@dcl/shop 1.2.1-31142410827.commit-447715b → 1.3.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-CxjV6VXk.js → Activity-ew3XpoT3.js} +4 -4
- package/_assets/{AnimatedBackground-BiXIwT8i.js → AnimatedBackground-D_nEuM-e.js} +1 -1
- package/_assets/{Assets-DVK807CG.js → Assets-cBlMqNjz.js} +18 -18
- package/_assets/{Assets.styles-A3yRI2MU.js → Assets.styles-CLwfDCDf.js} +1 -1
- package/_assets/{Authorizations-D1FoQR5j.js → Authorizations-Cs0nL4Oz.js} +3 -3
- package/_assets/Cart-BO4t_lkf.js +696 -0
- package/_assets/{CircularProgress-D5sNhvlC.js → CircularProgress-GqV7M35A.js} +4 -4
- package/_assets/{Collection-Bqw8AoVr.js → Collection-dJYcennk.js} +7 -7
- package/_assets/CollectionCarousel-uJ5UjL8j.js +872 -0
- package/_assets/{Confetti-CDwPqeLK.js → Confetti-CFn9Pw72.js} +1 -1
- package/_assets/{Creator-6eREKFWS.js → Creator-CuGxdrmY.js} +23 -23
- package/_assets/{ErrorNotice-BQwK_TDE.js → ErrorNotice-CJ7LbSaM.js} +1 -1
- package/_assets/{ExchangeController-BX6K_R7F.js → ExchangeController-CwGAtelJ.js} +1 -1
- package/_assets/{Faq-D_JBmT_h.js → Faq-CDhDmUOq.js} +1 -1
- package/_assets/{GetCredits-Q0Mgpypn.js → GetCredits-1I-xEtGF.js} +18 -18
- package/_assets/{Grow-DXIhfb0h.js → Grow-CVnVH5HV.js} +1 -1
- package/_assets/{HelpersUtil-BTJgul2J.js → HelpersUtil-DeEtn4Uv.js} +1 -1
- package/_assets/ItemDetail-R2KchS-D.js +3577 -0
- package/_assets/LazyEmoteControls-C8q58ZLn.js +2 -0
- package/_assets/{LoadMore-D20OD6Vd.js → LoadMore-CRwBs35r.js} +1 -1
- package/_assets/{ManaPricingBanner.styles-DGbgCot9.js → ManaPricingBanner.styles-BlUs3NYz.js} +1 -1
- package/_assets/{MyAssets-D-pR6nEY.js → MyAssets-Crv1OZqH.js} +5 -5
- package/_assets/{MyFavorites-BZJTE-15.js → MyFavorites-BsDoGy_0.js} +1 -1
- package/_assets/{NotFound-CY50b1nf.js → NotFound-CTrYO3ch.js} +1 -1
- package/_assets/{NotificationsBell-B4g5IIot.js → NotificationsBell-DRGgz2iS.js} +1 -1
- package/_assets/{OutfitDetail-BVF3gVX4.js → OutfitDetail-PIgUTZD2.js} +13 -13
- package/_assets/{OutfitPreview-BH8Vtdqe.js → OutfitPreview-B7Y1-68b.js} +2 -2
- package/_assets/{OutfitStudio-CkkYfM7v.js → OutfitStudio-Bsv8_JeA.js} +11 -11
- package/_assets/{StoreSettings-ByjR6E4Q.js → StoreSettings-BH1LqeM8.js} +5 -5
- package/_assets/{Success-ChdN3XnW.js → Success-C0JqrNNn.js} +4 -4
- package/_assets/{SwapController-BSn7c8IX.js → SwapController-B403gwlM.js} +1 -1
- package/_assets/{Tooltip-C20chtvP.js → Tooltip-Bb6q6TxX.js} +1 -1
- package/_assets/TradeService-BsjSuIVy.js +1 -0
- package/_assets/{W3MFrameProviderSingleton-DM1LkzC3.js → W3MFrameProviderSingleton-B6S06Y_H.js} +3 -3
- package/_assets/{WebCryptoP256-DtXjN3TD.js → WebCryptoP256-CI6-qWGK.js} +1 -1
- package/_assets/authorizations-CRcoV7f0.js +1 -0
- package/_assets/{basic-CKrSeG36.js → basic-DEn_IlUm.js} +1 -1
- package/_assets/{biconomy-CraeH257.js → biconomy-DvPM-XBT.js} +1 -1
- package/_assets/{builder-C8bXNaZ5.js → builder-Npez-0pQ.js} +1 -1
- package/_assets/buy-CRR9-X2w.js +1 -0
- package/_assets/buy-gasless-Cj1VGZpP.js +1 -0
- package/_assets/{categories-C5jojgbc.js → categories-CMYRFP-3.js} +4 -4
- package/_assets/{ccip-BTuFCSPg.js → ccip-Bvp_nKL6.js} +1 -1
- package/_assets/{ccip-Bb0XTJKs.js → ccip-DFr4gxX6.js} +1 -1
- package/_assets/{collectionPage.styles-BQBK8RFg.js → collectionPage.styles-B4iEFMy_.js} +1 -1
- package/_assets/{controller-BslzK_oR.js → controller-CgyRh-Bw.js} +2 -2
- package/_assets/{core-A4i7e9_h.js → core-B7wRtbuZ.js} +4 -4
- package/_assets/{createSvgIcon-DtyE83ul.js → createSvgIcon-Bo9WJgq_.js} +4 -4
- package/_assets/{custom-IpjkpKYP.js → custom-CH6sSlIL.js} +1 -1
- package/_assets/{data-capture-BylIfDOD.js → data-capture-DreW3nks.js} +1 -1
- package/_assets/{email-C_gUvpJ8.js → email-pIKOIyQR.js} +1 -1
- package/_assets/{embedded-wallet-BZVHH3C_.js → embedded-wallet-CLmF0Kdd.js} +1 -1
- package/_assets/{emotion-styled.browser.esm-BvfQxvDt.js → emotion-styled.browser.esm-BqTQ5SYv.js} +1 -1
- package/_assets/{engine-B73Qkzgt.js → engine-D64OXa1r.js} +1 -1
- package/_assets/{errors-CX9EJ2UZ.js → errors-BbwwHm_0.js} +1 -1
- package/_assets/{estimate-l1-fee-Bjxio48q.js → estimate-l1-fee-BU85AjOG.js} +1 -1
- package/_assets/{execute-BR9GMA2A.js → execute-BozDg2yb.js} +2 -2
- package/_assets/{features-CoryLSMJ.js → features-BDTF_ohu.js} +1 -1
- package/_assets/{fetchTokenMetadata-BcVWHlEL.js → fetchTokenMetadata-BT4wvs8u.js} +2 -2
- package/_assets/{field.styles-BX2ce_24.js → field.styles-C3qh-tZ2.js} +1 -1
- package/_assets/{get-ecosystem-wallet-info-BFR9-DCg.js → get-ecosystem-wallet-info-BlqgcGd0.js} +1 -1
- package/_assets/{getBalance-OP0XWTi2.js → getBalance-B89LWv-k.js} +1 -1
- package/_assets/{getNFT-BsALO_-5.js → getNFT-CMlAXi2W.js} +1 -1
- package/_assets/{getNFT--XquMmAd.js → getNFT-Cy5QJvSJ.js} +1 -1
- package/_assets/{grid.styles-D3oxiL_A.js → grid.styles-B2Eu32l1.js} +1 -1
- package/_assets/{hashTypedData-BZTDP8kP.js → hashTypedData-5hKkNljV.js} +1 -1
- package/_assets/{hashTypedData-CJy6tOpf.js → hashTypedData-CVMcc6Hz.js} +1 -1
- package/_assets/{in-app-bTj5LvvL.js → in-app-BiD_q7tQ.js} +1 -1
- package/_assets/{in-app-wallet-calls-V54KdLrU.js → in-app-wallet-calls-BxK-hX9G.js} +1 -1
- package/_assets/{index-D-JDvnI6.js → index-2KdRKXEu.js} +1 -1
- package/_assets/{index-B6qDcfLC.js → index-69aWe7LF.js} +1 -1
- package/_assets/{index-YzDw7lnB.js → index-BCSwRUu3.js} +1 -1
- package/_assets/{index-PfvTvnFS.js → index-BLQrxn9F.js} +1 -1
- package/_assets/{index-UKtYEQEQ.js → index-BNtwDdqR.js} +1 -1
- package/_assets/{index-DV6xJ5R3.js → index-BS9mRV4X.js} +1 -1
- package/_assets/{index-C8Kc50nN.js → index-BU93X1R1.js} +1 -1
- package/_assets/{index-zp7bpiif.js → index-Baqe51s4.js} +1 -1
- package/_assets/{index-Bs-rgt8S.js → index-BawFzGfz.js} +1 -1
- package/_assets/{index-Ceqm243m.js → index-BbAhN-VL.js} +1 -1
- package/_assets/{index-gDU5HG0M.js → index-BfrZo6vI.js} +1 -1
- package/_assets/{index-C8xBYuq6.js → index-Bj_Y4oBT.js} +1 -1
- package/_assets/{index-BfDKCK-b.js → index-Brr2CMye.js} +1 -1
- package/_assets/{index-CEAo9zba.js → index-BvQGZppV.js} +1 -1
- package/_assets/{index-CfuAIPVB.js → index-BwVlQTGw.js} +1 -1
- package/_assets/{index-CWbpUhbz.js → index-ByMxSKoO.js} +1 -1
- package/_assets/{index-DSeFRPGN.js → index-C0Tjm6c2.js} +2 -2
- package/_assets/{index-D8uCQOfi.js → index-C54j1-wd.js} +1 -1
- package/_assets/{index-BzlJrLzv.js → index-CD88wagS.js} +1 -1
- package/_assets/{index-CLKNbQ2Y.js → index-CGyHa-8V.js} +1 -1
- package/_assets/{index-0lnGEb9H.js → index-CKJapgfm.js} +1 -1
- package/_assets/{index-B2t9sa1E.js → index-CKK-zMqi.js} +72 -72
- package/_assets/{index-Bam-2vzo.js → index-CL_zZiR1.js} +1 -1
- package/_assets/{index-md2wV3Vc.js → index-COl_MS2X.js} +1 -1
- package/_assets/{index-DReHody5.js → index-CRNF_QU5.js} +1 -1
- package/_assets/{index-Tv4r9Lwx.js → index-CU54HyHs.js} +1 -1
- package/_assets/{index-w6ENWwBi.js → index-CdmghwAv.js} +1 -1
- package/_assets/{index-rkAdeG6n.js → index-CgPj91Wh.js} +1 -1
- package/_assets/{index-Bi2VdHZq.js → index-CoC4ZTSB.js} +3 -3
- package/_assets/{index-Cf_haBRI.js → index-D2gLfWlc.js} +1 -1
- package/_assets/{index-CNeTXjRv.js → index-D4mfZpjO.js} +2 -2
- package/_assets/{index-BFqY25SM.js → index-D6N8FICT.js} +2 -2
- package/_assets/{index-CJKoD8At.js → index-D7-5iUKs.js} +1 -1
- package/_assets/{index-BhMQwy2J.js → index-DKDGLsyf.js} +1 -1
- package/_assets/{index-Bu1qaX74.js → index-DQT21rdJ.js} +1 -1
- package/_assets/{index-DVvKTSOr.js → index-DRZIPiLU.js} +11 -11
- package/_assets/{index-2eCGZaTL.js → index-DRwratoB.js} +1 -1
- package/_assets/{index-D9DKKnsH.js → index-DmJfaFSK.js} +1 -1
- package/_assets/{index-Brb4suFu.js → index-DnZSYmpU.js} +1 -1
- package/_assets/{index-Bc5nlTSa.js → index-DnhjRPd0.js} +1 -1
- package/_assets/{index-iQ7iCCBF.js → index-DnlLS_ys.js} +1 -1
- package/_assets/{index-lkLKW4IC.js → index-DsKwbNYL.js} +1 -1
- package/_assets/{index-Coc88CNs.js → index-DxKuqcFg.js} +1 -1
- package/_assets/{index-BQGrMQAe.js → index-Dy-uR3t4.js} +1 -1
- package/_assets/{index-BTO7S5s4.js → index-E4Z_g959.js} +3 -3
- package/_assets/{index-BsvoYnWP.js → index-Eas9yoRi.js} +1 -1
- package/_assets/{index-BAAdKhhE.js → index-GomvWLkv.js} +1 -1
- package/_assets/{index-CNfRDyX8.js → index-UWPTFHML.js} +1 -1
- package/_assets/{index-CoZGIPvy.js → index-Xe0zG67j.js} +2 -2
- package/_assets/{index-Dz2XpmN8.js → index-bVwIZVq2.js} +1 -1
- package/_assets/{index-CD7rVCS9.js → index-hnGTtZoN.js} +3 -3
- package/_assets/{index-CVzFwkR2.js → index-tt5vpwow.js} +1 -1
- package/_assets/{index.es-Cf1qw100.js → index.es-BYW_XSuo.js} +4 -4
- package/_assets/{index.es-D8QRPbHG.js → index.es-D0J6Rjn_.js} +1 -1
- package/_assets/{index.es-D-iJF_vP.js → index.es-wL4nLZcl.js} +1 -1
- package/_assets/{localBatchGatewayRequest-mmyGx97_.js → localBatchGatewayRequest-CBnpaR4-.js} +1 -1
- package/_assets/{networks-auA2rGBi.js → networks-D41xdN6D.js} +1 -1
- package/_assets/{onramp-DnEfmJx7.js → onramp-DR5Lm3nA.js} +1 -1
- package/_assets/{openzeppelin-IGdhY6bS.js → openzeppelin-B19X12pO.js} +1 -1
- package/_assets/{parseNft-BiFdLjSe.js → parseNft-BHr3f8D7.js} +2 -2
- package/_assets/{parseSignature-J8MdklGZ.js → parseSignature-CRruTE7l.js} +1 -1
- package/_assets/{parseSignature-QJftY_rY.js → parseSignature-Cz1WFGnm.js} +3 -3
- package/_assets/{passkeys-D2Xshh23.js → passkeys-BAR54cJC.js} +1 -1
- package/_assets/{pay-with-exchange-Cu035sqT.js → pay-with-exchange-zDCz8UbG.js} +1 -1
- package/_assets/{qr-overlay-DYgMyv1Q.js → qr-overlay-DXWbTjg8.js} +1 -1
- package/_assets/{receive-CsNpdfnW.js → receive-B3ivhPV_.js} +1 -1
- package/_assets/{resolveImplementation-DTQI53AV.js → resolveImplementation-ASrjiSw-.js} +1 -1
- package/_assets/{rpc-KnP3VACd.js → rpc-r3GlqTct.js} +1 -1
- package/_assets/{secp256k1-CNuJw6t5.js → secp256k1-B5NNIaFX.js} +1 -1
- package/_assets/{secp256k1-D9mIimtB.js → secp256k1-Ch2QO1Jw.js} +1 -1
- package/_assets/{secp256k1-HByYfqH7.js → secp256k1-ChcROQU5.js} +1 -1
- package/_assets/{send-CMCnYIdY.js → send-6dgb2b7F.js} +1 -1
- package/_assets/{send-batch-transaction-C1sbN2my.js → send-batch-transaction-D_JGI6Rn.js} +1 -1
- package/_assets/{send-eip712-transaction-BAJeY5fb.js → send-eip712-transaction-BAt6mbHJ.js} +2 -2
- package/_assets/{send-gasless-transaction-B44KlVWh.js → send-gasless-transaction-B6-du22J.js} +2 -2
- package/_assets/{send-transaction-DT0LgivN.js → send-transaction-CWeSxAY3.js} +2 -2
- package/_assets/{sendMetaTransaction-etVFqqtW.js → sendMetaTransaction-Ds4_qSVu.js} +1 -1
- package/_assets/{sendRawTransaction-CP59S8fY.js → sendRawTransaction-lB8XtpQV.js} +3 -3
- package/_assets/{serializeTransaction-D82eIJpu.js → serializeTransaction-sBiqyBXY.js} +1 -1
- package/_assets/{session-proposal-CTk25Dr-.js → session-proposal-CtX3xmD3.js} +1 -1
- package/_assets/{session-request-C1qUxOZG.js → session-request-TgRSx-rm.js} +2 -2
- package/_assets/{signing-D2OJn6T_.js → signing-BLltMKaw.js} +3 -3
- package/_assets/{skeleton.styles-CEQXSxcg.js → skeleton.styles-CHtcYOO2.js} +1 -1
- package/_assets/{socials-Clt3JNMD.js → socials-C-PWl5ol.js} +1 -1
- package/_assets/{styled-DRUYplNz.js → styled-ByfFVW_J.js} +1 -1
- package/_assets/{swaps-hOclSX6h.js → swaps-cy6g7st6.js} +1 -1
- package/_assets/{thirdweb-DH3-POmB.js → thirdweb-Dw1AnBJt.js} +3 -3
- package/_assets/{to-serializable-transaction-CTdC8nHQ.js → to-serializable-transaction-BYNNGJgk.js} +2 -2
- package/_assets/{transactionReceipt-u3fxiMLd.js → transactionReceipt-D3t9P89G.js} +1 -1
- package/_assets/{transactions-CrPkr7No.js → transactions-Ci41fiMj.js} +1 -1
- package/_assets/useCreditPacks-DnkAdSB8.js +1 -0
- package/_assets/useImportable-DTHq6mob.js +1 -0
- package/_assets/{useInfiniteGrid-BJjThIIr.js → useInfiniteGrid-C5_gVX8O.js} +1 -1
- package/_assets/useTheme-pA484HjF.js +1 -0
- package/_assets/{verifyHash-GC24awPW.js → verifyHash-Bwromxoc.js} +1 -1
- package/_assets/{w3m-modal-D8ODxmhx.js → w3m-modal-JLRA_T5o.js} +1 -1
- package/_assets/{w3m-modal-C_4LJHJd.js → w3m-modal-yFiS_Jze.js} +1 -1
- package/_assets/{wait-for-tx-receipt-DxjVHpLa.js → wait-for-tx-receipt-BXBtEFR-.js} +1 -1
- package/_assets/{wallets-CLONLSgR.js → wallets-DB4fTO2e.js} +5 -5
- package/_assets/{web-connector-Bg3R-MOR.js → web-connector-CwHeziUM.js} +3 -3
- package/_assets/{writeContract-B0hqGC9P.js → writeContract-lzu9ejzj.js} +1 -1
- package/_assets/{zoraTestnet-BrHNrHjI.js → zoraTestnet-Bhmm9a22.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/_assets/Cart-CMAKp-wK.js +0 -696
- package/_assets/CollectionCarousel-DMTJO3vn.js +0 -872
- package/_assets/ItemDetail--g9bExAk.js +0 -3577
- package/_assets/LazyEmoteControls-DLE3wPcI.js +0 -2
- package/_assets/TradeService-C1HwlfJG.js +0 -1
- package/_assets/authorizations-BIUtCNZm.js +0 -1
- package/_assets/buy-Dvc_dX-A.js +0 -1
- package/_assets/buy-gasless-C2CSfMz_.js +0 -1
- package/_assets/useCreditPacks-BKNj_K3V.js +0 -1
- package/_assets/useImportable-Dxzd_Mzq.js +0 -1
- package/_assets/useTheme-Rk_Pnmot.js +0 -1
package/_assets/Cart-CMAKp-wK.js
DELETED
|
@@ -1,696 +0,0 @@
|
|
|
1
|
-
import{j as e,L as Le,r as T,b as ea,a as ta}from"./react-BYHuwl8r.js";import{t as de,s as i,b as a,L as ce,ax as aa,ay as Ee,az as sa,J as na,I as O,z as Mt,K as Ke,x as ia,X as H,am as dt,o as ra,q as oa,v as ca,aA as da,A as la,aB as ua,an as ha,aC as pa,aD as lt,aE as ga,aF as ma,y as xa,aG as ut,Z as V,aH as ht,aI as fa,F as ae,r as ya,c as pt,aJ as ba,C as va,aK as gt,aL as Re,aM as wa,aN as xe,aO as fe,aP as mt,g as ye,f as Ca,h as qe,aQ as ja}from"./index-B2t9sa1E.js";import{M as ka,S as Sa,C as $a,H as Ma,a as Ta,T as Ia,X as Pa,b as Aa,B as za,c as Ea,d as xt,e as Ra,f as Ce,P as Tt,m as qa,g as Ba,h as _a,i as Fa,j as Wa,k as It,l as je,L as La,n as Ka,o as ft,p as yt,W as Na,q as Qa,r as Ua,s as Ha,A as Oa,t as Ga,u as Va,v as Da,w as Ja,x as Xa,y as Ya,z as Za,D as es,E as ts,F as as,G as ss,I as ns,J as is,K as rs,N as os,O as cs,Q as Be,R as ds,U as ls,V as us,Y as hs,Z as bt,_ as vt,$ as ps,a0 as gs,a1 as ms}from"./CollectionCarousel-DMTJO3vn.js";import{f as xs,h as fs,a as ys,n as bs,i as vs,A as ws}from"./authorizations-BIUtCNZm.js";import{g as Cs,j as _e}from"./buy-Dvc_dX-A.js";import{b as js,w as ks,S as wt,G as Ss}from"./buy-gasless-C2CSfMz_.js";import{u as $s,M as Ms,R as be,r as Ts,c as Is,p as Ct}from"./useCreditPacks-BKNj_K3V.js";import{i as Ps,a as As}from"./errors-CX9EJ2UZ.js";import{E as zs}from"./ErrorNotice-BQwK_TDE.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-etVFqqtW.js";const{colors:se,radius:Es}=de,Rs=i.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
align-items: center;
|
|
4
|
-
justify-content: center;
|
|
5
|
-
gap: 8px;
|
|
6
|
-
width: 100%;
|
|
7
|
-
`,qs=i.span`
|
|
8
|
-
font-size: 16px;
|
|
9
|
-
line-height: 22px;
|
|
10
|
-
color: ${se.text2};
|
|
11
|
-
text-transform: capitalize;
|
|
12
|
-
white-space: nowrap;
|
|
13
|
-
`,Bs=i.div`
|
|
14
|
-
display: flex;
|
|
15
|
-
flex-direction: column;
|
|
16
|
-
gap: 12px;
|
|
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: ${Es.btn};
|
|
38
|
-
}
|
|
39
|
-
`,_s=i.span`
|
|
40
|
-
margin-left: 8px;
|
|
41
|
-
font-size: 13px;
|
|
42
|
-
font-weight: 600;
|
|
43
|
-
color: ${se.muted};
|
|
44
|
-
`,Fs=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
|
-
`;function Ws(r){const{phase:l,balanceCredits:P,onClose:A}=r,F=l==="processing",D=l==="error"?a("cartCheckout.errorTitle"):l==="nofunds"?a("cartCheckout.titleNoFunds"):l==="choose"?a("buyModal.choosePayment"):a("cartCheckout.titleBuy"),J=l==="processing";return e.jsxs(ka,{role:"dialog","aria-modal":"true","aria-label":a("cartCheckout.dialogAria"),children:[e.jsx(Sa,{onClick:F?void 0:A,"aria-hidden":!0}),e.jsxs($a,{"data-tall":J||void 0,children:[e.jsxs(Ma,{children:[e.jsxs(Ta,{children:[e.jsx(Ia,{children:D}),!F&&e.jsx(Pa,{onClick:A,"aria-label":a("buyModal.close"),children:e.jsx(Aa,{})})]}),e.jsxs(za,{children:[e.jsx(Ea,{children:l==="nofunds"?a("buyModal.dclBalance"):a("buyModal.myCreditsBalance")}),e.jsx(xt,{}),e.jsx(Ra,{children:ce(P)})]})]}),l==="choose"&&e.jsxs(Ce,{children:[e.jsxs(Fs,{children:[e.jsx("span",{children:a("cart.purchaseSummary")}),e.jsxs("strong",{children:[e.jsx(xt,{}),ce(r.totalCredits??0)]})]}),e.jsx(Tt,{options:r.options??[],totalCents:r.totalCents??0,onPay:r.onPay??(()=>{}),rateNote:(()=>{const z=qa(r.totalCents??0,r.totalManaWei??0n);return z!=null?a("buyModal.manaRate",{mana:z.toLocaleString("en",{maximumFractionDigits:2})}):null})()})]}),l==="processing"&&e.jsx(Ls,{stage:r.stage??"reserving",step:r.step??1,total:r.total??1,isSelfCustody:!!r.isSelfCustody,signatures:r.signatures}),l==="nofunds"&&e.jsx(Ks,{lines:r.lines??[],shortfallCredits:r.shortfallCredits??0,packs:r.packs??[],selectedPack:r.selectedPack??"",onSelectPack:r.onSelectPack??(()=>{}),onBuyPacks:r.onBuyPacks??(()=>{}),onCancel:A}),l==="error"&&e.jsxs(Ce,{children:[e.jsxs(Ba,{"data-testid":"buy-error",children:[e.jsx(_a,{src:Fa,alt:"",width:64,height:80}),e.jsxs(Wa,{children:[e.jsx("b",{children:a("cartCheckout.errorHeadline")})," ",r.message??a("cartCheckout.errorBody")]})]}),e.jsxs(It,{children:[e.jsx(je,{"data-variant":"outline",onClick:A,children:a("buyModal.cancel")}),e.jsx(je,{"data-variant":"purple",onClick:r.onRetry??A,children:a("cartCheckout.tryAgain")})]})]})]})]})}function Ls({stage:r,step:l,total:P,isSelfCustody:A,signatures:F}){const D=r==="reserving",J=P>0?Math.min(100,Math.round(l/P*100)):0,z=A&&F&&F.total>1,ne=r==="awaiting-signature"?A?z?a("cartCheckout.confirmMultiple",{current:F.current,total:F.total}):a("buyModal.confirmToContinue"):a("buyModal.completingTransaction"):r==="settling"?a("buyModal.completingTransaction"):a("cartCheckout.preparing");return e.jsxs(Ce,{"data-processing":!0,children:[e.jsx(La,{src:aa,alt:"",width:61,height:61}),e.jsx(Ka,{children:ne}),D?e.jsxs(Rs,{children:[e.jsx(ft,{"aria-hidden":!0,children:e.jsx(yt,{"data-step":!0,style:{width:`${J}%`}})}),P>1?e.jsxs(qs,{children:[l,"/",P]}):null]}):e.jsx(ft,{"aria-hidden":!0,children:e.jsx(yt,{})})]})}function Ks({lines:r,shortfallCredits:l,packs:P,selectedPack:A,onSelectPack:F,onBuyPacks:D,onCancel:J}){const z=P.find(n=>n.id===A),ne=r.reduce((n,K)=>n+(K.quantity??1),0);return e.jsxs(Ce,{children:[e.jsxs(Na,{"data-testid":"nofunds-warning",children:[e.jsx(Qa,{}),e.jsxs(Ua,{children:[e.jsx("b",{children:a("buyModal.insufficientFunds")})," ",a("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:a("buyModal.warningCreditsAmount",{count:Math.max(0,l)})})," ",a("buyModal.warningToPurchase",{count:ne}),Ee()?null:e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(Ha,{href:sa("/credits"),target:"_blank",rel:"noopener noreferrer",children:a("buyModal.warningLearnMore")})]})]})]}),e.jsx(Bs,{children:r.map(n=>{const K=n.quantity??1;return e.jsxs(Oa,{children:[e.jsx(Ga,{children:n.item.thumbnail?e.jsx("img",{src:n.item.thumbnail,alt:""}):null}),e.jsxs(Va,{children:[e.jsxs("div",{children:[e.jsxs(Da,{title:n.item.name,children:[n.item.name||a("buyModal.itemFallback"),K>1?e.jsx(_s,{children:a("cartCheckout.qty",{count:K})}):null]}),n.item.creator?e.jsx(Ja,{address:n.item.creator}):null]}),e.jsxs(Xa,{children:[e.jsx(Ya,{}),e.jsx("span",{children:ce(n.priceCredits*K)})]})]})]},n.item.id)})}),Ee()?null:e.jsxs(e.Fragment,{children:[e.jsx(Za,{children:P.map(n=>{const K=n.id===A;return e.jsxs(es,{"data-testid":"credit-pack","data-on":K||void 0,onClick:()=>F(n.id),children:[e.jsx(ts,{src:as,alt:""}),e.jsx(ss,{children:ce(n.credits)}),e.jsxs(ns,{children:["($",n.usd.toFixed(2),")"]})]},n.id)})}),e.jsxs(is,{children:[e.jsxs(rs,{children:[e.jsx(os,{}),e.jsx("span",{children:ce((z==null?void 0:z.credits)??0)})]}),e.jsxs(cs,{children:["$",((z==null?void 0:z.usd)??0).toFixed(2)]})]})]}),e.jsxs(It,{children:[e.jsx(je,{"data-variant":"outline",onClick:J,children:a("buyModal.cancel")}),Ee()?null:e.jsx(je,{"data-variant":"gradient",onClick:D,children:a("buyModal.buy")})]})]})}const{colors:o,gradients:Ns,radius:te}=de,Pt="@media (max-width: 1080px)",I="@media (max-width: 880px)",jt=i.div`
|
|
62
|
-
max-width: 1510px;
|
|
63
|
-
margin: 0 auto;
|
|
64
|
-
/* Grows into the page's leftover height and passes it down to Upsell, so the white cross-sell band ends at
|
|
65
|
-
the footer rather than leaving a gray strip. Needs .page[data-route="/cart"] to be a flex column. */
|
|
66
|
-
width: 100%;
|
|
67
|
-
flex: 1 0 auto;
|
|
68
|
-
display: flex;
|
|
69
|
-
flex-direction: column;
|
|
70
|
-
|
|
71
|
-
${I} {
|
|
72
|
-
padding-bottom: 188px; /* room for the fixed summary bar */
|
|
73
|
-
}
|
|
74
|
-
`,kt=i.button`
|
|
75
|
-
display: inline-flex;
|
|
76
|
-
align-items: center;
|
|
77
|
-
gap: 6px;
|
|
78
|
-
margin: 0 0 16px;
|
|
79
|
-
padding: 0;
|
|
80
|
-
border: 0;
|
|
81
|
-
background: none;
|
|
82
|
-
color: ${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
|
-
${I} {
|
|
99
|
-
display: none;
|
|
100
|
-
}
|
|
101
|
-
`,Qs=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
|
-
`,St=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: ${o.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
|
-
`,Us=i.div`
|
|
151
|
-
min-width: 0;
|
|
152
|
-
display: flex;
|
|
153
|
-
flex-direction: column;
|
|
154
|
-
gap: 12px;
|
|
155
|
-
`,Hs=i.div`
|
|
156
|
-
display: flex;
|
|
157
|
-
align-items: center;
|
|
158
|
-
justify-content: space-between;
|
|
159
|
-
gap: 12px;
|
|
160
|
-
background: ${o.white};
|
|
161
|
-
border-radius: 16px;
|
|
162
|
-
padding: 12px 12px 12px 24px;
|
|
163
|
-
|
|
164
|
-
${I} {
|
|
165
|
-
gap: 8px;
|
|
166
|
-
padding: 8px 16px;
|
|
167
|
-
}
|
|
168
|
-
`,At=i.section`
|
|
169
|
-
min-width: 0;
|
|
170
|
-
background: ${o.white};
|
|
171
|
-
border-radius: 16px;
|
|
172
|
-
padding: 24px;
|
|
173
|
-
|
|
174
|
-
${I} {
|
|
175
|
-
padding: 16px;
|
|
176
|
-
}
|
|
177
|
-
`,Os=i(At)`
|
|
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: ${o.text};
|
|
187
|
-
|
|
188
|
-
${de.media.maxWidth("mobile")} {
|
|
189
|
-
min-height: 320px;
|
|
190
|
-
padding: 32px 16px;
|
|
191
|
-
}
|
|
192
|
-
`,Gs=i.div`
|
|
193
|
-
display: flex;
|
|
194
|
-
flex-direction: column;
|
|
195
|
-
align-items: center;
|
|
196
|
-
gap: 12px;
|
|
197
|
-
padding-bottom: 16px;
|
|
198
|
-
`,Vs=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
|
-
`,Ds=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
|
-
`,Js=i(Le)`
|
|
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: ${te.card};
|
|
225
|
-
background: ${o.accent};
|
|
226
|
-
color: ${o.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: ${o.accentHover};
|
|
237
|
-
}
|
|
238
|
-
&:focus-visible {
|
|
239
|
-
outline: 2px solid ${o.accent};
|
|
240
|
-
outline-offset: 2px;
|
|
241
|
-
}
|
|
242
|
-
`,Xs=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: ${o.text};
|
|
253
|
-
cursor: pointer;
|
|
254
|
-
|
|
255
|
-
& .ico {
|
|
256
|
-
width: 20px;
|
|
257
|
-
height: 20px;
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
`,Ys=i.h1`
|
|
261
|
-
margin: 0;
|
|
262
|
-
font-size: 14px;
|
|
263
|
-
font-weight: 600;
|
|
264
|
-
line-height: 1.57;
|
|
265
|
-
color: ${o.text};
|
|
266
|
-
|
|
267
|
-
${I} {
|
|
268
|
-
flex: 1;
|
|
269
|
-
min-width: 0;
|
|
270
|
-
font-size: 16px;
|
|
271
|
-
}
|
|
272
|
-
`,Zs=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 ${o.text2};
|
|
280
|
-
border-radius: ${te.btn};
|
|
281
|
-
background: none;
|
|
282
|
-
color: ${o.text2};
|
|
283
|
-
font-size: 13px;
|
|
284
|
-
font-weight: 600;
|
|
285
|
-
line-height: 24px;
|
|
286
|
-
letter-spacing: 0.46px;
|
|
287
|
-
text-transform: uppercase;
|
|
288
|
-
white-space: nowrap;
|
|
289
|
-
cursor: pointer;
|
|
290
|
-
transition:
|
|
291
|
-
background 0.15s ease,
|
|
292
|
-
filter 0.15s ease;
|
|
293
|
-
|
|
294
|
-
/* Mixed from currentColor so the wash cannot drift from the border colour. */
|
|
295
|
-
&:hover:not(:disabled) {
|
|
296
|
-
background: color-mix(in srgb, currentColor 6%, transparent);
|
|
297
|
-
}
|
|
298
|
-
&:active:not(:disabled) {
|
|
299
|
-
filter: brightness(0.97);
|
|
300
|
-
}
|
|
301
|
-
&:disabled {
|
|
302
|
-
opacity: 0.55;
|
|
303
|
-
cursor: default;
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
/* Mobile keeps the full 40px button and thins the outline to 1px (1182:236892) rather than shrinking
|
|
307
|
-
the type, which had it reading smaller than the row title beside it. */
|
|
308
|
-
${I} {
|
|
309
|
-
border-width: 1px;
|
|
310
|
-
border-color: ${o.text};
|
|
311
|
-
color: ${o.text};
|
|
312
|
-
}
|
|
313
|
-
`,en=i.div`
|
|
314
|
-
display: flex;
|
|
315
|
-
flex-direction: column;
|
|
316
|
-
gap: 24px;
|
|
317
|
-
`,tn=i.div`
|
|
318
|
-
position: relative;
|
|
319
|
-
display: flex;
|
|
320
|
-
align-items: stretch;
|
|
321
|
-
gap: 12px;
|
|
322
|
-
background: ${o.white};
|
|
323
|
-
border: 1px solid ${o.gray4};
|
|
324
|
-
border-radius: ${te.card};
|
|
325
|
-
overflow: hidden;
|
|
326
|
-
|
|
327
|
-
&[data-unavailable] [data-thumb] {
|
|
328
|
-
opacity: 0.5;
|
|
329
|
-
}
|
|
330
|
-
&[data-unavailable] [data-check] {
|
|
331
|
-
display: none;
|
|
332
|
-
}
|
|
333
|
-
&[data-unavailable] [data-desc] {
|
|
334
|
-
opacity: 0.7;
|
|
335
|
-
}
|
|
336
|
-
`,an=i.div`
|
|
337
|
-
position: relative;
|
|
338
|
-
flex-shrink: 0;
|
|
339
|
-
width: 137.5px;
|
|
340
|
-
height: 137px;
|
|
341
|
-
background: ${o.media};
|
|
342
|
-
border-radius: ${te.card};
|
|
343
|
-
display: grid;
|
|
344
|
-
place-items: center;
|
|
345
|
-
overflow: hidden;
|
|
346
|
-
|
|
347
|
-
& img {
|
|
348
|
-
width: 83%;
|
|
349
|
-
height: 83%;
|
|
350
|
-
object-fit: contain;
|
|
351
|
-
filter: drop-shadow(0.56px 2.25px 2.8px rgba(0, 0, 0, 0.1));
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
${I} {
|
|
355
|
-
width: 120px;
|
|
356
|
-
height: 120px;
|
|
357
|
-
}
|
|
358
|
-
`,sn=i(Le)`
|
|
359
|
-
position: absolute;
|
|
360
|
-
inset: 0;
|
|
361
|
-
display: grid;
|
|
362
|
-
place-items: center;
|
|
363
|
-
`,nn=i.span`
|
|
364
|
-
position: absolute;
|
|
365
|
-
top: 7.5px;
|
|
366
|
-
left: 7.5px;
|
|
367
|
-
width: 20px;
|
|
368
|
-
height: 20px;
|
|
369
|
-
border-radius: 50%;
|
|
370
|
-
background: #34ce77;
|
|
371
|
-
display: grid;
|
|
372
|
-
place-items: center;
|
|
373
|
-
`,rn=i.div`
|
|
374
|
-
flex: 1;
|
|
375
|
-
min-width: 0;
|
|
376
|
-
display: flex;
|
|
377
|
-
flex-direction: column;
|
|
378
|
-
justify-content: space-between;
|
|
379
|
-
gap: 8px;
|
|
380
|
-
padding: 16px 8px;
|
|
381
|
-
|
|
382
|
-
${I} {
|
|
383
|
-
padding: 12px 4px 12px 0;
|
|
384
|
-
}
|
|
385
|
-
`,on=i.div`
|
|
386
|
-
display: flex;
|
|
387
|
-
flex-direction: column;
|
|
388
|
-
gap: 4px;
|
|
389
|
-
min-width: 0;
|
|
390
|
-
padding-right: 64px; /* clear the top-right favourite + remove group */
|
|
391
|
-
`,zt=Ke`
|
|
392
|
-
display: block;
|
|
393
|
-
font-size: 16px;
|
|
394
|
-
font-weight: 600;
|
|
395
|
-
line-height: 1.2;
|
|
396
|
-
color: ${o.text};
|
|
397
|
-
text-decoration: none;
|
|
398
|
-
overflow: hidden;
|
|
399
|
-
text-overflow: ellipsis;
|
|
400
|
-
white-space: nowrap;
|
|
401
|
-
|
|
402
|
-
a&:hover {
|
|
403
|
-
color: ${o.accent};
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
${I} {
|
|
407
|
-
white-space: normal;
|
|
408
|
-
display: -webkit-box;
|
|
409
|
-
-webkit-line-clamp: 2;
|
|
410
|
-
line-clamp: 2;
|
|
411
|
-
-webkit-box-orient: vertical;
|
|
412
|
-
}
|
|
413
|
-
`,cn=i.div`
|
|
414
|
-
${zt};
|
|
415
|
-
`,dn=i(Le)`
|
|
416
|
-
${zt};
|
|
417
|
-
`,ln=i(na)`
|
|
418
|
-
font-size: 10px;
|
|
419
|
-
line-height: 1.43;
|
|
420
|
-
color: ${o.muted};
|
|
421
|
-
|
|
422
|
-
& [data-avatar] {
|
|
423
|
-
display: none;
|
|
424
|
-
}
|
|
425
|
-
& [data-testid='creator-name'] {
|
|
426
|
-
font-size: 10px;
|
|
427
|
-
line-height: 1.43;
|
|
428
|
-
}
|
|
429
|
-
`,un=i.div`
|
|
430
|
-
display: flex;
|
|
431
|
-
align-items: center;
|
|
432
|
-
justify-content: space-between;
|
|
433
|
-
gap: 12px;
|
|
434
|
-
padding-right: 8px;
|
|
435
|
-
`,hn=i.div`
|
|
436
|
-
display: inline-flex;
|
|
437
|
-
align-items: center;
|
|
438
|
-
gap: 8px;
|
|
439
|
-
padding: 6px;
|
|
440
|
-
border: 0.5px solid ${o.muted2};
|
|
441
|
-
border-radius: ${te.pill};
|
|
442
|
-
`,$t=i.button`
|
|
443
|
-
display: grid;
|
|
444
|
-
place-items: center;
|
|
445
|
-
width: 16px;
|
|
446
|
-
height: 16px;
|
|
447
|
-
padding: 0;
|
|
448
|
-
border: 0;
|
|
449
|
-
background: none;
|
|
450
|
-
color: ${o.text};
|
|
451
|
-
cursor: pointer;
|
|
452
|
-
|
|
453
|
-
&:disabled {
|
|
454
|
-
color: ${o.muted2};
|
|
455
|
-
cursor: default;
|
|
456
|
-
}
|
|
457
|
-
`,pn=i.span`
|
|
458
|
-
min-width: 12px;
|
|
459
|
-
font-size: 14px;
|
|
460
|
-
font-weight: 500;
|
|
461
|
-
line-height: 1.2;
|
|
462
|
-
color: ${o.text};
|
|
463
|
-
text-align: center;
|
|
464
|
-
`,gn=i.div`
|
|
465
|
-
display: inline-flex;
|
|
466
|
-
align-items: center;
|
|
467
|
-
gap: 4px;
|
|
468
|
-
/* Always right-aligned: with a stepper present space-between handles it; for secondary/unique lines
|
|
469
|
-
(no stepper) the auto margin keeps the lone price on the right instead of falling to the left. */
|
|
470
|
-
margin-left: auto;
|
|
471
|
-
font-size: 24px;
|
|
472
|
-
font-weight: 600;
|
|
473
|
-
color: ${o.text2};
|
|
474
|
-
|
|
475
|
-
${I} {
|
|
476
|
-
font-size: 20px;
|
|
477
|
-
}
|
|
478
|
-
`,mn=i(Mt)`
|
|
479
|
-
width: 24px;
|
|
480
|
-
height: 24px;
|
|
481
|
-
background: ${o.text};
|
|
482
|
-
|
|
483
|
-
${I} {
|
|
484
|
-
width: 20px;
|
|
485
|
-
height: 20px;
|
|
486
|
-
}
|
|
487
|
-
`,xn=i.span`
|
|
488
|
-
margin-left: 6px;
|
|
489
|
-
font-size: 14px;
|
|
490
|
-
font-weight: 500;
|
|
491
|
-
color: ${o.muted};
|
|
492
|
-
text-decoration: line-through;
|
|
493
|
-
`,fn=i.div`
|
|
494
|
-
position: absolute;
|
|
495
|
-
top: 9px;
|
|
496
|
-
right: 7px;
|
|
497
|
-
display: flex;
|
|
498
|
-
align-items: flex-start;
|
|
499
|
-
gap: 12px;
|
|
500
|
-
`,yn=i.span`
|
|
501
|
-
display: inline-flex;
|
|
502
|
-
align-items: center;
|
|
503
|
-
gap: 4px;
|
|
504
|
-
font-size: 12px;
|
|
505
|
-
font-weight: 600;
|
|
506
|
-
line-height: 1;
|
|
507
|
-
text-transform: uppercase;
|
|
508
|
-
color: ${o.text2};
|
|
509
|
-
`,bn=i(O)`
|
|
510
|
-
color: #f48221;
|
|
511
|
-
`,vn=i.span`
|
|
512
|
-
align-self: flex-start;
|
|
513
|
-
display: inline-flex;
|
|
514
|
-
align-items: center;
|
|
515
|
-
gap: 4px;
|
|
516
|
-
padding: 2px 4px;
|
|
517
|
-
border-radius: ${te.chip};
|
|
518
|
-
background: #f4e9ff;
|
|
519
|
-
font-size: 10px;
|
|
520
|
-
font-weight: 400;
|
|
521
|
-
line-height: 14px;
|
|
522
|
-
color: ${o.text};
|
|
523
|
-
`,wn=i(O)`
|
|
524
|
-
width: 11.31px;
|
|
525
|
-
height: 10.94px;
|
|
526
|
-
background: ${o.text};
|
|
527
|
-
`,Et=Ke`
|
|
528
|
-
display: grid;
|
|
529
|
-
place-items: center;
|
|
530
|
-
width: 24px;
|
|
531
|
-
height: 24px;
|
|
532
|
-
padding: 0;
|
|
533
|
-
border: 0;
|
|
534
|
-
background: none;
|
|
535
|
-
color: ${o.muted};
|
|
536
|
-
cursor: pointer;
|
|
537
|
-
transition: color 0.12s ease;
|
|
538
|
-
|
|
539
|
-
&:disabled {
|
|
540
|
-
opacity: 0.5;
|
|
541
|
-
cursor: default;
|
|
542
|
-
}
|
|
543
|
-
`,Cn=i.button`
|
|
544
|
-
${Et};
|
|
545
|
-
|
|
546
|
-
&:hover:not(:disabled) {
|
|
547
|
-
color: ${o.text};
|
|
548
|
-
}
|
|
549
|
-
&[data-on] {
|
|
550
|
-
color: ${o.dclRed};
|
|
551
|
-
}
|
|
552
|
-
`,jn=i.button`
|
|
553
|
-
${Et};
|
|
554
|
-
|
|
555
|
-
&:hover:not(:disabled) {
|
|
556
|
-
color: ${o.dclRed};
|
|
557
|
-
}
|
|
558
|
-
`,kn=i.div`
|
|
559
|
-
display: flex;
|
|
560
|
-
gap: 20px;
|
|
561
|
-
margin-top: 16px;
|
|
562
|
-
|
|
563
|
-
& .link {
|
|
564
|
-
font-size: 13px;
|
|
565
|
-
color: ${o.muted};
|
|
566
|
-
font-weight: 600;
|
|
567
|
-
}
|
|
568
|
-
& .link:hover:not(:disabled) {
|
|
569
|
-
color: ${o.text};
|
|
570
|
-
}
|
|
571
|
-
`,Sn=i.aside`
|
|
572
|
-
position: sticky;
|
|
573
|
-
top: 172px;
|
|
574
|
-
display: flex;
|
|
575
|
-
flex-direction: column;
|
|
576
|
-
background: ${o.white};
|
|
577
|
-
box-shadow: 0 1px 3px rgba(22, 21, 24, 0.06);
|
|
578
|
-
border-radius: 16px;
|
|
579
|
-
padding: 16px;
|
|
580
|
-
|
|
581
|
-
${Pt} {
|
|
582
|
-
position: static;
|
|
583
|
-
}
|
|
584
|
-
${I} {
|
|
585
|
-
position: fixed;
|
|
586
|
-
left: 0;
|
|
587
|
-
right: 0;
|
|
588
|
-
top: auto;
|
|
589
|
-
bottom: 0;
|
|
590
|
-
z-index: 30;
|
|
591
|
-
border: 0;
|
|
592
|
-
/* Square and hard-edged against the page (1182:236910): it is a bar docked to the bottom, not a sheet
|
|
593
|
-
lifted off it. */
|
|
594
|
-
border-radius: 0;
|
|
595
|
-
box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.25);
|
|
596
|
-
}
|
|
597
|
-
`,$n=i.h2`
|
|
598
|
-
margin: 0 0 24px;
|
|
599
|
-
padding-bottom: 16px;
|
|
600
|
-
border-bottom: 1px solid ${o.gray4};
|
|
601
|
-
font-size: 24px;
|
|
602
|
-
font-weight: 600;
|
|
603
|
-
color: ${o.text};
|
|
604
|
-
|
|
605
|
-
${I} {
|
|
606
|
-
margin-bottom: 12px;
|
|
607
|
-
padding-bottom: 8px;
|
|
608
|
-
font-size: 16px;
|
|
609
|
-
line-height: 1.6;
|
|
610
|
-
}
|
|
611
|
-
`,Mn=i.div`
|
|
612
|
-
display: flex;
|
|
613
|
-
flex-direction: column;
|
|
614
|
-
gap: 12px;
|
|
615
|
-
`,Tn=i.div`
|
|
616
|
-
display: flex;
|
|
617
|
-
align-items: flex-start;
|
|
618
|
-
justify-content: space-between;
|
|
619
|
-
gap: 12px;
|
|
620
|
-
`,In=i.span`
|
|
621
|
-
font-size: 14px;
|
|
622
|
-
font-weight: 600;
|
|
623
|
-
line-height: 1.57;
|
|
624
|
-
color: ${o.muted1};
|
|
625
|
-
`,Pn=i.span`
|
|
626
|
-
display: inline-flex;
|
|
627
|
-
align-items: center;
|
|
628
|
-
gap: 8px;
|
|
629
|
-
font-size: 24px;
|
|
630
|
-
font-weight: 700;
|
|
631
|
-
color: ${o.text};
|
|
632
|
-
`,An=i.span`
|
|
633
|
-
display: flex;
|
|
634
|
-
flex-direction: column;
|
|
635
|
-
align-items: flex-end;
|
|
636
|
-
justify-content: center;
|
|
637
|
-
gap: 4px;
|
|
638
|
-
`;i.span`
|
|
639
|
-
font-size: 12px;
|
|
640
|
-
font-weight: 400;
|
|
641
|
-
line-height: 1;
|
|
642
|
-
color: ${o.muted};
|
|
643
|
-
`;const zn=i(Mt)`
|
|
644
|
-
width: 30px;
|
|
645
|
-
height: 30px;
|
|
646
|
-
background: ${o.text};
|
|
647
|
-
-webkit-mask-size: 24px 24px;
|
|
648
|
-
mask-size: 24px 24px;
|
|
649
|
-
-webkit-mask-position: left center;
|
|
650
|
-
mask-position: left center;
|
|
651
|
-
`;i.button`
|
|
652
|
-
width: 100%;
|
|
653
|
-
height: 56px;
|
|
654
|
-
border: 0;
|
|
655
|
-
border-radius: ${te.btn};
|
|
656
|
-
background: ${Ns.buyBtn};
|
|
657
|
-
color: ${o.softWhite};
|
|
658
|
-
font-size: 15px;
|
|
659
|
-
font-weight: 600;
|
|
660
|
-
letter-spacing: 0.046em;
|
|
661
|
-
text-transform: uppercase;
|
|
662
|
-
cursor: pointer;
|
|
663
|
-
transition: background-image 0.15s ease;
|
|
664
|
-
|
|
665
|
-
/* Primary hover/pressed is the solid Primary red (Figma 738:53252 / 738:53262) — the gradient is
|
|
666
|
-
the RESTING fill only. Painted as a flat GRADIENT, not a background-color: the shorthand can't
|
|
667
|
-
interpolate background-image, so gradient -> colour dropped the image midway while the colour was
|
|
668
|
-
still half transparent and the button visibly blinked. Same property both ends = a clean swap. */
|
|
669
|
-
&:hover:not(:disabled),
|
|
670
|
-
&:active:not(:disabled) {
|
|
671
|
-
background-image: linear-gradient(${o.dclRed}, ${o.dclRed});
|
|
672
|
-
}
|
|
673
|
-
&:disabled {
|
|
674
|
-
opacity: 0.6;
|
|
675
|
-
cursor: default;
|
|
676
|
-
}
|
|
677
|
-
`;const Rt=Ke`
|
|
678
|
-
margin: 0;
|
|
679
|
-
font-size: 13px;
|
|
680
|
-
`,ve=i.p`
|
|
681
|
-
${Rt};
|
|
682
|
-
`,En=i(zs)`
|
|
683
|
-
${Rt};
|
|
684
|
-
`,Rn=i.div`
|
|
685
|
-
position: relative;
|
|
686
|
-
flex: 1 0 auto;
|
|
687
|
-
margin-top: 48px;
|
|
688
|
-
/* Below the gray band the cross-sell sits straight on the purple field (Figma) — hence no band of its
|
|
689
|
-
own. The padding is the whole gap from the top of the section to the heading; the shared carousel's
|
|
690
|
-
own top margin is zeroed below so the two don't stack. */
|
|
691
|
-
padding: 47px 0 24px;
|
|
692
|
-
|
|
693
|
-
& section {
|
|
694
|
-
margin-top: 0;
|
|
695
|
-
}
|
|
696
|
-
`;function Fe(r){if(Ps(r))return a("errors.rejected");const l=(r.message??"").toLowerCase();return l.includes("insufficient")?a("cart.error.insufficient",{currency:va.name}):l.includes("no active listing")||l.includes("your own listing")?a("cart.error.listingChanged"):a("marketCheckout.error.generic")}const qn=12e4;function Bn(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 We=r=>r.reduce((l,P)=>l+P.priceCredits*P.quantity,0),we=r=>r.flatMap(l=>Array.from({length:l.quantity},()=>({...l,quantity:1})));function Xn(){ia({title:a("nav.cart"),noindex:!0});const r=H(t=>t.items),l=H(t=>t.remove),P=H(t=>t.increment),A=H(t=>t.decrement),F=H(t=>t.clear),D=H(t=>t.restore),J=H(t=>t.setFittingOpen),z=dt(t=>t.items),ne=dt(t=>t.toggle),{session:n,signIn:K}=ra(),qt=oa(),le=$s().packs.slice(0,Ms);T.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const Bt=r.some(t=>t.category!=="emote"),{data:ke}=ca({queryKey:["upsell-listings"],queryFn:()=>ja({first:40}),staleTime:6e4}),{data:S}=da(n),v=la(),X=ea(),{state:E}=ta(),[_t,ie]=T.useState(null),[Ne,ue]=T.useState(null),[Ft,q]=T.useState(!1),[B,G]=T.useState(null),Qe=T.useRef(0),[g,j]=T.useState(null),{data:he}=ua(n),{data:re}=ha(!0),[Se,Ue]=T.useState(""),oe=T.useRef(null),He=pa(r),Oe=t=>ut(He[t.id]),$e=r.filter(Oe),Ge=r.length>0&&$e.length===0,Wt=$e.reduce((t,s)=>t+s.priceCredits*s.quantity,0),Lt=r.reduce((t,s)=>t+s.quantity,0),Kt=$e.reduce((t,s)=>t+s.quantity,0),Ve=B?B.liveTotalCredits:Wt,Nt=new Set(r.map(t=>t.id)),De=((ke==null?void 0:ke.items)??[]).filter(t=>!Nt.has(t.id)).slice(0,12),Qt=new Map(B==null?void 0:B.buyable.map(t=>[t.item.id,t])),pe=(S==null?void 0:S.credits)??0,Me=Ve*10,Ut=re?lt(Me,re):0n,Te=Be({priceCents:Me,priceManaWei:Ut,balanceCents:(S==null?void 0:S.balanceCents)??0,manaBalanceWei:he??0n}),Ht=t=>t.some(s=>s.acquisition==="store"),Ie=t=>t.flatMap(s=>s.acquisition==="trade"?[s]:[]),Ot=fa,Gt=t=>ba(t.contractAddress,String(t.itemId));function ge(t){t(),G(null),ue(null),ie(null)}function Vt(){j(null),q(!1)}function Je(t){const s=We(t),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:t.map(u=>({item:u.item,priceCredits:u.priceCredits,quantity:u.quantity})),shortfall:d}),q(!1)}async function Pe(t){if(!n||t.length===0)return;const s=we(t),d=s.map(y=>({...y.item,priceCredits:y.priceCredits})),c=t.map(y=>({...y.item,priceCredits:y.priceCredits,quantity:y.quantity})),u=[];let h="authorize";const w=new Set,$=new Set,_=new Set,R=[];let W=!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 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:U,maxCreditedValue:ee}=await gt(n.identity,p.usdCents,M,C);u.push({salt:U.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:[U],maxCreditedValue:ee,chainId:p.item.chainId}:{kind:"trade",trade:p.trade,credits:[U],maxCreditedValue:ee})}catch(M){if(As(M)){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"]})}Je(t);return}throw M}}h="submit";const m=Cs(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(xs())try{const x=new Map;f=await js({purchases:y,buyer:n.address,signer:n.signer,onSigned:()=>N(m),onBroadcast:({txHash:C,salts:U})=>{x.set(C,U),U.forEach(ee=>w.add(ee))}});const p=await Promise.allSettled(f.map(C=>ks(C)));p.forEach((C,U)=>{const ee=x.get(f[U])??[];C.status==="fulfilled"?(ee.forEach(ze=>$.add(ze)),R.push(f[U])):C.reason instanceof wt||ee.forEach(ze=>_.add(ze))});const M=p.flatMap(C=>C.status==="rejected"?[C.reason]:[]);if(M.length&&!M.some(C=>C instanceof wt))throw M[0];W=!0}catch(x){if(!(x instanceof Ss)||!wa(n.providerType))throw x;f=await _e({purchases:y,buyer:n.address,signer:n.signer,onSigned:N,onBroadcast:({salts:p})=>p.forEach(M=>w.add(M)),onSettled:({txHash:p,salts:M})=>{M.forEach(C=>$.add(C)),R.push(p)},onReverted:({salts:p})=>p.forEach(M=>_.add(M))})}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(M=>$.add(M)),R.push(x)},onReverted:({salts:x})=>x.forEach(p=>_.add(p))});t.forEach(x=>l(x.item.id)),G(null),V("Shop Completed Purchase",{...xe(d),payment_type:"credits",no_crypto_step:W,transaction_hash:f[0]??null}),vt(v);const b=oe.current;oe.current=null,j(null),q(!1);const Q={items:c,txHash:f[0]??void 0,txHashes:f,settled:!0,...b?{creditsAdded:b}:{}};X("/success",{state:Q,replace:!0})}catch(y){fe(y)||ae(y,{flow:"cart_checkout",step:h,cart_size:t.length});const m=new Set([...w].filter(b=>!_.has(b))),{toRelease:k,boughtItemIds:L}=Ct({reservations:u,spent:m,settled:$}),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:mt(y),value_usd:ht(f.reduce((b,Q)=>b+Q.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),vt(v),V("Shop Completed Purchase",{...xe(N),payment_type:"credits",no_crypto_step:W,transaction_hash:R[0]??null,partial:!0}),j({phase:"error",message:a("cart.error.partiallyBought")}),q(!1);return}j({phase:"error",message:Fe(y)})}}function Xe(t,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),q(!1);const c={items:t,txHash:s[0]??void 0,txHashes:s,settled:!0,...d?{creditsAdded:d}:{}};X("/success",{state:c,replace:!0})}function Ye(t,s){fe(t)||ae(t,{flow:s,step:"submit"}),V(fe(t)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:mt(t)}),j({phase:"error",message:Fe(t)}),q(!1)}async function Dt(t,s){const d=ye(qe.MANAToken,s),c=ye(qe.CreditsManager,s);await vs({auth:{kind:ws.Allowance,contractAddress:d.address,spenderAddress:c.address,chainId:s},signer:t})}async function Ze(){if(re)return re;try{return await v.fetchQuery({queryKey:["mana-rate",pt.chainId],queryFn:()=>ya(pt.chainId),staleTime:6e4})}catch{return}}async function Jt(t){const s=we(t).reduce((h,w)=>h+w.usdCents,0),c=(he??0n)>0n?await Ze():re,u=c?lt(s,c):0n;return{totalCents:s,manaWei:u}}async function et(t,s){const d=We(t),{totalCents:c,manaWei:u}=await Jt(t),h=Be({priceCents:c,priceManaWei:u,balanceCents:(S==null?void 0:S.balanceCents)??0,manaBalanceWei:he??0n}),w=Ht(t)?{...h,options:h.options.filter($=>$.method==="credits")}:h;if(s&&w.options.some($=>$.method===s)){if(s==="credits"){Pe(t);return}const{spender:$,chainId:_}=tt(s,t);await at($,_,()=>s==="mana"?void st(t):void nt(t,c,u));return}if(w.options.some($=>$.method==="mana"||$.method==="combined")){j({phase:"choose",lines:t,totalCents:c,manaWei:u}),q(!1);return}if(S!=null&&S.credits<d){Je(t);return}Pe(t)}function Xt(t){return Be({priceCents:t.totalCents,priceManaWei:t.manaWei,balanceCents:(S==null?void 0:S.balanceCents)??0,manaBalanceWei:he??0n})}const[Ae,me]=T.useState(null);function tt(t,s){const d=Ie(s)[0].trade;return{spender:t==="mana"?ye(Ca(d.contract),d.chainId).address:ye(qe.CreditsManager,d.chainId).address,chainId:d.chainId}}async function at(t,s,d){const c=fs(s,t),u=n?await ys(c,n.address).catch(()=>!0):!0;if(bs(n==null?void 0:n.providerType,u)){q(!1),me({auth:c,run:d});return}d()}function Yt(t){if((g==null?void 0:g.phase)!=="choose")return;const{lines:s,totalCents:d,manaWei:c}=g;if(t==="credits"){Pe(s);return}const{spender:u,chainId:h}=tt(t,s);at(u,h,()=>t==="mana"?void st(s):void nt(s,d,c))}async function st(t){if(!n||t.length===0)return;const s=we(t),d=s.map(h=>({...h.item,priceCredits:h.priceCredits})),c=t.map(h=>({...h.item,priceCredits:h.priceCredits,quantity:h.quantity})),u=()=>j({phase:"processing",stage:"settling",step:s.length,total:s.length});j({phase:"processing",stage:"awaiting-signature",step:s.length,total:s.length});try{const h=await ps({trades:Ie(s).map(w=>w.trade),buyer:n.address,signer:n.signer,onSigned:u});t.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"]}),Xe(c,h)}catch(h){Ye(h,"buy_cart_mana")}}async function nt(t,s,d){if(!n||t.length===0)return;const c=we(t),u=c.map(m=>({...m.item,priceCredits:m.priceCredits})),h=t.map(m=>({...m.item,priceCredits:m.priceCredits,quantity:m.quantity})),w=gs(c.map(m=>m.usdCents),(S==null?void 0:S.balanceCents)??0),$=w.reduce((m,k)=>m+k,0),_=ms(Math.max(0,s-$),s,d),R=[],W=new Set,y=new Set;j({phase:"processing",stage:"reserving",step:1,total:c.length});try{const m=Ie(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 Q=m[f].item,{credit:x,maxCreditedValue:p}=await gt(n.identity,b,m[f].trade.id,Q.contractAddress&&Q.itemId!=null?{contractAddress:Q.contractAddress,itemId:String(Q.itemId)}:void 0);R.push({salt:x.id,itemId:Q.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)+_).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=>W.add(b)),onReverted:({salts:f})=>f.forEach(b=>y.add(b))});t.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"]}),Xe(h,N)}catch(m){const{toRelease:k}=Ct({reservations:R,spent:new Set([...W].filter(L=>!y.has(L))),settled:new Set});k.length&&Re(n.identity,k).catch(()=>{}),R.length&&v.invalidateQueries({queryKey:["usd-balance"]}),Ye(m,"buy_cart_combined")}}async function Y(t){if(!n){bt({type:"cart-checkout"}),K();return}const s=H.getState().items.filter(Oe);if(s.length===0)return;ie(null),ue(null),q(!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:ht(d),has_sufficient_credits:pe>=d});try{const c=await Ts(s,n.address,Ot,await Ze(),Gt),u=[...c.unavailable,...c.own];if(u.length&&(u.forEach(h=>l(h.id)),ue(Bn(c))),c.buyable.length===0){ie(a("cart.error.noneAvailable")),G(null);return}if(c.orderChanged){G(c),Qe.current=Date.now();return}await et(c.buyable,t)}catch(c){ae(c,{flow:"cart_checkout",step:"review",cart_size:s.length}),ie(Fe(c))}finally{q(!1)}}async function it(){if(B){if(!n){bt({type:"cart-checkout"}),K();return}if(Date.now()-Qe.current>qn){G(null),ue(null),await Y();return}ie(null),et(B.buyable)}}async function Zt(){if(Se){try{sessionStorage.setItem(be,JSON.stringify(H.getState().items))}catch{}q(!0);try{const t=await Is(Se,n?{address:n.address,identity:n.identity}:void 0);if(t.url){window.location.href=t.url;return}X("/credits")}catch(t){try{sessionStorage.removeItem(be)}catch{}ae(t,{flow:"cart_buy_credits"}),j({phase:"error",message:a("buyModal.error.creditsCheckout")})}finally{q(!1)}}}const rt=T.useRef(!1);T.useEffect(()=>{if(!n||rt.current||!ds("cart-checkout"))return;rt.current=!0;const t=setTimeout(()=>void Y(),0);return()=>clearTimeout(t)},[n]);const ot=T.useRef(!1);T.useEffect(()=>{if(!(E!=null&&E.resumeCheckout)||ot.current)return;ot.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 t=setTimeout(()=>void Y(),0);return()=>clearTimeout(t)},[E==null?void 0:E.resumeCheckout]);const ct=T.useRef(!1);T.useEffect(()=>{if(!(E!=null&&E.startCheckout)||ct.current)return;ct.current=!0,X(".",{replace:!0,state:null});const t=setTimeout(()=>void Y(),0);return()=>clearTimeout(t)},[E==null?void 0:E.startCheckout]);const Z=Ft||(g==null?void 0:g.phase)==="processing";return r.length===0&&!g?e.jsx(jt,{children:e.jsxs(St,{children:[e.jsxs(kt,{onClick:()=>X(-1),type:"button",children:[e.jsx(O,{name:"arrow-left"}),a("nav.cart")]}),e.jsxs(Os,{"data-testid":"cart-empty",children:[e.jsx(O,{name:"cart-plus",size:110}),e.jsxs(Gs,{children:[e.jsx(Vs,{children:a("cart.empty.title")}),e.jsx(Ds,{children:a("cart.empty.body")})]}),e.jsx(Js,{to:"/items",children:a("cart.empty.cta")})]})]})}):e.jsxs(jt,{children:[e.jsxs(St,{children:[e.jsxs(kt,{onClick:()=>X(-1),type:"button",children:[e.jsx(O,{name:"arrow-left"}),a("nav.cart")]}),e.jsxs(Qs,{children:[e.jsxs(Us,{children:[e.jsxs(Hs,{children:[e.jsx(Xs,{onClick:()=>X(-1),type:"button","aria-label":a("cart.goBack"),children:e.jsx(O,{name:"arrow-left"})}),e.jsx(Ys,{children:a("cart.panelTitle",{count:Lt})}),Bt?e.jsxs(Zs,{onClick:()=>J(!0),disabled:Z,children:[e.jsx(O,{name:"fitting-room"}),a("cart.fittingRoom")]}):null]}),e.jsxs(At,{children:[e.jsx(en,{children:r.map(t=>{const s=Qt.get(t.id),d=s?s.priceCredits:t.priceCredits,c=!!s&&s.priceCredits!==t.priceCredits,u=!t.tokenId,h=t.quantity,w=typeof t.available=="number"&&h>=t.available,$=d*h,_=ga(t),R=!!_&&!!z[_],W=ma(t),y=He[t.id],m=!ut(y),k=y==="sold-out"?a("cart.availability.soldOut"):a("cart.availability.unavailable");return e.jsxs(tn,{"data-unavailable":m||void 0,children:[e.jsxs(an,{"data-thumb":!0,children:[W?e.jsx(sn,{to:W,state:{item:t,tradeId:t.tradeId},"aria-label":t.name,children:t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:t.name}):null}):t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:t.name}):null,e.jsx(nn,{"data-check":!0,"aria-hidden":!0,children:e.jsx("svg",{viewBox:"0 0 20 20",width:"12",height:"12",children:e.jsx("path",{d:"M5 10.5l3 3 7-7.5",fill:"none",stroke:"#fff",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),e.jsxs(rn,{children:[e.jsxs(on,{"data-desc":!0,children:[W?e.jsx(dn,{to:W,state:{item:t,tradeId:t.tradeId},title:t.name,children:t.name}):e.jsx(cn,{title:t.name,children:t.name}),t.creator?e.jsx(ln,{address:t.creator,linkToProfile:!0}):null,qt&&u?e.jsxs(vn,{"data-testid":"cart-creator-tag",children:[e.jsx(wn,{name:"buy-from-creator"}),a("cart.creatorTag")]}):null]}),e.jsx(un,{children:m?e.jsxs(yn,{children:[e.jsx(bn,{name:"warning-fill",size:24}),k]}):e.jsxs(e.Fragment,{children:[u?e.jsxs(hn,{children:[e.jsx($t,{onClick:()=>ge(()=>A(t.id)),disabled:Z||h<=1,"aria-label":a("cart.decreaseQuantity",{name:t.name}),children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:e.jsx("path",{d:"M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),e.jsx(pn,{children:h}),e.jsx($t,{onClick:()=>ge(()=>P(t.id)),disabled:Z||w,"aria-label":a("cart.increaseQuantity"),children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:e.jsx("path",{d:"M8 3.5v9M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}):null,e.jsxs(gn,{children:[e.jsx(mn,{})," ",$,c?e.jsx(xn,{children:t.priceCredits*h}):null]})]})})]}),e.jsxs(fn,{children:[_?e.jsx(Cn,{"data-on":R||void 0,onClick:()=>ne(t),"aria-label":R?a("cart.removeFromFavorites",{name:t.name}):a("cart.addToFavorites",{name:t.name}),title:R?a("assetCard.removeFromFavorites"):a("assetCard.addToFavorites"),children:e.jsx(O,{name:R?"heart-solid":"heart"})}):null,e.jsx(jn,{onClick:()=>ge(()=>l(t.id)),disabled:Z,"aria-label":a("cart.remove",{name:t.name}),title:a("cart.removeTitle"),children:e.jsx(O,{name:"trash",size:24})})]})]},t.id)})}),e.jsx(kn,{children:e.jsx("button",{className:"link",onClick:()=>ge(F),disabled:Z,children:a("cart.clearCart")})})]})]}),e.jsxs(Sn,{children:[e.jsx($n,{children:a("cart.purchaseSummary")}),e.jsxs(Mn,{children:[e.jsxs(Tn,{children:[e.jsx(In,{children:a("cart.totalItems",{count:Kt})}),e.jsx(An,{children:e.jsxs(Pn,{children:[e.jsx(zn,{})," ",Ve]})})]}),e.jsx(Tt,{options:Te.options,totalCents:Me,shortfall:Te.manaShortfall,showCreditsAmount:!1,creditsLabel:B?a("marketCheckout.confirmPurchase"):Te.options.length>1?a("cart.buyWithCredits"):a("cart.checkout"),busy:Z||Ge,onPay:t=>void(B?it():Y(t)),creditsFallback:{label:Z?a("cart.working"):B?a("marketCheckout.confirmPurchase"):a("cart.checkout"),onClick:()=>void(B?it():Y())}}),Ge?e.jsx(ve,{className:"muted",children:a("cart.allUnavailable")}):null,n?null:e.jsx(ve,{className:"muted",children:a("cart.signInHint")}),B?e.jsx(ve,{className:"muted",children:a("cart.priceChanged")}):null,Ne?e.jsx(ve,{className:"muted",children:Ne}):null,e.jsx(En,{message:_t})]})]})]})]}),De.length>0?e.jsx(Rn,{children:e.jsx(ls,{title:a("cart.youMightAlsoLike"),items:De})}):null,Ae&&n?e.jsx(us,{auth:Ae.auth,signer:n.signer,title:a("authorizeStep.manaTitle"),name:a("authorizeStep.manaName"),reason:a("authorizeStep.manaReason"),icon:e.jsx("img",{src:hs,width:24,height:24,alt:"","aria-hidden":!0}),onAuthorized:()=>{const{run:t}=Ae;me(null),t()},onCancel:()=>me(null),onClose:()=>me(null)}):null,g?e.jsx(Ws,{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:xa(n==null?void 0:n.providerType),signatures:g.phase==="processing"?g.signatures:void 0,options:g.phase==="choose"?Xt(g).options:void 0,onPay:Yt,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 Y()}):null]})}export{Xn as Cart};
|