@dcl/shop 0.1.0-29931880276.commit-39a954b → 0.1.0-29934929940.commit-6d4a894
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/{AnimatedBackground-xIwScd64.js → AnimatedBackground-8hsGcQ0u.js} +3 -3
- package/assets/{Assets-DzhUMOjU.js → Assets-zJP2dh8T.js} +1 -1
- package/assets/{Assets.styles-BF1K0Jbw.js → Assets.styles-BKTin871.js} +33 -19
- package/assets/{Cart-w8N0Y0ya.js → Cart-KI1ErU7i.js} +1 -1
- package/assets/{CircularProgress-D7exEomy.js → CircularProgress-CHG6tLju.js} +1 -1
- package/assets/{Collection-GqEK3_zk.js → Collection-Do5NXSU2.js} +1 -1
- package/assets/{CollectionCarousel-C7O5o-Tv.js → CollectionCarousel-BaRGhi3w.js} +1 -1
- package/assets/{Creator-Clylca_l.js → Creator-JDFZfL5s.js} +1 -1
- package/assets/{CssVarsProvider-CboyQkKy.js → CssVarsProvider-ClB453yI.js} +1 -1
- package/assets/{ExchangeController-DmlCZsSW.js → ExchangeController-gNB3kOET.js} +1 -1
- package/assets/{GetCredits-D-SU9u6H.js → GetCredits--2sG2kUu.js} +1 -1
- package/assets/{HelpersUtil-BRd8Wboc.js → HelpersUtil-ChCAjTFl.js} +1 -1
- package/assets/{ImportListings-HESYhm4w.js → ImportListings-Dx4tRkPi.js} +1 -1
- package/assets/{ItemDetail-NzttQaG_.js → ItemDetail-DqyfPCJF.js} +2 -2
- package/assets/{LoadMore-DehCeiiw.js → LoadMore-DEqrabJR.js} +1 -1
- package/assets/{MarketCheckout-JtWPjxr4.js → MarketCheckout-BhoJ5oaY.js} +1 -1
- package/assets/{MyAssets-xIy0Iu3r.js → MyAssets-Dml_XsHc.js} +1 -1
- package/assets/{MyFavorites-CzDX3Blr.js → MyFavorites-DCK1vo8d.js} +1 -1
- package/assets/{MyPurchases-Bi8MSD7t.js → MyPurchases-CCC9vTm6.js} +1 -1
- package/assets/{NotFound-93qdZPW6.js → NotFound-C9MQxOVj.js} +1 -1
- package/assets/{PrimaryListModal-D8flQ4s3.js → PrimaryListModal-5yw3HjxR.js} +1 -1
- package/assets/{StoreSettings-BSsFAKLn.js → StoreSettings-CCWCDTh_.js} +1 -1
- package/assets/{Success-ClYYwwKU.js → Success-BDwtV9vp.js} +1 -1
- package/assets/{SwapController-BQwxN-hZ.js → SwapController-CUDA5nJJ.js} +1 -1
- package/assets/{Tooltip-DvkMJN9a.js → Tooltip-CmUV5INZ.js} +1 -1
- package/assets/{TradeService-B-A7fi8q.js → TradeService-DLK4MfJ6.js} +1 -1
- package/assets/{W3MFrameProviderSingleton-Dj1XgPIq.js → W3MFrameProviderSingleton-_Jupf0lQ.js} +3 -3
- package/assets/{WebCryptoP256-B7nDm7bV.js → WebCryptoP256-DUqSrnE5.js} +1 -1
- package/assets/{basic-DmwPxIIO.js → basic--d_dy4i5.js} +1 -1
- package/assets/{biconomy-BhaU-x0n.js → biconomy-B3E5v_ox.js} +1 -1
- package/assets/{buy-CG6T8PdF.js → buy-DcrAdUpx.js} +1 -1
- package/assets/{buy-gasless-D8VGUOmZ.js → buy-gasless-b-y-A9B0.js} +1 -1
- package/assets/{cart-checkout-CtsIeuCD.js → cart-checkout-DAncfmAA.js} +1 -1
- package/assets/{categories-DOvsccJ3.js → categories-BxHDtlRd.js} +1 -1
- package/assets/{ccip-DtXhpG-g.js → ccip-B6LXrSMV.js} +1 -1
- package/assets/{ccip-7QG8EGU2.js → ccip-DvIxb239.js} +1 -1
- package/assets/{collection-D_arZ29c.js → collection-ChguPkSb.js} +1 -1
- package/assets/{controller-DkZ-Dz5-.js → controller-Bn7Z9_r0.js} +2 -2
- package/assets/{core-0HmbO-iH.js → core-BBJz894Q.js} +4 -4
- package/assets/{custom-D-DeuiP6.js → custom-1kg7ng5l.js} +1 -1
- package/assets/{data-capture-CicifRfZ.js → data-capture-ChI8n4xx.js} +1 -1
- package/assets/{email-Dwf-6WA1.js → email-CMJpr-fW.js} +1 -1
- package/assets/{embedded-wallet-DCPuLx8U.js → embedded-wallet-ggb_52HF.js} +1 -1
- package/assets/{emotion-styled.browser.esm-BbfM-qS4.js → emotion-styled.browser.esm-wTpuh9_1.js} +1 -1
- package/assets/{engine-DpGff5Yu.js → engine-D1X0lXh5.js} +1 -1
- package/assets/{errors-BR15RpBo.js → errors-DGvmy-zZ.js} +1 -1
- package/assets/{estimate-l1-fee-B28SdcW0.js → estimate-l1-fee-CIJA48wh.js} +1 -1
- package/assets/{execute-DCmpb9bW.js → execute-CLaVApj9.js} +2 -2
- package/assets/{features-VE0_vWYT.js → features-DIxQMYhX.js} +1 -1
- package/assets/{fetchTokenMetadata-BAX-FhAK.js → fetchTokenMetadata-DK5hE0wQ.js} +2 -2
- package/assets/{get-ecosystem-wallet-info-BX24vsJU.js → get-ecosystem-wallet-info-D6mzdR0G.js} +1 -1
- package/assets/{getBalance-D4m2CI4L.js → getBalance-BzFjlu9G.js} +1 -1
- package/assets/{getNFT-cGXDfd4w.js → getNFT-B8L91SOg.js} +1 -1
- package/assets/{getNFT-CIxfY1zw.js → getNFT-C8_Ym6i8.js} +1 -1
- package/assets/{getOverlayAlpha-Bbwa0Id2.js → getOverlayAlpha-DEiIzOVP.js} +1 -1
- package/assets/{hashTypedData-DW9glqLV.js → hashTypedData-30Jlq8db.js} +1 -1
- package/assets/{hashTypedData-CuGYT3MD.js → hashTypedData-D6R8yQIx.js} +1 -1
- package/assets/{import-NCiecwkp.js → import-DwFR83oQ.js} +1 -1
- package/assets/{in-app-D6FFhYL8.js → in-app-CUkhWh_L.js} +1 -1
- package/assets/{in-app-wallet-calls--JWObqaU.js → in-app-wallet-calls-Cxpe1Bwc.js} +1 -1
- package/assets/{index-Bdrkx_0l.js → index-1gQN_kvx.js} +1 -1
- package/assets/{index-Ccb6psTR.js → index-5irkjtJp.js} +1 -1
- package/assets/{index-tXcpBNpH.js → index-B3CMW_Rz.js} +1 -1
- package/assets/{index-gVFIc3Gf.js → index-B3xOzx6X.js} +1 -1
- package/assets/{index-DcUSP1NZ.js → index-B8IbHKn5.js} +9 -9
- package/assets/{index-D68970iX.js → index-B9qeAesl.js} +1 -1
- package/assets/{index-CIAWDbLx.js → index-BEaNsXM-.js} +1 -1
- package/assets/{index-AD8y2fos.js → index-BFk4WfKV.js} +1 -1
- package/assets/{index-DnJZZYa0.js → index-BOt9Opm-.js} +1 -1
- package/assets/{index-BfKLBheW.js → index-BVi1IXaN.js} +1 -1
- package/assets/{index-BrDFuwwz.js → index-BWGviuYS.js} +1 -1
- package/assets/{index-3aaL8y7_.js → index-BbFU3LoB.js} +2 -2
- package/assets/{index-DhJdnUKp.js → index-BdwR3G_d.js} +1 -1
- package/assets/{index-BY4sZyBS.js → index-Bf4Q_PCL.js} +1 -1
- package/assets/{index-BNGJhE6h.js → index-Bl_PDUbW.js} +3 -3
- package/assets/{index-CuHvb1dG.js → index-BmdP7fOj.js} +1 -1
- package/assets/{index-Bzu2ISZD.js → index-BokebKeP.js} +2 -2
- package/assets/{index-Cn4BXJFK.js → index-BpHVmfrg.js} +1 -1
- package/assets/{index-B4MafS4f.js → index-BxGv3iyo.js} +1 -1
- package/assets/{index-Bn291VMX.js → index-C50s7O-g.js} +3 -3
- package/assets/{index-ctBIBolh.js → index-CDE1OoEd.js} +1 -1
- package/assets/{index-BKhuX1Zk.js → index-CDcigD9G.js} +1 -1
- package/assets/{index-DaGkyRHK.js → index-CKN3JhVe.js} +1 -1
- package/assets/{index-iErwYSN4.js → index-CKovnqJP.js} +1 -1
- package/assets/{index-CEvq6ig8.js → index-CRFpqXcH.js} +1 -1
- package/assets/{index-BWk0YlC1.js → index-CWbN9Peg.js} +1 -1
- package/assets/{index-Dgvroxgs.js → index-CecrsNSC.js} +1 -1
- package/assets/{index-1lXRwbFZ.js → index-CfF05W5R.js} +1 -1
- package/assets/{index-CaWRGHs2.js → index-Cgap8AUD.js} +1 -1
- package/assets/{index-BKftXRbu.js → index-ChE7SRyt.js} +1 -1
- package/assets/{index-DH2U2f22.js → index-Cj2-8UH4.js} +1 -1
- package/assets/{index-BdMt2ArB.js → index-Csh4ZzC9.js} +3 -3
- package/assets/{index-8vvLtURI.js → index-DHAMkmn9.js} +1 -1
- package/assets/{index-Ci9NOZul.js → index-DKroPvyy.js} +1 -1
- package/assets/{index-DwXbBOKz.js → index-DUZmU_0S.js} +2 -2
- package/assets/{index-AbU1f7V7.js → index-DUkzcHbX.js} +1 -1
- package/assets/{index-Cw8VkaQM.js → index-DirIOdjz.js} +1 -1
- package/assets/{index-CJtIa-2G.js → index-DjwEMK3G.js} +1 -1
- package/assets/{index-BprEr1Ly.js → index-DkYtNpvt.js} +1 -1
- package/assets/{index-3BS3wmrm.js → index-Dl9hHOZJ.js} +1 -1
- package/assets/{index-C_ZvSr7-.js → index-DoH_srP9.js} +1 -1
- package/assets/{index-CJ8YWRNg.js → index-Dpmkxp94.js} +1 -1
- package/assets/{index-CJNQr62o.js → index-DszuXHRO.js} +1 -1
- package/assets/{index-C9vfzG8K.js → index-M9Lpp4iE.js} +1 -1
- package/assets/{index-DNk71Hf-.js → index-MzkyVebZ.js} +1 -1
- package/assets/{index-MVoUqF_G.js → index-OEC5-urT.js} +1 -1
- package/assets/{index-B9YK8_ai.js → index-QETV6gE_.js} +1 -1
- package/assets/{index-NHYbH9Q9.js → index-ZeJG5A5O.js} +1 -1
- package/assets/{index-wkMH5x15.js → index-tRqsza9O.js} +1 -1
- package/assets/{index-CrqG2Pmp.js → index-w1ulQg_8.js} +1 -1
- package/assets/{index-DVbGVOvy.js → index-wFtyEdaH.js} +1 -1
- package/assets/{index-HRn0zui-.js → index-ytKJv8_W.js} +1 -1
- package/assets/{index.es-BkYyf3CC.js → index.es-BOjaJD0O.js} +4 -4
- package/assets/{index.es-DkpPJT72.js → index.es-CeNIgyNC.js} +1 -1
- package/assets/{index.es-CSzCsCdX.js → index.es-CnHhHSCq.js} +1 -1
- package/assets/{localBatchGatewayRequest-DZtDtccC.js → localBatchGatewayRequest-CnXU2N0v.js} +1 -1
- package/assets/{mana-rate-CQXoYDgW.js → mana-rate-Z0fOAnP4.js} +1 -1
- package/assets/{networks-DqRgQwei.js → networks-DRRFntRj.js} +1 -1
- package/assets/{onramp-Dua2KqaL.js → onramp-YOrhAP08.js} +1 -1
- package/assets/{openzeppelin-B5v-lnYu.js → openzeppelin-DLbYMZrj.js} +1 -1
- package/assets/{parseNft-C_apsVdc.js → parseNft-BAtiT6yX.js} +2 -2
- package/assets/{parseSignature-BpJH_FE8.js → parseSignature-DsA9O_Ak.js} +3 -3
- package/assets/{parseSignature-vZe7fqAs.js → parseSignature-z0AWZvnA.js} +1 -1
- package/assets/{passkeys-OcN7qNpX.js → passkeys-BTHsRkfl.js} +1 -1
- package/assets/{pay-with-exchange-GQhZYq31.js → pay-with-exchange-yHyBBgyM.js} +1 -1
- package/assets/{qr-overlay-8TuM7lya.js → qr-overlay-BH--1hn8.js} +1 -1
- package/assets/{receive-Ce9v7PbK.js → receive-CjGVww72.js} +1 -1
- package/assets/{resolveImplementation-CnyGjBjb.js → resolveImplementation-BKCjssN2.js} +1 -1
- package/assets/{rpc-C-8Z-khV.js → rpc-UlD1Yufg.js} +1 -1
- package/assets/{secp256k1-GS9coht8.js → secp256k1-BHkDM-tH.js} +1 -1
- package/assets/{secp256k1-XWlToBxV.js → secp256k1-BrTQvA4F.js} +1 -1
- package/assets/{secp256k1-CD5thO9M.js → secp256k1-WljeVDsw.js} +1 -1
- package/assets/{send-batch-transaction-B3SkjaJd.js → send-batch-transaction-Cc9JRr38.js} +1 -1
- package/assets/{send-eip712-transaction-b2YwZsw6.js → send-eip712-transaction-D5PSVDu-.js} +2 -2
- package/assets/{send-gasless-transaction-DauMfM6n.js → send-gasless-transaction-Dqcv_ITl.js} +2 -2
- package/assets/{send-CTpoky5o.js → send-tO6EhaL3.js} +1 -1
- package/assets/{send-transaction-CZpR2DTm.js → send-transaction-cYs7CC0Z.js} +2 -2
- package/assets/{sendRawTransaction-DgxONikM.js → sendRawTransaction-CITbtRC7.js} +3 -3
- package/assets/{serializeTransaction-Co5GcIEc.js → serializeTransaction-Btmy4ifh.js} +1 -1
- package/assets/{session-proposal-G8Yjn8ZD.js → session-proposal-DrRYiiTl.js} +1 -1
- package/assets/{session-request-DJdz6eXZ.js → session-request-D0sRJfkf.js} +2 -2
- package/assets/{signing-4ZA6JTPf.js → signing-pcucBOUB.js} +3 -3
- package/assets/{socials-DIMb8ZdT.js → socials-CGjqIEg_.js} +1 -1
- package/assets/{swaps-BNBy_8lk.js → swaps-BphZ398u.js} +1 -1
- package/assets/{thirdweb-B3zScHLY.js → thirdweb-DUgg8d6T.js} +3 -3
- package/assets/{to-serializable-transaction-D1abmMv3.js → to-serializable-transaction-s-pMi3iV.js} +2 -2
- package/assets/{transactionReceipt-BpaL5a1n.js → transactionReceipt-B-qhqvkt.js} +1 -1
- package/assets/{transactions-DQ-Lv1I4.js → transactions-CSSZ1Uj-.js} +1 -1
- package/assets/{useCreditPacks-FWq5J9OL.js → useCreditPacks-Z0vJvkTc.js} +1 -1
- package/assets/{useInfiniteGrid-8ySZNn_a.js → useInfiniteGrid-CcAnLcIW.js} +1 -1
- package/assets/{useStore-BUhMTkWi.js → useStore-DuXZRHKD.js} +1 -1
- package/assets/{useTheme-CX-2YuFt.js → useTheme-BaXPBxeY.js} +1 -1
- package/assets/useTheme-efxsW9nt.js +1 -0
- package/assets/{verifyHash-BxRMQYBh.js → verifyHash-CSuvCpxH.js} +1 -1
- package/assets/{w3m-modal-DOisJtvB.js → w3m-modal-BKgYOmDm.js} +1 -1
- package/assets/{w3m-modal-Bf0ntzho.js → w3m-modal-Bm4Jot-v.js} +1 -1
- package/assets/{wait-for-tx-receipt-CtkeURk6.js → wait-for-tx-receipt-CigZhA8t.js} +1 -1
- package/assets/{wallet-kind-BcpepgVH.js → wallet-kind-D0r-Cmku.js} +1 -1
- package/assets/{wallets-TN4SBaj9.js → wallets-DEGbSfsr.js} +5 -5
- package/assets/{web-connector-BoAILdPa.js → web-connector-BVqUWfCL.js} +3 -3
- package/assets/{writeContract-NLcb9_dn.js → writeContract-CyscURCL.js} +1 -1
- package/assets/{zoraTestnet-BoW5OfYU.js → zoraTestnet-DteZMy6Z.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/assets/useTheme-DbMI5R67.js +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{r as l,j as v}from"./react-BMZSDQJw.js";const w="https://cdn.decentraland.org/@dcl/shop/0.1.0-
|
|
1
|
+
import{r as l,j as v}from"./react-BMZSDQJw.js";const w="https://cdn.decentraland.org/@dcl/shop/0.1.0-29934929940.commit-6d4a894/assets/custom-welcome-background-BxlFQma9.webp",S="https://cdn.decentraland.org/@dcl/shop/0.1.0-29934929940.commit-6d4a894/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
|
-
`,
|
|
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,
|
|
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,4 +1,4 @@
|
|
|
1
|
-
import{u as Ke,r as p,j as e,a as Qe}from"./react-BMZSDQJw.js";import{c as F,o as Ze,k as Je,a2 as Xe,s,y as t,g as Ee,h as Ye,j as Te,al as Ie,t as o,I as T,l as B,n as pe,q as D,r as et,v as tt,u as Ne,z as nt,A as K,az as st,aA as ot}from"./index-
|
|
1
|
+
import{u as Ke,r as p,j as e,a as Qe}from"./react-BMZSDQJw.js";import{c as F,o as Ze,k as Je,a2 as Xe,s,y as t,g as Ee,h as Ye,j as Te,al as Ie,t as o,I as T,l as B,n as pe,q as D,r as et,v as tt,u as Ne,z as nt,A as K,az as st,aA as ot}from"./index-B8IbHKn5.js";import{r as it,a as rt,m as Ae}from"./mana-rate-Z0fOAnP4.js";import{u as _e,M as at}from"./MarketCheckout-BhoJ5oaY.js";import{g as lt,h as ct,i as dt,j as ft,k as pt,C as ut,l as xt,o as ht,m as mt,n as gt,M as bt}from"./Assets.styles-BKTin871.js";import{d as ue,R as yt,F as wt,S as xe,b as jt}from"./categories-BxHDtlRd.js";import{L as vt}from"./LoadMore-DEqrabJR.js";import{u as $t}from"./useInfiniteGrid-CcAnLcIW.js";import{E as Ct}from"./ErrorNotice-DDr3KjIH.js";import{d as kt}from"./dcl-schemas-BICTSpB5.js";import{u as St,G as Rt,w as zt,S as Et}from"./buy-gasless-b-y-A9B0.js";import{s as Tt}from"./buy-DcrAdUpx.js";import{j as It,s as Nt}from"./wallet-kind-D0r-Cmku.js";import{f as At}from"./errors-DGvmy-zZ.js";import{J as _t,C as Pt,B as ne}from"./ethers-CeDRuWE-.js";import{l as Mt}from"./loader-logo-BzY9EKdC.js";import{n as Lt}from"./emotion-CSxEP8yM.js";import"./sentry-8SzFotJj.js";import"./intl-CBcMB1D2.js";import"./index-HN6Rk25C.js";import"./Tooltip-CmUV5INZ.js";function Q(n){const i=n.source??"item",f=n.tradeId||`${n.contractAddress}-${n.tokenId??n.itemId??""}`;return`${i}:${f}`}const W="100000000000000000000",Pe=2,V=15,Bt=/^[a-zA-Z0-9]+$/;function he(n){const i=n.trim();return i.length===0?{ok:!1,reason:"empty"}:Bt.test(i)?i.length<Pe?{ok:!1,reason:"too-short"}:i.length>V?{ok:!1,reason:"too-long"}:{ok:!0}:{ok:!1,reason:"invalid-chars"}}function Ft(n){return n.replace(/[^a-zA-Z0-9]/g,"").slice(0,V)}const Wt=["function available(string _subdomain) view returns (bool)"],me={mainnet:{rpc:"https://rpc.decentraland.org/mainnet",address:"0x2a187453064356c898cae034eaed119e1663acb8"},sepolia:{rpc:"https://rpc.decentraland.org/sepolia",address:"0x7518456ae93eb98f3e64571b689c626616bb7f30"}};function Ht(){return F.chainId===kt.ChainId.MATIC_MAINNET?me.mainnet:me.sepolia}async function Ut(n,i={}){var d;const{rpc:f,address:u}=Ht(),l=new _t(f),c=new Pt(u,Wt,l);console.info(`[names] availability check → DCLRegistrar(${u}).available("${n}") on ${f}`);const x=await c.available(n);if((d=i.signal)!=null&&d.aborted)throw new DOMException("Aborted","AbortError");return console.info(`[names] "${n}" available=${x}`),x?"available":"taken"}const Ot="https://app.across.to/api";class Me extends Error{constructor(){super("Name registration is temporarily unavailable due to high network costs"),this.name="NameRouteCostTooHighError"}}function qt(n){return rt(W,n)}async function Gt(n,i,f={}){var d;const u=f.chainId??F.chainId,l=f.provider??"across",c=`${F.creditsServerUrl}/credits-name-route?name=${encodeURIComponent(i)}&chainId=${u}&provider=${l}`,x=await Xe(c,{method:"GET",identity:n,metadata:{}});if(!x.ok){let a;try{a=(d=await x.json())==null?void 0:d.code}catch{}throw a==="ROUTE_COST_TOO_HIGH"?new Me:new Error(`fetchNameCreditRoute ${x.status}`)}return x.json()}function Dt(n,i){const f=ne.from(n.availableAmount),l=ne.from(W).sub(f);return{credits:[{value:n.amount,expiresAt:Number(n.expiresAt),salt:It(n.id)}],creditsSignatures:[n.signature],externalCall:{target:i.externalCall.target,selector:i.externalCall.selector,data:i.externalCall.data,expiresAt:i.externalCall.expiresAt,salt:i.externalCall.salt},customExternalCallSignature:i.customExternalCallSignature,maxUncreditedValue:l.isNegative()?"0":l.toString(),maxCreditedValue:W}}async function Vt(n,i={}){const f=Ot,u=i.intervalMs??1e4,l=i.maxAttempts??60;let c={status:"pending",destinationTxHash:null,actionsSucceeded:!1};for(let x=0;x<l;x++){try{const d=await fetch(`${f}/deposit/status?originChainId=137&depositTxHash=${n}`);if(d.ok){const a=await d.json(),m=(a.status??"pending").toLowerCase(),w=a.fillTx??a.fillTxnRef??null,y=a.actionsSucceeded!==!1;if(m==="filled")return{status:"filled",destinationTxHash:w,actionsSucceeded:y};if(m==="refunded"||m==="expired")return{status:m,destinationTxHash:null,actionsSucceeded:!1};c={status:"pending",destinationTxHash:w,actionsSucceeded:y}}}catch{}x<l-1&&await new Promise(d=>setTimeout(d,u))}return c}async function Kt(n){const{name:i,identity:f,signer:u}=n,l=n.chainId??F.chainId,c=n.provider??"across",x=(n.beneficiary??await u.getAddress()).toLowerCase();let d=null,a=!1;console.info("[names] register start",{name:i,buyer:x,chainId:l,provider:c});try{const m=await it(l),w=qt(m);console.info("[names] step 1/6 sized reservation",{usdCents:w,manaRate:m});const y=await Gt(f,i,{chainId:l,provider:c});console.info("[names] step 2/6 route fetched",{target:y.externalCall.target,selector:y.externalCall.selector,provider:y.provider,quoteId:y.quoteId});const j=await Ze(f,w);if(d=j.credit.id,console.info("[names] step 3/6 credit authorized",{creditId:j.credit.id,maxCreditedValue:j.maxCreditedValue}),ne.from(j.maxCreditedValue).lt(W))throw new Error("Credit under-sized for the name price");const C=Dt(j.credit,y);let h;try{h=await St({chainId:l,buyer:x,signer:u,args:C})}catch(b){if(!(b instanceof Rt))throw b;h=await Tt(l,C,u)}if(console.info("[names] step 4/6 useCredits submitted (Polygon origin tx)",{originTxHash:h}),await zt(h),a=!0,console.info("[names] step 5/6 origin tx confirmed",{originTxHash:h}),c==="across"){const b=await Vt(h,n.acrossPoll);if(console.info("[names] step 6/6 across status",b),b.status==="pending")return{status:"pending",originTxHash:h};if(b.status!=="filled"||!b.actionsSucceeded)throw new Error("The name could not be registered on Ethereum; your funds were recovered.");return{status:"registered",originTxHash:h,destinationTxHash:b.destinationTxHash}}return{status:"pending",originTxHash:h}}catch(m){if(console.error("[names] register failed — raw error:",m,{name:i,buyer:x,originConfirmed:a}),m instanceof Et)return{status:"pending",originTxHash:m.txHash};throw d&&!a&&await Je(f,[d]).catch(()=>{}),m instanceof Me?m:new Error(At(m,"Couldn't register the name. Please try again.",{sale:!0}))}}const Qt=s.div`
|
|
2
2
|
position: fixed;
|
|
3
3
|
inset: 0;
|
|
4
4
|
z-index: 10000;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as
|
|
1
|
+
import{r as $,j as t}from"./react-BMZSDQJw.js";import{R as z,a as oe,C as ie,c as se}from"./categories-BxHDtlRd.js";import{T as ne}from"./Tooltip-CmUV5INZ.js";import{y as e,s as o,I as u,t as n,z as re,C as v}from"./index-B8IbHKn5.js";import{n as c}from"./emotion-CSxEP8yM.js";const ae=o.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: 12px;
|
|
@@ -83,7 +83,7 @@ import{r as y,j as t}from"./react-BMZSDQJw.js";import{R as z,a as oe,C as ie,c a
|
|
|
83
83
|
`,ge=o.div`
|
|
84
84
|
overflow: hidden;
|
|
85
85
|
min-height: 0;
|
|
86
|
-
`,
|
|
86
|
+
`,ue=o.div`
|
|
87
87
|
display: flex;
|
|
88
88
|
align-items: flex-end;
|
|
89
89
|
justify-content: center;
|
|
@@ -113,7 +113,7 @@ import{r as y,j as t}from"./react-BMZSDQJw.js";import{R as z,a as oe,C as ie,c a
|
|
|
113
113
|
&:focus-within {
|
|
114
114
|
border-color: ${e.rarities.epic};
|
|
115
115
|
}
|
|
116
|
-
`,F=o(
|
|
116
|
+
`,F=o(u)`
|
|
117
117
|
width: 16px;
|
|
118
118
|
height: 16px;
|
|
119
119
|
color: ${e.colors.rarity};
|
|
@@ -135,7 +135,7 @@ import{r as y,j as t}from"./react-BMZSDQJw.js";import{R as z,a as oe,C as ie,c a
|
|
|
135
135
|
-webkit-appearance: none;
|
|
136
136
|
margin: 0;
|
|
137
137
|
}
|
|
138
|
-
`,
|
|
138
|
+
`,me=o.span`
|
|
139
139
|
padding-bottom: 12px;
|
|
140
140
|
color: ${e.colors.text};
|
|
141
141
|
font-family: ${e.font.sans};
|
|
@@ -196,23 +196,23 @@ import{r as y,j as t}from"./react-BMZSDQJw.js";import{R as z,a as oe,C as ie,c a
|
|
|
196
196
|
box-shadow: 0 1px 3px rgba(22, 21, 24, 0.25);
|
|
197
197
|
cursor: pointer;
|
|
198
198
|
}
|
|
199
|
-
|
|
199
|
+
`,ye=o.div`
|
|
200
200
|
display: flex;
|
|
201
201
|
align-items: center;
|
|
202
202
|
justify-content: space-between;
|
|
203
203
|
padding: 12px 4px 0;
|
|
204
|
-
`,
|
|
204
|
+
`,H=o.span`
|
|
205
205
|
display: inline-flex;
|
|
206
206
|
align-items: center;
|
|
207
207
|
gap: 2px;
|
|
208
208
|
font-family: ${e.font.sans};
|
|
209
209
|
font-size: 13px;
|
|
210
210
|
color: ${e.colors.text};
|
|
211
|
-
`,
|
|
211
|
+
`,D=o(u)`
|
|
212
212
|
width: 16px;
|
|
213
213
|
height: 16px;
|
|
214
214
|
color: ${e.colors.text};
|
|
215
|
-
|
|
215
|
+
`,$e=o.div`
|
|
216
216
|
display: flex;
|
|
217
217
|
flex-wrap: wrap;
|
|
218
218
|
gap: 12px;
|
|
@@ -245,7 +245,7 @@ import{r as y,j as t}from"./react-BMZSDQJw.js";import{R as z,a as oe,C as ie,c a
|
|
|
245
245
|
border-radius: 4px;
|
|
246
246
|
background: ${({color:i})=>i};
|
|
247
247
|
flex: none;
|
|
248
|
-
`,ke=o(
|
|
248
|
+
`,ke=o(u)`
|
|
249
249
|
position: absolute;
|
|
250
250
|
inset: 0;
|
|
251
251
|
width: 16px;
|
|
@@ -300,7 +300,7 @@ import{r as y,j as t}from"./react-BMZSDQJw.js";import{R as z,a as oe,C as ie,c a
|
|
|
300
300
|
display: flex;
|
|
301
301
|
align-items: center;
|
|
302
302
|
gap: 6px;
|
|
303
|
-
`,Pe=o(
|
|
303
|
+
`,Pe=o(u)`
|
|
304
304
|
width: 14px;
|
|
305
305
|
height: 14px;
|
|
306
306
|
color: ${e.colors.text};
|
|
@@ -322,7 +322,7 @@ import{r as y,j as t}from"./react-BMZSDQJw.js";import{R as z,a as oe,C as ie,c a
|
|
|
322
322
|
${e.media.down("lg")} {
|
|
323
323
|
font-size: 16px;
|
|
324
324
|
}
|
|
325
|
-
`,Ie=o(
|
|
325
|
+
`,Ie=o(u)`
|
|
326
326
|
width: 12px;
|
|
327
327
|
height: 12px;
|
|
328
328
|
color: ${e.colors.muted2};
|
|
@@ -350,7 +350,7 @@ import{r as y,j as t}from"./react-BMZSDQJw.js";import{R as z,a as oe,C as ie,c a
|
|
|
350
350
|
width: 40px;
|
|
351
351
|
height: 22px;
|
|
352
352
|
}
|
|
353
|
-
`,
|
|
353
|
+
`,He=o("span",c("on"))`
|
|
354
354
|
position: absolute;
|
|
355
355
|
top: 50%;
|
|
356
356
|
left: ${({on:i})=>i?"calc(100% - 12px)":"0px"};
|
|
@@ -367,7 +367,7 @@ import{r as y,j as t}from"./react-BMZSDQJw.js";import{R as z,a as oe,C as ie,c a
|
|
|
367
367
|
height: 18px;
|
|
368
368
|
left: ${({on:i})=>i?"calc(100% - 18px)":"2px"};
|
|
369
369
|
}
|
|
370
|
-
`,d=1e5;function
|
|
370
|
+
`,d=1e5;function De(i){var l;for(const h of ie){const p=(l=h.subs)==null?void 0:l.find(r=>r.key===i);if(p)return n(p.labelKey)}return i}function k({title:i,open:l,onToggle:h,summary:p,desktopStatic:r,headerTestId:x,headerAria:m,children:f}){const g=t.jsx(se,{up:l,size:24,color:"var(--text)"});return t.jsxs(le,{children:[t.jsxs(ce,{type:"button",desktopStatic:r,onClick:h,"aria-expanded":l,"aria-label":m,"data-testid":x,children:[t.jsx(de,{children:i}),r?t.jsx(pe,{children:g}):g]}),!l&&p?t.jsx(xe,{desktopHidden:r,children:p}):null,t.jsx(he,{open:l,desktopStatic:r,children:t.jsx(ge,{children:f})})]})}function Ye({category:i,subCategory:l,onCategory:h,onSub:p,priceMin:r,priceMax:x,onPriceMin:m,onPriceMax:f,rarities:g,onToggleRarity:E,status:S,onStatus:_,smart:b,onSmart:L}){const[M,O]=$.useState(!0),[Y,B]=$.useState(!0),[K,W]=$.useState(!1),[G,U]=$.useState(!0),R=r&&!Number.isNaN(Number(r))?Number(r):void 0,C=x&&!Number.isNaN(Number(x))?Number(x):void 0,w=R!=null?Math.min(R,d):0,y=C!=null?Math.min(C,d):d,V=w/d*100,X=y/d*100;function q(s){const a=Math.min(s,y);m(a<=0?"":String(a))}function J(s){const a=Math.max(s,w);f(a>=d?"":String(a))}const Q=l?De(l):i!=="wearable"?n(`categories.${i==="emote"?"emotes":i==="all"?"shopAll":i}`):"",Z=R!=null||C!=null?`${r||"0"}-${x||"∞"}`:"",ee=z.filter(s=>g.includes(s)).map(re).join(", "),te=S==="on_sale"?n("filter.onSale"):S==="not_for_sale"?n("filter.notForSale"):"";return t.jsxs(ae,{children:[t.jsx(k,{title:n("assets.category"),open:M,onToggle:()=>O(s=>!s),summary:Q,desktopStatic:!0,children:t.jsx(oe,{category:i,subCategory:l,onCategory:h,onSub:p})}),t.jsx(j,{}),t.jsxs(k,{title:n("filter.price"),open:Y,onToggle:()=>B(s=>!s),summary:Z,desktopStatic:!0,children:[t.jsxs(ue,{children:[t.jsxs(T,{children:[t.jsx(N,{children:n("assets.min")}),t.jsxs(P,{children:[t.jsx(F,{name:v.iconName,"aria-hidden":!0}),t.jsx(I,{type:"number",min:"0","aria-label":n("assets.minPriceAria"),placeholder:"0",value:r,onChange:s=>m(s.target.value)})]})]}),t.jsx(me,{children:n("assets.priceTo")}),t.jsxs(T,{children:[t.jsx(N,{children:n("assets.max")}),t.jsxs(P,{children:[t.jsx(F,{name:v.iconName,"aria-hidden":!0}),t.jsx(I,{type:"number",min:"0","aria-label":n("assets.maxPriceAria"),placeholder:"0",value:x,onChange:s=>f(s.target.value)})]})]})]}),t.jsxs(fe,{children:[t.jsx(be,{"aria-hidden":!0}),t.jsx(we,{minPct:V,maxPct:X,"aria-hidden":!0}),t.jsx(A,{type:"range",min:0,max:d,value:w,"aria-label":n("assets.minPriceSliderAria"),onChange:s=>q(Number(s.target.value))}),t.jsx(A,{type:"range",min:0,max:d,value:y,"aria-label":n("assets.maxPriceSliderAria"),onChange:s=>J(Number(s.target.value))})]}),t.jsxs(ye,{children:[t.jsxs(H,{children:[t.jsx(D,{name:v.iconName,"aria-hidden":!0}),w.toLocaleString()]}),t.jsxs(H,{children:[t.jsx(D,{name:v.iconName,"aria-hidden":!0}),y.toLocaleString()]})]})]}),t.jsx(j,{}),t.jsx(k,{title:n("assets.rarity"),open:K,onToggle:()=>W(s=>!s),summary:ee,headerTestId:"sidebar-section-toggle",children:t.jsx($e,{"data-testid":"rarity-filter",children:z.map(s=>{const a=g.includes(s);return t.jsxs(ve,{type:"button",selected:a,"aria-pressed":a,onClick:()=>E(s),"data-testid":"rarity-filter-check",children:[t.jsx(je,{color:e.rarities[s],children:a?t.jsx(ke,{name:"check","aria-hidden":!0}):null}),t.jsx(Se,{selected:a,children:s})]},s)})})}),t.jsx(j,{}),t.jsx(k,{title:n("filter.status"),open:G,onToggle:()=>U(s=>!s),summary:te,children:[["all",n("filter.statusAll")],["on_sale",n("filter.onSale")],["not_for_sale",n("filter.notForSale")]].map(([s,a])=>t.jsxs(Re,{children:[t.jsx(Ce,{type:"radio",name:"shop-status",checked:S===s,onChange:()=>_(s)}),t.jsx(ze,{children:a})]},s))}),t.jsx(j,{}),t.jsxs(Te,{children:[t.jsxs(Ne,{children:[t.jsx(Pe,{name:"smart","aria-hidden":!0}),t.jsx(Fe,{children:n("filter.smart")}),t.jsx(ne,{content:n("filter.smartHint"),placement:"bottom",children:t.jsx(Ie,{name:"info",role:"img","aria-label":n("filter.smartHint"),tabIndex:0})})]}),t.jsx(Ae,{type:"button",role:"switch",on:b,"aria-checked":b,"aria-label":n("filter.smart"),onClick:()=>L(!b),children:t.jsx(He,{on:b})})]})]})}const Be=o.div`
|
|
371
371
|
position: relative;
|
|
372
372
|
display: flex;
|
|
373
373
|
gap: 32px;
|
|
@@ -401,19 +401,33 @@ import{r as y,j as t}from"./react-BMZSDQJw.js";import{R as z,a as oe,C as ie,c a
|
|
|
401
401
|
max-height: calc(100vh - 158px - 24px);
|
|
402
402
|
overflow-y: auto;
|
|
403
403
|
overscroll-behavior: contain;
|
|
404
|
+
/* Reserve the scrollbar gutter so revealing the bar on hover doesn't shift the filter content. */
|
|
405
|
+
scrollbar-gutter: stable;
|
|
404
406
|
|
|
405
|
-
/*
|
|
406
|
-
|
|
407
|
-
|
|
407
|
+
/* Hover-only scrollbar: hidden while the catalog scrolls, revealed only when the cursor is over the
|
|
408
|
+
filters column (so a subtle bar appears just as you try to scroll within it). Stays scrollable
|
|
409
|
+
throughout — only the bar's visibility changes. Matches the subtle cart-list treatment (cart.css). */
|
|
410
|
+
scrollbar-width: none;
|
|
411
|
+
scrollbar-color: transparent transparent;
|
|
412
|
+
transition: scrollbar-color 0.2s ease;
|
|
408
413
|
&::-webkit-scrollbar {
|
|
409
|
-
width:
|
|
414
|
+
width: 8px;
|
|
410
415
|
}
|
|
411
416
|
&::-webkit-scrollbar-track {
|
|
412
417
|
background: transparent;
|
|
413
418
|
}
|
|
414
419
|
&::-webkit-scrollbar-thumb {
|
|
415
|
-
background:
|
|
420
|
+
background: transparent;
|
|
416
421
|
border-radius: 8px;
|
|
422
|
+
transition: background 0.2s ease;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
&:hover {
|
|
426
|
+
scrollbar-width: thin;
|
|
427
|
+
scrollbar-color: ${e.colors.muted2} transparent;
|
|
428
|
+
}
|
|
429
|
+
&:hover::-webkit-scrollbar-thumb {
|
|
430
|
+
background: ${e.colors.muted2};
|
|
417
431
|
}
|
|
418
432
|
}
|
|
419
433
|
|
|
@@ -530,4 +544,4 @@ import{r as y,j as t}from"./react-BMZSDQJw.js";import{R as z,a as oe,C as ie,c a
|
|
|
530
544
|
outline: 2px solid ${e.colors.accent};
|
|
531
545
|
outline-offset: 2px;
|
|
532
546
|
}
|
|
533
|
-
`;export{qe as C,j as D,k as F,Ke as M
|
|
547
|
+
`;export{qe as C,j as D,k as F,Ke as M,$e as R,Re as S,ve as a,je as b,ke as c,Se as d,Ce as e,ze as f,Be as g,Ue as h,We as i,Ve as j,Xe as k,Ge as l,Je as m,Qe as n,Ye as o};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{j as e,r as j,u as Se,b as qe,L as Z}from"./react-BMZSDQJw.js";import{t as a,l as I,al as W,u as Le,aj as C,a as ie,g as Ie,e as Te,h as Pe,j as Ee,I as E,am as Be,q as J,an as de,ao as Fe,x as R,s as Ae,B as Re,c as We,C as Ue,o as ze,k as ue,ap as $e,v as he,r as Qe,aq as Ke}from"./index-
|
|
1
|
+
import{j as e,r as j,u as Se,b as qe,L as Z}from"./react-BMZSDQJw.js";import{t as a,l as I,al as W,u as Le,aj as C,a as ie,g as Ie,e as Te,h as Pe,j as Ee,I as E,am as Be,q as J,an as de,ao as Fe,x as R,s as Ae,B as Re,c as We,C as Ue,o as ze,k as ue,ap as $e,v as he,r as Qe,aq as Ke}from"./index-B8IbHKn5.js";import{s as Oe}from"./wallet-kind-D0r-Cmku.js";import{a as me}from"./buy-DcrAdUpx.js";import{g as Ge,a as Je,w as De,S as He,G as Ve}from"./buy-gasless-b-y-A9B0.js";import{R as D,r as Ye}from"./cart-checkout-DAncfmAA.js";import{u as Xe,c as Ze}from"./useCreditPacks-Z0vJvkTc.js";import{l as es}from"./loader-logo-BzY9EKdC.js";import{i as ss,a as as}from"./errors-DGvmy-zZ.js";import{E as ts}from"./ErrorNotice-DDr3KjIH.js";import{C as cs}from"./CollectionCarousel-BaRGhi3w.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-8SzFotJj.js";import"./ethers-CeDRuWE-.js";import"./intl-CBcMB1D2.js";import"./index-HN6Rk25C.js";const rs="https://cdn.decentraland.org/@dcl/shop/0.1.0-29934929940.commit-6d4a894/assets/buy-error-22UunaPC.png";function ns(t){const{phase:r,balanceCredits:u,onClose:l}=t,_=r==="processing",w=r!=="complete",M=r==="error"?a("cartCheckout.errorTitle"):r==="nofunds"?a("cartCheckout.titleNoFunds"):a("cartCheckout.titleBuy"),g=r==="processing";return e.jsxs("div",{className:"buy-modal",role:"dialog","aria-modal":"true","aria-label":a("cartCheckout.dialogAria"),children:[e.jsx("div",{className:"buy-modal__scrim",onClick:_?void 0:l,"aria-hidden":!0}),e.jsxs("div",{className:`buy-modal__card${g?" buy-modal__card--tall":""}`,children:[w&&e.jsxs("div",{className:"buy-modal__head",children:[e.jsxs("div",{className:"buy-modal__head-row",children:[e.jsx("h2",{className:"buy-modal__title",children:M}),!_&&e.jsx("button",{className:"buy-modal__x",onClick:l,"aria-label":a("buyModal.close"),children:e.jsx("svg",{viewBox:"0 0 18 18",width:"18",height:"18","aria-hidden":!0,children:e.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#161518",strokeWidth:"1.8",strokeLinecap:"round"})})})]}),e.jsxs("div",{className:"buy-modal__balance",children:[e.jsx("span",{className:"buy-modal__balance-label",children:r==="nofunds"?a("buyModal.dclBalance"):a("buyModal.myCreditsBalance")}),e.jsx(I,{className:"buy-modal__balance-ico"}),e.jsx("span",{className:"buy-modal__balance-value",children:W(u)})]})]}),r==="processing"&&e.jsx(os,{stage:t.stage??"reserving",step:t.step??1,total:t.total??1,isSelfCustody:!!t.isSelfCustody}),r==="nofunds"&&e.jsx(ls,{lines:t.lines??[],shortfallCredits:t.shortfallCredits??0,packs:t.packs??[],selectedPack:t.selectedPack??"",onSelectPack:t.onSelectPack??(()=>{}),onBuyPacks:t.onBuyPacks??(()=>{}),onCancel:l}),r==="complete"&&e.jsx(is,{purchased:t.purchased??[],onMyAssets:t.onMyAssets??l,onTryInWorld:t.onTryInWorld??l}),r==="error"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-error",children:[e.jsx("img",{className:"buy-error__art",src:rs,alt:"",width:64,height:80}),e.jsxs("p",{className:"buy-error__text",children:[e.jsx("b",{children:a("cartCheckout.errorHeadline")})," ",a("cartCheckout.errorBody")]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:l,children:a("buyModal.cancel")}),e.jsx("button",{className:"buy-modal__btn buy-modal__btn--purple",onClick:t.onRetry??l,children:a("cartCheckout.tryAgain")})]})]})]})]})}function os({stage:t,step:r,total:u,isSelfCustody:l}){const _=t==="reserving",w=u>0?Math.min(100,Math.round(r/u*100)):0,M=t==="awaiting-signature"?l?a("buyModal.confirmToContinue"):a("buyModal.completingTransaction"):t==="settling"?a("buyModal.completingTransaction"):a("cartCheckout.preparing");return e.jsxs("div",{className:"buy-modal__body buy-modal__processing",children:[e.jsx("img",{className:"buy-modal__logo",src:es,alt:"",width:61,height:61}),e.jsx("div",{className:"buy-modal__processing-text",children:M}),_?e.jsxs("div",{className:"cart-checkout__progress-row",children:[e.jsx("div",{className:"buy-modal__progress","aria-hidden":!0,children:e.jsx("span",{className:"buy-modal__progress-fill buy-modal__progress-fill--step",style:{width:`${w}%`}})}),u>1?e.jsxs("span",{className:"cart-checkout__step",children:[r,"/",u]}):null]}):e.jsx("div",{className:"buy-modal__progress","aria-hidden":!0,children:e.jsx("span",{className:"buy-modal__progress-fill"})})]})}function ls({lines:t,shortfallCredits:r,packs:u,selectedPack:l,onSelectPack:_,onBuyPacks:w,onCancel:M}){const g=u.find(c=>c.id===l),H=t.reduce((c,y)=>c+(y.quantity??1),0);return e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-modal__warning",children:[e.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":!0,className:"buy-modal__warning-ico",children:[e.jsx("path",{d:"M12 3L2 20h20L12 3z",fill:"none",stroke:"#691fa9",strokeWidth:"1.8",strokeLinejoin:"round"}),e.jsx("path",{d:"M12 9v5",stroke:"#691fa9",strokeWidth:"1.8",strokeLinecap:"round"}),e.jsx("circle",{cx:"12",cy:"17",r:"1.1",fill:"#691fa9"})]}),e.jsxs("p",{className:"buy-modal__warning-text",children:[e.jsx("b",{children:a("buyModal.insufficientFunds")})," ",a("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:a("buyModal.warningCreditsAmount",{count:Math.max(0,r)})})," ",a("buyModal.warningToPurchase",{count:H})]})]}),e.jsx("div",{className:"cart-checkout__scroll",children:t.map(c=>{const y=c.quantity??1;return e.jsxs("div",{className:"buy-modal__asset",children:[e.jsx("div",{className:"buy-modal__asset-thumb",children:c.item.thumbnail?e.jsx("img",{src:c.item.thumbnail,alt:""}):null}),e.jsxs("div",{className:"buy-modal__asset-info",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"buy-modal__asset-name",title:c.item.name,children:[c.item.name||a("buyModal.itemFallback"),y>1?e.jsx("span",{className:"cart-checkout__qty-tag",children:a("cartCheckout.qty",{count:y})}):null]}),c.item.creator?e.jsx("div",{className:"buy-modal__asset-creator",children:a("search.byCreator",{name:c.item.creator})}):null]}),e.jsxs("div",{className:"buy-modal__asset-price",children:[e.jsx(I,{className:"buy-modal__asset-price-ico"}),e.jsx("span",{children:W(c.priceCredits*y)})]})]})]},c.item.id)})}),e.jsx("div",{className:"buy-modal__packs",children:u.map(c=>{const y=c.id===l;return e.jsxs("button",{className:`buy-modal__pack${y?" buy-modal__pack--on":""}`,onClick:()=>_(c.id),children:[e.jsx(I,{className:"buy-modal__pack-ico"}),e.jsx("span",{className:"buy-modal__pack-amount",children:W(c.credits)}),e.jsxs("span",{className:"buy-modal__pack-usd",children:["($",c.usd.toFixed(2),")"]})]},c.id)})}),e.jsxs("div",{className:"buy-modal__total",children:[e.jsxs("div",{className:"buy-modal__total-credits",children:[e.jsx(I,{className:"buy-modal__total-ico"}),e.jsx("span",{children:W((g==null?void 0:g.credits)??0)})]}),e.jsxs("span",{className:"buy-modal__total-usd",children:["$",((g==null?void 0:g.usd)??0).toFixed(2)]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:M,children:a("buyModal.cancel")}),e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient",onClick:w,children:a("buyModal.buy")})]})]})}function is({purchased:t,onMyAssets:r,onTryInWorld:u}){return e.jsxs("div",{className:"buy-modal__body cart-checkout__done-body",children:[e.jsxs("div",{className:"buy-modal__success",children:[e.jsxs("svg",{viewBox:"0 0 64 64",width:"60",height:"60","aria-hidden":!0,children:[e.jsx("circle",{cx:"32",cy:"32",r:"32",fill:"#34ce77"}),e.jsx("path",{d:"M20 33l8 8 16-18",fill:"none",stroke:"#fff",strokeWidth:"5",strokeLinecap:"round",strokeLinejoin:"round"})]}),e.jsxs("p",{className:"buy-modal__success-text",children:[e.jsx("b",{children:a("getCredits.successTitle")})," ",a("buyModal.successBody")]})]}),e.jsx("div",{className:"cart-checkout__done",children:e.jsx("div",{className:"cart-checkout__done-scroll",children:t.map(l=>{const _=l.quantity??1;return e.jsxs("div",{className:"cart-checkout__done-row",children:[e.jsxs("div",{className:"cart-checkout__done-thumb",children:[l.thumbnail?e.jsx("img",{src:l.thumbnail,alt:""}):null,e.jsx("span",{className:"cart-checkout__done-check","aria-hidden":!0,children:e.jsx("svg",{viewBox:"0 0 18 18",width:"12",height:"12",children:e.jsx("path",{d:"M4 9l3.5 3.5L14 5",fill:"none",stroke:"#fff",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),e.jsxs("div",{className:"cart-checkout__done-info",children:[e.jsxs("div",{className:"cart-checkout__done-name",title:l.name,children:[l.name||a("buyModal.itemFallback"),_>1?e.jsx("span",{className:"cart-checkout__qty-tag",children:a("cartCheckout.qty",{count:_})}):null]}),l.creator?e.jsx("div",{className:"cart-checkout__done-creator",children:a("search.byCreator",{name:l.creator})}):null]}),e.jsxs("div",{className:"cart-checkout__done-price",children:[e.jsx(I,{className:"cart-checkout__done-price-ico"}),e.jsx("span",{children:W(l.priceCredits*_)})]})]},l.id)})})}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:r,children:a("buyModal.myAssets")}),e.jsxs("button",{className:"buy-modal__btn buy-modal__btn--ruby",onClick:u,children:[a("buyModal.tryInWorld"),e.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20","aria-hidden":!0,children:e.jsx("path",{d:"M5 12h12M13 7l5 5-5 5",fill:"none",stroke:"#fcfcfc",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})]})]})}const ds=Ae(Re)`
|
|
2
2
|
margin-top: 12px;
|
|
3
3
|
`;function _e(t){if(ss(t))return a("errors.rejected");const r=(t.message??"").toLowerCase();return r.includes("insufficient")?a("cart.error.insufficient",{currency:Ue.name}):r.includes("no active listing")||r.includes("your own listing")?a("cart.error.listingChanged"):a("marketCheckout.error.generic")}const us=12e4,hs=We.chainId===80002?"https://decentraland.zone/jump":"https://decentraland.org/jump";function ms(t){const r=[];return t.unavailable.length&&r.push(a("cart.drop.unavailable",{count:t.unavailable.length})),t.own.length&&r.push(a("cart.drop.own",{count:t.own.length})),a("cart.drop.removed",{items:r.join(` ${a("cart.drop.and")} `)})}const ye=t=>t.reduce((r,u)=>r+u.priceCredits*u.quantity,0),_s=t=>t.flatMap(r=>Array.from({length:r.quantity},()=>({...r,quantity:1})));function Is(){Le({title:a("nav.cart"),noindex:!0});const t=C(s=>s.items),r=C(s=>s.remove),u=C(s=>s.increment),l=C(s=>s.decrement),_=C(s=>s.clear),w=C(s=>s.restore),M=C(s=>s.setFittingOpen),g=ie(s=>s.items),H=ie(s=>s.toggle),{session:c}=Ie(),y=Xe().packs.slice(0,3);j.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const pe=t.some(s=>s.category!=="emote"),{data:V}=Te({queryKey:["upsell-listings"],queryFn:()=>Ke({first:40}),staleTime:6e4}),{data:B}=Pe(c),U=Ee(),z=Se(),{state:T}=qe(),[ee,F]=j.useState(null),[be,S]=j.useState(null),[se,$]=j.useState(null),[xe,P]=j.useState(!1),[k,A]=j.useState(null),ae=j.useRef(0),[i,v]=j.useState(null),[Y,te]=j.useState(""),je=t.reduce((s,n)=>s+n.priceCredits*n.quantity,0),ce=t.reduce((s,n)=>s+n.quantity,0),ge=k?k.liveTotalCredits:je,ke=new Set(t.map(s=>s.id)),re=((V==null?void 0:V.items)??[]).filter(s=>!ke.has(s.id)).slice(0,12),fe=new Map(k==null?void 0:k.buyable.map(s=>[s.item.id,s])),Q=(B==null?void 0:B.credits)??0,ve=Fe;function K(s){s(),A(null),$(null),S(null)}function Ne(){v(null),P(!1)}function ne(s){const n=ye(s),o=Math.max(0,n-Q),b=y.find(h=>h.credits>=o)??y[y.length-1];te(b.id),J("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:n,credits_balance:Q,shortfall:o}),v({phase:"nofunds",lines:s.map(h=>({item:h.item,priceCredits:h.priceCredits,quantity:h.quantity})),shortfall:o}),P(!1)}async function Ce(s){if(!c||s.length===0)return;const n=_s(s),o=n.map(d=>({...d.item,priceCredits:d.priceCredits})),b=s.map(d=>({...d.item,priceCredits:d.priceCredits,quantity:d.quantity})),h=[];let N="authorize",G=!1;v({phase:"processing",stage:"reserving",step:1,total:n.length});try{const d=[];for(let m=0;m<n.length;m++){const L=n[m];v({phase:"processing",stage:"reserving",step:m+1,total:n.length});try{const{credit:p,maxCreditedValue:X}=await ze(c.identity,L.usdCents,L.trade.id);h.push(p.id),d.push({trade:L.trade,credits:[p],maxCreditedValue:X})}catch(p){if(as(p)){if(h.length){try{await ue(c.identity,h)}catch(X){R(X,{flow:"cart_checkout",step:"release"})}U.invalidateQueries({queryKey:["usd-balance"]})}ne(s);return}throw p}}N="submit";const x=()=>v({phase:"processing",stage:"settling",step:n.length,total:n.length});v({phase:"processing",stage:"awaiting-signature",step:n.length,total:n.length});let f=[];if(Ge())try{f=await Je({purchases:d,buyer:c.address,signer:c.signer,onSigned:x});const L=(await Promise.allSettled(f.map(p=>De(p)))).flatMap(p=>p.status==="rejected"?[p.reason]:[]);if(L.length&&!L.some(p=>p instanceof He))throw L[0];G=!0}catch(m){if(!(m instanceof Ve))throw m;f=await me({purchases:d,buyer:c.address,signer:c.signer,onSigned:x})}else f=await me({purchases:d,buyer:c.address,signer:c.signer});s.forEach(m=>r(m.item.id)),A(null),J("Shop Completed Purchase",{...$e(o),payment_type:"credits",no_crypto_step:G,transaction_hash:f[0]??null}),U.invalidateQueries({queryKey:["usd-balance"]}),v({phase:"complete",purchased:b})}catch(d){if(he(d)||R(d,{flow:"cart_checkout",step:N,cart_size:s.length}),J(he(d)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:N,error_code:Qe(d),value_usd:de(o.reduce((x,f)=>x+f.priceCredits,0)),cart_size:n.length}),h.length){try{await ue(c.identity,h)}catch(x){R(x,{flow:"cart_checkout",step:"release"})}U.invalidateQueries({queryKey:["usd-balance"]})}v({phase:"error",message:_e(d)})}}function oe(s){const n=ye(s);if(B!=null&&B.credits<n){ne(s);return}Ce(s)}async function O(){if(!c){S(a("buyModal.signInToCheckout"));return}const s=C.getState().items;if(s.length===0)return;S(null),$(null),P(!0);const n=s.reduce((o,b)=>o+b.priceCredits*b.quantity,0);J("Shop Started Checkout",{cart_size:s.length,cart_value_credits:n,cart_value_usd:de(n),has_sufficient_credits:Q>=n});try{F(a("cart.status.reviewing"));const o=await Ye(s,c.address,ve),b=[...o.unavailable,...o.own];if(b.length&&(b.forEach(h=>r(h.id)),$(ms(o))),o.buyable.length===0){S(a("cart.error.noneAvailable")),A(null),F(null);return}if(o.orderChanged){A(o),ae.current=Date.now(),F(null);return}F(null),oe(o.buyable)}catch(o){R(o,{flow:"cart_checkout",step:"review",cart_size:s.length}),S(_e(o)),F(null)}finally{P(!1)}}async function we(){if(k){if(!c){S(a("buyModal.signInToCheckout"));return}if(Date.now()-ae.current>us){A(null),$(null),await O();return}S(null),oe(k.buyable)}}async function Me(){if(Y){try{sessionStorage.setItem(D,JSON.stringify(C.getState().items))}catch{}P(!0);try{const s=await Ze(Y,c?{address:c.address,identity:c.identity}:void 0);if(s.url){window.location.href=s.url;return}z("/credits")}catch(s){try{sessionStorage.removeItem(D)}catch{}R(s,{flow:"cart_buy_credits"}),v({phase:"error",message:a("buyModal.error.creditsCheckout")})}finally{P(!1)}}}const le=j.useRef(!1);j.useEffect(()=>{if(!(T!=null&&T.resumeCheckout)||le.current)return;le.current=!0;try{const n=sessionStorage.getItem(D);if(n){sessionStorage.removeItem(D);const o=JSON.parse(n);Array.isArray(o)&&o.length&&w(o)}}catch{}U.invalidateQueries({queryKey:["usd-balance"]});const s=setTimeout(()=>void O(),0);return()=>clearTimeout(s)},[T==null?void 0:T.resumeCheckout]);const q=xe||(i==null?void 0:i.phase)==="processing";return t.length===0&&!i?e.jsxs("div",{className:"cart cart--empty",children:[e.jsx(E,{name:"cart",size:44,color:"var(--muted-2)"}),e.jsx("p",{className:"cart-empty__title",children:a("cart.empty.title")}),e.jsx("p",{className:"muted",children:a("cart.empty.body")}),e.jsx(ds,{as:Z,to:"/assets",variant:"purple",children:a("cart.empty.cta")})]}):e.jsxs("div",{className:"checkout",children:[e.jsxs("div",{className:"checkout__top",children:[e.jsxs("button",{className:"checkout__back",onClick:()=>z(-1),type:"button",children:[e.jsx(E,{name:"arrow-left"}),a("nav.cart")]}),e.jsxs("div",{className:"checkout__body",children:[e.jsxs("div",{className:"checkout__left",children:[e.jsxs("div",{className:"checkout__head-card",children:[e.jsx("button",{className:"checkout__panel-back",onClick:()=>z(-1),type:"button","aria-label":a("cart.goBack"),children:e.jsx(E,{name:"arrow-left"})}),e.jsx("h1",{className:"checkout__panel-title",children:a("cart.panelTitle",{count:ce})}),pe?e.jsxs("button",{className:"checkout__fitting",onClick:()=>M(!0),disabled:q,children:[e.jsx(E,{name:"fitting-room"}),a("cart.fittingRoom")]}):null]}),e.jsxs("section",{className:"checkout__panel",children:[e.jsx("div",{className:"checkout__list",children:t.map(s=>{const n=fe.get(s.id),o=n?n.priceCredits:s.priceCredits,b=!!n&&n.priceCredits!==s.priceCredits,h=!s.tokenId,N=s.quantity,G=typeof s.available=="number"&&N>=s.available,d=o*N,x=!!g[s.id],f=s.tokenId??s.itemId,m=s.contractAddress&&f?`/item/${s.contractAddress}/${f}`:null;return e.jsxs("div",{className:"checkout__card",children:[e.jsxs("div",{className:"checkout__thumb",children:[m?e.jsx(Z,{className:"checkout__thumb-link",to:m,state:{item:s,tradeId:s.tradeId},"aria-label":s.name,children:s.thumbnail?e.jsx("img",{src:s.thumbnail,alt:s.name}):null}):s.thumbnail?e.jsx("img",{src:s.thumbnail,alt:s.name}):null,e.jsx("span",{className:"checkout__thumb-check","aria-hidden":!0,children:e.jsx("svg",{viewBox:"0 0 20 20",width:"12",height:"12",children:e.jsx("path",{d:"M5 10.5l3 3 7-7.5",fill:"none",stroke:"#fff",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),e.jsxs("div",{className:"checkout__info",children:[e.jsxs("div",{className:"checkout__desc",children:[m?e.jsx(Z,{className:"checkout__name",to:m,state:{item:s,tradeId:s.tradeId},title:s.name,children:s.name}):e.jsx("div",{className:"checkout__name",title:s.name,children:s.name}),s.creator?e.jsx(Be,{address:s.creator,className:"checkout__creator",linkToProfile:!0}):null]}),e.jsxs("div",{className:"checkout__foot",children:[h?e.jsxs("div",{className:"checkout__stepper",children:[e.jsx("button",{className:"checkout__step",onClick:()=>K(()=>l(s.id)),disabled:q||N<=1,"aria-label":a("cart.decreaseQuantity",{name:s.name}),children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:e.jsx("path",{d:"M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),e.jsx("span",{className:"checkout__qty",children:N}),e.jsx("button",{className:"checkout__step",onClick:()=>K(()=>u(s.id)),disabled:q||G,"aria-label":a("cart.increaseQuantity"),children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:e.jsx("path",{d:"M8 3.5v9M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}):null,e.jsxs("div",{className:"checkout__price",children:[e.jsx(I,{className:"checkout__price-ico"})," ",d,b?e.jsx("span",{className:"checkout__price-was",children:s.priceCredits*N}):null]})]})]}),e.jsxs("div",{className:"checkout__actions",children:[e.jsx("button",{className:`checkout__fav${x?" is-on":""}`,onClick:()=>H(s),"aria-label":x?a("cart.removeFromFavorites",{name:s.name}):a("cart.addToFavorites",{name:s.name}),title:x?a("assetCard.removeFromFavorites"):a("assetCard.addToFavorites"),children:e.jsx(E,{name:x?"heart-solid":"heart"})}),e.jsx("button",{className:"checkout__remove",onClick:()=>K(()=>r(s.id)),disabled:q,"aria-label":a("cart.remove",{name:s.name}),title:a("cart.removeTitle"),children:e.jsx(E,{name:"trash",size:24})})]})]},s.id)})}),e.jsx("div",{className:"checkout__utils",children:e.jsx("button",{className:"link",onClick:()=>K(_),disabled:q,children:a("cart.clearCart")})})]})]}),e.jsxs("aside",{className:"checkout__summary",children:[e.jsx("h2",{className:"checkout__summary-title",children:a("cart.purchaseSummary")}),e.jsxs("div",{className:"checkout__summary-body",children:[e.jsxs("div",{className:"checkout__total-line",children:[e.jsx("span",{className:"checkout__total-label",children:a("cart.totalItems",{count:ce})}),e.jsxs("span",{className:"checkout__total-value",children:[e.jsx(I,{className:"checkout__total-ico"})," ",ge]})]}),e.jsx("button",{className:"checkout__cta",onClick:()=>void(k?we():O()),disabled:q,children:q?a("cart.working"):k?a("marketCheckout.confirmPurchase"):a("assetCard.buyNow")}),k?e.jsx("p",{className:"muted checkout__msg",children:a("cart.priceChanged")}):null,se?e.jsx("p",{className:"muted checkout__msg",children:se}):null,ee?e.jsx("p",{className:"muted checkout__msg",children:ee}):null,e.jsx(ts,{message:be,className:"checkout__msg"})]})]})]})]}),re.length>0?e.jsx("div",{className:"cart-upsell",children:e.jsx(cs,{title:a("cart.youMightAlsoLike"),items:re})}):null,i?e.jsx(ns,{phase:i.phase,balanceCredits:Q,onClose:Ne,stage:i.phase==="processing"?i.stage:void 0,step:i.phase==="processing"?i.step:void 0,total:i.phase==="processing"?i.total:void 0,isSelfCustody:Oe(c==null?void 0:c.providerType),lines:i.phase==="nofunds"?i.lines:void 0,shortfallCredits:i.phase==="nofunds"?i.shortfall:void 0,packs:y,selectedPack:Y,onSelectPack:te,onBuyPacks:()=>void Me(),purchased:i.phase==="complete"?i.purchased:void 0,onMyAssets:()=>z("/assets?tab=mine"),onTryInWorld:()=>window.open(hs,"_blank","noopener"),message:i.phase==="error"?i.message:void 0,onRetry:()=>void O()}):null]})}export{Is as Cart};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{H as N,J as U,K as w,L as z,M as o,N as E,O as c,P as I,Q as g,R as D,S as M}from"./index-
|
|
1
|
+
import{H as N,J as U,K as w,L as z,M as o,N as E,O as c,P as I,Q as g,R as D,S as M}from"./index-B8IbHKn5.js";import{r as K,j as v}from"./react-BMZSDQJw.js";function F(r){return N("MuiCircularProgress",r)}U("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const L=["className","color","disableShrink","size","style","thickness","value","variant"];let l=r=>r,P,S,b,$;const t=44,W=M(P||(P=l`
|
|
2
2
|
0% {
|
|
3
3
|
transform: rotate(0deg);
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,r as p,d as Q,u as Y}from"./react-BMZSDQJw.js";import{y as N,s as v,ab as Z,I as J,t,c as V,x as W,e as X,u as ee,A as ae,at as te,C as re,au as se}from"./index-
|
|
1
|
+
import{j as e,r as p,d as Q,u as Y}from"./react-BMZSDQJw.js";import{y as N,s as v,ab as Z,I as J,t,c as V,x as W,e as X,u as ee,A as ae,at as te,C as re,au as se}from"./index-B8IbHKn5.js";import{E as oe}from"./ErrorNotice-DDr3KjIH.js";import{d as ie,g as ce,a as ne,A as le}from"./collection-ChguPkSb.js";import{u as de}from"./useStore-DuXZRHKD.js";import{s as E}from"./address-DrURAr9O.js";import{d as F,a as me,F as pe,e as ue,S as R,b as ge}from"./categories-BxHDtlRd.js";import{L as xe}from"./LoadMore-DEqrabJR.js";import{u as he}from"./useInfiniteGrid-CcAnLcIW.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-8SzFotJj.js";import"./ethers-CeDRuWE-.js";import"./intl-CBcMB1D2.js";import"./emotion-CSxEP8yM.js";const be=v.section`
|
|
2
2
|
position: relative;
|
|
3
3
|
border-radius: ${N.radius.card};
|
|
4
4
|
overflow: hidden;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,j as t}from"./react-BMZSDQJw.js";import{t as s,I as k,G as f,A as N}from"./index-
|
|
1
|
+
import{r as o,j as t}from"./react-BMZSDQJw.js";import{t as s,I as k,G as f,A as N}from"./index-B8IbHKn5.js";function L({title:v,items:a,onViewAll:i}){const r=o.useRef(null),[u,x]=o.useState(1),[d,g]=o.useState(0),[j,C]=o.useState(!0),[b,p]=o.useState(!1),c=o.useCallback(()=>{const l=r.current;if(!l)return;const{scrollLeft:e,scrollWidth:m,clientWidth:n}=l,_=Math.max(1,Math.ceil(m/n));x(_),g(Math.min(_-1,Math.round(e/n))),C(e<=1),p(e+n>=m-1)},[]);if(o.useEffect(()=>{c();const l=r.current;if(l)return l.addEventListener("scroll",c,{passive:!0}),window.addEventListener("resize",c),()=>{l.removeEventListener("scroll",c),window.removeEventListener("resize",c)}},[c,a.length]),a.length===0)return null;function h(l){const e=r.current;e&&e.scrollBy({left:l*e.clientWidth,behavior:"smooth"})}function w(l){const e=r.current;e&&e.scrollTo({left:l*e.clientWidth,behavior:"smooth"})}return t.jsxs("section",{className:"collection-carousel",children:[t.jsxs("div",{className:"collection-carousel__head",children:[t.jsx("h2",{className:"collection-carousel__title",children:v}),i?t.jsxs("button",{className:"collection-carousel__viewall",onClick:i,children:[s("collectionCarousel.viewAll"),t.jsx(k,{name:"chevron-down",size:16,className:"collection-carousel__viewall-ico"})]}):null]}),t.jsxs("div",{className:"collection-carousel__viewport",children:[t.jsx("button",{className:"collection-carousel__arrow collection-carousel__arrow--left",onClick:()=>h(-1),"aria-label":s("collectionCarousel.scrollLeft"),disabled:j,children:t.jsx("img",{src:f,alt:"","aria-hidden":!0})}),t.jsx("div",{className:"collection-carousel__track",ref:r,children:a.map(l=>t.jsx(N,{item:l},l.id))}),t.jsx("button",{className:"collection-carousel__arrow collection-carousel__arrow--right",onClick:()=>h(1),"aria-label":s("collectionCarousel.scrollRight"),disabled:b,children:t.jsx("img",{src:f,alt:"","aria-hidden":!0})})]}),u>1?t.jsx("div",{className:"collection-carousel__dots","aria-label":s("collectionCarousel.pages"),children:Array.from({length:u}).map((l,e)=>t.jsx("button",{className:`collection-carousel__dot${e===d?" is-active":""}`,"aria-label":s("collectionCarousel.goToPage",{page:e+1}),"aria-current":e===d?"true":void 0,onClick:()=>w(e)},e))}):null]})}export{L as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as K,j as e,L as re,d as se,a as te,r as j}from"./react-BMZSDQJw.js";import{av as oe,aw as ce,am as le,t as a,ax as E,B as ne,ab as D,g as ie,I,c as de,u as me,A as ue,aq as he,ay as ge,C as xe}from"./index-
|
|
1
|
+
import{u as K,j as e,L as re,d as se,a as te,r as j}from"./react-BMZSDQJw.js";import{av as oe,aw as ce,am as le,t as a,ax as E,B as ne,ab as D,g as ie,I,c as de,u as me,A as ue,aq as he,ay as ge,C as xe}from"./index-B8IbHKn5.js";import{d as _e,g as pe,a as Ne,A as je}from"./collection-ChguPkSb.js";import{u as be,L as fe}from"./useStore-DuXZRHKD.js";import{s as O}from"./address-DrURAr9O.js";import{d as $,a as ve,S as w,F as Ce,e as we,b as ke}from"./categories-BxHDtlRd.js";import{L as B}from"./LoadMore-DEqrabJR.js";import{u as R}from"./useInfiniteGrid-CcAnLcIW.js";import{E as T}from"./ErrorNotice-DDr3KjIH.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-8SzFotJj.js";import"./ethers-CeDRuWE-.js";import"./intl-CBcMB1D2.js";import"./emotion-CSxEP8yM.js";function Pe({collection:t,cover:r,itemCount:o}){const n=K(),{contractAddress:m,name:g,creator:x}=t,N=r==null||o==null,{data:i}=oe(m,N),p=r==null?(i==null?void 0:i.items)??[]:[],h=o??(i==null?void 0:i.total);function _(){n(`/collection/${m}`)}return e.jsxs("article",{className:"coll-card",role:"link",tabIndex:0,onClick:_,onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),_())},children:[e.jsx("div",{className:"coll-card__media",children:r?e.jsx("img",{className:"coll-card__img","data-testid":"coll-card-img",src:r,alt:"",loading:"lazy"}):p.length>0?e.jsx(ce,{items:p,className:"coll-card__cover"}):null}),e.jsxs("div",{className:"coll-card__body",children:[e.jsx("h3",{className:"coll-card__name",title:g,children:g}),e.jsxs("div",{className:"coll-card__meta",children:[x?e.jsx(le,{address:x,className:"coll-card__creator",linkToProfile:!0}):e.jsx("span",{className:"coll-card__creator",children:" "}),e.jsx("span",{className:"coll-card__count",children:h==null?"…":a("collectionCard.itemCount",{count:h})})]}),e.jsx("button",{className:"coll-card__view",onClick:d=>{d.stopPropagation(),_()},tabIndex:-1,children:a("collectionCard.viewCollection")})]})]})}function ye({address:t,className:r=""}){const o=E(m=>m.followed.includes(t.toLowerCase())),n=E(m=>m.toggle);return t?e.jsx(ne,{type:"button",size:"sm",variant:o?"ghost":"outline",className:r||void 0,"aria-pressed":o,title:o?a("creator.unfollowTitle"):a("creator.followTitle"),onClick:()=>n(t),children:o?a("creator.following"):a("creator.follow")}):null}const Se={website:"website",twitter:"twitter",discord:"discord",facebook:"facebook"};function Le({address:t}){var d,b;const{data:r}=D(t),{data:o}=be(t),n=ie(l=>{var f;return(f=l.session)==null?void 0:f.address}),m=!!n&&n.toLowerCase()===t.toLowerCase(),g=(r==null?void 0:r.name)||O(t),x=(b=(d=r==null?void 0:r.avatar)==null?void 0:d.snapshots)==null?void 0:b.face256,N=(o==null?void 0:o.cover)||_e,i=o==null?void 0:o.description,p=`${de.profileUrl}/${t}`,h=fe.filter(l=>o==null?void 0:o.links[l]),_=pe(Ne({name:r==null?void 0:r.name,hasClaimedName:r==null?void 0:r.hasClaimedName,ethAddress:(r==null?void 0:r.ethAddress)??t}));return e.jsxs("section",{className:"creator-hero","aria-label":`${g} storefront`,children:[e.jsxs("div",{className:"creator-hero__cover",children:[e.jsx("img",{className:"creator-hero__cover-img",src:N,alt:"",loading:"eager"}),e.jsx("div",{className:"creator-hero__scrim","aria-hidden":!0})]}),(h.length>0||m)&&e.jsxs("div",{className:"creator-hero__links",children:[h.map(l=>e.jsx("a",{className:"creator-hero__link","data-testid":"creator-hero-link",href:(o==null?void 0:o.links[l])??"",target:"_blank",rel:"noopener noreferrer",title:a(`creator.link.${l}`),"aria-label":a(`creator.link.${l}`),children:e.jsx(I,{name:Se[l]})},l)),m&&e.jsx(re,{className:"creator-hero__link creator-hero__edit",to:"/store-settings",title:a("creator.editStore"),"aria-label":a("creator.editStore"),children:e.jsx(I,{name:"pen"})})]}),e.jsxs("div",{className:"creator-hero__body",children:[x?e.jsx("img",{className:"creator-hero__ava",src:x,alt:"",loading:"eager",style:{backgroundColor:_}}):e.jsx("span",{className:"creator-hero__ava creator-hero__ava--ph","aria-hidden":!0,style:{backgroundColor:_}}),e.jsxs("div",{children:[e.jsx("h2",{className:"creator-hero__name",children:g}),i?e.jsx("p",{className:"creator-hero__desc",children:i}):null]}),e.jsxs("div",{className:"creator-hero__actions",children:[e.jsx("a",{className:"creator-hero__view","data-testid":"creator-hero-view",href:p,target:"_blank",rel:"noopener noreferrer",children:a("creator.viewProfile")}),e.jsx(ye,{address:t,className:"creator-hero__follow"})]})]})]})}const U=48;function Ge(){const{address:t}=se(),r=K(),[o]=te(),n=o.has("collections"),{data:m}=D(t),g=(m==null?void 0:m.name)||(t?O(t):a("creator.fallbackName"));me({title:g,description:a("seo.creator.description",{name:g})});const[x,N]=j.useState("wearable"),[i,p]=j.useState(null),[h,_]=j.useState([]),[d,b]=j.useState(""),[l,f]=j.useState(""),[P,z]=j.useState("newest"),y=d&&!Number.isNaN(Number(d))?Number(d):void 0,S=l&&!Number.isNaN(Number(l))?Number(l):void 0,G=i?ke[i]:void 0,H=($.find(s=>s.key===P)??$[0]).server,L={creator:t,category:x,rarities:h.length?h:void 0,wearableCategories:G,minPriceCredits:y,maxPriceCredits:S,sortBy:H},{items:v,total:Y,isLoading:C,error:A,hasNextPage:q,isFetchingNextPage:F,fetchNextPage:W}=R(["creator-listings",L],s=>he({...L,first:U,skip:s}),{enabled:!!t&&!n}),u=R(["creator-collections",t],s=>ge(t,{first:U,skip:s}).then(c=>({items:c.collections,total:c.total})),{enabled:!!t&&n});function Z(s){N(s),p(null),n&&M()}function M(){const s=new URLSearchParams(o);s.delete("collections");const c=s.toString();r({search:c?`?${c}`:""},{replace:!0})}function J(){if(n){M();return}const s=new URLSearchParams(o);s.delete("collections");const c=s.toString();r({search:c?`?${c}&collections`:"?collections"},{replace:!0})}function Q(s){_(c=>c.includes(s)?c.filter(ae=>ae!==s):[...c,s])}function V(){N("wearable"),p(null),_([]),b(""),f("")}const k=!!(y||S),X=k?`${d||"0"}–${l||"∞"}`:a("filter.price"),ee=x!=="wearable"||!!i||h.length>0||k;return e.jsxs("div",{className:"collection-page",children:[e.jsxs("nav",{className:"collection-page__crumbs","aria-label":a("creator.breadcrumbAria"),children:[e.jsx("button",{className:"collection-page__crumb-link",onClick:()=>r("/assets"),children:a("creator.breadcrumb")}),e.jsx("span",{className:"collection-page__crumb-sep",children:"/"}),e.jsx("span",{className:"collection-page__crumb-current",children:g})]}),t?e.jsx(Le,{address:t}):null,!n&&!C&&v.length>0?e.jsx(je,{items:v,source:"creator"}):null,e.jsxs("div",{className:"browse browse--sidebar",children:[e.jsx("aside",{className:"browse__sidebar",children:e.jsx(ve,{category:x,subCategory:i,onCategory:Z,onSub:p,title:a("creator.category"),flat:!0,collections:n,onCollections:J})}),e.jsx("div",{className:"browse__main",children:n?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"creator-collections__bar",children:e.jsx("span",{className:"assets__count",children:u.isLoading?"…":a("creator.collectionsCount",{count:u.total})})}),u.error?e.jsx(T,{message:a("creator.error")}):null,e.jsx("div",{className:"grid grid--collections",children:u.isLoading?e.jsx(w,{count:9}):e.jsxs(e.Fragment,{children:[u.items.map(s=>e.jsx(Pe,{collection:s,itemCount:s.itemCount},s.contractAddress)),u.isFetchingNextPage?e.jsx(w,{count:6}):null]})}),e.jsx(B,{hasNextPage:u.hasNextPage,isFetching:u.isFetchingNextPage,onLoadMore:()=>void u.fetchNextPage()}),!u.isLoading&&!u.error&&u.items.length===0?e.jsx("p",{className:"muted",children:a("creator.collectionsEmpty")}):null]}):e.jsxs(e.Fragment,{children:[e.jsx(Ce,{rarities:h,onToggleRarity:Q,sort:P,onSort:z,total:Y,loading:C,anyActive:ee,onClear:V,renderTrailing:s=>e.jsx(we,{panelKey:"price",label:X,active:k,panel:s,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":a("creator.priceMin"),placeholder:a("creator.priceMinPlaceholder"),value:d,onChange:c=>b(c.target.value)}),e.jsx("span",{children:"–"}),e.jsx("input",{type:"number",min:"0","aria-label":a("creator.priceMax"),placeholder:a("creator.priceMaxPlaceholder"),value:l,onChange:c=>f(c.target.value)})]}),e.jsx("p",{className:"filter-pop__hint",children:a("creator.priceHint",{currency:xe.name})})]})})}),A?e.jsx(T,{message:a("creator.error")}):null,e.jsx("div",{className:"grid",children:C?e.jsx(w,{count:15}):e.jsxs(e.Fragment,{children:[v.map(s=>e.jsx(ue,{item:s},s.id)),F?e.jsx(w,{count:6}):null]})}),e.jsx(B,{hasNextPage:q,isFetching:F,onLoadMore:()=>void W()}),!C&&!A&&v.length===0?e.jsx("p",{className:"muted",children:a("creator.empty")}):null]})})]})]})}export{Ge as Creator,Ge as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b9 as U,ba as Ue,M as C,bb as qe,bc as Ye,W as Qe,bd as Je,aY as Xe,L as R,b1 as K,b0 as Te,be as a,bf as Ze,bg as Le,T as et,b7 as tt}from"./index-
|
|
1
|
+
import{b9 as U,ba as Ue,M as C,bb as qe,bc as Ye,W as Qe,bd as Je,aY as Xe,L as R,b1 as K,b0 as Te,be as a,bf as Ze,bg as Le,T as et,b7 as tt}from"./index-B8IbHKn5.js";import{R as rt,g as ot}from"./getOverlayAlpha-DEiIzOVP.js";import{j as T,r as y}from"./react-BMZSDQJw.js";import{u as nt,a as Be}from"./useTheme-BaXPBxeY.js";function ne(r){const o=Ue(r);return r!==o&&o.styles?(o.styles.match(/^@layer\s+[^{]*$/)||(o.styles=`@layer global{${o.styles}}`),o):r}function at({styles:r,themeId:o,defaultTheme:n={}}){const i=nt(n),s=o&&i[o]||i;let l=typeof r=="function"?r(s):r;return s.modularCssLayers&&(Array.isArray(l)?l=l.map(d=>ne(typeof d=="function"?d(s):d)):l=ne(l)),T.jsx(U,{styles:l})}const Ee=y.createContext(null);function se(){return y.useContext(Ee)}const it=typeof Symbol=="function"&&Symbol.for,st=it?Symbol.for("mui.nested"):"__THEME_NESTED__";function lt(r,o){return typeof o=="function"?o(r):C({},r,o)}function ct(r){const{children:o,theme:n}=r,i=se(),s=y.useMemo(()=>{const l=i===null?n:lt(i,n);return l!=null&&(l[st]=i!==null),l},[n,i]);return T.jsx(Ee.Provider,{value:s,children:o})}function dt(r){const o=Be(),n=qe()||"",{modularCssLayers:i}=r;let s="mui.global, mui.components, mui.theme, mui.custom, mui.sx";return!i||o!==null?s="":typeof i=="string"?s=i.replace(/mui(?!\.)/g,s):s=`@layer ${s};`,Ye(()=>{const l=document.querySelector("head");if(!l)return;const d=l.firstChild;if(s){var m;if(d&&(m=d.hasAttribute)!=null&&m.call(d,"data-mui-layer-order")&&d.getAttribute("data-mui-layer-order")===n)return;const S=document.createElement("style");S.setAttribute("data-mui-layer-order",n),S.textContent=s,l.prepend(S)}else{var f;(f=l.querySelector(`style[data-mui-layer-order="${n}"]`))==null||f.remove()}},[s,n]),s?T.jsx(at,{styles:s}):null}const $e={};function xe(r,o,n,i=!1){return y.useMemo(()=>{const s=r&&o[r]||o;if(typeof n=="function"){const l=n(s),d=r?C({},o,{[r]:l}):l;return i?()=>d:d}return r?C({},o,{[r]:n}):C({},o,n)},[r,o,n,i])}function ut(r){const{children:o,theme:n,themeId:i}=r,s=Be($e),l=se()||$e,d=xe(i,s,n),m=xe(i,l,n,!0),f=d.direction==="rtl",S=dt(d);return T.jsx(ct,{theme:m,children:T.jsx(Qe.Provider,{value:d,children:T.jsx(rt,{value:f,children:T.jsxs(Je,{value:d==null?void 0:d.components,children:[S,o]})})})})}const le="mode",ce="color-scheme",Ie="data-color-scheme";function mt(r){const{defaultMode:o="light",defaultLightColorScheme:n="light",defaultDarkColorScheme:i="dark",modeStorageKey:s=le,colorSchemeStorageKey:l=ce,attribute:d=Ie,colorSchemeNode:m="document.documentElement",nonce:f}=r||{};return T.jsx("script",{suppressHydrationWarning:!0,nonce:typeof window>"u"?f:"",dangerouslySetInnerHTML:{__html:`(function() {
|
|
2
2
|
try {
|
|
3
3
|
var mode = localStorage.getItem('${s}') || '${o}';
|
|
4
4
|
var colorScheme = '';
|
|
@@ -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-
|
|
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-_Jupf0lQ.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-Csh4ZzC9.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 +1 @@
|
|
|
1
|
-
import{u as Y,a as $,r as i,j as e}from"./react-BMZSDQJw.js";import{u as H,t as s,g as Q,j as V,q as g,C as d,x as P,r as I,l as W,m as z}from"./index-
|
|
1
|
+
import{u as Y,a as $,r as i,j as e}from"./react-BMZSDQJw.js";import{u as H,t as s,g as Q,j as V,q as g,C as d,x as P,r as I,l as W,m as z}from"./index-B8IbHKn5.js";import{R as G}from"./resume-buy-Bf0zIH7y.js";import{R as D}from"./cart-checkout-DAncfmAA.js";import{l as J}from"./loader-logo-BzY9EKdC.js";import{u as Z,p as X,c as ee,i as se}from"./useCreditPacks-Z0vJvkTc.js";import{C as te}from"./CircularProgress-CHG6tLju.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-8SzFotJj.js";import"./ethers-CeDRuWE-.js";import"./intl-CBcMB1D2.js";const x="https://cdn.decentraland.org/@dcl/shop/0.1.0-29934929940.commit-6d4a894/assets/pack-chips--HnOpf5U.webp",re="https://cdn.decentraland.org/@dcl/shop/0.1.0-29934929940.commit-6d4a894/assets/credit-coin-CmcTCd5i.webp",ae="data:image/svg+xml,%3csvg%20width='60'%20height='60'%20viewBox='0%200%2060%2060'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='60'%20height='60'%20rx='30'%20fill='%2334CE77'/%3e%3cpath%20d='M21.6583%2046.1067L11.4656%2036.0591C10.1688%2034.829%2010.1905%2032.7207%2011.4769%2031.4622L13.6868%2029.3591C14.9732%2028.1006%2017.1615%2028.1058%2018.4582%2029.3359L23.8747%2034.6197L41.9704%2015.6527C43.2568%2014.3942%2045.4291%2014.2093%2046.7258%2015.4394L48.8765%2017.3628C50.1732%2018.5929%2050.3491%2020.6844%2049.0626%2021.9429L26.6112%2045.8766C25.1433%2047.342%2022.955%2047.3368%2021.6583%2046.1067Z'%20fill='%23FCFCFC'/%3e%3c/svg%3e",C=se()?"mock":"stripe",ce={pack_5:x,pack_10:x,pack_25:x,pack_50:x},ne="https://docs.decentraland.org";function M(o){const r=o;if((r==null?void 0:r.name)==="AbortError")return s("getCredits.errorCanceled");const m=((r==null?void 0:r.message)??"").toLowerCase();return m.includes("sign in")?s("getCredits.errorSignIn",{currency:d.name}):m.includes("timed out")?s("getCredits.errorTimeout",{currency:d.name}):s("getCredits.errorGeneric")}function je(){H({title:s("nav.getCredits",{currency:d.name}),noindex:!0});const o=Y(),{session:r,signIn:m}=Q(),n=V(),[k,S]=$(),{packs:F,isLoading:T}=Z(),[p,l]=i.useState("select"),[c,w]=i.useState(null),[E,R]=i.useState(null),[U,_]=i.useState(null),[K,N]=i.useState(!1),f=i.useRef(null);i.useEffect(()=>()=>{var t;return(t=f.current)==null?void 0:t.abort()},[]);const L=i.useCallback(()=>{S(t=>{const a=new URLSearchParams(t);return a.delete("order"),a.delete("canceled"),a},{replace:!0})},[S]),b=i.useCallback(async t=>{l("processing");const a=new AbortController;f.current=a;try{const u=await X(t,{signal:a.signal,address:r==null?void 0:r.address,identity:r==null?void 0:r.identity});if(u.status==="credited"){const j=u.creditsGranted??(c==null?void 0:c.credits)??0;R(j>0?j:null),l("success"),g("Shop Completed Buy Credits",{order_id:t,pack_usd:(c==null?void 0:c.usd)??null,credits:j>0?j:null,provider:C}),n.invalidateQueries({queryKey:["usd-balance"]});try{if(sessionStorage.getItem(D)){o("/cart",{state:{resumeCheckout:!0}});return}}catch{}try{const A=sessionStorage.getItem(G);if(A){sessionStorage.removeItem(G);const h=JSON.parse(A),B=h.tokenId??h.itemId;if(h.contractAddress&&B){o(`/item/${h.contractAddress}/${B}`,{state:{item:h,resumeBuy:!0}});return}}}catch{}}else u.status==="pending"?(g("Shop Buy Credits Pending",{step:"grant",pack_usd:(c==null?void 0:c.usd)??null}),n.invalidateQueries({queryKey:["usd-balance"]}),l("pending")):(g("Shop Buy Credits Failed",{step:"grant",error_code:"grant_failed",pack_usd:(c==null?void 0:c.usd)??null}),_(u.error??s("getCredits.errorGrant",{currency:d.name})),l("error"))}catch(u){P(u,{flow:"get_credits",step:"grant",order_id:t}),g("Shop Buy Credits Failed",{step:"grant",error_code:I(u),pack_usd:(c==null?void 0:c.usd)??null}),_(M(u)),l("error")}},[c,r,n,o]),q=i.useCallback(async t=>{if(!r){m();return}_(null),N(!1),w(t),l(C==="mock"?"processing":"redirecting"),g("Shop Started Buy Credits",{pack_usd:t.usd,credits:t.credits,provider:C});try{const a=await ee(t.id,{address:r.address,identity:r.identity});if(a.mock)b(a.orderId);else if(a.url)g("Shop Redirected To Stripe",{order_id:a.orderId,pack_usd:t.usd,credits:t.credits}),window.location.href=a.url;else throw new Error("Checkout did not return a redirect url")}catch(a){P(a,{flow:"get_credits",step:"checkout",provider:C}),g("Shop Buy Credits Failed",{step:"checkout",error_code:I(a),pack_usd:t.usd}),_(M(a)),l("error")}},[r,m,b]),y=i.useRef(!1);i.useEffect(()=>{if(y.current)return;const t=k.get("order");if(k.get("canceled")!=null){y.current=!0,g("Shop Buy Credits Cancelled",{order_id:t,provider:C}),L(),N(!0),l("select");return}t&&(l("processing"),r&&(y.current=!0,L(),b(t)))},[k,r]);function v(){var t;(t=f.current)==null||t.abort(),l("select"),w(null),R(null),_(null),N(!1)}const O=p==="select";return e.jsxs("div",{className:"getcredits",children:[O&&e.jsxs("header",{className:"getcredits__head",children:[e.jsx("h1",{className:"getcredits__title",children:s("getCredits.title",{currency:d.name})}),e.jsxs("p",{className:"getcredits__sub",children:[s("getCredits.subtitle",{currency:d.name})," ",e.jsxs("a",{className:"getcredits__learn",href:ne,target:"_blank",rel:"noreferrer",children:[s("getCredits.learnMore"),e.jsxs("svg",{className:"getcredits__learn-ico",viewBox:"0 0 13 13","aria-hidden":!0,fill:"none",children:[e.jsx("path",{d:"M4 2h7v7",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M11 2 2 11",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})]})]})]})]}),p==="select"&&e.jsxs(e.Fragment,{children:[K&&e.jsx("p",{className:"getcredits__note muted",role:"status",children:s("getCredits.canceledNote")}),e.jsx(ie,{packs:F,loading:T,onSelect:t=>void q(t)})]}),p==="redirecting"&&e.jsxs("div",{className:"getcredits__status",role:"status","aria-live":"polite",children:[e.jsx(te,{size:32}),e.jsx("p",{className:"muted",children:s("getCredits.redirecting")})]}),p==="processing"&&e.jsxs("div",{className:"gc-processing",role:"status","aria-live":"polite",children:[e.jsx("img",{className:"gc-processing__logo",src:J,alt:"",width:61,height:61}),e.jsxs("div",{className:"gc-processing__body",children:[e.jsxs("p",{className:"gc-processing__title",children:[e.jsx("strong",{children:s("getCredits.processing")}),"…"]}),e.jsxs("div",{className:"gc-progress","aria-hidden":!0,children:[e.jsx("span",{className:"gc-progress__track",children:e.jsx("span",{className:"gc-progress__fill"})}),e.jsx("span",{className:"gc-progress__count",children:"1/1"})]})]})]}),p==="success"&&e.jsxs("div",{className:"gc-success",role:"status","aria-live":"polite",children:[e.jsxs("div",{className:"gc-banner",children:[e.jsx("img",{className:"gc-banner__icon",src:ae,alt:"",width:60,height:60}),e.jsxs("p",{className:"gc-banner__text",children:[e.jsx("strong",{children:s("getCredits.successTitle")})," ",s("getCredits.successBody",{currency:d.name})]})]}),E!=null&&e.jsx("div",{className:"gc-credits",children:e.jsxs("div",{className:"gc-credits__row",children:[e.jsx("img",{className:"gc-credits__coin",src:re,alt:"",width:93,height:93}),e.jsxs("p",{className:"gc-credits__text",children:[e.jsx(W,{className:"gc-credits__diamond"}),e.jsxs("span",{children:[e.jsx("strong",{className:"gc-credits__amount",children:s("getCredits.creditsAmount",{credits:E,currency:d.name})})," ",e.jsx("span",{className:"gc-credits__added",children:s("getCredits.creditsAdded")})]})]})]})}),e.jsxs("div",{className:"gc-actions",children:[e.jsx("button",{className:"gc-actions__btn gc-actions__btn--outline",onClick:v,children:s("getCredits.buyMore",{currency:d.name})}),e.jsx("button",{className:"gc-actions__btn gc-actions__btn--solid",onClick:()=>o("/assets"),children:s("getCredits.startShopping")})]})]}),p==="pending"&&e.jsxs("div",{className:"gc-status",role:"status","aria-live":"polite",children:[e.jsx("p",{className:"gc-status__title",children:s("getCredits.pendingTitle",{currency:d.name})}),e.jsx("p",{className:"muted",children:s("getCredits.pendingBody")}),e.jsxs("div",{className:"gc-status__actions",children:[e.jsx("button",{className:"gc-actions__btn gc-actions__btn--solid",onClick:()=>o("/assets"),children:s("getCredits.startShopping")}),e.jsx("button",{className:"gc-actions__btn gc-actions__btn--outline",onClick:v,children:s("getCredits.done")})]})]}),p==="error"&&e.jsxs("div",{className:"gc-status gc-status--err",role:"alert",children:[e.jsx("p",{className:"gc-status__title",children:s("getCredits.errorTitle")}),e.jsx("p",{className:"error",children:U}),e.jsx("div",{className:"gc-status__actions",children:e.jsx("button",{className:"gc-actions__btn gc-actions__btn--solid",onClick:v,children:s("getCredits.tryAgain")})})]})]})}function ie({packs:o,loading:r,onSelect:m}){return r?e.jsx("div",{className:"packs","aria-busy":"true","aria-label":s("getCredits.packsLoading",{currency:d.name}),children:[0,1,2,3].map(n=>e.jsx("div",{className:"pack pack--skeleton","aria-hidden":!0,children:e.jsxs("span",{className:"pack__inner",children:[e.jsx("span",{className:"skeleton pack__label-sk"}),e.jsx("span",{className:"skeleton pack__art-sk"}),e.jsx("span",{className:"skeleton pack__cta-sk"})]})},n))}):e.jsx("div",{className:"packs",children:o.map(n=>e.jsxs("button",{type:"button",className:`pack${n.bestValue?" pack--best":""}`,"data-testid":"pack",onClick:()=>m(n),"aria-label":s("getCredits.packAria",{amount:z(n.credits),usd:n.usd}),children:[n.bestValue&&e.jsx("span",{className:"pack__badge",children:s("getCredits.packBadge")}),e.jsxs("span",{className:"pack__inner",children:[e.jsx("span",{className:"pack__label",children:s("getCredits.creditsAmount",{credits:n.credits,currency:d.name})}),e.jsx("span",{className:"pack__art",children:e.jsx("img",{src:ce[n.id]??x,alt:"",loading:"lazy"})}),e.jsx("span",{className:"pack__cta-wrap",children:e.jsxs("span",{className:"pack__cta",children:["$",n.usd.toFixed(2)]})})]})]},n.id))})}export{je as GetCredits,je 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-
|
|
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-ZeJG5A5O.js";import{d as g,r as v}from"./index-Csh4ZzC9.js";import{C as c}from"./ConstantsUtil-CPwpahR3.js";import{R as $,O as u}from"./W3MFrameProviderSingleton-_Jupf0lQ.js";import{au as y}from"./NetworkUtil-CM7JZPbs.js";const b=g`
|
|
2
2
|
:host {
|
|
3
3
|
display: flex;
|
|
4
4
|
justify-content: center;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{u as K,r as u,j as e,L as B}from"./react-BMZSDQJw.js";import{t as s,C as w,B as k,l as L,q as $,x as A,u as P,g as U,j as W,e as O,s as Q,E as z}from"./index-
|
|
1
|
+
import{u as K,r as u,j as e,L as B}from"./react-BMZSDQJw.js";import{t as s,C as w,B as k,l as L,q as $,x as A,u as P,g as U,j as W,e as O,s as Q,E as z}from"./index-B8IbHKn5.js";import{i as Y,R as D,f as G}from"./import-DwFR83oQ.js";import{s as H}from"./wallet-kind-D0r-Cmku.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-8SzFotJj.js";import"./ethers-CeDRuWE-.js";import"./intl-CBcMB1D2.js";import"./buy-DcrAdUpx.js";import"./index-HN6Rk25C.js";import"./mana-rate-Z0fOAnP4.js";function J({queue:n,session:T,onClose:j,onDone:h}){const N=K(),d=H(T.providerType),[m,f]=u.useState(()=>n.map(()=>"pending")),[I,E]=u.useState("running"),S=u.useRef(!1);u.useEffect(()=>{if(S.current)return;S.current=!0;let t=!1;return(async()=>{for(let r=0;r<n.length;r++){if(t)return;f(p=>p.map((g,o)=>o===r?"active":g));try{await Y(n[r].item,n[r].priceCredits,T),$("Shop Migrated Listing",{item_id:n[r].item.itemId??n[r].item.oldTradeId??null,contract_address:n[r].item.contractAddress,new_price_credits:n[r].priceCredits,new_price_usd:n[r].priceCredits/10}),t||f(p=>p.map((g,o)=>o===r?"done":g))}catch(p){if(p instanceof D)A(p,{flow:"import_listing",step:"relist",itemId:n[r].item.itemId??n[r].item.oldTradeId}),t||f(g=>g.map((o,b)=>b===r?"unlisted":o));else{const g=p,o=g.code===4001||/reject|denied|cancel/i.test(g.message??"");o||A(p,{flow:"import_listing",itemId:n[r].item.itemId??n[r].item.oldTradeId}),t||f(b=>b.map((a,l)=>l===r?o?"skipped":"failed":a))}}}t||E("finished")})(),()=>{t=!0}},[]);const _=m.filter(t=>t==="done").length,v=m.findIndex(t=>t==="active"),x=Math.round(m.filter(t=>t!=="pending"&&t!=="active").length/n.length*100);function y(){h(),j()}if(I==="finished"){const t=m.filter(r=>r==="skipped"||r==="failed").length,c=m.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:_>0?s("migrate.successTitle"):s("migrate.nothingTitle")}),e.jsxs("p",{className:"muted",style:{margin:0},children:[_>0?s("migrate.listedSummary",{count:_,currency:w.name}):s("migrate.noneListed"),t>0?" "+s("migrate.skippedSummary",{count:t}):"",c>0?" "+s("migrate.unlistedSummary",{count:c}):""]}),e.jsxs("div",{className:"modal__actions",children:[e.jsx(k,{variant:"ghost",onClick:y,children:s("getCredits.done")}),c>0?e.jsx(k,{variant:"purple",onClick:()=>{h(),j(),N("/my-assets")},children:s("migrate.goToMyAssets")}):_>0?e.jsx(k,{variant:"purple",onClick:()=>{h(),j(),N("/assets")},children:s("migrate.viewInShop")}):null]})]})})}return e.jsx("div",{className:"modal-backdrop",role:"presentation",children:e.jsxs("div",{className:"modal migrate","data-testid":"modal",role:"dialog","aria-modal":"true","aria-live":"polite",children:[e.jsx("h2",{className:"modal__title",children:s("migrate.listingTitle")}),e.jsxs("p",{className:"muted small",style:{margin:"0 0 4px"},children:[d?s("migrate.subConfirm"):s("migrate.subManaged")," ",v>=0?s("migrate.progressCount",{current:v+1,total:n.length}):""]}),e.jsx("div",{className:"migrate__progress",children:e.jsx("div",{className:"migrate__bar",style:{width:`${x}%`}})}),e.jsx("ul",{className:"migrate__list",children:n.map((t,c)=>e.jsxs("li",{className:`migrate__row migrate__row--${m[c]}`,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||s("migrate.itemFallback")}),e.jsxs("span",{className:"migrate__price",children:[e.jsx(L,{className:"ccy-mark"})," ",t.priceCredits.toLocaleString()]}),e.jsx("span",{className:"migrate__status",children:m[c]==="active"?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"spinner migrate__spin","aria-hidden":!0})," ",d?s("migrate.statusConfirm"):s("migrate.statusAdding")]}):m[c]==="done"?e.jsx("span",{className:"migrate__tick",children:"✓"}):m[c]==="skipped"?e.jsx("span",{className:"migrate__skip",children:s("migrate.statusSkipped")}):m[c]==="failed"?e.jsx("span",{className:"migrate__skip",children:s("migrate.statusFailed")}):m[c]==="unlisted"?e.jsx("span",{className:"migrate__skip",title:s("migrate.unlistedTooltip"),children:s("migrate.statusUnlisted")}):e.jsx("span",{className:"migrate__wait",children:s("migrate.statusWaiting")})})]},t.item.oldTradeId))}),e.jsx("p",{className:"muted small migrate__hint",children:d?s("migrate.hintConfirm"):s("migrate.hintManaged")})]})})}const F=Q(k)`
|
|
2
2
|
margin-top: 10px;
|
|
3
3
|
`,V=Q(k)`
|
|
4
4
|
padding: 13px 24px;
|