@dcl/shop 0.10.1-31029565525.commit-8eeaa8f → 0.10.1-31032606668.commit-30914a5

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.
Files changed (180) hide show
  1. package/_assets/{Activity-BnUTRccC.js → Activity-CBQ0_5Gp.js} +3 -3
  2. package/_assets/{AnimatedBackground-CFxGJrvr.js → AnimatedBackground-DzU3vjuD.js} +1 -1
  3. package/_assets/{Assets-DKArlsdV.js → Assets-Bm8xT-wK.js} +48 -48
  4. package/_assets/{Assets.styles-Crxo5ZgZ.js → Assets.styles-D_DUFdKV.js} +56 -56
  5. package/_assets/{Authorizations-BVsBhVRE.js → Authorizations-YCl9mcd9.js} +1 -1
  6. package/_assets/{Cart-DGWIQa7u.js → Cart-BRPkkQw3.js} +13 -13
  7. package/_assets/{CircularProgress-C2EMA-WY.js → CircularProgress-BvMoYOvy.js} +1 -1
  8. package/_assets/Collection-D7bUo9dI.js +162 -0
  9. package/_assets/{CollectionCarousel-BfWdU9TS.js → CollectionCarousel-Bs4fBuN6.js} +18 -18
  10. package/_assets/{Confetti-2clep845.js → Confetti-Bf7aP0NE.js} +1 -1
  11. package/_assets/Creator-DctbYEDT.js +306 -0
  12. package/_assets/{ErrorNotice-DuUZx_7m.js → ErrorNotice-BU7FyT1W.js} +1 -1
  13. package/_assets/{ExchangeController-d78CG8uk.js → ExchangeController-D7v6FLdb.js} +1 -1
  14. package/_assets/{Faq-CD5Cn1w0.js → Faq-DBZpkL9P.js} +1 -1
  15. package/_assets/{GetCredits-DByVocxz.js → GetCredits-DEsgS54C.js} +14 -14
  16. package/_assets/{Grow-pVAVq4p8.js → Grow-GSOfEN2l.js} +1 -1
  17. package/_assets/{HelpersUtil-OmexlG_i.js → HelpersUtil-CkBhbL_r.js} +1 -1
  18. package/_assets/{ItemDetail-BB7--DmF.js → ItemDetail-B3yupLtb.js} +209 -209
  19. package/_assets/LazyEmoteControls-DLcKgwgu.js +2 -0
  20. package/_assets/{LoadMore-Bka3px9r.js → LoadMore-i3u3Pyt6.js} +1 -1
  21. package/_assets/{ManaPricingBanner.styles-05aOeHWK.js → ManaPricingBanner.styles-C18BesFl.js} +1 -1
  22. package/_assets/MyAssets-C-lv91w7.js +381 -0
  23. package/_assets/{MyFavorites-CdmRx3i0.js → MyFavorites-U-UxHb-o.js} +2 -2
  24. package/_assets/{NotFound-Cv_WsqDu.js → NotFound-DkcTAlkz.js} +1 -1
  25. package/_assets/{NotificationsBell-B_4w5VLE.js → NotificationsBell-DDCAY3l-.js} +1 -1
  26. package/_assets/{OutfitDetail-BlE4dNxL.js → OutfitDetail-BFmRzzjx.js} +4 -4
  27. package/_assets/{OutfitPreview-BjiO0VsO.js → OutfitPreview-DPS3H3_3.js} +2 -2
  28. package/_assets/{OutfitStudio-D9LQ_WGt.js → OutfitStudio-CrgVuCXP.js} +59 -59
  29. package/_assets/{StoreSettings-DpevQbL3.js → StoreSettings-BLndphwX.js} +43 -43
  30. package/_assets/Success-BY9OhkKm.js +280 -0
  31. package/_assets/{SwapController-BCq8cczu.js → SwapController-DXYjEOyv.js} +1 -1
  32. package/_assets/{Tooltip-BSg8PAuJ.js → Tooltip-BajbwTea.js} +1 -1
  33. package/_assets/{TradeService-DnRblc5X.js → TradeService-Cv02JkEQ.js} +1 -1
  34. package/_assets/{W3MFrameProviderSingleton-BkgMeT5j.js → W3MFrameProviderSingleton-A5mBxhYF.js} +3 -3
  35. package/_assets/{WebCryptoP256-5hLL6y4k.js → WebCryptoP256-CnQALEMv.js} +1 -1
  36. package/_assets/{authorizations-BZabD414.js → authorizations-Xqbnmu9x.js} +1 -1
  37. package/_assets/{basic-CID-Qs3b.js → basic-CvPWviGS.js} +1 -1
  38. package/_assets/{biconomy-BWK8rG_e.js → biconomy-glo4y4ek.js} +1 -1
  39. package/_assets/{builder-C0HXHDnK.js → builder-BqnhdDxo.js} +1 -1
  40. package/_assets/{buy-DMMwBXQK.js → buy-Cq5r6s_d.js} +1 -1
  41. package/_assets/{buy-gasless-DkT1GvmP.js → buy-gasless-CaSmt8Rn.js} +1 -1
  42. package/_assets/{categories-LpPpJwMX.js → categories-Cc9LF1R4.js} +44 -50
  43. package/_assets/{ccip-CmVA7LRy.js → ccip-DtPCxwhK.js} +1 -1
  44. package/_assets/{ccip-CTHaF-0F.js → ccip-HLzoBWhd.js} +1 -1
  45. package/_assets/{collectionPage.styles-C0OU97Vl.js → collectionPage.styles-rLItNGdu.js} +2 -2
  46. package/_assets/{controller-BSCAkC53.js → controller-DLVCl98j.js} +2 -2
  47. package/_assets/{core-BY58gAaC.js → core-BoCM39Dc.js} +4 -4
  48. package/_assets/{createSvgIcon-Co2I3KNE.js → createSvgIcon-CF6VIRxG.js} +1 -1
  49. package/_assets/{custom-BFUJnR6C.js → custom-BQJpm4NP.js} +1 -1
  50. package/_assets/{data-capture-BcT9TYL5.js → data-capture-CPxjWW7W.js} +1 -1
  51. package/_assets/{email-zKJhfKOQ.js → email-DglJsBXd.js} +1 -1
  52. package/_assets/{embedded-wallet-DZzfkRu7.js → embedded-wallet-CRWhciW5.js} +1 -1
  53. package/_assets/{emotion-styled.browser.esm-dvplhB66.js → emotion-styled.browser.esm-BATaYRNB.js} +1 -1
  54. package/_assets/{engine-B3Mf1brx.js → engine-CRPW7FqE.js} +1 -1
  55. package/_assets/{errors-BGVCQOMz.js → errors-D4C9kv7B.js} +1 -1
  56. package/_assets/{estimate-l1-fee-DMFrbofF.js → estimate-l1-fee-aOXZ8ihZ.js} +1 -1
  57. package/_assets/{execute-DCGV6tDo.js → execute-k2RZ2hTw.js} +2 -2
  58. package/_assets/{features-DqHFEBDx.js → features-BmdkdPP-.js} +1 -1
  59. package/_assets/{fetchTokenMetadata-D6K4KP_4.js → fetchTokenMetadata-Bmcczr66.js} +2 -2
  60. package/_assets/{field.styles-DcKQ_iNz.js → field.styles-DQVBZTuq.js} +1 -1
  61. package/_assets/{get-ecosystem-wallet-info-D6HzrmoJ.js → get-ecosystem-wallet-info-BbJRcc1t.js} +1 -1
  62. package/_assets/{getBalance-LGdYuyxa.js → getBalance-DC-t3UhM.js} +1 -1
  63. package/_assets/{getNFT-Cw0O3Ml9.js → getNFT-BlzNSmnK.js} +1 -1
  64. package/_assets/{getNFT-CuZyZceA.js → getNFT-DwruUWap.js} +1 -1
  65. package/_assets/{grid.styles-BoDTH9-L.js → grid.styles-2-Lphh1_.js} +1 -1
  66. package/_assets/{hashTypedData-CM__DDH2.js → hashTypedData-BLMgL5Vz.js} +1 -1
  67. package/_assets/{hashTypedData-qqC1Tbni.js → hashTypedData-D6ew3JpS.js} +1 -1
  68. package/_assets/{in-app-BwohLVFE.js → in-app-BRl8aLUS.js} +1 -1
  69. package/_assets/{in-app-wallet-calls-DkQZMb0p.js → in-app-wallet-calls-Cf8UnG06.js} +1 -1
  70. package/_assets/{index-D8uSGtoz.js → index-B2N5oNn8.js} +1 -1
  71. package/_assets/{index-DplFHsVz.js → index-BBOn5orP.js} +1 -1
  72. package/_assets/{index-CRUz-lFa.js → index-BD25cQD4.js} +1 -1
  73. package/_assets/{index-C4OULSnf.js → index-BDzGigH2.js} +1 -1
  74. package/_assets/{index-txSbIXUX.js → index-BISFLA3c.js} +1 -1
  75. package/_assets/{index-DY-CJBBw.js → index-BJovGEvB.js} +1 -1
  76. package/_assets/{index-CwEAusBk.js → index-BKj0f9wi.js} +1 -1
  77. package/_assets/{index-BeHXNx4l.js → index-BTkQgQDi.js} +1 -1
  78. package/_assets/{index-BHs8Nm1v.js → index-BXzvQW0o.js} +1 -1
  79. package/_assets/{index-jQ98hJsI.js → index-BZL5qpA4.js} +2 -2
  80. package/_assets/{index-BOCGS4MY.js → index-B_PIYV8c.js} +2 -2
  81. package/_assets/{index-BDKp6O92.js → index-BelRIVeb.js} +1 -1
  82. package/_assets/{index-BSioXpnp.js → index-BkspOCIc.js} +1 -1
  83. package/_assets/{index-unjRyi-x.js → index-Bq_9XM9n.js} +1 -1
  84. package/_assets/{index-CVEw6hKC.js → index-C-WOsJGb.js} +1 -1
  85. package/_assets/{index-CvJmHkgv.js → index-C0tIouBf.js} +3 -3
  86. package/_assets/{index-DVP9mmy0.js → index-C6G5Ojpz.js} +1 -1
  87. package/_assets/{index-MhPhsWP8.js → index-C7hGN0lI.js} +1 -1
  88. package/_assets/{index-CFjdvXcL.js → index-CBe4gtAt.js} +2 -2
  89. package/_assets/{index-DOmua37r.js → index-CFypPkBr.js} +1 -1
  90. package/_assets/{index-dguKxdA7.js → index-CHb52k2r.js} +2 -2
  91. package/_assets/{index-DnafkRIs.js → index-CN8WHGrH.js} +1 -1
  92. package/_assets/{index-CDV3IoQm.js → index-COY9dHV9.js} +1 -1
  93. package/_assets/{index-DqogjYMl.js → index-CPTPmsi2.js} +1 -1
  94. package/_assets/{index-CM4gYpZ8.js → index-CPhcLOEq.js} +1 -1
  95. package/_assets/{index-Dg22Nieo.js → index-Ch87wzNg.js} +1 -1
  96. package/_assets/index-CqRUWZDq.js +1 -0
  97. package/_assets/{index-Dij6LJf6.js → index-CuSvjeNM.js} +1 -1
  98. package/_assets/{index-BLKe1fxG.js → index-CwFxxSc1.js} +299 -299
  99. package/_assets/{index-CRd1XuYs.js → index-CwKi0BcO.js} +1 -1
  100. package/_assets/{index-B9zvMdI0.js → index-CxTgEmAp.js} +1 -1
  101. package/_assets/{index-BPqobsB6.js → index-CyQd3Dif.js} +1 -1
  102. package/_assets/{index-BRZA_fuK.js → index-D7TrWXvV.js} +1 -1
  103. package/_assets/{index-BSFFapHO.js → index-DCZ36akI.js} +1 -1
  104. package/_assets/{index-CCenxE7k.js → index-DFNARVN7.js} +1 -1
  105. package/_assets/{index-Bo-edPJM.js → index-DGXzZsJb.js} +1 -1
  106. package/_assets/{index-CSHbp-r-.js → index-DKKo0LoX.js} +11 -11
  107. package/_assets/{index-MuXfi5UE.js → index-DOGInGKk.js} +1 -1
  108. package/_assets/{index-BsgL3ujL.js → index-DQ1Y3Whz.js} +1 -1
  109. package/_assets/{index-BzVWz4Tj.js → index-DRKYu1B3.js} +1 -1
  110. package/_assets/{index-DlhJ9Qox.js → index-DRyHPso7.js} +1 -1
  111. package/_assets/{index-UR9Qpju9.js → index-DSJJjIyM.js} +3 -3
  112. package/_assets/{index-B-2CvxPO.js → index-DSQSVjLs.js} +1 -1
  113. package/_assets/{index-CVIbA-VT.js → index-DdL-MVH6.js} +1 -1
  114. package/_assets/{index-CTenZZ8l.js → index-DgkGEui6.js} +1 -1
  115. package/_assets/{index-LP5Of-SX.js → index-Sn4izkWE.js} +1 -1
  116. package/_assets/index-UdM3HuhV.js +1 -0
  117. package/_assets/{index-CWhL4zBo.js → index-e3mxlGeM.js} +1 -1
  118. package/_assets/{index-Bo5HGYUE.js → index-fRwny2zx.js} +1 -1
  119. package/_assets/{index-0DS7nWrl.js → index-fvtPPVdt.js} +1 -1
  120. package/_assets/{index-ShFdgjrK.js → index-j8jUDLYS.js} +1 -1
  121. package/_assets/{index-BBrm4kwZ.js → index-rj2Zyfmj.js} +3 -3
  122. package/_assets/{index.es-WFmF4El-.js → index.es-C7evsiQb.js} +4 -4
  123. package/_assets/{index.es-CM1g4yN5.js → index.es-DF_rXR3Q.js} +1 -1
  124. package/_assets/{index.es-C61rbBYw.js → index.es-DYP1_xK_.js} +1 -1
  125. package/_assets/{localBatchGatewayRequest-DGjQ1weV.js → localBatchGatewayRequest-BXykDIjc.js} +1 -1
  126. package/_assets/{networks-C1UzX1Sm.js → networks-DKlZyT-L.js} +1 -1
  127. package/_assets/{onramp-Fd2Cj3wL.js → onramp-ByQtA-xO.js} +1 -1
  128. package/_assets/{openzeppelin-BYo8OyKm.js → openzeppelin-CroDtw4s.js} +1 -1
  129. package/_assets/{parseNft-Gein49L0.js → parseNft-BH0wDTt0.js} +2 -2
  130. package/_assets/{parseSignature-k67zYFy4.js → parseSignature-DgaK7Nqy.js} +1 -1
  131. package/_assets/{parseSignature-DaGe9UWu.js → parseSignature-VSsiOnpe.js} +3 -3
  132. package/_assets/{passkeys-D3J4DzgH.js → passkeys-C1oIb99i.js} +1 -1
  133. package/_assets/{pay-with-exchange-CbWF1HDJ.js → pay-with-exchange-CttWQzQs.js} +1 -1
  134. package/_assets/{qr-overlay-nWKGC2_v.js → qr-overlay-DHUyjo36.js} +1 -1
  135. package/_assets/{receive-bg6fMaP3.js → receive-BKxXWv2t.js} +1 -1
  136. package/_assets/{resolveImplementation-3oaoK01c.js → resolveImplementation-X7KhKw3S.js} +1 -1
  137. package/_assets/{rpc-BohETOPd.js → rpc-CLJ9sbD8.js} +1 -1
  138. package/_assets/{secp256k1-DDb2NhqN.js → secp256k1-Cbp19gqh.js} +1 -1
  139. package/_assets/{secp256k1-DTNpVYCz.js → secp256k1-DPi4cvKJ.js} +1 -1
  140. package/_assets/{secp256k1-C-hoA_Tn.js → secp256k1-DxA18vH5.js} +1 -1
  141. package/_assets/{send-CmaFLfs9.js → send-EgTowmAZ.js} +1 -1
  142. package/_assets/{send-batch-transaction-BGvy0zyD.js → send-batch-transaction-wEk0AI7v.js} +1 -1
  143. package/_assets/{send-eip712-transaction-hYvHM7vZ.js → send-eip712-transaction-BBM2idYc.js} +2 -2
  144. package/_assets/{send-gasless-transaction-QyhmnHZB.js → send-gasless-transaction-UdxWKrE2.js} +2 -2
  145. package/_assets/{send-transaction-CtZe85mL.js → send-transaction-DEvt9fmJ.js} +2 -2
  146. package/_assets/{sendMetaTransaction-C5SAvbei.js → sendMetaTransaction-BYbBPih_.js} +1 -1
  147. package/_assets/{sendRawTransaction-B2WHhB1D.js → sendRawTransaction-D5OSt6IO.js} +3 -3
  148. package/_assets/{serializeTransaction-BwuobXgs.js → serializeTransaction-Blc5JuIS.js} +1 -1
  149. package/_assets/{session-proposal-pdBgnfq3.js → session-proposal-BOLRFjK9.js} +1 -1
  150. package/_assets/{session-request-DVhv1Cj8.js → session-request-CRjXklwV.js} +2 -2
  151. package/_assets/{signing-BRSDIb8-.js → signing-B3rrMiJs.js} +3 -3
  152. package/_assets/skeleton.styles-D3iPDKdT.js +7 -0
  153. package/_assets/{socials-D7ScJClR.js → socials-QIa2OQ6D.js} +1 -1
  154. package/_assets/{styled-CrSAMFFb.js → styled-CMJUrQY2.js} +1 -1
  155. package/_assets/{swaps-wmzxaVLP.js → swaps-DIftYDvd.js} +1 -1
  156. package/_assets/{thirdweb-WdIIt1R4.js → thirdweb-C0YKMkrc.js} +3 -3
  157. package/_assets/{to-serializable-transaction-Dcp4UJq5.js → to-serializable-transaction-Cjnw6yJ0.js} +2 -2
  158. package/_assets/{transactionReceipt-CX5pZ3y-.js → transactionReceipt-BCryC1fM.js} +1 -1
  159. package/_assets/{transactions-CP64yjJv.js → transactions-p19NlOdG.js} +1 -1
  160. package/_assets/{useCreditPacks-BtlA3bsY.js → useCreditPacks-DL0joeDc.js} +1 -1
  161. package/_assets/{useImportable-30ssdgwW.js → useImportable-CXGXlKVj.js} +1 -1
  162. package/_assets/{useInfiniteGrid-DwOzTLpA.js → useInfiniteGrid-DCnfT2gg.js} +1 -1
  163. package/_assets/{useTheme-BTDb7mvT.js → useTheme-vYv6two9.js} +1 -1
  164. package/_assets/{verifyHash-C6FN0xpS.js → verifyHash-Dnb3FmXs.js} +1 -1
  165. package/_assets/{w3m-modal-Bq0A97y3.js → w3m-modal-BPKpwX5-.js} +1 -1
  166. package/_assets/{w3m-modal-DoKC93v3.js → w3m-modal-CQfqosvf.js} +1 -1
  167. package/_assets/{wait-for-tx-receipt-25yHA4Ha.js → wait-for-tx-receipt-H6RTv4Cw.js} +1 -1
  168. package/_assets/{wallets-CLLcXEAl.js → wallets-C2vtueR8.js} +5 -5
  169. package/_assets/{web-connector-CXNgxhSL.js → web-connector-Cc4ShgT6.js} +3 -3
  170. package/_assets/{writeContract-78bJpqls.js → writeContract-B_DvmCjk.js} +1 -1
  171. package/_assets/{zoraTestnet-CNk9bURD.js → zoraTestnet-TFaEQBOe.js} +1 -1
  172. package/index.html +11 -11
  173. package/package.json +2 -2
  174. package/_assets/Collection-D6DIMkEd.js +0 -162
  175. package/_assets/Creator-k4PUSiKV.js +0 -306
  176. package/_assets/LazyEmoteControls-CtiNE6Cc.js +0 -2
  177. package/_assets/MyAssets-_v0xxc8e.js +0 -381
  178. package/_assets/Success-rROJaYNs.js +0 -280
  179. package/_assets/index-CLm02-HM.js +0 -1
  180. package/_assets/index-zCa2boac.js +0 -1
@@ -1,4 +1,4 @@
1
- import{j as e,L as Se,r as P,b as Zt,a as ea}from"./react-BYHuwl8r.js";import{t as le,s as i,b as a,L as de,ba as ta,J as aa,I as H,z as St,K as Ke,x as sa,X as Q,am as ot,o as na,q as ia,v as ra,bb as oa,A as ca,bc as da,an as la,bd as ua,be as ct,bf as ha,bg as pa,y as ga,bh as dt,Z as G,bi as lt,bj as xa,F as ae,r as ma,c as ut,bk as fa,C as ya,bl as ht,bm as Be,bn as ba,bo as fe,bp as ye,bq as pt,g as be,f as va,h as Re,br as wa}from"./index-BLKe1fxG.js";import{M as Ca,S as ja,C as ka,H as Sa,a as $a,T as Ma,X as Ta,b as Ia,B as Pa,c as za,d as gt,e as Aa,f as je,P as $t,m as Ea,g as qa,h as Ba,i as Ra,j as Mt,k as ke,L as _a,l as Wa,n as xt,o as mt,W as Fa,p as La,q as Ka,A as Ua,r as Na,s as Qa,t as Ha,u as Oa,v as Va,w as Ga,x as Da,y as Ya,z as Ja,D as Xa,E as Za,F as es,G as ts,I as as,J as ss,K as _e,N as ns,O as is,Q as rs,R as os,U as ft,V as yt,Y as cs,Z as ds,_ as ls}from"./CollectionCarousel-BfWdU9TS.js";import{k as us,l as hs,a as ps,n as gs,f as xs,A as ms}from"./authorizations-BZabD414.js";import{g as fs,j as We}from"./buy-DMMwBXQK.js";import{b as ys,w as bs,S as bt,G as vs}from"./buy-gasless-DkT1GvmP.js";import{u as ws,M as Cs,R as ve,r as js,c as ks,p as vt}from"./useCreditPacks-BtlA3bsY.js";import{i as Ss,a as $s}from"./errors-BGVCQOMz.js";import{E as Ms}from"./ErrorNotice-DuUZx_7m.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-C5SAvbei.js";const{colors:se,radius:Ts}=le,Is=i.div`
1
+ import{j as e,L as $e,r as P,b as Zt,a as ea}from"./react-BYHuwl8r.js";import{t as le,s as i,b as a,L as de,bb as ta,J as aa,I as H,z as $t,K as Ke,x as sa,Y as Q,an as ot,o as na,q as ia,v as ra,bc as oa,A as ca,bd as da,ao as la,be as ua,bf as ct,bg as ha,bh as pa,y as ga,bi as dt,$ as G,bj as lt,bk as xa,F as ae,r as ma,c as ut,bl as fa,C as ya,bm as ht,bn as Be,bo as ba,bp as fe,bq as ye,br as pt,g as be,f as va,h as Re,bs as wa}from"./index-CwFxxSc1.js";import{M as Ca,S as ja,C as ka,H as $a,a as Sa,T as Ma,X as Ta,b as Ia,B as Pa,c as za,d as gt,e as Aa,f as je,P as St,m as Ea,g as qa,h as Ba,i as Ra,j as Mt,k as ke,L as _a,l as Wa,n as xt,o as mt,W as Fa,p as La,q as Ka,A as Ua,r as Na,s as Qa,t as Ha,u as Oa,v as Va,w as Ga,x as Ya,y as Da,z as Ja,D as Xa,E as Za,F as es,G as ts,I as as,J as ss,K as _e,N as ns,O as is,Q as rs,R as os,U as ft,V as yt,Y as cs,Z as ds,_ as ls}from"./CollectionCarousel-Bs4fBuN6.js";import{k as us,l as hs,a as ps,n as gs,f as xs,A as ms}from"./authorizations-Xqbnmu9x.js";import{g as fs,j as We}from"./buy-Cq5r6s_d.js";import{b as ys,w as bs,S as bt,G as vs}from"./buy-gasless-CaSmt8Rn.js";import{u as ws,M as Cs,R as ve,r as js,c as ks,p as vt}from"./useCreditPacks-DL0joeDc.js";import{i as $s,a as Ss}from"./errors-D4C9kv7B.js";import{E as Ms}from"./ErrorNotice-BU7FyT1W.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-BYbBPih_.js";const{colors:se,radius:Ts}=le,Is=i.div`
2
2
  display: flex;
3
3
  align-items: center;
4
4
  justify-content: center;
@@ -58,7 +58,7 @@ import{j as e,L as Se,r as P,b as Zt,a as ea}from"./react-BYHuwl8r.js";import{t
58
58
  font-weight: 700;
59
59
  color: ${se.text};
60
60
  }
61
- `,qs="https://cdn.decentraland.org/@dcl/shop/0.10.1-31029565525.commit-8eeaa8f/_assets/buy-error-22UunaPC.png";function Bs(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(Ca,{role:"dialog","aria-modal":"true","aria-label":a("cartCheckout.dialogAria"),children:[e.jsx(ja,{onClick:W?void 0:z,"aria-hidden":!0}),e.jsxs(ka,{"data-tall":Y||void 0,children:[e.jsxs(Sa,{children:[e.jsxs($a,{children:[e.jsx(Ma,{children:D}),!W&&e.jsx(Ta,{onClick:z,"aria-label":a("buyModal.close"),children:e.jsx(Ia,{})})]}),e.jsxs(Pa,{children:[e.jsx(za,{children:l==="nofunds"?a("buyModal.dclBalance"):a("buyModal.myCreditsBalance")}),e.jsx(gt,{}),e.jsx(Aa,{children:de(I)})]})]}),l==="choose"&&e.jsxs(je,{children:[e.jsxs(Es,{children:[e.jsx("span",{children:a("cart.purchaseSummary")}),e.jsxs("strong",{children:[e.jsx(gt,{}),de(o.totalCredits??0)]})]}),e.jsx($t,{options:o.options??[],totalCents:o.totalCents??0,onPay:o.onPay??(()=>{}),rateNote:(()=>{const A=Ea(o.totalCents??0,o.totalManaWei??0n);return A!=null?a("buyModal.manaRate",{mana:A.toLocaleString("en",{maximumFractionDigits:2})}):null})()})]}),l==="processing"&&e.jsx(Rs,{stage:o.stage??"reserving",step:o.step??1,total:o.total??1,isSelfCustody:!!o.isSelfCustody,signatures:o.signatures}),l==="nofunds"&&e.jsx(_s,{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(je,{children:[e.jsxs(qa,{"data-testid":"buy-error",children:[e.jsx(Ba,{src:qs,alt:"",width:64,height:80}),e.jsxs(Ra,{children:[e.jsx("b",{children:a("cartCheckout.errorHeadline")})," ",o.message??a("cartCheckout.errorBody")]})]}),e.jsxs(Mt,{children:[e.jsx(ke,{"data-variant":"outline",onClick:z,children:a("buyModal.cancel")}),e.jsx(ke,{"data-variant":"purple",onClick:o.onRetry??z,children:a("cartCheckout.tryAgain")})]})]})]})]})}function Rs({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(je,{"data-processing":!0,children:[e.jsx(_a,{src:ta,alt:"",width:61,height:61}),e.jsx(Wa,{children:ne}),D?e.jsxs(Is,{children:[e.jsx(xt,{"aria-hidden":!0,children:e.jsx(mt,{"data-step":!0,style:{width:`${Y}%`}})}),I>1?e.jsxs(Ps,{children:[l,"/",I]}):null]}):e.jsx(xt,{"aria-hidden":!0,children:e.jsx(mt,{})})]})}function _s({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(je,{children:[e.jsxs(Fa,{"data-testid":"nofunds-warning",children:[e.jsx(La,{}),e.jsxs(Ka,{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(zs,{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(Qa,{children:[e.jsxs("div",{children:[e.jsxs(Ha,{title:n.item.name,children:[n.item.name||a("buyModal.itemFallback"),L>1?e.jsx(As,{children:a("cartCheckout.qty",{count:L})}):null]}),n.item.creator?e.jsx(Oa,{address:n.item.creator}):null]}),e.jsxs(Va,{children:[e.jsx(Ga,{}),e.jsx("span",{children:de(n.priceCredits*L)})]})]})]},n.item.id)})}),e.jsx(Da,{children:I.map(n=>{const L=n.id===z;return e.jsxs(Ya,{"data-testid":"credit-pack","data-on":L||void 0,onClick:()=>W(n.id),children:[e.jsx(Ja,{}),e.jsx(Xa,{children:de(n.credits)}),e.jsxs(Za,{children:["($",n.usd.toFixed(2),")"]})]},n.id)})}),e.jsxs(es,{children:[e.jsxs(ts,{children:[e.jsx(as,{}),e.jsx("span",{children:de((A==null?void 0:A.credits)??0)})]}),e.jsxs(ss,{children:["$",((A==null?void 0:A.usd)??0).toFixed(2)]})]}),e.jsxs(Mt,{children:[e.jsx(ke,{"data-variant":"outline",onClick:Y,children:a("buyModal.cancel")}),e.jsx(ke,{"data-variant":"gradient",onClick:D,children:a("buyModal.buy")})]})]})}const{colors:r,gradients:Tt,radius:Z}=le,It="@media (max-width: 1080px)",T="@media (max-width: 880px)",wt=i.div`
61
+ `,qs="https://cdn.decentraland.org/@dcl/shop/0.10.1-31032606668.commit-30914a5/_assets/buy-error-22UunaPC.png";function Bs(o){const{phase:l,balanceCredits:I,onClose:z}=o,W=l==="processing",Y=l==="error"?a("cartCheckout.errorTitle"):l==="nofunds"?a("cartCheckout.titleNoFunds"):l==="choose"?a("buyModal.choosePayment"):a("cartCheckout.titleBuy"),D=l==="processing";return e.jsxs(Ca,{role:"dialog","aria-modal":"true","aria-label":a("cartCheckout.dialogAria"),children:[e.jsx(ja,{onClick:W?void 0:z,"aria-hidden":!0}),e.jsxs(ka,{"data-tall":D||void 0,children:[e.jsxs($a,{children:[e.jsxs(Sa,{children:[e.jsx(Ma,{children:Y}),!W&&e.jsx(Ta,{onClick:z,"aria-label":a("buyModal.close"),children:e.jsx(Ia,{})})]}),e.jsxs(Pa,{children:[e.jsx(za,{children:l==="nofunds"?a("buyModal.dclBalance"):a("buyModal.myCreditsBalance")}),e.jsx(gt,{}),e.jsx(Aa,{children:de(I)})]})]}),l==="choose"&&e.jsxs(je,{children:[e.jsxs(Es,{children:[e.jsx("span",{children:a("cart.purchaseSummary")}),e.jsxs("strong",{children:[e.jsx(gt,{}),de(o.totalCredits??0)]})]}),e.jsx(St,{options:o.options??[],totalCents:o.totalCents??0,onPay:o.onPay??(()=>{}),rateNote:(()=>{const A=Ea(o.totalCents??0,o.totalManaWei??0n);return A!=null?a("buyModal.manaRate",{mana:A.toLocaleString("en",{maximumFractionDigits:2})}):null})()})]}),l==="processing"&&e.jsx(Rs,{stage:o.stage??"reserving",step:o.step??1,total:o.total??1,isSelfCustody:!!o.isSelfCustody,signatures:o.signatures}),l==="nofunds"&&e.jsx(_s,{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(je,{children:[e.jsxs(qa,{"data-testid":"buy-error",children:[e.jsx(Ba,{src:qs,alt:"",width:64,height:80}),e.jsxs(Ra,{children:[e.jsx("b",{children:a("cartCheckout.errorHeadline")})," ",o.message??a("cartCheckout.errorBody")]})]}),e.jsxs(Mt,{children:[e.jsx(ke,{"data-variant":"outline",onClick:z,children:a("buyModal.cancel")}),e.jsx(ke,{"data-variant":"purple",onClick:o.onRetry??z,children:a("cartCheckout.tryAgain")})]})]})]})]})}function Rs({stage:o,step:l,total:I,isSelfCustody:z,signatures:W}){const Y=o==="reserving",D=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(je,{"data-processing":!0,children:[e.jsx(_a,{src:ta,alt:"",width:61,height:61}),e.jsx(Wa,{children:ne}),Y?e.jsxs(Is,{children:[e.jsx(xt,{"aria-hidden":!0,children:e.jsx(mt,{"data-step":!0,style:{width:`${D}%`}})}),I>1?e.jsxs(Ps,{children:[l,"/",I]}):null]}):e.jsx(xt,{"aria-hidden":!0,children:e.jsx(mt,{})})]})}function _s({lines:o,shortfallCredits:l,packs:I,selectedPack:z,onSelectPack:W,onBuyPacks:Y,onCancel:D}){const A=I.find(n=>n.id===z),ne=o.reduce((n,L)=>n+(L.quantity??1),0);return e.jsxs(je,{children:[e.jsxs(Fa,{"data-testid":"nofunds-warning",children:[e.jsx(La,{}),e.jsxs(Ka,{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(zs,{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(Qa,{children:[e.jsxs("div",{children:[e.jsxs(Ha,{title:n.item.name,children:[n.item.name||a("buyModal.itemFallback"),L>1?e.jsx(As,{children:a("cartCheckout.qty",{count:L})}):null]}),n.item.creator?e.jsx(Oa,{address:n.item.creator}):null]}),e.jsxs(Va,{children:[e.jsx(Ga,{}),e.jsx("span",{children:de(n.priceCredits*L)})]})]})]},n.item.id)})}),e.jsx(Ya,{children:I.map(n=>{const L=n.id===z;return e.jsxs(Da,{"data-testid":"credit-pack","data-on":L||void 0,onClick:()=>W(n.id),children:[e.jsx(Ja,{}),e.jsx(Xa,{children:de(n.credits)}),e.jsxs(Za,{children:["($",n.usd.toFixed(2),")"]})]},n.id)})}),e.jsxs(es,{children:[e.jsxs(ts,{children:[e.jsx(as,{}),e.jsx("span",{children:de((A==null?void 0:A.credits)??0)})]}),e.jsxs(ss,{children:["$",((A==null?void 0:A.usd)??0).toFixed(2)]})]}),e.jsxs(Mt,{children:[e.jsx(ke,{"data-variant":"outline",onClick:D,children:a("buyModal.cancel")}),e.jsx(ke,{"data-variant":"gradient",onClick:Y,children:a("buyModal.buy")})]})]})}const{colors:r,gradients:Tt,radius:Z}=le,It="@media (max-width: 1080px)",T="@media (max-width: 880px)",wt=i.div`
62
62
  max-width: 1510px;
63
63
  margin: 0 auto;
64
64
  /* Grows into the page's leftover height and passes it down to Upsell, so the white cross-sell band ends at
@@ -186,7 +186,7 @@ import{j as e,L as Se,r as P,b as Zt,a as ea}from"./react-BYHuwl8r.js";import{t
186
186
  ${le.media.maxWidth("mobile")} {
187
187
  font-size: 16px;
188
188
  }
189
- `,Hs=i(Se)`
189
+ `,Hs=i($e)`
190
190
  display: inline-flex;
191
191
  align-items: center;
192
192
  justify-content: center;
@@ -282,11 +282,11 @@ import{j as e,L as Se,r as P,b as Zt,a as ea}from"./react-BYHuwl8r.js";import{t
282
282
  padding: 0 10px;
283
283
  font-size: 12px;
284
284
  }
285
- `,Ds=i.div`
285
+ `,Ys=i.div`
286
286
  display: flex;
287
287
  flex-direction: column;
288
288
  gap: 24px;
289
- `,Ys=i.div`
289
+ `,Ds=i.div`
290
290
  position: relative;
291
291
  display: flex;
292
292
  align-items: stretch;
@@ -327,7 +327,7 @@ import{j as e,L as Se,r as P,b as Zt,a as ea}from"./react-BYHuwl8r.js";import{t
327
327
  width: 120px;
328
328
  height: 120px;
329
329
  }
330
- `,Xs=i(Se)`
330
+ `,Xs=i($e)`
331
331
  position: absolute;
332
332
  inset: 0;
333
333
  display: grid;
@@ -384,7 +384,7 @@ import{j as e,L as Se,r as P,b as Zt,a as ea}from"./react-BYHuwl8r.js";import{t
384
384
  }
385
385
  `,an=i.div`
386
386
  ${zt};
387
- `,sn=i(Se)`
387
+ `,sn=i($e)`
388
388
  ${zt};
389
389
  `,nn=i(aa)`
390
390
  font-size: 10px;
@@ -447,7 +447,7 @@ import{j as e,L as Se,r as P,b as Zt,a as ea}from"./react-BYHuwl8r.js";import{t
447
447
  ${T} {
448
448
  font-size: 20px;
449
449
  }
450
- `,ln=i(St)`
450
+ `,ln=i($t)`
451
451
  width: 24px;
452
452
  height: 24px;
453
453
  background: ${r.text};
@@ -480,7 +480,7 @@ import{j as e,L as Se,r as P,b as Zt,a as ea}from"./react-BYHuwl8r.js";import{t
480
480
  color: ${r.text2};
481
481
  `,gn=i(H)`
482
482
  color: #f48221;
483
- `,xn=i(Se)`
483
+ `,xn=i($e)`
484
484
  font-size: 12px;
485
485
  font-weight: 600;
486
486
  line-height: 24px;
@@ -601,12 +601,12 @@ import{j as e,L as Se,r as P,b as Zt,a as ea}from"./react-BYHuwl8r.js";import{t
601
601
  align-items: flex-start;
602
602
  justify-content: space-between;
603
603
  gap: 12px;
604
- `,Sn=i.span`
604
+ `,$n=i.span`
605
605
  font-size: 14px;
606
606
  font-weight: 600;
607
607
  line-height: 1.57;
608
608
  color: ${r.muted1};
609
- `,$n=i.span`
609
+ `,Sn=i.span`
610
610
  display: inline-flex;
611
611
  align-items: center;
612
612
  gap: 8px;
@@ -624,7 +624,7 @@ import{j as e,L as Se,r as P,b as Zt,a as ea}from"./react-BYHuwl8r.js";import{t
624
624
  font-weight: 400;
625
625
  line-height: 1;
626
626
  color: ${r.muted};
627
- `;const Tn=i(St)`
627
+ `;const Tn=i($t)`
628
628
  width: 30px;
629
629
  height: 30px;
630
630
  background: ${r.text};
@@ -692,4 +692,4 @@ import{j as e,L as Se,r as P,b as Zt,a as ea}from"./react-BYHuwl8r.js";import{t
692
692
  & section {
693
693
  margin-top: 0;
694
694
  }
695
- `;function Fe(o){if(Ss(o))return a("errors.rejected");const l=(o.message??"").toLowerCase();return l.includes("insufficient")?a("cart.error.insufficient",{currency:ya.name}):l.includes("no active listing")||l.includes("your own listing")?a("cart.error.listingChanged"):a("marketCheckout.error.generic")}const An=12e4;function En(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 Le=o=>o.reduce((l,I)=>l+I.priceCredits*I.quantity,0),Ce=o=>o.flatMap(l=>Array.from({length:l.quantity},()=>({...l,quantity:1})));function Gn(){sa({title:a("nav.cart"),noindex:!0});const o=Q(t=>t.items),l=Q(t=>t.remove),I=Q(t=>t.increment),z=Q(t=>t.decrement),W=Q(t=>t.clear),D=Q(t=>t.restore),Y=Q(t=>t.setFittingOpen),A=ot(t=>t.items),ne=ot(t=>t.toggle),{session:n,signIn:L}=na(),qt=ia(),ue=ws().packs.slice(0,Cs);P.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const Bt=o.some(t=>t.category!=="emote"),{data:$e}=ra({queryKey:["upsell-listings"],queryFn:()=>wa({first:40}),staleTime:6e4}),{data:S}=oa(n),v=ca(),ee=Zt(),{state:J}=ea(),[Rt,ie]=P.useState(null),[Ue,he]=P.useState(null),[_t,B]=P.useState(!1),[R,O]=P.useState(null),Ne=P.useRef(0),[g,j]=P.useState(null),{data:pe}=da(n),{data:re}=la(!0),[Me,Qe]=P.useState(""),oe=P.useRef(null),He=ua(o),Oe=t=>dt(He[t.id]),Te=o.filter(Oe),Ie=o.length>0&&Te.length===0,Wt=Te.reduce((t,s)=>t+s.priceCredits*s.quantity,0),Ft=o.reduce((t,s)=>t+s.quantity,0),Lt=Te.reduce((t,s)=>t+s.quantity,0),Ve=R?R.liveTotalCredits:Wt,Kt=new Set(o.map(t=>t.id)),Ge=(($e==null?void 0:$e.items)??[]).filter(t=>!Kt.has(t.id)).slice(0,12),Ut=new Map(R==null?void 0:R.buyable.map(t=>[t.item.id,t])),ge=(S==null?void 0:S.credits)??0,Pe=Ve*10,Nt=re?ct(Pe,re):0n,ce=_e({priceCents:Pe,priceManaWei:Nt,balanceCents:(S==null?void 0:S.balanceCents)??0,manaBalanceWei:pe??0n}),Qt=t=>t.some(s=>s.acquisition==="store"),ze=t=>t.flatMap(s=>s.acquisition==="trade"?[s]:[]),Ht=xa,Ot=t=>fa(t.contractAddress,String(t.itemId));function xe(t){t(),O(null),he(null),ie(null)}function Vt(){j(null),B(!1)}function De(t){const s=Le(t),d=Math.max(0,s-ge),c=ue.find(u=>u.credits>=d)??ue[ue.length-1];Qe(c.id),G("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:s,credits_balance:ge,shortfall:d}),j({phase:"nofunds",lines:t.map(u=>({item:u.item,priceCredits:u.priceCredits,quantity:u.quantity})),shortfall:d}),B(!1)}async function Ae(t){if(!n||t.length===0)return;const s=Ce(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 p=s[m];j({phase:"processing",stage:"reserving",step:m+1,total:s.length});try{const M=p.acquisition==="trade"?p.trade.id:void 0,C=p.item.contractAddress&&p.item.itemId!=null?{contractAddress:p.item.contractAddress,itemId:String(p.item.itemId)}:void 0,{credit:N,maxCreditedValue:X}=await ht(n.identity,p.usdCents,M,C);u.push({salt:N.id,itemId:p.item.id}),y.push(p.acquisition==="store"?{kind:"store",item:{collection:p.item.contractAddress,itemId:String(p.item.itemId),priceWei:p.priceWei},credits:[N],maxCreditedValue:X,chainId:p.item.chainId}:{kind:"trade",trade:p.trade,credits:[N],maxCreditedValue:X})}catch(M){if($s(M)){if(u.length){try{await Be(n.identity,u.map(C=>C.salt))}catch(C){ae(C,{flow:"cart_checkout",step:"release"})}v.invalidateQueries({queryKey:["usd-balance"]})}De(t);return}throw M}}h="submit";const x=fs(y).length,k=m=>x>1?{current:m,total:x}:void 0,F=(m,p)=>j({phase:"processing",stage:m,step:s.length,total:s.length,signatures:k(p)}),K=m=>m<x?F("awaiting-signature",m+1):F("settling",x);F("awaiting-signature",1);let f=[];if(us())try{const m=new Map;f=await ys({purchases:y,buyer:n.address,signer:n.signer,onSigned:()=>K(x),onBroadcast:({txHash:C,salts:N})=>{m.set(C,N),N.forEach(X=>w.add(X))}});const p=await Promise.allSettled(f.map(C=>bs(C)));p.forEach((C,N)=>{const X=m.get(f[N])??[];C.status==="fulfilled"?(X.forEach(qe=>$.add(qe)),E.push(f[N])):C.reason instanceof bt||X.forEach(qe=>_.add(qe))});const M=p.flatMap(C=>C.status==="rejected"?[C.reason]:[]);if(M.length&&!M.some(C=>C instanceof bt))throw M[0];q=!0}catch(m){if(!(m instanceof vs)||!ba(n.providerType))throw m;f=await We({purchases:y,buyer:n.address,signer:n.signer,onSigned:K,onBroadcast:({salts:p})=>p.forEach(M=>w.add(M)),onSettled:({txHash:p,salts:M})=>{M.forEach(C=>$.add(C)),E.push(p)},onReverted:({salts:p})=>p.forEach(M=>_.add(M))})}else f=await We({purchases:y,buyer:n.address,signer:n.signer,onSigned:K,onBroadcast:({salts:m})=>m.forEach(p=>w.add(p)),onSettled:({txHash:m,salts:p})=>{p.forEach(M=>$.add(M)),E.push(m)},onReverted:({salts:m})=>m.forEach(p=>_.add(p))});t.forEach(m=>l(m.item.id)),O(null),G("Shop Completed Purchase",{...fe(d),payment_type:"credits",no_crypto_step:q,transaction_hash:f[0]??null}),yt(v);const b=oe.current;oe.current=null,j(null),B(!1);const U={items:c,txHash:f[0]??void 0,txHashes:f,settled:!0,...b?{creditsAdded:b}:{}};ee("/success",{state:U,replace:!0})}catch(y){ye(y)||ae(y,{flow:"cart_checkout",step:h,cart_size:t.length});const x=new Set([...w].filter(b=>!_.has(b))),{toRelease:k,boughtItemIds:F}=vt({reservations:u,spent:x,settled:$}),K=d.filter(b=>F.includes(b.id)),f=d.filter(b=>!F.includes(b.id));if(G(ye(y)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:h,error_code:pt(y),value_usd:lt(f.reduce((b,U)=>b+U.priceCredits,0)),cart_size:s.length,partial:K.length>0}),k.length)try{await Be(n.identity,k)}catch(b){ae(b,{flow:"cart_checkout",step:"release"})}if(v.invalidateQueries({queryKey:["usd-balance"]}),K.length>0){F.forEach(b=>l(b)),O(null),yt(v),G("Shop Completed Purchase",{...fe(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:Fe(y)})}}function Ye(t,s){v.invalidateQueries({queryKey:["usd-balance"]}),v.invalidateQueries({queryKey:["detail-trade"]}),v.invalidateQueries({queryKey:["shop-item"]}),v.invalidateQueries({queryKey:["owned-token"]}),v.invalidateQueries({queryKey:["public-token"]}),v.invalidateQueries({queryKey:["item-resales"]}),v.invalidateQueries({queryKey:["shop-items"]}),v.invalidateQueries({queryKey:["catalog-items"]}),v.invalidateQueries({queryKey:["my-assets"]}),v.invalidateQueries({queryKey:["purchases"]}),v.invalidateQueries({queryKey:["owned-item-count"]}),v.invalidateQueries({queryKey:["overview-listings"]}),v.invalidateQueries({queryKey:["upsell-listings"]});const d=oe.current;oe.current=null,j(null),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 Je(t,s){ye(t)||ae(t,{flow:s,step:"submit"}),G(ye(t)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:pt(t)}),j({phase:"error",message:Fe(t)}),B(!1)}async function Gt(t,s){const d=be(Re.MANAToken,s),c=be(Re.CreditsManager,s);await xs({auth:{kind:ms.Allowance,contractAddress:d.address,spenderAddress:c.address,chainId:s},signer:t})}async function Xe(){if(re)return re;try{return await v.fetchQuery({queryKey:["mana-rate",ut.chainId],queryFn:()=>ma(ut.chainId),staleTime:6e4})}catch{return}}async function Dt(t){const s=Ce(t).reduce((h,w)=>h+w.usdCents,0),c=(pe??0n)>0n?await Xe():re,u=c?ct(s,c):0n;return{totalCents:s,manaWei:u}}async function Ze(t,s){const d=Le(t),{totalCents:c,manaWei:u}=await Dt(t),h=_e({priceCents:c,priceManaWei:u,balanceCents:(S==null?void 0:S.balanceCents)??0,manaBalanceWei:pe??0n}),w=Qt(t)?{...h,options:h.options.filter($=>$.method==="credits")}:h;if(s&&w.options.some($=>$.method===s)){if(s==="credits"){Ae(t);return}const{spender:$,chainId:_}=et(s,t);await tt($,_,()=>s==="mana"?void at(t):void st(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){De(t);return}Ae(t)}function Yt(t){return _e({priceCents:t.totalCents,priceManaWei:t.manaWei,balanceCents:(S==null?void 0:S.balanceCents)??0,manaBalanceWei:pe??0n})}const[Ee,me]=P.useState(null);function et(t,s){const d=ze(s)[0].trade;return{spender:t==="mana"?be(va(d.contract),d.chainId).address:be(Re.CreditsManager,d.chainId).address,chainId:d.chainId}}async function tt(t,s,d){const c=hs(s,t),u=n?await ps(c,n.address).catch(()=>!0):!0;if(gs(n==null?void 0:n.providerType,u)){B(!1),me({auth:c,run:d});return}d()}function Jt(t){if((g==null?void 0:g.phase)!=="choose")return;const{lines:s,totalCents:d,manaWei:c}=g;if(t==="credits"){Ae(s);return}const{spender:u,chainId:h}=et(t,s);tt(u,h,()=>t==="mana"?void at(s):void st(s,d,c))}async function at(t){if(!n||t.length===0)return;const s=Ce(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 cs({trades:ze(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",{...fe(d),payment_type:"mana",transaction_hash:h[0]??null}),v.invalidateQueries({queryKey:["mana-balance"]}),Ye(c,h)}catch(h){Je(h,"buy_cart_mana")}}async function st(t,s,d){if(!n||t.length===0)return;const c=Ce(t),u=c.map(x=>({...x.item,priceCredits:x.priceCredits})),h=t.map(x=>({...x.item,priceCredits:x.priceCredits,quantity:x.quantity})),w=ds(c.map(x=>x.usdCents),(S==null?void 0:S.balanceCents)??0),$=w.reduce((x,k)=>x+k,0),_=ls(Math.max(0,s-$),s,d),E=[],q=new Set,y=new Set;j({phase:"processing",stage:"reserving",step:1,total:c.length});try{const x=ze(c),k=[];for(let f=0;f<x.length;f++){const b=w[f];if(b<=0)continue;j({phase:"processing",stage:"reserving",step:f+1,total:x.length});const U=x[f].item,{credit:m,maxCreditedValue:p}=await ht(n.identity,b,x[f].trade.id,U.contractAddress&&U.itemId!=null?{contractAddress:U.contractAddress,itemId:String(U.itemId)}:void 0);E.push({salt:m.id,itemId:U.id}),k.push({kind:"trade",trade:x[f].trade,credits:[m],maxCreditedValue:p})}x.forEach((f,b)=>{w[b]<=0&&k.push({kind:"trade",trade:f.trade,credits:[],maxCreditedValue:"0"})}),k[0]={...k[0],maxCreditedValue:(BigInt(k[0].maxCreditedValue)+_).toString()},await Gt(n.signer,x[0].trade.chainId);const F=()=>j({phase:"processing",stage:"settling",step:c.length,total:c.length});j({phase:"processing",stage:"awaiting-signature",step:c.length,total:c.length});const K=await We({purchases:k,buyer:n.address,signer:n.signer,onSigned:F,onBroadcast:({salts:f})=>f.forEach(b=>q.add(b)),onReverted:({salts:f})=>f.forEach(b=>y.add(b))});t.forEach(f=>l(f.item.id)),O(null),G("Shop Completed Purchase",{...fe(u),payment_type:"credits_and_mana",transaction_hash:K[0]??null}),v.invalidateQueries({queryKey:["mana-balance"]}),Ye(h,K)}catch(x){const{toRelease:k}=vt({reservations:E,spent:new Set([...q].filter(F=>!y.has(F))),settled:new Set});k.length&&Be(n.identity,k).catch(()=>{}),E.length&&v.invalidateQueries({queryKey:["usd-balance"]}),Je(x,"buy_cart_combined")}}async function te(t){if(!n){ft({type:"cart-checkout"}),L();return}const s=Q.getState().items.filter(Oe);if(s.length===0)return;ie(null),he(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:lt(d),has_sufficient_credits:ge>=d});try{const c=await js(s,n.address,Ht,await Xe(),Ot),u=[...c.unavailable,...c.own];if(u.length&&(u.forEach(h=>l(h.id)),he(En(c))),c.buyable.length===0){ie(a("cart.error.noneAvailable")),O(null);return}if(c.orderChanged){O(c),Ne.current=Date.now();return}await Ze(c.buyable,t)}catch(c){ae(c,{flow:"cart_checkout",step:"review",cart_size:s.length}),ie(Fe(c))}finally{B(!1)}}async function nt(){if(R){if(!n){ft({type:"cart-checkout"}),L();return}if(Date.now()-Ne.current>An){O(null),he(null),await te();return}ie(null),Ze(R.buyable)}}async function Xt(){if(Me){try{sessionStorage.setItem(ve,JSON.stringify(Q.getState().items))}catch{}B(!0);try{const t=await ks(Me,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(ve)}catch{}ae(t,{flow:"cart_buy_credits"}),j({phase:"error",message:a("buyModal.error.creditsCheckout")})}finally{B(!1)}}}const it=P.useRef(!1);P.useEffect(()=>{if(!n||it.current||!ns("cart-checkout"))return;it.current=!0;const t=setTimeout(()=>void te(),0);return()=>clearTimeout(t)},[n]);const rt=P.useRef(!1);P.useEffect(()=>{if(!(J!=null&&J.resumeCheckout)||rt.current)return;rt.current=!0,oe.current=J.creditsAdded??null;try{const s=sessionStorage.getItem(ve);if(s){sessionStorage.removeItem(ve);const d=JSON.parse(s);Array.isArray(d)&&d.length&&D(d)}}catch{}v.invalidateQueries({queryKey:["usd-balance"]});const t=setTimeout(()=>void te(),0);return()=>clearTimeout(t)},[J==null?void 0:J.resumeCheckout]);const V=_t||(g==null?void 0:g.phase)==="processing";return o.length===0&&!g?e.jsx(wt,{children:e.jsxs(jt,{children:[e.jsxs(Ct,{onClick:()=>ee(-1),type:"button",children:[e.jsx(H,{name:"arrow-left"}),a("nav.cart")]}),e.jsxs(Ks,{"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(Qs,{children:a("cart.empty.body")})]}),e.jsx(Hs,{to:"/items",children:a("cart.empty.cta")})]})]})}):e.jsxs(wt,{children:[e.jsxs(jt,{children:[e.jsxs(Ct,{onClick:()=>ee(-1),type:"button",children:[e.jsx(H,{name:"arrow-left"}),a("nav.cart")]}),e.jsxs(Ws,{children:[e.jsxs(Fs,{children:[e.jsxs(Ls,{children:[e.jsx(Os,{onClick:()=>ee(-1),type:"button","aria-label":a("cart.goBack"),children:e.jsx(H,{name:"arrow-left"})}),e.jsx(Vs,{children:a("cart.panelTitle",{count:Ft})}),Bt?e.jsxs(Gs,{onClick:()=>Y(!0),disabled:V,children:[e.jsx(H,{name:"fitting-room"}),a("cart.fittingRoom")]}):null]}),e.jsxs(Pt,{children:[e.jsx(Ds,{children:o.map(t=>{const s=Ut.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,_=ha(t),E=!!_&&!!A[_],q=pa(t),y=He[t.id],x=!dt(y),k=y==="sold-out"?a("cart.availability.soldOut"):a("cart.availability.unavailable");return e.jsxs(Ys,{"data-unavailable":x||void 0,children:[e.jsxs(Js,{"data-thumb":!0,children:[q?e.jsx(Xs,{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(Zs,{"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(en,{children:[e.jsxs(tn,{"data-desc":!0,children:[q?e.jsx(sn,{to:q,state:{item:t,tradeId:t.tradeId},title:t.name,children:t.name}):e.jsx(an,{title:t.name,children:t.name}),t.creator?e.jsx(nn,{address:t.creator,linkToProfile:!0}):null,qt&&u?e.jsxs(mn,{"data-testid":"cart-creator-tag",children:[e.jsx(fn,{name:"buy-from-creator"}),a("cart.creatorTag")]}):null]}),e.jsx(rn,{children:x?e.jsxs(e.Fragment,{children:[e.jsxs(pn,{children:[e.jsx(gn,{name:"warning-fill",size:24}),k]}),q?e.jsx(xn,{to:q,state:{item:t,tradeId:t.tradeId},children:a("cart.availability.viewResales")}):null]}):e.jsxs(e.Fragment,{children:[u?e.jsxs(on,{children:[e.jsx(kt,{onClick:()=>xe(()=>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(cn,{children:h}),e.jsx(kt,{onClick:()=>xe(()=>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(dn,{children:[e.jsx(ln,{})," ",$,c?e.jsx(un,{children:t.priceCredits*h}):null]})]})})]}),e.jsxs(hn,{children:[_?e.jsx(yn,{"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(bn,{onClick:()=>xe(()=>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(vn,{children:e.jsx("button",{className:"link",onClick:()=>xe(W),disabled:V,children:a("cart.clearCart")})})]})]}),e.jsxs(wn,{children:[e.jsx(Cn,{children:a("cart.purchaseSummary")}),e.jsxs(jn,{children:[e.jsxs(kn,{children:[e.jsx(Sn,{children:a("cart.totalItems",{count:Lt})}),e.jsx(Mn,{children:e.jsxs($n,{children:[e.jsx(Tn,{})," ",Ve]})})]}),ce.options.length>0||ce.manaShortfall?e.jsx($t,{options:ce.options,totalCents:Pe,shortfall:ce.manaShortfall,showCreditsAmount:!1,creditsLabel:R?a("marketCheckout.confirmPurchase"):ce.options.length>1?a("cart.buyWithCredits"):a("cart.checkout"),busy:V||Ie,onPay:t=>void(R?nt():te(t))}):e.jsx(In,{onClick:()=>void(R?nt():te()),disabled:V||Ie,children:V?a("cart.working"):R?a("marketCheckout.confirmPurchase"):a("cart.checkout")}),Ie?e.jsx(we,{className:"muted",children:a("cart.allUnavailable")}):null,n?null:e.jsx(we,{className:"muted",children:a("cart.signInHint")}),R?e.jsx(we,{className:"muted",children:a("cart.priceChanged")}):null,Ue?e.jsx(we,{className:"muted",children:Ue}):null,e.jsx(Pn,{message:Rt})]})]})]})]}),Ge.length>0?e.jsx(zn,{children:e.jsx(is,{title:a("cart.youMightAlsoLike"),items:Ge})}):null,Ee&&n?e.jsx(rs,{auth:Ee.auth,signer:n.signer,title:a("authorizeStep.manaTitle"),name:a("authorizeStep.manaName"),reason:a("authorizeStep.manaReason"),icon:e.jsx("img",{src:os,width:24,height:24,alt:"","aria-hidden":!0}),onAuthorized:()=>{const{run:t}=Ee;me(null),t()},onCancel:()=>me(null),onClose:()=>me(null)}):null,g?e.jsx(Bs,{phase:g.phase,balanceCredits:ge,onClose:Vt,stage:g.phase==="processing"?g.stage:void 0,step:g.phase==="processing"?g.step:void 0,total:g.phase==="processing"?g.total:void 0,isSelfCustody:ga(n==null?void 0:n.providerType),signatures:g.phase==="processing"?g.signatures:void 0,options:g.phase==="choose"?Yt(g).options:void 0,onPay:Jt,totalCents:g.phase==="choose"?g.totalCents:void 0,totalManaWei:g.phase==="choose"?g.manaWei:void 0,totalCredits:g.phase==="choose"?Le(g.lines):void 0,lines:g.phase==="nofunds"?g.lines:void 0,shortfallCredits:g.phase==="nofunds"?g.shortfall:void 0,packs:ue,selectedPack:Me,onSelectPack:Qe,onBuyPacks:()=>void Xt(),message:g.phase==="error"?g.message:void 0,onRetry:()=>void te()}):null]})}export{Gn as Cart};
695
+ `;function Fe(o){if($s(o))return a("errors.rejected");const l=(o.message??"").toLowerCase();return l.includes("insufficient")?a("cart.error.insufficient",{currency:ya.name}):l.includes("no active listing")||l.includes("your own listing")?a("cart.error.listingChanged"):a("marketCheckout.error.generic")}const An=12e4;function En(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 Le=o=>o.reduce((l,I)=>l+I.priceCredits*I.quantity,0),Ce=o=>o.flatMap(l=>Array.from({length:l.quantity},()=>({...l,quantity:1})));function Gn(){sa({title:a("nav.cart"),noindex:!0});const o=Q(t=>t.items),l=Q(t=>t.remove),I=Q(t=>t.increment),z=Q(t=>t.decrement),W=Q(t=>t.clear),Y=Q(t=>t.restore),D=Q(t=>t.setFittingOpen),A=ot(t=>t.items),ne=ot(t=>t.toggle),{session:n,signIn:L}=na(),qt=ia(),ue=ws().packs.slice(0,Cs);P.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const Bt=o.some(t=>t.category!=="emote"),{data:Se}=ra({queryKey:["upsell-listings"],queryFn:()=>wa({first:40}),staleTime:6e4}),{data:$}=oa(n),v=ca(),ee=Zt(),{state:J}=ea(),[Rt,ie]=P.useState(null),[Ue,he]=P.useState(null),[_t,B]=P.useState(!1),[R,O]=P.useState(null),Ne=P.useRef(0),[g,j]=P.useState(null),{data:pe}=da(n),{data:re}=la(!0),[Me,Qe]=P.useState(""),oe=P.useRef(null),He=ua(o),Oe=t=>dt(He[t.id]),Te=o.filter(Oe),Ie=o.length>0&&Te.length===0,Wt=Te.reduce((t,s)=>t+s.priceCredits*s.quantity,0),Ft=o.reduce((t,s)=>t+s.quantity,0),Lt=Te.reduce((t,s)=>t+s.quantity,0),Ve=R?R.liveTotalCredits:Wt,Kt=new Set(o.map(t=>t.id)),Ge=((Se==null?void 0:Se.items)??[]).filter(t=>!Kt.has(t.id)).slice(0,12),Ut=new Map(R==null?void 0:R.buyable.map(t=>[t.item.id,t])),ge=($==null?void 0:$.credits)??0,Pe=Ve*10,Nt=re?ct(Pe,re):0n,ce=_e({priceCents:Pe,priceManaWei:Nt,balanceCents:($==null?void 0:$.balanceCents)??0,manaBalanceWei:pe??0n}),Qt=t=>t.some(s=>s.acquisition==="store"),ze=t=>t.flatMap(s=>s.acquisition==="trade"?[s]:[]),Ht=xa,Ot=t=>fa(t.contractAddress,String(t.itemId));function xe(t){t(),O(null),he(null),ie(null)}function Vt(){j(null),B(!1)}function Ye(t){const s=Le(t),d=Math.max(0,s-ge),c=ue.find(u=>u.credits>=d)??ue[ue.length-1];Qe(c.id),G("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:s,credits_balance:ge,shortfall:d}),j({phase:"nofunds",lines:t.map(u=>({item:u.item,priceCredits:u.priceCredits,quantity:u.quantity})),shortfall:d}),B(!1)}async function Ae(t){if(!n||t.length===0)return;const s=Ce(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,S=new Set,_=new Set,E=[];let q=!1;j({phase:"processing",stage:"reserving",step:1,total:s.length});try{const y=[];for(let m=0;m<s.length;m++){const p=s[m];j({phase:"processing",stage:"reserving",step:m+1,total:s.length});try{const M=p.acquisition==="trade"?p.trade.id:void 0,C=p.item.contractAddress&&p.item.itemId!=null?{contractAddress:p.item.contractAddress,itemId:String(p.item.itemId)}:void 0,{credit:N,maxCreditedValue:X}=await ht(n.identity,p.usdCents,M,C);u.push({salt:N.id,itemId:p.item.id}),y.push(p.acquisition==="store"?{kind:"store",item:{collection:p.item.contractAddress,itemId:String(p.item.itemId),priceWei:p.priceWei},credits:[N],maxCreditedValue:X,chainId:p.item.chainId}:{kind:"trade",trade:p.trade,credits:[N],maxCreditedValue:X})}catch(M){if(Ss(M)){if(u.length){try{await Be(n.identity,u.map(C=>C.salt))}catch(C){ae(C,{flow:"cart_checkout",step:"release"})}v.invalidateQueries({queryKey:["usd-balance"]})}Ye(t);return}throw M}}h="submit";const x=fs(y).length,k=m=>x>1?{current:m,total:x}:void 0,F=(m,p)=>j({phase:"processing",stage:m,step:s.length,total:s.length,signatures:k(p)}),K=m=>m<x?F("awaiting-signature",m+1):F("settling",x);F("awaiting-signature",1);let f=[];if(us())try{const m=new Map;f=await ys({purchases:y,buyer:n.address,signer:n.signer,onSigned:()=>K(x),onBroadcast:({txHash:C,salts:N})=>{m.set(C,N),N.forEach(X=>w.add(X))}});const p=await Promise.allSettled(f.map(C=>bs(C)));p.forEach((C,N)=>{const X=m.get(f[N])??[];C.status==="fulfilled"?(X.forEach(qe=>S.add(qe)),E.push(f[N])):C.reason instanceof bt||X.forEach(qe=>_.add(qe))});const M=p.flatMap(C=>C.status==="rejected"?[C.reason]:[]);if(M.length&&!M.some(C=>C instanceof bt))throw M[0];q=!0}catch(m){if(!(m instanceof vs)||!ba(n.providerType))throw m;f=await We({purchases:y,buyer:n.address,signer:n.signer,onSigned:K,onBroadcast:({salts:p})=>p.forEach(M=>w.add(M)),onSettled:({txHash:p,salts:M})=>{M.forEach(C=>S.add(C)),E.push(p)},onReverted:({salts:p})=>p.forEach(M=>_.add(M))})}else f=await We({purchases:y,buyer:n.address,signer:n.signer,onSigned:K,onBroadcast:({salts:m})=>m.forEach(p=>w.add(p)),onSettled:({txHash:m,salts:p})=>{p.forEach(M=>S.add(M)),E.push(m)},onReverted:({salts:m})=>m.forEach(p=>_.add(p))});t.forEach(m=>l(m.item.id)),O(null),G("Shop Completed Purchase",{...fe(d),payment_type:"credits",no_crypto_step:q,transaction_hash:f[0]??null}),yt(v);const b=oe.current;oe.current=null,j(null),B(!1);const U={items:c,txHash:f[0]??void 0,txHashes:f,settled:!0,...b?{creditsAdded:b}:{}};ee("/success",{state:U,replace:!0})}catch(y){ye(y)||ae(y,{flow:"cart_checkout",step:h,cart_size:t.length});const x=new Set([...w].filter(b=>!_.has(b))),{toRelease:k,boughtItemIds:F}=vt({reservations:u,spent:x,settled:S}),K=d.filter(b=>F.includes(b.id)),f=d.filter(b=>!F.includes(b.id));if(G(ye(y)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:h,error_code:pt(y),value_usd:lt(f.reduce((b,U)=>b+U.priceCredits,0)),cart_size:s.length,partial:K.length>0}),k.length)try{await Be(n.identity,k)}catch(b){ae(b,{flow:"cart_checkout",step:"release"})}if(v.invalidateQueries({queryKey:["usd-balance"]}),K.length>0){F.forEach(b=>l(b)),O(null),yt(v),G("Shop Completed Purchase",{...fe(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:Fe(y)})}}function De(t,s){v.invalidateQueries({queryKey:["usd-balance"]}),v.invalidateQueries({queryKey:["detail-trade"]}),v.invalidateQueries({queryKey:["shop-item"]}),v.invalidateQueries({queryKey:["owned-token"]}),v.invalidateQueries({queryKey:["public-token"]}),v.invalidateQueries({queryKey:["item-resales"]}),v.invalidateQueries({queryKey:["shop-items"]}),v.invalidateQueries({queryKey:["catalog-items"]}),v.invalidateQueries({queryKey:["my-assets"]}),v.invalidateQueries({queryKey:["purchases"]}),v.invalidateQueries({queryKey:["owned-item-count"]}),v.invalidateQueries({queryKey:["overview-listings"]}),v.invalidateQueries({queryKey:["upsell-listings"]});const d=oe.current;oe.current=null,j(null),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 Je(t,s){ye(t)||ae(t,{flow:s,step:"submit"}),G(ye(t)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:pt(t)}),j({phase:"error",message:Fe(t)}),B(!1)}async function Gt(t,s){const d=be(Re.MANAToken,s),c=be(Re.CreditsManager,s);await xs({auth:{kind:ms.Allowance,contractAddress:d.address,spenderAddress:c.address,chainId:s},signer:t})}async function Xe(){if(re)return re;try{return await v.fetchQuery({queryKey:["mana-rate",ut.chainId],queryFn:()=>ma(ut.chainId),staleTime:6e4})}catch{return}}async function Yt(t){const s=Ce(t).reduce((h,w)=>h+w.usdCents,0),c=(pe??0n)>0n?await Xe():re,u=c?ct(s,c):0n;return{totalCents:s,manaWei:u}}async function Ze(t,s){const d=Le(t),{totalCents:c,manaWei:u}=await Yt(t),h=_e({priceCents:c,priceManaWei:u,balanceCents:($==null?void 0:$.balanceCents)??0,manaBalanceWei:pe??0n}),w=Qt(t)?{...h,options:h.options.filter(S=>S.method==="credits")}:h;if(s&&w.options.some(S=>S.method===s)){if(s==="credits"){Ae(t);return}const{spender:S,chainId:_}=et(s,t);await tt(S,_,()=>s==="mana"?void at(t):void st(t,c,u));return}if(w.options.some(S=>S.method==="mana"||S.method==="combined")){j({phase:"choose",lines:t,totalCents:c,manaWei:u}),B(!1);return}if($!=null&&$.credits<d){Ye(t);return}Ae(t)}function Dt(t){return _e({priceCents:t.totalCents,priceManaWei:t.manaWei,balanceCents:($==null?void 0:$.balanceCents)??0,manaBalanceWei:pe??0n})}const[Ee,me]=P.useState(null);function et(t,s){const d=ze(s)[0].trade;return{spender:t==="mana"?be(va(d.contract),d.chainId).address:be(Re.CreditsManager,d.chainId).address,chainId:d.chainId}}async function tt(t,s,d){const c=hs(s,t),u=n?await ps(c,n.address).catch(()=>!0):!0;if(gs(n==null?void 0:n.providerType,u)){B(!1),me({auth:c,run:d});return}d()}function Jt(t){if((g==null?void 0:g.phase)!=="choose")return;const{lines:s,totalCents:d,manaWei:c}=g;if(t==="credits"){Ae(s);return}const{spender:u,chainId:h}=et(t,s);tt(u,h,()=>t==="mana"?void at(s):void st(s,d,c))}async function at(t){if(!n||t.length===0)return;const s=Ce(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 cs({trades:ze(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",{...fe(d),payment_type:"mana",transaction_hash:h[0]??null}),v.invalidateQueries({queryKey:["mana-balance"]}),De(c,h)}catch(h){Je(h,"buy_cart_mana")}}async function st(t,s,d){if(!n||t.length===0)return;const c=Ce(t),u=c.map(x=>({...x.item,priceCredits:x.priceCredits})),h=t.map(x=>({...x.item,priceCredits:x.priceCredits,quantity:x.quantity})),w=ds(c.map(x=>x.usdCents),($==null?void 0:$.balanceCents)??0),S=w.reduce((x,k)=>x+k,0),_=ls(Math.max(0,s-S),s,d),E=[],q=new Set,y=new Set;j({phase:"processing",stage:"reserving",step:1,total:c.length});try{const x=ze(c),k=[];for(let f=0;f<x.length;f++){const b=w[f];if(b<=0)continue;j({phase:"processing",stage:"reserving",step:f+1,total:x.length});const U=x[f].item,{credit:m,maxCreditedValue:p}=await ht(n.identity,b,x[f].trade.id,U.contractAddress&&U.itemId!=null?{contractAddress:U.contractAddress,itemId:String(U.itemId)}:void 0);E.push({salt:m.id,itemId:U.id}),k.push({kind:"trade",trade:x[f].trade,credits:[m],maxCreditedValue:p})}x.forEach((f,b)=>{w[b]<=0&&k.push({kind:"trade",trade:f.trade,credits:[],maxCreditedValue:"0"})}),k[0]={...k[0],maxCreditedValue:(BigInt(k[0].maxCreditedValue)+_).toString()},await Gt(n.signer,x[0].trade.chainId);const F=()=>j({phase:"processing",stage:"settling",step:c.length,total:c.length});j({phase:"processing",stage:"awaiting-signature",step:c.length,total:c.length});const K=await We({purchases:k,buyer:n.address,signer:n.signer,onSigned:F,onBroadcast:({salts:f})=>f.forEach(b=>q.add(b)),onReverted:({salts:f})=>f.forEach(b=>y.add(b))});t.forEach(f=>l(f.item.id)),O(null),G("Shop Completed Purchase",{...fe(u),payment_type:"credits_and_mana",transaction_hash:K[0]??null}),v.invalidateQueries({queryKey:["mana-balance"]}),De(h,K)}catch(x){const{toRelease:k}=vt({reservations:E,spent:new Set([...q].filter(F=>!y.has(F))),settled:new Set});k.length&&Be(n.identity,k).catch(()=>{}),E.length&&v.invalidateQueries({queryKey:["usd-balance"]}),Je(x,"buy_cart_combined")}}async function te(t){if(!n){ft({type:"cart-checkout"}),L();return}const s=Q.getState().items.filter(Oe);if(s.length===0)return;ie(null),he(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:lt(d),has_sufficient_credits:ge>=d});try{const c=await js(s,n.address,Ht,await Xe(),Ot),u=[...c.unavailable,...c.own];if(u.length&&(u.forEach(h=>l(h.id)),he(En(c))),c.buyable.length===0){ie(a("cart.error.noneAvailable")),O(null);return}if(c.orderChanged){O(c),Ne.current=Date.now();return}await Ze(c.buyable,t)}catch(c){ae(c,{flow:"cart_checkout",step:"review",cart_size:s.length}),ie(Fe(c))}finally{B(!1)}}async function nt(){if(R){if(!n){ft({type:"cart-checkout"}),L();return}if(Date.now()-Ne.current>An){O(null),he(null),await te();return}ie(null),Ze(R.buyable)}}async function Xt(){if(Me){try{sessionStorage.setItem(ve,JSON.stringify(Q.getState().items))}catch{}B(!0);try{const t=await ks(Me,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(ve)}catch{}ae(t,{flow:"cart_buy_credits"}),j({phase:"error",message:a("buyModal.error.creditsCheckout")})}finally{B(!1)}}}const it=P.useRef(!1);P.useEffect(()=>{if(!n||it.current||!ns("cart-checkout"))return;it.current=!0;const t=setTimeout(()=>void te(),0);return()=>clearTimeout(t)},[n]);const rt=P.useRef(!1);P.useEffect(()=>{if(!(J!=null&&J.resumeCheckout)||rt.current)return;rt.current=!0,oe.current=J.creditsAdded??null;try{const s=sessionStorage.getItem(ve);if(s){sessionStorage.removeItem(ve);const d=JSON.parse(s);Array.isArray(d)&&d.length&&Y(d)}}catch{}v.invalidateQueries({queryKey:["usd-balance"]});const t=setTimeout(()=>void te(),0);return()=>clearTimeout(t)},[J==null?void 0:J.resumeCheckout]);const V=_t||(g==null?void 0:g.phase)==="processing";return o.length===0&&!g?e.jsx(wt,{children:e.jsxs(jt,{children:[e.jsxs(Ct,{onClick:()=>ee(-1),type:"button",children:[e.jsx(H,{name:"arrow-left"}),a("nav.cart")]}),e.jsxs(Ks,{"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(Qs,{children:a("cart.empty.body")})]}),e.jsx(Hs,{to:"/items",children:a("cart.empty.cta")})]})]})}):e.jsxs(wt,{children:[e.jsxs(jt,{children:[e.jsxs(Ct,{onClick:()=>ee(-1),type:"button",children:[e.jsx(H,{name:"arrow-left"}),a("nav.cart")]}),e.jsxs(Ws,{children:[e.jsxs(Fs,{children:[e.jsxs(Ls,{children:[e.jsx(Os,{onClick:()=>ee(-1),type:"button","aria-label":a("cart.goBack"),children:e.jsx(H,{name:"arrow-left"})}),e.jsx(Vs,{children:a("cart.panelTitle",{count:Ft})}),Bt?e.jsxs(Gs,{onClick:()=>D(!0),disabled:V,children:[e.jsx(H,{name:"fitting-room"}),a("cart.fittingRoom")]}):null]}),e.jsxs(Pt,{children:[e.jsx(Ys,{children:o.map(t=>{const s=Ut.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,S=d*h,_=ha(t),E=!!_&&!!A[_],q=pa(t),y=He[t.id],x=!dt(y),k=y==="sold-out"?a("cart.availability.soldOut"):a("cart.availability.unavailable");return e.jsxs(Ds,{"data-unavailable":x||void 0,children:[e.jsxs(Js,{"data-thumb":!0,children:[q?e.jsx(Xs,{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(Zs,{"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(en,{children:[e.jsxs(tn,{"data-desc":!0,children:[q?e.jsx(sn,{to:q,state:{item:t,tradeId:t.tradeId},title:t.name,children:t.name}):e.jsx(an,{title:t.name,children:t.name}),t.creator?e.jsx(nn,{address:t.creator,linkToProfile:!0}):null,qt&&u?e.jsxs(mn,{"data-testid":"cart-creator-tag",children:[e.jsx(fn,{name:"buy-from-creator"}),a("cart.creatorTag")]}):null]}),e.jsx(rn,{children:x?e.jsxs(e.Fragment,{children:[e.jsxs(pn,{children:[e.jsx(gn,{name:"warning-fill",size:24}),k]}),q?e.jsx(xn,{to:q,state:{item:t,tradeId:t.tradeId},children:a("cart.availability.viewResales")}):null]}):e.jsxs(e.Fragment,{children:[u?e.jsxs(on,{children:[e.jsx(kt,{onClick:()=>xe(()=>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(cn,{children:h}),e.jsx(kt,{onClick:()=>xe(()=>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(dn,{children:[e.jsx(ln,{})," ",S,c?e.jsx(un,{children:t.priceCredits*h}):null]})]})})]}),e.jsxs(hn,{children:[_?e.jsx(yn,{"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(bn,{onClick:()=>xe(()=>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(vn,{children:e.jsx("button",{className:"link",onClick:()=>xe(W),disabled:V,children:a("cart.clearCart")})})]})]}),e.jsxs(wn,{children:[e.jsx(Cn,{children:a("cart.purchaseSummary")}),e.jsxs(jn,{children:[e.jsxs(kn,{children:[e.jsx($n,{children:a("cart.totalItems",{count:Lt})}),e.jsx(Mn,{children:e.jsxs(Sn,{children:[e.jsx(Tn,{})," ",Ve]})})]}),ce.options.length>0||ce.manaShortfall?e.jsx(St,{options:ce.options,totalCents:Pe,shortfall:ce.manaShortfall,showCreditsAmount:!1,creditsLabel:R?a("marketCheckout.confirmPurchase"):ce.options.length>1?a("cart.buyWithCredits"):a("cart.checkout"),busy:V||Ie,onPay:t=>void(R?nt():te(t))}):e.jsx(In,{onClick:()=>void(R?nt():te()),disabled:V||Ie,children:V?a("cart.working"):R?a("marketCheckout.confirmPurchase"):a("cart.checkout")}),Ie?e.jsx(we,{className:"muted",children:a("cart.allUnavailable")}):null,n?null:e.jsx(we,{className:"muted",children:a("cart.signInHint")}),R?e.jsx(we,{className:"muted",children:a("cart.priceChanged")}):null,Ue?e.jsx(we,{className:"muted",children:Ue}):null,e.jsx(Pn,{message:Rt})]})]})]})]}),Ge.length>0?e.jsx(zn,{children:e.jsx(is,{title:a("cart.youMightAlsoLike"),items:Ge})}):null,Ee&&n?e.jsx(rs,{auth:Ee.auth,signer:n.signer,title:a("authorizeStep.manaTitle"),name:a("authorizeStep.manaName"),reason:a("authorizeStep.manaReason"),icon:e.jsx("img",{src:os,width:24,height:24,alt:"","aria-hidden":!0}),onAuthorized:()=>{const{run:t}=Ee;me(null),t()},onCancel:()=>me(null),onClose:()=>me(null)}):null,g?e.jsx(Bs,{phase:g.phase,balanceCredits:ge,onClose:Vt,stage:g.phase==="processing"?g.stage:void 0,step:g.phase==="processing"?g.step:void 0,total:g.phase==="processing"?g.total:void 0,isSelfCustody:ga(n==null?void 0:n.providerType),signatures:g.phase==="processing"?g.signatures:void 0,options:g.phase==="choose"?Dt(g).options:void 0,onPay:Jt,totalCents:g.phase==="choose"?g.totalCents:void 0,totalManaWei:g.phase==="choose"?g.manaWei:void 0,totalCredits:g.phase==="choose"?Le(g.lines):void 0,lines:g.phase==="nofunds"?g.lines:void 0,shortfallCredits:g.phase==="nofunds"?g.shortfall:void 0,packs:ue,selectedPack:Me,onSelectPack:Qe,onBuyPacks:()=>void Xt(),message:g.phase==="error"?g.message:void 0,onRetry:()=>void te()}):null]})}export{Gn as Cart};
@@ -1,4 +1,4 @@
1
- import{ah as N,ai as w,aj as o,ak as n,K as D,w as M}from"./index-BLKe1fxG.js";import{r as U,j as g}from"./react-BYHuwl8r.js";import{g as z,a as E,c as I,b as K}from"./clsx-WwvpwSg0.js";import{s as v}from"./styled-CrSAMFFb.js";function F(r){return z("MuiCircularProgress",r)}E("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const W=["className","color","disableShrink","size","style","thickness","value","variant"];let l=r=>r,P,b,S,$;const t=44,B=M(P||(P=l`
1
+ import{ai as N,aj as w,ak as o,al as n,K as D,w as M}from"./index-CwFxxSc1.js";import{r as U,j as g}from"./react-BYHuwl8r.js";import{g as z,a as E,c as I,b as K}from"./clsx-WwvpwSg0.js";import{s as v}from"./styled-CMJUrQY2.js";function F(r){return z("MuiCircularProgress",r)}E("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const W=["className","color","disableShrink","size","style","thickness","value","variant"];let l=r=>r,P,b,S,$;const t=44,B=M(P||(P=l`
2
2
  0% {
3
3
  transform: rotate(0deg);
4
4
  }
@@ -0,0 +1,162 @@
1
+ import{j as e,r as h,d as J,b as X}from"./react-BYHuwl8r.js";import{t as b,s,bt as ee,a2 as te,D as R,bu as ae,bv as oe,I as ie,b as a,c as re,F as se,v as ne,x as ce,C as le,aq as z,ar as de,bw as pe,bx as xe}from"./index-CwFxxSc1.js";import{E as me}from"./ErrorNotice-BU7FyT1W.js";import{d as he,P as ue,C as ge,a as be,b as fe,A as ve}from"./collectionPage.styles-rLItNGdu.js";import{u as je,S as L,a as ye,F as Ce,c as we,P as $e,d as ke,H as Ne,e as Se}from"./categories-Cc9LF1R4.js";import{L as Pe}from"./LoadMore-i3u3Pyt6.js";import{u as Ae}from"./useInfiniteGrid-DCnfT2gg.js";import{G as Me}from"./grid.styles-2-Lphh1_.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";import"./skeleton.styles-D3iPDKdT.js";const Te=s.section`
2
+ position: relative;
3
+ border-radius: ${b.radius.card};
4
+ overflow: hidden;
5
+ margin-bottom: 24px;
6
+ min-height: 200px;
7
+ display: flex;
8
+ align-items: center;
9
+ justify-content: center;
10
+
11
+ ${b.media.maxWidth("mobile")} {
12
+ min-height: 140px;
13
+ }
14
+ `,Ee=s.div`
15
+ position: absolute;
16
+ inset: 0;
17
+ z-index: 0;
18
+ `,Fe=s.img`
19
+ width: 100%;
20
+ height: 100%;
21
+ object-fit: cover;
22
+ display: block;
23
+ `,Re=s.div`
24
+ position: absolute;
25
+ inset: 0;
26
+ background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.55) 100%);
27
+ `,ze=s.h1`
28
+ position: relative;
29
+ z-index: 1;
30
+ margin: 0;
31
+ padding: 32px 24px;
32
+ text-align: center;
33
+ color: ${b.colors.white};
34
+ font-size: 40px;
35
+ font-weight: 800;
36
+ line-height: 1.2;
37
+ letter-spacing: 0.02em;
38
+ text-transform: uppercase;
39
+ text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
40
+
41
+ ${b.media.maxWidth("mobile")} {
42
+ padding: 24px 16px;
43
+ font-size: 26px;
44
+ }
45
+ `;function Le({name:o,creator:t}){const{data:n}=ee(t),p=(n==null?void 0:n.cover)||he;return e.jsxs(Te,{"data-testid":"collection-hero","aria-label":o,children:[e.jsxs(Ee,{children:[e.jsx(Fe,{src:p,alt:"",loading:"eager"}),e.jsx(Re,{"aria-hidden":!0})]}),e.jsx(ze,{"data-testid":"collection-hero-title",children:o})]})}const{colors:c,radius:I}=b,Be=s.div`
46
+ display: flex;
47
+ flex-direction: column;
48
+ align-items: center;
49
+ text-align: center;
50
+ gap: 12px;
51
+ padding-bottom: 24px;
52
+ /* Lift so the avatar half-overlaps the 24px-below cover hero (24px + half the 110px avatar). */
53
+ margin-top: -79px;
54
+ margin-bottom: 8px;
55
+ border-bottom: 1px solid ${c.line};
56
+ `,B=s.img`
57
+ display: block;
58
+ width: 110px;
59
+ height: 110px;
60
+ border-radius: 50%;
61
+ object-fit: cover;
62
+ border: 5px solid ${c.white};
63
+ box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
64
+ background: #ff4bed;
65
+ `,Ie=s.h2`
66
+ margin: 0;
67
+ font-size: 20px;
68
+ font-weight: 700;
69
+ line-height: 1.3;
70
+ color: ${c.text};
71
+ max-width: 100%;
72
+ overflow: hidden;
73
+ text-overflow: ellipsis;
74
+ white-space: nowrap;
75
+ `,We=s.button`
76
+ display: inline-flex;
77
+ align-items: center;
78
+ gap: 8px;
79
+ padding: 4px 8px;
80
+ border: 0;
81
+ border-radius: ${I.btn};
82
+ background: none;
83
+ color: ${c.muted};
84
+ font: inherit;
85
+ font-size: 14px;
86
+ cursor: pointer;
87
+ transition:
88
+ color 0.15s ease,
89
+ background 0.15s ease;
90
+
91
+ &:hover {
92
+ color: ${c.text};
93
+ background: ${c.media};
94
+ }
95
+ `,_e=s.a`
96
+ display: inline-flex;
97
+ align-items: center;
98
+ justify-content: center;
99
+ width: 100%;
100
+ height: 44px;
101
+ padding: 0 20px;
102
+ border: 2px solid ${c.accent};
103
+ border-radius: ${I.btn};
104
+ background: transparent;
105
+ color: ${c.accent};
106
+ font-weight: 600;
107
+ font-size: 13px;
108
+ text-transform: uppercase;
109
+ letter-spacing: 0.046em;
110
+ text-decoration: none;
111
+ transition:
112
+ background 0.15s ease,
113
+ color 0.15s ease;
114
+
115
+ &:hover {
116
+ background: ${c.accent};
117
+ color: ${c.white};
118
+ }
119
+ `;function Ge({address:o}){var v,d;const{data:t}=te(o),[n,p]=h.useState(!1);if(!o)return null;const l=(t==null?void 0:t.name)||R(o),u=(d=(v=t==null?void 0:t.avatar)==null?void 0:v.snapshots)==null?void 0:d.face256,g=`${re.profileUrl}/${o}`,f=ae(oe({name:t==null?void 0:t.name,hasClaimedName:t==null?void 0:t.hasClaimedName,ethAddress:(t==null?void 0:t.ethAddress)??o}));async function x(){try{await navigator.clipboard.writeText(o),p(!0),window.setTimeout(()=>p(!1),1500)}catch(y){se(y,{flow:"copy_creator_address"})}}return e.jsxs(Be,{"data-testid":"creator-card",children:[u?e.jsx(B,{src:u,alt:"",loading:"eager",style:{backgroundColor:f}}):e.jsx(B,{as:"span","aria-hidden":!0,style:{backgroundColor:f}}),e.jsx(Ie,{title:l,children:l}),e.jsxs(We,{type:"button",onClick:()=>void x(),title:n?a("collection.copied"):a("collection.copyAddress"),"aria-label":n?a("collection.copied"):a("collection.copyAddress"),children:[e.jsx("span",{children:R(o)}),e.jsx(ie,{name:"copy",size:16})]}),e.jsx(_e,{"data-testid":"creator-card-view",href:g,target:"_blank",rel:"noopener noreferrer",children:a("collection.viewProfile")})]})}const{colors:He,media:$}=b,Ue=s.div`
120
+ position: relative;
121
+ display: flex;
122
+ gap: 32px;
123
+ align-items: flex-start;
124
+
125
+ ${$.maxWidth("lg")} {
126
+ display: block;
127
+ }
128
+ `,qe=s.div`
129
+ flex: 1;
130
+ min-width: 0;
131
+
132
+ ${$.maxWidth("lg")} {
133
+ width: 100%;
134
+ }
135
+ `,Ye=s.aside`
136
+ flex: none;
137
+ width: 265px;
138
+
139
+ ${$.maxWidth("lg")} {
140
+ position: fixed;
141
+ left: 0;
142
+ right: 0;
143
+ bottom: 0;
144
+ top: auto;
145
+ z-index: 9999;
146
+ width: 100%;
147
+ max-height: 88vh;
148
+ border-radius: 16px 16px 0 0;
149
+ background: ${He.white};
150
+ padding: 0 16px;
151
+ overflow-y: auto;
152
+ box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.18);
153
+ transform: translateY(100%);
154
+ transition: transform 0.26s ease;
155
+ visibility: hidden;
156
+
157
+ &[data-open] {
158
+ transform: translateY(0);
159
+ visibility: visible;
160
+ }
161
+ }
162
+ `,De=48;function st(){var F;const{contractAddress:o}=J(),t=X(),[n,p]=h.useState("all"),[l,u]=h.useState(null),[g,f]=h.useState([]),[x,v]=h.useState(""),[d,y]=h.useState(""),[k,W]=h.useState("newest");je(`${n}:${l??""}`);const N=x&&!Number.isNaN(Number(x))?Number(x):void 0,S=d&&!Number.isNaN(Number(d))?Number(d):void 0,_=l?Se[l]:void 0,G=(L.find(i=>i.key===k)??L[0]).server,P={category:n,rarities:g.length?g:void 0,wearableCategories:_,minPriceCredits:N,maxPriceCredits:S,sortBy:G},{items:j,total:H,isLoading:C,error:A,hasNextPage:U,isFetchingNextPage:M,isFetchNextPageError:q,fetchNextPage:Y}=Ae(["collection-page",o,P],i=>pe(o,{...P,first:De,skip:i}),{enabled:!!o}),{data:r}=ne({queryKey:["collection-meta",o],queryFn:()=>xe(o),enabled:!!o,staleTime:5*6e4}),T=(r==null?void 0:r.name)||a("collection.fallbackTitle");ce({title:r==null?void 0:r.name,description:r!=null&&r.name?a("seo.collection.description",{name:r.name}):void 0});const E=(r==null?void 0:r.creator)||((F=j[0])==null?void 0:F.creator);function D(i){p(i),u(null)}function K(i){f(m=>m.includes(i)?m.filter(Z=>Z!==i):[...m,i])}function O(){p("all"),u(null),f([]),v(""),y("")}const w=!!(N||S),Q=w?`${x||"0"}–${d||"∞"}`:a("filter.price"),V=n!=="all"||!!l||g.length>0||w;return e.jsxs(ue,{"data-testid":"collection-page",children:[e.jsxs(ge,{"aria-label":a("collection.breadcrumbAria"),children:[e.jsx(be,{onClick:()=>t("/items"),children:a("collection.breadcrumb")}),e.jsx("span",{children:"/"}),e.jsx(fe,{children:T})]}),e.jsx(Le,{name:T,creator:E}),e.jsxs(Ue,{"data-testid":"browse",children:[e.jsxs(Ye,{"data-testid":"browse-sidebar",children:[e.jsx(Ge,{address:E}),e.jsx(ye,{category:n,subCategory:l,onCategory:D,onSub:u,title:a("collection.category"),flat:!0})]}),e.jsxs(qe,{children:[!C&&j.length>0?e.jsx(ve,{items:j,source:"collection"}):null,e.jsx(Ce,{rarities:g,onToggleRarity:K,sort:k,onSort:W,total:H,loading:C,anyActive:V,onClear:O,renderTrailing:i=>e.jsx(we,{panelKey:"price",label:Q,active:w,panel:i,children:e.jsxs($e,{"data-variant":"price",children:[e.jsxs(ke,{children:[e.jsx("input",{type:"number",min:"0","aria-label":a("collection.priceMin"),placeholder:a("collection.priceMinPlaceholder"),value:x,onChange:m=>v(m.target.value)}),e.jsx("span",{children:"–"}),e.jsx("input",{type:"number",min:"0","aria-label":a("collection.priceMax"),placeholder:a("collection.priceMaxPlaceholder"),value:d,onChange:m=>y(m.target.value)})]}),e.jsx(Ne,{children:a("collection.priceHint",{currency:le.name})})]})})}),A?e.jsx(me,{message:a("collection.error")}):null,e.jsx(Me,{"data-testid":"grid",children:C?e.jsx(z,{count:15}):e.jsxs(e.Fragment,{children:[j.map(i=>e.jsx(de,{item:i},i.id)),M?e.jsx(z,{count:6}):null]})}),e.jsx(Pe,{hasNextPage:U,isFetching:M,isError:q,onLoadMore:()=>void Y()}),!C&&!A&&j.length===0?e.jsx("p",{className:"muted",children:a("collection.empty")}):null]})]})]})}export{st as Collection,st as default};
@@ -1,10 +1,10 @@
1
- import{j as t,r as v}from"./react-BYHuwl8r.js";import{s as e,t as o,b as f,z as k,L as j,bV as C,C as G,w as Y,I as Q,F as X,g as W,h as B,f as Z,as as q,a9 as J,bZ as F,aq as ee}from"./index-BLKe1fxG.js";import{s as te,f as U,A as H,g as K,r as ne,m as ae,i as ie,j as oe}from"./authorizations-BZabD414.js";import{i as se}from"./errors-BGVCQOMz.js";import{E as re}from"./ErrorNotice-DuUZx_7m.js";import{l as ce,m as de,n as le}from"./buy-DMMwBXQK.js";import{s as pe,M as he,E as ue}from"./sendMetaTransaction-C5SAvbei.js";import{I as xe,C as ge}from"./ethers-BDpbhgX6.js";const L="shop:resume_after_signin",fe=900*1e3;function ct(a){try{sessionStorage.setItem(L,JSON.stringify({...a,at:Date.now()}))}catch{}}function dt(a){let n;try{n=sessionStorage.getItem(L)}catch{return null}if(!n)return null;try{sessionStorage.removeItem(L)}catch{}let i;try{i=JSON.parse(n)}catch{return null}return!i||i.type!==a||typeof i.at!="number"||Date.now()-i.at>fe?null:i.type==="cart-checkout"?{type:"cart-checkout"}:{type:"item-buy",path:i.path}}function me(a,n){return(a+n-1n)/n}function be(a,n,i){return a<=0||n<=0?0n:a>=n?i:me(i*BigInt(a),BigInt(n))}function lt(a){var b,y,w;const n=Number.isFinite(a.priceCents)?Math.max(0,Math.trunc(a.priceCents)):0,i=Number.isFinite(a.balanceCents)?Math.max(0,Math.trunc(a.balanceCents)):0,s=a.priceManaWei>0n?a.priceManaWei:0n,l=a.manaBalanceWei>0n?a.manaBalanceWei:0n;if(n<=0)return{options:[],preferred:null,manaShortfall:null};const c=[];if(i>=n&&c.push({method:"credits",creditsCents:n,manaWei:0n}),s>0n&&i>0&&i<n){const d=n-i,m=be(d,n,s);l>=m&&c.push({method:"combined",creditsCents:i,manaWei:m})}s>0n&&l>=s&&c.push({method:"mana",creditsCents:0,manaWei:s});const p=((b=c.find(d=>d.method==="credits"))==null?void 0:b.method)??((y=c.find(d=>d.method==="combined"))==null?void 0:y.method)??((w=c.find(d=>d.method==="mana"))==null?void 0:w.method)??null,u=!c.some(d=>d.method==="mana"||d.method==="combined")&&s>0n&&l>0n?{manaWei:l,manaCents:ye(l,n,s),priceCents:n}:null;return{options:c,preferred:p,manaShortfall:u}}function ye(a,n,i){return Number(a*BigInt(n)/i)}function pt(a,n){let i=Number.isFinite(n)?Math.max(0,Math.trunc(n)):0;return a.map(s=>{const l=Number.isFinite(s)?Math.max(0,Math.trunc(s)):0,c=Math.min(l,i);return i-=c,c})}function z(a){return Number.isFinite(a)?Math.max(0,a)/10:0}function ht(a,n){return a.options.find(i=>i.method===n)??null}function ut(a,n){if(!Number.isFinite(a)||a<=0||n<=0n)return null;const i=a/10;return Number(n)/1e18/i}const T="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Group%201'%3e%3cpath%20id='Vector'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12%202L22%2012L12%2022L2%2012L12%202ZM12%204.8L19.2%2012L12%2019.2L4.8%2012L12%204.8ZM12%2015.6C12.9548%2015.6001%2013.8705%2015.2209%2014.5457%2014.5459C15.2209%2013.8708%2015.6003%2012.9552%2015.6004%2012.0004C15.6005%2011.0456%2015.2213%2010.1299%2014.5463%209.45471C13.8712%208.7795%2012.9556%208.40011%2012.0008%208.4C11.0461%208.4%2010.1304%208.77928%209.45525%209.45442C8.78012%2010.1295%208.40083%2011.0452%208.40083%2012C8.40083%2012.9548%208.78012%2013.8705%209.45525%2014.5456C10.1304%2015.2207%2011.0461%2015.6%2012.0008%2015.6H12Z'%20fill='white'/%3e%3cg%20id='Rectangle%201'%3e%3c/g%3e%3c/g%3e%3c/svg%3e",we=e.div`
1
+ import{j as t,r as v}from"./react-BYHuwl8r.js";import{s as e,t as o,b as f,z as k,L as j,bW as C,C as G,w as Y,I as Q,F as X,g as W,h as B,f as Z,at as q,aa as J,b_ as F,ar as ee}from"./index-CwFxxSc1.js";import{s as te,f as U,A as _,g as K,r as ne,m as ae,i as ie,j as oe}from"./authorizations-Xqbnmu9x.js";import{i as se}from"./errors-D4C9kv7B.js";import{E as re}from"./ErrorNotice-BU7FyT1W.js";import{l as ce,m as de,n as le}from"./buy-Cq5r6s_d.js";import{s as pe,M as he,E as ue}from"./sendMetaTransaction-BYbBPih_.js";import{I as xe,C as ge}from"./ethers-BDpbhgX6.js";const L="shop:resume_after_signin",fe=900*1e3;function ct(a){try{sessionStorage.setItem(L,JSON.stringify({...a,at:Date.now()}))}catch{}}function dt(a){let n;try{n=sessionStorage.getItem(L)}catch{return null}if(!n)return null;try{sessionStorage.removeItem(L)}catch{}let i;try{i=JSON.parse(n)}catch{return null}return!i||i.type!==a||typeof i.at!="number"||Date.now()-i.at>fe?null:i.type==="cart-checkout"?{type:"cart-checkout"}:{type:"item-buy",path:i.path}}function me(a,n){return(a+n-1n)/n}function be(a,n,i){return a<=0||n<=0?0n:a>=n?i:me(i*BigInt(a),BigInt(n))}function lt(a){var b,y,w;const n=Number.isFinite(a.priceCents)?Math.max(0,Math.trunc(a.priceCents)):0,i=Number.isFinite(a.balanceCents)?Math.max(0,Math.trunc(a.balanceCents)):0,s=a.priceManaWei>0n?a.priceManaWei:0n,l=a.manaBalanceWei>0n?a.manaBalanceWei:0n;if(n<=0)return{options:[],preferred:null,manaShortfall:null};const c=[];if(i>=n&&c.push({method:"credits",creditsCents:n,manaWei:0n}),s>0n&&i>0&&i<n){const d=n-i,m=be(d,n,s);l>=m&&c.push({method:"combined",creditsCents:i,manaWei:m})}s>0n&&l>=s&&c.push({method:"mana",creditsCents:0,manaWei:s});const p=((b=c.find(d=>d.method==="credits"))==null?void 0:b.method)??((y=c.find(d=>d.method==="combined"))==null?void 0:y.method)??((w=c.find(d=>d.method==="mana"))==null?void 0:w.method)??null,u=!c.some(d=>d.method==="mana"||d.method==="combined")&&s>0n&&l>0n?{manaWei:l,manaCents:ye(l,n,s),priceCents:n}:null;return{options:c,preferred:p,manaShortfall:u}}function ye(a,n,i){return Number(a*BigInt(n)/i)}function pt(a,n){let i=Number.isFinite(n)?Math.max(0,Math.trunc(n)):0;return a.map(s=>{const l=Number.isFinite(s)?Math.max(0,Math.trunc(s)):0,c=Math.min(l,i);return i-=c,c})}function z(a){return Number.isFinite(a)?Math.max(0,a)/10:0}function ht(a,n){return a.options.find(i=>i.method===n)??null}function ut(a,n){if(!Number.isFinite(a)||a<=0||n<=0n)return null;const i=a/10;return Number(n)/1e18/i}const T="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Group%201'%3e%3cpath%20id='Vector'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12%202L22%2012L12%2022L2%2012L12%202ZM12%204.8L19.2%2012L12%2019.2L4.8%2012L12%204.8ZM12%2015.6C12.9548%2015.6001%2013.8705%2015.2209%2014.5457%2014.5459C15.2209%2013.8708%2015.6003%2012.9552%2015.6004%2012.0004C15.6005%2011.0456%2015.2213%2010.1299%2014.5463%209.45471C13.8712%208.7795%2012.9556%208.40011%2012.0008%208.4C11.0461%208.4%2010.1304%208.77928%209.45525%209.45442C8.78012%2010.1295%208.40083%2011.0452%208.40083%2012C8.40083%2012.9548%208.78012%2013.8705%209.45525%2014.5456C10.1304%2015.2207%2011.0461%2015.6%2012.0008%2015.6H12Z'%20fill='white'/%3e%3cg%20id='Rectangle%201'%3e%3c/g%3e%3c/g%3e%3c/svg%3e",we=e.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: 12px;
5
5
  align-items: stretch;
6
6
  width: 100%;
7
- `,V=`
7
+ `,H=`
8
8
  width: 100%;
9
9
  min-height: 56px;
10
10
  display: flex;
@@ -36,14 +36,14 @@ import{j as t,r as v}from"./react-BYHuwl8r.js";import{s as e,t as o,b as f,z as
36
36
  cursor: default;
37
37
  }
38
38
  `,ve=e.button`
39
- ${V}
39
+ ${H}
40
40
  background: ${o.gradients.amethyst};
41
41
 
42
42
  &:hover:not(:disabled) {
43
43
  filter: brightness(1.08);
44
44
  }
45
45
  `,N=e.button`
46
- ${V}
46
+ ${H}
47
47
  background: ${o.colors.text2};
48
48
 
49
49
  &:hover:not(:disabled) {
@@ -289,10 +289,10 @@ import{j as t,r as v}from"./react-BYHuwl8r.js";import{s as e,t as o,b as f,z as
289
289
  @media (prefers-reduced-motion: reduce) {
290
290
  animation: none;
291
291
  }
292
- `;function ft({auth:a,signer:n,title:i,reason:s,name:l,image:c,icon:p,onAuthorized:x,onCancel:u,onClose:b}){const[y,w]=v.useState(!1),[d,m]=v.useState(null);async function $(){w(!0),m(null);try{await te({auth:a,signer:n,active:!0}),x()}catch(h){se(h)?m(f("authorizeStep.errorRejected")):(X(h,{flow:"authorize_step",kind:a.kind}),m(f("authorizeStep.errorGeneric"))),w(!1)}}return t.jsx(Me,{onClick:y?void 0:b,role:"presentation",children:t.jsxs(Ae,{onClick:h=>h.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":i,children:[t.jsxs(We,{children:[t.jsx(Ie,{children:i}),t.jsx(Se,{onClick:b,disabled:y,"aria-label":f("authorizeStep.close"),children:t.jsx(Q,{name:"close",className:"ico"})})]}),t.jsxs(Te,{"data-testid":"authorize-step-row",children:[t.jsx(Ne,{children:c?t.jsx("img",{src:c,alt:""}):p}),t.jsxs(Ee,{children:[t.jsx(Be,{title:l,children:l}),t.jsx(Le,{children:s})]})]}),t.jsx(Re,{children:f("authorizeStep.note")}),t.jsx(re,{message:d}),t.jsxs(Pe,{children:[t.jsx(Fe,{type:"button",onClick:u,disabled:y,children:f("authorizeStep.cancel")}),t.jsx(Ke,{type:"button","data-testid":"authorize-step-action",onClick:()=>void $(),disabled:y,children:y?t.jsxs(t.Fragment,{children:[t.jsx(De,{"aria-hidden":!0}),f("authorizeStep.authorizing")]}):f("authorizeStep.authorize")})]})]})})}async function mt(a){const[n]=await Qe({...a,trades:[a.trade]});return n}async function Qe(a){const{trades:n,buyer:i,signer:s,onSigned:l}=a;if(n.length===0)throw new Error("No items to buy");const c=new Map;for(const x of n){const u=`${x.chainId}:${x.contract.toLowerCase()}`,b=c.get(u);b?b.push(x):c.set(u,[x])}const p=[];for(const x of c.values())p.push(await Ue({trades:x,buyer:i,signer:s,onSigned:l}));return p}async function Ue(a){const{trades:n,buyer:i,signer:s,onSigned:l}=a,c=n[0],p=W(Z(c.contract),c.chainId),x=W(B.MANAToken,c.chainId);await U({auth:{kind:H.Allowance,contractAddress:x.address,spenderAddress:p.address,chainId:c.chainId},signer:s});const u=n.map(d=>de(d,i));if(K.enabled)try{const d=new xe(p.abi).encodeFunctionData("accept",[u]),m=ne(),$=ae(s.provider,m),h=await pe($,m,d,p,{serverURL:K.relayerUrl});return l==null||l(),await ie(h,"the MANA purchase"),h}catch(d){if(d instanceof he&&d.code===ue.USER_DENIED||d instanceof oe)throw d;console.warn("[buyWithMana] gasless meta-tx failed, falling back to a direct tx:",d)}await q(s.provider,c.chainId);const y=await new ge(p.address,p.abi,s).accept(u,le(c.chainId));return l==null||l(),(await y.wait()).transactionHash}async function bt(a){const{trade:n,buyer:i,signer:s,credits:l,manaGapWei:c,onBroadcast:p,onReverted:x}=a;if(l.length===0)throw new Error("No credits to spend — use buyWithMana for a MANA-only purchase");if(c<=0n)throw new Error("No MANA gap to cover — use buyWithCredits for a credits-only purchase");const u=W(B.MANAToken,n.chainId),b=W(B.CreditsManager,n.chainId);await U({auth:{kind:H.Allowance,contractAddress:u.address,spenderAddress:b.address,chainId:n.chainId},signer:s});const w=(l.reduce((d,m)=>d+BigInt(m.availableAmount),0n)+c).toString();return ce({trade:n,buyer:i,signer:s,credits:l,maxCreditedValue:w,onBroadcast:p,onReverted:x})}function yt(a){return t.jsx("svg",{viewBox:"0 0 18 18",width:"18",height:"18","aria-hidden":!0,...a,children:t.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#161518",strokeWidth:"1.8",strokeLinecap:"round"})})}function wt(a){return t.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":!0,...a,children:[t.jsx("path",{d:"M12 3L2 20h20L12 3z",fill:"none",stroke:"#691fa9",strokeWidth:"1.8",strokeLinejoin:"round"}),t.jsx("path",{d:"M12 9v5",stroke:"#691fa9",strokeWidth:"1.8",strokeLinecap:"round"}),t.jsx("circle",{cx:"12",cy:"17",r:"1.1",fill:"#691fa9"})]})}const{colors:r,gradients:_,radius:O,z:He}=o,vt=e.div`
292
+ `;function ft({auth:a,signer:n,title:i,reason:s,name:l,image:c,icon:p,onAuthorized:x,onCancel:u,onClose:b}){const[y,w]=v.useState(!1),[d,m]=v.useState(null);async function $(){w(!0),m(null);try{await te({auth:a,signer:n,active:!0}),x()}catch(h){se(h)?m(f("authorizeStep.errorRejected")):(X(h,{flow:"authorize_step",kind:a.kind}),m(f("authorizeStep.errorGeneric"))),w(!1)}}return t.jsx(Me,{onClick:y?void 0:b,role:"presentation",children:t.jsxs(Ae,{onClick:h=>h.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":i,children:[t.jsxs(We,{children:[t.jsx(Ie,{children:i}),t.jsx(Se,{onClick:b,disabled:y,"aria-label":f("authorizeStep.close"),children:t.jsx(Q,{name:"close",className:"ico"})})]}),t.jsxs(Te,{"data-testid":"authorize-step-row",children:[t.jsx(Ne,{children:c?t.jsx("img",{src:c,alt:""}):p}),t.jsxs(Ee,{children:[t.jsx(Be,{title:l,children:l}),t.jsx(Le,{children:s})]})]}),t.jsx(Re,{children:f("authorizeStep.note")}),t.jsx(re,{message:d}),t.jsxs(Pe,{children:[t.jsx(Fe,{type:"button",onClick:u,disabled:y,children:f("authorizeStep.cancel")}),t.jsx(Ke,{type:"button","data-testid":"authorize-step-action",onClick:()=>void $(),disabled:y,children:y?t.jsxs(t.Fragment,{children:[t.jsx(De,{"aria-hidden":!0}),f("authorizeStep.authorizing")]}):f("authorizeStep.authorize")})]})]})})}async function mt(a){const[n]=await Qe({...a,trades:[a.trade]});return n}async function Qe(a){const{trades:n,buyer:i,signer:s,onSigned:l}=a;if(n.length===0)throw new Error("No items to buy");const c=new Map;for(const x of n){const u=`${x.chainId}:${x.contract.toLowerCase()}`,b=c.get(u);b?b.push(x):c.set(u,[x])}const p=[];for(const x of c.values())p.push(await Ue({trades:x,buyer:i,signer:s,onSigned:l}));return p}async function Ue(a){const{trades:n,buyer:i,signer:s,onSigned:l}=a,c=n[0],p=W(Z(c.contract),c.chainId),x=W(B.MANAToken,c.chainId);await U({auth:{kind:_.Allowance,contractAddress:x.address,spenderAddress:p.address,chainId:c.chainId},signer:s});const u=n.map(d=>de(d,i));if(K.enabled)try{const d=new xe(p.abi).encodeFunctionData("accept",[u]),m=ne(),$=ae(s.provider,m),h=await pe($,m,d,p,{serverURL:K.relayerUrl});return l==null||l(),await ie(h,"the MANA purchase"),h}catch(d){if(d instanceof he&&d.code===ue.USER_DENIED||d instanceof oe)throw d;console.warn("[buyWithMana] gasless meta-tx failed, falling back to a direct tx:",d)}await q(s.provider,c.chainId);const y=await new ge(p.address,p.abi,s).accept(u,le(c.chainId));return l==null||l(),(await y.wait()).transactionHash}async function bt(a){const{trade:n,buyer:i,signer:s,credits:l,manaGapWei:c,onBroadcast:p,onReverted:x}=a;if(l.length===0)throw new Error("No credits to spend — use buyWithMana for a MANA-only purchase");if(c<=0n)throw new Error("No MANA gap to cover — use buyWithCredits for a credits-only purchase");const u=W(B.MANAToken,n.chainId),b=W(B.CreditsManager,n.chainId);await U({auth:{kind:_.Allowance,contractAddress:u.address,spenderAddress:b.address,chainId:n.chainId},signer:s});const w=(l.reduce((d,m)=>d+BigInt(m.availableAmount),0n)+c).toString();return ce({trade:n,buyer:i,signer:s,credits:l,maxCreditedValue:w,onBroadcast:p,onReverted:x})}function yt(a){return t.jsx("svg",{viewBox:"0 0 18 18",width:"18",height:"18","aria-hidden":!0,...a,children:t.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#161518",strokeWidth:"1.8",strokeLinecap:"round"})})}function wt(a){return t.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":!0,...a,children:[t.jsx("path",{d:"M12 3L2 20h20L12 3z",fill:"none",stroke:"#691fa9",strokeWidth:"1.8",strokeLinejoin:"round"}),t.jsx("path",{d:"M12 9v5",stroke:"#691fa9",strokeWidth:"1.8",strokeLinecap:"round"}),t.jsx("circle",{cx:"12",cy:"17",r:"1.1",fill:"#691fa9"})]})}const{colors:r,gradients:O,radius:V,z:_e}=o,vt=e.div`
293
293
  position: fixed;
294
294
  inset: 0;
295
- z-index: ${He.overlay};
295
+ z-index: ${_e.overlay};
296
296
  display: flex;
297
297
  overflow-y: auto;
298
298
  padding: 20px;
@@ -446,7 +446,7 @@ import{j as t,r as v}from"./react-BYHuwl8r.js";import{s as e,t as o,b as f,z as
446
446
  gap: 8px;
447
447
  justify-content: center;
448
448
  background: rgba(255, 162, 90, 0.3);
449
- border-radius: ${O.btn};
449
+ border-radius: ${V.btn};
450
450
  padding: 12px 8px;
451
451
  `,Dt=e.p`
452
452
  margin: 0;
@@ -477,18 +477,18 @@ import{j as t,r as v}from"./react-BYHuwl8r.js";import{s as e,t as o,b as f,z as
477
477
  &[data-on] {
478
478
  border: 4px solid ${r.magenta};
479
479
  }
480
- `,Ht=e(k)`
480
+ `,_t=e(k)`
481
481
  width: 24px;
482
482
  height: 24px;
483
483
  background: ${r.text};
484
- `,Vt=e.span`
484
+ `,Ht=e.span`
485
485
  font-size: 24px;
486
486
  font-weight: 500;
487
487
  color: ${r.text};
488
- `,_t=e.span`
488
+ `,Ot=e.span`
489
489
  font-size: 14px;
490
490
  color: ${r.text};
491
- `,Ot=e.div`
491
+ `,Vt=e.div`
492
492
  display: flex;
493
493
  align-items: center;
494
494
  justify-content: space-between;
@@ -522,7 +522,7 @@ import{j as t,r as v}from"./react-BYHuwl8r.js";import{s as e,t as o,b as f,z as
522
522
  /* Let the CTAs shrink so their min-content can't widen the modal past the viewport on mobile. */
523
523
  min-width: 0;
524
524
  height: 46px;
525
- border-radius: ${O.btn};
525
+ border-radius: ${V.btn};
526
526
  border: 0;
527
527
  cursor: pointer;
528
528
  font-size: 15px;
@@ -538,7 +538,7 @@ import{j as t,r as v}from"./react-BYHuwl8r.js";import{s as e,t as o,b as f,z as
538
538
  width: 100%;
539
539
  }
540
540
  &[data-variant='gradient'] {
541
- background: ${_.amethyst};
541
+ background: ${O.amethyst};
542
542
  color: ${r.softWhite};
543
543
  }
544
544
  &[data-variant='outline'] {
@@ -606,7 +606,7 @@ import{j as t,r as v}from"./react-BYHuwl8r.js";import{s as e,t as o,b as f,z as
606
606
  height: 100%;
607
607
  width: 40%;
608
608
  border-radius: 100px;
609
- background: ${_.amethyst};
609
+ background: ${O.amethyst};
610
610
  animation: buy-modal-progress 1.1s ease-in-out infinite;
611
611
 
612
612
  @keyframes buy-modal-progress {
@@ -665,14 +665,14 @@ import{j as t,r as v}from"./react-BYHuwl8r.js";import{s as e,t as o,b as f,z as
665
665
  text-align: center;
666
666
  }
667
667
  }
668
- `,{colors:I,media:A}=o,Ve=e.section`
668
+ `,{colors:I,media:A}=o,He=e.section`
669
669
  margin-top: 40px;
670
- `,_e=e.div`
670
+ `,Oe=e.div`
671
671
  display: flex;
672
672
  align-items: center;
673
673
  justify-content: space-between;
674
674
  margin-bottom: 20px;
675
- `,Oe=e.h2`
675
+ `,Ve=e.h2`
676
676
  font-size: 22px;
677
677
  font-weight: 700;
678
678
  color: ${I.text};
@@ -801,4 +801,4 @@ import{j as t,r as v}from"./react-BYHuwl8r.js";import{s as e,t as o,b as f,z as
801
801
  opacity: 1;
802
802
  transform: scale(1.1);
803
803
  }
804
- `;function dn({title:a,items:n,onViewAll:i}){const s=v.useRef(null),[l,c]=v.useState(1),[p,x]=v.useState(0),[u,b]=v.useState(!0),[y,w]=v.useState(!1),d=v.useCallback(()=>{const h=s.current;if(!h)return;const{scrollLeft:g,scrollWidth:R,clientWidth:S}=h,P=Math.max(1,Math.ceil(R/S));c(P),x(Math.min(P-1,Math.round(g/S))),b(g<=1),w(g+S>=R-1)},[]);if(v.useEffect(()=>{d();const h=s.current;if(h)return h.addEventListener("scroll",d,{passive:!0}),window.addEventListener("resize",d),()=>{h.removeEventListener("scroll",d),window.removeEventListener("resize",d)}},[d,n.length]),n.length===0)return null;function m(h){const g=s.current;g&&g.scrollBy({left:h*g.clientWidth,behavior:"smooth"})}function $(h){const g=s.current;g&&g.scrollTo({left:h*g.clientWidth,behavior:"smooth"})}return t.jsxs(Ve,{"data-testid":"carousel",children:[t.jsxs(_e,{children:[t.jsx(Oe,{children:a}),i?t.jsxs(Ge,{onClick:i,children:[f("collectionCarousel.viewAll"),t.jsx(Ye,{name:"chevron-down",size:16})]}):null]}),t.jsxs(Xe,{children:[t.jsx(D,{"data-side":"left",onClick:()=>m(-1),"aria-label":f("collectionCarousel.scrollLeft"),disabled:u,children:t.jsx("img",{src:F,alt:"","aria-hidden":!0})}),t.jsx(Ze,{ref:s,children:n.map(h=>t.jsx(ee,{item:h},h.id))}),t.jsx(D,{"data-side":"right",onClick:()=>m(1),"aria-label":f("collectionCarousel.scrollRight"),disabled:y,children:t.jsx("img",{src:F,alt:"","aria-hidden":!0})})]}),l>1?t.jsx(qe,{"aria-label":f("collectionCarousel.pages"),children:Array.from({length:l}).map((h,g)=>t.jsx(Je,{"data-active":g===p||void 0,"aria-label":f("collectionCarousel.goToPage",{page:g+1}),"aria-current":g===p?"true":void 0,onClick:()=>$(g)},g))}):null]})}export{z as $,Nt as A,At as B,$t as C,Vt as D,_t as E,Ot as F,Gt as G,jt as H,Yt as I,Xt as J,lt as K,Jt as L,vt as M,dt as N,dn as O,xt as P,ft as Q,T as R,kt as S,zt as T,ct as U,gt as V,Kt as W,Mt as X,Qe as Y,pt as Z,be as _,Ct as a,rn as a0,cn as a1,mt as a2,ht as a3,bt as a4,yt as b,Wt as c,It as d,St as e,Tt as f,en as g,tn as h,nn as i,Zt as j,qt as k,an as l,ut as m,on as n,sn as o,wt as p,Dt as q,Et as r,Bt as s,Lt as t,Rt as u,Pt as v,Ft as w,Qt as x,Ut as y,Ht as z};
804
+ `;function dn({title:a,items:n,onViewAll:i}){const s=v.useRef(null),[l,c]=v.useState(1),[p,x]=v.useState(0),[u,b]=v.useState(!0),[y,w]=v.useState(!1),d=v.useCallback(()=>{const h=s.current;if(!h)return;const{scrollLeft:g,scrollWidth:R,clientWidth:S}=h,P=Math.max(1,Math.ceil(R/S));c(P),x(Math.min(P-1,Math.round(g/S))),b(g<=1),w(g+S>=R-1)},[]);if(v.useEffect(()=>{d();const h=s.current;if(h)return h.addEventListener("scroll",d,{passive:!0}),window.addEventListener("resize",d),()=>{h.removeEventListener("scroll",d),window.removeEventListener("resize",d)}},[d,n.length]),n.length===0)return null;function m(h){const g=s.current;g&&g.scrollBy({left:h*g.clientWidth,behavior:"smooth"})}function $(h){const g=s.current;g&&g.scrollTo({left:h*g.clientWidth,behavior:"smooth"})}return t.jsxs(He,{"data-testid":"carousel",children:[t.jsxs(Oe,{children:[t.jsx(Ve,{children:a}),i?t.jsxs(Ge,{onClick:i,children:[f("collectionCarousel.viewAll"),t.jsx(Ye,{name:"chevron-down",size:16})]}):null]}),t.jsxs(Xe,{children:[t.jsx(D,{"data-side":"left",onClick:()=>m(-1),"aria-label":f("collectionCarousel.scrollLeft"),disabled:u,children:t.jsx("img",{src:F,alt:"","aria-hidden":!0})}),t.jsx(Ze,{ref:s,children:n.map(h=>t.jsx(ee,{item:h},h.id))}),t.jsx(D,{"data-side":"right",onClick:()=>m(1),"aria-label":f("collectionCarousel.scrollRight"),disabled:y,children:t.jsx("img",{src:F,alt:"","aria-hidden":!0})})]}),l>1?t.jsx(qe,{"aria-label":f("collectionCarousel.pages"),children:Array.from({length:l}).map((h,g)=>t.jsx(Je,{"data-active":g===p||void 0,"aria-label":f("collectionCarousel.goToPage",{page:g+1}),"aria-current":g===p?"true":void 0,onClick:()=>$(g)},g))}):null]})}export{z as $,Nt as A,At as B,$t as C,Ht as D,Ot as E,Vt as F,Gt as G,jt as H,Yt as I,Xt as J,lt as K,Jt as L,vt as M,dt as N,dn as O,xt as P,ft as Q,T as R,kt as S,zt as T,ct as U,gt as V,Kt as W,Mt as X,Qe as Y,pt as Z,be as _,Ct as a,rn as a0,cn as a1,mt as a2,ht as a3,bt as a4,yt as b,Wt as c,It as d,St as e,Tt as f,en as g,tn as h,nn as i,Zt as j,qt as k,an as l,ut as m,on as n,sn as o,wt as p,Dt as q,Et as r,Bt as s,Lt as t,Rt as u,Pt as v,Ft as w,Qt as x,Ut as y,_t as z};
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/index.es-C4oAOZ2V.js","_assets/react-BYHuwl8r.js"])))=>i.map(i=>d[i]);
2
- import{s as o,_ as a}from"./index-BLKe1fxG.js";import{r as n,j as e}from"./react-BYHuwl8r.js";const s=o.div`
2
+ import{s as o,_ as a}from"./index-CwFxxSc1.js";import{r as n,j as e}from"./react-BYHuwl8r.js";const s=o.div`
3
3
  position: fixed;
4
4
  inset: 0;
5
5
  /**