@dcl/shop 0.1.0-30533467189.commit-9c5e50b → 0.1.0-30535358248.commit-2722a7f
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-BeCpEUcx.js → Activity-CvucBHHY.js} +5 -5
- package/assets/{AnimatedBackground-CNBmTudE.js → AnimatedBackground-RAMrqGx_.js} +1 -1
- package/assets/{Assets-Drh794UP.js → Assets-knlkMAu5.js} +10 -10
- package/assets/{Assets.styles-Bs38vrbb.js → Assets.styles-CvuyiKqx.js} +1 -1
- package/assets/{Authorizations-CXLUdRrt.js → Authorizations-6ASyROzc.js} +2 -2
- package/assets/{Cart-GkgVaKgN.js → Cart-CktbEy9V.js} +10 -10
- package/assets/{CircularProgress-Cj5HjTPO.js → CircularProgress-DNgXJHy_.js} +5 -5
- package/assets/{Collection-CIB8FY5B.js → Collection-BMVrfLkT.js} +1 -1
- package/assets/{CollectionCarousel-lV1nhHlw.js → CollectionCarousel-CEeV8t-a.js} +11 -11
- package/assets/{ContentClient-gZyDAKO3.js → ContentClient-CHs-qED4.js} +1 -1
- package/assets/{Creator-BWkuY9vG.js → Creator-BpM4S3Hm.js} +5 -5
- package/assets/{DeploymentBuilder-DufsvYDr.js → DeploymentBuilder-ku3det23.js} +1 -1
- package/assets/{ErrorNotice-D1mxPlFl.js → ErrorNotice-BStoa2Qo.js} +1 -1
- package/assets/{ExchangeController-Ds17lqFl.js → ExchangeController-BYHmUZwM.js} +1 -1
- package/assets/{GetCredits-iWdg6r5p.js → GetCredits-BkAuC3jt.js} +12 -12
- package/assets/{HelpersUtil-DUa9W6LU.js → HelpersUtil-DRtQnbop.js} +1 -1
- package/assets/{ImportListings-DTqxR-r8.js → ImportListings-Dmc9cvXJ.js} +10 -10
- package/assets/{ItemDetail-Ds7gpKeP.js → ItemDetail-DHe174rO.js} +24 -24
- package/assets/LoadMore-D2rhC3FV.js +7 -0
- package/assets/{MenuList-DUpgo85O.js → MenuList-BWVPPtBW.js} +1 -1
- package/assets/{MyAssets-dO612_rE.js → MyAssets-BKeT--Ql.js} +1 -1
- package/assets/{MyFavorites-DqoY6rBc.js → MyFavorites-BHrdEY10.js} +1 -1
- package/assets/{NotFound-D2CFCHDj.js → NotFound-vJnWF5cu.js} +4 -4
- package/assets/{NotificationsBell-DzaE8jdt.js → NotificationsBell-Chozh7TD.js} +1 -1
- package/assets/{StoreSettings-C5TOIYXn.js → StoreSettings-TqML4NDY.js} +5 -5
- package/assets/{Success-BwnY9KEQ.js → Success-D3O1Ladi.js} +7 -7
- package/assets/{SwapController-BdsPfurP.js → SwapController-Da0gS2ji.js} +1 -1
- package/assets/{Tooltip-Br2xIJNX.js → Tooltip-DG5HvItw.js} +1 -1
- package/assets/{TradeService-D9oY18xN.js → TradeService-DZaBK_Qv.js} +1 -1
- package/assets/{W3MFrameProviderSingleton-C2UxaXWl.js → W3MFrameProviderSingleton-DAYqclPH.js} +3 -3
- package/assets/{WebCryptoP256-BVwoCVpw.js → WebCryptoP256-C0lhkhci.js} +1 -1
- package/assets/{authorizations-BSrgiqQQ.js → authorizations-BVmXaQeu.js} +1 -1
- package/assets/{basic-B_C7mAl9.js → basic-DO7LyzkW.js} +1 -1
- package/assets/{biconomy-C_XvaCiN.js → biconomy-DmIZbqMf.js} +1 -1
- package/assets/{browseLayout.styles-CwvQOYmi.js → browseLayout.styles-DBRHDPrA.js} +12 -12
- package/assets/{builder-43MkjBkG.js → builder-D-ICo29L.js} +1 -1
- package/assets/{buy-NnyfA38F.js → buy-Ccaxv3lt.js} +1 -1
- package/assets/{buy-gasless-DScVbMRZ.js → buy-gasless-UjTpzokh.js} +1 -1
- package/assets/{categories-DEfi9CfU.js → categories-BFgtEsDl.js} +3 -3
- package/assets/{ccip-CrecNrnD.js → ccip--AYEzQZX.js} +1 -1
- package/assets/{ccip-IP7G9cbg.js → ccip-XSek2mtN.js} +1 -1
- package/assets/{clsx-BdbYsiyl.js → clsx-CsyFr0ZL.js} +2 -2
- package/assets/{controller-cbUcBUrH.js → controller-UEFY0vzS.js} +2 -2
- package/assets/{core-bHMQ1_Mr.js → core-BvM6vAlM.js} +4 -4
- package/assets/{createSvgIcon-BESAkrOU.js → createSvgIcon-CqEJzhBK.js} +3 -3
- package/assets/{custom-BiLTt2sa.js → custom-CmDrwoPL.js} +1 -1
- package/assets/{data-capture-BUUOHCKU.js → data-capture-BGpPQSe4.js} +1 -1
- package/assets/{email-BC9OAJXc.js → email-MR7l-5-Z.js} +1 -1
- package/assets/{embedded-wallet-CjyStHIw.js → embedded-wallet-jJ0wwb2F.js} +1 -1
- package/assets/{emotion-styled.browser.esm-C55xmzJL.js → emotion-styled.browser.esm-BjI-2U8x.js} +1 -1
- package/assets/{engine-DyObRAzu.js → engine-CLWZ2d9c.js} +1 -1
- package/assets/{errors-BjCeABAr.js → errors-BfJQR72Z.js} +1 -1
- package/assets/{estimate-l1-fee-D0RkmwMW.js → estimate-l1-fee-DZ79UIrf.js} +1 -1
- package/assets/{ethers-CpLYx0ea.js → ethers-CXBJm_wN.js} +1 -1
- package/assets/{execute-Wy24SrPH.js → execute-DOgqp-6j.js} +2 -2
- package/assets/{features-_ZfA9H45.js → features-ChZmqAVE.js} +1 -1
- package/assets/{fetchTokenMetadata-g0Cwcuk5.js → fetchTokenMetadata-C3VIvOiy.js} +2 -2
- package/assets/{get-ecosystem-wallet-info-CaQJBLQt.js → get-ecosystem-wallet-info-1W7jn21T.js} +1 -1
- package/assets/{getBalance-BchSsnuR.js → getBalance-ofifHtS7.js} +1 -1
- package/assets/{getNFT-C7zYsElU.js → getNFT-0GUqM1mE.js} +1 -1
- package/assets/{getNFT-B6N9a0WP.js → getNFT-D3I1Pmv7.js} +1 -1
- package/assets/{getThemeProps-4SvFOZFg.js → getThemeProps-DMJMKWz1.js} +1 -1
- package/assets/{grid.styles-D_Jbs44i.js → grid.styles-BdzonCru.js} +1 -1
- package/assets/{hashTypedData-Dz90TJo5.js → hashTypedData-BQ7YG-GD.js} +1 -1
- package/assets/{hashTypedData-BZL8Z-wh.js → hashTypedData-SMqK0Bvk.js} +1 -1
- package/assets/{import-jtw911qv.js → import-BBD0DWIT.js} +1 -1
- package/assets/{in-app-akb4hnYm.js → in-app-CxfPziwR.js} +1 -1
- package/assets/{in-app-wallet-calls-gVWhlVjS.js → in-app-wallet-calls-D8u8Lb5V.js} +1 -1
- package/assets/{index-BC_1S9p4.js → index-2cVzfxOB.js} +1 -1
- package/assets/{index-BOFKzXjc.js → index-2vrBl8sT.js} +1 -1
- package/assets/{index-ldILnJ5u.js → index-B56ftAbJ.js} +1 -1
- package/assets/{index-BmpyBGMP.js → index-B8hqb_ut.js} +1 -1
- package/assets/{index-C5HC_oCV.js → index-BHA1eBb6.js} +1 -1
- package/assets/{index-DZtBOyk9.js → index-BIl576Hj.js} +1 -1
- package/assets/{index-BuXqiOY4.js → index-BMX5hUGo.js} +1 -1
- package/assets/{index-CcTRO2aV.js → index-BTZdGMI1.js} +1 -1
- package/assets/{index-B3JmhrNg.js → index-BU6Q-KL3.js} +1 -1
- package/assets/{index-D0y9dFEX.js → index-BYWBHUre.js} +1 -1
- package/assets/{index-BgErFyDC.js → index-Bf-t954n.js} +1 -1
- package/assets/{index-8Xp2N2qi.js → index-BhaRkjyI.js} +1 -1
- package/assets/{index-DEpnF9Wi.js → index-BiuoTYZN.js} +1 -1
- package/assets/{index-gk5_iRhU.js → index-BsLfKftk.js} +2 -2
- package/assets/{index-D6yMQf8Y.js → index-BumYVyPx.js} +1 -1
- package/assets/{index-B7ResnK5.js → index-BzC7P3rh.js} +1 -1
- package/assets/{index-BmzNos4-.js → index-C-lIghD5.js} +3 -3
- package/assets/{index-Blsedj7w.js → index-C1nKRU6X.js} +1 -1
- package/assets/{index-CdT0g-0m.js → index-CDKfv2bi.js} +2 -2
- package/assets/{index-WLKSffU2.js → index-CDl1_5Gn.js} +1 -1
- package/assets/{index-CK7WvZif.js → index-CEP90DOS.js} +1 -1
- package/assets/{index-rVbEY7Ss.js → index-CEiPmUBh.js} +1 -1
- package/assets/{index-B1omY0iS.js → index-CF_sMyTl.js} +2 -2
- package/assets/{index-kdSvdaR1.js → index-CQqiVn6f.js} +1 -1
- package/assets/{index-D-yWtbt-.js → index-C_o1Zom8.js} +1 -1
- package/assets/{index-B8Bu2_L_.js → index-CbbvhaCZ.js} +1 -1
- package/assets/{index-DPLedEOx.js → index-CbdwidXO.js} +1 -1
- package/assets/{index-DRbSD9RK.js → index-CfG77Wyl.js} +1 -1
- package/assets/{index-BSqWvbLc.js → index-CheBwFGj.js} +1 -1
- package/assets/{index-B_4siyWV.js → index-CufAJ6Dp.js} +1 -1
- package/assets/{index-B-Kqr2Lr.js → index-Cw22meEP.js} +1 -1
- package/assets/{index-CU_QDgpy.js → index-CwAAZj9L.js} +3 -3
- package/assets/index-D6kQ69Bn.js +2815 -0
- package/assets/{index-BFWrtVCG.js → index-D7jjeu20.js} +2 -2
- package/assets/{index-_u92gDCj.js → index-DAMK8alV.js} +1 -1
- package/assets/{index-qUvGBGNH.js → index-DBpv4hR1.js} +1 -1
- package/assets/{index-B0pnNsxo.js → index-DCo_b6w_.js} +1 -1
- package/assets/{index-BJQJ6qaf.js → index-DFzHpbP5.js} +1 -1
- package/assets/{index-Dp35ZriU.js → index-DK6Afp1x.js} +2 -2
- package/assets/{index-AinO5jlX.js → index-DLYns3Ur.js} +1 -1
- package/assets/{index-DlkFYSp0.js → index-DQ2tXB-9.js} +1 -1
- package/assets/{index-B-HKGF9V.js → index-De2dnF3o.js} +1 -1
- package/assets/{index-DutOGRmD.js → index-DgKHc2Pp.js} +1 -1
- package/assets/{index-DMamev_S.js → index-DkzGDwlW.js} +1 -1
- package/assets/{index-BFopPvwi.js → index-Do9Xy8lr.js} +1 -1
- package/assets/{index-CdObRSWE.js → index-DpRFZG3X.js} +1 -1
- package/assets/{index-CPEmrUBm.js → index-Du25SJyr.js} +3 -3
- package/assets/{index-CzYciFoQ.js → index-Dvv2TfLB.js} +1 -1
- package/assets/{index-BmfZCMnr.js → index-SqWDQHXX.js} +1 -1
- package/assets/{index-CmZ_zCk6.js → index-XhO07huK.js} +1 -1
- package/assets/{index-BXwwaP-V.js → index-_FQ-SV4x.js} +1 -1
- package/assets/{index-Dt6E6M6p.js → index-_MfLxWCe.js} +1 -1
- package/assets/{index-B0b7Et6O.js → index-m5SntnZ-.js} +1 -1
- package/assets/{index-Bavc2hNt.js → index-pFP2Nx_c.js} +1 -1
- package/assets/{index-BHHPSewi.js → index-r9DiwXAN.js} +1 -1
- package/assets/{index-CN9i-xys.js → index-uF4O1HZa.js} +1 -1
- package/assets/{index-cbzE2y4I.js → index-zc0VnW3D.js} +1 -1
- package/assets/{index.es-D3pQLfWc.js → index.es-D3lybDuO.js} +1 -1
- package/assets/{index.es-D8ikd0EN.js → index.es-DXhNuD76.js} +4 -4
- package/assets/{index.es-BoeBl1Ce.js → index.es-DXmbtBur.js} +1 -1
- package/assets/{localBatchGatewayRequest-B6O8A-Fd.js → localBatchGatewayRequest-CExVMgRH.js} +1 -1
- package/assets/{mana-convert-GIWR9f74.js → mana-convert-cZR9DTGN.js} +1 -1
- package/assets/{mana-rate-C2oyZxQp.js → mana-rate-cSpFrGml.js} +1 -1
- package/assets/{networks-CeSVlBGL.js → networks-DRyUri_T.js} +1 -1
- package/assets/{onramp-Dinzhb7k.js → onramp-B1GVlRI3.js} +1 -1
- package/assets/{openzeppelin-T7U-Yfrm.js → openzeppelin-78-FJYh6.js} +1 -1
- package/assets/{parseNft-CRc3kz2s.js → parseNft-Ci4sX3gJ.js} +2 -2
- package/assets/{parseSignature-Dy8dB5gM.js → parseSignature-CTZ9pKw7.js} +3 -3
- package/assets/{parseSignature-EJFTHTqk.js → parseSignature-uB_1oAEz.js} +1 -1
- package/assets/{passkeys-CiWO3ZPW.js → passkeys-CA3YYnAU.js} +1 -1
- package/assets/{pay-with-exchange-DtT_33kS.js → pay-with-exchange-DAyDjUqu.js} +1 -1
- package/assets/{qr-overlay-BQQepWTP.js → qr-overlay-BTio6zaV.js} +1 -1
- package/assets/{receive-BVLhEkJB.js → receive-yChzvN3k.js} +1 -1
- package/assets/{resolveImplementation-BzA6DVk0.js → resolveImplementation-CJVJqdzd.js} +1 -1
- package/assets/{rpc-CpJFu_5Q.js → rpc-DUGIeI5g.js} +1 -1
- package/assets/{secp256k1-KszxdVzW.js → secp256k1-B3QC3RZg.js} +1 -1
- package/assets/{secp256k1-CK6dHLcj.js → secp256k1-C54GlILm.js} +1 -1
- package/assets/{secp256k1-BOve6dCK.js → secp256k1-DwMMQidi.js} +1 -1
- package/assets/{send-Cc9g-Ybx.js → send-XMScNnJu.js} +1 -1
- package/assets/{send-batch-transaction-dKBIr3el.js → send-batch-transaction-ByP9c7mI.js} +1 -1
- package/assets/{send-eip712-transaction-5etOij5y.js → send-eip712-transaction-B6wWlCEV.js} +2 -2
- package/assets/{send-gasless-transaction-BT6nlitQ.js → send-gasless-transaction-CCtF_hMm.js} +2 -2
- package/assets/{send-transaction-DvPvL5r6.js → send-transaction-D8-Foq0N.js} +2 -2
- package/assets/{sendMetaTransaction-BqDdrDif.js → sendMetaTransaction-CdI6QA-v.js} +1 -1
- package/assets/{sendRawTransaction-CjlOlVJY.js → sendRawTransaction-BZO-KbQ7.js} +3 -3
- package/assets/{serializeTransaction-DbsZlK6y.js → serializeTransaction-LcE2ddKR.js} +1 -1
- package/assets/{session-proposal-Bmy5e1Ut.js → session-proposal-BGYLVtWS.js} +1 -1
- package/assets/{session-request-DGb_HmsP.js → session-request-B4DLpo1c.js} +2 -2
- package/assets/{signing-DFZMg2_O.js → signing-D-serK4b.js} +3 -3
- package/assets/{socials-D4orUUKf.js → socials-DOdAv2Kb.js} +1 -1
- package/assets/{swaps-Dysv__uX.js → swaps-DDatq7je.js} +1 -1
- package/assets/{thirdweb-BZDXsHNh.js → thirdweb-tS0phgDU.js} +3 -3
- package/assets/{to-serializable-transaction-D14tRtKW.js → to-serializable-transaction-BjLSxJFE.js} +2 -2
- package/assets/trade-encoding-CJDVWYcF.js +1 -0
- package/assets/{transactionReceipt-DG4QOjyW.js → transactionReceipt-C1bkyZl1.js} +1 -1
- package/assets/{transactions-DQVhdHWX.js → transactions-BQh9q_5C.js} +1 -1
- package/assets/useCreditPacks-puL7tAtr.js +1 -0
- package/assets/{useInfiniteGrid-2YbkQqBo.js → useInfiniteGrid-BxfEkchv.js} +1 -1
- package/assets/useManaRate-x5FL9eAV.js +1 -0
- package/assets/useSecondarySales-W8e5_GEF.js +1 -0
- package/assets/{useStore-BI6nsJYk.js → useStore-B7PIu8Uw.js} +2 -2
- package/assets/useTheme-CbnMJ7mn.js +1 -0
- package/assets/{verifyHash-KpVQz-WT.js → verifyHash-CjYiVJ2q.js} +1 -1
- package/assets/{w3m-modal-BlFD9ACf.js → w3m-modal-BFtxRT9O.js} +1 -1
- package/assets/{w3m-modal-DKW5EcgC.js → w3m-modal-q4l3tcYV.js} +1 -1
- package/assets/{wait-for-tx-receipt-FGVrufro.js → wait-for-tx-receipt-DTWTovYR.js} +1 -1
- package/assets/{wallets-BktQ5PcV.js → wallets-Dka8GiAQ.js} +5 -5
- package/assets/{web-connector-B52Gg4wJ.js → web-connector-BB8cyTKu.js} +3 -3
- package/assets/{writeContract-DcUDUFj3.js → writeContract-CznbjJyh.js} +1 -1
- package/assets/{zoraTestnet-BlRojFQQ.js → zoraTestnet-DhqU039o.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/assets/LoadMore-Bq-1Q2-v.js +0 -7
- package/assets/index-9fSuc05f.js +0 -2759
- package/assets/loader-logo-BzY9EKdC.js +0 -1
- package/assets/trade-encoding-BMjkJRi4.js +0 -1
- package/assets/useCreditPacks-DCVckaXX.js +0 -1
- package/assets/useManaRate-Bjg8HpCC.js +0 -1
- package/assets/useSecondarySales-DYck7_BT.js +0 -1
- package/assets/useTheme-BcT4IMUV.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,r as m,e as Y,b as Z}from"./react-vyZjIDcS.js";import{t as v,s as c,
|
|
1
|
+
import{j as e,r as m,e as Y,b as Z}from"./react-vyZjIDcS.js";import{t as v,s as c,af as J,ag as z,I as X,e as a,c as ee,l as te,u as ae,m as re,h as oe,S as E,A as ie,ah as se,ai as ne}from"./index-D6kQ69Bn.js";import{E as ce}from"./ErrorNotice-BStoa2Qo.js";import{d as le,g as de,a as pe,P as xe,C as ue,b as me,c as ge,B as he,S as be,M as fe,A as je}from"./browseLayout.styles-DBRHDPrA.js";import{u as ve}from"./useStore-B7PIu8Uw.js";import{c as F,a as ye,F as Ce,d as we,P as Se,e as ke,H as Ae,S as Ne}from"./categories-BFgtEsDl.js";import{L as $e}from"./LoadMore-D2rhC3FV.js";import{u as Pe}from"./useInfiniteGrid-BxfEkchv.js";import{G as Me}from"./grid.styles-BdzonCru.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";const Re=c.section`
|
|
2
2
|
position: relative;
|
|
3
3
|
border-radius: ${v.radius.card};
|
|
4
4
|
overflow: hidden;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as t,r as v}from"./react-vyZjIDcS.js";import{s as e,t as o,
|
|
1
|
+
import{j as t,r as v}from"./react-vyZjIDcS.js";import{s as e,t as o,e as g,z as k,J as j,bb as C,h as G,x as Y,I as Q,l as X,a as W,C as B,b as J,bc as Z,bd as F,A as q}from"./index-D6kQ69Bn.js";import{s as ee,h as U,A as H,g as K,r as te,m as ne,e as ae}from"./authorizations-BVmXaQeu.js";import{i as ie}from"./errors-BfJQR72Z.js";import{E as oe}from"./ErrorNotice-BStoa2Qo.js";import{a as se}from"./buy-Ccaxv3lt.js";import{g as re,d as ce}from"./trade-encoding-CJDVWYcF.js";import{s as de,M as le,E as pe}from"./sendMetaTransaction-CdI6QA-v.js";import{I as he,C as ue}from"./ethers-CXBJm_wN.js";const L="shop:resume_after_signin",xe=900*1e3;function rt(a){try{sessionStorage.setItem(L,JSON.stringify({...a,at:Date.now()}))}catch{}}function ct(a){let n;try{n=sessionStorage.getItem(L)}catch{return null}if(!n)return null;try{sessionStorage.removeItem(L)}catch{}let i;try{i=JSON.parse(n)}catch{return null}return!i||i.type!==a||typeof i.at!="number"||Date.now()-i.at>xe?null:i.type==="cart-checkout"?{type:"cart-checkout"}:{type:"item-buy",path:i.path}}function ge(a,n){return(a+n-1n)/n}function fe(a,n,i){return a<=0||n<=0?0n:a>=n?i:ge(i*BigInt(a),BigInt(n))}function dt(a){var m,f,w;const n=Number.isFinite(a.priceCents)?Math.max(0,Math.trunc(a.priceCents)):0,i=Number.isFinite(a.balanceCents)?Math.max(0,Math.trunc(a.balanceCents)):0,s=a.priceManaWei>0n?a.priceManaWei:0n,d=a.manaBalanceWei>0n?a.manaBalanceWei:0n;if(n<=0)return{options:[],preferred:null,manaShortfall:null};const c=[];if(i>=n&&c.push({method:"credits",creditsCents:n,manaWei:0n}),s>0n&&i>0&&i<n){const l=n-i,b=fe(l,n,s);d>=b&&c.push({method:"combined",creditsCents:i,manaWei:b})}s>0n&&d>=s&&c.push({method:"mana",creditsCents:0,manaWei:s});const p=((m=c.find(l=>l.method==="credits"))==null?void 0:m.method)??((f=c.find(l=>l.method==="combined"))==null?void 0:f.method)??((w=c.find(l=>l.method==="mana"))==null?void 0:w.method)??null,y=!c.some(l=>l.method==="mana"||l.method==="combined")&&s>0n&&d>0n?{manaWei:d,manaCents:me(d,n,s),priceCents:n}:null;return{options:c,preferred:p,manaShortfall:y}}function me(a,n,i){return Number(a*BigInt(n)/i)}function lt(a,n){let i=Number.isFinite(n)?Math.max(0,Math.trunc(n)):0;return a.map(s=>{const d=Number.isFinite(s)?Math.max(0,Math.trunc(s)):0,c=Math.min(d,i);return i-=c,c})}function z(a){return Number.isFinite(a)?Math.max(0,a)/10:0}function pt(a,n){return a.options.find(i=>i.method===n)??null}function ht(a,n){if(!Number.isFinite(a)||a<=0||n<=0n)return null;const i=a/10;return Number(n)/1e18/i}const T="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Group%201'%3e%3cpath%20id='Vector'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12%202L22%2012L12%2022L2%2012L12%202ZM12%204.8L19.2%2012L12%2019.2L4.8%2012L12%204.8ZM12%2015.6C12.9548%2015.6001%2013.8705%2015.2209%2014.5457%2014.5459C15.2209%2013.8708%2015.6003%2012.9552%2015.6004%2012.0004C15.6005%2011.0456%2015.2213%2010.1299%2014.5463%209.45471C13.8712%208.7795%2012.9556%208.40011%2012.0008%208.4C11.0461%208.4%2010.1304%208.77928%209.45525%209.45442C8.78012%2010.1295%208.40083%2011.0452%208.40083%2012C8.40083%2012.9548%208.78012%2013.8705%209.45525%2014.5456C10.1304%2015.2207%2011.0461%2015.6%2012.0008%2015.6H12Z'%20fill='white'/%3e%3cg%20id='Rectangle%201'%3e%3c/g%3e%3c/g%3e%3c/svg%3e",be=e.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: 12px;
|
|
@@ -289,7 +289,7 @@ import{j as t,r as v}from"./react-vyZjIDcS.js";import{s as e,t as o,d as g,y as
|
|
|
289
289
|
@media (prefers-reduced-motion: reduce) {
|
|
290
290
|
animation: none;
|
|
291
291
|
}
|
|
292
|
-
`;function gt({auth:a,signer:n,title:i,reason:s,name:d,image:c,icon:p,onAuthorized:h,onCancel:y,onClose:m}){const[f,w]=v.useState(!1),[l,b]=v.useState(null);async function $(){w(!0),b(null);try{await ee({auth:a,signer:n,active:!0}),h()}catch(u){ie(u)?b(g("authorizeStep.errorRejected")):(X(u,{flow:"authorize_step",kind:a.kind}),b(g("authorizeStep.errorGeneric"))),w(!1)}}return t.jsx(Ce,{onClick:f?void 0:m,role:"presentation",children:t.jsxs(ze,{onClick:u=>u.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":i,children:[t.jsxs(Me,{children:[t.jsx(Ae,{children:i}),t.jsx(We,{onClick:m,disabled:f,"aria-label":g("authorizeStep.close"),children:t.jsx(Q,{name:"close",className:"ico"})})]}),t.jsxs(Ie,{"data-testid":"authorize-step-row",children:[t.jsx(Se,{children:c?t.jsx("img",{src:c,alt:""}):p}),t.jsxs(Te,{children:[t.jsx(Ne,{title:d,children:d}),t.jsx(Ee,{children:s})]})]}),t.jsx(Be,{children:g("authorizeStep.note")}),t.jsx(oe,{message:l}),t.jsxs(Le,{children:[t.jsx(Re,{type:"button",onClick:y,disabled:f,children:g("authorizeStep.cancel")}),t.jsx(Pe,{type:"button","data-testid":"authorize-step-action",onClick:()=>void $(),disabled:f,children:f?t.jsxs(t.Fragment,{children:[t.jsx(Fe,{"aria-hidden":!0}),g("authorizeStep.authorizing")]}):g("authorizeStep.authorize")})]})]})})}async function ft(a){const[n]=await Ke({...a,trades:[a.trade]});return n}async function Ke(a){const{trades:n,buyer:i,signer:s,onSigned:d}=a;if(n.length===0)throw new Error("No items to buy");const c=new Map;for(const h of n){const y=`${h.chainId}:${h.contract.toLowerCase()}`,m=c.get(y);m?m.push(h):c.set(y,[h])}const p=[];for(const h of c.values())p.push(await De({trades:h,buyer:i,signer:s,onSigned:d}));return p}async function De(a){const{trades:n,buyer:i,signer:s,onSigned:d}=a,c=n[0],p=W(
|
|
292
|
+
`;function gt({auth:a,signer:n,title:i,reason:s,name:d,image:c,icon:p,onAuthorized:h,onCancel:y,onClose:m}){const[f,w]=v.useState(!1),[l,b]=v.useState(null);async function $(){w(!0),b(null);try{await ee({auth:a,signer:n,active:!0}),h()}catch(u){ie(u)?b(g("authorizeStep.errorRejected")):(X(u,{flow:"authorize_step",kind:a.kind}),b(g("authorizeStep.errorGeneric"))),w(!1)}}return t.jsx(Ce,{onClick:f?void 0:m,role:"presentation",children:t.jsxs(ze,{onClick:u=>u.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":i,children:[t.jsxs(Me,{children:[t.jsx(Ae,{children:i}),t.jsx(We,{onClick:m,disabled:f,"aria-label":g("authorizeStep.close"),children:t.jsx(Q,{name:"close",className:"ico"})})]}),t.jsxs(Ie,{"data-testid":"authorize-step-row",children:[t.jsx(Se,{children:c?t.jsx("img",{src:c,alt:""}):p}),t.jsxs(Te,{children:[t.jsx(Ne,{title:d,children:d}),t.jsx(Ee,{children:s})]})]}),t.jsx(Be,{children:g("authorizeStep.note")}),t.jsx(oe,{message:l}),t.jsxs(Le,{children:[t.jsx(Re,{type:"button",onClick:y,disabled:f,children:g("authorizeStep.cancel")}),t.jsx(Pe,{type:"button","data-testid":"authorize-step-action",onClick:()=>void $(),disabled:f,children:f?t.jsxs(t.Fragment,{children:[t.jsx(Fe,{"aria-hidden":!0}),g("authorizeStep.authorizing")]}):g("authorizeStep.authorize")})]})]})})}async function ft(a){const[n]=await Ke({...a,trades:[a.trade]});return n}async function Ke(a){const{trades:n,buyer:i,signer:s,onSigned:d}=a;if(n.length===0)throw new Error("No items to buy");const c=new Map;for(const h of n){const y=`${h.chainId}:${h.contract.toLowerCase()}`,m=c.get(y);m?m.push(h):c.set(y,[h])}const p=[];for(const h of c.values())p.push(await De({trades:h,buyer:i,signer:s,onSigned:d}));return p}async function De(a){const{trades:n,buyer:i,signer:s,onSigned:d}=a,c=n[0],p=W(J(c.contract),c.chainId),h=W(B.MANAToken,c.chainId);await U({auth:{kind:H.Allowance,contractAddress:h.address,spenderAddress:p.address,chainId:c.chainId},signer:s});const y=n.map(l=>re(l,i));if(K.enabled)try{const l=new he(p.abi).encodeFunctionData("accept",[y]),b=te(),$=ne(s.provider,b),u=await de($,b,l,p,{serverURL:K.relayerUrl});return d==null||d(),await b.waitForTransaction(u,1,12e4),u}catch(l){if(l instanceof le&&l.code===pe.USER_DENIED)throw l;console.warn("[buyWithMana] gasless meta-tx failed, falling back to a direct tx:",l)}await ae(s.provider,c.chainId);const f=await new ue(p.address,p.abi,s).accept(y,ce(c.chainId));return d==null||d(),(await f.wait()).transactionHash}async function mt(a){const{trade:n,buyer:i,signer:s,credits:d,manaGapWei:c}=a;if(d.length===0)throw new Error("No credits to spend — use buyWithMana for a MANA-only purchase");if(c<=0n)throw new Error("No MANA gap to cover — use buyWithCredits for a credits-only purchase");const p=W(B.MANAToken,n.chainId),h=W(B.CreditsManager,n.chainId);await U({auth:{kind:H.Allowance,contractAddress:p.address,spenderAddress:h.address,chainId:n.chainId},signer:s});const m=(d.reduce((f,w)=>f+BigInt(w.availableAmount),0n)+c).toString();return se({trade:n,buyer:i,signer:s,credits:d,maxCreditedValue:m})}function bt(a){return t.jsx("svg",{viewBox:"0 0 18 18",width:"18",height:"18","aria-hidden":!0,...a,children:t.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#161518",strokeWidth:"1.8",strokeLinecap:"round"})})}function yt(a){return t.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":!0,...a,children:[t.jsx("path",{d:"M12 3L2 20h20L12 3z",fill:"none",stroke:"#691fa9",strokeWidth:"1.8",strokeLinejoin:"round"}),t.jsx("path",{d:"M12 9v5",stroke:"#691fa9",strokeWidth:"1.8",strokeLinecap:"round"}),t.jsx("circle",{cx:"12",cy:"17",r:"1.1",fill:"#691fa9"})]})}const{colors:r,gradients:O,radius:V,z:Qe}=o,wt=e.div`
|
|
293
293
|
position: fixed;
|
|
294
294
|
inset: 0;
|
|
295
295
|
z-index: ${Qe.overlay};
|
|
@@ -422,7 +422,7 @@ import{j as t,r as v}from"./react-vyZjIDcS.js";import{s as e,t as o,d as g,y as
|
|
|
422
422
|
color: ${r.text};
|
|
423
423
|
overflow: hidden;
|
|
424
424
|
text-overflow: ellipsis;
|
|
425
|
-
`,Lt=e(
|
|
425
|
+
`,Lt=e(Z)`
|
|
426
426
|
font-size: 10px;
|
|
427
427
|
line-height: 1.43;
|
|
428
428
|
color: ${r.muted};
|
|
@@ -477,11 +477,11 @@ import{j as t,r as v}from"./react-vyZjIDcS.js";import{s as e,t as o,d as g,y as
|
|
|
477
477
|
&[data-on] {
|
|
478
478
|
border: 4px solid ${r.magenta};
|
|
479
479
|
}
|
|
480
|
-
`,
|
|
480
|
+
`,Ut=e(k)`
|
|
481
481
|
width: 24px;
|
|
482
482
|
height: 24px;
|
|
483
483
|
background: ${r.text};
|
|
484
|
-
`,
|
|
484
|
+
`,Ht=e.span`
|
|
485
485
|
font-size: 24px;
|
|
486
486
|
font-weight: 500;
|
|
487
487
|
color: ${r.text};
|
|
@@ -517,7 +517,7 @@ import{j as t,r as v}from"./react-vyZjIDcS.js";import{s as e,t as o,d as g,y as
|
|
|
517
517
|
margin-top: -8px;
|
|
518
518
|
padding-top: 8px;
|
|
519
519
|
background: ${r.white};
|
|
520
|
-
`,
|
|
520
|
+
`,Jt=e.button`
|
|
521
521
|
flex: 1;
|
|
522
522
|
/* Let the CTAs shrink so their min-content can't widen the modal past the viewport on mobile. */
|
|
523
523
|
min-width: 0;
|
|
@@ -563,7 +563,7 @@ import{j as t,r as v}from"./react-vyZjIDcS.js";import{s as e,t as o,d as g,y as
|
|
|
563
563
|
opacity: 0.6;
|
|
564
564
|
cursor: default;
|
|
565
565
|
}
|
|
566
|
-
`,
|
|
566
|
+
`,Zt=e.img`
|
|
567
567
|
width: 61px;
|
|
568
568
|
height: 61px;
|
|
569
569
|
`,qt=e.div`
|
|
@@ -665,9 +665,9 @@ import{j as t,r as v}from"./react-vyZjIDcS.js";import{s as e,t as o,d as g,y as
|
|
|
665
665
|
text-align: center;
|
|
666
666
|
}
|
|
667
667
|
}
|
|
668
|
-
`,{colors:I,media:A}=o,
|
|
668
|
+
`,{colors:I,media:A}=o,Ue=e.section`
|
|
669
669
|
margin-top: 40px;
|
|
670
|
-
`,
|
|
670
|
+
`,He=e.div`
|
|
671
671
|
display: flex;
|
|
672
672
|
align-items: center;
|
|
673
673
|
justify-content: space-between;
|
|
@@ -779,7 +779,7 @@ import{j as t,r as v}from"./react-vyZjIDcS.js";import{s as e,t as o,d as g,y as
|
|
|
779
779
|
justify-content: center;
|
|
780
780
|
gap: 8px;
|
|
781
781
|
margin-top: 18px;
|
|
782
|
-
`,
|
|
782
|
+
`,Je=e.button`
|
|
783
783
|
width: 10px;
|
|
784
784
|
height: 10px;
|
|
785
785
|
border-radius: 50%;
|
|
@@ -801,4 +801,4 @@ import{j as t,r as v}from"./react-vyZjIDcS.js";import{s as e,t as o,d as g,y as
|
|
|
801
801
|
opacity: 1;
|
|
802
802
|
transform: scale(1.1);
|
|
803
803
|
}
|
|
804
|
-
`;function cn({title:a,items:n,onViewAll:i}){const s=v.useRef(null),[d,c]=v.useState(1),[p,h]=v.useState(0),[y,m]=v.useState(!0),[f,w]=v.useState(!1),l=v.useCallback(()=>{const u=s.current;if(!u)return;const{scrollLeft:x,scrollWidth:R,clientWidth:S}=u,P=Math.max(1,Math.ceil(R/S));c(P),h(Math.min(P-1,Math.round(x/S))),m(x<=1),w(x+S>=R-1)},[]);if(v.useEffect(()=>{l();const u=s.current;if(u)return u.addEventListener("scroll",l,{passive:!0}),window.addEventListener("resize",l),()=>{u.removeEventListener("scroll",l),window.removeEventListener("resize",l)}},[l,n.length]),n.length===0)return null;function b(u){const x=s.current;x&&x.scrollBy({left:u*x.clientWidth,behavior:"smooth"})}function $(u){const x=s.current;x&&x.scrollTo({left:u*x.clientWidth,behavior:"smooth"})}return t.jsxs(
|
|
804
|
+
`;function cn({title:a,items:n,onViewAll:i}){const s=v.useRef(null),[d,c]=v.useState(1),[p,h]=v.useState(0),[y,m]=v.useState(!0),[f,w]=v.useState(!1),l=v.useCallback(()=>{const u=s.current;if(!u)return;const{scrollLeft:x,scrollWidth:R,clientWidth:S}=u,P=Math.max(1,Math.ceil(R/S));c(P),h(Math.min(P-1,Math.round(x/S))),m(x<=1),w(x+S>=R-1)},[]);if(v.useEffect(()=>{l();const u=s.current;if(u)return u.addEventListener("scroll",l,{passive:!0}),window.addEventListener("resize",l),()=>{u.removeEventListener("scroll",l),window.removeEventListener("resize",l)}},[l,n.length]),n.length===0)return null;function b(u){const x=s.current;x&&x.scrollBy({left:u*x.clientWidth,behavior:"smooth"})}function $(u){const x=s.current;x&&x.scrollTo({left:u*x.clientWidth,behavior:"smooth"})}return t.jsxs(Ue,{children:[t.jsxs(He,{children:[t.jsx(_e,{children:a}),i?t.jsxs(Oe,{onClick:i,children:[g("collectionCarousel.viewAll"),t.jsx(Ve,{name:"chevron-down",size:16})]}):null]}),t.jsxs(Ge,{children:[t.jsx(D,{"data-side":"left",onClick:()=>b(-1),"aria-label":g("collectionCarousel.scrollLeft"),disabled:y,children:t.jsx("img",{src:F,alt:"","aria-hidden":!0})}),t.jsx(Ye,{ref:s,children:n.map(u=>t.jsx(q,{item:u},u.id))}),t.jsx(D,{"data-side":"right",onClick:()=>b(1),"aria-label":g("collectionCarousel.scrollRight"),disabled:f,children:t.jsx("img",{src:F,alt:"","aria-hidden":!0})})]}),d>1?t.jsx(Xe,{"aria-label":g("collectionCarousel.pages"),children:Array.from({length:d}).map((u,x)=>t.jsx(Je,{"data-active":x===p||void 0,"aria-label":g("collectionCarousel.goToPage",{page:x+1}),"aria-current":x===p?"true":void 0,onClick:()=>$(x)},x))}):null]})}export{z as $,Tt as A,Mt as B,kt as C,Ht as D,_t as E,Ot as F,Vt as G,$t as H,Gt as I,Yt as J,dt as K,Zt as L,wt as M,ct as N,cn as O,ut as P,gt as Q,T as R,vt as S,Ct as T,rt as U,xt as V,Ft as W,zt as X,Ke as Y,lt as Z,fe as _,jt as a,sn as a0,rn as a1,ft as a2,pt as a3,mt as a4,bt as b,At as c,Wt as d,It as e,St as f,qt as g,en as h,tn as i,Xt as j,Jt as k,nn as l,ht as m,an as n,on as o,yt as p,Kt as q,Nt as r,Et as s,Bt as t,Lt as u,Rt as v,Pt as w,Dt as x,Qt as y,Ut as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as ee}from"./react-vyZjIDcS.js";import{B as H}from"./dcl-schemas-BICTSpB5.js";import{r as te}from"./index-DutOGRmD.js";import{p as N}from"./sentry-B35L1FdR.js";import{r as ne}from"./browser-ponyfill-BvriZgAo.js";function re(o,E){for(var M=0;M<E.length;M++){const y=E[M];if(typeof y!="string"&&!Array.isArray(y)){for(const C in y)if(C!=="default"&&!(C in o)){const F=Object.getOwnPropertyDescriptor(y,C);F&&Object.defineProperty(o,C,F.get?F:{enumerable:!0,get:()=>y[C]})}}}return Object.freeze(Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}))}var R={},Q,W;function ie(){return W||(W=1,Q=typeof self=="object"?self.FormData:window.FormData),Q}var V={},I={},q={},L={},z;function ae(){if(z)return L;z=1,Object.defineProperty(L,"__esModule",{value:!0}),L.isUsingNode=void 0;function o(){return typeof N<"u"&&N.release&&N.release.name==="node"}return L.isUsingNode=o,L}var G;function se(){if(G)return q;G=1;var o=q&&q.__createBinding||(Object.create?(function(a,l,m,d){d===void 0&&(d=m);var g=Object.getOwnPropertyDescriptor(l,m);(!g||("get"in g?!l.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return l[m]}}),Object.defineProperty(a,d,g)}):(function(a,l,m,d){d===void 0&&(d=m),a[d]=l[m]})),E=q&&q.__setModuleDefault||(Object.create?(function(a,l){Object.defineProperty(a,"default",{enumerable:!0,value:l})}):function(a,l){a.default=l}),M=q&&q.__importStar||function(a){if(a&&a.__esModule)return a;var l={};if(a!=null)for(var m in a)m!=="default"&&Object.prototype.hasOwnProperty.call(a,m)&&o(l,a,m);return E(l,a),l},y=q&&q.__rest||function(a,l){var m={};for(var d in a)Object.prototype.hasOwnProperty.call(a,d)&&l.indexOf(d)<0&&(m[d]=a[d]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var g=0,d=Object.getOwnPropertySymbols(a);g<d.length;g++)l.indexOf(d[g])<0&&Object.prototype.propertyIsEnumerable.call(a,d[g])&&(m[d[g]]=a[d[g]]);return m};Object.defineProperty(q,"__esModule",{value:!0}),q.createFetchComponent=void 0;const C=M(ne()),F=ae(),D=[400,401,403,404],U=["GET","HEAD","OPTIONS","PUT","DELETE"];async function _(a,l){const{timeout:m,abortController:d,signal:g,retryDelay:$}=l;let O=l.attempts,r=null,e;do try{m&&(r=setTimeout(()=>{d.abort()},m));const i=C.default(a.toString(),Object.assign(Object.assign({},l),{signal:g})),t=Promise.race([i,new Promise((c,v)=>{g.addEventListener("abort",()=>{c(new C.Response("timeout",{status:408,statusText:"Request Timeout"}))})})]);--O,e=await t,r&&clearTimeout(r)}finally{if(e&&(e.ok||D.includes(e.status)||O===0))break;await new Promise(i=>setTimeout(i,$))}while((!e||!e.ok)&&O>0);return e}function j(a){async function l(m,d){const $=Object.assign(Object.assign({},a==null?void 0:a.defaultFetcherOptions),d)||{},{timeout:O,method:r="GET",retryDelay:e=0,abortController:i}=$,t=y($,["timeout","method","retryDelay","abortController"]);let c=t.attempts||1;const v=i||new AbortController,{signal:s}=v;a!=null&&a.defaultHeaders&&(t.headers=Object.assign(Object.assign({},a==null?void 0:a.defaultHeaders),t.headers||{})),U.includes(r.toUpperCase())||(c=1);const n=await _(m,Object.assign(Object.assign({},t),{attempts:c,method:r,timeout:O,retryDelay:e,signal:s,abortController:v}));if(!(n!=null&&n.ok)){const u=await(n==null?void 0:n.text());throw new Error(`Failed to fetch ${m}. Got status ${n==null?void 0:n.status}. Response was '${u}'`)}return!(0,F.isUsingNode)()&&n&&Object.defineProperty(n,"buffer",{value:async function(){return H.from(await n.arrayBuffer())},configurable:!0}),s.aborted?void 0:n}return{fetch:l}}return q.createFetchComponent=j,q}var Y;function oe(){return Y||(Y=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.createFetchComponent=void 0;var E=se();Object.defineProperty(o,"createFetchComponent",{enumerable:!0,get:function(){return E.createFetchComponent}})})(I)),I}const le="0.0.0-development",ue={version:le};var X;function ce(){return X||(X=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.QueryBuilder=o.sanitizeUrl=o.mergeRequestOptions=o.isNode=o.convertFiltersToQueryParams=o.splitValuesIntoManyQueries=o.splitValuesIntoManyQueryBuilders=o.splitAndFetchPaginated=o.splitAndFetch=o.MAX_URL_LENGTH=o.addModelToFormData=o.getCurrentVersion=void 0;const E=oe(),M=ue;function y(){return M.version}o.getCurrentVersion=y;function C(r,e,i=""){for(const t in r){if(!r.hasOwnProperty(t)||r[t]===null||r[t]===void 0)continue;const c=i?`${i}[${t}]`:t;r[t]instanceof Date?e.append(c,r[t].toISOString()):r[t]instanceof Array?r[t].forEach((v,s)=>{const n=`${c}[${s}]`;C(v,e,n)}):typeof r[t]=="object"?C(r[t],e,c):e.append(c,r[t].toString())}return e}o.addModelToFormData=C;function F(r){return Array.from(new Set(r))}o.MAX_URL_LENGTH=2048;async function D({baseUrl:r,path:e,queryParams:i,fetcher:t,uniqueBy:c,options:v}){t=t||(0,E.createFetchComponent)();const s=a({baseUrl:r,path:e,queryParams:i}),n=new Map;for(const u of s)(await(await t.fetch(u,{...v,headers:{"Content-Type":"application/json"}})).json()).forEach(w=>n.set(c?w[c]:n.size,w));return Array.from(n.values())}o.splitAndFetch=D;const U=7;async function _({baseUrl:r,path:e,queryParams:i,elementsProperty:t,uniqueBy:c,options:v,fetcher:s}){s=s||(0,E.createFetchComponent)();const u=a({baseUrl:r,path:e,queryParams:i,reservedParams:new Map([["offset",U]])}),f=new Map;let w=!1;for(let b=0;b<u.length&&!w;b++){let p=u[b];for(;p&&!w;)try{const P=(await s.fetch(p,v)).json();P[t].forEach(A=>f.set(A[c],A));const T=P.pagination.next;p=T?new URL(T,p).toString():void 0}catch{w=!0}}return Array.from(f.values())}o.splitAndFetchPaginated=_;function j({queryParams:r,baseUrl:e,path:i,reservedParams:t}){const c="name"in r?new Map([[r.name,r.values]]):r;if(c.size===0)return[new O(e+i,c,t)];const s=Array.from(c.entries()).map(([p,P])=>[p,F(P)]).sort(([p,P],[h,T])=>P.length-T.length),n=new O(e+i,new Map,t);for(let p=0;p<s.length-1;p++){const[P,h]=s[p];if(!n.canSetParams(P,h))throw new Error("This library can split one query param into many HTTP requests, but it can't split more than one. You will need to do that on the client side.");n.setParams(P,h)}let u=O.clone(n);const[f,w]=s[s.length-1],b=[];for(const p of w)u.canAddParam(f,p)||(b.push(u),u=O.clone(n)),u.addParam(f,p);return b.push(u),b}o.splitValuesIntoManyQueryBuilders=j;function a(r){return j(r).map(i=>i.toString())}o.splitValuesIntoManyQueries=a;function l(r){if(!r)return new Map;const e=Object.entries(r).filter(([i,t])=>!!t).map(([i,t])=>{const c=i.endsWith("s")?i.slice(0,-1):i;let v;if(Array.isArray(t))v=[...t].filter(g).map(s=>`${s}`);else if(g(t))v=[`${t}`];else throw new Error("Query params must be either a string, a number, a boolean or an array of the types just mentioned");return[c,v]}).filter(([i,t])=>t.length>0);return new Map(e)}o.convertFiltersToQueryParams=l;function m(){return Object.prototype.toString.call(typeof N<"u"?N:0)==="[object process]"}o.isNode=m;function d(r,e){const i={...r==null?void 0:r.headers,...e==null?void 0:e.headers};return{...r,...e,headers:i}}o.mergeRequestOptions=d;function g(r){return typeof r=="string"||typeof r=="number"||typeof r=="boolean"}function $(r){return r=r.trim(),!r.startsWith("https://")&&!r.startsWith("http://")&&(r="https://"+r),r.endsWith("/")&&(r=r.slice(0,-1)),r}o.sanitizeUrl=$;class O{constructor(e,i=new Map,t=new Map){this.baseUrl=e,this.queryParams=i,this.reservedParams=t,this.length=this.calculateUrlLength(i,t)}canAddParam(e,i){return this.length+e.length+i.length+2<o.MAX_URL_LENGTH}addParam(e,i){if(!this.canAddParam(e,i))throw new Error(`You can't add this parameter '${e}', since it would exceed the max url length`);const t=this.queryParams.get(e),c=t||[];return c.push(i),this.queryParams.set(e,c),this.length+=this.calculateAddedLength(e,[i]),this}canSetParams(e,i){const t=new Map([...this.queryParams,[e,i]]);return this.calculateUrlLength(t,this.reservedParams)<o.MAX_URL_LENGTH}setParams(e,i){if(!this.canSetParams(e,i))throw new Error(`You can't add this parameter '${e}', since it would exceed the max url length`);return this.queryParams.set(e,i.map(t=>`${t}`)),this.length=this.calculateUrlLength(this.queryParams,this.reservedParams),this}setParam(e,i){return this.setParams(e,[i]),this}toString(){let e=this.baseUrl,i=!1;for(const[t,c]of this.queryParams)for(const v of c)i?e+=`&${t}=${v}`:(e+=`?${t}=${v}`,i=!0);return e}calculateUrlLength(e,i){let t=this.baseUrl.length;for(const[c,v]of i)this.queryParams.has(c)||(t+=c.length+2+v);for(const[c,v]of e)t+=this.calculateAddedLength(c,v);return t}static clone(e){return new O(e.baseUrl,new Map(e.queryParams),e.reservedParams)}calculateAddedLength(e,i){return this.calculateArrayLength(i)+(e.length+2)*i.length}calculateArrayLength(e){return e.map(i=>`${i}`).reduce((i,t)=>i+t.length,0)}}o.QueryBuilder=O})(V)),V}var B={},J;function fe(){if(J)return B;J=1,Object.defineProperty(B,"__esModule",{value:!0}),B.retry=void 0;async function o(E,M,y,C){for(;y>0;)try{return await M()}catch(F){if(y--,y>0)console.info(`Failed to ${E}. Still have ${y} attempt/s left. Will try again in ${C}`),await new Promise(D=>setTimeout(D,C));else throw F}throw new Error("Please specify more than one attempt for the retry function")}return B.retry=o,B}var k;function de(){if(k)return R;k=1;var o=R&&R.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(R,"__esModule",{value:!0}),R.createContentClient=R.downloadContent=void 0;const E=te(),M=o(ie()),y=ce(),C=fe();function F(_){return _.buffer?_.buffer:_}async function D(_,j,a,l){const{attempts:m=3,retryDelay:d=500}=l||{},g=l!=null&&l.timeout?{timeout:l.timeout}:{};return(0,C.retry)(`fetch file with hash ${a} from ${j}`,async()=>{const $=await _.fetch(`${j}/${a}`,g),O=H.from(await $.arrayBuffer());if(!(l!=null&&l.avoidChecks)&&(a.startsWith("Qm")?await(0,E.hashV0)(O):await(0,E.hashV1)(O))!==a)throw new Error(`Failed to fetch file with hash ${a} from ${j}`);return O},m,d)}R.downloadContent=D;function U(_){const{fetcher:j,logger:a}=_,l=(0,y.sanitizeUrl)(_.url),m=_==null?void 0:_.parallelConfig;async function d(s,n,u){const f=new AbortController,w=f.signal,b=(0,y.mergeRequestOptions)(u,{signal:w});return new Promise(async p=>{let P=s.length;const h=()=>{P--,P===0&&p([])},T=A=>A&&Array.isArray(A)&&A.length>0?(f.abort(),p(A),!0):!1;s.forEach(async A=>{try{const S=(0,y.sanitizeUrl)(A),Z=await j.fetch(`${S}${n}`,b);if(w.aborted){h();return}const x=await Z.json();T(x)||h()}catch(S){w.aborted||a==null||a.warn(`Failed to fetch from ${A}:`,S),h()}})})}async function g(s,n,u){const w=(await Promise.allSettled(s.map(async h=>{try{const T=(0,y.sanitizeUrl)(h);return await(await j.fetch(`${T}${n}`,u)).json()}catch(T){return a==null||a.warn(`Failed to fetch from ${h}:`,T),[]}}))).filter(h=>h.status==="fulfilled").map(h=>h.value||[]),b=w.flatMap(h=>h),p=w.filter(h=>h.length===0).length,P=new Map;return b.forEach(h=>{(!P.has(h.id)||h.timestamp>P.get(h.id).timestamp)&&P.set(h.id,h)}),{entities:Array.from(P.values()),emptyResults:p}}async function $(s,n){const u=(0,y.isNode)(),f=new M.default;f.append("entityId",s.entityId),(0,y.addModelToFormData)(s.authChain,f,"authChain");const w=await c(Array.from(s.files.keys()),n);for(const[b,p]of s.files)(!w.has(b)||b===s.entityId)&&(u?f.append(b,H.isBuffer(p)?p:H.from(F(p)),b):f.append(b,new Blob([F(p)]),b));return f}async function O(s,n){const u=await $(s,n),f=(0,y.mergeRequestOptions)(n||{},{body:u,method:"POST"});return await j.fetch(`${l}/entities`,f)}async function r(s,n){if(s.length===0)return Promise.reject("You must set at least one pointer.");const u=(0,y.mergeRequestOptions)(n||{},{body:JSON.stringify({pointers:s}),method:"POST",headers:{"Content-Type":"application/json"}});return(await j.fetch(`${l}/entities/active`,u)).json()}async function e(s,n){if(s.length===0)return Promise.reject("You must set at least one id.");const u=(0,y.mergeRequestOptions)(n||{},{body:JSON.stringify({ids:s}),method:"POST",headers:{"Content-Type":"application/json"}}),f=(n==null?void 0:n.parallel)||m;return f!=null&&f.urls&&(f==null?void 0:f.urls.length)>0?d([l,...f.urls],"/entities/active",u):(await j.fetch(`${l}/entities/active`,u)).json()}async function i(s,n){const u=await e([s],n);return u.length===0?Promise.reject(`Failed to find an entity with id '${s}'.`):u[0]}function t(s,n){return s.length===0?Promise.reject("You must set at least one cid."):(0,y.splitAndFetch)({fetcher:j,options:n,baseUrl:l,path:"/available-content",queryParams:{name:"cid",values:s},uniqueBy:"cid"})}async function c(s,n){const f=(await t(s,n)).filter(w=>w.available).map(({cid:w})=>w);return new Set(f)}async function v(s,n){const u=(n==null?void 0:n.parallel)||m;if(!(u!=null&&u.urls)||u.urls.length===0)throw new Error("Parallel configuration is required for checking pointer consistency");const f=(0,y.mergeRequestOptions)(n||{},{body:JSON.stringify({pointers:[s]}),method:"POST",headers:{"Content-Type":"application/json"}}),w=[l,...u.urls],{entities:b,emptyResults:p}=await g(w,"/entities/active",f);if(b.length===0)return{isConsistent:!0,upToDateEntities:void 0,outdatedEntities:void 0};const P=Math.max(...b.map(S=>S.timestamp)),h=b.filter(S=>S.timestamp===P),T=b.filter(S=>S.timestamp<P);return{isConsistent:T.length===0&&p===0,upToDateEntities:h.length>0?h:void 0,outdatedEntities:T.length>0?T:void 0}}return{buildEntityFormDataForDeployment:$,fetchEntitiesByPointers:r,fetchEntitiesByIds:e,fetchEntityById:i,downloadContent:(s,n)=>D(j,l+"/contents",s,n),deploy:O,isContentAvailable:t,checkPointerConsistency:v}}return R.createContentClient=U,R}var K=de();const he=ee(K),we=re({__proto__:null,default:he},[K]);export{we as C};
|
|
1
|
+
import{g as ee}from"./react-vyZjIDcS.js";import{B as H}from"./dcl-schemas-BICTSpB5.js";import{r as te}from"./index-DgKHc2Pp.js";import{p as N}from"./sentry-B35L1FdR.js";import{r as ne}from"./browser-ponyfill-BvriZgAo.js";function re(o,E){for(var M=0;M<E.length;M++){const y=E[M];if(typeof y!="string"&&!Array.isArray(y)){for(const C in y)if(C!=="default"&&!(C in o)){const F=Object.getOwnPropertyDescriptor(y,C);F&&Object.defineProperty(o,C,F.get?F:{enumerable:!0,get:()=>y[C]})}}}return Object.freeze(Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}))}var R={},Q,W;function ie(){return W||(W=1,Q=typeof self=="object"?self.FormData:window.FormData),Q}var V={},I={},q={},L={},z;function ae(){if(z)return L;z=1,Object.defineProperty(L,"__esModule",{value:!0}),L.isUsingNode=void 0;function o(){return typeof N<"u"&&N.release&&N.release.name==="node"}return L.isUsingNode=o,L}var G;function se(){if(G)return q;G=1;var o=q&&q.__createBinding||(Object.create?(function(a,l,m,d){d===void 0&&(d=m);var g=Object.getOwnPropertyDescriptor(l,m);(!g||("get"in g?!l.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return l[m]}}),Object.defineProperty(a,d,g)}):(function(a,l,m,d){d===void 0&&(d=m),a[d]=l[m]})),E=q&&q.__setModuleDefault||(Object.create?(function(a,l){Object.defineProperty(a,"default",{enumerable:!0,value:l})}):function(a,l){a.default=l}),M=q&&q.__importStar||function(a){if(a&&a.__esModule)return a;var l={};if(a!=null)for(var m in a)m!=="default"&&Object.prototype.hasOwnProperty.call(a,m)&&o(l,a,m);return E(l,a),l},y=q&&q.__rest||function(a,l){var m={};for(var d in a)Object.prototype.hasOwnProperty.call(a,d)&&l.indexOf(d)<0&&(m[d]=a[d]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var g=0,d=Object.getOwnPropertySymbols(a);g<d.length;g++)l.indexOf(d[g])<0&&Object.prototype.propertyIsEnumerable.call(a,d[g])&&(m[d[g]]=a[d[g]]);return m};Object.defineProperty(q,"__esModule",{value:!0}),q.createFetchComponent=void 0;const C=M(ne()),F=ae(),D=[400,401,403,404],U=["GET","HEAD","OPTIONS","PUT","DELETE"];async function _(a,l){const{timeout:m,abortController:d,signal:g,retryDelay:$}=l;let O=l.attempts,r=null,e;do try{m&&(r=setTimeout(()=>{d.abort()},m));const i=C.default(a.toString(),Object.assign(Object.assign({},l),{signal:g})),t=Promise.race([i,new Promise((c,v)=>{g.addEventListener("abort",()=>{c(new C.Response("timeout",{status:408,statusText:"Request Timeout"}))})})]);--O,e=await t,r&&clearTimeout(r)}finally{if(e&&(e.ok||D.includes(e.status)||O===0))break;await new Promise(i=>setTimeout(i,$))}while((!e||!e.ok)&&O>0);return e}function j(a){async function l(m,d){const $=Object.assign(Object.assign({},a==null?void 0:a.defaultFetcherOptions),d)||{},{timeout:O,method:r="GET",retryDelay:e=0,abortController:i}=$,t=y($,["timeout","method","retryDelay","abortController"]);let c=t.attempts||1;const v=i||new AbortController,{signal:s}=v;a!=null&&a.defaultHeaders&&(t.headers=Object.assign(Object.assign({},a==null?void 0:a.defaultHeaders),t.headers||{})),U.includes(r.toUpperCase())||(c=1);const n=await _(m,Object.assign(Object.assign({},t),{attempts:c,method:r,timeout:O,retryDelay:e,signal:s,abortController:v}));if(!(n!=null&&n.ok)){const u=await(n==null?void 0:n.text());throw new Error(`Failed to fetch ${m}. Got status ${n==null?void 0:n.status}. Response was '${u}'`)}return!(0,F.isUsingNode)()&&n&&Object.defineProperty(n,"buffer",{value:async function(){return H.from(await n.arrayBuffer())},configurable:!0}),s.aborted?void 0:n}return{fetch:l}}return q.createFetchComponent=j,q}var Y;function oe(){return Y||(Y=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.createFetchComponent=void 0;var E=se();Object.defineProperty(o,"createFetchComponent",{enumerable:!0,get:function(){return E.createFetchComponent}})})(I)),I}const le="0.0.0-development",ue={version:le};var X;function ce(){return X||(X=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.QueryBuilder=o.sanitizeUrl=o.mergeRequestOptions=o.isNode=o.convertFiltersToQueryParams=o.splitValuesIntoManyQueries=o.splitValuesIntoManyQueryBuilders=o.splitAndFetchPaginated=o.splitAndFetch=o.MAX_URL_LENGTH=o.addModelToFormData=o.getCurrentVersion=void 0;const E=oe(),M=ue;function y(){return M.version}o.getCurrentVersion=y;function C(r,e,i=""){for(const t in r){if(!r.hasOwnProperty(t)||r[t]===null||r[t]===void 0)continue;const c=i?`${i}[${t}]`:t;r[t]instanceof Date?e.append(c,r[t].toISOString()):r[t]instanceof Array?r[t].forEach((v,s)=>{const n=`${c}[${s}]`;C(v,e,n)}):typeof r[t]=="object"?C(r[t],e,c):e.append(c,r[t].toString())}return e}o.addModelToFormData=C;function F(r){return Array.from(new Set(r))}o.MAX_URL_LENGTH=2048;async function D({baseUrl:r,path:e,queryParams:i,fetcher:t,uniqueBy:c,options:v}){t=t||(0,E.createFetchComponent)();const s=a({baseUrl:r,path:e,queryParams:i}),n=new Map;for(const u of s)(await(await t.fetch(u,{...v,headers:{"Content-Type":"application/json"}})).json()).forEach(w=>n.set(c?w[c]:n.size,w));return Array.from(n.values())}o.splitAndFetch=D;const U=7;async function _({baseUrl:r,path:e,queryParams:i,elementsProperty:t,uniqueBy:c,options:v,fetcher:s}){s=s||(0,E.createFetchComponent)();const u=a({baseUrl:r,path:e,queryParams:i,reservedParams:new Map([["offset",U]])}),f=new Map;let w=!1;for(let b=0;b<u.length&&!w;b++){let p=u[b];for(;p&&!w;)try{const P=(await s.fetch(p,v)).json();P[t].forEach(A=>f.set(A[c],A));const T=P.pagination.next;p=T?new URL(T,p).toString():void 0}catch{w=!0}}return Array.from(f.values())}o.splitAndFetchPaginated=_;function j({queryParams:r,baseUrl:e,path:i,reservedParams:t}){const c="name"in r?new Map([[r.name,r.values]]):r;if(c.size===0)return[new O(e+i,c,t)];const s=Array.from(c.entries()).map(([p,P])=>[p,F(P)]).sort(([p,P],[h,T])=>P.length-T.length),n=new O(e+i,new Map,t);for(let p=0;p<s.length-1;p++){const[P,h]=s[p];if(!n.canSetParams(P,h))throw new Error("This library can split one query param into many HTTP requests, but it can't split more than one. You will need to do that on the client side.");n.setParams(P,h)}let u=O.clone(n);const[f,w]=s[s.length-1],b=[];for(const p of w)u.canAddParam(f,p)||(b.push(u),u=O.clone(n)),u.addParam(f,p);return b.push(u),b}o.splitValuesIntoManyQueryBuilders=j;function a(r){return j(r).map(i=>i.toString())}o.splitValuesIntoManyQueries=a;function l(r){if(!r)return new Map;const e=Object.entries(r).filter(([i,t])=>!!t).map(([i,t])=>{const c=i.endsWith("s")?i.slice(0,-1):i;let v;if(Array.isArray(t))v=[...t].filter(g).map(s=>`${s}`);else if(g(t))v=[`${t}`];else throw new Error("Query params must be either a string, a number, a boolean or an array of the types just mentioned");return[c,v]}).filter(([i,t])=>t.length>0);return new Map(e)}o.convertFiltersToQueryParams=l;function m(){return Object.prototype.toString.call(typeof N<"u"?N:0)==="[object process]"}o.isNode=m;function d(r,e){const i={...r==null?void 0:r.headers,...e==null?void 0:e.headers};return{...r,...e,headers:i}}o.mergeRequestOptions=d;function g(r){return typeof r=="string"||typeof r=="number"||typeof r=="boolean"}function $(r){return r=r.trim(),!r.startsWith("https://")&&!r.startsWith("http://")&&(r="https://"+r),r.endsWith("/")&&(r=r.slice(0,-1)),r}o.sanitizeUrl=$;class O{constructor(e,i=new Map,t=new Map){this.baseUrl=e,this.queryParams=i,this.reservedParams=t,this.length=this.calculateUrlLength(i,t)}canAddParam(e,i){return this.length+e.length+i.length+2<o.MAX_URL_LENGTH}addParam(e,i){if(!this.canAddParam(e,i))throw new Error(`You can't add this parameter '${e}', since it would exceed the max url length`);const t=this.queryParams.get(e),c=t||[];return c.push(i),this.queryParams.set(e,c),this.length+=this.calculateAddedLength(e,[i]),this}canSetParams(e,i){const t=new Map([...this.queryParams,[e,i]]);return this.calculateUrlLength(t,this.reservedParams)<o.MAX_URL_LENGTH}setParams(e,i){if(!this.canSetParams(e,i))throw new Error(`You can't add this parameter '${e}', since it would exceed the max url length`);return this.queryParams.set(e,i.map(t=>`${t}`)),this.length=this.calculateUrlLength(this.queryParams,this.reservedParams),this}setParam(e,i){return this.setParams(e,[i]),this}toString(){let e=this.baseUrl,i=!1;for(const[t,c]of this.queryParams)for(const v of c)i?e+=`&${t}=${v}`:(e+=`?${t}=${v}`,i=!0);return e}calculateUrlLength(e,i){let t=this.baseUrl.length;for(const[c,v]of i)this.queryParams.has(c)||(t+=c.length+2+v);for(const[c,v]of e)t+=this.calculateAddedLength(c,v);return t}static clone(e){return new O(e.baseUrl,new Map(e.queryParams),e.reservedParams)}calculateAddedLength(e,i){return this.calculateArrayLength(i)+(e.length+2)*i.length}calculateArrayLength(e){return e.map(i=>`${i}`).reduce((i,t)=>i+t.length,0)}}o.QueryBuilder=O})(V)),V}var B={},J;function fe(){if(J)return B;J=1,Object.defineProperty(B,"__esModule",{value:!0}),B.retry=void 0;async function o(E,M,y,C){for(;y>0;)try{return await M()}catch(F){if(y--,y>0)console.info(`Failed to ${E}. Still have ${y} attempt/s left. Will try again in ${C}`),await new Promise(D=>setTimeout(D,C));else throw F}throw new Error("Please specify more than one attempt for the retry function")}return B.retry=o,B}var k;function de(){if(k)return R;k=1;var o=R&&R.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(R,"__esModule",{value:!0}),R.createContentClient=R.downloadContent=void 0;const E=te(),M=o(ie()),y=ce(),C=fe();function F(_){return _.buffer?_.buffer:_}async function D(_,j,a,l){const{attempts:m=3,retryDelay:d=500}=l||{},g=l!=null&&l.timeout?{timeout:l.timeout}:{};return(0,C.retry)(`fetch file with hash ${a} from ${j}`,async()=>{const $=await _.fetch(`${j}/${a}`,g),O=H.from(await $.arrayBuffer());if(!(l!=null&&l.avoidChecks)&&(a.startsWith("Qm")?await(0,E.hashV0)(O):await(0,E.hashV1)(O))!==a)throw new Error(`Failed to fetch file with hash ${a} from ${j}`);return O},m,d)}R.downloadContent=D;function U(_){const{fetcher:j,logger:a}=_,l=(0,y.sanitizeUrl)(_.url),m=_==null?void 0:_.parallelConfig;async function d(s,n,u){const f=new AbortController,w=f.signal,b=(0,y.mergeRequestOptions)(u,{signal:w});return new Promise(async p=>{let P=s.length;const h=()=>{P--,P===0&&p([])},T=A=>A&&Array.isArray(A)&&A.length>0?(f.abort(),p(A),!0):!1;s.forEach(async A=>{try{const S=(0,y.sanitizeUrl)(A),Z=await j.fetch(`${S}${n}`,b);if(w.aborted){h();return}const x=await Z.json();T(x)||h()}catch(S){w.aborted||a==null||a.warn(`Failed to fetch from ${A}:`,S),h()}})})}async function g(s,n,u){const w=(await Promise.allSettled(s.map(async h=>{try{const T=(0,y.sanitizeUrl)(h);return await(await j.fetch(`${T}${n}`,u)).json()}catch(T){return a==null||a.warn(`Failed to fetch from ${h}:`,T),[]}}))).filter(h=>h.status==="fulfilled").map(h=>h.value||[]),b=w.flatMap(h=>h),p=w.filter(h=>h.length===0).length,P=new Map;return b.forEach(h=>{(!P.has(h.id)||h.timestamp>P.get(h.id).timestamp)&&P.set(h.id,h)}),{entities:Array.from(P.values()),emptyResults:p}}async function $(s,n){const u=(0,y.isNode)(),f=new M.default;f.append("entityId",s.entityId),(0,y.addModelToFormData)(s.authChain,f,"authChain");const w=await c(Array.from(s.files.keys()),n);for(const[b,p]of s.files)(!w.has(b)||b===s.entityId)&&(u?f.append(b,H.isBuffer(p)?p:H.from(F(p)),b):f.append(b,new Blob([F(p)]),b));return f}async function O(s,n){const u=await $(s,n),f=(0,y.mergeRequestOptions)(n||{},{body:u,method:"POST"});return await j.fetch(`${l}/entities`,f)}async function r(s,n){if(s.length===0)return Promise.reject("You must set at least one pointer.");const u=(0,y.mergeRequestOptions)(n||{},{body:JSON.stringify({pointers:s}),method:"POST",headers:{"Content-Type":"application/json"}});return(await j.fetch(`${l}/entities/active`,u)).json()}async function e(s,n){if(s.length===0)return Promise.reject("You must set at least one id.");const u=(0,y.mergeRequestOptions)(n||{},{body:JSON.stringify({ids:s}),method:"POST",headers:{"Content-Type":"application/json"}}),f=(n==null?void 0:n.parallel)||m;return f!=null&&f.urls&&(f==null?void 0:f.urls.length)>0?d([l,...f.urls],"/entities/active",u):(await j.fetch(`${l}/entities/active`,u)).json()}async function i(s,n){const u=await e([s],n);return u.length===0?Promise.reject(`Failed to find an entity with id '${s}'.`):u[0]}function t(s,n){return s.length===0?Promise.reject("You must set at least one cid."):(0,y.splitAndFetch)({fetcher:j,options:n,baseUrl:l,path:"/available-content",queryParams:{name:"cid",values:s},uniqueBy:"cid"})}async function c(s,n){const f=(await t(s,n)).filter(w=>w.available).map(({cid:w})=>w);return new Set(f)}async function v(s,n){const u=(n==null?void 0:n.parallel)||m;if(!(u!=null&&u.urls)||u.urls.length===0)throw new Error("Parallel configuration is required for checking pointer consistency");const f=(0,y.mergeRequestOptions)(n||{},{body:JSON.stringify({pointers:[s]}),method:"POST",headers:{"Content-Type":"application/json"}}),w=[l,...u.urls],{entities:b,emptyResults:p}=await g(w,"/entities/active",f);if(b.length===0)return{isConsistent:!0,upToDateEntities:void 0,outdatedEntities:void 0};const P=Math.max(...b.map(S=>S.timestamp)),h=b.filter(S=>S.timestamp===P),T=b.filter(S=>S.timestamp<P);return{isConsistent:T.length===0&&p===0,upToDateEntities:h.length>0?h:void 0,outdatedEntities:T.length>0?T:void 0}}return{buildEntityFormDataForDeployment:$,fetchEntitiesByPointers:r,fetchEntitiesByIds:e,fetchEntityById:i,downloadContent:(s,n)=>D(j,l+"/contents",s,n),deploy:O,isContentAvailable:t,checkPointerConsistency:v}}return R.createContentClient=U,R}var K=de();const he=ee(K),we=re({__proto__:null,default:he},[K]);export{we as C};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as Y,j as e,L as ue,e as fe,u as be,r as y}from"./react-vyZjIDcS.js";import{t as Z,
|
|
1
|
+
import{b as Y,j as e,L as ue,e as fe,u as be,r as y}from"./react-vyZjIDcS.js";import{t as Z,az as we,aA as R,aB as _,s as a,aC as je,G as ve,aD as Ce,e as t,aE as W,B as ye,H as q,af as J,n as $e,ag as Q,I as T,c as ke,m as Ne,S,h as Pe,A as Se,ay as Le,aF as Ae}from"./index-D6kQ69Bn.js";import{d as Me,g as ze,a as Fe,P as Be,C as Ee,b as Ie,c as Re,A as _e,B as We,S as Te,M as He,e as Ge,f as Ue}from"./browseLayout.styles-DBRHDPrA.js";import{u as De,L as Ke}from"./useStore-B7PIu8Uw.js";import{c as H,a as Oe,F as Ve,d as Ye,P as Ze,e as qe,H as Je,S as Qe}from"./categories-BFgtEsDl.js";import{L as G}from"./LoadMore-D2rhC3FV.js";import{u as U}from"./useInfiniteGrid-BxfEkchv.js";import{E as D}from"./ErrorNotice-BStoa2Qo.js";import{G as K}from"./grid.styles-BdzonCru.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";const{colors:m,radius:X,media:Xe}=Z,et=a.article`
|
|
2
2
|
height: 300px;
|
|
3
3
|
background: ${m.bg};
|
|
4
4
|
border-radius: ${X.card};
|
|
@@ -74,7 +74,7 @@ import{b as Y,j as e,L as ue,e as fe,u as be,r as y}from"./react-vyZjIDcS.js";im
|
|
|
74
74
|
${Xe.maxWidth("mobile")} {
|
|
75
75
|
font-size: 16px;
|
|
76
76
|
}
|
|
77
|
-
`,
|
|
77
|
+
`,nt=a.div`
|
|
78
78
|
flex: 1;
|
|
79
79
|
min-height: 0;
|
|
80
80
|
display: grid;
|
|
@@ -84,7 +84,7 @@ import{b as Y,j as e,L as ue,e as fe,u as be,r as y}from"./react-vyZjIDcS.js";im
|
|
|
84
84
|
& > * {
|
|
85
85
|
grid-area: stack;
|
|
86
86
|
}
|
|
87
|
-
`,
|
|
87
|
+
`,st=a.div`
|
|
88
88
|
display: flex;
|
|
89
89
|
align-items: center;
|
|
90
90
|
justify-content: space-between;
|
|
@@ -135,7 +135,7 @@ import{b as Y,j as e,L as ue,e as fe,u as be,r as y}from"./react-vyZjIDcS.js";im
|
|
|
135
135
|
&:active {
|
|
136
136
|
background: ${m.accentActive};
|
|
137
137
|
}
|
|
138
|
-
`;function xt({collection:r,cover:i,itemCount:
|
|
138
|
+
`;function xt({collection:r,cover:i,itemCount:n}){const l=Y(),{contractAddress:x,name:u,creator:f}=r,C=i==null||n==null,{data:d}=Ce(x,C),w=i==null?(d==null?void 0:d.items)??[]:[],g=n??(d==null?void 0:d.total);function b(){l(`/collection/${x}`)}return e.jsxs(et,{"data-testid":"coll-card",role:"link",tabIndex:0,onClick:b,onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),b())},children:[e.jsx(tt,{children:i?e.jsx(it,{"data-testid":"coll-card-img",src:i,alt:"",loading:"lazy"}):w.length>0?e.jsx(ot,{items:w,tinted:!1}):null}),e.jsxs(at,{children:[e.jsx(rt,{title:u,children:u}),e.jsxs(nt,{children:[e.jsxs(st,{"data-meta":!0,"data-testid":"coll-card-meta",children:[f?e.jsx(ct,{address:f,linkToProfile:!0}):e.jsx(lt,{children:" "}),e.jsx(dt,{children:g==null?"…":t("collectionCard.itemCount",{count:g})})]}),e.jsx(ht,{"data-view":!0,"data-testid":"coll-card-view",onClick:h=>{h.stopPropagation(),b()},tabIndex:-1,children:t("collectionCard.viewCollection")})]})]})]})}function pt({address:r,className:i=""}){const n=W(x=>x.followed.includes(r.toLowerCase())),l=W(x=>x.toggle);return r?e.jsx(ye,{type:"button",size:"sm",variant:n?"ghost":"outline",className:i||void 0,"aria-pressed":n,title:n?t("creator.unfollowTitle"):t("creator.followTitle"),onClick:()=>l(r),children:n?t("creator.following"):t("creator.follow")}):null}const{colors:v,radius:ee,media:j}=Z,te=q`
|
|
139
139
|
display: inline-flex;
|
|
140
140
|
align-items: center;
|
|
141
141
|
justify-content: center;
|
|
@@ -303,4 +303,4 @@ import{b as Y,j as e,L as ue,e as fe,u as be,r as y}from"./react-vyZjIDcS.js";im
|
|
|
303
303
|
&:hover {
|
|
304
304
|
background: rgba(255, 255, 255, 0.14);
|
|
305
305
|
}
|
|
306
|
-
`,Nt={website:"website",twitter:"twitter",discord:"discord",facebook:"facebook"};function Pt({address:r}){var h,$;const{data:i}=J(r),{data:
|
|
306
|
+
`,Nt={website:"website",twitter:"twitter",discord:"discord",facebook:"facebook"};function Pt({address:r}){var h,$;const{data:i}=J(r),{data:n}=De(r),l=$e(c=>{var k;return(k=c.session)==null?void 0:k.address}),x=!!l&&l.toLowerCase()===r.toLowerCase(),u=(i==null?void 0:i.name)||Q(r),f=($=(h=i==null?void 0:i.avatar)==null?void 0:h.snapshots)==null?void 0:$.face256,C=(n==null?void 0:n.cover)||Me,d=n==null?void 0:n.description,w=`${ke.profileUrl}/${r}`,g=Ke.filter(c=>n==null?void 0:n.links[c]),b=ze(Fe({name:i==null?void 0:i.name,hasClaimedName:i==null?void 0:i.hasClaimedName,ethAddress:(i==null?void 0:i.ethAddress)??r}));return e.jsxs(gt,{"aria-label":`${u} storefront`,children:[e.jsxs(mt,{children:[e.jsx(ut,{src:C,alt:"",loading:"eager"}),e.jsx(ft,{"aria-hidden":!0})]}),(g.length>0||x)&&e.jsxs(bt,{children:[g.map(c=>e.jsx(wt,{"data-testid":"creator-hero-link",href:(n==null?void 0:n.links[c])??"",target:"_blank",rel:"noopener noreferrer",title:t(`creator.link.${c}`),"aria-label":t(`creator.link.${c}`),children:e.jsx(T,{name:Nt[c]})},c)),x&&e.jsx(jt,{to:"/store-settings",title:t("creator.editStore"),"aria-label":t("creator.editStore"),children:e.jsx(T,{name:"pen"})})]}),e.jsxs(vt,{children:[f?e.jsx(O,{src:f,alt:"",loading:"eager",style:{backgroundColor:b}}):e.jsx(O,{as:"span","aria-hidden":!0,style:{backgroundColor:b}}),e.jsxs("div",{children:[e.jsx(Ct,{children:u}),d?e.jsx(yt,{children:d}):null]}),e.jsxs($t,{children:[e.jsx(kt,{"data-testid":"creator-hero-view",href:w,target:"_blank",rel:"noopener noreferrer",children:t("creator.viewProfile")}),e.jsx(pt,{address:r,className:"creator-hero__follow"})]})]})]})}const V=48;function Ht(){const{address:r}=fe(),i=Y(),[n]=be(),l=n.has("collections"),{data:x}=J(r),u=(x==null?void 0:x.name)||(r?Q(r):t("creator.fallbackName"));Ne({title:u,description:t("seo.creator.description",{name:u})});const[f,C]=y.useState("wearable"),[d,w]=y.useState(null),[g,b]=y.useState([]),[h,$]=y.useState(""),[c,k]=y.useState(""),[A,oe]=y.useState("newest"),M=h&&!Number.isNaN(Number(h))?Number(h):void 0,z=c&&!Number.isNaN(Number(c))?Number(c):void 0,ae=d?Qe[d]:void 0,re=(H.find(o=>o.key===A)??H[0]).server,F={creator:r,category:f,rarities:g.length?g:void 0,wearableCategories:ae,minPriceCredits:M,maxPriceCredits:z,sortBy:re},{items:N,total:ne,isLoading:P,error:B,hasNextPage:se,isFetchingNextPage:E,fetchNextPage:ce}=U(["creator-listings",F],o=>Le({...F,first:V,skip:o}),{enabled:!!r&&!l}),p=U(["creator-collections",r],o=>Ae(r,{first:V,skip:o}).then(s=>({items:s.collections,total:s.total})),{enabled:!!r&&l});function le(o){C(o),w(null),l&&I()}function I(){const o=new URLSearchParams(n);o.delete("collections");const s=o.toString();i({search:s?`?${s}`:""},{replace:!0})}function de(){if(l){I();return}const o=new URLSearchParams(n);o.delete("collections");const s=o.toString();i({search:s?`?${s}&collections`:"?collections"},{replace:!0})}function he(o){b(s=>s.includes(o)?s.filter(me=>me!==o):[...s,o])}function xe(){C("wearable"),w(null),b([]),$(""),k("")}const L=!!(M||z),pe=L?`${h||"0"}–${c||"∞"}`:t("filter.price"),ge=f!=="wearable"||!!d||g.length>0||L;return e.jsxs(Be,{children:[e.jsxs(Ee,{"aria-label":t("creator.breadcrumbAria"),children:[e.jsx(Ie,{onClick:()=>i("/assets"),children:t("creator.breadcrumb")}),e.jsx("span",{children:"/"}),e.jsx(Re,{children:u})]}),r?e.jsx(Pt,{address:r}):null,!l&&!P&&N.length>0?e.jsx(_e,{items:N,source:"creator"}):null,e.jsxs(We,{children:[e.jsx(Te,{children:e.jsx(Oe,{category:f,subCategory:d,onCategory:le,onSub:w,title:t("creator.category"),flat:!0,collections:l,onCollections:de})}),e.jsx(He,{children:l?e.jsxs(e.Fragment,{children:[e.jsx(Ge,{children:e.jsx(Ue,{children:p.isLoading?"…":t("creator.collectionsCount",{count:p.total})})}),p.error?e.jsx(D,{message:t("creator.error")}):null,e.jsx(K,{"data-variant":"collections",children:p.isLoading?e.jsx(S,{count:9}):e.jsxs(e.Fragment,{children:[p.items.map(o=>e.jsx(xt,{collection:o,itemCount:o.itemCount},o.contractAddress)),p.isFetchingNextPage?e.jsx(S,{count:6}):null]})}),e.jsx(G,{hasNextPage:p.hasNextPage,isFetching:p.isFetchingNextPage,onLoadMore:()=>void p.fetchNextPage()}),!p.isLoading&&!p.error&&p.items.length===0?e.jsx("p",{className:"muted",children:t("creator.collectionsEmpty")}):null]}):e.jsxs(e.Fragment,{children:[e.jsx(Ve,{rarities:g,onToggleRarity:he,sort:A,onSort:oe,total:ne,loading:P,anyActive:ge,onClear:xe,renderTrailing:o=>e.jsx(Ye,{panelKey:"price",label:pe,active:L,panel:o,children:e.jsxs(Ze,{"data-variant":"price",children:[e.jsxs(qe,{children:[e.jsx("input",{type:"number",min:"0","aria-label":t("creator.priceMin"),placeholder:t("creator.priceMinPlaceholder"),value:h,onChange:s=>$(s.target.value)}),e.jsx("span",{children:"–"}),e.jsx("input",{type:"number",min:"0","aria-label":t("creator.priceMax"),placeholder:t("creator.priceMaxPlaceholder"),value:c,onChange:s=>k(s.target.value)})]}),e.jsx(Je,{children:t("creator.priceHint",{currency:Pe.name})})]})})}),B?e.jsx(D,{message:t("creator.error")}):null,e.jsx(K,{children:P?e.jsx(S,{count:15}):e.jsxs(e.Fragment,{children:[N.map(o=>e.jsx(Se,{item:o},o.id)),E?e.jsx(S,{count:6}):null]})}),e.jsx(G,{hasNextPage:se,isFetching:E,onLoadMore:()=>void ce()}),!P&&!B&&N.length===0?e.jsx("p",{className:"muted",children:t("creator.empty")}):null]})})]})]})}export{Ht as Creator,Ht as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{g as M}from"./react-vyZjIDcS.js";import{r as O}from"./index-
|
|
1
|
+
import{g as M}from"./react-vyZjIDcS.js";import{r as O}from"./index-DgKHc2Pp.js";import{r as _}from"./dcl-schemas-BICTSpB5.js";function C(u,w){for(var m=0;m<w.length;m++){const f=w[m];if(typeof f!="string"&&!Array.isArray(f)){for(const h in f)if(h!=="default"&&!(h in u)){const v=Object.getOwnPropertyDescriptor(f,h);v&&Object.defineProperty(u,h,v.get?v:{enumerable:!0,get:()=>f[h]})}}}return Object.freeze(Object.defineProperty(u,Symbol.toStringTag,{value:"Module"}))}var d={},F;function P(){if(F)return d;F=1,Object.defineProperty(d,"__esModule",{value:!0}),d.getHashesByKey=d.buildEntityWithoutNewFiles=d.buildEntity=d.buildEntityAndFile=void 0;const u=O(),w=_();async function m({type:n,pointers:t,timestamp:e,content:a,metadata:r}){var i;if(t.length===0)throw new Error("All entities must have at least one pointer.");const l={version:"v3",type:n,pointers:t,timestamp:e,content:a,metadata:r};if(a){const s=new Set;for(const b of a){const E=b.file.toLowerCase();if(s.has(E))throw new Error(`Error creating the deployable entity: Decentraland's file system is case insensitive, the file ${JSON.stringify(b.file)} is repeated`);s.add(E)}}const c=new TextEncoder().encode(JSON.stringify(l)),o={id:await(0,u.hashV1)(c),...l};if(!w.Entity.validate(o))throw new Error(`Generated entity is not valid:
|
|
2
2
|
`+((i=w.Entity.validate.errors)===null||i===void 0?void 0:i.map(s=>s.message).join(`
|
|
3
3
|
`)));return{entity:o,entityFile:c}}d.buildEntityAndFile=m;async function f({type:n,pointers:t,files:e,metadata:a,timestamp:r}){const i=Array.from(e||[]).map(([o,s])=>({key:o,content:s})),l=await Promise.all(i.map(async({key:o,content:s})=>({key:o,content:s,hash:await(0,u.hashV1)(s)}))),c=new Map(l.map(({hash:o,key:s})=>[s,o])),y=new Map(l.map(({hash:o,content:s})=>[o,s]));return v(n,t,{hashesByKey:c,filesByHash:y,metadata:a,timestamp:r})}d.buildEntity=f;async function h(n,{contentUrl:t,type:e,pointers:a,hashesByKey:r,metadata:i,timestamp:l}){const c=r??i?p(i):void 0;if(c&&A(e,c)){const y=await D(n,t,c),o=await H(y,i);return f({type:e,pointers:a,files:y,metadata:o,timestamp:l})}return v(e,a,{hashesByKey:r,metadata:i,timestamp:l})}d.buildEntityWithoutNewFiles=h;async function v(n,t,e){if(t.length===0)throw new Error("All entities must have at least one pointer.");const a=e!=null&&e.hashesByKey?e==null?void 0:e.hashesByKey:new Map,r=Array.from(a.entries()).map(([o,s])=>({file:o,hash:s})),i=e!=null&&e.timestamp?e==null?void 0:e.timestamp:Date.now(),{entity:l,entityFile:c}=await m({type:n,pointers:t,timestamp:i,content:r,metadata:e==null?void 0:e.metadata}),y=e!=null&&e.filesByHash?e.filesByHash:new Map;return y.set(l.id,c),{files:y,entityId:l.id}}function A(n,t){return n===w.EntityType.PROFILE&&Array.from(t).some(([,e])=>e.toLowerCase().startsWith("qm"))}async function g(n,t){const a=await(await n.fetch(t)).arrayBuffer();return new Uint8Array(a)}async function D(n,t,e){const a=e.get("body.png"),r=e.get("face256.png"),i=new URL(`${t}/contents/${a}`).toString(),l=new URL(`${t}/contents/${r}`).toString(),[c,y]=await Promise.all([g(n,i),g(n,l)]);return new Map([["body.png",c],["face256.png",y]])}async function H(n,t){return t&&(t.avatars=await Promise.all(t.avatars.map(async e=>{const a={face256:"",body:""},r=n.get("face256.png");r&&(a.face256=await(0,u.hashV1)(r));const i=n.get("body.png");return i&&(a.body=await(0,u.hashV1)(i)),e.avatar.snapshots=a,e})),t)}function p(n){const t=n.avatars[0];if(t.avatar.snapshots)return new Map([["body.png",t.avatar.snapshots.body],["face256.png",t.avatar.snapshots.face256]])}return d.getHashesByKey=p,d}var B=P();const N=M(B),I=C({__proto__:null,default:N},[B]);export{I as D};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as r}from"./react-vyZjIDcS.js";import{I as i}from"./index-
|
|
1
|
+
import{j as r}from"./react-vyZjIDcS.js";import{I as i}from"./index-D6kQ69Bn.js";function a({message:e,className:o,testId:t}){return e?r.jsxs("p",{className:o?`error-notice ${o}`:"error-notice","data-testid":t,role:"alert",children:[r.jsx(i,{name:"alert",className:"error-notice__ico",size:18}),r.jsx("span",{className:"error-notice__msg",children:e})]}):null}export{a as E};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as l,E as w,b as E,S as A,d as k,O as U,N as P,g as f,B as x,e as N,i as I,p as L}from"./W3MFrameProviderSingleton-
|
|
1
|
+
import{C as l,E as w,b as E,S as A,d as k,O as U,N as P,g as f,B as x,e as N,i as I,p as L}from"./W3MFrameProviderSingleton-DAYqclPH.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-Du25SJyr.js";const D=0,C={paymentAsset:null,amount:null,tokenAmount:0,priceLoading:!1,error:null,exchanges:[],isLoading:!1,currentPayment:void 0,isPaymentInProgress:!1,paymentId:"",assets:[]},e=L(C),m={state:e,subscribe(t){return I(e,()=>t(e))},subscribeKey(t,n){return N(e,t,n)},resetState(){Object.assign(e,{...C})},async getAssetsForNetwork(t){const n=v(t),s=await m.getAssetsImageAndPrice(n),r=n.map(a=>{var c,o,p,y;const u=a.asset==="native"?f():`${a.network}:${a.asset}`,i=s.find(S=>{var g,d,h;return((h=(d=(g=S.fungibles)==null?void 0:g[0])==null?void 0:d.address)==null?void 0:h.toLowerCase())===u.toLowerCase()});return{...a,price:((o=(c=i==null?void 0:i.fungibles)==null?void 0:c[0])==null?void 0:o.price)||1,metadata:{...a.metadata,iconUrl:(y=(p=i==null?void 0:i.fungibles)==null?void 0:p[0])==null?void 0:y.iconUrl}}});return e.assets=r,r},async getAssetsImageAndPrice(t){const n=t.map(r=>r.asset==="native"?f():`${r.network}:${r.asset}`);return await Promise.all(n.map(r=>x.fetchTokenPrice({addresses:[r]})))},getTokenAmount(){var s;if(!((s=e==null?void 0:e.paymentAsset)!=null&&s.price))throw new Error("Cannot get token price");const t=P.bigNumber(e.amount??0).round(8),n=P.bigNumber(e.paymentAsset.price).round(8);return t.div(n).round(8).toNumber()},setAmount(t){var n;e.amount=t,(n=e.paymentAsset)!=null&&n.price&&(e.tokenAmount=m.getTokenAmount())},setPaymentAsset(t){e.paymentAsset=t},isPayWithExchangeEnabled(){var t;return(t=U.state.remoteFeatures)==null?void 0:t.payWithExchange},isPayWithExchangeSupported(){return m.isPayWithExchangeEnabled()&&l.state.activeCaipNetwork&&k.PAY_WITH_EXCHANGE_SUPPORTED_CHAIN_NAMESPACES.includes(l.state.activeCaipNetwork.chainNamespace)},async fetchExchanges(){var t;try{const n=m.isPayWithExchangeSupported();if(!e.paymentAsset||!n){e.exchanges=[],e.isLoading=!1;return}e.isLoading=!0;const s=await _({page:D,asset:b(e.paymentAsset.network,e.paymentAsset.asset),amount:((t=e.amount)==null?void 0:t.toString())??"0"});e.exchanges=s.exchanges.slice(0,2)}catch{throw A.showError("Unable to get exchanges"),new Error("Unable to get exchanges")}finally{e.isLoading=!1}},async getPayUrl(t,n){try{const s=Number(n.amount),r=await W({exchangeId:t,asset:b(n.network,n.asset),amount:s.toString(),recipient:`${n.network}:${n.recipient}`});return w.sendEvent({type:"track",event:"PAY_EXCHANGE_SELECTED",properties:{exchange:{id:t},configuration:{network:n.network,asset:n.asset,recipient:n.recipient,amount:s},currentPayment:{type:"exchange",exchangeId:t},source:"fund-from-exchange",headless:!1}}),r}catch(s){throw s instanceof Error&&s.message.includes("is not supported")?new Error("Asset not supported"):new Error(s.message)}},async handlePayWithExchange(t){var n;try{const s=(n=l.getAccountData())==null?void 0:n.address;if(!s)throw new Error("No account connected");if(!e.paymentAsset)throw new Error("No payment asset selected");const r=E.returnOpenHref("","popupWindow","scrollbar=yes,width=480,height=720");if(!r)throw new Error("Could not create popup window");e.isPaymentInProgress=!0,e.paymentId=crypto.randomUUID(),e.currentPayment={type:"exchange",exchangeId:t};const{network:a,asset:u}=e.paymentAsset,i={network:a,asset:u,amount:e.tokenAmount,recipient:s},c=await m.getPayUrl(t,i);if(!c){try{r.close()}catch(o){console.error("Unable to close popup window",o)}throw new Error("Unable to initiate payment")}e.currentPayment.sessionId=c.sessionId,e.currentPayment.status="IN_PROGRESS",e.currentPayment.exchangeId=t,r.location.href=c.url}catch{e.error="Unable to initiate payment",A.showError(e.error)}},async waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r=20}){const a=await m.getBuyStatus(t,n,s);if(a.status==="SUCCESS"||a.status==="FAILED")return a;if(r===0)throw new Error("Unable to get deposit status");return await new Promise(u=>{setTimeout(u,5e3)}),m.waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r-1})},async getBuyStatus(t,n,s){var r,a,u,i,c;try{if(!e.currentPayment)throw new Error("No current payment");const o=await T({sessionId:n,exchangeId:t});if(e.currentPayment.status=o.status,o.status==="SUCCESS"||o.status==="FAILED"){const p=(r=l.getAccountData())==null?void 0:r.address;e.currentPayment.result=o.txHash,e.isPaymentInProgress=!1,w.sendEvent({type:"track",event:o.status==="SUCCESS"?"PAY_SUCCESS":"PAY_ERROR",properties:{message:o.status==="FAILED"?E.parseError(e.error):void 0,source:"fund-from-exchange",paymentId:s,configuration:{network:((a=e.paymentAsset)==null?void 0:a.network)||"",asset:((u=e.paymentAsset)==null?void 0:u.asset)||"",recipient:p||"",amount:e.amount??0},currentPayment:{type:"exchange",exchangeId:(i=e.currentPayment)==null?void 0:i.exchangeId,sessionId:(c=e.currentPayment)==null?void 0:c.sessionId,result:o.txHash}}})}return o}catch{return{status:"UNKNOWN",txHash:""}}},reset(){e.currentPayment=void 0,e.isPaymentInProgress=!1,e.paymentId="",e.paymentAsset=null,e.amount=0,e.tokenAmount=0,e.priceLoading=!1,e.error=null,e.exchanges=[],e.isLoading=!1}};export{m as E};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as pe,u as xe,r as l,j as t}from"./react-vyZjIDcS.js";import{s as i,t as e,
|
|
1
|
+
import{b as pe,u as xe,r as l,j as t}from"./react-vyZjIDcS.js";import{s as i,t as e,x as E,m as ue,e as r,h as p,n as he,E as ge,aq as g,ao as fe,l as G,ax as U,I as ee,aj as N,z as te,aP as me}from"./index-D6kQ69Bn.js";import{R as H}from"./resume-buy-Bf0zIH7y.js";import{u as be,p as we,R as ye,c as ke,i as Ce}from"./useCreditPacks-puL7tAtr.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";import"./mana-convert-cZR9DTGN.js";const S="https://cdn.decentraland.org/@dcl/shop/0.1.0-30535358248.commit-2722a7f/assets/pack-coins-BDh1ZDbh.webp",ie="https://cdn.decentraland.org/@dcl/shop/0.1.0-30535358248.commit-2722a7f/assets/pack-stacks-D-V2jSHW.webp",re="https://cdn.decentraland.org/@dcl/shop/0.1.0-30535358248.commit-2722a7f/assets/pack-chest-BX_j84xW.webp",je="https://cdn.decentraland.org/@dcl/shop/0.1.0-30535358248.commit-2722a7f/assets/credit-coin-CmcTCd5i.webp",$e="data:image/svg+xml,%3csvg%20width='60'%20height='60'%20viewBox='0%200%2060%2060'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='60'%20height='60'%20rx='30'%20fill='%2334CE77'/%3e%3cpath%20d='M21.6583%2046.1067L11.4656%2036.0591C10.1688%2034.829%2010.1905%2032.7207%2011.4769%2031.4622L13.6868%2029.3591C14.9732%2028.1006%2017.1615%2028.1058%2018.4582%2029.3359L23.8747%2034.6197L41.9704%2015.6527C43.2568%2014.3942%2045.4291%2014.2093%2046.7258%2015.4394L48.8765%2017.3628C50.1732%2018.5929%2050.3491%2020.6844%2049.0626%2021.9429L26.6112%2045.8766C25.1433%2047.342%2022.955%2047.3368%2021.6583%2046.1067Z'%20fill='%23FCFCFC'/%3e%3c/svg%3e",ve="https://cdn.decentraland.org/@dcl/shop/0.1.0-30535358248.commit-2722a7f/assets/packs-backdrop-BcXiUPeP.webp",K="linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)",Se=i.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: 24px;
|
|
@@ -120,7 +120,7 @@ import{b as pe,u as xe,r as l,j as t}from"./react-vyZjIDcS.js";import{s as i,t a
|
|
|
120
120
|
line-height: 1.6;
|
|
121
121
|
color: ${e.colors.media};
|
|
122
122
|
text-align: center;
|
|
123
|
-
`,
|
|
123
|
+
`,D=i.div`
|
|
124
124
|
display: grid;
|
|
125
125
|
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
126
126
|
gap: 24px;
|
|
@@ -162,9 +162,9 @@ import{b as pe,u as xe,r as l,j as t}from"./react-vyZjIDcS.js";import{s as i,t a
|
|
|
162
162
|
position: absolute;
|
|
163
163
|
border-radius: inherit;
|
|
164
164
|
pointer-events: none;
|
|
165
|
-
-webkit-mask: ${
|
|
165
|
+
-webkit-mask: ${K};
|
|
166
166
|
-webkit-mask-composite: xor;
|
|
167
|
-
mask: ${
|
|
167
|
+
mask: ${K};
|
|
168
168
|
mask-composite: exclude;
|
|
169
169
|
transition: opacity 0.15s ease;
|
|
170
170
|
}
|
|
@@ -350,12 +350,12 @@ import{b as pe,u as xe,r as l,j as t}from"./react-vyZjIDcS.js";import{s as i,t a
|
|
|
350
350
|
width: 60%;
|
|
351
351
|
height: 30px;
|
|
352
352
|
border-radius: ${e.radius.chip};
|
|
353
|
-
`,
|
|
353
|
+
`,Ke=i(B)`
|
|
354
354
|
width: 253.5px;
|
|
355
355
|
max-width: 100%;
|
|
356
356
|
aspect-ratio: 1;
|
|
357
357
|
border-radius: 16px;
|
|
358
|
-
`,
|
|
358
|
+
`,De=i(B)`
|
|
359
359
|
width: 100%;
|
|
360
360
|
height: 48px;
|
|
361
361
|
border-radius: ${e.radius.card};
|
|
@@ -380,7 +380,7 @@ import{b as pe,u as xe,r as l,j as t}from"./react-vyZjIDcS.js";import{s as i,t a
|
|
|
380
380
|
font-size: 16px;
|
|
381
381
|
line-height: 1.4;
|
|
382
382
|
color: rgba(255, 255, 255, 0.88);
|
|
383
|
-
`,
|
|
383
|
+
`,qe=E`
|
|
384
384
|
0%, 100% {
|
|
385
385
|
transform: scale(1);
|
|
386
386
|
opacity: 1;
|
|
@@ -389,7 +389,7 @@ import{b as pe,u as xe,r as l,j as t}from"./react-vyZjIDcS.js";import{s as i,t a
|
|
|
389
389
|
transform: scale(0.88);
|
|
390
390
|
opacity: 0.7;
|
|
391
391
|
}
|
|
392
|
-
`,
|
|
392
|
+
`,Xe=i.div`
|
|
393
393
|
display: flex;
|
|
394
394
|
flex-direction: column;
|
|
395
395
|
align-items: center;
|
|
@@ -400,7 +400,7 @@ import{b as pe,u as xe,r as l,j as t}from"./react-vyZjIDcS.js";import{s as i,t a
|
|
|
400
400
|
`,ne=i.img`
|
|
401
401
|
width: 61px;
|
|
402
402
|
height: 61px;
|
|
403
|
-
animation: ${
|
|
403
|
+
animation: ${qe} 1.2s ease-in-out infinite;
|
|
404
404
|
|
|
405
405
|
@media (prefers-reduced-motion: reduce) {
|
|
406
406
|
animation: none;
|
|
@@ -604,7 +604,7 @@ import{b as pe,u as xe,r as l,j as t}from"./react-vyZjIDcS.js";import{s as i,t a
|
|
|
604
604
|
outline: 2px solid ${e.colors.accent};
|
|
605
605
|
outline-offset: 2px;
|
|
606
606
|
}
|
|
607
|
-
`,
|
|
607
|
+
`,q=i.div`
|
|
608
608
|
display: flex;
|
|
609
609
|
flex-direction: column;
|
|
610
610
|
align-items: center;
|
|
@@ -613,7 +613,7 @@ import{b as pe,u as xe,r as l,j as t}from"./react-vyZjIDcS.js";import{s as i,t a
|
|
|
613
613
|
margin: 0 auto;
|
|
614
614
|
padding: 48px 24px;
|
|
615
615
|
text-align: center;
|
|
616
|
-
`,
|
|
616
|
+
`,X=i.p`
|
|
617
617
|
margin: 0;
|
|
618
618
|
font-family: ${e.font.sans};
|
|
619
619
|
font-size: 20px;
|
|
@@ -631,4 +631,4 @@ import{b as pe,u as xe,r as l,j as t}from"./react-vyZjIDcS.js";import{s as i,t a
|
|
|
631
631
|
margin: 0;
|
|
632
632
|
font-family: ${e.font.sans};
|
|
633
633
|
color: ${e.colors.err};
|
|
634
|
-
`,C=Ce()?"mock":"stripe",Z=[S,S,ie,re],mt={pack_5:S,pack_10:S,pack_25:ie,pack_50:re};function se(a,s){return mt[a.id]??Z[s%Z.length]}function bt(a,s){return a.artUrl??se(a,s)}const wt="https://docs.decentraland.org";function J(a){const s=a;if((s==null?void 0:s.name)==="AbortError")return r("getCredits.errorCanceled");const f=((s==null?void 0:s.message)??"").toLowerCase();return f.includes("sign in")?r("getCredits.errorSignIn",{currency:p.name}):f.includes("timed out")?r("getCredits.errorTimeout",{currency:p.name}):r("getCredits.errorGeneric")}function
|
|
634
|
+
`,C=Ce()?"mock":"stripe",Z=[S,S,ie,re],mt={pack_5:S,pack_10:S,pack_25:ie,pack_50:re};function se(a,s){return mt[a.id]??Z[s%Z.length]}function bt(a,s){return a.artUrl??se(a,s)}const wt="https://docs.decentraland.org";function J(a){const s=a;if((s==null?void 0:s.name)==="AbortError")return r("getCredits.errorCanceled");const f=((s==null?void 0:s.message)??"").toLowerCase();return f.includes("sign in")?r("getCredits.errorSignIn",{currency:p.name}):f.includes("timed out")?r("getCredits.errorTimeout",{currency:p.name}):r("getCredits.errorGeneric")}function zt(){var I;ue({title:r("nav.getCredits",{currency:p.name}),noindex:!0});const a=pe(),{session:s,signIn:f}=he(),d=ge(),[m,j]=xe(),{packs:b,isLoading:oe}=be(),[u,x]=l.useState("select"),[c,T]=l.useState(null),[$,F]=l.useState(null),ae=($!=null?(I=b.find(n=>n.credits===$))==null?void 0:I.artUrl:void 0)??je,[de,y]=l.useState(null),[ce,P]=l.useState(!1),R=l.useRef(null);l.useEffect(()=>()=>{var n;return(n=R.current)==null?void 0:n.abort()},[]);const L=l.useCallback(()=>{j(n=>{const o=new URLSearchParams(n);return o.delete("order"),o.delete("canceled"),o},{replace:!0})},[j]),_=l.useCallback(async n=>{x("processing");const o=new AbortController;R.current=o;try{const h=await we(n,{signal:o.signal,address:s==null?void 0:s.address,identity:s==null?void 0:s.identity});if(h.status==="credited"){const w=h.creditsGranted??(c==null?void 0:c.credits)??0;F(w>0?w:null),x("success"),g("Shop Completed Buy Credits",{order_id:n,pack_usd:(c==null?void 0:c.usd)??null,credits:w>0?w:null,provider:C}),d.invalidateQueries({queryKey:["usd-balance"]});try{if(sessionStorage.getItem(ye)){const v={resumeCheckout:!0,...w>0?{creditsAdded:w}:{}};a("/cart",{state:v});return}}catch{}try{const v=sessionStorage.getItem(H);if(v){sessionStorage.removeItem(H);const W=JSON.parse(v),M=fe(W);if(M){a(M,{state:{item:W,resumeBuy:!0}});return}}}catch{}}else h.status==="pending"?(g("Shop Buy Credits Pending",{step:"grant",pack_usd:(c==null?void 0:c.usd)??null}),d.invalidateQueries({queryKey:["usd-balance"]}),x("pending")):(g("Shop Buy Credits Failed",{step:"grant",error_code:"grant_failed",pack_usd:(c==null?void 0:c.usd)??null}),y(h.error??r("getCredits.errorGrant",{currency:p.name})),x("error"))}catch(h){G(h,{flow:"get_credits",step:"grant",order_id:n}),g("Shop Buy Credits Failed",{step:"grant",error_code:U(h),pack_usd:(c==null?void 0:c.usd)??null}),y(J(h)),x("error")}},[c,s,d,a]),le=l.useCallback(async n=>{if(!s){f();return}y(null),P(!1),T(n),x(C==="mock"?"processing":"redirecting"),g("Shop Started Buy Credits",{pack_usd:n.usd,credits:n.credits,provider:C});try{const o=await ke(n.id,{address:s.address,identity:s.identity});if(o.mock)_(o.orderId);else if(o.url)g("Shop Redirected To Stripe",{order_id:o.orderId,pack_usd:n.usd,credits:n.credits}),window.location.href=o.url;else throw new Error("Checkout did not return a redirect url")}catch(o){G(o,{flow:"get_credits",step:"checkout",provider:C}),g("Shop Buy Credits Failed",{step:"checkout",error_code:U(o),pack_usd:n.usd}),y(J(o)),x("error")}},[s,f,_]),z=l.useRef(!1);l.useEffect(()=>{if(z.current)return;const n=m.get("order");if(m.get("canceled")!=null){z.current=!0,g("Shop Buy Credits Cancelled",{order_id:n,provider:C}),L(),P(!0),x("select");return}n&&(x("processing"),s&&(z.current=!0,L(),_(n)))},[m,s]);function A(){var n;(n=R.current)==null||n.abort(),x("select"),T(null),F(null),y(null),P(!1)}return t.jsxs(Se,{children:[(u==="select"||u==="redirecting")&&t.jsxs(Pe,{"data-testid":"credits-hero",children:[t.jsx(Re,{"aria-hidden":!0}),t.jsxs(_e,{$hidden:u==="redirecting",children:[t.jsxs(ze,{children:[t.jsx(Ae,{children:r("getCredits.title",{currency:p.name})}),t.jsxs(Ee,{children:[t.jsx(Be,{children:r("getCredits.subtitle",{currency:p.nameSingular})}),t.jsxs(Te,{href:wt,target:"_blank",rel:"noreferrer",children:[r("getCredits.learnMore"),t.jsx(ee,{name:"link-out"})]})]})]}),ce&&t.jsx(Fe,{role:"status",children:r("getCredits.canceledNote")}),t.jsx(yt,{packs:b,loading:oe,onSelect:n=>void le(n)})]}),u==="redirecting"&&t.jsxs(Ye,{role:"status","aria-live":"polite",children:[t.jsx(Qe,{src:N,alt:"",width:72,height:72}),t.jsx(Ve,{children:r("getCredits.redirecting")})]})]}),u==="processing"&&t.jsxs(Xe,{role:"status","aria-live":"polite",children:[t.jsx(ne,{src:N,alt:"",width:61,height:61}),t.jsxs(Ze,{children:[t.jsxs(Je,{children:[t.jsx("strong",{children:r("getCredits.processing")}),"…"]}),t.jsxs(et,{"aria-hidden":!0,children:[t.jsx(it,{children:t.jsx(rt,{})}),t.jsx(nt,{children:"1/1"})]})]})]}),u==="success"&&t.jsxs(st,{role:"status","aria-live":"polite",children:[t.jsxs(ot,{children:[t.jsx(at,{src:$e,alt:"",width:60,height:60}),t.jsxs(dt,{children:[t.jsx("strong",{children:r("getCredits.successTitle")})," ",r("getCredits.successBody",{currency:p.name})]})]}),$!=null&&t.jsx(ct,{children:t.jsxs(lt,{children:[t.jsx(pt,{src:ae,alt:"",width:93,height:93}),t.jsxs(xt,{children:[t.jsx(te,{}),t.jsxs("span",{children:[t.jsx(ut,{children:r("getCredits.creditsAmount",{credits:$,currency:p.name})})," ",t.jsx(ht,{children:r("getCredits.creditsAdded")})]})]})]})}),t.jsxs(gt,{children:[t.jsx(k,{"data-variant":"outline",onClick:A,children:r("getCredits.buyMore",{currency:p.name})}),t.jsx(k,{onClick:()=>a("/assets"),children:r("getCredits.startShopping")})]})]}),u==="pending"&&t.jsxs(q,{role:"status","aria-live":"polite",children:[t.jsx(X,{children:r("getCredits.pendingTitle",{currency:p.name})}),t.jsx(Oe,{children:r("getCredits.pendingBody")}),t.jsxs(Q,{children:[t.jsx(k,{onClick:()=>a("/assets"),children:r("getCredits.startShopping")}),t.jsx(k,{"data-variant":"outline",onClick:A,children:r("getCredits.done")})]})]}),u==="error"&&t.jsxs(q,{role:"alert",children:[t.jsx(X,{"data-tone":"error",children:r("getCredits.errorTitle")}),t.jsx(ft,{children:de}),t.jsx(Q,{children:t.jsx(k,{onClick:A,children:r("getCredits.tryAgain")})})]})]})}function yt({packs:a,loading:s,onSelect:f}){return s?t.jsx(D,{"aria-busy":"true","aria-label":r("getCredits.packsLoading",{currency:p.name}),children:[0,1,2,3].map(d=>t.jsxs(O,{as:"div","data-skeleton":"true","data-testid":"pack-skeleton","aria-hidden":!0,children:[t.jsxs(Y,{children:[t.jsx(V,{children:t.jsx(He,{})}),t.jsx(Ke,{})]}),t.jsx(De,{})]},d))}):t.jsx(D,{children:a.map((d,m)=>t.jsxs(O,{type:"button","data-testid":"pack","data-best":d.bestValue?"true":void 0,onClick:()=>f(d),"aria-label":r("getCredits.packAria",{amount:me(d.credits),usd:d.usd}),children:[d.bestValue&&t.jsxs(Le,{children:[t.jsx(ee,{name:"star-rounded"}),r("getCredits.packBadge")]}),t.jsxs(Y,{children:[t.jsxs(V,{children:[t.jsxs(Ie,{children:[t.jsx(te,{}),t.jsx(We,{children:d.credits})]}),t.jsx(Me,{children:r("getCredits.packUnit",{currency:p.name})})]}),t.jsx(Ge,{children:t.jsx("img",{src:bt(d,m),alt:"",loading:"lazy",width:507,height:507,onError:j=>{const b=j.currentTarget;b.dataset.artFallback||(b.dataset.artFallback="done",b.src=se(d,m))}})})]}),t.jsxs(Ue,{children:["$",d.usd.toFixed(2)]})]},d.id))})}export{zt as GetCredits,zt as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as f,b as h}from"./lit-element-B3y9oplH.js";import{n as m}from"./class-map-CxwNmq0D.js";import{c as p}from"./index-
|
|
1
|
+
import{i as f,b as h}from"./lit-element-B3y9oplH.js";import{n as m}from"./class-map-CxwNmq0D.js";import{c as p}from"./index-BIl576Hj.js";import{d as g,r as v}from"./index-Du25SJyr.js";import{C as c}from"./ConstantsUtil-Dfwpy1eP.js";import{R as $,O as u}from"./W3MFrameProviderSingleton-DAYqclPH.js";import{au as y}from"./NetworkUtil-HlUKXKcF.js";const b=g`
|
|
2
2
|
:host {
|
|
3
3
|
display: flex;
|
|
4
4
|
justify-content: center;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,b as ee,r as h,L as te}from"./react-vyZjIDcS.js";import{t as S,s as t,
|
|
1
|
+
import{j as e,b as ee,r as h,L as te}from"./react-vyZjIDcS.js";import{t as S,s as t,x as ie,y as se,e as i,h as R,B as I,z,aq as ne,aO as K,l as W,m as re,n as oe,E as ae,u as de,F as ce}from"./index-D6kQ69Bn.js";import{i as le,R as pe,f as ge}from"./import-BBD0DWIT.js";import{u as xe}from"./useSecondarySales-W8e5_GEF.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";import"./buy-Ccaxv3lt.js";import"./authorizations-BVmXaQeu.js";import"./sendMetaTransaction-CdI6QA-v.js";import"./trade-encoding-CJDVWYcF.js";import"./mana-rate-cSpFrGml.js";import"./mana-convert-cZR9DTGN.js";function U({size:o=12,...w}){return e.jsx("svg",{viewBox:"0 0 20 20",width:o,height:o,fill:"none","aria-hidden":!0,focusable:"false",...w,children:e.jsx("path",{d:"M5 10.5l3 3 7-7.5",stroke:"#fff",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})}const{colors:M,radius:me,z:ue}=S,he=ie`
|
|
2
2
|
0% {
|
|
3
3
|
transform: scale(0);
|
|
4
4
|
opacity: 0;
|
|
@@ -124,7 +124,7 @@ import{j as e,b as ee,r as h,L as te}from"./react-vyZjIDcS.js";import{t as S,s a
|
|
|
124
124
|
&[data-status='failed'] {
|
|
125
125
|
opacity: 0.6;
|
|
126
126
|
}
|
|
127
|
-
`,
|
|
127
|
+
`,Ie=t.span`
|
|
128
128
|
width: 34px;
|
|
129
129
|
height: 34px;
|
|
130
130
|
border-radius: ${we.btn};
|
|
@@ -138,7 +138,7 @@ import{j as e,b as ee,r as h,L as te}from"./react-vyZjIDcS.js";import{t as S,s a
|
|
|
138
138
|
height: 100%;
|
|
139
139
|
object-fit: contain;
|
|
140
140
|
}
|
|
141
|
-
`,
|
|
141
|
+
`,Le=t.span`
|
|
142
142
|
font-weight: 600;
|
|
143
143
|
font-size: 14px;
|
|
144
144
|
white-space: nowrap;
|
|
@@ -179,7 +179,7 @@ import{j as e,b as ee,r as h,L as te}from"./react-vyZjIDcS.js";import{t as S,s a
|
|
|
179
179
|
font-size: 12px;
|
|
180
180
|
`,Ne=t.p`
|
|
181
181
|
margin: 12px 0 0;
|
|
182
|
-
`;function Be({queue:o,session:w,onClose:j,onDone:m}){const v=ee(),p=se(w.providerType),[g,b]=h.useState(()=>o.map(()=>"pending")),[A,Q]=h.useState("running"),k=h.useRef(!1);h.useEffect(()=>{if(k.current)return;k.current=!0;let n=!1;return(async()=>{for(let a=0;a<o.length;a++){if(n)return;b(x=>x.map((u,f)=>f===a?"active":u));try{await le(o[a].item,o[a].priceCredits,w),ne("Shop Migrated Listing",{item_id:o[a].item.itemId??o[a].item.oldTradeId??null,contract_address:o[a].item.contractAddress,new_price_credits:o[a].priceCredits,new_price_usd:K(o[a].priceCredits)}),n||b(x=>x.map((u,f)=>f===a?"done":u))}catch(x){if(x instanceof pe)W(x,{flow:"import_listing",step:"relist",itemId:o[a].item.itemId??o[a].item.oldTradeId}),n||b(u=>u.map((f,C)=>C===a?"unlisted":f));else{const u=x,f=u.code===4001||/reject|denied|cancel/i.test(u.message??"");f||W(x,{flow:"import_listing",itemId:o[a].item.itemId??o[a].item.oldTradeId}),n||b(C=>C.map((B,
|
|
182
|
+
`;function Be({queue:o,session:w,onClose:j,onDone:m}){const v=ee(),p=se(w.providerType),[g,b]=h.useState(()=>o.map(()=>"pending")),[A,Q]=h.useState("running"),k=h.useRef(!1);h.useEffect(()=>{if(k.current)return;k.current=!0;let n=!1;return(async()=>{for(let a=0;a<o.length;a++){if(n)return;b(x=>x.map((u,f)=>f===a?"active":u));try{await le(o[a].item,o[a].priceCredits,w),ne("Shop Migrated Listing",{item_id:o[a].item.itemId??o[a].item.oldTradeId??null,contract_address:o[a].item.contractAddress,new_price_credits:o[a].priceCredits,new_price_usd:K(o[a].priceCredits)}),n||b(x=>x.map((u,f)=>f===a?"done":u))}catch(x){if(x instanceof pe)W(x,{flow:"import_listing",step:"relist",itemId:o[a].item.itemId??o[a].item.oldTradeId}),n||b(u=>u.map((f,C)=>C===a?"unlisted":f));else{const u=x,f=u.code===4001||/reject|denied|cancel/i.test(u.message??"");f||W(x,{flow:"import_listing",itemId:o[a].item.itemId??o[a].item.oldTradeId}),n||b(C=>C.map((B,F)=>F===a?f?"skipped":"failed":B))}}}n||Q("finished")})(),()=>{n=!0}},[]);const $=g.filter(n=>n==="done").length,E=g.findIndex(n=>n==="active"),N=Math.round(g.filter(n=>n!=="pending"&&n!=="active").length/o.length*100);function L(){m(),j()}if(A==="finished"){const n=g.filter(a=>a==="skipped"||a==="failed").length,l=g.filter(a=>a==="unlisted").length;return e.jsx(H,{role:"presentation",children:e.jsxs(Z,{"data-success":!0,role:"dialog","aria-modal":"true",children:[e.jsx(be,{"aria-hidden":!0,children:e.jsx(U,{size:30})}),e.jsx(O,{children:$>0?i("migrate.successTitle"):i("migrate.nothingTitle")}),e.jsxs("p",{className:"muted",style:{margin:0},children:[$>0?i("migrate.listedSummary",{count:$,currency:R.name}):i("migrate.noneListed"),n>0?" "+i("migrate.skippedSummary",{count:n}):"",l>0?" "+i("migrate.unlistedSummary",{count:l}):""]}),e.jsxs(fe,{"data-actions":!0,children:[e.jsx(I,{variant:"ghost",onClick:L,children:i("getCredits.done")}),l>0?e.jsx(I,{variant:"purple",onClick:()=>{m(),j(),v("/my-assets")},children:i("migrate.goToMyAssets")}):$>0?e.jsx(I,{variant:"purple",onClick:()=>{m(),j(),v("/assets")},children:i("migrate.viewInShop")}):null]})]})})}return e.jsx(H,{role:"presentation",children:e.jsxs(je,{"data-testid":"modal",role:"dialog","aria-modal":"true","aria-live":"polite",children:[e.jsx(O,{children:i("migrate.listingTitle")}),e.jsxs("p",{className:"muted small",style:{margin:"0 0 4px"},children:[p?i("migrate.subConfirm"):i("migrate.subManaged")," ",E>=0?i("migrate.progressCount",{current:E+1,total:o.length}):""]}),e.jsx(ve,{children:e.jsx(ke,{style:{width:`${N}%`}})}),e.jsx($e,{children:o.map((n,l)=>e.jsxs(Se,{"data-status":g[l],children:[e.jsx(Ie,{children:n.item.thumbnail?e.jsx("img",{src:n.item.thumbnail,alt:""}):null}),e.jsx(Le,{title:n.item.name,children:n.item.name||i("migrate.itemFallback")}),e.jsxs(Ce,{children:[e.jsx(z,{className:"ccy-mark"})," ",n.priceCredits.toLocaleString()]}),e.jsx(Te,{children:g[l]==="active"?e.jsxs(e.Fragment,{children:[e.jsx(Me,{className:"spinner","aria-hidden":!0})," ",p?i("migrate.statusConfirm"):i("migrate.statusAdding")]}):g[l]==="done"?e.jsx(Ee,{children:e.jsx(U,{})}):g[l]==="skipped"?e.jsx(_,{children:i("migrate.statusSkipped")}):g[l]==="failed"?e.jsx(_,{children:i("migrate.statusFailed")}):g[l]==="unlisted"?e.jsx(_,{title:i("migrate.unlistedTooltip"),children:i("migrate.statusUnlisted")}):e.jsx(ze,{children:i("migrate.statusWaiting")})})]},n.item.oldTradeId))}),e.jsx(Ne,{className:"muted small",children:p?i("migrate.hintConfirm"):i("migrate.hintManaged")})]})})}const{colors:r,gradients:Re,radius:Ae}=S,D="@media (max-width: 620px)",G=t.div`
|
|
183
183
|
max-width: 520px;
|
|
184
184
|
margin: 0 auto;
|
|
185
185
|
text-align: center;
|
|
@@ -194,15 +194,15 @@ import{j as e,b as ee,r as h,L as te}from"./react-vyZjIDcS.js";import{t as S,s a
|
|
|
194
194
|
font-size: 26px;
|
|
195
195
|
font-weight: 800;
|
|
196
196
|
margin: 4px 0 0;
|
|
197
|
-
`,V=t(
|
|
197
|
+
`,V=t(I)`
|
|
198
198
|
margin-top: 10px;
|
|
199
199
|
`,Qe=t.div`
|
|
200
200
|
max-width: 860px;
|
|
201
201
|
margin: 0 auto;
|
|
202
202
|
padding-bottom: 120px;
|
|
203
|
-
`,
|
|
203
|
+
`,Fe=t.header`
|
|
204
204
|
margin-bottom: 18px;
|
|
205
|
-
`,
|
|
205
|
+
`,Pe=t.span`
|
|
206
206
|
display: inline-block;
|
|
207
207
|
font-size: 12px;
|
|
208
208
|
font-weight: 700;
|
|
@@ -410,7 +410,7 @@ import{j as e,b as ee,r as h,L as te}from"./react-vyZjIDcS.js";import{t as S,s a
|
|
|
410
410
|
grid-column: 2 / 4;
|
|
411
411
|
justify-content: flex-start;
|
|
412
412
|
}
|
|
413
|
-
`,at=t(
|
|
413
|
+
`,at=t(I)`
|
|
414
414
|
&& {
|
|
415
415
|
background: ${r.media};
|
|
416
416
|
color: ${r.text2};
|
|
@@ -442,6 +442,6 @@ import{j as e,b as ee,r as h,L as te}from"./react-vyZjIDcS.js";import{t as S,s a
|
|
|
442
442
|
color: ${r.muted};
|
|
443
443
|
`,gt=t.span`
|
|
444
444
|
flex: 1 1 auto;
|
|
445
|
-
`,xt=t(
|
|
445
|
+
`,xt=t(I)`
|
|
446
446
|
padding: 13px 24px;
|
|
447
|
-
`,mt=[{key:"creations",title:"importListings.creations.title",sub:"importListings.creations.sub"},{key:"owned",title:"importListings.owned.title",sub:"importListings.owned.sub",secondary:!0}];function Tt(){re({title:i("seo.import.title"),noindex:!0});const{session:o,signIn:w,restore:j}=oe(),m=ae(),v=o==null?void 0:o.address;h.useEffect(()=>{j()},[j]);const{data:p,isLoading:g}=de({queryKey:["importable",v],queryFn:()=>ge(v),enabled:!!v}),b=xe(),A=h.useMemo(()=>mt.filter(d=>!d.secondary||b),[b]),[Q,k]=h.useState({}),[$,E]=h.useState(new Set),[N,
|
|
447
|
+
`,mt=[{key:"creations",title:"importListings.creations.title",sub:"importListings.creations.sub"},{key:"owned",title:"importListings.owned.title",sub:"importListings.owned.sub",secondary:!0}];function Tt(){re({title:i("seo.import.title"),noindex:!0});const{session:o,signIn:w,restore:j}=oe(),m=ae(),v=o==null?void 0:o.address;h.useEffect(()=>{j()},[j]);const{data:p,isLoading:g}=de({queryKey:["importable",v],queryFn:()=>ge(v),enabled:!!v}),b=xe(),A=h.useMemo(()=>mt.filter(d=>!d.secondary||b),[b]),[Q,k]=h.useState({}),[$,E]=h.useState(new Set),[N,L]=h.useState(null),n=h.useMemo(()=>[...(p==null?void 0:p.creations)??[],...b?(p==null?void 0:p.owned)??[]:[]],[p,b]);h.useEffect(()=>{n.length&&k(d=>{const c={...d};for(const s of n)c[s.oldTradeId]==null&&(c[s.oldTradeId]=s.suggestedCredits);return c})},[n]);const l=d=>!$.has(d),a=d=>Q[d.oldTradeId]??d.suggestedCredits,x=n.filter(d=>l(d.oldTradeId)),u=x.reduce((d,c)=>d+a(c),0);function f(d,c){const s=c.replace(/[^\d]/g,"");k(T=>({...T,[d]:s===""?0:parseInt(s,10)}))}function C(d){E(c=>{const s=new Set(c);return s.has(d)?s.delete(d):s.add(d),s})}function B(d){return d.map(c=>({item:c,priceCredits:Math.max(1,a(c))}))}function F(){m.invalidateQueries({queryKey:["importable"]}),m.invalidateQueries({queryKey:["shop-items"]}),m.invalidateQueries({queryKey:["catalog-items"]}),m.invalidateQueries({queryKey:["overview-listings"]}),m.invalidateQueries({queryKey:["upsell-listings"]}),m.invalidateQueries({queryKey:["my-assets"]}),m.invalidateQueries({queryKey:["collection-sale-state"]}),ce.success(i("importListings.toastUpdated"))}return o?!g&&n.length===0?e.jsxs(G,{children:[e.jsx(Y,{"aria-hidden":!0,children:"✨"}),e.jsx(J,{children:i("importListings.emptyTitle")}),e.jsx("p",{className:"muted",children:i("importListings.emptyBody")}),e.jsx(V,{as:te,to:"/my-assets",variant:"purple",children:i("importListings.goToMyAssets")})]}):e.jsxs(Qe,{children:[e.jsxs(Fe,{children:[e.jsx(Pe,{children:i("importListings.eyebrow")}),e.jsxs(_e,{children:[i("importListings.titleLead")," ",e.jsx(Ke,{children:i("importListings.titleAccent")})]}),e.jsx(De,{children:i("importListings.lede",{currency:R.name})})]}),e.jsxs(We,{children:[e.jsx(z,{className:"ccy-mark",color:S.colors.text})," ",i("importListings.rate",{currency:R.nameSingular})]}),g?e.jsx(X,{children:Array.from({length:4}).map((d,c)=>e.jsx(Je,{},c))}):A.map(d=>{const c=(p==null?void 0:p[d.key])??[];return c.length===0?null:e.jsxs(Ue,{children:[e.jsxs(He,{children:[e.jsx(Oe,{children:i(d.title)}),e.jsx(Ge,{children:i(d.sub)})]}),e.jsx(X,{children:c.map(s=>{const T=a(s),q=T!==s.suggestedCredits;return e.jsxs(Ye,{"data-off":l(s.oldTradeId)?void 0:!0,children:[e.jsx(Ve,{type:"checkbox",checked:l(s.oldTradeId),onChange:()=>C(s.oldTradeId),"aria-label":i("importListings.includeItem",{name:s.name})}),e.jsx(Xe,{children:s.thumbnail?e.jsx("img",{src:s.thumbnail,alt:""}):null}),e.jsxs(Ze,{children:[e.jsx(qe,{title:s.name,children:s.name||i("importListings.itemFallback")}),e.jsx(et,{children:s.rarity})]}),e.jsxs(tt,{children:[e.jsxs(it,{children:[e.jsx(z,{size:15,color:S.colors.text}),e.jsx(st,{"data-testid":"imp-price-input",inputMode:"numeric",value:T.toLocaleString(),onChange:P=>f(s.oldTradeId,P.target.value),"aria-label":i("importListings.priceAria",{currency:R.name,name:s.name})})]}),e.jsxs(nt,{children:[e.jsxs("span",{children:["$",K(T).toFixed(2)]}),q?e.jsxs(rt,{onClick:()=>k(P=>({...P,[s.oldTradeId]:s.suggestedCredits})),children:[i("importListings.resetTo")," ",e.jsx(z,{className:"ccy-mark"}),s.suggestedCredits.toLocaleString()]}):null]})]}),e.jsx(ot,{children:e.jsx(at,{size:"sm",disabled:!l(s.oldTradeId),onClick:()=>L(B([s])),children:i("importListings.list")})})]},s.oldTradeId)})})]},d.key)}),e.jsx(dt,{children:e.jsxs(ct,{children:[e.jsxs("div",{children:[e.jsxs(lt,{children:[e.jsx(z,{className:"ccy-mark",color:S.colors.text})," ",u.toLocaleString()]}),e.jsx(pt,{children:i("importListings.selectedSummary",{count:x.length,usd:K(u).toFixed(2)})})]}),e.jsx(gt,{}),e.jsx(xt,{variant:"purple",disabled:x.length===0,onClick:()=>L(B(x)),children:i("importListings.listAll",{count:x.length})})]})}),N&&o?e.jsx(Be,{queue:N,session:o,onClose:()=>L(null),onDone:F}):null]}):e.jsxs(G,{children:[e.jsx(Y,{"aria-hidden":!0,children:"📦"}),e.jsx(J,{children:i("importListings.signInTitle")}),e.jsx("p",{className:"muted",children:i("importListings.signInBody")}),e.jsx(V,{variant:"purple",onClick:()=>w(),children:i("storeSettings.signIn")})]})}export{Tt as ImportListings};
|