@dcl/shop 0.1.0-29254949383.commit-2b6a284 → 0.1.0-29254959255.commit-3cd2325

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 (169) hide show
  1. package/assets/{AnimatedBackground-CBTW32pD.js → AnimatedBackground-CDUBj4y0.js} +3 -3
  2. package/assets/{Assets-CCVQi0rI.js → Assets-NANr3qb9.js} +1 -1
  3. package/assets/{Button-Cr1_TS3D.js → Button-DqWM_3MR.js} +1 -1
  4. package/assets/{Cart-BvzVbU00.js → Cart-CTQGm_ja.js} +1 -1
  5. package/assets/{CircularProgress-DmKPpYYp.js → CircularProgress-BBL7xJ_3.js} +1 -1
  6. package/assets/{Collection-DWWE6LCn.js → Collection-ZuFsA8L4.js} +1 -1
  7. package/assets/{Creator-S-8XDh4B.js → Creator-C0jkSnJz.js} +1 -1
  8. package/assets/{ExchangeController-C16UGsPI.js → ExchangeController-DVY12NoW.js} +1 -1
  9. package/assets/{GetCredits-BdkbVl1H.js → GetCredits-CZ4zbmx6.js} +2 -2
  10. package/assets/{HelpersUtil-DtC5olF9.js → HelpersUtil-Ca5EgHCl.js} +1 -1
  11. package/assets/{ImportListings-C2_DJBwz.js → ImportListings-3mKD8qbb.js} +1 -1
  12. package/assets/ItemDetail-B9tJjLlJ.js +2 -0
  13. package/assets/{ItemDetail-eaGx2XMJ.css → ItemDetail-Casltmsg.css} +1 -1
  14. package/assets/{Market-Cw2GjoaL.js → Market-D61zxQ67.js} +1 -1
  15. package/assets/{MenuItem-DWYHS5jY.js → MenuItem-BbaNE8Mu.js} +1 -1
  16. package/assets/{MyAssets-BjiqkBzd.css → MyAssets-BqJHbQOZ.css} +1 -1
  17. package/assets/MyAssets-C3-t_mYq.js +1 -0
  18. package/assets/{MyFavorites-BXHZPa3S.js → MyFavorites--YAxltWz.js} +1 -1
  19. package/assets/{MyPurchases-4bq_8873.js → MyPurchases-DT6NEYdT.js} +1 -1
  20. package/assets/{NotFound-2_SxsvRo.js → NotFound-cPBFVHQG.js} +1 -1
  21. package/assets/{RealCheckout-DfpfMajt.js → RealCheckout-B4OdfXIG.js} +1 -1
  22. package/assets/{ShopFooterInner-ChpdTUyi.js → ShopFooterInner-EIBXBQ5d.js} +2 -2
  23. package/assets/{Success-CfpPpfJ2.js → Success-QTNYiUu0.js} +1 -1
  24. package/assets/{SvgIcon-CMfDTydC.js → SvgIcon-DVGrnwOp.js} +1 -1
  25. package/assets/{SwapController-DVHdee2F.js → SwapController-9C4gdC6w.js} +1 -1
  26. package/assets/{TradeService-Bd-vLt2h.js → TradeService-Bx9MzH12.js} +1 -1
  27. package/assets/{W3MFrameProviderSingleton-lwu7rhSU.js → W3MFrameProviderSingleton-kv89Sw6-.js} +3 -3
  28. package/assets/{WebCryptoP256-DmRCPcui.js → WebCryptoP256-PWLKGmE2.js} +1 -1
  29. package/assets/{basic-CDnbFgPw.js → basic-rVcDTIXu.js} +1 -1
  30. package/assets/{biconomy-C-AP_kvC.js → biconomy-DkqOwXyF.js} +1 -1
  31. package/assets/{buy-njp9xZO9.js → buy-Bv5rL_T6.js} +1 -1
  32. package/assets/{buy-gasless-3T0lk5aN.js → buy-gasless-Dl9oiGu4.js} +1 -1
  33. package/assets/{ccip-BYmSUL4p.js → ccip-CtooyqJg.js} +1 -1
  34. package/assets/{ccip-rSz0T9dj.js → ccip-DCFO-8m6.js} +1 -1
  35. package/assets/{collection-DaX7TWx3.js → collection-eKqAvjgr.js} +1 -1
  36. package/assets/{controller-QzyC0r-m.js → controller-GhfmDvHC.js} +2 -2
  37. package/assets/{core-CiQ-rgdc.js → core-5Z2KWHyv.js} +4 -4
  38. package/assets/{custom-BtXnP1ca.js → custom-C6zpUGAU.js} +1 -1
  39. package/assets/{data-capture-Da2_lc8C.js → data-capture-BJ5v-o61.js} +1 -1
  40. package/assets/decimals-BxZhgLeZ.js +1 -0
  41. package/assets/{decimals-CmjzGAcp.js → decimals-DyunviVp.js} +1 -1
  42. package/assets/{detectExtension-CSunUUY7.js → detectExtension-HSZKGRbO.js} +1 -1
  43. package/assets/{email-DFEkdCeY.js → email-j61gB4s7.js} +1 -1
  44. package/assets/{embedded-wallet-BiQwlvkX.js → embedded-wallet-B-wAditN.js} +1 -1
  45. package/assets/{engine-Cc1lsUp2.js → engine-CSxB2Vjm.js} +1 -1
  46. package/assets/{estimate-l1-fee-DhqI4M8P.js → estimate-l1-fee-DsqSQ-w1.js} +1 -1
  47. package/assets/{eth_estimateGas-DInlnlVz.js → eth_estimateGas-C82UNSAP.js} +1 -1
  48. package/assets/{eth_getStorageAt-C_xjUjBL.js → eth_getStorageAt-BcOw0zaP.js} +1 -1
  49. package/assets/{eth_getTransactionCount-C5eqLYqv.js → eth_getTransactionCount-BfkmHf_V.js} +1 -1
  50. package/assets/{extractIPFS-DMgu6Pq0.js → extractIPFS-CKOWe-1p.js} +1 -1
  51. package/assets/{features-CosSBUTn.js → features-XJ9gScxQ.js} +1 -1
  52. package/assets/{fetchTokenMetadata-Pp9y-Tfu.js → fetchTokenMetadata-DtUGEjWS.js} +2 -2
  53. package/assets/{generateUtilityClasses-YwmkdnPH.js → generateUtilityClasses-BqTxi5Sw.js} +1 -1
  54. package/assets/{get-ecosystem-wallet-info-BkineL4d.js → get-ecosystem-wallet-info-yojC0uAC.js} +1 -1
  55. package/assets/{getBalance-BMwxDuIL.js → getBalance-CMpD2uJP.js} +1 -1
  56. package/assets/{getInstalledModules-_eL918qz.js → getInstalledModules-Dp_ahHJG.js} +1 -1
  57. package/assets/{getNFT-CkUh8MA-.js → getNFT-Bu3jwggk.js} +1 -1
  58. package/assets/{getNFT-XLHc3NxY.js → getNFT-C8EC9Sa0.js} +2 -2
  59. package/assets/{hashTypedData-wraUldbi.js → hashTypedData-BPBVYwD_.js} +1 -1
  60. package/assets/{hashTypedData-ByDD-Jrs.js → hashTypedData-U5LYyrLd.js} +1 -1
  61. package/assets/{import-DuwIf2Pi.js → import-Cu8VVfW_.js} +1 -1
  62. package/assets/{in-app-wallet-calls-CvA7f9QC.js → in-app-wallet-calls-BP2Orkpm.js} +1 -1
  63. package/assets/{index-DvrPGZ5s.js → index-3oy1YetG.js} +1 -1
  64. package/assets/{index-Tc5UVwrs.js → index-6UZiNOm8.js} +1 -1
  65. package/assets/{index-DFGD5YdA.js → index-6oDymZWR.js} +1 -1
  66. package/assets/{index-CQLwRG38.js → index-7vJT2Rc7.js} +1 -1
  67. package/assets/{index-CcekaRK4.js → index-B-3a8HUY.js} +1 -1
  68. package/assets/{index-CncCZvNK.js → index-B2r4N10f.js} +3 -3
  69. package/assets/{index-Djz26u1Z.js → index-B7OlhSeG.js} +1 -1
  70. package/assets/{index-DdayI9kv.js → index-B7Z9rZTg.js} +1 -1
  71. package/assets/{index-CpruLnUV.js → index-B8g5zh3J.js} +1 -1
  72. package/assets/{index-A4m4wBnM.js → index-B9jRxa7Y.js} +1 -1
  73. package/assets/{index-DUecbvfD.js → index-B9u2XRPF.js} +1 -1
  74. package/assets/{index-DmBTWkhQ.js → index-BJHE167Q.js} +1 -1
  75. package/assets/{index-RCMVZOG-.js → index-BOdLHYvg.js} +1 -1
  76. package/assets/{index-oY2L5ByU.js → index-BVtD7LOo.js} +1 -1
  77. package/assets/{index-DvWJff_y.js → index-BfYQUwfq.js} +1 -1
  78. package/assets/{index-CkmZ55LK.js → index-BkPFXYI2.js} +1 -1
  79. package/assets/{index-CO_QSDoE.js → index-Bo-mQR8I.js} +1 -1
  80. package/assets/{index-TPp0P2AO.js → index-Boh7V7mm.js} +1 -1
  81. package/assets/{index-D_L_F2T3.js → index-CIwwzuMJ.js} +2 -2
  82. package/assets/{index-C1il374B.js → index-CKaFkODt.js} +1 -1
  83. package/assets/{index-Cs9y7LTd.js → index-CLC_1CrD.js} +1 -1
  84. package/assets/{index-CO0o2xky.js → index-CZPmTNzF.js} +1 -1
  85. package/assets/{index-D8aVqRam.js → index-CjauG1a_.js} +1 -1
  86. package/assets/{index-BboeApBF.js → index-Cl3BEBGX.js} +1 -1
  87. package/assets/{index-D85x0yip.js → index-CqgmbxdM.js} +1 -1
  88. package/assets/{index-trRRxvAA.js → index-Cqn-WYye.js} +1 -1
  89. package/assets/{index-B7lFElXy.js → index-CsMtLDxg.js} +1 -1
  90. package/assets/{index-DT0GWRTw.js → index-D3nSaxcC.js} +1 -1
  91. package/assets/{index-0wvjQ-oP.js → index-DB2-ofZ2.js} +1 -1
  92. package/assets/{index-BiC8AOx_.js → index-DC3L0_Kx.js} +31 -31
  93. package/assets/{index-wDjEy5n2.js → index-DDxG-8Gu.js} +1 -1
  94. package/assets/{index-BDgRiE-g.js → index-DK6BFOyH.js} +1 -1
  95. package/assets/{index-dF1gY6xl.js → index-DM1AwHt_.js} +1 -1
  96. package/assets/{index-9Flu8lxW.js → index-DNU-lqWb.js} +1 -1
  97. package/assets/{index-yqk7Psy8.js → index-DXi8gKNe.js} +1 -1
  98. package/assets/{index-OTnqX510.js → index-DZoQw4aY.js} +1 -1
  99. package/assets/{index-BelWVI_u.js → index-Do3kfWO6.js} +1 -1
  100. package/assets/{index-BREgCTzU.js → index-DredIDCG.js} +1 -1
  101. package/assets/{index-ClQ8rl7A.js → index-DuDlVW1U.js} +1 -1
  102. package/assets/{index-CadBLrlA.js → index-DvXHw62x.js} +1 -1
  103. package/assets/{index-D3SmImrT.js → index-DxWadf5b.js} +1 -1
  104. package/assets/{index-D0UQKaej.js → index-IXx60DdU.js} +2 -2
  105. package/assets/{index-D3aM00of.js → index-JXH4_6X2.js} +2 -2
  106. package/assets/{index-B8OTXzM2.js → index-KGZnnoZ8.js} +1 -1
  107. package/assets/{index-rktQ2LR5.js → index-KUQH6SSY.js} +1 -1
  108. package/assets/{index-DliU9pat.css → index-MNMpVtqO.css} +1 -1
  109. package/assets/{index-CpNYJcRx.js → index-SnX7JYIG.js} +1 -1
  110. package/assets/{index-kRa6J0YH.js → index-Sz6yV1AN.js} +1 -1
  111. package/assets/{index-D1RzRzjx.js → index-WNGJ9Ytg.js} +1 -1
  112. package/assets/{index-BPiOplYA.js → index-YgH_1ppY.js} +3 -3
  113. package/assets/{index-s-iN_q-_.js → index-ZzQQOhdb.js} +1 -1
  114. package/assets/{index-CPbjyJbw.js → index-_RIV5Ko4.js} +1 -1
  115. package/assets/{index-DsN8eKxF.js → index-mUuAO2ml.js} +1 -1
  116. package/assets/{index-D7xkl2o1.js → index-uNE5Ox4P.js} +1 -1
  117. package/assets/{index.es-60mBMII2.js → index.es-BFUliaII.js} +1 -1
  118. package/assets/{index.es-BoSAg8zf.js → index.es-BadTMk3h.js} +4 -4
  119. package/assets/{index.es-CZ7uV2fx.js → index.es-CFYNDRAV.js} +1 -1
  120. package/assets/{localBatchGatewayRequest-CXMJFr4c.js → localBatchGatewayRequest-Cclkr3d7.js} +1 -1
  121. package/assets/{mana-rate-G2IgQgyW.js → mana-rate-CgBtfPJ6.js} +1 -1
  122. package/assets/network-BgQHihpS.js +1 -0
  123. package/assets/{networks-r9sGE5Sj.js → networks-CM3sGb4g.js} +1 -1
  124. package/assets/{onramp-CgVoKVW7.js → onramp-DDJcttCc.js} +1 -1
  125. package/assets/{openzeppelin-Rpe03s_y.js → openzeppelin-ceMGZM-q.js} +1 -1
  126. package/assets/{ownerOf-BTHg84bk.js → ownerOf-C75PqCPi.js} +1 -1
  127. package/assets/{parseNft-C463ehIS.js → parseNft-gClEo5Oe.js} +2 -2
  128. package/assets/{parseSignature-uk9asJmq.js → parseSignature-B9oH4Syp.js} +3 -3
  129. package/assets/{parseSignature-CqoG_x5i.js → parseSignature-OVARoa0M.js} +1 -1
  130. package/assets/{pay-with-exchange-BgZ0yWjf.js → pay-with-exchange-CrzyGoub.js} +1 -1
  131. package/assets/{qr-overlay-Bs59urO9.js → qr-overlay-CbfDPRwR.js} +1 -1
  132. package/assets/{receive-DQvaRb00.js → receive-DnrL7aZf.js} +1 -1
  133. package/assets/{resolveImplementation-DiWDOoC-.js → resolveImplementation-Cd4HLyYY.js} +1 -1
  134. package/assets/{rpc-B0v2hmqw.js → rpc-CCo5yy8Q.js} +1 -1
  135. package/assets/{secp256k1-D_5IJQNP.js → secp256k1-CyqqpLxz.js} +1 -1
  136. package/assets/{secp256k1-8zpNemVO.js → secp256k1-DStZYSGU.js} +1 -1
  137. package/assets/{secp256k1-CIWvHXa5.js → secp256k1-DnzE4zk2.js} +1 -1
  138. package/assets/{send-DFdllAvp.js → send-CLns-jZW.js} +1 -1
  139. package/assets/{send-batch-transaction-Cue_fsYP.js → send-batch-transaction-DhJEXjx9.js} +1 -1
  140. package/assets/{send-eip712-transaction-J7PyLuy0.js → send-eip712-transaction-BTPIfxOm.js} +2 -2
  141. package/assets/{send-gasless-transaction-CGqmc9gq.js → send-gasless-transaction-BAH91Jx0.js} +2 -2
  142. package/assets/{sendRawTransaction-DqQfBvpK.js → sendRawTransaction-BkJ9p7sm.js} +3 -3
  143. package/assets/{serializeTransaction-D10WG6BP.js → serializeTransaction-DfoZ0-AM.js} +1 -1
  144. package/assets/{session-proposal-BXcSOyh5.js → session-proposal-D-kOKjun.js} +1 -1
  145. package/assets/{session-request-LLQFj3Mu.js → session-request-CeKA0NjC.js} +2 -2
  146. package/assets/{sha256-Cjhq2dOS.js → sha256-Djgj_foZ.js} +1 -1
  147. package/assets/{signing-Y9nDnMGa.js → signing-Bh7MmapP.js} +4 -4
  148. package/assets/{socials-Dmewiywq.js → socials-BEJbWDsD.js} +1 -1
  149. package/assets/{swaps-GYMEid1a.js → swaps-DToo_E-Z.js} +1 -1
  150. package/assets/{thirdweb-CfOvVeCU.js → thirdweb-ueK5F6MO.js} +3 -3
  151. package/assets/{totalSupply-CQ0r81cJ.js → totalSupply-BYSgGgpL.js} +1 -1
  152. package/assets/{transactionReceipt-QQ0xtwGL.js → transactionReceipt-CwzOJtK0.js} +1 -1
  153. package/assets/{transactions-TNSbdrJw.js → transactions-CvCj54mG.js} +1 -1
  154. package/assets/{useInfiniteGrid-CnC_JbP2.js → useInfiniteGrid-DnX_HQZy.js} +1 -1
  155. package/assets/{verifyHash-BJoqovyM.js → verifyHash-DutlRonP.js} +1 -1
  156. package/assets/{w3m-modal-BW3eS204.js → w3m-modal-BtFBBvXP.js} +1 -1
  157. package/assets/{w3m-modal-CIT0kzHW.js → w3m-modal-DB4RFiQ_.js} +1 -1
  158. package/assets/{wait-for-tx-receipt-BIo4AREx.js → wait-for-tx-receipt-H0jp18XR.js} +1 -1
  159. package/assets/{wallet-kind-BbqVQ9gJ.js → wallet-kind-CyXbsyHc.js} +1 -1
  160. package/assets/{wallets-DnAbchdq.js → wallets-XuFRxnmh.js} +6 -6
  161. package/assets/{web-connector-BdTNreEm.js → web-connector-DEXgdVv-.js} +3 -3
  162. package/assets/{writeContract-BMiXHHeE.js → writeContract-D-E_9p9e.js} +1 -1
  163. package/assets/{zoraTestnet-BpyNeGFA.js → zoraTestnet-oUYOCNKW.js} +1 -1
  164. package/index.html +8 -8
  165. package/package.json +2 -2
  166. package/assets/ItemDetail-CVw1nXip.js +0 -2
  167. package/assets/MyAssets-1ZE1pasl.js +0 -1
  168. package/assets/decimals-gDjL7Ktl.js +0 -1
  169. package/assets/network-CnbVq7Z0.js +0 -1
@@ -1,11 +1,11 @@
1
- import{r as l,j as v}from"./react-Vu6nbGi5.js";const w="https://cdn.decentraland.org/@dcl/shop/0.1.0-29254949383.commit-2b6a284/assets/custom-welcome-background-BxlFQma9.webp",S="https://cdn.decentraland.org/@dcl/shop/0.1.0-29254949383.commit-2b6a284/assets/DCL_LogoPattern-BryBPc3d.png",b=`
1
+ import{r as l,j as v}from"./react-Vu6nbGi5.js";const w="https://cdn.decentraland.org/@dcl/shop/0.1.0-29254959255.commit-3cd2325/assets/custom-welcome-background-BxlFQma9.webp",S="https://cdn.decentraland.org/@dcl/shop/0.1.0-29254959255.commit-3cd2325/assets/DCL_LogoPattern-BryBPc3d.png",U=`
2
2
  attribute vec2 a_position;
3
3
  varying vec2 v_uv;
4
4
  void main() {
5
5
  v_uv = a_position * 0.5 + 0.5;
6
6
  gl_Position = vec4(a_position, 0.0, 1.0);
7
7
  }
8
- `,U=`
8
+ `,b=`
9
9
  precision highp float;
10
10
 
11
11
  uniform float u_time;
@@ -77,4 +77,4 @@ void main() {
77
77
 
78
78
  gl_FragColor = result;
79
79
  }
80
- `;function g(t,a,r){const e=t.createShader(a);return e?(t.shaderSource(e,r),t.compileShader(e),t.getShaderParameter(e,t.COMPILE_STATUS)?e:(console.error("Shader compile error:",t.getShaderInfoLog(e)),t.deleteShader(e),null)):null}function P(t,a,r){const e=t.createProgram();return e?(t.attachShader(e,a),t.attachShader(e,r),t.linkProgram(e),t.getProgramParameter(e,t.LINK_STATUS)?e:(console.error("Program link error:",t.getProgramInfoLog(e)),t.deleteProgram(e),null)):null}function D(t,a,r){const e=t.createTexture();if(!e)return null;t.bindTexture(t.TEXTURE_2D,e),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array([128,128,128,255]));const o=new Image;return o.crossOrigin="anonymous",o.onload=()=>{r!=null&&r()||(t.bindTexture(t.TEXTURE_2D,e),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,!0),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,o),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR_MIPMAP_LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.generateMipmap(t.TEXTURE_2D))},o.src=a,e}function L(){const t=l.useRef(null),a=l.useRef(0);return l.useEffect(()=>{var h;const r=t.current;if(!r||(h=window.matchMedia)!=null&&h.call(window,"(prefers-reduced-motion: reduce)").matches)return;const e=r.getContext("webgl",{alpha:!1,antialias:!1});if(!e)return;const o=g(e,e.VERTEX_SHADER,b),c=g(e,e.FRAGMENT_SHADER,U);if(!o||!c){o&&e.deleteShader(o),c&&e.deleteShader(c);return}const n=P(e,o,c);if(!n){e.deleteShader(o),e.deleteShader(c);return}const u=e.getAttribLocation(n,"a_position"),_=e.getUniformLocation(n,"u_time"),R=e.getUniformLocation(n,"u_resolution"),y=e.getUniformLocation(n,"u_overlayTex"),s=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,s),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),e.STATIC_DRAW);let m=!1;const d=D(e,S,()=>m),A=()=>{const i=window.devicePixelRatio||1,x=r.clientWidth*i,E=r.clientHeight*i;(r.width!==x||r.height!==E)&&(r.width=x,r.height=E)},p=performance.now()/1e3,f=()=>{A(),e.viewport(0,0,r.width,r.height),e.useProgram(n),e.uniform1f(_,performance.now()/1e3-p),e.uniform2f(R,r.width,r.height),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,d),e.uniform1i(y,0),e.enableVertexAttribArray(u),e.bindBuffer(e.ARRAY_BUFFER,s),e.vertexAttribPointer(u,2,e.FLOAT,!1,0,0),e.drawArrays(e.TRIANGLES,0,6),a.current=requestAnimationFrame(f)},T=i=>{i.preventDefault(),cancelAnimationFrame(a.current),r.style.opacity="0"};return r.addEventListener("webglcontextlost",T,!1),a.current=requestAnimationFrame(f),()=>{m=!0,cancelAnimationFrame(a.current),r.removeEventListener("webglcontextlost",T),e.deleteProgram(n),e.deleteShader(o),e.deleteShader(c),e.deleteBuffer(s),e.deleteTexture(d)}},[]),v.jsxs("div",{className:"AnimatedBackground","aria-hidden":!0,children:[v.jsx("div",{className:"AnimatedBackground__fallback",style:{backgroundImage:`url(${w})`}}),v.jsx("canvas",{ref:t,className:"AnimatedBackground__canvas"})]})}export{L as default};
80
+ `;function g(t,a,r){const e=t.createShader(a);return e?(t.shaderSource(e,r),t.compileShader(e),t.getShaderParameter(e,t.COMPILE_STATUS)?e:(console.error("Shader compile error:",t.getShaderInfoLog(e)),t.deleteShader(e),null)):null}function P(t,a,r){const e=t.createProgram();return e?(t.attachShader(e,a),t.attachShader(e,r),t.linkProgram(e),t.getProgramParameter(e,t.LINK_STATUS)?e:(console.error("Program link error:",t.getProgramInfoLog(e)),t.deleteProgram(e),null)):null}function D(t,a,r){const e=t.createTexture();if(!e)return null;t.bindTexture(t.TEXTURE_2D,e),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array([128,128,128,255]));const o=new Image;return o.crossOrigin="anonymous",o.onload=()=>{r!=null&&r()||(t.bindTexture(t.TEXTURE_2D,e),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,!0),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,o),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR_MIPMAP_LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.generateMipmap(t.TEXTURE_2D))},o.src=a,e}function L(){const t=l.useRef(null),a=l.useRef(0);return l.useEffect(()=>{var h;const r=t.current;if(!r||(h=window.matchMedia)!=null&&h.call(window,"(prefers-reduced-motion: reduce)").matches)return;const e=r.getContext("webgl",{alpha:!1,antialias:!1});if(!e)return;const o=g(e,e.VERTEX_SHADER,U),c=g(e,e.FRAGMENT_SHADER,b);if(!o||!c){o&&e.deleteShader(o),c&&e.deleteShader(c);return}const n=P(e,o,c);if(!n){e.deleteShader(o),e.deleteShader(c);return}const u=e.getAttribLocation(n,"a_position"),_=e.getUniformLocation(n,"u_time"),R=e.getUniformLocation(n,"u_resolution"),y=e.getUniformLocation(n,"u_overlayTex"),s=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,s),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),e.STATIC_DRAW);let m=!1;const d=D(e,S,()=>m),A=()=>{const i=window.devicePixelRatio||1,x=r.clientWidth*i,E=r.clientHeight*i;(r.width!==x||r.height!==E)&&(r.width=x,r.height=E)},p=performance.now()/1e3,f=()=>{A(),e.viewport(0,0,r.width,r.height),e.useProgram(n),e.uniform1f(_,performance.now()/1e3-p),e.uniform2f(R,r.width,r.height),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,d),e.uniform1i(y,0),e.enableVertexAttribArray(u),e.bindBuffer(e.ARRAY_BUFFER,s),e.vertexAttribPointer(u,2,e.FLOAT,!1,0,0),e.drawArrays(e.TRIANGLES,0,6),a.current=requestAnimationFrame(f)},T=i=>{i.preventDefault(),cancelAnimationFrame(a.current),r.style.opacity="0"};return r.addEventListener("webglcontextlost",T,!1),a.current=requestAnimationFrame(f),()=>{m=!0,cancelAnimationFrame(a.current),r.removeEventListener("webglcontextlost",T),e.deleteProgram(n),e.deleteShader(o),e.deleteShader(c),e.deleteBuffer(s),e.deleteTexture(d)}},[]),v.jsxs("div",{className:"AnimatedBackground","aria-hidden":!0,children:[v.jsx("div",{className:"AnimatedBackground__fallback",style:{backgroundImage:`url(${w})`}}),v.jsx("canvas",{ref:t,className:"AnimatedBackground__canvas"})]})}export{L as default};
@@ -1 +1 @@
1
- import{r as i,j as e,b as D}from"./react-Vu6nbGi5.js";import{j as P,k as I,A as K,l as J}from"./index-BiC8AOx_.js";import{S as F,F as W,a as Y}from"./FilterBar-CdU8B66A.js";import{S as A}from"./SkeletonCards-BysJEVmg.js";import{L as Z}from"./LoadMore-BOCtgPLI.js";import{u as z}from"./useInfiniteGrid-CnC_JbP2.js";import"./ethers-JeCAM1sd.js";const Q=[{key:"all",label:"Shop All"},{key:"wearable",label:"Wearables",expandable:!0,subs:[{key:"Head",label:"Head",icon:"cat-head"},{key:"Upper Body",label:"Upper Body",icon:"cat-upper"},{key:"Handwear",label:"Handwear",icon:"cat-handwear"},{key:"Lower Body",label:"Lower Body",icon:"cat-lower"},{key:"Feet",label:"Feet",icon:"cat-feet"},{key:"Accessories",label:"Accessories",icon:"cat-accessories"},{key:"Skins",label:"Skins",icon:"cat-skins"}]},{key:"emote",label:"Emotes",expandable:!0,subs:[{key:"Dance",label:"Dance",icon:"emote-dance"},{key:"Stunt",label:"Stunt",icon:"emote-stunt"},{key:"Greetings",label:"Greetings",icon:"emote-greetings"},{key:"Fun",label:"Fun",icon:"emote-fun"},{key:"Poses",label:"Poses",icon:"emote-poses"},{key:"Reactions",label:"Reactions",icon:"emote-reactions"},{key:"Horror",label:"Horror",icon:"emote-horror"},{key:"Miscellaneous",label:"Miscellaneous",icon:"emote-misc"}]}];function V({category:f,subCategory:n,onCategory:l,onSub:x}){const[c,p]=i.useState(()=>f==="wearable"?"wearable":null);function o(s){s.subs?p(t=>{const u=t!==s.key;return u&&l(s.key),u?s.key:null}):(l(s.key),p(null))}return e.jsx("div",{className:"catfilter",children:Q.map(s=>{const t=c===s.key&&!!s.subs,u=s.key===f;return e.jsxs("div",{className:"catfilter__group",children:[e.jsxs("button",{type:"button",className:`catfilter__cat${t?" is-expanded":""}${u?" is-selected":""}`,onClick:()=>o(s),children:[e.jsx("span",{className:"catfilter__cat-label",children:s.label}),s.expandable?e.jsx("span",{className:`ico ico-chevron catfilter__chev${t?" is-up":""}`,"aria-hidden":!0}):null]}),s.subs?e.jsx("div",{className:`catfilter__subs${t?" is-open":""}`,children:e.jsx("div",{className:"catfilter__subs-inner",children:s.subs.map(r=>e.jsx("button",{type:"button",className:`catfilter__sub${n===r.key?" is-active":""}`,onClick:()=>x(n===r.key?null:r.key),children:e.jsxs("span",{className:"catfilter__sub-left",children:[e.jsx("span",{className:`ico ico-${r.icon} catfilter__sub-ico`,"aria-hidden":!0}),e.jsx("span",{className:"catfilter__sub-label",children:r.label})]})},r.key))})}):null]},s.key)})})}const X=48,ee={Head:["head","hat","hair","facial_hair","eyes","eyebrows","mouth","mask","helmet","tiara","top_head"],"Upper Body":["upper_body"],Handwear:["hands_wear"],"Lower Body":["lower_body"],Feet:["feet"],Accessories:["earring","eyewear"],Skins:["skin"],Dance:["dance"],Stunt:["stunt"],Greetings:["greetings"],Fun:["fun"],Poses:["poses"],Reactions:["reactions"],Horror:["horror"],Miscellaneous:["miscellaneous"]};function ce(){const[f]=D(),n=(f.get("q")??"").trim().toLowerCase(),[l,x]=i.useState("wearable"),[c,p]=i.useState(null),[o,s]=i.useState([]),[t,u]=i.useState(""),[r,N]=i.useState(""),[b,M]=i.useState("newest"),y=t&&!Number.isNaN(Number(t))?Number(t):void 0,h=r&&!Number.isNaN(Number(r))?Number(r):void 0,R=c?ee[c]:void 0,E=(F.find(a=>a.key===b)??F[0]).server,j={category:l,rarities:o.length?o:void 0,wearableCategories:R,minPriceCredits:y,maxPriceCredits:h,search:n||void 0,sortBy:E},{items:S,total:w,isLoading:d,error:L,hasNextPage:B,isFetchingNextPage:v,fetchNextPage:H}=z(["listings",j],a=>J({...j,first:X,skip:a})),_=w,C=i.useRef(null);i.useEffect(()=>{d||!n||C.current===n||(C.current=n,P("Shop Searched",{query:n,result_count:_}))},[n,d,_]);const g=i.useRef("__init__");i.useEffect(()=>{if(d)return;const a=JSON.stringify({category:l,subCategory:c,rarities:o,min:y,max:h,sort:b});if(g.current==="__init__"||g.current===a){g.current=a;return}g.current=a,P("Shop Applied Filter",{filters:{category:l,sub_category:c,rarities:o,min_price_credits:y??null,max_price_credits:h??null,sort:b},result_count:_})},[l,c,o,y,h,b,d,_]);function $(a){x(a),p(null)}function G(a){s(m=>m.includes(a)?m.filter(O=>O!==a):[...m,a])}function T(){x("wearable"),p(null),s([]),u(""),N("")}const k=!!(y||h),U=k?`${t||"0"}–${r||"∞"}`:"Price",q=l!=="wearable"||!!c||o.length>0||k;return e.jsxs("div",{className:"browse browse--sidebar",children:[e.jsx("aside",{className:"browse__sidebar",children:e.jsx(V,{category:l,subCategory:c,onCategory:$,onSub:p})}),e.jsxs("div",{className:"browse__main",children:[e.jsx(W,{rarities:o,onToggleRarity:G,sort:b,onSort:M,total:w,loading:d,query:n,anyActive:q,onClear:T,renderTrailing:a=>e.jsx(Y,{panelKey:"price",label:U,active:k,panel:a,children:e.jsxs("div",{className:"filter-pop filter-pop--price",children:[e.jsxs("div",{className:"filter-pop__price-row",children:[e.jsx("input",{type:"number",min:"0","aria-label":"Minimum price",placeholder:"Min",value:t,onChange:m=>u(m.target.value)}),e.jsx("span",{children:"–"}),e.jsx("input",{type:"number",min:"0","aria-label":"Maximum price",placeholder:"Max",value:r,onChange:m=>N(m.target.value)})]}),e.jsxs("p",{className:"filter-pop__hint",children:["Price in ",I.name]})]})})}),L?e.jsx("p",{className:"error",children:"Couldn’t load items — please try again."}):null,e.jsx("div",{className:"grid",children:d?e.jsx(A,{count:15}):e.jsxs(e.Fragment,{children:[S.map(a=>e.jsx(K,{item:a},a.id)),v?e.jsx(A,{count:6}):null]})}),e.jsx(Z,{hasNextPage:B,isFetching:v,onLoadMore:()=>H()}),!d&&S.length===0?e.jsx("p",{className:"muted",children:"No items match your filters."}):null]})]})}export{ce as Assets};
1
+ import{r as i,j as e,b as D}from"./react-Vu6nbGi5.js";import{j as P,k as I,A as K,l as J}from"./index-DC3L0_Kx.js";import{S as F,F as W,a as Y}from"./FilterBar-CdU8B66A.js";import{S as A}from"./SkeletonCards-BysJEVmg.js";import{L as Z}from"./LoadMore-BOCtgPLI.js";import{u as z}from"./useInfiniteGrid-DnX_HQZy.js";import"./ethers-JeCAM1sd.js";const Q=[{key:"all",label:"Shop All"},{key:"wearable",label:"Wearables",expandable:!0,subs:[{key:"Head",label:"Head",icon:"cat-head"},{key:"Upper Body",label:"Upper Body",icon:"cat-upper"},{key:"Handwear",label:"Handwear",icon:"cat-handwear"},{key:"Lower Body",label:"Lower Body",icon:"cat-lower"},{key:"Feet",label:"Feet",icon:"cat-feet"},{key:"Accessories",label:"Accessories",icon:"cat-accessories"},{key:"Skins",label:"Skins",icon:"cat-skins"}]},{key:"emote",label:"Emotes",expandable:!0,subs:[{key:"Dance",label:"Dance",icon:"emote-dance"},{key:"Stunt",label:"Stunt",icon:"emote-stunt"},{key:"Greetings",label:"Greetings",icon:"emote-greetings"},{key:"Fun",label:"Fun",icon:"emote-fun"},{key:"Poses",label:"Poses",icon:"emote-poses"},{key:"Reactions",label:"Reactions",icon:"emote-reactions"},{key:"Horror",label:"Horror",icon:"emote-horror"},{key:"Miscellaneous",label:"Miscellaneous",icon:"emote-misc"}]}];function V({category:f,subCategory:n,onCategory:l,onSub:x}){const[c,p]=i.useState(()=>f==="wearable"?"wearable":null);function o(s){s.subs?p(t=>{const u=t!==s.key;return u&&l(s.key),u?s.key:null}):(l(s.key),p(null))}return e.jsx("div",{className:"catfilter",children:Q.map(s=>{const t=c===s.key&&!!s.subs,u=s.key===f;return e.jsxs("div",{className:"catfilter__group",children:[e.jsxs("button",{type:"button",className:`catfilter__cat${t?" is-expanded":""}${u?" is-selected":""}`,onClick:()=>o(s),children:[e.jsx("span",{className:"catfilter__cat-label",children:s.label}),s.expandable?e.jsx("span",{className:`ico ico-chevron catfilter__chev${t?" is-up":""}`,"aria-hidden":!0}):null]}),s.subs?e.jsx("div",{className:`catfilter__subs${t?" is-open":""}`,children:e.jsx("div",{className:"catfilter__subs-inner",children:s.subs.map(r=>e.jsx("button",{type:"button",className:`catfilter__sub${n===r.key?" is-active":""}`,onClick:()=>x(n===r.key?null:r.key),children:e.jsxs("span",{className:"catfilter__sub-left",children:[e.jsx("span",{className:`ico ico-${r.icon} catfilter__sub-ico`,"aria-hidden":!0}),e.jsx("span",{className:"catfilter__sub-label",children:r.label})]})},r.key))})}):null]},s.key)})})}const X=48,ee={Head:["head","hat","hair","facial_hair","eyes","eyebrows","mouth","mask","helmet","tiara","top_head"],"Upper Body":["upper_body"],Handwear:["hands_wear"],"Lower Body":["lower_body"],Feet:["feet"],Accessories:["earring","eyewear"],Skins:["skin"],Dance:["dance"],Stunt:["stunt"],Greetings:["greetings"],Fun:["fun"],Poses:["poses"],Reactions:["reactions"],Horror:["horror"],Miscellaneous:["miscellaneous"]};function ce(){const[f]=D(),n=(f.get("q")??"").trim().toLowerCase(),[l,x]=i.useState("wearable"),[c,p]=i.useState(null),[o,s]=i.useState([]),[t,u]=i.useState(""),[r,N]=i.useState(""),[b,M]=i.useState("newest"),y=t&&!Number.isNaN(Number(t))?Number(t):void 0,h=r&&!Number.isNaN(Number(r))?Number(r):void 0,R=c?ee[c]:void 0,E=(F.find(a=>a.key===b)??F[0]).server,j={category:l,rarities:o.length?o:void 0,wearableCategories:R,minPriceCredits:y,maxPriceCredits:h,search:n||void 0,sortBy:E},{items:S,total:w,isLoading:d,error:L,hasNextPage:B,isFetchingNextPage:v,fetchNextPage:H}=z(["listings",j],a=>J({...j,first:X,skip:a})),_=w,C=i.useRef(null);i.useEffect(()=>{d||!n||C.current===n||(C.current=n,P("Shop Searched",{query:n,result_count:_}))},[n,d,_]);const g=i.useRef("__init__");i.useEffect(()=>{if(d)return;const a=JSON.stringify({category:l,subCategory:c,rarities:o,min:y,max:h,sort:b});if(g.current==="__init__"||g.current===a){g.current=a;return}g.current=a,P("Shop Applied Filter",{filters:{category:l,sub_category:c,rarities:o,min_price_credits:y??null,max_price_credits:h??null,sort:b},result_count:_})},[l,c,o,y,h,b,d,_]);function $(a){x(a),p(null)}function G(a){s(m=>m.includes(a)?m.filter(O=>O!==a):[...m,a])}function T(){x("wearable"),p(null),s([]),u(""),N("")}const k=!!(y||h),U=k?`${t||"0"}–${r||"∞"}`:"Price",q=l!=="wearable"||!!c||o.length>0||k;return e.jsxs("div",{className:"browse browse--sidebar",children:[e.jsx("aside",{className:"browse__sidebar",children:e.jsx(V,{category:l,subCategory:c,onCategory:$,onSub:p})}),e.jsxs("div",{className:"browse__main",children:[e.jsx(W,{rarities:o,onToggleRarity:G,sort:b,onSort:M,total:w,loading:d,query:n,anyActive:q,onClear:T,renderTrailing:a=>e.jsx(Y,{panelKey:"price",label:U,active:k,panel:a,children:e.jsxs("div",{className:"filter-pop filter-pop--price",children:[e.jsxs("div",{className:"filter-pop__price-row",children:[e.jsx("input",{type:"number",min:"0","aria-label":"Minimum price",placeholder:"Min",value:t,onChange:m=>u(m.target.value)}),e.jsx("span",{children:"–"}),e.jsx("input",{type:"number",min:"0","aria-label":"Maximum price",placeholder:"Max",value:r,onChange:m=>N(m.target.value)})]}),e.jsxs("p",{className:"filter-pop__hint",children:["Price in ",I.name]})]})})}),L?e.jsx("p",{className:"error",children:"Couldn’t load items — please try again."}):null,e.jsx("div",{className:"grid",children:d?e.jsx(A,{count:15}):e.jsxs(e.Fragment,{children:[S.map(a=>e.jsx(K,{item:a},a.id)),v?e.jsx(A,{count:6}):null]})}),e.jsx(Z,{hasNextPage:B,isFetching:v,onLoadMore:()=>H()}),!d&&S.length===0?e.jsx("p",{className:"muted",children:"No items match your filters."}):null]})]})}export{ce as Assets};
@@ -1,4 +1,4 @@
1
- import{r as a,i as st,j as z,e as lt,R as H}from"./react-Vu6nbGi5.js";import{b as m,C as Ne,d as M,T as ut,t as ct,v as dt,x as pt,y as ft,_ as Y,c as I,a as ee,u as fe,s as A,k as he,g as Se,e as Ve,n as ht,z as mt,A as bt,q as gt,p as J}from"./generateUtilityClasses-YwmkdnPH.js";import{S as Ce}from"./SvgIcon-CMfDTydC.js";var se={};function vt(...e){return e.reduce((t,n)=>n==null?t:function(...r){t.apply(this,r),n.apply(this,r)},()=>{})}function xt(e,t=166){let n;function o(...r){const i=()=>{e.apply(this,r)};clearTimeout(n),n=setTimeout(i,t)}return o.clear=()=>{clearTimeout(n)},o}function yt(e,t){return()=>null}function Ct(e,t){var n,o;return a.isValidElement(e)&&t.indexOf((n=e.type.muiName)!=null?n:(o=e.type)==null||(o=o._payload)==null||(o=o.value)==null?void 0:o.muiName)!==-1}function ke(e){return e&&e.ownerDocument||document}function Rt(e){return ke(e).defaultView||window}function Et(e,t){return()=>null}function Le(e,t){typeof e=="function"?e(t):e&&(e.current=t)}const _e=typeof window<"u"?a.useLayoutEffect:a.useEffect;let Re=0;function It(e){const[t,n]=a.useState(e),o=e||t;return a.useEffect(()=>{t==null&&(Re+=1,n(`mui-${Re}`))},[t]),o}const Ee=st.useId;function Tt(e){if(Ee!==void 0){const t=Ee();return e??t}return It(e)}function Mt(e,t,n,o,r){return null}function zt({controlled:e,default:t,name:n,state:o="value"}){const{current:r}=a.useRef(e!==void 0),[i,s]=a.useState(t),c=r?e:i,u=a.useCallback(d=>{r||s(d)},[]);return[c,u]}function X(e){const t=a.useRef(e);return _e(()=>{t.current=e}),a.useRef((...n)=>(0,t.current)(...n)).current}function ue(...e){return a.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{Le(n,t)})},e)}const Ie={};function $t(e,t){const n=a.useRef(Ie);return n.current===Ie&&(n.current=e(t)),n}const Bt=[];function Pt(e){a.useEffect(e,Bt)}class te{constructor(){this.currentId=null,this.clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)},this.disposeEffect=()=>this.clear}static create(){return new te}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},t)}}function Nt(){const e=$t(te.create).current;return Pt(e.disposeEffect),e}let ne=!0,ce=!1;const St=new te,Vt={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function kt(e){const{type:t,tagName:n}=e;return!!(n==="INPUT"&&Vt[t]&&!e.readOnly||n==="TEXTAREA"&&!e.readOnly||e.isContentEditable)}function Lt(e){e.metaKey||e.altKey||e.ctrlKey||(ne=!0)}function le(){ne=!1}function _t(){this.visibilityState==="hidden"&&ce&&(ne=!0)}function Ft(e){e.addEventListener("keydown",Lt,!0),e.addEventListener("mousedown",le,!0),e.addEventListener("pointerdown",le,!0),e.addEventListener("touchstart",le,!0),e.addEventListener("visibilitychange",_t,!0)}function Dt(e){const{target:t}=e;try{return t.matches(":focus-visible")}catch{}return ne||kt(t)}function Fe(){const e=a.useCallback(r=>{r!=null&&Ft(r.ownerDocument)},[]),t=a.useRef(!1);function n(){return t.current?(ce=!0,St.start(100,()=>{ce=!1}),t.current=!1,!0):!1}function o(r){return Dt(r)?(t.current=!0,!0):!1}return{isFocusVisibleRef:t,onFocus:o,onBlur:n,ref:e}}function jt(e,t){function n(o,r){return z.jsx(Ce,m({"data-testid":`${t}Icon`,ref:r},o,{children:e}))}return n.muiName=Ce.muiName,a.memo(a.forwardRef(n))}const Ot={configure:e=>{Ne.configure(e)}},Ut=Object.freeze(Object.defineProperty({__proto__:null,capitalize:M,createChainedFunction:vt,createSvgIcon:jt,debounce:xt,deprecatedPropType:yt,isMuiElement:Ct,ownerDocument:ke,ownerWindow:Rt,requirePropFactory:Et,setRef:Le,unstable_ClassNameGenerator:Ot,unstable_useEnhancedEffect:_e,unstable_useId:Tt,unsupportedProp:Mt,useControlled:zt,useEventCallback:X,useForkRef:ue,useIsFocusVisible:Fe},Symbol.toStringTag,{value:"Module"})),Wt=lt(Ut);var Te;function Vn(){return Te||(Te=1,(function(e){"use client";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.createSvgIcon}});var t=Wt})(se)),se}function wt(e){return Object.keys(e).length===0}function At(e=null){const t=a.useContext(ut);return!t||wt(t)?e:t}const Kt=ct();function Gt(e=Kt){return At(e)}function De(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=De(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function Ht(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=De(e))&&(o&&(o+=" "),o+=t);return o}const Xt=["className","component"];function Yt(e={}){const{themeId:t,defaultTheme:n,defaultClassName:o="MuiBox-root",generateClassName:r}=e,i=dt("div",{shouldForwardProp:c=>c!=="theme"&&c!=="sx"&&c!=="as"})(pt);return a.forwardRef(function(u,d){const f=Gt(n),b=ft(u),{className:g,component:x="div"}=b,h=Y(b,Xt);return z.jsx(i,m({as:x,ref:d,className:Ht(g,r?r(o):o),theme:t&&f[t]||f},h))})}function de(e,t){return de=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},de(e,t)}function qt(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,de(e,t)}const Me=H.createContext(null);function Zt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function me(e,t){var n=function(i){return t&&a.isValidElement(i)?t(i):i},o=Object.create(null);return e&&a.Children.map(e,function(r){return r}).forEach(function(r){o[r.key]=n(r)}),o}function Jt(e,t){e=e||{},t=t||{};function n(f){return f in t?t[f]:e[f]}var o=Object.create(null),r=[];for(var i in e)i in t?r.length&&(o[i]=r,r=[]):r.push(i);var s,c={};for(var u in t){if(o[u])for(s=0;s<o[u].length;s++){var d=o[u][s];c[o[u][s]]=n(d)}c[u]=n(u)}for(s=0;s<r.length;s++)c[r[s]]=n(r[s]);return c}function w(e,t,n){return n[t]!=null?n[t]:e.props[t]}function Qt(e,t){return me(e.children,function(n){return a.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:w(n,"appear",e),enter:w(n,"enter",e),exit:w(n,"exit",e)})})}function en(e,t,n){var o=me(e.children),r=Jt(t,o);return Object.keys(r).forEach(function(i){var s=r[i];if(a.isValidElement(s)){var c=i in t,u=i in o,d=t[i],f=a.isValidElement(d)&&!d.props.in;u&&(!c||f)?r[i]=a.cloneElement(s,{onExited:n.bind(null,s),in:!0,exit:w(s,"exit",e),enter:w(s,"enter",e)}):!u&&c&&!f?r[i]=a.cloneElement(s,{in:!1}):u&&c&&a.isValidElement(d)&&(r[i]=a.cloneElement(s,{onExited:n.bind(null,s),in:d.props.in,exit:w(s,"exit",e),enter:w(s,"enter",e)}))}}),r}var tn=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},nn={component:"div",childFactory:function(t){return t}},be=(function(e){qt(t,e);function t(o,r){var i;i=e.call(this,o,r)||this;var s=i.handleExited.bind(Zt(i));return i.state={contextValue:{isMounting:!0},handleExited:s,firstRender:!0},i}var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(r,i){var s=i.children,c=i.handleExited,u=i.firstRender;return{children:u?Qt(r,c):en(r,s,c),firstRender:!1}},n.handleExited=function(r,i){var s=me(this.props.children);r.key in s||(r.props.onExited&&r.props.onExited(i),this.mounted&&this.setState(function(c){var u=m({},c.children);return delete u[r.key],{children:u}}))},n.render=function(){var r=this.props,i=r.component,s=r.childFactory,c=Y(r,["component","childFactory"]),u=this.state.contextValue,d=tn(this.state.children).map(s);return delete c.appear,delete c.enter,delete c.exit,i===null?H.createElement(Me.Provider,{value:u},d):H.createElement(Me.Provider,{value:u},H.createElement(i,c,d))},t})(H.Component);be.propTypes={};be.defaultProps=nn;function on(e){const{className:t,classes:n,pulsate:o=!1,rippleX:r,rippleY:i,rippleSize:s,in:c,onExited:u,timeout:d}=e,[f,b]=a.useState(!1),g=I(t,n.ripple,n.rippleVisible,o&&n.ripplePulsate),x={width:s,height:s,top:-(s/2)+i,left:-(s/2)+r},h=I(n.child,f&&n.childLeaving,o&&n.childPulsate);return!c&&!f&&b(!0),a.useEffect(()=>{if(!c&&u!=null){const C=setTimeout(u,d);return()=>{clearTimeout(C)}}},[u,c,d]),z.jsx("span",{className:g,style:x,children:z.jsx("span",{className:h})})}const T=ee("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),rn=["center","classes","className"];let oe=e=>e,ze,$e,Be,Pe;const pe=550,an=80,sn=he(ze||(ze=oe`
1
+ import{r as a,i as st,j as z,e as lt,R as H}from"./react-Vu6nbGi5.js";import{b as m,C as Ne,d as M,T as ut,t as ct,v as dt,x as pt,y as ft,_ as Y,c as I,a as ee,u as fe,s as A,k as he,g as Se,e as Ve,n as ht,z as mt,A as bt,q as gt,p as J}from"./generateUtilityClasses-BqTxi5Sw.js";import{S as Ce}from"./SvgIcon-DVGrnwOp.js";var se={};function vt(...e){return e.reduce((t,n)=>n==null?t:function(...r){t.apply(this,r),n.apply(this,r)},()=>{})}function xt(e,t=166){let n;function o(...r){const i=()=>{e.apply(this,r)};clearTimeout(n),n=setTimeout(i,t)}return o.clear=()=>{clearTimeout(n)},o}function yt(e,t){return()=>null}function Ct(e,t){var n,o;return a.isValidElement(e)&&t.indexOf((n=e.type.muiName)!=null?n:(o=e.type)==null||(o=o._payload)==null||(o=o.value)==null?void 0:o.muiName)!==-1}function ke(e){return e&&e.ownerDocument||document}function Rt(e){return ke(e).defaultView||window}function Et(e,t){return()=>null}function Le(e,t){typeof e=="function"?e(t):e&&(e.current=t)}const _e=typeof window<"u"?a.useLayoutEffect:a.useEffect;let Re=0;function It(e){const[t,n]=a.useState(e),o=e||t;return a.useEffect(()=>{t==null&&(Re+=1,n(`mui-${Re}`))},[t]),o}const Ee=st.useId;function Tt(e){if(Ee!==void 0){const t=Ee();return e??t}return It(e)}function Mt(e,t,n,o,r){return null}function zt({controlled:e,default:t,name:n,state:o="value"}){const{current:r}=a.useRef(e!==void 0),[i,s]=a.useState(t),c=r?e:i,u=a.useCallback(d=>{r||s(d)},[]);return[c,u]}function X(e){const t=a.useRef(e);return _e(()=>{t.current=e}),a.useRef((...n)=>(0,t.current)(...n)).current}function ue(...e){return a.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{Le(n,t)})},e)}const Ie={};function $t(e,t){const n=a.useRef(Ie);return n.current===Ie&&(n.current=e(t)),n}const Bt=[];function Pt(e){a.useEffect(e,Bt)}class te{constructor(){this.currentId=null,this.clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)},this.disposeEffect=()=>this.clear}static create(){return new te}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},t)}}function Nt(){const e=$t(te.create).current;return Pt(e.disposeEffect),e}let ne=!0,ce=!1;const St=new te,Vt={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function kt(e){const{type:t,tagName:n}=e;return!!(n==="INPUT"&&Vt[t]&&!e.readOnly||n==="TEXTAREA"&&!e.readOnly||e.isContentEditable)}function Lt(e){e.metaKey||e.altKey||e.ctrlKey||(ne=!0)}function le(){ne=!1}function _t(){this.visibilityState==="hidden"&&ce&&(ne=!0)}function Ft(e){e.addEventListener("keydown",Lt,!0),e.addEventListener("mousedown",le,!0),e.addEventListener("pointerdown",le,!0),e.addEventListener("touchstart",le,!0),e.addEventListener("visibilitychange",_t,!0)}function Dt(e){const{target:t}=e;try{return t.matches(":focus-visible")}catch{}return ne||kt(t)}function Fe(){const e=a.useCallback(r=>{r!=null&&Ft(r.ownerDocument)},[]),t=a.useRef(!1);function n(){return t.current?(ce=!0,St.start(100,()=>{ce=!1}),t.current=!1,!0):!1}function o(r){return Dt(r)?(t.current=!0,!0):!1}return{isFocusVisibleRef:t,onFocus:o,onBlur:n,ref:e}}function jt(e,t){function n(o,r){return z.jsx(Ce,m({"data-testid":`${t}Icon`,ref:r},o,{children:e}))}return n.muiName=Ce.muiName,a.memo(a.forwardRef(n))}const Ot={configure:e=>{Ne.configure(e)}},Ut=Object.freeze(Object.defineProperty({__proto__:null,capitalize:M,createChainedFunction:vt,createSvgIcon:jt,debounce:xt,deprecatedPropType:yt,isMuiElement:Ct,ownerDocument:ke,ownerWindow:Rt,requirePropFactory:Et,setRef:Le,unstable_ClassNameGenerator:Ot,unstable_useEnhancedEffect:_e,unstable_useId:Tt,unsupportedProp:Mt,useControlled:zt,useEventCallback:X,useForkRef:ue,useIsFocusVisible:Fe},Symbol.toStringTag,{value:"Module"})),Wt=lt(Ut);var Te;function Vn(){return Te||(Te=1,(function(e){"use client";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.createSvgIcon}});var t=Wt})(se)),se}function wt(e){return Object.keys(e).length===0}function At(e=null){const t=a.useContext(ut);return!t||wt(t)?e:t}const Kt=ct();function Gt(e=Kt){return At(e)}function De(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=De(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function Ht(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=De(e))&&(o&&(o+=" "),o+=t);return o}const Xt=["className","component"];function Yt(e={}){const{themeId:t,defaultTheme:n,defaultClassName:o="MuiBox-root",generateClassName:r}=e,i=dt("div",{shouldForwardProp:c=>c!=="theme"&&c!=="sx"&&c!=="as"})(pt);return a.forwardRef(function(u,d){const f=Gt(n),b=ft(u),{className:g,component:x="div"}=b,h=Y(b,Xt);return z.jsx(i,m({as:x,ref:d,className:Ht(g,r?r(o):o),theme:t&&f[t]||f},h))})}function de(e,t){return de=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},de(e,t)}function qt(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,de(e,t)}const Me=H.createContext(null);function Zt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function me(e,t){var n=function(i){return t&&a.isValidElement(i)?t(i):i},o=Object.create(null);return e&&a.Children.map(e,function(r){return r}).forEach(function(r){o[r.key]=n(r)}),o}function Jt(e,t){e=e||{},t=t||{};function n(f){return f in t?t[f]:e[f]}var o=Object.create(null),r=[];for(var i in e)i in t?r.length&&(o[i]=r,r=[]):r.push(i);var s,c={};for(var u in t){if(o[u])for(s=0;s<o[u].length;s++){var d=o[u][s];c[o[u][s]]=n(d)}c[u]=n(u)}for(s=0;s<r.length;s++)c[r[s]]=n(r[s]);return c}function w(e,t,n){return n[t]!=null?n[t]:e.props[t]}function Qt(e,t){return me(e.children,function(n){return a.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:w(n,"appear",e),enter:w(n,"enter",e),exit:w(n,"exit",e)})})}function en(e,t,n){var o=me(e.children),r=Jt(t,o);return Object.keys(r).forEach(function(i){var s=r[i];if(a.isValidElement(s)){var c=i in t,u=i in o,d=t[i],f=a.isValidElement(d)&&!d.props.in;u&&(!c||f)?r[i]=a.cloneElement(s,{onExited:n.bind(null,s),in:!0,exit:w(s,"exit",e),enter:w(s,"enter",e)}):!u&&c&&!f?r[i]=a.cloneElement(s,{in:!1}):u&&c&&a.isValidElement(d)&&(r[i]=a.cloneElement(s,{onExited:n.bind(null,s),in:d.props.in,exit:w(s,"exit",e),enter:w(s,"enter",e)}))}}),r}var tn=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},nn={component:"div",childFactory:function(t){return t}},be=(function(e){qt(t,e);function t(o,r){var i;i=e.call(this,o,r)||this;var s=i.handleExited.bind(Zt(i));return i.state={contextValue:{isMounting:!0},handleExited:s,firstRender:!0},i}var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(r,i){var s=i.children,c=i.handleExited,u=i.firstRender;return{children:u?Qt(r,c):en(r,s,c),firstRender:!1}},n.handleExited=function(r,i){var s=me(this.props.children);r.key in s||(r.props.onExited&&r.props.onExited(i),this.mounted&&this.setState(function(c){var u=m({},c.children);return delete u[r.key],{children:u}}))},n.render=function(){var r=this.props,i=r.component,s=r.childFactory,c=Y(r,["component","childFactory"]),u=this.state.contextValue,d=tn(this.state.children).map(s);return delete c.appear,delete c.enter,delete c.exit,i===null?H.createElement(Me.Provider,{value:u},d):H.createElement(Me.Provider,{value:u},H.createElement(i,c,d))},t})(H.Component);be.propTypes={};be.defaultProps=nn;function on(e){const{className:t,classes:n,pulsate:o=!1,rippleX:r,rippleY:i,rippleSize:s,in:c,onExited:u,timeout:d}=e,[f,b]=a.useState(!1),g=I(t,n.ripple,n.rippleVisible,o&&n.ripplePulsate),x={width:s,height:s,top:-(s/2)+i,left:-(s/2)+r},h=I(n.child,f&&n.childLeaving,o&&n.childPulsate);return!c&&!f&&b(!0),a.useEffect(()=>{if(!c&&u!=null){const C=setTimeout(u,d);return()=>{clearTimeout(C)}}},[u,c,d]),z.jsx("span",{className:g,style:x,children:z.jsx("span",{className:h})})}const T=ee("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),rn=["center","classes","className"];let oe=e=>e,ze,$e,Be,Pe;const pe=550,an=80,sn=he(ze||(ze=oe`
2
2
  0% {
3
3
  transform: scale(0);
4
4
  opacity: 0.1;
@@ -1 +1 @@
1
- import{a as ee,r as v,j as t,L as A}from"./react-Vu6nbGi5.js";import{v as te,w as se,o as P,a as ae,c as re,x as ne,y as ce,t as R,C as ie,d as I,k as O,A as le,j as F,z as B,D as z,E as oe,F as de,G as D,H as ue,I as he,g as me,J as pe,l as fe}from"./index-BiC8AOx_.js";import{f as Q}from"./buy-njp9xZO9.js";import{g as ye,b as ge,w as _e,S as be,G as ve}from"./buy-gasless-3T0lk5aN.js";import"./ethers-JeCAM1sd.js";import"./index-rktQ2LR5.js";function Ce(s){return Math.ceil(s/10)}async function xe(s,r,d){var j;const _=[],a=[],C=[];for(const n of s)try{const m=await d(n);if(!m){a.push(n);continue}if(te(m,r)){C.push(n);continue}const c=se((j=m.received[0])==null?void 0:j.amount);if(!Number.isFinite(c)||c<=0){a.push(n);continue}_.push({item:n,trade:m,usdCents:c,priceCredits:Ce(c)})}catch{a.push(n)}const x=_.reduce((n,m)=>n+m.priceCredits,0),p=a.length>0||C.length>0||_.some(n=>n.priceCredits!==n.item.priceCredits);return{buyable:_,unavailable:a,own:C,liveTotalCredits:x,orderChanged:p}}function K(s){const r=s,d=(r.message??"").toLowerCase();return r.code===4001||d.includes("reject")||d.includes("denied")||d.includes("cancel")?"You cancelled the request.":d.includes("insufficient")?`You don't have enough ${O.name} — get more first.`:d.includes("no active listing")||d.includes("your own listing")?r.message:"Couldn't complete checkout — please try again."}const je=12e4;function Ne(s){const r=[];return s.unavailable.length&&r.push(`${s.unavailable.length} no longer available`),s.own.length&&r.push(`${s.own.length} you can't buy (your own listing)`),`Removed ${r.join(" and ")} from your cart.`}function Re(){const s=P(e=>e.items),r=P(e=>e.remove),d=P(e=>e.clear),_=P(e=>e.setFittingOpen),{session:a}=ae(),C=s.some(e=>e.category!=="emote"),{data:x}=re({queryKey:["upsell-listings"],queryFn:()=>fe({first:40}),staleTime:6e4}),{data:p}=ne(a),j=ce(),n=ee(),[m,c]=v.useState(null),[q,f]=v.useState(null),[G,S]=v.useState(null),[N,T]=v.useState(!1),[u,w]=v.useState(null),L=v.useRef(0),E=s.reduce((e,i)=>e+i.priceCredits,0),H=u?u.liveTotalCredits:E,V=new Set(s.map(e=>e.id)),M=((x==null?void 0:x.items)??[]).filter(e=>!V.has(e.id)).slice(0,6),J=new Map(u==null?void 0:u.buyable.map(e=>[e.item.id,e])),X=e=>e.tradeId?me(e.tradeId):pe(e.contractAddress,e.itemId??"");function U(e){e(),w(null),S(null),f(null)}async function W(e){if(!a||e.length===0)return;const i=e.map(l=>({...l.item,priceCredits:l.priceCredits})),g=[];let k="authorize",$=!1;try{c("Preparing your order…");const l=[];for(const o of e){const{credit:b,maxCreditedValue:y}=await oe(a.identity,o.usdCents,o.item.tradeId);g.push(b.id),l.push({trade:o.trade,credits:[b],maxCreditedValue:y})}c("Confirming your purchase…"),k="submit";let h=[];if(ye())try{h=await ge({purchases:l,buyer:a.address,signer:a.signer});const b=(await Promise.allSettled(h.map(y=>_e(y)))).flatMap(y=>y.status==="rejected"?[y.reason]:[]);if(b.length&&!b.some(y=>y instanceof be))throw b[0];$=!0}catch(o){if(!(o instanceof ve))throw o;h=await Q({purchases:l,buyer:a.address,signer:a.signer})}else h=await Q({purchases:l,buyer:a.address,signer:a.signer});e.forEach(o=>r(o.item.id)),w(null),c("Purchased! 🎉"),F("Shop Completed Purchase",{...de(i),payment_type:"credits",no_crypto_step:$,transaction_hash:h[0]??null}),j.invalidateQueries({queryKey:["usd-balance"]}),n("/success",{state:{items:i,txHash:h[0]}})}catch(l){if(D(l)||z(l,{flow:"cart_checkout",step:k,cart_size:e.length}),F(D(l)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:k,error_code:ue(l),value_usd:B(i.reduce((h,o)=>h+o.priceCredits,0)),cart_size:e.length}),g.length){try{await he(a.identity,g)}catch(h){z(h,{flow:"cart_checkout",step:"release"})}j.invalidateQueries({queryKey:["usd-balance"]})}f(K(l)),c(null)}}async function Y(){if(!a){f("Sign in to check out.");return}f(null),S(null),T(!0),F("Shop Started Checkout",{cart_size:s.length,cart_value_credits:E,cart_value_usd:B(E),has_sufficient_credits:((p==null?void 0:p.credits)??0)>=E});try{c("Reviewing your cart…");const e=await xe(s,a.address,X),i=[...e.unavailable,...e.own];if(i.length&&(i.forEach(g=>r(g.id)),S(Ne(e))),e.buyable.length===0){f("None of these items are available to buy right now."),w(null),c(null);return}if(e.orderChanged){w(e),L.current=Date.now(),c(null);return}await W(e.buyable)}catch(e){z(e,{flow:"cart_checkout",step:"review",cart_size:s.length}),f(K(e)),c(null)}finally{T(!1)}}async function Z(){if(u){if(!a){f("Sign in to check out.");return}if(Date.now()-L.current>je){w(null),S(null),await Y();return}f(null),T(!0);try{await W(u.buyable)}finally{T(!1)}}}return s.length===0?t.jsxs("div",{className:"cart cart--empty",children:[t.jsx("span",{className:"ico ico-cart cart-empty__ico","aria-hidden":!0}),t.jsx("p",{className:"cart-empty__title",children:R("cart.empty.title")}),t.jsx("p",{className:"muted",children:R("cart.empty.body")}),t.jsx(A,{className:"btn btn--purple",to:"/assets",children:R("cart.empty.cta")})]}):t.jsxs("div",{className:"cart",children:[t.jsxs("h1",{children:["Cart (",s.length,")"]}),t.jsx("div",{className:"cart__list",children:s.map(e=>{const i=J.get(e.id),g=i?i.priceCredits:e.priceCredits,k=!!i&&i.priceCredits!==e.priceCredits;return t.jsxs("div",{className:"cart__row",children:[t.jsx("div",{className:"cart__thumb",children:e.thumbnail?t.jsx("img",{src:e.thumbnail,alt:e.name}):null}),t.jsxs("div",{className:"cart__info",children:[t.jsx("div",{className:"cart__name",children:e.name}),e.creator?t.jsx(ie,{address:e.creator,className:"cart__creator",linkToProfile:!0}):null]}),t.jsxs("div",{className:"cart__price",children:[t.jsx(I,{className:"ccy-mark"})," ",g,k?t.jsx("span",{className:"muted",style:{marginLeft:6,textDecoration:"line-through"},children:e.priceCredits}):null]}),t.jsx("button",{className:"cart__remove",onClick:()=>U(()=>r(e.id)),disabled:N,"aria-label":`Remove ${e.name}`,title:"Remove",children:t.jsx("span",{className:"ico ico-trash","aria-hidden":!0})})]},e.id)})}),t.jsxs("div",{className:"cart__foot",children:[t.jsxs("div",{className:"cart__total",children:[t.jsxs("div",{className:"cart__total-line",children:["Total ",t.jsxs("strong",{children:[t.jsx(I,{className:"ccy-mark"})," ",H]})]}),a?t.jsxs("div",{className:"muted cart__balance",children:["Your balance: ",t.jsx(I,{className:"ccy-mark"})," ",(p==null?void 0:p.credits)??0]}):null]}),t.jsxs("div",{className:"cart__actions",children:[C?t.jsx("button",{className:"btn btn--ghost",onClick:()=>_(!0),disabled:N,children:"Try on outfit"}):null,t.jsxs(A,{className:"btn btn--ghost",to:"/credits",children:["Get ",O.name]}),t.jsx("button",{className:"btn btn--purple cart__checkout",onClick:u?Z:Y,disabled:N,children:N?"Working…":u?"Confirm purchase":"Checkout"})]})]}),t.jsxs("div",{className:"cart__utils",children:[t.jsx("button",{className:"link",onClick:()=>U(d),disabled:N,children:"Clear cart"}),null]}),u?t.jsx("p",{className:"muted",style:{marginTop:12},children:"Prices or availability changed since you added these — review the updated total and confirm to buy."}):null,G?t.jsx("p",{className:"muted",style:{marginTop:12},children:G}):null,m?t.jsx("p",{className:"muted",style:{marginTop:12},children:m}):null,q?t.jsx("p",{className:"error",style:{marginTop:12},children:q}):null,M.length>0?t.jsxs("section",{className:"row cart-upsell",children:[t.jsx("div",{className:"row__head",children:t.jsx("h2",{className:"row__title",children:"You might also like"})}),t.jsx("div",{className:"row__track",children:M.map(e=>t.jsx(le,{item:e},e.id))})]}):null]})}export{Re as Cart};
1
+ import{a as ee,r as v,j as t,L as A}from"./react-Vu6nbGi5.js";import{v as te,w as se,o as P,a as ae,c as re,x as ne,y as ce,t as R,C as ie,d as I,k as O,A as le,j as F,z as B,D as z,E as oe,F as de,G as D,H as ue,I as he,g as me,J as pe,l as fe}from"./index-DC3L0_Kx.js";import{f as Q}from"./buy-Bv5rL_T6.js";import{g as ye,b as ge,w as _e,S as be,G as ve}from"./buy-gasless-Dl9oiGu4.js";import"./ethers-JeCAM1sd.js";import"./index-KUQH6SSY.js";function Ce(s){return Math.ceil(s/10)}async function xe(s,r,d){var j;const _=[],a=[],C=[];for(const n of s)try{const m=await d(n);if(!m){a.push(n);continue}if(te(m,r)){C.push(n);continue}const c=se((j=m.received[0])==null?void 0:j.amount);if(!Number.isFinite(c)||c<=0){a.push(n);continue}_.push({item:n,trade:m,usdCents:c,priceCredits:Ce(c)})}catch{a.push(n)}const x=_.reduce((n,m)=>n+m.priceCredits,0),p=a.length>0||C.length>0||_.some(n=>n.priceCredits!==n.item.priceCredits);return{buyable:_,unavailable:a,own:C,liveTotalCredits:x,orderChanged:p}}function K(s){const r=s,d=(r.message??"").toLowerCase();return r.code===4001||d.includes("reject")||d.includes("denied")||d.includes("cancel")?"You cancelled the request.":d.includes("insufficient")?`You don't have enough ${O.name} — get more first.`:d.includes("no active listing")||d.includes("your own listing")?r.message:"Couldn't complete checkout — please try again."}const je=12e4;function Ne(s){const r=[];return s.unavailable.length&&r.push(`${s.unavailable.length} no longer available`),s.own.length&&r.push(`${s.own.length} you can't buy (your own listing)`),`Removed ${r.join(" and ")} from your cart.`}function Re(){const s=P(e=>e.items),r=P(e=>e.remove),d=P(e=>e.clear),_=P(e=>e.setFittingOpen),{session:a}=ae(),C=s.some(e=>e.category!=="emote"),{data:x}=re({queryKey:["upsell-listings"],queryFn:()=>fe({first:40}),staleTime:6e4}),{data:p}=ne(a),j=ce(),n=ee(),[m,c]=v.useState(null),[q,f]=v.useState(null),[G,S]=v.useState(null),[N,T]=v.useState(!1),[u,w]=v.useState(null),L=v.useRef(0),E=s.reduce((e,i)=>e+i.priceCredits,0),H=u?u.liveTotalCredits:E,V=new Set(s.map(e=>e.id)),M=((x==null?void 0:x.items)??[]).filter(e=>!V.has(e.id)).slice(0,6),J=new Map(u==null?void 0:u.buyable.map(e=>[e.item.id,e])),X=e=>e.tradeId?me(e.tradeId):pe(e.contractAddress,e.itemId??"");function U(e){e(),w(null),S(null),f(null)}async function W(e){if(!a||e.length===0)return;const i=e.map(l=>({...l.item,priceCredits:l.priceCredits})),g=[];let k="authorize",$=!1;try{c("Preparing your order…");const l=[];for(const o of e){const{credit:b,maxCreditedValue:y}=await oe(a.identity,o.usdCents,o.item.tradeId);g.push(b.id),l.push({trade:o.trade,credits:[b],maxCreditedValue:y})}c("Confirming your purchase…"),k="submit";let h=[];if(ye())try{h=await ge({purchases:l,buyer:a.address,signer:a.signer});const b=(await Promise.allSettled(h.map(y=>_e(y)))).flatMap(y=>y.status==="rejected"?[y.reason]:[]);if(b.length&&!b.some(y=>y instanceof be))throw b[0];$=!0}catch(o){if(!(o instanceof ve))throw o;h=await Q({purchases:l,buyer:a.address,signer:a.signer})}else h=await Q({purchases:l,buyer:a.address,signer:a.signer});e.forEach(o=>r(o.item.id)),w(null),c("Purchased! 🎉"),F("Shop Completed Purchase",{...de(i),payment_type:"credits",no_crypto_step:$,transaction_hash:h[0]??null}),j.invalidateQueries({queryKey:["usd-balance"]}),n("/success",{state:{items:i,txHash:h[0]}})}catch(l){if(D(l)||z(l,{flow:"cart_checkout",step:k,cart_size:e.length}),F(D(l)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:k,error_code:ue(l),value_usd:B(i.reduce((h,o)=>h+o.priceCredits,0)),cart_size:e.length}),g.length){try{await he(a.identity,g)}catch(h){z(h,{flow:"cart_checkout",step:"release"})}j.invalidateQueries({queryKey:["usd-balance"]})}f(K(l)),c(null)}}async function Y(){if(!a){f("Sign in to check out.");return}f(null),S(null),T(!0),F("Shop Started Checkout",{cart_size:s.length,cart_value_credits:E,cart_value_usd:B(E),has_sufficient_credits:((p==null?void 0:p.credits)??0)>=E});try{c("Reviewing your cart…");const e=await xe(s,a.address,X),i=[...e.unavailable,...e.own];if(i.length&&(i.forEach(g=>r(g.id)),S(Ne(e))),e.buyable.length===0){f("None of these items are available to buy right now."),w(null),c(null);return}if(e.orderChanged){w(e),L.current=Date.now(),c(null);return}await W(e.buyable)}catch(e){z(e,{flow:"cart_checkout",step:"review",cart_size:s.length}),f(K(e)),c(null)}finally{T(!1)}}async function Z(){if(u){if(!a){f("Sign in to check out.");return}if(Date.now()-L.current>je){w(null),S(null),await Y();return}f(null),T(!0);try{await W(u.buyable)}finally{T(!1)}}}return s.length===0?t.jsxs("div",{className:"cart cart--empty",children:[t.jsx("span",{className:"ico ico-cart cart-empty__ico","aria-hidden":!0}),t.jsx("p",{className:"cart-empty__title",children:R("cart.empty.title")}),t.jsx("p",{className:"muted",children:R("cart.empty.body")}),t.jsx(A,{className:"btn btn--purple",to:"/assets",children:R("cart.empty.cta")})]}):t.jsxs("div",{className:"cart",children:[t.jsxs("h1",{children:["Cart (",s.length,")"]}),t.jsx("div",{className:"cart__list",children:s.map(e=>{const i=J.get(e.id),g=i?i.priceCredits:e.priceCredits,k=!!i&&i.priceCredits!==e.priceCredits;return t.jsxs("div",{className:"cart__row",children:[t.jsx("div",{className:"cart__thumb",children:e.thumbnail?t.jsx("img",{src:e.thumbnail,alt:e.name}):null}),t.jsxs("div",{className:"cart__info",children:[t.jsx("div",{className:"cart__name",children:e.name}),e.creator?t.jsx(ie,{address:e.creator,className:"cart__creator",linkToProfile:!0}):null]}),t.jsxs("div",{className:"cart__price",children:[t.jsx(I,{className:"ccy-mark"})," ",g,k?t.jsx("span",{className:"muted",style:{marginLeft:6,textDecoration:"line-through"},children:e.priceCredits}):null]}),t.jsx("button",{className:"cart__remove",onClick:()=>U(()=>r(e.id)),disabled:N,"aria-label":`Remove ${e.name}`,title:"Remove",children:t.jsx("span",{className:"ico ico-trash","aria-hidden":!0})})]},e.id)})}),t.jsxs("div",{className:"cart__foot",children:[t.jsxs("div",{className:"cart__total",children:[t.jsxs("div",{className:"cart__total-line",children:["Total ",t.jsxs("strong",{children:[t.jsx(I,{className:"ccy-mark"})," ",H]})]}),a?t.jsxs("div",{className:"muted cart__balance",children:["Your balance: ",t.jsx(I,{className:"ccy-mark"})," ",(p==null?void 0:p.credits)??0]}):null]}),t.jsxs("div",{className:"cart__actions",children:[C?t.jsx("button",{className:"btn btn--ghost",onClick:()=>_(!0),disabled:N,children:"Try on outfit"}):null,t.jsxs(A,{className:"btn btn--ghost",to:"/credits",children:["Get ",O.name]}),t.jsx("button",{className:"btn btn--purple cart__checkout",onClick:u?Z:Y,disabled:N,children:N?"Working…":u?"Confirm purchase":"Checkout"})]})]}),t.jsxs("div",{className:"cart__utils",children:[t.jsx("button",{className:"link",onClick:()=>U(d),disabled:N,children:"Clear cart"}),null]}),u?t.jsx("p",{className:"muted",style:{marginTop:12},children:"Prices or availability changed since you added these — review the updated total and confirm to buy."}):null,G?t.jsx("p",{className:"muted",style:{marginTop:12},children:G}):null,m?t.jsx("p",{className:"muted",style:{marginTop:12},children:m}):null,q?t.jsx("p",{className:"error",style:{marginTop:12},children:q}):null,M.length>0?t.jsxs("section",{className:"row cart-upsell",children:[t.jsx("div",{className:"row__head",children:t.jsx("h2",{className:"row__title",children:"You might also like"})}),t.jsx("div",{className:"row__track",children:M.map(e=>t.jsx(le,{item:e},e.id))})]}):null]})}export{Re as Cart};
@@ -1,4 +1,4 @@
1
- import{g as N,a as U,u as w,_ as z,b as o,c as E,d as n,e as I,s as v,f as D,k as _}from"./generateUtilityClasses-YwmkdnPH.js";import{r as F,j as g}from"./react-Vu6nbGi5.js";function K(r){return N("MuiCircularProgress",r)}U("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=_(P||(P=l`
1
+ import{g as N,a as U,u as w,_ as z,b as o,c as E,d as n,e as I,s as v,f as D,k as _}from"./generateUtilityClasses-BqTxi5Sw.js";import{r as F,j as g}from"./react-Vu6nbGi5.js";function K(r){return N("MuiCircularProgress",r)}U("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=_(P||(P=l`
2
2
  0% {
3
3
  transform: rotate(0deg);
4
4
  }
@@ -1 +1 @@
1
- import{u as h,a as g,j as e}from"./react-Vu6nbGi5.js";import{C as x,A as j,f as _}from"./index-BiC8AOx_.js";import{A as N}from"./collection-DaX7TWx3.js";import{S as m}from"./SkeletonCards-BysJEVmg.js";import{L as f}from"./LoadMore-BOCtgPLI.js";import{u as C}from"./useInfiniteGrid-CnC_JbP2.js";import"./ethers-JeCAM1sd.js";const b=48;function F(){var i;const{contractAddress:o}=h(),d=g(),{items:s,total:c,isLoading:a,error:t,hasNextPage:u,isFetchingNextPage:n,fetchNextPage:p}=C(["collection-page",o],l=>_(o,{first:b,skip:l}),{enabled:!!o}),r=(i=s[0])==null?void 0:i.creator;return e.jsxs("div",{className:"collection-page",children:[e.jsxs("nav",{className:"collection-page__crumbs","aria-label":"Breadcrumb",children:[e.jsx("button",{className:"collection-page__crumb-link",onClick:()=>d("/assets"),children:"Collectibles"}),e.jsx("span",{className:"collection-page__crumb-sep",children:"/"}),e.jsx("span",{className:"collection-page__crumb-current",children:"Collection"})]}),e.jsxs("header",{className:"collection-page__head",children:[e.jsx("h1",{className:"collection-page__title",children:"Collection"}),r?e.jsx(x,{address:r,className:"collection-page__creator"}):null,e.jsx("span",{className:"muted collection-page__count",children:a?"…":`${c.toLocaleString()} item${c===1?"":"s"}`})]}),!a&&s.length>0?e.jsx(N,{items:s,source:"collection"}):null,t?e.jsx("p",{className:"error",children:"Couldn’t load this collection — please try again."}):null,e.jsx("div",{className:"grid",children:a?e.jsx(m,{count:12}):e.jsxs(e.Fragment,{children:[s.map(l=>e.jsx(j,{item:l},l.id)),n?e.jsx(m,{count:6}):null]})}),e.jsx(f,{hasNextPage:u,isFetching:n,onLoadMore:()=>p()}),!a&&!t&&s.length===0?e.jsx("p",{className:"muted",children:"This collection has no items to show."}):null]})}export{F as Collection,F as default};
1
+ import{u as h,a as g,j as e}from"./react-Vu6nbGi5.js";import{C as x,A as j,f as _}from"./index-DC3L0_Kx.js";import{A as N}from"./collection-eKqAvjgr.js";import{S as m}from"./SkeletonCards-BysJEVmg.js";import{L as f}from"./LoadMore-BOCtgPLI.js";import{u as C}from"./useInfiniteGrid-DnX_HQZy.js";import"./ethers-JeCAM1sd.js";const b=48;function F(){var i;const{contractAddress:o}=h(),d=g(),{items:s,total:c,isLoading:a,error:t,hasNextPage:u,isFetchingNextPage:n,fetchNextPage:p}=C(["collection-page",o],l=>_(o,{first:b,skip:l}),{enabled:!!o}),r=(i=s[0])==null?void 0:i.creator;return e.jsxs("div",{className:"collection-page",children:[e.jsxs("nav",{className:"collection-page__crumbs","aria-label":"Breadcrumb",children:[e.jsx("button",{className:"collection-page__crumb-link",onClick:()=>d("/assets"),children:"Collectibles"}),e.jsx("span",{className:"collection-page__crumb-sep",children:"/"}),e.jsx("span",{className:"collection-page__crumb-current",children:"Collection"})]}),e.jsxs("header",{className:"collection-page__head",children:[e.jsx("h1",{className:"collection-page__title",children:"Collection"}),r?e.jsx(x,{address:r,className:"collection-page__creator"}):null,e.jsx("span",{className:"muted collection-page__count",children:a?"…":`${c.toLocaleString()} item${c===1?"":"s"}`})]}),!a&&s.length>0?e.jsx(N,{items:s,source:"collection"}):null,t?e.jsx("p",{className:"error",children:"Couldn’t load this collection — please try again."}):null,e.jsx("div",{className:"grid",children:a?e.jsx(m,{count:12}):e.jsxs(e.Fragment,{children:[s.map(l=>e.jsx(j,{item:l},l.id)),n?e.jsx(m,{count:6}):null]})}),e.jsx(f,{hasNextPage:u,isFetching:n,onLoadMore:()=>p()}),!a&&!t&&s.length===0?e.jsx("p",{className:"muted",children:"This collection has no items to show."}):null]})}export{F as Collection,F as default};
@@ -1 +1 @@
1
- import{j as e,u as g,a as p}from"./react-Vu6nbGi5.js";import{m as i,C as h,A as x,n as j}from"./index-BiC8AOx_.js";import{A as f}from"./collection-DaX7TWx3.js";import{S as m}from"./SkeletonCards-BysJEVmg.js";import{L as N}from"./LoadMore-BOCtgPLI.js";import{u as b}from"./useInfiniteGrid-CnC_JbP2.js";import"./ethers-JeCAM1sd.js";function _({address:s,className:r=""}){const o=i(t=>t.followed.includes(s.toLowerCase())),a=i(t=>t.toggle);return s?e.jsx("button",{type:"button",className:`btn btn--sm ${o?"btn--ghost":"btn--outline"} ${r}`.trim(),"aria-pressed":o,title:o?"Unfollow creator":"Follow creator",onClick:()=>a(s),children:o?"Following":"Follow"}):null}const C=48;function S(){const{address:s}=g(),r=p(),{items:o,total:a,isLoading:t,error:n,hasNextPage:u,isFetchingNextPage:c,fetchNextPage:d}=b(["creator-page",s],l=>j(s,{first:C,skip:l}),{enabled:!!s});return e.jsxs("div",{className:"collection-page",children:[e.jsxs("nav",{className:"collection-page__crumbs","aria-label":"Breadcrumb",children:[e.jsx("button",{className:"collection-page__crumb-link",onClick:()=>r("/assets"),children:"Collectibles"}),e.jsx("span",{className:"collection-page__crumb-sep",children:"/"}),e.jsx("span",{className:"collection-page__crumb-current",children:"Creator"})]}),e.jsxs("header",{className:"collection-page__head",children:[s?e.jsx(h,{address:s,className:"collection-page__title-creator"}):null,s?e.jsx(_,{address:s}):null,e.jsx("span",{className:"muted collection-page__count",children:t?"…":`${a.toLocaleString()} item${a===1?"":"s"}`})]}),!t&&o.length>0?e.jsx(f,{items:o,source:"creator"}):null,n?e.jsx("p",{className:"error",children:"Couldn’t load this creator — please try again."}):null,e.jsx("div",{className:"grid",children:t?e.jsx(m,{count:12}):e.jsxs(e.Fragment,{children:[o.map(l=>e.jsx(x,{item:l},l.id)),c?e.jsx(m,{count:6}):null]})}),e.jsx(N,{hasNextPage:u,isFetching:c,onLoadMore:()=>d()}),!t&&!n&&o.length===0?e.jsx("p",{className:"muted",children:"This creator has no items to show yet."}):null]})}export{S as Creator,S as default};
1
+ import{j as e,u as g,a as p}from"./react-Vu6nbGi5.js";import{m as i,C as h,A as x,n as j}from"./index-DC3L0_Kx.js";import{A as f}from"./collection-eKqAvjgr.js";import{S as m}from"./SkeletonCards-BysJEVmg.js";import{L as N}from"./LoadMore-BOCtgPLI.js";import{u as b}from"./useInfiniteGrid-DnX_HQZy.js";import"./ethers-JeCAM1sd.js";function _({address:s,className:r=""}){const o=i(t=>t.followed.includes(s.toLowerCase())),a=i(t=>t.toggle);return s?e.jsx("button",{type:"button",className:`btn btn--sm ${o?"btn--ghost":"btn--outline"} ${r}`.trim(),"aria-pressed":o,title:o?"Unfollow creator":"Follow creator",onClick:()=>a(s),children:o?"Following":"Follow"}):null}const C=48;function S(){const{address:s}=g(),r=p(),{items:o,total:a,isLoading:t,error:n,hasNextPage:u,isFetchingNextPage:c,fetchNextPage:d}=b(["creator-page",s],l=>j(s,{first:C,skip:l}),{enabled:!!s});return e.jsxs("div",{className:"collection-page",children:[e.jsxs("nav",{className:"collection-page__crumbs","aria-label":"Breadcrumb",children:[e.jsx("button",{className:"collection-page__crumb-link",onClick:()=>r("/assets"),children:"Collectibles"}),e.jsx("span",{className:"collection-page__crumb-sep",children:"/"}),e.jsx("span",{className:"collection-page__crumb-current",children:"Creator"})]}),e.jsxs("header",{className:"collection-page__head",children:[s?e.jsx(h,{address:s,className:"collection-page__title-creator"}):null,s?e.jsx(_,{address:s}):null,e.jsx("span",{className:"muted collection-page__count",children:t?"…":`${a.toLocaleString()} item${a===1?"":"s"}`})]}),!t&&o.length>0?e.jsx(f,{items:o,source:"creator"}):null,n?e.jsx("p",{className:"error",children:"Couldn’t load this creator — please try again."}):null,e.jsx("div",{className:"grid",children:t?e.jsx(m,{count:12}):e.jsxs(e.Fragment,{children:[o.map(l=>e.jsx(x,{item:l},l.id)),c?e.jsx(m,{count:6}):null]})}),e.jsx(N,{hasNextPage:u,isFetching:c,onLoadMore:()=>d()}),!t&&!n&&o.length===0?e.jsx("p",{className:"muted",children:"This creator has no items to show yet."}):null]})}export{S as Creator,S as default};
@@ -1 +1 @@
1
- import{C as l,E as w,b as E,S as A,d as k,O as U,N as P,g as f,B as x,e as N,i as I,p as L}from"./W3MFrameProviderSingleton-lwu7rhSU.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-BPiOplYA.js";const D=0,C={paymentAsset:null,amount:null,tokenAmount:0,priceLoading:!1,error:null,exchanges:[],isLoading:!1,currentPayment:void 0,isPaymentInProgress:!1,paymentId:"",assets:[]},e=L(C),m={state:e,subscribe(t){return I(e,()=>t(e))},subscribeKey(t,n){return N(e,t,n)},resetState(){Object.assign(e,{...C})},async getAssetsForNetwork(t){const n=v(t),s=await m.getAssetsImageAndPrice(n),r=n.map(a=>{var c,o,p,y;const u=a.asset==="native"?f():`${a.network}:${a.asset}`,i=s.find(S=>{var g,d,h;return((h=(d=(g=S.fungibles)==null?void 0:g[0])==null?void 0:d.address)==null?void 0:h.toLowerCase())===u.toLowerCase()});return{...a,price:((o=(c=i==null?void 0:i.fungibles)==null?void 0:c[0])==null?void 0:o.price)||1,metadata:{...a.metadata,iconUrl:(y=(p=i==null?void 0:i.fungibles)==null?void 0:p[0])==null?void 0:y.iconUrl}}});return e.assets=r,r},async getAssetsImageAndPrice(t){const n=t.map(r=>r.asset==="native"?f():`${r.network}:${r.asset}`);return await Promise.all(n.map(r=>x.fetchTokenPrice({addresses:[r]})))},getTokenAmount(){var s;if(!((s=e==null?void 0:e.paymentAsset)!=null&&s.price))throw new Error("Cannot get token price");const t=P.bigNumber(e.amount??0).round(8),n=P.bigNumber(e.paymentAsset.price).round(8);return t.div(n).round(8).toNumber()},setAmount(t){var n;e.amount=t,(n=e.paymentAsset)!=null&&n.price&&(e.tokenAmount=m.getTokenAmount())},setPaymentAsset(t){e.paymentAsset=t},isPayWithExchangeEnabled(){var t;return(t=U.state.remoteFeatures)==null?void 0:t.payWithExchange},isPayWithExchangeSupported(){return m.isPayWithExchangeEnabled()&&l.state.activeCaipNetwork&&k.PAY_WITH_EXCHANGE_SUPPORTED_CHAIN_NAMESPACES.includes(l.state.activeCaipNetwork.chainNamespace)},async fetchExchanges(){var t;try{const n=m.isPayWithExchangeSupported();if(!e.paymentAsset||!n){e.exchanges=[],e.isLoading=!1;return}e.isLoading=!0;const s=await _({page:D,asset:b(e.paymentAsset.network,e.paymentAsset.asset),amount:((t=e.amount)==null?void 0:t.toString())??"0"});e.exchanges=s.exchanges.slice(0,2)}catch{throw A.showError("Unable to get exchanges"),new Error("Unable to get exchanges")}finally{e.isLoading=!1}},async getPayUrl(t,n){try{const s=Number(n.amount),r=await W({exchangeId:t,asset:b(n.network,n.asset),amount:s.toString(),recipient:`${n.network}:${n.recipient}`});return w.sendEvent({type:"track",event:"PAY_EXCHANGE_SELECTED",properties:{exchange:{id:t},configuration:{network:n.network,asset:n.asset,recipient:n.recipient,amount:s},currentPayment:{type:"exchange",exchangeId:t},source:"fund-from-exchange",headless:!1}}),r}catch(s){throw s instanceof Error&&s.message.includes("is not supported")?new Error("Asset not supported"):new Error(s.message)}},async handlePayWithExchange(t){var n;try{const s=(n=l.getAccountData())==null?void 0:n.address;if(!s)throw new Error("No account connected");if(!e.paymentAsset)throw new Error("No payment asset selected");const r=E.returnOpenHref("","popupWindow","scrollbar=yes,width=480,height=720");if(!r)throw new Error("Could not create popup window");e.isPaymentInProgress=!0,e.paymentId=crypto.randomUUID(),e.currentPayment={type:"exchange",exchangeId:t};const{network:a,asset:u}=e.paymentAsset,i={network:a,asset:u,amount:e.tokenAmount,recipient:s},c=await m.getPayUrl(t,i);if(!c){try{r.close()}catch(o){console.error("Unable to close popup window",o)}throw new Error("Unable to initiate payment")}e.currentPayment.sessionId=c.sessionId,e.currentPayment.status="IN_PROGRESS",e.currentPayment.exchangeId=t,r.location.href=c.url}catch{e.error="Unable to initiate payment",A.showError(e.error)}},async waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r=20}){const a=await m.getBuyStatus(t,n,s);if(a.status==="SUCCESS"||a.status==="FAILED")return a;if(r===0)throw new Error("Unable to get deposit status");return await new Promise(u=>{setTimeout(u,5e3)}),m.waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r-1})},async getBuyStatus(t,n,s){var r,a,u,i,c;try{if(!e.currentPayment)throw new Error("No current payment");const o=await T({sessionId:n,exchangeId:t});if(e.currentPayment.status=o.status,o.status==="SUCCESS"||o.status==="FAILED"){const p=(r=l.getAccountData())==null?void 0:r.address;e.currentPayment.result=o.txHash,e.isPaymentInProgress=!1,w.sendEvent({type:"track",event:o.status==="SUCCESS"?"PAY_SUCCESS":"PAY_ERROR",properties:{message:o.status==="FAILED"?E.parseError(e.error):void 0,source:"fund-from-exchange",paymentId:s,configuration:{network:((a=e.paymentAsset)==null?void 0:a.network)||"",asset:((u=e.paymentAsset)==null?void 0:u.asset)||"",recipient:p||"",amount:e.amount??0},currentPayment:{type:"exchange",exchangeId:(i=e.currentPayment)==null?void 0:i.exchangeId,sessionId:(c=e.currentPayment)==null?void 0:c.sessionId,result:o.txHash}}})}return o}catch{return{status:"UNKNOWN",txHash:""}}},reset(){e.currentPayment=void 0,e.isPaymentInProgress=!1,e.paymentId="",e.paymentAsset=null,e.amount=0,e.tokenAmount=0,e.priceLoading=!1,e.error=null,e.exchanges=[],e.isLoading=!1}};export{m as E};
1
+ import{C as l,E as w,b as E,S as A,d as k,O as U,N as P,g as f,B as x,e as N,i as I,p as L}from"./W3MFrameProviderSingleton-kv89Sw6-.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-YgH_1ppY.js";const D=0,C={paymentAsset:null,amount:null,tokenAmount:0,priceLoading:!1,error:null,exchanges:[],isLoading:!1,currentPayment:void 0,isPaymentInProgress:!1,paymentId:"",assets:[]},e=L(C),m={state:e,subscribe(t){return I(e,()=>t(e))},subscribeKey(t,n){return N(e,t,n)},resetState(){Object.assign(e,{...C})},async getAssetsForNetwork(t){const n=v(t),s=await m.getAssetsImageAndPrice(n),r=n.map(a=>{var c,o,p,y;const u=a.asset==="native"?f():`${a.network}:${a.asset}`,i=s.find(S=>{var g,d,h;return((h=(d=(g=S.fungibles)==null?void 0:g[0])==null?void 0:d.address)==null?void 0:h.toLowerCase())===u.toLowerCase()});return{...a,price:((o=(c=i==null?void 0:i.fungibles)==null?void 0:c[0])==null?void 0:o.price)||1,metadata:{...a.metadata,iconUrl:(y=(p=i==null?void 0:i.fungibles)==null?void 0:p[0])==null?void 0:y.iconUrl}}});return e.assets=r,r},async getAssetsImageAndPrice(t){const n=t.map(r=>r.asset==="native"?f():`${r.network}:${r.asset}`);return await Promise.all(n.map(r=>x.fetchTokenPrice({addresses:[r]})))},getTokenAmount(){var s;if(!((s=e==null?void 0:e.paymentAsset)!=null&&s.price))throw new Error("Cannot get token price");const t=P.bigNumber(e.amount??0).round(8),n=P.bigNumber(e.paymentAsset.price).round(8);return t.div(n).round(8).toNumber()},setAmount(t){var n;e.amount=t,(n=e.paymentAsset)!=null&&n.price&&(e.tokenAmount=m.getTokenAmount())},setPaymentAsset(t){e.paymentAsset=t},isPayWithExchangeEnabled(){var t;return(t=U.state.remoteFeatures)==null?void 0:t.payWithExchange},isPayWithExchangeSupported(){return m.isPayWithExchangeEnabled()&&l.state.activeCaipNetwork&&k.PAY_WITH_EXCHANGE_SUPPORTED_CHAIN_NAMESPACES.includes(l.state.activeCaipNetwork.chainNamespace)},async fetchExchanges(){var t;try{const n=m.isPayWithExchangeSupported();if(!e.paymentAsset||!n){e.exchanges=[],e.isLoading=!1;return}e.isLoading=!0;const s=await _({page:D,asset:b(e.paymentAsset.network,e.paymentAsset.asset),amount:((t=e.amount)==null?void 0:t.toString())??"0"});e.exchanges=s.exchanges.slice(0,2)}catch{throw A.showError("Unable to get exchanges"),new Error("Unable to get exchanges")}finally{e.isLoading=!1}},async getPayUrl(t,n){try{const s=Number(n.amount),r=await W({exchangeId:t,asset:b(n.network,n.asset),amount:s.toString(),recipient:`${n.network}:${n.recipient}`});return w.sendEvent({type:"track",event:"PAY_EXCHANGE_SELECTED",properties:{exchange:{id:t},configuration:{network:n.network,asset:n.asset,recipient:n.recipient,amount:s},currentPayment:{type:"exchange",exchangeId:t},source:"fund-from-exchange",headless:!1}}),r}catch(s){throw s instanceof Error&&s.message.includes("is not supported")?new Error("Asset not supported"):new Error(s.message)}},async handlePayWithExchange(t){var n;try{const s=(n=l.getAccountData())==null?void 0:n.address;if(!s)throw new Error("No account connected");if(!e.paymentAsset)throw new Error("No payment asset selected");const r=E.returnOpenHref("","popupWindow","scrollbar=yes,width=480,height=720");if(!r)throw new Error("Could not create popup window");e.isPaymentInProgress=!0,e.paymentId=crypto.randomUUID(),e.currentPayment={type:"exchange",exchangeId:t};const{network:a,asset:u}=e.paymentAsset,i={network:a,asset:u,amount:e.tokenAmount,recipient:s},c=await m.getPayUrl(t,i);if(!c){try{r.close()}catch(o){console.error("Unable to close popup window",o)}throw new Error("Unable to initiate payment")}e.currentPayment.sessionId=c.sessionId,e.currentPayment.status="IN_PROGRESS",e.currentPayment.exchangeId=t,r.location.href=c.url}catch{e.error="Unable to initiate payment",A.showError(e.error)}},async waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r=20}){const a=await m.getBuyStatus(t,n,s);if(a.status==="SUCCESS"||a.status==="FAILED")return a;if(r===0)throw new Error("Unable to get deposit status");return await new Promise(u=>{setTimeout(u,5e3)}),m.waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r-1})},async getBuyStatus(t,n,s){var r,a,u,i,c;try{if(!e.currentPayment)throw new Error("No current payment");const o=await T({sessionId:n,exchangeId:t});if(e.currentPayment.status=o.status,o.status==="SUCCESS"||o.status==="FAILED"){const p=(r=l.getAccountData())==null?void 0:r.address;e.currentPayment.result=o.txHash,e.isPaymentInProgress=!1,w.sendEvent({type:"track",event:o.status==="SUCCESS"?"PAY_SUCCESS":"PAY_ERROR",properties:{message:o.status==="FAILED"?E.parseError(e.error):void 0,source:"fund-from-exchange",paymentId:s,configuration:{network:((a=e.paymentAsset)==null?void 0:a.network)||"",asset:((u=e.paymentAsset)==null?void 0:u.asset)||"",recipient:p||"",amount:e.amount??0},currentPayment:{type:"exchange",exchangeId:(i=e.currentPayment)==null?void 0:i.exchangeId,sessionId:(c=e.currentPayment)==null?void 0:c.sessionId,result:o.txHash}}})}return o}catch{return{status:"UNKNOWN",txHash:""}}},reset(){e.currentPayment=void 0,e.isPaymentInProgress=!1,e.paymentId="",e.paymentAsset=null,e.amount=0,e.tokenAmount=0,e.priceLoading=!1,e.error=null,e.exchanges=[],e.isLoading=!1}};export{m as E};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/RealCheckout-DfpfMajt.js","assets/react-Vu6nbGi5.js","assets/index-BiC8AOx_.js","assets/ethers-JeCAM1sd.js","assets/index-DliU9pat.css"])))=>i.map(i=>d[i]);
2
- import{Y as $,h as b,Z as F,a as O,y as V,j as _,D as S,H as E,k as u,d as C,Q as R,_ as Y}from"./index-BiC8AOx_.js";import{a as z,r as l,j as e}from"./react-Vu6nbGi5.js";import{C as N}from"./CircularProgress-DmKPpYYp.js";import"./ethers-JeCAM1sd.js";import"./generateUtilityClasses-YwmkdnPH.js";function G(){return b.shopServerUrl||b.creditsServerUrl}async function K(t,s){const r=await $(`${G()}/credits/checkout`,{method:"POST",identity:s,metadata:{},headers:{"Content-Type":"application/json"},body:JSON.stringify({packId:t})});if(!r.ok)throw new Error(`checkout ${r.status}: ${await r.text()}`);const{orderId:a,clientSecret:n}=await r.json();return{orderId:a,clientSecret:n,mock:!1}}async function L(t,s,r={}){const{intervalMs:a=1500,timeoutMs:n=6e4,signal:i}=r,c=Date.now()+n;for(;;){if(i!=null&&i.aborted)throw new DOMException("Aborted","AbortError");const m=await q(t,s,i);if(m.status!=="processing")return m;if(Date.now()>c)return{status:"failed",error:"Timed out waiting for your credits."};await Q(a,i)}}async function q(t,s,r){const a=await $(`${G()}/credits/orders/${t}`,{method:"GET",identity:s,metadata:{},signal:r});if(!a.ok)throw new Error(`order status ${a.status}`);return a.json()}function Q(t,s){return new Promise((r,a)=>{const n=setTimeout(r,t);s==null||s.addEventListener("abort",()=>{clearTimeout(n),a(new DOMException("Aborted","AbortError"))})})}const J=.1,T=[{id:"pack_5",usd:5,credits:y(5)},{id:"pack_10",usd:10,credits:y(10)},{id:"pack_25",usd:25,credits:y(25),bestValue:!0},{id:"pack_50",usd:50,credits:y(50)}];function y(t){return Math.round(t/J)}function M(t){return T.find(s=>s.id===t)}const x="mock_cs_";function k(){return!b.stripePublishableKey}async function W(t,s){const r=M(t);if(!r)throw new Error("Unknown pack");if(k())return X(r);if(!(s!=null&&s.identity))throw new Error("Sign in to get credits.");return K(t,s.identity)}async function H(t,s={}){const{intervalMs:r,timeoutMs:a,signal:n,identity:i}=s;if(t.startsWith(x)||k())return Z(t,s);if(!i)throw new Error("Sign in to get credits.");return L(t,i,{intervalMs:r,timeoutMs:a,signal:n})}function X(t){const s=`${x}${t.id}_${Date.now()}`;return D(400).then(()=>({orderId:s,clientSecret:`${x}${t.id}`,mock:!0}))}async function Z(t,s={}){await D(s.intervalMs??900);const r=t.replace(x,"").replace(/_\d+$/,""),a=M(r),n=(a==null?void 0:a.credits)??0;if(s.address&&a)try{const i=await F(s.address,Math.round(a.usd*100));return{status:"credited",creditsGranted:n,newBalance:i.credits}}catch(i){return{status:"failed",error:i.message}}return{status:"credited",creditsGranted:n,newBalance:n}}function D(t,s){return new Promise((r,a)=>{setTimeout(r,t)})}const g=k()?"mock":"stripe",ee=l.lazy(()=>Y(()=>import("./RealCheckout-DfpfMajt.js"),__vite__mapDeps([0,1,2,3,4])));function P(t){const s=t;if((s==null?void 0:s.name)==="AbortError")return"You cancelled the request.";const r=((s==null?void 0:s.message)??"").toLowerCase();return r.includes("sign in")?`Sign in to get ${u.name}.`:r.includes("timed out")?`This is taking longer than usual — your ${u.name} will appear shortly.`:"Couldn't complete your purchase — please try again."}function oe(){const t=z(),{session:s,signIn:r}=O(),a=V(),[n,i]=l.useState("select"),[c,m]=l.useState(null),[h,w]=l.useState(null),[I,v]=l.useState(null),[A,p]=l.useState(null),j=l.useRef(null);l.useEffect(()=>()=>{var d;return(d=j.current)==null?void 0:d.abort()},[]);const B=l.useCallback(async d=>{if(!s){r();return}p(null),m(d),i("paying"),_("Shop Started Buy Credits",{pack_usd:d.usd,credits:d.credits,provider:g});try{const o=await W(d.id,{address:s.address,identity:s.identity});w(o)}catch(o){S(o,{flow:"get_credits",step:"checkout",provider:g}),_("Shop Buy Credits Failed",{step:"checkout",error_code:E(o),pack_usd:d.usd}),p(P(o)),i("error")}},[s,r]),U=l.useCallback(async()=>{if(!h)return;i("processing");const d=new AbortController;j.current=d;try{const o=await H(h.orderId,{signal:d.signal,address:s==null?void 0:s.address,identity:s==null?void 0:s.identity});o.status==="credited"?(v(o.creditsGranted??(c==null?void 0:c.credits)??0),i("success"),_("Shop Completed Buy Credits",{order_id:h.orderId,pack_usd:(c==null?void 0:c.usd)??null,credits:o.creditsGranted??(c==null?void 0:c.credits)??0,provider:g}),a.invalidateQueries({queryKey:["usd-balance"]})):(_("Shop Buy Credits Failed",{step:"grant",error_code:"grant_failed",pack_usd:(c==null?void 0:c.usd)??null}),p(o.error??`Couldn't add your ${u.name} — please try again.`),i("error"))}catch(o){S(o,{flow:"get_credits",step:"grant",order_id:h.orderId}),_("Shop Buy Credits Failed",{step:"grant",error_code:E(o),pack_usd:(c==null?void 0:c.usd)??null}),p(P(o)),i("error")}},[h,c,s,a]);function f(){var d;(d=j.current)==null||d.abort(),i("select"),m(null),w(null),v(null),p(null)}return e.jsxs("div",{className:"getcredits",children:[e.jsxs("header",{className:"getcredits__head",children:[e.jsxs("h1",{className:"getcredits__title",children:["Get ",u.name]}),e.jsxs("p",{className:"muted",children:["Add ",u.name," to your account to shop. Pay with any card."]})]}),s?e.jsxs(e.Fragment,{children:[n==="select"&&e.jsx(se,{onSelect:B}),n==="paying"&&c&&e.jsx(te,{pack:c,checkout:h,onPaid:U,onCancel:f}),n==="processing"&&e.jsxs("div",{className:"getcredits__status",role:"status","aria-live":"polite",children:[e.jsx(N,{size:40}),e.jsxs("p",{className:"getcredits__status-title",children:["Adding your ",u.name,"…"]}),e.jsx("p",{className:"muted",children:"Payment received. Just a moment while we top up your balance."})]}),n==="success"&&e.jsxs("div",{className:"getcredits__status getcredits__status--ok",role:"status","aria-live":"polite",children:[e.jsx("div",{className:"getcredits__confetti","aria-hidden":!0,children:"🎉"}),e.jsx("p",{className:"getcredits__status-title",children:"You’re all set!"}),e.jsxs("p",{className:"muted",children:[e.jsxs("strong",{children:[e.jsx(C,{className:"ccy-mark"})," ",I]})," ",u.name," added to your account."]}),e.jsxs("div",{className:"getcredits__status-actions",children:[e.jsx("button",{className:"btn",onClick:()=>t("/cart"),children:"Back to cart"}),e.jsxs("button",{className:"btn btn--ghost",onClick:f,children:["Get more ",u.name]})]})]}),n==="error"&&e.jsxs("div",{className:"getcredits__status getcredits__status--err",role:"alert",children:[e.jsx("p",{className:"getcredits__status-title",children:"Something went wrong"}),e.jsx("p",{className:"error",children:A}),e.jsx("div",{className:"getcredits__status-actions",children:e.jsx("button",{className:"btn",onClick:f,children:"Try again"})})]})]}):e.jsxs("div",{className:"getcredits__status",role:"status",children:[e.jsxs("p",{className:"getcredits__status-title",children:["Sign in to get ",u.name]}),e.jsxs("p",{className:"muted",children:["Connect your account to buy ",u.name," and start shopping."]}),e.jsx("div",{className:"getcredits__status-actions",children:e.jsx("button",{className:"btn btn--purple",onClick:r,children:"Sign in"})})]})]})}function se({onSelect:t}){return e.jsx("div",{className:"packs",children:T.map(s=>e.jsxs("button",{type:"button",className:`pack${s.bestValue?" pack--best":""}`,onClick:()=>t(s),"aria-label":`Get ${R(s.credits)} for $${s.usd}`,children:[s.bestValue&&e.jsx("span",{className:"pack__ribbon",children:"Best value"}),e.jsxs("span",{className:"pack__credits",children:[e.jsx(C,{className:"pack__credits-ico"}),s.credits]}),e.jsx("span",{className:"pack__label",children:u.name}),e.jsxs("span",{className:"pack__price",children:["$",s.usd]}),e.jsxs("span",{className:"pack__cta",children:["Get ",u.name]})]},s.id))})}function te({pack:t,checkout:s,onPaid:r,onCancel:a}){return e.jsxs("div",{className:"pay",children:[e.jsxs("div",{className:"pay__summary",children:[e.jsx("button",{className:"link",onClick:a,children:"← Choose a different pack"}),e.jsxs("div",{className:"pay__summary-row",children:[e.jsx("span",{children:"You’ll get"}),e.jsxs("strong",{children:[e.jsx(C,{className:"ccy-mark"})," ",R(t.credits)]})]}),e.jsxs("div",{className:"pay__summary-row pay__summary-row--total",children:[e.jsx("span",{children:"You pay"}),e.jsxs("strong",{children:["$",t.usd]})]})]}),e.jsx("div",{className:"pay__form",children:s?s.mock?e.jsx(re,{onPaid:r,amountUsd:t.usd}):e.jsx(l.Suspense,{fallback:e.jsxs("div",{className:"getcredits__status",role:"status","aria-live":"polite",children:[e.jsx(N,{size:32}),e.jsx("p",{className:"muted",children:"Getting the payment form ready…"})]}),children:e.jsx(ee,{clientSecret:s.clientSecret,onComplete:r})}):e.jsxs("div",{className:"getcredits__status",role:"status","aria-live":"polite",children:[e.jsx(N,{size:32}),e.jsx("p",{className:"muted",children:"Getting the payment form ready…"})]})})]})}function re({onPaid:t,amountUsd:s}){const[r,a]=l.useState("4242 4242 4242 4242"),[n,i]=l.useState(!1);function c(){i(!0),setTimeout(()=>t(),700)}return e.jsxs("div",{className:"card-form","aria-label":"Payment details",children:[e.jsx("p",{className:"muted small card-form__note",children:"Demo mode — no real charge is made."}),e.jsxs("label",{className:"field",children:[e.jsx("span",{children:"Card number"}),e.jsx("input",{value:r,onChange:m=>a(m.target.value),disabled:n,inputMode:"numeric"})]}),e.jsxs("div",{className:"card-form__row",children:[e.jsxs("label",{className:"field",children:[e.jsx("span",{children:"Expiry"}),e.jsx("input",{defaultValue:"12 / 34",disabled:n})]}),e.jsxs("label",{className:"field",children:[e.jsx("span",{children:"CVC"}),e.jsx("input",{defaultValue:"123",disabled:n,inputMode:"numeric"})]})]}),e.jsx("button",{className:"btn btn--purple card-form__pay",onClick:c,disabled:n,children:n?"Processing…":`Pay $${s}`})]})}export{oe as GetCredits,oe as default};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/RealCheckout-B4OdfXIG.js","assets/react-Vu6nbGi5.js","assets/index-DC3L0_Kx.js","assets/ethers-JeCAM1sd.js","assets/index-MNMpVtqO.css"])))=>i.map(i=>d[i]);
2
+ import{Y as $,h as b,Z as F,a as O,y as V,j as _,D as S,H as E,k as u,d as C,Q as R,_ as Y}from"./index-DC3L0_Kx.js";import{a as z,r as l,j as e}from"./react-Vu6nbGi5.js";import{C as N}from"./CircularProgress-BBL7xJ_3.js";import"./ethers-JeCAM1sd.js";import"./generateUtilityClasses-BqTxi5Sw.js";function G(){return b.shopServerUrl||b.creditsServerUrl}async function K(t,s){const r=await $(`${G()}/credits/checkout`,{method:"POST",identity:s,metadata:{},headers:{"Content-Type":"application/json"},body:JSON.stringify({packId:t})});if(!r.ok)throw new Error(`checkout ${r.status}: ${await r.text()}`);const{orderId:a,clientSecret:n}=await r.json();return{orderId:a,clientSecret:n,mock:!1}}async function L(t,s,r={}){const{intervalMs:a=1500,timeoutMs:n=6e4,signal:i}=r,c=Date.now()+n;for(;;){if(i!=null&&i.aborted)throw new DOMException("Aborted","AbortError");const m=await q(t,s,i);if(m.status!=="processing")return m;if(Date.now()>c)return{status:"failed",error:"Timed out waiting for your credits."};await Q(a,i)}}async function q(t,s,r){const a=await $(`${G()}/credits/orders/${t}`,{method:"GET",identity:s,metadata:{},signal:r});if(!a.ok)throw new Error(`order status ${a.status}`);return a.json()}function Q(t,s){return new Promise((r,a)=>{const n=setTimeout(r,t);s==null||s.addEventListener("abort",()=>{clearTimeout(n),a(new DOMException("Aborted","AbortError"))})})}const J=.1,T=[{id:"pack_5",usd:5,credits:y(5)},{id:"pack_10",usd:10,credits:y(10)},{id:"pack_25",usd:25,credits:y(25),bestValue:!0},{id:"pack_50",usd:50,credits:y(50)}];function y(t){return Math.round(t/J)}function M(t){return T.find(s=>s.id===t)}const x="mock_cs_";function k(){return!b.stripePublishableKey}async function W(t,s){const r=M(t);if(!r)throw new Error("Unknown pack");if(k())return X(r);if(!(s!=null&&s.identity))throw new Error("Sign in to get credits.");return K(t,s.identity)}async function H(t,s={}){const{intervalMs:r,timeoutMs:a,signal:n,identity:i}=s;if(t.startsWith(x)||k())return Z(t,s);if(!i)throw new Error("Sign in to get credits.");return L(t,i,{intervalMs:r,timeoutMs:a,signal:n})}function X(t){const s=`${x}${t.id}_${Date.now()}`;return D(400).then(()=>({orderId:s,clientSecret:`${x}${t.id}`,mock:!0}))}async function Z(t,s={}){await D(s.intervalMs??900);const r=t.replace(x,"").replace(/_\d+$/,""),a=M(r),n=(a==null?void 0:a.credits)??0;if(s.address&&a)try{const i=await F(s.address,Math.round(a.usd*100));return{status:"credited",creditsGranted:n,newBalance:i.credits}}catch(i){return{status:"failed",error:i.message}}return{status:"credited",creditsGranted:n,newBalance:n}}function D(t,s){return new Promise((r,a)=>{setTimeout(r,t)})}const g=k()?"mock":"stripe",ee=l.lazy(()=>Y(()=>import("./RealCheckout-B4OdfXIG.js"),__vite__mapDeps([0,1,2,3,4])));function P(t){const s=t;if((s==null?void 0:s.name)==="AbortError")return"You cancelled the request.";const r=((s==null?void 0:s.message)??"").toLowerCase();return r.includes("sign in")?`Sign in to get ${u.name}.`:r.includes("timed out")?`This is taking longer than usual — your ${u.name} will appear shortly.`:"Couldn't complete your purchase — please try again."}function oe(){const t=z(),{session:s,signIn:r}=O(),a=V(),[n,i]=l.useState("select"),[c,m]=l.useState(null),[h,w]=l.useState(null),[I,v]=l.useState(null),[A,p]=l.useState(null),j=l.useRef(null);l.useEffect(()=>()=>{var d;return(d=j.current)==null?void 0:d.abort()},[]);const B=l.useCallback(async d=>{if(!s){r();return}p(null),m(d),i("paying"),_("Shop Started Buy Credits",{pack_usd:d.usd,credits:d.credits,provider:g});try{const o=await W(d.id,{address:s.address,identity:s.identity});w(o)}catch(o){S(o,{flow:"get_credits",step:"checkout",provider:g}),_("Shop Buy Credits Failed",{step:"checkout",error_code:E(o),pack_usd:d.usd}),p(P(o)),i("error")}},[s,r]),U=l.useCallback(async()=>{if(!h)return;i("processing");const d=new AbortController;j.current=d;try{const o=await H(h.orderId,{signal:d.signal,address:s==null?void 0:s.address,identity:s==null?void 0:s.identity});o.status==="credited"?(v(o.creditsGranted??(c==null?void 0:c.credits)??0),i("success"),_("Shop Completed Buy Credits",{order_id:h.orderId,pack_usd:(c==null?void 0:c.usd)??null,credits:o.creditsGranted??(c==null?void 0:c.credits)??0,provider:g}),a.invalidateQueries({queryKey:["usd-balance"]})):(_("Shop Buy Credits Failed",{step:"grant",error_code:"grant_failed",pack_usd:(c==null?void 0:c.usd)??null}),p(o.error??`Couldn't add your ${u.name} — please try again.`),i("error"))}catch(o){S(o,{flow:"get_credits",step:"grant",order_id:h.orderId}),_("Shop Buy Credits Failed",{step:"grant",error_code:E(o),pack_usd:(c==null?void 0:c.usd)??null}),p(P(o)),i("error")}},[h,c,s,a]);function f(){var d;(d=j.current)==null||d.abort(),i("select"),m(null),w(null),v(null),p(null)}return e.jsxs("div",{className:"getcredits",children:[e.jsxs("header",{className:"getcredits__head",children:[e.jsxs("h1",{className:"getcredits__title",children:["Get ",u.name]}),e.jsxs("p",{className:"muted",children:["Add ",u.name," to your account to shop. Pay with any card."]})]}),s?e.jsxs(e.Fragment,{children:[n==="select"&&e.jsx(se,{onSelect:B}),n==="paying"&&c&&e.jsx(te,{pack:c,checkout:h,onPaid:U,onCancel:f}),n==="processing"&&e.jsxs("div",{className:"getcredits__status",role:"status","aria-live":"polite",children:[e.jsx(N,{size:40}),e.jsxs("p",{className:"getcredits__status-title",children:["Adding your ",u.name,"…"]}),e.jsx("p",{className:"muted",children:"Payment received. Just a moment while we top up your balance."})]}),n==="success"&&e.jsxs("div",{className:"getcredits__status getcredits__status--ok",role:"status","aria-live":"polite",children:[e.jsx("div",{className:"getcredits__confetti","aria-hidden":!0,children:"🎉"}),e.jsx("p",{className:"getcredits__status-title",children:"You’re all set!"}),e.jsxs("p",{className:"muted",children:[e.jsxs("strong",{children:[e.jsx(C,{className:"ccy-mark"})," ",I]})," ",u.name," added to your account."]}),e.jsxs("div",{className:"getcredits__status-actions",children:[e.jsx("button",{className:"btn",onClick:()=>t("/cart"),children:"Back to cart"}),e.jsxs("button",{className:"btn btn--ghost",onClick:f,children:["Get more ",u.name]})]})]}),n==="error"&&e.jsxs("div",{className:"getcredits__status getcredits__status--err",role:"alert",children:[e.jsx("p",{className:"getcredits__status-title",children:"Something went wrong"}),e.jsx("p",{className:"error",children:A}),e.jsx("div",{className:"getcredits__status-actions",children:e.jsx("button",{className:"btn",onClick:f,children:"Try again"})})]})]}):e.jsxs("div",{className:"getcredits__status",role:"status",children:[e.jsxs("p",{className:"getcredits__status-title",children:["Sign in to get ",u.name]}),e.jsxs("p",{className:"muted",children:["Connect your account to buy ",u.name," and start shopping."]}),e.jsx("div",{className:"getcredits__status-actions",children:e.jsx("button",{className:"btn btn--purple",onClick:r,children:"Sign in"})})]})]})}function se({onSelect:t}){return e.jsx("div",{className:"packs",children:T.map(s=>e.jsxs("button",{type:"button",className:`pack${s.bestValue?" pack--best":""}`,onClick:()=>t(s),"aria-label":`Get ${R(s.credits)} for $${s.usd}`,children:[s.bestValue&&e.jsx("span",{className:"pack__ribbon",children:"Best value"}),e.jsxs("span",{className:"pack__credits",children:[e.jsx(C,{className:"pack__credits-ico"}),s.credits]}),e.jsx("span",{className:"pack__label",children:u.name}),e.jsxs("span",{className:"pack__price",children:["$",s.usd]}),e.jsxs("span",{className:"pack__cta",children:["Get ",u.name]})]},s.id))})}function te({pack:t,checkout:s,onPaid:r,onCancel:a}){return e.jsxs("div",{className:"pay",children:[e.jsxs("div",{className:"pay__summary",children:[e.jsx("button",{className:"link",onClick:a,children:"← Choose a different pack"}),e.jsxs("div",{className:"pay__summary-row",children:[e.jsx("span",{children:"You’ll get"}),e.jsxs("strong",{children:[e.jsx(C,{className:"ccy-mark"})," ",R(t.credits)]})]}),e.jsxs("div",{className:"pay__summary-row pay__summary-row--total",children:[e.jsx("span",{children:"You pay"}),e.jsxs("strong",{children:["$",t.usd]})]})]}),e.jsx("div",{className:"pay__form",children:s?s.mock?e.jsx(re,{onPaid:r,amountUsd:t.usd}):e.jsx(l.Suspense,{fallback:e.jsxs("div",{className:"getcredits__status",role:"status","aria-live":"polite",children:[e.jsx(N,{size:32}),e.jsx("p",{className:"muted",children:"Getting the payment form ready…"})]}),children:e.jsx(ee,{clientSecret:s.clientSecret,onComplete:r})}):e.jsxs("div",{className:"getcredits__status",role:"status","aria-live":"polite",children:[e.jsx(N,{size:32}),e.jsx("p",{className:"muted",children:"Getting the payment form ready…"})]})})]})}function re({onPaid:t,amountUsd:s}){const[r,a]=l.useState("4242 4242 4242 4242"),[n,i]=l.useState(!1);function c(){i(!0),setTimeout(()=>t(),700)}return e.jsxs("div",{className:"card-form","aria-label":"Payment details",children:[e.jsx("p",{className:"muted small card-form__note",children:"Demo mode — no real charge is made."}),e.jsxs("label",{className:"field",children:[e.jsx("span",{children:"Card number"}),e.jsx("input",{value:r,onChange:m=>a(m.target.value),disabled:n,inputMode:"numeric"})]}),e.jsxs("div",{className:"card-form__row",children:[e.jsxs("label",{className:"field",children:[e.jsx("span",{children:"Expiry"}),e.jsx("input",{defaultValue:"12 / 34",disabled:n})]}),e.jsxs("label",{className:"field",children:[e.jsx("span",{children:"CVC"}),e.jsx("input",{defaultValue:"123",disabled:n,inputMode:"numeric"})]})]}),e.jsx("button",{className:"btn btn--purple card-form__pay",onClick:c,disabled:n,children:n?"Processing…":`Pay $${s}`})]})}export{oe as GetCredits,oe as default};
@@ -1,4 +1,4 @@
1
- import{i as f,b as h}from"./lit-element-B3y9oplH.js";import{n as m}from"./class-map-CxwNmq0D.js";import{c as p}from"./index-CadBLrlA.js";import{d as g,r as v}from"./index-BPiOplYA.js";import{C as c}from"./ConstantsUtil-CiDezLbv.js";import{R as $,O as u}from"./W3MFrameProviderSingleton-lwu7rhSU.js";import{au as y}from"./NetworkUtil-DDES604E.js";const b=g`
1
+ import{i as f,b as h}from"./lit-element-B3y9oplH.js";import{n as m}from"./class-map-CxwNmq0D.js";import{c as p}from"./index-DvXHw62x.js";import{d as g,r as v}from"./index-YgH_1ppY.js";import{C as c}from"./ConstantsUtil-CiDezLbv.js";import{R as $,O as u}from"./W3MFrameProviderSingleton-kv89Sw6-.js";import{au as y}from"./NetworkUtil-DDES604E.js";const b=g`
2
2
  :host {
3
3
  display: flex;
4
4
  justify-content: center;
@@ -1 +1 @@
1
- import{a as E,r as p,j as e,L as A}from"./react-Vu6nbGi5.js";import{j as Q,D as L,k as S,d as v,a as R,y as F,c as K,s as P}from"./index-BiC8AOx_.js";import{i as W,R as Y,f as G}from"./import-DuwIf2Pi.js";import{s as O}from"./wallet-kind-BbqVQ9gJ.js";import"./ethers-JeCAM1sd.js";import"./buy-njp9xZO9.js";import"./index-rktQ2LR5.js";import"./mana-rate-G2IgQgyW.js";function B({queue:l,session:I,onClose:g,onDone:h}){const x=E(),c=O(I.providerType),[d,j]=p.useState(()=>l.map(()=>"pending")),[b,C]=p.useState("running"),w=p.useRef(!1);p.useEffect(()=>{if(w.current)return;w.current=!0;let t=!1;return(async()=>{for(let s=0;s<l.length;s++){if(t)return;j(r=>r.map((m,o)=>o===s?"active":m));try{await W(l[s].item,l[s].priceCredits,I),Q("Shop Migrated Listing",{item_id:l[s].item.itemId??l[s].item.oldTradeId??null,contract_address:l[s].item.contractAddress,new_price_credits:l[s].priceCredits,new_price_usd:l[s].priceCredits/10}),t||j(r=>r.map((m,o)=>o===s?"done":m))}catch(r){if(r instanceof Y)L(r,{flow:"import_listing",step:"relist",itemId:l[s].item.itemId??l[s].item.oldTradeId}),t||j(m=>m.map((o,y)=>y===s?"unlisted":o));else{const m=r,o=m.code===4001||/reject|denied|cancel/i.test(m.message??"");o||L(r,{flow:"import_listing",itemId:l[s].item.itemId??l[s].item.oldTradeId}),t||j(y=>y.map((T,a)=>a===s?o?"skipped":"failed":T))}}}t||C("finished")})(),()=>{t=!0}},[]);const u=d.filter(t=>t==="done").length,N=d.findIndex(t=>t==="active"),_=Math.round(d.filter(t=>t!=="pending"&&t!=="active").length/l.length*100);function f(){h(),g()}if(b==="finished"){const t=d.filter(r=>r==="skipped"||r==="failed").length,s=d.filter(r=>r==="unlisted").length;return e.jsx("div",{className:"modal-backdrop",role:"presentation",children:e.jsxs("div",{className:"modal modal--success",role:"dialog","aria-modal":"true",children:[e.jsx("div",{className:"modal-success__check","aria-hidden":!0,children:"✓"}),e.jsx("h2",{className:"modal__title",children:u>0?"You're in the Shop! 🎉":"Nothing listed"}),e.jsxs("p",{className:"muted",style:{margin:0},children:[u>0?`${u} ${u===1?"item is":"items are"} now for sale with ${S.name}.`:"No items were listed.",t>0?` ${t} skipped — you can try those again anytime.`:"",s>0?` ${s} ${s===1?"item was":"items were"} taken off the old marketplace but couldn't be re-listed — re-list ${s===1?"it":"them"} from My Assets.`:""]}),e.jsxs("div",{className:"modal__actions",children:[e.jsx("button",{className:"btn btn--ghost",onClick:f,children:"Done"}),s>0?e.jsx("button",{className:"btn btn--purple",onClick:()=>{h(),g(),x("/my-assets")},children:"Go to My Assets"}):u>0?e.jsx("button",{className:"btn btn--purple",onClick:()=>{h(),g(),x("/assets")},children:"View in Shop"}):null]})]})})}return e.jsx("div",{className:"modal-backdrop",role:"presentation",children:e.jsxs("div",{className:"modal migrate",role:"dialog","aria-modal":"true","aria-live":"polite",children:[e.jsx("h2",{className:"modal__title",children:"Listing your items"}),e.jsxs("p",{className:"muted small",style:{margin:"0 0 4px"},children:[c?"We take down each old listing and re-list it for credits — confirm each step.":"Moving your items to the Shop."," ",N>=0?`${N+1} of ${l.length}`:""]}),e.jsx("div",{className:"migrate__progress",children:e.jsx("div",{className:"migrate__bar",style:{width:`${_}%`}})}),e.jsx("ul",{className:"migrate__list",children:l.map((t,s)=>e.jsxs("li",{className:`migrate__row migrate__row--${d[s]}`,children:[e.jsx("span",{className:"migrate__thumb",children:t.item.thumbnail?e.jsx("img",{src:t.item.thumbnail,alt:""}):null}),e.jsx("span",{className:"migrate__name",title:t.item.name,children:t.item.name||"Item"}),e.jsxs("span",{className:"migrate__price",children:[e.jsx(v,{className:"ccy-mark"})," ",t.priceCredits.toLocaleString()]}),e.jsx("span",{className:"migrate__status",children:d[s]==="active"?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"spinner migrate__spin","aria-hidden":!0})," ",c?"Confirm…":"Adding…"]}):d[s]==="done"?e.jsx("span",{className:"migrate__tick",children:"✓"}):d[s]==="skipped"?e.jsx("span",{className:"migrate__skip",children:"Skipped"}):d[s]==="failed"?e.jsx("span",{className:"migrate__skip",children:"Failed"}):d[s]==="unlisted"?e.jsx("span",{className:"migrate__skip",title:"Removed from the old marketplace but not re-listed — re-list it from My Assets.",children:"Not listed"}):e.jsx("span",{className:"migrate__wait",children:"Waiting"})})]},t.item.oldTradeId))}),e.jsx("p",{className:"muted small migrate__hint",children:c?"A couple of quick confirmations pop up per item (take down + re-list). Keep this open.":"This only takes a moment — keep this open."})]})})}const D=[{key:"creations",title:"Your creations",sub:"Items you made. Put them on sale in the Shop."},{key:"owned",title:"Items you own",sub:"Things you've bought elsewhere — resell them in the Shop."}];function ee(){const{session:l,signIn:I,restore:g}=R(),h=F(),x=l==null?void 0:l.address;p.useEffect(()=>{g()},[g]);const{data:c,isLoading:d}=K({queryKey:["importable",x],queryFn:()=>G(x),enabled:!!x}),[j,b]=p.useState({}),[C,w]=p.useState(new Set),[u,N]=p.useState(null),_=p.useMemo(()=>[...(c==null?void 0:c.creations)??[],...(c==null?void 0:c.owned)??[]],[c]);p.useEffect(()=>{_.length&&b(a=>{const n={...a};for(const i of _)n[i.oldTradeId]==null&&(n[i.oldTradeId]=i.suggestedCredits);return n})},[_]);const f=a=>!C.has(a),t=a=>j[a.oldTradeId]??a.suggestedCredits,s=_.filter(a=>f(a.oldTradeId)),r=s.reduce((a,n)=>a+t(n),0);function m(a,n){const i=n.replace(/[^\d]/g,"");b(k=>({...k,[a]:i===""?0:parseInt(i,10)}))}function o(a){w(n=>{const i=new Set(n);return i.has(a)?i.delete(a):i.add(a),i})}function y(a){return a.map(n=>({item:n,priceCredits:Math.max(1,t(n))}))}function T(){h.invalidateQueries({queryKey:["importable"]}),h.invalidateQueries({queryKey:["listings"]}),h.invalidateQueries({queryKey:["my-assets"]}),h.invalidateQueries({queryKey:["collection-sale-state"]}),P.success("Your Shop is updated.")}return l?!d&&_.length===0?e.jsxs("div",{className:"imp-empty",children:[e.jsx("span",{className:"imp-empty__ico","aria-hidden":!0,children:"✨"}),e.jsx("h1",{className:"imp-empty__title",children:"You're all caught up"}),e.jsx("p",{className:"muted",children:"Everything you sell is already in the Shop — nothing to import."}),e.jsx(A,{className:"btn btn--purple",to:"/my-assets",children:"Go to My Assets"})]}):e.jsxs("div",{className:"imp",children:[e.jsxs("header",{className:"imp__head",children:[e.jsx("span",{className:"imp__eyebrow",children:"Import to the Shop"}),e.jsxs("h1",{className:"imp__title",children:["Bring your listings ",e.jsx("span",{className:"imp__grad",children:"into the Shop"})]}),e.jsxs("p",{className:"imp__lede",children:["These items are already for sale elsewhere. We suggested a price in ",S.name," for each — matched to today's rate and rounded up. Adjust anything, then list them."]})]}),e.jsxs("div",{className:"imp__ratebar",children:[e.jsx(v,{className:"ccy-mark imp__diamond"})," 1 ",S.nameSingular," = $0.10 · prices rounded up"]}),d?e.jsx("div",{className:"imp__list",children:Array.from({length:4}).map((a,n)=>e.jsx("div",{className:"imp-row imp-row--skeleton"},n))}):D.map(a=>{const n=(c==null?void 0:c[a.key])??[];return n.length===0?null:e.jsxs("section",{className:"imp__section",children:[e.jsxs("div",{className:"imp__section-head",children:[e.jsx("h2",{className:"imp__section-title",children:a.title}),e.jsx("span",{className:"imp__section-sub",children:a.sub})]}),e.jsx("div",{className:"imp__list",children:n.map(i=>{const k=t(i),M=k!==i.suggestedCredits;return e.jsxs("article",{className:`imp-row${f(i.oldTradeId)?"":" is-off"}`,children:[e.jsx("input",{type:"checkbox",className:"imp-check",checked:f(i.oldTradeId),onChange:()=>o(i.oldTradeId),"aria-label":`Include ${i.name}`}),e.jsx("div",{className:"imp-thumb",children:i.thumbnail?e.jsx("img",{src:i.thumbnail,alt:""}):null}),e.jsxs("div",{className:"imp-meta",children:[e.jsx("div",{className:"imp-name",title:i.name,children:i.name||"Item"}),e.jsx("span",{className:"imp-chip",children:i.rarity})]}),e.jsxs("div",{className:"imp-price",children:[e.jsxs("div",{className:"imp-price__field",children:[e.jsx(v,{className:"ccy-mark imp-price__diamond"}),e.jsx("input",{className:"imp-price__input",inputMode:"numeric",value:k.toLocaleString(),onChange:$=>m(i.oldTradeId,$.target.value),"aria-label":`Price in ${S.name} for ${i.name}`})]}),e.jsxs("div",{className:"imp-price__sub",children:[e.jsxs("span",{children:["$",(k*.1).toFixed(2)]}),M?e.jsxs("button",{className:"imp-price__reset",onClick:()=>b($=>({...$,[i.oldTradeId]:i.suggestedCredits})),children:["Reset to ",e.jsx(v,{className:"ccy-mark"}),i.suggestedCredits.toLocaleString()]}):null]})]}),e.jsx("div",{className:"imp-action",children:e.jsx("button",{className:"btn btn--sm imp-row__list",disabled:!f(i.oldTradeId),onClick:()=>N(y([i])),children:"List"})})]},i.oldTradeId)})})]},a.key)}),e.jsx("div",{className:"imp-dock",children:e.jsxs("div",{className:"imp-dock__inner",children:[e.jsxs("div",{className:"imp-dock__summary",children:[e.jsxs("div",{className:"imp-dock__total",children:[e.jsx(v,{className:"ccy-mark imp__diamond"})," ",r.toLocaleString()]}),e.jsxs("div",{className:"imp-dock__sub",children:[s.length," item",s.length===1?"":"s"," selected · $",(r*.1).toFixed(2)]})]}),e.jsx("span",{className:"imp-dock__spacer"}),e.jsxs("button",{className:"btn btn--purple imp-dock__cta",disabled:s.length===0,onClick:()=>N(y(s)),children:["List all (",s.length,")"]})]})}),u&&l?e.jsx(B,{queue:u,session:l,onClose:()=>N(null),onDone:T}):null]}):e.jsxs("div",{className:"imp-empty",children:[e.jsx("span",{className:"imp-empty__ico","aria-hidden":!0,children:"📦"}),e.jsx("h1",{className:"imp-empty__title",children:"Import your listings"}),e.jsx("p",{className:"muted",children:"Sign in to bring the items you already sell into the Shop."}),e.jsx("button",{className:"btn btn--purple",onClick:()=>I(),children:"Sign in"})]})}export{ee as ImportListings};
1
+ import{a as E,r as p,j as e,L as A}from"./react-Vu6nbGi5.js";import{j as Q,D as L,k as S,d as v,a as R,y as F,c as K,s as P}from"./index-DC3L0_Kx.js";import{i as W,R as Y,f as G}from"./import-Cu8VVfW_.js";import{s as O}from"./wallet-kind-CyXbsyHc.js";import"./ethers-JeCAM1sd.js";import"./buy-Bv5rL_T6.js";import"./index-KUQH6SSY.js";import"./mana-rate-CgBtfPJ6.js";function B({queue:l,session:I,onClose:g,onDone:h}){const x=E(),c=O(I.providerType),[d,j]=p.useState(()=>l.map(()=>"pending")),[b,C]=p.useState("running"),w=p.useRef(!1);p.useEffect(()=>{if(w.current)return;w.current=!0;let t=!1;return(async()=>{for(let s=0;s<l.length;s++){if(t)return;j(r=>r.map((m,o)=>o===s?"active":m));try{await W(l[s].item,l[s].priceCredits,I),Q("Shop Migrated Listing",{item_id:l[s].item.itemId??l[s].item.oldTradeId??null,contract_address:l[s].item.contractAddress,new_price_credits:l[s].priceCredits,new_price_usd:l[s].priceCredits/10}),t||j(r=>r.map((m,o)=>o===s?"done":m))}catch(r){if(r instanceof Y)L(r,{flow:"import_listing",step:"relist",itemId:l[s].item.itemId??l[s].item.oldTradeId}),t||j(m=>m.map((o,y)=>y===s?"unlisted":o));else{const m=r,o=m.code===4001||/reject|denied|cancel/i.test(m.message??"");o||L(r,{flow:"import_listing",itemId:l[s].item.itemId??l[s].item.oldTradeId}),t||j(y=>y.map((T,a)=>a===s?o?"skipped":"failed":T))}}}t||C("finished")})(),()=>{t=!0}},[]);const u=d.filter(t=>t==="done").length,N=d.findIndex(t=>t==="active"),_=Math.round(d.filter(t=>t!=="pending"&&t!=="active").length/l.length*100);function f(){h(),g()}if(b==="finished"){const t=d.filter(r=>r==="skipped"||r==="failed").length,s=d.filter(r=>r==="unlisted").length;return e.jsx("div",{className:"modal-backdrop",role:"presentation",children:e.jsxs("div",{className:"modal modal--success",role:"dialog","aria-modal":"true",children:[e.jsx("div",{className:"modal-success__check","aria-hidden":!0,children:"✓"}),e.jsx("h2",{className:"modal__title",children:u>0?"You're in the Shop! 🎉":"Nothing listed"}),e.jsxs("p",{className:"muted",style:{margin:0},children:[u>0?`${u} ${u===1?"item is":"items are"} now for sale with ${S.name}.`:"No items were listed.",t>0?` ${t} skipped — you can try those again anytime.`:"",s>0?` ${s} ${s===1?"item was":"items were"} taken off the old marketplace but couldn't be re-listed — re-list ${s===1?"it":"them"} from My Assets.`:""]}),e.jsxs("div",{className:"modal__actions",children:[e.jsx("button",{className:"btn btn--ghost",onClick:f,children:"Done"}),s>0?e.jsx("button",{className:"btn btn--purple",onClick:()=>{h(),g(),x("/my-assets")},children:"Go to My Assets"}):u>0?e.jsx("button",{className:"btn btn--purple",onClick:()=>{h(),g(),x("/assets")},children:"View in Shop"}):null]})]})})}return e.jsx("div",{className:"modal-backdrop",role:"presentation",children:e.jsxs("div",{className:"modal migrate",role:"dialog","aria-modal":"true","aria-live":"polite",children:[e.jsx("h2",{className:"modal__title",children:"Listing your items"}),e.jsxs("p",{className:"muted small",style:{margin:"0 0 4px"},children:[c?"We take down each old listing and re-list it for credits — confirm each step.":"Moving your items to the Shop."," ",N>=0?`${N+1} of ${l.length}`:""]}),e.jsx("div",{className:"migrate__progress",children:e.jsx("div",{className:"migrate__bar",style:{width:`${_}%`}})}),e.jsx("ul",{className:"migrate__list",children:l.map((t,s)=>e.jsxs("li",{className:`migrate__row migrate__row--${d[s]}`,children:[e.jsx("span",{className:"migrate__thumb",children:t.item.thumbnail?e.jsx("img",{src:t.item.thumbnail,alt:""}):null}),e.jsx("span",{className:"migrate__name",title:t.item.name,children:t.item.name||"Item"}),e.jsxs("span",{className:"migrate__price",children:[e.jsx(v,{className:"ccy-mark"})," ",t.priceCredits.toLocaleString()]}),e.jsx("span",{className:"migrate__status",children:d[s]==="active"?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"spinner migrate__spin","aria-hidden":!0})," ",c?"Confirm…":"Adding…"]}):d[s]==="done"?e.jsx("span",{className:"migrate__tick",children:"✓"}):d[s]==="skipped"?e.jsx("span",{className:"migrate__skip",children:"Skipped"}):d[s]==="failed"?e.jsx("span",{className:"migrate__skip",children:"Failed"}):d[s]==="unlisted"?e.jsx("span",{className:"migrate__skip",title:"Removed from the old marketplace but not re-listed — re-list it from My Assets.",children:"Not listed"}):e.jsx("span",{className:"migrate__wait",children:"Waiting"})})]},t.item.oldTradeId))}),e.jsx("p",{className:"muted small migrate__hint",children:c?"A couple of quick confirmations pop up per item (take down + re-list). Keep this open.":"This only takes a moment — keep this open."})]})})}const D=[{key:"creations",title:"Your creations",sub:"Items you made. Put them on sale in the Shop."},{key:"owned",title:"Items you own",sub:"Things you've bought elsewhere — resell them in the Shop."}];function ee(){const{session:l,signIn:I,restore:g}=R(),h=F(),x=l==null?void 0:l.address;p.useEffect(()=>{g()},[g]);const{data:c,isLoading:d}=K({queryKey:["importable",x],queryFn:()=>G(x),enabled:!!x}),[j,b]=p.useState({}),[C,w]=p.useState(new Set),[u,N]=p.useState(null),_=p.useMemo(()=>[...(c==null?void 0:c.creations)??[],...(c==null?void 0:c.owned)??[]],[c]);p.useEffect(()=>{_.length&&b(a=>{const n={...a};for(const i of _)n[i.oldTradeId]==null&&(n[i.oldTradeId]=i.suggestedCredits);return n})},[_]);const f=a=>!C.has(a),t=a=>j[a.oldTradeId]??a.suggestedCredits,s=_.filter(a=>f(a.oldTradeId)),r=s.reduce((a,n)=>a+t(n),0);function m(a,n){const i=n.replace(/[^\d]/g,"");b(k=>({...k,[a]:i===""?0:parseInt(i,10)}))}function o(a){w(n=>{const i=new Set(n);return i.has(a)?i.delete(a):i.add(a),i})}function y(a){return a.map(n=>({item:n,priceCredits:Math.max(1,t(n))}))}function T(){h.invalidateQueries({queryKey:["importable"]}),h.invalidateQueries({queryKey:["listings"]}),h.invalidateQueries({queryKey:["my-assets"]}),h.invalidateQueries({queryKey:["collection-sale-state"]}),P.success("Your Shop is updated.")}return l?!d&&_.length===0?e.jsxs("div",{className:"imp-empty",children:[e.jsx("span",{className:"imp-empty__ico","aria-hidden":!0,children:"✨"}),e.jsx("h1",{className:"imp-empty__title",children:"You're all caught up"}),e.jsx("p",{className:"muted",children:"Everything you sell is already in the Shop — nothing to import."}),e.jsx(A,{className:"btn btn--purple",to:"/my-assets",children:"Go to My Assets"})]}):e.jsxs("div",{className:"imp",children:[e.jsxs("header",{className:"imp__head",children:[e.jsx("span",{className:"imp__eyebrow",children:"Import to the Shop"}),e.jsxs("h1",{className:"imp__title",children:["Bring your listings ",e.jsx("span",{className:"imp__grad",children:"into the Shop"})]}),e.jsxs("p",{className:"imp__lede",children:["These items are already for sale elsewhere. We suggested a price in ",S.name," for each — matched to today's rate and rounded up. Adjust anything, then list them."]})]}),e.jsxs("div",{className:"imp__ratebar",children:[e.jsx(v,{className:"ccy-mark imp__diamond"})," 1 ",S.nameSingular," = $0.10 · prices rounded up"]}),d?e.jsx("div",{className:"imp__list",children:Array.from({length:4}).map((a,n)=>e.jsx("div",{className:"imp-row imp-row--skeleton"},n))}):D.map(a=>{const n=(c==null?void 0:c[a.key])??[];return n.length===0?null:e.jsxs("section",{className:"imp__section",children:[e.jsxs("div",{className:"imp__section-head",children:[e.jsx("h2",{className:"imp__section-title",children:a.title}),e.jsx("span",{className:"imp__section-sub",children:a.sub})]}),e.jsx("div",{className:"imp__list",children:n.map(i=>{const k=t(i),M=k!==i.suggestedCredits;return e.jsxs("article",{className:`imp-row${f(i.oldTradeId)?"":" is-off"}`,children:[e.jsx("input",{type:"checkbox",className:"imp-check",checked:f(i.oldTradeId),onChange:()=>o(i.oldTradeId),"aria-label":`Include ${i.name}`}),e.jsx("div",{className:"imp-thumb",children:i.thumbnail?e.jsx("img",{src:i.thumbnail,alt:""}):null}),e.jsxs("div",{className:"imp-meta",children:[e.jsx("div",{className:"imp-name",title:i.name,children:i.name||"Item"}),e.jsx("span",{className:"imp-chip",children:i.rarity})]}),e.jsxs("div",{className:"imp-price",children:[e.jsxs("div",{className:"imp-price__field",children:[e.jsx(v,{className:"ccy-mark imp-price__diamond"}),e.jsx("input",{className:"imp-price__input",inputMode:"numeric",value:k.toLocaleString(),onChange:$=>m(i.oldTradeId,$.target.value),"aria-label":`Price in ${S.name} for ${i.name}`})]}),e.jsxs("div",{className:"imp-price__sub",children:[e.jsxs("span",{children:["$",(k*.1).toFixed(2)]}),M?e.jsxs("button",{className:"imp-price__reset",onClick:()=>b($=>({...$,[i.oldTradeId]:i.suggestedCredits})),children:["Reset to ",e.jsx(v,{className:"ccy-mark"}),i.suggestedCredits.toLocaleString()]}):null]})]}),e.jsx("div",{className:"imp-action",children:e.jsx("button",{className:"btn btn--sm imp-row__list",disabled:!f(i.oldTradeId),onClick:()=>N(y([i])),children:"List"})})]},i.oldTradeId)})})]},a.key)}),e.jsx("div",{className:"imp-dock",children:e.jsxs("div",{className:"imp-dock__inner",children:[e.jsxs("div",{className:"imp-dock__summary",children:[e.jsxs("div",{className:"imp-dock__total",children:[e.jsx(v,{className:"ccy-mark imp__diamond"})," ",r.toLocaleString()]}),e.jsxs("div",{className:"imp-dock__sub",children:[s.length," item",s.length===1?"":"s"," selected · $",(r*.1).toFixed(2)]})]}),e.jsx("span",{className:"imp-dock__spacer"}),e.jsxs("button",{className:"btn btn--purple imp-dock__cta",disabled:s.length===0,onClick:()=>N(y(s)),children:["List all (",s.length,")"]})]})}),u&&l?e.jsx(B,{queue:u,session:l,onClose:()=>N(null),onDone:T}):null]}):e.jsxs("div",{className:"imp-empty",children:[e.jsx("span",{className:"imp-empty__ico","aria-hidden":!0,children:"📦"}),e.jsx("h1",{className:"imp-empty__title",children:"Import your listings"}),e.jsx("p",{className:"muted",children:"Sign in to bring the items you already sell into the Shop."}),e.jsx("button",{className:"btn btn--purple",onClick:()=>I(),children:"Sign in"})]})}export{ee as ImportListings};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CsMtLDxg.js","assets/react-Vu6nbGi5.js","assets/index-DC3L0_Kx.js","assets/ethers-JeCAM1sd.js","assets/index-MNMpVtqO.css","assets/generateUtilityClasses-BqTxi5Sw.js","assets/Button-DqWM_3MR.js","assets/SvgIcon-DVGrnwOp.js","assets/CircularProgress-BBL7xJ_3.js"])))=>i.map(i=>d[i]);
2
+ import{j as e,r as c,u as fe,d as ve,a as xe,L as je}from"./react-Vu6nbGi5.js";import{_ as Ne,a as Q,K as be,N as ye,M as ge,a1 as Ie,W as we,i as A,h as Z,a2 as Ce,o as T,d as L,s as Ae,u as K,x as ke,c as P,a3 as Se,j as O,a4 as Ee,a5 as Le,q as Pe,C as Te,a6 as Y,a7 as Fe,g as Re,v as $e,w as Be,E as qe,F as Me,G as H,D as Ve,I as Oe,z as We,H as Ge,k as Ue,f as ze,a8 as De,a9 as Ke,J as Ye}from"./index-DC3L0_Kx.js";import{h as J}from"./buy-Bv5rL_T6.js";import{g as He,a as Je,w as Qe,S as Ze,G as Xe}from"./buy-gasless-Dl9oiGu4.js";import"./ethers-JeCAM1sd.js";import"./index-KUQH6SSY.js";const es=c.lazy(()=>Ne(()=>import("./index-CsMtLDxg.js").then(t=>t.i),__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(t=>({default:t.EmoteControls})));function ss(t){return e.jsx(c.Suspense,{fallback:null,children:e.jsx(es,{...t})})}function as({item:t}){const n=Q(I=>{var b;return(b=I.session)==null?void 0:b.address}),{data:r,isLoading:p}=be(n),g=n&&r?n:"default",m=t.category==="emote",[x,l]=c.useState("avatar"),h=!m&&x==="item",[s,i]=c.useState(!0);c.useEffect(()=>{i(!0)},[t.id,h]);const o=!!n&&!!r,f=o&&ye(t,ge(r)),N=Ie(t)[0],_=o&&!f&&!m;return e.jsxs(e.Fragment,{children:[p?null:e.jsx(we,{id:"shop-item-preview",contractAddress:t.contractAddress,tokenId:t.tokenId??void 0,itemId:t.tokenId?void 0:t.itemId??void 0,profile:h?void 0:f?g:"default",bodyShape:h||f?void 0:N,type:m?void 0:h?A.PreviewType.WEARABLE:A.PreviewType.AVATAR,emote:m||h?void 0:A.PreviewEmote.FASHION,disableBackground:!0,wheelZoom:m?1.5:void 0,wheelStart:m?100:void 0,dev:Z.chainId===80002,onLoad:()=>i(!1)},t.id),p||s?e.jsx("div",{className:"item-preview__loading","aria-busy":"true","aria-label":"Loading preview",children:e.jsx("span",{className:"item-preview__spinner","aria-hidden":!0})}):null,_&&!h?e.jsxs("p",{className:"item-preview__note",children:["Shown on a ",Ce(N)," body — this item isn’t made for your avatar’s shape."]}):null,m?e.jsx("div",{className:"item-preview__emote-controls",children:e.jsx(ss,{wearablePreviewId:"shop-item-preview",hideFrameInput:!0})}):e.jsxs("div",{className:"item-preview__toggle",role:"group","aria-label":"Preview mode",children:[e.jsx("button",{type:"button",className:x==="avatar"?"is-active":"","aria-pressed":x==="avatar",onClick:()=>l("avatar"),children:"On avatar"}),e.jsx("button",{type:"button",className:x==="item"?"is-active":"","aria-pressed":x==="item",onClick:()=>l("item"),children:"Item"})]})]})}function ts(t){return t==="male"?"♂":t==="female"?"♀":t==="unisex"?"⚥":""}function is({title:t,items:n,activeId:r,onSelect:p,onViewAll:g}){const m=c.useRef(null),x=T(i=>i.add),l=T(i=>i.items.map(o=>o.id));if(n.length===0)return null;function h(i){x(i,"carousel"),Ae.success(`“${i.name}” added to your cart.`)}function s(i){const o=m.current;o&&o.scrollBy({left:i*Math.round(o.clientWidth*.8),behavior:"smooth"})}return e.jsxs("section",{className:"collection-carousel",children:[e.jsxs("div",{className:"collection-carousel__head",children:[e.jsx("h2",{className:"collection-carousel__title",children:t}),e.jsxs("div",{className:"collection-carousel__head-right",children:[g?e.jsx("button",{className:"collection-carousel__viewall",onClick:g,children:"View all"}):null,e.jsxs("div",{className:"collection-carousel__arrows",children:[e.jsx("button",{className:"collection-carousel__arrow",onClick:()=>s(-1),"aria-label":"Scroll left",children:"‹"}),e.jsx("button",{className:"collection-carousel__arrow",onClick:()=>s(1),"aria-label":"Scroll right",children:"›"})]})]})]}),e.jsx("div",{className:"collection-carousel__track",ref:m,children:n.map(i=>{const o=ts(i.gender),f=i.id===r,N=i.priceCredits>0,_=l.includes(i.id);return e.jsxs("article",{className:`collection-carousel__card${f?" is-active":""}`,children:[e.jsx("button",{className:"collection-carousel__select","aria-label":`View ${i.name}`,"aria-current":f||void 0,onClick:()=>p(i)}),e.jsxs("div",{className:"collection-carousel__media",children:[i.thumbnail?e.jsx("img",{className:"collection-carousel__img",src:i.thumbnail,alt:i.name,loading:"lazy"}):null,N?e.jsx("button",{className:"collection-carousel__add",disabled:_,"aria-label":_?"In cart":`Add ${i.name} to cart`,title:_?"In cart":"Add to cart",onClick:I=>{I.stopPropagation(),_||h(i)},children:e.jsx("span",{className:`ico ${_?"ico-cart-solid":"ico-cart"}`,"aria-hidden":!0})}):null]}),e.jsxs("div",{className:"collection-carousel__body",children:[e.jsx("div",{className:"collection-carousel__name",title:i.name,children:i.name}),e.jsxs("div",{className:"collection-carousel__meta",children:[N?e.jsxs("span",{className:"collection-carousel__price",children:[e.jsx(L,{className:"collection-carousel__diamond"}),i.priceCredits]}):e.jsx("span",{className:"collection-carousel__price collection-carousel__na",children:"Not listed"}),e.jsxs("span",{className:"collection-carousel__chips",children:[e.jsx("span",{className:"chip chip--rarity",children:i.rarity}),o?e.jsx("span",{className:"chip chip--icon",children:o}):null]})]})]})]},i.id)})})]})}function rs(t){return Object.values(A.Rarity).includes(t)}function ns(t){return t==="male"?"Male":t==="female"?"Female":t==="unisex"?"Unisex":null}function cs(t){const n=t,r=(n.message??"").toLowerCase();return n.code===4001||r.includes("reject")||r.includes("denied")||r.includes("cancel")?"You cancelled the request.":r.includes("insufficient")?`You don't have enough ${Ue.name} — get more first.`:r.includes("no active listing")||r.includes("not for sale")?"This item is not for sale right now.":"Couldn't complete checkout — please try again."}function _s(){const{contractAddress:t,tokenId:n}=fe(),{state:r}=ve(),p=xe(),g=T(a=>a.add),m=T(a=>a.items),x=K(a=>a.toggle),{session:l}=Q(),{data:h}=ke(l),[s,i]=c.useState(()=>r!=null&&r.item?{...r.item,tradeId:r.tradeId??r.item.tradeId}:{id:`${t}-${n}`,name:"",creator:"",contractAddress:t??"",itemId:null,category:"wearable",rarity:"common",network:"MATIC",chainId:Z.chainId,thumbnail:"",priceCredits:0,gender:null,tokenId:n??void 0,tradeId:r==null?void 0:r.tradeId}),[o,f]=c.useState(!1),[N,_]=c.useState(null),[I,b]=c.useState(null),{data:w=[],isFetched:X}=P({queryKey:["collection-items",s.contractAddress],enabled:!!s.contractAddress,queryFn:()=>ze(s.contractAddress,{first:20}).then(a=>a.items)}),{data:F,isLoading:ee}=P({queryKey:["shop-item",s.contractAddress,n],enabled:!(r!=null&&r.item)&&!!s.contractAddress&&!!n,queryFn:()=>De(s.contractAddress,n)});c.useEffect(()=>{F&&i(a=>a.tradeId?a:{...F})},[F]);const[W,se]=c.useState(!1),{data:R=""}=P({queryKey:["item-desc",s.contractAddress,s.itemId],enabled:!!s.contractAddress&&!!s.itemId,staleTime:5*6e4,queryFn:()=>Ke(s.contractAddress,s.itemId)});c.useEffect(()=>{if(s.name||w.length===0)return;const a=n&&w.find(d=>d.tokenId===n||d.itemId===n)||w.find(d=>d.contractAddress===s.contractAddress);a&&i(d=>({...a,tradeId:d.tradeId??a.tradeId}))},[w]);const ae=c.useMemo(()=>{const a=new Set,d=[];for(const u of w){if(u.id===s.id||s.itemId&&u.itemId===s.itemId||s.tokenId&&u.tokenId===s.tokenId)continue;const E=`${u.contractAddress}-${u.itemId??u.tokenId??u.id}`;a.has(E)||(a.add(E),d.push(u))}return d},[w,s.id,s.itemId,s.tokenId]),{data:te,isLoading:k}=P({queryKey:["detail-trade",s.id,s.tradeId,s.contractAddress,s.itemId],enabled:!!s.contractAddress,queryFn:async()=>{if(s.tradeId)return s.tradeId;if(s.itemId){const a=await Ye(s.contractAddress,s.itemId);return(a==null?void 0:a.id)??null}return null}}),y=s.tradeId??te??void 0,j=!!y,ie=Se({priceCredits:s.priceCredits,compareAtCredits:s.compareAtCredits,saleEndsAt:s.saleEndsAt}),S=c.useMemo(()=>({...s,tradeId:y,id:y??s.id}),[s,y]),$=m.some(a=>a.id===S.id),B=K(a=>!!a.items[s.id]);c.useEffect(()=>{_(null),b(null)},[s.id]);const G=c.useRef(null);c.useEffect(()=>{!s.name||k||G.current===s.id||(G.current=s.id,O("Shop Viewed Item",{...Ee(s),for_sale:j}),Le(s))},[s.id,s.name,k,j]);function re(a){i(a);const d=a.tokenId??a.itemId;a.contractAddress&&d&&p(`/item/${a.contractAddress}/${d}`,{replace:!0,state:{item:a}}),typeof window<"u"&&window.scrollTo({top:0,behavior:"smooth"})}function ne(){!j||$||z||g(S,"item_detail")}async function ce(){var E;if(!j||!y)return;if(!l){b("Sign in to check out.");return}b(null),f(!0);let a,d="authorize",u=!1;try{_(`Buying ${s.name||"item"}…`);const v=await Re(y);if(!v)throw new Error("not for sale");if($e(v,l.address)){b("You can't buy your own listing."),_(null),f(!1);return}const q=(E=v.received)==null?void 0:E[0],_e=Be(q==null?void 0:q.amount),{credit:D,maxCreditedValue:pe}=await qe(l.identity,_e,y);a=D.id,d="submit";const M={trade:v,buyer:l.address,signer:l.signer,credits:[D],maxCreditedValue:pe};let C;if(He())try{C=await Je(M),await Qe(C),u=!0}catch(V){if(V instanceof Ze)u=!0;else if(V instanceof Xe)C=await J(M);else throw V}else C=await J(M);a=void 0,O("Shop Completed Purchase",{...Me([S]),payment_type:"credits",no_crypto_step:u,transaction_hash:C??null}),p("/success",{state:{items:[S],txHash:C}})}catch(v){H(v)||Ve(v,{flow:"buy",step:d,gasless:u}),a&&Oe(l.identity,[a]).catch(()=>{}),O(H(v)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:d,error_code:Ge(v),value_usd:We(S.priceCredits)}),b(cs(v)),_(null)}finally{f(!1)}}const le=rs(s.rarity)?s.rarity:A.Rarity.COMMON,[de]=A.Rarity.getGradient(le),U=ns(s.gender),oe=j&&ie,ue="More from this collection",z=Pe(s,l==null?void 0:l.address),me=j?$?"In cart":k?"Checking…":"Add to cart":"Not for sale",he=ee||!!s.contractAddress&&!X;return!s.name&&!he?e.jsxs("div",{className:"item-detail item-detail--notfound",children:[e.jsx("span",{className:"ico ico-cart item-detail__notfound-ico","aria-hidden":!0}),e.jsx("h1",{className:"item-detail__notfound-title",children:"This item isn’t available"}),e.jsx("p",{className:"muted",children:"It may have been delisted or moved. Browse Collectibles for something else."}),e.jsx("button",{className:"btn btn--purple",onClick:()=>p("/assets"),children:"Browse Collectibles"})]}):e.jsxs("div",{className:"item-detail",children:[e.jsxs("nav",{className:"item-detail__crumbs","aria-label":"Breadcrumb",children:[e.jsx("button",{className:"item-detail__crumb-link",onClick:()=>p("/assets"),children:"Collectibles"}),e.jsx("span",{className:"item-detail__crumb-sep",children:"/"}),e.jsx("span",{className:"item-detail__crumb-current",children:s.name||"Item"})]}),e.jsxs("div",{className:"item-detail__main",children:[e.jsx("div",{className:"item-detail__preview",style:{background:`radial-gradient(circle at 50% 38%, ${de}33 0%, var(--media) 68%)`},children:s.name?e.jsx(as,{item:s}):e.jsx("div",{className:"item-preview__loading","aria-busy":"true","aria-label":"Loading preview",children:e.jsx("span",{className:"item-preview__spinner","aria-hidden":!0})})}),e.jsxs("div",{className:"item-detail__info",children:[e.jsxs("div",{className:"item-detail__info-head",children:[e.jsx("h1",{className:"item-detail__title",children:s.name||"Loading…"}),e.jsx("button",{className:`item-detail__fav${B?" is-on":""}`,onClick:()=>x(s),"aria-pressed":B,"aria-label":B?"Remove from favorites":"Add to favorites",children:e.jsx("span",{className:"ico ico-heart","aria-hidden":!0})})]}),s.creator?e.jsx(Te,{address:s.creator,className:"item-detail__creator",linkToProfile:!0}):null,e.jsxs("div",{className:"item-detail__chips",children:[e.jsx("span",{className:"chip chip--rarity",children:s.rarity}),e.jsx("span",{className:"chip",children:s.category==="emote"?"Emote":"Wearable"}),U?e.jsx("span",{className:"chip",children:U}):null]}),R?e.jsxs("div",{className:"item-detail__description",children:[e.jsx("p",{className:`item-detail__desc-text${W?" is-expanded":""}`,children:R}),R.length>140?e.jsx("button",{className:"link item-detail__desc-toggle",onClick:()=>se(a=>!a),children:W?"Show less":"Read more"}):null]}):null,e.jsxs("div",{className:"item-detail__card",children:[e.jsxs("div",{className:"item-detail__price-block",children:[e.jsx("div",{className:"item-detail__price-label",children:"Price"}),j?oe?e.jsxs("div",{className:"item-detail__price item-detail__price--sale",children:[e.jsxs("span",{className:"item-detail__price",children:[e.jsx(L,{className:"item-detail__diamond"}),e.jsx("span",{className:"item-detail__price-value",children:s.priceCredits})]}),e.jsxs("span",{className:"item-detail__price-was",children:[e.jsx(L,{className:"item-detail__diamond item-detail__diamond--was"}),s.compareAtCredits]}),Y(s.compareAtCredits,s.priceCredits)>0?e.jsxs("span",{className:"item-detail__sale-badge",children:["SALE -",Y(s.compareAtCredits,s.priceCredits),"%"]}):null,e.jsx(Fe,{endsAt:s.saleEndsAt,className:"item-detail__countdown"})]}):e.jsxs("div",{className:"item-detail__price",children:[e.jsx(L,{className:"item-detail__diamond"}),e.jsx("span",{className:"item-detail__price-value",children:s.priceCredits})]}):e.jsx("div",{className:"item-detail__price item-detail__price--none",children:"Not for sale"}),l?e.jsxs("div",{className:"item-detail__balance muted",children:["Your balance: ",e.jsx(L,{className:"ccy-mark"})," ",(h==null?void 0:h.credits)??0]}):null]}),e.jsx("div",{className:"item-detail__ctas",children:z?e.jsxs("p",{className:"item-detail__own-note muted",children:["This is your item — manage it in ",e.jsx(je,{to:"/my-assets",children:"My Assets"}),"."]}):e.jsxs(e.Fragment,{children:[j?e.jsx("button",{className:"btn btn--purple item-detail__cta",onClick:ce,disabled:o||k,children:o?"Buying…":"Buy now"}):null,e.jsxs("button",{className:"item-detail__addcart",onClick:ne,disabled:!j||$||k||o,children:[e.jsx("span",{className:"ico ico-cart-solid item-detail__addcart-ico","aria-hidden":!0}),me]})]})}),N?e.jsx("p",{className:"muted item-detail__status",children:N}):null,I?e.jsx("p",{className:"error item-detail__status",children:I}):null]})]})]}),e.jsx(is,{title:ue,items:ae,activeId:s.id,onSelect:re,onViewAll:s.contractAddress?()=>p(`/collection/${s.contractAddress}`):void 0})]})}export{_s as ItemDetail,_s as default};
@@ -1 +1 @@
1
- .item-detail{max-width:1721px;margin:0 auto}.item-detail__crumbs{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--muted);margin-bottom:22px}.item-detail__crumb-link{background:none;border:0;padding:0;font:inherit;color:var(--muted)}.item-detail__crumb-link:hover{color:var(--text)}.item-detail__crumb-sep{color:var(--muted-2)}.item-detail__crumb-current{color:var(--text);font-weight:600}.item-detail__main{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(320px,522px);gap:40px;align-items:start}@media(max-width:900px){.item-detail__main{grid-template-columns:1fr}}.item-detail__preview{position:relative;height:min(752px,70vh);border-radius:var(--radius-card);overflow:hidden;background:var(--media)}.item-detail__preview iframe,.item-detail__preview>*{width:100%;height:100%;border:0;display:block}.item-detail__preview>.item-preview__toggle{position:absolute;top:14px;left:50%;transform:translate(-50%);z-index:2;width:auto;height:auto;display:inline-flex;gap:2px;padding:3px;background:#ffffffeb;border:1px solid var(--line);border-radius:999px;box-shadow:0 1px 4px #0000001f}.item-preview__toggle button{border:0;background:none;cursor:pointer;padding:6px 16px;border-radius:999px;font-weight:600;font-size:13px;color:var(--muted);transition:background .12s ease,color .12s ease}.item-preview__toggle button.is-active{background:var(--text);color:#fff}.item-preview__toggle button:not(.is-active):hover{color:var(--text)}.item-detail__preview>.item-preview__emote-controls{position:absolute;bottom:14px;left:50%;transform:translate(-50%);z-index:2;width:auto;height:auto;max-width:92%;display:flex;align-items:center;background:#ffffffeb;border:1px solid var(--line);border-radius:12px;padding:6px 10px;box-shadow:0 1px 4px #0000001f}.item-detail__preview>.item-preview__note{position:absolute;bottom:14px;left:50%;transform:translate(-50%);z-index:2;width:auto;height:auto;max-width:88%;margin:0;text-align:center;background:#161518c7;color:#fff;font-size:12px;font-weight:500;padding:6px 12px;border-radius:999px}.item-detail__preview>.item-preview__loading{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;display:flex;align-items:center;justify-content:center;width:100%;height:100%;background:transparent}.item-preview__spinner{width:34px;height:34px;border-radius:50%;border:3px solid var(--line);border-top-color:var(--accent);animation:item-preview-spin .8s linear infinite}@keyframes item-preview-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.item-preview__spinner{animation-duration:2.4s}}.item-detail__description{display:flex;flex-direction:column;align-items:flex-start;gap:4px}.item-detail__desc-text{margin:0;color:var(--text-2);font-size:14px;line-height:1.55;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden}.item-detail__desc-text.is-expanded{-webkit-line-clamp:unset;overflow:visible}.item-detail__desc-toggle{font-size:13px;align-self:flex-start}.item-detail__info{display:flex;flex-direction:column;gap:14px}.item-detail__info-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.item-detail__title{font-size:clamp(24px,2.4vw,34px);font-weight:700;line-height:1.15;color:var(--text)}.item-detail__fav{flex:none;width:38px;height:38px;border-radius:50%;border:1px solid var(--line);background:#fff;display:grid;place-items:center;color:var(--text)}.item-detail__fav{cursor:pointer;transition:color .12s ease,border-color .12s ease}.item-detail__fav.is-on{color:var(--dcl-red);border-color:var(--dcl-red)}.item-detail__fav .ico-heart{width:18px;height:18px}.item-detail__creator{color:var(--muted);font-size:14px;margin-top:-6px}.item-detail__chips{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.item-detail__card{margin-top:8px;border:1px solid var(--line);border-radius:var(--radius-card);padding:20px;display:flex;flex-direction:column;gap:16px;background:#fff}.item-detail__price-block{display:flex;flex-direction:column;gap:6px}.item-detail__price-label{font-size:13px;font-weight:600;text-transform:uppercase;letter-spacing:.03em;color:var(--muted)}.item-detail__price{display:flex;align-items:center;gap:10px;font-weight:700;color:var(--text-2)}.item-detail__diamond{width:28px;height:28px;color:var(--text-2)}.item-detail__price-value{font-size:34px;line-height:1}.item-detail__price--none{font-size:18px;color:var(--muted)}.item-detail__price--sale{flex-wrap:wrap;gap:10px 14px}.item-detail__price--sale .item-detail__price,.item-detail__price--sale .item-detail__price-value,.item-detail__price--sale .item-detail__diamond{color:var(--dcl-red)}.item-detail__price-was{display:inline-flex;align-items:center;gap:6px;color:var(--muted);text-decoration:line-through;font-weight:600;font-size:20px}.item-detail__diamond--was{width:18px;height:18px;color:var(--muted)}.item-detail__sale-badge{display:inline-flex;align-items:center;background:var(--dcl-red);color:#fff;font-weight:800;font-size:13px;letter-spacing:.03em;text-transform:uppercase;border-radius:6px;padding:4px 10px}.item-detail__countdown{display:inline-flex;align-items:center;gap:5px;background:var(--rarity-bg);color:var(--accent);font-size:13px;font-weight:700;border-radius:6px;padding:4px 10px;white-space:nowrap}.item-detail__countdown .sale-countdown__ico{width:14px;height:14px}.item-detail__balance{font-size:13px}.item-detail__ctas{display:flex;flex-direction:column;gap:12px}.item-detail__cta{width:100%;height:44px;text-align:center}.item-detail__addcart{width:100%;height:44px;display:flex;align-items:center;justify-content:center;gap:8px;background:var(--black-btn);color:var(--soft-white);border:0;border-radius:var(--radius-btn);font-weight:600;font-size:13px;text-transform:uppercase;letter-spacing:.046em}.item-detail__addcart:disabled{opacity:.55;cursor:default}.item-detail__addcart-ico{width:20px;height:20px}.item-detail__status{margin:0;font-size:13px}.item-detail__own-note{margin:0;font-size:14px}.item-detail__own-note a{color:var(--accent);font-weight:600}.collection-carousel{margin-top:56px}.collection-carousel__head{display:flex;align-items:center;justify-content:space-between;margin-bottom:20px}.collection-carousel__title{font-size:20px;font-weight:600;color:var(--text)}.collection-carousel__head-right{display:flex;align-items:center;gap:16px}.collection-carousel__viewall{background:none;border:0;padding:0;color:var(--accent);font-weight:600;font-size:13px;cursor:pointer;white-space:nowrap}.collection-carousel__viewall:hover{text-decoration:underline}.collection-carousel__arrows{display:flex;gap:10px}.collection-carousel__arrow{width:44px;height:44px;border-radius:50%;border:0;background:#fff;color:var(--text);font-size:22px;line-height:1;display:grid;place-items:center;box-shadow:0 6px 16px #16151829;transition:transform .12s ease,box-shadow .12s ease}.collection-carousel__arrow:hover{transform:scale(1.06);box-shadow:0 8px 20px #16151833}@media(prefers-reduced-motion:reduce){.collection-carousel__arrow{transition:none}}.collection-carousel__track{display:flex;gap:16px;overflow-x:auto;padding:12px 10px;margin:0 -10px;scroll-snap-type:x proximity}.collection-carousel__card{flex:0 0 220px;scroll-snap-align:start;text-align:left;background:#fff;border:1px solid var(--line);border-radius:var(--radius-card);overflow:hidden;padding:0;display:flex;flex-direction:column;transition:box-shadow .15s ease,transform .15s ease}.collection-carousel__card:hover{transform:translateY(-2px);box-shadow:0 0 0 2px var(--brand-violet),0 10px 30px #a524b347}.collection-carousel__card.is-active{box-shadow:0 0 0 2px var(--accent)}.collection-carousel__media{position:relative;aspect-ratio:1 / 1;background:var(--media)}.collection-carousel__img{width:100%;height:100%;object-fit:contain;display:block}.collection-carousel__body{padding:10px 12px 12px;display:flex;flex-direction:column;gap:8px}.collection-carousel__name{font-weight:600;font-size:14px;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.collection-carousel__meta{display:flex;align-items:center;justify-content:space-between;gap:8px}.collection-carousel__price{display:flex;align-items:center;gap:5px;font-weight:600;font-size:15px;color:var(--text-2)}.collection-carousel__diamond{width:14px;height:14px;color:var(--text-2)}.collection-carousel__chips{display:flex;align-items:center;gap:6px}.collection-carousel__na{color:var(--muted);font-weight:600;font-size:13px}.collection-carousel__card{cursor:pointer}.collection-carousel__card:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.collection-carousel__add{position:absolute;bottom:10px;right:10px;z-index:2;width:34px;height:34px;border-radius:50%;border:0;background:var(--accent);color:#fff;display:grid;place-items:center;box-shadow:0 4px 12px #691fa959;transition:transform .12s ease,background .15s ease}.collection-carousel__add:hover{transform:scale(1.08)}.collection-carousel__add:disabled{background:var(--muted-2);cursor:default;box-shadow:none}.collection-carousel__add .ico{width:18px;height:18px}.item-detail--notfound{min-height:46vh;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:14px}.item-detail__notfound-ico{width:44px;height:44px;opacity:.4}.item-detail__notfound-title{font-size:22px}.item-detail--notfound .btn{margin-top:6px}
1
+ .item-detail{max-width:1721px;margin:0 auto}.item-detail__crumbs{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--muted);margin-bottom:22px}.item-detail__crumb-link{background:none;border:0;padding:0;font:inherit;color:var(--muted)}.item-detail__crumb-link:hover{color:var(--text)}.item-detail__crumb-sep{color:var(--muted-2)}.item-detail__crumb-current{color:var(--text);font-weight:600}.item-detail__main{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(320px,522px);gap:40px;align-items:start}@media(max-width:900px){.item-detail__main{grid-template-columns:1fr}}.item-detail__preview{position:relative;height:min(752px,70vh);border-radius:var(--radius-card);overflow:hidden;background:var(--media)}.item-detail__preview iframe,.item-detail__preview>*{width:100%;height:100%;border:0;display:block}.item-detail__preview>.item-preview__toggle{position:absolute;top:14px;left:50%;transform:translate(-50%);z-index:2;width:auto;height:auto;display:inline-flex;gap:2px;padding:3px;background:#ffffffeb;border:1px solid var(--line);border-radius:999px;box-shadow:0 1px 4px #0000001f}.item-preview__toggle button{border:0;background:none;cursor:pointer;padding:6px 16px;border-radius:999px;font-weight:600;font-size:13px;color:var(--muted);transition:background .12s ease,color .12s ease}.item-preview__toggle button.is-active{background:var(--text);color:#fff}.item-preview__toggle button:not(.is-active):hover{color:var(--text)}.item-detail__preview>.item-preview__emote-controls{position:absolute;bottom:14px;left:50%;transform:translate(-50%);z-index:2;width:auto;height:auto;max-width:92%;display:flex;align-items:center;background:#ffffffeb;border:1px solid var(--line);border-radius:12px;padding:6px 10px;box-shadow:0 1px 4px #0000001f}.item-detail__preview>.item-preview__note{position:absolute;bottom:14px;left:50%;transform:translate(-50%);z-index:2;width:auto;height:auto;max-width:88%;margin:0;text-align:center;background:#161518c7;color:#fff;font-size:12px;font-weight:500;padding:6px 12px;border-radius:999px}.item-detail__preview>.item-preview__loading{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;display:flex;align-items:center;justify-content:center;width:100%;height:100%;background:transparent}.item-preview__spinner{width:34px;height:34px;border-radius:50%;border:3px solid var(--line);border-top-color:var(--accent);animation:item-preview-spin .8s linear infinite}@keyframes item-preview-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.item-preview__spinner{animation-duration:2.4s}}.item-detail__description{display:flex;flex-direction:column;align-items:flex-start;gap:4px}.item-detail__desc-text{margin:0;color:var(--text-2);font-size:14px;line-height:1.55;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden}.item-detail__desc-text.is-expanded{-webkit-line-clamp:unset;overflow:visible}.item-detail__desc-toggle{font-size:13px;align-self:flex-start}.item-detail__info{display:flex;flex-direction:column;gap:14px}.item-detail__info-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.item-detail__title{font-size:clamp(24px,2.4vw,34px);font-weight:700;line-height:1.15;color:var(--text)}.item-detail__fav{flex:none;width:38px;height:38px;border-radius:50%;border:1px solid var(--line);background:#fff;display:grid;place-items:center;color:var(--text)}.item-detail__fav{cursor:pointer;transition:color .12s ease,border-color .12s ease}.item-detail__fav.is-on{color:var(--dcl-red);border-color:var(--dcl-red)}.item-detail__fav .ico-heart{width:18px;height:18px}.item-detail__creator{color:var(--muted);font-size:14px;margin-top:-6px}.item-detail__chips{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.item-detail__card{margin-top:8px;border:1px solid var(--line);border-radius:var(--radius-card);padding:20px;display:flex;flex-direction:column;gap:16px;background:#fff}.item-detail__price-block{display:flex;flex-direction:column;gap:6px}.item-detail__price-label{font-size:13px;font-weight:600;text-transform:uppercase;letter-spacing:.03em;color:var(--muted)}.item-detail__price{display:flex;align-items:center;gap:10px;font-weight:700;color:var(--text-2)}.item-detail__diamond{width:28px;height:28px;color:var(--text-2)}.item-detail__price-value{font-size:34px;line-height:1}.item-detail__price--none{font-size:18px;color:var(--muted)}.item-detail__price--sale{flex-wrap:wrap;gap:10px 14px}.item-detail__price--sale .item-detail__price,.item-detail__price--sale .item-detail__price-value,.item-detail__price--sale .item-detail__diamond{color:var(--dcl-red)}.item-detail__price-was{display:inline-flex;align-items:center;gap:6px;color:var(--muted);text-decoration:line-through;font-weight:600;font-size:20px}.item-detail__diamond--was{width:18px;height:18px;color:var(--muted)}.item-detail__sale-badge{display:inline-flex;align-items:center;background:var(--dcl-red);color:#fff;font-weight:800;font-size:13px;letter-spacing:.03em;text-transform:uppercase;border-radius:6px;padding:4px 10px}.item-detail__countdown{display:inline-flex;align-items:center;gap:5px;background:var(--rarity-bg);color:var(--accent);font-size:13px;font-weight:700;border-radius:6px;padding:4px 10px;white-space:nowrap}.item-detail__countdown .sale-countdown__ico{width:14px;height:14px}.item-detail__balance{font-size:13px}.item-detail__ctas{display:flex;flex-direction:column;gap:12px}.item-detail__cta{width:100%;height:44px;text-align:center}.item-detail__addcart{width:100%;height:44px;display:flex;align-items:center;justify-content:center;gap:8px;background:var(--black-btn);color:var(--soft-white);border:0;border-radius:var(--radius-btn);font-weight:600;font-size:13px;text-transform:uppercase;letter-spacing:.046em}.item-detail__addcart:disabled{opacity:.55;cursor:default}.item-detail__addcart-ico{width:20px;height:20px}.item-detail__status{margin:0;font-size:13px}.item-detail__own-note{margin:0;font-size:14px}.item-detail__own-note a{color:var(--accent);font-weight:600}.collection-carousel{margin-top:56px}.collection-carousel__head{display:flex;align-items:center;justify-content:space-between;margin-bottom:20px}.collection-carousel__title{font-size:20px;font-weight:600;color:var(--text)}.collection-carousel__head-right{display:flex;align-items:center;gap:16px}.collection-carousel__viewall{background:none;border:0;padding:0;color:var(--accent);font-weight:600;font-size:13px;cursor:pointer;white-space:nowrap}.collection-carousel__viewall:hover{text-decoration:underline}.collection-carousel__arrows{display:flex;gap:10px}.collection-carousel__arrow{width:44px;height:44px;border-radius:50%;border:0;background:#fff;color:var(--text);font-size:22px;line-height:1;display:grid;place-items:center;box-shadow:0 6px 16px #16151829;transition:transform .12s ease,box-shadow .12s ease}.collection-carousel__arrow:hover{transform:scale(1.06);box-shadow:0 8px 20px #16151833}@media(prefers-reduced-motion:reduce){.collection-carousel__arrow{transition:none}}.collection-carousel__track{display:flex;gap:16px;overflow-x:auto;padding:12px 10px;margin:0 -10px;scroll-snap-type:x proximity}.collection-carousel__card{position:relative;flex:0 0 220px;scroll-snap-align:start;text-align:left;background:#fff;border:1px solid var(--line);border-radius:var(--radius-card);overflow:hidden;padding:0;display:flex;flex-direction:column;transition:box-shadow .15s ease,transform .15s ease}.collection-carousel__card:hover{transform:translateY(-2px);box-shadow:0 0 0 2px var(--brand-violet),0 10px 30px #a524b347}.collection-carousel__card.is-active{box-shadow:0 0 0 2px var(--accent)}.collection-carousel__media{position:relative;aspect-ratio:1 / 1;background:var(--media)}.collection-carousel__img{width:100%;height:100%;object-fit:contain;display:block}.collection-carousel__body{padding:10px 12px 12px;display:flex;flex-direction:column;gap:8px}.collection-carousel__name{font-weight:600;font-size:14px;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.collection-carousel__meta{display:flex;align-items:center;justify-content:space-between;gap:8px}.collection-carousel__price{display:flex;align-items:center;gap:5px;font-weight:600;font-size:15px;color:var(--text-2)}.collection-carousel__diamond{width:14px;height:14px;color:var(--text-2)}.collection-carousel__chips{display:flex;align-items:center;gap:6px}.collection-carousel__na{color:var(--muted);font-weight:600;font-size:13px}.collection-carousel__card{cursor:pointer}.collection-carousel__select{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;background:transparent;border:0;padding:0;cursor:pointer}.collection-carousel__select:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.collection-carousel__add{position:absolute;bottom:10px;right:10px;z-index:2;width:34px;height:34px;border-radius:50%;border:0;background:var(--accent);color:#fff;display:grid;place-items:center;box-shadow:0 4px 12px #691fa959;transition:transform .12s ease,background .15s ease}.collection-carousel__add:hover{transform:scale(1.08)}.collection-carousel__add:disabled{background:var(--muted-2);cursor:default;box-shadow:none}.collection-carousel__add .ico{width:18px;height:18px}.item-detail--notfound{min-height:46vh;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:14px}.item-detail__notfound-ico{width:44px;height:44px;opacity:.4}.item-detail__notfound-title{font-size:22px}.item-detail--notfound .btn{margin-top:6px}
@@ -1 +1 @@
1
- import{a as ee,r as u,j as e,b as ae}from"./react-Vu6nbGi5.js";import{c as te,h as G,a as re,x as se,y as z,g as ne,v as ie,E as oe,I,j as M,H as W,G as $,d as T,Q as H,k as U,A as ce,R as de}from"./index-BiC8AOx_.js";import{r as le,a as q,m as ue}from"./mana-rate-G2IgQgyW.js";import{S as Q,F as me,a as he}from"./FilterBar-CdU8B66A.js";import{S as Y}from"./SkeletonCards-BysJEVmg.js";import{L as ye}from"./LoadMore-BOCtgPLI.js";import{h as K}from"./buy-njp9xZO9.js";import{g as pe,a as fe,w as ke,S as be,G as _e}from"./buy-gasless-3T0lk5aN.js";import{u as ge}from"./useInfiniteGrid-CnC_JbP2.js";import"./ethers-JeCAM1sd.js";import"./index-rktQ2LR5.js";function xe(){return te({queryKey:["mana-rate",G.chainId],queryFn:()=>le(G.chainId),staleTime:6e4,refetchInterval:6e4,retry:1})}function O(a){const m=a,d=(m.message??"").toLowerCase();return m.code===4001||d.includes("reject")||d.includes("denied")||d.includes("cancel")?"You cancelled the request.":d.includes("insufficient")?`Not enough ${U.name} — get more first.`:d.includes("not found")||d.includes("no active listing")||d.includes("404")?"This item was just sold or removed. Refreshing the market…":d.includes("your own listing")?"You can't buy your own listing.":"Couldn't complete checkout — please try again."}function Ce(a){return{id:a.tradeId,tradeId:a.tradeId,name:a.name,creator:a.creator,contractAddress:a.contractAddress,itemId:a.itemId,category:a.category,wearableCategory:a.wearableCategory??void 0,rarity:a.rarity,network:a.network,chainId:a.chainId,thumbnail:a.thumbnail,priceCredits:0,gender:null}}function ve({listing:a,rate:m,onClose:d,onSold:p}){const{session:n}=re(),{data:o}=se(n),f=z(),k=ee(),[v,b]=u.useState("confirm"),[j,w]=u.useState("Locking today’s price…"),[x,C]=u.useState(null),[s,E]=u.useState(null),l=u.useRef(null),F=Math.ceil(q(a.manaWei,m)/10);u.useEffect(()=>{let h=!1;if(!n){b("error"),C("Sign in to check out.");return}return(async()=>{try{const r=await ne(a.tradeId);if(!r)throw new Error("not found");if(ie(r,n.address))throw new Error("You can't buy your own listing.");const c=q(a.manaWei,m);if(!Number.isFinite(c)||c<=0)throw new Error("price unavailable");const{credit:y,maxCreditedValue:R,usdCents:A}=await oe(n.identity,c,a.tradeId);if(h){I(n.identity,[y.id]).catch(()=>{});return}l.current=y.id,E({trade:r,credit:y,maxCreditedValue:R,usdCents:A,credits:Math.ceil(A/10)}),w("")}catch(r){if(h)return;console.error("[market] authorize failed",r),M($(r)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"authorize",error_code:W(r),value_usd:Math.round(q(a.manaWei,m))/100}),b("error"),C(O(r))}})(),()=>{h=!0,l.current&&n&&(I(n.identity,[l.current]).catch(()=>{}),l.current=null)}},[]);const _=!!s&&((o==null?void 0:o.credits)??0)<s.credits;async function L(){if(!n||!s)return;if(_){I(n.identity,[s.credit.id]).catch(()=>{}),l.current=null,k("/credits");return}b("working"),C(null);let h=!1;try{w("Confirming your purchase…");const r={trade:s.trade,buyer:n.address,signer:n.signer,credits:[s.credit],maxCreditedValue:s.maxCreditedValue};let c;if(pe())try{c=await fe(r),await ke(c),h=!0}catch(y){if(y instanceof be)h=!0;else if(y instanceof _e)c=await K(r);else throw y}else c=await K(r);l.current=null,M("Shop Completed Purchase",{items:[{item_id:a.itemId??null,contract_address:a.contractAddress,token_id:null,price_usd:s.usdCents/100}],value_credits:s.credits,value_usd:s.usdCents/100,purchase_type:"item",is_primary:!0,payment_type:"credits",no_crypto_step:h,transaction_hash:c??null}),f.invalidateQueries({queryKey:["usd-balance"]}),k("/success",{state:{items:[Ce(a)],txHash:c}})}catch(r){console.error("[market] buy now failed",r),I(n.identity,[s.credit.id]).catch(()=>{}),l.current=null,M($(r)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:W(r),value_usd:s.usdCents/100}),f.invalidateQueries({queryKey:["usd-balance"]});const c=O(r);C(c),b("error"),/sold or removed/i.test(c)&&p()}}function P(){n&&s&&I(n.identity,[s.credit.id]).catch(()=>{}),l.current=null,d()}const g=v==="working";return e.jsxs("div",{className:"mkt-modal",role:"dialog","aria-modal":"true","aria-label":`Buy ${a.name}`,children:[e.jsx("div",{className:"mkt-modal__scrim",onClick:g?void 0:P,"aria-hidden":!0}),e.jsxs("div",{className:"mkt-modal__card",children:[e.jsxs("div",{className:"mkt-modal__head",children:[e.jsx("div",{className:"mkt-modal__thumb",children:a.thumbnail?e.jsx("img",{src:a.thumbnail,alt:""}):null}),e.jsxs("div",{children:[e.jsx("div",{className:"mkt-modal__name",title:a.name,children:a.name||"Item"}),e.jsx("span",{className:"chip chip--rarity",children:a.rarity})]})]}),e.jsx("div",{className:"mkt-modal__price",children:s?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mkt-modal__price-label",children:"Final price"}),e.jsxs("div",{className:"mkt-modal__price-value",children:[e.jsx(T,{className:"mkt-modal__diamond"}),H(s.credits)]}),e.jsxs("div",{className:"mkt-modal__price-sub muted",children:["Locked for this purchase · $",(s.usdCents/100).toFixed(2)]})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mkt-modal__price-label",children:"Today’s price"}),e.jsxs("div",{className:"mkt-modal__price-value mkt-modal__price-value--approx",children:[e.jsx("span",{className:"mkt-modal__approx","aria-hidden":!0,children:"≈"}),e.jsx(T,{className:"mkt-modal__diamond"}),H(F)]}),e.jsx("div",{className:"mkt-modal__price-sub muted",children:j||"Locking today’s price…"})]})}),n?e.jsxs("div",{className:"mkt-modal__balance muted",children:["Your balance: ",e.jsx(T,{className:"ccy-mark"})," ",(o==null?void 0:o.credits)??0]}):null,_?e.jsxs("p",{className:"muted mkt-modal__note",children:["You’ll need a few more ",U.name," to buy this."]}):null,j&&v==="working"?e.jsx("p",{className:"muted mkt-modal__note",children:j}):null,x?e.jsx("p",{className:"error mkt-modal__note",children:x}):null,e.jsxs("div",{className:"mkt-modal__actions",children:[e.jsx("button",{className:"btn btn--ghost",onClick:P,disabled:g,children:"Cancel"}),e.jsx("button",{className:"btn btn--purple",onClick:L,disabled:g||!s,children:g?"Buying…":_?`Get ${U.name}`:"Confirm purchase"})]})]})]})}const je=48,B=[{key:"wearable",label:"Wearables",sub:["Head","Upper Body","Handwear","Lower Body","Feet","Accessories","Skins"]},{key:"emote",label:"Emotes",sub:[]}],we={Head:["head","hat","hair","facial_hair","eyes","eyebrows","mouth","mask","helmet","tiara","top_head"],"Upper Body":["upper_body"],Handwear:["hands_wear"],"Lower Body":["lower_body"],Feet:["feet"],Accessories:["earring","eyewear"],Skins:["skin"]};function Ne(a){return{id:a.tradeId,tradeId:a.tradeId,name:a.name,creator:a.creator,contractAddress:a.contractAddress,itemId:a.itemId,category:a.category,wearableCategory:a.wearableCategory??void 0,rarity:a.rarity,network:a.network,chainId:a.chainId,thumbnail:a.thumbnail,priceCredits:0,gender:null}}function Be(){const[a]=ae(),m=(a.get("q")??"").trim().toLowerCase(),d=z(),[p,n]=u.useState("wearable"),[o,f]=u.useState(null),[k,v]=u.useState([]),[b,j]=u.useState("newest"),[w,x]=u.useState(null),C=o?we[o]:void 0,s=(Q.find(t=>t.key===b)??Q[0]).server,E={category:p,rarities:k.length?k:void 0,wearableCategories:C,search:m||void 0,sortBy:s},{items:l,total:F,isLoading:_,error:L,hasNextPage:P,isFetchingNextPage:g,fetchNextPage:h}=ge(["legacy-listings",E],t=>de({...E,first:je,skip:t})),{data:r,isError:c}=xe(),y=t=>r?ue(t.manaWei,r):null;function R(t){n(t),f(null)}function A(t){v(i=>i.includes(t)?i.filter(S=>S!==t):[...i,t])}function V(){n("wearable"),f(null),v([])}function Z(t){const i=l.find(S=>S.tradeId===t.tradeId);i&&x(i)}function D(){d.invalidateQueries({queryKey:["legacy-listings"]})}const N=B.find(t=>t.key===p)??B[0],J=o?`${N.label} · ${o}`:N.label,X=p!=="wearable"||!!o||k.length>0;return e.jsxs("div",{className:"browse",children:[e.jsxs("div",{className:"market-banner",children:[e.jsx("span",{className:"market-banner__ico","aria-hidden":!0,children:"✨"}),e.jsx("span",{children:"Prices here follow the live market and may shift slightly at checkout."})]}),c?e.jsx("p",{className:"market-banner market-banner--warn",children:"The market price is temporarily unavailable — buying is paused for a moment. Please try again shortly."}):null,e.jsx(me,{rarities:k,onToggleRarity:A,sort:b,onSort:j,total:F,loading:_,query:m,anyActive:X,onClear:V,renderLeading:t=>e.jsx(he,{panelKey:"section",label:J,active:!!o||p!=="wearable",panel:t,children:e.jsxs("div",{className:"filter-pop filter-pop--section",children:[e.jsx("ul",{className:"filter-pop__cats",children:B.map(i=>e.jsx("li",{children:e.jsx("button",{className:`filter-pop__cat${p===i.key?" is-active":""}`,onClick:()=>R(i.key),children:i.label})},i.key))}),N.sub.length?e.jsxs("ul",{className:"filter-pop__subs",children:[e.jsx("li",{children:e.jsxs("button",{className:`filter-pop__sub${o?"":" is-active"}`,onClick:()=>{f(null),t.close()},children:["All ",N.label]})}),N.sub.map(i=>e.jsx("li",{children:e.jsx("button",{className:`filter-pop__sub${o===i?" is-active":""}`,onClick:()=>{f(S=>S===i?null:i),t.close()},children:i})},i))]}):null]})})}),L?e.jsx("p",{className:"error",children:"Couldn’t load the market — please try again."}):null,e.jsx("div",{className:"grid",children:_?e.jsx(Y,{count:15}):e.jsxs(e.Fragment,{children:[l.map(t=>e.jsx(ce,{item:Ne(t),mode:"market",marketPriceCredits:y(t),onBuyNow:Z},t.tradeId)),g?e.jsx(Y,{count:6}):null]})}),e.jsx(ye,{hasNextPage:P,isFetching:g,onLoadMore:()=>h()}),!_&&l.length===0?e.jsx("p",{className:"muted",children:"No items match your filters."}):null,w&&r?e.jsx(ve,{listing:w,rate:r,onClose:()=>x(null),onSold:()=>{x(null),D()}}):null]})}export{Be as Market,Be as default};
1
+ import{a as ee,r as u,j as e,b as ae}from"./react-Vu6nbGi5.js";import{c as te,h as G,a as re,x as se,y as z,g as ne,v as ie,E as oe,I,j as M,H as W,G as $,d as T,Q as H,k as U,A as ce,R as de}from"./index-DC3L0_Kx.js";import{r as le,a as q,m as ue}from"./mana-rate-CgBtfPJ6.js";import{S as Q,F as me,a as he}from"./FilterBar-CdU8B66A.js";import{S as Y}from"./SkeletonCards-BysJEVmg.js";import{L as ye}from"./LoadMore-BOCtgPLI.js";import{h as K}from"./buy-Bv5rL_T6.js";import{g as pe,a as fe,w as ke,S as be,G as _e}from"./buy-gasless-Dl9oiGu4.js";import{u as ge}from"./useInfiniteGrid-DnX_HQZy.js";import"./ethers-JeCAM1sd.js";import"./index-KUQH6SSY.js";function xe(){return te({queryKey:["mana-rate",G.chainId],queryFn:()=>le(G.chainId),staleTime:6e4,refetchInterval:6e4,retry:1})}function O(a){const m=a,d=(m.message??"").toLowerCase();return m.code===4001||d.includes("reject")||d.includes("denied")||d.includes("cancel")?"You cancelled the request.":d.includes("insufficient")?`Not enough ${U.name} — get more first.`:d.includes("not found")||d.includes("no active listing")||d.includes("404")?"This item was just sold or removed. Refreshing the market…":d.includes("your own listing")?"You can't buy your own listing.":"Couldn't complete checkout — please try again."}function Ce(a){return{id:a.tradeId,tradeId:a.tradeId,name:a.name,creator:a.creator,contractAddress:a.contractAddress,itemId:a.itemId,category:a.category,wearableCategory:a.wearableCategory??void 0,rarity:a.rarity,network:a.network,chainId:a.chainId,thumbnail:a.thumbnail,priceCredits:0,gender:null}}function ve({listing:a,rate:m,onClose:d,onSold:p}){const{session:n}=re(),{data:o}=se(n),f=z(),k=ee(),[v,b]=u.useState("confirm"),[j,w]=u.useState("Locking today’s price…"),[x,C]=u.useState(null),[s,E]=u.useState(null),l=u.useRef(null),F=Math.ceil(q(a.manaWei,m)/10);u.useEffect(()=>{let h=!1;if(!n){b("error"),C("Sign in to check out.");return}return(async()=>{try{const r=await ne(a.tradeId);if(!r)throw new Error("not found");if(ie(r,n.address))throw new Error("You can't buy your own listing.");const c=q(a.manaWei,m);if(!Number.isFinite(c)||c<=0)throw new Error("price unavailable");const{credit:y,maxCreditedValue:R,usdCents:A}=await oe(n.identity,c,a.tradeId);if(h){I(n.identity,[y.id]).catch(()=>{});return}l.current=y.id,E({trade:r,credit:y,maxCreditedValue:R,usdCents:A,credits:Math.ceil(A/10)}),w("")}catch(r){if(h)return;console.error("[market] authorize failed",r),M($(r)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"authorize",error_code:W(r),value_usd:Math.round(q(a.manaWei,m))/100}),b("error"),C(O(r))}})(),()=>{h=!0,l.current&&n&&(I(n.identity,[l.current]).catch(()=>{}),l.current=null)}},[]);const _=!!s&&((o==null?void 0:o.credits)??0)<s.credits;async function L(){if(!n||!s)return;if(_){I(n.identity,[s.credit.id]).catch(()=>{}),l.current=null,k("/credits");return}b("working"),C(null);let h=!1;try{w("Confirming your purchase…");const r={trade:s.trade,buyer:n.address,signer:n.signer,credits:[s.credit],maxCreditedValue:s.maxCreditedValue};let c;if(pe())try{c=await fe(r),await ke(c),h=!0}catch(y){if(y instanceof be)h=!0;else if(y instanceof _e)c=await K(r);else throw y}else c=await K(r);l.current=null,M("Shop Completed Purchase",{items:[{item_id:a.itemId??null,contract_address:a.contractAddress,token_id:null,price_usd:s.usdCents/100}],value_credits:s.credits,value_usd:s.usdCents/100,purchase_type:"item",is_primary:!0,payment_type:"credits",no_crypto_step:h,transaction_hash:c??null}),f.invalidateQueries({queryKey:["usd-balance"]}),k("/success",{state:{items:[Ce(a)],txHash:c}})}catch(r){console.error("[market] buy now failed",r),I(n.identity,[s.credit.id]).catch(()=>{}),l.current=null,M($(r)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:W(r),value_usd:s.usdCents/100}),f.invalidateQueries({queryKey:["usd-balance"]});const c=O(r);C(c),b("error"),/sold or removed/i.test(c)&&p()}}function P(){n&&s&&I(n.identity,[s.credit.id]).catch(()=>{}),l.current=null,d()}const g=v==="working";return e.jsxs("div",{className:"mkt-modal",role:"dialog","aria-modal":"true","aria-label":`Buy ${a.name}`,children:[e.jsx("div",{className:"mkt-modal__scrim",onClick:g?void 0:P,"aria-hidden":!0}),e.jsxs("div",{className:"mkt-modal__card",children:[e.jsxs("div",{className:"mkt-modal__head",children:[e.jsx("div",{className:"mkt-modal__thumb",children:a.thumbnail?e.jsx("img",{src:a.thumbnail,alt:""}):null}),e.jsxs("div",{children:[e.jsx("div",{className:"mkt-modal__name",title:a.name,children:a.name||"Item"}),e.jsx("span",{className:"chip chip--rarity",children:a.rarity})]})]}),e.jsx("div",{className:"mkt-modal__price",children:s?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mkt-modal__price-label",children:"Final price"}),e.jsxs("div",{className:"mkt-modal__price-value",children:[e.jsx(T,{className:"mkt-modal__diamond"}),H(s.credits)]}),e.jsxs("div",{className:"mkt-modal__price-sub muted",children:["Locked for this purchase · $",(s.usdCents/100).toFixed(2)]})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mkt-modal__price-label",children:"Today’s price"}),e.jsxs("div",{className:"mkt-modal__price-value mkt-modal__price-value--approx",children:[e.jsx("span",{className:"mkt-modal__approx","aria-hidden":!0,children:"≈"}),e.jsx(T,{className:"mkt-modal__diamond"}),H(F)]}),e.jsx("div",{className:"mkt-modal__price-sub muted",children:j||"Locking today’s price…"})]})}),n?e.jsxs("div",{className:"mkt-modal__balance muted",children:["Your balance: ",e.jsx(T,{className:"ccy-mark"})," ",(o==null?void 0:o.credits)??0]}):null,_?e.jsxs("p",{className:"muted mkt-modal__note",children:["You’ll need a few more ",U.name," to buy this."]}):null,j&&v==="working"?e.jsx("p",{className:"muted mkt-modal__note",children:j}):null,x?e.jsx("p",{className:"error mkt-modal__note",children:x}):null,e.jsxs("div",{className:"mkt-modal__actions",children:[e.jsx("button",{className:"btn btn--ghost",onClick:P,disabled:g,children:"Cancel"}),e.jsx("button",{className:"btn btn--purple",onClick:L,disabled:g||!s,children:g?"Buying…":_?`Get ${U.name}`:"Confirm purchase"})]})]})]})}const je=48,B=[{key:"wearable",label:"Wearables",sub:["Head","Upper Body","Handwear","Lower Body","Feet","Accessories","Skins"]},{key:"emote",label:"Emotes",sub:[]}],we={Head:["head","hat","hair","facial_hair","eyes","eyebrows","mouth","mask","helmet","tiara","top_head"],"Upper Body":["upper_body"],Handwear:["hands_wear"],"Lower Body":["lower_body"],Feet:["feet"],Accessories:["earring","eyewear"],Skins:["skin"]};function Ne(a){return{id:a.tradeId,tradeId:a.tradeId,name:a.name,creator:a.creator,contractAddress:a.contractAddress,itemId:a.itemId,category:a.category,wearableCategory:a.wearableCategory??void 0,rarity:a.rarity,network:a.network,chainId:a.chainId,thumbnail:a.thumbnail,priceCredits:0,gender:null}}function Be(){const[a]=ae(),m=(a.get("q")??"").trim().toLowerCase(),d=z(),[p,n]=u.useState("wearable"),[o,f]=u.useState(null),[k,v]=u.useState([]),[b,j]=u.useState("newest"),[w,x]=u.useState(null),C=o?we[o]:void 0,s=(Q.find(t=>t.key===b)??Q[0]).server,E={category:p,rarities:k.length?k:void 0,wearableCategories:C,search:m||void 0,sortBy:s},{items:l,total:F,isLoading:_,error:L,hasNextPage:P,isFetchingNextPage:g,fetchNextPage:h}=ge(["legacy-listings",E],t=>de({...E,first:je,skip:t})),{data:r,isError:c}=xe(),y=t=>r?ue(t.manaWei,r):null;function R(t){n(t),f(null)}function A(t){v(i=>i.includes(t)?i.filter(S=>S!==t):[...i,t])}function V(){n("wearable"),f(null),v([])}function Z(t){const i=l.find(S=>S.tradeId===t.tradeId);i&&x(i)}function D(){d.invalidateQueries({queryKey:["legacy-listings"]})}const N=B.find(t=>t.key===p)??B[0],J=o?`${N.label} · ${o}`:N.label,X=p!=="wearable"||!!o||k.length>0;return e.jsxs("div",{className:"browse",children:[e.jsxs("div",{className:"market-banner",children:[e.jsx("span",{className:"market-banner__ico","aria-hidden":!0,children:"✨"}),e.jsx("span",{children:"Prices here follow the live market and may shift slightly at checkout."})]}),c?e.jsx("p",{className:"market-banner market-banner--warn",children:"The market price is temporarily unavailable — buying is paused for a moment. Please try again shortly."}):null,e.jsx(me,{rarities:k,onToggleRarity:A,sort:b,onSort:j,total:F,loading:_,query:m,anyActive:X,onClear:V,renderLeading:t=>e.jsx(he,{panelKey:"section",label:J,active:!!o||p!=="wearable",panel:t,children:e.jsxs("div",{className:"filter-pop filter-pop--section",children:[e.jsx("ul",{className:"filter-pop__cats",children:B.map(i=>e.jsx("li",{children:e.jsx("button",{className:`filter-pop__cat${p===i.key?" is-active":""}`,onClick:()=>R(i.key),children:i.label})},i.key))}),N.sub.length?e.jsxs("ul",{className:"filter-pop__subs",children:[e.jsx("li",{children:e.jsxs("button",{className:`filter-pop__sub${o?"":" is-active"}`,onClick:()=>{f(null),t.close()},children:["All ",N.label]})}),N.sub.map(i=>e.jsx("li",{children:e.jsx("button",{className:`filter-pop__sub${o===i?" is-active":""}`,onClick:()=>{f(S=>S===i?null:i),t.close()},children:i})},i))]}):null]})})}),L?e.jsx("p",{className:"error",children:"Couldn’t load the market — please try again."}):null,e.jsx("div",{className:"grid",children:_?e.jsx(Y,{count:15}):e.jsxs(e.Fragment,{children:[l.map(t=>e.jsx(ce,{item:Ne(t),mode:"market",marketPriceCredits:y(t),onBuyNow:Z},t.tradeId)),g?e.jsx(Y,{count:6}):null]})}),e.jsx(ye,{hasNextPage:P,isFetching:g,onLoadMore:()=>h()}),!_&&l.length===0?e.jsx("p",{className:"muted",children:"No items match your filters."}):null,w&&r?e.jsx(ve,{listing:w,rate:r,onClose:()=>x(null),onSold:()=>{x(null),D()}}):null]})}export{Be as Market,Be as default};
@@ -1,4 +1,4 @@
1
- import{_ as w,b as g,n as Ne,o as ke,g as Q,a as A,u as ie,c as Z,e as ae,s as le,p as H,q as we}from"./generateUtilityClasses-YwmkdnPH.js";import{r as p,j as T,f as z,R as X,h as De}from"./react-Vu6nbGi5.js";import{u as Oe,_ as Le,T as Ce,a as W,b as J,s as ue,c as _e,o as ce,B as Fe}from"./Button-Cr1_TS3D.js";function je(e){const t=e.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}const He=["value"],Se=p.createContext();function xt(e){let{value:t}=e,n=w(e,He);return T.jsx(Se.Provider,g({value:t??!0},n))}const bt=()=>{const e=p.useContext(Se);return e??!1};function Ae(){const e=Oe(ke);return e[Ne]||e}const de=e=>{let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,(t/100).toFixed(2)};var ee={exports:{}},d={};/**
1
+ import{_ as w,b as g,n as Ne,o as ke,g as Q,a as A,u as ie,c as Z,e as ae,s as le,p as H,q as we}from"./generateUtilityClasses-BqTxi5Sw.js";import{r as p,j as T,f as z,R as X,h as De}from"./react-Vu6nbGi5.js";import{u as Oe,_ as Le,T as Ce,a as W,b as J,s as ue,c as _e,o as ce,B as Fe}from"./Button-DqWM_3MR.js";function je(e){const t=e.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}const He=["value"],Se=p.createContext();function xt(e){let{value:t}=e,n=w(e,He);return T.jsx(Se.Provider,g({value:t??!0},n))}const bt=()=>{const e=p.useContext(Se);return e??!1};function Ae(){const e=Oe(ke);return e[Ne]||e}const de=e=>{let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,(t/100).toFixed(2)};var ee={exports:{}},d={};/**
2
2
  * @license React
3
3
  * react-is.production.min.js
4
4
  *
@@ -1 +1 @@
1
- .publish-section{margin-top:40px}.publish-section__head{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:6px}.publish-section__title{font-size:20px;font-weight:700;color:var(--text)}.publish-section__hint{color:var(--muted);font-size:14px;margin:0 0 16px}.publish-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:16px;margin-top:8px}.publish-card{background:#fff;border:1px solid var(--line);border-radius:12px;padding:14px;display:flex;flex-direction:column;gap:10px}.publish-card__img{aspect-ratio:1;background:var(--media);border-radius:8px;display:grid;place-items:center;overflow:hidden}.publish-card__img img{width:100%;height:100%;object-fit:contain}.publish-card__name{font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.publish-card__meta{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.publish-card__collection{color:var(--muted);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.publish-chip{display:inline-flex;align-items:center;font-size:11px;font-weight:700;border-radius:var(--radius-chip);padding:3px 8px;background:var(--chip);color:#555}.publish-chip--rarity{background:var(--rarity-bg);color:var(--rarity);text-transform:uppercase;letter-spacing:.02em}.publish-card__supply{color:var(--muted);font-size:12px}.publish-card__cta{margin-top:auto;width:100%}.publish-empty{color:var(--muted);padding:16px 0}.primary-note{background:var(--rarity-bg);color:var(--accent);border-radius:8px;padding:10px 12px;margin:0}.myassets__section{margin-bottom:48px}.myassets__section-head{margin-bottom:18px}.myassets__section-title{font-size:22px;font-weight:700;margin:0}.myassets__section-sub{color:var(--muted);font-size:14px;margin:4px 0 0}.creations-collection{margin-bottom:26px}.creations-collection__name{font-size:15px;font-weight:700;color:var(--text-2);margin:0 0 14px;padding-bottom:8px;border-bottom:1px solid var(--line)}.asset-card--link,.publish-card--link{cursor:pointer;transition:box-shadow .15s ease,transform .15s ease}.asset-card--link:hover,.publish-card--link:hover{box-shadow:0 10px 26px #14141e1f;transform:translateY(-2px)}.asset-card--link:focus-visible,.publish-card--link:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.asset-card__remove{margin-top:8px;width:100%}.publish-card__listed{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:auto}.publish-card__price{font-weight:800;font-size:15px}.import-banner{display:flex;align-items:center;gap:14px;text-decoration:none;color:var(--text);background:linear-gradient(100deg,#a524b31a,#691fa90f);border:1px solid rgba(105,31,169,.22);border-radius:14px;padding:14px 18px;margin:4px 0 22px;transition:box-shadow .15s ease,transform .15s ease}.import-banner:hover{box-shadow:0 10px 26px #691fa929;transform:translateY(-1px)}.import-banner__ico{font-size:26px}.import-banner__text{display:flex;flex-direction:column;gap:2px;min-width:0}.import-banner__text strong{font-size:15px}.import-banner__sub{color:var(--muted);font-size:13px}.import-banner__cta{margin-left:auto;flex:none;background:var(--accent);color:#fff;font-weight:700;font-size:13px;letter-spacing:.03em;text-transform:uppercase;padding:9px 18px;border-radius:9px}
1
+ .publish-section{margin-top:40px}.publish-section__head{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:6px}.publish-section__title{font-size:20px;font-weight:700;color:var(--text)}.publish-section__hint{color:var(--muted);font-size:14px;margin:0 0 16px}.publish-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:16px;margin-top:8px}.publish-card{background:#fff;border:1px solid var(--line);border-radius:12px;padding:14px;display:flex;flex-direction:column;gap:10px}.publish-card__img{aspect-ratio:1;background:var(--media);border-radius:8px;display:grid;place-items:center;overflow:hidden}.publish-card__img img{width:100%;height:100%;object-fit:contain}.publish-card__name{font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.publish-card__meta{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.publish-card__collection{color:var(--muted);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.publish-chip{display:inline-flex;align-items:center;font-size:11px;font-weight:700;border-radius:var(--radius-chip);padding:3px 8px;background:var(--chip);color:#555}.publish-chip--rarity{background:var(--rarity-bg);color:var(--rarity);text-transform:uppercase;letter-spacing:.02em}.publish-card__supply{color:var(--muted);font-size:12px}.publish-card__cta{margin-top:auto;width:100%}.publish-empty{color:var(--muted);padding:16px 0}.primary-note{background:var(--rarity-bg);color:var(--accent);border-radius:8px;padding:10px 12px;margin:0}.myassets__section{margin-bottom:48px}.myassets__section-head{margin-bottom:18px}.myassets__section-title{font-size:22px;font-weight:700;margin:0}.myassets__section-sub{color:var(--muted);font-size:14px;margin:4px 0 0}.creations-collection{margin-bottom:26px}.creations-collection__name{font-size:15px;font-weight:700;color:var(--text-2);margin:0 0 14px;padding-bottom:8px;border-bottom:1px solid var(--line)}.asset-card--link,.publish-card--link{position:relative;transition:box-shadow .15s ease,transform .15s ease}.asset-card--link:hover,.publish-card--link:hover{box-shadow:0 10px 26px #14141e1f;transform:translateY(-2px)}.card-link-overlay{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;background:transparent;border:0;padding:0;cursor:pointer}.card-link-overlay:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.asset-card--link>button:not(.card-link-overlay),.publish-card--link>button:not(.card-link-overlay){position:relative;z-index:2}.asset-card__remove{margin-top:8px;width:100%}.publish-card__listed{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:auto}.publish-card__price{font-weight:800;font-size:15px}.import-banner{display:flex;align-items:center;gap:14px;text-decoration:none;color:var(--text);background:linear-gradient(100deg,#a524b31a,#691fa90f);border:1px solid rgba(105,31,169,.22);border-radius:14px;padding:14px 18px;margin:4px 0 22px;transition:box-shadow .15s ease,transform .15s ease}.import-banner:hover{box-shadow:0 10px 26px #691fa929;transform:translateY(-1px)}.import-banner__ico{font-size:26px}.import-banner__text{display:flex;flex-direction:column;gap:2px;min-width:0}.import-banner__text strong{font-size:15px}.import-banner__sub{color:var(--muted);font-size:13px}.import-banner__cta{margin-left:auto;flex:none;background:var(--accent);color:#fff;font-weight:700;font-size:13px;letter-spacing:.03em;text-transform:uppercase;padding:9px 18px;border-radius:9px}