@dcl/shop 0.1.0-29942574523.commit-573f25e → 0.1.0-29942650568.commit-3cdb6da
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-CzCwcFdY.js → AnimatedBackground-CysLhvvU.js} +3 -3
- package/assets/{Assets-BTdyC00C.js → Assets-DsvJ5f0v.js} +1 -1
- package/assets/{Assets.styles-eeqx94WS.js → Assets.styles-CA7lhkqC.js} +26 -27
- package/assets/{Authorizations-BZhmfDD4.js → Authorizations-vnz0r2Ax.js} +3 -3
- package/assets/{Cart-BicSZMzV.js → Cart-CTQAeaCb.js} +2 -2
- package/assets/{CircularProgress-BivMeg1W.js → CircularProgress-BoWkcKSM.js} +3 -3
- package/assets/{Collection-DQAOAaC9.js → Collection-DFg8H4cI.js} +1 -1
- package/assets/{CollectionCarousel-D_udpdxX.js → CollectionCarousel-BgmGp9gP.js} +1 -1
- package/assets/{Creator-X75Qvpr4.js → Creator-DpJL7xsg.js} +1 -1
- package/assets/{CssVarsProvider-C0ny30E-.js → CssVarsProvider-CVkDPUQi.js} +1 -1
- package/assets/{ExchangeController-D0l6M3tj.js → ExchangeController-XYLG0Onl.js} +1 -1
- package/assets/{GetCredits-CMdoboQp.js → GetCredits-C41Akzju.js} +1 -1
- package/assets/{HelpersUtil-hamZLlhX.js → HelpersUtil-CXmyL-9f.js} +1 -1
- package/assets/{ImportListings-BFIpuuBM.js → ImportListings-DL4qvnkm.js} +1 -1
- package/assets/ItemDetail-8kxMVjol.js +78 -0
- package/assets/{LoadMore-BLy9p9ul.js → LoadMore-DwH_uJJ9.js} +1 -1
- package/assets/{MarketCheckout-DSl7Bl-M.js → MarketCheckout-0NCiBi_9.js} +1 -1
- package/assets/MyAssets-ChdfSyve.js +258 -0
- package/assets/{MyFavorites-Dul-WC6l.js → MyFavorites-BAgv7K26.js} +1 -1
- package/assets/{MyPurchases-DI0zzNTZ.js → MyPurchases-DlfJ7xtX.js} +4 -4
- package/assets/{NotFound-Bdg_iIpB.js → NotFound-uK-Ostnl.js} +1 -1
- package/assets/PrimaryListModal-Bm7Lx1a1.js +1 -0
- package/assets/{StoreSettings-2cViRT0c.js → StoreSettings-jeamoHJO.js} +5 -5
- package/assets/{Success-D9l7pr2K.js → Success-IAIc5xBC.js} +1 -1
- package/assets/{SwapController-DKBIcDPA.js → SwapController-B81AJRRn.js} +1 -1
- package/assets/{Tooltip-DJ7HtAmB.js → Tooltip-CYItdKnL.js} +1 -1
- package/assets/{TradeService-BpWgN8zg.js → TradeService-BxBTy4_C.js} +1 -1
- package/assets/{W3MFrameProviderSingleton-B40OWK0h.js → W3MFrameProviderSingleton-WHc1zToo.js} +3 -3
- package/assets/{WebCryptoP256-Ccr1DsYO.js → WebCryptoP256-BQQeByzz.js} +1 -1
- package/assets/{authorizations-sU14ILrd.js → authorizations-C600xDT9.js} +1 -1
- package/assets/{basic-DaSuNoEa.js → basic-CaSER4PW.js} +1 -1
- package/assets/{biconomy-DmmBzkXG.js → biconomy-nsDuvr1X.js} +1 -1
- package/assets/{buy-BRLq1STf.js → buy-C5J6mAtx.js} +1 -1
- package/assets/{buy-gasless-hR2bH0iR.js → buy-gasless-Sy6Gurph.js} +1 -1
- package/assets/{cart-checkout-CifIjL1z.js → cart-checkout-BwJruvi6.js} +1 -1
- package/assets/{categories-BPU8ySTe.js → categories-CQMvcQ_A.js} +1 -1
- package/assets/{ccip-C1DhAmlP.js → ccip-CVFd9-T6.js} +1 -1
- package/assets/{ccip-pv6qu637.js → ccip-C_DKTuDg.js} +1 -1
- package/assets/{collection-DhudRI2A.js → collection-BButATLz.js} +1 -1
- package/assets/{controller-DBPpBNi9.js → controller-C4IlqRFi.js} +2 -2
- package/assets/{core-CftjJZSY.js → core-Bsb1vtZ6.js} +4 -4
- package/assets/{custom-CLjHEVcz.js → custom-B2_bVLxh.js} +1 -1
- package/assets/{data-capture-ClKTWWBL.js → data-capture-CeCg7Ckv.js} +1 -1
- package/assets/{email-Dx9BSTtw.js → email-DGWqulOs.js} +1 -1
- package/assets/{embedded-wallet-CCKNmFwm.js → embedded-wallet-BDA__pmu.js} +1 -1
- package/assets/emotion-styled.browser.esm-Of0yAmXP.js +1 -0
- package/assets/{engine-1UaDNb6s.js → engine-COT4y3N6.js} +1 -1
- package/assets/{errors-DKFg2ql0.js → errors-B2rT3Gvo.js} +1 -1
- package/assets/{estimate-l1-fee-cQM6_GVS.js → estimate-l1-fee-DSG403IA.js} +1 -1
- package/assets/{execute-BuVfiwvM.js → execute-zpOqUNic.js} +2 -2
- package/assets/{features-ieqkL6m1.js → features-CMZ-QMXf.js} +1 -1
- package/assets/{fetchTokenMetadata-D8OWz4cP.js → fetchTokenMetadata-CZyR6DMv.js} +2 -2
- package/assets/{get-ecosystem-wallet-info-LZLHBFVZ.js → get-ecosystem-wallet-info-Cll7wRD7.js} +1 -1
- package/assets/{getBalance-Ck1YHbUL.js → getBalance-BlSTzNnh.js} +1 -1
- package/assets/{getNFT-DYxVn0Et.js → getNFT-bAbPTgKN.js} +1 -1
- package/assets/{getNFT-DnYNAiji.js → getNFT-yZahXefO.js} +1 -1
- package/assets/{getOverlayAlpha-Jb_9sPPd.js → getOverlayAlpha-CH1E19pc.js} +1 -1
- package/assets/{hashTypedData-Bqz6FRnB.js → hashTypedData-BjKHZJt2.js} +1 -1
- package/assets/{hashTypedData-BHOeb4kN.js → hashTypedData-CoI7qham.js} +1 -1
- package/assets/{import-CyzZeEcP.js → import-B-7LIWfg.js} +1 -1
- package/assets/{in-app-yMA-tvKO.js → in-app-DuAkMaop.js} +1 -1
- package/assets/{in-app-wallet-calls-BJRqCE4k.js → in-app-wallet-calls-VVaW7dWC.js} +1 -1
- package/assets/{index-BgMPhDEY.js → index-2LZVA_H9.js} +1 -1
- package/assets/{index-C0MEN305.js → index-B14E9dDt.js} +1 -1
- package/assets/{index-DwFc8v1Z.js → index-B5bMVqc5.js} +1 -1
- package/assets/{index-CstoEHiD.js → index-BC--wvbP.js} +1 -1
- package/assets/{index-D0tMQ_oG.js → index-BCa080Jk.js} +1 -1
- package/assets/{index-mc7xea6T.js → index-BEL4KhCu.js} +1 -1
- package/assets/{index-Bxu_HZv7.js → index-BSSPgvD1.js} +1 -1
- package/assets/{index-DSbcS8Gm.js → index-BaDAgjcA.js} +1 -1
- package/assets/{index-nmCuLAGG.js → index-BlnhiyW1.js} +1 -1
- package/assets/{index-KyO7a8ne.js → index-BmwayVyG.js} +3 -3
- package/assets/{index-D18uHh6f.js → index-BsY45tr2.js} +1 -1
- package/assets/{index-CWcMLN9O.js → index-Bwtbao7B.js} +1 -1
- package/assets/{index-0Z5nkscP.js → index-Bzlo07t4.js} +1 -1
- package/assets/{index-DPjEYQhJ.js → index-C0_U8Amn.js} +1 -1
- package/assets/{index-DJEb_i4T.js → index-C0utXQ6l.js} +1 -1
- package/assets/{index-B55KertC.js → index-C2JrnQDe.js} +1 -1
- package/assets/{index-Chx72aoA.js → index-C4vAJ3fL.js} +1 -1
- package/assets/{index-B7YJ2-NC.js → index-CBhum_yI.js} +1 -1
- package/assets/{index-DPm2T7me.js → index-CJs5gUNJ.js} +3 -3
- package/assets/{index-B8PSEU0f.js → index-CRZSv11U.js} +1 -1
- package/assets/{index-Cenx9VIL.js → index-CUV4Rf3F.js} +1 -1
- package/assets/{index-Dil5ESgb.js → index-ChF-gCVV.js} +1 -1
- package/assets/{index-BVjayAtf.js → index-CiH0W5Hj.js} +1 -1
- package/assets/{index-LQPmlKJw.js → index-Cj8JMZ6F.js} +1 -1
- package/assets/{index-0C8jHF02.js → index-CjnhvTx0.js} +1 -1
- package/assets/{index-BlKccc7B.js → index-CkTptFnK.js} +2 -2
- package/assets/{index-CVG4mg1H.js → index-ClDUuLhd.js} +1 -1
- package/assets/{index-zfsFyt-v.js → index-Cok_sFK3.js} +1 -1
- package/assets/{index-BLpc0PAw.js → index-CyMsSal1.js} +1 -1
- package/assets/{index-WrHr3vKs.js → index-CzOo8tvO.js} +2 -2
- package/assets/{index-Df4qngsG.js → index-D2i7N7FD.js} +1 -1
- package/assets/{index-Dx4oKUoK.js → index-D4mGcEtB.js} +1 -1
- package/assets/{index-CCr2J09y.js → index-D7J0TuHz.js} +2 -2
- package/assets/{index-CqYieDft.js → index-DIZEbKwM.js} +1 -1
- package/assets/{index-CO9CUrPm.js → index-DIusB22U.js} +2 -2
- package/assets/{index-Dc1nvyn9.js → index-DJCp8uIp.js} +1 -1
- package/assets/index-DYDor-ZM.css +1 -0
- package/assets/{index-B_fPkyQt.js → index-DcAG03_T.js} +1 -1
- package/assets/{index-fvb_2ePt.js → index-DeO2Srep.js} +2 -2
- package/assets/{index-DM6cwvvh.js → index-Dfv7PJQh.js} +1 -1
- package/assets/{index-BEOJi3Jo.js → index-DmSOW0PY.js} +1 -1
- package/assets/{index-LMkzNUyd.js → index-Dp2XIou0.js} +1 -1
- package/assets/{index-Bc63dzBj.js → index-DsttSp14.js} +3 -3
- package/assets/{index-YX1mo09T.js → index-DuM3vKAV.js} +1 -1
- package/assets/{index-uESxdvPf.js → index-DvbuNJKq.js} +1 -1
- package/assets/{index-O1MAeCt1.js → index-DxHb67V2.js} +1 -1
- package/assets/index-Q9d0V8TZ.js +289 -0
- package/assets/{index-3c-o1deN.js → index-VrPb_Zz5.js} +1 -1
- package/assets/{index-DHzasbYL.js → index-ZjDtH0Hr.js} +1 -1
- package/assets/{index-a_8ZLAR0.js → index-gcnUvFrd.js} +1 -1
- package/assets/{index-xFOezD9a.js → index-tAmGgcla.js} +1 -1
- package/assets/{index-B6Hb0r15.js → index-uk-CfnlL.js} +1 -1
- package/assets/{index-Dszgr0BR.js → index-zvLgVYhW.js} +1 -1
- package/assets/{index.es-Dy8PEmK4.js → index.es-BzMx-nup.js} +4 -4
- package/assets/{index.es-CP2cNM9F.js → index.es-DAd9yxMt.js} +1 -1
- package/assets/{index.es-B-uJmNhd.js → index.es-fI5nPWfV.js} +1 -1
- package/assets/{localBatchGatewayRequest-Dg8trW1f.js → localBatchGatewayRequest-BIFDJTSD.js} +1 -1
- package/assets/{mana-rate-DtQ8WpoI.js → mana-rate-CC-yyhWK.js} +1 -1
- package/assets/{networks-BaSDToU0.js → networks-DkdE2sZd.js} +1 -1
- package/assets/{onramp-D6REu-OE.js → onramp-C_i59kJR.js} +1 -1
- package/assets/{openzeppelin-DsZ0ZpWh.js → openzeppelin-BMNh5qua.js} +1 -1
- package/assets/{parseNft-BrwItloF.js → parseNft-CW-hWGBI.js} +2 -2
- package/assets/{parseSignature-CtBPNsAi.js → parseSignature-C3GhRBL-.js} +3 -3
- package/assets/{parseSignature-C67g8Ikn.js → parseSignature-NZopg6IG.js} +1 -1
- package/assets/{passkeys-CkVvpC6F.js → passkeys-DuQQbJhZ.js} +1 -1
- package/assets/{pay-with-exchange-DDftQXGa.js → pay-with-exchange-DH6Kt6OD.js} +1 -1
- package/assets/{qr-overlay-CHyDfEfF.js → qr-overlay-u2BzHEzf.js} +1 -1
- package/assets/{receive-BqeMp3_k.js → receive-D2V6X2tA.js} +1 -1
- package/assets/{resolveImplementation-D6GNwvZn.js → resolveImplementation-BsuIKFkz.js} +1 -1
- package/assets/{rpc-D1wZc4pd.js → rpc-BIhelmqB.js} +1 -1
- package/assets/{secp256k1-Cu8gqKOi.js → secp256k1-BHmvTUzO.js} +1 -1
- package/assets/{secp256k1-DKdkwurr.js → secp256k1-BtgeD6jy.js} +1 -1
- package/assets/{secp256k1-tM-HU4Wb.js → secp256k1-hNsXkUex.js} +1 -1
- package/assets/{send-C5LlTSZw.js → send-DkPpjCf1.js} +1 -1
- package/assets/{send-batch-transaction-2M20mpyd.js → send-batch-transaction-Bt9-Q0FO.js} +1 -1
- package/assets/{send-eip712-transaction-DxCA-Uwd.js → send-eip712-transaction-CJ8Dr-eb.js} +2 -2
- package/assets/{send-gasless-transaction-VjwN2uQK.js → send-gasless-transaction-D5eQ85CY.js} +2 -2
- package/assets/{send-transaction-Bb0Q9hmN.js → send-transaction-BK1KmPMR.js} +2 -2
- package/assets/{sendRawTransaction-CED77ONZ.js → sendRawTransaction-Ddh_tSjE.js} +3 -3
- package/assets/{serializeTransaction-7yAEy3FU.js → serializeTransaction-f04zsBlb.js} +1 -1
- package/assets/{session-proposal-DGrkZ9Ix.js → session-proposal-r1mPrmCX.js} +1 -1
- package/assets/{session-request-Dg8cFRll.js → session-request-Cfr7jp2h.js} +2 -2
- package/assets/{signing-DuUwyfpZ.js → signing-C-mKTJFW.js} +3 -3
- package/assets/{socials-cbGvEEpM.js → socials-pmAt6WyL.js} +1 -1
- package/assets/{swaps-EURvYFti.js → swaps-XKJYQXAz.js} +1 -1
- package/assets/{thirdweb-D4Tt3SPK.js → thirdweb-B_kKfwse.js} +3 -3
- package/assets/{to-serializable-transaction-Dh5bAtyQ.js → to-serializable-transaction-rhTmQPEU.js} +2 -2
- package/assets/{trade-encoding-0IFZ39Tk.js → trade-encoding-CaZYjVNs.js} +1 -1
- package/assets/{transactionReceipt-DIw9ApVw.js → transactionReceipt-BcU054L-.js} +1 -1
- package/assets/{transactions-xAqHSp91.js → transactions-lrp4i700.js} +1 -1
- package/assets/useCreditPacks-Be9cG5vr.js +1 -0
- package/assets/{useInfiniteGrid-BbeLTVdN.js → useInfiniteGrid-8c-8xSTi.js} +1 -1
- package/assets/{useStore-PWA7dbNJ.js → useStore-Ccbed9Z-.js} +1 -1
- package/assets/useTheme-7-Mr4FFJ.js +1 -0
- package/assets/useTheme-C3YHg0O0.js +1 -0
- package/assets/{verifyHash-sv4aRvH_.js → verifyHash-z4q1c5J1.js} +1 -1
- package/assets/{w3m-modal-D1RMqW5z.js → w3m-modal-2GWsHPDh.js} +1 -1
- package/assets/{w3m-modal-BoTSPCYe.js → w3m-modal-DUSXSzQv.js} +1 -1
- package/assets/{wait-for-tx-receipt-CnoUxMtV.js → wait-for-tx-receipt-CAc2Bmoi.js} +1 -1
- package/assets/{wallets-Cuqbvnoy.js → wallets-BD_QGCV9.js} +5 -5
- package/assets/{web-connector-0FomZsHS.js → web-connector-Da5xZh52.js} +3 -3
- package/assets/{writeContract-Bicvfabo.js → writeContract-zNHMPW7R.js} +1 -1
- package/assets/{zoraTestnet-4QPNkDlh.js → zoraTestnet-Csb8JMNL.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/assets/ItemDetail-C0Sm18Me.js +0 -78
- package/assets/MyAssets-UFPrjPwu.js +0 -258
- package/assets/PrimaryListModal-CnlMOkG5.js +0 -1
- package/assets/emotion-styled.browser.esm-B6FBNgF3.js +0 -1
- package/assets/index-CJ4mXolB.js +0 -289
- package/assets/index-CqYr0ABc.css +0 -1
- package/assets/useCreditPacks-DO-uyk4N.js +0 -1
- package/assets/useTheme-BHtz4hyG.js +0 -1
- package/assets/useTheme-Ciqd957r.js +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{r as l,j as v}from"./react-BrLDncxD.js";const w="https://cdn.decentraland.org/@dcl/shop/0.1.0-
|
|
1
|
+
import{r as l,j as v}from"./react-BrLDncxD.js";const w="https://cdn.decentraland.org/@dcl/shop/0.1.0-29942650568.commit-3cdb6da/assets/custom-welcome-background-BxlFQma9.webp",S="https://cdn.decentraland.org/@dcl/shop/0.1.0-29942650568.commit-3cdb6da/assets/DCL_LogoPattern-BryBPc3d.png",b=`
|
|
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
|
+
`,U=`
|
|
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,b),c=g(e,e.FRAGMENT_SHADER,U);if(!o||!c){o&&e.deleteShader(o),c&&e.deleteShader(c);return}const n=P(e,o,c);if(!n){e.deleteShader(o),e.deleteShader(c);return}const u=e.getAttribLocation(n,"a_position"),_=e.getUniformLocation(n,"u_time"),R=e.getUniformLocation(n,"u_resolution"),y=e.getUniformLocation(n,"u_overlayTex"),s=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,s),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),e.STATIC_DRAW);let m=!1;const d=D(e,S,()=>m),A=()=>{const i=window.devicePixelRatio||1,x=r.clientWidth*i,E=r.clientHeight*i;(r.width!==x||r.height!==E)&&(r.width=x,r.height=E)},p=performance.now()/1e3,f=()=>{A(),e.viewport(0,0,r.width,r.height),e.useProgram(n),e.uniform1f(_,performance.now()/1e3-p),e.uniform2f(R,r.width,r.height),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,d),e.uniform1i(y,0),e.enableVertexAttribArray(u),e.bindBuffer(e.ARRAY_BUFFER,s),e.vertexAttribPointer(u,2,e.FLOAT,!1,0,0),e.drawArrays(e.TRIANGLES,0,6),a.current=requestAnimationFrame(f)},T=i=>{i.preventDefault(),cancelAnimationFrame(a.current),r.style.opacity="0"};return r.addEventListener("webglcontextlost",T,!1),a.current=requestAnimationFrame(f),()=>{m=!0,cancelAnimationFrame(a.current),r.removeEventListener("webglcontextlost",T),e.deleteProgram(n),e.deleteShader(o),e.deleteShader(c),e.deleteBuffer(s),e.deleteTexture(d)}},[]),v.jsxs("div",{className:"AnimatedBackground","aria-hidden":!0,children:[v.jsx("div",{className:"AnimatedBackground__fallback",style:{backgroundImage:`url(${w})`}}),v.jsx("canvas",{ref:t,className:"AnimatedBackground__canvas"})]})}export{L as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Ke,r as p,j as e,b as Qe}from"./react-BrLDncxD.js";import{c as F,w as Ze,q as Je,
|
|
1
|
+
import{a as Ke,r as p,j as e,b as Qe}from"./react-BrLDncxD.js";import{c as F,w as Ze,q as Je,L as Xe,s,F as t,d as Te,n as Ye,o as ze,j as Ie,e as et,t as o,I as z,h as B,v as pe,x as D,y as tt,z as nt,u as Ne,G as st,A as K,au as ot,av as it}from"./index-Q9d0V8TZ.js";import{r as rt,a as at,m as _e}from"./mana-rate-CC-yyhWK.js";import{u as Ae,M as lt}from"./MarketCheckout-0NCiBi_9.js";import{g as ct,h as dt,i as ft,j as pt,k as ut,C as xt,l as ht,o as mt,m as gt,n as bt,M as yt}from"./Assets.styles-CA7lhkqC.js";import{d as ue,R as wt,F as vt,S as xe,b as jt}from"./categories-CQMvcQ_A.js";import{L as $t}from"./LoadMore-DwH_uJJ9.js";import{u as Ct}from"./useInfiniteGrid-8c-8xSTi.js";import{E as kt}from"./ErrorNotice-BDH9xoG4.js";import{d as St}from"./dcl-schemas-BICTSpB5.js";import{u as Rt,G as Et,w as Tt,S as zt}from"./buy-gasless-Sy6Gurph.js";import{s as It}from"./buy-C5J6mAtx.js";import{h as Nt}from"./trade-encoding-CaZYjVNs.js";import{f as _t}from"./errors-B2rT3Gvo.js";import{J as At,C as Pt,B as ne}from"./ethers-CLB2z3On.js";import{l as Mt}from"./loader-logo-BzY9EKdC.js";import{n as Lt}from"./emotion-CSxEP8yM.js";import"./sentry-DYZXk5O5.js";import"./intl-CBcMB1D2.js";import"./index-HN6Rk25C.js";import"./Tooltip-CYItdKnL.js";import"./authorizations-C600xDT9.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===St.ChainId.MATIC_MAINNET?me.mainnet:me.sepolia}async function Ut(n,i={}){var d;const{rpc:f,address:u}=Ht(),l=new At(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 Gt(n){return at(W,n)}async function qt(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:Nt(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 rt(l),w=Gt(m);console.info("[names] step 1/6 sized reservation",{usdCents:w,manaRate:m});const y=await qt(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 v=await Ze(f,w);if(d=v.credit.id,console.info("[names] step 3/6 credit authorized",{creditId:v.credit.id,maxCreditedValue:v.maxCreditedValue}),ne.from(v.maxCreditedValue).lt(W))throw new Error("Credit under-sized for the name price");const C=Dt(v.credit,y);let h;try{h=await Rt({chainId:l,buyer:x,signer:u,args:C})}catch(b){if(!(b instanceof Et))throw b;h=await It(l,C,u)}if(console.info("[names] step 4/6 useCredits submitted (Polygon origin tx)",{originTxHash:h}),await Tt(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 zt)return{status:"pending",originTxHash:m.txHash};throw d&&!a&&await Je(f,[d]).catch(()=>{}),m instanceof Me?m:new Error(_t(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,9 +1,9 @@
|
|
|
1
|
-
import{r as
|
|
1
|
+
import{r as y,j as t}from"./react-BrLDncxD.js";import{R as z,a as oe,C as ie,c as ne}from"./categories-CQMvcQ_A.js";import{T as se}from"./Tooltip-CYItdKnL.js";import{F as e,s as o,I as m,t as s,G as re,C as v}from"./index-Q9d0V8TZ.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;
|
|
5
5
|
width: 100%;
|
|
6
|
-
`,
|
|
6
|
+
`,k=o.div`
|
|
7
7
|
height: 1px;
|
|
8
8
|
background: ${e.colors.media};
|
|
9
9
|
width: 100%;
|
|
@@ -59,7 +59,7 @@ import{r as $,j as t}from"./react-BrLDncxD.js";import{R as z,a as oe,C as ie,c a
|
|
|
59
59
|
${e.media.up("lg")} {
|
|
60
60
|
display: none;
|
|
61
61
|
}
|
|
62
|
-
`,
|
|
62
|
+
`,he=o("p",c("desktopHidden"))`
|
|
63
63
|
margin: 0;
|
|
64
64
|
padding: 0 4px 4px;
|
|
65
65
|
font-family: ${e.font.sans};
|
|
@@ -70,7 +70,7 @@ import{r as $,j as t}from"./react-BrLDncxD.js";import{R as z,a as oe,C as ie,c a
|
|
|
70
70
|
text-transform: capitalize;
|
|
71
71
|
|
|
72
72
|
${({desktopHidden:i})=>i?`${e.media.up("lg")} { display: none; }`:""}
|
|
73
|
-
`,
|
|
73
|
+
`,xe=o("div",c("open","desktopStatic"))`
|
|
74
74
|
display: grid;
|
|
75
75
|
grid-template-rows: ${({open:i})=>i?"1fr":"0fr"};
|
|
76
76
|
transition: grid-template-rows 0.22s ease;
|
|
@@ -83,7 +83,7 @@ import{r as $,j as t}from"./react-BrLDncxD.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
|
+
`,me=o.div`
|
|
87
87
|
display: flex;
|
|
88
88
|
align-items: flex-end;
|
|
89
89
|
justify-content: center;
|
|
@@ -100,7 +100,7 @@ import{r as $,j as t}from"./react-BrLDncxD.js";import{R as z,a as oe,C as ie,c a
|
|
|
100
100
|
font-weight: 400;
|
|
101
101
|
font-size: 12px;
|
|
102
102
|
color: ${e.colors.muted};
|
|
103
|
-
`,
|
|
103
|
+
`,F=o.span`
|
|
104
104
|
display: flex;
|
|
105
105
|
align-items: center;
|
|
106
106
|
gap: 4px;
|
|
@@ -113,7 +113,7 @@ import{r as $,j as t}from"./react-BrLDncxD.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
|
-
`,
|
|
116
|
+
`,P=o(m)`
|
|
117
117
|
width: 16px;
|
|
118
118
|
height: 16px;
|
|
119
119
|
color: ${e.colors.rarity};
|
|
@@ -135,7 +135,7 @@ import{r as $,j as t}from"./react-BrLDncxD.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
|
+
`,ue=o.span`
|
|
139
139
|
padding-bottom: 12px;
|
|
140
140
|
color: ${e.colors.text};
|
|
141
141
|
font-family: ${e.font.sans};
|
|
@@ -196,7 +196,7 @@ import{r as $,j as t}from"./react-BrLDncxD.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
|
+
`,$e=o.div`
|
|
200
200
|
display: flex;
|
|
201
201
|
align-items: center;
|
|
202
202
|
justify-content: space-between;
|
|
@@ -208,11 +208,11 @@ import{r as $,j as t}from"./react-BrLDncxD.js";import{R as z,a as oe,C as ie,c a
|
|
|
208
208
|
font-family: ${e.font.sans};
|
|
209
209
|
font-size: 13px;
|
|
210
210
|
color: ${e.colors.text};
|
|
211
|
-
`,D=o(
|
|
211
|
+
`,D=o(m)`
|
|
212
212
|
width: 16px;
|
|
213
213
|
height: 16px;
|
|
214
214
|
color: ${e.colors.text};
|
|
215
|
-
|
|
215
|
+
`,ye=o.div`
|
|
216
216
|
display: flex;
|
|
217
217
|
flex-wrap: wrap;
|
|
218
218
|
gap: 12px;
|
|
@@ -238,14 +238,14 @@ import{r as $,j as t}from"./react-BrLDncxD.js";import{R as z,a as oe,C as ie,c a
|
|
|
238
238
|
outline: 2px solid ${e.colors.accent};
|
|
239
239
|
outline-offset: 2px;
|
|
240
240
|
}
|
|
241
|
-
`,
|
|
241
|
+
`,ke=o("span",c("color"))`
|
|
242
242
|
position: relative;
|
|
243
243
|
width: 16px;
|
|
244
244
|
height: 16px;
|
|
245
245
|
border-radius: 4px;
|
|
246
246
|
background: ${({color:i})=>i};
|
|
247
247
|
flex: none;
|
|
248
|
-
`,
|
|
248
|
+
`,je=o(m)`
|
|
249
249
|
position: absolute;
|
|
250
250
|
inset: 0;
|
|
251
251
|
width: 16px;
|
|
@@ -300,7 +300,7 @@ import{r as $,j as t}from"./react-BrLDncxD.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
|
-
`,
|
|
303
|
+
`,Fe=o(m)`
|
|
304
304
|
width: 14px;
|
|
305
305
|
height: 14px;
|
|
306
306
|
color: ${e.colors.text};
|
|
@@ -309,7 +309,7 @@ import{r as $,j as t}from"./react-BrLDncxD.js";import{R as z,a as oe,C as ie,c a
|
|
|
309
309
|
width: 16px;
|
|
310
310
|
height: 16px;
|
|
311
311
|
}
|
|
312
|
-
`,
|
|
312
|
+
`,Pe=o.span`
|
|
313
313
|
font-family: ${e.font.sans};
|
|
314
314
|
font-weight: 600;
|
|
315
315
|
font-size: 14px;
|
|
@@ -322,7 +322,7 @@ import{r as $,j as t}from"./react-BrLDncxD.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(m)`
|
|
326
326
|
width: 12px;
|
|
327
327
|
height: 12px;
|
|
328
328
|
color: ${e.colors.muted2};
|
|
@@ -367,7 +367,7 @@ import{r as $,j as t}from"./react-BrLDncxD.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 De(i){var l;for(const
|
|
370
|
+
`,d=1e5;function De(i){var l;for(const x of ie){const p=(l=x.subs)==null?void 0:l.find(r=>r.key===i);if(p)return s(p.labelKey)}return i}function j({title:i,open:l,onToggle:x,summary:p,desktopStatic:r,headerTestId:h,headerAria:u,children:f}){const g=t.jsx(ne,{up:l,size:24,color:"var(--text)"});return t.jsxs(le,{children:[t.jsxs(ce,{type:"button",desktopStatic:r,onClick:x,"aria-expanded":l,"aria-label":u,"data-testid":h,children:[t.jsx(de,{children:i}),r?t.jsx(pe,{children:g}):g]}),!l&&p?t.jsx(he,{desktopHidden:r,children:p}):null,t.jsx(xe,{open:l,desktopStatic:r,children:t.jsx(ge,{children:f})})]})}function Me({category:i,subCategory:l,onCategory:x,onSub:p,priceMin:r,priceMax:h,onPriceMin:u,onPriceMax:f,rarities:g,onToggleRarity:E,status:S,onStatus:L,smart:b,onSmart:O}){const[_,Y]=y.useState(!0),[M,B]=y.useState(!0),[G,K]=y.useState(!1),[U,W]=y.useState(!0),R=r&&!Number.isNaN(Number(r))?Number(r):void 0,C=h&&!Number.isNaN(Number(h))?Number(h):void 0,w=R!=null?Math.min(R,d):0,$=C!=null?Math.min(C,d):d,V=w/d*100,X=$/d*100;function q(n){const a=Math.min(n,$);u(a<=0?"":String(a))}function J(n){const a=Math.max(n,w);f(a>=d?"":String(a))}const Q=l?De(l):i!=="wearable"?s(`categories.${i==="emote"?"emotes":i==="all"?"shopAll":i}`):"",Z=R!=null||C!=null?`${r||"0"}-${h||"∞"}`:"",ee=z.filter(n=>g.includes(n)).map(re).join(", "),te=S==="on_sale"?s("filter.onSale"):S==="not_for_sale"?s("filter.notForSale"):"";return t.jsxs(ae,{children:[t.jsx(j,{title:s("assets.category"),open:_,onToggle:()=>Y(n=>!n),summary:Q,desktopStatic:!0,children:t.jsx(oe,{category:i,subCategory:l,onCategory:x,onSub:p})}),t.jsx(k,{}),t.jsxs(j,{title:s("filter.price"),open:M,onToggle:()=>B(n=>!n),summary:Z,desktopStatic:!0,children:[t.jsxs(me,{children:[t.jsxs(T,{children:[t.jsx(N,{children:s("assets.min")}),t.jsxs(F,{children:[t.jsx(P,{name:v.iconName,"aria-hidden":!0}),t.jsx(I,{type:"number",min:"0","aria-label":s("assets.minPriceAria"),placeholder:"0",value:r,onChange:n=>u(n.target.value)})]})]}),t.jsx(ue,{children:s("assets.priceTo")}),t.jsxs(T,{children:[t.jsx(N,{children:s("assets.max")}),t.jsxs(F,{children:[t.jsx(P,{name:v.iconName,"aria-hidden":!0}),t.jsx(I,{type:"number",min:"0","aria-label":s("assets.maxPriceAria"),placeholder:"0",value:h,onChange:n=>f(n.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":s("assets.minPriceSliderAria"),onChange:n=>q(Number(n.target.value))}),t.jsx(A,{type:"range",min:0,max:d,value:$,"aria-label":s("assets.maxPriceSliderAria"),onChange:n=>J(Number(n.target.value))})]}),t.jsxs($e,{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}),$.toLocaleString()]})]})]}),t.jsx(k,{}),t.jsx(j,{title:s("assets.rarity"),open:G,onToggle:()=>K(n=>!n),summary:ee,headerTestId:"sidebar-section-toggle",children:t.jsx(ye,{"data-testid":"rarity-filter",children:z.map(n=>{const a=g.includes(n);return t.jsxs(ve,{type:"button",selected:a,"aria-pressed":a,onClick:()=>E(n),"data-testid":"rarity-filter-check",children:[t.jsx(ke,{color:e.rarities[n],children:a?t.jsx(je,{name:"check","aria-hidden":!0}):null}),t.jsx(Se,{selected:a,children:n})]},n)})})}),t.jsx(k,{}),t.jsx(j,{title:s("filter.status"),open:U,onToggle:()=>W(n=>!n),summary:te,children:[["all",s("filter.statusAll")],["on_sale",s("filter.onSale")],["not_for_sale",s("filter.notForSale")]].map(([n,a])=>t.jsxs(Re,{children:[t.jsx(Ce,{type:"radio",name:"shop-status",checked:S===n,onChange:()=>L(n)}),t.jsx(ze,{children:a})]},n))}),t.jsx(k,{}),t.jsxs(Te,{children:[t.jsxs(Ne,{children:[t.jsx(Fe,{name:"smart","aria-hidden":!0}),t.jsx(Pe,{children:s("filter.smart")}),t.jsx(se,{content:s("filter.smartHint"),placement:"bottom",children:t.jsx(Ie,{name:"info",role:"img","aria-label":s("filter.smartHint"),tabIndex:0})})]}),t.jsx(Ae,{type:"button",role:"switch",on:b,"aria-checked":b,"aria-label":s("filter.smart"),onClick:()=>O(!b),children:t.jsx(He,{on:b})})]})]})}const Be=o.div`
|
|
371
371
|
position: relative;
|
|
372
372
|
display: flex;
|
|
373
373
|
gap: 32px;
|
|
@@ -404,12 +404,13 @@ import{r as $,j as t}from"./react-BrLDncxD.js";import{R as z,a as oe,C as ie,c a
|
|
|
404
404
|
/* Reserve the scrollbar gutter so revealing the bar on hover doesn't shift the filter content. */
|
|
405
405
|
scrollbar-gutter: stable;
|
|
406
406
|
|
|
407
|
-
/*
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
407
|
+
/* Subtle scrollbar (matches the cart scroll list). The track width is reserved CONSTANTLY — the same
|
|
408
|
+
8px at rest and on hover — so revealing the scrollbar never consumes space and pushes the sidebar
|
|
409
|
+
content left. Only the THUMB fades in on hover; at rest both thumb and track are transparent, so
|
|
410
|
+
the gutter is invisible but its space is already held. Firefox keeps scrollbar-width: thin (not
|
|
411
|
+
none -> thin, which would also shift) and just recolours the thumb on hover. */
|
|
412
|
+
scrollbar-width: thin;
|
|
411
413
|
scrollbar-color: transparent transparent;
|
|
412
|
-
transition: scrollbar-color 0.2s ease;
|
|
413
414
|
&::-webkit-scrollbar {
|
|
414
415
|
width: 8px;
|
|
415
416
|
}
|
|
@@ -421,9 +422,7 @@ import{r as $,j as t}from"./react-BrLDncxD.js";import{R as z,a as oe,C as ie,c a
|
|
|
421
422
|
border-radius: 8px;
|
|
422
423
|
transition: background 0.2s ease;
|
|
423
424
|
}
|
|
424
|
-
|
|
425
425
|
&:hover {
|
|
426
|
-
scrollbar-width: thin;
|
|
427
426
|
scrollbar-color: ${e.colors.muted2} transparent;
|
|
428
427
|
}
|
|
429
428
|
&:hover::-webkit-scrollbar-thumb {
|
|
@@ -455,7 +454,7 @@ import{r as $,j as t}from"./react-BrLDncxD.js";import{R as z,a as oe,C as ie,c a
|
|
|
455
454
|
visibility: visible;
|
|
456
455
|
}
|
|
457
456
|
}
|
|
458
|
-
`,
|
|
457
|
+
`,Ue=o.div`
|
|
459
458
|
${e.media.down("lg")} {
|
|
460
459
|
flex: 1;
|
|
461
460
|
min-height: 0;
|
|
@@ -463,7 +462,7 @@ import{r as $,j as t}from"./react-BrLDncxD.js";import{R as z,a as oe,C as ie,c a
|
|
|
463
462
|
/* Room so the last filter row clears the sticky "Show items" bar (Figma bottom bar). */
|
|
464
463
|
padding-bottom: 24px;
|
|
465
464
|
}
|
|
466
|
-
`,
|
|
465
|
+
`,We=o.div`
|
|
467
466
|
position: fixed;
|
|
468
467
|
inset: 0;
|
|
469
468
|
z-index: 9998;
|
|
@@ -544,4 +543,4 @@ import{r as $,j as t}from"./react-BrLDncxD.js";import{R as z,a as oe,C as ie,c a
|
|
|
544
543
|
outline: 2px solid ${e.colors.accent};
|
|
545
544
|
outline-offset: 2px;
|
|
546
545
|
}
|
|
547
|
-
`;export{qe as C,
|
|
546
|
+
`;export{qe as C,k as D,j as F,Ge as M,ye as R,Re as S,ve as a,ke as b,je as c,Se as d,Ce as e,ze as f,Be as g,We as h,Ke as i,Ve as j,Xe as k,Ue as l,Je as m,Qe as n,Me as o};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as t,L as R,r as L}from"./react-BrLDncxD.js";import{s as a,B as
|
|
1
|
+
import{j as t,L as R,r as L}from"./react-BrLDncxD.js";import{s as a,B as N,F as e,N as q,u as B,t as i,d as D,e as F,I as x,h as G,m as A,o as H,c as Q,J as y,E as K,H as z}from"./index-Q9d0V8TZ.js";import{g as M,a as W,s as J,b as O}from"./authorizations-C600xDT9.js";import{f as P}from"./errors-B2rT3Gvo.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DYZXk5O5.js";import"./ethers-CLB2z3On.js";import"./intl-CBcMB1D2.js";import"./index-HN6Rk25C.js";const X=q`
|
|
2
2
|
to { transform: rotate(360deg); }
|
|
3
3
|
`,U=a.section`
|
|
4
4
|
width: 100%;
|
|
@@ -158,6 +158,6 @@ import{j as t,L as R,r as L}from"./react-BrLDncxD.js";import{s as a,B as q,F as
|
|
|
158
158
|
font-size: 22px;
|
|
159
159
|
font-weight: 700;
|
|
160
160
|
margin: 6px 0 0;
|
|
161
|
-
`,ct=a(
|
|
161
|
+
`,ct=a(N)`
|
|
162
162
|
margin-top: 12px;
|
|
163
|
-
`;function C({descriptor:o,owner:n,signer:l,name:s,description:d,image:r,icon:u}){const T=H(),[m,g]=L.useState(!1),{data:c,isLoading:p,refetch:E}=A({queryKey:["authorization",o.id,n],queryFn:()=>O(o,n),staleTime:3e4});async function I(){if(m||p)return;const h=!c;g(!0);try{await J({auth:o,signer:l,active:h}),await E(),T.setQueryData(["authorization",o.id,n],h),y.success(h?i("authorizations.toastActivated",{name:s}):i("authorizations.toastDeactivated",{name:s}))}catch(f){
|
|
163
|
+
`;function C({descriptor:o,owner:n,signer:l,name:s,description:d,image:r,icon:u}){const T=H(),[m,g]=L.useState(!1),{data:c,isLoading:p,refetch:E}=A({queryKey:["authorization",o.id,n],queryFn:()=>O(o,n),staleTime:3e4});async function I(){if(m||p)return;const h=!c;g(!0);try{await J({auth:o,signer:l,active:h}),await E(),T.setQueryData(["authorization",o.id,n],h),y.success(h?i("authorizations.toastActivated",{name:s}):i("authorizations.toastDeactivated",{name:s}))}catch(f){K(f,{flow:"authorizations",step:h?"grant":"revoke"}),y.error(P(f,i("authorizations.errorGeneric")))}finally{g(!1)}}const S=p?i("authorizations.checking"):c?i("authorizations.active"):i("authorizations.inactive");return t.jsxs(_,{"data-testid":`authorization-${o.id}`,"data-active":!!c,children:[t.jsx(tt,{children:r?t.jsx("img",{src:r,alt:""}):u}),t.jsxs(it,{children:[t.jsx(ot,{title:s,children:s}),t.jsx(et,{children:d})]}),t.jsxs(st,{children:[t.jsx(at,{"data-active":!!c,children:S}),m?t.jsx(rt,{"aria-label":i("authorizations.working")}):t.jsx(nt,{type:"button","data-testid":`authorization-toggle-${o.id}`,"data-active":!!c,role:"switch","aria-checked":!!c,"aria-label":c?i("authorizations.deactivateAria",{name:s}):i("authorizations.activateAria",{name:s}),disabled:p,onClick:()=>void I()})]})]})}function lt(o){return A({queryKey:["owned-collections",o],enabled:!!o,staleTime:6e4,queryFn:async()=>{const[n,l]=await Promise.all([z(o,{category:"wearable",first:96}),z(o,{category:"emote",first:96})]),s=new Map;for(const d of[...n.assets,...l.assets]){const r=d.contractAddress.toLowerCase();s.has(r)||s.set(r,d)}return[...s.values()]}})}function zt(){B({title:i("authorizations.title"),noindex:!0});const{session:o}=D(),n=Q.chainId,l=F(o==null?void 0:o.providerType),{data:s,isLoading:d}=lt(l?o==null?void 0:o.address:void 0);if(!o)return t.jsxs($,{children:[t.jsx(x,{name:"info",size:40,color:"var(--muted-2)"}),t.jsx(k,{children:i("authorizations.signInTitle")}),t.jsx("p",{className:"muted",children:i("authorizations.signInBody")})]});if(!l)return t.jsxs($,{children:[t.jsx(x,{name:"check",size:40,color:"var(--ok)"}),t.jsx(k,{children:i("authorizations.managedTitle")}),t.jsx("p",{className:"muted",children:i("authorizations.managedBody")}),t.jsx(ct,{as:R,to:"/assets",variant:"purple",children:i("authorizations.managedCta")})]});const r=M(n);return t.jsxs(U,{children:[t.jsxs(V,{children:[t.jsx(Y,{children:i("authorizations.title")}),t.jsx(Z,{children:i("authorizations.intro")})]}),t.jsxs(j,{children:[t.jsx(w,{children:i("authorizations.buyingTitle")}),t.jsx(b,{children:t.jsx(C,{descriptor:r,owner:o.address,signer:o.signer,name:i("authorizations.creditsName"),description:i("authorizations.creditsDesc"),icon:t.jsx(G,{className:"ccy-mark"})})})]}),t.jsxs(j,{children:[t.jsx(w,{children:i("authorizations.sellingTitle")}),d?t.jsx(v,{children:i("authorizations.checking")}):s&&s.length>0?t.jsx(b,{children:s.map(u=>t.jsx(C,{descriptor:W(u.contractAddress,n),owner:o.address,signer:o.signer,name:u.name||i("authorizations.collectionFallback"),description:i("authorizations.sellingDesc"),image:u.image,icon:t.jsx(x,{name:"pen",size:18})},u.contractAddress))}):t.jsx(v,{children:i("authorizations.sellingEmpty")})]})]})}export{zt as Authorizations};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{j as e,r as
|
|
1
|
+
import{j as e,r as x,a as Me,u as Ee,L as Z}from"./react-BrLDncxD.js";import{t as a,h as L,j as H,u as Pe,af as v,a as le,d as qe,m as Te,n as Ie,o as Le,I,g as Fe,e as Be,x as G,ah as de,ai as Re,E as A,s as Ae,B as Ue,C as We,w as ze,q as ue,aj as $e,z as he,y as Qe,ak as Ke}from"./index-Q9d0V8TZ.js";import{a as me}from"./buy-C5J6mAtx.js";import{g as Oe,a as Ge,w as De,S as He,G as Je}from"./buy-gasless-Sy6Gurph.js";import{R as D,r as Ve}from"./cart-checkout-BwJruvi6.js";import{u as Ye,c as Xe}from"./useCreditPacks-Be9cG5vr.js";import{l as Ze}from"./loader-logo-BzY9EKdC.js";import{i as es,a as ss}from"./errors-B2rT3Gvo.js";import{E as as}from"./ErrorNotice-BDH9xoG4.js";import{C as ts}from"./CollectionCarousel-BgmGp9gP.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DYZXk5O5.js";import"./ethers-CLB2z3On.js";import"./intl-CBcMB1D2.js";import"./authorizations-C600xDT9.js";import"./index-HN6Rk25C.js";import"./trade-encoding-CaZYjVNs.js";const rs="https://cdn.decentraland.org/@dcl/shop/0.1.0-29942650568.commit-3cdb6da/assets/buy-error-22UunaPC.png";function cs(r){const{phase:n,balanceCredits:h,onClose:m}=r,C=n==="processing",w=n==="error"?a("cartCheckout.errorTitle"):n==="nofunds"?a("cartCheckout.titleNoFunds"):a("cartCheckout.titleBuy"),S=n==="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:C?void 0:m,"aria-hidden":!0}),e.jsxs("div",{className:`buy-modal__card${S?" buy-modal__card--tall":""}`,children:[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:w}),!C&&e.jsx("button",{className:"buy-modal__x",onClick:m,"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:n==="nofunds"?a("buyModal.dclBalance"):a("buyModal.myCreditsBalance")}),e.jsx(L,{className:"buy-modal__balance-ico"}),e.jsx("span",{className:"buy-modal__balance-value",children:H(h)})]})]}),n==="processing"&&e.jsx(ns,{stage:r.stage??"reserving",step:r.step??1,total:r.total??1,isSelfCustody:!!r.isSelfCustody}),n==="nofunds"&&e.jsx(is,{lines:r.lines??[],shortfallCredits:r.shortfallCredits??0,packs:r.packs??[],selectedPack:r.selectedPack??"",onSelectPack:r.onSelectPack??(()=>{}),onBuyPacks:r.onBuyPacks??(()=>{}),onCancel:m}),n==="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:m,children:a("buyModal.cancel")}),e.jsx("button",{className:"buy-modal__btn buy-modal__btn--purple",onClick:r.onRetry??m,children:a("cartCheckout.tryAgain")})]})]})]})]})}function ns({stage:r,step:n,total:h,isSelfCustody:m}){const C=r==="reserving",w=h>0?Math.min(100,Math.round(n/h*100)):0,S=r==="awaiting-signature"?m?a("buyModal.confirmToContinue"):a("buyModal.completingTransaction"):r==="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:Ze,alt:"",width:61,height:61}),e.jsx("div",{className:"buy-modal__processing-text",children:S}),C?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}%`}})}),h>1?e.jsxs("span",{className:"cart-checkout__step",children:[n,"/",h]}):null]}):e.jsx("div",{className:"buy-modal__progress","aria-hidden":!0,children:e.jsx("span",{className:"buy-modal__progress-fill"})})]})}function is({lines:r,shortfallCredits:n,packs:h,selectedPack:m,onSelectPack:C,onBuyPacks:w,onCancel:S}){const N=h.find(t=>t.id===m),J=r.reduce((t,_)=>t+(_.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,n)})})," ",a("buyModal.warningToPurchase",{count:J})]})]}),e.jsx("div",{className:"cart-checkout__scroll",children:r.map(t=>{const _=t.quantity??1;return e.jsxs("div",{className:"buy-modal__asset",children:[e.jsx("div",{className:"buy-modal__asset-thumb",children:t.item.thumbnail?e.jsx("img",{src:t.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:t.item.name,children:[t.item.name||a("buyModal.itemFallback"),_>1?e.jsx("span",{className:"cart-checkout__qty-tag",children:a("cartCheckout.qty",{count:_})}):null]}),t.item.creator?e.jsx("div",{className:"buy-modal__asset-creator",children:a("search.byCreator",{name:t.item.creator})}):null]}),e.jsxs("div",{className:"buy-modal__asset-price",children:[e.jsx(L,{className:"buy-modal__asset-price-ico"}),e.jsx("span",{children:H(t.priceCredits*_)})]})]})]},t.item.id)})}),e.jsx("div",{className:"buy-modal__packs",children:h.map(t=>{const _=t.id===m;return e.jsxs("button",{className:`buy-modal__pack${_?" buy-modal__pack--on":""}`,onClick:()=>C(t.id),children:[e.jsx(L,{className:"buy-modal__pack-ico"}),e.jsx("span",{className:"buy-modal__pack-amount",children:H(t.credits)}),e.jsxs("span",{className:"buy-modal__pack-usd",children:["($",t.usd.toFixed(2),")"]})]},t.id)})}),e.jsxs("div",{className:"buy-modal__total",children:[e.jsxs("div",{className:"buy-modal__total-credits",children:[e.jsx(L,{className:"buy-modal__total-ico"}),e.jsx("span",{children:H((N==null?void 0:N.credits)??0)})]}),e.jsxs("span",{className:"buy-modal__total-usd",children:["$",((N==null?void 0:N.usd)??0).toFixed(2)]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:S,children:a("buyModal.cancel")}),e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient",onClick:w,children:a("buyModal.buy")})]})]})}const os=Ae(Ue)`
|
|
2
2
|
margin-top: 12px;
|
|
3
|
-
`;function _e(r){if(es(r))return a("errors.rejected");const n=(r.message??"").toLowerCase();return n.includes("insufficient")?a("cart.error.insufficient",{currency:We.name}):n.includes("no active listing")||n.includes("your own listing")?a("cart.error.listingChanged"):a("marketCheckout.error.generic")}const ls=12e4;function ds(r){const n=[];return r.unavailable.length&&n.push(a("cart.drop.unavailable",{count:r.unavailable.length})),r.own.length&&n.push(a("cart.drop.own",{count:r.own.length})),a("cart.drop.removed",{items:n.join(` ${a("cart.drop.and")} `)})}const ye=r=>r.reduce((n,h)=>n+h.priceCredits*h.quantity,0),us=r=>r.flatMap(n=>Array.from({length:n.quantity},()=>({...n,quantity:1})));function Es(){Pe({title:a("nav.cart"),noindex:!0});const r=v(s=>s.items),n=v(s=>s.remove),h=v(s=>s.increment),m=v(s=>s.decrement),C=v(s=>s.clear),w=v(s=>s.restore),S=v(s=>s.setFittingOpen),N=le(s=>s.items),J=le(s=>s.toggle),{session:t}=qe(),_=Ye().packs.slice(0,3);f.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const pe=r.some(s=>s.category!=="emote"),{data:V}=Te({queryKey:["upsell-listings"],queryFn:()=>Ke({first:40}),staleTime:6e4}),{data:F}=Ie(t),U=Le(),W=Me(),{state:T}=Ee(),[ee,B]=f.useState(null),[be,M]=f.useState(null),[se,z]=f.useState(null),[ge,E]=f.useState(!1),[x,R]=f.useState(null),ae=f.useRef(0),[l,k]=f.useState(null),[Y,te]=f.useState(""),fe=r.reduce((s,c)=>s+c.priceCredits*c.quantity,0),re=r.reduce((s,c)=>s+c.quantity,0),xe=x?x.liveTotalCredits:fe,ke=new Set(r.map(s=>s.id)),ce=((V==null?void 0:V.items)??[]).filter(s=>!ke.has(s.id)).slice(0,12),je=new Map(x==null?void 0:x.buyable.map(s=>[s.item.id,s])),$=(F==null?void 0:F.credits)??0,ve=Re;function Q(s){s(),R(null),z(null),M(null)}function Ce(){k(null),E(!1)}function ne(s){const c=ye(s),i=Math.max(0,c-$),p=_.find(d=>d.credits>=i)??_[_.length-1];te(p.id),G("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:c,credits_balance:$,shortfall:i}),k({phase:"nofunds",lines:s.map(d=>({item:d.item,priceCredits:d.priceCredits,quantity:d.quantity})),shortfall:i}),E(!1)}async function Ne(s){if(!t||s.length===0)return;const c=us(s),i=c.map(o=>({...o.item,priceCredits:o.priceCredits})),p=s.map(o=>({...o.item,priceCredits:o.priceCredits,quantity:o.quantity})),d=[];let j="authorize",O=!1;k({phase:"processing",stage:"reserving",step:1,total:c.length});try{const o=[];for(let u=0;u<c.length;u++){const q=c[u];k({phase:"processing",stage:"reserving",step:u+1,total:c.length});try{const{credit:y,maxCreditedValue:X}=await ze(t.identity,q.usdCents,q.trade.id);d.push(y.id),o.push({trade:q.trade,credits:[y],maxCreditedValue:X})}catch(y){if(ss(y)){if(d.length){try{await ue(t.identity,d)}catch(X){A(X,{flow:"cart_checkout",step:"release"})}U.invalidateQueries({queryKey:["usd-balance"]})}ne(s);return}throw y}}j="submit";const b=()=>k({phase:"processing",stage:"settling",step:c.length,total:c.length});k({phase:"processing",stage:"awaiting-signature",step:c.length,total:c.length});let g=[];if(Oe())try{g=await Ge({purchases:o,buyer:t.address,signer:t.signer,onSigned:b});const q=(await Promise.allSettled(g.map(y=>De(y)))).flatMap(y=>y.status==="rejected"?[y.reason]:[]);if(q.length&&!q.some(y=>y instanceof He))throw q[0];O=!0}catch(u){if(!(u instanceof Je))throw u;g=await me({purchases:o,buyer:t.address,signer:t.signer,onSigned:b})}else g=await me({purchases:o,buyer:t.address,signer:t.signer});s.forEach(u=>n(u.item.id)),R(null),G("Shop Completed Purchase",{...$e(i),payment_type:"credits",no_crypto_step:O,transaction_hash:g[0]??null}),U.invalidateQueries({queryKey:["usd-balance"]}),k(null),E(!1),W("/success",{state:{items:p,txHash:g[0]??void 0,settled:!0},replace:!0})}catch(o){if(he(o)||A(o,{flow:"cart_checkout",step:j,cart_size:s.length}),G(he(o)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:j,error_code:Qe(o),value_usd:de(i.reduce((b,g)=>b+g.priceCredits,0)),cart_size:c.length}),d.length){try{await ue(t.identity,d)}catch(b){A(b,{flow:"cart_checkout",step:"release"})}U.invalidateQueries({queryKey:["usd-balance"]})}k({phase:"error",message:_e(o)})}}function ie(s){const c=ye(s);if(F!=null&&F.credits<c){ne(s);return}Ne(s)}async function K(){if(!t){M(a("buyModal.signInToCheckout"));return}const s=v.getState().items;if(s.length===0)return;M(null),z(null),E(!0);const c=s.reduce((i,p)=>i+p.priceCredits*p.quantity,0);G("Shop Started Checkout",{cart_size:s.length,cart_value_credits:c,cart_value_usd:de(c),has_sufficient_credits:$>=c});try{B(a("cart.status.reviewing"));const i=await Ve(s,t.address,ve),p=[...i.unavailable,...i.own];if(p.length&&(p.forEach(d=>n(d.id)),z(ds(i))),i.buyable.length===0){M(a("cart.error.noneAvailable")),R(null),B(null);return}if(i.orderChanged){R(i),ae.current=Date.now(),B(null);return}B(null),ie(i.buyable)}catch(i){A(i,{flow:"cart_checkout",step:"review",cart_size:s.length}),M(_e(i)),B(null)}finally{E(!1)}}async function we(){if(x){if(!t){M(a("buyModal.signInToCheckout"));return}if(Date.now()-ae.current>ls){R(null),z(null),await K();return}M(null),ie(x.buyable)}}async function Se(){if(Y){try{sessionStorage.setItem(D,JSON.stringify(v.getState().items))}catch{}E(!0);try{const s=await Xe(Y,t?{address:t.address,identity:t.identity}:void 0);if(s.url){window.location.href=s.url;return}W("/credits")}catch(s){try{sessionStorage.removeItem(D)}catch{}A(s,{flow:"cart_buy_credits"}),k({phase:"error",message:a("buyModal.error.creditsCheckout")})}finally{E(!1)}}}const oe=f.useRef(!1);f.useEffect(()=>{if(!(T!=null&&T.resumeCheckout)||oe.current)return;oe.current=!0;try{const c=sessionStorage.getItem(D);if(c){sessionStorage.removeItem(D);const i=JSON.parse(c);Array.isArray(i)&&i.length&&w(i)}}catch{}U.invalidateQueries({queryKey:["usd-balance"]});const s=setTimeout(()=>void K(),0);return()=>clearTimeout(s)},[T==null?void 0:T.resumeCheckout]);const P=ge||(l==null?void 0:l.phase)==="processing";return r.length===0&&!l?e.jsxs("div",{className:"cart cart--empty",children:[e.jsx(I,{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(os,{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:()=>W(-1),type:"button",children:[e.jsx(I,{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:()=>W(-1),type:"button","aria-label":a("cart.goBack"),children:e.jsx(I,{name:"arrow-left"})}),e.jsx("h1",{className:"checkout__panel-title",children:a("cart.panelTitle",{count:re})}),pe?e.jsxs("button",{className:"checkout__fitting",onClick:()=>S(!0),disabled:P,children:[e.jsx(I,{name:"fitting-room"}),a("cart.fittingRoom")]}):null]}),e.jsxs("section",{className:"checkout__panel",children:[e.jsx("div",{className:"checkout__list",children:r.map(s=>{const c=je.get(s.id),i=c?c.priceCredits:s.priceCredits,p=!!c&&c.priceCredits!==s.priceCredits,d=!s.tokenId,j=s.quantity,O=typeof s.available=="number"&&j>=s.available,o=i*j,b=!!N[s.id],g=s.tokenId??s.itemId,u=s.contractAddress&&g?`/item/${s.contractAddress}/${g}`:null;return e.jsxs("div",{className:"checkout__card",children:[e.jsxs("div",{className:"checkout__thumb",children:[u?e.jsx(Z,{className:"checkout__thumb-link",to:u,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:[u?e.jsx(Z,{className:"checkout__name",to:u,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(Fe,{address:s.creator,className:"checkout__creator",linkToProfile:!0}):null]}),e.jsxs("div",{className:"checkout__foot",children:[d?e.jsxs("div",{className:"checkout__stepper",children:[e.jsx("button",{className:"checkout__step",onClick:()=>Q(()=>m(s.id)),disabled:P||j<=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:j}),e.jsx("button",{className:"checkout__step",onClick:()=>Q(()=>h(s.id)),disabled:P||O,"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(L,{className:"checkout__price-ico"})," ",o,p?e.jsx("span",{className:"checkout__price-was",children:s.priceCredits*j}):null]})]})]}),e.jsxs("div",{className:"checkout__actions",children:[e.jsx("button",{className:`checkout__fav${b?" is-on":""}`,onClick:()=>J(s),"aria-label":b?a("cart.removeFromFavorites",{name:s.name}):a("cart.addToFavorites",{name:s.name}),title:b?a("assetCard.removeFromFavorites"):a("assetCard.addToFavorites"),children:e.jsx(I,{name:b?"heart-solid":"heart"})}),e.jsx("button",{className:"checkout__remove",onClick:()=>Q(()=>n(s.id)),disabled:P,"aria-label":a("cart.remove",{name:s.name}),title:a("cart.removeTitle"),children:e.jsx(I,{name:"trash",size:24})})]})]},s.id)})}),e.jsx("div",{className:"checkout__utils",children:e.jsx("button",{className:"link",onClick:()=>Q(C),disabled:P,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:re})}),e.jsxs("span",{className:"checkout__total-value",children:[e.jsx(L,{className:"checkout__total-ico"})," ",xe]})]}),e.jsx("button",{className:"checkout__cta",onClick:()=>void(x?we():K()),disabled:P,children:P?a("cart.working"):x?a("marketCheckout.confirmPurchase"):a("assetCard.buyNow")}),x?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(as,{message:be,className:"checkout__msg"})]})]})]})]}),ce.length>0?e.jsx("div",{className:"cart-upsell",children:e.jsx(ts,{title:a("cart.youMightAlsoLike"),items:ce})}):null,l?e.jsx(cs,{phase:l.phase,balanceCredits:$,onClose:Ce,stage:l.phase==="processing"?l.stage:void 0,step:l.phase==="processing"?l.step:void 0,total:l.phase==="processing"?l.total:void 0,isSelfCustody:Be(t==null?void 0:t.providerType),lines:l.phase==="nofunds"?l.lines:void 0,shortfallCredits:l.phase==="nofunds"?l.shortfall:void 0,packs:_,selectedPack:Y,onSelectPack:te,onBuyPacks:()=>void Se(),message:l.phase==="error"?l.message:void 0,onRetry:()=>void K()}):null]})}export{Es as Cart};
|
|
3
|
+
`;function _e(r){if(es(r))return a("errors.rejected");const n=(r.message??"").toLowerCase();return n.includes("insufficient")?a("cart.error.insufficient",{currency:We.name}):n.includes("no active listing")||n.includes("your own listing")?a("cart.error.listingChanged"):a("marketCheckout.error.generic")}const ls=12e4;function ds(r){const n=[];return r.unavailable.length&&n.push(a("cart.drop.unavailable",{count:r.unavailable.length})),r.own.length&&n.push(a("cart.drop.own",{count:r.own.length})),a("cart.drop.removed",{items:n.join(` ${a("cart.drop.and")} `)})}const ye=r=>r.reduce((n,h)=>n+h.priceCredits*h.quantity,0),us=r=>r.flatMap(n=>Array.from({length:n.quantity},()=>({...n,quantity:1})));function Es(){Pe({title:a("nav.cart"),noindex:!0});const r=v(s=>s.items),n=v(s=>s.remove),h=v(s=>s.increment),m=v(s=>s.decrement),C=v(s=>s.clear),w=v(s=>s.restore),S=v(s=>s.setFittingOpen),N=le(s=>s.items),J=le(s=>s.toggle),{session:t}=qe(),_=Ye().packs.slice(0,3);x.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const pe=r.some(s=>s.category!=="emote"),{data:V}=Te({queryKey:["upsell-listings"],queryFn:()=>Ke({first:40}),staleTime:6e4}),{data:F}=Ie(t),U=Le(),W=Me(),{state:T}=Ee(),[ee,B]=x.useState(null),[be,M]=x.useState(null),[se,z]=x.useState(null),[ge,E]=x.useState(!1),[f,R]=x.useState(null),ae=x.useRef(0),[l,k]=x.useState(null),[Y,te]=x.useState(""),xe=r.reduce((s,c)=>s+c.priceCredits*c.quantity,0),re=r.reduce((s,c)=>s+c.quantity,0),fe=f?f.liveTotalCredits:xe,ke=new Set(r.map(s=>s.id)),ce=((V==null?void 0:V.items)??[]).filter(s=>!ke.has(s.id)).slice(0,12),je=new Map(f==null?void 0:f.buyable.map(s=>[s.item.id,s])),$=(F==null?void 0:F.credits)??0,ve=Re;function Q(s){s(),R(null),z(null),M(null)}function Ce(){k(null),E(!1)}function ne(s){const c=ye(s),i=Math.max(0,c-$),p=_.find(d=>d.credits>=i)??_[_.length-1];te(p.id),G("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:c,credits_balance:$,shortfall:i}),k({phase:"nofunds",lines:s.map(d=>({item:d.item,priceCredits:d.priceCredits,quantity:d.quantity})),shortfall:i}),E(!1)}async function Ne(s){if(!t||s.length===0)return;const c=us(s),i=c.map(o=>({...o.item,priceCredits:o.priceCredits})),p=s.map(o=>({...o.item,priceCredits:o.priceCredits,quantity:o.quantity})),d=[];let j="authorize",O=!1;k({phase:"processing",stage:"reserving",step:1,total:c.length});try{const o=[];for(let u=0;u<c.length;u++){const q=c[u];k({phase:"processing",stage:"reserving",step:u+1,total:c.length});try{const{credit:y,maxCreditedValue:X}=await ze(t.identity,q.usdCents,q.trade.id);d.push(y.id),o.push({trade:q.trade,credits:[y],maxCreditedValue:X})}catch(y){if(ss(y)){if(d.length){try{await ue(t.identity,d)}catch(X){A(X,{flow:"cart_checkout",step:"release"})}U.invalidateQueries({queryKey:["usd-balance"]})}ne(s);return}throw y}}j="submit";const b=()=>k({phase:"processing",stage:"settling",step:c.length,total:c.length});k({phase:"processing",stage:"awaiting-signature",step:c.length,total:c.length});let g=[];if(Oe())try{g=await Ge({purchases:o,buyer:t.address,signer:t.signer,onSigned:b});const q=(await Promise.allSettled(g.map(y=>De(y)))).flatMap(y=>y.status==="rejected"?[y.reason]:[]);if(q.length&&!q.some(y=>y instanceof He))throw q[0];O=!0}catch(u){if(!(u instanceof Je))throw u;g=await me({purchases:o,buyer:t.address,signer:t.signer,onSigned:b})}else g=await me({purchases:o,buyer:t.address,signer:t.signer});s.forEach(u=>n(u.item.id)),R(null),G("Shop Completed Purchase",{...$e(i),payment_type:"credits",no_crypto_step:O,transaction_hash:g[0]??null}),U.invalidateQueries({queryKey:["usd-balance"]}),k(null),E(!1),W("/success",{state:{items:p,txHash:g[0]??void 0,settled:!0},replace:!0})}catch(o){if(he(o)||A(o,{flow:"cart_checkout",step:j,cart_size:s.length}),G(he(o)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:j,error_code:Qe(o),value_usd:de(i.reduce((b,g)=>b+g.priceCredits,0)),cart_size:c.length}),d.length){try{await ue(t.identity,d)}catch(b){A(b,{flow:"cart_checkout",step:"release"})}U.invalidateQueries({queryKey:["usd-balance"]})}k({phase:"error",message:_e(o)})}}function ie(s){const c=ye(s);if(F!=null&&F.credits<c){ne(s);return}Ne(s)}async function K(){if(!t){M(a("buyModal.signInToCheckout"));return}const s=v.getState().items;if(s.length===0)return;M(null),z(null),E(!0);const c=s.reduce((i,p)=>i+p.priceCredits*p.quantity,0);G("Shop Started Checkout",{cart_size:s.length,cart_value_credits:c,cart_value_usd:de(c),has_sufficient_credits:$>=c});try{B(a("cart.status.reviewing"));const i=await Ve(s,t.address,ve),p=[...i.unavailable,...i.own];if(p.length&&(p.forEach(d=>n(d.id)),z(ds(i))),i.buyable.length===0){M(a("cart.error.noneAvailable")),R(null),B(null);return}if(i.orderChanged){R(i),ae.current=Date.now(),B(null);return}B(null),ie(i.buyable)}catch(i){A(i,{flow:"cart_checkout",step:"review",cart_size:s.length}),M(_e(i)),B(null)}finally{E(!1)}}async function we(){if(f){if(!t){M(a("buyModal.signInToCheckout"));return}if(Date.now()-ae.current>ls){R(null),z(null),await K();return}M(null),ie(f.buyable)}}async function Se(){if(Y){try{sessionStorage.setItem(D,JSON.stringify(v.getState().items))}catch{}E(!0);try{const s=await Xe(Y,t?{address:t.address,identity:t.identity}:void 0);if(s.url){window.location.href=s.url;return}W("/credits")}catch(s){try{sessionStorage.removeItem(D)}catch{}A(s,{flow:"cart_buy_credits"}),k({phase:"error",message:a("buyModal.error.creditsCheckout")})}finally{E(!1)}}}const oe=x.useRef(!1);x.useEffect(()=>{if(!(T!=null&&T.resumeCheckout)||oe.current)return;oe.current=!0;try{const c=sessionStorage.getItem(D);if(c){sessionStorage.removeItem(D);const i=JSON.parse(c);Array.isArray(i)&&i.length&&w(i)}}catch{}U.invalidateQueries({queryKey:["usd-balance"]});const s=setTimeout(()=>void K(),0);return()=>clearTimeout(s)},[T==null?void 0:T.resumeCheckout]);const P=ge||(l==null?void 0:l.phase)==="processing";return r.length===0&&!l?e.jsxs("div",{className:"cart cart--empty",children:[e.jsx(I,{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(os,{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:()=>W(-1),type:"button",children:[e.jsx(I,{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:()=>W(-1),type:"button","aria-label":a("cart.goBack"),children:e.jsx(I,{name:"arrow-left"})}),e.jsx("h1",{className:"checkout__panel-title",children:a("cart.panelTitle",{count:re})}),pe?e.jsxs("button",{className:"checkout__fitting",onClick:()=>S(!0),disabled:P,children:[e.jsx(I,{name:"fitting-room"}),a("cart.fittingRoom")]}):null]}),e.jsxs("section",{className:"checkout__panel",children:[e.jsx("div",{className:"checkout__list",children:r.map(s=>{const c=je.get(s.id),i=c?c.priceCredits:s.priceCredits,p=!!c&&c.priceCredits!==s.priceCredits,d=!s.tokenId,j=s.quantity,O=typeof s.available=="number"&&j>=s.available,o=i*j,b=!!N[s.id],g=s.tokenId??s.itemId,u=s.contractAddress&&g?`/item/${s.contractAddress}/${g}`:null;return e.jsxs("div",{className:"checkout__card",children:[e.jsxs("div",{className:"checkout__thumb",children:[u?e.jsx(Z,{className:"checkout__thumb-link",to:u,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:[u?e.jsx(Z,{className:"checkout__name",to:u,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(Fe,{address:s.creator,className:"checkout__creator",linkToProfile:!0}):null]}),e.jsxs("div",{className:"checkout__foot",children:[d?e.jsxs("div",{className:"checkout__stepper",children:[e.jsx("button",{className:"checkout__step",onClick:()=>Q(()=>m(s.id)),disabled:P||j<=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:j}),e.jsx("button",{className:"checkout__step",onClick:()=>Q(()=>h(s.id)),disabled:P||O,"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(L,{className:"checkout__price-ico"})," ",o,p?e.jsx("span",{className:"checkout__price-was",children:s.priceCredits*j}):null]})]})]}),e.jsxs("div",{className:"checkout__actions",children:[e.jsx("button",{className:`checkout__fav${b?" is-on":""}`,onClick:()=>J(s),"aria-label":b?a("cart.removeFromFavorites",{name:s.name}):a("cart.addToFavorites",{name:s.name}),title:b?a("assetCard.removeFromFavorites"):a("assetCard.addToFavorites"),children:e.jsx(I,{name:b?"heart-solid":"heart"})}),e.jsx("button",{className:"checkout__remove",onClick:()=>Q(()=>n(s.id)),disabled:P,"aria-label":a("cart.remove",{name:s.name}),title:a("cart.removeTitle"),children:e.jsx(I,{name:"trash",size:24})})]})]},s.id)})}),e.jsx("div",{className:"checkout__utils",children:e.jsx("button",{className:"link",onClick:()=>Q(C),disabled:P,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:re})}),e.jsxs("span",{className:"checkout__total-value",children:[e.jsx(L,{className:"checkout__total-ico"})," ",fe]})]}),e.jsx("button",{className:"checkout__cta",onClick:()=>void(f?we():K()),disabled:P,children:P?a("cart.working"):f?a("marketCheckout.confirmPurchase"):a("assetCard.buyNow")}),f?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(as,{message:be,className:"checkout__msg"})]})]})]})]}),ce.length>0?e.jsx("div",{className:"cart-upsell",children:e.jsx(ts,{title:a("cart.youMightAlsoLike"),items:ce})}):null,l?e.jsx(cs,{phase:l.phase,balanceCredits:$,onClose:Ce,stage:l.phase==="processing"?l.stage:void 0,step:l.phase==="processing"?l.step:void 0,total:l.phase==="processing"?l.total:void 0,isSelfCustody:Be(t==null?void 0:t.providerType),lines:l.phase==="nofunds"?l.lines:void 0,shortfallCredits:l.phase==="nofunds"?l.shortfall:void 0,packs:_,selectedPack:Y,onSelectPack:te,onBuyPacks:()=>void Se(),message:l.phase==="error"?l.message:void 0,onRetry:()=>void K()}):null]})}export{Es as Cart};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{N,
|
|
1
|
+
import{O as N,P as U,Q as w,R as z,S as o,U as E,V as c,W as I,X as g,Y as D,N as R}from"./index-Q9d0V8TZ.js";import{r as W,j as v}from"./react-BrLDncxD.js";function F(r){return N("MuiCircularProgress",r)}U("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const K=["className","color","disableShrink","size","style","thickness","value","variant"];let l=r=>r,P,S,b,$;const t=44,V=R(P||(P=l`
|
|
2
2
|
0% {
|
|
3
3
|
transform: rotate(0deg);
|
|
4
4
|
}
|
|
@@ -6,7 +6,7 @@ import{N,O as U,P as w,Q as z,R as o,S as E,U as c,V as I,W as g,X as D,M}from".
|
|
|
6
6
|
100% {
|
|
7
7
|
transform: rotate(360deg);
|
|
8
8
|
}
|
|
9
|
-
`)),B=
|
|
9
|
+
`)),B=R(S||(S=l`
|
|
10
10
|
0% {
|
|
11
11
|
stroke-dasharray: 1px, 200px;
|
|
12
12
|
stroke-dashoffset: 0;
|
|
@@ -25,4 +25,4 @@ import{N,O as U,P as w,Q as z,R as o,S as E,U as c,V as I,W as g,X as D,M}from".
|
|
|
25
25
|
animation: ${0} 1.4s linear infinite;
|
|
26
26
|
`),V)),O=g("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(r,e)=>e.svg})({display:"block"}),Q=g("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(r,e)=>{const{ownerState:s}=r;return[e.circle,e[`circle${c(s.variant)}`],s.disableShrink&&e.circleDisableShrink]}})(({ownerState:r,theme:e})=>o({stroke:"currentColor"},r.variant==="determinate"&&{transition:e.transitions.create("stroke-dashoffset")},r.variant==="indeterminate"&&{strokeDasharray:"80px, 200px",strokeDashoffset:0}),({ownerState:r})=>r.variant==="indeterminate"&&!r.disableShrink&&D($||($=l`
|
|
27
27
|
animation: ${0} 1.4s ease-in-out infinite;
|
|
28
|
-
`),B)),
|
|
28
|
+
`),B)),Z=W.forwardRef(function(e,s){const a=w({props:e,name:"MuiCircularProgress"}),{className:d,color:u="primary",disableShrink:M=!1,size:m=40,style:_,thickness:i=3.6,value:p=0,variant:k="indeterminate"}=a,j=z(a,K),n=o({},a,{color:u,disableShrink:M,size:m,thickness:i,value:p,variant:k}),f=G(n),h={},x={},y={};if(k==="determinate"){const C=2*Math.PI*((t-i)/2);h.strokeDasharray=C.toFixed(3),y["aria-valuenow"]=Math.round(p),h.strokeDashoffset=`${((100-p)/100*C).toFixed(3)}px`,x.transform="rotate(-90deg)"}return v.jsx(L,o({className:E(f.root,d),style:o({width:m,height:m},x,_),ownerState:n,ref:s,role:"progressbar"},y,j,{children:v.jsx(O,{className:f.svg,ownerState:n,viewBox:`${t/2} ${t/2} ${t} ${t}`,children:v.jsx(Q,{className:f.circle,style:h,ownerState:n,cx:t,cy:t,r:(t-i)/2,fill:"none",strokeWidth:i})})}))});export{Z as C};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,r as p,d as Q,a as Y}from"./react-BrLDncxD.js";import{F as N,s as v,an as Z,I as J,t,c as V,E as W,m as X,u as ee,A as ae,ao as te,C as re,ap as se}from"./index-
|
|
1
|
+
import{j as e,r as p,d as Q,a as Y}from"./react-BrLDncxD.js";import{F as N,s as v,an as Z,I as J,t,c as V,E as W,m as X,u as ee,A as ae,ao as te,C as re,ap as se}from"./index-Q9d0V8TZ.js";import{E as oe}from"./ErrorNotice-BDH9xoG4.js";import{d as ie,g as ce,a as ne,A as le}from"./collection-BButATLz.js";import{u as de}from"./useStore-Ccbed9Z-.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-CQMvcQ_A.js";import{L as xe}from"./LoadMore-DwH_uJJ9.js";import{u as he}from"./useInfiniteGrid-8c-8xSTi.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DYZXk5O5.js";import"./ethers-CLB2z3On.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-BrLDncxD.js";import{t as s,I as k,
|
|
1
|
+
import{r as o,j as t}from"./react-BrLDncxD.js";import{t as s,I as k,M as f,A as N}from"./index-Q9d0V8TZ.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{a as K,j as e,L as re,d as se,b as te,r as j}from"./react-BrLDncxD.js";import{aq as oe,ar as ce,g as le,t as a,as as E,B as ne,an as D,d as ie,I,c as de,u as me,A as ue,ak as he,at as ge,C as xe}from"./index-
|
|
1
|
+
import{a as K,j as e,L as re,d as se,b as te,r as j}from"./react-BrLDncxD.js";import{aq as oe,ar as ce,g as le,t as a,as as E,B as ne,an as D,d as ie,I,c as de,u as me,A as ue,ak as he,at as ge,C as xe}from"./index-Q9d0V8TZ.js";import{d as _e,g as pe,a as Ne,A as je}from"./collection-BButATLz.js";import{u as be,L as fe}from"./useStore-Ccbed9Z-.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-CQMvcQ_A.js";import{L as B}from"./LoadMore-DwH_uJJ9.js";import{u as R}from"./useInfiniteGrid-8c-8xSTi.js";import{E as T}from"./ErrorNotice-BDH9xoG4.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DYZXk5O5.js";import"./ethers-CLB2z3On.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 Se({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 ye={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:ye[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(Se,{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"),S=d&&!Number.isNaN(Number(d))?Number(d):void 0,y=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:S,maxPriceCredits:y,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=!!(S||y),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{b7 as U,b8 as Ue,
|
|
1
|
+
import{b7 as U,b8 as Ue,S as C,b9 as qe,ba as Ye,a0 as Qe,bb as Je,aW as Xe,R,a$ as K,a_ as Te,bc as a,bd as Ze,be as Le,T as et,b5 as tt}from"./index-Q9d0V8TZ.js";import{R as rt,g as ot}from"./getOverlayAlpha-CH1E19pc.js";import{j as T,r as y}from"./react-BrLDncxD.js";import{u as nt,a as Be}from"./useTheme-7-Mr4FFJ.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-WHc1zToo.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-BmwayVyG.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};
|