@dcl/shop 0.10.1-31040959942.commit-e9e6433 → 0.10.1-31042990976.commit-7edc9b6
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-CUf8ogRR.js → Activity-Cx-gKp62.js} +3 -3
- package/_assets/{AnimatedBackground-_78VlBdV.js → AnimatedBackground-yDvJglBx.js} +1 -1
- package/_assets/{Assets-UkGI952T.js → Assets-BzPVRWYe.js} +2 -2
- package/_assets/{Assets.styles-D1Vg-U1C.js → Assets.styles-D4-S4NWG.js} +1 -1
- package/_assets/{Authorizations-B3yDMR41.js → Authorizations-gGXOHHeT.js} +1 -1
- package/_assets/Cart-C4zUzYSx.js +669 -0
- package/_assets/{CircularProgress-CB62Wg9m.js → CircularProgress-DNShuaaC.js} +1 -1
- package/_assets/{Collection-CSv9R6xZ.js → Collection-CI_bqtk6.js} +1 -1
- package/_assets/{CollectionCarousel-Cg2MTF9W.js → CollectionCarousel-BAwS8rTZ.js} +119 -119
- package/_assets/{Confetti-Blr9NSjA.js → Confetti-DkcOmptO.js} +1 -1
- package/_assets/{Creator-sh_sYH1o.js → Creator-CFf63R4B.js} +1 -1
- package/_assets/{ErrorNotice-CXsnDhEh.js → ErrorNotice-C_rQ_hZp.js} +1 -1
- package/_assets/{ExchangeController-GIzn0xGk.js → ExchangeController-BPF_kkCP.js} +1 -1
- package/_assets/{Faq-C0nCohQD.js → Faq--E1fBOzk.js} +1 -1
- package/_assets/{GetCredits-CBLkNO-w.js → GetCredits-C2rjzPBY.js} +1 -1
- package/_assets/{Grow-Nzyme9Oa.js → Grow-CyHu9l8s.js} +1 -1
- package/_assets/{HelpersUtil-D0wBF1PA.js → HelpersUtil-Bh7qiwp_.js} +1 -1
- package/_assets/{ItemDetail-DZ3mEshJ.js → ItemDetail-CtR1YHPh.js} +1 -1
- package/_assets/LazyEmoteControls-BUp4tFZX.js +2 -0
- package/_assets/{LoadMore-CKNE48ED.js → LoadMore-BQIcG-2Y.js} +1 -1
- package/_assets/{ManaPricingBanner.styles-CJS5V2Di.js → ManaPricingBanner.styles-Dj_122X4.js} +1 -1
- package/_assets/{MyAssets-Ble658vU.js → MyAssets-Dk_4queh.js} +1 -1
- package/_assets/{MyFavorites-Qri7XFuW.js → MyFavorites-yuyxKJv4.js} +1 -1
- package/_assets/{NotFound-BnEiiuoJ.js → NotFound-rquTctww.js} +1 -1
- package/_assets/{NotificationsBell-CXzlEnr9.js → NotificationsBell-CFCmzqHj.js} +1 -1
- package/_assets/{OutfitDetail-CL1Y8ii5.js → OutfitDetail-BFc4wS6X.js} +1 -1
- package/_assets/{OutfitPreview-DRqW1c5F.js → OutfitPreview-C214293j.js} +1 -1
- package/_assets/{OutfitStudio-DgL1kI47.js → OutfitStudio-OOy9Y3VP.js} +1 -1
- package/_assets/{StoreSettings--R4i191j.js → StoreSettings-BpkjL6md.js} +1 -1
- package/_assets/{Success-DApKfyee.js → Success-BXjczKuA.js} +1 -1
- package/_assets/{SwapController-0aVdHfMW.js → SwapController-CA7wAH0n.js} +1 -1
- package/_assets/{Tooltip-B2qDq-8v.js → Tooltip-BoJS18Z3.js} +1 -1
- package/_assets/{TradeService-COZXjCcV.js → TradeService-DsmKoPxy.js} +1 -1
- package/_assets/{W3MFrameProviderSingleton-BYmipTKt.js → W3MFrameProviderSingleton-DKeivVWe.js} +3 -3
- package/_assets/{WebCryptoP256-Cid44am7.js → WebCryptoP256-CJPdW9Ug.js} +1 -1
- package/_assets/{authorizations-dpp0OnHI.js → authorizations-2Xd-ft_C.js} +1 -1
- package/_assets/{basic-An6X8Awg.js → basic-CpO7N7NV.js} +1 -1
- package/_assets/{biconomy-CeZnHUNK.js → biconomy-HF5uwOUc.js} +1 -1
- package/_assets/{builder-Ce37-lC-.js → builder-uBBMnbtK.js} +1 -1
- package/_assets/{buy-Dgj0sRqb.js → buy-CgUGATyG.js} +1 -1
- package/_assets/{buy-gasless-CYY_v3bj.js → buy-gasless-CVTH5KGZ.js} +1 -1
- package/_assets/{categories-KFHNUm7E.js → categories-yTyOCTA2.js} +1 -1
- package/_assets/{ccip-8Mu0bgFv.js → ccip-BjT8ndU2.js} +1 -1
- package/_assets/{ccip-BsYdmRqX.js → ccip-Bq1h60c1.js} +1 -1
- package/_assets/{collectionPage.styles-jwKyDncq.js → collectionPage.styles-BOOK4JE1.js} +5 -5
- package/_assets/{controller-Cam05qfJ.js → controller-CBtSaaQD.js} +2 -2
- package/_assets/{core-BdiPiyom.js → core-CIuOeePP.js} +4 -4
- package/_assets/{createSvgIcon-cAMuQ1mD.js → createSvgIcon-Dax4uwaL.js} +1 -1
- package/_assets/{custom-C7A-Vb1Q.js → custom-CYUokIbm.js} +1 -1
- package/_assets/{data-capture-COGpG9-r.js → data-capture-6P55-IaB.js} +1 -1
- package/_assets/{email-WblN0-6I.js → email-nYmfz15C.js} +1 -1
- package/_assets/{embedded-wallet-BDGaY-OT.js → embedded-wallet-D_e_UWzV.js} +1 -1
- package/_assets/{emotion-styled.browser.esm-D7YX5KN0.js → emotion-styled.browser.esm-s1GWUoDX.js} +1 -1
- package/_assets/{engine-DjipK7B5.js → engine-CpLQoIqI.js} +1 -1
- package/_assets/{errors-CzBZCztT.js → errors-hu6Xw0D2.js} +1 -1
- package/_assets/{estimate-l1-fee-Bk8rxjZm.js → estimate-l1-fee-CLRDa6fI.js} +1 -1
- package/_assets/{execute-C4AIZjft.js → execute-DqPg9Ksw.js} +2 -2
- package/_assets/{features-Dz4wLY98.js → features-BtrrmffG.js} +1 -1
- package/_assets/{fetchTokenMetadata-DjPW-ayp.js → fetchTokenMetadata-DFJ36WnI.js} +2 -2
- package/_assets/{field.styles-BThVZLzX.js → field.styles-XpeJ0COA.js} +1 -1
- package/_assets/{get-ecosystem-wallet-info-DMVrxBpI.js → get-ecosystem-wallet-info-DlCx83R8.js} +1 -1
- package/_assets/{getBalance-DeFn5Yjk.js → getBalance-B5ocM9g2.js} +1 -1
- package/_assets/{getNFT-iw9a-h4A.js → getNFT-DBaH5cpy.js} +1 -1
- package/_assets/{getNFT-CRgzh5wf.js → getNFT-oiyevCuO.js} +1 -1
- package/_assets/{grid.styles-U_Gpy1wT.js → grid.styles-Dpb8Greh.js} +1 -1
- package/_assets/{hashTypedData-CqewBwVq.js → hashTypedData-CeLfcFPQ.js} +1 -1
- package/_assets/{hashTypedData-9Zh9SRr-.js → hashTypedData-NanWeJ-D.js} +1 -1
- package/_assets/{in-app-DNl1emxp.js → in-app-DfEVZ7ts.js} +1 -1
- package/_assets/{in-app-wallet-calls-CBy5UcNA.js → in-app-wallet-calls-CaankqgP.js} +1 -1
- package/_assets/{index-xLgJxfJy.js → index-B-kvIPu1.js} +1 -1
- package/_assets/{index-m-SAK4uo.js → index-B0jVlmk0.js} +1 -1
- package/_assets/{index-RHSCZ-t0.js → index-B4WRMX84.js} +1 -1
- package/_assets/{index-1tktbprD.js → index-BC1n3NBn.js} +1 -1
- package/_assets/{index-BC_qLj4b.js → index-BGSoCmOn.js} +1 -1
- package/_assets/{index-BIJiNaiS.js → index-BHzYL11-.js} +1 -1
- package/_assets/{index-Dd8eTuKB.js → index-BJ6fvgAM.js} +1 -1
- package/_assets/{index-ByPjVaiq.js → index-BKYIrw8q.js} +1 -1
- package/_assets/{index-buu21jrH.js → index-BL2RPpVH.js} +11 -11
- package/_assets/{index-B3jctKqs.js → index-BMGdvlP9.js} +2 -2
- package/_assets/{index-5SMH4VL2.js → index-BNnBkkJr.js} +1 -1
- package/_assets/{index-CpQbv3Zu.js → index-BPoXI4qO.js} +1 -1
- package/_assets/{index-BsZ1af_A.js → index-BXdpk7Oq.js} +1 -1
- package/_assets/{index-DgPfV4X0.js → index-BZQS2qMR.js} +1 -1
- package/_assets/{index-C6rF-YrH.js → index-BccvdHMd.js} +1 -1
- package/_assets/{index-DO0NylVf.js → index-BntzHAg5.js} +1 -1
- package/_assets/{index-Kq5fobWt.js → index-BqVSjccZ.js} +1 -1
- package/_assets/{index-C_r09vuw.js → index-Bry4nBQ3.js} +1 -1
- package/_assets/{index-Dqdf5xVB.js → index-Bu9Qy6np.js} +1 -1
- package/_assets/{index-D8LZCVOB.js → index-C3zA3tgr.js} +1 -1
- package/_assets/{index-BdkbjSWP.js → index-C8Cm7Ukd.js} +1 -1
- package/_assets/{index-B0wdLudq.js → index-CIJje8vF.js} +1 -1
- package/_assets/{index-CJCxe5kr.js → index-COqbI5lZ.js} +1 -1
- package/_assets/{index-BwGtaRec.js → index-CPOch-_L.js} +1 -1
- package/_assets/{index-D6LfEXYp.js → index-CQMg581G.js} +1 -1
- package/_assets/{index-B7Rm4vXt.js → index-CWMeoaW8.js} +1 -1
- package/_assets/{index-HQUcvKn4.js → index-CYd-9A8i.js} +3 -3
- package/_assets/{index-BVDj7GJL.js → index-CaH_IfZ9.js} +1 -1
- package/_assets/{index-y3U1nB0H.js → index-CaRe7gid.js} +3 -3
- package/_assets/{index-Bc0mTSPi.js → index-Cbb2oZ2Y.js} +1 -1
- package/_assets/{index-DM2dLJ-M.js → index-ChhX0J8g.js} +1 -1
- package/_assets/{index-BdQAMxgJ.js → index-CkvT2_Qp.js} +2 -2
- package/_assets/{index-h--qqRrb.js → index-D9avTVnT.js} +1 -1
- package/_assets/{index-CcihKRSf.js → index-DI0-gUeO.js} +1 -1
- package/_assets/{index-DfIQCR2U.js → index-DJxot5zE.js} +1 -1
- package/_assets/{index-D3iRZfgO.js → index-De-xiANX.js} +1 -1
- package/_assets/{index-CqJzKRxe.js → index-Deo0xkWr.js} +2 -2
- package/_assets/{index-CHCVsh7P.js → index-DxD-NQZ2.js} +1 -1
- package/_assets/{index-D3qXchU2.js → index-DxUWfPTE.js} +1 -1
- package/_assets/{index-DXURSM0-.js → index-Dyf04oQ8.js} +1 -1
- package/_assets/{index-DwrPmkl2.js → index-FaWeourd.js} +1 -1
- package/_assets/{index-Cmc0GHkA.js → index-OiVd03k_.js} +1 -1
- package/_assets/{index-Dax05iV5.js → index-T6PQTPj1.js} +1 -1
- package/_assets/{index-CU5QiUkb.js → index-UiKz3U--.js} +1 -1
- package/_assets/{index-CjvMMH2k.js → index-_l18b6D8.js} +1 -1
- package/_assets/{index-DQ7Kosvv.js → index-cpjoojGa.js} +3 -3
- package/_assets/{index-xMSSxrHn.js → index-enm6a-Yh.js} +1 -1
- package/_assets/{index-DT4Zi23l.js → index-gR7VkXwX.js} +1 -1
- package/_assets/{index-DtAsm8Nr.js → index-jzVm2M_d.js} +1 -1
- package/_assets/{index-Ba-yhU-2.js → index-sW8OdK66.js} +1 -1
- package/_assets/{index-DhRx4LkD.js → index-w9D58X3R.js} +1 -1
- package/_assets/{index-MPYM0LiN.js → index-zPBk9zxn.js} +1 -1
- package/_assets/{index.es-CLldxJUJ.js → index.es-COh1P5q0.js} +1 -1
- package/_assets/{index.es-DGQjR0dR.js → index.es-DKfCNVgZ.js} +4 -4
- package/_assets/{index.es-DqD9HkXC.js → index.es-DZrZt1nk.js} +1 -1
- package/_assets/{localBatchGatewayRequest-COpd6g60.js → localBatchGatewayRequest-BI4PJuWG.js} +1 -1
- package/_assets/{networks-ChmokwGp.js → networks-Blxn8DDe.js} +1 -1
- package/_assets/{onramp-BmIZ6r8P.js → onramp-Dy-wl2-G.js} +1 -1
- package/_assets/{openzeppelin-CzypsJB4.js → openzeppelin-BMYbmCTg.js} +1 -1
- package/_assets/{parseNft-CydF3Edv.js → parseNft-C3NZ6wub.js} +2 -2
- package/_assets/{parseSignature-u2B-ofRt.js → parseSignature-C_OIotiZ.js} +3 -3
- package/_assets/{parseSignature-BeoYj8uB.js → parseSignature-DYiE9TKW.js} +1 -1
- package/_assets/{passkeys-CVYlDRWu.js → passkeys-B1XwJZLc.js} +1 -1
- package/_assets/{pay-with-exchange-DqJU65WS.js → pay-with-exchange-CNHEYWhj.js} +1 -1
- package/_assets/{qr-overlay-DNwX_TPq.js → qr-overlay-xYKFPsA7.js} +1 -1
- package/_assets/{receive-uVtJpZxa.js → receive-CZ46hzUV.js} +1 -1
- package/_assets/{resolveImplementation-CRaloAyf.js → resolveImplementation-CjcXKJyr.js} +1 -1
- package/_assets/{rpc-CqfSA8g9.js → rpc-CcyaVsGv.js} +1 -1
- package/_assets/{secp256k1-DvDQYEQd.js → secp256k1-CKJqWWFY.js} +1 -1
- package/_assets/{secp256k1-Do9ofviG.js → secp256k1-CtAF_8et.js} +1 -1
- package/_assets/{secp256k1-2YskFph9.js → secp256k1-ZiNVKyYC.js} +1 -1
- package/_assets/{send-IbCZj2la.js → send-C3JUT-Wt.js} +1 -1
- package/_assets/{send-batch-transaction-DFD_LTct.js → send-batch-transaction-BjDzAjfB.js} +1 -1
- package/_assets/{send-eip712-transaction-DBf5Z4g_.js → send-eip712-transaction-C_cuPsBN.js} +2 -2
- package/_assets/{send-gasless-transaction-TFSfXMLh.js → send-gasless-transaction-nJMNrEi5.js} +2 -2
- package/_assets/{send-transaction-DGhInFte.js → send-transaction-DlrF4JVI.js} +2 -2
- package/_assets/{sendMetaTransaction-CzqCMKMd.js → sendMetaTransaction-CYTRgQS4.js} +1 -1
- package/_assets/{sendRawTransaction-qf9SJfpX.js → sendRawTransaction-CrjHCLLH.js} +3 -3
- package/_assets/{serializeTransaction-D4cHSu0O.js → serializeTransaction-DCwr_uqm.js} +1 -1
- package/_assets/{session-proposal-5AODiiln.js → session-proposal-Cr_4TYaU.js} +1 -1
- package/_assets/{session-request-hpYNptgl.js → session-request-VECe4LIn.js} +2 -2
- package/_assets/{signing-BQUpSEqZ.js → signing-DsQKDYvj.js} +3 -3
- package/_assets/{skeleton.styles-BfEPveSL.js → skeleton.styles-B5haYcet.js} +1 -1
- package/_assets/{socials-D6EP9g5a.js → socials-B80b3Xbl.js} +1 -1
- package/_assets/{styled-FDInU8Rs.js → styled-qF6AFIDl.js} +1 -1
- package/_assets/{swaps-CqwmfiPX.js → swaps-9KfTzTvK.js} +1 -1
- package/_assets/{thirdweb-Cecbmps_.js → thirdweb-C31f21KI.js} +3 -3
- package/_assets/{to-serializable-transaction-u0MhoPX5.js → to-serializable-transaction-DRO125BM.js} +2 -2
- package/_assets/{transactionReceipt-l4NJYcz9.js → transactionReceipt-D2IEagp9.js} +1 -1
- package/_assets/{transactions-CeFT9Jfi.js → transactions-COJcFMl1.js} +1 -1
- package/_assets/{useCreditPacks-DQE6Gg5O.js → useCreditPacks-UUgawD-U.js} +1 -1
- package/_assets/{useImportable-Dh1ZOsU2.js → useImportable-DdzyhNKj.js} +1 -1
- package/_assets/{useInfiniteGrid--LOCzyU9.js → useInfiniteGrid-CWAXtPPS.js} +1 -1
- package/_assets/{useTheme-CpSHkSMG.js → useTheme-nSt_zjh9.js} +1 -1
- package/_assets/{verifyHash-BSS9_MWX.js → verifyHash-3joPxTRt.js} +1 -1
- package/_assets/{w3m-modal-ByuBko0g.js → w3m-modal-BdMUp7-V.js} +1 -1
- package/_assets/{w3m-modal-BCjN4Uqc.js → w3m-modal-fllBGzZL.js} +1 -1
- package/_assets/{wait-for-tx-receipt-CfVB-CU0.js → wait-for-tx-receipt-DLk5rirA.js} +1 -1
- package/_assets/{wallets-tUzLLBvA.js → wallets-p_5_3A7U.js} +5 -5
- package/_assets/{web-connector-BfVr5QpB.js → web-connector-B1ItZy3i.js} +3 -3
- package/_assets/{writeContract-B4n8yTsB.js → writeContract-_6f7I-3C.js} +1 -1
- package/_assets/{zoraTestnet-CNY7oWT9.js → zoraTestnet-BegtFmVb.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/_assets/Cart-CbY3Hhq6.js +0 -695
- package/_assets/LazyEmoteControls-BEt_49wK.js +0 -2
|
@@ -0,0 +1,669 @@
|
|
|
1
|
+
import{j as t,L as ke,r as P,b as Xt,a as Zt}from"./react-BYHuwl8r.js";import{t as de,s as i,b as a,L as ce,bb as ea,J as ta,I as H,z as St,K as Le,x as aa,Y as Q,an as ot,o as sa,q as na,v as ia,bc as ra,A as oa,bd as ca,ao as da,be as la,bf as ct,bg as ua,bh as ha,y as pa,bi as dt,$ as V,bj as lt,bk as ga,F as te,r as xa,c as ut,bl as ma,C as fa,bm as ht,bn as qe,bo as ya,bp as me,bq as fe,br as pt,g as ye,f as ba,h as Be,bs as va}from"./index-BL2RPpVH.js";import{M as wa,S as Ca,C as ja,H as ka,a as Sa,T as $a,X as Ma,b as Ta,B as Ia,c as Pa,d as gt,e as za,f as Ce,P as $t,m as Aa,g as Ea,h as qa,i as Ba,j as Mt,k as je,L as Ra,l as _a,n as xt,o as mt,W as Wa,p as Fa,q as La,A as Ka,r as Ua,s as Na,t as Qa,u as Ha,v as Oa,w as Va,x as Ga,y as Ya,z as Da,D as Ja,E as Xa,F as Za,G as es,I as ts,J as as,K as Re,N as ss,O as ns,Q as is,R as rs,U as ft,V as yt,Y as os,Z as cs,_ as ds}from"./CollectionCarousel-BAwS8rTZ.js";import{k as ls,l as us,a as hs,n as ps,f as gs,A as xs}from"./authorizations-2Xd-ft_C.js";import{g as ms,j as _e}from"./buy-CgUGATyG.js";import{b as fs,w as ys,S as bt,G as bs}from"./buy-gasless-CVTH5KGZ.js";import{u as vs,M as ws,R as be,r as Cs,c as js,p as vt}from"./useCreditPacks-UUgawD-U.js";import{i as ks,a as Ss}from"./errors-hu6Xw0D2.js";import{E as $s}from"./ErrorNotice-C_rQ_hZp.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-CYTRgQS4.js";const{colors:ae,radius:Ms}=de,Ts=i.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
gap: 8px;
|
|
6
|
+
width: 100%;
|
|
7
|
+
`,Is=i.span`
|
|
8
|
+
font-size: 16px;
|
|
9
|
+
line-height: 22px;
|
|
10
|
+
color: ${ae.text2};
|
|
11
|
+
text-transform: capitalize;
|
|
12
|
+
white-space: nowrap;
|
|
13
|
+
`,Ps=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 ${ae.media};
|
|
27
|
+
|
|
28
|
+
&::-webkit-scrollbar {
|
|
29
|
+
width: 8px;
|
|
30
|
+
}
|
|
31
|
+
&::-webkit-scrollbar-track {
|
|
32
|
+
background: ${ae.media};
|
|
33
|
+
border-radius: 10px;
|
|
34
|
+
}
|
|
35
|
+
&::-webkit-scrollbar-thumb {
|
|
36
|
+
background: #a2a2a2;
|
|
37
|
+
border-radius: ${Ms.btn};
|
|
38
|
+
}
|
|
39
|
+
`,zs=i.span`
|
|
40
|
+
margin-left: 8px;
|
|
41
|
+
font-size: 13px;
|
|
42
|
+
font-weight: 600;
|
|
43
|
+
color: ${ae.muted};
|
|
44
|
+
`,As=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: ${ae.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: ${ae.text};
|
|
60
|
+
}
|
|
61
|
+
`,Es="https://cdn.decentraland.org/@dcl/shop/0.10.1-31042990976.commit-7edc9b6/_assets/buy-error-22UunaPC.png";function qs(r){const{phase:l,balanceCredits:I,onClose:z}=r,W=l==="processing",G=l==="error"?a("cartCheckout.errorTitle"):l==="nofunds"?a("cartCheckout.titleNoFunds"):l==="choose"?a("buyModal.choosePayment"):a("cartCheckout.titleBuy"),Y=l==="processing";return t.jsxs(wa,{role:"dialog","aria-modal":"true","aria-label":a("cartCheckout.dialogAria"),children:[t.jsx(Ca,{onClick:W?void 0:z,"aria-hidden":!0}),t.jsxs(ja,{"data-tall":Y||void 0,children:[t.jsxs(ka,{children:[t.jsxs(Sa,{children:[t.jsx($a,{children:G}),!W&&t.jsx(Ma,{onClick:z,"aria-label":a("buyModal.close"),children:t.jsx(Ta,{})})]}),t.jsxs(Ia,{children:[t.jsx(Pa,{children:l==="nofunds"?a("buyModal.dclBalance"):a("buyModal.myCreditsBalance")}),t.jsx(gt,{}),t.jsx(za,{children:ce(I)})]})]}),l==="choose"&&t.jsxs(Ce,{children:[t.jsxs(As,{children:[t.jsx("span",{children:a("cart.purchaseSummary")}),t.jsxs("strong",{children:[t.jsx(gt,{}),ce(r.totalCredits??0)]})]}),t.jsx($t,{options:r.options??[],totalCents:r.totalCents??0,onPay:r.onPay??(()=>{}),rateNote:(()=>{const A=Aa(r.totalCents??0,r.totalManaWei??0n);return A!=null?a("buyModal.manaRate",{mana:A.toLocaleString("en",{maximumFractionDigits:2})}):null})()})]}),l==="processing"&&t.jsx(Bs,{stage:r.stage??"reserving",step:r.step??1,total:r.total??1,isSelfCustody:!!r.isSelfCustody,signatures:r.signatures}),l==="nofunds"&&t.jsx(Rs,{lines:r.lines??[],shortfallCredits:r.shortfallCredits??0,packs:r.packs??[],selectedPack:r.selectedPack??"",onSelectPack:r.onSelectPack??(()=>{}),onBuyPacks:r.onBuyPacks??(()=>{}),onCancel:z}),l==="error"&&t.jsxs(Ce,{children:[t.jsxs(Ea,{"data-testid":"buy-error",children:[t.jsx(qa,{src:Es,alt:"",width:64,height:80}),t.jsxs(Ba,{children:[t.jsx("b",{children:a("cartCheckout.errorHeadline")})," ",r.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:r.onRetry??z,children:a("cartCheckout.tryAgain")})]})]})]})]})}function Bs({stage:r,step:l,total:I,isSelfCustody:z,signatures:W}){const G=r==="reserving",Y=I>0?Math.min(100,Math.round(l/I*100)):0,A=z&&W&&W.total>1,ne=r==="awaiting-signature"?z?A?a("cartCheckout.confirmMultiple",{current:W.current,total:W.total}):a("buyModal.confirmToContinue"):a("buyModal.completingTransaction"):r==="settling"?a("buyModal.completingTransaction"):a("cartCheckout.preparing");return t.jsxs(Ce,{"data-processing":!0,children:[t.jsx(Ra,{src:ea,alt:"",width:61,height:61}),t.jsx(_a,{children:ne}),G?t.jsxs(Ts,{children:[t.jsx(xt,{"aria-hidden":!0,children:t.jsx(mt,{"data-step":!0,style:{width:`${Y}%`}})}),I>1?t.jsxs(Is,{children:[l,"/",I]}):null]}):t.jsx(xt,{"aria-hidden":!0,children:t.jsx(mt,{})})]})}function Rs({lines:r,shortfallCredits:l,packs:I,selectedPack:z,onSelectPack:W,onBuyPacks:G,onCancel:Y}){const A=I.find(n=>n.id===z),ne=r.reduce((n,L)=>n+(L.quantity??1),0);return t.jsxs(Ce,{children:[t.jsxs(Wa,{"data-testid":"nofunds-warning",children:[t.jsx(Fa,{}),t.jsxs(La,{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(Ps,{children:r.map(n=>{const L=n.quantity??1;return t.jsxs(Ka,{children:[t.jsx(Ua,{children:n.item.thumbnail?t.jsx("img",{src:n.item.thumbnail,alt:""}):null}),t.jsxs(Na,{children:[t.jsxs("div",{children:[t.jsxs(Qa,{title:n.item.name,children:[n.item.name||a("buyModal.itemFallback"),L>1?t.jsx(zs,{children:a("cartCheckout.qty",{count:L})}):null]}),n.item.creator?t.jsx(Ha,{address:n.item.creator}):null]}),t.jsxs(Oa,{children:[t.jsx(Va,{}),t.jsx("span",{children:ce(n.priceCredits*L)})]})]})]},n.item.id)})}),t.jsx(Ga,{children:I.map(n=>{const L=n.id===z;return t.jsxs(Ya,{"data-testid":"credit-pack","data-on":L||void 0,onClick:()=>W(n.id),children:[t.jsx(Da,{}),t.jsx(Ja,{children:ce(n.credits)}),t.jsxs(Xa,{children:["($",n.usd.toFixed(2),")"]})]},n.id)})}),t.jsxs(Za,{children:[t.jsxs(es,{children:[t.jsx(ts,{}),t.jsx("span",{children:ce((A==null?void 0:A.credits)??0)})]}),t.jsxs(as,{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:G,children:a("buyModal.buy")})]})]})}const{colors:o,gradients:_s,radius:se}=de,Tt="@media (max-width: 1080px)",T="@media (max-width: 880px)",wt=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
|
+
`,Ct=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: ${o.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: ${o.accent};
|
|
92
|
+
}
|
|
93
|
+
& .ico {
|
|
94
|
+
width: 18px;
|
|
95
|
+
height: 18px;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
${T} {
|
|
99
|
+
display: none;
|
|
100
|
+
}
|
|
101
|
+
`,Ws=i.div`
|
|
102
|
+
display: grid;
|
|
103
|
+
grid-template-columns: minmax(0, 1fr) 615px;
|
|
104
|
+
gap: 24px;
|
|
105
|
+
align-items: start;
|
|
106
|
+
|
|
107
|
+
${Tt} {
|
|
108
|
+
grid-template-columns: 1fr;
|
|
109
|
+
}
|
|
110
|
+
`,jt=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
|
+
`,Fs=i.div`
|
|
124
|
+
min-width: 0;
|
|
125
|
+
display: flex;
|
|
126
|
+
flex-direction: column;
|
|
127
|
+
gap: 12px;
|
|
128
|
+
`,Ls=i.div`
|
|
129
|
+
display: flex;
|
|
130
|
+
align-items: center;
|
|
131
|
+
justify-content: space-between;
|
|
132
|
+
gap: 12px;
|
|
133
|
+
background: ${o.white};
|
|
134
|
+
border-radius: 16px;
|
|
135
|
+
padding: 12px 12px 12px 24px;
|
|
136
|
+
|
|
137
|
+
${T} {
|
|
138
|
+
gap: 8px;
|
|
139
|
+
padding: 12px;
|
|
140
|
+
}
|
|
141
|
+
`,It=i.section`
|
|
142
|
+
min-width: 0;
|
|
143
|
+
background: ${o.white};
|
|
144
|
+
border-radius: 16px;
|
|
145
|
+
padding: 24px;
|
|
146
|
+
|
|
147
|
+
${T} {
|
|
148
|
+
padding: 16px;
|
|
149
|
+
}
|
|
150
|
+
`,Ks=i(It)`
|
|
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: ${o.text};
|
|
160
|
+
|
|
161
|
+
${de.media.maxWidth("mobile")} {
|
|
162
|
+
min-height: 320px;
|
|
163
|
+
padding: 32px 16px;
|
|
164
|
+
}
|
|
165
|
+
`,Us=i.div`
|
|
166
|
+
display: flex;
|
|
167
|
+
flex-direction: column;
|
|
168
|
+
align-items: center;
|
|
169
|
+
gap: 12px;
|
|
170
|
+
padding-bottom: 16px;
|
|
171
|
+
`,Ns=i.p`
|
|
172
|
+
margin: 0;
|
|
173
|
+
font-size: 24px;
|
|
174
|
+
font-weight: 700;
|
|
175
|
+
line-height: 1.6;
|
|
176
|
+
|
|
177
|
+
${de.media.maxWidth("mobile")} {
|
|
178
|
+
font-size: 20px;
|
|
179
|
+
}
|
|
180
|
+
`,Qs=i.p`
|
|
181
|
+
margin: 0;
|
|
182
|
+
font-size: 20px;
|
|
183
|
+
font-weight: 400;
|
|
184
|
+
line-height: 1.6;
|
|
185
|
+
|
|
186
|
+
${de.media.maxWidth("mobile")} {
|
|
187
|
+
font-size: 16px;
|
|
188
|
+
}
|
|
189
|
+
`,Hs=i(ke)`
|
|
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: ${se.card};
|
|
198
|
+
background: ${o.accent};
|
|
199
|
+
color: ${o.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: ${o.accentHover};
|
|
210
|
+
}
|
|
211
|
+
&:focus-visible {
|
|
212
|
+
outline: 2px solid ${o.accent};
|
|
213
|
+
outline-offset: 2px;
|
|
214
|
+
}
|
|
215
|
+
`,Os=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: ${o.text};
|
|
226
|
+
cursor: pointer;
|
|
227
|
+
|
|
228
|
+
& .ico {
|
|
229
|
+
width: 20px;
|
|
230
|
+
height: 20px;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
`,Vs=i.h1`
|
|
234
|
+
margin: 0;
|
|
235
|
+
font-size: 14px;
|
|
236
|
+
font-weight: 600;
|
|
237
|
+
line-height: 1.57;
|
|
238
|
+
color: ${o.text};
|
|
239
|
+
|
|
240
|
+
${T} {
|
|
241
|
+
flex: 1;
|
|
242
|
+
min-width: 0;
|
|
243
|
+
font-size: 16px;
|
|
244
|
+
}
|
|
245
|
+
`,Gs=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: ${se.btn};
|
|
254
|
+
background:
|
|
255
|
+
linear-gradient(${o.white}, ${o.white}) padding-box,
|
|
256
|
+
${_s.amethyst} border-box;
|
|
257
|
+
color: ${o.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
|
+
`,Ds=i.div`
|
|
290
|
+
position: relative;
|
|
291
|
+
display: flex;
|
|
292
|
+
align-items: stretch;
|
|
293
|
+
gap: 12px;
|
|
294
|
+
background: ${o.white};
|
|
295
|
+
border: 1px solid ${o.gray4};
|
|
296
|
+
border-radius: ${se.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
|
+
`,Js=i.div`
|
|
309
|
+
position: relative;
|
|
310
|
+
flex-shrink: 0;
|
|
311
|
+
width: 137.5px;
|
|
312
|
+
height: 137px;
|
|
313
|
+
background: ${o.media};
|
|
314
|
+
border-radius: ${se.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
|
+
`,Xs=i(ke)`
|
|
331
|
+
position: absolute;
|
|
332
|
+
inset: 0;
|
|
333
|
+
display: grid;
|
|
334
|
+
place-items: center;
|
|
335
|
+
`,Zs=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
|
+
`,en=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
|
+
`,tn=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
|
+
`,Pt=Le`
|
|
364
|
+
display: block;
|
|
365
|
+
font-size: 16px;
|
|
366
|
+
font-weight: 600;
|
|
367
|
+
line-height: 1.2;
|
|
368
|
+
color: ${o.text};
|
|
369
|
+
text-decoration: none;
|
|
370
|
+
overflow: hidden;
|
|
371
|
+
text-overflow: ellipsis;
|
|
372
|
+
white-space: nowrap;
|
|
373
|
+
|
|
374
|
+
a&:hover {
|
|
375
|
+
color: ${o.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
|
+
`,an=i.div`
|
|
386
|
+
${Pt};
|
|
387
|
+
`,sn=i(ke)`
|
|
388
|
+
${Pt};
|
|
389
|
+
`,nn=i(ta)`
|
|
390
|
+
font-size: 10px;
|
|
391
|
+
line-height: 1.43;
|
|
392
|
+
color: ${o.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
|
+
`,rn=i.div`
|
|
402
|
+
display: flex;
|
|
403
|
+
align-items: center;
|
|
404
|
+
justify-content: space-between;
|
|
405
|
+
gap: 12px;
|
|
406
|
+
padding-right: 8px;
|
|
407
|
+
`,on=i.div`
|
|
408
|
+
display: inline-flex;
|
|
409
|
+
align-items: center;
|
|
410
|
+
gap: 8px;
|
|
411
|
+
padding: 6px;
|
|
412
|
+
border: 0.5px solid ${o.muted2};
|
|
413
|
+
border-radius: ${se.pill};
|
|
414
|
+
`,kt=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: ${o.text};
|
|
423
|
+
cursor: pointer;
|
|
424
|
+
|
|
425
|
+
&:disabled {
|
|
426
|
+
color: ${o.muted2};
|
|
427
|
+
cursor: default;
|
|
428
|
+
}
|
|
429
|
+
`,cn=i.span`
|
|
430
|
+
min-width: 12px;
|
|
431
|
+
font-size: 14px;
|
|
432
|
+
font-weight: 500;
|
|
433
|
+
line-height: 1.2;
|
|
434
|
+
color: ${o.text};
|
|
435
|
+
text-align: center;
|
|
436
|
+
`,dn=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: ${o.text2};
|
|
446
|
+
|
|
447
|
+
${T} {
|
|
448
|
+
font-size: 20px;
|
|
449
|
+
}
|
|
450
|
+
`,ln=i(St)`
|
|
451
|
+
width: 24px;
|
|
452
|
+
height: 24px;
|
|
453
|
+
background: ${o.text};
|
|
454
|
+
|
|
455
|
+
${T} {
|
|
456
|
+
width: 20px;
|
|
457
|
+
height: 20px;
|
|
458
|
+
}
|
|
459
|
+
`,un=i.span`
|
|
460
|
+
margin-left: 6px;
|
|
461
|
+
font-size: 14px;
|
|
462
|
+
font-weight: 500;
|
|
463
|
+
color: ${o.muted};
|
|
464
|
+
text-decoration: line-through;
|
|
465
|
+
`,hn=i.div`
|
|
466
|
+
position: absolute;
|
|
467
|
+
top: 9px;
|
|
468
|
+
right: 7px;
|
|
469
|
+
display: flex;
|
|
470
|
+
align-items: flex-start;
|
|
471
|
+
gap: 12px;
|
|
472
|
+
`,pn=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: ${o.text2};
|
|
481
|
+
`,gn=i(H)`
|
|
482
|
+
color: #f48221;
|
|
483
|
+
`,xn=i(ke)`
|
|
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: ${o.accent};
|
|
491
|
+
|
|
492
|
+
&:hover {
|
|
493
|
+
color: ${o.accentHover};
|
|
494
|
+
}
|
|
495
|
+
&:focus-visible {
|
|
496
|
+
outline: 2px solid ${o.accent};
|
|
497
|
+
outline-offset: 2px;
|
|
498
|
+
}
|
|
499
|
+
`,mn=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: ${se.chip};
|
|
506
|
+
background: #f4e9ff;
|
|
507
|
+
font-size: 10px;
|
|
508
|
+
font-weight: 400;
|
|
509
|
+
line-height: 14px;
|
|
510
|
+
color: ${o.text};
|
|
511
|
+
`,fn=i(H)`
|
|
512
|
+
width: 11.31px;
|
|
513
|
+
height: 10.94px;
|
|
514
|
+
background: ${o.text};
|
|
515
|
+
`,zt=Le`
|
|
516
|
+
display: grid;
|
|
517
|
+
place-items: center;
|
|
518
|
+
width: 24px;
|
|
519
|
+
height: 24px;
|
|
520
|
+
padding: 0;
|
|
521
|
+
border: 0;
|
|
522
|
+
background: none;
|
|
523
|
+
color: ${o.muted};
|
|
524
|
+
cursor: pointer;
|
|
525
|
+
transition: color 0.12s ease;
|
|
526
|
+
|
|
527
|
+
&:disabled {
|
|
528
|
+
opacity: 0.5;
|
|
529
|
+
cursor: default;
|
|
530
|
+
}
|
|
531
|
+
`,yn=i.button`
|
|
532
|
+
${zt};
|
|
533
|
+
|
|
534
|
+
&:hover:not(:disabled) {
|
|
535
|
+
color: ${o.text};
|
|
536
|
+
}
|
|
537
|
+
&[data-on] {
|
|
538
|
+
color: ${o.dclRed};
|
|
539
|
+
}
|
|
540
|
+
`,bn=i.button`
|
|
541
|
+
${zt};
|
|
542
|
+
|
|
543
|
+
&:hover:not(:disabled) {
|
|
544
|
+
color: ${o.dclRed};
|
|
545
|
+
}
|
|
546
|
+
`,vn=i.div`
|
|
547
|
+
display: flex;
|
|
548
|
+
gap: 20px;
|
|
549
|
+
margin-top: 16px;
|
|
550
|
+
|
|
551
|
+
& .link {
|
|
552
|
+
font-size: 13px;
|
|
553
|
+
color: ${o.muted};
|
|
554
|
+
font-weight: 600;
|
|
555
|
+
}
|
|
556
|
+
& .link:hover:not(:disabled) {
|
|
557
|
+
color: ${o.text};
|
|
558
|
+
}
|
|
559
|
+
`,wn=i.aside`
|
|
560
|
+
position: sticky;
|
|
561
|
+
top: 172px;
|
|
562
|
+
display: flex;
|
|
563
|
+
flex-direction: column;
|
|
564
|
+
background: ${o.white};
|
|
565
|
+
box-shadow: 0 1px 3px rgba(22, 21, 24, 0.06);
|
|
566
|
+
border-radius: 16px;
|
|
567
|
+
padding: 16px;
|
|
568
|
+
|
|
569
|
+
${Tt} {
|
|
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
|
+
`,Cn=i.h2`
|
|
584
|
+
margin: 0 0 24px;
|
|
585
|
+
padding-bottom: 16px;
|
|
586
|
+
border-bottom: 1px solid ${o.gray4};
|
|
587
|
+
font-size: 24px;
|
|
588
|
+
font-weight: 600;
|
|
589
|
+
color: ${o.text};
|
|
590
|
+
|
|
591
|
+
${T} {
|
|
592
|
+
margin-bottom: 12px;
|
|
593
|
+
padding-bottom: 12px;
|
|
594
|
+
}
|
|
595
|
+
`,jn=i.div`
|
|
596
|
+
display: flex;
|
|
597
|
+
flex-direction: column;
|
|
598
|
+
gap: 12px;
|
|
599
|
+
`,kn=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: ${o.muted1};
|
|
609
|
+
`,$n=i.span`
|
|
610
|
+
display: inline-flex;
|
|
611
|
+
align-items: center;
|
|
612
|
+
gap: 8px;
|
|
613
|
+
font-size: 24px;
|
|
614
|
+
font-weight: 700;
|
|
615
|
+
color: ${o.text};
|
|
616
|
+
`,Mn=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: ${o.muted};
|
|
627
|
+
`;const Tn=i(St)`
|
|
628
|
+
width: 30px;
|
|
629
|
+
height: 30px;
|
|
630
|
+
background: ${o.text};
|
|
631
|
+
-webkit-mask-size: 24px 24px;
|
|
632
|
+
mask-size: 24px 24px;
|
|
633
|
+
-webkit-mask-position: left center;
|
|
634
|
+
mask-position: left center;
|
|
635
|
+
`,At=Le`
|
|
636
|
+
margin: 0;
|
|
637
|
+
font-size: 13px;
|
|
638
|
+
`,ve=i.p`
|
|
639
|
+
${At};
|
|
640
|
+
`,In=i($s)`
|
|
641
|
+
${At};
|
|
642
|
+
`,Pn=i.div`
|
|
643
|
+
position: relative;
|
|
644
|
+
/* Takes the leftover height so its white ::before covers it — see .page[data-route="/cart"]. */
|
|
645
|
+
flex: 1 0 auto;
|
|
646
|
+
margin-top: 48px;
|
|
647
|
+
/* The whole gap from the top of the cross-sell to the "You might also like" heading — the shared
|
|
648
|
+
carousel's own top margin is zeroed below so this padding isn't stacked on top of it. */
|
|
649
|
+
padding: 47px 0 24px;
|
|
650
|
+
|
|
651
|
+
&::before {
|
|
652
|
+
content: '';
|
|
653
|
+
position: absolute;
|
|
654
|
+
top: 0;
|
|
655
|
+
bottom: -80px; /* eat .page's bottom padding so the white reaches the footer */
|
|
656
|
+
left: 50%;
|
|
657
|
+
width: 100vw;
|
|
658
|
+
transform: translateX(-50%);
|
|
659
|
+
background: ${o.bg};
|
|
660
|
+
z-index: 0;
|
|
661
|
+
}
|
|
662
|
+
& > * {
|
|
663
|
+
position: relative;
|
|
664
|
+
z-index: 1;
|
|
665
|
+
}
|
|
666
|
+
& section {
|
|
667
|
+
margin-top: 0;
|
|
668
|
+
}
|
|
669
|
+
`;function We(r){if(ks(r))return a("errors.rejected");const l=(r.message??"").toLowerCase();return l.includes("insufficient")?a("cart.error.insufficient",{currency:fa.name}):l.includes("no active listing")||l.includes("your own listing")?a("cart.error.listingChanged"):a("marketCheckout.error.generic")}const zn=12e4;function An(r){const l=[];return r.unavailable.length&&l.push(a("cart.drop.unavailable",{count:r.unavailable.length})),r.own.length&&l.push(a("cart.drop.own",{count:r.own.length})),a("cart.drop.removed",{items:l.join(` ${a("cart.drop.and")} `)})}const Fe=r=>r.reduce((l,I)=>l+I.priceCredits*I.quantity,0),we=r=>r.flatMap(l=>Array.from({length:l.quantity},()=>({...l,quantity:1})));function Vn(){aa({title:a("nav.cart"),noindex:!0});const r=Q(e=>e.items),l=Q(e=>e.remove),I=Q(e=>e.increment),z=Q(e=>e.decrement),W=Q(e=>e.clear),G=Q(e=>e.restore),Y=Q(e=>e.setFittingOpen),A=ot(e=>e.items),ne=ot(e=>e.toggle),{session:n,signIn:L}=sa(),Et=na(),le=vs().packs.slice(0,ws);P.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const qt=r.some(e=>e.category!=="emote"),{data:Se}=ia({queryKey:["upsell-listings"],queryFn:()=>va({first:40}),staleTime:6e4}),{data:S}=ra(n),v=oa(),Z=Xt(),{state:D}=Zt(),[Bt,ie]=P.useState(null),[Ke,ue]=P.useState(null),[Rt,B]=P.useState(!1),[R,O]=P.useState(null),Ue=P.useRef(0),[g,j]=P.useState(null),{data:he}=ca(n),{data:re}=da(!0),[$e,Ne]=P.useState(""),oe=P.useRef(null),Qe=la(r),He=e=>dt(Qe[e.id]),Me=r.filter(He),Oe=r.length>0&&Me.length===0,_t=Me.reduce((e,s)=>e+s.priceCredits*s.quantity,0),Wt=r.reduce((e,s)=>e+s.quantity,0),Ft=Me.reduce((e,s)=>e+s.quantity,0),Ve=R?R.liveTotalCredits:_t,Lt=new Set(r.map(e=>e.id)),Ge=((Se==null?void 0:Se.items)??[]).filter(e=>!Lt.has(e.id)).slice(0,12),Kt=new Map(R==null?void 0:R.buyable.map(e=>[e.item.id,e])),pe=(S==null?void 0:S.credits)??0,Te=Ve*10,Ut=re?ct(Te,re):0n,Ie=Re({priceCents:Te,priceManaWei:Ut,balanceCents:(S==null?void 0:S.balanceCents)??0,manaBalanceWei:he??0n}),Nt=e=>e.some(s=>s.acquisition==="store"),Pe=e=>e.flatMap(s=>s.acquisition==="trade"?[s]:[]),Qt=ga,Ht=e=>ma(e.contractAddress,String(e.itemId));function ge(e){e(),O(null),ue(null),ie(null)}function Ot(){j(null),B(!1)}function Ye(e){const s=Fe(e),d=Math.max(0,s-pe),c=le.find(u=>u.credits>=d)??le[le.length-1];Ne(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,$=new Set,_=new Set,E=[];let q=!1;j({phase:"processing",stage:"reserving",step:1,total:s.length});try{const y=[];for(let m=0;m<s.length;m++){const p=s[m];j({phase:"processing",stage:"reserving",step:m+1,total:s.length});try{const M=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:N,maxCreditedValue:X}=await ht(n.identity,p.usdCents,M,C);u.push({salt:N.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:[N],maxCreditedValue:X,chainId:p.item.chainId}:{kind:"trade",trade:p.trade,credits:[N],maxCreditedValue:X})}catch(M){if(Ss(M)){if(u.length){try{await qe(n.identity,u.map(C=>C.salt))}catch(C){te(C,{flow:"cart_checkout",step:"release"})}v.invalidateQueries({queryKey:["usd-balance"]})}Ye(e);return}throw M}}h="submit";const x=ms(y).length,k=m=>x>1?{current:m,total:x}:void 0,F=(m,p)=>j({phase:"processing",stage:m,step:s.length,total:s.length,signatures:k(p)}),K=m=>m<x?F("awaiting-signature",m+1):F("settling",x);F("awaiting-signature",1);let f=[];if(ls())try{const m=new Map;f=await fs({purchases:y,buyer:n.address,signer:n.signer,onSigned:()=>K(x),onBroadcast:({txHash:C,salts:N})=>{m.set(C,N),N.forEach(X=>w.add(X))}});const p=await Promise.allSettled(f.map(C=>ys(C)));p.forEach((C,N)=>{const X=m.get(f[N])??[];C.status==="fulfilled"?(X.forEach(Ee=>$.add(Ee)),E.push(f[N])):C.reason instanceof bt||X.forEach(Ee=>_.add(Ee))});const M=p.flatMap(C=>C.status==="rejected"?[C.reason]:[]);if(M.length&&!M.some(C=>C instanceof bt))throw M[0];q=!0}catch(m){if(!(m instanceof bs)||!ya(n.providerType))throw m;f=await _e({purchases:y,buyer:n.address,signer:n.signer,onSigned:K,onBroadcast:({salts:p})=>p.forEach(M=>w.add(M)),onSettled:({txHash:p,salts:M})=>{M.forEach(C=>$.add(C)),E.push(p)},onReverted:({salts:p})=>p.forEach(M=>_.add(M))})}else f=await _e({purchases:y,buyer:n.address,signer:n.signer,onSigned:K,onBroadcast:({salts:m})=>m.forEach(p=>w.add(p)),onSettled:({txHash:m,salts:p})=>{p.forEach(M=>$.add(M)),E.push(m)},onReverted:({salts:m})=>m.forEach(p=>_.add(p))});e.forEach(m=>l(m.item.id)),O(null),V("Shop Completed Purchase",{...me(d),payment_type:"credits",no_crypto_step:q,transaction_hash:f[0]??null}),yt(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}:{}};Z("/success",{state:U,replace:!0})}catch(y){fe(y)||te(y,{flow:"cart_checkout",step:h,cart_size:e.length});const x=new Set([...w].filter(b=>!_.has(b))),{toRelease:k,boughtItemIds:F}=vt({reservations:u,spent:x,settled:$}),K=d.filter(b=>F.includes(b.id)),f=d.filter(b=>!F.includes(b.id));if(V(fe(y)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:h,error_code:pt(y),value_usd:lt(f.reduce((b,U)=>b+U.priceCredits,0)),cart_size:s.length,partial:K.length>0}),k.length)try{await qe(n.identity,k)}catch(b){te(b,{flow:"cart_checkout",step:"release"})}if(v.invalidateQueries({queryKey:["usd-balance"]}),K.length>0){F.forEach(b=>l(b)),O(null),yt(v),V("Shop Completed Purchase",{...me(K),payment_type:"credits",no_crypto_step:q,transaction_hash:E[0]??null,partial:!0}),j({phase:"error",message:a("cart.error.partiallyBought")}),B(!1);return}j({phase:"error",message:We(y)})}}function De(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}:{}};Z("/success",{state:c,replace:!0})}function Je(e,s){fe(e)||te(e,{flow:s,step:"submit"}),V(fe(e)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:pt(e)}),j({phase:"error",message:We(e)}),B(!1)}async function Vt(e,s){const d=ye(Be.MANAToken,s),c=ye(Be.CreditsManager,s);await gs({auth:{kind:xs.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",ut.chainId],queryFn:()=>xa(ut.chainId),staleTime:6e4})}catch{return}}async function Gt(e){const s=we(e).reduce((h,w)=>h+w.usdCents,0),c=(he??0n)>0n?await Xe():re,u=c?ct(s,c):0n;return{totalCents:s,manaWei:u}}async function Ze(e,s){const d=Fe(e),{totalCents:c,manaWei:u}=await Gt(e),h=Re({priceCents:c,priceManaWei:u,balanceCents:(S==null?void 0:S.balanceCents)??0,manaBalanceWei:he??0n}),w=Nt(e)?{...h,options:h.options.filter($=>$.method==="credits")}:h;if(s&&w.options.some($=>$.method===s)){if(s==="credits"){ze(e);return}const{spender:$,chainId:_}=et(s,e);await tt($,_,()=>s==="mana"?void at(e):void st(e,c,u));return}if(w.options.some($=>$.method==="mana"||$.method==="combined")){j({phase:"choose",lines:e,totalCents:c,manaWei:u}),B(!1);return}if(S!=null&&S.credits<d){Ye(e);return}ze(e)}function Yt(e){return Re({priceCents:e.totalCents,priceManaWei:e.manaWei,balanceCents:(S==null?void 0:S.balanceCents)??0,manaBalanceWei:he??0n})}const[Ae,xe]=P.useState(null);function et(e,s){const d=Pe(s)[0].trade;return{spender:e==="mana"?ye(ba(d.contract),d.chainId).address:ye(Be.CreditsManager,d.chainId).address,chainId:d.chainId}}async function tt(e,s,d){const c=us(s,e),u=n?await hs(c,n.address).catch(()=>!0):!0;if(ps(n==null?void 0:n.providerType,u)){B(!1),xe({auth:c,run:d});return}d()}function Dt(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 os({trades:Pe(s).map(w=>w.trade),buyer:n.address,signer:n.signer,onSigned:u});e.forEach(w=>l(w.item.id)),O(null),V("Shop Completed Purchase",{...me(d),payment_type:"mana",transaction_hash:h[0]??null}),v.invalidateQueries({queryKey:["mana-balance"]}),De(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(x=>({...x.item,priceCredits:x.priceCredits})),h=e.map(x=>({...x.item,priceCredits:x.priceCredits,quantity:x.quantity})),w=cs(c.map(x=>x.usdCents),(S==null?void 0:S.balanceCents)??0),$=w.reduce((x,k)=>x+k,0),_=ds(Math.max(0,s-$),s,d),E=[],q=new Set,y=new Set;j({phase:"processing",stage:"reserving",step:1,total:c.length});try{const x=Pe(c),k=[];for(let f=0;f<x.length;f++){const b=w[f];if(b<=0)continue;j({phase:"processing",stage:"reserving",step:f+1,total:x.length});const U=x[f].item,{credit:m,maxCreditedValue:p}=await ht(n.identity,b,x[f].trade.id,U.contractAddress&&U.itemId!=null?{contractAddress:U.contractAddress,itemId:String(U.itemId)}:void 0);E.push({salt:m.id,itemId:U.id}),k.push({kind:"trade",trade:x[f].trade,credits:[m],maxCreditedValue:p})}x.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)+_).toString()},await Vt(n.signer,x[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 _e({purchases:k,buyer:n.address,signer:n.signer,onSigned:F,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)),O(null),V("Shop Completed Purchase",{...me(u),payment_type:"credits_and_mana",transaction_hash:K[0]??null}),v.invalidateQueries({queryKey:["mana-balance"]}),De(h,K)}catch(x){const{toRelease:k}=vt({reservations:E,spent:new Set([...q].filter(F=>!y.has(F))),settled:new Set});k.length&&qe(n.identity,k).catch(()=>{}),E.length&&v.invalidateQueries({queryKey:["usd-balance"]}),Je(x,"buy_cart_combined")}}async function ee(e){if(!n){ft({type:"cart-checkout"}),L();return}const s=Q.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:lt(d),has_sufficient_credits:pe>=d});try{const c=await Cs(s,n.address,Qt,await Xe(),Ht),u=[...c.unavailable,...c.own];if(u.length&&(u.forEach(h=>l(h.id)),ue(An(c))),c.buyable.length===0){ie(a("cart.error.noneAvailable")),O(null);return}if(c.orderChanged){O(c),Ue.current=Date.now();return}await Ze(c.buyable,e)}catch(c){te(c,{flow:"cart_checkout",step:"review",cart_size:s.length}),ie(We(c))}finally{B(!1)}}async function nt(){if(R){if(!n){ft({type:"cart-checkout"}),L();return}if(Date.now()-Ue.current>zn){O(null),ue(null),await ee();return}ie(null),Ze(R.buyable)}}async function Jt(){if($e){try{sessionStorage.setItem(be,JSON.stringify(Q.getState().items))}catch{}B(!0);try{const e=await js($e,n?{address:n.address,identity:n.identity}:void 0);if(e.url){window.location.href=e.url;return}Z("/credits")}catch(e){try{sessionStorage.removeItem(be)}catch{}te(e,{flow:"cart_buy_credits"}),j({phase:"error",message:a("buyModal.error.creditsCheckout")})}finally{B(!1)}}}const it=P.useRef(!1);P.useEffect(()=>{if(!n||it.current||!ss("cart-checkout"))return;it.current=!0;const e=setTimeout(()=>void ee(),0);return()=>clearTimeout(e)},[n]);const rt=P.useRef(!1);P.useEffect(()=>{if(!(D!=null&&D.resumeCheckout)||rt.current)return;rt.current=!0,oe.current=D.creditsAdded??null;try{const s=sessionStorage.getItem(be);if(s){sessionStorage.removeItem(be);const d=JSON.parse(s);Array.isArray(d)&&d.length&&G(d)}}catch{}v.invalidateQueries({queryKey:["usd-balance"]});const e=setTimeout(()=>void ee(),0);return()=>clearTimeout(e)},[D==null?void 0:D.resumeCheckout]);const J=Rt||(g==null?void 0:g.phase)==="processing";return r.length===0&&!g?t.jsx(wt,{children:t.jsxs(jt,{children:[t.jsxs(Ct,{onClick:()=>Z(-1),type:"button",children:[t.jsx(H,{name:"arrow-left"}),a("nav.cart")]}),t.jsxs(Ks,{"data-testid":"cart-empty",children:[t.jsx(H,{name:"cart-plus",size:110}),t.jsxs(Us,{children:[t.jsx(Ns,{children:a("cart.empty.title")}),t.jsx(Qs,{children:a("cart.empty.body")})]}),t.jsx(Hs,{to:"/items",children:a("cart.empty.cta")})]})]})}):t.jsxs(wt,{children:[t.jsxs(jt,{children:[t.jsxs(Ct,{onClick:()=>Z(-1),type:"button",children:[t.jsx(H,{name:"arrow-left"}),a("nav.cart")]}),t.jsxs(Ws,{children:[t.jsxs(Fs,{children:[t.jsxs(Ls,{children:[t.jsx(Os,{onClick:()=>Z(-1),type:"button","aria-label":a("cart.goBack"),children:t.jsx(H,{name:"arrow-left"})}),t.jsx(Vs,{children:a("cart.panelTitle",{count:Wt})}),qt?t.jsxs(Gs,{onClick:()=>Y(!0),disabled:J,children:[t.jsx(H,{name:"fitting-room"}),a("cart.fittingRoom")]}):null]}),t.jsxs(It,{children:[t.jsx(Ys,{children:r.map(e=>{const s=Kt.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,$=d*h,_=ua(e),E=!!_&&!!A[_],q=ha(e),y=Qe[e.id],x=!dt(y),k=y==="sold-out"?a("cart.availability.soldOut"):a("cart.availability.unavailable");return t.jsxs(Ds,{"data-unavailable":x||void 0,children:[t.jsxs(Js,{"data-thumb":!0,children:[q?t.jsx(Xs,{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(Zs,{"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(en,{children:[t.jsxs(tn,{"data-desc":!0,children:[q?t.jsx(sn,{to:q,state:{item:e,tradeId:e.tradeId},title:e.name,children:e.name}):t.jsx(an,{title:e.name,children:e.name}),e.creator?t.jsx(nn,{address:e.creator,linkToProfile:!0}):null,Et&&u?t.jsxs(mn,{"data-testid":"cart-creator-tag",children:[t.jsx(fn,{name:"buy-from-creator"}),a("cart.creatorTag")]}):null]}),t.jsx(rn,{children:x?t.jsxs(t.Fragment,{children:[t.jsxs(pn,{children:[t.jsx(gn,{name:"warning-fill",size:24}),k]}),q?t.jsx(xn,{to:q,state:{item:e,tradeId:e.tradeId},children:a("cart.availability.viewResales")}):null]}):t.jsxs(t.Fragment,{children:[u?t.jsxs(on,{children:[t.jsx(kt,{onClick:()=>ge(()=>z(e.id)),disabled:J||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(cn,{children:h}),t.jsx(kt,{onClick:()=>ge(()=>I(e.id)),disabled:J||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(dn,{children:[t.jsx(ln,{})," ",$,c?t.jsx(un,{children:e.priceCredits*h}):null]})]})})]}),t.jsxs(hn,{children:[_?t.jsx(yn,{"data-on":E||void 0,onClick:()=>ne(e),"aria-label":E?a("cart.removeFromFavorites",{name:e.name}):a("cart.addToFavorites",{name:e.name}),title:E?a("assetCard.removeFromFavorites"):a("assetCard.addToFavorites"),children:t.jsx(H,{name:E?"heart-solid":"heart"})}):null,t.jsx(bn,{onClick:()=>ge(()=>l(e.id)),disabled:J,"aria-label":a("cart.remove",{name:e.name}),title:a("cart.removeTitle"),children:t.jsx(H,{name:"trash",size:24})})]})]},e.id)})}),t.jsx(vn,{children:t.jsx("button",{className:"link",onClick:()=>ge(W),disabled:J,children:a("cart.clearCart")})})]})]}),t.jsxs(wn,{children:[t.jsx(Cn,{children:a("cart.purchaseSummary")}),t.jsxs(jn,{children:[t.jsxs(kn,{children:[t.jsx(Sn,{children:a("cart.totalItems",{count:Ft})}),t.jsx(Mn,{children:t.jsxs($n,{children:[t.jsx(Tn,{})," ",Ve]})})]}),t.jsx($t,{options:Ie.options,totalCents:Te,shortfall:Ie.manaShortfall,showCreditsAmount:!1,creditsLabel:R?a("marketCheckout.confirmPurchase"):Ie.options.length>1?a("cart.buyWithCredits"):a("cart.checkout"),busy:J||Oe,onPay:e=>void(R?nt():ee(e)),creditsFallback:{label:J?a("cart.working"):R?a("marketCheckout.confirmPurchase"):a("cart.checkout"),onClick:()=>void(R?nt():ee())}}),Oe?t.jsx(ve,{className:"muted",children:a("cart.allUnavailable")}):null,n?null:t.jsx(ve,{className:"muted",children:a("cart.signInHint")}),R?t.jsx(ve,{className:"muted",children:a("cart.priceChanged")}):null,Ke?t.jsx(ve,{className:"muted",children:Ke}):null,t.jsx(In,{message:Bt})]})]})]})]}),Ge.length>0?t.jsx(Pn,{children:t.jsx(ns,{title:a("cart.youMightAlsoLike"),items:Ge})}):null,Ae&&n?t.jsx(is,{auth:Ae.auth,signer:n.signer,title:a("authorizeStep.manaTitle"),name:a("authorizeStep.manaName"),reason:a("authorizeStep.manaReason"),icon:t.jsx("img",{src:rs,width:24,height:24,alt:"","aria-hidden":!0}),onAuthorized:()=>{const{run:e}=Ae;xe(null),e()},onCancel:()=>xe(null),onClose:()=>xe(null)}):null,g?t.jsx(qs,{phase:g.phase,balanceCredits:pe,onClose:Ot,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:pa(n==null?void 0:n.providerType),signatures:g.phase==="processing"?g.signatures:void 0,options:g.phase==="choose"?Yt(g).options:void 0,onPay:Dt,totalCents:g.phase==="choose"?g.totalCents:void 0,totalManaWei:g.phase==="choose"?g.manaWei:void 0,totalCredits:g.phase==="choose"?Fe(g.lines):void 0,lines:g.phase==="nofunds"?g.lines:void 0,shortfallCredits:g.phase==="nofunds"?g.shortfall:void 0,packs:le,selectedPack:$e,onSelectPack:Ne,onBuyPacks:()=>void Jt(),message:g.phase==="error"?g.message:void 0,onRetry:()=>void ee()}):null]})}export{Vn as Cart};
|