@dcl/shop 1.3.1-31252242626.commit-c73d75c → 1.4.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-D3P6izHi.js +378 -0
- package/_assets/{AnimatedBackground-BPpu8-bp.js → AnimatedBackground-D2AQICJq.js} +1 -1
- package/_assets/{Assets-D_85zKYe.js → Assets-CeSMRmci.js} +7 -7
- package/_assets/{Assets.styles-B1HvwpzK.js → Assets.styles-Z2BoZfPC.js} +1 -1
- package/_assets/{Authorizations-DDGOtqxv.js → Authorizations-VVZUOHSE.js} +1 -1
- package/_assets/Cart-CH9s120K.js +696 -0
- package/_assets/{CircularProgress-BGQrDSLK.js → CircularProgress-C_E70_6Z.js} +1 -1
- package/_assets/{Collection-BwLONXnd.js → Collection-BBaIIr5M.js} +1 -1
- package/_assets/{CollectionCarousel-DFOfIf7S.js → CollectionCarousel-BCrU8ecV.js} +2 -2
- package/_assets/{Confetti-BXQ-8GtS.js → Confetti-CQ_6holA.js} +1 -1
- package/_assets/{Creator-DJ44nS7F.js → Creator-TtYB1N5N.js} +1 -1
- package/_assets/{ErrorNotice-C6TzeGyj.js → ErrorNotice-D2lGGd2A.js} +1 -1
- package/_assets/{ExchangeController-Di5Zg9CW.js → ExchangeController-DUX0Jdsr.js} +1 -1
- package/_assets/{Faq-BwOgrdK2.js → Faq-BeRHBr_T.js} +1 -1
- package/_assets/{GetCredits-CReJ5iKD.js → GetCredits-DwxH-V-7.js} +1 -1
- package/_assets/{Grow-CLVvW4Va.js → Grow-D8g-VUru.js} +1 -1
- package/_assets/{HelpersUtil-B4GqkAz9.js → HelpersUtil-a7045UWU.js} +1 -1
- package/_assets/{ItemDetail-B8_Oy1Zw.js → ItemDetail-B9XkCCaI.js} +1 -1
- package/_assets/LazyEmoteControls-CG--merP.js +2 -0
- package/_assets/{LoadMore-CKSYwQSC.js → LoadMore-CvbwW-Q7.js} +1 -1
- package/_assets/{ManaPricingBanner.styles-ClU3x0BU.js → ManaPricingBanner.styles-9rwqZxWY.js} +1 -1
- package/_assets/{MyAssets-BBpVmvzR.js → MyAssets-AvAKbdl8.js} +2 -2
- package/_assets/{MyFavorites-Cy9OJvwt.js → MyFavorites-BCVtjkJD.js} +1 -1
- package/_assets/{NotFound-e849cnkT.js → NotFound-C59P6Izo.js} +1 -1
- package/_assets/{NotificationsBell-BCAtVeX7.js → NotificationsBell-BZsN5Iuk.js} +1 -1
- package/_assets/{OutfitDetail-CJJkl5yC.js → OutfitDetail-CWyedHOu.js} +1 -1
- package/_assets/{OutfitPreview-x2PYMhn3.js → OutfitPreview-C9CK_tog.js} +1 -1
- package/_assets/{OutfitStudio-DjzcoL7_.js → OutfitStudio-0hJzr8fl.js} +1 -1
- package/_assets/{StoreSettings-WBnUCWX3.js → StoreSettings-DMkaWkoY.js} +1 -1
- package/_assets/{Success-DM6ZIfGx.js → Success-DBVDRM2b.js} +1 -1
- package/_assets/{SwapController-CCtJ10ku.js → SwapController-zTcRGPrQ.js} +1 -1
- package/_assets/{Tooltip-C1GF8yzx.js → Tooltip-B7PK3XRM.js} +1 -1
- package/_assets/{TradeService-DR7fX6hZ.js → TradeService-L56ib8YL.js} +1 -1
- package/_assets/{W3MFrameProviderSingleton-BSPMxIrN.js → W3MFrameProviderSingleton-CnouvR1_.js} +3 -3
- package/_assets/{WebCryptoP256-wXnsce_s.js → WebCryptoP256-awBjqtmJ.js} +1 -1
- package/_assets/authorizations-CwRrfhXP.js +1 -0
- package/_assets/{basic-CdgQQJxQ.js → basic-C1Occ-ll.js} +1 -1
- package/_assets/{biconomy-DhUyAaJx.js → biconomy-DYdhlClT.js} +1 -1
- package/_assets/{builder-rk1gzg6o.js → builder-DUURfr6C.js} +1 -1
- package/_assets/{buy-C8cZuDKG.js → buy-B-WrRkMr.js} +1 -1
- package/_assets/{buy-gasless-DgVYAdEI.js → buy-gasless-B3kudvBt.js} +1 -1
- package/_assets/{categories-TyiHModX.js → categories-DK06mRC-.js} +1 -1
- package/_assets/{ccip-BNrZpQD6.js → ccip-CeFSONqB.js} +1 -1
- package/_assets/{ccip-B6d91HbN.js → ccip-D7X2yyPA.js} +1 -1
- package/_assets/{collectionPage.styles-B0Y6R9vW.js → collectionPage.styles-wm5OLDLb.js} +6 -6
- package/_assets/{controller-BoNXkBWT.js → controller-BMK28WFM.js} +2 -2
- package/_assets/{core-BadPn6dC.js → core-BKQv8QTw.js} +4 -4
- package/_assets/{createSvgIcon-E_1bKhdT.js → createSvgIcon-Clii5lWh.js} +1 -1
- package/_assets/{custom-DiEOmU8d.js → custom-DAvHCARY.js} +1 -1
- package/_assets/{data-capture-DXnM_lk9.js → data-capture-BgeSAIFU.js} +1 -1
- package/_assets/{email-GOpB4BQG.js → email-DYlCA9Sx.js} +1 -1
- package/_assets/{embedded-wallet-Cohei5OY.js → embedded-wallet-C6eQ8V49.js} +1 -1
- package/_assets/{emotion-styled.browser.esm-CLtGE1ll.js → emotion-styled.browser.esm-CF5-hWBg.js} +1 -1
- package/_assets/{engine-BvtekySw.js → engine-DixaYvf_.js} +1 -1
- package/_assets/{errors-OSxcB_78.js → errors-CVqHKixP.js} +1 -1
- package/_assets/{estimate-l1-fee-CRBS7t31.js → estimate-l1-fee-Pi_Fcu_v.js} +1 -1
- package/_assets/{execute-TU_2vXm6.js → execute-CMHIfTIG.js} +2 -2
- package/_assets/{features-CwmiB51C.js → features-UalfAxmx.js} +1 -1
- package/_assets/{fetchTokenMetadata--yK0evUL.js → fetchTokenMetadata-C34JqoKx.js} +2 -2
- package/_assets/{field.styles-DeEM1NvZ.js → field.styles-CIxVjFuR.js} +1 -1
- package/_assets/{get-ecosystem-wallet-info-Dz0cXv5J.js → get-ecosystem-wallet-info-B0dn7Fe4.js} +1 -1
- package/_assets/{getBalance-CQpBPdTR.js → getBalance-qCdp4tf8.js} +1 -1
- package/_assets/{getNFT-BVYQgT7O.js → getNFT-CZjYeMk9.js} +1 -1
- package/_assets/{getNFT-DjKxNOGt.js → getNFT-CrvB8XF1.js} +1 -1
- package/_assets/{grid.styles-DXCsn4JF.js → grid.styles-BWgyhr0s.js} +1 -1
- package/_assets/{hashTypedData-DC_RnPQD.js → hashTypedData-BYa8SpY3.js} +1 -1
- package/_assets/{hashTypedData-D0IEKBRS.js → hashTypedData-kJ-hAObx.js} +1 -1
- package/_assets/{in-app-OsLybK6m.js → in-app-B0dvVGiq.js} +1 -1
- package/_assets/{in-app-wallet-calls-BXDmflHz.js → in-app-wallet-calls-DwoQ-KSZ.js} +1 -1
- package/_assets/{index-CSY0bdZ7.js → index-4hqCLge4.js} +1 -1
- package/_assets/{index-DYsiSWRD.js → index-BMFk7k2a.js} +2 -2
- package/_assets/{index-byTukmCU.js → index-BMTgIyWN.js} +1 -1
- package/_assets/{index-CWNHwTp9.js → index-BP0EmBJ-.js} +1 -1
- package/_assets/{index-BOQHWdN-.js → index-BQX5CGXn.js} +1 -1
- package/_assets/{index-D-uEOpjO.js → index-BQn4WbOu.js} +1 -1
- package/_assets/{index-BnjBGQHV.js → index-BWXYh1GT.js} +1 -1
- package/_assets/{index-BMHAmosr.js → index-BWxEgsJY.js} +1 -1
- package/_assets/{index-Du7SSwQ3.js → index-Bpr6Lfn-.js} +1 -1
- package/_assets/{index-DiN2c1K3.js → index-BqYZOUDk.js} +1 -1
- package/_assets/{index-C9SBlMYc.js → index-BsvhvJDQ.js} +1 -1
- package/_assets/{index-BtNfhlUE.js → index-Bw89h0QJ.js} +1 -1
- package/_assets/{index-BCZ3tZR3.js → index-BwzG5Pnl.js} +1 -1
- package/_assets/{index-BMErPZak.js → index-C1YzoFI-.js} +2 -2
- package/_assets/{index-DtBtmaAv.js → index-C53vdle3.js} +1 -1
- package/_assets/{index-BqDFXnrb.js → index-C6YXXNiT.js} +1 -1
- package/_assets/{index-5IfbtLyI.js → index-CAnMkSsw.js} +1 -1
- package/_assets/{index-tTAL2WB-.js → index-CBs-QSKp.js} +1 -1
- package/_assets/{index-CmE0xSf2.js → index-CFCWXNzP.js} +1 -1
- package/_assets/{index-DIFv8mLZ.js → index-CFIosO15.js} +1 -1
- package/_assets/{index-9AMRqa2Q.js → index-CQTQSECq.js} +1 -1
- package/_assets/{index-C9V04cJW.js → index-CSe7Xqd6.js} +1 -1
- package/_assets/{index-Bvwq5-S8.js → index-CT-s62SZ.js} +1 -1
- package/_assets/{index-DVr5g7aY.js → index-CWYJmZ0e.js} +1 -1
- package/_assets/{index-DN6xb_ze.js → index-CXtHLKLG.js} +1 -1
- package/_assets/{index-DuBvA9NX.js → index-Cb4u4uBY.js} +1 -1
- package/_assets/{index-CfVyYh3y.js → index-CbKqTE1n.js} +1 -1
- package/_assets/{index-DLn-xGRu.js → index-CfRD-uBc.js} +1 -1
- package/_assets/{index-CAozwzga.js → index-CpzYZlH8.js} +3 -3
- package/_assets/{index-B3RTvili.js → index-Cyo6p1tx.js} +1 -1
- package/_assets/{index-RT7ay0fP.js → index-CzKfhET1.js} +1 -1
- package/_assets/{index-BBS247oh.js → index-D5Q-6LU1.js} +1 -1
- package/_assets/{index-CJydVry-.js → index-D5qxgeiD.js} +1 -1
- package/_assets/{index-BrmXfhSy.js → index-DImWjxz8.js} +1 -1
- package/_assets/{index-DBE8WuHb.js → index-DJUhAF-m.js} +1 -1
- package/_assets/{index-DphwwJkw.js → index-DKz61GmH.js} +1 -1
- package/_assets/{index-BjmzqwSC.js → index-DXGkFKcY.js} +1 -1
- package/_assets/{index-BGW-6qbU.js → index-DYtEpEFW.js} +1 -1
- package/_assets/{index-C7hbjfPZ.js → index-DaK0h_lf.js} +1 -1
- package/_assets/{index-BZRe9AK8.js → index-DgWvH8vB.js} +1 -1
- package/_assets/{index-B_Rjazst.js → index-Dix3DFNj.js} +1 -1
- package/_assets/{index-fDHYZUKA.js → index-DrWszBPr.js} +1 -1
- package/_assets/{index-CJmYIHke.js → index-Dzr3wWqM.js} +329 -327
- package/_assets/{index-DEOpztub.js → index-ECd-PCjz.js} +1 -1
- package/_assets/{index-Brs0Pv5-.js → index-EXmcWYkf.js} +1 -1
- package/_assets/{index-CM7mcfju.js → index-I9-XdzvE.js} +3 -3
- package/_assets/{index--mkx_Ub3.js → index-QG0o4yA6.js} +2 -2
- package/_assets/{index-BwOue38k.js → index-UJUGuBsy.js} +3 -3
- package/_assets/{index-BXOEC5IY.js → index-__D_0yHf.js} +1 -1
- package/_assets/{index-DWFZCVHa.js → index-oCqI9Vle.js} +1 -1
- package/_assets/{index-BBeSi9EO.js → index-pI1BXeGM.js} +1 -1
- package/_assets/{index-Csbo1eza.js → index-txnyrMV_.js} +1 -1
- package/_assets/{index.es-XZr74JNT.js → index.es-DJ8zTN2F.js} +1 -1
- package/_assets/{index.es-BG60FmGW.js → index.es-DNcp95sw.js} +4 -4
- package/_assets/{index.es-Bz8gZ7qB.js → index.es-QXU_nQ-C.js} +1 -1
- package/_assets/{localBatchGatewayRequest-ikLylIgm.js → localBatchGatewayRequest-DQEy82M0.js} +1 -1
- package/_assets/{networks-DGWDQvqw.js → networks-C2SYHxfA.js} +1 -1
- package/_assets/{onramp-DKoZ03XB.js → onramp-BmIZqUWB.js} +1 -1
- package/_assets/{openzeppelin-LOcHCFQX.js → openzeppelin-CdFYjGJt.js} +1 -1
- package/_assets/{parseNft-CY3PDq17.js → parseNft-BSTb-_y6.js} +2 -2
- package/_assets/{parseSignature-Ds5KGfSM.js → parseSignature-eZCTQvH0.js} +1 -1
- package/_assets/{parseSignature-BI6HCnqF.js → parseSignature-l4LZgONZ.js} +3 -3
- package/_assets/{passkeys-BYmlf1qh.js → passkeys-CozWp77i.js} +1 -1
- package/_assets/{pay-with-exchange-D-vRoPs-.js → pay-with-exchange-BNpFsUXH.js} +1 -1
- package/_assets/{qr-overlay-ZKwUKLDM.js → qr-overlay-OlE8lt7R.js} +1 -1
- package/_assets/{receive-BpOQ3F73.js → receive-BGQom-1t.js} +1 -1
- package/_assets/{resolveImplementation-Bmms8eMC.js → resolveImplementation-ruTvtmSL.js} +1 -1
- package/_assets/{rpc-B-bvGvlc.js → rpc-BIQ29MFh.js} +1 -1
- package/_assets/{secp256k1-ChR0vl-U.js → secp256k1-B-R6uHp9.js} +1 -1
- package/_assets/{secp256k1-dWvFOFgp.js → secp256k1-DAIQkTMa.js} +1 -1
- package/_assets/{secp256k1-D-c7AgZJ.js → secp256k1-DW-8KMGu.js} +1 -1
- package/_assets/{send-CNoBgjC3.js → send-Dlj9wfGD.js} +1 -1
- package/_assets/{send-batch-transaction-Bt4eO7_A.js → send-batch-transaction-BzUzA610.js} +1 -1
- package/_assets/{send-eip712-transaction-Dkhz19jD.js → send-eip712-transaction-CALz6PKQ.js} +2 -2
- package/_assets/{send-gasless-transaction-CabqcqeH.js → send-gasless-transaction-Ua-fi-CM.js} +2 -2
- package/_assets/{send-transaction-2iw3OWf1.js → send-transaction-B6Fha1vM.js} +2 -2
- package/_assets/{sendMetaTransaction-ChBpXQUv.js → sendMetaTransaction-CUn-fhZo.js} +1 -1
- package/_assets/{sendRawTransaction-Bg5Bog-D.js → sendRawTransaction-ZVd15bYm.js} +3 -3
- package/_assets/{serializeTransaction-BQMXuVy4.js → serializeTransaction-BAGfnJsZ.js} +1 -1
- package/_assets/{session-proposal-3Q5m6rmS.js → session-proposal-BYxVkg3L.js} +1 -1
- package/_assets/{session-request-Cbe4UvDv.js → session-request-PkAQNb49.js} +2 -2
- package/_assets/{signing-D3JslPvi.js → signing-CIxtdm7n.js} +3 -3
- package/_assets/{skeleton.styles-CVOz4NuN.js → skeleton.styles-DL8N-ebx.js} +1 -1
- package/_assets/{socials-Byik4B6H.js → socials-T4X_pgd7.js} +1 -1
- package/_assets/{styled-DXQxy1OG.js → styled-77pZ9Va6.js} +1 -1
- package/_assets/{swaps-CGuC9r6P.js → swaps-CPRccZrb.js} +1 -1
- package/_assets/{thirdweb-DYS4bx2O.js → thirdweb-DYcza1xd.js} +3 -3
- package/_assets/{to-serializable-transaction-B9hOlQhS.js → to-serializable-transaction-zR9GnOtJ.js} +2 -2
- package/_assets/{transactionReceipt-CKK1YHPc.js → transactionReceipt-q4pdsIzp.js} +1 -1
- package/_assets/{transactions-pM3EvVyU.js → transactions-Cc80zHEF.js} +1 -1
- package/_assets/{useCreditPacks-BQuT66CB.js → useCreditPacks-kN4lsUSN.js} +1 -1
- package/_assets/{useImportable-VbRNEeu4.js → useImportable-BOwjZRHI.js} +1 -1
- package/_assets/{useInfiniteGrid-CqVFUAZB.js → useInfiniteGrid-B88z2StQ.js} +1 -1
- package/_assets/{useStore-DGBkQFz7.js → useStore-B7NaWcJ2.js} +1 -1
- package/_assets/{useTheme-fGx03AZV.js → useTheme-y31gDcIX.js} +1 -1
- package/_assets/{verifyHash-DOkIX2BO.js → verifyHash-7MX9V0uS.js} +1 -1
- package/_assets/{w3m-modal-B11X56B-.js → w3m-modal-BeJmA6h8.js} +1 -1
- package/_assets/{w3m-modal-BwxgxAPe.js → w3m-modal-CVKbb0y3.js} +1 -1
- package/_assets/{wait-for-tx-receipt-BaxFnjPg.js → wait-for-tx-receipt-BafcrIuf.js} +1 -1
- package/_assets/{wallets-BmrEl61j.js → wallets-B1mbb-GR.js} +5 -5
- package/_assets/{web-connector-CLVorEco.js → web-connector-D-4IhzX3.js} +3 -3
- package/_assets/{writeContract-rG-WdCVH.js → writeContract-ABlke1F1.js} +1 -1
- package/_assets/{zoraTestnet-DyA1No_S.js → zoraTestnet-UBz7o6gR.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/_assets/Activity-MdeNPdAy.js +0 -378
- package/_assets/Cart-CbbJZlOR.js +0 -696
- package/_assets/LazyEmoteControls-BcjgXC3K.js +0 -2
- package/_assets/authorizations-B8zfFZri.js +0 -1
package/_assets/Cart-CbbJZlOR.js
DELETED
|
@@ -1,696 +0,0 @@
|
|
|
1
|
-
import{j as e,L as We,r as M,b as sa,a as na}from"./react-BYHuwl8r.js";import{t as de,s as i,b as s,L as le,ax as ia,ay as ze,az as ra,J as oa,I as O,A as Tt,K as Le,y as ca,X as H,am as ot,v as la,w as da,l as ua,aA as ha,D as pa,aB as ga,an as ma,aC as xa,aD as ct,aE as fa,aF as ya,z as ba,aG as lt,Z as V,aH as dt,aI as va,k as ae,r as wa,c as ut,aJ as Ca,C as ja,aK as ht,aL as Ee,aM as ka,aN as fe,aO as ye,aP as pt,g as gt,f as mt,aQ as $a}from"./index-CJmYIHke.js";import{M as Sa,S as Ma,C as Ta,H as Ia,a as Pa,T as Aa,X as za,b as Ea,B as Ra,c as Ba,d as xt,e as qa,f as Ce,P as It,m as _a,g as Fa,h as Wa,i as La,j as Ka,k as Pt,l as je,L as Na,n as Qa,o as ft,p as yt,W as Ua,q as Ga,r as Ha,s as Oa,A as Da,t as Va,u as Ja,v as Xa,w as Ya,x as Za,y as es,z as ts,D as as,E as ss,F as ns,G as is,I as rs,J as os,K as cs,N as ls,O as ds,Q as Re,R as us,U as hs,V as ps,Y as gs,Z as bt,_ as vt,$ as ms,a0 as xs,a1 as fs,a2 as ys,a3 as wt,a4 as bs}from"./CollectionCarousel-DFOfIf7S.js";import{f as vs,h as ws,a as Cs,n as js,i as ks,A as $s}from"./authorizations-B8zfFZri.js";import{g as Ss,h as Be,p as Ms}from"./buy-C8cZuDKG.js";import{b as Ts,w as Is,S as Ct,G as Ps}from"./buy-gasless-DgVYAdEI.js";import{u as As,M as zs,R as be,r as Es,c as Rs,p as jt,a as qe}from"./useCreditPacks-BQuT66CB.js";import{i as Bs,a as qs}from"./errors-OSxcB_78.js";import{E as _s}from"./ErrorNotice-C6TzeGyj.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-ChBpXQUv.js";const{colors:se,radius:Fs}=de,Ws=i.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
align-items: center;
|
|
4
|
-
justify-content: center;
|
|
5
|
-
gap: 8px;
|
|
6
|
-
width: 100%;
|
|
7
|
-
`,Ls=i.span`
|
|
8
|
-
font-size: 16px;
|
|
9
|
-
line-height: 22px;
|
|
10
|
-
color: ${se.text2};
|
|
11
|
-
text-transform: capitalize;
|
|
12
|
-
white-space: nowrap;
|
|
13
|
-
`,Ks=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: ${Fs.btn};
|
|
38
|
-
}
|
|
39
|
-
`,Ns=i.span`
|
|
40
|
-
margin-left: 8px;
|
|
41
|
-
font-size: 13px;
|
|
42
|
-
font-weight: 600;
|
|
43
|
-
color: ${se.muted};
|
|
44
|
-
`,Qs=i.div`
|
|
45
|
-
display: flex;
|
|
46
|
-
align-items: center;
|
|
47
|
-
justify-content: space-between;
|
|
48
|
-
gap: 12px;
|
|
49
|
-
padding: 0 0 12px;
|
|
50
|
-
font-size: 14px;
|
|
51
|
-
color: ${se.muted};
|
|
52
|
-
|
|
53
|
-
& strong {
|
|
54
|
-
display: inline-flex;
|
|
55
|
-
align-items: center;
|
|
56
|
-
gap: 6px;
|
|
57
|
-
font-size: 20px;
|
|
58
|
-
font-weight: 700;
|
|
59
|
-
color: ${se.text};
|
|
60
|
-
}
|
|
61
|
-
`;function Us(o){const{phase:d,balanceCredits:P,onClose:A}=o,F=d==="processing",J=d==="error"?s("cartCheckout.errorTitle"):d==="nofunds"?s("cartCheckout.titleNoFunds"):d==="choose"?s("buyModal.choosePayment"):s("cartCheckout.titleBuy"),X=d==="processing";return e.jsxs(Sa,{role:"dialog","aria-modal":"true","aria-label":s("cartCheckout.dialogAria"),children:[e.jsx(Ma,{onClick:F?void 0:A,"aria-hidden":!0}),e.jsxs(Ta,{"data-tall":X||void 0,children:[e.jsxs(Ia,{children:[e.jsxs(Pa,{children:[e.jsx(Aa,{children:J}),!F&&e.jsx(za,{onClick:A,"aria-label":s("buyModal.close"),children:e.jsx(Ea,{})})]}),e.jsxs(Ra,{children:[e.jsx(Ba,{children:d==="nofunds"?s("buyModal.dclBalance"):s("buyModal.myCreditsBalance")}),e.jsx(xt,{}),e.jsx(qa,{children:le(P)})]})]}),d==="choose"&&e.jsxs(Ce,{children:[e.jsxs(Qs,{children:[e.jsx("span",{children:s("cart.purchaseSummary")}),e.jsxs("strong",{children:[e.jsx(xt,{}),le(o.totalCredits??0)]})]}),e.jsx(It,{options:o.options??[],totalCents:o.totalCents??0,onPay:o.onPay??(()=>{}),rateNote:(()=>{const z=_a(o.totalCents??0,o.totalManaWei??0n);return z!=null?s("buyModal.manaRate",{mana:z.toLocaleString("en",{maximumFractionDigits:2})}):null})()})]}),d==="processing"&&e.jsx(Gs,{stage:o.stage??"reserving",step:o.step??1,total:o.total??1,isSelfCustody:!!o.isSelfCustody,signatures:o.signatures}),d==="nofunds"&&e.jsx(Hs,{lines:o.lines??[],shortfallCredits:o.shortfallCredits??0,packs:o.packs??[],selectedPack:o.selectedPack??"",onSelectPack:o.onSelectPack??(()=>{}),onBuyPacks:o.onBuyPacks??(()=>{}),onCancel:A}),d==="error"&&e.jsxs(Ce,{children:[e.jsxs(Fa,{"data-testid":"buy-error",children:[e.jsx(Wa,{src:La,alt:"",width:64,height:80}),e.jsxs(Ka,{children:[e.jsx("b",{children:s("cartCheckout.errorHeadline")})," ",o.message??s("cartCheckout.errorBody")]})]}),e.jsxs(Pt,{children:[e.jsx(je,{"data-variant":"outline",onClick:A,children:s("buyModal.cancel")}),e.jsx(je,{"data-variant":"purple",onClick:o.onRetry??A,children:s("cartCheckout.tryAgain")})]})]})]})]})}function Gs({stage:o,step:d,total:P,isSelfCustody:A,signatures:F}){const J=o==="reserving",X=P>0?Math.min(100,Math.round(d/P*100)):0,z=A&&F&&F.total>1,ne=o==="awaiting-signature"?A?z?s("cartCheckout.confirmMultiple",{current:F.current,total:F.total}):s("buyModal.confirmToContinue"):s("buyModal.completingTransaction"):o==="settling"?s("buyModal.completingTransaction"):s("cartCheckout.preparing");return e.jsxs(Ce,{"data-processing":!0,children:[e.jsx(Na,{src:ia,alt:"",width:61,height:61}),e.jsx(Qa,{children:ne}),J?e.jsxs(Ws,{children:[e.jsx(ft,{"aria-hidden":!0,children:e.jsx(yt,{"data-step":!0,style:{width:`${X}%`}})}),P>1?e.jsxs(Ls,{children:[d,"/",P]}):null]}):e.jsx(ft,{"aria-hidden":!0,children:e.jsx(yt,{})})]})}function Hs({lines:o,shortfallCredits:d,packs:P,selectedPack:A,onSelectPack:F,onBuyPacks:J,onCancel:X}){const z=P.find(n=>n.id===A),ne=o.reduce((n,L)=>n+(L.quantity??1),0);return e.jsxs(Ce,{children:[e.jsxs(Ua,{"data-testid":"nofunds-warning",children:[e.jsx(Ga,{}),e.jsxs(Ha,{children:[e.jsx("b",{children:s("buyModal.insufficientFunds")})," ",s("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:s("buyModal.warningCreditsAmount",{count:Math.max(0,d)})})," ",s("buyModal.warningToPurchase",{count:ne}),ze()?null:e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(Oa,{href:ra("/credits"),target:"_blank",rel:"noopener noreferrer",children:s("buyModal.warningLearnMore")})]})]})]}),e.jsx(Ks,{children:o.map(n=>{const L=n.quantity??1;return e.jsxs(Da,{children:[e.jsx(Va,{children:n.item.thumbnail?e.jsx("img",{src:n.item.thumbnail,alt:""}):null}),e.jsxs(Ja,{children:[e.jsxs("div",{children:[e.jsxs(Xa,{title:n.item.name,children:[n.item.name||s("buyModal.itemFallback"),L>1?e.jsx(Ns,{children:s("cartCheckout.qty",{count:L})}):null]}),n.item.creator?e.jsx(Ya,{address:n.item.creator}):null]}),e.jsxs(Za,{children:[e.jsx(es,{}),e.jsx("span",{children:le(n.priceCredits*L)})]})]})]},n.item.id)})}),ze()?null:e.jsxs(e.Fragment,{children:[e.jsx(ts,{children:P.map(n=>{const L=n.id===A;return e.jsxs(as,{"data-testid":"credit-pack","data-on":L||void 0,onClick:()=>F(n.id),children:[e.jsx(ss,{src:ns,alt:""}),e.jsx(is,{children:le(n.credits)}),e.jsxs(rs,{children:["($",n.usd.toFixed(2),")"]})]},n.id)})}),e.jsxs(os,{children:[e.jsxs(cs,{children:[e.jsx(ls,{}),e.jsx("span",{children:le((z==null?void 0:z.credits)??0)})]}),e.jsxs(ds,{children:["$",((z==null?void 0:z.usd)??0).toFixed(2)]})]})]}),e.jsxs(Pt,{children:[e.jsx(je,{"data-variant":"outline",onClick:X,children:s("buyModal.cancel")}),ze()?null:e.jsx(je,{"data-variant":"gradient",onClick:J,children:s("buyModal.buy")})]})]})}const{colors:c,gradients:Os,radius:te}=de,At="@media (max-width: 1080px)",I="@media (max-width: 880px)",kt=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
|
-
`,$t=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: ${c.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: ${c.accent};
|
|
92
|
-
}
|
|
93
|
-
& .ico {
|
|
94
|
-
width: 18px;
|
|
95
|
-
height: 18px;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
${I} {
|
|
99
|
-
display: none;
|
|
100
|
-
}
|
|
101
|
-
`,Ds=i.div`
|
|
102
|
-
display: grid;
|
|
103
|
-
grid-template-columns: minmax(0, 1fr) 615px;
|
|
104
|
-
gap: 24px;
|
|
105
|
-
align-items: start;
|
|
106
|
-
|
|
107
|
-
${At} {
|
|
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: ${c.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
|
-
`,Vs=i.div`
|
|
151
|
-
min-width: 0;
|
|
152
|
-
display: flex;
|
|
153
|
-
flex-direction: column;
|
|
154
|
-
gap: 12px;
|
|
155
|
-
`,Js=i.div`
|
|
156
|
-
display: flex;
|
|
157
|
-
align-items: center;
|
|
158
|
-
justify-content: space-between;
|
|
159
|
-
gap: 12px;
|
|
160
|
-
background: ${c.white};
|
|
161
|
-
border-radius: 16px;
|
|
162
|
-
padding: 12px 12px 12px 24px;
|
|
163
|
-
|
|
164
|
-
${I} {
|
|
165
|
-
gap: 8px;
|
|
166
|
-
padding: 8px 16px;
|
|
167
|
-
}
|
|
168
|
-
`,zt=i.section`
|
|
169
|
-
min-width: 0;
|
|
170
|
-
background: ${c.white};
|
|
171
|
-
border-radius: 16px;
|
|
172
|
-
padding: 24px;
|
|
173
|
-
|
|
174
|
-
${I} {
|
|
175
|
-
padding: 16px;
|
|
176
|
-
}
|
|
177
|
-
`,Xs=i(zt)`
|
|
178
|
-
display: flex;
|
|
179
|
-
flex-direction: column;
|
|
180
|
-
align-items: center;
|
|
181
|
-
justify-content: center;
|
|
182
|
-
gap: 24px;
|
|
183
|
-
min-height: 420px;
|
|
184
|
-
padding: 48px 16px;
|
|
185
|
-
text-align: center;
|
|
186
|
-
color: ${c.text};
|
|
187
|
-
|
|
188
|
-
${de.media.maxWidth("mobile")} {
|
|
189
|
-
min-height: 320px;
|
|
190
|
-
padding: 32px 16px;
|
|
191
|
-
}
|
|
192
|
-
`,Ys=i.div`
|
|
193
|
-
display: flex;
|
|
194
|
-
flex-direction: column;
|
|
195
|
-
align-items: center;
|
|
196
|
-
gap: 12px;
|
|
197
|
-
padding-bottom: 16px;
|
|
198
|
-
`,Zs=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
|
-
`,en=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
|
-
`,tn=i(We)`
|
|
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: ${c.accent};
|
|
226
|
-
color: ${c.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: ${c.accentHover};
|
|
237
|
-
}
|
|
238
|
-
&:focus-visible {
|
|
239
|
-
outline: 2px solid ${c.accent};
|
|
240
|
-
outline-offset: 2px;
|
|
241
|
-
}
|
|
242
|
-
`,an=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: ${c.text};
|
|
253
|
-
cursor: pointer;
|
|
254
|
-
|
|
255
|
-
& .ico {
|
|
256
|
-
width: 20px;
|
|
257
|
-
height: 20px;
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
`,sn=i.h1`
|
|
261
|
-
margin: 0;
|
|
262
|
-
font-size: 14px;
|
|
263
|
-
font-weight: 600;
|
|
264
|
-
line-height: 1.57;
|
|
265
|
-
color: ${c.text};
|
|
266
|
-
|
|
267
|
-
${I} {
|
|
268
|
-
flex: 1;
|
|
269
|
-
min-width: 0;
|
|
270
|
-
font-size: 16px;
|
|
271
|
-
}
|
|
272
|
-
`,nn=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 ${c.text2};
|
|
280
|
-
border-radius: ${te.btn};
|
|
281
|
-
background: none;
|
|
282
|
-
color: ${c.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: ${c.text};
|
|
311
|
-
color: ${c.text};
|
|
312
|
-
}
|
|
313
|
-
`,rn=i.div`
|
|
314
|
-
display: flex;
|
|
315
|
-
flex-direction: column;
|
|
316
|
-
gap: 24px;
|
|
317
|
-
`,on=i.div`
|
|
318
|
-
position: relative;
|
|
319
|
-
display: flex;
|
|
320
|
-
align-items: stretch;
|
|
321
|
-
gap: 12px;
|
|
322
|
-
background: ${c.white};
|
|
323
|
-
border: 1px solid ${c.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
|
-
`,cn=i.div`
|
|
337
|
-
position: relative;
|
|
338
|
-
flex-shrink: 0;
|
|
339
|
-
width: 137.5px;
|
|
340
|
-
height: 137px;
|
|
341
|
-
background: ${c.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
|
-
`,ln=i(We)`
|
|
359
|
-
position: absolute;
|
|
360
|
-
inset: 0;
|
|
361
|
-
display: grid;
|
|
362
|
-
place-items: center;
|
|
363
|
-
`,dn=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
|
-
`,un=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
|
-
`,hn=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
|
-
`,Et=Le`
|
|
392
|
-
display: block;
|
|
393
|
-
font-size: 16px;
|
|
394
|
-
font-weight: 600;
|
|
395
|
-
line-height: 1.2;
|
|
396
|
-
color: ${c.text};
|
|
397
|
-
text-decoration: none;
|
|
398
|
-
overflow: hidden;
|
|
399
|
-
text-overflow: ellipsis;
|
|
400
|
-
white-space: nowrap;
|
|
401
|
-
|
|
402
|
-
a&:hover {
|
|
403
|
-
color: ${c.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
|
-
`,pn=i.div`
|
|
414
|
-
${Et};
|
|
415
|
-
`,gn=i(We)`
|
|
416
|
-
${Et};
|
|
417
|
-
`,mn=i(oa)`
|
|
418
|
-
font-size: 10px;
|
|
419
|
-
line-height: 1.43;
|
|
420
|
-
color: ${c.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
|
-
`,xn=i.div`
|
|
430
|
-
display: flex;
|
|
431
|
-
align-items: center;
|
|
432
|
-
justify-content: space-between;
|
|
433
|
-
gap: 12px;
|
|
434
|
-
padding-right: 8px;
|
|
435
|
-
`,fn=i.div`
|
|
436
|
-
display: inline-flex;
|
|
437
|
-
align-items: center;
|
|
438
|
-
gap: 8px;
|
|
439
|
-
padding: 6px;
|
|
440
|
-
border: 0.5px solid ${c.muted2};
|
|
441
|
-
border-radius: ${te.pill};
|
|
442
|
-
`,Mt=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: ${c.text};
|
|
451
|
-
cursor: pointer;
|
|
452
|
-
|
|
453
|
-
&:disabled {
|
|
454
|
-
color: ${c.muted2};
|
|
455
|
-
cursor: default;
|
|
456
|
-
}
|
|
457
|
-
`,yn=i.span`
|
|
458
|
-
min-width: 12px;
|
|
459
|
-
font-size: 14px;
|
|
460
|
-
font-weight: 500;
|
|
461
|
-
line-height: 1.2;
|
|
462
|
-
color: ${c.text};
|
|
463
|
-
text-align: center;
|
|
464
|
-
`,bn=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: ${c.text2};
|
|
474
|
-
|
|
475
|
-
${I} {
|
|
476
|
-
font-size: 20px;
|
|
477
|
-
}
|
|
478
|
-
`,vn=i(Tt)`
|
|
479
|
-
width: 24px;
|
|
480
|
-
height: 24px;
|
|
481
|
-
background: ${c.text};
|
|
482
|
-
|
|
483
|
-
${I} {
|
|
484
|
-
width: 20px;
|
|
485
|
-
height: 20px;
|
|
486
|
-
}
|
|
487
|
-
`,wn=i.span`
|
|
488
|
-
margin-left: 6px;
|
|
489
|
-
font-size: 14px;
|
|
490
|
-
font-weight: 500;
|
|
491
|
-
color: ${c.muted};
|
|
492
|
-
text-decoration: line-through;
|
|
493
|
-
`,Cn=i.div`
|
|
494
|
-
position: absolute;
|
|
495
|
-
top: 9px;
|
|
496
|
-
right: 7px;
|
|
497
|
-
display: flex;
|
|
498
|
-
align-items: flex-start;
|
|
499
|
-
gap: 12px;
|
|
500
|
-
`,jn=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: ${c.text2};
|
|
509
|
-
`,kn=i(O)`
|
|
510
|
-
color: #f48221;
|
|
511
|
-
`,$n=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: ${c.text};
|
|
523
|
-
`,Sn=i(O)`
|
|
524
|
-
width: 11.31px;
|
|
525
|
-
height: 10.94px;
|
|
526
|
-
background: ${c.text};
|
|
527
|
-
`,Rt=Le`
|
|
528
|
-
display: grid;
|
|
529
|
-
place-items: center;
|
|
530
|
-
width: 24px;
|
|
531
|
-
height: 24px;
|
|
532
|
-
padding: 0;
|
|
533
|
-
border: 0;
|
|
534
|
-
background: none;
|
|
535
|
-
color: ${c.muted};
|
|
536
|
-
cursor: pointer;
|
|
537
|
-
transition: color 0.12s ease;
|
|
538
|
-
|
|
539
|
-
&:disabled {
|
|
540
|
-
opacity: 0.5;
|
|
541
|
-
cursor: default;
|
|
542
|
-
}
|
|
543
|
-
`,Mn=i.button`
|
|
544
|
-
${Rt};
|
|
545
|
-
|
|
546
|
-
&:hover:not(:disabled) {
|
|
547
|
-
color: ${c.text};
|
|
548
|
-
}
|
|
549
|
-
&[data-on] {
|
|
550
|
-
color: ${c.dclRed};
|
|
551
|
-
}
|
|
552
|
-
`,Tn=i.button`
|
|
553
|
-
${Rt};
|
|
554
|
-
|
|
555
|
-
&:hover:not(:disabled) {
|
|
556
|
-
color: ${c.dclRed};
|
|
557
|
-
}
|
|
558
|
-
`,In=i.div`
|
|
559
|
-
display: flex;
|
|
560
|
-
gap: 20px;
|
|
561
|
-
margin-top: 16px;
|
|
562
|
-
|
|
563
|
-
& .link {
|
|
564
|
-
font-size: 13px;
|
|
565
|
-
color: ${c.muted};
|
|
566
|
-
font-weight: 600;
|
|
567
|
-
}
|
|
568
|
-
& .link:hover:not(:disabled) {
|
|
569
|
-
color: ${c.text};
|
|
570
|
-
}
|
|
571
|
-
`,Pn=i.aside`
|
|
572
|
-
position: sticky;
|
|
573
|
-
top: 172px;
|
|
574
|
-
display: flex;
|
|
575
|
-
flex-direction: column;
|
|
576
|
-
background: ${c.white};
|
|
577
|
-
box-shadow: 0 1px 3px rgba(22, 21, 24, 0.06);
|
|
578
|
-
border-radius: 16px;
|
|
579
|
-
padding: 16px;
|
|
580
|
-
|
|
581
|
-
${At} {
|
|
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
|
-
`,An=i.h2`
|
|
598
|
-
margin: 0 0 24px;
|
|
599
|
-
padding-bottom: 16px;
|
|
600
|
-
border-bottom: 1px solid ${c.gray4};
|
|
601
|
-
font-size: 24px;
|
|
602
|
-
font-weight: 600;
|
|
603
|
-
color: ${c.text};
|
|
604
|
-
|
|
605
|
-
${I} {
|
|
606
|
-
margin-bottom: 12px;
|
|
607
|
-
padding-bottom: 8px;
|
|
608
|
-
font-size: 16px;
|
|
609
|
-
line-height: 1.6;
|
|
610
|
-
}
|
|
611
|
-
`,zn=i.div`
|
|
612
|
-
display: flex;
|
|
613
|
-
flex-direction: column;
|
|
614
|
-
gap: 12px;
|
|
615
|
-
`,En=i.div`
|
|
616
|
-
display: flex;
|
|
617
|
-
align-items: flex-start;
|
|
618
|
-
justify-content: space-between;
|
|
619
|
-
gap: 12px;
|
|
620
|
-
`,Rn=i.span`
|
|
621
|
-
font-size: 14px;
|
|
622
|
-
font-weight: 600;
|
|
623
|
-
line-height: 1.57;
|
|
624
|
-
color: ${c.muted1};
|
|
625
|
-
`,Bn=i.span`
|
|
626
|
-
display: inline-flex;
|
|
627
|
-
align-items: center;
|
|
628
|
-
gap: 8px;
|
|
629
|
-
font-size: 24px;
|
|
630
|
-
font-weight: 700;
|
|
631
|
-
color: ${c.text};
|
|
632
|
-
`,qn=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: ${c.muted};
|
|
643
|
-
`;const _n=i(Tt)`
|
|
644
|
-
width: 30px;
|
|
645
|
-
height: 30px;
|
|
646
|
-
background: ${c.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: ${Os.buyBtn};
|
|
657
|
-
color: ${c.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(${c.dclRed}, ${c.dclRed});
|
|
672
|
-
}
|
|
673
|
-
&:disabled {
|
|
674
|
-
opacity: 0.6;
|
|
675
|
-
cursor: default;
|
|
676
|
-
}
|
|
677
|
-
`;const Bt=Le`
|
|
678
|
-
margin: 0;
|
|
679
|
-
font-size: 13px;
|
|
680
|
-
`,ve=i.p`
|
|
681
|
-
${Bt};
|
|
682
|
-
`,Fn=i(_s)`
|
|
683
|
-
${Bt};
|
|
684
|
-
`,Wn=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 _e(o){if(Bs(o))return s("errors.rejected");const d=(o.message??"").toLowerCase();return d.includes("insufficient")?s("cart.error.insufficient",{currency:ja.name}):d.includes("no active listing")||d.includes("your own listing")?s("cart.error.listingChanged"):s("marketCheckout.error.generic")}const Ln=12e4;function Kn(o){const d=[];return o.unavailable.length&&d.push(s("cart.drop.unavailable",{count:o.unavailable.length})),o.own.length&&d.push(s("cart.drop.own",{count:o.own.length})),s("cart.drop.removed",{items:d.join(` ${s("cart.drop.and")} `)})}const Fe=o=>o.reduce((d,P)=>d+P.priceCredits*P.quantity,0),we=o=>o.flatMap(d=>Array.from({length:d.quantity},()=>({...d,quantity:1})));function ai(){ca({title:s("nav.cart"),noindex:!0});const o=H(t=>t.items),d=H(t=>t.remove),P=H(t=>t.increment),A=H(t=>t.decrement),F=H(t=>t.clear),J=H(t=>t.restore),X=H(t=>t.setFittingOpen),z=ot(t=>t.items),ne=ot(t=>t.toggle),{session:n,signIn:L}=la(),qt=da(),ue=As().packs.slice(0,zs);M.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const _t=o.some(t=>t.category!=="emote"),{data:ke}=ua({queryKey:["upsell-listings"],queryFn:()=>$a({first:40}),staleTime:6e4}),{data:k}=ha(n),v=pa(),Y=sa(),{state:E}=na(),[Ft,ie]=M.useState(null),[Ke,he]=M.useState(null),[Wt,B]=M.useState(!1),[q,D]=M.useState(null),Ne=M.useRef(0),[p,j]=M.useState(null),{data:pe}=ga(n),{data:re}=ma(!0),[$e,Qe]=M.useState(""),oe=M.useRef(null),Ue=xa(o),Ge=t=>lt(Ue[t.id]),Se=o.filter(Ge),He=o.length>0&&Se.length===0,Lt=Se.reduce((t,a)=>t+a.priceCredits*a.quantity,0),Kt=o.reduce((t,a)=>t+a.quantity,0),Nt=Se.reduce((t,a)=>t+a.quantity,0),Oe=q?q.liveTotalCredits:Lt,Qt=new Set(o.map(t=>t.id)),De=((ke==null?void 0:ke.items)??[]).filter(t=>!Qt.has(t.id)).slice(0,12),Ut=new Map(q==null?void 0:q.buyable.map(t=>[t.item.id,t])),ge=(k==null?void 0:k.credits)??0,Me=Oe*10,Gt=re?ct(Me,re):0n,Te=Re({priceCents:Me,priceManaWei:Gt,balanceCents:(k==null?void 0:k.balanceCents)??0,manaBalanceWei:pe??0n}),Ht=t=>t.flatMap(a=>{const l=qe(a);return l.kind==="store"?[l.mint]:[]}),Ot=t=>t.flatMap(a=>a.acquisition==="trade"?[a.trade]:[]),Dt=va,Vt=t=>Ca(t.contractAddress,String(t.itemId));function me(t){t(),D(null),he(null),ie(null)}function Jt(){j(null),B(!1)}function Ve(t){const a=Fe(t),l=Math.max(0,a-ge),r=ue.find(u=>u.credits>=l)??ue[ue.length-1];Qe(r.id),V("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:a,credits_balance:ge,shortfall:l}),j({phase:"nofunds",lines:t.map(u=>({item:u.item,priceCredits:u.priceCredits,quantity:u.quantity})),shortfall:l}),B(!1)}async function Ie(t){if(!n||t.length===0)return;const a=we(t),l=a.map(g=>({...g.item,priceCredits:g.priceCredits})),r=t.map(g=>({...g.item,priceCredits:g.priceCredits,quantity:g.quantity})),u=[];let m="authorize";const $=new Set,K=new Set,W=new Set,_=[];let w=!1;j({phase:"processing",stage:"reserving",step:1,total:a.length});try{const g=[];for(let x=0;x<a.length;x++){const h=a[x];j({phase:"processing",stage:"reserving",step:x+1,total:a.length});try{const C=h.acquisition==="trade"?h.trade.id:void 0,b=h.item.contractAddress&&h.item.itemId!=null?{contractAddress:h.item.contractAddress,itemId:String(h.item.itemId)}:void 0,{credit:T,maxCreditedValue:U}=await ht(n.identity,h.usdCents,C,b);u.push({salt:T.id,itemId:h.item.id}),g.push(h.acquisition==="store"?{kind:"store",item:{collection:h.item.contractAddress,itemId:String(h.item.itemId),priceWei:h.priceWei},credits:[T],maxCreditedValue:U,chainId:h.item.chainId}:{kind:"trade",trade:h.trade,credits:[T],maxCreditedValue:U})}catch(C){if(qs(C)){if(u.length){try{await Ee(n.identity,u.map(b=>b.salt))}catch(b){ae(b,{flow:"cart_checkout",step:"release"})}v.invalidateQueries({queryKey:["usd-balance"]})}Ve(t);return}throw C}}m="submit";const S=Ss(g).length,N=x=>S>1?{current:x,total:S}:void 0,G=(x,h)=>j({phase:"processing",stage:x,step:a.length,total:a.length,signatures:N(h)}),Q=x=>x<S?G("awaiting-signature",x+1):G("settling",S);G("awaiting-signature",1);let f=[];if(vs())try{const x=new Map;f=await Ts({purchases:g,buyer:n.address,signer:n.signer,onSigned:()=>Q(S),onBroadcast:({txHash:b,salts:T})=>{x.set(b,T),T.forEach(U=>$.add(U))}});const h=await Promise.allSettled(f.map(b=>Is(b)));h.forEach((b,T)=>{const U=x.get(f[T])??[];b.status==="fulfilled"?(U.forEach(ce=>K.add(ce)),_.push(f[T])):b.reason instanceof Ct||U.forEach(ce=>W.add(ce))});const C=h.flatMap(b=>b.status==="rejected"?[b.reason]:[]);if(C.length&&!C.some(b=>b instanceof Ct))throw C[0];w=!0}catch(x){if(!(x instanceof Ps)||!ka(n.providerType))throw x;f=await Be({purchases:g,buyer:n.address,signer:n.signer,onSigned:Q,onBroadcast:({salts:h})=>h.forEach(C=>$.add(C)),onSettled:({txHash:h,salts:C})=>{C.forEach(b=>K.add(b)),_.push(h)},onReverted:({salts:h})=>h.forEach(C=>W.add(C))})}else f=await Be({purchases:g,buyer:n.address,signer:n.signer,onSigned:Q,onBroadcast:({salts:x})=>x.forEach(h=>$.add(h)),onSettled:({txHash:x,salts:h})=>{h.forEach(C=>K.add(C)),_.push(x)},onReverted:({salts:x})=>x.forEach(h=>W.add(h))});t.forEach(x=>d(x.item.id)),D(null),V("Shop Completed Purchase",{...fe(l),payment_type:"credits",no_crypto_step:w,transaction_hash:f[0]??null}),vt(v);const y=oe.current;oe.current=null,j(null),B(!1);const R={items:r,txHash:f[0]??void 0,txHashes:f,settled:!0,...y?{creditsAdded:y}:{}};Y("/success",{state:R,replace:!0})}catch(g){ye(g)||ae(g,{flow:"cart_checkout",step:m,cart_size:t.length});const S=new Set([...$].filter(y=>!W.has(y))),{toRelease:N,boughtItemIds:G}=jt({reservations:u,spent:S,settled:K}),Q=l.filter(y=>G.includes(y.id)),f=l.filter(y=>!G.includes(y.id));if(V(ye(g)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:m,error_code:pt(g),value_usd:dt(f.reduce((y,R)=>y+R.priceCredits,0)),cart_size:a.length,partial:Q.length>0}),N.length)try{await Ee(n.identity,N)}catch(y){ae(y,{flow:"cart_checkout",step:"release"})}if(v.invalidateQueries({queryKey:["usd-balance"]}),Q.length>0){G.forEach(y=>d(y)),D(null),vt(v),V("Shop Completed Purchase",{...fe(Q),payment_type:"credits",no_crypto_step:w,transaction_hash:_[0]??null,partial:!0}),j({phase:"error",message:s("cart.error.partiallyBought")}),B(!1);return}j({phase:"error",message:_e(g)})}}function Je(t,a){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 l=oe.current;oe.current=null,j(null),B(!1);const r={items:t,txHash:a[0]??void 0,txHashes:a,settled:!0,...l?{creditsAdded:l}:{}};Y("/success",{state:r,replace:!0})}function Xe(t,a){ye(t)||ae(t,{flow:a,step:"submit"}),V(ye(t)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:pt(t)}),j({phase:"error",message:_e(t)}),B(!1)}async function Xt(t,a){const l=gt(mt.MANAToken,a),r=gt(mt.CreditsManager,a);await ks({auth:{kind:$s.Allowance,contractAddress:l.address,spenderAddress:r.address,chainId:a},signer:t})}async function Ye(){if(re)return re;try{return await v.fetchQuery({queryKey:["mana-rate",ut.chainId],queryFn:()=>wa(ut.chainId),staleTime:6e4})}catch{return}}async function Yt(t){const a=we(t).reduce((m,$)=>m+$.usdCents,0),r=(pe??0n)>0n?await Ye():re,u=r?ct(a,r):0n;return{totalCents:a,manaWei:u}}async function Ze(t,a){const l=Fe(t),{totalCents:r,manaWei:u}=await Yt(t),m=Re({priceCents:r,priceManaWei:u,balanceCents:(k==null?void 0:k.balanceCents)??0,manaBalanceWei:pe??0n});if(a&&m.options.some($=>$.method===a)){if(a==="credits"){Ie(t);return}await Ae(et(a,t),()=>a==="mana"?void tt(t):void at(t,r,u));return}if(m.options.some($=>$.method==="mana"||$.method==="combined")){j({phase:"choose",lines:t,totalCents:r,manaWei:u}),B(!1);return}if(k!=null&&k.credits<l){Ve(t);return}Ie(t)}function Zt(t){return Re({priceCents:t.totalCents,priceManaWei:t.manaWei,balanceCents:(k==null?void 0:k.balanceCents)??0,manaBalanceWei:pe??0n})}const[Pe,xe]=M.useState(null);function et(t,a){const l=new Map;for(const r of a){const u=ms(t,qe(r));l.set(`${u.chainId}:${u.spender.toLowerCase()}`,u)}return[...l.values()]}async function Ae(t,a){const[l,...r]=t;if(!l){a();return}await ea(l.spender,l.chainId,()=>void Ae(r,a))}async function ea(t,a,l){const r=ws(a,t),u=n?await Cs(r,n.address).catch(()=>!0):!0;if(js(n==null?void 0:n.providerType,u)){B(!1),xe({auth:r,run:l});return}l()}function ta(t){if((p==null?void 0:p.phase)!=="choose")return;const{lines:a,totalCents:l,manaWei:r}=p;if(t==="credits"){Ie(a);return}Ae(et(t,a),()=>t==="mana"?void tt(a):void at(a,l,r))}async function tt(t){if(!n||t.length===0)return;const a=we(t),l=a.map(m=>({...m.item,priceCredits:m.priceCredits})),r=t.map(m=>({...m.item,priceCredits:m.priceCredits,quantity:m.quantity})),u=()=>j({phase:"processing",stage:"settling",step:a.length,total:a.length});j({phase:"processing",stage:"awaiting-signature",step:a.length,total:a.length});try{const m=await xs({trades:Ot(a),mints:Ht(a),buyer:n.address,signer:n.signer,onSigned:u});t.forEach($=>d($.item.id)),D(null),V("Shop Completed Purchase",{...fe(l),payment_type:"mana",transaction_hash:m[0]??null}),v.invalidateQueries({queryKey:["mana-balance"]}),Je(r,m)}catch(m){Xe(m,"buy_cart_mana")}}async function at(t,a,l){if(!n||t.length===0)return;const r=we(t),u=r.map(w=>({...w.item,priceCredits:w.priceCredits})),m=t.map(w=>({...w.item,priceCredits:w.priceCredits,quantity:w.quantity})),$=fs(r.map(w=>w.usdCents),(k==null?void 0:k.balanceCents)??0),K=[],W=new Set,_=new Set;j({phase:"processing",stage:"reserving",step:1,total:r.length});try{const w=r.map(qe),g=[],S=new Map,N=new Map;for(let f=0;f<r.length;f++){const y=r[f],R=w[f],x=$[f],h=ys(Math.max(0,y.usdCents-x),a,l);let C;if(x<=0)C=wt(R,[],"0");else{j({phase:"processing",stage:"reserving",step:f+1,total:r.length});const T=y.item,{credit:U,maxCreditedValue:ce}=await ht(n.identity,x,R.kind==="trade"?R.trade.id:void 0,T.contractAddress&&T.itemId!=null?{contractAddress:T.contractAddress,itemId:String(T.itemId)}:void 0);K.push({salt:U.id,itemId:T.id}),C=wt(R,[U],ce)}const b=Ms(C);S.set(b,(S.get(b)??0n)+h),N.has(b)||N.set(b,g.length),g.push(C)}for(const[f,y]of S){const R=N.get(f);R==null||y<=0n||(g[R]={...g[R],maxCreditedValue:(BigInt(g[R].maxCreditedValue)+y).toString()})}await Xt(n.signer,bs(w[0]));const G=()=>j({phase:"processing",stage:"settling",step:r.length,total:r.length});j({phase:"processing",stage:"awaiting-signature",step:r.length,total:r.length});const Q=await Be({purchases:g,buyer:n.address,signer:n.signer,onSigned:G,onBroadcast:({salts:f})=>f.forEach(y=>W.add(y)),onReverted:({salts:f})=>f.forEach(y=>_.add(y))});t.forEach(f=>d(f.item.id)),D(null),V("Shop Completed Purchase",{...fe(u),payment_type:"credits_and_mana",transaction_hash:Q[0]??null}),v.invalidateQueries({queryKey:["mana-balance"]}),Je(m,Q)}catch(w){const{toRelease:g}=jt({reservations:K,spent:new Set([...W].filter(S=>!_.has(S))),settled:new Set});g.length&&Ee(n.identity,g).catch(()=>{}),K.length&&v.invalidateQueries({queryKey:["usd-balance"]}),Xe(w,"buy_cart_combined")}}async function Z(t){if(!n){bt({type:"cart-checkout"}),L();return}const a=H.getState().items.filter(Ge);if(a.length===0)return;ie(null),he(null),B(!0);const l=a.reduce((r,u)=>r+u.priceCredits*u.quantity,0);V("Shop Started Checkout",{cart_size:a.length,cart_value_credits:l,cart_value_usd:dt(l),has_sufficient_credits:ge>=l});try{const r=await Es(a,n.address,Dt,await Ye(),Vt),u=[...r.unavailable,...r.own];if(u.length&&(u.forEach(m=>d(m.id)),he(Kn(r))),r.buyable.length===0){ie(s("cart.error.noneAvailable")),D(null);return}if(r.orderChanged){D(r),Ne.current=Date.now();return}await Ze(r.buyable,t)}catch(r){ae(r,{flow:"cart_checkout",step:"review",cart_size:a.length}),ie(_e(r))}finally{B(!1)}}async function st(){if(q){if(!n){bt({type:"cart-checkout"}),L();return}if(Date.now()-Ne.current>Ln){D(null),he(null),await Z();return}ie(null),Ze(q.buyable)}}async function aa(){if($e){try{sessionStorage.setItem(be,JSON.stringify(H.getState().items))}catch{}B(!0);try{const t=await Rs($e,n?{address:n.address,identity:n.identity}:void 0);if(t.url){window.location.href=t.url;return}Y("/credits")}catch(t){try{sessionStorage.removeItem(be)}catch{}ae(t,{flow:"cart_buy_credits"}),j({phase:"error",message:s("buyModal.error.creditsCheckout")})}finally{B(!1)}}}const nt=M.useRef(!1);M.useEffect(()=>{if(!n||nt.current||!us("cart-checkout"))return;nt.current=!0;const t=setTimeout(()=>void Z(),0);return()=>clearTimeout(t)},[n]);const it=M.useRef(!1);M.useEffect(()=>{if(!(E!=null&&E.resumeCheckout)||it.current)return;it.current=!0,oe.current=E.creditsAdded??null;try{const a=sessionStorage.getItem(be);if(a){sessionStorage.removeItem(be);const l=JSON.parse(a);Array.isArray(l)&&l.length&&J(l)}}catch{}v.invalidateQueries({queryKey:["usd-balance"]});const t=setTimeout(()=>void Z(),0);return()=>clearTimeout(t)},[E==null?void 0:E.resumeCheckout]);const rt=M.useRef(!1);M.useEffect(()=>{if(!(E!=null&&E.startCheckout)||rt.current)return;rt.current=!0,Y(".",{replace:!0,state:null});const t=setTimeout(()=>void Z(),0);return()=>clearTimeout(t)},[E==null?void 0:E.startCheckout]);const ee=Wt||(p==null?void 0:p.phase)==="processing";return o.length===0&&!p?e.jsx(kt,{children:e.jsxs(St,{children:[e.jsxs($t,{onClick:()=>Y(-1),type:"button",children:[e.jsx(O,{name:"arrow-left"}),s("nav.cart")]}),e.jsxs(Xs,{"data-testid":"cart-empty",children:[e.jsx(O,{name:"cart-plus",size:110}),e.jsxs(Ys,{children:[e.jsx(Zs,{children:s("cart.empty.title")}),e.jsx(en,{children:s("cart.empty.body")})]}),e.jsx(tn,{to:"/items",children:s("cart.empty.cta")})]})]})}):e.jsxs(kt,{children:[e.jsxs(St,{children:[e.jsxs($t,{onClick:()=>Y(-1),type:"button",children:[e.jsx(O,{name:"arrow-left"}),s("nav.cart")]}),e.jsxs(Ds,{children:[e.jsxs(Vs,{children:[e.jsxs(Js,{children:[e.jsx(an,{onClick:()=>Y(-1),type:"button","aria-label":s("cart.goBack"),children:e.jsx(O,{name:"arrow-left"})}),e.jsx(sn,{children:s("cart.panelTitle",{count:Kt})}),_t?e.jsxs(nn,{onClick:()=>X(!0),disabled:ee,children:[e.jsx(O,{name:"fitting-room"}),s("cart.fittingRoom")]}):null]}),e.jsxs(zt,{children:[e.jsx(rn,{children:o.map(t=>{const a=Ut.get(t.id),l=a?a.priceCredits:t.priceCredits,r=!!a&&a.priceCredits!==t.priceCredits,u=!t.tokenId,m=t.quantity,$=typeof t.available=="number"&&m>=t.available,K=l*m,W=fa(t),_=!!W&&!!z[W],w=ya(t),g=Ue[t.id],S=!lt(g),N=g==="sold-out"?s("cart.availability.soldOut"):s("cart.availability.unavailable");return e.jsxs(on,{"data-unavailable":S||void 0,children:[e.jsxs(cn,{"data-thumb":!0,children:[w?e.jsx(ln,{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(dn,{"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(un,{children:[e.jsxs(hn,{"data-desc":!0,children:[w?e.jsx(gn,{to:w,state:{item:t,tradeId:t.tradeId},title:t.name,children:t.name}):e.jsx(pn,{title:t.name,children:t.name}),t.creator?e.jsx(mn,{address:t.creator,linkToProfile:!0}):null,qt&&u?e.jsxs($n,{"data-testid":"cart-creator-tag",children:[e.jsx(Sn,{name:"buy-from-creator"}),s("cart.creatorTag")]}):null]}),e.jsx(xn,{children:S?e.jsxs(jn,{children:[e.jsx(kn,{name:"warning-fill",size:24}),N]}):e.jsxs(e.Fragment,{children:[u?e.jsxs(fn,{children:[e.jsx(Mt,{onClick:()=>me(()=>A(t.id)),disabled:ee||m<=1,"aria-label":s("cart.decreaseQuantity",{name:t.name}),children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:e.jsx("path",{d:"M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),e.jsx(yn,{children:m}),e.jsx(Mt,{onClick:()=>me(()=>P(t.id)),disabled:ee||$,"aria-label":s("cart.increaseQuantity"),children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:e.jsx("path",{d:"M8 3.5v9M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}):null,e.jsxs(bn,{children:[e.jsx(vn,{})," ",K,r?e.jsx(wn,{children:t.priceCredits*m}):null]})]})})]}),e.jsxs(Cn,{children:[W?e.jsx(Mn,{"data-on":_||void 0,onClick:()=>ne(t),"aria-label":_?s("cart.removeFromFavorites",{name:t.name}):s("cart.addToFavorites",{name:t.name}),title:_?s("assetCard.removeFromFavorites"):s("assetCard.addToFavorites"),children:e.jsx(O,{name:_?"heart-solid":"heart"})}):null,e.jsx(Tn,{onClick:()=>me(()=>d(t.id)),disabled:ee,"aria-label":s("cart.remove",{name:t.name}),title:s("cart.removeTitle"),children:e.jsx(O,{name:"trash",size:24})})]})]},t.id)})}),e.jsx(In,{children:e.jsx("button",{className:"link",onClick:()=>me(F),disabled:ee,children:s("cart.clearCart")})})]})]}),e.jsxs(Pn,{children:[e.jsx(An,{children:s("cart.purchaseSummary")}),e.jsxs(zn,{children:[e.jsxs(En,{children:[e.jsx(Rn,{children:s("cart.totalItems",{count:Nt})}),e.jsx(qn,{children:e.jsxs(Bn,{children:[e.jsx(_n,{})," ",Oe]})})]}),e.jsx(It,{options:Te.options,totalCents:Me,shortfall:Te.manaShortfall,showCreditsAmount:!1,creditsLabel:q?s("marketCheckout.confirmPurchase"):Te.options.length>1?s("cart.buyWithCredits"):s("cart.checkout"),busy:ee||He,onPay:t=>void(q?st():Z(t)),creditsFallback:{label:ee?s("cart.working"):q?s("marketCheckout.confirmPurchase"):s("cart.checkout"),onClick:()=>void(q?st():Z())}}),He?e.jsx(ve,{className:"muted",children:s("cart.allUnavailable")}):null,n?null:e.jsx(ve,{className:"muted",children:s("cart.signInHint")}),q?e.jsx(ve,{className:"muted",children:s("cart.priceChanged")}):null,Ke?e.jsx(ve,{className:"muted",children:Ke}):null,e.jsx(Fn,{message:Ft})]})]})]})]}),De.length>0?e.jsx(Wn,{children:e.jsx(hs,{title:s("cart.youMightAlsoLike"),items:De})}):null,Pe&&n?e.jsx(ps,{auth:Pe.auth,signer:n.signer,title:s("authorizeStep.manaTitle"),name:s("authorizeStep.manaName"),reason:s("authorizeStep.manaReason"),icon:e.jsx("img",{src:gs,width:24,height:24,alt:"","aria-hidden":!0}),onAuthorized:()=>{const{run:t}=Pe;xe(null),t()},onCancel:()=>xe(null),onClose:()=>xe(null)}):null,p?e.jsx(Us,{phase:p.phase,balanceCredits:ge,onClose:Jt,stage:p.phase==="processing"?p.stage:void 0,step:p.phase==="processing"?p.step:void 0,total:p.phase==="processing"?p.total:void 0,isSelfCustody:ba(n==null?void 0:n.providerType),signatures:p.phase==="processing"?p.signatures:void 0,options:p.phase==="choose"?Zt(p).options:void 0,onPay:ta,totalCents:p.phase==="choose"?p.totalCents:void 0,totalManaWei:p.phase==="choose"?p.manaWei:void 0,totalCredits:p.phase==="choose"?Fe(p.lines):void 0,lines:p.phase==="nofunds"?p.lines:void 0,shortfallCredits:p.phase==="nofunds"?p.shortfall:void 0,packs:ue,selectedPack:$e,onSelectPack:Qe,onBuyPacks:()=>void aa(),message:p.phase==="error"?p.message:void 0,onRetry:()=>void Z()}):null]})}export{ai as Cart};
|