PageSourceSearch

https://referware.vercel.app/_next/static/chunks/6709-99ee147ae17f3993.js

js referware.vercel.app collected 2026-10-03 07:36:07 UTC 1,304,257 bytes, 107 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6709],{46111:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CoinbaseWalletSDK=void 0;let n=r(5814),i=r(99285),s=r(97042),o=r(13603),a=r(61316),l=r(21130),u=r(88539),c=r(6580),h=r(49331),d=r(95832),f=r(54750);class p{constructor(e){var t,r,n;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;let a=e.linkAPIUrl||i.LINK_API_URL;void 0===e.overrideIsMetaMask?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=e.overrideIsMetaMask,this._overrideIsCoinbaseWallet=null===(t=e.overrideIsCoinbaseWallet)||void 0===t||t,this._overrideIsCoinbaseBrowser=null!==(r=e.overrideIsCoinbaseBrowser)&&void 0!==r&&r,this._diagnosticLogger=e.diagnosticLogger,this._reloadOnDisconnect=null===(n=e.reloadOnDisconnect)||void 0===n||n;let g=new URL(a),y=`${g.protocol}//${g.host}`;if(this._storage=new o.ScopedLocalStorage(`-walletlink:${y}`),this._storage.setItem("version",p.VERSION),this.walletExtension||this.coinbaseBrowser)return;this._relayEventManager=new c.RelayEventManager;let m=(0,s.isMobileWeb)(),v=e.uiConstructor||(e=>m?new u.MobileRelayUI(e):new h.WalletLinkRelayUI(e)),b={linkAPIUrl:a,version:f.LIB_VERSION,darkMode:!!e.darkMode,headlessMode:!!e.headlessMode,uiConstructor:v,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger,reloadOnDisconnect:this._reloadOnDisconnect,enableMobileWalletLink:e.enableMobileWalletLink};if(this._relay=m?new l.MobileRelay(b):new d.WalletLinkRelay(b),this.setAppInfo(e.appName,e.appLogoUrl),e.headlessMode)return;this._relay.attachUI()}makeWeb3Provider(e="",t=1){let r=this.walletExtension;if(r)return this.isCipherProvider(r)||r.setProviderInfo(e,t),!1===this._reloadOnDisconnect&&"function"==typeof r.disableReloadOnDisconnect&&r.disableReloadOnDisconnect(),r;let n=this.coinbaseBrowser;if(n)return n;let i=this._relay;if(!i||!this._relayEventManager||!this._storage)throw Error("Relay not initialized, should never happen");return e||i.setConnectDisabled(!0),new a.CoinbaseWalletProvider({relayProvider:()=>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})}setAppInfo(e,t){var r;this._appName=e||"DApp",this._appLogoUrl=t||(0,s.getFavicon)();let n=this.walletExtension;n?this.isCipherProvider(n)||n.setAppInfo(this._appName,this._appLogoUrl):null===(r=this._relay)||void 0===r||r.setAppInfo(this._appName,this._appLogoUrl)}disconnect(){var e;let t=this===null||void 0===this?void 0:this.walletExtension;t?t.close():null===(e=this._relay)||void 0===e||e.resetAndReload()}getQrUrl(){var e,t;return null!==(t=null===(e=this._relay)||void 0===e?void 0:e.getQRCodeUrl())&&void 0!==t?t:null}getCoinbaseWalletLogo(e,t=240){return(0,n.walletLogo)(e,t)}get walletExtension(){var e;return null!==(e=window.coinbaseWalletExtension)&&void 0!==e?e:window.walletLinkExtension}get coinbaseBrowser(){var e,t;try{let r=null!==(e=window.ethereum)&&void 0!==e?e:null===(t=window.top)||void 0===t?void 0:t.ethereum;if(!r)return;if("isCoinbaseBrowser"in r&&r.isCoinbaseBrowser)return r;return}catch(e){return}}isCipherProvider(e){return"boolean"==typeof e.isCipher&&e.isCipher}}t.CoinbaseWalletSDK=p,p.VERSION=f.LIB_VERSION},5814:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.walletLogo=void 0,t.walletLogo=(e,t)=>{let r;switch(e){case"standard":default:return r=t,`data:image/svg+xml,%3Csvg width='${t}' height='${r}' 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 r=t,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${t}' height='${r}
1' 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 r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' 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.61V
152.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' 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 r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' 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 r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' 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.8
11,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`}}},99285:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LINK_API_URL=void 0,t.LINK_API_URL="https://www.walletlink.org"},4406:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.errorValues=t.standardErrorCodes=void 0,t.standardErrorCodes={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,unsupportedChain:4902}},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."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}}},71839:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.standardErrors=void 0;let n=r(4406),i=r(86687);function s(e,t){let[r,n]=a(t);return new l(e,r||(0,i.getMessageFromCode)(e),n)}function o(e,t){let[r,n]=a(t);return new u(e,r||(0,i.getMessageFromCode)(e),n)}function a(e){if(e){if("string"==typeof e)return[e];if("object"==typeof e&&!Array.isArray(e)){let{message:t,data:r}=e;if(t&&"string"!=typeof t)throw Error("Must specify string message.");return[t||void 0,r]}}return[]}t.standardErrors={rpc:{parse:e=>s(n.standardErrorCodes.rpc.parse,e),invalidRequest:e=>s(n.standardErrorCodes.rpc.invalidRequest,e),invalidParams:e=>s(n.standardErrorCodes.rpc.invalidParams,e),methodNotFound:e=>s(n.standardErrorCodes.rpc.methodNotFound,e),internal:e=>s(n.standardErrorCodes.rpc.internal,e),server:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw Error("Ethereum RPC Server errors must provide single object argument.");let{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw Error('"code" must be an integer such that: -32099 <= code 
1<= -32005');return s(t,e)},invalidInput:e=>s(n.standardErrorCodes.rpc.invalidInput,e),resourceNotFound:e=>s(n.standardErrorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>s(n.standardErrorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>s(n.standardErrorCodes.rpc.transactionRejected,e),methodNotSupported:e=>s(n.standardErrorCodes.rpc.methodNotSupported,e),limitExceeded:e=>s(n.standardErrorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>o(n.standardErrorCodes.provider.userRejectedRequest,e),unauthorized:e=>o(n.standardErrorCodes.provider.unauthorized,e),unsupportedMethod:e=>o(n.standardErrorCodes.provider.unsupportedMethod,e),disconnected:e=>o(n.standardErrorCodes.provider.disconnected,e),chainDisconnected:e=>o(n.standardErrorCodes.provider.chainDisconnected,e),unsupportedChain:e=>o(n.standardErrorCodes.provider.unsupportedChain,e),custom:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw Error("Ethereum Provider custom errors must provide single object argument.");let{code:t,message:r,data:n}=e;if(!r||"string"!=typeof r)throw Error('"message" must be a nonempty string');return new u(t,r,n)}}};class l extends Error{constructor(e,t,r){if(!Number.isInteger(e))throw Error('"code" must be an integer.');if(!t||"string"!=typeof t)throw Error('"message" must be a nonempty string.');super(t),this.code=e,void 0!==r&&(this.data=r)}}class u extends l{constructor(e,t,r){if(!(Number.isInteger(e)&&e>=1e3&&e<=4999))throw Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,r)}}},39172:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.standardErrors=t.standardErrorCodes=t.serializeError=t.getMessageFromCode=t.getErrorCode=void 0;let n=r(4406);Object.defineProperty(t,"standardErrorCodes",{enumerable:!0,get:function(){return n.standardErrorCodes}});let i=r(71839);Object.defineProperty(t,"standardErrors",{enumerable:!0,get:function(){return i.standardErrors}});let s=r(47224);Object.defineProperty(t,"serializeError",{enumerable:!0,get:function(){return s.serializeError}});let o=r(86687);Object.defineProperty(t,"getErrorCode",{enumerable:!0,get:function(){return o.getErrorCode}}),Object.defineProperty(t,"getMessageFromCode",{enumerable:!0,get:function(){return o.getMessageFromCode}})},47224:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.serializeError=void 0;let n=r(44143),i=r(54750),s=r(4406),o=r(86687);t.serializeError=function(e,t){let r=(0,o.serialize)("string"==typeof e?{message:e,code:s.standardErrorCodes.rpc.internal}:(0,n.isErrorResponse)(e)?Object.assign(Object.assign({},e),{message:e.errorMessage,code:e.errorCode,data:{method:e.method}}):e,{shouldIncludeStack:!0}),a=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");a.searchParams.set("version",i.LIB_VERSION),a.searchParams.set("code",r.code.toString());let l=function(e,t){let r=null==e?void 0:e.method;if(r)return r;if(void 0===t);else if("string"==typeof t)return t;else if(!Array.isArray(t))return t.method;else if(t.length>0)return t[0].method}(r.data,t);return l&&a.searchParams.set("method",l),a.searchParams.set("message",r.message),Object.assign(Object.assign({},r),{docUrl:a.href})}},86687:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.serialize=t.getErrorCode=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;let n=r(4406),i="Unspecified error message.";function s(e,r=i){if(e&&Number.isInteger(e)){let r=e.toString();if(l(n.errorValues,r))return n.errorValues[r].message;if(e>=-32099&&e<=-32e3)return t.JSON_RPC_SERVER_ERROR_MESSAGE}return r}function o(e){if(!Number.isInteger(e))return!1;let t=e.toString();return!!(n.errorValues[t]||e>=-32099&&e<=-32e3)}function a(e){return e&&"object"==typeof e&&!Array.isArray(e)?Object.assign({},e):e}function l(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function u(e,t){return"object"==typeof e&&null!==e&&t in e&&"string"==typeof e[t]}t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",t.getMessageFromCode=s,t.isValidCode=o,t.getErrorCode=function(e){var t;return"number"==typeof e?e:"object"==typeof e&&null!==e&&("number"==typeof e.code||"number"==typeof e.errorCode)?null!==(t=e.code)&&void 0!==t?t:e.errorCode:void 0},t.serialize=function(e,{shouldIncludeStack:t=!1}={}){let r={};return e&&"object"==typeof e&&!Array.isArray(e)&&l(e,"code")&&o(e.code)?(r.code=e.code,e.message&&"string"==typeof e.message?(r.message=e.message,l(e,"data")&&(r.data=e.data)):(r.message=s(r.code),r.data={originalError:a(e)})):(r.code=n.standardErrorCodes.rpc.internal,r.message=u(e,"message")?e.message:i,r.data={originalError:a(e)}),t&&(r.stack=u(e,"stack")?e.stack:void 0),r}},91873:function(e,t){"use strict";var r,n;function i(){return e=>e}
1Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderType=t.RegExpString=t.IntNumber=t.BigIntString=t.AddressString=t.HexString=t.OpaqueType=void 0,t.OpaqueType=i,t.HexString=i(),t.AddressString=i(),t.BigIntString=i(),t.IntNumber=function(e){return Math.floor(e)},t.RegExpString=i(),(n=r||(t.ProviderType=r={})).CoinbaseWallet="CoinbaseWallet",n.MetaMask="MetaMask",n.Unselected=""},97042:function(e,t,r){"use strict";var n=r(9109).Buffer,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.isMobileWeb=t.getLocation=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;let s=i(r(58171)),o=r(39172),a=r(91873),l=/^[0-9]*$/,u=/^[a-f0-9]*$/;function c(e){return[...e].map(e=>e.toString(16).padStart(2,"0")).join("")}function h(e){return e.startsWith("0x")||e.startsWith("0X")}function d(e){return h(e)?e.slice(2):e}function f(e){return h(e)?`0x${e.slice(2)}`:`0x${e}`}function p(e){if("string"!=typeof e)return!1;let t=d(e).toLowerCase();return u.test(t)}function g(e,t=!1){if("string"==typeof e){let r=d(e).toLowerCase();if(u.test(r))return(0,a.HexString)(t?`0x${r}`:r)}throw o.standardErrors.rpc.invalidParams(`"${String(e)}" is not a hexadecimal string`)}function y(e,t=!1){let r=g(e,!1);return r.length%2==1&&(r=(0,a.HexString)(`0${r}`)),t?(0,a.HexString)(`0x${r}`):r}function m(e){if("number"==typeof e&&Number.isInteger(e))return(0,a.IntNumber)(e);if("string"==typeof e){if(l.test(e))return(0,a.IntNumber)(Number(e));if(p(e))return(0,a.IntNumber)(new s.default(y(e,!1),16).toNumber())}throw o.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}function v(e){if(null==e||"function"!=typeof e.constructor)return!1;let{constructor:t}=e;return"function"==typeof t.config&&"number"==typeof t.EUCLID}function b(){try{return null!==window.frameElement}catch(e){return!1}}t.randomBytesHex=function(e){return c(crypto.getRandomValues(new Uint8Array(e)))},t.uint8ArrayToHex=c,t.hexStringToUint8Array=function(e){return new Uint8Array(e.match(/.{1,2}/g).map(e=>parseInt(e,16)))},t.hexStringFromBuffer=function(e,t=!1){let r=e.toString("hex");return(0,a.HexString)(t?`0x${r}`:r)},t.bigIntStringFromBN=function(e){return(0,a.BigIntString)(e.toString(10))},t.intNumberFromHexString=function(e){return(0,a.IntNumber)(new s.default(y(e,!1),16).toNumber())},t.hexStringFromIntNumber=function(e){return(0,a.HexString)(`0x${new s.default(e).toString(16)}`)},t.has0xPrefix=h,t.strip0x=d,t.prepend0x=f,t.isHexString=p,t.ensureHexString=g,t.ensureEvenLengthHexString=y,t.ensureAddressString=function(e){if("string"==typeof e){let t=d(e).toLowerCase();if(p(t)&&40===t.length)return(0,a.AddressString)(f(t))}throw o.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(e)}`)},t.ensureBuffer=function(e){if(n.isBuffer(e))return e;if("string"==typeof e){if(p(e)){let t=y(e,!1);return n.from(t,"hex")}return n.from(e,"utf8")}throw o.standardErrors.rpc.invalidParams(`Not binary data: ${String(e)}`)},t.ensureIntNumber=m,t.ensureRegExpString=function(e){if(e instanceof RegExp)return(0,a.RegExpString)(e.toString());throw o.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(e)}`)},t.ensureBN=function(e){if(null!==e&&(s.default.isBN(e)||v(e)))return new s.default(e.toString(10),10);if("number"==typeof e)return new s.default(m(e));if("string"==typeof e){if(l.test(e))return new s.default(e,10);if(p(e))return new s.default(y(e,!1),16)}throw o.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)},t.ensureParsedJSONObject=function(e){if("string"==typeof e)return JSON.parse(e);if("object"==typeof e)return e;throw o.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(e)}`)},t.isBigNumber=v,t.range=function(e,t){return Array.from({length:t-e},(t,r)=>e+r)},t.getFavicon=function(){let e=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:t,host:r}=document.location,n=e?e.getAttribute("href"):null;return!n||n.startsWith("javascript:")||n.startsWith("vbscript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?t+n:`${t}//${r}${n}`},t.createQrUrl=function(e,t,r,n,i,s){let o=new URLSearchParams({[n?"parent-id":"id"]:e,secret:t,server:r,v:i,chainId:s.toString()}).toString();return`${r}/#/link?${o}`},t.isInIFrame=b,t.getLocation=function(){try{if(b()&&window.top)return window.top.location;return window.location}catch(e){return window.location}},t.isMobileWeb=function(){var e;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(null===(e=null==window?void 0:window.navigator)||void 0===e?void 0:e.userAgent)}},86080:function(e,t,r){"use strict";t.jp=void 0;let n=r(46111),i=r(61316);var s=r(46111);Object.defineProperty(t,"jp",{enumerable:!0,get:function(){return s.CoinbaseWalletSDK}}),r(61316),n.CoinbaseWalletSDK,"undefined"!=typeof window&&(window.CoinbaseWalletSDK=n.CoinbaseWalletSDK,window.CoinbaseWalletProvider=i.CoinbaseWalletProvider,window.WalletLink=n.CoinbaseWalletSDK,window.WalletLinkProvider=i.CoinbaseWalletProvider)},15677:function(e,t,r){"use strict";
1Object.defineProperty(t,"__esModule",{value:!0}),t.Cipher=void 0;let n=r(97042);class i{constructor(e){this.secret=e}async encrypt(e){let t=this.secret;if(64!==t.length)throw Error("secret must be 256 bits");let r=crypto.getRandomValues(new Uint8Array(12)),i=await crypto.subtle.importKey("raw",(0,n.hexStringToUint8Array)(t),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=new TextEncoder,o=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:r},i,s.encode(e)),a=o.slice(o.byteLength-16),l=o.slice(0,o.byteLength-16),u=new Uint8Array(a),c=new Uint8Array(l),h=new Uint8Array([...r,...u,...c]);return(0,n.uint8ArrayToHex)(h)}async decrypt(e){let t=this.secret;if(64!==t.length)throw Error("secret must be 256 bits");return new Promise((r,i)=>{!async function(){let s=await crypto.subtle.importKey("raw",(0,n.hexStringToUint8Array)(t),{name:"aes-gcm"},!1,["encrypt","decrypt"]),o=(0,n.hexStringToUint8Array)(e),a=o.slice(0,12),l=o.slice(12,28),u=new Uint8Array([...o.slice(28),...l]),c={name:"AES-GCM",iv:new Uint8Array(a)};try{let e=await window.crypto.subtle.decrypt(c,s,u),t=new TextDecoder;r(t.decode(e))}catch(e){i(e)}}()})}}t.Cipher=i},13603:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ScopedLocalStorage=void 0;class r{constructor(e){this.scope=e}setItem(e,t){localStorage.setItem(this.scopedKey(e),t)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){let e=this.scopedKey(""),t=[];for(let r=0;r<localStorage.length;r++){let n=localStorage.key(r);"string"==typeof n&&n.startsWith(e)&&t.push(n)}t.forEach(e=>localStorage.removeItem(e))}scopedKey(e){return`${this.scope}:${e}`}}t.ScopedLocalStorage=r},20877:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}'},75874:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esMo
1dule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.injectCssReset=void 0;let i=n(r(20877));t.injectCssReset=function(){let e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode(i.default)),document.documentElement.appendChild(e)}},61316:function(e,t,r){"use strict";var n=r(9109).Buffer,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoinbaseWalletProvider=void 0;let s=i(r(58171)),o=r(37836),a=r(39172),l=r(97042),u=r(21130),c=r(27825),h=r(61019),d=r(44143),f=i(r(80745)),p=r(4813),g=r(65057),y=r(73819),m="DefaultChainId",v="DefaultJsonRpcUrl";class b extends o.EventEmitter{constructor(e){var t,r;super(),this._filterPolyfill=new g.FilterPolyfill(this),this._subscriptionManager=new y.SubscriptionManager(this),this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1,this.setProviderInfo=this.setProviderInfo.bind(this),this.updateProviderInfo=this.updateProviderInfo.bind(this),this.getChainId=this.getChainId.bind(this),this.setAppInfo=this.setAppInfo.bind(this),this.enable=this.enable.bind(this),this.close=this.close.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this.request=this.request.bind(this),this._setAddresses=this._setAddresses.bind(this),this.scanQRCode=this.scanQRCode.bind(this),this.genericRequest=this.genericRequest.bind(this),this._chainIdFromOpts=e.chainId,this._jsonRpcUrlFromOpts=e.jsonRpcUrl,this._overrideIsMetaMask=e.overrideIsMetaMask,this._relayProvider=e.relayProvider,this._storage=e.storage,this._relayEventManager=e.relayEventManager,this.diagnostic=e.diagnosticLogger,this.reloadOnDisconnect=!0,this.isCoinbaseWallet=null===(t=e.overrideIsCoinbaseWallet)||void 0===t||t,this.isCoinbaseBrowser=null!==(r=e.overrideIsCoinbaseBrowser)&&void 0!==r&&r,this.qrUrl=e.qrUrl;let n=this.getChainId(),i=(0,l.prepend0x)(n.toString(16));this.emit("connect",{chainIdStr:i});let s=this._storage.getItem(c.LOCAL_STORAGE_ADDRESSES_KEY);if(s){let e=s.split(" ");""!==e[0]&&(this._addresses=e.map(e=>(0,l.ensureAddressString)(e)),this.emit("accountsChanged",e))}this._subscriptionManager.events.on("notification",e=>{this.emit("message",{type:e.method,data:e.params})}),this._isAuthorized()&&this.initializeRelay(),window.addEventListener("message",e=>{var t;if(e.origin===location.origin&&e.source===window&&"walletLinkMessage"===e.data.type&&"dappChainSwitched"===e.data.data.action){let r=e.data.data.chainId,n=null!==(t=e.data.data.jsonRpcUrl)&&void 0!==t?t:this.jsonRpcUrl;this.updateProviderInfo(n,Number(r))}})}get selectedAddress(){return this._addresses[0]||void 0}get networkVersion(){return this.getChainId().toString(10)}get chainId(){return(0,l.prepend0x)(this.getChainId().toString(16))}get isWalletLink(){return!0}get isMetaMask(){return this._overrideIsMetaMask}get host(){return this.jsonRpcUrl}get connected(){return!0}isConnected(){return!0}get jsonRpcUrl(){var e;return null!==(e=this._storage.getItem(v))&&void 0!==e?e:this._jsonRpcUrlFromOpts}set jsonRpcUrl(e){this._storage.setItem(v,e)}disableReloadOnDisconnect(){this.reloadOnDisconnect=!1}setProviderInfo(e,t){this.isCoinbaseBrowser||(this._chainIdFromOpts=t,this._jsonRpcUrlFromOpts=e),this.updateProviderInfo(this.jsonRpcUrl,this.getChainId())}updateProviderInfo(e,t){this.jsonRpcUrl=e;let r=this.getChainId();this._storage.setItem(m,t.toString(10)),(0,l.ensureIntNumber)(t)===r&&this.hasMadeFirstChainChangedEmission||(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(e,t,r,n,i,s){let o=await this.initializeRelay(),a=await o.watchAsset(e,t,r,n,i,null==s?void 0:s.toString()).promise;return!(0,d.isErrorResponse)(a)&&!!a.result}async addEthereumChain(e,t,r,n,i,s){var o,a;if((0,l.ensureIntNumber)(e)===this.getChainId())return!1;let u=await this.initializeRelay(),c=u.inlineAddEthereumChain(e.toString());this._isAuthorized()||c||await u.requestEthereumAccounts().promise;let h=await u.addEthereumChain(e.toString(),t,i,r,n,s).promise;return!(0,d.isErrorResponse)(h)&&((null===(o=h.result)||void 0===o?void 0:o.isApproved)===!0&&this.updateProviderInfo(t[0],e),(null===(a=h.result)||void 0===a?void 0:a.isApproved)===!0)}async switchEthereumChain(e){let t=await this.initializeRelay(),r=await t.switchEthereumChain(e.toString(10),this.selectedAddress||void 0).promise;if((0,d.isErrorResponse)(r)){if(!r.errorCode)return;if(r.errorCode===a.standardErrorCodes.provider.unsupportedChain)throw a.standardErrors.provider.unsupportedChain();throw a.standardErrors.provider.custom({message:r.errorMessage,code:r.errorCode})}let n=r.result;n.isApproved&&n.rpcUrl.length>0&&this.updateProviderInfo(n.rpcUrl,e)}setAppInfo(e,t){this.initializeRelay().then(r=>r.setAppInfo(e,t))}async enable(){var e;return(null===(e=this.diagnostic)||void 0===e||e.log(p.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?h.Session.hash(this._relay.session.id):void 0}),this._isAuthorized())?[...this._addresses]:await this.send("eth_requestAccounts")}async close(){(await this.initializeRelay()).resetAndReload()}send(e,t){try{let r=this._send(e,t);if(r instanceof Promise)return r.catch(t=>
1{throw(0,a.serializeError)(t,e)})}catch(t){throw(0,a.serializeError)(t,e)}}_send(e,t){if("string"==typeof e){let r=Array.isArray(t)?t:void 0!==t?[t]:[];return this._sendRequestAsync({jsonrpc:"2.0",id:0,method:e,params:r}).then(e=>e.result)}return"function"==typeof t?this._sendAsync(e,t):Array.isArray(e)?e.map(e=>this._sendRequest(e)):this._sendRequest(e)}async sendAsync(e,t){try{return this._sendAsync(e,t).catch(t=>{throw(0,a.serializeError)(t,e)})}catch(t){return Promise.reject((0,a.serializeError)(t,e))}}async _sendAsync(e,t){if("function"!=typeof t)throw Error("callback is required");if(Array.isArray(e)){this._sendMultipleRequestsAsync(e).then(e=>t(null,e)).catch(e=>t(e,null));return}return this._sendRequestAsync(e).then(e=>t(null,e)).catch(e=>t(e,null))}async request(e){try{return this._request(e).catch(t=>{throw(0,a.serializeError)(t,e.method)})}catch(t){return Promise.reject((0,a.serializeError)(t,e.method))}}async _request(e){if(!e||"object"!=typeof e||Array.isArray(e))throw a.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:e});let{method:t,params:r}=e;if("string"!=typeof t||0===t.length)throw a.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:e});if(void 0!==r&&!Array.isArray(r)&&("object"!=typeof r||null===r))throw a.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:e});let n=void 0===r?[]:r,i=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:t,params:n,jsonrpc:"2.0",id:i})).result}async scanQRCode(e){let t=await this.initializeRelay(),r=await t.scanQRCode((0,l.ensureRegExpString)(e)).promise;if((0,d.isErrorResponse)(r))throw(0,a.serializeError)(r.errorMessage,"scanQRCode");if("string"!=typeof r.result)throw(0,a.serializeError)("result was not a string","scanQRCode");return r.result}async genericRequest(e,t){let r=await this.initializeRelay(),n=await r.genericRequest(e,t).promise;if((0,d.isErrorResponse)(n))throw(0,a.serializeError)(n.errorMessage,"generic");if("string"!=typeof n.result)throw(0,a.serializeError)("result was not a string","generic");return n.result}async connectAndSignIn(e){var t;let r;null===(t=this.diagnostic)||void 0===t||t.log(p.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::connectAndSignIn",sessionIdHash:this._relay?h.Session.hash(this._relay.session.id):void 0});try{let t=await this.initializeRelay();if(!(t instanceof u.MobileRelay))throw Error("connectAndSignIn is only supported on mobile");if(r=await t.connectAndSignIn(e).promise,(0,d.isErrorResponse)(r))throw Error(r.errorMessage)}catch(e){if("string"==typeof e.message&&e.message.match(/(denied|rejected)/i))throw a.standardErrors.provider.userRejectedRequest("User denied account authorization");throw e}if(!r.result)throw Error("accounts received is empty");let{accounts:n}=r.result;return this._setAddresses(n),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),r.result}async selectProvider(e){let t=await this.initializeRelay(),r=await t.selectProvider(e).promise;if((0,d.isErrorResponse)(r))throw(0,a.serializeError)(r.errorMessage,"selectProvider");if("string"!=typeof r.result)throw(0,a.serializeError)("result was not a string","selectProvider");return r.result}supportsSubscriptions(){return!1}subscribe(){throw Error("Subscriptions are not supported")}unsubscribe(){throw Error("Subscriptions are not supported")}disconnect(){return!0}_sendRequest(e){let t={jsonrpc:"2.0",id:e.id},{method:r}=e;if(t.result=this._handleSynchronousMethods(e),void 0===t.result)throw Error(`Coinbase Wallet does not support calling ${r} synchronously without a callback. Please provide a callback parameter to call ${r} asynchronously.`);return t}_setAddresses(e,t){if(!Array.isArray(e))throw Error("addresses is not an array");let r=e.map(e=>(0,l.ensureAddressString)(e));JSON.stringify(r)!==JSON.stringify(this._addresses)&&(this._addresses=r,this.emit("accountsChanged",this._addresses),this._storage.setItem(c.LOCAL_STORAGE_ADDRESSES_KEY,r.join(" ")))}_sendRequestAsync(e){return new Promise((t,r)=>{try{let n=this._handleSynchronousMethods(e);if(void 0!==n)return t({jsonrpc:"2.0",id:e.id,result:n});let i=this._handleAsynchronousFilterMethods(e);if(void 0!==i){i.then(r=>t(Object.assign(Object.assign({},r),{id:e.id}))).catch(e=>r(e));return}let s=this._handleSubscriptionMethods(e);if(void 0!==s){s.then(r=>
1t({jsonrpc:"2.0",id:e.id,result:r.result})).catch(e=>r(e));return}}catch(e){return r(e)}this._handleAsynchronousMethods(e).then(r=>r&&t(Object.assign(Object.assign({},r),{id:e.id}))).catch(e=>r(e))})}_sendMultipleRequestsAsync(e){return Promise.all(e.map(e=>this._sendRequestAsync(e)))}_handleSynchronousMethods(e){let{method:t}=e,r=e.params||[];switch(t){case"eth_accounts":return this._eth_accounts();case"eth_coinbase":return this._eth_coinbase();case"eth_uninstallFilter":return this._eth_uninstallFilter(r);case"net_version":return this._net_version();case"eth_chainId":return this._eth_chainId();default:return}}async _handleAsynchronousMethods(e){let{method:t}=e,r=e.params||[];switch(t){case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_sign":return this._eth_sign(r);case"eth_ecRecover":return this._eth_ecRecover(r);case"personal_sign":return this._personal_sign(r);case"personal_ecRecover":return this._personal_ecRecover(r);case"eth_signTransaction":return this._eth_signTransaction(r);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(r);case"eth_sendTransaction":return this._eth_sendTransaction(r);case"eth_signTypedData_v1":return this._eth_signTypedData_v1(r);case"eth_signTypedData_v2":return this._throwUnsupportedMethodError();case"eth_signTypedData_v3":return this._eth_signTypedData_v3(r);case"eth_signTypedData_v4":case"eth_signTypedData":return this._eth_signTypedData_v4(r);case"cbWallet_arbitrary":return this._cbwallet_arbitrary(r);case"wallet_addEthereumChain":return this._wallet_addEthereumChain(r);case"wallet_switchEthereumChain":return this._wallet_switchEthereumChain(r);case"wallet_watchAsset":return this._wallet_watchAsset(r)}return(await this.initializeRelay()).makeEthereumJSONRPCRequest(e,this.jsonRpcUrl).catch(t=>{var r;throw(t.code===a.standardErrorCodes.rpc.methodNotFound||t.code===a.standardErrorCodes.rpc.methodNotSupported)&&(null===(r=this.diagnostic)||void 0===r||r.log(p.EVENTS.METHOD_NOT_IMPLEMENTED,{method:e.method,sessionIdHash:this._relay?h.Session.hash(this._relay.session.id):void 0})),t})}_handleAsynchronousFilterMethods(e){let{method:t}=e,r=e.params||[];switch(t){case"eth_newFilter":return this._eth_newFilter(r);case"eth_newBlockFilter":return this._eth_newBlockFilter();case"eth_newPendingTransactionFilter":return this._eth_newPendingTransactionFilter();case"eth_getFilterChanges":return this._eth_getFilterChanges(r);case"eth_getFilterLogs":return this._eth_getFilterLogs(r)}}_handleSubscriptionMethods(e){switch(e.method){case"eth_subscribe":case"eth_unsubscribe":return this._subscriptionManager.handleRequest(e)}}_isKnownAddress(e){try{let t=(0,l.ensureAddressString)(e);return this._addresses.map(e=>(0,l.ensureAddressString)(e)).includes(t)}catch(e){}return!1}_ensureKnownAddress(e){var t;if(!this._isKnownAddress(e))throw null===(t=this.diagnostic)||void 0===t||t.log(p.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),Error("Unknown Ethereum address")}_prepareTransactionParams(e){let t=e.from?(0,l.ensureAddressString)(e.from):this.selectedAddress;if(!t)throw Error("Ethereum address is unavailable");this._ensureKnownAddress(t);let r=e.to?(0,l.ensureAddressString)(e.to):null,i=null!=e.value?(0,l.ensureBN)(e.value):new s.default(0),o=e.data?(0,l.ensureBuffer)(e.data):n.alloc(0),a=null!=e.nonce?(0,l.ensureIntNumber)(e.nonce):null,u=null!=e.gasPrice?(0,l.ensureBN)(e.gasPrice):null,c=null!=e.maxFeePerGas?(0,l.ensureBN)(e.maxFeePerGas):null;return{fromAddress:t,toAddress:r,weiValue:i,data:o,nonce:a,gasPriceInWei:u,maxFeePerGas:c,maxPriorityFeePerGas:null!=e.maxPriorityFeePerGas?(0,l.ensureBN)(e.maxPriorityFeePerGas):null,gasLimit:null!=e.gas?(0,l.ensureBN)(e.gas):null,chainId:e.chainId?(0,l.ensureIntNumber)(e.chainId):this.getChainId()}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw a.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw a.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(e,t,r,n){this._ensureKnownAddress(t);try{let i=await this.initializeRelay(),s=await i.signEthereumMessage(e,t,r,n).promise;if((0,d.isErrorResponse)(s))throw Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}catch(e){if("string"==typeof e.message&&e.message.match(/(denied|rejected)/i))throw a.standardErrors.provider.userRejectedRequest("User denied message signature");throw e}}async _ethereumAddressFromSignedMessage(e,t,r){let n=await this.initializeRelay(),i=await n.ethereumAddressFromSignedMessage(e,t,r).promise;if((0,d.isErrorResponse)(i))throw Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,l.hexStringFromIntNumber)(this.getChainId())}getChainId(){let e=this._storage.getItem(m);if(!e)return(0,l.ensureIntNumber)(this._chainIdFromOpts);let t=parseInt(e,10);return(0,l.ensureIntNumber)(t)}async _eth_requestAccounts(){var e;let t;if(null===(e=this.diagnostic)||void 0===e||e.log(p.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?h.Session.hash(this._relay.session.id):void 0}),this._isAuthorized())return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});try{let e=await this.initializeRelay();if(t=await e.requestEthereumAccounts().promise,(0,d.isErrorResponse)(t))throw Error(t.errorMessage)}catch(e){if("string"==typeof e.message&&e.message.match(/(denied|rejected)/i))throw a.standardErrors.provider.userRejectedRequest("User denied account authorization");throw e}if(!t.result)throw Error("accounts received is empty");return this._setAddresses(t.result),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(e){this._requireAuthorization();let t=(0,l.ensureAddressString)(e[0]),r=(0,l.ensureBuffer)(e[1]);return this._signEthereumMessage(r,t,!1)}_eth_ecRecover(e){let t=(0,l.ensureBuffer)(e[0]),r=(0,l.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(t,r,!1)}_personal_sign(e){this._requireAuthorization();let t=(0,l.ensureBuffer)(e[0]),r=(0,l.ensureAddressString)(e[1]);return this._signEthereumMessage(t,r,!0)}_personal_ecRecover(e){let t=(0,l.ensureBuffer)(e[0]),r=(0,l.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(t,r,!0)}async _eth_signTransaction(e){this._requireAuthorization();let t=this._prepareTransactionParams(e[0]||{});try{let e=await this.initializeRelay(),r=await e.signEthereumTransaction(t).promise;if((0,d.isErrorResponse)(r))throw Error(r.errorMessage);return{jsonrpc:"2.0",id:0,result:r.result}}catch(e){if("string"==typeof e.message&&e.message.match(/(denied|rejected)/i))throw a.standardErrors.provider.userRejectedRequest("User denied transaction signature");throw e}}async _eth_sendRawTransaction(e){let t=(0,l.ensureBuffer)(e[0]),r=await this.initializeRelay(),n=await r.submitEthereumTransaction(t,this.getChainId()).promise;if((0,d.isErrorResponse)(n))throw Error(n.errorMessage);return{jsonrpc:"2.0",id:0,result:n.result}}async _eth_sendTransaction(e){this._requireAuthorization();let t=this._prepareTransactionParams(e[0]||{});try{let e=await this.initializeRelay(),r=await e.signAndSubmitEthereumTransaction(t).promise;if((0,d.isErrorResponse)(r))throw Error(r.errorMessage);return{jsonrpc:"2.0",id:0,result:r.result}}catch(e){if("string"==typeof e.message&&e.message.match(/(denied|rejected)/i))throw a.standardErrors.provider.userRejectedRequest("User denied transaction signature");throw e}}async _eth_signTypedData_v1(e){this._requireAuthorization();let t=(0,l.ensureParsedJSONObject)(e[0]),r=(0,l.ensureAddressString)(e[1]);this._ensureKnownAddress(r);let n=f.default.hashForSignTypedDataLegacy({data:t}),i=JSON.stringify(t,null,2);return this._signEthereumMessage(n,r,!1,i)}async _eth_signTypedData_v3(e){this._requireAuthorization();let t=(0,l.ensureAddressString)(e[0]),r=(0,l.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(t);let n=f.default.hashForSignTypedData_v3({data:r}),i=JSON.stringify(r,null,2);return this._signEthereumMessage(n,t,!1,i)}async _eth_signTypedData_v4(e){this._requireAuthorization();let t=(0,l.ensureAddressString)(e[0]),r=(0,l.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(t);let n=f.default.hashForSignTypedData_v4({data:r}),i=JSON.stringify(r,null,2);return this._signEthereumMessage(n,t,!1,i)}async _cbwallet_arbitrary(e){let t=e[0],r=e[1];if("string"!=typeof r)throw Error("parameter must be a string");if("object"!=typeof t||null===t)throw Error("parameter must be an object");return{jsonrpc:"2.0",id:0,result:await this.genericRequest(t,r)}}async _wallet_addEthereumChain(e){var t,r,n,i;let s=e[0];if((null===(t=s.rpcUrls)||void 0===t?void 0:t.length)===0)return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!s.chainName||""===s.chainName.trim())throw a.standardErrors.rpc.invalidParams("chainName is a required field");if(!s.nativeCurrency)throw a.standardErrors.rpc.invalidParams("nativeCurrency is a required field");let o=parseInt(s.chainId,16);return await this.addEthereumChain(o,null!==(r=s.rpcUrls)&&void 0!==r?r:[],null!==(n=s.blockExplorerUrls)&&void 0!==n?n:[],s.chainName,null!==(i=s.iconUrls)&&void 0!==i?i:[],s.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(e){let t=e[0];return await this.switchEthereumChain(parseInt(t.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(e){let t=Array.isArray(e)?e[0]:e;if(!t.type)throw a.standardErrors.rpc.invalidParams("Type is required");if((null==t?void 0:t.type)!=="ERC20")throw a.standardErrors.rpc.invalidParams(`Asset of type '${t.type}' is not supported`);if(!(null==t?void 0:t.options))throw a.standardErrors.rpc.invalidParams("Options are required");if(!(null==t?void 0:t.options.address))throw a.standardErrors.rpc.invalidParams("Address is required");let r=this.getChainId(),{address:n,symbol:i,image:s,decimals:o}=t.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(t.type,n,i,o,s,r)}}_eth_uninstallFilter(e){let t=(0,l.ensureHexString)(e[0]);return this._filterPolyfill.uninstallFilter(t)}async _eth_newFilter(e){let t=e[0];return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newFilter(t)}}async _eth_newBlockFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newBlockFilter()}}async _eth_newPendingTransactionFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newPendingTransactionFilter()}}_eth_getFilterChanges(e){let t=(0,l.ensureHexString)(e[0]);return this._filterPolyfill.getFilterChanges(t)}_eth_getFilterLogs(e){let t=(0,l.ensureHexString)(e[0]);return this._filterPolyfill.getFilterLogs(t)}initializeRelay(){return this._relay?Promise.resolve(this._relay):this._relayProvider().then(e=>(e.setAccountsCallback((e,t)=>this._setAddresses(e,t)),e.setChainCallback((e,t)=>{this.updateProviderInfo(t,parseInt(e,10))}),e.setDappDefaultChainCallback(this._chainIdFromOpts),this._relay=e,e))}}t.CoinbaseWalletProvider=b},4813:function(e,t){"use strict";
1Object.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",METHOD_NOT_IMPLEMENTED:"walletlink_sdk.method_not_implemented",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"}},65057:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.filterFromParam=t.FilterPolyfill=void 0;let n=r(91873),i=r(97042),s={jsonrpc:"2.0",id:0};class o{constructor(e){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,n.IntNumber)(1),this.REQUEST_THROTTLE_INTERVAL=1e3,this.lastFetchTimestamp=new Date(0),this.resolvers=[],this.provider=e}async newFilter(e){let t=a(e),r=this.makeFilterId(),n=await this.setInitialCursorPosition(r,t.fromBlock);return console.info(`Installing new log filter(${r}):`,t,"initial cursor position:",n),this.logFilters.set(r,t),this.setFilterTimeout(r),(0,i.hexStringFromIntNumber)(r)}async newBlockFilter(){let e=this.makeFilterId(),t=await this.setInitialCursorPosition(e,"latest");return console.info(`Installing new block filter (${e}) with initial cursor position:`,t),this.blockFilters.add(e),this.setFilterTimeout(e),(0,i.hexStringFromIntNumber)(e)}async newPendingTransactionFilter(){let e=this.makeFilterId(),t=await this.setInitialCursorPosition(e,"latest");return console.info(`Installing new block filter (${e}) with initial cursor position:`,t),this.pendingTransactionFilters.add(e),this.setFilterTimeout(e),(0,i.hexStringFromIntNumber)(e)}uninstallFilter(e){let t=(0,i.intNumberFromHexString)(e);return console.info(`Uninstalling filter (${t})`),this.deleteFilter(t),!0}getFilterChanges(e){let t=(0,i.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(h())}async getFilterLogs(e){let t=(0,i.intNumberFromHexString)(e),r=this.logFilters.get(t);return r?this.sendAsyncPromise(Object.assign(Object.assign({},s),{method:"eth_getLogs",params:[l(r)]})):h()}makeFilterId(){return(0,n.IntNumber)(++this.nextFilterId)}sendAsyncPromise(e){return new Promise((t,r)=>{this.provider.sendAsync(e,(e,n)=>e?r(e):Array.isArray(n)||null==n?r(Error(`unexpected response received: ${JSON.stringify(n)}`)):void t(n))})}deleteFilter(e){console.info(`Deleting filter (${e})`),this.logFilters.delete(e),this.blockFilters.delete(e),this.pendingTransactionFilters.delete(e),this.cursors.delete(e),this.timeouts.delete(e)}async getLogFilterChanges(e){let t=this.logFilters.get(e),r=this.cursors.get(e);if(!r||!t)return h();let o=await this.getCurrentBlockHeight(),a="latest"===t.toBlock?o:t.toBlock;if(r>o||r>Number(t.toBlock))return d();console.info(`Fetching logs from ${r} to ${a} for filter ${e}`);let u=await this.sendAsyncPromise(Object.assign(Object.assign({},s),{method:"eth_getLogs",params:[l(Object.assign(Object.assign({},t),{fromBlock:r,toBlock:a}))]}));if(Array.isArray(u.result)){let t=Math.max(...u.result.map(e=>(0,i.intNumberFromHexString)(e.blockNumber||"0x0")));if(t&&t>r){let i=(0,n.IntNumber)(t+1);console.info(`Moving cursor position for filter (${e}) from ${r} to ${i}`),this.cursors.set(e,i)}}return u}async getBlockFilterChanges(e){let t=this.cursors.get(e);if(!t)return h();let r=await this.getCurrentBlockHeight();if(t>r)return d();console.info(`Fetching blocks from ${t} to ${r} for filter (${e})`);let o=(await Promise.all((0,i.range)(t,r+1).map(e=>this.getBlockHashByNumber((0,n.IntNumber)(e))))).filter(e=>!!e),a=(0,n.IntNumber)(t+o.length);return console.info(`Moving cursor position for filter (${e}) from ${t} to ${a}`),this.cursors.set(e,a),Object.assign(Object.assign({},s),{result:o})}async getPendingTransactionFilterChanges(e){return Promise.resolve(d())}async setInitialCursorPosition(e,t){let r=await this.getCurrentBlockHeight(),n="number"==typeof t&&t>r?t:r;return this.cursors.set(e,n),n}setFilterTimeout(e){let t=this.timeouts.get(e);t&&window.clearTimeout(t);let r=window.setTimeout(()=>{console.info(`Filter (${e}) timed out`),this.deleteFilter(e)},3e5);this.timeouts.set(e,r)}async getCurrentBlockHeight(){let e=new Date;if(e.getTime()-this.lastFetchTimestamp.getTime()>this.REQUEST_THROTTLE_INTERVAL){this.lastFetchTimestamp=e;let t=await this._getCurrentBlockHeight();
1this.currentBlockHeight=t,this.resolvers.forEach(e=>e(t)),this.resolvers=[]}return this.currentBlockHeight?this.currentBlockHeight:new Promise(e=>this.resolvers.push(e))}async _getCurrentBlockHeight(){let{result:e}=await this.sendAsyncPromise(Object.assign(Object.assign({},s),{method:"eth_blockNumber",params:[]}));return(0,i.intNumberFromHexString)((0,i.ensureHexString)(e))}async getBlockHashByNumber(e){let t=await this.sendAsyncPromise(Object.assign(Object.assign({},s),{method:"eth_getBlockByNumber",params:[(0,i.hexStringFromIntNumber)(e),!1]}));return t.result&&"string"==typeof t.result.hash?(0,i.ensureHexString)(t.result.hash):null}}function a(e){return{fromBlock:u(e.fromBlock),toBlock:u(e.toBlock),addresses:void 0===e.address?null:Array.isArray(e.address)?e.address:[e.address],topics:e.topics||[]}}function l(e){let t={fromBlock:c(e.fromBlock),toBlock:c(e.toBlock),topics:e.topics};return null!==e.addresses&&(t.address=e.addresses),t}function u(e){if(void 0===e||"latest"===e||"pending"===e)return"latest";if("earliest"===e)return(0,n.IntNumber)(0);if((0,i.isHexString)(e))return(0,i.intNumberFromHexString)(e);throw Error(`Invalid block option: ${String(e)}`)}function c(e){return"latest"===e?e:(0,i.hexStringFromIntNumber)(e)}function h(){return Object.assign(Object.assign({},s),{error:{code:-32e3,message:"filter not found"}})}function d(){return Object.assign(Object.assign({},s),{result:[]})}t.FilterPolyfill=o,t.filterFromParam=a},73819:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SubscriptionManager=void 0;let n=r(15951),i=r(23617),s=()=>{};class o{constructor(e){let{events:t,middleware:r}=i({blockTracker:new n.PollingBlockTracker({provider:e,pollingInterval:15e3,setSkipCacheFlag:!0}),provider:e});this.events=t,this.subscriptionMiddleware=r}async handleRequest(e){let t={};return await this.subscriptionMiddleware(e,t,s,s),t}destroy(){this.subscriptionMiddleware.destroy()}}t.SubscriptionManager=o},27825:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RelayAbstract=t.APP_VERSION_KEY=t.LOCAL_STORAGE_ADDRESSES_KEY=t.WALLET_USER_NAME_KEY=void 0;let n=r(39172);t.WALLET_USER_NAME_KEY="walletUsername",t.LOCAL_STORAGE_ADDRESSES_KEY="Addresses",t.APP_VERSION_KEY="AppVersion";class i{async makeEthereumJSONRPCRequest(e,t){if(!t)throw Error("Error: No jsonRpcUrl provided");return window.fetch(t,{method:"POST",body:JSON.stringify(e),mode:"cors",headers:{"Content-Type":"application/json"}}).then(e=>e.json()).then(t=>{if(!t)throw n.standardErrors.rpc.parse({});let{error:r}=t;if(r)throw(0,n.serializeError)(r,e.method);return t})}}t.RelayAbstract=i},6580:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RelayEventManager=void 0;let n=r(97042);class i{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;let e=this._nextRequestId,t=(0,n.prepend0x)(e.toString(16));return this.callbacks.get(t)&&this.callbacks.delete(t),e}}t.RelayEventManager=i},61019:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Session=void 0;let n=r(42724),i=r(97042),s="session:id",o="session:secret",a="session:linked";class l{constructor(e,t,r,s){this._storage=e,this._id=t||(0,i.randomBytesHex)(16),this._secret=r||(0,i.randomBytesHex)(32),this._key=new n.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!s}static load(e){let t=e.getItem(s),r=e.getItem(a),n=e.getItem(o);return t&&n?new l(e,t,n,"1"===r):null}static hash(e){return new n.sha256().update(e).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(e){this._linked=e,this.persistLinked()}save(){return this._storage.setItem(s,this._id),this._storage.setItem(o,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(a,this._linked?"1":"0")}}t.Session=l},21130:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MobileRelay=void 0;let n=r(97042),i=r(95832),s=r(88539);class o extends i.WalletLinkRelay{constructor(e){var t;super(e),this._enableMobileWalletLink=null!==(t=e.enableMobileWalletLink)&&void 0!==t&&t}requestEthereumAccounts(){return this._enableMobileWalletLink?super.requestEthereumAccounts():{promise:new Promise(()=>{let e=(0,n.getLocation)();e.href=`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(e.href)}`}),cancel:()=>{}}}publishWeb3RequestEvent(e,t){if(super.publishWeb3RequestEvent(e,t),!(this._enableMobileWalletLink&&this.ui instanceof s.MobileRelayUI))return;let r=!1;switch(t.method){case"requestEthereumAccounts":case"connectAndSignIn":r=!0,this.ui.openCoinbaseWalletDeeplink(this.getQRCodeUrl());break;case"switchEthereumChain":return;default:r=!0,this.ui.openCoinbaseWalletDeeplink()}r&&window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0})}handleWeb3ResponseMessage(e){super.handleWeb3ResponseMessage(e)}connectAndSignIn(e){if(!this._enableMobileWalletLink)throw Error("connectAndSignIn is supported only when enableMobileWalletLink is on");return this.sendRequest({method:"connectAndSignIn",params:{appName:this.appName,a
1ppLogoUrl:this.appLogoUrl,domain:window.location.hostname,aud:window.location.href,version:"1",type:"eip4361",nonce:e.nonce,iat:new Date().toISOString(),chainId:`eip155:${this.dappDefaultChain}`,statement:e.statement,resources:e.resources}})}}t.MobileRelay=o},88539:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MobileRelayUI=void 0;let n=r(45281);class i{constructor(e){this.attached=!1,this.darkMode=!1,this.redirectDialog=new n.RedirectDialog,this.darkMode=e.darkMode}attach(){if(this.attached)throw Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}setConnected(e){}redirectToCoinbaseWallet(e){let t=new URL("https://go.cb-w.com/walletlink");t.searchParams.append("redirect_url",window.location.href),e&&t.searchParams.append("wl_url",e);let r=document.createElement("a");r.target="cbw-opener",r.href=t.href,r.rel="noreferrer noopener",r.click()}openCoinbaseWalletDeeplink(e){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",darkMode:this.darkMode,onButtonClick:()=>{this.redirectToCoinbaseWallet(e)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(e)},99)}showConnecting(e){return()=>{this.redirectDialog.clear()}}hideRequestEthereumAccounts(){this.redirectDialog.clear()}requestEthereumAccounts(){}addEthereumChain(){}watchAsset(){}selectProvider(){}switchEthereumChain(){}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}reloadUI(){}setStandalone(){}setConnectDisabled(){}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}isStandalone(){return!1}}t.MobileRelayUI=i},95832:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WalletLinkRelay=void 0;let n=r(39172),i=r(91873),s=r(97042),o=r(4813),a=r(27825),l=r(61019),u=r(26177),c=r(44143),h=r(49331);class d extends a.RelayAbstract{constructor(e){var t;super(),this.accountsCallback=null,this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.chainCallback=null,this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.linkedUpdated=e=>{var t;this.isLinked=e;let r=this.storage.getItem(a.LOCAL_STORAGE_ADDRESSES_KEY);if(e&&(this.session.linked=e),this.isUnlinkedErrorState=!1,r){let n=r.split(" "),i="true"===this.storage.getItem("IsStandaloneSigning");if(""!==n[0]&&!e&&this.session.linked&&!i){this.isUnlinkedErrorState=!0;let e=this.getSessionIdHash();null===(t=this.diagnostic)||void 0===t||t.log(o.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:e})}}},this.metadataUpdated=(e,t)=>{this.storage.setItem(e,t)},this.chainUpdated=(e,t)=>{(this.chainCallbackParams.chainId!==e||this.chainCallbackParams.jsonRpcUrl!==t)&&(this.chainCallbackParams={chainId:e,jsonRpcUrl:t},this.chainCallback&&this.chainCallback(e,t))},this.accountUpdated=e=>{this.accountsCallback&&this.accountsCallback([e]),d.accountRequestCallbackIds.size>0&&(Array.from(d.accountRequestCallbackIds.values()).forEach(t=>{this.invokeCallback(Object.assign(Object.assign({},{type:"WEB3_RESPONSE",id:t,response:{method:"requestEthereumAccounts",result:[e]}}),{id:t}))}),d.accountRequestCallbackIds.clear())},this.connectedUpdated=e=>{this.ui.setConnected(e)},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=e.linkAPIUrl,this.storage=e.storage,this.options=e;let{session:r,ui:n,connection:i}=this.subscribe();this._session=r,this.connection=i,this.relayEventManager=e.relayEventManager,this.diagnostic=e.diagnosticLogger,this._reloadOnDisconnect=null===(t=e.reloadOnDisconnect)||void 0===t||t,this.ui=n}subscribe(){let e=l.Session.load(this.storage)||new l.Session(this.storage).save(),{linkAPIUrl:t,diagnostic:r}=this,n=new u.WalletLinkConnection({session:e,linkAPIUrl:t,diagnostic:r,listener:this}),{version:i,darkMode:s}=this.options,o=this.options.uiConstructor({linkAPIUrl:t,version:i,darkMode:s,session:e});return n.connect(),{session:e,ui:o,connection:n}}attachUI(){this.ui.attach()}resetAndReload(){Promise.race([this.connection.setSessionMetadata("__destroyed","1"),new Promise(e=>setTimeout(()=>e(null),1e3))]).then(()=>{var e,t;let r=this.ui.isStandalone();null===(e=this.diagnostic)||void 0===e||e.log(o.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();let n=l.Session.load(this.storage);if((null==n?void 0:n.id)===this._session.id?this.storage.clear():n&&(null===(t=this.diagnostic)||void 0===t||t.log(o.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:l.Session.hash(n.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0);let{session:i,ui:s,connection:a}=this.subscribe();this._session=i,this.connection=a,this.ui=s,r&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.options.headlessMode||this.attachUI()}).catch(e=>{var t;null===(t=this.diagnostic)||void 0===t||t.log(o.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${e}`,sessionIdHash:this.getSessionIdHash()})})}setAppInfo(e,t){this.appName=e,this.appLogoUrl=t}getStorageItem(e){return this.storage.getItem(e)}get session(){return this._session}setStorageItem(e,t){this.storage.setItem(e,t)}signEthereumMessage(e,t,r,n){return this.sendRequest({method:"signEthereumMessage",params:{message:(0,s.hexStringFromBuffer)(e,!0),address:t,addPrefix:r,typedDataJson:n||null}})}ethereumAddressFromSignedMessage(e,t,r){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,s.hexStringFromBuffer)(e,!0),signature:(0,s.hexStringFromBuffer)(t,!0),addPrefix:r}})}signEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,s.bigIntStringFromBN)(e.weiValue),data:(0,s.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,s.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?(0,s.bigIntStringFromBN)(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?(0,s.bigIntStringFromBN)(e.gasPriceInWei):null,gasLimit:e.gasLim
1it?(0,s.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,s.bigIntStringFromBN)(e.weiValue),data:(0,s.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,s.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?(0,s.bigIntStringFromBN)(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?(0,s.bigIntStringFromBN)(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?(0,s.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,t){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,s.hexStringFromBuffer)(e,!0),chainId:t}})}scanQRCode(e){return this.sendRequest({method:"scanQRCode",params:{regExp:e}})}getQRCodeUrl(){return(0,s.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(e,t){return this.sendRequest({method:"generic",params:{action:t,data:e}})}sendGenericMessage(e){return this.sendRequest(e)}sendRequest(e){let t=null,r=(0,s.randomBytesHex)(8),n=n=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,e.method,n),null==t||t()};return{promise:new Promise((i,s)=>{this.ui.isStandalone()||(t=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:n,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(r,e=>{if(null==t||t(),(0,c.isErrorResponse)(e))return s(Error(e.errorMessage));i(e)}),this.ui.isStandalone()?this.sendRequestStandalone(r,e):this.publishWeb3RequestEvent(r,e)}),cancel:n}}setConnectDisabled(e){this.ui.setConnectDisabled(e)}setAccountsCallback(e){this.accountsCallback=e}setChainCallback(e){this.chainCallback=e}setDappDefaultChainCallback(e){this.dappDefaultChain=e,this.ui instanceof h.WalletLinkRelayUI&&this.ui.setChainId(e)}publishWeb3RequestEvent(e,t){var r;let n={type:"WEB3_REQUEST",id:e,request:t},i=l.Session.load(this.storage);null===(r=this.diagnostic)||void 0===r||r.log(o.EVENTS.WEB3_REQUEST,{eventId:n.id,method:`relay::${t.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:i?l.Session.hash(i.id):"",isSessionMismatched:((null==i?void 0:i.id)!==this._session.id).toString()}),this.publishEvent("Web3Request",n,!0).then(e=>{var r;null===(r=this.diagnostic)||void 0===r||r.log(o.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:n.id,method:`relay::${t.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:i?l.Session.hash(i.id):"",isSessionMismatched:((null==i?void 0:i.id)!==this._session.id).toString()})}).catch(e=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n.id,response:{method:t.method,errorMessage:e.message}})})}publishWeb3RequestCanceledEvent(e){this.publishEvent("Web3RequestCanceled",{type:"WEB3_REQUEST_CANCELED",id:e},!1).then()}publishEvent(e,t,r){return this.connection.publishEvent(e,t,r)}handleWeb3ResponseMessage(e){var t;let{response:r}=e;if(null===(t=this.diagnostic)||void 0===t||t.log(o.EVENTS.WEB3_RESPONSE,{eventId:e.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash()}),"requestEthereumAccounts"===r.method){d.accountRequestCallbackIds.forEach(t=>this.invokeCallback(Object.assign(Object.assign({},e),{id:t}))),d.accountRequestCallbackIds.clear();return}this.invokeCallback(e)}handleErrorResponse(e,t,r,i){var s;let o=null!==(s=null==r?void 0:r.message)&&void 0!==s?s:(0,n.getMessageFromCode)(i);this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:e,response:{method:t,errorMessage:o,errorCode:i}
1})}invokeCallback(e){let t=this.relayEventManager.callbacks.get(e.id);t&&(t(e.response),this.relayEventManager.callbacks.delete(e.id))}requestEthereumAccounts(){let e={method:"requestEthereumAccounts",params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},t=(0,s.randomBytesHex)(8),r=r=>{this.publishWeb3RequestCanceledEvent(t),this.handleErrorResponse(t,e.method,r)};return{promise:new Promise((i,s)=>{if(this.relayEventManager.callbacks.set(t,e=>{if(this.ui.hideRequestEthereumAccounts(),(0,c.isErrorResponse)(e))return s(Error(e.errorMessage));i(e)}),this.ui.inlineAccountsResponse())this.ui.requestEthereumAccounts({onCancel:r,onAccounts:e=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:t,response:{method:"requestEthereumAccounts",result:e}})}});else{let e=n.standardErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>r(e)})}d.accountRequestCallbackIds.add(t),this.ui.inlineAccountsResponse()||this.ui.isStandalone()||this.publishWeb3RequestEvent(t,e)}),cancel:r}}selectProvider(e){let t=(0,s.randomBytesHex)(8);return{cancel:e=>{this.publishWeb3RequestCanceledEvent(t),this.handleErrorResponse(t,"selectProvider",e)},promise:new Promise((r,n)=>{this.relayEventManager.callbacks.set(t,e=>{if((0,c.isErrorResponse)(e))return n(Error(e.errorMessage));r(e)}),this.ui.selectProvider&&this.ui.selectProvider({onApprove:e=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:t,response:{method:"selectProvider",result:e}})},onCancel:e=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:t,response:{method:"selectProvider",result:i.ProviderType.Unselected}})},providerOptions:e})})}}watchAsset(e,t,r,n,i,o){let a={method:"watchAsset",params:{type:e,options:{address:t,symbol:r,decimals:n,image:i},chainId:o}},l=null,u=(0,s.randomBytesHex)(8),h=e=>{this.publishWeb3RequestCanceledEvent(u),this.handleErrorResponse(u,a.method,e),null==l||l()};return this.ui.inlineWatchAsset()||(l=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:h,onResetConnection:this.resetAndReload})),{cancel:h,promise:new Promise((s,h)=>{this.relayEventManager.callbacks.set(u,e=>{if(null==l||l(),(0,c.isErrorResponse)(e))return h(Error(e.errorMessage));s(e)}),this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:()=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:u,response:{method:"watchAsset",result:!0}})},onCancel:e=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:u,response:{method:"watchAsset",result:!1}})},type:e,address:t,symbol:r,decimals:n,image:i,chainId:o}),this.ui.inlineWatchAsset()||this.ui.isStandalone()||this.publishWeb3RequestEvent(u,a)})}}addEthereumChain(e,t,r,n,i,o){let a={method:"addEthereumChain",params:{chainId:e,rpcUrls:t,blockExplorerUrls:n,chainName:i,iconUrls:r,nativeCurrency:o}},l=null,u=(0,s.randomBytesHex)(8),h=e=>{this.publishWeb3RequestCanceledEvent(u),this.handleErrorResponse(u,a.method,e),null==l||l()};return this.ui.inlineAddEthereumChain(e)||(l=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:h,onResetConnection:this.resetAndReload})),{promise:new Promise((t,r)=>{this.relayEventManager.callbacks.set(u,e=>{if(null==l||l(),(0,c.isErrorResponse)(e))return r(Error(e.errorMessage));t(e)}),this.ui.inlineAddEthereumChain(e)&&this.ui.addEthereumChain({onCancel:e=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:u,response:{method:"addEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},onApprove:e=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:u,response:{method:"addEthereumChain",result:{isApproved:!0,rpcUrl:e}}})},chainId:a.params.chainId,rpcUrls:a.params.rpcUrls,blockExplorerUrls:a.params.blockExplorerUrls,chainName:a.params.chainName,iconUrls:a.params.iconUrls,nativeCurrency:a.params.nativeCurrency}),this.ui.inlineAddEthereumChain(e)||this.ui.isStandalone()||this.publishWeb3RequestEvent(u,a)}),cancel:h}}switchEthereumChain(e,t){let r={method:"switchEthereumChain",params:Object.assign({chainId:e},{address:t})},i=(0,s.randomBytesHex)(8);return{promise:new Promise((t,s)=>{this.relayEventManager.callbacks.set(i,e=>(0,c.isErrorResponse)(e)&&e.errorCode?s(n.standardErrors.provider.custom({code:e.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."})):(0,c.isErrorResponse)(e)?s(Error(e.errorMessage)):void t(e)),this.ui.switchEthereumChain({onCancel:t=>{var r;if(t){let s=null!==(r=(0,n.getErrorCode)(t))&&void 0!==r?r:n.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(i,"switchEthereumChain",t instanceof Error?t:n.standardErrors.provider.unsupportedChain(e),s)}else this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"switchEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},onApprove:e=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"switchEthereumChain",result:{isApproved:!0,rpcUrl:e}}})},chainId:r.params.chainId,address:r.params.address}),this.ui.inlineSwitchEthereumChain()||this.ui.isStandalone()||this.publishWeb3RequestEvent(i,r)}),cancel:e=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,r.method,e)}}}inlineAddEthereumChain(e){return this.ui.inlineAddEthereumChain(e)}getSessionIdHash(){return l.Session.hash(this._session.id)}sendRequestStandalone(e,t){let r=r=>{this.handleErrorResponse(e,t.method,r)},n=t=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:e,response:t})};switch(t.method){case"signEthereumMessage":this.ui.signEthereumMessage({request:t,onSuccess:n,onCancel:r});break;case"signEthereumTransaction":this.ui.signEthereumTransaction({request:t,onSuccess:n,onCancel:r});break;case"submitEthereumTransaction":this.ui.submitEthereumTransaction({request:t,onSuccess:n,onCancel:r});break;case"ethereumAddressFromSignedMessage":this.ui.ethereumAddressFromSignedMessage({request:t,onSuccess:n});break;default:r()}}}t.WalletLinkRelay=d,d.accountRequestCallbackIds=new Set},26177:function(e,t,r){"use strict";
1Object.defineProperty(t,"__esModule",{value:!0}),t.WalletLinkConnection=void 0;let n=r(91873),i=r(15677),s=r(4813),o=r(27825),a=r(61019),l=r(75584),u=r(51973);class c{constructor({session:e,linkAPIUrl:t,listener:r,diagnostic:c,WebSocketClass:h=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,n.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=e=>{e&&new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",t=>e.JsonRpcUrl&&this.handleChainUpdated(t,e.JsonRpcUrl)]]).forEach((t,r)=>{let n=e[r];void 0!==n&&t(n)})},this.handleDestroyed=e=>{var t,r;"1"===e&&(null===(t=this.listener)||void 0===t||t.resetAndReload(),null===(r=this.diagnostic)||void 0===r||r.log(s.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:this.isDestroyed,sessionIdHash:a.Session.hash(this.session.id)}))},this.handleAccountUpdated=async e=>{var t,r;try{let r=await this.cipher.decrypt(e);null===(t=this.listener)||void 0===t||t.accountUpdated(r)}catch(e){null===(r=this.diagnostic)||void 0===r||r.log(s.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}},this.handleMetadataUpdated=async(e,t)=>{var r,n;try{let n=await this.cipher.decrypt(t);null===(r=this.listener)||void 0===r||r.metadataUpdated(e,n)}catch(t){null===(n=this.diagnostic)||void 0===n||n.log(s.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:e})}},this.handleWalletUsernameUpdated=async e=>{this.handleMetadataUpdated(o.WALLET_USER_NAME_KEY,e)},this.handleAppVersionUpdated=async e=>{this.handleMetadataUpdated(o.APP_VERSION_KEY,e)},this.handleChainUpdated=async(e,t)=>{var r,n;try{let n=await this.cipher.decrypt(e),i=await this.cipher.decrypt(t);null===(r=this.listener)||void 0===r||r.chainUpdated(n,i)}catch(e){null===(n=this.diagnostic)||void 0===n||n.log(s.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}},this.session=e,this.cipher=new i.Cipher(e.secret),this.diagnostic=c,this.listener=r;let d=new u.WalletLinkWebSocket(`${t}/rpc`,h);d.setConnectionStateListener(async t=>{var r;null===(r=this.diagnostic)||void 0===r||r.log(s.EVENTS.CONNECTED_STATE_CHANGE,{state:t,sessionIdHash:a.Session.hash(e.id)});let n=!1;switch(t){case u.ConnectionState.DISCONNECTED:if(!this.destroyed){let e=async()=>{await new Promise(e=>setTimeout(e,5e3)),this.destroyed||d.connect().catch(()=>{e()})};e()}break;case u.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),n=!0}catch(e){}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},1e4),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();case u.ConnectionState.CONNECTING:}this.connected!==n&&(this.connected=n)}),d.setIncomingDataListener(t=>{var r,n,i;switch(t.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{let n="IsLinkedOK"===t.type?t.linked:void 0;null===(r=this.diagnostic)||void 0===r||r.log(s.EVENTS.LINKED,{sessionIdHash:a.Session.hash(e.id),linked:n,type:t.type,onlineGuests:t.onlineGuests}),this.linked=n||t.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":null===(n=this.diagnostic)||void 0===n||n.log(s.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:a.Session.hash(e.id),metadata_keys:t&&t.metadata?Object.keys(t.metadata):void 0}),this.handleSessionMetadataUpdated(t.metadata);break;case"Event":this.handleIncomingEvent(t)}void 0!==t.id&&(null===(i=this.requestResolutions.get(t.id))||void 0===i||i(t))}),this.ws=d,this.http=new l.WalletLinkHTTP(t,e.id,e.key)}connect(){var e;if(this.destroyed)throw Error("instance is destroyed");null===(e=this.diagnostic)||void 0===e||e.log(s.EVENTS.STARTED_CONNECTING,{sessionIdHash:a.Session.hash(this.session.id)}),this.ws.connect()}destroy(){var e;this.destroyed=!0,this.ws.disconnect(),null===(e=this.diagnostic)||void 0===e||e.log(s.EVENTS.DISCONNECTED,{sessionIdHash:a.Session.hash(this.session.id)}),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(e){var t,r;this._connected=e,e&&(null===(t=this.onceConnected)||void 0===t||t.call(this)),null===(r=this.listener)||void 0===r||r.connectedUpdated(e)}setOnceConnected(e){return new Promise(t=>{this.connected?e().then(t):this.onceConnected=()=>{e().then(t),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(e){var t,r;this._linked=e,e&&(null===(t=this.onceLinked)||void 0===t||t.call(this)),null===(r=this.listener)||void 0===r||r.linkedUpdated(e)}setOnceLinked(e){return new Promise(t=>{this.linked?e().then(t):this.onceLinked=()=>{e().then(t),this.onceLinked=void 0}})}async handleIncomingEvent(e){var t,r;if("Event"===e.type&&"Web3Response"===e.event)try{let r=await this.cipher.decrypt(e.data),n=JSON.parse(r);if("WEB3_RESPONSE"!==n.type)return;null===(t=this.listener)||void 0===t||t.handleWeb3ResponseMessage(n)}catch(e){null===(r=this.diagnostic)||void 0===r||r.log(s.EVENTS.GENERAL_ER
1ROR,{message:"Had error decrypting",value:"incomingEvent"})}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(e=>setTimeout(e,250));try{await this.fetchUnseenEventsAPI()}catch(e){console.error("Unable to check for unseen events",e)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(e=>this.handleIncomingEvent(e))}async setSessionMetadata(e,t){let r={type:"SetSessionConfig",id:(0,n.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[e]:t}};return this.setOnceConnected(async()=>{let e=await this.makeRequest(r);if("Fail"===e.type)throw Error(e.error||"failed to set session metadata")})}async publishEvent(e,t,r=!1){let i=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},t),{origin:location.origin,relaySource:window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),s={type:"PublishEvent",id:(0,n.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:e,data:i,callWebhook:r};return this.setOnceLinked(async()=>{let e=await this.makeRequest(s);if("Fail"===e.type)throw Error(e.error||"failed to publish event");return e.eventId})}sendData(e){this.ws.sendData(JSON.stringify(e))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>2e4){this.ws.disconnect();return}try{this.ws.sendData("h")}catch(e){}}async makeRequest(e,t=6e4){let r;let n=e.id;return this.sendData(e),Promise.race([new Promise((e,i)=>{r=window.setTimeout(()=>{i(Error(`request ${n} timed out`))},t)}),new Promise(e=>{this.requestResolutions.set(n,t=>{clearTimeout(r),e(t),this.requestResolutions.delete(n)})})])}async authenticate(){let e={type:"HostSession",id:(0,n.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},t=await this.makeRequest(e);if("Fail"===t.type)throw Error(t.error||"failed to authentcate")}sendIsLinked(){let e={type:"IsLinked",id:(0,n.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(e)}sendGetSessionConfig(){let e={type:"GetSessionConfig",id:(0,n.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(e)}}t.WalletLinkConnection=c},75584:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WalletLinkHTTP=void 0;class r{constructor(e,t,r){this.linkAPIUrl=e,this.sessionId=t;let n=`${t}:${r}`;this.auth=`Basic ${btoa(n)}`}async markUnseenEventsAsSeen(e){return Promise.all(e.map(e=>fetch(`${this.linkAPIUrl}/events/${e.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(e=>console.error("Unabled to mark event as failed:",e))}async fetchUnseenEvents(){var e;let t=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(t.ok){let{events:r,error:n}=await t.json();if(n)throw Error(`Check unseen events failed: ${n}`);let i=null!==(e=null==r?void 0:r.filter(e=>"Web3Response"===e.event).map(e=>({type:"Event",sessionId:this.sessionId,eventId:e.id,event:e.event,data:e.data})))&&void 0!==e?e:[];return this.markUnseenEventsAsSeen(i),i}throw Error(`Check unseen events failed: ${t.status}`)}}t.WalletLinkHTTP=r},51973:function(e,t){"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.WalletLinkWebSocket=t.ConnectionState=void 0,(n=r||(t.ConnectionState=r={}))[n.DISCONNECTED=0]="DISCONNECTED",n[n.CONNECTING=1]="CONNECTING",n[n.CONNECTED=2]="CONNECTED";class i{setConnectionStateListener(e){this.connectionStateListener=e}setIncomingDataListener(e){this.incomingDataListener=e}constructor(e,t=WebSocket){this.WebSocketClass=t,this.webSocket=null,this.pendingData=[],this.url=e.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw Error("webSocket object is not null");return new Promise((e,t)=>{var n;let i;try{this.webSocket=i=new this.WebSocketClass(this.url)}catch(e){t(e);return}null===(n=this.connectionStateListener)||void 0===n||n.call(this,r.CONNECTING),i.onclose=e=>{var n;this.clearWebSocket(),t(Error(`websocket error ${e.code}: ${e.reason}`)),null===(n=this.connectionStateListener)||void 0===n||n.call(this,r.DISCONNECTED)},i.onopen=t=>{var n;e(),null===(n=this.connectionStateListener)||void 0===n||n.call(this,r.CONNECTED),this.pendingData.length>
10&&([...this.pendingData].forEach(e=>this.sendData(e)),this.pendingData=[])},i.onmessage=e=>{var t,r;if("h"===e.data)null===(t=this.incomingDataListener)||void 0===t||t.call(this,{type:"Heartbeat"});else try{let t=JSON.parse(e.data);null===(r=this.incomingDataListener)||void 0===r||r.call(this,t)}catch(e){}}})}disconnect(){var e;let{webSocket:t}=this;if(t){this.clearWebSocket(),null===(e=this.connectionStateListener)||void 0===e||e.call(this,r.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{t.close()}catch(e){}}}sendData(e){let{webSocket:t}=this;if(!t){this.pendingData.push(e),this.connect();return}t.send(e)}clearWebSocket(){let{webSocket:e}=this;e&&(this.webSocket=null,e.onclose=null,e.onerror=null,e.onmessage=null,e.onopen=null)}}t.WalletLinkWebSocket=i},44143:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isErrorResponse=void 0,t.isErrorResponse=function(e){return void 0!==e.errorMessage}},49331:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WalletLinkRelayUI=void 0;let n=r(75874),i=r(40624),s=r(89768);class o{constructor(e){this.standalone=null,this.attached=!1,this.snackbar=new s.Snackbar({darkMode:e.darkMode}),this.linkFlow=new i.LinkFlow({darkMode:e.darkMode,version:e.version,sessionId:e.session.id,sessionSecret:e.session.secret,linkAPIUrl:e.linkAPIUrl,isParentConnection:!1})}attach(){if(this.attached)throw Error("Coinbase Wallet SDK UI is already attached");let 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,n.injectCssReset)()}setConnected(e){this.linkFlow.setConnected(e)}setChainId(e){this.linkFlow.setChainId(e)}setConnectDisabled(e){this.linkFlow.setConnectDisabled(e)}addEthereumChain(){}watchAsset(){}switchEthereumChain(){}requestEthereumAccounts(e){this.linkFlow.open({onCancel:e.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}showConnecting(e){let t;return t=e.isUnlinkedErrorState?{autoExpand:!0,message:"Connection lost",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",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)}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(e){this.standalone=e}isStandalone(){var e;return null!==(e=this.standalone)&&void 0!==e&&e}}t.WalletLinkRelayUI=o},76742:function(e,t){"use strict";
1Object.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;border-radius:100px;font-weight:600}.-cbwsdk-css-reset .-cbwsdk-connect-item.light{background:#f5f8ff;color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark{background:#001033;color:#588af5}.-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}"},79100:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoinbaseWalletSteps=t.ConnectContent=void 0;let i=n(r(25796)),s=r(57764),o=r(97042),a=r(54750),l=r(5418),u=r(57726),c=r(64068),h=r(32007),d=r(3501),f=n(r(76742)),p=e=>"light"===e?"#FFFFFF":"#0A0B0D";function g({title:e,description:t,theme:r}){return(0,s.h)("div",{className:(0,i.default)("-cbwsdk-connect-item",r)},(0,s.h)("div",null,(0,s.h)(u.CoinbaseWalletRound,null)),(0,s.h)("div",{className:"-cbwsdk-connect-item-copy-wrapper"},(0,s.h)("h3",{className:"-cbwsdk-connect-item-title"},e),(0,s.h)("p",{className:"-cbwsdk-connect-item-description"},t)))}function y({theme:e}){return(0,s.h)("ol",{className:"-cbwsdk-wallet-steps"},(0,s.h)("li",{className:(0,i.default)("-cbwsdk-wallet-steps-item",e)},(0,s.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,s.h)("li",{className:(0,i.default)("-cbwsdk-wallet-steps-item",e)},(0,s.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},(0,s.h)("span",null,"Tap ",(0,s.h)("strong",null,"Scan")," "),(0,s.h)("span",{className:(0,i.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",e)},(0,s.h)(c.QRCodeIcon,{fill:p(e)})))))}t.ConnectContent=function(e){let{theme:t}=e,r=(0,o.createQrUrl)(e.sessionId,e.sessionSecret,e.linkAPIUrl,e.isParentConnection,e.version,e.chainId);return(0,s.h)("div",{"data-testid":"connect-content",className:(0,i.default)("-cbwsdk-connect-content",t)},(0,s.h)("style",null,f.default),(0,s.h)("div",{className:"-cbwsdk-connect-content-header"},(0,s.h)("h2",{className:(0,i.default)("-cbwsdk-connect-content-heading",t)},"Scan to connect with our mobile app"),e.onCancel&&(0,s.h)("button",{type:"button",className:"-cbwsdk-cancel-button",onClick:e.onCancel},(0,s.h)(l.CloseIcon,{fill:"light"===t?"#0A0B0D":"#FFFFFF"}))),(0,s.h)("div",{className:"-cbwsdk-connect-content-layout"},(0,s.h)("div",{className:"-cbwsdk-connect-content-column-left"},(0,s.h)(g,{title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",theme:t})),(0,s.h)("div",{className:"-cbwsdk-connect-content-column-right"},(0,s.h)("div",{className:"-cbwsdk-connect-content-qr-wrapper"},(0,s.h)(h.QRCode,{content:r,width:200,height:200,fgColor:"#000",bgColor:"transparent"}),(0,s.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:a.LIB_VERSION}),(0,s.h)("input",{type:"hidden",value:r})),(0,s.h)(y,{theme:t}),!e.isConnected&&(0,s.h)("div",{"data-testid":"connecting-spinner",className:(0,i.default)("-cbwsdk-connect-content-qr-connecting",t)},(0,s.h)(d.Spinner,{size:36,color:"dark"===t?"#FFF":"#000"}),(0,s.h)("p",null,"Connecting...")))))},t.CoinbaseWalletSteps=y},82905:function(e,t){"use strict";
1Object.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}"},33966:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectDialog=void 0;let i=n(r(25796)),s=r(57764),o=r(83148),a=r(79100),l=r(94876),u=n(r(82905));t.ConnectDialog=e=>{let{isOpen:t,darkMode:r}=e,[n,c]=(0,o.useState)(!t),[h,d]=(0,o.useState)(!t);(0,o.useEffect)(()=>{let e=[window.setTimeout(()=>{d(!t)},10)];return t?c(!1):e.push(window.setTimeout(()=>{c(!0)},360)),()=>{e.forEach(window.clearTimeout)}},[t]);let f=r?"dark":"light";return(0,s.h)("div",{class:(0,i.default)("-cbwsdk-connect-dialog-container",n&&"-cbwsdk-connect-dialog-container-hidden")},(0,s.h)("style",null,u.default),(0,s.h)("div",{class:(0,i.default)("-cbwsdk-connect-dialog-backdrop",f,h&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,s.h)("div",{class:"-cbwsdk-connect-dialog"},(0,s.h)("div",{class:(0,i.default)("-cbwsdk-connect-dialog-box",h&&"-cbwsdk-connect-dialog-box-hidden")},e.connectDisabled?null:(0,s.h)(a.ConnectContent,{theme:f,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,s.h)(l.TryExtensionContent,{theme:f}))))}},40624:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LinkFlow=void 0;let n=r(57764),i=r(33966);class s{constructor(e){this.connected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=e.darkMode,this.version=e.version,this.sessionId=e.sessionId,this.sessionSecret=e.sessionSecret,this.linkAPIUrl=e.linkAPIUrl,this.isParentConnection=e.isParentConnection}attach(e){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",e.appendChild(this.root),this.render()}setConnected(e){this.connected!==e&&(this.connected=e,this.render())}setChainId(e){this.chainId!==e&&(this.chainId=e,this.render())}detach(){var e;this.root&&((0,n.render)(null,this.root),null===(e=this.root.parentElement)||void 0===e||e.removeChild(this.root))}setConnectDisabled(e){this.connectDisabled=e}open(e){this.isOpen=!0,this.onCancel=e.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){this.root&&(0,n.render)((0,n.h)(i.ConnectDialog,{darkMode:this.darkMode,version:this.version,sessionId:this.sessionId,sessionSecret:this.sessionSecret,linkAPIUrl:this.linkAPIUrl,isOpen:this.isOpen,isConnected:this.connected,isParentConnection:this.isParentConnection,chainId:this.chainId,onCancel:this.onCancel,connectDisabled:this.connectDisabled}),this.root)}}t.LinkFlow=s},32007:function(e,t,r){"use strict";var n=r(9109).Buffer,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.QRCode=void 0;let s=r(57764),o=r(83148),a=i(r(53082));t.QRCode=e=>{let[t,r]=(0,o.useState)("");return(0,o.useEffect)(()=>{var t,i;let s=new a.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!==(i=e.height)&&void 0!==i?i:256,padding:0,image:e.image}),o=n.from(s.svg(),"utf8").toString("base64");r(`data:image/svg+xml;base64,${o}`)},[e.bgColor,e.content,e.fgColor,e.height,e.image,e.width]),t?(0,s.h)("img",{src:t,alt:"QR Code"}):null}},69110:function(e,t){"use strict";
1Object.defineProperty(t,"__esModule",{value:!0}),t.default=".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}"},45281:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.RedirectDialog=void 0;let i=n(r(25796)),s=r(57764),o=r(75874),a=r(28531),l=n(r(69110));class u{constructor(){this.root=null}attach(){let e=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",e.appendChild(this.root),(0,o.injectCssReset)()}present(e){this.render(e)}clear(){this.render(null)}render(e){this.root&&((0,s.render)(null,this.root),e&&(0,s.render)((0,s.h)(c,Object.assign({},e,{onDismiss:()=>{this.clear()}})),this.root))}}t.RedirectDialog=u;let c=({title:e,buttonText:t,darkMode:r,onButtonClick:n,onDismiss:o})=>(0,s.h)(a.SnackbarContainer,{darkMode:r},(0,s.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,s.h)("style",null,l.default),(0,s.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:o}),(0,s.h)("div",{class:(0,i.default)("-cbwsdk-redirect-dialog-box",r?"dark":"light")},(0,s.h)("p",null,e),(0,s.h)("button",{onClick:n},t))))},99461: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}
1.-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}"},89768:function(e,t,r){"use strict";var n=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;let i=n(r(25796)),s=r(57764),o=r(83148),a=n(r(99461));class l{constructor(e){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=e.darkMode}attach(e){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",e.appendChild(this.root),this.render()}presentItem(e){let t=this.nextItemKey++;return this.items.set(t,e),this.render(),()=>{this.items.delete(t),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,s.render)((0,s.h)("div",null,(0,s.h)(t.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([e,r])=>(0,s.h)(t.SnackbarInstance,Object.assign({},r,{key:e}))))),this.root)}}t.Snackbar=l,t.SnackbarContainer=e=>(0,s.h)("div",{class:(0,i.default)("-cbwsdk-snackbar-container")},(0,s.h)("style",null,a.default),(0,s.h)("div",{class:"-cbwsdk-snackbar"},e.children)),t.SnackbarInstance=({autoExpand:e,message:t,menuItems:r})=>{let[n,a]=(0,o.useState)(!0),[l,u]=(0,o.useState)(null!=e&&e);return(0,o.useEffect)(()=>{let e=[window.setTimeout(()=>{a(!1)},1),window.setTimeout(()=>{u(!0)},1e4)];return()=>{e.forEach(window.clearTimeout)}}),(0,s.h)("div",{class:(0,i.default)("-cbwsdk-snackbar-instance",n&&"-cbwsdk-snackbar-instance-hidden",l&&"-cbwsdk-snackbar-instance-expanded")},(0,s.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:()=>{u(!l)}},(0,s.h)("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiA
1wIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,s.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},t),(0,s.h)("div",{class:"-gear-container"},!l&&(0,s.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,s.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,s.h)("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=",class:"-gear-icon",title:"Expand"}))),r&&r.length>0&&(0,s.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},r.map((e,t)=>(0,s.h)("div",{class:(0,i.default)("-cbwsdk-snackbar-instance-menu-item",e.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:e.onClick,key:t},(0,s.h)("svg",{width:e.svgWidth,height:e.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,s.h)("path",{"fill-rule":e.defaultFillRule,"clip-rule":e.defaultClipRule,d:e.path,fill:"#AAAAAA"})),(0,s.h)("span",{class:(0,i.default)("-cbwsdk-snackbar-instance-menu-item-info",e.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},e.info)))))}},28531:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(89768),t)},27677: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)}}"},3501:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Spinner=void 0;let i=r(57764),s=n(r(27677));t.Spinner=e=>{var t;let r=null!==(t=e.size)&&void 0!==t?t:64,n=e.color||"#000";return(0,i.h)("div",{class:"-cbwsdk-spinner"},(0,i.h)("style",null,s.default),(0,i.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:r,height:r}},(0,i.h)("circle",{style:{cx:50,cy:50,r:45,stroke:n}})))}},58552: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}"},94876:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esMo
1dule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TryExtensionContent=void 0;let i=n(r(25796)),s=r(57764),o=r(83148),a=r(139),l=r(9333),u=r(32658),c=n(r(58552));t.TryExtensionContent=function({theme:e}){let[t,r]=(0,o.useState)(!1),n=(0,o.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),h=(0,o.useCallback)(()=>{t?window.location.reload():(n(),r(!0))},[n,t]);return(0,s.h)("div",{class:(0,i.default)("-cbwsdk-try-extension",e)},(0,s.h)("style",null,c.default),(0,s.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,s.h)("h3",{class:(0,i.default)("-cbwsdk-try-extension-heading",e)},"Or try the Coinbase Wallet browser extension"),(0,s.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,s.h)("button",{class:(0,i.default)("-cbwsdk-try-extension-cta",e),onClick:h},t?"Refresh":"Install"),(0,s.h)("div",null,!t&&(0,s.h)(a.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:"light"===e?"#0052FF":"#588AF5"})))),(0,s.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,s.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,s.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,s.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,s.h)("span",{class:(0,i.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,s.h)(l.LaptopIcon,{fill:"light"===e?"#0A0B0D":"#FFFFFF"}))),(0,s.h)("div",{class:(0,i.default)("-cbwsdk-try-extension-list-item-copy",e)},"Connect with dapps with just one click on your desktop browser")),(0,s.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,s.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,s.h)("span",{class:(0,i.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,s.h)(u.SafeIcon,{fill:"light"===e?"#0A0B0D":"#FFFFFF"}))),(0,s.h)("div",{class:(0,i.default)("-cbwsdk-try-extension-list-item-copy",e)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}},139:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArrowLeftIcon=void 0;let n=r(57764);t.ArrowLeftIcon=function(e){return(0,n.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},e),(0,n.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"}))}},5418:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CloseIcon=void 0;let n=r(57764);t.CloseIcon=function(e){return(0,n.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,n.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"}))}},57726:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CoinbaseWalletRound=void 0;let n=r(57764);t.CoinbaseWalletRound=function(e){return(0,n.h)("svg",Object.assign({width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,n.h)("circle",{cx:"14",cy:"14",r:"14",fill:"#0052FF"}),(0,n.h)("path",{d:"M23.8521 14.0003C23.8521 19.455 19.455 23.8521 14.0003 23.8521C8.54559 23.8521 4.14844 19.455 4.14844 14.0003C4.14844 8.54559 8.54559 4.14844 14.0003 4.14844C19.455 4.14844 23.8521 8.54559 23.8521 14.0003Z",fill:"white"}),(0,n.h)("path",{d:"M11.1855 12.5042C11.1855 12.0477 11.1855 11.7942 11.2835 11.642C11.3814 11.4899 11.4793 11.3377 11.6261 11.287C11.8219 11.1855 12.0178 11.1855 12.5073 11.1855H15.4934C15.983 11.1855 16.1788 11.1855 16.3746 11.287C16.5215 11.3884 16.6683 11.4899 16.7173 11.642C16.8152 11.8449 16.8152 12.0477 16.8152 12.5042V15.4965C16.8152 15.953 16.8152 16.2066 16.7173 16.3587C16.6194 16.5109 16.5215 16.663 16.3746 16.7137C16.1788 16.8152 15.983 16.8152 15.4934 16.8152H12.5073C12.0178 16.8152 11.8219 16.8152 11.6261 16.7137C11.4793 16.6123 11.3324 16.5109 11.2835 16.3587C11.1855 16.1558 11.1855 15.953 11.1855 15.4965V12.5042Z",fill:"#0052FF"}))}},9333:function(e,t,r){"use strict";
1Object.defineProperty(t,"__esModule",{value:!0}),t.LaptopIcon=void 0;let n=r(57764);t.LaptopIcon=function(e){return(0,n.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,n.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,n.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"}))}},64068:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QRCodeIcon=void 0;let n=r(57764);t.QRCodeIcon=function(e){return(0,n.h)("svg",Object.assign({width:"18",height:"18",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),(0,n.h)("path",{d:"M3 3V8.99939L5 8.99996V5H9V3H3Z"}),(0,n.h)("path",{d:"M15 21L21 21V15.0006L19 15V19L15 19V21Z"}),(0,n.h)("path",{d:"M21 9H19V5H15.0006L15 3H21V9Z"}),(0,n.h)("path",{d:"M3 15V21H8.99939L8.99996 19H5L5 15H3Z"}))}},32658:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SafeIcon=void 0;let n=r(57764);t.SafeIcon=function(e){return(0,n.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,n.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"}))}},86105:function(e,t,r){var n=r(9109).Buffer;let i=r(77114),s=r(58171);function o(e){if(e.startsWith("int["))return"int256"+e.slice(3);if("int"===e)return"int256";if(e.startsWith("uint["))return"uint256"+e.slice(4);if("uint"===e)return"uint256";if(e.startsWith("fixed["))return"fixed128x128"+e.slice(5);if("fixed"===e)return"fixed128x128";if(e.startsWith("ufixed["))return"ufixed128x128"+e.slice(6);else if("ufixed"===e)return"ufixed128x128";return e}function a(e){return parseInt(/^\D+(\d+)$/.exec(e)[1],10)}function l(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 i.isHexString(e)?new s(i.stripHexPrefix(e),16):new s(e,10);if("number"===t)return new s(e);if(e.toArray)return e;throw Error("Argument is not a number")}function h(e,t){if("address"===e)return h("uint160",c(t));if("bool"===e)return h("uint8",t?1:0);if("string"===e)return h("bytes",new n(t,"utf8"));if((p=e).lastIndexOf("]")===p.length-1){if(void 0===t.length)throw Error("Not an array?");if("dynamic"!==(r=u(e))&&0!==r&&t.length>r)throw Error("Elements exceed array size: "+r);for(f in d=[],e=e.slice(0,e.lastIndexOf("[")),"string"==typeof t&&(t=JSON.parse(t)),t)d.push(h(e,t[f]));if("dynamic"===r){var r,o,d,f,p,g=h("uint256",t.length);d.unshift(g)}return n.concat(d)}if("bytes"===e)return t=new n(t),d=n.concat([h("uint256",t.length),t]),t.length%32!=0&&(d=n.concat([d,i.zeros(32-t.length%32)])),d;if(e.startsWith("bytes")){if((r=a(e))<1||r>32)throw Error("Invalid bytes<N> width: "+r);return i.setLengthRight(t,32)}else if(e.startsWith("uint")){if((r=a(e))%8||r<8||r>256)throw Error("Invalid uint<N> width: "+r);if((o=c(t)).bitLength()>r)throw Error("Supplied uint exceeds width: "+r+" vs "+o.bitLength());if(o<0)throw Error("Supplied uint is negative");return o.toArrayLike(n,"be",32)}else if(e.startsWith("int")){if((r=a(e))%8||r<8||r>256)throw Error("Invalid int<N> width: "+r);if((o=c(t)).bitLength()>r)throw Error("Supplied int exceeds width: "+r+" vs "+o.bitLength());return o.toTwos(256).toArrayLike(n,"be",32)}else if(e.startsWith("ufixed")){if(r=l(e),(o=c(t))<0)throw Error("Supplied ufixed is negative");
vendor: 5,367 bytes, line 1
1return h("uint256",o.mul(new s(2).pow(new s(r[1]))))}else if(e.startsWith("fixed"))return r=l(e),h("int256",c(t).mul(new s(2).pow(new s(r[1]))));throw Error("Unsupported or invalid type: "+e)}function d(e,t){if(e.length!==t.length)throw Error("Number of types are not matching the values");for(var r,s,l=[],u=0;u<e.length;u++){var h=o(e[u]),d=t[u];if("bytes"===h)l.push(d);else if("string"===h)l.push(new n(d,"utf8"));else if("bool"===h)l.push(new n(d?"01":"00","hex"));else if("address"===h)l.push(i.setLength(d,20));else if(h.startsWith("bytes")){if((r=a(h))<1||r>32)throw Error("Invalid bytes<N> width: "+r);l.push(i.setLengthRight(d,r))}else if(h.startsWith("uint")){if((r=a(h))%8||r<8||r>256)throw Error("Invalid uint<N> width: "+r);if((s=c(d)).bitLength()>r)throw Error("Supplied uint exceeds width: "+r+" vs "+s.bitLength());l.push(s.toArrayLike(n,"be",r/8))}else if(h.startsWith("int")){if((r=a(h))%8||r<8||r>256)throw Error("Invalid int<N> width: "+r);if((s=c(d)).bitLength()>r)throw Error("Supplied int exceeds width: "+r+" vs "+s.bitLength());l.push(s.toTwos(r).toArrayLike(n,"be",r/8))}else throw Error("Unsupported or invalid type: "+h)}return n.concat(l)}e.exports={rawEncode:function(e,t){var r=[],i=[],s=32*e.length;for(var a in e){var l=o(e[a]),c=h(l,t[a]);"string"===l||"bytes"===l||"dynamic"===u(l)?(r.push(h("uint256",s)),i.push(c),s+=c.length):r.push(c)}return n.concat(r.concat(i))},solidityPack:d,soliditySHA3:function(e,t){return i.keccak(d(e,t))}}},80745:function(e,t,r){var n=r(9109).Buffer;let i=r(77114),s=r(86105),o={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"]},a={encodeData(e,t,r,o=!0){let a=["bytes32"],l=[this.hashType(e,r)];if(o){let u=(e,t,a)=>{if(void 0!==r[t])return["bytes32",null==a?"0x0000000000000000000000000000000000000000000000000000000000000000":i.keccak(this.encodeData(t,a,r,o))];if(void 0===a)throw Error(`missing value for field ${e} of type ${t}`);if("bytes"===t)return["bytes32",i.keccak(a)];if("string"===t)return"string"==typeof a&&(a=n.from(a,"utf8")),["bytes32",i.keccak(a)];if(t.lastIndexOf("]")===t.length-1){let r=t.slice(0,t.lastIndexOf("[")),n=a.map(t=>u(e,r,t));return["bytes32",i.keccak(s.rawEncode(n.map(([e])=>e),n.map(([,e])=>e)))]}return[t,a]};for(let n of r[e]){let[e,r]=u(n.name,n.type,t[n.name]);a.push(e),l.push(r)}}else for(let s of r[e]){let e=t[s.name];if(void 0!==e){if("bytes"===s.type)a.push("bytes32"),e=i.keccak(e),l.push(e);else if("string"===s.type)a.push("bytes32"),"string"==typeof e&&(e=n.from(e,"utf8")),e=i.keccak(e),l.push(e);else if(void 0!==r[s.type])a.push("bytes32"),e=i.keccak(this.encodeData(s.type,e,r,o)),l.push(e);else if(s.type.lastIndexOf("]")===s.type.length-1)throw Error("Arrays currently unimplemented in encodeData");else a.push(s.type),l.push(e)}}return s.rawEncode(a,l)},encodeType(e,t){let r="",n=this.findTypeDependencies(e,t).filter(t=>t!==e);for(let i of n=[e].concat(n.sort())){if(!t[i])throw Error("No type definition specified: "+i);r+=i+"("+t[i].map(({name:e,type:t})=>t+" "+e).join(",")+")"}return r},findTypeDependencies(e,t,r=[]){if(e=e.match(/^\w*/)[0],r.includes(e)||void 0===t[e])return r;for(let n of(r.push(e),t[e]))for(let e of this.findTypeDependencies(n.type,t,r))r.includes(e)||r.push(e);return r},hashStruct(e,t,r,n=!0){return i.keccak(this.encodeData(e,t,r,n))},hashType(e,t){return i.keccak(this.encodeType(e,t))},sanitizeData(e){let t={};for(let r in o.properties)e[r]&&(t[r]=e[r]);return t.types&&(t.types=Object.assign({EIP712Domain:[]},t.types)),t},hash(e,t=!0){let r=this.sanitizeData(e),s=[n.from("1901","hex")];return s.push(this.hashStruct("EIP712Domain",r.domain,r.types,t)),"EIP712Domain"!==r.primaryType&&s.push(this.hashStruct(r.primaryType,r.message,r.types,t)),i.keccak(n.concat(s))}};e.exports={TYPED_MESSAGE_SCHEMA:o,TypedDataUtils:a,hashForSignTypedDataLegacy:function(e){return function(e){let t=Error("Expect argument to be non-empty array");if("object"!=typeof e||!e.length)throw t;let r=e.map(function(e){return"bytes"===e.type?i.toBuffer(e.value):e.value}),n=e.map(function(e){return e.type}),o=e.map(function(e){if(!e.name)throw t;return e.type+" "+e.name});return s.soliditySHA3(["bytes32","bytes32"],[s.soliditySHA3(Array(e.length).fill("string"),o),s.soliditySHA3(n,r)])}(e.data)},hashForSignTypedData_v3:function(e){return a.hash(e.data,!1)},hashForSignTypedData_v4:function(e){return a.hash(e.data)}}},77114:function(e,t,r){var n=r(9109).Buffer;let i=r(6230),s=r(58171);function o(e){return n.allocUnsafe(e).fill(0)}function a(e,t,r){let n=o(t);return(e=l(e),r)?e.length<t?(e.copy(n),n):e.slice(0,t):e.length<t?(e.copy(n,t-e.length),n):e.slice(-t)}function l(e){if(!n.isBuffer(e)){if(Array.isArray(e))e=n.from(e);else if("string"==typeof e){var t;e=u(e)?n.from((t=c(e)).length%2?"0"+t:t,"hex"):n.from(e)}else if("number"==typeof e)e=intToBuffer(e);else if(null==e)e=n.allocUnsafe(0);else if(s.isBN(e))e=e.toArrayLike(n);else if(e.toArray)e=n.from(e.toArray());else throw Error("invalid type")}return e}function u(e){return"string"==typeof e&&e.match(/^0x[0-9A-Fa-f]*$/)}function c(e){return"string"==typeof e&&e.startsWith("0x")?e.slice(2):e}
1e.exports={zeros:o,setLength:a,setLengthRight:function(e,t){return a(e,t,!0)},isHexString:u,stripHexPrefix:c,toBuffer:l,bufferToHex:function(e){return"0x"+(e=l(e)).toString("hex")},keccak:function(e,t){return e=l(e),t||(t=256),i("keccak"+t).update(e).digest()}}},53082:function(e){function t(e){this.mode=n.MODE_8BIT_BYTE,this.data=e,this.parsedData=[];for(var t=0,r=this.data.length;t<r;t++){var i=[],s=this.data.charCodeAt(t);s>65536?(i[0]=240|(1835008&s)>>>18,i[1]=128|(258048&s)>>>12,i[2]=128|(4032&s)>>>6,i[3]=128|63&s):s>2048?(i[0]=224|(61440&s)>>>12,i[1]=128|(4032&s)>>>6,i[2]=128|63&s):s>128?(i[0]=192|(1984&s)>>>6,i[1]=128|63&s):i[0]=s,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 r(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,r=this.parsedData.length;t<r;t++)e.put(this.parsedData[t],8)}},r.prototype={addData:function(e){var r=new t(e);this.dataList.push(r),this.dataCache=null},isDark:function(e,t){if(e<0||this.moduleCount<=e||t<0||this.moduleCount<=t)throw Error(e+","+t);return this.modules[e][t]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(e,t){this.moduleCount=4*this.typeNumber+17,this.modules=Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++){this.modules[n]=Array(this.moduleCount);for(var i=0;i<this.moduleCount;i++)this.modules[n][i]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(e,t),this.typeNumber>=7&&this.setupTypeNumber(e),null==this.dataCache&&(this.dataCache=r.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)},setupPositionProbePattern:function(e,t){for(var r=-1;r<=7;r++)if(!(e+r<=-1)&&!(this.moduleCount<=e+r))for(var n=-1;n<=7;n++)t+n<=-1||this.moduleCount<=t+n||(0<=r&&r<=6&&(0==n||6==n)||0<=n&&n<=6&&(0==r||6==r)||2<=r&&r<=4&&2<=n&&n<=4?this.modules[e+r][t+n]=!0:this.modules[e+r][t+n]=!1)},getBestMaskPattern:function(){for(var e=0,t=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=o.getLostPoint(this);(0==r||e>n)&&(e=n,t=r)}return t},createMovieClip:function(e,t,r){var n=e.createEmptyMovieClip(t,r);this.make();for(var i=0;i<this.modules.length;i++)for(var s=1*i,o=0;o<this.modules[i].length;o++){var a=1*o;this.modules[i][o]&&(n.beginFill(0,100),n.moveTo(a,s),n.lineTo(a+1,s),n.lineTo(a+1,s+1),n.lineTo(a,s+1),n.endFill())}return n},setupTimingPattern:function(){for(var e=8;e<this.moduleCount-8;e++)null==this.modules[e][6]&&(this.modules[e][6]=e%2==0);for(var t=8;t<this.moduleCount-8;t++)null==this.modules[6][t]&&(this.modules[6][t]=t%2==0)},setupPositionAdjustPattern:function(){for(var e=o.getPatternPosition(this.typeNumber),t=0;t<e.length;t++)for(var r=0;r<e.length;r++){var n=e[t],i=e[r];if(null==this.modules[n][i])for(var s=-2;s<=2;s++)for(var a=-2;a<=2;a++)-2==s||2==s||-2==a||2==a||0==s&&0==a?this.modules[n+s][i+a]=!0:this.modules[n+s][i+a]=!1}},setupTypeNumber:function(e){for(var t=o.getBCHTypeNumber(this.typeNumber),r=0;r<18;r++){var n=!e&&(t>>r&1)==1;this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(var r=0;r<18;r++){var n=!e&&(t>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}},setupTypeInfo:function(e,t){for(var r=this.errorCorrectLevel<<3|t,n=o.getBCHTypeInfo(r),i=0;i<15;i++){var s=!e&&(n>>i&1)==1;i<6?this.modules[i][8]=s:i<8?this.modules[i+1][8]=s:this.modules[this.moduleCount-15+i][8]=s}for(var i=0;i<15;i++){var s=!e&&(n>>i&1)==1;i<8?this.modules[8][this.moduleCount-i-1]=s:i<9?this.modules[8][15-i-1+1]=s:this.modules[8][15-i-1]=s}this.modules[this.moduleCount-8][8]=!e},mapData:function(e,t){for(var r=-1,n=this.moduleCount-1,i=7,s=0,a=this.moduleCount-1;a>0;a-=2)for(6==a&&a--;;){for(var l=0;l<2;l++)if(null==this.modules[n][a-l]){var u=!1;s<e.length&&(u=(e[s]>>>i&1)==1),o.getMask(t,n,a-l)&&(u=!u),this.modules[n][a-l]=u,-1==--i&&(s++,i=7)}if((n+=r)<0||this.moduleCount<=n){n-=r,r=-r;break}}}},r.PAD0=236,r.PAD1=17,r.createData=function(e,t,n){for(var i=c.getRSBlocks(e,t),s=new h,a=0;a<n.length;a++){var l=n[a];s.put(l.mode,4),s.put(l.getLength(),o.getLengthInBits(l.mode,e)),l.write(s)}for(var u=0,a=0;a<i.length;a++)u+=i[a].dataCount;if(s.getLengthInBits()>8*u)throw Error("code length overflow. ("+s.getLengthInBits()+">"+8*u+")");for(s.getLengthInBits()+4<=8*u&&s.put(0,4);s.getLengthInBits()%8!=0;)s.putBit(!1);for(;!(s.getLengthInBits()>=8*u)&&(s.put(r.PAD0,8),!(s.getLengthInBits()>=8*u));)s.put(r.PAD1,8);return r.createBytes(s,i)},r.createBytes=function(e,t){for(var r=0,n=0,i=0,s=Array(t.length),a=Array(t.length),l=0;l<t.length;l++){var c=t[l].dataCount,h=t[l].totalCount-c;n=Math.max(n,c),i=Math.max(i,h),s[l]=Array(c);for(var d=0;d<s[l].length;d++)s[l][d]=255&e.buffer[d+r];r+=c;var f=o.getErrorCorrectPolynomial(h),p=new u(s[l],f.getLength()-1).mod(f);a[l]=Array(f.getLength()-1);for(var d=0;d<a[l].length;d++){var g=d+p.getLength()-a[l].length;a[l][d]=g>=0?p.get(g):0}}for(var y=0,d=0;d<t.length;d++)y+=t[d].totalCount;for(var m=Array(y),v=0,d=0;d<n;d++)for(var l=0;l<t.length;l++)d<s[l].length&&(m[v++]=s[l][d]);for(var d=0;d<i;d++)for(var l=0;l<t.length;l++)d<a[l].length&&(m[v++]=a[l][d]);return m};for(var n={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},i={L:1,M:0,Q:3,H:2},s={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},o={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(e){for(var t=e<<10;
1o.getBCHDigit(t)-o.getBCHDigit(o.G15)>=0;)t^=o.G15<<o.getBCHDigit(t)-o.getBCHDigit(o.G15);return(e<<10|t)^o.G15_MASK},getBCHTypeNumber:function(e){for(var t=e<<12;o.getBCHDigit(t)-o.getBCHDigit(o.G18)>=0;)t^=o.G18<<o.getBCHDigit(t)-o.getBCHDigit(o.G18);return e<<12|t},getBCHDigit:function(e){for(var t=0;0!=e;)t++,e>>>=1;return t},getPatternPosition:function(e){return o.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,r){switch(e){case s.PATTERN000:return(t+r)%2==0;case s.PATTERN001:return t%2==0;case s.PATTERN010:return r%3==0;case s.PATTERN011:return(t+r)%3==0;case s.PATTERN100:return(Math.floor(t/2)+Math.floor(r/3))%2==0;case s.PATTERN101:return t*r%2+t*r%3==0;case s.PATTERN110:return(t*r%2+t*r%3)%2==0;case s.PATTERN111:return(t*r%3+(t+r)%2)%2==0;default:throw Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new u([1],0),r=0;r<e;r++)t=t.multiply(new u([1,a.gexp(r)],0));return t},getLengthInBits:function(e,t){if(1<=t&&t<10)switch(e){case n.MODE_NUMBER:return 10;case n.MODE_ALPHA_NUM:return 9;case n.MODE_8BIT_BYTE:case n.MODE_KANJI:return 8;default:throw Error("mode:"+e)}else if(t<27)switch(e){case n.MODE_NUMBER:return 12;case n.MODE_ALPHA_NUM:return 11;case n.MODE_8BIT_BYTE:return 16;case n.MODE_KANJI:return 10;default:throw Error("mode:"+e)}else if(t<41)switch(e){case n.MODE_NUMBER:return 14;case n.MODE_ALPHA_NUM:return 13;case n.MODE_8BIT_BYTE:return 16;case n.MODE_KANJI:return 12;default:throw Error("mode:"+e)}else throw Error("type:"+t)},getLostPoint:function(e){for(var t=e.getModuleCount(),r=0,n=0;n<t;n++)for(var i=0;i<t;i++){for(var s=0,o=e.isDark(n,i),a=-1;a<=1;a++)if(!(n+a<0)&&!(t<=n+a))for(var l=-1;l<=1;l++)!(i+l<0)&&!(t<=i+l)&&(0!=a||0!=l)&&o==e.isDark(n+a,i+l)&&s++;s>5&&(r+=3+s-5)}for(var n=0;n<t-1;n++)for(var i=0;i<t-1;i++){var u=0;e.isDark(n,i)&&u++,e.isDark(n+1,i)&&u++,e.isDark(n,i+1)&&u++,e.isDark(n+1,i+1)&&u++,(0==u||4==u)&&(r+=3)}for(var n=0;n<t;n++)for(var i=0;i<t-6;i++)e.isDark(n,i)&&!e.isDark(n,i+1)&&e.isDark(n,i+2)&&e.isDark(n,i+3)&&e.isDark(n,i+4)&&!e.isDark(n,i+5)&&e.isDark(n,i+6)&&(r+=40);for(var i=0;i<t;i++)for(var n=0;n<t-6;n++)e.isDark(n,i)&&!e.isDark(n+1,i)&&e.isDark(n+2,i)&&e.isDark(n+3,i)&&e.isDark(n+4,i)&&!e.isDark(n+5,i)&&e.isDark(n+6,i)&&(r+=40);for(var c=0,i=0;i<t;i++)for(var n=0;n<t;n++)e.isDark(n,i)&&c++;return r+Math.abs(100*c/t/t-50)/5*10}},a={glog:function(e){if(e<1)throw Error("glog("+e+")");return a.LOG_TABLE[e]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return a.EXP_TABLE[e]},EXP_TABLE:Array(256),LOG_TABLE:Array(256)},l=0;l<8;l++)a.EXP_TABLE[l]=1<<l;for(var l=8;l<256;l++)a.EXP_TABLE[l]=a.EXP_TABLE[l-4]^a.EXP_TABLE[l-5]^a.EXP_TABLE[l-6]^a.EXP_TABLE[l-8];for(var l=0;l<255;l++)a.LOG_TABLE[a.EXP_TABLE[l]]=l;function u(e,t){if(void 0==e.length)throw Error(e.length+"/"+t);for(var r=0;r<e.length&&0==e[r];)r++;this.num=Array(e.length-r+t);for(var n=0;n<e.length-r;n++)this.num[n]=e[n+r]}function c(e,t){this.totalCount=e,this.dataCount=t}function h(){this.buffer=[],this.length=0}u.prototype={get:function(e){return this.num[e]},getLength:function(){return this.num.length},multiply:function(e){for(var t=Array(this.getLength()+e.getLength()-1),r=0;r<this.getLength();r++)for(var n=0;n<e.getLength();n++)t[r+n]^=a.gexp(a.glog(this.get(r))+a.glog(e.get(n)));return new u(t,0)},mod:function(e){if(this.getLength()-e.getLength()<0)return this;for(var t=a.glog(this.get(0))-a.glog(e.get(0)),r=Array(this.getLength()),n=0;n<this.getLength();n++)r[n]=this.get(n);for(var n=0;n<e.getLength();n++)r[n]^=a.gexp(a.glog(e.get(n))+t);return new u(r,0).mod(e)}},c.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37
1],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],c.getRSBlocks=function(e,t){var r=c.getRsBlockTable(e,t);if(void 0==r)throw Error("bad rs block @ typeNumber:"+e+"/errorCorrectLevel:"+t);for(var n=r.length/3,i=[],s=0;s<n;s++)for(var o=r[3*s+0],a=r[3*s+1],l=r[3*s+2],u=0;u<o;u++)i.push(new c(a,l));return i},c.getRsBlockTable=function(e,t){switch(t){case i.L:return c.RS_BLOCK_TABLE[(e-1)*4+0];case i.M:return c.RS_BLOCK_TABLE[(e-1)*4+1];case i.Q:return c.RS_BLOCK_TABLE[(e-1)*4+2];case i.H:return c.RS_BLOCK_TABLE[(e-1)*4+3];default:return}},h.prototype={get:function(e){var t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(var r=0;r<t;r++)this.putBit((e>>>t-r-1&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 d=[[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 f(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 Error("Expected 'content' as string!");if(0===this.options.content.length)throw Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0)||!(this.options.height>0))throw Error("Expected 'width' or 'height' value to be higher than zero!");var n=this.options.content,s=function(e,t){for(var r,n=(r=encodeURI(e).toString().replace(/\%[0-9a-fA-F]{2}/g,"a")).length+(r.length!=e?3:0),i=1,s=0,o=0,a=d.length;o<=a;o++){var l=d[o];if(!l)throw Error("Content too long: expected "+s+" but got "+n);switch(t){case"L":s=l[0];break;case"M":s=l[1];break;case"Q":s=l[2];break;case"H":s=l[3];break;default:throw Error("Unknwon error correction level: "+t)}if(n<=s)break;i++}if(i>d.length)throw Error("Content too long");return i}(n,this.options.ecl),o=function(e){switch(e){case"L":return i.L;case"M":return i.M;case"Q":return i.Q;case"H":return i.H;default:throw Error("Unknwon error correction level: "+e)}}(this.options.ecl);this.qrcode=new r(s,o),this.qrcode.addData(n),this.qrcode.make()}f.prototype.svg=function(e){var t=this.options||{},r=this.qrcode.modules;void 0===e&&(e={container:t.container||"svg"});for(var n=void 0===t.pretty||!!t.pretty,i=n?"  ":"",s=n?"\r\n":"",o=t.width,a=t.height,l=r.length,u=o/(l+2*t.padding),c=a/(l+2*t.padding),h=void 0!==t.join&&!!t.join,d=void 0!==t.swap&&!!t.swap,f=void 0===t.xmlDeclaration||!!t.xmlDeclaration,p=void 0!==t.predefined&&!!t.predefined,g=p?i+'<defs><path id="qrmodule" d="M0 0 h'+c+" v"+u+' H0 z" style="fill:'+t.color+';shape-rendering:crispEdges;" /></defs>'+s:"",y=i+'<rect x="0" y="0" width="'+o+'" height="'+a+'" style="fill:'+t.background+';shape-rendering:crispEdges;"/>'+s,m="",v="",b=0;b<l;b++)for(var w=0;w<l;w++)if(r[w][b]){var _=w*u+t.padding*u,E=b*c+t.padding*c;if(d){var S=_;_=E,E=S}if(h){var A=u+_,k=c+E;_=Number.isInteger(_)?Number(_):_.toFixed(2),E=Number.isInteger(E)?Number(E):E.toFixed(2),A=Number.isInteger(A)?Number(A):A.toFixed(2),v+="M"+_+","+E+" V"+(k=Number.isInteger(k)?Number(k):k.toFixed(2))+" H"
1+A+" V"+E+" H"+_+" Z "}else p?m+=i+'<use x="'+_.toString()+'" y="'+E.toString()+'" href="#qrmodule" />'+s:m+=i+'<rect x="'+_.toString()+'" y="'+E.toString()+'" width="'+u+'" height="'+c+'" style="fill:'+t.color+';shape-rendering:crispEdges;"/>'+s}h&&(m=i+'<path x="0" y="0" style="fill:'+t.color+';shape-rendering:crispEdges;" d="'+v+'" />');let C="";if(void 0!==this.options.image&&this.options.image.svg){let e=o*this.options.image.width/100,t=a*this.options.image.height/100;C+=`<svg x="${o/2-e/2}" y="${a/2-t/2}" width="${e}" height="${t}" viewBox="0 0 100 100" preserveAspectRatio="xMinYMin meet">`+(this.options.image.svg+s)+"</svg>"}var I="";switch(e.container){case"svg":f&&(I+='<?xml version="1.0" standalone="yes"?>'+s),I+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+o+'" height="'+a+'">'+s+(g+y+m)+C+"</svg>";break;case"svg-viewbox":f&&(I+='<?xml version="1.0" standalone="yes"?>'+s),I+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 '+o+" "+a+'">'+s+(g+y+m)+C+"</svg>";break;case"g":I+='<g width="'+o+'" height="'+a+'">'+s+(g+y+m)+C+"</g>";break;default:I+=(g+y+m+C).replace(/^\s+/,"")}return I},e.exports=f},54750:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LIB_VERSION=void 0,t.LIB_VERSION="3.9.3"},25796:function(e,t,r){"use strict";function n(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=function e(t){var r,n,i="";if("string"==typeof t||"number"==typeof t)i+=t;else if("object"==typeof t){if(Array.isArray(t))for(r=0;r<t.length;r++)t[r]&&(n=e(t[r]))&&(i&&(i+=" "),i+=n);else for(r in t)t[r]&&(i&&(i+=" "),i+=r)}return i}(e))&&(n&&(n+=" "),n+=t);return n}r.r(t),r.d(t,{clsx:function(){return n}}),t.default=n},37676:function(e,t,r){"use strict";r.d(t,{J:function(){return i},c:function(){return s}});var n=r(9784);function i(e){e=atob(e);let t=[];for(let r=0;r<e.length;r++)t.push(e.charCodeAt(r));return(0,n.lE)(t)}function s(e){e=(0,n.lE)(e);let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}},75194:function(e,t,r){"use strict";r.d(t,{i:function(){return n}});let n="hash/5.7.0"},6352:function(e,t,r){"use strict";r.d(t,{E:function(){return k}});var n=r(89005),i=r(22594),s=r(9784),o=r(43481),a=r(36173),l=r(13421),u=r(75194),c=r(99554);let h=new l.Yd(u.i),d=new Uint8Array(32);d.fill(0);let f=i.O$.from(-1),p=i.O$.from(0),g=i.O$.from(1),y=i.O$.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),m=(0,s.$m)(g.toHexString(),32),v=(0,s.$m)(p.toHexString(),32),b={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},w=["name","version","chainId","verifyingContract","salt"];function _(e){return function(t){return"string"!=typeof t&&h.throwArgumentError(`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,t),t}}let E={name:_("name"),version:_("version"),chainId:function(e){try{return i.O$.from(e).toString()}catch(e){}return h.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",e)},verifyingContract:function(e){try{return(0,n.Kn)(e).toLowerCase()}catch(e){}return h.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){try{let t=(0,s.lE)(e);if(32!==t.length)throw Error("bad length");return(0,s.Dv)(t)}catch(e){}return h.throwArgumentError('invalid domain value "salt"',"domain.salt",e)}};function S(e){{let t=e.match(/^(u?)int(\d*)$/);if(t){let r=""===t[1],n=parseInt(t[2]||"256");(n%8!=0||n>256||t[2]&&t[2]!==String(n))&&h.throwArgumentError("invalid numeric width","type",e);let o=y.mask(r?n-1:n),a=r?o.add(g).mul(f):p;return function(t){let r=i.O$.from(t);return(r.lt(a)||r.gt(o))&&h.throwArgumentError(`value out-of-bounds for ${e}`,"value",t),(0,s.$m)(r.toTwos(256).toHexString(),32)}}}{let t=e.match(/^bytes(\d+)$/);if(t){let r=parseInt(t[1]);return(0===r||r>32||t[1]!==String(r))&&h.throwArgumentError("invalid bytes width","type",e),function(t){return(0,s.lE)(t).length!==r&&h.throwArgumentError(`invalid length for ${e}`,"value",t),function(e){let t=(0,s.lE)(e),r=t.length%32;return r?(0,s.xs)([t,d.slice(r)]):(0,s.Dv)(t)}(t)}}}switch(e){case"address":return function(e){return(0,s.$m)((0,n.Kn)(e),32)};case"bool":return function(e){return e?m:v};case"bytes":return function(e){return(0,o.w)(e)};case"string":return function(e){return(0,c.id)(e)}}return null}function A(e,t){return`${e}(${t.map(({name:e,type:t})=>t+" "+e).join(",")})`}class k{constructor(e){(0,a.zG)(this,"types",Object.freeze((0,a.p$)(e))),(0,a.zG)(this,"_encoderCache",{}),(0,a.zG)(this,"_types",{});let t={},r={},n={};
1for(let i in Object.keys(e).forEach(e=>{t[e]={},r[e]=[],n[e]={}}),e){let n={};e[i].forEach(s=>{n[s.name]&&h.throwArgumentError(`duplicate variable name ${JSON.stringify(s.name)} in ${JSON.stringify(i)}`,"types",e),n[s.name]=!0;let o=s.type.match(/^([^\x5b]*)(\x5b|$)/)[1];o===i&&h.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",e),S(o)||(r[o]||h.throwArgumentError(`unknown type ${JSON.stringify(o)}`,"types",e),r[o].push(i),t[i][o]=!0)})}let i=Object.keys(r).filter(e=>0===r[e].length);for(let s in 0===i.length?h.throwArgumentError("missing primary type","types",e):i.length>1&&h.throwArgumentError(`ambiguous primary types or unused types: ${i.map(e=>JSON.stringify(e)).join(", ")}`,"types",e),(0,a.zG)(this,"primaryType",i[0]),!function i(s,o){o[s]&&h.throwArgumentError(`circular type reference to ${JSON.stringify(s)}`,"types",e),o[s]=!0,Object.keys(t[s]).forEach(e=>{r[e]&&(i(e,o),Object.keys(o).forEach(t=>{n[t][e]=!0}))}),delete o[s]}(this.primaryType,{}),n){let t=Object.keys(n[s]);t.sort(),this._types[s]=A(s,e[s])+t.map(t=>A(t,e[t])).join("")}}getEncoder(e){let t=this._encoderCache[e];return t||(t=this._encoderCache[e]=this._getEncoder(e)),t}_getEncoder(e){{let t=S(e);if(t)return t}let t=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(t){let e=t[1],r=this.getEncoder(e),n=parseInt(t[3]);return t=>{n>=0&&t.length!==n&&h.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t);let i=t.map(r);return this._types[e]&&(i=i.map(o.w)),(0,o.w)((0,s.xs)(i))}}let r=this.types[e];if(r){let t=(0,c.id)(this._types[e]);return e=>{let n=r.map(({name:t,type:r})=>{let n=this.getEncoder(r)(e[t]);return this._types[r]?(0,o.w)(n):n});return n.unshift(t),(0,s.xs)(n)}}return h.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){let t=this._types[e];return t||h.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return(0,o.w)(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,r){if(S(e))return r(e,t);let n=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){let e=n[1],i=parseInt(n[3]);return i>=0&&t.length!==i&&h.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map(t=>this._visit(e,t,r))}let i=this.types[e];return i?i.reduce((e,{name:n,type:i})=>(e[n]=this._visit(i,t[n],r),e),{}):h.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new k(e)}static getPrimaryType(e){return k.from(e).primaryType}static hashStruct(e,t,r){return k.from(t).hashStruct(e,r)}static hashDomain(e){let t=[];for(let r in e){let n=b[r];n||h.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),t.push({name:r,type:n})}return t.sort((e,t)=>w.indexOf(e.name)-w.indexOf(t.name)),k.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,r){return(0,s.xs)(["0x1901",k.hashDomain(e),k.from(t).hash(r)])}static hash(e,t,r){return(0,o.w)(k.encode(e,t,r))}static resolveNames(e,t,r,n){var i,o,l,u;return i=this,o=void 0,l=void 0,u=function*(){e=(0,a.DC)(e);let i={};e.verifyingContract&&!(0,s.A7)(e.verifyingContract,20)&&(i[e.verifyingContract]="0x");let o=k.from(t);for(let e in o.visit(r,(e,t)=>("address"!==e||(0,s.A7)(t,20)||(i[t]="0x"),t)),i)i[e]=yield n(e);return e.verifyingContract&&i[e.verifyingContract]&&(e.verifyingContract=i[e.verifyingContract]),r=o.visit(r,(e,t)=>"address"===e&&i[t]?i[t]:t),{domain:e,value:r}},new(l||(l=Promise))(function(e,t){function r(e){try{s(u.next(e))}catch(e){t(e)}}function n(e){try{s(u.throw(e))}catch(e){t(e)}}function s(t){var i;t.done?e(t.value):((i=t.value)instanceof l?i:new l(function(e){e(i)})).then(r,n)}s((u=u.apply(i,o||[])).next())})}static getPayload(e,t,r){k.hashDomain(e);let n={},o=[];w.forEach(t=>{let r=e[t];null!=r&&(n[t]=E[t](r),o.push({name:t,type:b[t]}))});let l=k.from(t),u=(0,a.DC)(t);return u.EIP712Domain?h.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",t):u.EIP712Domain=o,l.encode(r),{types:u,domain:n,primaryType:l.primaryType,message:l.visit(r,(e,t)=>{if(e.match(/^bytes(\d*)/))return(0,s.Dv)((0,s.lE)(t));if(e.match(/^u?int/))return i.O$.from(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!=typeof t&&h.throwArgumentError("invalid string","value",t),t}return h.throwArgumentError("unsupported type","type",e)})}}}},86365:function(e,t,r){"use strict";r.d(t,{i:function(){return n}});let n="providers/5.7.2"},55415:function(e,t,r){"use strict";let n,i;r.d(t,{Zk:function(){return ey}});var s,o=r(59035),a=r(37676),l=r(9784),u=r(36173);class c{constructor(e){(0,u.zG)(this,"alphabet",e),(0,u.zG)(this,"base",e.length),(0,u.zG)(this,"_alphabetMap",{}),(0,u.zG)(this,"_leader",e.charAt(0));for(let t=0;t<e.length;t++)this._alphabetMap[e.charAt(t)]=t}encode(e){let t=(0,l.lE)(e);if(0===t.length)return"";let r=[0];for(let e=0;e<t.length;++e){let n=t[e];for(let e=0;e<r.length;++e)n+=r[e]<<8,r[e]=n%this.base,n=n/this.base|0;for(;n>0;)r.push(n%this.base),n=n/this.base|0}let n="";for(let e=0;0===t[e]&&e<t.length-1;++e)n+=this._leader;for(let e=r.length-1;e>=0;--e)n+=this.alphabet[r[e]];return n}decode(e){if("string"!=typeof e)throw TypeError("Expected String");let t=[];if(0===e.length)return new Uint8Array(t);t.push(0);for(let r=0;r<e.length;r++){let n=this._alphabetMap[e[r]];if(void 0===n)throw Error("Non-base"+this.base+" character");let i=n;for(let e=0;e<t.length;++e)i+=t[e]*this.base,t[e]=255&i,i>>=8;for(;i>0;)t.push(255&i),i>>=8}for(let r=0;e[r]===this._leader&&r<e.length-1;++r)t.push(0);return(0,l.lE)(new Uint8Array(t.reverse()))}}new c("abcdefghijklmnopqrstuvwxyz234567");let h=new c("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");var d=r(22594),f=r(28257),p=r(43481),g=r(13421),y=r(75194);function m(e,t){null==t&&(t=1);let r=[],n=r.forEach,i=function(e,t){n.call(e,function(e){t>0&&Array.isArray(e)?i(e,t-1):r.push(e)})};return i(e,t),r}function v(e,t){let r=Array(e);for(let n=0,i=-1;n<e;n++)r[n]=i+=1+t();return r}function b(e,t){let r=v(e(),e),n=e(),i=v(n,e),s=function(e,t){let r=Array(e);for(let n=0;n<e;n++)r[n]=1+t();return r}(n,e);for(let e=0;e<n;e++)for(let t=0;t<s[e];t++)r.push(i[e]+t);return t?r.map(e=>t[e]):r}function w(e,t,r){let n=Array(e).fill(void 0).map(()=>[]);for(let i=0;i<t;i++)(function(e,t){let r=Array(e);for(let i=0,s=0;i<e;i++){var n;r[i]=s+=1&(n=t())?~n>>1:n>>1}return r})(e,r).forEach((e,t)=>n[t].push(e));return n}let _=(s=function(e){let t=0;function r(){return e[t++]<<8|e[t++]}let n=r(),i=1,s=[0,1];for(let e=1;e<n;e++)s.push(i+=r());
1let o=r(),a=t;t+=o;let l=0,u=0;function c(){return 0==l&&(u=u<<8|e[t++],l=8),u>>--l&1}let h=0;for(let e=0;e<31;e++)h=h<<1|c();let d=[],f=0,p=2147483648;for(;;){let e=Math.floor(((h-f+1)*i-1)/p),t=0,r=n;for(;r-t>1;){let n=t+r>>>1;e<s[n]?r=n:t=n}if(0==t)break;d.push(t);let o=f+Math.floor(p*s[t]/i),a=f+Math.floor(p*s[t+1]/i)-1;for(;((o^a)&1073741824)==0;)h=h<<1&2147483647|c(),o=o<<1&2147483647,a=a<<1&2147483647|1;for(;o&~a&536870912;)h=1073741824&h|h<<1&1073741823|c(),o=o<<1^1073741824,a=(1073741824^a)<<1|1073741825;f=o,p=1+a-o}let g=n-4;return d.map(t=>{switch(t-g){case 3:return g+65792+(e[a++]<<16|e[a++]<<8|e[a++]);case 2:return g+256+(e[a++]<<8|e[a++]);case 1:return g+e[a++];default:return t-1}})}((0,a.J)
vendor: 14,758 bytes, line 1
1("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA==")),
1i=0,()=>s[i++]),E=new Set(b(_)),S=new Set(b(_)),A=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(function(e,t){let r=1+t(),n=t(),i=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(r)}return t}(t);return m(w(i.length,1+e,t).map((e,t)=>{let s=e[0],o=e.slice(1);return Array(i[t]).fill(void 0).map((e,t)=>{let i=t*n;return[s+t*r,o.map(e=>e+i)]})}))}(r,e))}for(;;){let r=e()-1;if(r<0)break;t.push(w(1+e(),1+r,e).map(e=>[e[0],e.slice(1)]))}return function(e){let t={};for(let r=0;r<e.length;r++){let n=e[r];t[n[0]]=n[1]}return t}(m(t))}(_),k=(n=b(_).sort((e,t)=>e-t),function e(){let t=[];for(;;){let r=b(_,n);if(0==r.length)break;t.push({set:new Set(r),node:e()})}t.sort((e,t)=>
1t.set.size-e.set.size);let r=_();return{branches:t,valid:r%3,fe0f:!!(1&(r=r/3|0)),save:1==(r>>=1),check:2==r}}());function C(e){return e.filter(e=>65039!=e)}function I(e){for(let t of e.split(".")){let e=(0,f.XL)(t);try{for(let t=e.lastIndexOf(95)-1;t>=0;t--)if(95!==e[t])throw Error("underscore only allowed at start");if(e.length>=4&&e.every(e=>e<128)&&45===e[2]&&45===e[3])throw Error("invalid label extension")}catch(e){throw Error(`Invalid label "${t}": ${e.message}`)}}return e}let x=new g.Yd(y.i),P=new Uint8Array(32);function O(e){if(0===e.length)throw Error("invalid ENS name; empty component");return e}function T(e){let t=(0,f.Y0)(I(function(e,t){let r=(0,f.XL)(e).reverse(),n=[];for(;r.length;){let e=function(e,t){var r;let n,i;let s=k,o=[],a=e.length;for(;a;){let t=e[--a];if(!(s=null===(r=s.branches.find(e=>e.set.has(t)))||void 0===r?void 0:r.node))break;if(s.save)i=t;else if(s.check&&t===i)break;o.push(t),s.fe0f&&(o.push(65039),a>0&&65039==e[a-1]&&a--),s.valid&&(n=o.slice(),2==s.valid&&n.splice(1,1),e.length=a)}return n}(r);if(e){n.push(...t(e));continue}let i=r.pop();if(E.has(i)){n.push(i);continue}if(S.has(i))continue;let s=A[i];if(s){n.push(...s);continue}throw Error(`Disallowed codepoint: 0x${i.toString(16).toUpperCase()}`)}return I(String.fromCodePoint(...n).normalize("NFC"))}(e,C))),r=[];if(0===e.length)return r;let n=0;for(let e=0;e<t.length;e++)46===t[e]&&(r.push(O(t.slice(n,e))),n=e+1);if(n>=t.length)throw Error("invalid ENS name; empty component");return r.push(O(t.slice(n))),r}function R(e){"string"!=typeof e&&x.throwArgumentError("invalid ENS name; not a string","name",e);let t=P,r=T(e);for(;r.length;)t=(0,p.w)((0,l.zo)([t,(0,p.w)(r.pop())]));return(0,l.Dv)(t)}P.fill(0);let N=new g.Yd("networks/5.7.1");function D(e){let t=function(t,r){null==r&&(r={});let n=[];if(t.InfuraProvider&&"-"!==r.infura)try{n.push(new t.InfuraProvider(e,r.infura))}catch(e){}if(t.EtherscanProvider&&"-"!==r.etherscan)try{n.push(new t.EtherscanProvider(e,r.etherscan))}catch(e){}if(t.AlchemyProvider&&"-"!==r.alchemy)try{n.push(new t.AlchemyProvider(e,r.alchemy))}catch(e){}if(t.PocketProvider&&"-"!==r.pocket)try{let i=new t.PocketProvider(e,r.pocket);i.network&&-1===["goerli","ropsten","rinkeby","sepolia"].indexOf(i.network.name)&&n.push(i)}catch(e){}if(t.CloudflareProvider&&"-"!==r.cloudflare)try{n.push(new t.CloudflareProvider(e))}catch(e){}if(t.AnkrProvider&&"-"!==r.ankr)try{let i=new t.AnkrProvider(e,r.ankr);i.network&&-1===["ropsten"].indexOf(i.network.name)&&n.push(i)}catch(e){}if(0===n.length)return null;if(t.FallbackProvider){let i=1;return null!=r.quorum?i=r.quorum:"homestead"===e&&(i=2),new t.FallbackProvider(n,i)}return n[0]};return t.renetwork=function(e){return D(e)},t}function B(e,t){let r=function(r,n){return r.JsonRpcProvider?new r.JsonRpcProvider(e,t):null};return r.renetwork=function(t){return B(e,t)},r}let M={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:D("homestead")},L={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:D("ropsten")},U={chainId:63,name:"classicMordor",_defaultProvider:B("https://www.ethercluster.com/mordor","classicMordor")},j={unspecified:{chainId:0,name:"unspecified"},homestead:M,mainnet:M,morden:{chainId:2,name:"morden"},ropsten:L,testnet:L,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:D("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:D("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:D("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:D("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:B("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:U,classicTestnet:U,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:B("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:D("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:D("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"}};var F=r(83699),q=r.n(F);function H(e){return"0x"+q().sha256().update((0,l.lE)(e)).digest("hex")}new g.Yd("sha2/5.7.0");var z=r(46396),$=r(1192),V=r.n($),W=r(86365),G=r(86160),K=function(e,t,r,n){return new(r||(r=Promise))(function(i,s){function o(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};let J=new g.Yd(W.i);function Y(e){return null==e?"null":(32!==(0,l.E1)(e)&&J.throwArgumentError("invalid topic","topic",e),e.toLowerCase())}function Q(e){for(e=e.slice();e.length>0&&null==e[e.length-1];)e.pop();return e.map(e=>{if(!Array.isArray(e))return Y(e);{let t={};
1e.forEach(e=>{t[Y(e)]=!0});let r=Object.keys(t);return r.sort(),r.join("|")}}).join("&")}function Z(e){if("string"==typeof e){if(e=e.toLowerCase(),32===(0,l.E1)(e))return"tx:"+e;if(-1===e.indexOf(":"))return e}else if(Array.isArray(e))return"filter:*:"+Q(e);else if(o.Sg.isForkEvent(e))throw J.warn("not implemented"),Error("not implemented");else if(e&&"object"==typeof e)return"filter:"+(e.address||"*")+":"+Q(e.topics||[]);throw Error("invalid event - "+e)}function X(){return new Date().getTime()}function ee(e){return new Promise(t=>{setTimeout(t,e)})}let et=["block","network","pending","poll"];class er{constructor(e,t,r){(0,u.zG)(this,"tag",e),(0,u.zG)(this,"listener",t),(0,u.zG)(this,"once",r),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){let e=this.tag.split(":");return"tx"!==e[0]?null:e[1]}get filter(){var e;let t=this.tag.split(":");if("filter"!==t[0])return null;let r=t[1],n=""===(e=t[2])?[]:e.split(/&/g).map(e=>{if(""===e)return[];let t=e.split("|").map(e=>"null"===e?null:e);return 1===t.length?t[0]:t}),i={};return n.length>0&&(i.topics=n),r&&"*"!==r&&(i.address=r),i}pollable(){return this.tag.indexOf(":")>=0||et.indexOf(this.tag)>=0}}let en={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 ei(e){return(0,l.$m)(d.O$.from(e).toHexString(),32)}function es(e){return h.encode((0,l.zo)([e,(0,l.p3)(H(H(e)),0,4)]))}let eo=RegExp("^(ipfs)://(.*)$","i"),ea=[RegExp("^(https)://(.*)$","i"),RegExp("^(data):(.*)$","i"),eo,RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function el(e,t){try{return(0,f.ZN)(eu(e,t))}catch(e){}return null}function eu(e,t){if("0x"===e)return null;let r=d.O$.from((0,l.p3)(e,t,t+32)).toNumber(),n=d.O$.from((0,l.p3)(e,r,r+32)).toNumber();return(0,l.p3)(e,r+32,r+32+n)}function ec(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):J.throwArgumentError("unsupported IPFS format","link",e),`https://gateway.ipfs.io/ipfs/${e}`}function eh(e){let t=(0,l.lE)(e);if(t.length>32)throw Error("internal; should not happen");let r=new Uint8Array(32);return r.set(t,32-t.length),r}function ed(e){let t=[],r=0;for(let n=0;n<e.length;n++)t.push(null),r+=32;for(let n=0;n<e.length;n++){let i=(0,l.lE)(e[n]);t[n]=eh(r),t.push(eh(i.length)),t.push(function(e){if(e.length%32==0)return e;let t=new Uint8Array(32*Math.ceil(e.length/32));return t.set(e),t}(i)),r+=32+32*Math.ceil(i.length/32)}return(0,l.xs)(t)}class ef{constructor(e,t,r,n){(0,u.zG)(this,"provider",e),(0,u.zG)(this,"name",r),(0,u.zG)(this,"address",e.formatter.address(t)),(0,u.zG)(this,"_resolvedAddress",n)}supportsWildcard(){return this._supportsEip2544||(this._supportsEip2544=this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then(e=>d.O$.from(e).eq(1)).catch(e=>{if(e.code===g.Yd.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e})),this._supportsEip2544}_fetch(e,t){return K(this,void 0,void 0,function*(){let r={to:this.address,ccipReadEnabled:!0,data:(0,l.xs)([e,R(this.name),t||"0x"])},n=!1;if(yield this.supportsWildcard()){var i;n=!0,r.data=(0,l.xs)(["0x9061b923",ed([(i=this.name,(0,l.Dv)((0,l.zo)(T(i).map(e=>{if(e.length>63)throw Error("invalid DNS encoded entry; length exceeds 63 bytes");let t=new Uint8Array(e.length+1);return t.set(e,1),t[0]=t.length-1,t})))+"00"),r.data])])}try{let e=yield this.provider.call(r);return(0,l.lE)(e).length%32==4&&J.throwError("resolver threw error",g.Yd.errors.CALL_EXCEPTION,{transaction:r,data:e}),n&&(e=eu(e,0)),e}catch(e){if(e.code===g.Yd.errors.CALL_EXCEPTION)return null;throw e}})}_fetchBytes(e,t){return K(this,void 0,void 0,function*(){let r=yield this._fetch(e,t);return null!=r?eu(r,0):null})}_getAddress(e,t){let r=en[String(e)];if(null==r&&J.throwError(`unsupported coin type: ${e}`,g.Yd.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),"eth"===r.ilk)return this.provider.formatter.address(t);let n=(0,l.lE)(t);if(null!=r.p2pkh){let e=t.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(e){let t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return es((0,l.zo)([[r.p2pkh],"0x"+e[2]]))}}if(null!=r.p2sh){let e=t.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(e){let t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return es((0,l.zo)([[r.p2sh],"0x"+e[2]]))}}if(null!=r.prefix){let e=n[1],t=n[0];if(0===t?20!==e&&32!==e&&(t=-1):t=-1,t>=0&&n.length===2+e&&e>=1&&e<=75){let e=V().toWords(n.slice(2));return e.unshift(t),V().encode(r.prefix,e)}}return null}getAddress(e){return K(this,void 0,void 0,function*(){if(null==e&&(e=60),60===e)try{let e=yield this._fetch("0x3b3b57de");if("0x"===e||"0x0000000000000000000000000000000000000000000000000000000000000000"===e)return null;return this.provider.formatter.callAddress(e)}catch(e){if(e.code===g.Yd.errors.CALL_EXCEPTION)return null;throw e}let t=yield this._fetchBytes("0xf1cb7e06",ei(e));if(null==t||"0x"===t)return null;let r=this._getAddress(e,t);return null==r&&J.throwError("invalid or unsupported coin data",g.Yd.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:t}),r})}getAvatar(){return K(this,void 0,void 0,function*(){let e=[{type:"name",content:this.name}];try{let t=yield this.getText("avatar");if(null==t)return null;for(let r=0;r<ea.length;r++){let n=t.match(ea[r]);if(null==n)continue;let i=n[1].toLowerCase();switch(i){case"https":return e.push({type:"url",content:t}),{linkage:e,url:t};case"data":return e.push({type:"data",content:t}),{linkage:e,url:t};case"ipfs":return e.push({type:"ipfs",content:t}),{linkage:e,url:ec(t)};case"erc721":case"erc1155":{let r="erc721"===i?"0xc87b56dd":"0x0e89341c";e.push({type:i,content:t});let s=this._resolvedAddress||(yield this.getAddress()),o=(n[2]||"").split("/");if(2!==o.length)return null;let a=yield this.provider.formatter.address(o[0]),u=(0,l.$m)(d.O$.from(o[1]).toHexString(),32);if("erc721"===i){let t=this.provider.formatter.callAddress((yield this.provider.call({to:a,data:(0,l.xs)(["0x6352211e",u])})));if(s!==t)return null;e.push({type:"owner",content:t})}else if("erc1155"===i){let t=d.O$.from((yield this.provider.call({to:a,data:(0,l.xs)(["0x00fdd58e",(0,l.$m)(s,32),u])})));if(t.isZero())return null;e.push({type:"balance",content:t.toString()})}let c={to:this.provider.formatter.address(o[0]),data:(0,l.xs)([r,u])},h=el((yield this.provider.call(c)),0);if(null==h)return null;e.push({type:"metadata-url-base",content:h}),"erc1155"===i&&(h=h.replace("{id}",u.substring(2)),e.push({type:"metadata-url-expanded",content:h})),h.match(/^ipfs:/i)&&(h=ec(h)),e.push({type:"metadata-url",content:h});let f=yield(0,z.rd)(h);if(!f)return null;e.push({type:"metadata",content:JSON.stringify(f)});let p=f.image;if("string"!=typeof p)return null;if(p.match(/^(https:\/\/|data:)/i));else{let t=p.match(eo);if(null==t)return null;e.push({type:"url-ipfs",content:p}),p=ec(p)}return e.push({type:"url",content:p}),{linkage:e,url:p}}}}}catch(e){}return null})}getContentHash(){return K(this,void 0,void 0,function*(){let e=yield this._fetchBytes("0xbc1c58d1");if(null==e||"0x"===e)return null;let t=e.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(t){let e=parseInt(t[3],16);if(t[4].length===2*e)return"ipfs://"+h.encode("0x"+t[1])}let r=e.match(/^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(r){let e=parseInt(r[3],16);if(r[4].length===2*e)return"ipns://"+h.encode("0x"+r[1])}let n=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(n&&64===n[1].length)return"bzz://"+n[1];let i=e.match(/^0x90b2c605([0-9a-f]*)$/);if(i&&68===i[1].length){let e={"=":"","+":"-","/":"_"};return"sia://"+(0,a.c)("0x"+i[1]).replace(/[=+\/]/g,t=>e[t])}return J.throwError("invalid or unsupported content hash data",g.Yd.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})})}getText(e){return K(this,void 0,void 0,function*(){let t=(0,f.Y0)(e);(t=(0,l.zo)([ei(64),ei(t.length),t])).length%32!=0&&(t=(0,l.zo)([t,(0,l.$m)("0x",32-e.length%32)]));let r=yield this._fetchBytes("0x59d1d43c",(0,l.Dv)(t));return null==r||"0x"===r?null:(0,f.ZN)(r)})}}let ep=null,eg=1;class ey extends o.zt{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),(0,u.zG)(this,"anyNetwork","any"===e),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch(e=>{}),this._ready().catch(e=>{});else{let t=(0,u.tu)(new.target,"getNetwork")(e);
1t?((0,u.zG)(this,"_network",t),this.emit("network",t,null)):J.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return K(this,void 0,void 0,function*(){if(null==this._network){let e=null;if(this._networkPromise)try{e=yield this._networkPromise}catch(e){}null==e&&(e=yield this.detectNetwork()),e||J.throwError("no network detected",g.Yd.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=e:(0,u.zG)(this,"_network",e),this.emit("network",e,null))}return this._network})}get ready(){return(0,z.$l)(()=>this._ready().then(e=>e,e=>{if(e.code!==g.Yd.errors.NETWORK_ERROR||"noNetwork"!==e.event)throw e}))}static getFormatter(){return null==ep&&(ep=new G.Mb),ep}static getNetwork(e){return function(e){if(null==e)return null;if("number"==typeof e){for(let t in j){let r=j[t];if(r.chainId===e)return{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress||null,_defaultProvider:r._defaultProvider||null}}return{chainId:e,name:"unknown"}}if("string"==typeof e){let t=j[e];return null==t?null:{name:t.name,chainId:t.chainId,ensAddress:t.ensAddress,_defaultProvider:t._defaultProvider||null}}let t=j[e.name];if(!t)return"number"!=typeof e.chainId&&N.throwArgumentError("invalid network chainId","network",e),e;0!==e.chainId&&e.chainId!==t.chainId&&N.throwArgumentError("network chainId mismatch","network",e);let r=e._defaultProvider||null;if(null==r&&t._defaultProvider){var n;r=(n=t._defaultProvider)&&"function"==typeof n.renetwork?t._defaultProvider.renetwork(e):t._defaultProvider}return{name:e.name,chainId:t.chainId,ensAddress:e.ensAddress||t.ensAddress||null,_defaultProvider:r}}(null==e?"homestead":e)}ccipReadFetch(e,t,r){return K(this,void 0,void 0,function*(){if(this.disableCcipRead||0===r.length)return null;let n=e.to.toLowerCase(),i=t.toLowerCase(),s=[];for(let e=0;e<r.length;e++){let t=r[e],o=t.replace("{sender}",n).replace("{data}",i),a=t.indexOf("{data}")>=0?null:JSON.stringify({data:i,sender:n}),l=yield(0,z.rd)({url:o,errorPassThrough:!0},a,(e,t)=>(e.status=t.statusCode,e));if(l.data)return l.data;let u=l.message||"unknown error";if(l.status>=400&&l.status<500)return J.throwError(`response not found during CCIP fetch: ${u}`,g.Yd.errors.SERVER_ERROR,{url:t,errorMessage:u});s.push(u)}return J.throwError(`error encountered during CCIP fetch: ${s.map(e=>JSON.stringify(e)).join(", ")}`,g.Yd.errors.SERVER_ERROR,{urls:r,errorMessages:s})})}_getInternalBlockNumber(e){return K(this,void 0,void 0,function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){let t=this._internalBlockNumber;try{let r=yield t;if(X()-r.respTime<=e)return r.blockNumber;break}catch(e){if(this._internalBlockNumber===t)break}}let t=X(),r=(0,u.mE)({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then(e=>null,e=>e)}).then(({blockNumber:e,networkError:n})=>{if(n)throw this._internalBlockNumber===r&&(this._internalBlockNumber=null),n;let i=X();return(e=d.O$.from(e).toNumber())<this._maxInternalBlockNumber&&(e=this._maxInternalBlockNumber),this._maxInternalBlockNumber=e,this._setFastBlockNumber(e),{blockNumber:e,reqTime:t,respTime:i}});return this._internalBlockNumber=r,r.catch(e=>{this._internalBlockNumber===r&&(this._internalBlockNumber=null)}),(yield r).blockNumber})}poll(){return K(this,void 0,void 0,function*(){let e=eg++,t=[],r=null;try{r=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(e){this.emit("error",e);return}if(this._setFastBlockNumber(r),this.emit("poll",e,r),r===this._lastBlockNumber){this.emit("didPoll",e);return}if(-2===this._emitted.block&&(this._emitted.block=r-1),Math.abs(this._emitted.block-r)>1e3)J.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${r})`),this.emit("error",J.makeError("network block skew detected",g.Yd.errors.NETWORK_ERROR,{blockNumber:r,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",r);else for(let e=this._emitted.block+1;e<=r;
1e++)this.emit("block",e);this._emitted.block!==r&&(this._emitted.block=r,Object.keys(this._emitted).forEach(e=>{if("block"===e)return;let t=this._emitted[e];"pending"!==t&&r-t>12&&delete this._emitted[e]})),-2===this._lastBlockNumber&&(this._lastBlockNumber=r-1),this._events.forEach(e=>{switch(e.type){case"tx":{let r=e.hash,n=this.getTransactionReceipt(r).then(e=>(e&&null!=e.blockNumber&&(this._emitted["t:"+r]=e.blockNumber,this.emit(r,e)),null)).catch(e=>{this.emit("error",e)});t.push(n);break}case"filter":if(!e._inflight){e._inflight=!0,-2===e._lastBlockNumber&&(e._lastBlockNumber=r-1);let n=e.filter;n.fromBlock=e._lastBlockNumber+1,n.toBlock=r;let i=n.toBlock-this._maxFilterBlockRange;i>n.fromBlock&&(n.fromBlock=i),n.fromBlock<0&&(n.fromBlock=0);let s=this.getLogs(n).then(t=>{e._inflight=!1,0!==t.length&&t.forEach(t=>{t.blockNumber>e._lastBlockNumber&&(e._lastBlockNumber=t.blockNumber),this._emitted["b:"+t.blockHash]=t.blockNumber,this._emitted["t:"+t.transactionHash]=t.blockNumber,this.emit(n,t)})}).catch(t=>{this.emit("error",t),e._inflight=!1});t.push(s)}}}),this._lastBlockNumber=r,Promise.all(t).then(()=>{this.emit("didPoll",e)}).catch(e=>{this.emit("error",e)})})}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return K(this,void 0,void 0,function*(){return J.throwError("provider does not support network detection",g.Yd.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})})}getNetwork(){return K(this,void 0,void 0,function*(){let e=yield this._ready(),t=yield this.detectNetwork();if(e.chainId!==t.chainId){if(this.anyNetwork)return this._network=t,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",t,e),yield ee(0),this._network;let r=J.makeError("underlying network changed",g.Yd.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:t});throw this.emit("error",r),r}return e})}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then(e=>{this._setFastBlockNumber(e)},e=>{}),null!=this._fastBlockNumber?this._fastBlockNumber:-1}get polling(){return null!=this._poller}set polling(e){e&&!this._poller?(this._poller=setInterval(()=>{this.poll()},this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout(()=>{this.poll(),this._bootstrapPoll=setTimeout(()=>{this._poller||this.poll(),this._bootstrapPoll=null},this.pollingInterval)},0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){if("number"!=typeof e||e<=0||parseInt(String(e))!=e)throw Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval(()=>{this.poll()},this._pollingInterval))}_getFastBlockNumber(){let e=X();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then(e=>((null==this._fastBlockNumber||e>this._fastBlockNumber)&&(this._fastBlockNumber=e),this._fastBlockNumber))),this._fastBlockNumberPromise}_setFastBlockNumber(e){(null==this._fastBlockNumber||!(e<this._fastBlockNumber))&&(this._fastQueryDate=X(),(null==this._fastBlockNumber||e>this._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,t,r){return K(this,void 0,void 0,function*(){return this._waitForTransaction(e,null==t?1:t,r||0,null)})}_waitForTransaction(e,t,r,n){return K(this,void 0,void 0,function*(){let i=yield this.getTransactionReceipt(e);return(i?i.confirmations:0)>=t?i:new Promise((i,s)=>{let o=[],a=!1,l=function(){return!!a||(a=!0,o.forEach(e=>{e()}),!1)},u=e=>{e.confirmations<t||l()||i(e)};if(this.on(e,u),o.push(()=>{this.removeListener(e,u)}),n){let r=n.startBlock,i=null,u=o=>K(this,void 0,void 0,function*(){a||(yield ee(1e3),this.getTransactionCount(n.from).then(c=>K(this,void 0,void 0,function*(){if(!a){if(c<=n.nonce)r=o;else{{let t=yield this.getTransaction(e);if(t&&null!=t.blockNumber)return}for(null==i&&(i=r-3)<n.startBlock&&(i=n.startBlock);i<=o;){if(a)return;let r=yield this.getBlockWithTransactions(i);for(let i=0;i<r.transactions.length;i++){let o=r.transactions[i];if(o.hash===e)return;if(o.from===n.from&&o.nonce===n.nonce){if(a)return;let r=yield this.waitForTransaction(o.hash,t);if(l())return;let i="replaced";o.data===n.data&&o.to===n.to&&o.value.eq(n.value)?i="repriced":"0x"===o.data&&o.from===o.to&&o.value.isZero()&&(i="cancelled"),s(J.makeError("transaction was replaced",g.Yd.errors.TRANSACTION_REPLACED,{cancelled:"replaced"===i||"cancelled"===i,reason:i,replacement:this._wrapTransaction(o),hash:e,receipt:r}));return}}i++}}a||this.once("block",u)}}),e=>{a||this.once("block",u)}))});if(a)return;this.once("block",u),o.push(()=>{this.removeListener("block",u)})}if("number"==typeof r&&r>0){let e=setTimeout(()=>{l()||s(J.makeError("timeout exceeded",g.Yd.errors.TIMEOUT,{timeout:r}))},r);e.unref&&e.unref(),o.push(()=>{clearTimeout(e)})}})})}getBlockNumber(){return K(this,void 0,void 0,function*(){return this._getInternalBlockNumber(0)})}getGasPrice(){return K(this,void 0,void 0,function*(){yield this.getNetwork();let e=yield this.perform("getGasPrice",{});try{return d.O$.from(e)}catch(t){return J.throwError("bad result from backend",g.Yd.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:t})}})}getBalance(e,t){return K(this,void 0,void 0,function*(){yield this.getNetwork();let r=yield(0,u.mE)({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getBalance",r);try{return d.O$.from(n)}catch(e){return J.throwError("bad result from backend",g.Yd.errors.SERVER_ERROR,{method:"getBalance",params:r,result:n,error:e})}})}getTransactionCount(e,t){return K(this,void 0,void 0,function*(){yield this.getNetwork();let r=yield(0,u.mE)({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getTransactionCount",r);try{return d.O$.from(n).toNumber()}catch(e){return J.throwError("bad result from backend",g.Yd.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:n,error:e})}})}getCode(e,t){return K(this,void 0,void 0,function*(){yield this.getNetwork();let r=yield(0,u.mE)({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getCode",r);try{return(0,l.Dv)(n)}catch(e){return J.throwError("bad result from backend",g.Yd.errors.SERVER_ERROR,{method:"getCode",params:r,result:n,error:e})}})}getStorageAt(e,t,r){return K(this,void 0,void 0,function*(){yield this.getNetwork();let n=yield(0,u.mE)({address:this._getAddress(e),blockTag:this._getBlockTag(r),position:Prom
1ise.resolve(t).then(e=>(0,l.$P)(e))}),i=yield this.perform("getStorageAt",n);try{return(0,l.Dv)(i)}catch(e){return J.throwError("bad result from backend",g.Yd.errors.SERVER_ERROR,{method:"getStorageAt",params:n,result:i,error:e})}})}_wrapTransaction(e,t,r){if(null!=t&&32!==(0,l.E1)(t))throw Error("invalid response - sendTransaction");return null!=t&&e.hash!==t&&J.throwError("Transaction hash mismatch from Provider.sendTransaction.",g.Yd.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),e.wait=(t,n)=>K(this,void 0,void 0,function*(){let i;null==t&&(t=1),null==n&&(n=0),0!==t&&null!=r&&(i={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:r});let s=yield this._waitForTransaction(e.hash,t,n,i);return null==s&&0===t?null:(this._emitted["t:"+e.hash]=s.blockNumber,0===s.status&&J.throwError("transaction failed",g.Yd.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:s}),s)}),e}sendTransaction(e){return K(this,void 0,void 0,function*(){yield this.getNetwork();let t=yield Promise.resolve(e).then(e=>(0,l.Dv)(e)),r=this.formatter.transaction(e);null==r.confirmations&&(r.confirmations=0);let n=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{let e=yield this.perform("sendTransaction",{signedTransaction:t});return this._wrapTransaction(r,e,n)}catch(e){throw e.transaction=r,e.transactionHash=r.hash,e}})}_getTransactionRequest(e){return K(this,void 0,void 0,function*(){let t=yield e,r={};return["from","to"].forEach(e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then(e=>e?this._getAddress(e):null))}),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach(e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then(e=>e?d.O$.from(e):null))}),["type"].forEach(e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then(e=>null!=e?e:null))}),t.accessList&&(r.accessList=this.formatter.accessList(t.accessList)),["data"].forEach(e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then(e=>e?(0,l.Dv)(e):null))}),this.formatter.transactionRequest((yield(0,u.mE)(r)))})}_getFilter(e){return K(this,void 0,void 0,function*(){e=yield e;let t={};return null!=e.address&&(t.address=this._getAddress(e.address)),["blockHash","topics"].forEach(r=>{null!=e[r]&&(t[r]=e[r])}),["fromBlock","toBlock"].forEach(r=>{null!=e[r]&&(t[r]=this._getBlockTag(e[r]))}),this.formatter.filter((yield(0,u.mE)(t)))})}_call(e,t,r){return K(this,void 0,void 0,function*(){r>=10&&J.throwError("CCIP read exceeded maximum redirections",g.Yd.errors.SERVER_ERROR,{redirects:r,transaction:e});let n=e.to,i=yield this.perform("call",{transaction:e,blockTag:t});if(r>=0&&"latest"===t&&null!=n&&"0x556f1830"===i.substring(0,10)&&(0,l.E1)(i)%32==4)try{let s=(0,l.p3)(i,4),o=(0,l.p3)(s,0,32);d.O$.from(o).eq(n)||J.throwError("CCIP Read sender did not match",g.Yd.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i});let a=[],u=d.O$.from((0,l.p3)(s,32,64)).toNumber(),c=d.O$.from((0,l.p3)(s,u,u+32)).toNumber(),h=(0,l.p3)(s,u+32);for(let t=0;t<c;t++){let r=el(h,32*t);null==r&&J.throwError("CCIP Read contained corrupt URL string",g.Yd.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i}),a.push(r)}let f=eu(s,64);d.O$.from((0,l.p3)(s,100,128)).isZero()||J.throwError("CCIP Read callback selector included junk",g.Yd.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i});let p=(0,l.p3)(s,96,100),y=eu(s,128),m=yield this.ccipReadFetch(e,f,a);null==m&&J.throwError("CCIP Read disabled or provided no URLs",g.Yd.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i});let v={to:n,data:(0,l.xs)([p,ed([m,y])])};return this._call(v,t,r+1)}catch(e){if(e.code===g.Yd.errors.SERVER_ERROR)throw e}try{return(0,l.Dv)(i)}catch(r){return J.throwError("bad result from backend",g.Yd.errors.SERVER_ERROR,{method:"call",params:{transaction:e,blockTag:t},result:i,error:r})}})}call(e,t){return K(this,void 0,void 0,function*(){yield this.getNetwork();let r=yield(0,u.mE)({transaction:this._getTransactionRequest(e),blockTag:this._getBlockTag(t),ccipReadEnabled:Promise.resolve(e.cci
1pReadEnabled)});return this._call(r.transaction,r.blockTag,r.ccipReadEnabled?0:-1)})}estimateGas(e){return K(this,void 0,void 0,function*(){yield this.getNetwork();let t=yield(0,u.mE)({transaction:this._getTransactionRequest(e)}),r=yield this.perform("estimateGas",t);try{return d.O$.from(r)}catch(e){return J.throwError("bad result from backend",g.Yd.errors.SERVER_ERROR,{method:"estimateGas",params:t,result:r,error:e})}})}_getAddress(e){return K(this,void 0,void 0,function*(){"string"!=typeof(e=yield e)&&J.throwArgumentError("invalid address or ENS name","name",e);let t=yield this.resolveName(e);return null==t&&J.throwError("ENS name not configured",g.Yd.errors.UNSUPPORTED_OPERATION,{operation:`resolveName(${JSON.stringify(e)})`}),t})}_getBlock(e,t){return K(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;let r=-128,n={includeTransactions:!!t};if((0,l.A7)(e,32))n.blockHash=e;else try{n.blockTag=yield this._getBlockTag(e),(0,l.A7)(n.blockTag)&&(r=parseInt(n.blockTag.substring(2),16))}catch(t){J.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",e)}return(0,z.$l)(()=>K(this,void 0,void 0,function*(){let e=yield this.perform("getBlock",n);if(null==e)return null!=n.blockHash&&null==this._emitted["b:"+n.blockHash]||null!=n.blockTag&&r>this._emitted.block?null:void 0;if(t){let t=null;for(let r=0;r<e.transactions.length;r++){let n=e.transactions[r];if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){null==t&&(t=yield this._getInternalBlockNumber(100+2*this.pollingInterval));let e=t-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}}let r=this.formatter.blockWithTransactions(e);return r.transactions=r.transactions.map(e=>this._wrapTransaction(e)),r}return this.formatter.block(e)}),{oncePoll:this})})}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return K(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;let t={transactionHash:this.formatter.hash(e,!0)};return(0,z.$l)(()=>K(this,void 0,void 0,function*(){let r=yield this.perform("getTransaction",t);if(null==r)return null==this._emitted["t:"+e]?null:void 0;let n=this.formatter.transactionResponse(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}return this._wrapTransaction(n)}),{oncePoll:this})})}getTransactionReceipt(e){return K(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;let t={transactionHash:this.formatter.hash(e,!0)};return(0,z.$l)(()=>K(this,void 0,void 0,function*(){let r=yield this.perform("getTransactionReceipt",t);if(null==r)return null==this._emitted["t:"+e]?null:void 0;if(null==r.blockHash)return;let n=this.formatter.receipt(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}return n}),{oncePoll:this})})}getLogs(e){return K(this,void 0,void 0,function*(){yield this.getNetwork();let t=yield(0,u.mE)({filter:this._getFilter(e)}),r=yield this.perform("getLogs",t);return r.forEach(e=>{null==e.removed&&(e.removed=!1)}),G.Mb.arrayOf(this.formatter.filterLog.bind(this.formatter))(r)})}getEtherPrice(){return K(this,void 0,void 0,function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})})}_getBlockTag(e){return K(this,void 0,void 0,function*(){if("number"==typeof(e=yield e)&&e<0){e%1&&J.throwArgumentError("invalid BlockTag","blockTag",e);let t=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return(t+=e)<0&&(t=0),this.formatter.blockTag(t)}return this.formatter.blockTag(e)})}getResolver(e){return K(this,void 0,void 0,function*(){let t=e;for(;;){if(""===t||"."===t||"eth"!==e&&"eth"===t)return null;let r=yield this._getResolver(t,"getResolver");if(null!=r){let n=new ef(this,r,e);if(t!==e&&!(yield n.supportsWildcard()))return null;return n}t=t.split(".").slice(1).join(".")}})}_getResolver(e,t){return K(this,void 0,void 0,function*(){null==t&&(t="ENS");let r=yield this.getNetwork();r.ensAddress||J.throwError("network does not support ENS",g.Yd.errors.UNSUPPORTED_OPERATION,{operation:t,network:r.name});try{let t=yield this.call({to:r.ensAddress,data:"0x0178b8bf"+R(e).substring(2)});return this.formatter.callAddress(t)}catch(e){}return null})}resolveName(e){return K(this,void 0,void 0,function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(t){if((0,l.A7)(e))throw t}"string"!=typeof e&&J.throwArgumentError("invalid ENS name","name",e);let t=yield this.getResolver(e);return t?yield t.getAddress():null})}lookupAddress(e){return K(this,void 0,void 0,function*(){e=yield e;let t=(e=this.formatter.address(e)).substring(2).toLowerCase()+".addr.reverse",r=yield this._getResolver(t,"lookupAddress");if(null==r)return null;let n=el((yield this.call({to:r,data:"0x691f3431"+R(t).substring(2)})),0);return(yield this.resolveName(n))!=e?null:n})}getAvatar(e){return K(this,void 0,void 0,function*(){let t=null;if((0,l.A7)(e)){let r=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"getAvatar");if(!n)return null;t=new ef(this,n,r);try{let e=yield t.getAvatar();if(e)return e.url}catch(e){if(e.code!==g.Yd.errors.CALL_EXCEPTION)throw e}try{let e=el((yield this.call({to:n,data:"0x691f3431"+R(r).substring(2)})),0);t=yield this.getResolver(e)}catch(e){if(e.code!==g.Yd.errors.CALL_EXCEPTION)throw e;return null}}else if(!(t=yield this.getResolver(e)))return null;let r=yield t.getAvatar();return null==r?null:r.url})}perform(e,t){return J.throwError(e+" not implemented",g.Yd.errors.NOT_IMPLEMENT
1ED,{operation:e})}_startEvent(e){this.polling=this._events.filter(e=>e.pollable()).length>0}_stopEvent(e){this.polling=this._events.filter(e=>e.pollable()).length>0}_addEventListener(e,t,r){let n=new er(Z(e),t,r);return this._events.push(n),this._startEvent(n),this}on(e,t){return this._addEventListener(e,t,!1)}once(e,t){return this._addEventListener(e,t,!0)}emit(e,...t){let r=!1,n=[],i=Z(e);return this._events=this._events.filter(e=>e.tag!==i||(setTimeout(()=>{e.listener.apply(this,t)},0),r=!0,!e.once||(n.push(e),!1))),n.forEach(e=>{this._stopEvent(e)}),r}listenerCount(e){if(!e)return this._events.length;let t=Z(e);return this._events.filter(e=>e.tag===t).length}listeners(e){if(null==e)return this._events.map(e=>e.listener);let t=Z(e);return this._events.filter(e=>e.tag===t).map(e=>e.listener)}off(e,t){if(null==t)return this.removeAllListeners(e);let r=[],n=!1,i=Z(e);return this._events=this._events.filter(e=>e.tag!==i||e.listener!=t||!!n||(n=!0,r.push(e),!1)),r.forEach(e=>{this._stopEvent(e)}),this}removeAllListeners(e){let t=[];if(null==e)t=this._events,this._events=[];else{let r=Z(e);this._events=this._events.filter(e=>e.tag!==r||(t.push(e),!1))}return t.forEach(e=>{this._stopEvent(e)}),this}}},86160:function(e,t,r){"use strict";r.d(t,{Mb:function(){return h},Gp:function(){return d}});var n=r(89005),i=r(22594),s=r(9784),o=r(36173),a=r(2149),l=r(13421),u=r(86365);let c=new l.Yd(u.i);class h{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){let e={},t=this.address.bind(this),r=this.bigNumber.bind(this),n=this.blockTag.bind(this),i=this.data.bind(this),s=this.hash.bind(this),a=this.hex.bind(this),l=this.number.bind(this),u=this.type.bind(this);return e.transaction={hash:s,type:u,accessList:h.allowNull(this.accessList.bind(this),null),blockHash:h.allowNull(s,null),blockNumber:h.allowNull(l,null),transactionIndex:h.allowNull(l,null),confirmations:h.allowNull(l,null),from:t,gasPrice:h.allowNull(r),maxPriorityFeePerGas:h.allowNull(r),maxFeePerGas:h.allowNull(r),gasLimit:r,to:h.allowNull(t,null),value:r,nonce:l,data:i,r:h.allowNull(this.uint256),s:h.allowNull(this.uint256),v:h.allowNull(l),creates:h.allowNull(t,null),raw:h.allowNull(i)},e.transactionRequest={from:h.allowNull(t),nonce:h.allowNull(l),gasLimit:h.allowNull(r),gasPrice:h.allowNull(r),maxPriorityFeePerGas:h.allowNull(r),maxFeePerGas:h.allowNull(r),to:h.allowNull(t),value:h.allowNull(r),data:h.allowNull(e=>this.data(e,!0)),type:h.allowNull(l),accessList:h.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:l,blockNumber:l,transactionHash:s,address:t,topics:h.arrayOf(s),data:i,logIndex:l,blockHash:s},e.receipt={to:h.allowNull(this.address,null),from:h.allowNull(this.address,null),contractAddress:h.allowNull(t,null),transactionIndex:l,root:h.allowNull(a),gasUsed:r,logsBloom:h.allowNull(i),blockHash:s,transactionHash:s,logs:h.arrayOf(this.receiptLog.bind(this)),blockNumber:l,confirmations:h.allowNull(l,null),cumulativeGasUsed:r,effectiveGasPrice:h.allowNull(r),status:h.allowNull(l),type:u},e.block={hash:h.allowNull(s),parentHash:s,number:l,timestamp:l,nonce:h.allowNull(a),difficulty:this.difficulty.bind(this),gasLimit:r,gasUsed:r,miner:h.allowNull(t),extraData:i,transactions:h.allowNull(h.arrayOf(s)),baseFeePerGas:h.allowNull(r)},e.blockWithTransactions=(0,o.DC)(e.block),e.blockWithTransactions.transactions=h.allowNull(h.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:h.allowNull(n,void 0),toBlock:h.allowNull(n,void 0),blockHash:h.allowNull(s,void 0),address:h.allowNull(t,void 0),topics:h.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:h.allowNull(l),blockHash:h.allowNull(s),transactionIndex:l,removed:h.allowNull(this.boolean.bind(this)),address:t,data:h.allowFalsish(i,"0x"),topics:h.arrayOf(s),transactionHash:s,logIndex:l},e}accessList(e){return(0,a.z7)(e||[])}number(e){return"0x"===e?0:i.O$.from(e).toNumber()}type(e){return"0x"===e||null==e?0:i.O$.from(e).toNumber()}bigNumber(e){return i.O$.from(e)}boolean(e){if("boolean"==typeof e)return e;if("string"==typeof e){if("true"===(e=e.toLowerCase()))return!0;
1if("false"===e)return!1}throw Error("invalid boolean - "+e)}hex(e,t){return"string"==typeof e&&(t||"0x"===e.substring(0,2)||(e="0x"+e),(0,s.A7)(e))?e.toLowerCase():c.throwArgumentError("invalid hash","value",e)}data(e,t){let r=this.hex(e,t);if(r.length%2!=0)throw Error("invalid data; odd-length - "+e);return r}address(e){return(0,n.Kn)(e)}callAddress(e){if(!(0,s.A7)(e,32))return null;let t=(0,n.Kn)((0,s.p3)(e,12));return"0x0000000000000000000000000000000000000000"===t?null:t}contractAddress(e){return(0,n.CR)(e)}blockTag(e){if(null==e)return"latest";if("earliest"===e)return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if("number"==typeof e||(0,s.A7)(e))return(0,s.$P)(e);throw Error("invalid blockTag")}hash(e,t){let r=this.hex(e,t);return 32!==(0,s.E1)(r)?c.throwArgumentError("invalid hash","value",e):r}difficulty(e){if(null==e)return null;let t=i.O$.from(e);try{return t.toNumber()}catch(e){}return null}uint256(e){if(!(0,s.A7)(e))throw Error("invalid uint256");return(0,s.$m)(e,32)}_block(e,t){null!=e.author&&null==e.miner&&(e.miner=e.author);let r=null!=e._difficulty?e._difficulty:e.difficulty,n=h.check(t,e);return n._difficulty=null==r?null:i.O$.from(r),n}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return h.check(this.formats.transactionRequest,e)}transactionResponse(e){null!=e.gas&&null==e.gasLimit&&(e.gasLimit=e.gas),e.to&&i.O$.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),null!=e.input&&null==e.data&&(e.data=e.input),null==e.to&&null==e.creates&&(e.creates=this.contractAddress(e)),(1===e.type||2===e.type)&&null==e.accessList&&(e.accessList=[]);let t=h.check(this.formats.transaction,e);if(null!=e.chainId){let r=e.chainId;(0,s.A7)(r)&&(r=i.O$.from(r).toNumber()),t.chainId=r}else{let r=e.networkId;null==r&&null==t.v&&(r=e.chainId),(0,s.A7)(r)&&(r=i.O$.from(r).toNumber()),"number"!=typeof r&&null!=t.v&&((r=(t.v-35)/2)<0&&(r=0),r=parseInt(r)),"number"!=typeof r&&(r=0),t.chainId=r}return t.blockHash&&"x"===t.blockHash.replace(/0/g,"")&&(t.blockHash=null),t}transaction(e){return(0,a.Qc)(e)}receiptLog(e){return h.check(this.formats.receiptLog,e)}receipt(e){let t=h.check(this.formats.receipt,e);if(null!=t.root){if(t.root.length<=4){let e=i.O$.from(t.root).toNumber();0===e||1===e?(null!=t.status&&t.status!==e&&c.throwArgumentError("alt-root-status/status mismatch","value",{root:t.root,status:t.status}),t.status=e,delete t.root):c.throwArgumentError("invalid alt-root-status","value.root",t.root)}else 66!==t.root.length&&c.throwArgumentError("invalid root hash","value.root",t.root)}return null!=t.status&&(t.byzantium=!0),t}topics(e){return Array.isArray(e)?e.map(e=>this.topics(e)):null!=e?this.hash(e,!0):null}filter(e){return h.check(this.formats.filter,e)}filterLog(e){return h.check(this.formats.filterLog,e)}static check(e,t){let r={};for(let n in e)try{let i=e[n](t[n]);void 0!==i&&(r[n]=i)}catch(e){throw e.checkKey=n,e.checkValue=t[n],e}return r}static allowNull(e,t){return function(r){return null==r?t:e(r)}}static allowFalsish(e,t){return function(r){return r?e(r):t}}static arrayOf(e){return function(t){if(!Array.isArray(t))throw Error("not an array");let r=[];return t.forEach(function(t){r.push(e(t))}),r}}}function d(e){return e&&"function"==typeof e.isCommunityResource&&e.isCommunityResource()}},92030:function(e,t,r){"use strict";r.d(t,{r:function(){return C}});var n=r(37637),i=r(22594),s=r(9784),o=r(6352),a=r(36173),l=r(28257),u=r(2149),c=r(46396),h=r(13421),d=r(86365),f=r(55415),p=function(e,t,r,n){return new(r||(r=Promise))(function(i,s){function o(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};let g=new h.Yd(d.i),y=["call","estimateGas"];function m(e,t){if(null==e)return null;if("string"==typeof e.message&&e.message.match("reverted")){let r=(0,s.A7)(e.data)?e.data:null;if(!t||r)return{message:e.message,data:r}}if("object"==typeof e){for(let r in e){let n=m(e[r],t);if(n)return n}return null}if("string"==typeof e)try{return m(JSON.parse(e),t)}catch(e){}return null}function v(e,t,r){let n=r.transaction||r.signedTransaction;if("call"===e){let e=m(t,!0);if(e)return e.data;g.throwError("missing revert data in call exception; Transaction reverted without a reason string",h.Yd.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:t})}if("estimateGas"===e){let r=m(t.body,!1);null==r&&(r=m(t,!1)),r&&g.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",h.Yd.errors.UNPREDICTABLE_GAS_LIMIT,{reason:r.message,method:e,transaction:n,error:t})}let i=t.message;throw t.code===h.Yd.errors.SERVER_ERROR&&t.error&&"string"==typeof t.error.message?i=t.error.message:"string"==typeof t.body?i=t.body:"string"==typeof t.responseText&&(i=t.responseText),(i=(i||"").toLowerCase()).match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&g.throwError("insufficient funds for intrinsic transaction cost",h.Yd.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:n}),i.match(/nonce (is )?too low/i)&&g.throwError("nonce has already been used",h.Yd.errors.NONCE_EXPIRED,{error:t,method:e,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&g.throwError("replacement fee too low",h.Yd.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:n}),i.match(/only replay-protected/i)&&g.throwError("legacy pre-eip-155 transactions not supported",h.Yd.errors.UNSUPPORTED_OPERATION,{error:t,method:e,transaction:n}),y.indexOf(e)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&g.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",h.Yd.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:n}),t}function b(e){return new Promise(function(t){setTimeout(t,e)})}function w(e){if(e.error){let t=Error(e.error.message);throw t.code=e.error.code,t.data=e.error.data,t}return e.result}function _(e){return e?e.toLowerCase():e}let E={};class S extends n.E{constructor(e,t,r){if(super(),e!==E)throw Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");(0,a.zG)(this,"provider",t),null==r&&(r=0),"string"==typeof r?((0,a.zG)(this,"_address",this.provider.formatter.address(r)),(0,a.zG)(this,"_index",null)):"number"==typeof r?((0,a.zG)(this,"_index",r),(0,a.zG)(this,"_address",null)):g.throwArgumentError("invalid address or index","addressOrIndex",r)}connect(e){return g.throwError("cannot alter JSON-RPC Signer connection",h.Yd.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new A(E,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then(e=>(e.length<=this._index&&g.throwError("unknown account #"+this._index,h.Yd.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index])))}sendUncheckedTransaction(e){e=(0,a.DC)(e);let t=this.getAddress().then(e=>(e&&(e=e.toLowerCase()),e));
1if(null==e.gasLimit){let r=(0,a.DC)(e);r.from=t,e.gasLimit=this.provider.estimateGas(r)}return null!=e.to&&(e.to=Promise.resolve(e.to).then(e=>p(this,void 0,void 0,function*(){if(null==e)return null;let t=yield this.provider.resolveName(e);return null==t&&g.throwArgumentError("provided ENS name resolves to null","tx.to",e),t}))),(0,a.mE)({tx:(0,a.mE)(e),sender:t}).then(({tx:t,sender:r})=>{null!=t.from?t.from.toLowerCase()!==r&&g.throwArgumentError("from address mismatch","transaction",e):t.from=r;let n=this.provider.constructor.hexlifyTransaction(t,{from:!0});return this.provider.send("eth_sendTransaction",[n]).then(e=>e,e=>("string"==typeof e.message&&e.message.match(/user denied/i)&&g.throwError("user rejected transaction",h.Yd.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:t}),v("sendTransaction",e,n)))})}signTransaction(e){return g.throwError("signing transactions is unsupported",h.Yd.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return p(this,void 0,void 0,function*(){let t=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),r=yield this.sendUncheckedTransaction(e);try{return yield(0,c.$l)(()=>p(this,void 0,void 0,function*(){let e=yield this.provider.getTransaction(r);if(null!==e)return this.provider._wrapTransaction(e,r,t)}),{oncePoll:this.provider})}catch(e){throw e.transactionHash=r,e}})}signMessage(e){return p(this,void 0,void 0,function*(){let t="string"==typeof e?(0,l.Y0)(e):e,r=yield this.getAddress();try{return yield this.provider.send("personal_sign",[(0,s.Dv)(t),r.toLowerCase()])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&g.throwError("user rejected signing",h.Yd.errors.ACTION_REJECTED,{action:"signMessage",from:r,messageData:e}),t}})}_legacySignMessage(e){return p(this,void 0,void 0,function*(){let t="string"==typeof e?(0,l.Y0)(e):e,r=yield this.getAddress();try{return yield this.provider.send("eth_sign",[r.toLowerCase(),(0,s.Dv)(t)])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&g.throwError("user rejected signing",h.Yd.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:r,messageData:e}),t}})}_signTypedData(e,t,r){return p(this,void 0,void 0,function*(){let n=yield o.E.resolveNames(e,t,r,e=>this.provider.resolveName(e)),i=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[i.toLowerCase(),JSON.stringify(o.E.getPayload(n.domain,t,n.value))])}catch(e){throw"string"==typeof e.message&&e.message.match(/user denied/i)&&g.throwError("user rejected signing",h.Yd.errors.ACTION_REJECTED,{action:"_signTypedData",from:i,messageData:{domain:n.domain,types:t,value:n.value}}),e}})}unlock(e){return p(this,void 0,void 0,function*(){let t=this.provider,r=yield this.getAddress();return t.send("personal_unlockAccount",[r.toLowerCase(),e,null])})}}class A extends S{sendTransaction(e){return this.sendUncheckedTransaction(e).then(e=>({hash:e,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:t=>this.provider.waitForTransaction(e,t)}))}}let k={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class C extends f.Zk{constructor(e,t){let r=t;null==r&&(r=new Promise((e,t)=>{setTimeout(()=>{this.detectNetwork().then(t=>{e(t)},e=>{t(e)})},0)})),super(r),e||(e=(0,a.tu)(this.constructor,"defaultUrl")()),"string"==typeof e?(0,a.zG)(this,"connection",Object.freeze({url:e})):(0,a.zG)(this,"connection",Object.freeze((0,a.DC)(e))),this._nextId=42}get _cache(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout(()=>{this._cache.detectNetwork=null},0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return p(this,void 0,void 0,function*(){yield b(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch(t){try{e=yield this.send("net_version",[])}catch(e){}}if(null!=e){let t=(0,a.tu)(this.constructor,"getNetwork");try{return t(i.O$.from(e).toNumber())}catch(t){return g.throwError("could not detect network",h.Yd.errors.NETWORK_E
1RROR,{chainId:e,event:"invalidNetwork",serverError:t})}}return g.throwError("could not detect network",h.Yd.errors.NETWORK_ERROR,{event:"noNetwork"})})}getSigner(e){return new S(E,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then(e=>e.map(e=>this.formatter.address(e)))}send(e,t){let r={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:(0,a.p$)(r),provider:this});let n=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(n&&this._cache[e])return this._cache[e];let i=(0,c.rd)(this.connection,JSON.stringify(r),w).then(e=>(this.emit("debug",{action:"response",request:r,response:e,provider:this}),e),e=>{throw this.emit("debug",{action:"response",error:e,request:r,provider:this}),e});return n&&(this._cache[e]=i,setTimeout(()=>{this._cache[e]=null},0)),i}prepareRequest(e,t){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[_(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[_(t.address),t.blockTag]];case"getCode":return["eth_getCode",[_(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[_(t.address),(0,s.$m)(t.position,32),t.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[t.signedTransaction]];case"getBlock":if(t.blockTag)return["eth_getBlockByNumber",[t.blockTag,!!t.includeTransactions]];if(t.blockHash)return["eth_getBlockByHash",[t.blockHash,!!t.includeTransactions]];break;case"getTransaction":return["eth_getTransactionByHash",[t.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[t.transactionHash]];case"call":return["eth_call",[(0,a.tu)(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0}),t.blockTag]];case"estimateGas":return["eth_estimateGas",[(0,a.tu)(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0})]];case"getLogs":return t.filter&&null!=t.filter.address&&(t.filter.address=_(t.filter.address)),["eth_getLogs",[t.filter]]}return null}perform(e,t){return p(this,void 0,void 0,function*(){if("call"===e||"estimateGas"===e){let e=t.transaction;if(e&&null!=e.type&&i.O$.from(e.type).isZero()&&null==e.maxFeePerGas&&null==e.maxPriorityFeePerGas){let r=yield this.getFeeData();null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas&&((t=(0,a.DC)(t)).transaction=(0,a.DC)(e),delete t.transaction.type)}}let r=this.prepareRequest(e,t);null==r&&g.throwError(e+" not implemented",h.Yd.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(r[0],r[1])}catch(r){return v(e,r,t)}})}_startEvent(e){"pending"===e.tag&&this._startPending(),super._startEvent(e)}_startPending(){if(null!=this._pendingFilter)return;let e=this,t=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=t,t.then(function(r){return function n(){e.send("eth_getFilterChanges",[r]).then(function(r){if(e._pendingFilter!=t)return null;let n=Promise.resolve();return r.forEach(function(t){e._emitted["t:"+t.toLowerCase()]="pending",n=n.then(function(){return e.getTransaction(t).then(function(t){return e.emit("pending",t),null})})}),n.then(function(){return b(1e3)})}).then(function(){if(e._pendingFilter!=t){e.send("eth_uninstallFilter",[r]);return}return setTimeout(function(){n()},0),null}).catch(e=>{})}(),r}).catch(e=>{})}_stopEvent(e){"pending"===e.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,t){let r=(0,a.DC)(k);if(t)for(let e in t)t[e]&&(r[e]=!0);(0,a.uj)(e,r);let n={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(function(t){if(null==e[t])return;let r=(0,s.$P)(i.O$.from(e[t]));"gasLimit"===t&&(t="gas"),n[t]=r}),["from","to","data"].forEach(function(t){null!=e[t]&&(n[t]=(0,s.Dv)(e[t]))}),e.accessList&&(n.accessList=(0,u.z7)(e.accessList)),n}}},68893:function(e,t,r){"use strict";r.d(t,{Q:function(){return c}});var n=r(36173),i=r(13421),s=r(86365),o=r(92030);let a=new i.Yd(s.i),l=1;function u(e,t){let r="Web3LegacyFetcher";return function(e,i){let s={method:e,params:i,id:l++,jsonrpc:"2.0"};return new Promise((e,i)=>
1{this.emit("debug",{action:"request",fetcher:r,request:(0,n.p$)(s),provider:this}),t(s,(t,n)=>{if(t)return this.emit("debug",{action:"response",fetcher:r,error:t,request:s,provider:this}),i(t);if(this.emit("debug",{action:"response",fetcher:r,request:s,response:n,provider:this}),n.error){let e=Error(n.error.message);return e.code=n.error.code,e.data=n.error.data,i(e)}e(n.result)})})}}class c extends o.r{constructor(e,t){null==e&&a.throwArgumentError("missing provider","provider",e);let r=null,i=null,s=null;"function"==typeof e?(r="unknown:",i=e):(((r=e.host||e.path||"")||!e.isMetaMask||(r="metamask"),s=e,e.request)?(""===r&&(r="eip-1193:"),i=function(t,r){null==r&&(r=[]);let i={method:t,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:(0,n.p$)(i),provider:this}),e.request(i).then(e=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:i,response:e,provider:this}),e),e=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:i,error:e,provider:this}),e})}):e.sendAsync?i=u(e,e.sendAsync.bind(e)):e.send?i=u(e,e.send.bind(e)):a.throwArgumentError("unsupported provider","provider",e),r||(r="unknown:")),super(r,t),(0,n.zG)(this,"jsonRpcFetchFunc",i),(0,n.zG)(this,"provider",s)}send(e,t){return this.jsonRpcFetchFunc(e,t)}}},46396:function(e,t,r){"use strict";r.d(t,{rd:function(){return h},$l:function(){return d}});var n=r(37676),i=r(9784),s=r(36173),o=r(28257),a=r(13421);let l=new a.Yd("web/5.7.1");function u(e){return new Promise(t=>{setTimeout(t,e)})}function c(e,t){if(null==e)return null;if("string"==typeof e)return e;if((0,i.Zq)(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return(0,o.ZN)(e)}catch(e){}return(0,i.Dv)(e)}return e}function h(e,t,r){let h=null;if(null!=t){h=(0,o.Y0)(t);let r="string"==typeof e?{url:e}:(0,s.DC)(e);r.headers?0!==Object.keys(r.headers).filter(e=>"content-type"===e.toLowerCase()).length||(r.headers=(0,s.DC)(r.headers),r.headers["content-type"]="application/json"):r.headers={"content-type":"application/json"},e=r}return function(e,t,r){let h;let d="object"==typeof e&&null!=e.throttleLimit?e.throttleLimit:12;l.assertArgument(d>0&&d%1==0,"invalid connection throttle limit","connection.throttleLimit",d);let f="object"==typeof e?e.throttleCallback:null,p="object"==typeof e&&"number"==typeof e.throttleSlotInterval?e.throttleSlotInterval:100;l.assertArgument(p>0&&p%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",p);let g="object"==typeof e&&!!e.errorPassThrough,y={},m=null,v={method:"GET"},b=!1,w=12e4;if("string"==typeof e)m=e;else if("object"==typeof e){if((null==e||null==e.url)&&l.throwArgumentError("missing URL","connection.url",e),m=e.url,"number"==typeof e.timeout&&e.timeout>0&&(w=e.timeout),e.headers)for(let t in e.headers)y[t.toLowerCase()]={key:t,value:String(e.headers[t])},["if-none-match","if-modified-since"].indexOf(t.toLowerCase())>=0&&(b=!0);if(v.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==m.substring(0,6)&&!0!==e.allowInsecureAuthentication&&l.throwError("basic authentication requires a secure https url",a.Yd.errors.INVALID_ARGUMENT,{argument:"url",url:m,user:e.user,password:"[REDACTED]"});let t=e.user+":"+e.password;y.authorization={key:"Authorization",value:"Basic "+(0,n.c)((0,o.Y0)(t))}}null!=e.skipFetchSetup&&(v.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(v.fetchOptions=(0,s.DC)(e.fetchOptions))}let _=RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),E=m?m.match(_):null;if(E)try{var S;let e={statusCode:200,statusMessage:"OK",headers:{"content-type":E[1]||"text/plain"},body:E[2]?(0,n.J)(E[3]):(S=E[3],(0,o.Y0)(S.replace(/%([0-9a-f][0-9a-f])/gi,(e,t)=>String.fromCharCode(parseInt(t,16)))))},t=e.body;return r&&(t=r(e.body,e)),Promise.resolve(t)}catch(e){l.throwError("processing response error",a.Yd.errors.SERVER_ERROR,{body:c(E[1],E[2]),error:e,requestBody:null,requestMethod:"GET",url:m})}t&&(v.method="POST",v.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)}));let A={};
1Object.keys(y).forEach(e=>{let t=y[e];A[t.key]=t.value}),v.headers=A;let k=(h=null,{promise:new Promise(function(e,t){w&&(h=setTimeout(()=>{null!=h&&(h=null,t(l.makeError("timeout",a.Yd.errors.TIMEOUT,{requestBody:c(v.body,A["content-type"]),requestMethod:v.method,timeout:w,url:m})))},w))}),cancel:function(){null!=h&&(clearTimeout(h),h=null)}}),C=function(){var e,t,n,s;return e=this,t=void 0,n=void 0,s=function*(){for(let e=0;e<d;e++){let t=null;try{if(t=yield function(e,t){var r,n,s,o;return r=this,n=void 0,s=void 0,o=function*(){null==t&&(t={});let r={method:t.method||"GET",headers:t.headers||{},body:t.body||void 0};if(!0!==t.skipFetchSetup&&(r.mode="cors",r.cache="no-cache",r.credentials="same-origin",r.redirect="follow",r.referrer="client"),null!=t.fetchOptions){let e=t.fetchOptions;e.mode&&(r.mode=e.mode),e.cache&&(r.cache=e.cache),e.credentials&&(r.credentials=e.credentials),e.redirect&&(r.redirect=e.redirect),e.referrer&&(r.referrer=e.referrer)}let n=yield fetch(e,r),s=yield n.arrayBuffer(),o={};return n.headers.forEach?n.headers.forEach((e,t)=>{o[t.toLowerCase()]=e}):n.headers.keys().forEach(e=>{o[e.toLowerCase()]=n.headers.get(e)}),{headers:o,statusCode:n.status,statusMessage:n.statusText,body:(0,i.lE)(new Uint8Array(s))}},new(s||(s=Promise))(function(e,t){function i(e){try{l(o.next(e))}catch(e){t(e)}}function a(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):((r=t.value)instanceof s?r:new s(function(e){e(r)})).then(i,a)}l((o=o.apply(r,n||[])).next())})}(m,v),e<d){if(301===t.statusCode||302===t.statusCode){let e=t.headers.location||"";if("GET"===v.method&&e.match(/^https:/)){m=t.headers.location;continue}}else if(429===t.statusCode){let r=!0;if(f&&(r=yield f(e,m)),r){let r=0,n=t.headers["retry-after"];r="string"==typeof n&&n.match(/^[1-9][0-9]*$/)?1e3*parseInt(n):p*parseInt(String(Math.random()*Math.pow(2,e))),yield u(r);continue}}}}catch(e){null==(t=e.response)&&(k.cancel(),l.throwError("missing response",a.Yd.errors.SERVER_ERROR,{requestBody:c(v.body,A["content-type"]),requestMethod:v.method,serverError:e,url:m}))}let n=t.body;if(b&&304===t.statusCode?n=null:!g&&(t.statusCode<200||t.statusCode>=300)&&(k.cancel(),l.throwError("bad response",a.Yd.errors.SERVER_ERROR,{status:t.statusCode,headers:t.headers,body:c(n,t.headers?t.headers["content-type"]:null),requestBody:c(v.body,A["content-type"]),requestMethod:v.method,url:m})),r)try{let e=yield r(n,t);return k.cancel(),e}catch(r){if(r.throttleRetry&&e<d){let t=!0;if(f&&(t=yield f(e,m)),t){let t=p*parseInt(String(Math.random()*Math.pow(2,e)));yield u(t);continue}}k.cancel(),l.throwError("processing response error",a.Yd.errors.SERVER_ERROR,{body:c(n,t.headers?t.headers["content-type"]:null),error:r,requestBody:c(v.body,A["content-type"]),requestMethod:v.method,url:m})}return k.cancel(),n}return l.throwError("failed response",a.Yd.errors.SERVER_ERROR,{requestBody:c(v.body,A["content-type"]),requestMethod:v.method,url:m})},new(n||(n=Promise))(function(r,i){function o(e){try{l(s.next(e))}catch(e){i(e)}}function a(e){try{l(s.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?r(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(o,a)}l((s=s.apply(e,t||[])).next())})}();return Promise.race([k.promise,C])}(e,h,(e,t)=>{let n=null;if(null!=e)try{n=JSON.parse((0,o.ZN)(e))}catch(t){l.throwError("invalid JSON",a.Yd.errors.SERVER_ERROR,{body:e,error:t})}return r&&(n=r(n,t)),n})}function d(e,t){return t||(t={}),null==(t=(0,s.DC)(t)).floor&&(t.floor=0),null==t.ceiling&&(t.ceiling=1e4),null==t.interval&&(t.interval=250),new Promise(function(r,n){let i=null,s=!1,o=()=>!s&&(s=!0,i&&clearTimeout(i),!0);t.timeout&&(i=setTimeout(()=>{o()&&n(Error("timeout"))},t.timeout));let a=t.retryLimit,l=0;!function i(){return e().then(function(e){if(void 0!==e)o()&&r(e);else if(t.oncePoll)t.oncePoll.once("poll",i);else if(t.onceBlock)t.onceBlock.once("block",i);else if(!s){if(++l>a){o()&&n(Error("retry limit reached"));return}let e=t.interval*parseInt(String(Math.random()*Math.pow(2,l)));e<t.floor&&(e=t.floor),e>t.ceiling&&(e=t.ceiling),setTimeout(i,e)}return null},function(e){o()&&n(e)})}()})}},87893:function(e,t,r){"use strict";
1Object.defineProperty(t,"__esModule",{value:!0});let n=r(68885);function i(e,t,r){try{Reflect.apply(e,t,r)}catch(e){setTimeout(()=>{throw e})}}class s extends n.EventEmitter{emit(e,...t){let r="error"===e,n=this._events;if(void 0!==n)r=r&&void 0===n.error;else if(!r)return!1;if(r){let e;if(t.length>0&&([e]=t),e instanceof Error)throw e;let r=Error(`Unhandled error.${e?` (${e.message})`:""}`);throw r.context=e,r}let s=n[e];if(void 0===s)return!1;if("function"==typeof s)i(s,this,t);else{let e=s.length,r=function(e){let t=e.length,r=Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}(s);for(let n=0;n<e;n+=1)i(r[n],this,t)}return!0}}t.default=s},96519:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assertExhaustive=t.assertStruct=t.assert=t.AssertionError=void 0;let n=r(66517);function i(e,t){var r,n;return"string"==typeof(null===(n=null===(r=null==e?void 0:e.prototype)||void 0===r?void 0:r.constructor)||void 0===n?void 0:n.name)?new e({message:t}):e({message:t})}class s extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}t.AssertionError=s,t.assert=function(e,t="Assertion failed.",r=s){if(!e){if(t instanceof Error)throw t;throw i(r,t)}},t.assertStruct=function(e,t,r="Assertion failed",o=s){try{(0,n.assert)(e,t)}catch(e){throw i(o,`${r}: ${function(e){let t="object"==typeof e&&null!==e&&"message"in e?e.message:String(e);return t.endsWith(".")?t.slice(0,-1):t}(e)}.`)}},t.assertExhaustive=function(e){throw Error("Invalid branch reached. Should be detected during compilation.")}},21189:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.base64=void 0;let n=r(66517),i=r(96519);t.base64=(e,t={})=>{var r,s;let o,a;let l=null!==(r=t.paddingRequired)&&void 0!==r&&r,u=null!==(s=t.characterSet)&&void 0!==s?s:"base64";return"base64"===u?o=String.raw`[A-Za-z0-9+\/]`:((0,i.assert)("base64url"===u),o=String.raw`[-_A-Za-z0-9]`),a=l?RegExp(`^(?:${o}{4})*(?:${o}{3}=|${o}{2}==)?$`,"u"):RegExp(`^(?:${o}{4})*(?:${o}{2,3}|${o}{3}=|${o}{2}==)?$`,"u"),(0,n.pattern)(e,a)}},11583:function(e,t,r){"use strict";var n=r(9109).Buffer;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;let i=r(96519),s=r(36985),o=function(){let e=[];return()=>{if(0===e.length)for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return e}}();function a(e){return e instanceof Uint8Array}function l(e){(0,i.assert)(a(e),"Value must be a Uint8Array.")}function u(e){if(l(e),0===e.length)return"0x";let t=o(),r=Array(e.length);for(let n=0;n<e.length;n++)r[n]=t[e[n]];return(0,s.add0x)(r.join(""))}function c(e){return l(e),BigInt(u(e))}function h(e){var t;if((null===(t=null==e?void 0:e.toLowerCase)||void 0===t?void 0:t.call(e))==="0x")return new Uint8Array;(0,s.assertIsHexString)(e);let r=(0,s.remove0x)(e).toLowerCase(),n=r.length%2==0?r:`0${r}`,i=new Uint8Array(n.length/2);for(let e=0;e<i.length;e++){let t=n.charCodeAt(2*e),r=n.charCodeAt(2*e+1),s=t-(t<58?48:87),o=r-(r<58?48:87);i[e]=16*s+o}return i}function d(e){return(0,i.assert)("bigint"==typeof e,"Value must be a bigint."),(0,i.assert)(e>=BigInt(0),"Value must be a non-negative bigint."),h(e.toString(16))}function f(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 p(e){return(0,i.assert)("string"==typeof e,"Value must be a string."),new TextEncoder().encode(e)}function g(e){if("bigint"==typeof e)return d(e);if("number"==typeof e)return f(e);if("string"==typeof e)return e.startsWith("0x")?h(e):p(e);if(a(e))return e;throw TypeError(`Unsupported value type: "${typeof e}".`)}t.isBytes=a,t.assertIsBytes=l,t.bytesToHex=u,t.bytesToBigInt=c,t.bytesToSignedBigInt=function(e){l(e);let t=BigInt(0);for(let r of e)t=(t<<BigInt(8))+BigInt(r);return BigInt.asIntN(8*e.length,t)},t.bytesToNumber=function(e){l(e);let t=c(e);return(0,i.assert)(t<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(t)},t.bytesToString=function(e){return l(e),new TextDecoder().decode(e)},t.hexToBytes=h,t.bigIntToBytes=d,t.signedBigIntToBytes=function(e,t){(0,i.assert)("bigint"==typeof e,"Value must be a bigint."),(0,i.assert)("number"==typeof t,"Byte length must be a number."),(0,i.assert)(t>0,"Byte length must be greater than 0."),(0,i.assert)(function(e,t){(0,i.assert)(t>0);let r=e>>BigInt(31);return!((~e&r)+(e&~r)>>BigInt(8*t+-1))}(e,t),"Byte length is too small to represent the given value.");let r=e,n=new Uint8Array(t);for(let e=0;e<n.length;e++)n[e]=Number(BigInt.asUintN(8,r)),r>>=BigInt(8);return n.reverse()},t.numberToBytes=f,t.stringToBytes=p,t.valueToBytes=g,t.concatBytes=function(e){let t=Array(e.length),r=0;for(let n=0;n<e.length;n++){let i=g(e[n]);t[n]=i,r+=i.length}let n=new Uint8Array(r);for(let e=0,r=0;e<t.length;e++)n.set(t[e],r),r+=t[e].length;return n},t.createDataView=function(e){return void 0!==n&&e instanceof n?new DataView(e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)):new DataView(e.buffer,e.byteOffset,e.byteLength)}},47883:function(e,t,r){"use strict";
1Object.defineProperty(t,"__esModule",{value:!0}),t.ChecksumStruct=void 0;let n=r(66517),i=r(21189);t.ChecksumStruct=(0,n.size)((0,i.base64)((0,n.string)(),{paddingRequired:!0}),44,44)},36857:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createHex=t.createBytes=t.createBigInt=t.createNumber=void 0;let n=r(66517),i=r(96519),s=r(11583),o=r(36985),a=(0,n.union)([(0,n.number)(),(0,n.bigint)(),(0,n.string)(),o.StrictHexStruct]),l=(0,n.coerce)((0,n.number)(),a,Number),u=(0,n.coerce)((0,n.bigint)(),a,BigInt);(0,n.union)([o.StrictHexStruct,(0,n.instance)(Uint8Array)]);let c=(0,n.coerce)((0,n.instance)(Uint8Array),(0,n.union)([o.StrictHexStruct]),s.hexToBytes),h=(0,n.coerce)(o.StrictHexStruct,(0,n.instance)(Uint8Array),s.bytesToHex);t.createNumber=function(e){try{let t=(0,n.create)(e,l);return(0,i.assert)(Number.isFinite(t),`Expected a number-like value, got "${e}".`),t}catch(t){if(t instanceof n.StructError)throw Error(`Expected a number-like value, got "${e}".`);throw t}},t.createBigInt=function(e){try{return(0,n.create)(e,u)}catch(e){if(e instanceof n.StructError)throw Error(`Expected a number-like value, got "${String(e.value)}".`);throw e}},t.createBytes=function(e){if("string"==typeof e&&"0x"===e.toLowerCase())return new Uint8Array;try{return(0,n.create)(e,c)}catch(e){if(e instanceof n.StructError)throw Error(`Expected a bytes-like value, got "${String(e.value)}".`);throw e}},t.createHex=function(e){if(e instanceof Uint8Array&&0===e.length||"string"==typeof e&&"0x"===e.toLowerCase())return"0x";try{return(0,n.create)(e,h)}catch(e){if(e instanceof n.StructError)throw Error(`Expected a bytes-like value, got "${String(e.value)}".`);throw e}}},39544:function(e,t){"use strict";var r,n,i=this&&this.__classPrivateFieldSet||function(e,t,r,n,i){if("m"===n)throw TypeError("Private method is not writable");if("a"===n&&!i)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r},s=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(t,"__esModule",{value:!0}),t.FrozenSet=t.FrozenMap=void 0;class o{constructor(e){r.set(this,void 0),i(this,r,new Map(e),"f"),Object.freeze(this)}get size(){return s(this,r,"f").size}[(r=new WeakMap,Symbol.iterator)](){return s(this,r,"f")[Symbol.iterator]()}entries(){return s(this,r,"f").entries()}forEach(e,t){return s(this,r,"f").forEach((r,n,i)=>e.call(t,r,n,this))}get(e){return s(this,r,"f").get(e)}has(e){return s(this,r,"f").has(e)}keys(){return s(this,r,"f").keys()}values(){return s(this,r,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([e,t])=>`${String(e)} => ${String(t)}`).join(", ")} `:""}}`}}t.FrozenMap=o;class a{constructor(e){n.set(this,void 0),i(this,n,new Set(e),"f"),Object.freeze(this)}get size(){return s(this,n,"f").size}[(n=new WeakMap,Symbol.iterator)](){return s(this,n,"f")[Symbol.iterator]()}entries(){return s(this,n,"f").entries()}forEach(e,t){return s(this,n,"f").forEach((r,n,i)=>e.call(t,r,n,this))}has(e){return s(this,n,"f").has(e)}keys(){return s(this,n,"f").keys()}values(){return s(this,n,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(e=>String(e)).join(", ")} `:""}}`}}t.FrozenSet=a,Object.freeze(o),Object.freeze(o.prototype),Object.freeze(a),Object.freeze(a.prototype)},7787:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},36985:function(e,t,r){"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;let n=r(66517),i=r(96519);function s(e){return(0,n.is)(e,t.HexStruct)}function o(e){return(0,n.is)(e,t.StrictHexStruct)}t.HexStruct=(0,n.pattern)((0,n.string)(),/^(?:0x)?[0-9a-f]+$/iu),t.StrictHexStruct=(0,n.pattern)((0,n.string)(),/^0x[0-9a-f]+$/iu),t.isHexString=s,t.isStrictHexString=o,t.assertIsHexString=function(e){(0,i.assert)(s(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${e.substring(2)}`:`0x${e}`},t.remove0x=function(e){return e.startsWith("0x")||e.startsWith("0X")?e.substring(2):e}},99153:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);
1(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(96519),t),i(r(21189),t),i(r(11583),t),i(r(47883),t),i(r(36857),t),i(r(39544),t),i(r(7787),t),i(r(36985),t),i(r(12677),t),i(r(36750),t),i(r(47513),t),i(r(91676),t),i(r(31917),t),i(r(53091),t),i(r(45974),t),i(r(1287),t),i(r(31875),t)},12677:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),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.getJsonSize=t.isValidJson=t.JsonStruct=t.UnsafeJsonStruct=void 0;let n=r(66517),i=r(96519);t.UnsafeJsonStruct=(0,n.union)([(0,n.literal)(null),(0,n.boolean)(),(0,n.define)("finite number",e=>(0,n.is)(e,(0,n.number)())&&Number.isFinite(e)),(0,n.string)(),(0,n.array)((0,n.lazy)(()=>t.UnsafeJsonStruct)),(0,n.record)((0,n.string)(),(0,n.lazy)(()=>t.UnsafeJsonStruct))]),t.JsonStruct=(0,n.define)("Json",(e,r)=>{function n(e,t){let n=[...t.validator(e,r)];return!(n.length>0)||n}try{let r=n(e,t.UnsafeJsonStruct);if(!0!==r)return r;return n(JSON.parse(JSON.stringify(e)),t.UnsafeJsonStruct)}catch(e){if(e instanceof RangeError)return"Circular reference detected";return!1}}),t.isValidJson=function(e){return(0,n.is)(e,t.JsonStruct)},t.getJsonSize=function(e){(0,i.assertStruct)(e,t.JsonStruct,"Invalid JSON value");let r=JSON.stringify(e);return new TextEncoder().encode(r).byteLength},t.jsonrpc2="2.0",t.JsonRpcVersionStruct=(0,n.literal)(t.jsonrpc2),t.JsonRpcIdStruct=(0,n.nullable)((0,n.union)([(0,n.number)(),(0,n.string)()])),t.JsonRpcErrorStruct=(0,n.object)({code:(0,n.integer)(),message:(0,n.string)(),data:(0,n.optional)(t.JsonStruct),stack:(0,n.optional)((0,n.string)())}),t.JsonRpcParamsStruct=(0,n.optional)((0,n.union)([(0,n.record)((0,n.string)(),t.JsonStruct),(0,n.array)(t.JsonStruct)])),t.JsonRpcRequestStruct=(0,n.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,method:(0,n.string)(),params:t.JsonRpcParamsStruct}),t.JsonRpcNotificationStruct=(0,n.omit)(t.JsonRpcRequestStruct,["id"]),t.isJsonRpcNotification=function(e){return(0,n.is)(e,t.JsonRpcNotificationStruct)},t.assertIsJsonRpcNotification=function(e,r){(0,i.assertStruct)(e,t.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",r)},t.isJsonRpcRequest=function(e){return(0,n.is)(e,t.JsonRpcRequestStruct)},t.assertIsJsonRpcRequest=function(e,r){(0,i.assertStruct)(e,t.JsonRpcRequestStruct,"Invalid JSON-RPC request",r)},t.PendingJsonRpcResponseStruct=(0,n.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:(0,n.optional)((0,n.unknown)()),error:(0,n.optional)(t.JsonRpcErrorStruct)}),t.JsonRpcSuccessStruct=(0,n.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:t.JsonStruct}),t.JsonRpcFailureStruct=(0,n.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,error:t.JsonRpcErrorStruct}),t.JsonRpcResponseStruct=(0,n.union)([t.JsonRpcSuccessStruct,t.JsonRpcFailureStruct]),t.isPendingJsonRpcResponse=function(e){return(0,n.is)(e,t.PendingJsonRpcResponseStruct)},t.assertIsPendingJsonRpcResponse=function(e,r){(0,i.assertStruct)(e,t.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",r)},t.isJsonRpcResponse=function(e){return(0,n.is)(e,t.JsonRpcResponseStruct)},t.assertIsJsonRpcResponse=function(e,r){(0,i.assertStruct)(e,t.JsonRpcResponseStruct,"Invalid JSON-RPC response",r)},t.isJsonRpcSuccess=function(e){return(0,n.is)(e,t.JsonRpcSuccessStruct)},t.assertIsJsonRpcSuccess=function(e,r){(0,i.assertStruct)(e,t.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",r)},t.isJsonRpcFailure=function(e){return(0,n.is)(e,t.JsonRpcFailureStruct)},t.assertIsJsonRpcFailure=function(e,r){(0,i.assertStruct)(e,t.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",r)},t.isJsonRpcError=function(e){return(0,n.is)(e,t.JsonRpcErrorStruct)},t.assertIsJsonRpcError=function(e,r){(0,i.assertStruct)(e,t.JsonRpcErrorStruct,"Invalid JSON-RPC error",r)},t.getJsonRpcIdValidator=function(e){let{permitEmptyString:t,permitFractions:r,permitNull:n}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},e);return e=>!!("number"==typeof e&&(r||Number.isInteger(e))||"string"==typeof e&&(t||e.length>0)||n&&null===e)}},36750:function(e,t){"use strict";
1Object.defineProperty(t,"__esModule",{value:!0})},47513:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.createModuleLogger=t.createProjectLogger=void 0;let i=(0,n(r(55022)).default)("metamask");t.createProjectLogger=function(e){return i.extend(e)},t.createModuleLogger=function(e,t){return e.extend(t)}},91676:function(e,t){"use strict";var r;function n(e){return 127>=e.charCodeAt(0)}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},t.isObject=function(e){return!!e&&"object"==typeof e&&!Array.isArray(e)},t.hasProperty=(e,t)=>Object.hasOwnProperty.call(e,t),(r=t.JsonSize||(t.JsonSize={}))[r.Null=4]="Null",r[r.Comma=1]="Comma",r[r.Wrapper=1]="Wrapper",r[r.True=4]="True",r[r.False=5]="False",r[r.Quote=1]="Quote",r[r.Colon=1]="Colon",r[r.Date=24]="Date",t.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu,t.isPlainObject=function(e){if("object"!=typeof e||null===e)return!1;try{let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}catch(e){return!1}},t.isASCII=n,t.calculateStringSize=function(e){var r;return e.split("").reduce((e,t)=>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}},31917:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hexToBigInt=t.hexToNumber=t.bigIntToHex=t.numberToHex=void 0;let n=r(96519),i=r(36985);t.numberToHex=e=>((0,n.assert)("number"==typeof e,"Value must be a number."),(0,n.assert)(e>=0,"Value must be a non-negative number."),(0,n.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,i.add0x)(e.toString(16))),t.bigIntToHex=e=>((0,n.assert)("bigint"==typeof e,"Value must be a bigint."),(0,n.assert)(e>=0,"Value must be a non-negative bigint."),(0,i.add0x)(e.toString(16))),t.hexToNumber=e=>{(0,i.assertIsHexString)(e);let t=parseInt(e,16);return(0,n.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t},t.hexToBigInt=e=>((0,i.assertIsHexString)(e),BigInt((0,i.add0x)(e)))},53091:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},45974:function(e,t){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.timeSince=t.inMilliseconds=t.Duration=void 0,(r=t.Duration||(t.Duration={}))[r.Millisecond=1]="Millisecond",r[r.Second=1e3]="Second",r[r.Minute=6e4]="Minute",r[r.Hour=36e5]="Hour",r[r.Day=864e5]="Day",r[r.Week=6048e5]="Week",r[r.Year=31536e6]="Year";let n=e=>Number.isInteger(e)&&e>=0,i=(e,t)=>{if(!n(e))throw Error(`"${t}" must be a non-negative integer. Received: "${e}".`)};t.inMilliseconds=function(e,t){return i(e,"count"),e*t},t.timeSince=function(e){return i(e,"timestamp"),Date.now()-e}},1287:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},31875:function(e,t,r){"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;let n=r(45755),i=r(66517),s=r(96519);t.VersionStruct=(0,i.refine)((0,i.string)(),"Version",e=>null!==(0,n.valid)(e)||`Expected SemVer version, got "${e}"`),t.VersionRangeStruct=(0,i.refine)((0,i.string)(),"Version range",e=>null!==(0,n.validRange)(e)||`Expected SemVer range, got "${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,s.assertStruct)(e,t.VersionStruct)},t.assertIsSemVerRange=function(e){(0,s.assertStruct)(e,t.VersionRangeStruct)},t.gtVersion=function(e,t){return(0,n.gt)(e,t)},t.gtRange=function(e,t){return(0,n.gtr)(e,t)},t.satisfiesVersionRange=function(e,t){return(0,n.satisfies)(e,t,{includePrerelease:!0})}},24459:function(e,t,r){"use strict";t._O=t.Jq=t.KB=t.u8=t.cv=void 0,t.Ik=t.A9=t.n_=t.gM=void 0;let n=r(9109);function i(e){if(!(e instanceof Uint8Array))throw TypeError("b must be a Uint8Array")}function s(e){return i(e),n.Buffer.from(e.buffer,e.byteOffset,e.length)}class o{constructor(e,t){if(!Number.isInteger(e))throw TypeError("span must be an integer");this.span=e,this.property=t}makeDestinationObject(){return{}}getSpan(e,t){if(0>this.span)throw RangeError("indeterminate span");return this.span}replicate(e){let t=Object.create(this.constructor.prototype);return Object.assign(t,this),t.property=e,t}fromArray(e){}}function a(e,t){return t.property?e+"["+t.property+"]":e}class l extends o{isCount(){throw Error("ExternalLayout is abstract")}}class u extends l{constructor(e,t=0,r){if(!(e instanceof o))throw TypeError("layout must be a Layout");if(!Number.isInteger(t))throw TypeError("offset must be integer or undefined");super(e.span,r||e.property),this.layout=e,this.offset=t}isCount(){return this.layout instanceof c||this.layout instanceof h}decode(e,t=0){return this.layout.decode(e,t+this.offset)}encode(e,t,r=0){return this.layout.encode(e,t,r+this.offset)}}class c extends o{constructor(e,t){if(super(e,t),6<this.span)throw RangeError("span must not exceed 6 bytes")}decode(e,t=0){return s(e).readUIntLE(t,this.span)}encode(e,t,r=0){return s(t).writeUIntLE(e,r,this.span),this.span}}class h extends o{constructor(e,t){if(super(e,t),6<this.span)throw RangeError("span must not exceed 6 bytes")}decode(e,t=0){return s(e).readUIntBE(t,this.span)}encode(e,t,r=0){return s(t).writeUIntBE(e,r,this.span),this.span}}function d(e){let t=Math.floor(e/4294967296);return{hi32:t,lo32:e-4294967296*t}}function f(e,t){return 4294967296*e+t}class p extends o{constructor(e){super(8,e)}decode(e,t=0){let r=s(e),n=r.readUInt32LE(t);return f(r.readUInt32LE(t+4),n)}encode(e,t,r=0){let n=d(e),i=s(t);return i.writeUInt32LE(n.lo32,r),i.writeUInt32LE(n.hi32,r+4),8}}class g extends o{constructor(e){super(8,e)}decode(e,t=0){let r=s(e),n=r.readUInt32LE(t);return f(r.readInt32LE(t+4),n)}encode(e,t,r=0){let n=d(e),i=s(t);return i.writeUInt32LE(n.lo32,r),i.writeInt32LE(n.hi32,r+4),8}}class y extends o{constructor(e,t,r){if(!(e instanceof o))throw TypeError("elementLayout must be a Layout");if(!(t instanceof l&&t.isCount()||Number.isInteger(t)&&0<=t))throw TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");let n=-1;t instanceof l||!(0<e.span)||(n=t*e.span),super(n,r),this.elementLayout=e,this.count=t}getSpan(e,t=0){if(0<=this.span)return this.span;let r=0,n=this.count;if(n instanceof l&&(n=n.decode(e,t)),0<this.elementLayout.span)r=n*this.elementLayout.span;else{let i=0;for(;i<n;)r+=this.elementLayout.getSpan(e,t+r),++i}return r}decode(e,t=0){let r=[],n=0,i=this.count;for(i instanceof l&&(i=i.decode(e,t));n<i;)r.push(this.elementLayout.decode(e,t)),t+=this.elementLayout.getSpan(e,t),n+=1;return r}encode(e,t,r=0){let n=this.elementLayout,i=e.reduce((e,i)=>e+n.encode(i,t,r+e),0);return this.count instanceof l&&this.count.encode(e.length,t,r),i}}class m extends o{constructor(e,t,r){if(!(Array.isArray(e)&&e.reduce((e,t)=>
1e&&t instanceof o,!0)))throw TypeError("fields must be array of Layout instances");for(let n of("boolean"==typeof t&&void 0===r&&(r=t,t=void 0),e))if(0>n.span&&void 0===n.property)throw Error("fields cannot contain unnamed variable-length layout");let n=-1;try{n=e.reduce((e,t)=>e+t.getSpan(),0)}catch(e){}super(n,t),this.fields=e,this.decodePrefixes=!!r}getSpan(e,t=0){if(0<=this.span)return this.span;let r=0;try{r=this.fields.reduce((r,n)=>{let i=n.getSpan(e,t);return t+=i,r+i},0)}catch(e){throw RangeError("indeterminate span")}return r}decode(e,t=0){i(e);let r=this.makeDestinationObject();for(let n of this.fields)if(void 0!==n.property&&(r[n.property]=n.decode(e,t)),t+=n.getSpan(e,t),this.decodePrefixes&&e.length===t)break;return r}encode(e,t,r=0){let n=r,i=0,s=0;for(let n of this.fields){let o=n.span;if(s=0<o?o:0,void 0!==n.property){let i=e[n.property];void 0!==i&&(s=n.encode(i,t,r),0>o&&(o=n.getSpan(t,r)))}i=r,r+=o}return i+s-n}fromArray(e){let t=this.makeDestinationObject();for(let r of this.fields)void 0!==r.property&&0<e.length&&(t[r.property]=e.shift());return t}layoutFor(e){if("string"!=typeof e)throw TypeError("property must be string");for(let t of this.fields)if(t.property===e)return t}offsetOf(e){if("string"!=typeof e)throw TypeError("property must be string");let t=0;for(let r of this.fields){if(r.property===e)return t;0>r.span?t=-1:0<=t&&(t+=r.span)}}}class v{constructor(e){this.property=e}decode(e,t){throw Error("UnionDiscriminator is abstract")}encode(e,t,r){throw Error("UnionDiscriminator is abstract")}}class b extends v{constructor(e,t){if(!(e instanceof l&&e.isCount()))throw TypeError("layout must be an unsigned integer ExternalLayout");super(t||e.property||"variant"),this.layout=e}decode(e,t){return this.layout.decode(e,t)}encode(e,t,r){return this.layout.encode(e,t,r)}}class w extends o{constructor(e,t,r){let n;if(e instanceof c||e instanceof h)n=new b(new u(e));else if(e instanceof l&&e.isCount())n=new b(e);else if(e instanceof v)n=e;else throw TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if(void 0===t&&(t=null),!(null===t||t instanceof o))throw TypeError("defaultLayout must be null or a Layout");if(null!==t){if(0>t.span)throw Error("defaultLayout must have constant span");void 0===t.property&&(t=t.replicate("content"))}let i=-1;t&&0<=(i=t.span)&&(e instanceof c||e instanceof h)&&(i+=n.layout.span),super(i,r),this.discriminator=n,this.usesPrefixDiscriminator=e instanceof c||e instanceof h,this.defaultLayout=t,this.registry={};let s=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(e){return s(e)},this.configGetSourceVariant=function(e){s=e.bind(this)}}getSpan(e,t=0){if(0<=this.span)return this.span;let r=this.getVariant(e,t);if(!r)throw Error("unable to determine span for unrecognized variant");return r.getSpan(e,t)}defaultGetSourceVariant(e){if(Object.prototype.hasOwnProperty.call(e,this.discriminator.property)){if(this.defaultLayout&&this.defaultLayout.property&&Object.prototype.hasOwnProperty.call(e,this.defaultLayout.property))return;let t=this.registry[e[this.discriminator.property]];if(t&&(!t.layout||t.property&&Object.prototype.hasOwnProperty.call(e,t.property)))return t}else for(let t in this.registry){let r=this.registry[t];if(r.property&&Object.prototype.hasOwnProperty.call(e,r.property))return r}throw Error("unable to infer src variant")}decode(e,t=0){let r;let n=this.discriminator,i=n.decode(e,t),s=this.registry[i];if(void 0===s){let s=this.defaultLayout,o=0;this.usesPrefixDiscriminator&&(o=n.layout.span),(r=this.makeDestinationObject())[n.property]=i,r[s.property]=s.decode(e,t+o)}else r=s.decode(e,t);return r}encode(e,t,r=0){let n=this.getSourceVariant(e);if(void 0===n){let n=this.discriminator,i=this.defaultLayout,s=0;return this.usesPrefixDiscriminator&&(s=n.layout.span),n.encode(e[n.property],t,r),s+i.encode(e[i.property],t,r+s)}return n.encode(e,t,r)}addVariant(e,t,r){let n=new _(this,e,t,r);return this.registry[e]=n,n}getVariant(e,t=0){let r;return e instanceof Uint8Array?r=this.discriminator.decode(e,t):r=e,this.registry[r]}}class _ extends o{constructor(e,t,r,n){if(!(e instanceof w))throw TypeError("union must be a Union");if(!Number.isInteger(t)||0>t)throw TypeError("variant must be a (non-negative) integer");if("string"==typeof r&&void 0===n&&(n=r,r=null),r){if(!(r instanceof o))throw TypeError("layout must be a Layout");
1if(null!==e.defaultLayout&&0<=r.span&&r.span>e.defaultLayout.span)throw Error("variant span exceeds span of containing union");if("string"!=typeof n)throw TypeError("variant must have a String property")}let i=e.span;0>e.span&&0<=(i=r?r.span:0)&&e.usesPrefixDiscriminator&&(i+=e.discriminator.layout.span),super(i,n),this.union=e,this.variant=t,this.layout=r||null}getSpan(e,t=0){if(0<=this.span)return this.span;let r=0;this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span);let n=0;return this.layout&&(n=this.layout.getSpan(e,t+r)),r+n}decode(e,t=0){let r=this.makeDestinationObject();if(this!==this.union.getVariant(e,t))throw Error("variant mismatch");let n=0;return this.union.usesPrefixDiscriminator&&(n=this.union.discriminator.layout.span),this.layout?r[this.property]=this.layout.decode(e,t+n):this.property?r[this.property]=!0:this.union.usesPrefixDiscriminator&&(r[this.union.discriminator.property]=this.variant),r}encode(e,t,r=0){let n=0;if(this.union.usesPrefixDiscriminator&&(n=this.union.discriminator.layout.span),this.layout&&!Object.prototype.hasOwnProperty.call(e,this.property))throw TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,t,r);let i=n;if(this.layout&&(this.layout.encode(e[this.property],t,r+n),i+=this.layout.getSpan(t,r+n),0<=this.union.span&&i>this.union.span))throw Error("encoded variant overruns containing union");return i}fromArray(e){if(this.layout)return this.layout.fromArray(e)}}function E(e){return 0>e&&(e+=4294967296),e}class S extends o{constructor(e,t,r){if(!(e instanceof c||e instanceof h))throw TypeError("word must be a UInt or UIntBE layout");if("string"==typeof t&&void 0===r&&(r=t,t=!1),4<e.span)throw RangeError("word cannot exceed 32 bits");super(e.span,r),this.word=e,this.msb=!!t,this.fields=[];let n=0;this._packedSetValue=function(e){return n=E(e),this},this._packedGetValue=function(){return n}}decode(e,t=0){let r=this.makeDestinationObject(),n=this.word.decode(e,t);for(let t of(this._packedSetValue(n),this.fields))void 0!==t.property&&(r[t.property]=t.decode(e));return r}encode(e,t,r=0){let n=this.word.decode(t,r);for(let t of(this._packedSetValue(n),this.fields))if(void 0!==t.property){let r=e[t.property];void 0!==r&&t.encode(r)}return this.word.encode(this._packedGetValue(),t,r)}addField(e,t){let r=new A(this,e,t);return this.fields.push(r),r}addBoolean(e){let t=new k(this,e);return this.fields.push(t),t}fieldFor(e){if("string"!=typeof e)throw TypeError("property must be string");for(let t of this.fields)if(t.property===e)return t}}class A{constructor(e,t,r){if(!(e instanceof S))throw TypeError("container must be a BitStructure");if(!Number.isInteger(t)||0>=t)throw TypeError("bits must be positive integer");let n=8*e.span,i=e.fields.reduce((e,t)=>e+t.bits,0);if(t+i>n)throw Error("bits too long for span remainder ("+(n-i)+" of "+n+" remain)");this.container=e,this.bits=t,this.valueMask=(1<<t)-1,32===t&&(this.valueMask=4294967295),this.start=i,this.container.msb&&(this.start=n-i-t),this.wordMask=E(this.valueMask<<this.start),this.property=r}decode(e,t){return E(this.container._packedGetValue()&this.wordMask)>>>this.start}encode(e){if("number"!=typeof e||!Number.isInteger(e)||e!==E(e&this.valueMask))throw TypeError(a("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);let t=this.container._packedGetValue(),r=E(e<<this.start);this.container._packedSetValue(E(t&~this.wordMask)|r)}}class k extends A{constructor(e,t){super(e,1,t)}decode(e,t){return!!super.decode(e,t)}encode(e){"boolean"==typeof e&&(e=+e),super.encode(e)}}class C extends o{constructor(e,t){if(!(e instanceof l&&e.isCount()||Number.isInteger(e)&&0<=e))throw TypeError("length must be positive integer or an unsigned integer ExternalLayout");let r=-1;e instanceof l||(r=e),super(r,t),this.length=e}getSpan(e,t){let r=this.span;return 0>r&&(r=this.length.decode(e,t)),r}decode(e,t=0){let r=this.span;return 0>r&&(r=this.length.decode(e,t)),s(e).slice(t,t+r)}encode(e,t,r){let n=this.length;if(this.length instanceof l&&(n=e.length),!(e instanceof Uint8Array&&n===e.length))throw TypeError(a("Blob.encode",this)+" requires (length "+n+") Uint8Array as src");if(r+n>t.length)throw RangeError("encoding overruns Uint8Array");let i=s(e);return s(t).write(i.toString("hex"),r,n,"hex"),this.length instanceof l&&this.length.encode(n,t,r),n}}t.cv=(e,t,r)=>new u(e,t,r),t.u8=e=>new c(1,e),t.KB=e=>
1new c(2,e),t.Jq=e=>new c(4,e),t._O=e=>new p(e),t.gM=e=>new g(e),t.n_=(e,t,r)=>new m(e,t,r),t.A9=(e,t,r)=>new y(e,t,r),t.Ik=(e,t)=>new C(e,t)},18615:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(24986);function i(e,t,r){return void 0===t&&(t=new Uint8Array(2)),void 0===r&&(r=0),t[r+0]=e>>>8,t[r+1]=e>>>0,t}function s(e,t,r){return void 0===t&&(t=new Uint8Array(2)),void 0===r&&(r=0),t[r+0]=e>>>0,t[r+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 a(e,t){return void 0===t&&(t=0),(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function l(e,t){return void 0===t&&(t=0),e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]}function u(e,t){return void 0===t&&(t=0),(e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t])>>>0}function c(e,t,r){return void 0===t&&(t=new Uint8Array(4)),void 0===r&&(r=0),t[r+0]=e>>>24,t[r+1]=e>>>16,t[r+2]=e>>>8,t[r+3]=e>>>0,t}function h(e,t,r){return void 0===t&&(t=new Uint8Array(4)),void 0===r&&(r=0),t[r+0]=e>>>0,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24,t}function d(e,t,r){return void 0===t&&(t=new Uint8Array(8)),void 0===r&&(r=0),c(e/4294967296>>>0,t,r),c(e>>>0,t,r+4),t}function f(e,t,r){return void 0===t&&(t=new Uint8Array(8)),void 0===r&&(r=0),h(e>>>0,t,r),h(e/4294967296>>>0,t,r+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=s,t.writeInt16LE=s,t.readInt32BE=o,t.readUint32BE=a,t.readInt32LE=l,t.readUint32LE=u,t.writeUint32BE=c,t.writeInt32BE=c,t.writeUint32LE=h,t.writeInt32LE=h,t.readInt64BE=function(e,t){void 0===t&&(t=0);var r=o(e,t),n=o(e,t+4);return 4294967296*r+n-(n>>31)*4294967296},t.readUint64BE=function(e,t){return void 0===t&&(t=0),4294967296*a(e,t)+a(e,t+4)},t.readInt64LE=function(e,t){void 0===t&&(t=0);var r=l(e,t);return 4294967296*l(e,t+4)+r-(r>>31)*4294967296},t.readUint64LE=function(e,t){void 0===t&&(t=0);var r=u(e,t);return 4294967296*u(e,t+4)+r},t.writeUint64BE=d,t.writeInt64BE=d,t.writeUint64LE=f,t.writeInt64LE=f,t.readUintBE=function(e,t,r){if(void 0===r&&(r=0),e%8!=0)throw Error("readUintBE supports only bitLengths divisible by 8");if(e/8>t.length-r)throw Error("readUintBE: array is too short for the given b
1itLength");for(var n=0,i=1,s=e/8+r-1;s>=r;s--)n+=t[s]*i,i*=256;return n},t.readUintLE=function(e,t,r){if(void 0===r&&(r=0),e%8!=0)throw Error("readUintLE supports only bitLengths divisible by 8");if(e/8>t.length-r)throw Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,s=r;s<r+e/8;s++)n+=t[s]*i,i*=256;return n},t.writeUintBE=function(e,t,r,i){if(void 0===r&&(r=new Uint8Array(e/8)),void 0===i&&(i=0),e%8!=0)throw Error("writeUintBE supports only bitLengths divisible by 8");if(!n.isSafeInteger(t))throw Error("writeUintBE value must be an integer");for(var s=1,o=e/8+i-1;o>=i;o--)r[o]=t/s&255,s*=256;return r},t.writeUintLE=function(e,t,r,i){if(void 0===r&&(r=new Uint8Array(e/8)),void 0===i&&(i=0),e%8!=0)throw Error("writeUintLE supports only bitLengths divisible by 8");if(!n.isSafeInteger(t))throw Error("writeUintLE value must be an integer");for(var s=1,o=i;o<i+e/8;o++)r[o]=t/s&255,s*=256;return r},t.readFloat32BE=function(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat32(t)},t.readFloat32LE=function(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat32(t,!0)},t.readFloat64BE=function(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat64(t)},t.readFloat64LE=function(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat64(t,!0)},t.writeFloat32BE=function(e,t,r){return void 0===t&&(t=new Uint8Array(4)),void 0===r&&(r=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat32(r,e),t},t.writeFloat32LE=function(e,t,r){return void 0===t&&(t=new Uint8Array(4)),void 0===r&&(r=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat32(r,e,!0),t},t.writeFloat64BE=function(e,t,r){return void 0===t&&(t=new Uint8Array(8)),void 0===r&&(r=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat64(r,e),t},t.writeFloat64LE=function(e,t,r){return void 0===t&&(t=new Uint8Array(8)),void 0===r&&(r=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat64(r,e,!0),t}},94168:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(18615),i=r(32583);function s(e,t,r,s,o){if(void 0===o&&(o=0),32!==e.length)throw Error("ChaCha: key size must be 32 bytes");if(s.length<r.length)throw Error("ChaCha: destination is shorter than source");if(0===o){if(8!==t.length&&12!==t.length)throw Error("ChaCha nonce must be 8 or 12 bytes");l=(a=new Uint8Array(16)).length-t.length,a.set(t,l)}else{if(16!==t.length)throw Error("ChaCha nonce with counter must be 16 bytes");a=t,l=o}for(var a,l,u=new Uint8Array(64),c=0;c<r.length;c+=64){!function(e,t,r){for(var i=r[3]<<24|r[2]<<16|r[1]<<8|r[0],s=r[7]<<24|r[6]<<16|r[5]<<8|r[4],o=r[11]<<24|r[10]<<16|r[9]<<8|r[8],a=r[15]<<24|r[14]<<16|r[13]<<8|r[12],l=r[19]<<24|r[18]<<16|r[17]<<8|r[16],u=r[23]<<24|r[22]<<16|r[21]<<8|r[20],c=r[27]<<24|r[26]<<16|r[25]<<8|r[24],h=r[31]<<24|r[30]<<16|r[29]<<8|r[28],d=t[3]<<24|t[2]<<16|t[1]<<8|t[0],f=t[7]<<24|t[6]<<16|t[5]<<8|t[4],p=t[11]<<24|t[10]<<16|t[9]<<8|t[8],g=t[15]<<24|t[14]<<16|t[13]<<8|t[12],y=1634760805,m=857760878,v=2036477234,b=1797285236,w=i,_=s,E=o,S=a,A=l,k=u,C=c,I=h,x=d,P=f,O=p,T=g,R=0;R<20;R+=2)x^=y=y+w|0,w^=A=A+(x=x>>>16|x<<16)|0,w=w>>>20|w<<12,P^=m=m+_|0,_^=k=k+(P=P>>>16|P<<16)|0,_=_>>>20|_<<12,O^=v=v+E|0,E^=C=C+(O=O>>>16|O<<16)|0,E=E>>>20|E<<12,T^=b=b+S|0,S^=I=I+(T=T>>>16|T<<16)|0,S=S>>>20|S<<12,O^=v=v+E|0,E^=C=C+(O=O>>>24|O<<8)|0,E=E>>>25|E<<7,T^=b=b+S|0,S^=I=I+(T=T>>>24|T<<8)|0,S=S>>>25|S<<7,P^=m=m+_|0,_^=k=k+(P=P>>>24|P<<8)|0,_=_>>>25|_<<7,x^=y=y+w|0,w^=A=A+(x=x>>>24|x<<8)|0,w=w>>>25|w<<7,T^=y=y+_|0,_^=C=C+(T=T>>>16|T<<16)|0,_=_>>>20|_<<12,x^=m=m+E|0,E^=I=I+(x=x>>>16|x<<16)|0,E=E>>>20|E<<12,P^=v=v+S|0,S^=A=A+(P=P>>>16|P<<16)|0,S=S>>>20|S<<12,O^=b=b+w|0,w^=k=k+(O=O>>>16|O<<16)|0,w=w>>>20|w<<12,P^=v=v+S|0,S^=A=A+(P=P>>>24|P<<8)|0,S=S>>>25|S<<7,O^=b=b+w|0,w^=k=k+(O=O>>>24|O<<8)|0,w=w>>>25|w<<7,x^=m=m+E|0,E^=I=I+(x=x>>>24|x<<8)|0,E=E>>>25|E<<7,T^=y=y+_|0,_^=C=C+(T=T>>>24|T<<8)|0,_=_>>>25|_<<7;n.writeUint32LE(y+1634760805|0,e,0),n.writeUint32LE(m+857760878|0,e,4),n.writeUint32LE(v+2036477234|0,e,8),n.writeUint32LE(b+1797285236|0,e,12),n.writeUint32LE(w+i|0,e,16),n.writeUint32LE(_+s|0,e,20),n.writeUint32LE(E+o|0,e,24),n.writeUint32LE(S+a|0,e,28),n.writeUint32LE(A+l|0,e,32),n.writeUint32LE(k+u|0,e,36),n.writeUint32LE(C+c|0,e,40),n.writeUint32LE(I+h|0,e,44),n.writeUint32LE(x+d|0,e,48),n.writeUint32LE(P+f|0,e,52),n.writeUint32LE(O+p|0,e,56),n.writeUint32LE(T+g|0,e,60)}(u,a,e);for(var h=c;h<c+64&&h<r.length;h++)s[h]=r[h]^u[h-c];!function(e,t,r){for(var n=1;r--;)n=n+(255&e[t])|0,e[t]=255&n,n>>>=8,t++;if(n>0)throw Error("ChaCha: counter overflow")}(a,0,l)}return i.wipe(u),0===o&&i.wipe(a),s}t.streamXOR=s,t.stream=function(e,t,r,n){return void 0===n&&(n=0),i.wipe(r),s(e,t,r,r,n)}},23518:function(e,t,r){"use strict";var n=r(94168),i=r(14605),s=r(32583),o=r(18615),a=r(21346);t.Cv=32,t.WH=12,t.pg=16;var l=new Uint8Array(16),u=function(){function e(e){if(this.nonceLength=t.WH,this.tagLength=t.pg,e.length!==t.Cv)throw Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(e)}return e.prototype.seal=function(e,t,r,i){if(e.length>16)throw Error("ChaCha20Poly1305: incorrect nonce length");var o,a=new Uint8Array(16);a.set(e,a.length-e.length);var l=new Uint8Array(32);n.stream(this._key,a,l,4);var u=t.length+this.tagLength;if(i){if(i.length!==u)throw Error("ChaCha20Poly1305: incorrect destination length");o=i}else o=new Uint8Array(u);return n.streamXOR(this._key,a,t,o,4),this._authenticate(o.subarray(o.length-this.tagLength,o.length),l,o.subarray(0,o.length-this.tagLength),r),s.wipe(a),o},e.prototype.open=function(e,t,r,i){if(e.length>16)throw Error("ChaCha20Poly1305: incorrect nonce length");if(t.length<this.tagLength)return null;var o,l=new Uint8Array(16);l.set(e,l.length-e.length);var u=new Uint8Array(32);n.stream(this._key,l,u,4);var c=new Uint8Array(this.tagLength);if(this._authenticate(c,u,t.subarray(0,t.length-this.tagLength),r),!a.equal(c,t.subarray(t.length-this.tagLength,t.length)))return null;var h=t.length-this.tagLength;if(i){if(i.length!==h)throw Error("ChaCha20Poly1305: incorrect destination length");o=i}else o=new Uint8Array(h);return n.streamXOR(this._key,l,t.subarray(0,t.length-this.tagLength),o,4),s.wipe(l),o},e.prototype.clean=function(){return s.wipe(this._key),this},e.prototype._authenticate=function(e,t,r,n){var a=new i.Poly1305(t);n&&(a.update(n),n.length%16>0&&a.update(l.subarray(n.length%16))),a.update(r),r.length%16>0&&a.update(l.subarray(r.length%16));var u=new Uint8Array(8);n&&o.writeUint64LE(n.length,u),a.update(u),o.writeUint64LE(r.length,u),a.update(u);for(var c=a.digest(),h=0;h<c.length;h++)e[h]=c[h];a.clean(),s.wipe(c),s.wipe(u)},e}();t.OK=u},21346:function(e,t){"use strict";function r(e,t){if(e.length!==t.length)return 0;for(var r=0,n=0;n<e.length;n++)r|=e[n]^t[n];return 1&r-1>>>8}
1Object.defineProperty(t,"__esModule",{value:!0}),t.select=function(e,t,r){return~(e-1)&t|e-1&r},t.lessOrEqual=function(e,t){return(0|e)-(0|t)-1>>>31&1},t.compare=r,t.equal=function(e,t){return 0!==e.length&&0!==t.length&&0!==r(e,t)}},59271:function(e,t,r){"use strict";t.Xx=t._w=t.aP=t.KS=t.jQ=void 0,r(24861);let n=r(13033);function i(e){let t=new Float64Array(16);if(e)for(let r=0;r<e.length;r++)t[r]=e[r];return t}r(32583),t.jQ=64,t.KS=64,t.aP=32,new Uint8Array(32)[0]=9;let s=i(),o=i([1]),a=(i([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),i([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222])),l=i([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),u=i([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]);function c(e,t){for(let r=0;r<16;r++)e[r]=0|t[r]}function h(e){let t=1;for(let r=0;r<16;r++){let n=e[r]+t+65535;t=Math.floor(n/65536),e[r]=n-65536*t}e[0]+=t-1+37*(t-1)}function d(e,t,r){let n=~(r-1);for(let r=0;r<16;r++){let i=n&(e[r]^t[r]);e[r]^=i,t[r]^=i}}function f(e,t){let r=i(),n=i();for(let e=0;e<16;e++)n[e]=t[e];h(n),h(n),h(n);for(let e=0;e<2;e++){r[0]=n[0]-65517;for(let e=1;e<15;e++)r[e]=n[e]-65535-(r[e-1]>>16&1),r[e-1]&=65535;r[15]=n[15]-32767-(r[14]>>16&1);let e=r[15]>>16&1;r[14]&=65535,d(n,r,1-e)}for(let t=0;t<16;t++)e[2*t]=255&n[t],e[2*t+1]=n[t]>>8}i([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function p(e,t,r){for(let n=0;n<16;n++)e[n]=t[n]+r[n]}function g(e,t,r){for(let n=0;n<16;n++)e[n]=t[n]-r[n]}function y(e,t,r){let n,i,s=0,o=0,a=0,l=0,u=0,c=0,h=0,d=0,f=0,p=0,g=0,y=0,m=0,v=0,b=0,w=0,_=0,E=0,S=0,A=0,k=0,C=0,I=0,x=0,P=0,O=0,T=0,R=0,N=0,D=0,B=0,M=r[0],L=r[1],U=r[2],j=r[3],F=r[4],q=r[5],H=r[6],z=r[7],$=r[8],V=r[9],W=r[10],G=r[11],K=r[12],J=r[13],Y=r[14],Q=r[15];s+=(n=t[0])*M,o+=n*L,a+=n*U,l+=n*j,u+=n*F,c+=n*q,h+=n*H,d+=n*z,f+=n*$,p+=n*V,g+=n*W,y+=n*G,m+=n*K,v+=n*J,b+=n*Y,w+=n*Q,o+=(n=t[1])*M,a+=n*L,l+=n*U,u+=n*j,c+=n*F,h+=n*q,d+=n*H,f+=n*z,p+=n*$,g+=n*V,y+=n*W,m+=n*G,v+=n*K,b+=n*J,w+=n*Y,_+=n*Q,a+=(n=t[2])*M,l+=n*L,u+=n*U,c+=n*j,h+=n*F,d+=n*q,f+=n*H,p+=n*z,g+=n*$,y+=n*V,m+=n*W,v+=n*G,b+=n*K,w+=n*J,_+=n*Y,E+=n*Q,l+=(n=t[3])*M,u+=n*L,c+=n*U,h+=n*j,d+=n*F,f+=n*q,p+=n*H,g+=n*z,y+=n*$,m+=n*V,v+=n*W,b+=n*G,w+=n*K,_+=n*J,E+=n*Y,S+=n*Q,u+=(n=t[4])*M,c+=n*L,h+=n*U,d+=n*j,f+=n*F,p+=n*q,g+=n*H,y+=n*z,m+=n*$,v+=n*V,b+=n*W,w+=n*G,_+=n*K,E+=n*J,S+=n*Y,A+=n*Q,c+=(n=t[5])*M,h+=n*L,d+=n*U,f+=n*j,p+=n*F,g+=n*q,y+=n*H,m+=n*z,v+=n*$,b+=n*V,w+=n*W,_+=n*G,E+=n*K,S+=n*J,A+=n*Y,k+=n*Q,h+=(n=t[6])*M,d+=n*L,f+=n*U,p+=n*j,g+=n*F,y+=n*q,m+=n*H,v+=n*z,b+=n*$,w+=n*V,_+=n*W,E+=n*G,S+=n*K,A+=n*J,k+=n*Y,C+=n*Q,d+=(n=t[7])*M,f+=n*L,p+=n*U,g+=n*j,y+=n*F,m+=n*q,v+=n*H,b+=n*z,w+=n*$,_+=n*V,E+=n*W,S+=n*G,A+=n*K,k+=n*J,C+=n*Y,I+=n*Q,f+=(n=t[8])*M,p+=n*L,g+=n*U,y+=n*j,m+=n*F,v+=n*q,b+=n*H,w+=n*z,_+=n*$,E+=n*V,S+=n*W,A+=n*G,k+=n*K,C+=n*J,I+=n*Y,x+=n*Q,p+=(n=t[9])*M,g+=n*L,y+=n*U,m+=n*j,v+=n*F,b+=n*q,w+=n*H,_+=n*z,E+=n*$,S+=n*V,A+=n*W,k+=n*G,C+=n*K,I+=n*J,x+=n*Y,P+=n*Q,g+=(n=t[10])*M,y+=n*L,m+=n*U,v+=n*j,b+=n*F,w+=n*q,_+=n*H,E+=n*z,S+=n*$,A+=n*V,k+=n*W,C+=n*G,I+=n*K,x+=n*J,P+=n*Y,O+=n*Q,y+=(n=t[11])*M,m+=n*L,v+=n*U,b+=n*j,w+=n*F,_+=n*q,E+=n*H,S+=n*z,A+=n*$,k+=n*V,C+=n*W,I+=n*G,x+=n*K,P+=n*J,O+=n*Y,T+=n*Q,m+=(n=t[12])*M,v+=n*L,b+=n*U,w+=n*j,_+=n*F,E+=n*q,S+=n*H,A+=n*z,k+=n*$,C+=n*V,I+=n*W,x+=n*G,P+=n*K,O+=n*J,T+=n*Y,R+=n*Q,v+=(n=t[13])*M,b+=n*L,w+=n*U,_+=n*j,E+=n*F,S+=n*q,A+=n*H,k+=n*z,C+=n*$,I+=n*V,x+=n*W,P+=n*G,O+=n*K,T+=n*J,R+=n*Y,N+=n*Q,b+=(n=t[14])*M,w+=n*L,_+=n*U,E+=n*j,S+=n*F,A+=n*q,k+=n*H,C+=n*z,I+=n*$,x+=n*V,P+=n*W,O+=n*G,T+=n*K,R+=n*J,N+=n*Y,D+=n*Q,w+=(n=t[15])*M,_+=n*L,E+=n*U,S+=n*j,A+=n*F,k+=n*q,C+=n*H,I+=n*z,x+=n*$,P+=n*V,O+=n*W,T+=n*G,R+=n*K,N+=n*J,D+=n*Y,B+=n*Q,s+=38*_,o+=38*E,a+=38*S,l+=38*A,u+=38*k,c+=38*C,h+=38*I,d+=38*x,f+=38*P,p+=38*O,g+=38*T,y+=38*R,m+=38*N,v+=38*D,b+=38*B,i=Math.floor((n=s+(i=1)+65535)/65536),s=n-65536*i,i=Math.floor((n=o+i+65535)/65536),o=n-65536*i,i=Math.floor((n=a+i+65535)/65536),a=n-65536*i,i=Math.floor((n=l+i+65535)/65536),l=n-6
15536*i,i=Math.floor((n=u+i+65535)/65536),u=n-65536*i,i=Math.floor((n=c+i+65535)/65536),c=n-65536*i,i=Math.floor((n=h+i+65535)/65536),h=n-65536*i,i=Math.floor((n=d+i+65535)/65536),d=n-65536*i,i=Math.floor((n=f+i+65535)/65536),f=n-65536*i,i=Math.floor((n=p+i+65535)/65536),p=n-65536*i,i=Math.floor((n=g+i+65535)/65536),g=n-65536*i,i=Math.floor((n=y+i+65535)/65536),y=n-65536*i,i=Math.floor((n=m+i+65535)/65536),m=n-65536*i,i=Math.floor((n=v+i+65535)/65536),v=n-65536*i,i=Math.floor((n=b+i+65535)/65536),b=n-65536*i,i=Math.floor((n=w+i+65535)/65536),w=n-65536*i,s+=i-1+37*(i-1),i=Math.floor((n=s+(i=1)+65535)/65536),s=n-65536*i,i=Math.floor((n=o+i+65535)/65536),o=n-65536*i,i=Math.floor((n=a+i+65535)/65536),a=n-65536*i,i=Math.floor((n=l+i+65535)/65536),l=n-65536*i,i=Math.floor((n=u+i+65535)/65536),u=n-65536*i,i=Math.floor((n=c+i+65535)/65536),c=n-65536*i,i=Math.floor((n=h+i+65535)/65536),h=n-65536*i,i=Math.floor((n=d+i+65535)/65536),d=n-65536*i,i=Math.floor((n=f+i+65535)/65536),f=n-65536*i,i=Math.floor((n=p+i+65535)/65536),p=n-65536*i,i=Math.floor((n=g+i+65535)/65536),g=n-65536*i,i=Math.floor((n=y+i+65535)/65536),y=n-65536*i,i=Math.floor((n=m+i+65535)/65536),m=n-65536*i,i=Math.floor((n=v+i+65535)/65536),v=n-65536*i,i=Math.floor((n=b+i+65535)/65536),b=n-65536*i,i=Math.floor((n=w+i+65535)/65536),w=n-65536*i,s+=i-1+37*(i-1),e[0]=s,e[1]=o,e[2]=a,e[3]=l,e[4]=u,e[5]=c,e[6]=h,e[7]=d,e[8]=f,e[9]=p,e[10]=g,e[11]=y,e[12]=m,e[13]=v,e[14]=b,e[15]=w}function m(e,t){let r=i(),n=i(),s=i(),o=i(),l=i(),u=i(),c=i(),h=i(),d=i();g(r,e[1],e[0]),g(d,t[1],t[0]),y(r,r,d),p(n,e[0],e[1]),p(d,t[0],t[1]),y(n,n,d),y(s,e[3],t[3]),y(s,s,a),y(o,e[2],t[2]),p(o,o,o),g(l,n,r),g(u,o,s),p(c,o,s),p(h,n,r),y(e[0],l,u),y(e[1],h,c),y(e[2],c,u),y(e[3],l,h)}function v(e,t,r){for(let n=0;n<4;n++)d(e[n],t[n],r)}function b(e,t){let r=i(),n=i(),s=i();(function(e,t){let r;let n=i();for(r=0;r<16;r++)n[r]=t[r];for(r=253;r>=0;r--)y(n,n,n),2!==r&&4!==r&&y(n,n,t);for(r=0;r<16;r++)e[r]=n[r]})(s,t[2]),y(r,t[0],s),y(n,t[1],s),f(e,n),e[31]^=function(e){let t=new Uint8Array(32);return f(t,e),1&t[0]}(r)<<7}function w(e,t){let r=[i(),i(),i(),i()];c(r[0],l),c(r[1],u),c(r[2],o),y(r[3],l,u),function(e,t,r){c(e[0],s),c(e[1],o),c(e[2],o),c(e[3],s);for(let n=255;n>=0;--n){let i=r[n/8|0]>>(7&n)&1;v(e,t,i),m(t,e),m(e,e),v(e,t,i)}}(e,r,t)}t._w=function(e){if(e.length!==t.aP)throw Error(`ed25519: seed must be ${t.aP} bytes`);let r=(0,n.hash)(e);r[0]&=248,r[31]&=127,r[31]|=64;let s=new Uint8Array(32),o=[i(),i(),i(),i()];w(o,r),b(s,o);let a=new Uint8Array(64);return a.set(e),a.set(s,32),{publicKey:s,secretKey:a}};let _=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 E(e,t){let r,n,i,s;for(n=63;n>=32;--n){for(r=0,i=n-32,s=n-12;i<s;++i)t[i]+=r-16*t[n]*_[i-(n-32)],r=Math.floor((t[i]+128)/256),t[i]-=256*r;t[i]+=r,t[n]=0}for(i=0,r=0;i<32;i++)t[i]+=r-(t[31]>>4)*_[i],r=t[i]>>8,t[i]&=255;for(i=0;i<32;i++)t[i]-=r*_[i];for(n=0;n<32;n++)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function S(e){let t=new Float64Array(64);for(let r=0;r<64;r++)t[r]=e[r];for(let t=0;t<64;t++)e[t]=0;E(e,t)}t.Xx=function(e,t){let r=new Float64Array(64),s=[i(),i(),i(),i()],o=(0,n.hash)(e.subarray(0,32));o[0]&=248,o[31]&=127,o[31]|=64;let a=new Uint8Array(64);a.set(o.subarray(32),32);let l=new n.SHA512;l.update(a.subarray(32)),l.update(t);let u=l.digest();l.clean(),S(u),w(s,u),b(a,s),l.reset(),l.update(a.subarray(0,32)),l.update(e.subarray(32)),l.update(t);let c=l.digest();S(c);for(let e=0;e<32;e++)r[e]=u[e];for(let e=0;e<32;e++)for(let t=0;t<32;t++)r[e+t]+=c[e]*o[t];return E(a.subarray(32),r),a}},86784:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isSerializableHash=function(e){return void 0!==e.saveState&&void 0!==e.restoreState&&void 0!==e.cleanSavedState}},67878:function(e,t,r){"use strict";var n=r(4705),i=r(32583),s=function(){function e(e,t,r,i){void 0===r&&(r=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=e,this._info=i;var s=n.hmac(this._hash,r,t);this._hmac=new n.HMAC(e,s),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 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),r=0;r<t.length;r++)this._bufpos===this._buffer.length&&this._fillBuffer(),t[r]=this._buffer[this._bufpos++];return t},e.prototype.clean=function(){this._hmac.clean(),i.wipe(this._buffer),i.wipe(this._counter),this._bufpos=0},e}();t.t=s},4705:function(e,t,r){"use strict";
1Object.defineProperty(t,"__esModule",{value:!0});var n=r(86784),i=r(21346),s=r(32583),o=function(){function e(e,t){this._finished=!1,this._inner=new e,this._outer=new e,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var r=new Uint8Array(this.blockSize);t.length>this.blockSize?this._inner.update(t).finish(r).clean():r.set(t);for(var i=0;i<r.length;i++)r[i]^=54;this._inner.update(r);for(var i=0;i<r.length;i++)r[i]^=106;this._outer.update(r),n.isSerializableHash(this._inner)&&n.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),s.wipe(r)}return e.prototype.reset=function(){if(!n.isSerializableHash(this._inner)||!n.isSerializableHash(this._outer))throw Error("hmac: can't reset() because hash doesn't implement restoreState()");return this._inner.restoreState(this._innerKeyedState),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},e.prototype.clean=function(){n.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),n.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},e.prototype.update=function(e){return this._inner.update(e),this},e.prototype.finish=function(e){return this._finished?this._outer.finish(e):(this._inner.finish(e),this._outer.update(e.subarray(0,this.digestLength)).finish(e),this._finished=!0),this},e.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},e.prototype.saveState=function(){if(!n.isSerializableHash(this._inner))throw Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},e.prototype.restoreState=function(e){if(!n.isSerializableHash(this._inner)||!n.isSerializableHash(this._outer))throw Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(e),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},e.prototype.cleanSavedState=function(e){if(!n.isSerializableHash(this._inner))throw Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(e)},e}();t.HMAC=o,t.hmac=function(e,t,r){var n=new o(e,t);n.update(r);var i=n.digest();return n.clean(),i},t.equal=i.equal},24986:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mul=Math.imul||function(e,t){var r=65535&e,n=65535&t;return r*n+((e>>>16&65535)*n+r*(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<<t|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}},14605:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(21346),i=r(32583);t.DIGEST_LENGTH=16;var s=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 r=e[0]|e[1]<<8;this._r[0]=8191&r;var n=e[2]|e[3]<<8;this._r[1]=(r>>>13|n<<3)&8191;var i=e[4]|e[5]<<8;this._r[2]=(n>>>10|i<<6)&7939;var s=e[6]|e[7]<<8;this._r[3]=(i>>>7|s<<9)&8191;var o=e[8]|e[9]<<8;this._r[4]=(s>>>4|o<<12)&255,this._r[5]=o>>>1&8190;var a=e[10]|e[11]<<8;this._r[6]=(o>>>14|a<<2)&8191;var l=e[12]|e[13]<<8;this._r[7]=(a>>>11|l<<5)&8065;var u=e[14]|e[15]<<8;this._r[8]=(l>>>8|u<<8)&8191,this._r[9]=u>>>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,r){for(var n=this._fin?0:2048,i=this._h[0],s=this._h[1],o=this._h[2],a=this._h[3],l=this._h[4],u=this._h[5],c=this._h[6],h=this._h[7],d=this._h[8],f=this._h[9],p=this._r[0],g=this._r[1],y=this._r[2],m=this._r[3],v=this._r[4],b=this._r[5],w=this._r[6],_=this._r[7],E=this._r[8],S=this._r[9];r>=16;){var A,k=e[t+0]|e[t+1]<<8;i+=8191&k;
1var C=e[t+2]|e[t+3]<<8;s+=(k>>>13|C<<3)&8191;var I=e[t+4]|e[t+5]<<8;o+=(C>>>10|I<<6)&8191;var x=e[t+6]|e[t+7]<<8;a+=(I>>>7|x<<9)&8191;var P=e[t+8]|e[t+9]<<8;l+=(x>>>4|P<<12)&8191,u+=P>>>1&8191;var O=e[t+10]|e[t+11]<<8;c+=(P>>>14|O<<2)&8191;var T=e[t+12]|e[t+13]<<8;h+=(O>>>11|T<<5)&8191;var R=e[t+14]|e[t+15]<<8;d+=(T>>>8|R<<8)&8191,f+=R>>>5|n;var N=0;N=(A=0+i*p+5*S*s+5*E*o+5*_*a+5*w*l)>>>13,A&=8191,A+=5*b*u+5*v*c+5*m*h+5*y*d+5*g*f,N+=A>>>13,A&=8191;var D=N;D+=i*g+s*p+5*S*o+5*E*a+5*_*l,N=D>>>13,D&=8191,D+=5*w*u+5*b*c+5*v*h+5*m*d+5*y*f,N+=D>>>13,D&=8191;var B=N;B+=i*y+s*g+o*p+5*S*a+5*E*l,N=B>>>13,B&=8191,B+=5*_*u+5*w*c+5*b*h+5*v*d+5*m*f,N+=B>>>13,B&=8191;var M=N;M+=i*m+s*y+o*g+a*p+5*S*l,N=M>>>13,M&=8191,M+=5*E*u+5*_*c+5*w*h+5*b*d+5*v*f,N+=M>>>13,M&=8191;var L=N;L+=i*v+s*m+o*y+a*g+l*p,N=L>>>13,L&=8191,L+=5*S*u+5*E*c+5*_*h+5*w*d+5*b*f,N+=L>>>13,L&=8191;var U=N;U+=i*b+s*v+o*m+a*y+l*g,N=U>>>13,U&=8191,U+=u*p+5*S*c+5*E*h+5*_*d+5*w*f,N+=U>>>13,U&=8191;var j=N;j+=i*w+s*b+o*v+a*m+l*y,N=j>>>13,j&=8191,j+=u*g+c*p+5*S*h+5*E*d+5*_*f,N+=j>>>13,j&=8191;var F=N;F+=i*_+s*w+o*b+a*v+l*m,N=F>>>13,F&=8191,F+=u*y+c*g+h*p+5*S*d+5*E*f,N+=F>>>13,F&=8191;var q=N;q+=i*E+s*_+o*w+a*b+l*v,N=q>>>13,q&=8191,q+=u*m+c*y+h*g+d*p+5*S*f,N+=q>>>13,q&=8191;var H=N;H+=i*S+s*E+o*_+a*w+l*b,N=H>>>13,H&=8191,H+=u*v+c*m+h*y+d*g+f*p,N+=H>>>13,H&=8191,A=8191&(N=(N=(N<<2)+N|0)+A|0),N>>>=13,D+=N,i=A,s=D,o=B,a=M,l=L,u=U,c=j,h=F,d=q,f=H,t+=16,r-=16}this._h[0]=i,this._h[1]=s,this._h[2]=o,this._h[3]=a,this._h[4]=l,this._h[5]=u,this._h[6]=c,this._h[7]=h,this._h[8]=d,this._h[9]=f},e.prototype.finish=function(e,t){void 0===t&&(t=0);var r,n,i,s,o=new Uint16Array(10);if(this._leftover){for(s=this._leftover,this._buffer[s++]=1;s<16;s++)this._buffer[s]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(r=this._h[1]>>>13,this._h[1]&=8191,s=2;s<10;s++)this._h[s]+=r,r=this._h[s]>>>13,this._h[s]&=8191;for(this._h[0]+=5*r,r=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=r,r=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=r,o[0]=this._h[0]+5,r=o[0]>>>13,o[0]&=8191,s=1;s<10;s++)o[s]=this._h[s]+r,r=o[s]>>>13,o[s]&=8191;for(o[9]-=8192,n=(1^r)-1,s=0;s<10;s++)o[s]&=n;for(s=0,n=~n;s<10;s++)this._h[s]=this._h[s]&n|o[s];for(s=1,this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,i=this._h[0]+this._pad[0],this._h[0]=65535&i;s<8;s++)i=(this._h[s]+this._pad[s]|0)+(i>>>16)|0,this._h[s]=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,r=0,n=e.length;if(this._leftover){(t=16-this._leftover)>n&&(t=n);for(var i=0;i<t;i++)this._buffer[this._leftover+i]=e[r+i];if(n-=t,r+=t,this._leftover+=t,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(n>=16&&(t=n-n%16,this._blocks(e,r,t),r+=t,n-=t),n){for(var i=0;i<n;i++)this._buffer[this._leftover+i]=e[r+i];this._leftover+=n}return this},e.prototype.digest=function(){if(this._finished)throw Error("Poly1305 was finished");var e=new Uint8Array(16);return this.finish(e),e},e.prototype.clean=function(){return i.wipe(this._buffer),i.wipe(this._r),i.wipe(this._h),i.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},e}();t.Poly1305=s,t.oneTimeAuth=function(e,t){var r=new s(e);r.update(t);var n=r.digest();return r.clean(),n},t.equal=function(e,r){return e.length===t.DIGEST_LENGTH&&r.length===t.DIGEST_LENGTH&&n.equal(e,r)}},24861:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0;let n=r(71722),i=r(18615),s=r(32583);function o(e,r=t.defaultRandomSource){return r.randomBytes(e)}t.defaultRandomSource=new n.SystemRandomSource,t.randomBytes=o,t.randomUint32=function(e=t.defaultRandomSource){let r=o(4,e),n=(0,i.readUint32LE)(r);return(0,s.wipe)(r),n};let a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function l(e,r=a,n=t.defaultRandomSource){if(r.length<2)throw Error("randomString charset is too short");if(r.length>256)throw Error("randomString charset is too long");let i="",l=r.length,u=256-256%l;for(;e>0;){let t=o(Math.ceil(256*e/u),n);for(let n=0;n<t.length&&e>0;n++){let s=t[n];s<u&&(i+=r.charAt(s%l),e--)}(0,s.wipe)(t)}return i}t.randomString=l,t.randomStringForEntropy=function(e,r=a,n=t.defaultRandomSource){return l(Math.ceil(e/(Math.log(r.length)/Math.LN2)),r,n
1)}},3724:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserRandomSource=void 0;class r{constructor(){this.isAvailable=!1,this.isInstantiated=!1;let e="undefined"!=typeof self?self.crypto||self.msCrypto:null;e&&void 0!==e.getRandomValues&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(e){if(!this.isAvailable||!this._crypto)throw Error("Browser random byte generator is not available.");let t=new Uint8Array(e);for(let e=0;e<t.length;e+=65536)this._crypto.getRandomValues(t.subarray(e,e+Math.min(t.length-e,65536)));return t}}t.BrowserRandomSource=r},39663:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeRandomSource=void 0;let n=r(32583);class i{constructor(){this.isAvailable=!1,this.isInstantiated=!1;{let e=r(35883);e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(e){if(!this.isAvailable||!this._crypto)throw Error("Node.js random byte generator is not available.");let t=this._crypto.randomBytes(e);if(t.length!==e)throw Error("NodeRandomSource: got fewer bytes than requested");let r=new Uint8Array(e);for(let e=0;e<r.length;e++)r[e]=t[e];return(0,n.wipe)(t),r}}t.NodeRandomSource=i},71722:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SystemRandomSource=void 0;let n=r(3724),i=r(39663);class s{constructor(){if(this.isAvailable=!1,this.name="",this._source=new n.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new i.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(e){if(!this.isAvailable)throw Error("System random byte generator is not available.");return this._source.randomBytes(e)}}t.SystemRandomSource=s},67929:function(e,t,r){"use strict";var n=r(18615),i=r(32583);t.k=32,t.cn=64;var s=function(){function e(){this.digestLength=t.k,this.blockSize=t.cn,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return e.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},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._temp),this.reset()},e.prototype.update=function(e,t){if(void 0===t&&(t=e.length),this._finished)throw Error("SHA256: can't update because hash was finished.");var r=0;if(this._bytesHashed+=t,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&t>0;)this._buffer[this._bufferLength++]=e[r++],t--;this._bufferLength===this.blockSize&&(a(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(t>=this.blockSize&&(r=a(this._temp,this._state,e,r,t),t%=this.blockSize);t>0;)this._buffer[this._bufferLength++]=e[r++],t--;return this},e.prototype.finish=function(e){if(!this._finished){var t=this._bytesHashed,r=this._bufferLength,i=t%64<56?64:128;this._buffer[r]=128;for(var s=r+1;s<i-8;s++)this._buffer[s]=0;n.writeUint32BE(t/536870912|0,this._buffer,i-8),n.writeUint32BE(t<<3,this._buffer,i-4),a(this._temp,this._state,this._buffer,0,i),this._finished=!0}for(var s=0;s<this.digestLength/4;s++)n.writeUint32BE(this._state[s],e,4*s);return this},e.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},e.prototype.saveState=function(){if(this._finished)throw Error("SHA256: cannot save finished state");return{state:new Int32Array(this._state),buffer:this._bufferLength>0?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=s;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,2756
1734187,3204031479,3329325298]);function a(e,t,r,i,s){for(;s>=64;){for(var a=t[0],l=t[1],u=t[2],c=t[3],h=t[4],d=t[5],f=t[6],p=t[7],g=0;g<16;g++){var y=i+4*g;e[g]=n.readUint32BE(r,y)}for(var g=16;g<64;g++){var m=e[g-2],v=(m>>>17|m<<15)^(m>>>19|m<<13)^m>>>10,b=((m=e[g-15])>>>7|m<<25)^(m>>>18|m<<14)^m>>>3;e[g]=(v+e[g-7]|0)+(b+e[g-16]|0)}for(var g=0;g<64;g++){var v=(((h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+(h&d^~h&f)|0)+(p+(o[g]+e[g]|0)|0)|0,b=((a>>>2|a<<30)^(a>>>13|a<<19)^(a>>>22|a<<10))+(a&l^a&u^l&u)|0;p=f,f=d,d=h,h=c+v|0,c=u,u=l,l=a,a=v+b|0}t[0]+=a,t[1]+=l,t[2]+=u,t[3]+=c,t[4]+=h,t[5]+=d,t[6]+=f,t[7]+=p,i+=64,s-=64}return i}t.vp=function(e){var t=new s;t.update(e);var r=t.digest();return t.clean(),r}},13033:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(18615),i=r(32583);t.DIGEST_LENGTH=64,t.BLOCK_SIZE=128;var s=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,r){if(void 0===r&&(r=e.length),this._finished)throw Error("SHA512: can't update because hash was finished.");var n=0;if(this._bytesHashed+=r,this._bufferLength>0){for(;this._bufferLength<t.BLOCK_SIZE&&r>0;)this._buffer[this._bufferLength++]=e[n++],r--;this._bufferLength===this.blockSize&&(a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(r>=this.blockSize&&(n=a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,e,n,r),r%=this.blockSize);r>0;)this._buffer[this._bufferLength++]=e[n++],r--;return this},e.prototype.finish=function(e){if(!this._finished){var t=this._bytesHashed,r=this._bufferLength,i=t%128<112?128:256;this._buffer[r]=128;for(var s=r+1;s<i-8;s++)this._buffer[s]=0;n.writeUint32BE(t/536870912|0,this._buffer,i-8),n.writeUint32BE(t<<3,this._buffer,i-4),a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,i),this._finished=!0}for(var s=0;s<this.digestLength/8;s++)n.writeUint32BE(this._stateHi[s],e,8*s),n.writeUint32BE(this._stateLo[s],e,8*s+4);return this},e.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},e.prototype.saveState=function(){if(this._finished)throw Error("SHA256: cannot save finished state");return{stateHi:new Int32Array(this._stateHi),stateLo:new Int32Array(this._stateLo),buffer:this._bufferLength>0?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=s;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,
11322822218,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 a(e,t,r,i,s,a,l){for(var u,c,h,d,f,p,g,y,m=r[0],v=r[1],b=r[2],w=r[3],_=r[4],E=r[5],S=r[6],A=r[7],k=i[0],C=i[1],I=i[2],x=i[3],P=i[4],O=i[5],T=i[6],R=i[7];l>=128;){for(var N=0;N<16;N++){var D=8*N+a;e[N]=n.readUint32BE(s,D),t[N]=n.readUint32BE(s,D+4)}for(var N=0;N<80;N++){var B=m,M=v,L=b,U=w,j=_,F=E,q=S,H=A,z=k,$=C,V=I,W=x,G=P,K=O,J=T,Y=R;if(u=A,f=65535&(c=R),p=c>>>16,g=65535&u,y=u>>>16,u=(_>>>14|P<<18)^(_>>>18|P<<14)^(P>>>9|_<<23),f+=65535&(c=(P>>>14|_<<18)^(P>>>18|_<<14)^(_>>>9|P<<23)),p+=c>>>16,g+=65535&u,y+=u>>>16,u=_&E^~_&S,f+=65535&(c=P&O^~P&T),p+=c>>>16,g+=65535&u,y+=u>>>16,u=o[2*N],f+=65535&(c=o[2*N+1]),p+=c>>>16,g+=65535&u,y+=u>>>16,u=e[N%16],f+=65535&(c=t[N%16]),p+=c>>>16,g+=65535&u,y+=u>>>16,p+=f>>>16,g+=p>>>16,y+=g>>>16,h=65535&g|y<<16,d=65535&f|p<<16,u=h,f=65535&(c=d),p=c>>>16,g=65535&u,y=u>>>16,u=(m>>>28|k<<4)^(k>>>2|m<<30)^(k>>>7|m<<25),f+=65535&(c=(k>>>28|m<<4)^(m>>>2|k<<30)^(m>>>7|k<<25)),p+=c>>>16,g+=65535&u,y+=u>>>16,u=m&v^m&b^v&b,f+=65535&(c=k&C^k&I^C&I),p+=c>>>16,g+=65535&u,y+=u>>>16,p+=f>>>16,g+=p>>>16,y+=g>>>16,H=65535&g|y<<16,Y=65535&f|p<<16,u=U,f=65535&(c=W),p=c>>>16,g=65535&u,y=u>>>16,u=h,f+=65535&(c=d),p+=c>>>16,g+=65535&u,y+=u>>>16,p+=f>>>16,g+=p>>>16,y+=g>>>16,U=65535&g|y<<16,W=65535&f|p<<16,v=B,b=M,w=L,_=U,E=j,S=F,A=q,m=H,C=z,I=$,x=V,P=W,O=G,T=K,R=J,k=Y,N%16==15)for(var D=0;D<16;D++)u=e[D],f=65535&(c=t[D]),p=c>>>16,g=65535&u,y=u>>>16,u=e[(D+9)%16],f+=65535&(c=t[(D+9)%16]),p+=c>>>16,g+=65535&u,y+=u>>>16,u=((h=e[(D+1)%16])>>>1|(d=t[(D+1)%16])<<31)^(h>>>8|d<<24)^h>>>7,f+=65535&(c=(d>>>1|h<<31)^(d>>>8|h<<24)^(d>>>7|h<<25)),p+=c>>>16,g+=65535&u,y+=u>>>16,u=((h=e[(D+14)%16])>>>19|(d=t[(D+14)%16])<<13)^(d>>>29|h<<3)^h>>>6,f+=65535&(c=(d>>>19|h<<13)^(h>>>29|d<<3)^(d>>>6|h<<26)),p+=c>>>16,g+=65535&u,y+=u>>>16,p+=f>>>16,g+=p>>>16,y+=g>>>16,e[D]=65535&g|y<<16,t[D]=65535&f|p<<16}u=m,f=65535&(c=k),p=c>>>16,g=65535&u,y=u>>>16,u=r[0],f+=65535&(c=i[0]),p+=c>>>16,g+=65535&u,y+=u>>>16,p+=f>>>16,g+=p>>>16,y+=g>>>16,r[0]=m=65535&g|y<<16,i[0]=k=65535&f|p<<16,u=v,f=65535&(c=C),p=c>>>16,g=65535&u,y=u>>>16,u=r[1],f+=65535&(c=i[1]),p+=c>>>16,g+=65535&u,y+=u>>>16,p+=f>>>16,g+=p>>>16,y+=g>>>16,r[1]=v=65535&g|y<<16,i[1]=C=65535&f|p<<16,u=b,f=65535&(c=I),p=c>>>16,g=65535&u,y=u>>>16,u=r[2],f+=65535&(c=i[2]),p+=c>>>16,g+=65535&u,y+=u>>>16,p+=f>>>16,g+=p>>>16,y+=g>>>16,r[2]=b=65535&g|y<<16,i[2]=I=65535&f|p<<16,u=w,f=65535&(c=x),p=c>>>16,g=65535&u,y=u>>>16,u=r[3],f+=65535&(c=i[3]),p+=c>>>16,g+=65535&u,y+=u>>>16,p+=f>>>16,g+=p>>>16,y+=g>>>16,r[3]=w=65535&g|y<<16,i[3]=x=65535&f|p<<16,u=_,f=65535&(c=P),p=c>>>16,g=65535&u,y=u>>>16,u=r[4],f+=65535&(c=i[4]),p+=c>>>16,g+=65535&u,y+=u>>>16,p+=f>>>16,g+=p>>>16,y+=g>>>16,r[4]=_=65535&g|y<<16,i[4]=P=65535&f|p<<16,u=E,f=65535&(c=O),p=c>>>16,g=65535&u,y=u>>>16,u=r[5],f+=65535&(c=i[5]),p+=c>>>16,g+=65535&u,y+=u>>>16,p+=f>>>16,g+=p>>>16,y+=g>>>16,r[5]=E=65535&g|y<<16,i[5]=O=65535&f|p<<16,u=S,f=65535&(c=T),p=c>>>16,g=65535&u,y=u>>>16,u=r[6],f+=65535&(c=i[6]),p+=c>>>16,g+=65535&u,y+=u>>>16,p+=f>>>16,g+=p>>>16,y+=g>>>16,r[6]=S=65535&g|y<<16,i[6]=T=65535&f|p<<16,u=A,f=65535&(c=R),p=c>>>16,g=65535&u,y=u>>>16,u=r[7],f+=65535&(c=i[7]),p+=c>>>16,g+=65535&u,y+=u>>>16,p+=f>>>16,g+=p>>>16,y+=g>>>16,r[7]=A=65535&g|y<<16,i[7]=R=65535&f|p<<16,a+=128,l-=128}return a}t.hash=function(e){var t=new s;t.update(e);var r=t.digest();return t.clean(),r}},32583:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wipe=function(e){for(var t=0;t<e.length;t++)e[t]=0;return e}},89414:function(e,t,r){"use strict";t.gi=t.Au=t.KS=t.kz=void 0;let n=r(24861),i=r(32583);function s(e){let t=new Float64Array(16);if(e)for(let r=0;r<e.length;r++)t[r]=e[r];return t}t.kz=32,t.KS=32;let o=new Uint8Array(32);o[0]=9;let a=s([56129,1]);function l(e){let t=1;for(let r=0;r<16;r++){let n=e[r]+t+65535;t=Math.floor(n/65536),e[r]=n-65536*t}e[0]+=t-1+37*(t-1)}function u(e,t,r){let n=~(r-1);for(let r=0;r<16;r++){let i=n&(e[r]^t[r]);e[r]^=i,t[r]^=i}}function c(e,t,r){for(let n=0;n<16;n++)e[n]=t[n]+r[n]}function h(e,t,r){for(let n=0;n<16;n++)e[n]=t[n]-r[n]}function d(e,t,r){let n,i,s=0,o=0,a=0,l=0,u=0,c=0,h=0,d=0,f=0,p=0,g=0,y=0,m=0,v=0,b=0,w=0,_=0,E=0,S=0,A=0,k=0,C=0,I=0,x=0,P=0,O=0,T=0,R=0,N=0,D=0,B=0,M=r[0],L=r[1],U=r[2],j=r[3],F=r[4],q=r[5],H=r[6],z=r[7],$=r[8],
1V=r[9],W=r[10],G=r[11],K=r[12],J=r[13],Y=r[14],Q=r[15];s+=(n=t[0])*M,o+=n*L,a+=n*U,l+=n*j,u+=n*F,c+=n*q,h+=n*H,d+=n*z,f+=n*$,p+=n*V,g+=n*W,y+=n*G,m+=n*K,v+=n*J,b+=n*Y,w+=n*Q,o+=(n=t[1])*M,a+=n*L,l+=n*U,u+=n*j,c+=n*F,h+=n*q,d+=n*H,f+=n*z,p+=n*$,g+=n*V,y+=n*W,m+=n*G,v+=n*K,b+=n*J,w+=n*Y,_+=n*Q,a+=(n=t[2])*M,l+=n*L,u+=n*U,c+=n*j,h+=n*F,d+=n*q,f+=n*H,p+=n*z,g+=n*$,y+=n*V,m+=n*W,v+=n*G,b+=n*K,w+=n*J,_+=n*Y,E+=n*Q,l+=(n=t[3])*M,u+=n*L,c+=n*U,h+=n*j,d+=n*F,f+=n*q,p+=n*H,g+=n*z,y+=n*$,m+=n*V,v+=n*W,b+=n*G,w+=n*K,_+=n*J,E+=n*Y,S+=n*Q,u+=(n=t[4])*M,c+=n*L,h+=n*U,d+=n*j,f+=n*F,p+=n*q,g+=n*H,y+=n*z,m+=n*$,v+=n*V,b+=n*W,w+=n*G,_+=n*K,E+=n*J,S+=n*Y,A+=n*Q,c+=(n=t[5])*M,h+=n*L,d+=n*U,f+=n*j,p+=n*F,g+=n*q,y+=n*H,m+=n*z,v+=n*$,b+=n*V,w+=n*W,_+=n*G,E+=n*K,S+=n*J,A+=n*Y,k+=n*Q,h+=(n=t[6])*M,d+=n*L,f+=n*U,p+=n*j,g+=n*F,y+=n*q,m+=n*H,v+=n*z,b+=n*$,w+=n*V,_+=n*W,E+=n*G,S+=n*K,A+=n*J,k+=n*Y,C+=n*Q,d+=(n=t[7])*M,f+=n*L,p+=n*U,g+=n*j,y+=n*F,m+=n*q,v+=n*H,b+=n*z,w+=n*$,_+=n*V,E+=n*W,S+=n*G,A+=n*K,k+=n*J,C+=n*Y,I+=n*Q,f+=(n=t[8])*M,p+=n*L,g+=n*U,y+=n*j,m+=n*F,v+=n*q,b+=n*H,w+=n*z,_+=n*$,E+=n*V,S+=n*W,A+=n*G,k+=n*K,C+=n*J,I+=n*Y,x+=n*Q,p+=(n=t[9])*M,g+=n*L,y+=n*U,m+=n*j,v+=n*F,b+=n*q,w+=n*H,_+=n*z,E+=n*$,S+=n*V,A+=n*W,k+=n*G,C+=n*K,I+=n*J,x+=n*Y,P+=n*Q,g+=(n=t[10])*M,y+=n*L,m+=n*U,v+=n*j,b+=n*F,w+=n*q,_+=n*H,E+=n*z,S+=n*$,A+=n*V,k+=n*W,C+=n*G,I+=n*K,x+=n*J,P+=n*Y,O+=n*Q,y+=(n=t[11])*M,m+=n*L,v+=n*U,b+=n*j,w+=n*F,_+=n*q,E+=n*H,S+=n*z,A+=n*$,k+=n*V,C+=n*W,I+=n*G,x+=n*K,P+=n*J,O+=n*Y,T+=n*Q,m+=(n=t[12])*M,v+=n*L,b+=n*U,w+=n*j,_+=n*F,E+=n*q,S+=n*H,A+=n*z,k+=n*$,C+=n*V,I+=n*W,x+=n*G,P+=n*K,O+=n*J,T+=n*Y,R+=n*Q,v+=(n=t[13])*M,b+=n*L,w+=n*U,_+=n*j,E+=n*F,S+=n*q,A+=n*H,k+=n*z,C+=n*$,I+=n*V,x+=n*W,P+=n*G,O+=n*K,T+=n*J,R+=n*Y,N+=n*Q,b+=(n=t[14])*M,w+=n*L,_+=n*U,E+=n*j,S+=n*F,A+=n*q,k+=n*H,C+=n*z,I+=n*$,x+=n*V,P+=n*W,O+=n*G,T+=n*K,R+=n*J,N+=n*Y,D+=n*Q,w+=(n=t[15])*M,_+=n*L,E+=n*U,S+=n*j,A+=n*F,k+=n*q,C+=n*H,I+=n*z,x+=n*$,P+=n*V,O+=n*W,T+=n*G,R+=n*K,N+=n*J,D+=n*Y,B+=n*Q,s+=38*_,o+=38*E,a+=38*S,l+=38*A,u+=38*k,c+=38*C,h+=38*I,d+=38*x,f+=38*P,p+=38*O,g+=38*T,y+=38*R,m+=38*N,v+=38*D,b+=38*B,i=Math.floor((n=s+(i=1)+65535)/65536),s=n-65536*i,i=Math.floor((n=o+i+65535)/65536),o=n-65536*i,i=Math.floor((n=a+i+65535)/65536),a=n-65536*i,i=Math.floor((n=l+i+65535)/65536),l=n-65536*i,i=Math.floor((n=u+i+65535)/65536),u=n-65536*i,i=Math.floor((n=c+i+65535)/65536),c=n-65536*i,i=Math.floor((n=h+i+65535)/65536),h=n-65536*i,i=Math.floor((n=d+i+65535)/65536),d=n-65536*i,i=Math.floor((n=f+i+65535)/65536),f=n-65536*i,i=Math.floor((n=p+i+65535)/65536),p=n-65536*i,i=Math.floor((n=g+i+65535)/65536),g=n-65536*i,i=Math.floor((n=y+i+65535)/65536),y=n-65536*i,i=Math.floor((n=m+i+65535)/65536),m=n-65536*i,i=Math.floor((n=v+i+65535)/65536),v=n-65536*i,i=Math.floor((n=b+i+65535)/65536),b=n-65536*i,i=Math.floor((n=w+i+65535)/65536),w=n-65536*i,s+=i-1+37*(i-1),i=Math.floor((n=s+(i=1)+65535)/65536),s=n-65536*i,i=Math.floor((n=o+i+65535)/65536),o=n-65536*i,i=Math.floor((n=a+i+65535)/65536),a=n-65536*i,i=Math.floor((n=l+i+65535)/65536),l=n-65536*i,i=Math.floor((n=u+i+65535)/65536),u=n-65536*i,i=Math.floor((n=c+i+65535)/65536),c=n-65536*i,i=Math.floor((n=h+i+65535)/65536),h=n-65536*i,i=Math.floor((n=d+i+65535)/65536),d=n-65536*i,i=Math.floor((n=f+i+65535)/65536),f=n-65536*i,i=Math.floor((n=p+i+65535)/65536),p=n-65536*i,i=Math.floor((n=g+i+65535)/65536),g=n-65536*i,i=Math.floor((n=y+i+65535)/65536),y=n-65536*i,i=Math.floor((n=m+i+65535)/65536),m=n-65536*i,i=Math.floor((n=v+i+65535)/65536),v=n-65536*i,i=Math.floor((n=b+i+65535)/65536),b=n-65536*i,i=Math.floor((n=w+i+65535)/65536),w=n-65536*i,s+=i-1+37*(i-1),e[0]=s,e[1]=o,e[2]=a,e[3]=l,e[4]=u,e[5]=c,e[6]=h,e[7]=d,e[8]=f,e[9]=p,e[10]=g,e[11]=y,e[12]=m,e[13]=v,e[14]=b,e[15]=w}function f(e,t){let r=new Uint8Array(32),n=new Float64Array(80),i=s(),o=s(),f=s(),p=s(),g=s(),y=s();for(let t=0;t<31;t++)r[t]=e[t];r[31]=127&e[31]|64,r[0]&=248,function(e,t){for(let r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}(n,t);for(let e=0;e<16;e++)o[e]=n[e];i[0]=p[0]=1;for(let e=254;e>=0;--e){let t=r[e>>>3]>>>(7&e)&1;u(i,o,t),u(f,p,t),c(g,i,f),h(i,i,f),c(f,o,p),h(o,o,p),d(p,g,g),d(y,i,i),d(i,f,i),d(f,o,g),c(g,i,f),h(i,i,f),d(o,i,i),h(f,p,y),d(i,f,a),c(i,i,p),d(f,f,i),d(i,p,y),d(p,o,n),d(o,g,g),u(i,o,t),u(f,p,t)}for(let e=0;e<16;e++)n[e+16]=i[e],n[e+32]=f[e],n[e+48]=o[e],n[e+64]=p[e];let m=n.subarray(32),v=n.subarray(16);!function(e,t){let r=s();for(let e=0;e<16;e++)r[e]=t[e];for(let e=253;e>=0;e--)d(r,r,r),2!==e&&4!==e&&d(r,r,t);for(let t=0;t<16;t++)e[t]=r[t]}(m,m),d(v,v,m);let b=new Uint8Array(32);return!function(e,t){let r=s(),n=s();for(let e=0;e<16;e++)n[e]=t[e];l(n),l(n),l(n);for(let e=0;e<2;e++){r[0]=n[0]-65517;for(let e=1;e<15;e++)r[e]=n[e]-65535-(r[e-1]>>16&1),r[e-1]&=65535;r[15]=n[15]-32767-(r[14]>>16&1);let e=r[15]>>16&1;r[14]&=65535,u(n,r,1-e)}for(let t=0;t<16;t++)e[2*t]=255&n[t],e[2*t+1]=n[t]>>8}(b,v),b}t.Au=function(e){let r=(0,n.randomBytes)(32,e),s=function(e){if(e.length!==t.KS)throw Error(`x25519: seed must be ${t.KS} bytes`);let r=new Uint8Array(e);return{publicKey:f(r,o),secretKey:r}}(r);return(0,i.wipe)(r),s},t.gi=function(e,r,n=!1){if(e.length!==t.kz)throw Error("X25519: incorrect secret key length");if(r.length!==t.kz)throw Error("X25519: incorrect public key length");let i=f(e,r);if(n){let e=0;for(let t=0;t<i.length;t++)e|=i[t];if(0===e)throw Error("X25519: invalid shared key")}return i}},43872:function(e){"use strict";var t=Object.prototype.hasOwnProperty,r="~";function n(){}function i(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function s(e,t,n,s,o){if("function"!=typeof n)throw TypeError("The listener must be a function");var a=new i(n,s||e,o),l=r?r+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],a]:e._events[l].push(a):(e._events[l]=a,e._eventsCount++),e}function o(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1)),a.prototype.eventNames=function(){var e,n,i=[];if(0===this._eventsCount)return i;for(n in e=this._events)t.call(e,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},a.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,s=n.length,o=Array(s);i<s;i++)o[i]=n[i].fn;return o},a.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},a.prototype.emit=function(e,t,n,i,s,o){var a=r?r+e:e;if(!this._events[a])return!1;var l,u,c=this._events[a],h=arguments.length;
1if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),h){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,s),!0;case 6:return c.fn.call(c.context,t,n,i,s,o),!0}for(u=1,l=Array(h-1);u<h;u++)l[u-1]=arguments[u];c.fn.apply(c.context,l)}else{var d,f=c.length;for(u=0;u<f;u++)switch(c[u].once&&this.removeListener(e,c[u].fn,void 0,!0),h){case 1:c[u].fn.call(c[u].context);break;case 2:c[u].fn.call(c[u].context,t);break;case 3:c[u].fn.call(c[u].context,t,n);break;case 4:c[u].fn.call(c[u].context,t,n,i);break;default:if(!l)for(d=1,l=Array(h-1);d<h;d++)l[d-1]=arguments[d];c[u].fn.apply(c[u].context,l)}}return!0},a.prototype.on=function(e,t,r){return s(this,e,t,r,!1)},a.prototype.once=function(e,t,r){return s(this,e,t,r,!0)},a.prototype.removeListener=function(e,t,n,i){var s=r?r+e:e;if(!this._events[s])return this;if(!t)return o(this,s),this;var a=this._events[s];if(a.fn)a.fn!==t||i&&!a.once||n&&a.context!==n||o(this,s);else{for(var l=0,u=[],c=a.length;l<c;l++)(a[l].fn!==t||i&&!a[l].once||n&&a[l].context!==n)&&u.push(a[l]);u.length?this._events[s]=1===u.length?u[0]:u:o(this,s)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&o(this,t)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=r,a.EventEmitter=a,e.exports=a},39016:function(e,t,r){"use strict";function n(){return(null===r.g||void 0===r.g?void 0:r.g.crypto)||(null===r.g||void 0===r.g?void 0:r.g.msCrypto)||{}}function i(){let e=n();return e.subtle||e.webkitSubtle}Object.defineProperty(t,"__esModule",{value:!0}),t.isBrowserCryptoAvailable=t.getSubtleCrypto=t.getBrowerCrypto=void 0,t.getBrowerCrypto=n,t.getSubtleCrypto=i,t.isBrowserCryptoAvailable=function(){return!!n()&&!!i()}},56010:function(e,t,r){"use strict";var n=r(20357);function i(){return"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product}function s(){return void 0!==n&&void 0!==n.versions&&void 0!==n.versions.node}Object.defineProperty(t,"__esModule",{value:!0}),t.isBrowser=t.isNode=t.isReactNative=void 0,t.isReactNative=i,t.isNode=s,t.isBrowser=function(){return!i()&&!s()}},60092:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(69637);n.__exportStar(r(39016),t),n.__exportStar(r(56010),t)},69637:function(e,t,r){"use strict";r.r(t),r.d(t,{__assign:function(){return s},__asyncDelegator:function(){return w},__asyncGenerator:function(){return b},__asyncValues:function(){return _},__await:function(){return v},__awaiter:function(){return c},__classPrivateFieldGet:function(){return k},__classPrivateFieldSet:function(){return C},__createBinding:function(){return d},__decorate:function(){return a},__exportStar:function(){return f},__extends:function(){return i},__generator:function(){return h},__importDefault:function(){return A},__importStar:function(){return S}
vendor: 5,093 bytes, lines 1-14
1,__makeTemplateObject:function(){return E},__metadata:function(){return u},__param:function(){return l},__read:function(){return g},__rest:function(){return o},__spread:function(){return y},__spreadArrays:function(){return m},__values:function(){return p}});/*! *****************************************************************************
2Copyright (c) Microsoft Corporation.
3
4Permission to use, copy, modify, and/or distribute this software for any
5purpose with or without fee is hereby granted.
6
7THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
10INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13PERFORMANCE OF THIS SOFTWARE.
14***************************************************************************** */var n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function i(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var s=function(){return(s=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function o(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)0>t.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function a(e,t,r,n){var i,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,r,o):i(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o}function l(e,t){return function(r,n){t(r,n,e)}}function u(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function c(e,t,r,n){return new(r||(r=Promise))(function(i,s){function o(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})}function h(e,t){var r,n,i,s,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(r)throw TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,n=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===s[0]||2===s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}}function d(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}function f(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||(t[r]=e[r])}function p(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function g(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return o}function y(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(g(arguments[t]));return e}function m(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),i=0,t=0;t<r;t++)for(var s=arguments[t],o=0,a=s.length;o<a;o++,i++)n[i]=s[o];return n}function v(e){return this instanceof v?(this.v=e,this):new v(e)}function b(e,t,r){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var n,i=r.apply(e,t||[]),s=[];return n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n;function o(e){i[e]&&(n[e]=function(t){return new Promise(function(r,n){
14s.push([e,t,r,n])>1||a(e,t)})})}function a(e,t){try{var r;(r=i[e](t)).value instanceof v?Promise.resolve(r.value.v).then(l,u):c(s[0][2],r)}catch(e){c(s[0][3],e)}}function l(e){a("next",e)}function u(e){a("throw",e)}function c(e,t){e(t),s.shift(),s.length&&a(s[0][0],s[0][1])}}function w(e){var t,r;return t={},n("next"),n("throw",function(e){throw e}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,i){t[n]=e[n]?function(t){return(r=!r)?{value:v(e[n](t)),done:"return"===n}:i?i(t):t}:i}}function _(e){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=p(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise(function(n,i){!function(e,t,r,n){Promise.resolve(n).then(function(t){e({value:t,done:r})},t)}(n,i,(t=e[r](t)).done,t.value)})}}}function E(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function S(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function A(e){return e&&e.__esModule?e:{default:e}}function k(e,t){if(!t.has(e))throw TypeError("attempted to get private field on non-instance");return t.get(e)}function C(e,t,r){if(!t.has(e))throw TypeError("attempted to set private field on non-instance");return t.set(e,r),r}},74556:function(e,t){"use strict";function r(e){let t;return"undefined"!=typeof window&&void 0!==window[e]&&(t=window[e]),t}function n(e){let t=r(e);if(!t)throw Error(`${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=r,t.getFromWindowOrThrow=n,t.getDocumentOrThrow=function(){return n("document")},t.getDocument=function(){return r("document")},t.getNavigatorOrThrow=function(){return n("navigator")},t.getNavigator=function(){return r("navigator")},t.getLocationOrThrow=function(){return n("location")},t.getLocation=function(){return r("location")},t.getCryptoOrThrow=function(){return n("crypto")},t.getCrypto=function(){return r("crypto")},t.getLocalStorageOrThrow=function(){return n("localStorage")},t.getLocalStorage=function(){return r("localStorage")}},81521:function(e,t,r){"use strict";r(74556)},94762:function(e,t,r){"use strict";let n=r(29276),i=r(56368),s=r(76442),o=r(24816),a=e=>null==e,l=Symbol("encodeFragmentIdentifier");function u(e){if("string"!=typeof e||1!==e.length)throw TypeError("arrayFormatSeparator must be single character string")}function c(e,t){return t.encode?t.strict?n(e):encodeURIComponent(e):e}function h(e,t){return t.decode?i(e):e}function d(e){let t=e.indexOf("#");return -1!==t&&(e=e.slice(0,t)),e}function f(e){let t=(e=d(e)).indexOf("?");return -1===t?"":e.slice(t+1)}function p(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){u((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);let r=function(e){let t;switch(e.arrayFormat){case"index":return(e,r,n)=>{if(t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),!t){n[e]=r;return}void 0===n[e]&&(n[e]={}),n[e][t[1]]=r};case"bracket":return(e,r,n)=>{if(t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),!t){n[e]=r;return}if(void 0===n[e]){n[e]=[r];return}n[e]=[].concat(n[e],r)};case"colon-list-separator":return(e,r,n)=>{if(t=/(:list)$/.exec(e),e=e.replace(/:list$/,""),!t){n[e]=r;return}if(void 0===n[e]){n[e]=[r];return}n[e]=[].concat(n[e],r)};case"comma":case"separator":return(t,r,n)=>{let i="string"==typeof r&&r.includes(e.arrayFormatSeparator),s="string"==typeof r&&!i&&h(r,e).includes(e.arrayFormatSeparator);r=s?h(r,e):r;let o=i||s?r.split(e.arrayFormatSeparator).map(t=>h(t,e)):null===r?r:h(r,e);n[t]=o};case"bracket-separator":return(t,r,n)=>{let i=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),!i){n[t]=r?h(r,e):r;return}let s=null===r?[]:r.split(e.arrayFormatSeparator).map(t=>h(t,e));if(void 0===n[t]){n[t]=s;return}n[t]=[].concat(n[t],s)};default:return(e,t,r)=>{if(void 0===r[e]){r[e]=t;return}r[e]=[].concat(r[e],t)}}}(t),n=Object.create(null);if("string"!=typeof e||!(e=e.trim().replace(/^[?#&]/,"")))return n;for(let i of e.split("&")){if(""===i)continue;let[e,o]=s(t.decode?i.replace(/\+/g," "):i,"=");o=void 0===o?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?o:h(o,t),r(h(e,t),o,n)}for(let e of Object.keys(n)){let r=n[e];if("object"==typeof r&&null!==r)for(let e of Object.keys(r))r[e]=p(r[e],t);else n[e]=p(r,t)}return!1===t.sort?n:(!0===t.sort?Object.keys(n).sort():Object.keys(n).sort(t.sort)).reduce((e,t)=>
14{let r=n[t];return r&&"object"==typeof r&&!Array.isArray(r)?e[t]=function e(t){return Array.isArray(t)?t.sort():"object"==typeof t?e(Object.keys(t)).sort((e,t)=>Number(e)-Number(t)).map(e=>t[e]):t}(r):e[t]=r,e},Object.create(null))}t.extract=f,t.parse=g,t.stringify=(e,t)=>{if(!e)return"";u((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);let r=r=>t.skipNull&&a(e[r])||t.skipEmptyString&&""===e[r],n=function(e){switch(e.arrayFormat){case"index":return t=>(r,n)=>{let i=r.length;return void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[c(t,e),"[",i,"]"].join("")]:[...r,[c(t,e),"[",c(i,e),"]=",c(n,e)].join("")]};case"bracket":return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[c(t,e),"[]"].join("")]:[...r,[c(t,e),"[]=",c(n,e)].join("")];case"colon-list-separator":return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[c(t,e),":list="].join("")]:[...r,[c(t,e),":list=",c(n,e)].join("")];case"comma":case"separator":case"bracket-separator":{let t="bracket-separator"===e.arrayFormat?"[]=":"=";return r=>(n,i)=>void 0===i||e.skipNull&&null===i||e.skipEmptyString&&""===i?n:(i=null===i?"":i,0===n.length)?[[c(r,e),t,c(i,e)].join("")]:[[n,c(i,e)].join(e.arrayFormatSeparator)]}default:return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,c(t,e)]:[...r,[c(t,e),"=",c(n,e)].join("")]}}(t),i={};for(let t of Object.keys(e))r(t)||(i[t]=e[t]);let s=Object.keys(i);return!1!==t.sort&&s.sort(t.sort),s.map(r=>{let i=e[r];return void 0===i?"":null===i?c(r,t):Array.isArray(i)?0===i.length&&"bracket-separator"===t.arrayFormat?c(r,t)+"[]":i.reduce(n(r),[]).join("&"):c(r,t)+"="+c(i,t)}).filter(e=>e.length>0).join("&")},t.parseUrl=(e,t)=>
14{t=Object.assign({decode:!0},t);let[r,n]=s(e,"#");return Object.assign({url:r.split("?")[0]||"",query:g(f(e),t)},t&&t.parseFragmentIdentifier&&n?{fragmentIdentifier:h(n,t)}:{})},t.stringifyUrl=(e,r)=>{r=Object.assign({encode:!0,strict:!0,[l]:!0},r);let n=d(e.url).split("?")[0]||"",i=t.extract(e.url),s=Object.assign(t.parse(i,{sort:!1}),e.query),o=t.stringify(s,r);o&&(o=`?${o}`);let a=function(e){let t="",r=e.indexOf("#");return -1!==r&&(t=e.slice(r)),t}(e.url);return e.fragmentIdentifier&&(a=`#${r[l]?c(e.fragmentIdentifier,r):e.fragmentIdentifier}`),`${n}${o}${a}`},t.pick=(e,r,n)=>{n=Object.assign({parseFragmentIdentifier:!0,[l]:!1},n);let{url:i,query:s,fragmentIdentifier:a}=t.parseUrl(e,n);return t.stringifyUrl({url:i,query:o(s,r),fragmentIdentifier:a},n)},t.exclude=(e,r,n)=>{let i=Array.isArray(r)?e=>!r.includes(e):(e,t)=>!r(e,t);return t.pick(e,i,n)}},5942:function(e,t,r){"use strict";r.d(t,{q:function(){return n}});class n{}},44561:function(e,t,r){"use strict";r.r(t),r.d(t,{IEvents:function(){return n.q}});var n=r(5942)},946:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HEARTBEAT_EVENTS=t.HEARTBEAT_INTERVAL=void 0;let n=r(54574);t.HEARTBEAT_INTERVAL=n.FIVE_SECONDS,t.HEARTBEAT_EVENTS={pulse:"heartbeat_pulse"}},42294:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r(22086).__exportStar(r(946),t)},36172:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HeartBeat=void 0;let n=r(22086),i=r(68885),s=r(54574),o=r(89802),a=r(42294);class l extends o.IHeartBeat{constructor(e){super(e),this.events=new i.EventEmitter,this.interval=a.HEARTBEAT_INTERVAL,this.interval=(null==e?void 0:e.interval)||a.HEARTBEAT_INTERVAL}static init(e){return n.__awaiter(this,void 0,void 0,function*(){let t=new l(e);return yield t.init(),t})}init(){return n.__awaiter(this,void 0,void 0,function*(){yield this.initialize()})}stop(){clearInterval(this.intervalRef)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}initialize(){return n.__awaiter(this,void 0,void 0,function*(){this.intervalRef=setInterval(()=>this.pulse(),s.toMiliseconds(this.interval))})}pulse(){this.events.emit(a.HEARTBEAT_EVENTS.pulse)}}t.HeartBeat=l},83515:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(22086);n.__exportStar(r(36172),t),n.__exportStar(r(89802),t),n.__exportStar(r(42294),t)},99677:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IHeartBeat=void 0;let n=r(44561);class i extends n.IEvents{constructor(e){super()}}t.IHeartBeat=i},89802:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r(22086).__exportStar(r(99677),t)},22086:function(e,t,r){"use strict";r.r(t),r.d(t,{__assign:function(){return s},__asyncDelegator:function(){return w},__asyncGenerator:function(){return b},__asyncValues:function(){return _},__await:function(){return v},__awaiter:function(){return c},__classPrivateFieldGet:function(){return k},__classPrivateFieldSet:function(){return C},__createBinding:function(){return d},__decorate:function(){return a},__exportStar:function(){return f},__extends:function(){return i},__generator:function(){return h},__importDefault:function(){return A},__importStar:function(){return S}
vendor: 5,093 bytes, lines 14-27
14,__makeTemplateObject:function(){return E},__metadata:function(){return u},__param:function(){return l},__read:function(){return g},__rest:function(){return o},__spread:function(){return y},__spreadArrays:function(){return m},__values:function(){return p}});/*! *****************************************************************************
15Copyright (c) Microsoft Corporation.
16
17Permission to use, copy, modify, and/or distribute this software for any
18purpose with or without fee is hereby granted.
19
20THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
21REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
22AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
23INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
24LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
25OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
26PERFORMANCE OF THIS SOFTWARE.
27***************************************************************************** */var n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function i(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var s=function(){return(s=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function o(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)0>t.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function a(e,t,r,n){var i,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,r,o):i(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o}function l(e,t){return function(r,n){t(r,n,e)}}function u(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function c(e,t,r,n){return new(r||(r=Promise))(function(i,s){function o(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})}function h(e,t){var r,n,i,s,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(r)throw TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,n=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===s[0]||2===s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}}function d(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}function f(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||(t[r]=e[r])}function p(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function g(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return o}function y(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(g(arguments[t]));return e}function m(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),i=0,t=0;t<r;t++)for(var s=arguments[t],o=0,a=s.length;o<a;o++,i++)n[i]=s[o];return n}function v(e){return this instanceof v?(this.v=e,this):new v(e)}function b(e,t,r){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var n,i=r.apply(e,t||[]),s=[];return n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n;function o(e){i[e]&&(n[e]=function(t){return new Promise(function(r,n){
27s.push([e,t,r,n])>1||a(e,t)})})}function a(e,t){try{var r;(r=i[e](t)).value instanceof v?Promise.resolve(r.value.v).then(l,u):c(s[0][2],r)}catch(e){c(s[0][3],e)}}function l(e){a("next",e)}function u(e){a("throw",e)}function c(e,t){e(t),s.shift(),s.length&&a(s[0][0],s[0][1])}}function w(e){var t,r;return t={},n("next"),n("throw",function(e){throw e}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,i){t[n]=e[n]?function(t){return(r=!r)?{value:v(e[n](t)),done:"return"===n}:i?i(t):t}:i}}function _(e){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=p(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise(function(n,i){!function(e,t,r,n){Promise.resolve(n).then(function(t){e({value:t,done:r})},t)}(n,i,(t=e[r](t)).done,t.value)})}}}function E(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function S(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function A(e){return e&&e.__esModule?e:{default:e}}function k(e,t){if(!t.has(e))throw TypeError("attempted to get private field on non-instance");return t.get(e)}function C(e,t,r){if(!t.has(e))throw TypeError("attempted to set private field on non-instance");return t.set(e,r),r}},77726:function(){},2572:function(e,t){"use strict";function r(e){let t;return"undefined"!=typeof window&&void 0!==window[e]&&(t=window[e]),t}function n(e){let t=r(e);if(!t)throw Error(`${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=r,t.getFromWindowOrThrow=n,t.getDocumentOrThrow=function(){return n("document")},t.getDocument=function(){return r("document")},t.getNavigatorOrThrow=function(){return n("navigator")},t.getNavigator=function(){return r("navigator")},t.getLocationOrThrow=function(){return n("location")},t.getLocation=function(){return r("location")},t.getCryptoOrThrow=function(){return n("crypto")},t.getCrypto=function(){return r("crypto")},t.getLocalStorageOrThrow=function(){return n("localStorage")},t.getLocalStorage=function(){return r("localStorage")}},99266:function(e,t,r){"use strict";t.D=void 0;let n=r(2572);t.D=function(){let e,t,r;try{e=n.getDocumentOrThrow(),t=n.getLocationOrThrow()}catch(e){return null}function i(...t){let r=e.getElementsByTagName("meta");for(let e=0;e<r.length;e++){let n=r[e],i=["itemprop","property","name"].map(e=>n.getAttribute(e)).filter(e=>!!e&&t.includes(e));if(i.length&&i){let e=n.getAttribute("content");if(e)return e}}return""}let s=((r=i("name","og:site_name","og:title","twitter:title"))||(r=e.title),r),o=i("description","og:description","twitter:description","keywords");return{description:o,url:t.origin,icons:function(){let r=e.getElementsByTagName("link"),n=[];for(let e=0;e<r.length;e++){let i=r[e],s=i.getAttribute("rel");if(s&&s.toLowerCase().indexOf("icon")>-1){let e=i.getAttribute("href");if(e){if(-1===e.toLowerCase().indexOf("https:")&&-1===e.toLowerCase().indexOf("http:")&&0!==e.indexOf("//")){let r=t.protocol+"//"+t.host;if(0===e.indexOf("/"))r+=e;else{let n=t.pathname.split("/");n.pop(),r+=n.join("/")+"/"+e}n.push(r)}else if(0===e.indexOf("//")){let r=t.protocol+e;n.push(r)}else n.push(e)}}}return n}(),name:s}}},53491:function(e,t,r){"use strict";let n=r(29276),i=r(56368),s=r(76442),o=r(24816),a=e=>null==e,l=Symbol("encodeFragmentIdentifier");function u(e){if("string"!=typeof e||1!==e.length)throw TypeError("arrayFormatSeparator must be single character string")}function c(e,t){return t.encode?t.strict?n(e):encodeURIComponent(e):e}function h(e,t){return t.decode?i(e):e}function d(e){let t=e.indexOf("#");return -1!==t&&(e=e.slice(0,t)),e}function f(e){let t=(e=d(e)).indexOf("?");return -1===t?"":e.slice(t+1)}function p(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){u((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);let r=function(e){let t;switch(e.arrayFormat){case"index":return(e,r,n)=>{if(t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),!t){n[e]=r;return}void 0===n[e]&&(n[e]={}),n[e][t[1]]=r};case"bracket":return(e,r,n)=>{if(t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),!t){n[e]=r;return}if(void 0===n[e]){n[e]=[r];return}n[e]=[].concat(n[e],r)};case"colon-list-separator":return(e,r,n)=>{if(t=/(:list)$/.exec(e),e=e.replace(/:list$/,""),!t){n[e]=r;return}if(void 0===n[e]){n[e]=[r];return}n[e]=[].concat(n[e],r)};case"comma":case"separator":return(t,r,n)=>{let i="string"==typeof r&&r.includes(e.arrayFormatSeparator),s="string"==typeof r&&!i&&h(r,e).includes(e.arrayFormatSeparator);r=s?h(r,e):r;let o=i||s?r.split(e.arrayFormatSeparator).map(t=>h(t,e)):null===r?r:h(r,e);n[t]=o};case"bracket-separator":return(t,r,n)=>{let i=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),!i){n[t]=r?h(r,e):r;return}let s=null===r?[]:r.split(e.arrayFormatSeparator).map(t=>h(t,e));if(void 0===n[t]){n[t]=s;return}n[t]=[].concat(n[t],s)};default:return(e,t,r)=>{if(void 0===r[e]){r[e]=t;return}r[e]=[].concat(r[e],t)}}}(t),n=Object.create(null);if("string"!=typeof e||!(e=e.trim().replace(/^[?#&]/,"")))return n;for(let i of e.split("&")){if(""===i)continue;let[e,o]=s(t.decode?i.replace(/\+/g," "):i,"=");o=void 0===o?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?o:h(o,t),r(h(e,t),o,n)}for(let e of Object.keys(n)){let r=n[e];if("object"==typeof r&&null!==r)for(let e of Object.keys(r))r[e]=p(r[e],t);else n[e]=p(r,t)}return!1===t.sort?n:(!0===t.sort?Object.keys(n).sort():Object.keys(n).sort(t.sort)).reduce((e,t)=>
27{let r=n[t];return r&&"object"==typeof r&&!Array.isArray(r)?e[t]=function e(t){return Array.isArray(t)?t.sort():"object"==typeof t?e(Object.keys(t)).sort((e,t)=>Number(e)-Number(t)).map(e=>t[e]):t}(r):e[t]=r,e},Object.create(null))}t.extract=f,t.parse=g,t.stringify=(e,t)=>{if(!e)return"";u((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);let r=r=>t.skipNull&&a(e[r])||t.skipEmptyString&&""===e[r],n=function(e){switch(e.arrayFormat){case"index":return t=>(r,n)=>{let i=r.length;return void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[c(t,e),"[",i,"]"].join("")]:[...r,[c(t,e),"[",c(i,e),"]=",c(n,e)].join("")]};case"bracket":return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[c(t,e),"[]"].join("")]:[...r,[c(t,e),"[]=",c(n,e)].join("")];case"colon-list-separator":return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[c(t,e),":list="].join("")]:[...r,[c(t,e),":list=",c(n,e)].join("")];case"comma":case"separator":case"bracket-separator":{let t="bracket-separator"===e.arrayFormat?"[]=":"=";return r=>(n,i)=>void 0===i||e.skipNull&&null===i||e.skipEmptyString&&""===i?n:(i=null===i?"":i,0===n.length)?[[c(r,e),t,c(i,e)].join("")]:[[n,c(i,e)].join(e.arrayFormatSeparator)]}default:return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,c(t,e)]:[...r,[c(t,e),"=",c(n,e)].join("")]}}(t),i={};for(let t of Object.keys(e))r(t)||(i[t]=e[t]);let s=Object.keys(i);return!1!==t.sort&&s.sort(t.sort),s.map(r=>{let i=e[r];return void 0===i?"":null===i?c(r,t):Array.isArray(i)?0===i.length&&"bracket-separator"===t.arrayFormat?c(r,t)+"[]":i.reduce(n(r),[]).join("&"):c(r,t)+"="+c(i,t)}).filter(e=>e.length>0).join("&")},t.parseUrl=(e,t)=>
27{t=Object.assign({decode:!0},t);let[r,n]=s(e,"#");return Object.assign({url:r.split("?")[0]||"",query:g(f(e),t)},t&&t.parseFragmentIdentifier&&n?{fragmentIdentifier:h(n,t)}:{})},t.stringifyUrl=(e,r)=>{r=Object.assign({encode:!0,strict:!0,[l]:!0},r);let n=d(e.url).split("?")[0]||"",i=t.extract(e.url),s=Object.assign(t.parse(i,{sort:!1}),e.query),o=t.stringify(s,r);o&&(o=`?${o}`);let a=function(e){let t="",r=e.indexOf("#");return -1!==r&&(t=e.slice(r)),t}(e.url);return e.fragmentIdentifier&&(a=`#${r[l]?c(e.fragmentIdentifier,r):e.fragmentIdentifier}`),`${n}${o}${a}`},t.pick=(e,r,n)=>{n=Object.assign({parseFragmentIdentifier:!0,[l]:!1},n);let{url:i,query:s,fragmentIdentifier:a}=t.parseUrl(e,n);return t.stringifyUrl({url:i,query:o(s,r),fragmentIdentifier:a},n)},t.exclude=(e,r,n)=>{let i=Array.isArray(r)?e=>!r.includes(e):(e,t)=>!r(e,t);return t.pick(e,i,n)}},71851:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(24011);n.__exportStar(r(47036),t),n.__exportStar(r(62703),t)},47036: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},62703: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},54574:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(24011);n.__exportStar(r(91268),t),n.__exportStar(r(32674),t),n.__exportStar(r(79165),t),n.__exportStar(r(71851),t)},79165:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r(24011).__exportStar(r(34760),t)},34760:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IWatch=void 0;class r{}t.IWatch=r},25115:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromMiliseconds=t.toMiliseconds=void 0;let n=r(71851);t.toMiliseconds=function(e){return e*n.ONE_THOUSAND},t.fromMiliseconds=function(e){return Math.floor(e/n.ONE_THOUSAND)}},23396:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.delay=void 0,t.delay=function(e){return new Promise(t=>{setTimeout(()=>{t(!0)},e)})}},91268:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(24011);n.__exportStar(r(23396),t),n.__exportStar(r(25115),t)},32674:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Watch=void 0;class r{constructor(){this.timestamps=new Map}start(e){if(this.timestamps.has(e))throw Error(`Watch already started for label: ${e}`);this.timestamps.set(e,{started:Date.now()})}stop(e){let t=this.get(e);if(void 0!==t.elapsed)throw Error(`Watch already stopped for label: ${e}`);let r=Date.now()-t.started;this.timestamps.set(e,{started:t.started,elapsed:r})}get(e){let t=this.timestamps.get(e);if(void 0===t)throw Error(`No timestamp found for label: ${e}`);return t}elapsed(e){let t=this.get(e);return t.elapsed||Date.now()-t.started}}t.Watch=r,t.default=r},24011:function(e,t,r){"use strict";r.r(t),r.d(t,{__assign:function(){return s},__asyncDelegator:function(){return w},__asyncGenerator:function(){return b},__asyncValues:function(){return _},__await:function(){return v},__awaiter:function(){return c},__classPrivateFieldGet:function(){return k},__classPrivateFieldSet:function(){return C},__createBinding:function(){return d},__decorate:function(){return a},__exportStar:function(){return f},__extends:function(){return i},__generator:function(){return h},__importDefault:function(){return A},__importStar:function(){return S}
vendor: 5,093 bytes, lines 27-40
27,__makeTemplateObject:function(){return E},__metadata:function(){return u},__param:function(){return l},__read:function(){return g},__rest:function(){return o},__spread:function(){return y},__spreadArrays:function(){return m},__values:function(){return p}});/*! *****************************************************************************
28Copyright (c) Microsoft Corporation.
29
30Permission to use, copy, modify, and/or distribute this software for any
31purpose with or without fee is hereby granted.
32
33THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
34REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
35AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
36INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
37LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
38OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
39PERFORMANCE OF THIS SOFTWARE.
40***************************************************************************** */var n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function i(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var s=function(){return(s=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function o(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)0>t.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function a(e,t,r,n){var i,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,r,o):i(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o}function l(e,t){return function(r,n){t(r,n,e)}}function u(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function c(e,t,r,n){return new(r||(r=Promise))(function(i,s){function o(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})}function h(e,t){var r,n,i,s,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(r)throw TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,n=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===s[0]||2===s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}}function d(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}function f(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||(t[r]=e[r])}function p(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function g(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return o}function y(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(g(arguments[t]));return e}function m(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),i=0,t=0;t<r;t++)for(var s=arguments[t],o=0,a=s.length;o<a;o++,i++)n[i]=s[o];return n}function v(e){return this instanceof v?(this.v=e,this):new v(e)}function b(e,t,r){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var n,i=r.apply(e,t||[]),s=[];return n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n;function o(e){i[e]&&(n[e]=function(t){return new Promise(function(r,n){
40s.push([e,t,r,n])>1||a(e,t)})})}function a(e,t){try{var r;(r=i[e](t)).value instanceof v?Promise.resolve(r.value.v).then(l,u):c(s[0][2],r)}catch(e){c(s[0][3],e)}}function l(e){a("next",e)}function u(e){a("throw",e)}function c(e,t){e(t),s.shift(),s.length&&a(s[0][0],s[0][1])}}function w(e){var t,r;return t={},n("next"),n("throw",function(e){throw e}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,i){t[n]=e[n]?function(t){return(r=!r)?{value:v(e[n](t)),done:"return"===n}:i?i(t):t}:i}}function _(e){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=p(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise(function(n,i){!function(e,t,r,n){Promise.resolve(n).then(function(t){e({value:t,done:r})},t)}(n,i,(t=e[r](t)).done,t.value)})}}}function E(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function S(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function A(e){return e&&e.__esModule?e:{default:e}}function k(e,t){if(!t.has(e))throw TypeError("attempted to get private field on non-instance");return t.get(e)}function C(e,t,r){if(!t.has(e))throw TypeError("attempted to set private field on non-instance");return t.set(e,r),r}},62868:function(e,t){"use strict";function r(e){let t;return"undefined"!=typeof window&&void 0!==window[e]&&(t=window[e]),t}function n(e){let t=r(e);if(!t)throw Error(`${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=r,t.getFromWindowOrThrow=n,t.getDocumentOrThrow=function(){return n("document")},t.getDocument=function(){return r("document")},t.getNavigatorOrThrow=function(){return n("navigator")},t.getNavigator=function(){return r("navigator")},t.getLocationOrThrow=function(){return n("location")},t.getLocation=function(){return r("location")},t.getCryptoOrThrow=function(){return n("crypto")},t.getCrypto=function(){return r("crypto")},t.getLocalStorageOrThrow=function(){return n("localStorage")},t.getLocalStorage=function(){return r("localStorage")}},56932:function(e,t,r){"use strict";r(62868)},29461:function(e,t,r){"use strict";let n=r(29276),i=r(56368),s=r(76442),o=r(24816),a=e=>null==e,l=Symbol("encodeFragmentIdentifier");function u(e){if("string"!=typeof e||1!==e.length)throw TypeError("arrayFormatSeparator must be single character string")}function c(e,t){return t.encode?t.strict?n(e):encodeURIComponent(e):e}function h(e,t){return t.decode?i(e):e}function d(e){let t=e.indexOf("#");return -1!==t&&(e=e.slice(0,t)),e}function f(e){let t=(e=d(e)).indexOf("?");return -1===t?"":e.slice(t+1)}function p(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){u((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);let r=function(e){let t;switch(e.arrayFormat){case"index":return(e,r,n)=>{if(t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),!t){n[e]=r;return}void 0===n[e]&&(n[e]={}),n[e][t[1]]=r};case"bracket":return(e,r,n)=>{if(t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),!t){n[e]=r;return}if(void 0===n[e]){n[e]=[r];return}n[e]=[].concat(n[e],r)};case"colon-list-separator":return(e,r,n)=>{if(t=/(:list)$/.exec(e),e=e.replace(/:list$/,""),!t){n[e]=r;return}if(void 0===n[e]){n[e]=[r];return}n[e]=[].concat(n[e],r)};case"comma":case"separator":return(t,r,n)=>{let i="string"==typeof r&&r.includes(e.arrayFormatSeparator),s="string"==typeof r&&!i&&h(r,e).includes(e.arrayFormatSeparator);r=s?h(r,e):r;let o=i||s?r.split(e.arrayFormatSeparator).map(t=>h(t,e)):null===r?r:h(r,e);n[t]=o};case"bracket-separator":return(t,r,n)=>{let i=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),!i){n[t]=r?h(r,e):r;return}let s=null===r?[]:r.split(e.arrayFormatSeparator).map(t=>h(t,e));if(void 0===n[t]){n[t]=s;return}n[t]=[].concat(n[t],s)};default:return(e,t,r)=>{if(void 0===r[e]){r[e]=t;return}r[e]=[].concat(r[e],t)}}}(t),n=Object.create(null);if("string"!=typeof e||!(e=e.trim().replace(/^[?#&]/,"")))return n;for(let i of e.split("&")){if(""===i)continue;let[e,o]=s(t.decode?i.replace(/\+/g," "):i,"=");o=void 0===o?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?o:h(o,t),r(h(e,t),o,n)}for(let e of Object.keys(n)){let r=n[e];if("object"==typeof r&&null!==r)for(let e of Object.keys(r))r[e]=p(r[e],t);else n[e]=p(r,t)}return!1===t.sort?n:(!0===t.sort?Object.keys(n).sort():Object.keys(n).sort(t.sort)).reduce((e,t)=>
40{let r=n[t];return r&&"object"==typeof r&&!Array.isArray(r)?e[t]=function e(t){return Array.isArray(t)?t.sort():"object"==typeof t?e(Object.keys(t)).sort((e,t)=>Number(e)-Number(t)).map(e=>t[e]):t}(r):e[t]=r,e},Object.create(null))}t.extract=f,t.parse=g,t.stringify=(e,t)=>{if(!e)return"";u((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);let r=r=>t.skipNull&&a(e[r])||t.skipEmptyString&&""===e[r],n=function(e){switch(e.arrayFormat){case"index":return t=>(r,n)=>{let i=r.length;return void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[c(t,e),"[",i,"]"].join("")]:[...r,[c(t,e),"[",c(i,e),"]=",c(n,e)].join("")]};case"bracket":return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[c(t,e),"[]"].join("")]:[...r,[c(t,e),"[]=",c(n,e)].join("")];case"colon-list-separator":return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[c(t,e),":list="].join("")]:[...r,[c(t,e),":list=",c(n,e)].join("")];case"comma":case"separator":case"bracket-separator":{let t="bracket-separator"===e.arrayFormat?"[]=":"=";return r=>(n,i)=>void 0===i||e.skipNull&&null===i||e.skipEmptyString&&""===i?n:(i=null===i?"":i,0===n.length)?[[c(r,e),t,c(i,e)].join("")]:[[n,c(i,e)].join(e.arrayFormatSeparator)]}default:return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,c(t,e)]:[...r,[c(t,e),"=",c(n,e)].join("")]}}(t),i={};for(let t of Object.keys(e))r(t)||(i[t]=e[t]);let s=Object.keys(i);return!1!==t.sort&&s.sort(t.sort),s.map(r=>{let i=e[r];return void 0===i?"":null===i?c(r,t):Array.isArray(i)?0===i.length&&"bracket-separator"===t.arrayFormat?c(r,t)+"[]":i.reduce(n(r),[]).join("&"):c(r,t)+"="+c(i,t)}).filter(e=>e.length>0).join("&")},t.parseUrl=(e,t)=>
40{t=Object.assign({decode:!0},t);let[r,n]=s(e,"#");return Object.assign({url:r.split("?")[0]||"",query:g(f(e),t)},t&&t.parseFragmentIdentifier&&n?{fragmentIdentifier:h(n,t)}:{})},t.stringifyUrl=(e,r)=>{r=Object.assign({encode:!0,strict:!0,[l]:!0},r);let n=d(e.url).split("?")[0]||"",i=t.extract(e.url),s=Object.assign(t.parse(i,{sort:!1}),e.query),o=t.stringify(s,r);o&&(o=`?${o}`);let a=function(e){let t="",r=e.indexOf("#");return -1!==r&&(t=e.slice(r)),t}(e.url);return e.fragmentIdentifier&&(a=`#${r[l]?c(e.fragmentIdentifier,r):e.fragmentIdentifier}`),`${n}${o}${a}`},t.pick=(e,r,n)=>{n=Object.assign({parseFragmentIdentifier:!0,[l]:!1},n);let{url:i,query:s,fragmentIdentifier:a}=t.parseUrl(e,n);return t.stringifyUrl({url:i,query:o(s,r),fragmentIdentifier:a},n)},t.exclude=(e,r,n)=>{let i=Array.isArray(r)?e=>!r.includes(e):(e,t)=>!r(e,t);return t.pick(e,i,n)}},40168:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(11735),i=r(29174),s=function(){function e(){this._semaphore=new i.default(1)}return e.prototype.acquire=function(){return n.__awaiter(this,void 0,void 0,function(){return n.__generator(this,function(e){switch(e.label){case 0:return[4,this._semaphore.acquire()];case 1:return[2,e.sent()[1]]}})})},e.prototype.runExclusive=function(e){return this._semaphore.runExclusive(function(){return e()})},e.prototype.isLocked=function(){return this._semaphore.isLocked()},e.prototype.release=function(){this._semaphore.release()},e}();t.default=s},29174:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(11735),i=function(){function e(e){if(this._maxConcurrency=e,this._queue=[],e<=0)throw Error("semaphore must be initialized to a positive value");this._value=e}return e.prototype.acquire=function(){var e=this,t=this.isLocked(),r=new Promise(function(t){return e._queue.push(t)});return t||this._dispatch(),r},e.prototype.runExclusive=function(e){return n.__awaiter(this,void 0,void 0,function(){var t,r,i;return n.__generator(this,function(n){switch(n.label){case 0:return[4,this.acquire()];case 1:r=(t=n.sent())[0],i=t[1],n.label=2;case 2:return n.trys.push([2,,4,5]),[4,e(r)];case 3:return[2,n.sent()];case 4:return i(),[7];case 5:return[2]}})})},e.prototype.isLocked=function(){return this._value<=0},e.prototype.release=function(){if(this._maxConcurrency>1)throw 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 r=!1;this._currentReleaser=function(){r||(r=!0,e._value++,e._dispatch())},t([this._value--,this._currentReleaser])}},e}();t.default=i},49715:function(e,t,r){"use strict";t.WU=void 0;var n=r(40168);Object.defineProperty(t,"WU",{enumerable:!0,get:function(){return n.default}}),r(29174),r(49571)},49571:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.withTimeout=void 0;var n=r(11735);t.withTimeout=function(e,t,r){var i=this;return void 0===r&&(r=Error("timeout")),{acquire:function(){return new Promise(function(s,o){return n.__awaiter(i,void 0,void 0,function(){var i,a;return n.__generator(this,function(n){switch(n.label){case 0:return i=!1,setTimeout(function(){i=!0,o(r)},t),[4,e.acquire()];case 1:return a=n.sent(),i?(Array.isArray(a)?a[1]:a)():s(a),[2]}})})})},runExclusive:function(e){return n.__awaiter(this,void 0,void 0,function(){var t,r;return n.__generator(this,function(n){switch(n.label){case 0:t=function(){},n.label=1;case 1:return n.trys.push([1,,7,8]),[4,this.acquire()];case 2:if(!Array.isArray(r=n.sent()))return[3,4];return t=r[1],[4,e(r[0])];case 3:case 5:return[2,n.sent()];case 4:return t=r,[4,e()];case 6:return[3,8];case 7:return t(),[7];case 8:return[2]}})})},release:function(){e.release()},isLocked:function(){return e.isLocked()}}}},35197:function(e,t,r){"use strict";var n=r(10632).Buffer;e.exports=function(e){if(e.length>=255)throw TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var i=0;i<e.length;i++){var s=e.charAt(i),o=s.charCodeAt(0);if(255!==t[o])throw TypeError(s+" is ambiguous");t[o]=i}var a=e.length,l=e.charAt(0),u=Math.log(a)/Math.log(256),c=Math.log(256)/Math.log(a);function h(e){if("string"!=typeof e)throw TypeError("Expected String");if(0===e.length)return n.alloc(0);for(var r=0,i=0,s=0;e[r]===l;)i++,r++;for(var o=(e.length-r)*u+1>>>0,c=new Uint8Array(o);e[r];){var h=t[e.charCodeAt(r)];if(255===h)return;for(var d=0,f=o-1;(0!==h||d<s)&&-1!==f;f--,d++)h+=a*c[f]>>>0,c[f]=h%256>>>0,h=h/256>>>0;if(0!==h)throw Error("Non-zero carry");s=d,r++}for(var p=o-s;p!==o&&0===c[p];)p++;var g=n.allocUnsafe(i+(o-p));g.fill(0,0,i);for(var y=i;p!==o;)g[y++]=c[p++];return g}return{encode:function(t){if((Array.isArray(t)||t instanceof Uint8Array)&&(t=n.from(t)),!n.isBuffer(t))throw TypeError("Expected Buffer");if(0===t.length)return"";for(var r=0,i=0,s=0,o=t.length;s!==o&&0===t[s];)s++,r++;for(var u=(o-s)*c+1>>>0,h=new Uint8Array(u);s!==o;){for(var d=t[s],f=0,p=u-1;(0!==d||f<i)&&-1!==p;p--,f++)d+=256*h[p]>>>0,h[p]=d%a>>>0,d=d/a>>>0;if(0!==d)throw Error("Non-zero carry");i=f,s++}for(var g=u-i;g!==u&&0===h[g];)g++;for(var y=l.repeat(r);g<u;++g)y+=e.charAt(h[g]);return y},decodeUnsafe:h,decode:function(e){var t=h(e);if(t)return t;throw Error("Non-base"+a+" character")}}}},1192:function(e){"use strict";
40for(var t="qpzry9x8gf2tvdw0s3jn54khce6mua7l",r={},n=0;n<t.length;n++){var i=t.charAt(n);if(void 0!==r[i])throw TypeError(i+" is ambiguous");r[i]=n}function s(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,r=0;r<e.length;++r){var n=e.charCodeAt(r);if(n<33||n>126)return"Invalid prefix ("+e+")";t=s(t)^n>>5}for(r=0,t=s(t);r<e.length;++r){var i=e.charCodeAt(r);t=s(t)^31&i}return t}function a(e,t){if(t=t||90,e.length<8)return e+" too short";if(e.length>t)return"Exceeds length limit";var n=e.toLowerCase(),i=e.toUpperCase();if(e!==n&&e!==i)return"Mixed-case string "+e;var a=(e=n).lastIndexOf("1");if(-1===a)return"No separator character for "+e;if(0===a)return"Missing prefix for "+e;var l=e.slice(0,a),u=e.slice(a+1);if(u.length<6)return"Data too short";var c=o(l);if("string"==typeof c)return c;for(var h=[],d=0;d<u.length;++d){var f=u.charAt(d),p=r[f];if(void 0===p)return"Unknown character "+f;c=s(c)^p,d+6>=u.length||h.push(p)}return 1!==c?"Invalid checksum for "+e:{prefix:l,words:h}}function l(e,t,r,n){for(var i=0,s=0,o=(1<<r)-1,a=[],l=0;l<e.length;++l)for(i=i<<t|e[l],s+=t;s>=r;)a.push(i>>(s-=r)&o);if(n)s>0&&a.push(i<<r-s&o);else{if(s>=t)return"Excess padding";if(i<<r-s&o)return"Non-zero padding"}return a}e.exports={decodeUnsafe:function(){var e=a.apply(null,arguments);if("object"==typeof e)return e},decode:function(e){var t=a.apply(null,arguments);if("object"==typeof t)return t;throw Error(t)},encode:function(e,r,n){if(n=n||90,e.length+7+r.length>n)throw TypeError("Exceeds length limit");var i=o(e=e.toLowerCase());if("string"==typeof i)throw Error(i);for(var a=e+"1",l=0;l<r.length;++l){var u=r[l];if(u>>5!=0)throw Error("Non 5-bit word");i=s(i)^u,a+=t.charAt(u)}for(l=0;l<6;++l)i=s(i);for(i^=1,l=0;l<6;++l){var c=i>>(5-l)*5&31;a+=t.charAt(c)}return a},toWordsUnsafe:function(e){var t=l(e,8,5,!0);if(Array.isArray(t))return t},toWords:function(e){var t=l(e,8,5,!0);if(Array.isArray(t))return t;throw Error(t)},fromWordsUnsafe:function(e){var t=l(e,5,8,!1);if(Array.isArray(t))return t},fromWords:function(e){var t=l(e,5,8,!1);if(Array.isArray(t))return t;throw Error(t)}}},12653:function(e,t,r){"use strict";var n=r(9109).Buffer;t.oU=function(e){{let t=n.from(e);t.reverse();let r=t.toString("hex");return 0===r.length?BigInt(0):BigInt(`0x${r}`)}},t.k$=function(e,t){{let r=e.toString(16),i=n.from(r.padStart(2*t,"0").slice(0,2*t),"hex");return i.reverse(),i}}},5810:function(e,t,r){"use strict";var n=r(9109).Buffer,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__decorate||function(e,t,r,n){var i,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,r,o):i(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&i(t,e,r);return s(t,e),t},l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.deserializeUnchecked=t.deserialize=t.serialize=t.BinaryReader=t.BinaryWriter=t.BorshError=t.baseDecode=t.baseEncode=void 0;let u=l(r(58171)),c=l(r(46124)),h=a(r(57139)),d=new("function"!=typeof TextDecoder?h.TextDecoder:TextDecoder)("utf-8",{fatal:!0});t.baseEncode=function(e){return"string"==typeof e&&(e=n.from(e,"utf8")),c.default.encode(n.from(e))},t.baseDecode=function(e){return n.from(c.default.decode(e))};class f extends Error{constructor(e){super(e),this.fieldPath=[],this.originalMessage=e}addToFieldPath(e){this.fieldPath.splice(0,0,e),this.message=this.originalMessage+": "+this.fieldPath.join(".")}}t.BorshError=f;class p{constructor(){this.buf=n.alloc(1024),this.length=0}maybeResize(){this.buf.length<16+this.length&&(this.buf=n.concat([this.buf,n.alloc(1024)]))}writeU8(e){this.maybeResize(),this.buf.writeUInt8(e,this.length),this.length+=1}writeU16(e){this.maybeResize(),this.buf.writeUInt16LE(e,this.length),this.length+=2}writeU32(e){this.maybeResize(),this.buf.writeUInt32LE(e,this.length),this.length+=4}writeU64(e){this.maybeResize(),this.writeBuffer(n.from(new u.default(e).toArray("le",8)))}writeU128(e){this.maybeResize(),this.writeBuffer(n.from(new u.default(e).toArray("le",16)))}writeU256(e){this.maybeResize(),this.writeBuffer(n.from(new u.default(e).toArray("le",32)))}writeU512(e){this.maybeResize(),this.writeBuffer(n.from(new u.default(e).toArray("le",64)))}writeBuffer(e){this.buf=n.concat([n.from(this.buf.subarray(0,this.length)),e,n.alloc(1024)]),this.length+=e.length}writeString(e){this.maybeResize();let t=n.from(e,"utf8");this.writeU32(t.length),this.writeBuffer(t)}writeFixedArray(e){this.writeBuffer(n.from(e))}writeArray(e,t){for(let r of(this.maybeResize(),this.writeU32(e.length),e))this.maybeResize(),t(r)}toArray(){return this.buf.subarray(0,this.length)}}function g(e,t,r){let n=r.value;r.value=function(...e){try{return n.apply(this,e)}catch(e){if(e instanceof RangeError&&["ERR_BUFFER_OUT_OF_BOUNDS","ERR_OUT_OF_RANGE"].indexOf(e.code)>=0)throw new f("Reached the end of buffer when deserializing");throw e}}}t.BinaryWriter=p;class y{constructor(e){this.buf=e,this.offset=0}readU8(){let e=this.buf.readUInt8(this.offset);return this.offset+=1,e}readU16(){let e=this.buf.readUInt16LE(this.offset);return this.offset+=2,e}readU32(){let e=this.buf.readUInt32LE(this.offset);return this.offset+=4,e}readU64(){let e=this.readBuffer(8);return new u.default(e,"le")}readU128(){let e=this.readBuffer(16);return new u.default(e,"le")}readU256(){let e=this.readBuffer(32);return new u.default(e,"le")}readU512(){let e=this.readBuffer(64);return new u.default(e,"le")}readBuffer(e){if(this.offset+e>this.buf.length)throw new f(`Expected buffer length ${e} isn't within bounds`);let t=this.buf.slice(this.offset,this.offset+e);return this.offset+=e,t}readString(){let e=this.readU32(),t=this.readBuffer(e);try{return d.decode(t)}catch(e){throw new f(`Error decoding UTF-8 string: ${e}`)}}readFixedArray(e){return new Uint8Array(this.readBuffer(e))}readArray(e){let t=this.readU32(),r=[];for(let n=0;n<t;++n)r.push(e());return r}}function m(e){return e.charAt(0).toUpperCase()+e.slice(1)}function v(e,t,r,n,i){try{if("string"==typeof n)i[`write${m(n)}`](r);
40else if(n instanceof Array){if("number"==typeof n[0]){if(r.length!==n[0])throw new f(`Expecting byte array of length ${n[0]}, but got ${r.length} bytes`);i.writeFixedArray(r)}else if(2===n.length&&"number"==typeof n[1]){if(r.length!==n[1])throw new f(`Expecting byte array of length ${n[1]}, but got ${r.length} bytes`);for(let t=0;t<n[1];t++)v(e,null,r[t],n[0],i)}else i.writeArray(r,r=>{v(e,t,r,n[0],i)})}else if(void 0!==n.kind)switch(n.kind){case"option":null==r?i.writeU8(0):(i.writeU8(1),v(e,t,r,n.type,i));break;case"map":i.writeU32(r.size),r.forEach((r,s)=>{v(e,t,s,n.key,i),v(e,t,r,n.value,i)});break;default:throw new f(`FieldType ${n} unrecognized`)}else b(e,r,i)}catch(e){throw e instanceof f&&e.addToFieldPath(t),e}}function b(e,t,r){if("function"==typeof t.borshSerialize){t.borshSerialize(r);return}let n=e.get(t.constructor);if(!n)throw new f(`Class ${t.constructor.name} is missing in schema`);if("struct"===n.kind)n.fields.map(([n,i])=>{v(e,n,t[n],i,r)});else if("enum"===n.kind){let i=t[n.field];for(let s=0;s<n.values.length;++s){let[o,a]=n.values[s];if(o===i){r.writeU8(s),v(e,o,t[o],a,r);break}}}else throw new f(`Unexpected schema kind: ${n.kind} for ${t.constructor.name}`)}function w(e,t,r,n){try{if("string"==typeof r)return n[`read${m(r)}`]();if(r instanceof Array){if("number"==typeof r[0])return n.readFixedArray(r[0]);if("number"!=typeof r[1])return n.readArray(()=>w(e,t,r[0],n));{let t=[];for(let i=0;i<r[1];i++)t.push(w(e,null,r[0],n));return t}}if("option"===r.kind){if(n.readU8())return w(e,t,r.type,n);return}if("map"===r.kind){let i=new Map,s=n.readU32();for(let o=0;o<s;o++){let s=w(e,t,r.key,n),o=w(e,t,r.value,n);i.set(s,o)}return i}return _(e,r,n)}catch(e){throw e instanceof f&&e.addToFieldPath(t),e}}function _(e,t,r){if("function"==typeof t.borshDeserialize)return t.borshDeserialize(r);let n=e.get(t);if(!n)throw new f(`Class ${t.name} is missing in schema`);if("struct"===n.kind){let n={};for(let[i,s]of e.get(t).fields)n[i]=w(e,i,s,r);return new t(n)}if("enum"===n.kind){let i=r.readU8();if(i>=n.values.length)throw new f(`Enum index: ${i} is out of range`);let[s,o]=n.values[i],a=w(e,s,o,r);return new t({[s]:a})}throw new f(`Unexpected schema kind: ${n.kind} for ${t.constructor.name}`)}o([g],y.prototype,"readU8",null),o([g],y.prototype,"readU16",null),o([g],y.prototype,"readU32",null),o([g],y.prototype,"readU64",null),o([g],y.prototype,"readU128",null),o([g],y.prototype,"readU256",null),o([g],y.prototype,"readU512",null),o([g],y.prototype,"readString",null),o([g],y.prototype,"readFixedArray",null),o([g],y.prototype,"readArray",null),t.BinaryReader=y,t.serialize=function(e,t,r=p){let n=new r;return b(e,t,n),n.toArray()},t.deserialize=function(e,t,r,n=y){let i=new n(r),s=_(e,t,i);if(i.offset<r.length)throw new f(`Unexpected ${r.length-i.offset} bytes after deserialized data`);return s},t.deserializeUnchecked=function(e,t,r,n=y){return _(e,t,new n(r))}},46124:function(e,t,r){var n=r(35197);e.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},80726:function(e,t,r){var n=r(9109).Buffer;e.exports=function(e){for(var t=new n(e.length),r=0,i=e.length-1;r<=i;++r,--i)t[r]=e[i],t[i]=e[r];return t}},55151:function(e,t){var r="undefined"!=typeof self?self:this,n=function(){function e(){this.fetch=!1,this.DOMException=r.DOMException}return e.prototype=r,new e}();(function(e){var t={searchParams:"URLSearchParams"in n,iterable:"Symbol"in n&&"iterator"in Symbol,blob:"FileReader"in n&&"Blob"in n&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in n,arrayBuffer:"ArrayBuffer"in n};if(t.arrayBuffer)var r=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],i=ArrayBuffer.isView||function(e){return e&&r.indexOf(Object.prototype.toString.call(e))>-1};function s(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw TypeError("Invalid character in header field name");return e.toLowerCase()}function o(e){return"string"!=typeof e&&(e=String(e)),e}
40function a(e){var r={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return t.iterable&&(r[Symbol.iterator]=function(){return r}),r}function l(e){this.map={},e instanceof l?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 u(e){if(e.bodyUsed)return Promise.reject(TypeError("Already read"));e.bodyUsed=!0}function c(e){return new Promise(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function h(e){var t=new FileReader,r=c(t);return t.readAsArrayBuffer(e),r}function d(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function f(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e){if("string"==typeof e)this._bodyText=e;else if(t.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(t.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else{var r;t.arrayBuffer&&t.blob&&(r=e)&&DataView.prototype.isPrototypeOf(r)?(this._bodyArrayBuffer=d(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):t.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||i(e))?this._bodyArrayBuffer=d(e):this._bodyText=e=Object.prototype.toString.call(e)}}else 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):t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},t.blob&&(this.blob=function(){var e=u(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)return Promise.resolve(new Blob([this._bodyText]));throw Error("could not read FormData body as blob")},this.arrayBuffer=function(){return this._bodyArrayBuffer?u(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(h)}),this.text=function(){var e,t,r,n=u(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,r=c(t=new FileReader),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(!this._bodyFormData)return Promise.resolve(this._bodyText);throw Error("could not read FormData body as text")},t.formData&&(this.formData=function(){return this.text().then(y)}),this.json=function(){return this.text().then(JSON.parse)},this}l.prototype.append=function(e,t){e=s(e),t=o(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},l.prototype.delete=function(e){delete this.map[s(e)]},l.prototype.get=function(e){return e=s(e),this.has(e)?this.map[e]:null},l.prototype.has=function(e){return this.map.hasOwnProperty(s(e))},l.prototype.set=function(e,t){this.map[s(e)]=o(t)},l.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},l.prototype.keys=function(){var e=[];return this.forEach(function(t,r){e.push(r)}),a(e)},l.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),a(e)},l.prototype.entries=function(){var e=[];return this.forEach(function(t,r){e.push([r,t])}),a(e)},t.iterable&&(l.prototype[Symbol.iterator]=l.prototype.entries);var p=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function g(e,t){var r,n,i=(t=t||{}).body;if(e instanceof g){if(e.bodyUsed)throw TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new l(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",(t.headers||!this.headers)&&(this.headers=new l(t.headers)),this.method=(n=(r=t.method||this.method||"GET").toUpperCase(),p.indexOf(n)>-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function y(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}}),t}function m(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 l(t.headers),this.url=t.url||"",this._initBody(e)}g.prototype.clone=function(){return new g(this,{body:this._bodyInit})},f.call(g.prototype),f.call(m.prototype),m.prototype.clone=function(){return new m(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},m.error=function(){var e=new m(null,{status:0,statusText:""});return e.type="error",e};var v=[301,302,303,307,308];m.redirect=function(e,t){if(-1===v.indexOf(t))throw RangeError("Invalid status code");return new m(null,{status:t,headers:{location:e}})},e.DOMException=n.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function b(r,n){return new Promise(function(i,s){var o=new g(r,n);if(o.signal&&o.signal.aborted)return s(new e.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function u(){a.abort()}a.onload=function(){var e,t,r={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new l,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEac
40h(function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();t.append(n,i)}}),t)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL"),i(new m("response"in a?a.response:a.responseText,r))},a.onerror=function(){s(TypeError("Network request failed"))},a.ontimeout=function(){s(TypeError("Network request failed"))},a.onabort=function(){s(new e.DOMException("Aborted","AbortError"))},a.open(o.method,o.url,!0),"include"===o.credentials?a.withCredentials=!0:"omit"===o.credentials&&(a.withCredentials=!1),"responseType"in a&&t.blob&&(a.responseType="blob"),o.headers.forEach(function(e,t){a.setRequestHeader(t,e)}),o.signal&&(o.signal.addEventListener("abort",u),a.onreadystatechange=function(){4===a.readyState&&o.signal.removeEventListener("abort",u)}),a.send(void 0===o._bodyInit?null:o._bodyInit)})}b.polyfill=!0,n.fetch||(n.fetch=b,n.Headers=l,n.Request=g,n.Response=m),e.Headers=l,e.Request=g,e.Response=m,e.fetch=b,Object.defineProperty(e,"__esModule",{value:!0})})({}),n.fetch.ponyfill=!0,delete n.fetch.polyfill,(t=n.fetch).default=n.fetch,t.fetch=n.fetch,t.Headers=n.Headers,t.Request=n.Request,t.Response=n.Response,e.exports=t},42927:function(e,t,r){var n;n=function(e){var t,r,n,i,s,o,a,l,u,c,h,d,f,p;return t=e.lib.BlockCipher,r=e.algo,n=[],i=[],s=[],o=[],a=[],l=[],u=[],c=[],h=[],d=[],function(){for(var e=[],t=0;t<256;t++)t<128?e[t]=t<<1:e[t]=t<<1^283;for(var r=0,f=0,t=0;t<256;t++){var p=f^f<<1^f<<2^f<<3^f<<4;p=p>>>8^255&p^99,n[r]=p,i[p]=r;var g=e[r],y=e[g],m=e[y],v=257*e[p]^16843008*p;s[r]=v<<24|v>>>8,o[r]=v<<16|v>>>16,a[r]=v<<8|v>>>24,l[r]=v;var v=16843009*m^65537*y^257*g^16843008*r;u[p]=v<<24|v>>>8,c[p]=v<<16|v>>>16,h[p]=v<<8|v>>>24,d[p]=v,r?(r=g^e[e[e[m^g]]],f^=e[e[f]]):r=f=1}}(),f=[0,1,2,4,8,16,32,64,128,27,54],p=r.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e,t=this._keyPriorReset=this._key,r=t.words,i=t.sigBytes/4,s=((this._nRounds=i+6)+1)*4,o=this._keySchedule=[],a=0;a<s;a++)a<i?o[a]=r[a]:(e=o[a-1],a%i?i>6&&a%i==4&&(e=n[e>>>24]<<24|n[e>>>16&255]<<16|n[e>>>8&255]<<8|n[255&e]):e=(n[(e=e<<8|e>>>24)>>>24]<<24|n[e>>>16&255]<<16|n[e>>>8&255]<<8|n[255&e])^f[a/i|0]<<24,o[a]=o[a-i]^e);for(var l=this._invKeySchedule=[],p=0;p<s;p++){var a=s-p;if(p%4)var e=o[a];else var e=o[a-4];p<4||a<=4?l[p]=e:l[p]=u[n[e>>>24]]^c[n[e>>>16&255]]^h[n[e>>>8&255]]^d[n[255&e]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,s,o,a,l,n)},decryptBlock:function(e,t){var r=e[t+1];e[t+1]=e[t+3],e[t+3]=r,this._doCryptBlock(e,t,this._invKeySchedule,u,c,h,d,i);var r=e[t+1];e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,n,i,s,o,a){for(var l=this._nRounds,u=e[t]^r[0],c=e[t+1]^r[1],h=e[t+2]^r[2],d=e[t+3]^r[3],f=4,p=1;p<l;p++){var g=n[u>>>24]^i[c>>>16&255]^s[h>>>8&255]^o[255&d]^r[f++],y=n[c>>>24]^i[h>>>16&255]^s[d>>>8&255]^o[255&u]^r[f++],m=n[h>>>24]^i[d>>>16&255]^s[u>>>8&255]^o[255&c]^r[f++],v=n[d>>>24]^i[u>>>16&255]^s[c>>>8&255]^o[255&h]^r[f++];u=g,c=y,h=m,d=v}var g=(a[u>>>24]<<24|a[c>>>16&255]<<16|a[h>>>8&255]<<8|a[255&d])^r[f++],y=(a[c>>>24]<<24|a[h>>>16&255]<<16|a[d>>>8&255]<<8|a[255&u])^r[f++],m=(a[h>>>24]<<24|a[d>>>16&255]<<16|a[u>>>8&255]<<8|a[255&c])^r[f++],v=(a[d>>>24]<<24|a[u>>>16&255]<<16|a[c>>>8&255]<<8|a[255&h])^r[f++];e[t]=g,e[t+1]=y,e[t+2]=m,e[t+3]=v},keySize:8}),e.AES=t._createHelper(p),e.AES},e.exports=n(r(39317),r(85925),r(96546),r(87579),r(90576))},16405:function(e,t,r){var n;n=function(e){return function(){var t=e.lib.BlockCipher,r=e.algo;let n=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],i
vendor: 11,033 bytes, line 40
40=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]]
40;var s={pbox:[],sbox:[]};function o(e,t){let r=e.sbox[0][t>>24&255]+e.sbox[1][t>>16&255];return r^=e.sbox[2][t>>8&255],r+=e.sbox[3][255&t]}function a(e,t,r){let n,i=t,s=r;for(let t=0;t<16;++t)i^=e.pbox[t],s=o(e,i)^s,n=i,i=s,s=n;return n=i,i=s,s=n^e.pbox[16],{left:i^=e.pbox[17],right:s}}var l=r.Blowfish=t.extend({_doReset:function(){if(this._keyPriorReset!==this._key){var e=this._keyPriorReset=this._key;!function(e,t,r){for(let t=0;t<4;t++){e.sbox[t]=[];for(let r=0;r<256;r++)e.sbox[t][r]=i[t][r]}let s=0;for(let i=0;i<18;
40i++)e.pbox[i]=n[i]^t[s],++s>=r&&(s=0);let o=0,l=0,u=0;for(let t=0;t<18;t+=2)o=(u=a(e,o,l)).left,l=u.right,e.pbox[t]=o,e.pbox[t+1]=l;for(let t=0;t<4;t++)for(let r=0;r<256;r+=2)o=(u=a(e,o,l)).left,l=u.right,e.sbox[t][r]=o,e.sbox[t][r+1]=l}(s,e.words,e.sigBytes/4)}},encryptBlock:function(e,t){var r=a(s,e[t],e[t+1]);e[t]=r.left,e[t+1]=r.right},decryptBlock:function(e,t){var r=function(e,t,r){let n,i=t,s=r;for(let t=17;t>1;--t)i^=e.pbox[t],s=o(e,i)^s,n=i,i=s,s=n;return n=i,i=s,s=n^e.pbox[1],{left:i^=e.pbox[0],right:s}}(s,e[t],e[t+1]);e[t]=r.left,e[t+1]=r.right},blockSize:2,keySize:4,ivSize:2});e.Blowfish=t._createHelper(l)}(),e.Blowfish},e.exports=n(r(39317),r(85925),r(96546),r(87579),r(90576))},90576:function(e,t,r){var n;n=function(e){var t,r,n,i,s,o,a,l,u,c,h,d,f,p,g,y,m;e.lib.Cipher||(r=(t=e.lib).Base,n=t.WordArray,i=t.BufferedBlockAlgorithm,(s=e.enc).Utf8,o=s.Base64,a=e.algo.EvpKDF,l=t.Cipher=i.extend({cfg:r.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,r){this.cfg=this.cfg.extend(r),this._xformMode=e,this._key=t,this.reset()},reset:function(){i.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?m:g}return function(t){return{encrypt:function(r,n,i){return e(n).encrypt(t,r,n,i)},decrypt:function(r,n,i){return e(n).decrypt(t,r,n,i)}}}}()}),t.StreamCipher=l.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),u=e.mode={},c=t.BlockCipherMode=r.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),h=u.CBC=function(){var e=c.extend();function t(e,t,r){var n,i=this._iv;i?(n=i,this._iv=void 0):n=this._prevBlock;for(var s=0;s<r;s++)e[t+s]^=n[s]}return e.Encryptor=e.extend({processBlock:function(e,r){var n=this._cipher,i=n.blockSize;t.call(this,e,r,i),n.encryptBlock(e,r),this._prevBlock=e.slice(r,r+i)}}),e.Decryptor=e.extend({processBlock:function(e,r){var n=this._cipher,i=n.blockSize,s=e.slice(r,r+i);n.decryptBlock(e,r),t.call(this,e,r,i),this._prevBlock=s}}),e}(),d=(e.pad={}).Pkcs7={pad:function(e,t){for(var r=4*t,i=r-e.sigBytes%r,s=i<<24|i<<16|i<<8|i,o=[],a=0;a<i;a+=4)o.push(s);var l=n.create(o,i);e.concat(l)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},t.BlockCipher=l.extend({cfg:l.cfg.extend({mode:h,padding:d}),reset:function(){l.reset.call(this);var e,t=this.cfg,r=t.iv,n=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=n.createEncryptor:(e=n.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,r&&r.words):(this._mode=e.call(n,this,r&&r.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:4}),f=t.CipherParams=r.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),p=(e.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;return(r?n.create([1398893684,1701076831]).concat(r).concat(t):t).toString(o)},parse:function(e){var t,r=o.parse(e),i=r.words;return 1398893684==i[0]&&1701076831==i[1]&&(t=n.create(i.slice(2,4)),i.splice(0,4),r.sigBytes-=16),f.create({ciphertext:r,salt:t})}},g=t.SerializableCipher=r.extend({cfg:r.extend({format:p}),encrypt:function(e,t,r,n){n=this.cfg.extend(n);var i=e.createEncryptor(r,n),s=i.finalize(t),o=i.cfg;return f.create({ciphertext:s,key:r,iv:o.iv,algorithm:e,mode:o.mode,padding:o.padding,blockSize:e.blockSize,formatter:n.format})},decrypt:function(e,t,r,n){return n=this.cfg.extend(n),t=this._parse(t,n.format),e.createDecryptor(r,n).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),y=(e.kdf={}).OpenSSL={execute:function(e,t,r,i,s){if(i||(i=n.random(8)),s)var o=a.create({keySize:t+r,hasher:s}).compute(e,i);else var o=a.create({keySize:t+r}).compute(e,i);var l=n.create(o.words.slice(t),4*r);return o.sigBytes=4*t,f.create({key:o,iv:l,salt:i})}},m=t.PasswordBasedCipher=g.extend({cfg:g.cfg.extend({kdf:y}),encrypt:function(e,t,r,n){var i=(n=this.cfg.extend(n)).kdf.execute(r,e.keySize,e.ivSize,n.salt,n.hasher);n.iv=i.iv;var s=g.encrypt.call(this,e,t,i.key,n);
vendor: 4,662 bytes, line 40
40return s.mixIn(i),s},decrypt:function(e,t,r,n){n=this.cfg.extend(n),t=this._parse(t,n.format);var i=n.kdf.execute(r,e.keySize,e.ivSize,t.salt,n.hasher);return n.iv=i.iv,g.decrypt.call(this,e,t,i.key,n)}}))},e.exports=n(r(39317),r(87579))},39317:function(e,t,r){var n;n=function(){var e=e||function(e,t){if("undefined"!=typeof window&&window.crypto&&(n=window.crypto),"undefined"!=typeof self&&self.crypto&&(n=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(n=globalThis.crypto),!n&&"undefined"!=typeof window&&window.msCrypto&&(n=window.msCrypto),!n&&void 0!==r.g&&r.g.crypto&&(n=r.g.crypto),!n)try{n=r(42480)}catch(e){}var n,i=function(){if(n){if("function"==typeof n.getRandomValues)try{return n.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof n.randomBytes)try{return n.randomBytes(4).readInt32LE()}catch(e){}}throw Error("Native crypto module could not be used to get secure random number.")},s=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),o={},a=o.lib={},l=a.Base={extend:function(e){var t=s(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},u=a.WordArray=l.extend({init:function(e,r){e=this.words=e||[],t!=r?this.sigBytes=r:this.sigBytes=4*e.length},toString:function(e){return(e||h).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,i=e.sigBytes;if(this.clamp(),n%4)for(var s=0;s<i;s++){var o=r[s>>>2]>>>24-s%4*8&255;t[n+s>>>2]|=o<<24-(n+s)%4*8}else for(var a=0;a<i;a+=4)t[n+a>>>2]=r[a>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=l.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],r=0;r<e;r+=4)t.push(i());return new u.init(t,e)}}),c=o.enc={},h=c.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var s=t[i>>>2]>>>24-i%4*8&255;n.push((s>>>4).toString(16)),n.push((15&s).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n+=2)r[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new u.init(r,t/2)}},d=c.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var s=t[i>>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(s))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n++)r[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new u.init(r,t)}},f=c.Utf8={stringify:function(e){try{return decodeURIComponent(escape(d.stringify(e)))}catch(e){throw Error("Malformed UTF-8 data")}},parse:function(e){return d.parse(unescape(encodeURIComponent(e)))}},p=a.BufferedBlockAlgorithm=l.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=f.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r,n=this._data,i=n.words,s=n.sigBytes,o=this.blockSize,a=s/(4*o),l=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*o,c=e.min(4*l,s);if(l){for(var h=0;h<l;h+=o)this._doProcessBlock(i,h);r=i.splice(0,l),n.sigBytes-=c}return new u.init(r,c)},clone:function(){var e=l.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});a.Hasher=p.extend({cfg:l.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){p.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,r){return new e.init(r).finalize(t)}},_createHmacHelper:function(e){return function(t,r){return new g.HMAC.init(e,r).finalize(t)}}});var g=o.algo={};return o}(Math);return e},e.exports=n()},85925:function(e,t,r){var n;n=function(e){var t;return t=e.lib.WordArray,e.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var i=[],s=0;s<r;s+=3)for(var o=(t[s>>>2]>>>24-s%4*8&255)<<16|(t[s+1>>>2]>>>24-(s+1)%4*8&255)<<8|t[s+2>>>2]>>>24-(s+2)%4*8&255,a=0;a<4&&s+.75*a<r;a++)i.push(n.charAt(o>>>6*(3-a)&63));var l=n.charAt(64);if(l)for(;i.length%4;)i.push(l);return i.join("")},parse:function(e){var r=e.length,n=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var s=0;s<n.length;
40s++)i[n.charCodeAt(s)]=s}var o=n.charAt(64);if(o){var a=e.indexOf(o);-1!==a&&(r=a)}return function(e,r,n){for(var i=[],s=0,o=0;o<r;o++)if(o%4){var a=n[e.charCodeAt(o-1)]<<o%4*2|n[e.charCodeAt(o)]>>>6-o%4*2;i[s>>>2]|=a<<24-s%4*8,s++}return t.create(i,s)}(e,r,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},e.enc.Base64},e.exports=n(r(39317))},37296:function(e,t,r){var n;n=function(e){var t;return t=e.lib.WordArray,e.enc.Base64url={stringify:function(e,t){void 0===t&&(t=!0);var r=e.words,n=e.sigBytes,i=t?this._safe_map:this._map;e.clamp();for(var s=[],o=0;o<n;o+=3)for(var a=(r[o>>>2]>>>24-o%4*8&255)<<16|(r[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|r[o+2>>>2]>>>24-(o+2)%4*8&255,l=0;l<4&&o+.75*l<n;l++)s.push(i.charAt(a>>>6*(3-l)&63));var u=i.charAt(64);if(u)for(;s.length%4;)s.push(u);return s.join("")},parse:function(e,r){void 0===r&&(r=!0);var n=e.length,i=r?this._safe_map:this._map,s=this._reverseMap;if(!s){s=this._reverseMap=[];for(var o=0;o<i.length;o++)s[i.charCodeAt(o)]=o}var a=i.charAt(64);if(a){var l=e.indexOf(a);-1!==l&&(n=l)}return function(e,r,n){for(var i=[],s=0,o=0;o<r;o++)if(o%4){var a=n[e.charCodeAt(o-1)]<<o%4*2|n[e.charCodeAt(o)]>>>6-o%4*2;i[s>>>2]|=a<<24-s%4*8,s++}return t.create(i,s)}(e,n,s)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"},e.enc.Base64url},e.exports=n(r(39317))},10242:function(e,t,r){var n;n=function(e){return function(){var t=e.lib.WordArray,r=e.enc;function n(e){return e<<8&4278255360|e>>>8&16711935}r.Utf16=r.Utf16BE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i+=2){var s=t[i>>>2]>>>16-i%4*8&65535;n.push(String.fromCharCode(s))}return n.join("")},parse:function(e){for(var r=e.length,n=[],i=0;i<r;i++)n[i>>>1]|=e.charCodeAt(i)<<16-i%2*16;return t.create(n,2*r)}},r.Utf16LE={stringify:function(e){for(var t=e.words,r=e.sigBytes,i=[],s=0;s<r;s+=2){var o=n(t[s>>>2]>>>16-s%4*8&65535);i.push(String.fromCharCode(o))}return i.join("")},parse:function(e){for(var r=e.length,i=[],s=0;s<r;s++)i[s>>>1]|=n(e.charCodeAt(s)<<16-s%2*16);return t.create(i,2*r)}}}(),e.enc.Utf16},e.exports=n(r(39317))},87579:function(e,t,r){var n;n=function(e){var t,r,n,i,s,o;return r=(t=e.lib).Base,n=t.WordArray,s=(i=e.algo).MD5,o=i.EvpKDF=r.extend({cfg:r.extend({keySize:4,hasher:s,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r,i=this.cfg,s=i.hasher.create(),o=n.create(),a=o.words,l=i.keySize,u=i.iterations;a.length<l;){r&&s.update(r),r=s.update(e).finalize(t),s.reset();for(var c=1;c<u;c++)r=s.finalize(r),s.reset();o.concat(r)}return o.sigBytes=4*l,o}}),e.EvpKDF=function(e,t,r){return o.create(r).compute(e,t)},e.EvpKDF},e.exports=n(r(39317),r(54724),r(52657))},28662:function(e,t,r){var n;n=function(e){var t,r;return t=e.lib.CipherParams,r=e.enc.Hex,e.format.Hex={stringify:function(e){return e.ciphertext.toString(r)},parse:function(e){var n=r.parse(e);return t.create({ciphertext:n})}},e.format.Hex},e.exports=n(r(39317),r(90576))},52657:function(e,t,r){var n;n=function(e){var t,r;t=e.lib.Base,r=e.enc.Utf8,e.algo.HMAC=t.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=r.parse(t));var n=e.blockSize,i=4*n;t.sigBytes>i&&(t=e.finalize(t)),t.clamp();for(var s=this._oKey=t.clone(),o=this._iKey=t.clone(),a=s.words,l=o.words,u=0;u<n;u++)a[u]^=1549556828,l[u]^=909522486;s.sigBytes=o.sigBytes=i,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,r=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(r))}})},e.exports=n(r(39317))},58110:function(e,t,r){var n;n=function(e){return e},e.exports=n(r(39317),r(66061),r(90183),r(10242),r(85925),r(37296),r(96546),r(54724),r(7940),r(92020),r(12427),r(42869),r(26552),r(75461),r(52657),r(51795),r(87579),r(90576),r(90584),r(91015),r(2187),r(87438),r(95124),r(81046),r(44121),r(57457),r(36490),r(64394),r(28662),r(42927),r(77850),r(14848),r(70843),r(32340),r(16405))},90183:function(e,t,r){var n;n=function(e){return function(){if("function"==typeof ArrayBuffer){var t=e.lib.WordArray,r=t.init;(t.init=function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),(e instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),e instanceof Uint8Array){for(var t=e.byteLength,n=[],i=0;i<t;i++)n[i>>>2]|=e[i]<<24-i%4*8;r.call(this,n,t)}else r.apply(this,arguments)}).prototype=t}}(),e.lib.WordArray},e.exports=n(r(39317))},96546:function(e,t,r){var n;n=function(e){return function(t){var r=e.lib,n=r.WordArray,i=r.Hasher,s=e.algo,o=[];!function(){for(var e=0;e<64;e++)o[e]=4294967296*t.abs(t.sin(e+1))|0}();var a=s.MD5=i.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,i=e[n];e[n]=(i<<8|i>>>24)&16711935|(i<<24|i>>>8)&4278255360}
40var s=this._hash.words,a=e[t+0],d=e[t+1],f=e[t+2],p=e[t+3],g=e[t+4],y=e[t+5],m=e[t+6],v=e[t+7],b=e[t+8],w=e[t+9],_=e[t+10],E=e[t+11],S=e[t+12],A=e[t+13],k=e[t+14],C=e[t+15],I=s[0],x=s[1],P=s[2],O=s[3];I=l(I,x,P,O,a,7,o[0]),O=l(O,I,x,P,d,12,o[1]),P=l(P,O,I,x,f,17,o[2]),x=l(x,P,O,I,p,22,o[3]),I=l(I,x,P,O,g,7,o[4]),O=l(O,I,x,P,y,12,o[5]),P=l(P,O,I,x,m,17,o[6]),x=l(x,P,O,I,v,22,o[7]),I=l(I,x,P,O,b,7,o[8]),O=l(O,I,x,P,w,12,o[9]),P=l(P,O,I,x,_,17,o[10]),x=l(x,P,O,I,E,22,o[11]),I=l(I,x,P,O,S,7,o[12]),O=l(O,I,x,P,A,12,o[13]),P=l(P,O,I,x,k,17,o[14]),x=l(x,P,O,I,C,22,o[15]),I=u(I,x,P,O,d,5,o[16]),O=u(O,I,x,P,m,9,o[17]),P=u(P,O,I,x,E,14,o[18]),x=u(x,P,O,I,a,20,o[19]),I=u(I,x,P,O,y,5,o[20]),O=u(O,I,x,P,_,9,o[21]),P=u(P,O,I,x,C,14,o[22]),x=u(x,P,O,I,g,20,o[23]),I=u(I,x,P,O,w,5,o[24]),O=u(O,I,x,P,k,9,o[25]),P=u(P,O,I,x,p,14,o[26]),x=u(x,P,O,I,b,20,o[27]),I=u(I,x,P,O,A,5,o[28]),O=u(O,I,x,P,f,9,o[29]),P=u(P,O,I,x,v,14,o[30]),x=u(x,P,O,I,S,20,o[31]),I=c(I,x,P,O,y,4,o[32]),O=c(O,I,x,P,b,11,o[33]),P=c(P,O,I,x,E,16,o[34]),x=c(x,P,O,I,k,23,o[35]),I=c(I,x,P,O,d,4,o[36]),O=c(O,I,x,P,g,11,o[37]),P=c(P,O,I,x,v,16,o[38]),x=c(x,P,O,I,_,23,o[39]),I=c(I,x,P,O,A,4,o[40]),O=c(O,I,x,P,a,11,o[41]),P=c(P,O,I,x,p,16,o[42]),x=c(x,P,O,I,m,23,o[43]),I=c(I,x,P,O,w,4,o[44]),O=c(O,I,x,P,S,11,o[45]),P=c(P,O,I,x,C,16,o[46]),x=c(x,P,O,I,f,23,o[47]),I=h(I,x,P,O,a,6,o[48]),O=h(O,I,x,P,v,10,o[49]),P=h(P,O,I,x,k,15,o[50]),x=h(x,P,O,I,y,21,o[51]),I=h(I,x,P,O,S,6,o[52]),O=h(O,I,x,P,p,10,o[53]),P=h(P,O,I,x,_,15,o[54]),x=h(x,P,O,I,d,21,o[55]),I=h(I,x,P,O,b,6,o[56]),O=h(O,I,x,P,C,10,o[57]),P=h(P,O,I,x,m,15,o[58]),x=h(x,P,O,I,A,21,o[59]),I=h(I,x,P,O,g,6,o[60]),O=h(O,I,x,P,E,10,o[61]),P=h(P,O,I,x,f,15,o[62]),x=h(x,P,O,I,w,21,o[63]),s[0]=s[0]+I|0,s[1]=s[1]+x|0,s[2]=s[2]+P|0,s[3]=s[3]+O|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;r[i>>>5]|=128<<24-i%32;var s=t.floor(n/4294967296);r[(i+64>>>9<<4)+15]=(s<<8|s>>>24)&16711935|(s<<24|s>>>8)&4278255360,r[(i+64>>>9<<4)+14]=(n<<8|n>>>24)&16711935|(n<<24|n>>>8)&4278255360,e.sigBytes=(r.length+1)*4,this._process();for(var o=this._hash,a=o.words,l=0;l<4;l++){var u=a[l];a[l]=(u<<8|u>>>24)&16711935|(u<<24|u>>>8)&4278255360}return o},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});function l(e,t,r,n,i,s,o){var a=e+(t&r|~t&n)+i+o;return(a<<s|a>>>32-s)+t}function u(e,t,r,n,i,s,o){var a=e+(t&n|r&~n)+i+o;return(a<<s|a>>>32-s)+t}function c(e,t,r,n,i,s,o){var a=e+(t^r^n)+i+o;return(a<<s|a>>>32-s)+t}function h(e,t,r,n,i,s,o){var a=e+(r^(t|~n))+i+o;return(a<<s|a>>>32-s)+t}e.MD5=i._createHelper(a),e.HmacMD5=i._createHmacHelper(a)}(Math),e.MD5},e.exports=n(r(39317))},90584:function(e,t,r){var n;n=function(e){return e.mode.CFB=function(){var t=e.lib.BlockCipherMode.extend();function r(e,t,r,n){var i,s=this._iv;s?(i=s.slice(0),this._iv=void 0):i=this._prevBlock,n.encryptBlock(i,0);for(var o=0;o<r;o++)e[t+o]^=i[o]}return t.Encryptor=t.extend({processBlock:function(e,t){var n=this._cipher,i=n.blockSize;r.call(this,e,t,i,n),this._prevBlock=e.slice(t,t+i)}}),t.Decryptor=t.extend({processBlock:function(e,t){var n=this._cipher,i=n.blockSize,s=e.slice(t,t+i);r.call(this,e,t,i,n),this._prevBlock=s}}),t}(),e.mode.CFB},e.exports=n(r(39317),r(90576))},2187:function(e,t,r){var n;n=function(e){return(/** @preserve
41	 * Counter block mode compatible with  Dr Brian Gladman fileenc.c
42	 * derived from CryptoJS.mode.CTR
43	 * Jan Hruby [email protected]
44	 */e.mode.CTRGladman=function(){var t=e.lib.BlockCipherMode.extend();function r(e){if((e>>24&255)==255){var t=e>>16&255,r=e>>8&255,n=255&e;255===t?(t=0,255===r?(r=0,255===n?n=0:++n):++r):++t,e=0+(t<<16)+(r<<8)+n}else e+=16777216;return e}var n=t.Encryptor=t.extend({processBlock:function(e,t){var n,i=this._cipher,s=i.blockSize,o=this._iv,a=this._counter;o&&(a=this._counter=o.slice(0),this._iv=void 0),0===((n=a)[0]=r(n[0]))&&(n[1]=r(n[1]));var l=a.slice(0);i.encryptBlock(l,0);for(var u=0;u<s;u++)e[t+u]^=l[u]}});return t.Decryptor=n,t}(),e.mode.CTRGladman)},e.exports=n(r(39317),r(90576))},91015:function(e,t,r){var n;n=function(e){var t,r;return e.mode.CTR=(r=(t=e.lib.BlockCipherMode.extend()).Encryptor=t.extend({processBlock:function(e,t){var r=this._cipher,n=r.blockSize,i=this._iv,s=this._counter;i&&(s=this._counter=i.slice(0),this._iv=void 0);var o=s.slice(0);r.encryptBlock(o,0),s[n-1]=s[n-1]+1|0;for(var a=0;a<n;a++)e[t+a]^=o[a]}}),t.Decryptor=r,t),e.mode.CTR},e.exports=n(r(39317),r(90576))},95124:function(e,t,r){var n;n=function(e){var t;return e.mode.ECB=((t=e.lib.BlockCipherMode.extend()).Encryptor=t.extend({processBlock:function(e,t){this._cipher.encryptBlock(e,t)}}),t.Decryptor=t.extend({processBlock:function(e,t){this._cipher.decryptBlock(e,t)}}),t),e.mode.ECB},e.exports=n(r(39317),r(90576))},87438:function(e,t,r){var n;n=function(e){var t,r;return e.mode.OFB=(r=(t=e.lib.BlockCipherMode.extend()).Encryptor=t.extend({processBlock:function(e,t){var r=this._cipher,n=r.blockSize,i=this._iv,s=this._keystream;i&&(s=this._keystream=i.slice(0),this._iv=void 0),r.encryptBlock(s,0);for(var o=0;o<n;o++)e[t+o]^=s[o]}}),t.Decryptor=r,t),e.mode.OFB},e.exports=n(r(39317),r(90576))},81046:function(e,t,r){var n;n=function(e){return e.pad.AnsiX923={pad:function(e,t){var r=e.sigBytes,n=4*t,i=n-r%n,s=r+i-1;
44e.clamp(),e.words[s>>>2]|=i<<24-s%4*8,e.sigBytes+=i},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},e.pad.Ansix923},e.exports=n(r(39317),r(90576))},44121:function(e,t,r){var n;n=function(e){return e.pad.Iso10126={pad:function(t,r){var n=4*r,i=n-t.sigBytes%n;t.concat(e.lib.WordArray.random(i-1)).concat(e.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},e.pad.Iso10126},e.exports=n(r(39317),r(90576))},57457:function(e,t,r){var n;n=function(e){return e.pad.Iso97971={pad:function(t,r){t.concat(e.lib.WordArray.create([2147483648],1)),e.pad.ZeroPadding.pad(t,r)},unpad:function(t){e.pad.ZeroPadding.unpad(t),t.sigBytes--}},e.pad.Iso97971},e.exports=n(r(39317),r(90576))},64394:function(e,t,r){var n;n=function(e){return e.pad.NoPadding={pad:function(){},unpad:function(){}},e.pad.NoPadding},e.exports=n(r(39317),r(90576))},36490:function(e,t,r){var n;n=function(e){return e.pad.ZeroPadding={pad:function(e,t){var r=4*t;e.clamp(),e.sigBytes+=r-(e.sigBytes%r||r)},unpad:function(e){for(var t=e.words,r=e.sigBytes-1,r=e.sigBytes-1;r>=0;r--)if(t[r>>>2]>>>24-r%4*8&255){e.sigBytes=r+1;break}}},e.pad.ZeroPadding},e.exports=n(r(39317),r(90576))},51795:function(e,t,r){var n;n=function(e){var t,r,n,i,s,o,a;return r=(t=e.lib).Base,n=t.WordArray,s=(i=e.algo).SHA256,o=i.HMAC,a=i.PBKDF2=r.extend({cfg:r.extend({keySize:4,hasher:s,iterations:25e4}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,i=o.create(r.hasher,e),s=n.create(),a=n.create([1]),l=s.words,u=a.words,c=r.keySize,h=r.iterations;l.length<c;){var d=i.update(t).finalize(a);i.reset();for(var f=d.words,p=f.length,g=d,y=1;y<h;y++){g=i.finalize(g),i.reset();for(var m=g.words,v=0;v<p;v++)f[v]^=m[v]}s.concat(d),u[0]++}return s.sigBytes=4*c,s}}),e.PBKDF2=function(e,t,r){return a.create(r).compute(e,t)},e.PBKDF2},e.exports=n(r(39317),r(7940),r(52657))},32340:function(e,t,r){var n;n=function(e){return function(){var t=e.lib.StreamCipher,r=e.algo,n=[],i=[],s=[],o=r.RabbitLegacy=t.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv,r=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],n=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var i=0;i<4;i++)a.call(this);for(var i=0;i<8;i++)n[i]^=r[i+4&7];if(t){var s=t.words,o=s[0],l=s[1],u=(o<<8|o>>>24)&16711935|(o<<24|o>>>8)&4278255360,c=(l<<8|l>>>24)&16711935|(l<<24|l>>>8)&4278255360,h=u>>>16|4294901760&c,d=c<<16|65535&u;n[0]^=u,n[1]^=h,n[2]^=c,n[3]^=d,n[4]^=u,n[5]^=h,n[6]^=c,n[7]^=d;for(var i=0;i<4;i++)a.call(this)}},_doProcessBlock:function(e,t){var r=this._X;a.call(this),n[0]=r[0]^r[5]>>>16^r[3]<<16,n[1]=r[2]^r[7]>>>16^r[5]<<16,n[2]=r[4]^r[1]>>>16^r[7]<<16,n[3]=r[6]^r[3]>>>16^r[1]<<16;for(var i=0;i<4;i++)n[i]=(n[i]<<8|n[i]>>>24)&16711935|(n[i]<<24|n[i]>>>8)&4278255360,e[t+i]^=n[i]},blockSize:4,ivSize:2});function a(){for(var e=this._X,t=this._C,r=0;r<8;r++)i[r]=t[r];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<i[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<i[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<i[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<i[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<i[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<i[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<i[6]>>>0?1:0)|0,this._b=t[7]>>>0<i[7]>>>0?1:0;for(var r=0;r<8;r++){var n=e[r]+t[r],o=65535&n,a=n>>>16,l=((o*o>>>17)+o*a>>>15)+a*a,u=((4294901760&n)*n|0)+((65535&n)*n|0);s[r]=l^u}e[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,e[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,e[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,e[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,e[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,e[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,e[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,e[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}e.RabbitLegacy=t._createHelper(o)}(),e.RabbitLegacy},e.exports=n(r(39317),r(85925),r(96546),r(87579),r(90576))},70843:function(e,t,r){var n;n=function(e){return function(){var t=e.lib.StreamCipher,r=e.algo,n=[],i=[],s=[],o=r.Rabbit=t.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,r=0;r<4;r++)e[r]=(e[r]<<8|e[r]>>>24)&16711935|(e[r]<<24|e[r]>>>8)&4278255360;var n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],i=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var r=0;r<4;r++)a.call(this);for(var r=0;r<8;r++)i[r]^=n[r+4&7];
vendor: 10,608 bytes, lines 44-53
44if(t){var s=t.words,o=s[0],l=s[1],u=(o<<8|o>>>24)&16711935|(o<<24|o>>>8)&4278255360,c=(l<<8|l>>>24)&16711935|(l<<24|l>>>8)&4278255360,h=u>>>16|4294901760&c,d=c<<16|65535&u;i[0]^=u,i[1]^=h,i[2]^=c,i[3]^=d,i[4]^=u,i[5]^=h,i[6]^=c,i[7]^=d;for(var r=0;r<4;r++)a.call(this)}},_doProcessBlock:function(e,t){var r=this._X;a.call(this),n[0]=r[0]^r[5]>>>16^r[3]<<16,n[1]=r[2]^r[7]>>>16^r[5]<<16,n[2]=r[4]^r[1]>>>16^r[7]<<16,n[3]=r[6]^r[3]>>>16^r[1]<<16;for(var i=0;i<4;i++)n[i]=(n[i]<<8|n[i]>>>24)&16711935|(n[i]<<24|n[i]>>>8)&4278255360,e[t+i]^=n[i]},blockSize:4,ivSize:2});function a(){for(var e=this._X,t=this._C,r=0;r<8;r++)i[r]=t[r];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<i[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<i[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<i[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<i[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<i[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<i[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<i[6]>>>0?1:0)|0,this._b=t[7]>>>0<i[7]>>>0?1:0;for(var r=0;r<8;r++){var n=e[r]+t[r],o=65535&n,a=n>>>16,l=((o*o>>>17)+o*a>>>15)+a*a,u=((4294901760&n)*n|0)+((65535&n)*n|0);s[r]=l^u}e[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,e[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,e[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,e[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,e[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,e[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,e[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,e[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}e.Rabbit=t._createHelper(o)}(),e.Rabbit},e.exports=n(r(39317),r(85925),r(96546),r(87579),r(90576))},14848:function(e,t,r){var n;n=function(e){return function(){var t=e.lib.StreamCipher,r=e.algo,n=r.RC4=t.extend({_doReset:function(){for(var e=this._key,t=e.words,r=e.sigBytes,n=this._S=[],i=0;i<256;i++)n[i]=i;for(var i=0,s=0;i<256;i++){var o=i%r,a=t[o>>>2]>>>24-o%4*8&255;s=(s+n[i]+a)%256;var l=n[i];n[i]=n[s],n[s]=l}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=i.call(this)},keySize:8,ivSize:0});function i(){for(var e=this._S,t=this._i,r=this._j,n=0,i=0;i<4;i++){r=(r+e[t=(t+1)%256])%256;var s=e[t];e[t]=e[r],e[r]=s,n|=e[(e[t]+e[r])%256]<<24-8*i}return this._i=t,this._j=r,n}e.RC4=t._createHelper(n);var s=r.RC4Drop=n.extend({cfg:n.cfg.extend({drop:192}),_doReset:function(){n._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)i.call(this)}});e.RC4Drop=t._createHelper(s)}(),e.RC4},e.exports=n(r(39317),r(85925),r(96546),r(87579),r(90576))},75461:function(e,t,r){var n;n=function(e){return(/** @preserve
45	(c) 2012 by Cédric Mesnil. All rights reserved.
46
47	Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
48
49	    - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
50	    - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
51
52	THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
53	*/function(t){var r=e.lib,n=r.WordArray,i=r.Hasher,s=e.algo,o=n.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),a=n.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),l=n.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),u=n.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),c=n.create([0,1518500249,1859775393,2400959708,2840853838]),h=n.create([1352829926,1548603684,1836072691,2053994217,0]),d=s.RIPEMD160=i.extend({_doReset:function(){this._hash=n.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r,n,i,s,d,p,g,y,m,v,b,w,_,E,S,A,k,C,I,x=0;x<16;x++){var P=t+x,O=e[P];e[P]=(O<<8|O>>>24)&16711935|(O<<24|O>>>8)&4278255360}var T=this._hash.words,R=c.words,N=h.words,D=o.words,B=a.words,M=l.words,L=u.words;E=m=T[0],S=v=T[1],A=b=T[2],k=w=T[3],C=_=T[4];for(var x=0;x<80;x+=1)I=m+e[t+D[x]]|0,x<16?I+=(v^b^w)+R[0]:x<32?I+=((r=v)&b|~r&w)+R[1]:x<48?I+=((v|~b)^w)+R[2]:x<64?I+=(n=v,i=b,(n&(s=w)|i&~s)+R[3]):I+=(v^(b|~w))+R[4],I|=0,I=(I=f(I,M[x]))+_|0,m=_,_=w,w=f(b,10),b=v,v=I,I=E+e[t+B[x]]|0,x<16?I+=(S^(A|~k))+N[0]:x<32?I+=(d=S,p=A,(d&(g=k)|p&~g)+N[1]):x<48?I+=((S|~A)^k)+N[2]:x<64?I+=((y=S)&A|~y&k)+N[3]:I+=(S^A^k)+N[4],I|=0,I=(I=f(I,L[x]))+C|0,E=C,C=k,k=f(A,10),A=S,S=I;I=T[1]+b+k|0,T[1]=T[2]+w+C|0,T[2]=T[3]+_+E|0,T[3]=T[4]+m+S|0,T[4]=T[0]+v+A|0,T[0]=I},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;t[n>>>5]|=128<<24-n%32,t[(n+64>>>9<<4)+14]=(r<<8|r>>>24)&16711935|(r<<24|r>>>8)&4278255360,e.sigBytes=(t.length+1)*4,this._process();for(var i=this._hash,s=i.words,o=0;o<5;o++){var a=s[o];s[o]=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360}return i},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});function f(e,t){return e<<t|e>>>32-t}e.RIPEMD160=i._createHelper(d),e.HmacRIPEMD160=i._createHmacHelper(d)}(Math),e.RIPEMD160)},e.exports=n(r(39317))},54724:function(e,t,r){var n;n=function(e){var t,r,n,i,s,o;return r=(t=e.lib).WordArray,n=t.Hasher,i=e.algo,s=[],o=i.SHA1=n.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],a=r[3],l=r[4],u=0;u<80;u++){if(u<16)s[u]=0|e[t+u];else{var c=s[u-3]^s[u-8]^s[u-14]^s[u-16];s[u]=c<<1|c>>>31}var h=(n<<5|n>>>27)+l+s[u];u<20?h+=(i&o|~i&a)+1518500249:u<40?h+=(i^o^a)+1859775393:u<60?h+=(i&o|i&a|o&a)-1894007588:h+=(i^o^a)-899497514,l=a,a=o,o=i<<30|i>>>2,i=n,n=h}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+a|0,r[4]=r[4]+l|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[(n+64>>>9<<4)+14]=Math.floor(r/4294967296),t[(n+64>>>9<<4)+15]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e}}),e.SHA1=n._createHelper(o),e.HmacSHA1=n._createHmacHelper(o),e.SHA1},e.exports=n(r(39317))},92020:function(e,t,r){var n;n=function(e){var t,r,n,i;return t=e.lib.WordArray,n=(r=e.algo).SHA256,i=r.SHA224=n.extend({_doReset:function(){this._hash=new t.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=n._doFinalize.call(this);return e.sigBytes-=4,e}}),e.SHA224=n._createHelper(i),e.HmacSHA224=n._createHmacHelper(i),e.SHA224},e.exports=n(r(39317),r(7940))},7940:function(e,t,r){var n;n=function(e){var t,r,n,i,s,o,a,l,u;return t=Math,n=(r=e.lib).WordArray,i=r.Hasher,s=e.algo,o=[],a=[],function(){function e(e){return(e-(0|e))*4294967296|0}for(var r=2,n=0;n<64;)(function(e){for(var r=t.sqrt(e),n=2;n<=r;n++)if(!(e%n))return!1;return!0})(r)&&(n<8&&(o[n]=e(t.pow(r,.5))),a[n]=e(t.pow(r,1/3)),n++),r++}(),l=[],u=s.SHA256=i.extend({_doReset:function(){this._hash=new n.init(o.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],s=r[2],o=r[3],u=r[4],c=r[5],h=r[6],d=r[7],f=0;f<64;f++){if(f<16)l[f]=0|e[t+f];else{var p=l[f-15],g=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,y=l[f-2],m=(y<<15|y>>>17)^(y<<13|y>>>19)^y>>>10;l[f]=g+l[f-7]+m+l[f-16]}var v=u&c^~u&h,b=n&i^n&s^i&s,w=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),_=d+((u<<26|u>>>6)^(u<<21|u>>>11)^(u<<7|u>>>25))+v+a[f]+l[f],E=w+b;d=h,h=c,c=u,u=o+_|0,o=s,s=i,i=n,n=_+E|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+s|0,r[3]=r[3]+o|0,r[4]=r[4]+u|0,r[5]=r[5]+c|0,r[6]=r[6]+h|0,r[7]=r[7]+d|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;return r[i>>>5]|=128<<24-i%32,r[(i+64>>>9<<4)+14]=t.floor(n/4294967296),r[(i+64>>>9<<4)+15]=n,e.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}}),e.SHA256=i._createHelper(u),e.HmacSHA256=i._createHmacHelper(u),e.SHA256},e.exports=n(r(39317))},26552:function(e,t,r){var n;n=function(e){var t,r,n,i,s,o,a,l,u,c,h;return t=Math,n=(r=e.lib).WordArray,i=r.Hasher,s=e.x64.Word,o=e.algo,a=[],l=[],u=[],function(){for(var e=1,t=0,r=0;r<24;r++){a[e+5*t]=(r+1)*(r+2)/2%64;var n=t%5,i=(2*e+3*t)%5;e=n,t=i}for(var e=0;e<5;e++)for(var t=0;t<5;t++)l[e+5*t]=t+(2*e+3*t)%5*5;for(var o=1,c=0;c<24;c++){for(var h=0,d=0,f=0;f<7;f++){if(1&o){var p=(1<<f)-1;p<32?d^=1<<p:h^=1<<p-32}128&o?o=o<<1^113:o<<=1}u[c]=s.create(h,d)}}(),c=[],function(){for(var e=0;e<25;e++)c[e]=s.create()}(),h=o.SHA3=i.extend({cfg:i.cfg.extend({outputLength:512}),_doReset:function(){for(var e=this._state=[],t=0;t<25;t++)e[t]=new s.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(e,t){for(var r=this._state,n=this.blockSize/2,i=0;i<n;i++){var s=e[t+2*i],o=e[t+2*i+1];s=(s<<8|s>>>24)&16711935|(s<<24|s>>>8)&4278255360,o=(o<<8|o>>>24)&16711935|(o<<24|o>>>8)&4278255360;var h=r[i];h.high^=o,h.low^=s}for(var d=0;d<24;d++){for(var f=0;f<5;f++){for(var p=0,g=0,y=0;y<5;y++){var h=r[f+5*y];p^=h.high,g^=h.low}var m=c[f];m.high=p,m.low=g}for(var f=0;f<5;f++)for(var v=c[(f+4)%5],b=c[(f+1)%5],w=b.high,_=b.low,p=v.high^(w<<1|_>>>31),g=v.low^(_<<1|w>>>31),y=0;y<5;y++){var h=r[f+5*y];h.high^=p,h.low^=g}for(var E=1;E<25;E++){var p,g,h=r[E],S=h.high,A=h.low,k=a[E];k<32?(p=S<<k|A>>>32-k,g=A<<k|S>>>32-k):(p=A<<k-32|S>>>64-k,g=S<<k-32|A>>>64-k);
53var C=c[l[E]];C.high=p,C.low=g}var I=c[0],x=r[0];I.high=x.high,I.low=x.low;for(var f=0;f<5;f++)for(var y=0;y<5;y++){var E=f+5*y,h=r[E],P=c[E],O=c[(f+1)%5+5*y],T=c[(f+2)%5+5*y];h.high=P.high^~O.high&T.high,h.low=P.low^~O.low&T.low}var h=r[0],R=u[d];h.high^=R.high,h.low^=R.low}},_doFinalize:function(){var e=this._data,r=e.words;this._nDataBytes;var i=8*e.sigBytes,s=32*this.blockSize;r[i>>>5]|=1<<24-i%32,r[(t.ceil((i+1)/s)*s>>>5)-1]|=128,e.sigBytes=4*r.length,this._process();for(var o=this._state,a=this.cfg.outputLength/8,l=a/8,u=[],c=0;c<l;c++){var h=o[c],d=h.high,f=h.low;d=(d<<8|d>>>24)&16711935|(d<<24|d>>>8)&4278255360,f=(f<<8|f>>>24)&16711935|(f<<24|f>>>8)&4278255360,u.push(f),u.push(d)}return new n.init(u,a)},clone:function(){for(var e=i.clone.call(this),t=e._state=this._state.slice(0),r=0;r<25;r++)t[r]=t[r].clone();return e}}),e.SHA3=i._createHelper(h),e.HmacSHA3=i._createHmacHelper(h),e.SHA3},e.exports=n(r(39317),r(66061))},42869:function(e,t,r){var n;n=function(e){var t,r,n,i,s,o;return r=(t=e.x64).Word,n=t.WordArray,s=(i=e.algo).SHA512,o=i.SHA384=s.extend({_doReset:function(){this._hash=new n.init([new r.init(3418070365,3238371032),new r.init(1654270250,914150663),new r.init(2438529370,812702999),new r.init(355462360,4144912697),new r.init(1731405415,4290775857),new r.init(2394180231,1750603025),new r.init(3675008525,1694076839),new r.init(1203062813,3204075428)])},_doFinalize:function(){var e=s._doFinalize.call(this);return e.sigBytes-=16,e}}),e.SHA384=s._createHelper(o),e.HmacSHA384=s._createHmacHelper(o),e.SHA384},e.exports=n(r(39317),r(66061),r(12427))},12427:function(e,t,r){var n;n=function(e){return function(){var t=e.lib.Hasher,r=e.x64,n=r.Word,i=r.WordArray,s=e.algo;function o(){return n.create.apply(n,arguments)}var a=[o(1116352408,3609767458),o(1899447441,602891725),o(3049323471,3964484399),o(3921009573,2173295548),o(961987163,4081628472),o(1508970993,3053834265),o(2453635748,2937671579),o(2870763221,3664609560),o(3624381080,2734883394),o(310598401,1164996542),o(607225278,1323610764),o(1426881987,3590304994),o(1925078388,4068182383),o(2162078206,991336113),o(2614888103,633803317),o(3248222580,3479774868),o(3835390401,2666613458),o(4022224774,944711139),o(264347078,2341262773),o(604807628,2007800933),o(770255983,1495990901),o(1249150122,1856431235),o(1555081692,3175218132),o(1996064986,2198950837),o(2554220882,3999719339),o(2821834349,766784016),o(2952996808,2566594879),o(3210313671,3203337956),o(3336571891,1034457026),o(3584528711,2466948901),o(113926993,3758326383),o(338241895,168717936),o(666307205,1188179964),o(773529912,1546045734),o(1294757372,1522805485),o(1396182291,2643833823),o(1695183700,2343527390),o(1986661051,1014477480),o(2177026350,1206759142),o(2456956037,344077627),o(2730485921,1290863460),o(2820302411,3158454273),o(3259730800,3505952657),o(3345764771,106217008),o(3516065817,3606008344),o(3600352804,1432725776),o(4094571909,1467031594),o(275423344,851169720),o(430227734,3100823752),o(506948616,1363258195),o(659060556,3750685593),o(883997877,3785050280),o(958139571,3318307427),o(1322822218,3812723403),o(1537002063,2003034995),o(1747873779,3602036899),o(1955562222,1575990012),o(2024104815,1125592928),o(2227730452,2716904306),o(2361852424,442776044),o(2428436474,593698344),o(2756734187,3733110249),o(3204031479,2999351573),o(3329325298,3815920427),o(3391569614,3928383900),o(3515267271,566280711),o(3940187606,3454069534),o(4118630271,4000239992),o(116418474,1914138554),o(174292421,2731055270),o(289380356,3203993006),o(460393269,320620315),o(685471733,587496836),o(852142971,1086792851),o(1017036298,365543100),o(1126000580,2618297676),o(1288033470,3409855158),o(1501505948,4234509866),o(1607167915,987167468),o(1816402316,1246189591)],l=[];!function(){for(var e=0;e<80;e++)l[e]=o()}();var u=s.SHA512=t.extend({_doReset:function(){this._hash=new i.init([new n.init(1779033703,4089235720),new n.init(3144134277,2227873595),new n.init(1013904242,4271175723),new n.init(2773480762,1595750129),new n.init(1359893119,2917565137),new n.init(2600822924,725511199),new n.init(528734635,4215389547),new n.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],s=r[2],o=r[3],u=r[4],c=r[5],h=r[6],d=r[7],f=n.high,p=n.low,g=i.high,y=i.low,m=s.high,v=s.low,b=o.high,w=o.low,_=u.high,E=u.low,S=c.high,A=c.low,k=h.high,C=h.low,I=d.high,x=d.low,P=f,O=p,T=g,R=y,N=m,D=v,B=b,M=w,L=_,U=E,j=S,F=A,q=k,H=C,z=I,$=x,V=0;V<80;V++){var W,G,K=l[V];if(V<16)G=K.high=0|e[t+2*V],W=K.low=0|e[t+2*V+1];else{var J=l[V-15],Y=J.high,Q=J.low,Z=(Y>>>1|Q<<31)^(Y>>>8|Q<<24)^Y>>>7,X=(Q>>>1|Y<<31)^(Q>>>8|Y<<24)^(Q>>>7|Y<<25),ee=l[V-2],et=ee.high,er=ee.low,en=(et>>>19|er<<13)^(et<<3|er>>>29)^et>>>6,ei=(er>>>19|et<<13)^(er<<3|et>>>29)^(er>>>6|et<<26),es=l[V-7],eo=es.high,ea=es.low,el=l[V-16],eu=el.high,ec=el.low;G=Z+eo+((W=X+ea)>>>0<X>>>0?1:0),W+=ei,G=G+en+(W>>>
530<ei>>>0?1:0),W+=ec,G=G+eu+(W>>>0<ec>>>0?1:0),K.high=G,K.low=W}var eh=L&j^~L&q,ed=U&F^~U&H,ef=P&T^P&N^T&N,ep=O&R^O&D^R&D,eg=(P>>>28|O<<4)^(P<<30|O>>>2)^(P<<25|O>>>7),ey=(O>>>28|P<<4)^(O<<30|P>>>2)^(O<<25|P>>>7),em=(L>>>14|U<<18)^(L>>>18|U<<14)^(L<<23|U>>>9),ev=(U>>>14|L<<18)^(U>>>18|L<<14)^(U<<23|L>>>9),eb=a[V],ew=eb.high,e_=eb.low,eE=$+ev,eS=z+em+(eE>>>0<$>>>0?1:0),eE=eE+ed,eS=eS+eh+(eE>>>0<ed>>>0?1:0),eE=eE+e_,eS=eS+ew+(eE>>>0<e_>>>0?1:0),eE=eE+W,eS=eS+G+(eE>>>0<W>>>0?1:0),eA=ey+ep,ek=eg+ef+(eA>>>0<ey>>>0?1:0);z=q,$=H,q=j,H=F,j=L,F=U,L=B+eS+((U=M+eE|0)>>>0<M>>>0?1:0)|0,B=N,M=D,N=T,D=R,T=P,R=O,P=eS+ek+((O=eE+eA|0)>>>0<eE>>>0?1:0)|0}p=n.low=p+O,n.high=f+P+(p>>>0<O>>>0?1:0),y=i.low=y+R,i.high=g+T+(y>>>0<R>>>0?1:0),v=s.low=v+D,s.high=m+N+(v>>>0<D>>>0?1:0),w=o.low=w+M,o.high=b+B+(w>>>0<M>>>0?1:0),E=u.low=E+U,u.high=_+L+(E>>>0<U>>>0?1:0),A=c.low=A+F,c.high=S+j+(A>>>0<F>>>0?1:0),C=h.low=C+H,h.high=k+q+(C>>>0<H>>>0?1:0),x=d.low=x+$,d.high=I+z+(x>>>0<$>>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[(n+128>>>10<<5)+30]=Math.floor(r/4294967296),t[(n+128>>>10<<5)+31]=r,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(u),e.HmacSHA512=t._createHmacHelper(u)}(),e.SHA512},e.exports=n(r(39317),r(66061))},77850:function(e,t,r){var n;n=function(e){return function(){var t=e.lib,r=t.WordArray,n=t.BlockCipher,i=e.algo,s=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],o=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],a=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],l
vendor: 7,629 bytes, line 53
53=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],
vendor: 2,578 bytes, line 53
53u=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],c=i.DES=n.extend({_doReset:function(){for(var e=this._key.words,t=[],r=0;r<56;r++){var n=s[r]-1;t[r]=e[n>>>5]>>>31-n%32&1}for(var i=this._subKeys=[],l=0;l<16;l++){for(var u=i[l]=[],c=a[l],r=0;r<24;r++)u[r/6|0]|=t[(o[r]-1+c)%28]<<31-r%6,u[4+(r/6|0)]|=t[28+(o[r+24]-1+c)%28]<<31-r%6;u[0]=u[0]<<1|u[0]>>>31;for(var r=1;r<7;r++)u[r]=u[r]>>>(r-1)*4+3;u[7]=u[7]<<5|u[7]>>>27}for(var h=this._invSubKeys=[],r=0;r<16;r++)h[r]=i[15-r]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,r){this._lBlock=e[t],this._rBlock=e[t+1],h.call(this,4,252645135),h.call(this,16,65535),d.call(this,2,858993459),d.call(this,8,16711935),h.call(this,1,1431655765);for(var n=0;n<16;n++){for(var i=r[n],s=this._lBlock,o=this._rBlock,a=0,c=0;c<8;c++)a|=l[c][((o^i[c])&u[c])>>>0];this._lBlock=o,this._rBlock=s^a}var f=this._lBlock;this._lBlock=this._rBlock,this._rBlock=f,h.call(this,1,1431655765),d.call(this,8,16711935),d.call(this,2,858993459),h.call(this,16,65535),h.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function h(e,t){var r=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=r,this._lBlock^=r<<e}function d(e,t){var r=(this._rBlock>>>e^this._lBlock)&t;this._lBlock^=r,this._rBlock^=r<<e}e.DES=n._createHelper(c);var f=i.TripleDES=n.extend({_doReset:function(){var e=this._key.words;if(2!==e.length&&4!==e.length&&e.length<6)throw Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var t=e.slice(0,2),n=e.length<4?e.slice(0,2):e.slice(2,4),i=e.length<6?e.slice(0,2):e.slice(4,6);this._des1=c.createEncryptor(r.create(t)),this._des2=c.createEncryptor(r.create(n)),this._des3=c.createEncryptor(r.create(i))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2});e.TripleDES=n._createHelper(f)}(),e.TripleDES},e.exports=n(r(39317),r(85925),r(96546),r(87579),r(90576))},66061:function(e,t,r){var n;n=function(e){var t,r,n,i;return r=(t=e.lib).Base,n=t.WordArray,(i=e.x64={}).Word=r.extend({init:function(e,t){this.high=e,this.low=t}}),i.WordArray=r.extend({init:function(e,t){e=this.words=e||[],void 0!=t?this.sigBytes=t:this.sigBytes=8*e.length},toX32:function(){for(var e=this.words,t=e.length,r=[],i=0;i<t;i++){var s=e[i];
53r.push(s.high),r.push(s.low)}return n.create(r,this.sigBytes)},clone:function(){for(var e=r.clone.call(this),t=e.words=this.words.slice(0),n=t.length,i=0;i<n;i++)t[i]=t[i].clone();return e}}),e},e.exports=n(r(39317))},55022:function(e,t,r){let n;var i=r(20357);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;let r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,i=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(n++,"%c"===e&&(i=n))}),t.splice(i,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&void 0!==i&&"env"in i&&(e=i.env.DEBUG),e},t.useColors=function(){return"undefined"!=typeof window&&!!window.process&&("renderer"===window.process.type||!!window.process.__nwjs)||!("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("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=(n=!1,()=>{n||(n=!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||(()=>{}),e.exports=r(11810)(t);let{formatters:s}=e.exports;s.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},11810:function(e,t,r){e.exports=function(e){function t(e){let r,i,s;let o=null;function a(...e){if(!a.enabled)return;let n=Number(new Date),i=n-(r||n);a.diff=i,a.prev=r,a.curr=n,r=n,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(r,n)=>{if("%%"===r)return"%";s++;let i=t.formatters[n];if("function"==typeof i){let t=e[s];r=i.call(a,t),e.splice(s,1),s--}return r}),t.formatArgs.call(a,e),(a.log||t.log).apply(a,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=n,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==o?o:(i!==t.namespaces&&(i=t.namespaces,s=t.enabled(e)),s),set:e=>{o=e}}),"function"==typeof t.init&&t.init(a),a}function n(e,r){let n=t(this.namespace+(void 0===r?":":r)+e);return n.log=this.log,n}function i(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){let e=[...t.names.map(i),...t.skips.map(i).map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){let r;t.save(e),t.namespaces=e,t.names=[],t.skips=[];let n=("string"==typeof e?e:"").split(/[\s,]+/),i=n.length;for(r=0;r<i;r++)n[r]&&("-"===(e=n[r].replace(/\*/g,".*?"))[0]?t.skips.push(RegExp("^"+e.slice(1)+"$")):t.names.push(RegExp("^"+e+"$")))},t.enabled=function(e){let r,n;if("*"===e[e.length-1])return!0;for(r=0,n=t.skips.length;r<n;r++)if(t.skips[r].test(e))return!1;for(r=0,n=t.names.length;r<n;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=r(44378),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(r=>{t[r]=e[r]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t)|0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t}},56368:function(e){"use strict";var t="%[a-f0-9]{2}",r=RegExp("("+t+")|([^%]+?)","gi"),n=RegExp("("+t+")+","gi");e.exports=function(e){if("string"!=typeof e)throw TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch(t){return function(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},i=n.exec(e);i;){try{t[i[0]]=decodeURIComponent(i[0])}catch(e){var s=function(e){try{return decodeURIComponent(e)}catch(i){for(var t=e.match(r)||[],n=1;n<t.length;n++)t=(e=(function e(t,r){try{return[decodeURIComponent(t.join(""))]}catch(e){}if(1===t.length)return t;r=r||1;var n=t.slice(0,r),i=t.slice(r);return Array.prototype.concat.call([],e(n),e(i))})(t,n).join("")).match(r)||[];return e}}(i[0]);s!==i[0]&&(t[i[0]]=s)}i=n.exec(e)}t["%C2"]="�";for(var o=Object.keys(t),a=0;a<o.length;a++){var l=o[a];e=e.replace(RegExp(l,"g"),t[l])}return e}(e)}}},93286:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esMo
53dule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseBlockTracker=void 0;let i=n(r(87893)),s=(e,t)=>e+t,o=["sync","latest"];class a extends i.default{constructor(e){super(),this._blockResetDuration=e.blockResetDuration||2e4,this._usePastBlocks=e.usePastBlocks||!1,this._currentBlock=null,this._isRunning=!1,this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}async destroy(){this._cancelBlockResetTimeout(),await this._maybeEnd(),super.removeAllListeners()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}async getLatestBlock(){return this._currentBlock?this._currentBlock:await new Promise(e=>this.once("latest",e))}removeAllListeners(e){return e?super.removeAllListeners(e):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener(),this}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(e){o.includes(e)&&this._maybeStart()}_onRemoveListener(){this._getBlockTrackerEventCount()>0||this._maybeEnd()}async _maybeStart(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),await this._start(),this.emit("_started"))}async _maybeEnd(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),await this._end(),this.emit("_ended"))}_getBlockTrackerEventCount(){return o.map(e=>this.listenerCount(e)).reduce(s)}_shouldUseNewBlock(e){let t=this._currentBlock;if(!t)return!0;let r=l(e),n=l(t);return this._usePastBlocks&&r<n||r>n}_newPotentialLatest(e){this._shouldUseNewBlock(e)&&this._setCurrentBlock(e)}_setCurrentBlock(e){let t=this._currentBlock;this._currentBlock=e,this.emit("latest",e),this.emit("sync",{oldBlock:t,newBlock:e})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){this._blockResetTimeout&&clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}}function l(e){return Number.parseInt(e,16)}t.BaseBlockTracker=a},48739:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PollingBlockTracker=void 0;let i=n(r(8728)),s=n(r(50167)),o=r(93286),a=r(75542),l=(0,a.createModuleLogger)(a.projectLogger,"polling-block-tracker"),u=(0,i.default)();class c extends o.BaseBlockTracker{constructor(e={}){var t;if(!e.provider)throw Error("PollingBlockTracker - no provider specified.");super(Object.assign(Object.assign({},e),{blockResetDuration:null!==(t=e.blockResetDuration)&&void 0!==t?t:e.pollingInterval})),this._provider=e.provider,this._pollingInterval=e.pollingInterval||2e4,this._retryTimeout=e.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=void 0===e.keepEventLoopActive||e.keepEventLoopActive,this._setSkipCacheFlag=e.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var e;this._isRunning;)try{await this._updateLatestBlock();let e=h(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await e}catch(n){let t=Error(`PollingBlockTracker - encountered an error while attempting to update latest block:
54${null!==(e=n.stack)&&void 0!==e?e:n}`);try{this.emit("error",t)}catch(e){console.error(t)}let r=h(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await r}}async _updateLatestBlock(){let e=await this._fetchLatestBlock();this._newPotentialLatest(e)}async _fetchLatestBlock(){let e={jsonrpc:"2.0",id:u(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(e.skipCache=!0),l("Making request",e);let t=await (0,s.default)(t=>this._provider.sendAsync(e,t))();if(l("Got response",t),t.error)throw Error(`PollingBlockTracker - encountered error fetching block:
55${t.error.message}`);return t.result}}function h(e,t){return new Promise(r=>{let n=setTimeout(r,e);n.unref&&t&&n.unref()})}t.PollingBlockTracker=c},70652:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esMo
55dule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.SubscribeBlockTracker=void 0;let i=n(r(8728)),s=r(93286),o=(0,i.default)();class a extends s.BaseBlockTracker{constructor(e={}){if(!e.provider)throw Error("SubscribeBlockTracker - no provider specified.");super(e),this._provider=e.provider,this._subscriptionId=null}async checkForLatestBlock(){return await this.getLatestBlock()}async _start(){if(void 0===this._subscriptionId||null===this._subscriptionId)try{let e=await this._call("eth_blockNumber");this._subscriptionId=await this._call("eth_subscribe","newHeads"),this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(e)}catch(e){this.emit("error",e)}}async _end(){if(null!==this._subscriptionId&&void 0!==this._subscriptionId)try{await this._call("eth_unsubscribe",this._subscriptionId),this._subscriptionId=null}catch(e){this.emit("error",e)}}_call(e,...t){return new Promise((r,n)=>{this._provider.sendAsync({id:o(),method:e,params:t,jsonrpc:"2.0"},(e,t)=>{e?n(e):r(t.result)})})}_handleSubData(e,t){var r;"eth_subscription"===t.method&&(null===(r=t.params)||void 0===r?void 0:r.subscription)===this._subscriptionId&&this._newPotentialLatest(t.params.result.number)}}t.SubscribeBlockTracker=a},15951:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(48739),t),i(r(70652),t)},75542:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createModuleLogger=t.projectLogger=void 0;let n=r(99153);Object.defineProperty(t,"createModuleLogger",{enumerable:!0,get:function(){return n.createModuleLogger}}),t.projectLogger=(0,n.createProjectLogger)("eth-block-tracker")},50167:function(e){"use strict";let t=(e,t)=>function(){let r=t.promiseModule,n=Array(arguments.length);for(let e=0;e<arguments.length;e++)n[e]=arguments[e];return new r((r,i)=>{t.errorFirst?n.push(function(e,n){if(t.multiArgs){let t=Array(arguments.length-1);for(let e=1;e<arguments.length;e++)t[e-1]=arguments[e];e?(t.unshift(e),i(t)):r(t)}else e?i(e):r(n)}):n.push(function(e){if(t.multiArgs){let e=Array(arguments.length-1);for(let t=0;t<arguments.length;t++)e[t]=arguments[t];r(e)}else r(e)}),e.apply(this,n)})};e.exports=(e,r)=>{let n;r=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},r);let i=e=>{let t=t=>"string"==typeof t?e===t:t.test(e);return r.include?r.include.some(t):!r.exclude.some(t)};for(let s in n="function"==typeof e?function(){return r.excludeMain?e.apply(this,arguments):t(e,r).apply(this,arguments)}:Object.create(Object.getPrototypeOf(e)),e){let o=e[s];n[s]="function"==typeof o&&i(s)?t(o,r):o}return n}},87530:function(e,t,r){let n=r(92224);class i extends n{constructor(){super(),this.allResults=[]}async update(){throw Error("BaseFilterWithHistory - no update method specified")}addResults(e){this.allResults=this.allResults.concat(e),super.addResults(e)}addInitialResults(e){this.allResults=this.allResults.concat(e),super.addInitialResults(e)}getAllResults(){return this.allResults}}e.exports=i},92224:function(e,t,r){let n=r(87893).default;class i extends n{constructor(){super(),this.updates=[]}async initialize(){}async update(){throw Error("BaseFilter - no update method specified")}addResults(e){this.updates=this.updates.concat(e),e.forEach(e=>this.emit("update",e))}addInitialResults(e){}getChangesAndClear(){let e=this.updates;return this.updates=[],e}}e.exports=i},39907:function(e,t,r){let n=r(92224),i=r(57495),{incrementHexInt:s}=r(25789);class o extends n{constructor({provider:e,params:t}){super(),this.type="block",this.provider=e}async update({oldBlock:e,newBlock:t}){let r=s(e),n=(await i({provider:this.provider,fromBlock:r,toBlock:t})).map(e=>e.hash);this.addResults(n)}}e.exports=o},57495:function(e){async function t({provider:e,fromBlock:t,toBlock:s}){t||(t=s);
55let o=r(t),a=Array(r(s)-o+1).fill().map((e,t)=>o+t).map(n);return(await Promise.all(a.map(t=>i(e,"eth_getBlockByNumber",[t,!1])))).filter(e=>null!==e)}function r(e){return null==e?e:Number.parseInt(e,16)}function n(e){return null==e?e:"0x"+e.toString(16)}async function i(e,t,r){for(let n=0;n<3;n++)try{return await function(e,t){return new Promise((r,n)=>{e.sendAsync(t,(e,t)=>{e?n(e):t.error?n(t.error):t.result?r(t.result):n(Error("Result was empty"))})})}(e,{id:1,jsonrpc:"2.0",method:t,params:r})}catch(e){console.error(`provider.sendAsync failed: ${e.stack||e.message||e}`)}return null}e.exports=t},25789:function(e){function t(e){return e.sort((e,t)=>"latest"===e||"earliest"===t?1:"latest"===t||"earliest"===e?-1:r(e)-r(t))}function r(e){return null==e?e:Number.parseInt(e,16)}function n(e){if(null==e)return e;let t=e.toString(16);return t.length%2&&(t="0"+t),"0x"+t}function i(){return Math.floor(16*Math.random()).toString(16)}e.exports={minBlockRef:function(...e){return t(e)[0]},maxBlockRef:function(...e){let r=t(e);return r[r.length-1]},sortBlockRefs:t,bnToHex:function(e){return"0x"+e.toString(16)},blockRefIsNumber:function(e){return e&&!["earliest","latest","pending"].includes(e)},hexToInt:r,incrementHexInt:function(e){return null==e?e:n(r(e)+1)},intToHex:n,unsafeRandomBytes:function(e){let t="0x";for(let r=0;r<e;r++)t+=i()+i();return t}}},50755:function(e,t,r){let n=r(49715).WU,{createAsyncMiddleware:i,createScaffoldMiddleware:s}=r(47845),o=r(81116),a=r(39907),l=r(6373),{intToHex:u,hexToInt:c}=r(25789);function h(e){return d(async(...t)=>u((await e(...t)).id))}function d(e){return i(async(t,r)=>{let n=await e.apply(null,t.params);r.result=n})}function f(e,t){let r=[];for(let t in e)r.push(e[t]);return r}e.exports=function({blockTracker:e,provider:t}){let r=0,i={},p=new n,g=function({mutex:e}){return t=>async(r,n,i,s)=>{(await e.acquire())(),t(r,n,i,s)}}({mutex:p}),y=s({eth_newFilter:g(h(v)),eth_newBlockFilter:g(h(b)),eth_newPendingTransactionFilter:g(h(w)),eth_uninstallFilter:g(d(S)),eth_getFilterChanges:g(d(_)),eth_getFilterLogs:g(d(E))}),m=async({oldBlock:e,newBlock:t})=>{if(0===i.length)return;let r=await p.acquire();try{await Promise.all(f(i).map(async r=>{try{await r.update({oldBlock:e,newBlock:t})}catch(e){console.error(e)}}))}catch(e){console.error(e)}r()};return y.newLogFilter=v,y.newBlockFilter=b,y.newPendingTransactionFilter=w,y.uninstallFilter=S,y.getFilterChanges=_,y.getFilterLogs=E,y.destroy=()=>{C()},y;async function v(e){let r=new o({provider:t,params:e});return await A(r),r}async function b(){let e=new a({provider:t});return await A(e),e}async function w(){let e=new l({provider:t});return await A(e),e}async function _(e){let t=c(e),r=i[t];if(!r)throw Error(`No filter for index "${t}"`);return r.getChangesAndClear()}async function E(e){let t=c(e),r=i[t];if(!r)throw Error(`No filter for index "${t}"`);let n=[];return"log"===r.type&&(n=r.getAllResults()),n}async function S(e){let t=c(e),r=!!i[t];return r&&await k(t),r}async function A(t){let n=f(i).length,s=await e.getLatestBlock();return await t.initialize({currentBlock:s}),i[++r]=t,t.id=r,t.idHex=u(r),I({prevFilterCount:n,newFilterCount:f(i).length}),r}async function k(e){let t=f(i).length;delete i[e],I({prevFilterCount:t,newFilterCount:f(i).length})}async function C(){let e=f(i).length;i={},I({prevFilterCount:e,newFilterCount:0})}function I({prevFilterCount:t,newFilterCount:r}){if(0===t&&r>0){e.on("sync",m);return}if(t>0&&0===r){e.removeListener("sync",m);return}}}},81116:function(e,t,r){let n=r(88614),i=r(82116),s=r(87530),{bnToHex:o,hexToInt:a,incrementHexInt:l,minBlockRef:u,blockRefIsNumber:c}=r(25789);class h extends s{constructor({provider:e,params:t}){super(),this.type="log",this.ethQuery=new n(e),this.params=Object.assign({fromBlock:"latest",toBlock:"latest",address:void 0,topics:[]},t),this.params.address&&(Array.isArray(this.params.address)||(this.params.address=[this.params.address]),this.params.address=this.params.address.map(e=>e.toLowerCase()))}async initialize({currentBlock:e}){let t=this.params.fromBlock;["latest","pending"].includes(t)&&(t=e),"earliest"===t&&(t="0x0"),this.params.fromBlock=t;let r=u(this.params.toBlock,e),n=Object.assign({},this.params,{toBlock:r}),i=await this._fetchLogs(n);this.addInitialResults(i)}async update({oldBlock:e,newBlock:t}){let r;r=e?l(e):t;let n=Object.assign({},this.params,{fromBlock:r,toBlock:t}),i=(await this._fetchLogs(n)).filter(e=>this.matchLog(e));this.addResults(i)}async _fetchLogs(e){return await i(t=>this.ethQuery.getLogs(e,t))()}matchLog(e){if(a(this.params.fromBlock)>=a(e.blockNumber)||c(this.params.toBlock)&&a(this.params.toBlock)<=a(e.blockNumber))return!1;let t=e.address&&e.address.toLowerCase();return(!this.params.address||!t||!!this.params.address.includes(t))&&this.params.topics.every((t,r)=>{let n=e.topics[r];if(!n)return!1;n=n.toLowerCase();let i=Array.isArray(t)?t:[t];return!!i.includes(null)||(i=i.map(e=>e.toLowerCase())).includes(n)})}}e.exports=h},82116:function(e){"use strict";let t=(e,t,r,n)=>function(...i){return new t.promiseModule((s,o)=>{t.multiArgs?i.push((...e)=>{t.errorFirst?e[0]?o(e):(e.shift(),s(e)):s(e)}):t.errorFirst?i.push((e,t)=>{e?o(e):s(t)}):i.push(s),Reflect.apply(e,this===r?n:this,i)})},r=new WeakMap;e.exports=(e,n)=>{n={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...n};let i=typeof e;if(!(null!==e&&("object"===i||"function"===i)))throw TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${null===e?"null":i}\``);let s=(e,t)=>{let i=r.get(e);if(i||(i={}
55,r.set(e,i)),t in i)return i[t];let s=e=>"string"==typeof e||"symbol"==typeof t?t===e:e.test(t),o=Reflect.getOwnPropertyDescriptor(e,t),a=void 0===o||o.writable||o.configurable,l=(n.include?n.include.some(s):!n.exclude.some(s))&&a;return i[t]=l,l},o=new WeakMap,a=new Proxy(e,{apply(e,r,i){let s=o.get(e);if(s)return Reflect.apply(s,r,i);let l=n.excludeMain?e:t(e,n,a,e);return o.set(e,l),Reflect.apply(l,r,i)},get(e,r){let i=e[r];if(!s(e,r)||i===Function.prototype[r])return i;let l=o.get(i);if(l)return l;if("function"==typeof i){let r=t(i,n,a,e);return o.set(i,r),r}return i}});return a}},23617:function(e,t,r){let n=r(87893).default,{createAsyncMiddleware:i,createScaffoldMiddleware:s}=r(47845),o=r(50755),{unsafeRandomBytes:a,incrementHexInt:l}=r(25789),u=r(57495);function c(e){return null==e?null:{hash:e.hash,parentHash:e.parentHash,sha3Uncles:e.sha3Uncles,miner:e.miner,stateRoot:e.stateRoot,transactionsRoot:e.transactionsRoot,receiptsRoot:e.receiptsRoot,logsBloom:e.logsBloom,difficulty:e.difficulty,number:e.number,gasLimit:e.gasLimit,gasUsed:e.gasUsed,nonce:e.nonce,mixHash:e.mixHash,timestamp:e.timestamp,extraData:e.extraData}}e.exports=function({blockTracker:e,provider:t}){let r={},h=o({blockTracker:e,provider:t}),d=!1,f=new n,p=s({eth_subscribe:i(g),eth_unsubscribe:i(y)});return p.destroy=function(){for(let e in f.removeAllListeners(),r)r[e].destroy(),delete r[e];d=!0},{events:f,middleware:p};async function g(n,i){let s;if(d)throw Error("SubscriptionManager - attempting to use after destroying");let o=n.params[0],f=a(16);switch(o){case"newHeads":s=function({subId:r}){let n={type:o,destroy:async()=>{e.removeListener("sync",n.update)},update:async({oldBlock:e,newBlock:n})=>{let i=l(e);(await u({provider:t,fromBlock:i,toBlock:n})).map(c).filter(e=>null!==e).forEach(e=>{m(r,e)})}};return e.on("sync",n.update),n}({subId:f});break;case"logs":let p=n.params[1];s=function({subId:e,filter:t}){return t.on("update",t=>m(e,t)),{type:o,destroy:async()=>await h.uninstallFilter(t.idHex)}}({subId:f,filter:await h.newLogFilter(p)});break;default:throw Error(`SubscriptionManager - unsupported subscription type "${o}"`)}r[f]=s,i.result=f}async function y(e,t){if(d)throw Error("SubscriptionManager - attempting to use after destroying");let n=e.params[0],i=r[n];if(!i){t.result=!1;return}delete r[n],await i.destroy(),t.result=!0}function m(e,t){f.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:e,result:t}})}}},6373:function(e,t,r){let n=r(92224),i=r(57495),{incrementHexInt:s}=r(25789);class o extends n{constructor({provider:e}){super(),this.type="tx",this.provider=e}async update({oldBlock:e}){let t=s(e),r=await i({provider:this.provider,fromBlock:t,toBlock:e}),n=[];for(let e of r)n.push(...e.transactions);this.addResults(n)}}e.exports=o},88614:function(e,t,r){let n=r(44924),i=r(8728)();function s(e){this.currentProvider=e}function o(e){return function(){var t=[].slice.call(arguments),r=t.pop();this.sendAsync({method:e,params:t},r)}}function a(e,t){return function(){var r=[].slice.call(arguments),n=r.pop();r.length<e&&r.push("latest"),this.sendAsync({method:t,params:r},n)}}e.exports=s,s.prototype.getBalance=a(2,"eth_getBalance"),s.prototype.getCode=a(2,"eth_getCode"),s.prototype.getTransactionCount=a(2,"eth_getTransactionCount"),s.prototype.getStorageAt=a(3,"eth_getStorageAt"),s.prototype.call=a(2,"eth_call"),s.prototype.protocolVersion=o("eth_protocolVersion"),s.prototype.syncing=o("eth_syncing"),s.prototype.coinbase=o("eth_coinbase"),s.prototype.mining=o("eth_mining"),s.prototype.hashrate=o("eth_hashrate"),s.prototype.gasPrice=o("eth_gasPrice"),s.prototype.accounts=o("eth_accounts"),s.prototype.blockNumber=o("eth_blockNumber"),s.prototype.getBlockTransactionCountByHash=o("eth_getBlockTransactionCountByHash"),s.prototype.getBlockTransactionCountByNumber=o("eth_getBlockTransactionCountByNumber"),s.prototype.getUncleCountByBlockHash=o("eth_getUncleCountByBlockHash"),s.prototype.getUncleCountByBlockNumber=o("eth_getUncleCountByBlockNumber"),s.prototype.sign=o("eth_sign"),s.prototype.sendTransaction=o("eth_sendTransaction"),s.prototype.sendRawTransaction=o("eth_sendRawTransaction"),s.prototype.estimateGas=o("eth_estimateGas"),s.prototype.getBlockByHash=o("eth_getBlockByHash"),s.prototype.getBlockByNumber=o("eth_getBlockByNumber"),s.prototype.getTransactionByHash=o("eth_getTransactionByHash"),s.prototype.getTransactionByBlockHashAndIndex=o("eth_getTransactionByBlockHashAndIndex"),s.prototype.getTransactionByBlockNumberAndIndex=o("eth_getTransactionByBlockNumberAndIndex"),s.prototype.getTransactionReceipt=o("eth_getTransactionReceipt"),s.prototype.getUncleByBlockHashAndIndex=o("eth_getUncleByBlockHashAndIndex"),s.prototype.getUncleByBlockNumberAndIndex=o("eth_getUncleByBlockNumberAndIndex"),s.prototype.getCompilers=o("eth_getCompilers"),s.prototype.compileLLL=o("eth_compileLLL"),s.prototype.compileSolidity=o("eth_compileSolidity"),s.prototype.compileSerpent=o("eth_compileSerpent"),s.prototype.newFilter=o("eth_newFilter"),s.prototype.newBlockFilter=o("eth_newBlockFilter"),s.prototype.newPendingTransactionFilter=o("eth_newPendingTransactionFilter"),s.prototype.uninstallFilter=o("eth_uninstallFilter"),s.prototype.getFilterChanges=o("eth_getFilterChanges"),s.prototype.getFilterLogs=o("eth_getFilterLogs"),s.prototype.getLogs=o("eth_getLogs"),s.prototype.getWork=o("eth_getWork"),s.prototype.submitWork=o("eth_submitWork"),s.prototype.submitHashrate=o("eth_submitHashrate"),s.prototype.sendAsync=function(e,t){this.currentProvider.sendAsync(n({id:i(),jsonrpc:"2.0",params:[]},e),function(e,r){if(!e&&r.error&&(e=Error("EthQuery - RPC Error - "+r.error.message)),e)return t(e);t(null,r.result)})}},12456:function(e,t,r){"use strict";
55Object.defineProperty(t,"__esModule",{value:!0}),t.EthereumProviderError=t.EthereumRpcError=void 0;let n=r(98794);class i extends Error{constructor(e,t,r){if(!Number.isInteger(e))throw Error('"code" must be an integer.');if(!t||"string"!=typeof t)throw Error('"message" must be a nonempty string.');super(t),this.code=e,void 0!==r&&(this.data=r)}serialize(){let e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data),this.stack&&(e.stack=this.stack),e}toString(){return n.default(this.serialize(),o,2)}}t.EthereumRpcError=i;class s extends i{constructor(e,t,r){if(!(Number.isInteger(e)&&e>=1e3&&e<=4999))throw Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,r)}}function o(e,t){if("[Circular]"!==t)return t}t.EthereumProviderError=s},70497: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."}}},31370:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ethErrors=void 0;let n=r(12456),i=r(63356),s=r(70497);function o(e,t){let[r,s]=l(t);return new n.EthereumRpcError(e,r||i.getMessageFromCode(e),s)}function a(e,t){let[r,s]=l(t);return new n.EthereumProviderError(e,r||i.getMessageFromCode(e),s)}function l(e){if(e){if("string"==typeof e)return[e];if("object"==typeof e&&!Array.isArray(e)){let{message:t,data:r}=e;if(t&&"string"!=typeof t)throw Error("Must specify string message.");return[t||void 0,r]}}return[]}t.ethErrors={rpc:{parse:e=>o(s.errorCodes.rpc.parse,e),invalidRequest:e=>o(s.errorCodes.rpc.invalidRequest,e),invalidParams:e=>o(s.errorCodes.rpc.invalidParams,e),methodNotFound:e=>o(s.errorCodes.rpc.methodNotFound,e),internal:e=>o(s.errorCodes.rpc.internal,e),server:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw Error("Ethereum RPC Server errors must provide single object argument.");let{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw Error('"code" must be an integer such that: -32099 <= code 
55<= -32005');return o(t,e)},invalidInput:e=>o(s.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>o(s.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>o(s.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>o(s.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>o(s.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>o(s.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>a(s.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>a(s.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>a(s.errorCodes.provider.unsupportedMethod,e),disconnected:e=>a(s.errorCodes.provider.disconnected,e),chainDisconnected:e=>a(s.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw Error("Ethereum Provider custom errors must provide single object argument.");let{code:t,message:r,data:i}=e;if(!r||"string"!=typeof r)throw Error('"message" must be a nonempty string');return new n.EthereumProviderError(t,r,i)}}}},98215:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getMessageFromCode=t.serializeError=t.EthereumProviderError=t.EthereumRpcError=t.ethErrors=t.errorCodes=void 0;let n=r(12456);Object.defineProperty(t,"EthereumRpcError",{enumerable:!0,get:function(){return n.EthereumRpcError}}),Object.defineProperty(t,"EthereumProviderError",{enumerable:!0,get:function(){return n.EthereumProviderError}});let i=r(63356);Object.defineProperty(t,"serializeError",{enumerable:!0,get:function(){return i.serializeError}}),Object.defineProperty(t,"getMessageFromCode",{enumerable:!0,get:function(){return i.getMessageFromCode}});let s=r(31370);Object.defineProperty(t,"ethErrors",{enumerable:!0,get:function(){return s.ethErrors}});let o=r(70497);Object.defineProperty(t,"errorCodes",{enumerable:!0,get:function(){return o.errorCodes}})},63356:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.serializeError=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;let n=r(70497),i=r(12456),s=n.errorCodes.rpc.internal,o={code:s,message:a(s)};function a(e,r="Unspecified error message. This is a bug, please report it."){if(Number.isInteger(e)){let r=e.toString();if(c(n.errorValues,r))return n.errorValues[r].message;if(e>=-32099&&e<=-32e3)return t.JSON_RPC_SERVER_ERROR_MESSAGE}return r}function l(e){if(!Number.isInteger(e))return!1;let t=e.toString();return!!(n.errorValues[t]||e>=-32099&&e<=-32e3)}function u(e){return e&&"object"==typeof e&&!Array.isArray(e)?Object.assign({},e):e}function c(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",t.getMessageFromCode=a,t.isValidCode=l,t.serializeError=function(e,{fallbackError:t=o,shouldIncludeStack:r=!1}={}){if(!t||!Number.isInteger(t.code)||"string"!=typeof t.message)throw Error("Must provide fallback error with integer number code and string message.");if(e instanceof i.EthereumRpcError)return e.serialize();let n={};if(e&&"object"==typeof e&&!Array.isArray(e)&&c(e,"code")&&l(e.code))n.code=e.code,e.message&&"string"==typeof e.message?(n.message=e.message,c(e,"data")&&(n.data=e.data)):(n.message=a(n.code),n.data={originalError:u(e)});else{n.code=t.code;let r=null==e?void 0:e.message;n.message=r&&"string"==typeof r?r:t.message,n.data={originalError:u(e)}}let s=null==e?void 0:e.stack;return r&&e&&s&&"string"==typeof s&&(n.stack=s),n}},68885:function(e){"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise(function(r,n){var i;function s(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",s),r([].slice.call(arguments))}g(e,t,o,{once:!0}),"error"!==t&&(i={once:!0},"function"==typeof e.on&&g(e,"error",s,i))})},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function a(e){if("function"!=typeof e)throw TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function u(e,t,r,n){if(a(r),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),s=e._events),o=s[t]),void 0===o)o=s[t]=r,++e._eventsCount;else if("function"==typeof o?o=s[t]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),(i=l(e))>0&&o.length>i&&!o.warned){o.warned=!0;var i,s,o,u=Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=o.length,console&&console.warn&&console.warn(u)}return e}function c(){if(!this.fired)return(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0==arguments.length)?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=c.bind(n);return i.listener=r,n.wrapFn=i,i}function d(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):p(i,i.length)}function f(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(e,t){for(var r=Array(t),n=0;n<t;++n)r[n]=e[n];return r}function g(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else if("function"==typeof e.addEventListener)e.addEventListener(t,function i(s){n.once&&e.removeEventListener(t,i),r(s)});else throw TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return o}
55,set:function(e){if("number"!=typeof e||e<0||i(e))throw RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");o=e}}),s.init=function(){(void 0===this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return l(this)},s.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,s=this._events;if(void 0!==s)i=i&&void 0===s.error;else if(!i)return!1;if(i){if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var o,a=Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var l=s[e];if(void 0===l)return!1;if("function"==typeof l)n(l,this,t);else for(var u=l.length,c=p(l,u),r=0;r<u;++r)n(c[r],this,t);return!0},s.prototype.addListener=function(e,t){return u(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return u(this,e,t,!0)},s.prototype.once=function(e,t){return a(t),this.on(e,h(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,h(this,e,t)),this},s.prototype.removeListener=function(e,t){var r,n,i,s,o;if(a(t),void 0===(n=this._events)||void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,s=r.length-1;s>=0;s--)if(r[s]===t||r[s].listener===t){o=r[s].listener,i=s;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,o||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0==arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0==arguments.length){var i,s=Object.keys(r);for(n=0;n<s.length;++n)"removeListener"!==(i=s[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},s.prototype.listeners=function(e){return d(this,e,!0)},s.prototype.rawListeners=function(e){return d(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},s.prototype.listenerCount=f,s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},98794:function(e){e.exports=o,o.default=o,o.stable=u,o.stableStringify=u;var t="[...]",r="[Circular]",n=[],i=[];function s(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function o(e,o,l,u){void 0===u&&(u=s()),function e(n,i,s,o,l,u,c){if(u+=1,"object"==typeof n&&null!==n){for(h=0;h<o.length;h++)if(o[h]===n){a(r,n,i,l);return}if(void 0!==c.depthLimit&&u>c.depthLimit||void 0!==c.edgesLimit&&s+1>c.edgesLimit){a(t,n,i,l);return}if(o.push(n),Array.isArray(n))for(h=0;h<n.length;h++)e(n[h],h,h,o,n,u,c);else{var h,d=Object.keys(n);for(h=0;h<d.length;h++){var f=d[h];e(n[f],f,h,o,n,u,c)}}o.pop()}}(e,"",0,[],void 0,0,u);try{h=0===i.length?JSON.stringify(e,o,l):JSON.stringify(e,c(o),l)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==n.length;){var h,d=n.pop();4===d.length?Object.defineProperty(d[0],d[1],d[3]):d[0][d[1]]=d[2]}}return h}function a(e,t,r,s){var o=Object.getOwnPropertyDescriptor(s,r);void 0!==o.get?o.configurable?(Object.defineProperty(s,r,{value:e}),n.push([s,r,t,o])):i.push([t,r,e]):(s[r]=e,n.push([s,r,t]))}function l(e,t){return e<t?-1:e>t?1:0}function u(e,o,u,h){void 0===h&&(h=s());var d,f=function e(i,s,o,u,c,h,d){if(h+=1,"object"==typeof i&&null!==i){for(f=0;f<u.length;f++)if(u[f]===i){a(r,i,s,c);return}try{if("function"==typeof i.toJSON)return}catch(e){return}if(void 0!==d.depthLimit&&h>d.depthLimit||void 0!==d.edgesLimit&&o+1>d.edgesLimit){a(t,i,s,c);return}if(u.push(i),Array.isArray(i))for(f=0;f<i.length;f++)e(i[f],f,f,u,i,h,d);else{var f,p={},g=Object.keys(i).sort(l);for(f=0;f<g.length;f++){var y=g[f];e(i[y],y,f,u,i,h,d),p[y]=i[y]}if(void 0===c)return p;n.push([c,s,i]),c[s]=p}u.pop()}}(e,"",0,[],void 0,0,h)||e;try{d=0===i.length?JSON.stringify(f,o,u):JSON.stringify(f,c(o),u)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==n.length;){var p=n.pop();4===p.length?Object.defineProperty(p[0],p[1],p[3]):p[0][p[1]]=p[2]}}return d}function c(e){return e=void 0!==e?e:function(e,t){return t},function(t,r){if(i.length>0)for(var n=0;n<i.length;n++){var s=i[n];if(s[1]===t&&s[0]===r){r=s[2],i.splice(n,1);break}}return e.call(this,t,r)}}},24816:function(e){"use strict";e.exports=function(e,t){for(var r={},n=Object.keys(e),i=Array.isArray(t),s=0;s<n.length;s++){var o=n[s],a=e[o];(i?-1!==t.indexOf(o):t(o,a,e))&&(r[o]=a)}return r}},53733:function(e,t,r){"use strict";let n=r(3538).v4,i=r(62309),s=function(e,t){if(!(this instanceof s))return new s(e,t);t||(t={}),this.options={reviver:void 0!==t.reviver?t.reviver:null,replacer:void 0!==t.replacer?t.replacer:null,generator:void 0!==t.generator?t.generator:function(){return n()},version:void 0!==t.version?t.version:2,notificationIdNull:"boolean"==typeof t.notificationIdNull&&t.notificationIdNull},this.callServer=e};e.exports=s,s.prototype.request=function(e,t,r,n){let s;let o=this,a=null,l=Array.isArray(e)&&"function"==typeof t;if(1===this.options.version&&l)throw TypeError("JSON-RPC 1.0 does not support batching");let u=!l&&e&&"object"==typeof e&&"function"==typeof t;if(l||u)n=t,a=e;else{"function"==typeof r&&(n=r,r=void 0);let s="function"==typeof n;try{a=i(e,t,r,{generator:this.options.generator,version:this.options.version,notificationIdNull:this.options.notificationIdNull})}catch(e){if(s)return n(e);throw e}if(!s)return a}try{s=JSON.stringify(a,this.options.replacer)}catch(e){return n(e)}return this.callServer(s,function(e,t){o._parseResponse(e,t,n)}),a},s.prototype._parseResponse=function(e,t,r){let n;if(e){r(e);return}if(!t)return r();try{n=JSON.parse(t,this.options.reviver)}catch(e){return r(e)}if(3===r.length){if(!Array.isArray(n))return r(null,n.error,n.result);{let e=function(e){return void 0!==e.error};return r(null,n.filter(e),n.filter(function(t){return!e(t)}))}}r(null,n)}},62309:function(e,t,r){"use strict";let n=r(3538).v4;e.exports=function(e,t,r,i){if("string"!=typeof e)throw TypeError(e+" must be a string");let s="number"==typeof(i=i||{}).version?i.version:2;if(1!==s&&2!==s)throw TypeError(s+" must be 1 or 2");let o={method:e};if(2===s&&(o.jsonrpc="2.0"),t){if("object"!=typeof t&&!Array.isArray(t))throw TypeError(t+" must be an object, array or omitted");o.params=t}if(void 0===r){let e="function"==typeof i.generator?i.generator:function(){return n()};o.id=e(o,i)}else 2===s&&null===r?i.notificationIdNull&&(o.id=null):o.id=r;return o}},19930:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esMo
55dule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.JsonRpcEngine=void 0;let i=n(r(90194)),s=r(98215);class o extends i.default{constructor(){super(),this._middleware=[]}push(e){this._middleware.push(e)}handle(e,t){if(t&&"function"!=typeof t)throw Error('"callback" must be a function if provided.');return Array.isArray(e)?t?this._handleBatch(e,t):this._handleBatch(e):t?this._handle(e,t):this._promiseHandle(e)}asMiddleware(){return async(e,t,r,n)=>{try{let[i,s,a]=await o._runAllMiddleware(e,t,this._middleware);if(s)return await o._runReturnHandlers(a),n(i);return r(async e=>{try{await o._runReturnHandlers(a)}catch(t){return e(t)}return e()})}catch(e){return n(e)}}}async _handleBatch(e,t){try{let r=await Promise.all(e.map(this._promiseHandle.bind(this)));if(t)return t(null,r);return r}catch(e){if(t)return t(e);throw e}}_promiseHandle(e){return new Promise(t=>{this._handle(e,(e,r)=>{t(r)})})}async _handle(e,t){if(!e||Array.isArray(e)||"object"!=typeof e){let r=new s.EthereumRpcError(s.errorCodes.rpc.invalidRequest,`Requests must be plain objects. Received: ${typeof e}`,{request:e});return t(r,{id:void 0,jsonrpc:"2.0",error:r})}if("string"!=typeof e.method){let r=new s.EthereumRpcError(s.errorCodes.rpc.invalidRequest,`Must specify a string method. Received: ${typeof e.method}`,{request:e});return t(r,{id:e.id,jsonrpc:"2.0",error:r})}let r=Object.assign({},e),n={id:r.id,jsonrpc:r.jsonrpc},i=null;try{await this._processRequest(r,n)}catch(e){i=e}return i&&(delete n.result,n.error||(n.error=s.serializeError(i))),t(i,n)}async _processRequest(e,t){let[r,n,i]=await o._runAllMiddleware(e,t,this._middleware);if(o._checkForCompletion(e,t,n),await o._runReturnHandlers(i),r)throw r}static async _runAllMiddleware(e,t,r){let n=[],i=null,s=!1;for(let a of r)if([i,s]=await o._runMiddleware(e,t,a,n),s)break;return[i,s,n.reverse()]}static _runMiddleware(e,t,r,n){return new Promise(i=>{let o=e=>{let r=e||t.error;r&&(t.error=s.serializeError(r)),i([r,!0])};try{r(e,t,r=>{t.error?o(t.error):(r&&("function"!=typeof r&&o(new s.EthereumRpcError(s.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof r}" for request:
56${a(e)}`,{request:e})),n.push(r)),i([null,!1]))},o)}catch(e){o(e)}})}static async _runReturnHandlers(e){for(let t of e)await new Promise((e,r)=>{t(t=>t?r(t):e())})}static _checkForCompletion(e,t,r){if(!("result"in t)&&!("error"in t))throw new s.EthereumRpcError(s.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request:
57${a(e)}`,{request:e});if(!r)throw new s.EthereumRpcError(s.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request:
58${a(e)}`,{request:e})}}function a(e){return JSON.stringify(e,null,2)}t.JsonRpcEngine=o},77914:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAsyncMiddleware=void 0,t.createAsyncMiddleware=function(e){return async(t,r,n,i)=>{let s;let o=new Promise(e=>{s=e}),a=null,l=!1,u=async()=>{l=!0,n(e=>{a=e,s()}),await o};try{await e(t,r,u),l?(await o,a(null)):i(null)}catch(e){a?a(e):i(e)}}}},65287:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createScaffoldMiddleware=void 0,t.createScaffoldMiddleware=function(e){return(t,r,n,i)=>{let s=e[t.method];return void 0===s?n():"function"==typeof s?s(t,r,n,i):(r.result=s,i())}}},20985:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getUniqueId=void 0;let r=Math.floor(4294967295*Math.random());t.getUniqueId=function(){return r=(r+1)%4294967295}},82644:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createIdRemapMiddleware=void 0;let n=r(20985);t.createIdRemapMiddleware=function(){return(e,t,r,i)=>{let s=e.id,o=n.getUniqueId();e.id=o,t.id=o,r(r=>{e.id=s,t.id=s,r()})}}},47845:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};
58Object.defineProperty(t,"__esModule",{value:!0}),i(r(82644),t),i(r(77914),t),i(r(65287),t),i(r(20985),t),i(r(19930),t),i(r(27140),t)},27140:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeMiddleware=void 0;let n=r(19930);t.mergeMiddleware=function(e){let t=new n.JsonRpcEngine;return e.forEach(e=>t.push(e)),t.asMiddleware()}},90194:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(68885);function i(e,t,r){try{Reflect.apply(e,t,r)}catch(e){setTimeout(()=>{throw e})}}class s extends n.EventEmitter{emit(e,...t){let r="error"===e,n=this._events;if(void 0!==n)r=r&&void 0===n.error;else if(!r)return!1;if(r){let e;if(t.length>0&&([e]=t),e instanceof Error)throw e;let r=Error(`Unhandled error.${e?` (${e.message})`:""}`);throw r.context=e,r}let s=n[e];if(void 0===s)return!1;if("function"==typeof s)i(s,this,t);else{let e=s.length,r=function(e){let t=e.length,r=Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}(s);for(let n=0;n<e;n+=1)i(r[n],this,t)}return!0}}t.default=s},8728:function(e){e.exports=function(e){var t=(e=e||{}).max||Number.MAX_SAFE_INTEGER,r=void 0!==e.start?e.start:Math.floor(Math.random()*t);return function(){return r%=t,r++}}},6230:function(e,t,r){e.exports=r(80826)(r(14417))},80826:function(e,t,r){let n=r(58091),i=r(1911);e.exports=function(e){let t=n(e),r=i(e);return function(e,n){switch("string"==typeof e?e.toLowerCase():e){case"keccak224":return new t(1152,448,null,224,n);case"keccak256":return new t(1088,512,null,256,n);case"keccak384":return new t(832,768,null,384,n);case"keccak512":return new t(576,1024,null,512,n);case"sha3-224":return new t(1152,448,6,224,n);case"sha3-256":return new t(1088,512,6,256,n);case"sha3-384":return new t(832,768,6,384,n);case"sha3-512":return new t(576,1024,6,512,n);case"shake128":return new r(1344,256,31,n);case"shake256":return new r(1088,512,31,n);default:throw Error("Invald algorithm: "+e)}}}},58091:function(e,t,r){var n=r(9109).Buffer;let{Transform:i}=r(5939);e.exports=e=>class t extends i{constructor(t,r,n,i,s){super(s),this._rate=t,this._capacity=r,this._delimitedSuffix=n,this._hashBitLength=i,this._options=s,this._state=new e,this._state.initialize(t,r),this._finalized=!1}_transform(e,t,r){let n=null;try{this.update(e,t)}catch(e){n=e}r(n)}_flush(e){let t=null;try{this.push(this.digest())}catch(e){t=e}e(t)}update(e,t){if(!n.isBuffer(e)&&"string"!=typeof e)throw TypeError("Data must be a string or a buffer");if(this._finalized)throw Error("Digest already called");return n.isBuffer(e)||(e=n.from(e,t)),this._state.absorb(e),this}digest(e){if(this._finalized)throw Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let t=this._state.squeeze(this._hashBitLength/8);return void 0!==e&&(t=t.toString(e)),this._resetState(),t}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){let e=new t(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e}}},1911:function(e,t,r){var n=r(9109).Buffer;let{Transform:i}=r(5939);e.exports=e=>class t extends i{constructor(t,r,n,i){super(i),this._rate=t,this._capacity=r,this._delimitedSuffix=n,this._options=i,this._state=new e,this._state.initialize(t,r),this._finalized=!1}_transform(e,t,r){let n=null;try{this.update(e,t)}catch(e){n=e}r(n)}_flush(){}_read(e){this.push(this.squeeze(e))}update(e,t){if(!n.isBuffer(e)&&"string"!=typeof e)throw TypeError("Data must be a string or a buffer");if(this._finalized)throw Error("Squeeze already called");return n.isBuffer(e)||(e=n.from(e,t)),this._state.absorb(e),this}squeeze(e,t){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let r=this._state.squeeze(e);return void 0!==t&&(r=r.toString(t)),r}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){let e=new t(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e}}},66768:function(e,t){let r=[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];t.p1600=function(e){for(let t=0;t<24;++t){let n=e[0]^e[10]^e[20]^e[30]^e[40],i=e[1]^e[11]^e[21]^e[31]^e[41],s=e[2]^e[12]^e[22]^e[32]^e[42],o=e[3]^e[13]^e[23]^e[33]^e[43],a=e[4]^e[14]^e[24]^e[34]^e[44],l=e[5]^e[15]^e[25]^e[35]^e[45],u=e[6]^e[16]^e[26]^e[36]^e[46],c=e[7]^e[17]^e[27]^e[37]^e[47],h=e[8]^e[18]^e[28]^e[38]^e[48],d=e[9]^e[19]^e[29]^e[39]^e[49],f=h^(s<<1|o>>>31),p=d^(o<<1|s>>>31),g=e[0]^f,y=e[1]^p,m=e[10]^f,v=e[11]^p,b=e[20]^f,w=e[21]^p,_=e[30]^f,E=e[31]^p,S=e[40]^f,A=e[41]^p;f=n^(a<<1|l>>>31),p=i^(l<<1|a>>>31);let k=e[2]^f,C=e[3]^p,I=e[12]^f,x=e[13]^p,P=e[22]^f,O=e[23]^p,T=e[32]^f,R=e[33]^p,N=e[42]^f,D=e[43]^p;f=s^(u<<1|c>>>31),p=o^(c<<1|u>>>31);let B=e[4]^f,M=e[5]^p,L=e[14]^f,U=e[15]^p,j=e[24]^f,F=e[25]^p,q=e[34]^f,H=e[35]^p,z=e[44]^f,$=e[45]^p;f=a^(h<<1|d>>>31),p=l^(d<<1|h>>>31);let V=e[6]^f,W=e[7]^p,G=e[16]^f,K=e[17]^p,J=e[26]^f,Y=e[27]^p,Q=e[36]^f,Z=e[37]^p,X=e[46]^f,ee=e[47]^p;f=u^(n<<1|i>>>31),p=c^(i<<1|n>>>31);let et=e[8]^f,er=e[9]^p,en=e[18]^f,ei=e[19]^p,es=e[28]^f,eo=e[29]^p,ea=e[38]^f,el=e[39]^p,eu=e[48]^f,ec=e[49]^p,eh=v<<4|m>>>28,ed=m<<4|v>>>28,ef=b<<3|w>>>29,ep=w<<3|b>>>29,eg=E<<9|_>>>23,ey=_<<9|E>>>23,em=S<<18|A>>>14,ev=A<<18|S>>>14,eb=k<<1|C>>>31,ew=C<<1|k>>>31,e_=x<<12|I>>>20,eE=I<<12|x>>>20,eS=P<<10|O>>>22,eA=O<<10|P>>>22,ek=R<<13|T>>>19,eC=T<<13|R>>>19,eI=N<<2|D>>>30,ex=D<<2|N>>>30,eP=M<<30|B>>>2,eO=B<<30|M>>>2,eT=L<<6|U>>>26,eR=U<<6|L>>>26,eN=F<<11|j>>>21,eD=j<<11|F>>>21,eB=q<<15|H>>>17,eM=H<<15|q>>>17,eL=$<<29|z>>>3,eU=z<<29|$>>>3,ej=V<<28|W>>>4,eF=W<<28|V>>>4,eq=K<<23|G>>>9,eH=G<<23|K>>>9,ez=J<<25|Y>>>7,e$=Y<<25|J>>>7,eV=Q<<21|Z>>>11,eW=Z<<21|Q>>>11,eG=ee<<24|X>>>8,eK=X<<24|ee>>>8,eJ=et<<27|er>>>5,eY=er<<27|et>>>5,eQ=en<<20|ei>>>12,eZ=ei<<20|en>>>12,eX=eo<<7|es>>>25,e0=es<<7|eo>>>25,e1=ea<<8|el>>>24,e2=el<<8|ea>>>24,e3=eu<<14|ec>>>18,e5=ec<<14|eu>>>18;
58e[0]=g^~e_&eN,e[1]=y^~eE&eD,e[10]=ej^~eQ&ef,e[11]=eF^~eZ&ep,e[20]=eb^~eT&ez,e[21]=ew^~eR&e$,e[30]=eJ^~eh&eS,e[31]=eY^~ed&eA,e[40]=eP^~eq&eX,e[41]=eO^~eH&e0,e[2]=e_^~eN&eV,e[3]=eE^~eD&eW,e[12]=eQ^~ef&ek,e[13]=eZ^~ep&eC,e[22]=eT^~ez&e1,e[23]=eR^~e$&e2,e[32]=eh^~eS&eB,e[33]=ed^~eA&eM,e[42]=eq^~eX&eg,e[43]=eH^~e0&ey,e[4]=eN^~eV&e3,e[5]=eD^~eW&e5,e[14]=ef^~ek&eL,e[15]=ep^~eC&eU,e[24]=ez^~e1&em,e[25]=e$^~e2&ev,e[34]=eS^~eB&eG,e[35]=eA^~eM&eK,e[44]=eX^~eg&eI,e[45]=e0^~ey&ex,e[6]=eV^~e3&g,e[7]=eW^~e5&y,e[16]=ek^~eL&ej,e[17]=eC^~eU&eF,e[26]=e1^~em&eb,e[27]=e2^~ev&ew,e[36]=eB^~eG&eJ,e[37]=eM^~eK&eY,e[46]=eg^~eI&eP,e[47]=ey^~ex&eO,e[8]=e3^~g&e_,e[9]=e5^~y&eE,e[18]=eL^~ej&eQ,e[19]=eU^~eF&eZ,e[28]=em^~eb&eT,e[29]=ev^~ew&eR,e[38]=eG^~eJ&eh,e[39]=eK^~eY&ed,e[48]=eI^~eP&eq,e[49]=ex^~eO&eH,e[0]^=r[2*t],e[1]^=r[2*t+1]}}},14417:function(e,t,r){var n=r(9109).Buffer;let i=r(66768);function s(){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}s.prototype.initialize=function(e,t){for(let e=0;e<50;++e)this.state[e]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1},s.prototype.absorb=function(e){for(let t=0;t<e.length;++t)this.state[~~(this.count/4)]^=e[t]<<this.count%4*8,this.count+=1,this.count===this.blockSize&&(i.p1600(this.state),this.count=0)},s.prototype.absorbLastFewBits=function(e){this.state[~~(this.count/4)]^=e<<this.count%4*8,(128&e)!=0&&this.count===this.blockSize-1&&i.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<(this.blockSize-1)%4*8,i.p1600(this.state),this.count=0,this.squeezing=!0},s.prototype.squeeze=function(e){this.squeezing||this.absorbLastFewBits(1);let t=n.alloc(e);for(let r=0;r<e;++r)t[r]=this.state[~~(this.count/4)]>>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(i.p1600(this.state),this.count=0);return t},s.prototype.copy=function(e){for(let 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=s},8355:function(e,t,r){e=r.nmd(e);var n,i,s,o="__lodash_hash_undefined__",a="[object Arguments]",l="[object Array]",u="[object Boolean]",c="[object Date]",h="[object Error]",d="[object Function]",f="[object Map]",p="[object Number]",g="[object Object]",y="[object Promise]",m="[object RegExp]",v="[object Set]",b="[object String]",w="[object WeakMap]",_="[object ArrayBuffer]",E="[object DataView]",S=/^\[object .+?Constructor\]$/,A=/^(?:0|[1-9]\d*)$/,k={};k["[object Float32Array]"]=k["[object Float64Array]"]=k["[object Int8Array]"]=k["[object Int16Array]"]=k["[object Int32Array]"]=k["[object Uint8Array]"]=k["[object Uint8ClampedArray]"]=k["[object Uint16Array]"]=k["[object Uint32Array]"]=!0,k[a]=k[l]=k[_]=k[u]=k[E]=k[c]=k[h]=k[d]=k[f]=k[p]=k[g]=k[m]=k[v]=k[b]=k[w]=!1;var C="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,I="object"==typeof self&&self&&self.Object===Object&&self,x=C||I||Function("return this")(),P=t&&!t.nodeType&&t,O=P&&e&&!e.nodeType&&e,T=O&&O.exports===P,R=T&&C.process,N=function(){try{return R&&R.binding&&R.binding("util")}catch(e){}}(),D=N&&N.isTypedArray;function B(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r}function M(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}var L=Array.prototype,U=Function.prototype,j=Object.prototype,F=x["__core-js_shared__"],q=U.toString,H=j.hasOwnProperty,z=(n=/[^.]+$/.exec(F&&F.keys&&F.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",$=j.toString,V=RegExp("^"+q.call(H).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),W=T?x.Buffer:void 0,G=x.Symbol,K=x.Uint8Array,J=j.propertyIsEnumerable,Y=L.splice,Q=G?G.toStringTag:void 0,Z=Object.getOwnPropertySymbols,X=W?W.isBuffer:void 0,ee=(i=Object.keys,s=Object,function(e){return i(s(e))}),et=ek(x,"DataView"),er=ek(x,"Map"),en=ek(x,"Promise"),ei=ek(x,"Set"),es=ek(x,"WeakMap"),eo=ek(Object,"create"),ea=ex(et),el=ex(er),eu=ex(en),ec=ex(ei),eh=ex(es),ed=G?G.prototype:void 0,ef=ed?ed.valueOf:void 0;function ep(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function eg(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ey(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function em(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new ey;++t<r;)this.add(e[t])}function ev(e){var t=this.__data__=new eg(e);this.size=t.size}function eb(e,t){for(var r=e.length;r--;)if(eP(e[r][0],t))return r;return -1}
58function ew(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Q&&Q in Object(e)?function(e){var t=H.call(e,Q),r=e[Q];try{e[Q]=void 0;var n=!0}catch(e){}var i=$.call(e);return n&&(t?e[Q]=r:delete e[Q]),i}(e):$.call(e)}function e_(e){return eM(e)&&ew(e)==a}function eE(e,t,r,n,i,s){var o=1&r,a=e.length,l=t.length;if(a!=l&&!(o&&l>a))return!1;var u=s.get(e);if(u&&s.get(t))return u==t;var c=-1,h=!0,d=2&r?new em:void 0;for(s.set(e,t),s.set(t,e);++c<a;){var f=e[c],p=t[c];if(n)var g=o?n(p,f,c,t,e,s):n(f,p,c,e,t,s);if(void 0!==g){if(g)continue;h=!1;break}if(d){if(!function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}(t,function(e,t){if(!d.has(t)&&(f===e||i(f,e,r,n,s)))return d.push(t)})){h=!1;break}}else if(!(f===p||i(f,p,r,n,s))){h=!1;break}}return s.delete(e),s.delete(t),h}function eS(e){var t;return t=function(e){return null!=e&&eD(e.length)&&!eN(e)?function(e,t){var r,n=eT(e),i=!n&&eO(e),s=!n&&!i&&eR(e),o=!n&&!i&&!s&&eL(e),a=n||i||s||o,l=a?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],u=l.length;for(var c in e)H.call(e,c)&&!(a&&("length"==c||s&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||(r=null==(r=u)?9007199254740991:r)&&("number"==typeof c||A.test(c))&&c>-1&&c%1==0&&c<r))&&l.push(c);return l}(e):function(e){if(t=e&&e.constructor,e!==("function"==typeof t&&t.prototype||j))return ee(e);var t,r=[];for(var n in Object(e))H.call(e,n)&&"constructor"!=n&&r.push(n);return r}(e)}(e),eT(e)?t:function(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}(t,eC(e))}function eA(e,t){var r,n=e.__data__;return("string"==(r=typeof t)||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==t:null===t)?n["string"==typeof t?"string":"hash"]:n.map}function ek(e,t){var r=null==e?void 0:e[t];return!(!eB(r)||z&&z in r)&&(eN(r)?V:S).test(ex(r))?r:void 0}ep.prototype.clear=function(){this.__data__=eo?eo(null):{},this.size=0},ep.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ep.prototype.get=function(e){var t=this.__data__;if(eo){var r=t[e];return r===o?void 0:r}return H.call(t,e)?t[e]:void 0},ep.prototype.has=function(e){var t=this.__data__;return eo?void 0!==t[e]:H.call(t,e)},ep.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=eo&&void 0===t?o:t,this},eg.prototype.clear=function(){this.__data__=[],this.size=0},eg.prototype.delete=function(e){var t=this.__data__,r=eb(t,e);return!(r<0)&&(r==t.length-1?t.pop():Y.call(t,r,1),--this.size,!0)},eg.prototype.get=function(e){var t=this.__data__,r=eb(t,e);return r<0?void 0:t[r][1]},eg.prototype.has=function(e){return eb(this.__data__,e)>-1},eg.prototype.set=function(e,t){var r=this.__data__,n=eb(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},ey.prototype.clear=function(){this.size=0,this.__data__={hash:new ep,map:new(er||eg),string:new ep}},ey.prototype.delete=function(e){var t=eA(this,e).delete(e);return this.size-=t?1:0,t},ey.prototype.get=function(e){return eA(this,e).get(e)},ey.prototype.has=function(e){return eA(this,e).has(e)},ey.prototype.set=function(e,t){var r=eA(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},em.prototype.add=em.prototype.push=function(e){return this.__data__.set(e,o),this},em.prototype.has=function(e){return this.__data__.has(e)},ev.prototype.clear=function(){this.__data__=new eg,this.size=0},ev.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},ev.prototype.get=function(e){return this.__data__.get(e)},ev.prototype.has=function(e){return this.__data__.has(e)},ev.prototype.set=function(e,t){var r=this.__data__;if(r instanceof eg){var n=r.__data__;if(!er||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new ey(n)}return r.set(e,t),this.size=r.size,this};var eC=Z?function(e){return null==e?[]:function(e,t){for(var r=-1,n=null==e?0:e.length,i=0,s=[];++r<n;){var o=e[r];t(o,r,e)&&(s[i++]=o)}return s}(Z(e=Object(e)),function(t){return J.call(e,t)})}:function(){return[]},eI=ew;function ex(e){if(null!=e){try{return q.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function eP(e,t){return e===t||e!=e&&t!=t}(et&&eI(new et(new ArrayBuffer(1)))!=E||er&&eI(new er)!=f||en&&eI(en.resolve())!=y||ei&&eI(new ei)!=v||es&&eI(new es)!=w)&&(eI=function(e){var t=ew(e),r=t==g?e.constructor:void 0,n=r?ex(r):"";if(n)switch(n){case ea:return E;case el:return f;case eu:return y;case ec:return v;case eh:return w}return t});var eO=e_(function(){return arguments}())?e_:function(e){return eM(e)&&H.call(e,"callee")&&!J.call(e,"callee")},eT=Array.isArray,eR=X||function(){return!1};function eN(e){if(!eB(e))return!1;var t=ew(e);return t==d||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function eD(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function eB(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function eM(e){return null!=e&&"object"==typeof e}var eL=D?function(e){return D(e)}:function(e){return eM(e)&&eD(e.length)&&!!k[ew(e)]};e.exports=function(e,t){return function e(t,r,n,i,s){return t===r||(null!=t&&null!=r&&(eM(t)||eM(r))?function(e,t,r,n,i,s){var o=eT(e),d=eT(t),y=o?l:eI(e),w=d?l:eI(t);y=y==a?g:y,w=w==a?g:w;var S=y==g,A=w==g,k=y==w;
58if(k&&eR(e)){if(!eR(t))return!1;o=!0,S=!1}if(k&&!S)return s||(s=new ev),o||eL(e)?eE(e,t,r,n,i,s):function(e,t,r,n,i,s,o){switch(r){case E:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)break;e=e.buffer,t=t.buffer;case _:if(e.byteLength!=t.byteLength||!s(new K(e),new K(t)))break;return!0;case u:case c:case p:return eP(+e,+t);case h:return e.name==t.name&&e.message==t.message;case m:case b:return e==t+"";case f:var a=B;case v:var l=1&n;if(a||(a=M),e.size!=t.size&&!l)break;var d=o.get(e);if(d)return d==t;n|=2,o.set(e,t);var g=eE(a(e),a(t),n,i,s,o);return o.delete(e),g;case"[object Symbol]":if(ef)return ef.call(e)==ef.call(t)}return!1}(e,t,y,r,n,i,s);if(!(1&r)){var C=S&&H.call(e,"__wrapped__"),I=A&&H.call(t,"__wrapped__");if(C||I){var x=C?e.value():e,P=I?t.value():t;return s||(s=new ev),i(x,P,r,n,s)}}return!!k&&(s||(s=new ev),function(e,t,r,n,i,s){var o=1&r,a=eS(e),l=a.length;if(l!=eS(t).length&&!o)return!1;for(var u=l;u--;){var c=a[u];if(!(o?c in t:H.call(t,c)))return!1}var h=s.get(e);if(h&&s.get(t))return h==t;var d=!0;s.set(e,t),s.set(t,e);for(var f=o;++u<l;){var p=e[c=a[u]],g=t[c];if(n)var y=o?n(g,p,c,t,e,s):n(p,g,c,e,t,s);if(!(void 0===y?p===g||i(p,g,r,n,s):y)){d=!1;break}f||(f="constructor"==c)}if(d&&!f){var m=e.constructor,v=t.constructor;m!=v&&"constructor"in e&&"constructor"in t&&!("function"==typeof m&&m instanceof m&&"function"==typeof v&&v instanceof v)&&(d=!1)}return s.delete(e),s.delete(t),d}(e,t,r,n,i,s))}(t,r,n,i,e,s):t!=t&&r!=r)}(e,t)}},87040:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Base=void 0;let i=r(9109),s=n(r(58110));class o{print(){o.print(this)}bufferIndexOf(e,t,r=!1){return r?this.binarySearch(e,t,i.Buffer.compare):this.linearSearch(e,t,(e,t)=>e.equals(t))}static binarySearch(e,t,r){let n=0,i=e.length-1;for(;n<=i;){let s=Math.floor((n+i)/2),o=r(e[s],t);if(0===o){for(let n=s-1;n>=0;n--)if(0!==r(e[n],t))return n+1;return 0}o<0?n=s+1:i=s-1}return -1}binarySearch(e,t,r){return o.binarySearch(e,t,r)}static linearSearch(e,t,r){for(let n=0;n<e.length;n++)if(r(e[n],t))return n;return -1}linearSearch(e,t,r){return o.linearSearch(e,t,r)}static bufferify(e){if(!i.Buffer.isBuffer(e)){if("object"==typeof e&&e.words)return i.Buffer.from(e.toString(s.default.enc.Hex),"hex");if(o.isHexString(e))return i.Buffer.from(e.replace(/^0x/,""),"hex");if("string"==typeof e)return i.Buffer.from(e);if("bigint"==typeof e)return i.Buffer.from(e.toString(16),"hex");else if(e instanceof Uint8Array)return i.Buffer.from(e.buffer);else if("number"==typeof e){let t=e.toString();return t.length%2&&(t=`0${t}`),i.Buffer.from(t,"hex")}else if(ArrayBuffer.isView(e))return i.Buffer.from(e.buffer,e.byteOffset,e.byteLength)}return e}bigNumberify(e){return o.bigNumberify(e)}static bigNumberify(e){if("bigint"==typeof e)return e;if("string"==typeof e)return e.startsWith("0x")&&o.isHexString(e)?BigInt("0x"+e.replace("0x","").toString()):BigInt(e);if(i.Buffer.isBuffer(e))return BigInt("0x"+e.toString("hex"));if(e instanceof Uint8Array||"number"==typeof e)return BigInt(e);throw Error("cannot bigNumberify")}static isHexString(e){return"string"==typeof e&&/^(0x)?[0-9A-Fa-f]*$/.test(e)}static print(e){console.log(e.toString())}bufferToHex(e,t=!0){return o.bufferToHex(e,t)}static bufferToHex(e,t=!0){return`${t?"0x":""}${(e||i.Buffer.alloc(0)).toString("hex")}`}bufferify(e){return o.bufferify(e)}bufferifyFn(e){return t=>{let r=e(t);return i.Buffer.isBuffer(r)?r:this.isHexString(r)?i.Buffer.from(r.replace("0x",""),"hex"):"string"==typeof r?i.Buffer.from(r):"bigint"==typeof r?i.Buffer.from(t.toString(16),"hex"):ArrayBuffer.isView(r)?i.Buffer.from(r.buffer,r.byteOffset,r.byteLength):i.Buffer.from(e(s.default.enc.Hex.parse(t.toString("hex"))).toString(s.default.enc.Hex),"hex")}}isHexString(e){return o.isHexString(e)}log2(e){return 1===e?0:1+this.log2(e/2|0)}zip(e,t){return e.map((e,r)=>[e,t[r]])}static hexZeroPad(e,t){return"0x"+e.replace("0x","").padStart(t,"0")}}t.Base=o,t.default=o},82602:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esMo
58dule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.IncrementalMerkleTree=void 0;let i=n(r(87040)),s=n(r(22058));class o extends i.default{constructor(e,t){if(super(),this.hashFn=e,t.depth&&(this.depth=t.depth),t.arity&&(this.arity=t.arity),this.depth<1)throw Error("depth must be greater than 0");if(this.arity<1)throw Error("arity must be greater than 0");let r=[],n=t.zeroValue;if(this.zeroValue=n,this.zeroes=[],this.depth)for(let e=0;e<this.depth;e++)this.zeroes.push(n),r[e]=[],n=this.hashFn(Array(this.arity).fill(n));this.nodes=r,this.root=n}getRoot(){return this.root}getHexRoot(){return this.bufferToHex(this.bufferify(this.getRoot()))}insert(e){if(this.depth&&this.arity&&this.nodes[0].length>=this.getMaxLeaves())throw Error("tree is full");let t=e,r=this.nodes[0].length;for(let e=0;e<this.depth;e+=1){let n=r%this.arity,i=r-n,s=i+this.arity,o=[];this.nodes[e][r]=t;for(let t=i;t<s;t+=1)t<this.nodes[e].length?o.push(this.nodes[e][t]):o.push(this.zeroes[e]);t=this.hashFn(o),r=Math.floor(r/this.arity)}this.root=t}delete(e){this.update(e,this.zeroValue)}update(e,t){if(e<0||e>=this.nodes[0].length)throw Error("out of bounds");let r=t;for(let t=0;t<this.depth;t+=1){let n=e%this.arity,i=e-n,s=i+this.arity,o=[];this.nodes[t][e]=r;for(let e=i;e<s;e+=1)e<this.nodes[t].length?o.push(this.nodes[t][e]):o.push(this.zeroes[t]);r=this.hashFn(o),e=Math.floor(e/this.arity)}this.root=r}getDepth(){return this.depth}getArity(){return this.arity}getMaxLeaves(){return Math.pow(this.depth,this.arity)}indexOf(e){return this.nodes[0].indexOf(e)}getLeaves(){let e=this.copyList(this.nodes[0]),t=this.nodes[0].length;for(let r=t;r<this.getMaxLeaves();r++)e[r]=this.zeroValue;return e}copyList(e){return e.map(e=>BigInt(e))}getLayers(){let e=[];for(let t of this.nodes)e.push(this.copyList(t));if(e[0].length<this.getMaxLeaves()){let t=e[0].length;for(let r=t;r<this.getMaxLeaves();r++)e[0][r]=this.zeroValue;for(let r=0;r<this.depth;r++){let n=t%this.arity,i=t-n,s=i+this.arity;for(let t=i;t<s;t++)t>=e[r].length&&(e[r][t]=this.zeroes[r]);t=Math.floor(t/this.arity)}}return e.push([this.root]),e}getHexLayers(){return this.getLayers().reduce((e,t)=>(Array.isArray(t)?e.push(t.map(e=>this.bufferToHex(this.bufferify(e)))):e.push(t),e),[])}getLayersAsObject(){let e=this.getLayers().map(e=>e.map(e=>this.bufferToHex(this.bufferify(e),!1))),t=[];for(let r=0;r<e.length;r++){let n=[];for(let i=0;i<e[r].length;i++){let s={[e[r][i]]:null};if(t.length){s[e[r][i]]={};let n=t.shift(),o=Object.keys(n)[0];if(s[e[r][i]][o]=n[o],t.length){let n=t.shift(),o=Object.keys(n)[0];s[e[r][i]][o]=n[o]}}n.push(s)}t.push(...n)}return t[0]}computeRoot(){let e;let t=this.nodes[0].length;for(let r=0;r<this.depth;r+=1){let n=t%this.arity,i=t-n,s=i+this.arity,o=[];for(let e=i;e<s;e+=1)e<this.nodes[r].length?o.push(this.nodes[r][e]):o.push(this.zeroes[r]);e=this.hashFn(o),t=Math.floor(t/this.arity)}return e}getProof(e){if(e<0||e>=this.nodes[0].length)throw Error("The leaf does not exist in this tree");let t=[],r=[],n=e;for(let n=0;n<this.depth;n+=1){let i=e%this.arity,s=e-i,o=s+this.arity;r[n]=i,t[n]=[];for(let r=s;r<o;r+=1)r!==e&&(r<this.nodes[n].length?t[n].push(this.nodes[n][r]):t[n].push(this.zeroes[n]));e=Math.floor(e/this.arity)}return{root:this.root,leaf:this.nodes[0][n],pathIndices:r,siblings:t}}verify(e){let t=e.leaf;for(let r=0;r<e.siblings.length;r+=1){let n=e.siblings[r].slice();n.splice(e.pathIndices[r],0,t),t=this.hashFn(n)}return e.root===t}toString(){return this.toTreeString()}toTreeString(){let e=this.getLayersAsObject();return s.default.asTree(e,!0)}}t.IncrementalMerkleTree=o,"undefined"!=typeof window&&(window.IncrementalMerkleTree=o),t.default=o},68339:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MerkleMountainRange=void 0;let i=r(9109),s=n(r(7940)),o=n(r(87040));class a extends o.default{constructor(e=s.default,t=[],r,n,o){for(let s of(super(),this.root=i.Buffer.alloc(0),this.size=0,this.width=0,this.hashes={},this.data={},t=t.map(this.bufferify),this.hashFn=this.bufferifyFn(e),this.hashLeafFn=r,this.peakBaggingFn=n,this.hashBranchFn=o,t))this.append(s)}append(e){e=this.bufferify(e);let t=this.hashFn(e),r=this.bufferToHex(t);this.data[r]&&this.bufferToHex(this.hashFn(this.data[r]))===r||(this.data[r]=e);let n=this.hashLeaf(this.size+1,t);this.hashes[this.size+1]=n,this.width+=1;let i=this.getPeakIndexes(this.width);this.size=this.getSize(this.width);let s=[];for(let e=0;e<i.length;e++)s[e]=this._getOrCreateNode(i[e]);this.root=this.peakBagging(this.width,s)}hashLeaf(e,t){return(t=this.bufferify(t),this.hashLeafFn)?this.bufferify(this.hashLeafFn(e,t)):this.hashFn(i.Buffer.concat([this.bufferify(e),t]))}hashBranch(e,t,r){return this.hashBranchFn?this.bufferify(this.hashBranchFn(e,t,r)):this.hashFn(i.Buffer.concat([this.bufferify(e),this.bufferify(t),this.bufferify(r)]))}getPeaks(){let e=this.getPeakIndexes(this.width),t=[];for(let r=0;r<e.length;r++)t[r]=this.hashes[e[r]];return t}
58getLeafIndex(e){return e%2==1?this.getSize(e):this.getSize(e-1)+1}getPeakIndexes(e){let t=this.numOfPeaks(e),r=[],n=0,i=0;for(let s=255;s>0&&((e&1<<s-1)==0||(i=i+(1<<s)-1,r[n++]=i,!(r.length>=t)));s--);if(n!==r.length)throw Error("invalid bit calculation");return r}numOfPeaks(e){let t=e,r=0;for(;t>0;)t%2==1&&r++,t>>=1;return r}peakBagging(e,t){let r=this.getSize(e);if(this.numOfPeaks(e)!==t.length)throw Error("received invalid number of peaks");return 0!==e||t.length?this.peakBaggingFn?this.bufferify(this.peakBaggingFn(r,t)):this.hashFn(i.Buffer.concat([this.bufferify(r),...t.map(this.bufferify)])):i.Buffer.alloc(0)}getSize(e){return(e<<1)-this.numOfPeaks(e)}getRoot(){return this.root}getHexRoot(){return this.bufferToHex(this.getRoot())}getNode(e){return this.hashes[e]}mountainHeight(e){let t=1;for(;1<<t<=e+t;)t++;return t-1}heightAt(e){let t=e,r=0,n=0;for(;t>r;)t-=(1<<n)-1,r=(1<<(n=this.mountainHeight(t)))-1;return n-(r-t)}isLeaf(e){return 1===this.heightAt(e)}getChildren(e){let t=e-(1<<this.heightAt(e)-1),r=e-1;if(t===r)throw Error("not a parent");return[t,r]}getMerkleProof(e){if(e>this.size)throw Error("out of range");if(!this.isLeaf(e))throw Error("not a leaf");let t=this.root,r=this.width,n=this.getPeakIndexes(this.width),i=[],s=0;for(let t=0;t<n.length;t++)i[t]=this.hashes[n[t]],n[t]>=e&&0===s&&(s=n[t]);let o=0,a=0,l=this.heightAt(s),u=[];for(;s!==e;)l--,[o,a]=this.getChildren(s),s=e<=o?o:a,u[l-1]=this.hashes[e<=o?a:o];return{root:t,width:r,peakBagging:i,siblings:u}}verify(e,t,r,n,i,s){let o,a;if(n=this.bufferify(n),this.getSize(t)<r)throw Error("index is out of range");if(!e.equals(this.peakBagging(t,i)))throw Error("invalid root hash from the peaks");let l=0,u=this.getPeakIndexes(t);for(let e=0;e<u.length;e++)if(u[e]>=r){o=i[e],l=u[e];break}if(!o)throw Error("target not found");let c=s.length+1,h=Array(c),d=0,f=0;for(;c>0&&(h[--c]=l,l!==r);)[d,f]=this.getChildren(l),l=r>d?f:d;for(;c<h.length;)l=h[c],a=0===c?this.hashLeaf(l,this.hashFn(n)):l-1===h[c-1]?this.hashBranch(l,s[c-1],a):this.hashBranch(l,a,s[c-1]),c++;if(!a.equals(o))throw Error("hashed peak is invalid");return!0}peaksToPeakMap(e,t){let r={},n=0,i=t.length;for(let s=1;s<=32;s++)n=32-s,(e&1<<s-1)!=0?r[n]=t[--i]:r[n]=0;if(0!==i)throw Error("invalid number of peaks");return r}peakMapToPeaks(e,t){let r=this.numOfPeaks(e),n=Array(r),i=0;for(let e=0;e<32;e++)0!==t[e]&&(n[i++]=t[e]);if(i!==r)throw Error("invalid number of peaks");return n}peakUpdate(e,t,r){let n={},i=e+1,s=this.getLeafIndex(i),o=this.hashLeaf(s,r),a=0,l=0,u=!1,c=!1,h=!1;for(let r=1;r<=32;r++)a=32-r,h?n[a]=t[a]:(u=(e&(l=1<<r-1))!=0,c=(i&l)!=0,s++,u&&(o=this.hashBranch(s,t[a],o)),c?(u?n[a]=t[a]:n[a]=o,h=!0):n[a]=0);return n}rollUp(e,t,r,n){if(!e.equals(this.peakBagging(t,r)))throw Error("invalid root hash from the peaks");let i=t,s=this.peaksToPeakMap(t,r);for(let e=0;e<n.length;e++)s=this.peakUpdate(i,s,n[e]),i++;return this.peakBagging(i,this.peakMapToPeaks(i,s))}_getOrCreateNode(e){if(e>this.size)throw Error("out of range");if(!this.hashes[e]){let[t,r]=this.getChildren(e),n=this._getOrCreateNode(t),i=this._getOrCreateNode(r);this.hashes[e]=this.hashBranch(e,n,i)}return this.hashes[e]}}t.MerkleMountainRange=a,"undefined"!=typeof window&&(window.MerkleMountainRange=a),t.default=a},30690:function(e,t,r){"use strict";var n=r(9109).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.MerkleSumTree=t.ProofStep=t.Leaf=t.Bucket=void 0;let i=r(87040);class s{constructor(e,t){this.size=BigInt(e),this.hashed=t,this.parent=null,this.left=null,this.right=null}}t.Bucket=s;class o{constructor(e,t,r){this.hashFn=e,this.rng=t.map(e=>BigInt(e)),this.data=r}getBucket(){let e;return e=this.data?this.hashFn(this.data):n.alloc(32),new s(BigInt(this.rng[1])-BigInt(this.rng[0]),e)}}t.Leaf=o;class a{constructor(e,t){this.bucket=e,this.right=t}}t.ProofStep=a;class l extends i.Base{constructor(e,t){for(let r of(super(),this.leaves=e,this.hashFn=t,l.checkConsecutive(e),this.buckets=[],e))this.buckets.push(r.getBucket());let r=[];for(let e of this.buckets)r.push(e);for(;1!==r.length;){let e=[];for(;r.length;)if(r.length>=2){let t=r.shift(),i=r.shift(),o=new s(t.size+i.size,this.hashFn(n.concat([this.sizeToBuffer(t.size),this.bufferify(t.hashed),this.sizeToBuffer(i.size),this.bufferify(i.hashed)])));i.parent=o,t.parent=i.parent,t.right=i,i.left=t,e.push(o)}else e.push(r.shift());r=e}this.root=r[0]}sizeToBuffer(e){let t=n.alloc(8);return new DataView(t.buffer).setBigInt64(0,BigInt(e),!1),t}static checkConsecutive(e){let t=BigInt(0);for(let r of e){if(r.rng[0]!==t)throw Error("leaf ranges are invalid");t=BigInt(r.rng[1])}}getProof(e){let t=this.buckets[Number(e)],r=[];for(;t&&t.parent;){let e=!!t.right,n=t.right?t.right:t.left;t=t.parent,r.push(new a(n,e))}return r}sum(e){let t=BigInt(0);
58for(let r of e)t+=BigInt(r);return t}verifyProof(e,t,r){let i;let o=[this.sum(r.filter(e=>!e.right).map(e=>e.bucket.size)),BigInt(e.size)-this.sum(r.filter(e=>e.right).map(e=>e.bucket.size))];if(!(o[0]===t.rng[0]&&o[1]===t.rng[1]))return!1;let a=t.getBucket();for(let e of r)i=e.right?this.hashFn(n.concat([this.sizeToBuffer(a.size),this.bufferify(a.hashed),this.sizeToBuffer(e.bucket.size),this.bufferify(e.bucket.hashed)])):this.hashFn(n.concat([this.sizeToBuffer(e.bucket.size),this.bufferify(e.bucket.hashed),this.sizeToBuffer(a.size),this.bufferify(a.hashed)])),a=new s(BigInt(a.size)+BigInt(e.bucket.size),i);return a.size===e.size&&a.hashed.toString("hex")===e.hashed.toString("hex")}}t.MerkleSumTree=l,"undefined"!=typeof window&&(window.MerkleSumTree=l),t.default=l},52563:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MerkleTree=void 0;let i=r(9109),s=n(r(80726)),o=n(r(7940)),a=n(r(22058)),l=n(r(87040));class u extends l.default{constructor(e,t=o.default,r={}){if(super(),this.duplicateOdd=!1,this.concatenator=i.Buffer.concat,this.hashLeaves=!1,this.isBitcoinTree=!1,this.leaves=[],this.layers=[],this.sortLeaves=!1,this.sortPairs=!1,this.sort=!1,this.fillDefaultHash=null,this.complete=!1,r.complete){if(r.isBitcoinTree)throw Error('option "complete" is incompatible with "isBitcoinTree"');if(r.duplicateOdd)throw Error('option "complete" is incompatible with "duplicateOdd"')}if(this.isBitcoinTree=!!r.isBitcoinTree,this.hashLeaves=!!r.hashLeaves,this.sortLeaves=!!r.sortLeaves,this.sortPairs=!!r.sortPairs,this.complete=!!r.complete,r.fillDefaultHash){if("function"==typeof r.fillDefaultHash)this.fillDefaultHash=r.fillDefaultHash;else if(i.Buffer.isBuffer(r.fillDefaultHash)||"string"==typeof r.fillDefaultHash)this.fillDefaultHash=(e,t)=>r.fillDefaultHash;else throw Error('method "fillDefaultHash" must be a function, Buffer, or string')}this.sort=!!r.sort,this.sort&&(this.sortLeaves=!0,this.sortPairs=!0),this.duplicateOdd=!!r.duplicateOdd,r.concatenator&&(this.concatenator=r.concatenator),this.hashFn=this.bufferifyFn(t),this.processLeaves(e)}getOptions(){var e,t;return{complete:this.complete,isBitcoinTree:this.isBitcoinTree,hashLeaves:this.hashLeaves,sortLeaves:this.sortLeaves,sortPairs:this.sortPairs,sort:this.sort,fillDefaultHash:null!==(t=null===(e=this.fillDefaultHash)||void 0===e?void 0:e.toString())&&void 0!==t?t:null,duplicateOdd:this.duplicateOdd}}processLeaves(e){if(this.hashLeaves&&(e=e.map(this.hashFn)),this.leaves=e.map(this.bufferify),this.sortLeaves&&(this.leaves=this.leaves.sort(i.Buffer.compare)),this.fillDefaultHash)for(let e=this.leaves.length;e<Math.pow(2,Math.ceil(Math.log2(this.leaves.length)));e++)this.leaves.push(this.bufferify(this.fillDefaultHash(e,this.hashFn)));this.createHashes(this.leaves)}createHashes(e){for(this.layers=[e];e.length>1;){let t=this.layers.length;this.layers.push([]);let r=this.complete&&1===t&&!Number.isInteger(Math.log2(e.length))?2*e.length-Math.pow(2,Math.ceil(Math.log2(e.length))):e.length;for(let n=0;n<e.length;n+=2){if(n>=r){this.layers[t].push(...e.slice(r));break}if(n+1===e.length&&e.length%2==1){let r=e[e.length-1],i=r;if(this.isBitcoinTree){i=this.hashFn(this.concatenator([s.default(r),s.default(r)])),i=s.default(this.hashFn(i)),this.layers[t].push(i);continue}if(this.duplicateOdd);else{this.layers[t].push(e[n]);continue}}let o=e[n],a=n+1===e.length?o:e[n+1],l=null;l=this.isBitcoinTree?[s.default(o),s.default(a)]:[o,a],this.sortPairs&&l.sort(i.Buffer.compare);let u=this.hashFn(this.concatenator(l));this.isBitcoinTree&&(u=s.default(this.hashFn(u))),this.layers[t].push(u)}e=this.layers[t]}}addLeaf(e,t=!1){t&&(e=this.hashFn(e)),this.processLeaves(this.leaves.concat(e))}addLeaves(e,t=!1){t&&(e=e.map(this.hashFn)),this.processLeaves(this.leaves.concat(e))}getLeaves(e){return Array.isArray(e)?(this.hashLeaves&&(e=e.map(this.hashFn),this.sortLeaves&&(e=e.sort(i.Buffer.compare))),this.leaves.filter(t=>-1!==this.bufferIndexOf(e,t,this.sortLeaves))):this.leaves}getLeaf(e){return e<0||e>this.leaves.length-1?i.Buffer.from([]):this.leaves[e]}getLeafIndex(e){e=this.bufferify(e);let t=this.getLeaves();for(let r=0;r<t.length;r++)if(t[r].equals(e))return r;return -1}getLeafCount(){return this.leaves.length}getHexLeaves(){return this.leaves.map(e=>this.bufferToHex(e))}static marshalLeaves(e){return JSON.stringify(e.map(e=>u.bufferToHex(e)),null,2)}static unmarshalLeaves(e){let t=null;if("string"==typeof e)t=JSON.parse(e);else if(e instanceof Object)t=e;else throw Error("Expected type of string or object");
58if(!t)return[];if(!Array.isArray(t))throw Error("Expected JSON string to be array");return t.map(u.bufferify)}getLayers(){return this.layers}getHexLayers(){return this.layers.reduce((e,t)=>(Array.isArray(t)?e.push(t.map(e=>this.bufferToHex(e))):e.push(t),e),[])}getLayersFlat(){let e=this.layers.reduce((e,t)=>(Array.isArray(t)?e.unshift(...t):e.unshift(t),e),[]);return e.unshift(i.Buffer.from([0])),e}getHexLayersFlat(){return this.getLayersFlat().map(e=>this.bufferToHex(e))}getLayerCount(){return this.getLayers().length}getRoot(){return 0===this.layers.length?i.Buffer.from([]):this.layers[this.layers.length-1][0]||i.Buffer.from([])}getHexRoot(){return this.bufferToHex(this.getRoot())}getProof(e,t){if(void 0===e)throw Error("leaf is required");e=this.bufferify(e);let r=[];if(!Number.isInteger(t)){t=-1;for(let r=0;r<this.leaves.length;r++)0===i.Buffer.compare(e,this.leaves[r])&&(t=r)}if(t<=-1)return[];for(let e=0;e<this.layers.length;e++){let n=this.layers[e],i=t%2,s=i?t-1:this.isBitcoinTree&&t===n.length-1&&e<this.layers.length-1?t:t+1;s<n.length&&r.push({position:i?"left":"right",data:n[s]}),t=t/2|0}return r}getHexProof(e,t){return this.getProof(e,t).map(e=>this.bufferToHex(e.data))}getProofs(){let e=[];return this.getProofsDFS(this.layers.length-1,0,[],e),e}getProofsDFS(e,t,r,n){let i=t%2;if(-1===e){i||n.push([...r].reverse());return}if(t>=this.layers[e].length)return;let s=this.layers[e],o=i?t-1:t+1,a=!1;o<s.length&&(a=!0,r.push({position:i?"left":"right",data:s[o]})),this.getProofsDFS(e-1,2*t,r,n),this.getProofsDFS(e-1,2*t+1,r,n),a&&r.splice(r.length-1,1)}getHexProofs(){return this.getProofs().map(e=>this.bufferToHex(e.data))}getPositionalHexProof(e,t){return this.getProof(e,t).map(e=>["left"===e.position?0:1,this.bufferToHex(e.data)])}static marshalProof(e){return JSON.stringify(e.map(e=>"string"==typeof e?e:i.Buffer.isBuffer(e)?u.bufferToHex(e):{position:e.position,data:u.bufferToHex(e.data)}),null,2)}static unmarshalProof(e){let t=null;if("string"==typeof e)t=JSON.parse(e);else if(e instanceof Object)t=e;else throw Error("Expected type of string or object");if(!t)return[];if(!Array.isArray(t))throw Error("Expected JSON string to be array");return t.map(e=>{if("string"==typeof e)return u.bufferify(e);if(e instanceof Object)return{position:e.position,data:u.bufferify(e.data)};throw Error("Expected item to be of type string or object")})}static marshalTree(e){let t=e.getHexRoot(),r=e.leaves.map(e=>u.bufferToHex(e)),n=e.getHexLayers();return JSON.stringify({options:e.getOptions(),root:t,layers:n,leaves:r},null,2)}static unmarshalTree(e,t=o.default,r={}){let n=null;if("string"==typeof e)n=JSON.parse(e);else if(e instanceof Object)n=e;else throw Error("Expected type of string or object");if(!n)throw Error("could not parse json");return r=Object.assign({},n.options||{},r),new u(n.leaves,t,r)}getProofIndices(e,t){let r=Math.pow(2,t),n=new Set;for(let t of e){let e=r+t;for(;e>1;)n.add(1^e),e=e/2|0}let i=e.map(e=>r+e),s=Array.from(n).sort((e,t)=>e-t).reverse();n=i.concat(s);let o=new Set,a=[];for(let e of n)if(!o.has(e))for(a.push(e);e>1&&(o.add(e),o.has(1^e));)e=e/2|0;return a.filter(t=>!e.includes(t-r))}getProofIndicesForUnevenTree(e,t){let r=Math.ceil(Math.log2(t)),n=[];for(let e=0;e<r;e++)t%2!=0&&n.push({index:e,leavesCount:t}),t=Math.ceil(t/2);let i=[],s=e;for(let e=0;e<r;e++){let t=s.map(e=>e%2==0?e+1:e-1).filter(e=>!s.includes(e)),r=n.find(({index:t})=>t===e);r&&s.includes(r.leavesCount-1)&&(t=t.slice(0,-1)),i.push(t),s=[...new Set(s.map(e=>e%2==0?e/2:e%2==0?(e+1)/2:(e-1)/2))]}return i}getMultiProof(e,t){if(this.complete||console.warn("Warning: For correct multiProofs it's strongly recommended to set complete: true"),t||(t=e,e=this.getLayersFlat()),this.isUnevenTree()&&t.every(Number.isInteger))return this.getMultiProofForUnevenTree(t);if(!t.every(Number.isInteger)){let e=t;this.sortPairs&&(e=e.sort(i.Buffer.compare));let r=e.map(e=>this.bufferIndexOf(this.leaves,e,this.sortLeaves)).sort((e,t)=>e===t?0:e>t?1:-1);if(!r.every(e=>-1!==e))throw Error("Element does not exist in Merkle tree");let n=[],s=[],o=[];for(let e=0;e<this.layers.length;e++){let t=this.layers[e];for(let e=0;e<r.length;e++){let i=r[e],a=this.getPairNode(t,i);n.push(t[i]),a&&s.push(a),o.push(i/2|0)}r=o.filter((e,t,r)=>r.indexOf(e)===t),o=[]}return s.filter(e=>!n.includes(e))}
58return this.getProofIndices(t,Math.log2(e.length/2|0)).map(t=>e[t])}getMultiProofForUnevenTree(e,t){t||(t=e,e=this.getLayers());let r=[],n=t;for(let t of e){let e=[];for(let r of n){if(r%2==0){let i=r+1;if(!n.includes(i)&&t[i]){e.push(t[i]);continue}}let i=r-1;if(!n.includes(i)&&t[i]){e.push(t[i]);continue}}r=r.concat(e);let i=new Set;for(let e of n){if(e%2==0){i.add(e/2);continue}if(e%2==0){i.add((e+1)/2);continue}i.add((e-1)/2)}n=Array.from(i)}return r}getHexMultiProof(e,t){return this.getMultiProof(e,t).map(e=>this.bufferToHex(e))}getProofFlags(e,t){let r;if(!Array.isArray(e)||e.length<=0)throw Error("Invalid Inputs!");if(!(r=e.every(Number.isInteger)?[...e].sort((e,t)=>e===t?0:e>t?1:-1):e.map(e=>this.bufferIndexOf(this.leaves,e,this.sortLeaves)).sort((e,t)=>e===t?0:e>t?1:-1)).every(e=>-1!==e))throw Error("Element does not exist in Merkle tree");let n=t.map(e=>this.bufferify(e)),i=[],s=[];for(let e=0;e<this.layers.length;e++){let t=this.layers[e];r=r.reduce((e,r)=>{if(!i.includes(t[r])){let e=this.getPairNode(t,r),o=n.includes(t[r])||n.includes(e);e&&s.push(!o),i.push(t[r]),i.push(e)}return e.push(r/2|0),e},[])}return s}verify(e,t,r){let n=this.bufferify(t);if(r=this.bufferify(r),!Array.isArray(e)||!t||!r)return!1;for(let t=0;t<e.length;t++){let r=e[t],o=null,a=null;if("string"==typeof r)o=this.bufferify(r),a=!0;else if(Array.isArray(r))a=0===r[0],o=this.bufferify(r[1]);else if(i.Buffer.isBuffer(r))o=r,a=!0;else if(r instanceof Object)o=this.bufferify(r.data),a="left"===r.position;else throw Error("Expected node to be of type string or object");let l=[];this.isBitcoinTree?(l.push(s.default(n)),l[a?"unshift":"push"](s.default(o)),n=this.hashFn(this.concatenator(l)),n=s.default(this.hashFn(n))):(this.sortPairs?-1===i.Buffer.compare(n,o)?l.push(n,o):l.push(o,n):(l.push(n),l[a?"unshift":"push"](o)),n=this.hashFn(this.concatenator(l)))}return 0===i.Buffer.compare(n,r)}verifyMultiProof(e,t,r,n,s){if(this.isUnevenTree())return this.verifyMultiProofForUnevenTree(e,t,r,n,s);let o=Math.ceil(Math.log2(n));e=this.bufferify(e),r=r.map(e=>this.bufferify(e)),s=s.map(e=>this.bufferify(e));let a={};for(let[e,n]of this.zip(t,r))a[Math.pow(2,o)+e]=n;for(let[e,r]of this.zip(this.getProofIndices(t,o),s))a[e]=r;let l=Object.keys(a).map(e=>+e).sort((e,t)=>e-t);l=l.slice(0,l.length-1);let u=0;for(;u<l.length;){let e=l[u];if(e>=2&&({}).hasOwnProperty.call(a,1^e)){let t=[a[e-e%2],a[e-e%2+1]];this.sortPairs&&(t=t.sort(i.Buffer.compare));let r=t[1]?this.hashFn(this.concatenator(t)):t[0];a[e/2|0]=r,l.push(e/2|0)}u+=1}return!t.length||({}).hasOwnProperty.call(a,1)&&a[1].equals(e)}verifyMultiProofWithFlags(e,t,r,n){e=this.bufferify(e),t=t.map(this.bufferify),r=r.map(this.bufferify);let s=t.length,o=n.length,a=[],l=0,u=0,c=0;for(let e=0;e<o;e++){let o=[n[e]?l<s?t[l++]:a[u++]:r[c++],l<s?t[l++]:a[u++]].sort(i.Buffer.compare);a[e]=this.hashFn(this.concatenator(o))}return 0===i.Buffer.compare(a[o-1],e)}verifyMultiProofForUnevenTree(e,t,r,n,i){e=this.bufferify(e),r=r.map(e=>this.bufferify(e)),i=i.map(e=>this.bufferify(e));let s=this.calculateRootForUnevenTree(t,r,n,i);return e.equals(s)}getDepth(){return this.getLayers().length-1}getLayersAsObject(){let e=this.getLayers().map(e=>e.map(e=>this.bufferToHex(e,!1))),t=[];for(let r=0;r<e.length;r++){let n=[];for(let i=0;i<e[r].length;i++){let s={[e[r][i]]:null};if(t.length){s[e[r][i]]={};let n=t.shift(),o=Object.keys(n)[0];if(s[e[r][i]][o]=n[o],t.length){let n=t.shift(),o=Object.keys(n)[0];s[e[r][i]][o]=n[o]}}n.push(s)}t.push(...n)}return t[0]}static verify(e,t,r,n=o.default,i={}){return new u([],n,i).verify(e,t,r)}static getMultiProof(e,t){return new u([]).getMultiProof(e,t)}resetTree(){this.leaves=[],this.layers=[]}getPairNode(e,t){let r=t%2==0?t+1:t-1;return r<e.length?e[r]:null}toTreeString(){let e=this.getLayersAsObject();return a.default.asTree(e,!0)}toString(){return this.toTreeString()}isUnevenTree(e){let t=(null==e?void 0:e.length)||this.getDepth();return!this.isPowOf2(t)}isPowOf2(e){return e&&!(e&e-1)}calculateRootForUnevenTree(e,t,r,n){let i=this.zip(e,t).sort(([e],[t])=>e-t),s=i.map(([e])=>e),o=this.getProofIndicesForUnevenTree(s,r),a=0,l=[];for(let e=0;e<o.length;
58e++){let t=o[e],r=a;a+=t.length,l[e]=this.zip(t,n.slice(r,a))}let u=[i];for(let e=0;e<l.length;e++){let t=l[e].concat(u[e]).sort(([e],[t])=>e-t).map(([,e])=>e),r=[...new Set(u[e].map(([e])=>e).map(e=>e%2==0?e/2:e%2==0?(e+1)/2:(e-1)/2))],n=[];for(let e=0;e<r.length;e++){let i=r[e],s=t[2*e],o=t[2*e+1],a=o?this.hashFn(this.concatenator([s,o])):s;n.push([i,a])}u.push(n)}return u[u.length-1][0][1]}}t.MerkleTree=u,"undefined"!=typeof window&&(window.MerkleTree=u),t.default=u},91206:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MerkleTree=void 0;let i=n(r(52563));t.MerkleTree=i.default;var s=r(68339);Object.defineProperty(t,"MerkleMountainRange",{enumerable:!0,get:function(){return s.MerkleMountainRange}});var o=r(82602);Object.defineProperty(t,"IncrementalMerkleTree",{enumerable:!0,get:function(){return o.IncrementalMerkleTree}});var a=r(30690);Object.defineProperty(t,"MerkleSumTree",{enumerable:!0,get:function(){return a.MerkleSumTree}}),t.default=i.default},44378:function(e){function t(e,t,r,n){return Math.round(e/r)+" "+n+(t>=1.5*r?"s":"")}e.exports=function(e,r){r=r||{};var n,i,s=typeof e;if("string"===s&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var t=/^(-?(?:\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(t){var r=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*r;case"weeks":case"week":case"w":return 6048e5*r;case"days":case"day":case"d":return 864e5*r;case"hours":case"hour":case"hrs":case"hr":case"h":return 36e5*r;case"minutes":case"minute":case"mins":case"min":case"m":return 6e4*r;case"seconds":case"second":case"secs":case"sec":case"s":return 1e3*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}(e);if("number"===s&&isFinite(e))return r.long?(n=Math.abs(e))>=864e5?t(e,n,864e5,"day"):n>=36e5?t(e,n,36e5,"hour"):n>=6e4?t(e,n,6e4,"minute"):n>=1e3?t(e,n,1e3,"second"):e+" ms":(i=Math.abs(e))>=864e5?Math.round(e/864e5)+"d":i>=36e5?Math.round(e/36e5)+"h":i>=6e4?Math.round(e/6e4)+"m":i>=1e3?Math.round(e/1e3)+"s":e+"ms";throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},41019:function(e){"use strict";let t=self.fetch.bind(self);e.exports=t,e.exports.default=e.exports},57764:function(e,t,r){"use strict";r.r(t),r.d(t,{Component:function(){return k},Fragment:function(){return A},cloneElement:function(){return F},createContext:function(){return q},createElement:function(){return _},createRef:function(){return S},h:function(){return _},hydrate:function(){return j},isValidElement:function(){return o},options:function(){return i},render:function(){return U},toChildArray:function(){return function e(t,r){return r=r||[],null==t||"boolean"==typeof t||(v(t)?t.some(function(t){e(t,r)}):r.push(t)),r}}});var n,i,s,o,a,l,u,c,h,d,f,p,g={},y=[],m=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,v=Array.isArray;function b(e,t){for(var r in t)e[r]=t[r];return e}function w(e){var t=e.parentNode;t&&t.removeChild(e)}function _(e,t,r){var i,s,o,a={};for(o in t)"key"==o?i=t[o]:"ref"==o?s=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?n.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===a[o]&&(a[o]=e.defaultProps[o]);return E(e,a,i,s,null)}function E(e,t,r,n,o){var a={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==o?++s:o,__i:-1,__u:0};return null==o&&null!=i.vnode&&i.vnode(a),a}function S(){return{current:null}}function A(e){return e.children}function k(e,t){this.props=e,this.context=t}function C(e,t){if(null==t)return e.__?C(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e)return r.__e;return"function"==typeof e.type?C(e):null}function I(e){(!e.__d&&(e.__d=!0)&&a.push(e)&&!x.__r++||l!==i.debounceRendering)&&((l=i.debounceRendering)||u)(x)}function x(){var e,t,r,n,s,o,l,u;for(a.sort(c);e=a.shift();)e.__d&&(t=a.length,n=void 0,o=(s=(r=e).__v).__e,l=[],u=[],r.__P&&((n=b({},s)).__v=s.__v+1,i.vnode&&i.vnode(n),N(r.__P,n,s,r.__n,r.__P.namespaceURI,32&s.__u?[o]:null,l,null==o?C(s):o,!!(32&s.__u),u),n.__v=s.__v,n.__.__k[n.__i]=n,D(l,n,u),n.__e!=o&&function e(t){var r,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,r=0;r<t.__k.length;r++)if(null!=(n=t.__k[r])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return e(t)}}(n)),a.length>t&&a.sort(c));x.__r=0}function P(e,t,r,n,i,s,o,a,l,u,c){var h,d,f,p,m,b=n&&n.__k||y,w=t.length;for(r.__d=l,function(e,t,r){var n,i,s,o,a,l=t.length,u=r.length,c=u,h=0;for(e.__k=[],n=0;n<l;n++)o=n+h,null!=(i=e.__k[n]=null==(i=t[n])||"boolean"==typeof i||"function"==typeof i?null:"string"==typeof i||"number"==typeof i||"bigint"==typeof i||i.constructor==String?E(null,i,null,null,null):v(i)?E(A,{children:i},null,null,null):void 0===i.constructor&&i.__b>0?E(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)?(i.__=e,i.__b=e.__b+1,a=function(e,t,r,n){var i=e.key,s=e.type,o=r-1,a=r+1,l=t[r];if(null===l||l&&i==l.key&&s===l.type&&0==(131072&l.__u))return r;if(n>(null!=l&&0==(131072&l.__u)?1:0))for(;o>=0||a<t.length;){if(o>=0){if((l=t[o])&&0==(131072&l.__u)&&i==l.key&&s===l.type)return o;o--}if(a<t.length){if((l=t[a])&&0==(131072&l.__u)&&i==l.key&&s===l.type)return a;a++}}return -1}(i,r,o,c),i.__i=a,s=null,-1!==a&&(c--,(s=r[a])&&(s.__u|=131072)),null==s||null===s.__v?(-1==a&&h--,"function"!=typeof i.type&&(i.__u|=65536)):a!==o&&(a===o+1?h++:a>o?c>l-o?h+=a-o:h--:a<o?a==o-1&&(h=a-o):h=0,a!==n+h&&(i.__u|=65536))):(s=r[o])&&null==s.key&&s.__e&&0==(131072&s.__u)&&(s.__e==e.__d&&(e.__d=C(s)),M(s,s,!1),r[o]=null,c--);if(c)for(n=0;n<u;n++)null!=(s=r[n])&&0==(131072&s.__u)&&(s.__e==e.__d&&(e.__d=C(s)),M(s,s))}(r,t,b),l=r.__d,h=0;h<w;h++)null!=(f=r.__k[h])&&"boolean"!=typeof f&&"function"!=typeof f&&(d=-1===f.__i?g:b[f.__i]||g,f.__i=h,N(e,f,d,i,s,o,a,l,u,c),p=f.__e,f.ref&&d.ref!=f.ref&&(d.ref&&B(d.ref,null,f),c.push(f.ref,f.__c||p,f)),null==m&&null!=p&&(m=p),65536&f.__u||d.__k===f.__k?(l&&!l.isConnected&&(l=C(d)),l=function e(t,r,n){var i,s;if("function"==typeof t.type){for(i=t.__k,s=0;i&&s<i.length;s++)i[s]&&(i[s].__=t,r=e(i[s],r,n));return r}t.__e!=r&&(n.insertBefore(t.__e,r||null),r=t.__e);do r=r&&r.nextSibling;
58while(null!=r&&8===r.nodeType);return r}(f,l,e)):"function"==typeof f.type&&void 0!==f.__d?l=f.__d:p&&(l=p.nextSibling),f.__d=void 0,f.__u&=-196609);r.__d=l,r.__e=m}function O(e,t,r){"-"===t[0]?e.setProperty(t,null==r?"":r):e[t]=null==r?"":"number"!=typeof r||m.test(t)?r:r+"px"}function T(e,t,r,n,i){var s;e:if("style"===t){if("string"==typeof r)e.style.cssText=r;else{if("string"==typeof n&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||O(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||O(e.style,t,r[t])}}else if("o"===t[0]&&"n"===t[1])s=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase() in e||"onFocusOut"===t||"onFocusIn"===t?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+s]=r,r?n?r.u=n.u:(r.u=h,e.addEventListener(t,s?f:d,s)):e.removeEventListener(t,s?f:d,s);else{if("http://www.w3.org/2000/svg"==i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&t in e)try{e[t]=null==r?"":r;break e}catch(e){}"function"==typeof r||(null==r||!1===r&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,r))}}function R(e){return function(t){if(this.l){var r=this.l[t.type+e];if(null==t.t)t.t=h++;else if(t.t<r.u)return;return r(i.event?i.event(t):t)}}}function N(e,t,r,s,o,a,l,u,c,h){var d,f,p,y,m,_,E,S,I,x,O,R,N,D,B,M=t.type;if(void 0!==t.constructor)return null;128&r.__u&&(c=!!(32&r.__u),a=[u=t.__e=r.__e]),(d=i.__b)&&d(t);e:if("function"==typeof M)try{if(S=t.props,I=(d=M.contextType)&&s[d.__c],x=d?I?I.props.value:d.__:s,r.__c?E=(f=t.__c=r.__c).__=f.__E:("prototype"in M&&M.prototype.render?t.__c=f=new M(S,x):(t.__c=f=new k(S,x),f.constructor=M,f.render=L),I&&I.sub(f),f.props=S,f.state||(f.state={}),f.context=x,f.__n=s,p=f.__d=!0,f.__h=[],f._sb=[]),null==f.__s&&(f.__s=f.state),null!=M.getDerivedStateFromProps&&(f.__s==f.state&&(f.__s=b({},f.__s)),b(f.__s,M.getDerivedStateFromProps(S,f.__s))),y=f.props,m=f.state,f.__v=t,p)null==M.getDerivedStateFromProps&&null!=f.componentWillMount&&f.componentWillMount(),null!=f.componentDidMount&&f.__h.push(f.componentDidMount);else{if(null==M.getDerivedStateFromProps&&S!==y&&null!=f.componentWillReceiveProps&&f.componentWillReceiveProps(S,x),!f.__e&&(null!=f.shouldComponentUpdate&&!1===f.shouldComponentUpdate(S,f.__s,x)||t.__v===r.__v)){for(t.__v!==r.__v&&(f.props=S,f.state=f.__s,f.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.forEach(function(e){e&&(e.__=t)}),O=0;O<f._sb.length;O++)f.__h.push(f._sb[O]);f._sb=[],f.__h.length&&l.push(f);break e}null!=f.componentWillUpdate&&f.componentWillUpdate(S,f.__s,x),null!=f.componentDidUpdate&&f.__h.push(function(){f.componentDidUpdate(y,m,_)})}if(f.context=x,f.props=S,f.__P=e,f.__e=!1,R=i.__r,N=0,"prototype"in M&&M.prototype.render){for(f.state=f.__s,f.__d=!1,R&&R(t),d=f.render(f.props,f.state,f.context),D=0;D<f._sb.length;D++)f.__h.push(f._sb[D]);f._sb=[]}else do f.__d=!1,R&&R(t),d=f.render(f.props,f.state,f.context),f.state=f.__s;while(f.__d&&++N<25);f.state=f.__s,null!=f.getChildContext&&(s=b(b({},s),f.getChildContext())),p||null==f.getSnapshotBeforeUpdate||(_=f.getSnapshotBeforeUpdate(y,m)),P(e,v(B=null!=d&&d.type===A&&null==d.key?d.props.children:d)?B:[B],t,r,s,o,a,l,u,c,h),f.base=t.__e,t.__u&=-161,f.__h.length&&l.push(f),E&&(f.__E=f.__=null)}catch(e){t.__v=null,c||null!=a?(t.__e=u,t.__u|=c?160:32,a[a.indexOf(u)]=null):(t.__e=r.__e,t.__k=r.__k),i.__e(e,t,r)}else null==a&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=function(e,t,r,i,s,o,a,l,u){var c,h,d,f,p,y,m,b=r.props,_=t.props,E=t.type;if("svg"===E?s="http://www.w3.org/2000/svg":"math"===E?s="http://www.w3.org/1998/Math/MathML":s||(s="http://www.w3.org/1999/xhtml"),null!=o){for(c=0;c<o.length;c++)if((p=o[c])&&"setAttribute"in p==!!E&&(E?p.localName===E:3===p.nodeType)){e=p,o[c]=null;break}}if(null==e){if(null===E)return document.createTextNode(_);e=document.createElementNS(s,E,_.is&&_),o=null,l=!1}if(null===E)b===_||l&&e.data===_||(e.data=_);else{if(o=o&&n.call(e.childNodes),b=r.props||g,!l&&null!=o)for(b={},c=0;c<e.attributes.length;c++)b[(p=e.attributes[c]).name]=p.value;for(c in b)if(p=b[c],"children"==c);else if("dangerouslySetInnerHTML"==c)d=p;else if("key"!==c&&!(c in _)){if("value"==c&&"defaultValue"in _||"checked"==c&&"defaultChecked"in _)continue;T(e,c,null,p,s)}for(c in _)p=_[c],"children"==c?f=p:"dangerouslySetInnerHTML"==c?h=p:"value"==c?y=p:"checked"==c?m=p:"key"===c||l&&"function"!=typeof p||b[c]===p||T(e,c,p,b[c],s);if(h)l||d&&(h.__html===d.__html||h.__html===e.innerHTML)||(e.innerHTML=h.__html),t.__k=[];else if(d&&(e.innerHTML=""),P(e,v(f)?f:[f],t,r,i,"foreignObject"===E?"http://www.w3.org/1999/xhtml":s,o,a,o?o[0]:r.__k&&C(r,0),l,u),null!=o)for(c=o.length;c--;)null!=o[c]&&w(o[c]);l||(c="value",void 0===y||y===e[c]&&("progress"!==E||y)&&("option"!==E||y===b[c])||T(e,c,y,b[c],s),c="checked",void 0!==m&&m!==e[c]&&T(e,c,m,b[c],s))}return e}(r.__e,t,r,s,o,a,l,c,h);(d=i.diffed)&&d(t)}function D(e,t,r){t.__d=void 0;for(var n=0;n<r.length;n++)B(r[n],r[++n],r[++n]);i.__c&&i.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){i.__e(e,t.__v)}})}function B(e,t,r){try{"function"==typeof e?e(t):e.current=t}catch(e){i.__e(e,r)}}function M(e,t,r){var n,s;if(i.unmount&&i.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||B(n,null,t)),null!=(n=e.__c)){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(e){i.__e(e,t)}n.base=n.__P=null}if(n=e.__k)for(s=0;s<n.length;s++)n[s]&&M(n[s],t,r||"function"!=typeof e.type);r||null==e.__e||w(e.__e),e.__c=e.__=e.__e=e.__d=void 0}function L(e,t,r){return this.constructor(e,r)}function U(e,t,r){var s,o,a,l;i.__&&i.__(e,t),o=(s="function"==typeof r)?null:r&&r.__k||t.__k,a=[],l=[],N(t,e=(!s&&r||t).__k=_(A,null,[e]),o||g,g,t.namespaceURI,!s&&r?[r]:o?null:t.firstChild?n.call(t.childNodes):null,a,!s&&r?r:o?o.__e:t.firstChild,s,l),D(a,e,l)}function j(e,t){U(e,t,j)}function F(e,t,r){var i,s,o,a,l=b({},e.props);for(o in e.type&&e.type.defaultProps&&(a=e.type.defaultProps),t)"key"==o?i=t[o
vendor: 1,433 bytes, line 58
58]:"ref"==o?s=t[o]:l[o]=void 0===t[o]&&void 0!==a?a[o]:t[o];return arguments.length>2&&(l.children=arguments.length>3?n.call(arguments,2):r),E(e.type,l,i||e.key,s||e.ref,null)}function q(e,t){var r={__c:t="__cC"+p++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var r,n;return this.getChildContext||(r=[],(n={})[t]=this,this.getChildContext=function(){return n},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&r.some(function(e){e.__e=!0,I(e)})},this.sub=function(e){r.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){r.splice(r.indexOf(e),1),t&&t.call(e)}}),e.children}};return r.Provider.__=r.Consumer.contextType=r}n=y.slice,i={__e:function(e,t,r,n){for(var i,s,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((s=i.constructor)&&null!=s.getDerivedStateFromError&&(i.setState(s.getDerivedStateFromError(e)),o=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,n||{}),o=i.__d),o)return i.__E=i}catch(t){e=t}throw e}},s=0,o=function(e){return null!=e&&null==e.constructor},k.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=b({},this.state),"function"==typeof e&&(e=e(b({},r),this.props)),e&&b(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),I(this))},k.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),I(this))},k.prototype.render=A,a=[],u="function"==typeof Promise?Promise.prototype.then.bind(Prom
58ise.resolve()):setTimeout,c=function(e,t){return e.__v.__b-t.__v.__b},x.__r=0,h=0,d=R(!1),f=R(!0),p=0},83148:function(e,t,r){"use strict";r.r(t),r.d(t,{useCallback:function(){return C},useContext:function(){return I},useDebugValue:function(){return x},useEffect:function(){return _},useErrorBoundary:function(){return P},useId:function(){return O},useImperativeHandle:function(){return A},useLayoutEffect:function(){return E},useMemo:function(){return k},useReducer:function(){return w},useRef:function(){return S},useState:function(){return b}});var n,i,s,o,a=r(57764),l=0,u=[],c=[],h=a.options,d=h.__b,f=h.__r,p=h.diffed,g=h.__c,y=h.unmount,m=h.__;function v(e,t){h.__h&&h.__h(i,e,l||t),l=0;var r=i.__H||(i.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({__V:c}),r.__[e]}function b(e){return l=1,w(M,e)}function w(e,t,r){var s=v(n++,2);if(s.t=e,!s.__c&&(s.__=[r?r(t):M(void 0,t),function(e){var t=s.__N?s.__N[0]:s.__[0],r=s.t(t,e);t!==r&&(s.__N=[r,s.__[1]],s.__c.setState({}))}],s.__c=i,!i.u)){var o=function(e,t,r){if(!s.__c.__H)return!0;var n=s.__c.__H.__.filter(function(e){return!!e.__c});if(n.every(function(e){return!e.__N}))return!a||a.call(this,e,t,r);var i=!1;return n.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(i=!0)}}),!(!i&&s.__c.props===e)&&(!a||a.call(this,e,t,r))};i.u=!0;var a=i.shouldComponentUpdate,l=i.componentWillUpdate;i.componentWillUpdate=function(e,t,r){if(this.__e){var n=a;a=void 0,o(e,t,r),a=n}l&&l.call(this,e,t,r)},i.shouldComponentUpdate=o}return s.__N||s.__}function _(e,t){var r=v(n++,3);!h.__s&&B(r.__H,t)&&(r.__=e,r.i=t,i.__H.__h.push(r))}function E(e,t){var r=v(n++,4);!h.__s&&B(r.__H,t)&&(r.__=e,r.i=t,i.__h.push(r))}function S(e){return l=5,k(function(){return{current:e}},[])}function A(e,t,r){l=6,E(function(){return"function"==typeof e?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},null==r?r:r.concat(e))}function k(e,t){var r=v(n++,7);return B(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function C(e,t){return l=8,k(function(){return e},t)}function I(e){var t=i.context[e.__c],r=v(n++,9);return r.c=e,t?(null==r.__&&(r.__=!0,t.sub(i)),t.props.value):e.__}function x(e,t){h.useDebugValue&&h.useDebugValue(t?t(e):e)}function P(e){var t=v(n++,10),r=b();return t.__=e,i.componentDidCatch||(i.componentDidCatch=function(e,n){t.__&&t.__(e,n),r[1](e)}),[r[0],function(){r[1](void 0)}]}function O(){var e=v(n++,11);if(!e.__){for(var t=i.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var r=t.__m||(t.__m=[0,0]);e.__="P"+r[0]+"-"+r[1]++}return e.__}function T(){for(var e;e=u.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(N),e.__H.__h.forEach(D),e.__H.__h=[]}catch(t){e.__H.__h=[],h.__e(t,e.__v)}}h.__b=function(e){i=null,d&&d(e)},h.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),m&&m(e,t)},h.__r=function(e){f&&f(e),n=0;var t=(i=e.__c).__H;t&&(s===i?(t.__h=[],i.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.__V=c,e.__N=e.i=void 0})):(t.__h.forEach(N),t.__h.forEach(D),t.__h=[],n=0)),s=i},h.diffed=function(e){p&&p(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==u.push(t)&&o===h.requestAnimationFrame||((o=h.requestAnimationFrame)||function(e){var t,r=function(){clearTimeout(n),R&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);R&&(t=requestAnimationFrame(r))})(T)),t.__H.__.forEach(function(e){e.i&&(e.__H=e.i),e.__V!==c&&(e.__=e.__V),e.i=void 0,e.__V=c})),s=i=null},h.__c=function(e,t){t.some(function(e){try{e.__h.forEach(N),e.__h=e.__h.filter(function(e){return!e.__||D(e)})}catch(r){t.some(function(e){e.__h&&(e.__h=[])}),t=[],h.__e(r,e.__v)}}),g&&g(e,t)},h.unmount=function(e){y&&y(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(e){try{N(e)}catch(e){t=e}}),r.__H=void 0,t&&h.__e(t,r.__v))};var R="function"==typeof requestAnimationFrame;function N(e){var t=i,r=e.__c;"function"==typeof r&&(e.__c=void 0,r()),i=t}function D(e){var t=i;e.__c=e.__(),i=t}function B(e,t){return!e||e.length!==t.length||t.some(function(t,r){return t!==e[r]})}function M(e,t){return"function"==typeof t?t(e):t}},57963:function(e){"use strict";function t(e){try{return JSON.stringify(e)}catch(e){return'"[Circular]"'}}e.exports=function(e,r,n){var i=n&&n.stringify||t;if("object"==typeof e&&null!==e){var s=r.length+1;if(1===s)return e;var o=Array(s);o[0]=i(e);for(var a=1;a<s;a++)o[a]=i(r[a]);return o.join(" ")}if("string"!=typeof e)return e;var l=r.length;if(0===l)return e;for(var u="",c=0,h=-1,d=e&&e.length||0,f=0;f<d;){if(37===e.charCodeAt(f)&&f+1<d){switch(h=h>-1?h:0,e.charCodeAt(f+1)){case 100:case 102:if(c>=l||null==r[c])break;h<f&&(u+=e.slice(h,f)),u+=Number(r[c]),h=f+2,f++;break;case 105:if(c>=l||null==r[c])break;h<f&&(u+=e.slice(h,f)),u+=Math.floor(Number(r[c])),h=f+2,f++;break;case 79:case 111:case 106:if(c>
58=l||void 0===r[c])break;h<f&&(u+=e.slice(h,f));var p=typeof r[c];if("string"===p){u+="'"+r[c]+"'",h=f+2,f++;break}if("function"===p){u+=r[c].name||"<anonymous>",h=f+2,f++;break}u+=i(r[c]),h=f+2,f++;break;case 115:if(c>=l)break;h<f&&(u+=e.slice(h,f)),u+=String(r[c]),h=f+2,f++;break;case 37:h<f&&(u+=e.slice(h,f)),u+="%",h=f+2,f++,c--}++c}++f}return -1===h?e:(h<d&&(u+=e.slice(h)),u)}},16058:function(e){"use strict";var t={};function r(e,r,n){n||(n=Error);var i=function(e){function t(t,n,i){return e.call(this,"string"==typeof r?r:r(t,n,i))||this}return t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e,t}(n);i.prototype.name=n.name,i.prototype.code=e,t[e]=i}function n(e,t){if(!Array.isArray(e))return"of ".concat(t," ").concat(String(e));var r=e.length;return(e=e.map(function(e){return String(e)}),r>2)?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}r("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(e,t,r){if("string"==typeof t&&(i="not ",t.substr(0,i.length)===i)?(l="must not be",t=t.replace(/^not /,"")):l="must be",s=" argument",(void 0===o||o>e.length)&&(o=e.length),e.substring(o-s.length,o)===s)u="The ".concat(e," ").concat(l," ").concat(n(t,"type"));else{var i,s,o,a,l,u,c=("number"!=typeof a&&(a=0),a+1>e.length||-1===e.indexOf(".",a))?"argument":"property";u='The "'.concat(e,'" ').concat(c," ").concat(l," ").concat(n(t,"type"))}return u+". Received type ".concat(typeof r)},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.q=t},414:function(e,t,r){"use strict";var n=r(20357),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=c;var s=r(27813),o=r(67684);r(87398)(c,s);for(var a=i(o.prototype),l=0;l<a.length;l++){var u=a[l];c.prototype[u]||(c.prototype[u]=o.prototype[u])}function c(e){if(!(this instanceof c))return new c(e);s.call(this,e),o.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",h)))}function h(){this._writableState.ended||n.nextTick(d,this)}function d(e){e.end()}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(c.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(c.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},87802:function(e,t,r){"use strict";e.exports=i;var n=r(64958);function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}r(87398)(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},27813:function(e,t,r){"use strict";var n,i,s,o,a,l=r(20357);e.exports=k,k.ReadableState=A,r(68885).EventEmitter;var u=function(e,t){return e.listeners(t).length},c=r(81725),h=r(9109).Buffer,d=(void 0!==r.g?r.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},f=r(94616);i=f&&f.debuglog?f.debuglog("stream"):function(){};var p=r(36337),g=r(3587),y=r(72164).getHighWaterMark,m=r(16058).q,v=m.ERR_INVALID_ARG_TYPE,b=m.ERR_STREAM_PUSH_AFTER_EOF,w=m.ERR_METHOD_NOT_IMPLEMENT
58ED,_=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(87398)(k,c);var E=g.errorOrDestroy,S=["error","close","destroy","pause","resume"];function A(e,t,i){n=n||r(414),e=e||{},"boolean"!=typeof i&&(i=t instanceof n),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=y(this,e,"readableHighWaterMark",i),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(s||(s=r(56123).s),this.decoder=new s(e.encoding),this.encoding=e.encoding)}function k(e){if(n=n||r(414),!(this instanceof k))return new k(e);var t=this instanceof n;this._readableState=new A(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),c.call(this)}function C(e,t,r,n,s){i("readableAddChunk",t);var o,a,l,u,c,f=e._readableState;if(null===t)f.reading=!1,function(e,t){if(i("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?P(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,O(e)))}}(e,f);else{if(s||(o=f,a=t,h.isBuffer(a)||a instanceof d||"string"==typeof a||void 0===a||o.objectMode||(l=new v("chunk",["string","Buffer","Uint8Array"],a)),c=l),c)E(e,c);else if(f.objectMode||t&&t.length>0){if("string"==typeof t||f.objectMode||Object.getPrototypeOf(t)===h.prototype||(u=t,t=h.from(u)),n)f.endEmitted?E(e,new _):I(e,f,t,!0);else if(f.ended)E(e,new b);else{if(f.destroyed)return!1;f.reading=!1,f.decoder&&!r?(t=f.decoder.write(t),f.objectMode||0!==t.length?I(e,f,t,!1):T(e,f)):I(e,f,t,!1)}}else n||(f.reading=!1,T(e,f))}return!f.ended&&(f.length<f.highWaterMark||0===f.length)}function I(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&P(e)),T(e,t)}function x(e,t){if(e<=0||0===t.length&&t.ended)return 0;if(t.objectMode)return 1;if(e!=e)return t.flowing&&t.length?t.buffer.head.data.length:t.length;if(e>t.highWaterMark){var r;t.highWaterMark=((r=e)>=1073741824?r=1073741824:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),r)}return e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0)}function P(e){var t=e._readableState;i("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(i("emitReadable",t.flowing),t.emittedReadable=!0,l.nextTick(O,e))}function O(e){var t=e._readableState;i("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,M(e)}function T(e,t){t.readingMore||(t.readingMore=!0,l.nextTick(R,e,t))}function R(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(i("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function N(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function D(e){i("readable nexttick read 0"),e.read(0)}function B(e,t){i("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),M(e),t.flowing&&!t.reading&&e.read(0)}function M(e){var t=e._readableState;for(i("flow",t.flowing);t.flowing&&null!==e.read(););}function L(e,t){var r;return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r)}function U(e){var t=e._readableState;i("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,l.nextTick(j,t,e))}function j(e,t){if(i("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function F(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return -1}Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),k.prototype.destroy=g.destroy,k.prototype._undestroy=g.undestroy,k.prototype._destroy=function(e,t){t(e)},k.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=h.from(e,t),t=""),r=!0),C(this,e,t,!1,r)},k.prototype.unshift=function(e){return C(this,e,null,!0,!1)},k.prototype.isPaused=function(){return!1===this._readableState.flowing},k.prototype.setEncoding=function(e){s||(s=r(56123).s);var t=new s(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;
58for(var n=this._readableState.buffer.head,i="";null!==n;)i+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this},k.prototype.read=function(e){i("read",e),e=parseInt(e,10);var t,r=this._readableState,n=e;if(0!==e&&(r.emittedReadable=!1),0===e&&r.needReadable&&((0!==r.highWaterMark?r.length>=r.highWaterMark:r.length>0)||r.ended))return i("read: emitReadable",r.length,r.ended),0===r.length&&r.ended?U(this):P(this),null;if(0===(e=x(e,r))&&r.ended)return 0===r.length&&U(this),null;var s=r.needReadable;return i("need readable",s),(0===r.length||r.length-e<r.highWaterMark)&&i("length less than watermark",s=!0),r.ended||r.reading?i("reading or ended",s=!1):s&&(i("do read"),r.reading=!0,r.sync=!0,0===r.length&&(r.needReadable=!0),this._read(r.highWaterMark),r.sync=!1,r.reading||(e=x(n,r))),null===(t=e>0?L(e,r):null)?(r.needReadable=r.length<=r.highWaterMark,e=0):(r.length-=e,r.awaitDrain=0),0===r.length&&(r.ended||(r.needReadable=!0),n!==e&&r.ended&&U(this)),null!==t&&this.emit("data",t),t},k.prototype._read=function(e){E(this,new w("_read()"))},k.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,i("pipe count=%d opts=%j",n.pipesCount,t);var s=t&&!1===t.end||e===l.stdout||e===l.stderr?g:o;function o(){i("onend"),e.end()}n.endEmitted?l.nextTick(s):r.once("end",s),e.on("unpipe",function t(s,l){i("onunpipe"),s===r&&l&&!1===l.hasUnpiped&&(l.hasUnpiped=!0,i("cleanup"),e.removeListener("close",f),e.removeListener("finish",p),e.removeListener("drain",a),e.removeListener("error",d),e.removeListener("unpipe",t),r.removeListener("end",o),r.removeListener("end",g),r.removeListener("data",h),c=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&a())});var a=function(){var e=r._readableState;i("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&u(r,"data")&&(e.flowing=!0,M(r))};e.on("drain",a);var c=!1;function h(t){i("ondata");var s=e.write(t);i("dest.write",s),!1===s&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==F(n.pipes,e))&&!c&&(i("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function d(t){i("onerror",t),g(),e.removeListener("error",d),0===u(e,"error")&&E(e,t)}function f(){e.removeListener("finish",p),g()}function p(){i("onfinish"),e.removeListener("close",f),g()}function g(){i("unpipe"),r.unpipe(e)}return r.on("data",h),function(e,t,r){if("function"==typeof e.prependListener)return e.prepe
vendor: 5,561 bytes, line 58
58ndListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",d),e.once("close",f),e.once("finish",p),e.emit("pipe",r),n.flowing||(i("pipe resume"),r.resume()),e},k.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var s=0;s<i;s++)n[s].emit("unpipe",this,{hasUnpiped:!1});return this}var o=F(t.pipes,e);return -1===o||(t.pipes.splice(o,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},k.prototype.on=function(e,t){var r=c.prototype.on.call(this,e,t),n=this._readableState;return"data"===e?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"!==e||n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,i("on readable",n.length,n.reading),n.length?P(this):n.reading||l.nextTick(D,this)),r},k.prototype.addListener=k.prototype.on,k.prototype.removeListener=function(e,t){var r=c.prototype.removeListener.call(this,e,t);return"readable"===e&&l.nextTick(N,this),r},k.prototype.removeAllListeners=function(e){var t=c.prototype.removeAllListeners.apply(this,arguments);return("readable"===e||void 0===e)&&l.nextTick(N,this),t},k.prototype.resume=function(){var e=this._readableState;return e.flowing||(i("resume"),e.flowing=!e.readableListening,e.resumeScheduled||(e.resumeScheduled=!0,l.nextTick(B,this,e))),e.paused=!1,this},k.prototype.pause=function(){return i("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(i("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},k.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var s in e.on("end",function(){if(i("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(s){i("wrapped data"),r.decoder&&(s=r.decoder.write(s)),(!r.objectMode||null!=s)&&(r.objectMode||s&&s.length)&&(t.push(s)||(n=!0,e.pause()))}),e)void 0===this[s]&&"function"==typeof e[s]&&(this[s]=function(t){return function(){return e[t].apply(e,arguments)}}(s));for(var o=0;o<S.length;o++)e.on(S[o],this.emit.bind(this,S[o]));return this._read=function(t){i("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(k.prototype[Symbol.asyncIterator]=function(){return void 0===o&&(o=r(87136)),o(this)}),Object.defineProperty(k.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(k.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(k.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),k._fromList=L,Object.defineProperty(k.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(k.from=function(e,t){return void 0===a&&(a=r(98505)),a(k,e,t)})},64958:function(e,t,r){"use strict";e.exports=c;var n=r(16058).q,i=n.ERR_METHOD_NOT_IMPLEMENTED,s=n.ERR_MULTIPLE_CALLBACK,o=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,l=r(414);function u(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new s);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function c(e){if(!(this instanceof c))return new c(e);l.call(this,e),this._transformState={afterTransform:u.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",h)}function h(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?d(this,null,null):this._flush(function(t,r){d(e,t,r)})}function d(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new a;if(e._transformState.transforming)throw new o;return e.push(null)}r(87398)(c,l),c.prototype.push=function(e,t){return this._transformState.needTransform=!1,l.prototype.push.call(this,e,t)},c.prototype._transform=function(e,t,r){r(new i("_transform()"))},c.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},c.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},c.prototype._destroy=function(e,t){l.prototype._destroy.call(this,e,function(e){t(e)})}},67684:function(e,t,r){"use strict";var n,i,s=r(20357);function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){(function(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(void 0),n=n.next}t.corkedRequestsFree.next=e})(t,e)}}
58e.exports=k,k.WritableState=A;var a={deprecate:r(20310)},l=r(81725),u=r(9109).Buffer,c=(void 0!==r.g?r.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},h=r(3587),d=r(72164).getHighWaterMark,f=r(16058).q,p=f.ERR_INVALID_ARG_TYPE,g=f.ERR_METHOD_NOT_IMPLEMENTED,y=f.ERR_MULTIPLE_CALLBACK,m=f.ERR_STREAM_CANNOT_PIPE,v=f.ERR_STREAM_DESTROYED,b=f.ERR_STREAM_NULL_VALUES,w=f.ERR_STREAM_WRITE_AFTER_END,_=f.ERR_UNKNOWN_ENCODING,E=h.errorOrDestroy;function S(){}function A(e,t,i){n=n||r(414),e=e||{},"boolean"!=typeof i&&(i=t instanceof n),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=d(this,e,"writableHighWaterMark",i),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===e.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){(function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if("function"!=typeof i)throw new y;if(r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,t)--r.pendingcb,n?(s.nextTick(i,t),s.nextTick(T,e,r),e._writableState.errorEmitted=!0,E(e,t)):(i(t),e._writableState.errorEmitted=!0,E(e,t),T(e,r));else{var o=P(r)||e.destroyed;o||r.corked||r.bufferProcessing||!r.bufferedRequest||x(e,r),n?s.nextTick(I,e,r,o,i):I(e,r,o,i)}})(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function k(e){var t=this instanceof(n=n||r(414));if(!t&&!i.call(k,this))return new k(e);this._writableState=new A(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),l.call(this)}function C(e,t,r,n,i,s,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new v("write")):r?e._writev(i,t.onwrite):e._write(i,s,t.onwrite),t.sync=!1}function I(e,t,r,n){r||0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain")),t.pendingcb--,n(),T(e,t)}function x(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=Array(t.bufferedRequestCount),i=t.corkedRequestsFree;i.entry=r;for(var s=0,a=!0;r;)n[s]=r,r.isBuf||(a=!1),r=r.next,s+=1;n.allBuffers=a,C(e,t,!0,t.length,n,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;r;){var l=r.chunk,u=r.encoding,c=r.callback,h=t.objectMode?1:l.length;if(C(e,t,!1,h,l,u,c),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function P(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function O(e,t){e._final(function(r){t.pendingcb--,r&&E(e,r),t.prefinished=!0,e.emit("prefinish"),T(e,t)})}function T(e,t){var r=P(t);if(r&&(t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,s.nextTick(O,e,t))),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}r(87398)(k,l),A.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(A.prototype,"buffer",{get:a.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(i=Function.prototype[Symbol.hasInstance],Object.defineProperty(k,Symbol.hasInstance,{value:function(e){return!!i.call(this,e)||this===k&&e&&e._writableState instanceof A}})):i=function(e){return e instanceof this},k.prototype.pipe=function(){E(this,new m)},k.prototype.write=function(e,t,r){var n,i,o,a,l,h,d,f=this._writableState,g=!1,y=!f.objectMode&&(n=e,u.isBuffer(n)||n instanceof c);return y&&!u.isBuffer(e)&&(i=e,e=u.from(i)),("function"==typeof t&&(r=t,t=null),y?t="buffer":t||(t=f.defaultEncoding),"function"!=typeof r&&(r=S),f.ending)?(o=r,E(this,a=new w),s.nextTick(o,a)):(y||(l=e,h=r,null===l?d=new b:"string"==typeof l||f.objectMode||(d=new p("chunk",["string","Buffer"],l)),!d||(E(this,d),s.nextTick(h,d),0)))&&(f.pendingcb++,g=function(e,t,r,n,i,s){if(!r){var o,a,l=(o=n,a=i,t.objectMode||!1===t.decodeStrings||"string"!=typeof o||(o=u.from(o,a)),o);n!==l&&(r=!0,i="buffer",n=l)}var c=t.objectMode?1:n.length;t.length+=c;var h=t.length<t.highWaterMark;if(h||(t.needDrain=!0),t.writing||t.corked){var d=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:s,next:null},d?d.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else C(e,t,!1,c,n,i,s);return h}(this,f,y,e,t,r)),g},k.prototype.cork=function(){this._writableState.corked++},k.prototype.uncork=function(){var e=this._writableState;!e.corked||(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||x(this,e))},k.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new _(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(k.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(k.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),k.prototype._write=function(e,t,r){r(new g("_write()"))},k.prototype._writev=null,k.prototype.end=function(e,t,r){var n,i=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||(n=r,i.ending=!0,T(this,i),n&&(i.finished?s.nextTick(n):this.once("finish",n)),i.ended=!0,this.writable=!1),this},Object.defineProperty(k.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),k.prototype.destroy=h.destroy,k.prototype._undestroy=h.undestroy,k.prototype._destroy=function(e,t){t(e)}},87136:function(e,t,r){"use strict";var n,i=r(20357);function s(e,t,r){var n;return(t="symbol"==typeof(n=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?n:String(n))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var o=r(91763),a=Symbol("lastResolve"),l=Symbol("lastReject"),u=Symbol("error"),c=Symbol("ended"),h=Symbol("lastPromise"),d=Symbol("handlePromise"),f=Symbol("stream");function p(e,t){return{value:e,done:t}}function g(e){var t=e[a];if(null!==t){var r=e[f].read();null!==r&&(e[h]=null,e[a]=null,e[l]=null,t(p(r,!1)))}}function y(e){i.nextTick(g,e)}var m=Object.getPrototypeOf(function(){}),v=Object.setPrototypeOf((s(n={get stream(){return this[f]},next:function(){var e,t,r=this,n=this[u];if(null!==n)return Promise.reject(n);if(this[c])return Promise.resolve(p(void 0,!0));if(this[f].destroyed)return new Promise(function(e,t){i.nextTick(function(){r[u]?t(r[u]):e(p(void 0,!0))})});var s=this[h];
58if(s)t=new Promise((e=this,function(t,r){s.then(function(){if(e[c]){t(p(void 0,!0));return}e[d](t,r)},r)}));else{var o=this[f].read();if(null!==o)return Promise.resolve(p(o,!1));t=new Promise(this[d])}return this[h]=t,t}},Symbol.asyncIterator,function(){return this}),s(n,"return",function(){var e=this;return new Promise(function(t,r){e[f].destroy(null,function(e){if(e){r(e);return}t(p(void 0,!0))})})}),n),m);e.exports=function(e){var t,r=Object.create(v,(s(t={},f,{value:e,writable:!0}),s(t,a,{value:null,writable:!0}),s(t,l,{value:null,writable:!0}),s(t,u,{value:null,writable:!0}),s(t,c,{value:e._readableState.endEmitted,writable:!0}),s(t,d,{value:function(e,t){var n=r[f].read();n?(r[h]=null,r[a]=null,r[l]=null,e(p(n,!1))):(r[a]=e,r[l]=t)},writable:!0}),t));return r[h]=null,o(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[l];null!==t&&(r[h]=null,r[a]=null,r[l]=null,t(e)),r[u]=e;return}var n=r[a];null!==n&&(r[h]=null,r[a]=null,r[l]=null,n(p(void 0,!0))),r[c]=!0}),e.on("readable",y.bind(null,r)),r}},36337:function(e,t,r){"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach(function(t){var n,i;n=t,i=r[t],(n=s(n))in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function s(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var o=r(9109).Buffer,a=r(52361).inspect,l=a&&a.custom||"inspect";e.exports=function(){var e;function t(){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}return e=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return o.alloc(0);for(var t,r,n=o.allocUnsafe(e>>>0),i=this.head,s=0;i;)t=i.data,r=s,o.prototype.copy.call(t,n,r),s+=i.data.length,i=i.next;return n}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var i=t.data,s=e>i.length?i.length:e;if(s===i.length?n+=i:n+=i.slice(0,e),0==(e-=s)){s===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(s));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=o.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,s=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,s),0==(e-=s)){s===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(s));break}++n}return this.length-=n,t}},{key:l,value:function(e,t){return a(this,i(i({},t),{},{depth:0,customInspect:!1}))}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,s(n.key),n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}()},3587:function(e,t,r){"use strict";var n=r(20357);function i(e,t){o(e,t),s(e)}function s(e){(!e._writableState||e._writableState.emitClose)&&(!e._readableState||e._readableState.emitClose)&&e.emit("close")}function o(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this,a=this._readableState&&this._readableState.destroyed,l=this._writableState&&this._writableState.destroyed;return a||l?t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(o,this,e)):n.nextTick(o,this,e)):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?r._writableState?r._writableState.errorEmitted?n.nextTick(s,r):(r._writableState.errorEmitted=!0,n.nextTick(i,r,e)):n.nextTick(i,r,e):t?(n.nextTick(s,r),t(e)):n.nextTick(s,r)})),this},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}},91763:function(e,t,r){"use strict";var n=r(16058).q.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,r,s){if("function"==typeof r)return e(t,null,r);r||(r={}),o=s||i,a=!1,s=function(){if(!a){a=!0;for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];o.apply(this,t)}};var o,a,l=r.readable||!1!==r.readable&&t.readable,u=r.writable||!1!==r.writable&&t.writable,c=function(){t.writable||d()},h=t._writableState&&t._writableState.finished,d=function(){u=!1,h=!0,l||s.call(t)},f=t._readableState&&t._readableState.endEmitted,p=function(){l=!1,f=!0,u||s.call(t)},g=function(e){s.call(t,e)},y=function(){var e;return l&&!f?(t._readableState&&t._readableState.ended||(e=new n),s.call(t,e)):u&&!h?(t._writableState&&t._writableState.ended||(e=new n),s.call(t,e)):void 0},m=function(){t.req.on("finish",d)};return t.setHeader&&"function"==typeof t.abort?(t.on("complete",d),t.on("abort",y),t.req?m():t.on("request",m)):u&&!t._writableState&&(t.on("end",c),t.on("close",c)),t.on("end",p),t.on("finish",d),!1!==r.error&&t.on("error",g),t.on("close",y),function(){t.removeListener("complete",d),t.removeListener("abort",y),t.removeListener("request",m),t.req&&t.req.removeListener("finish",d),t.removeListener("end",c),t.removeListener("close",c),t.removeListener("finish",d),t.removeListener("end",p),t.removeListener("error",g),t.removeListener("close",y)}}},98505:function(e){e.exports=function(){throw Error("Readable.from is not available in the browser")}},85597:function(e,t,r){"use strict";var n,i=r(16058).q,s=i.ERR_MISSING_ARGS,o=i.ERR_STREAM_DESTROYED;function a(e){if(e)throw e}function l(e){e()}function u(e,t){return e.pipe(t)}e.exports=function(){for(var e,t,i=arguments.length,c=Array(i),h=0;h<i;h++)c[h]=arguments[h];var d=(e=c).length&&"function"==typeof e[e.length-1]?e.pop():a;if(Array.isArray(c[0])&&(c=c[0]),c.length<2)throw new s("streams");var f=c.map(function(e,i){var s,a,u,h,p,g,y=i<c.length-1;return s=i>0,u=a=function(e){t||(t=e),e&&f.forEach(l),y||(f.forEach(l),d(t))},h=!1,a=function(){h||(h=!0,u.apply(void 0,arguments))},p=!1,e.on("close",function(){p=!0}
58),void 0===n&&(n=r(91763)),n(e,{readable:y,writable:s},function(e){if(e)return a(e);p=!0,a()}),g=!1,function(t){if(!p&&!g){if(g=!0,e.setHeader&&"function"==typeof e.abort)return e.abort();if("function"==typeof e.destroy)return e.destroy();a(t||new o("pipe"))}}});return c.reduce(u)}},72164:function(e,t,r){"use strict";var n=r(16058).q.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,i){var s=null!=t.highWaterMark?t.highWaterMark:i?t[r]:null;if(null!=s){if(!(isFinite(s)&&Math.floor(s)===s)||s<0)throw new n(i?r:"highWaterMark",s);return Math.floor(s)}return e.objectMode?16:16384}}},81725:function(e,t,r){e.exports=r(68885).EventEmitter},5939:function(e,t,r){(t=e.exports=r(27813)).Stream=t,t.Readable=t,t.Writable=r(67684),t.Duplex=r(414),t.Transform=r(64958),t.PassThrough=r(87802),t.finished=r(91763),t.pipeline=r(85597)},23466:function(e){"use strict";var t=Object.prototype.hasOwnProperty,r="~";function n(){}function i(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function s(e,t,n,s,o){if("function"!=typeof n)throw TypeError("The listener must be a function");var a=new i(n,s||e,o),l=r?r+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],a]:e._events[l].push(a):(e._events[l]=a,e._eventsCount++),e}function o(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1)),a.prototype.eventNames=function(){var e,n,i=[];if(0===this._eventsCount)return i;for(n in e=this._events)t.call(e,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},a.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,s=n.length,o=Array(s);i<s;i++)o[i]=n[i].fn;return o},a.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},a.prototype.emit=function(e,t,n,i,s,o){var a=r?r+e:e;if(!this._events[a])return!1;var l,u,c=this._events[a],h=arguments.length;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),h){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,s),!0;case 6:return c.fn.call(c.context,t,n,i,s,o),!0}for(u=1,l=Array(h-1);u<h;u++)l[u-1]=arguments[u];c.fn.apply(c.context,l)}else{var d,f=c.length;for(u=0;u<f;u++)switch(c[u].once&&this.removeListener(e,c[u].fn,void 0,!0),h){case 1:c[u].fn.call(c[u].context);break;case 2:c[u].fn.call(c[u].context,t);break;case 3:c[u].fn.call(c[u].context,t,n);break;case 4:c[u].fn.call(c[u].context,t,n,i);break;default:if(!l)for(d=1,l=Array(h-1);d<h;d++)l[d-1]=arguments[d];c[u].fn.apply(c[u].context,l)}}return!0},a.prototype.on=function(e,t,r){return s(this,e,t,r,!1)},a.prototype.once=function(e,t,r){return s(this,e,t,r,!0)},a.prototype.removeListener=function(e,t,n,i){var s=r?r+e:e;if(!this._events[s])return this;if(!t)return o(this,s),this;var a=this._events[s];if(a.fn)a.fn!==t||i&&!a.once||n&&a.context!==n||o(this,s);else{for(var l=0,u=[],c=a.length;l<c;l++)(a[l].fn!==t||i&&!a[l].once||n&&a[l].context!==n)&&u.push(a[l]);u.length?this._events[s]=1===u.length?u[0]:u:o(this,s)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&o(this,t)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=r,a.EventEmitter=a,e.exports=a},10632:function(e,t,r){/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var n=r(9109),i=n.Buffer;function s(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(s(n,t),t.Buffer=o),o.prototype=Object.create(i.prototype),s(i,o),o.from=function(e,t,r){if("number"==typeof e)throw TypeError("Argument must not be a number");return i(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return n.SlowBuffer(e)}},1961:function(e,t,r){let n=Symbol("SemVer ANY");
58class i{static get ANY(){return n}constructor(e,t){if(t=s(t),e instanceof i){if(!!t.loose===e.loose)return e;e=e.value}u("comparator",e=e.trim().split(/\s+/).join(" "),t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===n?this.value="":this.value=this.operator+this.semver.version,u("comp",this)}parse(e){let t=this.options.loose?o[a.COMPARATORLOOSE]:o[a.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new c(r[2],this.options.loose):this.semver=n}toString(){return this.value}test(e){if(u("Comparator.test",e,this.options.loose),this.semver===n||e===n)return!0;if("string"==typeof e)try{e=new c(e,this.options)}catch(e){return!1}return l(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof i))throw TypeError("a Comparator is required");return""===this.operator?""===this.value||new h(e.value,t).test(this.value):""===e.operator?""===e.value||new h(this.value,t).test(e.semver):!((t=s(t)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||l(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||l(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">"))}}e.exports=i;let s=r(72018),{safeRe:o,t:a}=r(37127),l=r(23920),u=r(86026),c=r(95012),h=r(85461)},85461:function(e,t,r){class n{constructor(e,t){if(t=s(t),e instanceof n){if(!!t.loose===e.loose&&!!t.includePrerelease===e.includePrerelease)return e;return new n(e.raw,t)}if(e instanceof o)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let e=this.set[0];if(this.set=this.set.filter(e=>!y(e[0])),0===this.set.length)this.set=[e];else if(this.set.length>1){for(let e of this.set)if(1===e.length&&m(e[0])){this.set=[e];break}}}this.format()}format(){return this.range=this.set.map(e=>e.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(e){let t=((this.options.includePrerelease&&p)|(this.options.loose&&g))+":"+e,r=i.get(t);if(r)return r;let n=this.options.loose,s=n?u[c.HYPHENRANGELOOSE]:u[c.HYPHENRANGE];a("hyphen replace",e=e.replace(s,P(this.options.includePrerelease))),a("comparator trim",e=e.replace(u[c.COMPARATORTRIM],h)),a("tilde trim",e=e.replace(u[c.TILDETRIM],d)),a("caret trim",e=e.replace(u[c.CARETTRIM],f));let l=e.split(" ").map(e=>b(e,this.options)).join(" ").split(/\s+/).map(e=>x(e,this.options));n&&(l=l.filter(e=>(a("loose invalid filter",e,this.options),!!e.match(u[c.COMPARATORLOOSE])))),a("range list",l);let m=new Map;for(let e of l.map(e=>new o(e,this.options))){if(y(e))return[e];m.set(e.value,e)}m.size>1&&m.has("")&&m.delete("");let v=[...m.values()];return i.set(t,v),v}intersects(e,t){if(!(e instanceof n))throw TypeError("a Range is required");return this.set.some(r=>v(r,t)&&e.set.some(e=>v(e,t)&&r.every(r=>e.every(e=>r.intersects(e,t)))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new l(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(O(this.set[t],e,this.options))return!0;return!1}}e.exports=n;let i=new(r(58469)),s=r(72018),o=r(1961),a=r(86026),l=r(95012),{safeRe:u,t:c,comparatorTrimReplace:h,tildeTrimReplace:d,caretTrimReplace:f}=r(37127),{FLAG_INCLUDE_PRERELEASE:p,FLAG_LOOSE:g}=r(54632),y=e=>"<0.0.0-0"===e.value,m=e=>""===e.value,v=(e,t)=>{let r=!0,n=e.slice(),i=n.pop();for(;r&&n.length;)r=n.every(e=>i.intersects(e,t)),i=n.pop();return r},b=(e,t)=>(a("comp",e,t),a("caret",e=S(e,t)),a("tildes",e=_(e,t)),a("xrange",e=k(e,t)),a("stars",e=I(e,t)),e),w=e=>!e||"x"===e.toLowerCase()||"*"===e,_=(e,t)=>
58e.trim().split(/\s+/).map(e=>E(e,t)).join(" "),E=(e,t)=>{let r=t.loose?u[c.TILDELOOSE]:u[c.TILDE];return e.replace(r,(t,r,n,i,s)=>{let o;return a("tilde",e,t,r,n,i,s),w(r)?o="":w(n)?o=`>=${r}.0.0 <${+r+1}.0.0-0`:w(i)?o=`>=${r}.${n}.0 <${r}.${+n+1}.0-0`:s?(a("replaceTilde pr",s),o=`>=${r}.${n}.${i}-${s} <${r}.${+n+1}.0-0`):o=`>=${r}.${n}.${i} <${r}.${+n+1}.0-0`,a("tilde return",o),o})},S=(e,t)=>e.trim().split(/\s+/).map(e=>A(e,t)).join(" "),A=(e,t)=>{a("caret",e,t);let r=t.loose?u[c.CARETLOOSE]:u[c.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(t,r,i,s,o)=>{let l;return a("caret",e,t,r,i,s,o),w(r)?l="":w(i)?l=`>=${r}.0.0${n} <${+r+1}.0.0-0`:w(s)?l="0"===r?`>=${r}.${i}.0${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.0${n} <${+r+1}.0.0-0`:o?(a("replaceCaret pr",o),l="0"===r?"0"===i?`>=${r}.${i}.${s}-${o} <${r}.${i}.${+s+1}-0`:`>=${r}.${i}.${s}-${o} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${s}-${o} <${+r+1}.0.0-0`):(a("no pr"),l="0"===r?"0"===i?`>=${r}.${i}.${s}${n} <${r}.${i}.${+s+1}-0`:`>=${r}.${i}.${s}${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${s} <${+r+1}.0.0-0`),a("caret return",l),l})},k=(e,t)=>(a("replaceXRanges",e,t),e.split(/\s+/).map(e=>C(e,t)).join(" ")),C=(e,t)=>{e=e.trim();let r=t.loose?u[c.XRANGELOOSE]:u[c.XRANGE];return e.replace(r,(r,n,i,s,o,l)=>{a("xRange",e,r,n,i,s,o,l);let u=w(i),c=u||w(s),h=c||w(o);return"="===n&&h&&(n=""),l=t.includePrerelease?"-0":"",u?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&h?(c&&(s=0),o=0,">"===n?(n=">=",c?(i=+i+1,s=0):s=+s+1,o=0):"<="===n&&(n="<",c?i=+i+1:s=+s+1),"<"===n&&(l="-0"),r=`${n+i}.${s}.${o}${l}`):c?r=`>=${i}.0.0${l} <${+i+1}.0.0-0`:h&&(r=`>=${i}.${s}.0${l} <${i}.${+s+1}.0-0`),a("xRange return",r),r})},I=(e,t)=>(a("replaceStars",e,t),e.trim().replace(u[c.STAR],"")),x=(e,t)=>(a("replaceGTE0",e,t),e.trim().replace(u[t.includePrerelease?c.GTE0PRE:c.GTE0],"")),P=e=>(t,r,n,i,s,o,a,l,u,c,h,d)=>(r=w(n)?"":w(i)?`>=${n}.0.0${e?"-0":""}`:w(s)?`>=${n}.${i}.0${e?"-0":""}`:o?`>=${r}`:`>=${r}${e?"-0":""}`,l=w(u)?"":w(c)?`<${+u+1}.0.0-0`:w(h)?`<${u}.${+c+1}.0-0`:d?`<=${u}.${c}.${h}-${d}`:e?`<${u}.${c}.${+h+1}-0`:`<=${l}`,`${r} ${l}`.trim()),O=(e,t,r)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let r=0;r<e.length;r++)if(a(e[r].semver),e[r].semver!==o.ANY&&e[r].semver.prerelease.length>0){let n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0}},95012:function(e,t,r){let n=r(86026),{MAX_LENGTH:i,MAX_SAFE_INTEGER:s}=r(54632),{safeRe:o,t:a}=r(37127),l=r(72018),{compareIdentifiers:u}=r(43688);class c{constructor(e,t){if(t=l(t),e instanceof c){if(!!t.loose===e.loose&&!!t.includePrerelease===e.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>i)throw TypeError(`version is longer than ${i} characters`);n("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?o[a.LOOSE]:o[a.FULL]);if(!r)throw TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>s||this.major<0)throw TypeError("Invalid major version");if(this.minor>s||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>s||this.patch<0)throw TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&t<s)return t}return e}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(n("SemVer.compare",this.version,this.options,e),!(e instanceof c)){if("string"==typeof e&&e===this.version)return 0;e=new c(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof c||(e=new c(e,this.options)),u(this.major,e.major)||u(this.minor,e.minor)||u(this.patch,e.patch)}comparePre(e){if(e instanceof c||(e=new c(e,this.options)),this.prerelease.length&&!e.prerelease.length)return -1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],i=e.prerelease[t];
58if(n("prerelease compare",t,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return -1;if(r===i)continue;else return u(r,i)}while(++t)}compareBuild(e){e instanceof c||(e=new c(e,this.options));let t=0;do{let r=this.build[t],i=e.build[t];if(n("build compare",t,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return -1;if(r===i)continue;else return u(r,i)}while(++t)}inc(e,t,r){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"major":(0!==this.minor||0!==this.patch||0===this.prerelease.length)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(0!==this.patch||0===this.prerelease.length)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{let e=Number(r)?1:0;if(!t&&!1===r)throw Error("invalid increment argument: identifier is empty");if(0===this.prerelease.length)this.prerelease=[e];else{let n=this.prerelease.length;for(;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);
58if(-1===n){if(t===this.prerelease.join(".")&&!1===r)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let n=[t,e];!1===r&&(n=[t]),0===u(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=c},22210:function(e,t,r){let n=r(83041);e.exports=(e,t)=>{let r=n(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null}},23920:function(e,t,r){let n=r(52605),i=r(97224),s=r(38993),o=r(4916),a=r(95215),l=r(51864);e.exports=(e,t,r,u)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return n(e,r,u);case"!=":return i(e,r,u);case">":return s(e,r,u);case">=":return o(e,r,u);case"<":return a(e,r,u);case"<=":return l(e,r,u);default:throw TypeError(`Invalid operator: ${t}`)}}},68771:function(e,t,r){let n=r(95012),i=r(83041),{safeRe:s,t:o}=r(37127);e.exports=(e,t)=>{if(e instanceof n)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){let n;let i=t.includePrerelease?s[o.COERCERTLFULL]:s[o.COERCERTL];for(;(n=i.exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&n.index+n[0].length===r.index+r[0].length||(r=n),i.lastIndex=n.index+n[1].length+n[2].length;i.lastIndex=-1}else r=e.match(t.includePrerelease?s[o.COERCEFULL]:s[o.COERCE]);if(null===r)return null;let a=r[2],l=r[3]||"0",u=r[4]||"0",c=t.includePrerelease&&r[5]?`-${r[5]}`:"",h=t.includePrerelease&&r[6]?`+${r[6]}`:"";return i(`${a}.${l}.${u}${c}${h}`,t)}},80218:function(e,t,r){let n=r(95012);e.exports=(e,t,r)=>{let i=new n(e,r),s=new n(t,r);return i.compare(s)||i.compareBuild(s)}},90079:function(e,t,r){let n=r(75953);e.exports=(e,t)=>n(e,t,!0)},75953:function(e,t,r){let n=r(95012);e.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))},18124:function(e,t,r){let n=r(83041);e.exports=(e,t)=>{let r=n(e,null,!0),i=n(t,null,!0),s=r.compare(i);if(0===s)return null;let o=s>0,a=o?r:i,l=o?i:r,u=!!a.prerelease.length;if(l.prerelease.length&&!u)return l.patch||l.minor?a.patch?"patch":a.minor?"minor":"major":"major";let c=u?"pre":"";return r.major!==i.major?c+"major":r.minor!==i.minor?c+"minor":r.patch!==i.patch?c+"patch":"prerelease"}},52605:function(e,t,r){let n=r(75953);e.exports=(e,t,r)=>0===n(e,t,r)},38993:function(e,t,r){let n=r(75953);e.exports=(e,t,r)=>n(e,t,r)>0},4916:function(e,t,r){let n=r(75953);e.exports=(e,t,r)=>n(e,t,r)>=0},46655:function(e,t,r){let n=r(95012);e.exports=(e,t,r,i,s)=>{"string"==typeof r&&(s=i,i=r,r=void 0);try{return new n(e instanceof n?e.version:e,r).inc(t,i,s).version}catch(e){return null}}},95215:function(e,t,r){let n=r(75953);e.exports=(e,t,r)=>0>n(e,t,r)},51864:function(e,t,r){let n=r(75953);e.exports=(e,t,r)=>0>=n(e,t,r)},73007:function(e,t,r){let n=r(95012);e.exports=(e,t)=>new n(e,t).major},71024:function(e,t,r){let n=r(95012);e.exports=(e,t)=>new n(e,t).minor},97224:function(e,t,r){let n=r(75953);e.exports=(e,t,r)=>0!==n(e,t,r)},83041:function(e,t,r){let n=r(95012);e.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}},48430:function(e,t,r){let n=r(95012);e.exports=(e,t)=>new n(e,t).patch},29716:function(e,t,r){let n=r(83041);e.exports=(e,t)=>{let r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}},6659:function(e,t,r){let n=r(75953);e.exports=(e,t,r)=>n(t,e,r)},79682:function(e,t,r){let n=r(80218);e.exports=(e,t)=>e.sort((e,r)=>n(r,e,t))},23611:function(e,t,r){let n=r(85461);e.exports=(e,t,r)=>{try{t=new n(t,r)}catch(e){return!1}return t.test(e)}},1839:function(e,t,r){let n=r(80218);e.exports=(e,t)=>e.sort((e,r)=>n(e,r,t))},14191:function(e,t,r){let n=r(83041);e.exports=(e,t)=>{let r=n(e,t);return r?r.version:null}},45755:function(e,t,r){let n=r(37127),i=r(54632),s=r(95012),o=r(43688),a=r(83041),l=r(14191),u=r(22210),c=r(46655),h=r(18124),d=r(73007),f=r(71024),p=r(48430),g=r(29716),y=r(75953),m=r(6659),v=r(90079),b=r(80218),w=r(1839),_=r(79682),E=r(38993),S=r(95215),A=r(52605),k=r(97224),C=r(4916),I=r(51864),x=r(23920),P=r(68771),O=r(1961),T=r(85461),R=r(23611),N=r(59406),D=r(78536),B=r(71496),M=r(61407),L=r(9212),U=r(83001),j=r(36345),F=r(27309),q=r(91284),H=r(8268),z=r(6394);
58e.exports={parse:a,valid:l,clean:u,inc:c,diff:h,major:d,minor:f,patch:p,prerelease:g,compare:y,rcompare:m,compareLoose:v,compareBuild:b,sort:w,rsort:_,gt:E,lt:S,eq:A,neq:k,gte:C,lte:I,cmp:x,coerce:P,Comparator:O,Range:T,satisfies:R,toComparators:N,maxSatisfying:D,minSatisfying:B,minVersion:M,validRange:L,outside:U,gtr:j,ltr:F,intersects:q,simplifyRange:H,subset:z,SemVer:s,re:n.re,src:n.src,tokens:n.t,SEMVER_SPEC_VERSION:i.SEMVER_SPEC_VERSION,RELEASE_TYPES:i.RELEASE_TYPES,compareIdentifiers:o.compareIdentifiers,rcompareIdentifiers:o.rcompareIdentifiers}},54632:function(e){let t=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,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}},86026:function(e,t,r){var n=r(20357);let i="object"==typeof n&&n.env&&n.env.NODE_DEBUG&&/\bsemver\b/i.test(n.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=i},43688:function(e){let t=/^[0-9]+$/,r=(e,r)=>{let n=t.test(e),i=t.test(r);return n&&i&&(e=+e,r=+r),e===r?0:n&&!i?-1:i&&!n?1:e<r?-1:1};e.exports={compareIdentifiers:r,rcompareIdentifiers:(e,t)=>r(t,e)}},58469:function(e){class t{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(void 0!==t)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){let e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}e.exports=t},72018:function(e){let t=Object.freeze({loose:!0}),r=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:r},37127:function(e,t,r){let{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:s}=r(54632),o=r(86026),a=(t=e.exports={}).re=[],l=t.safeRe=[],u=t.src=[],c=t.t={},h=0,d="[a-zA-Z0-9-]",f=[["\\s",1],["\\d",s],[d,i]],p=e=>{for(let[t,r]of f)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},g=(e,t,r)=>{let n=p(t),i=h++;o(e,i,t),c[e]=i,u[i]=t,a[i]=new RegExp(t,r?"g":void 0),l[i]=new RegExp(n,r?"g":void 0)};g("NUMERICIDENTIFIER","0|[1-9]\\d*"),g("NUMERICIDENTIFIERLOOSE","\\d+"),g("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${d}*`),g("MAINVERSION",`(${u[c.NUMERICIDENTIFIER]})\\.(${u[c.NUMERICIDENTIFIER]})\\.(${u[c.NUMERICIDENTIFIER]})`),g("MAINVERSIONLOOSE",`(${u[c.NUMERICIDENTIFIERLOOSE]})\\.(${u[c.NUMERICIDENTIFIERLOOSE]})\\.(${u[c.NUMERICIDENTIFIERLOOSE]})`),g("PRERELEASEIDENTIFIER",`(?:${u[c.NUMERICIDENTIFIER]}|${u[c.NONNUMERICIDENTIFIER]})`),g("PRERELEASEIDENTIFIERLOOSE",`(?:${u[c.NUMERICIDENTIFIERLOOSE]}|${u[c.NONNUMERICIDENTIFIER]})`),g("PRERELEASE",`(?:-(${u[c.PRERELEASEIDENTIFIER]}(?:\\.${u[c.PRERELEASEIDENTIFIER]})*))`),g("PRERELEASELOOSE",`(?:-?(${u[c.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[c.PRERELEASEIDENTIFIERLOOSE]})*))`),g("BUILDIDENTIFIER",`${d}+`),g("BUILD",`(?:\\+(${u[c.BUILDIDENTIFIER]}(?:\\.${u[c.BUILDIDENTIFIER]})*))`),g("FULLPLAIN",`v?${u[c.MAINVERSION]}${u[c.PRERELEASE]}?${u[c.BUILD]}?`),g("FULL",`^${u[c.FULLPLAIN]}$`),g("LOOSEPLAIN",`[v=\\s]*${u[c.MAINVERSIONLOOSE]}${u[c.PRERELEASELOOSE]}?${u[c.BUILD]}?`),g("LOOSE",`^${u[c.LOOSEPLAIN]}$`),g("GTLT","((?:<|>)?=?)"),g("XRANGEIDENTIFIERLOOSE",`${u[c.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),g("XRANGEIDENTIFIER",`${u[c.NUMERICIDENTIFIER]}|x|X|\\*`),g("XRANGEPLAIN",`[v=\\s]*(${u[c.XRANGEIDENTIFIER]})(?:\\.(${u[c.XRANGEIDENTIFIER]})(?:\\.(${u[c.XRANGEIDENTIFIER]})(?:${u[c.PRERELEASE]})?${u[c.BUILD]}?)?)?`),g("XRANGEPLAINLOOSE",`[v=\\s]*(${u[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[c.XRANGEIDENTIFIERLOOSE]})(?:${u[c.PRERELEASELOOSE]})?${u[c.BUILD]}?)?)?`),g("XRANGE",`^${u[c.GTLT]}\\s*${u[c.XRANGEPLAIN]}$`),g("XRANGELOOSE",`^${u[c.GTLT]}\\s*${u[c.XRANGEPLAINLOOSE]}$`),g("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),g("COERCE",`${u[c.COERCEPLAIN]}(?:$|[^\\d])`),g("COERCEFULL",u[c.COERCEPLAIN]+`(?:${u[c.PRERELEASE]})?`+`(?:${u[c.BUILD]})?`+"(?:$|[^\\d])"),g("COERCERTL",u[c.COERCE],!0),g("COERCERTLFULL",u[c.COERCEFULL],!0),g("LONETILDE","(?:~>?)"),g("TILDETRIM",`(\\s*)${u[c.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",g("TILDE",`^${u[c.LONETILDE]}${u[c.XRANGEPLAIN]}$`),g("TILDELOOSE",`^${u[c.LONETILDE]}${u[c.XRANGEPLAINLOOSE]}$`),g("LONECARET","(?:\\^)"),g("CARETTRIM",`(\\s*)${u[c.LONECARET]}
58\\s+`,!0),t.caretTrimReplace="$1^",g("CARET",`^${u[c.LONECARET]}${u[c.XRANGEPLAIN]}$`),g("CARETLOOSE",`^${u[c.LONECARET]}${u[c.XRANGEPLAINLOOSE]}$`),g("COMPARATORLOOSE",`^${u[c.GTLT]}\\s*(${u[c.LOOSEPLAIN]})$|^$`),g("COMPARATOR",`^${u[c.GTLT]}\\s*(${u[c.FULLPLAIN]})$|^$`),g("COMPARATORTRIM",`(\\s*)${u[c.GTLT]}\\s*(${u[c.LOOSEPLAIN]}|${u[c.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",g("HYPHENRANGE",`^\\s*(${u[c.XRANGEPLAIN]})\\s+-\\s+(${u[c.XRANGEPLAIN]})\\s*$`),g("HYPHENRANGELOOSE",`^\\s*(${u[c.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[c.XRANGEPLAINLOOSE]})\\s*$`),g("STAR","(<|>)?=?\\s*\\*"),g("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),g("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},36345:function(e,t,r){let n=r(83001);e.exports=(e,t,r)=>n(e,t,">",r)},91284:function(e,t,r){let n=r(85461);e.exports=(e,t,r)=>(e=new n(e,r),t=new n(t,r),e.intersects(t,r))},27309:function(e,t,r){let n=r(83001);e.exports=(e,t,r)=>n(e,t,"<",r)},78536:function(e,t,r){let n=r(95012),i=r(85461);e.exports=(e,t,r)=>{let s=null,o=null,a=null;try{a=new i(t,r)}catch(e){return null}return e.forEach(e=>{a.test(e)&&(!s||-1===o.compare(e))&&(o=new n(s=e,r))}),s}},71496:function(e,t,r){let n=r(95012),i=r(85461);e.exports=(e,t,r)=>{let s=null,o=null,a=null;try{a=new i(t,r)}catch(e){return null}return e.forEach(e=>{a.test(e)&&(!s||1===o.compare(e))&&(o=new n(s=e,r))}),s}},61407:function(e,t,r){let n=r(95012),i=r(85461),s=r(38993);e.exports=(e,t)=>{e=new i(e,t);let r=new n("0.0.0");if(e.test(r)||(r=new n("0.0.0-0"),e.test(r)))return r;r=null;for(let t=0;t<e.set.length;++t){let i=e.set[t],o=null;i.forEach(e=>{let t=new n(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":(!o||s(t,o))&&(o=t);break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${e.operator}`)}}),o&&(!r||s(r,o))&&(r=o)}return r&&e.test(r)?r:null}},83001:function(e,t,r){let n=r(95012),i=r(1961),{ANY:s}=i,o=r(85461),a=r(23611),l=r(38993),u=r(95215),c=r(51864),h=r(4916);e.exports=(e,t,r,d)=>{let f,p,g,y,m;switch(e=new n(e,d),t=new o(t,d),r){case">":f=l,p=c,g=u,y=">",m=">=";break;case"<":f=u,p=h,g=l,y="<",m="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(a(e,t,d))return!1;for(let r=0;r<t.set.length;++r){let n=t.set[r],o=null,a=null;if(n.forEach(e=>{e.semver===s&&(e=new i(">=0.0.0")),o=o||e,a=a||e,f(e.semver,o.semver,d)?o=e:g(e.semver,a.semver,d)&&(a=e)}),o.operator===y||o.operator===m||(!a.operator||a.operator===y)&&p(e,a.semver)||a.operator===m&&g(e,a.semver))return!1}return!0}},8268:function(e,t,r){let n=r(23611),i=r(75953);e.exports=(e,t,r)=>{let s=[],o=null,a=null,l=e.sort((e,t)=>i(e,t,r));for(let e of l)n(e,t,r)?(a=e,o||(o=e)):(a&&s.push([o,a]),a=null,o=null);o&&s.push([o,null]);let u=[];for(let[e,t]of s)e===t?u.push(e):t||e!==l[0]?t?e===l[0]?u.push(`<=${t}`):u.push(`${e} - ${t}`):u.push(`>=${e}`):u.push("*");let c=u.join(" || "),h="string"==typeof t.raw?t.raw:String(t);return c.length<h.length?c:t}},6394:function(e,t,r){let n=r(85461),i=r(1961),{ANY:s}=i,o=r(23611),a=r(75953),l=[new i(">=0.0.0-0")],u=[new i(">=0.0.0")],c=(e,t,r)=>{let n,i,c,f,p,g,y;if(e===t)return!0;if(1===e.length&&e[0].semver===s){if(1===t.length&&t[0].semver===s)return!0;e=r.includePrerelease?l:u}if(1===t.length&&t[0].semver===s){if(r.includePrerelease)return!0;t=u}let m=new Set;for(let t of e)">"===t.operator||">="===t.operator?n=h(n,t,r):"<"===t.operator||"<="===t.operator?i=d(i,t,r):m.add(t.semver);if(m.size>1||n&&i&&((c=a(n.semver,i.semver,r))>0||0===c&&(">="!==n.operator||"<="!==i.operator)))return null;for(let e of m){if(n&&!o(e,String(n),r)||i&&!o(e,String(i),r))return null;for(let n of t)if(!o(e,String(n),r))return!1;return!0}let v=!!i&&!r.includePrerelease&&!!i.semver.prerelease.length&&i.semver,b=!!n&&!r.includePrerelease&&!!n.semver.prerelease.length&&n.semver;for(let e of(v&&1===v.prerelease.length&&"<"===i.operator&&0===v.prerelease[0]&&(v=!1),t)){if(y=y||">"===e.operator||">="===e.operator,g=g||"<"===e.operator||"<="===e.operator,n){if(b&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===b.major&&e.semver.minor===b.minor&&e.semver.patch===b.patch&&(b=!1),">"===e.operator||">="===e.operator){if((f=h(n,e,r))===e&&f!==n)return!1}else if(">="===n.operator&&!o(n.semver,String(e),r))return!1}if(i){if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),"<"===e.operator||"<="===e.operator){if((
58p=d(i,e,r))===e&&p!==i)return!1}else if("<="===i.operator&&!o(i.semver,String(e),r))return!1}if(!e.operator&&(i||n)&&0!==c)return!1}return(!n||!g||!!i||0===c)&&(!i||!y||!!n||0===c)&&!b&&!v},h=(e,t,r)=>{if(!e)return t;let n=a(e.semver,t.semver,r);return n>0?e:n<0?t:">"===t.operator&&">="===e.operator?t:e},d=(e,t,r)=>{if(!e)return t;let n=a(e.semver,t.semver,r);return n<0?e:n>0?t:"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,r={})=>{if(e===t)return!0;e=new n(e,r),t=new n(t,r);let i=!1;t:for(let n of e.set){for(let e of t.set){let t=c(n,e,r);if(i=i||null!==t,t)continue t}if(i)return!1}return!0}},59406:function(e,t,r){let n=r(85461);e.exports=(e,t)=>new n(e,t).set.map(e=>e.map(e=>e.value).join(" ").trim().split(" "))},9212:function(e,t,r){let n=r(85461);e.exports=(e,t)=>{try{return new n(e,t).range||"*"}catch(e){return null}}},40333:function(e,t,r){var n=r(10632).Buffer;function i(e,t){this._block=n.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}i.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=n.from(e,t));for(var r=this._block,i=this._blockSize,s=e.length,o=this._len,a=0;a<s;){for(var l=o%i,u=Math.min(s-a,i-l),c=0;c<u;c++)r[l+c]=e[a+c];o+=u,a+=u,o%i==0&&this._update(r)}return this._len+=s,this},i.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0;this._block.writeUInt32BE((r-n)/4294967296,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var i=this._hash();return e?i.toString(e):i},i.prototype._update=function(){throw Error("_update must be implemented by subclass")},e.exports=i},42724:function(e,t,r){var n=e.exports=function(e){var t=n[e=e.toLowerCase()];if(!t)throw Error(e+" is not supported (we accept pull requests)");return new t};n.sha=r(53799),n.sha1=r(4836),n.sha224=r(44455),n.sha256=r(51250),n.sha384=r(43836),n.sha512=r(58103)},53799:function(e,t,r){var n=r(87398),i=r(40333),s=r(10632).Buffer,o=[1518500249,1859775393,-1894007588,-899497514],a=Array(80);function l(){this.init(),this._w=a,i.call(this,64,56)}n(l,i),l.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},l.prototype._update=function(e){for(var t=this._w,r=0|this._a,n=0|this._b,i=0|this._c,s=0|this._d,a=0|this._e,l=0;l<16;++l)t[l]=e.readInt32BE(4*l);for(;l<80;++l)t[l]=t[l-3]^t[l-8]^t[l-14]^t[l-16];for(var u=0;u<80;++u){var c,h,d,f,p,g=~~(u/20),y=((c=r)<<5|c>>>27)+(h=n,d=i,f=s,0===g?h&d|~h&f:2===g?h&d|h&f|d&f:h^d^f)+a+t[u]+o[g]|0;a=s,s=i,i=(p=n)<<30|p>>>2,n=r,r=y}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0},l.prototype._hash=function(){var e=s.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=l},4836:function(e,t,r){var n=r(87398),i=r(40333),s=r(10632).Buffer,o=[1518500249,1859775393,-1894007588,-899497514],a=Array(80);function l(){this.init(),this._w=a,i.call(this,64,56)}n(l,i),l.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},l.prototype._update=function(e){for(var t=this._w,r=0|this._a,n=0|this._b,i=0|this._c,s=0|this._d,a=0|this._e,l=0;l<16;++l)t[l]=e.readInt32BE(4*l);for(;l<80;++l)t[l]=(c=t[l-3]^t[l-8]^t[l-14]^t[l-16])<<1|c>>>31;for(var u=0;u<80;++u){var c,h,d,f,p,g,y=~~(u/20),m=((h=r)<<5|h>>>27)+(d=n,f=i,p=s,0===y?d&f|~d&p:2===y?d&f|d&p|f&p:d^f^p)+a+t[u]+o[y]|0;a=s,s=i,i=(g=n)<<30|g>>>2,n=r,r=m}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0},l.prototype._hash=function(){var e=s.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=l},44455:function(e,t,r){var n=r(87398),i=r(51250),s=r(40333),o=r(10632).Buffer,a=Array(64);function l(){this.init(),this._w=a,s.call(this,64,56)}n(l,i),l.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},l.prototype._hash=function(){var e=o.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=l},51250:function(e,t,r){var n=r(87398),i=r(40333),s=r(10632).Buffer,o=[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,2756
58734187,3204031479,3329325298],a=Array(64);function l(){this.init(),this._w=a,i.call(this,64,56)}n(l,i),l.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},l.prototype._update=function(e){for(var t=this._w,r=0|this._a,n=0|this._b,i=0|this._c,s=0|this._d,a=0|this._e,l=0|this._f,u=0|this._g,c=0|this._h,h=0;h<16;++h)t[h]=e.readInt32BE(4*h);for(;h<64;++h)t[h]=(((f=t[h-2])>>>17|f<<15)^(f>>>19|f<<13)^f>>>10)+t[h-7]+(((p=t[h-15])>>>7|p<<25)^(p>>>18|p<<14)^p>>>3)+t[h-16]|0;for(var d=0;d<64;++d){var f,p,g,y,m,v,b,w,_,E=c+(((g=a)>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7))+(y=a,m=l,(v=u)^y&(m^v))+o[d]+t[d]|0,S=(((b=r)>>>2|b<<30)^(b>>>13|b<<19)^(b>>>22|b<<10))+((w=r)&(_=n)|i&(w|_))|0;c=u,u=l,l=a,a=s+E|0,s=i,i=n,n=r,r=E+S|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0,this._f=l+this._f|0,this._g=u+this._g|0,this._h=c+this._h|0},l.prototype._hash=function(){var e=s.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=l},43836:function(e,t,r){var n=r(87398),i=r(58103),s=r(40333),o=r(10632).Buffer,a=Array(160);function l(){this.init(),this._w=a,s.call(this,128,112)}n(l,i),l.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},l.prototype._hash=function(){var e=o.allocUnsafe(48);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},e.exports=l},58103:function(e,t,r){var n=r(87398),i=r(40333),s=r(10632).Buffer,o=[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,
581126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],a=Array(160);function l(){this.init(),this._w=a,i.call(this,128,112)}function u(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function c(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function h(e,t){return e>>>0<t>>>0?1:0}n(l,i),l.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},l.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,s=0|this._dh,a=0|this._eh,l=0|this._fh,d=0|this._gh,f=0|this._hh,p=0|this._al,g=0|this._bl,y=0|this._cl,m=0|this._dl,v=0|this._el,b=0|this._fl,w=0|this._gl,_=0|this._hl,E=0;E<32;E+=2)t[E]=e.readInt32BE(4*E),t[E+1]=e.readInt32BE(4*E+4);for(;E<160;E+=2){var S,A,k,C,I,x,P,O,T=t[E-30],R=t[E-30+1],N=((S=T)>>>1|(A=R)<<31)^(S>>>8|A<<24)^S>>>7,D=((k=R)>>>1|(C=T)<<31)^(k>>>8|C<<24)^(k>>>7|C<<25);T=t[E-4],R=t[E-4+1];var B=((I=T)>>>19|(x=R)<<13)^(x>>>29|I<<3)^I>>>6,M=((P=R)>>>19|(O=T)<<13)^(O>>>29|P<<3)^(P>>>6|O<<26),L=t[E-14],U=t[E-14+1],j=t[E-32],F=t[E-32+1],q=D+U|0,H=N+L+h(q,D)|0;H=(H=H+B+h(q=q+M|0,M)|0)+j+h(q=q+F|0,F)|0,t[E]=H,t[E+1]=q}for(var z=0;z<160;z+=2){H=t[z],q=t[z+1];var $,V,W,G,K,J,Y,Q,Z,X,ee=($=r)&(V=n)|i&($|V),et=(W=p)&(G=g)|y&(W|G),er=u(r,p),en=u(p,r),ei=c(a,v),es=c(v,a),eo=o[z],ea=o[z+1],el=(K=a,J=l,(Y=d)^K&(J^Y)),eu=(Q=v,Z=b,(X=w)^Q&(Z^X)),ec=_+es|0,eh=f+ei+h(ec,_)|0;eh=(eh=(eh=eh+el+h(ec=ec+eu|0,eu)|0)+eo+h(ec=ec+ea|0,ea)|0)+H+h(ec=ec+q|0,q)|0;var ed=en+et|0,ef=er+ee+h(ed,en)|0;f=d,_=w,d=l,w=b,l=a,b=v,a=s+eh+h(v=m+ec|0,m)|0,s=i,m=y,i=n,y=g,n=r,g=p,r=eh+ef+h(p=ec+ed|0,ec)|0}this._al=this._al+p|0,this._bl=this._bl+g|0,this._cl=this._cl+y|0,this._dl=this._dl+m|0,this._el=this._el+v|0,this._fl=this._fl+b|0,this._gl=this._gl+w|0,this._hl=this._hl+_|0,this._ah=this._ah+r+h(this._al,p)|0,this._bh=this._bh+n+h(this._bl,g)|0,this._ch=this._ch+i+h(this._cl,y)|0,this._dh=this._dh+s+h(this._dl,m)|0,this._eh=this._eh+a+h(this._el,v)|0,this._fh=this._fh+l+h(this._fl,b)|0,this._gh=this._gh+d+h(this._gl,w)|0,this._hh=this._hh+f+h(this._hl,_)|0},l.prototype._hash=function(){var e=s.allocUnsafe(64);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=l},76442:function(e){"use strict";e.exports=(e,t)=>{if(!("string"==typeof e&&"string"==typeof t))throw TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];let r=e.indexOf(t);return -1===r?[e]:[e.slice(0,r),e.slice(r+t.length)]}},29276:function(e){"use strict";e.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)},56123:function(e,t,r){"use strict";var n=r(10632).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function s(e){var t;switch(this.encoding=function(e){var t=function(e){var t;if(!e)return"utf8";for(;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=l,this.end=u,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=c,this.end=h,t=3;break;default:this.write=d,this.end=f;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if((192&t[0])!=128)return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if((192&t[1])!=128)return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&(192&t[2])!=128)return e.lastNeed=2,"�"}}(this,e,0);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):void(e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length)}function l(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function c(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function h(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function f(e){return e&&e.length?this.write(e):""}t.s=s,s.prototype.write=function(e){var t,r;if(0===e.length)return"";if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},s.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},s.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=o(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||-2===i?0:(i=o(t[n]))>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||-2===i?0:(i=o(t[n]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},s.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},57139:function(e,t){"use strict";function r(e,t,r){return t<=e&&e<=r}function n(e){if(void 0===e)return{};if(e===Object(e))return e;throw TypeError("Could not convert argument to dictionary")}function i(e){this.tokens=[].slice.call(e)}function s(e,t){if(e)throw TypeError("Decoder error");return t||65533}
58i.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():-1},prepend:function(e){if(Array.isArray(e))for(;e.length;)this.tokens.unshift(e.pop());else this.tokens.unshift(e)},push:function(e){if(Array.isArray(e))for(;e.length;)this.tokens.push(e.shift());else this.tokens.push(e)}};var o="utf-8";function a(e,t){if(!(this instanceof a))return new a(e,t);if((e=void 0!==e?String(e).toLowerCase():o)!==o)throw Error("Encoding not supported. Only utf-8 is supported");t=n(t),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=!!t.fatal,this._ignoreBOM=!!t.ignoreBOM,Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}function l(e,t){if(!(this instanceof l))return new l(e,t);if((e=void 0!==e?String(e).toLowerCase():o)!==o)throw Error("Encoding not supported. Only utf-8 is supported");t=n(t),this._streaming=!1,this._encoder=null,this._options={fatal:!!t.fatal},Object.defineProperty(this,"encoding",{value:"utf-8"})}function u(e){var t=e.fatal,n=0,i=0,o=0,a=128,l=191;this.handler=function(e,u){if(-1===u&&0!==o)return o=0,s(t);if(-1===u)return -1;if(0===o){if(r(u,0,127))return u;if(r(u,194,223))o=1,n=u-192;else if(r(u,224,239))224===u&&(a=160),237===u&&(l=159),o=2,n=u-224;else{if(!r(u,240,244))return s(t);240===u&&(a=144),244===u&&(l=143),o=3,n=u-240}return n<<=6*o,null}if(!r(u,a,l))return n=o=i=0,a=128,l=191,e.prepend(u),s(t);if(a=128,l=191,i+=1,n+=u-128<<6*(o-i),i!==o)return null;var c=n;return n=o=i=0,c}}function c(e){e.fatal,this.handler=function(e,t){if(-1===t)return -1;if(r(t,0,127))return t;r(t,128,2047)?(n=1,i=192):r(t,2048,65535)?(n=2,i=224):r(t,65536,1114111)&&(n=3,i=240);for(var n,i,s=[(t>>6*n)+i];n>0;){var o=t>>6*(n-1);s.push(128|63&o),n-=1}return s}}a.prototype={decode:function(e,t){r="object"==typeof e&&e instanceof ArrayBuffer?new Uint8Array(e):"object"==typeof e&&"buffer"in e&&e.buffer instanceof ArrayBuffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(0),t=n(t),this._streaming||(this._decoder=new u({fatal:this._fatal}),this._BOMseen=!1),this._streaming=!!t.stream;for(var r,s,o=new i(r),a=[];!o.endOfStream()&&-1!==(s=this._decoder.handler(o,o.read()));)null!==s&&(Array.isArray(s)?a.push.apply(a,s):a.push(s));if(!this._streaming){do{if(-1===(s=this._decoder.handler(o,o.read())))break;if(null===s)continue;Array.isArray(s)?a.push.apply(a,s):a.push(s)}while(!o.endOfStream());this._decoder=null}return!a.length||-1===["utf-8"].indexOf(this.encoding)||this._ignoreBOM||this._BOMseen||(65279===a[0]?(this._BOMseen=!0,a.shift()):this._BOMseen=!0),function(e){for(var t="",r=0;r<e.length;++r){var n=e[r];n<=65535?t+=String.fromCharCode(n):(n-=65536,t+=String.fromCharCode((n>>10)+55296,(1023&n)+56320))}return t}(a)}},l.prototype={encode:function(e,t){e=e?String(e):"",t=n(t),this._streaming||(this._encoder=new c(this._options)),this._streaming=!!t.stream;for(var r,s=[],o=new i(function(e){for(var t=String(e),r=t.length,n=0,i=[];n<r;){var s=t.charCodeAt(n);if(s<55296||s>57343)i.push(s);else if(56320<=s&&s<=57343)i.push(65533);else if(55296<=s&&s<=56319){if(n===r-1)i.push(65533);else{var o=e.charCodeAt(n+1);if(56320<=o&&o<=57343){var a=1023&s,l=1023&o;i.push(65536+(a<<10)+l),n+=1}else i.push(65533)}}n+=1}return i}(e));!o.endOfStream()&&-1!==(r=this._encoder.handler(o,o.read()));)Array.isArray(r)?s.push.apply(s,r):s.push(r);if(!this._streaming){for(;-1!==(r=this._encoder.handler(o,o.read()));)Array.isArray(r)?s.push.apply(s,r):s.push(r);this._encoder=null}return new Uint8Array(s)}},t.TextEncoder=l,t.TextDecoder=a},22058:function(e){var t;t=function(){function e(t,r,n,i,s,o,a){var l,u,c,h="",d=0,f=i.slice(0);if(f.push([r,n])&&i.length>0&&(i.forEach(function(e,t){t>0&&(h+=(e[1]?" ":"│")+"  "),c||e[0]!==r||(c=!0)}),h+=(l=n?"└":"├",t?l+="─ ":l+="──┐",l+t),s&&("object"!=typeof r||r instanceof Date)&&(h+=": "+r),c&&(h+=" (circular ref.)"),a(h)),!c&&"object"==typeof r){var p=function(e,t){var r=[];for(var n in e)e.hasOwnProperty(n)&&(!t||"function"!=typeof e[n])&&r.push(n);return r}(r,o);p.forEach(function(t){u=++d===p.length,e(t,r[t],u,f,s,o,a)})}}var t={};return t.asLines=function(t,r,n,i){e(".",t,!1,[],r,"function"!=typeof n&&n,i||n)},t.asTree=function(t,r,n){var i="";return e(".",t,!1,[],r,n,function(e){i+=e+"\n"}),i},t},e.exports=t()},20310:function(e,t,r){e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}};function n(e){try{if(!r.g.localStorage)return!1}catch(e){return!1}var t=r.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}},3538:function(e,t,r){"use strict";r.d(t,{v4:function(){return u}});for(var n,i=new Uint8Array(16),s=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,o=[],a=0;a<256;++a)o.push((a+256).toString(16).substr(1));var l=function(e){var t=arguments.length>
581&&void 0!==arguments[1]?arguments[1]:0,r=(o[e[t+0]]+o[e[t+1]]+o[e[t+2]]+o[e[t+3]]+"-"+o[e[t+4]]+o[e[t+5]]+"-"+o[e[t+6]]+o[e[t+7]]+"-"+o[e[t+8]]+o[e[t+9]]+"-"+o[e[t+10]]+o[e[t+11]]+o[e[t+12]]+o[e[t+13]]+o[e[t+14]]+o[e[t+15]]).toLowerCase();if(!("string"==typeof r&&s.test(r)))throw TypeError("Stringified UUID is invalid");return r},u=function(e,t,r){var s=(e=e||{}).random||(e.rng||function(){if(!n&&!(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(i)})();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t){r=r||0;for(var o=0;o<16;++o)t[r+o]=s[o];return t}return l(s)}},7035:function(e){"use strict";e.exports=function(){throw Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},44924:function(e){e.exports=function(){for(var e={},r=0;r<arguments.length;r++){var n=arguments[r];for(var i in n)t.call(n,i)&&(e[i]=n[i])}return e};var t=Object.prototype.hasOwnProperty},78227:function(e,t,r){"use strict";let n=r(57963);e.exports=s;let i=function(){function e(e){return void 0!==e&&e}try{if("undefined"!=typeof globalThis)return globalThis;return Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch(t){return e(self)||e(window)||e(this)||{}}}().console||{};function s(e){var t,r;(e=e||{}).browser=e.browser||{};let n=e.browser.transmit;if(n&&"function"!=typeof n.send)throw Error("pino: transmit option must have a send function");let c=e.browser.write||i;e.browser.write&&(e.browser.asObject=!0);let h=e.serializers||{},g=Array.isArray(t=e.browser.serialize)?t.filter(function(e){return"!stdSerializers.err"!==e}):!0===t&&Object.keys(h),y=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(y=!1),"function"==typeof c&&(c.error=c.fatal=c.warn=c.info=c.debug=c.trace=c),!1===e.enabled&&(e.level="silent");let m=e.level||"info",v=Object.create(c);v.log||(v.log=d),Object.defineProperty(v,"levelVal",{get:function(){return"silent"===this.level?1/0:this.levels.values[this.level]}}),Object.defineProperty(v,"level",{get:function(){return this._level},set:function(e){if("silent"!==e&&!this.levels.values[e])throw Error("unknown level "+e);this._level=e,o(b,v,"error","log"),o(b,v,"fatal","error"),o(b,v,"warn","error"),o(b,v,"info","log"),o(b,v,"debug","log"),o(b,v,"trace","log")}});let b={transmit:n,serialize:g,asObject:e.browser.asObject,levels:["error","fatal","warn","info","debug","trace"],timestamp:"function"==typeof(r=e).timestamp?r.timestamp:!1===r.timestamp?f:p};return v.levels=s.levels,v.level=m,v.setMaxListeners=v.getMaxListeners=v.emit=v.addListener=v.on=v.prependListener=v.once=v.prependOnceListener=v.removeListener=v.removeAllListeners=v.listeners=v.listenerCount=v.eventNames=v.write=v.flush=d,v.serializers=h,v._serialize=g,v._stdErrSerialize=y,v.child=function(t,r){if(!t)throw Error("missing bindings for child Pino");r=r||{},g&&t.serializers&&(r.serializers=t.serializers);let i=r.serializers;if(g&&i){var s=Object.assign({},h,i),o=!0===e.browser.serialize?Object.keys(s):g;delete t.serializers,a([t],o,s,this._stdErrSerialize)}function c(e){this._childLevel=(0|e._childLevel)+1,this.error=l(e,t,"error"),this.fatal=l(e,t,"fatal"),this.warn=l(e,t,"warn"),this.info=l(e,t,"info"),this.debug=l(e,t,"debug"),this.trace=l(e,t,"trace"),s&&(this.serializers=s,this._serialize=o),n&&(this._logEvent=u([].concat(e._logEvent.bindings,t)))}return c.prototype=this,new c(this)},n&&(v._logEvent=u()),v}function o(e,t,r,o){let l=Object.getPrototypeOf(t);t[r]=t.levelVal>t.levels.values[r]?d:l[r]?l[r]:i[r]||i[o]||d,function(e,t,r){if(e.transmit||t[r]!==d){var o;t[r]=(o=t[r],function(){let l=e.timestamp(),c=Array(arguments.length),h=Object.getPrototypeOf&&Object.getPrototypeOf(this)===i?i:this;for(var d=0;d<c.length;d++)c[d]=arguments[d];if(e.serialize&&!e.asObject&&a(c,this._serialize,this.serializers,this._stdErrSerialize),e.asObject?o.call(h,function(e,t,r,i){e._seri
58alize&&a(r,e._serialize,e.serializers,e._stdErrSerialize);let o=r.slice(),l=o[0],u={};i&&(u.time=i),u.level=s.levels.values[t];let c=(0|e._childLevel)+1;if(c<1&&(c=1),null!==l&&"object"==typeof l){for(;c--&&"object"==typeof o[0];)Object.assign(u,o.shift());l=o.length?n(o.shift(),o):void 0}else"string"==typeof l&&(l=n(o.shift(),o));return void 0!==l&&(u.msg=l),u}(this,r,c,l)):o.apply(h,c),e.transmit){let n=e.transmit.level||t.level,i=s.levels.values[n],o=s.levels.values[r];if(o<i)return;(function(e,t,r){let n=t.send,i=t.ts,s=t.methodLevel,o=t.methodValue,l=t.val,c=e._logEvent.bindings;a(r,e._serialize||Object.keys(e.serializers),e.serializers,void 0===e._stdErrSerialize||e._stdErrSerialize),e._logEvent.ts=i,e._logEvent.messages=r.filter(function(e){return -1===c.indexOf(e)}),e._logEvent.level.label=s,e._logEvent.level.value=o,n(s,e._logEvent,l),e._logEvent=u(c)})(this,{ts:l,methodLevel:r,methodValue:o,transmitLevel:n,transmitValue:s.levels.values[e.transmit.level||t.level],send:e.transmit.send,val:t.levelVal},c)}})}}(e,t,r)}function a(e,t,r,n){for(let i in e)if(n&&e[i]instanceof Error)e[i]=s.stdSerializers.err(e[i]);else if("object"==typeof e[i]&&!Array.isArray(e[i]))for(let n in e[i])t&&t.indexOf(n)>-1&&n in r&&(e[i][n]=r[n](e[i][n]))}function l(e,t,r){return function(){let n=Array(1+arguments.length);n[0]=t;for(var i=1;i<n.length;i++)n[i]=arguments[i-1];return e[r].apply(this,n)}}function u(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function c(){return{}}function h(e){return e}function d(){}function f(){return!1}function p(){return Date.now()}s.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},s.stdSerializers={mapHttpRequest:c,mapHttpResponse:c,wrapRequestSerializer:h,wrapResponseSerializer:h,wrapErrorSerializer:h,req:c,res:c,err:function(e){let t={type:e.constructor.name,msg:e.message,stack:e.stack};for(let r in e)void 0===t[r]&&(t[r]=e[r]);return t}},s.stdTimeFunctions=Object.assign({},{nullTime:f,epochTime:p,unixTime:function(){return Math.round(Date.now()/1e3)},isoTime:function(){return new Date(Date.now()).toISOString()}})},13900:function(e,t,r){"use strict";var n=r(9109).Buffer;let i=r(23466),s=r(51861);class o extends i.EventEmitter{address;rpc_id;queue;options;autoconnect;ready;reconnect;reconnect_timer_id;reconnect_interval;max_reconnects;rest_options;current_reconnects;generate_request_id;socket;webSocketFactory;dataPack;constructor(e,t="ws://localhost:8080",{autoconnect:r=!0,reconnect:n=!0,reconnect_interval:i=1e3,max_reconnects:o=5,...a}={},l,u){super(),this.webSocketFactory=e,this.queue={},this.rpc_id=0,this.address=t,this.autoconnect=r,this.ready=!1,this.reconnect=n,this.reconnect_timer_id=void 0,this.reconnect_interval=i,this.max_reconnects=o,this.rest_options=a,this.current_reconnects=0,this.generate_request_id=l||(()=>++this.rpc_id),u?this.dataPack=u:this.dataPack=new s.DefaultDataPack,this.autoconnect&&this._connect(this.address,{autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects,...this.rest_options})}connect(){this.socket||this._connect(this.address,{autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects,...this.rest_options})}call(e,t,r,n){return n||"object"!=typeof r||(n=r,r=null),new Promise((i,s)=>{if(!this.ready)return s(Error("socket not ready"));let o=this.generate_request_id(e,t);this.socket.send(this.dataPack.encode({jsonrpc:"2.0",method:e,params:t||void 0,id:o}),n,e=>{if(e)return s(e);this.queue[o]={promise:[i,s]},r&&(this.queue[o].timeout=setTimeout(()=>{delete this.queue[o],s(Error("reply timeout"))},r))})})}async login(e){let t=await this.call("rpc.login",e);if(!t)throw Error("authentication failed");return t}async listMethods(){return await this.call("__listMethods")}notify(e,t){return new Promise((r,n)=>{if(!this.ready)return n(Error("socket not ready"));this.socket.send(this.dataPack.encode({jsonrpc:"2.0",method:e,params:t}),e=>{if(e)return n(e);r()})})}async subscribe(e){"string"==typeof e&&(e=[e]);let t=await this.call("rpc.on",e);if("string"==typeof e&&"ok"!==t[e])throw Error("Failed subscribing to an event '"+e+"' with: "+t[e]);return t}async unsubscribe(e){"string"==typeof e&&(e=[e]);let t=await this.call("rpc.off",e);if("string"==typeof e&&"ok"!==t[e])throw Error("Failed unsubscribing from an event with: "+t);return t}close(e,t){this.socket.close(e||1e3,t)}setAutoReconnect(e){this.reconnect=e}setReconnectInterval(e){this.reconnect_interval=e}setMaxReconnects(e){this.max_reconnects=e}_connect(e,t){clearTimeout(this.reconnect_timer_id),this.socket=this.webSocketFactory(e,t),this.socket.addEventListener("open",()=>
vendor: 1,109 bytes, line 58
58{this.ready=!0,this.emit("open"),this.current_reconnects=0}),this.socket.addEventListener("message",({data:e})=>{e instanceof ArrayBuffer&&(e=n.from(e).toString());try{e=this.dataPack.decode(e)}catch(e){return}if(e.notification&&this.listeners(e.notification).length){if(!Object.keys(e.params).length)return this.emit(e.notification);let t=[e.notification];if(e.params.constructor===Object)t.push(e.params);else for(let r=0;r<e.params.length;r++)t.push(e.params[r]);return Promise.resolve().then(()=>{this.emit.apply(this,t)})}if(!this.queue[e.id])return e.method?Promise.resolve().then(()=>{this.emit(e.method,e?.params)}):void 0;"error"in e=="result"in e&&this.queue[e.id].promise[1](Error('Server response malformed. Response must include either "result" or "error", but not both.')),this.queue[e.id].timeout&&clearTimeout(this.queue[e.id].timeout),e.error?this.queue[e.id].promise[1](e.error):this.queue[e.id].promise[0](e.result),delete this.queue[e.id]}),this.socket.addEventListener("error",e=>this.emit("error",e)),this.socket.addEventListener("close",({code:r,reason:n})=>{this.ready&&setTimeout(()=>
58this.emit("close",r,n),0),this.ready=!1,this.socket=void 0,1e3!==r&&(this.current_reconnects++,this.reconnect&&(this.max_reconnects>this.current_reconnects||0===this.max_reconnects)&&(this.reconnect_timer_id=setTimeout(()=>this._connect(e,t),this.reconnect_interval)))})}}t.Z=o},67331:function(e,t,r){"use strict";let n=r(23466);class i extends n.EventEmitter{socket;constructor(e,t,r){super(),this.socket=new window.WebSocket(e,r),this.socket.onopen=()=>this.emit("open"),this.socket.onmessage=e=>this.emit("message",e.data),this.socket.onerror=e=>this.emit("error",e),this.socket.onclose=e=>{this.emit("close",e.code,e.reason)}}send(e,t,r){let n=r||t;try{this.socket.send(e),n()}catch(e){n(e)}}close(e,t){this.socket.close(e,t)}addEventListener(e,t,r){this.socket.addEventListener(e,t,r)}}t.Z=function(e,t){return new i(e,t)}},51861:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createError=t.DefaultDataPack=void 0;let r=new Map([[-32e3,"Event not provided"],[-32600,"Invalid Request"],[-32601,"Method not found"],[-32602,"Invalid params"],[-32603,"Internal error"],[-32604,"Params not found"],[-32605,"Method forbidden"],[-32606,"Event forbidden"],[-32700,"Parse error"]]);class n{encode(e){return JSON.stringify(e)}decode(e){return JSON.parse(e)}}t.DefaultDataPack=n,t.createError=function(e,t){let n={code:e,message:r.get(e)||"Internal Server Error"};return t&&(n.data=t),n}},36781:function(e,t,r){"use strict";let n,i,s,o,a;r.d(t,{tJ:function(){return id},Qm:function(){return ig},sW:function(){return ip}});var l,u,c,h,d,f,p,g,y,m,v,b,w,_,E={};r.r(E),r.d(E,{hasBrowserEnv:function(){return t7},hasStandardBrowserEnv:function(){return t9},hasStandardBrowserWebWorkerEnv:function(){return re},origin:function(){return rt}});var S={};function A(e,t,r,n){return new(r||(r=Promise))(function(i,s){function o(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})}r.r(S),r.d(S,{arbitrumBlueberry:function(){return ni},arbitrumNova:function(){return nn},astarZKatana:function(){return nt},astarZkEVM:function(){return nr},astarZkyoto:function(){return nu},cyberMainnet:function(){return na},cyberTestnet:function(){return nl},degen:function(){return nc},gelatoOPTestnet:function(){return ne},opCelestiaRaspberry:function(){return ns},polygonBlackberry:function(){return no}}),"function"==typeof SuppressedError&&SuppressedError;let k=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"kernel",type:"address"},{indexed:!0,internalType:"address",name:"oldOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnerChanged",type:"event"},{inputs:[{internalType:"bytes",name:"",type:"bytes"}],name:"disable",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"ecdsaValidatorStorage",outputs:[{internalType:"address",name:"owner",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"_data",type:"bytes"}],name:"enable",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"_caller",type:"address"},{internalType:"bytes",name:"",type:"bytes"}],name:"validCaller",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"hash",type:"bytes32"},{internalType:"bytes",name:"signature",type:"bytes"}],name:"validateSignature",outputs:[{internalType:"ValidationData",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"bytes",name:"initCode",type:"bytes"},{internalType:"bytes",name:"callData",type:"bytes"},{internalType:"uint256",name:"callGasLimit",type:"uint256"},{internalType:"uint256",name:"verificationGasLimit",type:"uint256"},{internalType:"uint256",name:"preVerificationGas",type:"uint256"},{internalType:"uint256",name:"maxFeePerGas",type:"uint256"},{internalType:"uint256",name:"maxPriorityFeePerGas",type:"uint256"},{internalType:"bytes",name:"paymasterAndData",type:"bytes"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct UserOperation",name:"_userOp",type:"tuple"},{internalType:"bytes32",name:"_userOpHash",type:"bytes32"},{internalType:"uint256",name:"",type:"uint256"}],name:"validateUserOp",outputs:[{internalType:"ValidationData",name:"validationData",type:"uint256"}],stateMutability:"payable",type:"function"}],C=[{inputs:[{internalType:"contract IEntryPoint",name:"_entryPoint",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"AlreadyInitialized",type:"error"},{inputs:[],name:"DisabledMode",type:"error"},{inputs:[],name:"NotAuthorizedCaller",type:"error"},{inputs:[],name:"NotEntryPoint",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldValidator",type:"address"},{indexed:!0,internalType:"address",name:"newValidator",type:"address"}],name:"DefaultValidatorChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes4",name:"selector",type:"bytes4"},{indexed:!0,internalType:"address",name:"executor",type:"address"},{indexed:!0,internalType:"address",name:"validator",type:"address"}],name:"ExecutionChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"Received",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"newImplementation",type:"address"}],name:"Upgraded",type:"event"},{stateMutability:"payable",type:"fallback"},{inputs:[{internalType:"bytes4",name:"_disableFlag",type:"bytes4"}],name:"disableMode",outputs:[],stateMutability:"payable",type:"function"},{inputs:[],name:"eip712Domain",outputs:[{internalType:"bytes1",name:"fields",type:"bytes1"},{internalType:"string",name:"name",type:"string"},{internalType:"string",name:"version",type:"string"},{internalType:"uint256",name:"chainId",type:"uint256"},{internalType:"address",name:"verifyingContract",type:"address"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"uint256[]",name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"entryPoint",outputs:[{internalType:"contract IEntryPoint",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"},{internalType:"enum Operation",name:"",type:"uint8"}],name:"execute",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],internalType:"struct Call[]",name:"calls",type:"tuple[]"}],name:"executeBatch",outputs:[],stateMutability:"payable",type:"function"},{inputs:[],name:"getDefaultValidator",outputs:[{internalType:"contract IKernelValidator",name:"validator",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"getDisabledMode",outputs:[{internalType:"bytes4",name:"disabled",type:"bytes4"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"_selector",type:"bytes4"}],name:"getExecution",outputs:[{components:[{internalType:"ValidAfter",name:"validAfter",type:"uint48"},{internalType:"ValidUntil",name:"validUntil",type:"uint48"},{internalType:"address",name:"executor",type:"address"},{internalType:"contract IKernelValidator",name:"validator",type:"address"}],internalType:"struct ExecutionDetail",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[],name:"getLastDisabledTime",outputs:[{internalType:"uint48",name:"",type:"uint48"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint192",name:"key",type:"uint192"}],name:"getNonce",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getNonce",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IKernelValidator",name:"_defaultValidator",type:"address"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"initialize",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes32",name:"hash",type:"bytes32"},{internalType:"bytes",name:"signature",type:"bytes"}],name:"isValidSignature",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"},{internalType:"uint256[]",name:"",type:"uint256[]"},{internalType:"uint256[]",name:"",type:"uint256[]"},{internalType:"bytes",name:"",type:"bytes"}],name:"onERC1155BatchReceived",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"},{internalType:"uint256",name:"",type:"uint256"},{internalType:"bytes",name:"",type:"bytes"}],name:"onERC1155Received",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"},{internalType:"bytes",name:"",type:"bytes"}],name:"onERC721Received",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"contract IKernelValidator",name:"_defaultValidator",type:"address"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"setDefaultValidator",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes4",name:"_selector",type:"bytes4"},{internalType:"address",name:"_executor",type:"address"},{internalType:"contract IKernelValidator",name:"_validator",type:"address"},{internalType:"ValidUntil",name:"_validUntil",type:"uint48"},{internalType:"ValidAfter",name:"_validAfter",type:"uint48"},{internalType:"bytes",name:"_enableData",type:"bytes"}],name:"setExecution",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"_newImplementation",type:"address"}],name:"upgradeTo",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"bytes",name:"initCode",type:"bytes"},{internalType:"bytes",name:"callData",type:"bytes"},{internalType:"uint256",name:"callGasLimit",type:"uint256"},{internalType:"uint256",name:"verificationGasLimit",type:"uint256"},{internalType:"uint256",name:"preVerificationGas",type:"uint256"},{internalType:"uint256",name:"maxFeePerGas",type:"uint256"},{internalType:"uint256",name:"maxPriorityFeePerGas",type:"uint256"},{internalType:"bytes",name:"paymasterAndData",type:"bytes"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct UserOperation",name:"_userOp",type:"tuple"},{internalType:"bytes32",name:"userOpHash",type:"bytes32"},{internalType:"uint256",name:"missingAccountFunds",type:"uint256"}],name:"validateUserOp",outputs:[{internalType:"ValidationData",name:"validationData",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[],name:"version",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{stateMutability:"payable",type:"receive"}],I=[{inputs:[{internalType:"address",name:"_owner",type:"address"},{internalType:"contract IEntryPoint",name:"_entryPoint",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"DeploymentFailed",type:"error"},{inputs:[],name:"NewOwnerIsZeroAddress",type:"error"},{inputs:[],name:"NoHandoverRequest",type:"error"},{inputs:[],name:"SaltDoesNotStartWithCaller",type:"error"},{inputs:[],name:"Unauthorized",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"proxy",type:"address"},{indexed:!0,internalType:"address",name:"implementation",type:"address"}],name:"Deployed",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"pendingOwner",type:"address"}],name:"OwnershipHandoverCanceled",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"pendingOwner",type:"address"}],name:"OwnershipHandoverRequested",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{inputs:[{internalType:"uint32",name:"unstakeDelaySec",type:"uint32"}],name:"addStake",outputs:[],stateMutability:"payable",type:"function"},{inputs:[],name:"cancelOwnershipHandover",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"pendingOwner",type:"address"}],name:"completeOwnershipHandover",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"_implementation",type:"address"},{internalType:"bytes",name:"_data",type:"bytes"},{internalType:"uint256",name:"_index",type:"uint256"}],name:"createAccount",outputs:[{internalType:"address",name:"proxy",type:"address"}],stateMutability:"payable",type:"function"},{inputs:[],name:"entryPoint",outputs:[{internalType:"contract IEntryPoint",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"_data",type:"bytes"},{internalType:"uint256",name:"_index",type:"uint256"}],name:"getAccountAddress",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"initCodeHash",outputs:[{internalType:"bytes32",name:"result",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"isAllowedImplementation",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"result",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"pendingOwner",type:"address"}
vendor: 16,227 bytes, line 58
58],name:"ownershipHandoverExpiresAt",outputs:[{internalType:"uint256",name:"result",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"ownershipHandoverValidFor",outputs:[{internalType:"uint64",name:"",type:"uint64"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"salt",type:"bytes32"}],name:"predictDeterministicAddress",outputs:[{internalType:"address",name:"predicted",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"payable",type:"function"},{inputs:[],name:"requestOwnershipHandover",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"contract IEntryPoint",name:"_entryPoint",type:"address"}],name:"setEntryPoint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_implementation",type:"address"},{internalType:"bool",name:"_allow",type:"bool"}],name:"setImplementation",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"payable",type:"function"},{inputs:[],name:"unlockStake",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address payable",name:"withdrawAddress",type:"address"}],name:"withdrawStake",outputs:[],stateMutability:"nonpayable",type:"function"}],x=[{inputs:[],stateMutability:"nonpayable",type:"constructor"},{inputs:[{internalType:"bytes",name:"transactions",type:"bytes"}],name:"multiSend",outputs:[],stateMutability:"payable",type:"function"}],P=[{inputs:[{internalType:"string",name:"name_",type:"string"},{internalType:"string",name:"symbol_",type:"string"},{internalType:"uint8",name:"decimals_",type:"uint8"},{internalType:"uint256",name:"initialBalance_",type:"uint256"},{internalType:"address payable",name:"feeReceiver_",type:"address"}],stateMutability:"payable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"subtractedValue",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"addedValue",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",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:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}],O=[{inputs:[{internalType:"uint256",name:"preOpGas",type:"uint256"},{internalType:"uint256",name:"paid",type:"uint256"},{internalType:"uint48",name:"validAfter",type:"uint48"},{internalType:"uint48",name:"validUntil",type:"uint48"},{internalType:"bool",name:"targetSuccess",type:"bool"},{internalType:"bytes",name:"targetResult",type:"bytes"}],name:"ExecutionResult",type:"error"},{inputs:[{internalType:"uint256",name:"opIndex",type:"uint256"},{internalType:"string",name:"reason",type:"string"}],name:"FailedOp",type:"error"},{inputs:[{internalType:"address",name:"sender",type:"address"}],name:"SenderAddressResult",type:"error"},{inputs:[{internalType:"address",name:"aggregator",type:"address"}],name:"SignatureValidationFailed",type:"error"},{inputs:[{components:[{internalType:"uint256",name:"preOpGas",type:"uint256"},{internalType:"uint256",name:"prefund",type:"uint256"},{internalType:"bool",name:"sigFailed",type:"bool"},{internalType:"uint48",name:"validAfter",type:"uint48"},{internalType:"uint48",name:"validUntil",type:"uint48"},{internalType:"bytes",name:"paymasterContext",type:"bytes"}],internalType:"struct IEntryPoint.ReturnInfo",name:"returnInfo",type:"tuple"},{components:[{internalType:"uint256",name:"stake",type:"uint256"},{internalType:"uint256",name:"unstakeDelaySec",type:"uint256"}],internalType:"struct IStakeManager.StakeInfo",name:"senderInfo",type:"tuple"},{components:[{internalType:"uint256",name:"stake",type:"uint256"},{internalType:"uint256",name:"unstakeDelaySec",type:"uint256"}],internalType:"struct IStakeManager.StakeInfo",name:"factoryInfo",type:"tuple"},{components:[{internalType:"uint256",name:"stake",type:"uint256"},{internalType:"uint256",name:"unstakeDelaySec",type:"uint256"}],internalType:"struct IStakeManager.StakeInfo",name:"paymasterInfo",type:"tuple"}],name:"ValidationResult",type:"error"},{inputs:[{components:[{internalType:"uint256",name:"preOpGas",type:"uint256"},{internalType:"uint256",name:"prefund",type:"uint256"},{internalType:"bool",name:"sigFailed",type:"bool"},{internalType:"uint48",name:"validAfter",type:"uint48"},{internalType:"uint48",name:"validUntil",type:"uint48"},{internalType:"bytes",name:"paymasterContext",type:"bytes"}],internalType:"struct IEntryPoint.ReturnInfo",name:"returnInfo",type:"tuple"},{components:[{internalType:"uint256",name:"stake",type:"uint256"},{internalType:"uint256",name:"unstakeDelaySec",type:"uint256"}],internalType:"struct IStakeManager.StakeInfo",name:"senderInfo",type:"tuple"},{components:[{internalType:"uint256",name:"stake",type:"uint256"},{internalType:"uint256",name:"unstakeDelaySec",type:"uint256"}],internalType:"struct IStakeManager.StakeInfo",name:"factoryInfo",type:"tuple"},{components:[{internalType:"uint256",name:"stake",type:"uint256"},{internalType:"uint256",name:"unstakeDelaySec",type:"uint256"}],internalType:"struct IStakeManager.StakeInfo",name:"paymasterInfo",type:"tuple"},{components:[{internalType:"address",name:"aggregator",type:"address"},{components:[{internalType:"uint256",name:"stake",type:"uint256"},{internalType:"uint256",name:"unstakeDelaySec",type:"uint256"}],internalType:"struct IStakeManager.StakeInfo",name:"stakeInfo",type:"tuple"}],internalType:"struct IEntryPoint.AggregatorStakeInfo",name:"aggregatorInfo",type:"tuple"}],name:"ValidationResultWithAggregation",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"userOpHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"address",name:"factory",type:"address"},{indexed:!1,internalType:"address",name:"paymaster",type:"address"}],name:"AccountDeployed",type:"event"},{anonymous:!1,inputs:[],name:"BeforeExecution",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!1,internalType:"uint256",name:"totalDeposit",type:"uint256"}],name:"Deposited",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"aggregator",type:"address"}],name:"SignatureAggregatorChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!1,internalType:"uint256",name:"totalStaked",type:"uint256"},{indexed:!1,internalType:"uint256",name:"unstakeDelaySec",type:"uint256"}],name:"StakeLocked",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!1,internalType:"uint256",name:"withdrawTime",type:"uint256"}],name:"StakeUnlocked",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!1,internalType:"address",name:"withdrawAddress",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"StakeWithdrawn",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"userOpHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!0,internalType:"address",name:"paymaster",type:"address"},{indexed:!1,internalType:"uint256",name:"nonce",type:"uint256"},{indexed:!1,internalType:"bool",name:"success",type:"bool"},{indexed:!1,internalType:"uint256",name:"actualGasCost",type:"uint256"},{indexed:!1,internalType:"uint256",name:"actualGasUsed",type:"uint256"}],name:"UserOperationEvent",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"userOpHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"nonce",type:"uint256"},{indexed:!1,internalType:"bytes",name:"revertReason",type:"bytes"}],name:"UserOperationRevertReason",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!1,internalType:"address",name:"withdrawAddress",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"Withdrawn",type:"event"},{inputs:[],name:"SIG_VALIDATION_FAILED",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"initCode",type:"bytes"},{internalType:"address",name:"sender",type:"address"},{internalType:"bytes",name:"paymasterAndData",type:"bytes"}],name:"_validateSenderAndPaymaster",outputs:[],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint32",name:"unstakeDelaySec",type:"uint32"}],name:"addStake",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"depositTo",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"deposits",outputs:[{internalType:"uint112",name:"deposit",type:"uint112"},{internalType:"bool",name:"staked",type:"bool"},{internalType:"uint112",name:"stake",type:"uint112"},{internalType:"uint32",name:"unstakeDelaySec",type:"uint32"},{internalType:"uint48",name:"withdrawTime",type:"uint48"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"getDepositInfo",outputs:[{components:[{internalType:"uint112",name:"deposit",type:"uint112"},{internalType:"bool",name:"staked",type:"bool"},{internalType:"uint112",name:"stake",type:"uint112"},{internalType:"uint32",name:"unstakeDelaySec",type:"uint32"},{internalType:"uint48",name:"withdrawTime",type:"uint48"}],internalType:"struct IStakeManager.DepositInfo",name:"info",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint192",name:"key",type:"uint192"}],name:"getNonce",outputs:[{internalType:"uint256",name:"nonce",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"initCode",type:"bytes"}],name:"getSenderAddress",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"bytes",name:"initCode",type:"bytes"},{internalType:"bytes",name:"callData",type:"bytes"},{internalType:"uint256",name:"callGasLimit",type:"uint256"},{internalType:"uint256",name:"verificationGasLimit",type:"uint256"},{internalType:"uint256",name:"preVerificationGas",type:"uint256"},{internalType:"uint256",name:"maxFeePerGas",type:"uint256"},{internalType:"uint256",name:"maxPriorityFeePerGas",type:"uint256"},{internalType:"bytes",name:"paymasterAndData",type:"bytes"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct UserOperation",name:"userOp",type:"tuple"}],name:"getUserOpHash",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"bytes",name:"initCode",type:"bytes"},{internalType:"bytes",name:"callData",type:"bytes"},{internalType:"uint256",name:"callGasLimit",type:"uint256"},{internalType:"uint256",name:"verificationGasLimit",type:"uint256"},{internalType:"uint256",name:"preVerificationGas",type:"uint256"},{internalType:"uint256",name:"maxFeePerGas",type:"uint256"},{internalType:"uint256",name:"maxPriorityFeePerGas",type:"uint256"},{internalType:"bytes",name:"paymasterAndData",type:"bytes"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct UserOperation[]",name:"userOps",type:"tuple[]"},{internalType:"contract IAggregator",name:"aggregator",type:"address"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct IEntryPoint.UserOpsPerAggregator[]",name:"opsPerAggregator",type:"tuple[]"},{internalType:"address payable",name:"beneficiary",type:"address"}],name:"handleAggregatedOps",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"bytes",name:"initCode",type:"bytes"},{internalType:"bytes",name:"callData",type:"bytes"},{internalType:"uint256",name:"callGasLimit",type:"uint256"},{internalType:"uint256",name:"verificationGasLimit",type:"uint256"},{internalType:"uint256",name:"preVerificationGas",type:"uint256"},{internalType:"uint256",name:"maxFeePerGas",type:"uint256"},{internalType:"uint256",name:"maxPriorityFeePerGas",type:"uint256"},{internalType:"bytes",name:"paymasterAndData",type:"bytes"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct UserOperation[]",name:"ops",type:"tuple[]"},{internalType:"address payable",name:"beneficiary",type:"address"}],name:"handleOps",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint192",name:"key",type:"uint192"}],name:"incrementNonce",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes",name:"callData",type:"bytes"},{components:[{components:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"uint256",name:"callGasLimit",type:"uint256"},{internalType:"uint256",name:"verificationGasLimit",type:"uint256"},{internalType:"uint256",name:"preVerificationGas",type:"uint256"},{internalType:"address",name:"paymaster",type:"address"},{internalType:"uint256",name:"maxFeePerGas",type:"uint256"},{internalType:"uint256",name:"maxPriorityFeePerGas",type:"uint256"}
58],internalType:"struct EntryPoint.MemoryUserOp",name:"mUserOp",type:"tuple"},{internalType:"bytes32",name:"userOpHash",type:"bytes32"},{internalType:"uint256",name:"prefund",type:"uint256"},{internalType:"uint256",name:"contextOffset",type:"uint256"},{internalType:"uint256",name:"preOpGas",type:"uint256"}],internalType:"struct EntryPoint.UserOpInfo",name:"opInfo",type:"tuple"},{internalType:"bytes",name:"context",type:"bytes"}],name:"innerHandleOp",outputs:[{internalType:"uint256",name:"actualGasCost",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint192",name:"",type:"uint192"}],name:"nonceSequenceNumber",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"bytes",name:"initCode",type:"bytes"},{internalType:"bytes",name:"callData",type:"bytes"},{internalType:"uint256",name:"callGasLimit",type:"uint256"},{internalType:"uint256",name:"verificationGasLimit",type:"uint256"},{internalType:"uint256",name:"preVerificationGas",type:"uint256"},{internalType:"uint256",name:"maxFeePerGas",type:"uint256"},{internalType:"uint256",name:"maxPriorityFeePerGas",type:"uint256"},{internalType:"bytes",name:"paymasterAndData",type:"bytes"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct UserOperation",name:"op",type:"tuple"},{internalType:"address",name:"target",type:"address"},{internalType:"bytes",name:"targetCallData",type:"bytes"}],name:"simulateHandleOp",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"bytes",name:"initCode",type:"bytes"},{internalType:"bytes",name:"callData",type:"bytes"},{internalType:"uint256",name:"callGasLimit",type:"uint256"},{internalType:"uint256",name:"verificationGasLimit",type:"uint256"},{internalType:"uint256",name:"preVerificationGas",type:"uint256"},{internalType:"uint256",name:"maxFeePerGas",type:"uint256"},{internalType:"uint256",name:"maxPriorityFeePerGas",type:"uint256"},{internalType:"bytes",name:"paymasterAndData",type:"bytes"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct UserOperation",name:"userOp",type:"tuple"}],name:"simulateValidation",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"unlockStake",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address payable",name:"withdrawAddress",type:"address"}],name:"withdrawStake",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address payable",name:"withdrawAddress",type:"address"},{internalType:"uint256",name:"withdrawAmount",type:"uint256"}],name:"withdrawTo",outputs:[],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}];var T=r(93413),R=r(92498),N=r(89431),D=r(83677),B=r(3796),M=r(9660),L=r(19205),U=r(85721);function j(e){let t=e.length&&Array.isArray(e[0]);return{args:t?e[0]:[],options:(t?e[1]:e[0])??{}}}function F(e,t){let r=!1;return Array.isArray(e[0])?r=!0:1===e.length?r=t.inputs.some(e=>e.indexed):2===e.length&&(r=!0),{args:r?e[0]:void 0,options:(r?e[1]:e[0])??{}}}var q=r(60152),H=r(48786);let z=e=>({...e,estimateUserOperationGas:(t,r)=>e.request({method:"eth_estimateUserOperationGas",params:[t,r]}),sendUserOperation:(t,r)=>e.request({method:"eth_sendUserOperation",params:[t,r]}),getUserOperationByHash:t=>e.request({method:"eth_getUserOperationByHash",params:[t]}),getUserOperationReceipt:t=>e.request({method:"eth_getUserOperationReceipt",params:[t]}),getSupportedEntryPoints:()=>e.request({method:"eth_supportedEntryPoints",params:[]}),getMaxPriorityFeePerGas:()=>e.request({method:"eth_maxPriorityFeePerGas",params:[]}),async getFeeData(){let t=await e.getBlock({blockTag:"latest"});if(t&&t.baseFeePerGas){let e=BigInt(15e8);return{maxPriorityFeePerGas:e,maxFeePerGas:t.baseFeePerGas*BigInt(2)+e}}return{maxFeePerGas:0,maxPriorityFeePerGas:0}},getContractCode:async t=>await e.getBytecode({address:t})??"0x"}),$=({chain:e,rpcUrl:t,fetchOptions:r})=>z((0,q.v)({chain:e,transport:(0,H.d)(t,{fetchOptions:{...r,headers:{...r?.headers,"Alchemy-AA-Sdk-Version":"0.1.0-alpha.23"}}})}));(u=y||(y={}))[u.DEBUG=4]="DEBUG",u[u.INFO=3]="INFO",u[u.WARN=2]="WARN",u[u.ERROR=1]="ERROR",u[u.NONE=0]="NONE";class V{static setLogLevel(e){this.logLevel=e}static setLogFilter(e){this.logFilter=e}
58static error(e,...t){this.shouldLog(e,y.ERROR)&&console.error(e,...t)}static warn(e,...t){this.shouldLog(e,y.WARN)&&console.warn(e,...t)}static debug(e,...t){this.shouldLog(e,y.DEBUG)&&console.debug(e,...t)}static info(e,...t){this.shouldLog(e,y.INFO)&&console.info(e,...t)}static shouldLog(e,t){return!(this.logLevel<t)&&(!this.logFilter||!!e.includes(this.logFilter))}}Object.defineProperty(V,"logLevel",{enumerable:!0,configurable:!0,writable:!0,value:y.NONE}),(c=m||(m={})).UNDEFINED="0x0",c.NOT_DEPLOYED="0x1",c.DEPLOYED="0x2";class W{constructor(e){Object.defineProperty(this,"deploymentState",{enumerable:!0,configurable:!0,writable:!0,value:m.UNDEFINED}),Object.defineProperty(this,"accountAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"entryPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"entryPointAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"rpcProvider",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.entryPointAddress=e.entryPointAddress,this.rpcProvider="string"==typeof e.rpcClient?$({chain:e.chain,rpcUrl:e.rpcClient}):e.rpcClient,this.accountAddress=e.accountAddress,this.entryPoint=function({abi:e,address:t,publicClient:r,walletClient:n}){let i=null!=r,s=null!=n,o={},a=!1,l=!1,u=!1;for(let t of e)if("function"===t.type?"view"===t.stateMutability||"pure"===t.stateMutability?a=!0:l=!0:"event"===t.type&&(u=!0),a&&l&&u)break;return i&&(a&&(o.read=new Proxy({},{get:(n,i)=>(...n)=>{let{args:s,options:o}=j(n);return(0,T.s)(r,B.L,"readContract")({abi:e,address:t,functionName:i,args:s,...o})}})),l&&(o.simulate=new Proxy({},{get:(n,i)=>(...n)=>{let{args:s,options:o}=j(n);return(0,T.s)(r,M.a,"simulateContract")({abi:e,address:t,functionName:i,args:s,...o})}})),u&&(o.createEventFilter=new Proxy({},{get:(n,i)=>(...n)=>{let{args:s,options:o}=F(n,e.find(e=>"event"===e.type&&e.name===i));return(0,T.s)(r,R.A,"createContractEventFilter")({abi:e,address:t,eventName:i,args:s,...o})}}),o.getEvents=new Proxy({},{get:(n,i)=>(...n)=>{let{args:s,options:o}=F(n,e.find(e=>"event"===e.type&&e.name===i));return(0,T.s)(r,D.m,"getContractEvents")({abi:e,address:t,eventName:i,args:s,...o})}}),o.watchEvent=new Proxy({},{get:(n,i)=>(...n)=>{let{args:s,options:o}=F(n,e.find(e=>"event"===e.type&&e.name===i));return(0,T.s)(r,L.Y,"watchContractEvent")({abi:e,address:t,eventName:i,args:s,...o})}}))),s&&l&&(o.write=new Proxy({},{get:(r,i)=>(...r)=>{let{args:s,options:o}=j(r);return(0,T.s)(n,U.n,"writeContract")({abi:e,address:t,functionName:i,args:s,...o})}})),(i||s)&&l&&(o.estimateGas=new Proxy({},{get:(i,s)=>(...i)=>{let{args:o,options:a}=j(i),l=r??n;return(0,T.s)(l,N.D,"estimateContractGas")({abi:e,address:t,functionName:s,args:o,...a,account:a.account??n.account})}})),o.address=t,o.abi=e,o}({address:e.entryPointAddress,abi:O,publicClient:this.rpcProvider})}async signMessageWith6492(e){throw Error("signMessageWith6492 not supported")}async signTypedData(e){throw Error("signTypedData not supported")}async signTypedDataWith6492(e){throw Error("signTypedDataWith6492 not supported")}async encodeBatchExecute(e){throw Error("encodeBatchExecute not supported")}async getNonce(){if(!await this.isAccountDeployed())return 0n;let e=await this.getAddress();return this.entryPoint.read.getNonce([e,BigInt(0)])}async getInitCode(){if(this.deploymentState===m.DEPLOYED)return"0x";let e=await this.rpcProvider.getContractCode(await this.getAddress());return(e?.length??0)>2?(this.deploymentState=m.DEPLOYED,"0x"):(this.deploymentState=m.NOT_DEPLOYED,this.getAccountInitCode())}async getAddress(){if(!this.accountAddress){let e=await this.getAccountInitCode();V.debug("[BaseSmartContractAccount](getAddress) initCode: ",e);try{await this.entryPoint.simulate.getSenderAddress([e])}catch(e){if(V.debug("[BaseSmartContractAccount](getAddress) entrypoint.getSenderAddress result: ",e),e.cause?.data?.errorName==="SenderAddressResult")return this.accountAddress=e.cause.data.args[0],this.accountAddress}throw Error("getCounterFactualAddress failed")}return this.accountAddress}async isAccountDeployed(){return await this.getDeploymentState()===m.DEPLOYE
58D}async getDeploymentState(){return this.deploymentState===m.UNDEFINED?"0x"===await this.getInitCode()?m.DEPLOYED:m.NOT_DEPLOYED:this.deploymentState}}var G=r(14503),K=r(82361),J=r(53932),Y=r(40369);r(67463);var Q=r(20137),Z=r(12403);let X=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),ee=Uint8Array.from({length:16},(e,t)=>t),et=ee.map(e=>(9*e+5)%16),er=[ee],en=[et];for(let e=0;e<4;e++)for(let t of[er,en])t.push(t[e].map(e=>X[e]));let ei=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(e=>new Uint8Array(e));(e,t)=>e.map(e=>ei[t][e]),(e,t)=>e.map(e=>ei[t][e]);Q.N;var es=r(51265);let[eo,ea]=r(43452).ZP.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e3585
585771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e)));Q.N,r(95861);var el=r(38999);r(99688);let eu=(e,t)=>t?eu(t,e%t):e;l="qpzry9x8gf2tvdw0s3jn54khce6mua7l";el.kA.ProjectivePoint,n=es.J,(0,Z.iY)("Bitcoin seed");var ec=r(95046);r(99142),r(99112);var eh=r(47147),ed=r(51463),ef=r(24416);r(28242),r(51930);var ep=r(39480);class eg extends Error{constructor(e,t={}){let r=t.cause instanceof eg?t.cause.details:t.cause?.message?t.cause.message:t.details,n=t.cause instanceof eg&&t.cause.docsPath||t.docsPath;super([e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...n?[`Docs: https://abitype.dev${n}`]:[],...r?[`Details: ${r}`]:[],"Version: [email protected]"].join("\n")),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),t.cause&&(this.cause=t.cause),this.details=r,this.docsPath=n,this.metaMessages=t.metaMessages,this.shortMessage=e}}class ey extends eg{constructor({params:e}){super("Failed to parse ABI parameters.",{details:`parseAbiParameters(${JSON.stringify(e,null,2)})`,docsPath:"/api/human.html#parseabiparameters-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiParametersError"})}}class em extends eg{constructor({param:e}){super("Invalid ABI parameter.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class ev extends eg{constructor({param:e,name:t}){super("Invalid ABI parameter.",{details:e,metaMessages:[`"${t}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}class eb extends eg{constructor({param:e,type:t,modifier:r}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${r}" not allowed${t?` in "${t}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class ew extends eg{constructor({param:e,type:t,modifier:r}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${r}" not allowed${t?` in "${t}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${r}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class e_ extends eg{constructor({abiParameter:e}){super("Invalid ABI parameter.",{details:JSON.stringify(e,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}var eE=r(71563);let eS=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/,eA=new Set(["memory","indexed","storage","calldata"]),ek=new Set(["calldata","memory","storage"]);class eC extends eg{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}class eI extends eg{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}class ex extends eg{constructor({signature:e,type:t}){super(`Invalid ${t} signature.`,{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class eP extends eg{constructor({signature:e}){super("Invalid struct signature.",{details:e,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}class eO extends eg{constructor({type:e}){super("Circular reference detected.",{metaMessages:[`Struct "${e}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}class eT extends eg{constructor({current:e,depth:t}){super("Unbalanced parentheses.",{metaMessages:[`"${e.trim()}" has too many ${t>0?"opening":"closing"} parentheses.`],details:`Depth "${t}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}let eR=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]),eN=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,eD=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,eB=/^u?int$/;function eM(e,t){var r,n,i;let s;let o=(r=t?.type)?`${r}:${e}`:e;if(eR.has(o))return eR.get(o);let a=eE.cN.test(e),l=(0,eE.Zw)(a?eD:eN,e);
58if(!l)throw new em({param:e});if(l.name&&("address"===(n=l.name)||"bool"===n||"function"===n||"string"===n||"tuple"===n||eE.eL.test(n)||eE.lh.test(n)||ej.test(n)))throw new ev({param:e,name:l.name});let u=l.name?{name:l.name}:{},c="indexed"===l.modifier?{indexed:!0}:{},h=t?.structs??{},d={};if(a){s="tuple";let e=eL(l.type),t=[],r=e.length;for(let n=0;n<r;n++)t.push(eM(e[n],{structs:h}));d={components:t}}else if(l.type in h)s="tuple",d={components:h[l.type]};else if(eB.test(l.type))s=`${l.type}256`;else if(s=l.type,t?.type!=="struct"&&!eU(s))throw new eI({type:s});if(l.modifier){if(!t?.modifiers?.has?.(l.modifier))throw new eb({param:e,type:t?.type,modifier:l.modifier});if(ek.has(l.modifier)&&(i=s,!l.array&&"bytes"!==i&&"string"!==i&&"tuple"!==i))throw new ew({param:e,type:t?.type,modifier:l.modifier})}let f={type:`${s}${l.array??""}`,...u,...c,...d};return eR.set(o,f),f}function eL(e,t=[],r="",n=0){if(""===e){if(""===r)return t;if(0!==n)throw new eT({current:r,depth:n});return t.push(r.trim()),t}let i=e.length;for(let s=0;s<i;s++){let i=e[s],o=e.slice(s+1);switch(i){case",":return 0===n?eL(o,[...t,r.trim()]):eL(o,t,`${r}${i}`,n);case"(":return eL(o,t,`${r}${i}`,n+1);case")":return eL(o,t,`${r}${i}`,n-1);default:return eL(o,t,`${r}${i}`,n)}}return[]}function eU(e){return"address"===e||"bool"===e||"function"===e||"string"===e||eE.eL.test(e)||eE.lh.test(e)}let ej=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/,eF=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function eq(e){let t=[];if("string"==typeof e){let r=eL(e),n=r.length;for(let e=0;e<n;e++)t.push(eM(r[e],{modifiers:eA}))}else{let r=function(e){let t={},r=e.length;for(let n=0;n<r;n++){let r=e[n];if(!eS.test(r))continue;let i=(0,eE.Zw)(eS,r);if(!i)throw new ex({signature:r,type:"struct"});let s=i.properties.split(";"),o=[],a=s.length;for(let e=0;e<a;e++){let t=s[e].trim();if(!t)continue;let r=eM(t,{type:"struct"});o.push(r)}if(!o.length)throw new eP({signature:r});t[i.name]=o}let n={},i=Object.entries(t),s=i.length;for(let e=0;e<s;e++){let[r,s]=i[e];n[r]=function e(t,r,n=new Set){let i=[],s=t.length;for(let o=0;o<s;o++){let s=t[o];if(eE.cN.test(s.type))i.push(s);else{let t=(0,eE.Zw)(eF,s.type);if(!t?.type)throw new e_({abiParameter:s});let{array:o,type:a}=t;if(a in r){if(n.has(a))throw new eO({type:a});i.push({...s,type:`tuple${o??""}`,components:e(r[a]??[],r,new Set([...n,a]))})}else if(eU(a))i.push(s);else throw new eC({type:a})}}return i}(s,t)}return n}(e),n=e.length;for(let i=0;i<n;i++){let n=e[i];if(eS.test(n))continue;let s=eL(n),o=s.length;for(let e=0;e<o;e++)t.push(eM(s[e],{modifiers:eA,structs:r}))}}if(0===t.length)throw new ey({params:e});return t}let eH=({factoryAddress:e,initCode:t,signature:r})=>(0,J.zo)([(0,ep.E)(eq("address, bytes, bytes"),[e,t,r]),"0x6492649264926492649264926492649264926492649264926492649264926492"]);var ez=r(36393),e$=r(21019),eV=r(53611),eW=r(73438);let eG=(...e)=>async t=>{let r=t;for(let t of e)r=await t(r);return r};async function eK(e){let t=Object.keys(e).map(t=>Promise.resolve(e[t]).then(e=>({key:t,value:e})));return(await Promise.all(t)).reduce((e,t)=>(e[t.key]=t.value,e),{})}function eJ(e){if("function"!=typeof e)return null==e||"string"==typeof e||"boolean"==typeof e?e:"bigint"==typeof e?(0,ec.NC)(e):null!=e._isBigNumber||"object"!=typeof e?(0,ec.NC)(e).replace(/^0x0/,"0x"):Array.isArray(e)?e.map(e=>eJ(e)):Object.keys(e).reduce((t,r)=>({...t,[r]:eJ(e[r])}),{})}function eY(e,t,r){let n=(0,ep.E)([{type:"bytes32"},{type:"address"},{type:"uint256"}],[(0,eh.w)(function(e){let t=(0,eh.w)(e.initCode),r=(0,eh.w)(e.callData),n=(0,eh.w)(e.paymasterAndData);return(0,ep.E)([{type:"address"},{type:"uint256"},{type:"bytes32"},{type:"bytes32"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"bytes32"}],[e.sender,(0,e$.y_)(e.nonce),t,r,(0,e$.y_)(e.callGasLimit),(0,e$.y_)(e.verificationGasLimit),(0,e$.y_)(e.preVerificationGas),(0,e$.y_)(e.maxFeePerGas),(0,e$.y_)(e.maxPriorityFeePerGas),n])}(e)),t,r]);return(0,eh.w)(n)}function eQ(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}let eZ=async e=>e,eX=new Map([[eV.y.id,10000000n],[eW.J.id,10000000n]]);class e0 extends ez.Z{constructor(e,t,r,n,i){super(),Object.defineProperty(this,"entryPointAddress",{enumerable:!0,configurable:!0,writable:!0,value:t}
58),Object.defineProperty(this,"chain",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"account",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"txMaxRetries",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"txRetryIntervalMs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"txRetryMulitplier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"minPriorityFeePerBid",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"rpcClient",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:async e=>{let{method:t,params:r}=e;switch(t){case"eth_sendTransaction":let[n]=r;return this.sendTransaction(n);case"eth_sign":case"personal_sign":let[i,s]=r;if(s!==await this.getAddress())throw Error("cannot sign for address that is not the current account");return this.signMessage(i);default:return this.rpcClient.request(e)}}}),Object.defineProperty(this,"getAddress",{enumerable:!0,configurable:!0,writable:!0,value:()=>{if(!this.account)throw Error("account not connected!");return this.account.getAddress()}}),Object.defineProperty(this,"sendTransaction",{enumerable:!0,configurable:!0,writable:!0,value:async e=>{if(!e.to)throw Error("transaction is missing to address");let t={};e.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),e.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas);let{hash:r}=await this.sendUserOperation({target:e.to,data:e.data??"0x",value:e.value?(0,e$.H_)(e.value,"bigint"):0n},t);return await this.waitForUserOperationTransaction(r)}}),Object.defineProperty(this,"signMessage",{enumerable:!0,configurable:!0,writable:!0,value:async e=>{if(!this.account)throw Error("account not connected!");return this.account.signMessage(e)}}),Object.defineProperty(this,"signTypedData",{enumerable:!0,configurable:!0,writable:!0,value:async e=>{if(!this.account)throw Error("account not connected!");return this.account.signTypedData(e)}}),Object.defineProperty(this,"sendTransactions",{enumerable:!0,configurable:!0,writable:!0,value:async e=>{let t=e.map(e=>{if(!e.to)throw Error("one transaction in the batch is missing a target address");return{target:e.to,data:e.data??"0x",value:e.value?(0,e$.H_)(e.value,"bigint"):0n}}),r=(...e)=>{if(e.length)return e.reduce((e,t)=>e>t?e:t)},n=r(...e.filter(e=>null!=e.maxFeePerGas).map(e=>(0,e$.H_)(e.maxFeePerGas,"bigint"))),i=r(...e.filter(e=>null!=e.maxPriorityFeePerGas).map(e=>(0,e$.H_)(e.maxPriorityFeePerGas,"bigint"))),s={};null!=n&&(s.maxFeePerGas=n),null!=i&&(s.maxPriorityFeePerGas=i);let{hash:o}=await this.sendUserOperation(t,s);return await this.waitForUserOperationTransaction(o)}}),Object.defineProperty(this,"waitForUserOperationTransaction",{enumerable:!0,configurable:!0,writable:!0,value:async e=>{for(let t=0;t<this.txMaxRetries;t++){let r=this.txRetryIntervalMs*Math.pow(this.txRetryMulitplier,t)+100*Math.random();await new Promise(e=>setTimeout(e,r));let n=await this.getUserOperationReceipt(e).catch(()=>null);if(n)return this.getTransaction(n.receipt.transactionHash).then(e=>e.hash)}throw Error("Failed to find transaction for User Operation")}}),Object.defineProperty(this,"getUserOperationByHash",{enumerable:!0,configurable:!0,writable:!0,value:e=>this.rpcClient.getUserOperationByHash(e)}),Object.defineProperty(this,"getUserOperationReceipt",{enumerable:!0,configurable:!0,writable:!0,value:e=>this.rpcClient.getUserOperationReceipt(e)}),Object.defineProperty(this,"getTransaction",{enumerable:!0,configurable:!0,writable:!0,value:e=>this.rpcClient.getTransaction({hash:e})}),Object.defineProperty(this,"sendUserOperation",{enumerable:!0,configurable:!0,writable:!0,value:async(e,t)=>{if(!this.account)throw Error("account not connected!");let r=await this.account.getInitCode(),n=await eG(this.dummyPaymasterDataMiddleware,this.feeDataGetter,this.gasEstimator,this.paymasterDataMiddleware,this.customMiddleware??eZ,async e=>({...e,...t}))({initCode:r,sender:this.getAddress(),nonce:this.account.getNonce(),callData:Array.isArray(e)?this.account.encodeBatchExecute(e):this.account.encodeExecute(e.target,e.value??0n,e.data),signature:this.account.getDummySignature()}),i=eJ(await eK(n));
58if(!(i.callGasLimit&&i.maxFeePerGas&&null!=i.maxPriorityFeePerGas&&i.preVerificationGas&&i.verificationGasLimit))throw Error(`Request is missing parameters. All properties on UserOperationStruct must be set. uo: ${JSON.stringify(i,null,2)}`);return i.signature=await this.account.signMessage(eY(i,this.entryPointAddress,BigInt(this.chain.id))),{hash:await this.rpcClient.sendUserOperation(i,this.entryPointAddress),request:i}}}),Object.defineProperty(this,"dummyPaymasterDataMiddleware",{enumerable:!0,configurable:!0,writable:!0,value:async e=>(e.paymasterAndData="0x",e)}),Object.defineProperty(this,"paymasterDataMiddleware",{enumerable:!0,configurable:!0,writable:!0,value:async e=>(e.paymasterAndData="0x",e)}),Object.defineProperty(this,"gasEstimator",{enumerable:!0,configurable:!0,writable:!0,value:async e=>{let t=eJ(await eK(e)),r=await this.rpcClient.estimateUserOperationGas(t,this.entryPointAddress);return e.callGasLimit=r.callGasLimit,e.verificationGasLimit=r.verificationGasLimit,e.preVerificationGas=r.preVerificationGas,e}}),Object.defineProperty(this,"feeDataGetter",{enumerable:!0,configurable:!0,writable:!0,value:async e=>{let t=await this.rpcClient.getMaxPriorityFeePerGas(),r=await this.rpcClient.getFeeData();if(!r.maxFeePerGas||!r.maxPriorityFeePerGas)throw Error("feeData is missing maxFeePerGas or maxPriorityFeePerGas");let n=4n*BigInt(t)/3n;n<this.minPriorityFeePerBid&&(n=this.minPriorityFeePerBid);let i=BigInt(r.maxFeePerGas)-BigInt(r.maxPriorityFeePerGas)+n;return e.maxFeePerGas=i,e.maxPriorityFeePerGas=n,e}}),Object.defineProperty(this,"customMiddleware",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"withPaymasterMiddleware",{enumerable:!0,configurable:!0,writable:!0,value:e=>(eQ(this,"dummyPaymasterDataMiddleware",e.dummyPaymasterDataMiddleware?this.overrideMiddlewareFunction(e.dummyPaymasterDataMiddleware):this.dummyPaymasterDataMiddleware),eQ(this,"paymasterDataMiddleware",e.paymasterDataMiddleware?this.overrideMiddlewareFunction(e.paymasterDataMiddleware):this.paymasterDataMiddleware),this)}),Object.defineProperty(this,"withGasEstimator",{enumerable:!0,configurable:!0,writable:!0,value:e=>(eQ(this,"gasEstimator",this.overrideMiddlewareFunction(e)),this)}),Object.defineProperty(this,"withFeeDataGetter",{enumerable:!0,configurable:!0,writable:!0,value:e=>(eQ(this,"feeDataGetter",this.overrideMiddlewareFunction(e)),this)}),Object.defineProperty(this,"withCustomMiddleware",{enumerable:!0,configurable:!0,writable:!0,value:e=>(eQ(this,"customMiddleware",e),this)}),Object.defineProperty(this,"overrideMiddlewareFunction",{enumerable:!0,configurable:!0,writable:!0,value:e=>async t=>({...t,...await e(t)})}),this.txMaxRetries=i?.txMaxRetries??5,this.txRetryIntervalMs=i?.txRetryIntervalMs??2e3,this.txRetryMulitplier=i?.txRetryMulitplier??1.5,this.minPriorityFeePerBid=i?.minPriorityFeePerBid??eX.get(r.id)??100000000n,this.rpcClient="string"==typeof e?$({chain:r,rpcUrl:e}):e}signMessageWith6492(e){if(!this.account)throw Error("account not connected!");return this.account.signMessageWith6492(e)}signTypedDataWith6492(e){if(!this.account)throw Error("account not connected!");return this.account.signTypedDataWith6492(e)}connect(e){let t=e(this.rpcClient);return eQ(this,"account",t),this.emit("connect",{chainId:(0,ec.NC)(this.chain.id)}),t.getAddress().then(e=>this.emit("accountsChanged",[e])),this}
58disconnect(){return this.account&&(this.emit("disconnect"),this.emit("accountsChanged",[])),eQ(this,"account",void 0),this}isConnected(){return void 0!==this.account}}var e1=r(88202),e2=r(28373),e3=r(80755);let e5="https://meta-aa-provider.onrender.com/api/v1/bundler",e6="https://meta-aa-provider.onrender.com/api/v1/paymaster",e4="0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",e8="0x8ae01fcf7c655655ff2c6ef907b8b4718ab4e17c",e7="0x0DA6a956B9488eD4dd761E59f52FDc6c8068E6B5",e9={USDC:{1:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",137:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",42161:"0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8",43114:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"},PEPE:{1:"0x6982508145454Ce325dDbE47a25d4ec3d2311933"}},te={[e9.USDC[1]]:(0,e2.v)("100",6),[e9.USDC[5]]:(0,e2.v)("100",6),[e9.USDC[137]]:(0,e2.v)("10",6),[e9.USDC[42161]]:(0,e2.v)("10",6),[e9.USDC[43114]]:(0,e2.v)("10",6),[e9.PEPE[1]]:(0,e2.v)("50000000",18),"0x3870419Ba2BBf0127060bCB37f69A1b1C090992B":(0,e2.v)("100",18)},tt=new Map([[e3.y.id,30000000000n]]),tr="f36f7f706a58477884ce6fe89165666c",tn={1:`https://mainnet.infura.io/v3/${tr}`,5:`https://goerli.infura.io/v3/${tr}`,11155111:"https://fittest-ultra-aura.ethereum-sepolia.quiknode.pro/3893d01b1dd411fdfa9b6dd372dd2b4f69fcf1ea/",137:`https://polygon-mainnet.infura.io/v3/${tr}`,80001:`https://polygon-mumbai.infura.io/v3/${tr}`,80002:`https://polygon-amoy.infura.io/v3/${tr}`,10:`https://optimism-mainnet.infura.io/v3/${tr}`,420:`https://optimism-goerli.infura.io/v3/${tr}`,42161:`https://arbitrum-mainnet.infura.io/v3/${tr}`,421613:`https://arbitrum-goerli.infura.io/v3/${tr}`,43114:`https://avalanche-mainnet.infura.io/v3/${tr}`,43113:`https://avalanche-fuji.infura.io/v3/${tr}`,1313161554:`https://aurora-mainnet.infura.io/v3/${tr}`,1313161555:`https://aurora-testnet.infura.io/v3/${tr}`,56:"https://neat-greatest-layer.bsc.quiknode.pro/9405a499ceee314e5f2f68c9d47518d3537fce6a/",8453:"https://twilight-red-tree.base-mainnet.quiknode.pro/dc6eb27bf0f917df215922488dd97f4de7d9b08e/",84531:"https://icy-long-mountain.base-goerli.quiknode.pro/5b80d93e97cc9412a63c10a30841869abbef9596/",100:"https://thrilling-fluent-film.xdai.quiknode.pro/305955cffb9868cdd95b5e3dc9775f20678ad9ac/",10200:"https://nd-810-853-201.p2pify.com/e828b09f0d43591de96c297b3f36fffd",59144:`https://linea-mainnet.infura.io/v3/${tr}`,59140:`https://linea-goerli.infura.io/v3/${tr}`,204:"https://opbnb.rpc.thirdweb.com/eed98c1f30120c0508f17c1f01d3102b",42069:"https://rpc.op-testnet.gelato.digital",1261120:"https://rpc.zkatana.gelato.digital",84532:"https://floral-old-feather.base-sepolia.quiknode.pro/4c3b4295d0c174410872b1e461a91cc33c7969a9/",421614:`https://arbitrum-sepolia.infura.io/v3/${tr}`,11155420:`https://optimism-sepolia.infura.io/v3/${tr}`,42220:`https://celo-mainnet.infura.io/v3/${tr}`,44787:`https://celo-alfajores.infura.io/v3/${tr}`,168587773:"https://168587773.rpc.thirdweb.com/eed98c1f30120c0508f17c1f01d3102b",81457:"https://rpc.blast.io",3776:"https://rpc.startale.com/astar-zkevm",122:"https://rpc.fuse.io",42170:"https://nova.arbitrum.
58io/rpc",94204209:"https://rpc.polygon-blackberry.gelato.digital",88153591557:"https://rpc.arb-blueberry.gelato.digital",123420111:"https://rpc.opcelestia-raspberry.gelato.digital",6038361:"https://rpc.startale.com/zkyoto",666666666:"https://rpc.degen.tips",7560:"https://cyber.alt.technology",111557560:"https://cyber-testnet.alt.technology"};var ti=r(73515);(h=v||(v={})).sudo="0x00000000",h.plugin="0x00000001",h.enable="0x00000002";class ts{constructor(e){Object.defineProperty(this,"validatorAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"mode",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"projectId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"chain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"entryPointAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"enableSignature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"validUntil",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"validAfter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"executor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"selector",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"rpcUrl",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"publicClient",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.projectId=e.projectId,this.validatorAddress=e.validatorAddress??"0xd9AB5096a832b9ce79914329DAEE236f8Eea0390",this.mode=e.mode??v.sudo,this.entryPointAddress=e.entryPointAddress??e4,this.enableSignature=e.enableSignature,this.validUntil=e.validUntil??0,this.validAfter=e.validAfter??0,this.executor=e.executor,this.selector=e.selector,this.chain=e.chain,this.rpcUrl=e.rpcUrl,this.publicClient=(0,q.v)({transport:(0,H.d)(e.rpcUrl??tn[this.chain?.id??ti.v.id]),chain:this.chain??ti.v})}shouldDelegateViaFallback(){return!0}getPluginValidatorData(){if(!this.selector||!this.executor)throw Error("Plugin Validator data params uninitialised");return{selector:this.selector,executor:this.executor,validAfter:this.validAfter,validUntil:this.validUntil}}getNonceKey(){return 0n}async getDynamicDummySignature(e,t){let r=await this.resolveValidatorMode(e,t);if(r===v.enable){let r=await this.getEnableData(e),n=r.length/2-1,i=(0,J.SM)(["0x000000000000000000000000",this.getAddress(),this.executor]);return(0,J.SM)([v.enable,i,(0,e1.vk)((0,ec.NC)(n),{size:32}),r,(0,e1.vk)((0,ec.NC)(65),{size:32}),"0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c",await this.getDummyUserOpSignature(t)])}return(0,J.SM)([r,await this.getDummyUserOpSignature(t)])}setEnableSignature(e){this.enableSignature=e}getEnableSignature(){return this.enableSignature}getAddress(){return this.validatorAddress}getPublicClient(){if(!this.publicClient)throw Error("Validator uninitialized: PublicClient missing");return this.publicClient}async approveExecutor(e,t,r,n,i,s){let o;if(!this.chain)throw Error("Validator uninitialized");try{let t=await this.getPublicClient().getStorageAt({address:e,slot:"0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc"});o=t?"0x"+t.slice(26):t}catch(e){}let a=await this.signer();return await a.signTypedData({domain:{name:"Kernel",version:o?.toLowerCase()===e7.toLowerCase()||o?.toLowerCase()==="0x8dd4dbb54d8a8cf0de6f9ccc4609470a30eff18c"||void 0===o||"0x0000000000000000000000000000000000000000"===o?"0.2.2":"0.2.1",chainId:this.chain.id,verifyingContract:e},types:{ValidatorApproved:[{name:"sig",type:"bytes4"},{name:"validatorData",type:"uint256"},{name:"executor",type:"address"},{name:"enableData",type:"bytes"}]},message:{sig:t,validatorData:(0,e$.y_)((0,J.SM)([(0,e1.vk)((0,ec.NC)(n),{size:6}),(0,e1.vk)((0,ec.NC)(i),{size:6}),s.getAddress()]),{size:32}),executor:r,enableData:await s.getEnableData(e)},primaryType:"ValidatorApproved"})}async resolveValidatorMode(e,t){let r;if(!this.chain||!this.publicClient)throw Error("Validator uninitialized");try{let n=await this.publicClient.readContract({abi:C,address:e,functionName:"getDefaultValidator"});r=n?.toLowerCase()===this.validatorAddress.toLowerCase()||this.mode===v.sudo?v.sudo:await this.isPluginEnabled(e,t.toString().slice(0,10))?v.plugin:v.enable}catch(e){r=this.mode===v.plugin?v.enable:this.mode}return r}async getSignature(e){let t=await this.resolveValidatorMode(e.sender,e.callData);if(t===v.sudo||t===v.plugin)return(0,J.SM)([this.mode,await this.signUserOp(e)]);{let r=await this.getEnableData(e.sender),n=r.length/2-1,i=this.getEnableSignature();if(!i)throw Error("Enable signature not set");return(0,J.zo)([t,(0,e1.vk)((0,ec.NC)(this.validUntil),{size:6}),(0,e1.vk)((0,ec.NC)(this.validAfter),{size:6}),(0,e1.vk)(this.validatorAddress,{size:20}),(0,e1.vk)(this.executor,{size:20}),(0,e1.vk)((0,ec.NC)(n),{size:32}),r,(0,e1.vk)((0,ec.NC)(i.length/2-1),{size:32}),i,await this.signUserOp(e)])}}}function to(e,t){return function(){return e.apply(t,arguments)}}let{toString:ta}=Object.prototype,{getPrototypeOf:tl}=Object,tu=(i=Object.create(null),e=>{let t=ta.call(e);return i[t]||(i[t]=t.slice(8,-1).toLowerCase())}),tc=e=>(e=e.toLowerCase(),t=>tu(t)===e),th=e=>t=>typeof t===e,{isArray:td}=Array,tf=th("undefined"),tp=tc("ArrayBuffer"),tg=th("string"),ty=th("function"),tm=th("number"),tv=e=>null!==e&&"object"==typeof e,tb=e=>{if("object"!==tu(e))return!1;let t=tl(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},tw=tc("Date"),t_=tc("File"),tE=tc("Blob"),tS=tc("FileList"),tA=tc("URLSearchParams"),[tk,tC,tI,tx]=["ReadableStream","Request","Response","Headers"].map(tc);function tP(e,t,{allOwnKeys:r=!1}={}){let n,i;if(null!=e){if("object"!=typeof e&&(e=[e]),td(e))for(n=0,i=e.length;n<i;n++)t.call(null,e[n],n,e);else{let i;let s=r?Object.getOwnPropertyNames(e):Object.keys(e),o=s.length;for(n=0;n<o;n++)i=s[n],t.call(null,e[i],i,e)}}}function tO(e,t){let r;t=t.toLowerCase();let n=Object.keys(e),i=n.length;for(;i-- >0;)if(t===(r=n[i]).toLowerCase())return r;return null}let tT="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,tR=e=>!tf(e)&&e!==tT,tN=(s="undefined"!=typeof Uint8Array&&tl(Uint8Array),e=>s&&e instanceof s),tD=tc("HTMLFormElement"),tB=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),tM=tc("RegExp"),tL=(e,t)=>{let r=Object.getOwnPropertyDescriptors(e),n={};tP(r,(r,i)=>{let s;!1!==(s=t(r,i,e))&&(n[i]=s||r)}),Object.defineProperties(e,n)}
58,tU="abcdefghijklmnopqrstuvwxyz",tj="0123456789",tF={DIGIT:tj,ALPHA:tU,ALPHA_DIGIT:tU+tU.toUpperCase()+tj},tq=tc("AsyncFunction");var tH={isArray:td,isArrayBuffer:tp,isBuffer:function(e){return null!==e&&!tf(e)&&null!==e.constructor&&!tf(e.constructor)&&ty(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||ty(e.append)&&("formdata"===(t=tu(e))||"object"===t&&ty(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&tp(e.buffer)},isString:tg,isNumber:tm,isBoolean:e=>!0===e||!1===e,isObject:tv,isPlainObject:tb,isReadableStream:tk,isRequest:tC,isResponse:tI,isHeaders:tx,isUndefined:tf,isDate:tw,isFile:t_,isBlob:tE,isRegExp:tM,isFunction:ty,isStream:e=>tv(e)&&ty(e.pipe),isURLSearchParams:tA,isTypedArray:tN,isFileList:tS,forEach:tP,merge:function e(){let{caseless:t}=tR(this)&&this||{},r={},n=(n,i)=>{let s=t&&tO(r,i)||i;tb(r[s])&&tb(n)?r[s]=e(r[s],n):tb(n)?r[s]=e({},n):td(n)?r[s]=n.slice():r[s]=n};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&tP(arguments[e],n);return r},extend:(e,t,r,{allOwnKeys:n}={})=>(tP(t,(t,n)=>{r&&ty(t)?e[n]=to(t,r):e[n]=t},{allOwnKeys:n}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let i,s,o;let a={};if(t=t||{},null==e)return t;do{for(s=(i=Object.getOwnPropertyNames(e)).length;s-- >0;)o=i[s],(!n||n(o,e,t))&&!a[o]&&(t[o]=e[o],a[o]=!0);e=!1!==r&&tl(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:tu,kindOfTest:tc,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;let n=e.indexOf(t,r);return -1!==n&&n===r},toArray:e=>{if(!e)return null;if(td(e))return e;let t=e.length;if(!tm(t))return null;let r=Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{let r;let n=(e&&e[Symbol.iterator]).call(e);for(;(r=n.next())&&!r.done;){let n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let r;let n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:tD,hasOwnProperty:tB,hasOwnProp:tB,reduceDescriptors:tL,freezeMethods:e=>{tL(e,(t,r)=>{if(ty(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;if(ty(e[r])){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},toObjectSet:(e,t)=>{let r={};return(e=>{e.forEach(e=>{r[e]=!0})})(td(e)?e:String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,r){return t.toUpperCase()+r}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:tO,global:tT,isContextDefined:tR,ALPHABET:tF,generateString:(e=16,t=tF.ALPHA_DIGIT)=>{let r="",{length:n}=t;for(;e--;)r+=t[Math.random()*n|0];return r},isSpecCompliantForm:function(e){return!!(e&&ty(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{let t=Array(10),r=(e,n)=>{if(tv(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[n]=e;let i=td(e)?[]:{};return tP(e,(e,t)=>{let s=r(e,n+1);tf(s)||(i[t]=s)}),t[n]=void 0,i}}return e};return r(e,0)},isAsyncFn:tq,isThenable:e=>e&&(tv(e)||ty(e))&&ty(e.then)&&ty(e.catch)};function tz(e,t,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}tH.inherits(tz,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:tH.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});let t$=tz.prototype,tV={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","E
58RR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{tV[e]={value:e}}),Object.defineProperties(tz,tV),Object.defineProperty(t$,"isAxiosError",{value:!0}),tz.from=(e,t,r,n,i,s)=>{let o=Object.create(t$);return tH.toFlatObject(e,o,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e),tz.call(o,e.message,t,r,n,i),o.cause=e,o.name=e.name,s&&Object.assign(o,s),o};var tW=r(9109).Buffer;function tG(e){return tH.isPlainObject(e)||tH.isArray(e)}function tK(e){return tH.endsWith(e,"[]")?e.slice(0,-2):e}function tJ(e,t,r){return e?e.concat(t).map(function(e,t){return e=tK(e),!r&&t?"["+e+"]":e}).join(r?".":""):t}let tY=tH.toFlatObject(tH,{},null,function(e){return/^is[A-Z]/.test(e)});var tQ=function(e,t,r){if(!tH.isObject(e))throw TypeError("target must be an object");t=t||new FormData;let n=(r=tH.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!tH.isUndefined(t[e])})).metaTokens,i=r.visitor||u,s=r.dots,o=r.indexes,a=(r.Blob||"undefined"!=typeof Blob&&Blob)&&tH.isSpecCompliantForm(t);if(!tH.isFunction(i))throw TypeError("visitor must be a function");function l(e){if(null===e)return"";if(tH.isDate(e))return e.toISOString();if(!a&&tH.isBlob(e))throw new tz("Blob is not supported. Use a Buffer instead.");return tH.isArrayBuffer(e)||tH.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):tW.from(e):e}function u(e,r,i){let a=e;if(e&&!i&&"object"==typeof e){if(tH.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else{var u;if(tH.isArray(e)&&(u=e,tH.isArray(u)&&!u.some(tG))||(tH.isFileList(e)||tH.endsWith(r,"[]"))&&(a=tH.toArray(e)))return r=tK(r),a.forEach(function(e,n){tH.isUndefined(e)||null===e||t.append(!0===o?tJ([r],n,s):null===o?r:r+"[]",l(e))}),!1}}return!!tG(e)||(t.append(tJ(i,r,s),l(e)),!1)}let c=[],h=Object.assign(tY,{defaultVisitor:u,convertValue:l,isVisitable:tG});if(!tH.isObject(e))throw TypeError("data must be an object");return!function e(r,n){if(!tH.isUndefined(r)){if(-1!==c.indexOf(r))throw Error("Circular reference detected in "+n.join("."));c.push(r),tH.forEach(r,function(r,s){!0===(!(tH.isUndefined(r)||null===r)&&i.call(t,r,tH.isString(s)?s.trim():s,n,h))&&e(r,n?n.concat(s):[s])}),c.pop()}}(e),t};function tZ(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function tX(e,t){this._pairs=[],e&&tQ(e,this,t)}let t0=tX.prototype;function t1(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function t2(e,t,r){let n;if(!t)return e;let i=r&&r.encode||t1,s=r&&r.serialize;if(n=s?s(t,r):tH.isURLSearchParams(t)?t.toString():new tX(t,r).toString(i)){let t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+n}return e}t0.append=function(e,t){this._pairs.push([e,t])},t0.toString=function(e){let t=e?function(t){return e.call(this,t,tZ)}:tZ;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};class t3{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){tH.forEach(this.handlers,function(t){null!==t&&e(t)})}}var t5={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},t6="undefined"!=typeof URLSearchParams?URLSearchParams:tX,t4="undefined"!=typeof FormData?FormData:null,t8="undefined"!=typeof Blob?Blob:null;let t7="undefined"!=typeof window&&"undefined"!=typeof document,t9=(o="undefined"!=typeof navigator&&navigator.product,t7&&0>["ReactNative","NativeScript","NS"].indexOf(o)),re="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,rt=t7&&window.location.href||"http://localhost";var rr={...E,isBrowser:!0,classes:{URLSearchParams:t6,FormData:t4,Blob:t8},protocols:["http","https","file","blob","url","data"]},rn=function(e){if(tH.isFormData(e)&&tH.isFunction(e.entries)){let t={};return tH.forEachEntry(e,(e,r)=>{!function e(t,r,n,i){let s=t[i++];if("__proto__"===s)return!0;let o=Number.isFinite(+s),a=i>=t.length;return(s=!s&&tH.isArray(n)?n.length:s,a)?tH.hasOwnProp(n,s)?n[s]=[n[s],r]:n[s]=r:(n[s]&&tH.isObject(n[s])||(n[s]=[]),e(t,r,n[s],i)&&tH.isArray(n[s])&&(n[s]=function(e){let t,r;let n={},i=Object.keys(e),s=i.length;for(t=0;t<s;t++)n[r=i[t]]=e[r];return n}(n[s]))),!o}(tH.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0]),r,t,0)}),t}return null};let ri={transitional:t5,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){let r;let n=t.getContentType()||"",i=n.indexOf("application/json")>-1,s=tH.isObject(e);
58if(s&&tH.isHTMLForm(e)&&(e=new FormData(e)),tH.isFormData(e))return i?JSON.stringify(rn(e)):e;if(tH.isArrayBuffer(e)||tH.isBuffer(e)||tH.isStream(e)||tH.isFile(e)||tH.isBlob(e)||tH.isReadableStream(e))return e;if(tH.isArrayBufferView(e))return e.buffer;if(tH.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1){var o,a;return(o=e,a=this.formSerializer,tQ(o,new rr.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,n){return rr.isNode&&tH.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},a))).toString()}if((r=tH.isFileList(e))||n.indexOf("multipart/form-data")>-1){let t=this.env&&this.env.FormData;return tQ(r?{"files[]":e}:e,t&&new t,this.formSerializer)}}return s||i?(t.setContentType("application/json",!1),function(e,t,r){if(tH.isString(e))try{return(0,JSON.parse)(e),tH.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){let t=this.transitional||ri.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(tH.isResponse(e)||tH.isReadableStream(e))return e;if(e&&tH.isString(e)&&(r&&!this.responseType||n)){let r=t&&t.silentJSONParsing;try{return JSON.parse(e)}catch(e){if(!r&&n){if("SyntaxError"===e.name)throw tz.from(e,tz.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:rr.classes.FormData,Blob:rr.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};tH.forEach(["delete","get","head","post","put","patch"],e=>{ri.headers[e]={}});let rs=tH.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);var ro=e=>{let t,r,n;let i={};return e&&e.split("\n").forEach(function(e){n=e.indexOf(":"),t=e.substring(0,n).trim().toLowerCase(),r=e.substring(n+1).trim(),!t||i[t]&&rs[t]||("set-cookie"===t?i[t]?i[t].push(r):i[t]=[r]:i[t]=i[t]?i[t]+", "+r:r)}),i};let ra=Symbol("internals");function rl(e){return e&&String(e).trim().toLowerCase()}function ru(e){return!1===e||null==e?e:tH.isArray(e)?e.map(ru):String(e)}let rc=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function rh(e,t,r,n,i){if(tH.isFunction(n))return n.call(this,t,r);if(i&&(t=r),tH.isString(t)){if(tH.isString(n))return -1!==t.indexOf(n);if(tH.isRegExp(n))return n.test(t)}}class rd{constructor(e){e&&this.set(e)}set(e,t,r){let n=this;function i(e,t,r){let i=rl(t);if(!i)throw Error("header name must be a non-empty string");let s=tH.findKey(n,i);s&&void 0!==n[s]&&!0!==r&&(void 0!==r||!1===n[s])||(n[s||t]=ru(e))}let s=(e,t)=>tH.forEach(e,(e,r)=>i(e,r,t));if(tH.isPlainObject(e)||e instanceof this.constructor)s(e,t);else if(tH.isString(e)&&(e=e.trim())&&!rc(e))s(ro(e),t);else if(tH.isHeaders(e))for(let[t,n]of e.entries())i(n,t,r);else null!=e&&i(t,e,r);return this}get(e,t){if(e=rl(e)){let r=tH.findKey(this,e);if(r){let e=this[r];if(!t)return e;if(!0===t)return function(e){let t;let r=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
58for(;t=n.exec(e);)r[t[1]]=t[2];return r}(e);if(tH.isFunction(t))return t.call(this,e,r);if(tH.isRegExp(t))return t.exec(e);throw TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=rl(e)){let r=tH.findKey(this,e);return!!(r&&void 0!==this[r]&&(!t||rh(this,this[r],r,t)))}return!1}delete(e,t){let r=this,n=!1;function i(e){if(e=rl(e)){let i=tH.findKey(r,e);i&&(!t||rh(r,r[i],i,t))&&(delete r[i],n=!0)}}return tH.isArray(e)?e.forEach(i):i(e),n}clear(e){let t=Object.keys(this),r=t.length,n=!1;for(;r--;){let i=t[r];(!e||rh(this,this[i],i,e,!0))&&(delete this[i],n=!0)}return n}normalize(e){let t=this,r={};return tH.forEach(this,(n,i)=>{let s=tH.findKey(r,i);if(s){t[s]=ru(n),delete t[i];return}let o=e?i.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,r)=>t.toUpperCase()+r):String(i).trim();o!==i&&delete t[i],t[o]=ru(n),r[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return tH.forEach(this,(r,n)=>{null!=r&&!1!==r&&(t[n]=e&&tH.isArray(r)?r.join(", "):r)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let r=new this(e);return t.forEach(e=>r.set(e)),r}static accessor(e){let t=(this[ra]=this[ra]={accessors:{}}).accessors,r=this.prototype;function n(e){let n=rl(e);t[n]||(!function(e,t){let r=tH.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(e,r,i){return this[n].call(this,t,e,r,i)},configurable:!0})})}(r,e),t[n]=!0)}return tH.isArray(e)?e.forEach(n):n(e),this}}function rf(e,t){let r=this||ri,n=t||r,i=rd.from(n.headers),s=n.data;return tH.forEach(e,function(e){s=e.call(r,s,i.normalize(),t?t.status:void 0)}),i.normalize(),s}function rp(e){return!!(e&&e.__CANCEL__)}function rg(e,t,r){tz.call(this,null==e?"canceled":e,tz.ERR_CANCELED,t,r),this.name="CanceledError"}function ry(e,t,r){let n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new tz("Request failed with status code "+r.status,[tz.ERR_BAD_REQUEST,tz.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}rd.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),tH.reduceDescriptors(rd.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}}),tH.freezeMethods(rd),tH.inherits(rg,tz,{__CANCEL__:!0});var rm=function(e,t){let r;let n=Array(e=e||10),i=Array(e),s=0,o=0;return t=void 0!==t?t:1e3,function(a){let l=Date.now(),u=i[o];r||(r=l),n[s]=a,i[s]=l;let c=o,h=0;for(;c!==s;)h+=n[c++],c%=e;if((s=(s+1)%e)===o&&(o=(o+1)%e),l-r<t)return;let d=u&&l-u;return d?Math.round(1e3*h/d):void 0}},rv=function(e,t){let r=0,n=1e3/t,i=null;return function(){let t=Date.now();if(this===!0||t-r>n)return i&&(clearTimeout(i),i=null),r=t,e.apply(null,arguments);i||(i=setTimeout(()=>(i=null,r=Date.now(),e.apply(null,arguments)),n-(t-r)))}},rb=(e,t,r=3)=>{let n=0,i=rm(50,250);return rv(r=>{let s=r.loaded,o=r.lengthComputable?r.total:void 0,a=s-n,l=i(a);n=s;let u={loaded:s,total:o,progress:o?s/o:void 0,bytes:a,rate:l||void 0,estimated:l&&o&&s<=o?(o-s)/l:void 0,event:r,lengthComputable:null!=o};u[t?"download":"upload"]=!0,e(u)},r)},rw=rr.hasStandardBrowserEnv?function(){let e;let t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function n(e){let n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=n(window.location.href),function(t){let r=tH.isString(t)?n(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0},r_=rr.hasStandardBrowserEnv?{write(e,t,r,n,i,s){let o=[e+"="+encodeURIComponent(t)];tH.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),tH.isString(n)&&o.push("path="+n),tH.isString(i)&&o.push("domain="+i),!0===s&&o.push("secure"),document.cookie=o.join("; ")},read(e){let t=document.cookie.match(RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function rE(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e:t}let rS=e=>e instanceof rd?{...e}:e;function rA(e,t){t=t||{};let r={};function n(e,t,r){return tH.isPlainObject(e)&&tH.isPlainObject(t)?tH.merge.call({caseless:r},e,t):tH.isPlainObject(t)?tH.merge({},t):tH.isArray(t)?t.slice():t}function i(e,t,r){return tH.isUndefined(t)?tH.isUndefined(e)?void 0:n(void 0,e,r):n(e,t,r)}function s(e,t){if(!tH.isUndefined(t))return n(void 0,t)}function o(e,t){return tH.isUndefined(t)?tH.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function a(r,i,s){return s in t?n(r,i):s in e?n(void 0,r):void 0}let l={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBo
58dyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(e,t)=>i(rS(e),rS(t),!0)};return tH.forEach(Object.keys(Object.assign({},e,t)),function(n){let s=l[n]||i,o=s(e[n],t[n],n);tH.isUndefined(o)&&s!==a||(r[n]=o)}),r}var rk=e=>{let t;let r=rA({},e),{data:n,withXSRFToken:i,xsrfHeaderName:s,xsrfCookieName:o,headers:a,auth:l}=r;if(r.headers=a=rd.from(a),r.url=t2(rE(r.baseURL,r.url),e.params,e.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),tH.isFormData(n)){if(rr.hasStandardBrowserEnv||rr.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(!1!==(t=a.getContentType())){let[e,...r]=t?t.split(";").map(e=>e.trim()).filter(Boolean):[];a.setContentType([e||"multipart/form-data",...r].join("; "))}}if(rr.hasStandardBrowserEnv&&(i&&tH.isFunction(i)&&(i=i(r)),i||!1!==i&&rw(r.url))){let e=s&&o&&r_.read(o);e&&a.set(s,e)}return r},rC="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,r){let n;let i=rk(e),s=i.data,o=rd.from(i.headers).normalize(),{responseType:a}=i;function l(){i.cancelToken&&i.cancelToken.unsubscribe(n),i.signal&&i.signal.removeEventListener("abort",n)}let u=new XMLHttpRequest;function c(){if(!u)return;let n=rd.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders());ry(function(e){t(e),l()},function(e){r(e),l()},{data:a&&"text"!==a&&"json"!==a?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:n,config:e,request:u}),u=null}u.open(i.method.toUpperCase(),i.url,!0),u.timeout=i.timeout,"onloadend"in u?u.onloadend=c:u.onreadystatechange=function(){u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(c)},u.onabort=function(){u&&(r(new tz("Request aborted",tz.ECONNABORTED,i,u)),u=null)},u.onerror=function(){r(new tz("Network Error",tz.ERR_NETWORK,i,u)),u=null},u.ontimeout=function(){let e=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded",t=i.transitional||t5;i.timeoutErrorMessage&&(e=i.timeoutErrorMessage),r(new tz(e,t.clarifyTimeoutError?tz.ETIMEDOUT:tz.ECONNABORTED,i,u)),u=null},void 0===s&&o.setContentType(null),"setRequestHeader"in u&&tH.forEach(o.toJSON(),function(e,t){u.setRequestHeader(t,e)}),tH.isUndefined(i.withCredentials)||(u.withCredentials=!!i.withCredentials),a&&"json"!==a&&(u.responseType=i.responseType),"function"==typeof i.onDownloadProgress&&u.addEventListener("progress",rb(i.onDownloadProgress,!0)),"function"==typeof i.onUploadProgress&&u.upload&&u.upload.addEventListener("progress",rb(i.onUploadProgress)),(i.cancelToken||i.signal)&&(n=t=>{u&&(r(!t||t.type?new rg(null,e,u):t),u.abort(),u=null)},i.cancelToken&&i.cancelToken.subscribe(n),i.signal&&(i.signal.aborted?n():i.signal.addEventListener("abort",n)));let h=function(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(i.url);if(h&&-1===rr.protocols.indexOf(h)){r(new tz("Unsupported protocol "+h+":",tz.ERR_BAD_REQUEST,e));return}u.send(s||null)})},rI=(e,t)=>{let r,n=new AbortController,i=function(e){if(!r){r=!0,o();let t=e instanceof Error?e:this.reason;n.abort(t instanceof tz?t:new rg(t instanceof Error?t.message:t))}},s=t&&setTimeout(()=>{i(new tz(`timeout ${t} of ms exceeded`,tz.ETIMEDOUT))},t),o=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(e=>{e&&(e.removeEventListener?e.removeEventListener("abort",i):e.unsubscribe(i))}),e=null)};e.forEach(e=>e&&e.addEventListener&&e.addEventListener("abort",i));let{signal:a}=n;return a.unsubscribe=o,[a,()=>{s&&clearTimeout(s),s=null}]};let rx=function*(e,t){let r,n=e.byteLength;if(!t||n<t){yield e;return}let i=0;for(;i<n;)r=i+t,yield e.slice(i,r),i=r},rP=async function*(e,t,r){for await(let n of e)yield*rx(ArrayBuffer.isView(n)?n:await r(String(n)),t)},rO=(e,t,r,n,i)=>{let s=rP(e,t,i),o=0;return new ReadableStream({type:"bytes",async pull(e){let{done:t,value:i}=await s.next();if(t){e.close(),n();return}let a=i.byteLength;r&&r(o+=a),e.enqueue(new Uint8Array(i))},cancel:e=>(n(e),s.return())},{highWaterMark:2})},rT=(e,t)=>
58{let r=null!=e;return n=>setTimeout(()=>t({lengthComputable:r,total:e,loaded:n}))},rR="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,rN=rR&&"function"==typeof ReadableStream,rD=rR&&("function"==typeof TextEncoder?(a=new TextEncoder,e=>a.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer())),rB=rN&&(()=>{let e=!1,t=new Request(rr.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})(),rM=rN&&!!(()=>{try{return tH.isReadableStream(new Response("").body)}catch(e){}})(),rL={stream:rM&&(e=>e.body)};rR&&(d=new Response,["text","arrayBuffer","blob","formData","stream"].forEach(e=>{rL[e]||(rL[e]=tH.isFunction(d[e])?t=>t[e]():(t,r)=>{throw new tz(`Response type '${e}' is not supported`,tz.ERR_NOT_SUPPORT,r)})}));let rU=async e=>null==e?0:tH.isBlob(e)?e.size:tH.isSpecCompliantForm(e)?(await new Request(e).arrayBuffer()).byteLength:tH.isArrayBufferView(e)?e.byteLength:(tH.isURLSearchParams(e)&&(e+=""),tH.isString(e))?(await rD(e)).byteLength:void 0,rj=async(e,t)=>{let r=tH.toFiniteNumber(e.getContentLength());return null==r?rU(t):r},rF={http:null,xhr:rC,fetch:rR&&(async e=>{let t,r,n,{url:i,method:s,data:o,signal:a,cancelToken:l,timeout:u,onDownloadProgress:c,onUploadProgress:h,responseType:d,headers:f,withCredentials:p="same-origin",fetchOptions:g}=rk(e);d=d?(d+"").toLowerCase():"text";let[y,m]=a||l||u?rI([a,l],u):[],v=()=>{t||setTimeout(()=>{y&&y.unsubscribe()}),t=!0};try{if(h&&rB&&"get"!==s&&"head"!==s&&0!==(n=await rj(f,o))){let e,t=new Request(i,{method:"POST",body:o,duplex:"half"});tH.isFormData(o)&&(e=t.headers.get("content-type"))&&f.setContentType(e),t.body&&(o=rO(t.body,65536,rT(n,rb(h)),null,rD))}tH.isString(p)||(p=p?"cors":"omit"),r=new Request(i,{...g,signal:y,method:s.toUpperCase(),headers:f.normalize().toJSON(),body:o,duplex:"half",withCredentials:p});let t=await fetch(r),a=rM&&("stream"===d||"response"===d);if(rM&&(c||a)){let e={};["status","statusText","headers"].forEach(r=>{e[r]=t[r]});let r=tH.toFiniteNumber(t.headers.get("content-length"));t=new Response(rO(t.body,65536,c&&rT(r,rb(c,!0)),a&&v,rD),e)}d=d||"text";let l=await rL[tH.findKey(rL,d)||"text"](t,e);return a||v(),m&&m(),await new Promise((n,i)=>{ry(n,i,{data:l,headers:rd.from(t.headers),status:t.status,statusText:t.statusText,config:e,request:r})})}catch(t){if(v(),t&&"TypeError"===t.name&&/fetch/i.test(t.message))throw Object.assign(new tz("Network Error",tz.ERR_NETWORK,e,r),{cause:t.cause||t});throw tz.from(t,t&&t.code,e,r)}})};tH.forEach(rF,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});let rq=e=>`- ${e}`,rH=e=>tH.isFunction(e)||null===e||!1===e;var rz=e=>{let t,r;let{length:n}=e=tH.isArray(e)?e:[e],i={};for(let s=0;s<n;s++){let n;if(r=t=e[s],!rH(t)&&void 0===(r=rF[(n=String(t)).toLowerCase()]))throw new tz(`Unknown adapter '${n}'`);if(r)break;i[n||"#"+s]=r}if(!r){let e=Object.entries(i).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new tz("There is no suitable adapter to dispatch the request "+(n?e.length>1?"since :\n"+e.map(rq).join("\n"):" "+rq(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r};function r$(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new rg(null,e)}function rV(e){return r$(e),e.headers=rd.from(e.headers),e.data=rf.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),rz(e.adapter||ri.adapter)(e).then(function(t){return r$(e),t.data=rf.call(e,e.transformResponse,t),t.headers=rd.from(t.headers),t},function(t){return!rp(t)&&(r$(e),t&&t.response&&(t.response.data=rf.call(e,e.transformResponse,t.response),t.response.headers=rd.from(t.response.headers))),Promise.reject(t)})}let rW="1.7.2",rG={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{rG[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});let rK={};rG.transitional=function(e,t,r){function n(e,t){return"[Axios v"+rW+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,i,s)=>{if(!1===e)throw new tz(n(i," has been removed"+(t?" in "+t:"")),tz.ERR_DEPRECATED);return t&&!rK[i]&&(rK[i]=!0,console.warn(n(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,i,s)}};var rJ={assertOptions:function(e,t,r){if("object"!=typeof e)throw new tz("options must be an object",tz.ERR_BAD_OPTION_VALUE);let n=Object.keys(e),i=n.length;for(;i-- >0;){let s=n[i],o=t[s];if(o){let t=e[s],r=void 0===t||o(t,s,e);if(!0!==r)throw new tz("option "+s+" must be "+r,tz.ERR_BAD_OPTION_VALUE);continue}if(!0!==r)throw new tz("Unknown option "+s,tz.ERR_BAD_OPTION)}},validators:rG};let rY=rJ.validators;class rQ{constructor(e){this.defaults=e,this.interceptors={request:new t3,response:new t3}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t;Error.captureStackTrace?Error.captureStackTrace(t={}):t=Error();let r=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?r&&!String(e.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+r):e.stack=r}catch(e){}}throw e}}_request(e,t){let r,n;"string"==typeof e?(t=t||{}).url=e:t=e||{};let{transitional:i,paramsSerializer:s,headers:o}=t=rA(this.defaults,t);void 0!==i&&rJ.assertOptions(i,{silentJSONParsing:rY.transitional(rY.boolean),forcedJSONParsing:rY.transitional(rY.boolean),clarifyTimeoutError:rY.transitional(rY.boolean)}
58,!1),null!=s&&(tH.isFunction(s)?t.paramsSerializer={serialize:s}:rJ.assertOptions(s,{encode:rY.function,serialize:rY.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=o&&tH.merge(o.common,o[t.method]);o&&tH.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=rd.concat(a,o);let l=[],u=!0;this.interceptors.request.forEach(function(e){("function"!=typeof e.runWhen||!1!==e.runWhen(t))&&(u=u&&e.synchronous,l.unshift(e.fulfilled,e.rejected))});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let h=0;if(!u){let e=[rV.bind(this),void 0];for(e.unshift.apply(e,l),e.push.apply(e,c),n=e.length,r=Promise.resolve(t);h<n;)r=r.then(e[h++],e[h++]);return r}n=l.length;let d=t;for(h=0;h<n;){let e=l[h++],t=l[h++];try{d=e(d)}catch(e){t.call(this,e);break}}try{r=rV.call(this,d)}catch(e){return Promise.reject(e)}for(h=0,n=c.length;h<n;)r=r.then(c[h++],c[h++]);return r}getUri(e){return t2(rE((e=rA(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}tH.forEach(["delete","get","head","options"],function(e){rQ.prototype[e]=function(t,r){return this.request(rA(r||{},{method:e,url:t,data:(r||{}).data}))}}),tH.forEach(["post","put","patch"],function(e){function t(t){return function(r,n,i){return this.request(rA(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}rQ.prototype[e]=t(),rQ.prototype[e+"Form"]=t(!0)});class rZ{constructor(e){let t;if("function"!=typeof e)throw TypeError("executor must be a function.");this.promise=new Promise(function(e){t=e});let r=this;this.promise.then(e=>{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null}),this.promise.then=e=>{let t;let n=new Promise(e=>{r.subscribe(e),t=e}).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e(function(e,n,i){r.reason||(r.reason=new rg(e,n,i),t(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new rZ(function(t){e=t}),cancel:e}}}let rX={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,Parti
58alContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(rX).forEach(([e,t])=>{rX[t]=e});let r0=function e(t){let r=new rQ(t),n=to(rQ.prototype.request,r);return tH.extend(n,rQ.prototype,r,{allOwnKeys:!0}),tH.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(rA(t,r))},n}(ri);r0.Axios=rQ,r0.CanceledError=rg,r0.CancelToken=rZ,r0.isCancel=rp,r0.VERSION=rW,r0.toFormData=tQ,r0.AxiosError=tz,r0.Cancel=r0.CanceledError,r0.all=function(e){return Promise.all(e)},r0.spread=function(e){return function(t){return e.apply(null,t)}},r0.isAxiosError=function(e){return tH.isObject(e)&&!0===e.isAxiosError},r0.mergeConfig=rA,r0.AxiosHeaders=rd,r0.formToJSON=e=>rn(tH.isHTMLForm(e)?new FormData(e):e),r0.getAdapter=rz,r0.HttpStatusCode=rX,r0.default=r0;let r1=async(e,t)=>{try{let{data:{chainId:r}}=await r0.post(`${t??"https://backend-vikp.onrender.com"}/v1/projects/get-chain-id`,{projectId:e},{headers:{"Content-Type":"application/json"}});return r}catch(e){console.log(e);return}};var r2=r(52186),r3=r(51359),r5=r(64113),r6=r(88056),r4=r(74188),r8=r(77955),r7=r(77350),r9=r(95258);let ne=(0,r9.a)({id:42069,name:"Gelato OPTestnet",network:"gelatoOPTestnet",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.op-testnet.gelato.digital"],webSocket:[]},public:{http:["https://rpc.op-testnet.gelato.digital"],webSocket:[]}},blockExplorers:{default:{name:"Explorer",url:"https://blockscout.op-testnet.gelato.digital"}}}),nt=(0,r9.a)({id:1261120,name:"Astar zKatana",network:"astarZKatana",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.zkatana.gelato.digital"],webSocket:["https://ws.zkatana.gelato.digital"]},public:{http:["https://rpc.zkatana.gelato.digital"],webSocket:["https://ws.zkatana.gelato.digital"]}},blockExplorers:{default:{name:"Explorer",url:"https://zkatana.blockscout.com"}}}),nr=(0,r9.a)({id:3776,name:"Astar zkEVM",network:"AstarZkEVM",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.startale.com/astar-zkevm"]},public:{http:["https://rpc.startale.com/astar-zkevm"]}},blockExplorers:{default:{name:"Astar zkEVM Explorer",url:"https://astar-zkevm.explorer.startale.com"}},contracts:{multicall3:{address:"0x36eabf148272BA81A5225C6a3637972F0EE17771",blockCreated:93528}},testnet:!1}),nn=(0,r9.a)({id:42170,name:"Arbitrum Nova",network:"arbitrumNova",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18}
58,rpcUrls:{default:{http:["https://nova.arbitrum.io/rpc"]},public:{http:["https://nova.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://nova.arbiscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1746963}},testnet:!1}),ni=(0,r9.a)({id:88153591557,name:"Arbitrum Blueberry",network:"arbitrum-blueberry",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.arb-blueberry.gelato.digital"]},public:{http:["https://rpc.arb-blueberry.gelato.digital"]}},blockExplorers:{default:{name:"Gelatoscout",url:"https://arb-blueberry.gelatoscout.com"}},testnet:!0}),ns=(0,r9.a)({id:123420111,name:"OP Celestia Raspberry",network:"op-celestia-raspberry",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.opcelestia-raspberry.gelato.digital"]},public:{http:["https://rpc.opcelestia-raspberry.gelato.digital"]}},blockExplorers:{default:{name:"Gelatoscout",url:"https://opcelestia-raspberry.gelatoscout.com"}},testnet:!0}),no=(0,r9.a)({id:94204209,name:"Polygon Blackberry",network:"polybon-blackberry",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.polygon-blackberry.gelato.digital"]},public:{http:["https://rpc.polygon-blackberry.gelato.digital"]}},blockExplorers:{default:{name:"Gelatoscout",url:"https://polygon-blackberry.gelatoscout.com"}},testnet:!0}),na=(0,r9.a)({id:7560,name:"Cyber Mainnet",network:"cyber-mainnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://cyber.alt.technology/"]},public:{http:["https://cyber.alt.technology/"]}},blockExplorers:{default:{name:"Cyber Mainnet Explorer",url:"https://cyber-explorer.alt.technology/"}},testnet:!1}),nl=(0,r9.a)({id:111557560,name:"Cyber Testnet",network:"cyber-testnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://cyber-testnet.alt.technology"]},public:{http:["https://cyber-testnet.alt.technology"]}},blockExplorers:{default:{name:"Cyber Testnet Explorer",url:"https://cyber-testnet-explorer.alt.technology/"}},testnet:!0}),nu=(0,r9.a)({id:6038361,name:"Astar zkEVM Testnet zKyoto",network:"zKyoto",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.startale.com/zkyoto"]},public:{http:["https://rpc.startale.com/zkyoto"]}},blockExplorers:{default:{name:"zKyoto Explorer",url:"https://zkyoto.explorer.startale.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:196153}},testnet:!0}),nc=(0,r9.a)({id:666666666,name:"Degen",nativeCurrency:{decimals:18,name:"Degen",symbol:"DEGEN"},network:"degen",rpcUrls:{default:{http:["https://rpc.degen.tips"],webSocket:["wss://rpc.degen.tips"]},public:{http:["https://rpc.degen.tips"],webSocket:["wss://rpc.degen.tips"]}},blockExplorers:{default:{name:"Degen Chain Explorer",url:"https://explorer.degen.tips"}}}),nh=e=>{let t=(0,K.O0)(e.data);return(function(e,t){if(e.length!==t.length)throw new r2.fs({expectedLength:e.length,givenLength:t.length});let r=[];for(let n=0;n<e.length;n++){let i=e[n],s=t[n];
58r.push(function e(t,r,n=!1){if("address"===t){if(!(0,r5.U)(r))throw new r3.b({address:r});return(0,e1.vk)(r.toLowerCase(),{size:n?32:null})}if("string"===t)return(0,ec.$G)(r);if("bytes"===t)return r;if("bool"===t)return(0,e1.vk)((0,ec.C4)(r),{size:n?32:1});let i=t.match(r6.lh);if(i){let[e,t,s="256"]=i,o=parseInt(s)/8;return(0,ec.eC)(r,{size:n?32:o,signed:"int"===t})}let s=t.match(r6.eL);if(s){let[e,t]=s;if(parseInt(t)!==(r.length-2)/2)throw new r2.KY({expectedSize:parseInt(t),givenSize:(r.length-2)/2});return(0,e1.vk)(r,{dir:"right",size:n?32:null})}let o=t.match(r6.Ow);if(o&&Array.isArray(r)){let[t,n]=o,i=[];for(let t=0;t<r.length;t++)i.push(e(n,r[t],!0));return 0===i.length?"0x":(0,J.SM)(i)}throw new r2.Mi(t)}(i,s))}return(0,J.SM)(r)})(["uint8","address","uint256","uint256","bytes"],[e.delegateCall?1:0,e.target,e.value||BigInt(0),BigInt(t.length),function(e,t){let r={to:"hex"},n=r.to;return"number"===n?function(e,t={}){void 0!==t.size&&(0,e$.Yf)(e,{size:t.size});let r=(0,ec.ci)(e,t);return(0,e$.ly)(r)}(e,r):"bigint"===n?function(e,t={}){void 0!==t.size&&(0,e$.Yf)(e,{size:t.size});let r=(0,ec.ci)(e,t);return(0,e$.y_)(r)}(e,r):"boolean"===n?function(e,t={}){let r=e;if(void 0!==t.size&&((0,e$.Yf)(r,{size:t.size}),r=(0,r8.f)(r)),r.length>1||r[0]>1)throw new r4.yr(r);return!!r[0]}
58(e,r):"string"===n?function(e,t={}){let r=e;return void 0!==t.size&&((0,e$.Yf)(r,{size:t.size}),r=(0,r8.f)(r,{dir:"right"})),new TextDecoder().decode(r)}(e,r):(0,ec.ci)(e,r)}(t,0)]).slice(2)},nd=e=>"0x"+e.map(e=>nh(e)).join(""),nf=e=>({getAddress:async()=>Promise.resolve((await e.getAddresses())[0]),signMessage:async t=>await e.signMessage({account:e.account,message:"string"==typeof t?t:{raw:t}}),signTypedData:async t=>np(await e.signTypedData({...t,account:e.account}))}),np=e=>{let t=e;if(!(0,Y.v)(t)&&(t=`0x${t}`,!(0,Y.v)(t)))throw Error("Invalid signed data "+e);let{r,s:n,v:i}=function(e){let{r:t,s:r}=el.kA.Signature.fromCompact(e.slice(2,130)),n=BigInt(`0x${e.slice(130)}`);return{r:(0,ec.eC)(t,{size:32}),s:(0,ec.eC)(r,{size:32}),v:n}}(t);return(0n===i||1n===i)&&(i+=27n),(0,ef.X)({r,s:n,v:i})},ng=e=>{for(let t of Object.values(r7).concat(Object.values(S)))if(t.id===e)return t;throw Error("could not find chain")};class ny extends ts{constructor(e){super(e),Object.defineProperty(this,"owner",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.owner=e.owner}static async init(e){let t=await r1(e.projectId);if(!t)throw Error("ChainId not found");let r=ng(t);return new ny({...e,chain:r})}async signer(){return await Promise.resolve(this.owner)}async getOwner(){return this.owner.getAddress()}async getEnableData(){return this.getOwner()}encodeEnable(e){return(0,G.R)({abi:k,functionName:"enable",args:[e]})}encodeDisable(e="0x"){return(0,G.R)({abi:k,functionName:"disable",args:[e]})}async getDummyUserOpSignature(){return"0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c"}async isPluginEnabled(e,t){if(!this.publicClient)throw Error("Validator uninitialized: PublicClient missing");let r=await this.publicClient.readContract({abi:C,address:e,functionName:"getExecution",args:[t]}),n=await this.publicClient.readContract({abi:k,address:this.validatorAddress,functionName:"ecdsaValidatorStorage",args:[e]});return r.validator.toLowerCase()===this.validatorAddress.toLowerCase()&&n.toLowerCase()===(await this.getEnableData()).toLowerCase()}async signMessage(e){return await this.owner.signMessage(e)}async signTypedData(e){return np(await this.owner.signTypedData(e))}async signUserOp(e){if(!this.chain)throw Error("Validator uninitialized");let t=eY({...e,signature:"0x"},this.entryPointAddress,BigInt(this.chain.id)),r="string"==typeof t?(0,K.O0)(t):t;return await this.owner.signMessage(r)}}var nm=r(83007),nv=r(26422);r(91440);var nb=r(69532);(0,nm.o)("doRecovery(address, bytes)");var nw=r(49014),n_=r(65310),nE=r(20101);function nS({abi:e,data:t}){let r=(0,nw.tP)(t,0,4),n=e.find(e=>"function"===e.type&&r===(0,nm.o)((0,nE.t)(e)));if(!n)throw new r2.eF(r,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:n.name,args:"inputs"in n&&n.inputs&&n.inputs.length>0?(0,n_.r)(n.inputs,(0,nw.tP)(t,4)):void 0}}r(91206);var nA=r(18748);let nk=({chain:e,rpcUrl:t,bundlerRpcUrl:r,projectId:n,bundlerProvider:i})=>{let s=(0,H.d)(r??e5,{fetchOptions:{headers:r===e5?{projectId:n,bundlerProvider:i}:{}},name:"Connected bundler network",key:"connected-bundler-network",retryCount:0,timeout:35e3}),o=(0,H.d)(t??tn[e.id]);return z((0,q.v)({chain:e,transport:(0,nb.P)({async request({method:t,params:r}){let n;return["eth_sendUserOperation","eth_estimateUserOperationGas","eth_getUserOperationReceipt","eth_getUserOperationByHash","eth_supportedEntryPoints","eth_maxPriorityFeePerGas","rundler_maxPriorityFeePerGas","pimlico_getUserOperationGasPrice"].includes(t)?await s({chain:e}).request({method:t,params:r}):await o({chain:e}).request({method:t,params:r})}})}))};function nC(e){return e&&void 0!==e.connectValidator}(f=b||(b={})).UNDEFINED="0x0",f.NOT_DEPLOYED="0x1",f.DEPLOYED="0x2";class nI extends W{constructor(e){super({...e,entryPointAddress:e.entryPointAddress??e4,chain:e.chain??ti.v,rpcClient:e.rpcClient??e5}),Object.defineProperty(this,"factoryAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"index",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"initCode",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"validator",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"defaultValidator",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.index=e.index??0n,this.factoryAddress=e.factoryAddress??"0x5de4839a76cf55d0c90e2061ef4386d962E15ae3",this.validator=e.validator,this.defaultValidator=e.defaultValidator,this.initCode=e.initCode}static async init(e){let t=await r1(e.projectId);if(!t)throw Error("ChainId not found");let r=ng(t),n="string"==typeof e.rpcClient?nk({chain:r,rpcUrl:e.rpcClient,bundlerRpcUrl:e.rpcClient??e5,projectId:e.projectId,bundlerProvider:e.bundlerProvider}):e.rpcClient;return new nI({...e,chain:r,rpcClient:n})}connectValidator(e){return eQ(this,"validator",e),this}getValidator(){if(!this.validator)throw Error("Validator not connected");return this.validator}getDummySignature(){return"0x00000000870fe151d548a1c527c3804866fab30abf28ed17b79d5fc5149f19ca0819fefc3c57f3da4fdf9b10fab3f2f3dca536467ae44943b9dbb8433efe7760ddd72aaa1c"}
58async getInitCode(){if(this.deploymentState===b.DEPLOYED)return"0x";let e=await this.rpcProvider.getContractCode(await this.getAddress());return(e?.length??0)>2?(this.deploymentState=b.DEPLOYED,"0x"):(this.deploymentState=b.NOT_DEPLOYED,this.initCode??this.getAccountInitCode())}getIndex(){return this.index}async approvePlugin(){if(!this.validator)throw Error("Validator not connected");if(this.defaultValidator&&!this.validator.getEnableSignature()){let{executor:e,selector:t,validAfter:r,validUntil:n}=this.validator.getPluginValidatorData(),i=await this.defaultValidator.approveExecutor(await this.getAddress(),t,e,n,r,this.validator);this.validator.setEnableSignature(i)}}async encodeExecute(e,t,r){if(!this.validator)throw Error("Validator not connected");return e.toLowerCase()===(await this.getAddress()).toLowerCase()&&this.validator.shouldDelegateViaFallback()?r:this.encodeExecuteAction(e,t,r,0)}async encodeBatchExecute(e){let t=await this.getKernelImplementationAddess(),r=await this.getInitCode();if(t?.toLowerCase()!==e7.toLowerCase()&&t?.toLowerCase()!=="0x8dd4dbb54d8a8cf0de6f9ccc4609470a30eff18c"&&t?.toLowerCase()!=="0xd3f582f6b4814e989ee8e96bc3175320b5a540ab"&&"0x"===r){let t=(0,G.R)({abi:x,functionName:"multiSend",args:[nd(e)]});return await this.encodeExecuteDelegate(e8,BigInt(0),t)}return await this.encodeExecuteBatchAction(e)}async encodeExecuteDelegate(e,t,r){return this.encodeExecuteAction(e,t,r,1)}async encodeSetExection(){if(!this.validator)throw Error("Validator not connected");let{executor:e,selector:t,validAfter:r,validUntil:n}=await this.validator.getPluginValidatorData(),i=await this.validator.getEnableData();return(0,G.R)({abi:C,functionName:"setExecution",args:[t,e,this.validator.validatorAddress,n,r,i]})}async encodeUgradeTo(){return(0,G.R)({abi:C,functionName:"upgradeTo",args:[e7]})}async getKernelImplementationAddess(){try{let e=await this.rpcProvider.getStorageAt({address:await this.getAddress(),slot:"0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc"});return e?"0x"+e.slice(26):e}catch(e){return}}async signMessageWith6492(e){try{if(!this.validator)throw Error("Validator not connected");let t="string"==typeof e?(0,K.O0)(e):e,r=await this.validator.signMessage((0,K.O0)((0,ed.r)({raw:t})));return await this.isAccountDeployed()||(r=eH({factoryAddress:this.factoryAddress,initCode:await this.getFactoryInitCode(),signature:r})),r}catch(e){throw console.error("Got Error - ",e.message),Error("Message Signing with EIP6492 failed")}}async signTypedDataWith6492(e){try{if(!this.validator)throw Error("Validator not connected");let t=await this.validator.signTypedData(e);return await this.isAccountDeployed()||(t=eH({factoryAddress:this.factoryAddress,initCode:await this.getFactoryInitCode(),signature:t})),t}catch(e){throw console.error("Got Error - ",e.message),Error("Message Signing with EIP6492 failed")}}async signMessage(e){if(!this.validator)throw Error("Validator not connected");let t="string"==typeof e?(0,K.O0)(e):e;return await this.validator.signMessage(t)}async signTypedData(e){if(!this.validator)throw Error("Validator not connected");return await this.validator.signTypedData(e)}signUserOp(e){if(!this.validator)throw Error("Validator not connected");return this.validator.signUserOp(e)}encodeExecuteAction(e,t,r,n){return(0,G.R)({abi:C,functionName:"execute",args:[e,t,r,n]})}encodeExecuteBatchAction(e){return(0,G.R)({abi:C,functionName:"executeBatch",args:[e.map(e=>({to:e.target,value:e.value??0n,data:e.data}))]})}async getAccountInitCode(){return(0,J.SM)([this.factoryAddress,await this.getFactoryInitCode()])}async getNonce(){if(!await this.isAccountDeployed())return 0n;if(!this.validator)throw Error("Validator unintialized");let e=await this.getAddress(),t=this.validator.getNonceKey();return this.entryPoint.read.getNonce([e,t])}async getFactoryInitCode(){let e=this.defaultValidator??this.validator;if(!e)throw Error("Validator not connected");try{return(0,G.R)({abi:I,functionName:"createAccount",args:[e7,(0,G.R)({abi:C,functionName:"initialize",args:[e.getAddress(),await e.getEnableData()]}),this.index]})}catch(e){throw console.error("err occurred:",e.message),Error("Factory Code generation failed")}}}var nx=r(48926);let nP=O.find(e=>"simulateValidation"===e.name)?.inputs[0],nO=e=>Object.keys(e).map(t=>{let r=e[t];return"string"==typeof r&&r.startsWith("0x")||(r=(0,ec.NC)(r)),[t,r]}).reduce((e,[t,r])=>({...e,[t]:r}),{});var nT=r(9109).Buffer;let nR={fixed:21e3,perUserOp:18300,perUserOpWord:4,zeroByte:4,nonZeroByte:16,bundleSize:1,sigSize:65};
58class nN extends nx.G{constructor(){super("Chain does not support EIP-1559 fees."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Eip1559FeesNotSupportedError"})}}let nD=e=>(e.withFeeDataGetter(async t=>{let r,n,i=await eK({maxFeePerGas:t.maxFeePerGas,maxPriorityFeePerGas:t.maxPriorityFeePerGas});if("GELATO"===e.bundlerProvider)return{maxFeePerGas:0n,maxPriorityFeePerGas:0n};try{({maxFeePerGas:r,maxPriorityFeePerGas:n}=await nU(e))}catch(e){console.warn("getGas: eth_maxPriorityFeePerGas failed, falling back to legacy gas price.")}if(void 0===r||void 0===n){let t=await nj(e);r=t?.maxFeePerGas?BigInt(t?.maxFeePerGas):0n,n=t.maxPriorityFeePerGas?BigInt(t.maxPriorityFeePerGas):0n}return i.maxFeePerGas||i.maxPriorityFeePerGas?{maxFeePerGas:i.maxFeePerGas??r,maxPriorityFeePerGas:i.maxPriorityFeePerGas??n}:{maxFeePerGas:r,maxPriorityFeePerGas:n}}),e.withGasEstimator(async t=>{if(void 0!==t.callGasLimit&&void 0!==t.verificationGasLimit&&void 0!==t.preVerificationGas)return t;let r=await e.account?.getInitCode(),n=await nB(e,r),i={...t,callGasLimit:void 0!==r&&r.length>2?BigInt("1000000"):BigInt(55e3),verificationGasLimit:BigInt(11e4)+n,preVerificationGas:BigInt(1e5)};i.preVerificationGas=await nM(i);let s=eJ(await eK(i)),{preVerificationGas:o,verificationGasLimit:a,callGasLimit:l}=await e.rpcClient.estimateUserOperationGas(s,e4);return s.preVerificationGas=BigInt(o)??s.preVerificationGas,s.verificationGasLimit=BigInt(a)??s.verificationGasLimit,s.callGasLimit=BigInt(l)??s.callGasLimit,{...t,...s}}),e),nB=async(e,t)=>{if(null==t||"0x"===t)return BigInt(0);let r=t.substring(0,42),n="0x"+t.substring(42);return await e.rpcClient.estimateGas({account:e4,to:r,data:n})},nM=async e=>(function(e,t){let r={...nR,...(void 0)??{}},n={preVerificationGas:21e3,signature:(0,ec.NC)(nT.alloc(r.sigSize,1)),...e},i=(0,K.O0)(function(e,t=!0){if(t){let t=(0,ep.E)([{type:"address",name:"sender"},{type:"uint256",name:"nonce"},{type:"bytes",name:"initCode"},{type:"bytes",name:"callData"},{type:"uint256",name:"callGasLimit"},{type:"uint256",name:"verificationGasLimit"},{type:"uint256",name:"preVerificationGas"},{type:"uint256",name:"maxFeePerGas"},{type:"uint256",name:"maxPriorityFeePerGas"},{type:"bytes",name:"paymasterAndData"},{type:"bytes",name:"signature"}],Object.values({...e,signature:"0x"}));return"0x"+t.slice(66,t.length-64)}return function(e,t){let r=e.map(e=>"bytes"===e.type&&t?"bytes32":e.type).join(", "),n=e.map(e=>"bytes"===e.type&&t?(0,eh.w)(e.val):e.val);return(0,ep.E)(eq(r),n)}(nP.components.map(t=>({type:t.type,val:e[t.name]})),t)}(n,!1));return Math.round(i.map(e=>0===e?r.zeroByte:r.nonZeroByte).reduce((e,t)=>e+t)+r.fixed/r.bundleSize+r.perUserOp+r.perUserOpWord*i.length)})(await eK(e)),nL={STACKUP:"eth_maxPriorityFeePerGas",ALCHEMY:"rundler_maxPriorityFeePerGas",PIMLICO:"pimlico_getUserOperationGasPrice",GELATO:"eth_maxPriorityFeePerGas"},nU=async e=>{let[t,r]=await Promise.all([e.rpcClient.request({method:nL[e.bundlerProvider]??"eth_maxPriorityFeePerGas",params:[]}),e.rpcClient.getBlock({blockTag:"latest"})]);if("PIMLICO"===e.bundlerProvider&&(t=t.standard.maxPriorityFeePerGas),"bigint"!=typeof r.baseFeePerGas)throw new nN;let n=10**"1.2".split(".")[1].length,i=BigInt(t);return{maxFeePerGas:r.baseFeePerGas*BigInt(1.2*n)/BigInt(n)+i,maxPriorityFeePerGas:i}},nj=async e=>{let{block:t,gasPrice:r}=await eK({block:e.rpcClient.getBlock({blockTag:"latest"}),gasPrice:e.rpcClient.getGasPrice().catch(e=>(console.warn("Legacy: Failed to get gas price",e),null))}),n=null,i=null;if(t&&null!=t.baseFeePerGas){let s=BigInt("1500000000");(null==(i=r?r-t.baseFeePerGas:null)||i-BigInt(0)||i>s)&&(i=s),i=i<e.minPriorityFeePerBid?e.minPriorityFeePerBid:i,n=t.baseFeePerGas*BigInt(2)+(i??0)}return{maxFeePerGas:n,maxPriorityFeePerGas:i}};Error("Transaction failed gas checks");let nF=Error("Invalid operation"),nq=Error("Incorrect callData for token paymaster"),nH=Error("Account not connected");class nz{constructor(e){Object.defineProperty(this,"provider",{enumerable:!0,configurable:!0,writable:!0,value:e})}async signUserOp({userOp:e,callData:t,gasTokenAddress:r,erc20UserOp:n,erc20CallData:i,paymasterProvider:s,shouldOverrideFee:o=!1,shouldConsume:a=!0}){let l;let u=eJ(await eK(e));n&&(l=nO(await eK(n)));let c=await r1(this.provider.getProjectId());if(!c)throw Error("ChainId not found");let h=Object.fromEntries(Object.entries({projectId:this.provider.getProjectId(),chainId:c,userOp:u,entryPointAddress:e4,callData:t instanceof Promise?await t:t,gasTokenData:r&&l&&i?{tokenAddress:r,erc20UserOp:l,erc20CallData:i instanceof Promise?await i:i}:void 0,tokenAddress:r,erc20UserOp:l,erc20CallData:i instanceof Promise?await i:i,paymasterProvider:s,shouldOverrideFee:o,shouldConsume:a}).filter(([e,t])=>void 0!==t)),{data:d}=await r0.post(`${e6}/getPaymasterAndData`,{...h},{headers:{"Content-Type":"application/json"}});return d}}class n$ extends nz{constructor(e,t){super(e),Object.defineProperty(this,"paymasterConfig",{enumerable:!0,configurable:!0,writable:!0,value:t})}async getPaymasterAddress(e){let t=await r1(this.provider.getProjectId());try{let{data:r}=await r0.post(`${e6}/getPaymasterAddress`,{chainId:t,entryPointAddress:e4,paymasterProvider:e},{headers:{"Content-Type":"application/json"}});return r}catch(e){console.log(e);return}}async decodeMainCallFromCallData(e,t){let r="0x";if(t instanceof Promise){let e=await t;e instanceof Uint8Array?r=(0,ec.NC)(e):r=e}else t instanceof Uint8Array?r=(0,ec.NC)(t):r=t;try{let{functionName:e,args:t}=nS({abi:C,data:r});if("execute"===e){let e;let[r,n,i]=t;
58try{({functionName:e}=nS({abi:x,data:i}))}catch(e){}let s={target:r,value:n??0n,data:i};return"multiSend"===e&&(s={...s,target:e8,delegateCall:!0,data:i}),s}if("executeBatch"===e){let[e]=t;return e.map(e=>({target:e.to,value:e.value??0n,data:e.data}))}}catch(t){return{target:e instanceof Promise?await e:e,data:r,value:0n,delegateCall:!0}}}async getERC20UserOp(e,t,r,n){try{let i;let s={target:r,value:BigInt(0),data:(0,G.R)({abi:P,functionName:"approve",args:[n,te[r]]})};if(!this.provider.account)throw nH;i=t&&Array.isArray(t)?[s,...t]:[s,t];let o=await this.provider.account.encodeBatchExecute(i);return{...e,callData:o,callGasLimit:await this.provider.rpcClient.estimateGas({account:e4,to:await this.provider.getAddress(),data:o}),signature:await this.provider.getAccount().getValidator().getDynamicDummySignature(await e.sender,o)}}catch(e){return}}async getPaymasterResponse(e,t,r,n){var i;let s=await this.decodeMainCallFromCallData(e.sender,e.callData);if(!s)throw nq;let o=await r1(this.provider.getProjectId());if(!o)throw Error("ChainId not found");let a="TEST_ERC20"===(i=this.paymasterConfig.gasToken)?"0x3870419Ba2BBf0127060bCB37f69A1b1C090992B":e9[i][o]||void 0,l=await this.getPaymasterAddress(t);if(void 0!==a&&void 0!==l&&(0,r5.U)(l)){let i=await this.getERC20UserOp(e,s,a,l);if(!i)return;return await this.signUserOp({userOp:e,callData:e.callData,gasTokenAddress:a,erc20UserOp:i,erc20CallData:i.callData,paymasterProvider:t,shouldOverrideFee:r,shouldConsume:n})}}}class nV extends nz{constructor(e,t){super(e)}async getPaymasterResponse(e,t,r,n){let i=eJ(await eK(e));return await this.signUserOp({userOp:i,paymasterProvider:t,shouldOverrideFee:r,shouldConsume:n})}}let nW={VERIFYING_PAYMASTER:nV,TOKEN_PAYMASTER:n$},{Axios:nG,AxiosError:nK,CanceledError:nJ,isCancel:nY,CancelToken:nQ,VERSION:nZ,all:nX,Cancel:n0,isAxiosError:n1,spread:n2,toFormData:n3,AxiosHeaders:n5,HttpStatusCode:n6,formToJSON:n4,getAdapter:n8,mergeConfig:n7}=r0,n9=(e,t)=>(e.withPaymasterMiddleware(ie(e,t)),e),ie=(e,t)=>({dummyPaymasterDataMiddleware:async e=>(e.paymasterAndData="0xe93eca6595fe94091dc1af46aac2a8b5d79907700000000000000000000000000000000000000000000000000000000064ee5cd9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000fffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c",e),paymasterDataMiddleware:async r=>{let n;let i=BigInt("100000"),s=BigInt("1000000"),o=BigInt("55000"),a=new nW[t.policy](e,t);try{n=await a.getPaymasterResponse({...r,preVerificationGas:i,verificationGasLimit:s,callGasLimit:o},t.paymasterProvider,!1,e.shouldConsume())}catch(e){if(console.error(e),t.onlySendSponsoredTransaction){if(e instanceof nK)throw Error(e.response?.data.message);throw e}}if(t.onlySendSponsoredTransaction&&(!n||!n.paymasterAndData||"0x"===n.paymasterAndData))throw Error("Transaction is not sponsored");return n&&n.paymasterAndData&&"0x"!==n.paymasterAndData?{...r,...n}:{...r,paymasterAndData:"0x"}}});(p=w||(w={}))[p.Call=0]="Call",p[p.DelegateCall=1]="DelegateCall";class it extends e0{constructor({projectId:e,chain:t,entryPointAddress:r=e4,rpcUrl:n,bundlerRpcUrl:i=e5,account:s,bundlerProvider:o,opts:a}){let l="number"==typeof t?ng(t):t;super(nk({chain:l,rpcUrl:n,bundlerRpcUrl:i,projectId:e,bundlerProvider:o}),r,l,s,{...a,txMaxRetries:a?.txMaxRetries??20,txRetryIntervalMs:a?.txRetryIntervalMs??1e4,minPriorityFeePerBid:a?.minPriorityFeePerBid??tt.get(l.id)}),Object.defineProperty(this,"projectId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sendTxMaxRetries",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sendTxRetryIntervalMs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"bundlerProvider",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_txMaxRetries",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_txRetryIntervalMs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_shouldConsume",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"feeOptions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"getProjectId",{enumerable:!0,configurable:!0,writable:!0,value:()=>this.projectId}),Object.defineProperty(this,"shouldConsume",{enumerable:!0,configurable:!0,writable:!0,value:()=>this._shouldConsume}),Object.defineProperty(this,"sendTransaction",{enumerable:!0,configurable:!0,writable:!0,value:async(e,t=w.Call)=>{if(!e.to)throw Error("transaction is missing to address");let r={};e.maxFeePerGas&&(r.maxFeePerGas=e.maxFeePerGas),e.maxPriorityFeePerGas&&(r.maxPriorityFeePerGas=e.maxPriorityFeePerGas);let{hash:n}=await this.sendUserOperation({target:e.to,data:e.data??"0x",value:e.value?(0,e$.H_)(e.value,"bigint"):0n},r,t);return await this.waitForUserOperationTransaction(n)}}),Object.defineProperty(this,"buildUserOperation",{enumerable:!0,configurable:!0,writable:!0,value:async(e,t,r=w.Call)=>{if(this._shouldConsume=!1,!nC(this.account))throw Error("account not connected!");if(!this.account.validator)throw Error("validator not connected!");let n="0x";if(Array.isArray(e)){if(r===w.Call)n=await this.account.encodeBatchExecute(e);else throw nF}else if(nC(this.account)){if(r===w.DelegateCall)n=await this.account.encodeExecuteDelegate(e.target,e.value??0n,e.data);else if(r===w.Call)n=await this.account.encodeExecute(e.target,e.value??0n,e.data);else throw nF}else throw nF;let i=await this.account.getInitCode(),s=await this.account.getNonce(),o=await this._runMiddlewareStack({initCode:i,sender:this.getAddress(),nonce:s,callData:n,signature:await this.account.getValidator().getDynamicDummySignature(await this.getAddress(),n)},t);return this._shouldConsume=!0,o}}),Object.defineProperty(this,"_runMiddlewareStack",{enumerable:!0,configurable:!0,writable:!0,value:async(e,t)=>{let r=await eG(this.dummyPaymasterDataMiddleware,this.feeDataGetter,this.paymasterDataMiddleware,this.gasEstimator,this.customMiddleware??eZ,async e=>({...e,...t}))(e);return eJ(await eK(r))}}),Object.defineProperty(this,"sendUserOperation",{enumerable:!0,configurable:!0,writable:!0,value:async(e,t,r=w.Call)=>{let n,i,s,o;if(!this._shouldConsume)throw Error("Cannot send user operation while building user operation");if(!nC(this.account))throw Error("account not connected!");if(!this.account.validator)throw Error("validator not connected!");let a="0x";if(Array.isArray(e)){if(r===w.Call)a=await this.account.encodeBatchExecute(e);else throw nF}else if(nC(this.account)){if(r===w.DelegateCall)a=await this.account.encodeExecuteDelegate(e.target,e.value??0n,e.data);else if(r===w.Call)a=await this.account.encodeExecute(e.target,e.value??0n,e.data);else throw nF}else throw nF;let l=await this.account.getInitCode(),u="",c=0,h=await this.account.getNonce();do{var d;if(n=await eG(this.dummyPaymasterDataMiddleware,this.feeDataGetter,this.paymasterDataMiddleware,this.gasEstimator,this.customMiddleware??eZ,async e=>({...e,...t}))({initCode:l,sender:this.getAddress(),nonce:h,callData:a,signature:await this.account.getValidator().getDynamicDummySignature(await this.getAddress(),a),maxFeePerGas:s,maxPriorityFeePerGas:o}),!((d=i=eJ(await eK(n))).callGasLimit&&d.maxFeePerGas&&null!=d.maxPriorityFeePerGas&&d.preVerificationGas&&d.verificationGasLimit))throw Error(`Request is missing parameters. All properties on UserOperationStruct must be set. uo: ${JSON.stringify(i,null,2)}`);await this.account.approvePlugin(),i.signature=await this.account.validator.getSignature(i);try{u=await this.rpcClient.sendUserOperation(i,this.entryPointAddress)}catch(e){if(this.isReplacementOpError(e)&&c++<this.sendTxMaxRetries){s=113n*BigInt(i.maxFeePerGas)/100n,o=113n*BigInt(i.maxPriorityFeePerGas)/100n,console.log(`After ${this.sendTxRetryIntervalMs/6e4} minutes, resending tx with Increased Gas fees: maxFeePerGas: ${s}, maxPriorityFeePerGas: ${o}`),await new Promise(e=>setTimeout(e,this.sendTxRetryIntervalMs));continue}throw this.unwrapError(e)}}while(""===u);return{hash:u,request:i}}}),Object.defineProperty(this,"waitForUserOperationTransaction",{enumerable:!0,configurable:!0,writable:!0,value:async e=>{let t=await this.rpcClient.getBlockNumber();for(let r=0;r<this._txMaxRetries;r++){if("GELATO"===this.bundlerProvider){let t=await this.getUserOperationReceipt(e).catch(()=>null);if(t)return this.getTransaction(t.receipt.transactionHash).then(e=>e.hash)}else{let r=await this.rpcClient.getLogs({address:e4,event:(0,nA.mE)({abi:O,name:"UserOperationEvent"}),args:{userOpHash:e},fromBlock:t-100n});if(r.length)return r[0].transactionHash}await new Promise(e=>setTimeout(e,this._txRetryIntervalMs))}throw Error("Failed to find transaction for User Operation")}}),Object.defineProperty(this,"getAccount",{enumerable:!0,configurable:!0,writable:!0,value:()=>{if(!nC(this.account))throw Error("account not connected!");return this.account}}),Object.defineProperty(this,"dummyPaymasterDataMiddleware",{enumerable:!0,configurable:!0,writable:!0,value:async e=>(e.paymasterAndData="0x",e)}),Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:async e=>{let{method:t,params:r}=e;switch(t){case"eth_chainId":return this.chain.id;case"eth_sendTransaction":let[n]=r;return this.sendTransaction(n);case"eth_signTypedData_v4":return this.signTypedData(JSON.parse(r[1]));case"personal_sign":if(!this.account)throw Error("account not connected!");let[i,s]=r;if(s.toLowerCase()!==(await this.getAddress()).toLowerCase())throw Error("cannot sign for address that is not the current account");return this.account.signMessageWith6492(i);default:return this.rpcClient.request(e)}}}),this.feeOptions={maxFeePerGasBufferPercentage:a?.feeOptions?.maxFeePerGasBufferPercentage??0,maxPriorityFeePerGasBufferPercentage:a?.feeOptions?.maxPriorityFeePerGasBufferPercentage??13},this._txMaxRetries=a?.txMaxRetries??20,this._txRetryIntervalMs=a?.txRetryIntervalMs??5e3,this.bundlerProvider=o,this.projectId=e,this.sendTxMaxRetries=a?.sendTxMaxRetries??3,this.sendTxRetryIntervalMs=a?.sendTxRetryIntervalMs??6e4,nD(this)}isReplacementOpError(e){if(null!=e.cause){let t=e?.cause?.message;return(t?.includes("replacement op must increase maxFeePerGas and MaxPriorityFeePerGas")||t?.match(/.*replacement.*underpriced.*/)!==null)??!1}return!1}unwrapError(e){if(e?.cause!=null){let t="",r=e?.cause?.message;if(r?.includes("FailedOp")===!0){let e=r.match(/FailedOp\((.*)\)/);if(null!=e){let n=e[1].split(",");t=`(paymaster address: ${n[1]})`,r=n[2]}}let n=Error(`The bundler has failed to include UserOperation in a batch: ${r} ${t}`);return n.stack=e.stack,n}return e}withZeroDevPaymasterAndData(e){if(!this.isConnected())throw Error("ZeroDevProvider: account is not set, did 
58you call `connect` first?");return n9(this,e)}}BigInt.prototype.toJSON=function(){return this.toString()},(g=_||(_={}))[g.EQUAL=0]="EQUAL",g[g.GREATER_THAN=1]="GREATER_THAN",g[g.LESS_THAN=2]="LESS_THAN",g[g.GREATER_THAN_OR_EQUAL=3]="GREATER_THAN_OR_EQUAL",g[g.LESS_THAN_OR_EQUAL=4]="LESS_THAN_OR_EQUAL",g[g.NOT_EQUAL=5]="NOT_EQUAL";class ir extends it{constructor(e,t){let r=e.bundlerProvider,n=(void 0===e.usePaymaster||e.usePaymaster)&&"GELATO"!==r;if(e.opts?.paymasterConfig&&e.opts?.paymasterConfig.policy==="TOKEN_PAYMASTER"&&n&&(r="STACKUP"),super({...e.opts?.providerConfig,chain:e.opts?.providerConfig?.chain??ti.v,rpcUrl:e.opts?.providerConfig?.rpcUrl,projectId:e.projectId,bundlerProvider:r}),Object.defineProperty(this,"defaultProvider",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"getValidator",{enumerable:!0,configurable:!0,writable:!0,value:()=>{if(!nC(this.account)||!this.account.validator)throw Error("ValidatorProvider: account with validator is not set, did you call all connects first?");return this.account.getValidator()}}),Object.defineProperty(this,"getEncodedEnableData",{enumerable:!0,configurable:!0,writable:!0,value:async e=>{if(!nC(this.account)||!this.account.validator)throw Error("ValidatorProvider: account with validator is not set, did 
58you call all connects first?");return await this.account.validator.encodeEnable(e)}}),Object.defineProperty(this,"getEncodedDisableData",{enumerable:!0,configurable:!0,writable:!0,value:async(e="0x")=>{if(!nC(this.account)||!this.account.validator)throw Error("ValidatorProvider: account with validator is not set, did you call all connects first?");return await this.account.validator.encodeDisable(e)}}),Object.defineProperty(this,"sendEnableUserOperation",{enumerable:!0,configurable:!0,writable:!0,value:async e=>{let t=await this.getEncodedEnableData(e);if(!nC(this.account)||!this.account.validator)throw Error("ValidatorProvider: account with validator is not set, did you call all connects first?");return await this.sendUserOperation({target:this.account.validator.validatorAddress,data:t})}}),Object.defineProperty(this,"sendDisableUserOperation",{enumerable:!0,configurable:!0,writable:!0,value:async(e="0x")=>{let t=await this.getEncodedDisableData(e);if(!nC(this.account)||!this.account.validator)throw Error("ValidatorProvider: account with validator is not set, did 
58you call all connects first?");if(!this.defaultProvider)throw Error("Default Validator provider unintialized");return await this.defaultProvider.sendUserOperation({target:this.account.validator.validatorAddress,data:t})}}),this.defaultProvider=e.defaultProvider,"number"==typeof e.opts?.providerConfig?.chain&&"number"==typeof e.defaultProvider?.chain&&e.opts?.providerConfig?.chain!==e.defaultProvider?.chain||"object"==typeof e.opts?.providerConfig?.chain&&"object"==typeof e.defaultProvider?.chain&&e.opts?.providerConfig?.chain.id!==e.defaultProvider?.chain.id)throw Error("chainId mismatch between default provider and current provider - check projectIds");if(this.connect(()=>new nI({projectId:e.projectId,validator:t,defaultValidator:e.defaultProvider?.getValidator(),rpcClient:this.rpcClient,bundlerProvider:r,index:e.defaultProvider?.getAccount().getIndex(),...e.opts?.accountConfig})),n){let t=e.opts?.paymasterConfig??{policy:"VERIFYING_PAYMASTER"};n9(this,t={...t,paymasterProvider:e.opts?.paymasterConfig?.paymasterProvider??r})}}}class ii extends ir{constructor(e){let t="number"==typeof e.opts?.providerConfig?.chain?ng(e.opts.providerConfig.chain):e.opts?.providerConfig?.chain??ti.v;super({...e,opts:{...e.opts,providerConfig:{...e.opts?.providerConfig,chain:t}}},new ny({projectId:e.projectId,owner:e.owner,chain:t,rpcUrl:e.opts?.providerConfig?.rpcUrl,...e.opts?.validatorConfig})),Object.defineProperty(this,"changeOwner",{enumerable:!0,configurable:!0,writable:!0,value:this.sendEnableUserOperation}),Object.defineProperty(this,"deleteOwner",{enumerable:!0,configurable:!0,writable:!0,value:this.sendDisableUserOperation})}static async init(e){let t=await r1(e.projectId);if(!t)throw Error("ChainId not found");let r=ng(t);return new ii({...e,opts:{...e.opts,providerConfig:{chain:r,...e.opts?.providerConfig}}})}}r(37637),r(9784),r(6352),r(92030);var is=r(85053),io=r(34952),ia=r(78910),il=r(52251),iu=r(56110);let ic=new iu.Y("Ethereum AA",iu.i.INFO);class ih extends io.VY{get key(){return"zerodev"}constructor(e){var t;super(e),this.connectedChain="EVM",this.supportedChains=["ETH","EVM"],this.isGasSponsorshipDisabled=!1,this.isEmbeddedWallet=!0,this.name="ZeroDev";let r=null===(t=e.apiProviders.zerodev)||void 0===t?void 0:t.clientId;if(!r)throw Error("Missing ZeroDev project ID provided. Add your ZeroDev project id to your project configuration via the Dynamic Labs dashboard.");this.projectId=r,this._walletUiUtils=e.walletUiUtils,this.evmNetworks=(0,il.fu)(e.evmNetworks)}getEOAConnector(){return this.eoaConnector}getAccountAbstractionProvider(){return this.zeroDevProvider}setEoaConnector(e){return A(this,void 0,void 0,function*(){this.zeroDevProviderDeferredPromise=new il.CR,this.eoaConnector=e;let t=yield this.eoaConnector.getSigner();if(!t)return;let r=yield ii.init({bundlerProvider:"STACKUP",owner:nf(t),projectId:this.projectId});(0,il.DP)(r,"sendUserOperation",(e,...t)=>(this._walletUiUtils.disabledConfirmationOnce(),e(...t))),this.zeroDevProvider=r,yield this.checkIsProjectChainEnabled(),this.zeroDevProviderDeferredPromise.resolve()})}checkIsProjectChainEnabled(){return A(this,void 0,void 0,function*(){var e,t;let r=yield this.getPublicClient(),n=null===(e=null==r?void 0:r.chain)||void 0===e?void 0:e.name,i=null===(t=null==r?void 0:r.chain)||void 0===t?void 0:t.id;this.evmNetworks.some(e=>e.chainId===i)||ic.error(`Please make sure to enable ${n} (${i}) in the Dynamic dashboard (https://app.dynamic.xyz/dashboard/configurations#evm).`)})}getProviderWithSponsorshipValidation(){return A(this,void 0,void 0,function*(){if(this.providerWithSponsorship)return this.providerWithSponsorship;let{eoaConnector:e}=this;if(!e)throw new il.kW("No EOA connector");let t=yield e.getSigner();return this.providerWithSponsorship=yield ii.init({bundlerProvider:"STACKUP",opts:{paymasterConfig:{onlySendSponsoredTransaction:!0,policy:"VERIFYING_PAYMASTER"}},owner:nf(t),projectId:this.projectId}),(0,il.DP)(this.providerWithSponsorship,"sendUserOperation",(e,...t)=>(this._walletUiUtils.disabledConfirmationOnce(),e(...t))),this.providerWithSponsorship})}fetchPublicAddress(){return A(this,void 0,void 0,function*(){var e,t;return yield null===(e=this.zeroDevProviderDeferredPromise)||void 0===e?void 0:e.promise,null===(t=this.zeroDevProvider)||void 0===t?void 0:t.getAddress()})}getConnectedAccounts(){return A(this,void 0,void 0,function*(){var e;return yield null===(e=this.zeroDevProviderDeferredPromise)||void 0===e?void 0:e.promise,this.zeroDevProvider?[(yield this.zeroDevProvider.getAddress())]:[]})}getNetwork(){return A(this,void 0,void 0,function*(){var e,t;return yield null===(e=this.zeroDevProviderDeferredPromise)||void 0===e?void 0:e.promise,null===(t=this.zeroDevProvider)||void 0===t?void 0:t.rpcClient.chain.id})}getTransport(e){return(0,ia.sE)({getAccounts:()=>A(this,void 0,void 0,function*(){let t=yield e.getAddress();return t?[t]:[]}),onPersonalSign:t=>A(this,[t],void 0,function*({message:t}){return this._walletUiUtils.disabledConfirmationOnce(),e.signMessage(t)}),onSendTransaction:t=>A(this,[t],void 0,function*({transaction:t}){try{this._walletUiUtils.disabledConfirmationOnce();let r=this.isGasSponsorshipDisabled?e:yield this.getProviderWithSponsorshipValidation();return yield r.sendTransaction((0,ia.eD)(t))}catch(e){if(ic.debug(e),il.k4.isErrorMessage(e))throw new il.k4;if(il.C_.isErrorMessage(e))throw new il.C_;throw e}}),onSignTypedData:t=>A(this,[t],void 0,function*({message:t}){this._walletUiUtils.disabledConfirmationOnce();let r=JSON.parse(t);return e.signTypedData(r)}
58),provider:e.rpcClient,transport:(0,nb.P)(e),walletUiUtils:this._walletUiUtils})}getWalletClient(e){let t=this.zeroDevProvider;if(!t)throw new il.kW("No provider");let r=this.getTransport(t);return(0,nv.K)({chain:e?ia.zk[e]:void 0,transport:r})}getPublicClient(){return A(this,void 0,void 0,function*(){let e=this.zeroDevProvider;if(!e)throw new il.kW("No provider");return e.rpcClient})}getSigner(){return A(this,void 0,void 0,function*(){let e=this.zeroDevProvider;if(!e)throw new il.kW("No provider");let t=this.getTransport(e),r=yield e.getAddress();return(0,nv.K)({account:r,transport:t})})}canSponsorTransactionGas(e){return A(this,void 0,void 0,function*(){var t;try{let r={data:e.data?e.data:"0x",target:e.to,value:(0,Y.v)(e.value)?(0,e$.H_)(e.value,"bigint"):e.value},n=yield null===(t=this.zeroDevProvider)||void 0===t?void 0:t.buildUserOperation(r);if(!n)return!1;return"0x"!==n.paymasterAndData}catch(e){return ic.debug(e),!1}})}disableGasSponsorshipOnce(){this.isGasSponsorshipDisabled=!0}getBalance(){return A(this,void 0,void 0,function*(){var e;let t=yield null===(e=this.zeroDevProvider)||void 0===e?void 0:e.rpcClient;if(!t)throw new il.kW("No RPC client");let r=yield this.fetchPublicAddress();if(r)return(0,is.d)((yield t.getBalance({address:r})))})}signMessage(e){return A(this,void 0,void 0,function*(){let t=yield this.getSigner(),r=yield this.fetchPublicAddress();if(r&&t)return t.signMessage({account:r,message:e})})}}class id{}let ip=e=>(null==e?void 0:e.key)==="zerodev",ig=e=>{var t;return(null===(t=e.apiProviders)||void 0===t?void 0:t.zerodev)?[ih]:[]}},99151:function(e,t,r){"use strict";let n,i,s,o;r.d(t,{T7:function(){return eX},wV:function(){return e1},Eh:function(){return uu},Lq:function(){return l0},Rp:function(){return ur},Tq:function(){return lX},Ye:function(){return l6},ON:function(){return l3}});var a,l,u,c,h={};r.r(h),r.d(h,{identity:function(){return tm}});var d={};r.r(d),r.d(d,{base2:function(){return tv}});var f={};r.r(f),r.d(f,{base8:function(){return tb}});var p={};r.r(p),r.d(p,{base10:function(){return tw}});var g={};r.r(g),r.d(g,{base16:function(){return t_},base16upper:function(){return tE}});var y={};r.r(y),r.d(y,{base32:function(){return tS},base32hex:function(){return tI},base32hexpad:function(){return tP},base32hexpadupper:function(){return tO},base32hexupper:function(){return tx},base32pad:function(){return tk},base32padupper:function(){return tC},base32upper:function(){return tA},base32z:function(){return tT}});var m={};r.r(m),r.d(m,{base36:function(){return tR},base36upper:function(){return tN}});var v={};r.r(v),r.d(v,{base58btc:function(){return tD},base58flickr:function(){return tB}});var b={};r.r(b),r.d(b,{base64:function(){return tM},base64pad:function(){return tL},base64url:function(){return tU},base64urlpad:function(){return tj}});var w={};r.r(w),r.d(w,{base256emoji:function(){return tz}});var _={};r.r(_),r.d(_,{sha256:function(){return t2},sha512:function(){return t3}});var E={};r.r(E),r.d(E,{identity:function(){return t5}});var S={};r.r(S),r.d(S,{code:function(){return t4},decode:function(){return t7},encode:function(){return t8},name:function(){return t6}});var A={};r.r(A),r.d(A,{code:function(){return rr},decode:function(){return ri},encode:function(){return rn},name:function(){return rt}});var k=r(9109);function C(e,t,r,n){return new(r||(r=Promise))(function(i,s){function o(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})}"undefined"!=typeof window&&(window.global=globalThis,Object.assign(window,{Buffer:k.Buffer})),"function"==typeof SuppressedError&&SuppressedError;var I=r(60152),x=r(48786),P=r(85053),O=r(64113),T=r(28242),R=r(51463),N=r(51930),D=r(24416),B=r(99142),M=r(20357);"undefined"!=typeof window&&void 0!==window.document&&"undefined"!=typeof crypto&&crypto.subtle,void 0!==M&&null!=M.versions&&M.versions.node;var L=r(55151),U=r.n(L);let j=L.fetch;function F(e){let t=new Uint8Array(e),r="";for(let e of t)r+=String.fromCharCode(e);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}let q="copy",H="convert";function z(e,t){return{required:!0,schema:e,derive:t}}function $(e){return{required:!0,schema:e}}function V(e){return{required:!1,schema:e}}let W={appid:V(q),appidExclude:V(q),credProps:V(q)},G={type:$(q),id:$(q),rawId:$(H),authenticatorAttachment:V(q),response:$({clientDataJSON:$(H),attestationObject:$(H),transports:z(q,e=>e.getTransports?.()||[])}),clientExtensionResults:z(W,e=>e.getClientExtensionResults())};async function K(e){let t=await navigator.credentials.create(e);return t.toJSON=()=>(function e(t,r,n){if(r===q)return n;if(r===H)return t(n);if(r instanceof Array)return n.map(n=>
58e(t,r[0],n));if(r instanceof Object){let i={};for(let[s,o]of Object.entries(r)){if(o.derive){let e=o.derive(n);void 0!==e&&(n[s]=e)}if(!(s in n)){if(o.required)throw Error(`Missing key: ${s}`);continue}if(null==n[s]){i[s]=null;continue}i[s]=e(t,o.schema,n[s])}return i}})(F,G,t),t}function J(e){switch(e){case"internal":return"AUTHENTICATOR_TRANSPORT_INTERNAL";case"usb":return"AUTHENTICATOR_TRANSPORT_USB";case"nfc":return"AUTHENTICATOR_TRANSPORT_NFC";case"ble":return"AUTHENTICATOR_TRANSPORT_BLE";case"hybrid":return"AUTHENTICATOR_TRANSPORT_HYBRID";default:throw Error("unsupported transport format")}}async function Y(e){var t;if(!window.PublicKeyCredential)throw Error("webauthn is not supported by this browser");return{credentialId:(t=(await K(e)).toJSON()).rawId,attestationObject:t.response.attestationObject,clientDataJson:t.response.clientDataJSON,transports:t.response.transports.map(J)}}$(q),$(q),$(H),V(q),$({clientDataJSON:$(H),authenticatorData:$(H),signature:$(H),userHandle:$(H)}),z(W,e=>e.getClientExtensionResults()),r(9109).Buffer;class Q extends Error{constructor(e){let t=`Turnkey error ${e.code}: ${e.message}`;null!=e.details&&(t+=` (Details: ${JSON.stringify(e.details)})`),super(t),this.name="TurnkeyRequestError",this.details=e.details??null,this.code=e.code}}class Z{constructor(e,t){if(this.getActivity=async e=>this.request("/public/v1/query/get_activity",e),this.stampGetActivity=async e=>{let t=this.config.baseUrl+"/public/v1/query/get_activity",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.getApiKey=async e=>this.request("/public/v1/query/get_api_key",e),this.stampGetApiKey=async e=>{let t=this.config.baseUrl+"/public/v1/query/get_api_key",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.getApiKeys=async e=>this.request("/public/v1/query/get_api_keys",e),this.stampGetApiKeys=async e=>{let t=this.config.baseUrl+"/public/v1/query/get_api_keys",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.getAuthenticator=async e=>this.request("/public/v1/query/get_authenticator",e),this.stampGetAuthenticator=async e=>{let t=this.config.baseUrl+"/public/v1/query/get_authenticator",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.getAuthenticators=async e=>this.request("/public/v1/query/get_authenticators",e),this.stampGetAuthenticators=async e=>{let t=this.config.baseUrl+"/public/v1/query/get_authenticators",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.getOrganization=async e=>this.request("/public/v1/query/get_organization",e),this.stampGetOrganization=async e=>{let t=this.config.baseUrl+"/public/v1/query/get_organization",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.getPolicy=async e=>this.request("/public/v1/query/get_policy",e),this.stampGetPolicy=async e=>{let t=this.config.baseUrl+"/public/v1/query/get_policy",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.getPrivateKey=async e=>this.request("/public/v1/query/get_private_key",e),this.stampGetPrivateKey=async e=>{let t=this.config.baseUrl+"/public/v1/query/get_private_key",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.getUser=async e=>this.request("/public/v1/query/get_user",e),this.stampGetUser=async e=>{let t=this.config.baseUrl+"/public/v1/query/get_user",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.getWallet=async e=>this.request("/public/v1/query/get_wallet",e),this.stampGetWallet=async e=>{let t=this.config.baseUrl+"/public/v1/query/get_wallet",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.getActivities=async e=>this.request("/public/v1/query/list_activities",e),this.stampGetActivities=async e=>{let t=this.config.baseUrl+"/public/v1/query/list_activities",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.getPolicies=async e=>this.request("/public/v1/query/list_policies",e),this.stampGetPolicies=async e=>{let t=this.config.baseUrl+"/public/v1/query/list_policies",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.listPrivateKeyTags=async e=>this.request("/public/v1/query/list_private_key_tags",e),this.stampListPrivateKeyTags=async e=>{let t=this.config.baseUrl+"/public/v1/query/list_private_key_tags",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.getPrivateKeys=async e=>this.request("/public/v1/query/list_private_keys",e),this.stampGetPrivateKeys=async e=>{let t=this.config.baseUrl+"/public/v1/query/list_private_keys",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}}
58,this.getSubOrgIds=async e=>this.request("/public/v1/query/list_suborgs",e),this.stampGetSubOrgIds=async e=>{let t=this.config.baseUrl+"/public/v1/query/list_suborgs",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.listUserTags=async e=>this.request("/public/v1/query/list_user_tags",e),this.stampListUserTags=async e=>{let t=this.config.baseUrl+"/public/v1/query/list_user_tags",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.getUsers=async e=>this.request("/public/v1/query/list_users",e),this.stampGetUsers=async e=>{let t=this.config.baseUrl+"/public/v1/query/list_users",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.getWalletAccounts=async e=>this.request("/public/v1/query/list_wallet_accounts",e),this.stampGetWalletAccounts=async e=>{let t=this.config.baseUrl+"/public/v1/query/list_wallet_accounts",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.getWallets=async e=>this.request("/public/v1/query/list_wallets",e),this.stampGetWallets=async e=>{let t=this.config.baseUrl+"/public/v1/query/list_wallets",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.getWhoami=async e=>this.request("/public/v1/query/whoami",e),this.stampGetWhoami=async e=>{let t=this.config.baseUrl+"/public/v1/query/whoami",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.approveActivity=async e=>this.request("/public/v1/submit/approve_activity",e),this.stampApproveActivity=async e=>{let t=this.config.baseUrl+"/public/v1/submit/approve_activity",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.createApiKeys=async e=>this.request("/public/v1/submit/create_api_keys",e),this.stampCreateApiKeys=async e=>{let t=this.config.baseUrl+"/public/v1/submit/create_api_keys",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.createApiOnlyUsers=async e=>this.request("/public/v1/submit/create_api_only_users",e),this.stampCreateApiOnlyUsers=async e=>{let t=this.config.baseUrl+"/public/v1/submit/create_api_only_users",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.createAuthenticators=async e=>this.request("/public/v1/submit/create_authenticators",e),this.stampCreateAuthenticators=async e=>{let t=this.config.baseUrl+"/public/v1/submit/create_authenticators",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.createInvitations=async e=>this.request("/public/v1/submit/create_invitations",e),this.stampCreateInvitations=async e=>{let t=this.config.baseUrl+"/public/v1/submit/create_invitations",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.createPolicies=async e=>this.request("/public/v1/submit/create_policies",e),this.stampCreatePolicies=async e=>{let t=this.config.baseUrl+"/public/v1/submit/create_policies",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.createPolicy=async e=>this.request("/public/v1/submit/create_policy",e),this.stampCreatePolicy=async e=>{let t=this.config.baseUrl+"/public/v1/submit/create_policy",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.createPrivateKeyTag=async e=>this.request("/public/v1/submit/create_private_key_tag",e),this.stampCreatePrivateKeyTag=async e=>{let t=this.config.baseUrl+"/public/v1/submit/create_private_key_tag",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.createPrivateKeys=async e=>this.request("/public/v1/submit/create_private_keys",e),this.stampCreatePrivateKeys=async e=>{let t=this.config.baseUrl+"/public/v1/submit/create_private_keys",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.createSubOrganization=async e=>this.request("/public/v1/submit/create_sub_organization",e),this.stampCreateSubOrganization=async e=>{let t=this.config.baseUrl+"/public/v1/submit/create_sub_organization",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.createUserTag=async e=>this.request("/public/v1/submit/create_user_tag",e),this.stampCreateUserTag=async e=>{let t=this.config.baseUrl+"/public/v1/submit/create_user_tag",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.createUsers=async e=>this.request("/public/v1/submit/create_users",e),this.stampCreateUsers=async e=>{let t=this.config.baseUrl+"/public/v1/submit/create_users",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}}
58,this.createWallet=async e=>this.request("/public/v1/submit/create_wallet",e),this.stampCreateWallet=async e=>{let t=this.config.baseUrl+"/public/v1/submit/create_wallet",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.createWalletAccounts=async e=>this.request("/public/v1/submit/create_wallet_accounts",e),this.stampCreateWalletAccounts=async e=>{let t=this.config.baseUrl+"/public/v1/submit/create_wallet_accounts",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.deleteApiKeys=async e=>this.request("/public/v1/submit/delete_api_keys",e),this.stampDeleteApiKeys=async e=>{let t=this.config.baseUrl+"/public/v1/submit/delete_api_keys",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.deleteAuthenticators=async e=>this.request("/public/v1/submit/delete_authenticators",e),this.stampDeleteAuthenticators=async e=>{let t=this.config.baseUrl+"/public/v1/submit/delete_authenticators",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.deleteInvitation=async e=>this.request("/public/v1/submit/delete_invitation",e),this.stampDeleteInvitation=async e=>{let t=this.config.baseUrl+"/public/v1/submit/delete_invitation",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.deletePolicy=async e=>this.request("/public/v1/submit/delete_policy",e),this.stampDeletePolicy=async e=>{let t=this.config.baseUrl+"/public/v1/submit/delete_policy",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.deletePrivateKeyTags=async e=>this.request("/public/v1/submit/delete_private_key_tags",e),this.stampDeletePrivateKeyTags=async e=>{let t=this.config.baseUrl+"/public/v1/submit/delete_private_key_tags",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.deleteUserTags=async e=>this.request("/public/v1/submit/delete_user_tags",e),this.stampDeleteUserTags=async e=>{let t=this.config.baseUrl+"/public/v1/submit/delete_user_tags",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.deleteUsers=async e=>this.request("/public/v1/submit/delete_users",e),this.stampDeleteUsers=async e=>{let t=this.config.baseUrl+"/public/v1/submit/delete_users",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.emailAuth=async e=>this.request("/public/v1/submit/email_auth",e),this.stampEmailAuth=async e=>{let t=this.config.baseUrl+"/public/v1/submit/email_auth",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.exportPrivateKey=async e=>this.request("/public/v1/submit/export_private_key",e),this.stampExportPrivateKey=async e=>{let t=this.config.baseUrl+"/public/v1/submit/export_private_key",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.exportWallet=async e=>this.request("/public/v1/submit/export_wallet",e),this.stampExportWallet=async e=>{let t=this.config.baseUrl+"/public/v1/submit/export_wallet",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.exportWalletAccount=async e=>this.request("/public/v1/submit/export_wallet_account",e),this.stampExportWalletAccount=async e=>{let t=this.config.baseUrl+"/public/v1/submit/export_wallet_account",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.importPrivateKey=async e=>this.request("/public/v1/submit/import_private_key",e),this.stampImportPrivateKey=async e=>{let t=this.config.baseUrl+"/public/v1/submit/import_private_key",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.importWallet=async e=>this.request("/public/v1/submit/import_wallet",e),this.stampImportWallet=async e=>{let t=this.config.baseUrl+"/public/v1/submit/import_wallet",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.initImportPrivateKey=async e=>this.request("/public/v1/submit/init_import_private_key",e),this.stampInitImportPrivateKey=async e=>{let t=this.config.baseUrl+"/public/v1/submit/init_import_private_key",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.initImportWallet=async e=>this.request("/public/v1/submit/init_import_wallet",e),this.stampInitImportWallet=async e=>{let t=this.config.baseUrl+"/public/v1/submit/init_import_wallet",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.initUserEmailRecovery=async e=>this.request("/public/v1/submit/init_user_email_recovery",e),this.stampInitUserEmailRecovery=async e=>{let t=this.config.baseUrl+"/public/v1/submit/init_user_email_recovery",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.recoverUser=async e=>this.request("/public/v1/submit/recover_user",e),this.stampRecoverUser=async e=>{let t=this.config.baseUrl+"/public/v1/submit/recover_user",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.rejectActivity=async e=>this.request("/public/v1/submit/reject_activity",e),this.stampRejectActivity=async e=>{let t=this.config.baseUrl+"/public/v1/submit/reject_activity",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.removeOrganizationFeature=async e=>this.request("/public/v1/submit/remove_organization_feature",e),this.stampRemoveOrganizationFeature=async e=>{let t=this.config.baseUrl+"/public/v1/submit/remove_organization_feature",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.setOrganizationFeature=async e=>this.request("/public/v1/submit/set_organization_feature",e),this.stampSetOrganizationFeature=async e=>{let t=this.config.baseUrl+"/public/v1/submit/set_organization_feature",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.signRawPayload=async e=>this.request("/public/v1/submit/sign_raw_payload",e),this.stampSignRawPayload=async e=>{let t=this.config.baseUrl+"/public/v1/submit/sign_raw_payload",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.signRawPayloads=async e=>this.request("/public/v1/submit/sign_raw_payloads",e),this.stampSignRawPayloads=async e=>{let t=this.config.baseUrl+"/public/v1/submit/sign_raw_payloads",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.signTransaction=async e=>this.request("/public/v1/submit/sign_transaction",e),this.stampSignTransaction=async e=>{let t=this.config.baseUrl+"/public/v1/submit/sign_transaction",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.updatePolicy=async e=>this.request("/public/v1/submit/update_policy",e),this.stampUpdatePolicy=async e=>{let t=this.config.baseUrl+"/public/v1/submit/update_policy",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.updatePrivateKeyTag=async e=>this.request("/public/v1/submit/update_private_key_tag",e),this.stampUpdatePrivateKeyTag=async e=>{let t=this.config.baseUrl+"/public/v1/submit/update_private_key_tag",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.updateRootQuorum=async e=>this.request("/public/v1/submit/update_root_quorum",e),this.stampUpdateRootQuorum=async e=>{let t=this.config.baseUrl+"/public/v1/submit/update_root_quorum",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.updateUser=async e=>this.request("/public/v1/submit/update_user",e),this.stampUpdateUser=async e=>{let t=this.config.baseUrl+"/public/v1/submit/update_user",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},this.updateUserTag=async e=>this.request("/public/v1/submit/update_user_tag",e),this.stampUpdateUserTag=async e=>{let t=this.config.baseUrl+"/public/v1/submit/update_user_tag",r=JSON.stringify(e),n=await this.stamper.stamp(r);return{body:r,stamp:n,url:t}},!e.baseUrl)throw Error("Missing base URL. Please verify env vars.");this.config=e,this.stamper=t}async request(e,t){let r=this.config.baseUrl+e,n=JSON.stringify(t),i=await this.stamper.stamp(n),s=await j(r,{method:"POST",headers:{[i.stampHeaderName]:i.stampHeaderValue,"X-Client-Version":"@turnkey/[email protected]"},body:n,redirect:"follow"});if(!s.ok){let e;try{e=await s.json()}catch(e){throw Error(`${s.status} ${s.statusText}`)}throw new Q(e)}return await s.json()}}
58class X extends Error{constructor(e){let{message:t,cause:r,activityId:n,activityStatus:i,activityType:s}=e;super(t),this.name="TurnkeyActivityError",this.activityId=n??null,this.activityStatus=i??null,this.activityType=s??null,this.cause=r??null}}async function ee(e){let{client:t,organizationId:r,signWith:n}=e,{ethereumAddress:i}=e;if(!n)throw new X({message:"Missing signWith parameter"});if((0,O.U)(n))i=n;else if(!i){let e=await t.getPrivateKey({privateKeyId:n,organizationId:r});if("string"!=typeof(i=e.privateKey.addresses.find(e=>"ADDRESS_FORMAT_ETHEREUM"===e.format)?.address)||!i)throw new X({message:`Unable to find Ethereum address for key ${n} under organization ${r}`})}return(0,B.A)({address:i,signMessage:function({message:e}){return et(t,e,r,n)},signTransaction:function(e,i){return er(t,e,i?.serializer?i.serializer:T.D,r,n)},signTypedData:function(e){return en(t,e,r,n)}})}async function et(e,t,r,n){let i=(0,R.r)(t),s=await eo(e,i,r,n);return`${s}`}async function er(e,t,r,n,i){let s=r(t).replace(/^0x/,"");return await ei(e,s,n,i)}async function en(e,t,r,n){let i=(0,N.J)(t);return await eo(e,i,r,n)}async function ei(e,t,r,n){let i;try{i=await es(e,t,r,n)}catch(e){if(e instanceof X)throw e;throw new X({message:`Failed to sign transaction: ${e.message}`,cause:e})}return`0x${i}`}async function es(e,t,r,n){if(e instanceof Z){let{activity:i}=await e.signTransaction({type:"ACTIVITY_TYPE_SIGN_TRANSACTION_V2",organizationId:r,parameters:{signWith:n,type:"TRANSACTION_TYPE_ETHEREUM",unsignedTransaction:t},timestampMs:String(Date.now())}),{id:s,status:o,type:a}=i;if("ACTIVITY_STATUS_COMPLETED"!==i.status)throw new X({message:`Invalid activity status: ${i.status}`,activityId:s,activityStatus:o,activityType:a});return el(i?.result?.signTransactionResult?.signedTransaction)}{let r=await e.signTransaction({signWith:n,type:"TRANSACTION_TYPE_ETHEREUM",unsignedTransaction:t});return el(r?.signedTransaction)}}async function eo(e,t,r,n){let i;try{i=await ea(e,t,r,n)}catch(e){if(e instanceof X)throw e;throw new X({message:`Failed to sign: ${e.message}`,cause:e})}return i}async function ea(e,t,r,n){let i;if(e instanceof Z){let{activity:s}=await e.signRawPayload({type:"ACTIVITY_TYPE_SIGN_RAW_PAYLOAD_V2",organizationId:r,parameters:{signWith:n,payload:t,encoding:"PAYLOAD_ENCODING_HEXADECIMAL",hashFunction:"HASH_FUNCTION_NO_OP"},timestampMs:String(Date.now())}),{id:o,status:a,type:l}=s;if("ACTIVITY_STATUS_COMPLETED"!==a)throw new X({message:`Invalid activity status: ${s.status}`,activityId:o,activityStatus:a,activityType:l});i=el(s?.result?.signRawPayloadResult)}else i=await e.signRawPayload({signWith:n,payload:t,encoding:"PAYLOAD_ENCODING_HEXADECIMAL",hashFunction:"HASH_FUNCTION_NO_OP"});return el((0,D.X)({r:`0x${i.r}`,s:`0x${i.s}`,v:"00"===i.v?27n:28n}))}function el(e){if(null==e)throw Error(`Got unexpected ${JSON.stringify(e)}`);return e}(a=u||(u={})).PublicKeyReady="PUBLIC_KEY_READY",a.InjectCredentialBundle="INJECT_CREDENTIAL_BUNDLE",a.InjectKeyExportBundle="INJECT_KEY_EXPORT_BUNDLE",a.InjectWalletExportBundle="INJECT_WALLET_EXPORT_BUNDLE",a.InjectImportBundle="INJECT_IMPORT_BUNDLE",a.ExtractWalletEncryptedBundle="EXTRACT_WALLET_ENCRYPTED_BUNDLE",a.ExtractKeyEncryptedBundle="EXTRACT_KEY_ENCRYPTED_BUNDLE",a.BundleInjected="BUNDLE_INJECTED",a.EncryptedBundleExtracted="ENCRYPTED_BUNDLE_EXTRACTED",a.StampRequest="STAMP_REQUEST",a.Stamp="STAMP",a.Error="ERROR",(l=c||(c={})).Hexadecimal="HEXADECIMAL",l.Solana="SOLANA";class eu{constructor(e){if("undefined"==typeof window)throw Error("Cannot initialize iframe in non-browser environment");if(!e.iframeContainer)throw Error("Iframe container cannot be found");if(this.container=e.iframeContainer,this.container.querySelector(`#${e.iframeElementId}`))throw Error(`Iframe element with ID ${e.iframeElementId} already exists`);let t=window.document.createElement("iframe");t.id=e.iframeElementId,t.src=e.iframeUrl,this.iframe=t;let r=new URL(e.iframeUrl);this.iframeOrigin=r.origin,this.iframePublicKey=null}async init(){return this.container.appendChild(this.iframe),new Promise((e,t)=>{window.addEventListener("message",t=>{t.origin===this.iframeOrigin&&t.data?.type===u.PublicKeyReady&&(this.iframePublicKey=t.data.value,e(t.data.value))},!1)})}clear(){this.iframe.remove()}publicKey(){return this.iframePublicKey}async injectCredentialBundle(e){return new Promise((t,r)=>{this.iframe.contentWindow?.postMessage({type:u.InjectCredentialBundle,value:e},"*"),window.addEventListener("message",e=>{e.origin===this.iframeOrigin&&(e.data?.type===u.BundleInjected&&t(e.data.value),e.data?.type===u.Error&&r(e.data.value))},!1)})}async injectKeyExportBundle(e,t){return this.iframe.contentWindow?.postMessage({type:u.InjectKeyExportBundle,value:e,keyFormat:t},"*"),new Promise((e,t)=>
58{window.addEventListener("message",r=>{r.origin===this.iframeOrigin&&(r.data?.type===u.BundleInjected&&e(r.data.value),r.data?.type===u.Error&&t(r.data.value))},!1)})}async injectWalletExportBundle(e){return this.iframe.contentWindow?.postMessage({type:u.InjectWalletExportBundle,value:e},"*"),new Promise((e,t)=>{window.addEventListener("message",r=>{r.origin===this.iframeOrigin&&(r.data?.type===u.BundleInjected&&e(r.data.value),r.data?.type===u.Error&&t(r.data.value))},!1)})}async injectImportBundle(e){return this.iframe.contentWindow?.postMessage({type:u.InjectImportBundle,value:e},"*"),new Promise((e,t)=>{window.addEventListener("message",r=>{r.origin===this.iframeOrigin&&(r.data?.type===u.BundleInjected&&e(r.data.value),r.data?.type===u.Error&&t(r.data.value))},!1)})}async extractWalletEncryptedBundle(){return this.iframe.contentWindow?.postMessage({type:u.ExtractWalletEncryptedBundle},"*"),new Promise((e,t)=>{window.addEventListener("message",r=>{r.origin===this.iframeOrigin&&(r.data?.type===u.EncryptedBundleExtracted&&e(r.data.value),r.data?.type===u.Error&&t(r.data.value))},!1)})}async extractKeyEncryptedBundle(e){return this.iframe.contentWindow?.postMessage({type:u.ExtractKeyEncryptedBundle,keyFormat:e},"*"),new Promise((e,t)=>{window.addEventListener("message",r=>{r.origin===this.iframeOrigin&&(r.data?.type===u.EncryptedBundleExtracted&&e(r.data.value),r.data?.type===u.Error&&t(r.data.value))},!1)})}async stamp(e){if(null===this.iframePublicKey)throw Error("null iframe public key. Have you called/awaited .init()?");let t=this.iframeOrigin;return this.iframe.contentWindow?.postMessage({type:u.StampRequest,value:e},"*"),new Promise(function(e,r){window.addEventListener("message",n=>{n.origin===t&&(n.data?.type===u.Stamp&&e({stampHeaderName:"X-Stamp",stampHeaderValue:n.data.value}),n.data?.type===u.Error&&r(n.data.value))},!1)})}}function ec(e){let t=new Uint8Array(e),r="";for(let e of t)r+=String.fromCharCode(e);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}let eh="copy",ed="convert";function ef(e){return{required:!0,schema:e}}function ep(e){return{required:!1,schema:e}}let eg={appid:ep(eh),appidExclude:ep(eh),credProps:ep(eh)},ey={type:ef(eh),id:ef(eh),rawId:ef(ed),authenticatorAttachment:ep(eh),response:ef({clientDataJSON:ef(ed),authenticatorData:ef(ed),signature:ef(ed),userHandle:ef(ed)}),clientExtensionResults:{required:!0,schema:eg,derive:e=>e.getClientExtensionResults()}};async function em(e){let t=await navigator.credentials.get(e);return t.toJSON=()=>(function e(t,r,n){if(r===eh)return n;if(r===ed)return t(n);if(r instanceof Array)return n.map(n=>e(t,r[0],n));if(r instanceof Object){let i={};for(let[s,o]of Object.entries(r)){if(o.derive){let e=o.derive(n);void 0!==e&&(n[s]=e)}if(!(s in n)){if(o.required)throw Error(`Missing key: ${s}`);continue}if(null==n[s]){i[s]=null;continue}i[s]=e(t,o.schema,n[s])}return i}})(ec,ey,t),t}n=void 0!==globalThis?.Buffer?globalThis.Buffer:k.Buffer;var ev=r(65530);class eb{constructor(e){this.rpId=e.rpId,this.timeout=e.timeout||3e5,this.userVerification=e.userVerification||"preferred",this.allowCredentials=e.allowCredentials||[]}async stamp(e){let t=function(e){let t=new TextEncoder().encode(e),r=(0,ev.J)(t),i=n.from(r).toString("hex");return new Uint8Array(n.from(i,"utf8"))}(e),r={publicKey:{rpId:this.rpId,challenge:t,allowCredentials:this.allowCredentials,timeout:this.timeout,userVerification:this.userVerification}},i=(await em(r)).toJSON();return{stampHeaderName:"X-Stamp-Webauthn",stampHeaderValue:JSON.stringify({authenticatorData:i.response.authenticatorData,clientDataJson:i.response.clientDataJSON,credentialId:i.id,signature:i.response.signature})}}}var ew=r(34952),e_=r(78910),eE=r(52251),eS=r(88946);let eA=(e,t)=>null==e?void 0:e.find(({walletName:e,chain:r})=>(null==e?void 0:e.startsWith("turnkey"))&&t===r);var ek=r(86673);let eC={AUTHENTICATOR_TRANSPORT_BLE:ek.lfg.Ble,AUTHENTICATOR_TRANSPORT_HYBRID:ek.lfg.Hybrid,AUTHENTICATOR_TRANSPORT_INTERNAL:ek.lfg.Internal,AUTHENTICATOR_TRANSPORT_NFC:ek.lfg.Nfc,AUTHENTICATOR_TRANSPORT_USB:ek.lfg.Usb},eI=e=>e.map(e=>eC[e]);r(59527),r(45429);var ex=r(9109).Buffer;let eP=e=>ex.from(e).toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,""),eO=()=>{let e=new Uint8Array(32);return crypto.getRandomValues(e),e.buffer};class eT{constructor(){this.isSessionActive=()=>!!this.__createdAt&&"email"===this.__recoveryType&&(!this.isExpired(this.__createdAt,this.__sessionExpiration||1800)||(this.clear(),!1)),this.isValidCode=e=>C(this,void 0,void 0,function*(){var t,r,n,i;if(!e||!this.__turnkeyRecoveryUserId)throw new eE.kW("Cannot proceed with your request");let s=yield null===(t=this.__client)||void 0===t?void 0:t.getUser({organizationId:e,userId:this.__turnkeyRecoveryUserId}),o={email:"CREDENTIAL_TYPE_API_KEY_P256",passkey:"CREDENTIAL_TYPE_RECOVER_USER_KEY_P256"},a=null===(i=null===(n=null===(r=null==s?void 0:s.user)||void 0===r?void 0:r.apiKeys)||void 0===n?void 0:n.filter(e=>e.credential.type===o[this.__recoveryType]))||void 0===i?void 0:i.pop();return!(!a||this.isExpired(parseInt(a.createdAt.seconds,10),900))&&(this.__createdAt=parseInt(a.createdAt.seconds,10),!0)}),this.isExpired=(e,t)=>{let r=new Date(1e3*(e+t));return new Date>=r}}get publicKey(){return this.__publicKey}get client(){return this.__client}get recoveryType(){return this.__recoveryType}get recoveryUserId(){return this.__turnkeyRecoveryUserId||""}set recoveryUserId(e){this.__turnkeyRecoveryUserId=e}clear(){var e;null===(e=this.__iframeStamper)||void 0===e||e.clear(),this.__recoveryType=void 0,this.__iframeStamper=void 0,this.__publicKey=void 0,this.__client=void 0,this.__turnkeyRecoveryUserId=void 0,this.__createdAt=void 0}initRecovery(e,t,r,n){return C(this,void 0,void 0,function*(){return this.__recoveryType&&this.clear(),this.__sessionExpiration=n,this.__recoveryType=e,this.__iframeStamper=new eu({iframeContainer:t,iframeElementId:r,iframeUrl:"passkey"===e?"https://recovery.turnkey.com":"https://auth.turnkey.com"}),yield this.__iframeStamper.init(),this.__publicKey=this.__iframeStamper.publicKey(),this.__publicKey})}verifyRecoveryCode(e,t){return C(this,void 0,void 0,function*(){if(!this.__iframeStamper)throw new eE.kW("Cannot proceed with your request");try{if(yield this.__iframeStamper.injectCredentialBundle(e),this.__client=new Z({baseUrl:"https://api.turnkey.com"},this.__iframeStamper),!t||!this.__turnkeyRecoveryUserId)throw new eE.kW("Cannot proceed with your request");
58if(!(yield this.isValidCode(t)))throw new eE.kW("The code is invalid or expired.")}catch(e){if(ew.kg.error("Error while verifying recovery code",e),e instanceof eE.kW)throw e;throw new eE.kW("The code is invalid or expired.")}})}completeRecovery(e){return C(this,arguments,void 0,function*({attestation:e,challenge:t,organizationId:r}){if(!this.__client||!this.__turnkeyRecoveryUserId)throw new eE.kW("Cannot proceed with your request");try{return this.__client.recoverUser({organizationId:r,parameters:{authenticator:{attestation:e,authenticatorName:"Passkey",challenge:t},userId:this.__turnkeyRecoveryUserId},timestampMs:String(Date.now()),type:"ACTIVITY_TYPE_RECOVER_USER"})}catch(e){throw ew.kg.error("Error while completing recovery process",e),e}})}addPasskeyAuthenticator(e){return C(this,arguments,void 0,function*({attestation:e,challenge:t,organizationId:r}){if(!this.__client||!this.__turnkeyRecoveryUserId)throw new eE.kW("Cannot proceed with your request");try{return this.__client.createAuthenticators({organizationId:r,parameters:{authenticators:[{attestation:e,authenticatorName:"Passkey",challenge:t}],userId:this.__turnkeyRecoveryUserId},timestampMs:String(Date.now()),type:"ACTIVITY_TYPE_CREATE_AUTHENTICATORS_V2"})}catch(e){throw ew.kg.error("Error while creating new authenticator",e),e}})}}let eR=new eT;class eN{get publicKey(){return this.__publicKey}clear(){var e;null===(e=this.__iframeStamper)||void 0===e||e.clear(),this.__iframeStamper=void 0,this.__publicKey=void 0,this.__turnkeyClient=void 0}initExport(e,t){return C(this,void 0,void 0,function*(){if(this.__iframeStamper=new eu({iframeContainer:e,iframeElementId:t,iframeUrl:"https://export.turnkey.com"}),yield this.__iframeStamper.init(),this.__publicKey=this.__iframeStamper.publicKey(),eR.isSessionActive())this.__turnkeyClient=eR.client;else{let e=(0,eE.KT)();e||(e=window.location.hostname);let t=new eb({rpId:e});this.__turnkeyClient=new Z({baseUrl:"https://api.turnkey.com"},t)}return this.__publicKey})}verifyExportWallet(e){return C(this,void 0,void 0,function*(){if(!this.__iframeStamper)throw new eE.kW("Cannot proceed with your request");try{return yield this.__iframeStamper.injectWalletExportBundle(e)}catch(e){throw ew.kg.error("Error while verifying export wallet",e),e}})}verifyExportPrivateKey(e){return C(this,void 0,void 0,function*(){if(!this.__iframeStamper)throw new eE.kW("Cannot proceed with your request");try{return yield this.__iframeStamper.injectKeyExportBundle(e)}catch(e){throw ew.kg.error("Error while verifying export private key",e),e}})}exportPrivateKey(e){return C(this,arguments,void 0,function*({privateKeyId:e,organizationId:t}){if(!this.__iframeStamper||!this.__publicKey||!this.__turnkeyClient||!e)throw new eE.kW("Cannot proceed with your request");try{return(yield this.__turnkeyClient.exportPrivateKey({organizationId:t,parameters:{privateKeyId:e,targetPublicKey:this.__publicKey},timestampMs:String(Date.now()),type:"ACTIVITY_TYPE_EXPORT_PRIVATE_KEY"})).activity}catch(e){throw ew.kg.error("Error while completing export private key process",e),e}})}exportWallet(e){return C(this,arguments,void 0,function*({walletId:e,organizationId:t,address:r}){if(!this.__iframeStamper||!this.__publicKey||!this.__turnkeyClient||!e)throw new eE.kW("Cannot proceed with your request");try{if(r)return(yield this.__turnkeyClient.exportWalletAccount({organizationId:t,parameters:{address:r,targetPublicKey:this.__publicKey},timestampMs:String(Date.now()),type:"ACTIVITY_TYPE_EXPORT_WALLET_ACCOUNT"})).activity;return(yield this.__turnkeyClient.exportWallet({organizationId:t,parameters:{targetPublicKey:this.__publicKey,walletId:e},timestampMs:String(Date.now()),type:"ACTIVITY_TYPE_EXPORT_WALLET"})).activity}catch(e){throw ew.kg.error("Error while completing export wallet process",e),e}})}}class eD extends ew.VY{constructor(e,t){if(super(t),this.canConnectViaEmail=!1,this.isEmbeddedWallet=!0,!t.appName)throw Error("appName not set");this.name=e.name,this.overrideKey=e.key,this.appName=t.appName,this.__authenticatorMethodHandler=eR,this.__exportHandler=new eN}getWebAuthnAttestation(){return C(this,void 0,void 0,function*(){let e;
58let t=eO(),r=eO(),{email:n,phone:i}=this;if(!n&&!i)throw Error("Email or phone must be set to register a webauthn credential.");let s={publicKey:{authenticatorSelection:{authenticatorAttachment:void 0,requireResidentKey:!1,residentKey:"preferred",userVerification:"discouraged"},challenge:t,pubKeyCredParams:[{alg:-7,type:"public-key"}],rp:{id:(0,eE.KT)(),name:this.appName},user:{displayName:n||`${this.appName} - ${i}`,id:r,name:n||`${this.appName} - ${i}`}}};try{e=yield Y(s)}catch(t){ew.kg.warn(`Unable to register webauthn credential on the current page's TLD ${(0,eE.KT)()}. Falling back to using hostname. ${window.location.hostname}`,t),s.publicKey.rp.id=window.location.hostname,e=yield Y(s)}return{attestation:{attestationObject:e.attestationObject,clientDataJson:e.clientDataJson,credentialId:e.credentialId,transports:eI(e.transports)},challenge:eP(t)}})}getAuthenticatorHandler(){return this.__authenticatorMethodHandler}getExportHandler(){return this.__exportHandler}get email(){return this._email}setEmail(e){this._email=e}get phone(){return this._phone}setPhone(e){this._phone=e}clearEmail(){this._email=null}fetchPublicAddress(){return C(this,void 0,void 0,function*(){var e;return null===(e=this.verifiedCredential)||void 0===e?void 0:e.address})}getConnectedAccounts(){return C(this,void 0,void 0,function*(){var e;let t=null===(e=this.verifiedCredential)||void 0===e?void 0:e.address;return t?[t]:[]})}getMobileOrInstalledWallet(){return this}get turnkeyAddress(){var e;let{address:t}=null!==(e=this.verifiedCredential)&&void 0!==e?e:{};return t}get walletProperties(){let{walletProperties:e}=this.verifiedCredential||{};return e}set verifiedCredential(e){this._verifiedCredential=e}get verifiedCredential(){return this._verifiedCredential}}class eB extends eD{constructor(e,t){var r;super(e,t),this.connectedChain="EVM",this.supportedChains=["ETH","EVM"],this.verifiedCredentialChain="eip155",this.evmNetworks=(0,eE.fu)(t.evmNetworks),this.walletUiUtils=t.walletUiUtils,this._turnkeyAccount=void 0,this._selectedChainId=this.getLastUsedChainId(),this.chainRpcProviders=t.chainRpcProviders,null===(r=this.chainRpcProviders)||void 0===r||r.registerChainProviders(eS.r.EVM,e=>{let t={};return(null==e?void 0:e.evm)&&(t.evm=(0,eE.fu)(e.evm).map(e=>{var t;let r=(null===(t=e.privateCustomerRpcUrls)||void 0===t?void 0:t[0])||e.rpcUrls[0],n=(0,I.v)({chain:(0,eE.uy)(e),transport:(0,x.d)(r)});return{chainId:e.chainId,chainName:e.name,provider:n}})),t.evm}),this.__turnkeyClient=this.getTurnkeyClient()}getLastUsedChainId(){var e;return this.lastUsedChainId?this.lastUsedChainId:(null===(e=this.evmNetworks)||void 0===e?void 0:e.length)?this.evmNetworks[0].chainId:void 0}getNetwork(){return C(this,void 0,void 0,function*(){var e;return null===(e=yield this.getSigner())||void 0===e?void 0:e.getChainId()})}supportsNetworkSwitching(){return!0}switchNetwork(e){return C(this,arguments,void 0,function*({networkChainId:e}){this.lastUsedChainId=e,this._selectedChainId=e,yield this.refreshTurnkeyAccount(),this.emit("chainChange",{chain:e.toString()})})}setVerifiedCredentials(e){let t=eA(e,"eip155");JSON.stringify(this.verifiedCredential)!==JSON.stringify(t)&&(this.verifiedCredential=t,this.refreshTurnkeyAccount())}getRpcUrl(){let e=this._selectedChainId;return(0,ew.GO)({chainId:e,networks:this.evmNetworks})}getBalance(){return C(this,void 0,void 0,function*(){let e=this.turnkeyAddress;if(!e)return;let t=this.getRpcUrl();if(!t)return;let r=(0,I.v)({transport:(0,x.d)(t)}),n=yield r.getBalance({address:e});return(0,P.d)(n)})}signMessage(e){return C(this,void 0,void 0,function*(){let t=yield this.getSigner();if(!t)throw Error("Signer not found");return t.signMessage({message:e})})}getPublicClient(){return C(this,void 0,void 0,function*(){var e,t,r;if(0===this.evmNetworks.length)return;let n=null!==(e=yield this.getNetwork())&&void 0!==e?e:1,i={cosmos:[],evm:this.evmNetworks,solana:[],starknet:void 0};return null===(r=null===(t=this.chainRpcProviders)||void 0===t?void 0:t.getEvmProviderByChainId(i,n))||void 0===r?void 0:r.provider})}getSigner(){return C(this,void 0,void 0,function*(){return yield this.getTurnkeyAccount(),this.getWalletClient()})}getTurnkeyClient(){var e;let t=(0,eE.KT)();t||(t=window.location.hostname);let r=new eb({rpId:t});return this.__turnkeyClient=null!==(e=this.getAuthenticatorHandler().client)&&void 0!==e?e:new Z({baseUrl:"https://api.turnkey.com"},r),this.__turnkeyClient}getAccount(){return C(this,void 0,void 0,function*(){var e,t;return("passkey"===this.getAuthenticatorHandler().recoveryType&&(null===(e=this.__turnkeyClient)||void 0===e?void 0:e.stamper)instanceof eu||"email"===this.getAuthenticatorHandler().recoveryType&&(null===(t=this.__turnkeyClient)||void 0===t?void 0:t.stamper)instanceof eb||this.__turnkeyClient!==this.getAuthenticatorHandler().client)&&(yield this.refreshTurnkeyAccount()),this._turnkeyAccount})}getWalletClient(){let e=this.networkRpcUrl,t=this._turnkeyAccount,r=this.currentEvmNetwork;if(t&&e&&r)return(0,e_.No)({account:this.getAccount.bind(this),address:this.turnkeyAddress,chain:(0,eE.uy)(r),transport:(0,x.d)(e),walletUiUtils:this.walletUiUtils})}refreshTurnkeyAccount(){return C(this,void 0,void 0,function*(){return this._turnkeyAccount=void 0,this.getTurnkeyAccount()})}get currentChainId(){var e,t,r;return null!==(e=this._selectedChainId)&&void 0!==e?e:null===(r=null===(t=this.evmNetworks)||void 0===t?void 0:t[0])||void 0===r?void 0:r.chainId}get networkRpcUrl(){let e=this.currentChainId;if(this.evmNetworks.find(t=>t.chainId===e))return(0,ew.GO)({chainId:e,networks:this.evmNetworks})}get currentEvmNetwork(){let e=this.currentChainId;return this.evmNetworks.find(t=>t.chainId===e)}getTurnkeyAccount(){return C(this,void 0,void 0,function*(){var e,t;if(this._turnkeyAccount)return this._turnkeyAccount;let{turnkeySubOrganizationId:r}=null!==(e=this.walletProperties)&&void 0!==e?e:{},{address:n}=null!==(t=this.verifiedCredential)&&void 0!==t?t:{};if(r&&n)return this._turnkeyAccount=yield ee({client:this.getTurnkeyClient(),ethereumAddress:n,organizationId:r,signWith:n}),this._turnkeyAccount})}
58get lastUsedChainId(){let e=localStorage.getItem(eB.lastUsedChainIdStorageKey);if(e)try{let t=parseInt(e);if(isNaN(t))return;if(!this.evmNetworks.some(e=>e.chainId===t)){let e=this.evmNetworks[0].chainId;return this.lastUsedChainId=e,this.lastUsedChainId}return t}catch(e){ew.kg.error(e);return}}set lastUsedChainId(e){void 0===e?localStorage.removeItem(eB.lastUsedChainIdStorageKey):localStorage.setItem(eB.lastUsedChainIdStorageKey,e.toString())}}eB.lastUsedChainIdStorageKey="turnkey-last-used-chain-id";let eM={Turnkey:{key:"turnkey",name:"Turnkey"},TurnkeyHD:{key:"turnkeyhd",name:"Turnkey HD"}},eL=e=>{var t;return(null===(t=e.apiProviders)||void 0===t?void 0:t.turnkey)?[eB.bind(null,eM.TurnkeyHD),eB.bind(null,eM.Turnkey)]:[]},eU="copy",ej="convert";function eF(e,t){return{required:!0,schema:e,derive:t}}function eq(e){return{required:!0,schema:e}}function eH(e){return{required:!1,schema:e}}let ez={appid:eH(eU),appidExclude:eH(eU),credProps:eH(eU)};function e$(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)0>t.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function eV(e,t,r,n){return new(r||(r=Promise))(function(i,s){function o(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})}eq(eU),eq(eU),eq(ej),eH(eU),eq({clientDataJSON:eq(ej),attestationObject:eq(ej),transports:eF(eU,e=>e.getTransports?.()||[])}),eF(ez,e=>e.getClientExtensionResults()),eq(eU),eq(eU),eq(ej),eH(eU),eq({clientDataJSON:eq(ej),authenticatorData:eq(ej),signature:eq(ej),userHandle:eq(ej)}),eF(ez,e=>e.getClientExtensionResults()),r(9109).Buffer,r(9109).Buffer,r(9109).Buffer,"function"==typeof SuppressedError&&SuppressedError;var eW=r(72305),eG=r(26422),eK=r(69532),eJ=r(99112);let eY=e=>"eip6963:announceProvider"===e.type&&void 0!==e.detail;class eQ{constructor(){this.providers=[]}registerProviders(){"undefined"!=typeof window&&(window.addEventListener("eip6963:announceProvider",e=>{eY(e)&&this.providers.push(e.detail)}),window.dispatchEvent(new Event("eip6963:requestProvider")))}}class eZ{constructor(){this.eip6963Provider=new eQ}static get(){var e;return(null===(e=eZ.instance)||void 0===e?void 0:e.eip6963Provider)||(eZ.instance=new eZ,eZ.instance.eip6963Provider.registerProviders()),eZ.instance.eip6963Provider}}class eX{constructor(e){this.wallet=e}getInstalledProvider(){let e=this.getEip6963Config();if(e){let t=this.eip6963ProviderLookup(e.rdns);if(t)return t}let t=this.getInjectedConfig();if(t&&t.extensionLocators&&t.extensionLocators.length)return this.installedProviderLookup(t.extensionLocators)}getEip6963Config(){if(this.wallet&&this.wallet.eip6963Config)return this.wallet.eip6963Config}getInjectedConfig(){if(!this.wallet||!this.wallet.injectedConfig)return;let{injectedConfig:e}=this.wallet;return e.find(e=>"evm"===e.chain)}installedProviders(){let e=this.getInjectedConfig();if(!e)return[];let t=[];if(e.windowLocations)for(let r of e.windowLocations){let e=(0,eE.vj)(r);e&&e.length&&t.push(...e)}return window.ethereum&&(window.ethereum.providers&&window.ethereum.providers.length?window.ethereum.providers.forEach(e=>t.push(e)):t.push(window.ethereum)),t}installedProviderLookup(e){let t=this.installedProviders();return(0,ew.VN)(t,e)}eip6963ProviderLookup(e){var t;let{providers:r}=eZ.get();return null===(t=r.find(t=>t.info.rdns===e))||void 0===t?void 0:t.provider}isInstalledHelper(){return void 0!==this.findProvider()}findProvider(){return this.getInstalledProvider()}findWalletClient(e){let t=this.findProvider();if(t)return(0,eG.K)({account:this.account,chain:e?e_.zk[e]:void 0,transport:(0,eK.P)(t)})}fetchPublicAddress(){return eV(this,void 0,void 0,function*(){let e=this.findWalletClient();return e?this.fetchPublicAddressWithProvider(e):Promise.resolve(void 0)})}fetchPublicAddressWithProvider(e){return eV(this,void 0,void 0,function*(){try{let[t]=yield e.requestAddresses(),r=(0,eJ.K)(t);return this.account=(0,B.A)(r),r}catch(e){return ew.kg.error(e),Promise.reject(e)}})}signMessage(e){return eV(this,void 0,void 0,function*(){let t=yield this.fetchPublicAddress();if(!t)return Promise.resolve(void 0);let r=this.findWalletClient();return r?yield r.signMessage({account:t,message:e}):Promise.resolve(void 0)})}_setupEventListeners(e){let t=this.findProvider();if(!t)return{tearDownEventListeners:()=>{}};let{handleAccountChange:r,handleChainChange:n,handleDisconnect:i}=(0,ew.nb)(e);return t.on("accountsChanged",r),t.on("chainChanged",n),t.on("disconnect",i),{tearDownEventListeners:()=>{let e=this.findProvider();e&&(r&&e.removeListener("accountsChanged",r),n&&e.removeListener("chainChanged",n),i&&e.removeListener("disconnect",i))}}}}let e0=({chainId:e,name:t,networks:r})=>e||t?e&&t?r.find(r=>r.chainId===e&&r.name===t):e?r.find(t=>t.chainId===e):r.find(e=>e.name===t):void 0;class e1 extends ew.VY{getPublicClient(){return eV(this,void 0,void 0,function*(){var e,t,r;let n=null!==(e=yield this.getNetwork())&&void 0!==e?e:1;if(0===this.evmNetworks.length)return;let i={cosmos:[],evm:this.evmNetworks,solana:[],starknet:void 0};return null===(r=null===(t=this.chainRpcProviders)||void 0===t?void 0:t.getEvmProviderByChainId(i,n))||void 0===r?void 0:r.provider})}constructor(e){var t;super(e),this.evmNetworkRpcMap=()=>this.evmNetworks.reduce((e,t)=>
58{var r;return[e[t.chainId]]=(null===(r=null==t?void 0:t.privateCustomerRpcUrls)||void 0===r?void 0:r.length)?t.privateCustomerRpcUrls:t.rpcUrls,e},{}),this.evmNetworks=(0,eE.fu)(e.evmNetworks),this.chainRpcProviders=e.chainRpcProviders,null===(t=this.chainRpcProviders)||void 0===t||t.registerChainProviders(eS.r.EVM,e=>{let t={};return(null==e?void 0:e.evm)&&(t.evm=(0,eE.fu)(e.evm).map(e=>{var t;let r=(null===(t=e.privateCustomerRpcUrls)||void 0===t?void 0:t[0])||e.rpcUrls[0],n=(0,I.v)({chain:(0,eE.uy)(e),transport:(0,x.d)(r)});return{chainId:e.chainId,chainName:e.name,provider:n}})),t.evm})}getNetwork(){return eV(this,void 0,void 0,function*(){let e=this.getWalletClient();return this.supportsNetworkSwitching&&e?(0,eE.MB)(e.getChainId,{fallbackValue:eE.yR,timeoutMs:1e3}):Promise.resolve(void 0)})}getNameService(){return eV(this,void 0,void 0,function*(){let[[e],t]=yield Promise.all([this.getConnectedAccounts(),this.getPublicClient()]);if(!e||!t)return;let r=yield t.getEnsName({address:e}),n=r?yield t.getEnsAvatar({name:r}):void 0;return{avatar:null!=n?n:void 0,name:null!=r?r:void 0}})}getSigner(){return eV(this,void 0,void 0,function*(){return this.getWalletClient()})}getBalance(){return eV(this,void 0,void 0,function*(){let[e]=yield this.getConnectedAccounts();if(!e)return;let t=yield this.getPublicClient(),r=yield null==t?void 0:t.getBalance({address:e});if(r||r===BigInt(0))return(0,P.d)(r)})}supportsNetworkSwitching(){return!0}switchNetwork(e){return eV(this,arguments,void 0,function*({networkName:e,networkChainId:t}){let r=e0({chainId:t,name:e,networks:this.evmNetworks});if(!r)throw new eE.kW(`Could not find network mapping for chain ${e||t}`);if(!this.supportsNetworkSwitching())throw new eE.kW("Network switching is not supported");let n=this.getWalletClient();if(!n)throw new eE.kW("Provider not found");return this.providerSwitchNetwork({network:r,provider:n})})}getConnectedAccounts(){return eV(this,void 0,void 0,function*(){let e=this.getWalletClient();return e?(0,eE.MB)(e.getAddresses,{fallbackValue:[],timeoutMs:300}):[]})}providerSwitchNetwork(e){return eV(this,arguments,void 0,function*({network:e,provider:t}){var r,n,i,s;let{chainId:o}=e,a=yield this.getNetwork();if(!a||a!==o)try{if(!this.supportsNetworkSwitching())throw new eE.kW("Network switching is not supported");return yield t.switchChain((0,eE.uy)(e))}catch(o){if(4902===o.code||(null===(r=o.message)||void 0===r?void 0:r.includes("Unrecognized chain"))||(null===(i=null===(n=o.data)||void 0===n?void 0:n.orginalError)||void 0===i?void 0:i.code)===4902)return this.providerAddNetwork({network:e,provider:t});if((null===(s=o.message)||void 0===s?void 0:s.includes("rejected"))||"string"==typeof o&&o.includes("rejected"))throw new eE.kW("User rejected the wallet's request to switch network");throw o}})}providerAddNetwork(e){return eV(this,arguments,void 0,function*({network:e,provider:t}){var r;try{return yield t.addChain({chain:(0,eE.uy)(e)})}catch(e){if((null===(r=e.message)||void 0===r?void 0:r.includes("rejected"))||"string"==typeof e&&e.includes("rejected"))throw new eE.kW("User rejected the wallet's request to add network");throw e}})}}var e2=r(68885),e3=r.n(e2),e5=r(23518),e6=r(67878),e4=r(24861),e8=r(67929),e7=r(89414);function e9(e){return null!=globalThis.Buffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function te(e=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?e9(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function tt(e,t){t||(t=e.reduce((e,t)=>e+t.length,0));let r=te(t),n=0;for(let t of e)r.set(t,n),n+=t.length;return e9(r)}var tr=function(e,t){if(e.length>=255)throw TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<e.length;i++){var s=e.charAt(i),o=s.charCodeAt(0);if(255!==r[o])throw TypeError(s+" is ambiguous");r[o]=i}var a=e.length,l=e.charAt(0),u=Math.log(a)/Math.log(256),c=Math.log(256)/Math.log(a);function h(e){if("string"!=typeof e)throw TypeError("Expected String");if(0===e.length)return new Uint8Array;var t=0;if(" "!==e[0]){for(var n=0,i=0;e[t]===l;)n++,t++;for(var s=(e.length-t)*u+1>>>0,o=new Uint8Array(s);e[t];){var c=r[e.charCodeAt(t)];if(255===c)return;for(var h=0,d=s-1;(0!==c||h<i)&&-1!==d;d--,h++)c+=a*o[d]>>>0,o[d]=c%256>>>0,c=c/256>>>0;if(0!==c)throw Error("Non-zero carry");i=h,t++}if(" "!==e[t]){for(var f=s-i;f!==s&&0===o[f];)f++;for(var p=new Uint8Array(n+(s-f)),g=n;f!==s;)p[g++]=o[f++];return p}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,n=0,i=0,s=t.length;i!==s&&0===t[i];)i++,r++;for(var o=(s-i)*c+1>>>0,u=new Uint8Array(o);i!==s;){for(var h=t[i],d=0,f=o-1;(0!==h||d<n)&&-1!==f;f--,d++)h+=256*u[f]>>>0,u[f]=h%a>>>0,h=h/a>>>0;if(0!==h)throw Error("Non-zero carry");n=d,i++}for(var p=o-n;p!==o&&0===u[p];)p++;for(var g=l.repeat(r);p<o;++p)g+=e.charAt(u[p]);return g},decodeUnsafe:h,decode:function(e){var r=h(e);if(r)return r;throw Error(`Non-${t} character`)}}};new Uint8Array(0);let tn=(e,t)=>{if(e===t)return!0;
58if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0},ti=e=>{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error("Unknown type, must be binary type")},ts=e=>new TextEncoder().encode(e),to=e=>new TextDecoder().decode(e);class ta{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class tl{constructor(e,t,r){if(this.name=e,this.prefix=t,void 0===t.codePointAt(0))throw Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=r}decode(e){if("string"==typeof e){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(e){return tc(this,e)}}class tu{constructor(e){this.decoders=e}or(e){return tc(this,e)}decode(e){let t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}let tc=(e,t)=>new tu({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class th{constructor(e,t,r,n){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=n,this.encoder=new ta(e,t,r),this.decoder=new tl(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}let td=({name:e,prefix:t,encode:r,decode:n})=>new th(e,t,r,n),tf=({prefix:e,name:t,alphabet:r})=>{let{encode:n,decode:i}=tr(r,t);return td({prefix:e,name:t,encode:n,decode:e=>ti(i(e))})},tp=(e,t,r,n)=>{let i={};for(let e=0;e<t.length;++e)i[t[e]]=e;let s=e.length;for(;"="===e[s-1];)--s;let o=new Uint8Array(s*r/8|0),a=0,l=0,u=0;for(let t=0;t<s;++t){let s=i[e[t]];if(void 0===s)throw SyntaxError(`Non-${n} character`);l=l<<r|s,(a+=r)>=8&&(a-=8,o[u++]=255&l>>a)}if(a>=r||255&l<<8-a)throw SyntaxError("Unexpected end of data");return o},tg=(e,t,r)=>{let n="="===t[t.length-1],i=(1<<r)-1,s="",o=0,a=0;for(let n=0;n<e.length;++n)for(a=a<<8|e[n],o+=8;o>r;)o-=r,s+=t[i&a>>o];if(o&&(s+=t[i&a<<r-o]),n)for(;s.length*r&7;)s+="=";return s},ty=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>td({prefix:t,name:e,encode:e=>tg(e,n,r),decode:t=>tp(t,n,r,e)}),tm=td({prefix:"\0",name:"identity",encode:e=>to(e),decode:e=>ts(e)}),tv=ty({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),tb=ty({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),tw=tf({prefix:"9",name:"base10",alphabet:"0123456789"}),t_=ty({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),tE=ty({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),tS=ty({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),tA=ty({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),tk=ty({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),tC=ty({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),tI=ty({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),tx=ty({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),tP=ty({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),tO=ty({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),tT=ty({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),tR=tf({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),tN=tf({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),tD=tf({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),tB=tf({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),tM=ty({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
58+/",bitsPerChar:6}),tL=ty({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),tU=ty({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),tj=ty({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),tF=Array.from("\uD83D\uDE80\uD83E\uDE90☄\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☀\uD83D\uDCBB\uD83D\uDDA5\uD83D\uDCBE\uD83D\uDCBF\uD83D\uDE02❤\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☺\uD83D\uDC4C\uD83E\uDD17\uD83D\uDC9C\uD83D\uDE14\uD83D\uDE0E\uD83D\uDE07\uD83C\uDF39\uD83E\uDD26\uD83C\uDF89\uD83D\uDC9E✌✨\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❣\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✋\uD83D\uDE1A\uD83D\uDE1D\uD83D\uDE34\uD83C\uDF1F\uD83D\uDE2C\uD83D\uDE43\uD83C\uDF40\uD83C\uDF37\uD83D\uDE3B\uD83D\uDE13⭐✅\uD83E\uDD7A\uD83C\uDF08\uD83D\uDE08\uD83E\uDD18\uD83D\uDCA6✔\uD83D\uDE23\uD83C\uDFC3\uD83D\uDC90☹\uD83C\uDF8A\uD83D\uDC98\uD83D\uDE20☝\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⚽\uD83E\uDD19☕\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⚡\uD83C\uDF1E\uD83C\uDF88❌✊\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✈\uD83C\uDF80\uD83C\uDF7A\uD83E\uDD13\uD83D\uDE19\uD83D\uDC9F\uD83C\uDF31\uD83D\uDE16\uD83D\uDC76\uD83E\uDD74▶➡❓\uD83D\uDC8E\uD83D\uDCB8⬇\uD83D\uDE28\uD83C\uDF1A\uD83E\uDD8B\uD83D\uDE37\uD83D\uDD7A⚠\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☎\uD83D\uDCA7\uD83D\uDE2F\uD83D\uDC86\uD83D\uDC46\uD83C\uDFA4\uD83D\uDE47\uD83C\uDF51❄\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"),tq=tF.reduce((e,t,r)=>(e[r]=t,e),[]),tH=tF.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]),tz=td({prefix:"\uD83D\uDE80",name:"base256emoji",encode:function(e){return e.reduce((e,t)=>e+=tq[t],"")},decode:function(e){let t=[];for(let r of e){let e=tH[r.codePointAt(0)];if(void 0===e)throw Error(`Non-base256emoji character: ${r}`);t.push(e)}return new Uint8Array(t)}});var t$=function e(t,r,n){r=r||[];for(var i=n=n||0;t>=2147483648;)r[n++]=255&t|128,t/=128;for(;-128&t;)r[n++]=255&t|128,t>>>=7;return r[n]=0|t,e.bytes=n-i+1,r},tV=function e(t,r){var n,i=0,r=r||0,s=0,o=r,a=t.length;do{if(o>=a)throw e.bytes=0,RangeError("Could not decode varint");n=t[o++],i+=s<28?(127&n)<<s:(127&n)*Math.pow(2,s),s+=7}while(n>=128);return e.bytes=o-r,i};let tW=(e,t=0)=>[tV(e,t),tV.bytes],tG=(e,t,r=0)=>(t$(e,t,r),t),tK=e=>e<128?1:e<16384?2:e<2097152?3:e<268435456?4:e<34359738368?5:e<4398046511104?6:e<562949953421312?7:e<72057594037927940?8:e<0x7fffffffffffffff?9:10,tJ=(e,t)=>
58{let r=t.byteLength,n=tK(e),i=n+tK(r),s=new Uint8Array(i+r);return tG(e,s,0),tG(r,s,n),s.set(t,i),new tZ(e,r,t,s)},tY=e=>{let t=ti(e),[r,n]=tW(t),[i,s]=tW(t.subarray(n)),o=t.subarray(n+s);if(o.byteLength!==i)throw Error("Incorrect length");return new tZ(r,i,o,t)},tQ=(e,t)=>e===t||e.code===t.code&&e.size===t.size&&tn(e.bytes,t.bytes);class tZ{constructor(e,t,r,n){this.code=e,this.size=t,this.digest=r,this.bytes=n}}let tX=({name:e,code:t,encode:r})=>new t0(e,t,r);class t0{constructor(e,t,r){this.name=e,this.code=t,this.encode=r}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?tJ(this.code,t):t.then(e=>tJ(this.code,e))}throw Error("Unknown type, must be binary type")}}let t1=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),t2=tX({name:"sha2-256",code:18,encode:t1("SHA-256")}),t3=tX({name:"sha2-512",code:19,encode:t1("SHA-512")}),t5={code:0,name:"identity",encode:ti,digest:e=>tJ(0,ti(e))},t6="raw",t4=85,t8=e=>ti(e),t7=e=>ti(e),t9=new TextEncoder,re=new TextDecoder,rt="json",rr=512,rn=e=>t9.encode(JSON.stringify(e)),ri=e=>JSON.parse(re.decode(e));class rs{constructor(e,t,r,n){this.code=t,this.version=e,this.multihash=r,this.bytes=n,this.byteOffset=n.byteOffset,this.byteLength=n.byteLength,this.asCID=this,this._baseCache=new Map,Object.defineProperties(this,{byteOffset:rp,byteLength:rp,code:rf,version:rf,multihash:rf,bytes:rf,_baseCache:rp,asCID:rp})}toV0(){if(0===this.version)return this;{let{code:e,multihash:t}=this;if(e!==ru)throw Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==rc)throw Error("Cannot convert non sha2-256 multihash CID to CIDv0");return rs.createV0(t)}}toV1(){switch(this.version){case 0:{let{code:e,digest:t}=this.multihash,r=tJ(e,t);return rs.createV1(this.code,r)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}equals(e){return e&&this.code===e.code&&this.version===e.version&&tQ(this.multihash,e.multihash)}toString(e){let{bytes:t,version:r,_baseCache:n}=this;return 0===r?ra(t,n,e||tD.encoder):rl(t,n,e||tS.encoder)}toJSON(){return{code:this.code,version:this.version,hash:this.multihash.bytes}}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}static isCID(e){return rg(/^0\.0/,ry),!!(e&&(e[rd]||e.asCID===e))}get toBaseEncodedString(){throw Error("Deprecated, use .toString()")}get codec(){throw Error('"codec" property is deprecated, use integer "code" property instead')}get buffer(){throw Error("Deprecated .buffer property, use .bytes to get Uint8Array instead")}get multibaseName(){throw Error('"multibaseName" property is deprecated')}get prefix(){throw Error('"prefix" property is deprecated')}static asCID(e){if(e instanceof rs)return e;if(null!=e&&e.asCID===e){let{version:t,code:r,multihash:n,bytes:i}=e;return new rs(t,r,n,i||rh(t,r,n.bytes))}if(null==e||!0!==e[rd])return null;{let{version:t,multihash:r,code:n}=e,i=tY(r);return rs.create(t,n,i)}}static create(e,t,r){if("number"!=typeof t)throw Error("String codecs are no longer supported");switch(e){case 0:if(t===ru)return new rs(e,t,r,r.bytes);throw Error(`Version 0 CID must use dag-pb (code: ${ru}) block encoding`);case 1:{let n=rh(e,t,r.bytes);return new rs(e,t,r,n)}default:throw Error("Invalid version")}}static createV0(e){return rs.create(0,ru,e)}static createV1(e,t){return rs.create(1,e,t)}static decode(e){let[t,r]=rs.decodeFirst(e);if(r.length)throw Error("Incorrect length");return t}static decodeFirst(e){let t=rs.inspectBytes(e),r=t.size-t.multihashSize,n=ti(e.subarray(r,r+t.multihashSize));if(n.byteLength!==t.multihashSize)throw Error("Incorrect length");let i=n.subarray(t.multihashSize-t.digestSize),s=new tZ(t.multihashCode,t.digestSize,i,n);return[0===t.version?rs.createV0(s):rs.createV1(t.codec,s),e.subarray(t.size)]}static inspectBytes(e){let t=0,r=()=>{let[r,n]=tW(e.subarray(t));return t+=n,r},n=r(),i=ru;if(18===n?(n=0,t=0):1===n&&(i=r()),0!==n&&1!==n)throw RangeError(`Invalid CID version ${n}`);let s=t,o=r(),a=r(),l=t+a;return{version:n,codec:i,multihashCode:o,digestSize:a,multihashSize:l-s,size:l}}static parse(e,t){let[r,n]=ro(e,t),i=rs.decode(n);return i._baseCache.set(r,e),i}}let ro=(e,t)=>{switch(e[0]){case"Q":return[tD.prefix,(t||tD).decode(`${tD.prefix}${e}`)];case tD.prefix:return[tD.prefix,(t||tD).decode(e)];case tS.prefix:return[tS.prefix,(t||tS).decode(e)];default:if(null==t)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[e[0],t.decode(e)]}},ra=(e,t,r)=>{let{prefix:n}=r;if(n!==tD.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let i=t.get(n);if(null!=i)return i;{let i=r.encode(e).slice(1);return t.set(n,i),i}},rl=(e,t,r)=>{let{prefix:n}=r,i=t.get(n);if(null!=i)return i;{let i=r.encode(e);return t.set(n,i),i}},ru=112,rc=18,rh=(e,t,r)=>{let n=tK(e),i=n+tK(t),s=new Uint8Array(i+r.byteLength);return tG(e,s,0),tG(t,s,n),s.set(r,i),s}
58,rd=Symbol.for("@ipld/js-cid/CID"),rf={writable:!1,configurable:!1,enumerable:!0},rp={writable:!1,enumerable:!1,configurable:!1},rg=(e,t)=>{if(e.test("0.0.0-dev"))console.warn(t);else throw Error(t)},ry=`CID.isCID(v) is deprecated and will be removed in the next major release.
59Following code pattern:
60
61if (CID.isCID(value)) {
62  doSomethingWithCID(value)
63}
64
65Is replaced with:
66
67const cid = CID.asCID(value)
68if (cid) {
69  // Make sure to use cid instead of value
70  doSomethingWithCID(cid)
71}
72`,rm={...h,...d,...f,...p,...g,...y,...m,...v,...b,...w};function rv(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}({..._,...E});let rb=rv("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),rw=rv("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{let t=te((e=e.substring(1)).length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),r_={utf8:rb,"utf-8":rb,hex:rm.base16,latin1:rw,ascii:rw,binary:rw,...rm};function rE(e,t="utf8"){let r=r_[t];if(!r)throw Error(`Unsupported encoding "${t}"`);return("utf8"===t||"utf-8"===t)&&null!=globalThis.Buffer&&null!=globalThis.Buffer.from?e9(globalThis.Buffer.from(e,"utf-8")):r.decoder.decode(`${r.prefix}${e}`)}function rS(e,t="utf8"){let r=r_[t];if(!r)throw Error(`Unsupported encoding "${t}"`);return("utf8"===t||"utf-8"===t)&&null!=globalThis.Buffer&&null!=globalThis.Buffer.from?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):r.encoder.encode(e).substring(1)}var rA=r(54574);r(74556),r(81521),r(94762);let rk={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}};r(20357),Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;let rC={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 rI(e,t){return!!Array.isArray(e)&&(!("u">typeof t)||!e.length||e.every(t))}let rx=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,rP=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,rO=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function rT(e,t){if("__proto__"===e||"constructor"===e&&t&&"object"==typeof t&&"prototype"in t){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`);return}return t}function rR(e,t={}){if("string"!=typeof e)return e;let r=e.trim();if('"'===e[0]&&e.endsWith('"')&&!e.includes("\\"))return r.slice(1,-1);if(r.length<=9){let e=r.toLowerCase();if("true"===e)return!0;
72if("false"===e)return!1;if("undefined"===e)return;if("null"===e)return null;if("nan"===e)return Number.NaN;if("infinity"===e)return Number.POSITIVE_INFINITY;if("-infinity"===e)return Number.NEGATIVE_INFINITY}if(!rO.test(e)){if(t.strict)throw SyntaxError("[destr] Invalid JSON");return e}try{if(rx.test(e)||rP.test(e)){if(t.strict)throw Error("[destr] Possible prototype pollution");return JSON.parse(e,rT)}return JSON.parse(e)}catch(r){if(t.strict)throw r;return e}}var rN=r(9109).Buffer;function rD(e,...t){try{var r;return(r=e(...t))&&"function"==typeof r.then?r:Promise.resolve(r)}catch(e){return Promise.reject(e)}}function rB(e){if(function(e){let t=typeof e;return null===e||"object"!==t&&"function"!==t}(e))return String(e);if(function(e){let t=Object.getPrototypeOf(e);return!t||t.isPrototypeOf(Object)}(e)||Array.isArray(e))return JSON.stringify(e);if("function"==typeof e.toJSON)return rB(e.toJSON());throw Error("[unstorage] Cannot stringify value!")}let rM="base64:";function rL(e){return e?e.split("?")[0].replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""):""}function rU(e){return(e=rL(e))?e+":":""}let rj=()=>{let e=new Map;return{name:"memory",options:{},hasItem:t=>e.has(t),getItem:t=>e.get(t)??null,getItemRaw:t=>e.get(t)??null,setItem(t,r){e.set(t,r)},setItemRaw(t,r){e.set(t,r)},removeItem(t){e.delete(t)},getKeys:()=>Array.from(e.keys()),clear(){e.clear()},dispose(){e.clear()}}};function rF(e,t,r){return e.watch?e.watch((e,n)=>t(e,r+n)):()=>{}}async function rq(e){"function"==typeof e.dispose&&await rD(e.dispose)}function rH(e){return new Promise((t,r)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>r(e.error)})}function rz(e,t){let r=indexedDB.open(e);r.onupgradeneeded=()=>r.result.createObjectStore(t);let n=rH(r);return(e,r)=>n.then(n=>r(n.transaction(t,e).objectStore(t)))}function r$(){return i||(i=rz("keyval-store","keyval")),i}function rV(e,t=r$()){return t("readonly",t=>rH(t.get(e)))}let rW=e=>JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString()+"n":t),rG=e=>JSON.parse(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'),(e,t)=>"string"==typeof t&&t.match(/^\d+n$/)?BigInt(t.substring(0,t.length-1)):t);function rK(e){if("string"!=typeof e)throw Error(`Cannot safe json parse value of type ${typeof e}`);try{return rG(e)}catch(t){return e}}function rJ(e){return"string"==typeof e?e:rW(e)||""}var rY=(e={})=>{let t;let r=e.base&&e.base.length>0?`${e.base}:`:"",n=e=>r+e;return e.dbName&&e.storeName&&(t=rz(e.dbName,e.storeName)),{name:"idb-keyval",options:e,hasItem:async e=>!(typeof await rV(n(e),t)>"u"),getItem:async e=>await rV(n(e),t)??null,setItem:(e,r)=>(function(e,t,r=r$()){return r("readwrite",r=>(r.put(t,e),rH(r.transaction)))})(n(e),r,t),removeItem:e=>(function(e,t=r$()){return t("readwrite",t=>(t.delete(e),rH(t.transaction)))})(n(e),t),getKeys:()=>(function(e=r$()){return e("readonly",e=>{var t;if(e.getAllKeys)return rH(e.getAllKeys());let r=[];return(t=e=>r.push(e.key),e.openCursor().onsuccess=function(){this.result&&(t(this.result),this.result.continue())},rH(e.transaction)).then(()=>r)})})(t),clear:()=>(function(e=r$()){return e("readwrite",e=>(e.clear(),rH(e.transaction)))})(t)}};class rQ{constructor(){this.indexedDb=function(e={}){let t={mounts:{"":e.driver||rj()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},r=e=>{for(let r of t.mountpoints)if(e.startsWith(r))return{base:r,relativeKey:e.slice(r.length),driver:t.mounts[r]};return{base:"",relativeKey:e,driver:t.mounts[""]}},n=(e,r)=>t.mountpoints.filter(t=>t.startsWith(e)||r&&e.startsWith(t)).map(r=>({relativeBase:e.length>r.length?e.slice(r.length):void 0,mountpoint:r,driver:t.mounts[r]})),i=(e,r)=>{if(t.watching)for(let n of(r=rL(r),t.watchListeners))n(e,r)},s=async()=>{if(!t.watching)for(let e in t.watching=!0,t.mounts)t.unwatch[e]=await rF(t.mounts[e],i,e)},o=async()=>{if(t.watching){for(let e in t.unwatch)await t.unwatch[e]();t.unwatch={},t.watching=!1}},a=(e,t,n)=>{let i=new Map,s=e=>{let t=i.get(e.base);return t||(t={driver:e.driver,base:e.base,items:[]},i.set(e.base,t)),t};for(let n of e){let e="string"==typeof n,i=rL(e?n:n.key),o=e?void 0:n.value,a=e||!n.options?t:{...t,...n.options},l=r(i);s(l).items.push({key:i,value:o,relativeKey:l.relativeKey,options:a})}return Promise.all([...i.values()].map(e=>n(e))).then(e=>e.flat())},l={hasItem(e,t={}){let{relativeKey:n,driver:i}=r(e=rL(e));return rD(i.hasItem,n,t)},getItem(e,t={}){let{relativeKey:n,driver:i}=r(e=rL(e));
72return rD(i.getItem,n,t).then(e=>rR(e))},getItems:(e,t)=>a(e,t,e=>e.driver.getItems?rD(e.driver.getItems,e.items.map(e=>({key:e.relativeKey,options:e.options})),t).then(t=>t.map(t=>({key:function(...e){return rL(e.join(":"))}(e.base,t.key),value:rR(t.value)}))):Promise.all(e.items.map(t=>rD(e.driver.getItem,t.relativeKey,t.options).then(e=>({key:t.key,value:rR(e)}))))),getItemRaw(e,t={}){let{relativeKey:n,driver:i}=r(e=rL(e));return i.getItemRaw?rD(i.getItemRaw,n,t):rD(i.getItem,n,t).then(e=>"string"==typeof e&&e.startsWith(rM)?rN.from(e.slice(rM.length),"base64"):e)},async setItem(e,t,n={}){if(void 0===t)return l.removeItem(e);let{relativeKey:s,driver:o}=r(e=rL(e));o.setItem&&(await rD(o.setItem,s,rB(t),n),o.watch||i("update",e))},async setItems(e,t){await a(e,t,async e=>{if(e.driver.setItems)return rD(e.driver.setItems,e.items.map(e=>({key:e.relativeKey,value:rB(e.value),options:e.options})),t);e.driver.setItem&&await Promise.all(e.items.map(t=>rD(e.driver.setItem,t.relativeKey,rB(t.value),t.options)))})},async setItemRaw(e,t,n={}){if(void 0===t)return l.removeItem(e,n);let{relativeKey:s,driver:o}=r(e=rL(e));if(o.setItemRaw)await rD(o.setItemRaw,s,t,n);else{if(!o.setItem)return;await rD(o.setItem,s,"string"==typeof t?t:rM+rN.from(t).toString("base64"),n)}o.watch||i("update",e)},async removeItem(e,t={}){"boolean"==typeof t&&(t={removeMeta:t});let{relativeKey:n,driver:s}=r(e=rL(e));s.removeItem&&(await rD(s.removeItem,n,t),(t.removeMeta||t.removeMata)&&await rD(s.removeItem,n+"$",t),s.watch||i("remove",e))},async getMeta(e,t={}){"boolean"==typeof t&&(t={nativeOnly:t});let{relativeKey:n,driver:i}=r(e=rL(e)),s=Object.create(null);if(i.getMeta&&Object.assign(s,await rD(i.getMeta,n,t)),!t.nativeOnly){let e=await rD(i.getItem,n+"$",t).then(e=>rR(e));e&&"object"==typeof e&&("string"==typeof e.atime&&(e.atime=new Date(e.atime)),"string"==typeof e.mtime&&(e.mtime=new Date(e.mtime)),Object.assign(s,e))}return s},setMeta(e,t,r={}){return this.setItem(e+"$",t,r)},removeMeta(e,t={}){return this.removeItem(e+"$",t)},async getKeys(e,t={}){let r=n(e=rU(e),!0),i=[],s=[];for(let e of r){let r=(await rD(e.driver.getKeys,e.relativeBase,t)).map(t=>e.mountpoint+rL(t)).filter(e=>!i.some(t=>e.startsWith(t)));s.push(...r),i=[e.mountpoint,...i.filter(t=>!t.startsWith(e.mountpoint))]}return e?s.filter(t=>t.startsWith(e)&&!t.endsWith("$")):s.filter(e=>!e.endsWith("$"))},async clear(e,t={}){e=rU(e),await Promise.all(n(e,!1).map(async e=>e.driver.clear?rD(e.driver.clear,e.relativeBase,t):e.driver.removeItem?Promise.all((await e.driver.getKeys(e.relativeBase||"",t)).map(r=>e.driver.removeItem(r,t))):void 0))},async dispose(){await Promise.all(Object.values(t.mounts).map(e=>rq(e)))},watch:async e=>(await s(),t.watchListeners.push(e),async()=>{t.watchListeners=t.watchListeners.filter(t=>t!==e),0===t.watchListeners.length&&await o()}),async unwatch(){t.watchListeners=[],await o()},mount(e,r){if((e=rU(e))&&t.mounts[e])throw Error(`already mounted at ${e}`);return e&&(t.mountpoints.push(e),t.mountpoints.sort((e,t)=>t.length-e.length)),t.mounts[e]=r,t.watching&&Promise.resolve(rF(r,i,e)).then(r=>{t.unwatch[e]=r}).catch(console.error),l},async unmount(e,r=!0){(e=rU(e))&&t.mounts[e]&&(t.watching&&e in t.unwatch&&(t.unwatch[e](),delete t.unwatch[e]),r&&await rq(t.mounts[e]),t.mountpoints=t.mountpoints.filter(t=>t!==e),delete t.mounts[e])},getMount(e=""){let t=r(e=rL(e)+":");return{driver:t.driver,base:t.base}},getMounts:(e="",t={})=>n(e=rL(e),t.parents).map(e=>({driver:e.driver,base:e.mountpoint}))};return l}({driver:rY({dbName:"WALLET_CONNECT_V2_INDEXED_DB",storeName:"keyvaluestorage"})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(e=>[e.key,e.value])}async getItem(e){let t=await this.indexedDb.getItem(e);if(null!==t)return t}async setItem(e,t){await this.indexedDb.setItem(e,rJ(t))}async removeItem(e){await this.indexedDb.removeItem(e)}}var rZ="u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof r.g?r.g:"u">typeof self?self:{},rX={exports:{}};function r0(e){var t;return[e[0],rK(null!=(t=e[1])?t:"")]}!function(){function e(){}e.prototype.getItem=function(e){return this.hasOwnProperty(e)?String(this[e]):null},e.prototype.setItem=function(e,t){this[e]=String(t)},e.prototype.removeItem=function(e){delete this[e]},e.prototype.clear=function(){let e=this;Object.keys(e).forEach(function(t){e[t]=void 0,delete e[t]})},e.prototype.key=function(e){return e=e||0,Object.keys(this)[e]},e.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),"u">typeof rZ&&rZ.localStorage?rX.exports=rZ.localStorage:"u">typeof window&&window.localStorage?rX.exports=window.localStorage:rX.exports=new e}();class r1{constructor(){this.localStorage=rX.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(r0)}async getItem(e){let t=this.localStorage.getItem(e);if(null!==t)return rK(t)}async setItem(e,t){this.localStorage.setItem(e,rJ(t))}async removeItem(e){this.localStorage.removeItem(e)}}let r2=async(e,t,r)=>{let n="wc_storage_version",i=await t.getItem(n);if(i&&i>=1){r(t);return}let s=await e.getKeys();if(!s.length){r(t);return}let o=[];for(;s.length;){let r=s.shift();if(!r)continue;let n=r.toLowerCase();if(n.includes("wc@")||n.includes("walletconnect")||n.includes("wc_")||n.includes("wallet_connect")){let n=await e.getItem(r);await t.setItem(r,n),o.push(r)}}await t.setItem(n,1),r(t),r3(e,o)},r3=async(e,t)=>{t.length&&t.forEach(async t=>{await e.removeItem(t)})};class r5{constructor(){this.initialized=!1,this.setInitialized=e=>{this.storage=e,this.initialized=!0};let e=new r1;this.storage=e;try{let t=new rQ;r2(e,t,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(e){return await this.initialize(),this.storage.getItem(e)}async setItem(e,t){return await this.initialize(),this.storage.setItem(e,t)}async removeItem(e){return await this.initialize(),this.storage.removeItem(e)}async initialize(){this.initialized||await new Promise(e=>{let t=setInterval(()=>{this.initialized&&(clearInterval(t),e())},20)})}}var r6=r(83515),r4=r(78227),r8=r.n(r4);let r7={level:"info"},r9="custom_context";var ne=Object.defineProperty,nt=Object.defineProperties,nr=Object.getOwnPropertyDescriptors,nn=Object.getOwnPropertySymbols,ni=Object.prototype.hasOwnProperty,ns=Object.prototype.propertyIsEnumerable,no=(e,t,r)=>t in e?ne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,na=(e,t)=>{for(var r in t||(t={}))ni.call(t,r)&&no(e,r,t[r]);if(nn)for(var r of nn(t))ns.call(t,r)&&no(e,r,t[r]);return e},nl=(e,t)=>nt(e,nr(t));function nu(e){return nl(na({},e),{level:e?.level||r7.level})}function nc(e,t=r9){return typeof e.bindings>"u"?function(e,t=r9){return e[t]||""}(e,t):e.bindings().context||""}function nh(e,t,r=r9){let n=function(e,t,r=r9){let n=nc(e,r);return n.trim()?`${n}/${t}`:t}(e,t,r);return function(e,t,r=r9){return e[r]=t,e}(e.child({context:n}),n,r)}var nd=r(5942);class nf extends nd.q{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}}class np extends nd.q{constructor(e,t){super(),this.core=e,this.logger=t,this.records=new Map}}class ng{constructor(e,t){this.logger=e,this.core=t}}class ny extends nd.q{constructor(e,t){super(),this.relayer=e,this.logger=t}}class nm extends nd.q{constructor(e){super()}}class nv{constructor(e,t,r,n){this.core=e,this.logger=t,this.name=r}}class nb extends nd.q{constructor(e,t){super(),this.relayer=e,this.logger=t}}class nw extends nd.q{constructor(e,t){super(),this.core=e,this.logger=t}}class n_{constructor(e,t){this.projectId=e,this.logger=t}}class nE{constructor(e,t){this.projectId=e,this.logger=t}}class nS{constructor(e){this.opts=e,this.protocol="wc",this.version=2}}class nA{constructor(e){this.client=e}}var nk=r(59271);let nC="base64url",nI="base58btc";function nx(e){return rS(rE(rJ(e),"utf8"),nC)}function nP(e){return["did","key","z"+rS(tt([rE("K36",nI),e]),nI)].join(":")}function nO(e=(0,e4.randomBytes)(32)){return nk._w(e)}async function nT(e,t,r,n,i=(0,rA.fromMiliseconds)(Date.now())){var s,o;let a={alg:"EdDSA",typ:"JWT"}
72,l={iss:nP(n.publicKey),sub:e,aud:t,iat:i,exp:i+r},u=rE([nx((s={header:a,payload:l}).header),nx(s.payload)].join("."),"utf8");return[nx((o={header:a,payload:l,signature:nk.Xx(n.secretKey,u)}).header),nx(o.payload),rS(o.signature,nC)].join(".")}r(77726);var nR=r(20357),nN=function(e,t,r){if(r||2==arguments.length)for(var n,i=0,s=t.length;i<s;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))},nD=function(e,t,r){this.name=e,this.version=t,this.os=r,this.type="browser"},nB=function(e){this.version=e,this.type="node",this.name="node",this.os=nR.platform},nM=function(e,t,r,n){this.name=e,this.version=t,this.os=r,this.bot=n,this.type="bot-device"},nL=function(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null},nU=function(){this.type="react-native",this.name="react-native",this.version=null,this.os=null},nj=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,nF=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/]],nq=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]],nH=r(2572),nz=r(99266),n$=r(53491),nV=r(20357);function nW(e,t){return e.includes(":")?[e]:t.chains||[]}let nG="base10",nK="base16",nJ="base64pad",nY="utf8";function nQ(){return rS((0,e4.randomBytes)(32),nK)}function nZ(e){return rS((0,e8.vp)(rE(e,nY)),nK)}function nX(e){return Number(rS(e,nG))}function n0(e){let t=rE(e,nJ),r=t.slice(0,1);if(1===nX(r)){let e=t.slice(1,33),n=t.slice(33,45);return{type:r,sealed:t.slice(45),iv:n,senderPublicKey:e}}let n=t.slice(1,13);return{type:r,sealed:t.slice(13),iv:n}}function n1(e){let t=e?.type||0;if(1===t){if(typeof e?.senderPublicKey>"u")throw Error("missing sender public key");if(typeof e?.receiverPublicKey>"u")throw Error("missing receiver public key")}return{type:t,senderPublicKey:e?.senderPublicKey,receiverPublicKey:e?.receiverPublicKey}}function n2(e){return 1===e.type&&"string"==typeof e.senderPublicKey&&"string"==typeof e.receiverPublicKey}var n3=Object.defineProperty,n5=Object.getOwnPropertySymbols,n6=Object.prototype.hasOwnProperty,n4=Object.prototype.propertyIsEnumerable,n8=(e,t,r)=>t in e?n3(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,n7=(e,t)=>{for(var r in t||(t={}))n6.call(t,r)&&n8(e,r,t[r]);if(n5)for(var r of n5(t))n4.call(t,r)&&n8(e,r,t[r]);return e};let n9={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"};function ie(){return"u">typeof nV&&"u">typeof nV.versions&&"u">typeof nV.versions.node}
72function it(){return!(0,nH.getDocument)()&&!!(0,nH.getNavigator)()&&"ReactNative"===navigator.product}function ir(){return!ie()&&!!(0,nH.getNavigator)()&&!!(0,nH.getDocument)()}function ii(){return it()?n9.reactNative:ie()?n9.node:ir()?n9.browser:n9.unknown}function is(e,t){return e.filter(e=>t.includes(e)).length===e.length}function io(e){return Object.fromEntries(e.entries())}function ia(e){return new Map(Object.entries(e))}function il(e=rA.FIVE_MINUTES,t){let r,n,i;let s=(0,rA.toMiliseconds)(e||rA.FIVE_MINUTES);return{resolve:e=>{i&&r&&(clearTimeout(i),r(e))},reject:e=>{i&&n&&(clearTimeout(i),n(e))},done:()=>new Promise((e,o)=>{i=setTimeout(()=>{o(Error(t))},s),r=e,n=o})}}function iu(e,t,r){return new Promise(async(n,i)=>{let s=setTimeout(()=>i(Error(r)),t);try{let t=await e;n(t)}catch(e){i(e)}clearTimeout(s)})}function ic(e,t){if("string"==typeof t&&t.startsWith(`${e}:`))return t;if("topic"===e.toLowerCase()){if("string"!=typeof t)throw Error('Value must be "string" for expirer target type: topic');return`topic:${t}`}if("id"===e.toLowerCase()){if("number"!=typeof t)throw Error('Value must be "number" for expirer target type: id');return`id:${t}`}throw Error(`Unknown expirer target type: ${e}`)}function ih(e){let[t,r]=e.split(":"),n={id:void 0,topic:void 0};if("topic"===t&&"string"==typeof r)n.topic=r;else if("id"===t&&Number.isInteger(Number(r)))n.id=Number(r);else throw Error(`Invalid target, expected id:number or topic:string, got ${t}:${r}`);return n}function id(e,t){return(0,rA.fromMiliseconds)((t||Date.now())+(0,rA.toMiliseconds)(e))}function ip(e){return Date.now()>=(0,rA.toMiliseconds)(e)}function ig(e,t){return`${e}${t?`:${t}`:""}`}async function iy({id:e,topic:t,wcDeepLink:n}){try{if(!n)return;let i="string"==typeof n?JSON.parse(n):n,s=i?.href;if("string"!=typeof s)return;s.endsWith("/")&&(s=s.slice(0,-1));let o=`${s}/wc?requestId=${e}&sessionTopic=${t}`,a=ii();a===n9.browser?o.startsWith("https://")?window.open(o,"_blank","noreferrer noopener"):window.open(o,"_self","noreferrer noopener"):a===n9.reactNative&&"u">typeof(null==r.g?void 0:r.g.Linking)&&await r.g.Linking.openURL(o)}catch(e){console.error(e)}}async function im(e,t){try{return await e.getItem(t)||(ir()?localStorage.getItem(t):void 0)}catch(e){console.error(e)}}function iv(e){return e?.relay||{protocol:"irn"}}function ib(e){let t=rk[e];if(typeof t>"u")throw Error(`Relay Protocol not supported: ${e}`);return t}var iw=Object.defineProperty,i_=Object.defineProperties,iE=Object.getOwnPropertyDescriptors,iS=Object.getOwnPropertySymbols,iA=Object.prototype.hasOwnProperty,ik=Object.prototype.propertyIsEnumerable,iC=(e,t,r)=>t in e?iw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,iI=(e,t)=>{for(var r in t||(t={}))iA.call(t,r)&&iC(e,r,t[r]);if(iS)for(var r of iS(t))ik.call(t,r)&&iC(e,r,t[r]);return e},ix=(e,t)=>i_(e,iE(t));function iP(e){var t;let r=(e=(e=e.includes("wc://")?e.replace("wc://",""):e).includes("wc:")?e.replace("wc:",""):e).indexOf(":"),n=-1!==e.indexOf("?")?e.indexOf("?"):void 0,i=e.substring(0,r),s=e.substring(r+1,n).split("@"),o="u">typeof n?e.substring(n):"",a=n$.parse(o);return{protocol:i,topic:(t=s[0]).startsWith("//")?t.substring(2):t,version:parseInt(s[1],10),symKey:a.symKey,relay:function(e,t="-"){let r={},n="relay"+t;return Object.keys(e).forEach(t=>{if(t.startsWith(n)){let i=t.replace(n,""),s=e[t];r[i]=s}}),r}(a),expiryTimestamp:a.expiryTimestamp?parseInt(a.expiryTimestamp,10):void 0}}function iO(e){let t=[];return e.forEach(e=>{let[r,n]=e.split(":");t.push(`${r}:${n}`)}),t}Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;let iT={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}},iR={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function iN(e,t){let{message:r,code:n}=iR[e];return{message:t?`${r} ${t}`:r,code:n}}function iD(e,t){let{message:r,code:n}=iT[e];return{message:t?`${r} ${t}`:r,code:n}}function iB(e,t){return!!Array.isArray(e)&&(!("u">typeof t)||!e.length||e.every(t))}function iM(e){return Object.getPrototypeOf(e)===Object.prototype&&Object.keys(e).length}function iL(e){return typeof e>"u"}function iU(e,t){return!!(t&&iL(e))||"string"==typeof e&&!!e.trim().length}function ij(e,t){return!!(t&&iL(e))||"number"==typeof e&&!isNaN(e)}function iF(e){return!!(iU(e,!1)&&e.includes(":"))&&2===e.split(":").length}function iq(e){let t=!0;return iB(e)?e.length&&(t=e.every(e=>iU(e,!1))):t=!1,t}function iH(e,t){let r=null;
72return Object.values(e).forEach(e=>{var n;let i;if(r)return;let s=(n=`${t}, namespace`,i=null,iq(e?.methods)?iq(e?.events)||(i=iD("UNSUPPORTED_EVENTS",`${n}, events should be an array of strings or empty array for no events`)):i=iD("UNSUPPORTED_METHODS",`${n}, methods should be an array of strings or empty array for no methods`),i);s&&(r=s)}),r}function iz(e,t){let r=null;if(e&&iM(e)){let n;let i=iH(e,t);i&&(r=i);let s=(n=null,Object.values(e).forEach(e=>{var r,i;let s;if(n)return;let o=(r=e?.accounts,i=`${t} namespace`,s=null,iB(r)?r.forEach(e=>{s||function(e){if(iU(e,!1)&&e.includes(":")){let t=e.split(":");if(3===t.length){let e=t[0]+":"+t[1];return!!t[2]&&iF(e)}}return!1}(e)||(s=iD("UNSUPPORTED_ACCOUNTS",`${i}, account ${e} should be a string and conform to "namespace:chainId:address" format`))}):s=iD("UNSUPPORTED_ACCOUNTS",`${i}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),s);o&&(n=o)}),n);s&&(r=s)}else r=iN("MISSING_OR_INVALID",`${t}, namespaces should be an object with data`);return r}function i$(e){return iU(e.protocol,!0)}function iV(e){return"u">typeof e}function iW(e,t){return!(!iF(t)||!(function(e){let t=[];return Object.values(e).forEach(e=>{t.push(...iO(e.accounts))}),t})(e).includes(t))}function iG(e,t,r){let n=null,i=function(e){let t={};return Object.keys(e).forEach(r=>{var n;r.includes(":")?t[r]=e[r]:null==(n=e[r].chains)||n.forEach(n=>{t[n]={methods:e[r].methods,events:e[r].events}})}),t}(e),s=function(e){let t={};return Object.keys(e).forEach(r=>{if(r.includes(":"))t[r]=e[r];else{let n=iO(e[r].accounts);n?.forEach(n=>{t[n]={accounts:e[r].accounts.filter(e=>e.includes(`${n}:`)),methods:e[r].methods,events:e[r].events}})}}),t}(t),o=Object.keys(i),a=Object.keys(s),l=iK(Object.keys(e)),u=iK(Object.keys(t)),c=l.filter(e=>!u.includes(e));return c.length&&(n=iN("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces.
73      Required: ${c.toString()}
74      Received: ${Object.keys(t).toString()}`)),is(o,a)||(n=iN("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces.
75      Required: ${o.toString()}
76      Approved: ${a.toString()}`)),Object.keys(t).forEach(e=>{if(!e.includes(":")||n)return;let i=iO(t[e].accounts);i.includes(e)||(n=iN("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${e}
77        Required: ${e}
78        Approved: ${i.toString()}`))}),o.forEach(e=>{n||(is(i[e].methods,s[e].methods)?is(i[e].events,s[e].events)||(n=iN("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${e}`)):n=iN("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${e}`))}),n}function iK(e){return[...new Set(e.map(e=>e.includes(":")?e.split(":")[0]:e))]}function iJ(){let e=ii();return new Promise(t=>{switch(e){case n9.browser:t(ir()&&navigator?.onLine);break;case n9.reactNative:t(iY());break;case n9.node:default:t(!0)}})}async function iY(){if(it()&&"u">typeof r.g&&null!=r.g&&r.g.NetInfo){let e=await (null==r.g?void 0:r.g.NetInfo.fetch());return e?.isConnected}return!0}let iQ={};class iZ{static get(e){return iQ[e]}static set(e,t){iQ[e]=t}static delete(e){delete iQ[e]}}let iX="INTERNAL_ERROR",i0="SERVER_ERROR",i1=[-32700,-32600,-32601,-32602,-32603],i2={PARSE_ERROR:{code:-32700,message:"Parse error"},INVALID_REQUEST:{code:-32600,message:"Invalid Request"},METHOD_NOT_FOUND:{code:-32601,message:"Method not found"},INVALID_PARAMS:{code:-32602,message:"Invalid params"},[iX]:{code:-32603,message:"Internal error"},[i0]:{code:-32e3,message:"Server error"}};function i3(e){return Object.keys(i2).includes(e)?i2[e]:i2[i0]}function i5(e,t,r){return e.message.includes("getaddrinfo ENOTFOUND")||e.message.includes("connect ECONNREFUSED")?Error(`Unavailable ${r} RPC url at ${t}`):e}var i6=r(60092);
78function i4(e=3){return Date.now()*Math.pow(10,e)+Math.floor(Math.random()*Math.pow(10,e))}function i8(e=6){return BigInt(i4(e))}function i7(e,t,r){return{id:r||i4(),jsonrpc:"2.0",method:e,params:t}}function i9(e,t){return{id:e,jsonrpc:"2.0",result:t}}function se(e,t,r){var n,i,s;return{id:e,jsonrpc:"2.0",error:void 0===(n=t)?i3(iX):("string"==typeof n&&(n=Object.assign(Object.assign({},i3(i0)),{message:n})),void 0!==r&&(n.data=r),i=n.code,i1.includes(i)&&(s=n.code,n=Object.values(i2).find(e=>e.code===s)||i2[i0]),n)}}class st{}class sr extends st{constructor(){super()}}class sn extends sr{constructor(e){super()}}function si(e,t){let r=function(e){let t=e.match(RegExp(/^\w+:/,"gi"));if(t&&t.length)return t[0]}(e);return void 0!==r&&new RegExp(t).test(r)}function ss(e){return si(e,"^https?:")}function so(e){return si(e,"^wss?:")}function sa(e){return"object"==typeof e&&"id"in e&&"jsonrpc"in e&&"2.0"===e.jsonrpc}function sl(e){return sa(e)&&"method"in e}function su(e){return sa(e)&&(sc(e)||sh(e))}function sc(e){return"result"in e}function sh(e){return"error"in e}class sd extends sn{constructor(e){super(e),this.events=new e2.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async request(e,t){return this.requestStrict(i7(e.method,e.params||[],e.id||i8().toString()),t)}async requestStrict(e,t){return new Promise(async(r,n)=>{if(!this.connection.connected)try{await this.open()}catch(e){n(e)}this.events.on(`${e.id}`,e=>{sh(e)?n(e.error):r(e.result)});try{await this.connection.send(e,t)}catch(e){n(e)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),su(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&3e3===e.code&&this.events.emit("error",Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),"string"==typeof e&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}}let sf=()=>"u">typeof WebSocket||"u">typeof r.g&&"u">typeof r.g.WebSocket||"u">typeof window&&"u">typeof window.WebSocket||"u">typeof self&&"u">typeof self.WebSocket,sp=e=>e.split("?")[0],sg="u">typeof WebSocket?WebSocket:"u">typeof r.g&&"u">typeof r.g.WebSocket?r.g.WebSocket:"u">typeof window&&"u">typeof window.WebSocket?window.WebSocket:"u">typeof self&&"u">typeof self.WebSocket?self.WebSocket:r(7035);class sy{constructor(e){if(this.url=e,this.events=new e2.EventEmitter,this.registering=!1,!so(e))throw Error(`Provided URL is not compatible with WebSocket connection: ${e}`);this.url=e}get connected(){return"u">typeof this.socket}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,t)=>{if(typeof this.socket>"u"){t(Error("Connection already closed"));return}this.socket.onclose=t=>{this.onClose(t),e()},this.socket.close()})}async send(e){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(rJ(e))}catch(t){this.onError(e.id,t)}}register(e=this.url){if(!so(e))throw Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){let e=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=e||this.events.listenerCount("open")>=e)&&this.events.setMaxListeners(e+1),new Promise((e,t)=>
78{this.events.once("register_error",e=>{this.resetMaxListeners(),t(e)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return t(Error("WebSocket connection is missing or invalid"));e(this.socket)})})}return this.url=e,this.registering=!0,new Promise((t,r)=>{let n=new URLSearchParams(e).get("origin"),i=(0,i6.isReactNative)()?{headers:{origin:n}}:{rejectUnauthorized:!RegExp("wss?://localhost(:d{2,5})?").test(e)},s=new sg(e,[],i);sf()?s.onerror=e=>{r(this.emitError(e.error))}:s.on("error",e=>{r(this.emitError(e))}),s.onopen=()=>{this.onOpen(s),t(s)}})}onOpen(e){e.onmessage=e=>this.onPayload(e),e.onclose=e=>this.onClose(e),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}onPayload(e){if(typeof e.data>"u")return;let t="string"==typeof e.data?rK(e.data):e.data;this.events.emit("payload",t)}onError(e,t){let r=this.parseError(t),n=se(e,r.message||r.toString());this.events.emit("payload",n)}parseError(e,t=this.url){return i5(e,sp(t),"WS")}resetMaxListeners(){this.events.getMaxListeners()>10&&this.events.setMaxListeners(10)}emitError(e){let t=this.parseError(Error(e?.message||`WebSocket connection failed for host: ${sp(this.url)}`));return this.events.emit("register_error",t),t}}var sm=r(8355),sv=r.n(sm),sb=r(41019),sw=r.n(sb),s_=r(20357),sE=function(e,t){if(e.length>=255)throw TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<e.length;i++){var s=e.charAt(i),o=s.charCodeAt(0);if(255!==r[o])throw TypeError(s+" is ambiguous");r[o]=i}var a=e.length,l=e.charAt(0),u=Math.log(a)/Math.log(256),c=Math.log(256)/Math.log(a);function h(e){if("string"!=typeof e)throw TypeError("Expected String");if(0===e.length)return new Uint8Array;var t=0;if(" "!==e[0]){for(var n=0,i=0;e[t]===l;)n++,t++;for(var s=(e.length-t)*u+1>>>0,o=new Uint8Array(s);e[t];){var c=r[e.charCodeAt(t)];if(255===c)return;for(var h=0,d=s-1;(0!==c||h<i)&&-1!==d;d--,h++)c+=a*o[d]>>>0,o[d]=c%256>>>0,c=c/256>>>0;if(0!==c)throw Error("Non-zero carry");i=h,t++}if(" "!==e[t]){for(var f=s-i;f!==s&&0===o[f];)f++;for(var p=new Uint8Array(n+(s-f)),g=n;f!==s;)p[g++]=o[f++];return p}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,n=0,i=0,s=t.length;i!==s&&0===t[i];)i++,r++;for(var o=(s-i)*c+1>>>0,u=new Uint8Array(o);i!==s;){for(var h=t[i],d=0,f=o-1;(0!==h||d<n)&&-1!==f;f--,d++)h+=256*u[f]>>>0,u[f]=h%a>>>0,h=h/a>>>0;if(0!==h)throw Error("Non-zero carry");n=d,i++}for(var p=o-n;p!==o&&0===u[p];)p++;for(var g=l.repeat(r);p<o;++p)g+=e.charAt(u[p]);return g},decodeUnsafe:h,decode:function(e){var r=h(e);if(r)return r;throw Error(`Non-${t} character`)}}};let sS=e=>{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error("Unknown type, must be binary type")},sA=e=>new TextEncoder().encode(e),sk=e=>new TextDecoder().decode(e);class sC{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class sI{constructor(e,t,r){if(this.name=e,this.prefix=t,void 0===t.codePointAt(0))throw Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=r}decode(e){if("string"==typeof e){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(e){return sP(this,e)}}class sx{constructor(e){this.decoders=e}or(e){return sP(this,e)}decode(e){let t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}
78, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}let sP=(e,t)=>new sx({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class sO{constructor(e,t,r,n){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=n,this.encoder=new sC(e,t,r),this.decoder=new sI(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}let sT=({name:e,prefix:t,encode:r,decode:n})=>new sO(e,t,r,n),sR=({prefix:e,name:t,alphabet:r})=>{let{encode:n,decode:i}=sE(r,t);return sT({prefix:e,name:t,encode:n,decode:e=>sS(i(e))})},sN=(e,t,r,n)=>{let i={};for(let e=0;e<t.length;++e)i[t[e]]=e;let s=e.length;for(;"="===e[s-1];)--s;let o=new Uint8Array(s*r/8|0),a=0,l=0,u=0;for(let t=0;t<s;++t){let s=i[e[t]];if(void 0===s)throw SyntaxError(`Non-${n} character`);l=l<<r|s,(a+=r)>=8&&(a-=8,o[u++]=255&l>>a)}if(a>=r||255&l<<8-a)throw SyntaxError("Unexpected end of data");return o},sD=(e,t,r)=>{let n="="===t[t.length-1],i=(1<<r)-1,s="",o=0,a=0;for(let n=0;n<e.length;++n)for(a=a<<8|e[n],o+=8;o>r;)o-=r,s+=t[i&a>>o];if(o&&(s+=t[i&a<<r-o]),n)for(;s.length*r&7;)s+="=";return s},sB=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>sT({prefix:t,name:e,encode:e=>sD(e,n,r),decode:t=>sN(t,n,r,e)});var sM=Object.freeze({__proto__:null,identity:sT({prefix:"\0",name:"identity",encode:e=>sk(e),decode:e=>sA(e)})}),sL=Object.freeze({__proto__:null,base2:sB({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1})}),sU=Object.freeze({__proto__:null,base8:sB({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3})}),sj=Object.freeze({__proto__:null,base10:sR({prefix:"9",name:"base10",alphabet:"0123456789"})}),sF=Object.freeze({__proto__:null,base16:sB({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),base16upper:sB({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4})});let sq=sB({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),sH=sB({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),sz=sB({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),s$=sB({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),sV=sB({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),sW=sB({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5});var sG=Object.freeze({__proto__:null,base32:sq,base32upper:sH,base32pad:sz,base32padupper:s$,base32hex:sV,base32hexupper:sW,base32hexpad:sB({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),base32hexpadupper:sB({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z:sB({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5})}),sK=Object.freeze({__proto__:null,base36:sR({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper:sR({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"})}),sJ=Object.freeze({__proto__:null,base58btc:sR({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr:sR({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"})});let sY=sB({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6});var sQ=Object.freeze({__proto__:null,base64:sY,base64pad:sB({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url:sB({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad:sB({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6})});let sZ=Array.from("\uD83D\uDE80\uD83E\uDE90☄\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☀\uD83D\uDCBB\uD83D\uDDA5\uD83D\uDCBE\uD83D\uDCBF\uD83D\uDE02❤\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☺\uD83D\uDC4C\uD83E\uDD17\uD83D\uDC9C\uD83D\uDE14\uD83D\uDE0E\uD83D\uDE07\uD83C\uDF39\uD83E\uDD26\uD83C\uDF89\uD83D\uDC9E✌✨\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❣\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✋\uD83D\uDE1A\uD83D\uDE1D\uD83D\uDE34\uD83C\uDF1F\uD83D\uDE2C\uD83D\uDE43\uD83C\uDF40\uD83C\uDF37\uD83D\uDE3B\uD83D\uDE13⭐✅\uD83E\uDD7A\uD83C\uDF08\uD83D\uDE08\uD83E\uDD18\uD83D\uDCA6✔\uD83D\uDE23\uD83C\uDFC3\uD83D\uDC90☹\uD83C\uDF8A\uD83D\uDC98\uD83D\uDE20☝\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⚽\uD83E\uDD19☕\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⚡\uD83C\uDF1E\uD83C\uDF88❌✊\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✈\uD83C\uDF80\uD83C\uDF7A\uD83E\uDD13\uD83D\uDE19\uD83D\uDC9F\uD83C\uDF31\uD83D\uDE16\uD83D\uDC76\uD83E\uDD74▶➡❓\uD83D\uDC8E\uD83D\uDCB8⬇\uD83D\uDE28\uD83C\uDF1A\uD83E\uDD8B\uD83D\uDE37\uD83D\uDD7A⚠\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☎\uD83D\uDCA7\uD83D\uDE2F\uD83D\uDC86\uD83D\uDC46\uD83C\uDFA4\uD83D\uDE47\uD83C\uDF51❄\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"),sX=s
78Z.reduce((e,t,r)=>(e[r]=t,e),[]),s0=sZ.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]);var s1=Object.freeze({__proto__:null,base256emoji:sT({prefix:"\uD83D\uDE80",name:"base256emoji",encode:function(e){return e.reduce((e,t)=>e+=sX[t],"")},decode:function(e){let t=[];for(let r of e){let e=s0[r.codePointAt(0)];if(void 0===e)throw Error(`Non-base256emoji character: ${r}`);t.push(e)}return new Uint8Array(t)}})});function s2(e,t){var r,n=0,t=t||0,i=0,s=t,o=e.length;do{if(s>=o)throw s2.bytes=0,RangeError("Could not decode varint");r=e[s++],n+=i<28?(127&r)<<i:(127&r)*Math.pow(2,i),i+=7}while(r>=128);return s2.bytes=s-t,n}var s3=function e(t,r,n){r=r||[],n=n||0;for(var i=n;t>=2147483648;)r[n++]=255&t|128,t/=128;for(;-128&t;)r[n++]=255&t|128,t>>>=7;return r[n]=0|t,e.bytes=n-i+1,r};let s5=(e,t,r=0)=>(s3(e,t,r),t),s6=e=>e<128?1:e<16384?2:e<2097152?3:e<268435456?4:e<34359738368?5:e<4398046511104?6:e<562949953421312?7:e<72057594037927940?8:e<0x7fffffffffffffff?9:10,s4=(e,t)=>{let r=t.byteLength,n=s6(e),i=n+s6(r),s=new Uint8Array(i+r);return s5(e,s,0),s5(r,s,n),s.set(t,i),new s8(e,r,t,s)};class s8{constructor(e,t,r,n){this.code=e,this.size=t,this.digest=r,this.bytes=n}}let s7=({name:e,code:t,encode:r})=>new s9(e,t,r);class s9{constructor(e,t,r){this.name=e,this.code=t,this.encode=r}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?s4(this.code,t):t.then(e=>s4(this.code,e))}throw Error("Unknown type, must be binary type")}}let oe=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t));var ot=Object.freeze({__proto__:null,sha256:s7({name:"sha2-256",code:18,encode:oe("SHA-256")}),sha512:s7({name:"sha2-512",code:19,encode:oe("SHA-512")})}),or=Object.freeze({__proto__:null,identity:{code:0,name:"identity",encode:sS,digest:e=>s4(0,sS(e))}});new TextEncoder,new TextDecoder;let on={...sM,...sL,...sU,...sj,...sF,...sG,...sK,...sJ,...sQ,...s1};function oi(e){return null!=globalThis.Buffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function os(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}({...ot,...or});let oo=os("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),oa=os("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{let t=function(e=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?oi(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}((e=e.substring(1)).length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),ol={utf8:oo,"utf-8":oo,hex:on.base16,latin1:oa,ascii:oa,binary:oa,...on},ou="core",oc=`wc@2:${ou}:`,oh={logger:"error"},od={database:":memory:"},of="client_ed25519_seed",op=rA.ONE_DAY,og=rA.SIX_HOURS,oy="wss://relay.walletconnect.com",om="wss://relay.walletconnect.org",ov={message:"relayer_message",message_ack:"relayer_message_ack",connect:"relayer_connect",disconnect:"relayer_disconnect",error:"relayer_error",connection_stalled:"relayer_connection_stalled",publish:"relayer_publish"},ob={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},ow=rA.ONE_SECOND,o_={created:"subscription_created",deleted:"subscription_deleted",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},oE=1e3*rA.FIVE_SECONDS,oS={wc_pairingDelete:{req:{ttl:rA.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:rA.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:rA.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:rA.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:rA.ONE_DAY,prompt:!1,tag:0},res:{ttl:rA.ONE_DAY,prompt:!1,tag:0}}},oA={create:"pairing_create",expire:"pairing_expire",delete:"pairing_delete",ping:"pairing_ping"},ok={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},oC={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},oI="verify-api",ox="https://verify.walletconnect.com",oP="https://verify.walletconnect.org",oO=[ox,oP];class oT{constructor(e,t){this.core=e,this.logger=t,this.keychain=new Map,this.name="keychain",this.version="0.3",this.initialized=!1,this.storagePrefix=oc,this.init=async()=>
78{if(!this.initialized){let e=await this.getKeyChain();"u">typeof e&&(this.keychain=e),this.initialized=!0}},this.has=e=>(this.isInitialized(),this.keychain.has(e)),this.set=async(e,t)=>{this.isInitialized(),this.keychain.set(e,t),await this.persist()},this.get=e=>{this.isInitialized();let t=this.keychain.get(e);if(typeof t>"u"){let{message:t}=iN("NO_MATCHING_KEY",`${this.name}: ${e}`);throw Error(t)}return t},this.del=async e=>{this.isInitialized(),this.keychain.delete(e),await this.persist()},this.core=e,this.logger=nh(t,this.name)}get context(){return nc(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,io(e))}async getKeyChain(){let e=await this.core.storage.getItem(this.storageKey);return"u">typeof e?ia(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){let{message:e}=iN("NOT_INITIALIZED",this.name);throw Error(e)}}}class oR{constructor(e,t,r){this.core=e,this.logger=t,this.name="crypto",this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=e=>(this.isInitialized(),this.keychain.has(e)),this.getClientId=async()=>(this.isInitialized(),nP(nO(await this.getClientSeed()).publicKey)),this.generateKeyPair=()=>{this.isInitialized();let e=function(){let e=e7.Au();return{privateKey:rS(e.secretKey,nK),publicKey:rS(e.publicKey,nK)}}();return this.setPrivateKey(e.publicKey,e.privateKey)},this.signJWT=async e=>{this.isInitialized();let t=nO(await this.getClientSeed()),r=nQ();return await nT(r,e,op,t)},this.generateSharedKey=(e,t,r)=>{this.isInitialized();let n=function(e,t){let r=e7.gi(rE(e,nK),rE(t,nK),!0);return rS(new e6.t(e8.mE,r).expand(32),nK)}(this.getPrivateKey(e),t);return this.setSymKey(n,r)},this.setSymKey=async(e,t)=>{this.isInitialized();let r=t||rS((0,e8.vp)(rE(e,nK)),nK);return await this.keychain.set(r,e),r},this.deleteKeyPair=async e=>{this.isInitialized(),await this.keychain.del(e)},this.deleteSymKey=async e=>{this.isInitialized(),await this.keychain.del(e)},this.encode=async(e,t,r)=>{this.isInitialized();let n=n1(r),i=rJ(t);if(n2(n)){let t=n.senderPublicKey,r=n.receiverPublicKey;e=await this.generateSharedKey(t,r)}let s=this.getSymKey(e),{type:o,senderPublicKey:a}=n;return function(e){var t;let r=(t="u">typeof e.type?e.type:0,rE(`${t}`,nG));if(1===nX(r)&&typeof e.senderPublicKey>"u")throw Error("Missing sender public key for type 1 envelope");let n="u">typeof e.senderPublicKey?rE(e.senderPublicKey,nK):void 0,i="u">typeof e.iv?rE(e.iv,nK):(0,e4.randomBytes)(12);return function(e){if(1===nX(e.type)){if(typeof e.senderPublicKey>"u")throw Error("Missing sender public key for type 1 envelope");return rS(tt([e.type,e.senderPublicKey,e.iv,e.sealed]),nJ)}return rS(tt([e.type,e.iv,e.sealed]),nJ)}({type:r,sealed:new e5.OK(rE(e.symKey,nK)).seal(i,rE(e.message,nY)),iv:i,senderPublicKey:n})}({type:o,symKey:s,message:i,senderPublicKey:a})},this.decode=async(e,t,r)=>{this.isInitialized();let n=function(e,t){let r=n0(e);return n1({type:nX(r.type),senderPublicKey:"u">typeof r.senderPublicKey?rS(r.senderPublicKey,nK):void 0,receiverPublicKey:t?.receiverPublicKey})}(t,r);if(n2(n)){let t=n.receiverPublicKey,r=n.senderPublicKey;e=await this.generateSharedKey(t,r)}try{let r=this.getSymKey(e),n=function(e){let t=new e5.OK(rE(e.symKey,nK)),{sealed:r,iv:n}=n0(e.encoded),i=t.open(n,r);if(null===i)throw Error("Failed to decrypt");return rS(i,nY)}({symKey:r,encoded:t});return rK(n)}catch(t){this.logger.error(`Failed to decode message from topic: '${e}', clientId: '${await this.getClientId()}'`),this.logger.error(t)}},this.getPayloadType=e=>nX(n0(e).type),this.getPayloadSenderPublicKey=e=>{let t=n0(e);return t.senderPublicKey?rS(t.senderPublicKey,nK):void 0},this.core=e,this.logger=nh(t,this.name),this.keychain=r||new oT(this.core,this.logger)}get context(){return nc(this.logger)}async setPrivateKey(e,t){return await this.keychain.set(e,t),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(of)}catch{e=nQ(),await this.keychain.set(of,e)}return function(e,t="utf8"){let r=ol[t];if(!r)throw Error(`Unsupported encoding "${t}"`);return("utf8"===t||"utf-8"===t)&&null!=globalThis.Buffer&&null!=globalThis.Buffer.from?oi(globalThis.Buffer.from(e,"utf-8")):r.decoder.decode(`${r.prefix}${e}`)}(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){let{message:e}=iN("NOT_INITIALIZED",this.name);throw Error(e)}}}class oN extends ng{constructor(e,t){super(e,t),this.logger=e,this.core=t,this.messages=new Map,this.name="messages",this.version="0.3",this.initialized=!1,this.storagePrefix=oc,this.init=async()=>
78{if(!this.initialized){this.logger.trace("Initialized");try{let e=await this.getRelayerMessages();"u">typeof e&&(this.messages=e),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}finally{this.initialized=!0}}},this.set=async(e,t)=>{this.isInitialized();let r=nZ(t),n=this.messages.get(e);return typeof n>"u"&&(n={}),"u">typeof n[r]||(n[r]=t,this.messages.set(e,n),await this.persist()),r},this.get=e=>{this.isInitialized();let t=this.messages.get(e);return typeof t>"u"&&(t={}),t},this.has=(e,t)=>(this.isInitialized(),"u">typeof this.get(e)[nZ(t)]),this.del=async e=>{this.isInitialized(),this.messages.delete(e),await this.persist()},this.logger=nh(e,this.name),this.core=t}get context(){return nc(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,io(e))}async getRelayerMessages(){let e=await this.core.storage.getItem(this.storageKey);return"u">typeof e?ia(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){let{message:e}=iN("NOT_INITIALIZED",this.name);throw Error(e)}}}class oD extends ny{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.events=new e2.EventEmitter,this.name="publisher",this.queue=new Map,this.publishTimeout=(0,rA.toMiliseconds)(2*rA.TEN_SECONDS),this.needsTransportRestart=!1,this.publish=async(e,t,r)=>{var n;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:e,message:t,opts:r}});try{let i=r?.ttl||og,s=iv(r),o=r?.prompt||!1,a=r?.tag||0,l=r?.id||i8().toString(),u={topic:e,message:t,opts:{ttl:i,relay:s,prompt:o,tag:a,id:l}},c=setTimeout(()=>this.queue.set(l,u),this.publishTimeout);try{await await iu(this.rpcPublish(e,t,i,s,o,a,l),this.publishTimeout,`Failed to publish payload, please try again. id:${l} tag:${a}`),this.removeRequestFromQueue(l),this.relayer.events.emit(ov.publish,u)}catch(e){if(this.logger.debug("Publishing Payload stalled"),this.needsTransportRestart=!0,null!=(n=r?.internal)&&n.throwOnFailedPublish)throw this.removeRequestFromQueue(l),e;return}finally{clearTimeout(c)}this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:e,message:t,opts:r}})}catch(e){throw this.logger.debug("Failed to Publish Payload"),this.logger.error(e),e}},this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.relayer=e,this.logger=nh(t,this.name),this.registerEventListeners()}get context(){return nc(this.logger)}rpcPublish(e,t,r,n,i,s,o){var a,l,u,c;let h={method:ib(n.protocol).publish,params:{topic:e,message:t,ttl:r,prompt:i,tag:s},id:o};return iL(null==(a=h.params)?void 0:a.prompt)&&(null==(l=h.params)||delete l.prompt),iL(null==(u=h.params)?void 0:u.tag)&&(null==(c=h.params)||delete c.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:h}),this.relayer.request(h)}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async e=>{let{topic:t,message:r,opts:n}=e;await this.publish(t,r,n)})}registerEventListeners(){this.relayer.core.heartbeat.on(r6.HEARTBEAT_EVENTS.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(ov.connection_stalled);return}this.checkQueue()}),this.relayer.on(ov.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}}class oB{constructor(){this.map=new Map,this.set=(e,t)=>{let r=this.get(e);this.exists(e,t)||this.map.set(e,[...r,t])},this.get=e=>this.map.get(e)||[],this.exists=(e,t)=>this.get(e).includes(t),this.delete=(e,t)=>{if(typeof t>"u"){this.map.delete(e);return}if(!this.map.has(e))return;let r=this.get(e);if(!this.exists(e,t))return;let n=r.filter(e=>e!==t);if(!n.length){this.map.delete(e);return}this.map.set(e,n)},this.clear=()=>{this.map.clear()}}
78get topics(){return Array.from(this.map.keys())}}var oM=Object.defineProperty,oL=Object.defineProperties,oU=Object.getOwnPropertyDescriptors,oj=Object.getOwnPropertySymbols,oF=Object.prototype.hasOwnProperty,oq=Object.prototype.propertyIsEnumerable,oH=(e,t,r)=>t in e?oM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,oz=(e,t)=>{for(var r in t||(t={}))oF.call(t,r)&&oH(e,r,t[r]);if(oj)for(var r of oj(t))oq.call(t,r)&&oH(e,r,t[r]);return e},o$=(e,t)=>oL(e,oU(t));class oV extends nb{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.subscriptions=new Map,this.topicMap=new oB,this.events=new e2.EventEmitter,this.name="subscription",this.version="0.3",this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=oc,this.subscribeTimeout=1e4,this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),this.clientId=await this.relayer.core.crypto.getClientId())},this.subscribe=async(e,t)=>{await this.restartToComplete(),this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:e,opts:t}});try{let r=iv(t),n={topic:e,relay:r};this.pending.set(e,n);let i=await this.rpcSubscribe(e,r);return this.onSubscribe(i,n),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:e,opts:t}}),i}catch(e){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(e),e}},this.unsubscribe=async(e,t)=>{await this.restartToComplete(),this.isInitialized(),"u">typeof t?.id?await this.unsubscribeById(e,t.id,t):await this.unsubscribeByTopic(e,t)},this.isSubscribed=async e=>{if(this.topics.includes(e))return!0;let t=`${this.pendingSubscriptionWatchLabel}_${e}`;return await new Promise((r,n)=>{let i=new rA.Watch;i.start(t);let s=setInterval(()=>{!this.pending.has(e)&&this.topics.includes(e)&&(clearInterval(s),i.stop(t),r(!0)),i.elapsed(t)>=oE&&(clearInterval(s),i.stop(t),n(Error("Subscription resolution timeout")))},this.pollingInterval)}).catch(()=>!1)},this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=e,this.logger=nh(t,this.name),this.clientId=""}get context(){return nc(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(e,t){let r=!1;try{r=this.getSubscription(e).topic===t}catch{}return r}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,t){let r=this.topicMap.get(e);await Promise.all(r.map(async r=>await this.unsubscribeById(e,r,t)))}async unsubscribeById(e,t,r){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:r}});try{let n=iv(r);await this.rpcUnsubscribe(e,t,n);let i=iD("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,t,i),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:r}})}catch(e){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(e),e}}async rpcSubscribe(e,t){let r={method:ib(t.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:r});try{await await iu(this.relayer.request(r),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(ov.connection_stalled)}return nZ(e+this.clientId)}async rpcBatchSubscribe(e){if(!e.length)return;let t={method:ib(e[0].relay.protocol).batchSubscribe,params:{topics:e.map(e=>e.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:t});try{return await await iu(this.relayer.request(t),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Payload stalled"),this.relayer.events.emit(ov.connection_stalled)}}rpcUnsubscribe(e,t,r){let n={method:ib(r.protocol).unsubscribe,params:{topic:e,id:t}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n}),this.relayer.request(n)}onSubscribe(e,t){this.setSubscription(e,o$(oz({},t),{id:e})),this.pending.delete(t.topic)}
78onBatchSubscribe(e){e.length&&e.forEach(e=>{this.setSubscription(e.id,oz({},e)),this.pending.delete(e.topic)})}async onUnsubscribe(e,t,r){this.events.removeAllListeners(t),this.hasSubscription(t,e)&&this.deleteSubscription(t,r),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,t){this.subscriptions.has(e)||(this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:t}),this.addSubscription(e,t))}addSubscription(e,t){this.subscriptions.set(e,oz({},t)),this.topicMap.set(t.topic,e),this.events.emit(o_.created,t)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});let t=this.subscriptions.get(e);if(!t){let{message:t}=iN("NO_MATCHING_KEY",`${this.name}: ${e}`);throw Error(t)}return t}deleteSubscription(e,t){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:t});let r=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(r.topic,e),this.events.emit(o_.deleted,o$(oz({},r),{reason:t}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(o_.sync)}async reset(){if(this.cached.length){let e=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let t=0;t<e;t++){let e=this.cached.splice(0,this.batchSubscribeTopicsLimit);await this.batchSubscribe(e)}}this.events.emit(o_.resubscribed)}async restore(){try{let e=await this.getRelayerSubscriptions();if(typeof e>"u"||!e.length)return;if(this.subscriptions.size){let{message:e}=iN("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){if(!e.length)return;let t=await this.rpcBatchSubscribe(e);iB(t)&&this.onBatchSubscribe(t.map((t,r)=>o$(oz({},e[r]),{id:t})))}async onConnect(){this.restartInProgress||(await this.restart(),this.onEnable())}onDisconnect(){this.onDisable()}async checkPending(){if(!this.initialized||this.relayer.transportExplicitlyClosed)return;let e=[];this.pending.forEach(t=>{e.push(t)}),await this.batchSubscribe(e)}registerEventListeners(){this.relayer.core.heartbeat.on(r6.HEARTBEAT_EVENTS.pulse,async()=>{await this.checkPending()}),this.relayer.on(ov.connect,async()=>{await this.onConnect()}),this.relayer.on(ov.disconnect,()=>{this.onDisconnect()}),this.events.on(o_.created,async e=>{let t=o_.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()}),this.events.on(o_.deleted,async e=>{let t=o_.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()})}isInitialized(){if(!this.initialized){let{message:e}=iN("NOT_INITIALIZED",this.name);throw Error(e)}}async restartToComplete(){this.restartInProgress&&await new Promise(e=>{let t=setInterval(()=>{this.restartInProgress||(clearInterval(t),e())},this.pollingInterval)})}}var oW=Object.defineProperty,oG=Object.getOwnPropertySymbols,oK=Object.prototype.hasOwnProperty,oJ=Object.prototype.propertyIsEnumerable,oY=(e,t,r)=>t in e?oW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,oQ=(e,t)=>{for(var r in t||(t={}))oK.call(t,r)&&oY(e,r,t[r]);if(oG)for(var r of oG(t))oJ.call(t,r)&&oY(e,r,t[r]);return e};class oZ extends nm{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new e2.EventEmitter,this.name="relayer",this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","socket stalled"],this.hasExperiencedNetworkDisruption=!1,this.requestsInFlight=new Map,this.request=async e=>{this.logger.debug("Publishing Request Payload");let t=e.id;try{await this.toEstablishConnection();let r=this.provider.request(e);return this.requestsInFlight.set(t,{promise:r,request:e}),await r}catch(e){throw this.logger.debug("Failed to Publish Request"),this.logger.error(e),e}finally{this.requestsInFlight.delete(t)}},this.onPayloadHandler=e=>{this.onProviderPayload(e)},this.onConnectHandler=()=>{this.events.emit(ov.connect)},this.onDisconnectHandler=()=>{this.onProviderDisconnect()},this.onProviderErrorHandler=e=>{this.logger.error(e),this.events.emit(ov.error,e),this.logger.info("Fatal socket error received, closing transport"),this.transportClose()},this.registerProviderListeners=()=>{this.provider.on(ob.payload,this.onPayloadHandler),this.provider.on(ob.connect,this.onConnectHandler),this.provider.on(ob.disconnect,this.onDisconnectHandler),this.provider.on(ob.error,this.onProviderErrorHandler)},this.core=e.core,this.logger="u">typeof e.logger&&"string"!=typeof e.logger?nh(e.logger,this.name):r8()(nu({level:e.logger||"error"})),this.messages=new oN(this.logger,e.core),this.subscriber=new oV(this,this.logger),this.publisher=new oD(this,this.logger),this.relayUrl=e?.relayUrl||oy,this.projectId=e.projectId,this.bundleId=function(){var e;try{return it()&&"u">typeof r.g&&"u">typeof(null==r.g?void 0:r.g.Application)?null==(e=r.g.Application)?void 0:e.applicationId:void 0}catch{return}}(),this.provider={}}
78async init(){this.logger.trace("Initialized"),this.registerEventListeners(),await this.createProvider(),await Promise.all([this.messages.init(),this.subscriber.init()]);try{await this.transportOpen()}catch{this.logger.warn(`Connection via ${this.relayUrl} failed, attempting to connect via failover domain ${om}...`),await this.restartTransport(om)}this.initialized=!0,setTimeout(async()=>{0===this.subscriber.topics.length&&(this.logger.info("No topics subscribed to after init, closing transport"),await this.transportClose(),this.transportExplicitlyClosed=!1)},1e4)}get context(){return nc(this.logger)}get connected(){return this.provider.connection.connected}get connecting(){return this.provider.connection.connecting}async publish(e,t,r){this.isInitialized(),await this.publisher.publish(e,t,r),await this.recordMessageEvent({topic:e,message:t,publishedAt:Date.now()})}async subscribe(e,t){var r;let n;this.isInitialized();let i=(null==(r=this.subscriber.topicMap.get(e))?void 0:r[0])||"";if(i)return i;let s=t=>{t.topic===e&&(this.subscriber.off(o_.created,s),n())};return await Promise.all([new Promise(e=>{n=e,this.subscriber.on(o_.created,s)}),new Promise(async r=>{i=await this.subscriber.subscribe(e,t),r()})]),i}async unsubscribe(e,t){this.isInitialized(),await this.subscriber.unsubscribe(e,t)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async transportClose(){this.requestsInFlight.size>0&&(this.logger.debug("Waiting for all in-flight requests to finish before closing transport..."),this.requestsInFlight.forEach(async e=>{await e.promise})),this.transportExplicitlyClosed=!0,this.hasExperiencedNetworkDisruption&&this.connected?await iu(this.provider.disconnect(),1e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.connected&&await this.provider.disconnect()}async transportOpen(e){if(this.transportExplicitlyClosed=!1,await this.confirmOnlineStateOrThrow(),!this.connectionAttemptInProgress){e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportClose(),await this.createProvider()),this.connectionAttemptInProgress=!0;try{await Promise.all([new Promise(e=>{if(!this.initialized)return e();this.subscriber.once(o_.resubscribed,()=>{e()})}),new Promise(async(e,t)=>{try{await iu(this.provider.connect(),1e4,`Socket stalled when trying to connect to ${this.relayUrl}`)}catch(e){t(e);return}e()})])}catch(e){if(this.logger.error(e),!this.isConnectionStalled(e.message))throw e;this.provider.events.emit(ob.disconnect)}finally{this.connectionAttemptInProgress=!1,this.hasExperiencedNetworkDisruption=!1}}}async restartTransport(e){await this.confirmOnlineStateOrThrow(),this.connectionAttemptInProgress||(this.relayUrl=e||this.relayUrl,await this.transportClose(),await this.createProvider(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await iJ())throw Error("No internet connection detected. Please restart your network and try again.")}isConnectionStalled(e){return this.staleConnectionErrors.some(t=>e.includes(t))}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();let e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new sd(new sy(function({protocol:e,version:t,relayUrl:n,sdkVersion:i,auth:s,projectId:o,useOnCloseEvent:a,bundleId:l}){var u,c;let h;let d=n.split("?"),f=function(e,t,n){let i=function(){if(ii()===n9.reactNative&&"u">typeof r.g&&"u">typeof(null==r.g?void 0:r.g.Platform)){let{OS:e,Version:t}=r.g.Platform;return[e,t].join("-")}let e="undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product?new nU:"undefined"!=typeof navigator?function(e){var t=""!==e&&nF.reduce(function(t,r){var n=r[0],i=r[1];if(t)return t;var s=i.exec(e);return!!s&&[n,s]},!1);if(!t)return null;var r=t[0],n=t[1];if("searchbot"===r)return new nL;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<3&&(i=nN(nN([],i,!0),function(e){for(var t=[],r=0;r<e;r++)t.push("0");return t}(3-i.length),!0)):i=[];var s=i.join("."),o=function(e){for(var t=0,r=nq.length;t<r;t++){var n=nq[t],i=n[0];if(n[1].exec(e))return i}return null}(e),a=nj.exec(e);return a&&a[1]?new nM(r,s,o,a[1]):new nD(r,s,o)}(navigator.userAgent):void 0!==nR&&nR.version?new nB(nR.version.slice(1)):null;if(null===e)return"unknown";let t=e.os?e.os.replace(" ","").toLowerCase():"unknown";return"browser"===e.type?[t,e.name,e.version].join("-"):[t,e.version].join("-")}(),s=function(){var e;let t=ii();return t===n9.browser?[t,(null==(e=(0,nH.getLocation)())?void 0:e.host)||"unknown"].join(":"):t}();return[[e,t].join("-"),["js",n].join("-"),i,s].join("/")}(e,t,i),p=(u=d[1]||"",c={auth:s,ua:f,projectId:o,useOnCloseEvent:a||void 0,origin:l||void 0},h=n7(n7({},h=n$.parse(u)),c),u=n$.stringify(h));return d[0]+"?"+p}({sdkVersion:"2.11.2",protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0,bundleId:this.bundleId}))),this.registerProviderListeners()}async recordMessageEvent(e){let{topic:t,message:r}=e;await this.messages.set(t,r)}async shouldIgnoreMessageEvent(e){let{topic:t,message:r}=e;if(!r||0===r.length)return this.logger.debug(`Ignoring invalid/empty message: ${r}`),!0;if(!await this.subscriber.isSubscribed(t))return this.logger.debug(`Ignoring message for non-subscribed topic ${t}`),!0;let n=this.messages.has(t,r);return n&&this.logger.debug(`Ignoring duplicate message: ${r}`),n}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),sl(e)){if(!e.method.endsWith("_subscription"))return;let t=e.params,{topic:r,message:n,publishedAt:i}=t.data,s={topic:r,message:n,publishedAt:i};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(oQ({type:"event",event:t.id}
78,s)),this.events.emit(t.id,s),await this.acknowledgePayload(e),await this.onMessageEvent(s)}else su(e)&&this.events.emit(ov.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(ov.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){let t=i9(e.id,!0);await this.provider.connection.send(t)}unregisterProviderListeners(){this.provider.off(ob.payload,this.onPayloadHandler),this.provider.off(ob.connect,this.onConnectHandler),this.provider.off(ob.disconnect,this.onDisconnectHandler),this.provider.off(ob.error,this.onProviderErrorHandler)}async registerEventListeners(){this.events.on(ov.connection_stalled,()=>{this.restartTransport().catch(e=>this.logger.error(e))});let e=await iJ();!function(e){switch(ii()){case n9.browser:!it()&&ir()&&(window.addEventListener("online",()=>e(!0)),window.addEventListener("offline",()=>e(!1)));break;case n9.reactNative:it()&&"u">typeof r.g&&null!=r.g&&r.g.NetInfo&&r.g?.NetInfo.addEventListener(t=>e(t?.isConnected));case n9.node:}}(async t=>{this.initialized&&e!==t&&(e=t,t?await this.restartTransport().catch(e=>this.logger.error(e)):(this.hasExperiencedNetworkDisruption=!0,await this.transportClose().catch(e=>this.logger.error(e))))})}onProviderDisconnect(){this.events.emit(ov.disconnect),this.attemptToReconnect()}attemptToReconnect(){this.transportExplicitlyClosed||(this.logger.info("attemptToReconnect called. Connecting..."),setTimeout(async()=>{await this.restartTransport().catch(e=>this.logger.error(e))},(0,rA.toMiliseconds)(ow)))}isInitialized(){if(!this.initialized){let{message:e}=iN("NOT_INITIALIZED",this.name);throw Error(e)}}async toEstablishConnection(){if(await this.confirmOnlineStateOrThrow(),!this.connected){if(this.connectionAttemptInProgress)return await new Promise(e=>{let t=setInterval(()=>{this.connected&&(clearInterval(t),e())},this.connectionStatusPollingInterval)});await this.restartTransport()}}}var oX=Object.defineProperty,o0=Object.getOwnPropertySymbols,o1=Object.prototype.hasOwnProperty,o2=Object.prototype.propertyIsEnumerable,o3=(e,t,r)=>t in e?oX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,o5=(e,t)=>{for(var r in t||(t={}))o1.call(t,r)&&o3(e,r,t[r]);if(o0)for(var r of o0(t))o2.call(t,r)&&o3(e,r,t[r]);return e};class o6 extends nv{constructor(e,t,r,n=oc,i){super(e,t,r,n),this.core=e,this.logger=t,this.name=r,this.map=new Map,this.version="0.3",this.cached=[],this.initialized=!1,this.storagePrefix=oc,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(e=>{var t;this.getKey&&null!==e&&!iL(e)?this.map.set(this.getKey(e),e):(null==(t=e?.proposer)?void 0:t.publicKey)?this.map.set(e.id,e):e?.topic&&this.map.set(e.topic,e)}),this.cached=[],this.initialized=!0)},this.set=async(e,t)=>{this.isInitialized(),this.map.has(e)?await this.update(e,t):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:e,value:t}),this.map.set(e,t),await this.persist())},this.get=e=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:e}),this.getData(e)),this.getAll=e=>(this.isInitialized(),e?this.values.filter(t=>Object.keys(e).every(r=>sv()(t[r],e[r]))):this.values),this.update=async(e,t)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:e,update:t});let r=o5(o5({},this.getData(e)),t);this.map.set(e,r),await this.persist()},this.delete=async(e,t)=>{this.isInitialized(),this.map.has(e)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:e,reason:t}),this.map.delete(e),await this.persist())},this.logger=nh(t,this.name),this.storagePrefix=n,this.getKey=i}get context(){return nc(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){let t=this.map.get(e);if(!t){let{message:t}=iN("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(t),Error(t)}return t}async persist(){await this.setDataStore(this.values)}
78async restore(){try{let e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){let{message:e}=iN("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){let{message:e}=iN("NOT_INITIALIZED",this.name);throw Error(e)}}}class o4{constructor(e,t){this.core=e,this.logger=t,this.name="pairing",this.version="0.3",this.events=new(e3()),this.initialized=!1,this.storagePrefix=oc,this.ignoredPayloadTypes=[1],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))},this.register=({methods:e})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...e])]},this.create=async()=>{var e;this.isInitialized();let t=nQ(),r=await this.core.crypto.setSymKey(t),n=id(rA.FIVE_MINUTES),i={protocol:"irn"},s=(e={protocol:this.core.protocol,version:this.core.version,topic:r,symKey:t,relay:i,expiryTimestamp:n},`${e.protocol}:${e.topic}@${e.version}?`+n$.stringify(ix(iI({symKey:e.symKey},function(e,t="-"){let r={};return Object.keys(e).forEach(n=>{e[n]&&(r["relay"+t+n]=e[n])}),r}(e.relay)),{expiryTimestamp:e.expiryTimestamp})));return await this.pairings.set(r,{topic:r,expiry:n,relay:i,active:!1}),await this.core.relayer.subscribe(r),this.core.expirer.set(r,n),{topic:r,uri:s}},this.pair=async e=>{this.isInitialized(),this.isValidPair(e);let{topic:t,symKey:r,relay:n,expiryTimestamp:i}=iP(e.uri);if(this.pairings.keys.includes(t)&&this.pairings.get(t).active)throw Error(`Pairing already exists: ${t}. Please try again with a new connection URI.`);let s=i||id(rA.FIVE_MINUTES),o={topic:t,relay:n,expiry:s,active:!1};return await this.pairings.set(t,o),this.core.expirer.set(t,s),e.activatePairing&&await this.activate({topic:t}),this.events.emit(oA.create,o),this.core.crypto.keychain.has(t)||(await this.core.crypto.setSymKey(r,t),await this.core.relayer.subscribe(t,{relay:n})),o},this.activate=async({topic:e})=>{this.isInitialized();let t=id(rA.THIRTY_DAYS);await this.pairings.update(e,{active:!0,expiry:t}),this.core.expirer.set(e,t)},this.ping=async e=>{this.isInitialized(),await this.isValidPing(e);let{topic:t}=e;if(this.pairings.keys.includes(t)){let e=await this.sendRequest(t,"wc_pairingPing",{}),{done:r,resolve:n,reject:i}=il();this.events.once(ig("pairing_ping",e),({error:e})=>{e?i(e):n()}),await r()}},this.updateExpiry=async({topic:e,expiry:t})=>{this.isInitialized(),await this.pairings.update(e,{expiry:t})},this.updateMetadata=async({topic:e,metadata:t})=>{this.isInitialized(),await this.pairings.update(e,{peerMetadata:t})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async e=>{this.isInitialized(),await this.isValidDisconnect(e);let{topic:t}=e;this.pairings.keys.includes(t)&&(await this.sendRequest(t,"wc_pairingDelete",iD("USER_DISCONNECTED")),await this.deletePairing(t))},this.sendRequest=async(e,t,r)=>{let n=i7(t,r),i=await this.core.crypto.encode(e,n),s=oS[t].req;return this.core.history.set(e,n),this.core.relayer.publish(e,i,s),n.id},this.sendResult=async(e,t,r)=>{let n=i9(e,r),i=await this.core.crypto.encode(t,n),s=oS[(await this.core.history.get(t,e)).request.method].res;await this.core.relayer.publish(t,i,s),await this.core.history.resolve(n)},this.sendError=async(e,t,r)=>{let n=se(e,r),i=await this.core.crypto.encode(t,n),s=await this.core.history.get(t,e),o=oS[s.request.method]?oS[s.request.method].res:oS.unregistered_method.res;await this.core.relayer.publish(t,i,o),await this.core.history.resolve(n)},this.deletePairing=async(e,t)=>{await this.core.relayer.unsubscribe(e),await Promise.all([this.pairings.delete(e,iD("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(e),t?Promise.resolve():this.core.expirer.del(e)])},this.cleanup=async()=>{let e=this.pairings.getAll().filter(e=>ip(e.expiry));await Promise.all(e.map(e=>this.deletePairing(e.topic)))},this.onRelayEventRequest=e=>{let{topic:t,payload:r}=e;switch(r.method){case"wc_pairingPing":return this.onPairingPingRequest(t,r);case"wc_pairingDelete":return this.onPairingDeleteRequest(t,r);default:return this.onUnknownRpcMethodRequest(t,r)}},this.onRelayEventResponse=async e=>{let{topic:t,payload:r}=e,n=(await this.core.history.get(t,r.id)).request.method;return"wc_pairingPing"===n?this.onPairingPingResponse(t,r):this.onUnknownRpcMethodResponse(n)},this.onPairingPingRequest=async(e,t)=>{let{id:r}=t;try{this.isValidPing({topic:e}),await this.sendResult(r,e,!0),this.events.emit(oA.ping,{id:r,topic:e})}catch(t){await this.sendError(r,e,t),this.logger.error(t)}},this.onPairingPingResponse=(e,t)=>{let{id:r}=t;setTimeout(()=>{sc(t)?this.events.emit(ig("pairing_ping",r),{}):sh(t)&&this.events.emit(ig("pairing_ping",r),{error:t.error})},500)},this.onPairingDeleteRequest=async(e,t)=>{let{id:r}=t;try{this.isValidDisconnect({topic:e}),await this.deletePairing(e),this.events.emit(oA.delete,{id:r,topic:e})}catch(t){await this.sendError(r,e,t),this.logger.error(t)}},this.onUnknownRpcMethodRequest=async(e,t)=>{let{id:r,method:n}=t;try{if(this.registeredMethods.includes(n))return;let t=iD("WC_METHOD_UNSUPPORTED",n);await this.sendError(r,e,t),this.logger.error(t)}catch(t){await this.sendError(r,e,t),this.logger.error(t)}},this.onUnknownRpcMethodResponse=e=>{this.registeredMethods.includes(e)||this.logger.error(iD("WC_METHOD_UNSUPPORTED",e))},this.isValidPair=e=>{var t;if(!iV(e)){let{message:t}=iN("MISSING_OR_INVALID",`pair() params: ${e}`);throw Error(t)}if(!function(e){if(iU(e,!1))try{return"u">typeof new URL(e)}catch{}return!1}(e.uri)){let{message:t}=iN("MISSING_OR_INVALID",`pair() uri: ${e.uri}`);throw Error(t)}let r=iP(e.uri);if(!(null!=(t=r?.relay)&&t.protocol)){let{message:e}=iN("MISSING_OR_INVALID","pair() uri#relay-protocol");throw Error(e)}if(!(null!=r&&r.symKey)){let{message:e}=iN("MISSING_OR_INVALID","pair() uri#symKey");throw Error(e)}if(null!=r&&r.expiryTimestamp&&(0,rA.toMiliseconds)(r?.expiryTimestamp)<Date.now()){let{message:e}=iN("EXPIRED","pair() URI has expired. Please try again with a new connection URI.");throw Error(e)}},this.isValidPing=async e=>{if(!iV(e)){let{message:t}=iN("MISSING_OR_INVALID",`ping() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidPairingTopic(t)},this.isValidDisconnect=async e=>{if(!iV(e)){let{message:t}=iN("MISSING_OR_INVALID",`disconnect() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidPairingTopic(t)},this.isValidPairingTopic=async e=>{if(!iU(e,!1)){let{message:t}=iN("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw Error(t)}if(!this.pairings.keys.includes(e)){let{message:t}=iN("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw Error(t)}if(ip(this.pairings.get(e).expiry)){await this.deletePairing(e);let{message:t}=iN("EXPIRED",`pairing topic: ${e}`);throw Error(t)}},this.core=e,this.logger=nh(t,this.name),this.pairings=new o6(this.core,this.logger,this.name,this.storagePrefix)}get context(){return nc(this.logger)}isInitialized(){if(!this.initialized){let{message:e}=iN("NOT_INITIALIZED",this.name);throw Error(e)}}registerRelayerEvents(){this.core.relayer.on(ov.message,async e=>{let{topic:t,message:r}=e;if(!this.pairings.keys.includes(t)||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(r)))return;let n=await this.core.crypto.decode(t,r);try{sl(n)?(this.core.history.set(t,n),this.onRelayEventRequest({topic:t,payload:n})):su(n)&&(await this.core.history.resolve(n),await this.onRelayEventResponse({topic:t,payload:n}),this.core.history.delete(t,n.id))}catch(e){this.logger.error(e)}})}registerExpirerEvents(){this.core.expirer.on(oC.expired,async e=>{let{topic:t}=ih(e.target);t&&this.pairings.keys.includes(t)&&(await this.deletePairing(t,!0),this.events.emit(oA.expire,{topic:t}))})}}class o8 extends np{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.records=new Map,this.events=new e2.EventEmitter,this.name="history",this.version="0.3",this.cached=[],this.initialized=!1,this.storagePrefix=oc,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(
78),this.cached.forEach(e=>this.records.set(e.id,e)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(e,t,r)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:e,request:t,chainId:r}),this.records.has(t.id))return;let n={id:t.id,topic:e,request:{method:t.method,params:t.params||null},chainId:r,expiry:id(rA.THIRTY_DAYS)};this.records.set(n.id,n),this.events.emit(ok.created,n)},this.resolve=async e=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:e}),!this.records.has(e.id))return;let t=await this.getRecord(e.id);typeof t.response>"u"&&(t.response=sh(e)?{error:e.error}:{result:e.result},this.records.set(t.id,t),this.events.emit(ok.updated,t))},this.get=async(e,t)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:e,id:t}),await this.getRecord(t)),this.delete=(e,t)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:t}),this.values.forEach(r=>{r.topic!==e||"u">typeof t&&r.id!==t||(this.records.delete(r.id),this.events.emit(ok.deleted,r))})},this.exists=async(e,t)=>(this.isInitialized(),!!this.records.has(t)&&(await this.getRecord(t)).topic===e),this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.logger=nh(t,this.name)}get context(){return nc(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){let e=[];return this.values.forEach(t=>{if("u">typeof t.response)return;let r={topic:t.topic,request:i7(t.request.method,t.request.params,t.id),chainId:t.chainId};return e.push(r)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();let t=this.records.get(e);if(!t){let{message:t}=iN("NO_MATCHING_KEY",`${this.name}: ${e}`);throw Error(t)}return t}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(ok.sync)}async restore(){try{let e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){let{message:e}=iN("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(ok.created,e=>{let t=ok.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e}),this.persist()}),this.events.on(ok.updated,e=>{let t=ok.updated;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e}),this.persist()}),this.events.on(ok.deleted,e=>{let t=ok.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e}),this.persist()}),this.core.heartbeat.on(r6.HEARTBEAT_EVENTS.pulse,()=>{this.cleanup()})}cleanup(){try{this.records.forEach(e=>{(0,rA.toMiliseconds)(e.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${e.id}`),this.delete(e.topic,e.id))})}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){let{message:e}=iN("NOT_INITIALIZED",this.name);throw Error(e)}}}class o7 extends nw{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.expirations=new Map,this.events=new e2.EventEmitter,this.name="expirer",this.version="0.3",this.cached=[],this.initialized=!1,this.storagePrefix=oc,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(e
78=>this.expirations.set(e.target,e)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=e=>{try{let t=this.formatTarget(e);return"u">typeof this.getExpiration(t)}catch{return!1}},this.set=(e,t)=>{this.isInitialized();let r=this.formatTarget(e),n={target:r,expiry:t};this.expirations.set(r,n),this.checkExpiry(r,n),this.events.emit(oC.created,{target:r,expiration:n})},this.get=e=>{this.isInitialized();let t=this.formatTarget(e);return this.getExpiration(t)},this.del=e=>{if(this.isInitialized(),this.has(e)){let t=this.formatTarget(e),r=this.getExpiration(t);this.expirations.delete(t),this.events.emit(oC.deleted,{target:t,expiration:r})}},this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.logger=nh(t,this.name)}get context(){return nc(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if("string"==typeof e)return ic("topic",e);if("number"==typeof e)return ic("id",e);let{message:t}=iN("UNKNOWN_TYPE",`Target type: ${typeof e}`);throw Error(t)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(oC.sync)}async restore(){try{let e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){let{message:e}=iN("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){let t=this.expirations.get(e);if(!t){let{message:t}=iN("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(t),Error(t)}return t}checkExpiry(e,t){let{expiry:r}=t;(0,rA.toMiliseconds)(r)-Date.now()<=0&&this.expire(e,t)}expire(e,t){this.expirations.delete(e),this.events.emit(oC.expired,{target:e,expiration:t})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,t)=>this.checkExpiry(t,e))}registerEventListeners(){this.core.heartbeat.on(r6.HEARTBEAT_EVENTS.pulse,()=>this.checkExpirations()),this.events.on(oC.created,e=>{let t=oC.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}),this.events.on(oC.expired,e=>{let t=oC.expired;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}),this.events.on(oC.deleted,e=>{let t=oC.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()})}isInitialized(){if(!this.initialized){let{message:e}=iN("NOT_INITIALIZED",this.name);throw Error(e)}}}class o9 extends n_{constructor(e,t){super(e,t),this.projectId=e,this.logger=t,this.name=oI,this.initialized=!1,this.queue=[],this.verifyDisabled=!1,this.init=async e=>{if(this.verifyDisabled||it()||!ir())return;let t=this.getVerifyUrl(e?.verifyUrl);this.verifyUrl!==t&&this.removeIframe(),this.verifyUrl=t;try{await this.createIframe()}catch(e){this.logger.info(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.info(e)}if(!this.initialized){this.removeIframe(),this.verifyUrl=oP;try{await this.createIframe()}catch(e){this.logger.info(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.info(e),this.verifyDisabled=!0}}},this.register=async e=>{this.initialized?this.sendPost(e.attestationId):(this.addToQueue(e.attestationId),await this.init())},this.resolve=async e=>{let t;if(this.isDevEnv)return"";let r=this.getVerifyUrl(e?.verifyUrl);try{t=await this.fetchAttestation(e.attestationId,r)}catch(n){this.logger.info(`failed to resolve attestation: ${e.attestationId} from url: ${r}`),this.logger.info(n),t=await this.fetchAttestation(e.attestationId,oP)}return t},this.fetchAttestation=async(e,t)=>{this.logger.info(`resolving attestation: ${e} from url: ${t}`);let r=this.startAbortTimer(2*rA.ONE_SECOND),n=await fetch(`${t}/attestation/${e}`,{signal:this.abortController.signal});return clearTimeout(r),200===n.status?await n.json():void 0},this.addToQueue=e=>{this.queue.push(e)},this.processQueue=()=>
78{0!==this.queue.length&&(this.queue.forEach(e=>this.sendPost(e)),this.queue=[])},this.sendPost=e=>{var t;try{if(!this.iframe)return;null==(t=this.iframe.contentWindow)||t.postMessage(e,"*"),this.logger.info(`postMessage sent: ${e} ${this.verifyUrl}`)}catch{}},this.createIframe=async()=>{let e;let t=r=>{"verify_ready"===r.data&&(this.initialized=!0,this.processQueue(),window.removeEventListener("message",t),e())};await Promise.race([new Promise(r=>{if(document.getElementById(oI))return r();window.addEventListener("message",t);let n=document.createElement("iframe");n.id=oI,n.src=`${this.verifyUrl}/${this.projectId}`,n.style.display="none",document.body.append(n),this.iframe=n,e=r}),new Promise((e,r)=>setTimeout(()=>{window.removeEventListener("message",t),r("verify iframe load timeout")},(0,rA.toMiliseconds)(rA.FIVE_SECONDS)))])},this.removeIframe=()=>{this.iframe&&(this.iframe.remove(),this.iframe=void 0,this.initialized=!1)},this.getVerifyUrl=e=>{let t=e||ox;return oO.includes(t)||(this.logger.info(`verify url: ${t}, not included in trusted list, assigning default: ${ox}`),t=ox),t},this.logger=nh(t,this.name),this.verifyUrl=ox,this.abortController=new AbortController,this.isDevEnv=ie()&&s_.env.IS_VITEST}get context(){return nc(this.logger)}startAbortTimer(e){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),(0,rA.toMiliseconds)(e))}}class ae extends nE{constructor(e,t){super(e,t),this.projectId=e,this.logger=t,this.context="echo",this.registerDeviceToken=async e=>{let{clientId:t,token:r,notificationType:n,enableEncrypted:i=!1}=e,s=`https://echo.walletconnect.com/${this.projectId}/clients`;await sw()(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:t,type:n,token:r,always_raw:i})})},this.logger=nh(t,this.context)}}var at=Object.defineProperty,ar=Object.getOwnPropertySymbols,an=Object.prototype.hasOwnProperty,ai=Object.prototype.propertyIsEnumerable,as=(e,t,r)=>t in e?at(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ao=(e,t)=>{for(var r in t||(t={}))an.call(t,r)&&as(e,r,t[r]);if(ar)for(var r of ar(t))ai.call(t,r)&&as(e,r,t[r]);return e};class aa extends nf{constructor(e){super(e),this.protocol="wc",this.version=2,this.name=ou,this.events=new e2.EventEmitter,this.initialized=!1,this.on=(e,t)=>this.events.on(e,t),this.once=(e,t)=>this.events.once(e,t),this.off=(e,t)=>this.events.off(e,t),this.removeListener=(e,t)=>this.events.removeListener(e,t),this.projectId=e?.projectId,this.relayUrl=e?.relayUrl||oy,this.customStoragePrefix=null!=e&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";let t="u">typeof e?.logger&&"string"!=typeof e?.logger?e.logger:r8()(nu({level:e?.logger||oh.logger}));this.logger=nh(t,this.name),this.heartbeat=new r6.HeartBeat,this.crypto=new oR(this,this.logger,e?.keychain),this.history=new o8(this,this.logger),this.expirer=new o7(this,this.logger),this.storage=null!=e&&e.storage?e.storage:new r5(ao(ao({},od),e?.storageOptions)),this.relayer=new oZ({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new o4(this,this.logger),this.verify=new o9(this.projectId||"",this.logger),this.echoClient=new ae(this.projectId||"",this.logger)}static async init(e){let t=new aa(e);await t.initialize();let r=await t.crypto.getClientId();return await t.storage.setItem("WALLETCONNECT_CLIENT_ID",r),t}get context(){return nc(this.logger)}async start(){this.initialized||await this.initialize()}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.initialized=!0,this.logger.info("Core Initialization Success")}catch(e){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,e),this.logger.error(e.message),e}}}let al="client",au=`wc@2:${al}:`,ac={name:al,logger:"error"},ah="WALLETCONNECT_DEEPLINK_CHOICE",ad="Proposal expired",af=rA.SEVEN_DAYS,ap={wc_sessionPropose:{req:{ttl:rA.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:rA.FIVE_MINUTES,prompt:!1,tag:1101}},wc_sessionSettle:{req:{ttl:rA.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:rA.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:rA.ONE_DAY,prompt:!1,tag:1104},res:{ttl:rA.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:rA.ONE_DAY,prompt:!1,tag:1106},res:{ttl:rA.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:rA.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:rA.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:rA.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:rA.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:rA.ONE_DAY,prompt:!1,tag:1112},res:{ttl:rA.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:rA.THIRTY_SECONDS,prompt:!1,tag:1114},res:{ttl:rA.THIRTY_SECONDS,prompt:!1,tag:1115}}},ag={min:rA.FIVE_MINUTES,max:rA.SEVEN_DAYS},ay={idle:"IDLE",active:"ACTIVE"},am=["wc_sessionPropose","wc_sessionRequest","wc_authRequest"];var av=Object.defineProperty,ab=Object.defineProperties,aw=Object.getOwnPropertyDescriptors,a_=Object.getOwnPropertySymbols,aE=Object.prototype.hasOwnProperty,aS=Object.prototype.propertyIsEnumerable,aA=(e,t,r)=>t in e?av(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ak=(e,t)=>{for(var r in t||(t={}))aE.call(t,r)&&aA(e,r,t[r]);if(a_)for(var r of a_(t))aS.call(t,r)&&aA(e,r,t[r]);return e},aC=(e,t)=>ab(e,aw(t));class aI extends nA{constructor(e){super(e),this.name="engine",this.events=new(e3()),this.initialized=!1,this.ignoredPayloadTypes=[1],this.requestQueue={state:ay.idle,queue:[]},this.sessionRequestQueue={state:ay.idle,queue:[]},this.requestQueueDelay=rA.ONE_SECOND,this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),this.client.core.pairing.register({methods:Object.keys(ap)}),this.initialized=!0,setTimeout(()=>{this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},(0,rA.toMiliseconds)(this.requestQueueDelay)))},this.connect=async e=>{await this.isInitialized();let t=aC(ak({},e),{requiredNamespaces:e.requiredNamespaces||{},optionalNamespaces:e.optionalNamespaces||{}});await this.isValidConnect(t);let{pairingTopic:r,requiredNamespaces:n,optionalNamespaces:i,sessionProperties:s,relays:o}=t,a=r,l,u=!1;
78if(a&&(u=this.client.core.pairing.pairings.get(a).active),!a||!u){let{topic:e,uri:t}=await this.client.core.pairing.create();a=e,l=t}let c=await this.client.core.crypto.generateKeyPair(),h=ap.wc_sessionPropose.req.ttl||rA.FIVE_MINUTES,d=id(h),f=ak({requiredNamespaces:n,optionalNamespaces:i,relays:o??[{protocol:"irn"}],proposer:{publicKey:c,metadata:this.client.metadata},expiryTimestamp:d},s&&{sessionProperties:s}),{reject:p,resolve:g,done:y}=il(h,ad);if(this.events.once(ig("session_connect"),async({error:e,session:t})=>{if(e)p(e);else if(t){t.self.publicKey=c;let e=aC(ak({},t),{requiredNamespaces:f.requiredNamespaces,optionalNamespaces:f.optionalNamespaces});await this.client.session.set(t.topic,e),await this.setExpiry(t.topic,t.expiry),a&&await this.client.core.pairing.updateMetadata({topic:a,metadata:t.peer.metadata}),g(e)}}),!a){let{message:e}=iN("NO_MATCHING_KEY",`connect() pairing topic: ${a}`);throw Error(e)}let m=await this.sendRequest({topic:a,method:"wc_sessionPropose",params:f,throwOnFailedPublish:!0});return await this.setProposal(m,ak({id:m},f)),{uri:l,approval:y}},this.pair=async e=>(await this.isInitialized(),await this.client.core.pairing.pair(e)),this.approve=async e=>{await this.isInitialized(),await this.isValidApprove(e);let{id:t,relayProtocol:r,namespaces:n,sessionProperties:i}=e,{pairingTopic:s,proposer:o,requiredNamespaces:a,optionalNamespaces:l}=this.client.proposal.get(t);s=s||"";let u=await this.client.core.crypto.generateKeyPair(),c=o.publicKey,h=await this.client.core.crypto.generateSharedKey(u,c);s&&t&&(await this.client.core.pairing.updateMetadata({topic:s,metadata:o.metadata}),await this.sendResult({id:t,topic:s,result:{relay:{protocol:r??"irn"},responderPublicKey:u}}),await this.client.proposal.delete(t,iD("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:s}));let d=ak({relay:{protocol:r??"irn"},namespaces:n,pairingTopic:s,controller:{publicKey:u,metadata:this.client.metadata},expiry:id(af)},i&&{sessionProperties:i});await this.client.core.relayer.subscribe(h);let f=aC(ak({},d),{topic:h,requiredNamespaces:a,optionalNamespaces:l,pairingTopic:s,acknowledged:!1,self:d.controller,peer:{publicKey:o.publicKey,metadata:o.metadata},controller:u});await this.client.session.set(h,f);try{await this.sendRequest({topic:h,method:"wc_sessionSettle",params:d,throwOnFailedPublish:!0})}catch(e){throw this.client.logger.error(e),this.client.session.delete(h,iD("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(h),e}return await this.setExpiry(h,id(af)),{topic:h,acknowledged:()=>new Promise(e=>setTimeout(()=>e(this.client.session.get(h)),500))}},this.reject=async e=>{await this.isInitialized(),await this.isValidReject(e);let{id:t,reason:r}=e,{pairingTopic:n}=this.client.proposal.get(t);n&&(await this.sendError(t,n,r),await this.client.proposal.delete(t,iD("USER_DISCONNECTED")))},this.update=async e=>{await this.isInitialized(),await this.isValidUpdate(e);let{topic:t,namespaces:r}=e,n=await this.sendRequest({topic:t,method:"wc_sessionUpdate",params:{namespaces:r}}),{done:i,resolve:s,reject:o}=il();return this.events.once(ig("session_update",n),({error:e})=>{e?o(e):s()}),await this.client.session.update(t,{namespaces:r}),{acknowledged:i}},this.extend=async e=>{await this.isInitialized(),await this.isValidExtend(e);let{topic:t}=e,r=await this.sendRequest({topic:t,method:"wc_sessionExtend",params:{}}),{done:n,resolve:i,reject:s}=il();return this.events.once(ig("session_extend",r),({error:e})=>{e?s(e):i()}),await this.setExpiry(t,id(af)),{acknowledged:n}},this.request=async e=>{await this.isInitialized(),await this.isValidRequest(e);let{chainId:t,request:r,topic:n,expiry:i=ap.wc_sessionRequest.req.ttl}=e,s=i4(),{done:o,resolve:a,reject:l}=il(i,"Request expired. Please try again.");return this.events.once(ig("session_request",s),({error:e,result:t})=>{e?l(e):a(t)}),await Promise.all([new Promise(async e=>{await this.sendRequest({clientRpcId:s,topic:n,method:"wc_sessionRequest",params:{request:aC(ak({},r),{expiryTimestamp:id(i)}),chainId:t},expiry:i,throwOnFailedPublish:!0}).catch(e=>l(e)),this.client.events.emit("session_request_sent",{topic:n,request:r,chainId:t,id:s}),e()}),new Promise(async e=>{iy({id:s,topic:n,wcDeepLink:await im(this.client.core.storage,ah)}),e()}),o()]).then(e=>e[2])},this.respond=async e=>{await this.isInitialized(),await this.isValidRespond(e);let{topic:t,response:r}=e,{id:n}=r;sc(r)?await this.sendResult({id:n,topic:t,result:r.result,throwOnFailedPublish:!0}):sh(r)&&await this.sendError(n,t,r.error),this.cleanupAfterResponse(e)},this.ping=async e=>{await this.isInitialized(),await this.isValidPing(e);let{topic:t}=e;if(this.client.session.keys.includes(t)){let e=await this.sendRequest({topic:t,method:"wc_sessionPing",params:{}}),{done:r,resolve:n,reject:i}=il();this.events.once(ig("session_ping",e),({error:e})=>{e?i(e):n()}),await r()}else this.client.core.pairing.pairings.keys.includes(t)&&await this.client.core.pairing.ping({topic:t})},this.emit=async e=>{await this.isInitialized(),await this.isValidEmit(e);let{topic:t,event:r,chainId:n}=e;await this.sendRequest({topic:t,method:"wc_sessionEvent",params:{event:r,chainId:n}})},this.disconnect=async e=>{await this.isInitialized(),await this.isValidDisconnect(e);let{topic:t}=e;if(this.client.session.keys.includes(t))await this.sendRequest({topic:t,method:"wc_sessionDelete",params:iD("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:t,emitEvent:!1});else if(this.client.core.pairing.pairings.keys.includes(t))await this.client.core.pairing.disconnect({topic:t});else{let{message:e}=iN("MISMATCHED_TOPIC",`Session or pairing topic not found: ${t}`);throw Error(e)}},this.find=e=>(this.isInitialized(),this.client.session.getAll().filter(t=>(function(e,t){let{requiredNamespaces:r}=t,n=Object.keys(e.namespaces),i=Object.keys(r),s=!0;return!!is(i,n)&&(n.forEach(t=>{let{accounts:n,methods:i,events:o}=e.namespaces[t],a=iO(n),l=r[t];is(nW(t,l),a)&&is(l.methods,i)&&is(l.events,o)||(s=!1)}),s)})(t,e))),this.getPendingSessionRequests=()=>
78this.client.pendingRequest.getAll(),this.cleanupDuplicatePairings=async e=>{if(e.pairingTopic)try{let t=this.client.core.pairing.pairings.get(e.pairingTopic),r=this.client.core.pairing.pairings.getAll().filter(r=>{var n,i;return(null==(n=r.peerMetadata)?void 0:n.url)&&(null==(i=r.peerMetadata)?void 0:i.url)===e.peer.metadata.url&&r.topic&&r.topic!==t.topic});if(0===r.length)return;this.client.logger.info(`Cleaning up ${r.length} duplicate pairing(s)`),await Promise.all(r.map(e=>this.client.core.pairing.disconnect({topic:e.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(e){this.client.logger.error(e)}},this.deleteSession=async e=>{let{topic:t,expirerHasDeleted:r=!1,emitEvent:n=!0,id:i=0}=e,{self:s}=this.client.session.get(t);await this.client.core.relayer.unsubscribe(t),await this.client.session.delete(t,iD("USER_DISCONNECTED")),this.client.core.crypto.keychain.has(s.publicKey)&&await this.client.core.crypto.deleteKeyPair(s.publicKey),this.client.core.crypto.keychain.has(t)&&await this.client.core.crypto.deleteSymKey(t),r||this.client.core.expirer.del(t),this.client.core.storage.removeItem(ah).catch(e=>this.client.logger.warn(e)),this.getPendingSessionRequests().forEach(e=>{e.topic===t&&this.deletePendingSessionRequest(e.id,iD("USER_DISCONNECTED"))}),n&&this.client.events.emit("session_delete",{id:i,topic:t})},this.deleteProposal=async(e,t)=>{await Promise.all([this.client.proposal.delete(e,iD("USER_DISCONNECTED")),t?Promise.resolve():this.client.core.expirer.del(e)])},this.deletePendingSessionRequest=async(e,t,r=!1)=>{await Promise.all([this.client.pendingRequest.delete(e,t),r?Promise.resolve():this.client.core.expirer.del(e)]),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(t=>t.id!==e),r&&(this.sessionRequestQueue.state=ay.idle,this.client.events.emit("session_request_expire",{id:e}))},this.setExpiry=async(e,t)=>{this.client.session.keys.includes(e)&&await this.client.session.update(e,{expiry:t}),this.client.core.expirer.set(e,t)},this.setProposal=async(e,t)=>{await this.client.proposal.set(e,t),this.client.core.expirer.set(e,id(ap.wc_sessionPropose.req.ttl))},this.setPendingSessionRequest=async e=>{let{id:t,topic:r,params:n,verifyContext:i}=e,s=n.request.expiryTimestamp||id(ap.wc_sessionRequest.req.ttl);await this.client.pendingRequest.set(t,{id:t,topic:r,params:n,verifyContext:i}),s&&this.client.core.expirer.set(t,s)},this.sendRequest=async e=>{let{topic:t,method:r,params:n,expiry:i,relayRpcId:s,clientRpcId:o,throwOnFailedPublish:a}=e,l=i7(r,n,o);if(ir()&&am.includes(r)){let e=nZ(JSON.stringify(l));this.client.core.verify.register({attestationId:e})}let u=await this.client.core.crypto.encode(t,l),c=ap[r].req;return i&&(c.ttl=i),s&&(c.id=s),this.client.core.history.set(t,l),a?(c.internal=aC(ak({},c.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(t,u,c)):this.client.core.relayer.publish(t,u,c).catch(e=>this.client.logger.error(e)),l.id},this.sendResult=async e=>{let{id:t,topic:r,result:n,throwOnFailedPublish:i}=e,s=i9(t,n),o=await this.client.core.crypto.encode(r,s),a=ap[(await this.client.core.history.get(r,t)).request.method].res;i?(a.internal=aC(ak({},a.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(r,o,a)):this.client.core.relayer.publish(r,o,a).catch(e=>this.client.logger.error(e)),await this.client.core.history.resolve(s)},this.sendError=async(e,t,r)=>{let n=se(e,r),i=await this.client.core.crypto.encode(t,n),s=ap[(await this.client.core.history.get(t,e)).request.method].res;this.client.core.relayer.publish(t,i,s),await this.client.core.history.resolve(n)},this.cleanup=async()=>{let e=[],t=[];this.client.session.getAll().forEach(t=>{let r=!1;ip(t.expiry)&&(r=!0),this.client.core.crypto.keychain.has(t.topic)||(r=!0),r&&e.push(t.topic)}),this.client.proposal.getAll().forEach(e=>{ip(e.expiryTimestamp)&&t.push(e.id)}),await Promise.all([...e.map(e=>this.deleteSession({topic:e})),...t.map(e=>this.deleteProposal(e))])},this.onRelayEventRequest=async e=>{this.requestQueue.queue.push(e),await this.processRequestsQueue()},this.processRequestsQueue=async()=>
78{if(this.requestQueue.state===ay.active){this.client.logger.info("Request queue already active, skipping...");return}for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=ay.active;let e=this.requestQueue.queue.shift();if(e)try{this.processRequest(e),await new Promise(e=>setTimeout(e,300))}catch(e){this.client.logger.warn(e)}}this.requestQueue.state=ay.idle},this.processRequest=e=>{let{topic:t,payload:r}=e,n=r.method;switch(n){case"wc_sessionPropose":return this.onSessionProposeRequest(t,r);case"wc_sessionSettle":return this.onSessionSettleRequest(t,r);case"wc_sessionUpdate":return this.onSessionUpdateRequest(t,r);case"wc_sessionExtend":return this.onSessionExtendRequest(t,r);case"wc_sessionPing":return this.onSessionPingRequest(t,r);case"wc_sessionDelete":return this.onSessionDeleteRequest(t,r);case"wc_sessionRequest":return this.onSessionRequest(t,r);case"wc_sessionEvent":return this.onSessionEventRequest(t,r);default:return this.client.logger.info(`Unsupported request method ${n}`)}},this.onRelayEventResponse=async e=>{let{topic:t,payload:r}=e,n=(await this.client.core.history.get(t,r.id)).request.method;switch(n){case"wc_sessionPropose":return this.onSessionProposeResponse(t,r);case"wc_sessionSettle":return this.onSessionSettleResponse(t,r);case"wc_sessionUpdate":return this.onSessionUpdateResponse(t,r);case"wc_sessionExtend":return this.onSessionExtendResponse(t,r);case"wc_sessionPing":return this.onSessionPingResponse(t,r);case"wc_sessionRequest":return this.onSessionRequestResponse(t,r);default:return this.client.logger.info(`Unsupported response method ${n}`)}},this.onRelayEventUnknownPayload=e=>{let{topic:t}=e,{message:r}=iN("MISSING_OR_INVALID",`Decoded payload on topic ${t} is not identifiable as a JSON-RPC request or a response.`);throw Error(r)},this.onSessionProposeRequest=async(e,t)=>{let{params:r,id:n}=t;try{this.isValidConnect(ak({},t.params));let i=r.expiryTimestamp||id(ap.wc_sessionPropose.req.ttl),s=ak({id:n,pairingTopic:e,expiryTimestamp:i},r);await this.setProposal(n,s);let o=nZ(JSON.stringify(t)),a=await this.getVerifyContext(o,s.proposer.metadata);this.client.events.emit("session_proposal",{id:n,params:s,verifyContext:a})}catch(t){await this.sendError(n,e,t),this.client.logger.error(t)}},this.onSessionProposeResponse=async(e,t)=>{let{id:r}=t;if(sc(t)){let{result:n}=t;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:n});let i=this.client.proposal.get(r);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:i});let s=i.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:s});let o=n.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:o});let a=await this.client.core.crypto.generateSharedKey(s,o);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:a});let l=await this.client.core.relayer.subscribe(a);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:l}),await this.client.core.pairing.activate({topic:e})}else sh(t)&&(await this.client.proposal.delete(r,iD("USER_DISCONNECTED")),this.events.emit(ig("session_connect"),{error:t.error}))},this.onSessionSettleRequest=async(e,t)=>{let{id:r,params:n}=t;try{this.isValidSessionSettleRequest(n);let{relay:r,controller:i,expiry:s,namespaces:o,sessionProperties:a,pairingTopic:l}=t.params,u=ak({topic:e,relay:r,expiry:s,namespaces:o,acknowledged:!0,pairingTopic:l,requiredNamespaces:{},optionalNamespaces:{},controller:i.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:i.publicKey,metadata:i.metadata}},a&&{sessionProperties:a});await this.sendResult({id:t.id,topic:e,result:!0}),this.events.emit(ig("session_connect"),{session:u}),this.cleanupDuplicatePairings(u)}catch(t){await this.sendError(r,e,t),this.client.logger.error(t)}},this.onSessionSettleResponse=async(e,t)=>{let{id:r}=t;sc(t)?(await this.client.session.update(e,{acknowledged:!0}),this.events.emit(ig("session_approve",r),{})):sh(t)&&(await this.client.session.delete(e,iD("USER_DISCONNECTED")),this.events.emit(ig("session_approve",r),{error:t.error}))},this.onSessionUpdateRequest=async(e,t)=>{let{params:r,id:n}=t;try{let t=`${e}_session_update`,i=iZ.get(t);if(i&&this.isRequestOutOfSync(i,n)){this.client.logger.info(`Discarding out of sync request - ${n}`);return}
78this.isValidUpdate(ak({topic:e},r)),await this.client.session.update(e,{namespaces:r.namespaces}),await this.sendResult({id:n,topic:e,result:!0}),this.client.events.emit("session_update",{id:n,topic:e,params:r}),iZ.set(t,n)}catch(t){await this.sendError(n,e,t),this.client.logger.error(t)}},this.isRequestOutOfSync=(e,t)=>parseInt(t.toString().slice(0,-3))<=parseInt(e.toString().slice(0,-3)),this.onSessionUpdateResponse=(e,t)=>{let{id:r}=t;sc(t)?this.events.emit(ig("session_update",r),{}):sh(t)&&this.events.emit(ig("session_update",r),{error:t.error})},this.onSessionExtendRequest=async(e,t)=>{let{id:r}=t;try{this.isValidExtend({topic:e}),await this.setExpiry(e,id(af)),await this.sendResult({id:r,topic:e,result:!0}),this.client.events.emit("session_extend",{id:r,topic:e})}catch(t){await this.sendError(r,e,t),this.client.logger.error(t)}},this.onSessionExtendResponse=(e,t)=>{let{id:r}=t;sc(t)?this.events.emit(ig("session_extend",r),{}):sh(t)&&this.events.emit(ig("session_extend",r),{error:t.error})},this.onSessionPingRequest=async(e,t)=>{let{id:r}=t;try{this.isValidPing({topic:e}),await this.sendResult({id:r,topic:e,result:!0}),this.client.events.emit("session_ping",{id:r,topic:e})}catch(t){await this.sendError(r,e,t),this.client.logger.error(t)}},this.onSessionPingResponse=(e,t)=>{let{id:r}=t;setTimeout(()=>{sc(t)?this.events.emit(ig("session_ping",r),{}):sh(t)&&this.events.emit(ig("session_ping",r),{error:t.error})},500)},this.onSessionDeleteRequest=async(e,t)=>{let{id:r}=t;try{this.isValidDisconnect({topic:e,reason:t.params}),await Promise.all([new Promise(t=>{this.client.core.relayer.once(ov.publish,async()=>{t(await this.deleteSession({topic:e,id:r}))})}),this.sendResult({id:r,topic:e,result:!0}),this.cleanupPendingSentRequestsForTopic({topic:e,error:iD("USER_DISCONNECTED")})])}catch(e){this.client.logger.error(e)}},this.onSessionRequest=async(e,t)=>{let{id:r,params:n}=t;try{this.isValidRequest(ak({topic:e},n));let t=nZ(JSON.stringify(i7("wc_sessionRequest",n,r))),i=this.client.session.get(e),s=await this.getVerifyContext(t,i.peer.metadata),o={id:r,topic:e,params:n,verifyContext:s};await this.setPendingSessionRequest(o),this.addSessionRequestToSessionRequestQueue(o),this.processSessionRequestQueue()}catch(t){await this.sendError(r,e,t),this.client.logger.error(t)}},this.onSessionRequestResponse=(e,t)=>{let{id:r}=t;sc(t)?this.events.emit(ig("session_request",r),{result:t.result}):sh(t)&&this.events.emit(ig("session_request",r),{error:t.error})},this.onSessionEventRequest=async(e,t)=>{let{id:r,params:n}=t;try{let t=`${e}_session_event_${n.event.name}`,i=iZ.get(t);if(i&&this.isRequestOutOfSync(i,r)){this.client.logger.info(`Discarding out of sync request - ${r}`);return}this.isValidEmit(ak({topic:e},n)),this.client.events.emit("session_event",{id:r,topic:e,params:n}),iZ.set(t,r)}catch(t){await this.sendError(r,e,t),this.client.logger.error(t)}},this.addSessionRequestToSessionRequestQueue=e=>{this.sessionRequestQueue.queue.push(e)},this.cleanupAfterResponse=e=>{this.deletePendingSessionRequest(e.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=ay.idle,this.processSessionRequestQueue()},(0,rA.toMiliseconds)(this.requestQueueDelay))},this.cleanupPendingSentRequestsForTopic=({topic:e,error:t})=>{let r=this.client.core.history.pending;r.length>0&&r.filter(t=>t.topic===e&&"wc_sessionRequest"===t.request.method).forEach(e=>{this.events.emit(ig("session_request",e.request.id),{error:t})})},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===ay.active){this.client.logger.info("session request queue is already active.");return}let e=this.sessionRequestQueue.queue[0];if(!e){this.client.logger.info("session request queue is empty.");return}try{this.sessionRequestQueue.state=ay.active,this.client.events.emit("session_request",e)}catch(e){this.client.logger.error(e)}},this.onPairingCreated=e=>{if(e.active)return;let t=this.client.proposal.getAll().find(t=>t.pairingTopic===e.topic);
78t&&this.onSessionProposeRequest(e.topic,i7("wc_sessionPropose",{requiredNamespaces:t.requiredNamespaces,optionalNamespaces:t.optionalNamespaces,relays:t.relays,proposer:t.proposer,sessionProperties:t.sessionProperties},t.id))},this.isValidConnect=async e=>{let t;if(!iV(e)){let{message:t}=iN("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(e)}`);throw Error(t)}let{pairingTopic:r,requiredNamespaces:n,optionalNamespaces:i,sessionProperties:s,relays:o}=e;if(iL(r)||await this.isValidPairingTopic(r),t=!1,o?o&&iB(o)&&o.length&&o.forEach(e=>{t=i$(e)}):t=!0,!t){let{message:e}=iN("MISSING_OR_INVALID",`connect() relays: ${o}`);throw Error(e)}iL(n)||0===iM(n)||this.validateNamespaces(n,"requiredNamespaces"),iL(i)||0===iM(i)||this.validateNamespaces(i,"optionalNamespaces"),iL(s)||this.validateSessionProps(s,"sessionProperties")},this.validateNamespaces=(e,t)=>{let r=function(e,t,r){let n=null;if(e&&iM(e)){let i;let s=iH(e,t);s&&(n=s);let o=(i=null,Object.entries(e).forEach(([e,n])=>{var s,o;let a;if(i)return;let l=(s=nW(e,n),o=`${t} ${r}`,a=null,iB(s)&&s.length?s.forEach(e=>{a||iF(e)||(a=iD("UNSUPPORTED_CHAINS",`${o}, chain ${e} should be a string and conform to "namespace:chainId" format`))}):iF(e)||(a=iD("UNSUPPORTED_CHAINS",`${o}, 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"] }`)),a);l&&(i=l)}),i);o&&(n=o)}else n=iN("MISSING_OR_INVALID",`${t}, ${r} should be an object with data`);return n}(e,"connect()",t);if(r)throw Error(r.message)},this.isValidApprove=async e=>{if(!iV(e))throw Error(iN("MISSING_OR_INVALID",`approve() params: ${e}`).message);let{id:t,namespaces:r,relayProtocol:n,sessionProperties:i}=e;await this.isValidProposalId(t);let s=this.client.proposal.get(t),o=iz(r,"approve()");if(o)throw Error(o.message);let a=iG(s.requiredNamespaces,r,"approve()");if(a)throw Error(a.message);if(!iU(n,!0)){let{message:e}=iN("MISSING_OR_INVALID",`approve() relayProtocol: ${n}`);throw Error(e)}iL(i)||this.validateSessionProps(i,"sessionProperties")},this.isValidReject=async e=>{if(!iV(e)){let{message:t}=iN("MISSING_OR_INVALID",`reject() params: ${e}`);throw Error(t)}let{id:t,reason:r}=e;if(await this.isValidProposalId(t),!r||"object"!=typeof r||!r.code||!ij(r.code,!1)||!r.message||!iU(r.message,!1)){let{message:e}=iN("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(r)}`);throw Error(e)}},this.isValidSessionSettleRequest=e=>{let t;if(!iV(e)){let{message:t}=iN("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${e}`);throw Error(t)}let{relay:r,controller:n,namespaces:i,expiry:s}=e;if(!i$(r)){let{message:e}=iN("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw Error(e)}let o=(t=null,iU(n?.publicKey,!1)||(t=iN("MISSING_OR_INVALID","onSessionSettleRequest() controller public key should be a string")),t);if(o)throw Error(o.message);let a=iz(i,"onSessionSettleRequest()");if(a)throw Error(a.message);if(ip(s)){let{message:e}=iN("EXPIRED","onSessionSettleRequest()");throw Error(e)}},this.isValidUpdate=async e=>{if(!iV(e)){let{message:t}=iN("MISSING_OR_INVALID",`update() params: ${e}`);throw Error(t)}let{topic:t,namespaces:r}=e;await this.isValidSessionTopic(t);let n=this.client.session.get(t),i=iz(r,"update()");if(i)throw Error(i.message);let s=iG(n.requiredNamespaces,r,"update()");if(s)throw Error(s.message)},this.isValidExtend=async e=>{if(!iV(e)){let{message:t}=iN("MISSING_OR_INVALID",`extend() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidSessionTopic(t)},this.isValidRequest=async e=>{var t;if(!iV(e)){let{message:t}=iN("MISSING_OR_INVALID",`request() params: ${e}`);throw Error(t)}let{topic:r,request:n,chainId:i,expiry:s}=e;await this.isValidSessionTopic(r);let{namespaces:o}=this.client.session.get(r);if(!iW(o,i)){let{message:e}=iN("MISSING_OR_INVALID",`request() chainId: ${i}`);throw Error(e)}
78if(iL(n)||!iU(n.method,!1)){let{message:e}=iN("MISSING_OR_INVALID",`request() ${JSON.stringify(n)}`);throw Error(e)}if(!(iU(t=n.method,!1)&&(function(e,t){let r=[];return Object.values(e).forEach(e=>{iO(e.accounts).includes(t)&&r.push(...e.methods)}),r})(o,i).includes(t))){let{message:e}=iN("MISSING_OR_INVALID",`request() method: ${n.method}`);throw Error(e)}if(s&&(!ij(s,!1)||!(s<=ag.max)||!(s>=ag.min))){let{message:e}=iN("MISSING_OR_INVALID",`request() expiry: ${s}. Expiry must be a number (in seconds) between ${ag.min} and ${ag.max}`);throw Error(e)}},this.isValidRespond=async e=>{var t;if(!iV(e)){let{message:t}=iN("MISSING_OR_INVALID",`respond() params: ${e}`);throw Error(t)}let{topic:r,response:n}=e;try{await this.isValidSessionTopic(r)}catch(r){throw null!=(t=e?.response)&&t.id&&this.cleanupAfterResponse(e),r}if(iL(n)||iL(n.result)&&iL(n.error)||!ij(n.id,!1)||!iU(n.jsonrpc,!1)){let{message:e}=iN("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(n)}`);throw Error(e)}},this.isValidPing=async e=>{if(!iV(e)){let{message:t}=iN("MISSING_OR_INVALID",`ping() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidSessionOrPairingTopic(t)},this.isValidEmit=async e=>{var t;if(!iV(e)){let{message:t}=iN("MISSING_OR_INVALID",`emit() params: ${e}`);throw Error(t)}let{topic:r,event:n,chainId:i}=e;await this.isValidSessionTopic(r);let{namespaces:s}=this.client.session.get(r);if(!iW(s,i)){let{message:e}=iN("MISSING_OR_INVALID",`emit() chainId: ${i}`);throw Error(e)}
78if(iL(n)||!iU(n.name,!1)){let{message:e}=iN("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(n)}`);throw Error(e)}if(!(iU(t=n.name,!1)&&(function(e,t){let r=[];return Object.values(e).forEach(e=>{iO(e.accounts).includes(t)&&r.push(...e.events)}),r})(s,i).includes(t))){let{message:e}=iN("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(n)}`);throw Error(e)}},this.isValidDisconnect=async e=>{if(!iV(e)){let{message:t}=iN("MISSING_OR_INVALID",`disconnect() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidSessionOrPairingTopic(t)},this.getVerifyContext=async(e,t)=>{let r={verified:{verifyUrl:t.verifyUrl||ox,validation:"UNKNOWN",origin:t.url||""}};try{let n=await this.client.core.verify.resolve({attestationId:e,verifyUrl:t.verifyUrl});n&&(r.verified.origin=n.origin,r.verified.isScam=n.isScam,r.verified.validation=n.origin===new URL(t.url).origin?"VALID":"INVALID")}catch(e){this.client.logger.info(e)}return this.client.logger.info(`Verify context: ${JSON.stringify(r)}`),r},this.validateSessionProps=(e,t)=>{Object.values(e).forEach(e=>{if(!iU(e,!1)){let{message:r}=iN("MISSING_OR_INVALID",`${t} must be in Record<string, string> format. Received: ${JSON.stringify(e)}`);throw Error(r)}})}}async isInitialized(){if(!this.initialized){let{message:e}=iN("NOT_INITIALIZED",this.name);throw Error(e)}await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(ov.message,async e=>{let{topic:t,message:r}=e;if(this.ignoredPayloadTypes.includes(this.client.core.crypto.getPayloadType(r)))return;let n=await this.client.core.crypto.decode(t,r);try{sl(n)?(this.client.core.history.set(t,n),this.onRelayEventRequest({topic:t,payload:n})):su(n)?(await this.client.core.history.resolve(n),await this.onRelayEventResponse({topic:t,payload:n}),this.client.core.history.delete(t,n.id)):this.onRelayEventUnknownPayload({topic:t,payload:n})}catch(e){this.client.logger.error(e)}})}registerExpirerEvents(){this.client.core.expirer.on(oC.expired,async e=>{let{topic:t,id:r}=ih(e.target);if(r&&this.client.pendingRequest.keys.includes(r))return await this.deletePendingSessionRequest(r,iN("EXPIRED"),!0);t?this.client.session.keys.includes(t)&&(await this.deleteSession({topic:t,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:t})):r&&(await this.deleteProposal(r,!0),this.client.events.emit("proposal_expire",{id:r}))})}registerPairingEvents(){this.client.core.pairing.events.on(oA.create,e=>this.onPairingCreated(e))}isValidPairingTopic(e){if(!iU(e,!1)){let{message:t}=iN("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw Error(t)}if(!this.client.core.pairing.pairings.keys.includes(e)){let{message:t}=iN("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw Error(t)}if(ip(this.client.core.pairing.pairings.get(e).expiry)){let{message:t}=iN("EXPIRED",`pairing topic: ${e}`);throw Error(t)}}async isValidSessionTopic(e){if(!iU(e,!1)){let{message:t}=iN("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw Error(t)}if(!this.client.session.keys.includes(e)){let{message:t}=iN("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw Error(t)}if(ip(this.client.session.get(e).expiry)){await this.deleteSession({topic:e});let{message:t}=iN("EXPIRED",`session topic: ${e}`);throw Error(t)}if(!this.client.core.crypto.keychain.has(e)){let{message:t}=iN("MISSING_OR_INVALID",`session topic does not exist in keychain: ${e}`);throw await this.deleteSession({topic:e}),Error(t)}}async isValidSessionOrPairingTopic(e){if(this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else if(this.client.core.pairing.pairings.keys.includes(e))this.isValidPairingTopic(e);else if(iU(e,!1)){let{message:t}=iN("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw Error(t)}else{let{message:t}=iN("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw Error(t)}}async isValidProposalId(e){if("number"!=typeof e){let{message:t}=iN("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw Error(t)}if(!this.client.proposal.keys.includes(e)){let{message:t}=iN("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw Error(t)}if(ip(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);let{message:t}=iN("EXPIRED",`proposal id: ${e}`);throw Error(t)}}}class ax extends o6{constructor(e,t){super(e,t,"proposal",au),this.core=e,this.logger=t}}class aP extends o6{constructor(e,t){super(e,t,"session",au),this.core=e,this.logger=t}}class aO extends o6{constructor(e,t){super(e,t,"request",au,e=>e.id),this.core=e,this.logger=t}}class aT extends nS{constructor(e){super(e),this.protocol="wc",this.version=2,this.name=ac.name,this.events=new e2.EventEmitter,this.on=(e,t)=>this.events.on(e,t),this.once=(e,t)=>this.events.once(e,t),this.off=(e,t)=>this.events.off(e,t),this.removeListener=(e,t)=>this.events.removeListener(e,t),this.removeAllListeners=e=>this.events.removeAllListeners(e),this.connect=async e=>{try{return await this.engine.connect(e)}catch(e){throw this.logger.error(e.message),e}},this.pair=async e=>{try{return await this.engine.pair(e)}catch(e){throw this.logger.error(e.message),e}},this.approve=async e=>{try{return await this.engine.approve(e)}catch(e){throw this.logger.error(e.message),e}},this.reject=async e=>{try{return await this.engine.reject(e)}catch(e){throw this.logger.error(e.message),e}},this.update=async e=>{try{return await this.engine.update(e)}catch(e){throw this.logger.error(e.message),e}},this.extend=async e=>{try{return await this.engine.extend(e)}catch(e){throw this.logger.error(e.message),e}},this.request=async e=>{try{return await this.engine.request(e)}catch(e){throw this.logger.error(e.message),e}},this.respond=async e=>{try{return await this.engine.respond(e)}catch(e){throw this.logger.error(e.message),e}},this.ping=async e=>{try{return await this.engine.ping(e)}catch(e){throw this.logger.error(e.message),e}},this.emit=async e=>{try{return await this.engine.emit(e)}catch(e){throw this.logger.error(e.message),e}},this.disconnect=async e=>{try{return await this.engine.disconnect(e)}catch(e){throw this.logger.error(e.message),e}},this.find=e=>{try{return this.engine.find(e)}catch(e){throw this.logger.error(e.message),e}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(e){throw this.logger.error(e.message),e}},this.name=e?.name||ac.name,this.metadata=e?.metadata||(0,nz.D)()||{name:"",description:"",url:"",icons:[""]};let t="u">typeof e?.logger&&"string"!=typeof e?.logger?e.logger:r8()(nu({level:e?.logger||ac.logger}));this.core=e?.core||new aa(e),this.logger=nh(t,this.name),this.session=new aP(this.core,this.logger),this.proposal=new ax(this.core,this.logger),this.pendingRequest=new aO(this.core,this.logger),this.engine=new aI(this)}static async init(e){let t=new aT(e);return await t.initialize(),t}get context(){return nc(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.engine.init(),this.core.verify.init({verifyUrl:this.metadata.verifyUrl}),this.logger.info("SignClient Initialization Success")}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}}function aR(e=[],t=[]){return[...new Set([...e,...t])]}function aN(e){return e.includes(":")}function aD(e){return aN(e)?e.split(":")[0]:e}r(62868),r(56932),r(29461),r(20357),Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;let aB={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 aM(e,t){let{message:r,code:n}=aB[e];return{message:t?`${r} ${t}`:r,code:n}}function aL(e,t){return!!Array.isArray(e)&&(!("u">typeof t)||!e.length||e.every(t))}var aU=Object.defineProperty,aj=Object.defineProperties,aF=Object.getOwnPropertyDescriptors,aq=Object.getOwnPropertySymbols,aH=Object.prototype.hasOwnProperty,az=Object.prototype.propertyIsEnumerable,a$=(e,t,r)=>t in e?aU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,aV=(e,t)=>{for(var r in t||(t={}))aH.call(t,r)&&a$(e,r,t[r]);if(aq)for(var r of aq(t))az.call(t,r)&&a$(e,r,t[r]);return e},aW=(e,t)=>
78aj(e,aF(t));let aG={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"};class aK{constructor(e,t=!1){if(this.url=e,this.disableProviderPing=t,this.events=new e2.EventEmitter,this.isAvailable=!1,this.registering=!1,!ss(e))throw Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=t}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw Error("Connection already closed");this.onClose()}async send(e){this.isAvailable||await this.register();try{let t=rJ(e),r=await (await U()(this.url,aW(aV({},aG),{body:t}))).json();this.onPayload({data:r})}catch(t){this.onError(e.id,t)}}async register(e=this.url){if(!ss(e))throw Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){let e=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=e||this.events.listenerCount("open")>=e)&&this.events.setMaxListeners(e+1),new Promise((e,t)=>{this.events.once("register_error",e=>{this.resetMaxListeners(),t(e)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return t(Error("HTTP connection is missing or invalid"));e()})})}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){let t=rJ({id:1,jsonrpc:"2.0",method:"test",params:[]});await U()(e,aW(aV({},aG),{body:t}))}this.onOpen()}catch(t){let e=this.parseError(t);throw this.events.emit("register_error",e),this.onClose(),e}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;let t="string"==typeof e.data?rK(e.data):e.data;this.events.emit("payload",t)}onError(e,t){let r=this.parseError(t),n=se(e,r.message||r.toString());this.events.emit("payload",n)}parseError(e,t=this.url){return i5(e,t,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>10&&this.events.setMaxListeners(10)}}class aJ extends sn{constructor(e){super(e),this.events=new e2.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async request(e,t){return this.requestStrict(i7(e.method,e.params||[],e.id||i8().toString()),t)}async requestStrict(e,t){return new Promise(async(r,n)=>{if(!this.connection.connected)try{await this.open()}catch(e){n(e)}this.events.on(`${e.id}`,e=>{sh(e)?n(e.error):r(e.result)});try{await this.connection.send(e,t)}catch(e){n(e)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),su(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&3e3===e.code&&this.events.emit("error",Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),"string"==typeof e&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}}let aY="error",aQ="wc@2:universal_provider:",aZ="default_chain_changed";var aX="u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof r.g?r.g:"u">typeof self?self:{},a0={exports:{}};/**
79 * @license
80 * Lodash <https://lodash.com/>
81 * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
82 * Released under MIT license <https://lodash.com/license>
83 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
84 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
85 */!function(e,t){(function(){var r,n="Expected a function",i="__lodash_hash_undefined__",s="__lodash_placeholder__",o=1/0,a=0/0,l=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],u="[object Arguments]",c="[object Array]",h="[object Boolean]",d="[object Date]",f="[object Error]",p="[object Function]",g="[object GeneratorFunction]",y="[object Map]",m="[object Number]",v="[object Object]",b="[object Promise]",w="[object RegExp]",_="[object Set]",E="[object String]",S="[object Symbol]",A="[object WeakMap]",k="[object ArrayBuffer]",C="[object DataView]",I="[object Float32Array]",x="[object Float64Array]",P="[object Int8Array]",O="[object Int16Array]",T="[object Int32Array]",R="[object Uint8Array]",N="[object Uint8ClampedArray]",D="[object Uint16Array]",B="[object Uint32Array]",M=/\b__p \+= '';/g,L=/\b(__p \+=) '' \+/g,U=/(__e\(.*?\)|\b__t\)) \+\n'';/g,j=/&(?:amp|lt|gt|quot|#39);/g,F=/[&<>"']/g,q=RegExp(j.source),H=RegExp(F.source),z=/<%-([\s\S]+?)%>/g,$=/<%([\s\S]+?)%>/g,V=/<%=([\s\S]+?)%>/g,W=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,G=/^\w*$/,K=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,J=/[\\^$.*+?()[\]{}|]/g,Y=RegExp(J.source),Q=/^\s+/,Z=/\s/,X=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ee=/\{\n\/\* \[wrapped with (.+)\] \*/,et=/,? & /,er=
85/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,en=/[()=,{}\[\]\/\s]/,ei=/\\(\\)?/g,es=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,eo=/\w*$/,ea=/^[-+]0x[0-9a-f]+$/i,el=/^0b[01]+$/i,eu=/^\[object .+?Constructor\]$/,ec=/^0o[0-7]+$/i,eh=/^(?:0|[1-9]\d*)$/,ed=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ef=/($^)/,ep=/['\n\r\u2028\u2029\\]/g,eg="\ud800-\udfff",ey="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",em="\\u2700-\\u27bf",ev="a-z\\xdf-\\xf6\\xf8-\\xff",eb="A-Z\\xc0-\\xd6\\xd8-\\xde",ew="\\ufe0e\\ufe0f",e_="\\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",eE="['’]",eS="["+e_+"]",eA="["+ey+"]",ek="["+ev+"]",eC="[^"+eg+e_+"\\d+"+em+ev+eb+"]",eI="\ud83c[\udffb-\udfff]",ex="[^"+eg+"]",eP="(?:\ud83c[\udde6-\uddff]){2}",eO="[\ud800-\udbff][\udc00-\udfff]",eT="["+eb+"]",eR="\\u200d",eN="(?:"+ek+"|"+eC+")",eD="(?:"+eE+"(?:d|ll|m|re|s|t|ve))?",eB="(?:"+eE+"(?:D|LL|M|RE|S|T|VE))?",eM="(?:"+eA+"|"+eI+")?",eL="["+ew+"]?",eU="(?:"+eR+"(?:"+[ex,eP,eO].join("|")+")"+eL+eM+")*",ej=eL+eM+eU,eF="(?:"+["["+em+"]",eP,eO].join("|")+")"+ej,eq="(?:"+[ex+eA+"?",eA,eP,eO,"["+eg+"]"].join("|")+")",eH=RegExp(eE,"g"),ez=RegExp(eA,"g"),e$=RegExp(eI+"(?="+eI+")|"+eq+ej,"g"),eV=RegExp([eT+"?"+ek+"+"+eD+"(?="+[eS,eT,"$"].join("|")+")","(?:"+eT+"|"+eC+")+"+eB+"(?="+[eS,eT+eN,"$"].join("|")+")",eT+"?"+eN+"+"+eD,eT+"+"+eB,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])","\\d+",eF].join("|"),"g"),eW=RegExp("["+eR+eg+ey+ew+"]"),eG=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,eK=["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"],eJ=-1,eY={};eY[I]=eY[x]=eY[P]=eY[O]=eY[T]=eY[R]=eY[N]=eY[D]=eY[B]=!0,eY[u]=eY[c]=eY[k]=eY[h]=eY[C]=eY[d]=eY[f]=eY[p]=eY[y]=eY[m]=eY[v]=eY[w]=eY[_]=eY[E]=eY[A]=!1;var eQ={};eQ[u]=eQ[c]=eQ[k]=eQ[C]=eQ[h]=eQ[d]=eQ[I]=eQ[x]=eQ[P]=eQ[O]=eQ[T]=eQ[y]=eQ[m]=eQ[v]=eQ[w]=eQ[_]=eQ[E]=eQ[S]=eQ[R]=eQ[N]=eQ[D]=eQ[B]=!0,eQ[f]=eQ[p]=eQ[A]=!1;var eZ={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},eX=parseFloat,e0=parseInt,e1="object"==typeof aX&&aX&&aX.Object===Object&&aX,e2="object"==typeof self&&self&&self.Object===Object&&self,e3=e1||e2||Function("return this")(),e5=t&&!t.nodeType&&t,e6=e5&&e&&!e.nodeType&&e,e4=e6&&e6.exports===e5,e8=e4&&e1.process,e7=function(){try{return e6&&e6.require&&e6.require("util").types||e8&&e8.binding&&e8.binding("util")}catch{}}(),e9=e7&&e7.isArrayBuffer,te=e7&&e7.isDate,tt=e7&&e7.isMap,tr=e7&&e7.isRegExp,tn=e7&&e7.isSet,ti=e7&&e7.isTypedArray;function ts(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function to(e,t,r,n){for(var i=-1,s=null==e?0:e.length;++i<s;){var o=e[i];t(n,o,r(o),e)}return n}function ta(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}function tl(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(!t(e[r],r,e))return!1;return!0}function tu(e,t){for(var r=-1,n=null==e?0:e.length,i=0,s=[];++r<n;){var o=e[r];t(o,r,e)&&(s[i++]=o)}return s}function tc(e,t){return!!(null==e?0:e.length)&&tw(e,t,0)>-1}function th(e,t,r){for(var n=-1,i=null==e?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}function td(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}function tf(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}function tp(e,t,r,n){var i=-1,s=null==e?0:e.length;for(n&&s&&(r=e[++i]);++i<s;)r=t(r,e[i],i,e);return r}function tg(e,t,r,n){var i=null==e?0:e.length;for(n&&i&&(r=e[--i]);i--;)r=t(r,e[i],i,e);return r}function ty(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var tm=tA("length");function tv(e,t,r){var n;return r(e,function(e,r,i){if(t(e,r,i))return n=r,!1}),n}function tb(e,t,r,n){for(var i=e.length,s=r+(n?1:-1);n?s--:++s<i;)if(t(e[s],s,e))return s;return -1}function tw(e,t,r){return t==t?function(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return -1}(e,t,r):tb(e,tE,r)}function t_(e,t,r,n){for(var i=r-1,s=e.length;++i<s;)if(n(e[i],t))return i;return -1}function tE(e){return e!=e}function tS(e,t){var r=null==e?0:e.length;return r?tI(e,t)/r:a}function tA(e){return function(t){return null==t?r:t[e]}}function tk(e){return function(t){return null==e?r:e[t]}
vendor: 5,470 bytes, line 85
85}function tC(e,t,r,n,i){return i(e,function(e,i,s){r=n?(n=!1,e):t(r,e,i,s)}),r}function tI(e,t){for(var n,i=-1,s=e.length;++i<s;){var o=t(e[i]);o!==r&&(n=n===r?o:n+o)}return n}function tx(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function tP(e){return e&&e.slice(0,tV(e)+1).replace(Q,"")}function tO(e){return function(t){return e(t)}}function tT(e,t){return td(t,function(t){return e[t]})}function tR(e,t){return e.has(t)}function tN(e,t){for(var r=-1,n=e.length;++r<n&&tw(t,e[r],0)>-1;);return r}function tD(e,t){for(var r=e.length;r--&&tw(t,e[r],0)>-1;);return r}var tB=tk({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),tM=tk({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function tL(e){return"\\"+eZ[e]}function tU(e){return eW.test(e)}function tj(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r}function tF(e,t){return function(r){return e(t(r))}}function tq(e,t){for(var r=-1,n=e.length,i=0,o=[];++r<n;){var a=e[r];(a===t||a===s)&&(e[r]=s,o[i++]=r)}return o}function tH(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}function tz(e){return tU(e)?function(e){for(var t=e$.lastIndex=0;e$.test(e);)++t;return t}(e):tm(e)}function t$(e){return tU(e)?e.match(e$)||[]:e.split("")}function tV(e){for(var t=e.length;t--&&Z.test(e.charAt(t)););return t}var tW=tk({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),tG=function e(t){var Z,eg,ey,em,ev=(t=null==t?e3:tG.defaults(e3.Object(),t,tG.pick(e3,eK))).Array,eb=t.Date,ew=t.Error,e_=t.Function,eE=t.Math,eS=t.Object,eA=t.RegExp,ek=t.String,eC=t.TypeError,eI=ev.prototype,ex=e_.prototype,eP=eS.prototype,eO=t["__core-js_shared__"],eT=ex.toString,eR=eP.hasOwnProperty,eN=0,eD=(Z=/[^.]+$/.exec(eO&&eO.keys&&eO.keys.IE_PROTO||""))?"Symbol(src)_1."+Z:"",eB=eP.toString,eM=eT.call(eS),eL=e3._,eU=eA("^"+eT.call(eR).replace(J,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ej=e4?t.Buffer:r,eF=t.Symbol,eq=t.Uint8Array,e$=ej?ej.allocUnsafe:r,eW=tF(eS.getPrototypeOf,eS),eZ=eS.create,e1=eP.propertyIsEnumerable,e2=eI.splice,e5=eF?eF.isConcatSpreadable:r,e6=eF?eF.iterator:r,e8=eF?eF.toStringTag:r,e7=function(){try{var e=ip(eS,"defineProperty");return e({},"",{}),e}catch{}}(),tm=t.clearTimeout!==e3.clearTimeout&&t.clearTimeout,tk=eb&&eb.now!==e3.Date.now&&eb.now,tK=t.setTimeout!==e3.setTimeout&&t.setTimeout,tJ=eE.ceil,tY=eE.floor,tQ=eS.getOwnPropertySymbols,tZ=ej?ej.isBuffer:r,tX=t.isFinite,t0=eI.join,t1=tF(eS.keys,eS),t2=eE.max,t3=eE.min,t5=eb.now,t6=t.parseInt,t4=eE.random,t8=eI.reverse,t7=ip(t,"DataView"),t9=ip(t,"Map"),re=ip(t,"Promise"),rt=ip(t,"Set"),rr=ip(t,"WeakMap"),rn=ip(eS,"create"),ri=rr&&new rr,rs={},ro=ij(t7),ra=ij(t9),rl=ij(re),ru=ij(rt),rc=ij(rr),rh=eF?eF.prototype:r,rd=rh?rh.valueOf:r,rf=rh?rh.toString:r;function rp(e){if(sW(e)&&!sB(e)&&!(e instanceof rv)){if(e instanceof rm)return e;if(eR.call(e,"__wrapped__"))return iF(e)}return new rm(e)}var rg=function(){function e(){}return function(t){if(!sV(t))return{};if(eZ)return eZ(t);e.prototype=t;var n=new e;return e.prototype=r,n}}();function ry(){}function rm(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=r}function rv(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function rb(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function rw(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function r_(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function rE(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new r_;++t<r;)this.add(e[t])}function rS(e){var t=this.__data__=new rw(e);this.size=t.size}function rA(e,t){var r=sB(e),n=!r&&sD(e),i=!r&&!n&&sj(e),s=!r&&!n&&!i&&s0(e),o=r||n||i||s,a=o?tx(e.length,ek):[],l=a.length;for(var u in e)(t||eR.call(e,u))&&!(o&&("length"==u||i&&("offset"==u||"parent"==u)||s&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||i_(u,l)))&&a.push(u);return a}function rk(e){var t=e.length;return t?e[nu(0,t-1)]:r}
85function rC(e,t,n){(n===r||sT(e[t],n))&&(n!==r||t in e)||rT(e,t,n)}function rI(e,t,n){var i=e[t];eR.call(e,t)&&sT(i,n)&&(n!==r||t in e)||rT(e,t,n)}function rx(e,t){for(var r=e.length;r--;)if(sT(e[r][0],t))return r;return -1}function rP(e,t,r,n){return rU(e,function(e,i,s){t(n,e,r(e),s)}),n}function rO(e,t){return e&&nq(t,od(t),e)}function rT(e,t,r){"__proto__"==t&&e7?e7(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function rR(e,t){for(var n=-1,i=t.length,s=ev(i),o=null==e;++n<i;)s[n]=o?r:oa(e,t[n]);return s}function rN(e,t,n){return e==e&&(n!==r&&(e=e<=n?e:n),t!==r&&(e=e>=t?e:t)),e}function rD(e,t,n,i,s,o){var a,l=1&t,c=2&t,f=4&t;if(n&&(a=s?n(e,i,s,o):n(e)),a!==r)return a;if(!sV(e))return e;var b=sB(e);if(b){if(A=e.length,M=new e.constructor(A),A&&"string"==typeof e[0]&&eR.call(e,"index")&&(M.index=e.index,M.input=e.input),a=M,!l)return nF(e,a)}else{var A,M,L,U,j,F=im(e),q=F==p||F==g;if(sj(e))return nD(e,l);if(F==v||F==u||q&&!s){if(a=c||q?{}:ib(e),!l)return c?(L=(j=a)&&nq(e,of(e),j),nq(e,iy(e),L)):(U=rO(a,e),nq(e,ig(e),U))}else{if(!eQ[F])return s?e:{};a=function(e,t,r){var n,i,s=e.constructor;switch(t){case k:return nB(e);case h:case d:return new s(+e);case C:return n=r?nB(e.buffer):e.buffer,new e.constructor(n,e.byteOffset,e.byteLength);case I:case x:case P:case O:case T:case R:case N:case D:case B:return nM(e,r);case y:return new s;case m:case E:return new s(e);case w:return(i=new e.constructor(e.source,eo.exec(e))).lastIndex=e.lastIndex,i;case _:return new s;case S:return rd?eS(rd.call(e)):{}}}(e,F,l)}}o||(o=new rS);var H=o.get(e);if(H)return H;o.set(e,a),sQ(e)?e.forEach(function(r){a.add(rD(r,t,n,r,e,o))}):sG(e)&&e.forEach(function(r,i){a.set(i,rD(r,t,n,i,e,o))});var z=f?c?io:is:c?of:od,$=b?r:z(e);return ta($||e,function(r,i){$&&(r=e[i=r]),rI(a,i,rD(r,t,n,i,e,o))}),a}function rB(e,t,n){var i=n.length;if(null==e)return!i;for(e=eS(e);i--;){var s=n[i],o=t[s],a=e[s];if(a===r&&!(s in e)||!o(a))return!1}return!0}function rM(e,t,i){if("function"!=typeof e)throw new eC(n);return iR(function(){e.apply(r,i)},t)}function rL(e,t,r,n){var i=-1,s=tc,o=!0,a=e.length,l=[],u=t.length;if(!a)return l;r&&(t=td(t,tO(r))),n?(s=th,o=!1):t.length>=200&&(s=tR,o=!1,t=new rE(t));e:for(;++i<a;){var c=e[i],h=null==r?c:r(c);if(c=n||0!==c?c:0,o&&h==h){for(var d=u;d--;)if(t[d]===h)continue e;l.push(c)}else s(t,h,n)||l.push(c)}return l}rp.templateSettings={escape:z,evaluate:$,interpolate:V,variable:"",imports:{_:rp}},rp.prototype=ry.prototype,rp.prototype.constructor=rp,rm.prototype=rg(ry.prototype),rm.prototype.constructor=rm,rv.prototype=rg(ry.prototype),rv.prototype.constructor=rv,rb.prototype.clear=function(){this.__data__=rn?rn(null):{},this.size=0},rb.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},rb.prototype.get=function(e){var t=this.__data__;if(rn){var n=t[e];return n===i?r:n}return eR.call(t,e)?t[e]:r},rb.prototype.has=function(e){var t=this.__data__;return rn?t[e]!==r:eR.call(t,e)},rb.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=rn&&t===r?i:t,this},rw.prototype.clear=function(){this.__data__=[],this.size=0},rw.prototype.delete=function(e){var t=this.__data__,r=rx(t,e);return!(r<0)&&(r==t.length-1?t.pop():e2.call(t,r,1),--this.size,!0)},rw.prototype.get=function(e){var t=this.__data__,n=rx(t,e);return n<0?r:t[n][1]},rw.prototype.has=function(e){return rx(this.__data__,e)>-1},rw.prototype.set=function(e,t){var r=this.__data__,n=rx(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},r_.prototype.clear=function(){this.size=0,this.__data__={hash:new rb,map:new(t9||rw),string:new rb}},r_.prototype.delete=function(e){var t=ih(this,e).delete(e);return this.size-=t?1:0,t},r_.prototype.get=function(e){return ih(this,e).get(e)},r_.prototype.has=function(e){return ih(this,e).has(e)},r_.prototype.set=function(e,t){var r=ih(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},rE.prototype.add=rE.prototype.push=function(e){return this.__data__.set(e,i),this},rE.prototype.has=function(e){return this.__data__.has(e)},rS.prototype.clear=function(){this.__data__=new rw,this.size=0},rS.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},rS.prototype.get=function(e){return this.__data__.get(e)},rS.prototype.has=function(e){return this.__data__.has(e)},rS.prototype.set=function(e,t){var r=this.__data__;if(r instanceof rw){var n=r.__data__;if(!t9||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new r_(n)}return r.set(e,t),this.size=r.size,this};var rU=n$(rW),rj=n$(rG,!0);function rF(e,t){var r=!0;return rU(e,function(e,n,i){return r=!!t(e,n,i)}),r}function rq(e,t,n){for(var i=-1,s=e.length;++i<s;){var o=e[i],a=t(o);if(null!=a&&(l===r?a==a&&!sX(a):n(a,l)))var l=a,u=o}return u}function rH(e,t){var r=[];return rU(e,function(e,n,i){t(e,n,i)&&r.push(e)}),r}function rz(e,t,r,n,i){var s=-1,o=e.length;for(r||(r=iw),i||(i=[]);++s<o;){var a=e[s];t>0&&r(a)?t>
851?rz(a,t-1,r,n,i):tf(i,a):n||(i[i.length]=a)}return i}var r$=nV(),rV=nV(!0);function rW(e,t){return e&&r$(e,t,od)}function rG(e,t){return e&&rV(e,t,od)}function rK(e,t){return tu(t,function(t){return sH(e[t])})}function rJ(e,t){t=nT(t,e);for(var n=0,i=t.length;null!=e&&n<i;)e=e[iU(t[n++])];return n&&n==i?e:r}function rY(e,t,r){var n=t(e);return sB(e)?n:tf(n,r(e))}function rQ(e){return null==e?e===r?"[object Undefined]":"[object Null]":e8&&e8 in eS(e)?function(e){var t=eR.call(e,e8),n=e[e8];try{e[e8]=r;var i=!0}catch{}var s=eB.call(e);return i&&(t?e[e8]=n:delete e[e8]),s}(e):eB.call(e)}function rZ(e,t){return e>t}function rX(e,t){return null!=e&&eR.call(e,t)}function r0(e,t){return null!=e&&t in eS(e)}function r1(e,t,n){for(var i=n?th:tc,s=e[0].length,o=e.length,a=o,l=ev(o),u=1/0,c=[];a--;){var h=e[a];a&&t&&(h=td(h,tO(t))),u=t3(h.length,u),l[a]=!n&&(t||s>=120&&h.length>=120)?new rE(a&&h):r}h=e[0];var d=-1,f=l[0];e:for(;++d<s&&c.length<u;){var p=h[d],g=t?t(p):p;if(p=n||0!==p?p:0,!(f?tR(f,g):i(c,g,n))){for(a=o;--a;){var y=l[a];if(!(y?tR(y,g):i(e[a],g,n)))continue e}f&&f.push(g),c.push(p)}}return c}function r2(e,t,n){t=nT(t,e);var i=null==(e=iP(e,t))?e:e[iU(iQ(t))];return null==i?r:ts(i,e,n)}function r3(e){return sW(e)&&rQ(e)==u}function r5(e,t,n,i,s){return e===t||(null!=e&&null!=t&&(sW(e)||sW(t))?function(e,t,n,i,s,o){var a=sB(e),l=sB(t),p=a?c:im(e),g=l?c:im(t);p=p==u?v:p,g=g==u?v:g;var b=p==v,A=g==v,I=p==g;if(I&&sj(e)){if(!sj(t))return!1;a=!0,b=!1}if(I&&!b)return o||(o=new rS),a||s0(e)?ir(e,t,n,i,s,o):function(e,t,r,n,i,s,o){switch(r){case C:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)break;e=e.buffer,t=t.buffer;case k:return!(e.byteLength!=t.byteLength||!s(new eq(e),new eq(t)));case h:case d:case m:return sT(+e,+t);case f:return e.name==t.name&&e.message==t.message;case w:case E:return e==t+"";case y:var a=tj;case _:var l=1&n;if(a||(a=tH),e.size!=t.size&&!l)break;var u=o.get(e);if(u)return u==t;n|=2,o.set(e,t);var c=ir(a(e),a(t),n,i,s,o);return o.delete(e),c;case S:if(rd)return rd.call(e)==rd.call(t)}return!1}(e,t,p,n,i,s,o);if(!(1&n)){var x=b&&eR.call(e,"__wrapped__"),P=A&&eR.call(t,"__wrapped__");
vendor: 5,078 bytes, line 85
85if(x||P){var O=x?e.value():e,T=P?t.value():t;return o||(o=new rS),s(O,T,n,i,o)}}return!!I&&(o||(o=new rS),function(e,t,n,i,s,o){var a=1&n,l=is(e),u=l.length;if(u!=is(t).length&&!a)return!1;for(var c=u;c--;){var h=l[c];if(!(a?h in t:eR.call(t,h)))return!1}var d=o.get(e),f=o.get(t);if(d&&f)return d==t&&f==e;var p=!0;o.set(e,t),o.set(t,e);for(var g=a;++c<u;){var y=e[h=l[c]],m=t[h];if(i)var v=a?i(m,y,h,t,e,o):i(y,m,h,e,t,o);if(!(v===r?y===m||s(y,m,n,i,o):v)){p=!1;break}g||(g="constructor"==h)}if(p&&!g){var b=e.constructor,w=t.constructor;b!=w&&"constructor"in e&&"constructor"in t&&!("function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w)&&(p=!1)}return o.delete(e),o.delete(t),p}(e,t,n,i,s,o))}(e,t,n,i,r5,s):e!=e&&t!=t)}function r6(e,t,n,i){var s=n.length,o=s,a=!i;if(null==e)return!o;for(e=eS(e);s--;){var l=n[s];if(a&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++s<o;){var u=(l=n[s])[0],c=e[u],h=l[1];if(a&&l[2]){if(c===r&&!(u in e))return!1}else{var d=new rS;if(i)var f=i(c,h,u,e,t,d);if(!(f===r?r5(h,c,3,i,d):f))return!1}}return!0}function r4(e){return!(!sV(e)||eD&&eD in e)&&(sH(e)?eU:eu).test(ij(e))}function r8(e){return"function"==typeof e?e:null==e?oU:"object"==typeof e?sB(e)?nr(e[0],e[1]):nt(e):oG(e)}function r7(e){if(!iC(e))return t1(e);var t=[];for(var r in eS(e))eR.call(e,r)&&"constructor"!=r&&t.push(r);return t}function r9(e,t){return e<t}function ne(e,t){var r=-1,n=sL(e)?ev(e.length):[];return rU(e,function(e,i,s){n[++r]=t(e,i,s)}),n}function nt(e){var t=id(e);return 1==t.length&&t[0][2]?iI(t[0][0],t[0][1]):function(r){return r===e||r6(r,e,t)}}function nr(e,t){var n;return iS(e)&&(n=t)==n&&!sV(n)?iI(iU(e),t):function(n){var i=oa(n,e);return i===r&&i===t?ol(n,e):r5(t,i,3)}}function nn(e,t,n,i,s){e!==t&&r$(t,function(o,a){if(s||(s=new rS),sV(o))!function(e,t,n,i,s,o,a){var l=iO(e,n),u=iO(t,n),c=a.get(u);if(c){rC(e,n,c);return}var h=o?o(l,u,n+"",e,t,a):r,d=h===r;if(d){var f=sB(u),p=!f&&sj(u),g=!f&&!p&&s0(u);h=u,f||p||g?sB(l)?h=l:sU(l)?h=nF(l):p?(d=!1,h=nD(u,!0)):g?(d=!1,h=nM(u,!0)):h=[]:sJ(u)||sD(u)?(h=l,sD(l)?h=s7(l):(!sV(l)||sH(l))&&(h=ib(u))):d=!1}d&&(a.set(u,h),s(h,u,i,o,a),a.delete(u)),rC(e,n,h)}(e,t,a,n,nn,i,s);else{var l=i?i(iO(e,a),o,a+"",e,t,s):r;l===r&&(l=o),rC(e,a,l)}},of)}function ni(e,t){var n=e.length;if(n)return i_(t+=t<0?n:0,n)?e[t]:r}function ns(e,t,r){t=t.length?td(t,function(e){return sB(e)?function(t){return rJ(t,1===e.length?e[0]:e)}:e}):[oU];var n=-1;return t=td(t,tO(ic())),function(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}(ne(e,function(e,r,i){return{criteria:td(t,function(t){return t(e)}),index:++n,value:e}}),function(e,t){return function(e,t,r){for(var n=-1,i=e.criteria,s=t.criteria,o=i.length,a=r.length;++n<o;){var l=nL(i[n],s[n]);if(l){if(n>=a)return l;return l*("desc"==r[n]?-1:1)}}return e.index-t.index}(e,t,r)})}function no(e,t,r){for(var n=-1,i=t.length,s={};++n<i;){var o=t[n],a=rJ(e,o);r(a,o)&&nd(s,nT(o,e),a)}return s}function na(e,t,r,n){var i=n?t_:tw,s=-1,o=t.length,a=e;for(e===t&&(t=nF(t)),r&&(a=td(e,tO(r)));++s<o;)for(var l=0,u=t[s],c=r?r(u):u;(l=i(a,c,l,n))>-1;)a!==e&&e2.call(a,l,1),e2.call(e,l,1);return e}function nl(e,t){for(var r=e?t.length:0,n=r-1;r--;){var i=t[r];if(r==n||i!==s){var s=i;i_(i)?e2.call(e,i,1):nS(e,i)}}return e}function nu(e,t){return e+tY(t4()*(t-e+1))}function nc(e,t){var r="";if(!e||t<1||t>9007199254740991)return r;do t%2&&(r+=e),(t=tY(t/2))&&(e+=e);while(t);return r}function nh(e,t){return iN(ix(e,t,oU),e+"")}function nd(e,t,n,i){if(!sV(e))return e;t=nT(t,e);for(var s=-1,o=t.length,a=o-1,l=e;null!=l&&++s<o;){var u=iU(t[s]),c=n;if("__proto__"===u||"constructor"===u||"prototype"===u)break;if(s!=a){var h=l[u];(c=i?i(h,u,l):r)===r&&(c=sV(h)?h:i_(t[s+1])?[]:{})}rI(l,u,c),l=l[u]}return e}var nf=ri?function(e,t){return ri.set(e,t),e}:oU,np=e7?function(e,t){return e7(e,"toString",{configurable:!0,enumerable:!1,value:oB(t),writable:!0})}:oU;function ng(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var s=ev(i);++n<i;)s[n]=e[n+t];return s}function ny(e,t){var r;return rU(e,function(e,n,i){return!(r=t(e,n,i))}),!!r}function nm(e,t,r){var n=0,i=null==e?n:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;n<i;){var s=n+i>>>1,o=e[s];null!==o&&!sX(o)&&(r?o<=t:o<t)?n=s+1:i=s}return i}return nv(e,t,oU,r)}function nv(e,t,n,i){var s=0,o=null==e?0:e.length;if(0===o)return 0;t=n(t);for(var a=t!=t,l=null===t,u=sX(t),c=t===r;s<o;){var h=tY((s+o)/2),d=n(e[h]),f=d!==r,p=null===d,g=d==d,y=sX(d);if(a)var m=i||g;else m=c?g&&(i||f):l?g&&f&&(i||!p):u?g&&f&&!p&&(i||!y):!p&&!y&&(i?d<=t:d<t);m?s=h+1:o=h}return t3(o,4294967294)}function nb(e,t){for(var r=-1,n=e.length,i=0,s=[];++r<n;){var o=e[r],a=t?t(o):o;if(!r||!sT(a,l)){var l=a;s[i++]=0===o?0:o}}return s}function nw(e){return"number"==typeof e?e:sX(e)?a:+e}function n_(e){if("string"==typeof e)return e;if(sB(e))return td(e,n_)+"";if(sX(e))return rf?rf.call(e):"";var t=e+"";return"0"==t&&1/e==-o?"-0":t}function nE(e,t,r){var n=-1,i=tc,s=e.length,o=!0,a=[],l=a;if(r)o=!1,i=th;else if(s>=200){var u=t?null:n4(e);
vendor: 4,947 bytes, line 85
85if(u)return tH(u);o=!1,i=tR,l=new rE}else l=t?[]:a;e:for(;++n<s;){var c=e[n],h=t?t(c):c;if(c=r||0!==c?c:0,o&&h==h){for(var d=l.length;d--;)if(l[d]===h)continue e;t&&l.push(h),a.push(c)}else i(l,h,r)||(l!==a&&l.push(h),a.push(c))}return a}function nS(e,t){return t=nT(t,e),null==(e=iP(e,t))||delete e[iU(iQ(t))]}function nA(e,t,r,n){return nd(e,t,r(rJ(e,t)),n)}function nk(e,t,r,n){for(var i=e.length,s=n?i:-1;(n?s--:++s<i)&&t(e[s],s,e););return r?ng(e,n?0:s,n?s+1:i):ng(e,n?s+1:0,n?i:s)}function nC(e,t){var r=e;return r instanceof rv&&(r=r.value()),tp(t,function(e,t){return t.func.apply(t.thisArg,tf([e],t.args))},r)}function nI(e,t,r){var n=e.length;if(n<2)return n?nE(e[0]):[];for(var i=-1,s=ev(n);++i<n;)for(var o=e[i],a=-1;++a<n;)a!=i&&(s[i]=rL(s[i]||o,e[a],t,r));return nE(rz(s,1),t,r)}function nx(e,t,n){for(var i=-1,s=e.length,o=t.length,a={};++i<s;){var l=i<o?t[i]:r;n(a,e[i],l)}return a}function nP(e){return sU(e)?e:[]}function nO(e){return"function"==typeof e?e:oU}function nT(e,t){return sB(e)?e:iS(e,t)?[e]:iL(s9(e))}function nR(e,t,n){var i=e.length;return n=n===r?i:n,!t&&n>=i?e:ng(e,t,n)}var nN=tm||function(e){return e3.clearTimeout(e)};function nD(e,t){if(t)return e.slice();var r=e.length,n=e$?e$(r):new e.constructor(r);return e.copy(n),n}function nB(e){var t=new e.constructor(e.byteLength);return new eq(t).set(new eq(e)),t}function nM(e,t){var r=t?nB(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function nL(e,t){if(e!==t){var n=e!==r,i=null===e,s=e==e,o=sX(e),a=t!==r,l=null===t,u=t==t,c=sX(t);if(!l&&!c&&!o&&e>t||o&&a&&u&&!l&&!c||i&&a&&u||!n&&u||!s)return 1;if(!i&&!o&&!c&&e<t||c&&n&&s&&!i&&!o||l&&n&&s||!a&&s||!u)return -1}return 0}function nU(e,t,r,n){for(var i=-1,s=e.length,o=r.length,a=-1,l=t.length,u=t2(s-o,0),c=ev(l+u),h=!n;++a<l;)c[a]=t[a];for(;++i<o;)(h||i<s)&&(c[r[i]]=e[i]);for(;u--;)c[a++]=e[i++];return c}function nj(e,t,r,n){for(var i=-1,s=e.length,o=-1,a=r.length,l=-1,u=t.length,c=t2(s-a,0),h=ev(c+u),d=!n;++i<c;)h[i]=e[i];for(var f=i;++l<u;)h[f+l]=t[l];for(;++o<a;)(d||i<s)&&(h[f+r[o]]=e[i++]);return h}function nF(e,t){var r=-1,n=e.length;for(t||(t=ev(n));++r<n;)t[r]=e[r];return t}function nq(e,t,n,i){var s=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var l=t[o],u=i?i(n[l],e[l],l,n,e):r;u===r&&(u=e[l]),s?rT(n,l,u):rI(n,l,u)}return n}function nH(e,t){return function(r,n){var i=sB(r)?to:rP,s=t?t():{};return i(r,e,ic(n,2),s)}}function nz(e){return nh(function(t,n){var i=-1,s=n.length,o=s>1?n[s-1]:r,a=s>2?n[2]:r;for(o=e.length>3&&"function"==typeof o?(s--,o):r,a&&iE(n[0],n[1],a)&&(o=s<3?r:o,s=1),t=eS(t);++i<s;){var l=n[i];l&&e(t,l,i,o)}return t})}function n$(e,t){return function(r,n){if(null==r)return r;if(!sL(r))return e(r,n);for(var i=r.length,s=t?i:-1,o=eS(r);(t?s--:++s<i)&&!1!==n(o[s],s,o););return r}}function nV(e){return function(t,r,n){for(var i=-1,s=eS(t),o=n(t),a=o.length;a--;){var l=o[e?a:++i];if(!1===r(s[l],l,s))break}return t}}function nW(e){return function(t){var n=tU(t=s9(t))?t$(t):r,i=n?n[0]:t.charAt(0),s=n?nR(n,1).join(""):t.slice(1);return i[e]()+s}}function nG(e){return function(t){return tp(oR(oA(t).replace(eH,"")),e,"")}}function nK(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=rg(e.prototype),n=e.apply(r,t);return sV(n)?n:r}}function nJ(e){return function(t,n,i){var s=eS(t);if(!sL(t)){var o=ic(n,3);t=od(t),n=function(e){return o(s[e],e,s)}}var a=e(t,n,i);return a>-1?s[o?t[a]:a]:r}}function nY(e){return ii(function(t){var i=t.length,s=i,o=rm.prototype.thru;for(e&&t.reverse();s--;){var a=t[s];if("function"!=typeof a)throw new eC(n);if(o&&!l&&"wrapper"==il(a))var l=new rm([],!0)}for(s=l?s:i;++s<i;){var u=il(a=t[s]),c="wrapper"==u?ia(a):r;l=c&&iA(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?l[il(c[0])].apply(l,c[3]):1==a.length&&iA(a)?l[u]():l.thru(a)}return function(){var e=arguments,r=e[0];if(l&&1==e.length&&sB(r))return l.plant(r).value();for(var n=0,s=i?t[n].apply(this,e):r;++n<i;)s=t[n].call(this,s);return s}})}function nQ(e,t,n,i,s,o,a,l,u,c){var h=128&t,d=1&t,f=2&t,p=24&t,g=512&t,y=f?r:nK(e);return function m(){for(var v=arguments.length,b=ev(v),w=v;w--;)b[w]=arguments[w];if(p)var _=iu(m),E=function(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}(b,_);if(i&&(b=nU(b,i,s,p)),o&&(b=nj(b,o,a,p)),v-=E,p&&v<c){var S=tq(b,_);return n5(e,t,nQ,m.placeholder,n,b,S,l,u,c-v)}var A=d?n:this,k=f?A[e]:e;return v=b.length,l?b=function(e,t){for(var n=e.length,i=t3(t.length,n),s=nF(e);i--;){var o=t[i];e[i]=i_(o,n)?s[o]:r}return e}(b,l):g&&v>1&&b.reverse(),h&&u<v&&(b.length=u),this&&this!==e3&&this instanceof m&&(k=y||nK(k)),k.apply(A,b)}}function nZ(e,t){return function(r,n){var i,s;return i=t(n),s={}
85,rW(r,function(t,r,n){e(s,i(t),r,n)}),s}}function nX(e,t){return function(n,i){var s;if(n===r&&i===r)return t;if(n!==r&&(s=n),i!==r){if(s===r)return i;"string"==typeof n||"string"==typeof i?(n=n_(n),i=n_(i)):(n=nw(n),i=nw(i)),s=e(n,i)}return s}}function n0(e){return ii(function(t){return t=td(t,tO(ic())),nh(function(r){var n=this;return e(t,function(e){return ts(e,n,r)})})})}function n1(e,t){var n=(t=t===r?" ":n_(t)).length;if(n<2)return n?nc(t,e):t;var i=nc(t,tJ(e/tz(t)));return tU(t)?nR(t$(i),0,e).join(""):i.slice(0,e)}function n2(e){return function(t,n,i){return i&&"number"!=typeof i&&iE(t,n,i)&&(n=i=r),t=s5(t),n===r?(n=t,t=0):n=s5(n),i=i===r?t<n?1:-1:s5(i),function(e,t,r,n){for(var i=-1,s=t2(tJ((t-e)/(r||1)),0),o=ev(s);s--;)o[n?s:++i]=e,e+=r;return o}(t,n,i,e)}}function n3(e){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=s8(t),r=s8(r)),e(t,r)}}function n5(e,t,n,i,s,o,a,l,u,c){var h=8&t,d=h?a:r,f=h?r:a,p=h?o:r,g=h?r:o;t|=h?32:64,4&(t&=~(h?64:32))||(t&=-4);var y=[e,t,s,p,d,g,f,l,u,c],m=n.apply(r,y);return iA(e)&&iT(m,y),m.placeholder=i,iD(m,e,t)}function n6(e){var t=eE[e];return function(e,r){if(e=s8(e),(r=null==r?0:t3(s6(r),292))&&tX(e)){var n=(s9(e)+"e").split("e");return+((n=(s9(t(n[0]+"e"+(+n[1]+r)))+"e").split("e"))[0]+"e"+(+n[1]-r))}return t(e)}}var n4=rt&&1/tH(new rt([,-0]))[1]==o?function(e){return new rt(e)}:oz;function n8(e){return function(t){var r,n,i=im(t);return i==y?tj(t):i==_?(r=-1,n=Array(t.size),t.forEach(function(e){n[++r]=[e,e]}),n):td(e(t),function(e){return[e,t[e]]})}}function n7(e,t,i,o,a,l,u,c){var h=2&t;if(!h&&"function"!=typeof e)throw new eC(n);var d=o?o.length:0;if(d||(t&=-97,o=a=r),u=u===r?u:t2(s6(u),0),c=c===r?c:s6(c),d-=a?a.length:0,64&t){var f=o,p=a;o=a=r}var g=h?r:ia(e),y=[e,t,i,o,a,f,p,l,u,c];if(g&&function(e,t){var r=e[1],n=t[1],i=r|n,o=i<131,a=128==n&&8==r||128==n&&256==r&&e[7].length<=t[8]||384==n&&t[7].length<=t[8]&&8==r;if(o||a){1&n&&(e[2]=t[2],i|=1&r?0:4);var l=t[3];if(l){var u=e[3];e[3]=u?nU(u,l,t[4]):l,e[4]=u?tq(e[3],s):t[4]}(l=t[5])&&(u=e[5],e[5]=u?nj(u,l,t[6]):l,e[6]=u?tq(e[5],s):t[6]),(l=t[7])&&(e[7]=l),128&n&&(e[8]=null==e[8]?t[8]:t3(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i}}(y,g),e=y[0],t=y[1],i=y[2],o=y[3],a=y[4],(c=y[9]=y[9]===r?h?0:e.length:t2(y[9]-d,0))||!(24&t)||(t&=-25),t&&1!=t)8==t||16==t?(m=e,v=t,b=c,w=nK(m),R=function e(){for(var t=arguments.length,n=ev(t),i=t,s=iu(e);i--;)n[i]=arguments[i];var o=t<3&&n[0]!==s&&n[t-1]!==s?[]:tq(n,s);return(t-=o.length)<b?n5(m,v,nQ,e.placeholder,r,n,o,r,r,b-t):ts(this&&this!==e3&&this instanceof e?w:m,this,n)}):32!=t&&33!=t||a.length?R=nQ.apply(r,y):(_=e,E=t,S=i,A=o,k=1&E,C=nK(_),R=function e(){for(var t=-1,r=arguments.length,n=-1,i=A.length,s=ev(i+r),o=this&&this!==e3&&this instanceof e?C:_;++n<i;)s[n]=A[n];for(;r--;)s[n++]=arguments[++t];return ts(o,k?S:this,s)});else var m,v,b,w,_,E,S,A,k,C,I,x,P,O,T,R=(I=e,x=t,P=i,O=1&x,T=nK(I),function e(){return(this&&this!==e3&&this instanceof e?T:I).apply(O?P:this,arguments)});return iD((g?nf:iT)(R,y),e,t)}function n9(e,t,n,i){return e===r||sT(e,eP[n])&&!eR.call(i,n)?t:e}function ie(e,t,n,i,s,o){return sV(e)&&sV(t)&&(o.set(t,e),nn(e,t,r,ie,o),o.delete(t)),e}function it(e){return sJ(e)?r:e}function ir(e,t,n,i,s,o){var a=1&n,l=e.length,u=t.length;if(l!=u&&!(a&&u>l))return!1;var c=o.get(e),h=o.get(t);if(c&&h)return c==t&&h==e;var d=-1,f=!0,p=2&n?new rE:r;for(o.set(e,t),o.set(t,e);++d<l;){var g=e[d],y=t[d];if(i)var m=a?i(y,g,d,t,e,o):i(g,y,d,e,t,o);if(m!==r){if(m)continue;f=!1;break}if(p){if(!ty(t,function(e,t){if(!tR(p,t)&&(g===e||s(g,e,n,i,o)))return p.push(t)})){f=!1;break}}else if(!(g===y||s(g,y,n,i,o))){f=!1;break}}return o.delete(e),o.delete(t),f}function ii(e){return iN(ix(e,r,iW),e+"")}function is(e){return rY(e,od,ig)}function io(e){return rY(e,of,iy)}var ia=ri?function(e){return ri.get(e)}:oz;function il(e){for(var t=e.name+"",r=rs[t],n=eR.call(rs,t)?r.length:0;n--;){var i=r[n],s=i.func;if(null==s||s==e)return i.name}return t}function iu(e){return(eR.call(rp,"placeholder")?rp:e).placeholder}function ic(){var e=rp.iteratee||oj;return e=e===oj?r8:e,arguments.length?e(arguments[0],arguments[1]):e}function ih(e,t){var r,n=e.__data__;return("string"==(r=typeof t)||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==t:null===t)?n["string"==typeof t?"string":"hash"]:n.map}function id(e){for(var t=od(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,i==i&&!sV(i)]}return t}function ip(e,t){var n=null==e?r:e[t];return r4(n)?n:r}var ig=tQ?function(e){return null==e?[]:tu(tQ(e=eS(e)),function(t){return e1.call(e,t)})}:oY,iy=tQ?function(e){for(var t=[];e;
vendor: 6,293 bytes, lines 85-87
85)tf(t,ig(e)),e=eW(e);return t}:oY,im=rQ;function iv(e,t,r){t=nT(t,e);for(var n=-1,i=t.length,s=!1;++n<i;){var o=iU(t[n]);if(!(s=null!=e&&r(e,o)))break;e=e[o]}return s||++n!=i?s:!!(i=null==e?0:e.length)&&s$(i)&&i_(o,i)&&(sB(e)||sD(e))}function ib(e){return"function"!=typeof e.constructor||iC(e)?{}:rg(eW(e))}function iw(e){return sB(e)||sD(e)||!!(e5&&e&&e[e5])}function i_(e,t){var r=typeof e;return!!(t=t??9007199254740991)&&("number"==r||"symbol"!=r&&eh.test(e))&&e>-1&&e%1==0&&e<t}function iE(e,t,r){if(!sV(r))return!1;var n=typeof t;return("number"==n?!!(sL(r)&&i_(t,r.length)):"string"==n&&t in r)&&sT(r[t],e)}function iS(e,t){if(sB(e))return!1;var r=typeof e;return!!("number"==r||"symbol"==r||"boolean"==r||null==e||sX(e))||G.test(e)||!W.test(e)||null!=t&&e in eS(t)}function iA(e){var t=il(e),r=rp[t];if("function"!=typeof r||!(t in rv.prototype))return!1;if(e===r)return!0;var n=ia(r);return!!n&&e===n[0]}(t7&&im(new t7(new ArrayBuffer(1)))!=C||t9&&im(new t9)!=y||re&&im(re.resolve())!=b||rt&&im(new rt)!=_||rr&&im(new rr)!=A)&&(im=function(e){var t=rQ(e),n=t==v?e.constructor:r,i=n?ij(n):"";if(i)switch(i){case ro:return C;case ra:return y;case rl:return b;case ru:return _;case rc:return A}return t});var ik=eO?sH:oQ;function iC(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||eP)}function iI(e,t){return function(n){return null!=n&&n[e]===t&&(t!==r||e in eS(n))}}function ix(e,t,n){return t=t2(t===r?e.length-1:t,0),function(){for(var r=arguments,i=-1,s=t2(r.length-t,0),o=ev(s);++i<s;)o[i]=r[t+i];i=-1;for(var a=ev(t+1);++i<t;)a[i]=r[i];return a[t]=n(o),ts(e,this,a)}}function iP(e,t){return t.length<2?e:rJ(e,ng(t,0,-1))}function iO(e,t){if(!("constructor"===t&&"function"==typeof e[t])&&"__proto__"!=t)return e[t]}var iT=iB(nf),iR=tK||function(e,t){return e3.setTimeout(e,t)},iN=iB(np);function iD(e,t,r){var n,i,s=t+"";return iN(e,function(e,t){var r=t.length;if(!r)return e;var n=r-1;return t[n]=(r>1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(X,`{
86/* [wrapped with `+t+`] */
87`)}(s,(n=(i=s.match(ee))?i[1].split(et):[],ta(l,function(e){var t="_."+e[0];r&e[1]&&!tc(n,t)&&n.push(t)}),n.sort())))}function iB(e){var t=0,n=0;return function(){var i=t5(),s=16-(i-n);if(n=i,s>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(r,arguments)}}function iM(e,t){var n=-1,i=e.length,s=i-1;for(t=t===r?i:t;++n<t;){var o=nu(n,s),a=e[o];e[o]=e[n],e[n]=a}return e.length=t,e}var iL=(ey=(eg=sk(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(K,function(e,r,n,i){t.push(n?i.replace(ei,"$1"):r||e)}),t},function(e){return 500===ey.size&&ey.clear(),e})).cache,eg);function iU(e){if("string"==typeof e||sX(e))return e;var t=e+"";return"0"==t&&1/e==-o?"-0":t}function ij(e){if(null!=e){try{return eT.call(e)}catch{}try{return e+""}catch{}}return""}function iF(e){if(e instanceof rv)return e.clone();var t=new rm(e.__wrapped__,e.__chain__);return t.__actions__=nF(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var iq=nh(function(e,t){return sU(e)?rL(e,rz(t,1,sU,!0)):[]}),iH=nh(function(e,t){var n=iQ(t);return sU(n)&&(n=r),sU(e)?rL(e,rz(t,1,sU,!0),ic(n,2)):[]}),iz=nh(function(e,t){var n=iQ(t);return sU(n)&&(n=r),sU(e)?rL(e,rz(t,1,sU,!0),r,n):[]});function i$(e,t,r){var n=null==e?0:e.length;if(!n)return -1;var i=null==r?0:s6(r);return i<0&&(i=t2(n+i,0)),tb(e,ic(t,3),i)}function iV(e,t,n){var i=null==e?0:e.length;if(!i)return -1;var s=i-1;return n!==r&&(s=s6(n),s=n<0?t2(i+s,0):t3(s,i-1)),tb(e,ic(t,3),s,!0)}function iW(e){return(null==e?0:e.length)?rz(e,1):[]}function iG(e){return e&&e.length?e[0]:r}var iK=nh(function(e){var t=td(e,nP);return t.length&&t[0]===e[0]?r1(t):[]}),iJ=nh(function(e){var t=iQ(e),n=td(e,nP);return t===iQ(n)?t=r:n.pop(),n.length&&n[0]===e[0]?r1(n,ic(t,2)):[]}),iY=nh(function(e){var t=iQ(e),n=td(e,nP);return(t="function"==typeof t?t:r)&&n.pop(),n.length&&n[0]===e[0]?r1(n,r,t):[]});function iQ(e){var t=null==e?0:e.length;return t?e[t-1]:r}var iZ=nh(iX);function iX(e,t){return e&&e.length&&t&&t.length?na(e,t):e}var i0=ii(function(e,t){var r=null==e?0:e.length,n=rR(e,t);return nl(e,td(t,function(e){return i_(e,r)?+e:e}).sort(nL)),n});function i1(e){return null==e?e:t8.call(e)}var i2=nh(function(e){return nE(rz(e,1,sU,!0))}),i3=nh(function(e){var t=iQ(e);return sU(t)&&(t=r),nE(rz(e,1,sU,!0),ic(t,2))}),i5=nh(function(e){var t=iQ(e);return t="function"==typeof t?t:r,nE(rz(e,1,sU,!0),r,t)});function i6(e){if(!(e&&e.length))return[];var t=0;return e=tu(e,function(e){if(sU(e))return t=t2(e.length,t),!0}),tx(t,function(t){return td(e,tA(t))})}function i4(e,t){if(!(e&&e.length))return[];var n=i6(e);return null==t?n:td(n,function(e){return ts(t,r,e)})}var i8=nh(function(e,t){return sU(e)?rL(e,t):[]}),i7=nh(function(e){return nI(tu(e,sU))}),i9=nh(function(e){var t=iQ(e);return sU(t)&&(t=r),nI(tu(e,sU),ic(t,2))}),se=nh(function(e){var t=iQ(e);return t="function"==typeof t?t:r,nI(tu(e,sU),r,t)}),st=nh(i6),sr=nh(function(e){var t=e.length,n=t>1?e[t-1]:r;return n="function"==typeof n?(e.pop(),n):r,i4(e,n)});function sn(e){var t=rp(e);return t.__chain__=!0,t}function si(e,t){return t(e)}var ss=ii(function(e){var t=e.length,n=t?e[0]:0,i=this.__wrapped__,s=function(t){return rR(t,e)};return!(t>1)&&!this.__actions__.length&&i instanceof rv&&i_(n)?((i=i.slice(n,+n+(t?1:0))).__actions__.push({func:si,args:[s],thisArg:r}),new rm(i,this.__chain__).thru(function(e){return t&&!e.length&&e.push(r),e})):this.thru(s)}),so=nH(function(e,t,r){eR.call(e,r)?++e[r]:rT(e,r,1)}),sa=nJ(i$),sl=nJ(iV);function su(e,t){return(sB(e)?ta:rU)(e,ic(t,3))}function sc(e,t){return(sB(e)?function(e,t){for(var r=null==e?0:e.length;r--&&!1!==t(e[r],r,e););return e}:rj)(e,ic(t,3))}var sh=nH(function(e,t,r){eR.call(e,r)?e[r].push(t):rT(e,r,[t])}),sd=nh(function(e,t,r){var n=-1,i="function"==typeof t,s=sL(e)?ev(e.length):[];return rU(e,function(e){s[++n]=i?ts(t,e,r):r2(e,t,r)}),s}),sf=nH(function(e,t,r){rT(e,r,t)});function sp(e,t){return(sB(e)?td:ne)(e,ic(t,3))}var sg=nH(function(e,t,r){e[r?0:1].push(t)},function(){return[[],[]]}),sy=nh(function(e,t){if(null==e)return[];var r=t.length;return r>1&&iE(e,t[0],t[1])?t=[]:r>2&&iE(t[0],t[1],t[2])&&(t=[t[0]]),ns(e,rz(t,1),[])}),sm=tk||function(){return e3.Date.now()};function sv(e,t,n){return t=n?r:t,t=e&&null==t?e.length:t,n7(e,128,r,r,r,r,t)}
87function sb(e,t){var i;if("function"!=typeof t)throw new eC(n);return e=s6(e),function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=r),i}}var sw=nh(function(e,t,r){var n=1;if(r.length){var i=tq(r,iu(sw));n|=32}return n7(e,n,t,r,i)}),s_=nh(function(e,t,r){var n=3;if(r.length){var i=tq(r,iu(s_));n|=32}return n7(t,n,e,r,i)});function sE(e,t,i){var s,o,a,l,u,c,h=0,d=!1,f=!1,p=!0;if("function"!=typeof e)throw new eC(n);function g(t){var n=s,i=o;return s=o=r,h=t,l=e.apply(i,n)}function y(e){var n=e-c,i=e-h;return c===r||n>=t||n<0||f&&i>=a}function m(){var e,r,n,i=sm();if(y(i))return v(i);u=iR(m,(e=i-c,r=i-h,n=t-e,f?t3(n,a-r):n))}function v(e){return u=r,p&&s?g(e):(s=o=r,l)}function b(){var e,n=sm(),i=y(n);if(s=arguments,o=this,c=n,i){if(u===r)return h=e=c,u=iR(m,t),d?g(e):l;if(f)return nN(u),u=iR(m,t),g(c)}return u===r&&(u=iR(m,t)),l}return t=s8(t)||0,sV(i)&&(d=!!i.leading,a=(f="maxWait"in i)?t2(s8(i.maxWait)||0,t):a,p="trailing"in i?!!i.trailing:p),b.cancel=function(){u!==r&&nN(u),h=0,s=c=o=u=r},b.flush=function(){return u===r?l:v(sm())},b}var sS=nh(function(e,t){return rM(e,1,t)}),sA=nh(function(e,t,r){return rM(e,s8(t)||0,r)});function sk(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new eC(n);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],s=r.cache;if(s.has(i))return s.get(i);var o=e.apply(this,n);return r.cache=s.set(i,o)||s,o};return r.cache=new(sk.Cache||r_),r}function sC(e){if("function"!=typeof e)throw new eC(n);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)}}sk.Cache=r_;var sI=nh(function(e,t){var r=(t=1==t.length&&sB(t[0])?td(t[0],tO(ic())):td(rz(t,1),tO(ic()))).length;return nh(function(n){for(var i=-1,s=t3(n.length,r);++i<s;)n[i]=t[i].call(this,n[i]);return ts(e,this,n)})}),sx=nh(function(e,t){var n=tq(t,iu(sx));return n7(e,32,r,t,n)}),sP=nh(function(e,t){var n=tq(t,iu(sP));return n7(e,64,r,t,n)}),sO=ii(function(e,t){return n7(e,256,r,r,r,t)});function sT(e,t){return e===t||e!=e&&t!=t}var sR=n3(rZ),sN=n3(function(e,t){return e>=t}),sD=r3(function(){return arguments}())?r3:function(e){return sW(e)&&eR.call(e,"callee")&&!e1.call(e,"callee")},sB=ev.isArray,sM=e9?tO(e9):function(e){return sW(e)&&rQ(e)==k};function sL(e){return null!=e&&s$(e.length)&&!sH(e)}function sU(e){return sW(e)&&sL(e)}var sj=tZ||oQ,sF=te?tO(te):function(e){return sW(e)&&rQ(e)==d};function sq(e){if(!sW(e))return!1;var t=rQ(e);return t==f||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!sJ(e)}function sH(e){if(!sV(e))return!1;var t=rQ(e);return t==p||t==g||"[object AsyncFunction]"==t||"[object Proxy]"==t}function sz(e){return"number"==typeof e&&e==s6(e)}function s$(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function sV(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function sW(e){return null!=e&&"object"==typeof e}var sG=tt?tO(tt):function(e){return sW(e)&&im(e)==y};function sK(e){return"number"==typeof e||sW(e)&&rQ(e)==m}function sJ(e){if(!sW(e)||rQ(e)!=v)return!1;var t=eW(e);if(null===t)return!0;var r=eR.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&eT.call(r)==eM}var sY=tr?tO(tr):function(e){return sW(e)&&rQ(e)==w},sQ=tn?tO(tn):function(e){return sW(e)&&im(e)==_};function sZ(e){return"string"==typeof e||!sB(e)&&sW(e)&&rQ(e)==E}function sX(e){return"symbol"==typeof e||sW(e)&&rQ(e)==S}var s0=ti?tO(ti):function(e){return sW(e)&&s$(e.length)&&!!eY[rQ(e)]},s1=n3(r9),s2=n3(function(e,t){return e<=t});function s3(e){if(!e)return[];if(sL(e))return sZ(e)?t$(e):nF(e);if(e6&&e[e6])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[e6]());var t=im(e);return(t==y?tj:t==_?tH:o_)(e)}function s5(e){return e?(e=s8(e))===o||e===-o?(e<0?-1:1)*17976931348623157e292:e==e?e:0:0===e?e:0}function s6(e){var t=s5(e),r=t%1;return t==t?r?t-r:t:0}function s4(e){return e?rN(s6(e),0,4294967295):0}function s8(e){if("number"==typeof e)return e;if(sX(e))return a;
87if(sV(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=sV(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=tP(e);var r=el.test(e);return r||ec.test(e)?e0(e.slice(2),r?2:8):ea.test(e)?a:+e}function s7(e){return nq(e,of(e))}function s9(e){return null==e?"":n_(e)}var oe=nz(function(e,t){if(iC(t)||sL(t)){nq(t,od(t),e);return}for(var r in t)eR.call(t,r)&&rI(e,r,t[r])}),ot=nz(function(e,t){nq(t,of(t),e)}),or=nz(function(e,t,r,n){nq(t,of(t),e,n)}),on=nz(function(e,t,r,n){nq(t,od(t),e,n)}),oi=ii(rR),os=nh(function(e,t){e=eS(e);var n=-1,i=t.length,s=i>2?t[2]:r;for(s&&iE(t[0],t[1],s)&&(i=1);++n<i;)for(var o=t[n],a=of(o),l=-1,u=a.length;++l<u;){var c=a[l],h=e[c];(h===r||sT(h,eP[c])&&!eR.call(e,c))&&(e[c]=o[c])}return e}),oo=nh(function(e){return e.push(r,ie),ts(og,r,e)});function oa(e,t,n){var i=null==e?r:rJ(e,t);return i===r?n:i}function ol(e,t){return null!=e&&iv(e,t,r0)}var ou=nZ(function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=eB.call(t)),e[t]=r},oB(oU)),oc=nZ(function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=eB.call(t)),eR.call(e,t)?e[t].push(r):e[t]=[r]},ic),oh=nh(r2);function od(e){return sL(e)?rA(e):r7(e)}function of(e){return sL(e)?rA(e,!0):function(e){if(!sV(e))return function(e){var t=[];if(null!=e)for(var r in eS(e))t.push(r);return t}(e);var t=iC(e),r=[];for(var n in e)"constructor"==n&&(t||!eR.call(e,n))||r.push(n);return r}(e)}var op=nz(function(e,t,r){nn(e,t,r)}),og=nz(function(e,t,r,n){nn(e,t,r,n)}),oy=ii(function(e,t){var r={};if(null==e)return r;var n=!1;t=td(t,function(t){return t=nT(t,e),n||(n=t.length>1),t}),nq(e,io(e),r),n&&(r=rD(r,7,it));for(var i=t.length;i--;)nS(r,t[i]);return r}),om=ii(function(e,t){return null==e?{}:no(e,t,function(t,r){return ol(e,r)})});function ov(e,t){if(null==e)return{};var r=td(io(e),function(e){return[e]});return t=ic(t),no(e,r,function(e,r){return t(e,r[0])})}var ob=n8(od),ow=n8(of);function o_(e){return null==e?[]:tT(e,od(e))}var oE=nG(function(e,t,r){return t=t.toLowerCase(),e+(r?oS(t):t)});function oS(e){return oT(s9(e).toLowerCase())}function oA(e){return(e=s9(e))&&e.replace(ed,tB).replace(ez,"")}var ok=nG(function(e,t,r){return e+(r?"-":"")+t.toLowerCase()}),oC=nG(function(e,t,r){return e+(r?" ":"")+t.toLowerCase()}),oI=nW("toLowerCase"),ox=nG(function(e,t,r){return e+(r?"_":"")+t.toLowerCase()}),oP=nG(function(e,t,r){return e+(r?" ":"")+oT(t)}),oO=nG(function(e,t,r){return e+(r?" ":"")+t.toUpperCase()}),oT=nW("toUpperCase");function oR(e,t,n){var i;return e=s9(e),(t=n?r:t)===r?(i=e,eG.test(i))?e.match(eV)||[]:e.match(er)||[]:e.match(t)||[]}var oN=nh(function(e,t){try{return ts(e,r,t)}catch(e){return sq(e)?e:new ew(e)}}),oD=ii(function(e,t){return ta(t,function(t){rT(e,t=iU(t),sw(e[t],e))}),e});function oB(e){return function(){return e}}var oM=nY(),oL=nY(!0);function oU(e){return e}function oj(e){return r8("function"==typeof e?e:rD(e,1))}var oF=nh(function(e,t){return function(r){return r2(r,e,t)}}),oq=nh(function(e,t){return function(r){return r2(e,r,t)}});function oH(e,t,r){var n=od(t),i=rK(t,n);null!=r||sV(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=rK(t,od(t)));var s=!(sV(r)&&"chain"in r)||!!r.chain,o=sH(e);return ta(i,function(r){var n=t[r];e[r]=n,o&&(e.prototype[r]=function(){var t=this.__chain__;if(s||t){var r=e(this.__wrapped__);return(r.__actions__=nF(this.__actions__)).push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,tf([this.value()],arguments))})}),e}function oz(){}var o$=n0(td),oV=n0(tl),oW=n0(ty);function oG(e){return iS(e)?tA(iU(e)):function(t){return rJ(t,e)}}var oK=n2(),oJ=n2(!0);function oY(){return[]}function oQ(){return!1}var oZ=nX(function(e,t){return e+t},0),oX=n6("ceil"),o0=nX(function(e,t){return e/t},1),o1=n6("floor"),o2=nX(function(e,t){return e*t},1),o3=n6("round"),o5=nX(function(e,t){return e-t},0);return rp.after=function(e,t){if("function"!=typeof t)throw new eC(n);return e=s6(e),function(){if(--e<1)return t.apply(this,arguments)}},rp.ary=sv,rp.assign=oe,rp.assignIn=ot,rp.assignInWith=or,rp.assignWith=on,rp.at=oi,rp.before=sb,rp.bind=sw,rp.bindAll=oD,rp.bindKey=s_,rp.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return sB(e)?e:[e]},rp.chain=sn,rp.chunk=function(e,t,n){t=(n?iE(e,t,n):t===r)?1:t2(s6(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var s=0,o=0,a=ev(tJ(i/t));s<i;)a[o++]=ng(e,s,s+=t);return a},rp.compact=function(e){for(var t=-1,r=null==e?0:e.length,n=0,i=[];++t<r;){var s=e[t];s&&(i[n++]=s)}return i},rp.concat=function(){var e=arguments.length;if(!e)return[];for(var t=ev(e-1),r=arguments[0],n=e;n--;)t[n-1]=arguments[n];
87return tf(sB(r)?nF(r):[r],rz(t,1))},rp.cond=function(e){var t=null==e?0:e.length,r=ic();return e=t?td(e,function(e){if("function"!=typeof e[1])throw new eC(n);return[r(e[0]),e[1]]}):[],nh(function(r){for(var n=-1;++n<t;){var i=e[n];if(ts(i[0],this,r))return ts(i[1],this,r)}})},rp.conforms=function(e){var t,r;return r=od(t=rD(e,1)),function(e){return rB(e,t,r)}},rp.constant=oB,rp.countBy=so,rp.create=function(e,t){var r=rg(e);return null==t?r:rO(r,t)},rp.curry=function e(t,n,i){n=i?r:n;var s=n7(t,8,r,r,r,r,r,n);return s.placeholder=e.placeholder,s},rp.curryRight=function e(t,n,i){n=i?r:n;var s=n7(t,16,r,r,r,r,r,n);return s.placeholder=e.placeholder,s},rp.debounce=sE,rp.defaults=os,rp.defaultsDeep=oo,rp.defer=sS,rp.delay=sA,rp.difference=iq,rp.differenceBy=iH,rp.differenceWith=iz,rp.drop=function(e,t,n){var i=null==e?0:e.length;return i?ng(e,(t=n||t===r?1:s6(t))<0?0:t,i):[]},rp.dropRight=function(e,t,n){var i=null==e?0:e.length;return i?ng(e,0,(t=i-(t=n||t===r?1:s6(t)))<0?0:t):[]},rp.dropRightWhile=function(e,t){return e&&e.length?nk(e,ic(t,3),!0,!0):[]},rp.dropWhile=function(e,t){return e&&e.length?nk(e,ic(t,3),!0):[]},rp.fill=function(e,t,n,i){var s=null==e?0:e.length;return s?(n&&"number"!=typeof n&&iE(e,t,n)&&(n=0,i=s),function(e,t,n,i){var s=e.length;for((n=s6(n))<0&&(n=-n>s?0:s+n),(i=i===r||i>s?s:s6(i))<0&&(i+=s),i=n>i?0:s4(i);n<i;)e[n++]=t;return e}(e,t,n,i)):[]},rp.filter=function(e,t){return(sB(e)?tu:rH)(e,ic(t,3))},rp.flatMap=function(e,t){return rz(sp(e,t),1)},rp.flatMapDeep=function(e,t){return rz(sp(e,t),o)},rp.flatMapDepth=function(e,t,n){return n=n===r?1:s6(n),rz(sp(e,t),n)},rp.flatten=iW,rp.flattenDeep=function(e){return(null==e?0:e.length)?rz(e,o):[]},rp.flattenDepth=function(e,t){return(null==e?0:e.length)?rz(e,t=t===r?1:s6(t)):[]},rp.flip=function(e){return n7(e,512)},rp.flow=oM,rp.flowRight=oL,rp.fromPairs=function(e){for(var t=-1,r=null==e?0:e.length,n={};++t<r;){var i=e[t];n[i[0]]=i[1]}return n},rp.functions=function(e){return null==e?[]:rK(e,od(e))},rp.functionsIn=function(e){return null==e?[]:rK(e,of(e))},rp.groupBy=sh,rp.initial=function(e){return(null==e?0:e.length)?ng(e,0,-1):[]},rp.intersection=iK,rp.intersectionBy=iJ,rp.intersectionWith=iY,rp.invert=ou,rp.invertBy=oc,rp.invokeMap=sd,rp.iteratee=oj,rp.keyBy=sf,rp.keys=od,rp.keysIn=of,rp.map=sp,rp.mapKeys=function(e,t){var r={};return t=ic(t,3),rW(e,function(e,n,i){rT(r,t(e,n,i),e)}),r},rp.mapValues=function(e,t){var r={};return t=ic(t,3),rW(e,function(e,n,i){rT(r,n,t(e,n,i))}),r},rp.matches=function(e){return nt(rD(e,1))},rp.matchesProperty=function(e,t){return nr(e,rD(t,1))},rp.memoize=sk,rp.merge=op,rp.mergeWith=og,rp.method=oF,rp.methodOf=oq,rp.mixin=oH,rp.negate=sC,rp.nthArg=function(e){return e=s6(e),nh(function(t){return ni(t,e)})},rp.omit=oy,rp.omitBy=function(e,t){return ov(e,sC(ic(t)))},rp.once=function(e){return sb(2,e)},rp.orderBy=function(e,t,n,i){return null==e?[]:(sB(t)||(t=null==t?[]:[t]),sB(n=i?r:n)||(n=null==n?[]:[n]),ns(e,t,n))},rp.over=o$,rp.overArgs=sI,rp.overEvery=oV,rp.overSome=oW,rp.partial=sx,rp.partialRight=sP,rp.partition=sg,rp.pick=om,rp.pickBy=ov,rp.property=oG,rp.propertyOf=function(e){return function(t){return null==e?r:rJ(e,t)}},rp.pull=iZ,rp.pullAll=iX,rp.pullAllBy=function(e,t,r){return e&&e.length&&t&&t.length?na(e,t,ic(r,2)):e},rp.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?na(e,t,r,n):e},rp.pullAt=i0,rp.range=oK,rp.rangeRight=oJ,rp.rearg=sO,rp.reject=function(e,t){return(sB(e)?tu:rH)(e,sC(ic(t,3)))},rp.remove=function(e,t){var r=[];if(!(e&&e.length))return r;var n=-1,i=[],s=e.length;for(t=ic(t,3);++n<s;){var o=e[n];t(o,n,e)&&(r.push(o),i.push(n))}return nl(e,i),r},rp.rest=function(e,t){if("function"!=typeof e)throw new eC(n);return nh(e,t=t===r?t:s6(t))},rp.reverse=i1,rp.sampleSize=function(e,t,n){return t=(n?iE(e,t,n):t===r)?1:s6(t),(sB(e)?function(e,t){return iM(nF(e),rN(t,0,e.length))}:function(e,t){var r=o_(e);return iM(r,rN(t,0,r.length))})(e,t)},rp.set=function(e,t,r){return null==e?e:nd(e,t,r)},rp.setWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:nd(e,t,n,i)},rp.shuffle=function(e){return(sB(e)?function(e){return iM(nF(e))}:function(e){return iM(o_(e))})(e)}
vendor: 4,679 bytes, line 87
87,rp.slice=function(e,t,n){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&iE(e,t,n)?(t=0,n=i):(t=null==t?0:s6(t),n=n===r?i:s6(n)),ng(e,t,n)):[]},rp.sortBy=sy,rp.sortedUniq=function(e){return e&&e.length?nb(e):[]},rp.sortedUniqBy=function(e,t){return e&&e.length?nb(e,ic(t,2)):[]},rp.split=function(e,t,n){return n&&"number"!=typeof n&&iE(e,t,n)&&(t=n=r),(n=n===r?4294967295:n>>>0)?(e=s9(e))&&("string"==typeof t||null!=t&&!sY(t))&&!(t=n_(t))&&tU(e)?nR(t$(e),0,n):e.split(t,n):[]},rp.spread=function(e,t){if("function"!=typeof e)throw new eC(n);return t=null==t?0:t2(s6(t),0),nh(function(r){var n=r[t],i=nR(r,0,t);return n&&tf(i,n),ts(e,this,i)})},rp.tail=function(e){var t=null==e?0:e.length;return t?ng(e,1,t):[]},rp.take=function(e,t,n){return e&&e.length?ng(e,0,(t=n||t===r?1:s6(t))<0?0:t):[]},rp.takeRight=function(e,t,n){var i=null==e?0:e.length;return i?ng(e,(t=i-(t=n||t===r?1:s6(t)))<0?0:t,i):[]},rp.takeRightWhile=function(e,t){return e&&e.length?nk(e,ic(t,3),!1,!0):[]},rp.takeWhile=function(e,t){return e&&e.length?nk(e,ic(t,3)):[]},rp.tap=function(e,t){return t(e),e},rp.throttle=function(e,t,r){var i=!0,s=!0;if("function"!=typeof e)throw new eC(n);return sV(r)&&(i="leading"in r?!!r.leading:i,s="trailing"in r?!!r.trailing:s),sE(e,t,{leading:i,maxWait:t,trailing:s})},rp.thru=si,rp.toArray=s3,rp.toPairs=ob,rp.toPairsIn=ow,rp.toPath=function(e){return sB(e)?td(e,iU):sX(e)?[e]:nF(iL(s9(e)))},rp.toPlainObject=s7,rp.transform=function(e,t,r){var n=sB(e),i=n||sj(e)||s0(e);if(t=ic(t,4),null==r){var s=e&&e.constructor;r=i?n?new s:[]:sV(e)&&sH(s)?rg(eW(e)):{}}return(i?ta:rW)(e,function(e,n,i){return t(r,e,n,i)}),r},rp.unary=function(e){return sv(e,1)},rp.union=i2,rp.unionBy=i3,rp.unionWith=i5,rp.uniq=function(e){return e&&e.length?nE(e):[]},rp.uniqBy=function(e,t){return e&&e.length?nE(e,ic(t,2)):[]},rp.uniqWith=function(e,t){return t="function"==typeof t?t:r,e&&e.length?nE(e,r,t):[]},rp.unset=function(e,t){return null==e||nS(e,t)},rp.unzip=i6,rp.unzipWith=i4,rp.update=function(e,t,r){return null==e?e:nA(e,t,nO(r))},rp.updateWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:nA(e,t,nO(n),i)},rp.values=o_,rp.valuesIn=function(e){return null==e?[]:tT(e,of(e))},rp.without=i8,rp.words=oR,rp.wrap=function(e,t){return sx(nO(t),e)},rp.xor=i7,rp.xorBy=i9,rp.xorWith=se,rp.zip=st,rp.zipObject=function(e,t){return nx(e||[],t||[],rI)},rp.zipObjectDeep=function(e,t){return nx(e||[],t||[],nd)},rp.zipWith=sr,rp.entries=ob,rp.entriesIn=ow,rp.extend=ot,rp.extendWith=or,oH(rp,rp),rp.add=oZ,rp.attempt=oN,rp.camelCase=oE,rp.capitalize=oS,rp.ceil=oX,rp.clamp=function(e,t,n){return n===r&&(n=t,t=r),n!==r&&(n=(n=s8(n))==n?n:0),t!==r&&(t=(t=s8(t))==t?t:0),rN(s8(e),t,n)},rp.clone=function(e){return rD(e,4)},rp.cloneDeep=function(e){return rD(e,5)},rp.cloneDeepWith=function(e,t){return rD(e,5,t="function"==typeof t?t:r)},rp.cloneWith=function(e,t){return rD(e,4,t="function"==typeof t?t:r)},rp.conformsTo=function(e,t){return null==t||rB(e,t,od(t))},rp.deburr=oA,rp.defaultTo=function(e,t){return null==e||e!=e?t:e},rp.divide=o0,rp.endsWith=function(e,t,n){e=s9(e),t=n_(t);var i=e.length,s=n=n===r?i:rN(s6(n),0,i);return(n-=t.length)>=0&&e.slice(n,s)==t},rp.eq=sT,rp.escape=function(e){return(e=s9(e))&&H.test(e)?e.replace(F,tM):e},rp.escapeRegExp=function(e){return(e=s9(e))&&Y.test(e)?e.replace(J,"\\$&"):e},rp.every=function(e,t,n){var i=sB(e)?tl:rF;return n&&iE(e,t,n)&&(t=r),i(e,ic(t,3))},rp.find=sa,rp.findIndex=i$,rp.findKey=function(e,t){return tv(e,ic(t,3),rW)},rp.findLast=sl,rp.findLastIndex=iV,rp.findLastKey=function(e,t){return tv(e,ic(t,3),rG)},rp.floor=o1,rp.forEach=su,rp.forEachRight=sc,rp.forIn=function(e,t){return null==e?e:r$(e,ic(t,3),of)},rp.forInRight=function(e,t){return null==e?e:rV(e,ic(t,3),of)},rp.forOwn=function(e,t){return e&&rW(e,ic(t,3))},rp.forOwnRight=function(e,t){return e&&rG(e,ic(t,3))},rp.get=oa,rp.gt=sR,rp.gte=sN,rp.has=function(e,t){return null!=e&&iv(e,t,rX)},rp.hasIn=ol,rp.head=iG,rp.identity=oU,rp.includes=function(e,t,r,n){e=sL(e)?e:o_(e),r=r&&!n?s6(r):0;var i=e.length;return r<0&&(r=t2(i+r,0)),sZ(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&tw(e,t,r)>-1},rp.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return -1;var i=null==r?0:s6(r);return i<0&&(i=t2(n+i,0)),tw(e,t,i)},rp.inRange=function(e,t,n){var i,s,o;return t=s5(t),n===r?(n=t,t=0):n=s5(n),(i=e=s8(e))>=t3(s=t,o=n)&&i<t2(s,o)},rp.invoke=oh,rp.isArguments=sD,rp.isArray=sB,rp.isArrayBuffer=sM,rp.isArrayLike=sL,rp.isArrayLikeObject=sU,rp.isBoolean=function(e){return!0===e||!1===e||sW(e)&&rQ(e)==h},rp.isBuffer=sj,rp.isDate=sF,rp.isElement=function(e){return sW(e)&&1===e.nodeType&&!sJ(e)},rp.isEmpty=function(e){if(null==e)return!0;
vendor: 2,851 bytes, line 87
87if(sL(e)&&(sB(e)||"string"==typeof e||"function"==typeof e.splice||sj(e)||s0(e)||sD(e)))return!e.length;var t=im(e);if(t==y||t==_)return!e.size;if(iC(e))return!r7(e).length;for(var r in e)if(eR.call(e,r))return!1;return!0},rp.isEqual=function(e,t){return r5(e,t)},rp.isEqualWith=function(e,t,n){var i=(n="function"==typeof n?n:r)?n(e,t):r;return i===r?r5(e,t,r,n):!!i},rp.isError=sq,rp.isFinite=function(e){return"number"==typeof e&&tX(e)},rp.isFunction=sH,rp.isInteger=sz,rp.isLength=s$,rp.isMap=sG,rp.isMatch=function(e,t){return e===t||r6(e,t,id(t))},rp.isMatchWith=function(e,t,n){return n="function"==typeof n?n:r,r6(e,t,id(t),n)},rp.isNaN=function(e){return sK(e)&&e!=+e},rp.isNative=function(e){if(ik(e))throw new ew("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return r4(e)},rp.isNil=function(e){return null==e},rp.isNull=function(e){return null===e},rp.isNumber=sK,rp.isObject=sV,rp.isObjectLike=sW,rp.isPlainObject=sJ,rp.isRegExp=sY,rp.isSafeInteger=function(e){return sz(e)&&e>=-9007199254740991&&e<=9007199254740991},rp.isSet=sQ,rp.isString=sZ,rp.isSymbol=sX,rp.isTypedArray=s0,rp.isUndefined=function(e){return e===r},rp.isWeakMap=function(e){return sW(e)&&im(e)==A},rp.isWeakSet=function(e){return sW(e)&&"[object WeakSet]"==rQ(e)},rp.join=function(e,t){return null==e?"":t0.call(e,t)},rp.kebabCase=ok,rp.last=iQ,rp.lastIndexOf=function(e,t,n){var i=null==e?0:e.length;if(!i)return -1;var s=i;return n!==r&&(s=(s=s6(n))<0?t2(i+s,0):t3(s,i-1)),t==t?function(e,t,r){for(var n=r+1;n--&&e[n]!==t;);return n}(e,t,s):tb(e,tE,s,!0)},rp.lowerCase=oC,rp.lowerFirst=oI,rp.lt=s1,rp.lte=s2,rp.max=function(e){return e&&e.length?rq(e,oU,rZ):r},rp.maxBy=function(e,t){return e&&e.length?rq(e,ic(t,2),rZ):r},rp.mean=function(e){return tS(e,oU)},rp.meanBy=function(e,t){return tS(e,ic(t,2))},rp.min=function(e){return e&&e.length?rq(e,oU,r9):r},rp.minBy=function(e,t){return e&&e.length?rq(e,ic(t,2),r9):r},rp.stubArray=oY,rp.stubFalse=oQ,rp.stubObject=function(){return{}},rp.stubString=function(){return""},rp.stubTrue=function(){return!0},rp.multiply=o2,rp.nth=function(e,t){return e&&e.length?ni(e,s6(t)):r},rp.noConflict=function(){return e3._===this&&(e3._=eL),this},rp.noop=oz,rp.now=sm,rp.pad=function(e,t,r){e=s9(e);var n=(t=s6(t))?tz(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return n1(tY(i),r)+e+n1(tJ(i),r)},rp.padEnd=function(e,t,r){e=s9(e);var n=(t=s6(t))?tz(e):0;return t&&n<t?e+n1(t-n,r):e},rp.padStart=function(e,t,r){e=s9(e);var n=(t=s6(t))?tz(e):0;return t&&n<t?n1(t-n,r)+e:e},rp.parseInt=function(e,t,r){return r||null==t?t=0:t&&(t=+t),t6(s9(e).replace(Q,""),t||0)},rp.random=function(e,t,n){if(n&&"boolean"!=typeof n&&iE(e,t,n)&&(t=n=r),n===r&&("boolean"==typeof t?(n=t,t=r):"boolean"==typeof e&&(n=e,e=r)),e===r&&t===r?(e=0,t=1):(e=s5(e),t===r?(t=e,e=0):t=s5(t)),e>t){var i=e;e=t,t=i}if(n||e%1||t%1){var s=t4();
vendor: 5,302 bytes, lines 87-104
87return t3(e+s*(t-e+eX("1e-"+((s+"").length-1))),t)}return nu(e,t)},rp.reduce=function(e,t,r){var n=sB(e)?tp:tC,i=arguments.length<3;return n(e,ic(t,4),r,i,rU)},rp.reduceRight=function(e,t,r){var n=sB(e)?tg:tC,i=arguments.length<3;return n(e,ic(t,4),r,i,rj)},rp.repeat=function(e,t,n){return t=(n?iE(e,t,n):t===r)?1:s6(t),nc(s9(e),t)},rp.replace=function(){var e=arguments,t=s9(e[0]);return e.length<3?t:t.replace(e[1],e[2])},rp.result=function(e,t,n){t=nT(t,e);var i=-1,s=t.length;for(s||(s=1,e=r);++i<s;){var o=null==e?r:e[iU(t[i])];o===r&&(i=s,o=n),e=sH(o)?o.call(e):o}return e},rp.round=o3,rp.runInContext=e,rp.sample=function(e){return(sB(e)?rk:function(e){return rk(o_(e))})(e)},rp.size=function(e){if(null==e)return 0;if(sL(e))return sZ(e)?tz(e):e.length;var t=im(e);return t==y||t==_?e.size:r7(e).length},rp.snakeCase=ox,rp.some=function(e,t,n){var i=sB(e)?ty:ny;return n&&iE(e,t,n)&&(t=r),i(e,ic(t,3))},rp.sortedIndex=function(e,t){return nm(e,t)},rp.sortedIndexBy=function(e,t,r){return nv(e,t,ic(r,2))},rp.sortedIndexOf=function(e,t){var r=null==e?0:e.length;if(r){var n=nm(e,t);if(n<r&&sT(e[n],t))return n}return -1},rp.sortedLastIndex=function(e,t){return nm(e,t,!0)},rp.sortedLastIndexBy=function(e,t,r){return nv(e,t,ic(r,2),!0)},rp.sortedLastIndexOf=function(e,t){if(null==e?0:e.length){var r=nm(e,t,!0)-1;if(sT(e[r],t))return r}return -1},rp.startCase=oP,rp.startsWith=function(e,t,r){return e=s9(e),r=null==r?0:rN(s6(r),0,e.length),t=n_(t),e.slice(r,r+t.length)==t},rp.subtract=o5,rp.sum=function(e){return e&&e.length?tI(e,oU):0},rp.sumBy=function(e,t){return e&&e.length?tI(e,ic(t,2)):0},rp.template=function(e,t,n){var i=rp.templateSettings;n&&iE(e,t,n)&&(t=r),e=s9(e),t=or({},t,i,n9);var s,o,a=or({},t.imports,i.imports,n9),l=od(a),u=tT(a,l),c=0,h=t.interpolate||ef,d="__p += '",f=eA((t.escape||ef).source+"|"+h.source+"|"+(h===V?es:ef).source+"|"+(t.evaluate||ef).source+"|$","g"),p="//# sourceURL="+(eR.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++eJ+"]")+`
88`;e.replace(f,function(t,r,n,i,a,l){return n||(n=i),d+=e.slice(c,l).replace(ep,tL),r&&(s=!0,d+=`' +
89__e(`+r+`) +
90'`),a&&(o=!0,d+=`';
91`+a+`;
92__p += '`),n&&(d+=`' +
93((__t = (`+n+`)) == null ? '' : __t) +
94'`),c=l+t.length,t}),d+=`';
95`;var g=eR.call(t,"variable")&&t.variable;if(g){if(en.test(g))throw new ew("Invalid `variable` option passed into `_.template`")}else d=`with (obj) {
96`+d+`
97}
98`;d=(o?d.replace(M,""):d).replace(L,"$1").replace(U,"$1;"),d="function("+(g||"obj")+`) {
99`+(g?"":`obj || (obj = {});
100`)+"var __t, __p = ''"+(s?", __e = _.escape":"")+(o?`, __j = Array.prototype.join;
101function print() { __p += __j.call(arguments, '') }
102`:`;
103`)+d+`return __p
104}`;var y=oN(function(){return e_(l,p+"return "+d).apply(r,u)});if(y.source=d,sq(y))throw y;return y},rp.times=function(e,t){if((e=s6(e))<1||e>9007199254740991)return[];var r=4294967295,n=t3(e,4294967295);t=ic(t),e-=4294967295;for(var i=tx(n,t);++r<e;)t(r);return i},rp.toFinite=s5,rp.toInteger=s6,rp.toLength=s4,rp.toLower=function(e){return s9(e).toLowerCase()},rp.toNumber=s8,rp.toSafeInteger=function(e){return e?rN(s6(e),-9007199254740991,9007199254740991):0===e?e:0},rp.toString=s9,rp.toUpper=function(e){return s9(e).toUpperCase()},rp.trim=function(e,t,n){if((e=s9(e))&&(n||t===r))return tP(e);if(!e||!(t=n_(t)))return e;var i=t$(e),s=t$(t),o=tN(i,s),a=tD(i,s)+1;return nR(i,o,a).join("")},rp.trimEnd=function(e,t,n){if((e=s9(e))&&(n||t===r))return e.slice(0,tV(e)+1);if(!e||!(t=n_(t)))return e;var i=t$(e),s=tD(i,t$(t))+1;return nR(i,0,s).join("")},rp.trimStart=function(e,t,n){if((e=s9(e))&&(n||t===r))return e.replace(Q,"");if(!e||!(t=n_(t)))return e;var i=t$(e),s=tN(i,t$(t));return nR(i,s).join("")},rp.truncate=function(e,t){var n=30,i="...";if(sV(t)){var s="separator"in t?t.separator:s;n="length"in t?s6(t.length):n,i="omission"in t?n_(t.omission):i}var o=(e=s9(e)).length;if(tU(e)){var a=t$(e);o=a.length}if(n>=o)return e;var l=n-tz(i);if(l<1)return i;var u=a?nR(a,0,l).join(""):e.slice(0,l);if(s===r)return u+i;if(a&&(l+=u.length-l),sY(s)){if(e.slice(l).search(s)){var c,h=u;for(s.global||(s=eA(s.source,s9(eo.exec(s))+"g")),s.lastIndex=0;c=s.exec(h);)var d=c.index;u=u.slice(0,d===r?l:d)}}else if(e.indexOf(n_(s),l)!=l){var f=u.lastIndexOf(s);f>-1&&(u=u.slice(0,f))}return u+i},rp.unescape=function(e){return(e=s9(e))&&q.test(e)?e.replace(j,tW):e},rp.uniqueId=function(e){var t=++eN;return s9(e)+t},rp.upperCase=oO,rp.upperFirst=oT,rp.each=su,rp.eachRight=sc,rp.first=iG,oH(rp,(em={},rW(rp,function(e,t){eR.call(rp.prototype,t)||(em[t]=e)}),em),{chain:!1}),rp.VERSION="4.17.21",ta(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){rp[e].placeholder=rp}),ta(["drop","take"],function(e,t){rv.prototype[e]=function(n){n=n===r?1:t2(s6(n),0);var i=this.__filtered__&&!t?new rv(this):this.clone();return i.__filtered__?i.__takeCount__=t3(n,i.__takeCount__):i.__views__.push({size:t3(n,4294967295),type:e+(i.__dir__<0?"Right":"")}),i},rv.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),ta(["filter","map","takeWhile"],function(e,t){var r=t+1,n=1==r||3==r;rv.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:ic(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}}),ta(["head","last"],function(e,t){var r="take"+(t?"Right":"");
vendor: 4,140 bytes, line 104
104rv.prototype[e]=function(){return this[r](1).value()[0]}}),ta(["initial","tail"],function(e,t){var r="drop"+(t?"":"Right");rv.prototype[e]=function(){return this.__filtered__?new rv(this):this[r](1)}}),rv.prototype.compact=function(){return this.filter(oU)},rv.prototype.find=function(e){return this.filter(e).head()},rv.prototype.findLast=function(e){return this.reverse().find(e)},rv.prototype.invokeMap=nh(function(e,t){return"function"==typeof e?new rv(this):this.map(function(r){return r2(r,e,t)})}),rv.prototype.reject=function(e){return this.filter(sC(ic(e)))},rv.prototype.slice=function(e,t){e=s6(e);var n=this;return n.__filtered__&&(e>0||t<0)?new rv(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==r&&(n=(t=s6(t))<0?n.dropRight(-t):n.take(t-e)),n)},rv.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},rv.prototype.toArray=function(){return this.take(4294967295)},rW(rv.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),s=rp[i?"take"+("last"==t?"Right":""):t],o=i||/^find/.test(t);s&&(rp.prototype[t]=function(){var t=this.__wrapped__,a=i?[1]:arguments,l=t instanceof rv,u=a[0],c=l||sB(t),h=function(e){var t=s.apply(rp,tf([e],a));return i&&d?t[0]:t};c&&n&&"function"==typeof u&&1!=u.length&&(l=c=!1);var d=this.__chain__,f=!!this.__actions__.length,p=o&&!d,g=l&&!f;if(!o&&c){t=g?t:new rv(this);var y=e.apply(t,a);return y.__actions__.push({func:si,args:[h],thisArg:r}),new rm(y,d)}return p&&g?e.apply(this,a):(y=this.thru(h),p?i?y.value()[0]:y.value():y)})}),ta(["pop","push","shift","sort","splice","unshift"],function(e){var t=eI[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);rp.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(sB(i)?i:[],e)}return this[r](function(r){return t.apply(sB(r)?r:[],e)})}}),rW(rv.prototype,function(e,t){var r=rp[t];if(r){var n=r.name+"";eR.call(rs,n)||(rs[n]=[]),rs[n].push({name:t,func:r})}}),rs[nQ(r,2).name]=[{name:"wrapper",func:r}],rv.prototype.clone=function(){var e=new rv(this.__wrapped__);return e.__actions__=nF(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=nF(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=nF(this.__views__),e},rv.prototype.reverse=function(){if(this.__filtered__){var e=new rv(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e},rv.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=sB(e),n=t<0,i=r?e.length:0,s=function(e,t,r){for(var n=-1,i=r.length;++n<i;){var s=r[n],o=s.size;switch(s.type){case"drop":e+=o;break;case"dropRight":t-=o;break;case"take":t=t3(t,e+o);break;case"takeRight":e=t2(e,t-o)}}return{start:e,end:t}}(0,i,this.__views__),o=s.start,a=s.end,l=a-o,u=n?a:o-1,c=this.__iteratees__,h=c.length,d=0,f=t3(l,this.__takeCount__);if(!r||!n&&i==l&&f==l)return nC(e,this.__actions__);var p=[];e:for(;l--&&d<f;){u+=t;for(var g=-1,y=e[u];++g<h;){var m=c[g],v=m.iteratee,b=m.type,w=v(y);if(2==b)y=w;else if(!w){if(1==b)continue e;break e}}p[d++]=y}return p},rp.prototype.at=ss,rp.prototype.chain=function(){return sn(this)},rp.prototype.commit=function(){return new rm(this.value(),this.__chain__)},rp.prototype.next=function(){this.__values__===r&&(this.__values__=s3(this.value()));var e=this.__index__>=this.__values__.length,t=e?r:this.__values__[this.__index__++];return{done:e,value:t}},rp.prototype.plant=function(e){for(var t,n=this;n instanceof ry;){var i=iF(n);i.__index__=0,i.__values__=r,t?s.__wrapped__=i:t=i;var s=i;n=n.__wrapped__}return s.__wrapped__=e,t},rp.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof rv){var t=e;return this.__actions__.length&&(t=new rv(this)),(t=t.reverse()).__actions__.push({func:si,args:[i1],thisArg:r}),new rm(t,this.__chain__)}return this.thru(i1)},rp.prototype.toJSON=rp.prototype.valueOf=rp.prototype.value=function(){return nC(this.__wrapped__,this.__actions__)},rp.prototype.first=rp.prototype.head,e6&&(rp.prototype[e6]=function(){return this}),rp}();e6?((e6.exports=tG)._=tG,e5._=tG):e3._=tG}).call(aX)}
104(a0,a0.exports);var a1=Object.defineProperty,a2=Object.defineProperties,a3=Object.getOwnPropertyDescriptors,a5=Object.getOwnPropertySymbols,a6=Object.prototype.hasOwnProperty,a4=Object.prototype.propertyIsEnumerable,a8=(e,t,r)=>t in e?a1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,a7=(e,t)=>{for(var r in t||(t={}))a6.call(t,r)&&a8(e,r,t[r]);if(a5)for(var r of a5(t))a4.call(t,r)&&a8(e,r,t[r]);return e},a9=(e,t)=>a2(e,a3(t));function le(e,t,r){var n;let i=function(e){let[t,r]=e.split(":");return{namespace:t,reference:r}}(e);return(null==(n=t.rpcMap)?void 0:n[i.reference])||`https://rpc.walletconnect.com/v1/?chainId=${i.namespace}:${i.reference}&projectId=${r}`}function lt(e){return e.includes(":")?e.split(":")[1]:e}function lr(e){return e.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function ln(e={},t={}){let r=li(e),n=li(t);return a0.exports.merge(r,n)}function li(e){var t,r,n,i;let s={};if(!(Object.getPrototypeOf(e)===Object.prototype&&Object.keys(e).length))return s;for(let[o,a]of Object.entries(e)){let e=aN(o)?[o]:a.chains,l=a.methods||[],u=a.events||[],c=a.rpcMap||{},h=aD(o);s[h]=a9(a7(a7({},s[h]),a),{chains:aR(e,null==(t=s[h])?void 0:t.chains),methods:aR(l,null==(r=s[h])?void 0:r.methods),events:aR(u,null==(n=s[h])?void 0:n.events),rpcMap:a7(a7({},c),null==(i=s[h])?void 0:i.rpcMap)})}return s}function ls(e){return e.includes(":")?e.split(":")[2]:e}function lo(e){return"number"==typeof e?e:e.includes("0x")?parseInt(e,16):isNaN(Number(e=e.includes(":")?e.split(":")[1]:e))?e:Number(e)}let la={},ll=e=>la[e],lu=(e,t)=>{la[e]=t};class lc{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=ll("events"),this.client=ll("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(aZ,`${this.name}:${e}`)}getAccounts(){let e=this.namespace.accounts;return e&&e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2])||[]}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{var r;let n=lt(t);e[n]=this.createHttpProvider(n,null==(r=this.namespace.rpcMap)?void 0:r[t])}),e}getHttpProvider(){let e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){let r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){let r=t||le(e,this.namespace,this.client.core.projectId);if(!r)throw Error(`No RPC url provided for chainId: ${e}`);return new aJ(new aK(r,ll("disableProviderPing")))}}class lh{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=ll("events"),this.client=ll("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){switch(e.request.method){case"eth_requestAccounts":case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain())}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(parseInt(e),t),this.chainId=parseInt(e),this.events.emit(aZ,`${this.name}:${e}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,t){let r=t||le(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!r)throw Error(`No RPC url provided for chainId: ${e}`);return new aJ(new aK(r,ll("disableProviderPing")))}setHttpProvider(e,t){let r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{var r;let n=parseInt(lt(t));e[n]=this.createHttpProvider(n,null==(r=this.namespace.rpcMap)?void 0:r[t])}),e}getAccounts(){let e=this.namespace.accounts;return e?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}getHttpProvider(){let e=this.chainId,t=this.httpProviders[e];if(typeof t>"u")throw Error(`JSON-RPC provider for ${e} not found`);return t}async handleSwitchChain(e){var t,r;let n=e.request.params?null==(t=e.request.params[0])?void 0:t.chainId:"0x0",i=parseInt(n=n.startsWith("0x")?n:`0x${n}`,16);if(this.isChainApproved(i))this.setDefaultChain(`${i}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:n}]},chainId:null==(r=this.namespace.chains)?void 0:r[0]}),this.setDefaultChain(`${i}`);else throw Error(`Failed to switch to chain 'eip155:${i}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}}class ld{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=ll("events"),this.client=ll("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(aZ,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}getAccounts(){let e=this.namespace.accounts;return e?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{var r;let n=lt(t);e[n]=this.createHttpProvider(n,null==(r=this.namespace.rpcMap)?void 0:r[t])}),e}getHttpProvider(){let e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){let r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){let r=t||le(e,this.namespace,this.client.core.projectId);if(!r)throw Error(`No RPC url provided for chainId: ${e}`);return new aJ(new aK(r,ll("disableProviderPing")))}}class lf{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=ll("events"),this.client=ll("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(aZ,`${this.name}:${this.chainId}`)}getAccounts(){let e=this.namespace.accounts;return e?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{var r;let n=lt(t);e[n]=this.createHttpProvider(n,null==(r=this.namespace.rpcMap)?void 0:r[t])}),e}getHttpProvider(){let e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){let r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){let r=t||le(e,this.namespace,this.client.core.projectId);if(!r)throw Error(`No RPC url provided for chainId: ${e}`);return new aJ(new aK(r,ll("disableProviderPing")))}}class lp{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=ll("events"),this.client=ll("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(aZ,`${this.name}:${this.chainId}`)}getAccounts(){let e=this.namespace.accounts;return e?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{let r=this.getCardanoRPCUrl(t),n=lt(t);e[n]=this.createHttpProvider(n,r)}),e}getHttpProvider(){let e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw Error(`JSON-RPC provider for ${e} not found`);return t}getCardanoRPCUrl(e){let t=this.namespace.rpcMap;if(t)return t[e]}setHttpProvider(e,t){let r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){let r=t||this.getCardanoRPCUrl(e);if(!r)throw Error(`No RPC url provided for chainId: ${e}`);return new aJ(new aK(r,ll("disableProviderPing")))}}class lg{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=ll("events"),this.client=ll("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(aZ,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}getAccounts(){let e=this.namespace.accounts;return e?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{var r;let n=lt(t);e[n]=this.createHttpProvider(n,null==(r=this.namespace.rpcMap)?void 0:r[t])}),e}getHttpProvider(){let e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){let r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){let r=t||le(e,this.namespace,this.client.core.projectId);if(!r)throw Error(`No RPC url provided for chainId: ${e}`);return new aJ(new aK(r,ll("disableProviderPing")))}}class ly{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=ll("events"),this.client=ll("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(aZ,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}getAccounts(){let e=this.namespace.accounts;return e?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{var r;let n=lt(t);e[n]=this.createHttpProvider(n,null==(r=this.namespace.rpcMap)?void 0:r[t])}),e}getHttpProvider(){let e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){let r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){let r=t||le(e,this.namespace,this.client.core.projectId);if(!r)throw Error(`No RPC url provided for chainId: ${e}`);return new aJ(new aK(r,ll("disableProviderPing")))}}class lm{constructor(e){this.name="near",this.namespace=e.namespace,this.events=ll("events"),this.client=ll("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(this.chainId=e,!this.httpProviders[e]){let r=t||le(`${this.name}:${e}`,this.namespace);if(!r)throw Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,r)}this.events.emit(aZ,`${this.name}:${this.chainId}`)}getAccounts(){let e=this.namespace.accounts;return e&&e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2])||[]}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{var r;e[t]=this.createHttpProvider(t,null==(r=this.namespace.rpcMap)?void 0:r[t])}),e}getHttpProvider(){let e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){let r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){let r=t||le(e,this.namespace);return typeof r>"u"?void 0:new aJ(new aK(r,ll("disableProviderPing")))}}var lv=Object.defineProperty,lb=Object.defineProperties,lw=Object.getOwnPropertyDescriptors,l_=Object.getOwnPropertySymbols,lE=Object.prototype.hasOwnProperty,lS=Object.prototype.propertyIsEnumerable,lA=(e,t,r)=>t in e?lv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,lk=(e,t)=>{for(var r in t||(t={}))lE.call(t,r)&&lA(e,r,t[r]);if(l_)for(var r of l_(t))lS.call(t,r)&&lA(e,r,t[r]);return e},lC=(e,t)=>lb(e,lw(t));class lI{constructor(e){this.events=new(e3()),this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=e,this.logger="u">typeof e?.logger&&"string"!=typeof e?.logger?e.logger:r8()(nu({level:e?.logger||aY})),this.disableProviderPing=e?.disableProviderPing||!1}static async init(e){let t=new lI(e);return await t.initialize(),t}async request(e,t,r){let[n,i]=this.validateChain(t);if(!this.session)throw Error("Please call connect() before request()");return await this.getProvider(n).request({request:lk({}
104,e),chainId:`${n}:${i}`,topic:this.session.topic,expiry:r})}sendAsync(e,t,r,n){let i=new Date().getTime();this.request(e,r,n).then(e=>t(null,i9(i,e))).catch(e=>t(e,void 0))}async enable(){if(!this.client)throw Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw Error("Please call connect() before enable()");await this.client.disconnect({topic:null==(e=this.session)?void 0:e.topic,reason:aM("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw Error("Sign Client not initialized");if(this.setNamespaces(e),await this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}removeListener(e,t){this.events.removeListener(e,t)}off(e,t){this.events.off(e,t)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let t=0;do{if(this.shouldAbortPairingAttempt)throw Error("Pairing aborted");if(t>=this.maxPairingAttempts)throw Error("Max auto pairing attempts reached");let{uri:r,approval:n}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});r&&(this.uri=r,this.events.emit("display_uri",r)),await n().then(e=>{this.session=e;let t=function(e){let t={};for(let[r,n]of Object.entries(e)){let e=n.methods||[],i=n.events||[],s=n.accounts||[],o=aN(r)?[r]:n.chains?n.chains:lr(n.accounts);t[r]={chains:o,methods:e,events:i,accounts:s}}return t}(e.namespaces);this.namespaces=ln(this.namespaces,t),this.persist("namespaces",this.namespaces)}).catch(e=>{if(e.message!==ad)throw e;t++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,t){try{if(!this.session)return;let[r,n]=this.validateChain(e);this.getProvider(r).setDefaultChain(n,t)}catch(e){if(!/Please call connect/.test(e.message))throw e}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");let t=this.client.pairing.getAll();if(aL(t)){for(let r of t)e.deletePairings?this.client.core.expirer.set(r.topic,0):await this.client.core.relayer.subscriber.unsubscribe(r.topic);this.logger.info(`Inactive pairings cleared: ${t.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){let e=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[e]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await aT.init({logger:this.providerOpts.logger||aY,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}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw Error("Sign Client not initialized");if(!this.session)throw Error("Session not initialized. Please call connect() before enable()");let e=[...new Set(Object.keys(this.session.namespaces).map(e=>aD(e)))];lu("client",this.client),lu("events",this.events),lu("disableProviderPing",this.disableProviderPing),e.forEach(e=>{if(!this.session)return;let t=function(e,t){let r=Object.keys(t.namespaces).filter(t=>t.includes(e));if(!r.length)return[];let n=[];return r.forEach(e=>{let r=t.namespaces[e].accounts;n.push(...r)}),n}(e,this.session),r=lr(t),n=lC(lk({},ln(this.namespaces,this.optionalNamespaces)[e]),{accounts:t,chains:r});switch(e){case"eip155":this.rpcProviders[e]=new lh({namespace:n});break;case"solana":this.rpcProviders[e]=new ld({namespace:n});break;case"cosmos":this.rpcProviders[e]=new lf({namespace:n});break;
104case"polkadot":this.rpcProviders[e]=new lc({namespace:n});break;case"cip34":this.rpcProviders[e]=new lp({namespace:n});break;case"elrond":this.rpcProviders[e]=new lg({namespace:n});break;case"multiversx":this.rpcProviders[e]=new ly({namespace:n});break;case"near":this.rpcProviders[e]=new lm({namespace:n})}})}registerEventListeners(){if(typeof this.client>"u")throw Error("Sign Client is not initialized");this.client.on("session_ping",e=>{this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{let{params:t}=e,{event:r}=t;if("accountsChanged"===r.name){let e=r.data;e&&aL(e)&&this.events.emit("accountsChanged",e.map(ls))}else if("chainChanged"===r.name){let e=t.chainId,r=t.event.data,n=aD(e),i=lo(e)!==lo(r)?`${n}:${lo(r)}`:e;this.onChainChanged(i)}else this.events.emit(r.name,r.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:t})=>{var r;let{namespaces:n}=t,i=null==(r=this.client)?void 0:r.session.get(e);this.session=lC(lk({},i),{namespaces:n}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:t})}),this.client.on("session_delete",async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",lC(lk({},aM("USER_DISCONNECTED")),{data:e.topic}))}),this.on(aZ,e=>{this.onChainChanged(e,!0)})}getProvider(e){if(!this.rpcProviders[e])throw Error(`Provider not found: ${e}`);return this.rpcProviders[e]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var t;this.getProvider(e).updateNamespace(null==(t=this.session)?void 0:t.namespaces[e])})}setNamespaces(e){let{namespaces:t,optionalNamespaces:r,sessionProperties:n}=e;t&&Object.keys(t).length&&(this.namespaces=t),r&&Object.keys(r).length&&(this.optionalNamespaces=r),this.sessionProperties=n,this.persist("namespaces",t),this.persist("optionalNamespaces",r)}validateChain(e){let[t,r]=e?.split(":")||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[t,r];if(t&&!Object.keys(this.namespaces||{}).map(e=>aD(e)).includes(t))throw Error(`Namespace '${t}' is not configured. Please call connect() first with namespace config.`);if(t&&r)return[t,r];let n=aD(Object.keys(this.namespaces)[0]),i=this.rpcProviders[n].getDefaultChain();return[n,i]}async requestAccounts(){let[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,t=!1){if(!this.namespaces)return;let[r,n]=this.validateChain(e);n&&(t||this.getProvider(r).setDefaultChain(n),this.namespaces[r]?this.namespaces[r].defaultChain=n:this.namespaces[`${r}:${n}`]?this.namespaces[`${r}:${n}`].defaultChain=n:this.namespaces[`${r}:${n}`]={defaultChain:n},this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",n))}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){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),await this.cleanupPendingPairings({deletePairings:!0})}persist(e,t){this.client.core.storage.setItem(`${aQ}/${e}`,t)}async getFromStore(e){return await this.client.core.storage.getItem(`${aQ}/${e}`)}}let lx=["eth_sendTransaction","personal_sign"],lP=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"],lO=["chainChanged","accountsChanged"],lT=["chainChanged","accountsChanged","message","disconnect","connect"];var lR=Object.defineProperty,lN=Object.defineProperties,lD=Object.getOwnPropertyDescriptors,lB=Object.getOwnPropertySymbols,lM=Object.prototype.hasOwnProperty,lL=Object.prototype.propertyIsEnumerable,lU=(e,t,r)=>t in e?lR(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,lj=(e,t)=>{for(var r in t||(t={}))lM.call(t,r)&&lU(e,r,t[r]);if(lB)for(var r of lB(t))lL.call(t,r)&&lU(e,r,t[r]);return e},lF=(e,t)=>lN(e,lD(t));function lq(e){return Number(e[0].split(":")[1])}function lH(e){return`0x${e.toString(16)}`}class lz{constructor(){this.events=new e2.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY="wc@2:ethereum_provider:",this.on=(e,t)=>(this.events.on(e,t),this),this.once=(e,t)=>(this.events.once(e,t),this),this.removeListener=(e,t)=>(this.events.removeListener(e,t),this),this.off=(e,t)=>(this.events.off(e,t),this),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static async init(e){let t=new lz;return await t.initialize(e),t}async request(e,t){return await this.signer.request(e,this.formatChainId(this.chainId),t)}sendAsync(e,t,r){this.signer.sendAsync(e,t,this.formatChainId(this.chainId),r)}get connected(){return!!this.signer.client&&this.signer.client.core.relayer.connected}get connecting(){return!!this.signer.client&&this.signer.client.core.relayer.connecting}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(e){if(!this.signer.client)throw Error("Provider not initialized. Call init() first");this.loadConnectOpts(e);let{required:t,optional:r}=function(e){let{chains:t,optionalChains:r,methods:n,optionalMethods:i,events:s,optionalEvents:o,rpcMap:a}=e;if(!rI(t))throw Error("Invalid chains");let l={chains:t,methods:n||lx,events:s||lO,rpcMap:lj({},t.length?{[lq(t)]:a[lq(t)]}:{})},u=s?.filter(e=>!lO.includes(e)),c=n?.filter(e=>!lx.includes(e));if(!r&&!o&&!i&&!(null!=u&&u.length)&&!(null!=c&&c.length))return{required:t.length?l:void 0};let h={chains:[...new Set(u?.length&&c?.length||!r?l.chains.concat(r||[]):r)],methods:[...new Set(l.methods.concat(null!=i&&i.length?i:lP))],events:[...new Set(l.events.concat(null!=o&&o.length?o:lT))],rpcMap:a};return{required:t.length?l:void 0,optional:r.length?h:void 0}}(this.rpc);try{let n=await new Promise(async(n,i)=>{var s;this.rpc.showQrModal&&(null==(s=this.modal)||s.subscribeModal(e=>{e.open||this.signer.session||(this.signer.abortPairingAttempt(),i(Error("Connection request reset. Please try again.")))})),await this.signer.connect(lF(lj({namespaces:lj({},t&&{[this.namespace]:t})},r&&{optionalNamespaces:{[this.namespace]:r}}),{pairingTopic:e?.pairingTopic})).then(e=>{n(e)}).catch(e=>{i(Error(e.message))})});if(!n)return;let i=function(e,t=[]){let r=[];return Object.keys(e).forEach(n=>{if(t.length&&!t.includes(n))return;let i=e[n];
104r.push(...i.accounts)}),r}(n.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:i),this.setAccounts(i),this.events.emit("connect",{chainId:lH(this.chainId)})}catch(e){throw this.signer.logger.error(e),e}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",e=>{let{params:t}=e,{event:r}=t;"accountsChanged"===r.name?(this.accounts=this.parseAccounts(r.data),this.events.emit("accountsChanged",this.accounts)):"chainChanged"===r.name?this.setChainId(this.formatChainId(r.data)):this.events.emit(r.name,r.data),this.events.emit("session_event",e)}),this.signer.on("chainChanged",e=>{let t=parseInt(e);this.chainId=t,this.events.emit("chainChanged",lH(this.chainId)),this.persist()}),this.signer.on("session_update",e=>{this.events.emit("session_update",e)}),this.signer.on("session_delete",e=>{this.reset(),this.events.emit("session_delete",e),this.events.emit("disconnect",lF(lj({},function(e,t){let{message:r,code:n}=rC[e];return{message:r,code:n}}("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",e=>{var t,r;this.rpc.showQrModal&&(null==(t=this.modal)||t.closeModal(),null==(r=this.modal)||r.openModal({uri:e})),this.events.emit("display_uri",e)})}switchEthereumChain(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}isCompatibleChainId(e){return"string"==typeof e&&e.startsWith(`${this.namespace}:`)}formatChainId(e){return`${this.namespace}:${e}`}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){let t=e.filter(e=>this.isCompatibleChainId(e)).map(e=>this.parseChainId(e));t.length&&(this.chainId=t[0],this.events.emit("chainChanged",lH(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){let t=this.parseChainId(e);this.chainId=t,this.switchEthereumChain(t)}}parseAccountId(e){let[t,r,n]=e.split(":");return{chainId:`${t}:${r}`,address:n}}setAccounts(e){this.accounts=e.filter(e=>this.parseChainId(this.parseAccountId(e).chainId)===this.chainId).map(e=>this.parseAccountId(e).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var t,r;let n=null!=(t=e?.chains)?t:[],i=null!=(r=e?.optionalChains)?r:[],s=n.concat(i);if(!s.length)throw Error("No chains specified in either `chains` or `optionalChains`");let o=n.length?e?.methods||lx:[],a=n.length?e?.events||lO:[],l=e?.optionalMethods||[],u=e?.optionalEvents||[],c=e?.rpcMap||this.buildRpcMap(s,e.projectId),h=e?.qrModalOptions||void 0;return{chains:n?.map(e=>this.formatChainId(e)),optionalChains:i.map(e=>this.formatChainId(e)),methods:o,events:a,optionalMethods:l,optionalEvents:u,rpcMap:c,showQrModal:!!(null!=e&&e.showQrModal),qrModalOptions:h,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,t){let r={};return e.forEach(e=>{r[e]=this.getRpcUrl(e,t)}),r}async initialize(e){if(this.rpc=this.getRpcConfig(e),this.chainId=this.rpc.chains.length?lq(this.rpc.chains):lq(this.rpc.optionalChains),this.signer=await lI.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:e.disableProviderPing,relayUrl:e.relayUrl,storageOptions:e.storageOptions}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let e;try{let{WalletConnectModal:t}=await r.e(5318).then(r.bind(r,55318));e=t}catch{throw Error("To use QR modal, please install @walletconnect/modal package")}if(e)try{this.modal=new e(lj({projectId:this.rpc.projectId},this.rpc.qrModalOptions))}catch(e){throw this.signer.logger.error(e),Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(e){if(!e)return;let{chains:t,optionalChains:r,rpcMap:n}=e;t&&rI(t)&&(this.rpc.chains=t.map(e=>this.formatChainId(e)),t.forEach(e=>{this.rpc.rpcMap[e]=n?.[e]||this.getRpcUrl(e)})),r&&rI(r)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=r?.map(e=>this.formatChainId(e)),r.forEach(e=>{this.rpc.rpcMap[e]=n?.[e]||this.getRpcUrl(e)}))}getRpcUrl(e,t){var r;return(null==(r=this.rpc.rpcMap)?void 0:r[e])||`https://rpc.walletconnect.com/v1/?chainId=eip155:${e}&projectId=${t||this.rpc.projectId}`}async loadPersistedSession(){if(!this.session)return;let e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),t=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:t?.accounts),this.setAccounts(t?.accounts)}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(e){return"string"==typeof e||e instanceof String?[this.parseAccount(e)]:e.map(e=>this.parseAccount(e))}}var l$=r(36393);let lV=(e,t=10)=>{try{let r=parseInt(String(e),t);if(isNaN(r)){ew.kg.error(`Error parsing ${e}`);return}return r}catch(t){ew.kg.error(`Error parsing ${e} to int: ${t}`)}},lW=e=>`dynamic-wc2-active-account-${e}`,lG=e=>`dynamic-wc2-session-topic-${e}`,lK=e=>`dynamic-wc2-switched-network-${e}`,lJ=e=>`dynamic-wc2-current-chain-${e}`,lY=new l$.Z;class lQ extends e1{constructor(e){var t;super(e),this.supportedChains=["EVM","ETH"],this.connectedChain="EVM",this.isInitialized=!1,this.canConnectViaQrCode=!0,this.isWalletConnect=!0,this.preferredChains=[],this._hasSwitchedNetwork=!1,this.sessionEventHandler=()=>{},this.sessionDeleteHandler=()=>{},this.name=e.walletName,this.projectId=e.projectId,this.deepLinkPreference=e.deepLinkPreference||"native",this.preferredChains=e.walletConnectPreferredChains||[],this.hasSwitchedNetwork=t=!!localStorage.getItem(this.swicthedNetworkKey);let r=localStorage.getItem(this.currentChainKey);this.currentChainId=r?lV(r):void 0}getMappedChains(){return this.evmNetworks.filter(e=>11297108109!==e.chainId).map(e=>`eip155:${e.chainId}`)}getMappedChainsByPreferredOrder(){let e=this.getMappedChains();return e.includes("eip155:1")||e.push("eip155:1"),[...this.preferredChains.filter(t=>e.includes(t)),...e.filter(e=>!this.preferredChains.includes(e))].map(e=>Number(e.split(":")[1]))}initConnection(){return eV(this,void 0,void 0,function*(){let{provider:e}=lQ;if(!e)throw new eE.kW("No provider found (init connection)");null!=e&&e.signer.uri||e.connect().catch(e=>{ew.kg.error(e),lY.emit("walletconnect_connection_failed",e)})})}createProvider(){return eV(this,void 0,void 0,function*(){return lz.init({events:["chainChanged","accountsChanged"],methods:[],optionalChains:this.getMappedChainsByPreferredOrder(),optionalMethods:["eth_chainId","eth_signTypedData","eth_signTransaction","eth_sign","personal_sign","eth_sendTransaction","eth_signTypedData_v4","wallet_switchEthereumChain","wallet_addEthereumChain"],projectId:this.projectId,rpcMap:this.evmNetworkRpcMap(),showQrModal:!1})})}getWalletClientFromInitializedProvider(){return eV(this,void 0,void 0,function*(){let e=this.createProvider();return(0,eG.K)({account:this.activeAccount?(0,B.A)(this.activeAccount):void 0,transport:(0,eK.P)((yield e))})})}createInitProviderPromise(){return eV(this,void 0,void 0,function*(){lQ.provider=yield this.createProvider(),this.teardownEventListeners(),this.setupEventListeners()})}initProvider(){return eV(this,void 0,void 0,function*(){let{provider:e}=lQ;e||(void 0===this.initializePromise&&(this.initializePromise=this.createInitProviderPromise()),yield this.initializePromise)})}refreshSession(){var e,t,r,n,i;(null===(t=null===(e=lQ.provider)||void 0===e?void 0:e.session)||void 0===t?void 0:t.topic)&&localStorage.getItem(this.sessionTopicKey)===(null===(n=null===(r=lQ.provider)||void 0===r?void 0:r.session)||void 0===n?void 0:n.topic)&&(this.session=lQ.provider.session,this.activeAccount=null!==(i=localStorage.getItem(this.activeAccountKey))&&void 0!==i?i:void 0)}init(){return eV(this,void 0,void 0,function*(){yield this.initProvider(),yield this.initConnection(),this.isInitialized=!0})}get sessionTopicKey(){return lG(this.key)}get activeAccountKey(){return lW(this.key)}get swicthedNetworkKey(){return lK(this.key)}get currentChainKey(){return lJ(this.key)}set currentChainId(e){this._currentChainId=e,e?localStorage.setItem(this.currentChainKey,e.toString()):localStorage.removeItem(this.currentChainKey)}get currentChainId(){return this._currentChainId}set hasSwitchedNetwork(e){this._hasSwitchedNetwork=e,e?localStorage.setItem(this.swicthedNetworkKey,e.toString()):localStorage.removeItem(this.swicthedNetworkKey)}get hasSwitchedNetwork(){return this._hasSwitchedNetwork}supportsNetworkSwitching(){return!0}setupEventListeners(){lQ.provider&&(this.sessionEventHandler=({params:e})=>
104{if(ew.kg.debug("session_event was called",{params:e}),!e||!e.event){ew.kg.debug("session_event was called without params or params.event");return}let{name:t,data:r}=e.event;if("chainChanged"===t){let e=lV(r);if(e===this.currentChainId){ew.kg.debug(`ignoring chainChanged event with same chain id as current chain id: ${e}`);return}if(void 0===e){ew.kg.debug(`received unexpected data for chainChanged: ${r} with type ${typeof r}}`);return}this.currentChainId=e,this.emit("chainChange",{chain:String(e)}),this.hasSwitchedNetwork=!0,this.switchNetwork({networkChainId:e})}else if("accountsChanged"===t){if(!Array.isArray(r)){ew.kg.debug(`received unexpected data for accountsChanged: ${r} with type ${typeof r}}`);return}let e=r[0].split(":")[2];this.setActiveAccount(e)}},lQ.provider.on("session_event",this.sessionEventHandler),this.sessionDeleteHandler=()=>eV(this,void 0,void 0,function*(){this.endSession(),this.emit("disconnect")}),lQ.provider.on("session_delete",this.sessionDeleteHandler))}teardownEventListeners(){lQ.provider&&(lQ.provider.off("session_event",this.sessionEventHandler),lQ.provider.off("session_delete",this.sessionDeleteHandler))}getWalletClient(e){if(lQ.provider)return(0,eG.K)({account:this.activeAccount?(0,B.A)(this.activeAccount):void 0,chain:e_.zk[null!=e?e:String(this.currentChainId)],transport:(0,eK.P)(lQ.provider)})}fetchPublicAddress(e){return eV(this,void 0,void 0,function*(){var t,r;if(this.activeAccount)return this.activeAccount;if((!lQ.provider||!(null===(t=lQ.provider)||void 0===t?void 0:t.signer.uri))&&(ew.kg.debug("No WC2 provider found, re-initializing..."),yield this.endSession(),yield this.init(),yield new Promise(e=>setTimeout(e,1e3)),!lQ.provider||!(null===(r=lQ.provider)||void 0===r?void 0:r.signer.uri)))throw ew.kg.debug("No WC2 provider found, escaping and throwing error"),new eE.kW("No provider found");let n=(0,eW.MO)(this.walletBook,this.key);return(0,ew.ze)(lQ.provider.signer.uri,n,{onDesktopUri:null==e?void 0:e.onDesktopUri,onDisplayUri:null==e?void 0:e.onDisplayUri},this.deepLinkPreference),new Promise((e,t)=>{if(!lQ.provider){t(new eE.kW("No provider found"));return}lY.on("walletconnect_connection_failed",()=>{let e=new eE.kW("Connection rejected. Please try again.");e.code="connection_rejected",lQ.provider&&(lQ.provider.signer.uri=void 0,this.init()),t(e)}),lQ.provider.on("connect",()=>{var r;let n=null===(r=lQ.provider)||void 0===r?void 0:r.session;if(!n){t(new eE.kW("No session found"));return}this.setSession(n),this.setActiveAccount(n.namespaces.eip155.accounts[0].split(":")[2]),this.getNetwork().then(t=>{this.currentChainId=t,e(this.activeAccount)})})})})}waitForSignMessage(e,t){return eV(this,void 0,void 0,function*(){let r=new Promise((r,n)=>{this.on("chainChange",()=>r({success:!1})),e(t).then(e=>r({signedMessage:e,success:!0})).catch(n)}),n=yield r;return!1===n.success?e(t):n.signedMessage})}getDeepLink(){var e;if(!this.session)return;let t=(0,eW.MO)(this.walletBook,this.key),r=(0,ew.bW)({metadata:t,mode:"regular",preference:this.deepLinkPreference,uri:null===(e=lQ.provider)||void 0===e?void 0:e.signer.uri});if(r)return`${r}?sessionTopic=${this.session.topic}`}signMessage(e){return eV(this,void 0,void 0,function*(){if(!this.session)throw new eE.kW("no session");let t=this.getDeepLink();return(0,eE.tq)()&&t&&(window.location.href=t),yield this.waitForSignMessage(e=>eV(this,void 0,void 0,function*(){let{activeAccount:t}=this;if(t)return(yield this.getWalletClientFromInitializedProvider()).signMessage({account:t,message:e})}),e)})}clearActiveAccount(){localStorage.removeItem(this.activeAccountKey),this.activeAccount=void 0}clearSession(){localStorage.removeItem(this.sessionTopicKey),this.session=void 0}setActiveAccount(e){localStorage.setItem(this.activeAccountKey,e),this.activeAccount=e,this.emit("accountChange",{accounts:[e]})}setSession(e){localStorage.setItem(this.sessionTopicKey,e.topic),this.session=e}endSession(){return eV(this,void 0,void 0,function*(){var e;if(this.clearActiveAccount(),this.clearSession(),this.hasSwitchedNetwork=!1,this.currentChainId=void 0,null===(e=lQ.provider)||void 0===e?void 0:e.session)try{yield lQ.provider.disconnect(),lQ.provider=void 0}catch(e){ew.kg.debug(e)}})}getNetwork(){let e=Object.create(null,{getNetwork:{get:()=>super.getNetwork}});return eV(this,void 0,void 0,function*(){return this.currentChainId?this.currentChainId:(yield this.initProvider(),e.getNetwork.c
104all(this))})}providerSwitchNetwork(e){let t=Object.create(null,{providerSwitchNetwork:{get:()=>super.providerSwitchNetwork}});return eV(this,arguments,void 0,function*({network:e}){let r=yield this.getSupportedNetworks();if(!(null==r?void 0:r.includes(e.chainId.toString()))){let e=new eE.kW("Network switching is not available at this time. The user should manually switch network in their wallet");throw e.code="network_switching_only_available_in_wallet",e}let n=yield this.getNetwork();if(n&&n===e.chainId)return;if(this.switchNetworkOnlyFromWallet)throw new eE.kW("Network switching is only supported through the wallet");if(!this.supportsNetworkSwitching())throw new eE.kW("Network switching not supported");let i=yield this.getWalletClientFromInitializedProvider();if(this.isMetaMask()){let e=this.getDeepLink();e&&(window.location.href=e)}yield t.providerSwitchNetwork.call(this,{network:e,provider:i}),this.currentChainId=e.chainId,this.hasSwitchedNetwork=!0,this.emit("chainChange",{chain:String(e.chainId)})})}getConnectedAccounts(){return eV(this,void 0,void 0,function*(){return(!1===this.isInitialized&&(yield this.initProvider(),this.refreshSession(),this.isInitialized=!0),this.activeAccount)?[this.activeAccount]:[]})}isMetaMask(){var e,t,r,n,i;return null!==(i=null===(n=null===(r=null===(t=null===(e=this.session)||void 0===e?void 0:e.peer)||void 0===t?void 0:t.metadata)||void 0===r?void 0:r.name)||void 0===n?void 0:n.toLowerCase().startsWith("metamask"))&&void 0!==i&&i}getSupportedNetworks(){return eV(this,void 0,void 0,function*(){var e;if(yield this.initProvider(),this.refreshSession(),this.isMetaMask())return this.hasSwitchedNetwork?[String(this.currentChainId)]:this.evmNetworks.map(e=>e.chainId.toString());if(!this.session)return[];let t=[];return Object.keys(this.session.namespaces).forEach(e=>{e.startsWith("eip155:")&&t.push(e.split(":")[1])}),null===(e=this.session.namespaces.eip155)||void 0===e||e.accounts.forEach(e=>t.push(e.split(":")[1])),t.length?t:this.evmNetworks.map(e=>e.chainId.toString())})}}class lZ extends e1{constructor(){super(...arguments),this.supportedChains=["ETH","EVM"],this.connectedChain="EVM",this.walletConnectorFallback=!1}getEthProviderHelper(){return this.wallet||(this.wallet=(0,eW.IP)(this.walletBook,this.key)),this.wallet&&!this.ethProviderHelper&&(this.ethProviderHelper=new eX(this.wallet)),this.ethProviderHelper}getMobileOrInstalledWallet(){var e,t;return(this.wallet||(this.wallet=(0,eW.IP)(this.walletBook,this.key)),this.isInstalledOnBrowser()||(null===(t=null===(e=this.wallet)||void 0===e?void 0:e.mobile)||void 0===t?void 0:t.inAppBrowser)&&"universal"!==this.constructorProps.deepLinkPreference&&(0,eE.tq)()||!this.walletConnectorFallback)?this:new lQ(Object.assign(Object.assign({},this.constructorProps),{walletName:this.name}))}setupEventListeners(){if(!this.getWalletClient())return;let e=this.getEthProviderHelper();if(!e)return;let{tearDownEventListeners:t}=e._setupEventListeners(this);this.teardownEventListeners=t}getWalletClient(e){var t;return null===(t=this.getEthProviderHelper())||void 0===t?void 0:t.findWalletClient(e)}isInstalledOnBrowser(){var e;return(null===(e=this.getEthProviderHelper())||void 0===e?void 0:e.findProvider())!==void 0}fetchPublicAddress(){return eV(this,void 0,void 0,function*(){var e;return null===(e=this.getEthProviderHelper())||void 0===e?void 0:e.fetchPublicAddress()})}connect(){return eV(this,void 0,void 0,function*(){yield this.fetchPublicAddress()})}signMessage(e){return eV(this,void 0,void 0,function*(){var t;return null===(t=this.getEthProviderHelper())||void 0===t?void 0:t.signMessage(e)})}proveOwnership(e){return eV(this,void 0,void 0,function*(){return this.signMessage(e)})}endSession(){return eV(this,void 0,void 0,function*(){})}providerSwitchNetwork(e){let t=Object.create(null,{providerSwitchNetwork:{get:()=>super.providerSwitchNetwork}});return eV(this,arguments,void 0,function*({network:e,provider:r}){return t.providerSwitchNetwork.call(this,{network:e,provider:r})})}}class lX extends lZ{constructor(e){super(e),this.name="PhantomEvm",this.wallet=(0,eW.IP)(this.walletBook,this.key)}fetchPublicAddress(){let e=Object.create(null,{fetchPublicAddress:{get:()=>super.fetchPublicAddress}});return eV(this,void 0,void 0,function*(){if(this.isInstalledOnBrowser())return e.fetchPublicAddress.call(this);(0,eE.tq)()&&(0,eE.Rc)({nativeLink:"phantom://browse",universalLink:"https://phantom.app/ul/browse"})})}}class l0 extends lZ{constructor(e){super(e),this.name="ExodusEvm",this.walletConnectorFallback=!0,this.wallet=(0,eW.IP)(this.walletBook,this.key)}}let l1={eip6963Config:{rdns:"io.zerion.wallet"},filterFromWalletConnect:!0,injectedConfig:[{chain:"evm",extensionLocators:[{flag:"isMetaMask",value:!0}],windowLocations:["zerionWallet","zerionwallet.ethereum"]}],name:"Zerion"};class l2 extends lZ{constructor(e){super(e),this.name="Zerion",this.overrideKey="zerion",this.wallet=l1}isInstalledOnBrowser(){var e;return!!(window.zerionWallet||(null===(e=window.zerionwallet)||void 0===e?void 0:e.ethereum))}}let l3=[lX,l0,l2],l5=["phantomevm","coinbase","exodusevm","zerion"],l6=({walletBook:e})=>{var t;return Object.entries(null!==(t=null==e?void 0:e.wallets)&&void 0!==t?t:{}).filter(([e,t])=>{var r;return(null===(r=t.injectedConfig)||void 0===r?void 0:r.find(e=>"evm"===e.chain))&&!l5.includes(e)}).map(([e,t])=>{let{shortName:r}=t,n=r||t.name,i=!!t.walletConnect;return class extends lZ{constructor(r){super(Object.assign({},r)),this.name=n,this.wallet=t,this.walletConnectorFallback=i,this.overrideKey=e}fetchPublicAddress(){let e=Object.create(null,{fetchPublicAddress:{get:()=>super.fetchPublicAddress}});return eV(this,void 0,void 0,function*(){var t;if(this.isInstalledOnBrowser())return e.fetchPublicAddress.call(this);let r=null===(t=this.wallet.mobile)||void 0===t?void 0:t.inAppBrowser;if(!r){let e=Error(`No inAppBrowserBase found for ${this.name}.`);throw ew.kg.error(e.message),e}let n=window.location.href.replace("https://","");window.location.href=`${r}/${n}`})}}})};class l4 extends e1{constructor(e){var{walletName:t}=e;super(e$(e,["walletName"])),this.supportedChains=["EVM","ETH"],this.connectedChain="EVM",this.bridge="https://bridge.walletconnect.org",this.name=t}getWalletClient(){}}
104let l8=({isWalletConnectV2Enabled:e,walletBook:t})=>{var r;return Object.values(null!==(r=null==t?void 0:t.wallets)&&void 0!==r?r:{}).filter(e=>e.walletConnect&&!e.filterFromWalletConnect).map(t=>{var r;let{shortName:n}=t,i=n||t.name;return e&&(null===(r=t.walletConnect.sdks)||void 0===r?void 0:r.includes("sign_v2"))?class extends lQ{constructor(e){super(Object.assign(Object.assign({},e),{walletName:i}))}}:class extends l4{constructor(e){super(Object.assign(Object.assign({},e),{walletName:i}))}}})},l7=({isWalletConnectV2Enabled:e})=>e?class extends lQ{constructor(e){super(Object.assign(Object.assign({},e),{walletName:"WalletConnect"}))}}:class extends l4{constructor(e){super(Object.assign(Object.assign({},e),{walletName:"WalletConnect"}))}};var l9=r(86080),ue=r(95046),ut=r(82361);let ur="87939db78f824920ada5c872db3e56b8",un=`https://mainnet.infura.io/v3/${ur}`,ui=({opts:{appLogoUrl:e,appName:t="",evmNetworks:r=[]}={}})=>{var n,i;if(!o){s=new l9.jp({appLogoUrl:e,appName:t,enableMobileWalletLink:!0,headlessMode:!0,reloadOnDisconnect:!1});let a=null==r?void 0:r.find(e=>1===e.chainId),l=(null===(n=null==a?void 0:a.privateCustomerRpcUrls)||void 0===n?void 0:n[0])||(null===(i=null==a?void 0:a.rpcUrls)||void 0===i?void 0:i[0])||un;o=s.makeWeb3Provider(l,1)}return{provider:o,sdk:s}},us=()=>eV(void 0,void 0,void 0,function*(){yield null==o?void 0:o.close()}),uo=(e,t)=>eV(void 0,void 0,void 0,function*(){var r;let{provider:n,sdk:i}=ui({opts:e}),s=i.getQrUrl();if(!s)throw new eE.kW("no qr url available");null===(r=null==t?void 0:t.onDisplayUri)||void 0===r||r.call(t,s);let[o]=yield n.request({method:"eth_requestAccounts"});return o}
104),ua=(e,t)=>eV(void 0,void 0,void 0,function*(){let{provider:r}=ui({opts:e}),[n]=yield r.request({method:"eth_requestAccounts"});try{return yield r.request({method:"personal_sign",params:[(0,ue.NC)((0,ut.O0)(t)),n.toLowerCase()]})}catch(e){yield r.close();return}});class ul extends e1{constructor(e){var{appName:t,appLogoUrl:r,evmNetworks:n}=e;super(Object.assign({evmNetworks:n},e$(e,["appName","appLogoUrl","evmNetworks"]))),this.name="Coinbase",this.supportedChains=["EVM","ETH"],this.connectedChain="EVM",this.canConnectViaQrCode=!0,this.coinbaseProviderOpts={appLogoUrl:r,appName:t,evmNetworks:n};let i=(0,eW.IP)(this.walletBook,this.key);if(!i)return;this.ethProviderHelper=new eX(i)}setupEventListeners(){var e,t,r;if(!this.isInstalledOnBrowser()){this.setupCoinbaseProviderEventListeners();return}if(!(null===(e=this.ethProviderHelper)||void 0===e?void 0:e.findProvider()))return;let n=null===(r=null===(t=this.ethProviderHelper)||void 0===t?void 0:t._setupEventListeners)||void 0===r?void 0:r.call(t,this);(null==n?void 0:n.tearDownEventListeners)&&(this.teardownEventListeners=n.tearDownEventListeners)}getWalletClient(e){var t;return this.isInstalledOnBrowser()?null===(t=this.ethProviderHelper)||void 0===t?void 0:t.findWalletClient(e):(0,eG.K)({transport:(0,eK.P)(ui({opts:this.coinbaseProviderOpts}).provider)})}isInstalledOnBrowser(){var e;return(null===(e=this.ethProviderHelper)||void 0===e?void 0:e.findProvider())!==void 0}fetchPublicAddress(e){return eV(this,void 0,void 0,function*(){var t;return this.isInstalledOnBrowser()?null===(t=this.ethProviderHelper)||void 0===t?void 0:t.fetchPublicAddress():uo(this.coinbaseProviderOpts,e)})}signMessage(e){return eV(this,void 0,void 0,function*(){var t;return this.isInstalledOnBrowser()?null===(t=this.ethProviderHelper)||void 0===t?void 0:t.signMessage(e):ua(this.coinbaseProviderOpts,e)})}endSession(){return eV(this,void 0,void 0,function*(){this.isInstalledOnBrowser()||us()})}setupCoinbaseProviderEventListeners(){let{provider:e}=ui({opts:this.coinbaseProviderOpts});if(!e)return;let{handleAccountChange:t,handleChainChange:r,handleDisconnect:n}=(0,ew.nb)(this);e.on("accountsChanged",t),e.on("chainChanged",r),e.on("disconnect",n),this.teardownEventListeners=()=>{e.removeListener("accountsChanged",t),e.removeListener("chainChanged",r),e.removeListener("disconnect",n)}}}let uu=e=>[...l3,...l6(e),...l8(e),...eL(e),ul,l7(e)]},14448:function(e,t,r){"use strict";function n(e,t,r,n){return new(r||(r=Promise))(function(i,s){function o(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})}r.d(t,{P:function(){return x}}),"function"==typeof SuppressedError&&SuppressedError;var i=r(59035),s=r(22594),o=r(9784),a=r(36173),l=r(46396),u=r(55415),c=r(86160),h=r(13421),d=r(86365),f=function(e,t,r,n){return new(r||(r=Promise))(function(i,s){function o(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};let p=new h.Yd(d.i);function g(){return new Date().getTime()}function y(e){let t=null;for(let r=0;r<e.length;r++){let n=e[r];if(null==n)return null;t?t.name===n.name&&t.chainId===n.chainId&&(t.ensAddress===n.ensAddress||null==t.ensAddress&&null==n.ensAddress)||p.throwArgumentError("provider mismatch","networks",e):t=n}return t}function m(e,t){let r=Math.floor((e=e.slice().sort()).length/2);if(e.length%2)return e[r];let n=e[r-1],i=e[r];return null!=t&&Math.abs(n-i)>t?null:(n+i)/2}function v(e){if(null===e)return"null";if("number"==typeof e||"boolean"==typeof e)return JSON.stringify(e);if("string"==typeof e)return e;if(s.O$.isBigNumber(e))return e.toString();if(Array.isArray(e))return JSON.stringify(e.map(e=>v(e)));if("object"==typeof e){let t=Object.keys(e);return t.sort(),"{"+t.map(t=>{let r=e[t];return r="function"==typeof r?"[function]":v(r),JSON.stringify(t)+":"+r}).join(",")+"}"}throw Error("unknown value type: "+typeof e)}let b=1;function w(e){let t=null,r=null,n=new Promise(n=>{r=setTimeout(t=function(){r&&(clearTimeout(r),r=null),n()},e)});return{cancel:t,getPromise:function(){return n},wait:e=>n=n.then(e)}}let _=[h.Yd.errors.CALL_EXCEPTION,h.Yd.errors.INSUFFICIENT_FUNDS,h.Yd.errors.NONCE_EXPIRED,h.Yd.errors.REPLACEMENT_UNDERPRICED,h.Yd.errors.UNPREDICTABLE_GAS_LIMIT],E=["address","args","errorArgs","errorSignature","method","transaction"];function S(e,t){let r={weight:e.weight};return Object.defineProperty(r,"provider",{get:()=>e.provider}),e.start&&(r.start=e.start),t&&(r.duration=t-e.start),e.done&&(e.error?r.error=e.error:r.result=e.result||null),r}function A(e,t){return f(this,void 0,void 0,function*(){let r=e.provider;return null!=r.blockNumber&&r.blockNumber>=t||-1===t?r:(0,l.$l)(()=>new Promise((n,i)=>{setTimeout(function(){return r.blockNumber>=t?n(r):e.cancelled?n(null):n(void 0)}
104,0)}),{oncePoll:r})})}class k extends u.Zk{constructor(e,t){0===e.length&&p.throwArgumentError("missing providers","providers",e);let r=e.map((e,t)=>{if(i.zt.isProvider(e)){let t=(0,c.Gp)(e)?2e3:750;return Object.freeze({provider:e,weight:1,stallTimeout:t,priority:1})}let r=(0,a.DC)(e);null==r.priority&&(r.priority=1),null==r.stallTimeout&&(r.stallTimeout=(0,c.Gp)(e)?2e3:750),null==r.weight&&(r.weight=1);let n=r.weight;return(n%1||n>512||n<1)&&p.throwArgumentError("invalid weight; must be integer in [1, 512]",`providers[${t}].weight`,n),Object.freeze(r)}),n=r.reduce((e,t)=>e+t.weight,0);null==t?t=n/2:t>n&&p.throwArgumentError("quorum will always fail; larger than total weight","quorum",t);let s=y(r.map(e=>e.provider.network));null==s&&(s=new Promise((e,t)=>{setTimeout(()=>{this.detectNetwork().then(e,t)},0)})),super(s),(0,a.zG)(this,"providerConfigs",Object.freeze(r)),(0,a.zG)(this,"quorum",t),this._highestBlockNumber=-1}detectNetwork(){return f(this,void 0,void 0,function*(){return y((yield Promise.all(this.providerConfigs.map(e=>e.provider.getNetwork()))))})}perform(e,t){return f(this,void 0,void 0,function*(){if("sendTransaction"===e){let e=yield Promise.all(this.providerConfigs.map(e=>e.provider.sendTransaction(t.signedTransaction).then(e=>e.hash,e=>e)));for(let t=0;t<e.length;t++){let r=e[t];if("string"==typeof r)return r}throw e[0]}-1===this._highestBlockNumber&&"getBlockNumber"!==e&&(yield this.getBlockNumber());let r=function(e,t,r){var n,i;let s=v;switch(t){case"getBlockNumber":return function(t){let r=t.map(e=>e.result),n=m(t.map(e=>e.result),2);if(null!=n)return n=Math.ceil(n),r.indexOf(n+1)>=0&&n++,n>=e._highestBlockNumber&&(e._highestBlockNumber=n),e._highestBlockNumber};case"getGasPrice":return function(e){let t=e.map(e=>e.result);return t.sort(),t[Math.floor(t.length/2)]};case"getEtherPrice":return function(e){return m(e.map(e=>e.result))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":s=function(e){return null==e?null:((e=(0,a.DC)(e)).confirmations=-1,v(e))};break;case"getBlock":s=r.includeTransactions?function(e){return null==e?null:((e=(0,a.DC)(e)).transactions=e.transactions.map(e=>((e=(0,a.DC)(e)).confirmations=-1,e)),v(e))}:function(e){return null==e?null:v(e)};break;default:throw Error("unknown method: "+t)}return n=s,i=e.quorum,function(e){let t={};e.forEach(e=>{let r=n(e.result);t[r]||(t[r]={count:0,result:e.result}),t[r].count++});let r=Object.keys(t);for(let e=0;e<r.length;e++){let n=t[r[e]];if(n.count>=i)return n.result}}}(this,e,t),n=function(e){e=e.slice();for(let t=e.length-1;t>0;t--){let r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e}(this.providerConfigs.map(a.DC));n.sort((e,t)=>e.priority-t.priority);let i=this._highestBlockNumber,s=0,l=!0;for(;;){let u=g(),c=n.filter(e=>e.runner&&u-e.start<e.stallTimeout).reduce((e,t)=>e+t.weight,0);for(;c<this.quorum&&s<n.length;){let r=n[s++],l=b++;r.start=g(),r.staller=w(r.stallTimeout),r.staller.wait(()=>{r.staller=null}),r.runner=(function(e,t,r,n){return f(this,void 0,void 0,function*(){let i=e.provider;switch(r){case"getBlockNumber":case"getGasPrice":return i[r]();case"getEtherPrice":if(i.getEtherPrice)return i.getEtherPrice();break;case"getBalance":case"getTransactionCount":case"getCode":return n.blockTag&&(0,o.A7)(n.blockTag)&&(i=yield A(e,t)),i[r](n.address,n.blockTag||"latest");case"getStorageAt":return n.blockTag&&(0,o.A7)(n.blockTag)&&(i=yield A(e,t)),i.getStorageAt(n.address,n.position,n.blockTag||"latest");case"getBlock":return n.blockTag&&(0,o.A7)(n.blockTag)&&(i=yield A(e,t)),i[n.includeTransactions?"getBlockWithTransactions":"getBlock"](n.blockTag||n.blockHash);case"call":case"estimateGas":if(n.blockTag&&(0,o.A7)(n.blockTag)&&(i=yield A(e,t)),"call"===r&&n.blockTag)return i[r](n.transaction,n.blockTag);return i[r](n.transaction);case"getTransaction":case"getTransactionReceipt":return i[r](n.transactionHash);case"getLogs":{let r=n.filter;return(r.fromBlock&&(0,o.A7)(r.fromBlock)||r.toBlock&&(0,o.A7)(r.toBlock))&&(i=yield A(e,t)),i.getLogs(r)}}return p.throwError("unknown method error",h.Yd.errors.UNKNOWN_ERROR,{method:r,params:n})})})(r,i,e,t).then(n=>
104{r.done=!0,r.result=n,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:l,backend:S(r,g()),request:{method:e,params:(0,a.p$)(t)},provider:this})},n=>{r.done=!0,r.error=n,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:l,backend:S(r,g()),request:{method:e,params:(0,a.p$)(t)},provider:this})}),this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:l,backend:S(r,null),request:{method:e,params:(0,a.p$)(t)},provider:this}),c+=r.weight}let d=[];n.forEach(e=>{!e.done&&e.runner&&(d.push(e.runner),e.staller&&d.push(e.staller.getPromise()))}),d.length&&(yield Promise.race(d));let y=n.filter(e=>e.done&&null==e.error);if(y.length>=this.quorum){let e=r(y);if(void 0!==e)return n.forEach(e=>{e.staller&&e.staller.cancel(),e.cancelled=!0}),e;l||(yield w(100).getPromise()),l=!1}let m=n.reduce((e,t)=>{if(!t.done||null==t.error)return e;let r=t.error.code;return _.indexOf(r)>=0&&(e[r]||(e[r]={error:t.error,weight:0}),e[r].weight+=t.weight),e},{});if(Object.keys(m).forEach(e=>{let t=m[e];if(t.weight<this.quorum)return;n.forEach(e=>{e.staller&&e.staller.cancel(),e.cancelled=!0});let r=t.error,i={};E.forEach(e=>{null!=r[e]&&(i[e]=r[e])}),p.throwError(r.reason||r.message,e,i)}),0===n.filter(e=>!e.done).length)break}return n.forEach(e=>{e.staller&&e.staller.cancel(),e.cancelled=!0}),p.throwError("failed to meet quorum",h.Yd.errors.SERVER_ERROR,{method:e,params:t,results:n.map(e=>S(e)),provider:this})})}}var C=r(92030),I=r(68893);let x={extend:e=>{["ETH","EVM"].some(t=>e.supportedChains.includes(t))&&(e.ethers={getRpcProvider:function(){return n(this,void 0,void 0,function*(){var t,r;let{chain:n,transport:i}=yield e.getPublicClient(),s={chainId:null==n?void 0:n.id,ensAddress:null===(r=null===(t=null==n?void 0:n.contracts)||void 0===t?void 0:t.ensRegistry)||void 0===r?void 0:r.address,name:null==n?void 0:n.name};
104return"fallback"===i.type?new k(i.transports.map(({value:e})=>new C.r(null==e?void 0:e.url,s))):new C.r(i.url,s)})},getSigner:function(){return n(this,void 0,void 0,function*(){let t=yield e.ethers.getWeb3Provider(),r=yield e.fetchPublicAddress();return t.getSigner(r)})},getWeb3Provider:function(){return n(this,void 0,void 0,function*(){var t,r;let n;let i=yield e.getPublicClient(),s=e.getWalletClient(),{transport:o}=null!=s?s:{};if(!o)throw Error("Wallet is not connected, cannot create ethers client");if(i){let{chain:e}=i;n={chainId:null==e?void 0:e.id,ensAddress:null===(r=null===(t=null==e?void 0:e.contracts)||void 0===t?void 0:t.ensRegistry)||void 0===r?void 0:r.address,name:null==e?void 0:e.name}}return new I.Q(o,n)})}})},name:"ethers-wallet-connector-extension"}},3351:function(e,t,r){"use strict";r.d(t,{z:function(){return tI}});var n,i,s,o,a,l,u={};r.r(u),r.d(u,{acala:function(){return td.acala},arbitrum:function(){return td.arbitrum},arbitrumGoerli:function(){return td.arbitrumGoerli},arbitrumNova:function(){return td.arbitrumNova},arbitrumSepolia:function(){return td.arbitrumSepolia},astar:function(){return td.astar},astarZkatana:function(){return td.astarZkatana},aurora:function(){return td.aurora},auroraTestnet:function(){return td.auroraTestnet},avalanche:function(){return td.avalanche},avalancheFuji:function(){return td.avalancheFuji},bahamut:function(){return td.bahamut},base:function(){return td.base},baseGoerli:function(){return td.baseGoerli},baseSepolia:function(){return td.baseSepolia},bearNetworkChainMainnet:function(){return td.bearNetworkChainMainnet},bearNetworkChainTestnet:function(){return td.bearNetworkChainTestnet},bitTorrent:function(){return td.bitTorrent},bitTorrentTestnet:function(){return td.bitTorrentTestnet},boba:function(){return td.boba},bronos:function(){return td.bronos},bronosTestnet:function(){return td.bronosTestnet},bsc:function(){return td.bsc},bscTestnet:function(){return td.bscTestnet},bxn:function(){return td.bxn},bxnTestnet:function(){return td.bxnTestnet},canto:function(){return td.canto},celo:function(){return td.celo},celoAlfajores:function(){return td.celoAlfajores},celoCannoli:function(){return td.celoCannoli},chiliz:function(){return td.chiliz},classic:function(){return td.classic},confluxESpace:function(){return td.confluxESpace},confluxESpaceTestnet:function(){return td.confluxESpaceTestnet},coreDao:function(){return td.coreDao},cronos:function(){return td.cronos},cronosTestnet:function(){return td.cronosTestnet},crossbell:function(){return td.crossbell},dfk:function(){return td.dfk},dogechain:function(){return td.dogechain},edgeware:function(){return td.edgeware},edgewareTestnet:function(){return td.edgewareTestnet},ekta:function(){return td.ekta},ektaTestnet:function(){return td.ektaTestnet},eos:function(){return td.eos},eosTestnet:function(){return td.eosTestnet},evmos:function(){return td.evmos},evmosTestnet:function(){return td.evmosTestnet},fantom:function(){return td.fantom},fantomSonicTestnet:function(){return td.fantomSonicTestnet},fantomTestnet:function(){return td.fantomTestnet},fibo:function(){return td.fibo},filecoin:function(){return td.filecoin},filecoinCalibration:function(){return td.filecoinCalibration},filecoinHyperspace:function(){return td.filecoinHyperspace},flare:function(){return td.flare},flareTestnet:function(){return td.flareTestnet},foundry:function(){return td.foundry},fuse:function(){return td.fuse},fuseSparknet:function(){return td.fuseSparknet},gnosis:function(){return td.gnosis},gnosisChiado:function(){return td.gnosisChiado},gobi:function(){return td.gobi},goerli:function(){return td.goerli},haqqMainnet:function(){return td.haqqMainnet},haqqTestedge2:function(){return td.haqqTestedge2},hardhat:function(){return td.hardhat},harmonyOne:function(){return td.harmonyOne},holesky:function(){return td.holesky},iotex:function(){return td.iotex},iotexTestnet:function(){return td.iotexTestnet},jbc:function(){return td.jbc},karura:function(){return td.karura},kava:function(){return td.kava},kavaTestnet:function(){return td.kavaTestnet},klaytn:function(){return td.klaytn},klaytnBaobab:function(){return td.klaytnBaobab},kroma:function(){return td.kroma}
104,kromaSepolia:function(){return td.kromaSepolia},linea:function(){return td.linea},lineaTestnet:function(){return td.lineaTestnet},localhost:function(){return td.localhost},lukso:function(){return td.lukso},mainnet:function(){return td.mainnet},mandala:function(){return td.mandala},manta:function(){return td.manta},mantaTestnet:function(){return td.mantaTestnet},mantle:function(){return td.mantle},mantleTestnet:function(){return td.mantleTestnet},meter:function(){return td.meter},meterTestnet:function(){return td.meterTestnet},metis:function(){return td.metis},metisGoerli:function(){return td.metisGoerli},mev:function(){return td.mev},mevTestnet:function(){return td.mevTestnet},modeTestnet:function(){return td.modeTestnet},moonbaseAlpha:function(){return td.moonbaseAlpha},moonbeam:function(){return td.moonbeam},moonbeamDev:function(){return td.moonbeamDev},moonriver:function(){return td.moonriver},neonDevnet:function(){return td.neonDevnet},neonMainnet:function(){return td.neonMainnet},nexi:function(){return td.nexi},nexilix:function(){return td.nexilix},oasisTestnet:function(){return td.oasisTestnet},oasys:function(){return td.oasys},okc:function(){return td.okc},opBNB:function(){return td.opBNB},opBNBTestnet:function(){return td.opBNBTestnet},optimism:function(){return td.optimism},optimismGoerli:function(){return td.optimismGoerli},optimismSepolia:function(){return td.optimismSepolia},pgn:function(){return td.pgn},pgnTestnet:function(){return td.pgnTestnet},plinga:function(){return td.plinga},polygon:function(){return td.polygon},polygonMumbai:function(){return td.polygonMumbai},polygonZkEvm:function(){return td.polygonZkEvm},polygonZkEvmTestnet:function(){return td.polygonZkEvmTestnet},pulsechain:function(){return td.pulsechain},pulsechainV4:function(){return td.pulsechainV4},qMainnet:function(){return td.qMainnet},qTestnet:function(){return td.qTestnet},rollux:function(){return td.rollux},rolluxTestnet:function(){return td.rolluxTestnet},ronin:function(){return td.ronin},rootstock:function(){return td.rootstock},saigon:function(){return td.saigon},sapphire:function(){return td.sapphire},sapphireTestnet:function(){return td.sapphireTestnet},scroll:function(){return td.scroll},scrollSepolia:function(){return td.scrollSepolia},scrollTestnet:function(){return td.scrollTestnet},sepolia:function(){return td.sepolia},shardeumSphinx:function(){return td.shardeumSphinx},shibarium:function(){return td.shibarium},shimmer:function(){return td.shimmer},shimmerTestnet:function(){return td.shimmerTestnet},skaleBlockBrawlers:function(){return td.skaleBlockBrawlers},skaleCalypso:function(){return td.skaleCalypso},skaleCalypsoTestnet:function(){return td.skaleCalypsoTestnet},skaleChaosTestnet:function(){return td.skaleChaosTestnet},skaleCryptoBlades:function(){return td.skaleCryptoBlades},skaleCryptoColosseum:function(){return td.skaleCryptoColosseum},skaleEuropa:function(){return td.skaleEuropa},skaleEuropaTestnet:function(){return td.skaleEuropaTestnet},skaleExorde:function(){return td.skaleExorde},skaleHumanProtocol:function(){return td.skaleHumanProtocol},skaleNebula:function(){return td.skaleNebula},skaleNebulaTestnet:function(){return td.skaleNebulaTestnet},skaleRazor:function(){return td.skaleRazor},skaleTitan:function(){return td.skaleTitan},skaleTitanTestnet:function(){return td.skaleTitanTestnet},songbird:function(){return td.songbird},songbirdTestnet:function(){return td.songbirdTestnet},spicy:function(){return td.spicy},syscoin:function(){return td.syscoin},syscoinTestnet:function(){return td.syscoinTestnet},taikoJolnir:function(){return td.taikoJolnir},taikoTestnetSepolia:function(){return td.taikoTestnetSepolia},taraxa:function(){return td.taraxa},taraxaTestnet:function(){return td.taraxaTestnet},telos:function(){return td.telos},telosTestnet:function(){return td.telosTestnet},tenet:function(){return td.tenet},thunderTestnet:function(){return td.thunderTestnet},vechain:function(){return td.vechain},wanchain:function(){return td.wanchain},wanchainTestnet:function(){return td.wanchainTestnet},wemix:function(){return td.wemix},wemixTestnet:function(){return td.wemixTestnet},xdc:function(){return td.xdc},xdcTestnet:function(){return td.xdcTestnet},zetachainAthensTestnet:function(){return td.zetachainAthensTestnet},zhejiang:function(){return td.zhejiang},zilliqa:function(){return td.zilliqa},zilliqaTestnet:function(){return td.zilliqaTestnet},zkFair:function(){return td.zkFair},zkFairTestnet:function(){return td.zkFairTestnet},zkSync:function(){return td.zkSync},zkSyncSepoliaTestnet:function(){return td.zkSyncSepoliaTestnet},zkSyncTestnet:function(){return td.zkSyncTestnet},zora:function(){return td.zora},zoraSepolia:function(){return td.zoraSepolia},zoraTestnet:function(){return td.zoraTestnet}});
104var c=r(57437),h=r(2265),d=class extends Error{constructor({chainId:e,connectorId:t}){super(`Chain "${e}" not configured for connector "${t}".`),this.name="ChainNotConfiguredForConnectorError"}},f=class extends Error{constructor(){super(...arguments),this.name="ConnectorNotFoundError",this.message="Connector not found"}};function p(e){return"string"==typeof e?Number.parseInt(e,"0x"===e.trim().substring(0,2)?16:10):"bigint"==typeof e?Number(e):e}var g=r(43872),y=r(16491),m=r(35694),v=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},b=(e,t,r)=>(v(e,t,"read from private field"),r?r.call(e):t.get(e)),w=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},_=(e,t,r,n)=>(v(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),E=class extends g{constructor({chains:e=[y.R,m.w],options:t}){super(),this.chains=e,this.options=t}getBlockExplorerUrls(e){let{default:t,...r}=e.blockExplorers??{};if(t)return[t.url,...Object.values(r).map(e=>e.url)]}isChainUnsupported(e){return!this.chains.some(t=>t.id===e)}setStorage(e){this.storage=e}},S=r(99112),A=r(96329),k=r(26422),C=r(69532),I=r(95046),x=class extends E{constructor({chains:e,options:t}={}
104){let r={shimDisconnect:!0,getProvider(){if("undefined"==typeof window)return;let e=window.ethereum;return e?.providers&&e.providers.length>0?e.providers[0]:e},...t};super({chains:e,options:r}),this.id="injected",w(this,n,void 0),this.shimDisconnectKey=`${this.id}.shimDisconnect`,this.onAccountsChanged=e=>{0===e.length?this.emit("disconnect"):this.emit("change",{account:(0,S.K)(e[0])})},this.onChainChanged=e=>{let t=p(e),r=this.isChainUnsupported(t);this.emit("change",{chain:{id:t,unsupported:r}})},this.onDisconnect=async e=>{!(1013===e.code&&await this.getProvider()&&await this.getAccount())&&(this.emit("disconnect"),this.options.shimDisconnect&&this.storage?.removeItem(this.shimDisconnectKey))};let i=r.getProvider();if("string"==typeof r.name)this.name=r.name;else if(i){let e=function(e){if(!e)return"Injected";let t=e=>e.isApexWallet?"Apex Wallet":e.isAvalanche?"Core Wallet":e.isBackpack?"Backpack":e.isBifrost?"Bifrost Wallet":e.isBitKeep?"BitKeep":e.isBitski?"Bitski":e.isBlockWallet?"BlockWallet":e.isBraveWallet?"Brave Wallet":e.isCoin98?"Coin98 Wallet":e.isCoinbaseWallet?"Coinbase Wallet":e.isDawn?"Dawn Wallet":e.isDefiant?"Defiant":e.isDesig?"Desig Wallet":e.isEnkrypt?"Enkrypt":e.isExodus?"Exodus":e.isFordefi?"Fordefi":e.isFrame?"Frame":e.isFrontier?"Frontier Wallet":e.isGamestop?"GameStop Wallet":e.isHaqqWallet?"HAQQ Wallet":e.isHyperPay?"HyperPay Wallet":e.isImToken?"ImToken":e.isHaloWallet?"Halo Wallet":e.isKuCoinWallet?"KuCoin Wallet":e.isMathWallet?"MathWallet":e.isNovaWallet?"Nova Wallet":e.isOkxWallet||e.isOKExWallet?"OKX Wallet":e.isOktoWallet?"Okto Wallet":e.isOneInchIOSWallet||e.isOneInchAndroidWallet?"1inch Wallet":e.isOneKey?"OneKey Wallet":e.isOpera?"Opera":e.isPhantom?"Phantom":e.isPortal?"Ripio Portal":e.isRabby?"Rabby Wallet":e.isRainbow?"Rainbow":e.isSafePal?"SafePal Wallet":e.isStatus?"Status":e.isSubWallet?"SubWallet":e.isTalisman?"Talisman":e.isTally?"Taho":e.isTokenPocket?"TokenPocket":e.isTokenary?"Tokenary":e.isTrust||e.isTrustWallet?"Trust Wallet":e.isTTWallet?"TTWallet":e.isXDEFI?"XDEFI Wallet":e.isZeal?"Zeal":e.isZerion?"Zerion":e.isMetaMask?"MetaMask":void 0;if(e.providers?.length){let r=new Set,n=1;for(let i of e.providers){let e=t(i);e||(e=`Unknown Wallet #${n}`,n+=1),r.add(e)}let i=[...r];return i.length?i:i[0]??"Injected"}return t(e)??"Injected"}(i);r.name?this.name=r.name(e):"string"==typeof e?this.name=e:this.name=e[0]}else this.name="Injected";this.ready=!!i}async connect({chainId:e}={}){try{let t=await this.getProvider();if(!t)throw new f;t.on&&(t.on("accountsChanged",this.onAccountsChanged),t.on("chainChanged",this.onChainChanged),t.on("disconnect",this.onDisconnect)),this.emit("message",{type:"connecting"});let r=await t.request({method:"eth_requestAccounts"}),n=(0,S.K)(r[0]),i=await this.getChainId(),s=this.isChainUnsupported(i);return e&&i!==e&&(i=(await this.switchChain(e)).id,s=this.isChainUnsupported(i)),this.options.shimDisconnect&&this.storage?.setItem(this.shimDisconnectKey,!0),{account:n,chain:{id:i,unsupported:s}}}catch(e){if(this.isUserRejectedRequestError(e))throw new A.ab(e);if(-32002===e.code)throw new A.pT(e);throw e}}async disconnect(){let e=await this.getProvider();e?.removeListener&&(e.removeListener("accountsChanged",this.onAccountsChanged),e.removeListener("chainChanged",this.onChainChanged),e.removeListener("disconnect",this.onDisconnect),this.options.shimDisconnect&&this.storage?.removeItem(this.shimDisconnectKey))}async getAccount(){let e=await this.getProvider();if(!e)throw new f;let t=await e.request({method:"eth_accounts"});return(0,S.K)(t[0])}async getChainId(){let e=await this.getProvider();if(!e)throw new f;return e.request({method:"eth_chainId"}).then(p)}async getProvider(){let e=this.options.getProvider();return e&&_(this,n,e),b(this,n)}async getWalletClient({chainId:e}={}){let[t,r]=await Promise.all([this.getProvider(),this.getAccount()]),n=this.chains.find(t=>t.id===e);if(!t)throw Error("provider is required.");return(0,k.K)({account:r,chain:n,transport:(0,C.P)(t)})}async isAuthorized(){try{if(this.options.shimDisconnect&&!this.storage?.getItem(this.shimDisconnectKey))return!1;if(!await this.getProvider())throw new f;return!!await this.getAccount()}catch{return!1}}async switchChain(e){let t=await this.getProvider();if(!t)throw new f;let r=(0,I.eC)(e);try{return await Promise.all([t.request({method:"wallet_switchEthereumChain",params:[{chainId:r}]}),new Promise(t=>this.on("change",({chain:r})=>{r?.id===e&&t()}))]),this.chains.find(t=>
104t.id===e)??{id:e,name:`Chain ${r}`,network:`${r}`,nativeCurrency:{name:"Ether",decimals:18,symbol:"ETH"},rpcUrls:{default:{http:[""]},public:{http:[""]}}}}catch(i){let n=this.chains.find(t=>t.id===e);if(!n)throw new d({chainId:e,connectorId:this.id});if(4902===i.code||i?.data?.originalError?.code===4902)try{if(await t.request({method:"wallet_addEthereumChain",params:[{chainId:r,chainName:n.name,nativeCurrency:n.nativeCurrency,rpcUrls:[n.rpcUrls.public?.http[0]??""],blockExplorerUrls:this.getBlockExplorerUrls(n)}]}),await this.getChainId()!==e)throw new A.ab(Error("User rejected switch after adding network."));return n}catch(e){throw new A.ab(e)}if(this.isUserRejectedRequestError(i))throw new A.ab(i);throw new A.x3(i)}}async watchAsset({address:e,decimals:t=18,image:r,symbol:n}){let i=await this.getProvider();if(!i)throw new f;return i.request({method:"wallet_watchAsset",params:{type:"ERC20",options:{address:e,decimals:t,image:r,symbol:n}}})}isUserRejectedRequestError(e){return 4001===e.code}};n=new WeakMap;var P=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},O=(e,t,r)=>(P(e,t,"read from private field"),r?r.call(e):t.get(e)),T=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},R=(e,t,r,n)=>(P(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),N=(e,t,r)=>(P(e,t,"access private method"),r),D=r(60152),B=r(37591),M=r(97317),L=r(66021);function U(e,t={}){let{key:r="fallback",name:n="Fallback",rank:i=!1,retryCount:s,retryDelay:o}=t;return({chain:t,pollingInterval:a=4e3,timeout:l})=>{let u=e,c=()=>{},h=(0,L.q)({key:r,name:n,async request({method:e,params:r}){let n=async(i=0)=>{let s=u[i]({chain:t,retryCount:0,timeout:l});try{let t=await s.request({method:e,params:r});return c({method:e,params:r,response:t,transport:s,status:"success"}),t}catch(t){if(c({error:t,method:e,params:r,transport:s,status:"error"}),(0,B.y)(t)||i===u.length-1)throw t;return n(i+1)}};return n()},retryCount:s,retryDelay:o,type:"fallback"},{onResponse:e=>c=e,transports:u.map(e=>e({chain:t,retryCount:0}))});if(i){let e="object"==typeof i?i:{};!function({chain:e,interval:t=4e3,onTransports:r,sampleCount:n=10,timeout:i=1e3,transports:s,weights:o={}}){let{stability:a=.7,latency:l=.3}=o,u=[],c=async()=>{let o=await Promise.all(s.map(async t=>{let r,n;let s=t({chain:e,retryCount:0,timeout:i}),o=Date.now();try{await s.request({method:"net_listening"}),n=1}catch{n=0}finally{r=Date.now()}return{latency:r-o,success:n}}));u.push(o),u.length>n&&u.shift();let h=Math.max(...u.map(e=>Math.max(...e.map(({latency:e})=>e))));r(s.map((e,t)=>{let r=u.map(e=>e[t].latency),n=r.reduce((e,t)=>e+t,0)/r.length,i=u.map(e=>e[t].success),s=i.reduce((e,t)=>e+t,0)/i.length;return 0===s?[0,t]:[l*(1-n/h)+a*s,t]}).sort((e,t)=>t[0]-e[0]).map(([,e])=>s[e])),await (0,M.D)(t),c()};c()}({chain:t,interval:e.interval??a,onTransports:e=>u=e,sampleCount:e.sampleCount,timeout:e.timeout,transports:u,weights:e.weights})}return h}}var j=r(48786),F=r(4456),q=r(42623),H=r(22196);let z=e=>(t,r,n)=>{let i=n.subscribe;return n.subscribe=(e,t,r)=>{let s=e;if(t){let i=(null==r?void 0:r.equalityFn)||Object.is,o=e(n.getState());s=r=>{let n=e(r);if(!i(o,n)){let e=o;t(o=n,e)}},(null==r?void 0:r.fireImmediately)&&t(o,o)}return i(s)},e(t,r,n)},$=e=>t=>{try{let r=e(t);if(r instanceof Promise)return r;return{then:e=>$(e)(r),catch(e){return this}}}catch(e){return{then(e){return this},catch:t=>$(t)(e)}}},V=(e,t)=>(r,n,i)=>{let s,o,a={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},l=!1,u=new Set,c=new Set;try{s=a.getStorage()}catch(e){}if(!s)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),r(...e)},n,i);let h=$(a.serialize),d=()=>{let e;let t=h({state:a.partialize({...n()}),version:a.version}).then(e=>s.setItem(a.name,e)).catch(t=>{e=t});if(e)throw e;return t},f=i.setState;i.setState=(e,t)=>{f(e,t),d()};let p=e((...e)=>{r(...e),d()},n,i),g=()=>{var e;if(!s)return;
104l=!1,u.forEach(e=>e(n()));let t=(null==(e=a.onRehydrateStorage)?void 0:e.call(a,n()))||void 0;return $(s.getItem.bind(s))(a.name).then(e=>{if(e)return a.deserialize(e)}).then(e=>{if(e){if("number"!=typeof e.version||e.version===a.version)return e.state;if(a.migrate)return a.migrate(e.state,e.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}}).then(e=>{var t;return r(o=a.merge(e,null!=(t=n())?t:p),!0),d()}).then(()=>{null==t||t(o,void 0),l=!0,c.forEach(e=>e(o))}).catch(e=>{null==t||t(void 0,e)})};return i.persist={setOptions:e=>{a={...a,...e},e.getStorage&&(s=e.getStorage())},clearStorage:()=>{null==s||s.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>g(),hasHydrated:()=>l,onHydrate:e=>(u.add(e),()=>{u.delete(e)}),onFinishHydration:e=>(c.add(e),()=>{c.delete(e)})},g(),o||p},W=(e,t)=>(r,n,i)=>{let s,o={storage:function(e,t){let r;try{r=e()}catch(e){return}return{getItem:e=>{var t;let n=e=>null===e?null:JSON.parse(e,void 0),i=null!=(t=r.getItem(e))?t:null;return i instanceof Promise?i.then(n):n(i)},setItem:(e,t)=>r.setItem(e,JSON.stringify(t,void 0)),removeItem:e=>r.removeItem(e)}}(()=>localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},a=!1,l=new Set,u=new Set,c=o.storage;if(!c)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),r(...e)},n,i);let h=()=>{let e=o.partialize({...n()});return c.setItem(o.name,{state:e,version:o.version})},d=i.setState;i.setState=(e,t)=>{d(e,t),h()};let f=e((...e)=>{r(...e),h()},n,i);i.getInitialState=()=>f;let p=()=>{var e,t;if(!c)return;a=!1,l.forEach(e=>{var t;return e(null!=(t=n())?t:f)});let i=(null==(t=o.onRehydrateStorage)?void 0:t.call(o,null!=(e=n())?e:f))||void 0;return $(c.getItem.bind(c))(o.name).then(e=>{if(e){if("number"!=typeof e.version||e.version===o.version)return e.state;if(o.migrate)return o.migrate(e.state,e.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}}).then(e=>{var t;return r(s=o.merge(e,null!=(t=n())?t:f),!0),h()}).then(()=>{null==i||i(s,void 0),s=n(),a=!0,u.forEach(e=>e(s))}).catch(e=>{null==i||i(void 0,e)})};return i.persist={setOptions:e=>{o={...o,...e},e.storage&&(c=e.storage)},clearStorage:()=>{null==c||c.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>p(),hasHydrated:()=>a,onHydrate:e=>(l.add(e),()=>{l.delete(e)}),onFinishHydration:e=>(u.add(e),()=>{u.delete(e)})},o.skipHydration||p(),s||f},G=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?(console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),V(e,t)):W(e,t);var K=r(77902);function J(e,t,{batch:r={multicall:{wait:32}},pollingInterval:n=4e3,rank:i,retryCount:s,retryDelay:o,stallTimeout:a}={}){if(!e.length)throw Error("must have at least one chain");let l=[],u={},c={};for(let r of e){let e=!1;for(let n of t){let t=n(r);t&&(e=!0,l.some(({id:e})=>e===r.id)||(l=[...l,t.chain]),u[r.id]=[...u[r.id]||[],...t.rpcUrls.http],t.rpcUrls.webSocket&&(c[r.id]=[...c[r.id]||[],...t.rpcUrls.webSocket]))}if(!e)throw Error(`Could not find valid provider configuration for chain "${r.name}".
105
106You may need to add \`jsonRpcProvider\` to \`configureChains\` with the chain's RPC URLs.
107Read more: https://wagmi.sh/core/providers/jsonRpc`)}return{chains:l,publicClient:({chainId:t})=>{let c=l.find(e=>e.id===t)??e[0],h=u[c.id];if(!h||!h[0])throw Error(`No providers configured for chain "${c.id}"`);return Object.assign((0,D.v)({batch:r,chain:c,transport:U(h.map(e=>(0,j.d)(e,{timeout:a})),{rank:i,retryCount:s,retryDelay:o}),pollingInterval:n}),{chains:l})},webSocketPublicClient:({chainId:t})=>{let u=l.find(e=>e.id===t)??e[0],h=c[u.id];if(h&&h[0])return Object.assign((0,D.v)({batch:r,chain:u,transport:U(h.map(e=>(function(e,t={}){let{key:r="webSocket",name:n="WebSocket JSON-RPC",retryDelay:i}=t;return({chain:s,retryCount:o,timeout:a})=>{let l=t.retryCount??o,u=a??t.timeout??1e4,c=e||s?.rpcUrls.default.webSocket?.[0];if(!c)throw new q.I;return(0,L.q)({key:r,name:n,async request({method:e,params:t}){let r={method:e,params:t},n=await (0,H.hb)(c),{error:i,result:s}=await H.f4.webSocketAsync(n,{body:r,timeout:u});if(i)throw new F.bs({body:r,error:i,url:c});return s},retryCount:l,retryDelay:i,timeout:u,type:"webSocket"},{getSocket:()=>(0,H.hb)(c),async subscribe({params:e,onData:t,onError:r}){let n=await (0,H.hb)(c),{result:i}=await new Promise((i,s)=>H.f4.webSocket(n,{body:{method:"eth_subscribe",params:e},onResponse(e){if(e.error){s(e.error),r?.(e.error);return}if("number"==typeof e.id){i(e);return}"eth_subscription"===e.method&&t(e.params)}}));return{subscriptionId:i,unsubscribe:async()=>new Promise(e=>H.f4.webSocket(n,{body:{method:"eth_unsubscribe",params:[i]},onResponse:e}))}}})}})(e,{timeout:a})),{rank:i,retryCount:s,retryDelay:o}),pollingInterval:n}),{chains:l})}}}
107var Y=class extends Error{constructor(){super(...arguments),this.name="ConnectorAlreadyConnectedError",this.message="Connector already connected"}},Q=(e,{find:t,replace:r})=>e&&t(e)?r(e):"object"!=typeof e?e:Array.isArray(e)?e.map(e=>Q(e,{find:t,replace:r})):e instanceof Object?Object.entries(e).reduce((e,[n,i])=>({...e,[n]:Q(i,{find:t,replace:r})}),{}):e;function Z(e){return Q(JSON.parse(e),{find:e=>"string"==typeof e&&e.startsWith("#bigint."),replace:e=>BigInt(e.replace("#bigint.",""))})}function X(e,t){return e.slice(0,t).join(".")||"."}function ee(e,t){let{length:r}=e;for(let n=0;n<r;++n)if(e[n]===t)return n+1;return 0}function et(e,t,r,n){return JSON.stringify(e,function(e,t){let r="function"==typeof e,n="function"==typeof t,i=[],s=[];return function(o,a){if("object"==typeof a){if(i.length){let e=ee(i,this);0===e?i[i.length]=this:(i.splice(e),s.splice(e)),s[s.length]=o;let r=ee(i,a);if(0!==r)return n?t.call(this,o,a,X(s,r)):`[ref=${X(s,r)}]`}else i[0]=a,s[0]=o}return r?e.call(this,o,a):a}}((e,r)=>{let n="bigint"==typeof r?`#bigint.${r.toString()}`:r;return t?.(e,n)||n},n),r??void 0)}var er={getItem:e=>"",setItem:(e,t)=>null,removeItem:e=>null};function en({deserialize:e=Z,key:t="wagmi",serialize:r=et,storage:n}){return{...n,getItem:(r,i=null)=>{let s=n.getItem(`${t}.${r}`);try{return s?e(s):i}catch(e){return console.warn(e),i}},setItem:(e,i)=>{if(null===i)n.removeItem(`${t}.${e}`);else try{n.setItem(`${t}.${e}`,r(i))}catch(e){console.error(e)}},removeItem:e=>n.removeItem(`${t}.${e}`)}}var ei="store",es=class{constructor({autoConnect:e=!1,connectors:t=[new x],publicClient:r,storage:n=en({storage:"undefined"!=typeof window?window.localStorage:er}),logger:l={warn:console.warn},webSocketPublicClient:u}){let c;T(this,o),this.publicClients=new Map,this.webSocketPublicClients=new Map,T(this,i,void 0),T(this,s,void 0),this.args={autoConnect:e,connectors:t,logger:l,publicClient:r,storage:n,webSocketPublicClient:u};let h="disconnected";if(e)try{let e=n.getItem(ei),t=e?.state?.data;h=t?.account?"reconnecting":"connecting",c=t?.chain?.id}catch(e){}let d="function"==typeof t?t():t;d.forEach(e=>e.setStorage(n)),this.store=(0,K.M)(z(G(()=>({connectors:d,publicClient:this.getPublicClient({chainId:c}),status:h,webSocketPublicClient:this.getWebSocketPublicClient({chainId:c})}),{name:ei,storage:n,partialize:t=>({...e&&{data:{account:t?.data?.account,chain:t?.data?.chain}},chains:t?.chains}),version:2}))),this.storage=n,R(this,s,n?.getItem("wallet")),N(this,o,a).call(this),e&&"undefined"!=typeof window&&setTimeout(async()=>await this.autoConnect(),0)}get chains(){return this.store.getState().chains}get connectors(){return this.store.getState().connectors}get connector(){return this.store.getState().connector}get data(){return this.store.getState().data}get error(){return this.store.getState().error}get lastUsedChainId(){return this.data?.chain?.id}get publicClient(){return this.store.getState().publicClient}get status(){return this.store.getState().status}get subscribe(){return this.store.subscribe}get webSocketPublicClient(){return this.store.getState().webSocketPublicClient}setState(e){let t="function"==typeof e?e(this.store.getState()):e;this.store.setState(t,!0)}clearState(){this.setState(e=>({...e,chains:void 0,connector:void 0,data:void 0,error:void 0,status:"disconnected"}))}async destroy(){this.connector&&await this.connector.disconnect?.(),R(this,i,!1),this.clearState(),this.store.destroy()}async autoConnect(){if(O(this,i))return;R(this,i,!0),this.setState(e=>({...e,status:e.data?.account?"reconnecting":"connecting"}));let e=O(this,s)?[...this.connectors].sort(e=>e.id===O(this,s)?-1:1):this.connectors,t=!1;for(let r of e){if(!r.ready||!r.isAuthorized||!await r.isAuthorized())continue;let e=await r.connect();this.setState(t=>({...t,connector:r,chains:r?.chains,data:e,status:"connected"})),t=!0;break}return t||this.setState(e=>({...e,data:void 0,status:"disconnected"})),R(this,i,!1),this.data}setConnectors(e){this.args={...this.args,connectors:e};let t="function"==typeof e?e():e;t.forEach(e=>e.setStorage(this.args.storage)),this.setState(e=>({...e,connectors:t}))}getPublicClient({chainId:e}={}){let t=this.publicClients.get(-1);if(t&&t?.chain.id===e||(t=this.publicClients.get(e??-1)))return t;let{publicClient:r}=this.args;return t="function"==typeof r?r({chainId:e}):r,this.publicClients.set(e??-1,t),t}setPublicClient(e){let t=this.data?.chain?.id;this.args={...this.args,publicClient:e},this.publicClients.clear(),this.setState(e=>({...e,publicClient:this.getPublicClient({chainId:t})}))}getWebSocketPublicClient({chainId:e}={}){let t=this.webSocketPublicClients.get(-1);if(t&&t?.chain.id===e||(t=this.webSocketPublicClients.get(e??-1)))return t;let{webSocketPublicClient:r}=this.args;return(t="function"==typeof r?r({chainId:e}):r)&&this.webSocketPublicClients.set(e??-1,t),t}setWebSocketPublicClient(e){let t=this.data?.chain?.id;this.args={...this.args,webSocketPublicClient:e},this.webSocketPublicClients.clear(),this.setState(e=>({...e,webSocketPublicClient:this.getWebSocketPublicClient({chainId:t})}))}setLastUsedConnector(e=null){this.storage?.setItem("wallet",e)}};function eo(){if(!l)throw Error("No wagmi config found. Ensure you have set up a config: https://wagmi.sh/react/config");return l}async function ea({chainId:e,connector:t}){let r=eo(),n=r.connector;if(n&&t.id===n.id)throw new Y;try{r.setState(e=>({...e,status:"connecting"}));let n=await t.connect({chainId:e});return r.setLastUsedConnector(t.id),r.setState(e=>({...e,connector:t,chains:t?.chains,data:n,status:"connected"}
107)),r.storage.setItem("connected",!0),{...n,connector:t}}catch(e){throw r.setState(e=>({...e,status:e.connector?"connected":"disconnected"})),e}}async function el(){let e=eo();e.connector&&await e.connector.disconnect(),e.clearState(),e.storage.removeItem("connected")}function eu(){}i=new WeakMap,s=new WeakMap,o=new WeakSet,a=function(){let e=e=>{this.setState(t=>({...t,data:{...t.data,...e}}))},t=()=>{this.clearState()},r=e=>{this.setState(t=>({...t,error:e}))};this.store.subscribe(({connector:e})=>e,(n,i)=>{i?.off?.("change",e),i?.off?.("disconnect",t),i?.off?.("error",r),n&&(n.on?.("change",e),n.on?.("disconnect",t),n.on?.("error",r))});let{publicClient:n,webSocketPublicClient:i}=this.args;("function"==typeof n||"function"==typeof i)&&this.store.subscribe(({data:e})=>e?.chain?.id,e=>{this.setState(t=>({...t,publicClient:this.getPublicClient({chainId:e}),webSocketPublicClient:this.getWebSocketPublicClient({chainId:e})}))})};let ec="undefined"==typeof window||"Deno"in window;function eh(){}function ed(e,t,r){return eS(e)?"function"==typeof t?{...r,queryKey:e,queryFn:t}:{...t,queryKey:e}:e}function ef(e,t,r){return eS(e)?"function"==typeof t?{...r,mutationKey:e,mutationFn:t}:{...t,mutationKey:e}:"function"==typeof e?{...t,mutationFn:e}:{...e}}function ep(e,t,r){return eS(e)?[{...t,queryKey:e},r]:[e||{},t]}function eg(e,t){let{type:r="all",exact:n,fetchStatus:i,predicate:s,queryKey:o,stale:a}=e;if(eS(o)){if(n){if(t.queryHash!==em(o,t.options))return!1}else{if(!eb(t.queryKey,o))return!1}}if("all"!==r){let e=t.isActive();if("active"===r&&!e||"inactive"===r&&e)return!1}return("boolean"!=typeof a||t.isStale()===a)&&(void 0===i||i===t.state.fetchStatus)&&(!s||!!s(t))}function ey(e,t){let{exact:r,fetching:n,predicate:i,mutationKey:s}=e;if(eS(s)){if(!t.options.mutationKey)return!1;if(r){if(ev(t.options.mutationKey)!==ev(s))return!1}else{if(!eb(t.options.mutationKey,s))return!1}}return("boolean"!=typeof n||"loading"===t.state.status===n)&&(!i||!!i(t))}function em(e,t){return((null==t?void 0:t.queryKeyHashFn)||ev)(e)}function ev(e){return JSON.stringify(e,(e,t)=>e_(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function eb(e,t){return e===t||typeof e==typeof t&&!!e&&!!t&&"object"==typeof e&&"object"==typeof t&&!Object.keys(t).some(r=>!eb(e[r],t[r]))}function ew(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function e_(e){if(!eE(e))return!1;let t=e.constructor;if(void 0===t)return!0;let r=t.prototype;return!!(eE(r)&&r.hasOwnProperty("isPrototypeOf"))}function eE(e){return"[object Object]"===Object.prototype.toString.call(e)}function eS(e){return Array.isArray(e)}function eA(e){return new Promise(t=>{setTimeout(t,e)})}function ek(e){eA(0).then(e)}let eC=console,eI=function(){let e=[],t=0,r=e=>{e()},n=e=>{e()},i=n=>{t?e.push(n):ek(()=>{r(n)})},s=()=>{let t=e;e=[],t.length&&ek(()=>{n(()=>{t.forEach(e=>{r(e)})})})};return{batch:e=>{let r;t++;try{r=e()}finally{--t||s()}return r},batchCalls:e=>(...t)=>{i(()=>{e(...t)})},schedule:i,setNotifyFunction:e=>{r=e},setBatchNotifyFunction:e=>{n=e}}}();class ex{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){let t={listener:e};return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}class eP extends ex{constructor(){super(),this.setup=e=>{if(!ec&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),window.addEventListener("focus",t,!1),()=>{window.removeEventListener("visibilitychange",t),window.removeEventListener("focus",t)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var e;null==(e=this.cleanup)||e.call(this),this.cleanup=void 0}}setEventListener(e){var t;this.setup=e,null==(t=this.cleanup)||t.call(this),this.cleanup=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.focused!==e&&(this.focused=e,this.onFocus())}onFocus(){this.listeners.forEach(({listener:e})=>{e()})}isFocused(){return"boolean"==typeof this.focused?this.focused:"undefined"==typeof document||[void 0,"visible","prerender"].includes(document.visibilityState)}}let eO=new eP,eT=["online","offline"];class eR extends ex{constructor(){super(),this.setup=e=>{if(!ec&&window.addEventListener){let t=()=>e();
107return eT.forEach(e=>{window.addEventListener(e,t,!1)}),()=>{eT.forEach(e=>{window.removeEventListener(e,t)})}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var e;null==(e=this.cleanup)||e.call(this),this.cleanup=void 0}}setEventListener(e){var t;this.setup=e,null==(t=this.cleanup)||t.call(this),this.cleanup=e(e=>{"boolean"==typeof e?this.setOnline(e):this.onOnline()})}setOnline(e){this.online!==e&&(this.online=e,this.onOnline())}onOnline(){this.listeners.forEach(({listener:e})=>{e()})}isOnline(){return"boolean"==typeof this.online?this.online:"undefined"==typeof navigator||void 0===navigator.onLine||navigator.onLine}}let eN=new eR;function eD(e){return Math.min(1e3*2**e,3e4)}function eB(e){return(null!=e?e:"online")!=="online"||eN.isOnline()}class eM{constructor(e){this.revert=null==e?void 0:e.revert,this.silent=null==e?void 0:e.silent}}function eL(e){return e instanceof eM}function eU(e){let t,r,n,i=!1,s=0,o=!1,a=new Promise((e,t)=>{r=e,n=t}),l=()=>!eO.isFocused()||"always"!==e.networkMode&&!eN.isOnline(),u=n=>{o||(o=!0,null==e.onSuccess||e.onSuccess(n),null==t||t(),r(n))},c=r=>{o||(o=!0,null==e.onError||e.onError(r),null==t||t(),n(r))},h=()=>new Promise(r=>{t=e=>{let t=o||!l();return t&&r(e),t},null==e.onPause||e.onPause()}).then(()=>{t=void 0,o||null==e.onContinue||e.onContinue()}),d=()=>{let t;if(!o){try{t=e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(u).catch(t=>{var r,n;if(o)return;let a=null!=(r=e.retry)?r:3,u=null!=(n=e.retryDelay)?n:eD,f="function"==typeof u?u(s,t):u,p=!0===a||"number"==typeof a&&s<a||"function"==typeof a&&a(s,t);if(i||!p){c(t);return}s++,null==e.onFail||e.onFail(s,t),eA(f).then(()=>{if(l())return h()}).then(()=>{i?c(t):d()})})}};return eB(e.networkMode)?d():h().then(d),{promise:a,cancel:t=>{o||(c(new eM(t)),null==e.abort||e.abort())},continue:()=>(null==t?void 0:t())?a:Promise.resolve(),cancelRetry:()=>{i=!0},continueRetry:()=>{i=!1}}}class ej{destroy(){this.clearGcTimeout()}scheduleGc(){var e;this.clearGcTimeout(),"number"==typeof(e=this.cacheTime)&&e>=0&&e!==1/0&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(e){this.cacheTime=Math.max(this.cacheTime||0,null!=e?e:ec?1/0:3e5)}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class eF extends ej{constructor(e){super(),this.abortSignalConsumed=!1,this.defaultOptions=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.cache=e.cache,this.logger=e.logger||eC,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.initialState=e.state||function(e){let t="function"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==t,n=r?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?null!=n?n:Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"loading",fetchStatus:"idle"}}(this.options),this.state=this.initialState,this.scheduleGc()}get meta(){return this.options.meta}setOptions(e){this.options={...this.defaultOptions,...e},this.updateCacheTime(this.options.cacheTime)}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.cache.remove(this)}setData(e,t){var r,n;let i=(r=this.state.data,null!=(n=this.options).isDataEqual&&n.isDataEqual(r,e)?r:"function"==typeof n.structuralSharing?n.structuralSharing(r,e):!1!==n.structuralSharing?function e(t,r){if(t===r)return t;let n=ew(t)&&ew(r);if(n||e_(t)&&e_(r)){let i=n?t.length:Object.keys(t).length,s=n?r:Object.keys(r),o=s.length,a=n?[]:{},l=0;for(let i=0;i<o;i++){let o=n?i:s[i];a[o]=e(t[o],r[o]),a[o]===t[o]&&l++}return i===o&&l===i?t:a}return r}(r,e):e);return this.dispatch({data:i,type:"success",dataUpdatedAt:null==t?void 0:t.updatedAt,manual:null==t?void 0:t.manual}),i}setState(e,t){this.dispatch({type:"setState",state:e,setStateOptions:t})}cancel(e){var t;let r=this.promise;return null==(t=this.retryer)||t.cancel(e),r?r.then(eh).catch(eh):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.initialState)}isActive(){return this.observers.some(e=>!1!==e.options.enabled)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.observers.some(e=>e.getCurrentResult().isStale)}isStaleByTime(e=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!Math.max(this.state.dataUpdatedAt+(e||0)-Date.now(),0)}onFocus(){var e;let t=this.observers.find(e=>e.shouldFetchOnWindowFocus());t&&t.refetch({cancelRefetch:!1}),null==(e=this.retryer)||e.continue()}onOnline(){var e;let t=this.observers.find(e=>e.shouldFetchOnReconnect());t&&t.refetch({cancelRefetch:!1}),null==(e=this.retryer)||e.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>
107t!==e),this.observers.length||(this.retryer&&(this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.scheduleGc()),this.cache.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.dispatch({type:"invalidate"})}fetch(e,t){var r,n,i,s;if("idle"!==this.state.fetchStatus){if(this.state.dataUpdatedAt&&null!=t&&t.cancelRefetch)this.cancel({silent:!0});else if(this.promise)return null==(i=this.retryer)||i.continueRetry(),this.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let o=function(){if("function"==typeof AbortController)return new AbortController}(),a={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},l=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>{if(o)return this.abortSignalConsumed=!0,o.signal}})};l(a);let u={fetchOptions:t,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(a)):Promise.reject("Missing queryFn for queryKey '"+this.options.queryHash+"'")};l(u),null==(r=this.options.behavior)||r.onFetch(u),this.revertState=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==(null==(n=u.fetchOptions)?void 0:n.meta))&&this.dispatch({type:"fetch",meta:null==(s=u.fetchOptions)?void 0:s.meta});let c=e=>{if(eL(e)&&e.silent||this.dispatch({type:"error",error:e}),!eL(e)){var t,r,n,i;null==(t=(r=this.cache.config).onError)||t.call(r,e,this),null==(n=(i=this.cache.config).onSettled)||n.call(i,this.state.data,e,this)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=eU({fn:u.fetchFn,abort:null==o?void 0:o.abort.bind(o),onSuccess:e=>{var t,r,n,i;if(void 0===e){c(Error(this.queryHash+" data is undefined"));return}this.setData(e),null==(t=(r=this.cache.config).onSuccess)||t.call(r,e,this),null==(n=(i=this.cache.config).onSettled)||n.call(i,e,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:c,onFail:(e,t)=>{this.dispatch({type:"failed",failureCount:e,error:t})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(e){this.state=(t=>{var r,n;switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null!=(r=e.meta)?r:null,fetchStatus:eB(this.options.networkMode)?"fetching":"paused",...!t.dataUpdatedAt&&{error:null,status:"loading"}};case"success":return{...t,data:e.data,dataUpdateCount:t.dataUpdateCount+1,dataUpdatedAt:null!=(n=e.dataUpdatedAt)?n:Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":let i=e.error;if(eL(i)&&i.revert&&this.revertState)return{...this.revertState,fetchStatus:"idle"};return{...t,error:i,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),eI.batch(()=>{this.observers.forEach(t=>{t.onQueryUpdate(e)}),this.cache.notify({query:this,type:"updated",action:e})})}}class eq extends ex{constructor(e){super(),this.config=e||{},this.queries=[],this.queriesMap={}}build(e,t,r){var n;let i=t.queryKey,s=null!=(n=t.queryHash)?n:em(i,t),o=this.get(s);return o||(o=new eF({cache:this,logger:e.getLogger(),queryKey:i,queryHash:s,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(o)),o}add(e){this.queriesMap[e.queryHash]||(this.queriesMap[e.queryHash]=e,this.queries.push(e),this.notify({type:"added",query:e}))}remove(e){let t=this.queriesMap[e.queryHash];t&&(e.destroy(),this.queries=this.queries.filter(t=>t!==e),t===e&&delete this.queriesMap[e.queryHash],this.notify({type:"removed",query:e}))}clear(){eI.batch(()=>
107{this.queries.forEach(e=>{this.remove(e)})})}get(e){return this.queriesMap[e]}getAll(){return this.queries}find(e,t){let[r]=ep(e,t);return void 0===r.exact&&(r.exact=!0),this.queries.find(e=>eg(r,e))}findAll(e,t){let[r]=ep(e,t);return Object.keys(r).length>0?this.queries.filter(e=>eg(r,e)):this.queries}notify(e){eI.batch(()=>{this.listeners.forEach(({listener:t})=>{t(e)})})}onFocus(){eI.batch(()=>{this.queries.forEach(e=>{e.onFocus()})})}onOnline(){eI.batch(()=>{this.queries.forEach(e=>{e.onOnline()})})}}class eH extends ej{constructor(e){super(),this.defaultOptions=e.defaultOptions,this.mutationId=e.mutationId,this.mutationCache=e.mutationCache,this.logger=e.logger||eC,this.observers=[],this.state=e.state||ez(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options={...this.defaultOptions,...e},this.updateCacheTime(this.options.cacheTime)}get meta(){return this.options.meta}setState(e){this.dispatch({type:"setState",state:e})}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.mutationCache.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.observers=this.observers.filter(t=>t!==e),this.scheduleGc(),this.mutationCache.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.observers.length||("loading"===this.state.status?this.scheduleGc():this.mutationCache.remove(this))}continue(){var e,t;return null!=(e=null==(t=this.retryer)?void 0:t.continue())?e:this.execute()}async execute(){var e,t,r,n,i,s,o,a,l,u,c,h,d,f,p,g,y,m,v,b;let w="loading"===this.state.status;try{if(!w){this.dispatch({type:"loading",variables:this.options.variables}),await (null==(l=(u=this.mutationCache.config).onMutate)?void 0:l.call(u,this.state.variables,this));let e=await (null==(c=(h=this.options).onMutate)?void 0:c.call(h,this.state.variables));e!==this.state.context&&this.dispatch({type:"loading",context:e,variables:this.state.variables})}let d=await (()=>{var e;return this.retryer=eU({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:(e,t)=>{this.dispatch({type:"failed",failureCount:e,error:t})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:null!=(e=this.options.retry)?e:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise})();return await (null==(e=(t=this.mutationCache.config).onSuccess)?void 0:e.call(t,d,this.state.variables,this.state.context,this)),await (null==(r=(n=this.options).onSuccess)?void 0:r.call(n,d,this.state.variables,this.state.context)),await (null==(i=(s=this.mutationCache.config).onSettled)?void 0:i.call(s,d,null,this.state.variables,this.state.context,this)),await (null==(o=(a=this.options).onSettled)?void 0:o.call(a,d,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:d}),d}catch(e){try{throw await (null==(d=(f=this.mutationCache.config).onError)?void 0:d.call(f,e,this.state.variables,this.state.context,this)),await (null==(p=(g=this.options).onError)?void 0:p.call(g,e,this.state.variables,this.state.context)),await (null==(y=(m=this.mutationCache.config).onSettled)?void 0:y.call(m,void 0,e,this.state.variables,this.state.context,this)),await (null==(v=(b=this.options).onSettled)?void 0:v.call(b,void 0,e,this.state.variables,this.state.context)),e}finally{this.dispatch({type:"error",error:e})}}}dispatch(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"loading":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!eB(this.options.networkMode),status:"loading",variables:e.variables};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"};case"setState":return{...t,...e.state}}})(this.state),eI.batch(()=>
107{this.observers.forEach(t=>{t.onMutationUpdate(e)}),this.mutationCache.notify({mutation:this,type:"updated",action:e})})}}function ez(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}class e$ extends ex{constructor(e){super(),this.config=e||{},this.mutations=[],this.mutationId=0}build(e,t,r){let n=new eH({mutationCache:this,logger:e.getLogger(),mutationId:++this.mutationId,options:e.defaultMutationOptions(t),state:r,defaultOptions:t.mutationKey?e.getMutationDefaults(t.mutationKey):void 0});return this.add(n),n}add(e){this.mutations.push(e),this.notify({type:"added",mutation:e})}remove(e){this.mutations=this.mutations.filter(t=>t!==e),this.notify({type:"removed",mutation:e})}clear(){eI.batch(()=>{this.mutations.forEach(e=>{this.remove(e)})})}getAll(){return this.mutations}find(e){return void 0===e.exact&&(e.exact=!0),this.mutations.find(t=>ey(e,t))}findAll(e){return this.mutations.filter(t=>ey(e,t))}notify(e){eI.batch(()=>{this.listeners.forEach(({listener:t})=>{t(e)})})}resumePausedMutations(){var e;return this.resuming=(null!=(e=this.resuming)?e:Promise.resolve()).then(()=>{let e=this.mutations.filter(e=>
107e.state.isPaused);return eI.batch(()=>e.reduce((e,t)=>e.then(()=>t.continue().catch(eh)),Promise.resolve()))}).then(()=>{this.resuming=void 0}),this.resuming}}function eV(e,t){return null==e.getNextPageParam?void 0:e.getNextPageParam(t[t.length-1],t)}class eW{constructor(e={}){this.queryCache=e.queryCache||new eq,this.mutationCache=e.mutationCache||new e$,this.logger=e.logger||eC,this.defaultOptions=e.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[],this.mountCount=0}mount(){this.mountCount++,1===this.mountCount&&(this.unsubscribeFocus=eO.subscribe(()=>{eO.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=eN.subscribe(()=>{eN.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())}))}unmount(){var e,t;this.mountCount--,0===this.mountCount&&(null==(e=this.unsubscribeFocus)||e.call(this),this.unsubscribeFocus=void 0,null==(t=this.unsubscribeOnline)||t.call(this),this.unsubscribeOnline=void 0)}isFetching(e,t){let[r]=ep(e,t);return r.fetchStatus="fetching",this.queryCache.findAll(r).length}isMutating(e){return this.mutationCache.findAll({...e,fetching:!0}).length}getQueryData(e,t){var r;return null==(r=this.queryCache.find(e,t))?void 0:r.state.data}ensureQueryData(e,t,r){let n=ed(e,t,r),i=this.getQueryData(n.queryKey);return i?Promise.resolve(i):this.fetchQuery(n)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,r){let n=this.queryCache.find(e),i=null==n?void 0:n.state.data,s="function"==typeof t?t(i):t;if(void 0===s)return;let o=ed(e),a=this.defaultQueryOptions(o);return this.queryCache.build(this,a).setData(s,{...r,manual:!0})}setQueriesData(e,t,r){return eI.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,r)]))}getQueryState(e,t){var r;return null==(r=this.queryCache.find(e,t))?void 0:r.state}removeQueries(e,t){let[r]=ep(e,t),n=this.queryCache;eI.batch(()=>{n.findAll(r).forEach(e=>{n.remove(e)})})}resetQueries(e,t,r){let[n,i]=ep(e,t,r),s=this.queryCache,o={type:"active",...n};return eI.batch(()=>(s.findAll(n).forEach(e=>{e.reset()}),this.refetchQueries(o,i)))}cancelQueries(e,t,r){let[n,i={}]=ep(e,t,r);return void 0===i.revert&&(i.revert=!0),Promise.all(eI.batch(()=>this.queryCache.findAll(n).map(e=>e.cancel(i)))).then(eh).catch(eh)}invalidateQueries(e,t,r){let[n,i]=ep(e,t,r);return eI.batch(()=>{var e,t;if(this.queryCache.findAll(n).forEach(e=>{e.invalidate()}),"none"===n.refetchType)return Promise.resolve();let r={...n,type:null!=(e=null!=(t=n.refetchType)?t:n.type)?e:"active"};return this.refetchQueries(r,i)})}refetchQueries(e,t,r){let[n,i]=ep(e,t,r),s=Promise.all(eI.batch(()=>this.queryCache.findAll(n).filter(e=>!e.isDisabled()).map(e=>{var t;return e.fetch(void 0,{...i,cancelRefetch:null==(t=null==i?void 0:i.cancelRefetch)||t,meta:{refetchPage:n.refetchPage}})}))).then(eh);return null!=i&&i.throwOnError||(s=s.catch(eh)),s}fetchQuery(e,t,r){let n=ed(e,t,r),i=this.defaultQueryOptions(n);void 0===i.retry&&(i.retry=!1);let s=this.queryCache.build(this,i);return s.isStaleByTime(i.staleTime)?s.fetch(i):Promise.resolve(s.state.data)}prefetchQuery(e,t,r){return this.fetchQuery(e,t,r).then(eh).catch(eh)}fetchInfiniteQuery(e,t,r){let n=ed(e,t,r);return n.behavior={onFetch:e=>{e.fetchFn=()=>{var t,r,n,i,s,o,a;let l;let u=null==(t=e.fetchOptions)?void 0:null==(r=t.meta)?void 0:r.refetchPage,c=null==(n=e.fetchOptions)?void 0:null==(i=n.meta)?void 0:i.fetchMore,h=null==c?void 0:c.pageParam,d=(null==c?void 0:c.direction)==="forward",f=(null==c?void 0:c.direction)==="backward",p=(null==(s=e.state.data)?void 0:s.pages)||[],g=(null==(o=e.state.data)?void 0:o.pageParams)||[],y=g,m=!1,v=t=>{Object.defineProperty(t,"signal",{enumerable:!0,get:()=>{var t,r;return null!=(t=e.signal)&&t.aborted?m=!0:null==(r=e.signal)||r.addEventListener("abort",()=>{m=!0}),e.signal}})},b=e.options.queryFn||(()=>Promise.reject("Missing queryFn for queryKey '"+e.options.queryHash+"'")),w=(e,t,r,n)=>(y=n?[t,...y]:[...y,t],n?[r,...e]:[...e,r]),_=(t,r,n,i)=>{if(m)return Promise.reject("Cancelled");if(void 0===n&&!r&&t.length)return Promise.resolve(t);let s={queryKey:e.queryKey,pageParam:n,meta:e.options.meta};return v(s),Promise.resolve(b(s)).then(e=>w(t,n,e,i))};if(p.length){if(d){let t=void 0!==h,r=t?h:eV(e.options,p);l=_(p,t,r)}else if(f){let t=void 0!==h,r=t?h:null==(a=e.options).getPreviousPageParam?void 0:a.getPreviousPageParam(p[0],p);l=_(p,t,r,!0)}else{y=[];let t=void 0===e.options.getNextPageParam;l=!u||!p[0]||u(p[0],0,p)?_([],t,g[0]):Promise.resolve(w([],g[0],p[0]));for(let r=1;r<p.length;r++)l=l.then(n=>{if(!u||!p[r]||u(p[r],r,p)){let i=t?g[r]:eV(e.options,n);return _(n,t,i)}return Promise.resolve(w(n,g[r],p[r]))})}}else l=_([]);return l.then(e=>({pages:e,pageParams:y}))}}},this.fetchQuery(n)}prefetchInfiniteQuery(e,t,r){return this.fetchInfiniteQuery(e,t,r).then(eh).catch(eh)}resumePausedMutations(){return this.mutationCache.resumePausedMutations()}getQueryCache(){return this.queryCache}getMutationCache(){return this.mutationCache}getLogger(){return this.logger}getDefaultOptions(){return this.defaultOptions}setDefaultOptions(e){this.defaultOptions=e}setQueryDefaults(e,t){let r=this.queryDefaults.find(t=>ev(e)===ev(t.queryKey));r?r.defaultOptions=t:this.queryDefaults.push({queryKey:e,defaultOptions:t})}getQueryDefaults(e){if(!e)return;let t=this.queryDefaults.find(t=>eb(e,t.queryKey));return null==t?void 0:t.defaultOptions}setMutationDefaults(e,t){let r=this.mutationDefaults.find(t=>ev(e)===ev(t.mutationKey));r?r.defaultOptions=t:this.mutationDefaults.push({mutationKey:e,defaultOptions:t})}getMutationDefaults(e){if(!e)return;let t=this.mutationDefaults.find(t=>eb(e,t.mutationKey));return null==t?void 0:t.defaultOptions}defaultQueryOptions(e){if(null!=e&&e._defaulted)return e;let t={...this.defaultOptions.queries,...this.getQueryDefaults(null==e?void 0:e.queryKey),...e,_defaulted:!0};return!t.queryHash&&t.queryKey&&(t.queryHash=em(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.useErrorBoundary&&(t.useErrorBoundary=!!t.suspense),t}defaultMutationOptions(e){return null!=e&&e._defaulted?e:{...this.defaultOptions.mutations,...this.getMutationDefaults(null==e?void 0:e.mutationKey),...e,_defaulted:!0}}clear(){this.queryCache.clear(),this.mutationCache.clear()}}
107function eG(e){return e.state.isPaused}function eK(e){return"success"===e.state.status}let eJ=["added","removed","updated"];function eY(e){return eJ.includes(e)}async function eQ({queryClient:e,persister:t,maxAge:r=864e5,buster:n="",hydrateOptions:i}){try{let s=await t.restoreClient();if(s){if(s.timestamp){let o=Date.now()-s.timestamp>r,a=s.buster!==n;o||a?t.removeClient():function(e,t,r){if("object"!=typeof t||null===t)return;let n=e.getMutationCache(),i=e.getQueryCache(),s=t.mutations||[],o=t.queries||[];s.forEach(t=>{var i;n.build(e,{...null==r?void 0:null==(i=r.defaultOptions)?void 0:i.mutations,mutationKey:t.mutationKey},t.state)}),o.forEach(({queryKey:t,state:n,queryHash:s})=>{var o;let a=i.get(s);if(a){if(a.state.dataUpdatedAt<n.dataUpdatedAt){let{fetchStatus:e,...t}=n;a.setState(t)}return}i.build(e,{...null==r?void 0:null==(o=r.defaultOptions)?void 0:o.queries,queryKey:t,queryHash:s},{...n,fetchStatus:"idle"})})}(e,s.clientState,i)}else t.removeClient()}}catch(e){t.removeClient()}}async function eZ({queryClient:e,persister:t,buster:r="",dehydrateOptions:n}){let i={buster:r,timestamp:Date.now(),clientState:function(e,t={}){let r=[],n=[];if(!1!==t.dehydrateMutations){let n=t.shouldDehydrateMutation||eG;e.getMutationCache().getAll().forEach(e=>{n(e)&&r.push({mutationKey:e.options.mutationKey,state:e.state})})}if(!1!==t.dehydrateQueries){let r=t.shouldDehydrateQuery||eK;e.getQueryCache().getAll().forEach(e=>{r(e)&&n.push({state:e.state,queryKey:e.queryKey,queryHash:e.queryHash})})}return{mutations:r,queries:n}}(e,n)};await t.persistClient(i)}let eX=h.createContext(void 0),e0=h.createContext(!1);function e1(e,t){return e||(t&&"undefined"!=typeof window?(window.ReactQueryClientContext||(window.ReactQueryClientContext=eX),window.ReactQueryClientContext):eX)}let e2=function(){let{context:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=h.useContext(e1(e,h.useContext(e0)));if(!t)throw Error("No QueryClient set, use QueryClientProvider to set one");return t},e3=e=>{let{client:t,children:r,context:n,contextSharing:i=!1}=e;h.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]);let s=e1(n,i);return h.createElement(e0.Provider,{value:!n&&i},h.createElement(s.Provider,{value:t},r))};var e5=r(10554);class e6 extends ex{constructor(e,t){super(),this.client=e,this.setOptions(t),this.bindMethods(),this.updateResult()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){var t;let r=this.options;this.options=this.client.defaultMutationOptions(e),!function(e,t){if(e&&!t||t&&!e)return!1;for(let r in e)if(e[r]!==t[r])return!1;return!0}(r,this.options)&&this.client.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.currentMutation,observer:this}),null==(t=this.currentMutation)||t.setOptions(this.options)}onUnsubscribe(){if(!this.hasListeners()){var e;null==(e=this.currentMutation)||e.removeObserver(this)}}onMutationUpdate(e){this.updateResult();let t={listeners:!0};"success"===e.type?t.onSuccess=!0:"error"===e.type&&(t.onError=!0),this.notify(t)}getCurrentResult(){return this.currentResult}reset(){this.currentMutation=void 0,this.updateResult(),this.notify({listeners:!0})}mutate(e,t){return this.mutateOptions=t,this.currentMutation&&this.currentMutation.removeObserver(this),this.currentMutation=this.client.getMutationCache().build(this.client,{...this.options,variables:void 0!==e?e:this.options.variables}),this.currentMutation.addObserver(this),this.currentMutation.execute()}updateResult(){let e=this.currentMutation?this.currentMutation.state:ez(),t={...e,isLoading:"loading"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset};this.currentResult=t}notify(e){eI.batch(()=>{if(this.mutateOptions&&this.hasListeners()){var t,r,n,i,s,o,a,l;e.onSuccess?(null==(t=(r=this.mutateOptions).onSuccess)||t.call(r,this.currentResult.data,this.currentResult.variables,this.currentResult.context),null==(n=(i=this.mutateOptions).onSettled)||n.call(i,this.currentResult.data,null,this.currentResult.variables,this.currentResult.context)):e.onError&&(null==(s=(o=this.mutateOptions).onError)||s.call(o,this.currentResult.error,this.currentResult.variables,this.currentResult.context),null==(a=(l=this.mutateOptions).onSettled)||a.call(l,void 0,this.currentResult.error,this.currentResult.variables,this.currentResult.context))}
107e.listeners&&this.listeners.forEach(({listener:e})=>{e(this.currentResult)})})}}let e4=e5.useSyncExternalStore;function e8(){}r(35006);var e7=h.createContext(void 0),e9=h.createContext(void 0);function te(e){let{children:t,config:r}=e;return h.createElement(e7.Provider,{children:h.createElement(e3,{children:t,client:r.queryClient,context:e9}),value:r})}function tt(){let e=h.useContext(e7);if(!e)throw Error("`useConfig` must be used within `WagmiConfig`.\n\nRead more: https://wagmi.sh/react/WagmiConfig");return e}function tr(e,t,r){return function(e,t,r){var n,i;let s=ef(e,void 0,void 0),o=e2({context:s.context}),[a]=h.useState(()=>new e6(o,s));h.useEffect(()=>{a.setOptions(s)},[a,s]);let l=e4(h.useCallback(e=>a.subscribe(eI.batchCalls(e)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),u=h.useCallback((e,t)=>{a.mutate(e,t).catch(e8)},[a]);if(l.error&&(n=a.options.useErrorBoundary,i=[l.error],"function"==typeof n?n(...i):!!n))throw l.error;return{...l,mutate:u,mutateAsync:l.mutate}}({context:e9,...ef(e,t,r)})}e5.useSyncExternalStore;var tn=e=>[{entity:"connect",...e}],ti=e=>{let{connector:t,chainId:r}=e;if(!t)throw Error("connector is required");return ea({connector:t,chainId:r})},ts=[{entity:"disconnect"}],to=()=>el();function ta(){return function(e){return e.rpcUrls.public.http[0]?{chain:e,rpcUrls:e.rpcUrls.public}:null}}var tl=r(76305);function tu(e,t,r,n){return new(r||(r=Promise))(function(i,s){function o(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;class tc extends E{constructor({chains:e,handleLogOut:t,walletConnector:r,preventWagmiSyncFromCallingLogout:n}){super({chains:e,options:void 0}),this.id="dynamic",this.name="Dynamic",this.ready=!1,this.onAccountsChanged=e=>tu(this,void 0,void 0,function*(){this.emit("change",{account:(0,S.K)(e[0])})}),this.onChainChanged=e=>tu(this,void 0,void 0,function*(){this.emit("change",{chain:{id:Number(e),unsupported:!1}})}),this.onDisconnect=()=>tu(this,void 0,void 0,function*(){}),this.handleLogOut=t,this.walletConnector=r,this.id=`dynamic-${r.key}`,this.preventWagmiSyncFromCallingLogout=n}_onAccountsChanged({accounts:e}){this.onAccountsChanged(e)}_onChainChanged({chain:e}){this.onChainChanged(e)}_onDisconnect(){this.onDisconnect()}setupEventListeners(){this.walletConnector.on("accountChange",this._onAccountsChanged,this),this.walletConnector.on("chainChange",this._onChainChanged,this),this.walletConnector.on("disconnect",this._onDisconnect,this)}connect(e){return tu(this,void 0,void 0,function*(){if(!this.walletConnector)throw Error("WalletConnector is not defined");let e=yield this.getAccount();return this.setupEventListeners(),this.emit("message",{type:"connecting"}),{account:e,chain:{id:yield this.getChainId(),unsupported:!1}}})}disconnect(){return tu(this,void 0,void 0,function*(){this.walletConnector.removeListener("accountChange",this._onAccountsChanged,this),this.walletConnector.removeListener("chainChange",this._onChainChanged,this),this.walletConnector.removeListener("disconnect",this._onDisconnect,this),this.preventWagmiSyncFromCallingLogout.current||(yield this.walletConnector.endSession(),yield this.handleLogOut()),this.preventWagmiSyncFromCallingLogout.current=!1})}getAccount(){return tu(this,void 0,void 0,function*(){var e;let t=yield null===(e=this.walletConnector)||void 0===e?void 0:e.fetchPublicAddress();if(!t)throw Error("Not connected");return(0,S.K)(t)})}getChainId(){return tu(this,void 0,void 0,function*(){if(!this.walletConnector)throw Error("WalletConnector is not defined");let e=yield this.walletConnector.getNetwork();if(!e)throw Error("Network is not defined");return Number(e)})}getProvider(e){return tu(this,void 0,void 0,function*(){var e;return null===(e=this.walletConnector)||void 0===e?void 0:e.getWalletClient()})}getWalletClient(e){return tu(this,void 0,void 0,function*(){var t;let r=yield this.walletConnector.getSigner();return r.account&&r.chain?r:(0,k.K)({account:yield this.getAccount(),chain:null!==(t=this.chains.find(t=>
107t.id===(null==e?void 0:e.chainId)))&&void 0!==t?t:this.chains[0],transport:(0,C.P)(r)})})}isAuthorized(){return tu(this,void 0,void 0,function*(){var e,t;return(null!==(t=yield null===(e=this.walletConnector)||void 0===e?void 0:e.getConnectedAccounts())&&void 0!==t?t:[]).length>0})}switchChain(e){return tu(this,void 0,void 0,function*(){var t,r;yield null===(t=this.walletConnector)||void 0===t?void 0:t.switchNetwork({networkChainId:e});let n=(0,I.NC)(e);return null!==(r=this.chains.find(t=>t.id===e))&&void 0!==r?r:{id:e,name:`Chain ${n}`,nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},network:`${n}`,rpcUrls:{default:{http:[""]},public:{http:[""]}}}})}watchAsset(e){throw Error("Method not implemented.")}}let th=(e,t)=>{for(let r of e)if(r.connected&&"EVM"===r.connector.connectedChain)return t(r)};var td=r(77350);let tf=e=>"string"==typeof e?e:e.http,tp=e=>{var t;let r=(null!==(t=e.privateCustomerRpcUrls)&&void 0!==t?t:[]).map(tf);return r.length?r:e.rpcUrls},tg=(e,t,r)=>{let n=null==t?void 0:t.find(e=>"string"==typeof e?e.includes(r):"string"==typeof e.http&&e.http.includes(r));"string"==typeof n?e[r]={http:[n]}:"string"==typeof(null==n?void 0:n.http)&&(e[r]={http:[n.http]})},ty=e=>tv(Object.values(u).find(t=>t.id===e.chainId),e),tm=e=>{let t=tp(e),r={default:{http:t},public:{http:t}};return["alchemy","infura"].forEach(t=>tg(r,e.privateCustomerRpcUrls,t)),r},tv=(e,t)=>{var r,n,i,s,o,a,l,u,c,h;return Object.assign(Object.assign({},e),{blockExplorers:Object.assign(Object.assign({},null==e?void 0:e.blockExplorers),{default:Object.assign(Object.assign({},null===(r=null==e?void 0:e.blockExplorers)||void 0===r?void 0:r.default),{name:"",url:null!==(i=null===(n=t.blockExplorerUrls)||void 0===n?void 0:n[0])&&void 0!==i?i:""})}),contracts:null!==(s=t.contracts)&&void 0!==s?s:null==e?void 0:e.contracts,id:null!==(o=null==e?void 0:e.id)&&void 0!==o?o:t.chainId,name:null!==(l=null!==(a=t.vanityName)&&void 0!==a?a:t.name)&&void 0!==l?l:null==e?void 0:e.name,nativeCurrency:null!==(u=t.nativeCurrency)&&void 0!==u?u:null==e?void 0:e.nativeCurrency,network:null!==(h=null!==(c=null==e?void 0:e.network)&&void 0!==c?c:t.chainName)&&void 0!==h?h:"",rpcUrls:tm(t)})},tb=e=>{let t=e.map(ty);return t.length>0?t:[y.R]},tw=(e,t)=>{let r,n;return"string"!=typeof t?(r=t.http,n=t.webSocket):r=t,t=>t.id!==e.chainId?null:(function({rpc:e}){return function(t){let r=e(t);return r&&""!==r.http?{chain:{...t,rpcUrls:{...t.rpcUrls,default:{http:[r.http]}}},rpcUrls:{http:[r.http],webSocket:r.webSocket?[r.webSocket]:void 0}}:null}})({rpc:()=>({http:r,webSocket:n})})(t)},t_=e=>{let t=[];return e.forEach(e=>{var r;(null!==(r=e.privateCustomerRpcUrls)&&void 0!==r?r:[]).forEach(r=>{t.push(tw(e,r))})}),[...t,ta()]},tE=({children:e,connector:t,wallets:r,preventWagmiSyncFromCallingLogout:n})=>{let{status:i}=tt(),{connect:s}=function(){let{chainId:e,connector:t,onError:r,onMutate:n,onSettled:i,onSuccess:s}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=tt(),{data:a,error:l,isError:u,isIdle:c,isLoading:d,isSuccess:f,mutate:p,mutateAsync:g,reset:y,status:m,variables:v}=tr(tn({connector:t,chainId:e}),ti,{onError:r,onMutate:n,onSettled:i,onSuccess:s});return{connect:h.useCallback(r=>{var n,i;return p({chainId:null!==(n=null==r?void 0:r.chainId)&&void 0!==n?n:e,connector:null!==(i=null==r?void 0:r.connector)&&void 0!==i?i:t})},[e,t,p]),connectAsync:h.useCallback(r=>{var n,i;return g({chainId:null!==(n=null==r?void 0:r.chainId)&&void 0!==n?n:e,connector:null!==(i=null==r?void 0:r.connector)&&void 0!==i?i:t})},[e,t,g]),connectors:o.connectors,data:a,error:l,isError:u,isIdle:c,isLoading:d,isSuccess:f,pendingConnector:null==v?void 0:v.connector,reset:y,status:m,variables:v}}(),{disconnect:o}=function(){let{onError:e,onMutate:t,onSettled:r,onSuccess:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{error:i,isError:s,isIdle:o,isLoading:a,isSuccess:l,mutate:u,mutateAsync:c,reset:h,status:d}
107=tr(ts,to,{...e?{onError(t,r,n){e(t,n)}}:{},onMutate:t,...r?{onSettled(e,t,n,i){r(t,i)}}:{},...n?{onSuccess(e,t,r){n(r)}}:{}});return{disconnect:u,disconnectAsync:c,error:i,isError:s,isIdle:o,isLoading:a,isSuccess:l,reset:h,status:d}}(),{walletConnector:a}=(0,tl.SXd)(),l=(0,h.useRef)(void 0);return((0,h.useEffect)(()=>{let e=!!l.current;if(!r.length){e&&(n.current=!0,o(),l.current=void 0);return}a&&t&&(null==t?void 0:t.id)!==l.current&&(l.current=t.id,s({connector:t}))},[i,s,t,o,l,n,a,r]),h.version.startsWith("18"))?(0,c.jsx)(c.Fragment,{children:e}):h.createElement(h.Fragment,null,e)},tS=e=>"EVM"===e.connector.connectedChain,tA=(e,t)=>{if((null==e?void 0:e.connector.connectedChain)==="EVM"){let r=t.filter(tS).filter(t=>t.address!==e.address);return[e,...r]}return t.filter(tS)},{publicClient:tk}=J([y.R],[ta()]),tC=function(e){let{queryClient:t=new eW({defaultOptions:{queries:{cacheTime:864e5,networkMode:"offlineFirst",refetchOnWindowFocus:!1,retry:0},mutations:{networkMode:"offlineFirst"}}}),storage:r=en({storage:"undefined"!=typeof window&&window.localStorage?window.localStorage:er}),persister:n="undefined"!=typeof window?function({storage:e,key:t="REACT_QUERY_OFFLINE_CACHE",throttleTime:r=1e3,serialize:n=JSON.stringify,deserialize:i=JSON.parse,retry:s}){if(e){let o=r=>{try{e.setItem(t,n(r));return}catch(e){return e}};return{persistClient:function(e,t=100){let r,n=null;return function(...i){r=i,null===n&&(n=setTimeout(()=>{e(...r),n=null},t))}}(e=>{let t=e,r=o(t),n=0;for(;r&&t;)n++,(t=null==s?void 0:s({persistedClient:t,error:r,errorCount:n}))&&(r=o(t))},r),restoreClient:()=>{let r=e.getItem(t);if(r)return i(r)},removeClient:()=>{e.removeItem(t)}}}return{persistClient:eu,restoreClient:()=>void 0,removeClient:eu}}({key:"cache",storage:r,serialize:e=>e,deserialize:e=>e}):void 0,...i}=e,s=function(e){let t=new es(e);return l=t,t}({...i,storage:r});if(n){var o;let e,r;r=!1,eQ(o={queryClient:t,persister:n,dehydrateOptions:{shouldDehydrateQuery:e=>0!==e.cacheTime&&!1!==e.queryKey[0].persist}}).then(()=>{r||(e=function(e){let t=e.queryClient.getQueryCache().subscribe(t=>{eY(t.type)&&eZ(e)}),r=e.queryClient.getMutationCache().subscribe(t=>{eY(t.type)&&eZ(e)});return()=>{t(),r()}}(o))})}return Object.assign(s,{queryClient:t})}({autoConnect:!0,publicClient:tk}),tI=({evmNetworks:e,children:t})=>{let{networkConfigurations:r,handleLogOut:n,sendWagmiSettings:i,primaryWallet:s}=(0,tl.SXd)(),o=(0,h.useRef)(!1),a=(0,tl.wCc)().sort(e=>e.address===(null==s?void 0:s.address)?-1:1),l=(0,h.useMemo)(()=>tA(s,a),[s,a]);(0,h.useEffect)(()=>{i({dynamicWagmiSettings:e})},[]);let{chains:u,publicClient:d,webSocketPublicClient:f}=(0,h.useMemo)(()=>{var t;let n=(null!==(t=null!=e?e:null==r?void 0:r.evm)&&void 0!==t?t:[]).map(e=>(e.chainId=parseInt(e.chainId.toString()),e));return J(tb(n),t_(n))},[e,null==r?void 0:r.evm]),p=(0,h.useMemo)(()=>th(l,e=>new tc({chains:u,handleLogOut:n,preventWagmiSyncFromCallingLogout:o,walletConnector:e.connector})),[l,u,n,o]);return((0,h.useEffect)(()=>{tC.setPublicClient(d),tC.setWebSocketPublicClient(f),tC.setConnectors(p?[p]:[])},[p,d,f]),h.version.startsWith("18"))?(0,c.jsx)(te,{config:tC,children:(0,c.jsx)(tE,{connector:p,preventWagmiSyncFromCallingLogout:o,wallets:a,children:t})}):h.createElement(te,{config:tC},h.createElement(tE,{connector:p,preventWagmiSyncFromCallingLogout:o,wallets:a},t))}},62746:function(e,t,r){"use strict";r.d(t,{_:function(){return y}});var n=r(65376),i=r(68104);class s extends i.kb{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,(0,n.vp)(e);let r=(0,i.O0)(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let s=this.blockLen,o=new Uint8Array(s);o.set(r.length>s?e.create().update(r).digest():r);for(let e=0;e<o.length;e++)o[e]^=54;this.iHash.update(o),this.oHash=e.create();for(let e=0;e<o.length;e++)o[e]^=106;this.oHash.update(o),o.fill(0)}update(e){return(0,n.Gg)(this),this.iHash.update(e),this}digestInto(e){(0,n.Gg)(this),(0,n.aI)(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));let{oHash:t,iHash:r,finished:n,destroyed:i,blockLen:s,outputLen:o}=this;return e.finished=n,e.destroyed=i,e.blockLen=s,e.outputLen=o,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}let o=(e,t,r)=>new s(e,t).update(r).digest();o.create=(e,t)=>
107new s(e,t);var a=r(53554),l=r(91678),u=r(65332);let{bytesToNumberBE:c,hexToBytes:h}=l,d={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(e){let{Err:t}=d;if(e.length<2||2!==e[0])throw new t("Invalid signature integer tag");let r=e[1],n=e.subarray(2,r+2);if(!r||n.length!==r)throw new t("Invalid signature integer: wrong length");if(128&n[0])throw new t("Invalid signature integer: negative");if(0===n[0]&&!(128&n[1]))throw new t("Invalid signature integer: unnecessary leading zero");return{d:c(n),l:e.subarray(r+2)}},toSig(e){let{Err:t}=d,r="string"==typeof e?h(e):e;l.gk(r);let n=r.length;if(n<2||48!=r[0])throw new t("Invalid signature tag");if(r[1]!==n-2)throw new t("Invalid signature: incorrect length");let{d:i,l:s}=d._parseInt(r.subarray(2)),{d:o,l:a}=d._parseInt(s);if(a.length)throw new t("Invalid signature: left bytes after parsing");return{r:i,s:o}},hexFromSig(e){let t=e=>8&Number.parseInt(e[0],16)?"00"+e:e,r=e=>{let t=e.toString(16);return 1&t.length?`0${t}`:t},n=t(r(e.s)),i=t(r(e.r)),s=n.length/2,o=i.length/2,a=r(s),l=r(o);return`30${r(o+s+4)}02${l}${i}02${a}${n}`}},f=BigInt(0),p=BigInt(1),g=(BigInt(2),BigInt(3));function y(e,t){let r=t=>(function(e){let t=function(e){let t=(0,u.K)(e);return l.FF(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}(e),{Fp:r,n:n}=t,i=r.BYTES+1,s=2*r.BYTES+1;function o(e){return a.wQ(e,n)}function c(e){return a.U_(e,n)}let{ProjectivePoint:h,normPrivateKeyToScalar:y,weierstrassEquation:m,isWithinCurveOrder:v}=function(e){let t=/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function(e){let t=(0,u.K)(e);l.FF(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:r,Fp:n,a:i}=t;if(r){if(!n.eql(i,n.ZERO))throw Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!=typeof r||"bigint"!=typeof r.beta||"function"!=typeof r.splitScalar)throw Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}(e),{Fp:r}=t,n=t.toBytes||((e,t,n)=>{let i=t.toAffine();return l.eV(Uint8Array.from([4]),r.toBytes(i.x),r.toBytes(i.y))}),i=t.fromBytes||(e=>{let t=e.subarray(1);return{x:r.fromBytes(t.subarray(0,r.BYTES)),y:r.fromBytes(t.subarray(r.BYTES,2*r.BYTES))}});function s(e){let{a:n,b:i}=t,s=r.sqr(e),o=r.mul(s,e);return r.add(r.add(o,r.mul(e,n)),i)}if(!r.eql(r.sqr(t.Gy),s(t.Gx)))throw Error("bad generator point: equation left != right");function o(e){return"bigint"==typeof e&&f<e&&e<t.n}function c(e){if(!o(e))throw Error("Expected valid bigint: 0 < bigint < curve.n")}function h(e){let r;let{allowedPrivateKeyLengths:n,nByteLength:i,wrapPrivateKey:s,n:o}=t;if(n&&"bigint"!=typeof e){if(l._t(e)&&(e=l.ci(e)),"string"!=typeof e||!n.includes(e.length))throw Error("Invalid key");e=e.padStart(2*i,"0")}try{r="bigint"==typeof e?e:l.bytesToNumberBE((0,l.ql)("private key",e,i))}catch(t){throw Error(`private key must be ${i} bytes, hex or bigint, not ${typeof e}`)}return s&&(r=a.wQ(r,o)),c(r),r}let d=new Map;function y(e){if(!(e instanceof m))throw Error("ProjectivePoint expected")}class m{constructor(e,t,n){if(this.px=e,this.py=t,this.pz=n,null==e||!r.isValid(e))throw Error("x required");if(null==t||!r.isValid(t))throw Error("y required");if(null==n||!r.isValid(n))throw Error("z required")}static fromAffine(e){let{x:t,y:n}=e||{};if(!e||!r.isValid(t)||!r.isValid(n))throw Error("invalid affine point");if(e instanceof m)throw Error("projective point not allowed");let i=e=>r.eql(e,r.ZERO);return i(t)&&i(n)?m.ZERO:new m(t,n,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){let t=r.invertBatch(e.map(e=>e.pz));return e.map((e,r)=>e.toAffine(t[r])).map(m.fromAffine)}static fromHex(e){let t=m.fromAffine(i((0,l.ql)("pointHex",e)));return t.assertValidity(),t}static fromPrivateKey(e){return m.BASE.multiply(h(e))}_setWindowSize(e){this._WINDOW_SIZE=e,d.delete(this)}
107assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&!r.is0(this.py))return;throw Error("bad point: ZERO")}let{x:e,y:n}=this.toAffine();if(!r.isValid(e)||!r.isValid(n))throw Error("bad point: x or y not FE");let i=r.sqr(n),o=s(e);if(!r.eql(i,o))throw Error("bad point: equation left != right");if(!this.isTorsionFree())throw Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y:e}=this.toAffine();if(r.isOdd)return!r.isOdd(e);throw Error("Field doesn't support isOdd")}equals(e){y(e);let{px:t,py:n,pz:i}=this,{px:s,py:o,pz:a}=e,l=r.eql(r.mul(t,a),r.mul(s,i)),u=r.eql(r.mul(n,a),r.mul(o,i));return l&&u}negate(){return new m(this.px,r.neg(this.py),this.pz)}double(){let{a:e,b:n}=t,i=r.mul(n,g),{px:s,py:o,pz:a}=this,l=r.ZERO,u=r.ZERO,c=r.ZERO,h=r.mul(s,s),d=r.mul(o,o),f=r.mul(a,a),p=r.mul(s,o);return p=r.add(p,p),c=r.mul(s,a),c=r.add(c,c),l=r.mul(e,c),u=r.mul(i,f),u=r.add(l,u),l=r.sub(d,u),u=r.add(d,u),u=r.mul(l,u),l=r.mul(p,l),c=r.mul(i,c),f=r.mul(e,f),p=r.sub(h,f),p=r.mul(e,p),p=r.add(p,c),c=r.add(h,h),h=r.add(c,h),h=r.add(h,f),h=r.mul(h,p),u=r.add(u,h),f=r.mul(o,a),f=r.add(f,f),h=r.mul(f,p),l=r.sub(l,h),c=r.mul(f,d),c=r.add(c,c),new m(l,u,c=r.add(c,c))}add(e){y(e);let{px:n,py:i,pz:s}=this,{px:o,py:a,pz:l}=e,u=r.ZERO,c=r.ZERO,h=r.ZERO,d=t.a,f=r.mul(t.b,g),p=r.mul(n,o),v=r.mul(i,a),b=r.mul(s,l),w=r.add(n,i),_=r.add(o,a);w=r.mul(w,_),_=r.add(p,v),w=r.sub(w,_),_=r.add(n,s);let E=r.add(o,l);return _=r.mul(_,E),E=r.add(p,b),_=r.sub(_,E),E=r.add(i,s),u=r.add(a,l),E=r.mul(E,u),u=r.add(v,b),E=r.sub(E,u),h=r.mul(d,_),u=r.mul(f,b),h=r.add(u,h),u=r.sub(v,h),h=r.add(v,h),c=r.mul(u,h),v=r.add(p,p),v=r.add(v,p),b=r.mul(d,b),_=r.mul(f,_),v=r.add(v,b),b=r.sub(p,b),b=r.mul(d,b),_=r.add(_,b),p=r.mul(v,_),c=r.add(c,p),p=r.mul(E,_),u=r.mul(w,u),u=r.sub(u,p),p=r.mul(w,v),h=r.mul(E,h),new m(u,c,h=r.add(h,p))}subtract(e){return this.add(e.negate())}is0(){return this.equals(m.ZERO)}wNAF(e){return b.wNAFCached(this,d,e,e=>{let t=r.invertBatch(e.map(e=>e.pz));return e.map((e,r)=>e.toAffine(t[r])).map(m.fromAffine)})}multiplyUnsafe(e){let n=m.ZERO;if(e===f)return n;if(c(e),e===p)return this;let{endo:i}=t;if(!i)return b.unsafeLadder(this,e);let{k1neg:s,k1:o,k2neg:a,k2:l}=i.splitScalar(e),u=n,h=n,d=this;for(;o>f||l>f;)o&p&&(u=u.add(d)),l&p&&(h=h.add(d)),d=d.double(),o>>=p,l>>=p;return s&&(u=u.negate()),a&&(h=h.negate()),h=new m(r.mul(h.px,i.beta),h.py,h.pz),u.add(h)}multiply(e){let n,i;c(e);let{endo:s}=t;if(s){let{k1neg:t,k1:o,k2neg:a,k2:l}=s.splitScalar(e),{p:u,f:c}=this.wNAF(o),{p:h,f:d}=this.wNAF(l);u=b.constTimeNegate(t,u),h=b.constTimeNegate(a,h),h=new m(r.mul(h.px,s.beta),h.py,h.pz),n=u.add(h),i=c.add(d)}else{let{p:t,f:r}=this.wNAF(e);n=t,i=r}return m.normalizeZ([n,i])[0]}multiplyAndAddUnsafe(e,t,r){let n=m.BASE,i=(e,t)=>t!==f&&t!==p&&e.equals(n)?e.multiply(t):e.multiplyUnsafe(t),s=i(this,t).add(i(e,r));return s.is0()?void 0:s}toAffine(e){let{px:t,py:n,pz:i}=this,s=this.is0();null==e&&(e=s?r.ONE:r.inv(i));let o=r.mul(t,e),a=r.mul(n,e),l=r.mul(i,e);if(s)return{x:r.ZERO,y:r.ZERO};if(!r.eql(l,r.ONE))throw Error("invZ was invalid");return{x:o,y:a}}isTorsionFree(){let{h:e,isTorsionFree:r}=t;if(e===p)return!0;if(r)return r(m,this);throw Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:e,clearCofactor:r}=t;return e===p?this:r?r(m,this):this.multiplyUnsafe(t.h)}toRawBytes(e=!0){return this.assertValidity(),n(m,this,e)}toHex(e=!0){return l.ci(this.toRawBytes(e))}}m.BASE=new m(t.Gx,t.Gy,r.ONE),m.ZERO=new m(r.ZERO,r.ONE,r.ZERO);let v=t.nBitLength,b=(0,u.M)(m,t.endo?Math.ceil(v/2):v);return{CURVE:t,ProjectivePoint:m,normPrivateKeyToScalar:h,weierstrassEquation:s,isWithinCurveOrder:o}}({...t,toBytes(e,t,n){let i=t.toAffine(),s=r.toBytes(i.x),o=l.eV;return n?o(Uint8Array.from([t.hasEvenY()?2:3]),s):o(Uint8Array.from([4]),s,r.toBytes(i.y))},fromBytes(e){let t=e.length,n=e[0],o=e.subarray(1);if(t===i&&(2===n||3===n)){let e;let t=l.bytesToNumberBE(o);if(!(f<t&&t<r.ORDER))throw Error("Point is not on curve");let i=m(t);try{e=r.sqrt(i)}catch(e){throw Error("Point is not on curve"+(e instanceof Error?": "+e.message:""))}return(1&n)==1!=((e&p)===p)&&(e=r.neg(e)),{x:t,y:e}}if(t===s&&4===n)return{x:r.fromBytes(o.subarray(0,r.BYTES)),y:r.fromBytes(o.subarray(r.BYTES,2*r.BYTES))};throw Error(`Point of length ${t}
107 was invalid. Expected ${i} compressed bytes or ${s} uncompressed bytes`)}}),b=e=>l.ci(l.tL(e,t.nByteLength)),w=(e,t,r)=>l.bytesToNumberBE(e.slice(t,r));class _{constructor(e,t,r){this.r=e,this.s=t,this.recovery=r,this.assertValidity()}static fromCompact(e){let r=t.nByteLength;return new _(w(e=(0,l.ql)("compactSignature",e,2*r),0,r),w(e,r,2*r))}static fromDER(e){let{r:t,s:r}=d.toSig((0,l.ql)("DER",e));return new _(t,r)}assertValidity(){if(!v(this.r))throw Error("r must be 0 < r < CURVE.n");if(!v(this.s))throw Error("s must be 0 < s < CURVE.n")}addRecoveryBit(e){return new _(this.r,this.s,e)}recoverPublicKey(e){let{r:n,s:i,recovery:s}=this,a=A((0,l.ql)("msgHash",e));if(null==s||![0,1,2,3].includes(s))throw Error("recovery id invalid");let u=2===s||3===s?n+t.n:n;if(u>=r.ORDER)throw Error("recovery id 2 or 3 invalid");let d=(1&s)==0?"02":"03",f=h.fromHex(d+b(u)),p=c(u),g=o(-a*p),y=o(i*p),m=h.BASE.multiplyAndAddUnsafe(f,g,y);if(!m)throw Error("point at infinify");return m.assertValidity(),m}hasHighS(){return this.s>n>>p}normalizeS(){return this.hasHighS()?new _(this.r,o(-this.s),this.recovery):this}toDERRawBytes(){return l.hexToBytes(this.toDERHex())}toDERHex(){return d.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return l.hexToBytes(this.toCompactHex())}toCompactHex(){return b(this.r)+b(this.s)}}function E(e){let t=l._t(e),r="string"==typeof e,n=(t||r)&&e.length;return t?n===i||n===s:r?n===2*i||n===2*s:e instanceof h}let S=t.bits2int||function(e){let r=l.bytesToNumberBE(e),n=8*e.length-t.nBitLength;return n>0?r>>BigInt(n):r},A=t.bits2int_modN||function(e){return o(S(e))},k=l.dQ(t.nBitLength);function C(e){if("bigint"!=typeof e)throw Error("bigint expected");if(!(f<=e&&e<k))throw Error(`bigint expected < 2^${t.nBitLength}`);return l.tL(e,t.nByteLength)}let I={lowS:t.lowS,prehash:!1},x={lowS:t.lowS,prehash:!1};return h.BASE._setWindowSize(8),{CURVE:t,getPublicKey:function(e,t=!0){return h.fromPrivateKey(e).toRawBytes(t)},getSharedSecret:function(e,t,r=!0){if(E(e))throw Error("first arg must be private key");if(!E(t))throw Error("second arg must be public key");return h.fromHex(t).multiply(y(e)).toRawBytes(r)},sign:function(e,i,s=I){let{seed:a,k2sig:u}=function(e,i,s=I){if(["recovered","canonical"].some(e=>e in s))throw Error("sign() legacy options not supported");let{hash:a,randomBytes:u}=t,{lowS:d,prehash:g,extraEntropy:m}=s;null==d&&(d=!0),e=(0,l.ql)("msgHash",e),g&&(e=(0,l.ql)("prehashed msgHash",a(e)));let b=A(e),w=y(i),E=[C(w),C(b)];if(null!=m&&!1!==m){let e=!0===m?u(r.BYTES):m;E.push((0,l.ql)("extraEntropy",e))}return{seed:l.eV(...E),k2sig:function(e){let t=S(e);if(!v(t))return;let r=c(t),i=h.BASE.multiply(t).toAffine(),s=o(i.x);if(s===f)return;let a=o(r*o(b+s*w));if(a===f)return;let l=(i.x===s?0:2)|Number(i.y&p),u=a;if(d&&a>n>>p)u=a>n>>p?o(-a):a,l^=1;return new _(s,u,l)}}}(e,i,s);return l.n$(t.hash.outputLen,t.nByteLength,t.hmac)(a,u)},verify:function(e,r,n,i=x){let s,a;if(r=(0,l.ql)("msgHash",r),n=(0,l.ql)("publicKey",n),"strict"in i)throw Error("options.strict was renamed to lowS");let{lowS:u,prehash:f}=i;try{if("string"==typeof e||l._t(e))try{a=_.fromDER(e)}catch(t){if(!(t instanceof d.Err))throw t;a=_.fromCompact(e)}else if("object"==typeof e&&"bigint"==typeof e.r&&"bigint"==typeof e.s){let{r:t,s:r}=e;a=new _(t,r)}else throw Error("PARSE");s=h.fromHex(n)}catch(e){if("PARSE"===e.message)throw Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(u&&a.hasHighS())return!1;f&&(r=t.hash(r));let{r:p,s:g}=a,y=A(r),m=c(g),v=o(y*m),b=o(p*m),w=h.BASE.multiplyAndAddUnsafe(s,v,b)?.toAffine();return!!w&&o(w.x)===p},ProjectivePoint:h,Signature:_,utils:{isValidPrivateKey(e){try{return y(e),!0}catch(e){return!1}},normPrivateKeyToScalar:y,randomPrivateKey:()=>{let e=a.PS(t.n);return a.Us(t.randomBytes(e),t.n)},precompute:(e=8,t=h.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)}}})({...e,hash:t,hmac:(e,...r)=>o(t,e,(0,i.eV)(...r)),randomBytes:i.O6});return Object.freeze({...r(t),create:r})}BigInt(4)},65332:function(e,t,r){"use strict";r.d(t,{K:function(){return l},M:function(){return a}});var n=r(53554),i=r(91678);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */let s=BigInt(0),o=BigInt(1);function a(e,t){let r=(e,t)=>{let r=t.negate();return e?r:t},n=e=>({windows:Math.ceil(t/e)+1,windowSize:2**(e-1)});return{constTimeNegate:r,unsafeLadder(t,r){let n=e.ZERO,i=t;
107for(;r>s;)r&o&&(n=n.add(i)),i=i.double(),r>>=o;return n},precomputeWindow(e,t){let{windows:r,windowSize:i}=n(t),s=[],o=e,a=o;for(let e=0;e<r;e++){a=o,s.push(a);for(let e=1;e<i;e++)a=a.add(o),s.push(a);o=a.double()}return s},wNAF(t,i,s){let{windows:a,windowSize:l}=n(t),u=e.ZERO,c=e.BASE,h=BigInt(2**t-1),d=2**t,f=BigInt(t);for(let e=0;e<a;e++){let t=e*l,n=Number(s&h);s>>=f,n>l&&(n-=d,s+=o);let a=t+Math.abs(n)-1,p=e%2!=0,g=n<0;0===n?c=c.add(r(p,i[t])):u=u.add(r(g,i[a]))}return{p:u,f:c}},wNAFCached(e,t,r,n){let i=e._WINDOW_SIZE||1,s=t.get(e);return s||(s=this.precomputeWindow(e,i),1!==i&&t.set(e,n(s))),this.wNAF(i,s,r)}}}function l(e){return(0,n.OP)(e.Fp),(0,i.FF)(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,n.kK)(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}},53554:function(e,t,r){"use strict";r.d(t,{DV:function(){return b},OP:function(){return y},PS:function(){return _},Tu:function(){return p},U_:function(){return f},Us:function(){return E},gN:function(){return v},kK:function(){return m},oA:function(){return d},wQ:function(){return h}});var n=r(91678);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */let i=BigInt(0),s=BigInt(1),o=BigInt(2),a=BigInt(3),l=BigInt(4),u=BigInt(5),c=BigInt(8);function h(e,t){let r=e%t;return r>=i?r:t+r}function d(e,t,r){let n=e;for(;t-- >i;)n*=n,n%=r;return n}function f(e,t){if(e===i||t<=i)throw Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=h(e,t),n=t,o=i,a=s,l=s,u=i;for(;r!==i;){let e=n/r,t=n%r,i=o-l*e,s=a-u*e;n=r,r=t,o=l,a=u,l=i,u=s}if(n!==s)throw Error("invert: does not exist");return h(o,t)}BigInt(9),BigInt(16);let p=(e,t)=>(h(e,t)&s)===s,g=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function y(e){let t=g.reduce((e,t)=>(e[t]="function",e),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});return(0,n.FF)(e,t)}function m(e,t){let r=void 0!==t?t:e.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function v(e,t,r=!1,d={}){if(e<=i)throw Error(`Expected Field ORDER > 0, got ${e}`);let{nBitLength:p,nByteLength:g}=m(e,t);if(g>2048)throw Error("Field lengths over 2048 bytes are not supported");let y=function(e){if(e%l===a){let t=(e+s)/l;return function(e,r){let n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw Error("Cannot find square root");return n}}if(e%c===u){let t=(e-u)/c;return function(e,r){let n=e.mul(r,o),i=e.pow(n,t),s=e.mul(r,i),a=e.mul(e.mul(s,o),i),l=e.mul(s,e.sub(a,e.ONE));if(!e.eql(e.sqr(l),r))throw Error("Cannot find square root");return l}}return function(e){let t,r,n;let a=(e-s)/o;for(t=e-s,r=0;t%o===i;t/=o,r++);for(n=o;n<e&&function(e,t,r){if(r<=i||t<i)throw Error("Expected power/modulo > 0");if(r===s)return i;let n=s;for(;t>i;)t&s&&(n=n*e%r),e=e*e%r,t>>=s;return n}(n,a,e)!==e-s;n++);if(1===r){let t=(e+s)/l;return function(e,r){let n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw Error("Cannot find square root");return n}}let u=(t+s)/o;return function(e,i){if(e.pow(i,a)===e.neg(e.ONE))throw Error("Cannot find square root");let o=r,l=e.pow(e.mul(e.ONE,n),t),c=e.pow(i,u),h=e.pow(i,t);for(;!e.eql(h,e.ONE);){if(e.eql(h,e.ZERO))return e.ZERO;let t=1;for(let r=e.sqr(h);t<o&&!e.eql(r,e.ONE);t++)r=e.sqr(r);let r=e.pow(l,s<<BigInt(o-t-1));l=e.sqr(r),c=e.mul(c,r),h=e.mul(h,l),o=t}return c}}(e)}(e),v=Object.freeze({ORDER:e,BITS:p,BYTES:g,MASK:(0,n.dQ)(p),ZERO:i,ONE:s,create:t=>h(t,e),isValid:t=>{if("bigint"!=typeof t)throw Error(`Invalid field element: expected bigint, got ${typeof t}`);return i<=t&&t<e},is0:e=>e===i,isOdd:e=>(e&s)===s,neg:t=>h(-t,e),eql:(e,t)=>e===t,sqr:t=>h(t*t,e),add:(t,r)=>h(t+r,e),sub:(t,r)=>h(t-r,e),mul:(t,r)=>h(t*r,e),pow:(e,t)=>(function(e,t,r){if(r<i)throw Error("Expected power > 0");if(r===i)return e.ONE;if(r===s)return t;let n=e.ONE,o=t;for(;r>i;)r&s&&(n=e.mul(n,o)),o=e.sqr(o),r>>=s;return n})(v,e,t),div:(t,r)=>h(t*f(r,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>f(t,e),sqrt:d.sqrt||(e=>y(v,e)),invertBatch:e=>(function(e,t){let r=Array(t.length),n=t.reduce((t,n,i)=>e.is0(n)?t:(r[i]=t,e.mul(t,n)),e.ONE),i=e.inv(n);return t.reduceRight((t,n,i)=>e.is0(n)?t:(r[i]=e.mul(t,r[i]),e.mul(t,n)),i),r})(v,e),cmov:(e,t,r)=>r?t:e,toBytes:e=>r?(0,n.S5)(e,g):(0,n.tL)(e,g),fromBytes:e=>{if(e.length!==g)throw Error(`Fp.fromBytes: expected ${g}, got ${e.length}`);return r?(0,n.ty)(e):(0,n.bytesToNumberBE)(e)}});return Object.freeze(v)}function b(e,t){if(!e.isOdd)throw Error("Field doesn't have isOdd");let r=e.sqrt(t);return e.isOdd(r)?e.neg(r):r}function w(e){if("bigint"!=typeof e)throw Error("field order must be bigint");return Math.ceil(e.toString(2).length/8)}function _(e){let t=w(e);return t+Math.ceil(t/2)}function E(e,t,r=!1){let i=e.length,o=w(t),a=_(t);if(i<16||i<a||i>1024)throw Error(`expected ${a}-1024 bytes of input, got ${i}`);let l=h(r?(0,n.bytesToNumberBE)(e):(0,n.ty)(e),t-s)+s;return r?(0,n.S5)(l,o):(0,n.tL)(l,o)}},91678:function(e,t,r){"use strict";r.d(t,{FF:function(){return A},S5:function(){return y},_t:function(){return s},bytesToNumberBE:function(){return f},ci:function(){return l},dQ:function(){return b},eV:function(){return v},gk:function(){return o},hexToBytes:function(){return d},n$:function(){return E},ql:function(){return m},tL:function(){return g},ty:function(){return p}}),BigInt(0);let n=BigInt(1),i=BigInt(2);function s(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function o(e){if(!s(e))throw Error("Uint8Array expected")}let a=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function l(e){o(e);let t="";for(let r=0;r<e.length;r++)t+=a[e[r]];return t}function u(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);return BigInt(""===e?"0":`0x${e}`)}let c={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function h(e){return e>=c._0&&e<=c._9?e-c._0:e>=c._A&&e<=c._F?e-(c._A-10):e>=c._a&&e<=c._f?e-(c._a-10):void 0}function d(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);let t=e.length,r=t/2;if(t%2)throw Error("padded hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let t=0,i=0;t<r;t++,i+=2){let r=h(e.charCodeAt(i)),s=h(e.charCodeAt(i+1));if(void 0===r||void 0===s)throw Error('hex string expected, got non-hex character "'+(e[i]+e[i+1])+'" at index '+i);n[t]=16*r+s}return n}function f(e){return u(l(e))}function p(e){return o(e),u(l(Uint8Array.from(e).reverse()))}function g(e,t){return d(e.toString(16).padStart(2*t,"0"))}function y(e,t){return g(e,t).reverse()}function m(e,t,r){let n;if("string"==typeof t)try{n=d(t)}catch(r){throw Error(`${e} must be valid hex string, got "${t}". Cause: ${r}`)}else if(s(t))n=Uint8Array.from(t);else throw Error(`${e} must be hex string or Uint8Array`);let i=n.length;if("number"==typeof r&&i!==r)throw Error(`${e} expected ${r} bytes, got ${i}`);return n}function v(...e){let t=0;for(let r=0;r<e.length;r++){let n=e[r];o(n),t+=n.length}let r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){let i=e[t];r.set(i,n),n+=i.length}return r}let b=e=>(i<<BigInt(e-1))-n,w=e=>new Uint8Array(e),_=e=>Uint8Array.from(e);function E(e,t,r){if("number"!=typeof e||e<2)throw Error("hashLen must be a number");if("number"!=typeof t||t<2)throw Error("qByteLen must be a number");if("function"!=typeof r)throw Error("hmacFn must be a function");let n=w(e),i=w(e),s=0,o=()=>{n.fill(1),i.fill(0),s=0},a=(...e)=>r(i,n,...e),l=(e=w())=>{i=a(_([0]),e),n=a(),0!==e.length&&(i=a(_([1]),e),n=a())},u=()=>{if(s++>=1e3)throw Error("drbg: tried 1000 values");let e=0,r=[];for(;e<t;){let t=(n=a()).slice();r.push(t),e+=n.length}return v(...r)};return(e,t)=>{let r;for(o(),l(e);!(r=t(u()));)l();return o(),r}}let S={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||s(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};function A(e,t,r={}){let n=(t,r,n)=>{let i=S[r];if("function"!=typeof i)throw Error(`Invalid validator "${r}", expected function`);let s=e[t];if((!n||void 0!==s)&&!i(s,e))throw Error(`Invalid param ${String(t)}=${s} (${typeof s}), expected ${r}`)};for(let[e,r]of Object.entries(t))n(e,r,!1);for(let[e,t]of Object.entries(r))n(e,t,!0);return e}},2552:function(e,t,r){"use strict";r.d(t,{UN:function(){return N}});
107var n=r(44815),i=r(75390),s=r(68104);let[o,a]=i.ZP.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0
107x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),l=new Uint32Array(80),u=new Uint32Array(80);class c extends n.VR{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:e,Al:t,Bh:r,Bl:n,Ch:i,Cl:s,Dh:o,Dl:a,Eh:l,El:u,Fh:c,Fl:h,Gh:d,Gl:f,Hh:p,Hl:g}=this;return[e,t,r,n,i,s,o,a,l,u,c,h,d,f,p,g]}set(e,t,r,n,i,s,o,a,l,u,c,h,d,f,p,g){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|n,this.Ch=0|i,this.Cl=0|s,this.Dh=0|o,this.Dl=0|a,this.Eh=0|l,this.El=0|u,this.Fh=0|c,this.Fl=0|h,this.Gh=0|d,this.Gl=0|f,this.Hh=0|p,this.Hl=0|g}process(e,t){for(let r=0;r<16;r++,t+=4)l[r]=e.getUint32(t),u[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){let t=0|l[e-15],r=0|u[e-15],n=i.ZP.rotrSH(t,r,1)^i.ZP.rotrSH(t,r,8)^i.ZP.shrSH(t,r,7),s=i.ZP.rotrSL(t,r,1)^i.ZP.rotrSL(t,r,8)^i.ZP.shrSL(t,r,7),o=0|l[e-2],a=0|u[e-2],c=i.ZP.rotrSH(o,a,19)^i.ZP.rotrBH(o,a,61)^i.ZP.shrSH(o,a,6),h=i.ZP.rotrSL(o,a,19)^i.ZP.rotrBL(o,a,61)^i.ZP.shrSL(o,a,6),d=i.ZP.add4L(s,h,u[e-7],u[e-16]),f=i.ZP.add4H(d,n,c,l[e-7],l[e-16]);l[e]=0|f,u[e]=0|d}let{Ah:r,Al:n,Bh:s,Bl:c,Ch:h,Cl:d,Dh:f,Dl:p,Eh:g,El:y,Fh:m,Fl:v,Gh:b,Gl:w,Hh:_,Hl:E}=this;for(let e=0;e<80;e++){let t=i.ZP.rotrSH(g,y,14)^i.ZP.rotrSH(g,y,18)^i.ZP.rotrBH(g,y,41),S=i.ZP.rotrSL(g,y,14)^i.ZP.rotrSL(g,y,18)^i.ZP.rotrBL(g,y,41),A=g&m^~g&b,k=y&v^~y&w,C=i.ZP.add5L(E,S,k,a[e],u[e]),I=i.ZP.add5H(C,_,t,A,o[e],l[e]),x=0|C,P=i.ZP.rotrSH(r,n,28)^i.ZP.rotrBH(r,n,34)^i.ZP.rotrBH(r,n,39),O=i.ZP.rotrSL(r,n,28)^i.ZP.rotrBL(r,n,34)^i.ZP.rotrBL(r,n,39),T=r&s^r&h^s&h,R=n&c^n&d^c&d;_=0|b,E=0|w,b=0|m,w=0|v,m=0|g,v=0|y,({h:g,l:y}=i.ZP.add(0|f,0|p,0|I,0|x)),f=0|h,p=0|d,h=0|s,d=0|c,s=0|r,c=0|n;let N=i.ZP.add3L(x,O,R);r=i.ZP.add3H(N,I,P,T),n=0|N}({h:r,l:n}=i.ZP.add(0|this.Ah,0|this.Al,0|r,0|n)),({h:s,l:c}=i.ZP.add(0|this.Bh,0|this.Bl,0|s,0|c)),({h:h,l:d}=i.ZP.add(0|this.Ch,0|this.Cl,0|h,0|d)),({h:f,l:p}=i.ZP.add(0|this.Dh,0|this.Dl,0|f,0|p)),({h:g,l:y}=i.ZP.add(0|this.Eh,0|this.El,0|g,0|y)),({h:m,l:v}=i.ZP.add(0|this.Fh,0|this.Fl,0|m,0|v)),({h:b,l:w}=i.ZP.add(0|this.Gh,0|this.Gl,0|b,0|w)),({h:_,l:E}=i.ZP.add(0|this.Hh,0|this.Hl,0|_,0|E)),this.set(r,n,s,c,h,d,f,p,g,y,m,v,b,w,_,E)}roundClean(){l.fill(0),u.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}let h=(0,s.hE)(()=>new c);var d=r(53554),f=r(91678),p=r(65332);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */let g=BigInt(0),y=BigInt(1),m=BigInt(2),v=BigInt(8),b={zip215:!0},w=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),_=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),E=BigInt(0),S=BigInt(1),A=BigInt(2),k=BigInt(5),C=BigInt(10),I=BigInt(20),x=BigInt(40),P=BigInt(80);function O(e,t){let r=(0,d.wQ)(t*t*t,w),n=function(e){let t=e*e%w*e%w,r=(0,d.oA)(t,A,w)*t%w,n=(0,d.oA)(r,S,w)*e%w,i=(0,d.oA)(n,k,w)*n%w,s=(0,d.oA)(i,C,w)*i%w,o=(0,d.oA)(s,I,w)*s%w,a=(0,d.oA)(o,x,w)*o%w,l=(0,d.oA)(a,P,w)*a%w,u=(0,d.oA)(l,P,w)*a%w,c=(0,d.oA)(u,C,w)*i%w;return{pow_p_5_8:(0,d.oA)(c,A,w)*e%w,b2:t}}(e*(0,d.wQ)(r*r*t,w)).pow_p_5_8,i=(0,d.wQ)(e*r*n,w),s=(0,d.wQ)(t*i*i,w),o=i,a=(0,d.wQ)(i*_,w),l=s===e,u=s===(0,d.wQ)(-e,w),c=s===(0,d.wQ)(-e*_,w);return l&&(i=o),(u||c)&&(i=a),(0,d.Tu)(i,w)&&(i=(0,d.wQ)(-i,w)),{isValid:l||u,value:i}}let T=(0,d.gN)(w,void 0,!0),R={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:T,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:h,randomBytes:s.O6,adjustScalarBytes:function(e){return e[0]&=248,e[31]&=127,e[3
1071]|=64,e},uvRatio:O},N=function(e){let t=function(e){let t=(0,p.K)(e);return f.FF(e,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...t})}(e),{Fp:r,n:n,prehash:i,hash:s,randomBytes:o,nByteLength:a,h:l}=t,u=m<<BigInt(8*a)-y,c=r.create,h=t.uvRatio||((e,t)=>{try{return{isValid:!0,value:r.sqrt(e*r.inv(t))}}catch(e){return{isValid:!1,value:g}}}),w=t.adjustScalarBytes||(e=>e),_=t.domain||((e,t,r)=>{if(t.length||r)throw Error("Contexts/pre-hash are not supported");return e}),E=e=>"bigint"==typeof e&&g<e,S=(e,t)=>E(e)&&E(t)&&e<t,A=e=>e===g||S(e,u);function k(e,t){if(S(e,t))return e;throw Error(`Expected valid scalar < ${t}, got ${typeof e} ${e}`)}function C(e){return e===g?e:k(e,n)}let I=new Map;function x(e){if(!(e instanceof P))throw Error("ExtendedPoint expected")}class P{constructor(e,t,r,n){if(this.ex=e,this.ey=t,this.ez=r,this.et=n,!A(e))throw Error("x required");if(!A(t))throw Error("y required");if(!A(r))throw Error("z required");if(!A(n))throw Error("t required")}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(e){if(e instanceof P)throw Error("extended point not allowed");let{x:t,y:r}=e||{};if(!A(t)||!A(r))throw Error("invalid affine point");return new P(t,r,y,c(t*r))}static normalizeZ(e){let t=r.invertBatch(e.map(e=>e.ez));return e.map((e,r)=>e.toAffine(t[r])).map(P.fromAffine)}_setWindowSize(e){this._WINDOW_SIZE=e,I.delete(this)}assertValidity(){let{a:e,d:r}=t;if(this.is0())throw Error("bad point: ZERO");let{ex:n,ey:i,ez:s,et:o}=this,a=c(n*n),l=c(i*i),u=c(s*s),h=c(u*u),d=c(a*e);if(c(u*c(d+l))!==c(h+c(r*c(a*l))))throw Error("bad point: equation left != right (1)");if(c(n*i)!==c(s*o))throw Error("bad point: equation left != right (2)")}equals(e){x(e);let{ex:t,ey:r,ez:n}=this,{ex:i,ey:s,ez:o}=e,a=c(t*o),l=c(i*n),u=c(r*o),h=c(s*n);return a===l&&u===h}is0(){return this.equals(P.ZERO)}negate(){return new P(c(-this.ex),this.ey,this.ez,c(-this.et))}double(){let{a:e}=t,{ex:r,ey:n,ez:i}=this,s=c(r*r),o=c(n*n),a=c(m*c(i*i)),l=c(e*s),u=r+n,h=c(c(u*u)-s-o),d=l+o,f=d-a,p=l-o,g=c(h*f),y=c(d*p),v=c(h*p);return new P(g,y,c(f*d),v)}add(e){x(e);let{a:r,d:n}=t,{ex:i,ey:s,ez:o,et:a}=this,{ex:l,ey:u,ez:h,et:d}=e;if(r===BigInt(-1)){let e=c((s-i)*(u+l)),t=c((s+i)*(u-l)),r=c(t-e);if(r===g)return this.double();let n=c(o*m*d),f=c(a*m*h),p=f+n,y=t+e,v=f-n,b=c(p*r),w=c(y*v),_=c(p*v);return new P(b,w,c(r*y),_)}let f=c(i*l),p=c(s*u),y=c(a*n*d),v=c(o*h),b=c((i+s)*(l+u)-f-p),w=v-y,_=v+y,E=c(p-r*f),S=c(b*w),A=c(_*E),k=c(b*E);return new P(S,A,c(w*_),k)}subtract(e){return this.add(e.negate())}wNAF(e){return R.wNAFCached(this,I,e,P.normalizeZ)}multiply(e){let{p:t,f:r}=this.wNAF(k(e,n));return P.normalizeZ([t,r])[0]}multiplyUnsafe(e){let t=C(e);return t===g?T:this.equals(T)||t===y?this:this.equals(O)?this.wNAF(t).p:R.unsafeLadder(this,t)}isSmallOrder(){return this.multiplyUnsafe(l).is0()}isTorsionFree(){return R.unsafeLadder(this,n).is0()}toAffine(e){let{ex:t,ey:n,ez:i}=this,s=this.is0();null==e&&(e=s?v:r.inv(i));let o=c(t*e),a=c(n*e),l=c(i*e);if(s)return{x:g,y:y};if(l!==y)throw Error("invZ was invalid");return{x:o,y:a}}clearCofactor(){let{h:e}=t;return e===y?this:this.multiplyUnsafe(e)}static fromHex(e,n=!1){let{d:i,a:s}=t,o=r.BYTES,a=(e=(0,f.ql)("pointHex",e,o)).slice(),l=e[o-1];a[o-1]=-129&l;let d=f.ty(a);d===g||(n?k(d,u):k(d,r.ORDER));let p=c(d*d),{isValid:m,value:v}=h(c(p-y),c(i*p-s));if(!m)throw Error("Point.fromHex: invalid y coordinate");let b=(v&y)===y,w=(128&l)!=0;if(!n&&v===g&&w)throw Error("Point.fromHex: x=0 and x_0=1");return w!==b&&(v=c(-v)),P.fromAffine({x:v,y:d})}static fromPrivateKey(e){return D(e).point}toRawBytes(){let{x:e,y:t}=this.toAffine(),n=f.S5(t,r.BYTES);return n[n.length-1]|=e&y?128:0,n}toHex(){return f.ci(this.toRawBytes())}}P.BASE=new P(t.Gx,t.Gy,y,c(t.Gx*t.Gy)),P.ZERO=new P(g,y,y,g);let{BASE:O,ZERO:T}=P,R=(0,p.M)(P,8*a);function N(e){var t;return t=f.ty(e),(0,d.wQ)(t,n)}function D(e){e=(0,f.ql)("private key",e,a);let t=(0,f.ql)("hashed private key",s(e),2*a),r=w(t.slice(0,a)),n=t.slice(a,2*a),i=N(r),o=O.multiply(i),l=o.toRawBytes();return{head:r,prefix:n,scalar:i,point:o,pointBytes:l}}function B(e=new Uint8Array,...t){return N(s(_(f.eV(...t),(0,f.ql)("context",e),!!i)))}return O._setWindowSize(8),{CURVE:t,getPublicKey:function(e){return D(e).pointBytes},sign:function(e,t,s={}){var o;e=(0,f.ql)("message",e),i&&(e=i(e));let{prefix:l,scalar:u,pointBytes:c}=D(t),h=B(s.context,l,e),p=O.multiply(h).toRawBytes(),g=(o=h+B(s.context,p,c,e)*u,(0,d.wQ)(o,n)
107);C(g);let y=f.eV(p,f.S5(g,r.BYTES));return(0,f.ql)("result",y,2*a)},verify:function(e,t,n,s=b){let o,a,l;let{context:u,zip215:c}=s,h=r.BYTES;e=(0,f.ql)("signature",e,2*h),t=(0,f.ql)("message",t),i&&(t=i(t));let d=f.ty(e.slice(h,2*h));try{o=P.fromHex(n,c),a=P.fromHex(e.slice(0,h),c),l=O.multiplyUnsafe(d)}catch(e){return!1}if(!c&&o.isSmallOrder())return!1;let p=B(u,a.toRawBytes(),o.toRawBytes(),t);return a.add(o.multiplyUnsafe(p)).subtract(l).clearCofactor().equals(P.ZERO)},ExtendedPoint:P,utils:{getExtendedPublicKey:D,randomPrivateKey:()=>o(r.BYTES),precompute:(e=8,t=P.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)}}}(R);({...R});let D=(T.ORDER+BigInt(3))/BigInt(8);function B(e){if(!(e instanceof $))throw Error("RistrettoPoint expected")}T.pow(A,D),T.sqrt(T.neg(T.ONE)),T.ORDER,BigInt(5),BigInt(8),BigInt(486662),(0,d.DV)(T,T.neg(BigInt(486664)));let M=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),L=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),U=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),j=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),F=e=>O(S,e),q=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),H=e=>N.CURVE.Fp.create(bytesToNumberLE(e)&q);function z(e){let{d:t}=N.CURVE,r=N.CURVE.Fp.ORDER,n=N.CURVE.Fp.create,i=n(null*e*e),s=n((i+S)*U),o=BigInt(-1),a=n((o-t*i)*n(i+t)),{isValid:l,value:u}=O(s,a),c=n(u*e);isNegativeLE(c,r)||(c=n(-c)),l||(u=c),l||(o=i);let h=n(o*(i-S)*j-a),d=u*u,f=n((u+u)*a),p=n(h*M),g=n(S-d),y=n(S+d);return new N.ExtendedPoint(n(f*y),n(g*p),n(p*y),n(f*g))}class ${constructor(e){this.ep=e}static fromAffine(e){return new $(N.ExtendedPoint.fromAffine(e))}static hashToCurve(e){let t=z(H((e=ensureBytes("ristrettoHash",e,64)).slice(0,32))),r=z(H(e.slice(32,64)));return new $(t.add(r))}static fromHex(e){e=ensureBytes("ristrettoHex",e,32);let{a:t,d:r}=N.CURVE,n=N.CURVE.Fp.ORDER,i=N.CURVE.Fp.create,s="RistrettoPoint.fromHex: the hex is not valid encoding of RistrettoPoint",o=H(e);if(!equalBytes(numberToBytesLE(o,32),e)||isNegativeLE(o,n))throw Error(s);let a=i(o*o),l=i(S+t*a),u=i(S-t*a),c=i(l*l),h=i(u*u),d=i(t*r*c-h),{isValid:f,value:p}=F(i(d*h)),g=i(p*u),y=i(p*g*d),m=i((o+o)*g);isNegativeLE(m,n)&&(m=i(-m));let v=i(l*y),b=i(m*v);if(!f||isNegativeLE(b,n)||v===E)throw Error(s);return new $(new N.ExtendedPoint(m,v,S,b))}toRawBytes(){let e,{ex:t,ey:r,ez:n,et:i}=this.ep,s=N.CURVE.Fp.ORDER,o=N.CURVE.Fp.create,a=o(o(n+r)*o(n-r)),l=o(t*r),u=o(l*l),{value:c}=F(o(a*u)),h=o(c*a),d=o(c*l),f=o(h*d*i);if(isNegativeLE(i*f,s)){let n=o(null*r),i=o(null*t);t=n,r=i,e=o(h*L)}else e=d;isNegativeLE(t*f,s)&&(r=o(-r));let p=o((n-r)*e);return isNegativeLE(p,s)&&(p=o(-p)),numberToBytesLE(p,32)}toHex(){return bytesToHex(this.toRawBytes())}toString(){return this.toHex()}equals(e){B(e);let{ex:t,ey:r}=this.ep,{ex:n,ey:i}=e.ep,s=N.CURVE.Fp.create,o=s(t*i)===s(r*n),a=s(r*i)===s(t*n);return o||a}add(e){return B(e),new $(this.ep.add(e.ep))}subtract(e){return B(e),new $(this.ep.subtract(e.ep))}multiply(e){return new $(this.ep.multiply(e))}multiplyUnsafe(e){return new $(this.ep.multiplyUnsafe(e))}double(){return new $(this.ep.double())}negate(){return new $(this.ep.negate())}}},68347:function(e,t,r){"use strict";r.d(t,{kA:function(){return d}});var n=r(65530),i=r(53554),s=r(62746);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */let o=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),a=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),l=BigInt(1),u=BigInt(2),c=(e,t)=>(e+t/u)/t,h=(0,i.gN)(o,void 0,void 0,{sqrt:function(e){let t=BigInt(3),r=BigInt(6),n=BigInt(11),s=BigInt(22),a=BigInt(23),l=BigInt(44),c=BigInt(88),d=e*e*e%o,f=d*d*e%o,p=(0,i.oA)(f,t,o)*f%o,g=(0,i.oA)(p,t,o)*f%o,y=(0,i.oA)(g,u,o)*d%o,m=(0,i.oA)(y,n,o)*y%o,v=(0,i.oA)(m,s,o)*m%o,b=(0,i.oA)(v,l,o)*v%o,w=(0,i.oA)(b,c,o)*b%o,_=(0,i.oA)(w,l,o)*v%o,E=(0,i.oA)(_,t,o)*f%o,S=(0,i.oA)(E,a,o)*m%o,A=(0,i.oA)(S,r,o)*d%o,k=(0,i.oA)(A,u,o);if(!h.eql(h.sqr(k),e))throw Error("Cannot find square root");return k}}),d=(0,s._)({a:BigInt(0),b:BigInt(7),Fp:h,n:a,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{let t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-l*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),n=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=BigInt("0x100000000000000000000000000000000"),o=c(t*e,a),u=c(-r*e,a),h=(0,i.wQ)(e-o*t-u*n,a),d=(0,i.wQ)(-o*r-u*t,a),f=h>s,p=d>s;if(f&&(h=a-h),p&&(d=a-d),h>s||d>s)throw Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:f,k1:h,k2neg:p,k2:d}}}},n.J);BigInt(0),d.ProjectivePoint},65376:function(e,t,r){"use strict";function n(e){if(!Number.isSafeInteger(e)||e<0)throw Error(`positive integer expected, not ${e}`)}function i(e,...t){if(!(e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name))throw Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function s(e){if("function"!=typeof e||"function"!=typeof e.create)throw Error("Hash should be wrapped by utils.wrapConstructor");n(e.outputLen),n(e.blockLen)}function o(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function a(e,t){i(e);let r=t.outputLen;if(e.length<r)throw Error(`digestInto() expects output buffer of length at least ${r}`)}r.d(t,{Gg:function(){return o},J8:function(){return a},Rx:function(){return n},aI:function(){return i},vp:function(){return s}})},44815:function(e,t,r){"use strict";r.d(t,{VR:function(){return a},bc:function(){return s},l3:function(){return o}});var n=r(65376),i=r(68104);let s=(e,t,r)=>e&t^~e&r,o=(e,t,r)=>e&t^e&r^t&r;class a extends i.kb{constructor(e,t,r,n){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,i.GL)(this.buffer)}update(e){(0,n.Gg)(this);let{view:t,buffer:r,blockLen:s}=this,o=(e=(0,i.O0)(e)).length;for(let n=0;n<o;){let a=Math.min(s-this.pos,o-n);if(a===s){let t=(0,i.GL)(e);for(;s<=o-n;n+=s)this.process(t,n);continue}r.set(e.subarray(n,n+a),this.pos),this.pos+=a,n+=a,this.pos===s&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,n.Gg)(this),(0,n.J8)(e,this),this.finished=!0;let{buffer:t,view:r,blockLen:s,isLE:o}=this,{pos:a}=this;t[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>s-a&&(this.process(r,0),a=0);for(let e=a;
107e<s;e++)t[e]=0;!function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);let i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),l=n?4:0,u=n?0:4;e.setUint32(t+l,o,n),e.setUint32(t+u,a,n)}(r,s-8,BigInt(8*this.length),o),this.process(r,0);let l=(0,i.GL)(e),u=this.outputLen;if(u%4)throw Error("_sha2: outputLen should be aligned to 32bit");let c=u/4,h=this.get();if(c>h.length)throw Error("_sha2: outputLen bigger than state");for(let e=0;e<c;e++)l.setUint32(4*e,h[e],o)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:t,buffer:r,length:n,finished:i,destroyed:s,pos:o}=this;return e.length=n,e.pos=o,e.finished=i,e.destroyed=s,n%t&&e.buffer.set(r),e}}},75390:function(e,t,r){"use strict";r.d(t,{EP:function(){return a},SD:function(){return u},Vl:function(){return o},gm:function(){return l},mk:function(){return c}});let n=BigInt(4294967296-1),i=BigInt(32);function s(e,t=!1){return t?{h:Number(e&n),l:Number(e>>i&n)}:{h:0|Number(e>>i&n),l:0|Number(e&n)}}function o(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;i<e.length;i++){let{h:o,l:a}=s(e[i],t);[r[i],n[i]]=[o,a]}return[r,n]}let a=(e,t,r)=>e<<r|t>>>32-r,l=(e,t,r)=>t<<r|e>>>32-r,u=(e,t,r)=>t<<r-32|e>>>64-r,c=(e,t,r)=>e<<r-32|t>>>64-r;t.ZP={fromBig:s,split:o,toBig:(e,t)=>BigInt(e>>>0)<<i|BigInt(t>>>0),shrSH:(e,t,r)=>e>>>r,shrSL:(e,t,r)=>e<<32-r|t>>>r,rotrSH:(e,t,r)=>e>>>r|t<<32-r,rotrSL:(e,t,r)=>e<<32-r|t>>>r,rotrBH:(e,t,r)=>e<<64-r|t>>>r-32,rotrBL:(e,t,r)=>e>>>r-32|t<<64-r,rotr32H:(e,t)=>t,rotr32L:(e,t)=>e,rotlSH:a,rotlSL:l,rotlBH:u,rotlBL:c,add:function(e,t,r,n){let i=(t>>>0)+(n>>>0);return{h:e+r+(i/4294967296|0)|0,l:0|i}},add3L:(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),add3H:(e,t,r,n)=>t+r+n+(e/4294967296|0)|0,add4L:(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),add4H:(e,t,r,n,i)=>t+r+n+i+(e/4294967296|0)|0,add5H:(e,t,r,n,i,s)=>t+r+n+i+s+(e/4294967296|0)|0,add5L:(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0)}},65530:function(e,t,r){"use strict";r.d(t,{J:function(){return u}});var n=r(44815),i=r(68104);let s=new Uint32Array([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]),o=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),a=new Uint32Array(64);class l extends n.VR{constructor(){super(64,32,8,!1),this.A=0|o[0],this.B=0|o[1],this.C=0|o[2],this.D=0|o[3],this.E=0|o[4],this.F=0|o[5],this.G=0|o[6],this.H=0|o[7]}get(){let{A:e,B:t,C:r,D:n,E:i,F:s,G:o,H:a}=this;return[e,t,r,n,i,s,o,a]}set(e,t,r,n,i,s,o,a){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|s,this.G=0|o,this.H=0|a}process(e,t){for(let r=0;r<16;r++,t+=4)a[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=a[e-15],r=a[e-2],n=(0,i.np)(t,7)^(0,i.np)(t,18)^t>>>3,s=(0,i.np)(r,17)^(0,i.np)(r,19)^r>>>10;a[e]=s+a[e-7]+n+a[e-16]|0}let{A:r,B:o,C:l,D:u,E:c,F:h,G:d,H:f}=this;for(let e=0;e<64;e++){let t=f+((0,i.np)(c,6)^(0,i.np)(c,11)^(0,i.np)(c,25))+(0,n.bc)(c,h,d)+s[e]+a[e]|0,p=((0,i.np)(r,2)^(0,i.np)(r,13)^(0,i.np)(r,22))+(0,n.l3)(r,o,l)|0;f=d,d=h,h=c,c=u+t|0,u=l,l=o,o=r,r=t+p|0}r=r+this.A|0,o=o+this.B|0,l=l+this.C|0,u=u+this.D|0,c=c+this.E|0,h=h+this.F|0,d=d+this.G|0,f=f+this.H|0,this.set(r,o,l,u,c,h,d,f)}roundClean(){a.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}let u=(0,i.hE)(()=>new l)},35743:function(e,t,r){"use strict";r.d(t,{fr:function(){return w}});var n=r(65376),i=r(75390),s=r(68104);let o=[],a=[],l=[],u=BigInt(0),c=BigInt(1),h=BigInt(2),d=BigInt(7),f=BigInt(256),p=BigInt(113);for(let e=0,t=c,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],o.push(2*(5*n+r)),a.push((e+1)*(e+2)/2%64);let i=u;for(let e=0;e<7;e++)(t=(t<<c^(t>>d)*p)%f)&h&&(i^=c<<(c<<BigInt(e))-c);l.push(i)}let[g,y]=(0,i.Vl)(l,!0),m=(e,t,r)=>r>32?(0,i.SD)(e,t,r):(0,i.EP)(e,t,r),v=(e,t,r)=>r>32?(0,i.mk)(e,t,r):(0,i.gm)(e,t,r);class b extends s.kb{constructor(e,t,r,i=!1,o=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=i,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,n.Rx)(r),0>=this.blockLen||this.blockLen>=200)throw Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,s.Jq)(this.state)}keccak(){s.iA||(0,s.l1)(this.state32),function(e,t=24){let r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){let n=(t+8)%10,i=(t+2)%10,s=r[i],o=r[i+1],a=m(s,o,1)^r[n],l=v(s,o,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=a,e[t+r+1]^=l}let t=e[2],i=e[3];for(let r=0;r<24;r++){let n=a[r],s=m(t,i,n),l=v(t,i,n),u=o[r];t=e[u],i=e[u+1],e[u]=s,e[u+1]=l}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=g[n],e[1]^=y[n]}r.fill(0)}(this.state32,this.rounds),s.iA||(0,s.l1)(this.state32),this.posOut=0,this.pos=0}update(e){(0,n.Gg)(this);let{blockLen:t,state:r}=this,i=(e=(0,s.O0)(e)).length;for(let n=0;n<i;){let s=Math.min(t-this.pos,i-n);for(let t=0;t<s;t++)r[this.pos++]^=e[n++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:t,pos:r,blockLen:n}=this;e[r]^=t,(128&t)!=0&&r===n-1&&this.keccak(),e[n-1]^=128,this.keccak()}writeInto(e){(0,n.Gg)(this,!1),(0,n.aI)(e),this.finish();let t=this.state,{blockLen:r}=this;for(let n=0,i=e.length;n<i;){this.posOut>=r&&this.keccak();let s=Math.min(r-this.posOut,i-n);e.set(t.subarray(this.posOut,this.posOut+s),n),this.posOut+=s,n+=s}return e}xofInto(e){if(!this.enableXOF)throw Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return(0,n.Rx)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,n.J8)(e,this),this.finished)throw Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){let{blockLen:t,suffix:r,outputLen:n,rounds:i,enableXOF:s}=this;return e||(e=new b(t,r,n,s,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=r,e.outputLen=n,e.enableXOF=s,e.destroyed=this.destroyed,e}}let w=(0,s.hE)(()=>new b(136,1,32))},68104:function(e,t,r){"use strict";r.d(t,{kb:function(){return p},l1:function(){return c},eV:function(){return f},GL:function(){return o},iA:function(){return l},O6:function(){return y},np:function(){return a},O0:function(){return d},Jq:function(){return s},iY:function(){return h},hE:function(){return g}});let n="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0;var i=r(65376);let s=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),o=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),a=(e,t)=>e<<32-t|e>>>t,l=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],u=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255;function c(e){for(let t=0;t<e.length;t++)e[t]=u(e[t])}function h(e){if("string"!=typeof e)throw Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function d(e){return"string"==typeof e&&(e=h(e)),(0,i.aI)(e),e}function f(...e){let t=0;for(let r=0;r<e.length;r++){let n=e[r];(0,i.aI)(n),t+=n.length}let r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){let i=e[t];r.set(i,n),n+=i.length}return r}class p{clone(){return this._cloneInto()}}function g(e){let t=t=>e().update(d(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function y(e=32){if(n&&"function"==typeof n.getRandomValues)return n.getRandomValues(new Uint8Array(e));throw Error("crypto.getRandomValues must be defined")}},66517:function(e,t,r){"use strict";r.r(t),r.d(t,{Struct:function(){return u},StructError:function(){return n},any:function(){return A},array:function(){return k},assert:function(){return c},assign:function(){return g},bigint:function(){return C},boolean:function(){return I},coerce:function(){return J},create:function(){return h},date:function(){return x},defaulted:function(){return Y},define:function(){return y},deprecated:function(){return m},dynamic:function(){return v},empty:function(){return Z},enums:function(){return P},func:function(){return O},instance:function(){return T},integer:function(){return R},intersection:function(){return N},is:function(){return f},lazy:function(){return b},literal:function(){return D},map:function(){return B},mask:function(){return d},max:function(){return ee},min:function(){return et},never:function(){return M},nonempty:function(){return er},nullable:function(){return L},number:function(){return U},object:function(){return j},omit:function(){return w},optional:function(){return F},partial:function(){return _},pattern:function(){return en},pick:function(){return E},record:function(){return q},refine:function(){return es},regexp:function(){return H},set:function(){return z},size:function(){return ei},string:function(){return $},struct:function(){return S},trimmed:function(){return Q},tuple:function(){return V},type:function(){return W},union:function(){return G},unknown:function(){return K},validate:function(){return p}});
107class n extends TypeError{constructor(e,t){let r;let{message:n,explanation:i,...s}=e,{path:o}=e,a=0===o.length?n:`At path: ${o.join(".")} -- ${n}`;super(i??a),null!=i&&(this.cause=a),Object.assign(this,s),this.name=this.constructor.name,this.failures=()=>r??(r=[e,...t()])}}function i(e){return"object"==typeof e&&null!=e}function s(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1;let t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function o(e){return"symbol"==typeof e?e.toString():"string"==typeof e?JSON.stringify(e):`${e}`}function*a(e,t,r,n){var s;for(let a of(i(s=e)&&"function"==typeof s[Symbol.iterator]||(e=[e]),e)){let e=function(e,t,r,n){if(!0===e)return;!1===e?e={}:"string"==typeof e&&(e={message:e});let{path:i,branch:s}=t,{type:a}=r,{refinement:l,message:u=`Expected a value of type \`${a}\`${l?` with refinement \`${l}\``:""}, but received: \`${o(n)}\``}=e;return{value:n,type:a,refinement:l,key:i[i.length-1],path:i,branch:s,...e,message:u}}(a,t,r,n);e&&(yield e)}}function*l(e,t,r={}){let{path:n=[],branch:s=[e],coerce:o=!1,mask:a=!1}=r,u={path:n,branch:s};if(o&&(e=t.coercer(e,u),a&&"type"!==t.type&&i(t.schema)&&i(e)&&!Array.isArray(e)))for(let r in e)void 0===t.schema[r]&&delete e[r];let c="valid";for(let n of t.validator(e,u))n.explanation=r.message,c="not_valid",yield[n,void 0];for(let[h,d,f]of t.entries(e,u))for(let t of l(d,f,{path:void 0===h?n:[...n,h],branch:void 0===h?s:[...s,d],coerce:o,mask:a,message:r.message}))t[0]?(c=null!=t[0].refinement?"not_refined":"not_valid",yield[t[0],void 0]):o&&(d=t[1],void 0===h?e=d:e instanceof Map?e.set(h,d):e instanceof Set?e.add(d):i(e)&&(void 0!==d||h in e)&&(e[h]=d));if("not_valid"!==c)for(let n of t.refiner(e,u))n.explanation=r.message,c="not_refined",yield[n,void 0];"valid"===c&&(yield[void 0,e])}class u{constructor(e){let{type:t,schema:r,validator:n,refiner:i,coercer:s=e=>e,entries:o=function*(){}}=e;this.type=t,this.schema=r,this.entries=o,this.coercer=s,n?this.validator=(e,t)=>a(n(e,t),t,this,e):this.validator=()=>[],i?this.refiner=(e,t)=>a(i(e,t),t,this,e):this.refiner=()=>[]}assert(e,t){return c(e,this,t)}create(e,t){return h(e,this,t)}is(e){return f(e,this)}mask(e,t){return d(e,this,t)}validate(e,t={}){return p(e,this,t)}}function c(e,t,r){let n=p(e,t,{message:r});if(n[0])throw n[0]}function h(e,t,r){let n=p(e,t,{coerce:!0,message:r});if(!n[0])return n[1];throw n[0]}function d(e,t,r){let n=p(e,t,{coerce:!0,mask:!0,message:r});if(!n[0])return n[1];throw n[0]}function f(e,t){return!p(e,t)[0]}function p(e,t,r={}){let i=l(e,t,r),s=function(e){let{done:t,value:r}=e.next();return t?void 0:r}(i);return s[0]?[new n(s[0],function*(){for(let e of i)e[0]&&(yield e[0])}),void 0]:[void 0,s[1]]}function g(...e){let t="type"===e[0].type,r=Object.assign({},...e.map(e=>e.schema));return t?W(r):j(r)}function y(e,t){return new u({type:e,schema:null,validator:t})}function m(e,t){return new u({...e,refiner:(t,r)=>void 0===t||e.refiner(t,r),validator:(r,n)=>void 0===r||(t(r,n),e.validator(r,n))})}function v(e){return new u({type:"dynamic",schema:null,*entries(t,r){let n=e(t,r);yield*n.entries(t,r)},validator:(t,r)=>e(t,r).validator(t,r),coercer:(t,r)=>e(t,r).coercer(t,r),refiner:(t,r)=>e(t,r).refiner(t,r)})}function b(e){let t;return new u({type:"lazy",schema:null,*entries(r,n){t??(t=e()),yield*t.entries(r,n)},validator:(r,n)=>(t??(t=e()),t.validator(r,n)),coercer:(r,n)=>(t??(t=e()),t.coercer(r,n)),refiner:(r,n)=>(t??(t=e()),t.refiner(r,n))})}function w(e,t){let{schema:r}=e,n={...r};for(let e of t)delete n[e];return"type"===e.type?W(n):j(n)}function _(e){let t=e instanceof u,r=t?{...e.schema}:{...e};for(let e in r)r[e]=F(r[e]);return t&&"type"===e.type?W(r):j(r)}function E(e,t){let{schema:r}=e,n={};for(let e of t)n[e]=r[e];return"type"===e.type?W(n):j(n)}function S(e,t){return console.warn("[email protected] - The `struct` helper has been renamed to `define`."),y(e,t)}function A(){return y("any",()=>!0)}function k(e){return new u({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(let[r,n]of t.entries())yield[r,n,e]},coercer:e=>Array.isArray(e)?e.slice():e,validator:e=>Array.isArray(e)||`Expected an array value, but received: ${o(e)}`})}function C(){return y("bigint",e=>"bigint"==typeof e)}function I(){return y("boolean",e=>"boolean"==typeof e)}function x(){return y("date",e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${o(e)}`)}function P(e){let t={},r=e.map(e=>o(e)).join();for(let r of e)t[r]=r;return new u({type:"enums",schema:t,validator:t=>e.includes(t)||`Expected one of \`${r}\`, but received: ${o(t)}`})}function O(){return y("func",e=>"function"==typeof e||`Expected a function, but received: ${o(e)}`)}function T(e){return y("instance",t=>t instanceof e||`Expected a \`${e.name}\` instance, but received: ${o(t)}`)}function R(){return y("integer",e=>"number"==typeof e&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${o(e)}`)}function N(e){return new u({type:"intersection",schema:null,*entries(t,r){for(let n of e)yield*n.entries(t,r)}
107,*validator(t,r){for(let n of e)yield*n.validator(t,r)},*refiner(t,r){for(let n of e)yield*n.refiner(t,r)}})}function D(e){let t=o(e),r=typeof e;return new u({type:"literal",schema:"string"===r||"number"===r||"boolean"===r?e:null,validator:r=>r===e||`Expected the literal \`${t}\`, but received: ${o(r)}`})}function B(e,t){return new u({type:"map",schema:null,*entries(r){if(e&&t&&r instanceof Map)for(let[n,i]of r.entries())yield[n,n,e],yield[n,i,t]},coercer:e=>e instanceof Map?new Map(e):e,validator:e=>e instanceof Map||`Expected a \`Map\` object, but received: ${o(e)}`})}function M(){return y("never",()=>!1)}function L(e){return new u({...e,validator:(t,r)=>null===t||e.validator(t,r),refiner:(t,r)=>null===t||e.refiner(t,r)})}function U(){return y("number",e=>"number"==typeof e&&!isNaN(e)||`Expected a number, but received: ${o(e)}`)}function j(e){let t=e?Object.keys(e):[],r=M();return new u({type:"object",schema:e||null,*entries(n){if(e&&i(n)){let i=new Set(Object.keys(n));for(let r of t)i.delete(r),yield[r,n[r],e[r]];for(let e of i)yield[e,n[e],r]}},validator:e=>i(e)||`Expected an object, but received: ${o(e)}`,coercer:e=>i(e)?{...e}:e})}function F(e){return new u({...e,validator:(t,r)=>void 0===t||e.validator(t,r),refiner:(t,r)=>void 0===t||e.refiner(t,r)})}function q(e,t){return new u({type:"record",schema:null,*entries(r){if(i(r))for(let n in r){let i=r[n];yield[n,n,e],yield[n,i,t]}},validator:e=>i(e)||`Expected an object, but received: ${o(e)}`})}function H(){return y("regexp",e=>e instanceof RegExp)}function z(e){return new u({type:"set",schema:null,*entries(t){if(e&&t instanceof Set)for(let r of t)yield[r,r,e]},coercer:e=>e instanceof Set?new Set(e):e,validator:e=>e instanceof Set||`Expected a \`Set\` object, but received: ${o(e)}`})}function $(){return y("string",e=>"string"==typeof e||`Expected a string, but received: ${o(e)}`)}function V(e){let t=M();return new u({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){let n=Math.max(e.length,r.length);for(let i=0;i<n;i++)yield[i,r[i],e[i]||t]}},validator:e=>Array.isArray(e)||`Expected an array, but received: ${o(e)}`})}function W(e){let t=Object.keys(e);return new u({type:"type",schema:e,*entries(r){if(i(r))for(let n of t)yield[n,r[n],e[n]]},validator:e=>i(e)||`Expected an object, but received: ${o(e)}`,coercer:e=>i(e)?{...e}:e})}function G(e){let t=e.map(e=>e.type).join(" | ");return new u({type:"union",schema:null,coercer(t){for(let r of e){let[e,n]=r.validate(t,{coerce:!0});if(!e)return n}return t},validator(r,n){let i=[];for(let t of e){let[...e]=l(r,t,n),[s]=e;if(!s[0])return[];for(let[t]of e)t&&i.push(t)}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${o(r)}`,...i]}})}function K(){return y("unknown",()=>!0)}function J(e,t,r){return new u({...e,coercer:(n,i)=>f(n,t)?e.coercer(r(n,i),i):e.coercer(n,i)})}function Y(e,t,r={}){return J(e,K(),e=>{let n="function"==typeof t?t():t;if(void 0===e)return n;if(!r.strict&&s(e)&&s(n)){let t={...e},r=!1;for(let e in n)void 0===t[e]&&(t[e]=n[e],r=!0);if(r)return t}return e})}function Q(e){return J(e,$(),e=>e.trim())}function Z(e){return es(e,"empty",t=>{let r=X(t);return 0===r||`Expected an empty ${e.type} but received one with a size of \`${r}\``})}function X(e){return e instanceof Map||e instanceof Set?e.size:e.length}function ee(e,t,r={}){let{exclusive:n}=r;return es(e,"max",r=>n?r<t:r<=t||`Expected a ${e.type} less than ${n?"":"or equal to "}${t} but received \`${r}\``)}function et(e,t,r={}){let{exclusive:n}=r;return es(e,"min",r=>n?r>t:r>=t||`Expected a ${e.type} greater than ${n?"":"or equal to "}${t} but received \`${r}\``)}function er(e){return es(e,"nonempty",t=>X(t)>0||`Expected a nonempty ${e.type} but received an empty one`)}function en(e,t){return es(e,"pattern",r=>t.test(r)||`Expected a ${e.type} matching \`/${t.source}/\` but received "${r}"`)}function ei(e,t,r=t){let n=`Expected a ${e.type}`,i=t===r?`of \`${t}\``:`between \`${t}\` and \`${r}\``;return es(e,"size",e=>{if("number"==typeof e||e instanceof Date)return t<=e&&e<=r||`${n} ${i} but received \`${e}\``;if(e instanceof Map||e instanceof Set){let{size:s}=e;return t<=s&&s<=r||`${n} with a size ${i} but received one with a size of \`${s}\``}{let{length:s}=e;return t<=s&&s<=r||`${n} with a length ${i} but received one with a length of \`${s}\``}})}function es(e,t,r){return new u({...e,*refiner(n,i){for(let s of(yield*e.refiner(n,i),a(r(n,i),i,e,n)))yield{...s,refinement:t}}})}},48786:function(e,t,r){"use strict";r.d(t,{d:function(){return l}});var n=r(4456),i=r(42623),s=r(10639),o=r(22196),a=r(66021);function l(e,t={}){let{batch:r,fetchOptions:l,key:u="http",name:c="HTTP JSON-RPC",retryDelay:h}=t;return({chain:d,retryCount:f,timeout:p})=>{let{batchSize:g=1e3,wait:y=0}="object"==typeof r?r:{},m=t.retryCount??f,v=p??t.timeout??1e4,b=e||d?.rpcUrls.default.http[0];if(!b)throw new i.I;return(0,a.q)({key:u,name:c,async request({method:t,params:i}){let a={method:t,params:i},{schedule:u}=(0,s.S)({id:`${e}`,wait:y,shouldSplitBatch:e=>e.length>g,fn:e=>o.f4.http(b,{body:e,fetchOptions:l,timeout:v}),sort:(e,t)=>e.id-t.id}),c=async e=>r?u(e):[await o.f4.http(b,{body:e,fetchOptions:l,timeout:v})],[{error:h,result:d}]=await c(a);if(h)throw new n.bs({body:a,error:h,url:b});return d},retryCount:m,retryDelay:h,timeout:v,type:"http"},{fetchOptions:l,url:e})}}},42623:function(e,t,r){"use strict";r.d(t,{I:function(){return i}});var n=r(48926);class i extends n.G{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro"})}}},22196:function(e,t,r){"use strict";r.d(t,{hb:function(){return h},f4:function(){return d}});let n=function(){if("undefined"!=typeof WebSocket)return WebSocket;if(void 0!==global.WebSocket)return global.WebSocket;if(void 0!==window.WebSocket)return window.WebSocket;if(void 0!==self.WebSocket)return self.WebSocket;throw Error("`WebSocket` is not supported in this environment")}();var i=r(4456),s=r(10639);function o(e,{errorInstance:t=Error("timed out"),timeout:r,signal:n}){return new Promise((i,s)=>{(async()=>{let o;try{let a=new AbortController;r>0&&(o=setTimeout(()=>{n?a.abort():s(t)},r)),i(await e({signal:a?.signal}))}catch(e){"AbortError"===e.name&&s(t),s(e)}finally{clearTimeout(o)}})()})}var a=r(47499);let l=0;async function u(e,{body:t,fetchOptions:r={},timeout:n=1e4}){let{headers:s,method:u,signal:c}=r;try{let h;let d=await o(async({signal:i})=>await fetch(e,{...r,body:Array.isArray(t)?(0,a.P)(t.map(e=>({jsonrpc:"2.0",id:e.id??l++,...e}
107))):(0,a.P)({jsonrpc:"2.0",id:t.id??l++,...t}),headers:{...s,"Content-Type":"application/json"},method:u||"POST",signal:c||(n>0?i:void 0)}),{errorInstance:new i.W5({body:t,url:e}),timeout:n,signal:!0});if(h=d.headers.get("Content-Type")?.startsWith("application/json")?await d.json():await d.text(),!d.ok)throw new i.Gg({body:t,details:(0,a.P)(h.error)||d.statusText,headers:d.headers,status:d.status,url:e});return h}catch(r){if(r instanceof i.Gg||r instanceof i.W5)throw r;throw new i.Gg({body:t,details:r.message,url:e})}}let c=new Map;async function h(e){let t=c.get(e);if(t)return t;let{schedule:r}=(0,s.S)({id:e,fn:async()=>{let r=new n(e),i=new Map,s=new Map,o=({data:e})=>{let t=JSON.parse(e),r="eth_subscription"===t.method,n=r?t.params.subscription:t.id,o=r?s:i,a=o.get(n);a&&a({data:e}),r||o.delete(n)},a=()=>{c.delete(e),r.removeEventListener("close",a),r.removeEventListener("message",o)};return r.addEventListener("close",a),r.addEventListener("message",o),r.readyState===n.CONNECTING&&await new Promise((e,t)=>{r&&(r.onopen=e,r.onerror=t)}),t=Object.assign(r,{requests:i,subscriptions:s}),c.set(e,t),[t]}}),[i,[o]]=await r();return o}let d={http:u,webSocket:function(e,{body:t,onResponse:r}){if(e.readyState===e.CLOSED||e.readyState===e.CLOSING)throw new i.c9({body:t,url:e.url,details:"Socket is closed."});let n=l++,s=({data:i})=>{let o=JSON.parse(i);("number"!=typeof o.id||n===o.id)&&(r?.(o),"eth_subscribe"===t.method&&"string"==typeof o.result&&e.subscriptions.set(o.result,s),"eth_unsubscribe"===t.method&&e.subscriptions.delete(t.params?.[0]))};return e.requests.set(n,s),e.send(JSON.stringify({jsonrpc:"2.0",...t,id:n})),e},webSocketAsync:async function(e,{body:t,timeout:r=1e4}){return o(()=>new Promise(r=>d.webSocket(e,{body:t,onResponse:r})),{errorInstance:new i.W5({body:t,url:e.url}),timeout:r})}}},24416:function(e,t,r){"use strict";r.d(t,{X:function(){return o}});var n=r(38999),i=r(21019),s=r(95046);function o({r:e,s:t,v:r}){return`0x${new n.kA.Signature((0,i.y_)(e),(0,i.y_)(t)).toCompactHex()}${(0,s.NC)(r).slice(2)}`}},99688:function(e,t,r){"use strict";r.d(t,{OP:function(){return g},PS:function(){return b},U_:function(){return f},Us:function(){return w},gN:function(){return m},kK:function(){return y},oA:function(){return d},wQ:function(){return h}});var n=r(38078);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */let i=BigInt(0),s=BigInt(1),o=BigInt(2),a=BigInt(3),l=BigInt(4),u=BigInt(5),c=BigInt(8);function h(e,t){let r=e%t;return r>=i?r:t+r}function d(e,t,r){let n=e;for(;t-- >i;)n*=n,n%=r;return n}function f(e,t){if(e===i||t<=i)throw Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=h(e,t),n=t,o=i,a=s,l=s,u=i;for(;r!==i;){let e=n/r,t=n%r,i=o-l*e,s=a-u*e;n=r,r=t,o=l,a=u,l=i,u=s}if(n!==s)throw Error("invert: does not exist");return h(o,t)}BigInt(9),BigInt(16);let p=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function g(e){let t=p.reduce((e,t)=>(e[t]="function",e),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});return(0,n.FF)(e,t)}function y(e,t){let r=void 0!==t?t:e.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function m(e,t,r=!1,d={}){if(e<=i)throw Error(`Expected Field ORDER > 0, got ${e}`);let{nBitLength:p,nByteLength:g}=y(e,t);if(g>2048)throw Error("Field lengths over 2048 bytes are not supported");let m=function(e){if(e%l===a){let t=(e+s)/l;return function(e,r){let n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw Error("Cannot find square root");return n}}if(e%c===u){let t=(e-u)/c;return function(e,r){let n=e.mul(r,o),i=e.pow(n,t),s=e.mul(r,i),a=e.mul(e.mul(s,o),i),l=e.mul(s,e.sub(a,e.ONE));if(!e.eql(e.sqr(l),r))throw Error("Cannot find square root");return l}}return function(e){let t,r,n;let a=(e-s)/o;for(t=e-s,r=0;t%o===i;t/=o,r++);for(n=o;n<e&&function(e,t,r){if(r<=i||t<i)throw Error("Expected power/modulo > 0");if(r===s)return i;let n=s;for(;t>i;)t&s&&(n=n*e%r),e=e*e%r,t>>=s;return n}(n,a,e)!==e-s;n++);if(1===r){let t=(e+s)/l;return function(e,r){let n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw Error("Cannot find square root");return n}}let u=(t+s)/o;return function(e,i){if(e.pow(i,a)===e.neg(e.ONE))throw Error("Cannot find square root");let o=r,l=e.pow(e.mul(e.ONE,n),t),c=e.pow(i,u),h=e.pow(i,t);for(;!e.eql(h,e.ONE);){if(e.eql(h,e.ZERO))return e.ZERO;let t=1;for(let r=e.sqr(h);t<o&&!e.eql(r,e.ONE);t++)r=e.sqr(r);let r=e.pow(l,s<<BigInt(o-t-1));l=e.sqr(r),c=e.mul(c,r),h=e.mul(h,l),o=t}return c}}(e)}(e),v=Object.freeze({ORDER:e,BITS:p,BYTES:g,MASK:(0,n.dQ)(p),ZERO:i,ONE:s,create:t=>h(t,e),isValid:t=>{if("bigint"!=typeof t)throw Error(`Invalid field element: expected bigint, got ${typeof t}`);return i<=t&&t<e},is0:e=>e===i,isOdd:e=>(e&s)===s,neg:t=>h(-t,e),eql:(e,t)=>
107e===t,sqr:t=>h(t*t,e),add:(t,r)=>h(t+r,e),sub:(t,r)=>h(t-r,e),mul:(t,r)=>h(t*r,e),pow:(e,t)=>(function(e,t,r){if(r<i)throw Error("Expected power > 0");if(r===i)return e.ONE;if(r===s)return t;let n=e.ONE,o=t;for(;r>i;)r&s&&(n=e.mul(n,o)),o=e.sqr(o),r>>=s;return n})(v,e,t),div:(t,r)=>h(t*f(r,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>f(t,e),sqrt:d.sqrt||(e=>m(v,e)),invertBatch:e=>(function(e,t){let r=Array(t.length),n=t.reduce((t,n,i)=>e.is0(n)?t:(r[i]=t,e.mul(t,n)),e.ONE),i=e.inv(n);return t.reduceRight((t,n,i)=>e.is0(n)?t:(r[i]=e.mul(t,r[i]),e.mul(t,n)),i),r})(v,e),cmov:(e,t,r)=>r?t:e,toBytes:e=>r?(0,n.S5)(e,g):(0,n.tL)(e,g),fromBytes:e=>{if(e.length!==g)throw Error(`Fp.fromBytes: expected ${g}, got ${e.length}`);return r?(0,n.ty)(e):(0,n.bytesToNumberBE)(e)}});return Object.freeze(v)}function v(e){if("bigint"!=typeof e)throw Error("field order must be bigint");return Math.ceil(e.toString(2).length/8)}function b(e){let t=v(e);return t+Math.ceil(t/2)}function w(e,t,r=!1){let i=e.length,o=v(t),a=b(t);if(i<16||i<a||i>1024)throw Error(`expected ${a}-1024 bytes of input, got ${i}`);let l=h(r?(0,n.bytesToNumberBE)(e):(0,n.ty)(e),t-s)+s;return r?(0,n.S5)(l,o):(0,n.tL)(l,o)}},38999:function(e,t,r){"use strict";r.d(t,{kA:function(){return S}});var n=r(51265),i=r(99688),s=r(67463),o=r(12403),a=r(38078);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */let l=BigInt(0),u=BigInt(1);function c(e){return(0,i.OP)(e.Fp),(0,a.FF)(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,i.kK)(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}let{bytesToNumberBE:h,hexToBytes:d}=a,f={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(e){let{Err:t}=f;if(e.length<2||2!==e[0])throw new t("Invalid signature integer tag");let r=e[1],n=e.subarray(2,r+2);if(!r||n.length!==r)throw new t("Invalid signature integer: wrong length");if(128&n[0])throw new t("Invalid signature integer: negative");if(0===n[0]&&!(128&n[1]))throw new t("Invalid signature integer: unnecessary leading zero");return{d:h(n),l:e.subarray(r+2)}},toSig(e){let{Err:t}=f,r="string"==typeof e?d(e):e;if(!(r instanceof Uint8Array))throw Error("ui8a expected");let n=r.length;if(n<2||48!=r[0])throw new t("Invalid signature tag");if(r[1]!==n-2)throw new t("Invalid signature: incorrect length");let{d:i,l:s}=f._parseInt(r.subarray(2)),{d:o,l:a}=f._parseInt(s);if(a.length)throw new t("Invalid signature: left bytes after parsing");return{r:i,s:o}},hexFromSig(e){let t=e=>8&Number.parseInt(e[0],16)?"00"+e:e,r=e=>{let t=e.toString(16);return 1&t.length?`0${t}`:t},n=t(r(e.s)),i=t(r(e.r)),s=n.length/2,o=i.length/2,a=r(s),l=r(o);return`30${r(o+s+4)}02${l}${i}02${a}${n}`}},p=BigInt(0),g=BigInt(1),y=(BigInt(2),BigInt(3));BigInt(4);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */let m=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),v=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),b=BigInt(1),w=BigInt(2),_=(e,t)=>(e+t/w)/t,E=(0,i.gN)(m,void 0,void 0,{sqrt:function(e){let t=BigInt(3),r=BigInt(6),n=BigInt(11),s=BigInt(22),o=BigInt(23),a=BigInt(44),l=BigInt(88),u=e*e*e%m,c=u*u*e%m,h=(0,i.oA)(c,t,m)*c%m,d=(0,i.oA)(h,t,m)*c%m,f=(0,i.oA)(d,w,m)*u%m,p=(0,i.oA)(f,n,m)*f%m,g=(0,i.oA)(p,s,m)*p%m,y=(0,i.oA)(g,a,m)*g%m,v=(0,i.oA)(y,l,m)*y%m,b=(0,i.oA)(v,a,m)*g%m,_=(0,i.oA)(b,t,m)*c%m,S=(0,i.oA)(_,o,m)*p%m,A=(0,i.oA)(S,r,m)*u%m,k=(0,i.oA)(A,w,m);if(!E.eql(E.sqr(k),e))throw Error("Cannot find square root");return k}}),S=function(e,t){let r=t=>(function(e){let t=function(e){let t=c(e);return a.FF(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}(e),{Fp:r,n:n}=t,s=r.BYTES+1,o=2*r.BYTES+1;function h(e){return i.wQ(e,n)}function d(e){return i.U_(e,n)}let{ProjectivePoint:m,normPrivateKeyToScalar:v,weierstrassEquation:b,isWithinCurveOrder:w}=function(e){let t=/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function(e){let t=c(e);a.FF(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:r,Fp:n,a:i}=t;if(r){if(!n.eql(i,n.ZERO))throw Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!=typeof r||"bigint"!=typeof r.beta||"function"!=typeof r.splitScalar)throw Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}(e),{Fp:r}=t,n=t.toBytes||((e,t,n)=>{let i=t.toAffine();return a.eV(Uint8Array.from([4]),r.toBytes(i.x),r.toBytes(i.y))}),s=t.fromBytes||(e=>{let t=e.subarray(1);return{x:r.fromBytes(t.subarray(0,r.BYTES)),y:r.fromBytes(t.subarray(r.BYTES,2*r.BYTES))}});function o(e){let{a:n,b:i}
107=t,s=r.sqr(e),o=r.mul(s,e);return r.add(r.add(o,r.mul(e,n)),i)}if(!r.eql(r.sqr(t.Gy),o(t.Gx)))throw Error("bad generator point: equation left != right");function h(e){return"bigint"==typeof e&&p<e&&e<t.n}function d(e){if(!h(e))throw Error("Expected valid bigint: 0 < bigint < curve.n")}function f(e){let r;let{allowedPrivateKeyLengths:n,nByteLength:s,wrapPrivateKey:o,n:l}=t;if(n&&"bigint"!=typeof e){if(e instanceof Uint8Array&&(e=a.ci(e)),"string"!=typeof e||!n.includes(e.length))throw Error("Invalid key");e=e.padStart(2*s,"0")}try{r="bigint"==typeof e?e:a.bytesToNumberBE((0,a.ql)("private key",e,s))}catch(t){throw Error(`private key must be ${s} bytes, hex or bigint, not ${typeof e}`)}return o&&(r=i.wQ(r,l)),d(r),r}let m=new Map;function v(e){if(!(e instanceof b))throw Error("ProjectivePoint expected")}class b{constructor(e,t,n){if(this.px=e,this.py=t,this.pz=n,null==e||!r.isValid(e))throw Error("x required");if(null==t||!r.isValid(t))throw Error("y required");if(null==n||!r.isValid(n))throw Error("z required")}static fromAffine(e){let{x:t,y:n}=e||{};if(!e||!r.isValid(t)||!r.isValid(n))throw Error("invalid affine point");if(e instanceof b)throw Error("projective point not allowed");let i=e=>r.eql(e,r.ZERO);return i(t)&&i(n)?b.ZERO:new b(t,n,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){let t=r.invertBatch(e.map(e=>e.pz));return e.map((e,r)=>e.toAffine(t[r])).map(b.fromAffine)}static fromHex(e){let t=b.fromAffine(s((0,a.ql)("pointHex",e)));return t.assertValidity(),t}static fromPrivateKey(e){return b.BASE.multiply(f(e))}_setWindowSize(e){this._WINDOW_SIZE=e,m.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&!r.is0(this.py))return;throw Error("bad point: ZERO")}let{x:e,y:n}=this.toAffine();if(!r.isValid(e)||!r.isValid(n))throw Error("bad point: x or y not FE");let i=r.sqr(n),s=o(e);if(!r.eql(i,s))throw Error("bad point: equation left != right");if(!this.isTorsionFree())throw Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y:e}=this.toAffine();if(r.isOdd)return!r.isOdd(e);throw Error("Field doesn't support isOdd")}equals(e){v(e);let{px:t,py:n,pz:i}=this,{px:s,py:o,pz:a}=e,l=r.eql(r.mul(t,a),r.mul(s,i)),u=r.eql(r.mul(n,a),r.mul(o,i));return l&&u}negate(){return new b(this.px,r.neg(this.py),this.pz)}double(){let{a:e,b:n}=t,i=r.mul(n,y),{px:s,py:o,pz:a}=this,l=r.ZERO,u=r.ZERO,c=r.ZERO,h=r.mul(s,s),d=r.mul(o,o),f=r.mul(a,a),p=r.mul(s,o);return p=r.add(p,p),c=r.mul(s,a),c=r.add(c,c),l=r.mul(e,c),u=r.mul(i,f),u=r.add(l,u),l=r.sub(d,u),u=r.add(d,u),u=r.mul(l,u),l=r.mul(p,l),c=r.mul(i,c),f=r.mul(e,f),p=r.sub(h,f),p=r.mul(e,p),p=r.add(p,c),c=r.add(h,h),h=r.add(c,h),h=r.add(h,f),h=r.mul(h,p),u=r.add(u,h),f=r.mul(o,a),f=r.add(f,f),h=r.mul(f,p),l=r.sub(l,h),c=r.mul(f,d),c=r.add(c,c),new b(l,u,c=r.add(c,c))}add(e){v(e);let{px:n,py:i,pz:s}=this,{px:o,py:a,pz:l}=e,u=r.ZERO,c=r.ZERO,h=r.ZERO,d=t.a,f=r.mul(t.b,y),p=r.mul(n,o),g=r.mul(i,a),m=r.mul(s,l),w=r.add(n,i),_=r.add(o,a);w=r.mul(w,_),_=r.add(p,g),w=r.sub(w,_),_=r.add(n,s);let E=r.add(o,l);return _=r.mul(_,E),E=r.add(p,m),_=r.sub(_,E),E=r.add(i,s),u=r.add(a,l),E=r.mul(E,u),u=r.add(g,m),E=r.sub(E,u),h=r.mul(d,_),u=r.mul(f,m),h=r.add(u,h),u=r.sub(g,h),h=r.add(g,h),c=r.mul(u,h),g=r.add(p,p),g=r.add(g,p),m=r.mul(d,m),_=r.mul(f,_),g=r.add(g,m),m=r.sub(p,m),m=r.mul(d,m),_=r.add(_,m),p=r.mul(g,_),c=r.add(c,p),p=r.mul(E,_),u=r.mul(w,u),u=r.sub(u,p),p=r.mul(w,g),h=r.mul(E,h),new b(u,c,h=r.add(h,p))}subtract(e){return this.add(e.negate())}is0(){return this.equals(b.ZERO)}wNAF(e){return _.wNAFCached(this,m,e,e=>{let t=r.invertBatch(e.map(e=>e.pz));return e.map((e,r)=>e.toAffine(t[r])).map(b.fromAffine)})}multiplyUnsafe(e){let n=b.ZERO;if(e===p)return n;if(d(e),e===g)return this;let{endo:i}=t;if(!i)return _.unsafeLadder(this,e);let{k1neg:s,k1:o,k2neg:a,k2:l}=i.splitScalar(e),u=n,c=n,h=this;for(;o>p||l>p;)o&g&&(u=u.add(h)),l&g&&(c=c.add(h)),h=h.double(),o>>=g,l>>=g;return s&&(u=u.negate()),a&&(c=c.negate()),c=new b(r.mul(c.px,i.beta),c.py,c.pz),u.add(c)}multiply(e){let n,i;d(e);let{endo:s}=t;if(s){let{k1neg:t,k1:o,k2neg:a,k2:l}=s.splitScalar(e),{p:u,f:c}=this.wNAF(o),{p:h,f:d}=this.wNAF(l);u=_.constTimeNegate(t,u),h=_.constTimeNegate(a,h),h=new b(r.mul(h.px,s.beta),h.py,h.pz),n=u.add(h),i=c.add(d)}else{let{p:t,f:r}=this.wNAF(e);n=t,i=r}return b.normalizeZ([n,i])[0]}multiplyAndAddUnsafe(e,t,r){let n=b.BASE,i=(e,t)=>t!==p&&t!==g&&e.equals(n)?e.multiply(t):e.multiplyUnsafe(t),s=i(this,t).add(i(e,r));return s.is0()?void 0:s}toAffine(e){let{px:t,py:n,pz:i}=this,s=this.is0();null==e&&(e=s?r.ONE:r.inv(i));let o=r.mul(t,e),a=r.mul(n,e),l=r.mul(i,e);if(s)return{x:r.ZERO,y:r.ZERO};
107if(!r.eql(l,r.ONE))throw Error("invZ was invalid");return{x:o,y:a}}isTorsionFree(){let{h:e,isTorsionFree:r}=t;if(e===g)return!0;if(r)return r(b,this);throw Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:e,clearCofactor:r}=t;return e===g?this:r?r(b,this):this.multiplyUnsafe(t.h)}toRawBytes(e=!0){return this.assertValidity(),n(b,this,e)}toHex(e=!0){return a.ci(this.toRawBytes(e))}}b.BASE=new b(t.Gx,t.Gy,r.ONE),b.ZERO=new b(r.ZERO,r.ONE,r.ZERO);let w=t.nBitLength,_=function(e,t){let r=(e,t)=>{let r=t.negate();return e?r:t},n=e=>({windows:Math.ceil(t/e)+1,windowSize:2**(e-1)});return{constTimeNegate:r,unsafeLadder(t,r){let n=e.ZERO,i=t;for(;r>l;)r&u&&(n=n.add(i)),i=i.double(),r>>=u;return n},precomputeWindow(e,t){let{windows:r,windowSize:i}=n(t),s=[],o=e,a=o;for(let e=0;e<r;e++){a=o,s.push(a);for(let e=1;e<i;e++)a=a.add(o),s.push(a);o=a.double()}return s},wNAF(t,i,s){let{windows:o,windowSize:a}=n(t),l=e.ZERO,c=e.BASE,h=BigInt(2**t-1),d=2**t,f=BigInt(t);for(let e=0;e<o;e++){let t=e*a,n=Number(s&h);s>>=f,n>a&&(n-=d,s+=u);let o=t+Math.abs(n)-1,p=e%2!=0,g=n<0;0===n?c=c.add(r(p,i[t])):l=l.add(r(g,i[o]))}return{p:l,f:c}},wNAFCached(e,t,r,n){let i=e._WINDOW_SIZE||1,s=t.get(e);return s||(s=this.precomputeWindow(e,i),1!==i&&t.set(e,n(s))),this.wNAF(i,s,r)}}}(b,t.endo?Math.ceil(w/2):w);return{CURVE:t,ProjectivePoint:b,normPrivateKeyToScalar:f,weierstrassEquation:o,isWithinCurveOrder:h}}({...t,toBytes(e,t,n){let i=t.toAffine(),s=r.toBytes(i.x),o=a.eV;return n?o(Uint8Array.from([t.hasEvenY()?2:3]),s):o(Uint8Array.from([4]),s,r.toBytes(i.y))},fromBytes(e){let t=e.length,n=e[0],i=e.subarray(1);if(t===s&&(2===n||3===n)){let e=a.bytesToNumberBE(i);if(!(p<e&&e<r.ORDER))throw Error("Point is not on curve");let t=b(e),s=r.sqrt(t);return(1&n)==1!=((s&g)===g)&&(s=r.neg(s)),{x:e,y:s}}if(t===o&&4===n)return{x:r.fromBytes(i.subarray(0,r.BYTES)),y:r.fromBytes(i.subarray(r.BYTES,2*r.BYTES))};throw Error(`Point of length ${t} was invalid. Expected ${s} compressed bytes or ${o} uncompressed bytes`)}}),_=e=>a.ci(a.tL(e,t.nByteLength)),E=(e,t,r)=>a.bytesToNumberBE(e.slice(t,r));class S{constructor(e,t,r){this.r=e,this.s=t,this.recovery=r,this.assertValidity()}static fromCompact(e){let r=t.nByteLength;return new S(E(e=(0,a.ql)("compactSignature",e,2*r),0,r),E(e,r,2*r))}static fromDER(e){let{r:t,s:r}=f.toSig((0,a.ql)("DER",e));return new S(t,r)}assertValidity(){if(!w(this.r))throw Error("r must be 0 < r < CURVE.n");if(!w(this.s))throw Error("s must be 0 < s < CURVE.n")}addRecoveryBit(e){return new S(this.r,this.s,e)}recoverPublicKey(e){let{r:n,s:i,recovery:s}=this,o=C((0,a.ql)("msgHash",e));if(null==s||![0,1,2,3].includes(s))throw Error("recovery id invalid");let l=2===s||3===s?n+t.n:n;if(l>=r.ORDER)throw Error("recovery id 2 or 3 invalid");let u=(1&s)==0?"02":"03",c=m.fromHex(u+_(l)),f=d(l),p=h(-o*f),g=h(i*f),y=m.BASE.multiplyAndAddUnsafe(c,p,g);if(!y)throw Error("point at infinify");return y.assertValidity(),y}hasHighS(){return this.s>n>>g}normalizeS(){return this.hasHighS()?new S(this.r,h(-this.s),this.recovery):this}toDERRawBytes(){return a.hexToBytes(this.toDERHex())}toDERHex(){return f.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return a.hexToBytes(this.toCompactHex())}toCompactHex(){return _(this.r)+_(this.s)}}function A(e){let t=e instanceof Uint8Array,r="string"==typeof e,n=(t||r)&&e.length;return t?n===s||n===o:r?n===2*s||n===2*o:e instanceof m}let k=t.bits2int||function(e){let r=a.bytesToNumberBE(e),n=8*e.length-t.nBitLength;return n>0?r>>BigInt(n):r},C=t.bits2int_modN||function(e){return h(k(e))},I=a.dQ(t.nBitLength);function x(e){if("bigint"!=typeof e)throw Error("bigint expected");if(!(p<=e&&e<I))throw Error(`bigint expected < 2^${t.nBitLength}`);return a.tL(e,t.nByteLength)}let P={lowS:t.lowS,prehash:!1},O={lowS:t.lowS,prehash:!1};return m.BASE._setWindowSize(8),{CURVE:t,getPublicKey:function(e,t=!0){return m.fromPrivateKey(e).toRawBytes(t)},getSharedSecret:function(e,t,r=!0){if(A(e))throw Error("first arg must be private key");if(!A(t))throw Error("second arg must be public key");return m.fromHex(t).multiply(v(e)).toRawBytes(r)},sign:function(e,i,s=P){let{seed:o,k2sig:l}=function(e,i,s=P){if(["recovered","canonical"].some(e=>e in s))throw Error("sign() legacy options not supported");let{hash:o,randomBytes:l}=t,{lowS:u,prehash:c,extraEntropy:f}=s;
107null==u&&(u=!0),e=(0,a.ql)("msgHash",e),c&&(e=(0,a.ql)("prehashed msgHash",o(e)));let y=C(e),b=v(i),_=[x(b),x(y)];if(null!=f){let e=!0===f?l(r.BYTES):f;_.push((0,a.ql)("extraEntropy",e))}return{seed:a.eV(..._),k2sig:function(e){let t=k(e);if(!w(t))return;let r=d(t),i=m.BASE.multiply(t).toAffine(),s=h(i.x);if(s===p)return;let o=h(r*h(y+s*b));if(o===p)return;let a=(i.x===s?0:2)|Number(i.y&g),l=o;if(u&&o>n>>g)l=o>n>>g?h(-o):o,a^=1;return new S(s,l,a)}}}(e,i,s);return a.n$(t.hash.outputLen,t.nByteLength,t.hmac)(o,l)},verify:function(e,r,n,i=O){let s,o;if(r=(0,a.ql)("msgHash",r),n=(0,a.ql)("publicKey",n),"strict"in i)throw Error("options.strict was renamed to lowS");let{lowS:l,prehash:u}=i;try{if("string"==typeof e||e instanceof Uint8Array)try{o=S.fromDER(e)}catch(t){if(!(t instanceof f.Err))throw t;o=S.fromCompact(e)}else if("object"==typeof e&&"bigint"==typeof e.r&&"bigint"==typeof e.s){let{r:t,s:r}=e;o=new S(t,r)}else throw Error("PARSE");s=m.fromHex(n)}catch(e){if("PARSE"===e.message)throw Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(l&&o.hasHighS())return!1;u&&(r=t.hash(r));let{r:c,s:p}=o,g=C(r),y=d(p),v=h(g*y),b=h(c*y),w=m.BASE.multiplyAndAddUnsafe(s,v,b)?.toAffine();return!!w&&h(w.x)===c},ProjectivePoint:m,Signature:S,utils:{isValidPrivateKey(e){try{return v(e),!0}catch(e){return!1}},normPrivateKeyToScalar:v,randomPrivateKey:()=>{let e=i.PS(t.n);return i.Us(t.randomBytes(e),t.n)},precompute:(e=8,t=m.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)}}})({...e,hash:t,hmac:(e,...r)=>(0,s.b)(t,e,(0,o.eV)(...r)),randomBytes:o.O6});return Object.freeze({...r(t),create:r})}({a:BigInt(0),b:BigInt(7),Fp:E,n:v,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{let t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-b*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),n=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=BigInt("0x100000000000000000000000000000000"),o=_(t*e,v),a=_(-r*e,v),l=(0,i.wQ)(e-o*t-a*n,v),u=(0,i.wQ)(-o*r-a*t,v),c=l>s,h=u>s;if(c&&(l=v-l),h&&(u=v-u),l>s||u>s)throw Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:c,k1:l,k2neg:h,k2:u}}}},n.J);BigInt(0),S.ProjectivePoint},20137:function(e,t,r){"use strict";r.d(t,{N:function(){return s}});var n=r(95861),i=r(12403);class s extends i.kb{constructor(e,t,r,n){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,i.GL)(this.buffer)}update(e){(0,n.Gg)(this);let{view:t,buffer:r,blockLen:s}=this,o=(e=(0,i.O0)(e)).length;for(let n=0;n<o;){let a=Math.min(s-this.pos,o-n);if(a===s){let t=(0,i.GL)(e);for(;s<=o-n;n+=s)this.process(t,n);continue}r.set(e.subarray(n,n+a),this.pos),this.pos+=a,n+=a,this.pos===s&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,n.Gg)(this),(0,n.J8)(e,this),this.finished=!0;let{buffer:t,view:r,blockLen:s,isLE:o}=this,{pos:a}=this;t[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>s-a&&(this.process(r,0),a=0);for(let e=a;e<s;e++)t[e]=0;!function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);let i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),l=n?4:0,u=n?0:4;e.setUint32(t+l,o,n),e.setUint32(t+u,a,n)}(r,s-8,BigInt(8*this.length),o),this.process(r,0);let l=(0,i.GL)(e),u=this.outputLen;if(u%4)throw Error("_sha2: outputLen should be aligned to 32bit");let c=u/4,h=this.get();if(c>h.length)throw Error("_sha2: outputLen bigger than state");for(let e=0;e<c;e++)l.setUint32(4*e,h[e],o)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:t,buffer:r,length:n,finished:i,destroyed:s,pos:o}=this;return e.length=n,e.pos=o,e.finished=i,e.destroyed=s,n%t&&e.buffer.set(r),e}}},67463:function(e,t,r){"use strict";r.d(t,{b:function(){return o}});var n=r(95861),i=r(12403);class s extends i.kb{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,(0,n.vp)(e);let r=(0,i.O0)(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let s=this.blockLen,o=new Uint8Array(s);o.set(r.length>s?e.create().update(r).digest():r);for(let e=0;e<o.length;e++)o[e]^=54;this.iHash.update(o),this.oHash=e.create();for(let e=0;e<o.length;e++)o[e]^=106;this.oHash.update(o),o.fill(0)}update(e){return(0,n.Gg)(this),this.iHash.update(e),this}digestInto(e){(0,n.Gg)(this),(0,n.aI)(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));let{oHash:t,iHash:r,finished:n,destroyed:i,blockLen:s,outputLen:o}=this;return e.finished=n,e.destroyed=i,e.blockLen=s,e.outputLen=o,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}let o=(e,t,r)=>new s(e,t).update(r).digest();o.create=(e,t)=>
107new s(e,t)},51265:function(e,t,r){"use strict";r.d(t,{J:function(){return h}});var n=r(20137),i=r(12403);let s=(e,t,r)=>e&t^~e&r,o=(e,t,r)=>e&t^e&r^t&r,a=new Uint32Array([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]),l=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),u=new Uint32Array(64);class c extends n.N{constructor(){super(64,32,8,!1),this.A=0|l[0],this.B=0|l[1],this.C=0|l[2],this.D=0|l[3],this.E=0|l[4],this.F=0|l[5],this.G=0|l[6],this.H=0|l[7]}get(){let{A:e,B:t,C:r,D:n,E:i,F:s,G:o,H:a}=this;return[e,t,r,n,i,s,o,a]}set(e,t,r,n,i,s,o,a){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|s,this.G=0|o,this.H=0|a}process(e,t){for(let r=0;r<16;r++,t+=4)u[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=u[e-15],r=u[e-2],n=(0,i.np)(t,7)^(0,i.np)(t,18)^t>>>3,s=(0,i.np)(r,17)^(0,i.np)(r,19)^r>>>10;u[e]=s+u[e-7]+n+u[e-16]|0}let{A:r,B:n,C:l,D:c,E:h,F:d,G:f,H:p}=this;for(let e=0;e<64;e++){let t=p+((0,i.np)(h,6)^(0,i.np)(h,11)^(0,i.np)(h,25))+s(h,d,f)+a[e]+u[e]|0,g=((0,i.np)(r,2)^(0,i.np)(r,13)^(0,i.np)(r,22))+o(r,n,l)|0;p=f,f=d,d=h,h=c+t|0,c=l,l=n,n=r,r=t+g|0}r=r+this.A|0,n=n+this.B|0,l=l+this.C|0,c=c+this.D|0,h=h+this.E|0,d=d+this.F|0,f=f+this.G|0,p=p+this.H|0,this.set(r,n,l,c,h,d,f,p)}roundClean(){u.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}let h=(0,i.hE)(()=>new c)}}]);

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