@dcl/shop 0.6.0 → 0.6.1-30951438943.commit-29cea86
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/{Activity-Bge7lOuf.js → Activity-Bcut5fRy.js} +3 -3
- package/_assets/{AnimatedBackground-D0qNZ1uk.js → AnimatedBackground-C0Bpklcd.js} +1 -1
- package/_assets/{Assets-CxGe_ZM9.js → Assets-CVN8kbVX.js} +53 -52
- package/_assets/{Assets.styles-BiOSgFHZ.js → Assets.styles-DTCjJoYe.js} +1 -1
- package/_assets/{Authorizations-CsTEC_Hm.js → Authorizations-Doo9Zgdg.js} +1 -1
- package/_assets/{Cart-CHYrwY74.js → Cart-W7w0zqfv.js} +2 -2
- package/_assets/{CircularProgress-DDBADFDe.js → CircularProgress-DuQoJ6hf.js} +1 -1
- package/_assets/{Collection-nSwc5Ptd.js → Collection-DiBZWSLl.js} +1 -1
- package/_assets/{CollectionCarousel-D5MnwNN7.js → CollectionCarousel-DbpF1h5w.js} +1 -1
- package/_assets/{Creator-BVoAg8vx.js → Creator-gV7PR2lz.js} +1 -1
- package/_assets/{ErrorNotice-CHXOd3mv.js → ErrorNotice-vGKBE1Hj.js} +1 -1
- package/_assets/{ExchangeController-Bi0S9a9G.js → ExchangeController-C7H6XSRu.js} +1 -1
- package/_assets/{GetCredits-DBdIhuBL.js → GetCredits-BClB8S1_.js} +6 -6
- package/_assets/{HelpersUtil-BWrob0lV.js → HelpersUtil-B2odRbT4.js} +1 -1
- package/_assets/ItemDetail-o9GnfAIZ.js +3393 -0
- package/_assets/{LoadMore-BRkbiHQL.js → LoadMore-69ZjUVQ9.js} +1 -1
- package/_assets/{ManaPricingBanner.styles-DdfpyUuV.js → ManaPricingBanner.styles-06X913rg.js} +1 -1
- package/_assets/{MenuList-UXGLAgD2.js → MenuList-CYuJjTkq.js} +1 -1
- package/_assets/{MyAssets-DdKYWk0O.js → MyAssets-7DlPFZzH.js} +1 -1
- package/_assets/{MyFavorites-DdKVRDaf.js → MyFavorites-CvUWGM2g.js} +1 -1
- package/_assets/{NotFound-BkW0P3dR.js → NotFound-BfKww1lP.js} +1 -1
- package/_assets/{NotificationsBell-7ShIRJH3.js → NotificationsBell-8BV2V_7m.js} +1 -1
- package/_assets/{OutfitDetail-CNOkA_8O.js → OutfitDetail-i6KGnd11.js} +1 -1
- package/_assets/{OutfitPreview-DyGfIKQi.js → OutfitPreview-BO-tY6LN.js} +1 -1
- package/_assets/{OutfitStudio-DPE8kpg1.js → OutfitStudio-DHMsd1iV.js} +1 -1
- package/_assets/{StoreSettings-DfBHIW4j.js → StoreSettings-BBKP2P89.js} +1 -1
- package/_assets/{Success-crgO4feC.js → Success-RKKJMbUR.js} +1 -1
- package/_assets/{SwapController-Ht-IFVno.js → SwapController-uaC5iBTR.js} +1 -1
- package/_assets/{Tooltip-CLv-UZmX.js → Tooltip-Dh4BuhSJ.js} +1 -1
- package/_assets/{TradeService-B-NE5VaA.js → TradeService-B44oeYAt.js} +1 -1
- package/_assets/{W3MFrameProviderSingleton-Dew4UHCH.js → W3MFrameProviderSingleton-CtKoZGPW.js} +3 -3
- package/_assets/{WebCryptoP256-C5HbbLGD.js → WebCryptoP256-BgVEe5M8.js} +1 -1
- package/_assets/{authorizations-BZyk6WdU.js → authorizations-BWL7qlKm.js} +1 -1
- package/_assets/{basic-B6EVXOl2.js → basic-_OLz7uwX.js} +1 -1
- package/_assets/{biconomy-Ug4_y9HZ.js → biconomy-U_kcYvmd.js} +1 -1
- package/_assets/{builder-BtJop_Py.js → builder-I4cDZvRJ.js} +1 -1
- package/_assets/{buy-DdQ4SGHv.js → buy-PW05H439.js} +1 -1
- package/_assets/{buy-gasless-DduUmbTM.js → buy-gasless-B2bIFHQv.js} +1 -1
- package/_assets/{categories-BaRCBxVv.js → categories-Cewsb8Ef.js} +1 -1
- package/_assets/{ccip-BMULKFZu.js → ccip-BYTqCIcr.js} +1 -1
- package/_assets/{ccip-Db74k1Pr.js → ccip-DZw0ptqC.js} +1 -1
- package/_assets/{clsx-CEPd4QO3.js → clsx-ChZXKlM3.js} +1 -1
- package/_assets/{collectionPage.styles-D9bc4PtY.js → collectionPage.styles-Dd3m9ofi.js} +1 -1
- package/_assets/{controller-CWp6YNJV.js → controller-CGfzFXj8.js} +2 -2
- package/_assets/{core-CwiW5Nem.js → core-Eb3TLPcG.js} +4 -4
- package/_assets/{createSvgIcon-Bs2ci5m0.js → createSvgIcon-DIV4UAHy.js} +1 -1
- package/_assets/{custom-uHB6JExE.js → custom-D9XFQnk4.js} +1 -1
- package/_assets/{data-capture-D3NMxO3v.js → data-capture-DH1mVPA3.js} +1 -1
- package/_assets/{email-DVnSEa3r.js → email-Da1yvej9.js} +1 -1
- package/_assets/{embedded-wallet-DbVoNaLe.js → embedded-wallet-DBHQI3mh.js} +1 -1
- package/_assets/{emotion-styled.browser.esm-B3uXeLtp.js → emotion-styled.browser.esm-BQQ0TwU4.js} +1 -1
- package/_assets/{engine-BmkWePcn.js → engine-C32OFyoP.js} +1 -1
- package/_assets/{errors-DT8BUFd8.js → errors-Dyyi7AS1.js} +1 -1
- package/_assets/{estimate-l1-fee-LcCTQkbO.js → estimate-l1-fee-BUpWNCY1.js} +1 -1
- package/_assets/{execute-CBj5JHAd.js → execute-mSR8LGc4.js} +2 -2
- package/_assets/{features-BXQRcYZ3.js → features-Dd4HBrMX.js} +1 -1
- package/_assets/{fetchTokenMetadata-DJbq1Gx7.js → fetchTokenMetadata-BZB4GCl8.js} +2 -2
- package/_assets/{field.styles-CIQ-1Gyi.js → field.styles-vC92Xftn.js} +1 -1
- package/_assets/{get-ecosystem-wallet-info-L-cqSPfk.js → get-ecosystem-wallet-info-DwWRMl-N.js} +1 -1
- package/_assets/{getBalance-DX1WnXFT.js → getBalance-DSh23fMH.js} +1 -1
- package/_assets/{getNFT-fH2QMDXF.js → getNFT-BBp6M0pq.js} +1 -1
- package/_assets/{getNFT-Cgfi4Vmu.js → getNFT-BevVadL_.js} +1 -1
- package/_assets/{getThemeProps-D85rRXiV.js → getThemeProps-BF7zjQVr.js} +1 -1
- package/_assets/{grid.styles-BbfBfqCV.js → grid.styles-Bb1W1YT9.js} +1 -1
- package/_assets/{hashTypedData-DP-1NjnI.js → hashTypedData-C5G1DAop.js} +1 -1
- package/_assets/{hashTypedData-BbQ-AHc3.js → hashTypedData-Wfn9v-Hf.js} +1 -1
- package/_assets/{in-app-CtBGXFNg.js → in-app-BXEo5oJI.js} +1 -1
- package/_assets/{in-app-wallet-calls-yAvikrwR.js → in-app-wallet-calls-Bd6X0KWG.js} +1 -1
- package/_assets/{index-e4M6K87M.js → index-2BF-jN6f.js} +1 -1
- package/_assets/{index-CFyRWGpS.js → index-6Oq8x_-m.js} +1 -1
- package/_assets/{index-C9ALJu8v.js → index-7e_Syhad.js} +1 -1
- package/_assets/{index-rurXcTSu.js → index-B-wUrKiv.js} +3 -3
- package/_assets/{index-ZEf4-UtL.js → index-B1Fh_Ntj.js} +1 -1
- package/_assets/{index-BpzRndQt.js → index-B1eEwkzz.js} +1 -1
- package/_assets/{index-C-j8K69Q.js → index-B8FkQHkj.js} +1 -1
- package/_assets/{index-C0Hpoz_1.js → index-BCpKNpfr.js} +1 -1
- package/_assets/{index-CK0YA4GV.js → index-BF7hghuG.js} +1 -1
- package/_assets/{index-Bf7FRpyE.js → index-BFwmH5r2.js} +1 -1
- package/_assets/{index-BqH8KAmH.js → index-BK186nFF.js} +364 -389
- package/_assets/{index-7ncft_vv.js → index-BMDKd-Ff.js} +1 -1
- package/_assets/{index-B1CRrsWx.js → index-BNXLnSJ4.js} +1 -1
- package/_assets/{index-BbUGeidq.js → index-BQlATUFi.js} +1 -1
- package/_assets/{index-ul5wIAT0.js → index-BehGKAc6.js} +3 -3
- package/_assets/{index-B7gpJ7FK.js → index-BlneDIUK.js} +1 -1
- package/_assets/{index-CfJ4lbnY.js → index-Bpxazn1C.js} +1 -1
- package/_assets/{index-B_a8jknM.js → index-BqMHKneq.js} +1 -1
- package/_assets/{index-BrXEqk1O.js → index-CABCJq7C.js} +1 -1
- package/_assets/{index-DzETqrsC.js → index-CCwIHj2Z.js} +1 -1
- package/_assets/{index-X3LYABjY.js → index-CGga9MZU.js} +1 -1
- package/_assets/{index-B1Gnpvim.js → index-Cl0OwOQC.js} +2 -2
- package/_assets/{index-BSu1IoGB.js → index-CmOMlUK3.js} +1 -1
- package/_assets/{index-5sbt15fG.js → index-CnYjUY-N.js} +1 -1
- package/_assets/{index-C64LKUby.js → index-CpXK1eyp.js} +1 -1
- package/_assets/{index-DWEx5TbM.js → index-D3ia8xPb.js} +1 -1
- package/_assets/{index-BUe1EUX7.js → index-D58_3pMX.js} +1 -1
- package/_assets/{index-DW8xuXKL.js → index-D6jXV4v6.js} +3 -3
- package/_assets/{index-Dmf3D7KE.js → index-DBY7pfsX.js} +1 -1
- package/_assets/{index-BTt9L5Av.js → index-DCDkfxBQ.js} +1 -1
- package/_assets/{index-BEe4QBLJ.js → index-DHBBVF0A.js} +1 -1
- package/_assets/{index-DMHLNLqi.js → index-DNzD8lGd.js} +1 -1
- package/_assets/{index-Cou1KO6b.js → index-DQllllFW.js} +1 -1
- package/_assets/{index-CdUpjD0Z.js → index-D_Rc0VlP.js} +1 -1
- package/_assets/{index-3T1Up4ST.js → index-DabDoxcF.js} +2 -2
- package/_assets/{index-DIVlNKTA.js → index-DbyFw-p2.js} +1 -1
- package/_assets/{index-CF2mk15z.js → index-DeMedGEt.js} +1 -1
- package/_assets/{index-DqtsvtM3.js → index-DgM4asaI.js} +1 -1
- package/_assets/{index-B3GREAKI.js → index-DoaAKgT7.js} +1 -1
- package/_assets/{index-DgiMo6hh.js → index-Dsgz061o.js} +1 -1
- package/_assets/{index-DTMwjYEd.js → index-DtNkXFsH.js} +2 -2
- package/_assets/{index-DdXDqIhp.js → index-OM8C66gb.js} +1 -1
- package/_assets/{index-BRbIAs-h.js → index-QshQ-X06.js} +1 -1
- package/_assets/{index-nf5H3h6Q.js → index-b5E6PDAn.js} +1 -1
- package/_assets/{index-7aVl6hlf.js → index-fkuvr7Fy.js} +1 -1
- package/_assets/{index-Bl0Kh3_k.js → index-mDuPP0v8.js} +1 -1
- package/_assets/{index-H8YACMnu.js → index-ncNzPsNV.js} +1 -1
- package/_assets/{index-BSAtCb0u.js → index-ti6Xx8KP.js} +1 -1
- package/_assets/{index-BcPJYMIm.js → index-uYRD9E52.js} +1 -1
- package/_assets/{index-C7JkPo6K.js → index-vlz-Aki7.js} +1 -1
- package/_assets/{index-C_D2J-BR.js → index-vrvK7bcx.js} +1 -1
- package/_assets/{index-DrMKJdtC.js → index-yp3Medz4.js} +1 -1
- package/_assets/{index.es-CqtFRAJI.js → index.es-BG9tAoxq.js} +1 -1
- package/_assets/{index.es-B4CfzT8f.js → index.es-Bq-mnMqp.js} +4 -4
- package/_assets/{index.es-Bn8h3cHG.js → index.es-D5Y2l8N-.js} +1 -1
- package/_assets/{localBatchGatewayRequest-CZC8IBaQ.js → localBatchGatewayRequest-DQzEn08n.js} +1 -1
- package/_assets/{networks-0i8YZqHL.js → networks-7mAev_So.js} +1 -1
- package/_assets/{onramp-jLRLYivy.js → onramp-C5rbJZZQ.js} +1 -1
- package/_assets/{openzeppelin-Cg2_q1PI.js → openzeppelin-cUgS_fFv.js} +1 -1
- package/_assets/{parseNft-TDEqNX1Z.js → parseNft-BtgCWBfG.js} +2 -2
- package/_assets/{parseSignature-BalN-8VI.js → parseSignature-0U8LTkYq.js} +3 -3
- package/_assets/{parseSignature-U7pY0kT6.js → parseSignature-BL815h22.js} +1 -1
- package/_assets/{passkeys-1owiFaBv.js → passkeys-CenbJOC4.js} +1 -1
- package/_assets/{pay-with-exchange-CxpzU3qT.js → pay-with-exchange-fg2iyPQf.js} +1 -1
- package/_assets/{qr-overlay-CPsiG3BP.js → qr-overlay-Db9bn8si.js} +1 -1
- package/_assets/{receive-Bj4S4vrF.js → receive-Cy92xKIA.js} +1 -1
- package/_assets/{resolveImplementation-BgFFYcu4.js → resolveImplementation-CphK2kw-.js} +1 -1
- package/_assets/{rpc-C5i5d_Hd.js → rpc-tPaaI0wQ.js} +1 -1
- package/_assets/{secp256k1-CHxQAK4O.js → secp256k1-BefPXR71.js} +1 -1
- package/_assets/{secp256k1-PzBXITZB.js → secp256k1-BuRL31Pv.js} +1 -1
- package/_assets/{secp256k1-CVOBgeVv.js → secp256k1-rc9cttcQ.js} +1 -1
- package/_assets/{send-B1VWG_GM.js → send-B85QTpWb.js} +1 -1
- package/_assets/{send-batch-transaction-BhVc50dx.js → send-batch-transaction-IhphBGXV.js} +1 -1
- package/_assets/{send-eip712-transaction-G6HchcdI.js → send-eip712-transaction-D1F2l2MF.js} +2 -2
- package/_assets/{send-gasless-transaction-XGwNLlF0.js → send-gasless-transaction-B32TPIoL.js} +2 -2
- package/_assets/{send-transaction-C1XI8fYZ.js → send-transaction-DAsAIcLp.js} +2 -2
- package/_assets/{sendMetaTransaction-6e7RT25o.js → sendMetaTransaction-X4QLi3Hi.js} +1 -1
- package/_assets/{sendRawTransaction-lz2apptP.js → sendRawTransaction-Bp5LMxhF.js} +3 -3
- package/_assets/{serializeTransaction-CtWH-IFd.js → serializeTransaction-CcoTA2oD.js} +1 -1
- package/_assets/{session-proposal-DceQ_mD9.js → session-proposal-BFRFzBM9.js} +1 -1
- package/_assets/{session-request-CPsFtvuK.js → session-request-Kq_RHzZu.js} +2 -2
- package/_assets/{signing-CeXE5YMl.js → signing-Dqg6cmff.js} +3 -3
- package/_assets/{socials-Dn0c1c-x.js → socials-D13NM4Eg.js} +1 -1
- package/_assets/{swaps-fYZLHQYX.js → swaps-CQuH4Q4P.js} +1 -1
- package/_assets/{thirdweb-9nUi4NTx.js → thirdweb-CIKZzA4I.js} +3 -3
- package/_assets/{to-serializable-transaction-D4biQiPj.js → to-serializable-transaction-Bs3gRQ4f.js} +2 -2
- package/_assets/{trade-encoding-DED17fJl.js → trade-encoding-C7Wym_F1.js} +1 -1
- package/_assets/{transactionReceipt-D6xTzzAw.js → transactionReceipt-Bp1hf_iD.js} +1 -1
- package/_assets/{transactions-D3QkVO0W.js → transactions-Bli31a16.js} +1 -1
- package/_assets/{useCreditPacks-BcNkRZz6.js → useCreditPacks-CHzNSIvf.js} +1 -1
- package/_assets/{useImportable-B6vGX6b2.js → useImportable-kOA7rsjp.js} +1 -1
- package/_assets/{useInfiniteGrid-DaAZHneB.js → useInfiniteGrid-CdPr9eL9.js} +1 -1
- package/_assets/{useTheme-BJh8uAMV.js → useTheme-CGp2hobC.js} +1 -1
- package/_assets/{verifyHash-DDW5fWXv.js → verifyHash-tFRgslhI.js} +1 -1
- package/_assets/{w3m-modal-CbSLOTQ6.js → w3m-modal-Cd7LAwQP.js} +1 -1
- package/_assets/{w3m-modal-BrowLxPF.js → w3m-modal-DIDR69iz.js} +1 -1
- package/_assets/{wait-for-tx-receipt-Chc522wr.js → wait-for-tx-receipt-BlFYuYR0.js} +1 -1
- package/_assets/{wallets-1JYF6nkF.js → wallets-0QMnCoJB.js} +5 -5
- package/_assets/{web-connector-C19h992M.js → web-connector-C-yPSxwg.js} +3 -3
- package/_assets/{writeContract-DvQTemxv.js → writeContract-BWpBg5cs.js} +1 -1
- package/_assets/{zoraTestnet-DwCWuKz_.js → zoraTestnet-YDHc7FSH.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/_assets/ItemDetail-BLZNqNQh.js +0 -3375
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/PhArrowCircleDown-B305t-Sh.js","_assets/property-C9JG5tag.js","_assets/PhArrowClockwise-CJPxQhr_.js","_assets/PhArrowDown-C4hT9BVu.js","_assets/PhArrowLeft-Way4Cu-r.js","_assets/PhArrowRight-Cp5ZME0F.js","_assets/PhArrowSquareOut-NnrK69c5.js","_assets/PhArrowsDownUp-BjBI4ckC.js","_assets/PhArrowsLeftRight-CuLpbKRk.js","_assets/PhArrowUp-Dph6j8rm.js","_assets/PhArrowUpRight-BpJjRRRh.js","_assets/PhArrowsClockwise-CFUT8X7R.js","_assets/PhBank-Dchr4XQJ.js","_assets/PhBrowser-dUu2TrC1.js","_assets/PhCaretDown-78IuKU3V.js","_assets/PhCaretLeft-_aiyH7n1.js","_assets/PhCaretRight-8zJQEuDX.js","_assets/PhCaretUp-CiCxKWwN.js","_assets/PhCheck-CcADx8br.js","_assets/PhCircleHalf-BYzSzd2h.js","_assets/PhClock-UItiXeJq.js","_assets/PhCompass-CUy3uA7t.js","_assets/PhCopy-C-PDgSlZ.js","_assets/PhCreditCard-CWRaUT6F.js","_assets/PhCurrencyDollar-Cqla3AXT.js","_assets/PhDesktop-BBIPrYLl.js","_assets/PhDeviceMobile-BdsPaATg.js","_assets/PhDotsThree-BMXCQl-0.js","_assets/PhVault-l2PHF38a.js","_assets/PhEnvelope-yUsis6yU.js","_assets/PhFunnelSimple-Ba7BbWTp.js","_assets/PhGlobe-DgLxBk5U.js","_assets/PhIdentificationCard-Czjmq9Z3.js","_assets/PhImage-BAJ_erz6.js","_assets/PhInfo-Cr4DhVUE.js","_assets/PhLightbulb-BX_7duTr.js","_assets/PhMagnifyingGlass-Mygfryvz.js","_assets/PhPaperPlaneRight-BeuCA660.js","_assets/PhPlus-BMjcHjsT.js","_assets/PhPower-CGffGmdb.js","_assets/PhPuzzlePiece-wm_GpVSi.js","_assets/PhQrCode-DRwRzXCH.js","_assets/PhQuestion-M09j2U0T.js","_assets/PhQuestionMark-BP9EMB6h.js","_assets/PhSealCheck-BfG80yKn.js","_assets/PhSignOut-C5YOWlPT.js","_assets/PhSpinner-BXooDYzU.js","_assets/PhTrash-Biq6rmmL.js","_assets/PhUser-CAgZSpGe.js","_assets/PhWallet-w25D16It.js","_assets/PhWarning-DPEydIPw.js","_assets/PhWarningCircle-BqjT745H.js","_assets/PhX-s-SmVExa.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{a as M,i as y,b as x,w as h}from"./lit-element-B3y9oplH.js";import{n as s,o as Z,a as A}from"./class-map-CxwNmq0D.js";import{r as E,v as c,d as I}from"./index-
|
|
2
|
+
import{a as M,i as y,b as x,w as h}from"./lit-element-B3y9oplH.js";import{n as s,o as Z,a as A}from"./class-map-CxwNmq0D.js";import{r as E,v as c,d as I}from"./index-D6jXV4v6.js";import{_ as r}from"./index-BK186nFF.js";const L=".",C={getSpacingStyles(t,e){if(Array.isArray(t))return t[e]?`var(--apkt-spacing-${t[e]})`:void 0;if(typeof t=="string")return`var(--apkt-spacing-${t})`},getFormattedDate(t){return new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric"}).format(t)},formatCurrency(t=0,e={}){const i=Number(t);return isNaN(i)?"$0.00":new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2,...e}).format(i)},getHostName(t){try{return new URL(t).hostname}catch{return""}},getTruncateString({string:t,charsStart:e,charsEnd:i,truncate:o}){return t.length<=e+i?t:o==="end"?`${t.substring(0,e)}...`:o==="start"?`...${t.substring(t.length-i)}`:`${t.substring(0,Math.floor(e))}...${t.substring(t.length-Math.floor(i))}`},generateAvatarColors(t){const i=t.toLowerCase().replace(/^0x/iu,"").replace(/[^a-f0-9]/gu,"").substring(0,6).padEnd(6,"0"),o=this.hexToRgb(i),n=getComputedStyle(document.documentElement).getPropertyValue("--w3m-border-radius-master"),a=100-3*Number(n==null?void 0:n.replace("px","")),p=`${a}% ${a}% at 65% 40%`,d=[];for(let u=0;u<5;u+=1){const m=this.tintColor(o,.15*u);d.push(`rgb(${m[0]}, ${m[1]}, ${m[2]})`)}return`
|
|
3
3
|
--local-color-1: ${d[0]};
|
|
4
4
|
--local-color-2: ${d[1]};
|
|
5
5
|
--local-color-3: ${d[2]};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as d,i as p,b as m}from"./lit-element-B3y9oplH.js";import{n as h}from"./class-map-CxwNmq0D.js";import{r as f,v as r}from"./index-
|
|
1
|
+
import{a as d,i as p,b as m}from"./lit-element-B3y9oplH.js";import{n as h}from"./class-map-CxwNmq0D.js";import{r as f,v as r}from"./index-D6jXV4v6.js";import{c as x}from"./index-BMDKd-Ff.js";const g=d`
|
|
2
2
|
:host {
|
|
3
3
|
display: flex;
|
|
4
4
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as r}from"./parseSignature-U7pY0kT6.js";import{B as y,E as f,a as v,b as A,F as S,W as I,d as F,e as R,f as x,g as C,p as B,l as N,n as P,p as D,h as U,s as w,z as L}from"./parseSignature-U7pY0kT6.js";import{I as H,c as k,a as z,p as q,w as V}from"./custom-uHB6JExE.js";import{h as s}from"./W3MFrameProviderSingleton-Dew4UHCH.js";import{U as G,c as j,f as W,s as K,w as Z,a as J}from"./W3MFrameProviderSingleton-Dew4UHCH.js";import{A as X,a as Y,B as _,b as $,C as aa,D as ra,E as oa,F as sa,c as ea,H as ta,I as ia,d as na,e as ca,f as da,g as Ea,h as pa,i as ua,j as la,k as ma,l as Ta,J as ga,L as ba,M as ha,m as ya,N as fa,n as va,o as Aa,P as Sa,p as Ia,q as Fa,R as Ra,r as xa,s as Ca,t as Ba,u as Na,S as Pa,v as Da,w as Ua,x as wa,T as La,y as Ma,z as Ha,G as ka,U as za,K as qa,O as Va,Q as Oa,V as Ga,W as ja,X as Wa,Y as Ka,Z as Za,_ as Ja,$ as Qa,a0 as Xa,a1 as Ya,a2 as _a,a3 as $a,a4 as ar,a5 as rr,a6 as or,a7 as sr,a8 as er,a9 as tr,aa as ir,ab as nr,ac as cr,ad as dr,ae as Er,af as pr,ag as ur,ah as lr,ai as mr,aj as Tr,ak as gr,al as br,am as hr,an as yr,ao as fr,ap as vr,a1 as Ar}from"./NetworkUtil-EoWQDMpU.js";import{A as Ir,a as Fr,b as Rr,c as xr,d as Cr,e as Br,f as Nr,g as Pr,h as Dr,i as Ur,j as wr,k as Lr,l as Mr,m as Hr,n as kr,o as zr,p as qr,B as Vr,q as Or,r as Gr,C as jr,s as Wr,t as Kr,u as Zr,v as Jr,w as Qr,x as Xr,y as Yr,z as _r,D as $r,E as ao,F as ro,G as oo,H as so,I as eo,J as to,K as io,L as no,M as co,N as Eo,O as po,P as uo,Q as lo,R as mo,S as To,T as go,U as bo,V as ho,W as yo,X as fo,Y as vo,Z as Ao,_ as So,$ as Io,a0 as Fo,a1 as Ro,a2 as xo,a3 as Co,a4 as Bo,a5 as No,a6 as Po,a7 as Do,a8 as Uo,a9 as wo,aa as Lo,ab as Mo,ac as Ho,ad as ko,ae as zo,af as qo,ag as Vo,ah as Oo,ai as Go,aj as jo,ak as Wo,al as Ko,am as Zo,an as Jo,ao as Qo,ap as Xo,aq as Yo,ar as _o,as as $o,at as as,au as rs,av as os,aw as ss,ax as es,ay as ts,az as is,aA as ns,aB as cs,aC as ds,aD as Es,aE as ps,aF as us,aG as ls,aH as ms,aI as Ts,aJ as gs,aK as bs,aL as hs,aM as ys,aN as fs,aM as vs,aO as As,aP as Ss,aQ as Is,aR as Fs,aS as Rs,aT as xs,aU as Cs,aV as Bs,aW as Ns,aX as Ps,aY as Ds,aZ as Us,a_ as ws,a$ as Ls,b0 as Ms,b1 as Hs,b2 as ks,b3 as zs,b4 as qs,aL as Vs,aM as Os,b4 as Gs,aN as js,aM as Ws,b5 as Ks,b6 as Zs,aA as Js}from"./sendRawTransaction-lz2apptP.js";import{I as Xs,a as Ys,b as _s,g as $s,h as ae,c as re,d as oe,e as se,p as ee,t as te,v as ie}from"./hashTypedData-BbQ-AHc3.js";import{d as ce,e as de,a as Ee}from"./localBatchGatewayRequest-CZC8IBaQ.js";import{ccipRequest as ue,ccipRequest as le,offchainLookup as me,offchainLookupAbiItem as Te,offchainLookupSignature as ge}from"./ccip-Db74k1Pr.js";import{d as t}from"./verifyHash-DDW5fWXv.js";import{e as he,p as ye,a as fe,s as ve,s as Ae}from"./verifyHash-DDW5fWXv.js";import{a as Ie,b as Fe,c as Re,s as xe,d as Ce}from"./serializeTransaction-CtWH-IFd.js";import"./secp256k1-CVOBgeVv.js";import"./dcl-schemas-Dr9BTjb7.js";import"./index-DI-3MKLG.js";import"./react-DehiWSvs.js";import"./sentry-973sfbO9.js";import"./index-B1Gnpvim.js";import"./events-DQ172AOg.js";import"./index-BqH8KAmH.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./browser-ponyfill-I5CKtKME.js";export{Ir as AbiConstructorNotFoundError,Fr as AbiConstructorParamsNotFoundError,Rr as AbiDecodingDataSizeTooSmallError,xr as AbiDecodingZeroDataError,Cr as AbiEncodingArrayLengthMismatchError,Br as AbiEncodingBytesSizeMismatchError,Nr as AbiEncodingLengthMismatchError,Pr as AbiErrorInputsNotFoundError,Dr as AbiErrorNotFoundError,Ur as AbiErrorSignatureNotFoundError,wr as AbiEventNotFoundError,Lr as AbiEventSignatureEmptyTopicsError,Mr as AbiEventSignatureNotFoundError,Hr as AbiFunctionNotFoundError,kr as AbiFunctionOutputsNotFoundError,zr as AbiFunctionSignatureNotFoundError,qr as AccountStateConflictError,X as AtomicReadyWalletRejectedUpgradeError,Y as AtomicityNotSupportedError,_ as BaseError,Vr as BaseFeeScalarError,Or as BlockNotFoundError,y as BundleFailedError,$ as BundleTooLargeError,Gr as BytesSizeMismatchError,jr as CallExecutionError,aa as ChainDisconnectedError,Wr as ChainDoesNotSupportContract,Kr as ChainMismatchError,Zr as ChainNotFoundError,Jr as CircularReferenceError,Qr as ClientChainNotConfiguredError,Xr as ContractFunctionExecutionError,Yr as ContractFunctionRevertedError,_r as ContractFunctionZeroDataError,$r as CounterfactualDeploymentFailedError,ao as DecodeLogDataMismatch,ro as DecodeLogTopicsMismatch,ra as DuplicateIdError,oo as Eip1559FeesNotSupportedError,f as EnsAvatarInvalidNftUriError,v as EnsAvatarUnsupportedNamespaceError,A as EnsAvatarUriResolutionError,so as EstimateGasExecutionError,oa as ExecutionRevertedError,sa as FeeCapTooHighError,ea as FeeCapTooLowError,S as FilterTypeNotSupportedError,ta as HttpRequestError,ia as InsufficientFundsError,na as IntegerOutOfRangeError,ca as InternalRpcError,da as IntrinsicGasTooHighError,Ea as IntrinsicGasTooLowError,eo as InvalidAbiDecodingTypeError,to as InvalidAbiEncodingTypeError,io as InvalidAbiItemError,no as InvalidAbiParametersError,co as InvalidAbiTypeParameterError,Eo as InvalidAddressError,po as InvalidArrayError,pa as InvalidBytesBooleanError,uo as InvalidChainIdError,H as InvalidDecimalNumberError,lo as InvalidDefinitionTypeError,Xs as InvalidDomainError,mo as InvalidFunctionModifierError,ua as InvalidHexBooleanError,la as InvalidInputRpcError,To as InvalidLegacyVError,go as InvalidModifierError,bo as InvalidParameterError,ma as InvalidParamsRpcError,ho as InvalidParenthesisError,Ys as InvalidPrimaryTypeError,Ta as InvalidRequestRpcError,yo as InvalidSerializableTransactionError,fo as InvalidSignatureError,vo as InvalidStorageKeySizeError,Ao as InvalidStructSignatureError,_s as InvalidStructTypeError,ga as JsonRpcVersionUnsupportedError,ba as LimitExceededRpcError,So as MaxFeePerGasTooLowError,ha as MethodNotFoundRpcError,ya as MethodNotSupportedRpcError,fa as NonceMaxValueError,va as NonceTooHighError,Aa as NonceTooLowError,Sa as ParseRpcError,Ia as ProviderDisconnectedError,Fa as ProviderRpcError,Io as RawContractError,Ra as ResourceNotFoundRpcError,xa as ResourceUnavailableRpcError,Ca as ResponseBodyTooLargeError,Ba as RpcError,Na as RpcRequestError,Pa as SizeExceedsPaddingSizeError,Da as SizeOverflowError,Ua as SliceOffsetOutOfBoundsError,Fo as SolidityProtectedKeywordError,Ro as StateAssignmentConflictError,wa as SwitchChainError,La as TimeoutError,Ma as TipAboveFeeCapError,xo as TransactionExecutionError,Co as TransactionNotFoundError,Bo as TransactionReceiptNotFoundError,Ha as TransactionRejectedRpcError,ka as TransactionTypeNotSupportedError,za as UnauthorizedProviderError,qa as UnknownBundleIdError,Va as UnknownNodeError,Oa as UnknownRpcError,No as UnknownSignatureError,Po as UnknownTypeError,Ga as UnsupportedChainIdError,ja as UnsupportedNonOptionalCapabilityError,Do as UnsupportedPackedAbiType,Wa as UnsupportedProviderMethodError,G as UrlRequiredError,Ka as UserRejectedRequestError,I as WaitForCallsStatusTimeoutError,Uo as WaitForTransactionReceiptTimeoutError,wo as assertCurrentChain,Lo as assertRequest,Ie as assertTransactionEIP1559,Fe as assertTransactionEIP2930,Re as assertTransactionLegacy,Mo as blobsToCommitments,Ho as blobsToProofs,Za as boolToBytes,Ja as boolToHex,ko as bytesToBigInt,zo as bytesToBool,Qa as bytesToHex,qo as bytesToNumber,Vo as bytesToString,ue as ccipFetch,le as ccipRequest,Oo as checksumAddress,Go as commitmentToVersionedHash,jo as commitmentsToVersionedHashes,Wo as concat,Ko as concatBytes,Zo as concatHex,k as createClient,F as createNonceManager,r as createPublicClient,j as createTransport,z as custom,Jo as decodeAbiParameters,Qo as decodeErrorResult,Xo as decodeEventLog,ce as decodeFunctionData,Yo as decodeFunctionResult,_o as defineBlock,t as defineChain,$o as defineTransaction,as as defineTransactionReceipt,rs as defineTransactionRequest,os as deploylessCallViaBytecodeBytecode,ss as deploylessCallViaFactoryBytecode,es as encodeAbiParameters,ts as encodeDeployData,de as encodeErrorResult,R as encodeEventTopics,is as encodeFunctionData,Ee as encodeFunctionResult,x as encodePacked,Xa as erc20Abi,Ya as erc6492SignatureValidatorAbi,ns as erc6492SignatureValidatorByteCode,C as ethAddress,_a as etherUnits,he as extendSchema,W as fallback,cs as formatBlock,ds as formatEther,$a as formatGwei,Es as formatLog,ps as formatTransaction,us as formatTransactionReceipt,ls as formatTransactionRequest,ar as formatUnits,rr as fromHex,ms as getAbiItem,Ts as getAddress,gs as getChainContractAddress,bs as getContractError,hs as getEventSelector,ys as getEventSignature,fs as getFunctionSelector,vs as getFunctionSignature,As as getTransactionType,$s as getTypesForEIP712Domain,or as gweiUnits,ae as hashDomain,re as hashMessage,oe as hashStruct,se as hashTypedData,sr as hexToBigInt,er as hexToBool,tr as hexToBytes,ir as hexToNumber,B as hexToSignature,nr as hexToString,s as http,Ss as isAddress,Is as isAddressEqual,cr as isHex,Fs as keccak256,N as labelhash,Rs as maxUint16,xs as maxUint256,dr as multicall3Abi,P as namehash,Er as numberToBytes,pr as numberToHex,me as offchainLookup,Te as offchainLookupAbiItem,ge as offchainLookupSignature,ur as pad,lr as padBytes,mr as padHex,Cs as parseAbi,ye as parseAbiItem,fe as parseAbiParameters,Bs as parseEventLogs,D as parseSignature,q as parseUnits,Ns as prepareEncodeFunctionData,ee as presignMessagePrefix,U as publicActions,Ps as recoverAddress,Ds as recoverPublicKey,Us as rpcTransactionType,xe as serializeAccessList,w as serializeErc6492Signature,ve as serializeSignature,Ce as serializeTransaction,ws as sha256,K as shouldThrow,Ae as signatureToHex,Tr as size,Ls as slice,Ms as sliceBytes,Hs as sliceHex,gr as stringToBytes,br as stringToHex,hr as stringify,ks as toBlobSidecars,zs as toBlobs,yr as toBytes,qs as toEventHash,Vs as toEventSelector,Os as toEventSignature,Gs as toFunctionHash,js as toFunctionSelector,Ws as toFunctionSignature,fr as toHex,te as toPrefixedMessage,Ks as toRlp,Zs as transactionType,vr as trim,Ar as universalSignatureValidatorAbi,Js as universalSignatureValidatorByteCode,ie as validateTypedData,V as withCache,Z as withRetry,J as withTimeout,L as zeroAddress};
|
|
1
|
+
import{c as r}from"./parseSignature-BL815h22.js";import{B as y,E as f,a as v,b as A,F as S,W as I,d as F,e as R,f as x,g as C,p as B,l as N,n as P,p as D,h as U,s as w,z as L}from"./parseSignature-BL815h22.js";import{I as H,c as k,a as z,p as q,w as V}from"./custom-D9XFQnk4.js";import{h as s}from"./W3MFrameProviderSingleton-CtKoZGPW.js";import{U as G,c as j,f as W,s as K,w as Z,a as J}from"./W3MFrameProviderSingleton-CtKoZGPW.js";import{A as X,a as Y,B as _,b as $,C as aa,D as ra,E as oa,F as sa,c as ea,H as ta,I as ia,d as na,e as ca,f as da,g as Ea,h as pa,i as ua,j as la,k as ma,l as Ta,J as ga,L as ba,M as ha,m as ya,N as fa,n as va,o as Aa,P as Sa,p as Ia,q as Fa,R as Ra,r as xa,s as Ca,t as Ba,u as Na,S as Pa,v as Da,w as Ua,x as wa,T as La,y as Ma,z as Ha,G as ka,U as za,K as qa,O as Va,Q as Oa,V as Ga,W as ja,X as Wa,Y as Ka,Z as Za,_ as Ja,$ as Qa,a0 as Xa,a1 as Ya,a2 as _a,a3 as $a,a4 as ar,a5 as rr,a6 as or,a7 as sr,a8 as er,a9 as tr,aa as ir,ab as nr,ac as cr,ad as dr,ae as Er,af as pr,ag as ur,ah as lr,ai as mr,aj as Tr,ak as gr,al as br,am as hr,an as yr,ao as fr,ap as vr,a1 as Ar}from"./NetworkUtil-EoWQDMpU.js";import{A as Ir,a as Fr,b as Rr,c as xr,d as Cr,e as Br,f as Nr,g as Pr,h as Dr,i as Ur,j as wr,k as Lr,l as Mr,m as Hr,n as kr,o as zr,p as qr,B as Vr,q as Or,r as Gr,C as jr,s as Wr,t as Kr,u as Zr,v as Jr,w as Qr,x as Xr,y as Yr,z as _r,D as $r,E as ao,F as ro,G as oo,H as so,I as eo,J as to,K as io,L as no,M as co,N as Eo,O as po,P as uo,Q as lo,R as mo,S as To,T as go,U as bo,V as ho,W as yo,X as fo,Y as vo,Z as Ao,_ as So,$ as Io,a0 as Fo,a1 as Ro,a2 as xo,a3 as Co,a4 as Bo,a5 as No,a6 as Po,a7 as Do,a8 as Uo,a9 as wo,aa as Lo,ab as Mo,ac as Ho,ad as ko,ae as zo,af as qo,ag as Vo,ah as Oo,ai as Go,aj as jo,ak as Wo,al as Ko,am as Zo,an as Jo,ao as Qo,ap as Xo,aq as Yo,ar as _o,as as $o,at as as,au as rs,av as os,aw as ss,ax as es,ay as ts,az as is,aA as ns,aB as cs,aC as ds,aD as Es,aE as ps,aF as us,aG as ls,aH as ms,aI as Ts,aJ as gs,aK as bs,aL as hs,aM as ys,aN as fs,aM as vs,aO as As,aP as Ss,aQ as Is,aR as Fs,aS as Rs,aT as xs,aU as Cs,aV as Bs,aW as Ns,aX as Ps,aY as Ds,aZ as Us,a_ as ws,a$ as Ls,b0 as Ms,b1 as Hs,b2 as ks,b3 as zs,b4 as qs,aL as Vs,aM as Os,b4 as Gs,aN as js,aM as Ws,b5 as Ks,b6 as Zs,aA as Js}from"./sendRawTransaction-Bp5LMxhF.js";import{I as Xs,a as Ys,b as _s,g as $s,h as ae,c as re,d as oe,e as se,p as ee,t as te,v as ie}from"./hashTypedData-Wfn9v-Hf.js";import{d as ce,e as de,a as Ee}from"./localBatchGatewayRequest-DQzEn08n.js";import{ccipRequest as ue,ccipRequest as le,offchainLookup as me,offchainLookupAbiItem as Te,offchainLookupSignature as ge}from"./ccip-DZw0ptqC.js";import{d as t}from"./verifyHash-tFRgslhI.js";import{e as he,p as ye,a as fe,s as ve,s as Ae}from"./verifyHash-tFRgslhI.js";import{a as Ie,b as Fe,c as Re,s as xe,d as Ce}from"./serializeTransaction-CcoTA2oD.js";import"./secp256k1-rc9cttcQ.js";import"./dcl-schemas-Dr9BTjb7.js";import"./index-DI-3MKLG.js";import"./react-DehiWSvs.js";import"./sentry-973sfbO9.js";import"./index-Cl0OwOQC.js";import"./events-DQ172AOg.js";import"./index-BK186nFF.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./browser-ponyfill-I5CKtKME.js";export{Ir as AbiConstructorNotFoundError,Fr as AbiConstructorParamsNotFoundError,Rr as AbiDecodingDataSizeTooSmallError,xr as AbiDecodingZeroDataError,Cr as AbiEncodingArrayLengthMismatchError,Br as AbiEncodingBytesSizeMismatchError,Nr as AbiEncodingLengthMismatchError,Pr as AbiErrorInputsNotFoundError,Dr as AbiErrorNotFoundError,Ur as AbiErrorSignatureNotFoundError,wr as AbiEventNotFoundError,Lr as AbiEventSignatureEmptyTopicsError,Mr as AbiEventSignatureNotFoundError,Hr as AbiFunctionNotFoundError,kr as AbiFunctionOutputsNotFoundError,zr as AbiFunctionSignatureNotFoundError,qr as AccountStateConflictError,X as AtomicReadyWalletRejectedUpgradeError,Y as AtomicityNotSupportedError,_ as BaseError,Vr as BaseFeeScalarError,Or as BlockNotFoundError,y as BundleFailedError,$ as BundleTooLargeError,Gr as BytesSizeMismatchError,jr as CallExecutionError,aa as ChainDisconnectedError,Wr as ChainDoesNotSupportContract,Kr as ChainMismatchError,Zr as ChainNotFoundError,Jr as CircularReferenceError,Qr as ClientChainNotConfiguredError,Xr as ContractFunctionExecutionError,Yr as ContractFunctionRevertedError,_r as ContractFunctionZeroDataError,$r as CounterfactualDeploymentFailedError,ao as DecodeLogDataMismatch,ro as DecodeLogTopicsMismatch,ra as DuplicateIdError,oo as Eip1559FeesNotSupportedError,f as EnsAvatarInvalidNftUriError,v as EnsAvatarUnsupportedNamespaceError,A as EnsAvatarUriResolutionError,so as EstimateGasExecutionError,oa as ExecutionRevertedError,sa as FeeCapTooHighError,ea as FeeCapTooLowError,S as FilterTypeNotSupportedError,ta as HttpRequestError,ia as InsufficientFundsError,na as IntegerOutOfRangeError,ca as InternalRpcError,da as IntrinsicGasTooHighError,Ea as IntrinsicGasTooLowError,eo as InvalidAbiDecodingTypeError,to as InvalidAbiEncodingTypeError,io as InvalidAbiItemError,no as InvalidAbiParametersError,co as InvalidAbiTypeParameterError,Eo as InvalidAddressError,po as InvalidArrayError,pa as InvalidBytesBooleanError,uo as InvalidChainIdError,H as InvalidDecimalNumberError,lo as InvalidDefinitionTypeError,Xs as InvalidDomainError,mo as InvalidFunctionModifierError,ua as InvalidHexBooleanError,la as InvalidInputRpcError,To as InvalidLegacyVError,go as InvalidModifierError,bo as InvalidParameterError,ma as InvalidParamsRpcError,ho as InvalidParenthesisError,Ys as InvalidPrimaryTypeError,Ta as InvalidRequestRpcError,yo as InvalidSerializableTransactionError,fo as InvalidSignatureError,vo as InvalidStorageKeySizeError,Ao as InvalidStructSignatureError,_s as InvalidStructTypeError,ga as JsonRpcVersionUnsupportedError,ba as LimitExceededRpcError,So as MaxFeePerGasTooLowError,ha as MethodNotFoundRpcError,ya as MethodNotSupportedRpcError,fa as NonceMaxValueError,va as NonceTooHighError,Aa as NonceTooLowError,Sa as ParseRpcError,Ia as ProviderDisconnectedError,Fa as ProviderRpcError,Io as RawContractError,Ra as ResourceNotFoundRpcError,xa as ResourceUnavailableRpcError,Ca as ResponseBodyTooLargeError,Ba as RpcError,Na as RpcRequestError,Pa as SizeExceedsPaddingSizeError,Da as SizeOverflowError,Ua as SliceOffsetOutOfBoundsError,Fo as SolidityProtectedKeywordError,Ro as StateAssignmentConflictError,wa as SwitchChainError,La as TimeoutError,Ma as TipAboveFeeCapError,xo as TransactionExecutionError,Co as TransactionNotFoundError,Bo as TransactionReceiptNotFoundError,Ha as TransactionRejectedRpcError,ka as TransactionTypeNotSupportedError,za as UnauthorizedProviderError,qa as UnknownBundleIdError,Va as UnknownNodeError,Oa as UnknownRpcError,No as UnknownSignatureError,Po as UnknownTypeError,Ga as UnsupportedChainIdError,ja as UnsupportedNonOptionalCapabilityError,Do as UnsupportedPackedAbiType,Wa as UnsupportedProviderMethodError,G as UrlRequiredError,Ka as UserRejectedRequestError,I as WaitForCallsStatusTimeoutError,Uo as WaitForTransactionReceiptTimeoutError,wo as assertCurrentChain,Lo as assertRequest,Ie as assertTransactionEIP1559,Fe as assertTransactionEIP2930,Re as assertTransactionLegacy,Mo as blobsToCommitments,Ho as blobsToProofs,Za as boolToBytes,Ja as boolToHex,ko as bytesToBigInt,zo as bytesToBool,Qa as bytesToHex,qo as bytesToNumber,Vo as bytesToString,ue as ccipFetch,le as ccipRequest,Oo as checksumAddress,Go as commitmentToVersionedHash,jo as commitmentsToVersionedHashes,Wo as concat,Ko as concatBytes,Zo as concatHex,k as createClient,F as createNonceManager,r as createPublicClient,j as createTransport,z as custom,Jo as decodeAbiParameters,Qo as decodeErrorResult,Xo as decodeEventLog,ce as decodeFunctionData,Yo as decodeFunctionResult,_o as defineBlock,t as defineChain,$o as defineTransaction,as as defineTransactionReceipt,rs as defineTransactionRequest,os as deploylessCallViaBytecodeBytecode,ss as deploylessCallViaFactoryBytecode,es as encodeAbiParameters,ts as encodeDeployData,de as encodeErrorResult,R as encodeEventTopics,is as encodeFunctionData,Ee as encodeFunctionResult,x as encodePacked,Xa as erc20Abi,Ya as erc6492SignatureValidatorAbi,ns as erc6492SignatureValidatorByteCode,C as ethAddress,_a as etherUnits,he as extendSchema,W as fallback,cs as formatBlock,ds as formatEther,$a as formatGwei,Es as formatLog,ps as formatTransaction,us as formatTransactionReceipt,ls as formatTransactionRequest,ar as formatUnits,rr as fromHex,ms as getAbiItem,Ts as getAddress,gs as getChainContractAddress,bs as getContractError,hs as getEventSelector,ys as getEventSignature,fs as getFunctionSelector,vs as getFunctionSignature,As as getTransactionType,$s as getTypesForEIP712Domain,or as gweiUnits,ae as hashDomain,re as hashMessage,oe as hashStruct,se as hashTypedData,sr as hexToBigInt,er as hexToBool,tr as hexToBytes,ir as hexToNumber,B as hexToSignature,nr as hexToString,s as http,Ss as isAddress,Is as isAddressEqual,cr as isHex,Fs as keccak256,N as labelhash,Rs as maxUint16,xs as maxUint256,dr as multicall3Abi,P as namehash,Er as numberToBytes,pr as numberToHex,me as offchainLookup,Te as offchainLookupAbiItem,ge as offchainLookupSignature,ur as pad,lr as padBytes,mr as padHex,Cs as parseAbi,ye as parseAbiItem,fe as parseAbiParameters,Bs as parseEventLogs,D as parseSignature,q as parseUnits,Ns as prepareEncodeFunctionData,ee as presignMessagePrefix,U as publicActions,Ps as recoverAddress,Ds as recoverPublicKey,Us as rpcTransactionType,xe as serializeAccessList,w as serializeErc6492Signature,ve as serializeSignature,Ce as serializeTransaction,ws as sha256,K as shouldThrow,Ae as signatureToHex,Tr as size,Ls as slice,Ms as sliceBytes,Hs as sliceHex,gr as stringToBytes,br as stringToHex,hr as stringify,ks as toBlobSidecars,zs as toBlobs,yr as toBytes,qs as toEventHash,Vs as toEventSelector,Os as toEventSignature,Gs as toFunctionHash,js as toFunctionSelector,Ws as toFunctionSignature,fr as toHex,te as toPrefixedMessage,Ks as toRlp,Zs as transactionType,vr as trim,Ar as universalSignatureValidatorAbi,Js as universalSignatureValidatorByteCode,ie as validateTypedData,V as withCache,Z as withRetry,J as withTimeout,L as zeroAddress};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/in-app-wallet-calls-
|
|
2
|
-
import{_ as b}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/in-app-wallet-calls-Bd6X0KWG.js","_assets/wait-for-tx-receipt-BlFYuYR0.js","_assets/transactionReceipt-Bp1hf_iD.js","_assets/prepare-contract-call-BnXbUbQT.js","_assets/utils-B9hEgCzc.js","_assets/sentry-973sfbO9.js","_assets/react-DehiWSvs.js","_assets/to-serializable-transaction-Bs3gRQ4f.js","_assets/index-BK186nFF.js","_assets/dcl-schemas-Dr9BTjb7.js","_assets/ethers-CtNGBird.js","_assets/intl-CBcMB1D2.js","_assets/index-D-NhBWWr.css","_assets/transaction-BRB0QRZP.js","_assets/sleep-mAKpSMLY.js","_assets/send-batch-transaction-IhphBGXV.js","_assets/send-transaction-DAsAIcLp.js","_assets/execute-mSR8LGc4.js","_assets/detectExtension-DEjVJeUh.js","_assets/eth_getTransactionCount-riJ8hG2K.js","_assets/index-DtNkXFsH.js","_assets/signing-Dqg6cmff.js","_assets/get-bytecode-knYex1Eu.js","_assets/send-eip712-transaction-D1F2l2MF.js","_assets/eth_sendRawTransaction-DPdnXbFR.js","_assets/sha256--PXCNFKm.js","_assets/linkAccount-BodpWbRq.js","_assets/wallets-0QMnCoJB.js","_assets/store-CraP4F4Y.js","_assets/hashTypedData-C5G1DAop.js","_assets/index-Cl0OwOQC.js","_assets/events-DQ172AOg.js","_assets/index-BqMHKneq.js","_assets/index-DI-3MKLG.js","_assets/index-nibyPLVP.js","_assets/index-CJdot1dH.js","_assets/index-yp3Medz4.js","_assets/ethereum-CliiIOgc.js","_assets/types-DC0Zmj1B.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as b}from"./index-BK186nFF.js";import{e as R}from"./ethereum-CliiIOgc.js";import{s as M}from"./types-DC0Zmj1B.js";import{f as D,e as I,a as v,w as B}from"./utils-B9hEgCzc.js";import{p as W,g as V}from"./get-bytecode-knYex1Eu.js";import{b as F,g as H,t as O}from"./to-serializable-transaction-Bs3gRQ4f.js";import{r as $,e as N}from"./execute-mSR8LGc4.js";import{g as f,a4 as U,f as k,T as z,s as g,h as y,c as j}from"./prepare-contract-call-BnXbUbQT.js";const Ae="0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c",q="0x85e23b94e7F5E9cC1fF78BCe78cfb15B81f0DF00",Y="0x4be0ddfebca9a5a4a617dee4dece99e7c862dceb",w="0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",Z="0x0000000071727De22E5E9d8BAf0edAc6f37da032",K=50000n,Ce=t=>J(t||w)==="v0.7"?Y:q,E=t=>{const e=D().bundler;return e.startsWith("localhost:")?`http://${e}/v2?chain=${t.id}`:`https://${t.id}.${e}/v2`},J=t=>{const e=f(t);if(e===w)return"v0.6";if(e===Z)return"v0.7";throw new Error("Unknown paymaster version")};function Q(t={}){return U({filters:t,signature:"event UserOperationRevertReason(bytes32 indexed userOpHash, address indexed sender, uint256 nonce, bytes revertReason)"})}function X(t={}){return U({filters:t,signature:"event PostOpRevertReason(bytes32 indexed userOpHash, address indexed sender, uint256 nonce, bytes revertReason)"})}function ee(t){const{receipt:e}=t,n={...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs,status:e.status,to:e.to?e.to:null,transactionHash:e.transactionHash,transactionIndex:e.transactionIndex,type:e.type};return e.blobGasPrice&&(n.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(n.blobGasUsed=BigInt(e.blobGasUsed)),{...t,actualGasCost:BigInt(t.actualGasCost),actualGasUsed:BigInt(t.actualGasUsed),nonce:BigInt(t.nonce),receipt:n,userOpHash:t.userOpHash}}const xe=()=>{const t=BigInt(Math.floor(Math.random()*4294967296)),e=BigInt(Math.floor(Math.random()*4294967296)),n=BigInt(Math.floor(Math.random()*4294967296)),r=BigInt(Math.floor(Math.random()*4294967296)),o=BigInt(Math.floor(Math.random()*4294967296)),p=BigInt(Math.floor(Math.random()*4294967296));return t<<BigInt(160)|e<<BigInt(128)|n<<BigInt(96)|r<<BigInt(64)|o<<BigInt(32)|p};function _(t){return Object.fromEntries(Object.entries(t).map(([e,n])=>[e,n==null||k(n)?n:z(n)]))}async function Ie(t){return d({...t,operation:"eth_sendUserOperation",params:[_(t.userOp),t.options.entrypointAddress??w]})}async function Ue(t,e){const n=await d({...t,operation:"eth_estimateUserOperationGas",params:[_(t.userOp),t.options.entrypointAddress??w,e??{}]});return{callGasLimit:y(n.callGasLimit)+K,paymasterPostOpGasLimit:n.paymasterPostOpGasLimit!==void 0?y(n.paymasterPostOpGasLimit):void 0,paymasterVerificationGasLimit:n.paymasterVerificationGasLimit!==void 0?y(n.paymasterVerificationGasLimit):void 0,preVerificationGas:y(n.preVerificationGas),verificationGas:n.verificationGas!==void 0?y(n.verificationGas):void 0,verificationGasLimit:y(n.verificationGasLimit)}}async function Ee(t){const e=await d({...t,operation:"thirdweb_getUserOperationGasPrice",params:[]});return{maxFeePerGas:y(e.maxFeePerGas),maxPriorityFeePerGas:y(e.maxPriorityFeePerGas)}}async function _e(t){var n,r;const e=await te(t);if(e){if(e.success===!1){const p=(r=(n=W({events:[Q(),X()],logs:e.logs})[0])==null?void 0:n.args)==null?void 0:r.revertReason;if(!p)throw new Error(`UserOp failed at txHash: ${e.receipt.transactionHash}`);const a=F({data:p});throw new Error(`UserOp failed with reason: '${a.args.join(",")}' at txHash: ${e.receipt.transactionHash}`)}return e.receipt}}async function te(t){const e=await d({operation:"eth_getUserOperationReceipt",options:t,params:[t.userOpHash]});if(e)return ee(e)}async function Pe(t){const e=await d({operation:"zk_paymasterData",options:t.options,params:[t.transaction]});return{paymaster:e.paymaster,paymasterInput:e.paymasterInput}}async function ne(t){const e=await d({...t,operation:"tw_execute",params:[t.eoaAddress,t.wrappedCalls,t.signature,t.authorization]});if(!e.queueId)throw new Error(`Error executing 7702 transaction: ${g(e)}`);return{transactionId:e.queueId}}async function ae(t){return{transactionHash:(await d({...t,operation:"tw_getTransactionHash",params:[t.transactionId]})).transactionHash}}async function Ge(t){return{transactionHash:(await d({operation:"zk_broadcastTransaction",options:t.options,params:[{...t.transaction,signedTransaction:t.signedTransaction}]})).transactionHash}}async function d(t){const{options:e,operation:n,params:r}=t,o=e.bundlerUrl??E(e.chain),a=await I(e.client)(o,{useAuthToken:!0,body:g({id:1,jsonrpc:"2.0",method:n,params:r}),headers:{"Content-Type":"application/json"},method:"POST"}),i=await a.json();if(!a.ok||i.error){let s=i.error||a.statusText;typeof s=="object"&&(s=g(s));const u=i.code||"UNKNOWN";throw new Error(`${n} error: ${s}
|
|
3
3
|
Status: ${a.status}
|
|
4
|
-
Code: ${u}`)}return i.result}async function ie(t){const{client:e,chain:n,bundlerUrl:r}=t,o=r??E(n),p=`delegation-contract:${o}`;return B(async()=>{var u;const i=await I(e)(o,{useAuthToken:!0,body:g({id:1,jsonrpc:"2.0",method:"tw_getDelegationContract",params:[]}),headers:{"Content-Type":"application/json"},method:"POST"});if(!i.ok)throw new Error(`Failed to fetch delegation contract: ${i.status} ${i.statusText}`);const s=await i.json();if(s.error)throw new Error(`Delegation contract RPC error: ${JSON.stringify(s.error)}`);if(!((u=s.result)!=null&&u.delegationContract))throw new Error("Invalid response: missing delegationContract in result");return s.result.delegationContract},{cacheKey:p,cacheTime:1440*60*1e3})}const se=t=>{const{client:e,adminAccount:n,sponsorGas:r}=t,o=async a=>{var A,C,x;const i=a[0];if(!i)throw new Error("No transactions provided");const s=v(i.chainId),u=H({address:n.address,chain:s,client:e,abi:ue});let c=(A=i.authorizationList)==null?void 0:A[0];const m=await ie({client:e,chain:s});if(c&&((C=c.address)==null?void 0:C.toLowerCase())!==m.toLowerCase())throw new Error(`Authorization address does not match expected delegation contract address. Expected ${m} but got ${c.address}`);if(!c&&!await oe(u,m)){let T=i.nonce?BigInt(i.nonce):BigInt(await re({client:e,address:n.address,chain:s}));T+=r?0n:1n;const h=await((x=n.signAuthorization)==null?void 0:x.call(n,{address:f(m),chainId:i.chainId,nonce:T}));if(!h)throw new Error("Failed to sign authorization");c=h}if(r){const l={calls:a.map(L=>({data:L.data??"0x",target:f(L.to??""),value:L.value??0n})),uid:$()},T=await n.signTypedData({domain:{chainId:i.chainId,name:"MinimalAccount",verifyingContract:u.address,version:"1"},message:l,primaryType:"WrappedCalls",types:{Call:[{name:"target",type:"address"},{name:"value",type:"uint256"},{name:"data",type:"bytes"}],WrappedCalls:[{name:"calls",type:"Call[]"},{name:"uid",type:"bytes32"}]}}),h=await ne({authorization:c,eoaAddress:f(n.address),options:{chain:v(i.chainId),client:e},signature:T,wrappedCalls:l});return{transactionHash:await pe({options:{chain:v(i.chainId),client:e},transactionId:h.transactionId})}}const S=N({calls:a.map(l=>({data:l.data??"0x",target:f(l.to??""),value:l.value??0n})),contract:u,overrides:{authorizationList:c?[c]:void 0,value:a.reduce((l,T)=>l+(T.value??0n),0n)}}),G=await O({from:n.address,transaction:S});return n.sendTransaction(G)},p={address:n.address,sendBatchTransaction:async a=>o(a),sendTransaction:async a=>o([a]),signMessage:({message:a,originalMessage:i,chainId:s})=>n.signMessage({chainId:s,message:a,originalMessage:i}),signTypedData:a=>n.signTypedData(a),sendCalls:async a=>{const{inAppWalletSendCalls:i}=await b(async()=>{const{inAppWalletSendCalls:S}=await import("./in-app-wallet-calls-yAvikrwR.js");return{inAppWalletSendCalls:S}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18])),s=a.calls[0];if(!s)throw new Error("No calls to send");const u=s.client,c=s.chain||a.chain,m=await i({account:p,calls:a.calls,chain:c});return{chain:c,client:u,id:m}},getCallsStatus:async a=>{const{inAppWalletGetCallsStatus:i}=await b(async()=>{const{inAppWalletGetCallsStatus:s}=await import("./in-app-wallet-calls-yAvikrwR.js");return{inAppWalletGetCallsStatus:s}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]));return i(a)},getCallsStatusRaw:async a=>{const{inAppWalletGetCallsStatusRaw:i}=await b(async()=>{const{inAppWalletGetCallsStatusRaw:s}=await import("./in-app-wallet-calls-yAvikrwR.js");return{inAppWalletGetCallsStatusRaw:s}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]));return i(a)},getCapabilities:async a=>({[a.chainId??1]:{atomic:{status:"supported"},paymasterService:{supported:r??!1}}})};return p};async function re(t){const{client:e,address:n,chain:r}=t,o=j({chain:r,client:e});return await b(async()=>{const{eth_getTransactionCount:a}=await import("./eth_getTransactionCount-riJ8hG2K.js");return{eth_getTransactionCount:a}},__vite__mapDeps([19,3,4,5,6])).then(({eth_getTransactionCount:a})=>a(o,{address:f(n),blockTag:"pending"}))}async function oe(t,e){const n=await V(t),r=n.length>0&&n.startsWith("0xef0100"),o=`0x${n.slice(8,48)}`;return r&&o.toLowerCase()===e.toLowerCase()}async function pe(t){const e=t.timeoutMs||3e5,n=t.intervalMs||1e3,r=Date.now()+e;for(;Date.now()<r;){const o=await ae({options:t.options,transactionId:t.transactionId});if(o.transactionHash)return o.transactionHash;await new Promise(p=>setTimeout(p,n))}throw new Error(`Timeout waiting for transaction to be mined on chain ${t.options.chain.id} with transactionId: ${t.transactionId}`)}const ue=[{type:"receive",stateMutability:"payable"},{type:"function",name:"createSessionWithSig",inputs:[{name:"sessionSpec",type:"tuple",internalType:"struct SessionLib.SessionSpec",components:[{name:"signer",type:"address",internalType:"address"},{name:"isWildcard",type:"bool",internalType:"bool"},{name:"expiresAt",type:"uint256",internalType:"uint256"},{name:"callPolicies",type:"tuple[]",internalType:"struct SessionLib.CallSpec[]",components:[{name:"target",type:"address",internalType:"address"},{name:"selector",type:"bytes4",internalType:"bytes4"},{name:"maxValuePerUse",type:"uint256",internalType:"uint256"},{name:"valueLimit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]},{name:"constraints",type:"tuple[]",internalType:"struct SessionLib.Constraint[]",components:[{name:"condition",type:"uint8",internalType:"enum SessionLib.Condition"},{name:"index",type:"uint64",internalType:"uint64"},{name:"refValue",type:"bytes32",internalType:"bytes32"},{name:"limit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]}]}]},{name:"transferPolicies",type:"tuple[]",internalType:"struct SessionLib.TransferSpec[]",components:[{name:"target",type:"address",internalType:"address"},{name:"maxValuePerUse",type:"uint256",internalType:"uint256"},{name:"valueLimit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]}]},{name:"uid",type:"bytes32",internalType:"bytes32"}]},{name:"signature",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"eip712Domain",inputs:[],outputs:[{name:"fields",type:"bytes1",internalType:"bytes1"},{name:"name",type:"string",internalType:"string"},{name:"version",type:"string",internalType:"string"},{name:"chainId",type:"uint256",internalType:"uint256"},{name:"verifyingContract",type:"address",internalType:"address"},{name:"salt",type:"bytes32",internalType:"bytes32"},{name:"extensions",type:"uint256[]",internalType:"uint256[]"}],stateMutability:"view"},{type:"function",name:"execute",inputs:[{name:"calls",type:"tuple[]",internalType:"struct Call[]",components:[{name:"target",type:"address",internalType:"address"},{name:"value",type:"uint256",internalType:"uint256"},{name:"data",type:"bytes",internalType:"bytes"}]}],outputs:[],stateMutability:"payable"},{type:"function",name:"executeWithSig",inputs:[{name:"wrappedCalls",type:"tuple",internalType:"struct WrappedCalls",components:[{name:"calls",type:"tuple[]",internalType:"struct Call[]",components:[{name:"target",type:"address",internalType:"address"},{name:"value",type:"uint256",internalType:"uint256"},{name:"data",type:"bytes",internalType:"bytes"}]},{name:"uid",type:"bytes32",internalType:"bytes32"}]},{name:"signature",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"payable"},{type:"function",name:"getCallPoliciesForSigner",inputs:[{name:"signer",type:"address",internalType:"address"}],outputs:[{name:"",type:"tuple[]",internalType:"struct SessionLib.CallSpec[]",components:[{name:"target",type:"address",internalType:"address"},{name:"selector",type:"bytes4",internalType:"bytes4"},{name:"maxValuePerUse",type:"uint256",internalType:"uint256"},{name:"valueLimit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]},{name:"constraints",type:"tuple[]",internalType:"struct SessionLib.Constraint[]",components:[{name:"condition",type:"uint8",internalType:"enum SessionLib.Condition"},{name:"index",type:"uint64",internalType:"uint64"},{name:"refValue",type:"bytes32",internalType:"bytes32"},{name:"limit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]}]}]}],stateMutability:"view"},{type:"function",name:"getSessionExpirationForSigner",inputs:[{name:"signer",type:"address",internalType:"address"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"getSessionStateForSigner",inputs:[{name:"signer",type:"address",internalType:"address"}],outputs:[{name:"",type:"tuple",internalType:"struct SessionLib.SessionState",components:[{name:"transferValue",type:"tuple[]",internalType:"struct SessionLib.LimitState[]",components:[{name:"remaining",type:"uint256",internalType:"uint256"},{name:"target",type:"address",internalType:"address"},{name:"selector",type:"bytes4",internalType:"bytes4"},{name:"index",type:"uint256",internalType:"uint256"}]},{name:"callValue",type:"tuple[]",internalType:"struct SessionLib.LimitState[]",components:[{name:"remaining",type:"uint256",internalType:"uint256"},{name:"target",type:"address",internalType:"address"},{name:"selector",type:"bytes4",internalType:"bytes4"},{name:"index",type:"uint256",internalType:"uint256"}]},{name:"callParams",type:"tuple[]",internalType:"struct SessionLib.LimitState[]",components:[{name:"remaining",type:"uint256",internalType:"uint256"},{name:"target",type:"address",internalType:"address"},{name:"selector",type:"bytes4",internalType:"bytes4"},{name:"index",type:"uint256",internalType:"uint256"}]}]}],stateMutability:"view"},{type:"function",name:"getTransferPoliciesForSigner",inputs:[{name:"signer",type:"address",internalType:"address"}],outputs:[{name:"",type:"tuple[]",internalType:"struct SessionLib.TransferSpec[]",components:[{name:"target",type:"address",internalType:"address"},{name:"maxValuePerUse",type:"uint256",internalType:"uint256"},{name:"valueLimit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]}]}],stateMutability:"view"},{type:"function",name:"isWildcardSigner",inputs:[{name:"signer",type:"address",internalType:"address"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"view"},{type:"function",name:"onERC1155BatchReceived",inputs:[{name:"",type:"address",internalType:"address"},{name:"",type:"address",internalType:"address"},{name:"",type:"uint256[]",internalType:"uint256[]"},{name:"",type:"uint256[]",internalType:"uint256[]"},{name:"",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"nonpayable"},{type:"function",name:"onERC1155Received",inputs:[{name:"",type:"address",internalType:"address"},{name:"",type:"address",internalType:"address"},{name:"",type:"uint256",internalType:"uint256"},{name:"",type:"uint256",internalType:"uint256"},{name:"",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"nonpayable"},{type:"function",name:"onERC721Received",inputs:[{name:"",type:"address",internalType:"address"},{name:"",type:"address",internalType:"address"},{name:"",type:"uint256",internalType:"uint256"},{name:"",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"nonpayable"},{type:"function",name:"supportsInterface",inputs:[{name:"interfaceId",type:"bytes4",internalType:"bytes4"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"view"},{type:"event",name:"Executed",inputs:[{name:"to",type:"address",indexed:!0,internalType:"address"},{name:"value",type:"uint256",indexed:!1,internalType:"uint256"},{name:"data",type:"bytes",indexed:!1,internalType:"bytes"}],anonymous:!1},{type:"event",name:"SessionCreated",inputs:[{name:"signer",type:"address",indexed:!0,internalType:"address"},{name:"sessionSpec",type:"tuple",indexed:!1,internalType:"struct SessionLib.SessionSpec",components:[{name:"signer",type:"address",internalType:"address"},{name:"isWildcard",type:"bool",internalType:"bool"},{name:"expiresAt",type:"uint256",internalType:"uint256"},{name:"callPolicies",type:"tuple[]",internalType:"struct SessionLib.CallSpec[]",components:[{name:"target",type:"address",internalType:"address"},{name:"selector",type:"bytes4",internalType:"bytes4"},{name:"maxValuePerUse",type:"uint256",internalType:"uint256"},{name:"valueLimit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]},{name:"constraints",type:"tuple[]",internalType:"struct SessionLib.Constraint[]",components:[{name:"condition",type:"uint8",internalType:"enum SessionLib.Condition"},{name:"index",type:"uint64",internalType:"uint64"},{name:"refValue",type:"bytes32",internalType:"bytes32"},{name:"limit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]}]}]},{name:"transferPolicies",type:"tuple[]",internalType:"struct SessionLib.TransferSpec[]",components:[{name:"target",type:"address",internalType:"address"},{name:"maxValuePerUse",type:"uint256",internalType:"uint256"},{name:"valueLimit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]}]},{name:"uid",type:"bytes32",internalType:"bytes32"}]}],anonymous:!1},{type:"event",name:"ValueReceived",inputs:[{name:"from",type:"address",indexed:!0,internalType:"address"},{name:"value",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"error",name:"AllowanceExceeded",inputs:[{name:"allowanceUsage",type:"uint256",internalType:"uint256"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint64",internalType:"uint64"}]},{type:"error",name:"CallPolicyViolated",inputs:[{name:"target",type:"address",internalType:"address"},{name:"selector",type:"bytes4",internalType:"bytes4"}]},{type:"error",name:"CallReverted",inputs:[]},{type:"error",name:"ConditionFailed",inputs:[{name:"param",type:"bytes32",internalType:"bytes32"},{name:"refValue",type:"bytes32",internalType:"bytes32"},{name:"condition",type:"uint8",internalType:"uint8"}]},{type:"error",name:"InvalidDataLength",inputs:[{name:"actualLength",type:"uint256",internalType:"uint256"},{name:"expectedLength",type:"uint256",internalType:"uint256"}]},{type:"error",name:"InvalidSignature",inputs:[{name:"msgSender",type:"address",internalType:"address"},{name:"thisAddress",type:"address",internalType:"address"}]},{type:"error",name:"LifetimeUsageExceeded",inputs:[{name:"lifetimeUsage",type:"uint256",internalType:"uint256"},{name:"limit",type:"uint256",internalType:"uint256"}]},{type:"error",name:"MaxValueExceeded",inputs:[{name:"value",type:"uint256",internalType:"uint256"},{name:"maxValuePerUse",type:"uint256",internalType:"uint256"}]},{type:"error",name:"NoCallsToExecute",inputs:[]},{type:"error",name:"SessionExpired",inputs:[]},{type:"error",name:"SessionExpiresTooSoon",inputs:[]},{type:"error",name:"SessionZeroSigner",inputs:[]},{type:"error",name:"TransferPolicyViolated",inputs:[{name:"target",type:"address",internalType:"address"}]},{type:"error",name:"UIDAlreadyProcessed",inputs:[]}];function ce(t){return t.id==="inApp"||t.id==="embedded"}async function le(t,e,n){var p,a,i,s;if(((p=e==null?void 0:e.auth)==null?void 0:p.mode)!=="popup"&&((a=e==null?void 0:e.auth)==null?void 0:a.mode)!==void 0&&n.authenticateWithRedirect){const u=t.strategy;M.includes(u)&&await n.authenticateWithRedirect(u,(i=e==null?void 0:e.auth)==null?void 0:i.mode,(s=e==null?void 0:e.auth)==null?void 0:s.redirectUrl)}const o=(await n.connect(t)).user.account;return P({authAccount:o,client:t.client,createOptions:e,desiredChain:t.chain})}async function ye(t,e,n){t.authResult&&n.loginWithAuthToken&&await n.loginWithAuthToken(t.authResult);const r=await me(n);if(!r)throw new Error("Failed to authenticate user.");const o=r.account;return P({authAccount:o,client:t.client,createOptions:e,desiredChain:t.chain})}async function de(t){const{connectSmartAccount:e}=await b(async()=>{const{connectSmartAccount:n}=await import("./index-DTMwjYEd.js");return{connectSmartAccount:n}},__vite__mapDeps([20,8,6,5,9,10,11,12,13,3,4,7,17,18,21,22,23,24,25,16,26,27,28,29,30,31,32,33,34,35,36,37,38]));return e({chain:t.chain,client:t.client,personalAccount:t.authAccount},t.smartAccountOptions)}async function me(t){const e=await t.getUser();switch(e.status){case"Logged In, Wallet Initialized":return e}}async function P(t){const{createOptions:e,authAccount:n,desiredChain:r,client:o}=t;let p,a;const i=e&&"executionMode"in e?e.executionMode:void 0;if(i&&(i.mode==="EIP4337"?p=i.smartAccount:i.mode==="EIP7702"&&(a=i)),e&&"smartAccount"in e&&(e!=null&&e.smartAccount)&&(p=e.smartAccount),p){const[s,u]=await de({authAccount:n,chain:r,client:o,smartAccountOptions:p});return{account:s,adminAccount:n,chain:u}}if(a){const s=r;if(!s)throw new Error("Chain is required for EIP-7702 execution, pass a chain when connecting the inAppWallet.");return{account:se({adminAccount:n,client:o,sponsorGas:a.sponsorGas}),adminAccount:n,chain:s}}return{account:n,chain:r||R}}const Re=Object.freeze(Object.defineProperty({__proto__:null,autoConnectInAppWallet:ye,connectInAppWallet:le,isInAppWallet:ce},Symbol.toStringTag,{value:"Module"}));export{Ae as D,w as E,J as a,_e as b,Ee as c,xe as d,Ue as e,Z as f,E as g,_ as h,Ce as i,Pe as j,Ge as k,Ie as l,ce as m,Re as n};
|
|
4
|
+
Code: ${u}`)}return i.result}async function ie(t){const{client:e,chain:n,bundlerUrl:r}=t,o=r??E(n),p=`delegation-contract:${o}`;return B(async()=>{var u;const i=await I(e)(o,{useAuthToken:!0,body:g({id:1,jsonrpc:"2.0",method:"tw_getDelegationContract",params:[]}),headers:{"Content-Type":"application/json"},method:"POST"});if(!i.ok)throw new Error(`Failed to fetch delegation contract: ${i.status} ${i.statusText}`);const s=await i.json();if(s.error)throw new Error(`Delegation contract RPC error: ${JSON.stringify(s.error)}`);if(!((u=s.result)!=null&&u.delegationContract))throw new Error("Invalid response: missing delegationContract in result");return s.result.delegationContract},{cacheKey:p,cacheTime:1440*60*1e3})}const se=t=>{const{client:e,adminAccount:n,sponsorGas:r}=t,o=async a=>{var A,C,x;const i=a[0];if(!i)throw new Error("No transactions provided");const s=v(i.chainId),u=H({address:n.address,chain:s,client:e,abi:ue});let c=(A=i.authorizationList)==null?void 0:A[0];const m=await ie({client:e,chain:s});if(c&&((C=c.address)==null?void 0:C.toLowerCase())!==m.toLowerCase())throw new Error(`Authorization address does not match expected delegation contract address. Expected ${m} but got ${c.address}`);if(!c&&!await oe(u,m)){let T=i.nonce?BigInt(i.nonce):BigInt(await re({client:e,address:n.address,chain:s}));T+=r?0n:1n;const h=await((x=n.signAuthorization)==null?void 0:x.call(n,{address:f(m),chainId:i.chainId,nonce:T}));if(!h)throw new Error("Failed to sign authorization");c=h}if(r){const l={calls:a.map(L=>({data:L.data??"0x",target:f(L.to??""),value:L.value??0n})),uid:$()},T=await n.signTypedData({domain:{chainId:i.chainId,name:"MinimalAccount",verifyingContract:u.address,version:"1"},message:l,primaryType:"WrappedCalls",types:{Call:[{name:"target",type:"address"},{name:"value",type:"uint256"},{name:"data",type:"bytes"}],WrappedCalls:[{name:"calls",type:"Call[]"},{name:"uid",type:"bytes32"}]}}),h=await ne({authorization:c,eoaAddress:f(n.address),options:{chain:v(i.chainId),client:e},signature:T,wrappedCalls:l});return{transactionHash:await pe({options:{chain:v(i.chainId),client:e},transactionId:h.transactionId})}}const S=N({calls:a.map(l=>({data:l.data??"0x",target:f(l.to??""),value:l.value??0n})),contract:u,overrides:{authorizationList:c?[c]:void 0,value:a.reduce((l,T)=>l+(T.value??0n),0n)}}),G=await O({from:n.address,transaction:S});return n.sendTransaction(G)},p={address:n.address,sendBatchTransaction:async a=>o(a),sendTransaction:async a=>o([a]),signMessage:({message:a,originalMessage:i,chainId:s})=>n.signMessage({chainId:s,message:a,originalMessage:i}),signTypedData:a=>n.signTypedData(a),sendCalls:async a=>{const{inAppWalletSendCalls:i}=await b(async()=>{const{inAppWalletSendCalls:S}=await import("./in-app-wallet-calls-Bd6X0KWG.js");return{inAppWalletSendCalls:S}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18])),s=a.calls[0];if(!s)throw new Error("No calls to send");const u=s.client,c=s.chain||a.chain,m=await i({account:p,calls:a.calls,chain:c});return{chain:c,client:u,id:m}},getCallsStatus:async a=>{const{inAppWalletGetCallsStatus:i}=await b(async()=>{const{inAppWalletGetCallsStatus:s}=await import("./in-app-wallet-calls-Bd6X0KWG.js");return{inAppWalletGetCallsStatus:s}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]));return i(a)},getCallsStatusRaw:async a=>{const{inAppWalletGetCallsStatusRaw:i}=await b(async()=>{const{inAppWalletGetCallsStatusRaw:s}=await import("./in-app-wallet-calls-Bd6X0KWG.js");return{inAppWalletGetCallsStatusRaw:s}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]));return i(a)},getCapabilities:async a=>({[a.chainId??1]:{atomic:{status:"supported"},paymasterService:{supported:r??!1}}})};return p};async function re(t){const{client:e,address:n,chain:r}=t,o=j({chain:r,client:e});return await b(async()=>{const{eth_getTransactionCount:a}=await import("./eth_getTransactionCount-riJ8hG2K.js");return{eth_getTransactionCount:a}},__vite__mapDeps([19,3,4,5,6])).then(({eth_getTransactionCount:a})=>a(o,{address:f(n),blockTag:"pending"}))}async function oe(t,e){const n=await V(t),r=n.length>0&&n.startsWith("0xef0100"),o=`0x${n.slice(8,48)}`;return r&&o.toLowerCase()===e.toLowerCase()}async function pe(t){const e=t.timeoutMs||3e5,n=t.intervalMs||1e3,r=Date.now()+e;for(;Date.now()<r;){const o=await ae({options:t.options,transactionId:t.transactionId});if(o.transactionHash)return o.transactionHash;await new Promise(p=>setTimeout(p,n))}throw new Error(`Timeout waiting for transaction to be mined on chain ${t.options.chain.id} with transactionId: ${t.transactionId}`)}const ue=[{type:"receive",stateMutability:"payable"},{type:"function",name:"createSessionWithSig",inputs:[{name:"sessionSpec",type:"tuple",internalType:"struct SessionLib.SessionSpec",components:[{name:"signer",type:"address",internalType:"address"},{name:"isWildcard",type:"bool",internalType:"bool"},{name:"expiresAt",type:"uint256",internalType:"uint256"},{name:"callPolicies",type:"tuple[]",internalType:"struct SessionLib.CallSpec[]",components:[{name:"target",type:"address",internalType:"address"},{name:"selector",type:"bytes4",internalType:"bytes4"},{name:"maxValuePerUse",type:"uint256",internalType:"uint256"},{name:"valueLimit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]},{name:"constraints",type:"tuple[]",internalType:"struct SessionLib.Constraint[]",components:[{name:"condition",type:"uint8",internalType:"enum SessionLib.Condition"},{name:"index",type:"uint64",internalType:"uint64"},{name:"refValue",type:"bytes32",internalType:"bytes32"},{name:"limit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]}]}]},{name:"transferPolicies",type:"tuple[]",internalType:"struct SessionLib.TransferSpec[]",components:[{name:"target",type:"address",internalType:"address"},{name:"maxValuePerUse",type:"uint256",internalType:"uint256"},{name:"valueLimit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]}]},{name:"uid",type:"bytes32",internalType:"bytes32"}]},{name:"signature",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"eip712Domain",inputs:[],outputs:[{name:"fields",type:"bytes1",internalType:"bytes1"},{name:"name",type:"string",internalType:"string"},{name:"version",type:"string",internalType:"string"},{name:"chainId",type:"uint256",internalType:"uint256"},{name:"verifyingContract",type:"address",internalType:"address"},{name:"salt",type:"bytes32",internalType:"bytes32"},{name:"extensions",type:"uint256[]",internalType:"uint256[]"}],stateMutability:"view"},{type:"function",name:"execute",inputs:[{name:"calls",type:"tuple[]",internalType:"struct Call[]",components:[{name:"target",type:"address",internalType:"address"},{name:"value",type:"uint256",internalType:"uint256"},{name:"data",type:"bytes",internalType:"bytes"}]}],outputs:[],stateMutability:"payable"},{type:"function",name:"executeWithSig",inputs:[{name:"wrappedCalls",type:"tuple",internalType:"struct WrappedCalls",components:[{name:"calls",type:"tuple[]",internalType:"struct Call[]",components:[{name:"target",type:"address",internalType:"address"},{name:"value",type:"uint256",internalType:"uint256"},{name:"data",type:"bytes",internalType:"bytes"}]},{name:"uid",type:"bytes32",internalType:"bytes32"}]},{name:"signature",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"payable"},{type:"function",name:"getCallPoliciesForSigner",inputs:[{name:"signer",type:"address",internalType:"address"}],outputs:[{name:"",type:"tuple[]",internalType:"struct SessionLib.CallSpec[]",components:[{name:"target",type:"address",internalType:"address"},{name:"selector",type:"bytes4",internalType:"bytes4"},{name:"maxValuePerUse",type:"uint256",internalType:"uint256"},{name:"valueLimit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]},{name:"constraints",type:"tuple[]",internalType:"struct SessionLib.Constraint[]",components:[{name:"condition",type:"uint8",internalType:"enum SessionLib.Condition"},{name:"index",type:"uint64",internalType:"uint64"},{name:"refValue",type:"bytes32",internalType:"bytes32"},{name:"limit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]}]}]}],stateMutability:"view"},{type:"function",name:"getSessionExpirationForSigner",inputs:[{name:"signer",type:"address",internalType:"address"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"getSessionStateForSigner",inputs:[{name:"signer",type:"address",internalType:"address"}],outputs:[{name:"",type:"tuple",internalType:"struct SessionLib.SessionState",components:[{name:"transferValue",type:"tuple[]",internalType:"struct SessionLib.LimitState[]",components:[{name:"remaining",type:"uint256",internalType:"uint256"},{name:"target",type:"address",internalType:"address"},{name:"selector",type:"bytes4",internalType:"bytes4"},{name:"index",type:"uint256",internalType:"uint256"}]},{name:"callValue",type:"tuple[]",internalType:"struct SessionLib.LimitState[]",components:[{name:"remaining",type:"uint256",internalType:"uint256"},{name:"target",type:"address",internalType:"address"},{name:"selector",type:"bytes4",internalType:"bytes4"},{name:"index",type:"uint256",internalType:"uint256"}]},{name:"callParams",type:"tuple[]",internalType:"struct SessionLib.LimitState[]",components:[{name:"remaining",type:"uint256",internalType:"uint256"},{name:"target",type:"address",internalType:"address"},{name:"selector",type:"bytes4",internalType:"bytes4"},{name:"index",type:"uint256",internalType:"uint256"}]}]}],stateMutability:"view"},{type:"function",name:"getTransferPoliciesForSigner",inputs:[{name:"signer",type:"address",internalType:"address"}],outputs:[{name:"",type:"tuple[]",internalType:"struct SessionLib.TransferSpec[]",components:[{name:"target",type:"address",internalType:"address"},{name:"maxValuePerUse",type:"uint256",internalType:"uint256"},{name:"valueLimit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]}]}],stateMutability:"view"},{type:"function",name:"isWildcardSigner",inputs:[{name:"signer",type:"address",internalType:"address"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"view"},{type:"function",name:"onERC1155BatchReceived",inputs:[{name:"",type:"address",internalType:"address"},{name:"",type:"address",internalType:"address"},{name:"",type:"uint256[]",internalType:"uint256[]"},{name:"",type:"uint256[]",internalType:"uint256[]"},{name:"",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"nonpayable"},{type:"function",name:"onERC1155Received",inputs:[{name:"",type:"address",internalType:"address"},{name:"",type:"address",internalType:"address"},{name:"",type:"uint256",internalType:"uint256"},{name:"",type:"uint256",internalType:"uint256"},{name:"",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"nonpayable"},{type:"function",name:"onERC721Received",inputs:[{name:"",type:"address",internalType:"address"},{name:"",type:"address",internalType:"address"},{name:"",type:"uint256",internalType:"uint256"},{name:"",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"nonpayable"},{type:"function",name:"supportsInterface",inputs:[{name:"interfaceId",type:"bytes4",internalType:"bytes4"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"view"},{type:"event",name:"Executed",inputs:[{name:"to",type:"address",indexed:!0,internalType:"address"},{name:"value",type:"uint256",indexed:!1,internalType:"uint256"},{name:"data",type:"bytes",indexed:!1,internalType:"bytes"}],anonymous:!1},{type:"event",name:"SessionCreated",inputs:[{name:"signer",type:"address",indexed:!0,internalType:"address"},{name:"sessionSpec",type:"tuple",indexed:!1,internalType:"struct SessionLib.SessionSpec",components:[{name:"signer",type:"address",internalType:"address"},{name:"isWildcard",type:"bool",internalType:"bool"},{name:"expiresAt",type:"uint256",internalType:"uint256"},{name:"callPolicies",type:"tuple[]",internalType:"struct SessionLib.CallSpec[]",components:[{name:"target",type:"address",internalType:"address"},{name:"selector",type:"bytes4",internalType:"bytes4"},{name:"maxValuePerUse",type:"uint256",internalType:"uint256"},{name:"valueLimit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]},{name:"constraints",type:"tuple[]",internalType:"struct SessionLib.Constraint[]",components:[{name:"condition",type:"uint8",internalType:"enum SessionLib.Condition"},{name:"index",type:"uint64",internalType:"uint64"},{name:"refValue",type:"bytes32",internalType:"bytes32"},{name:"limit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]}]}]},{name:"transferPolicies",type:"tuple[]",internalType:"struct SessionLib.TransferSpec[]",components:[{name:"target",type:"address",internalType:"address"},{name:"maxValuePerUse",type:"uint256",internalType:"uint256"},{name:"valueLimit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]}]},{name:"uid",type:"bytes32",internalType:"bytes32"}]}],anonymous:!1},{type:"event",name:"ValueReceived",inputs:[{name:"from",type:"address",indexed:!0,internalType:"address"},{name:"value",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"error",name:"AllowanceExceeded",inputs:[{name:"allowanceUsage",type:"uint256",internalType:"uint256"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint64",internalType:"uint64"}]},{type:"error",name:"CallPolicyViolated",inputs:[{name:"target",type:"address",internalType:"address"},{name:"selector",type:"bytes4",internalType:"bytes4"}]},{type:"error",name:"CallReverted",inputs:[]},{type:"error",name:"ConditionFailed",inputs:[{name:"param",type:"bytes32",internalType:"bytes32"},{name:"refValue",type:"bytes32",internalType:"bytes32"},{name:"condition",type:"uint8",internalType:"uint8"}]},{type:"error",name:"InvalidDataLength",inputs:[{name:"actualLength",type:"uint256",internalType:"uint256"},{name:"expectedLength",type:"uint256",internalType:"uint256"}]},{type:"error",name:"InvalidSignature",inputs:[{name:"msgSender",type:"address",internalType:"address"},{name:"thisAddress",type:"address",internalType:"address"}]},{type:"error",name:"LifetimeUsageExceeded",inputs:[{name:"lifetimeUsage",type:"uint256",internalType:"uint256"},{name:"limit",type:"uint256",internalType:"uint256"}]},{type:"error",name:"MaxValueExceeded",inputs:[{name:"value",type:"uint256",internalType:"uint256"},{name:"maxValuePerUse",type:"uint256",internalType:"uint256"}]},{type:"error",name:"NoCallsToExecute",inputs:[]},{type:"error",name:"SessionExpired",inputs:[]},{type:"error",name:"SessionExpiresTooSoon",inputs:[]},{type:"error",name:"SessionZeroSigner",inputs:[]},{type:"error",name:"TransferPolicyViolated",inputs:[{name:"target",type:"address",internalType:"address"}]},{type:"error",name:"UIDAlreadyProcessed",inputs:[]}];function ce(t){return t.id==="inApp"||t.id==="embedded"}async function le(t,e,n){var p,a,i,s;if(((p=e==null?void 0:e.auth)==null?void 0:p.mode)!=="popup"&&((a=e==null?void 0:e.auth)==null?void 0:a.mode)!==void 0&&n.authenticateWithRedirect){const u=t.strategy;M.includes(u)&&await n.authenticateWithRedirect(u,(i=e==null?void 0:e.auth)==null?void 0:i.mode,(s=e==null?void 0:e.auth)==null?void 0:s.redirectUrl)}const o=(await n.connect(t)).user.account;return P({authAccount:o,client:t.client,createOptions:e,desiredChain:t.chain})}async function ye(t,e,n){t.authResult&&n.loginWithAuthToken&&await n.loginWithAuthToken(t.authResult);const r=await me(n);if(!r)throw new Error("Failed to authenticate user.");const o=r.account;return P({authAccount:o,client:t.client,createOptions:e,desiredChain:t.chain})}async function de(t){const{connectSmartAccount:e}=await b(async()=>{const{connectSmartAccount:n}=await import("./index-DtNkXFsH.js");return{connectSmartAccount:n}},__vite__mapDeps([20,8,6,5,9,10,11,12,13,3,4,7,17,18,21,22,23,24,25,16,26,27,28,29,30,31,32,33,34,35,36,37,38]));return e({chain:t.chain,client:t.client,personalAccount:t.authAccount},t.smartAccountOptions)}async function me(t){const e=await t.getUser();switch(e.status){case"Logged In, Wallet Initialized":return e}}async function P(t){const{createOptions:e,authAccount:n,desiredChain:r,client:o}=t;let p,a;const i=e&&"executionMode"in e?e.executionMode:void 0;if(i&&(i.mode==="EIP4337"?p=i.smartAccount:i.mode==="EIP7702"&&(a=i)),e&&"smartAccount"in e&&(e!=null&&e.smartAccount)&&(p=e.smartAccount),p){const[s,u]=await de({authAccount:n,chain:r,client:o,smartAccountOptions:p});return{account:s,adminAccount:n,chain:u}}if(a){const s=r;if(!s)throw new Error("Chain is required for EIP-7702 execution, pass a chain when connecting the inAppWallet.");return{account:se({adminAccount:n,client:o,sponsorGas:a.sponsorGas}),adminAccount:n,chain:s}}return{account:n,chain:r||R}}const Re=Object.freeze(Object.defineProperty({__proto__:null,autoConnectInAppWallet:ye,connectInAppWallet:le,isInAppWallet:ce},Symbol.toStringTag,{value:"Module"}));export{Ae as D,w as E,J as a,_e as b,Ee as c,xe as d,Ue as e,Z as f,E as g,_ as h,Ce as i,Pe as j,Ge as k,Ie as l,ce as m,Re as n};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as _,b as l,a as ve}from"./lit-element-B3y9oplH.js";import{n as b,o as f,r as h,a as Ie}from"./class-map-CxwNmq0D.js";import{d as U,r as Ne,e as Se,v as ke}from"./index-
|
|
1
|
+
import{i as _,b as l,a as ve}from"./lit-element-B3y9oplH.js";import{n as b,o as f,r as h,a as Ie}from"./class-map-CxwNmq0D.js";import{d as U,r as Ne,e as Se,v as ke}from"./index-D6jXV4v6.js";import{c as C,U as _e}from"./index-BMDKd-Ff.js";import"./index-DgM4asaI.js";import"./index-B8FkQHkj.js";import"./index-CnYjUY-N.js";import"./index-CGga9MZU.js";import"./index-BNXLnSJ4.js";import"./index-fkuvr7Fy.js";import"./index-6Oq8x_-m.js";import{$ as Ce,k as v,a0 as $e,a1 as y,b as O,a2 as Re,a3 as N,O as ce,N as A,a4 as me,C as m,q as T,E as M,S as R,n as Oe,M as G,e as Ue,i as Le,p as qe,o as P,R as z}from"./W3MFrameProviderSingleton-CtKoZGPW.js";import{au as I}from"./NetworkUtil-EoWQDMpU.js";import"./index-b5E6PDAn.js";import{M as ge}from"./MathUtil-BGCe3rZ3.js";const De=U`
|
|
2
2
|
:host {
|
|
3
3
|
position: relative;
|
|
4
4
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as x,k as N,r as i,j as f}from"./react-DehiWSvs.js";import{p as v,g}from"./dcl-schemas-Dr9BTjb7.js";import{ce as L}from"./index-BqH8KAmH.js";import{r as q,g as he,h as ye}from"./createSvgIcon-Bs2ci5m0.js";import{n as M}from"./emotion-styled.browser.esm-B3uXeLtp.js";import{C as ve}from"./CircularProgress-DDBADFDe.js";var A={},oe;function Ee(){if(oe)return A;oe=1,Object.defineProperty(A,"__esModule",{value:!0});function e(){let r,n;const t=new Promise((s,u)=>{r=c=>{s(c),t.isPending=!1},n=c=>{u(c),t.isPending=!1}}).catch(s=>Promise.reject(s));return t.resolve=r,t.reject=n,"finally"in t||(t.finally=s=>{t.then(s),t.catch(s)}),t.isPending=!0,t}return A.future=e,A.default=e,A}var we=Ee();const be=x(we);function se(e){return{all:e=e||new Map,on:function(r,n){var t=e.get(r);t?t.push(n):e.set(r,[n])},off:function(r,n){var t=e.get(r);t&&(n?t.splice(t.indexOf(n)>>>0,1):e.set(r,[]))},emit:function(r,n){var t=e.get(r);t&&t.slice().map(function(s){s(n)}),(t=e.get("*"))&&t.slice().map(function(s){s(r,n)})}}}const S=new Map,Y=new Map,Z=new Map,k=new Map;function ae(e){const r=document.getElementById(e);return!r||!r.contentWindow?!1:Z.get(r.contentWindow)??!1}function H(e){if(e.data&&e.data.type)try{switch(e.data.type){case v.PreviewMessageType.CONTROLLER_RESPONSE:{const r=e.data.payload,{id:n}=r,t=S.get(n);t&&(S.delete(n),r.ok?t.resolve(r.result):r.ok===!1&&t.reject(new Error(r.error)));break}case v.PreviewMessageType.EMOTE_EVENT:{const r=e.data.payload,{type:n,payload:t}=r,s=e.source?Y.get(e.source):null;s&&n&&s.emit(n,t);break}case v.PreviewMessageType.LOAD:{e.source&&(Z.set(e.source,!0),(k.get(e.source)||[]).filter(t=>{var s;return((s=t.data)==null?void 0:s.type)!==v.PreviewMessageType.LOAD}).forEach(H),k.delete(e.source));break}default:}}catch(r){console.error("Error processing WearablePreview message:",r)}}const Pe=e=>{var n;if(((n=e.data)==null?void 0:n.type)===v.PreviewMessageType.LOAD){H(e);return}if(!(e.source?Z.get(e.source):!1)&&e.source){const t=k.get(e.source)||[];t.push(e),k.set(e.source,t);return}H(e)};typeof window<"u"&&window.addEventListener("message",Pe,!1);let ie=0;function Se(e){return function(n,t,s){const u=document.getElementById(e);if(!u||!u.contentWindow){const d=new Error("iframe not found or not accessible");return Promise.reject(d)}const c=e+"-"+ie,l=be();S.set(c,l);const p=v.PreviewMessageType.CONTROLLER_REQUEST,y={id:c,namespace:n,method:t,params:s},m=setTimeout(()=>{S.delete(c),l.reject(new Error(`Request timeout for ${t}`))},1e4),a=l.resolve,j=l.reject;l.resolve=d=>{clearTimeout(m),a(d)},l.reject=d=>{clearTimeout(m),j(d)};try{v.sendMessage(u.contentWindow,p,y)}catch(d){const w=d instanceof Error?d.message:String(d);l.reject(new Error(`Failed to send message: ${w}`)),S.delete(c),clearTimeout(m)}return ie++,l}}function Me(e){const r=document.getElementById(e);if(!r)throw new Error(`Could not find an iframe with id="${e}"`);S.clear();const n=r.contentWindow?Y.get(r.contentWindow)??se():se();r.contentWindow&&Y.set(r.contentWindow,n);const t=Se(e);return{scene:{getScreenshot(s,u){return t("scene","getScreenshot",[s,u])},getMetrics(){return t("scene","getMetrics",[])},changeZoom:function(s){return t("scene","changeZoom",[s])},panCamera:function(s){return t("scene","panCamera",[s])},changeCameraPosition:function(s){return t("scene","changeCameraPosition",[s])},cleanup(){return t("scene","cleanup",[])},setUsername:function(s){return t("scene","setUsername",[s])}},emote:{getLength(){return t("emote","getLength",[])},isPlaying(){return t("emote","isPlaying",[])},goTo(s){return t("emote","goTo",[s])},play(){return t("emote","play",[])},pause(){return t("emote","pause",[])},stop(){return t("emote","stop",[])},enableSound(){return t("emote","enableSound",[])},disableSound(){return t("emote","disableSound",[])},hasSound(){return t("emote","hasSound",[])},isSocialEmote(){return t("emote","isSocialEmote",[])},getSocialEmoteAnimations(){return t("emote","getSocialEmoteAnimations",[])},getPlayingSocialEmoteAnimation(){return t("emote","getPlayingSocialEmoteAnimation",[])},emote:null,events:n},physics:{setSpringBonesParams(s,u){return t("physics","setSpringBonesParams",[s,u])}}}}var R={},ue;function Ae(){if(ue)return R;ue=1;var e=L();Object.defineProperty(R,"__esModule",{value:!0}),R.default=void 0;var r=e(q()),n=N();return R.default=(0,r.default)((0,n.jsx)("path",{d:"M6 19h4V5H6zm8-14v14h4V5z"}),"Pause"),R}var Re=Ae();const Te=x(Re);var T={},ce;function Ce(){if(ce)return T;ce=1;var e=L();Object.defineProperty(T,"__esModule",{value:!0}),T.default=void 0;var r=e(q()),n=N();return T.default=(0,r.default)((0,n.jsx)("path",{d:"M8 5v14l11-7z"}),"PlayArrow"),T}var Ie=Ce();const xe=x(Ie);var C={},le;function je(){if(le)return C;le=1;var e=L();Object.defineProperty(C,"__esModule",{value:!0}),C.default=void 0;var r=e(q()),n=N();return C.default=(0,r.default)((0,n.jsx)("path",{d:"M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63m2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71M4.27 3 3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9zM12 4 9.91 6.09 12 8.18z"}),"VolumeOff"),C}var _e=je();const Oe=x(_e);var I={},de;function ke(){if(de)return I;de=1;var e=L();Object.defineProperty(I,"__esModule",{value:!0}),I.default=void 0;var r=e(q()),n=N();return I.default=(0,r.default)((0,n.jsx)("path",{d:"M3 9v6h4l5 5V4L7 9zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02M14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77"}),"VolumeUp"),I}var Ne=ke();const Le=x(Ne),qe=(e,r)=>{const n=i.useRef(null),[t,s]=i.useState(!1);return i.useEffect(()=>{const u=r??Me(e);if(n.current=u,ae(e)){s(!0);return}const c=document.getElementById(e);if(!c){console.error(`Could not find iframe with id="${e}"`);return}if(!c.contentWindow){console.error(`Iframe contentWindow is not accessible for id="${e}"`);return}const p=y=>{var m;((m=y.data)==null?void 0:m.type)===v.PreviewMessageType.LOAD&&ae(e)&&s(!0)};return window.addEventListener("message",p),()=>{window.removeEventListener("message",p),s(!1),n.current=null}},[e,r]),{controllerRef:n,isReady:t}},We={small:16,medium:20,large:24},me=({children:e,startIcon:r,endIcon:n,loading:t=!1,loadingIcon:s,loadingPosition:u="center",disabled:c=!1,size:l="medium",...p})=>{const y=f.jsx(ve,{color:"inherit",size:We[l]}),m=s||y,a=t&&u==="center"?m:e;return f.jsx(he,{disabled:c||t,startIcon:t&&u==="start"?m:r,endIcon:t&&u==="end"?m:n,size:l,...p,children:a})},Ve=M(ye)(({theme:e})=>({display:"flex",position:"absolute",width:"100%",bottom:0,margin:`${e.spacing(2)} 0`,padding:`0 ${e.spacing(3)}`,gap:e.spacing(2)})),Ue=M(me)(({theme:e})=>({width:56,height:44,padding:0,minWidth:"unset",background:"rgba(0, 0, 0, 0.64) !important","& svg":{marginLeft:e.spacing(.5)}})),De=M(me)(({theme:e,muted:r})=>({marginLeft:e.spacing(2.5),minWidth:25,background:"none",padding:0,opacity:r?.5:1})),Fe=M("input")(({theme:e})=>({flex:1,width:"100%",background:"none",WebkitAppearance:"none","&:focus":{outline:"none"},"&::-webkit-slider-thumb":{WebkitAppearance:"none",width:24,height:24,borderRadius:10,backgroundColor:"#736e7d",overflow:"visible",cursor:"pointer",paddingBottom:e.spacing(.625),marginTop:e.spacing(-.5)},"&::-moz-range-thumb":{width:24,height:24,borderRadius:20,backgroundColor:"#736e7d",overflow:"visible",cursor:"pointer",border:"none"},"&::-ms-thumb":{width:24,height:24,borderRadius:20,backgroundColor:"#736e7d",overflow:"visible",cursor:"pointer"},"&::-webkit-slider-runnable-track":{width:300,height:15,background:"rgba(115, 110, 125, 0.32)",border:"none",borderRadius:10},"&::-moz-range-track":{width:"100%",height:15,borderRadius:10,cursor:"pointer",background:"rgba(115, 110, 125, 0.32)"}})),Be=M("div")({display:"flex",alignItems:"center"}),ze=M("input")({width:56,height:44,borderRadius:5,background:"transparent",border:"1px solid rgba(115, 110, 125, 0.4)",color:"white",textAlign:"center","&:focus-visible":{outline:"1px solid"}}),$e=({wearablePreviewId:e,className:r,hideFrameInput:n,hideProgressInput:t,hidePlayButton:s,hideSoundButton:u,wearablePreviewController:c,renderPlayButton:l,renderSoundButton:p,renderProgressBar:y,renderFrameInput:m})=>{const{controllerRef:a,isReady:j}=qe(e,c),[d,w]=i.useState(0),[b,W]=i.useState(!1),[h,fe]=i.useState(void 0),[P,ge]=i.useState(!0),[_,G]=i.useState(void 0),[J,Q]=i.useState(!1),[K,X]=i.useState(!1),V=i.useCallback(()=>{w(0)},[]),U=i.useCallback(()=>{W(!1),w(o=>o>=Math.floor((h??0)*100)?0:o)},[h]),D=i.useCallback(()=>{W(!1)},[]),F=i.useCallback(async()=>{if(!K){let o=h;!h&&a.current&&(o=await a.current.emote.getLength()),W(!0),fe(o)}},[h,K,a]),B=i.useCallback(({length:o})=>{w(Math.ceil((o??0)*100))},[]);i.useEffect(()=>{const o=a.current;if(o)return o.emote.events.on(g.PreviewEmoteEventType.ANIMATION_PLAY,F),o.emote.events.on(g.PreviewEmoteEventType.ANIMATION_PLAYING,B),o.emote.events.on(g.PreviewEmoteEventType.ANIMATION_END,U),o.emote.events.on(g.PreviewEmoteEventType.ANIMATION_PAUSE,D),o.emote.events.on(g.PreviewEmoteEventType.ANIMATION_LOOP,V),()=>{o.emote.events.off(g.PreviewEmoteEventType.ANIMATION_PLAY,F),o.emote.events.off(g.PreviewEmoteEventType.ANIMATION_PLAYING,B),o.emote.events.off(g.PreviewEmoteEventType.ANIMATION_END,U),o.emote.events.off(g.PreviewEmoteEventType.ANIMATION_PAUSE,D),o.emote.events.off(g.PreviewEmoteEventType.ANIMATION_LOOP,V)}},[a,F,B,U,D,V]),i.useEffect(()=>{_===void 0&&j&&a.current&&a.current.emote.hasSound().then(o=>G(o)).catch(o=>{console.error("Error checking sound:",o),G(!1)})},[_,j,a]);const z=i.useCallback(async()=>{if(a.current)try{await a.current.emote.play()}catch(o){console.error("Error playing emote:",o)}},[a]),$=i.useCallback(async()=>{if(a.current)try{await a.current.emote.pause()}catch(o){console.error("Error pausing emote:",o)}},[a]),ee=i.useCallback(async()=>{b?await $():await z()},[b,z,$]),te=i.useCallback(()=>{var o,E;P?(o=a.current)==null||o.emote.disableSound():(E=a.current)==null||E.emote.enableSound(),ge(!P)},[P,a]),O=i.useCallback(async o=>{if(isNaN(o)||!a.current)return;let E=o;const ne=h??0;ne*100<o&&(E=ne*100),w(E),X(!0);try{b&&(await a.current.emote.pause(),Q(!0)),await a.current.emote.goTo(E/100)}catch(pe){console.error("Error changing frame:",pe)}},[h,b,a]),re=i.useCallback(async()=>{if(X(!1),J&&a.current){try{await a.current.emote.play()}catch(o){console.error("Error resuming play:",o)}Q(!1)}},[J,a]);return f.jsxs(Ve,{className:r,children:[s?null:l?l({isPlaying:b,onPlay:z,onPause:$,onToggle:ee}):f.jsx(Ue,{onClick:ee,children:b?f.jsx(Te,{}):f.jsx(xe,{})}),t?null:y?y({frame:d,length:h??0,onChange:O,onMouseUp:re}):f.jsx(Fe,{type:"range",value:d,max:Math.ceil((h??0)*100),min:0,step:1,onChange:o=>O(Number(o.target.value)),onMouseUp:re}),n?null:f.jsx(Be,{children:m?m({frame:Math.round(d/100),onChange:o=>O(o*100)}):f.jsx(ze,{type:"number",value:Math.round(d/100),onChange:o=>O(Number(o.target.value)*100)})}),u||!_?null:p?p({isSoundEnabled:P,hasSound:_,onToggle:te}):f.jsx(De,{muted:!P,onClick:te,children:P?f.jsx(Le,{}):f.jsx(Oe,{})})]})},Ke=Object.freeze(Object.defineProperty({__proto__:null,EmoteControls:$e},Symbol.toStringTag,{value:"Module"}));export{me as B,$e as E,Me as c,Ke as i,qe as u};
|
|
1
|
+
import{g as x,k as N,r as i,j as f}from"./react-DehiWSvs.js";import{p as v,g}from"./dcl-schemas-Dr9BTjb7.js";import{ce as L}from"./index-BK186nFF.js";import{r as q,g as he,h as ye}from"./createSvgIcon-DIV4UAHy.js";import{n as M}from"./emotion-styled.browser.esm-BQQ0TwU4.js";import{C as ve}from"./CircularProgress-DuQoJ6hf.js";var A={},oe;function Ee(){if(oe)return A;oe=1,Object.defineProperty(A,"__esModule",{value:!0});function e(){let r,n;const t=new Promise((s,u)=>{r=c=>{s(c),t.isPending=!1},n=c=>{u(c),t.isPending=!1}}).catch(s=>Promise.reject(s));return t.resolve=r,t.reject=n,"finally"in t||(t.finally=s=>{t.then(s),t.catch(s)}),t.isPending=!0,t}return A.future=e,A.default=e,A}var we=Ee();const be=x(we);function se(e){return{all:e=e||new Map,on:function(r,n){var t=e.get(r);t?t.push(n):e.set(r,[n])},off:function(r,n){var t=e.get(r);t&&(n?t.splice(t.indexOf(n)>>>0,1):e.set(r,[]))},emit:function(r,n){var t=e.get(r);t&&t.slice().map(function(s){s(n)}),(t=e.get("*"))&&t.slice().map(function(s){s(r,n)})}}}const S=new Map,Y=new Map,Z=new Map,k=new Map;function ae(e){const r=document.getElementById(e);return!r||!r.contentWindow?!1:Z.get(r.contentWindow)??!1}function H(e){if(e.data&&e.data.type)try{switch(e.data.type){case v.PreviewMessageType.CONTROLLER_RESPONSE:{const r=e.data.payload,{id:n}=r,t=S.get(n);t&&(S.delete(n),r.ok?t.resolve(r.result):r.ok===!1&&t.reject(new Error(r.error)));break}case v.PreviewMessageType.EMOTE_EVENT:{const r=e.data.payload,{type:n,payload:t}=r,s=e.source?Y.get(e.source):null;s&&n&&s.emit(n,t);break}case v.PreviewMessageType.LOAD:{e.source&&(Z.set(e.source,!0),(k.get(e.source)||[]).filter(t=>{var s;return((s=t.data)==null?void 0:s.type)!==v.PreviewMessageType.LOAD}).forEach(H),k.delete(e.source));break}default:}}catch(r){console.error("Error processing WearablePreview message:",r)}}const Pe=e=>{var n;if(((n=e.data)==null?void 0:n.type)===v.PreviewMessageType.LOAD){H(e);return}if(!(e.source?Z.get(e.source):!1)&&e.source){const t=k.get(e.source)||[];t.push(e),k.set(e.source,t);return}H(e)};typeof window<"u"&&window.addEventListener("message",Pe,!1);let ie=0;function Se(e){return function(n,t,s){const u=document.getElementById(e);if(!u||!u.contentWindow){const d=new Error("iframe not found or not accessible");return Promise.reject(d)}const c=e+"-"+ie,l=be();S.set(c,l);const p=v.PreviewMessageType.CONTROLLER_REQUEST,y={id:c,namespace:n,method:t,params:s},m=setTimeout(()=>{S.delete(c),l.reject(new Error(`Request timeout for ${t}`))},1e4),a=l.resolve,j=l.reject;l.resolve=d=>{clearTimeout(m),a(d)},l.reject=d=>{clearTimeout(m),j(d)};try{v.sendMessage(u.contentWindow,p,y)}catch(d){const w=d instanceof Error?d.message:String(d);l.reject(new Error(`Failed to send message: ${w}`)),S.delete(c),clearTimeout(m)}return ie++,l}}function Me(e){const r=document.getElementById(e);if(!r)throw new Error(`Could not find an iframe with id="${e}"`);S.clear();const n=r.contentWindow?Y.get(r.contentWindow)??se():se();r.contentWindow&&Y.set(r.contentWindow,n);const t=Se(e);return{scene:{getScreenshot(s,u){return t("scene","getScreenshot",[s,u])},getMetrics(){return t("scene","getMetrics",[])},changeZoom:function(s){return t("scene","changeZoom",[s])},panCamera:function(s){return t("scene","panCamera",[s])},changeCameraPosition:function(s){return t("scene","changeCameraPosition",[s])},cleanup(){return t("scene","cleanup",[])},setUsername:function(s){return t("scene","setUsername",[s])}},emote:{getLength(){return t("emote","getLength",[])},isPlaying(){return t("emote","isPlaying",[])},goTo(s){return t("emote","goTo",[s])},play(){return t("emote","play",[])},pause(){return t("emote","pause",[])},stop(){return t("emote","stop",[])},enableSound(){return t("emote","enableSound",[])},disableSound(){return t("emote","disableSound",[])},hasSound(){return t("emote","hasSound",[])},isSocialEmote(){return t("emote","isSocialEmote",[])},getSocialEmoteAnimations(){return t("emote","getSocialEmoteAnimations",[])},getPlayingSocialEmoteAnimation(){return t("emote","getPlayingSocialEmoteAnimation",[])},emote:null,events:n},physics:{setSpringBonesParams(s,u){return t("physics","setSpringBonesParams",[s,u])}}}}var R={},ue;function Ae(){if(ue)return R;ue=1;var e=L();Object.defineProperty(R,"__esModule",{value:!0}),R.default=void 0;var r=e(q()),n=N();return R.default=(0,r.default)((0,n.jsx)("path",{d:"M6 19h4V5H6zm8-14v14h4V5z"}),"Pause"),R}var Re=Ae();const Te=x(Re);var T={},ce;function Ce(){if(ce)return T;ce=1;var e=L();Object.defineProperty(T,"__esModule",{value:!0}),T.default=void 0;var r=e(q()),n=N();return T.default=(0,r.default)((0,n.jsx)("path",{d:"M8 5v14l11-7z"}),"PlayArrow"),T}var Ie=Ce();const xe=x(Ie);var C={},le;function je(){if(le)return C;le=1;var e=L();Object.defineProperty(C,"__esModule",{value:!0}),C.default=void 0;var r=e(q()),n=N();return C.default=(0,r.default)((0,n.jsx)("path",{d:"M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63m2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71M4.27 3 3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9zM12 4 9.91 6.09 12 8.18z"}),"VolumeOff"),C}var _e=je();const Oe=x(_e);var I={},de;function ke(){if(de)return I;de=1;var e=L();Object.defineProperty(I,"__esModule",{value:!0}),I.default=void 0;var r=e(q()),n=N();return I.default=(0,r.default)((0,n.jsx)("path",{d:"M3 9v6h4l5 5V4L7 9zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02M14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77"}),"VolumeUp"),I}var Ne=ke();const Le=x(Ne),qe=(e,r)=>{const n=i.useRef(null),[t,s]=i.useState(!1);return i.useEffect(()=>{const u=r??Me(e);if(n.current=u,ae(e)){s(!0);return}const c=document.getElementById(e);if(!c){console.error(`Could not find iframe with id="${e}"`);return}if(!c.contentWindow){console.error(`Iframe contentWindow is not accessible for id="${e}"`);return}const p=y=>{var m;((m=y.data)==null?void 0:m.type)===v.PreviewMessageType.LOAD&&ae(e)&&s(!0)};return window.addEventListener("message",p),()=>{window.removeEventListener("message",p),s(!1),n.current=null}},[e,r]),{controllerRef:n,isReady:t}},We={small:16,medium:20,large:24},me=({children:e,startIcon:r,endIcon:n,loading:t=!1,loadingIcon:s,loadingPosition:u="center",disabled:c=!1,size:l="medium",...p})=>{const y=f.jsx(ve,{color:"inherit",size:We[l]}),m=s||y,a=t&&u==="center"?m:e;return f.jsx(he,{disabled:c||t,startIcon:t&&u==="start"?m:r,endIcon:t&&u==="end"?m:n,size:l,...p,children:a})},Ve=M(ye)(({theme:e})=>({display:"flex",position:"absolute",width:"100%",bottom:0,margin:`${e.spacing(2)} 0`,padding:`0 ${e.spacing(3)}`,gap:e.spacing(2)})),Ue=M(me)(({theme:e})=>({width:56,height:44,padding:0,minWidth:"unset",background:"rgba(0, 0, 0, 0.64) !important","& svg":{marginLeft:e.spacing(.5)}})),De=M(me)(({theme:e,muted:r})=>({marginLeft:e.spacing(2.5),minWidth:25,background:"none",padding:0,opacity:r?.5:1})),Fe=M("input")(({theme:e})=>({flex:1,width:"100%",background:"none",WebkitAppearance:"none","&:focus":{outline:"none"},"&::-webkit-slider-thumb":{WebkitAppearance:"none",width:24,height:24,borderRadius:10,backgroundColor:"#736e7d",overflow:"visible",cursor:"pointer",paddingBottom:e.spacing(.625),marginTop:e.spacing(-.5)},"&::-moz-range-thumb":{width:24,height:24,borderRadius:20,backgroundColor:"#736e7d",overflow:"visible",cursor:"pointer",border:"none"},"&::-ms-thumb":{width:24,height:24,borderRadius:20,backgroundColor:"#736e7d",overflow:"visible",cursor:"pointer"},"&::-webkit-slider-runnable-track":{width:300,height:15,background:"rgba(115, 110, 125, 0.32)",border:"none",borderRadius:10},"&::-moz-range-track":{width:"100%",height:15,borderRadius:10,cursor:"pointer",background:"rgba(115, 110, 125, 0.32)"}})),Be=M("div")({display:"flex",alignItems:"center"}),ze=M("input")({width:56,height:44,borderRadius:5,background:"transparent",border:"1px solid rgba(115, 110, 125, 0.4)",color:"white",textAlign:"center","&:focus-visible":{outline:"1px solid"}}),$e=({wearablePreviewId:e,className:r,hideFrameInput:n,hideProgressInput:t,hidePlayButton:s,hideSoundButton:u,wearablePreviewController:c,renderPlayButton:l,renderSoundButton:p,renderProgressBar:y,renderFrameInput:m})=>{const{controllerRef:a,isReady:j}=qe(e,c),[d,w]=i.useState(0),[b,W]=i.useState(!1),[h,fe]=i.useState(void 0),[P,ge]=i.useState(!0),[_,G]=i.useState(void 0),[J,Q]=i.useState(!1),[K,X]=i.useState(!1),V=i.useCallback(()=>{w(0)},[]),U=i.useCallback(()=>{W(!1),w(o=>o>=Math.floor((h??0)*100)?0:o)},[h]),D=i.useCallback(()=>{W(!1)},[]),F=i.useCallback(async()=>{if(!K){let o=h;!h&&a.current&&(o=await a.current.emote.getLength()),W(!0),fe(o)}},[h,K,a]),B=i.useCallback(({length:o})=>{w(Math.ceil((o??0)*100))},[]);i.useEffect(()=>{const o=a.current;if(o)return o.emote.events.on(g.PreviewEmoteEventType.ANIMATION_PLAY,F),o.emote.events.on(g.PreviewEmoteEventType.ANIMATION_PLAYING,B),o.emote.events.on(g.PreviewEmoteEventType.ANIMATION_END,U),o.emote.events.on(g.PreviewEmoteEventType.ANIMATION_PAUSE,D),o.emote.events.on(g.PreviewEmoteEventType.ANIMATION_LOOP,V),()=>{o.emote.events.off(g.PreviewEmoteEventType.ANIMATION_PLAY,F),o.emote.events.off(g.PreviewEmoteEventType.ANIMATION_PLAYING,B),o.emote.events.off(g.PreviewEmoteEventType.ANIMATION_END,U),o.emote.events.off(g.PreviewEmoteEventType.ANIMATION_PAUSE,D),o.emote.events.off(g.PreviewEmoteEventType.ANIMATION_LOOP,V)}},[a,F,B,U,D,V]),i.useEffect(()=>{_===void 0&&j&&a.current&&a.current.emote.hasSound().then(o=>G(o)).catch(o=>{console.error("Error checking sound:",o),G(!1)})},[_,j,a]);const z=i.useCallback(async()=>{if(a.current)try{await a.current.emote.play()}catch(o){console.error("Error playing emote:",o)}},[a]),$=i.useCallback(async()=>{if(a.current)try{await a.current.emote.pause()}catch(o){console.error("Error pausing emote:",o)}},[a]),ee=i.useCallback(async()=>{b?await $():await z()},[b,z,$]),te=i.useCallback(()=>{var o,E;P?(o=a.current)==null||o.emote.disableSound():(E=a.current)==null||E.emote.enableSound(),ge(!P)},[P,a]),O=i.useCallback(async o=>{if(isNaN(o)||!a.current)return;let E=o;const ne=h??0;ne*100<o&&(E=ne*100),w(E),X(!0);try{b&&(await a.current.emote.pause(),Q(!0)),await a.current.emote.goTo(E/100)}catch(pe){console.error("Error changing frame:",pe)}},[h,b,a]),re=i.useCallback(async()=>{if(X(!1),J&&a.current){try{await a.current.emote.play()}catch(o){console.error("Error resuming play:",o)}Q(!1)}},[J,a]);return f.jsxs(Ve,{className:r,children:[s?null:l?l({isPlaying:b,onPlay:z,onPause:$,onToggle:ee}):f.jsx(Ue,{onClick:ee,children:b?f.jsx(Te,{}):f.jsx(xe,{})}),t?null:y?y({frame:d,length:h??0,onChange:O,onMouseUp:re}):f.jsx(Fe,{type:"range",value:d,max:Math.ceil((h??0)*100),min:0,step:1,onChange:o=>O(Number(o.target.value)),onMouseUp:re}),n?null:f.jsx(Be,{children:m?m({frame:Math.round(d/100),onChange:o=>O(o*100)}):f.jsx(ze,{type:"number",value:Math.round(d/100),onChange:o=>O(Number(o.target.value)*100)})}),u||!_?null:p?p({isSoundEnabled:P,hasSound:_,onToggle:te}):f.jsx(De,{muted:!P,onClick:te,children:P?f.jsx(Le,{}):f.jsx(Oe,{})})]})},Ke=Object.freeze(Object.defineProperty({__proto__:null,EmoteControls:$e},Symbol.toStringTag,{value:"Module"}));export{me as B,$e as E,Me as c,Ke as i,qe as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e as ot}from"./index-
|
|
1
|
+
import{e as ot}from"./index-Cl0OwOQC.js";import{f as nn}from"./react-DehiWSvs.js";import{p as Se,g as ge}from"./sentry-973sfbO9.js";import{c as on}from"./index-DI-3MKLG.js";var Pe={};/*! *****************************************************************************
|
|
2
2
|
Copyright (c) Microsoft Corporation.
|
|
3
3
|
|
|
4
4
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as f,b as l,a as ee}from"./lit-element-B3y9oplH.js";import{n as c,o as w,r as u,a as Ii}from"./class-map-CxwNmq0D.js";import{d as v,r as _,e as W}from"./index-
|
|
1
|
+
import{i as f,b as l,a as ee}from"./lit-element-B3y9oplH.js";import{n as c,o as w,r as u,a as Ii}from"./class-map-CxwNmq0D.js";import{d as v,r as _,e as W}from"./index-D6jXV4v6.js";import{c as p,U as F}from"./index-BMDKd-Ff.js";import"./index-CnYjUY-N.js";import"./index-BNXLnSJ4.js";import"./index-DQllllFW.js";import{O as m,C as d,L as Ee,q as E,b as y,M as P,E as C,t as me,o as b,R as h,d as D,S as A,k as x,l as ze,W as Fe,ak as Xt,aj as he,a3 as J,a1 as qi,z as I,am as tt,A as _i,F as Ki,D as Gi,y as Xi,T as ft,V as Yt,X as Qt,a9 as Yi,ao as Qi,Z as Bt,ap as Ji}from"./W3MFrameProviderSingleton-CtKoZGPW.js";import"./index-DoaAKgT7.js";import{W as zs,a as Fs}from"./index-CCwIHj2Z.js";import"./index-B8FkQHkj.js";import"./index-CGga9MZU.js";import"./index-DgM4asaI.js";import{au as S}from"./NetworkUtil-EoWQDMpU.js";import{H as Jt}from"./HelpersUtil-B2odRbT4.js";import{n as Zi}from"./index-fkuvr7Fy.js";import{E as Q}from"./ExchangeController-C7H6XSRu.js";import"./index-DHBBVF0A.js";import"./index-CpXK1eyp.js";import"./index-mDuPP0v8.js";import{M as mt}from"./MathUtil-BGCe3rZ3.js";import"./index-6Oq8x_-m.js";import{e as Zt,n as ei}from"./ref-BsAZ42-h.js";import"./index-DBY7pfsX.js";import"./index-b5E6PDAn.js";import"./index-DbyFw-p2.js";import"./index-ti6Xx8KP.js";import{O as bt}from"./index-vlz-Aki7.js";import{e as en}from"./index-OM8C66gb.js";import"./index-BF7hghuG.js";import"./index-B1eEwkzz.js";import{N as tn}from"./NavigationUtil-DmfK5sOV.js";import"./index-7e_Syhad.js";import"./index-BK186nFF.js";import"./react-DehiWSvs.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./index-Cl0OwOQC.js";import"./events-DQ172AOg.js";import"./index-BqMHKneq.js";import"./index-DI-3MKLG.js";import"./index-nibyPLVP.js";import"./index-yp3Medz4.js";import"./index.es-BG9tAoxq.js";import"./browser-ponyfill-I5CKtKME.js";import"./ConstantsUtil-Di3dRDAF.js";import"./async-directive-BRxn_Py3.js";import"./browser-CqsLPmeb.js";const nn=v`
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as g,b as e}from"./lit-element-B3y9oplH.js";import{r as f,n as w,o as v}from"./class-map-CxwNmq0D.js";import{d as y,r as k,e as P}from"./index-
|
|
1
|
+
import{i as g,b as e}from"./lit-element-B3y9oplH.js";import{r as f,n as w,o as v}from"./class-map-CxwNmq0D.js";import{d as y,r as k,e as P}from"./index-D6jXV4v6.js";import{c as b}from"./index-BMDKd-Ff.js";import"./index-DbyFw-p2.js";import{H as x}from"./HelpersUtil-B2odRbT4.js";import{R as u,E as A}from"./W3MFrameProviderSingleton-CtKoZGPW.js";import"./index-DoaAKgT7.js";import"./index-fkuvr7Fy.js";const I=y`
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as h,b as d}from"./lit-element-B3y9oplH.js";import{n as i,o as c}from"./class-map-CxwNmq0D.js";import"./index-
|
|
1
|
+
import{i as h,b as d}from"./lit-element-B3y9oplH.js";import{n as i,o as c}from"./class-map-CxwNmq0D.js";import"./index-BNXLnSJ4.js";import{c as m}from"./index-BMDKd-Ff.js";import{d as g,r as y,e as f}from"./index-D6jXV4v6.js";const b=g`
|
|
2
2
|
:host {
|
|
3
3
|
width: 100%;
|
|
4
4
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/fortmatic-EI5cNLV0.js","_assets/react-DehiWSvs.js","_assets/index-CjpWKs8Q.js","_assets/dcl-schemas-Dr9BTjb7.js","_assets/ethers-CtNGBird.js","_assets/sentry-973sfbO9.js","_assets/index-COjgItKg.js","_assets/index-l92NuJVf.js","_assets/index-CTpdUOYC.js","_assets/hooks.module-C4R15-Vr.js","_assets/events-DQ172AOg.js","_assets/intl-CBcMB1D2.js","_assets/index-
|
|
2
|
-
var ce=Object.defineProperty;var de=(o,n,e)=>n in o?ce(o,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[n]=e;var d=(o,n,e)=>de(o,typeof n!="symbol"?n+"":n,e);import{c as h,e as l,f as g}from"./dcl-schemas-Dr9BTjb7.js";import{g as ue}from"./react-DehiWSvs.js";import{r as he}from"./events-DQ172AOg.js";import{_ as m}from"./index-BqH8KAmH.js";var C;(function(o){o.Update="Web3ReactUpdate",o.Error="Web3ReactError",o.Deactivate="Web3ReactDeactivate"})(C||(C={}));const le={clientId:"e1adce863fe287bb6cf0e3fd90bdb77f",chains:[h.ChainId.ETHEREUM_MAINNET,h.ChainId.ETHEREUM_SEPOLIA,h.ChainId.MATIC_MAINNET,h.ChainId.MATIC_AMOY]},pe={storageKey:"decentraland-connect-storage-key",[l.ProviderType.INJECTED]:{},[l.ProviderType.FORTMATIC]:{apiKeys:{[h.ChainId.ETHEREUM_MAINNET]:"pk_live_F8E24DF8DD5BCBC5",[h.ChainId.ETHEREUM_SEPOLIA]:"pk_test_5B728BEFE5C10911"},urls:A(l.ProviderType.FORTMATIC)},[l.ProviderType.NETWORK]:{urls:A(l.ProviderType.NETWORK)},[l.ProviderType.WALLET_LINK]:{appName:"Decentraland",urls:A(l.ProviderType.WALLET_LINK)},[l.ProviderType.WALLET_CONNECT_V2]:{projectId:"61570c542c2d66c659492e5b24a41522",urls:A(l.ProviderType.WALLET_CONNECT_V2),chains:[h.ChainId.ETHEREUM_MAINNET,h.ChainId.ETHEREUM_SEPOLIA,h.ChainId.MATIC_MAINNET,h.ChainId.MATIC_AMOY,h.ChainId.ARBITRUM_MAINNET,h.ChainId.OPTIMISM_MAINNET,h.ChainId.AVALANCHE_MAINNET,h.ChainId.BSC_MAINNET,h.ChainId.FANTOM_MAINNET]},[l.ProviderType.MAGIC]:{apiKey:"pk_live_212568025B158355",urls:A(l.ProviderType.MAGIC),chains:[h.ChainId.ETHEREUM_MAINNET,h.ChainId.ETHEREUM_SEPOLIA,h.ChainId.MATIC_MAINNET,h.ChainId.MATIC_AMOY,h.ChainId.OPTIMISM_MAINNET,h.ChainId.ARBITRUM_MAINNET,h.ChainId.AVALANCHE_MAINNET,h.ChainId.BSC_MAINNET,h.ChainId.FANTOM_MAINNET]},[l.ProviderType.MAGIC_TEST]:{apiKey:"pk_live_CE856A4938B36648",urls:A(l.ProviderType.MAGIC),chains:[h.ChainId.ETHEREUM_MAINNET,h.ChainId.ETHEREUM_SEPOLIA,h.ChainId.MATIC_MAINNET,h.ChainId.MATIC_AMOY,h.ChainId.OPTIMISM_MAINNET,h.ChainId.ARBITRUM_MAINNET,h.ChainId.AVALANCHE_MAINNET,h.ChainId.BSC_MAINNET,h.ChainId.FANTOM_MAINNET]},thirdweb:le};function I(){return pe}function A(o){const n={[h.ChainId.ETHEREUM_MAINNET]:"https://rpc.decentraland.org/mainnet",[h.ChainId.ETHEREUM_SEPOLIA]:"https://rpc.decentraland.org/sepolia",[h.ChainId.MATIC_MAINNET]:"https://rpc.decentraland.org/polygon",[h.ChainId.MATIC_AMOY]:"https://rpc.decentraland.org/amoy",[h.ChainId.ARBITRUM_MAINNET]:"https://rpc.decentraland.org/arbitrum",[h.ChainId.OPTIMISM_MAINNET]:"https://rpc.decentraland.org/optimism",[h.ChainId.AVALANCHE_MAINNET]:"https://rpc.decentraland.org/avalanche",[h.ChainId.BSC_MAINNET]:"https://rpc.decentraland.org/binance",[h.ChainId.FANTOM_MAINNET]:"https://rpc.decentraland.org/fantom"};let e="";switch(o){case l.ProviderType.WALLET_LINK:e="walletlink";break;case l.ProviderType.FORTMATIC:e="fortmatic";break;case l.ProviderType.MAGIC:e="magic";break;case l.ProviderType.MAGIC_TEST:e="magic";break;case l.ProviderType.WALLET_CONNECT_V2:e="walletconnect-v2";break;case l.ProviderType.THIRDWEB:e="thirdweb";break}if(e){const t=Object.keys(n);for(const r of t)n[r]+=`?project=${e}`}return n}var $=he();const je=ue($);function fe(o,n){o.prototype=Object.create(n.prototype),o.prototype.constructor=o,o.__proto__=n}var E=(function(o){fe(n,o);function n(t){var r,i=t===void 0?{}:t,s=i.supportedChainIds;return r=o.call(this)||this,r.supportedChainIds=s,r}var e=n.prototype;return e.emitUpdate=function(r){this.emit(C.Update,r)},e.emitError=function(r){this.emit(C.Error,r)},e.emitDeactivate=function(){this.emit(C.Deactivate)},n})($.EventEmitter);class z extends E{constructor(e){const t=I()[g.ProviderType.FORTMATIC],r=Object.keys(t.apiKeys).map(i=>Number(i));if(!r.includes(e))throw new Error(`Invariant error: Unsupported chainId ${e}`);super({supportedChainIds:r});d(this,"apiKey");d(this,"chainId");d(this,"rpcUrl");d(this,"fortmatic");this.apiKey=t.apiKeys[e],this.chainId=e,this.rpcUrl=t.urls[e]}async activate(){if(!this.fortmatic){const{default:t}=await m(async()=>{const{default:r}=await import("./fortmatic-EI5cNLV0.js").then(i=>i.f);return{default:r}},__vite__mapDeps([0,1]));this.fortmatic=new t(this.apiKey,{rpcUrl:this.rpcUrl,chainId:this.chainId})}const e=await this.fortmatic.getProvider().enable().then(t=>t[0]);return{provider:this.fortmatic.getProvider(),chainId:this.chainId,account:e}}getApiKey(){return this.apiKey}async getProvider(){return this.fortmatic.getProvider()}async getChainId(){return this.chainId}async getAccount(){return this.fortmatic.getProvider().send("eth_accounts").then(e=>e[0])}deactivate(){}close(){return this.fortmatic.user.logout()}}function j(){return j=Object.assign||function(o){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(o[t]=e[t])}return o},j.apply(this,arguments)}function q(o,n){o.prototype=Object.create(n.prototype),o.prototype.constructor=o,o.__proto__=n}function K(o){return K=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},K(o)}function L(o,n){return L=Object.setPrototypeOf||function(t,r){return t.__proto__=r,t},L(o,n)}function ve(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function O(o,n,e){return ve()?O=Reflect.construct:O=function(r,i,s){var a=[null];a.push.apply(a,i);var c=Function.bind.apply(r,a),u=new c;return s&&L(u,s.prototype),u},O.apply(null,arguments)}function we(o){return Function.toString.call(o).indexOf("[native code]")!==-1}function S(o){var n=typeof Map=="function"?new Map:void 0;return S=function(t){if(t===null||!we(t))return t;if(typeof t!="function")throw new TypeError("Super expression must either be null or a function");if(typeof n<"u"){if(n.has(t))return n.get(t);n.set(t,r)}function r(){return O(t,arguments,K(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),L(r,t)},S(o)}function b(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}typeof Symbol<"u"&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")));typeof Symbol<"u"&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));function P(o,n){try{var e=o()}catch(t){return n(t)}return e&&e.then?e.then(void 0,n):e}function y(o){return o.hasOwnProperty("result")?o.result:o}var k=(function(o){q(n,o);function n(){var e;return e=o.call(this)||this,e.name=e.constructor.name,e.message="No Ethereum provider was found on window.ethereum.",e}return n})(S(Error)),ge=(function(o){q(n,o);function n(){var e;return e=o.call(this)||this,e.name=e.constructor.name,e.message="The user rejected the request.",e}return n})(S(Error)),me=(function(o){q(n,o);function n(t){var r;return r=o.call(this,t)||this,r.handleNetworkChanged=r.handleNetworkChanged.bind(b(r)),r.handleChainChanged=r.handleChainChanged.bind(b(r)),r.handleAccountsChanged=r.handleAccountsChanged.bind(b(r)),r.handleClose=r.handleClose.bind(b(r)),r}var e=n.prototype;return e.handleChainChanged=function(r){this.emitUpdate({chainId:r,provider:window.ethereum})},e.handleAccountsChanged=function(r){r.length===0?this.emitDeactivate():this.emitUpdate({account:r[0]})},e.handleClose=function(r,i){this.emitDeactivate()},e.handleNetworkChanged=function(r){this.emitUpdate({chainId:r,provider:window.ethereum})},e.activate=function(){try{var r=function(f){if(i)return f;function p(){return j({provider:window.ethereum},a?{account:a}:{})}var v=(function(){if(!a)return Promise.resolve(window.ethereum.enable().then(function(T){return T&&y(T)[0]})).then(function(T){a=T})})();return v&&v.then?v.then(p):p(v)},i=!1,s=this;if(!window.ethereum)throw new k;window.ethereum.on&&(window.ethereum.on("chainChanged",s.handleChainChanged),window.ethereum.on("accountsChanged",s.handleAccountsChanged),window.ethereum.on("close",s.handleClose),window.ethereum.on("networkChanged",s.handleNetworkChanged)),window.ethereum.isMetaMask&&(window.ethereum.autoRefreshOnNetworkChange=!1);var a,c=P(function(){return Promise.resolve(window.ethereum.send("eth_requestAccounts").then(function(u){return y(u)[0]})).then(function(u){a=u})},function(u){if(u.code===4001)throw new ge});return Promise.resolve(c&&c.then?c.then(r):r(c))}catch(u){return Promise.reject(u)}},e.getProvider=function(){try{return Promise.resolve(window.ethereum)}catch(r){return Promise.reject(r)}},e.getChainId=function(){try{var r=function(){function c(){if(!i)try{i=y(window.ethereum.send({method:"net_version"}))}catch{}return i||(window.ethereum.isDapper?i=y(window.ethereum.cachedResults.net_version):i=window.ethereum.chainId||window.ethereum.netVersion||window.ethereum.networkVersion||window.ethereum._chainId),i}var u=(function(){if(!i){var f=P(function(){return Promise.resolve(window.ethereum.send("net_version").then(y)).then(function(p){i=p})},function(){});if(f&&f.then)return f.then(function(){})}})();return u&&u.then?u.then(c):c(u)};if(!window.ethereum)throw new k;var i,s=P(function(){return Promise.resolve(window.ethereum.send("eth_chainId").then(y)).then(function(a){i=a})},function(){});return Promise.resolve(s&&s.then?s.then(r):r(s))}catch(a){return Promise.reject(a)}},e.getAccount=function(){try{var r=function(){function c(){return i||(i=y(window.ethereum.send({method:"eth_accounts"}))[0]),i}var u=(function(){if(!i){var f=P(function(){return Promise.resolve(window.ethereum.enable().then(function(p){return y(p)[0]})).then(function(p){i=p})},function(){});if(f&&f.then)return f.then(function(){})}})();return u&&u.then?u.then(c):c(u)};if(!window.ethereum)throw new k;var i,s=P(function(){return Promise.resolve(window.ethereum.send("eth_accounts").then(function(a){return y(a)[0]})).then(function(a){i=a})},function(){});return Promise.resolve(s&&s.then?s.then(r):r(s))}catch(a){return Promise.reject(a)}},e.deactivate=function(){window.ethereum&&window.ethereum.removeListener&&(window.ethereum.removeListener("chainChanged",this.handleChainChanged),window.ethereum.removeListener("accountsChanged",this.handleAccountsChanged),window.ethereum.removeListener("close",this.handleClose),window.ethereum.removeListener("networkChanged",this.handleNetworkChanged))},e.isAuthorized=function(){try{return window.ethereum?Promise.resolve(P(function(){return Promise.resolve(window.ethereum.send("eth_accounts").then(function(r){return y(r).length>0}))},function(){return!1})):Promise.resolve(!1)}catch(r){return Promise.reject(r)}},n})(E);class G extends Error{constructor(){super("There was an error unlocking your wallet. Please be sure your wallet is unlocked and try again."),this.name="ErrorUnlockingWallet"}}const Ie=60*1e3;class J extends me{constructor(n){super({supportedChainIds:[n]})}async activate(){const n=new Promise((t,r)=>{setTimeout(()=>{r(new G)},Ie)}),e=super.activate();return Promise.race([e,n])}}var ye="Invariant failed";function V(o,n){throw new Error(ye)}function Y(o,n){o.prototype=Object.create(n.prototype),o.prototype.constructor=o,N(o,n)}function D(o){return D=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},D(o)}function N(o,n){return N=Object.setPrototypeOf||function(t,r){return t.__proto__=r,t},N(o,n)}function Ce(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function R(o,n,e){return Ce()?R=Reflect.construct:R=function(r,i,s){var a=[null];a.push.apply(a,i);var c=Function.bind.apply(r,a),u=new c;return s&&N(u,s.prototype),u},R.apply(null,arguments)}function Ee(o){return Function.toString.call(o).indexOf("[native code]")!==-1}function W(o){var n=typeof Map=="function"?new Map:void 0;return W=function(t){if(t===null||!Ee(t))return t;if(typeof t!="function")throw new TypeError("Super expression must either be null or a function");if(typeof n<"u"){if(n.has(t))return n.get(t);n.set(t,r)}function r(){return R(t,arguments,D(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),N(r,t)},W(o)}var U=(function(o){Y(n,o);function n(e,t,r){var i;return i=o.call(this)||this,i.code=t,i.data=r,i.name=i.constructor.name,i.message=e,i}return n})(W(Error)),Ae=function(n,e){var t=this,r=this;this.isMetaMask=!1,this.sendAsync=function(s,a){console.log("sendAsync",s.method,s.params),r.request(s.method,s.params).then(function(c){return a(null,{jsonrpc:"2.0",id:s.id,result:c})}).catch(function(c){return a(c,null)})},this.request=function(s,a){try{return typeof s!="string"&&(a=s.params,s=s.method),Promise.resolve(fetch(t.url,{method:"POST",body:JSON.stringify({jsonrpc:"2.0",id:1,method:s,params:a}),headers:{"Content-Type":"application/json"}})).then(function(c){if(!c.ok)throw new U(c.status+": "+c.statusText,-32e3);return Promise.resolve(c.json()).then(function(u){if("error"in u){var f,p,v;throw new U(u==null||(f=u.error)==null?void 0:f.message,u==null||(p=u.error)==null?void 0:p.code,u==null||(v=u.error)==null?void 0:v.data)}else{if("result"in u)return u.result;throw new U("Received unexpected JSON-RPC response to "+s+" request.",-32e3,u)}})})}catch(c){return Promise.reject(c)}},this.chainId=n,this.url=e;var i=new URL(e);this.host=i.host,this.path=i.pathname},Te=(function(o){Y(n,o);function n(t){var r,i=t.urls,s=t.defaultChainId;return s||Object.keys(i).length===1||V(),r=o.call(this,{supportedChainIds:Object.keys(i).map(function(a){return Number(a)})})||this,r.currentChainId=s||Number(Object.keys(i)[0]),r.providers=Object.keys(i).reduce(function(a,c){return a[Number(c)]=new Ae(Number(c),i[Number(c)]),a},{}),r}var e=n.prototype;return e.activate=function(){try{var r=this;return Promise.resolve({provider:r.providers[r.currentChainId],chainId:r.currentChainId,account:null})}catch(i){return Promise.reject(i)}},e.getProvider=function(){try{var r=this;return Promise.resolve(r.providers[r.currentChainId])}catch(i){return Promise.reject(i)}},e.getChainId=function(){try{var r=this;return Promise.resolve(r.currentChainId)}catch(i){return Promise.reject(i)}},e.getAccount=function(){return Promise.resolve(null)},e.deactivate=function(){},e.changeChainId=function(r){Object.keys(this.providers).includes(r.toString())||V(),this.currentChainId=r,this.emitUpdate({provider:this.providers[this.currentChainId],chainId:r})},n})(E);class Q extends Te{constructor(n){super({urls:I()[l.ProviderType.NETWORK].urls,defaultChainId:n})}}function x(){return x=Object.assign||function(o){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(o[t]=e[t])}return o},x.apply(this,arguments)}function Pe(o,n){o.prototype=Object.create(n.prototype),o.prototype.constructor=o,F(o,n)}function F(o,n){return F=Object.setPrototypeOf||function(t,r){return t.__proto__=r,t},F(o,n)}function B(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}var _e=1,Ne=(function(o){Pe(n,o);function n(t){var r,i=t.url,s=t.appName,a=t.appLogoUrl,c=t.darkMode,u=t.supportedChainIds;return r=o.call(this,{supportedChainIds:u})||this,r.url=i,r.appName=s,r.appLogoUrl=a,r.darkMode=c||!1,r.handleChainChanged=r.handleChainChanged.bind(B(r)),r.handleAccountsChanged=r.handleAccountsChanged.bind(B(r)),r}var e=n.prototype;return e.activate=function(){try{var r=this,i=function(){return Promise.resolve(r.provider.request({method:"eth_requestAccounts"})).then(function(c){var u=c[0];return r.provider.on("chainChanged",r.handleChainChanged),r.provider.on("accountsChanged",r.handleAccountsChanged),{provider:r.provider,account:u}})},s=(function(){if(window.ethereum&&window.ethereum.isCoinbaseWallet===!0)r.provider=window.ethereum;else{var a=(function(){if(!r.walletLink)return Promise.resolve(m(()=>import("./index-CjpWKs8Q.js").then(c=>c.i),__vite__mapDeps([2,1,3,4,5,6,7,8,9,10,11])).then(function(c){var u;return(u=c==null?void 0:c.default)!=null?u:c})).then(function(c){r.walletLink=new c(x({appName:r.appName,darkMode:r.darkMode},r.appLogoUrl?{appLogoUrl:r.appLogoUrl}:{})),r.provider=r.walletLink.makeWeb3Provider(r.url,_e)})})();if(a&&a.then)return a.then(function(){})}})();return Promise.resolve(s&&s.then?s.then(i):i(s))}catch(a){return Promise.reject(a)}},e.getProvider=function(){try{var r=this;return Promise.resolve(r.provider)}catch(i){return Promise.reject(i)}},e.getChainId=function(){try{var r=this;return Promise.resolve(r.provider.chainId)}catch(i){return Promise.reject(i)}},e.getAccount=function(){try{var r=this;return Promise.resolve(r.provider.request({method:"eth_requestAccounts"})).then(function(i){return i[0]})}catch(i){return Promise.reject(i)}},e.deactivate=function(){this.provider.removeListener("chainChanged",this.handleChainChanged),this.provider.removeListener("accountsChanged",this.handleAccountsChanged)},e.close=function(){try{var r=this;return r.provider.close(),r.emitDeactivate(),Promise.resolve()}catch(i){return Promise.reject(i)}},e.handleChainChanged=function(r){this.emitUpdate({chainId:r})},e.handleAccountsChanged=function(r){this.emitUpdate({account:r[0]})},n})(E);class X extends Ne{constructor(n){const e=I()[g.ProviderType.WALLET_LINK],t=e.urls[n];if(!t)throw new Error(`Unsupported chainId for WalletLink: ${n}. Supported chains: ${Object.keys(e.urls).join(", ")}`);super({url:t,appName:e.appName,supportedChainIds:[n]})}}class Me{}class Z extends Me{get(n){const e=window.localStorage.getItem(n);return e===null?void 0:e}set(n,e){window.localStorage.setItem(n,e)}remove(n){window.localStorage.removeItem(n)}removeRegExp(n){for(let e=localStorage.length-1;e>=0;e--){const t=localStorage.key(e);t&&n.test(t)&&localStorage.removeItem(t)}}}const be={[g.ChainId.ETHEREUM_MAINNET]:"mainnet",[g.ChainId.ETHEREUM_SEPOLIA]:"sepolia",[g.ChainId.MATIC_MAINNET]:"polygon",[g.ChainId.MATIC_AMOY]:"polygonAmoy",[g.ChainId.ARBITRUM_MAINNET]:"arbitrum",[g.ChainId.OPTIMISM_MAINNET]:"optimism",[g.ChainId.AVALANCHE_MAINNET]:"avalanche",[g.ChainId.BSC_MAINNET]:"bsc",[g.ChainId.FANTOM_MAINNET]:"fantom"},w=class w extends E{constructor(e){super({supportedChainIds:w.configuration.chains});d(this,"desiredChainId");d(this,"appKit");d(this,"provider");d(this,"accountUnsubscribe");d(this,"networkUnsubscribe");d(this,"initAppKit",async()=>{if(w.sharedAppKit)return this.appKit=w.sharedAppKit,this.appKit;const{createAppKit:e}=await m(async()=>{const{createAppKit:s}=await import("./index-DW8xuXKL.js").then(a=>a.h);return{createAppKit:s}},__vite__mapDeps([12,13,1,5,3,4,11,14,15,16,17,18,19,20,21,22,23])),{WagmiAdapter:t}=await m(async()=>{const{WagmiAdapter:s}=await import("./index-rurXcTSu.js").then(a=>a.b);return{WagmiAdapter:s}},__vite__mapDeps([24,15,3,16,1,5,17,18,13,4,11,14,25,26,6,27,28,29])),r=await this.getNetworks(),i=new t({networks:r,projectId:w.configuration.projectId});return this.appKit=e({adapters:[i],projectId:w.configuration.projectId,networks:r,defaultNetwork:r[0],metadata:{name:"Decentraland",description:"Decentraland - Virtual World",url:typeof window<"u"?window.location.origin:"https://decentraland.org",icons:["https://decentraland.org/favicon.ico"]},themeMode:"dark",themeVariables:{"--w3m-z-index":3e3},features:{analytics:!1,email:!1,socials:!1,onramp:!1,swaps:!1},enableInjected:!0,enableEIP6963:!0}),w.sharedAppKit=this.appKit,await this.waitForSessionRestore(),this.appKit});d(this,"waitForSessionRestore",async()=>{const e=this.appKit;if(!e)return;const t=e.getAccount();if((t==null?void 0:t.status)==="connected"||(t==null?void 0:t.status)==="disconnected")return;const r=t!=null&&t.status?5e3:500;return new Promise(i=>{const s=setTimeout(()=>{a==null||a(),i()},r),a=e.subscribeAccount(c=>{((c==null?void 0:c.status)==="connected"||(c==null?void 0:c.status)==="disconnected")&&(clearTimeout(s),a==null||a(),i())},"eip155")})});d(this,"validateRestoredSession",async e=>{try{const t=e.getWalletProvider();return t?(await t.request({method:"eth_chainId"}),!0):!1}catch(t){return w.isStaleSessionError(t)?!1:(console.warn("Error validating WalletConnect session:",t),!0)}});d(this,"openModalAndWaitForConnection",async()=>{const e=this.requireAppKit(),t=()=>new Promise((r,i)=>{let s=!1;const a=(p,v)=>{s||(s=!0,clearTimeout(c),p==null||p(),v==null||v())},c=setTimeout(()=>{a(),i(new Error("Connection timeout"))},3e5),u=e.subscribeAccount(p=>{p!=null&&p.isConnected&&(p!=null&&p.address)&&(a(u,f),r(p.address))},"eip155"),f=e.subscribeState(p=>{!p.open&&!e.getAddress("eip155")&&(a(u,f),i(new Error("User closed the modal without connecting")))})});try{await e.open({view:"Connect"}),await t()}catch(r){if(w.isStaleSessionError(r)){if(console.warn("Stale session detected, retrying connection..."),w.clearStorage(),await this.initAppKit(),!this.appKit)throw new Error("AppKit reinitialization failed");await this.appKit.open({view:"Connect"}),await t()}else throw r}});d(this,"activate",async()=>{try{await this.initAppKit()}catch(c){if(console.error("Error initializing AppKit",c),w.isStaleSessionError(c))console.warn("WalletConnect session is stale, clearing storage and retrying..."),w.clearStorage(),await this.initAppKit();else throw c}const e=this.requireAppKit(),t=e.getAccount();(t==null?void 0:t.status)==="connected"&&(t==null?void 0:t.address)?await this.validateRestoredSession(e)||(console.warn("Restored WalletConnect session is stale, clearing and prompting reconnection..."),w.clearStorage(),await this.initAppKit(),await this.openModalAndWaitForConnection()):await this.openModalAndWaitForConnection();const i=e.getWalletProvider();if(!i)throw new Error("Failed to get wallet provider after connection");this.provider=i,this.accountUnsubscribe=e.subscribeAccount(c=>{c!=null&&c.address&&this.handleAccountsChanged([c.address])},"eip155"),this.networkUnsubscribe=e.subscribeCaipNetworkChange(c=>{c!=null&&c.id&&this.handleChainChanged(c.id)});const s=e.getAddress("eip155");return{chainId:e.getChainId()||this.desiredChainId,account:s||null,provider:this.provider}});d(this,"getProvider",async()=>{if(!this.provider)throw new Error("Provider is undefined");return this.provider});d(this,"getChainId",async()=>this.requireAppKit().getChainId()??this.desiredChainId);d(this,"getAccount",async()=>this.requireAppKit().getAddress("eip155")??null);d(this,"getWalletName",()=>{var e,t,r;return(r=(t=(e=this.appKit)==null?void 0:e.getWalletInfo)==null?void 0:t.call(e,"eip155"))==null?void 0:r.name});d(this,"deactivate",()=>{});d(this,"clearInstance",()=>{var t,r;const e=this.provider;if(e){this.provider=void 0;try{(t=this.accountUnsubscribe)==null||t.call(this),(r=this.networkUnsubscribe)==null||r.call(this)}catch(i){console.warn("Error unsubscribing from AppKit events:",i)}return this.accountUnsubscribe=void 0,this.networkUnsubscribe=void 0,e}});d(this,"close",async()=>{var t;if(this.clearInstance()){try{await((t=this.appKit)==null?void 0:t.disconnect())}catch(r){console.warn("Error during WalletConnect disconnect:",r)}this.appKit=void 0}});d(this,"handleAccountsChanged",e=>{this.emitUpdate({account:e[0]})});d(this,"handleChainChanged",e=>{this.emitUpdate({chainId:e})});d(this,"handleDisconnect",()=>{this.clearInstance(),this.emitDeactivate()});this.desiredChainId=e}requireAppKit(){if(!this.appKit)throw new Error("AppKit is not initialized");return this.appKit}static isStaleSessionError(e){if(e instanceof Error){const t=e.message.toLowerCase();return t.includes("no matching key")||t.includes("session topic doesn't exist")||t.includes("missing or invalid")||t.includes("expired")||t.includes("user rejected methods")||t.includes("is not configured")||t.includes("cannot read properties")||t.includes("undefined is not an object")}return!1}async getNetworks(){const e=w.configuration.chains,t=await m(()=>import("./networks-0i8YZqHL.js"),__vite__mapDeps([30,18,5,1,31,32,25,13,3,4,11,14,33,34,29])),r=e.map(s=>{const a=be[s];if(a)return t[a]}).filter(s=>s!==void 0);if(r.length===0)throw new Error("No supported networks found for WalletConnect");const i=r.find(s=>s.id===this.desiredChainId);if(i){const s=r.filter(a=>a.id!==this.desiredChainId);return[i,...s]}return[r[0],...r.slice(1)]}};d(w,"configuration",I()[g.ProviderType.WALLET_CONNECT_V2]),d(w,"clearStorage",(e=new Z)=>{e.removeRegExp(new RegExp("^wc@2:")),e.removeRegExp(new RegExp("^@appkit")),w.sharedAppKit=null}),d(w,"sharedAppKit",null);let _=w;class H extends E{constructor(e,t=!1){super({supportedChainIds:I()[g.ProviderType.MAGIC].chains});d(this,"isTest");d(this,"chainId");d(this,"account");d(this,"magic");d(this,"activate",async()=>{if(this.magic=await this.buildMagicInstance(this.chainId),!await this.magic.user.isLoggedIn())throw new Error("Magic: user isn't logged in");const t=await this.getProvider(),r=await t.request({method:"eth_accounts"});return this.account=r[0]??null,{provider:t,chainId:this.chainId,account:this.account}});d(this,"getProvider",async()=>{if(!this.magic)throw new Error("Magic: instance was not initialized");const e=await this.magic.wallet.getProvider();return{...e,isMagic:!0,request:new Proxy(e.request,{apply:async(t,r,i)=>{var s,a,c;if(((s=i[0])==null?void 0:s.method)==="wallet_switchEthereumChain")try{const u=parseInt((c=(a=i[0])==null?void 0:a.params[0])==null?void 0:c.chainId,16);return this.supportedChainIds&&!this.supportedChainIds.includes(u)?{code:2020202,message:"Unsupported Magic ChainId"}:(this.magic=await this.buildMagicInstance(u),this.emitUpdate({chainId:u}),null)}catch{return{code:2020201,message:"Error changing the Magic ChainId"}}return t.bind(e)(...i)}}),sendAsync:new Proxy(e.send,{apply:async(t,r,i)=>t.bind(e)(...i)})}});d(this,"getChainId",async()=>{if(!this.magic)throw new Error("Magic: instance was not initialized");return this.chainId});d(this,"getAccount",async()=>{if(!this.magic)throw new Error("Magic: instance was not initialized");return this.account});d(this,"getEmail",async()=>{try{if(!this.magic||!await this.magic.user.isLoggedIn())return;const t=await this.magic.user.getInfo();return(t==null?void 0:t.email)??void 0}catch{return}});d(this,"deactivate",()=>{});d(this,"buildMagicInstance",async e=>{const{Magic:t}=await m(async()=>{const{Magic:a}=await import("./index-CSlo2BeJ.js");return{Magic:a}},__vite__mapDeps([35,5,1,36])),{OAuthExtension:r}=await m(async()=>{const{OAuthExtension:a}=await import("./index-qsorFlMF.js");return{OAuthExtension:a}},__vite__mapDeps([37,36,5,1,38,7,8,4,10,3])),i=I()[this.isTest?g.ProviderType.MAGIC_TEST:g.ProviderType.MAGIC],s=i.urls[e];if(!s)throw new Error(`Unsupported chainId for Magic: ${e}. Supported chains: ${Object.keys(i.urls).join(", ")}`);return new t(i.apiKey,{extensions:[new r],network:{rpcUrl:s,chainId:e}})});this.isTest=t,this.chainId=e,this.account=null}close(){if(!this.magic)throw new Error("Magic: instance was not initialized");return this.magic.user.logout()}}class ee extends H{constructor(n){super(n,!0)}}class te extends E{constructor(e){var t;super({supportedChainIds:((t=I().thirdweb)==null?void 0:t.chains)??[h.ChainId.ETHEREUM_MAINNET,h.ChainId.ETHEREUM_SEPOLIA]});d(this,"chainId");d(this,"client");d(this,"wallet");d(this,"chain");d(this,"eip1193Provider");d(this,"activate",async()=>{const e=await this.getClient(),t=await this.getWallet();let r;try{r=await t.autoConnect({client:e})}catch{throw new Error("Thirdweb: No active session. User must authenticate first.")}if(!r)throw new Error("Thirdweb: No active session. User must authenticate first.");const i=await this.getChain(),{EIP1193:s}=await m(async()=>{const{EIP1193:u}=await import("./wallets-1JYF6nkF.js").then(f=>f.Q);return{EIP1193:u}},__vite__mapDeps([39,40,41,42,5,1,13,3,4,11,14,43,44,45,46,47,48,49,50,51,27,52,53,54,19,16,20,55,21]));return this.eip1193Provider=s.toProvider({wallet:t,chain:i,client:e}),{provider:await this.getProvider(),chainId:this.chainId,account:r.address}});d(this,"getProvider",async()=>{if(!this.eip1193Provider)throw new Error("Thirdweb: wallet is not connected. Call activate() first.");const e=this.eip1193Provider;return{...e,isDapper:!1,isFortmatic:!1,isMetamask:!1,isMagic:!1,isThirdweb:!0,request:new Proxy(e.request,{apply:async(t,r,i)=>{var a,c,u,f;if(((a=i[0])==null?void 0:a.method)==="wallet_switchEthereumChain"){const p=(f=(u=(c=i[0])==null?void 0:c.params)==null?void 0:u[0])==null?void 0:f.chainId,v=parseInt(p,16);if(this.supportedChainIds&&!this.supportedChainIds.includes(v))throw new Error("Thirdweb: unsupported chain");this.chainId=v,this.chain=null,this.eip1193Provider=null;const T=await this.getClient(),ne=await this.getWallet(),ie=await this.getChain(),{EIP1193:oe}=await m(async()=>{const{EIP1193:ae}=await import("./wallets-1JYF6nkF.js").then(se=>se.Q);return{EIP1193:ae}},__vite__mapDeps([39,40,41,42,5,1,13,3,4,11,14,43,44,45,46,47,48,49,50,51,27,52,53,54,19,16,20,55,21]));return this.eip1193Provider=oe.toProvider({wallet:ne,chain:ie,client:T}),this.emitUpdate({chainId:v}),null}return Reflect.apply(t,e,i)}}),sendAsync:new Proxy(e.request,{apply:async(t,r,i)=>Reflect.apply(t,e,i)})}});d(this,"getChainId",async()=>this.chainId);d(this,"getAccount",async()=>{if(!this.wallet)return null;try{const e=this.wallet.getAccount();return(e==null?void 0:e.address)??null}catch{return null}});d(this,"getEmail",async()=>{try{const e=await this.getClient(),{getUserEmail:t}=await m(async()=>{const{getUserEmail:i}=await import("./in-app-CtBGXFNg.js");return{getUserEmail:i}},__vite__mapDeps([56,41,42,5,1,47,46,13,3,4,11,14,57,58]));return await t({client:e})??void 0}catch{return}});d(this,"deactivate",()=>{});this.chainId=e,this.client=null,this.wallet=null,this.chain=null,this.eip1193Provider=null}async getClient(){if(this.client)return this.client;let e;try{e=await m(()=>import("./thirdweb-9nUi4NTx.js").then(r=>r.t),__vite__mapDeps([59,42,5,1,41,40,13,3,4,11,14,43,44,45,60,61,62,63,64,65,54,66,67,68,69,53]))}catch{throw new Error("Thirdweb: thirdweb package is not installed.")}const t=I().thirdweb;return this.client=e.createThirdwebClient({clientId:t.clientId}),this.client}async getWallet(){if(this.wallet)return this.wallet;let e;try{e=await m(()=>import("./wallets-1JYF6nkF.js").then(t=>t.Q),__vite__mapDeps([39,40,41,42,5,1,13,3,4,11,14,43,44,45,46,47,48,49,50,51,27,52,53,54,19,16,20,55,21]))}catch{throw new Error("Thirdweb: thirdweb package is not installed. Run: npm install thirdweb")}return this.wallet=e.inAppWallet(),this.wallet}async getChain(){if(this.chain)return this.chain;const e=await m(()=>import("./chains-DPlhC0Sw.js"),__vite__mapDeps([70,42,5,1,68,50]));return this.chain=e.defineChain(this.chainId),this.chain}async close(){this.wallet&&await this.wallet.disconnect(),this.wallet=null,this.chain=null,this.eip1193Provider=null}}class M{constructor(n){d(this,"provider");d(this,"id",0);d(this,"on",(n,e)=>this.provider.on(n,e));d(this,"emit",(n,...e)=>this.provider.emit(n,e));d(this,"removeListener",(n,e)=>this.provider.removeListener(n,e));d(this,"request",async({method:n,params:e})=>this.isModernProvider()?this.provider.request({method:n,params:e}):this.send(n,e));d(this,"sendAsync",async(n,e)=>this.hasSendAsync()?this.provider.sendAsync(n,(t,r)=>{r&&!Object.prototype.hasOwnProperty.call(r,"result")?e(t,{id:0,jsonrpc:"2.0",result:r}):e(t,r)}):this.send(n,e));this.provider=n}static adapt(n){const e=new M(n);return{...n,on:e.on,emit:e.emit,removeListener:e.removeListener,request:e.request,sendAsync:e.sendAsync,send:e.send.bind(e)}}async send(n,e){let t,r,i;const s=typeof e=="function";if(s){const a=n;r=a.params||[],t=a.method,i=e}else t=n,r=e||[],i=(a,c)=>{if(a)throw a;return c};if(this.isModernProvider()){const[a,c]=await this.provider.request({method:t,params:r}).then(f=>[null,f]).catch(f=>[f,void 0]);return i(a,s?{id:"",jsonrpc:"2.0",result:c}:c)}else{this.patchOldMobile();const[a,c]=s?await new Promise(u=>this.provider.send(n,(f,p)=>{u([f,p])})):await new Promise(u=>this.provider.send({jsonrpc:"2.0",id:++this.id,method:t,params:r},(f,p)=>{const v=p;u([(v==null?void 0:v.error)??f,(v==null?void 0:v.result)??p])}));return i(a,c)}}isModernProvider(){return"request"in this.provider&&typeof this.provider.request=="function"}hasSendAsync(){return typeof this.provider.sendAsync=="function"}patchOldMobile(){this.provider&&!this.provider.isDapper&&!this.provider.isFortmatic&&!this.provider.isMetamask&&this.hasSendAsync()&&this.provider.send!==this.provider.sendAsync&&(this.provider.send=this.provider.sendAsync.bind(this.provider))}}class re{constructor(n){d(this,"storage");d(this,"connector");d(this,"promiseOfConnection");d(this,"getWalletName",()=>{if(this.connector instanceof _)return this.connector.getWalletName()});d(this,"clearConnectionData",()=>{const{storageKey:n}=I();this.storage.remove(n),_.clearStorage(this.storage)});d(this,"handleWeb3ReactDeactivate",async()=>{try{await this.disconnect()}catch(n){console.error(n)}});this.storage=n}async connect(n,e=h.ChainId.ETHEREUM_MAINNET){if(this.connector)try{await this.disconnect()}catch(a){console.error("Error disconnecting previous connection",a)}const t=this.buildConnector(n,e);t.on(C.Deactivate,this.handleWeb3ReactDeactivate);let{provider:r,account:i}={};try{const a=await t.activate();r=a.provider,i=a.account}catch(a){throw console.error("Error activating the connector",a),a}(n===l.ProviderType.MAGIC||n===l.ProviderType.MAGIC_TEST||n===l.ProviderType.THIRDWEB)&&t.on(C.Update,({chainId:a})=>{a&&this.setConnectionData(n,a)});let s=e;if(n===l.ProviderType.INJECTED){const a=await r.request({method:"eth_chainId"});s=a?parseInt(a,16):s}return this.connector=t,this.setConnectionData(n,s),{provider:M.adapt(r),providerType:n,account:i||"",chainId:s}}isConnected(){return!!this.connector&&!!this.getConnectionData()}async tryPreviousConnection(){const n=this.getConnectionData();if(!n)throw new Error("Could not find a valid provider. Make sure to call the `connect` method first");if(this.connector){const[t,r]=await Promise.all([this.connector.getProvider(),this.connector.getAccount()]);return{provider:t,providerType:n.providerType,chainId:n.chainId,account:r||""}}let e;try{e=this.promiseOfConnection?await this.promiseOfConnection:await(this.promiseOfConnection=this.connect(n.providerType,n.chainId))}finally{this.promiseOfConnection=void 0}return{...e,chainId:this.getConnectionData().chainId}}getAvailableProviders(){const n=[l.ProviderType.FORTMATIC,l.ProviderType.WALLET_CONNECT,l.ProviderType.WALLET_LINK];return typeof window<"u"&&window.ethereum!==void 0?n.unshift(l.ProviderType.INJECTED):n.unshift(l.ProviderType.METAMASK_MOBILE),n}async disconnect(){this.connector&&(this.connector.removeAllListeners(C.Deactivate),this.connector.removeAllListeners(C.Update),this.connector.deactivate(),this.isClosableConnector()&&await this.connector.close()),this.clearConnectionData(),this.connector=void 0}async getProvider(){if(!this.connector)throw new Error("No valid connector found. Please .connect() first");return this.connector.getProvider()}async getEmail(){const n=this.connector;if(n!=null&&n.getEmail)try{return await n.getEmail()}catch{return}}async createProvider(n,e=h.ChainId.ETHEREUM_MAINNET){const r=await this.buildConnector(n,e).getProvider();return M.adapt(r)}buildConnector(n,e){switch(n){case l.ProviderType.INJECTED:return new J(e);case l.ProviderType.FORTMATIC:return new z(e);case l.ProviderType.MAGIC:return new H(e);case l.ProviderType.MAGIC_TEST:return new ee(e);case l.ProviderType.WALLET_LINK:return new X(e);case l.ProviderType.NETWORK:return new Q(e);case l.ProviderType.WALLET_CONNECT_V2:return new _(e);case l.ProviderType.THIRDWEB:return new te(e);default:throw new Error(`Invalid provider ${n}`)}}getConnectionData(){const{storageKey:n}=I(),e=this.storage.get(n);try{return e?JSON.parse(e):void 0}catch(t){console.error("Error parsing connection data",t);return}}storeConnectionData(n,e){this.setConnectionData(n,e)}setConnectionData(n,e){const{storageKey:t}=I(),r=JSON.stringify({providerType:n,chainId:e});this.storage.set(t,r)}isClosableConnector(){return this.connector&&"close"in this.connector}}const Oe=new re(new Z),Ke=Object.freeze(Object.defineProperty({__proto__:null,AbstractConnector:E,ConnectionManager:re,ErrorUnlockingWallet:G,FortmaticConnector:z,InjectedConnector:J,MagicConnector:H,MagicTestConnector:ee,NetworkConnector:Q,ProviderAdapter:M,ThirdwebConnector:te,WalletConnectV2Connector:_,WalletLinkConnector:X,connection:Oe,getConfiguration:I,getRpcUrls:A},Symbol.toStringTag,{value:"Module"}));export{je as N,Oe as c,$ as e,Ke as i};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/fortmatic-EI5cNLV0.js","_assets/react-DehiWSvs.js","_assets/index-CjpWKs8Q.js","_assets/dcl-schemas-Dr9BTjb7.js","_assets/ethers-CtNGBird.js","_assets/sentry-973sfbO9.js","_assets/index-COjgItKg.js","_assets/index-l92NuJVf.js","_assets/index-CTpdUOYC.js","_assets/hooks.module-C4R15-Vr.js","_assets/events-DQ172AOg.js","_assets/intl-CBcMB1D2.js","_assets/index-D6jXV4v6.js","_assets/index-BK186nFF.js","_assets/index-D-NhBWWr.css","_assets/W3MFrameProviderSingleton-CtKoZGPW.js","_assets/index-DI-3MKLG.js","_assets/browser-ponyfill-I5CKtKME.js","_assets/NetworkUtil-EoWQDMpU.js","_assets/index-BqMHKneq.js","_assets/index-nibyPLVP.js","_assets/index-yp3Medz4.js","_assets/index.es-BG9tAoxq.js","_assets/lit-element-B3y9oplH.js","_assets/index-B-wUrKiv.js","_assets/sendRawTransaction-Bp5LMxhF.js","_assets/index-CcbRdBPP.js","_assets/store-CraP4F4Y.js","_assets/custom-D9XFQnk4.js","_assets/writeContract-BWpBg5cs.js","_assets/networks-7mAev_So.js","_assets/zoraTestnet-YDHc7FSH.js","_assets/verifyHash-tFRgslhI.js","_assets/secp256k1-rc9cttcQ.js","_assets/serializeTransaction-CcoTA2oD.js","_assets/index-CSlo2BeJ.js","_assets/index-DftqIOqz.js","_assets/index-qsorFlMF.js","_assets/index-DG6oakSS.js","_assets/wallets-0QMnCoJB.js","_assets/signing-Dqg6cmff.js","_assets/prepare-contract-call-BnXbUbQT.js","_assets/utils-B9hEgCzc.js","_assets/to-serializable-transaction-Bs3gRQ4f.js","_assets/transaction-BRB0QRZP.js","_assets/get-bytecode-knYex1Eu.js","_assets/execute-mSR8LGc4.js","_assets/detectExtension-DEjVJeUh.js","_assets/linkAccount-BodpWbRq.js","_assets/index-BehGKAc6.js","_assets/ethereum-CliiIOgc.js","_assets/types-DC0Zmj1B.js","_assets/hashTypedData-C5G1DAop.js","_assets/send-transaction-DAsAIcLp.js","_assets/eth_sendRawTransaction-DPdnXbFR.js","_assets/index-CJdot1dH.js","_assets/in-app-BXEo5oJI.js","_assets/passkeys-CenbJOC4.js","_assets/uint8-array-CjVHUazS.js","_assets/thirdweb-CIKZzA4I.js","_assets/wait-for-tx-receipt-BlFYuYR0.js","_assets/transactionReceipt-Bp1hf_iD.js","_assets/sleep-mAKpSMLY.js","_assets/eth_estimateGas-BmR_JMy9.js","_assets/eth_getStorageAt-BUYdIAYw.js","_assets/eth_getTransactionCount-riJ8hG2K.js","_assets/decimals-BpjIyOut.js","_assets/decimals-B3pg7hp8.js","_assets/zora-sepolia-Dv22rzxP.js","_assets/send-batch-transaction-IhphBGXV.js","_assets/chains-DPlhC0Sw.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var ce=Object.defineProperty;var de=(o,n,e)=>n in o?ce(o,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[n]=e;var d=(o,n,e)=>de(o,typeof n!="symbol"?n+"":n,e);import{c as h,e as l,f as g}from"./dcl-schemas-Dr9BTjb7.js";import{g as ue}from"./react-DehiWSvs.js";import{r as he}from"./events-DQ172AOg.js";import{_ as m}from"./index-BK186nFF.js";var C;(function(o){o.Update="Web3ReactUpdate",o.Error="Web3ReactError",o.Deactivate="Web3ReactDeactivate"})(C||(C={}));const le={clientId:"e1adce863fe287bb6cf0e3fd90bdb77f",chains:[h.ChainId.ETHEREUM_MAINNET,h.ChainId.ETHEREUM_SEPOLIA,h.ChainId.MATIC_MAINNET,h.ChainId.MATIC_AMOY]},pe={storageKey:"decentraland-connect-storage-key",[l.ProviderType.INJECTED]:{},[l.ProviderType.FORTMATIC]:{apiKeys:{[h.ChainId.ETHEREUM_MAINNET]:"pk_live_F8E24DF8DD5BCBC5",[h.ChainId.ETHEREUM_SEPOLIA]:"pk_test_5B728BEFE5C10911"},urls:A(l.ProviderType.FORTMATIC)},[l.ProviderType.NETWORK]:{urls:A(l.ProviderType.NETWORK)},[l.ProviderType.WALLET_LINK]:{appName:"Decentraland",urls:A(l.ProviderType.WALLET_LINK)},[l.ProviderType.WALLET_CONNECT_V2]:{projectId:"61570c542c2d66c659492e5b24a41522",urls:A(l.ProviderType.WALLET_CONNECT_V2),chains:[h.ChainId.ETHEREUM_MAINNET,h.ChainId.ETHEREUM_SEPOLIA,h.ChainId.MATIC_MAINNET,h.ChainId.MATIC_AMOY,h.ChainId.ARBITRUM_MAINNET,h.ChainId.OPTIMISM_MAINNET,h.ChainId.AVALANCHE_MAINNET,h.ChainId.BSC_MAINNET,h.ChainId.FANTOM_MAINNET]},[l.ProviderType.MAGIC]:{apiKey:"pk_live_212568025B158355",urls:A(l.ProviderType.MAGIC),chains:[h.ChainId.ETHEREUM_MAINNET,h.ChainId.ETHEREUM_SEPOLIA,h.ChainId.MATIC_MAINNET,h.ChainId.MATIC_AMOY,h.ChainId.OPTIMISM_MAINNET,h.ChainId.ARBITRUM_MAINNET,h.ChainId.AVALANCHE_MAINNET,h.ChainId.BSC_MAINNET,h.ChainId.FANTOM_MAINNET]},[l.ProviderType.MAGIC_TEST]:{apiKey:"pk_live_CE856A4938B36648",urls:A(l.ProviderType.MAGIC),chains:[h.ChainId.ETHEREUM_MAINNET,h.ChainId.ETHEREUM_SEPOLIA,h.ChainId.MATIC_MAINNET,h.ChainId.MATIC_AMOY,h.ChainId.OPTIMISM_MAINNET,h.ChainId.ARBITRUM_MAINNET,h.ChainId.AVALANCHE_MAINNET,h.ChainId.BSC_MAINNET,h.ChainId.FANTOM_MAINNET]},thirdweb:le};function I(){return pe}function A(o){const n={[h.ChainId.ETHEREUM_MAINNET]:"https://rpc.decentraland.org/mainnet",[h.ChainId.ETHEREUM_SEPOLIA]:"https://rpc.decentraland.org/sepolia",[h.ChainId.MATIC_MAINNET]:"https://rpc.decentraland.org/polygon",[h.ChainId.MATIC_AMOY]:"https://rpc.decentraland.org/amoy",[h.ChainId.ARBITRUM_MAINNET]:"https://rpc.decentraland.org/arbitrum",[h.ChainId.OPTIMISM_MAINNET]:"https://rpc.decentraland.org/optimism",[h.ChainId.AVALANCHE_MAINNET]:"https://rpc.decentraland.org/avalanche",[h.ChainId.BSC_MAINNET]:"https://rpc.decentraland.org/binance",[h.ChainId.FANTOM_MAINNET]:"https://rpc.decentraland.org/fantom"};let e="";switch(o){case l.ProviderType.WALLET_LINK:e="walletlink";break;case l.ProviderType.FORTMATIC:e="fortmatic";break;case l.ProviderType.MAGIC:e="magic";break;case l.ProviderType.MAGIC_TEST:e="magic";break;case l.ProviderType.WALLET_CONNECT_V2:e="walletconnect-v2";break;case l.ProviderType.THIRDWEB:e="thirdweb";break}if(e){const t=Object.keys(n);for(const r of t)n[r]+=`?project=${e}`}return n}var $=he();const je=ue($);function fe(o,n){o.prototype=Object.create(n.prototype),o.prototype.constructor=o,o.__proto__=n}var E=(function(o){fe(n,o);function n(t){var r,i=t===void 0?{}:t,s=i.supportedChainIds;return r=o.call(this)||this,r.supportedChainIds=s,r}var e=n.prototype;return e.emitUpdate=function(r){this.emit(C.Update,r)},e.emitError=function(r){this.emit(C.Error,r)},e.emitDeactivate=function(){this.emit(C.Deactivate)},n})($.EventEmitter);class z extends E{constructor(e){const t=I()[g.ProviderType.FORTMATIC],r=Object.keys(t.apiKeys).map(i=>Number(i));if(!r.includes(e))throw new Error(`Invariant error: Unsupported chainId ${e}`);super({supportedChainIds:r});d(this,"apiKey");d(this,"chainId");d(this,"rpcUrl");d(this,"fortmatic");this.apiKey=t.apiKeys[e],this.chainId=e,this.rpcUrl=t.urls[e]}async activate(){if(!this.fortmatic){const{default:t}=await m(async()=>{const{default:r}=await import("./fortmatic-EI5cNLV0.js").then(i=>i.f);return{default:r}},__vite__mapDeps([0,1]));this.fortmatic=new t(this.apiKey,{rpcUrl:this.rpcUrl,chainId:this.chainId})}const e=await this.fortmatic.getProvider().enable().then(t=>t[0]);return{provider:this.fortmatic.getProvider(),chainId:this.chainId,account:e}}getApiKey(){return this.apiKey}async getProvider(){return this.fortmatic.getProvider()}async getChainId(){return this.chainId}async getAccount(){return this.fortmatic.getProvider().send("eth_accounts").then(e=>e[0])}deactivate(){}close(){return this.fortmatic.user.logout()}}function j(){return j=Object.assign||function(o){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(o[t]=e[t])}return o},j.apply(this,arguments)}function q(o,n){o.prototype=Object.create(n.prototype),o.prototype.constructor=o,o.__proto__=n}function K(o){return K=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},K(o)}function L(o,n){return L=Object.setPrototypeOf||function(t,r){return t.__proto__=r,t},L(o,n)}function ve(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function O(o,n,e){return ve()?O=Reflect.construct:O=function(r,i,s){var a=[null];a.push.apply(a,i);var c=Function.bind.apply(r,a),u=new c;return s&&L(u,s.prototype),u},O.apply(null,arguments)}function we(o){return Function.toString.call(o).indexOf("[native code]")!==-1}function S(o){var n=typeof Map=="function"?new Map:void 0;return S=function(t){if(t===null||!we(t))return t;if(typeof t!="function")throw new TypeError("Super expression must either be null or a function");if(typeof n<"u"){if(n.has(t))return n.get(t);n.set(t,r)}function r(){return O(t,arguments,K(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),L(r,t)},S(o)}function b(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}typeof Symbol<"u"&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")));typeof Symbol<"u"&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));function P(o,n){try{var e=o()}catch(t){return n(t)}return e&&e.then?e.then(void 0,n):e}function y(o){return o.hasOwnProperty("result")?o.result:o}var k=(function(o){q(n,o);function n(){var e;return e=o.call(this)||this,e.name=e.constructor.name,e.message="No Ethereum provider was found on window.ethereum.",e}return n})(S(Error)),ge=(function(o){q(n,o);function n(){var e;return e=o.call(this)||this,e.name=e.constructor.name,e.message="The user rejected the request.",e}return n})(S(Error)),me=(function(o){q(n,o);function n(t){var r;return r=o.call(this,t)||this,r.handleNetworkChanged=r.handleNetworkChanged.bind(b(r)),r.handleChainChanged=r.handleChainChanged.bind(b(r)),r.handleAccountsChanged=r.handleAccountsChanged.bind(b(r)),r.handleClose=r.handleClose.bind(b(r)),r}var e=n.prototype;return e.handleChainChanged=function(r){this.emitUpdate({chainId:r,provider:window.ethereum})},e.handleAccountsChanged=function(r){r.length===0?this.emitDeactivate():this.emitUpdate({account:r[0]})},e.handleClose=function(r,i){this.emitDeactivate()},e.handleNetworkChanged=function(r){this.emitUpdate({chainId:r,provider:window.ethereum})},e.activate=function(){try{var r=function(f){if(i)return f;function p(){return j({provider:window.ethereum},a?{account:a}:{})}var v=(function(){if(!a)return Promise.resolve(window.ethereum.enable().then(function(T){return T&&y(T)[0]})).then(function(T){a=T})})();return v&&v.then?v.then(p):p(v)},i=!1,s=this;if(!window.ethereum)throw new k;window.ethereum.on&&(window.ethereum.on("chainChanged",s.handleChainChanged),window.ethereum.on("accountsChanged",s.handleAccountsChanged),window.ethereum.on("close",s.handleClose),window.ethereum.on("networkChanged",s.handleNetworkChanged)),window.ethereum.isMetaMask&&(window.ethereum.autoRefreshOnNetworkChange=!1);var a,c=P(function(){return Promise.resolve(window.ethereum.send("eth_requestAccounts").then(function(u){return y(u)[0]})).then(function(u){a=u})},function(u){if(u.code===4001)throw new ge});return Promise.resolve(c&&c.then?c.then(r):r(c))}catch(u){return Promise.reject(u)}},e.getProvider=function(){try{return Promise.resolve(window.ethereum)}catch(r){return Promise.reject(r)}},e.getChainId=function(){try{var r=function(){function c(){if(!i)try{i=y(window.ethereum.send({method:"net_version"}))}catch{}return i||(window.ethereum.isDapper?i=y(window.ethereum.cachedResults.net_version):i=window.ethereum.chainId||window.ethereum.netVersion||window.ethereum.networkVersion||window.ethereum._chainId),i}var u=(function(){if(!i){var f=P(function(){return Promise.resolve(window.ethereum.send("net_version").then(y)).then(function(p){i=p})},function(){});if(f&&f.then)return f.then(function(){})}})();return u&&u.then?u.then(c):c(u)};if(!window.ethereum)throw new k;var i,s=P(function(){return Promise.resolve(window.ethereum.send("eth_chainId").then(y)).then(function(a){i=a})},function(){});return Promise.resolve(s&&s.then?s.then(r):r(s))}catch(a){return Promise.reject(a)}},e.getAccount=function(){try{var r=function(){function c(){return i||(i=y(window.ethereum.send({method:"eth_accounts"}))[0]),i}var u=(function(){if(!i){var f=P(function(){return Promise.resolve(window.ethereum.enable().then(function(p){return y(p)[0]})).then(function(p){i=p})},function(){});if(f&&f.then)return f.then(function(){})}})();return u&&u.then?u.then(c):c(u)};if(!window.ethereum)throw new k;var i,s=P(function(){return Promise.resolve(window.ethereum.send("eth_accounts").then(function(a){return y(a)[0]})).then(function(a){i=a})},function(){});return Promise.resolve(s&&s.then?s.then(r):r(s))}catch(a){return Promise.reject(a)}},e.deactivate=function(){window.ethereum&&window.ethereum.removeListener&&(window.ethereum.removeListener("chainChanged",this.handleChainChanged),window.ethereum.removeListener("accountsChanged",this.handleAccountsChanged),window.ethereum.removeListener("close",this.handleClose),window.ethereum.removeListener("networkChanged",this.handleNetworkChanged))},e.isAuthorized=function(){try{return window.ethereum?Promise.resolve(P(function(){return Promise.resolve(window.ethereum.send("eth_accounts").then(function(r){return y(r).length>0}))},function(){return!1})):Promise.resolve(!1)}catch(r){return Promise.reject(r)}},n})(E);class G extends Error{constructor(){super("There was an error unlocking your wallet. Please be sure your wallet is unlocked and try again."),this.name="ErrorUnlockingWallet"}}const Ie=60*1e3;class J extends me{constructor(n){super({supportedChainIds:[n]})}async activate(){const n=new Promise((t,r)=>{setTimeout(()=>{r(new G)},Ie)}),e=super.activate();return Promise.race([e,n])}}var ye="Invariant failed";function V(o,n){throw new Error(ye)}function Y(o,n){o.prototype=Object.create(n.prototype),o.prototype.constructor=o,N(o,n)}function D(o){return D=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},D(o)}function N(o,n){return N=Object.setPrototypeOf||function(t,r){return t.__proto__=r,t},N(o,n)}function Ce(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function R(o,n,e){return Ce()?R=Reflect.construct:R=function(r,i,s){var a=[null];a.push.apply(a,i);var c=Function.bind.apply(r,a),u=new c;return s&&N(u,s.prototype),u},R.apply(null,arguments)}function Ee(o){return Function.toString.call(o).indexOf("[native code]")!==-1}function W(o){var n=typeof Map=="function"?new Map:void 0;return W=function(t){if(t===null||!Ee(t))return t;if(typeof t!="function")throw new TypeError("Super expression must either be null or a function");if(typeof n<"u"){if(n.has(t))return n.get(t);n.set(t,r)}function r(){return R(t,arguments,D(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),N(r,t)},W(o)}var U=(function(o){Y(n,o);function n(e,t,r){var i;return i=o.call(this)||this,i.code=t,i.data=r,i.name=i.constructor.name,i.message=e,i}return n})(W(Error)),Ae=function(n,e){var t=this,r=this;this.isMetaMask=!1,this.sendAsync=function(s,a){console.log("sendAsync",s.method,s.params),r.request(s.method,s.params).then(function(c){return a(null,{jsonrpc:"2.0",id:s.id,result:c})}).catch(function(c){return a(c,null)})},this.request=function(s,a){try{return typeof s!="string"&&(a=s.params,s=s.method),Promise.resolve(fetch(t.url,{method:"POST",body:JSON.stringify({jsonrpc:"2.0",id:1,method:s,params:a}),headers:{"Content-Type":"application/json"}})).then(function(c){if(!c.ok)throw new U(c.status+": "+c.statusText,-32e3);return Promise.resolve(c.json()).then(function(u){if("error"in u){var f,p,v;throw new U(u==null||(f=u.error)==null?void 0:f.message,u==null||(p=u.error)==null?void 0:p.code,u==null||(v=u.error)==null?void 0:v.data)}else{if("result"in u)return u.result;throw new U("Received unexpected JSON-RPC response to "+s+" request.",-32e3,u)}})})}catch(c){return Promise.reject(c)}},this.chainId=n,this.url=e;var i=new URL(e);this.host=i.host,this.path=i.pathname},Te=(function(o){Y(n,o);function n(t){var r,i=t.urls,s=t.defaultChainId;return s||Object.keys(i).length===1||V(),r=o.call(this,{supportedChainIds:Object.keys(i).map(function(a){return Number(a)})})||this,r.currentChainId=s||Number(Object.keys(i)[0]),r.providers=Object.keys(i).reduce(function(a,c){return a[Number(c)]=new Ae(Number(c),i[Number(c)]),a},{}),r}var e=n.prototype;return e.activate=function(){try{var r=this;return Promise.resolve({provider:r.providers[r.currentChainId],chainId:r.currentChainId,account:null})}catch(i){return Promise.reject(i)}},e.getProvider=function(){try{var r=this;return Promise.resolve(r.providers[r.currentChainId])}catch(i){return Promise.reject(i)}},e.getChainId=function(){try{var r=this;return Promise.resolve(r.currentChainId)}catch(i){return Promise.reject(i)}},e.getAccount=function(){return Promise.resolve(null)},e.deactivate=function(){},e.changeChainId=function(r){Object.keys(this.providers).includes(r.toString())||V(),this.currentChainId=r,this.emitUpdate({provider:this.providers[this.currentChainId],chainId:r})},n})(E);class Q extends Te{constructor(n){super({urls:I()[l.ProviderType.NETWORK].urls,defaultChainId:n})}}function x(){return x=Object.assign||function(o){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(o[t]=e[t])}return o},x.apply(this,arguments)}function Pe(o,n){o.prototype=Object.create(n.prototype),o.prototype.constructor=o,F(o,n)}function F(o,n){return F=Object.setPrototypeOf||function(t,r){return t.__proto__=r,t},F(o,n)}function B(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}var _e=1,Ne=(function(o){Pe(n,o);function n(t){var r,i=t.url,s=t.appName,a=t.appLogoUrl,c=t.darkMode,u=t.supportedChainIds;return r=o.call(this,{supportedChainIds:u})||this,r.url=i,r.appName=s,r.appLogoUrl=a,r.darkMode=c||!1,r.handleChainChanged=r.handleChainChanged.bind(B(r)),r.handleAccountsChanged=r.handleAccountsChanged.bind(B(r)),r}var e=n.prototype;return e.activate=function(){try{var r=this,i=function(){return Promise.resolve(r.provider.request({method:"eth_requestAccounts"})).then(function(c){var u=c[0];return r.provider.on("chainChanged",r.handleChainChanged),r.provider.on("accountsChanged",r.handleAccountsChanged),{provider:r.provider,account:u}})},s=(function(){if(window.ethereum&&window.ethereum.isCoinbaseWallet===!0)r.provider=window.ethereum;else{var a=(function(){if(!r.walletLink)return Promise.resolve(m(()=>import("./index-CjpWKs8Q.js").then(c=>c.i),__vite__mapDeps([2,1,3,4,5,6,7,8,9,10,11])).then(function(c){var u;return(u=c==null?void 0:c.default)!=null?u:c})).then(function(c){r.walletLink=new c(x({appName:r.appName,darkMode:r.darkMode},r.appLogoUrl?{appLogoUrl:r.appLogoUrl}:{})),r.provider=r.walletLink.makeWeb3Provider(r.url,_e)})})();if(a&&a.then)return a.then(function(){})}})();return Promise.resolve(s&&s.then?s.then(i):i(s))}catch(a){return Promise.reject(a)}},e.getProvider=function(){try{var r=this;return Promise.resolve(r.provider)}catch(i){return Promise.reject(i)}},e.getChainId=function(){try{var r=this;return Promise.resolve(r.provider.chainId)}catch(i){return Promise.reject(i)}},e.getAccount=function(){try{var r=this;return Promise.resolve(r.provider.request({method:"eth_requestAccounts"})).then(function(i){return i[0]})}catch(i){return Promise.reject(i)}},e.deactivate=function(){this.provider.removeListener("chainChanged",this.handleChainChanged),this.provider.removeListener("accountsChanged",this.handleAccountsChanged)},e.close=function(){try{var r=this;return r.provider.close(),r.emitDeactivate(),Promise.resolve()}catch(i){return Promise.reject(i)}},e.handleChainChanged=function(r){this.emitUpdate({chainId:r})},e.handleAccountsChanged=function(r){this.emitUpdate({account:r[0]})},n})(E);class X extends Ne{constructor(n){const e=I()[g.ProviderType.WALLET_LINK],t=e.urls[n];if(!t)throw new Error(`Unsupported chainId for WalletLink: ${n}. Supported chains: ${Object.keys(e.urls).join(", ")}`);super({url:t,appName:e.appName,supportedChainIds:[n]})}}class Me{}class Z extends Me{get(n){const e=window.localStorage.getItem(n);return e===null?void 0:e}set(n,e){window.localStorage.setItem(n,e)}remove(n){window.localStorage.removeItem(n)}removeRegExp(n){for(let e=localStorage.length-1;e>=0;e--){const t=localStorage.key(e);t&&n.test(t)&&localStorage.removeItem(t)}}}const be={[g.ChainId.ETHEREUM_MAINNET]:"mainnet",[g.ChainId.ETHEREUM_SEPOLIA]:"sepolia",[g.ChainId.MATIC_MAINNET]:"polygon",[g.ChainId.MATIC_AMOY]:"polygonAmoy",[g.ChainId.ARBITRUM_MAINNET]:"arbitrum",[g.ChainId.OPTIMISM_MAINNET]:"optimism",[g.ChainId.AVALANCHE_MAINNET]:"avalanche",[g.ChainId.BSC_MAINNET]:"bsc",[g.ChainId.FANTOM_MAINNET]:"fantom"},w=class w extends E{constructor(e){super({supportedChainIds:w.configuration.chains});d(this,"desiredChainId");d(this,"appKit");d(this,"provider");d(this,"accountUnsubscribe");d(this,"networkUnsubscribe");d(this,"initAppKit",async()=>{if(w.sharedAppKit)return this.appKit=w.sharedAppKit,this.appKit;const{createAppKit:e}=await m(async()=>{const{createAppKit:s}=await import("./index-D6jXV4v6.js").then(a=>a.h);return{createAppKit:s}},__vite__mapDeps([12,13,1,5,3,4,11,14,15,16,17,18,19,20,21,22,23])),{WagmiAdapter:t}=await m(async()=>{const{WagmiAdapter:s}=await import("./index-B-wUrKiv.js").then(a=>a.b);return{WagmiAdapter:s}},__vite__mapDeps([24,15,3,16,1,5,17,18,13,4,11,14,25,26,6,27,28,29])),r=await this.getNetworks(),i=new t({networks:r,projectId:w.configuration.projectId});return this.appKit=e({adapters:[i],projectId:w.configuration.projectId,networks:r,defaultNetwork:r[0],metadata:{name:"Decentraland",description:"Decentraland - Virtual World",url:typeof window<"u"?window.location.origin:"https://decentraland.org",icons:["https://decentraland.org/favicon.ico"]},themeMode:"dark",themeVariables:{"--w3m-z-index":3e3},features:{analytics:!1,email:!1,socials:!1,onramp:!1,swaps:!1},enableInjected:!0,enableEIP6963:!0}),w.sharedAppKit=this.appKit,await this.waitForSessionRestore(),this.appKit});d(this,"waitForSessionRestore",async()=>{const e=this.appKit;if(!e)return;const t=e.getAccount();if((t==null?void 0:t.status)==="connected"||(t==null?void 0:t.status)==="disconnected")return;const r=t!=null&&t.status?5e3:500;return new Promise(i=>{const s=setTimeout(()=>{a==null||a(),i()},r),a=e.subscribeAccount(c=>{((c==null?void 0:c.status)==="connected"||(c==null?void 0:c.status)==="disconnected")&&(clearTimeout(s),a==null||a(),i())},"eip155")})});d(this,"validateRestoredSession",async e=>{try{const t=e.getWalletProvider();return t?(await t.request({method:"eth_chainId"}),!0):!1}catch(t){return w.isStaleSessionError(t)?!1:(console.warn("Error validating WalletConnect session:",t),!0)}});d(this,"openModalAndWaitForConnection",async()=>{const e=this.requireAppKit(),t=()=>new Promise((r,i)=>{let s=!1;const a=(p,v)=>{s||(s=!0,clearTimeout(c),p==null||p(),v==null||v())},c=setTimeout(()=>{a(),i(new Error("Connection timeout"))},3e5),u=e.subscribeAccount(p=>{p!=null&&p.isConnected&&(p!=null&&p.address)&&(a(u,f),r(p.address))},"eip155"),f=e.subscribeState(p=>{!p.open&&!e.getAddress("eip155")&&(a(u,f),i(new Error("User closed the modal without connecting")))})});try{await e.open({view:"Connect"}),await t()}catch(r){if(w.isStaleSessionError(r)){if(console.warn("Stale session detected, retrying connection..."),w.clearStorage(),await this.initAppKit(),!this.appKit)throw new Error("AppKit reinitialization failed");await this.appKit.open({view:"Connect"}),await t()}else throw r}});d(this,"activate",async()=>{try{await this.initAppKit()}catch(c){if(console.error("Error initializing AppKit",c),w.isStaleSessionError(c))console.warn("WalletConnect session is stale, clearing storage and retrying..."),w.clearStorage(),await this.initAppKit();else throw c}const e=this.requireAppKit(),t=e.getAccount();(t==null?void 0:t.status)==="connected"&&(t==null?void 0:t.address)?await this.validateRestoredSession(e)||(console.warn("Restored WalletConnect session is stale, clearing and prompting reconnection..."),w.clearStorage(),await this.initAppKit(),await this.openModalAndWaitForConnection()):await this.openModalAndWaitForConnection();const i=e.getWalletProvider();if(!i)throw new Error("Failed to get wallet provider after connection");this.provider=i,this.accountUnsubscribe=e.subscribeAccount(c=>{c!=null&&c.address&&this.handleAccountsChanged([c.address])},"eip155"),this.networkUnsubscribe=e.subscribeCaipNetworkChange(c=>{c!=null&&c.id&&this.handleChainChanged(c.id)});const s=e.getAddress("eip155");return{chainId:e.getChainId()||this.desiredChainId,account:s||null,provider:this.provider}});d(this,"getProvider",async()=>{if(!this.provider)throw new Error("Provider is undefined");return this.provider});d(this,"getChainId",async()=>this.requireAppKit().getChainId()??this.desiredChainId);d(this,"getAccount",async()=>this.requireAppKit().getAddress("eip155")??null);d(this,"getWalletName",()=>{var e,t,r;return(r=(t=(e=this.appKit)==null?void 0:e.getWalletInfo)==null?void 0:t.call(e,"eip155"))==null?void 0:r.name});d(this,"deactivate",()=>{});d(this,"clearInstance",()=>{var t,r;const e=this.provider;if(e){this.provider=void 0;try{(t=this.accountUnsubscribe)==null||t.call(this),(r=this.networkUnsubscribe)==null||r.call(this)}catch(i){console.warn("Error unsubscribing from AppKit events:",i)}return this.accountUnsubscribe=void 0,this.networkUnsubscribe=void 0,e}});d(this,"close",async()=>{var t;if(this.clearInstance()){try{await((t=this.appKit)==null?void 0:t.disconnect())}catch(r){console.warn("Error during WalletConnect disconnect:",r)}this.appKit=void 0}});d(this,"handleAccountsChanged",e=>{this.emitUpdate({account:e[0]})});d(this,"handleChainChanged",e=>{this.emitUpdate({chainId:e})});d(this,"handleDisconnect",()=>{this.clearInstance(),this.emitDeactivate()});this.desiredChainId=e}requireAppKit(){if(!this.appKit)throw new Error("AppKit is not initialized");return this.appKit}static isStaleSessionError(e){if(e instanceof Error){const t=e.message.toLowerCase();return t.includes("no matching key")||t.includes("session topic doesn't exist")||t.includes("missing or invalid")||t.includes("expired")||t.includes("user rejected methods")||t.includes("is not configured")||t.includes("cannot read properties")||t.includes("undefined is not an object")}return!1}async getNetworks(){const e=w.configuration.chains,t=await m(()=>import("./networks-7mAev_So.js"),__vite__mapDeps([30,18,5,1,31,32,25,13,3,4,11,14,33,34,29])),r=e.map(s=>{const a=be[s];if(a)return t[a]}).filter(s=>s!==void 0);if(r.length===0)throw new Error("No supported networks found for WalletConnect");const i=r.find(s=>s.id===this.desiredChainId);if(i){const s=r.filter(a=>a.id!==this.desiredChainId);return[i,...s]}return[r[0],...r.slice(1)]}};d(w,"configuration",I()[g.ProviderType.WALLET_CONNECT_V2]),d(w,"clearStorage",(e=new Z)=>{e.removeRegExp(new RegExp("^wc@2:")),e.removeRegExp(new RegExp("^@appkit")),w.sharedAppKit=null}),d(w,"sharedAppKit",null);let _=w;class H extends E{constructor(e,t=!1){super({supportedChainIds:I()[g.ProviderType.MAGIC].chains});d(this,"isTest");d(this,"chainId");d(this,"account");d(this,"magic");d(this,"activate",async()=>{if(this.magic=await this.buildMagicInstance(this.chainId),!await this.magic.user.isLoggedIn())throw new Error("Magic: user isn't logged in");const t=await this.getProvider(),r=await t.request({method:"eth_accounts"});return this.account=r[0]??null,{provider:t,chainId:this.chainId,account:this.account}});d(this,"getProvider",async()=>{if(!this.magic)throw new Error("Magic: instance was not initialized");const e=await this.magic.wallet.getProvider();return{...e,isMagic:!0,request:new Proxy(e.request,{apply:async(t,r,i)=>{var s,a,c;if(((s=i[0])==null?void 0:s.method)==="wallet_switchEthereumChain")try{const u=parseInt((c=(a=i[0])==null?void 0:a.params[0])==null?void 0:c.chainId,16);return this.supportedChainIds&&!this.supportedChainIds.includes(u)?{code:2020202,message:"Unsupported Magic ChainId"}:(this.magic=await this.buildMagicInstance(u),this.emitUpdate({chainId:u}),null)}catch{return{code:2020201,message:"Error changing the Magic ChainId"}}return t.bind(e)(...i)}}),sendAsync:new Proxy(e.send,{apply:async(t,r,i)=>t.bind(e)(...i)})}});d(this,"getChainId",async()=>{if(!this.magic)throw new Error("Magic: instance was not initialized");return this.chainId});d(this,"getAccount",async()=>{if(!this.magic)throw new Error("Magic: instance was not initialized");return this.account});d(this,"getEmail",async()=>{try{if(!this.magic||!await this.magic.user.isLoggedIn())return;const t=await this.magic.user.getInfo();return(t==null?void 0:t.email)??void 0}catch{return}});d(this,"deactivate",()=>{});d(this,"buildMagicInstance",async e=>{const{Magic:t}=await m(async()=>{const{Magic:a}=await import("./index-CSlo2BeJ.js");return{Magic:a}},__vite__mapDeps([35,5,1,36])),{OAuthExtension:r}=await m(async()=>{const{OAuthExtension:a}=await import("./index-qsorFlMF.js");return{OAuthExtension:a}},__vite__mapDeps([37,36,5,1,38,7,8,4,10,3])),i=I()[this.isTest?g.ProviderType.MAGIC_TEST:g.ProviderType.MAGIC],s=i.urls[e];if(!s)throw new Error(`Unsupported chainId for Magic: ${e}. Supported chains: ${Object.keys(i.urls).join(", ")}`);return new t(i.apiKey,{extensions:[new r],network:{rpcUrl:s,chainId:e}})});this.isTest=t,this.chainId=e,this.account=null}close(){if(!this.magic)throw new Error("Magic: instance was not initialized");return this.magic.user.logout()}}class ee extends H{constructor(n){super(n,!0)}}class te extends E{constructor(e){var t;super({supportedChainIds:((t=I().thirdweb)==null?void 0:t.chains)??[h.ChainId.ETHEREUM_MAINNET,h.ChainId.ETHEREUM_SEPOLIA]});d(this,"chainId");d(this,"client");d(this,"wallet");d(this,"chain");d(this,"eip1193Provider");d(this,"activate",async()=>{const e=await this.getClient(),t=await this.getWallet();let r;try{r=await t.autoConnect({client:e})}catch{throw new Error("Thirdweb: No active session. User must authenticate first.")}if(!r)throw new Error("Thirdweb: No active session. User must authenticate first.");const i=await this.getChain(),{EIP1193:s}=await m(async()=>{const{EIP1193:u}=await import("./wallets-0QMnCoJB.js").then(f=>f.Q);return{EIP1193:u}},__vite__mapDeps([39,40,41,42,5,1,13,3,4,11,14,43,44,45,46,47,48,49,50,51,27,52,53,54,19,16,20,55,21]));return this.eip1193Provider=s.toProvider({wallet:t,chain:i,client:e}),{provider:await this.getProvider(),chainId:this.chainId,account:r.address}});d(this,"getProvider",async()=>{if(!this.eip1193Provider)throw new Error("Thirdweb: wallet is not connected. Call activate() first.");const e=this.eip1193Provider;return{...e,isDapper:!1,isFortmatic:!1,isMetamask:!1,isMagic:!1,isThirdweb:!0,request:new Proxy(e.request,{apply:async(t,r,i)=>{var a,c,u,f;if(((a=i[0])==null?void 0:a.method)==="wallet_switchEthereumChain"){const p=(f=(u=(c=i[0])==null?void 0:c.params)==null?void 0:u[0])==null?void 0:f.chainId,v=parseInt(p,16);if(this.supportedChainIds&&!this.supportedChainIds.includes(v))throw new Error("Thirdweb: unsupported chain");this.chainId=v,this.chain=null,this.eip1193Provider=null;const T=await this.getClient(),ne=await this.getWallet(),ie=await this.getChain(),{EIP1193:oe}=await m(async()=>{const{EIP1193:ae}=await import("./wallets-0QMnCoJB.js").then(se=>se.Q);return{EIP1193:ae}},__vite__mapDeps([39,40,41,42,5,1,13,3,4,11,14,43,44,45,46,47,48,49,50,51,27,52,53,54,19,16,20,55,21]));return this.eip1193Provider=oe.toProvider({wallet:ne,chain:ie,client:T}),this.emitUpdate({chainId:v}),null}return Reflect.apply(t,e,i)}}),sendAsync:new Proxy(e.request,{apply:async(t,r,i)=>Reflect.apply(t,e,i)})}});d(this,"getChainId",async()=>this.chainId);d(this,"getAccount",async()=>{if(!this.wallet)return null;try{const e=this.wallet.getAccount();return(e==null?void 0:e.address)??null}catch{return null}});d(this,"getEmail",async()=>{try{const e=await this.getClient(),{getUserEmail:t}=await m(async()=>{const{getUserEmail:i}=await import("./in-app-BXEo5oJI.js");return{getUserEmail:i}},__vite__mapDeps([56,41,42,5,1,47,46,13,3,4,11,14,57,58]));return await t({client:e})??void 0}catch{return}});d(this,"deactivate",()=>{});this.chainId=e,this.client=null,this.wallet=null,this.chain=null,this.eip1193Provider=null}async getClient(){if(this.client)return this.client;let e;try{e=await m(()=>import("./thirdweb-CIKZzA4I.js").then(r=>r.t),__vite__mapDeps([59,42,5,1,41,40,13,3,4,11,14,43,44,45,60,61,62,63,64,65,54,66,67,68,69,53]))}catch{throw new Error("Thirdweb: thirdweb package is not installed.")}const t=I().thirdweb;return this.client=e.createThirdwebClient({clientId:t.clientId}),this.client}async getWallet(){if(this.wallet)return this.wallet;let e;try{e=await m(()=>import("./wallets-0QMnCoJB.js").then(t=>t.Q),__vite__mapDeps([39,40,41,42,5,1,13,3,4,11,14,43,44,45,46,47,48,49,50,51,27,52,53,54,19,16,20,55,21]))}catch{throw new Error("Thirdweb: thirdweb package is not installed. Run: npm install thirdweb")}return this.wallet=e.inAppWallet(),this.wallet}async getChain(){if(this.chain)return this.chain;const e=await m(()=>import("./chains-DPlhC0Sw.js"),__vite__mapDeps([70,42,5,1,68,50]));return this.chain=e.defineChain(this.chainId),this.chain}async close(){this.wallet&&await this.wallet.disconnect(),this.wallet=null,this.chain=null,this.eip1193Provider=null}}class M{constructor(n){d(this,"provider");d(this,"id",0);d(this,"on",(n,e)=>this.provider.on(n,e));d(this,"emit",(n,...e)=>this.provider.emit(n,e));d(this,"removeListener",(n,e)=>this.provider.removeListener(n,e));d(this,"request",async({method:n,params:e})=>this.isModernProvider()?this.provider.request({method:n,params:e}):this.send(n,e));d(this,"sendAsync",async(n,e)=>this.hasSendAsync()?this.provider.sendAsync(n,(t,r)=>{r&&!Object.prototype.hasOwnProperty.call(r,"result")?e(t,{id:0,jsonrpc:"2.0",result:r}):e(t,r)}):this.send(n,e));this.provider=n}static adapt(n){const e=new M(n);return{...n,on:e.on,emit:e.emit,removeListener:e.removeListener,request:e.request,sendAsync:e.sendAsync,send:e.send.bind(e)}}async send(n,e){let t,r,i;const s=typeof e=="function";if(s){const a=n;r=a.params||[],t=a.method,i=e}else t=n,r=e||[],i=(a,c)=>{if(a)throw a;return c};if(this.isModernProvider()){const[a,c]=await this.provider.request({method:t,params:r}).then(f=>[null,f]).catch(f=>[f,void 0]);return i(a,s?{id:"",jsonrpc:"2.0",result:c}:c)}else{this.patchOldMobile();const[a,c]=s?await new Promise(u=>this.provider.send(n,(f,p)=>{u([f,p])})):await new Promise(u=>this.provider.send({jsonrpc:"2.0",id:++this.id,method:t,params:r},(f,p)=>{const v=p;u([(v==null?void 0:v.error)??f,(v==null?void 0:v.result)??p])}));return i(a,c)}}isModernProvider(){return"request"in this.provider&&typeof this.provider.request=="function"}hasSendAsync(){return typeof this.provider.sendAsync=="function"}patchOldMobile(){this.provider&&!this.provider.isDapper&&!this.provider.isFortmatic&&!this.provider.isMetamask&&this.hasSendAsync()&&this.provider.send!==this.provider.sendAsync&&(this.provider.send=this.provider.sendAsync.bind(this.provider))}}class re{constructor(n){d(this,"storage");d(this,"connector");d(this,"promiseOfConnection");d(this,"getWalletName",()=>{if(this.connector instanceof _)return this.connector.getWalletName()});d(this,"clearConnectionData",()=>{const{storageKey:n}=I();this.storage.remove(n),_.clearStorage(this.storage)});d(this,"handleWeb3ReactDeactivate",async()=>{try{await this.disconnect()}catch(n){console.error(n)}});this.storage=n}async connect(n,e=h.ChainId.ETHEREUM_MAINNET){if(this.connector)try{await this.disconnect()}catch(a){console.error("Error disconnecting previous connection",a)}const t=this.buildConnector(n,e);t.on(C.Deactivate,this.handleWeb3ReactDeactivate);let{provider:r,account:i}={};try{const a=await t.activate();r=a.provider,i=a.account}catch(a){throw console.error("Error activating the connector",a),a}(n===l.ProviderType.MAGIC||n===l.ProviderType.MAGIC_TEST||n===l.ProviderType.THIRDWEB)&&t.on(C.Update,({chainId:a})=>{a&&this.setConnectionData(n,a)});let s=e;if(n===l.ProviderType.INJECTED){const a=await r.request({method:"eth_chainId"});s=a?parseInt(a,16):s}return this.connector=t,this.setConnectionData(n,s),{provider:M.adapt(r),providerType:n,account:i||"",chainId:s}}isConnected(){return!!this.connector&&!!this.getConnectionData()}async tryPreviousConnection(){const n=this.getConnectionData();if(!n)throw new Error("Could not find a valid provider. Make sure to call the `connect` method first");if(this.connector){const[t,r]=await Promise.all([this.connector.getProvider(),this.connector.getAccount()]);return{provider:t,providerType:n.providerType,chainId:n.chainId,account:r||""}}let e;try{e=this.promiseOfConnection?await this.promiseOfConnection:await(this.promiseOfConnection=this.connect(n.providerType,n.chainId))}finally{this.promiseOfConnection=void 0}return{...e,chainId:this.getConnectionData().chainId}}getAvailableProviders(){const n=[l.ProviderType.FORTMATIC,l.ProviderType.WALLET_CONNECT,l.ProviderType.WALLET_LINK];return typeof window<"u"&&window.ethereum!==void 0?n.unshift(l.ProviderType.INJECTED):n.unshift(l.ProviderType.METAMASK_MOBILE),n}async disconnect(){this.connector&&(this.connector.removeAllListeners(C.Deactivate),this.connector.removeAllListeners(C.Update),this.connector.deactivate(),this.isClosableConnector()&&await this.connector.close()),this.clearConnectionData(),this.connector=void 0}async getProvider(){if(!this.connector)throw new Error("No valid connector found. Please .connect() first");return this.connector.getProvider()}async getEmail(){const n=this.connector;if(n!=null&&n.getEmail)try{return await n.getEmail()}catch{return}}async createProvider(n,e=h.ChainId.ETHEREUM_MAINNET){const r=await this.buildConnector(n,e).getProvider();return M.adapt(r)}buildConnector(n,e){switch(n){case l.ProviderType.INJECTED:return new J(e);case l.ProviderType.FORTMATIC:return new z(e);case l.ProviderType.MAGIC:return new H(e);case l.ProviderType.MAGIC_TEST:return new ee(e);case l.ProviderType.WALLET_LINK:return new X(e);case l.ProviderType.NETWORK:return new Q(e);case l.ProviderType.WALLET_CONNECT_V2:return new _(e);case l.ProviderType.THIRDWEB:return new te(e);default:throw new Error(`Invalid provider ${n}`)}}getConnectionData(){const{storageKey:n}=I(),e=this.storage.get(n);try{return e?JSON.parse(e):void 0}catch(t){console.error("Error parsing connection data",t);return}}storeConnectionData(n,e){this.setConnectionData(n,e)}setConnectionData(n,e){const{storageKey:t}=I(),r=JSON.stringify({providerType:n,chainId:e});this.storage.set(t,r)}isClosableConnector(){return this.connector&&"close"in this.connector}}const Oe=new re(new Z),Ke=Object.freeze(Object.defineProperty({__proto__:null,AbstractConnector:E,ConnectionManager:re,ErrorUnlockingWallet:G,FortmaticConnector:z,InjectedConnector:J,MagicConnector:H,MagicTestConnector:ee,NetworkConnector:Q,ProviderAdapter:M,ThirdwebConnector:te,WalletConnectV2Connector:_,WalletLinkConnector:X,connection:Oe,getConfiguration:I,getRpcUrls:A},Symbol.toStringTag,{value:"Module"}));export{je as N,Oe as c,$ as e,Ke as i};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as b,b as l,a as O}from"./lit-element-B3y9oplH.js";import{n as h,r as d}from"./class-map-CxwNmq0D.js";import{d as C,r as E,e as P}from"./index-
|
|
1
|
+
import{i as b,b as l,a as O}from"./lit-element-B3y9oplH.js";import{n as h,r as d}from"./class-map-CxwNmq0D.js";import{d as C,r as E,e as P}from"./index-D6jXV4v6.js";import{c as v,U as x}from"./index-BMDKd-Ff.js";import"./index-BF7hghuG.js";import"./index-BNXLnSJ4.js";import{u as g,R as S,o as $,b as R,S as T}from"./W3MFrameProviderSingleton-CtKoZGPW.js";const L=C`
|
|
2
2
|
:host {
|
|
3
3
|
position: relative;
|
|
4
4
|
display: inline-block;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as u,b as c}from"./lit-element-B3y9oplH.js";import{n as r,o as p}from"./class-map-CxwNmq0D.js";import{d as g,r as f}from"./index-
|
|
1
|
+
import{i as u,b as c}from"./lit-element-B3y9oplH.js";import{n as r,o as p}from"./class-map-CxwNmq0D.js";import{d as g,r as f}from"./index-D6jXV4v6.js";import{c as m}from"./index-BMDKd-Ff.js";const b=g`
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
width: var(--local-width);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as p,b as m}from"./lit-element-B3y9oplH.js";import{n as i}from"./class-map-CxwNmq0D.js";import{c as f}from"./index-
|
|
1
|
+
import{i as p,b as m}from"./lit-element-B3y9oplH.js";import{n as i}from"./class-map-CxwNmq0D.js";import{c as f}from"./index-BMDKd-Ff.js";import"./index-CnYjUY-N.js";import{d as h,r as b,e as w}from"./index-D6jXV4v6.js";import{N as d}from"./W3MFrameProviderSingleton-CtKoZGPW.js";const g=h`
|
|
2
2
|
:host {
|
|
3
3
|
width: 100%;
|
|
4
4
|
}
|