@dcl/shop 0.1.0-29030398160.commit-dedc8ac → 0.1.0-29111888971.commit-e1b927a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/{AnimatedBackground-8aI4vJAl.js → AnimatedBackground-XZF9g9Bk.js} +3 -3
- package/assets/{Assets-O86HcPf_.js → Assets-CZPTo1jO.js} +1 -1
- package/assets/{Button-D1faXtxc.js → Button-B2TDtyup.js} +1 -1
- package/assets/{Cart-wT4YY2XB.js → Cart-DhU4_S6H.js} +1 -1
- package/assets/{CircularProgress-ByISsJtD.js → CircularProgress-Cf__730y.js} +1 -1
- package/assets/{Collection-B-SrzrlP.js → Collection-CRBxkkqX.js} +1 -1
- package/assets/{Creator-3SRIb5GI.js → Creator-DO__19RD.js} +1 -1
- package/assets/{ExchangeController-CtvD9TxU.js → ExchangeController-txwSQL2Z.js} +1 -1
- package/assets/{GetCredits-BntbDm9-.js → GetCredits-DS1z5pyp.js} +2 -2
- package/assets/{HelpersUtil-zGctDzqI.js → HelpersUtil-CMysbO5y.js} +1 -1
- package/assets/{ImportListings-DvqpDa-s.js → ImportListings-ChNZ2UwM.js} +1 -1
- package/assets/{ItemDetail-CjSWRE3L.js → ItemDetail-Do5cjFW8.js} +2 -2
- package/assets/{Market-Hqywp2wQ.js → Market-Z4jp-uLb.js} +1 -1
- package/assets/{MenuItem-BzIPsU3-.js → MenuItem-B4U0TYKf.js} +1 -1
- package/assets/{MyAssets-nfsXXyUv.js → MyAssets-C7QdtDYF.js} +1 -1
- package/assets/{MyFavorites-B6_8hr5-.js → MyFavorites-Bu2IDcdJ.js} +1 -1
- package/assets/{MyPurchases-33hyTefC.js → MyPurchases-CDUC3XzQ.js} +1 -1
- package/assets/{NotFound-DXluG5-7.js → NotFound-D5sXjRPf.js} +1 -1
- package/assets/{RealCheckout-tQms6dAo.js → RealCheckout-DBL3uxEj.js} +1 -1
- package/assets/{ShopFooterInner-DV3X__jb.js → ShopFooterInner-BHh4OUAv.js} +2 -2
- package/assets/{Success-BblXOFEG.js → Success-BrvAPmP4.js} +1 -1
- package/assets/{SvgIcon-CVoRZ89M.js → SvgIcon-Cg5l4LDh.js} +1 -1
- package/assets/{SwapController-BEHLqATV.js → SwapController-BDZMxnNb.js} +1 -1
- package/assets/{TradeService-a9BKe-Oz.js → TradeService-CkLYTYcJ.js} +1 -1
- package/assets/{W3MFrameProviderSingleton-HtGM3kiI.js → W3MFrameProviderSingleton-D4DCXtQm.js} +3 -3
- package/assets/{WebCryptoP256-bPjiT7wY.js → WebCryptoP256-OE37a6hF.js} +1 -1
- package/assets/{basic-awR2CJat.js → basic-SUHSB6nZ.js} +1 -1
- package/assets/{biconomy-CBCMLM9k.js → biconomy-C6flCXA4.js} +1 -1
- package/assets/{buy-C8v-ou6b.js → buy-YkuLG1h7.js} +1 -1
- package/assets/{buy-gasless-CUtIigP0.js → buy-gasless-gRmZHjsE.js} +1 -1
- package/assets/{ccip-BMCE_sFa.js → ccip-7fqLW_t2.js} +1 -1
- package/assets/{ccip-DiW7RkRR.js → ccip-ByQiZ_aq.js} +1 -1
- package/assets/{collection-D-oaSVfu.js → collection-2CKCNH2O.js} +1 -1
- package/assets/{controller-CJz3LUjz.js → controller-BO0zre2A.js} +2 -2
- package/assets/{core-CGoVaJvD.js → core-D-mQUZ3X.js} +4 -4
- package/assets/{custom-CLQCvu9h.js → custom-C6VO1Je_.js} +1 -1
- package/assets/{data-capture-C1enk8q3.js → data-capture-DdxbO7dd.js} +1 -1
- package/assets/decimals-ByIlBo-2.js +1 -0
- package/assets/{decimals-C8GSUqDy.js → decimals-Di7mGY-D.js} +1 -1
- package/assets/{detectExtension-Bdev6B_Y.js → detectExtension-DsE82Ej6.js} +1 -1
- package/assets/{email-DI1UmfjV.js → email-BTEyDEk6.js} +1 -1
- package/assets/{embedded-wallet-CUaCp934.js → embedded-wallet-QGoIGdCB.js} +1 -1
- package/assets/{engine-NUwMDIUh.js → engine-Bjifrd8K.js} +1 -1
- package/assets/{estimate-l1-fee-CkQ_-gw6.js → estimate-l1-fee-Bqou6JLl.js} +1 -1
- package/assets/{eth_estimateGas-DaI_qfS7.js → eth_estimateGas-CarYiSgL.js} +1 -1
- package/assets/{eth_getStorageAt-DqNZYObO.js → eth_getStorageAt-B-cqm2CG.js} +1 -1
- package/assets/{eth_getTransactionCount-BBYhaRkF.js → eth_getTransactionCount-Dfx3JW2Q.js} +1 -1
- package/assets/{extractIPFS-COY4B3_o.js → extractIPFS-C5EI4cZz.js} +1 -1
- package/assets/{features-DW4K2ZKu.js → features-U-ULFF0v.js} +1 -1
- package/assets/{fetchTokenMetadata-D4vVc_nQ.js → fetchTokenMetadata-DHc2WWGs.js} +2 -2
- package/assets/{generateUtilityClasses-D15hK3nM.js → generateUtilityClasses-BAjjhm6X.js} +1 -1
- package/assets/{get-ecosystem-wallet-info-QCLNyKk6.js → get-ecosystem-wallet-info-CWcGnKL4.js} +1 -1
- package/assets/{getBalance-CndsdQzG.js → getBalance-C8i1-K0c.js} +1 -1
- package/assets/{getInstalledModules-BZgUgPCr.js → getInstalledModules-BXhbS0To.js} +1 -1
- package/assets/{getNFT-Bw4qn7ry.js → getNFT-CzHwZ4FU.js} +2 -2
- package/assets/{getNFT-BQyw29TQ.js → getNFT-D3XSi6wm.js} +1 -1
- package/assets/{hashTypedData-Er6Ia-O7.js → hashTypedData-BOc0w62Q.js} +1 -1
- package/assets/{hashTypedData-CaO8N883.js → hashTypedData-DX5YrpbP.js} +1 -1
- package/assets/{import-NJqh-zgj.js → import-BulayqYM.js} +1 -1
- package/assets/{in-app-wallet-calls-BDq_Ik7W.js → in-app-wallet-calls-BI0pU06-.js} +1 -1
- package/assets/{index-P5U8LYs6.js → index--_rHc9Od.js} +1 -1
- package/assets/{index-BZIVWDQd.js → index-2NUAW7ds.js} +1 -1
- package/assets/{index-CDAYsxA6.js → index-BF6unOoT.js} +1 -1
- package/assets/{index-Hn-DbSZA.js → index-BKSTjS_b.js} +1 -1
- package/assets/{index-LDSpzB15.js → index-BLQJ40Mi.js} +1 -1
- package/assets/{index-CfKqUBFA.js → index-BNH6Xzon.js} +2 -2
- package/assets/{index-Bo34Cx12.js → index-BOQwd6ZB.js} +1 -1
- package/assets/{index-DwQ4pw8v.js → index-BZ5hUBd_.js} +1 -1
- package/assets/{index-mLXaZKmk.js → index-BaSqmd6J.js} +1 -1
- package/assets/{index-AgzyxgSU.js → index-BlEd83Li.js} +1 -1
- package/assets/{index-BqIdYoG8.js → index-Bo6hVxzu.js} +1 -1
- package/assets/{index-C6QyIhnE.js → index-C2OMQVG4.js} +1 -1
- package/assets/{index-FcUvAZuZ.js → index-C2U9pe20.js} +1 -1
- package/assets/{index-DXfwhNfH.js → index-C6FQ8I_Q.js} +2 -2
- package/assets/{index-Dmfk0azd.js → index-C7-iTfFV.js} +39 -39
- package/assets/{index-CDOPdFEN.js → index-CDMAFM2h.js} +1 -1
- package/assets/{index-zGd0k6zk.js → index-CIPKmOlZ.js} +1 -1
- package/assets/{index-D-VYD1II.js → index-CMavzzI_.js} +1 -1
- package/assets/{index-C1RysQbA.js → index-CbJmVQBN.js} +1 -1
- package/assets/{index-BoZx7TrW.js → index-CcQfGUgB.js} +1 -1
- package/assets/{index-DieH8QTn.js → index-CiIXwK1P.js} +1 -1
- package/assets/{index-DrcFvB51.js → index-CkHNiFzW.js} +1 -1
- package/assets/{index-BexyLNIk.js → index-CkVoCPEe.js} +1 -1
- package/assets/{index-BABCyrjx.js → index-CxyR8sie.js} +1 -1
- package/assets/{index-emGKKyxf.js → index-CzFnbzvY.js} +1 -1
- package/assets/{index-Dav5KOrd.js → index-CzfG6alx.js} +1 -1
- package/assets/{index-BdBYQDrP.js → index-D3hzhbb8.js} +1 -1
- package/assets/{index-PQMQyCqV.js → index-D4VlTBkw.js} +1 -1
- package/assets/{index-BRyy9_FL.js → index-D5qOQwpy.js} +1 -1
- package/assets/{index-BseAcDfV.js → index-DIMSfymy.js} +3 -3
- package/assets/{index-DVQRwKte.js → index-DIw62AgP.js} +1 -1
- package/assets/{index-CCxw-foK.js → index-DJyoXp5I.js} +1 -1
- package/assets/{index-j1oJp18p.js → index-DOTYPGXa.js} +1 -1
- package/assets/{index-Buf412yH.js → index-DQx-sY_c.js} +1 -1
- package/assets/{index-Gr3BFRx7.js → index-DS8DYtub.js} +1 -1
- package/assets/{index-ccNJtibX.js → index-DShBCYos.js} +3 -3
- package/assets/{index-2l5r0dRI.js → index-DV4p99KA.js} +2 -2
- package/assets/{index-KUsuHO11.js → index-DacKA042.js} +1 -1
- package/assets/{index-Ddmzqmxk.js → index-DhBdPYnK.js} +1 -1
- package/assets/{index-CWz8eoAl.js → index-DjPU0-Js.js} +1 -1
- package/assets/{index-CRhrr6gN.js → index-DlllSUoB.js} +1 -1
- package/assets/{index-BEzzzIlC.js → index-DtrBN21c.js} +1 -1
- package/assets/{index-CWHR1ZBn.js → index-Eb-Zd0F2.js} +1 -1
- package/assets/{index-C6xmzvY-.js → index-GAmNssSM.js} +1 -1
- package/assets/{index-CmcvhZsS.js → index-IfYZnKCO.js} +1 -1
- package/assets/{index-FrZezou7.js → index-LSZxonl2.js} +1 -1
- package/assets/{index-CyDCPwX2.js → index-Pp2oEhTr.js} +1 -1
- package/assets/{index-DRm7xERf.js → index-Qzch3HJ1.js} +1 -1
- package/assets/{index-BUaGOTLN.js → index-ULMMROQ0.js} +1 -1
- package/assets/{index-Dm67LTtv.js → index-YfJF6hV4.js} +1 -1
- package/assets/{index-BKg37Q5D.js → index-jYazATJj.js} +1 -1
- package/assets/{index-DJCTaNyE.js → index-kxu93Of2.js} +1 -1
- package/assets/{index-Dq7Rlnvq.js → index-n-cFV5ht.js} +1 -1
- package/assets/{index.es-DZDKrrOX.js → index.es-Dk6KC5kj.js} +1 -1
- package/assets/{index.es-7keraYJG.js → index.es-DnMpNe4m.js} +4 -4
- package/assets/{index.es-C2X55s9j.js → index.es-IGCEipYb.js} +1 -1
- package/assets/{localBatchGatewayRequest-ntoba0Xt.js → localBatchGatewayRequest-BLJAP4fw.js} +1 -1
- package/assets/{mana-rate-D_DTt_S8.js → mana-rate-DkxpKYLQ.js} +1 -1
- package/assets/network-DsCGVBhE.js +1 -0
- package/assets/{networks-DvMCxuQT.js → networks-Bc_Uf_7y.js} +1 -1
- package/assets/{onramp-D4LFsmfg.js → onramp-DnhEoZl6.js} +1 -1
- package/assets/{openzeppelin-CJAun2pO.js → openzeppelin-DwFpqgXP.js} +1 -1
- package/assets/{ownerOf-DrmYf79A.js → ownerOf-Qq7Or7yc.js} +1 -1
- package/assets/{parseNft-Yzo9Plhx.js → parseNft-B-POJxiL.js} +2 -2
- package/assets/{parseSignature-3yq9FfJP.js → parseSignature-ClLI6O4f.js} +3 -3
- package/assets/{parseSignature-h2iJV3NZ.js → parseSignature-kOoafZEo.js} +1 -1
- package/assets/{pay-with-exchange-BWW2tZIp.js → pay-with-exchange-BZR4RMBZ.js} +1 -1
- package/assets/{qr-overlay-hYqgRnm0.js → qr-overlay-9WMDd_PO.js} +1 -1
- package/assets/{receive-BMHwXxqP.js → receive-CtJWuhGM.js} +1 -1
- package/assets/{resolveImplementation-DS1nY4sc.js → resolveImplementation-BJatMhHh.js} +1 -1
- package/assets/{rpc-BC6ESxMB.js → rpc-BA0W82l4.js} +1 -1
- package/assets/{secp256k1-DNCGSF8O.js → secp256k1-B82Rx-TY.js} +1 -1
- package/assets/{secp256k1-BQuyxdaC.js → secp256k1-DFslM7tB.js} +1 -1
- package/assets/{secp256k1-CrZRZ9L5.js → secp256k1-DHqlJ8nk.js} +1 -1
- package/assets/{send-B62L18Hx.js → send-DXVwWcB5.js} +1 -1
- package/assets/{send-batch-transaction-De_pBpa_.js → send-batch-transaction-D1j9aZww.js} +1 -1
- package/assets/{send-eip712-transaction-D-GzcP3o.js → send-eip712-transaction-CrryJAyV.js} +2 -2
- package/assets/{send-gasless-transaction-Iil1KVOe.js → send-gasless-transaction-B7YcLCGg.js} +2 -2
- package/assets/{sendRawTransaction-BqauPPYf.js → sendRawTransaction-DT-ObNx8.js} +3 -3
- package/assets/{serializeTransaction-B4qzULZO.js → serializeTransaction-DawhfTu0.js} +1 -1
- package/assets/{session-proposal-C4Cz1cln.js → session-proposal-lgMupzDT.js} +1 -1
- package/assets/{session-request-De0p90UO.js → session-request-DacijEHD.js} +2 -2
- package/assets/{sha256-bg_KfcLv.js → sha256-BxR-wXll.js} +1 -1
- package/assets/{signing-BGpVago5.js → signing-CoPa7cSW.js} +4 -4
- package/assets/{socials-vOukOtuh.js → socials-CMh8u0Ej.js} +1 -1
- package/assets/{swaps-FEWWVCcs.js → swaps-B0Q00kKq.js} +1 -1
- package/assets/{thirdweb-C8ToELvu.js → thirdweb-9c12J_EF.js} +3 -3
- package/assets/{totalSupply-C5jxuFw1.js → totalSupply-BCZn9Djj.js} +1 -1
- package/assets/{transactionReceipt-CbcThGoC.js → transactionReceipt-C2iQ3ozz.js} +1 -1
- package/assets/{transactions-CaxBviMm.js → transactions-Dqx74UWQ.js} +1 -1
- package/assets/{useInfiniteGrid-BiC1UMEK.js → useInfiniteGrid-DgSsqvQS.js} +1 -1
- package/assets/{verifyHash-JbNzrsYR.js → verifyHash-BVbpPoSf.js} +1 -1
- package/assets/{w3m-modal-BUwENQ4T.js → w3m-modal-CGHylzdj.js} +1 -1
- package/assets/{w3m-modal-BfRGsEzF.js → w3m-modal-DvCL5Oh_.js} +1 -1
- package/assets/{wait-for-tx-receipt-BJDKOLGI.js → wait-for-tx-receipt-Dm2aAIs1.js} +1 -1
- package/assets/{wallet-kind-CuaDlRao.js → wallet-kind-vciDs8sO.js} +1 -1
- package/assets/{wallets-BnBHCJi8.js → wallets-D8labJv_.js} +6 -6
- package/assets/{web-connector-CJKlFm6H.js → web-connector-C9MeCxtf.js} +3 -3
- package/assets/{writeContract-CtBYiULm.js → writeContract-C3IzBPhR.js} +1 -1
- package/assets/{zoraTestnet-CJMxifqR.js → zoraTestnet-CduWQC79.js} +1 -1
- package/index.html +8 -8
- package/package.json +2 -2
- package/assets/decimals-DnNelAv5.js +0 -1
- package/assets/network-CFFySFe9.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e as Ht,c as dr,g as Qu}from"./react-Vu6nbGi5.js";import{F as K,af as Yu}from"./index-Dmfk0azd.js";import{k as hr,e as ms,p as te,i as Ut}from"./ethers-DHDSyreX.js";import{r as Xu}from"./index-COjgItKg.js";import{e as el,b as du,c as tl,d as $s}from"./index-BOwZsNrV.js";import{p as rl,a as nl,b as il}from"./hooks.module-C4R15-Vr.js";import{r as fr}from"./index-DXfwhNfH.js";function sl(e,n){for(var r=0;r<n.length;r++){const t=n[r];if(typeof t!="string"&&!Array.isArray(t)){for(const h in t)if(h!=="default"&&!(h in e)){const a=Object.getOwnPropertyDescriptor(t,h);a&&Object.defineProperty(e,h,a.get?a:{enumerable:!0,get:()=>t[h]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var vn={},ot={},at={},Hs;function ol(){if(Hs)return at;Hs=1,Object.defineProperty(at,"__esModule",{value:!0}),at.walletLogo=void 0;const e=(n,r)=>{let t;switch(n){case"standard":return t=r,`data:image/svg+xml,%3Csvg width='${r}' height='${t}' 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 t=r,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${r}' height='${t}' 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 t=(.1*r).toFixed(2),`data:image/svg+xml,%3Csvg width='${r}' height='${t}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return t=(.25*r).toFixed(2),`data:image/svg+xml,%3Csvg width='${r}' height='${t}' 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 t=(.1*r).toFixed(2),`data:image/svg+xml,%3Csvg width='${r}' height='${t}' 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 t=(.25*r).toFixed(2),`data:image/svg+xml,%3Csvg width='${r}' height='${t}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return t=r,`data:image/svg+xml,%3Csvg width='${r}' height='${t}' 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 `}};return at.walletLogo=e,at}var ct={},Us;function al(){return Us||(Us=1,Object.defineProperty(ct,"__esModule",{value:!0}),ct.LINK_API_URL=void 0,ct.LINK_API_URL="https://www.walletlink.org"),ct}var W={},_n={},Ae={},Ws;function gr(){return Ws||(Ws=1,Object.defineProperty(Ae,"__esModule",{value:!0}),Ae.errorValues=Ae.standardErrorCodes=void 0,Ae.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}},Ae.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."}}),Ae}var ut={},En={},Vs;function bs(){return Vs||(Vs=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serialize=e.getErrorCode=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const n=gr(),r="Unspecified error message.";e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function t(o,i=r){if(o&&Number.isInteger(o)){const p=o.toString();if(l(n.errorValues,p))return n.errorValues[p].message;if(u(o))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return i}e.getMessageFromCode=t;function h(o){if(!Number.isInteger(o))return!1;const i=o.toString();return!!(n.errorValues[i]||u(o))}e.isValidCode=h;function a(o){var i;if(typeof o=="number")return o;if(c(o))return(i=o.code)!==null&&i!==void 0?i:o.errorCode}e.getErrorCode=a;function c(o){return typeof o=="object"&&o!==null&&(typeof o.code=="number"||typeof o.errorCode=="number")}function f(o,{shouldIncludeStack:i=!1}={}){const p={};if(o&&typeof o=="object"&&!Array.isArray(o)&&l(o,"code")&&h(o.code)){const m=o;p.code=m.code,m.message&&typeof m.message=="string"?(p.message=m.message,l(m,"data")&&(p.data=m.data)):(p.message=t(p.code),p.data={originalError:g(o)})}else p.code=n.standardErrorCodes.rpc.internal,p.message=s(o,"message")?o.message:r,p.data={originalError:g(o)};return i&&(p.stack=s(o,"stack")?o.stack:void 0),p}e.serialize=f;function u(o){return o>=-32099&&o<=-32e3}function g(o){return o&&typeof o=="object"&&!Array.isArray(o)?Object.assign({},o):o}function l(o,i){return Object.prototype.hasOwnProperty.call(o,i)}function s(o,i){return typeof o=="object"&&o!==null&&i in o&&typeof o[i]=="string"}})(En)),En}var zs;function cl(){if(zs)return ut;zs=1,Object.defineProperty(ut,"__esModule",{value:!0}),ut.standardErrors=void 0;const e=gr(),n=bs();ut.standardErrors={rpc:{parse:u=>r(e.standardErrorCodes.rpc.parse,u),invalidRequest:u=>r(e.standardErrorCodes.rpc.invalidRequest,u),invalidParams:u=>r(e.standardErrorCodes.rpc.invalidParams,u),methodNotFound:u=>r(e.standardErrorCodes.rpc.methodNotFound,u),internal:u=>r(e.standardErrorCodes.rpc.internal,u),server:u=>{if(!u||typeof u!="object"||Array.isArray(u))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:g}=u;if(!Number.isInteger(g)||g>-32005||g<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return r(g,u)},invalidInput:u=>r(e.standardErrorCodes.rpc.invalidInput,u),resourceNotFound:u=>r(e.standardErrorCodes.rpc.resourceNotFound,u),resourceUnavailable:u=>r(e.standardErrorCodes.rpc.resourceUnavailable,u),transactionRejected:u=>r(e.standardErrorCodes.rpc.transactionRejected,u),methodNotSupported:u=>r(e.standardErrorCodes.rpc.methodNotSupported,u),limitExceeded:u=>r(e.standardErrorCodes.rpc.limitExceeded,u)},provider:{userRejectedRequest:u=>t(e.standardErrorCodes.provider.userRejectedRequest,u),unauthorized:u=>t(e.standardErrorCodes.provider.unauthorized,u),unsupportedMethod:u=>t(e.standardErrorCodes.provider.unsupportedMethod,u),disconnected:u=>t(e.standardErrorCodes.provider.disconnected,u),chainDisconnected:u=>t(e.standardErrorCodes.provider.chainDisconnected,u),unsupportedChain:u=>t(e.standardErrorCodes.provider.unsupportedChain,u),custom:u=>{if(!u||typeof u!="object"||Array.isArray(u))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:g,message:l,data:s}=u;if(!l||typeof l!="string")throw new Error('"message" must be a nonempty string');return new c(g,l,s)}}};function r(u,g){const[l,s]=h(g);return new a(u,l||(0,n.getMessageFromCode)(u),s)}function t(u,g){const[l,s]=h(g);return new c(u,l||(0,n.getMessageFromCode)(u),s)}function h(u){if(u){if(typeof u=="string")return[u];if(typeof u=="object"&&!Array.isArray(u)){const{message:g,data:l}=u;if(g&&typeof g!="string")throw new Error("Must specify string message.");return[g||void 0,l]}}return[]}class a extends Error{constructor(g,l,s){if(!Number.isInteger(g))throw new Error('"code" must be an integer.');if(!l||typeof l!="string")throw new Error('"message" must be a nonempty string.');super(l),this.code=g,s!==void 0&&(this.data=s)}}class c extends a{constructor(g,l,s){if(!f(g))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(g,l,s)}}function f(u){return Number.isInteger(u)&&u>=1e3&&u<=4999}return ut}var lt={},dt={},Js;function ys(){if(Js)return dt;Js=1,Object.defineProperty(dt,"__esModule",{value:!0}),dt.isErrorResponse=void 0;function e(n){return n.errorMessage!==void 0}return dt.isErrorResponse=e,dt}var ht={},Gs;function ws(){return Gs||(Gs=1,Object.defineProperty(ht,"__esModule",{value:!0}),ht.LIB_VERSION=void 0,ht.LIB_VERSION="3.9.3"),ht}var Zs;function ul(){if(Zs)return lt;Zs=1,Object.defineProperty(lt,"__esModule",{value:!0}),lt.serializeError=void 0;const e=ys(),n=ws(),r=gr(),t=bs();function h(f,u){const g=(0,t.serialize)(a(f),{shouldIncludeStack:!0}),l=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");l.searchParams.set("version",n.LIB_VERSION),l.searchParams.set("code",g.code.toString());const s=c(g.data,u);return s&&l.searchParams.set("method",s),l.searchParams.set("message",g.message),Object.assign(Object.assign({},g),{docUrl:l.href})}lt.serializeError=h;function a(f){return typeof f=="string"?{message:f,code:r.standardErrorCodes.rpc.internal}:(0,e.isErrorResponse)(f)?Object.assign(Object.assign({},f),{message:f.errorMessage,code:f.errorCode,data:{method:f.method}}):f}function c(f,u){const g=f==null?void 0:f.method;if(g)return g;if(u!==void 0){if(typeof u=="string")return u;if(Array.isArray(u)){if(u.length>0)return u[0].method}else return u.method}}return lt}var Ks;function pr(){return Ks||(Ks=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.standardErrors=e.standardErrorCodes=e.serializeError=e.getMessageFromCode=e.getErrorCode=void 0;const n=gr();Object.defineProperty(e,"standardErrorCodes",{enumerable:!0,get:function(){return n.standardErrorCodes}});const r=cl();Object.defineProperty(e,"standardErrors",{enumerable:!0,get:function(){return r.standardErrors}});const t=ul();Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return t.serializeError}});const h=bs();Object.defineProperty(e,"getErrorCode",{enumerable:!0,get:function(){return h.getErrorCode}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return h.getMessageFromCode}})})(_n)),_n}var oe={},Qs;function mr(){if(Qs)return oe;Qs=1,Object.defineProperty(oe,"__esModule",{value:!0}),oe.ProviderType=oe.RegExpString=oe.IntNumber=oe.BigIntString=oe.AddressString=oe.HexString=oe.OpaqueType=void 0;function e(){return t=>t}oe.OpaqueType=e,oe.HexString=e(),oe.AddressString=e(),oe.BigIntString=e();function n(t){return Math.floor(t)}oe.IntNumber=n,oe.RegExpString=e();var r;return(function(t){t.CoinbaseWallet="CoinbaseWallet",t.MetaMask="MetaMask",t.Unselected=""})(r||(oe.ProviderType=r={})),oe}var Ys;function Re(){if(Ys)return W;Ys=1;var e=W&&W.__importDefault||function(M){return M&&M.__esModule?M:{default:M}};Object.defineProperty(W,"__esModule",{value:!0}),W.isMobileWeb=W.getLocation=W.isInIFrame=W.createQrUrl=W.getFavicon=W.range=W.isBigNumber=W.ensureParsedJSONObject=W.ensureBN=W.ensureRegExpString=W.ensureIntNumber=W.ensureBuffer=W.ensureAddressString=W.ensureEvenLengthHexString=W.ensureHexString=W.isHexString=W.prepend0x=W.strip0x=W.has0xPrefix=W.hexStringFromIntNumber=W.intNumberFromHexString=W.bigIntStringFromBN=W.hexStringFromBuffer=W.hexStringToUint8Array=W.uint8ArrayToHex=W.randomBytesHex=void 0;const n=e(hr()),r=pr(),t=mr(),h=/^[0-9]*$/,a=/^[a-f0-9]*$/;function c(M){return f(crypto.getRandomValues(new Uint8Array(M)))}W.randomBytesHex=c;function f(M){return[...M].map(L=>L.toString(16).padStart(2,"0")).join("")}W.uint8ArrayToHex=f;function u(M){return new Uint8Array(M.match(/.{1,2}/g).map(L=>parseInt(L,16)))}W.hexStringToUint8Array=u;function g(M,L=!1){const T=M.toString("hex");return(0,t.HexString)(L?`0x${T}`:T)}W.hexStringFromBuffer=g;function l(M){return(0,t.BigIntString)(M.toString(10))}W.bigIntStringFromBN=l;function s(M){return(0,t.IntNumber)(new n.default(y(M,!1),16).toNumber())}W.intNumberFromHexString=s;function o(M){return(0,t.HexString)(`0x${new n.default(M).toString(16)}`)}W.hexStringFromIntNumber=o;function i(M){return M.startsWith("0x")||M.startsWith("0X")}W.has0xPrefix=i;function p(M){return i(M)?M.slice(2):M}W.strip0x=p;function m(M){return i(M)?`0x${M.slice(2)}`:`0x${M}`}W.prepend0x=m;function b(M){if(typeof M!="string")return!1;const L=p(M).toLowerCase();return a.test(L)}W.isHexString=b;function d(M,L=!1){if(typeof M=="string"){const T=p(M).toLowerCase();if(a.test(T))return(0,t.HexString)(L?`0x${T}`:T)}throw r.standardErrors.rpc.invalidParams(`"${String(M)}" is not a hexadecimal string`)}W.ensureHexString=d;function y(M,L=!1){let T=d(M,!1);return T.length%2===1&&(T=(0,t.HexString)(`0${T}`)),L?(0,t.HexString)(`0x${T}`):T}W.ensureEvenLengthHexString=y;function w(M){if(typeof M=="string"){const L=p(M).toLowerCase();if(b(L)&&L.length===40)return(0,t.AddressString)(m(L))}throw r.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(M)}`)}W.ensureAddressString=w;function v(M){if(K.isBuffer(M))return M;if(typeof M=="string"){if(b(M)){const L=y(M,!1);return K.from(L,"hex")}return K.from(M,"utf8")}throw r.standardErrors.rpc.invalidParams(`Not binary data: ${String(M)}`)}W.ensureBuffer=v;function _(M){if(typeof M=="number"&&Number.isInteger(M))return(0,t.IntNumber)(M);if(typeof M=="string"){if(h.test(M))return(0,t.IntNumber)(Number(M));if(b(M))return(0,t.IntNumber)(new n.default(y(M,!1),16).toNumber())}throw r.standardErrors.rpc.invalidParams(`Not an integer: ${String(M)}`)}W.ensureIntNumber=_;function C(M){if(M instanceof RegExp)return(0,t.RegExpString)(M.toString());throw r.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(M)}`)}W.ensureRegExpString=C;function S(M){if(M!==null&&(n.default.isBN(M)||P(M)))return new n.default(M.toString(10),10);if(typeof M=="number")return new n.default(_(M));if(typeof M=="string"){if(h.test(M))return new n.default(M,10);if(b(M))return new n.default(y(M,!1),16)}throw r.standardErrors.rpc.invalidParams(`Not an integer: ${String(M)}`)}W.ensureBN=S;function I(M){if(typeof M=="string")return JSON.parse(M);if(typeof M=="object")return M;throw r.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(M)}`)}W.ensureParsedJSONObject=I;function P(M){if(M==null||typeof M.constructor!="function")return!1;const{constructor:L}=M;return typeof L.config=="function"&&typeof L.EUCLID=="number"}W.isBigNumber=P;function B(M,L){return Array.from({length:L-M},(T,x)=>M+x)}W.range=B;function $(){const M=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:L,host:T}=document.location,x=M?M.getAttribute("href"):null;return!x||x.startsWith("javascript:")||x.startsWith("vbscript:")?null:x.startsWith("http://")||x.startsWith("https://")||x.startsWith("data:")?x:x.startsWith("//")?L+x:`${L}//${T}${x}`}W.getFavicon=$;function z(M,L,T,x,D,V){const F=x?"parent-id":"id",j=new URLSearchParams({[F]:M,secret:L,server:T,v:D,chainId:V.toString()}).toString();return`${T}/#/link?${j}`}W.createQrUrl=z;function X(){try{return window.frameElement!==null}catch{return!1}}W.isInIFrame=X;function Y(){try{return X()&&window.top?window.top.location:window.location}catch{return window.location}}W.getLocation=Y;function J(){var M;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((M=window==null?void 0:window.navigator)===null||M===void 0?void 0:M.userAgent)}return W.isMobileWeb=J,W}var ft={},Xs;function ll(){if(Xs)return ft;Xs=1,Object.defineProperty(ft,"__esModule",{value:!0}),ft.ScopedLocalStorage=void 0;let e=class{constructor(r){this.scope=r}setItem(r,t){localStorage.setItem(this.scopedKey(r),t)}getItem(r){return localStorage.getItem(this.scopedKey(r))}removeItem(r){localStorage.removeItem(this.scopedKey(r))}clear(){const r=this.scopedKey(""),t=[];for(let h=0;h<localStorage.length;h++){const a=localStorage.key(h);typeof a=="string"&&a.startsWith(r)&&t.push(a)}t.forEach(h=>localStorage.removeItem(h))}scopedKey(r){return`${this.scope}:${r}`}};return ft.ScopedLocalStorage=e,ft}var Me={},gt={},pt={},mt={},eo;function vs(){return eo||(eo=1,Object.defineProperty(mt,"__esModule",{value:!0}),mt.EVENTS=void 0,mt.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"}),mt}var de={},to;function _s(){if(to)return de;to=1,Object.defineProperty(de,"__esModule",{value:!0}),de.RelayAbstract=de.APP_VERSION_KEY=de.LOCAL_STORAGE_ADDRESSES_KEY=de.WALLET_USER_NAME_KEY=void 0;const e=pr();de.WALLET_USER_NAME_KEY="walletUsername",de.LOCAL_STORAGE_ADDRESSES_KEY="Addresses",de.APP_VERSION_KEY="AppVersion";let n=class{async makeEthereumJSONRPCRequest(t,h){if(!h)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(h,{method:"POST",body:JSON.stringify(t),mode:"cors",headers:{"Content-Type":"application/json"}}).then(a=>a.json()).then(a=>{if(!a)throw e.standardErrors.rpc.parse({});const c=a,{error:f}=c;if(f)throw(0,e.serializeError)(f,t.method);return c})}};return de.RelayAbstract=n,de}var bt={},ro;function Es(){if(ro)return bt;ro=1,Object.defineProperty(bt,"__esModule",{value:!0}),bt.Session=void 0;const e=el(),n=Re(),r="session:id",t="session:secret",h="session:linked";let a=class hu{constructor(f,u,g,l){this._storage=f,this._id=u||(0,n.randomBytesHex)(16),this._secret=g||(0,n.randomBytesHex)(32),this._key=new e.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!l}static load(f){const u=f.getItem(r),g=f.getItem(h),l=f.getItem(t);return u&&l?new hu(f,u,l,g==="1"):null}static hash(f){return new e.sha256().update(f).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(f){this._linked=f,this.persistLinked()}save(){return this._storage.setItem(r,this._id),this._storage.setItem(t,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(h,this._linked?"1":"0")}};return bt.Session=a,bt}var yt={},wt={},no;function dl(){if(no)return wt;no=1,Object.defineProperty(wt,"__esModule",{value:!0}),wt.Cipher=void 0;const e=Re();let n=class{constructor(t){this.secret=t}async encrypt(t){const h=this.secret;if(h.length!==64)throw Error("secret must be 256 bits");const a=crypto.getRandomValues(new Uint8Array(12)),c=await crypto.subtle.importKey("raw",(0,e.hexStringToUint8Array)(h),{name:"aes-gcm"},!1,["encrypt","decrypt"]),f=new TextEncoder,u=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:a},c,f.encode(t)),g=16,l=u.slice(u.byteLength-g),s=u.slice(0,u.byteLength-g),o=new Uint8Array(l),i=new Uint8Array(s),p=new Uint8Array([...a,...o,...i]);return(0,e.uint8ArrayToHex)(p)}async decrypt(t){const h=this.secret;if(h.length!==64)throw Error("secret must be 256 bits");return new Promise((a,c)=>{(async function(){const f=await crypto.subtle.importKey("raw",(0,e.hexStringToUint8Array)(h),{name:"aes-gcm"},!1,["encrypt","decrypt"]),u=(0,e.hexStringToUint8Array)(t),g=u.slice(0,12),l=u.slice(12,28),s=u.slice(28),o=new Uint8Array([...s,...l]),i={name:"AES-GCM",iv:new Uint8Array(g)};try{const p=await window.crypto.subtle.decrypt(i,f,o),m=new TextDecoder;a(m.decode(p))}catch(p){c(p)}})()})}};return wt.Cipher=n,wt}var vt={},io;function hl(){if(io)return vt;io=1,Object.defineProperty(vt,"__esModule",{value:!0}),vt.WalletLinkHTTP=void 0;let e=class{constructor(r,t,h){this.linkAPIUrl=r,this.sessionId=t;const a=`${t}:${h}`;this.auth=`Basic ${btoa(a)}`}async markUnseenEventsAsSeen(r){return Promise.all(r.map(t=>fetch(`${this.linkAPIUrl}/events/${t.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(t=>console.error("Unabled to mark event as failed:",t))}async fetchUnseenEvents(){var r;const t=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(t.ok){const{events:h,error:a}=await t.json();if(a)throw new Error(`Check unseen events failed: ${a}`);const c=(r=h==null?void 0:h.filter(f=>f.event==="Web3Response").map(f=>({type:"Event",sessionId:this.sessionId,eventId:f.id,event:f.event,data:f.data})))!==null&&r!==void 0?r:[];return this.markUnseenEventsAsSeen(c),c}throw new Error(`Check unseen events failed: ${t.status}`)}};return vt.WalletLinkHTTP=e,vt}var Le={},so;function fl(){if(so)return Le;so=1,Object.defineProperty(Le,"__esModule",{value:!0}),Le.WalletLinkWebSocket=Le.ConnectionState=void 0;var e;(function(r){r[r.DISCONNECTED=0]="DISCONNECTED",r[r.CONNECTING=1]="CONNECTING",r[r.CONNECTED=2]="CONNECTED"})(e||(Le.ConnectionState=e={}));let n=class{setConnectionStateListener(t){this.connectionStateListener=t}setIncomingDataListener(t){this.incomingDataListener=t}constructor(t,h=WebSocket){this.WebSocketClass=h,this.webSocket=null,this.pendingData=[],this.url=t.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((t,h)=>{var a;let c;try{this.webSocket=c=new this.WebSocketClass(this.url)}catch(f){h(f);return}(a=this.connectionStateListener)===null||a===void 0||a.call(this,e.CONNECTING),c.onclose=f=>{var u;this.clearWebSocket(),h(new Error(`websocket error ${f.code}: ${f.reason}`)),(u=this.connectionStateListener)===null||u===void 0||u.call(this,e.DISCONNECTED)},c.onopen=f=>{var u;t(),(u=this.connectionStateListener)===null||u===void 0||u.call(this,e.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(l=>this.sendData(l)),this.pendingData=[])},c.onmessage=f=>{var u,g;if(f.data==="h")(u=this.incomingDataListener)===null||u===void 0||u.call(this,{type:"Heartbeat"});else try{const l=JSON.parse(f.data);(g=this.incomingDataListener)===null||g===void 0||g.call(this,l)}catch{}}})}disconnect(){var t;const{webSocket:h}=this;if(h){this.clearWebSocket(),(t=this.connectionStateListener)===null||t===void 0||t.call(this,e.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{h.close()}catch{}}}sendData(t){const{webSocket:h}=this;if(!h){this.pendingData.push(t),this.connect();return}h.send(t)}clearWebSocket(){const{webSocket:t}=this;t&&(this.webSocket=null,t.onclose=null,t.onerror=null,t.onmessage=null,t.onopen=null)}};return Le.WalletLinkWebSocket=n,Le}var oo;function gl(){if(oo)return yt;oo=1,Object.defineProperty(yt,"__esModule",{value:!0}),yt.WalletLinkConnection=void 0;const e=mr(),n=dl(),r=vs(),t=_s(),h=Es(),a=hl(),c=fl(),f=1e4,u=6e4;let g=class{constructor({session:s,linkAPIUrl:o,listener:i,diagnostic:p,WebSocketClass:m=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,e.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=d=>{if(!d)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",w=>d.JsonRpcUrl&&this.handleChainUpdated(w,d.JsonRpcUrl)]]).forEach((w,v)=>{const _=d[v];_!==void 0&&w(_)})},this.handleDestroyed=d=>{var y,w;d==="1"&&((y=this.listener)===null||y===void 0||y.resetAndReload(),(w=this.diagnostic)===null||w===void 0||w.log(r.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:this.isDestroyed,sessionIdHash:h.Session.hash(this.session.id)}))},this.handleAccountUpdated=async d=>{var y,w;try{const v=await this.cipher.decrypt(d);(y=this.listener)===null||y===void 0||y.accountUpdated(v)}catch{(w=this.diagnostic)===null||w===void 0||w.log(r.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}},this.handleMetadataUpdated=async(d,y)=>{var w,v;try{const _=await this.cipher.decrypt(y);(w=this.listener)===null||w===void 0||w.metadataUpdated(d,_)}catch{(v=this.diagnostic)===null||v===void 0||v.log(r.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:d})}},this.handleWalletUsernameUpdated=async d=>{this.handleMetadataUpdated(t.WALLET_USER_NAME_KEY,d)},this.handleAppVersionUpdated=async d=>{this.handleMetadataUpdated(t.APP_VERSION_KEY,d)},this.handleChainUpdated=async(d,y)=>{var w,v;try{const _=await this.cipher.decrypt(d),C=await this.cipher.decrypt(y);(w=this.listener)===null||w===void 0||w.chainUpdated(_,C)}catch{(v=this.diagnostic)===null||v===void 0||v.log(r.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}},this.session=s,this.cipher=new n.Cipher(s.secret),this.diagnostic=p,this.listener=i;const b=new c.WalletLinkWebSocket(`${o}/rpc`,m);b.setConnectionStateListener(async d=>{var y;(y=this.diagnostic)===null||y===void 0||y.log(r.EVENTS.CONNECTED_STATE_CHANGE,{state:d,sessionIdHash:h.Session.hash(s.id)});let w=!1;switch(d){case c.ConnectionState.DISCONNECTED:if(!this.destroyed){const v=async()=>{await new Promise(_=>setTimeout(_,5e3)),this.destroyed||b.connect().catch(()=>{v()})};v()}break;case c.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),w=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},f),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case c.ConnectionState.CONNECTING:break}this.connected!==w&&(this.connected=w)}),b.setIncomingDataListener(d=>{var y,w,v;switch(d.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const _=d.type==="IsLinkedOK"?d.linked:void 0;(y=this.diagnostic)===null||y===void 0||y.log(r.EVENTS.LINKED,{sessionIdHash:h.Session.hash(s.id),linked:_,type:d.type,onlineGuests:d.onlineGuests}),this.linked=_||d.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{(w=this.diagnostic)===null||w===void 0||w.log(r.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:h.Session.hash(s.id),metadata_keys:d&&d.metadata?Object.keys(d.metadata):void 0}),this.handleSessionMetadataUpdated(d.metadata);break}case"Event":{this.handleIncomingEvent(d);break}}d.id!==void 0&&((v=this.requestResolutions.get(d.id))===null||v===void 0||v(d))}),this.ws=b,this.http=new a.WalletLinkHTTP(o,s.id,s.key)}connect(){var s;if(this.destroyed)throw new Error("instance is destroyed");(s=this.diagnostic)===null||s===void 0||s.log(r.EVENTS.STARTED_CONNECTING,{sessionIdHash:h.Session.hash(this.session.id)}),this.ws.connect()}destroy(){var s;this.destroyed=!0,this.ws.disconnect(),(s=this.diagnostic)===null||s===void 0||s.log(r.EVENTS.DISCONNECTED,{sessionIdHash:h.Session.hash(this.session.id)}),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(s){var o,i;this._connected=s,s&&((o=this.onceConnected)===null||o===void 0||o.call(this)),(i=this.listener)===null||i===void 0||i.connectedUpdated(s)}setOnceConnected(s){return new Promise(o=>{this.connected?s().then(o):this.onceConnected=()=>{s().then(o),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(s){var o,i;this._linked=s,s&&((o=this.onceLinked)===null||o===void 0||o.call(this)),(i=this.listener)===null||i===void 0||i.linkedUpdated(s)}setOnceLinked(s){return new Promise(o=>{this.linked?s().then(o):this.onceLinked=()=>{s().then(o),this.onceLinked=void 0}})}async handleIncomingEvent(s){var o,i;if(!(s.type!=="Event"||s.event!=="Web3Response"))try{const p=await this.cipher.decrypt(s.data),m=JSON.parse(p);if(m.type!=="WEB3_RESPONSE")return;(o=this.listener)===null||o===void 0||o.handleWeb3ResponseMessage(m)}catch{(i=this.diagnostic)===null||i===void 0||i.log(r.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(s=>setTimeout(s,250));try{await this.fetchUnseenEventsAPI()}catch(s){console.error("Unable to check for unseen events",s)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(o=>this.handleIncomingEvent(o))}async setSessionMetadata(s,o){const i={type:"SetSessionConfig",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[s]:o}};return this.setOnceConnected(async()=>{const p=await this.makeRequest(i);if(p.type==="Fail")throw new Error(p.error||"failed to set session metadata")})}async publishEvent(s,o,i=!1){const p=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},o),{origin:location.origin,relaySource:window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),m={type:"PublishEvent",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:s,data:p,callWebhook:i};return this.setOnceLinked(async()=>{const b=await this.makeRequest(m);if(b.type==="Fail")throw new Error(b.error||"failed to publish event");return b.eventId})}sendData(s){this.ws.sendData(JSON.stringify(s))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>f*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(s,o=u){const i=s.id;this.sendData(s);let p;return Promise.race([new Promise((m,b)=>{p=window.setTimeout(()=>{b(new Error(`request ${i} timed out`))},o)}),new Promise(m=>{this.requestResolutions.set(i,b=>{clearTimeout(p),m(b),this.requestResolutions.delete(i)})})])}async authenticate(){const s={type:"HostSession",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},o=await this.makeRequest(s);if(o.type==="Fail")throw new Error(o.error||"failed to authentcate")}sendIsLinked(){const s={type:"IsLinked",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(s)}sendGetSessionConfig(){const s={type:"GetSessionConfig",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(s)}};return yt.WalletLinkConnection=g,yt}var _t={},Te={},Qt={},ao;function pl(){return ao||(ao=1,Object.defineProperty(Qt,"__esModule",{value:!0}),Qt.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}'),Qt}var co;function fu(){if(co)return Te;co=1;var e=Te&&Te.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Te,"__esModule",{value:!0}),Te.injectCssReset=void 0;const n=e(pl());function r(){const t=document.createElement("style");t.type="text/css",t.appendChild(document.createTextNode(n.default)),document.documentElement.appendChild(t)}return Te.injectCssReset=r,Te}var Et={};const ce=Ht(rl);var Ne={};const Wt=Ht(nl),br=Ht(il);var _e={},Rt={},uo;function ml(){if(uo)return Rt;uo=1,Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.CloseIcon=void 0;const e=ce;function n(r){return(0,e.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r),(0,e.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"}))}return Rt.CloseIcon=n,Rt}var St={},lo;function bl(){if(lo)return St;lo=1,Object.defineProperty(St,"__esModule",{value:!0}),St.CoinbaseWalletRound=void 0;const e=ce;function n(r){return(0,e.h)("svg",Object.assign({width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r),(0,e.h)("circle",{cx:"14",cy:"14",r:"14",fill:"#0052FF"}),(0,e.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,e.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"}))}return St.CoinbaseWalletRound=n,St}var Ct={},ho;function yl(){if(ho)return Ct;ho=1,Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.QRCodeIcon=void 0;const e=ce;function n(r){return(0,e.h)("svg",Object.assign({width:"18",height:"18",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},r),(0,e.h)("path",{d:"M3 3V8.99939L5 8.99996V5H9V3H3Z"}),(0,e.h)("path",{d:"M15 21L21 21V15.0006L19 15V19L15 19V21Z"}),(0,e.h)("path",{d:"M21 9H19V5H15.0006L15 3H21V9Z"}),(0,e.h)("path",{d:"M3 15V21H8.99939L8.99996 19H5L5 15H3Z"}))}return Ct.QRCodeIcon=n,Ct}var Pe={},Rn,fo;function wl(){if(fo)return Rn;fo=1;function e(i){this.mode=r.MODE_8BIT_BYTE,this.data=i,this.parsedData=[];for(var p=0,m=this.data.length;p<m;p++){var b=[],d=this.data.charCodeAt(p);d>65536?(b[0]=240|(d&1835008)>>>18,b[1]=128|(d&258048)>>>12,b[2]=128|(d&4032)>>>6,b[3]=128|d&63):d>2048?(b[0]=224|(d&61440)>>>12,b[1]=128|(d&4032)>>>6,b[2]=128|d&63):d>128?(b[0]=192|(d&1984)>>>6,b[1]=128|d&63):b[0]=d,this.parsedData.push(b)}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))}e.prototype={getLength:function(i){return this.parsedData.length},write:function(i){for(var p=0,m=this.parsedData.length;p<m;p++)i.put(this.parsedData[p],8)}};function n(i,p){this.typeNumber=i,this.errorCorrectLevel=p,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}n.prototype={addData:function(i){var p=new e(i);this.dataList.push(p),this.dataCache=null},isDark:function(i,p){if(i<0||this.moduleCount<=i||p<0||this.moduleCount<=p)throw new Error(i+","+p);return this.modules[i][p]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(i,p){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var m=0;m<this.moduleCount;m++){this.modules[m]=new Array(this.moduleCount);for(var b=0;b<this.moduleCount;b++)this.modules[m][b]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(i,p),this.typeNumber>=7&&this.setupTypeNumber(i),this.dataCache==null&&(this.dataCache=n.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,p)},setupPositionProbePattern:function(i,p){for(var m=-1;m<=7;m++)if(!(i+m<=-1||this.moduleCount<=i+m))for(var b=-1;b<=7;b++)p+b<=-1||this.moduleCount<=p+b||(0<=m&&m<=6&&(b==0||b==6)||0<=b&&b<=6&&(m==0||m==6)||2<=m&&m<=4&&2<=b&&b<=4?this.modules[i+m][p+b]=!0:this.modules[i+m][p+b]=!1)},getBestMaskPattern:function(){for(var i=0,p=0,m=0;m<8;m++){this.makeImpl(!0,m);var b=a.getLostPoint(this);(m==0||i>b)&&(i=b,p=m)}return p},createMovieClip:function(i,p,m){var b=i.createEmptyMovieClip(p,m),d=1;this.make();for(var y=0;y<this.modules.length;y++)for(var w=y*d,v=0;v<this.modules[y].length;v++){var _=v*d,C=this.modules[y][v];C&&(b.beginFill(0,100),b.moveTo(_,w),b.lineTo(_+d,w),b.lineTo(_+d,w+d),b.lineTo(_,w+d),b.endFill())}return b},setupTimingPattern:function(){for(var i=8;i<this.moduleCount-8;i++)this.modules[i][6]==null&&(this.modules[i][6]=i%2==0);for(var p=8;p<this.moduleCount-8;p++)this.modules[6][p]==null&&(this.modules[6][p]=p%2==0)},setupPositionAdjustPattern:function(){for(var i=a.getPatternPosition(this.typeNumber),p=0;p<i.length;p++)for(var m=0;m<i.length;m++){var b=i[p],d=i[m];if(this.modules[b][d]==null)for(var y=-2;y<=2;y++)for(var w=-2;w<=2;w++)y==-2||y==2||w==-2||w==2||y==0&&w==0?this.modules[b+y][d+w]=!0:this.modules[b+y][d+w]=!1}},setupTypeNumber:function(i){for(var p=a.getBCHTypeNumber(this.typeNumber),m=0;m<18;m++){var b=!i&&(p>>m&1)==1;this.modules[Math.floor(m/3)][m%3+this.moduleCount-8-3]=b}for(var m=0;m<18;m++){var b=!i&&(p>>m&1)==1;this.modules[m%3+this.moduleCount-8-3][Math.floor(m/3)]=b}},setupTypeInfo:function(i,p){for(var m=this.errorCorrectLevel<<3|p,b=a.getBCHTypeInfo(m),d=0;d<15;d++){var y=!i&&(b>>d&1)==1;d<6?this.modules[d][8]=y:d<8?this.modules[d+1][8]=y:this.modules[this.moduleCount-15+d][8]=y}for(var d=0;d<15;d++){var y=!i&&(b>>d&1)==1;d<8?this.modules[8][this.moduleCount-d-1]=y:d<9?this.modules[8][15-d-1+1]=y:this.modules[8][15-d-1]=y}this.modules[this.moduleCount-8][8]=!i},mapData:function(i,p){for(var m=-1,b=this.moduleCount-1,d=7,y=0,w=this.moduleCount-1;w>0;w-=2)for(w==6&&w--;;){for(var v=0;v<2;v++)if(this.modules[b][w-v]==null){var _=!1;y<i.length&&(_=(i[y]>>>d&1)==1);var C=a.getMask(p,b,w-v);C&&(_=!_),this.modules[b][w-v]=_,d--,d==-1&&(y++,d=7)}if(b+=m,b<0||this.moduleCount<=b){b-=m,m=-m;break}}}},n.PAD0=236,n.PAD1=17,n.createData=function(i,p,m){for(var b=g.getRSBlocks(i,p),d=new l,y=0;y<m.length;y++){var w=m[y];d.put(w.mode,4),d.put(w.getLength(),a.getLengthInBits(w.mode,i)),w.write(d)}for(var v=0,y=0;y<b.length;y++)v+=b[y].dataCount;if(d.getLengthInBits()>v*8)throw new Error("code length overflow. ("+d.getLengthInBits()+">"+v*8+")");for(d.getLengthInBits()+4<=v*8&&d.put(0,4);d.getLengthInBits()%8!=0;)d.putBit(!1);for(;!(d.getLengthInBits()>=v*8||(d.put(n.PAD0,8),d.getLengthInBits()>=v*8));)d.put(n.PAD1,8);return n.createBytes(d,b)},n.createBytes=function(i,p){for(var m=0,b=0,d=0,y=new Array(p.length),w=new Array(p.length),v=0;v<p.length;v++){var _=p[v].dataCount,C=p[v].totalCount-_;b=Math.max(b,_),d=Math.max(d,C),y[v]=new Array(_);for(var S=0;S<y[v].length;S++)y[v][S]=255&i.buffer[S+m];m+=_;var I=a.getErrorCorrectPolynomial(C),P=new u(y[v],I.getLength()-1),B=P.mod(I);w[v]=new Array(I.getLength()-1);for(var S=0;S<w[v].length;S++){var $=S+B.getLength()-w[v].length;w[v][S]=$>=0?B.get($):0}}for(var z=0,S=0;S<p.length;S++)z+=p[S].totalCount;for(var X=new Array(z),Y=0,S=0;S<b;S++)for(var v=0;v<p.length;v++)S<y[v].length&&(X[Y++]=y[v][S]);for(var S=0;S<d;S++)for(var v=0;v<p.length;v++)S<w[v].length&&(X[Y++]=w[v][S]);return X};for(var r={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},t={L:1,M:0,Q:3,H:2},h={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},a={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(i){for(var p=i<<10;a.getBCHDigit(p)-a.getBCHDigit(a.G15)>=0;)p^=a.G15<<a.getBCHDigit(p)-a.getBCHDigit(a.G15);return(i<<10|p)^a.G15_MASK},getBCHTypeNumber:function(i){for(var p=i<<12;a.getBCHDigit(p)-a.getBCHDigit(a.G18)>=0;)p^=a.G18<<a.getBCHDigit(p)-a.getBCHDigit(a.G18);return i<<12|p},getBCHDigit:function(i){for(var p=0;i!=0;)p++,i>>>=1;return p},getPatternPosition:function(i){return a.PATTERN_POSITION_TABLE[i-1]},getMask:function(i,p,m){switch(i){case h.PATTERN000:return(p+m)%2==0;case h.PATTERN001:return p%2==0;case h.PATTERN010:return m%3==0;case h.PATTERN011:return(p+m)%3==0;case h.PATTERN100:return(Math.floor(p/2)+Math.floor(m/3))%2==0;case h.PATTERN101:return p*m%2+p*m%3==0;case h.PATTERN110:return(p*m%2+p*m%3)%2==0;case h.PATTERN111:return(p*m%3+(p+m)%2)%2==0;default:throw new Error("bad maskPattern:"+i)}},getErrorCorrectPolynomial:function(i){for(var p=new u([1],0),m=0;m<i;m++)p=p.multiply(new u([1,c.gexp(m)],0));return p},getLengthInBits:function(i,p){if(1<=p&&p<10)switch(i){case r.MODE_NUMBER:return 10;case r.MODE_ALPHA_NUM:return 9;case r.MODE_8BIT_BYTE:return 8;case r.MODE_KANJI:return 8;default:throw new Error("mode:"+i)}else if(p<27)switch(i){case r.MODE_NUMBER:return 12;case r.MODE_ALPHA_NUM:return 11;case r.MODE_8BIT_BYTE:return 16;case r.MODE_KANJI:return 10;default:throw new Error("mode:"+i)}else if(p<41)switch(i){case r.MODE_NUMBER:return 14;case r.MODE_ALPHA_NUM:return 13;case r.MODE_8BIT_BYTE:return 16;case r.MODE_KANJI:return 12;default:throw new Error("mode:"+i)}else throw new Error("type:"+p)},getLostPoint:function(i){for(var p=i.getModuleCount(),m=0,b=0;b<p;b++)for(var d=0;d<p;d++){for(var y=0,w=i.isDark(b,d),v=-1;v<=1;v++)if(!(b+v<0||p<=b+v))for(var _=-1;_<=1;_++)d+_<0||p<=d+_||v==0&&_==0||w==i.isDark(b+v,d+_)&&y++;y>5&&(m+=3+y-5)}for(var b=0;b<p-1;b++)for(var d=0;d<p-1;d++){var C=0;i.isDark(b,d)&&C++,i.isDark(b+1,d)&&C++,i.isDark(b,d+1)&&C++,i.isDark(b+1,d+1)&&C++,(C==0||C==4)&&(m+=3)}for(var b=0;b<p;b++)for(var d=0;d<p-6;d++)i.isDark(b,d)&&!i.isDark(b,d+1)&&i.isDark(b,d+2)&&i.isDark(b,d+3)&&i.isDark(b,d+4)&&!i.isDark(b,d+5)&&i.isDark(b,d+6)&&(m+=40);for(var d=0;d<p;d++)for(var b=0;b<p-6;b++)i.isDark(b,d)&&!i.isDark(b+1,d)&&i.isDark(b+2,d)&&i.isDark(b+3,d)&&i.isDark(b+4,d)&&!i.isDark(b+5,d)&&i.isDark(b+6,d)&&(m+=40);for(var S=0,d=0;d<p;d++)for(var b=0;b<p;b++)i.isDark(b,d)&&S++;var I=Math.abs(100*S/p/p-50)/5;return m+=I*10,m}},c={glog:function(i){if(i<1)throw new Error("glog("+i+")");return c.LOG_TABLE[i]},gexp:function(i){for(;i<0;)i+=255;for(;i>=256;)i-=255;return c.EXP_TABLE[i]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},f=0;f<8;f++)c.EXP_TABLE[f]=1<<f;for(var f=8;f<256;f++)c.EXP_TABLE[f]=c.EXP_TABLE[f-4]^c.EXP_TABLE[f-5]^c.EXP_TABLE[f-6]^c.EXP_TABLE[f-8];for(var f=0;f<255;f++)c.LOG_TABLE[c.EXP_TABLE[f]]=f;function u(i,p){if(i.length==null)throw new Error(i.length+"/"+p);for(var m=0;m<i.length&&i[m]==0;)m++;this.num=new Array(i.length-m+p);for(var b=0;b<i.length-m;b++)this.num[b]=i[b+m]}u.prototype={get:function(i){return this.num[i]},getLength:function(){return this.num.length},multiply:function(i){for(var p=new Array(this.getLength()+i.getLength()-1),m=0;m<this.getLength();m++)for(var b=0;b<i.getLength();b++)p[m+b]^=c.gexp(c.glog(this.get(m))+c.glog(i.get(b)));return new u(p,0)},mod:function(i){if(this.getLength()-i.getLength()<0)return this;for(var p=c.glog(this.get(0))-c.glog(i.get(0)),m=new Array(this.getLength()),b=0;b<this.getLength();b++)m[b]=this.get(b);for(var b=0;b<i.getLength();b++)m[b]^=c.gexp(c.glog(i.get(b))+p);return new u(m,0).mod(i)}};function g(i,p){this.totalCount=i,this.dataCount=p}g.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],[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]],g.getRSBlocks=function(i,p){var m=g.getRsBlockTable(i,p);if(m==null)throw new Error("bad rs block @ typeNumber:"+i+"/errorCorrectLevel:"+p);for(var b=m.length/3,d=[],y=0;y<b;y++)for(var w=m[y*3+0],v=m[y*3+1],_=m[y*3+2],C=0;C<w;C++)d.push(new g(v,_));return d},g.getRsBlockTable=function(i,p){switch(p){case t.L:return g.RS_BLOCK_TABLE[(i-1)*4+0];case t.M:return g.RS_BLOCK_TABLE[(i-1)*4+1];case t.Q:return g.RS_BLOCK_TABLE[(i-1)*4+2];case t.H:return g.RS_BLOCK_TABLE[(i-1)*4+3];default:return}};function l(){this.buffer=[],this.length=0}l.prototype={get:function(i){var p=Math.floor(i/8);return(this.buffer[p]>>>7-i%8&1)==1},put:function(i,p){for(var m=0;m<p;m++)this.putBit((i>>>p-m-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(i){var p=Math.floor(this.length/8);this.buffer.length<=p&&this.buffer.push(0),i&&(this.buffer[p]|=128>>>this.length%8),this.length++}};var s=[[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 o(i){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof i=="string"&&(i={content:i}),i)for(var p in i)this.options[p]=i[p];if(typeof this.options.content!="string")throw new Error("Expected 'content' as string!");if(this.options.content.length===0)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0)||!(this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");function m(_){switch(_){case"L":return t.L;case"M":return t.M;case"Q":return t.Q;case"H":return t.H;default:throw new Error("Unknwon error correction level: "+_)}}function b(_,C){for(var S=d(_),I=1,P=0,B=0,$=s.length;B<=$;B++){var z=s[B];if(!z)throw new Error("Content too long: expected "+P+" but got "+S);switch(C){case"L":P=z[0];break;case"M":P=z[1];break;case"Q":P=z[2];break;case"H":P=z[3];break;default:throw new Error("Unknwon error correction level: "+C)}if(S<=P)break;I++}if(I>s.length)throw new Error("Content too long");return I}function d(_){var C=encodeURI(_).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return C.length+(C.length!=_?3:0)}var y=this.options.content,w=b(y,this.options.ecl),v=m(this.options.ecl);this.qrcode=new n(w,v),this.qrcode.addData(y),this.qrcode.make()}return o.prototype.svg=function(i){var p=this.options||{},m=this.qrcode.modules;typeof i>"u"&&(i={container:p.container||"svg"});for(var b=typeof p.pretty<"u"?!!p.pretty:!0,d=b?" ":"",y=b?`\r
|
|
1
|
+
import{e as Ht,c as dr,g as Qu}from"./react-Vu6nbGi5.js";import{F as K,af as Yu}from"./index-C7-iTfFV.js";import{k as hr,e as ms,p as te,i as Ut}from"./ethers-DHDSyreX.js";import{r as Xu}from"./index-COjgItKg.js";import{e as el,b as du,c as tl,d as $s}from"./index-BOwZsNrV.js";import{p as rl,a as nl,b as il}from"./hooks.module-C4R15-Vr.js";import{r as fr}from"./index-C6FQ8I_Q.js";function sl(e,n){for(var r=0;r<n.length;r++){const t=n[r];if(typeof t!="string"&&!Array.isArray(t)){for(const h in t)if(h!=="default"&&!(h in e)){const a=Object.getOwnPropertyDescriptor(t,h);a&&Object.defineProperty(e,h,a.get?a:{enumerable:!0,get:()=>t[h]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var vn={},ot={},at={},Hs;function ol(){if(Hs)return at;Hs=1,Object.defineProperty(at,"__esModule",{value:!0}),at.walletLogo=void 0;const e=(n,r)=>{let t;switch(n){case"standard":return t=r,`data:image/svg+xml,%3Csvg width='${r}' height='${t}' 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 t=r,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${r}' height='${t}' 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 t=(.1*r).toFixed(2),`data:image/svg+xml,%3Csvg width='${r}' height='${t}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return t=(.25*r).toFixed(2),`data:image/svg+xml,%3Csvg width='${r}' height='${t}' 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 t=(.1*r).toFixed(2),`data:image/svg+xml,%3Csvg width='${r}' height='${t}' 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 t=(.25*r).toFixed(2),`data:image/svg+xml,%3Csvg width='${r}' height='${t}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return t=r,`data:image/svg+xml,%3Csvg width='${r}' height='${t}' 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 `}};return at.walletLogo=e,at}var ct={},Us;function al(){return Us||(Us=1,Object.defineProperty(ct,"__esModule",{value:!0}),ct.LINK_API_URL=void 0,ct.LINK_API_URL="https://www.walletlink.org"),ct}var W={},_n={},Ae={},Ws;function gr(){return Ws||(Ws=1,Object.defineProperty(Ae,"__esModule",{value:!0}),Ae.errorValues=Ae.standardErrorCodes=void 0,Ae.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}},Ae.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."}}),Ae}var ut={},En={},Vs;function bs(){return Vs||(Vs=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serialize=e.getErrorCode=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const n=gr(),r="Unspecified error message.";e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function t(o,i=r){if(o&&Number.isInteger(o)){const p=o.toString();if(l(n.errorValues,p))return n.errorValues[p].message;if(u(o))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return i}e.getMessageFromCode=t;function h(o){if(!Number.isInteger(o))return!1;const i=o.toString();return!!(n.errorValues[i]||u(o))}e.isValidCode=h;function a(o){var i;if(typeof o=="number")return o;if(c(o))return(i=o.code)!==null&&i!==void 0?i:o.errorCode}e.getErrorCode=a;function c(o){return typeof o=="object"&&o!==null&&(typeof o.code=="number"||typeof o.errorCode=="number")}function f(o,{shouldIncludeStack:i=!1}={}){const p={};if(o&&typeof o=="object"&&!Array.isArray(o)&&l(o,"code")&&h(o.code)){const m=o;p.code=m.code,m.message&&typeof m.message=="string"?(p.message=m.message,l(m,"data")&&(p.data=m.data)):(p.message=t(p.code),p.data={originalError:g(o)})}else p.code=n.standardErrorCodes.rpc.internal,p.message=s(o,"message")?o.message:r,p.data={originalError:g(o)};return i&&(p.stack=s(o,"stack")?o.stack:void 0),p}e.serialize=f;function u(o){return o>=-32099&&o<=-32e3}function g(o){return o&&typeof o=="object"&&!Array.isArray(o)?Object.assign({},o):o}function l(o,i){return Object.prototype.hasOwnProperty.call(o,i)}function s(o,i){return typeof o=="object"&&o!==null&&i in o&&typeof o[i]=="string"}})(En)),En}var zs;function cl(){if(zs)return ut;zs=1,Object.defineProperty(ut,"__esModule",{value:!0}),ut.standardErrors=void 0;const e=gr(),n=bs();ut.standardErrors={rpc:{parse:u=>r(e.standardErrorCodes.rpc.parse,u),invalidRequest:u=>r(e.standardErrorCodes.rpc.invalidRequest,u),invalidParams:u=>r(e.standardErrorCodes.rpc.invalidParams,u),methodNotFound:u=>r(e.standardErrorCodes.rpc.methodNotFound,u),internal:u=>r(e.standardErrorCodes.rpc.internal,u),server:u=>{if(!u||typeof u!="object"||Array.isArray(u))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:g}=u;if(!Number.isInteger(g)||g>-32005||g<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return r(g,u)},invalidInput:u=>r(e.standardErrorCodes.rpc.invalidInput,u),resourceNotFound:u=>r(e.standardErrorCodes.rpc.resourceNotFound,u),resourceUnavailable:u=>r(e.standardErrorCodes.rpc.resourceUnavailable,u),transactionRejected:u=>r(e.standardErrorCodes.rpc.transactionRejected,u),methodNotSupported:u=>r(e.standardErrorCodes.rpc.methodNotSupported,u),limitExceeded:u=>r(e.standardErrorCodes.rpc.limitExceeded,u)},provider:{userRejectedRequest:u=>t(e.standardErrorCodes.provider.userRejectedRequest,u),unauthorized:u=>t(e.standardErrorCodes.provider.unauthorized,u),unsupportedMethod:u=>t(e.standardErrorCodes.provider.unsupportedMethod,u),disconnected:u=>t(e.standardErrorCodes.provider.disconnected,u),chainDisconnected:u=>t(e.standardErrorCodes.provider.chainDisconnected,u),unsupportedChain:u=>t(e.standardErrorCodes.provider.unsupportedChain,u),custom:u=>{if(!u||typeof u!="object"||Array.isArray(u))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:g,message:l,data:s}=u;if(!l||typeof l!="string")throw new Error('"message" must be a nonempty string');return new c(g,l,s)}}};function r(u,g){const[l,s]=h(g);return new a(u,l||(0,n.getMessageFromCode)(u),s)}function t(u,g){const[l,s]=h(g);return new c(u,l||(0,n.getMessageFromCode)(u),s)}function h(u){if(u){if(typeof u=="string")return[u];if(typeof u=="object"&&!Array.isArray(u)){const{message:g,data:l}=u;if(g&&typeof g!="string")throw new Error("Must specify string message.");return[g||void 0,l]}}return[]}class a extends Error{constructor(g,l,s){if(!Number.isInteger(g))throw new Error('"code" must be an integer.');if(!l||typeof l!="string")throw new Error('"message" must be a nonempty string.');super(l),this.code=g,s!==void 0&&(this.data=s)}}class c extends a{constructor(g,l,s){if(!f(g))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(g,l,s)}}function f(u){return Number.isInteger(u)&&u>=1e3&&u<=4999}return ut}var lt={},dt={},Js;function ys(){if(Js)return dt;Js=1,Object.defineProperty(dt,"__esModule",{value:!0}),dt.isErrorResponse=void 0;function e(n){return n.errorMessage!==void 0}return dt.isErrorResponse=e,dt}var ht={},Gs;function ws(){return Gs||(Gs=1,Object.defineProperty(ht,"__esModule",{value:!0}),ht.LIB_VERSION=void 0,ht.LIB_VERSION="3.9.3"),ht}var Zs;function ul(){if(Zs)return lt;Zs=1,Object.defineProperty(lt,"__esModule",{value:!0}),lt.serializeError=void 0;const e=ys(),n=ws(),r=gr(),t=bs();function h(f,u){const g=(0,t.serialize)(a(f),{shouldIncludeStack:!0}),l=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");l.searchParams.set("version",n.LIB_VERSION),l.searchParams.set("code",g.code.toString());const s=c(g.data,u);return s&&l.searchParams.set("method",s),l.searchParams.set("message",g.message),Object.assign(Object.assign({},g),{docUrl:l.href})}lt.serializeError=h;function a(f){return typeof f=="string"?{message:f,code:r.standardErrorCodes.rpc.internal}:(0,e.isErrorResponse)(f)?Object.assign(Object.assign({},f),{message:f.errorMessage,code:f.errorCode,data:{method:f.method}}):f}function c(f,u){const g=f==null?void 0:f.method;if(g)return g;if(u!==void 0){if(typeof u=="string")return u;if(Array.isArray(u)){if(u.length>0)return u[0].method}else return u.method}}return lt}var Ks;function pr(){return Ks||(Ks=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.standardErrors=e.standardErrorCodes=e.serializeError=e.getMessageFromCode=e.getErrorCode=void 0;const n=gr();Object.defineProperty(e,"standardErrorCodes",{enumerable:!0,get:function(){return n.standardErrorCodes}});const r=cl();Object.defineProperty(e,"standardErrors",{enumerable:!0,get:function(){return r.standardErrors}});const t=ul();Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return t.serializeError}});const h=bs();Object.defineProperty(e,"getErrorCode",{enumerable:!0,get:function(){return h.getErrorCode}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return h.getMessageFromCode}})})(_n)),_n}var oe={},Qs;function mr(){if(Qs)return oe;Qs=1,Object.defineProperty(oe,"__esModule",{value:!0}),oe.ProviderType=oe.RegExpString=oe.IntNumber=oe.BigIntString=oe.AddressString=oe.HexString=oe.OpaqueType=void 0;function e(){return t=>t}oe.OpaqueType=e,oe.HexString=e(),oe.AddressString=e(),oe.BigIntString=e();function n(t){return Math.floor(t)}oe.IntNumber=n,oe.RegExpString=e();var r;return(function(t){t.CoinbaseWallet="CoinbaseWallet",t.MetaMask="MetaMask",t.Unselected=""})(r||(oe.ProviderType=r={})),oe}var Ys;function Re(){if(Ys)return W;Ys=1;var e=W&&W.__importDefault||function(M){return M&&M.__esModule?M:{default:M}};Object.defineProperty(W,"__esModule",{value:!0}),W.isMobileWeb=W.getLocation=W.isInIFrame=W.createQrUrl=W.getFavicon=W.range=W.isBigNumber=W.ensureParsedJSONObject=W.ensureBN=W.ensureRegExpString=W.ensureIntNumber=W.ensureBuffer=W.ensureAddressString=W.ensureEvenLengthHexString=W.ensureHexString=W.isHexString=W.prepend0x=W.strip0x=W.has0xPrefix=W.hexStringFromIntNumber=W.intNumberFromHexString=W.bigIntStringFromBN=W.hexStringFromBuffer=W.hexStringToUint8Array=W.uint8ArrayToHex=W.randomBytesHex=void 0;const n=e(hr()),r=pr(),t=mr(),h=/^[0-9]*$/,a=/^[a-f0-9]*$/;function c(M){return f(crypto.getRandomValues(new Uint8Array(M)))}W.randomBytesHex=c;function f(M){return[...M].map(L=>L.toString(16).padStart(2,"0")).join("")}W.uint8ArrayToHex=f;function u(M){return new Uint8Array(M.match(/.{1,2}/g).map(L=>parseInt(L,16)))}W.hexStringToUint8Array=u;function g(M,L=!1){const T=M.toString("hex");return(0,t.HexString)(L?`0x${T}`:T)}W.hexStringFromBuffer=g;function l(M){return(0,t.BigIntString)(M.toString(10))}W.bigIntStringFromBN=l;function s(M){return(0,t.IntNumber)(new n.default(y(M,!1),16).toNumber())}W.intNumberFromHexString=s;function o(M){return(0,t.HexString)(`0x${new n.default(M).toString(16)}`)}W.hexStringFromIntNumber=o;function i(M){return M.startsWith("0x")||M.startsWith("0X")}W.has0xPrefix=i;function p(M){return i(M)?M.slice(2):M}W.strip0x=p;function m(M){return i(M)?`0x${M.slice(2)}`:`0x${M}`}W.prepend0x=m;function b(M){if(typeof M!="string")return!1;const L=p(M).toLowerCase();return a.test(L)}W.isHexString=b;function d(M,L=!1){if(typeof M=="string"){const T=p(M).toLowerCase();if(a.test(T))return(0,t.HexString)(L?`0x${T}`:T)}throw r.standardErrors.rpc.invalidParams(`"${String(M)}" is not a hexadecimal string`)}W.ensureHexString=d;function y(M,L=!1){let T=d(M,!1);return T.length%2===1&&(T=(0,t.HexString)(`0${T}`)),L?(0,t.HexString)(`0x${T}`):T}W.ensureEvenLengthHexString=y;function w(M){if(typeof M=="string"){const L=p(M).toLowerCase();if(b(L)&&L.length===40)return(0,t.AddressString)(m(L))}throw r.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(M)}`)}W.ensureAddressString=w;function v(M){if(K.isBuffer(M))return M;if(typeof M=="string"){if(b(M)){const L=y(M,!1);return K.from(L,"hex")}return K.from(M,"utf8")}throw r.standardErrors.rpc.invalidParams(`Not binary data: ${String(M)}`)}W.ensureBuffer=v;function _(M){if(typeof M=="number"&&Number.isInteger(M))return(0,t.IntNumber)(M);if(typeof M=="string"){if(h.test(M))return(0,t.IntNumber)(Number(M));if(b(M))return(0,t.IntNumber)(new n.default(y(M,!1),16).toNumber())}throw r.standardErrors.rpc.invalidParams(`Not an integer: ${String(M)}`)}W.ensureIntNumber=_;function C(M){if(M instanceof RegExp)return(0,t.RegExpString)(M.toString());throw r.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(M)}`)}W.ensureRegExpString=C;function S(M){if(M!==null&&(n.default.isBN(M)||P(M)))return new n.default(M.toString(10),10);if(typeof M=="number")return new n.default(_(M));if(typeof M=="string"){if(h.test(M))return new n.default(M,10);if(b(M))return new n.default(y(M,!1),16)}throw r.standardErrors.rpc.invalidParams(`Not an integer: ${String(M)}`)}W.ensureBN=S;function I(M){if(typeof M=="string")return JSON.parse(M);if(typeof M=="object")return M;throw r.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(M)}`)}W.ensureParsedJSONObject=I;function P(M){if(M==null||typeof M.constructor!="function")return!1;const{constructor:L}=M;return typeof L.config=="function"&&typeof L.EUCLID=="number"}W.isBigNumber=P;function B(M,L){return Array.from({length:L-M},(T,x)=>M+x)}W.range=B;function $(){const M=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:L,host:T}=document.location,x=M?M.getAttribute("href"):null;return!x||x.startsWith("javascript:")||x.startsWith("vbscript:")?null:x.startsWith("http://")||x.startsWith("https://")||x.startsWith("data:")?x:x.startsWith("//")?L+x:`${L}//${T}${x}`}W.getFavicon=$;function z(M,L,T,x,D,V){const F=x?"parent-id":"id",j=new URLSearchParams({[F]:M,secret:L,server:T,v:D,chainId:V.toString()}).toString();return`${T}/#/link?${j}`}W.createQrUrl=z;function X(){try{return window.frameElement!==null}catch{return!1}}W.isInIFrame=X;function Y(){try{return X()&&window.top?window.top.location:window.location}catch{return window.location}}W.getLocation=Y;function J(){var M;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((M=window==null?void 0:window.navigator)===null||M===void 0?void 0:M.userAgent)}return W.isMobileWeb=J,W}var ft={},Xs;function ll(){if(Xs)return ft;Xs=1,Object.defineProperty(ft,"__esModule",{value:!0}),ft.ScopedLocalStorage=void 0;let e=class{constructor(r){this.scope=r}setItem(r,t){localStorage.setItem(this.scopedKey(r),t)}getItem(r){return localStorage.getItem(this.scopedKey(r))}removeItem(r){localStorage.removeItem(this.scopedKey(r))}clear(){const r=this.scopedKey(""),t=[];for(let h=0;h<localStorage.length;h++){const a=localStorage.key(h);typeof a=="string"&&a.startsWith(r)&&t.push(a)}t.forEach(h=>localStorage.removeItem(h))}scopedKey(r){return`${this.scope}:${r}`}};return ft.ScopedLocalStorage=e,ft}var Me={},gt={},pt={},mt={},eo;function vs(){return eo||(eo=1,Object.defineProperty(mt,"__esModule",{value:!0}),mt.EVENTS=void 0,mt.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"}),mt}var de={},to;function _s(){if(to)return de;to=1,Object.defineProperty(de,"__esModule",{value:!0}),de.RelayAbstract=de.APP_VERSION_KEY=de.LOCAL_STORAGE_ADDRESSES_KEY=de.WALLET_USER_NAME_KEY=void 0;const e=pr();de.WALLET_USER_NAME_KEY="walletUsername",de.LOCAL_STORAGE_ADDRESSES_KEY="Addresses",de.APP_VERSION_KEY="AppVersion";let n=class{async makeEthereumJSONRPCRequest(t,h){if(!h)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(h,{method:"POST",body:JSON.stringify(t),mode:"cors",headers:{"Content-Type":"application/json"}}).then(a=>a.json()).then(a=>{if(!a)throw e.standardErrors.rpc.parse({});const c=a,{error:f}=c;if(f)throw(0,e.serializeError)(f,t.method);return c})}};return de.RelayAbstract=n,de}var bt={},ro;function Es(){if(ro)return bt;ro=1,Object.defineProperty(bt,"__esModule",{value:!0}),bt.Session=void 0;const e=el(),n=Re(),r="session:id",t="session:secret",h="session:linked";let a=class hu{constructor(f,u,g,l){this._storage=f,this._id=u||(0,n.randomBytesHex)(16),this._secret=g||(0,n.randomBytesHex)(32),this._key=new e.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!l}static load(f){const u=f.getItem(r),g=f.getItem(h),l=f.getItem(t);return u&&l?new hu(f,u,l,g==="1"):null}static hash(f){return new e.sha256().update(f).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(f){this._linked=f,this.persistLinked()}save(){return this._storage.setItem(r,this._id),this._storage.setItem(t,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(h,this._linked?"1":"0")}};return bt.Session=a,bt}var yt={},wt={},no;function dl(){if(no)return wt;no=1,Object.defineProperty(wt,"__esModule",{value:!0}),wt.Cipher=void 0;const e=Re();let n=class{constructor(t){this.secret=t}async encrypt(t){const h=this.secret;if(h.length!==64)throw Error("secret must be 256 bits");const a=crypto.getRandomValues(new Uint8Array(12)),c=await crypto.subtle.importKey("raw",(0,e.hexStringToUint8Array)(h),{name:"aes-gcm"},!1,["encrypt","decrypt"]),f=new TextEncoder,u=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:a},c,f.encode(t)),g=16,l=u.slice(u.byteLength-g),s=u.slice(0,u.byteLength-g),o=new Uint8Array(l),i=new Uint8Array(s),p=new Uint8Array([...a,...o,...i]);return(0,e.uint8ArrayToHex)(p)}async decrypt(t){const h=this.secret;if(h.length!==64)throw Error("secret must be 256 bits");return new Promise((a,c)=>{(async function(){const f=await crypto.subtle.importKey("raw",(0,e.hexStringToUint8Array)(h),{name:"aes-gcm"},!1,["encrypt","decrypt"]),u=(0,e.hexStringToUint8Array)(t),g=u.slice(0,12),l=u.slice(12,28),s=u.slice(28),o=new Uint8Array([...s,...l]),i={name:"AES-GCM",iv:new Uint8Array(g)};try{const p=await window.crypto.subtle.decrypt(i,f,o),m=new TextDecoder;a(m.decode(p))}catch(p){c(p)}})()})}};return wt.Cipher=n,wt}var vt={},io;function hl(){if(io)return vt;io=1,Object.defineProperty(vt,"__esModule",{value:!0}),vt.WalletLinkHTTP=void 0;let e=class{constructor(r,t,h){this.linkAPIUrl=r,this.sessionId=t;const a=`${t}:${h}`;this.auth=`Basic ${btoa(a)}`}async markUnseenEventsAsSeen(r){return Promise.all(r.map(t=>fetch(`${this.linkAPIUrl}/events/${t.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(t=>console.error("Unabled to mark event as failed:",t))}async fetchUnseenEvents(){var r;const t=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(t.ok){const{events:h,error:a}=await t.json();if(a)throw new Error(`Check unseen events failed: ${a}`);const c=(r=h==null?void 0:h.filter(f=>f.event==="Web3Response").map(f=>({type:"Event",sessionId:this.sessionId,eventId:f.id,event:f.event,data:f.data})))!==null&&r!==void 0?r:[];return this.markUnseenEventsAsSeen(c),c}throw new Error(`Check unseen events failed: ${t.status}`)}};return vt.WalletLinkHTTP=e,vt}var Le={},so;function fl(){if(so)return Le;so=1,Object.defineProperty(Le,"__esModule",{value:!0}),Le.WalletLinkWebSocket=Le.ConnectionState=void 0;var e;(function(r){r[r.DISCONNECTED=0]="DISCONNECTED",r[r.CONNECTING=1]="CONNECTING",r[r.CONNECTED=2]="CONNECTED"})(e||(Le.ConnectionState=e={}));let n=class{setConnectionStateListener(t){this.connectionStateListener=t}setIncomingDataListener(t){this.incomingDataListener=t}constructor(t,h=WebSocket){this.WebSocketClass=h,this.webSocket=null,this.pendingData=[],this.url=t.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((t,h)=>{var a;let c;try{this.webSocket=c=new this.WebSocketClass(this.url)}catch(f){h(f);return}(a=this.connectionStateListener)===null||a===void 0||a.call(this,e.CONNECTING),c.onclose=f=>{var u;this.clearWebSocket(),h(new Error(`websocket error ${f.code}: ${f.reason}`)),(u=this.connectionStateListener)===null||u===void 0||u.call(this,e.DISCONNECTED)},c.onopen=f=>{var u;t(),(u=this.connectionStateListener)===null||u===void 0||u.call(this,e.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(l=>this.sendData(l)),this.pendingData=[])},c.onmessage=f=>{var u,g;if(f.data==="h")(u=this.incomingDataListener)===null||u===void 0||u.call(this,{type:"Heartbeat"});else try{const l=JSON.parse(f.data);(g=this.incomingDataListener)===null||g===void 0||g.call(this,l)}catch{}}})}disconnect(){var t;const{webSocket:h}=this;if(h){this.clearWebSocket(),(t=this.connectionStateListener)===null||t===void 0||t.call(this,e.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{h.close()}catch{}}}sendData(t){const{webSocket:h}=this;if(!h){this.pendingData.push(t),this.connect();return}h.send(t)}clearWebSocket(){const{webSocket:t}=this;t&&(this.webSocket=null,t.onclose=null,t.onerror=null,t.onmessage=null,t.onopen=null)}};return Le.WalletLinkWebSocket=n,Le}var oo;function gl(){if(oo)return yt;oo=1,Object.defineProperty(yt,"__esModule",{value:!0}),yt.WalletLinkConnection=void 0;const e=mr(),n=dl(),r=vs(),t=_s(),h=Es(),a=hl(),c=fl(),f=1e4,u=6e4;let g=class{constructor({session:s,linkAPIUrl:o,listener:i,diagnostic:p,WebSocketClass:m=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,e.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=d=>{if(!d)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",w=>d.JsonRpcUrl&&this.handleChainUpdated(w,d.JsonRpcUrl)]]).forEach((w,v)=>{const _=d[v];_!==void 0&&w(_)})},this.handleDestroyed=d=>{var y,w;d==="1"&&((y=this.listener)===null||y===void 0||y.resetAndReload(),(w=this.diagnostic)===null||w===void 0||w.log(r.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:this.isDestroyed,sessionIdHash:h.Session.hash(this.session.id)}))},this.handleAccountUpdated=async d=>{var y,w;try{const v=await this.cipher.decrypt(d);(y=this.listener)===null||y===void 0||y.accountUpdated(v)}catch{(w=this.diagnostic)===null||w===void 0||w.log(r.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}},this.handleMetadataUpdated=async(d,y)=>{var w,v;try{const _=await this.cipher.decrypt(y);(w=this.listener)===null||w===void 0||w.metadataUpdated(d,_)}catch{(v=this.diagnostic)===null||v===void 0||v.log(r.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:d})}},this.handleWalletUsernameUpdated=async d=>{this.handleMetadataUpdated(t.WALLET_USER_NAME_KEY,d)},this.handleAppVersionUpdated=async d=>{this.handleMetadataUpdated(t.APP_VERSION_KEY,d)},this.handleChainUpdated=async(d,y)=>{var w,v;try{const _=await this.cipher.decrypt(d),C=await this.cipher.decrypt(y);(w=this.listener)===null||w===void 0||w.chainUpdated(_,C)}catch{(v=this.diagnostic)===null||v===void 0||v.log(r.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}},this.session=s,this.cipher=new n.Cipher(s.secret),this.diagnostic=p,this.listener=i;const b=new c.WalletLinkWebSocket(`${o}/rpc`,m);b.setConnectionStateListener(async d=>{var y;(y=this.diagnostic)===null||y===void 0||y.log(r.EVENTS.CONNECTED_STATE_CHANGE,{state:d,sessionIdHash:h.Session.hash(s.id)});let w=!1;switch(d){case c.ConnectionState.DISCONNECTED:if(!this.destroyed){const v=async()=>{await new Promise(_=>setTimeout(_,5e3)),this.destroyed||b.connect().catch(()=>{v()})};v()}break;case c.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),w=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},f),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case c.ConnectionState.CONNECTING:break}this.connected!==w&&(this.connected=w)}),b.setIncomingDataListener(d=>{var y,w,v;switch(d.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const _=d.type==="IsLinkedOK"?d.linked:void 0;(y=this.diagnostic)===null||y===void 0||y.log(r.EVENTS.LINKED,{sessionIdHash:h.Session.hash(s.id),linked:_,type:d.type,onlineGuests:d.onlineGuests}),this.linked=_||d.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{(w=this.diagnostic)===null||w===void 0||w.log(r.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:h.Session.hash(s.id),metadata_keys:d&&d.metadata?Object.keys(d.metadata):void 0}),this.handleSessionMetadataUpdated(d.metadata);break}case"Event":{this.handleIncomingEvent(d);break}}d.id!==void 0&&((v=this.requestResolutions.get(d.id))===null||v===void 0||v(d))}),this.ws=b,this.http=new a.WalletLinkHTTP(o,s.id,s.key)}connect(){var s;if(this.destroyed)throw new Error("instance is destroyed");(s=this.diagnostic)===null||s===void 0||s.log(r.EVENTS.STARTED_CONNECTING,{sessionIdHash:h.Session.hash(this.session.id)}),this.ws.connect()}destroy(){var s;this.destroyed=!0,this.ws.disconnect(),(s=this.diagnostic)===null||s===void 0||s.log(r.EVENTS.DISCONNECTED,{sessionIdHash:h.Session.hash(this.session.id)}),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(s){var o,i;this._connected=s,s&&((o=this.onceConnected)===null||o===void 0||o.call(this)),(i=this.listener)===null||i===void 0||i.connectedUpdated(s)}setOnceConnected(s){return new Promise(o=>{this.connected?s().then(o):this.onceConnected=()=>{s().then(o),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(s){var o,i;this._linked=s,s&&((o=this.onceLinked)===null||o===void 0||o.call(this)),(i=this.listener)===null||i===void 0||i.linkedUpdated(s)}setOnceLinked(s){return new Promise(o=>{this.linked?s().then(o):this.onceLinked=()=>{s().then(o),this.onceLinked=void 0}})}async handleIncomingEvent(s){var o,i;if(!(s.type!=="Event"||s.event!=="Web3Response"))try{const p=await this.cipher.decrypt(s.data),m=JSON.parse(p);if(m.type!=="WEB3_RESPONSE")return;(o=this.listener)===null||o===void 0||o.handleWeb3ResponseMessage(m)}catch{(i=this.diagnostic)===null||i===void 0||i.log(r.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(s=>setTimeout(s,250));try{await this.fetchUnseenEventsAPI()}catch(s){console.error("Unable to check for unseen events",s)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(o=>this.handleIncomingEvent(o))}async setSessionMetadata(s,o){const i={type:"SetSessionConfig",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[s]:o}};return this.setOnceConnected(async()=>{const p=await this.makeRequest(i);if(p.type==="Fail")throw new Error(p.error||"failed to set session metadata")})}async publishEvent(s,o,i=!1){const p=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},o),{origin:location.origin,relaySource:window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),m={type:"PublishEvent",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:s,data:p,callWebhook:i};return this.setOnceLinked(async()=>{const b=await this.makeRequest(m);if(b.type==="Fail")throw new Error(b.error||"failed to publish event");return b.eventId})}sendData(s){this.ws.sendData(JSON.stringify(s))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>f*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(s,o=u){const i=s.id;this.sendData(s);let p;return Promise.race([new Promise((m,b)=>{p=window.setTimeout(()=>{b(new Error(`request ${i} timed out`))},o)}),new Promise(m=>{this.requestResolutions.set(i,b=>{clearTimeout(p),m(b),this.requestResolutions.delete(i)})})])}async authenticate(){const s={type:"HostSession",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},o=await this.makeRequest(s);if(o.type==="Fail")throw new Error(o.error||"failed to authentcate")}sendIsLinked(){const s={type:"IsLinked",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(s)}sendGetSessionConfig(){const s={type:"GetSessionConfig",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(s)}};return yt.WalletLinkConnection=g,yt}var _t={},Te={},Qt={},ao;function pl(){return ao||(ao=1,Object.defineProperty(Qt,"__esModule",{value:!0}),Qt.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}'),Qt}var co;function fu(){if(co)return Te;co=1;var e=Te&&Te.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Te,"__esModule",{value:!0}),Te.injectCssReset=void 0;const n=e(pl());function r(){const t=document.createElement("style");t.type="text/css",t.appendChild(document.createTextNode(n.default)),document.documentElement.appendChild(t)}return Te.injectCssReset=r,Te}var Et={};const ce=Ht(rl);var Ne={};const Wt=Ht(nl),br=Ht(il);var _e={},Rt={},uo;function ml(){if(uo)return Rt;uo=1,Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.CloseIcon=void 0;const e=ce;function n(r){return(0,e.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r),(0,e.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"}))}return Rt.CloseIcon=n,Rt}var St={},lo;function bl(){if(lo)return St;lo=1,Object.defineProperty(St,"__esModule",{value:!0}),St.CoinbaseWalletRound=void 0;const e=ce;function n(r){return(0,e.h)("svg",Object.assign({width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r),(0,e.h)("circle",{cx:"14",cy:"14",r:"14",fill:"#0052FF"}),(0,e.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,e.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"}))}return St.CoinbaseWalletRound=n,St}var Ct={},ho;function yl(){if(ho)return Ct;ho=1,Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.QRCodeIcon=void 0;const e=ce;function n(r){return(0,e.h)("svg",Object.assign({width:"18",height:"18",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},r),(0,e.h)("path",{d:"M3 3V8.99939L5 8.99996V5H9V3H3Z"}),(0,e.h)("path",{d:"M15 21L21 21V15.0006L19 15V19L15 19V21Z"}),(0,e.h)("path",{d:"M21 9H19V5H15.0006L15 3H21V9Z"}),(0,e.h)("path",{d:"M3 15V21H8.99939L8.99996 19H5L5 15H3Z"}))}return Ct.QRCodeIcon=n,Ct}var Pe={},Rn,fo;function wl(){if(fo)return Rn;fo=1;function e(i){this.mode=r.MODE_8BIT_BYTE,this.data=i,this.parsedData=[];for(var p=0,m=this.data.length;p<m;p++){var b=[],d=this.data.charCodeAt(p);d>65536?(b[0]=240|(d&1835008)>>>18,b[1]=128|(d&258048)>>>12,b[2]=128|(d&4032)>>>6,b[3]=128|d&63):d>2048?(b[0]=224|(d&61440)>>>12,b[1]=128|(d&4032)>>>6,b[2]=128|d&63):d>128?(b[0]=192|(d&1984)>>>6,b[1]=128|d&63):b[0]=d,this.parsedData.push(b)}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))}e.prototype={getLength:function(i){return this.parsedData.length},write:function(i){for(var p=0,m=this.parsedData.length;p<m;p++)i.put(this.parsedData[p],8)}};function n(i,p){this.typeNumber=i,this.errorCorrectLevel=p,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}n.prototype={addData:function(i){var p=new e(i);this.dataList.push(p),this.dataCache=null},isDark:function(i,p){if(i<0||this.moduleCount<=i||p<0||this.moduleCount<=p)throw new Error(i+","+p);return this.modules[i][p]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(i,p){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var m=0;m<this.moduleCount;m++){this.modules[m]=new Array(this.moduleCount);for(var b=0;b<this.moduleCount;b++)this.modules[m][b]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(i,p),this.typeNumber>=7&&this.setupTypeNumber(i),this.dataCache==null&&(this.dataCache=n.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,p)},setupPositionProbePattern:function(i,p){for(var m=-1;m<=7;m++)if(!(i+m<=-1||this.moduleCount<=i+m))for(var b=-1;b<=7;b++)p+b<=-1||this.moduleCount<=p+b||(0<=m&&m<=6&&(b==0||b==6)||0<=b&&b<=6&&(m==0||m==6)||2<=m&&m<=4&&2<=b&&b<=4?this.modules[i+m][p+b]=!0:this.modules[i+m][p+b]=!1)},getBestMaskPattern:function(){for(var i=0,p=0,m=0;m<8;m++){this.makeImpl(!0,m);var b=a.getLostPoint(this);(m==0||i>b)&&(i=b,p=m)}return p},createMovieClip:function(i,p,m){var b=i.createEmptyMovieClip(p,m),d=1;this.make();for(var y=0;y<this.modules.length;y++)for(var w=y*d,v=0;v<this.modules[y].length;v++){var _=v*d,C=this.modules[y][v];C&&(b.beginFill(0,100),b.moveTo(_,w),b.lineTo(_+d,w),b.lineTo(_+d,w+d),b.lineTo(_,w+d),b.endFill())}return b},setupTimingPattern:function(){for(var i=8;i<this.moduleCount-8;i++)this.modules[i][6]==null&&(this.modules[i][6]=i%2==0);for(var p=8;p<this.moduleCount-8;p++)this.modules[6][p]==null&&(this.modules[6][p]=p%2==0)},setupPositionAdjustPattern:function(){for(var i=a.getPatternPosition(this.typeNumber),p=0;p<i.length;p++)for(var m=0;m<i.length;m++){var b=i[p],d=i[m];if(this.modules[b][d]==null)for(var y=-2;y<=2;y++)for(var w=-2;w<=2;w++)y==-2||y==2||w==-2||w==2||y==0&&w==0?this.modules[b+y][d+w]=!0:this.modules[b+y][d+w]=!1}},setupTypeNumber:function(i){for(var p=a.getBCHTypeNumber(this.typeNumber),m=0;m<18;m++){var b=!i&&(p>>m&1)==1;this.modules[Math.floor(m/3)][m%3+this.moduleCount-8-3]=b}for(var m=0;m<18;m++){var b=!i&&(p>>m&1)==1;this.modules[m%3+this.moduleCount-8-3][Math.floor(m/3)]=b}},setupTypeInfo:function(i,p){for(var m=this.errorCorrectLevel<<3|p,b=a.getBCHTypeInfo(m),d=0;d<15;d++){var y=!i&&(b>>d&1)==1;d<6?this.modules[d][8]=y:d<8?this.modules[d+1][8]=y:this.modules[this.moduleCount-15+d][8]=y}for(var d=0;d<15;d++){var y=!i&&(b>>d&1)==1;d<8?this.modules[8][this.moduleCount-d-1]=y:d<9?this.modules[8][15-d-1+1]=y:this.modules[8][15-d-1]=y}this.modules[this.moduleCount-8][8]=!i},mapData:function(i,p){for(var m=-1,b=this.moduleCount-1,d=7,y=0,w=this.moduleCount-1;w>0;w-=2)for(w==6&&w--;;){for(var v=0;v<2;v++)if(this.modules[b][w-v]==null){var _=!1;y<i.length&&(_=(i[y]>>>d&1)==1);var C=a.getMask(p,b,w-v);C&&(_=!_),this.modules[b][w-v]=_,d--,d==-1&&(y++,d=7)}if(b+=m,b<0||this.moduleCount<=b){b-=m,m=-m;break}}}},n.PAD0=236,n.PAD1=17,n.createData=function(i,p,m){for(var b=g.getRSBlocks(i,p),d=new l,y=0;y<m.length;y++){var w=m[y];d.put(w.mode,4),d.put(w.getLength(),a.getLengthInBits(w.mode,i)),w.write(d)}for(var v=0,y=0;y<b.length;y++)v+=b[y].dataCount;if(d.getLengthInBits()>v*8)throw new Error("code length overflow. ("+d.getLengthInBits()+">"+v*8+")");for(d.getLengthInBits()+4<=v*8&&d.put(0,4);d.getLengthInBits()%8!=0;)d.putBit(!1);for(;!(d.getLengthInBits()>=v*8||(d.put(n.PAD0,8),d.getLengthInBits()>=v*8));)d.put(n.PAD1,8);return n.createBytes(d,b)},n.createBytes=function(i,p){for(var m=0,b=0,d=0,y=new Array(p.length),w=new Array(p.length),v=0;v<p.length;v++){var _=p[v].dataCount,C=p[v].totalCount-_;b=Math.max(b,_),d=Math.max(d,C),y[v]=new Array(_);for(var S=0;S<y[v].length;S++)y[v][S]=255&i.buffer[S+m];m+=_;var I=a.getErrorCorrectPolynomial(C),P=new u(y[v],I.getLength()-1),B=P.mod(I);w[v]=new Array(I.getLength()-1);for(var S=0;S<w[v].length;S++){var $=S+B.getLength()-w[v].length;w[v][S]=$>=0?B.get($):0}}for(var z=0,S=0;S<p.length;S++)z+=p[S].totalCount;for(var X=new Array(z),Y=0,S=0;S<b;S++)for(var v=0;v<p.length;v++)S<y[v].length&&(X[Y++]=y[v][S]);for(var S=0;S<d;S++)for(var v=0;v<p.length;v++)S<w[v].length&&(X[Y++]=w[v][S]);return X};for(var r={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},t={L:1,M:0,Q:3,H:2},h={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},a={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(i){for(var p=i<<10;a.getBCHDigit(p)-a.getBCHDigit(a.G15)>=0;)p^=a.G15<<a.getBCHDigit(p)-a.getBCHDigit(a.G15);return(i<<10|p)^a.G15_MASK},getBCHTypeNumber:function(i){for(var p=i<<12;a.getBCHDigit(p)-a.getBCHDigit(a.G18)>=0;)p^=a.G18<<a.getBCHDigit(p)-a.getBCHDigit(a.G18);return i<<12|p},getBCHDigit:function(i){for(var p=0;i!=0;)p++,i>>>=1;return p},getPatternPosition:function(i){return a.PATTERN_POSITION_TABLE[i-1]},getMask:function(i,p,m){switch(i){case h.PATTERN000:return(p+m)%2==0;case h.PATTERN001:return p%2==0;case h.PATTERN010:return m%3==0;case h.PATTERN011:return(p+m)%3==0;case h.PATTERN100:return(Math.floor(p/2)+Math.floor(m/3))%2==0;case h.PATTERN101:return p*m%2+p*m%3==0;case h.PATTERN110:return(p*m%2+p*m%3)%2==0;case h.PATTERN111:return(p*m%3+(p+m)%2)%2==0;default:throw new Error("bad maskPattern:"+i)}},getErrorCorrectPolynomial:function(i){for(var p=new u([1],0),m=0;m<i;m++)p=p.multiply(new u([1,c.gexp(m)],0));return p},getLengthInBits:function(i,p){if(1<=p&&p<10)switch(i){case r.MODE_NUMBER:return 10;case r.MODE_ALPHA_NUM:return 9;case r.MODE_8BIT_BYTE:return 8;case r.MODE_KANJI:return 8;default:throw new Error("mode:"+i)}else if(p<27)switch(i){case r.MODE_NUMBER:return 12;case r.MODE_ALPHA_NUM:return 11;case r.MODE_8BIT_BYTE:return 16;case r.MODE_KANJI:return 10;default:throw new Error("mode:"+i)}else if(p<41)switch(i){case r.MODE_NUMBER:return 14;case r.MODE_ALPHA_NUM:return 13;case r.MODE_8BIT_BYTE:return 16;case r.MODE_KANJI:return 12;default:throw new Error("mode:"+i)}else throw new Error("type:"+p)},getLostPoint:function(i){for(var p=i.getModuleCount(),m=0,b=0;b<p;b++)for(var d=0;d<p;d++){for(var y=0,w=i.isDark(b,d),v=-1;v<=1;v++)if(!(b+v<0||p<=b+v))for(var _=-1;_<=1;_++)d+_<0||p<=d+_||v==0&&_==0||w==i.isDark(b+v,d+_)&&y++;y>5&&(m+=3+y-5)}for(var b=0;b<p-1;b++)for(var d=0;d<p-1;d++){var C=0;i.isDark(b,d)&&C++,i.isDark(b+1,d)&&C++,i.isDark(b,d+1)&&C++,i.isDark(b+1,d+1)&&C++,(C==0||C==4)&&(m+=3)}for(var b=0;b<p;b++)for(var d=0;d<p-6;d++)i.isDark(b,d)&&!i.isDark(b,d+1)&&i.isDark(b,d+2)&&i.isDark(b,d+3)&&i.isDark(b,d+4)&&!i.isDark(b,d+5)&&i.isDark(b,d+6)&&(m+=40);for(var d=0;d<p;d++)for(var b=0;b<p-6;b++)i.isDark(b,d)&&!i.isDark(b+1,d)&&i.isDark(b+2,d)&&i.isDark(b+3,d)&&i.isDark(b+4,d)&&!i.isDark(b+5,d)&&i.isDark(b+6,d)&&(m+=40);for(var S=0,d=0;d<p;d++)for(var b=0;b<p;b++)i.isDark(b,d)&&S++;var I=Math.abs(100*S/p/p-50)/5;return m+=I*10,m}},c={glog:function(i){if(i<1)throw new Error("glog("+i+")");return c.LOG_TABLE[i]},gexp:function(i){for(;i<0;)i+=255;for(;i>=256;)i-=255;return c.EXP_TABLE[i]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},f=0;f<8;f++)c.EXP_TABLE[f]=1<<f;for(var f=8;f<256;f++)c.EXP_TABLE[f]=c.EXP_TABLE[f-4]^c.EXP_TABLE[f-5]^c.EXP_TABLE[f-6]^c.EXP_TABLE[f-8];for(var f=0;f<255;f++)c.LOG_TABLE[c.EXP_TABLE[f]]=f;function u(i,p){if(i.length==null)throw new Error(i.length+"/"+p);for(var m=0;m<i.length&&i[m]==0;)m++;this.num=new Array(i.length-m+p);for(var b=0;b<i.length-m;b++)this.num[b]=i[b+m]}u.prototype={get:function(i){return this.num[i]},getLength:function(){return this.num.length},multiply:function(i){for(var p=new Array(this.getLength()+i.getLength()-1),m=0;m<this.getLength();m++)for(var b=0;b<i.getLength();b++)p[m+b]^=c.gexp(c.glog(this.get(m))+c.glog(i.get(b)));return new u(p,0)},mod:function(i){if(this.getLength()-i.getLength()<0)return this;for(var p=c.glog(this.get(0))-c.glog(i.get(0)),m=new Array(this.getLength()),b=0;b<this.getLength();b++)m[b]=this.get(b);for(var b=0;b<i.getLength();b++)m[b]^=c.gexp(c.glog(i.get(b))+p);return new u(m,0).mod(i)}};function g(i,p){this.totalCount=i,this.dataCount=p}g.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],[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]],g.getRSBlocks=function(i,p){var m=g.getRsBlockTable(i,p);if(m==null)throw new Error("bad rs block @ typeNumber:"+i+"/errorCorrectLevel:"+p);for(var b=m.length/3,d=[],y=0;y<b;y++)for(var w=m[y*3+0],v=m[y*3+1],_=m[y*3+2],C=0;C<w;C++)d.push(new g(v,_));return d},g.getRsBlockTable=function(i,p){switch(p){case t.L:return g.RS_BLOCK_TABLE[(i-1)*4+0];case t.M:return g.RS_BLOCK_TABLE[(i-1)*4+1];case t.Q:return g.RS_BLOCK_TABLE[(i-1)*4+2];case t.H:return g.RS_BLOCK_TABLE[(i-1)*4+3];default:return}};function l(){this.buffer=[],this.length=0}l.prototype={get:function(i){var p=Math.floor(i/8);return(this.buffer[p]>>>7-i%8&1)==1},put:function(i,p){for(var m=0;m<p;m++)this.putBit((i>>>p-m-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(i){var p=Math.floor(this.length/8);this.buffer.length<=p&&this.buffer.push(0),i&&(this.buffer[p]|=128>>>this.length%8),this.length++}};var s=[[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 o(i){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof i=="string"&&(i={content:i}),i)for(var p in i)this.options[p]=i[p];if(typeof this.options.content!="string")throw new Error("Expected 'content' as string!");if(this.options.content.length===0)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0)||!(this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");function m(_){switch(_){case"L":return t.L;case"M":return t.M;case"Q":return t.Q;case"H":return t.H;default:throw new Error("Unknwon error correction level: "+_)}}function b(_,C){for(var S=d(_),I=1,P=0,B=0,$=s.length;B<=$;B++){var z=s[B];if(!z)throw new Error("Content too long: expected "+P+" but got "+S);switch(C){case"L":P=z[0];break;case"M":P=z[1];break;case"Q":P=z[2];break;case"H":P=z[3];break;default:throw new Error("Unknwon error correction level: "+C)}if(S<=P)break;I++}if(I>s.length)throw new Error("Content too long");return I}function d(_){var C=encodeURI(_).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return C.length+(C.length!=_?3:0)}var y=this.options.content,w=b(y,this.options.ecl),v=m(this.options.ecl);this.qrcode=new n(w,v),this.qrcode.addData(y),this.qrcode.make()}return o.prototype.svg=function(i){var p=this.options||{},m=this.qrcode.modules;typeof i>"u"&&(i={container:p.container||"svg"});for(var b=typeof p.pretty<"u"?!!p.pretty:!0,d=b?" ":"",y=b?`\r
|
|
2
2
|
`:"",w=p.width,v=p.height,_=m.length,C=w/(_+2*p.padding),S=v/(_+2*p.padding),I=typeof p.join<"u"?!!p.join:!1,P=typeof p.swap<"u"?!!p.swap:!1,B=typeof p.xmlDeclaration<"u"?!!p.xmlDeclaration:!0,$=typeof p.predefined<"u"?!!p.predefined:!1,z=$?d+'<defs><path id="qrmodule" d="M0 0 h'+S+" v"+C+' H0 z" style="fill:'+p.color+';shape-rendering:crispEdges;" /></defs>'+y:"",X=d+'<rect x="0" y="0" width="'+w+'" height="'+v+'" style="fill:'+p.background+';shape-rendering:crispEdges;"/>'+y,Y="",J="",M=0;M<_;M++)for(var L=0;L<_;L++){var T=m[L][M];if(T){var x=L*C+p.padding*C,D=M*S+p.padding*S;if(P){var V=x;x=D,D=V}if(I){var F=C+x,j=S+D;x=Number.isInteger(x)?Number(x):x.toFixed(2),D=Number.isInteger(D)?Number(D):D.toFixed(2),F=Number.isInteger(F)?Number(F):F.toFixed(2),j=Number.isInteger(j)?Number(j):j.toFixed(2),J+="M"+x+","+D+" V"+j+" H"+F+" V"+D+" H"+x+" Z "}else $?Y+=d+'<use x="'+x.toString()+'" y="'+D.toString()+'" href="#qrmodule" />'+y:Y+=d+'<rect x="'+x.toString()+'" y="'+D.toString()+'" width="'+C+'" height="'+S+'" style="fill:'+p.color+';shape-rendering:crispEdges;"/>'+y}}I&&(Y=d+'<path x="0" y="0" style="fill:'+p.color+';shape-rendering:crispEdges;" d="'+J+'" />');let G="";if(this.options.image!==void 0&&this.options.image.svg){const k=w*this.options.image.width/100,A=v*this.options.image.height/100,N=w/2-k/2,U=v/2-A/2;G+=`<svg x="${N}" y="${U}" width="${k}" height="${A}" viewBox="0 0 100 100" preserveAspectRatio="xMinYMin meet">`,G+=this.options.image.svg+y,G+="</svg>"}var H="";switch(i.container){case"svg":B&&(H+='<?xml version="1.0" standalone="yes"?>'+y),H+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+w+'" height="'+v+'">'+y,H+=z+X+Y,H+=G,H+="</svg>";break;case"svg-viewbox":B&&(H+='<?xml version="1.0" standalone="yes"?>'+y),H+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 '+w+" "+v+'">'+y,H+=z+X+Y,H+=G,H+="</svg>";break;case"g":H+='<g width="'+w+'" height="'+v+'">'+y,H+=z+X+Y,H+=G,H+="</g>";break;default:H+=(z+X+Y+G).replace(/^\s+/,"");break}return H},Rn=o,Rn}var go;function vl(){if(go)return Pe;go=1;var e=Pe&&Pe.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.QRCode=void 0;const n=ce,r=br,t=e(wl()),h=a=>{const[c,f]=(0,r.useState)("");return(0,r.useEffect)(()=>{var u,g;const l=new t.default({content:a.content,background:a.bgColor||"#ffffff",color:a.fgColor||"#000000",container:"svg",ecl:"M",width:(u=a.width)!==null&&u!==void 0?u:256,height:(g=a.height)!==null&&g!==void 0?g:256,padding:0,image:a.image}),s=K.from(l.svg(),"utf8").toString("base64");f(`data:image/svg+xml;base64,${s}`)},[a.bgColor,a.content,a.fgColor,a.height,a.image,a.width]),c?(0,n.h)("img",{src:c,alt:"QR Code"}):null};return Pe.QRCode=h,Pe}var Oe={},Yt={},po;function _l(){return po||(po=1,Object.defineProperty(Yt,"__esModule",{value:!0}),Yt.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)}}"),Yt}var mo;function El(){if(mo)return Oe;mo=1;var e=Oe&&Oe.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.Spinner=void 0;const n=ce,r=e(_l()),t=h=>{var a;const c=(a=h.size)!==null&&a!==void 0?a:64,f=h.color||"#000";return(0,n.h)("div",{class:"-cbwsdk-spinner"},(0,n.h)("style",null,r.default),(0,n.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:c,height:c}},(0,n.h)("circle",{style:{cx:50,cy:50,r:45,stroke:f}})))};return Oe.Spinner=t,Oe}var Xt={},bo;function Rl(){return bo||(bo=1,Object.defineProperty(Xt,"__esModule",{value:!0}),Xt.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}"),Xt}var yo;function Sl(){if(yo)return _e;yo=1;var e=_e&&_e.__importDefault||function(b){return b&&b.__esModule?b:{default:b}};Object.defineProperty(_e,"__esModule",{value:!0}),_e.CoinbaseWalletSteps=_e.ConnectContent=void 0;const n=e(Wt),r=ce,t=Re(),h=ws(),a=ml(),c=bl(),f=yl(),u=vl(),g=El(),l=e(Rl()),s={title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",steps:m},o=b=>b==="light"?"#FFFFFF":"#0A0B0D";function i(b){const{theme:d}=b,y=(0,t.createQrUrl)(b.sessionId,b.sessionSecret,b.linkAPIUrl,b.isParentConnection,b.version,b.chainId),w=s.steps;return(0,r.h)("div",{"data-testid":"connect-content",className:(0,n.default)("-cbwsdk-connect-content",d)},(0,r.h)("style",null,l.default),(0,r.h)("div",{className:"-cbwsdk-connect-content-header"},(0,r.h)("h2",{className:(0,n.default)("-cbwsdk-connect-content-heading",d)},"Scan to connect with our mobile app"),b.onCancel&&(0,r.h)("button",{type:"button",className:"-cbwsdk-cancel-button",onClick:b.onCancel},(0,r.h)(a.CloseIcon,{fill:d==="light"?"#0A0B0D":"#FFFFFF"}))),(0,r.h)("div",{className:"-cbwsdk-connect-content-layout"},(0,r.h)("div",{className:"-cbwsdk-connect-content-column-left"},(0,r.h)(p,{title:s.title,description:s.description,theme:d})),(0,r.h)("div",{className:"-cbwsdk-connect-content-column-right"},(0,r.h)("div",{className:"-cbwsdk-connect-content-qr-wrapper"},(0,r.h)(u.QRCode,{content:y,width:200,height:200,fgColor:"#000",bgColor:"transparent"}),(0,r.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:h.LIB_VERSION}),(0,r.h)("input",{type:"hidden",value:y})),(0,r.h)(w,{theme:d}),!b.isConnected&&(0,r.h)("div",{"data-testid":"connecting-spinner",className:(0,n.default)("-cbwsdk-connect-content-qr-connecting",d)},(0,r.h)(g.Spinner,{size:36,color:d==="dark"?"#FFF":"#000"}),(0,r.h)("p",null,"Connecting...")))))}_e.ConnectContent=i;function p({title:b,description:d,theme:y}){return(0,r.h)("div",{className:(0,n.default)("-cbwsdk-connect-item",y)},(0,r.h)("div",null,(0,r.h)(c.CoinbaseWalletRound,null)),(0,r.h)("div",{className:"-cbwsdk-connect-item-copy-wrapper"},(0,r.h)("h3",{className:"-cbwsdk-connect-item-title"},b),(0,r.h)("p",{className:"-cbwsdk-connect-item-description"},d)))}function m({theme:b}){return(0,r.h)("ol",{className:"-cbwsdk-wallet-steps"},(0,r.h)("li",{className:(0,n.default)("-cbwsdk-wallet-steps-item",b)},(0,r.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,r.h)("li",{className:(0,n.default)("-cbwsdk-wallet-steps-item",b)},(0,r.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},(0,r.h)("span",null,"Tap ",(0,r.h)("strong",null,"Scan")," "),(0,r.h)("span",{className:(0,n.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",b)},(0,r.h)(f.QRCodeIcon,{fill:o(b)})))))}return _e.CoinbaseWalletSteps=m,_e}var xe={},kt={},wo;function Cl(){if(wo)return kt;wo=1,Object.defineProperty(kt,"__esModule",{value:!0}),kt.ArrowLeftIcon=void 0;const e=ce;function n(r){return(0,e.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},r),(0,e.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"}))}return kt.ArrowLeftIcon=n,kt}var It={},vo;function kl(){if(vo)return It;vo=1,Object.defineProperty(It,"__esModule",{value:!0}),It.LaptopIcon=void 0;const e=ce;function n(r){return(0,e.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},r),(0,e.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,e.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"}))}return It.LaptopIcon=n,It}var At={},_o;function Il(){if(_o)return At;_o=1,Object.defineProperty(At,"__esModule",{value:!0}),At.SafeIcon=void 0;const e=ce;function n(r){return(0,e.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},r),(0,e.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"}))}return At.SafeIcon=n,At}var er={},Eo;function Al(){return Eo||(Eo=1,Object.defineProperty(er,"__esModule",{value:!0}),er.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}"),er}var Ro;function Ml(){if(Ro)return xe;Ro=1;var e=xe&&xe.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(xe,"__esModule",{value:!0}),xe.TryExtensionContent=void 0;const n=e(Wt),r=ce,t=br,h=Cl(),a=kl(),c=Il(),f=e(Al());function u({theme:g}){const[l,s]=(0,t.useState)(!1),o=(0,t.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),i=(0,t.useCallback)(()=>{l?window.location.reload():(o(),s(!0))},[o,l]);return(0,r.h)("div",{class:(0,n.default)("-cbwsdk-try-extension",g)},(0,r.h)("style",null,f.default),(0,r.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,r.h)("h3",{class:(0,n.default)("-cbwsdk-try-extension-heading",g)},"Or try the Coinbase Wallet browser extension"),(0,r.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,r.h)("button",{class:(0,n.default)("-cbwsdk-try-extension-cta",g),onClick:i},l?"Refresh":"Install"),(0,r.h)("div",null,!l&&(0,r.h)(h.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:g==="light"?"#0052FF":"#588AF5"})))),(0,r.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,r.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,r.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,r.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,r.h)("span",{class:(0,n.default)("-cbwsdk-try-extension-list-item-icon",g)},(0,r.h)(a.LaptopIcon,{fill:g==="light"?"#0A0B0D":"#FFFFFF"}))),(0,r.h)("div",{class:(0,n.default)("-cbwsdk-try-extension-list-item-copy",g)},"Connect with dapps with just one click on your desktop browser")),(0,r.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,r.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,r.h)("span",{class:(0,n.default)("-cbwsdk-try-extension-list-item-icon",g)},(0,r.h)(c.SafeIcon,{fill:g==="light"?"#0A0B0D":"#FFFFFF"}))),(0,r.h)("div",{class:(0,n.default)("-cbwsdk-try-extension-list-item-copy",g)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}return xe.TryExtensionContent=u,xe}var tr={},So;function Ll(){return So||(So=1,Object.defineProperty(tr,"__esModule",{value:!0}),tr.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}"),tr}var Co;function Tl(){if(Co)return Ne;Co=1;var e=Ne&&Ne.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.ConnectDialog=void 0;const n=e(Wt),r=ce,t=br,h=Sl(),a=Ml(),c=e(Ll()),f=u=>{const{isOpen:g,darkMode:l}=u,[s,o]=(0,t.useState)(!g),[i,p]=(0,t.useState)(!g);(0,t.useEffect)(()=>{const b=[window.setTimeout(()=>{p(!g)},10)];return g?o(!1):b.push(window.setTimeout(()=>{o(!0)},360)),()=>{b.forEach(window.clearTimeout)}},[g]);const m=l?"dark":"light";return(0,r.h)("div",{class:(0,n.default)("-cbwsdk-connect-dialog-container",s&&"-cbwsdk-connect-dialog-container-hidden")},(0,r.h)("style",null,c.default),(0,r.h)("div",{class:(0,n.default)("-cbwsdk-connect-dialog-backdrop",m,i&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,r.h)("div",{class:"-cbwsdk-connect-dialog"},(0,r.h)("div",{class:(0,n.default)("-cbwsdk-connect-dialog-box",i&&"-cbwsdk-connect-dialog-box-hidden")},u.connectDisabled?null:(0,r.h)(h.ConnectContent,{theme:m,version:u.version,sessionId:u.sessionId,sessionSecret:u.sessionSecret,linkAPIUrl:u.linkAPIUrl,isConnected:u.isConnected,isParentConnection:u.isParentConnection,chainId:u.chainId,onCancel:u.onCancel}),(0,r.h)(a.TryExtensionContent,{theme:m}))))};return Ne.ConnectDialog=f,Ne}var ko;function Nl(){if(ko)return Et;ko=1,Object.defineProperty(Et,"__esModule",{value:!0}),Et.LinkFlow=void 0;const e=ce,n=Tl();let r=class{constructor(h){this.connected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=h.darkMode,this.version=h.version,this.sessionId=h.sessionId,this.sessionSecret=h.sessionSecret,this.linkAPIUrl=h.linkAPIUrl,this.isParentConnection=h.isParentConnection}attach(h){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",h.appendChild(this.root),this.render()}setConnected(h){this.connected!==h&&(this.connected=h,this.render())}setChainId(h){this.chainId!==h&&(this.chainId=h,this.render())}detach(){var h;this.root&&((0,e.render)(null,this.root),(h=this.root.parentElement)===null||h===void 0||h.removeChild(this.root))}setConnectDisabled(h){this.connectDisabled=h}open(h){this.isOpen=!0,this.onCancel=h.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){this.root&&(0,e.render)((0,e.h)(n.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)}};return Et.LinkFlow=r,Et}var Mt={},rr={},Io;function Pl(){return Io||(Io=1,Object.defineProperty(rr,"__esModule",{value:!0}),rr.default=".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}"),rr}var Ao;function gu(){return Ao||(Ao=1,(function(e){var n=Mt&&Mt.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0}),e.SnackbarInstance=e.SnackbarContainer=e.Snackbar=void 0;const r=n(Wt),t=ce,h=br,a=n(Pl()),c="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",f="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";class u{constructor(o){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=o.darkMode}attach(o){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",o.appendChild(this.root),this.render()}presentItem(o){const i=this.nextItemKey++;return this.items.set(i,o),this.render(),()=>{this.items.delete(i),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,t.render)((0,t.h)("div",null,(0,t.h)(e.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([o,i])=>(0,t.h)(e.SnackbarInstance,Object.assign({},i,{key:o}))))),this.root)}}e.Snackbar=u;const g=s=>(0,t.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-container")},(0,t.h)("style",null,a.default),(0,t.h)("div",{class:"-cbwsdk-snackbar"},s.children));e.SnackbarContainer=g;const l=({autoExpand:s,message:o,menuItems:i})=>{const[p,m]=(0,h.useState)(!0),[b,d]=(0,h.useState)(s??!1);(0,h.useEffect)(()=>{const w=[window.setTimeout(()=>{m(!1)},1),window.setTimeout(()=>{d(!0)},1e4)];return()=>{w.forEach(window.clearTimeout)}});const y=()=>{d(!b)};return(0,t.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance",p&&"-cbwsdk-snackbar-instance-hidden",b&&"-cbwsdk-snackbar-instance-expanded")},(0,t.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:y},(0,t.h)("img",{src:c,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,t.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},o),(0,t.h)("div",{class:"-gear-container"},!b&&(0,t.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,t.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,t.h)("img",{src:f,class:"-gear-icon",title:"Expand"}))),i&&i.length>0&&(0,t.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},i.map((w,v)=>(0,t.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item",w.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:w.onClick,key:v},(0,t.h)("svg",{width:w.svgWidth,height:w.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,t.h)("path",{"fill-rule":w.defaultFillRule,"clip-rule":w.defaultClipRule,d:w.path,fill:"#AAAAAA"})),(0,t.h)("span",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item-info",w.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},w.info)))))};e.SnackbarInstance=l})(Mt)),Mt}var Mo;function pu(){if(Mo)return _t;Mo=1,Object.defineProperty(_t,"__esModule",{value:!0}),_t.WalletLinkRelayUI=void 0;const e=fu(),n=Nl(),r=gu();let t=class{constructor(a){this.standalone=null,this.attached=!1,this.snackbar=new r.Snackbar({darkMode:a.darkMode}),this.linkFlow=new n.LinkFlow({darkMode:a.darkMode,version:a.version,sessionId:a.session.id,sessionSecret:a.session.secret,linkAPIUrl:a.linkAPIUrl,isParentConnection:!1})}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const a=document.documentElement,c=document.createElement("div");c.className="-cbwsdk-css-reset",a.appendChild(c),this.linkFlow.attach(c),this.snackbar.attach(c),this.attached=!0,(0,e.injectCssReset)()}setConnected(a){this.linkFlow.setConnected(a)}setChainId(a){this.linkFlow.setChainId(a)}setConnectDisabled(a){this.linkFlow.setConnectDisabled(a)}addEthereumChain(){}watchAsset(){}switchEthereumChain(){}requestEthereumAccounts(a){this.linkFlow.open({onCancel:a.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}showConnecting(a){let c;return a.isUnlinkedErrorState?c={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:a.onResetConnection}]}:c={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:a.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:a.onResetConnection}]},this.snackbar.presentItem(c)}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(a){this.standalone=a}isStandalone(){var a;return(a=this.standalone)!==null&&a!==void 0?a:!1}};return _t.WalletLinkRelayUI=t,_t}var Lo;function mu(){if(Lo)return pt;Lo=1,Object.defineProperty(pt,"__esModule",{value:!0}),pt.WalletLinkRelay=void 0;const e=pr(),n=mr(),r=Re(),t=vs(),h=_s(),a=Es(),c=gl(),f=ys(),u=pu();let g=class Ge extends h.RelayAbstract{constructor(s){var o;super(),this.accountsCallback=null,this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.chainCallback=null,this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.linkedUpdated=b=>{var d;this.isLinked=b;const y=this.storage.getItem(h.LOCAL_STORAGE_ADDRESSES_KEY);if(b&&(this.session.linked=b),this.isUnlinkedErrorState=!1,y){const w=y.split(" "),v=this.storage.getItem("IsStandaloneSigning")==="true";if(w[0]!==""&&!b&&this.session.linked&&!v){this.isUnlinkedErrorState=!0;const _=this.getSessionIdHash();(d=this.diagnostic)===null||d===void 0||d.log(t.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:_})}}},this.metadataUpdated=(b,d)=>{this.storage.setItem(b,d)},this.chainUpdated=(b,d)=>{this.chainCallbackParams.chainId===b&&this.chainCallbackParams.jsonRpcUrl===d||(this.chainCallbackParams={chainId:b,jsonRpcUrl:d},this.chainCallback&&this.chainCallback(b,d))},this.accountUpdated=b=>{this.accountsCallback&&this.accountsCallback([b]),Ge.accountRequestCallbackIds.size>0&&(Array.from(Ge.accountRequestCallbackIds.values()).forEach(d=>{const y={type:"WEB3_RESPONSE",id:d,response:{method:"requestEthereumAccounts",result:[b]}};this.invokeCallback(Object.assign(Object.assign({},y),{id:d}))}),Ge.accountRequestCallbackIds.clear())},this.connectedUpdated=b=>{this.ui.setConnected(b)},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=s.linkAPIUrl,this.storage=s.storage,this.options=s;const{session:i,ui:p,connection:m}=this.subscribe();this._session=i,this.connection=m,this.relayEventManager=s.relayEventManager,this.diagnostic=s.diagnosticLogger,this._reloadOnDisconnect=(o=s.reloadOnDisconnect)!==null&&o!==void 0?o:!0,this.ui=p}subscribe(){const s=a.Session.load(this.storage)||new a.Session(this.storage).save(),{linkAPIUrl:o,diagnostic:i}=this,p=new c.WalletLinkConnection({session:s,linkAPIUrl:o,diagnostic:i,listener:this}),{version:m,darkMode:b}=this.options,d=this.options.uiConstructor({linkAPIUrl:o,version:m,darkMode:b,session:s});return p.connect(),{session:s,ui:d,connection:p}}attachUI(){this.ui.attach()}resetAndReload(){Promise.race([this.connection.setSessionMetadata("__destroyed","1"),new Promise(s=>setTimeout(()=>s(null),1e3))]).then(()=>{var s,o;const i=this.ui.isStandalone();(s=this.diagnostic)===null||s===void 0||s.log(t.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const p=a.Session.load(this.storage);if((p==null?void 0:p.id)===this._session.id?this.storage.clear():p&&((o=this.diagnostic)===null||o===void 0||o.log(t.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:a.Session.hash(p.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0);const{session:m,ui:b,connection:d}=this.subscribe();this._session=m,this.connection=d,this.ui=b,i&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.options.headlessMode||this.attachUI()}).catch(s=>{var o;(o=this.diagnostic)===null||o===void 0||o.log(t.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${s}`,sessionIdHash:this.getSessionIdHash()})})}setAppInfo(s,o){this.appName=s,this.appLogoUrl=o}getStorageItem(s){return this.storage.getItem(s)}get session(){return this._session}setStorageItem(s,o){this.storage.setItem(s,o)}signEthereumMessage(s,o,i,p){return this.sendRequest({method:"signEthereumMessage",params:{message:(0,r.hexStringFromBuffer)(s,!0),address:o,addPrefix:i,typedDataJson:p||null}})}ethereumAddressFromSignedMessage(s,o,i){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,r.hexStringFromBuffer)(s,!0),signature:(0,r.hexStringFromBuffer)(o,!0),addPrefix:i}})}signEthereumTransaction(s){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:s.fromAddress,toAddress:s.toAddress,weiValue:(0,r.bigIntStringFromBN)(s.weiValue),data:(0,r.hexStringFromBuffer)(s.data,!0),nonce:s.nonce,gasPriceInWei:s.gasPriceInWei?(0,r.bigIntStringFromBN)(s.gasPriceInWei):null,maxFeePerGas:s.gasPriceInWei?(0,r.bigIntStringFromBN)(s.gasPriceInWei):null,maxPriorityFeePerGas:s.gasPriceInWei?(0,r.bigIntStringFromBN)(s.gasPriceInWei):null,gasLimit:s.gasLimit?(0,r.bigIntStringFromBN)(s.gasLimit):null,chainId:s.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(s){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:s.fromAddress,toAddress:s.toAddress,weiValue:(0,r.bigIntStringFromBN)(s.weiValue),data:(0,r.hexStringFromBuffer)(s.data,!0),nonce:s.nonce,gasPriceInWei:s.gasPriceInWei?(0,r.bigIntStringFromBN)(s.gasPriceInWei):null,maxFeePerGas:s.maxFeePerGas?(0,r.bigIntStringFromBN)(s.maxFeePerGas):null,maxPriorityFeePerGas:s.maxPriorityFeePerGas?(0,r.bigIntStringFromBN)(s.maxPriorityFeePerGas):null,gasLimit:s.gasLimit?(0,r.bigIntStringFromBN)(s.gasLimit):null,chainId:s.chainId,shouldSubmit:!0}})}submitEthereumTransaction(s,o){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,r.hexStringFromBuffer)(s,!0),chainId:o}})}scanQRCode(s){return this.sendRequest({method:"scanQRCode",params:{regExp:s}})}getQRCodeUrl(){return(0,r.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(s,o){return this.sendRequest({method:"generic",params:{action:o,data:s}})}sendGenericMessage(s){return this.sendRequest(s)}sendRequest(s){let o=null;const i=(0,r.randomBytesHex)(8),p=b=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,s.method,b),o==null||o()};return{promise:new Promise((b,d)=>{this.ui.isStandalone()||(o=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:p,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(i,y=>{if(o==null||o(),(0,f.isErrorResponse)(y))return d(new Error(y.errorMessage));b(y)}),this.ui.isStandalone()?this.sendRequestStandalone(i,s):this.publishWeb3RequestEvent(i,s)}),cancel:p}}setConnectDisabled(s){this.ui.setConnectDisabled(s)}setAccountsCallback(s){this.accountsCallback=s}setChainCallback(s){this.chainCallback=s}setDappDefaultChainCallback(s){this.dappDefaultChain=s,this.ui instanceof u.WalletLinkRelayUI&&this.ui.setChainId(s)}publishWeb3RequestEvent(s,o){var i;const p={type:"WEB3_REQUEST",id:s,request:o},m=a.Session.load(this.storage);(i=this.diagnostic)===null||i===void 0||i.log(t.EVENTS.WEB3_REQUEST,{eventId:p.id,method:`relay::${o.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:m?a.Session.hash(m.id):"",isSessionMismatched:((m==null?void 0:m.id)!==this._session.id).toString()}),this.publishEvent("Web3Request",p,!0).then(b=>{var d;(d=this.diagnostic)===null||d===void 0||d.log(t.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:p.id,method:`relay::${o.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:m?a.Session.hash(m.id):"",isSessionMismatched:((m==null?void 0:m.id)!==this._session.id).toString()})}).catch(b=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:p.id,response:{method:o.method,errorMessage:b.message}})})}publishWeb3RequestCanceledEvent(s){const o={type:"WEB3_REQUEST_CANCELED",id:s};this.publishEvent("Web3RequestCanceled",o,!1).then()}publishEvent(s,o,i){return this.connection.publishEvent(s,o,i)}handleWeb3ResponseMessage(s){var o;const{response:i}=s;if((o=this.diagnostic)===null||o===void 0||o.log(t.EVENTS.WEB3_RESPONSE,{eventId:s.id,method:`relay::${i.method}`,sessionIdHash:this.getSessionIdHash()}),i.method==="requestEthereumAccounts"){Ge.accountRequestCallbackIds.forEach(p=>this.invokeCallback(Object.assign(Object.assign({},s),{id:p}))),Ge.accountRequestCallbackIds.clear();return}this.invokeCallback(s)}handleErrorResponse(s,o,i,p){var m;const b=(m=i==null?void 0:i.message)!==null&&m!==void 0?m:(0,e.getMessageFromCode)(p);this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:s,response:{method:o,errorMessage:b,errorCode:p}})}invokeCallback(s){const o=this.relayEventManager.callbacks.get(s.id);o&&(o(s.response),this.relayEventManager.callbacks.delete(s.id))}requestEthereumAccounts(){const s={method:"requestEthereumAccounts",params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},o=(0,r.randomBytesHex)(8),i=m=>{this.publishWeb3RequestCanceledEvent(o),this.handleErrorResponse(o,s.method,m)};return{promise:new Promise((m,b)=>{if(this.relayEventManager.callbacks.set(o,d=>{if(this.ui.hideRequestEthereumAccounts(),(0,f.isErrorResponse)(d))return b(new Error(d.errorMessage));m(d)}),this.ui.inlineAccountsResponse()){const d=y=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:o,response:{method:"requestEthereumAccounts",result:y}})};this.ui.requestEthereumAccounts({onCancel:i,onAccounts:d})}else{const d=e.standardErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>i(d)})}Ge.accountRequestCallbackIds.add(o),!this.ui.inlineAccountsResponse()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(o,s)}),cancel:i}}selectProvider(s){const o={method:"selectProvider"},i=(0,r.randomBytesHex)(8),p=b=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,o.method,b)},m=new Promise((b,d)=>{this.relayEventManager.callbacks.set(i,v=>{if((0,f.isErrorResponse)(v))return d(new Error(v.errorMessage));b(v)});const y=v=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"selectProvider",result:n.ProviderType.Unselected}})},w=v=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"selectProvider",result:v}})};this.ui.selectProvider&&this.ui.selectProvider({onApprove:w,onCancel:y,providerOptions:s})});return{cancel:p,promise:m}}watchAsset(s,o,i,p,m,b){const d={method:"watchAsset",params:{type:s,options:{address:o,symbol:i,decimals:p,image:m},chainId:b}};let y=null;const w=(0,r.randomBytesHex)(8),v=C=>{this.publishWeb3RequestCanceledEvent(w),this.handleErrorResponse(w,d.method,C),y==null||y()};this.ui.inlineWatchAsset()||(y=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:v,onResetConnection:this.resetAndReload}));const _=new Promise((C,S)=>{this.relayEventManager.callbacks.set(w,B=>{if(y==null||y(),(0,f.isErrorResponse)(B))return S(new Error(B.errorMessage));C(B)});const I=B=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:w,response:{method:"watchAsset",result:!1}})},P=()=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:w,response:{method:"watchAsset",result:!0}})};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:P,onCancel:I,type:s,address:o,symbol:i,decimals:p,image:m,chainId:b}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(w,d)});return{cancel:v,promise:_}}addEthereumChain(s,o,i,p,m,b){const d={method:"addEthereumChain",params:{chainId:s,rpcUrls:o,blockExplorerUrls:p,chainName:m,iconUrls:i,nativeCurrency:b}};let y=null;const w=(0,r.randomBytesHex)(8),v=C=>{this.publishWeb3RequestCanceledEvent(w),this.handleErrorResponse(w,d.method,C),y==null||y()};return this.ui.inlineAddEthereumChain(s)||(y=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:v,onResetConnection:this.resetAndReload})),{promise:new Promise((C,S)=>{this.relayEventManager.callbacks.set(w,B=>{if(y==null||y(),(0,f.isErrorResponse)(B))return S(new Error(B.errorMessage));C(B)});const I=B=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:w,response:{method:"addEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},P=B=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:w,response:{method:"addEthereumChain",result:{isApproved:!0,rpcUrl:B}}})};this.ui.inlineAddEthereumChain(s)&&this.ui.addEthereumChain({onCancel:I,onApprove:P,chainId:d.params.chainId,rpcUrls:d.params.rpcUrls,blockExplorerUrls:d.params.blockExplorerUrls,chainName:d.params.chainName,iconUrls:d.params.iconUrls,nativeCurrency:d.params.nativeCurrency}),!this.ui.inlineAddEthereumChain(s)&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(w,d)}),cancel:v}}switchEthereumChain(s,o){const i={method:"switchEthereumChain",params:Object.assign({chainId:s},{address:o})},p=(0,r.randomBytesHex)(8),m=d=>{this.publishWeb3RequestCanceledEvent(p),this.handleErrorResponse(p,i.method,d)};return{promise:new Promise((d,y)=>{this.relayEventManager.callbacks.set(p,_=>{if((0,f.isErrorResponse)(_)&&_.errorCode)return y(e.standardErrors.provider.custom({code:_.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if((0,f.isErrorResponse)(_))return y(new Error(_.errorMessage));d(_)});const w=_=>{var C;if(_){const S=(C=(0,e.getErrorCode)(_))!==null&&C!==void 0?C:e.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(p,"switchEthereumChain",_ instanceof Error?_:e.standardErrors.provider.unsupportedChain(s),S)}else this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:p,response:{method:"switchEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},v=_=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:p,response:{method:"switchEthereumChain",result:{isApproved:!0,rpcUrl:_}}})};this.ui.switchEthereumChain({onCancel:w,onApprove:v,chainId:i.params.chainId,address:i.params.address}),!this.ui.inlineSwitchEthereumChain()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(p,i)}),cancel:m}}inlineAddEthereumChain(s){return this.ui.inlineAddEthereumChain(s)}getSessionIdHash(){return a.Session.hash(this._session.id)}sendRequestStandalone(s,o){const i=m=>{this.handleErrorResponse(s,o.method,m)},p=m=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:s,response:m})};switch(o.method){case"signEthereumMessage":this.ui.signEthereumMessage({request:o,onSuccess:p,onCancel:i});break;case"signEthereumTransaction":this.ui.signEthereumTransaction({request:o,onSuccess:p,onCancel:i});break;case"submitEthereumTransaction":this.ui.submitEthereumTransaction({request:o,onSuccess:p,onCancel:i});break;case"ethereumAddressFromSignedMessage":this.ui.ethereumAddressFromSignedMessage({request:o,onSuccess:p});break;default:i();break}}};return pt.WalletLinkRelay=g,g.accountRequestCallbackIds=new Set,pt}var Lt={},Be={},De={},To;function Ol(){return To||(To=1,(function(e){var n=De&&De.__createBinding||(Object.create?(function(t,h,a,c){c===void 0&&(c=a);var f=Object.getOwnPropertyDescriptor(h,a);(!f||("get"in f?!h.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return h[a]}}),Object.defineProperty(t,c,f)}):(function(t,h,a,c){c===void 0&&(c=a),t[c]=h[a]})),r=De&&De.__exportStar||function(t,h){for(var a in t)a!=="default"&&!Object.prototype.hasOwnProperty.call(h,a)&&n(h,t,a)};Object.defineProperty(e,"__esModule",{value:!0}),r(gu(),e)})(De)),De}var nr={},No;function xl(){return No||(No=1,Object.defineProperty(nr,"__esModule",{value:!0}),nr.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}"),nr}var Po;function Bl(){if(Po)return Be;Po=1;var e=Be&&Be.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(Be,"__esModule",{value:!0}),Be.RedirectDialog=void 0;const n=e(Wt),r=ce,t=fu(),h=Ol(),a=e(xl());let c=class{constructor(){this.root=null}attach(){const g=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",g.appendChild(this.root),(0,t.injectCssReset)()}present(g){this.render(g)}clear(){this.render(null)}render(g){this.root&&((0,r.render)(null,this.root),g&&(0,r.render)((0,r.h)(f,Object.assign({},g,{onDismiss:()=>{this.clear()}})),this.root))}};Be.RedirectDialog=c;const f=({title:u,buttonText:g,darkMode:l,onButtonClick:s,onDismiss:o})=>{const i=l?"dark":"light";return(0,r.h)(h.SnackbarContainer,{darkMode:l},(0,r.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,r.h)("style",null,a.default),(0,r.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:o}),(0,r.h)("div",{class:(0,n.default)("-cbwsdk-redirect-dialog-box",i)},(0,r.h)("p",null,u),(0,r.h)("button",{onClick:s},g))))};return Be}var Oo;function bu(){if(Oo)return Lt;Oo=1,Object.defineProperty(Lt,"__esModule",{value:!0}),Lt.MobileRelayUI=void 0;const e=Bl();let n=class{constructor(t){this.attached=!1,this.darkMode=!1,this.redirectDialog=new e.RedirectDialog,this.darkMode=t.darkMode}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}setConnected(t){}redirectToCoinbaseWallet(t){const h=new URL("https://go.cb-w.com/walletlink");h.searchParams.append("redirect_url",window.location.href),t&&h.searchParams.append("wl_url",t);const a=document.createElement("a");a.target="cbw-opener",a.href=h.href,a.rel="noreferrer noopener",a.click()}openCoinbaseWalletDeeplink(t){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",darkMode:this.darkMode,onButtonClick:()=>{this.redirectToCoinbaseWallet(t)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(t)},99)}showConnecting(t){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}};return Lt.MobileRelayUI=n,Lt}var xo;function yu(){if(xo)return gt;xo=1,Object.defineProperty(gt,"__esModule",{value:!0}),gt.MobileRelay=void 0;const e=Re(),n=mu(),r=bu();let t=class extends n.WalletLinkRelay{constructor(a){var c;super(a),this._enableMobileWalletLink=(c=a.enableMobileWalletLink)!==null&&c!==void 0?c:!1}requestEthereumAccounts(){return this._enableMobileWalletLink?super.requestEthereumAccounts():{promise:new Promise(()=>{const a=(0,e.getLocation)();a.href=`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(a.href)}`}),cancel:()=>{}}}publishWeb3RequestEvent(a,c){if(super.publishWeb3RequestEvent(a,c),!(this._enableMobileWalletLink&&this.ui instanceof r.MobileRelayUI))return;let f=!1;switch(c.method){case"requestEthereumAccounts":case"connectAndSignIn":f=!0,this.ui.openCoinbaseWalletDeeplink(this.getQRCodeUrl());break;case"switchEthereumChain":return;default:f=!0,this.ui.openCoinbaseWalletDeeplink();break}f&&window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0})}handleWeb3ResponseMessage(a){super.handleWeb3ResponseMessage(a)}connectAndSignIn(a){if(!this._enableMobileWalletLink)throw new Error("connectAndSignIn is supported only when enableMobileWalletLink is on");return this.sendRequest({method:"connectAndSignIn",params:{appName:this.appName,appLogoUrl:this.appLogoUrl,domain:window.location.hostname,aud:window.location.href,version:"1",type:"eip4361",nonce:a.nonce,iat:new Date().toISOString(),chainId:`eip155:${this.dappDefaultChain}`,statement:a.statement,resources:a.resources}})}};return gt.MobileRelay=t,gt}var ir={exports:{}},Sn,Bo;function wu(){return Bo||(Bo=1,Sn=fr().EventEmitter),Sn}var Cn,Do;function Dl(){if(Do)return Cn;Do=1;function e(p,m){var b=Object.keys(p);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(p);m&&(d=d.filter(function(y){return Object.getOwnPropertyDescriptor(p,y).enumerable})),b.push.apply(b,d)}return b}function n(p){for(var m=1;m<arguments.length;m++){var b=arguments[m]!=null?arguments[m]:{};m%2?e(Object(b),!0).forEach(function(d){r(p,d,b[d])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(b)):e(Object(b)).forEach(function(d){Object.defineProperty(p,d,Object.getOwnPropertyDescriptor(b,d))})}return p}function r(p,m,b){return m=c(m),m in p?Object.defineProperty(p,m,{value:b,enumerable:!0,configurable:!0,writable:!0}):p[m]=b,p}function t(p,m){if(!(p instanceof m))throw new TypeError("Cannot call a class as a function")}function h(p,m){for(var b=0;b<m.length;b++){var d=m[b];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(p,c(d.key),d)}}function a(p,m,b){return m&&h(p.prototype,m),Object.defineProperty(p,"prototype",{writable:!1}),p}function c(p){var m=f(p,"string");return typeof m=="symbol"?m:String(m)}function f(p,m){if(typeof p!="object"||p===null)return p;var b=p[Symbol.toPrimitive];if(b!==void 0){var d=b.call(p,m);if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(p)}var u=ms(),g=u.Buffer,l=du(),s=l.inspect,o=s&&s.custom||"inspect";function i(p,m,b){g.prototype.copy.call(p,m,b)}return Cn=(function(){function p(){t(this,p),this.head=null,this.tail=null,this.length=0}return a(p,[{key:"push",value:function(b){var d={data:b,next:null};this.length>0?this.tail.next=d:this.head=d,this.tail=d,++this.length}},{key:"unshift",value:function(b){var d={data:b,next:this.head};this.length===0&&(this.tail=d),this.head=d,++this.length}},{key:"shift",value:function(){if(this.length!==0){var b=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,b}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(b){if(this.length===0)return"";for(var d=this.head,y=""+d.data;d=d.next;)y+=b+d.data;return y}},{key:"concat",value:function(b){if(this.length===0)return g.alloc(0);for(var d=g.allocUnsafe(b>>>0),y=this.head,w=0;y;)i(y.data,d,w),w+=y.data.length,y=y.next;return d}},{key:"consume",value:function(b,d){var y;return b<this.head.data.length?(y=this.head.data.slice(0,b),this.head.data=this.head.data.slice(b)):b===this.head.data.length?y=this.shift():y=d?this._getString(b):this._getBuffer(b),y}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(b){var d=this.head,y=1,w=d.data;for(b-=w.length;d=d.next;){var v=d.data,_=b>v.length?v.length:b;if(_===v.length?w+=v:w+=v.slice(0,b),b-=_,b===0){_===v.length?(++y,d.next?this.head=d.next:this.head=this.tail=null):(this.head=d,d.data=v.slice(_));break}++y}return this.length-=y,w}},{key:"_getBuffer",value:function(b){var d=g.allocUnsafe(b),y=this.head,w=1;for(y.data.copy(d),b-=y.data.length;y=y.next;){var v=y.data,_=b>v.length?v.length:b;if(v.copy(d,d.length-b,0,_),b-=_,b===0){_===v.length?(++w,y.next?this.head=y.next:this.head=this.tail=null):(this.head=y,y.data=v.slice(_));break}++w}return this.length-=w,d}},{key:o,value:function(b,d){return s(this,n(n({},d),{},{depth:0,customInspect:!1}))}}]),p})(),Cn}var kn,Fo;function vu(){if(Fo)return kn;Fo=1;function e(c,f){var u=this,g=this._readableState&&this._readableState.destroyed,l=this._writableState&&this._writableState.destroyed;return g||l?(f?f(c):c&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,te.nextTick(h,this,c)):te.nextTick(h,this,c)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(c||null,function(s){!f&&s?u._writableState?u._writableState.errorEmitted?te.nextTick(r,u):(u._writableState.errorEmitted=!0,te.nextTick(n,u,s)):te.nextTick(n,u,s):f?(te.nextTick(r,u),f(s)):te.nextTick(r,u)}),this)}function n(c,f){h(c,f),r(c)}function r(c){c._writableState&&!c._writableState.emitClose||c._readableState&&!c._readableState.emitClose||c.emit("close")}function t(){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)}function h(c,f){c.emit("error",f)}function a(c,f){var u=c._readableState,g=c._writableState;u&&u.autoDestroy||g&&g.autoDestroy?c.destroy(f):c.emit("error",f)}return kn={destroy:e,undestroy:t,errorOrDestroy:a},kn}var In={},qo;function rt(){if(qo)return In;qo=1;function e(f,u){f.prototype=Object.create(u.prototype),f.prototype.constructor=f,f.__proto__=u}var n={};function r(f,u,g){g||(g=Error);function l(o,i,p){return typeof u=="string"?u:u(o,i,p)}var s=(function(o){e(i,o);function i(p,m,b){return o.call(this,l(p,m,b))||this}return i})(g);s.prototype.name=g.name,s.prototype.code=f,n[f]=s}function t(f,u){if(Array.isArray(f)){var g=f.length;return f=f.map(function(l){return String(l)}),g>2?"one of ".concat(u," ").concat(f.slice(0,g-1).join(", "),", or ")+f[g-1]:g===2?"one of ".concat(u," ").concat(f[0]," or ").concat(f[1]):"of ".concat(u," ").concat(f[0])}else return"of ".concat(u," ").concat(String(f))}function h(f,u,g){return f.substr(0,u.length)===u}function a(f,u,g){return(g===void 0||g>f.length)&&(g=f.length),f.substring(g-u.length,g)===u}function c(f,u,g){return typeof g!="number"&&(g=0),g+u.length>f.length?!1:f.indexOf(u,g)!==-1}return r("ERR_INVALID_OPT_VALUE",function(f,u){return'The value "'+u+'" is invalid for option "'+f+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(f,u,g){var l;typeof u=="string"&&h(u,"not ")?(l="must not be",u=u.replace(/^not /,"")):l="must be";var s;if(a(f," argument"))s="The ".concat(f," ").concat(l," ").concat(t(u,"type"));else{var o=c(f,".")?"property":"argument";s='The "'.concat(f,'" ').concat(o," ").concat(l," ").concat(t(u,"type"))}return s+=". Received type ".concat(typeof g),s},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(f){return"The "+f+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(f){return"Cannot call "+f+" 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(f){return"Unknown encoding: "+f},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),In.codes=n,In}var An,jo;function _u(){if(jo)return An;jo=1;var e=rt().codes.ERR_INVALID_OPT_VALUE;function n(t,h,a){return t.highWaterMark!=null?t.highWaterMark:h?t[a]:null}function r(t,h,a,c){var f=n(h,c,a);if(f!=null){if(!(isFinite(f)&&Math.floor(f)===f)||f<0){var u=c?a:"highWaterMark";throw new e(u,f)}return Math.floor(f)}return t.objectMode?16:16*1024}return An={getHighWaterMark:r},An}var Mn,$o;function Eu(){if($o)return Mn;$o=1,Mn=I;function e(k){var A=this;this.next=null,this.entry=null,this.finish=function(){H(A,k)}}var n;I.WritableState=C;var r={deprecate:tl()},t=wu(),h=ms().Buffer,a=(typeof dr<"u"?dr:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function c(k){return h.from(k)}function f(k){return h.isBuffer(k)||k instanceof a}var u=vu(),g=_u(),l=g.getHighWaterMark,s=rt().codes,o=s.ERR_INVALID_ARG_TYPE,i=s.ERR_METHOD_NOT_IMPLEMENTED,p=s.ERR_MULTIPLE_CALLBACK,m=s.ERR_STREAM_CANNOT_PIPE,b=s.ERR_STREAM_DESTROYED,d=s.ERR_STREAM_NULL_VALUES,y=s.ERR_STREAM_WRITE_AFTER_END,w=s.ERR_UNKNOWN_ENCODING,v=u.errorOrDestroy;Ut()(I,t);function _(){}function C(k,A,N){n=n||tt(),k=k||{},typeof N!="boolean"&&(N=A instanceof n),this.objectMode=!!k.objectMode,N&&(this.objectMode=this.objectMode||!!k.writableObjectMode),this.highWaterMark=l(this,k,"writableHighWaterMark",N),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var U=k.decodeStrings===!1;this.decodeStrings=!U,this.defaultEncoding=k.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(Q){M(A,Q)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=k.emitClose!==!1,this.autoDestroy=!!k.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}C.prototype.getBuffer=function(){for(var A=this.bufferedRequest,N=[];A;)N.push(A),A=A.next;return N},(function(){try{Object.defineProperty(C.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var S;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(S=Function.prototype[Symbol.hasInstance],Object.defineProperty(I,Symbol.hasInstance,{value:function(A){return S.call(this,A)?!0:this!==I?!1:A&&A._writableState instanceof C}})):S=function(A){return A instanceof this};function I(k){n=n||tt();var A=this instanceof n;if(!A&&!S.call(I,this))return new I(k);this._writableState=new C(k,this,A),this.writable=!0,k&&(typeof k.write=="function"&&(this._write=k.write),typeof k.writev=="function"&&(this._writev=k.writev),typeof k.destroy=="function"&&(this._destroy=k.destroy),typeof k.final=="function"&&(this._final=k.final)),t.call(this)}I.prototype.pipe=function(){v(this,new m)};function P(k,A){var N=new y;v(k,N),te.nextTick(A,N)}function B(k,A,N,U){var Q;return N===null?Q=new d:typeof N!="string"&&!A.objectMode&&(Q=new o("chunk",["string","Buffer"],N)),Q?(v(k,Q),te.nextTick(U,Q),!1):!0}I.prototype.write=function(k,A,N){var U=this._writableState,Q=!1,E=!U.objectMode&&f(k);return E&&!h.isBuffer(k)&&(k=c(k)),typeof A=="function"&&(N=A,A=null),E?A="buffer":A||(A=U.defaultEncoding),typeof N!="function"&&(N=_),U.ending?P(this,N):(E||B(this,U,k,N))&&(U.pendingcb++,Q=z(this,U,E,k,A,N)),Q},I.prototype.cork=function(){this._writableState.corked++},I.prototype.uncork=function(){var k=this._writableState;k.corked&&(k.corked--,!k.writing&&!k.corked&&!k.bufferProcessing&&k.bufferedRequest&&x(this,k))},I.prototype.setDefaultEncoding=function(A){if(typeof A=="string"&&(A=A.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((A+"").toLowerCase())>-1))throw new w(A);return this._writableState.defaultEncoding=A,this},Object.defineProperty(I.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function $(k,A,N){return!k.objectMode&&k.decodeStrings!==!1&&typeof A=="string"&&(A=h.from(A,N)),A}Object.defineProperty(I.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function z(k,A,N,U,Q,E){if(!N){var R=$(A,U,Q);U!==R&&(N=!0,Q="buffer",U=R)}var O=A.objectMode?1:U.length;A.length+=O;var q=A.length<A.highWaterMark;if(q||(A.needDrain=!0),A.writing||A.corked){var ne=A.lastBufferedRequest;A.lastBufferedRequest={chunk:U,encoding:Q,isBuf:N,callback:E,next:null},ne?ne.next=A.lastBufferedRequest:A.bufferedRequest=A.lastBufferedRequest,A.bufferedRequestCount+=1}else X(k,A,!1,O,U,Q,E);return q}function X(k,A,N,U,Q,E,R){A.writelen=U,A.writecb=R,A.writing=!0,A.sync=!0,A.destroyed?A.onwrite(new b("write")):N?k._writev(Q,A.onwrite):k._write(Q,E,A.onwrite),A.sync=!1}function Y(k,A,N,U,Q){--A.pendingcb,N?(te.nextTick(Q,U),te.nextTick(j,k,A),k._writableState.errorEmitted=!0,v(k,U)):(Q(U),k._writableState.errorEmitted=!0,v(k,U),j(k,A))}function J(k){k.writing=!1,k.writecb=null,k.length-=k.writelen,k.writelen=0}function M(k,A){var N=k._writableState,U=N.sync,Q=N.writecb;if(typeof Q!="function")throw new p;if(J(N),A)Y(k,N,U,A,Q);else{var E=D(N)||k.destroyed;!E&&!N.corked&&!N.bufferProcessing&&N.bufferedRequest&&x(k,N),U?te.nextTick(L,k,N,E,Q):L(k,N,E,Q)}}function L(k,A,N,U){N||T(k,A),A.pendingcb--,U(),j(k,A)}function T(k,A){A.length===0&&A.needDrain&&(A.needDrain=!1,k.emit("drain"))}function x(k,A){A.bufferProcessing=!0;var N=A.bufferedRequest;if(k._writev&&N&&N.next){var U=A.bufferedRequestCount,Q=new Array(U),E=A.corkedRequestsFree;E.entry=N;for(var R=0,O=!0;N;)Q[R]=N,N.isBuf||(O=!1),N=N.next,R+=1;Q.allBuffers=O,X(k,A,!0,A.length,Q,"",E.finish),A.pendingcb++,A.lastBufferedRequest=null,E.next?(A.corkedRequestsFree=E.next,E.next=null):A.corkedRequestsFree=new e(A),A.bufferedRequestCount=0}else{for(;N;){var q=N.chunk,ne=N.encoding,Z=N.callback,re=A.objectMode?1:q.length;if(X(k,A,!1,re,q,ne,Z),N=N.next,A.bufferedRequestCount--,A.writing)break}N===null&&(A.lastBufferedRequest=null)}A.bufferedRequest=N,A.bufferProcessing=!1}I.prototype._write=function(k,A,N){N(new i("_write()"))},I.prototype._writev=null,I.prototype.end=function(k,A,N){var U=this._writableState;return typeof k=="function"?(N=k,k=null,A=null):typeof A=="function"&&(N=A,A=null),k!=null&&this.write(k,A),U.corked&&(U.corked=1,this.uncork()),U.ending||G(this,U,N),this},Object.defineProperty(I.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function D(k){return k.ending&&k.length===0&&k.bufferedRequest===null&&!k.finished&&!k.writing}function V(k,A){k._final(function(N){A.pendingcb--,N&&v(k,N),A.prefinished=!0,k.emit("prefinish"),j(k,A)})}function F(k,A){!A.prefinished&&!A.finalCalled&&(typeof k._final=="function"&&!A.destroyed?(A.pendingcb++,A.finalCalled=!0,te.nextTick(V,k,A)):(A.prefinished=!0,k.emit("prefinish")))}function j(k,A){var N=D(A);if(N&&(F(k,A),A.pendingcb===0&&(A.finished=!0,k.emit("finish"),A.autoDestroy))){var U=k._readableState;(!U||U.autoDestroy&&U.endEmitted)&&k.destroy()}return N}function G(k,A,N){A.ending=!0,j(k,A),N&&(A.finished?te.nextTick(N):k.once("finish",N)),A.ended=!0,k.writable=!1}function H(k,A,N){var U=k.entry;for(k.entry=null;U;){var Q=U.callback;A.pendingcb--,Q(N),U=U.next}A.corkedRequestsFree.next=k}return Object.defineProperty(I.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(A){this._writableState&&(this._writableState.destroyed=A)}}),I.prototype.destroy=u.destroy,I.prototype._undestroy=u.undestroy,I.prototype._destroy=function(k,A){A(k)},Mn}var Ln,Ho;function tt(){if(Ho)return Ln;Ho=1;var e=Object.keys||function(g){var l=[];for(var s in g)l.push(s);return l};Ln=c;var n=Ru(),r=Eu();Ut()(c,n);for(var t=e(r.prototype),h=0;h<t.length;h++){var a=t[h];c.prototype[a]||(c.prototype[a]=r.prototype[a])}function c(g){if(!(this instanceof c))return new c(g);n.call(this,g),r.call(this,g),this.allowHalfOpen=!0,g&&(g.readable===!1&&(this.readable=!1),g.writable===!1&&(this.writable=!1),g.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",f)))}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}});function f(){this._writableState.ended||te.nextTick(u,this)}function u(g){g.end()}return Object.defineProperty(c.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(l){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=l,this._writableState.destroyed=l)}}),Ln}var Tn,Uo;function Rs(){if(Uo)return Tn;Uo=1;var e=rt().codes.ERR_STREAM_PREMATURE_CLOSE;function n(a){var c=!1;return function(){if(!c){c=!0;for(var f=arguments.length,u=new Array(f),g=0;g<f;g++)u[g]=arguments[g];a.apply(this,u)}}}function r(){}function t(a){return a.setHeader&&typeof a.abort=="function"}function h(a,c,f){if(typeof c=="function")return h(a,null,c);c||(c={}),f=n(f||r);var u=c.readable||c.readable!==!1&&a.readable,g=c.writable||c.writable!==!1&&a.writable,l=function(){a.writable||o()},s=a._writableState&&a._writableState.finished,o=function(){g=!1,s=!0,u||f.call(a)},i=a._readableState&&a._readableState.endEmitted,p=function(){u=!1,i=!0,g||f.call(a)},m=function(w){f.call(a,w)},b=function(){var w;if(u&&!i)return(!a._readableState||!a._readableState.ended)&&(w=new e),f.call(a,w);if(g&&!s)return(!a._writableState||!a._writableState.ended)&&(w=new e),f.call(a,w)},d=function(){a.req.on("finish",o)};return t(a)?(a.on("complete",o),a.on("abort",b),a.req?d():a.on("request",d)):g&&!a._writableState&&(a.on("end",l),a.on("close",l)),a.on("end",p),a.on("finish",o),c.error!==!1&&a.on("error",m),a.on("close",b),function(){a.removeListener("complete",o),a.removeListener("abort",b),a.removeListener("request",d),a.req&&a.req.removeListener("finish",o),a.removeListener("end",l),a.removeListener("close",l),a.removeListener("finish",o),a.removeListener("end",p),a.removeListener("error",m),a.removeListener("close",b)}}return Tn=h,Tn}var Nn,Wo;function Fl(){if(Wo)return Nn;Wo=1;var e;function n(w,v,_){return v=r(v),v in w?Object.defineProperty(w,v,{value:_,enumerable:!0,configurable:!0,writable:!0}):w[v]=_,w}function r(w){var v=t(w,"string");return typeof v=="symbol"?v:String(v)}function t(w,v){if(typeof w!="object"||w===null)return w;var _=w[Symbol.toPrimitive];if(_!==void 0){var C=_.call(w,v);if(typeof C!="object")return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return(v==="string"?String:Number)(w)}var h=Rs(),a=Symbol("lastResolve"),c=Symbol("lastReject"),f=Symbol("error"),u=Symbol("ended"),g=Symbol("lastPromise"),l=Symbol("handlePromise"),s=Symbol("stream");function o(w,v){return{value:w,done:v}}function i(w){var v=w[a];if(v!==null){var _=w[s].read();_!==null&&(w[g]=null,w[a]=null,w[c]=null,v(o(_,!1)))}}function p(w){te.nextTick(i,w)}function m(w,v){return function(_,C){w.then(function(){if(v[u]){_(o(void 0,!0));return}v[l](_,C)},C)}}var b=Object.getPrototypeOf(function(){}),d=Object.setPrototypeOf((e={get stream(){return this[s]},next:function(){var v=this,_=this[f];if(_!==null)return Promise.reject(_);if(this[u])return Promise.resolve(o(void 0,!0));if(this[s].destroyed)return new Promise(function(P,B){te.nextTick(function(){v[f]?B(v[f]):P(o(void 0,!0))})});var C=this[g],S;if(C)S=new Promise(m(C,this));else{var I=this[s].read();if(I!==null)return Promise.resolve(o(I,!1));S=new Promise(this[l])}return this[g]=S,S}},n(e,Symbol.asyncIterator,function(){return this}),n(e,"return",function(){var v=this;return new Promise(function(_,C){v[s].destroy(null,function(S){if(S){C(S);return}_(o(void 0,!0))})})}),e),b),y=function(v){var _,C=Object.create(d,(_={},n(_,s,{value:v,writable:!0}),n(_,a,{value:null,writable:!0}),n(_,c,{value:null,writable:!0}),n(_,f,{value:null,writable:!0}),n(_,u,{value:v._readableState.endEmitted,writable:!0}),n(_,l,{value:function(I,P){var B=C[s].read();B?(C[g]=null,C[a]=null,C[c]=null,I(o(B,!1))):(C[a]=I,C[c]=P)},writable:!0}),_));return C[g]=null,h(v,function(S){if(S&&S.code!=="ERR_STREAM_PREMATURE_CLOSE"){var I=C[c];I!==null&&(C[g]=null,C[a]=null,C[c]=null,I(S)),C[f]=S;return}var P=C[a];P!==null&&(C[g]=null,C[a]=null,C[c]=null,P(o(void 0,!0))),C[u]=!0}),v.on("readable",p.bind(null,C)),C};return Nn=y,Nn}var Pn,Vo;function ql(){return Vo||(Vo=1,Pn=function(){throw new Error("Readable.from is not available in the browser")}),Pn}var On,zo;function Ru(){if(zo)return On;zo=1,On=P;var e;P.ReadableState=I,fr().EventEmitter;var n=function(R,O){return R.listeners(O).length},r=wu(),t=ms().Buffer,h=(typeof dr<"u"?dr:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function a(E){return t.from(E)}function c(E){return t.isBuffer(E)||E instanceof h}var f=du(),u;f&&f.debuglog?u=f.debuglog("stream"):u=function(){};var g=Dl(),l=vu(),s=_u(),o=s.getHighWaterMark,i=rt().codes,p=i.ERR_INVALID_ARG_TYPE,m=i.ERR_STREAM_PUSH_AFTER_EOF,b=i.ERR_METHOD_NOT_IMPLEMENTED,d=i.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,y,w,v;Ut()(P,r);var _=l.errorOrDestroy,C=["error","close","destroy","pause","resume"];function S(E,R,O){if(typeof E.prependListener=="function")return E.prependListener(R,O);!E._events||!E._events[R]?E.on(R,O):Array.isArray(E._events[R])?E._events[R].unshift(O):E._events[R]=[O,E._events[R]]}function I(E,R,O){e=e||tt(),E=E||{},typeof O!="boolean"&&(O=R instanceof e),this.objectMode=!!E.objectMode,O&&(this.objectMode=this.objectMode||!!E.readableObjectMode),this.highWaterMark=o(this,E,"readableHighWaterMark",O),this.buffer=new g,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=E.emitClose!==!1,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&&(y||(y=$s().StringDecoder),this.decoder=new y(E.encoding),this.encoding=E.encoding)}function P(E){if(e=e||tt(),!(this instanceof P))return new P(E);var R=this instanceof e;this._readableState=new I(E,this,R),this.readable=!0,E&&(typeof E.read=="function"&&(this._read=E.read),typeof E.destroy=="function"&&(this._destroy=E.destroy)),r.call(this)}Object.defineProperty(P.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(R){this._readableState&&(this._readableState.destroyed=R)}}),P.prototype.destroy=l.destroy,P.prototype._undestroy=l.undestroy,P.prototype._destroy=function(E,R){R(E)},P.prototype.push=function(E,R){var O=this._readableState,q;return O.objectMode?q=!0:typeof E=="string"&&(R=R||O.defaultEncoding,R!==O.encoding&&(E=t.from(E,R),R=""),q=!0),B(this,E,R,!1,q)},P.prototype.unshift=function(E){return B(this,E,null,!0,!1)};function B(E,R,O,q,ne){u("readableAddChunk",R);var Z=E._readableState;if(R===null)Z.reading=!1,M(E,Z);else{var re;if(ne||(re=z(Z,R)),re)_(E,re);else if(Z.objectMode||R&&R.length>0)if(typeof R!="string"&&!Z.objectMode&&Object.getPrototypeOf(R)!==t.prototype&&(R=a(R)),q)Z.endEmitted?_(E,new d):$(E,Z,R,!0);else if(Z.ended)_(E,new m);else{if(Z.destroyed)return!1;Z.reading=!1,Z.decoder&&!O?(R=Z.decoder.write(R),Z.objectMode||R.length!==0?$(E,Z,R,!1):x(E,Z)):$(E,Z,R,!1)}else q||(Z.reading=!1,x(E,Z))}return!Z.ended&&(Z.length<Z.highWaterMark||Z.length===0)}function $(E,R,O,q){R.flowing&&R.length===0&&!R.sync?(R.awaitDrain=0,E.emit("data",O)):(R.length+=R.objectMode?1:O.length,q?R.buffer.unshift(O):R.buffer.push(O),R.needReadable&&L(E)),x(E,R)}function z(E,R){var O;return!c(R)&&typeof R!="string"&&R!==void 0&&!E.objectMode&&(O=new p("chunk",["string","Buffer","Uint8Array"],R)),O}P.prototype.isPaused=function(){return this._readableState.flowing===!1},P.prototype.setEncoding=function(E){y||(y=$s().StringDecoder);var R=new y(E);this._readableState.decoder=R,this._readableState.encoding=this._readableState.decoder.encoding;for(var O=this._readableState.buffer.head,q="";O!==null;)q+=R.write(O.data),O=O.next;return this._readableState.buffer.clear(),q!==""&&this._readableState.buffer.push(q),this._readableState.length=q.length,this};var X=1073741824;function Y(E){return E>=X?E=X:(E--,E|=E>>>1,E|=E>>>2,E|=E>>>4,E|=E>>>8,E|=E>>>16,E++),E}function J(E,R){return E<=0||R.length===0&&R.ended?0:R.objectMode?1:E!==E?R.flowing&&R.length?R.buffer.head.data.length:R.length:(E>R.highWaterMark&&(R.highWaterMark=Y(E)),E<=R.length?E:R.ended?R.length:(R.needReadable=!0,0))}P.prototype.read=function(E){u("read",E),E=parseInt(E,10);var R=this._readableState,O=E;if(E!==0&&(R.emittedReadable=!1),E===0&&R.needReadable&&((R.highWaterMark!==0?R.length>=R.highWaterMark:R.length>0)||R.ended))return u("read: emitReadable",R.length,R.ended),R.length===0&&R.ended?N(this):L(this),null;if(E=J(E,R),E===0&&R.ended)return R.length===0&&N(this),null;var q=R.needReadable;u("need readable",q),(R.length===0||R.length-E<R.highWaterMark)&&(q=!0,u("length less than watermark",q)),R.ended||R.reading?(q=!1,u("reading or ended",q)):q&&(u("do read"),R.reading=!0,R.sync=!0,R.length===0&&(R.needReadable=!0),this._read(R.highWaterMark),R.sync=!1,R.reading||(E=J(O,R)));var ne;return E>0?ne=A(E,R):ne=null,ne===null?(R.needReadable=R.length<=R.highWaterMark,E=0):(R.length-=E,R.awaitDrain=0),R.length===0&&(R.ended||(R.needReadable=!0),O!==E&&R.ended&&N(this)),ne!==null&&this.emit("data",ne),ne};function M(E,R){if(u("onEofChunk"),!R.ended){if(R.decoder){var O=R.decoder.end();O&&O.length&&(R.buffer.push(O),R.length+=R.objectMode?1:O.length)}R.ended=!0,R.sync?L(E):(R.needReadable=!1,R.emittedReadable||(R.emittedReadable=!0,T(E)))}}function L(E){var R=E._readableState;u("emitReadable",R.needReadable,R.emittedReadable),R.needReadable=!1,R.emittedReadable||(u("emitReadable",R.flowing),R.emittedReadable=!0,te.nextTick(T,E))}function T(E){var R=E._readableState;u("emitReadable_",R.destroyed,R.length,R.ended),!R.destroyed&&(R.length||R.ended)&&(E.emit("readable"),R.emittedReadable=!1),R.needReadable=!R.flowing&&!R.ended&&R.length<=R.highWaterMark,k(E)}function x(E,R){R.readingMore||(R.readingMore=!0,te.nextTick(D,E,R))}function D(E,R){for(;!R.reading&&!R.ended&&(R.length<R.highWaterMark||R.flowing&&R.length===0);){var O=R.length;if(u("maybeReadMore read 0"),E.read(0),O===R.length)break}R.readingMore=!1}P.prototype._read=function(E){_(this,new b("_read()"))},P.prototype.pipe=function(E,R){var O=this,q=this._readableState;switch(q.pipesCount){case 0:q.pipes=E;break;case 1:q.pipes=[q.pipes,E];break;default:q.pipes.push(E);break}q.pipesCount+=1,u("pipe count=%d opts=%j",q.pipesCount,R);var ne=(!R||R.end!==!1)&&E!==te.stdout&&E!==te.stderr,Z=ne?ye:Se;q.endEmitted?te.nextTick(Z):O.once("end",Z),E.on("unpipe",re);function re(we,ve){u("onunpipe"),we===O&&ve&&ve.hasUnpiped===!1&&(ve.hasUnpiped=!0,Kt())}function ye(){u("onend"),E.end()}var Ie=V(O);E.on("drain",Ie);var it=!1;function Kt(){u("cleanup"),E.removeListener("close",Xe),E.removeListener("finish",et),E.removeListener("drain",Ie),E.removeListener("error",Ye),E.removeListener("unpipe",re),O.removeListener("end",ye),O.removeListener("end",Se),O.removeListener("data",st),it=!0,q.awaitDrain&&(!E._writableState||E._writableState.needDrain)&&Ie()}O.on("data",st);function st(we){u("ondata");var ve=E.write(we);u("dest.write",ve),ve===!1&&((q.pipesCount===1&&q.pipes===E||q.pipesCount>1&&Q(q.pipes,E)!==-1)&&!it&&(u("false write response, pause",q.awaitDrain),q.awaitDrain++),O.pause())}function Ye(we){u("onerror",we),Se(),E.removeListener("error",Ye),n(E,"error")===0&&_(E,we)}S(E,"error",Ye);function Xe(){E.removeListener("finish",et),Se()}E.once("close",Xe);function et(){u("onfinish"),E.removeListener("close",Xe),Se()}E.once("finish",et);function Se(){u("unpipe"),O.unpipe(E)}return E.emit("pipe",O),q.flowing||(u("pipe resume"),O.resume()),E};function V(E){return function(){var O=E._readableState;u("pipeOnDrain",O.awaitDrain),O.awaitDrain&&O.awaitDrain--,O.awaitDrain===0&&n(E,"data")&&(O.flowing=!0,k(E))}}P.prototype.unpipe=function(E){var R=this._readableState,O={hasUnpiped:!1};if(R.pipesCount===0)return this;if(R.pipesCount===1)return E&&E!==R.pipes?this:(E||(E=R.pipes),R.pipes=null,R.pipesCount=0,R.flowing=!1,E&&E.emit("unpipe",this,O),this);if(!E){var q=R.pipes,ne=R.pipesCount;R.pipes=null,R.pipesCount=0,R.flowing=!1;for(var Z=0;Z<ne;Z++)q[Z].emit("unpipe",this,{hasUnpiped:!1});return this}var re=Q(R.pipes,E);return re===-1?this:(R.pipes.splice(re,1),R.pipesCount-=1,R.pipesCount===1&&(R.pipes=R.pipes[0]),E.emit("unpipe",this,O),this)},P.prototype.on=function(E,R){var O=r.prototype.on.call(this,E,R),q=this._readableState;return E==="data"?(q.readableListening=this.listenerCount("readable")>0,q.flowing!==!1&&this.resume()):E==="readable"&&!q.endEmitted&&!q.readableListening&&(q.readableListening=q.needReadable=!0,q.flowing=!1,q.emittedReadable=!1,u("on readable",q.length,q.reading),q.length?L(this):q.reading||te.nextTick(j,this)),O},P.prototype.addListener=P.prototype.on,P.prototype.removeListener=function(E,R){var O=r.prototype.removeListener.call(this,E,R);return E==="readable"&&te.nextTick(F,this),O},P.prototype.removeAllListeners=function(E){var R=r.prototype.removeAllListeners.apply(this,arguments);return(E==="readable"||E===void 0)&&te.nextTick(F,this),R};function F(E){var R=E._readableState;R.readableListening=E.listenerCount("readable")>0,R.resumeScheduled&&!R.paused?R.flowing=!0:E.listenerCount("data")>0&&E.resume()}function j(E){u("readable nexttick read 0"),E.read(0)}P.prototype.resume=function(){var E=this._readableState;return E.flowing||(u("resume"),E.flowing=!E.readableListening,G(this,E)),E.paused=!1,this};function G(E,R){R.resumeScheduled||(R.resumeScheduled=!0,te.nextTick(H,E,R))}function H(E,R){u("resume",R.reading),R.reading||E.read(0),R.resumeScheduled=!1,E.emit("resume"),k(E),R.flowing&&!R.reading&&E.read(0)}P.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function k(E){var R=E._readableState;for(u("flow",R.flowing);R.flowing&&E.read()!==null;);}P.prototype.wrap=function(E){var R=this,O=this._readableState,q=!1;E.on("end",function(){if(u("wrapped end"),O.decoder&&!O.ended){var re=O.decoder.end();re&&re.length&&R.push(re)}R.push(null)}),E.on("data",function(re){if(u("wrapped data"),O.decoder&&(re=O.decoder.write(re)),!(O.objectMode&&re==null)&&!(!O.objectMode&&(!re||!re.length))){var ye=R.push(re);ye||(q=!0,E.pause())}});for(var ne in E)this[ne]===void 0&&typeof E[ne]=="function"&&(this[ne]=(function(ye){return function(){return E[ye].apply(E,arguments)}})(ne));for(var Z=0;Z<C.length;Z++)E.on(C[Z],this.emit.bind(this,C[Z]));return this._read=function(re){u("wrapped _read",re),q&&(q=!1,E.resume())},this},typeof Symbol=="function"&&(P.prototype[Symbol.asyncIterator]=function(){return w===void 0&&(w=Fl()),w(this)}),Object.defineProperty(P.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(P.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(P.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(R){this._readableState&&(this._readableState.flowing=R)}}),P._fromList=A,Object.defineProperty(P.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function A(E,R){if(R.length===0)return null;var O;return R.objectMode?O=R.buffer.shift():!E||E>=R.length?(R.decoder?O=R.buffer.join(""):R.buffer.length===1?O=R.buffer.first():O=R.buffer.concat(R.length),R.buffer.clear()):O=R.buffer.consume(E,R.decoder),O}function N(E){var R=E._readableState;u("endReadable",R.endEmitted),R.endEmitted||(R.ended=!0,te.nextTick(U,R,E))}function U(E,R){if(u("endReadableNT",E.endEmitted,E.length),!E.endEmitted&&E.length===0&&(E.endEmitted=!0,R.readable=!1,R.emit("end"),E.autoDestroy)){var O=R._writableState;(!O||O.autoDestroy&&O.finished)&&R.destroy()}}typeof Symbol=="function"&&(P.from=function(E,R){return v===void 0&&(v=ql()),v(P,E,R)});function Q(E,R){for(var O=0,q=E.length;O<q;O++)if(E[O]===R)return O;return-1}return On}var xn,Jo;function Su(){if(Jo)return xn;Jo=1,xn=f;var e=rt().codes,n=e.ERR_METHOD_NOT_IMPLEMENTED,r=e.ERR_MULTIPLE_CALLBACK,t=e.ERR_TRANSFORM_ALREADY_TRANSFORMING,h=e.ERR_TRANSFORM_WITH_LENGTH_0,a=tt();Ut()(f,a);function c(l,s){var o=this._transformState;o.transforming=!1;var i=o.writecb;if(i===null)return this.emit("error",new r);o.writechunk=null,o.writecb=null,s!=null&&this.push(s),i(l);var p=this._readableState;p.reading=!1,(p.needReadable||p.length<p.highWaterMark)&&this._read(p.highWaterMark)}function f(l){if(!(this instanceof f))return new f(l);a.call(this,l),this._transformState={afterTransform:c.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,l&&(typeof l.transform=="function"&&(this._transform=l.transform),typeof l.flush=="function"&&(this._flush=l.flush)),this.on("prefinish",u)}function u(){var l=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(s,o){g(l,s,o)}):g(this,null,null)}f.prototype.push=function(l,s){return this._transformState.needTransform=!1,a.prototype.push.call(this,l,s)},f.prototype._transform=function(l,s,o){o(new n("_transform()"))},f.prototype._write=function(l,s,o){var i=this._transformState;if(i.writecb=o,i.writechunk=l,i.writeencoding=s,!i.transforming){var p=this._readableState;(i.needTransform||p.needReadable||p.length<p.highWaterMark)&&this._read(p.highWaterMark)}},f.prototype._read=function(l){var s=this._transformState;s.writechunk!==null&&!s.transforming?(s.transforming=!0,this._transform(s.writechunk,s.writeencoding,s.afterTransform)):s.needTransform=!0},f.prototype._destroy=function(l,s){a.prototype._destroy.call(this,l,function(o){s(o)})};function g(l,s,o){if(s)return l.emit("error",s);if(o!=null&&l.push(o),l._writableState.length)throw new h;if(l._transformState.transforming)throw new t;return l.push(null)}return xn}var Bn,Go;function jl(){if(Go)return Bn;Go=1,Bn=n;var e=Su();Ut()(n,e);function n(r){if(!(this instanceof n))return new n(r);e.call(this,r)}return n.prototype._transform=function(r,t,h){h(null,r)},Bn}var Dn,Zo;function $l(){if(Zo)return Dn;Zo=1;var e;function n(o){var i=!1;return function(){i||(i=!0,o.apply(void 0,arguments))}}var r=rt().codes,t=r.ERR_MISSING_ARGS,h=r.ERR_STREAM_DESTROYED;function a(o){if(o)throw o}function c(o){return o.setHeader&&typeof o.abort=="function"}function f(o,i,p,m){m=n(m);var b=!1;o.on("close",function(){b=!0}),e===void 0&&(e=Rs()),e(o,{readable:i,writable:p},function(y){if(y)return m(y);b=!0,m()});var d=!1;return function(y){if(!b&&!d){if(d=!0,c(o))return o.abort();if(typeof o.destroy=="function")return o.destroy();m(y||new h("pipe"))}}}function u(o){o()}function g(o,i){return o.pipe(i)}function l(o){return!o.length||typeof o[o.length-1]!="function"?a:o.pop()}function s(){for(var o=arguments.length,i=new Array(o),p=0;p<o;p++)i[p]=arguments[p];var m=l(i);if(Array.isArray(i[0])&&(i=i[0]),i.length<2)throw new t("streams");var b,d=i.map(function(y,w){var v=w<i.length-1,_=w>0;return f(y,v,_,function(C){b||(b=C),C&&d.forEach(u),!v&&(d.forEach(u),m(b))})});return i.reduce(g)}return Dn=s,Dn}var Ko;function Cu(){return Ko||(Ko=1,(function(e,n){n=e.exports=Ru(),n.Stream=n,n.Readable=n,n.Writable=Eu(),n.Duplex=tt(),n.Transform=Su(),n.PassThrough=jl(),n.finished=Rs(),n.pipeline=$l()})(ir,ir.exports)),ir.exports}var Fn,Qo;function Hl(){if(Qo)return Fn;Qo=1;const{Transform:e}=Cu();return Fn=n=>class ku extends e{constructor(t,h,a,c,f){super(f),this._rate=t,this._capacity=h,this._delimitedSuffix=a,this._hashBitLength=c,this._options=f,this._state=new n,this._state.initialize(t,h),this._finalized=!1}_transform(t,h,a){let c=null;try{this.update(t,h)}catch(f){c=f}a(c)}_flush(t){let h=null;try{this.push(this.digest())}catch(a){h=a}t(h)}update(t,h){if(!K.isBuffer(t)&&typeof t!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return K.isBuffer(t)||(t=K.from(t,h)),this._state.absorb(t),this}digest(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let h=this._state.squeeze(this._hashBitLength/8);return t!==void 0&&(h=h.toString(t)),this._resetState(),h}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const t=new ku(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(t._state),t._finalized=this._finalized,t}},Fn}var qn,Yo;function Ul(){if(Yo)return qn;Yo=1;const{Transform:e}=Cu();return qn=n=>class Iu extends e{constructor(t,h,a,c){super(c),this._rate=t,this._capacity=h,this._delimitedSuffix=a,this._options=c,this._state=new n,this._state.initialize(t,h),this._finalized=!1}_transform(t,h,a){let c=null;try{this.update(t,h)}catch(f){c=f}a(c)}_flush(){}_read(t){this.push(this.squeeze(t))}update(t,h){if(!K.isBuffer(t)&&typeof t!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return K.isBuffer(t)||(t=K.from(t,h)),this._state.absorb(t),this}squeeze(t,h){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let a=this._state.squeeze(t);return h!==void 0&&(a=a.toString(h)),a}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const t=new Iu(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(t._state),t._finalized=this._finalized,t}},qn}var jn,Xo;function Wl(){if(Xo)return jn;Xo=1;const e=Hl(),n=Ul();return jn=function(r){const t=e(r),h=n(r);return function(a,c){switch(typeof a=="string"?a.toLowerCase():a){case"keccak224":return new t(1152,448,null,224,c);case"keccak256":return new t(1088,512,null,256,c);case"keccak384":return new t(832,768,null,384,c);case"keccak512":return new t(576,1024,null,512,c);case"sha3-224":return new t(1152,448,6,224,c);case"sha3-256":return new t(1088,512,6,256,c);case"sha3-384":return new t(832,768,6,384,c);case"sha3-512":return new t(576,1024,6,512,c);case"shake128":return new h(1344,256,31,c);case"shake256":return new h(1088,512,31,c);default:throw new Error("Invald algorithm: "+a)}}},jn}var $n={},ea;function Vl(){if(ea)return $n;ea=1;const e=[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];return $n.p1600=function(n){for(let r=0;r<24;++r){const t=n[0]^n[10]^n[20]^n[30]^n[40],h=n[1]^n[11]^n[21]^n[31]^n[41],a=n[2]^n[12]^n[22]^n[32]^n[42],c=n[3]^n[13]^n[23]^n[33]^n[43],f=n[4]^n[14]^n[24]^n[34]^n[44],u=n[5]^n[15]^n[25]^n[35]^n[45],g=n[6]^n[16]^n[26]^n[36]^n[46],l=n[7]^n[17]^n[27]^n[37]^n[47],s=n[8]^n[18]^n[28]^n[38]^n[48],o=n[9]^n[19]^n[29]^n[39]^n[49];let i=s^(a<<1|c>>>31),p=o^(c<<1|a>>>31);const m=n[0]^i,b=n[1]^p,d=n[10]^i,y=n[11]^p,w=n[20]^i,v=n[21]^p,_=n[30]^i,C=n[31]^p,S=n[40]^i,I=n[41]^p;i=t^(f<<1|u>>>31),p=h^(u<<1|f>>>31);const P=n[2]^i,B=n[3]^p,$=n[12]^i,z=n[13]^p,X=n[22]^i,Y=n[23]^p,J=n[32]^i,M=n[33]^p,L=n[42]^i,T=n[43]^p;i=a^(g<<1|l>>>31),p=c^(l<<1|g>>>31);const x=n[4]^i,D=n[5]^p,V=n[14]^i,F=n[15]^p,j=n[24]^i,G=n[25]^p,H=n[34]^i,k=n[35]^p,A=n[44]^i,N=n[45]^p;i=f^(s<<1|o>>>31),p=u^(o<<1|s>>>31);const U=n[6]^i,Q=n[7]^p,E=n[16]^i,R=n[17]^p,O=n[26]^i,q=n[27]^p,ne=n[36]^i,Z=n[37]^p,re=n[46]^i,ye=n[47]^p;i=g^(t<<1|h>>>31),p=l^(h<<1|t>>>31);const Ie=n[8]^i,it=n[9]^p,Kt=n[18]^i,st=n[19]^p,Ye=n[28]^i,Xe=n[29]^p,et=n[38]^i,Se=n[39]^p,we=n[48]^i,ve=n[49]^p,Rr=m,Sr=b,Cr=y<<4|d>>>28,kr=d<<4|y>>>28,Ir=w<<3|v>>>29,Ar=v<<3|w>>>29,Mr=C<<9|_>>>23,Lr=_<<9|C>>>23,Tr=S<<18|I>>>14,Nr=I<<18|S>>>14,Pr=P<<1|B>>>31,Or=B<<1|P>>>31,xr=z<<12|$>>>20,Br=$<<12|z>>>20,Dr=X<<10|Y>>>22,Fr=Y<<10|X>>>22,qr=M<<13|J>>>19,jr=J<<13|M>>>19,$r=L<<2|T>>>30,Hr=T<<2|L>>>30,Ur=D<<30|x>>>2,Wr=x<<30|D>>>2,Vr=V<<6|F>>>26,zr=F<<6|V>>>26,Jr=G<<11|j>>>21,Gr=j<<11|G>>>21,Zr=H<<15|k>>>17,Kr=k<<15|H>>>17,Qr=N<<29|A>>>3,Yr=A<<29|N>>>3,Xr=U<<28|Q>>>4,en=Q<<28|U>>>4,tn=R<<23|E>>>9,rn=E<<23|R>>>9,nn=O<<25|q>>>7,sn=q<<25|O>>>7,on=ne<<21|Z>>>11,an=Z<<21|ne>>>11,cn=ye<<24|re>>>8,un=re<<24|ye>>>8,ln=Ie<<27|it>>>5,dn=it<<27|Ie>>>5,hn=Kt<<20|st>>>12,fn=st<<20|Kt>>>12,gn=Xe<<7|Ye>>>25,pn=Ye<<7|Xe>>>25,mn=et<<8|Se>>>24,bn=Se<<8|et>>>24,yn=we<<14|ve>>>18,wn=ve<<14|we>>>18;n[0]=Rr^~xr&Jr,n[1]=Sr^~Br&Gr,n[10]=Xr^~hn&Ir,n[11]=en^~fn&Ar,n[20]=Pr^~Vr&nn,n[21]=Or^~zr&sn,n[30]=ln^~Cr&Dr,n[31]=dn^~kr&Fr,n[40]=Ur^~tn&gn,n[41]=Wr^~rn&pn,n[2]=xr^~Jr&on,n[3]=Br^~Gr&an,n[12]=hn^~Ir&qr,n[13]=fn^~Ar&jr,n[22]=Vr^~nn&mn,n[23]=zr^~sn&bn,n[32]=Cr^~Dr&Zr,n[33]=kr^~Fr&Kr,n[42]=tn^~gn&Mr,n[43]=rn^~pn&Lr,n[4]=Jr^~on&yn,n[5]=Gr^~an&wn,n[14]=Ir^~qr&Qr,n[15]=Ar^~jr&Yr,n[24]=nn^~mn&Tr,n[25]=sn^~bn&Nr,n[34]=Dr^~Zr&cn,n[35]=Fr^~Kr&un,n[44]=gn^~Mr&$r,n[45]=pn^~Lr&Hr,n[6]=on^~yn&Rr,n[7]=an^~wn&Sr,n[16]=qr^~Qr&Xr,n[17]=jr^~Yr&en,n[26]=mn^~Tr&Pr,n[27]=bn^~Nr&Or,n[36]=Zr^~cn&ln,n[37]=Kr^~un&dn,n[46]=Mr^~$r&Ur,n[47]=Lr^~Hr&Wr,n[8]=yn^~Rr&xr,n[9]=wn^~Sr&Br,n[18]=Qr^~Xr&hn,n[19]=Yr^~en&fn,n[28]=Tr^~Pr&Vr,n[29]=Nr^~Or&zr,n[38]=cn^~ln&Cr,n[39]=un^~dn&kr,n[48]=$r^~Ur&tn,n[49]=Hr^~Wr&rn,n[0]^=e[r*2],n[1]^=e[r*2+1]}},$n}var Hn,ta;function zl(){if(ta)return Hn;ta=1;const e=Vl();function n(){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}return n.prototype.initialize=function(r,t){for(let h=0;h<50;++h)this.state[h]=0;this.blockSize=r/8,this.count=0,this.squeezing=!1},n.prototype.absorb=function(r){for(let t=0;t<r.length;++t)this.state[~~(this.count/4)]^=r[t]<<8*(this.count%4),this.count+=1,this.count===this.blockSize&&(e.p1600(this.state),this.count=0)},n.prototype.absorbLastFewBits=function(r){this.state[~~(this.count/4)]^=r<<8*(this.count%4),(r&128)!==0&&this.count===this.blockSize-1&&e.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<8*((this.blockSize-1)%4),e.p1600(this.state),this.count=0,this.squeezing=!0},n.prototype.squeeze=function(r){this.squeezing||this.absorbLastFewBits(1);const t=K.alloc(r);for(let h=0;h<r;++h)t[h]=this.state[~~(this.count/4)]>>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(e.p1600(this.state),this.count=0);return t},n.prototype.copy=function(r){for(let t=0;t<50;++t)r.state[t]=this.state[t];r.blockSize=this.blockSize,r.count=this.count,r.squeezing=this.squeezing},Hn=n,Hn}var Un,ra;function Jl(){return ra||(ra=1,Un=Wl()(zl())),Un}var Wn,na;function Au(){if(na)return Wn;na=1;const e=Jl(),n=hr();function r(s){return K.allocUnsafe(s).fill(0)}function t(s,o,i){const p=r(o);return s=a(s),i?s.length<o?(s.copy(p),p):s.slice(0,o):s.length<o?(s.copy(p,o-s.length),p):s.slice(-o)}function h(s,o){return t(s,o,!0)}function a(s){if(!K.isBuffer(s))if(Array.isArray(s))s=K.from(s);else if(typeof s=="string")g(s)?s=K.from(u(l(s)),"hex"):s=K.from(s);else if(typeof s=="number")s=intToBuffer(s);else if(s==null)s=K.allocUnsafe(0);else if(n.isBN(s))s=s.toArrayLike(K);else if(s.toArray)s=K.from(s.toArray());else throw new Error("invalid type");return s}function c(s){return s=a(s),"0x"+s.toString("hex")}function f(s,o){return s=a(s),o||(o=256),e("keccak"+o).update(s).digest()}function u(s){return s.length%2?"0"+s:s}function g(s){return typeof s=="string"&&s.match(/^0x[0-9A-Fa-f]*$/)}function l(s){return typeof s=="string"&&s.startsWith("0x")?s.slice(2):s}return Wn={zeros:r,setLength:t,setLengthRight:h,isHexString:g,stripHexPrefix:l,toBuffer:a,bufferToHex:c,keccak:f},Wn}var Vn,ia;function Gl(){if(ia)return Vn;ia=1;const e=Au(),n=hr();function r(i){return i.startsWith("int[")?"int256"+i.slice(3):i==="int"?"int256":i.startsWith("uint[")?"uint256"+i.slice(4):i==="uint"?"uint256":i.startsWith("fixed[")?"fixed128x128"+i.slice(5):i==="fixed"?"fixed128x128":i.startsWith("ufixed[")?"ufixed128x128"+i.slice(6):i==="ufixed"?"ufixed128x128":i}function t(i){return parseInt(/^\D+(\d+)$/.exec(i)[1],10)}function h(i){var p=/^\D+(\d+)x(\d+)$/.exec(i);return[parseInt(p[1],10),parseInt(p[2],10)]}function a(i){var p=i.match(/(.*)\[(.*?)\]$/);return p?p[2]===""?"dynamic":parseInt(p[2],10):null}function c(i){var p=typeof i;if(p==="string")return e.isHexString(i)?new n(e.stripHexPrefix(i),16):new n(i,10);if(p==="number")return new n(i);if(i.toArray)return i;throw new Error("Argument is not a number")}function f(i,p){var m,b,d,y;if(i==="address")return f("uint160",c(p));if(i==="bool")return f("uint8",p?1:0);if(i==="string")return f("bytes",new K(p,"utf8"));if(g(i)){if(typeof p.length>"u")throw new Error("Not an array?");if(m=a(i),m!=="dynamic"&&m!==0&&p.length>m)throw new Error("Elements exceed array size: "+m);d=[],i=i.slice(0,i.lastIndexOf("[")),typeof p=="string"&&(p=JSON.parse(p));for(y in p)d.push(f(i,p[y]));if(m==="dynamic"){var w=f("uint256",p.length);d.unshift(w)}return K.concat(d)}else{if(i==="bytes")return p=new K(p),d=K.concat([f("uint256",p.length),p]),p.length%32!==0&&(d=K.concat([d,e.zeros(32-p.length%32)])),d;if(i.startsWith("bytes")){if(m=t(i),m<1||m>32)throw new Error("Invalid bytes<N> width: "+m);return e.setLengthRight(p,32)}else if(i.startsWith("uint")){if(m=t(i),m%8||m<8||m>256)throw new Error("Invalid uint<N> width: "+m);if(b=c(p),b.bitLength()>m)throw new Error("Supplied uint exceeds width: "+m+" vs "+b.bitLength());if(b<0)throw new Error("Supplied uint is negative");return b.toArrayLike(K,"be",32)}else if(i.startsWith("int")){if(m=t(i),m%8||m<8||m>256)throw new Error("Invalid int<N> width: "+m);if(b=c(p),b.bitLength()>m)throw new Error("Supplied int exceeds width: "+m+" vs "+b.bitLength());return b.toTwos(256).toArrayLike(K,"be",32)}else if(i.startsWith("ufixed")){if(m=h(i),b=c(p),b<0)throw new Error("Supplied ufixed is negative");return f("uint256",b.mul(new n(2).pow(new n(m[1]))))}else if(i.startsWith("fixed"))return m=h(i),f("int256",c(p).mul(new n(2).pow(new n(m[1]))))}throw new Error("Unsupported or invalid type: "+i)}function u(i){return i==="string"||i==="bytes"||a(i)==="dynamic"}function g(i){return i.lastIndexOf("]")===i.length-1}function l(i,p){var m=[],b=[],d=32*i.length;for(var y in i){var w=r(i[y]),v=p[y],_=f(w,v);u(w)?(m.push(f("uint256",d)),b.push(_),d+=_.length):m.push(_)}return K.concat(m.concat(b))}function s(i,p){if(i.length!==p.length)throw new Error("Number of types are not matching the values");for(var m,b,d=[],y=0;y<i.length;y++){var w=r(i[y]),v=p[y];if(w==="bytes")d.push(v);else if(w==="string")d.push(new K(v,"utf8"));else if(w==="bool")d.push(new K(v?"01":"00","hex"));else if(w==="address")d.push(e.setLength(v,20));else if(w.startsWith("bytes")){if(m=t(w),m<1||m>32)throw new Error("Invalid bytes<N> width: "+m);d.push(e.setLengthRight(v,m))}else if(w.startsWith("uint")){if(m=t(w),m%8||m<8||m>256)throw new Error("Invalid uint<N> width: "+m);if(b=c(v),b.bitLength()>m)throw new Error("Supplied uint exceeds width: "+m+" vs "+b.bitLength());d.push(b.toArrayLike(K,"be",m/8))}else if(w.startsWith("int")){if(m=t(w),m%8||m<8||m>256)throw new Error("Invalid int<N> width: "+m);if(b=c(v),b.bitLength()>m)throw new Error("Supplied int exceeds width: "+m+" vs "+b.bitLength());d.push(b.toTwos(m).toArrayLike(K,"be",m/8))}else throw new Error("Unsupported or invalid type: "+w)}return K.concat(d)}function o(i,p){return e.keccak(s(i,p))}return Vn={rawEncode:l,solidityPack:s,soliditySHA3:o},Vn}var zn,sa;function Zl(){if(sa)return zn;sa=1;const e=Au(),n=Gl(),r={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"]},t={encodeData(a,c,f,u=!0){const g=["bytes32"],l=[this.hashType(a,f)];if(u){const s=(o,i,p)=>{if(f[i]!==void 0)return["bytes32",p==null?"0x0000000000000000000000000000000000000000000000000000000000000000":e.keccak(this.encodeData(i,p,f,u))];if(p===void 0)throw new Error(`missing value for field ${o} of type ${i}`);if(i==="bytes")return["bytes32",e.keccak(p)];if(i==="string")return typeof p=="string"&&(p=K.from(p,"utf8")),["bytes32",e.keccak(p)];if(i.lastIndexOf("]")===i.length-1){const m=i.slice(0,i.lastIndexOf("[")),b=p.map(d=>s(o,m,d));return["bytes32",e.keccak(n.rawEncode(b.map(([d])=>d),b.map(([,d])=>d)))]}return[i,p]};for(const o of f[a]){const[i,p]=s(o.name,o.type,c[o.name]);g.push(i),l.push(p)}}else for(const s of f[a]){let o=c[s.name];if(o!==void 0)if(s.type==="bytes")g.push("bytes32"),o=e.keccak(o),l.push(o);else if(s.type==="string")g.push("bytes32"),typeof o=="string"&&(o=K.from(o,"utf8")),o=e.keccak(o),l.push(o);else if(f[s.type]!==void 0)g.push("bytes32"),o=e.keccak(this.encodeData(s.type,o,f,u)),l.push(o);else{if(s.type.lastIndexOf("]")===s.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");g.push(s.type),l.push(o)}}return n.rawEncode(g,l)},encodeType(a,c){let f="",u=this.findTypeDependencies(a,c).filter(g=>g!==a);u=[a].concat(u.sort());for(const g of u){if(!c[g])throw new Error("No type definition specified: "+g);f+=g+"("+c[g].map(({name:s,type:o})=>o+" "+s).join(",")+")"}return f},findTypeDependencies(a,c,f=[]){if(a=a.match(/^\w*/)[0],f.includes(a)||c[a]===void 0)return f;f.push(a);for(const u of c[a])for(const g of this.findTypeDependencies(u.type,c,f))!f.includes(g)&&f.push(g);return f},hashStruct(a,c,f,u=!0){return e.keccak(this.encodeData(a,c,f,u))},hashType(a,c){return e.keccak(this.encodeType(a,c))},sanitizeData(a){const c={};for(const f in r.properties)a[f]&&(c[f]=a[f]);return c.types&&(c.types=Object.assign({EIP712Domain:[]},c.types)),c},hash(a,c=!0){const f=this.sanitizeData(a),u=[K.from("1901","hex")];return u.push(this.hashStruct("EIP712Domain",f.domain,f.types,c)),f.primaryType!=="EIP712Domain"&&u.push(this.hashStruct(f.primaryType,f.message,f.types,c)),e.keccak(K.concat(u))}};zn={TYPED_MESSAGE_SCHEMA:r,TypedDataUtils:t,hashForSignTypedDataLegacy:function(a){return h(a.data)},hashForSignTypedData_v3:function(a){return t.hash(a.data,!1)},hashForSignTypedData_v4:function(a){return t.hash(a.data)}};function h(a){const c=new Error("Expect argument to be non-empty array");if(typeof a!="object"||!a.length)throw c;const f=a.map(function(l){return l.type==="bytes"?e.toBuffer(l.value):l.value}),u=a.map(function(l){return l.type}),g=a.map(function(l){if(!l.name)throw c;return l.type+" "+l.name});return n.soliditySHA3(["bytes32","bytes32"],[n.soliditySHA3(new Array(a.length).fill("string"),g),n.soliditySHA3(u,f)])}return zn}var Fe={},oa;function Kl(){if(oa)return Fe;oa=1,Object.defineProperty(Fe,"__esModule",{value:!0}),Fe.filterFromParam=Fe.FilterPolyfill=void 0;const e=mr(),n=Re(),r=300*1e3,t={jsonrpc:"2.0",id:0};let h=class{constructor(o){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,e.IntNumber)(1),this.REQUEST_THROTTLE_INTERVAL=1e3,this.lastFetchTimestamp=new Date(0),this.resolvers=[],this.provider=o}async newFilter(o){const i=a(o),p=this.makeFilterId(),m=await this.setInitialCursorPosition(p,i.fromBlock);return console.info(`Installing new log filter(${p}):`,i,"initial cursor position:",m),this.logFilters.set(p,i),this.setFilterTimeout(p),(0,n.hexStringFromIntNumber)(p)}async newBlockFilter(){const o=this.makeFilterId(),i=await this.setInitialCursorPosition(o,"latest");return console.info(`Installing new block filter (${o}) with initial cursor position:`,i),this.blockFilters.add(o),this.setFilterTimeout(o),(0,n.hexStringFromIntNumber)(o)}async newPendingTransactionFilter(){const o=this.makeFilterId(),i=await this.setInitialCursorPosition(o,"latest");return console.info(`Installing new block filter (${o}) with initial cursor position:`,i),this.pendingTransactionFilters.add(o),this.setFilterTimeout(o),(0,n.hexStringFromIntNumber)(o)}uninstallFilter(o){const i=(0,n.intNumberFromHexString)(o);return console.info(`Uninstalling filter (${i})`),this.deleteFilter(i),!0}getFilterChanges(o){const i=(0,n.intNumberFromHexString)(o);return this.timeouts.has(i)&&this.setFilterTimeout(i),this.logFilters.has(i)?this.getLogFilterChanges(i):this.blockFilters.has(i)?this.getBlockFilterChanges(i):this.pendingTransactionFilters.has(i)?this.getPendingTransactionFilterChanges(i):Promise.resolve(g())}async getFilterLogs(o){const i=(0,n.intNumberFromHexString)(o),p=this.logFilters.get(i);return p?this.sendAsyncPromise(Object.assign(Object.assign({},t),{method:"eth_getLogs",params:[c(p)]})):g()}makeFilterId(){return(0,e.IntNumber)(++this.nextFilterId)}sendAsyncPromise(o){return new Promise((i,p)=>{this.provider.sendAsync(o,(m,b)=>{if(m)return p(m);if(Array.isArray(b)||b==null)return p(new Error(`unexpected response received: ${JSON.stringify(b)}`));i(b)})})}deleteFilter(o){console.info(`Deleting filter (${o})`),this.logFilters.delete(o),this.blockFilters.delete(o),this.pendingTransactionFilters.delete(o),this.cursors.delete(o),this.timeouts.delete(o)}async getLogFilterChanges(o){const i=this.logFilters.get(o),p=this.cursors.get(o);if(!p||!i)return g();const m=await this.getCurrentBlockHeight(),b=i.toBlock==="latest"?m:i.toBlock;if(p>m||p>Number(i.toBlock))return l();console.info(`Fetching logs from ${p} to ${b} for filter ${o}`);const d=await this.sendAsyncPromise(Object.assign(Object.assign({},t),{method:"eth_getLogs",params:[c(Object.assign(Object.assign({},i),{fromBlock:p,toBlock:b}))]}));if(Array.isArray(d.result)){const y=d.result.map(v=>(0,n.intNumberFromHexString)(v.blockNumber||"0x0")),w=Math.max(...y);if(w&&w>p){const v=(0,e.IntNumber)(w+1);console.info(`Moving cursor position for filter (${o}) from ${p} to ${v}`),this.cursors.set(o,v)}}return d}async getBlockFilterChanges(o){const i=this.cursors.get(o);if(!i)return g();const p=await this.getCurrentBlockHeight();if(i>p)return l();console.info(`Fetching blocks from ${i} to ${p} for filter (${o})`);const m=(await Promise.all((0,n.range)(i,p+1).map(d=>this.getBlockHashByNumber((0,e.IntNumber)(d))))).filter(d=>!!d),b=(0,e.IntNumber)(i+m.length);return console.info(`Moving cursor position for filter (${o}) from ${i} to ${b}`),this.cursors.set(o,b),Object.assign(Object.assign({},t),{result:m})}async getPendingTransactionFilterChanges(o){return Promise.resolve(l())}async setInitialCursorPosition(o,i){const p=await this.getCurrentBlockHeight(),m=typeof i=="number"&&i>p?i:p;return this.cursors.set(o,m),m}setFilterTimeout(o){const i=this.timeouts.get(o);i&&window.clearTimeout(i);const p=window.setTimeout(()=>{console.info(`Filter (${o}) timed out`),this.deleteFilter(o)},r);this.timeouts.set(o,p)}async getCurrentBlockHeight(){const o=new Date;if(o.getTime()-this.lastFetchTimestamp.getTime()>this.REQUEST_THROTTLE_INTERVAL){this.lastFetchTimestamp=o;const i=await this._getCurrentBlockHeight();this.currentBlockHeight=i,this.resolvers.forEach(p=>p(i)),this.resolvers=[]}return this.currentBlockHeight?this.currentBlockHeight:new Promise(i=>this.resolvers.push(i))}async _getCurrentBlockHeight(){const{result:o}=await this.sendAsyncPromise(Object.assign(Object.assign({},t),{method:"eth_blockNumber",params:[]}));return(0,n.intNumberFromHexString)((0,n.ensureHexString)(o))}async getBlockHashByNumber(o){const i=await this.sendAsyncPromise(Object.assign(Object.assign({},t),{method:"eth_getBlockByNumber",params:[(0,n.hexStringFromIntNumber)(o),!1]}));return i.result&&typeof i.result.hash=="string"?(0,n.ensureHexString)(i.result.hash):null}};Fe.FilterPolyfill=h;function a(s){return{fromBlock:f(s.fromBlock),toBlock:f(s.toBlock),addresses:s.address===void 0?null:Array.isArray(s.address)?s.address:[s.address],topics:s.topics||[]}}Fe.filterFromParam=a;function c(s){const o={fromBlock:u(s.fromBlock),toBlock:u(s.toBlock),topics:s.topics};return s.addresses!==null&&(o.address=s.addresses),o}function f(s){if(s===void 0||s==="latest"||s==="pending")return"latest";if(s==="earliest")return(0,e.IntNumber)(0);if((0,n.isHexString)(s))return(0,n.intNumberFromHexString)(s);throw new Error(`Invalid block option: ${String(s)}`)}function u(s){return s==="latest"?s:(0,n.hexStringFromIntNumber)(s)}function g(){return Object.assign(Object.assign({},t),{error:{code:-32e3,message:"filter not found"}})}function l(){return Object.assign(Object.assign({},t),{result:[]})}return Fe}var Tt={},qe={},je={},Jn,aa;function Ss(){if(aa)return Jn;aa=1,Jn=e;function e(n){n=n||{};var r=n.max||Number.MAX_SAFE_INTEGER,t=typeof n.start<"u"?n.start:Math.floor(Math.random()*r);return function(){return t=t%r,t++}}return Jn}var Gn,ca;function Ql(){if(ca)return Gn;ca=1;const e=(n,r)=>function(){const t=r.promiseModule,h=new Array(arguments.length);for(let a=0;a<arguments.length;a++)h[a]=arguments[a];return new t((a,c)=>{r.errorFirst?h.push(function(f,u){if(r.multiArgs){const g=new Array(arguments.length-1);for(let l=1;l<arguments.length;l++)g[l-1]=arguments[l];f?(g.unshift(f),c(g)):a(g)}else f?c(f):a(u)}):h.push(function(f){if(r.multiArgs){const u=new Array(arguments.length-1);for(let g=0;g<arguments.length;g++)u[g]=arguments[g];a(u)}else a(f)}),n.apply(this,h)})};return Gn=(n,r)=>{r=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},r);const t=a=>{const c=f=>typeof f=="string"?a===f:f.test(a);return r.include?r.include.some(c):!r.exclude.some(c)};let h;typeof n=="function"?h=function(){return r.excludeMain?n.apply(this,arguments):e(n,r).apply(this,arguments)}:h=Object.create(Object.getPrototypeOf(n));for(const a in n){const c=n[a];h[a]=typeof c=="function"&&t(a)?e(c,r):c}return h},Gn}var $e={},sr={},ua;function Cs(){if(ua)return sr;ua=1,Object.defineProperty(sr,"__esModule",{value:!0});const e=fr();function n(h,a,c){try{Reflect.apply(h,a,c)}catch(f){setTimeout(()=>{throw f})}}function r(h){const a=h.length,c=new Array(a);for(let f=0;f<a;f+=1)c[f]=h[f];return c}class t extends e.EventEmitter{emit(a,...c){let f=a==="error";const u=this._events;if(u!==void 0)f=f&&u.error===void 0;else if(!f)return!1;if(f){let l;if(c.length>0&&([l]=c),l instanceof Error)throw l;const s=new Error(`Unhandled error.${l?` (${l.message})`:""}`);throw s.context=l,s}const g=u[a];if(g===void 0)return!1;if(typeof g=="function")n(g,this,c);else{const l=g.length,s=r(g);for(let o=0;o<l;o+=1)n(s[o],this,c)}return!0}}return sr.default=t,sr}var la;function Mu(){if(la)return $e;la=1;var e=$e&&$e.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty($e,"__esModule",{value:!0}),$e.BaseBlockTracker=void 0;const n=e(Cs()),r=1e3,t=(f,u)=>f+u,h=["sync","latest"];let a=class extends n.default{constructor(u){super(),this._blockResetDuration=u.blockResetDuration||20*r,this._usePastBlocks=u.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(g=>this.once("latest",g))}removeAllListeners(u){return u?super.removeAllListeners(u):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(u){h.includes(u)&&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 h.map(u=>this.listenerCount(u)).reduce(t)}_shouldUseNewBlock(u){const g=this._currentBlock;if(!g)return!0;const l=c(u),s=c(g);return this._usePastBlocks&&l<s||l>s}_newPotentialLatest(u){this._shouldUseNewBlock(u)&&this._setCurrentBlock(u)}_setCurrentBlock(u){const g=this._currentBlock;this._currentBlock=u,this.emit("latest",u),this.emit("sync",{oldBlock:g,newBlock:u})}_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}};$e.BaseBlockTracker=a;function c(f){return Number.parseInt(f,16)}return $e}var Zn={},He={},he={};class Lu extends TypeError{constructor(n,r){let t;const{message:h,explanation:a,...c}=n,{path:f}=n,u=f.length===0?h:`At path: ${f.join(".")} -- ${h}`;super(a??u),a!=null&&(this.cause=u),Object.assign(this,c),this.name=this.constructor.name,this.failures=()=>t??(t=[n,...r()])}}function Yl(e){return le(e)&&typeof e[Symbol.iterator]=="function"}function le(e){return typeof e=="object"&&e!=null}function da(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;const n=Object.getPrototypeOf(e);return n===null||n===Object.prototype}function se(e){return typeof e=="symbol"?e.toString():typeof e=="string"?JSON.stringify(e):`${e}`}function Xl(e){const{done:n,value:r}=e.next();return n?void 0:r}function ed(e,n,r,t){if(e===!0)return;e===!1?e={}:typeof e=="string"&&(e={message:e});const{path:h,branch:a}=n,{type:c}=r,{refinement:f,message:u=`Expected a value of type \`${c}\`${f?` with refinement \`${f}\``:""}, but received: \`${se(t)}\``}=e;return{value:t,type:c,refinement:f,key:h[h.length-1],path:h,branch:a,...e,message:u}}function*gs(e,n,r,t){Yl(e)||(e=[e]);for(const h of e){const a=ed(h,n,r,t);a&&(yield a)}}function*ks(e,n,r={}){const{path:t=[],branch:h=[e],coerce:a=!1,mask:c=!1}=r,f={path:t,branch:h};if(a&&(e=n.coercer(e,f),c&&n.type!=="type"&&le(n.schema)&&le(e)&&!Array.isArray(e)))for(const g in e)n.schema[g]===void 0&&delete e[g];let u="valid";for(const g of n.validator(e,f))g.explanation=r.message,u="not_valid",yield[g,void 0];for(let[g,l,s]of n.entries(e,f)){const o=ks(l,s,{path:g===void 0?t:[...t,g],branch:g===void 0?h:[...h,l],coerce:a,mask:c,message:r.message});for(const i of o)i[0]?(u=i[0].refinement!=null?"not_refined":"not_valid",yield[i[0],void 0]):a&&(l=i[1],g===void 0?e=l:e instanceof Map?e.set(g,l):e instanceof Set?e.add(l):le(e)&&(l!==void 0||g in e)&&(e[g]=l))}if(u!=="not_valid")for(const g of n.refiner(e,f))g.explanation=r.message,u="not_refined",yield[g,void 0];u==="valid"&&(yield[void 0,e])}class ie{constructor(n){const{type:r,schema:t,validator:h,refiner:a,coercer:c=u=>u,entries:f=function*(){}}=n;this.type=r,this.schema=t,this.entries=f,this.coercer=c,h?this.validator=(u,g)=>{const l=h(u,g);return gs(l,g,this,u)}:this.validator=()=>[],a?this.refiner=(u,g)=>{const l=a(u,g);return gs(l,g,this,u)}:this.refiner=()=>[]}assert(n,r){return Tu(n,this,r)}create(n,r){return Nu(n,this,r)}is(n){return Is(n,this)}mask(n,r){return Pu(n,this,r)}validate(n,r={}){return nt(n,this,r)}}function Tu(e,n,r){const t=nt(e,n,{message:r});if(t[0])throw t[0]}function Nu(e,n,r){const t=nt(e,n,{coerce:!0,message:r});if(t[0])throw t[0];return t[1]}function Pu(e,n,r){const t=nt(e,n,{coerce:!0,mask:!0,message:r});if(t[0])throw t[0];return t[1]}function Is(e,n){return!nt(e,n)[0]}function nt(e,n,r={}){const t=ks(e,n,r),h=Xl(t);return h[0]?[new Lu(h[0],function*(){for(const c of t)c[0]&&(yield c[0])}),void 0]:[void 0,h[1]]}function td(...e){const n=e[0].type==="type",r=e.map(h=>h.schema),t=Object.assign({},...r);return n?zt(t):Vt(t)}function ue(e,n){return new ie({type:e,schema:null,validator:n})}function rd(e,n){return new ie({...e,refiner:(r,t)=>r===void 0||e.refiner(r,t),validator(r,t){return r===void 0?!0:(n(r,t),e.validator(r,t))}})}function nd(e){return new ie({type:"dynamic",schema:null,*entries(n,r){yield*e(n,r).entries(n,r)},validator(n,r){return e(n,r).validator(n,r)},coercer(n,r){return e(n,r).coercer(n,r)},refiner(n,r){return e(n,r).refiner(n,r)}})}function id(e){let n;return new ie({type:"lazy",schema:null,*entries(r,t){n??(n=e()),yield*n.entries(r,t)},validator(r,t){return n??(n=e()),n.validator(r,t)},coercer(r,t){return n??(n=e()),n.coercer(r,t)},refiner(r,t){return n??(n=e()),n.refiner(r,t)}})}function sd(e,n){const{schema:r}=e,t={...r};for(const h of n)delete t[h];switch(e.type){case"type":return zt(t);default:return Vt(t)}}function od(e){const n=e instanceof ie,r=n?{...e.schema}:{...e};for(const t in r)r[t]=Ou(r[t]);return n&&e.type==="type"?zt(r):Vt(r)}function ad(e,n){const{schema:r}=e,t={};for(const h of n)t[h]=r[h];switch(e.type){case"type":return zt(t);default:return Vt(t)}}function cd(e,n){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),ue(e,n)}function ud(){return ue("any",()=>!0)}function ld(e){return new ie({type:"array",schema:e,*entries(n){if(e&&Array.isArray(n))for(const[r,t]of n.entries())yield[r,t,e]},coercer(n){return Array.isArray(n)?n.slice():n},validator(n){return Array.isArray(n)||`Expected an array value, but received: ${se(n)}`}})}function dd(){return ue("bigint",e=>typeof e=="bigint")}function hd(){return ue("boolean",e=>typeof e=="boolean")}function fd(){return ue("date",e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${se(e)}`)}function gd(e){const n={},r=e.map(t=>se(t)).join();for(const t of e)n[t]=t;return new ie({type:"enums",schema:n,validator(t){return e.includes(t)||`Expected one of \`${r}\`, but received: ${se(t)}`}})}function pd(){return ue("func",e=>typeof e=="function"||`Expected a function, but received: ${se(e)}`)}function md(e){return ue("instance",n=>n instanceof e||`Expected a \`${e.name}\` instance, but received: ${se(n)}`)}function bd(){return ue("integer",e=>typeof e=="number"&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${se(e)}`)}function yd(e){return new ie({type:"intersection",schema:null,*entries(n,r){for(const t of e)yield*t.entries(n,r)},*validator(n,r){for(const t of e)yield*t.validator(n,r)},*refiner(n,r){for(const t of e)yield*t.refiner(n,r)}})}function wd(e){const n=se(e),r=typeof e;return new ie({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?e:null,validator(t){return t===e||`Expected the literal \`${n}\`, but received: ${se(t)}`}})}function vd(e,n){return new ie({type:"map",schema:null,*entries(r){if(e&&n&&r instanceof Map)for(const[t,h]of r.entries())yield[t,t,e],yield[t,h,n]},coercer(r){return r instanceof Map?new Map(r):r},validator(r){return r instanceof Map||`Expected a \`Map\` object, but received: ${se(r)}`}})}function As(){return ue("never",()=>!1)}function _d(e){return new ie({...e,validator:(n,r)=>n===null||e.validator(n,r),refiner:(n,r)=>n===null||e.refiner(n,r)})}function Ed(){return ue("number",e=>typeof e=="number"&&!isNaN(e)||`Expected a number, but received: ${se(e)}`)}function Vt(e){const n=e?Object.keys(e):[],r=As();return new ie({type:"object",schema:e||null,*entries(t){if(e&&le(t)){const h=new Set(Object.keys(t));for(const a of n)h.delete(a),yield[a,t[a],e[a]];for(const a of h)yield[a,t[a],r]}},validator(t){return le(t)||`Expected an object, but received: ${se(t)}`},coercer(t){return le(t)?{...t}:t}})}function Ou(e){return new ie({...e,validator:(n,r)=>n===void 0||e.validator(n,r),refiner:(n,r)=>n===void 0||e.refiner(n,r)})}function Rd(e,n){return new ie({type:"record",schema:null,*entries(r){if(le(r))for(const t in r){const h=r[t];yield[t,t,e],yield[t,h,n]}},validator(r){return le(r)||`Expected an object, but received: ${se(r)}`}})}function Sd(){return ue("regexp",e=>e instanceof RegExp)}function Cd(e){return new ie({type:"set",schema:null,*entries(n){if(e&&n instanceof Set)for(const r of n)yield[r,r,e]},coercer(n){return n instanceof Set?new Set(n):n},validator(n){return n instanceof Set||`Expected a \`Set\` object, but received: ${se(n)}`}})}function xu(){return ue("string",e=>typeof e=="string"||`Expected a string, but received: ${se(e)}`)}function kd(e){const n=As();return new ie({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const t=Math.max(e.length,r.length);for(let h=0;h<t;h++)yield[h,r[h],e[h]||n]}},validator(r){return Array.isArray(r)||`Expected an array, but received: ${se(r)}`}})}function zt(e){const n=Object.keys(e);return new ie({type:"type",schema:e,*entries(r){if(le(r))for(const t of n)yield[t,r[t],e[t]]},validator(r){return le(r)||`Expected an object, but received: ${se(r)}`},coercer(r){return le(r)?{...r}:r}})}function Id(e){const n=e.map(r=>r.type).join(" | ");return new ie({type:"union",schema:null,coercer(r){for(const t of e){const[h,a]=t.validate(r,{coerce:!0});if(!h)return a}return r},validator(r,t){const h=[];for(const a of e){const[...c]=ks(r,a,t),[f]=c;if(f[0])for(const[u]of c)u&&h.push(u);else return[]}return[`Expected the value to satisfy a union of \`${n}\`, but received: ${se(r)}`,...h]}})}function Bu(){return ue("unknown",()=>!0)}function Ms(e,n,r){return new ie({...e,coercer:(t,h)=>Is(t,n)?e.coercer(r(t,h),h):e.coercer(t,h)})}function Ad(e,n,r={}){return Ms(e,Bu(),t=>{const h=typeof n=="function"?n():n;if(t===void 0)return h;if(!r.strict&&da(t)&&da(h)){const a={...t};let c=!1;for(const f in h)a[f]===void 0&&(a[f]=h[f],c=!0);if(c)return a}return t})}function Md(e){return Ms(e,xu(),n=>n.trim())}function Ld(e){return Ze(e,"empty",n=>{const r=Du(n);return r===0||`Expected an empty ${e.type} but received one with a size of \`${r}\``})}function Du(e){return e instanceof Map||e instanceof Set?e.size:e.length}function Td(e,n,r={}){const{exclusive:t}=r;return Ze(e,"max",h=>t?h<n:h<=n||`Expected a ${e.type} less than ${t?"":"or equal to "}${n} but received \`${h}\``)}function Nd(e,n,r={}){const{exclusive:t}=r;return Ze(e,"min",h=>t?h>n:h>=n||`Expected a ${e.type} greater than ${t?"":"or equal to "}${n} but received \`${h}\``)}function Pd(e){return Ze(e,"nonempty",n=>Du(n)>0||`Expected a nonempty ${e.type} but received an empty one`)}function Od(e,n){return Ze(e,"pattern",r=>n.test(r)||`Expected a ${e.type} matching \`/${n.source}/\` but received "${r}"`)}function xd(e,n,r=n){const t=`Expected a ${e.type}`,h=n===r?`of \`${n}\``:`between \`${n}\` and \`${r}\``;return Ze(e,"size",a=>{if(typeof a=="number"||a instanceof Date)return n<=a&&a<=r||`${t} ${h} but received \`${a}\``;if(a instanceof Map||a instanceof Set){const{size:c}=a;return n<=c&&c<=r||`${t} with a size ${h} but received one with a size of \`${c}\``}else{const{length:c}=a;return n<=c&&c<=r||`${t} with a length ${h} but received one with a length of \`${c}\``}})}function Ze(e,n,r){return new ie({...e,*refiner(t,h){yield*e.refiner(t,h);const a=r(t,h),c=gs(a,h,e,t);for(const f of c)yield{...f,refinement:n}}})}const Bd=Object.freeze(Object.defineProperty({__proto__:null,Struct:ie,StructError:Lu,any:ud,array:ld,assert:Tu,assign:td,bigint:dd,boolean:hd,coerce:Ms,create:Nu,date:fd,defaulted:Ad,define:ue,deprecated:rd,dynamic:nd,empty:Ld,enums:gd,func:pd,instance:md,integer:bd,intersection:yd,is:Is,lazy:id,literal:wd,map:vd,mask:Pu,max:Td,min:Nd,never:As,nonempty:Pd,nullable:_d,number:Ed,object:Vt,omit:sd,optional:Ou,partial:od,pattern:Od,pick:ad,record:Rd,refine:Ze,regexp:Sd,set:Cd,size:xd,string:xu,struct:cd,trimmed:Md,tuple:kd,type:zt,union:Id,unknown:Bu,validate:nt},Symbol.toStringTag,{value:"Module"})),Ke=Ht(Bd);var ha;function ke(){if(ha)return he;ha=1,Object.defineProperty(he,"__esModule",{value:!0}),he.assertExhaustive=he.assertStruct=he.assert=he.AssertionError=void 0;const e=Ke;function n(g){return typeof g=="object"&&g!==null&&"message"in g}function r(g){var l,s;return typeof((s=(l=g==null?void 0:g.prototype)===null||l===void 0?void 0:l.constructor)===null||s===void 0?void 0:s.name)=="string"}function t(g){const l=n(g)?g.message:String(g);return l.endsWith(".")?l.slice(0,-1):l}function h(g,l){return r(g)?new g({message:l}):g({message:l})}class a extends Error{constructor(l){super(l.message),this.code="ERR_ASSERTION"}}he.AssertionError=a;function c(g,l="Assertion failed.",s=a){if(!g)throw l instanceof Error?l:h(s,l)}he.assert=c;function f(g,l,s="Assertion failed",o=a){try{(0,e.assert)(g,l)}catch(i){throw h(o,`${s}: ${t(i)}.`)}}he.assertStruct=f;function u(g){throw new Error("Invalid branch reached. Should be detected during compilation.")}return he.assertExhaustive=u,he}var Nt={},fa;function Fu(){if(fa)return Nt;fa=1,Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.base64=void 0;const e=Ke,n=ke(),r=(t,h={})=>{var a,c;const f=(a=h.paddingRequired)!==null&&a!==void 0?a:!1,u=(c=h.characterSet)!==null&&c!==void 0?c:"base64";let g;u==="base64"?g=String.raw`[A-Za-z0-9+\/]`:((0,n.assert)(u==="base64url"),g=String.raw`[-_A-Za-z0-9]`);let l;return f?l=new RegExp(`^(?:${g}{4})*(?:${g}{3}=|${g}{2}==)?$`,"u"):l=new RegExp(`^(?:${g}{4})*(?:${g}{2,3}|${g}{3}=|${g}{2}==)?$`,"u"),(0,e.pattern)(t,l)};return Nt.base64=r,Nt}var ee={},Kn={},ga;function yr(){return ga||(ga=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.remove0x=e.add0x=e.assertIsStrictHexString=e.assertIsHexString=e.isStrictHexString=e.isHexString=e.StrictHexStruct=e.HexStruct=void 0;const n=Ke,r=ke();e.HexStruct=(0,n.pattern)((0,n.string)(),/^(?:0x)?[0-9a-f]+$/iu),e.StrictHexStruct=(0,n.pattern)((0,n.string)(),/^0x[0-9a-f]+$/iu);function t(g){return(0,n.is)(g,e.HexStruct)}e.isHexString=t;function h(g){return(0,n.is)(g,e.StrictHexStruct)}e.isStrictHexString=h;function a(g){(0,r.assert)(t(g),"Value must be a hexadecimal string.")}e.assertIsHexString=a;function c(g){(0,r.assert)(h(g),'Value must be a hexadecimal string, starting with "0x".')}e.assertIsStrictHexString=c;function f(g){return g.startsWith("0x")?g:g.startsWith("0X")?`0x${g.substring(2)}`:`0x${g}`}e.add0x=f;function u(g){return g.startsWith("0x")||g.startsWith("0X")?g.substring(2):g}e.remove0x=u})(Kn)),Kn}var pa;function qu(){if(pa)return ee;pa=1,Object.defineProperty(ee,"__esModule",{value:!0}),ee.createDataView=ee.concatBytes=ee.valueToBytes=ee.stringToBytes=ee.numberToBytes=ee.signedBigIntToBytes=ee.bigIntToBytes=ee.hexToBytes=ee.bytesToString=ee.bytesToNumber=ee.bytesToSignedBigInt=ee.bytesToBigInt=ee.bytesToHex=ee.assertIsBytes=ee.isBytes=void 0;const e=ke(),n=yr(),r=48,t=58,h=87;function a(){const S=[];return()=>{if(S.length===0)for(let I=0;I<256;I++)S.push(I.toString(16).padStart(2,"0"));return S}}const c=a();function f(S){return S instanceof Uint8Array}ee.isBytes=f;function u(S){(0,e.assert)(f(S),"Value must be a Uint8Array.")}ee.assertIsBytes=u;function g(S){if(u(S),S.length===0)return"0x";const I=c(),P=new Array(S.length);for(let B=0;B<S.length;B++)P[B]=I[S[B]];return(0,n.add0x)(P.join(""))}ee.bytesToHex=g;function l(S){u(S);const I=g(S);return BigInt(I)}ee.bytesToBigInt=l;function s(S){u(S);let I=BigInt(0);for(const P of S)I=(I<<BigInt(8))+BigInt(P);return BigInt.asIntN(S.length*8,I)}ee.bytesToSignedBigInt=s;function o(S){u(S);const I=l(S);return(0,e.assert)(I<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(I)}ee.bytesToNumber=o;function i(S){return u(S),new TextDecoder().decode(S)}ee.bytesToString=i;function p(S){var I;if(((I=S==null?void 0:S.toLowerCase)===null||I===void 0?void 0:I.call(S))==="0x")return new Uint8Array;(0,n.assertIsHexString)(S);const P=(0,n.remove0x)(S).toLowerCase(),B=P.length%2===0?P:`0${P}`,$=new Uint8Array(B.length/2);for(let z=0;z<$.length;z++){const X=B.charCodeAt(z*2),Y=B.charCodeAt(z*2+1),J=X-(X<t?r:h),M=Y-(Y<t?r:h);$[z]=J*16+M}return $}ee.hexToBytes=p;function m(S){(0,e.assert)(typeof S=="bigint","Value must be a bigint."),(0,e.assert)(S>=BigInt(0),"Value must be a non-negative bigint.");const I=S.toString(16);return p(I)}ee.bigIntToBytes=m;function b(S,I){(0,e.assert)(I>0);const P=S>>BigInt(31);return!((~S&P)+(S&~P)>>BigInt(I*8+-1))}function d(S,I){(0,e.assert)(typeof S=="bigint","Value must be a bigint."),(0,e.assert)(typeof I=="number","Byte length must be a number."),(0,e.assert)(I>0,"Byte length must be greater than 0."),(0,e.assert)(b(S,I),"Byte length is too small to represent the given value.");let P=S;const B=new Uint8Array(I);for(let $=0;$<B.length;$++)B[$]=Number(BigInt.asUintN(8,P)),P>>=BigInt(8);return B.reverse()}ee.signedBigIntToBytes=d;function y(S){(0,e.assert)(typeof S=="number","Value must be a number."),(0,e.assert)(S>=0,"Value must be a non-negative number."),(0,e.assert)(Number.isSafeInteger(S),"Value is not a safe integer. Use `bigIntToBytes` instead.");const I=S.toString(16);return p(I)}ee.numberToBytes=y;function w(S){return(0,e.assert)(typeof S=="string","Value must be a string."),new TextEncoder().encode(S)}ee.stringToBytes=w;function v(S){if(typeof S=="bigint")return m(S);if(typeof S=="number")return y(S);if(typeof S=="string")return S.startsWith("0x")?p(S):w(S);if(f(S))return S;throw new TypeError(`Unsupported value type: "${typeof S}".`)}ee.valueToBytes=v;function _(S){const I=new Array(S.length);let P=0;for(let $=0;$<S.length;$++){const z=v(S[$]);I[$]=z,P+=z.length}const B=new Uint8Array(P);for(let $=0,z=0;$<I.length;$++)B.set(I[$],z),z+=I[$].length;return B}ee.concatBytes=_;function C(S){if(typeof K<"u"&&S instanceof K){const I=S.buffer.slice(S.byteOffset,S.byteOffset+S.byteLength);return new DataView(I)}return new DataView(S.buffer,S.byteOffset,S.byteLength)}return ee.createDataView=C,ee}var Pt={},ma;function Dd(){if(ma)return Pt;ma=1,Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.ChecksumStruct=void 0;const e=Ke,n=Fu();return Pt.ChecksumStruct=(0,e.size)((0,n.base64)((0,e.string)(),{paddingRequired:!0}),44,44),Pt}var fe={},ba;function Fd(){if(ba)return fe;ba=1,Object.defineProperty(fe,"__esModule",{value:!0}),fe.createHex=fe.createBytes=fe.createBigInt=fe.createNumber=void 0;const e=Ke,n=ke(),r=qu(),t=yr(),h=(0,e.union)([(0,e.number)(),(0,e.bigint)(),(0,e.string)(),t.StrictHexStruct]),a=(0,e.coerce)((0,e.number)(),h,Number),c=(0,e.coerce)((0,e.bigint)(),h,BigInt);(0,e.union)([t.StrictHexStruct,(0,e.instance)(Uint8Array)]);const f=(0,e.coerce)((0,e.instance)(Uint8Array),(0,e.union)([t.StrictHexStruct]),r.hexToBytes),u=(0,e.coerce)(t.StrictHexStruct,(0,e.instance)(Uint8Array),r.bytesToHex);function g(i){try{const p=(0,e.create)(i,a);return(0,n.assert)(Number.isFinite(p),`Expected a number-like value, got "${i}".`),p}catch(p){throw p instanceof e.StructError?new Error(`Expected a number-like value, got "${i}".`):p}}fe.createNumber=g;function l(i){try{return(0,e.create)(i,c)}catch(p){throw p instanceof e.StructError?new Error(`Expected a number-like value, got "${String(p.value)}".`):p}}fe.createBigInt=l;function s(i){if(typeof i=="string"&&i.toLowerCase()==="0x")return new Uint8Array;try{return(0,e.create)(i,f)}catch(p){throw p instanceof e.StructError?new Error(`Expected a bytes-like value, got "${String(p.value)}".`):p}}fe.createBytes=s;function o(i){if(i instanceof Uint8Array&&i.length===0||typeof i=="string"&&i.toLowerCase()==="0x")return"0x";try{return(0,e.create)(i,u)}catch(p){throw p instanceof e.StructError?new Error(`Expected a bytes-like value, got "${String(p.value)}".`):p}}return fe.createHex=o,fe}var ge={},ya;function qd(){if(ya)return ge;ya=1;var e=ge&&ge.__classPrivateFieldSet||function(c,f,u,g,l){if(g==="m")throw new TypeError("Private method is not writable");if(g==="a"&&!l)throw new TypeError("Private accessor was defined without a setter");if(typeof f=="function"?c!==f||!l:!f.has(c))throw new TypeError("Cannot write private member to an object whose class did not declare it");return g==="a"?l.call(c,u):l?l.value=u:f.set(c,u),u},n=ge&&ge.__classPrivateFieldGet||function(c,f,u,g){if(u==="a"&&!g)throw new TypeError("Private accessor was defined without a getter");if(typeof f=="function"?c!==f||!g:!f.has(c))throw new TypeError("Cannot read private member from an object whose class did not declare it");return u==="m"?g:u==="a"?g.call(c):g?g.value:f.get(c)},r,t;Object.defineProperty(ge,"__esModule",{value:!0}),ge.FrozenSet=ge.FrozenMap=void 0;class h{constructor(f){r.set(this,void 0),e(this,r,new Map(f),"f"),Object.freeze(this)}get size(){return n(this,r,"f").size}[(r=new WeakMap,Symbol.iterator)](){return n(this,r,"f")[Symbol.iterator]()}entries(){return n(this,r,"f").entries()}forEach(f,u){return n(this,r,"f").forEach((g,l,s)=>f.call(u,g,l,this))}get(f){return n(this,r,"f").get(f)}has(f){return n(this,r,"f").has(f)}keys(){return n(this,r,"f").keys()}values(){return n(this,r,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([f,u])=>`${String(f)} => ${String(u)}`).join(", ")} `:""}}`}}ge.FrozenMap=h;class a{constructor(f){t.set(this,void 0),e(this,t,new Set(f),"f"),Object.freeze(this)}get size(){return n(this,t,"f").size}[(t=new WeakMap,Symbol.iterator)](){return n(this,t,"f")[Symbol.iterator]()}entries(){return n(this,t,"f").entries()}forEach(f,u){return n(this,t,"f").forEach((g,l,s)=>f.call(u,g,l,this))}has(f){return n(this,t,"f").has(f)}keys(){return n(this,t,"f").keys()}values(){return n(this,t,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(f=>String(f)).join(", ")} `:""}}`}}return ge.FrozenSet=a,Object.freeze(h),Object.freeze(h.prototype),Object.freeze(a),Object.freeze(a.prototype),ge}var Qn={},wa;function jd(){return wa||(wa=1,Object.defineProperty(Qn,"__esModule",{value:!0})),Qn}var Yn={},va;function $d(){return va||(va=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getJsonRpcIdValidator=e.assertIsJsonRpcError=e.isJsonRpcError=e.assertIsJsonRpcFailure=e.isJsonRpcFailure=e.assertIsJsonRpcSuccess=e.isJsonRpcSuccess=e.assertIsJsonRpcResponse=e.isJsonRpcResponse=e.assertIsPendingJsonRpcResponse=e.isPendingJsonRpcResponse=e.JsonRpcResponseStruct=e.JsonRpcFailureStruct=e.JsonRpcSuccessStruct=e.PendingJsonRpcResponseStruct=e.assertIsJsonRpcRequest=e.isJsonRpcRequest=e.assertIsJsonRpcNotification=e.isJsonRpcNotification=e.JsonRpcNotificationStruct=e.JsonRpcRequestStruct=e.JsonRpcParamsStruct=e.JsonRpcErrorStruct=e.JsonRpcIdStruct=e.JsonRpcVersionStruct=e.jsonrpc2=e.getJsonSize=e.isValidJson=e.JsonStruct=e.UnsafeJsonStruct=void 0;const n=Ke,r=ke(),t=()=>(0,n.define)("finite number",_=>(0,n.is)(_,(0,n.number)())&&Number.isFinite(_));e.UnsafeJsonStruct=(0,n.union)([(0,n.literal)(null),(0,n.boolean)(),t(),(0,n.string)(),(0,n.array)((0,n.lazy)(()=>e.UnsafeJsonStruct)),(0,n.record)((0,n.string)(),(0,n.lazy)(()=>e.UnsafeJsonStruct))]),e.JsonStruct=(0,n.define)("Json",(_,C)=>{function S(I,P){const $=[...P.validator(I,C)];return $.length>0?$:!0}try{const I=S(_,e.UnsafeJsonStruct);return I!==!0?I:S(JSON.parse(JSON.stringify(_)),e.UnsafeJsonStruct)}catch(I){return I instanceof RangeError?"Circular reference detected":!1}});function h(_){return(0,n.is)(_,e.JsonStruct)}e.isValidJson=h;function a(_){(0,r.assertStruct)(_,e.JsonStruct,"Invalid JSON value");const C=JSON.stringify(_);return new TextEncoder().encode(C).byteLength}e.getJsonSize=a,e.jsonrpc2="2.0",e.JsonRpcVersionStruct=(0,n.literal)(e.jsonrpc2),e.JsonRpcIdStruct=(0,n.nullable)((0,n.union)([(0,n.number)(),(0,n.string)()])),e.JsonRpcErrorStruct=(0,n.object)({code:(0,n.integer)(),message:(0,n.string)(),data:(0,n.optional)(e.JsonStruct),stack:(0,n.optional)((0,n.string)())}),e.JsonRpcParamsStruct=(0,n.optional)((0,n.union)([(0,n.record)((0,n.string)(),e.JsonStruct),(0,n.array)(e.JsonStruct)])),e.JsonRpcRequestStruct=(0,n.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,method:(0,n.string)(),params:e.JsonRpcParamsStruct}),e.JsonRpcNotificationStruct=(0,n.omit)(e.JsonRpcRequestStruct,["id"]);function c(_){return(0,n.is)(_,e.JsonRpcNotificationStruct)}e.isJsonRpcNotification=c;function f(_,C){(0,r.assertStruct)(_,e.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",C)}e.assertIsJsonRpcNotification=f;function u(_){return(0,n.is)(_,e.JsonRpcRequestStruct)}e.isJsonRpcRequest=u;function g(_,C){(0,r.assertStruct)(_,e.JsonRpcRequestStruct,"Invalid JSON-RPC request",C)}e.assertIsJsonRpcRequest=g,e.PendingJsonRpcResponseStruct=(0,n.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:(0,n.optional)((0,n.unknown)()),error:(0,n.optional)(e.JsonRpcErrorStruct)}),e.JsonRpcSuccessStruct=(0,n.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:e.JsonStruct}),e.JsonRpcFailureStruct=(0,n.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,error:e.JsonRpcErrorStruct}),e.JsonRpcResponseStruct=(0,n.union)([e.JsonRpcSuccessStruct,e.JsonRpcFailureStruct]);function l(_){return(0,n.is)(_,e.PendingJsonRpcResponseStruct)}e.isPendingJsonRpcResponse=l;function s(_,C){(0,r.assertStruct)(_,e.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",C)}e.assertIsPendingJsonRpcResponse=s;function o(_){return(0,n.is)(_,e.JsonRpcResponseStruct)}e.isJsonRpcResponse=o;function i(_,C){(0,r.assertStruct)(_,e.JsonRpcResponseStruct,"Invalid JSON-RPC response",C)}e.assertIsJsonRpcResponse=i;function p(_){return(0,n.is)(_,e.JsonRpcSuccessStruct)}e.isJsonRpcSuccess=p;function m(_,C){(0,r.assertStruct)(_,e.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",C)}e.assertIsJsonRpcSuccess=m;function b(_){return(0,n.is)(_,e.JsonRpcFailureStruct)}e.isJsonRpcFailure=b;function d(_,C){(0,r.assertStruct)(_,e.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",C)}e.assertIsJsonRpcFailure=d;function y(_){return(0,n.is)(_,e.JsonRpcErrorStruct)}e.isJsonRpcError=y;function w(_,C){(0,r.assertStruct)(_,e.JsonRpcErrorStruct,"Invalid JSON-RPC error",C)}e.assertIsJsonRpcError=w;function v(_){const{permitEmptyString:C,permitFractions:S,permitNull:I}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},_);return B=>!!(typeof B=="number"&&(S||Number.isInteger(B))||typeof B=="string"&&(C||B.length>0)||I&&B===null)}e.getJsonRpcIdValidator=v})(Yn)),Yn}var Xn={},_a;function Hd(){return _a||(_a=1,Object.defineProperty(Xn,"__esModule",{value:!0})),Xn}var Ee={},or={exports:{}},ei,Ea;function Ud(){if(Ea)return ei;Ea=1;var e=1e3,n=e*60,r=n*60,t=r*24,h=t*7,a=t*365.25;ei=function(l,s){s=s||{};var o=typeof l;if(o==="string"&&l.length>0)return c(l);if(o==="number"&&isFinite(l))return s.long?u(l):f(l);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(l))};function c(l){if(l=String(l),!(l.length>100)){var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(l);if(s){var o=parseFloat(s[1]),i=(s[2]||"ms").toLowerCase();switch(i){case"years":case"year":case"yrs":case"yr":case"y":return o*a;case"weeks":case"week":case"w":return o*h;case"days":case"day":case"d":return o*t;case"hours":case"hour":case"hrs":case"hr":case"h":return o*r;case"minutes":case"minute":case"mins":case"min":case"m":return o*n;case"seconds":case"second":case"secs":case"sec":case"s":return o*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}}}function f(l){var s=Math.abs(l);return s>=t?Math.round(l/t)+"d":s>=r?Math.round(l/r)+"h":s>=n?Math.round(l/n)+"m":s>=e?Math.round(l/e)+"s":l+"ms"}function u(l){var s=Math.abs(l);return s>=t?g(l,s,t,"day"):s>=r?g(l,s,r,"hour"):s>=n?g(l,s,n,"minute"):s>=e?g(l,s,e,"second"):l+" ms"}function g(l,s,o,i){var p=s>=o*1.5;return Math.round(l/o)+" "+i+(p?"s":"")}return ei}var ti,Ra;function Wd(){if(Ra)return ti;Ra=1;function e(n){t.debug=t,t.default=t,t.coerce=g,t.disable=f,t.enable=a,t.enabled=u,t.humanize=Ud(),t.destroy=l,Object.keys(n).forEach(s=>{t[s]=n[s]}),t.names=[],t.skips=[],t.formatters={};function r(s){let o=0;for(let i=0;i<s.length;i++)o=(o<<5)-o+s.charCodeAt(i),o|=0;return t.colors[Math.abs(o)%t.colors.length]}t.selectColor=r;function t(s){let o,i=null,p,m;function b(...d){if(!b.enabled)return;const y=b,w=Number(new Date),v=w-(o||w);y.diff=v,y.prev=o,y.curr=w,o=w,d[0]=t.coerce(d[0]),typeof d[0]!="string"&&d.unshift("%O");let _=0;d[0]=d[0].replace(/%([a-zA-Z%])/g,(S,I)=>{if(S==="%%")return"%";_++;const P=t.formatters[I];if(typeof P=="function"){const B=d[_];S=P.call(y,B),d.splice(_,1),_--}return S}),t.formatArgs.call(y,d),(y.log||t.log).apply(y,d)}return b.namespace=s,b.useColors=t.useColors(),b.color=t.selectColor(s),b.extend=h,b.destroy=t.destroy,Object.defineProperty(b,"enabled",{enumerable:!0,configurable:!1,get:()=>i!==null?i:(p!==t.namespaces&&(p=t.namespaces,m=t.enabled(s)),m),set:d=>{i=d}}),typeof t.init=="function"&&t.init(b),b}function h(s,o){const i=t(this.namespace+(typeof o>"u"?":":o)+s);return i.log=this.log,i}function a(s){t.save(s),t.namespaces=s,t.names=[],t.skips=[];const o=(typeof s=="string"?s:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const i of o)i[0]==="-"?t.skips.push(i.slice(1)):t.names.push(i)}function c(s,o){let i=0,p=0,m=-1,b=0;for(;i<s.length;)if(p<o.length&&(o[p]===s[i]||o[p]==="*"))o[p]==="*"?(m=p,b=i,p++):(i++,p++);else if(m!==-1)p=m+1,b++,i=b;else return!1;for(;p<o.length&&o[p]==="*";)p++;return p===o.length}function f(){const s=[...t.names,...t.skips.map(o=>"-"+o)].join(",");return t.enable(""),s}function u(s){for(const o of t.skips)if(c(s,o))return!1;for(const o of t.names)if(c(s,o))return!0;return!1}function g(s){return s instanceof Error?s.stack||s.message:s}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return t.enable(t.load()),t}return ti=e,ti}var Sa;function Vd(){return Sa||(Sa=1,(function(e,n){var r={};n.formatArgs=h,n.save=a,n.load=c,n.useColors=t,n.storage=f(),n.destroy=(()=>{let g=!1;return()=>{g||(g=!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`."))}})(),n.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"];function t(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let g;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(g=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(g[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function h(g){if(g[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+g[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const l="color: "+this.color;g.splice(1,0,l,"color: inherit");let s=0,o=0;g[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(s++,i==="%c"&&(o=s))}),g.splice(o,0,l)}n.log=console.debug||console.log||(()=>{});function a(g){try{g?n.storage.setItem("debug",g):n.storage.removeItem("debug")}catch{}}function c(){let g;try{g=n.storage.getItem("debug")||n.storage.getItem("DEBUG")}catch{}return!g&&typeof te<"u"&&"env"in te&&(g=r.DEBUG),g}function f(){try{return localStorage}catch{}}e.exports=Wd()(n);const{formatters:u}=e.exports;u.j=function(g){try{return JSON.stringify(g)}catch(l){return"[UnexpectedJSONParseError]: "+l.message}}})(or,or.exports)),or.exports}var Ca;function zd(){if(Ca)return Ee;Ca=1;var e=Ee&&Ee.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.createModuleLogger=Ee.createProjectLogger=void 0;const r=(0,e(Vd()).default)("metamask");function t(a){return r.extend(a)}Ee.createProjectLogger=t;function h(a,c){return a.extend(c)}return Ee.createModuleLogger=h,Ee}var ri={},ka;function Jd(){return ka||(ka=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.calculateNumberSize=e.calculateStringSize=e.isASCII=e.isPlainObject=e.ESCAPE_CHARACTERS_REGEXP=e.JsonSize=e.hasProperty=e.isObject=e.isNullOrUndefined=e.isNonEmptyArray=void 0;function n(g){return Array.isArray(g)&&g.length>0}e.isNonEmptyArray=n;function r(g){return g==null}e.isNullOrUndefined=r;function t(g){return!!g&&typeof g=="object"&&!Array.isArray(g)}e.isObject=t;const h=(g,l)=>Object.hasOwnProperty.call(g,l);e.hasProperty=h,(function(g){g[g.Null=4]="Null",g[g.Comma=1]="Comma",g[g.Wrapper=1]="Wrapper",g[g.True=4]="True",g[g.False=5]="False",g[g.Quote=1]="Quote",g[g.Colon=1]="Colon",g[g.Date=24]="Date"})(e.JsonSize||(e.JsonSize={})),e.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function a(g){if(typeof g!="object"||g===null)return!1;try{let l=g;for(;Object.getPrototypeOf(l)!==null;)l=Object.getPrototypeOf(l);return Object.getPrototypeOf(g)===l}catch{return!1}}e.isPlainObject=a;function c(g){return g.charCodeAt(0)<=127}e.isASCII=c;function f(g){var l;return g.split("").reduce((o,i)=>c(i)?o+1:o+2,0)+((l=g.match(e.ESCAPE_CHARACTERS_REGEXP))!==null&&l!==void 0?l:[]).length}e.calculateStringSize=f;function u(g){return g.toString().length}e.calculateNumberSize=u})(ri)),ri}var pe={},Ia;function Gd(){if(Ia)return pe;Ia=1,Object.defineProperty(pe,"__esModule",{value:!0}),pe.hexToBigInt=pe.hexToNumber=pe.bigIntToHex=pe.numberToHex=void 0;const e=ke(),n=yr(),r=c=>((0,e.assert)(typeof c=="number","Value must be a number."),(0,e.assert)(c>=0,"Value must be a non-negative number."),(0,e.assert)(Number.isSafeInteger(c),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,n.add0x)(c.toString(16)));pe.numberToHex=r;const t=c=>((0,e.assert)(typeof c=="bigint","Value must be a bigint."),(0,e.assert)(c>=0,"Value must be a non-negative bigint."),(0,n.add0x)(c.toString(16)));pe.bigIntToHex=t;const h=c=>{(0,n.assertIsHexString)(c);const f=parseInt(c,16);return(0,e.assert)(Number.isSafeInteger(f),"Value is not a safe integer. Use `hexToBigInt` instead."),f};pe.hexToNumber=h;const a=c=>((0,n.assertIsHexString)(c),BigInt((0,n.add0x)(c)));return pe.hexToBigInt=a,pe}var ni={},Aa;function Zd(){return Aa||(Aa=1,Object.defineProperty(ni,"__esModule",{value:!0})),ni}var ii={},Ma;function Kd(){return Ma||(Ma=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.timeSince=e.inMilliseconds=e.Duration=void 0,(function(a){a[a.Millisecond=1]="Millisecond",a[a.Second=1e3]="Second",a[a.Minute=6e4]="Minute",a[a.Hour=36e5]="Hour",a[a.Day=864e5]="Day",a[a.Week=6048e5]="Week",a[a.Year=31536e6]="Year"})(e.Duration||(e.Duration={}));const n=a=>Number.isInteger(a)&&a>=0,r=(a,c)=>{if(!n(a))throw new Error(`"${c}" must be a non-negative integer. Received: "${a}".`)};function t(a,c){return r(a,"count"),a*c}e.inMilliseconds=t;function h(a){return r(a,"timestamp"),Date.now()-a}e.timeSince=h})(ii)),ii}var si={},La;function Qd(){return La||(La=1,Object.defineProperty(si,"__esModule",{value:!0})),si}var oi={},ar={exports:{}},ai,Ta;function Jt(){if(Ta)return ai;Ta=1;const e="2.0.0",n=256,r=Number.MAX_SAFE_INTEGER||9007199254740991,t=16,h=n-6;return ai={MAX_LENGTH:n,MAX_SAFE_COMPONENT_LENGTH:t,MAX_SAFE_BUILD_LENGTH:h,MAX_SAFE_INTEGER:r,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},ai}var ci,Na;function wr(){if(Na)return ci;Na=1;var e={};return ci=typeof te=="object"&&e&&e.NODE_DEBUG&&/\bsemver\b/i.test(e.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{},ci}var Pa;function Gt(){return Pa||(Pa=1,(function(e,n){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:t,MAX_LENGTH:h}=Jt(),a=wr();n=e.exports={};const c=n.re=[],f=n.safeRe=[],u=n.src=[],g=n.safeSrc=[],l=n.t={};let s=0;const o="[a-zA-Z0-9-]",i=[["\\s",1],["\\d",h],[o,t]],p=b=>{for(const[d,y]of i)b=b.split(`${d}*`).join(`${d}{0,${y}}`).split(`${d}+`).join(`${d}{1,${y}}`);return b},m=(b,d,y)=>{const w=p(d),v=s++;a(b,v,d),l[b]=v,u[v]=d,g[v]=w,c[v]=new RegExp(d,y?"g":void 0),f[v]=new RegExp(w,y?"g":void 0)};m("NUMERICIDENTIFIER","0|[1-9]\\d*"),m("NUMERICIDENTIFIERLOOSE","\\d+"),m("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${o}*`),m("MAINVERSION",`(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})`),m("MAINVERSIONLOOSE",`(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASEIDENTIFIER",`(?:${u[l.NONNUMERICIDENTIFIER]}|${u[l.NUMERICIDENTIFIER]})`),m("PRERELEASEIDENTIFIERLOOSE",`(?:${u[l.NONNUMERICIDENTIFIER]}|${u[l.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASE",`(?:-(${u[l.PRERELEASEIDENTIFIER]}(?:\\.${u[l.PRERELEASEIDENTIFIER]})*))`),m("PRERELEASELOOSE",`(?:-?(${u[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[l.PRERELEASEIDENTIFIERLOOSE]})*))`),m("BUILDIDENTIFIER",`${o}+`),m("BUILD",`(?:\\+(${u[l.BUILDIDENTIFIER]}(?:\\.${u[l.BUILDIDENTIFIER]})*))`),m("FULLPLAIN",`v?${u[l.MAINVERSION]}${u[l.PRERELEASE]}?${u[l.BUILD]}?`),m("FULL",`^${u[l.FULLPLAIN]}$`),m("LOOSEPLAIN",`[v=\\s]*${u[l.MAINVERSIONLOOSE]}${u[l.PRERELEASELOOSE]}?${u[l.BUILD]}?`),m("LOOSE",`^${u[l.LOOSEPLAIN]}$`),m("GTLT","((?:<|>)?=?)"),m("XRANGEIDENTIFIERLOOSE",`${u[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),m("XRANGEIDENTIFIER",`${u[l.NUMERICIDENTIFIER]}|x|X|\\*`),m("XRANGEPLAIN",`[v=\\s]*(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:${u[l.PRERELEASE]})?${u[l.BUILD]}?)?)?`),m("XRANGEPLAINLOOSE",`[v=\\s]*(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:${u[l.PRERELEASELOOSE]})?${u[l.BUILD]}?)?)?`),m("XRANGE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAIN]}$`),m("XRANGELOOSE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAINLOOSE]}$`),m("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),m("COERCE",`${u[l.COERCEPLAIN]}(?:$|[^\\d])`),m("COERCEFULL",u[l.COERCEPLAIN]+`(?:${u[l.PRERELEASE]})?(?:${u[l.BUILD]})?(?:$|[^\\d])`),m("COERCERTL",u[l.COERCE],!0),m("COERCERTLFULL",u[l.COERCEFULL],!0),m("LONETILDE","(?:~>?)"),m("TILDETRIM",`(\\s*)${u[l.LONETILDE]}\\s+`,!0),n.tildeTrimReplace="$1~",m("TILDE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAIN]}$`),m("TILDELOOSE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAINLOOSE]}$`),m("LONECARET","(?:\\^)"),m("CARETTRIM",`(\\s*)${u[l.LONECARET]}\\s+`,!0),n.caretTrimReplace="$1^",m("CARET",`^${u[l.LONECARET]}${u[l.XRANGEPLAIN]}$`),m("CARETLOOSE",`^${u[l.LONECARET]}${u[l.XRANGEPLAINLOOSE]}$`),m("COMPARATORLOOSE",`^${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]})$|^$`),m("COMPARATOR",`^${u[l.GTLT]}\\s*(${u[l.FULLPLAIN]})$|^$`),m("COMPARATORTRIM",`(\\s*)${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]}|${u[l.XRANGEPLAIN]})`,!0),n.comparatorTrimReplace="$1$2$3",m("HYPHENRANGE",`^\\s*(${u[l.XRANGEPLAIN]})\\s+-\\s+(${u[l.XRANGEPLAIN]})\\s*$`),m("HYPHENRANGELOOSE",`^\\s*(${u[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[l.XRANGEPLAINLOOSE]})\\s*$`),m("STAR","(<|>)?=?\\s*\\*"),m("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),m("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(ar,ar.exports)),ar.exports}var ui,Oa;function Ls(){if(Oa)return ui;Oa=1;const e=Object.freeze({loose:!0}),n=Object.freeze({});return ui=t=>t?typeof t!="object"?e:t:n,ui}var li,xa;function ju(){if(xa)return li;xa=1;const e=/^[0-9]+$/,n=(t,h)=>{if(typeof t=="number"&&typeof h=="number")return t===h?0:t<h?-1:1;const a=e.test(t),c=e.test(h);return a&&c&&(t=+t,h=+h),t===h?0:a&&!c?-1:c&&!a?1:t<h?-1:1};return li={compareIdentifiers:n,rcompareIdentifiers:(t,h)=>n(h,t)},li}var di,Ba;function ae(){if(Ba)return di;Ba=1;const e=wr(),{MAX_LENGTH:n,MAX_SAFE_INTEGER:r}=Jt(),{safeRe:t,t:h}=Gt(),a=Ls(),{compareIdentifiers:c}=ju(),f=(g,l)=>{const s=l.split(".");if(s.length>g.length)return!1;for(let o=0;o<s.length;o++)if(c(g[o],s[o])!==0)return!1;return!0};class u{constructor(l,s){if(s=a(s),l instanceof u){if(l.loose===!!s.loose&&l.includePrerelease===!!s.includePrerelease)return l;l=l.version}else if(typeof l!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof l}".`);if(l.length>n)throw new TypeError(`version is longer than ${n} characters`);e("SemVer",l,s),this.options=s,this.loose=!!s.loose,this.includePrerelease=!!s.includePrerelease;const o=l.trim().match(s.loose?t[h.LOOSE]:t[h.FULL]);if(!o)throw new TypeError(`Invalid Version: ${l}`);if(this.raw=l,this.major=+o[1],this.minor=+o[2],this.patch=+o[3],this.major>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");o[4]?this.prerelease=o[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){const p=+i;if(p>=0&&p<r)return p}return i}):this.prerelease=[],this.build=o[5]?o[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(l){if(e("SemVer.compare",this.version,this.options,l),!(l instanceof u)){if(typeof l=="string"&&l===this.version)return 0;l=new u(l,this.options)}return l.version===this.version?0:this.compareMain(l)||this.comparePre(l)}compareMain(l){return l instanceof u||(l=new u(l,this.options)),this.major<l.major?-1:this.major>l.major?1:this.minor<l.minor?-1:this.minor>l.minor?1:this.patch<l.patch?-1:this.patch>l.patch?1:0}comparePre(l){if(l instanceof u||(l=new u(l,this.options)),this.prerelease.length&&!l.prerelease.length)return-1;if(!this.prerelease.length&&l.prerelease.length)return 1;if(!this.prerelease.length&&!l.prerelease.length)return 0;let s=0;do{const o=this.prerelease[s],i=l.prerelease[s];if(e("prerelease compare",s,o,i),o===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(o===void 0)return-1;if(o===i)continue;return c(o,i)}while(++s)}compareBuild(l){l instanceof u||(l=new u(l,this.options));let s=0;do{const o=this.build[s],i=l.build[s];if(e("build compare",s,o,i),o===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(o===void 0)return-1;if(o===i)continue;return c(o,i)}while(++s)}inc(l,s,o){if(l.startsWith("pre")){if(!s&&o===!1)throw new Error("invalid increment argument: identifier is empty");if(s){const i=`-${s}`.match(this.options.loose?t[h.PRERELEASELOOSE]:t[h.PRERELEASE]);if(!i||i[1]!==s)throw new Error(`invalid identifier: ${s}`)}}switch(l){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",s,o);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",s,o);break;case"prepatch":this.prerelease.length=0,this.inc("patch",s,o),this.inc("pre",s,o);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",s,o),this.inc("pre",s,o);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const i=Number(o)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let p=this.prerelease.length;for(;--p>=0;)typeof this.prerelease[p]=="number"&&(this.prerelease[p]++,p=-2);if(p===-1){if(s===this.prerelease.join(".")&&o===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(s){let p=[s,i];if(o===!1&&(p=[s]),f(this.prerelease,s)){const m=this.prerelease[s.split(".").length];isNaN(m)&&(this.prerelease=p)}else this.prerelease=p}break}default:throw new Error(`invalid increment argument: ${l}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return di=u,di}var hi,Da;function Qe(){if(Da)return hi;Da=1;const e=ae();return hi=(r,t,h=!1)=>{if(r instanceof e)return r;try{return new e(r,t)}catch(a){if(!h)return null;throw a}},hi}var fi,Fa;function Yd(){if(Fa)return fi;Fa=1;const e=Qe();return fi=(r,t)=>{const h=e(r,t);return h?h.version:null},fi}var gi,qa;function Xd(){if(qa)return gi;qa=1;const e=Qe();return gi=(r,t)=>{const h=e(r.trim().replace(/^[=v]+/,""),t);return h?h.version:null},gi}var pi,ja;function eh(){if(ja)return pi;ja=1;const e=ae();return pi=(r,t,h,a,c)=>{typeof h=="string"&&(c=a,a=h,h=void 0);try{return new e(r instanceof e?r.version:r,h).inc(t,a,c).version}catch{return null}},pi}var mi,$a;function th(){if($a)return mi;$a=1;const e=Qe();return mi=(r,t)=>{const h=e(r,null,!0),a=e(t,null,!0),c=h.compare(a);if(c===0)return null;const f=c>0,u=f?h:a,g=f?a:h,l=!!u.prerelease.length;if(!!g.prerelease.length&&!l){if(!g.patch&&!g.minor)return"major";if(g.compareMain(u)===0)return g.minor&&!g.patch?"minor":"patch"}const o=l?"pre":"";return h.major!==a.major?o+"major":h.minor!==a.minor?o+"minor":h.patch!==a.patch?o+"patch":"prerelease"},mi}var bi,Ha;function rh(){if(Ha)return bi;Ha=1;const e=ae();return bi=(r,t)=>new e(r,t).major,bi}var yi,Ua;function nh(){if(Ua)return yi;Ua=1;const e=ae();return yi=(r,t)=>new e(r,t).minor,yi}var wi,Wa;function ih(){if(Wa)return wi;Wa=1;const e=ae();return wi=(r,t)=>new e(r,t).patch,wi}var vi,Va;function sh(){if(Va)return vi;Va=1;const e=Qe();return vi=(r,t)=>{const h=e(r,t);return h&&h.prerelease.length?h.prerelease:null},vi}var _i,za;function me(){if(za)return _i;za=1;const e=ae();return _i=(r,t,h)=>new e(r,h).compare(new e(t,h)),_i}var Ei,Ja;function oh(){if(Ja)return Ei;Ja=1;const e=me();return Ei=(r,t,h)=>e(t,r,h),Ei}var Ri,Ga;function ah(){if(Ga)return Ri;Ga=1;const e=me();return Ri=(r,t)=>e(r,t,!0),Ri}var Si,Za;function Ts(){if(Za)return Si;Za=1;const e=ae();return Si=(r,t,h)=>{const a=new e(r,h),c=new e(t,h);return a.compare(c)||a.compareBuild(c)},Si}var Ci,Ka;function ch(){if(Ka)return Ci;Ka=1;const e=Ts();return Ci=(r,t)=>r.sort((h,a)=>e(h,a,t)),Ci}var ki,Qa;function uh(){if(Qa)return ki;Qa=1;const e=Ts();return ki=(r,t)=>r.sort((h,a)=>e(a,h,t)),ki}var Ii,Ya;function vr(){if(Ya)return Ii;Ya=1;const e=me();return Ii=(r,t,h)=>e(r,t,h)>0,Ii}var Ai,Xa;function Ns(){if(Xa)return Ai;Xa=1;const e=me();return Ai=(r,t,h)=>e(r,t,h)<0,Ai}var Mi,ec;function $u(){if(ec)return Mi;ec=1;const e=me();return Mi=(r,t,h)=>e(r,t,h)===0,Mi}var Li,tc;function Hu(){if(tc)return Li;tc=1;const e=me();return Li=(r,t,h)=>e(r,t,h)!==0,Li}var Ti,rc;function Ps(){if(rc)return Ti;rc=1;const e=me();return Ti=(r,t,h)=>e(r,t,h)>=0,Ti}var Ni,nc;function Os(){if(nc)return Ni;nc=1;const e=me();return Ni=(r,t,h)=>e(r,t,h)<=0,Ni}var Pi,ic;function Uu(){if(ic)return Pi;ic=1;const e=$u(),n=Hu(),r=vr(),t=Ps(),h=Ns(),a=Os();return Pi=(f,u,g,l)=>{switch(u){case"===":return typeof f=="object"&&(f=f.version),typeof g=="object"&&(g=g.version),f===g;case"!==":return typeof f=="object"&&(f=f.version),typeof g=="object"&&(g=g.version),f!==g;case"":case"=":case"==":return e(f,g,l);case"!=":return n(f,g,l);case">":return r(f,g,l);case">=":return t(f,g,l);case"<":return h(f,g,l);case"<=":return a(f,g,l);default:throw new TypeError(`Invalid operator: ${u}`)}},Pi}var Oi,sc;function lh(){if(sc)return Oi;sc=1;const e=ae(),n=Qe(),{safeRe:r,t}=Gt();return Oi=(a,c)=>{if(a instanceof e)return a;if(typeof a=="number"&&(a=String(a)),typeof a!="string")return null;c=c||{};let f=null;if(!c.rtl)f=a.match(c.includePrerelease?r[t.COERCEFULL]:r[t.COERCE]);else{const i=c.includePrerelease?r[t.COERCERTLFULL]:r[t.COERCERTL];let p;for(;(p=i.exec(a))&&(!f||f.index+f[0].length!==a.length);)(!f||p.index+p[0].length!==f.index+f[0].length)&&(f=p),i.lastIndex=p.index+p[1].length+p[2].length;i.lastIndex=-1}if(f===null)return null;const u=f[2],g=f[3]||"0",l=f[4]||"0",s=c.includePrerelease&&f[5]?`-${f[5]}`:"",o=c.includePrerelease&&f[6]?`+${f[6]}`:"";return n(`${u}.${g}.${l}${s}${o}`,c)},Oi}var xi,oc;function dh(){if(oc)return xi;oc=1;const e=Qe(),n=Jt(),r=ae(),t=(f,u,g)=>{if(!n.RELEASE_TYPES.includes(u))return null;const l=h(f,g);return l&&a(l,u)},h=(f,u)=>{const g=f instanceof r?f.version:f;return e(g,u)},a=(f,u)=>{if(c(u))return f.version;switch(f.prerelease=[],u){case"major":f.minor=0,f.patch=0;break;case"minor":f.patch=0;break}return f.format()},c=f=>f.startsWith("pre");return xi=t,xi}var Bi,ac;function hh(){if(ac)return Bi;ac=1;class e{constructor(){this.max=1e3,this.map=new Map}get(r){const t=this.map.get(r);if(t!==void 0)return this.map.delete(r),this.map.set(r,t),t}delete(r){return this.map.delete(r)}set(r,t){if(!this.delete(r)&&t!==void 0){if(this.map.size>=this.max){const a=this.map.keys().next().value;this.delete(a)}this.map.set(r,t)}return this}}return Bi=e,Bi}var Di,cc;function be(){if(cc)return Di;cc=1;const e=/\s+/g;class n{constructor(T,x){if(x=h(x),T instanceof n)return T.loose===!!x.loose&&T.includePrerelease===!!x.includePrerelease?T:new n(T.raw,x);if(T instanceof a)return this.raw=T.value,this.set=[[T]],this.formatted=void 0,this;if(this.options=x,this.loose=!!x.loose,this.includePrerelease=!!x.includePrerelease,this.raw=T.trim().replace(e," "),this.set=this.raw.split("||").map(D=>this.parseRange(D.trim())).filter(D=>D.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const D=this.set[0];if(this.set=this.set.filter(V=>!d(V[0])),this.set.length===0)this.set=[D];else if(this.set.length>1){for(const V of this.set)if(V.length===1&&y(V[0])){this.set=[V];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let T=0;T<this.set.length;T++){T>0&&(this.formatted+="||");const x=this.set[T];for(let D=0;D<x.length;D++)D>0&&(this.formatted+=" "),this.formatted+=x[D].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(T){T=T.replace(b,"");const D=((this.options.includePrerelease&&p)|(this.options.loose&&m))+":"+T,V=t.get(D);if(V)return V;const F=this.options.loose,j=F?u[l.HYPHENRANGELOOSE]:u[l.HYPHENRANGE];T=T.replace(j,J(this.options.includePrerelease)),c("hyphen replace",T),T=T.replace(u[l.COMPARATORTRIM],s),c("comparator trim",T),T=T.replace(u[l.TILDETRIM],o),c("tilde trim",T),T=T.replace(u[l.CARETTRIM],i),c("caret trim",T);let G=T.split(" ").map(N=>v(N,this.options)).join(" ").split(/\s+/).map(N=>Y(N,this.options));F&&(G=G.filter(N=>(c("loose invalid filter",N,this.options),!!N.match(u[l.COMPARATORLOOSE])))),c("range list",G);const H=new Map,k=G.map(N=>new a(N,this.options));for(const N of k){if(d(N))return[N];H.set(N.value,N)}H.size>1&&H.has("")&&H.delete("");const A=[...H.values()];return t.set(D,A),A}intersects(T,x){if(!(T instanceof n))throw new TypeError("a Range is required");return this.set.some(D=>w(D,x)&&T.set.some(V=>w(V,x)&&D.every(F=>V.every(j=>F.intersects(j,x)))))}test(T){if(!T)return!1;if(typeof T=="string")try{T=new f(T,this.options)}catch{return!1}for(let x=0;x<this.set.length;x++)if(M(this.set[x],T,this.options))return!0;return!1}}Di=n;const r=hh(),t=new r,h=Ls(),a=_r(),c=wr(),f=ae(),{safeRe:u,src:g,t:l,comparatorTrimReplace:s,tildeTrimReplace:o,caretTrimReplace:i}=Gt(),{FLAG_INCLUDE_PRERELEASE:p,FLAG_LOOSE:m}=Jt(),b=new RegExp(g[l.BUILD],"g"),d=L=>L.value==="<0.0.0-0",y=L=>L.value==="",w=(L,T)=>{let x=!0;const D=L.slice();let V=D.pop();for(;x&&D.length;)x=D.every(F=>V.intersects(F,T)),V=D.pop();return x},v=(L,T)=>(L=L.replace(u[l.BUILD],""),c("comp",L,T),L=P(L,T),c("caret",L),L=S(L,T),c("tildes",L),L=$(L,T),c("xrange",L),L=X(L,T),c("stars",L),L),_=L=>!L||L.toLowerCase()==="x"||L==="*",C=(L,T,x)=>_(L)&&!_(T)||_(T)&&x&&!_(x),S=(L,T)=>L.trim().split(/\s+/).map(x=>I(x,T)).join(" "),I=(L,T)=>{const x=T.loose?u[l.TILDELOOSE]:u[l.TILDE],D=T.includePrerelease?"-0":"";return L.replace(x,(V,F,j,G,H)=>{c("tilde",L,V,F,j,G,H);let k;return _(F)?k="":_(j)?k=`>=${F}.0.0${D} <${+F+1}.0.0-0`:_(G)?k=`>=${F}.${j}.0${D} <${F}.${+j+1}.0-0`:H?(c("replaceTilde pr",H),k=`>=${F}.${j}.${G}-${H} <${F}.${+j+1}.0-0`):k=`>=${F}.${j}.${G} <${F}.${+j+1}.0-0`,c("tilde return",k),k})},P=(L,T)=>L.trim().split(/\s+/).map(x=>B(x,T)).join(" "),B=(L,T)=>{c("caret",L,T);const x=T.loose?u[l.CARETLOOSE]:u[l.CARET],D=T.includePrerelease?"-0":"";return L.replace(x,(V,F,j,G,H)=>{c("caret",L,V,F,j,G,H);let k;return _(F)?k="":_(j)?k=`>=${F}.0.0${D} <${+F+1}.0.0-0`:_(G)?F==="0"?k=`>=${F}.${j}.0${D} <${F}.${+j+1}.0-0`:k=`>=${F}.${j}.0${D} <${+F+1}.0.0-0`:H?(c("replaceCaret pr",H),F==="0"?j==="0"?k=`>=${F}.${j}.${G}-${H} <${F}.${j}.${+G+1}-0`:k=`>=${F}.${j}.${G}-${H} <${F}.${+j+1}.0-0`:k=`>=${F}.${j}.${G}-${H} <${+F+1}.0.0-0`):(c("no pr"),F==="0"?j==="0"?k=`>=${F}.${j}.${G} <${F}.${j}.${+G+1}-0`:k=`>=${F}.${j}.${G} <${F}.${+j+1}.0-0`:k=`>=${F}.${j}.${G} <${+F+1}.0.0-0`),c("caret return",k),k})},$=(L,T)=>(c("replaceXRanges",L,T),L.split(/\s+/).map(x=>z(x,T)).join(" ")),z=(L,T)=>{L=L.trim();const x=T.loose?u[l.XRANGELOOSE]:u[l.XRANGE];return L.replace(x,(D,V,F,j,G,H)=>{if(c("xRange",L,D,V,F,j,G,H),C(F,j,G))return L;const k=_(F),A=k||_(j),N=A||_(G),U=N;return V==="="&&U&&(V=""),H=T.includePrerelease?"-0":"",k?V===">"||V==="<"?D="<0.0.0-0":D="*":V&&U?(A&&(j=0),G=0,V===">"?(V=">=",A?(F=+F+1,j=0,G=0):(j=+j+1,G=0)):V==="<="&&(V="<",A?F=+F+1:j=+j+1),V==="<"&&(H="-0"),D=`${V+F}.${j}.${G}${H}`):A?D=`>=${F}.0.0${H} <${+F+1}.0.0-0`:N&&(D=`>=${F}.${j}.0${H} <${F}.${+j+1}.0-0`),c("xRange return",D),D})},X=(L,T)=>(c("replaceStars",L,T),L.trim().replace(u[l.STAR],"")),Y=(L,T)=>(c("replaceGTE0",L,T),L.trim().replace(u[T.includePrerelease?l.GTE0PRE:l.GTE0],"")),J=L=>(T,x,D,V,F,j,G,H,k,A,N,U)=>(_(D)?x="":_(V)?x=`>=${D}.0.0${L?"-0":""}`:_(F)?x=`>=${D}.${V}.0${L?"-0":""}`:j?x=`>=${x}`:x=`>=${x}${L?"-0":""}`,_(k)?H="":_(A)?H=`<${+k+1}.0.0-0`:_(N)?H=`<${k}.${+A+1}.0-0`:U?H=`<=${k}.${A}.${N}-${U}`:L?H=`<${k}.${A}.${+N+1}-0`:H=`<=${H}`,`${x} ${H}`.trim()),M=(L,T,x)=>{for(let D=0;D<L.length;D++)if(!L[D].test(T))return!1;if(T.prerelease.length&&!x.includePrerelease){for(let D=0;D<L.length;D++)if(c(L[D].semver),L[D].semver!==a.ANY&&L[D].semver.prerelease.length>0){const V=L[D].semver;if(V.major===T.major&&V.minor===T.minor&&V.patch===T.patch)return!0}return!1}return!0};return Di}var Fi,uc;function _r(){if(uc)return Fi;uc=1;const e=Symbol("SemVer ANY");class n{static get ANY(){return e}constructor(l,s){if(s=r(s),l instanceof n){if(l.loose===!!s.loose)return l;l=l.value}l=l.trim().split(/\s+/).join(" "),c("comparator",l,s),this.options=s,this.loose=!!s.loose,this.parse(l),this.semver===e?this.value="":this.value=this.operator+this.semver.version,c("comp",this)}parse(l){const s=this.options.loose?t[h.COMPARATORLOOSE]:t[h.COMPARATOR],o=l.match(s);if(!o)throw new TypeError(`Invalid comparator: ${l}`);this.operator=o[1]!==void 0?o[1]:"",this.operator==="="&&(this.operator=""),o[2]?this.semver=new f(o[2],this.options.loose):this.semver=e}toString(){return this.value}test(l){if(c("Comparator.test",l,this.options.loose),this.semver===e||l===e)return!0;if(typeof l=="string")try{l=new f(l,this.options)}catch{return!1}return a(l,this.operator,this.semver,this.options)}intersects(l,s){if(!(l instanceof n))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new u(l.value,s).test(this.value):l.operator===""?l.value===""?!0:new u(this.value,s).test(l.semver):(s=r(s),s.includePrerelease&&(this.value==="<0.0.0-0"||l.value==="<0.0.0-0")||!s.includePrerelease&&(this.value.startsWith("<0.0.0")||l.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&l.operator.startsWith(">")||this.operator.startsWith("<")&&l.operator.startsWith("<")||this.semver.version===l.semver.version&&this.operator.includes("=")&&l.operator.includes("=")||a(this.semver,"<",l.semver,s)&&this.operator.startsWith(">")&&l.operator.startsWith("<")||a(this.semver,">",l.semver,s)&&this.operator.startsWith("<")&&l.operator.startsWith(">")))}}Fi=n;const r=Ls(),{safeRe:t,t:h}=Gt(),a=Uu(),c=wr(),f=ae(),u=be();return Fi}var qi,lc;function Er(){if(lc)return qi;lc=1;const e=be();return qi=(r,t,h)=>{try{t=new e(t,h)}catch{return!1}return t.test(r)},qi}var ji,dc;function fh(){if(dc)return ji;dc=1;const e=be();return ji=(r,t)=>new e(r,t).set.map(h=>h.map(a=>a.value).join(" ").trim().split(" ")),ji}var $i,hc;function gh(){if(hc)return $i;hc=1;const e=ae(),n=be();return $i=(t,h,a)=>{let c=null,f=null,u=null;try{u=new n(h,a)}catch{return null}return t.forEach(g=>{u.test(g)&&(!c||f.compare(g)===-1)&&(c=g,f=new e(c,a))}),c},$i}var Hi,fc;function ph(){if(fc)return Hi;fc=1;const e=ae(),n=be();return Hi=(t,h,a)=>{let c=null,f=null,u=null;try{u=new n(h,a)}catch{return null}return t.forEach(g=>{u.test(g)&&(!c||f.compare(g)===1)&&(c=g,f=new e(c,a))}),c},Hi}var Ui,gc;function mh(){if(gc)return Ui;gc=1;const e=ae(),n=be(),r=vr();return Ui=(h,a)=>{h=new n(h,a);let c=new e("0.0.0");if(h.test(c)||(c=new e("0.0.0-0"),h.test(c)))return c;c=null;for(let f=0;f<h.set.length;++f){const u=h.set[f];let g=null;u.forEach(l=>{const s=new e(l.semver.version);switch(l.operator){case">":s.prerelease.length===0?s.patch++:s.prerelease.push(0),s.raw=s.format();case"":case">=":(!g||r(s,g))&&(g=s);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${l.operator}`)}}),g&&(!c||r(c,g))&&(c=g)}return c&&h.test(c)?c:null},Ui}var Wi,pc;function bh(){if(pc)return Wi;pc=1;const e=be();return Wi=(r,t)=>{try{return new e(r,t).range||"*"}catch{return null}},Wi}var Vi,mc;function xs(){if(mc)return Vi;mc=1;const e=ae(),n=_r(),{ANY:r}=n,t=be(),h=Er(),a=vr(),c=Ns(),f=Os(),u=Ps();return Vi=(l,s,o,i)=>{l=new e(l,i),s=new t(s,i);let p,m,b,d,y;switch(o){case">":p=a,m=f,b=c,d=">",y=">=";break;case"<":p=c,m=u,b=a,d="<",y="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(h(l,s,i))return!1;for(let w=0;w<s.set.length;++w){const v=s.set[w];let _=null,C=null;if(v.forEach(S=>{S.semver===r&&(S=new n(">=0.0.0")),_=_||S,C=C||S,p(S.semver,_.semver,i)?_=S:b(S.semver,C.semver,i)&&(C=S)}),_.operator===d||_.operator===y||(!C.operator||C.operator===d)&&m(l,C.semver))return!1;if(C.operator===y&&b(l,C.semver))return!1}return!0},Vi}var zi,bc;function yh(){if(bc)return zi;bc=1;const e=xs();return zi=(r,t,h)=>e(r,t,">",h),zi}var Ji,yc;function wh(){if(yc)return Ji;yc=1;const e=xs();return Ji=(r,t,h)=>e(r,t,"<",h),Ji}var Gi,wc;function vh(){if(wc)return Gi;wc=1;const e=be();return Gi=(r,t,h)=>(r=new e(r,h),t=new e(t,h),r.intersects(t,h)),Gi}var Zi,vc;function _h(){if(vc)return Zi;vc=1;const e=Er(),n=me();return Zi=(r,t,h)=>{const a=[];let c=null,f=null;const u=r.sort((o,i)=>n(o,i,h));for(const o of u)e(o,t,h)?(f=o,c||(c=o)):(f&&a.push([c,f]),f=null,c=null);c&&a.push([c,null]);const g=[];for(const[o,i]of a)o===i?g.push(o):!i&&o===u[0]?g.push("*"):i?o===u[0]?g.push(`<=${i}`):g.push(`${o} - ${i}`):g.push(`>=${o}`);const l=g.join(" || "),s=typeof t.raw=="string"?t.raw:String(t);return l.length<s.length?l:t},Zi}var Ki,_c;function Eh(){if(_c)return Ki;_c=1;const e=be(),n=_r(),{ANY:r}=n,t=Er(),h=me(),a=(s,o,i={})=>{if(s===o)return!0;s=new e(s,i),o=new e(o,i);let p=!1;e:for(const m of s.set){for(const b of o.set){const d=u(m,b,i);if(p=p||d!==null,d)continue e}if(p)return!1}return!0},c=[new n(">=0.0.0-0")],f=[new n(">=0.0.0")],u=(s,o,i)=>{if(s===o)return!0;if(s.length===1&&s[0].semver===r){if(o.length===1&&o[0].semver===r)return!0;i.includePrerelease?s=c:s=f}if(o.length===1&&o[0].semver===r){if(i.includePrerelease)return!0;o=f}const p=new Set;let m,b;for(const I of s)I.operator===">"||I.operator===">="?m=g(m,I,i):I.operator==="<"||I.operator==="<="?b=l(b,I,i):p.add(I.semver);if(p.size>1)return null;let d;if(m&&b){if(d=h(m.semver,b.semver,i),d>0)return null;if(d===0&&(m.operator!==">="||b.operator!=="<="))return null}for(const I of p){if(m&&!t(I,String(m),i)||b&&!t(I,String(b),i))return null;for(const P of o)if(!t(I,String(P),i))return!1;return!0}let y,w,v,_,C=b&&!i.includePrerelease&&b.semver.prerelease.length?b.semver:!1,S=m&&!i.includePrerelease&&m.semver.prerelease.length?m.semver:!1;C&&C.prerelease.length===1&&b.operator==="<"&&C.prerelease[0]===0&&(C=!1);for(const I of o){if(_=_||I.operator===">"||I.operator===">=",v=v||I.operator==="<"||I.operator==="<=",m){if(S&&I.semver.prerelease&&I.semver.prerelease.length&&I.semver.major===S.major&&I.semver.minor===S.minor&&I.semver.patch===S.patch&&(S=!1),I.operator===">"||I.operator===">="){if(y=g(m,I,i),y===I&&y!==m)return!1}else if(m.operator===">="&&!I.test(m.semver))return!1}if(b){if(C&&I.semver.prerelease&&I.semver.prerelease.length&&I.semver.major===C.major&&I.semver.minor===C.minor&&I.semver.patch===C.patch&&(C=!1),I.operator==="<"||I.operator==="<="){if(w=l(b,I,i),w===I&&w!==b)return!1}else if(b.operator==="<="&&!I.test(b.semver))return!1}if(!I.operator&&(b||m)&&d!==0)return!1}return!(m&&v&&!b&&d!==0||b&&_&&!m&&d!==0||S||C)},g=(s,o,i)=>{if(!s)return o;const p=h(s.semver,o.semver,i);return p>0?s:p<0||o.operator===">"&&s.operator===">="?o:s},l=(s,o,i)=>{if(!s)return o;const p=h(s.semver,o.semver,i);return p<0?s:p>0||o.operator==="<"&&s.operator==="<="?o:s};return Ki=a,Ki}var Qi,Ec;function Rh(){if(Ec)return Qi;Ec=1;const e=Gt(),n=Jt(),r=ae(),t=ju(),h=Qe(),a=Yd(),c=Xd(),f=eh(),u=th(),g=rh(),l=nh(),s=ih(),o=sh(),i=me(),p=oh(),m=ah(),b=Ts(),d=ch(),y=uh(),w=vr(),v=Ns(),_=$u(),C=Hu(),S=Ps(),I=Os(),P=Uu(),B=lh(),$=dh(),z=_r(),X=be(),Y=Er(),J=fh(),M=gh(),L=ph(),T=mh(),x=bh(),D=xs(),V=yh(),F=wh(),j=vh(),G=_h(),H=Eh();return Qi={parse:h,valid:a,clean:c,inc:f,diff:u,major:g,minor:l,patch:s,prerelease:o,compare:i,rcompare:p,compareLoose:m,compareBuild:b,sort:d,rsort:y,gt:w,lt:v,eq:_,neq:C,gte:S,lte:I,cmp:P,coerce:B,truncate:$,Comparator:z,Range:X,satisfies:Y,toComparators:J,maxSatisfying:M,minSatisfying:L,minVersion:T,validRange:x,outside:D,gtr:V,ltr:F,intersects:j,simplifyRange:G,subset:H,SemVer:r,re:e.re,src:e.src,tokens:e.t,SEMVER_SPEC_VERSION:n.SEMVER_SPEC_VERSION,RELEASE_TYPES:n.RELEASE_TYPES,compareIdentifiers:t.compareIdentifiers,rcompareIdentifiers:t.rcompareIdentifiers},Qi}var Rc;function Sh(){return Rc||(Rc=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.satisfiesVersionRange=e.gtRange=e.gtVersion=e.assertIsSemVerRange=e.assertIsSemVerVersion=e.isValidSemVerRange=e.isValidSemVerVersion=e.VersionRangeStruct=e.VersionStruct=void 0;const n=Rh(),r=Ke,t=ke();e.VersionStruct=(0,r.refine)((0,r.string)(),"Version",s=>(0,n.valid)(s)===null?`Expected SemVer version, got "${s}"`:!0),e.VersionRangeStruct=(0,r.refine)((0,r.string)(),"Version range",s=>(0,n.validRange)(s)===null?`Expected SemVer range, got "${s}"`:!0);function h(s){return(0,r.is)(s,e.VersionStruct)}e.isValidSemVerVersion=h;function a(s){return(0,r.is)(s,e.VersionRangeStruct)}e.isValidSemVerRange=a;function c(s){(0,t.assertStruct)(s,e.VersionStruct)}e.assertIsSemVerVersion=c;function f(s){(0,t.assertStruct)(s,e.VersionRangeStruct)}e.assertIsSemVerRange=f;function u(s,o){return(0,n.gt)(s,o)}e.gtVersion=u;function g(s,o){return(0,n.gtr)(s,o)}e.gtRange=g;function l(s,o){return(0,n.satisfies)(s,o,{includePrerelease:!0})}e.satisfiesVersionRange=l})(oi)),oi}var Sc;function Ch(){return Sc||(Sc=1,(function(e){var n=He&&He.__createBinding||(Object.create?(function(t,h,a,c){c===void 0&&(c=a);var f=Object.getOwnPropertyDescriptor(h,a);(!f||("get"in f?!h.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return h[a]}}),Object.defineProperty(t,c,f)}):(function(t,h,a,c){c===void 0&&(c=a),t[c]=h[a]})),r=He&&He.__exportStar||function(t,h){for(var a in t)a!=="default"&&!Object.prototype.hasOwnProperty.call(h,a)&&n(h,t,a)};Object.defineProperty(e,"__esModule",{value:!0}),r(ke(),e),r(Fu(),e),r(qu(),e),r(Dd(),e),r(Fd(),e),r(qd(),e),r(jd(),e),r(yr(),e),r($d(),e),r(Hd(),e),r(zd(),e),r(Jd(),e),r(Gd(),e),r(Zd(),e),r(Kd(),e),r(Qd(),e),r(Sh(),e)})(He)),He}var Cc;function kh(){return Cc||(Cc=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createModuleLogger=e.projectLogger=void 0;const n=Ch();Object.defineProperty(e,"createModuleLogger",{enumerable:!0,get:function(){return n.createModuleLogger}}),e.projectLogger=(0,n.createProjectLogger)("eth-block-tracker")})(Zn)),Zn}var kc;function Ih(){if(kc)return je;kc=1;var e=je&&je.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(je,"__esModule",{value:!0}),je.PollingBlockTracker=void 0;const n=e(Ss()),r=e(Ql()),t=Mu(),h=kh(),a=(0,h.createModuleLogger)(h.projectLogger,"polling-block-tracker"),c=(0,n.default)(),f=1e3;let u=class extends t.BaseBlockTracker{constructor(s={}){var o;if(!s.provider)throw new Error("PollingBlockTracker - no provider specified.");super(Object.assign(Object.assign({},s),{blockResetDuration:(o=s.blockResetDuration)!==null&&o!==void 0?o:s.pollingInterval})),this._provider=s.provider,this._pollingInterval=s.pollingInterval||20*f,this._retryTimeout=s.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=s.keepEventLoopActive===void 0?!0:s.keepEventLoopActive,this._setSkipCacheFlag=s.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var s;this._isRunning;)try{await this._updateLatestBlock();const o=g(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await o}catch(o){const i=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:
|
|
3
3
|
${(s=o.stack)!==null&&s!==void 0?s:o}`);try{this.emit("error",i)}catch{console.error(i)}const p=g(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await p}}async _updateLatestBlock(){const s=await this._fetchLatestBlock();this._newPotentialLatest(s)}async _fetchLatestBlock(){const s={jsonrpc:"2.0",id:c(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(s.skipCache=!0),a("Making request",s);const o=await(0,r.default)(i=>this._provider.sendAsync(s,i))();if(a("Got response",o),o.error)throw new Error(`PollingBlockTracker - encountered error fetching block:
|
|
4
4
|
${o.error.message}`);return o.result}};je.PollingBlockTracker=u;function g(l,s){return new Promise(o=>{const i=setTimeout(o,l);i.unref&&s&&i.unref()})}return je}var Ue={},Ic;function Ah(){if(Ic)return Ue;Ic=1;var e=Ue&&Ue.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Ue,"__esModule",{value:!0}),Ue.SubscribeBlockTracker=void 0;const n=e(Ss()),r=Mu(),t=(0,n.default)();let h=class extends r.BaseBlockTracker{constructor(c={}){if(!c.provider)throw new Error("SubscribeBlockTracker - no provider specified.");super(c),this._provider=c.provider,this._subscriptionId=null}async checkForLatestBlock(){return await this.getLatestBlock()}async _start(){if(this._subscriptionId===void 0||this._subscriptionId===null)try{const c=await this._call("eth_blockNumber");this._subscriptionId=await this._call("eth_subscribe","newHeads"),this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(c)}catch(c){this.emit("error",c)}}async _end(){if(this._subscriptionId!==null&&this._subscriptionId!==void 0)try{await this._call("eth_unsubscribe",this._subscriptionId),this._subscriptionId=null}catch(c){this.emit("error",c)}}_call(c,...f){return new Promise((u,g)=>{this._provider.sendAsync({id:t(),method:c,params:f,jsonrpc:"2.0"},(l,s)=>{l?g(l):u(s.result)})})}_handleSubData(c,f){var u;f.method==="eth_subscription"&&((u=f.params)===null||u===void 0?void 0:u.subscription)===this._subscriptionId&&this._newPotentialLatest(f.params.result.number)}};return Ue.SubscribeBlockTracker=h,Ue}var Ac;function Mh(){return Ac||(Ac=1,(function(e){var n=qe&&qe.__createBinding||(Object.create?(function(t,h,a,c){c===void 0&&(c=a),Object.defineProperty(t,c,{enumerable:!0,get:function(){return h[a]}})}):(function(t,h,a,c){c===void 0&&(c=a),t[c]=h[a]})),r=qe&&qe.__exportStar||function(t,h){for(var a in t)a!=="default"&&!Object.prototype.hasOwnProperty.call(h,a)&&n(h,t,a)};Object.defineProperty(e,"__esModule",{value:!0}),r(Ih(),e),r(Ah(),e)})(qe)),qe}var We={},Ot={},xt={},Mc;function Wu(){if(Mc)return xt;Mc=1,Object.defineProperty(xt,"__esModule",{value:!0}),xt.getUniqueId=void 0;const e=4294967295;let n=Math.floor(Math.random()*e);function r(){return n=(n+1)%e,n}return xt.getUniqueId=r,xt}var Lc;function Lh(){if(Lc)return Ot;Lc=1,Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.createIdRemapMiddleware=void 0;const e=Wu();function n(){return(r,t,h,a)=>{const c=r.id,f=e.getUniqueId();r.id=f,t.id=f,h(u=>{r.id=c,t.id=c,u()})}}return Ot.createIdRemapMiddleware=n,Ot}var Bt={},Tc;function Th(){if(Tc)return Bt;Tc=1,Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.createAsyncMiddleware=void 0;function e(n){return async(r,t,h,a)=>{let c;const f=new Promise(s=>{c=s});let u=null,g=!1;const l=async()=>{g=!0,h(s=>{u=s,c()}),await f};try{await n(r,t,l),g?(await f,u(null)):a(null)}catch(s){u?u(s):a(s)}}}return Bt.createAsyncMiddleware=e,Bt}var Dt={},Nc;function Nh(){if(Nc)return Dt;Nc=1,Object.defineProperty(Dt,"__esModule",{value:!0}),Dt.createScaffoldMiddleware=void 0;function e(n){return(r,t,h,a)=>{const c=n[r.method];return c===void 0?h():typeof c=="function"?c(r,t,h,a):(t.result=c,a())}}return Dt.createScaffoldMiddleware=e,Dt}var Ve={},cr={},Pc;function Ph(){if(Pc)return cr;Pc=1,Object.defineProperty(cr,"__esModule",{value:!0});const e=fr();function n(h,a,c){try{Reflect.apply(h,a,c)}catch(f){setTimeout(()=>{throw f})}}function r(h){const a=h.length,c=new Array(a);for(let f=0;f<a;f+=1)c[f]=h[f];return c}class t extends e.EventEmitter{emit(a,...c){let f=a==="error";const u=this._events;if(u!==void 0)f=f&&u.error===void 0;else if(!f)return!1;if(f){let l;if(c.length>0&&([l]=c),l instanceof Error)throw l;const s=new Error(`Unhandled error.${l?` (${l.message})`:""}`);throw s.context=l,s}const g=u[a];if(g===void 0)return!1;if(typeof g=="function")n(g,this,c);else{const l=g.length,s=r(g);for(let o=0;o<l;o+=1)n(s[o],this,c)}return!0}}return cr.default=t,cr}var Yi={},ze={},Xi,Oc;function Oh(){if(Oc)return Xi;Oc=1,Xi=a,a.default=a,a.stable=g,a.stableStringify=g;var e="[...]",n="[Circular]",r=[],t=[];function h(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function a(o,i,p,m){typeof m>"u"&&(m=h()),f(o,"",0,[],void 0,0,m);var b;try{t.length===0?b=JSON.stringify(o,i,p):b=JSON.stringify(o,s(i),p)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;r.length!==0;){var d=r.pop();d.length===4?Object.defineProperty(d[0],d[1],d[3]):d[0][d[1]]=d[2]}}return b}function c(o,i,p,m){var b=Object.getOwnPropertyDescriptor(m,p);b.get!==void 0?b.configurable?(Object.defineProperty(m,p,{value:o}),r.push([m,p,i,b])):t.push([i,p,o]):(m[p]=o,r.push([m,p,i]))}function f(o,i,p,m,b,d,y){d+=1;var w;if(typeof o=="object"&&o!==null){for(w=0;w<m.length;w++)if(m[w]===o){c(n,o,i,b);return}if(typeof y.depthLimit<"u"&&d>y.depthLimit){c(e,o,i,b);return}if(typeof y.edgesLimit<"u"&&p+1>y.edgesLimit){c(e,o,i,b);return}if(m.push(o),Array.isArray(o))for(w=0;w<o.length;w++)f(o[w],w,w,m,o,d,y);else{var v=Object.keys(o);for(w=0;w<v.length;w++){var _=v[w];f(o[_],_,w,m,o,d,y)}}m.pop()}}function u(o,i){return o<i?-1:o>i?1:0}function g(o,i,p,m){typeof m>"u"&&(m=h());var b=l(o,"",0,[],void 0,0,m)||o,d;try{t.length===0?d=JSON.stringify(b,i,p):d=JSON.stringify(b,s(i),p)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;r.length!==0;){var y=r.pop();y.length===4?Object.defineProperty(y[0],y[1],y[3]):y[0][y[1]]=y[2]}}return d}function l(o,i,p,m,b,d,y){d+=1;var w;if(typeof o=="object"&&o!==null){for(w=0;w<m.length;w++)if(m[w]===o){c(n,o,i,b);return}try{if(typeof o.toJSON=="function")return}catch{return}if(typeof y.depthLimit<"u"&&d>y.depthLimit){c(e,o,i,b);return}if(typeof y.edgesLimit<"u"&&p+1>y.edgesLimit){c(e,o,i,b);return}if(m.push(o),Array.isArray(o))for(w=0;w<o.length;w++)l(o[w],w,w,m,o,d,y);else{var v={},_=Object.keys(o).sort(u);for(w=0;w<_.length;w++){var C=_[w];l(o[C],C,w,m,o,d,y),v[C]=o[C]}if(typeof b<"u")r.push([b,i,o]),b[i]=v;else return v}m.pop()}}function s(o){return o=typeof o<"u"?o:function(i,p){return p},function(i,p){if(t.length>0)for(var m=0;m<t.length;m++){var b=t[m];if(b[1]===i&&b[0]===p){p=b[2],t.splice(m,1);break}}return o.call(this,i,p)}}return Xi}var xc;function Bs(){if(xc)return ze;xc=1,Object.defineProperty(ze,"__esModule",{value:!0}),ze.EthereumProviderError=ze.EthereumRpcError=void 0;const e=Oh();class n extends Error{constructor(c,f,u){if(!Number.isInteger(c))throw new Error('"code" must be an integer.');if(!f||typeof f!="string")throw new Error('"message" must be a nonempty string.');super(f),this.code=c,u!==void 0&&(this.data=u)}serialize(){const c={code:this.code,message:this.message};return this.data!==void 0&&(c.data=this.data),this.stack&&(c.stack=this.stack),c}toString(){return e.default(this.serialize(),h,2)}}ze.EthereumRpcError=n;class r extends n{constructor(c,f,u){if(!t(c))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(c,f,u)}}ze.EthereumProviderError=r;function t(a){return Number.isInteger(a)&&a>=1e3&&a<=4999}function h(a,c){if(c!=="[Circular]")return c}return ze}var es={},Je={},Bc;function Ds(){return Bc||(Bc=1,Object.defineProperty(Je,"__esModule",{value:!0}),Je.errorValues=Je.errorCodes=void 0,Je.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}},Je.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."}}),Je}var Dc;function Vu(){return Dc||(Dc=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const n=Ds(),r=Bs(),t=n.errorCodes.rpc.internal,h="Unspecified error message. This is a bug, please report it.",a={code:t,message:c(t)};e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function c(o,i=h){if(Number.isInteger(o)){const p=o.toString();if(s(n.errorValues,p))return n.errorValues[p].message;if(g(o))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return i}e.getMessageFromCode=c;function f(o){if(!Number.isInteger(o))return!1;const i=o.toString();return!!(n.errorValues[i]||g(o))}e.isValidCode=f;function u(o,{fallbackError:i=a,shouldIncludeStack:p=!1}={}){var m,b;if(!i||!Number.isInteger(i.code)||typeof i.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(o instanceof r.EthereumRpcError)return o.serialize();const d={};if(o&&typeof o=="object"&&!Array.isArray(o)&&s(o,"code")&&f(o.code)){const w=o;d.code=w.code,w.message&&typeof w.message=="string"?(d.message=w.message,s(w,"data")&&(d.data=w.data)):(d.message=c(d.code),d.data={originalError:l(o)})}else{d.code=i.code;const w=(m=o)===null||m===void 0?void 0:m.message;d.message=w&&typeof w=="string"?w:i.message,d.data={originalError:l(o)}}const y=(b=o)===null||b===void 0?void 0:b.stack;return p&&o&&y&&typeof y=="string"&&(d.stack=y),d}e.serializeError=u;function g(o){return o>=-32099&&o<=-32e3}function l(o){return o&&typeof o=="object"&&!Array.isArray(o)?Object.assign({},o):o}function s(o,i){return Object.prototype.hasOwnProperty.call(o,i)}})(es)),es}var Ft={},Fc;function xh(){if(Fc)return Ft;Fc=1,Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.ethErrors=void 0;const e=Bs(),n=Vu(),r=Ds();Ft.ethErrors={rpc:{parse:c=>t(r.errorCodes.rpc.parse,c),invalidRequest:c=>t(r.errorCodes.rpc.invalidRequest,c),invalidParams:c=>t(r.errorCodes.rpc.invalidParams,c),methodNotFound:c=>t(r.errorCodes.rpc.methodNotFound,c),internal:c=>t(r.errorCodes.rpc.internal,c),server:c=>{if(!c||typeof c!="object"||Array.isArray(c))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:f}=c;if(!Number.isInteger(f)||f>-32005||f<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return t(f,c)},invalidInput:c=>t(r.errorCodes.rpc.invalidInput,c),resourceNotFound:c=>t(r.errorCodes.rpc.resourceNotFound,c),resourceUnavailable:c=>t(r.errorCodes.rpc.resourceUnavailable,c),transactionRejected:c=>t(r.errorCodes.rpc.transactionRejected,c),methodNotSupported:c=>t(r.errorCodes.rpc.methodNotSupported,c),limitExceeded:c=>t(r.errorCodes.rpc.limitExceeded,c)},provider:{userRejectedRequest:c=>h(r.errorCodes.provider.userRejectedRequest,c),unauthorized:c=>h(r.errorCodes.provider.unauthorized,c),unsupportedMethod:c=>h(r.errorCodes.provider.unsupportedMethod,c),disconnected:c=>h(r.errorCodes.provider.disconnected,c),chainDisconnected:c=>h(r.errorCodes.provider.chainDisconnected,c),custom:c=>{if(!c||typeof c!="object"||Array.isArray(c))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:f,message:u,data:g}=c;if(!u||typeof u!="string")throw new Error('"message" must be a nonempty string');return new e.EthereumProviderError(f,u,g)}}};function t(c,f){const[u,g]=a(f);return new e.EthereumRpcError(c,u||n.getMessageFromCode(c),g)}function h(c,f){const[u,g]=a(f);return new e.EthereumProviderError(c,u||n.getMessageFromCode(c),g)}function a(c){if(c){if(typeof c=="string")return[c];if(typeof c=="object"&&!Array.isArray(c)){const{message:f,data:u}=c;if(f&&typeof f!="string")throw new Error("Must specify string message.");return[f||void 0,u]}}return[]}return Ft}var qc;function Bh(){return qc||(qc=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMessageFromCode=e.serializeError=e.EthereumProviderError=e.EthereumRpcError=e.ethErrors=e.errorCodes=void 0;const n=Bs();Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return n.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return n.EthereumProviderError}});const r=Vu();Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const t=xh();Object.defineProperty(e,"ethErrors",{enumerable:!0,get:function(){return t.ethErrors}});const h=Ds();Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return h.errorCodes}})})(Yi)),Yi}var jc;function zu(){if(jc)return Ve;jc=1;var e=Ve&&Ve.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Ve,"__esModule",{value:!0}),Ve.JsonRpcEngine=void 0;const n=e(Ph()),r=Bh();let t=class Ce extends n.default{constructor(){super(),this._middleware=[]}push(c){this._middleware.push(c)}handle(c,f){if(f&&typeof f!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(c)?f?this._handleBatch(c,f):this._handleBatch(c):f?this._handle(c,f):this._promiseHandle(c)}asMiddleware(){return async(c,f,u,g)=>{try{const[l,s,o]=await Ce._runAllMiddleware(c,f,this._middleware);return s?(await Ce._runReturnHandlers(o),g(l)):u(async i=>{try{await Ce._runReturnHandlers(o)}catch(p){return i(p)}return i()})}catch(l){return g(l)}}}async _handleBatch(c,f){try{const u=await Promise.all(c.map(this._promiseHandle.bind(this)));return f?f(null,u):u}catch(u){if(f)return f(u);throw u}}_promiseHandle(c){return new Promise(f=>{this._handle(c,(u,g)=>{f(g)})})}async _handle(c,f){if(!c||Array.isArray(c)||typeof c!="object"){const s=new r.EthereumRpcError(r.errorCodes.rpc.invalidRequest,`Requests must be plain objects. Received: ${typeof c}`,{request:c});return f(s,{id:void 0,jsonrpc:"2.0",error:s})}if(typeof c.method!="string"){const s=new r.EthereumRpcError(r.errorCodes.rpc.invalidRequest,`Must specify a string method. Received: ${typeof c.method}`,{request:c});return f(s,{id:c.id,jsonrpc:"2.0",error:s})}const u=Object.assign({},c),g={id:u.id,jsonrpc:u.jsonrpc};let l=null;try{await this._processRequest(u,g)}catch(s){l=s}return l&&(delete g.result,g.error||(g.error=r.serializeError(l))),f(l,g)}async _processRequest(c,f){const[u,g,l]=await Ce._runAllMiddleware(c,f,this._middleware);if(Ce._checkForCompletion(c,f,g),await Ce._runReturnHandlers(l),u)throw u}static async _runAllMiddleware(c,f,u){const g=[];let l=null,s=!1;for(const o of u)if([l,s]=await Ce._runMiddleware(c,f,o,g),s)break;return[l,s,g.reverse()]}static _runMiddleware(c,f,u,g){return new Promise(l=>{const s=i=>{const p=i||f.error;p&&(f.error=r.serializeError(p)),l([p,!0])},o=i=>{f.error?s(f.error):(i&&(typeof i!="function"&&s(new r.EthereumRpcError(r.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof i}" for request:
|