@dcl/shop 0.1.0-29934929940.commit-6d4a894 → 0.1.0-29941568358.commit-de47e56
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-8hsGcQ0u.js → AnimatedBackground-cMeJUDnS.js} +1 -1
- package/assets/{Assets-zJP2dh8T.js → Assets-D4bmQvg2.js} +11 -11
- package/assets/{Assets.styles-BKTin871.js → Assets.styles-JIZQe0rQ.js} +1 -1
- package/assets/Authorizations-Bxum5Ckz.js +163 -0
- package/assets/Cart-pFVN5ROM.js +3 -0
- package/assets/{CircularProgress-CHG6tLju.js → CircularProgress-DVvK_YYJ.js} +3 -3
- package/assets/{Collection-Do5NXSU2.js → Collection-CCeBHPqN.js} +1 -1
- package/assets/{CollectionCarousel-BaRGhi3w.js → CollectionCarousel-CfEwak3h.js} +1 -1
- package/assets/{ContentClient-BjQkITL0.js → ContentClient-DWUTshFt.js} +1 -1
- package/assets/{Creator-JDFZfL5s.js → Creator-DyLgE_Lq.js} +1 -1
- package/assets/{CssVarsProvider-ClB453yI.js → CssVarsProvider-CaTQjQty.js} +3 -3
- package/assets/{DeploymentBuilder-D-b1kMax.js → DeploymentBuilder-BeZK0qfR.js} +1 -1
- package/assets/{ExchangeController-gNB3kOET.js → ExchangeController-ZePEIh3m.js} +1 -1
- package/assets/{GetCredits--2sG2kUu.js → GetCredits-BcaMNIRG.js} +1 -1
- package/assets/{HelpersUtil-ChCAjTFl.js → HelpersUtil-CRTK_83W.js} +1 -1
- package/assets/{ImportListings-Dx4tRkPi.js → ImportListings-9YfzHduB.js} +2 -2
- package/assets/ItemDetail-BSqp8w-l.js +78 -0
- package/assets/{LoadMore-DEqrabJR.js → LoadMore-BK9c312B.js} +1 -1
- package/assets/{MarketCheckout-BhoJ5oaY.js → MarketCheckout-BxM5rUvM.js} +1 -1
- package/assets/{MyAssets-Dml_XsHc.js → MyAssets-BA5zCiVR.js} +2 -2
- package/assets/{MyFavorites-DCK1vo8d.js → MyFavorites-DWjt5m8Z.js} +1 -1
- package/assets/{MyPurchases-CCC9vTm6.js → MyPurchases--MUfwO_U.js} +5 -5
- package/assets/{NotFound-C9MQxOVj.js → NotFound-DVZ9W5Hr.js} +1 -1
- package/assets/PrimaryListModal-CQHoY5iG.js +1 -0
- package/assets/{StoreSettings-CCWCDTh_.js → StoreSettings-CpeZPPkb.js} +2 -2
- package/assets/{Success-BDwtV9vp.js → Success-CxrAGNmd.js} +3 -3
- package/assets/{SwapController-CUDA5nJJ.js → SwapController-BH4rWo6P.js} +1 -1
- package/assets/{Tooltip-CmUV5INZ.js → Tooltip-zazDSBbm.js} +1 -1
- package/assets/{TradeService-DLK4MfJ6.js → TradeService-IuqYxWb8.js} +1 -1
- package/assets/{W3MFrameProviderSingleton-_Jupf0lQ.js → W3MFrameProviderSingleton-CFGfbV9-.js} +3 -3
- package/assets/{WebCryptoP256-DUqSrnE5.js → WebCryptoP256-ByM1YcL4.js} +1 -1
- package/assets/authorizations-CsduRV0X.js +1 -0
- package/assets/{basic--d_dy4i5.js → basic-BMJtBJ3f.js} +1 -1
- package/assets/{biconomy-B3E5v_ox.js → biconomy-WqxLiteU.js} +1 -1
- package/assets/buy-CN2rC9a0.js +1 -0
- package/assets/buy-gasless-iZXsoGZN.js +1 -0
- package/assets/{cart-checkout-DAncfmAA.js → cart-checkout-CLMqKMCz.js} +1 -1
- package/assets/{categories-BxHDtlRd.js → categories-D7_Qudaw.js} +1 -1
- package/assets/{ccip-DvIxb239.js → ccip-Be5Dn1Zo.js} +1 -1
- package/assets/{ccip-B6LXrSMV.js → ccip-DLXgNS3N.js} +1 -1
- package/assets/collection-DbmjhyjW.js +1 -0
- package/assets/{controller-Bn7Z9_r0.js → controller-CDv5xjYs.js} +2 -2
- package/assets/{core-BBJz894Q.js → core-B1vdvz8J.js} +4 -4
- package/assets/{custom-1kg7ng5l.js → custom-3-JWbHeB.js} +1 -1
- package/assets/{data-capture-ChI8n4xx.js → data-capture-B9u0j-_M.js} +1 -1
- package/assets/{email-CMJpr-fW.js → email-Bu0wLP5a.js} +1 -1
- package/assets/{embedded-wallet-ggb_52HF.js → embedded-wallet-DALUv36Z.js} +1 -1
- package/assets/emotion-styled.browser.esm-rI_2ZiJm.js +1 -0
- package/assets/{engine-D1X0lXh5.js → engine-COZjF6GN.js} +1 -1
- package/assets/{errors-DGvmy-zZ.js → errors-BuvqNt2H.js} +1 -1
- package/assets/{estimate-l1-fee-CIJA48wh.js → estimate-l1-fee-y9SYh7nZ.js} +1 -1
- package/assets/{ethers-CeDRuWE-.js → ethers-Dpp9c5As.js} +1 -1
- package/assets/{execute-CLaVApj9.js → execute-DVE3v1AF.js} +2 -2
- package/assets/{features-DIxQMYhX.js → features-CqkOcXXU.js} +1 -1
- package/assets/{fetchTokenMetadata-DK5hE0wQ.js → fetchTokenMetadata-CZAPbDmS.js} +2 -2
- package/assets/{get-ecosystem-wallet-info-D6mzdR0G.js → get-ecosystem-wallet-info-CSMzgHAT.js} +1 -1
- package/assets/{getBalance-BzFjlu9G.js → getBalance-BawNMn6h.js} +1 -1
- package/assets/{getNFT-C8_Ym6i8.js → getNFT-BnfoPCmO.js} +1 -1
- package/assets/{getNFT-B8L91SOg.js → getNFT-yjjewJwo.js} +1 -1
- package/assets/{getOverlayAlpha-DEiIzOVP.js → getOverlayAlpha-DAstUi74.js} +1 -1
- package/assets/{hashTypedData-30Jlq8db.js → hashTypedData-CKhs32SE.js} +1 -1
- package/assets/{hashTypedData-D6R8yQIx.js → hashTypedData-Cb3dj8Vj.js} +1 -1
- package/assets/import-D2QUSpyp.js +1 -0
- package/assets/{in-app-CUkhWh_L.js → in-app-Dy6198Ub.js} +1 -1
- package/assets/{in-app-wallet-calls-Cxpe1Bwc.js → in-app-wallet-calls-Df8xMcoL.js} +1 -1
- package/assets/{index-BOt9Opm-.js → index-4DPFDe86.js} +1 -1
- package/assets/{index-wFtyEdaH.js → index-85kWMWjg.js} +1 -1
- package/assets/{index-DjwEMK3G.js → index-B0SpA1TA.js} +1 -1
- package/assets/{index-BdwR3G_d.js → index-B4Jw07i3.js} +1 -1
- package/assets/{index-CKovnqJP.js → index-B83hIo9e.js} +1 -1
- package/assets/{index-QETV6gE_.js → index-BCWp_6cV.js} +1 -1
- package/assets/{index-CRFpqXcH.js → index-BDN6djsw.js} +1 -1
- package/assets/{index-B3CMW_Rz.js → index-BItUV6PM.js} +1 -1
- package/assets/{index-B9qeAesl.js → index-BIulqLQL.js} +1 -1
- package/assets/{index-BmdP7fOj.js → index-BPKqBTdV.js} +1 -1
- package/assets/{index-BokebKeP.js → index-BRKyx7oU.js} +2 -2
- package/assets/{index-5irkjtJp.js → index-BRNsIe3m.js} +1 -1
- package/assets/{index-DirIOdjz.js → index-BcuysZka.js} +1 -1
- package/assets/{index-Cx_FuvLh.js → index-BhfJUYAQ.js} +1 -1
- package/assets/{index-Cgap8AUD.js → index-Bi4zgWjQ.js} +2 -2
- package/assets/{index-B3xOzx6X.js → index-BlBcCTXj.js} +1 -1
- package/assets/{index-C50s7O-g.js → index-BmlDboHr.js} +3 -3
- package/assets/{index-DszuXHRO.js → index-BsI3EWcy.js} +1 -1
- package/assets/{index-tRqsza9O.js → index-BzcxFNUz.js} +1 -1
- package/assets/{index-Bf4Q_PCL.js → index-C2-W1jZ1.js} +1 -1
- package/assets/{index-DUZmU_0S.js → index-C2ZtkYpB.js} +2 -2
- package/assets/{index-Dpmkxp94.js → index-CEhWolV_.js} +1 -1
- package/assets/{index-BWGviuYS.js → index-CIHaBruC.js} +1 -1
- package/assets/{index-BVi1IXaN.js → index-CIfdS8Db.js} +1 -1
- package/assets/{index-1gQN_kvx.js → index-CJRmkopy.js} +3 -3
- package/assets/{index-DkYtNpvt.js → index-CNpvozfL.js} +1 -1
- package/assets/{index-Dj-dQr5B.js → index-CPs7rZSr.js} +1 -1
- package/assets/{index-fBrY7bRL.js → index-CRSMETpm.js} +1 -1
- package/assets/{index-DHAMkmn9.js → index-CXgtaw1w.js} +1 -1
- package/assets/{index-DoH_srP9.js → index-CaOpng6c.js} +1 -1
- package/assets/{index-DKroPvyy.js → index-CbxN7Krq.js} +1 -1
- package/assets/{index-OEC5-urT.js → index-Cnmgw5PF.js} +1 -1
- package/assets/{index-CKN3JhVe.js → index-Ct22HWuE.js} +1 -1
- package/assets/{index-Cj2-8UH4.js → index-Cz1Suly9.js} +1 -1
- package/assets/{index-BbFU3LoB.js → index-D0xvd_Dp.js} +2 -2
- package/assets/{index-w1ulQg_8.js → index-D8me2ig5.js} +1 -1
- package/assets/{index-Dl9hHOZJ.js → index-DIGUl9iX.js} +1 -1
- package/assets/{index-DUkzcHbX.js → index-DIpMchso.js} +1 -1
- package/assets/{index-CWbN9Peg.js → index-DP9-yadx.js} +1 -1
- package/assets/{index-CecrsNSC.js → index-DPTvpJzS.js} +1 -1
- package/assets/{index-BEaNsXM-.js → index-DPp2bhUs.js} +1 -1
- package/assets/{index-DtQgf-Kz.js → index-D_Osq35D.js} +1 -1
- package/assets/{index-M9Lpp4iE.js → index-DgYBZU4A.js} +1 -1
- package/assets/{index-CDE1OoEd.js → index-DlvbN_Av.js} +1 -1
- package/assets/{index-CfF05W5R.js → index-DoaLV6gK.js} +1 -1
- package/assets/{index-Csh4ZzC9.js → index-DoxUiIoZ.js} +3 -3
- package/assets/{index-Drt6Trho.js → index-DtYBJNaS.js} +1 -1
- package/assets/{index-ZeJG5A5O.js → index-FFhK2B90.js} +1 -1
- package/assets/{index-ytKJv8_W.js → index-HRvlJsjj.js} +1 -1
- package/assets/{index-BpHVmfrg.js → index-Tfh0IyJl.js} +1 -1
- package/assets/{index-B8IbHKn5.js → index-V0hMC6mZ.js} +28 -28
- package/assets/{index-CAp_8XyK.js → index-V1lpWoC-.js} +1 -1
- package/assets/{index-ChE7SRyt.js → index-cA2ARKGJ.js} +1 -1
- package/assets/{index-MzkyVebZ.js → index-cjI3Jxw7.js} +1 -1
- package/assets/{index-CDcigD9G.js → index-kbFINusp.js} +1 -1
- package/assets/{index-BFk4WfKV.js → index-rFCcyY0H.js} +1 -1
- package/assets/{index-BxGv3iyo.js → index-sN6H-jhd.js} +1 -1
- package/assets/{index-Bl_PDUbW.js → index-uTPBgRyq.js} +3 -3
- package/assets/{index.es-BOjaJD0O.js → index.es-BqAU2pak.js} +4 -4
- package/assets/{index.es-CeNIgyNC.js → index.es-C7FJOZk9.js} +1 -1
- package/assets/{index.es-CnHhHSCq.js → index.es-DLc2fyYi.js} +1 -1
- package/assets/{localBatchGatewayRequest-CnXU2N0v.js → localBatchGatewayRequest-aE453fG9.js} +1 -1
- package/assets/{mana-rate-Z0fOAnP4.js → mana-rate-CFrZfrxV.js} +1 -1
- package/assets/{networks-DRRFntRj.js → networks-DYw-qqg1.js} +1 -1
- package/assets/{onramp-YOrhAP08.js → onramp-Dv5XffT1.js} +1 -1
- package/assets/{openzeppelin-DLbYMZrj.js → openzeppelin-DY9zonpF.js} +1 -1
- package/assets/{parseNft-BAtiT6yX.js → parseNft-BoqFzz1w.js} +2 -2
- package/assets/{parseSignature-z0AWZvnA.js → parseSignature-DLqUl44D.js} +1 -1
- package/assets/{parseSignature-DsA9O_Ak.js → parseSignature-_8ci0C1c.js} +3 -3
- package/assets/{passkeys-BTHsRkfl.js → passkeys-9jKCllXJ.js} +1 -1
- package/assets/{pay-with-exchange-yHyBBgyM.js → pay-with-exchange-q2w3TOV5.js} +1 -1
- package/assets/{qr-overlay-BH--1hn8.js → qr-overlay-kE0-Tb5Q.js} +1 -1
- package/assets/{receive-CjGVww72.js → receive-BlDcpWqy.js} +1 -1
- package/assets/{resolveImplementation-BKCjssN2.js → resolveImplementation-u5UN_seG.js} +1 -1
- package/assets/{rpc-UlD1Yufg.js → rpc-hzBSsIuq.js} +1 -1
- package/assets/{secp256k1-BrTQvA4F.js → secp256k1-CIm5iUJu.js} +1 -1
- package/assets/{secp256k1-BHkDM-tH.js → secp256k1-D_XLFIAD.js} +1 -1
- package/assets/{secp256k1-WljeVDsw.js → secp256k1-DogjvjtS.js} +1 -1
- package/assets/{send-tO6EhaL3.js → send-33Lvo35v.js} +1 -1
- package/assets/{send-batch-transaction-Cc9JRr38.js → send-batch-transaction-DxqLfBgo.js} +1 -1
- package/assets/{send-eip712-transaction-D5PSVDu-.js → send-eip712-transaction-BWi3gkm3.js} +2 -2
- package/assets/{send-gasless-transaction-Dqcv_ITl.js → send-gasless-transaction-CC-pEfDw.js} +2 -2
- package/assets/{send-transaction-cYs7CC0Z.js → send-transaction-DN1HyeTa.js} +2 -2
- package/assets/{sendRawTransaction-CITbtRC7.js → sendRawTransaction-DqtJOwfz.js} +3 -3
- package/assets/{serializeTransaction-Btmy4ifh.js → serializeTransaction-DOUpHqmp.js} +1 -1
- package/assets/{session-proposal-DrRYiiTl.js → session-proposal-BtkIO7cP.js} +1 -1
- package/assets/{session-request-D0sRJfkf.js → session-request-lsymM3l6.js} +2 -2
- package/assets/{signing-pcucBOUB.js → signing-Bskb_x4I.js} +3 -3
- package/assets/{socials-CGjqIEg_.js → socials-BrDjbXdD.js} +1 -1
- package/assets/{swaps-BphZ398u.js → swaps-BcWPrBSV.js} +1 -1
- package/assets/{thirdweb-DUgg8d6T.js → thirdweb-Cpf8EN89.js} +3 -3
- package/assets/{to-serializable-transaction-s-pMi3iV.js → to-serializable-transaction-gyjNAfk6.js} +2 -2
- package/assets/trade-encoding-vTSEXgN1.js +1 -0
- package/assets/{transactionReceipt-B-qhqvkt.js → transactionReceipt-Bum6hzjL.js} +1 -1
- package/assets/{transactions-CSSZ1Uj-.js → transactions-D-Z-vxC7.js} +1 -1
- package/assets/{useCreditPacks-Z0vJvkTc.js → useCreditPacks-BJp5mEnq.js} +1 -1
- package/assets/{useInfiniteGrid-CcAnLcIW.js → useInfiniteGrid-COXciuKu.js} +1 -1
- package/assets/{useStore-DuXZRHKD.js → useStore-cTXMZhwG.js} +2 -2
- package/assets/useTheme-Cv3anIxV.js +1 -0
- package/assets/{useTheme-BaXPBxeY.js → useTheme-DmdtRbZb.js} +1 -1
- package/assets/{verifyHash-CSuvCpxH.js → verifyHash-DOsO5RNA.js} +1 -1
- package/assets/{w3m-modal-Bm4Jot-v.js → w3m-modal-D1Pu_W_3.js} +1 -1
- package/assets/{w3m-modal-BKgYOmDm.js → w3m-modal-oBw-UuhI.js} +1 -1
- package/assets/{wait-for-tx-receipt-CigZhA8t.js → wait-for-tx-receipt-BYt5Gcy_.js} +1 -1
- package/assets/{wallets-DEGbSfsr.js → wallets-uu9PjeR0.js} +5 -5
- package/assets/{web-connector-BVqUWfCL.js → web-connector-Vwf5Urnw.js} +3 -3
- package/assets/{writeContract-CyscURCL.js → writeContract-iaip-T2H.js} +1 -1
- package/assets/{zoraTestnet-DteZMy6Z.js → zoraTestnet-EJHbKpn0.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/assets/Cart-KI1ErU7i.js +0 -3
- package/assets/ItemDetail-DqyfPCJF.js +0 -78
- package/assets/PrimaryListModal-5yw3HjxR.js +0 -1
- package/assets/buy-DcrAdUpx.js +0 -1
- package/assets/buy-gasless-b-y-A9B0.js +0 -1
- package/assets/collection-ChguPkSb.js +0 -1
- package/assets/emotion-styled.browser.esm-wTpuh9_1.js +0 -1
- package/assets/import-DwFR83oQ.js +0 -1
- package/assets/useTheme-efxsW9nt.js +0 -1
- package/assets/wallet-kind-D0r-Cmku.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as l,j as v}from"./react-BMZSDQJw.js";const w="https://cdn.decentraland.org/@dcl/shop/0.1.0-
|
|
1
|
+
import{r as l,j as v}from"./react-BMZSDQJw.js";const w="https://cdn.decentraland.org/@dcl/shop/0.1.0-29941568358.commit-de47e56/assets/custom-welcome-background-BxlFQma9.webp",S="https://cdn.decentraland.org/@dcl/shop/0.1.0-29941568358.commit-de47e56/assets/DCL_LogoPattern-BryBPc3d.png",U=`
|
|
2
2
|
attribute vec2 a_position;
|
|
3
3
|
varying vec2 v_uv;
|
|
4
4
|
void main() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{u as Ke,r as p,j as e,a as
|
|
1
|
+
import{u as Ke,r as p,j as e,a as Je}from"./react-BMZSDQJw.js";import{c as F,o as Qe,k as Ze,a3 as Xe,s,y as t,g as Te,h as Ye,j as ze,am as Ie,J as et,t as o,I as z,l as B,n as pe,q as D,r as tt,v as nt,u as Ne,z as st,A as K,aA as ot,aB as it}from"./index-V0hMC6mZ.js";import{r as rt,a as at,m as Ae}from"./mana-rate-CFrZfrxV.js";import{u as _e,M as lt}from"./MarketCheckout-BxM5rUvM.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-JIZQe0rQ.js";import{d as ue,R as wt,F as jt,S as xe,b as vt}from"./categories-D7_Qudaw.js";import{L as $t}from"./LoadMore-BK9c312B.js";import{u as Ct}from"./useInfiniteGrid-COXciuKu.js";import{E as kt}from"./ErrorNotice-DDr3KjIH.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-iZXsoGZN.js";import{s as It}from"./buy-CN2rC9a0.js";import{h as Nt}from"./trade-encoding-vTSEXgN1.js";import{f as At}from"./errors-BuvqNt2H.js";import{J as _t,C as Pt,B as ne}from"./ethers-Dpp9c5As.js";import{l as Mt}from"./loader-logo-BzY9EKdC.js";import{n as Lt}from"./emotion-CSxEP8yM.js";import"./sentry-8SzFotJj.js";import"./intl-CBcMB1D2.js";import"./index-HN6Rk25C.js";import"./Tooltip-zazDSBbm.js";import"./authorizations-CsduRV0X.js";function J(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 _t(f),c=new Pt(u,Wt,l);console.info(`[names] availability check → DCLRegistrar(${u}).available("${n}") on ${f}`);const x=await c.available(n);if((d=i.signal)!=null&&d.aborted)throw new DOMException("Aborted","AbortError");return console.info(`[names] "${n}" available=${x}`),x?"available":"taken"}const Ot="https://app.across.to/api";class Me extends Error{constructor(){super("Name registration is temporarily unavailable due to high network costs"),this.name="NameRouteCostTooHighError"}}function qt(n){return at(W,n)}async function Gt(n,i,f={}){var d;const u=f.chainId??F.chainId,l=f.provider??"across",c=`${F.creditsServerUrl}/credits-name-route?name=${encodeURIComponent(i)}&chainId=${u}&provider=${l}`,x=await Xe(c,{method:"GET",identity:n,metadata:{}});if(!x.ok){let a;try{a=(d=await x.json())==null?void 0:d.code}catch{}throw a==="ROUTE_COST_TOO_HIGH"?new Me:new Error(`fetchNameCreditRoute ${x.status}`)}return x.json()}function Dt(n,i){const f=ne.from(n.availableAmount),l=ne.from(W).sub(f);return{credits:[{value:n.amount,expiresAt:Number(n.expiresAt),salt: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=qt(m);console.info("[names] step 1/6 sized reservation",{usdCents:w,manaRate:m});const y=await Gt(f,i,{chainId:l,provider:c});console.info("[names] step 2/6 route fetched",{target:y.externalCall.target,selector:y.externalCall.selector,provider:y.provider,quoteId:y.quoteId});const j=await Qe(f,w);if(d=j.credit.id,console.info("[names] step 3/6 credit authorized",{creditId:j.credit.id,maxCreditedValue:j.maxCreditedValue}),ne.from(j.maxCreditedValue).lt(W))throw new Error("Credit under-sized for the name price");const C=Dt(j.credit,y);let h;try{h=await 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 Ze(f,[d]).catch(()=>{}),m instanceof Me?m:new Error(At(m,"Couldn't register the name. Please try again.",{sale:!0}))}}const Jt=s.div`
|
|
2
2
|
position: fixed;
|
|
3
3
|
inset: 0;
|
|
4
4
|
z-index: 10000;
|
|
@@ -7,7 +7,7 @@ import{u as Ke,r as p,j as e,a as Qe}from"./react-BMZSDQJw.js";import{c as F,o a
|
|
|
7
7
|
justify-content: center;
|
|
8
8
|
padding: 16px;
|
|
9
9
|
background: rgba(22, 21, 24, 0.55);
|
|
10
|
-
`,
|
|
10
|
+
`,Qt=s.div`
|
|
11
11
|
width: 560px;
|
|
12
12
|
max-width: 100%;
|
|
13
13
|
max-height: 92vh;
|
|
@@ -127,7 +127,7 @@ import{u as Ke,r as p,j as e,a as Qe}from"./react-BMZSDQJw.js";import{c as F,o a
|
|
|
127
127
|
height: 22px;
|
|
128
128
|
color: ${t.colors.brandViolet};
|
|
129
129
|
}
|
|
130
|
-
`,
|
|
130
|
+
`,Zt=s.div`
|
|
131
131
|
margin-top: 16px;
|
|
132
132
|
padding: 16px;
|
|
133
133
|
border-radius: 12px;
|
|
@@ -186,7 +186,7 @@ import{u as Ke,r as p,j as e,a as Qe}from"./react-BMZSDQJw.js";import{c as F,o a
|
|
|
186
186
|
font-family: ${t.font.sans};
|
|
187
187
|
font-size: 16px;
|
|
188
188
|
color: ${t.colors.muted2};
|
|
189
|
-
`,
|
|
189
|
+
`,Ee=s.button`
|
|
190
190
|
margin-top: 16px;
|
|
191
191
|
width: 100%;
|
|
192
192
|
height: 52px;
|
|
@@ -366,7 +366,7 @@ import{u as Ke,r as p,j as e,a as Qe}from"./react-BMZSDQJw.js";import{c as F,o a
|
|
|
366
366
|
flex: none;
|
|
367
367
|
color: ${t.colors.dclRed};
|
|
368
368
|
}
|
|
369
|
-
`;function bn({name:n,priceCredits:i,onClose:f}){const{session:u}=
|
|
369
|
+
`;function bn({name:n,priceCredits:i,onClose:f}){const{session:u}=Te(),{data:l,isError:c}=Ye(u),x=ze(),d=Ke(),[a,m]=p.useState("confirm"),[w,y]=p.useState(""),[j,C]=p.useState(null),h=p.useRef(!1),b=w.trim().toLowerCase()===n.toLowerCase(),v=a==="completing",S=i!=null?Ie(i):"—";p.useEffect(()=>{const g=N=>{N.key==="Escape"&&!v&&f()};document.addEventListener("keydown",g);const H=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",g),document.body.style.overflow=H}},[v,f]);async function k(){if(!(!u||!b||h.current)){h.current=!0,m("completing"),C(null);try{await Kt({name:n,identity:u.identity,signer:u.signer}),D("Shop Completed Purchase",{purchase_type:"name",is_primary:!0,payment_type:"credits",value_credits:i??null}),x.invalidateQueries({queryKey:["usd-balance"]}),m("success")}catch(g){D(nt(g)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:tt(g),purchase_type:"name"}),C((g==null?void 0:g.message)||o("names.errorGeneric")),m("error")}finally{h.current=!1}}}const I=a!=="success",R=et(u==null?void 0:u.providerType);return e.jsx(Jt,{onClick:v?void 0:f,role:"presentation",children:e.jsxs(Qt,{role:"dialog","aria-modal":"true","aria-label":o("names.buyTitle"),onClick:g=>g.stopPropagation(),children:[I&&e.jsxs(e.Fragment,{children:[e.jsxs(ge,{children:[e.jsx(be,{children:a==="error"?o("names.errorTitle"):o("names.buyTitle")}),e.jsx(ye,{onClick:f,disabled:v,"aria-label":o("buyModal.close"),children:e.jsx(z,{name:"close"})})]}),e.jsxs(we,{children:[o("names.myCreditsBalance")," ",e.jsx(B,{})," ",pe(l,c)]}),e.jsx(je,{})]}),(a==="confirm"||a==="error")&&e.jsxs(e.Fragment,{children:[e.jsxs(ve,{children:[e.jsx($e,{"aria-hidden":!0,children:"@"}),e.jsxs(Ce,{children:[e.jsxs(ke,{children:[n,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Se,{children:o("names.subtitle")})]}),e.jsxs(Re,{children:[e.jsx(B,{}),S]})]}),a==="error"?e.jsxs(e.Fragment,{children:[e.jsxs(gn,{children:[e.jsx(z,{name:"info","aria-hidden":!0}),e.jsx("span",{children:j})]}),e.jsx(Ee,{onClick:()=>m("confirm"),children:o("names.tryAgain")})]}):e.jsxs(e.Fragment,{children:[e.jsxs(Zt,{children:[e.jsx(Xt,{children:o("names.confirmTitle")}),e.jsx(Yt,{dangerouslySetInnerHTML:{__html:o("names.confirmBody",{name:`<b>@${yn(n)}</b>`})}}),e.jsxs(en,{children:[e.jsx(tn,{"aria-hidden":!0,children:"@"}),e.jsx(nn,{value:w,onChange:g=>y(g.target.value.replace(/[^a-zA-Z0-9]/g,"")),placeholder:"yourname","aria-label":o("names.reenterAria"),autoComplete:"off",spellCheck:!1,style:{width:`${Math.max(w.length,8)}ch`}}),e.jsx(sn,{children:".dcl.eth"})]})]}),e.jsx(Ee,{onClick:()=>void k(),disabled:!b||!u,children:o("names.buyCta")})]})]}),a==="completing"&&e.jsxs(on,{children:[e.jsx(rn,{src:Mt,alt:"",width:56,height:56}),e.jsx(an,{children:R?o("names.confirming"):o("names.completing")}),e.jsxs(ln,{children:[e.jsx(cn,{"aria-hidden":!0,children:e.jsx("span",{})}),e.jsx(dn,{children:"1/1"})]})]}),a==="success"&&e.jsxs(e.Fragment,{children:[e.jsxs(ge,{children:[e.jsx(be,{children:o("names.successHeaderTitle")}),e.jsx(ye,{onClick:f,"aria-label":o("buyModal.close"),children:e.jsx(z,{name:"close"})})]}),e.jsxs(we,{children:[o("names.myCreditsBalance")," ",e.jsx(B,{})," ",pe(l,c)]}),e.jsx(je,{}),e.jsxs(fn,{children:[e.jsx(pn,{"aria-hidden":!0,children:e.jsx(z,{name:"check"})}),e.jsxs(un,{children:[e.jsx("b",{children:o("names.successBannerBold")})," ",o("names.successBannerRest")]})]}),e.jsxs(ve,{style:{marginTop:20},children:[e.jsx($e,{"aria-hidden":!0,children:"@"}),e.jsxs(Ce,{children:[e.jsxs(ke,{children:[n,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Se,{children:o("names.subtitle")})]}),e.jsxs(Re,{children:[e.jsx(B,{}),S]})]}),e.jsxs(xn,{children:[e.jsx(hn,{onClick:()=>{f(),d("/my-assets")},children:o("names.myItems")}),e.jsx(mn,{href:F.profileUrl,target:"_blank",rel:"noopener noreferrer",children:o("names.assignToAvatar")})]})]})]})})}function yn(n){return n.replace(/[&<>"']/g,i=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[i])}const wn=s.div`
|
|
370
370
|
width: 100%;
|
|
371
371
|
min-width: 0;
|
|
372
372
|
`,jn=s.nav`
|
|
@@ -441,7 +441,7 @@ import{u as Ke,r as p,j as e,a as Qe}from"./react-BMZSDQJw.js";import{c as F,o a
|
|
|
441
441
|
${t.media.down("mobile")} {
|
|
442
442
|
font-size: 26px;
|
|
443
443
|
}
|
|
444
|
-
`,
|
|
444
|
+
`,En=s.p`
|
|
445
445
|
margin: 0;
|
|
446
446
|
max-width: 760px;
|
|
447
447
|
font-family: ${t.font.sans};
|
|
@@ -453,12 +453,12 @@ import{u as Ke,r as p,j as e,a as Qe}from"./react-BMZSDQJw.js";import{c as F,o a
|
|
|
453
453
|
${t.media.down("mobile")} {
|
|
454
454
|
font-size: 16px;
|
|
455
455
|
}
|
|
456
|
-
`,
|
|
456
|
+
`,Tn=s.div`
|
|
457
457
|
width: min(785px, 100%);
|
|
458
458
|
display: flex;
|
|
459
459
|
flex-direction: column;
|
|
460
460
|
gap: 12px;
|
|
461
|
-
`,
|
|
461
|
+
`,zn=s.div`
|
|
462
462
|
position: relative;
|
|
463
463
|
`,In=s("div",Lt("invalid"))`
|
|
464
464
|
display: flex;
|
|
@@ -645,7 +645,7 @@ import{u as Ke,r as p,j as e,a as Qe}from"./react-BMZSDQJw.js";import{c as F,o a
|
|
|
645
645
|
width: 16px;
|
|
646
646
|
height: 16px;
|
|
647
647
|
}
|
|
648
|
-
`,
|
|
648
|
+
`,Q=s.div`
|
|
649
649
|
display: flex;
|
|
650
650
|
align-items: center;
|
|
651
651
|
gap: 8px;
|
|
@@ -695,7 +695,7 @@ import{u as Ke,r as p,j as e,a as Qe}from"./react-BMZSDQJw.js";import{c as F,o a
|
|
|
695
695
|
flex-direction: column;
|
|
696
696
|
gap: 24px;
|
|
697
697
|
}
|
|
698
|
-
`,
|
|
698
|
+
`,Z=s.article`
|
|
699
699
|
flex: 1 0 0;
|
|
700
700
|
min-width: 0;
|
|
701
701
|
display: flex;
|
|
@@ -755,4 +755,4 @@ import{u as Ke,r as p,j as e,a as Qe}from"./react-BMZSDQJw.js";import{c as F,o a
|
|
|
755
755
|
clip: rect(0, 0, 0, 0);
|
|
756
756
|
white-space: nowrap;
|
|
757
757
|
border: 0;
|
|
758
|
-
`,Kn="https://docs.decentraland.org/creator/worlds/about/";function
|
|
758
|
+
`,Kn="https://docs.decentraland.org/creator/worlds/about/";function Jn(n){const i=typeof window<"u"?window.location.hostname:"";return`${i.endsWith("decentraland.org")?"https://decentraland.org":i.endsWith("decentraland.today")?"https://decentraland.today":"https://decentraland.zone"}/marketplace/names/browse?search=${encodeURIComponent(n)}`}function Qn({onBack:n}){Ne({title:o("seo.names.title"),description:o("seo.names.description")});const{session:i,signIn:f}=Te(),{data:u}=_e(),l=u?Ae(W,u):null,[c,x]=p.useState(""),[d,a]=p.useState("idle"),[m,w]=p.useState(!1),y=p.useRef(null),[j,C]=p.useState(void 0);p.useLayoutEffect(()=>{y.current&&C(y.current.offsetWidth)},[c]),p.useEffect(()=>{if(!he(c).ok){a(c.length===0?"idle":"invalid");return}a("checking");const I=new AbortController,R=setTimeout(()=>{(async()=>{try{const g=await Ut(c,{signal:I.signal});a(g)}catch(g){if((g==null?void 0:g.name)==="AbortError")return;a("error")}})()},400);return()=>{clearTimeout(R),I.abort()}},[c]);const h=he(c),b=h.ok&&(d==="available"||d==="error");function v(){if(b){if(!i){f();return}w(!0)}}const S=e.jsxs(e.Fragment,{children:[o("names.claim"),l!=null?e.jsxs(Hn,{children:[e.jsx(B,{}),Ie(l)]}):null]});return e.jsxs(wn,{"data-testid":"names-page",children:[e.jsxs(jn,{"aria-label":o("names.breadcrumbAria"),children:[e.jsx(vn,{onClick:n,children:o("names.breadcrumbCollectibles")}),e.jsx("span",{"aria-hidden":!0,children:">"}),e.jsx($n,{children:o("names.breadcrumbCurrent")})]}),e.jsxs(Cn,{children:[e.jsxs(kn,{children:[e.jsxs(Sn,{children:[e.jsx(Rn,{children:o("names.heroTitle")}),e.jsx(En,{children:o("names.heroSubtitle")})]}),e.jsxs(Tn,{children:[e.jsxs(zn,{children:[e.jsxs(In,{invalid:d==="taken",children:[e.jsxs(Pn,{children:[e.jsx(Mn,{"aria-hidden":!0,children:"@"}),e.jsx(Ln,{value:c,onChange:k=>x(Ft(k.target.value)),placeholder:o("names.inputPlaceholder"),"aria-label":o("names.inputAria"),autoComplete:"off",spellCheck:!1,maxLength:V,style:{width:j!=null?`${j}px`:void 0}}),e.jsx(Nn,{ref:y,"aria-hidden":!0,children:c||o("names.inputPlaceholder")}),e.jsx(Bn,{children:o("names.suffix")})]}),c.length>0?e.jsxs(Fn,{"aria-hidden":!0,children:[c.length,"/",V]}):null,e.jsx(Le,{onClick:v,disabled:!b,"data-testid":"names-claim",children:S})]}),d==="taken"?e.jsxs(An,{role:"status","data-testid":"names-taken",children:[e.jsx(z,{name:"info",size:16,"aria-hidden":!0}),e.jsx("span",{children:o("names.taken")}),e.jsxs(_n,{href:Jn(c),target:"_blank",rel:"noopener noreferrer",children:[o("names.takenMakeOffer"),e.jsx(z,{name:"external-link",size:13,"aria-hidden":!0})]})]}):null]}),e.jsx(Wn,{onClick:v,disabled:!b,children:S}),d==="checking"?e.jsx(Q,{tone:"muted",role:"status","data-testid":"names-checking",children:o("names.checking")}):d==="error"?e.jsx(Q,{tone:"muted",role:"status",children:o("names.checkError")}):d==="invalid"&&!h.ok&&h.reason==="too-short"?e.jsx(Q,{tone:"muted",role:"status",children:o("names.tooShort",{min:Pe})}):null,e.jsx(Vn,{role:"status","aria-live":"polite",children:d==="available"?o("names.available",{name:c}):""})]})]}),e.jsxs(Un,{children:[e.jsx(On,{children:o("names.whyTitle")}),e.jsxs(qn,{children:[e.jsxs(Z,{children:[e.jsx(X,{"aria-hidden":!0}),e.jsx(Y,{children:e.jsx(ee,{children:o("names.why1")})})]}),e.jsxs(Z,{children:[e.jsx(X,{"aria-hidden":!0}),e.jsxs(Y,{children:[e.jsx(ee,{children:o("names.why2")}),e.jsxs(Gn,{href:Kn,target:"_blank",rel:"noopener noreferrer",children:[o("names.why2Link"),e.jsx(z,{name:"external-link","aria-hidden":!0})]})]})]}),e.jsxs(Z,{children:[e.jsx(X,{"aria-hidden":!0}),e.jsxs(Y,{children:[e.jsx(ee,{children:o("names.why3")}),e.jsx(Dn,{children:o("names.why3Link")})]})]})]})]})]}),m?e.jsx(bn,{name:c,priceCredits:l,onClose:()=>w(!1)}):null]})}const te=48;function Zn(n){return{tradeId:n.tradeId??n.id,listingType:"primary",contractAddress:n.contractAddress,itemId:n.itemId??"",name:n.name,thumbnail:n.thumbnail,rarity:n.rarity,category:n.category,wearableCategory:n.wearableCategory??null,creator:n.creator,manaWei:n.manaWei??"0",available:1,network:n.network,chainId:n.chainId,createdAt:0}}function ws(){const[n]=Je(),i=(n.get("q")??"").trim().toLowerCase(),f=ze(),u=(n.get("q")??"").trim();Ne({title:u?o("seo.collectibles.searchTitle",{query:u}):o("seo.collectibles.title"),description:o("seo.collectibles.description")});const[l,c]=p.useState("wearable"),[x,d]=p.useState(null),[a,m]=p.useState([]),[w,y]=p.useState(""),[j,C]=p.useState(""),[h,b]=p.useState("on_sale"),[v,S]=p.useState(!1),[k,I]=p.useState("newest"),[R,g]=p.useState(!1),[H,N]=p.useState(null);p.useEffect(()=>{if(!R)return;const r=L=>{L.key==="Escape"&&g(!1)};document.addEventListener("keydown",r);const $=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",r),document.body.style.overflow=$}},[R]);const U=h==="on_sale",A=w&&!Number.isNaN(Number(w))?Number(w):void 0,_=j&&!Number.isNaN(Number(j))?Number(j):void 0,se=x?vt[x]:void 0,oe=(ue.find(r=>r.key===k)??ue[0]).server,ie={category:l,rarities:a.length?a:void 0,wearableCategories:se,minPriceCredits:A,maxPriceCredits:_,search:i||void 0,sortBy:oe,isSmart:v||void 0,onSale:!0},re={category:l,rarities:a.length?a:void 0,wearableCategories:se,search:i||void 0,sortBy:oe,isWearableSmart:v||void 0,isOnSale:h==="not_for_sale"?!1:void 0},{items:P,total:ae,isLoading:E,isPlaceholderData:T,error:Be,hasNextPage:Fe,isFetchingNextPage:le,fetchNextPage:We}=Ct(U?["unified-listings",ie]:["catalog-items",re],r=>U?ot({...ie,first:te,skip:r}):it({...re,first:te,skip:r}),{enabled:l!=="names"}),O=ae,He=E||T,Ue=E?15:Math.min(Math.max(P.length,1),te),{data:q,isError:Oe}=_e(),qe=r=>q&&r.manaWei?Ae(r.manaWei,q):null,ce=p.useRef(null);p.useEffect(()=>{E||T||!i||ce.current===i||(ce.current=i,D("Shop Searched",{query:i,result_count:O}))},[i,E,T,O]);const G=p.useRef("__init__");p.useEffect(()=>{if(E||T)return;const r=JSON.stringify({category:l,subCategory:x,rarities:a,min:A,max:_,sort:k,status:h,smart:v});if(G.current==="__init__"||G.current===r){G.current=r;return}G.current=r,D("Shop Applied Filter",{filters:{category:l,sub_category:x,rarities:a,min_price_credits:A??null,max_price_credits:_??null,status:h,smart:v,sort:k},result_count:O})},[l,x,a,A,_,k,h,v,E,T,O]);function de(r){c(r),d(null)}function fe(r){m($=>$.includes(r)?$.filter(L=>L!==r):[...$,r])}function Ge(){c("wearable"),d(null),m([]),y(""),C(""),b("on_sale"),S(!1)}function De(r){const $=P.find(L=>L.id===r.id);$&&$.source==="legacy"&&$.manaWei&&N(Zn($))}function Ve(){f.invalidateQueries({queryKey:["unified-listings"]})}const M=[];(A!=null||_!=null)&&M.push({key:"price",label:o("filter.price"),onRemove:()=>{y(""),C("")}});for(const r of wt)a.includes(r)&&M.push({key:`rarity-${r}`,label:st(r),onRemove:()=>fe(r)});return v&&M.push({key:"smart",label:o("filter.smart"),onRemove:()=>S(!1)}),h!=="on_sale"&&M.push({key:"status",label:h==="all"?o("filter.statusAll"):o("filter.notForSale"),onRemove:()=>b("on_sale")}),e.jsxs(ct,{"data-testid":"browse",children:[l!=="names"&&e.jsxs(e.Fragment,{children:[R?e.jsx(dt,{onClick:()=>g(!1),"aria-hidden":!0}):null,e.jsxs(ft,{className:R?"is-open":"","data-testid":"browse-sidebar",children:[e.jsxs(pt,{children:[e.jsx(ut,{children:o("assets.filters")}),e.jsx(xt,{onClick:()=>g(!1),"aria-label":o("assets.closeFilters"),children:"✕"})]}),e.jsx(ht,{children:e.jsx(mt,{category:l,subCategory:x,onCategory:de,onSub:d,priceMin:w,priceMax:j,onPriceMin:y,onPriceMax:C,rarities:a,onToggleRarity:fe,status:h,onStatus:b,smart:v,onSmart:S})}),e.jsx(gt,{children:e.jsx(bt,{type:"button",onClick:()=>g(!1),children:o("assets.showItems")})})]})]}),e.jsx(yt,{children:l==="names"?e.jsx(Qn,{onBack:()=>de("wearable")}):e.jsxs(e.Fragment,{children:[e.jsx(jt,{sort:k,onSort:I,total:ae,loading:E||T,query:i,onOpenFilters:()=>g(!0),chips:M,onClearChips:Ge}),Oe&&U&&P.some(r=>r.source==="legacy")?e.jsx("p",{className:"market-banner market-banner--warn",children:o("assets.marketUnavailable")}):null,Be?e.jsx(kt,{message:o("assets.loadError"),testId:"browse-error"}):null,e.jsx("div",{className:"grid","data-testid":"grid",children:He?e.jsx(xe,{count:Ue}):e.jsxs(e.Fragment,{children:[P.map(r=>{if(!U)return e.jsx(K,{item:r,mode:"view"},J(r));const $=r;return $.source==="legacy"?e.jsx(K,{item:$,mode:"market",marketPriceCredits:qe($),onBuyNow:De},J(r)):e.jsx(K,{item:r},J(r))}),le?e.jsx(xe,{count:6}):null]})}),e.jsx($t,{hasNextPage:Fe,isFetching:le,onLoadMore:()=>void We()}),!E&&!T&&P.length===0?e.jsx("p",{className:"muted",children:o("assets.noItems")}):null]})}),H&&q?e.jsx(lt,{listing:H,rate:q,onClose:()=>N(null),onSold:()=>{N(null),Ve()}}):null]})}export{ws as Assets};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as $,j as t}from"./react-BMZSDQJw.js";import{R as z,a as oe,C as ie,c as se}from"./categories-
|
|
1
|
+
import{r as $,j as t}from"./react-BMZSDQJw.js";import{R as z,a as oe,C as ie,c as se}from"./categories-D7_Qudaw.js";import{T as ne}from"./Tooltip-zazDSBbm.js";import{y as e,s as o,I as u,t as n,z as re,C as v}from"./index-V0hMC6mZ.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;
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import{j as t,L as R,r as D}from"./react-BMZSDQJw.js";import{s as a,B as L,y as e,H as q,u as B,t as i,g as N,J as F,I as x,l as G,e as A,j as H,c as Q,E as y,x as K,D as z}from"./index-V0hMC6mZ.js";import{g as M,a as W,s as J,b as O}from"./authorizations-CsduRV0X.js";import{f as P}from"./errors-BuvqNt2H.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-8SzFotJj.js";import"./ethers-Dpp9c5As.js";import"./intl-CBcMB1D2.js";import"./index-HN6Rk25C.js";const X=q`
|
|
2
|
+
to { transform: rotate(360deg); }
|
|
3
|
+
`,U=a.section`
|
|
4
|
+
width: 100%;
|
|
5
|
+
min-width: 0;
|
|
6
|
+
max-width: 760px;
|
|
7
|
+
`,V=a.div`
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
gap: 6px;
|
|
11
|
+
margin-bottom: 24px;
|
|
12
|
+
`,Y=a.h1`
|
|
13
|
+
font-family: ${e.font.sans};
|
|
14
|
+
margin: 0;
|
|
15
|
+
`,Z=a.p`
|
|
16
|
+
color: ${e.colors.muted};
|
|
17
|
+
font-size: 14px;
|
|
18
|
+
margin: 0;
|
|
19
|
+
max-width: 60ch;
|
|
20
|
+
`,j=a.div`
|
|
21
|
+
margin-bottom: 28px;
|
|
22
|
+
`,w=a.h2`
|
|
23
|
+
font-family: ${e.font.sans};
|
|
24
|
+
font-size: 15px;
|
|
25
|
+
font-weight: 700;
|
|
26
|
+
color: ${e.colors.text};
|
|
27
|
+
margin: 0 0 10px;
|
|
28
|
+
`,b=a.div`
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
gap: 12px;
|
|
32
|
+
`,_=a.div`
|
|
33
|
+
display: grid;
|
|
34
|
+
grid-template-columns: 44px 1fr auto;
|
|
35
|
+
align-items: center;
|
|
36
|
+
gap: 14px;
|
|
37
|
+
padding: 14px 18px;
|
|
38
|
+
background: ${e.colors.white};
|
|
39
|
+
border: 1px solid ${e.colors.line};
|
|
40
|
+
border-radius: 16px;
|
|
41
|
+
|
|
42
|
+
${e.media.down("mobile")} {
|
|
43
|
+
grid-template-columns: 44px 1fr;
|
|
44
|
+
grid-row-gap: 10px;
|
|
45
|
+
}
|
|
46
|
+
`,tt=a.div`
|
|
47
|
+
width: 44px;
|
|
48
|
+
height: 44px;
|
|
49
|
+
border-radius: 10px;
|
|
50
|
+
background: ${e.colors.media};
|
|
51
|
+
overflow: hidden;
|
|
52
|
+
display: flex;
|
|
53
|
+
align-items: center;
|
|
54
|
+
justify-content: center;
|
|
55
|
+
color: ${e.colors.muted2};
|
|
56
|
+
|
|
57
|
+
img {
|
|
58
|
+
width: 100%;
|
|
59
|
+
height: 100%;
|
|
60
|
+
object-fit: contain;
|
|
61
|
+
}
|
|
62
|
+
`,it=a.div`
|
|
63
|
+
min-width: 0;
|
|
64
|
+
display: flex;
|
|
65
|
+
flex-direction: column;
|
|
66
|
+
gap: 3px;
|
|
67
|
+
`,ot=a.span`
|
|
68
|
+
font-weight: 700;
|
|
69
|
+
color: ${e.colors.text};
|
|
70
|
+
white-space: nowrap;
|
|
71
|
+
overflow: hidden;
|
|
72
|
+
text-overflow: ellipsis;
|
|
73
|
+
`,et=a.span`
|
|
74
|
+
font-size: 13px;
|
|
75
|
+
color: ${e.colors.muted};
|
|
76
|
+
`,at=a.span`
|
|
77
|
+
font-size: 12px;
|
|
78
|
+
font-weight: 700;
|
|
79
|
+
color: ${e.colors.muted2};
|
|
80
|
+
|
|
81
|
+
&[data-active='true'] {
|
|
82
|
+
color: ${e.colors.okStrong};
|
|
83
|
+
}
|
|
84
|
+
`,st=a.div`
|
|
85
|
+
display: flex;
|
|
86
|
+
align-items: center;
|
|
87
|
+
gap: 10px;
|
|
88
|
+
justify-self: end;
|
|
89
|
+
|
|
90
|
+
${e.media.down("mobile")} {
|
|
91
|
+
grid-column: 1 / -1;
|
|
92
|
+
justify-self: start;
|
|
93
|
+
}
|
|
94
|
+
`,nt=a.button`
|
|
95
|
+
position: relative;
|
|
96
|
+
width: 46px;
|
|
97
|
+
height: 26px;
|
|
98
|
+
flex: 0 0 auto;
|
|
99
|
+
border-radius: ${e.radius.pill};
|
|
100
|
+
border: none;
|
|
101
|
+
background: ${e.colors.gray4};
|
|
102
|
+
cursor: pointer;
|
|
103
|
+
transition: background 0.15s;
|
|
104
|
+
padding: 0;
|
|
105
|
+
|
|
106
|
+
&::after {
|
|
107
|
+
content: '';
|
|
108
|
+
position: absolute;
|
|
109
|
+
top: 3px;
|
|
110
|
+
left: 3px;
|
|
111
|
+
width: 20px;
|
|
112
|
+
height: 20px;
|
|
113
|
+
border-radius: 50%;
|
|
114
|
+
background: ${e.colors.white};
|
|
115
|
+
transition: transform 0.15s;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
&[data-active='true'] {
|
|
119
|
+
background: ${e.colors.accent};
|
|
120
|
+
}
|
|
121
|
+
&[data-active='true']::after {
|
|
122
|
+
transform: translateX(20px);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
&:disabled {
|
|
126
|
+
cursor: default;
|
|
127
|
+
opacity: 0.6;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
&:focus-visible {
|
|
131
|
+
outline: 2px solid ${e.colors.accent};
|
|
132
|
+
outline-offset: 2px;
|
|
133
|
+
}
|
|
134
|
+
`,rt=a.span`
|
|
135
|
+
width: 16px;
|
|
136
|
+
height: 16px;
|
|
137
|
+
border-radius: 50%;
|
|
138
|
+
border: 2px solid ${e.colors.gray4};
|
|
139
|
+
border-top-color: ${e.colors.accent};
|
|
140
|
+
animation: ${X} 0.7s linear infinite;
|
|
141
|
+
|
|
142
|
+
@media (prefers-reduced-motion: reduce) {
|
|
143
|
+
animation: none;
|
|
144
|
+
}
|
|
145
|
+
`,v=a.p`
|
|
146
|
+
color: ${e.colors.muted};
|
|
147
|
+
font-size: 14px;
|
|
148
|
+
margin: 0;
|
|
149
|
+
`,$=a.div`
|
|
150
|
+
display: flex;
|
|
151
|
+
flex-direction: column;
|
|
152
|
+
align-items: center;
|
|
153
|
+
gap: 8px;
|
|
154
|
+
text-align: center;
|
|
155
|
+
padding: 90px 20px;
|
|
156
|
+
min-height: 50vh;
|
|
157
|
+
`,k=a.p`
|
|
158
|
+
font-size: 22px;
|
|
159
|
+
font-weight: 700;
|
|
160
|
+
margin: 6px 0 0;
|
|
161
|
+
`,ct=a(L)`
|
|
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]=D.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}=N(),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};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{j as e,r as j,u as Se,b as qe,L as Z}from"./react-BMZSDQJw.js";import{t as a,l as I,am as W,u as Le,ak as C,a as ie,g as Ie,e as Te,h as Pe,j as Ee,I as E,an as Be,J as Fe,q as J,ao as de,ap as Ae,x as R,s as Re,B as We,c as Ue,C as ze,o as $e,k as ue,aq as Qe,v as he,r as Ke,ar as Oe}from"./index-V0hMC6mZ.js";import{a as me}from"./buy-CN2rC9a0.js";import{g as Ge,a as Je,w as De,S as He,G as Ve}from"./buy-gasless-iZXsoGZN.js";import{R as D,r as Ye}from"./cart-checkout-CLMqKMCz.js";import{u as Xe,c as Ze}from"./useCreditPacks-BJp5mEnq.js";import{l as es}from"./loader-logo-BzY9EKdC.js";import{i as ss,a as as}from"./errors-BuvqNt2H.js";import{E as ts}from"./ErrorNotice-DDr3KjIH.js";import{C as cs}from"./CollectionCarousel-CfEwak3h.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-8SzFotJj.js";import"./ethers-Dpp9c5As.js";import"./intl-CBcMB1D2.js";import"./authorizations-CsduRV0X.js";import"./index-HN6Rk25C.js";import"./trade-encoding-vTSEXgN1.js";const rs="https://cdn.decentraland.org/@dcl/shop/0.1.0-29941568358.commit-de47e56/assets/buy-error-22UunaPC.png";function ns(t){const{phase:r,balanceCredits:u,onClose:l}=t,_=r==="processing",w=r!=="complete",M=r==="error"?a("cartCheckout.errorTitle"):r==="nofunds"?a("cartCheckout.titleNoFunds"):a("cartCheckout.titleBuy"),k=r==="processing";return e.jsxs("div",{className:"buy-modal",role:"dialog","aria-modal":"true","aria-label":a("cartCheckout.dialogAria"),children:[e.jsx("div",{className:"buy-modal__scrim",onClick:_?void 0:l,"aria-hidden":!0}),e.jsxs("div",{className:`buy-modal__card${k?" buy-modal__card--tall":""}`,children:[w&&e.jsxs("div",{className:"buy-modal__head",children:[e.jsxs("div",{className:"buy-modal__head-row",children:[e.jsx("h2",{className:"buy-modal__title",children:M}),!_&&e.jsx("button",{className:"buy-modal__x",onClick:l,"aria-label":a("buyModal.close"),children:e.jsx("svg",{viewBox:"0 0 18 18",width:"18",height:"18","aria-hidden":!0,children:e.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#161518",strokeWidth:"1.8",strokeLinecap:"round"})})})]}),e.jsxs("div",{className:"buy-modal__balance",children:[e.jsx("span",{className:"buy-modal__balance-label",children:r==="nofunds"?a("buyModal.dclBalance"):a("buyModal.myCreditsBalance")}),e.jsx(I,{className:"buy-modal__balance-ico"}),e.jsx("span",{className:"buy-modal__balance-value",children:W(u)})]})]}),r==="processing"&&e.jsx(os,{stage:t.stage??"reserving",step:t.step??1,total:t.total??1,isSelfCustody:!!t.isSelfCustody}),r==="nofunds"&&e.jsx(ls,{lines:t.lines??[],shortfallCredits:t.shortfallCredits??0,packs:t.packs??[],selectedPack:t.selectedPack??"",onSelectPack:t.onSelectPack??(()=>{}),onBuyPacks:t.onBuyPacks??(()=>{}),onCancel:l}),r==="complete"&&e.jsx(is,{purchased:t.purchased??[],onMyAssets:t.onMyAssets??l,onTryInWorld:t.onTryInWorld??l}),r==="error"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-error",children:[e.jsx("img",{className:"buy-error__art",src:rs,alt:"",width:64,height:80}),e.jsxs("p",{className:"buy-error__text",children:[e.jsx("b",{children:a("cartCheckout.errorHeadline")})," ",a("cartCheckout.errorBody")]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:l,children:a("buyModal.cancel")}),e.jsx("button",{className:"buy-modal__btn buy-modal__btn--purple",onClick:t.onRetry??l,children:a("cartCheckout.tryAgain")})]})]})]})]})}function os({stage:t,step:r,total:u,isSelfCustody:l}){const _=t==="reserving",w=u>0?Math.min(100,Math.round(r/u*100)):0,M=t==="awaiting-signature"?l?a("buyModal.confirmToContinue"):a("buyModal.completingTransaction"):t==="settling"?a("buyModal.completingTransaction"):a("cartCheckout.preparing");return e.jsxs("div",{className:"buy-modal__body buy-modal__processing",children:[e.jsx("img",{className:"buy-modal__logo",src:es,alt:"",width:61,height:61}),e.jsx("div",{className:"buy-modal__processing-text",children:M}),_?e.jsxs("div",{className:"cart-checkout__progress-row",children:[e.jsx("div",{className:"buy-modal__progress","aria-hidden":!0,children:e.jsx("span",{className:"buy-modal__progress-fill buy-modal__progress-fill--step",style:{width:`${w}%`}})}),u>1?e.jsxs("span",{className:"cart-checkout__step",children:[r,"/",u]}):null]}):e.jsx("div",{className:"buy-modal__progress","aria-hidden":!0,children:e.jsx("span",{className:"buy-modal__progress-fill"})})]})}function ls({lines:t,shortfallCredits:r,packs:u,selectedPack:l,onSelectPack:_,onBuyPacks:w,onCancel:M}){const k=u.find(c=>c.id===l),H=t.reduce((c,y)=>c+(y.quantity??1),0);return e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-modal__warning",children:[e.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":!0,className:"buy-modal__warning-ico",children:[e.jsx("path",{d:"M12 3L2 20h20L12 3z",fill:"none",stroke:"#691fa9",strokeWidth:"1.8",strokeLinejoin:"round"}),e.jsx("path",{d:"M12 9v5",stroke:"#691fa9",strokeWidth:"1.8",strokeLinecap:"round"}),e.jsx("circle",{cx:"12",cy:"17",r:"1.1",fill:"#691fa9"})]}),e.jsxs("p",{className:"buy-modal__warning-text",children:[e.jsx("b",{children:a("buyModal.insufficientFunds")})," ",a("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:a("buyModal.warningCreditsAmount",{count:Math.max(0,r)})})," ",a("buyModal.warningToPurchase",{count:H})]})]}),e.jsx("div",{className:"cart-checkout__scroll",children:t.map(c=>{const y=c.quantity??1;return e.jsxs("div",{className:"buy-modal__asset",children:[e.jsx("div",{className:"buy-modal__asset-thumb",children:c.item.thumbnail?e.jsx("img",{src:c.item.thumbnail,alt:""}):null}),e.jsxs("div",{className:"buy-modal__asset-info",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"buy-modal__asset-name",title:c.item.name,children:[c.item.name||a("buyModal.itemFallback"),y>1?e.jsx("span",{className:"cart-checkout__qty-tag",children:a("cartCheckout.qty",{count:y})}):null]}),c.item.creator?e.jsx("div",{className:"buy-modal__asset-creator",children:a("search.byCreator",{name:c.item.creator})}):null]}),e.jsxs("div",{className:"buy-modal__asset-price",children:[e.jsx(I,{className:"buy-modal__asset-price-ico"}),e.jsx("span",{children:W(c.priceCredits*y)})]})]})]},c.item.id)})}),e.jsx("div",{className:"buy-modal__packs",children:u.map(c=>{const y=c.id===l;return e.jsxs("button",{className:`buy-modal__pack${y?" buy-modal__pack--on":""}`,onClick:()=>_(c.id),children:[e.jsx(I,{className:"buy-modal__pack-ico"}),e.jsx("span",{className:"buy-modal__pack-amount",children:W(c.credits)}),e.jsxs("span",{className:"buy-modal__pack-usd",children:["($",c.usd.toFixed(2),")"]})]},c.id)})}),e.jsxs("div",{className:"buy-modal__total",children:[e.jsxs("div",{className:"buy-modal__total-credits",children:[e.jsx(I,{className:"buy-modal__total-ico"}),e.jsx("span",{children:W((k==null?void 0:k.credits)??0)})]}),e.jsxs("span",{className:"buy-modal__total-usd",children:["$",((k==null?void 0:k.usd)??0).toFixed(2)]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:M,children:a("buyModal.cancel")}),e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient",onClick:w,children:a("buyModal.buy")})]})]})}function is({purchased:t,onMyAssets:r,onTryInWorld:u}){return e.jsxs("div",{className:"buy-modal__body cart-checkout__done-body",children:[e.jsxs("div",{className:"buy-modal__success",children:[e.jsxs("svg",{viewBox:"0 0 64 64",width:"60",height:"60","aria-hidden":!0,children:[e.jsx("circle",{cx:"32",cy:"32",r:"32",fill:"#34ce77"}),e.jsx("path",{d:"M20 33l8 8 16-18",fill:"none",stroke:"#fff",strokeWidth:"5",strokeLinecap:"round",strokeLinejoin:"round"})]}),e.jsxs("p",{className:"buy-modal__success-text",children:[e.jsx("b",{children:a("getCredits.successTitle")})," ",a("buyModal.successBody")]})]}),e.jsx("div",{className:"cart-checkout__done",children:e.jsx("div",{className:"cart-checkout__done-scroll",children:t.map(l=>{const _=l.quantity??1;return e.jsxs("div",{className:"cart-checkout__done-row",children:[e.jsxs("div",{className:"cart-checkout__done-thumb",children:[l.thumbnail?e.jsx("img",{src:l.thumbnail,alt:""}):null,e.jsx("span",{className:"cart-checkout__done-check","aria-hidden":!0,children:e.jsx("svg",{viewBox:"0 0 18 18",width:"12",height:"12",children:e.jsx("path",{d:"M4 9l3.5 3.5L14 5",fill:"none",stroke:"#fff",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),e.jsxs("div",{className:"cart-checkout__done-info",children:[e.jsxs("div",{className:"cart-checkout__done-name",title:l.name,children:[l.name||a("buyModal.itemFallback"),_>1?e.jsx("span",{className:"cart-checkout__qty-tag",children:a("cartCheckout.qty",{count:_})}):null]}),l.creator?e.jsx("div",{className:"cart-checkout__done-creator",children:a("search.byCreator",{name:l.creator})}):null]}),e.jsxs("div",{className:"cart-checkout__done-price",children:[e.jsx(I,{className:"cart-checkout__done-price-ico"}),e.jsx("span",{children:W(l.priceCredits*_)})]})]},l.id)})})}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:r,children:a("buyModal.myAssets")}),e.jsxs("button",{className:"buy-modal__btn buy-modal__btn--ruby",onClick:u,children:[a("buyModal.tryInWorld"),e.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20","aria-hidden":!0,children:e.jsx("path",{d:"M5 12h12M13 7l5 5-5 5",fill:"none",stroke:"#fcfcfc",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})]})]})}const ds=Re(We)`
|
|
2
|
+
margin-top: 12px;
|
|
3
|
+
`;function _e(t){if(ss(t))return a("errors.rejected");const r=(t.message??"").toLowerCase();return r.includes("insufficient")?a("cart.error.insufficient",{currency:ze.name}):r.includes("no active listing")||r.includes("your own listing")?a("cart.error.listingChanged"):a("marketCheckout.error.generic")}const us=12e4,hs=Ue.chainId===80002?"https://decentraland.zone/jump":"https://decentraland.org/jump";function ms(t){const r=[];return t.unavailable.length&&r.push(a("cart.drop.unavailable",{count:t.unavailable.length})),t.own.length&&r.push(a("cart.drop.own",{count:t.own.length})),a("cart.drop.removed",{items:r.join(` ${a("cart.drop.and")} `)})}const ye=t=>t.reduce((r,u)=>r+u.priceCredits*u.quantity,0),_s=t=>t.flatMap(r=>Array.from({length:r.quantity},()=>({...r,quantity:1})));function Ts(){Le({title:a("nav.cart"),noindex:!0});const t=C(s=>s.items),r=C(s=>s.remove),u=C(s=>s.increment),l=C(s=>s.decrement),_=C(s=>s.clear),w=C(s=>s.restore),M=C(s=>s.setFittingOpen),k=ie(s=>s.items),H=ie(s=>s.toggle),{session:c}=Ie(),y=Xe().packs.slice(0,3);j.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const pe=t.some(s=>s.category!=="emote"),{data:V}=Te({queryKey:["upsell-listings"],queryFn:()=>Oe({first:40}),staleTime:6e4}),{data:B}=Pe(c),U=Ee(),z=Se(),{state:T}=qe(),[ee,F]=j.useState(null),[be,S]=j.useState(null),[se,$]=j.useState(null),[xe,P]=j.useState(!1),[g,A]=j.useState(null),ae=j.useRef(0),[i,v]=j.useState(null),[Y,te]=j.useState(""),je=t.reduce((s,n)=>s+n.priceCredits*n.quantity,0),ce=t.reduce((s,n)=>s+n.quantity,0),ke=g?g.liveTotalCredits:je,ge=new Set(t.map(s=>s.id)),re=((V==null?void 0:V.items)??[]).filter(s=>!ge.has(s.id)).slice(0,12),fe=new Map(g==null?void 0:g.buyable.map(s=>[s.item.id,s])),Q=(B==null?void 0:B.credits)??0,ve=Ae;function K(s){s(),A(null),$(null),S(null)}function Ne(){v(null),P(!1)}function ne(s){const n=ye(s),o=Math.max(0,n-Q),b=y.find(h=>h.credits>=o)??y[y.length-1];te(b.id),J("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:n,credits_balance:Q,shortfall:o}),v({phase:"nofunds",lines:s.map(h=>({item:h.item,priceCredits:h.priceCredits,quantity:h.quantity})),shortfall:o}),P(!1)}async function Ce(s){if(!c||s.length===0)return;const n=_s(s),o=n.map(d=>({...d.item,priceCredits:d.priceCredits})),b=s.map(d=>({...d.item,priceCredits:d.priceCredits,quantity:d.quantity})),h=[];let N="authorize",G=!1;v({phase:"processing",stage:"reserving",step:1,total:n.length});try{const d=[];for(let m=0;m<n.length;m++){const L=n[m];v({phase:"processing",stage:"reserving",step:m+1,total:n.length});try{const{credit:p,maxCreditedValue:X}=await $e(c.identity,L.usdCents,L.trade.id);h.push(p.id),d.push({trade:L.trade,credits:[p],maxCreditedValue:X})}catch(p){if(as(p)){if(h.length){try{await ue(c.identity,h)}catch(X){R(X,{flow:"cart_checkout",step:"release"})}U.invalidateQueries({queryKey:["usd-balance"]})}ne(s);return}throw p}}N="submit";const x=()=>v({phase:"processing",stage:"settling",step:n.length,total:n.length});v({phase:"processing",stage:"awaiting-signature",step:n.length,total:n.length});let f=[];if(Ge())try{f=await Je({purchases:d,buyer:c.address,signer:c.signer,onSigned:x});const L=(await Promise.allSettled(f.map(p=>De(p)))).flatMap(p=>p.status==="rejected"?[p.reason]:[]);if(L.length&&!L.some(p=>p instanceof He))throw L[0];G=!0}catch(m){if(!(m instanceof Ve))throw m;f=await me({purchases:d,buyer:c.address,signer:c.signer,onSigned:x})}else f=await me({purchases:d,buyer:c.address,signer:c.signer});s.forEach(m=>r(m.item.id)),A(null),J("Shop Completed Purchase",{...Qe(o),payment_type:"credits",no_crypto_step:G,transaction_hash:f[0]??null}),U.invalidateQueries({queryKey:["usd-balance"]}),v({phase:"complete",purchased:b})}catch(d){if(he(d)||R(d,{flow:"cart_checkout",step:N,cart_size:s.length}),J(he(d)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:N,error_code:Ke(d),value_usd:de(o.reduce((x,f)=>x+f.priceCredits,0)),cart_size:n.length}),h.length){try{await ue(c.identity,h)}catch(x){R(x,{flow:"cart_checkout",step:"release"})}U.invalidateQueries({queryKey:["usd-balance"]})}v({phase:"error",message:_e(d)})}}function oe(s){const n=ye(s);if(B!=null&&B.credits<n){ne(s);return}Ce(s)}async function O(){if(!c){S(a("buyModal.signInToCheckout"));return}const s=C.getState().items;if(s.length===0)return;S(null),$(null),P(!0);const n=s.reduce((o,b)=>o+b.priceCredits*b.quantity,0);J("Shop Started Checkout",{cart_size:s.length,cart_value_credits:n,cart_value_usd:de(n),has_sufficient_credits:Q>=n});try{F(a("cart.status.reviewing"));const o=await Ye(s,c.address,ve),b=[...o.unavailable,...o.own];if(b.length&&(b.forEach(h=>r(h.id)),$(ms(o))),o.buyable.length===0){S(a("cart.error.noneAvailable")),A(null),F(null);return}if(o.orderChanged){A(o),ae.current=Date.now(),F(null);return}F(null),oe(o.buyable)}catch(o){R(o,{flow:"cart_checkout",step:"review",cart_size:s.length}),S(_e(o)),F(null)}finally{P(!1)}}async function we(){if(g){if(!c){S(a("buyModal.signInToCheckout"));return}if(Date.now()-ae.current>us){A(null),$(null),await O();return}S(null),oe(g.buyable)}}async function Me(){if(Y){try{sessionStorage.setItem(D,JSON.stringify(C.getState().items))}catch{}P(!0);try{const s=await Ze(Y,c?{address:c.address,identity:c.identity}:void 0);if(s.url){window.location.href=s.url;return}z("/credits")}catch(s){try{sessionStorage.removeItem(D)}catch{}R(s,{flow:"cart_buy_credits"}),v({phase:"error",message:a("buyModal.error.creditsCheckout")})}finally{P(!1)}}}const le=j.useRef(!1);j.useEffect(()=>{if(!(T!=null&&T.resumeCheckout)||le.current)return;le.current=!0;try{const n=sessionStorage.getItem(D);if(n){sessionStorage.removeItem(D);const o=JSON.parse(n);Array.isArray(o)&&o.length&&w(o)}}catch{}U.invalidateQueries({queryKey:["usd-balance"]});const s=setTimeout(()=>void O(),0);return()=>clearTimeout(s)},[T==null?void 0:T.resumeCheckout]);const q=xe||(i==null?void 0:i.phase)==="processing";return t.length===0&&!i?e.jsxs("div",{className:"cart cart--empty",children:[e.jsx(E,{name:"cart",size:44,color:"var(--muted-2)"}),e.jsx("p",{className:"cart-empty__title",children:a("cart.empty.title")}),e.jsx("p",{className:"muted",children:a("cart.empty.body")}),e.jsx(ds,{as:Z,to:"/assets",variant:"purple",children:a("cart.empty.cta")})]}):e.jsxs("div",{className:"checkout",children:[e.jsxs("div",{className:"checkout__top",children:[e.jsxs("button",{className:"checkout__back",onClick:()=>z(-1),type:"button",children:[e.jsx(E,{name:"arrow-left"}),a("nav.cart")]}),e.jsxs("div",{className:"checkout__body",children:[e.jsxs("div",{className:"checkout__left",children:[e.jsxs("div",{className:"checkout__head-card",children:[e.jsx("button",{className:"checkout__panel-back",onClick:()=>z(-1),type:"button","aria-label":a("cart.goBack"),children:e.jsx(E,{name:"arrow-left"})}),e.jsx("h1",{className:"checkout__panel-title",children:a("cart.panelTitle",{count:ce})}),pe?e.jsxs("button",{className:"checkout__fitting",onClick:()=>M(!0),disabled:q,children:[e.jsx(E,{name:"fitting-room"}),a("cart.fittingRoom")]}):null]}),e.jsxs("section",{className:"checkout__panel",children:[e.jsx("div",{className:"checkout__list",children:t.map(s=>{const n=fe.get(s.id),o=n?n.priceCredits:s.priceCredits,b=!!n&&n.priceCredits!==s.priceCredits,h=!s.tokenId,N=s.quantity,G=typeof s.available=="number"&&N>=s.available,d=o*N,x=!!k[s.id],f=s.tokenId??s.itemId,m=s.contractAddress&&f?`/item/${s.contractAddress}/${f}`:null;return e.jsxs("div",{className:"checkout__card",children:[e.jsxs("div",{className:"checkout__thumb",children:[m?e.jsx(Z,{className:"checkout__thumb-link",to:m,state:{item:s,tradeId:s.tradeId},"aria-label":s.name,children:s.thumbnail?e.jsx("img",{src:s.thumbnail,alt:s.name}):null}):s.thumbnail?e.jsx("img",{src:s.thumbnail,alt:s.name}):null,e.jsx("span",{className:"checkout__thumb-check","aria-hidden":!0,children:e.jsx("svg",{viewBox:"0 0 20 20",width:"12",height:"12",children:e.jsx("path",{d:"M5 10.5l3 3 7-7.5",fill:"none",stroke:"#fff",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),e.jsxs("div",{className:"checkout__info",children:[e.jsxs("div",{className:"checkout__desc",children:[m?e.jsx(Z,{className:"checkout__name",to:m,state:{item:s,tradeId:s.tradeId},title:s.name,children:s.name}):e.jsx("div",{className:"checkout__name",title:s.name,children:s.name}),s.creator?e.jsx(Be,{address:s.creator,className:"checkout__creator",linkToProfile:!0}):null]}),e.jsxs("div",{className:"checkout__foot",children:[h?e.jsxs("div",{className:"checkout__stepper",children:[e.jsx("button",{className:"checkout__step",onClick:()=>K(()=>l(s.id)),disabled:q||N<=1,"aria-label":a("cart.decreaseQuantity",{name:s.name}),children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:e.jsx("path",{d:"M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),e.jsx("span",{className:"checkout__qty",children:N}),e.jsx("button",{className:"checkout__step",onClick:()=>K(()=>u(s.id)),disabled:q||G,"aria-label":a("cart.increaseQuantity"),children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:e.jsx("path",{d:"M8 3.5v9M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}):null,e.jsxs("div",{className:"checkout__price",children:[e.jsx(I,{className:"checkout__price-ico"})," ",d,b?e.jsx("span",{className:"checkout__price-was",children:s.priceCredits*N}):null]})]})]}),e.jsxs("div",{className:"checkout__actions",children:[e.jsx("button",{className:`checkout__fav${x?" is-on":""}`,onClick:()=>H(s),"aria-label":x?a("cart.removeFromFavorites",{name:s.name}):a("cart.addToFavorites",{name:s.name}),title:x?a("assetCard.removeFromFavorites"):a("assetCard.addToFavorites"),children:e.jsx(E,{name:x?"heart-solid":"heart"})}),e.jsx("button",{className:"checkout__remove",onClick:()=>K(()=>r(s.id)),disabled:q,"aria-label":a("cart.remove",{name:s.name}),title:a("cart.removeTitle"),children:e.jsx(E,{name:"trash",size:24})})]})]},s.id)})}),e.jsx("div",{className:"checkout__utils",children:e.jsx("button",{className:"link",onClick:()=>K(_),disabled:q,children:a("cart.clearCart")})})]})]}),e.jsxs("aside",{className:"checkout__summary",children:[e.jsx("h2",{className:"checkout__summary-title",children:a("cart.purchaseSummary")}),e.jsxs("div",{className:"checkout__summary-body",children:[e.jsxs("div",{className:"checkout__total-line",children:[e.jsx("span",{className:"checkout__total-label",children:a("cart.totalItems",{count:ce})}),e.jsxs("span",{className:"checkout__total-value",children:[e.jsx(I,{className:"checkout__total-ico"})," ",ke]})]}),e.jsx("button",{className:"checkout__cta",onClick:()=>void(g?we():O()),disabled:q,children:q?a("cart.working"):g?a("marketCheckout.confirmPurchase"):a("assetCard.buyNow")}),g?e.jsx("p",{className:"muted checkout__msg",children:a("cart.priceChanged")}):null,se?e.jsx("p",{className:"muted checkout__msg",children:se}):null,ee?e.jsx("p",{className:"muted checkout__msg",children:ee}):null,e.jsx(ts,{message:be,className:"checkout__msg"})]})]})]})]}),re.length>0?e.jsx("div",{className:"cart-upsell",children:e.jsx(cs,{title:a("cart.youMightAlsoLike"),items:re})}):null,i?e.jsx(ns,{phase:i.phase,balanceCredits:Q,onClose:Ne,stage:i.phase==="processing"?i.stage:void 0,step:i.phase==="processing"?i.step:void 0,total:i.phase==="processing"?i.total:void 0,isSelfCustody:Fe(c==null?void 0:c.providerType),lines:i.phase==="nofunds"?i.lines:void 0,shortfallCredits:i.phase==="nofunds"?i.shortfall:void 0,packs:y,selectedPack:Y,onSelectPack:te,onBuyPacks:()=>void Me(),purchased:i.phase==="complete"?i.purchased:void 0,onMyAssets:()=>z("/assets?tab=mine"),onTryInWorld:()=>window.open(hs,"_blank","noopener"),message:i.phase==="error"?i.message:void 0,onRetry:()=>void O()}):null]})}export{Ts as Cart};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{K as N,L as U,M as w,N as z,O as o,P as E,Q as c,R as I,S as g,U as D,H as M}from"./index-V0hMC6mZ.js";import{r as K,j as v}from"./react-BMZSDQJw.js";function F(r){return N("MuiCircularProgress",r)}U("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const L=["className","color","disableShrink","size","style","thickness","value","variant"];let l=r=>r,P,S,b,$;const t=44,W=M(P||(P=l`
|
|
2
2
|
0% {
|
|
3
3
|
transform: rotate(0deg);
|
|
4
4
|
}
|
|
@@ -23,6 +23,6 @@ import{H as N,J as U,K as w,L as z,M as o,N as E,O as c,P as I,Q as g,R as D,S a
|
|
|
23
23
|
}
|
|
24
24
|
`)),G=r=>{const{classes:e,variant:s,color:a,disableShrink:d}=r,u={root:["root",s,`color${c(a)}`],svg:["svg"],circle:["circle",`circle${c(s)}`,d&&"circleDisableShrink"]};return I(u,F,e)},H=g("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(r,e)=>{const{ownerState:s}=r;return[e.root,e[s.variant],e[`color${c(s.color)}`]]}})(({ownerState:r,theme:e})=>o({display:"inline-block"},r.variant==="determinate"&&{transition:e.transitions.create("transform")},r.color!=="inherit"&&{color:(e.vars||e).palette[r.color].main}),({ownerState:r})=>r.variant==="indeterminate"&&D(b||(b=l`
|
|
25
25
|
animation: ${0} 1.4s linear infinite;
|
|
26
|
-
`),W)),
|
|
26
|
+
`),W)),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)),q=K.forwardRef(function(e,s){const a=w({props:e,name:"MuiCircularProgress"}),{className:d,color:u="primary",disableShrink:R=!1,size:m=40,style:_,thickness:i=3.6,value:p=0,variant:k="indeterminate"}=a,j=z(a,L),n=o({},a,{color:u,disableShrink:R,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(H,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{q as C};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,r as p,d as Q,u as Y}from"./react-BMZSDQJw.js";import{y as N,s as v,
|
|
1
|
+
import{j as e,r as p,d as Q,u as Y}from"./react-BMZSDQJw.js";import{y as N,s as v,ac as Z,I as J,t,c as V,x as W,e as X,u as ee,A as ae,au as te,C as re,av as se}from"./index-V0hMC6mZ.js";import{E as oe}from"./ErrorNotice-DDr3KjIH.js";import{d as ie,g as ce,a as ne,A as le}from"./collection-DbmjhyjW.js";import{u as de}from"./useStore-cTXMZhwG.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-D7_Qudaw.js";import{L as xe}from"./LoadMore-BK9c312B.js";import{u as he}from"./useInfiniteGrid-COXciuKu.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-8SzFotJj.js";import"./ethers-Dpp9c5As.js";import"./intl-CBcMB1D2.js";import"./emotion-CSxEP8yM.js";const be=v.section`
|
|
2
2
|
position: relative;
|
|
3
3
|
border-radius: ${N.radius.card};
|
|
4
4
|
overflow: hidden;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,j as t}from"./react-BMZSDQJw.js";import{t as s,I as k,G as f,A as N}from"./index-
|
|
1
|
+
import{r as o,j as t}from"./react-BMZSDQJw.js";import{t as s,I as k,G as f,A as N}from"./index-V0hMC6mZ.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{g as ee}from"./react-BMZSDQJw.js";import{B as H}from"./dcl-schemas-BICTSpB5.js";import{r as te}from"./index-CAp_8XyK.js";import{p as N}from"./sentry-8SzFotJj.js";import{r as ne}from"./browser-ponyfill-C_hn4Jen.js";function re(o,E){for(var M=0;M<E.length;M++){const y=E[M];if(typeof y!="string"&&!Array.isArray(y)){for(const C in y)if(C!=="default"&&!(C in o)){const F=Object.getOwnPropertyDescriptor(y,C);F&&Object.defineProperty(o,C,F.get?F:{enumerable:!0,get:()=>y[C]})}}}return Object.freeze(Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}))}var R={},Q,W;function ie(){return W||(W=1,Q=typeof self=="object"?self.FormData:window.FormData),Q}var V={},I={},q={},L={},z;function ae(){if(z)return L;z=1,Object.defineProperty(L,"__esModule",{value:!0}),L.isUsingNode=void 0;function o(){return typeof N<"u"&&N.release&&N.release.name==="node"}return L.isUsingNode=o,L}var G;function se(){if(G)return q;G=1;var o=q&&q.__createBinding||(Object.create?(function(a,l,m,d){d===void 0&&(d=m);var g=Object.getOwnPropertyDescriptor(l,m);(!g||("get"in g?!l.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return l[m]}}),Object.defineProperty(a,d,g)}):(function(a,l,m,d){d===void 0&&(d=m),a[d]=l[m]})),E=q&&q.__setModuleDefault||(Object.create?(function(a,l){Object.defineProperty(a,"default",{enumerable:!0,value:l})}):function(a,l){a.default=l}),M=q&&q.__importStar||function(a){if(a&&a.__esModule)return a;var l={};if(a!=null)for(var m in a)m!=="default"&&Object.prototype.hasOwnProperty.call(a,m)&&o(l,a,m);return E(l,a),l},y=q&&q.__rest||function(a,l){var m={};for(var d in a)Object.prototype.hasOwnProperty.call(a,d)&&l.indexOf(d)<0&&(m[d]=a[d]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var g=0,d=Object.getOwnPropertySymbols(a);g<d.length;g++)l.indexOf(d[g])<0&&Object.prototype.propertyIsEnumerable.call(a,d[g])&&(m[d[g]]=a[d[g]]);return m};Object.defineProperty(q,"__esModule",{value:!0}),q.createFetchComponent=void 0;const C=M(ne()),F=ae(),D=[400,401,403,404],U=["GET","HEAD","OPTIONS","PUT","DELETE"];async function _(a,l){const{timeout:m,abortController:d,signal:g,retryDelay:$}=l;let O=l.attempts,r=null,e;do try{m&&(r=setTimeout(()=>{d.abort()},m));const i=C.default(a.toString(),Object.assign(Object.assign({},l),{signal:g})),t=Promise.race([i,new Promise((c,v)=>{g.addEventListener("abort",()=>{c(new C.Response("timeout",{status:408,statusText:"Request Timeout"}))})})]);--O,e=await t,r&&clearTimeout(r)}finally{if(e&&(e.ok||D.includes(e.status)||O===0))break;await new Promise(i=>setTimeout(i,$))}while((!e||!e.ok)&&O>0);return e}function j(a){async function l(m,d){const $=Object.assign(Object.assign({},a==null?void 0:a.defaultFetcherOptions),d)||{},{timeout:O,method:r="GET",retryDelay:e=0,abortController:i}=$,t=y($,["timeout","method","retryDelay","abortController"]);let c=t.attempts||1;const v=i||new AbortController,{signal:s}=v;a!=null&&a.defaultHeaders&&(t.headers=Object.assign(Object.assign({},a==null?void 0:a.defaultHeaders),t.headers||{})),U.includes(r.toUpperCase())||(c=1);const n=await _(m,Object.assign(Object.assign({},t),{attempts:c,method:r,timeout:O,retryDelay:e,signal:s,abortController:v}));if(!(n!=null&&n.ok)){const u=await(n==null?void 0:n.text());throw new Error(`Failed to fetch ${m}. Got status ${n==null?void 0:n.status}. Response was '${u}'`)}return!(0,F.isUsingNode)()&&n&&Object.defineProperty(n,"buffer",{value:async function(){return H.from(await n.arrayBuffer())},configurable:!0}),s.aborted?void 0:n}return{fetch:l}}return q.createFetchComponent=j,q}var Y;function oe(){return Y||(Y=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.createFetchComponent=void 0;var E=se();Object.defineProperty(o,"createFetchComponent",{enumerable:!0,get:function(){return E.createFetchComponent}})})(I)),I}const le="0.0.0-development",ue={version:le};var X;function ce(){return X||(X=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.QueryBuilder=o.sanitizeUrl=o.mergeRequestOptions=o.isNode=o.convertFiltersToQueryParams=o.splitValuesIntoManyQueries=o.splitValuesIntoManyQueryBuilders=o.splitAndFetchPaginated=o.splitAndFetch=o.MAX_URL_LENGTH=o.addModelToFormData=o.getCurrentVersion=void 0;const E=oe(),M=ue;function y(){return M.version}o.getCurrentVersion=y;function C(r,e,i=""){for(const t in r){if(!r.hasOwnProperty(t)||r[t]===null||r[t]===void 0)continue;const c=i?`${i}[${t}]`:t;r[t]instanceof Date?e.append(c,r[t].toISOString()):r[t]instanceof Array?r[t].forEach((v,s)=>{const n=`${c}[${s}]`;C(v,e,n)}):typeof r[t]=="object"?C(r[t],e,c):e.append(c,r[t].toString())}return e}o.addModelToFormData=C;function F(r){return Array.from(new Set(r))}o.MAX_URL_LENGTH=2048;async function D({baseUrl:r,path:e,queryParams:i,fetcher:t,uniqueBy:c,options:v}){t=t||(0,E.createFetchComponent)();const s=a({baseUrl:r,path:e,queryParams:i}),n=new Map;for(const u of s)(await(await t.fetch(u,{...v,headers:{"Content-Type":"application/json"}})).json()).forEach(w=>n.set(c?w[c]:n.size,w));return Array.from(n.values())}o.splitAndFetch=D;const U=7;async function _({baseUrl:r,path:e,queryParams:i,elementsProperty:t,uniqueBy:c,options:v,fetcher:s}){s=s||(0,E.createFetchComponent)();const u=a({baseUrl:r,path:e,queryParams:i,reservedParams:new Map([["offset",U]])}),f=new Map;let w=!1;for(let b=0;b<u.length&&!w;b++){let p=u[b];for(;p&&!w;)try{const P=(await s.fetch(p,v)).json();P[t].forEach(A=>f.set(A[c],A));const T=P.pagination.next;p=T?new URL(T,p).toString():void 0}catch{w=!0}}return Array.from(f.values())}o.splitAndFetchPaginated=_;function j({queryParams:r,baseUrl:e,path:i,reservedParams:t}){const c="name"in r?new Map([[r.name,r.values]]):r;if(c.size===0)return[new O(e+i,c,t)];const s=Array.from(c.entries()).map(([p,P])=>[p,F(P)]).sort(([p,P],[h,T])=>P.length-T.length),n=new O(e+i,new Map,t);for(let p=0;p<s.length-1;p++){const[P,h]=s[p];if(!n.canSetParams(P,h))throw new Error("This library can split one query param into many HTTP requests, but it can't split more than one. You will need to do that on the client side.");n.setParams(P,h)}let u=O.clone(n);const[f,w]=s[s.length-1],b=[];for(const p of w)u.canAddParam(f,p)||(b.push(u),u=O.clone(n)),u.addParam(f,p);return b.push(u),b}o.splitValuesIntoManyQueryBuilders=j;function a(r){return j(r).map(i=>i.toString())}o.splitValuesIntoManyQueries=a;function l(r){if(!r)return new Map;const e=Object.entries(r).filter(([i,t])=>!!t).map(([i,t])=>{const c=i.endsWith("s")?i.slice(0,-1):i;let v;if(Array.isArray(t))v=[...t].filter(g).map(s=>`${s}`);else if(g(t))v=[`${t}`];else throw new Error("Query params must be either a string, a number, a boolean or an array of the types just mentioned");return[c,v]}).filter(([i,t])=>t.length>0);return new Map(e)}o.convertFiltersToQueryParams=l;function m(){return Object.prototype.toString.call(typeof N<"u"?N:0)==="[object process]"}o.isNode=m;function d(r,e){const i={...r==null?void 0:r.headers,...e==null?void 0:e.headers};return{...r,...e,headers:i}}o.mergeRequestOptions=d;function g(r){return typeof r=="string"||typeof r=="number"||typeof r=="boolean"}function $(r){return r=r.trim(),!r.startsWith("https://")&&!r.startsWith("http://")&&(r="https://"+r),r.endsWith("/")&&(r=r.slice(0,-1)),r}o.sanitizeUrl=$;class O{constructor(e,i=new Map,t=new Map){this.baseUrl=e,this.queryParams=i,this.reservedParams=t,this.length=this.calculateUrlLength(i,t)}canAddParam(e,i){return this.length+e.length+i.length+2<o.MAX_URL_LENGTH}addParam(e,i){if(!this.canAddParam(e,i))throw new Error(`You can't add this parameter '${e}', since it would exceed the max url length`);const t=this.queryParams.get(e),c=t||[];return c.push(i),this.queryParams.set(e,c),this.length+=this.calculateAddedLength(e,[i]),this}canSetParams(e,i){const t=new Map([...this.queryParams,[e,i]]);return this.calculateUrlLength(t,this.reservedParams)<o.MAX_URL_LENGTH}setParams(e,i){if(!this.canSetParams(e,i))throw new Error(`You can't add this parameter '${e}', since it would exceed the max url length`);return this.queryParams.set(e,i.map(t=>`${t}`)),this.length=this.calculateUrlLength(this.queryParams,this.reservedParams),this}setParam(e,i){return this.setParams(e,[i]),this}toString(){let e=this.baseUrl,i=!1;for(const[t,c]of this.queryParams)for(const v of c)i?e+=`&${t}=${v}`:(e+=`?${t}=${v}`,i=!0);return e}calculateUrlLength(e,i){let t=this.baseUrl.length;for(const[c,v]of i)this.queryParams.has(c)||(t+=c.length+2+v);for(const[c,v]of e)t+=this.calculateAddedLength(c,v);return t}static clone(e){return new O(e.baseUrl,new Map(e.queryParams),e.reservedParams)}calculateAddedLength(e,i){return this.calculateArrayLength(i)+(e.length+2)*i.length}calculateArrayLength(e){return e.map(i=>`${i}`).reduce((i,t)=>i+t.length,0)}}o.QueryBuilder=O})(V)),V}var B={},J;function fe(){if(J)return B;J=1,Object.defineProperty(B,"__esModule",{value:!0}),B.retry=void 0;async function o(E,M,y,C){for(;y>0;)try{return await M()}catch(F){if(y--,y>0)console.info(`Failed to ${E}. Still have ${y} attempt/s left. Will try again in ${C}`),await new Promise(D=>setTimeout(D,C));else throw F}throw new Error("Please specify more than one attempt for the retry function")}return B.retry=o,B}var k;function de(){if(k)return R;k=1;var o=R&&R.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(R,"__esModule",{value:!0}),R.createContentClient=R.downloadContent=void 0;const E=te(),M=o(ie()),y=ce(),C=fe();function F(_){return _.buffer?_.buffer:_}async function D(_,j,a,l){const{attempts:m=3,retryDelay:d=500}=l||{},g=l!=null&&l.timeout?{timeout:l.timeout}:{};return(0,C.retry)(`fetch file with hash ${a} from ${j}`,async()=>{const $=await _.fetch(`${j}/${a}`,g),O=H.from(await $.arrayBuffer());if(!(l!=null&&l.avoidChecks)&&(a.startsWith("Qm")?await(0,E.hashV0)(O):await(0,E.hashV1)(O))!==a)throw new Error(`Failed to fetch file with hash ${a} from ${j}`);return O},m,d)}R.downloadContent=D;function U(_){const{fetcher:j,logger:a}=_,l=(0,y.sanitizeUrl)(_.url),m=_==null?void 0:_.parallelConfig;async function d(s,n,u){const f=new AbortController,w=f.signal,b=(0,y.mergeRequestOptions)(u,{signal:w});return new Promise(async p=>{let P=s.length;const h=()=>{P--,P===0&&p([])},T=A=>A&&Array.isArray(A)&&A.length>0?(f.abort(),p(A),!0):!1;s.forEach(async A=>{try{const S=(0,y.sanitizeUrl)(A),Z=await j.fetch(`${S}${n}`,b);if(w.aborted){h();return}const x=await Z.json();T(x)||h()}catch(S){w.aborted||a==null||a.warn(`Failed to fetch from ${A}:`,S),h()}})})}async function g(s,n,u){const w=(await Promise.allSettled(s.map(async h=>{try{const T=(0,y.sanitizeUrl)(h);return await(await j.fetch(`${T}${n}`,u)).json()}catch(T){return a==null||a.warn(`Failed to fetch from ${h}:`,T),[]}}))).filter(h=>h.status==="fulfilled").map(h=>h.value||[]),b=w.flatMap(h=>h),p=w.filter(h=>h.length===0).length,P=new Map;return b.forEach(h=>{(!P.has(h.id)||h.timestamp>P.get(h.id).timestamp)&&P.set(h.id,h)}),{entities:Array.from(P.values()),emptyResults:p}}async function $(s,n){const u=(0,y.isNode)(),f=new M.default;f.append("entityId",s.entityId),(0,y.addModelToFormData)(s.authChain,f,"authChain");const w=await c(Array.from(s.files.keys()),n);for(const[b,p]of s.files)(!w.has(b)||b===s.entityId)&&(u?f.append(b,H.isBuffer(p)?p:H.from(F(p)),b):f.append(b,new Blob([F(p)]),b));return f}async function O(s,n){const u=await $(s,n),f=(0,y.mergeRequestOptions)(n||{},{body:u,method:"POST"});return await j.fetch(`${l}/entities`,f)}async function r(s,n){if(s.length===0)return Promise.reject("You must set at least one pointer.");const u=(0,y.mergeRequestOptions)(n||{},{body:JSON.stringify({pointers:s}),method:"POST",headers:{"Content-Type":"application/json"}});return(await j.fetch(`${l}/entities/active`,u)).json()}async function e(s,n){if(s.length===0)return Promise.reject("You must set at least one id.");const u=(0,y.mergeRequestOptions)(n||{},{body:JSON.stringify({ids:s}),method:"POST",headers:{"Content-Type":"application/json"}}),f=(n==null?void 0:n.parallel)||m;return f!=null&&f.urls&&(f==null?void 0:f.urls.length)>0?d([l,...f.urls],"/entities/active",u):(await j.fetch(`${l}/entities/active`,u)).json()}async function i(s,n){const u=await e([s],n);return u.length===0?Promise.reject(`Failed to find an entity with id '${s}'.`):u[0]}function t(s,n){return s.length===0?Promise.reject("You must set at least one cid."):(0,y.splitAndFetch)({fetcher:j,options:n,baseUrl:l,path:"/available-content",queryParams:{name:"cid",values:s},uniqueBy:"cid"})}async function c(s,n){const f=(await t(s,n)).filter(w=>w.available).map(({cid:w})=>w);return new Set(f)}async function v(s,n){const u=(n==null?void 0:n.parallel)||m;if(!(u!=null&&u.urls)||u.urls.length===0)throw new Error("Parallel configuration is required for checking pointer consistency");const f=(0,y.mergeRequestOptions)(n||{},{body:JSON.stringify({pointers:[s]}),method:"POST",headers:{"Content-Type":"application/json"}}),w=[l,...u.urls],{entities:b,emptyResults:p}=await g(w,"/entities/active",f);if(b.length===0)return{isConsistent:!0,upToDateEntities:void 0,outdatedEntities:void 0};const P=Math.max(...b.map(S=>S.timestamp)),h=b.filter(S=>S.timestamp===P),T=b.filter(S=>S.timestamp<P);return{isConsistent:T.length===0&&p===0,upToDateEntities:h.length>0?h:void 0,outdatedEntities:T.length>0?T:void 0}}return{buildEntityFormDataForDeployment:$,fetchEntitiesByPointers:r,fetchEntitiesByIds:e,fetchEntityById:i,downloadContent:(s,n)=>D(j,l+"/contents",s,n),deploy:O,isContentAvailable:t,checkPointerConsistency:v}}return R.createContentClient=U,R}var K=de();const he=ee(K),we=re({__proto__:null,default:he},[K]);export{we as C};
|
|
1
|
+
import{g as ee}from"./react-BMZSDQJw.js";import{B as H}from"./dcl-schemas-BICTSpB5.js";import{r as te}from"./index-V1lpWoC-.js";import{p as N}from"./sentry-8SzFotJj.js";import{r as ne}from"./browser-ponyfill-C_hn4Jen.js";function re(o,E){for(var M=0;M<E.length;M++){const y=E[M];if(typeof y!="string"&&!Array.isArray(y)){for(const C in y)if(C!=="default"&&!(C in o)){const F=Object.getOwnPropertyDescriptor(y,C);F&&Object.defineProperty(o,C,F.get?F:{enumerable:!0,get:()=>y[C]})}}}return Object.freeze(Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}))}var R={},Q,W;function ie(){return W||(W=1,Q=typeof self=="object"?self.FormData:window.FormData),Q}var V={},I={},q={},L={},z;function ae(){if(z)return L;z=1,Object.defineProperty(L,"__esModule",{value:!0}),L.isUsingNode=void 0;function o(){return typeof N<"u"&&N.release&&N.release.name==="node"}return L.isUsingNode=o,L}var G;function se(){if(G)return q;G=1;var o=q&&q.__createBinding||(Object.create?(function(a,l,m,d){d===void 0&&(d=m);var g=Object.getOwnPropertyDescriptor(l,m);(!g||("get"in g?!l.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return l[m]}}),Object.defineProperty(a,d,g)}):(function(a,l,m,d){d===void 0&&(d=m),a[d]=l[m]})),E=q&&q.__setModuleDefault||(Object.create?(function(a,l){Object.defineProperty(a,"default",{enumerable:!0,value:l})}):function(a,l){a.default=l}),M=q&&q.__importStar||function(a){if(a&&a.__esModule)return a;var l={};if(a!=null)for(var m in a)m!=="default"&&Object.prototype.hasOwnProperty.call(a,m)&&o(l,a,m);return E(l,a),l},y=q&&q.__rest||function(a,l){var m={};for(var d in a)Object.prototype.hasOwnProperty.call(a,d)&&l.indexOf(d)<0&&(m[d]=a[d]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var g=0,d=Object.getOwnPropertySymbols(a);g<d.length;g++)l.indexOf(d[g])<0&&Object.prototype.propertyIsEnumerable.call(a,d[g])&&(m[d[g]]=a[d[g]]);return m};Object.defineProperty(q,"__esModule",{value:!0}),q.createFetchComponent=void 0;const C=M(ne()),F=ae(),D=[400,401,403,404],U=["GET","HEAD","OPTIONS","PUT","DELETE"];async function _(a,l){const{timeout:m,abortController:d,signal:g,retryDelay:$}=l;let O=l.attempts,r=null,e;do try{m&&(r=setTimeout(()=>{d.abort()},m));const i=C.default(a.toString(),Object.assign(Object.assign({},l),{signal:g})),t=Promise.race([i,new Promise((c,v)=>{g.addEventListener("abort",()=>{c(new C.Response("timeout",{status:408,statusText:"Request Timeout"}))})})]);--O,e=await t,r&&clearTimeout(r)}finally{if(e&&(e.ok||D.includes(e.status)||O===0))break;await new Promise(i=>setTimeout(i,$))}while((!e||!e.ok)&&O>0);return e}function j(a){async function l(m,d){const $=Object.assign(Object.assign({},a==null?void 0:a.defaultFetcherOptions),d)||{},{timeout:O,method:r="GET",retryDelay:e=0,abortController:i}=$,t=y($,["timeout","method","retryDelay","abortController"]);let c=t.attempts||1;const v=i||new AbortController,{signal:s}=v;a!=null&&a.defaultHeaders&&(t.headers=Object.assign(Object.assign({},a==null?void 0:a.defaultHeaders),t.headers||{})),U.includes(r.toUpperCase())||(c=1);const n=await _(m,Object.assign(Object.assign({},t),{attempts:c,method:r,timeout:O,retryDelay:e,signal:s,abortController:v}));if(!(n!=null&&n.ok)){const u=await(n==null?void 0:n.text());throw new Error(`Failed to fetch ${m}. Got status ${n==null?void 0:n.status}. Response was '${u}'`)}return!(0,F.isUsingNode)()&&n&&Object.defineProperty(n,"buffer",{value:async function(){return H.from(await n.arrayBuffer())},configurable:!0}),s.aborted?void 0:n}return{fetch:l}}return q.createFetchComponent=j,q}var Y;function oe(){return Y||(Y=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.createFetchComponent=void 0;var E=se();Object.defineProperty(o,"createFetchComponent",{enumerable:!0,get:function(){return E.createFetchComponent}})})(I)),I}const le="0.0.0-development",ue={version:le};var X;function ce(){return X||(X=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.QueryBuilder=o.sanitizeUrl=o.mergeRequestOptions=o.isNode=o.convertFiltersToQueryParams=o.splitValuesIntoManyQueries=o.splitValuesIntoManyQueryBuilders=o.splitAndFetchPaginated=o.splitAndFetch=o.MAX_URL_LENGTH=o.addModelToFormData=o.getCurrentVersion=void 0;const E=oe(),M=ue;function y(){return M.version}o.getCurrentVersion=y;function C(r,e,i=""){for(const t in r){if(!r.hasOwnProperty(t)||r[t]===null||r[t]===void 0)continue;const c=i?`${i}[${t}]`:t;r[t]instanceof Date?e.append(c,r[t].toISOString()):r[t]instanceof Array?r[t].forEach((v,s)=>{const n=`${c}[${s}]`;C(v,e,n)}):typeof r[t]=="object"?C(r[t],e,c):e.append(c,r[t].toString())}return e}o.addModelToFormData=C;function F(r){return Array.from(new Set(r))}o.MAX_URL_LENGTH=2048;async function D({baseUrl:r,path:e,queryParams:i,fetcher:t,uniqueBy:c,options:v}){t=t||(0,E.createFetchComponent)();const s=a({baseUrl:r,path:e,queryParams:i}),n=new Map;for(const u of s)(await(await t.fetch(u,{...v,headers:{"Content-Type":"application/json"}})).json()).forEach(w=>n.set(c?w[c]:n.size,w));return Array.from(n.values())}o.splitAndFetch=D;const U=7;async function _({baseUrl:r,path:e,queryParams:i,elementsProperty:t,uniqueBy:c,options:v,fetcher:s}){s=s||(0,E.createFetchComponent)();const u=a({baseUrl:r,path:e,queryParams:i,reservedParams:new Map([["offset",U]])}),f=new Map;let w=!1;for(let b=0;b<u.length&&!w;b++){let p=u[b];for(;p&&!w;)try{const P=(await s.fetch(p,v)).json();P[t].forEach(A=>f.set(A[c],A));const T=P.pagination.next;p=T?new URL(T,p).toString():void 0}catch{w=!0}}return Array.from(f.values())}o.splitAndFetchPaginated=_;function j({queryParams:r,baseUrl:e,path:i,reservedParams:t}){const c="name"in r?new Map([[r.name,r.values]]):r;if(c.size===0)return[new O(e+i,c,t)];const s=Array.from(c.entries()).map(([p,P])=>[p,F(P)]).sort(([p,P],[h,T])=>P.length-T.length),n=new O(e+i,new Map,t);for(let p=0;p<s.length-1;p++){const[P,h]=s[p];if(!n.canSetParams(P,h))throw new Error("This library can split one query param into many HTTP requests, but it can't split more than one. You will need to do that on the client side.");n.setParams(P,h)}let u=O.clone(n);const[f,w]=s[s.length-1],b=[];for(const p of w)u.canAddParam(f,p)||(b.push(u),u=O.clone(n)),u.addParam(f,p);return b.push(u),b}o.splitValuesIntoManyQueryBuilders=j;function a(r){return j(r).map(i=>i.toString())}o.splitValuesIntoManyQueries=a;function l(r){if(!r)return new Map;const e=Object.entries(r).filter(([i,t])=>!!t).map(([i,t])=>{const c=i.endsWith("s")?i.slice(0,-1):i;let v;if(Array.isArray(t))v=[...t].filter(g).map(s=>`${s}`);else if(g(t))v=[`${t}`];else throw new Error("Query params must be either a string, a number, a boolean or an array of the types just mentioned");return[c,v]}).filter(([i,t])=>t.length>0);return new Map(e)}o.convertFiltersToQueryParams=l;function m(){return Object.prototype.toString.call(typeof N<"u"?N:0)==="[object process]"}o.isNode=m;function d(r,e){const i={...r==null?void 0:r.headers,...e==null?void 0:e.headers};return{...r,...e,headers:i}}o.mergeRequestOptions=d;function g(r){return typeof r=="string"||typeof r=="number"||typeof r=="boolean"}function $(r){return r=r.trim(),!r.startsWith("https://")&&!r.startsWith("http://")&&(r="https://"+r),r.endsWith("/")&&(r=r.slice(0,-1)),r}o.sanitizeUrl=$;class O{constructor(e,i=new Map,t=new Map){this.baseUrl=e,this.queryParams=i,this.reservedParams=t,this.length=this.calculateUrlLength(i,t)}canAddParam(e,i){return this.length+e.length+i.length+2<o.MAX_URL_LENGTH}addParam(e,i){if(!this.canAddParam(e,i))throw new Error(`You can't add this parameter '${e}', since it would exceed the max url length`);const t=this.queryParams.get(e),c=t||[];return c.push(i),this.queryParams.set(e,c),this.length+=this.calculateAddedLength(e,[i]),this}canSetParams(e,i){const t=new Map([...this.queryParams,[e,i]]);return this.calculateUrlLength(t,this.reservedParams)<o.MAX_URL_LENGTH}setParams(e,i){if(!this.canSetParams(e,i))throw new Error(`You can't add this parameter '${e}', since it would exceed the max url length`);return this.queryParams.set(e,i.map(t=>`${t}`)),this.length=this.calculateUrlLength(this.queryParams,this.reservedParams),this}setParam(e,i){return this.setParams(e,[i]),this}toString(){let e=this.baseUrl,i=!1;for(const[t,c]of this.queryParams)for(const v of c)i?e+=`&${t}=${v}`:(e+=`?${t}=${v}`,i=!0);return e}calculateUrlLength(e,i){let t=this.baseUrl.length;for(const[c,v]of i)this.queryParams.has(c)||(t+=c.length+2+v);for(const[c,v]of e)t+=this.calculateAddedLength(c,v);return t}static clone(e){return new O(e.baseUrl,new Map(e.queryParams),e.reservedParams)}calculateAddedLength(e,i){return this.calculateArrayLength(i)+(e.length+2)*i.length}calculateArrayLength(e){return e.map(i=>`${i}`).reduce((i,t)=>i+t.length,0)}}o.QueryBuilder=O})(V)),V}var B={},J;function fe(){if(J)return B;J=1,Object.defineProperty(B,"__esModule",{value:!0}),B.retry=void 0;async function o(E,M,y,C){for(;y>0;)try{return await M()}catch(F){if(y--,y>0)console.info(`Failed to ${E}. Still have ${y} attempt/s left. Will try again in ${C}`),await new Promise(D=>setTimeout(D,C));else throw F}throw new Error("Please specify more than one attempt for the retry function")}return B.retry=o,B}var k;function de(){if(k)return R;k=1;var o=R&&R.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(R,"__esModule",{value:!0}),R.createContentClient=R.downloadContent=void 0;const E=te(),M=o(ie()),y=ce(),C=fe();function F(_){return _.buffer?_.buffer:_}async function D(_,j,a,l){const{attempts:m=3,retryDelay:d=500}=l||{},g=l!=null&&l.timeout?{timeout:l.timeout}:{};return(0,C.retry)(`fetch file with hash ${a} from ${j}`,async()=>{const $=await _.fetch(`${j}/${a}`,g),O=H.from(await $.arrayBuffer());if(!(l!=null&&l.avoidChecks)&&(a.startsWith("Qm")?await(0,E.hashV0)(O):await(0,E.hashV1)(O))!==a)throw new Error(`Failed to fetch file with hash ${a} from ${j}`);return O},m,d)}R.downloadContent=D;function U(_){const{fetcher:j,logger:a}=_,l=(0,y.sanitizeUrl)(_.url),m=_==null?void 0:_.parallelConfig;async function d(s,n,u){const f=new AbortController,w=f.signal,b=(0,y.mergeRequestOptions)(u,{signal:w});return new Promise(async p=>{let P=s.length;const h=()=>{P--,P===0&&p([])},T=A=>A&&Array.isArray(A)&&A.length>0?(f.abort(),p(A),!0):!1;s.forEach(async A=>{try{const S=(0,y.sanitizeUrl)(A),Z=await j.fetch(`${S}${n}`,b);if(w.aborted){h();return}const x=await Z.json();T(x)||h()}catch(S){w.aborted||a==null||a.warn(`Failed to fetch from ${A}:`,S),h()}})})}async function g(s,n,u){const w=(await Promise.allSettled(s.map(async h=>{try{const T=(0,y.sanitizeUrl)(h);return await(await j.fetch(`${T}${n}`,u)).json()}catch(T){return a==null||a.warn(`Failed to fetch from ${h}:`,T),[]}}))).filter(h=>h.status==="fulfilled").map(h=>h.value||[]),b=w.flatMap(h=>h),p=w.filter(h=>h.length===0).length,P=new Map;return b.forEach(h=>{(!P.has(h.id)||h.timestamp>P.get(h.id).timestamp)&&P.set(h.id,h)}),{entities:Array.from(P.values()),emptyResults:p}}async function $(s,n){const u=(0,y.isNode)(),f=new M.default;f.append("entityId",s.entityId),(0,y.addModelToFormData)(s.authChain,f,"authChain");const w=await c(Array.from(s.files.keys()),n);for(const[b,p]of s.files)(!w.has(b)||b===s.entityId)&&(u?f.append(b,H.isBuffer(p)?p:H.from(F(p)),b):f.append(b,new Blob([F(p)]),b));return f}async function O(s,n){const u=await $(s,n),f=(0,y.mergeRequestOptions)(n||{},{body:u,method:"POST"});return await j.fetch(`${l}/entities`,f)}async function r(s,n){if(s.length===0)return Promise.reject("You must set at least one pointer.");const u=(0,y.mergeRequestOptions)(n||{},{body:JSON.stringify({pointers:s}),method:"POST",headers:{"Content-Type":"application/json"}});return(await j.fetch(`${l}/entities/active`,u)).json()}async function e(s,n){if(s.length===0)return Promise.reject("You must set at least one id.");const u=(0,y.mergeRequestOptions)(n||{},{body:JSON.stringify({ids:s}),method:"POST",headers:{"Content-Type":"application/json"}}),f=(n==null?void 0:n.parallel)||m;return f!=null&&f.urls&&(f==null?void 0:f.urls.length)>0?d([l,...f.urls],"/entities/active",u):(await j.fetch(`${l}/entities/active`,u)).json()}async function i(s,n){const u=await e([s],n);return u.length===0?Promise.reject(`Failed to find an entity with id '${s}'.`):u[0]}function t(s,n){return s.length===0?Promise.reject("You must set at least one cid."):(0,y.splitAndFetch)({fetcher:j,options:n,baseUrl:l,path:"/available-content",queryParams:{name:"cid",values:s},uniqueBy:"cid"})}async function c(s,n){const f=(await t(s,n)).filter(w=>w.available).map(({cid:w})=>w);return new Set(f)}async function v(s,n){const u=(n==null?void 0:n.parallel)||m;if(!(u!=null&&u.urls)||u.urls.length===0)throw new Error("Parallel configuration is required for checking pointer consistency");const f=(0,y.mergeRequestOptions)(n||{},{body:JSON.stringify({pointers:[s]}),method:"POST",headers:{"Content-Type":"application/json"}}),w=[l,...u.urls],{entities:b,emptyResults:p}=await g(w,"/entities/active",f);if(b.length===0)return{isConsistent:!0,upToDateEntities:void 0,outdatedEntities:void 0};const P=Math.max(...b.map(S=>S.timestamp)),h=b.filter(S=>S.timestamp===P),T=b.filter(S=>S.timestamp<P);return{isConsistent:T.length===0&&p===0,upToDateEntities:h.length>0?h:void 0,outdatedEntities:T.length>0?T:void 0}}return{buildEntityFormDataForDeployment:$,fetchEntitiesByPointers:r,fetchEntitiesByIds:e,fetchEntityById:i,downloadContent:(s,n)=>D(j,l+"/contents",s,n),deploy:O,isContentAvailable:t,checkPointerConsistency:v}}return R.createContentClient=U,R}var K=de();const he=ee(K),we=re({__proto__:null,default:he},[K]);export{we as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as K,j as e,L as re,d as se,a as te,r as j}from"./react-BMZSDQJw.js";import{
|
|
1
|
+
import{u as K,j as e,L as re,d as se,a as te,r as j}from"./react-BMZSDQJw.js";import{aw as oe,ax as ce,an as le,t as a,ay as E,B as ne,ac as z,g as ie,I,c as de,u as me,A as ue,ar as he,az as ge,C as xe}from"./index-V0hMC6mZ.js";import{d as _e,g as pe,a as Ne,A as je}from"./collection-DbmjhyjW.js";import{u as be,L as fe}from"./useStore-cTXMZhwG.js";import{s as D}from"./address-DrURAr9O.js";import{d as $,a as ve,S as w,F as Ce,e as we,b as ke}from"./categories-D7_Qudaw.js";import{L as B}from"./LoadMore-BK9c312B.js";import{u as R}from"./useInfiniteGrid-COXciuKu.js";import{E as T}from"./ErrorNotice-DDr3KjIH.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-8SzFotJj.js";import"./ethers-Dpp9c5As.js";import"./intl-CBcMB1D2.js";import"./emotion-CSxEP8yM.js";function Pe({collection:t,cover:r,itemCount:o}){const n=K(),{contractAddress:m,name:g,creator:x}=t,N=r==null||o==null,{data:i}=oe(m,N),p=r==null?(i==null?void 0:i.items)??[]:[],h=o??(i==null?void 0:i.total);function _(){n(`/collection/${m}`)}return e.jsxs("article",{className:"coll-card",role:"link",tabIndex:0,onClick:_,onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),_())},children:[e.jsx("div",{className:"coll-card__media",children:r?e.jsx("img",{className:"coll-card__img","data-testid":"coll-card-img",src:r,alt:"",loading:"lazy"}):p.length>0?e.jsx(ce,{items:p,className:"coll-card__cover"}):null}),e.jsxs("div",{className:"coll-card__body",children:[e.jsx("h3",{className:"coll-card__name",title:g,children:g}),e.jsxs("div",{className:"coll-card__meta",children:[x?e.jsx(le,{address:x,className:"coll-card__creator",linkToProfile:!0}):e.jsx("span",{className:"coll-card__creator",children:" "}),e.jsx("span",{className:"coll-card__count",children:h==null?"…":a("collectionCard.itemCount",{count:h})})]}),e.jsx("button",{className:"coll-card__view",onClick:d=>{d.stopPropagation(),_()},tabIndex:-1,children:a("collectionCard.viewCollection")})]})]})}function ye({address:t,className:r=""}){const o=E(m=>m.followed.includes(t.toLowerCase())),n=E(m=>m.toggle);return t?e.jsx(ne,{type:"button",size:"sm",variant:o?"ghost":"outline",className:r||void 0,"aria-pressed":o,title:o?a("creator.unfollowTitle"):a("creator.followTitle"),onClick:()=>n(t),children:o?a("creator.following"):a("creator.follow")}):null}const Se={website:"website",twitter:"twitter",discord:"discord",facebook:"facebook"};function Le({address:t}){var d,b;const{data:r}=z(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)||D(t),x=(b=(d=r==null?void 0:r.avatar)==null?void 0:d.snapshots)==null?void 0:b.face256,N=(o==null?void 0:o.cover)||_e,i=o==null?void 0:o.description,p=`${de.profileUrl}/${t}`,h=fe.filter(l=>o==null?void 0:o.links[l]),_=pe(Ne({name:r==null?void 0:r.name,hasClaimedName:r==null?void 0:r.hasClaimedName,ethAddress:(r==null?void 0:r.ethAddress)??t}));return e.jsxs("section",{className:"creator-hero","aria-label":`${g} storefront`,children:[e.jsxs("div",{className:"creator-hero__cover",children:[e.jsx("img",{className:"creator-hero__cover-img",src:N,alt:"",loading:"eager"}),e.jsx("div",{className:"creator-hero__scrim","aria-hidden":!0})]}),(h.length>0||m)&&e.jsxs("div",{className:"creator-hero__links",children:[h.map(l=>e.jsx("a",{className:"creator-hero__link","data-testid":"creator-hero-link",href:(o==null?void 0:o.links[l])??"",target:"_blank",rel:"noopener noreferrer",title:a(`creator.link.${l}`),"aria-label":a(`creator.link.${l}`),children:e.jsx(I,{name:Se[l]})},l)),m&&e.jsx(re,{className:"creator-hero__link creator-hero__edit",to:"/store-settings",title:a("creator.editStore"),"aria-label":a("creator.editStore"),children:e.jsx(I,{name:"pen"})})]}),e.jsxs("div",{className:"creator-hero__body",children:[x?e.jsx("img",{className:"creator-hero__ava",src:x,alt:"",loading:"eager",style:{backgroundColor:_}}):e.jsx("span",{className:"creator-hero__ava creator-hero__ava--ph","aria-hidden":!0,style:{backgroundColor:_}}),e.jsxs("div",{children:[e.jsx("h2",{className:"creator-hero__name",children:g}),i?e.jsx("p",{className:"creator-hero__desc",children:i}):null]}),e.jsxs("div",{className:"creator-hero__actions",children:[e.jsx("a",{className:"creator-hero__view","data-testid":"creator-hero-view",href:p,target:"_blank",rel:"noopener noreferrer",children:a("creator.viewProfile")}),e.jsx(ye,{address:t,className:"creator-hero__follow"})]})]})]})}const U=48;function Ge(){const{address:t}=se(),r=K(),[o]=te(),n=o.has("collections"),{data:m}=z(t),g=(m==null?void 0:m.name)||(t?D(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,O]=j.useState("newest"),y=d&&!Number.isNaN(Number(d))?Number(d):void 0,S=l&&!Number.isNaN(Number(l))?Number(l):void 0,G=i?ke[i]:void 0,H=($.find(s=>s.key===P)??$[0]).server,L={creator:t,category:x,rarities:h.length?h:void 0,wearableCategories:G,minPriceCredits:y,maxPriceCredits:S,sortBy:H},{items:v,total:Y,isLoading:C,error:A,hasNextPage:W,isFetchingNextPage:F,fetchNextPage:Z}=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 q(s){N(s),p(null),n&&M()}function M(){const s=new URLSearchParams(o);s.delete("collections");const c=s.toString();r({search:c?`?${c}`:""},{replace:!0})}function J(){if(n){M();return}const s=new URLSearchParams(o);s.delete("collections");const c=s.toString();r({search:c?`?${c}&collections`:"?collections"},{replace:!0})}function Q(s){_(c=>c.includes(s)?c.filter(ae=>ae!==s):[...c,s])}function V(){N("wearable"),p(null),_([]),b(""),f("")}const k=!!(y||S),X=k?`${d||"0"}–${l||"∞"}`:a("filter.price"),ee=x!=="wearable"||!!i||h.length>0||k;return e.jsxs("div",{className:"collection-page",children:[e.jsxs("nav",{className:"collection-page__crumbs","aria-label":a("creator.breadcrumbAria"),children:[e.jsx("button",{className:"collection-page__crumb-link",onClick:()=>r("/assets"),children:a("creator.breadcrumb")}),e.jsx("span",{className:"collection-page__crumb-sep",children:"/"}),e.jsx("span",{className:"collection-page__crumb-current",children:g})]}),t?e.jsx(Le,{address:t}):null,!n&&!C&&v.length>0?e.jsx(je,{items:v,source:"creator"}):null,e.jsxs("div",{className:"browse browse--sidebar",children:[e.jsx("aside",{className:"browse__sidebar",children:e.jsx(ve,{category:x,subCategory:i,onCategory:q,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:O,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:W,isFetching:F,onLoadMore:()=>void Z()}),!C&&!A&&v.length===0?e.jsx("p",{className:"muted",children:a("creator.empty")}):null]})})]})]})}export{Ge as Creator,Ge as default};
|