@dcl/shop 0.4.0 → 0.4.1-30932341848.commit-2643c3e
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-CSDWiFkq.js → Activity-BkSkVMgx.js} +1 -1
- package/_assets/{AnimatedBackground-vKrEOHA5.js → AnimatedBackground-BTZET6f2.js} +1 -1
- package/_assets/{Assets-Cogahyqe.js → Assets-D1i5mRl6.js} +7 -7
- package/_assets/{Assets.styles-B2EWL6JB.js → Assets.styles-Bi4xjNky.js} +1 -1
- package/_assets/{Authorizations-BrKYlkZG.js → Authorizations-IONuoFEE.js} +1 -1
- package/_assets/Cart-CC6i3iiK.js +695 -0
- package/_assets/{CircularProgress--GC-6I6k.js → CircularProgress-TASjBonD.js} +1 -1
- package/_assets/{Collection-D16pjJSe.js → Collection-CG2b4Gx7.js} +1 -1
- package/_assets/{CollectionCarousel-BeuBL17J.js → CollectionCarousel-DclZ0mlb.js} +1 -1
- package/_assets/{Creator-BLsHzXRL.js → Creator-8Mfi_dnj.js} +1 -1
- package/_assets/{ErrorNotice-Cvc0nTjw.js → ErrorNotice-Dp7YPtfk.js} +1 -1
- package/_assets/{ExchangeController-DoFEzXko.js → ExchangeController-D0Rulps3.js} +1 -1
- package/_assets/{GetCredits-bxJh6m8F.js → GetCredits-D3f6eK7Z.js} +1 -1
- package/_assets/{HelpersUtil-BFgierZ-.js → HelpersUtil-CHZxw6Oq.js} +1 -1
- package/_assets/{ImportListings-BwORJ3CC.js → ImportListings-CrYfE8u0.js} +28 -17
- package/_assets/{ItemDetail-PoeIzOPp.js → ItemDetail-Dh08n_fl.js} +11 -11
- package/_assets/{ItemPreview.styles-DtAUND9N.js → ItemPreview.styles-wYbd945M.js} +1 -1
- package/_assets/{LoadMore-DsWSQHxD.js → LoadMore-BNIL9tET.js} +2 -2
- package/_assets/{ManaPricingBanner.styles-CF0iOeeS.js → ManaPricingBanner.styles-aqXUo-bI.js} +1 -1
- package/_assets/{MenuList-DNOqfxHx.js → MenuList-Cuj0vFC5.js} +1 -1
- package/_assets/{MyAssets-2XwaE-SE.js → MyAssets-D5p4sDDv.js} +2 -2
- package/_assets/{MyFavorites-DIi3ztNe.js → MyFavorites-Gk_fH6sw.js} +2 -2
- package/_assets/{NotFound-jHtQUp44.js → NotFound-DwGJKrjH.js} +4 -4
- package/_assets/{NotificationsBell-By0uu4SI.js → NotificationsBell-B0X96P7p.js} +1 -1
- package/_assets/{OutfitDetail-BQr6vhnT.js → OutfitDetail-Dd5OejtY.js} +1 -1
- package/_assets/{OutfitPreview-D6Z7-XEK.js → OutfitPreview-x404cIYl.js} +2 -2
- package/_assets/{OutfitStudio-BFWU775v.js → OutfitStudio-DF_iLA7k.js} +1 -1
- package/_assets/{StoreSettings-BJTpsKoX.js → StoreSettings-CXY0qyzv.js} +1 -1
- package/_assets/{Success-CIQKaiOo.js → Success-DNkWodW6.js} +5 -5
- package/_assets/{SwapController-XcLKHFDT.js → SwapController-Rg3Irf1I.js} +1 -1
- package/_assets/{Tooltip-fS4VCxQs.js → Tooltip-BO9fgnbG.js} +1 -1
- package/_assets/{TradeService-BgfeT0JQ.js → TradeService-DIzj7uCq.js} +1 -1
- package/_assets/{W3MFrameProviderSingleton-BJE-tnmd.js → W3MFrameProviderSingleton-CVfGARdD.js} +3 -3
- package/_assets/{WebCryptoP256-P_MkVOZf.js → WebCryptoP256-0eyBpluy.js} +1 -1
- package/_assets/{authorizations-Bm65kFBw.js → authorizations-C1AfJLRY.js} +1 -1
- package/_assets/{basic-BzdDurZu.js → basic-rL97KQul.js} +1 -1
- package/_assets/{biconomy-BHLIxKXm.js → biconomy-DkmjzVV4.js} +1 -1
- package/_assets/{browseLayout.styles-D_JQHeMK.js → browseLayout.styles-DzWXZTdR.js} +1 -1
- package/_assets/{builder-CPpn-LV6.js → builder-jhZkD6bW.js} +1 -1
- package/_assets/buy-CXpnZ35Y.js +1 -0
- package/_assets/buy-gasless-BziA3gtB.js +1 -0
- package/_assets/{categories-D2JgaepG.js → categories-DraU6LZY.js} +1 -1
- package/_assets/{ccip-japHsC-d.js → ccip-B6_1GTZr.js} +1 -1
- package/_assets/{ccip-BGuL2CTW.js → ccip-BJCCRkIr.js} +1 -1
- package/_assets/{clsx-DY37pDvc.js → clsx-bcb20HaA.js} +1 -1
- package/_assets/{controller-CEuTNpMI.js → controller-CqltqUJK.js} +2 -2
- package/_assets/{core-DFTtNj6Y.js → core-DFgcDI0R.js} +4 -4
- package/_assets/{createSvgIcon-BFo-10ds.js → createSvgIcon-DKhyR4iX.js} +1 -1
- package/_assets/{custom-DyS8vC8K.js → custom-C1vnmcgY.js} +1 -1
- package/_assets/{data-capture-CpqP5gpO.js → data-capture-D_wAwrCz.js} +1 -1
- package/_assets/{email-DOkwtMrW.js → email-CDpqkxI2.js} +1 -1
- package/_assets/{embedded-wallet-BI0I-FyI.js → embedded-wallet-CCymge2a.js} +1 -1
- package/_assets/{emotion-styled.browser.esm-nmKSs9QV.js → emotion-styled.browser.esm-79WZWEvr.js} +1 -1
- package/_assets/{engine-BsCDGGhp.js → engine-K79-3wUG.js} +1 -1
- package/_assets/{errors-CVWX9epA.js → errors-4DfPe5KG.js} +1 -1
- package/_assets/{estimate-l1-fee-BwVQYvPZ.js → estimate-l1-fee-e9M5mnGL.js} +1 -1
- package/_assets/{execute-DCjeHtk2.js → execute-BAoe28Qg.js} +2 -2
- package/_assets/{features-DmQF08Nd.js → features-Bs2FlBtm.js} +1 -1
- package/_assets/{fetchTokenMetadata-DtvlyEpN.js → fetchTokenMetadata-pClntfRM.js} +2 -2
- package/_assets/{field.styles-ZqzDOrCY.js → field.styles-BlCMUm6N.js} +1 -1
- package/_assets/{get-ecosystem-wallet-info-glXHSBBX.js → get-ecosystem-wallet-info-yxRtiVgT.js} +1 -1
- package/_assets/{getBalance-D4uOuyXp.js → getBalance-CcbCVOsb.js} +1 -1
- package/_assets/{getNFT-VYQvQv4K.js → getNFT-BHZbxxfy.js} +1 -1
- package/_assets/{getNFT-D9u1poHS.js → getNFT-Cs3xtqCU.js} +1 -1
- package/_assets/{getThemeProps-BOJ8W9dy.js → getThemeProps-BLLnclJV.js} +1 -1
- package/_assets/{grid.styles-C92STzz7.js → grid.styles-ULDFkMa6.js} +1 -1
- package/_assets/{hashTypedData-CU4XEihs.js → hashTypedData-CO0tgaiF.js} +1 -1
- package/_assets/{hashTypedData-Cmk_4l7W.js → hashTypedData-DpNd075i.js} +1 -1
- package/_assets/{in-app-n2C_GYjN.js → in-app-DRgzQ5z0.js} +1 -1
- package/_assets/{in-app-wallet-calls-BH4EHvoE.js → in-app-wallet-calls-DkrL1cCt.js} +1 -1
- package/_assets/{index-BAGHoKjd.js → index-38gtJ95w.js} +1 -1
- package/_assets/{index-B0wrSWVL.js → index-9wwl-XRz.js} +83 -74
- package/_assets/{index-C1Zza7kR.js → index-APj4WzhC.js} +3 -3
- package/_assets/{index-DuYquyJk.js → index-B4CSRI8M.js} +1 -1
- package/_assets/{index-Dyb9tM0L.js → index-BD5xbVRd.js} +1 -1
- package/_assets/{index-1DlQc04C.js → index-BH_V6MtA.js} +1 -1
- package/_assets/{index-S5ytn1G_.js → index-BaScAbc6.js} +1 -1
- package/_assets/{index-X1g5-mc1.js → index-BayCkUJb.js} +2 -2
- package/_assets/{index-Drzr7GIe.js → index-BmqSpa_-.js} +1 -1
- package/_assets/{index-DUOePrjP.js → index-BtcGKkld.js} +1 -1
- package/_assets/{index-B33pX4sx.js → index-C1IdaBWg.js} +1 -1
- package/_assets/{index-1E3TZOEp.js → index-C2kzA4mV.js} +3 -3
- package/_assets/{index-DCJFwzag.js → index-C7PcZNVu.js} +1 -1
- package/_assets/{index-DU7iVDBh.js → index-C7pWVQTv.js} +3 -3
- package/_assets/{index-9ZSFZyk5.js → index-CD-1zUsA.js} +1 -1
- package/_assets/{index-CDzrsoju.js → index-CDoPxnOt.js} +1 -1
- package/_assets/{index-Das01MWO.js → index-CLwlwAIK.js} +2 -2
- package/_assets/{index-CS26D5br.js → index-CPXhIJG_.js} +1 -1
- package/_assets/{index-CNek90qs.js → index-CQDwyW0y.js} +1 -1
- package/_assets/{index-DgIUvj1u.js → index-CZ6qluuL.js} +1 -1
- package/_assets/{index-DO-41U6s.js → index-CZAkoXAT.js} +1 -1
- package/_assets/{index-5oJAYQpS.js → index-ChXTmBUQ.js} +1 -1
- package/_assets/{index-C75VmoUV.js → index-CuyybehC.js} +1 -1
- package/_assets/{index-B-0owZIE.js → index-Cw9Buaqy.js} +1 -1
- package/_assets/{index-Bdk6ierZ.js → index-Cy78NsWj.js} +1 -1
- package/_assets/{index-BKB9eVo_.js → index-DA9YlTs2.js} +1 -1
- package/_assets/{index-DWyeO73d.js → index-DVhYSN4n.js} +1 -1
- package/_assets/{index-CFJ4759x.js → index-DWDCHhqm.js} +1 -1
- package/_assets/{index-B-2A_xJK.js → index-DZWN2B23.js} +1 -1
- package/_assets/{index-B95j5ECm.js → index-DZ_CpgRO.js} +1 -1
- package/_assets/{index-gO1p5U4e.js → index-DZv1yX3H.js} +1 -1
- package/_assets/{index-YlEZ0MB-.js → index-D__XyT6J.js} +1 -1
- package/_assets/{index-BvzZi8lQ.js → index-DeeVEpUN.js} +1 -1
- package/_assets/{index-BBLwTza9.js → index-DtTxgVE8.js} +1 -1
- package/_assets/{index-8ahFN9pV.js → index-DxvEkyFh.js} +1 -1
- package/_assets/{index-5ZQ75r5A.js → index-F7iGy4N6.js} +2 -2
- package/_assets/{index-CMiDANew.js → index-HzKciouT.js} +1 -1
- package/_assets/{index-BmtMJnoP.js → index-IL8sDetE.js} +1 -1
- package/_assets/{index-Bnnl1_Pn.js → index-QYzzmkrp.js} +1 -1
- package/_assets/{index-iVhRHvGC.js → index-UVKX7gHV.js} +1 -1
- package/_assets/{index-x_f1XpFN.js → index-UkpFRfQ7.js} +1 -1
- package/_assets/{index-DCkPd79h.js → index-UnW-qttV.js} +1 -1
- package/_assets/{index-lc1BgLRJ.js → index-XKNU4pMQ.js} +1 -1
- package/_assets/{index-DcW0aOo_.js → index-iNQ1gNi_.js} +1 -1
- package/_assets/{index-3G1ZZRHy.js → index-mYETjRZ2.js} +1 -1
- package/_assets/{index-CCQWBULG.js → index-ndvGyFuK.js} +1 -1
- package/_assets/{index-B6HLteu2.js → index-pmYgNf4o.js} +1 -1
- package/_assets/{index-BpfebiBi.js → index-s0P5AR2z.js} +1 -1
- package/_assets/{index-Dg3cba8i.js → index-u80x1-iQ.js} +1 -1
- package/_assets/{index-BAKuuHpY.js → index-wnXGZDFx.js} +1 -1
- package/_assets/{index-BFbvmloZ.js → index-xSU_1Q0H.js} +1 -1
- package/_assets/{index.es-DlCKcYQh.js → index.es-Bfm7fmDv.js} +1 -1
- package/_assets/{index.es-CYrm9JiK.js → index.es-CSDWEQ3N.js} +4 -4
- package/_assets/{index.es-D-Hj-yaE.js → index.es-DJMgYiau.js} +1 -1
- package/_assets/{localBatchGatewayRequest-D-M3uJjn.js → localBatchGatewayRequest-DCo_Witg.js} +1 -1
- package/_assets/{mana-convert-XtWFaGCt.js → mana-convert-BVz9Ojfp.js} +1 -1
- package/_assets/{mana-rate-CLS7fjKR.js → mana-rate-CNR1wHIx.js} +1 -1
- package/_assets/{networks-DLkt_HOu.js → networks-BjEprBZY.js} +1 -1
- package/_assets/{onramp-B9C9zg8X.js → onramp-DA0IXhxL.js} +1 -1
- package/_assets/{openzeppelin-Czmq9Q8z.js → openzeppelin-CZE9q4eI.js} +1 -1
- package/_assets/{parseNft-Df0bG2_u.js → parseNft-B18S2NmF.js} +2 -2
- package/_assets/{parseSignature-nbJG9PDg.js → parseSignature-9n8B-B9F.js} +3 -3
- package/_assets/{parseSignature-Cu3sQgfL.js → parseSignature-Cff06c2o.js} +1 -1
- package/_assets/{passkeys-UkbavCkH.js → passkeys-CC8JVy-m.js} +1 -1
- package/_assets/{pay-with-exchange-BZkWaWxT.js → pay-with-exchange-D3NuRJmY.js} +1 -1
- package/_assets/{qr-overlay-BE8jnAiO.js → qr-overlay-DbTnL2jo.js} +1 -1
- package/_assets/{receive-B2e1QRi3.js → receive-Bcdayv7D.js} +1 -1
- package/_assets/{resolveImplementation-BBe0akeh.js → resolveImplementation-CwGmt-Ul.js} +1 -1
- package/_assets/{rpc-iEVF2nz4.js → rpc-DRzCeqsN.js} +1 -1
- package/_assets/{secp256k1-Ba2kPpNf.js → secp256k1-ClhqnUH3.js} +1 -1
- package/_assets/{secp256k1-ClQ_G_RL.js → secp256k1-DLUn4TB-.js} +1 -1
- package/_assets/{secp256k1-e7mCjC3J.js → secp256k1-DhzpyilF.js} +1 -1
- package/_assets/{send-batch-transaction-C1STwRsa.js → send-batch-transaction-DHantNiN.js} +1 -1
- package/_assets/{send-eip712-transaction-Dy9FgG1n.js → send-eip712-transaction-fLP_Vd1c.js} +2 -2
- package/_assets/{send-gasless-transaction-C66wRlKz.js → send-gasless-transaction-SMtNChEu.js} +2 -2
- package/_assets/{send-transaction-CLuOLZ7t.js → send-transaction-BsC7jNWJ.js} +2 -2
- package/_assets/{send-BOmHA5ER.js → send-wLs7dMmi.js} +1 -1
- package/_assets/{sendMetaTransaction-DvDr2bCi.js → sendMetaTransaction-CtKaGv9m.js} +1 -1
- package/_assets/{sendRawTransaction-DqkFhazS.js → sendRawTransaction-DFSXwuy_.js} +3 -3
- package/_assets/{serializeTransaction-BEOUomEz.js → serializeTransaction-ndx8JnHB.js} +1 -1
- package/_assets/{session-proposal-UXG0f185.js → session-proposal-C8st7cqE.js} +1 -1
- package/_assets/{session-request-DIqK3WRK.js → session-request-vqs34KuA.js} +2 -2
- package/_assets/{signing-DReJZKDs.js → signing-4la8JLly.js} +3 -3
- package/_assets/{socials-CdGrw0ok.js → socials-6ow68kgk.js} +1 -1
- package/_assets/{swaps-CycOd3sO.js → swaps-D5qhgYfH.js} +1 -1
- package/_assets/{thirdweb-D5w8-dkS.js → thirdweb-BbrRIT8Z.js} +3 -3
- package/_assets/{to-serializable-transaction-C1TwC6Ti.js → to-serializable-transaction-DdVBjpVG.js} +2 -2
- package/_assets/{trade-encoding-Mw7kNWLf.js → trade-encoding-u1ITpVgD.js} +1 -1
- package/_assets/{transactionReceipt-DyOMk-YN.js → transactionReceipt-KCU4fxr5.js} +1 -1
- package/_assets/{transactions-VmU1Fomk.js → transactions-BA1mj6Hg.js} +1 -1
- package/_assets/{useCreditPacks-D1yz9_D9.js → useCreditPacks-CQJURGzy.js} +1 -1
- package/_assets/{useInfiniteGrid-C-7TbIWI.js → useInfiniteGrid-BE0gx0bE.js} +1 -1
- package/_assets/useManaRate-CrXBa97M.js +1 -0
- package/_assets/{useStore-DCWOq5iS.js → useStore-u-3kFHFb.js} +1 -1
- package/_assets/useTheme-CjaDxtu4.js +1 -0
- package/_assets/{verifyHash-B-nszbU3.js → verifyHash-DeQJYKTd.js} +1 -1
- package/_assets/{w3m-modal-y9ZrKukQ.js → w3m-modal-CTZXmBh-.js} +1 -1
- package/_assets/{w3m-modal-C9EOWDq3.js → w3m-modal-DyW-GOaP.js} +1 -1
- package/_assets/{wait-for-tx-receipt-DL1snjgl.js → wait-for-tx-receipt-CWPx3r9S.js} +1 -1
- package/_assets/{wallets-CExmmU6y.js → wallets-GJytAlIt.js} +5 -5
- package/_assets/{web-connector-vE0RE6CB.js → web-connector-DWE3a9mg.js} +3 -3
- package/_assets/{writeContract-B0sDSczf.js → writeContract-D3GlbOtW.js} +1 -1
- package/_assets/{zoraTestnet-B_NFi9S-.js → zoraTestnet-C9-Fej0w.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/_assets/Cart-W8w3sCuV.js +0 -695
- package/_assets/buy-CfVy6xwA.js +0 -1
- package/_assets/buy-gasless-DmFIjDH7.js +0 -1
- package/_assets/useManaRate-6JYRR5Sm.js +0 -1
- package/_assets/useSecondarySales-BhfHOcZl.js +0 -1
- package/_assets/useTheme-DoVQgCCM.js +0 -1
|
@@ -0,0 +1,695 @@
|
|
|
1
|
+
import{j as e,L as Se,r as P,d as ta,b as aa}from"./react-DehiWSvs.js";import{t as le,s as i,b as s,ao as de,aZ as sa,an as na,I as O,p as Mt,a9 as Ne,m as ia,L as Q,ab as dt,n as ra,u as oa,a_ as ca,q as da,a$ as la,b0 as ua,b1 as ha,b2 as pa,o as ga,b3 as lt,O as G,b4 as ut,b5 as xa,j as ae,c as ht,b6 as ma,d as fa,b7 as pt,b8 as Re,b9 as ye,ba as be,bb as gt,g as ve,e as ya,C as We,bc as ba}from"./index-9wwl-XRz.js";import{M as va,S as wa,C as Ca,H as ja,a as ka,T as $a,X as Sa,b as Ma,B as Ta,c as Ia,d as xt,e as Pa,f as ke,P as Tt,m as za,g as Aa,h as Ea,i as qa,j as It,k as $e,L as _a,l as Ba,n as mt,o as ft,W as Ra,p as Wa,q as Fa,A as La,r as Ka,s as Ua,t as Na,u as Qa,v as Oa,w as Ha,x as Va,y as Ga,z as Da,D as Ya,E as Ja,F as Xa,G as Za,I as es,J as ts,K as Fe,N as as,O as ss,Q as ns,R as is,U as yt,V as bt,Y as rs,Z as os,_ as cs}from"./CollectionCarousel-DclZ0mlb.js";import{u as ds}from"./useManaRate-CrXBa97M.js";import{r as ls}from"./mana-rate-CNR1wHIx.js";import{j as us,k as hs,h as ps,n as gs,i as xs,A as ms}from"./authorizations-C1AfJLRY.js";import{u as fs,g as ys,b as Le}from"./buy-CXpnZ35Y.js";import{b as bs,w as vs,S as vt,G as ws}from"./buy-gasless-BziA3gtB.js";import{u as Cs,M as js,R as we,r as ks,c as $s,p as wt}from"./useCreditPacks-CQJURGzy.js";import{i as Ss,a as Ms}from"./errors-4DfPe5KG.js";import{E as Ts}from"./ErrorNotice-Dp7YPtfk.js";import{u as Ct}from"./mana-convert-BVz9Ojfp.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./trade-encoding-u1ITpVgD.js";import"./sendMetaTransaction-CtKaGv9m.js";const{colors:se,radius:Is}=le,Ps=i.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
gap: 8px;
|
|
6
|
+
width: 100%;
|
|
7
|
+
`,zs=i.span`
|
|
8
|
+
font-size: 16px;
|
|
9
|
+
line-height: 22px;
|
|
10
|
+
color: ${se.text2};
|
|
11
|
+
text-transform: capitalize;
|
|
12
|
+
white-space: nowrap;
|
|
13
|
+
`,As=i.div`
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
gap: 8px;
|
|
17
|
+
/* The list is the modal's elastic region: inside a viewport-capped card it gives up height first, so
|
|
18
|
+
the pack picker, total and Cancel/Buy below it stay on screen without scrolling. The floor is an
|
|
19
|
+
explicit ~one row because a scroll container's automatic minimum size is zero — it would otherwise
|
|
20
|
+
collapse to nothing on a short screen. */
|
|
21
|
+
min-height: 120px;
|
|
22
|
+
max-height: 360px;
|
|
23
|
+
overflow-y: auto;
|
|
24
|
+
width: 100%;
|
|
25
|
+
scrollbar-width: thin;
|
|
26
|
+
scrollbar-color: #a2a2a2 ${se.media};
|
|
27
|
+
|
|
28
|
+
&::-webkit-scrollbar {
|
|
29
|
+
width: 8px;
|
|
30
|
+
}
|
|
31
|
+
&::-webkit-scrollbar-track {
|
|
32
|
+
background: ${se.media};
|
|
33
|
+
border-radius: 10px;
|
|
34
|
+
}
|
|
35
|
+
&::-webkit-scrollbar-thumb {
|
|
36
|
+
background: #a2a2a2;
|
|
37
|
+
border-radius: ${Is.btn};
|
|
38
|
+
}
|
|
39
|
+
`,Es=i.span`
|
|
40
|
+
margin-left: 8px;
|
|
41
|
+
font-size: 13px;
|
|
42
|
+
font-weight: 600;
|
|
43
|
+
color: ${se.muted};
|
|
44
|
+
`,qs=i.div`
|
|
45
|
+
display: flex;
|
|
46
|
+
align-items: center;
|
|
47
|
+
justify-content: space-between;
|
|
48
|
+
gap: 12px;
|
|
49
|
+
padding: 0 0 12px;
|
|
50
|
+
font-size: 14px;
|
|
51
|
+
color: ${se.muted};
|
|
52
|
+
|
|
53
|
+
& strong {
|
|
54
|
+
display: inline-flex;
|
|
55
|
+
align-items: center;
|
|
56
|
+
gap: 6px;
|
|
57
|
+
font-size: 20px;
|
|
58
|
+
font-weight: 700;
|
|
59
|
+
color: ${se.text};
|
|
60
|
+
}
|
|
61
|
+
`,_s="https://cdn.decentraland.org/@dcl/shop/0.4.1-30932341848.commit-2643c3e/_assets/buy-error-22UunaPC.png";function Bs(o){const{phase:l,balanceCredits:I,onClose:z}=o,W=l==="processing",D=l==="error"?s("cartCheckout.errorTitle"):l==="nofunds"?s("cartCheckout.titleNoFunds"):l==="choose"?s("buyModal.choosePayment"):s("cartCheckout.titleBuy"),Y=l==="processing";return e.jsxs(va,{role:"dialog","aria-modal":"true","aria-label":s("cartCheckout.dialogAria"),children:[e.jsx(wa,{onClick:W?void 0:z,"aria-hidden":!0}),e.jsxs(Ca,{"data-tall":Y||void 0,children:[e.jsxs(ja,{children:[e.jsxs(ka,{children:[e.jsx($a,{children:D}),!W&&e.jsx(Sa,{onClick:z,"aria-label":s("buyModal.close"),children:e.jsx(Ma,{})})]}),e.jsxs(Ta,{children:[e.jsx(Ia,{children:l==="nofunds"?s("buyModal.dclBalance"):s("buyModal.myCreditsBalance")}),e.jsx(xt,{}),e.jsx(Pa,{children:de(I)})]})]}),l==="choose"&&e.jsxs(ke,{children:[e.jsxs(qs,{children:[e.jsx("span",{children:s("cart.purchaseSummary")}),e.jsxs("strong",{children:[e.jsx(xt,{}),de(o.totalCredits??0)]})]}),e.jsx(Tt,{options:o.options??[],totalCents:o.totalCents??0,onPay:o.onPay??(()=>{}),rateNote:(()=>{const A=za(o.totalCents??0,o.totalManaWei??0n);return A!=null?s("buyModal.manaRate",{mana:A.toLocaleString("en",{maximumFractionDigits:2})}):null})()})]}),l==="processing"&&e.jsx(Rs,{stage:o.stage??"reserving",step:o.step??1,total:o.total??1,isSelfCustody:!!o.isSelfCustody,signatures:o.signatures}),l==="nofunds"&&e.jsx(Ws,{lines:o.lines??[],shortfallCredits:o.shortfallCredits??0,packs:o.packs??[],selectedPack:o.selectedPack??"",onSelectPack:o.onSelectPack??(()=>{}),onBuyPacks:o.onBuyPacks??(()=>{}),onCancel:z}),l==="error"&&e.jsxs(ke,{children:[e.jsxs(Aa,{"data-testid":"buy-error",children:[e.jsx(Ea,{src:_s,alt:"",width:64,height:80}),e.jsxs(qa,{children:[e.jsx("b",{children:s("cartCheckout.errorHeadline")})," ",o.message??s("cartCheckout.errorBody")]})]}),e.jsxs(It,{children:[e.jsx($e,{"data-variant":"outline",onClick:z,children:s("buyModal.cancel")}),e.jsx($e,{"data-variant":"purple",onClick:o.onRetry??z,children:s("cartCheckout.tryAgain")})]})]})]})]})}function Rs({stage:o,step:l,total:I,isSelfCustody:z,signatures:W}){const D=o==="reserving",Y=I>0?Math.min(100,Math.round(l/I*100)):0,A=z&&W&&W.total>1,ne=o==="awaiting-signature"?z?A?s("cartCheckout.confirmMultiple",{current:W.current,total:W.total}):s("buyModal.confirmToContinue"):s("buyModal.completingTransaction"):o==="settling"?s("buyModal.completingTransaction"):s("cartCheckout.preparing");return e.jsxs(ke,{"data-processing":!0,children:[e.jsx(_a,{src:sa,alt:"",width:61,height:61}),e.jsx(Ba,{children:ne}),D?e.jsxs(Ps,{children:[e.jsx(mt,{"aria-hidden":!0,children:e.jsx(ft,{"data-step":!0,style:{width:`${Y}%`}})}),I>1?e.jsxs(zs,{children:[l,"/",I]}):null]}):e.jsx(mt,{"aria-hidden":!0,children:e.jsx(ft,{})})]})}function Ws({lines:o,shortfallCredits:l,packs:I,selectedPack:z,onSelectPack:W,onBuyPacks:D,onCancel:Y}){const A=I.find(n=>n.id===z),ne=o.reduce((n,L)=>n+(L.quantity??1),0);return e.jsxs(ke,{children:[e.jsxs(Ra,{"data-testid":"nofunds-warning",children:[e.jsx(Wa,{}),e.jsxs(Fa,{children:[e.jsx("b",{children:s("buyModal.insufficientFunds")})," ",s("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:s("buyModal.warningCreditsAmount",{count:Math.max(0,l)})})," ",s("buyModal.warningToPurchase",{count:ne})]})]}),e.jsx(As,{children:o.map(n=>{const L=n.quantity??1;return e.jsxs(La,{children:[e.jsx(Ka,{children:n.item.thumbnail?e.jsx("img",{src:n.item.thumbnail,alt:""}):null}),e.jsxs(Ua,{children:[e.jsxs("div",{children:[e.jsxs(Na,{title:n.item.name,children:[n.item.name||s("buyModal.itemFallback"),L>1?e.jsx(Es,{children:s("cartCheckout.qty",{count:L})}):null]}),n.item.creator?e.jsx(Qa,{address:n.item.creator}):null]}),e.jsxs(Oa,{children:[e.jsx(Ha,{}),e.jsx("span",{children:de(n.priceCredits*L)})]})]})]},n.item.id)})}),e.jsx(Va,{children:I.map(n=>{const L=n.id===z;return e.jsxs(Ga,{"data-testid":"credit-pack","data-on":L||void 0,onClick:()=>W(n.id),children:[e.jsx(Da,{}),e.jsx(Ya,{children:de(n.credits)}),e.jsxs(Ja,{children:["($",n.usd.toFixed(2),")"]})]},n.id)})}),e.jsxs(Xa,{children:[e.jsxs(Za,{children:[e.jsx(es,{}),e.jsx("span",{children:de((A==null?void 0:A.credits)??0)})]}),e.jsxs(ts,{children:["$",((A==null?void 0:A.usd)??0).toFixed(2)]})]}),e.jsxs(It,{children:[e.jsx($e,{"data-variant":"outline",onClick:Y,children:s("buyModal.cancel")}),e.jsx($e,{"data-variant":"gradient",onClick:D,children:s("buyModal.buy")})]})]})}const{colors:r,gradients:Pt,radius:Z}=le,zt="@media (max-width: 1080px)",T="@media (max-width: 880px)",jt=i.div`
|
|
62
|
+
max-width: 1510px;
|
|
63
|
+
margin: 0 auto;
|
|
64
|
+
/* Grows into the page's leftover height and passes it down to Upsell, so the white cross-sell band ends at
|
|
65
|
+
the footer rather than leaving a gray strip. Needs .page[data-route="/cart"] to be a flex column. */
|
|
66
|
+
width: 100%;
|
|
67
|
+
flex: 1 0 auto;
|
|
68
|
+
display: flex;
|
|
69
|
+
flex-direction: column;
|
|
70
|
+
|
|
71
|
+
${T} {
|
|
72
|
+
padding-bottom: 188px; /* room for the fixed summary bar */
|
|
73
|
+
}
|
|
74
|
+
`,kt=i.button`
|
|
75
|
+
display: inline-flex;
|
|
76
|
+
align-items: center;
|
|
77
|
+
gap: 6px;
|
|
78
|
+
margin: 0 0 16px;
|
|
79
|
+
padding: 0;
|
|
80
|
+
border: 0;
|
|
81
|
+
background: none;
|
|
82
|
+
color: ${r.text2};
|
|
83
|
+
font-size: 14px;
|
|
84
|
+
font-weight: 600;
|
|
85
|
+
letter-spacing: 0.02em;
|
|
86
|
+
text-transform: uppercase;
|
|
87
|
+
cursor: pointer;
|
|
88
|
+
transition: color 0.15s ease;
|
|
89
|
+
|
|
90
|
+
&:hover {
|
|
91
|
+
color: ${r.accent};
|
|
92
|
+
}
|
|
93
|
+
& .ico {
|
|
94
|
+
width: 18px;
|
|
95
|
+
height: 18px;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
${T} {
|
|
99
|
+
display: none;
|
|
100
|
+
}
|
|
101
|
+
`,Fs=i.div`
|
|
102
|
+
display: grid;
|
|
103
|
+
grid-template-columns: minmax(0, 1fr) 615px;
|
|
104
|
+
gap: 24px;
|
|
105
|
+
align-items: start;
|
|
106
|
+
|
|
107
|
+
${zt} {
|
|
108
|
+
grid-template-columns: 1fr;
|
|
109
|
+
}
|
|
110
|
+
`,$t=i.div`
|
|
111
|
+
position: relative;
|
|
112
|
+
/* The gray band is 733px in Figma (1553-317103) — taller than the panels inside it, deliberately. Without
|
|
113
|
+
this it collapsed to the panels' height, and the page shell's own viewport-filling min-height then padded
|
|
114
|
+
the page out BELOW the cross-sell, so a strip of gray showed under "You might also like" instead of the
|
|
115
|
+
footer. Giving the band its designed height puts the leftover space where the design wants it. */
|
|
116
|
+
min-height: 733px;
|
|
117
|
+
|
|
118
|
+
${T} {
|
|
119
|
+
/* The single-column layout is already taller than the desktop band, and the fixed summary bar sits over
|
|
120
|
+
the bottom of it — a floor here would only add empty gray. */
|
|
121
|
+
min-height: 0;
|
|
122
|
+
}
|
|
123
|
+
`,Ls=i.div`
|
|
124
|
+
min-width: 0;
|
|
125
|
+
display: flex;
|
|
126
|
+
flex-direction: column;
|
|
127
|
+
gap: 12px;
|
|
128
|
+
`,Ks=i.div`
|
|
129
|
+
display: flex;
|
|
130
|
+
align-items: center;
|
|
131
|
+
justify-content: space-between;
|
|
132
|
+
gap: 12px;
|
|
133
|
+
background: ${r.white};
|
|
134
|
+
border-radius: 16px;
|
|
135
|
+
padding: 12px 12px 12px 24px;
|
|
136
|
+
|
|
137
|
+
${T} {
|
|
138
|
+
gap: 8px;
|
|
139
|
+
padding: 12px;
|
|
140
|
+
}
|
|
141
|
+
`,At=i.section`
|
|
142
|
+
min-width: 0;
|
|
143
|
+
background: ${r.white};
|
|
144
|
+
border-radius: 16px;
|
|
145
|
+
padding: 24px;
|
|
146
|
+
|
|
147
|
+
${T} {
|
|
148
|
+
padding: 16px;
|
|
149
|
+
}
|
|
150
|
+
`,Us=i(At)`
|
|
151
|
+
display: flex;
|
|
152
|
+
flex-direction: column;
|
|
153
|
+
align-items: center;
|
|
154
|
+
justify-content: center;
|
|
155
|
+
gap: 24px;
|
|
156
|
+
min-height: 420px;
|
|
157
|
+
padding: 48px 16px;
|
|
158
|
+
text-align: center;
|
|
159
|
+
color: ${r.text};
|
|
160
|
+
|
|
161
|
+
${le.media.maxWidth("mobile")} {
|
|
162
|
+
min-height: 320px;
|
|
163
|
+
padding: 32px 16px;
|
|
164
|
+
}
|
|
165
|
+
`,Ns=i.div`
|
|
166
|
+
display: flex;
|
|
167
|
+
flex-direction: column;
|
|
168
|
+
align-items: center;
|
|
169
|
+
gap: 12px;
|
|
170
|
+
padding-bottom: 16px;
|
|
171
|
+
`,Qs=i.p`
|
|
172
|
+
margin: 0;
|
|
173
|
+
font-size: 24px;
|
|
174
|
+
font-weight: 700;
|
|
175
|
+
line-height: 1.6;
|
|
176
|
+
|
|
177
|
+
${le.media.maxWidth("mobile")} {
|
|
178
|
+
font-size: 20px;
|
|
179
|
+
}
|
|
180
|
+
`,Os=i.p`
|
|
181
|
+
margin: 0;
|
|
182
|
+
font-size: 20px;
|
|
183
|
+
font-weight: 400;
|
|
184
|
+
line-height: 1.6;
|
|
185
|
+
|
|
186
|
+
${le.media.maxWidth("mobile")} {
|
|
187
|
+
font-size: 16px;
|
|
188
|
+
}
|
|
189
|
+
`,Hs=i(Se)`
|
|
190
|
+
display: inline-flex;
|
|
191
|
+
align-items: center;
|
|
192
|
+
justify-content: center;
|
|
193
|
+
width: 310px;
|
|
194
|
+
max-width: 100%;
|
|
195
|
+
height: 56px;
|
|
196
|
+
padding: 0 12px;
|
|
197
|
+
border-radius: ${Z.card};
|
|
198
|
+
background: ${r.accent};
|
|
199
|
+
color: ${r.softWhite};
|
|
200
|
+
font-size: 15px;
|
|
201
|
+
font-weight: 600;
|
|
202
|
+
line-height: 24px;
|
|
203
|
+
letter-spacing: 0.46px;
|
|
204
|
+
text-transform: uppercase;
|
|
205
|
+
text-decoration: none;
|
|
206
|
+
transition: background 0.15s ease;
|
|
207
|
+
|
|
208
|
+
&:hover {
|
|
209
|
+
background: ${r.accentHover};
|
|
210
|
+
}
|
|
211
|
+
&:focus-visible {
|
|
212
|
+
outline: 2px solid ${r.accent};
|
|
213
|
+
outline-offset: 2px;
|
|
214
|
+
}
|
|
215
|
+
`,Vs=i.button`
|
|
216
|
+
display: none;
|
|
217
|
+
|
|
218
|
+
${T} {
|
|
219
|
+
display: inline-flex;
|
|
220
|
+
align-items: center;
|
|
221
|
+
flex-shrink: 0;
|
|
222
|
+
border: 0;
|
|
223
|
+
background: none;
|
|
224
|
+
padding: 0;
|
|
225
|
+
color: ${r.text};
|
|
226
|
+
cursor: pointer;
|
|
227
|
+
|
|
228
|
+
& .ico {
|
|
229
|
+
width: 20px;
|
|
230
|
+
height: 20px;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
`,Gs=i.h1`
|
|
234
|
+
margin: 0;
|
|
235
|
+
font-size: 14px;
|
|
236
|
+
font-weight: 600;
|
|
237
|
+
line-height: 1.57;
|
|
238
|
+
color: ${r.text};
|
|
239
|
+
|
|
240
|
+
${T} {
|
|
241
|
+
flex: 1;
|
|
242
|
+
min-width: 0;
|
|
243
|
+
font-size: 16px;
|
|
244
|
+
}
|
|
245
|
+
`,Ds=i.button`
|
|
246
|
+
display: inline-flex;
|
|
247
|
+
align-items: center;
|
|
248
|
+
justify-content: center;
|
|
249
|
+
gap: 8px;
|
|
250
|
+
height: 40px;
|
|
251
|
+
padding: 0 12px;
|
|
252
|
+
border: 2px solid transparent;
|
|
253
|
+
border-radius: ${Z.btn};
|
|
254
|
+
background:
|
|
255
|
+
linear-gradient(${r.white}, ${r.white}) padding-box,
|
|
256
|
+
${Pt.amethyst} border-box;
|
|
257
|
+
color: ${r.accent};
|
|
258
|
+
font-size: 13px;
|
|
259
|
+
font-weight: 600;
|
|
260
|
+
line-height: 24px;
|
|
261
|
+
letter-spacing: 0.46px;
|
|
262
|
+
text-transform: uppercase;
|
|
263
|
+
white-space: nowrap;
|
|
264
|
+
cursor: pointer;
|
|
265
|
+
transition:
|
|
266
|
+
box-shadow 0.15s ease,
|
|
267
|
+
filter 0.15s ease;
|
|
268
|
+
|
|
269
|
+
&:hover:not(:disabled) {
|
|
270
|
+
box-shadow: 0 0 8px 0 rgba(165, 36, 179, 0.35);
|
|
271
|
+
}
|
|
272
|
+
&:active:not(:disabled) {
|
|
273
|
+
filter: brightness(0.97);
|
|
274
|
+
}
|
|
275
|
+
&:disabled {
|
|
276
|
+
opacity: 0.55;
|
|
277
|
+
cursor: default;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
${T} {
|
|
281
|
+
height: 36px;
|
|
282
|
+
padding: 0 10px;
|
|
283
|
+
font-size: 12px;
|
|
284
|
+
}
|
|
285
|
+
`,Ys=i.div`
|
|
286
|
+
display: flex;
|
|
287
|
+
flex-direction: column;
|
|
288
|
+
gap: 24px;
|
|
289
|
+
`,Js=i.div`
|
|
290
|
+
position: relative;
|
|
291
|
+
display: flex;
|
|
292
|
+
align-items: stretch;
|
|
293
|
+
gap: 12px;
|
|
294
|
+
background: ${r.white};
|
|
295
|
+
border: 1px solid ${r.gray4};
|
|
296
|
+
border-radius: ${Z.card};
|
|
297
|
+
overflow: hidden;
|
|
298
|
+
|
|
299
|
+
&[data-unavailable] [data-thumb] {
|
|
300
|
+
opacity: 0.5;
|
|
301
|
+
}
|
|
302
|
+
&[data-unavailable] [data-check] {
|
|
303
|
+
display: none;
|
|
304
|
+
}
|
|
305
|
+
&[data-unavailable] [data-desc] {
|
|
306
|
+
opacity: 0.7;
|
|
307
|
+
}
|
|
308
|
+
`,Xs=i.div`
|
|
309
|
+
position: relative;
|
|
310
|
+
flex-shrink: 0;
|
|
311
|
+
width: 137.5px;
|
|
312
|
+
height: 137px;
|
|
313
|
+
background: ${r.media};
|
|
314
|
+
border-radius: ${Z.card};
|
|
315
|
+
display: grid;
|
|
316
|
+
place-items: center;
|
|
317
|
+
overflow: hidden;
|
|
318
|
+
|
|
319
|
+
& img {
|
|
320
|
+
width: 83%;
|
|
321
|
+
height: 83%;
|
|
322
|
+
object-fit: contain;
|
|
323
|
+
filter: drop-shadow(0.56px 2.25px 2.8px rgba(0, 0, 0, 0.1));
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
${T} {
|
|
327
|
+
width: 120px;
|
|
328
|
+
height: 120px;
|
|
329
|
+
}
|
|
330
|
+
`,Zs=i(Se)`
|
|
331
|
+
position: absolute;
|
|
332
|
+
inset: 0;
|
|
333
|
+
display: grid;
|
|
334
|
+
place-items: center;
|
|
335
|
+
`,en=i.span`
|
|
336
|
+
position: absolute;
|
|
337
|
+
top: 7.5px;
|
|
338
|
+
left: 7.5px;
|
|
339
|
+
width: 20px;
|
|
340
|
+
height: 20px;
|
|
341
|
+
border-radius: 50%;
|
|
342
|
+
background: #34ce77;
|
|
343
|
+
display: grid;
|
|
344
|
+
place-items: center;
|
|
345
|
+
`,tn=i.div`
|
|
346
|
+
flex: 1;
|
|
347
|
+
min-width: 0;
|
|
348
|
+
display: flex;
|
|
349
|
+
flex-direction: column;
|
|
350
|
+
justify-content: space-between;
|
|
351
|
+
gap: 8px;
|
|
352
|
+
padding: 16px 8px;
|
|
353
|
+
|
|
354
|
+
${T} {
|
|
355
|
+
padding: 12px 4px 12px 0;
|
|
356
|
+
}
|
|
357
|
+
`,an=i.div`
|
|
358
|
+
display: flex;
|
|
359
|
+
flex-direction: column;
|
|
360
|
+
gap: 4px;
|
|
361
|
+
min-width: 0;
|
|
362
|
+
padding-right: 64px; /* clear the top-right favourite + remove group */
|
|
363
|
+
`,Et=Ne`
|
|
364
|
+
display: block;
|
|
365
|
+
font-size: 16px;
|
|
366
|
+
font-weight: 600;
|
|
367
|
+
line-height: 1.2;
|
|
368
|
+
color: ${r.text};
|
|
369
|
+
text-decoration: none;
|
|
370
|
+
overflow: hidden;
|
|
371
|
+
text-overflow: ellipsis;
|
|
372
|
+
white-space: nowrap;
|
|
373
|
+
|
|
374
|
+
a&:hover {
|
|
375
|
+
color: ${r.accent};
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
${T} {
|
|
379
|
+
white-space: normal;
|
|
380
|
+
display: -webkit-box;
|
|
381
|
+
-webkit-line-clamp: 2;
|
|
382
|
+
line-clamp: 2;
|
|
383
|
+
-webkit-box-orient: vertical;
|
|
384
|
+
}
|
|
385
|
+
`,sn=i.div`
|
|
386
|
+
${Et};
|
|
387
|
+
`,nn=i(Se)`
|
|
388
|
+
${Et};
|
|
389
|
+
`,rn=i(na)`
|
|
390
|
+
font-size: 10px;
|
|
391
|
+
line-height: 1.43;
|
|
392
|
+
color: ${r.muted};
|
|
393
|
+
|
|
394
|
+
& [data-avatar] {
|
|
395
|
+
display: none;
|
|
396
|
+
}
|
|
397
|
+
& [data-testid='creator-name'] {
|
|
398
|
+
font-size: 10px;
|
|
399
|
+
line-height: 1.43;
|
|
400
|
+
}
|
|
401
|
+
`,on=i.div`
|
|
402
|
+
display: flex;
|
|
403
|
+
align-items: center;
|
|
404
|
+
justify-content: space-between;
|
|
405
|
+
gap: 12px;
|
|
406
|
+
padding-right: 8px;
|
|
407
|
+
`,cn=i.div`
|
|
408
|
+
display: inline-flex;
|
|
409
|
+
align-items: center;
|
|
410
|
+
gap: 8px;
|
|
411
|
+
padding: 6px;
|
|
412
|
+
border: 0.5px solid ${r.muted2};
|
|
413
|
+
border-radius: ${Z.pill};
|
|
414
|
+
`,St=i.button`
|
|
415
|
+
display: grid;
|
|
416
|
+
place-items: center;
|
|
417
|
+
width: 16px;
|
|
418
|
+
height: 16px;
|
|
419
|
+
padding: 0;
|
|
420
|
+
border: 0;
|
|
421
|
+
background: none;
|
|
422
|
+
color: ${r.text};
|
|
423
|
+
cursor: pointer;
|
|
424
|
+
|
|
425
|
+
&:disabled {
|
|
426
|
+
color: ${r.muted2};
|
|
427
|
+
cursor: default;
|
|
428
|
+
}
|
|
429
|
+
`,dn=i.span`
|
|
430
|
+
min-width: 12px;
|
|
431
|
+
font-size: 14px;
|
|
432
|
+
font-weight: 500;
|
|
433
|
+
line-height: 1.2;
|
|
434
|
+
color: ${r.text};
|
|
435
|
+
text-align: center;
|
|
436
|
+
`,ln=i.div`
|
|
437
|
+
display: inline-flex;
|
|
438
|
+
align-items: center;
|
|
439
|
+
gap: 4px;
|
|
440
|
+
/* Always right-aligned: with a stepper present space-between handles it; for secondary/unique lines
|
|
441
|
+
(no stepper) the auto margin keeps the lone price on the right instead of falling to the left. */
|
|
442
|
+
margin-left: auto;
|
|
443
|
+
font-size: 24px;
|
|
444
|
+
font-weight: 600;
|
|
445
|
+
color: ${r.text2};
|
|
446
|
+
|
|
447
|
+
${T} {
|
|
448
|
+
font-size: 20px;
|
|
449
|
+
}
|
|
450
|
+
`,un=i(Mt)`
|
|
451
|
+
width: 24px;
|
|
452
|
+
height: 24px;
|
|
453
|
+
background: ${r.text};
|
|
454
|
+
|
|
455
|
+
${T} {
|
|
456
|
+
width: 20px;
|
|
457
|
+
height: 20px;
|
|
458
|
+
}
|
|
459
|
+
`,hn=i.span`
|
|
460
|
+
margin-left: 6px;
|
|
461
|
+
font-size: 14px;
|
|
462
|
+
font-weight: 500;
|
|
463
|
+
color: ${r.muted};
|
|
464
|
+
text-decoration: line-through;
|
|
465
|
+
`,pn=i.div`
|
|
466
|
+
position: absolute;
|
|
467
|
+
top: 9px;
|
|
468
|
+
right: 7px;
|
|
469
|
+
display: flex;
|
|
470
|
+
align-items: flex-start;
|
|
471
|
+
gap: 12px;
|
|
472
|
+
`,gn=i.span`
|
|
473
|
+
display: inline-flex;
|
|
474
|
+
align-items: center;
|
|
475
|
+
gap: 4px;
|
|
476
|
+
font-size: 12px;
|
|
477
|
+
font-weight: 600;
|
|
478
|
+
line-height: 1;
|
|
479
|
+
text-transform: uppercase;
|
|
480
|
+
color: ${r.text2};
|
|
481
|
+
`,xn=i(O)`
|
|
482
|
+
color: #f48221;
|
|
483
|
+
`,mn=i(Se)`
|
|
484
|
+
font-size: 12px;
|
|
485
|
+
font-weight: 600;
|
|
486
|
+
line-height: 24px;
|
|
487
|
+
letter-spacing: 0.46px;
|
|
488
|
+
text-transform: uppercase;
|
|
489
|
+
text-decoration: underline;
|
|
490
|
+
color: ${r.accent};
|
|
491
|
+
|
|
492
|
+
&:hover {
|
|
493
|
+
color: ${r.accentHover};
|
|
494
|
+
}
|
|
495
|
+
&:focus-visible {
|
|
496
|
+
outline: 2px solid ${r.accent};
|
|
497
|
+
outline-offset: 2px;
|
|
498
|
+
}
|
|
499
|
+
`,fn=i.span`
|
|
500
|
+
align-self: flex-start;
|
|
501
|
+
display: inline-flex;
|
|
502
|
+
align-items: center;
|
|
503
|
+
gap: 4px;
|
|
504
|
+
padding: 2px 4px;
|
|
505
|
+
border-radius: ${Z.chip};
|
|
506
|
+
background: #f4e9ff;
|
|
507
|
+
font-size: 10px;
|
|
508
|
+
font-weight: 400;
|
|
509
|
+
line-height: 14px;
|
|
510
|
+
color: ${r.text};
|
|
511
|
+
`,yn=i(O)`
|
|
512
|
+
width: 11.31px;
|
|
513
|
+
height: 10.94px;
|
|
514
|
+
background: ${r.text};
|
|
515
|
+
`,qt=Ne`
|
|
516
|
+
display: grid;
|
|
517
|
+
place-items: center;
|
|
518
|
+
width: 24px;
|
|
519
|
+
height: 24px;
|
|
520
|
+
padding: 0;
|
|
521
|
+
border: 0;
|
|
522
|
+
background: none;
|
|
523
|
+
color: ${r.muted};
|
|
524
|
+
cursor: pointer;
|
|
525
|
+
transition: color 0.12s ease;
|
|
526
|
+
|
|
527
|
+
&:disabled {
|
|
528
|
+
opacity: 0.5;
|
|
529
|
+
cursor: default;
|
|
530
|
+
}
|
|
531
|
+
`,bn=i.button`
|
|
532
|
+
${qt};
|
|
533
|
+
|
|
534
|
+
&:hover:not(:disabled) {
|
|
535
|
+
color: ${r.text};
|
|
536
|
+
}
|
|
537
|
+
&[data-on] {
|
|
538
|
+
color: ${r.dclRed};
|
|
539
|
+
}
|
|
540
|
+
`,vn=i.button`
|
|
541
|
+
${qt};
|
|
542
|
+
|
|
543
|
+
&:hover:not(:disabled) {
|
|
544
|
+
color: ${r.dclRed};
|
|
545
|
+
}
|
|
546
|
+
`,wn=i.div`
|
|
547
|
+
display: flex;
|
|
548
|
+
gap: 20px;
|
|
549
|
+
margin-top: 16px;
|
|
550
|
+
|
|
551
|
+
& .link {
|
|
552
|
+
font-size: 13px;
|
|
553
|
+
color: ${r.muted};
|
|
554
|
+
font-weight: 600;
|
|
555
|
+
}
|
|
556
|
+
& .link:hover:not(:disabled) {
|
|
557
|
+
color: ${r.text};
|
|
558
|
+
}
|
|
559
|
+
`,Cn=i.aside`
|
|
560
|
+
position: sticky;
|
|
561
|
+
top: 172px;
|
|
562
|
+
display: flex;
|
|
563
|
+
flex-direction: column;
|
|
564
|
+
background: ${r.white};
|
|
565
|
+
box-shadow: 0 1px 3px rgba(22, 21, 24, 0.06);
|
|
566
|
+
border-radius: 16px;
|
|
567
|
+
padding: 16px;
|
|
568
|
+
|
|
569
|
+
${zt} {
|
|
570
|
+
position: static;
|
|
571
|
+
}
|
|
572
|
+
${T} {
|
|
573
|
+
position: fixed;
|
|
574
|
+
left: 0;
|
|
575
|
+
right: 0;
|
|
576
|
+
top: auto;
|
|
577
|
+
bottom: 0;
|
|
578
|
+
z-index: 30;
|
|
579
|
+
border: 0;
|
|
580
|
+
border-radius: 16px 16px 0 0;
|
|
581
|
+
box-shadow: 0 -4px 20px rgba(22, 21, 24, 0.12);
|
|
582
|
+
}
|
|
583
|
+
`,jn=i.h2`
|
|
584
|
+
margin: 0 0 24px;
|
|
585
|
+
padding-bottom: 16px;
|
|
586
|
+
border-bottom: 1px solid ${r.gray4};
|
|
587
|
+
font-size: 24px;
|
|
588
|
+
font-weight: 600;
|
|
589
|
+
color: ${r.text};
|
|
590
|
+
|
|
591
|
+
${T} {
|
|
592
|
+
margin-bottom: 12px;
|
|
593
|
+
padding-bottom: 12px;
|
|
594
|
+
}
|
|
595
|
+
`,kn=i.div`
|
|
596
|
+
display: flex;
|
|
597
|
+
flex-direction: column;
|
|
598
|
+
gap: 12px;
|
|
599
|
+
`,$n=i.div`
|
|
600
|
+
display: flex;
|
|
601
|
+
align-items: flex-start;
|
|
602
|
+
justify-content: space-between;
|
|
603
|
+
gap: 12px;
|
|
604
|
+
`,Sn=i.span`
|
|
605
|
+
font-size: 14px;
|
|
606
|
+
font-weight: 600;
|
|
607
|
+
line-height: 1.57;
|
|
608
|
+
color: ${r.muted1};
|
|
609
|
+
`,Mn=i.span`
|
|
610
|
+
display: inline-flex;
|
|
611
|
+
align-items: center;
|
|
612
|
+
gap: 8px;
|
|
613
|
+
font-size: 24px;
|
|
614
|
+
font-weight: 700;
|
|
615
|
+
color: ${r.text};
|
|
616
|
+
`,Tn=i.span`
|
|
617
|
+
display: flex;
|
|
618
|
+
flex-direction: column;
|
|
619
|
+
align-items: flex-end;
|
|
620
|
+
justify-content: center;
|
|
621
|
+
gap: 4px;
|
|
622
|
+
`;i.span`
|
|
623
|
+
font-size: 12px;
|
|
624
|
+
font-weight: 400;
|
|
625
|
+
line-height: 1;
|
|
626
|
+
color: ${r.muted};
|
|
627
|
+
`;const In=i(Mt)`
|
|
628
|
+
width: 30px;
|
|
629
|
+
height: 30px;
|
|
630
|
+
background: ${r.text};
|
|
631
|
+
-webkit-mask-size: 24px 24px;
|
|
632
|
+
mask-size: 24px 24px;
|
|
633
|
+
-webkit-mask-position: left center;
|
|
634
|
+
mask-position: left center;
|
|
635
|
+
`,Pn=i.button`
|
|
636
|
+
width: 100%;
|
|
637
|
+
height: 56px;
|
|
638
|
+
border: 0;
|
|
639
|
+
border-radius: ${Z.btn};
|
|
640
|
+
background: ${Pt.amethyst};
|
|
641
|
+
color: ${r.softWhite};
|
|
642
|
+
font-size: 15px;
|
|
643
|
+
font-weight: 600;
|
|
644
|
+
letter-spacing: 0.046em;
|
|
645
|
+
text-transform: uppercase;
|
|
646
|
+
cursor: pointer;
|
|
647
|
+
transition:
|
|
648
|
+
background 0.15s ease,
|
|
649
|
+
filter 0.15s ease;
|
|
650
|
+
|
|
651
|
+
&:hover:not(:disabled) {
|
|
652
|
+
background: ${r.accent};
|
|
653
|
+
}
|
|
654
|
+
&:active:not(:disabled) {
|
|
655
|
+
filter: brightness(0.95);
|
|
656
|
+
}
|
|
657
|
+
&:disabled {
|
|
658
|
+
opacity: 0.6;
|
|
659
|
+
cursor: default;
|
|
660
|
+
}
|
|
661
|
+
`,_t=Ne`
|
|
662
|
+
margin: 0;
|
|
663
|
+
font-size: 13px;
|
|
664
|
+
`,Ce=i.p`
|
|
665
|
+
${_t};
|
|
666
|
+
`,zn=i(Ts)`
|
|
667
|
+
${_t};
|
|
668
|
+
`,An=i.div`
|
|
669
|
+
position: relative;
|
|
670
|
+
/* Takes the leftover height so its white ::before covers it — see .page[data-route="/cart"]. */
|
|
671
|
+
flex: 1 0 auto;
|
|
672
|
+
margin-top: 48px;
|
|
673
|
+
/* The whole gap from the top of the cross-sell to the "You might also like" heading — the shared
|
|
674
|
+
carousel's own top margin is zeroed below so this padding isn't stacked on top of it. */
|
|
675
|
+
padding: 47px 0 24px;
|
|
676
|
+
|
|
677
|
+
&::before {
|
|
678
|
+
content: '';
|
|
679
|
+
position: absolute;
|
|
680
|
+
top: 0;
|
|
681
|
+
bottom: -80px; /* eat .page's bottom padding so the white reaches the footer */
|
|
682
|
+
left: 50%;
|
|
683
|
+
width: 100vw;
|
|
684
|
+
transform: translateX(-50%);
|
|
685
|
+
background: ${r.bg};
|
|
686
|
+
z-index: 0;
|
|
687
|
+
}
|
|
688
|
+
& > * {
|
|
689
|
+
position: relative;
|
|
690
|
+
z-index: 1;
|
|
691
|
+
}
|
|
692
|
+
& section {
|
|
693
|
+
margin-top: 0;
|
|
694
|
+
}
|
|
695
|
+
`;function Ke(o){if(Ss(o))return s("errors.rejected");const l=(o.message??"").toLowerCase();return l.includes("insufficient")?s("cart.error.insufficient",{currency:fa.name}):l.includes("no active listing")||l.includes("your own listing")?s("cart.error.listingChanged"):s("marketCheckout.error.generic")}const En=12e4;function qn(o){const l=[];return o.unavailable.length&&l.push(s("cart.drop.unavailable",{count:o.unavailable.length})),o.own.length&&l.push(s("cart.drop.own",{count:o.own.length})),s("cart.drop.removed",{items:l.join(` ${s("cart.drop.and")} `)})}const Ue=o=>o.reduce((l,I)=>l+I.priceCredits*I.quantity,0),je=o=>o.flatMap(l=>Array.from({length:l.quantity},()=>({...l,quantity:1})));function Zn(){ia({title:s("nav.cart"),noindex:!0});const o=Q(t=>t.items),l=Q(t=>t.remove),I=Q(t=>t.increment),z=Q(t=>t.decrement),W=Q(t=>t.clear),D=Q(t=>t.restore),Y=Q(t=>t.setFittingOpen),A=dt(t=>t.items),ne=dt(t=>t.toggle),{session:n,signIn:L}=ra(),Bt=fs(),ue=Cs().packs.slice(0,js);P.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const Rt=o.some(t=>t.category!=="emote"),{data:Me}=oa({queryKey:["upsell-listings"],queryFn:()=>ba({first:40}),staleTime:6e4}),{data:$}=ca(n),b=da(),ee=ta(),{state:J}=aa(),[Wt,ie]=P.useState(null),[Qe,he]=P.useState(null),[Ft,_]=P.useState(!1),[B,H]=P.useState(null),Oe=P.useRef(0),[p,j]=P.useState(null),{data:pe}=la(n),{data:re}=ds(!0),[Te,He]=P.useState(""),oe=P.useRef(null),Ve=ua(o),Ge=t=>lt(Ve[t.id]),Ie=o.filter(Ge),Pe=o.length>0&&Ie.length===0,Lt=Ie.reduce((t,a)=>t+a.priceCredits*a.quantity,0),Kt=o.reduce((t,a)=>t+a.quantity,0),Ut=Ie.reduce((t,a)=>t+a.quantity,0),De=B?B.liveTotalCredits:Lt,Nt=new Set(o.map(t=>t.id)),Ye=((Me==null?void 0:Me.items)??[]).filter(t=>!Nt.has(t.id)).slice(0,12),Qt=new Map(B==null?void 0:B.buyable.map(t=>[t.item.id,t])),ge=($==null?void 0:$.credits)??0,ze=De*10,Ot=re?Ct(ze,re):0n,xe=Fe({priceCents:ze,priceManaWei:Ot,balanceCents:($==null?void 0:$.balanceCents)??0,manaBalanceWei:pe??0n}),Ht=t=>t.some(a=>a.acquisition==="store"),Ae=t=>t.flatMap(a=>a.acquisition==="trade"?[a]:[]),Vt=xa,Gt=t=>ma(t.contractAddress,String(t.itemId));function me(t){t(),H(null),he(null),ie(null)}function Dt(){j(null),_(!1)}function Je(t){const a=Ue(t),d=Math.max(0,a-ge),c=ue.find(u=>u.credits>=d)??ue[ue.length-1];He(c.id),G("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:a,credits_balance:ge,shortfall:d}),j({phase:"nofunds",lines:t.map(u=>({item:u.item,priceCredits:u.priceCredits,quantity:u.quantity})),shortfall:d}),_(!1)}async function Ee(t){if(!n||t.length===0)return;const a=je(t),d=a.map(y=>({...y.item,priceCredits:y.priceCredits})),c=t.map(y=>({...y.item,priceCredits:y.priceCredits,quantity:y.quantity})),u=[];let h="authorize";const w=new Set,S=new Set,R=new Set,E=[];let q=!1;j({phase:"processing",stage:"reserving",step:1,total:a.length});try{const y=[];for(let m=0;m<a.length;m++){const x=a[m];j({phase:"processing",stage:"reserving",step:m+1,total:a.length});try{const M=x.acquisition==="trade"?x.trade.id:void 0,C=x.item.contractAddress&&x.item.itemId!=null?{contractAddress:x.item.contractAddress,itemId:String(x.item.itemId)}:void 0,{credit:N,maxCreditedValue:X}=await pt(n.identity,x.usdCents,M,C);u.push({salt:N.id,itemId:x.item.id}),y.push(x.acquisition==="store"?{kind:"store",item:{collection:x.item.contractAddress,itemId:String(x.item.itemId),priceWei:x.priceWei},credits:[N],maxCreditedValue:X,chainId:x.item.chainId}:{kind:"trade",trade:x.trade,credits:[N],maxCreditedValue:X})}catch(M){if(Ms(M)){if(u.length){try{await Re(n.identity,u.map(C=>C.salt))}catch(C){ae(C,{flow:"cart_checkout",step:"release"})}b.invalidateQueries({queryKey:["usd-balance"]})}Je(t);return}throw M}}h="submit";const g=ys(y).length,k=m=>g>1?{current:m,total:g}:void 0,F=(m,x)=>j({phase:"processing",stage:m,step:a.length,total:a.length,signatures:k(x)}),K=m=>m<g?F("awaiting-signature",m+1):F("settling",g);F("awaiting-signature",1);let f=[];const v=y.some(m=>m.kind==="store"),U=y.flatMap(m=>m.kind==="trade"?[m]:[]);if(us()&&!v)try{const m=new Map;f=await bs({purchases:U,buyer:n.address,signer:n.signer,onSigned:()=>K(g),onBroadcast:({txHash:C,salts:N})=>{m.set(C,N),N.forEach(X=>w.add(X))}});const x=await Promise.allSettled(f.map(C=>vs(C)));x.forEach((C,N)=>{const X=m.get(f[N])??[];C.status==="fulfilled"?(X.forEach(Be=>S.add(Be)),E.push(f[N])):C.reason instanceof vt||X.forEach(Be=>R.add(Be))});const M=x.flatMap(C=>C.status==="rejected"?[C.reason]:[]);if(M.length&&!M.some(C=>C instanceof vt))throw M[0];q=!0}catch(m){if(!(m instanceof ws))throw m;f=await Le({purchases:y,buyer:n.address,signer:n.signer,onSigned:K,onBroadcast:({salts:x})=>x.forEach(M=>w.add(M)),onSettled:({txHash:x,salts:M})=>{M.forEach(C=>S.add(C)),E.push(x)},onReverted:({salts:x})=>x.forEach(M=>R.add(M))})}else f=await Le({purchases:y,buyer:n.address,signer:n.signer,onSigned:K,onBroadcast:({salts:m})=>m.forEach(x=>w.add(x)),onSettled:({txHash:m,salts:x})=>{x.forEach(M=>S.add(M)),E.push(m)},onReverted:({salts:m})=>m.forEach(x=>R.add(x))});t.forEach(m=>l(m.item.id)),H(null),G("Shop Completed Purchase",{...ye(d),payment_type:"credits",no_crypto_step:q,transaction_hash:f[0]??null}),bt(b);const ce=oe.current;oe.current=null,j(null),_(!1);const _e={items:c,txHash:f[0]??void 0,txHashes:f,settled:!0,...ce?{creditsAdded:ce}:{}};ee("/success",{state:_e,replace:!0})}catch(y){be(y)||ae(y,{flow:"cart_checkout",step:h,cart_size:t.length});const g=new Set([...w].filter(v=>!R.has(v))),{toRelease:k,boughtItemIds:F}=wt({reservations:u,spent:g,settled:S}),K=d.filter(v=>F.includes(v.id)),f=d.filter(v=>!F.includes(v.id));if(G(be(y)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:h,error_code:gt(y),value_usd:ut(f.reduce((v,U)=>v+U.priceCredits,0)),cart_size:a.length,partial:K.length>0}),k.length)try{await Re(n.identity,k)}catch(v){ae(v,{flow:"cart_checkout",step:"release"})}if(b.invalidateQueries({queryKey:["usd-balance"]}),K.length>0){F.forEach(v=>l(v)),H(null),bt(b),G("Shop Completed Purchase",{...ye(K),payment_type:"credits",no_crypto_step:q,transaction_hash:E[0]??null,partial:!0}),j({phase:"error",message:s("cart.error.partiallyBought")}),_(!1);return}j({phase:"error",message:Ke(y)})}}function Xe(t,a){b.invalidateQueries({queryKey:["usd-balance"]}),b.invalidateQueries({queryKey:["detail-trade"]}),b.invalidateQueries({queryKey:["shop-item"]}),b.invalidateQueries({queryKey:["owned-token"]}),b.invalidateQueries({queryKey:["public-token"]}),b.invalidateQueries({queryKey:["item-resales"]}),b.invalidateQueries({queryKey:["shop-items"]}),b.invalidateQueries({queryKey:["catalog-items"]}),b.invalidateQueries({queryKey:["my-assets"]}),b.invalidateQueries({queryKey:["purchases"]}),b.invalidateQueries({queryKey:["owned-item-count"]}),b.invalidateQueries({queryKey:["overview-listings"]}),b.invalidateQueries({queryKey:["upsell-listings"]});const d=oe.current;oe.current=null,j(null),_(!1);const c={items:t,txHash:a[0]??void 0,txHashes:a,settled:!0,...d?{creditsAdded:d}:{}};ee("/success",{state:c,replace:!0})}function Ze(t,a){be(t)||ae(t,{flow:a,step:"submit"}),G(be(t)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:gt(t)}),j({phase:"error",message:Ke(t)}),_(!1)}async function Yt(t,a){const d=ve(We.MANAToken,a),c=ve(We.CreditsManager,a);await xs({auth:{kind:ms.Allowance,contractAddress:d.address,spenderAddress:c.address,chainId:a},signer:t})}async function et(){if(re)return re;try{return await b.fetchQuery({queryKey:["mana-rate",ht.chainId],queryFn:()=>ls(ht.chainId),staleTime:6e4})}catch{return}}async function Jt(t){const a=je(t).reduce((h,w)=>h+w.usdCents,0),c=(pe??0n)>0n?await et():re,u=c?Ct(a,c):0n;return{totalCents:a,manaWei:u}}async function tt(t,a){const d=Ue(t),{totalCents:c,manaWei:u}=await Jt(t),h=Fe({priceCents:c,priceManaWei:u,balanceCents:($==null?void 0:$.balanceCents)??0,manaBalanceWei:pe??0n}),w=Ht(t)?{...h,options:h.options.filter(S=>S.method==="credits")}:h;if(a&&w.options.some(S=>S.method===a)){if(a==="credits"){Ee(t);return}const{spender:S,chainId:R}=at(a,t);await st(S,R,()=>a==="mana"?void nt(t):void it(t,c,u));return}if(w.options.some(S=>S.method==="mana"||S.method==="combined")){j({phase:"choose",lines:t,totalCents:c,manaWei:u}),_(!1);return}if($!=null&&$.credits<d){Je(t);return}Ee(t)}function Xt(t){return Fe({priceCents:t.totalCents,priceManaWei:t.manaWei,balanceCents:($==null?void 0:$.balanceCents)??0,manaBalanceWei:pe??0n})}const[qe,fe]=P.useState(null);function at(t,a){const d=Ae(a)[0].trade;return{spender:t==="mana"?ve(ya(d.contract),d.chainId).address:ve(We.CreditsManager,d.chainId).address,chainId:d.chainId}}async function st(t,a,d){const c=hs(a,t),u=n?await ps(c,n.address).catch(()=>!0):!0;if(gs(n==null?void 0:n.providerType,u)){_(!1),fe({auth:c,run:d});return}d()}function Zt(t){if((p==null?void 0:p.phase)!=="choose")return;const{lines:a,totalCents:d,manaWei:c}=p;if(t==="credits"){Ee(a);return}const{spender:u,chainId:h}=at(t,a);st(u,h,()=>t==="mana"?void nt(a):void it(a,d,c))}async function nt(t){if(!n||t.length===0)return;const a=je(t),d=a.map(h=>({...h.item,priceCredits:h.priceCredits})),c=t.map(h=>({...h.item,priceCredits:h.priceCredits,quantity:h.quantity})),u=()=>j({phase:"processing",stage:"settling",step:a.length,total:a.length});j({phase:"processing",stage:"awaiting-signature",step:a.length,total:a.length});try{const h=await rs({trades:Ae(a).map(w=>w.trade),buyer:n.address,signer:n.signer,onSigned:u});t.forEach(w=>l(w.item.id)),H(null),G("Shop Completed Purchase",{...ye(d),payment_type:"mana",transaction_hash:h[0]??null}),b.invalidateQueries({queryKey:["mana-balance"]}),Xe(c,h)}catch(h){Ze(h,"buy_cart_mana")}}async function it(t,a,d){if(!n||t.length===0)return;const c=je(t),u=c.map(g=>({...g.item,priceCredits:g.priceCredits})),h=t.map(g=>({...g.item,priceCredits:g.priceCredits,quantity:g.quantity})),w=os(c.map(g=>g.usdCents),($==null?void 0:$.balanceCents)??0),S=w.reduce((g,k)=>g+k,0),R=cs(Math.max(0,a-S),a,d),E=[],q=new Set,y=new Set;j({phase:"processing",stage:"reserving",step:1,total:c.length});try{const g=Ae(c),k=[];for(let f=0;f<g.length;f++){const v=w[f];if(v<=0)continue;j({phase:"processing",stage:"reserving",step:f+1,total:g.length});const U=g[f].item,{credit:ce,maxCreditedValue:_e}=await pt(n.identity,v,g[f].trade.id,U.contractAddress&&U.itemId!=null?{contractAddress:U.contractAddress,itemId:String(U.itemId)}:void 0);E.push({salt:ce.id,itemId:U.id}),k.push({kind:"trade",trade:g[f].trade,credits:[ce],maxCreditedValue:_e})}g.forEach((f,v)=>{w[v]<=0&&k.push({kind:"trade",trade:f.trade,credits:[],maxCreditedValue:"0"})}),k[0]={...k[0],maxCreditedValue:(BigInt(k[0].maxCreditedValue)+R).toString()},await Yt(n.signer,g[0].trade.chainId);const F=()=>j({phase:"processing",stage:"settling",step:c.length,total:c.length});j({phase:"processing",stage:"awaiting-signature",step:c.length,total:c.length});const K=await Le({purchases:k,buyer:n.address,signer:n.signer,onSigned:F,onBroadcast:({salts:f})=>f.forEach(v=>q.add(v)),onReverted:({salts:f})=>f.forEach(v=>y.add(v))});t.forEach(f=>l(f.item.id)),H(null),G("Shop Completed Purchase",{...ye(u),payment_type:"credits_and_mana",transaction_hash:K[0]??null}),b.invalidateQueries({queryKey:["mana-balance"]}),Xe(h,K)}catch(g){const{toRelease:k}=wt({reservations:E,spent:new Set([...q].filter(F=>!y.has(F))),settled:new Set});k.length&&Re(n.identity,k).catch(()=>{}),E.length&&b.invalidateQueries({queryKey:["usd-balance"]}),Ze(g,"buy_cart_combined")}}async function te(t){if(!n){yt({type:"cart-checkout"}),L();return}const a=Q.getState().items.filter(Ge);if(a.length===0)return;ie(null),he(null),_(!0);const d=a.reduce((c,u)=>c+u.priceCredits*u.quantity,0);G("Shop Started Checkout",{cart_size:a.length,cart_value_credits:d,cart_value_usd:ut(d),has_sufficient_credits:ge>=d});try{const c=await ks(a,n.address,Vt,await et(),Gt),u=[...c.unavailable,...c.own];if(u.length&&(u.forEach(h=>l(h.id)),he(qn(c))),c.buyable.length===0){ie(s("cart.error.noneAvailable")),H(null);return}if(c.orderChanged){H(c),Oe.current=Date.now();return}await tt(c.buyable,t)}catch(c){ae(c,{flow:"cart_checkout",step:"review",cart_size:a.length}),ie(Ke(c))}finally{_(!1)}}async function rt(){if(B){if(!n){yt({type:"cart-checkout"}),L();return}if(Date.now()-Oe.current>En){H(null),he(null),await te();return}ie(null),tt(B.buyable)}}async function ea(){if(Te){try{sessionStorage.setItem(we,JSON.stringify(Q.getState().items))}catch{}_(!0);try{const t=await $s(Te,n?{address:n.address,identity:n.identity}:void 0);if(t.url){window.location.href=t.url;return}ee("/credits")}catch(t){try{sessionStorage.removeItem(we)}catch{}ae(t,{flow:"cart_buy_credits"}),j({phase:"error",message:s("buyModal.error.creditsCheckout")})}finally{_(!1)}}}const ot=P.useRef(!1);P.useEffect(()=>{if(!n||ot.current||!as("cart-checkout"))return;ot.current=!0;const t=setTimeout(()=>void te(),0);return()=>clearTimeout(t)},[n]);const ct=P.useRef(!1);P.useEffect(()=>{if(!(J!=null&&J.resumeCheckout)||ct.current)return;ct.current=!0,oe.current=J.creditsAdded??null;try{const a=sessionStorage.getItem(we);if(a){sessionStorage.removeItem(we);const d=JSON.parse(a);Array.isArray(d)&&d.length&&D(d)}}catch{}b.invalidateQueries({queryKey:["usd-balance"]});const t=setTimeout(()=>void te(),0);return()=>clearTimeout(t)},[J==null?void 0:J.resumeCheckout]);const V=Ft||(p==null?void 0:p.phase)==="processing";return o.length===0&&!p?e.jsx(jt,{children:e.jsxs($t,{children:[e.jsxs(kt,{onClick:()=>ee(-1),type:"button",children:[e.jsx(O,{name:"arrow-left"}),s("nav.cart")]}),e.jsxs(Us,{"data-testid":"cart-empty",children:[e.jsx(O,{name:"cart-plus",size:110}),e.jsxs(Ns,{children:[e.jsx(Qs,{children:s("cart.empty.title")}),e.jsx(Os,{children:s("cart.empty.body")})]}),e.jsx(Hs,{to:"/items",children:s("cart.empty.cta")})]})]})}):e.jsxs(jt,{children:[e.jsxs($t,{children:[e.jsxs(kt,{onClick:()=>ee(-1),type:"button",children:[e.jsx(O,{name:"arrow-left"}),s("nav.cart")]}),e.jsxs(Fs,{children:[e.jsxs(Ls,{children:[e.jsxs(Ks,{children:[e.jsx(Vs,{onClick:()=>ee(-1),type:"button","aria-label":s("cart.goBack"),children:e.jsx(O,{name:"arrow-left"})}),e.jsx(Gs,{children:s("cart.panelTitle",{count:Kt})}),Rt?e.jsxs(Ds,{onClick:()=>Y(!0),disabled:V,children:[e.jsx(O,{name:"fitting-room"}),s("cart.fittingRoom")]}):null]}),e.jsxs(At,{children:[e.jsx(Ys,{children:o.map(t=>{const a=Qt.get(t.id),d=a?a.priceCredits:t.priceCredits,c=!!a&&a.priceCredits!==t.priceCredits,u=!t.tokenId,h=t.quantity,w=typeof t.available=="number"&&h>=t.available,S=d*h,R=ha(t),E=!!R&&!!A[R],q=pa(t),y=Ve[t.id],g=!lt(y),k=y==="sold-out"?s("cart.availability.soldOut"):s("cart.availability.unavailable");return e.jsxs(Js,{"data-unavailable":g||void 0,children:[e.jsxs(Xs,{"data-thumb":!0,children:[q?e.jsx(Zs,{to:q,state:{item:t,tradeId:t.tradeId},"aria-label":t.name,children:t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:t.name}):null}):t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:t.name}):null,e.jsx(en,{"data-check":!0,"aria-hidden":!0,children:e.jsx("svg",{viewBox:"0 0 20 20",width:"12",height:"12",children:e.jsx("path",{d:"M5 10.5l3 3 7-7.5",fill:"none",stroke:"#fff",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),e.jsxs(tn,{children:[e.jsxs(an,{"data-desc":!0,children:[q?e.jsx(nn,{to:q,state:{item:t,tradeId:t.tradeId},title:t.name,children:t.name}):e.jsx(sn,{title:t.name,children:t.name}),t.creator?e.jsx(rn,{address:t.creator,linkToProfile:!0}):null,Bt&&u?e.jsxs(fn,{"data-testid":"cart-creator-tag",children:[e.jsx(yn,{name:"buy-from-creator"}),s("cart.creatorTag")]}):null]}),e.jsx(on,{children:g?e.jsxs(e.Fragment,{children:[e.jsxs(gn,{children:[e.jsx(xn,{name:"warning-fill",size:24}),k]}),q?e.jsx(mn,{to:q,state:{item:t,tradeId:t.tradeId},children:s("cart.availability.viewResales")}):null]}):e.jsxs(e.Fragment,{children:[u?e.jsxs(cn,{children:[e.jsx(St,{onClick:()=>me(()=>z(t.id)),disabled:V||h<=1,"aria-label":s("cart.decreaseQuantity",{name:t.name}),children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:e.jsx("path",{d:"M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),e.jsx(dn,{children:h}),e.jsx(St,{onClick:()=>me(()=>I(t.id)),disabled:V||w,"aria-label":s("cart.increaseQuantity"),children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:e.jsx("path",{d:"M8 3.5v9M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}):null,e.jsxs(ln,{children:[e.jsx(un,{})," ",S,c?e.jsx(hn,{children:t.priceCredits*h}):null]})]})})]}),e.jsxs(pn,{children:[R?e.jsx(bn,{"data-on":E||void 0,onClick:()=>ne(t),"aria-label":E?s("cart.removeFromFavorites",{name:t.name}):s("cart.addToFavorites",{name:t.name}),title:E?s("assetCard.removeFromFavorites"):s("assetCard.addToFavorites"),children:e.jsx(O,{name:E?"heart-solid":"heart"})}):null,e.jsx(vn,{onClick:()=>me(()=>l(t.id)),disabled:V,"aria-label":s("cart.remove",{name:t.name}),title:s("cart.removeTitle"),children:e.jsx(O,{name:"trash",size:24})})]})]},t.id)})}),e.jsx(wn,{children:e.jsx("button",{className:"link",onClick:()=>me(W),disabled:V,children:s("cart.clearCart")})})]})]}),e.jsxs(Cn,{children:[e.jsx(jn,{children:s("cart.purchaseSummary")}),e.jsxs(kn,{children:[e.jsxs($n,{children:[e.jsx(Sn,{children:s("cart.totalItems",{count:Ut})}),e.jsx(Tn,{children:e.jsxs(Mn,{children:[e.jsx(In,{})," ",De]})})]}),xe.options.length>0||xe.manaShortfall?e.jsx(Tt,{options:xe.options,totalCents:ze,shortfall:xe.manaShortfall,creditsLabel:B?s("marketCheckout.confirmPurchase"):s("cart.buyWithCredits"),busy:V||Pe,onPay:t=>void(B?rt():te(t))}):e.jsx(Pn,{onClick:()=>void(B?rt():te()),disabled:V||Pe,children:V?s("cart.working"):B?s("marketCheckout.confirmPurchase"):s("cart.checkout")}),Pe?e.jsx(Ce,{className:"muted",children:s("cart.allUnavailable")}):null,n?null:e.jsx(Ce,{className:"muted",children:s("cart.signInHint")}),B?e.jsx(Ce,{className:"muted",children:s("cart.priceChanged")}):null,Qe?e.jsx(Ce,{className:"muted",children:Qe}):null,e.jsx(zn,{message:Wt})]})]})]})]}),Ye.length>0?e.jsx(An,{children:e.jsx(ss,{title:s("cart.youMightAlsoLike"),items:Ye})}):null,qe&&n?e.jsx(ns,{auth:qe.auth,signer:n.signer,title:s("authorizeStep.manaTitle"),name:s("authorizeStep.manaName"),reason:s("authorizeStep.manaReason"),icon:e.jsx("img",{src:is,width:24,height:24,alt:"","aria-hidden":!0}),onAuthorized:()=>{const{run:t}=qe;fe(null),t()},onCancel:()=>fe(null),onClose:()=>fe(null)}):null,p?e.jsx(Bs,{phase:p.phase,balanceCredits:ge,onClose:Dt,stage:p.phase==="processing"?p.stage:void 0,step:p.phase==="processing"?p.step:void 0,total:p.phase==="processing"?p.total:void 0,isSelfCustody:ga(n==null?void 0:n.providerType),signatures:p.phase==="processing"?p.signatures:void 0,options:p.phase==="choose"?Xt(p).options:void 0,onPay:Zt,totalCents:p.phase==="choose"?p.totalCents:void 0,totalManaWei:p.phase==="choose"?p.manaWei:void 0,totalCredits:p.phase==="choose"?Ue(p.lines):void 0,lines:p.phase==="nofunds"?p.lines:void 0,shortfallCredits:p.phase==="nofunds"?p.shortfall:void 0,packs:ue,selectedPack:Te,onSelectPack:He,onBuyPacks:()=>void ea(),message:p.phase==="error"?p.message:void 0,onRetry:()=>void te()}):null]})}export{Zn as Cart};
|