@dcl/shop 0.8.0 → 0.8.1-31010487922.commit-7e8c168

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 (235) hide show
  1. package/_assets/{Activity-BpEWDEgt.js → Activity-D0ke7CND.js} +3 -3
  2. package/_assets/{AnimatedBackground-whCeMUgc.js → AnimatedBackground-ECFAiLHT.js} +1 -1
  3. package/_assets/Assets-BF1jmHXH.js +801 -0
  4. package/_assets/{Assets.styles-DuSEfvzx.js → Assets.styles-oV1FeEer.js} +2 -2
  5. package/_assets/{Authorizations-DTC0viZ7.js → Authorizations-Cc50JSP-.js} +3 -3
  6. package/_assets/{Cart-Ccdz2uXK.js → Cart-D4Ru3hhk.js} +3 -3
  7. package/_assets/{CircularProgress-BkDrovgn.js → CircularProgress-DqnGiMZe.js} +3 -3
  8. package/_assets/{Collection-LGp9HIwD.js → Collection-YEjRwps6.js} +10 -10
  9. package/_assets/{CollectionCarousel-CnR1So5p.js → CollectionCarousel-BeRnGCYD.js} +32 -32
  10. package/_assets/{ConstantsUtil-Di3dRDAF.js → ConstantsUtil-BkhvNc68.js} +1 -1
  11. package/_assets/{ContentClient-CRr9ZuRH.js → ContentClient-CGWTGqN4.js} +1 -1
  12. package/_assets/Creator-D__6ZkY9.js +306 -0
  13. package/_assets/{DeploymentBuilder-DYNbIRzZ.js → DeploymentBuilder-CFls_09j.js} +1 -1
  14. package/_assets/{ErrorNotice-BXWX_0E4.js → ErrorNotice-Q_ppMazV.js} +1 -1
  15. package/_assets/{ExchangeController-C_NxeYpZ.js → ExchangeController-qVRplriS.js} +1 -1
  16. package/_assets/{Faq-BXT0tU5Q.js → Faq-cnUUa754.js} +1 -1
  17. package/_assets/{GetCredits-CiVv6zS4.js → GetCredits-B0kU7FuE.js} +19 -19
  18. package/_assets/{Grow-d2ucdHqS.js → Grow-HgGzFpE3.js} +1 -1
  19. package/_assets/{HelpersUtil-BsEaPmaI.js → HelpersUtil-Ew-F4vBT.js} +1 -1
  20. package/_assets/{ItemDetail-BxGSP-it.js → ItemDetail-qqSyfKPj.js} +13 -13
  21. package/_assets/LazyEmoteControls-DNXHFm3g.js +2 -0
  22. package/_assets/{LoadMore-DcIHY8Kf.js → LoadMore-DSHozISi.js} +1 -1
  23. package/_assets/{ManaPricingBanner.styles-CxOm66Fo.js → ManaPricingBanner.styles-UwzPqB3A.js} +1 -1
  24. package/_assets/{MyAssets-BozGMHXd.js → MyAssets-fpg41I4K.js} +1 -1
  25. package/_assets/{MyFavorites-wLuasEwD.js → MyFavorites-Cd7TlT9w.js} +2 -2
  26. package/_assets/{NetworkUtil-EoWQDMpU.js → NetworkUtil-CO-1nCx-.js} +1 -1
  27. package/_assets/{NotFound-D9deZR03.js → NotFound-CTSrHIhr.js} +1 -1
  28. package/_assets/{NotificationsBell-DULYJmKs.js → NotificationsBell-DabycGGR.js} +1 -1
  29. package/_assets/{OutfitDetail-B28zoBrk.js → OutfitDetail-BCQPpfUl.js} +15 -15
  30. package/_assets/{OutfitPreview-GRiCEESc.js → OutfitPreview-CNVm-Mmy.js} +2 -2
  31. package/_assets/{OutfitStudio-D7500MAI.js → OutfitStudio-DF2ScfYx.js} +13 -13
  32. package/_assets/{StoreSettings-DK8rP1ia.js → StoreSettings-rrOuug9U.js} +9 -9
  33. package/_assets/{Success-zZ3HkHoh.js → Success-D8XBSWq_.js} +13 -13
  34. package/_assets/{SwapController-LhvwgYfv.js → SwapController-ZQOTT4HD.js} +1 -1
  35. package/_assets/{Tooltip-Dh6dtNV3.js → Tooltip-xIVvDLOp.js} +2 -2
  36. package/_assets/{TradeService-DjBvwlyu.js → TradeService-DmCFIQne.js} +1 -1
  37. package/_assets/{W3MFrameProviderSingleton-DyHElSGY.js → W3MFrameProviderSingleton-CRZ8AP2Q.js} +3 -3
  38. package/_assets/{WebCryptoP256-CGMChTjg.js → WebCryptoP256-DXjlDDMT.js} +1 -1
  39. package/_assets/authorizations-BixBV4TD.js +1 -0
  40. package/_assets/{basic-BwriZEC-.js → basic-CcERZRfI.js} +1 -1
  41. package/_assets/{biconomy-CeViGwXz.js → biconomy-BIgRCmes.js} +1 -1
  42. package/_assets/{browser-CqsLPmeb.js → browser-DrmA6_0y.js} +1 -1
  43. package/_assets/{browser-ponyfill-I5CKtKME.js → browser-ponyfill-fSxUcg6c.js} +1 -1
  44. package/_assets/{builder-CYMYImB0.js → builder-yYkfVnmO.js} +1 -1
  45. package/_assets/buy-C6t8EdJL.js +1 -0
  46. package/_assets/{buy-gasless-DIfZSqYX.js → buy-gasless-uXmROTXZ.js} +1 -1
  47. package/_assets/{categories-BbYXk3ti.js → categories-CGxAQH-_.js} +45 -33
  48. package/_assets/{ccip-CwIu0LfN.js → ccip-ClC71LrZ.js} +1 -1
  49. package/_assets/{ccip-Sex5PzD_.js → ccip-TCYs1z3C.js} +1 -1
  50. package/_assets/{chains-DPlhC0Sw.js → chains-BqVOrxrG.js} +1 -1
  51. package/_assets/{collectionPage.styles-CHbJGgda.js → collectionPage.styles-DxfKkCjZ.js} +4 -4
  52. package/_assets/{common-CNwVQ4p9.js → common-CkYiP-7J.js} +1 -1
  53. package/_assets/{controller-DfTp5YOO.js → controller-CAD_Ncxd.js} +2 -2
  54. package/_assets/{core-BEK9pA3q.js → core-C5ZUevur.js} +4 -4
  55. package/_assets/{createSvgIcon-CU05oHiV.js → createSvgIcon-DsB10OiJ.js} +4 -4
  56. package/_assets/{custom-BhGswfT_.js → custom-CizQsxK3.js} +1 -1
  57. package/_assets/{data-capture-nvuZRuzg.js → data-capture-Bwsb_w-3.js} +1 -1
  58. package/_assets/decimals-DO67KSdi.js +1 -0
  59. package/_assets/{decimals-B3pg7hp8.js → decimals-DyjR4aoq.js} +1 -1
  60. package/_assets/{detectExtension-DEjVJeUh.js → detectExtension-DWfhzRDC.js} +1 -1
  61. package/_assets/{disposePreview-B96DpOZy.js → disposePreview-flulL6RX.js} +1 -1
  62. package/_assets/{email-CieTjR51.js → email-CUebz27I.js} +1 -1
  63. package/_assets/{embedded-wallet-CI-r3uDX.js → embedded-wallet-DHuEKb2B.js} +1 -1
  64. package/_assets/{emotion-styled.browser.esm-BlQXcSKx.js → emotion-styled.browser.esm-CVKaLYZX.js} +1 -1
  65. package/_assets/{engine-CHP2eI44.js → engine-CwQ6coYl.js} +1 -1
  66. package/_assets/errors-CBUUj0FX.js +1 -0
  67. package/_assets/estimate-l1-fee-BJpzTLgk.js +1 -0
  68. package/_assets/eth_estimateGas-CZdRIIy4.js +1 -0
  69. package/_assets/{eth_getStorageAt-BUYdIAYw.js → eth_getStorageAt-C4Yqzc5m.js} +1 -1
  70. package/_assets/eth_getTransactionCount-W_BA_-db.js +1 -0
  71. package/_assets/{ethereum-CliiIOgc.js → ethereum-DFU7Vz3W.js} +1 -1
  72. package/_assets/{ethers-DejfrZ8i.js → ethers-lk3HAbPB.js} +1 -1
  73. package/_assets/{execute-BJuyrz_X.js → execute-BkwPHs5d.js} +2 -2
  74. package/_assets/{extractIPFS-CUaS-9Rs.js → extractIPFS-DzfSqAlh.js} +1 -1
  75. package/_assets/{features-B9o2bxOE.js → features-COoncQLs.js} +1 -1
  76. package/_assets/{fetchTokenMetadata-DeEXEM9T.js → fetchTokenMetadata-DVdGF8SH.js} +2 -2
  77. package/_assets/{field.styles-BYH2xB5-.js → field.styles-ChGQv28p.js} +1 -1
  78. package/_assets/{fortmatic-EI5cNLV0.js → fortmatic-9W3d2zrH.js} +1 -1
  79. package/_assets/{get-bytecode-knYex1Eu.js → get-bytecode-BsB9WanS.js} +1 -1
  80. package/_assets/get-ecosystem-wallet-info-BpyDXVOG.js +1 -0
  81. package/_assets/{getBalance-pkY6oxRI.js → getBalance-NmIU2b2O.js} +2 -2
  82. package/_assets/{getInstalledModules-tywfzr6y.js → getInstalledModules-BE5-ES5I.js} +1 -1
  83. package/_assets/{getNFT-CYm9n3Xd.js → getNFT-BGxpYRoe.js} +2 -2
  84. package/_assets/getNFT-YEPEG38f.js +1 -0
  85. package/_assets/{grid.styles-DoBUqqdT.js → grid.styles-D2J96SwT.js} +1 -1
  86. package/_assets/{hashTypedData-DpkGfcdz.js → hashTypedData-CApfLnos.js} +1 -1
  87. package/_assets/{hashTypedData-ONHChmVW.js → hashTypedData-CcYMI56c.js} +1 -1
  88. package/_assets/{in-app-GxZkDa12.js → in-app-CKc3O4Sv.js} +1 -1
  89. package/_assets/{in-app-wallet-calls-B91UMKOr.js → in-app-wallet-calls-n0DVkHti.js} +1 -1
  90. package/_assets/index-0kdmGL8P.js +3390 -0
  91. package/_assets/index-3QPqSkja.js +1 -0
  92. package/_assets/{index-DEPPVv3y.js → index-4iaG5DfH.js} +1 -1
  93. package/_assets/{index-DOxWmjOH.js → index-6S3FMUEk.js} +1 -1
  94. package/_assets/{index-5GNI01Ww.js → index-6X3q9jcE.js} +1 -1
  95. package/_assets/{index-CSlo2BeJ.js → index-7vaOJntM.js} +1 -1
  96. package/_assets/{index-BJM0Y8Dj.js → index-9ZdEDnsf.js} +1 -1
  97. package/_assets/{index-L36hhrTC.js → index-B0Nj1Xpe.js} +1 -1
  98. package/_assets/{index-CMV7iaeR.js → index-B7SwXBLX.js} +1 -1
  99. package/_assets/{index-L_H5aHd6.js → index-BAuvCwBS.js} +1 -1
  100. package/_assets/{index-BACQuryf.js → index-BBAMyxaq.js} +1 -1
  101. package/_assets/{index-JweqbyGF.js → index-BKGDTHnI.js} +2 -2
  102. package/_assets/{index-BsE741-i.js → index-BW8WltKr.js} +1 -1
  103. package/_assets/{index-B49Ra42Y.js → index-Be2ZgTC2.js} +2 -2
  104. package/_assets/{index-C33PRPh0.js → index-BhB231bL.js} +1 -1
  105. package/_assets/{index-BkDtNpJ9.js → index-BhLXJT-A.js} +1 -1
  106. package/_assets/{index-Bk7mlw_4.js → index-BiCSZsIb.js} +1 -1
  107. package/_assets/{index-_943ql8C.js → index-BkyUhgF6.js} +1 -1
  108. package/_assets/{index-CRQCirWA.js → index-Bm2p-zGj.js} +1 -1
  109. package/_assets/{index-DMNGIYYv.js → index-BmnaNalD.js} +1 -1
  110. package/_assets/{index-Cv1Bu0gQ.js → index-BsSKIwHD.js} +1 -1
  111. package/_assets/{index-Bzt1xZyM.js → index-BxR_qhCB.js} +1 -1
  112. package/_assets/{index-__99MHKr.js → index-BxmGjj2a.js} +2 -2
  113. package/_assets/{index-CTpdUOYC.js → index-BzcwOGk4.js} +1 -1
  114. package/_assets/{index-OxDwxhIP.js → index-BzkS1G6W.js} +1 -1
  115. package/_assets/{index-BpBengnA.js → index-C3Stq5lv.js} +1 -1
  116. package/_assets/{index-BH5LU_4T.js → index-C59CJSbo.js} +1 -1
  117. package/_assets/{index-l4-9ZZLe.js → index-C6MGFWmE.js} +3 -3
  118. package/_assets/{index-B-FT9tly.js → index-C7RtdG3Z.js} +1 -1
  119. package/_assets/{index-DxSEHau1.js → index-CA4L-7AN.js} +1 -1
  120. package/_assets/{index--dDDhPCb.js → index-CBeTDdme.js} +1 -1
  121. package/_assets/{index-DftqIOqz.js → index-CC3KVZ-C.js} +1 -1
  122. package/_assets/{index-t0T-6ZrA.js → index-CF7r6gRE.js} +1 -1
  123. package/_assets/{index-DI-3MKLG.js → index-CJEkcTww.js} +1 -1
  124. package/_assets/{index-Cu9CgJO0.js → index-CLpv_ZJ-.js} +1 -1
  125. package/_assets/{index-OqCfgEJv.js → index-CMEuS0ny.js} +1 -1
  126. package/_assets/{index-BX8-GtYO.js → index-CVOcWyr3.js} +3 -3
  127. package/_assets/{index-INHGq5Es.js → index-CcVPLkSq.js} +1 -1
  128. package/_assets/{index-CIQQJerR.js → index-CczTfLT1.js} +1 -1
  129. package/_assets/{index-B6MX4qjW.js → index-CgeqYqkT.js} +3 -3
  130. package/_assets/{index-BFFeuHAN.js → index-CpR4TF12.js} +1 -1
  131. package/_assets/{index-Bmq5dKA-.js → index-CtdnhIV0.js} +1 -1
  132. package/_assets/{index-73vZ1csI.js → index-CxzejZj0.js} +1 -1
  133. package/_assets/{index-B_JiruyT.js → index-CydESP8d.js} +1 -1
  134. package/_assets/{index-D4Aqu34H.js → index-D0cG_Wab.js} +1 -1
  135. package/_assets/{index-B4d9kGHc.js → index-DGxvuwYE.js} +1 -1
  136. package/_assets/{index-DOiEVNYb.js → index-DN1EN0BQ.js} +1 -1
  137. package/_assets/{index-G6kG-9qx.js → index-DRT-S6qO.js} +1 -1
  138. package/_assets/{index-DPmmgd_P.js → index-DaUjgiMa.js} +2 -2
  139. package/_assets/{index-Bk_uITsR.js → index-DhLM0XTE.js} +1 -1
  140. package/_assets/{index-C5F4093w.js → index-DmMFljl8.js} +1 -1
  141. package/_assets/{index-BYlZ9YbP.js → index-DxEnMKm3.js} +1 -1
  142. package/_assets/{index-DhNV3-07.js → index-DxQd7A0J.js} +1 -1
  143. package/_assets/{index-BkMwrTJ3.js → index-DzGUGKu8.js} +1 -1
  144. package/_assets/{index-E7P9-xl1.js → index-IpNLzHgx.js} +1 -1
  145. package/_assets/{index-Dfv984cL.js → index-KJ7hHQUO.js} +1 -1
  146. package/_assets/{index-CtybxktV.js → index-U0B_ruvX.js} +1 -1
  147. package/_assets/{index-BWh4oQv2.js → index-Y97601kH.js} +1 -1
  148. package/_assets/{index-Cakc_FOK.js → index-Yr43kIYd.js} +1 -1
  149. package/_assets/{index-DGI43LaB.js → index-_jZ2ge8B.js} +1 -1
  150. package/_assets/{index-D3BUTCsu.js → index-c7dUn7oS.js} +1 -1
  151. package/_assets/{index-De1oZcbD.js → index-hCVFHVic.js} +11 -11
  152. package/_assets/{index-CrYXAQF7.js → index-mRgaZ-_k.js} +1 -1
  153. package/_assets/{index-8TbyLPoA.js → index-wnob8aZw.js} +2 -2
  154. package/_assets/{index.es-DD8zy1OU.js → index.es-Bt1vrHLy.js} +1 -1
  155. package/_assets/{index.es-7bD3vSL6.js → index.es-CQZWy8u6.js} +4 -4
  156. package/_assets/{index.es-DdtYF7po.js → index.es-DrGoY9Xx.js} +1 -1
  157. package/_assets/{index.es-DQ3AciL_.js → index.es-DrfFlp1M.js} +1 -1
  158. package/_assets/{linkAccount-BodpWbRq.js → linkAccount-CNeA4_rd.js} +1 -1
  159. package/_assets/{localBatchGatewayRequest-Cqcm6wSH.js → localBatchGatewayRequest-DjDL8c_C.js} +1 -1
  160. package/_assets/{native-DfrS-44q.js → native-D1Bt7nPF.js} +1 -1
  161. package/_assets/{networks-BsQOwKdI.js → networks-BICt4Cqn.js} +1 -1
  162. package/_assets/{onramp-CutBYUPg.js → onramp-DG7xtPwJ.js} +1 -1
  163. package/_assets/{openzeppelin-K-AgEyIf.js → openzeppelin-DT5thYhO.js} +1 -1
  164. package/_assets/{ownerOf-Dw2VC0ue.js → ownerOf-CSle-7WO.js} +1 -1
  165. package/_assets/parseNft-DeY1x__c.js +2 -0
  166. package/_assets/{parseSignature-DnyPA3OO.js → parseSignature-BwH4RvfH.js} +1 -1
  167. package/_assets/{parseSignature-BrLHTUOQ.js → parseSignature-C3vshYUJ.js} +3 -3
  168. package/_assets/{passkeys-zi3xVlV1.js → passkeys-BL7MgzVl.js} +1 -1
  169. package/_assets/{pay-with-exchange-pvINEHpN.js → pay-with-exchange-qF0q90BH.js} +1 -1
  170. package/_assets/{prepare-contract-call-BnXbUbQT.js → prepare-contract-call-Nm9e1q7x.js} +1 -1
  171. package/_assets/{qr-overlay-CLKlyiw2.js → qr-overlay-hZqIuLIW.js} +3 -3
  172. package/_assets/{react-DehiWSvs.js → react-OEOSdkUk.js} +1 -1
  173. package/_assets/{receive-BLXAcZ6B.js → receive-COE1EvWZ.js} +1 -1
  174. package/_assets/{resolveImplementation-CfgIWk0L.js → resolveImplementation-HLbNG2Vp.js} +1 -1
  175. package/_assets/{rpc-C2ZJH6qL.js → rpc-lGsIPm3Z.js} +1 -1
  176. package/_assets/{secp256k1-DQNL-k-L.js → secp256k1-BBTaGZ_Y.js} +1 -1
  177. package/_assets/{secp256k1-BPdRWJXL.js → secp256k1-CQZtwuUm.js} +1 -1
  178. package/_assets/{secp256k1--GaGebUJ.js → secp256k1-GE4zGOQU.js} +1 -1
  179. package/_assets/{send-Cl_aA-ga.js → send-BJWcTbds.js} +1 -1
  180. package/_assets/{send-batch-transaction-1ElceULH.js → send-batch-transaction-Ba7JslR9.js} +1 -1
  181. package/_assets/{send-eip712-transaction-BV_DsAbU.js → send-eip712-transaction-BSFP8vKh.js} +2 -2
  182. package/_assets/send-gasless-transaction-dOOl0_oC.js +2 -0
  183. package/_assets/{send-transaction-DWimy5qX.js → send-transaction-CMc6wANs.js} +2 -2
  184. package/_assets/{sendMetaTransaction-B6HBQ8NH.js → sendMetaTransaction-DqzmtvVe.js} +1 -1
  185. package/_assets/{sendRawTransaction-6C6FbT-9.js → sendRawTransaction-zYZQ5Tfd.js} +3 -3
  186. package/_assets/{sentry-973sfbO9.js → sentry-B60WY-np.js} +1 -1
  187. package/_assets/{serializeTransaction-DJpTnAzh.js → serializeTransaction-CDXHLkZy.js} +1 -1
  188. package/_assets/{session-proposal-B1fE_9QJ.js → session-proposal-B6LJtMoi.js} +1 -1
  189. package/_assets/{session-request-DVlIT2Cz.js → session-request-B2L7VQbP.js} +2 -2
  190. package/_assets/{sha256--PXCNFKm.js → sha256-B3W1x8Ou.js} +1 -1
  191. package/_assets/{signing-C2OtEE_7.js → signing-DH8o0qgI.js} +3 -3
  192. package/_assets/{socials-CwiK-Oz5.js → socials-De6pYslK.js} +1 -1
  193. package/_assets/{styled-INC_AiMB.js → styled-Dlzz4gCY.js} +2 -2
  194. package/_assets/{swaps-Cz6uslns.js → swaps-C1ulCDV2.js} +1 -1
  195. package/_assets/{thirdweb-QagPg_5G.js → thirdweb-BB9WKhiC.js} +3 -3
  196. package/_assets/{to-serializable-transaction-CI3ePtUl.js → to-serializable-transaction-BxPcLWhE.js} +2 -2
  197. package/_assets/{totalSupply-DEpB2B-R.js → totalSupply-BfIXxtR1.js} +1 -1
  198. package/_assets/{transaction-BRB0QRZP.js → transaction-C7nbuBwl.js} +1 -1
  199. package/_assets/{transactionReceipt-B2jt8_c5.js → transactionReceipt-D9BW4O3E.js} +1 -1
  200. package/_assets/{transactions-DuxoNdoM.js → transactions-CA_3u_cG.js} +1 -1
  201. package/_assets/{useCreditPacks-CeoLpXxe.js → useCreditPacks-D4YqwUaM.js} +1 -1
  202. package/_assets/useImportable-B7DZOe6X.js +1 -0
  203. package/_assets/{useInfiniteGrid-D9jUBgv1.js → useInfiniteGrid-DDAFkDbL.js} +1 -1
  204. package/_assets/useTheme-jEgFLoWg.js +1 -0
  205. package/_assets/useUrlFilters-DABDXRpV.js +1 -0
  206. package/_assets/{utils-B9hEgCzc.js → utils-BkRfOA0C.js} +1 -1
  207. package/_assets/{verifyHash-BWYK-_oQ.js → verifyHash-CfhhiiiM.js} +1 -1
  208. package/_assets/{w3m-modal-C_cXhjYQ.js → w3m-modal-Dgkl_pUo.js} +1 -1
  209. package/_assets/{w3m-modal-DeCOfGwP.js → w3m-modal-oirp7A4F.js} +1 -1
  210. package/_assets/{wait-for-tx-receipt-D52q1hNL.js → wait-for-tx-receipt-DJ9PgMUD.js} +1 -1
  211. package/_assets/{wallets-BiRgfoDB.js → wallets-Bj-wvS3Z.js} +5 -5
  212. package/_assets/{web-connector-CI1NmWV2.js → web-connector-Djk4hyaT.js} +3 -3
  213. package/_assets/{writeContract-J3cBsNY4.js → writeContract-oXMRoqds.js} +1 -1
  214. package/_assets/{zora-sepolia-Dv22rzxP.js → zora-sepolia-DOetv30E.js} +1 -1
  215. package/_assets/{zoraTestnet-zRF1Vikt.js → zoraTestnet-nCZwff13.js} +1 -1
  216. package/index.html +11 -11
  217. package/package.json +2 -2
  218. package/_assets/Assets-CH4B54Xy.js +0 -801
  219. package/_assets/Creator-2jJw01qB.js +0 -306
  220. package/_assets/LazyEmoteControls-D7IWhRxC.js +0 -2
  221. package/_assets/authorizations-w-yCHVpU.js +0 -1
  222. package/_assets/buy-DIVuBMot.js +0 -1
  223. package/_assets/decimals-BpjIyOut.js +0 -1
  224. package/_assets/errors-BAqCaL6O.js +0 -1
  225. package/_assets/estimate-l1-fee-D_pdXw9y.js +0 -1
  226. package/_assets/eth_estimateGas-BmR_JMy9.js +0 -1
  227. package/_assets/eth_getTransactionCount-riJ8hG2K.js +0 -1
  228. package/_assets/get-ecosystem-wallet-info-C5KzHIh2.js +0 -1
  229. package/_assets/getNFT-BXJA28mr.js +0 -1
  230. package/_assets/index-CcbRdBPP.js +0 -1
  231. package/_assets/index-DbCMsBDL.js +0 -3504
  232. package/_assets/parseNft-pYm9OVKe.js +0 -2
  233. package/_assets/send-gasless-transaction-eTi92Rfc.js +0 -2
  234. package/_assets/useImportable-CHlGR9sz.js +0 -1
  235. package/_assets/useTheme-HGI9qk_L.js +0 -1
@@ -1,4 +1,4 @@
1
- import{r as $,j as t}from"./react-DehiWSvs.js";import{R as T,C as se,a as ae}from"./categories-BbYXk3ti.js";import{t as e,s as o,I as g,b as s,af as re,C as v,ag as le}from"./index-DbCMsBDL.js";import{n as c,T as ce}from"./Tooltip-Dh6dtNV3.js";const de=o.div`
1
+ import{r as $,j as t}from"./react-OEOSdkUk.js";import{R as T,C as se,a as ae,b as re}from"./categories-CGxAQH-_.js";import{n as c,T as le}from"./Tooltip-xIVvDLOp.js";import{t as e,s as o,I as g,b as s,ai as ce,C as v}from"./index-0kdmGL8P.js";const de=o.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: 12px;
@@ -367,7 +367,7 @@ import{r as $,j as t}from"./react-DehiWSvs.js";import{R as T,C as se,a as ae}fro
367
367
  height: 18px;
368
368
  left: ${({on:i})=>i?"calc(100% - 18px)":"2px"};
369
369
  }
370
- `,d=1e5;function De(i){var l;for(const h of ae){const p=(l=h.subs)==null?void 0:l.find(a=>a.key===i);if(p)return s(p.labelKey)}return i}function j({title:i,open:l,onToggle:h,summary:p,desktopStatic:a,headerTestId:x,headerAria:f,children:u}){const m=t.jsx(le,{up:l,size:24,color:e.colors.text});return t.jsxs(pe,{children:[t.jsxs(xe,{type:"button",desktopStatic:a,onClick:h,"aria-expanded":l,"aria-label":f,"data-testid":x,children:[t.jsx(he,{children:i}),a?t.jsx(me,{children:m}):m]}),!l&&p?t.jsx(ge,{desktopHidden:a,children:p}):null,t.jsx(fe,{open:l,desktopStatic:a,children:t.jsx(ue,{children:u})})]})}function Ye({category:i,subCategory:l,onCategory:h,onSub:p,priceMin:a,priceMax:x,onPriceMin:f,onPriceMax:u,rarities:m,onToggleRarity:B,status:S,onStatus:D,smart:b,onSmart:L,hideNames:O=!1,collections:C=!1,onCollections:_}){const[M,Y]=$.useState(!0),[K,U]=$.useState(!0),[q,G]=$.useState(!1),[V,X]=$.useState(!0),R=a&&!Number.isNaN(Number(a))?Number(a):void 0,z=x&&!Number.isNaN(Number(x))?Number(x):void 0,w=R!=null?Math.min(R,d):0,y=z!=null?Math.min(z,d):d,J=w/d*100,Q=y/d*100;function Z(n){const r=Math.min(n,y);f(r<=0?"":String(r))}function ee(n){const r=Math.max(n,w);u(r>=d?"":String(r))}const te=C?s("categories.collections"):l?De(l):i!=="wearable"?s(`categories.${i==="emote"?"emotes":i==="all"?"shopAll":i}`):"",oe=R!=null||z!=null?`${a||"0"}-${x||"∞"}`:"",ie=T.filter(n=>m.includes(n)).map(re).join(", "),ne=S==="on_sale"?s("filter.onSale"):S==="not_for_sale"?s("filter.notForSale"):"";return t.jsxs(de,{children:[t.jsx(j,{title:s("assets.category"),open:M,onToggle:()=>Y(n=>!n),summary:te,desktopStatic:!0,children:t.jsx(se,{category:i,subCategory:l,onCategory:h,onSub:p,hideNames:O,collections:C,onCollections:_})}),t.jsx(k,{}),t.jsxs(j,{title:s("filter.price"),open:K,onToggle:()=>U(n=>!n),summary:oe,desktopStatic:!0,children:[t.jsxs(be,{children:[t.jsxs(W,{children:[t.jsx(N,{children:s("assets.min")}),t.jsxs(P,{children:[t.jsx(F,{name:v.iconName,"aria-hidden":!0}),t.jsx(E,{type:"number",min:"0","aria-label":s("assets.minPriceAria"),placeholder:"0",value:a,onChange:n=>f(n.target.value)})]})]}),t.jsx(we,{children:s("assets.priceTo")}),t.jsxs(W,{children:[t.jsx(N,{children:s("assets.max")}),t.jsxs(P,{children:[t.jsx(F,{name:v.iconName,"aria-hidden":!0}),t.jsx(E,{type:"number",min:"0","aria-label":s("assets.maxPriceAria"),placeholder:"0",value:x,onChange:n=>u(n.target.value)})]})]})]}),t.jsxs(ye,{children:[t.jsx($e,{"aria-hidden":!0}),t.jsx(ve,{minPct:J,maxPct:Q,"aria-hidden":!0}),t.jsx(I,{type:"range",min:0,max:d,value:w,"aria-label":s("assets.minPriceSliderAria"),onChange:n=>Z(Number(n.target.value))}),t.jsx(I,{type:"range",min:0,max:d,value:y,"aria-label":s("assets.maxPriceSliderAria"),onChange:n=>ee(Number(n.target.value))})]}),t.jsxs(ke,{children:[t.jsxs(A,{children:[t.jsx(H,{name:v.iconName,"aria-hidden":!0}),w.toLocaleString()]}),t.jsxs(A,{children:[t.jsx(H,{name:v.iconName,"aria-hidden":!0}),y.toLocaleString()]})]})]}),t.jsx(k,{}),t.jsx(j,{title:s("assets.rarity"),open:q,onToggle:()=>G(n=>!n),summary:ie,headerTestId:"sidebar-section-toggle",children:t.jsx(je,{"data-testid":"rarity-filter",children:T.map(n=>{const r=m.includes(n);return t.jsxs(Se,{type:"button",selected:r,"aria-pressed":r,onClick:()=>B(n),"data-testid":"rarity-filter-check",children:[t.jsx(Re,{color:e.rarities[n],children:r?t.jsx(ze,{name:"check","aria-hidden":!0}):null}),t.jsx(Ce,{selected:r,children:n})]},n)})})}),t.jsx(k,{}),t.jsx(j,{title:s("filter.status"),open:V,onToggle:()=>X(n=>!n),summary:ne,children:[["all",s("filter.statusAll")],["on_sale",s("filter.onSale")],["not_for_sale",s("filter.notForSale")]].map(([n,r])=>t.jsxs(Te,{children:[t.jsx(We,{type:"radio",name:"shop-status",checked:S===n,onChange:()=>D(n)}),t.jsx(Ne,{children:r})]},n))}),t.jsx(k,{}),t.jsxs(Pe,{children:[t.jsxs(Fe,{children:[t.jsx(Ee,{name:"smart","aria-hidden":!0}),t.jsx(Ie,{children:s("filter.smart")}),t.jsx(ce,{content:s("filter.smartHint"),placement:"bottom",children:t.jsx(Ae,{name:"info",role:"img","aria-label":s("filter.smartHint"),tabIndex:0,"data-testid":"smart-hint"})})]}),t.jsx(He,{type:"button",role:"switch",on:b,"aria-checked":b,"aria-label":s("filter.smart"),onClick:()=>L(!b),children:t.jsx(Be,{on:b})})]})]})}const Ke=o.div`
370
+ `,d=1e5;function De(i){var l;for(const h of ae){const p=(l=h.subs)==null?void 0:l.find(a=>a.key===i);if(p)return s(p.labelKey)}return i}function j({title:i,open:l,onToggle:h,summary:p,desktopStatic:a,headerTestId:x,headerAria:f,children:u}){const m=t.jsx(re,{up:l,size:24,color:e.colors.text});return t.jsxs(pe,{children:[t.jsxs(xe,{type:"button",desktopStatic:a,onClick:h,"aria-expanded":l,"aria-label":f,"data-testid":x,children:[t.jsx(he,{children:i}),a?t.jsx(me,{children:m}):m]}),!l&&p?t.jsx(ge,{desktopHidden:a,children:p}):null,t.jsx(fe,{open:l,desktopStatic:a,children:t.jsx(ue,{children:u})})]})}function Ye({category:i,subCategory:l,onCategory:h,onSub:p,priceMin:a,priceMax:x,onPriceMin:f,onPriceMax:u,rarities:m,onToggleRarity:B,status:S,onStatus:D,smart:b,onSmart:L,hideNames:O=!1,collections:C=!1,onCollections:_}){const[M,Y]=$.useState(!0),[K,U]=$.useState(!0),[q,G]=$.useState(!1),[V,X]=$.useState(!0),R=a&&!Number.isNaN(Number(a))?Number(a):void 0,z=x&&!Number.isNaN(Number(x))?Number(x):void 0,w=R!=null?Math.min(R,d):0,y=z!=null?Math.min(z,d):d,J=w/d*100,Q=y/d*100;function Z(n){const r=Math.min(n,y);f(r<=0?"":String(r))}function ee(n){const r=Math.max(n,w);u(r>=d?"":String(r))}const te=C?s("categories.collections"):l?De(l):i!=="wearable"?s(`categories.${i==="emote"?"emotes":i==="all"?"shopAll":i}`):"",oe=R!=null||z!=null?`${a||"0"}-${x||"∞"}`:"",ie=T.filter(n=>m.includes(n)).map(ce).join(", "),ne=S==="on_sale"?s("filter.onSale"):S==="not_for_sale"?s("filter.notForSale"):"";return t.jsxs(de,{children:[t.jsx(j,{title:s("assets.category"),open:M,onToggle:()=>Y(n=>!n),summary:te,desktopStatic:!0,children:t.jsx(se,{category:i,subCategory:l,onCategory:h,onSub:p,hideNames:O,collections:C,onCollections:_})}),t.jsx(k,{}),t.jsxs(j,{title:s("filter.price"),open:K,onToggle:()=>U(n=>!n),summary:oe,desktopStatic:!0,children:[t.jsxs(be,{children:[t.jsxs(W,{children:[t.jsx(N,{children:s("assets.min")}),t.jsxs(P,{children:[t.jsx(F,{name:v.iconName,"aria-hidden":!0}),t.jsx(E,{type:"number",min:"0","aria-label":s("assets.minPriceAria"),placeholder:"0",value:a,onChange:n=>f(n.target.value)})]})]}),t.jsx(we,{children:s("assets.priceTo")}),t.jsxs(W,{children:[t.jsx(N,{children:s("assets.max")}),t.jsxs(P,{children:[t.jsx(F,{name:v.iconName,"aria-hidden":!0}),t.jsx(E,{type:"number",min:"0","aria-label":s("assets.maxPriceAria"),placeholder:"0",value:x,onChange:n=>u(n.target.value)})]})]})]}),t.jsxs(ye,{children:[t.jsx($e,{"aria-hidden":!0}),t.jsx(ve,{minPct:J,maxPct:Q,"aria-hidden":!0}),t.jsx(I,{type:"range",min:0,max:d,value:w,"aria-label":s("assets.minPriceSliderAria"),onChange:n=>Z(Number(n.target.value))}),t.jsx(I,{type:"range",min:0,max:d,value:y,"aria-label":s("assets.maxPriceSliderAria"),onChange:n=>ee(Number(n.target.value))})]}),t.jsxs(ke,{children:[t.jsxs(A,{children:[t.jsx(H,{name:v.iconName,"aria-hidden":!0}),w.toLocaleString()]}),t.jsxs(A,{children:[t.jsx(H,{name:v.iconName,"aria-hidden":!0}),y.toLocaleString()]})]})]}),t.jsx(k,{}),t.jsx(j,{title:s("assets.rarity"),open:q,onToggle:()=>G(n=>!n),summary:ie,headerTestId:"sidebar-section-toggle",children:t.jsx(je,{"data-testid":"rarity-filter",children:T.map(n=>{const r=m.includes(n);return t.jsxs(Se,{type:"button",selected:r,"aria-pressed":r,onClick:()=>B(n),"data-testid":"rarity-filter-check",children:[t.jsx(Re,{color:e.rarities[n],children:r?t.jsx(ze,{name:"check","aria-hidden":!0}):null}),t.jsx(Ce,{selected:r,children:n})]},n)})})}),t.jsx(k,{}),t.jsx(j,{title:s("filter.status"),open:V,onToggle:()=>X(n=>!n),summary:ne,children:[["all",s("filter.statusAll")],["on_sale",s("filter.onSale")],["not_for_sale",s("filter.notForSale")]].map(([n,r])=>t.jsxs(Te,{children:[t.jsx(We,{type:"radio",name:"shop-status",checked:S===n,onChange:()=>D(n)}),t.jsx(Ne,{children:r})]},n))}),t.jsx(k,{}),t.jsxs(Pe,{children:[t.jsxs(Fe,{children:[t.jsx(Ee,{name:"smart","aria-hidden":!0}),t.jsx(Ie,{children:s("filter.smart")}),t.jsx(le,{content:s("filter.smartHint"),placement:"bottom",children:t.jsx(Ae,{name:"info",role:"img","aria-label":s("filter.smartHint"),tabIndex:0,"data-testid":"smart-hint"})})]}),t.jsx(He,{type:"button",role:"switch",on:b,"aria-checked":b,"aria-label":s("filter.smart"),onClick:()=>L(!b),children:t.jsx(Be,{on:b})})]})]})}const Ke=o.div`
371
371
  position: relative;
372
372
  display: flex;
373
373
  gap: 32px;
@@ -1,4 +1,4 @@
1
- import{j as i,L as _,r as P}from"./react-DehiWSvs.js";import{s as n,B as W,t as a,o as D,q as F,b as e,k as G,v as O,I as z,w as B,n as w,x as K,c as Q,y as H,z as A,A as X,D as Z,E}from"./index-DbCMsBDL.js";import{e as J,f as U,d as V,h as Y,s as tt,b as it}from"./authorizations-w-yCHVpU.js";import{f as et}from"./builder-CYMYImB0.js";import{m as ot}from"./mana-matic-C4e1sNO3.js";import{f as at}from"./errors-BAqCaL6O.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-CmtP3U6y.js";import"./ethers-DejfrZ8i.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-B6HBQ8NH.js";const nt=D`
1
+ import{j as i,L as _,r as F}from"./react-OEOSdkUk.js";import{s as n,B as G,t as a,w as D,x as P,b as e,o as W,y as O,I as z,z as B,v as w,A as K,c as H,D as Q,E as A,F as X,G as Z,H as E}from"./index-0kdmGL8P.js";import{c as J,d as U,b as V,e as Y,s as tt,a as it}from"./authorizations-BixBV4TD.js";import{f as et}from"./builder-yYkfVnmO.js";import{m as ot}from"./mana-matic-C4e1sNO3.js";import{f as at}from"./errors-CBUUj0FX.js";import"./sentry-B60WY-np.js";import"./dcl-schemas-CmtP3U6y.js";import"./ethers-lk3HAbPB.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-DqzmtvVe.js";const nt=D`
2
2
  to { transform: rotate(360deg); }
3
3
  `,st=D`
4
4
  to { background-position: -200% 0; }
@@ -181,6 +181,6 @@ import{j as i,L as _,r as P}from"./react-DehiWSvs.js";import{s as n,B as W,t as
181
181
  font-size: 22px;
182
182
  font-weight: 700;
183
183
  margin: 6px 0 0;
184
- `,M=n(W)`
184
+ `,M=n(G)`
185
185
  margin-top: 12px;
186
- `;function j({descriptor:t,owner:s,signer:r,name:o,description:c,image:l,icon:p}){const v=K(),[h,y]=P.useState(!1),{data:u,isLoading:m,refetch:d}=w({queryKey:["authorization",t.id,s],queryFn:()=>it(t,s),staleTime:3e4});async function g(){if(h||m)return;const b=!u;y(!0);try{await tt({auth:t,signer:r,active:b}),await d(),v.setQueryData(["authorization",t.id,s],b),A.success(b?e("authorizations.toastActivated",{name:o}):e("authorizations.toastDeactivated",{name:o}))}catch($){X($,{flow:"authorizations",step:b?"grant":"revoke"}),A.error(at($,e("authorizations.errorGeneric")))}finally{y(!1)}}const q=m?e("authorizations.checking"):u?e("authorizations.active"):e("authorizations.inactive");return i.jsxs(ut,{"data-testid":`authorization-${t.id}`,"data-active":!!u,children:[i.jsx(pt,{children:l?i.jsx("img",{src:l,alt:""}):p}),i.jsxs(mt,{children:[i.jsx(gt,{title:o,children:o}),i.jsx(xt,{children:c})]}),i.jsxs(yt,{children:[i.jsx(ft,{"data-active":!!u,children:q}),h?i.jsx(zt,{"aria-label":e("authorizations.working")}):i.jsx(bt,{type:"button","data-testid":`authorization-toggle-${t.id}`,"data-active":!!u,role:"switch","aria-checked":!!u,"aria-label":u?e("authorizations.deactivateAria",{name:o}):e("authorizations.activateAria",{name:o}),disabled:m,onClick:()=>void g()})]})]})}const f=500,R=10,wt=f*R;async function N(t,s){const r=await E(t,{category:s,first:f}),o=Math.min(Math.ceil(r.total/f),R),c=await Promise.all(Array.from({length:Math.max(0,o-1)},(l,p)=>E(t,{category:s,first:f,skip:(p+1)*f})));return{assets:[...r.assets,...c.flatMap(l=>l.assets)],truncated:r.total>wt}}function vt(t){return w({queryKey:["owned-collections",t],enabled:!!t,staleTime:6e4,queryFn:async()=>{const[s,r]=await Promise.all([N(t,"wearable"),N(t,"emote")]),o=new Map;for(const c of[...s.assets,...r.assets]){const l=c.contractAddress.toLowerCase();o.has(l)||o.set(l,c)}return{collections:[...o.values()],truncated:s.truncated||r.truncated,scanned:s.assets.length+r.assets.length}}})}function kt(t){return w({queryKey:["contract-registry"],enabled:t,staleTime:1/0,gcTime:1/0,queryFn:Z})}function Ct(t,s){const r=s==null?void 0:s.get(t.toLowerCase());if(r)return r;const o=H(t);return o===t?e("authorizations.collectionFallback"):o}function $t(t,s){return w({queryKey:["creator-collections",t],enabled:!!t&&!!s,staleTime:6e4,queryFn:async()=>{const r=await et(t,s),o=new Map;for(const c of r){const l=c.contractAddress.toLowerCase();o.has(l)||o.set(l,c)}return[...o.values()]}})}function _t(){F({title:e("authorizations.title"),noindex:!0});const{session:t,signIn:s}=G(),r=Q.chainId,o=O(t==null?void 0:t.providerType),{data:c,isLoading:l}=vt(o?t==null?void 0:t.address:void 0),{data:p,isLoading:v}=kt(!!o&&!!(t!=null&&t.address)),{data:h,isLoading:y}=$t(o?t==null?void 0:t.address:void 0,o?t==null?void 0:t.identity:void 0);if(!t)return i.jsxs(S,{children:[i.jsx(z,{name:"info",size:40,color:a.colors.muted2}),i.jsx(L,{children:e("authorizations.signInTitle")}),i.jsx("p",{className:"muted",children:e("authorizations.signInBody")}),i.jsx(M,{variant:"purple",onClick:()=>s(),children:e("storeSettings.signIn")})]});if(!o)return i.jsxs(S,{children:[i.jsx(z,{name:"check",size:40,color:a.colors.ok}),i.jsx(L,{children:e("authorizations.managedTitle")}),i.jsx("p",{className:"muted",children:e("authorizations.managedBody")}),i.jsx(M,{as:_,to:"/items",variant:"purple",children:e("authorizations.managedCta")})]});const u=J(r),m=U(r);return i.jsxs(rt,{children:[i.jsxs(ct,{children:[i.jsx(lt,{children:e("authorizations.title")}),i.jsx(dt,{children:e("authorizations.intro")})]}),i.jsxs(k,{children:[i.jsx(C,{children:e("authorizations.buyingTitle")}),i.jsxs(x,{children:[i.jsx(j,{descriptor:u,owner:t.address,signer:t.signer,name:e("authorizations.creditsName"),description:e("authorizations.creditsDesc"),icon:i.jsx(B,{className:"ccy-mark"})}),i.jsx(j,{descriptor:m,owner:t.address,signer:t.signer,name:e("authorizations.manaName"),description:e("authorizations.manaDesc"),icon:i.jsx(ht,{src:ot,alt:"","aria-hidden":!0})})]})]}),i.jsxs(k,{children:[i.jsx(C,{children:e("authorizations.sellingTitle")}),c!=null&&c.truncated?i.jsx(jt,{"data-testid":"authorizations-selling-truncated",children:e("authorizations.sellingTruncated",{count:c.scanned})}):null,l||v?i.jsx(x,{"aria-busy":"true","aria-label":e("authorizations.checking"),children:Array.from({length:3}).map((d,g)=>i.jsx(T,{"aria-hidden":!0},g))}):c&&c.collections.length>0?i.jsx(x,{children:c.collections.map(d=>i.jsx(j,{descriptor:V(d.contractAddress,r),owner:t.address,signer:t.signer,name:Ct(d.contractAddress,p),description:e("authorizations.sellingDesc"),image:d.image,icon:i.jsx(z,{name:"pen",size:18})},d.contractAddress))}):i.jsx(I,{children:e("authorizations.sellingEmpty")})]}),i.jsxs(k,{children:[i.jsx(C,{children:e("authorizations.mintingTitle")}),y?i.jsx(x,{"aria-busy":"true","aria-label":e("authorizations.checking"),children:Array.from({length:3}).map((d,g)=>i.jsx(T,{"aria-hidden":!0},g))}):h&&h.length>0?i.jsx(x,{children:h.map(d=>i.jsx(j,{descriptor:Y(d.contractAddress,r),owner:t.address,signer:t.signer,name:d.name||e("authorizations.collectionFallback"),description:e("authorizations.mintingDesc"),icon:i.jsx(z,{name:"pen",size:18})},d.contractAddress))}):i.jsx(I,{children:e("authorizations.mintingEmpty")})]})]})}export{_t as Authorizations};
186
+ `;function j({descriptor:t,owner:s,signer:r,name:o,description:c,image:l,icon:p}){const v=K(),[h,y]=F.useState(!1),{data:u,isLoading:m,refetch:d}=w({queryKey:["authorization",t.id,s],queryFn:()=>it(t,s),staleTime:3e4});async function g(){if(h||m)return;const b=!u;y(!0);try{await tt({auth:t,signer:r,active:b}),await d(),v.setQueryData(["authorization",t.id,s],b),A.success(b?e("authorizations.toastActivated",{name:o}):e("authorizations.toastDeactivated",{name:o}))}catch($){X($,{flow:"authorizations",step:b?"grant":"revoke"}),A.error(at($,e("authorizations.errorGeneric")))}finally{y(!1)}}const q=m?e("authorizations.checking"):u?e("authorizations.active"):e("authorizations.inactive");return i.jsxs(ut,{"data-testid":`authorization-${t.id}`,"data-active":!!u,children:[i.jsx(pt,{children:l?i.jsx("img",{src:l,alt:""}):p}),i.jsxs(mt,{children:[i.jsx(gt,{title:o,children:o}),i.jsx(xt,{children:c})]}),i.jsxs(yt,{children:[i.jsx(ft,{"data-active":!!u,children:q}),h?i.jsx(zt,{"aria-label":e("authorizations.working")}):i.jsx(bt,{type:"button","data-testid":`authorization-toggle-${t.id}`,"data-active":!!u,role:"switch","aria-checked":!!u,"aria-label":u?e("authorizations.deactivateAria",{name:o}):e("authorizations.activateAria",{name:o}),disabled:m,onClick:()=>void g()})]})]})}const f=500,R=10,wt=f*R;async function N(t,s){const r=await E(t,{category:s,first:f}),o=Math.min(Math.ceil(r.total/f),R),c=await Promise.all(Array.from({length:Math.max(0,o-1)},(l,p)=>E(t,{category:s,first:f,skip:(p+1)*f})));return{assets:[...r.assets,...c.flatMap(l=>l.assets)],truncated:r.total>wt}}function vt(t){return w({queryKey:["owned-collections",t],enabled:!!t,staleTime:6e4,queryFn:async()=>{const[s,r]=await Promise.all([N(t,"wearable"),N(t,"emote")]),o=new Map;for(const c of[...s.assets,...r.assets]){const l=c.contractAddress.toLowerCase();o.has(l)||o.set(l,c)}return{collections:[...o.values()],truncated:s.truncated||r.truncated,scanned:s.assets.length+r.assets.length}}})}function kt(t){return w({queryKey:["contract-registry"],enabled:t,staleTime:1/0,gcTime:1/0,queryFn:Z})}function Ct(t,s){const r=s==null?void 0:s.get(t.toLowerCase());if(r)return r;const o=Q(t);return o===t?e("authorizations.collectionFallback"):o}function $t(t,s){return w({queryKey:["creator-collections",t],enabled:!!t&&!!s,staleTime:6e4,queryFn:async()=>{const r=await et(t,s),o=new Map;for(const c of r){const l=c.contractAddress.toLowerCase();o.has(l)||o.set(l,c)}return[...o.values()]}})}function _t(){P({title:e("authorizations.title"),noindex:!0});const{session:t,signIn:s}=W(),r=H.chainId,o=O(t==null?void 0:t.providerType),{data:c,isLoading:l}=vt(o?t==null?void 0:t.address:void 0),{data:p,isLoading:v}=kt(!!o&&!!(t!=null&&t.address)),{data:h,isLoading:y}=$t(o?t==null?void 0:t.address:void 0,o?t==null?void 0:t.identity:void 0);if(!t)return i.jsxs(S,{children:[i.jsx(z,{name:"info",size:40,color:a.colors.muted2}),i.jsx(L,{children:e("authorizations.signInTitle")}),i.jsx("p",{className:"muted",children:e("authorizations.signInBody")}),i.jsx(M,{variant:"purple",onClick:()=>s(),children:e("storeSettings.signIn")})]});if(!o)return i.jsxs(S,{children:[i.jsx(z,{name:"check",size:40,color:a.colors.ok}),i.jsx(L,{children:e("authorizations.managedTitle")}),i.jsx("p",{className:"muted",children:e("authorizations.managedBody")}),i.jsx(M,{as:_,to:"/items",variant:"purple",children:e("authorizations.managedCta")})]});const u=J(r),m=U(r);return i.jsxs(rt,{children:[i.jsxs(ct,{children:[i.jsx(lt,{children:e("authorizations.title")}),i.jsx(dt,{children:e("authorizations.intro")})]}),i.jsxs(k,{children:[i.jsx(C,{children:e("authorizations.buyingTitle")}),i.jsxs(x,{children:[i.jsx(j,{descriptor:u,owner:t.address,signer:t.signer,name:e("authorizations.creditsName"),description:e("authorizations.creditsDesc"),icon:i.jsx(B,{className:"ccy-mark"})}),i.jsx(j,{descriptor:m,owner:t.address,signer:t.signer,name:e("authorizations.manaName"),description:e("authorizations.manaDesc"),icon:i.jsx(ht,{src:ot,alt:"","aria-hidden":!0})})]})]}),i.jsxs(k,{children:[i.jsx(C,{children:e("authorizations.sellingTitle")}),c!=null&&c.truncated?i.jsx(jt,{"data-testid":"authorizations-selling-truncated",children:e("authorizations.sellingTruncated",{count:c.scanned})}):null,l||v?i.jsx(x,{"aria-busy":"true","aria-label":e("authorizations.checking"),children:Array.from({length:3}).map((d,g)=>i.jsx(T,{"aria-hidden":!0},g))}):c&&c.collections.length>0?i.jsx(x,{children:c.collections.map(d=>i.jsx(j,{descriptor:V(d.contractAddress,r),owner:t.address,signer:t.signer,name:Ct(d.contractAddress,p),description:e("authorizations.sellingDesc"),image:d.image,icon:i.jsx(z,{name:"pen",size:18})},d.contractAddress))}):i.jsx(I,{children:e("authorizations.sellingEmpty")})]}),i.jsxs(k,{children:[i.jsx(C,{children:e("authorizations.mintingTitle")}),y?i.jsx(x,{"aria-busy":"true","aria-label":e("authorizations.checking"),children:Array.from({length:3}).map((d,g)=>i.jsx(T,{"aria-hidden":!0},g))}):h&&h.length>0?i.jsx(x,{children:h.map(d=>i.jsx(j,{descriptor:Y(d.contractAddress,r),owner:t.address,signer:t.signer,name:d.name||e("authorizations.collectionFallback"),description:e("authorizations.mintingDesc"),icon:i.jsx(z,{name:"pen",size:18})},d.contractAddress))}):i.jsx(I,{children:e("authorizations.mintingEmpty")})]})]})}export{_t as Authorizations};
@@ -1,4 +1,4 @@
1
- import{j as e,L as Se,r as P,d as Zt,b as ea}from"./react-DehiWSvs.js";import{t as le,s as i,b as a,aA as de,b6 as ta,az as aa,I as H,w as St,ae as Ke,q as sa,P as Q,ah as ot,k as na,l as ia,n as ra,b7 as oa,x as ca,b8 as da,ai as la,b9 as ua,ba as ct,bb as ha,bc as pa,v as ga,bd as dt,R as G,be as lt,bf as xa,A as ae,r as ma,c as ut,bg as fa,C as ya,bh as ht,bi as Re,bj as ba,bk as fe,bl as ye,bm as pt,g as be,d as va,e as Be,bn as wa}from"./index-DbCMsBDL.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 Ra,i as Ba,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-CnR1So5p.js";import{p as us,q as hs,b as ps,t as gs,j as xs,A as ms}from"./authorizations-w-yCHVpU.js";import{g as fs,j as We}from"./buy-DIVuBMot.js";import{b as ys,w as bs,S as bt,G as vs}from"./buy-gasless-DIfZSqYX.js";import{u as ws,M as Cs,R as ve,r as js,c as ks,p as vt}from"./useCreditPacks-CeoLpXxe.js";import{i as Ss,a as $s}from"./errors-BAqCaL6O.js";import{E as Ms}from"./ErrorNotice-BXWX_0E4.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-CmtP3U6y.js";import"./ethers-DejfrZ8i.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-B6HBQ8NH.js";const{colors:se,radius:Ts}=le,Is=i.div`
1
+ import{j as e,L as Se,r as P,e as Zt,d as ea}from"./react-OEOSdkUk.js";import{t as le,s as i,b as a,aD as de,b9 as ta,aC as aa,I as H,z as St,ah as Ke,x as sa,S as Q,aj as ot,o as na,q as ia,v as ra,ba as oa,A as ca,bb as da,ak as la,bc as ua,bd as ct,be as ha,bf as pa,y as ga,bg as dt,V as G,bh as lt,bi as xa,F as ae,r as ma,c as ut,bj as fa,C as ya,bk as ht,bl as Be,bm as ba,bn as fe,bo as ye,bp as pt,g as be,f as va,h as Re,bq as wa}from"./index-0kdmGL8P.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-BeRnGCYD.js";import{k as us,l as hs,a as ps,n as gs,f as xs,A as ms}from"./authorizations-BixBV4TD.js";import{g as fs,j as We}from"./buy-C6t8EdJL.js";import{b as ys,w as bs,S as bt,G as vs}from"./buy-gasless-uXmROTXZ.js";import{u as ws,M as Cs,R as ve,r as js,c as ks,p as vt}from"./useCreditPacks-D4YqwUaM.js";import{i as Ss,a as $s}from"./errors-CBUUj0FX.js";import{E as Ms}from"./ErrorNotice-Q_ppMazV.js";import"./sentry-B60WY-np.js";import"./dcl-schemas-CmtP3U6y.js";import"./ethers-lk3HAbPB.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-DqzmtvVe.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,d as Zt,b as ea}from"./react-DehiWSvs.js";import{t
58
58
  font-weight: 700;
59
59
  color: ${se.text};
60
60
  }
61
- `,qs="https://cdn.decentraland.org/@dcl/shop/0.8.0/_assets/buy-error-22UunaPC.png";function Rs(o){const{phase:l,balanceCredits:I,onClose:z}=o,W=l==="processing",D=l==="error"?a("cartCheckout.errorTitle"):l==="nofunds"?a("cartCheckout.titleNoFunds"):l==="choose"?a("buyModal.choosePayment"):a("cartCheckout.titleBuy"),Y=l==="processing";return e.jsxs(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(Bs,{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(Ra,{src:qs,alt:"",width:64,height:80}),e.jsxs(Ba,{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 Bs({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.8.1-31010487922.commit-7e8c168/_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`
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
@@ -692,4 +692,4 @@ import{j as e,L as Se,r as P,d as Zt,b as ea}from"./react-DehiWSvs.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 Rt=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(),[Bt,ie]=P.useState(null),[Ue,he]=P.useState(null),[_t,R]=P.useState(!1),[B,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=B?B.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(B==null?void 0:B.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),R(!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}),R(!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 Re(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),R(!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 Re(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")}),R(!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),R(!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)}),R(!1)}async function Gt(t,s){const d=be(Be.MANAToken,s),c=be(Be.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}),R(!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(Be.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)){R(!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&&Re(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),R(!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{R(!1)}}async function nt(){if(B){if(!n){ft({type:"cart-checkout"}),L();return}if(Date.now()-Ne.current>An){O(null),he(null),await te();return}ie(null),Ze(B.buyable)}}async function Xt(){if(Me){try{sessionStorage.setItem(ve,JSON.stringify(Q.getState().items))}catch{}R(!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{R(!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})}),Rt?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:B?a("marketCheckout.confirmPurchase"):ce.options.length>1?a("cart.buyWithCredits"):a("cart.checkout"),busy:V||Ie,onPay:t=>void(B?nt():te(t))}):e.jsx(In,{onClick:()=>void(B?nt():te()),disabled:V||Ie,children:V?a("cart.working"):B?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")}),B?e.jsx(we,{className:"muted",children:a("cart.priceChanged")}):null,Ue?e.jsx(we,{className:"muted",children:Ue}):null,e.jsx(Pn,{message:Bt})]})]})]})]}),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(Rs,{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(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};
@@ -1,4 +1,4 @@
1
- import{aa as N,ab as U,ac as o,ad as n,ae as D,o as M}from"./index-DbCMsBDL.js";import{r as w,j as g}from"./react-DehiWSvs.js";import{g as z,a as E,c as I,b as F}from"./clsx-WwvpwSg0.js";import{s as v}from"./styled-INC_AiMB.js";function K(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 a=44,B=M(P||(P=l`
1
+ import{ad as N,ae as w,af as o,ag as n,ah as D,w as M}from"./index-0kdmGL8P.js";import{r as U,j as g}from"./react-OEOSdkUk.js";import{g as z,a as E,c as I,b as F}from"./clsx-WwvpwSg0.js";import{s as v}from"./styled-Dlzz4gCY.js";function K(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
  }
@@ -21,8 +21,8 @@ import{aa as N,ab as U,ac as o,ad as n,ae as D,o as M}from"./index-DbCMsBDL.js";
21
21
  stroke-dasharray: 100px, 200px;
22
22
  stroke-dashoffset: -125px;
23
23
  }
24
- `)),L=r=>{const{classes:e,variant:s,color:t,disableShrink:d}=r,m={root:["root",s,`color${n(t)}`],svg:["svg"],circle:["circle",`circle${n(s)}`,d&&"circleDisableShrink"]};return F(m,K,e)},V=v("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(r,e)=>{const{ownerState:s}=r;return[e.root,e[s.variant],e[`color${n(s.color)}`]]}})(({ownerState:r,theme:e})=>o({display:"inline-block"},r.variant==="determinate"&&{transition:e.transitions.create("transform")},r.color!=="inherit"&&{color:(e.vars||e).palette[r.color].main}),({ownerState:r})=>r.variant==="indeterminate"&&D(S||(S=l`
24
+ `)),L=r=>{const{classes:e,variant:s,color:a,disableShrink:d}=r,m={root:["root",s,`color${n(a)}`],svg:["svg"],circle:["circle",`circle${n(s)}`,d&&"circleDisableShrink"]};return F(m,K,e)},V=v("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(r,e)=>{const{ownerState:s}=r;return[e.root,e[s.variant],e[`color${n(s.color)}`]]}})(({ownerState:r,theme:e})=>o({display:"inline-block"},r.variant==="determinate"&&{transition:e.transitions.create("transform")},r.color!=="inherit"&&{color:(e.vars||e).palette[r.color].main}),({ownerState:r})=>r.variant==="indeterminate"&&D(S||(S=l`
25
25
  animation: ${0} 1.4s linear infinite;
26
26
  `),B)),Z=v("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(r,e)=>e.svg})({display:"block"}),q=v("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(r,e)=>{const{ownerState:s}=r;return[e.circle,e[`circle${n(s.variant)}`],s.disableShrink&&e.circleDisableShrink]}})(({ownerState:r,theme:e})=>o({stroke:"currentColor"},r.variant==="determinate"&&{transition:e.transitions.create("stroke-dashoffset")},r.variant==="indeterminate"&&{strokeDasharray:"80px, 200px",strokeDashoffset:0}),({ownerState:r})=>r.variant==="indeterminate"&&!r.disableShrink&&D($||($=l`
27
27
  animation: ${0} 1.4s ease-in-out infinite;
28
- `),G)),Q=w.forwardRef(function(e,s){const t=N({props:e,name:"MuiCircularProgress"}),{className:d,color:m="primary",disableShrink:R=!1,size:u=40,style:_,thickness:i=3.6,value:p=0,variant:k="indeterminate"}=t,j=U(t,W),c=o({},t,{color:m,disableShrink:R,size:u,thickness:i,value:p,variant:k}),f=L(c),h={},x={},y={};if(k==="determinate"){const C=2*Math.PI*((a-i)/2);h.strokeDasharray=C.toFixed(3),y["aria-valuenow"]=Math.round(p),h.strokeDashoffset=`${((100-p)/100*C).toFixed(3)}px`,x.transform="rotate(-90deg)"}return g.jsx(V,o({className:I(f.root,d),style:o({width:u,height:u},x,_),ownerState:c,ref:s,role:"progressbar"},y,j,{children:g.jsx(Z,{className:f.svg,ownerState:c,viewBox:`${a/2} ${a/2} ${a} ${a}`,children:g.jsx(q,{className:f.circle,style:h,ownerState:c,cx:a,cy:a,r:(a-i)/2,fill:"none",strokeWidth:i})})}))});export{Q as C};
28
+ `),G)),Q=U.forwardRef(function(e,s){const a=N({props:e,name:"MuiCircularProgress"}),{className:d,color:m="primary",disableShrink:R=!1,size:u=40,style:_,thickness:i=3.6,value:f=0,variant:k="indeterminate"}=a,j=w(a,W),c=o({},a,{color:m,disableShrink:R,size:u,thickness:i,value:f,variant:k}),p=L(c),h={},x={},y={};if(k==="determinate"){const C=2*Math.PI*((t-i)/2);h.strokeDasharray=C.toFixed(3),y["aria-valuenow"]=Math.round(f),h.strokeDashoffset=`${((100-f)/100*C).toFixed(3)}px`,x.transform="rotate(-90deg)"}return g.jsx(V,o({className:I(p.root,d),style:o({width:u,height:u},x,_),ownerState:c,ref:s,role:"progressbar"},y,j,{children:g.jsx(Z,{className:p.svg,ownerState:c,viewBox:`${t/2} ${t/2} ${t} ${t}`,children:g.jsx(q,{className:p.circle,style:h,ownerState:c,cx:t,cy:t,r:(t-i)/2,fill:"none",strokeWidth:i})})}))});export{Q as C};
@@ -1,4 +1,4 @@
1
- import{j as e,r as h,u as J,d as X}from"./react-DehiWSvs.js";import{t as b,s,bo as ee,V as te,y as z,bp as ae,bq as oe,I as ie,b as a,c as re,A as se,n as ne,q as ce,C as le,ak as F,al as de,br as pe,bs as xe}from"./index-DbCMsBDL.js";import{E as me}from"./ErrorNotice-BXWX_0E4.js";import{d as he,P as ue,C as ge,a as be,b as fe,A as ve}from"./collectionPage.styles-CHbJGgda.js";import{S as L,C as ye,F as je,b as Ce,P as we,c as $e,H as ke,d as Ne}from"./categories-BbYXk3ti.js";import{L as Ae}from"./LoadMore-DcIHY8Kf.js";import{u as Pe}from"./useInfiniteGrid-D9jUBgv1.js";import{G as Se}from"./grid.styles-DoBUqqdT.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-CmtP3U6y.js";import"./ethers-DejfrZ8i.js";import"./intl-CBcMB1D2.js";const Me=s.section`
1
+ import{j as e,r as h,a as J,e as X}from"./react-OEOSdkUk.js";import{t as b,s,br as ee,Y as te,D as T,bs as ae,bt as oe,I as ie,b as a,c as re,F as se,v as ne,x as ce,C as le,am as z,an as de,bu as pe,bv as xe}from"./index-0kdmGL8P.js";import{E as me}from"./ErrorNotice-Q_ppMazV.js";import{d as he,P as ue,C as ge,a as be,b as fe,A as ve}from"./collectionPage.styles-DxfKkCjZ.js";import{S as L,C as je,F as ye,c as Ce,P as we,d as $e,H as ke,e as Ne}from"./categories-CGxAQH-_.js";import{L as Pe}from"./LoadMore-DSHozISi.js";import{u as Se}from"./useInfiniteGrid-DDAFkDbL.js";import{G as Ae}from"./grid.styles-D2J96SwT.js";import"./sentry-B60WY-np.js";import"./dcl-schemas-CmtP3U6y.js";import"./ethers-lk3HAbPB.js";import"./intl-CBcMB1D2.js";const Me=s.section`
2
2
  position: relative;
3
3
  border-radius: ${b.radius.card};
4
4
  overflow: hidden;
@@ -15,16 +15,16 @@ import{j as e,r as h,u as J,d as X}from"./react-DehiWSvs.js";import{t as b,s,bo
15
15
  position: absolute;
16
16
  inset: 0;
17
17
  z-index: 0;
18
- `,Re=s.img`
18
+ `,Fe=s.img`
19
19
  width: 100%;
20
20
  height: 100%;
21
21
  object-fit: cover;
22
22
  display: block;
23
- `,Te=s.div`
23
+ `,Re=s.div`
24
24
  position: absolute;
25
25
  inset: 0;
26
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`
27
+ `,Te=s.h1`
28
28
  position: relative;
29
29
  z-index: 1;
30
30
  margin: 0;
@@ -42,7 +42,7 @@ import{j as e,r as h,u as J,d as X}from"./react-DehiWSvs.js";import{t as b,s,bo
42
42
  padding: 24px 16px;
43
43
  font-size: 26px;
44
44
  }
45
- `;function Fe({name:o,creator:t}){const{data:n}=ee(t),d=(n==null?void 0:n.cover)||he;return e.jsxs(Me,{"data-testid":"collection-hero","aria-label":o,children:[e.jsxs(Ee,{children:[e.jsx(Re,{src:d,alt:"",loading:"eager"}),e.jsx(Te,{"aria-hidden":!0})]}),e.jsx(ze,{"data-testid":"collection-hero-title",children:o})]})}const{colors:c,radius:I}=b,Le=s.div`
45
+ `;function ze({name:o,creator:t}){const{data:n}=ee(t),d=(n==null?void 0:n.cover)||he;return e.jsxs(Me,{"data-testid":"collection-hero","aria-label":o,children:[e.jsxs(Ee,{children:[e.jsx(Fe,{src:d,alt:"",loading:"eager"}),e.jsx(Re,{"aria-hidden":!0})]}),e.jsx(Te,{"data-testid":"collection-hero-title",children:o})]})}const{colors:c,radius:I}=b,Le=s.div`
46
46
  display: flex;
47
47
  flex-direction: column;
48
48
  align-items: center;
@@ -116,7 +116,7 @@ import{j as e,r as h,u as J,d as X}from"./react-DehiWSvs.js";import{t as b,s,bo
116
116
  background: ${c.accent};
117
117
  color: ${c.white};
118
118
  }
119
- `;function _e({address:o}){var v,l;const{data:t}=te(o),[n,d]=h.useState(!1);if(!o)return null;const p=(t==null?void 0:t.name)||z(o),u=(l=(v=t==null?void 0:t.avatar)==null?void 0:v.snapshots)==null?void 0:l.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),d(!0),window.setTimeout(()=>d(!1),1500)}catch(j){se(j,{flow:"copy_creator_address"})}}return e.jsxs(Le,{"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(Be,{title:p,children:p}),e.jsxs(Ie,{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:z(o)}),e.jsx(ie,{name:"copy",size:16})]}),e.jsx(We,{"data-testid":"creator-card-view",href:g,target:"_blank",rel:"noopener noreferrer",children:a("collection.viewProfile")})]})}const{colors:qe,media:$}=b,Ge=s.div`
119
+ `;function _e({address:o}){var v,l;const{data:t}=te(o),[n,d]=h.useState(!1);if(!o)return null;const p=(t==null?void 0:t.name)||T(o),u=(l=(v=t==null?void 0:t.avatar)==null?void 0:v.snapshots)==null?void 0:l.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),d(!0),window.setTimeout(()=>d(!1),1500)}catch(y){se(y,{flow:"copy_creator_address"})}}return e.jsxs(Le,{"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(Be,{title:p,children:p}),e.jsxs(Ie,{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:T(o)}),e.jsx(ie,{name:"copy",size:16})]}),e.jsx(We,{"data-testid":"creator-card-view",href:g,target:"_blank",rel:"noopener noreferrer",children:a("collection.viewProfile")})]})}const{colors:Ge,media:$}=b,He=s.div`
120
120
  position: relative;
121
121
  display: flex;
122
122
  gap: 32px;
@@ -125,14 +125,14 @@ import{j as e,r as h,u as J,d as X}from"./react-DehiWSvs.js";import{t as b,s,bo
125
125
  ${$.maxWidth("lg")} {
126
126
  display: block;
127
127
  }
128
- `,He=s.div`
128
+ `,Ue=s.div`
129
129
  flex: 1;
130
130
  min-width: 0;
131
131
 
132
132
  ${$.maxWidth("lg")} {
133
133
  width: 100%;
134
134
  }
135
- `,Ue=s.aside`
135
+ `,Ye=s.aside`
136
136
  flex: none;
137
137
  width: 265px;
138
138
 
@@ -146,7 +146,7 @@ import{j as e,r as h,u as J,d as X}from"./react-DehiWSvs.js";import{t as b,s,bo
146
146
  width: 100%;
147
147
  max-height: 88vh;
148
148
  border-radius: 16px 16px 0 0;
149
- background: ${qe.white};
149
+ background: ${Ge.white};
150
150
  padding: 0 16px;
151
151
  overflow-y: auto;
152
152
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.18);
@@ -159,4 +159,4 @@ import{j as e,r as h,u as J,d as X}from"./react-DehiWSvs.js";import{t as b,s,bo
159
159
  visibility: visible;
160
160
  }
161
161
  }
162
- `,Ye=48;function it(){var T;const{contractAddress:o}=J(),t=X(),[n,d]=h.useState("wearable"),[p,u]=h.useState(null),[g,f]=h.useState([]),[x,v]=h.useState(""),[l,j]=h.useState(""),[k,W]=h.useState("newest"),N=x&&!Number.isNaN(Number(x))?Number(x):void 0,A=l&&!Number.isNaN(Number(l))?Number(l):void 0,_=p?Ne[p]:void 0,q=(L.find(i=>i.key===k)??L[0]).server,P={category:n,rarities:g.length?g:void 0,wearableCategories:_,minPriceCredits:N,maxPriceCredits:A,sortBy:q},{items:y,total:G,isLoading:C,error:S,hasNextPage:H,isFetchingNextPage:M,isFetchNextPageError:U,fetchNextPage:Y}=Pe(["collection-page",o,P],i=>pe(o,{...P,first:Ye,skip:i}),{enabled:!!o}),{data:r}=ne({queryKey:["collection-meta",o],queryFn:()=>xe(o),enabled:!!o,staleTime:5*6e4}),E=(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 R=(r==null?void 0:r.creator)||((T=y[0])==null?void 0:T.creator);function K(i){d(i),u(null)}function V(i){f(m=>m.includes(i)?m.filter(Z=>Z!==i):[...m,i])}function D(){d("wearable"),u(null),f([]),v(""),j("")}const w=!!(N||A),O=w?`${x||"0"}–${l||"∞"}`:a("filter.price"),Q=n!=="wearable"||!!p||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:E})]}),e.jsx(Fe,{name:E,creator:R}),e.jsxs(Ge,{"data-testid":"browse",children:[e.jsxs(Ue,{"data-testid":"browse-sidebar",children:[e.jsx(_e,{address:R}),e.jsx(ye,{category:n,subCategory:p,onCategory:K,onSub:u,title:a("collection.category"),flat:!0})]}),e.jsxs(He,{children:[!C&&y.length>0?e.jsx(ve,{items:y,source:"collection"}):null,e.jsx(je,{rarities:g,onToggleRarity:V,sort:k,onSort:W,total:G,loading:C,anyActive:Q,onClear:D,renderTrailing:i=>e.jsx(Ce,{panelKey:"price",label:O,active:w,panel:i,children:e.jsxs(we,{"data-variant":"price",children:[e.jsxs($e,{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:l,onChange:m=>j(m.target.value)})]}),e.jsx(ke,{children:a("collection.priceHint",{currency:le.name})})]})})}),S?e.jsx(me,{message:a("collection.error")}):null,e.jsx(Se,{"data-testid":"grid",children:C?e.jsx(F,{count:15}):e.jsxs(e.Fragment,{children:[y.map(i=>e.jsx(de,{item:i},i.id)),M?e.jsx(F,{count:6}):null]})}),e.jsx(Ae,{hasNextPage:H,isFetching:M,isError:U,onLoadMore:()=>void Y()}),!C&&!S&&y.length===0?e.jsx("p",{className:"muted",children:a("collection.empty")}):null]})]})]})}export{it as Collection,it as default};
162
+ `,qe=48;function it(){var R;const{contractAddress:o}=J(),t=X(),[n,d]=h.useState("wearable"),[p,u]=h.useState(null),[g,f]=h.useState([]),[x,v]=h.useState(""),[l,y]=h.useState(""),[k,W]=h.useState("newest"),N=x&&!Number.isNaN(Number(x))?Number(x):void 0,P=l&&!Number.isNaN(Number(l))?Number(l):void 0,_=p?Ne[p]:void 0,G=(L.find(i=>i.key===k)??L[0]).server,S={category:n,rarities:g.length?g:void 0,wearableCategories:_,minPriceCredits:N,maxPriceCredits:P,sortBy:G},{items:j,total:H,isLoading:C,error:A,hasNextPage:U,isFetchingNextPage:M,isFetchNextPageError:Y,fetchNextPage:q}=Se(["collection-page",o,S],i=>pe(o,{...S,first:qe,skip:i}),{enabled:!!o}),{data:r}=ne({queryKey:["collection-meta",o],queryFn:()=>xe(o),enabled:!!o,staleTime:5*6e4}),E=(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 F=(r==null?void 0:r.creator)||((R=j[0])==null?void 0:R.creator);function D(i){d(i),u(null)}function K(i){f(m=>m.includes(i)?m.filter(Z=>Z!==i):[...m,i])}function O(){d("wearable"),u(null),f([]),v(""),y("")}const w=!!(N||P),Q=w?`${x||"0"}–${l||"∞"}`:a("filter.price"),V=n!=="wearable"||!!p||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:E})]}),e.jsx(ze,{name:E,creator:F}),e.jsxs(He,{"data-testid":"browse",children:[e.jsxs(Ye,{"data-testid":"browse-sidebar",children:[e.jsx(_e,{address:F}),e.jsx(je,{category:n,subCategory:p,onCategory:D,onSub:u,title:a("collection.category"),flat:!0})]}),e.jsxs(Ue,{children:[!C&&j.length>0?e.jsx(ve,{items:j,source:"collection"}):null,e.jsx(ye,{rarities:g,onToggleRarity:K,sort:k,onSort:W,total:H,loading:C,anyActive:V,onClear:O,renderTrailing:i=>e.jsx(Ce,{panelKey:"price",label:Q,active:w,panel:i,children:e.jsxs(we,{"data-variant":"price",children:[e.jsxs($e,{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:l,onChange:m=>y(m.target.value)})]}),e.jsx(ke,{children:a("collection.priceHint",{currency:le.name})})]})})}),A?e.jsx(me,{message:a("collection.error")}):null,e.jsx(Ae,{"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:Y,onLoadMore:()=>void q()}),!C&&!A&&j.length===0?e.jsx("p",{className:"muted",children:a("collection.empty")}):null]})]})]})}export{it as Collection,it as default};