@dcl/shop 0.10.1-31042990976.commit-7edc9b6 → 1.0.0
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-CJO4ONwi.js +371 -0
- package/_assets/AnimatedBackground-CHiOSgJ6.js +97 -0
- package/_assets/{Assets-BzPVRWYe.js → Assets-1KVsmH01.js} +8 -8
- package/_assets/{Assets.styles-D4-S4NWG.js → Assets.styles-BUHnZ7Nb.js} +140 -132
- package/_assets/{Authorizations-gGXOHHeT.js → Authorizations-BGlyC4dr.js} +28 -26
- package/_assets/Cart-afrKtZvj.js +707 -0
- package/_assets/{CircularProgress-DNShuaaC.js → CircularProgress-K7JjSpPZ.js} +1 -1
- package/_assets/{Collection-CI_bqtk6.js → Collection-B0G71rJV.js} +19 -19
- package/_assets/CollectionCarousel-B4hzcKRb.js +816 -0
- package/_assets/{Confetti-DkcOmptO.js → Confetti-BBhDY6Q2.js} +1 -1
- package/_assets/{Creator-CFf63R4B.js → Creator-CYC3eVKx.js} +7 -7
- package/_assets/{ErrorNotice-C_rQ_hZp.js → ErrorNotice-CnPcFEw_.js} +1 -1
- package/_assets/{ExchangeController-BPF_kkCP.js → ExchangeController-BAefeOHy.js} +1 -1
- package/_assets/{Faq--E1fBOzk.js → Faq-D03YByjo.js} +20 -14
- package/_assets/{GetCredits-C2rjzPBY.js → GetCredits-Cyw0rRMV.js} +114 -80
- package/_assets/{Grow-CyHu9l8s.js → Grow-CPwRVF9g.js} +1 -1
- package/_assets/{HelpersUtil-Bh7qiwp_.js → HelpersUtil-DJC0aWJi.js} +1 -1
- package/_assets/{ItemDetail-CtR1YHPh.js → ItemDetail-DSuMCjR9.js} +510 -480
- package/_assets/LazyEmoteControls-D-xqLU4A.js +2 -0
- package/_assets/{LoadMore-BQIcG-2Y.js → LoadMore-CMAFsns3.js} +1 -1
- package/_assets/ManaPricingBanner.styles-Bb7BS6EM.js +93 -0
- package/_assets/{MyAssets-Dk_4queh.js → MyAssets-C5lGRPqP.js} +33 -33
- package/_assets/{MyFavorites-yuyxKJv4.js → MyFavorites-C1t1o6Li.js} +12 -11
- package/_assets/{NotFound-rquTctww.js → NotFound-Bdi_fN5j.js} +1 -1
- package/_assets/{NotificationsBell-CFCmzqHj.js → NotificationsBell-BQk3EV9b.js} +1 -1
- package/_assets/{OutfitDetail-BFc4wS6X.js → OutfitDetail-D3Mwl6KR.js} +4 -4
- package/_assets/{OutfitPreview-C214293j.js → OutfitPreview-BpWwkAro.js} +2 -2
- package/_assets/{OutfitStudio-OOy9Y3VP.js → OutfitStudio-BL7OYD9h.js} +1 -1
- package/_assets/{StoreSettings-BpkjL6md.js → StoreSettings-BNhzJJib.js} +1 -1
- package/_assets/{Success-BXjczKuA.js → Success-Cnu7oCbI.js} +1 -1
- package/_assets/{SwapController-CA7wAH0n.js → SwapController-BD23YCPw.js} +1 -1
- package/_assets/{Tooltip-BoJS18Z3.js → Tooltip-tAvMrdFp.js} +1 -1
- package/_assets/{TradeService-DsmKoPxy.js → TradeService-a2JgoWq2.js} +1 -1
- package/_assets/{W3MFrameProviderSingleton-DKeivVWe.js → W3MFrameProviderSingleton-CPDmjNiA.js} +3 -3
- package/_assets/{WebCryptoP256-CJPdW9Ug.js → WebCryptoP256-DIEJtB0I.js} +1 -1
- package/_assets/{authorizations-2Xd-ft_C.js → authorizations-HgwrWkaa.js} +1 -1
- package/_assets/{basic-CpO7N7NV.js → basic-B3qEjJvY.js} +1 -1
- package/_assets/{biconomy-HF5uwOUc.js → biconomy-CzcDC8vB.js} +1 -1
- package/_assets/{builder-uBBMnbtK.js → builder-TZGldT6a.js} +1 -1
- package/_assets/{buy-CgUGATyG.js → buy-CuFubBZY.js} +1 -1
- package/_assets/{buy-gasless-CVTH5KGZ.js → buy-gasless-DO6cBuJ3.js} +1 -1
- package/_assets/{categories-yTyOCTA2.js → categories-B3DJZe02.js} +54 -54
- package/_assets/{ccip-Bq1h60c1.js → ccip-CB03B_MW.js} +1 -1
- package/_assets/{ccip-BjT8ndU2.js → ccip-VI2-jJnV.js} +1 -1
- package/_assets/collectionPage.styles-DXfFyRiH.js +49 -0
- package/_assets/{controller-CBtSaaQD.js → controller-CEo6ipG_.js} +2 -2
- package/_assets/{core-CIuOeePP.js → core-DmqfUS4f.js} +4 -4
- package/_assets/{createSvgIcon-Dax4uwaL.js → createSvgIcon-WfOAVB94.js} +4 -4
- package/_assets/{custom-CYUokIbm.js → custom-bIxIBqCn.js} +1 -1
- package/_assets/{data-capture-6P55-IaB.js → data-capture-Dtaj6ehs.js} +1 -1
- package/_assets/disposePreview-5vjiqVZ0.js +1 -0
- package/_assets/{email-nYmfz15C.js → email-DBXWS-p0.js} +1 -1
- package/_assets/{embedded-wallet-D_e_UWzV.js → embedded-wallet-DqlpsZRk.js} +1 -1
- package/_assets/{emotion-styled.browser.esm-s1GWUoDX.js → emotion-styled.browser.esm-pOAX0dMa.js} +1 -1
- package/_assets/{engine-CpLQoIqI.js → engine-gP8vp-2g.js} +1 -1
- package/_assets/{errors-hu6Xw0D2.js → errors-WNvNILsF.js} +1 -1
- package/_assets/{estimate-l1-fee-CLRDa6fI.js → estimate-l1-fee-X1cvAsdL.js} +1 -1
- package/_assets/{execute-DqPg9Ksw.js → execute-V2l_cDAW.js} +2 -2
- package/_assets/{features-BtrrmffG.js → features-CFR_-yBt.js} +1 -1
- package/_assets/{fetchTokenMetadata-DFJ36WnI.js → fetchTokenMetadata-Do5GLuIQ.js} +2 -2
- package/_assets/{field.styles-XpeJ0COA.js → field.styles-ciG_OcBi.js} +1 -1
- package/_assets/{get-ecosystem-wallet-info-DlCx83R8.js → get-ecosystem-wallet-info-CyDTxLgQ.js} +1 -1
- package/_assets/{getBalance-B5ocM9g2.js → getBalance-7wKu8RUe.js} +1 -1
- package/_assets/{getNFT-oiyevCuO.js → getNFT-BbpUiMXR.js} +1 -1
- package/_assets/{getNFT-DBaH5cpy.js → getNFT-DecLUThv.js} +1 -1
- package/_assets/{grid.styles-Dpb8Greh.js → grid.styles-Caahz6PS.js} +1 -1
- package/_assets/{hashTypedData-CeLfcFPQ.js → hashTypedData-C9kgxiiE.js} +1 -1
- package/_assets/{hashTypedData-NanWeJ-D.js → hashTypedData-Ca524zaX.js} +1 -1
- package/_assets/hero-credits-mobile-C9Muog4T.webp +0 -0
- package/_assets/{in-app-DfEVZ7ts.js → in-app-B-disnkm.js} +1 -1
- package/_assets/{in-app-wallet-calls-CaankqgP.js → in-app-wallet-calls-3yighozE.js} +1 -1
- package/_assets/{index-De-xiANX.js → index--1pBMb8n.js} +1 -1
- package/_assets/{index-BNnBkkJr.js → index-2-BWsekC.js} +1 -1
- package/_assets/{index-DxUWfPTE.js → index-8xcbpK09.js} +1 -1
- package/_assets/{index-Dyf04oQ8.js → index-B6l73M7K.js} +1 -1
- package/_assets/{index-BJ6fvgAM.js → index-BBX5Tona.js} +1 -1
- package/_assets/{index-_l18b6D8.js → index-BLCTVSaC.js} +1 -1
- package/_assets/{index-CYd-9A8i.js → index-BMFVFrWl.js} +3 -3
- package/_assets/{index-CaH_IfZ9.js → index-BQB7qYN1.js} +1 -1
- package/_assets/index-BYP7oMPZ.css +1 -0
- package/_assets/{index-BMGdvlP9.js → index-Bd7SNoIN.js} +2 -2
- package/_assets/{index-OiVd03k_.js → index-BdQllJHM.js} +1 -1
- package/_assets/{index-Cbb2oZ2Y.js → index-BjEDpwxR.js} +1 -1
- package/_assets/{index-B4WRMX84.js → index-BrU_i04f.js} +1 -1
- package/_assets/{index-BGSoCmOn.js → index-BuImQh6o.js} +1 -1
- package/_assets/{index-COqbI5lZ.js → index-C3MGLBUO.js} +1 -1
- package/_assets/index-C616xNgB.js +3699 -0
- package/_assets/{index-DI0-gUeO.js → index-CAl290ro.js} +1 -1
- package/_assets/{index-BPoXI4qO.js → index-CEDBhmGn.js} +1 -1
- package/_assets/{index-C8Cm7Ukd.js → index-CEnhHz30.js} +1 -1
- package/_assets/{index-BC1n3NBn.js → index-CFziwAGz.js} +1 -1
- package/_assets/{index-DJxot5zE.js → index-CGcb9Mz3.js} +1 -1
- package/_assets/{index-DxD-NQZ2.js → index-CKkE-eRE.js} +1 -1
- package/_assets/{index-cpjoojGa.js → index-CONyzZZC.js} +3 -3
- package/_assets/{index-BHzYL11-.js → index-CO_xP_3N.js} +1 -1
- package/_assets/{index-BqVSjccZ.js → index-CUAEZ5zJ.js} +1 -1
- package/_assets/index-CZBUgvRB.js +1 -0
- package/_assets/{index-BXdpk7Oq.js → index-CdFrv2eV.js} +1 -1
- package/_assets/{index-zPBk9zxn.js → index-CjhGjrdW.js} +1 -1
- package/_assets/{index-w9D58X3R.js → index-CmlH9TBP.js} +1 -1
- package/_assets/{index-enm6a-Yh.js → index-CyITvpDL.js} +1 -1
- package/_assets/{index-UiKz3U--.js → index-D58OkhU1.js} +1 -1
- package/_assets/{index-BKYIrw8q.js → index-D9iAFl4E.js} +1 -1
- package/_assets/{index-CWMeoaW8.js → index-DCAUOF_r.js} +1 -1
- package/_assets/{index-B-kvIPu1.js → index-DCMLwiSR.js} +1 -1
- package/_assets/{index-CPOch-_L.js → index-DEw1jYQT.js} +1 -1
- package/_assets/{index-Bry4nBQ3.js → index-DJOlt1Iv.js} +1 -1
- package/_assets/{index-Bu9Qy6np.js → index-DKghJgJj.js} +1 -1
- package/_assets/{index-CaRe7gid.js → index-DNvcQt0s.js} +3 -3
- package/_assets/{index-jzVm2M_d.js → index-DRI1gQSo.js} +1 -1
- package/_assets/{index-gR7VkXwX.js → index-DUmo7598.js} +3 -3
- package/_assets/{index-BccvdHMd.js → index-Dag4zALf.js} +1 -1
- package/_assets/index-DsH_mBtT.js +622 -0
- package/_assets/{index-BntzHAg5.js → index-DvjyzmjB.js} +1 -1
- package/_assets/{index-T6PQTPj1.js → index-DxB85HDB.js} +1 -1
- package/_assets/{index-ChhX0J8g.js → index-Eip3e8N8.js} +1 -1
- package/_assets/{index-CQMg581G.js → index-Gw3Mauv_.js} +1 -1
- package/_assets/{index-CkvT2_Qp.js → index-JuH5W7YS.js} +2 -2
- package/_assets/{index-D9avTVnT.js → index-N5sgh9IC.js} +1 -1
- package/_assets/{index-CIJje8vF.js → index-o0b8cjRQ.js} +1 -1
- package/_assets/{index-Deo0xkWr.js → index-p0fxtTsZ.js} +2 -2
- package/_assets/{index-FaWeourd.js → index-p4Ph7ugv.js} +1 -1
- package/_assets/{index-B0jVlmk0.js → index-tCYP1O3W.js} +1 -1
- package/_assets/{index-BZQS2qMR.js → index-yiECqJCb.js} +1 -1
- package/_assets/{index.es-DZrZt1nk.js → index.es-C5PJ78RX.js} +1 -1
- package/_assets/{index.es-COh1P5q0.js → index.es-D73EniUm.js} +1 -1
- package/_assets/{index.es-DKfCNVgZ.js → index.es-DF_hlZIu.js} +4 -4
- package/_assets/{localBatchGatewayRequest-BI4PJuWG.js → localBatchGatewayRequest-DvkdRgNo.js} +1 -1
- package/_assets/{networks-Blxn8DDe.js → networks-7b-i0dnd.js} +1 -1
- package/_assets/{onramp-Dy-wl2-G.js → onramp-CoF8bFaS.js} +1 -1
- package/_assets/{openzeppelin-BMYbmCTg.js → openzeppelin-DcsEW8tQ.js} +1 -1
- package/_assets/{parseNft-C3NZ6wub.js → parseNft-CNJ2CwyE.js} +2 -2
- package/_assets/{parseSignature-DYiE9TKW.js → parseSignature-D0-1k6Yx.js} +1 -1
- package/_assets/{parseSignature-C_OIotiZ.js → parseSignature-whU_pkfu.js} +3 -3
- package/_assets/{passkeys-B1XwJZLc.js → passkeys-SqHHDvyI.js} +1 -1
- package/_assets/{pay-with-exchange-CNHEYWhj.js → pay-with-exchange-Cvr7dd94.js} +1 -1
- package/_assets/promo-best-rated-emotes-C6kNvB-a.png +0 -0
- package/_assets/promo-week-selected-outfits-BBmkZYZx.png +0 -0
- package/_assets/{qr-overlay-xYKFPsA7.js → qr-overlay-HlBTd234.js} +1 -1
- package/_assets/{receive-CZ46hzUV.js → receive-HPltMi_i.js} +1 -1
- package/_assets/{resolveImplementation-CjcXKJyr.js → resolveImplementation-CM1yFlGf.js} +1 -1
- package/_assets/{rpc-CcyaVsGv.js → rpc-CPS_djFB.js} +1 -1
- package/_assets/{secp256k1-CKJqWWFY.js → secp256k1-CQmdb_AD.js} +1 -1
- package/_assets/{secp256k1-CtAF_8et.js → secp256k1-ChRNiO68.js} +1 -1
- package/_assets/{secp256k1-ZiNVKyYC.js → secp256k1-DUTfCpIK.js} +1 -1
- package/_assets/{send-batch-transaction-BjDzAjfB.js → send-batch-transaction-Vn4JOFM5.js} +1 -1
- package/_assets/{send-eip712-transaction-C_cuPsBN.js → send-eip712-transaction-Qvibiwhe.js} +2 -2
- package/_assets/{send-gasless-transaction-nJMNrEi5.js → send-gasless-transaction-DQLcvFHt.js} +2 -2
- package/_assets/{send-transaction-DlrF4JVI.js → send-transaction-CZ0kapdy.js} +2 -2
- package/_assets/{send-C3JUT-Wt.js → send-zy_Vr6BQ.js} +1 -1
- package/_assets/{sendMetaTransaction-CYTRgQS4.js → sendMetaTransaction-Ba_-1nOk.js} +1 -1
- package/_assets/{sendRawTransaction-CrjHCLLH.js → sendRawTransaction-BUz1EYd8.js} +3 -3
- package/_assets/{serializeTransaction-DCwr_uqm.js → serializeTransaction-B8qCVIIu.js} +1 -1
- package/_assets/{session-proposal-Cr_4TYaU.js → session-proposal-BqO43SKO.js} +1 -1
- package/_assets/{session-request-VECe4LIn.js → session-request-DbQI-hjo.js} +2 -2
- package/_assets/{signing-DsQKDYvj.js → signing-CVGndCRE.js} +3 -3
- package/_assets/{skeleton.styles-B5haYcet.js → skeleton.styles-K9f1Sxf1.js} +1 -1
- package/_assets/{socials-B80b3Xbl.js → socials-CNOGl_eO.js} +1 -1
- package/_assets/{styled-qF6AFIDl.js → styled-CljNQW-J.js} +1 -1
- package/_assets/{swaps-9KfTzTvK.js → swaps-D5haogfk.js} +1 -1
- package/_assets/{thirdweb-C31f21KI.js → thirdweb-CC2bk-Up.js} +3 -3
- package/_assets/{to-serializable-transaction-DRO125BM.js → to-serializable-transaction-BB0M9pw8.js} +2 -2
- package/_assets/{transactionReceipt-D2IEagp9.js → transactionReceipt-puJsrtjz.js} +1 -1
- package/_assets/{transactions-COJcFMl1.js → transactions-BnYHwdat.js} +1 -1
- package/_assets/{useCreditPacks-UUgawD-U.js → useCreditPacks-xyyhS_80.js} +1 -1
- package/_assets/{useImportable-DdzyhNKj.js → useImportable-Bh7jH6e9.js} +1 -1
- package/_assets/{useInfiniteGrid-CWAXtPPS.js → useInfiniteGrid-CV4TXaLn.js} +1 -1
- package/_assets/{useTheme-nSt_zjh9.js → useTheme-Czw2-J4G.js} +1 -1
- package/_assets/{verifyHash-3joPxTRt.js → verifyHash-CAYWYGEG.js} +1 -1
- package/_assets/{w3m-modal-fllBGzZL.js → w3m-modal-DtofW43q.js} +1 -1
- package/_assets/{w3m-modal-BdMUp7-V.js → w3m-modal-Fr29zvJe.js} +1 -1
- package/_assets/{wait-for-tx-receipt-DLk5rirA.js → wait-for-tx-receipt-mfzWqQ40.js} +1 -1
- package/_assets/{wallets-p_5_3A7U.js → wallets-DT2LKaVF.js} +5 -5
- package/_assets/{web-connector-B1ItZy3i.js → web-connector-4TZSYYzx.js} +3 -3
- package/_assets/{writeContract-_6f7I-3C.js → writeContract-CEQ0n4-z.js} +1 -1
- package/_assets/{zoraTestnet-BegtFmVb.js → zoraTestnet-Cd1Th5ww.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/_assets/Activity-Cx-gKp62.js +0 -381
- package/_assets/AnimatedBackground-yDvJglBx.js +0 -97
- package/_assets/Cart-C4zUzYSx.js +0 -669
- package/_assets/CollectionCarousel-BAwS8rTZ.js +0 -804
- package/_assets/LazyEmoteControls-BUp4tFZX.js +0 -2
- package/_assets/ManaPricingBanner.styles-Dj_122X4.js +0 -74
- package/_assets/collectionPage.styles-BOOK4JE1.js +0 -48
- package/_assets/disposePreview-C6zVmkpS.js +0 -1
- package/_assets/index-BL2RPpVH.js +0 -3390
- package/_assets/index-C3zA3tgr.js +0 -519
- package/_assets/index-D-NhBWWr.css +0 -1
- package/_assets/index-sW8OdK66.js +0 -1
- package/_assets/packs-backdrop-BcXiUPeP.webp +0 -0
|
@@ -0,0 +1,707 @@
|
|
|
1
|
+
import{j as t,L as ke,r as M,b as ea,a as ta}from"./react-BYHuwl8r.js";import{t as de,s as i,b as a,L as ce,bc as aa,J as sa,I as O,z as St,K as Le,x as na,Y as H,ao as ct,o as ia,q as ra,v as oa,bd as ca,A as da,be as la,ap as ua,bf as ha,bg as dt,bh as pa,bi as ga,y as ma,bj as lt,$ as V,bk as ut,bl as xa,F as ae,r as fa,c as ht,bm as ya,C as ba,bn as pt,bo as Re,bp as va,bq as xe,br as fe,bs as gt,g as ye,f as wa,h as qe,bt as Ca}from"./index-C616xNgB.js";import{M as ja,S as ka,C as $a,H as Sa,a as Ta,T as Ma,X as Ia,b as Pa,B as za,c as Aa,d as mt,e as Ea,f as Ce,P as Tt,m as Ra,g as qa,h as Ba,i as _a,j as Mt,k as je,L as Fa,l as Wa,n as xt,o as ft,W as La,p as Ka,q as Na,A as Ua,r as Qa,s as Ha,t as Oa,u as Ga,v as Va,w as Da,x as Ya,y as Ja,z as Xa,D as Za,E as es,F as ts,G as as,I as ss,J as ns,K as is,N as Be,O as rs,Q as os,R as cs,U as ds,V as yt,Y as bt,Z as ls,_ as us,$ as hs}from"./CollectionCarousel-B4hzcKRb.js";import{k as ps,l as gs,a as ms,n as xs,f as fs,A as ys}from"./authorizations-HgwrWkaa.js";import{g as bs,j as _e}from"./buy-CuFubBZY.js";import{b as vs,w as ws,S as vt,G as Cs}from"./buy-gasless-DO6cBuJ3.js";import{u as js,M as ks,R as be,r as $s,c as Ss,p as wt}from"./useCreditPacks-xyyhS_80.js";import{i as Ts,a as Ms}from"./errors-WNvNILsF.js";import{E as Is}from"./ErrorNotice-CnPcFEw_.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-Ba_-1nOk.js";const{colors:se,radius:Ps}=de,zs=i.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
gap: 8px;
|
|
6
|
+
width: 100%;
|
|
7
|
+
`,As=i.span`
|
|
8
|
+
font-size: 16px;
|
|
9
|
+
line-height: 22px;
|
|
10
|
+
color: ${se.text2};
|
|
11
|
+
text-transform: capitalize;
|
|
12
|
+
white-space: nowrap;
|
|
13
|
+
`,Es=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: ${Ps.btn};
|
|
38
|
+
}
|
|
39
|
+
`,Rs=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
|
+
`,Bs="https://cdn.decentraland.org/@dcl/shop/1.0.0/_assets/buy-error-22UunaPC.png";function _s(o){const{phase:l,balanceCredits:P,onClose:z}=o,W=l==="processing",D=l==="error"?a("cartCheckout.errorTitle"):l==="nofunds"?a("cartCheckout.titleNoFunds"):l==="choose"?a("buyModal.choosePayment"):a("cartCheckout.titleBuy"),Y=l==="processing";return t.jsxs(ja,{role:"dialog","aria-modal":"true","aria-label":a("cartCheckout.dialogAria"),children:[t.jsx(ka,{onClick:W?void 0:z,"aria-hidden":!0}),t.jsxs($a,{"data-tall":Y||void 0,children:[t.jsxs(Sa,{children:[t.jsxs(Ta,{children:[t.jsx(Ma,{children:D}),!W&&t.jsx(Ia,{onClick:z,"aria-label":a("buyModal.close"),children:t.jsx(Pa,{})})]}),t.jsxs(za,{children:[t.jsx(Aa,{children:l==="nofunds"?a("buyModal.dclBalance"):a("buyModal.myCreditsBalance")}),t.jsx(mt,{}),t.jsx(Ea,{children:ce(P)})]})]}),l==="choose"&&t.jsxs(Ce,{children:[t.jsxs(qs,{children:[t.jsx("span",{children:a("cart.purchaseSummary")}),t.jsxs("strong",{children:[t.jsx(mt,{}),ce(o.totalCredits??0)]})]}),t.jsx(Tt,{options:o.options??[],totalCents:o.totalCents??0,onPay:o.onPay??(()=>{}),rateNote:(()=>{const A=Ra(o.totalCents??0,o.totalManaWei??0n);return A!=null?a("buyModal.manaRate",{mana:A.toLocaleString("en",{maximumFractionDigits:2})}):null})()})]}),l==="processing"&&t.jsx(Fs,{stage:o.stage??"reserving",step:o.step??1,total:o.total??1,isSelfCustody:!!o.isSelfCustody,signatures:o.signatures}),l==="nofunds"&&t.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"&&t.jsxs(Ce,{children:[t.jsxs(qa,{"data-testid":"buy-error",children:[t.jsx(Ba,{src:Bs,alt:"",width:64,height:80}),t.jsxs(_a,{children:[t.jsx("b",{children:a("cartCheckout.errorHeadline")})," ",o.message??a("cartCheckout.errorBody")]})]}),t.jsxs(Mt,{children:[t.jsx(je,{"data-variant":"outline",onClick:z,children:a("buyModal.cancel")}),t.jsx(je,{"data-variant":"purple",onClick:o.onRetry??z,children:a("cartCheckout.tryAgain")})]})]})]})]})}function Fs({stage:o,step:l,total:P,isSelfCustody:z,signatures:W}){const D=o==="reserving",Y=P>0?Math.min(100,Math.round(l/P*100)):0,A=z&&W&&W.total>1,ne=o==="awaiting-signature"?z?A?a("cartCheckout.confirmMultiple",{current:W.current,total:W.total}):a("buyModal.confirmToContinue"):a("buyModal.completingTransaction"):o==="settling"?a("buyModal.completingTransaction"):a("cartCheckout.preparing");return t.jsxs(Ce,{"data-processing":!0,children:[t.jsx(Fa,{src:aa,alt:"",width:61,height:61}),t.jsx(Wa,{children:ne}),D?t.jsxs(zs,{children:[t.jsx(xt,{"aria-hidden":!0,children:t.jsx(ft,{"data-step":!0,style:{width:`${Y}%`}})}),P>1?t.jsxs(As,{children:[l,"/",P]}):null]}):t.jsx(xt,{"aria-hidden":!0,children:t.jsx(ft,{})})]})}function Ws({lines:o,shortfallCredits:l,packs:P,selectedPack:z,onSelectPack:W,onBuyPacks:D,onCancel:Y}){const A=P.find(n=>n.id===z),ne=o.reduce((n,K)=>n+(K.quantity??1),0);return t.jsxs(Ce,{children:[t.jsxs(La,{"data-testid":"nofunds-warning",children:[t.jsx(Ka,{}),t.jsxs(Na,{children:[t.jsx("b",{children:a("buyModal.insufficientFunds")})," ",a("buyModal.warningNeedToBuy")," ",t.jsx("b",{children:a("buyModal.warningCreditsAmount",{count:Math.max(0,l)})})," ",a("buyModal.warningToPurchase",{count:ne})]})]}),t.jsx(Es,{children:o.map(n=>{const K=n.quantity??1;return t.jsxs(Ua,{children:[t.jsx(Qa,{children:n.item.thumbnail?t.jsx("img",{src:n.item.thumbnail,alt:""}):null}),t.jsxs(Ha,{children:[t.jsxs("div",{children:[t.jsxs(Oa,{title:n.item.name,children:[n.item.name||a("buyModal.itemFallback"),K>1?t.jsx(Rs,{children:a("cartCheckout.qty",{count:K})}):null]}),n.item.creator?t.jsx(Ga,{address:n.item.creator}):null]}),t.jsxs(Va,{children:[t.jsx(Da,{}),t.jsx("span",{children:ce(n.priceCredits*K)})]})]})]},n.item.id)})}),t.jsx(Ya,{children:P.map(n=>{const K=n.id===z;return t.jsxs(Ja,{"data-testid":"credit-pack","data-on":K||void 0,onClick:()=>W(n.id),children:[t.jsx(Xa,{src:Za,alt:""}),t.jsx(es,{children:ce(n.credits)}),t.jsxs(ts,{children:["($",n.usd.toFixed(2),")"]})]},n.id)})}),t.jsxs(as,{children:[t.jsxs(ss,{children:[t.jsx(ns,{}),t.jsx("span",{children:ce((A==null?void 0:A.credits)??0)})]}),t.jsxs(is,{children:["$",((A==null?void 0:A.usd)??0).toFixed(2)]})]}),t.jsxs(Mt,{children:[t.jsx(je,{"data-variant":"outline",onClick:Y,children:a("buyModal.cancel")}),t.jsx(je,{"data-variant":"gradient",onClick:D,children:a("buyModal.buy")})]})]})}const{colors:r,gradients:It,radius:ee}=de,Pt="@media (max-width: 1080px)",I="@media (max-width: 880px)",Ct=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
|
+
${I} {
|
|
72
|
+
padding-bottom: 188px; /* room for the fixed summary bar */
|
|
73
|
+
}
|
|
74
|
+
`,jt=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
|
+
${I} {
|
|
99
|
+
display: none;
|
|
100
|
+
}
|
|
101
|
+
`,Ls=i.div`
|
|
102
|
+
display: grid;
|
|
103
|
+
grid-template-columns: minmax(0, 1fr) 615px;
|
|
104
|
+
gap: 24px;
|
|
105
|
+
align-items: start;
|
|
106
|
+
|
|
107
|
+
${Pt} {
|
|
108
|
+
grid-template-columns: 1fr;
|
|
109
|
+
}
|
|
110
|
+
`,kt=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
|
+
/* Gray below the panels so the band never hugs the last card: Figma's band runs y152–950 with the
|
|
118
|
+
content ending at 854. The min-height above only covers a SHORT cart — once the list outgrows it
|
|
119
|
+
the band tracks the content, and without this padding it would butt straight into the purple. */
|
|
120
|
+
padding-bottom: 96px;
|
|
121
|
+
|
|
122
|
+
&::before {
|
|
123
|
+
content: '';
|
|
124
|
+
position: absolute;
|
|
125
|
+
top: -28px;
|
|
126
|
+
bottom: 0;
|
|
127
|
+
left: 50%;
|
|
128
|
+
width: 100vw;
|
|
129
|
+
transform: translateX(-50%);
|
|
130
|
+
background: ${r.media};
|
|
131
|
+
z-index: 0;
|
|
132
|
+
}
|
|
133
|
+
& > * {
|
|
134
|
+
position: relative;
|
|
135
|
+
z-index: 1;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
${I} {
|
|
139
|
+
/* The single-column layout is already taller than the desktop band, and the fixed summary bar sits over
|
|
140
|
+
the bottom of it — a floor here would only add empty gray. */
|
|
141
|
+
min-height: 0;
|
|
142
|
+
|
|
143
|
+
/* The fixed summary bar already reserves room at the bottom on mobile (see Checkout). */
|
|
144
|
+
padding-bottom: 32px;
|
|
145
|
+
|
|
146
|
+
&::before {
|
|
147
|
+
top: -16px; /* .page's mobile padding */
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
`,Ks=i.div`
|
|
151
|
+
min-width: 0;
|
|
152
|
+
display: flex;
|
|
153
|
+
flex-direction: column;
|
|
154
|
+
gap: 12px;
|
|
155
|
+
`,Ns=i.div`
|
|
156
|
+
display: flex;
|
|
157
|
+
align-items: center;
|
|
158
|
+
justify-content: space-between;
|
|
159
|
+
gap: 12px;
|
|
160
|
+
background: ${r.white};
|
|
161
|
+
border-radius: 16px;
|
|
162
|
+
padding: 12px 12px 12px 24px;
|
|
163
|
+
|
|
164
|
+
${I} {
|
|
165
|
+
gap: 8px;
|
|
166
|
+
padding: 12px;
|
|
167
|
+
}
|
|
168
|
+
`,zt=i.section`
|
|
169
|
+
min-width: 0;
|
|
170
|
+
background: ${r.white};
|
|
171
|
+
border-radius: 16px;
|
|
172
|
+
padding: 24px;
|
|
173
|
+
|
|
174
|
+
${I} {
|
|
175
|
+
padding: 16px;
|
|
176
|
+
}
|
|
177
|
+
`,Us=i(zt)`
|
|
178
|
+
display: flex;
|
|
179
|
+
flex-direction: column;
|
|
180
|
+
align-items: center;
|
|
181
|
+
justify-content: center;
|
|
182
|
+
gap: 24px;
|
|
183
|
+
min-height: 420px;
|
|
184
|
+
padding: 48px 16px;
|
|
185
|
+
text-align: center;
|
|
186
|
+
color: ${r.text};
|
|
187
|
+
|
|
188
|
+
${de.media.maxWidth("mobile")} {
|
|
189
|
+
min-height: 320px;
|
|
190
|
+
padding: 32px 16px;
|
|
191
|
+
}
|
|
192
|
+
`,Qs=i.div`
|
|
193
|
+
display: flex;
|
|
194
|
+
flex-direction: column;
|
|
195
|
+
align-items: center;
|
|
196
|
+
gap: 12px;
|
|
197
|
+
padding-bottom: 16px;
|
|
198
|
+
`,Hs=i.p`
|
|
199
|
+
margin: 0;
|
|
200
|
+
font-size: 24px;
|
|
201
|
+
font-weight: 700;
|
|
202
|
+
line-height: 1.6;
|
|
203
|
+
|
|
204
|
+
${de.media.maxWidth("mobile")} {
|
|
205
|
+
font-size: 20px;
|
|
206
|
+
}
|
|
207
|
+
`,Os=i.p`
|
|
208
|
+
margin: 0;
|
|
209
|
+
font-size: 20px;
|
|
210
|
+
font-weight: 400;
|
|
211
|
+
line-height: 1.6;
|
|
212
|
+
|
|
213
|
+
${de.media.maxWidth("mobile")} {
|
|
214
|
+
font-size: 16px;
|
|
215
|
+
}
|
|
216
|
+
`,Gs=i(ke)`
|
|
217
|
+
display: inline-flex;
|
|
218
|
+
align-items: center;
|
|
219
|
+
justify-content: center;
|
|
220
|
+
width: 310px;
|
|
221
|
+
max-width: 100%;
|
|
222
|
+
height: 56px;
|
|
223
|
+
padding: 0 12px;
|
|
224
|
+
border-radius: ${ee.card};
|
|
225
|
+
background: ${r.accent};
|
|
226
|
+
color: ${r.softWhite};
|
|
227
|
+
font-size: 15px;
|
|
228
|
+
font-weight: 600;
|
|
229
|
+
line-height: 24px;
|
|
230
|
+
letter-spacing: 0.46px;
|
|
231
|
+
text-transform: uppercase;
|
|
232
|
+
text-decoration: none;
|
|
233
|
+
transition: background 0.15s ease;
|
|
234
|
+
|
|
235
|
+
&:hover {
|
|
236
|
+
background: ${r.accentHover};
|
|
237
|
+
}
|
|
238
|
+
&:focus-visible {
|
|
239
|
+
outline: 2px solid ${r.accent};
|
|
240
|
+
outline-offset: 2px;
|
|
241
|
+
}
|
|
242
|
+
`,Vs=i.button`
|
|
243
|
+
display: none;
|
|
244
|
+
|
|
245
|
+
${I} {
|
|
246
|
+
display: inline-flex;
|
|
247
|
+
align-items: center;
|
|
248
|
+
flex-shrink: 0;
|
|
249
|
+
border: 0;
|
|
250
|
+
background: none;
|
|
251
|
+
padding: 0;
|
|
252
|
+
color: ${r.text};
|
|
253
|
+
cursor: pointer;
|
|
254
|
+
|
|
255
|
+
& .ico {
|
|
256
|
+
width: 20px;
|
|
257
|
+
height: 20px;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
`,Ds=i.h1`
|
|
261
|
+
margin: 0;
|
|
262
|
+
font-size: 14px;
|
|
263
|
+
font-weight: 600;
|
|
264
|
+
line-height: 1.57;
|
|
265
|
+
color: ${r.text};
|
|
266
|
+
|
|
267
|
+
${I} {
|
|
268
|
+
flex: 1;
|
|
269
|
+
min-width: 0;
|
|
270
|
+
font-size: 16px;
|
|
271
|
+
}
|
|
272
|
+
`,Ys=i.button`
|
|
273
|
+
display: inline-flex;
|
|
274
|
+
align-items: center;
|
|
275
|
+
justify-content: center;
|
|
276
|
+
gap: 8px;
|
|
277
|
+
height: 40px;
|
|
278
|
+
padding: 0 12px;
|
|
279
|
+
border: 2px solid transparent;
|
|
280
|
+
border-radius: ${ee.btn};
|
|
281
|
+
background:
|
|
282
|
+
linear-gradient(${r.white}, ${r.white}) padding-box,
|
|
283
|
+
${It.amethyst} border-box;
|
|
284
|
+
color: ${r.accent};
|
|
285
|
+
font-size: 13px;
|
|
286
|
+
font-weight: 600;
|
|
287
|
+
line-height: 24px;
|
|
288
|
+
letter-spacing: 0.46px;
|
|
289
|
+
text-transform: uppercase;
|
|
290
|
+
white-space: nowrap;
|
|
291
|
+
cursor: pointer;
|
|
292
|
+
transition:
|
|
293
|
+
box-shadow 0.15s ease,
|
|
294
|
+
filter 0.15s ease;
|
|
295
|
+
|
|
296
|
+
&:hover:not(:disabled) {
|
|
297
|
+
box-shadow: 0 0 8px 0 rgba(165, 36, 179, 0.35);
|
|
298
|
+
}
|
|
299
|
+
&:active:not(:disabled) {
|
|
300
|
+
filter: brightness(0.97);
|
|
301
|
+
}
|
|
302
|
+
&:disabled {
|
|
303
|
+
opacity: 0.55;
|
|
304
|
+
cursor: default;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
${I} {
|
|
308
|
+
height: 36px;
|
|
309
|
+
padding: 0 10px;
|
|
310
|
+
font-size: 12px;
|
|
311
|
+
}
|
|
312
|
+
`,Js=i.div`
|
|
313
|
+
display: flex;
|
|
314
|
+
flex-direction: column;
|
|
315
|
+
gap: 24px;
|
|
316
|
+
`,Xs=i.div`
|
|
317
|
+
position: relative;
|
|
318
|
+
display: flex;
|
|
319
|
+
align-items: stretch;
|
|
320
|
+
gap: 12px;
|
|
321
|
+
background: ${r.white};
|
|
322
|
+
border: 1px solid ${r.gray4};
|
|
323
|
+
border-radius: ${ee.card};
|
|
324
|
+
overflow: hidden;
|
|
325
|
+
|
|
326
|
+
&[data-unavailable] [data-thumb] {
|
|
327
|
+
opacity: 0.5;
|
|
328
|
+
}
|
|
329
|
+
&[data-unavailable] [data-check] {
|
|
330
|
+
display: none;
|
|
331
|
+
}
|
|
332
|
+
&[data-unavailable] [data-desc] {
|
|
333
|
+
opacity: 0.7;
|
|
334
|
+
}
|
|
335
|
+
`,Zs=i.div`
|
|
336
|
+
position: relative;
|
|
337
|
+
flex-shrink: 0;
|
|
338
|
+
width: 137.5px;
|
|
339
|
+
height: 137px;
|
|
340
|
+
background: ${r.media};
|
|
341
|
+
border-radius: ${ee.card};
|
|
342
|
+
display: grid;
|
|
343
|
+
place-items: center;
|
|
344
|
+
overflow: hidden;
|
|
345
|
+
|
|
346
|
+
& img {
|
|
347
|
+
width: 83%;
|
|
348
|
+
height: 83%;
|
|
349
|
+
object-fit: contain;
|
|
350
|
+
filter: drop-shadow(0.56px 2.25px 2.8px rgba(0, 0, 0, 0.1));
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
${I} {
|
|
354
|
+
width: 120px;
|
|
355
|
+
height: 120px;
|
|
356
|
+
}
|
|
357
|
+
`,en=i(ke)`
|
|
358
|
+
position: absolute;
|
|
359
|
+
inset: 0;
|
|
360
|
+
display: grid;
|
|
361
|
+
place-items: center;
|
|
362
|
+
`,tn=i.span`
|
|
363
|
+
position: absolute;
|
|
364
|
+
top: 7.5px;
|
|
365
|
+
left: 7.5px;
|
|
366
|
+
width: 20px;
|
|
367
|
+
height: 20px;
|
|
368
|
+
border-radius: 50%;
|
|
369
|
+
background: #34ce77;
|
|
370
|
+
display: grid;
|
|
371
|
+
place-items: center;
|
|
372
|
+
`,an=i.div`
|
|
373
|
+
flex: 1;
|
|
374
|
+
min-width: 0;
|
|
375
|
+
display: flex;
|
|
376
|
+
flex-direction: column;
|
|
377
|
+
justify-content: space-between;
|
|
378
|
+
gap: 8px;
|
|
379
|
+
padding: 16px 8px;
|
|
380
|
+
|
|
381
|
+
${I} {
|
|
382
|
+
padding: 12px 4px 12px 0;
|
|
383
|
+
}
|
|
384
|
+
`,sn=i.div`
|
|
385
|
+
display: flex;
|
|
386
|
+
flex-direction: column;
|
|
387
|
+
gap: 4px;
|
|
388
|
+
min-width: 0;
|
|
389
|
+
padding-right: 64px; /* clear the top-right favourite + remove group */
|
|
390
|
+
`,At=Le`
|
|
391
|
+
display: block;
|
|
392
|
+
font-size: 16px;
|
|
393
|
+
font-weight: 600;
|
|
394
|
+
line-height: 1.2;
|
|
395
|
+
color: ${r.text};
|
|
396
|
+
text-decoration: none;
|
|
397
|
+
overflow: hidden;
|
|
398
|
+
text-overflow: ellipsis;
|
|
399
|
+
white-space: nowrap;
|
|
400
|
+
|
|
401
|
+
a&:hover {
|
|
402
|
+
color: ${r.accent};
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
${I} {
|
|
406
|
+
white-space: normal;
|
|
407
|
+
display: -webkit-box;
|
|
408
|
+
-webkit-line-clamp: 2;
|
|
409
|
+
line-clamp: 2;
|
|
410
|
+
-webkit-box-orient: vertical;
|
|
411
|
+
}
|
|
412
|
+
`,nn=i.div`
|
|
413
|
+
${At};
|
|
414
|
+
`,rn=i(ke)`
|
|
415
|
+
${At};
|
|
416
|
+
`,on=i(sa)`
|
|
417
|
+
font-size: 10px;
|
|
418
|
+
line-height: 1.43;
|
|
419
|
+
color: ${r.muted};
|
|
420
|
+
|
|
421
|
+
& [data-avatar] {
|
|
422
|
+
display: none;
|
|
423
|
+
}
|
|
424
|
+
& [data-testid='creator-name'] {
|
|
425
|
+
font-size: 10px;
|
|
426
|
+
line-height: 1.43;
|
|
427
|
+
}
|
|
428
|
+
`,cn=i.div`
|
|
429
|
+
display: flex;
|
|
430
|
+
align-items: center;
|
|
431
|
+
justify-content: space-between;
|
|
432
|
+
gap: 12px;
|
|
433
|
+
padding-right: 8px;
|
|
434
|
+
`,dn=i.div`
|
|
435
|
+
display: inline-flex;
|
|
436
|
+
align-items: center;
|
|
437
|
+
gap: 8px;
|
|
438
|
+
padding: 6px;
|
|
439
|
+
border: 0.5px solid ${r.muted2};
|
|
440
|
+
border-radius: ${ee.pill};
|
|
441
|
+
`,$t=i.button`
|
|
442
|
+
display: grid;
|
|
443
|
+
place-items: center;
|
|
444
|
+
width: 16px;
|
|
445
|
+
height: 16px;
|
|
446
|
+
padding: 0;
|
|
447
|
+
border: 0;
|
|
448
|
+
background: none;
|
|
449
|
+
color: ${r.text};
|
|
450
|
+
cursor: pointer;
|
|
451
|
+
|
|
452
|
+
&:disabled {
|
|
453
|
+
color: ${r.muted2};
|
|
454
|
+
cursor: default;
|
|
455
|
+
}
|
|
456
|
+
`,ln=i.span`
|
|
457
|
+
min-width: 12px;
|
|
458
|
+
font-size: 14px;
|
|
459
|
+
font-weight: 500;
|
|
460
|
+
line-height: 1.2;
|
|
461
|
+
color: ${r.text};
|
|
462
|
+
text-align: center;
|
|
463
|
+
`,un=i.div`
|
|
464
|
+
display: inline-flex;
|
|
465
|
+
align-items: center;
|
|
466
|
+
gap: 4px;
|
|
467
|
+
/* Always right-aligned: with a stepper present space-between handles it; for secondary/unique lines
|
|
468
|
+
(no stepper) the auto margin keeps the lone price on the right instead of falling to the left. */
|
|
469
|
+
margin-left: auto;
|
|
470
|
+
font-size: 24px;
|
|
471
|
+
font-weight: 600;
|
|
472
|
+
color: ${r.text2};
|
|
473
|
+
|
|
474
|
+
${I} {
|
|
475
|
+
font-size: 20px;
|
|
476
|
+
}
|
|
477
|
+
`,hn=i(St)`
|
|
478
|
+
width: 24px;
|
|
479
|
+
height: 24px;
|
|
480
|
+
background: ${r.text};
|
|
481
|
+
|
|
482
|
+
${I} {
|
|
483
|
+
width: 20px;
|
|
484
|
+
height: 20px;
|
|
485
|
+
}
|
|
486
|
+
`,pn=i.span`
|
|
487
|
+
margin-left: 6px;
|
|
488
|
+
font-size: 14px;
|
|
489
|
+
font-weight: 500;
|
|
490
|
+
color: ${r.muted};
|
|
491
|
+
text-decoration: line-through;
|
|
492
|
+
`,gn=i.div`
|
|
493
|
+
position: absolute;
|
|
494
|
+
top: 9px;
|
|
495
|
+
right: 7px;
|
|
496
|
+
display: flex;
|
|
497
|
+
align-items: flex-start;
|
|
498
|
+
gap: 12px;
|
|
499
|
+
`,mn=i.span`
|
|
500
|
+
display: inline-flex;
|
|
501
|
+
align-items: center;
|
|
502
|
+
gap: 4px;
|
|
503
|
+
font-size: 12px;
|
|
504
|
+
font-weight: 600;
|
|
505
|
+
line-height: 1;
|
|
506
|
+
text-transform: uppercase;
|
|
507
|
+
color: ${r.text2};
|
|
508
|
+
`,xn=i(O)`
|
|
509
|
+
color: #f48221;
|
|
510
|
+
`,fn=i(ke)`
|
|
511
|
+
font-size: 12px;
|
|
512
|
+
font-weight: 600;
|
|
513
|
+
line-height: 24px;
|
|
514
|
+
letter-spacing: 0.46px;
|
|
515
|
+
text-transform: uppercase;
|
|
516
|
+
text-decoration: underline;
|
|
517
|
+
color: ${r.accent};
|
|
518
|
+
|
|
519
|
+
&:hover {
|
|
520
|
+
color: ${r.accentHover};
|
|
521
|
+
}
|
|
522
|
+
&:focus-visible {
|
|
523
|
+
outline: 2px solid ${r.accent};
|
|
524
|
+
outline-offset: 2px;
|
|
525
|
+
}
|
|
526
|
+
`,yn=i.span`
|
|
527
|
+
align-self: flex-start;
|
|
528
|
+
display: inline-flex;
|
|
529
|
+
align-items: center;
|
|
530
|
+
gap: 4px;
|
|
531
|
+
padding: 2px 4px;
|
|
532
|
+
border-radius: ${ee.chip};
|
|
533
|
+
background: #f4e9ff;
|
|
534
|
+
font-size: 10px;
|
|
535
|
+
font-weight: 400;
|
|
536
|
+
line-height: 14px;
|
|
537
|
+
color: ${r.text};
|
|
538
|
+
`,bn=i(O)`
|
|
539
|
+
width: 11.31px;
|
|
540
|
+
height: 10.94px;
|
|
541
|
+
background: ${r.text};
|
|
542
|
+
`,Et=Le`
|
|
543
|
+
display: grid;
|
|
544
|
+
place-items: center;
|
|
545
|
+
width: 24px;
|
|
546
|
+
height: 24px;
|
|
547
|
+
padding: 0;
|
|
548
|
+
border: 0;
|
|
549
|
+
background: none;
|
|
550
|
+
color: ${r.muted};
|
|
551
|
+
cursor: pointer;
|
|
552
|
+
transition: color 0.12s ease;
|
|
553
|
+
|
|
554
|
+
&:disabled {
|
|
555
|
+
opacity: 0.5;
|
|
556
|
+
cursor: default;
|
|
557
|
+
}
|
|
558
|
+
`,vn=i.button`
|
|
559
|
+
${Et};
|
|
560
|
+
|
|
561
|
+
&:hover:not(:disabled) {
|
|
562
|
+
color: ${r.text};
|
|
563
|
+
}
|
|
564
|
+
&[data-on] {
|
|
565
|
+
color: ${r.dclRed};
|
|
566
|
+
}
|
|
567
|
+
`,wn=i.button`
|
|
568
|
+
${Et};
|
|
569
|
+
|
|
570
|
+
&:hover:not(:disabled) {
|
|
571
|
+
color: ${r.dclRed};
|
|
572
|
+
}
|
|
573
|
+
`,Cn=i.div`
|
|
574
|
+
display: flex;
|
|
575
|
+
gap: 20px;
|
|
576
|
+
margin-top: 16px;
|
|
577
|
+
|
|
578
|
+
& .link {
|
|
579
|
+
font-size: 13px;
|
|
580
|
+
color: ${r.muted};
|
|
581
|
+
font-weight: 600;
|
|
582
|
+
}
|
|
583
|
+
& .link:hover:not(:disabled) {
|
|
584
|
+
color: ${r.text};
|
|
585
|
+
}
|
|
586
|
+
`,jn=i.aside`
|
|
587
|
+
position: sticky;
|
|
588
|
+
top: 172px;
|
|
589
|
+
display: flex;
|
|
590
|
+
flex-direction: column;
|
|
591
|
+
background: ${r.white};
|
|
592
|
+
box-shadow: 0 1px 3px rgba(22, 21, 24, 0.06);
|
|
593
|
+
border-radius: 16px;
|
|
594
|
+
padding: 16px;
|
|
595
|
+
|
|
596
|
+
${Pt} {
|
|
597
|
+
position: static;
|
|
598
|
+
}
|
|
599
|
+
${I} {
|
|
600
|
+
position: fixed;
|
|
601
|
+
left: 0;
|
|
602
|
+
right: 0;
|
|
603
|
+
top: auto;
|
|
604
|
+
bottom: 0;
|
|
605
|
+
z-index: 30;
|
|
606
|
+
border: 0;
|
|
607
|
+
border-radius: 16px 16px 0 0;
|
|
608
|
+
box-shadow: 0 -4px 20px rgba(22, 21, 24, 0.12);
|
|
609
|
+
}
|
|
610
|
+
`,kn=i.h2`
|
|
611
|
+
margin: 0 0 24px;
|
|
612
|
+
padding-bottom: 16px;
|
|
613
|
+
border-bottom: 1px solid ${r.gray4};
|
|
614
|
+
font-size: 24px;
|
|
615
|
+
font-weight: 600;
|
|
616
|
+
color: ${r.text};
|
|
617
|
+
|
|
618
|
+
${I} {
|
|
619
|
+
margin-bottom: 12px;
|
|
620
|
+
padding-bottom: 12px;
|
|
621
|
+
}
|
|
622
|
+
`,$n=i.div`
|
|
623
|
+
display: flex;
|
|
624
|
+
flex-direction: column;
|
|
625
|
+
gap: 12px;
|
|
626
|
+
`,Sn=i.div`
|
|
627
|
+
display: flex;
|
|
628
|
+
align-items: flex-start;
|
|
629
|
+
justify-content: space-between;
|
|
630
|
+
gap: 12px;
|
|
631
|
+
`,Tn=i.span`
|
|
632
|
+
font-size: 14px;
|
|
633
|
+
font-weight: 600;
|
|
634
|
+
line-height: 1.57;
|
|
635
|
+
color: ${r.muted1};
|
|
636
|
+
`,Mn=i.span`
|
|
637
|
+
display: inline-flex;
|
|
638
|
+
align-items: center;
|
|
639
|
+
gap: 8px;
|
|
640
|
+
font-size: 24px;
|
|
641
|
+
font-weight: 700;
|
|
642
|
+
color: ${r.text};
|
|
643
|
+
`,In=i.span`
|
|
644
|
+
display: flex;
|
|
645
|
+
flex-direction: column;
|
|
646
|
+
align-items: flex-end;
|
|
647
|
+
justify-content: center;
|
|
648
|
+
gap: 4px;
|
|
649
|
+
`;i.span`
|
|
650
|
+
font-size: 12px;
|
|
651
|
+
font-weight: 400;
|
|
652
|
+
line-height: 1;
|
|
653
|
+
color: ${r.muted};
|
|
654
|
+
`;const Pn=i(St)`
|
|
655
|
+
width: 30px;
|
|
656
|
+
height: 30px;
|
|
657
|
+
background: ${r.text};
|
|
658
|
+
-webkit-mask-size: 24px 24px;
|
|
659
|
+
mask-size: 24px 24px;
|
|
660
|
+
-webkit-mask-position: left center;
|
|
661
|
+
mask-position: left center;
|
|
662
|
+
`;i.button`
|
|
663
|
+
width: 100%;
|
|
664
|
+
height: 56px;
|
|
665
|
+
border: 0;
|
|
666
|
+
border-radius: ${ee.btn};
|
|
667
|
+
background: ${It.buyBtn};
|
|
668
|
+
color: ${r.softWhite};
|
|
669
|
+
font-size: 15px;
|
|
670
|
+
font-weight: 600;
|
|
671
|
+
letter-spacing: 0.046em;
|
|
672
|
+
text-transform: uppercase;
|
|
673
|
+
cursor: pointer;
|
|
674
|
+
transition: background-image 0.15s ease;
|
|
675
|
+
|
|
676
|
+
/* Primary hover/pressed is the solid Primary red (Figma 738:53252 / 738:53262) — the gradient is
|
|
677
|
+
the RESTING fill only. Painted as a flat GRADIENT, not a background-color: the shorthand can't
|
|
678
|
+
interpolate background-image, so gradient -> colour dropped the image midway while the colour was
|
|
679
|
+
still half transparent and the button visibly blinked. Same property both ends = a clean swap. */
|
|
680
|
+
&:hover:not(:disabled),
|
|
681
|
+
&:active:not(:disabled) {
|
|
682
|
+
background-image: linear-gradient(${r.dclRed}, ${r.dclRed});
|
|
683
|
+
}
|
|
684
|
+
&:disabled {
|
|
685
|
+
opacity: 0.6;
|
|
686
|
+
cursor: default;
|
|
687
|
+
}
|
|
688
|
+
`;const Rt=Le`
|
|
689
|
+
margin: 0;
|
|
690
|
+
font-size: 13px;
|
|
691
|
+
`,ve=i.p`
|
|
692
|
+
${Rt};
|
|
693
|
+
`,zn=i(Is)`
|
|
694
|
+
${Rt};
|
|
695
|
+
`,An=i.div`
|
|
696
|
+
position: relative;
|
|
697
|
+
flex: 1 0 auto;
|
|
698
|
+
margin-top: 48px;
|
|
699
|
+
/* Below the gray band the cross-sell sits straight on the purple field (Figma) — hence no band of its
|
|
700
|
+
own. The padding is the whole gap from the top of the section to the heading; the shared carousel's
|
|
701
|
+
own top margin is zeroed below so the two don't stack. */
|
|
702
|
+
padding: 47px 0 24px;
|
|
703
|
+
|
|
704
|
+
& section {
|
|
705
|
+
margin-top: 0;
|
|
706
|
+
}
|
|
707
|
+
`;function Fe(o){if(Ts(o))return a("errors.rejected");const l=(o.message??"").toLowerCase();return l.includes("insufficient")?a("cart.error.insufficient",{currency:ba.name}):l.includes("no active listing")||l.includes("your own listing")?a("cart.error.listingChanged"):a("marketCheckout.error.generic")}const En=12e4;function Rn(o){const l=[];return o.unavailable.length&&l.push(a("cart.drop.unavailable",{count:o.unavailable.length})),o.own.length&&l.push(a("cart.drop.own",{count:o.own.length})),a("cart.drop.removed",{items:l.join(` ${a("cart.drop.and")} `)})}const We=o=>o.reduce((l,P)=>l+P.priceCredits*P.quantity,0),we=o=>o.flatMap(l=>Array.from({length:l.quantity},()=>({...l,quantity:1})));function Dn(){na({title:a("nav.cart"),noindex:!0});const o=H(e=>e.items),l=H(e=>e.remove),P=H(e=>e.increment),z=H(e=>e.decrement),W=H(e=>e.clear),D=H(e=>e.restore),Y=H(e=>e.setFittingOpen),A=ct(e=>e.items),ne=ct(e=>e.toggle),{session:n,signIn:K}=ia(),qt=ra(),le=js().packs.slice(0,ks);M.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const Bt=o.some(e=>e.category!=="emote"),{data:$e}=oa({queryKey:["upsell-listings"],queryFn:()=>Ca({first:40}),staleTime:6e4}),{data:$}=ca(n),v=da(),te=ea(),{state:E}=ta(),[_t,ie]=M.useState(null),[Ke,ue]=M.useState(null),[Ft,B]=M.useState(!1),[_,G]=M.useState(null),Ne=M.useRef(0),[g,j]=M.useState(null),{data:he}=la(n),{data:re}=ua(!0),[Se,Ue]=M.useState(""),oe=M.useRef(null),Qe=ha(o),He=e=>lt(Qe[e.id]),Te=o.filter(He),Oe=o.length>0&&Te.length===0,Wt=Te.reduce((e,s)=>e+s.priceCredits*s.quantity,0),Lt=o.reduce((e,s)=>e+s.quantity,0),Kt=Te.reduce((e,s)=>e+s.quantity,0),Ge=_?_.liveTotalCredits:Wt,Nt=new Set(o.map(e=>e.id)),Ve=(($e==null?void 0:$e.items)??[]).filter(e=>!Nt.has(e.id)).slice(0,12),Ut=new Map(_==null?void 0:_.buyable.map(e=>[e.item.id,e])),pe=($==null?void 0:$.credits)??0,Me=Ge*10,Qt=re?dt(Me,re):0n,Ie=Be({priceCents:Me,priceManaWei:Qt,balanceCents:($==null?void 0:$.balanceCents)??0,manaBalanceWei:he??0n}),Ht=e=>e.some(s=>s.acquisition==="store"),Pe=e=>e.flatMap(s=>s.acquisition==="trade"?[s]:[]),Ot=xa,Gt=e=>ya(e.contractAddress,String(e.itemId));function ge(e){e(),G(null),ue(null),ie(null)}function Vt(){j(null),B(!1)}function De(e){const s=We(e),d=Math.max(0,s-pe),c=le.find(u=>u.credits>=d)??le[le.length-1];Ue(c.id),V("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:s,credits_balance:pe,shortfall:d}),j({phase:"nofunds",lines:e.map(u=>({item:u.item,priceCredits:u.priceCredits,quantity:u.quantity})),shortfall:d}),B(!1)}async function ze(e){if(!n||e.length===0)return;const s=we(e),d=s.map(y=>({...y.item,priceCredits:y.priceCredits})),c=e.map(y=>({...y.item,priceCredits:y.priceCredits,quantity:y.quantity})),u=[];let h="authorize";const w=new Set,S=new Set,F=new Set,R=[];let q=!1;j({phase:"processing",stage:"reserving",step:1,total:s.length});try{const y=[];for(let x=0;x<s.length;x++){const p=s[x];j({phase:"processing",stage:"reserving",step:x+1,total:s.length});try{const T=p.acquisition==="trade"?p.trade.id:void 0,C=p.item.contractAddress&&p.item.itemId!=null?{contractAddress:p.item.contractAddress,itemId:String(p.item.itemId)}:void 0,{credit:Q,maxCreditedValue:Z}=await pt(n.identity,p.usdCents,T,C);u.push({salt:Q.id,itemId:p.item.id}),y.push(p.acquisition==="store"?{kind:"store",item:{collection:p.item.contractAddress,itemId:String(p.item.itemId),priceWei:p.priceWei},credits:[Q],maxCreditedValue:Z,chainId:p.item.chainId}:{kind:"trade",trade:p.trade,credits:[Q],maxCreditedValue:Z})}catch(T){if(Ms(T)){if(u.length){try{await Re(n.identity,u.map(C=>C.salt))}catch(C){ae(C,{flow:"cart_checkout",step:"release"})}v.invalidateQueries({queryKey:["usd-balance"]})}De(e);return}throw T}}h="submit";const m=bs(y).length,k=x=>m>1?{current:x,total:m}:void 0,L=(x,p)=>j({phase:"processing",stage:x,step:s.length,total:s.length,signatures:k(p)}),N=x=>x<m?L("awaiting-signature",x+1):L("settling",m);L("awaiting-signature",1);let f=[];if(ps())try{const x=new Map;f=await vs({purchases:y,buyer:n.address,signer:n.signer,onSigned:()=>N(m),onBroadcast:({txHash:C,salts:Q})=>{x.set(C,Q),Q.forEach(Z=>w.add(Z))}});const p=await Promise.allSettled(f.map(C=>ws(C)));p.forEach((C,Q)=>{const Z=x.get(f[Q])??[];C.status==="fulfilled"?(Z.forEach(Ee=>S.add(Ee)),R.push(f[Q])):C.reason instanceof vt||Z.forEach(Ee=>F.add(Ee))});const T=p.flatMap(C=>C.status==="rejected"?[C.reason]:[]);if(T.length&&!T.some(C=>C instanceof vt))throw T[0];q=!0}catch(x){if(!(x instanceof Cs)||!va(n.providerType))throw x;f=await _e({purchases:y,buyer:n.address,signer:n.signer,onSigned:N,onBroadcast:({salts:p})=>p.forEach(T=>w.add(T)),onSettled:({txHash:p,salts:T})=>{T.forEach(C=>S.add(C)),R.push(p)},onReverted:({salts:p})=>p.forEach(T=>F.add(T))})}else f=await _e({purchases:y,buyer:n.address,signer:n.signer,onSigned:N,onBroadcast:({salts:x})=>x.forEach(p=>w.add(p)),onSettled:({txHash:x,salts:p})=>{p.forEach(T=>S.add(T)),R.push(x)},onReverted:({salts:x})=>x.forEach(p=>F.add(p))});e.forEach(x=>l(x.item.id)),G(null),V("Shop Completed Purchase",{...xe(d),payment_type:"credits",no_crypto_step:q,transaction_hash:f[0]??null}),bt(v);const b=oe.current;oe.current=null,j(null),B(!1);const U={items:c,txHash:f[0]??void 0,txHashes:f,settled:!0,...b?{creditsAdded:b}:{}};te("/success",{state:U,replace:!0})}catch(y){fe(y)||ae(y,{flow:"cart_checkout",step:h,cart_size:e.length});const m=new Set([...w].filter(b=>!F.has(b))),{toRelease:k,boughtItemIds:L}=wt({reservations:u,spent:m,settled:S}),N=d.filter(b=>L.includes(b.id)),f=d.filter(b=>!L.includes(b.id));if(V(fe(y)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:h,error_code:gt(y),value_usd:ut(f.reduce((b,U)=>b+U.priceCredits,0)),cart_size:s.length,partial:N.length>0}),k.length)try{await Re(n.identity,k)}catch(b){ae(b,{flow:"cart_checkout",step:"release"})}if(v.invalidateQueries({queryKey:["usd-balance"]}),N.length>0){L.forEach(b=>l(b)),G(null),bt(v),V("Shop Completed Purchase",{...xe(N),payment_type:"credits",no_crypto_step:q,transaction_hash:R[0]??null,partial:!0}),j({phase:"error",message:a("cart.error.partiallyBought")}),B(!1);return}j({phase:"error",message:Fe(y)})}}function Ye(e,s){v.invalidateQueries({queryKey:["usd-balance"]}),v.invalidateQueries({queryKey:["detail-trade"]}),v.invalidateQueries({queryKey:["shop-item"]}),v.invalidateQueries({queryKey:["owned-token"]}),v.invalidateQueries({queryKey:["public-token"]}),v.invalidateQueries({queryKey:["item-resales"]}),v.invalidateQueries({queryKey:["shop-items"]}),v.invalidateQueries({queryKey:["catalog-items"]}),v.invalidateQueries({queryKey:["my-assets"]}),v.invalidateQueries({queryKey:["purchases"]}),v.invalidateQueries({queryKey:["owned-item-count"]}),v.invalidateQueries({queryKey:["overview-listings"]}),v.invalidateQueries({queryKey:["upsell-listings"]});const d=oe.current;oe.current=null,j(null),B(!1);const c={items:e,txHash:s[0]??void 0,txHashes:s,settled:!0,...d?{creditsAdded:d}:{}};te("/success",{state:c,replace:!0})}function Je(e,s){fe(e)||ae(e,{flow:s,step:"submit"}),V(fe(e)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:gt(e)}),j({phase:"error",message:Fe(e)}),B(!1)}async function Dt(e,s){const d=ye(qe.MANAToken,s),c=ye(qe.CreditsManager,s);await fs({auth:{kind:ys.Allowance,contractAddress:d.address,spenderAddress:c.address,chainId:s},signer:e})}async function Xe(){if(re)return re;try{return await v.fetchQuery({queryKey:["mana-rate",ht.chainId],queryFn:()=>fa(ht.chainId),staleTime:6e4})}catch{return}}async function Yt(e){const s=we(e).reduce((h,w)=>h+w.usdCents,0),c=(he??0n)>0n?await Xe():re,u=c?dt(s,c):0n;return{totalCents:s,manaWei:u}}async function Ze(e,s){const d=We(e),{totalCents:c,manaWei:u}=await Yt(e),h=Be({priceCents:c,priceManaWei:u,balanceCents:($==null?void 0:$.balanceCents)??0,manaBalanceWei:he??0n}),w=Ht(e)?{...h,options:h.options.filter(S=>S.method==="credits")}:h;if(s&&w.options.some(S=>S.method===s)){if(s==="credits"){ze(e);return}const{spender:S,chainId:F}=et(s,e);await tt(S,F,()=>s==="mana"?void at(e):void st(e,c,u));return}if(w.options.some(S=>S.method==="mana"||S.method==="combined")){j({phase:"choose",lines:e,totalCents:c,manaWei:u}),B(!1);return}if($!=null&&$.credits<d){De(e);return}ze(e)}function Jt(e){return Be({priceCents:e.totalCents,priceManaWei:e.manaWei,balanceCents:($==null?void 0:$.balanceCents)??0,manaBalanceWei:he??0n})}const[Ae,me]=M.useState(null);function et(e,s){const d=Pe(s)[0].trade;return{spender:e==="mana"?ye(wa(d.contract),d.chainId).address:ye(qe.CreditsManager,d.chainId).address,chainId:d.chainId}}async function tt(e,s,d){const c=gs(s,e),u=n?await ms(c,n.address).catch(()=>!0):!0;if(xs(n==null?void 0:n.providerType,u)){B(!1),me({auth:c,run:d});return}d()}function Xt(e){if((g==null?void 0:g.phase)!=="choose")return;const{lines:s,totalCents:d,manaWei:c}=g;if(e==="credits"){ze(s);return}const{spender:u,chainId:h}=et(e,s);tt(u,h,()=>e==="mana"?void at(s):void st(s,d,c))}async function at(e){if(!n||e.length===0)return;const s=we(e),d=s.map(h=>({...h.item,priceCredits:h.priceCredits})),c=e.map(h=>({...h.item,priceCredits:h.priceCredits,quantity:h.quantity})),u=()=>j({phase:"processing",stage:"settling",step:s.length,total:s.length});j({phase:"processing",stage:"awaiting-signature",step:s.length,total:s.length});try{const h=await ls({trades:Pe(s).map(w=>w.trade),buyer:n.address,signer:n.signer,onSigned:u});e.forEach(w=>l(w.item.id)),G(null),V("Shop Completed Purchase",{...xe(d),payment_type:"mana",transaction_hash:h[0]??null}),v.invalidateQueries({queryKey:["mana-balance"]}),Ye(c,h)}catch(h){Je(h,"buy_cart_mana")}}async function st(e,s,d){if(!n||e.length===0)return;const c=we(e),u=c.map(m=>({...m.item,priceCredits:m.priceCredits})),h=e.map(m=>({...m.item,priceCredits:m.priceCredits,quantity:m.quantity})),w=us(c.map(m=>m.usdCents),($==null?void 0:$.balanceCents)??0),S=w.reduce((m,k)=>m+k,0),F=hs(Math.max(0,s-S),s,d),R=[],q=new Set,y=new Set;j({phase:"processing",stage:"reserving",step:1,total:c.length});try{const m=Pe(c),k=[];for(let f=0;f<m.length;f++){const b=w[f];if(b<=0)continue;j({phase:"processing",stage:"reserving",step:f+1,total:m.length});const U=m[f].item,{credit:x,maxCreditedValue:p}=await pt(n.identity,b,m[f].trade.id,U.contractAddress&&U.itemId!=null?{contractAddress:U.contractAddress,itemId:String(U.itemId)}:void 0);R.push({salt:x.id,itemId:U.id}),k.push({kind:"trade",trade:m[f].trade,credits:[x],maxCreditedValue:p})}m.forEach((f,b)=>{w[b]<=0&&k.push({kind:"trade",trade:f.trade,credits:[],maxCreditedValue:"0"})}),k[0]={...k[0],maxCreditedValue:(BigInt(k[0].maxCreditedValue)+F).toString()},await Dt(n.signer,m[0].trade.chainId);const L=()=>j({phase:"processing",stage:"settling",step:c.length,total:c.length});j({phase:"processing",stage:"awaiting-signature",step:c.length,total:c.length});const N=await _e({purchases:k,buyer:n.address,signer:n.signer,onSigned:L,onBroadcast:({salts:f})=>f.forEach(b=>q.add(b)),onReverted:({salts:f})=>f.forEach(b=>y.add(b))});e.forEach(f=>l(f.item.id)),G(null),V("Shop Completed Purchase",{...xe(u),payment_type:"credits_and_mana",transaction_hash:N[0]??null}),v.invalidateQueries({queryKey:["mana-balance"]}),Ye(h,N)}catch(m){const{toRelease:k}=wt({reservations:R,spent:new Set([...q].filter(L=>!y.has(L))),settled:new Set});k.length&&Re(n.identity,k).catch(()=>{}),R.length&&v.invalidateQueries({queryKey:["usd-balance"]}),Je(m,"buy_cart_combined")}}async function J(e){if(!n){yt({type:"cart-checkout"}),K();return}const s=H.getState().items.filter(He);if(s.length===0)return;ie(null),ue(null),B(!0);const d=s.reduce((c,u)=>c+u.priceCredits*u.quantity,0);V("Shop Started Checkout",{cart_size:s.length,cart_value_credits:d,cart_value_usd:ut(d),has_sufficient_credits:pe>=d});try{const c=await $s(s,n.address,Ot,await Xe(),Gt),u=[...c.unavailable,...c.own];if(u.length&&(u.forEach(h=>l(h.id)),ue(Rn(c))),c.buyable.length===0){ie(a("cart.error.noneAvailable")),G(null);return}if(c.orderChanged){G(c),Ne.current=Date.now();return}await Ze(c.buyable,e)}catch(c){ae(c,{flow:"cart_checkout",step:"review",cart_size:s.length}),ie(Fe(c))}finally{B(!1)}}async function nt(){if(_){if(!n){yt({type:"cart-checkout"}),K();return}if(Date.now()-Ne.current>En){G(null),ue(null),await J();return}ie(null),Ze(_.buyable)}}async function Zt(){if(Se){try{sessionStorage.setItem(be,JSON.stringify(H.getState().items))}catch{}B(!0);try{const e=await Ss(Se,n?{address:n.address,identity:n.identity}:void 0);if(e.url){window.location.href=e.url;return}te("/credits")}catch(e){try{sessionStorage.removeItem(be)}catch{}ae(e,{flow:"cart_buy_credits"}),j({phase:"error",message:a("buyModal.error.creditsCheckout")})}finally{B(!1)}}}const it=M.useRef(!1);M.useEffect(()=>{if(!n||it.current||!rs("cart-checkout"))return;it.current=!0;const e=setTimeout(()=>void J(),0);return()=>clearTimeout(e)},[n]);const rt=M.useRef(!1);M.useEffect(()=>{if(!(E!=null&&E.resumeCheckout)||rt.current)return;rt.current=!0,oe.current=E.creditsAdded??null;try{const s=sessionStorage.getItem(be);if(s){sessionStorage.removeItem(be);const d=JSON.parse(s);Array.isArray(d)&&d.length&&D(d)}}catch{}v.invalidateQueries({queryKey:["usd-balance"]});const e=setTimeout(()=>void J(),0);return()=>clearTimeout(e)},[E==null?void 0:E.resumeCheckout]);const ot=M.useRef(!1);M.useEffect(()=>{if(!(E!=null&&E.startCheckout))return;const e=setTimeout(()=>{ot.current||(ot.current=!0,J())},0);return()=>clearTimeout(e)},[E==null?void 0:E.startCheckout]);const X=Ft||(g==null?void 0:g.phase)==="processing";return o.length===0&&!g?t.jsx(Ct,{children:t.jsxs(kt,{children:[t.jsxs(jt,{onClick:()=>te(-1),type:"button",children:[t.jsx(O,{name:"arrow-left"}),a("nav.cart")]}),t.jsxs(Us,{"data-testid":"cart-empty",children:[t.jsx(O,{name:"cart-plus",size:110}),t.jsxs(Qs,{children:[t.jsx(Hs,{children:a("cart.empty.title")}),t.jsx(Os,{children:a("cart.empty.body")})]}),t.jsx(Gs,{to:"/items",children:a("cart.empty.cta")})]})]})}):t.jsxs(Ct,{children:[t.jsxs(kt,{children:[t.jsxs(jt,{onClick:()=>te(-1),type:"button",children:[t.jsx(O,{name:"arrow-left"}),a("nav.cart")]}),t.jsxs(Ls,{children:[t.jsxs(Ks,{children:[t.jsxs(Ns,{children:[t.jsx(Vs,{onClick:()=>te(-1),type:"button","aria-label":a("cart.goBack"),children:t.jsx(O,{name:"arrow-left"})}),t.jsx(Ds,{children:a("cart.panelTitle",{count:Lt})}),Bt?t.jsxs(Ys,{onClick:()=>Y(!0),disabled:X,children:[t.jsx(O,{name:"fitting-room"}),a("cart.fittingRoom")]}):null]}),t.jsxs(zt,{children:[t.jsx(Js,{children:o.map(e=>{const s=Ut.get(e.id),d=s?s.priceCredits:e.priceCredits,c=!!s&&s.priceCredits!==e.priceCredits,u=!e.tokenId,h=e.quantity,w=typeof e.available=="number"&&h>=e.available,S=d*h,F=pa(e),R=!!F&&!!A[F],q=ga(e),y=Qe[e.id],m=!lt(y),k=y==="sold-out"?a("cart.availability.soldOut"):a("cart.availability.unavailable");return t.jsxs(Xs,{"data-unavailable":m||void 0,children:[t.jsxs(Zs,{"data-thumb":!0,children:[q?t.jsx(en,{to:q,state:{item:e,tradeId:e.tradeId},"aria-label":e.name,children:e.thumbnail?t.jsx("img",{src:e.thumbnail,alt:e.name}):null}):e.thumbnail?t.jsx("img",{src:e.thumbnail,alt:e.name}):null,t.jsx(tn,{"data-check":!0,"aria-hidden":!0,children:t.jsx("svg",{viewBox:"0 0 20 20",width:"12",height:"12",children:t.jsx("path",{d:"M5 10.5l3 3 7-7.5",fill:"none",stroke:"#fff",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),t.jsxs(an,{children:[t.jsxs(sn,{"data-desc":!0,children:[q?t.jsx(rn,{to:q,state:{item:e,tradeId:e.tradeId},title:e.name,children:e.name}):t.jsx(nn,{title:e.name,children:e.name}),e.creator?t.jsx(on,{address:e.creator,linkToProfile:!0}):null,qt&&u?t.jsxs(yn,{"data-testid":"cart-creator-tag",children:[t.jsx(bn,{name:"buy-from-creator"}),a("cart.creatorTag")]}):null]}),t.jsx(cn,{children:m?t.jsxs(t.Fragment,{children:[t.jsxs(mn,{children:[t.jsx(xn,{name:"warning-fill",size:24}),k]}),q?t.jsx(fn,{to:q,state:{item:e,tradeId:e.tradeId},children:a("cart.availability.viewResales")}):null]}):t.jsxs(t.Fragment,{children:[u?t.jsxs(dn,{children:[t.jsx($t,{onClick:()=>ge(()=>z(e.id)),disabled:X||h<=1,"aria-label":a("cart.decreaseQuantity",{name:e.name}),children:t.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:t.jsx("path",{d:"M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),t.jsx(ln,{children:h}),t.jsx($t,{onClick:()=>ge(()=>P(e.id)),disabled:X||w,"aria-label":a("cart.increaseQuantity"),children:t.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:t.jsx("path",{d:"M8 3.5v9M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}):null,t.jsxs(un,{children:[t.jsx(hn,{})," ",S,c?t.jsx(pn,{children:e.priceCredits*h}):null]})]})})]}),t.jsxs(gn,{children:[F?t.jsx(vn,{"data-on":R||void 0,onClick:()=>ne(e),"aria-label":R?a("cart.removeFromFavorites",{name:e.name}):a("cart.addToFavorites",{name:e.name}),title:R?a("assetCard.removeFromFavorites"):a("assetCard.addToFavorites"),children:t.jsx(O,{name:R?"heart-solid":"heart"})}):null,t.jsx(wn,{onClick:()=>ge(()=>l(e.id)),disabled:X,"aria-label":a("cart.remove",{name:e.name}),title:a("cart.removeTitle"),children:t.jsx(O,{name:"trash",size:24})})]})]},e.id)})}),t.jsx(Cn,{children:t.jsx("button",{className:"link",onClick:()=>ge(W),disabled:X,children:a("cart.clearCart")})})]})]}),t.jsxs(jn,{children:[t.jsx(kn,{children:a("cart.purchaseSummary")}),t.jsxs($n,{children:[t.jsxs(Sn,{children:[t.jsx(Tn,{children:a("cart.totalItems",{count:Kt})}),t.jsx(In,{children:t.jsxs(Mn,{children:[t.jsx(Pn,{})," ",Ge]})})]}),t.jsx(Tt,{options:Ie.options,totalCents:Me,shortfall:Ie.manaShortfall,showCreditsAmount:!1,creditsLabel:_?a("marketCheckout.confirmPurchase"):Ie.options.length>1?a("cart.buyWithCredits"):a("cart.checkout"),busy:X||Oe,onPay:e=>void(_?nt():J(e)),creditsFallback:{label:X?a("cart.working"):_?a("marketCheckout.confirmPurchase"):a("cart.checkout"),onClick:()=>void(_?nt():J())}}),Oe?t.jsx(ve,{className:"muted",children:a("cart.allUnavailable")}):null,n?null:t.jsx(ve,{className:"muted",children:a("cart.signInHint")}),_?t.jsx(ve,{className:"muted",children:a("cart.priceChanged")}):null,Ke?t.jsx(ve,{className:"muted",children:Ke}):null,t.jsx(zn,{message:_t})]})]})]})]}),Ve.length>0?t.jsx(An,{children:t.jsx(os,{title:a("cart.youMightAlsoLike"),items:Ve})}):null,Ae&&n?t.jsx(cs,{auth:Ae.auth,signer:n.signer,title:a("authorizeStep.manaTitle"),name:a("authorizeStep.manaName"),reason:a("authorizeStep.manaReason"),icon:t.jsx("img",{src:ds,width:24,height:24,alt:"","aria-hidden":!0}),onAuthorized:()=>{const{run:e}=Ae;me(null),e()},onCancel:()=>me(null),onClose:()=>me(null)}):null,g?t.jsx(_s,{phase:g.phase,balanceCredits:pe,onClose:Vt,stage:g.phase==="processing"?g.stage:void 0,step:g.phase==="processing"?g.step:void 0,total:g.phase==="processing"?g.total:void 0,isSelfCustody:ma(n==null?void 0:n.providerType),signatures:g.phase==="processing"?g.signatures:void 0,options:g.phase==="choose"?Jt(g).options:void 0,onPay:Xt,totalCents:g.phase==="choose"?g.totalCents:void 0,totalManaWei:g.phase==="choose"?g.manaWei:void 0,totalCredits:g.phase==="choose"?We(g.lines):void 0,lines:g.phase==="nofunds"?g.lines:void 0,shortfallCredits:g.phase==="nofunds"?g.shortfall:void 0,packs:le,selectedPack:Se,onSelectPack:Ue,onBuyPacks:()=>void Zt(),message:g.phase==="error"?g.message:void 0,onRetry:()=>void J()}):null]})}export{Dn as Cart};
|