@dcl/shop 0.7.3-31002809274.commit-68e2004 → 0.7.3-31004669641.commit-bf2b4b9
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-BY9v5uGI.js +381 -0
- package/_assets/{AnimatedBackground-BPNjZnHs.js → AnimatedBackground-d_qXXLZ1.js} +2 -2
- package/_assets/{Assets-B9gu6JnA.js → Assets-BZE6MNTH.js} +11 -11
- package/_assets/{Assets.styles-DiCnesUC.js → Assets.styles-CnXHifI7.js} +2 -2
- package/_assets/{Authorizations-BQzDrrA_.js → Authorizations-DWPIfXPK.js} +4 -4
- package/_assets/Cart-eLOXdOz1.js +695 -0
- package/_assets/{CircularProgress-CQb8cfhx.js → CircularProgress-DTjTksS3.js} +3 -3
- package/_assets/{Collection-DvApaJVE.js → Collection-CIFeZjf3.js} +2 -2
- package/_assets/{CollectionCarousel-3Ff7fmHM.js → CollectionCarousel-DQNzqOkv.js} +55 -55
- package/_assets/{ContentClient-Bv-dXg1a.js → ContentClient-CRr9ZuRH.js} +1 -1
- package/_assets/{Creator-phXYNMmi.js → Creator-CrPYV324.js} +26 -26
- package/_assets/{DeploymentBuilder-DbR23a3M.js → DeploymentBuilder-DYNbIRzZ.js} +1 -1
- package/_assets/{ErrorNotice-Biw7jacR.js → ErrorNotice--UMHyZQ4.js} +1 -1
- package/_assets/{ExchangeController-j0EaU5ur.js → ExchangeController-Cw3I4QaN.js} +1 -1
- package/_assets/{Faq-CYehw8Xd.js → Faq-Bp-D4IrP.js} +2 -2
- package/_assets/{GetCredits-B5t5SiEY.js → GetCredits-CP5H3xk1.js} +4 -4
- package/_assets/{Grow-BbO3nPWz.js → Grow-CJ1PmyMj.js} +1 -1
- package/_assets/{HelpersUtil-Bm2I2riv.js → HelpersUtil-SHIQGznF.js} +1 -1
- package/_assets/ItemDetail-JScjMgo5.js +3516 -0
- package/_assets/LazyEmoteControls-D0uKVSFP.js +2 -0
- package/_assets/{LoadMore-DMhOO7Nq.js → LoadMore-CYbQF7Q0.js} +2 -2
- package/_assets/ManaPricingBanner.styles-7PjhHSIi.js +74 -0
- package/_assets/{MyAssets-pppiT6fl.js → MyAssets-BtVKb2bo.js} +2 -2
- package/_assets/{MyFavorites-B8NF0NVk.js → MyFavorites-BjdScB7R.js} +1 -1
- package/_assets/{NotFound-ySn_lkJ7.js → NotFound-DJy-difK.js} +4 -4
- package/_assets/{NotificationsBell-Mz-RqcfB.js → NotificationsBell-CYkkKwLS.js} +1 -1
- package/_assets/{OutfitDetail-dru3bX0e.js → OutfitDetail-Bd_MlsAu.js} +4 -4
- package/_assets/{OutfitPreview-RhS9kvYc.js → OutfitPreview-Bog0LK-T.js} +2 -2
- package/_assets/{OutfitStudio-B-MkV2Nw.js → OutfitStudio-GawF1FlF.js} +10 -10
- package/_assets/{StoreSettings-DMlPpaxq.js → StoreSettings-BuuzjCNb.js} +1 -1
- package/_assets/{Success-DGiWm-dB.js → Success-B6PVyVMT.js} +7 -7
- package/_assets/{SwapController-DC-RT5b2.js → SwapController-vRfOqnfY.js} +1 -1
- package/_assets/{Tooltip-DIS1AoSo.js → Tooltip-z-K5_r2G.js} +1 -1
- package/_assets/{TradeService-CW14jFoK.js → TradeService-DXen8uyN.js} +1 -1
- package/_assets/{W3MFrameProviderSingleton-Bn14TsAB.js → W3MFrameProviderSingleton-D0DuVK1Q.js} +3 -3
- package/_assets/{WebCryptoP256-DN6bPKJH.js → WebCryptoP256-oxgpEQ_A.js} +1 -1
- package/_assets/authorizations-jqQwcb6e.js +1 -0
- package/_assets/{basic-Db4hGFC-.js → basic-8OT967no.js} +1 -1
- package/_assets/{biconomy-yx9AAdUi.js → biconomy-C_1YJrQx.js} +1 -1
- package/_assets/{builder-Db8kqGSp.js → builder-DWtVDpBN.js} +1 -1
- package/_assets/buy-BQaJKCDU.js +1 -0
- package/_assets/buy-gasless-CZ9IMCzy.js +1 -0
- package/_assets/{categories-BMCKe30t.js → categories-gEEglioA.js} +32 -38
- package/_assets/{ccip-DSJk995u.js → ccip-SKapXXwI.js} +1 -1
- package/_assets/{ccip-kyphTkC8.js → ccip-y4ibU2Cv.js} +1 -1
- package/_assets/{collectionPage.styles-Dmgr28GG.js → collectionPage.styles-BYaw_6eJ.js} +7 -7
- package/_assets/{controller-BxSHfLz5.js → controller-DiG2j0Bj.js} +2 -2
- package/_assets/{core-FJbXZcd9.js → core-DVkS31SH.js} +4 -4
- package/_assets/{createSvgIcon-BVj0atRc.js → createSvgIcon-BUYy_aBs.js} +1 -1
- package/_assets/{custom-8lpWNVH1.js → custom-z_Yw6ggL.js} +1 -1
- package/_assets/{data-capture-ZsoqccWO.js → data-capture-DjCvuOfO.js} +1 -1
- package/_assets/{dcl-schemas-Dr9BTjb7.js → dcl-schemas-CmtP3U6y.js} +1 -1
- package/_assets/{disposePreview-8oEf57G7.js → disposePreview-B96DpOZy.js} +1 -1
- package/_assets/{email-TmqKH5rK.js → email-BaVWsYiK.js} +1 -1
- package/_assets/{embedded-wallet-D8AjSmuZ.js → embedded-wallet-C6OnTlQL.js} +1 -1
- package/_assets/{emotion-styled.browser.esm-B1CecDgm.js → emotion-styled.browser.esm-EAs3eW_Y.js} +1 -1
- package/_assets/{engine-CTKRqGmj.js → engine-CTTcDaNZ.js} +1 -1
- package/_assets/errors-DEg1qT4Y.js +1 -0
- package/_assets/{estimate-l1-fee-DpS-XaOF.js → estimate-l1-fee-AmLKK3kz.js} +1 -1
- package/_assets/{ethers-CtNGBird.js → ethers-DejfrZ8i.js} +1 -1
- package/_assets/{execute-Bz7pyjbp.js → execute-CG71Q0V6.js} +2 -2
- package/_assets/{features-W9H6sjcF.js → features-PXGl3AnM.js} +1 -1
- package/_assets/{fetchTokenMetadata-COd7SGVt.js → fetchTokenMetadata-CwMSW9Tj.js} +2 -2
- package/_assets/{field.styles-CdYHVXFs.js → field.styles-i8y02t11.js} +1 -1
- package/_assets/{get-ecosystem-wallet-info-CMuxAyIB.js → get-ecosystem-wallet-info-DtXl85OB.js} +1 -1
- package/_assets/{getBalance-DQubrLKJ.js → getBalance-CiuYRk08.js} +1 -1
- package/_assets/{getNFT-BNY2enZa.js → getNFT-BuPS2uUr.js} +1 -1
- package/_assets/{getNFT-CSRtW3h-.js → getNFT-CqiHMUz2.js} +1 -1
- package/_assets/{grid.styles-DH_ZretM.js → grid.styles-DEbulSnv.js} +1 -1
- package/_assets/{hashTypedData-Dqqcre1R.js → hashTypedData-BLt2Myt1.js} +1 -1
- package/_assets/{hashTypedData-BA0RWbmG.js → hashTypedData-DFL6TdkK.js} +1 -1
- package/_assets/{in-app-BvYCjHKb.js → in-app-sxEWWI71.js} +1 -1
- package/_assets/{in-app-wallet-calls-CxpZt-vc.js → in-app-wallet-calls-C5cCPgXV.js} +1 -1
- package/_assets/{index-BpsXe6IR.js → index-5ckQJdvo.js} +1 -1
- package/_assets/{index-C-IYvYAw.js → index-67nX322c.js} +1 -1
- package/_assets/{index-B91rfq1c.js → index-78Cn6c_7.js} +1 -1
- package/_assets/{index-Lb7odxFK.js → index-B1dodBTd.js} +1 -1
- package/_assets/{index-BDuns4Lg.js → index-B3D9_3qT.js} +1 -1
- package/_assets/{index-CuJbAAma.js → index-B7ZIe8-o.js} +1 -1
- package/_assets/index-BIZt_Cii.js +1 -0
- package/_assets/{index-CNepofQh.js → index-B_JiruyT.js} +1 -1
- package/_assets/{index-Bqt5iJBo.js → index-Bc0XpRAE.js} +1 -1
- package/_assets/{index-kUOBQ2KK.js → index-BkMwrTJ3.js} +1 -1
- package/_assets/{index-Cfy91mWw.js → index-BvRxx-Op.js} +1 -1
- package/_assets/{index-CNDHrB-N.js → index-C1zDjUql.js} +1 -1
- package/_assets/{index-qsorFlMF.js → index-C33PRPh0.js} +1 -1
- package/_assets/{index-BGOWhyHo.js → index-C3OG0-Rm.js} +3 -3
- package/_assets/{index-BiAcVSuI.js → index-C4dNaJNB.js} +1 -1
- package/_assets/{index-jjnXqv_1.js → index-C5KfCPRU.js} +1 -1
- package/_assets/{index-BjtZr1Rk.js → index-C7bppXGo.js} +1 -1
- package/_assets/{index-CkZ39O4D.js → index-C8xUshki.js} +1 -1
- package/_assets/{index-vZmAzias.js → index-CHcpd_Ml.js} +1 -1
- package/_assets/{index-C0jkYp6u.js → index-CIehX5LY.js} +1 -1
- package/_assets/{index-DtS2WMUT.js → index-CLEBFSaY.js} +1 -1
- package/_assets/{index-BmtMCuH8.js → index-CQ-nzCsh.js} +1 -1
- package/_assets/{index-Cj_FIJ6O.js → index-CW7T-svS.js} +1 -1
- package/_assets/{index-o5wXH6k1.js → index-CYXSUQre.js} +1 -1
- package/_assets/{index-DDe_P04W.js → index-CaVKZu6I.js} +1 -1
- package/_assets/index-CeopVToX.js +3504 -0
- package/_assets/{index-DsSWYz9j.js → index-ClN4jZIk.js} +1 -1
- package/_assets/{index-Wj_hpWlf.js → index-CoFiKLCF.js} +1 -1
- package/_assets/{index-Vcg4k-hF.js → index-CoPWTFH8.js} +1 -1
- package/_assets/{index-DIYqluqo.js → index-CtmC7UzU.js} +3 -3
- package/_assets/{index-CjpWKs8Q.js → index-Cv1Bu0gQ.js} +1 -1
- package/_assets/index-CvmGmJY_.js +2 -0
- package/_assets/{index-DOPim6Hs.js → index-D3pGB9SZ.js} +1 -1
- package/_assets/{index-BsEcuD0O.js → index-D93EJWs2.js} +2 -2
- package/_assets/{index-DhygeoM5.js → index-DHQ2fPeu.js} +3 -3
- package/_assets/{index-Ch2NaYC8.js → index-DN_dErJN.js} +1 -1
- package/_assets/{index-CRKbJ2OP.js → index-DQ6Egb9a.js} +1 -1
- package/_assets/{index-BJNlk-SI.js → index-DQJrunBx.js} +1 -1
- package/_assets/{index-Bl9hxKO2.js → index-DRX1VYfQ.js} +1 -1
- package/_assets/{index-Cr_vaK1b.js → index-DdKN54Dm.js} +1 -1
- package/_assets/{index-l92NuJVf.js → index-Dfv984cL.js} +1 -1
- package/_assets/{index-DBwuf2dy.js → index-Dqs83TPk.js} +1 -1
- package/_assets/{index-DLrjz4Tx.js → index-DsTxG252.js} +1 -1
- package/_assets/{index-WguW8tuP.js → index-DurGhmUt.js} +1 -1
- package/_assets/{index-CtwVaZjN.js → index-DvlueLuH.js} +1 -1
- package/_assets/{index-BfAg05xe.js → index-FAGRZO5x.js} +1 -1
- package/_assets/{index-CN8Fwkg_.js → index-FjcfjJmU.js} +2 -2
- package/_assets/{index-DG6oakSS.js → index-G6kG-9qx.js} +1 -1
- package/_assets/{index-DFAt726n.js → index-JjDJFXBe.js} +1 -1
- package/_assets/{index-DFCfS17C.js → index-K5Fr8OrY.js} +1 -1
- package/_assets/{index-DYoWqsAK.js → index-SVsxH_b4.js} +1 -1
- package/_assets/{index-DBGfpyip.js → index-dFGs7ucu.js} +1 -1
- package/_assets/{index-CefOdSuo.js → index-kQ-ETH4W.js} +1 -1
- package/_assets/{index-CxlN6NCL.js → index-miZ-bpMn.js} +7 -7
- package/_assets/{index-BogeqjBp.js → index-tAv2AuqO.js} +1 -1
- package/_assets/{index-DZOsxVd8.js → index-v6z9lSk-.js} +1 -1
- package/_assets/{index-CTvMZ0av.js → index-vW-YvhXV.js} +1 -1
- package/_assets/{index-Bw6vREOp.js → index-yniyfO-A.js} +2 -2
- package/_assets/{index.es-Db0bppXh.js → index.es-B_R9O1eE.js} +4 -4
- package/_assets/{index.es-DRPff5jo.js → index.es-CnlQU9TO.js} +1 -1
- package/_assets/{index.es-vm3av0ZU.js → index.es-nH3kt9zb.js} +1 -1
- package/_assets/{localBatchGatewayRequest-BT4bgYX3.js → localBatchGatewayRequest-CRA7Ohwq.js} +1 -1
- package/_assets/{networks-BjCyq87b.js → networks-BPbRQuXJ.js} +1 -1
- package/_assets/{onramp-MxLeUwo5.js → onramp-DAURmNvI.js} +1 -1
- package/_assets/{openzeppelin-NiqHvD0o.js → openzeppelin-RAIrBNFG.js} +1 -1
- package/_assets/{parseNft-DXKUZt78.js → parseNft-C8cGcKny.js} +2 -2
- package/_assets/{parseSignature-CHSFJk_c.js → parseSignature-Cosz4bIV.js} +1 -1
- package/_assets/{parseSignature-JjWPQjiQ.js → parseSignature-DI4-gGRK.js} +3 -3
- package/_assets/{passkeys-Dp5NPgWw.js → passkeys-Dx5zNag-.js} +1 -1
- package/_assets/{pay-with-exchange-CxuzzGwq.js → pay-with-exchange-DL_Cj2vD.js} +1 -1
- package/_assets/{qr-overlay-C29AmkL1.js → qr-overlay-D-IY5b74.js} +1 -1
- package/_assets/{receive-BSxHY6Lk.js → receive-BK0cXamC.js} +1 -1
- package/_assets/{resolveImplementation-DBwFo6J8.js → resolveImplementation-DtBE8M6b.js} +1 -1
- package/_assets/{rpc-B7hkwqRp.js → rpc-DvdjRONR.js} +1 -1
- package/_assets/{secp256k1-80kUQxfu.js → secp256k1-BGblV5cK.js} +1 -1
- package/_assets/{secp256k1-dBN4ORWU.js → secp256k1-DqooDfDM.js} +1 -1
- package/_assets/{secp256k1-BmlNWGtD.js → secp256k1-Jn3F0n__.js} +1 -1
- package/_assets/{send-C63T079L.js → send-DsSxPyoB.js} +1 -1
- package/_assets/{send-batch-transaction-BkwLmlea.js → send-batch-transaction-CjeCT7XS.js} +1 -1
- package/_assets/{send-eip712-transaction-6nm-uQAt.js → send-eip712-transaction-CTme_bPY.js} +2 -2
- package/_assets/{send-gasless-transaction-ASekpRez.js → send-gasless-transaction-Bb4bNRR9.js} +2 -2
- package/_assets/{send-transaction-Bzhp2g8b.js → send-transaction-pABhtz56.js} +2 -2
- package/_assets/{sendMetaTransaction-BATUzHIf.js → sendMetaTransaction-H67kFub1.js} +1 -1
- package/_assets/{sendRawTransaction-_Kv849f3.js → sendRawTransaction-B79pWyP7.js} +3 -3
- package/_assets/{serializeTransaction-ZzhlS1TB.js → serializeTransaction-48HG-PU6.js} +1 -1
- package/_assets/{session-proposal-DzR3pRyS.js → session-proposal-BcsaTK8S.js} +1 -1
- package/_assets/{session-request-VXo9pQwV.js → session-request-CeeAG1yH.js} +2 -2
- package/_assets/{signing-CGrYz3PN.js → signing-BKuWdGYf.js} +3 -3
- package/_assets/{socials-B-JrWB2l.js → socials-D_UOJlsU.js} +1 -1
- package/_assets/{styled-gTPQAN-Y.js → styled-BiSZljCY.js} +2 -2
- package/_assets/{swaps-CyAk4mTe.js → swaps-Czr01d7W.js} +1 -1
- package/_assets/{thirdweb-8szcRqMp.js → thirdweb-vG4lgpUb.js} +3 -3
- package/_assets/{to-serializable-transaction-CF8YxIRs.js → to-serializable-transaction-wl_9nUoT.js} +2 -2
- package/_assets/{transactionReceipt-CGVPV54W.js → transactionReceipt-CcSJiG0c.js} +1 -1
- package/_assets/{transactions-BIRi6SwZ.js → transactions-Ddia0n7n.js} +1 -1
- package/_assets/{useCreditPacks-B-X7zfCn.js → useCreditPacks-MqR7c3SM.js} +1 -1
- package/_assets/useImportable-NxQmNfsn.js +1 -0
- package/_assets/{useInfiniteGrid-6IGMMT5_.js → useInfiniteGrid-Kcee13Mj.js} +1 -1
- package/_assets/{useTheme-BwoD3vEY.js → useTheme-B7WRHLy8.js} +1 -1
- package/_assets/{verifyHash-C5CdkBh3.js → verifyHash-DyarspWE.js} +1 -1
- package/_assets/{w3m-modal-B3GHykWz.js → w3m-modal-DF93OTvH.js} +1 -1
- package/_assets/{w3m-modal-B3F6Mnna.js → w3m-modal-DKYntPky.js} +1 -1
- package/_assets/{wait-for-tx-receipt-C_FjDUYj.js → wait-for-tx-receipt-DR-RY-a_.js} +1 -1
- package/_assets/{wallets-DzQ1vri5.js → wallets-C9IItlAk.js} +5 -5
- package/_assets/{web-connector-B4iFaMmt.js → web-connector-BuJ7c2wG.js} +3 -3
- package/_assets/{writeContract-DaZaDo8I.js → writeContract-Buu3J9V_.js} +1 -1
- package/_assets/{zoraTestnet-W4T_ajaY.js → zoraTestnet-jeCAG28W.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/_assets/Activity-DRU10G0s.js +0 -381
- package/_assets/Cart-BHkq2PkV.js +0 -695
- package/_assets/ItemDetail-D-C6pe19.js +0 -3497
- package/_assets/LazyEmoteControls-BxXOD9g-.js +0 -2
- package/_assets/ManaPricingBanner.styles-D0ksfubq.js +0 -74
- package/_assets/authorizations-BJlchz9P.js +0 -1
- package/_assets/buy-DHqPe2Je.js +0 -1
- package/_assets/buy-gasless-CvTXQoUY.js +0 -1
- package/_assets/errors-CCUK8cBW.js +0 -1
- package/_assets/index-4grC8vnQ.js +0 -3386
- package/_assets/index-DAPvhTCu.js +0 -1
- package/_assets/index-DBkJBt2j.js +0 -2
- package/_assets/trade-encoding-dpFoczNW.js +0 -1
- package/_assets/useImportable-C11MUaBr.js +0 -1
package/_assets/Cart-BHkq2PkV.js
DELETED
|
@@ -1,695 +0,0 @@
|
|
|
1
|
-
import{j as e,L as $e,r as P,d as ta,b as aa}from"./react-DehiWSvs.js";import{t as ue,s as i,d as a,az as le,b5 as sa,ay as na,I as H,w as Mt,af as Ue,q as ia,Q as N,ah as dt,k as ra,l as oa,n as ca,b6 as da,x as la,b7 as ua,ai as ha,b8 as pa,b9 as lt,ba as ga,bb as xa,v as ma,bc as ut,S as G,bd as ht,be as fa,A as ae,r as ya,c as pt,bf as ba,e as va,bg as gt,bh as _e,bi as ye,bj as be,bk as xt,g as ve,a as wa,C as We,bl as Ca}from"./index-4grC8vnQ.js";import{M as ja,S as ka,C as Sa,H as $a,a as Ma,T as Ta,X as Ia,b as Pa,B as za,c as Aa,d as mt,e as Ea,f as ke,P as Tt,m as qa,g as Ba,h as Ra,i as _a,j as It,k as Se,L as Wa,l as Fa,n as ft,o as yt,W as La,p as Ka,q as Qa,A as Ua,r as Na,s as Ha,t as Oa,u as Va,v as Ga,w as Da,x as Ya,y as Ja,z as Xa,D as Za,E as es,F as ts,G as as,I as ss,J as ns,K as Fe,N as is,O as rs,Q as os,R as cs,U as bt,V as vt,Y as ds,Z as ls,_ as us}from"./CollectionCarousel-3Ff7fmHM.js";import{j as hs,k as ps,a as gs,n as xs,i as ms,A as fs}from"./authorizations-BJlchz9P.js";import{g as ys,b as Le}from"./buy-DHqPe2Je.js";import{b as bs,w as vs,S as wt,G as ws}from"./buy-gasless-CvTXQoUY.js";import{u as Cs,M as js,R as we,r as ks,c as Ss,p as Ct}from"./useCreditPacks-B-X7zfCn.js";import{i as $s,a as Ms}from"./errors-CCUK8cBW.js";import{E as Ts}from"./ErrorNotice-Biw7jacR.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./trade-encoding-dpFoczNW.js";import"./sendMetaTransaction-BATUzHIf.js";const{colors:se,radius:Is}=ue,Ps=i.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
align-items: center;
|
|
4
|
-
justify-content: center;
|
|
5
|
-
gap: 8px;
|
|
6
|
-
width: 100%;
|
|
7
|
-
`,zs=i.span`
|
|
8
|
-
font-size: 16px;
|
|
9
|
-
line-height: 22px;
|
|
10
|
-
color: ${se.text2};
|
|
11
|
-
text-transform: capitalize;
|
|
12
|
-
white-space: nowrap;
|
|
13
|
-
`,As=i.div`
|
|
14
|
-
display: flex;
|
|
15
|
-
flex-direction: column;
|
|
16
|
-
gap: 8px;
|
|
17
|
-
/* The list is the modal's elastic region: inside a viewport-capped card it gives up height first, so
|
|
18
|
-
the pack picker, total and Cancel/Buy below it stay on screen without scrolling. The floor is an
|
|
19
|
-
explicit ~one row because a scroll container's automatic minimum size is zero — it would otherwise
|
|
20
|
-
collapse to nothing on a short screen. */
|
|
21
|
-
min-height: 120px;
|
|
22
|
-
max-height: 360px;
|
|
23
|
-
overflow-y: auto;
|
|
24
|
-
width: 100%;
|
|
25
|
-
scrollbar-width: thin;
|
|
26
|
-
scrollbar-color: #a2a2a2 ${se.media};
|
|
27
|
-
|
|
28
|
-
&::-webkit-scrollbar {
|
|
29
|
-
width: 8px;
|
|
30
|
-
}
|
|
31
|
-
&::-webkit-scrollbar-track {
|
|
32
|
-
background: ${se.media};
|
|
33
|
-
border-radius: 10px;
|
|
34
|
-
}
|
|
35
|
-
&::-webkit-scrollbar-thumb {
|
|
36
|
-
background: #a2a2a2;
|
|
37
|
-
border-radius: ${Is.btn};
|
|
38
|
-
}
|
|
39
|
-
`,Es=i.span`
|
|
40
|
-
margin-left: 8px;
|
|
41
|
-
font-size: 13px;
|
|
42
|
-
font-weight: 600;
|
|
43
|
-
color: ${se.muted};
|
|
44
|
-
`,qs=i.div`
|
|
45
|
-
display: flex;
|
|
46
|
-
align-items: center;
|
|
47
|
-
justify-content: space-between;
|
|
48
|
-
gap: 12px;
|
|
49
|
-
padding: 0 0 12px;
|
|
50
|
-
font-size: 14px;
|
|
51
|
-
color: ${se.muted};
|
|
52
|
-
|
|
53
|
-
& strong {
|
|
54
|
-
display: inline-flex;
|
|
55
|
-
align-items: center;
|
|
56
|
-
gap: 6px;
|
|
57
|
-
font-size: 20px;
|
|
58
|
-
font-weight: 700;
|
|
59
|
-
color: ${se.text};
|
|
60
|
-
}
|
|
61
|
-
`,Bs="https://cdn.decentraland.org/@dcl/shop/0.7.3-31002809274.commit-68e2004/_assets/buy-error-22UunaPC.png";function Rs(o){const{phase:l,balanceCredits:I,onClose:z}=o,W=l==="processing",D=l==="error"?a("cartCheckout.errorTitle"):l==="nofunds"?a("cartCheckout.titleNoFunds"):l==="choose"?a("buyModal.choosePayment"):a("cartCheckout.titleBuy"),Y=l==="processing";return e.jsxs(ja,{role:"dialog","aria-modal":"true","aria-label":a("cartCheckout.dialogAria"),children:[e.jsx(ka,{onClick:W?void 0:z,"aria-hidden":!0}),e.jsxs(Sa,{"data-tall":Y||void 0,children:[e.jsxs($a,{children:[e.jsxs(Ma,{children:[e.jsx(Ta,{children:D}),!W&&e.jsx(Ia,{onClick:z,"aria-label":a("buyModal.close"),children:e.jsx(Pa,{})})]}),e.jsxs(za,{children:[e.jsx(Aa,{children:l==="nofunds"?a("buyModal.dclBalance"):a("buyModal.myCreditsBalance")}),e.jsx(mt,{}),e.jsx(Ea,{children:le(I)})]})]}),l==="choose"&&e.jsxs(ke,{children:[e.jsxs(qs,{children:[e.jsx("span",{children:a("cart.purchaseSummary")}),e.jsxs("strong",{children:[e.jsx(mt,{}),le(o.totalCredits??0)]})]}),e.jsx(Tt,{options:o.options??[],totalCents:o.totalCents??0,onPay:o.onPay??(()=>{}),rateNote:(()=>{const A=qa(o.totalCents??0,o.totalManaWei??0n);return A!=null?a("buyModal.manaRate",{mana:A.toLocaleString("en",{maximumFractionDigits:2})}):null})()})]}),l==="processing"&&e.jsx(_s,{stage:o.stage??"reserving",step:o.step??1,total:o.total??1,isSelfCustody:!!o.isSelfCustody,signatures:o.signatures}),l==="nofunds"&&e.jsx(Ws,{lines:o.lines??[],shortfallCredits:o.shortfallCredits??0,packs:o.packs??[],selectedPack:o.selectedPack??"",onSelectPack:o.onSelectPack??(()=>{}),onBuyPacks:o.onBuyPacks??(()=>{}),onCancel:z}),l==="error"&&e.jsxs(ke,{children:[e.jsxs(Ba,{"data-testid":"buy-error",children:[e.jsx(Ra,{src:Bs,alt:"",width:64,height:80}),e.jsxs(_a,{children:[e.jsx("b",{children:a("cartCheckout.errorHeadline")})," ",o.message??a("cartCheckout.errorBody")]})]}),e.jsxs(It,{children:[e.jsx(Se,{"data-variant":"outline",onClick:z,children:a("buyModal.cancel")}),e.jsx(Se,{"data-variant":"purple",onClick:o.onRetry??z,children:a("cartCheckout.tryAgain")})]})]})]})]})}function _s({stage:o,step:l,total:I,isSelfCustody:z,signatures:W}){const D=o==="reserving",Y=I>0?Math.min(100,Math.round(l/I*100)):0,A=z&&W&&W.total>1,ne=o==="awaiting-signature"?z?A?a("cartCheckout.confirmMultiple",{current:W.current,total:W.total}):a("buyModal.confirmToContinue"):a("buyModal.completingTransaction"):o==="settling"?a("buyModal.completingTransaction"):a("cartCheckout.preparing");return e.jsxs(ke,{"data-processing":!0,children:[e.jsx(Wa,{src:sa,alt:"",width:61,height:61}),e.jsx(Fa,{children:ne}),D?e.jsxs(Ps,{children:[e.jsx(ft,{"aria-hidden":!0,children:e.jsx(yt,{"data-step":!0,style:{width:`${Y}%`}})}),I>1?e.jsxs(zs,{children:[l,"/",I]}):null]}):e.jsx(ft,{"aria-hidden":!0,children:e.jsx(yt,{})})]})}function Ws({lines:o,shortfallCredits:l,packs:I,selectedPack:z,onSelectPack:W,onBuyPacks:D,onCancel:Y}){const A=I.find(n=>n.id===z),ne=o.reduce((n,L)=>n+(L.quantity??1),0);return e.jsxs(ke,{children:[e.jsxs(La,{"data-testid":"nofunds-warning",children:[e.jsx(Ka,{}),e.jsxs(Qa,{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})]})]}),e.jsx(As,{children:o.map(n=>{const L=n.quantity??1;return e.jsxs(Ua,{children:[e.jsx(Na,{children:n.item.thumbnail?e.jsx("img",{src:n.item.thumbnail,alt:""}):null}),e.jsxs(Ha,{children:[e.jsxs("div",{children:[e.jsxs(Oa,{title:n.item.name,children:[n.item.name||a("buyModal.itemFallback"),L>1?e.jsx(Es,{children:a("cartCheckout.qty",{count:L})}):null]}),n.item.creator?e.jsx(Va,{address:n.item.creator}):null]}),e.jsxs(Ga,{children:[e.jsx(Da,{}),e.jsx("span",{children:le(n.priceCredits*L)})]})]})]},n.item.id)})}),e.jsx(Ya,{children:I.map(n=>{const L=n.id===z;return e.jsxs(Ja,{"data-testid":"credit-pack","data-on":L||void 0,onClick:()=>W(n.id),children:[e.jsx(Xa,{}),e.jsx(Za,{children:le(n.credits)}),e.jsxs(es,{children:["($",n.usd.toFixed(2),")"]})]},n.id)})}),e.jsxs(ts,{children:[e.jsxs(as,{children:[e.jsx(ss,{}),e.jsx("span",{children:le((A==null?void 0:A.credits)??0)})]}),e.jsxs(ns,{children:["$",((A==null?void 0:A.usd)??0).toFixed(2)]})]}),e.jsxs(It,{children:[e.jsx(Se,{"data-variant":"outline",onClick:Y,children:a("buyModal.cancel")}),e.jsx(Se,{"data-variant":"gradient",onClick:D,children:a("buyModal.buy")})]})]})}const{colors:r,gradients:Pt,radius:Z}=ue,zt="@media (max-width: 1080px)",T="@media (max-width: 880px)",jt=i.div`
|
|
62
|
-
max-width: 1510px;
|
|
63
|
-
margin: 0 auto;
|
|
64
|
-
/* Grows into the page's leftover height and passes it down to Upsell, so the white cross-sell band ends at
|
|
65
|
-
the footer rather than leaving a gray strip. Needs .page[data-route="/cart"] to be a flex column. */
|
|
66
|
-
width: 100%;
|
|
67
|
-
flex: 1 0 auto;
|
|
68
|
-
display: flex;
|
|
69
|
-
flex-direction: column;
|
|
70
|
-
|
|
71
|
-
${T} {
|
|
72
|
-
padding-bottom: 188px; /* room for the fixed summary bar */
|
|
73
|
-
}
|
|
74
|
-
`,kt=i.button`
|
|
75
|
-
display: inline-flex;
|
|
76
|
-
align-items: center;
|
|
77
|
-
gap: 6px;
|
|
78
|
-
margin: 0 0 16px;
|
|
79
|
-
padding: 0;
|
|
80
|
-
border: 0;
|
|
81
|
-
background: none;
|
|
82
|
-
color: ${r.text2};
|
|
83
|
-
font-size: 14px;
|
|
84
|
-
font-weight: 600;
|
|
85
|
-
letter-spacing: 0.02em;
|
|
86
|
-
text-transform: uppercase;
|
|
87
|
-
cursor: pointer;
|
|
88
|
-
transition: color 0.15s ease;
|
|
89
|
-
|
|
90
|
-
&:hover {
|
|
91
|
-
color: ${r.accent};
|
|
92
|
-
}
|
|
93
|
-
& .ico {
|
|
94
|
-
width: 18px;
|
|
95
|
-
height: 18px;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
${T} {
|
|
99
|
-
display: none;
|
|
100
|
-
}
|
|
101
|
-
`,Fs=i.div`
|
|
102
|
-
display: grid;
|
|
103
|
-
grid-template-columns: minmax(0, 1fr) 615px;
|
|
104
|
-
gap: 24px;
|
|
105
|
-
align-items: start;
|
|
106
|
-
|
|
107
|
-
${zt} {
|
|
108
|
-
grid-template-columns: 1fr;
|
|
109
|
-
}
|
|
110
|
-
`,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
|
-
|
|
118
|
-
${T} {
|
|
119
|
-
/* The single-column layout is already taller than the desktop band, and the fixed summary bar sits over
|
|
120
|
-
the bottom of it — a floor here would only add empty gray. */
|
|
121
|
-
min-height: 0;
|
|
122
|
-
}
|
|
123
|
-
`,Ls=i.div`
|
|
124
|
-
min-width: 0;
|
|
125
|
-
display: flex;
|
|
126
|
-
flex-direction: column;
|
|
127
|
-
gap: 12px;
|
|
128
|
-
`,Ks=i.div`
|
|
129
|
-
display: flex;
|
|
130
|
-
align-items: center;
|
|
131
|
-
justify-content: space-between;
|
|
132
|
-
gap: 12px;
|
|
133
|
-
background: ${r.white};
|
|
134
|
-
border-radius: 16px;
|
|
135
|
-
padding: 12px 12px 12px 24px;
|
|
136
|
-
|
|
137
|
-
${T} {
|
|
138
|
-
gap: 8px;
|
|
139
|
-
padding: 12px;
|
|
140
|
-
}
|
|
141
|
-
`,At=i.section`
|
|
142
|
-
min-width: 0;
|
|
143
|
-
background: ${r.white};
|
|
144
|
-
border-radius: 16px;
|
|
145
|
-
padding: 24px;
|
|
146
|
-
|
|
147
|
-
${T} {
|
|
148
|
-
padding: 16px;
|
|
149
|
-
}
|
|
150
|
-
`,Qs=i(At)`
|
|
151
|
-
display: flex;
|
|
152
|
-
flex-direction: column;
|
|
153
|
-
align-items: center;
|
|
154
|
-
justify-content: center;
|
|
155
|
-
gap: 24px;
|
|
156
|
-
min-height: 420px;
|
|
157
|
-
padding: 48px 16px;
|
|
158
|
-
text-align: center;
|
|
159
|
-
color: ${r.text};
|
|
160
|
-
|
|
161
|
-
${ue.media.maxWidth("mobile")} {
|
|
162
|
-
min-height: 320px;
|
|
163
|
-
padding: 32px 16px;
|
|
164
|
-
}
|
|
165
|
-
`,Us=i.div`
|
|
166
|
-
display: flex;
|
|
167
|
-
flex-direction: column;
|
|
168
|
-
align-items: center;
|
|
169
|
-
gap: 12px;
|
|
170
|
-
padding-bottom: 16px;
|
|
171
|
-
`,Ns=i.p`
|
|
172
|
-
margin: 0;
|
|
173
|
-
font-size: 24px;
|
|
174
|
-
font-weight: 700;
|
|
175
|
-
line-height: 1.6;
|
|
176
|
-
|
|
177
|
-
${ue.media.maxWidth("mobile")} {
|
|
178
|
-
font-size: 20px;
|
|
179
|
-
}
|
|
180
|
-
`,Hs=i.p`
|
|
181
|
-
margin: 0;
|
|
182
|
-
font-size: 20px;
|
|
183
|
-
font-weight: 400;
|
|
184
|
-
line-height: 1.6;
|
|
185
|
-
|
|
186
|
-
${ue.media.maxWidth("mobile")} {
|
|
187
|
-
font-size: 16px;
|
|
188
|
-
}
|
|
189
|
-
`,Os=i($e)`
|
|
190
|
-
display: inline-flex;
|
|
191
|
-
align-items: center;
|
|
192
|
-
justify-content: center;
|
|
193
|
-
width: 310px;
|
|
194
|
-
max-width: 100%;
|
|
195
|
-
height: 56px;
|
|
196
|
-
padding: 0 12px;
|
|
197
|
-
border-radius: ${Z.card};
|
|
198
|
-
background: ${r.accent};
|
|
199
|
-
color: ${r.softWhite};
|
|
200
|
-
font-size: 15px;
|
|
201
|
-
font-weight: 600;
|
|
202
|
-
line-height: 24px;
|
|
203
|
-
letter-spacing: 0.46px;
|
|
204
|
-
text-transform: uppercase;
|
|
205
|
-
text-decoration: none;
|
|
206
|
-
transition: background 0.15s ease;
|
|
207
|
-
|
|
208
|
-
&:hover {
|
|
209
|
-
background: ${r.accentHover};
|
|
210
|
-
}
|
|
211
|
-
&:focus-visible {
|
|
212
|
-
outline: 2px solid ${r.accent};
|
|
213
|
-
outline-offset: 2px;
|
|
214
|
-
}
|
|
215
|
-
`,Vs=i.button`
|
|
216
|
-
display: none;
|
|
217
|
-
|
|
218
|
-
${T} {
|
|
219
|
-
display: inline-flex;
|
|
220
|
-
align-items: center;
|
|
221
|
-
flex-shrink: 0;
|
|
222
|
-
border: 0;
|
|
223
|
-
background: none;
|
|
224
|
-
padding: 0;
|
|
225
|
-
color: ${r.text};
|
|
226
|
-
cursor: pointer;
|
|
227
|
-
|
|
228
|
-
& .ico {
|
|
229
|
-
width: 20px;
|
|
230
|
-
height: 20px;
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
`,Gs=i.h1`
|
|
234
|
-
margin: 0;
|
|
235
|
-
font-size: 14px;
|
|
236
|
-
font-weight: 600;
|
|
237
|
-
line-height: 1.57;
|
|
238
|
-
color: ${r.text};
|
|
239
|
-
|
|
240
|
-
${T} {
|
|
241
|
-
flex: 1;
|
|
242
|
-
min-width: 0;
|
|
243
|
-
font-size: 16px;
|
|
244
|
-
}
|
|
245
|
-
`,Ds=i.button`
|
|
246
|
-
display: inline-flex;
|
|
247
|
-
align-items: center;
|
|
248
|
-
justify-content: center;
|
|
249
|
-
gap: 8px;
|
|
250
|
-
height: 40px;
|
|
251
|
-
padding: 0 12px;
|
|
252
|
-
border: 2px solid transparent;
|
|
253
|
-
border-radius: ${Z.btn};
|
|
254
|
-
background:
|
|
255
|
-
linear-gradient(${r.white}, ${r.white}) padding-box,
|
|
256
|
-
${Pt.amethyst} border-box;
|
|
257
|
-
color: ${r.accent};
|
|
258
|
-
font-size: 13px;
|
|
259
|
-
font-weight: 600;
|
|
260
|
-
line-height: 24px;
|
|
261
|
-
letter-spacing: 0.46px;
|
|
262
|
-
text-transform: uppercase;
|
|
263
|
-
white-space: nowrap;
|
|
264
|
-
cursor: pointer;
|
|
265
|
-
transition:
|
|
266
|
-
box-shadow 0.15s ease,
|
|
267
|
-
filter 0.15s ease;
|
|
268
|
-
|
|
269
|
-
&:hover:not(:disabled) {
|
|
270
|
-
box-shadow: 0 0 8px 0 rgba(165, 36, 179, 0.35);
|
|
271
|
-
}
|
|
272
|
-
&:active:not(:disabled) {
|
|
273
|
-
filter: brightness(0.97);
|
|
274
|
-
}
|
|
275
|
-
&:disabled {
|
|
276
|
-
opacity: 0.55;
|
|
277
|
-
cursor: default;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
${T} {
|
|
281
|
-
height: 36px;
|
|
282
|
-
padding: 0 10px;
|
|
283
|
-
font-size: 12px;
|
|
284
|
-
}
|
|
285
|
-
`,Ys=i.div`
|
|
286
|
-
display: flex;
|
|
287
|
-
flex-direction: column;
|
|
288
|
-
gap: 24px;
|
|
289
|
-
`,Js=i.div`
|
|
290
|
-
position: relative;
|
|
291
|
-
display: flex;
|
|
292
|
-
align-items: stretch;
|
|
293
|
-
gap: 12px;
|
|
294
|
-
background: ${r.white};
|
|
295
|
-
border: 1px solid ${r.gray4};
|
|
296
|
-
border-radius: ${Z.card};
|
|
297
|
-
overflow: hidden;
|
|
298
|
-
|
|
299
|
-
&[data-unavailable] [data-thumb] {
|
|
300
|
-
opacity: 0.5;
|
|
301
|
-
}
|
|
302
|
-
&[data-unavailable] [data-check] {
|
|
303
|
-
display: none;
|
|
304
|
-
}
|
|
305
|
-
&[data-unavailable] [data-desc] {
|
|
306
|
-
opacity: 0.7;
|
|
307
|
-
}
|
|
308
|
-
`,Xs=i.div`
|
|
309
|
-
position: relative;
|
|
310
|
-
flex-shrink: 0;
|
|
311
|
-
width: 137.5px;
|
|
312
|
-
height: 137px;
|
|
313
|
-
background: ${r.media};
|
|
314
|
-
border-radius: ${Z.card};
|
|
315
|
-
display: grid;
|
|
316
|
-
place-items: center;
|
|
317
|
-
overflow: hidden;
|
|
318
|
-
|
|
319
|
-
& img {
|
|
320
|
-
width: 83%;
|
|
321
|
-
height: 83%;
|
|
322
|
-
object-fit: contain;
|
|
323
|
-
filter: drop-shadow(0.56px 2.25px 2.8px rgba(0, 0, 0, 0.1));
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
${T} {
|
|
327
|
-
width: 120px;
|
|
328
|
-
height: 120px;
|
|
329
|
-
}
|
|
330
|
-
`,Zs=i($e)`
|
|
331
|
-
position: absolute;
|
|
332
|
-
inset: 0;
|
|
333
|
-
display: grid;
|
|
334
|
-
place-items: center;
|
|
335
|
-
`,en=i.span`
|
|
336
|
-
position: absolute;
|
|
337
|
-
top: 7.5px;
|
|
338
|
-
left: 7.5px;
|
|
339
|
-
width: 20px;
|
|
340
|
-
height: 20px;
|
|
341
|
-
border-radius: 50%;
|
|
342
|
-
background: #34ce77;
|
|
343
|
-
display: grid;
|
|
344
|
-
place-items: center;
|
|
345
|
-
`,tn=i.div`
|
|
346
|
-
flex: 1;
|
|
347
|
-
min-width: 0;
|
|
348
|
-
display: flex;
|
|
349
|
-
flex-direction: column;
|
|
350
|
-
justify-content: space-between;
|
|
351
|
-
gap: 8px;
|
|
352
|
-
padding: 16px 8px;
|
|
353
|
-
|
|
354
|
-
${T} {
|
|
355
|
-
padding: 12px 4px 12px 0;
|
|
356
|
-
}
|
|
357
|
-
`,an=i.div`
|
|
358
|
-
display: flex;
|
|
359
|
-
flex-direction: column;
|
|
360
|
-
gap: 4px;
|
|
361
|
-
min-width: 0;
|
|
362
|
-
padding-right: 64px; /* clear the top-right favourite + remove group */
|
|
363
|
-
`,Et=Ue`
|
|
364
|
-
display: block;
|
|
365
|
-
font-size: 16px;
|
|
366
|
-
font-weight: 600;
|
|
367
|
-
line-height: 1.2;
|
|
368
|
-
color: ${r.text};
|
|
369
|
-
text-decoration: none;
|
|
370
|
-
overflow: hidden;
|
|
371
|
-
text-overflow: ellipsis;
|
|
372
|
-
white-space: nowrap;
|
|
373
|
-
|
|
374
|
-
a&:hover {
|
|
375
|
-
color: ${r.accent};
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
${T} {
|
|
379
|
-
white-space: normal;
|
|
380
|
-
display: -webkit-box;
|
|
381
|
-
-webkit-line-clamp: 2;
|
|
382
|
-
line-clamp: 2;
|
|
383
|
-
-webkit-box-orient: vertical;
|
|
384
|
-
}
|
|
385
|
-
`,sn=i.div`
|
|
386
|
-
${Et};
|
|
387
|
-
`,nn=i($e)`
|
|
388
|
-
${Et};
|
|
389
|
-
`,rn=i(na)`
|
|
390
|
-
font-size: 10px;
|
|
391
|
-
line-height: 1.43;
|
|
392
|
-
color: ${r.muted};
|
|
393
|
-
|
|
394
|
-
& [data-avatar] {
|
|
395
|
-
display: none;
|
|
396
|
-
}
|
|
397
|
-
& [data-testid='creator-name'] {
|
|
398
|
-
font-size: 10px;
|
|
399
|
-
line-height: 1.43;
|
|
400
|
-
}
|
|
401
|
-
`,on=i.div`
|
|
402
|
-
display: flex;
|
|
403
|
-
align-items: center;
|
|
404
|
-
justify-content: space-between;
|
|
405
|
-
gap: 12px;
|
|
406
|
-
padding-right: 8px;
|
|
407
|
-
`,cn=i.div`
|
|
408
|
-
display: inline-flex;
|
|
409
|
-
align-items: center;
|
|
410
|
-
gap: 8px;
|
|
411
|
-
padding: 6px;
|
|
412
|
-
border: 0.5px solid ${r.muted2};
|
|
413
|
-
border-radius: ${Z.pill};
|
|
414
|
-
`,$t=i.button`
|
|
415
|
-
display: grid;
|
|
416
|
-
place-items: center;
|
|
417
|
-
width: 16px;
|
|
418
|
-
height: 16px;
|
|
419
|
-
padding: 0;
|
|
420
|
-
border: 0;
|
|
421
|
-
background: none;
|
|
422
|
-
color: ${r.text};
|
|
423
|
-
cursor: pointer;
|
|
424
|
-
|
|
425
|
-
&:disabled {
|
|
426
|
-
color: ${r.muted2};
|
|
427
|
-
cursor: default;
|
|
428
|
-
}
|
|
429
|
-
`,dn=i.span`
|
|
430
|
-
min-width: 12px;
|
|
431
|
-
font-size: 14px;
|
|
432
|
-
font-weight: 500;
|
|
433
|
-
line-height: 1.2;
|
|
434
|
-
color: ${r.text};
|
|
435
|
-
text-align: center;
|
|
436
|
-
`,ln=i.div`
|
|
437
|
-
display: inline-flex;
|
|
438
|
-
align-items: center;
|
|
439
|
-
gap: 4px;
|
|
440
|
-
/* Always right-aligned: with a stepper present space-between handles it; for secondary/unique lines
|
|
441
|
-
(no stepper) the auto margin keeps the lone price on the right instead of falling to the left. */
|
|
442
|
-
margin-left: auto;
|
|
443
|
-
font-size: 24px;
|
|
444
|
-
font-weight: 600;
|
|
445
|
-
color: ${r.text2};
|
|
446
|
-
|
|
447
|
-
${T} {
|
|
448
|
-
font-size: 20px;
|
|
449
|
-
}
|
|
450
|
-
`,un=i(Mt)`
|
|
451
|
-
width: 24px;
|
|
452
|
-
height: 24px;
|
|
453
|
-
background: ${r.text};
|
|
454
|
-
|
|
455
|
-
${T} {
|
|
456
|
-
width: 20px;
|
|
457
|
-
height: 20px;
|
|
458
|
-
}
|
|
459
|
-
`,hn=i.span`
|
|
460
|
-
margin-left: 6px;
|
|
461
|
-
font-size: 14px;
|
|
462
|
-
font-weight: 500;
|
|
463
|
-
color: ${r.muted};
|
|
464
|
-
text-decoration: line-through;
|
|
465
|
-
`,pn=i.div`
|
|
466
|
-
position: absolute;
|
|
467
|
-
top: 9px;
|
|
468
|
-
right: 7px;
|
|
469
|
-
display: flex;
|
|
470
|
-
align-items: flex-start;
|
|
471
|
-
gap: 12px;
|
|
472
|
-
`,gn=i.span`
|
|
473
|
-
display: inline-flex;
|
|
474
|
-
align-items: center;
|
|
475
|
-
gap: 4px;
|
|
476
|
-
font-size: 12px;
|
|
477
|
-
font-weight: 600;
|
|
478
|
-
line-height: 1;
|
|
479
|
-
text-transform: uppercase;
|
|
480
|
-
color: ${r.text2};
|
|
481
|
-
`,xn=i(H)`
|
|
482
|
-
color: #f48221;
|
|
483
|
-
`,mn=i($e)`
|
|
484
|
-
font-size: 12px;
|
|
485
|
-
font-weight: 600;
|
|
486
|
-
line-height: 24px;
|
|
487
|
-
letter-spacing: 0.46px;
|
|
488
|
-
text-transform: uppercase;
|
|
489
|
-
text-decoration: underline;
|
|
490
|
-
color: ${r.accent};
|
|
491
|
-
|
|
492
|
-
&:hover {
|
|
493
|
-
color: ${r.accentHover};
|
|
494
|
-
}
|
|
495
|
-
&:focus-visible {
|
|
496
|
-
outline: 2px solid ${r.accent};
|
|
497
|
-
outline-offset: 2px;
|
|
498
|
-
}
|
|
499
|
-
`,fn=i.span`
|
|
500
|
-
align-self: flex-start;
|
|
501
|
-
display: inline-flex;
|
|
502
|
-
align-items: center;
|
|
503
|
-
gap: 4px;
|
|
504
|
-
padding: 2px 4px;
|
|
505
|
-
border-radius: ${Z.chip};
|
|
506
|
-
background: #f4e9ff;
|
|
507
|
-
font-size: 10px;
|
|
508
|
-
font-weight: 400;
|
|
509
|
-
line-height: 14px;
|
|
510
|
-
color: ${r.text};
|
|
511
|
-
`,yn=i(H)`
|
|
512
|
-
width: 11.31px;
|
|
513
|
-
height: 10.94px;
|
|
514
|
-
background: ${r.text};
|
|
515
|
-
`,qt=Ue`
|
|
516
|
-
display: grid;
|
|
517
|
-
place-items: center;
|
|
518
|
-
width: 24px;
|
|
519
|
-
height: 24px;
|
|
520
|
-
padding: 0;
|
|
521
|
-
border: 0;
|
|
522
|
-
background: none;
|
|
523
|
-
color: ${r.muted};
|
|
524
|
-
cursor: pointer;
|
|
525
|
-
transition: color 0.12s ease;
|
|
526
|
-
|
|
527
|
-
&:disabled {
|
|
528
|
-
opacity: 0.5;
|
|
529
|
-
cursor: default;
|
|
530
|
-
}
|
|
531
|
-
`,bn=i.button`
|
|
532
|
-
${qt};
|
|
533
|
-
|
|
534
|
-
&:hover:not(:disabled) {
|
|
535
|
-
color: ${r.text};
|
|
536
|
-
}
|
|
537
|
-
&[data-on] {
|
|
538
|
-
color: ${r.dclRed};
|
|
539
|
-
}
|
|
540
|
-
`,vn=i.button`
|
|
541
|
-
${qt};
|
|
542
|
-
|
|
543
|
-
&:hover:not(:disabled) {
|
|
544
|
-
color: ${r.dclRed};
|
|
545
|
-
}
|
|
546
|
-
`,wn=i.div`
|
|
547
|
-
display: flex;
|
|
548
|
-
gap: 20px;
|
|
549
|
-
margin-top: 16px;
|
|
550
|
-
|
|
551
|
-
& .link {
|
|
552
|
-
font-size: 13px;
|
|
553
|
-
color: ${r.muted};
|
|
554
|
-
font-weight: 600;
|
|
555
|
-
}
|
|
556
|
-
& .link:hover:not(:disabled) {
|
|
557
|
-
color: ${r.text};
|
|
558
|
-
}
|
|
559
|
-
`,Cn=i.aside`
|
|
560
|
-
position: sticky;
|
|
561
|
-
top: 172px;
|
|
562
|
-
display: flex;
|
|
563
|
-
flex-direction: column;
|
|
564
|
-
background: ${r.white};
|
|
565
|
-
box-shadow: 0 1px 3px rgba(22, 21, 24, 0.06);
|
|
566
|
-
border-radius: 16px;
|
|
567
|
-
padding: 16px;
|
|
568
|
-
|
|
569
|
-
${zt} {
|
|
570
|
-
position: static;
|
|
571
|
-
}
|
|
572
|
-
${T} {
|
|
573
|
-
position: fixed;
|
|
574
|
-
left: 0;
|
|
575
|
-
right: 0;
|
|
576
|
-
top: auto;
|
|
577
|
-
bottom: 0;
|
|
578
|
-
z-index: 30;
|
|
579
|
-
border: 0;
|
|
580
|
-
border-radius: 16px 16px 0 0;
|
|
581
|
-
box-shadow: 0 -4px 20px rgba(22, 21, 24, 0.12);
|
|
582
|
-
}
|
|
583
|
-
`,jn=i.h2`
|
|
584
|
-
margin: 0 0 24px;
|
|
585
|
-
padding-bottom: 16px;
|
|
586
|
-
border-bottom: 1px solid ${r.gray4};
|
|
587
|
-
font-size: 24px;
|
|
588
|
-
font-weight: 600;
|
|
589
|
-
color: ${r.text};
|
|
590
|
-
|
|
591
|
-
${T} {
|
|
592
|
-
margin-bottom: 12px;
|
|
593
|
-
padding-bottom: 12px;
|
|
594
|
-
}
|
|
595
|
-
`,kn=i.div`
|
|
596
|
-
display: flex;
|
|
597
|
-
flex-direction: column;
|
|
598
|
-
gap: 12px;
|
|
599
|
-
`,Sn=i.div`
|
|
600
|
-
display: flex;
|
|
601
|
-
align-items: flex-start;
|
|
602
|
-
justify-content: space-between;
|
|
603
|
-
gap: 12px;
|
|
604
|
-
`,$n=i.span`
|
|
605
|
-
font-size: 14px;
|
|
606
|
-
font-weight: 600;
|
|
607
|
-
line-height: 1.57;
|
|
608
|
-
color: ${r.muted1};
|
|
609
|
-
`,Mn=i.span`
|
|
610
|
-
display: inline-flex;
|
|
611
|
-
align-items: center;
|
|
612
|
-
gap: 8px;
|
|
613
|
-
font-size: 24px;
|
|
614
|
-
font-weight: 700;
|
|
615
|
-
color: ${r.text};
|
|
616
|
-
`,Tn=i.span`
|
|
617
|
-
display: flex;
|
|
618
|
-
flex-direction: column;
|
|
619
|
-
align-items: flex-end;
|
|
620
|
-
justify-content: center;
|
|
621
|
-
gap: 4px;
|
|
622
|
-
`;i.span`
|
|
623
|
-
font-size: 12px;
|
|
624
|
-
font-weight: 400;
|
|
625
|
-
line-height: 1;
|
|
626
|
-
color: ${r.muted};
|
|
627
|
-
`;const In=i(Mt)`
|
|
628
|
-
width: 30px;
|
|
629
|
-
height: 30px;
|
|
630
|
-
background: ${r.text};
|
|
631
|
-
-webkit-mask-size: 24px 24px;
|
|
632
|
-
mask-size: 24px 24px;
|
|
633
|
-
-webkit-mask-position: left center;
|
|
634
|
-
mask-position: left center;
|
|
635
|
-
`,Pn=i.button`
|
|
636
|
-
width: 100%;
|
|
637
|
-
height: 56px;
|
|
638
|
-
border: 0;
|
|
639
|
-
border-radius: ${Z.btn};
|
|
640
|
-
background: ${Pt.amethyst};
|
|
641
|
-
color: ${r.softWhite};
|
|
642
|
-
font-size: 15px;
|
|
643
|
-
font-weight: 600;
|
|
644
|
-
letter-spacing: 0.046em;
|
|
645
|
-
text-transform: uppercase;
|
|
646
|
-
cursor: pointer;
|
|
647
|
-
transition:
|
|
648
|
-
background 0.15s ease,
|
|
649
|
-
filter 0.15s ease;
|
|
650
|
-
|
|
651
|
-
&:hover:not(:disabled) {
|
|
652
|
-
background: ${r.accent};
|
|
653
|
-
}
|
|
654
|
-
&:active:not(:disabled) {
|
|
655
|
-
filter: brightness(0.95);
|
|
656
|
-
}
|
|
657
|
-
&:disabled {
|
|
658
|
-
opacity: 0.6;
|
|
659
|
-
cursor: default;
|
|
660
|
-
}
|
|
661
|
-
`,Bt=Ue`
|
|
662
|
-
margin: 0;
|
|
663
|
-
font-size: 13px;
|
|
664
|
-
`,Ce=i.p`
|
|
665
|
-
${Bt};
|
|
666
|
-
`,zn=i(Ts)`
|
|
667
|
-
${Bt};
|
|
668
|
-
`,An=i.div`
|
|
669
|
-
position: relative;
|
|
670
|
-
/* Takes the leftover height so its white ::before covers it — see .page[data-route="/cart"]. */
|
|
671
|
-
flex: 1 0 auto;
|
|
672
|
-
margin-top: 48px;
|
|
673
|
-
/* The whole gap from the top of the cross-sell to the "You might also like" heading — the shared
|
|
674
|
-
carousel's own top margin is zeroed below so this padding isn't stacked on top of it. */
|
|
675
|
-
padding: 47px 0 24px;
|
|
676
|
-
|
|
677
|
-
&::before {
|
|
678
|
-
content: '';
|
|
679
|
-
position: absolute;
|
|
680
|
-
top: 0;
|
|
681
|
-
bottom: -80px; /* eat .page's bottom padding so the white reaches the footer */
|
|
682
|
-
left: 50%;
|
|
683
|
-
width: 100vw;
|
|
684
|
-
transform: translateX(-50%);
|
|
685
|
-
background: ${r.bg};
|
|
686
|
-
z-index: 0;
|
|
687
|
-
}
|
|
688
|
-
& > * {
|
|
689
|
-
position: relative;
|
|
690
|
-
z-index: 1;
|
|
691
|
-
}
|
|
692
|
-
& section {
|
|
693
|
-
margin-top: 0;
|
|
694
|
-
}
|
|
695
|
-
`;function Ke(o){if($s(o))return a("errors.rejected");const l=(o.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 En=12e4;function qn(o){const l=[];return o.unavailable.length&&l.push(a("cart.drop.unavailable",{count:o.unavailable.length})),o.own.length&&l.push(a("cart.drop.own",{count:o.own.length})),a("cart.drop.removed",{items:l.join(` ${a("cart.drop.and")} `)})}const Qe=o=>o.reduce((l,I)=>l+I.priceCredits*I.quantity,0),je=o=>o.flatMap(l=>Array.from({length:l.quantity},()=>({...l,quantity:1})));function Yn(){ia({title:a("nav.cart"),noindex:!0});const o=N(t=>t.items),l=N(t=>t.remove),I=N(t=>t.increment),z=N(t=>t.decrement),W=N(t=>t.clear),D=N(t=>t.restore),Y=N(t=>t.setFittingOpen),A=dt(t=>t.items),ne=dt(t=>t.toggle),{session:n,signIn:L}=ra(),Rt=oa(),he=Cs().packs.slice(0,js);P.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const _t=o.some(t=>t.category!=="emote"),{data:Me}=ca({queryKey:["upsell-listings"],queryFn:()=>Ca({first:40}),staleTime:6e4}),{data:S}=da(n),b=la(),ee=ta(),{state:J}=aa(),[Wt,ie]=P.useState(null),[Ne,pe]=P.useState(null),[Ft,B]=P.useState(!1),[R,O]=P.useState(null),He=P.useRef(0),[p,j]=P.useState(null),{data:ge}=ua(n),{data:re}=ha(!0),[Te,Oe]=P.useState(""),oe=P.useRef(null),Ve=pa(o),Ge=t=>ut(Ve[t.id]),Ie=o.filter(Ge),Pe=o.length>0&&Ie.length===0,Lt=Ie.reduce((t,s)=>t+s.priceCredits*s.quantity,0),Kt=o.reduce((t,s)=>t+s.quantity,0),Qt=Ie.reduce((t,s)=>t+s.quantity,0),De=R?R.liveTotalCredits:Lt,Ut=new Set(o.map(t=>t.id)),Ye=((Me==null?void 0:Me.items)??[]).filter(t=>!Ut.has(t.id)).slice(0,12),Nt=new Map(R==null?void 0:R.buyable.map(t=>[t.item.id,t])),xe=(S==null?void 0:S.credits)??0,ze=De*10,Ht=re?lt(ze,re):0n,ce=Fe({priceCents:ze,priceManaWei:Ht,balanceCents:(S==null?void 0:S.balanceCents)??0,manaBalanceWei:ge??0n}),Ot=t=>t.some(s=>s.acquisition==="store"),Ae=t=>t.flatMap(s=>s.acquisition==="trade"?[s]:[]),Vt=fa,Gt=t=>ba(t.contractAddress,String(t.itemId));function me(t){t(),O(null),pe(null),ie(null)}function Dt(){j(null),B(!1)}function Je(t){const s=Qe(t),d=Math.max(0,s-xe),c=he.find(u=>u.credits>=d)??he[he.length-1];Oe(c.id),G("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:s,credits_balance:xe,shortfall:d}),j({phase:"nofunds",lines:t.map(u=>({item:u.item,priceCredits:u.priceCredits,quantity:u.quantity})),shortfall:d}),B(!1)}async function Ee(t){if(!n||t.length===0)return;const s=je(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,E=[];let q=!1;j({phase:"processing",stage:"reserving",step:1,total:s.length});try{const y=[];for(let m=0;m<s.length;m++){const x=s[m];j({phase:"processing",stage:"reserving",step:m+1,total:s.length});try{const M=x.acquisition==="trade"?x.trade.id:void 0,C=x.item.contractAddress&&x.item.itemId!=null?{contractAddress:x.item.contractAddress,itemId:String(x.item.itemId)}:void 0,{credit:U,maxCreditedValue:X}=await gt(n.identity,x.usdCents,M,C);u.push({salt:U.id,itemId:x.item.id}),y.push(x.acquisition==="store"?{kind:"store",item:{collection:x.item.contractAddress,itemId:String(x.item.itemId),priceWei:x.priceWei},credits:[U],maxCreditedValue:X,chainId:x.item.chainId}:{kind:"trade",trade:x.trade,credits:[U],maxCreditedValue:X})}catch(M){if(Ms(M)){if(u.length){try{await _e(n.identity,u.map(C=>C.salt))}catch(C){ae(C,{flow:"cart_checkout",step:"release"})}b.invalidateQueries({queryKey:["usd-balance"]})}Je(t);return}throw M}}h="submit";const g=ys(y).length,k=m=>g>1?{current:m,total:g}:void 0,F=(m,x)=>j({phase:"processing",stage:m,step:s.length,total:s.length,signatures:k(x)}),K=m=>m<g?F("awaiting-signature",m+1):F("settling",g);F("awaiting-signature",1);let f=[];const v=y.some(m=>m.kind==="store"),Q=y.flatMap(m=>m.kind==="trade"?[m]:[]);if(hs()&&!v)try{const m=new Map;f=await bs({purchases:Q,buyer:n.address,signer:n.signer,onSigned:()=>K(g),onBroadcast:({txHash:C,salts:U})=>{m.set(C,U),U.forEach(X=>w.add(X))}});const x=await Promise.allSettled(f.map(C=>vs(C)));x.forEach((C,U)=>{const X=m.get(f[U])??[];C.status==="fulfilled"?(X.forEach(Re=>$.add(Re)),E.push(f[U])):C.reason instanceof wt||X.forEach(Re=>_.add(Re))});const M=x.flatMap(C=>C.status==="rejected"?[C.reason]:[]);if(M.length&&!M.some(C=>C instanceof wt))throw M[0];q=!0}catch(m){if(!(m instanceof ws))throw m;f=await Le({purchases:y,buyer:n.address,signer:n.signer,onSigned:K,onBroadcast:({salts:x})=>x.forEach(M=>w.add(M)),onSettled:({txHash:x,salts:M})=>{M.forEach(C=>$.add(C)),E.push(x)},onReverted:({salts:x})=>x.forEach(M=>_.add(M))})}else f=await Le({purchases:y,buyer:n.address,signer:n.signer,onSigned:K,onBroadcast:({salts:m})=>m.forEach(x=>w.add(x)),onSettled:({txHash:m,salts:x})=>{x.forEach(M=>$.add(M)),E.push(m)},onReverted:({salts:m})=>m.forEach(x=>_.add(x))});t.forEach(m=>l(m.item.id)),O(null),G("Shop Completed Purchase",{...ye(d),payment_type:"credits",no_crypto_step:q,transaction_hash:f[0]??null}),vt(b);const de=oe.current;oe.current=null,j(null),B(!1);const Be={items:c,txHash:f[0]??void 0,txHashes:f,settled:!0,...de?{creditsAdded:de}:{}};ee("/success",{state:Be,replace:!0})}catch(y){be(y)||ae(y,{flow:"cart_checkout",step:h,cart_size:t.length});const g=new Set([...w].filter(v=>!_.has(v))),{toRelease:k,boughtItemIds:F}=Ct({reservations:u,spent:g,settled:$}),K=d.filter(v=>F.includes(v.id)),f=d.filter(v=>!F.includes(v.id));if(G(be(y)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:h,error_code:xt(y),value_usd:ht(f.reduce((v,Q)=>v+Q.priceCredits,0)),cart_size:s.length,partial:K.length>0}),k.length)try{await _e(n.identity,k)}catch(v){ae(v,{flow:"cart_checkout",step:"release"})}if(b.invalidateQueries({queryKey:["usd-balance"]}),K.length>0){F.forEach(v=>l(v)),O(null),vt(b),G("Shop Completed Purchase",{...ye(K),payment_type:"credits",no_crypto_step:q,transaction_hash:E[0]??null,partial:!0}),j({phase:"error",message:a("cart.error.partiallyBought")}),B(!1);return}j({phase:"error",message:Ke(y)})}}function Xe(t,s){b.invalidateQueries({queryKey:["usd-balance"]}),b.invalidateQueries({queryKey:["detail-trade"]}),b.invalidateQueries({queryKey:["shop-item"]}),b.invalidateQueries({queryKey:["owned-token"]}),b.invalidateQueries({queryKey:["public-token"]}),b.invalidateQueries({queryKey:["item-resales"]}),b.invalidateQueries({queryKey:["shop-items"]}),b.invalidateQueries({queryKey:["catalog-items"]}),b.invalidateQueries({queryKey:["my-assets"]}),b.invalidateQueries({queryKey:["purchases"]}),b.invalidateQueries({queryKey:["owned-item-count"]}),b.invalidateQueries({queryKey:["overview-listings"]}),b.invalidateQueries({queryKey:["upsell-listings"]});const d=oe.current;oe.current=null,j(null),B(!1);const c={items:t,txHash:s[0]??void 0,txHashes:s,settled:!0,...d?{creditsAdded:d}:{}};ee("/success",{state:c,replace:!0})}function Ze(t,s){be(t)||ae(t,{flow:s,step:"submit"}),G(be(t)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:xt(t)}),j({phase:"error",message:Ke(t)}),B(!1)}async function Yt(t,s){const d=ve(We.MANAToken,s),c=ve(We.CreditsManager,s);await ms({auth:{kind:fs.Allowance,contractAddress:d.address,spenderAddress:c.address,chainId:s},signer:t})}async function et(){if(re)return re;try{return await b.fetchQuery({queryKey:["mana-rate",pt.chainId],queryFn:()=>ya(pt.chainId),staleTime:6e4})}catch{return}}async function Jt(t){const s=je(t).reduce((h,w)=>h+w.usdCents,0),c=(ge??0n)>0n?await et():re,u=c?lt(s,c):0n;return{totalCents:s,manaWei:u}}async function tt(t,s){const d=Qe(t),{totalCents:c,manaWei:u}=await Jt(t),h=Fe({priceCents:c,priceManaWei:u,balanceCents:(S==null?void 0:S.balanceCents)??0,manaBalanceWei:ge??0n}),w=Ot(t)?{...h,options:h.options.filter($=>$.method==="credits")}:h;if(s&&w.options.some($=>$.method===s)){if(s==="credits"){Ee(t);return}const{spender:$,chainId:_}=at(s,t);await st($,_,()=>s==="mana"?void nt(t):void it(t,c,u));return}if(w.options.some($=>$.method==="mana"||$.method==="combined")){j({phase:"choose",lines:t,totalCents:c,manaWei:u}),B(!1);return}if(S!=null&&S.credits<d){Je(t);return}Ee(t)}function Xt(t){return Fe({priceCents:t.totalCents,priceManaWei:t.manaWei,balanceCents:(S==null?void 0:S.balanceCents)??0,manaBalanceWei:ge??0n})}const[qe,fe]=P.useState(null);function at(t,s){const d=Ae(s)[0].trade;return{spender:t==="mana"?ve(wa(d.contract),d.chainId).address:ve(We.CreditsManager,d.chainId).address,chainId:d.chainId}}async function st(t,s,d){const c=ps(s,t),u=n?await gs(c,n.address).catch(()=>!0):!0;if(xs(n==null?void 0:n.providerType,u)){B(!1),fe({auth:c,run:d});return}d()}function Zt(t){if((p==null?void 0:p.phase)!=="choose")return;const{lines:s,totalCents:d,manaWei:c}=p;if(t==="credits"){Ee(s);return}const{spender:u,chainId:h}=at(t,s);st(u,h,()=>t==="mana"?void nt(s):void it(s,d,c))}async function nt(t){if(!n||t.length===0)return;const s=je(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 ds({trades:Ae(s).map(w=>w.trade),buyer:n.address,signer:n.signer,onSigned:u});t.forEach(w=>l(w.item.id)),O(null),G("Shop Completed Purchase",{...ye(d),payment_type:"mana",transaction_hash:h[0]??null}),b.invalidateQueries({queryKey:["mana-balance"]}),Xe(c,h)}catch(h){Ze(h,"buy_cart_mana")}}async function it(t,s,d){if(!n||t.length===0)return;const c=je(t),u=c.map(g=>({...g.item,priceCredits:g.priceCredits})),h=t.map(g=>({...g.item,priceCredits:g.priceCredits,quantity:g.quantity})),w=ls(c.map(g=>g.usdCents),(S==null?void 0:S.balanceCents)??0),$=w.reduce((g,k)=>g+k,0),_=us(Math.max(0,s-$),s,d),E=[],q=new Set,y=new Set;j({phase:"processing",stage:"reserving",step:1,total:c.length});try{const g=Ae(c),k=[];for(let f=0;f<g.length;f++){const v=w[f];if(v<=0)continue;j({phase:"processing",stage:"reserving",step:f+1,total:g.length});const Q=g[f].item,{credit:de,maxCreditedValue:Be}=await gt(n.identity,v,g[f].trade.id,Q.contractAddress&&Q.itemId!=null?{contractAddress:Q.contractAddress,itemId:String(Q.itemId)}:void 0);E.push({salt:de.id,itemId:Q.id}),k.push({kind:"trade",trade:g[f].trade,credits:[de],maxCreditedValue:Be})}g.forEach((f,v)=>{w[v]<=0&&k.push({kind:"trade",trade:f.trade,credits:[],maxCreditedValue:"0"})}),k[0]={...k[0],maxCreditedValue:(BigInt(k[0].maxCreditedValue)+_).toString()},await Yt(n.signer,g[0].trade.chainId);const F=()=>j({phase:"processing",stage:"settling",step:c.length,total:c.length});j({phase:"processing",stage:"awaiting-signature",step:c.length,total:c.length});const K=await Le({purchases:k,buyer:n.address,signer:n.signer,onSigned:F,onBroadcast:({salts:f})=>f.forEach(v=>q.add(v)),onReverted:({salts:f})=>f.forEach(v=>y.add(v))});t.forEach(f=>l(f.item.id)),O(null),G("Shop Completed Purchase",{...ye(u),payment_type:"credits_and_mana",transaction_hash:K[0]??null}),b.invalidateQueries({queryKey:["mana-balance"]}),Xe(h,K)}catch(g){const{toRelease:k}=Ct({reservations:E,spent:new Set([...q].filter(F=>!y.has(F))),settled:new Set});k.length&&_e(n.identity,k).catch(()=>{}),E.length&&b.invalidateQueries({queryKey:["usd-balance"]}),Ze(g,"buy_cart_combined")}}async function te(t){if(!n){bt({type:"cart-checkout"}),L();return}const s=N.getState().items.filter(Ge);if(s.length===0)return;ie(null),pe(null),B(!0);const d=s.reduce((c,u)=>c+u.priceCredits*u.quantity,0);G("Shop Started Checkout",{cart_size:s.length,cart_value_credits:d,cart_value_usd:ht(d),has_sufficient_credits:xe>=d});try{const c=await ks(s,n.address,Vt,await et(),Gt),u=[...c.unavailable,...c.own];if(u.length&&(u.forEach(h=>l(h.id)),pe(qn(c))),c.buyable.length===0){ie(a("cart.error.noneAvailable")),O(null);return}if(c.orderChanged){O(c),He.current=Date.now();return}await tt(c.buyable,t)}catch(c){ae(c,{flow:"cart_checkout",step:"review",cart_size:s.length}),ie(Ke(c))}finally{B(!1)}}async function rt(){if(R){if(!n){bt({type:"cart-checkout"}),L();return}if(Date.now()-He.current>En){O(null),pe(null),await te();return}ie(null),tt(R.buyable)}}async function ea(){if(Te){try{sessionStorage.setItem(we,JSON.stringify(N.getState().items))}catch{}B(!0);try{const t=await Ss(Te,n?{address:n.address,identity:n.identity}:void 0);if(t.url){window.location.href=t.url;return}ee("/credits")}catch(t){try{sessionStorage.removeItem(we)}catch{}ae(t,{flow:"cart_buy_credits"}),j({phase:"error",message:a("buyModal.error.creditsCheckout")})}finally{B(!1)}}}const ot=P.useRef(!1);P.useEffect(()=>{if(!n||ot.current||!is("cart-checkout"))return;ot.current=!0;const t=setTimeout(()=>void te(),0);return()=>clearTimeout(t)},[n]);const ct=P.useRef(!1);P.useEffect(()=>{if(!(J!=null&&J.resumeCheckout)||ct.current)return;ct.current=!0,oe.current=J.creditsAdded??null;try{const s=sessionStorage.getItem(we);if(s){sessionStorage.removeItem(we);const d=JSON.parse(s);Array.isArray(d)&&d.length&&D(d)}}catch{}b.invalidateQueries({queryKey:["usd-balance"]});const t=setTimeout(()=>void te(),0);return()=>clearTimeout(t)},[J==null?void 0:J.resumeCheckout]);const V=Ft||(p==null?void 0:p.phase)==="processing";return o.length===0&&!p?e.jsx(jt,{children:e.jsxs(St,{children:[e.jsxs(kt,{onClick:()=>ee(-1),type:"button",children:[e.jsx(H,{name:"arrow-left"}),a("nav.cart")]}),e.jsxs(Qs,{"data-testid":"cart-empty",children:[e.jsx(H,{name:"cart-plus",size:110}),e.jsxs(Us,{children:[e.jsx(Ns,{children:a("cart.empty.title")}),e.jsx(Hs,{children:a("cart.empty.body")})]}),e.jsx(Os,{to:"/items",children:a("cart.empty.cta")})]})]})}):e.jsxs(jt,{children:[e.jsxs(St,{children:[e.jsxs(kt,{onClick:()=>ee(-1),type:"button",children:[e.jsx(H,{name:"arrow-left"}),a("nav.cart")]}),e.jsxs(Fs,{children:[e.jsxs(Ls,{children:[e.jsxs(Ks,{children:[e.jsx(Vs,{onClick:()=>ee(-1),type:"button","aria-label":a("cart.goBack"),children:e.jsx(H,{name:"arrow-left"})}),e.jsx(Gs,{children:a("cart.panelTitle",{count:Kt})}),_t?e.jsxs(Ds,{onClick:()=>Y(!0),disabled:V,children:[e.jsx(H,{name:"fitting-room"}),a("cart.fittingRoom")]}):null]}),e.jsxs(At,{children:[e.jsx(Ys,{children:o.map(t=>{const s=Nt.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),E=!!_&&!!A[_],q=xa(t),y=Ve[t.id],g=!ut(y),k=y==="sold-out"?a("cart.availability.soldOut"):a("cart.availability.unavailable");return e.jsxs(Js,{"data-unavailable":g||void 0,children:[e.jsxs(Xs,{"data-thumb":!0,children:[q?e.jsx(Zs,{to:q,state:{item:t,tradeId:t.tradeId},"aria-label":t.name,children:t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:t.name}):null}):t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:t.name}):null,e.jsx(en,{"data-check":!0,"aria-hidden":!0,children:e.jsx("svg",{viewBox:"0 0 20 20",width:"12",height:"12",children:e.jsx("path",{d:"M5 10.5l3 3 7-7.5",fill:"none",stroke:"#fff",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),e.jsxs(tn,{children:[e.jsxs(an,{"data-desc":!0,children:[q?e.jsx(nn,{to:q,state:{item:t,tradeId:t.tradeId},title:t.name,children:t.name}):e.jsx(sn,{title:t.name,children:t.name}),t.creator?e.jsx(rn,{address:t.creator,linkToProfile:!0}):null,Rt&&u?e.jsxs(fn,{"data-testid":"cart-creator-tag",children:[e.jsx(yn,{name:"buy-from-creator"}),a("cart.creatorTag")]}):null]}),e.jsx(on,{children:g?e.jsxs(e.Fragment,{children:[e.jsxs(gn,{children:[e.jsx(xn,{name:"warning-fill",size:24}),k]}),q?e.jsx(mn,{to:q,state:{item:t,tradeId:t.tradeId},children:a("cart.availability.viewResales")}):null]}):e.jsxs(e.Fragment,{children:[u?e.jsxs(cn,{children:[e.jsx($t,{onClick:()=>me(()=>z(t.id)),disabled:V||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(dn,{children:h}),e.jsx($t,{onClick:()=>me(()=>I(t.id)),disabled:V||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(ln,{children:[e.jsx(un,{})," ",$,c?e.jsx(hn,{children:t.priceCredits*h}):null]})]})})]}),e.jsxs(pn,{children:[_?e.jsx(bn,{"data-on":E||void 0,onClick:()=>ne(t),"aria-label":E?a("cart.removeFromFavorites",{name:t.name}):a("cart.addToFavorites",{name:t.name}),title:E?a("assetCard.removeFromFavorites"):a("assetCard.addToFavorites"),children:e.jsx(H,{name:E?"heart-solid":"heart"})}):null,e.jsx(vn,{onClick:()=>me(()=>l(t.id)),disabled:V,"aria-label":a("cart.remove",{name:t.name}),title:a("cart.removeTitle"),children:e.jsx(H,{name:"trash",size:24})})]})]},t.id)})}),e.jsx(wn,{children:e.jsx("button",{className:"link",onClick:()=>me(W),disabled:V,children:a("cart.clearCart")})})]})]}),e.jsxs(Cn,{children:[e.jsx(jn,{children:a("cart.purchaseSummary")}),e.jsxs(kn,{children:[e.jsxs(Sn,{children:[e.jsx($n,{children:a("cart.totalItems",{count:Qt})}),e.jsx(Tn,{children:e.jsxs(Mn,{children:[e.jsx(In,{})," ",De]})})]}),ce.options.length>0||ce.manaShortfall?e.jsx(Tt,{options:ce.options,totalCents:ze,shortfall:ce.manaShortfall,showCreditsAmount:!1,creditsLabel:R?a("marketCheckout.confirmPurchase"):ce.options.length>1?a("cart.buyWithCredits"):a("cart.checkout"),busy:V||Pe,onPay:t=>void(R?rt():te(t))}):e.jsx(Pn,{onClick:()=>void(R?rt():te()),disabled:V||Pe,children:V?a("cart.working"):R?a("marketCheckout.confirmPurchase"):a("cart.checkout")}),Pe?e.jsx(Ce,{className:"muted",children:a("cart.allUnavailable")}):null,n?null:e.jsx(Ce,{className:"muted",children:a("cart.signInHint")}),R?e.jsx(Ce,{className:"muted",children:a("cart.priceChanged")}):null,Ne?e.jsx(Ce,{className:"muted",children:Ne}):null,e.jsx(zn,{message:Wt})]})]})]})]}),Ye.length>0?e.jsx(An,{children:e.jsx(rs,{title:a("cart.youMightAlsoLike"),items:Ye})}):null,qe&&n?e.jsx(os,{auth:qe.auth,signer:n.signer,title:a("authorizeStep.manaTitle"),name:a("authorizeStep.manaName"),reason:a("authorizeStep.manaReason"),icon:e.jsx("img",{src:cs,width:24,height:24,alt:"","aria-hidden":!0}),onAuthorized:()=>{const{run:t}=qe;fe(null),t()},onCancel:()=>fe(null),onClose:()=>fe(null)}):null,p?e.jsx(Rs,{phase:p.phase,balanceCredits:xe,onClose:Dt,stage:p.phase==="processing"?p.stage:void 0,step:p.phase==="processing"?p.step:void 0,total:p.phase==="processing"?p.total:void 0,isSelfCustody:ma(n==null?void 0:n.providerType),signatures:p.phase==="processing"?p.signatures:void 0,options:p.phase==="choose"?Xt(p).options:void 0,onPay:Zt,totalCents:p.phase==="choose"?p.totalCents:void 0,totalManaWei:p.phase==="choose"?p.manaWei:void 0,totalCredits:p.phase==="choose"?Qe(p.lines):void 0,lines:p.phase==="nofunds"?p.lines:void 0,shortfallCredits:p.phase==="nofunds"?p.shortfall:void 0,packs:he,selectedPack:Te,onSelectPack:Oe,onBuyPacks:()=>void ea(),message:p.phase==="error"?p.message:void 0,onRetry:()=>void te()}):null]})}export{Yn as Cart};
|