@dcl/shop 1.0.0 → 1.0.1
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/Activity-CYc4haGG.js +378 -0
- package/_assets/{AnimatedBackground-CHiOSgJ6.js → AnimatedBackground-DEshz0c2.js} +1 -1
- package/_assets/{Assets-1KVsmH01.js → Assets-D5sxwFuc.js} +6 -6
- package/_assets/{Assets.styles-BUHnZ7Nb.js → Assets.styles-c5XuGAG4.js} +1 -1
- package/_assets/{Authorizations-BGlyC4dr.js → Authorizations-m488Gyk0.js} +1 -1
- package/_assets/{Cart-afrKtZvj.js → Cart-Ctyse8xg.js} +2 -2
- package/_assets/{CircularProgress-K7JjSpPZ.js → CircularProgress-CB7Frwx7.js} +1 -1
- package/_assets/{Collection-B0G71rJV.js → Collection-CS-PKjRf.js} +8 -8
- package/_assets/{CollectionCarousel-B4hzcKRb.js → CollectionCarousel-DhrBSU2o.js} +13 -13
- package/_assets/{Confetti-BBhDY6Q2.js → Confetti-z9mEz7Mo.js} +1 -1
- package/_assets/{Creator-CYC3eVKx.js → Creator-BMYJiMCB.js} +5 -5
- package/_assets/{ErrorNotice-CnPcFEw_.js → ErrorNotice-BG4CBNkl.js} +1 -1
- package/_assets/{ExchangeController-BAefeOHy.js → ExchangeController-CLyfn8FH.js} +1 -1
- package/_assets/{Faq-D03YByjo.js → Faq-D7gV7iYA.js} +1 -1
- package/_assets/{GetCredits-Cyw0rRMV.js → GetCredits-CL7K_M9H.js} +10 -10
- package/_assets/{Grow-CPwRVF9g.js → Grow-Ccwk3GHr.js} +1 -1
- package/_assets/{HelpersUtil-DJC0aWJi.js → HelpersUtil-tyC-vTbQ.js} +1 -1
- package/_assets/{ItemDetail-DSuMCjR9.js → ItemDetail-DwY7HKZL.js} +28 -28
- package/_assets/LazyEmoteControls-BNHGzPTO.js +2 -0
- package/_assets/{LoadMore-CMAFsns3.js → LoadMore-BLHzgyNQ.js} +1 -1
- package/_assets/{ManaPricingBanner.styles-Bb7BS6EM.js → ManaPricingBanner.styles-G4jy5obg.js} +1 -1
- package/_assets/{MyAssets-C5lGRPqP.js → MyAssets-BpBrCfKj.js} +4 -4
- package/_assets/{MyFavorites-C1t1o6Li.js → MyFavorites-eakG4vL0.js} +1 -1
- package/_assets/{NotFound-Bdi_fN5j.js → NotFound-By_5zIVf.js} +1 -1
- package/_assets/{NotificationsBell-BQk3EV9b.js → NotificationsBell-DVM7TZeA.js} +1 -1
- package/_assets/{OutfitDetail-D3Mwl6KR.js → OutfitDetail-CKImDsVr.js} +1 -1
- package/_assets/{OutfitPreview-BpWwkAro.js → OutfitPreview-BDsx1Zln.js} +1 -1
- package/_assets/{OutfitStudio-BL7OYD9h.js → OutfitStudio-BNP0n5pI.js} +4 -4
- package/_assets/{StoreSettings-BNhzJJib.js → StoreSettings-CMOSmEWV.js} +6 -6
- package/_assets/{Success-Cnu7oCbI.js → Success-DKTCAGfP.js} +1 -1
- package/_assets/{SwapController-BD23YCPw.js → SwapController-B6jVCCgh.js} +1 -1
- package/_assets/{Tooltip-tAvMrdFp.js → Tooltip-CnjWof_H.js} +1 -1
- package/_assets/{TradeService-a2JgoWq2.js → TradeService-DqBS7JER.js} +1 -1
- package/_assets/{W3MFrameProviderSingleton-CPDmjNiA.js → W3MFrameProviderSingleton-BNh7T9LS.js} +3 -3
- package/_assets/{WebCryptoP256-DIEJtB0I.js → WebCryptoP256-DVUZQ3fN.js} +1 -1
- package/_assets/{authorizations-HgwrWkaa.js → authorizations-CE0HtqU4.js} +1 -1
- package/_assets/{basic-B3qEjJvY.js → basic-sWTPOMIW.js} +1 -1
- package/_assets/{biconomy-CzcDC8vB.js → biconomy-Gn8OlgoU.js} +1 -1
- package/_assets/{builder-TZGldT6a.js → builder-DeMyTCI7.js} +1 -1
- package/_assets/buy-BF3MKHeK.js +1 -0
- package/_assets/buy-gasless-C6Uiz2ft.js +1 -0
- package/_assets/{categories-B3DJZe02.js → categories-e7ryjlpc.js} +1 -1
- package/_assets/{ccip-CB03B_MW.js → ccip-BGow4NM2.js} +1 -1
- package/_assets/{ccip-VI2-jJnV.js → ccip-C8QxGeVJ.js} +1 -1
- package/_assets/{collectionPage.styles-DXfFyRiH.js → collectionPage.styles-DGJTp7Uw.js} +4 -4
- package/_assets/{controller-CEo6ipG_.js → controller-Ct0gOkSO.js} +2 -2
- package/_assets/{core-DmqfUS4f.js → core-BPejI2Uv.js} +4 -4
- package/_assets/{createSvgIcon-WfOAVB94.js → createSvgIcon-CfV25Qvu.js} +3 -3
- package/_assets/{custom-bIxIBqCn.js → custom-CtkIvR1q.js} +1 -1
- package/_assets/{data-capture-Dtaj6ehs.js → data-capture-ChzQjncq.js} +1 -1
- package/_assets/{email-DBXWS-p0.js → email-DTmn4SUk.js} +1 -1
- package/_assets/{embedded-wallet-DqlpsZRk.js → embedded-wallet-zOEVMj8r.js} +1 -1
- package/_assets/{emotion-styled.browser.esm-pOAX0dMa.js → emotion-styled.browser.esm-ftlGzXhy.js} +1 -1
- package/_assets/{engine-gP8vp-2g.js → engine-C84VS8MU.js} +1 -1
- package/_assets/{errors-WNvNILsF.js → errors-jURSB57c.js} +1 -1
- package/_assets/{estimate-l1-fee-X1cvAsdL.js → estimate-l1-fee-BK9aiTEg.js} +1 -1
- package/_assets/{execute-V2l_cDAW.js → execute-BJdfX8go.js} +2 -2
- package/_assets/{features-CFR_-yBt.js → features-CEPVrrJh.js} +1 -1
- package/_assets/{fetchTokenMetadata-Do5GLuIQ.js → fetchTokenMetadata-Cg8LhGF6.js} +2 -2
- package/_assets/{field.styles-ciG_OcBi.js → field.styles-BO_2AHCA.js} +1 -1
- package/_assets/{get-ecosystem-wallet-info-CyDTxLgQ.js → get-ecosystem-wallet-info-DN7GFeAM.js} +1 -1
- package/_assets/{getBalance-7wKu8RUe.js → getBalance-CCluSQca.js} +1 -1
- package/_assets/{getNFT-DecLUThv.js → getNFT-B3tNxOax.js} +1 -1
- package/_assets/{getNFT-BbpUiMXR.js → getNFT-C7PC0iJF.js} +1 -1
- package/_assets/{grid.styles-Caahz6PS.js → grid.styles-DRngdZfp.js} +1 -1
- package/_assets/{hashTypedData-Ca524zaX.js → hashTypedData-BPxQrISG.js} +1 -1
- package/_assets/{hashTypedData-C9kgxiiE.js → hashTypedData-ulq3qXHW.js} +1 -1
- package/_assets/{in-app-B-disnkm.js → in-app-C_sI0Q7l.js} +1 -1
- package/_assets/{in-app-wallet-calls-3yighozE.js → in-app-wallet-calls-ozqkkU0m.js} +1 -1
- package/_assets/{index-DCMLwiSR.js → index-0wuiFD-D.js} +1 -1
- package/_assets/{index-BBX5Tona.js → index-2bLJt5nu.js} +1 -1
- package/_assets/{index-DvjyzmjB.js → index-B-0HDufu.js} +1 -1
- package/_assets/{index-CFziwAGz.js → index-B1yZmsbg.js} +1 -1
- package/_assets/{index-DsH_mBtT.js → index-B2h0kzTR.js} +7 -7
- package/_assets/{index-o0b8cjRQ.js → index-B41s2t0I.js} +1 -1
- package/_assets/{index-CEDBhmGn.js → index-B4Sh4DUY.js} +1 -1
- package/_assets/{index-CEnhHz30.js → index-B4VWghxR.js} +1 -1
- package/_assets/{index-2-BWsekC.js → index-B4ldzGrT.js} +1 -1
- package/_assets/{index-CONyzZZC.js → index-B8hnFmS-.js} +3 -3
- package/_assets/{index-D58OkhU1.js → index-BCbVNwA6.js} +1 -1
- package/_assets/{index-8xcbpK09.js → index-BCqRbjcA.js} +1 -1
- package/_assets/{index-CUAEZ5zJ.js → index-BG93ruhj.js} +1 -1
- package/_assets/{index-CmlH9TBP.js → index-BLtmHnvk.js} +1 -1
- package/_assets/{index-DxB85HDB.js → index-BQAoWWgI.js} +1 -1
- package/_assets/{index-BrU_i04f.js → index-BQbGdQCn.js} +1 -1
- package/_assets/{index-D9iAFl4E.js → index-BZo86GEs.js} +1 -1
- package/_assets/{index-BMFVFrWl.js → index-Bfbo1-y3.js} +3 -3
- package/_assets/{index-DRI1gQSo.js → index-Bk3FocQt.js} +1 -1
- package/_assets/{index-C616xNgB.js → index-BpBLqmY7.js} +19 -19
- package/_assets/{index-BjEDpwxR.js → index-BqQA-htt.js} +1 -1
- package/_assets/{index-DEw1jYQT.js → index-BsAc5Nb_.js} +1 -1
- package/_assets/{index-CjhGjrdW.js → index-BwT65Ui0.js} +1 -1
- package/_assets/{index-DNvcQt0s.js → index-BwpU8az-.js} +3 -3
- package/_assets/{index-DCAUOF_r.js → index-C1ABS6aZ.js} +1 -1
- package/_assets/{index-p0fxtTsZ.js → index-C21U9leN.js} +2 -2
- package/_assets/{index-CO_xP_3N.js → index-C6jWze3p.js} +1 -1
- package/_assets/{index-CAl290ro.js → index-C7gyW2pC.js} +1 -1
- package/_assets/{index-CyITvpDL.js → index-C8N5dIBi.js} +1 -1
- package/_assets/{index-CGcb9Mz3.js → index-CFj3lX4u.js} +1 -1
- package/_assets/{index--1pBMb8n.js → index-CPVal8wI.js} +1 -1
- package/_assets/{index-BuImQh6o.js → index-Ca2t9jnc.js} +1 -1
- package/_assets/{index-yiECqJCb.js → index-Ce2J3RrX.js} +1 -1
- package/_assets/{index-Gw3Mauv_.js → index-Cutc7nXs.js} +1 -1
- package/_assets/{index-JuH5W7YS.js → index-D3CBiscc.js} +2 -2
- package/_assets/{index-CZBUgvRB.js → index-D7sH_woo.js} +1 -1
- package/_assets/{index-N5sgh9IC.js → index-DEpHjDox.js} +1 -1
- package/_assets/{index-Bd7SNoIN.js → index-DNUmp9qJ.js} +2 -2
- package/_assets/{index-DKghJgJj.js → index-DPJNY0Ni.js} +1 -1
- package/_assets/{index-BLCTVSaC.js → index-DPh8zvp5.js} +1 -1
- package/_assets/{index-Eip3e8N8.js → index-DUeFbNWb.js} +1 -1
- package/_assets/{index-C3MGLBUO.js → index-D_qvzN-5.js} +1 -1
- package/_assets/{index-DUmo7598.js → index-DisgA_Kp.js} +1 -1
- package/_assets/{index-BdQllJHM.js → index-DmYn7FTm.js} +1 -1
- package/_assets/{index-tCYP1O3W.js → index-DmouEX3z.js} +1 -1
- package/_assets/{index-BQB7qYN1.js → index-DrdjzH9k.js} +1 -1
- package/_assets/{index-DJOlt1Iv.js → index-G_9AGT2d.js} +1 -1
- package/_assets/{index-CdFrv2eV.js → index-YX6Ay2YX.js} +1 -1
- package/_assets/{index-Dag4zALf.js → index-aOhbQl_e.js} +1 -1
- package/_assets/{index-CKkE-eRE.js → index-js8gBwwu.js} +1 -1
- package/_assets/{index-B6l73M7K.js → index-sAHvnz2N.js} +1 -1
- package/_assets/{index-p4Ph7ugv.js → index-yJr5AHy6.js} +1 -1
- package/_assets/{index.es-C5PJ78RX.js → index.es-CAm13D3S.js} +1 -1
- package/_assets/{index.es-DF_hlZIu.js → index.es-_sMtTPSc.js} +4 -4
- package/_assets/{index.es-D73EniUm.js → index.es-nXwNgZDa.js} +1 -1
- package/_assets/{localBatchGatewayRequest-DvkdRgNo.js → localBatchGatewayRequest-DldZ90JU.js} +1 -1
- package/_assets/{networks-7b-i0dnd.js → networks-A_3lFdbQ.js} +1 -1
- package/_assets/{onramp-CoF8bFaS.js → onramp-uIn5Hze6.js} +1 -1
- package/_assets/{openzeppelin-DcsEW8tQ.js → openzeppelin-K0lueS2f.js} +1 -1
- package/_assets/{parseNft-CNJ2CwyE.js → parseNft-B8gQqMLe.js} +2 -2
- package/_assets/{parseSignature-whU_pkfu.js → parseSignature-DzYQN9v3.js} +3 -3
- package/_assets/{parseSignature-D0-1k6Yx.js → parseSignature-eP7njmVY.js} +1 -1
- package/_assets/{passkeys-SqHHDvyI.js → passkeys-CdjlkSrV.js} +1 -1
- package/_assets/{pay-with-exchange-Cvr7dd94.js → pay-with-exchange-2kPfthhA.js} +1 -1
- package/_assets/{qr-overlay-HlBTd234.js → qr-overlay-lH0GRusa.js} +1 -1
- package/_assets/{receive-HPltMi_i.js → receive-D9VTDtK7.js} +1 -1
- package/_assets/{resolveImplementation-CM1yFlGf.js → resolveImplementation-BBpjC548.js} +1 -1
- package/_assets/{rpc-CPS_djFB.js → rpc-QKrpJtdm.js} +1 -1
- package/_assets/{secp256k1-ChRNiO68.js → secp256k1-BC1FlI33.js} +1 -1
- package/_assets/{secp256k1-CQmdb_AD.js → secp256k1-CYkRl_Jj.js} +1 -1
- package/_assets/{secp256k1-DUTfCpIK.js → secp256k1-DhRlT0ib.js} +1 -1
- package/_assets/{send-zy_Vr6BQ.js → send-BR0llNO1.js} +1 -1
- package/_assets/{send-batch-transaction-Vn4JOFM5.js → send-batch-transaction-BCKT8nBl.js} +1 -1
- package/_assets/{send-eip712-transaction-Qvibiwhe.js → send-eip712-transaction-DJ0zmOUy.js} +2 -2
- package/_assets/{send-gasless-transaction-DQLcvFHt.js → send-gasless-transaction-BjdM8j2X.js} +2 -2
- package/_assets/{send-transaction-CZ0kapdy.js → send-transaction-C8RVBMn9.js} +2 -2
- package/_assets/{sendMetaTransaction-Ba_-1nOk.js → sendMetaTransaction-CcYdCbY-.js} +1 -1
- package/_assets/{sendRawTransaction-BUz1EYd8.js → sendRawTransaction-daS8Cqba.js} +3 -3
- package/_assets/{serializeTransaction-B8qCVIIu.js → serializeTransaction-hW8PYHkl.js} +1 -1
- package/_assets/{session-proposal-BqO43SKO.js → session-proposal-CqH6oHj9.js} +1 -1
- package/_assets/{session-request-DbQI-hjo.js → session-request-BWv_wt41.js} +2 -2
- package/_assets/{signing-CVGndCRE.js → signing-BqfCVU3I.js} +3 -3
- package/_assets/{skeleton.styles-K9f1Sxf1.js → skeleton.styles-DagyoT5y.js} +1 -1
- package/_assets/{socials-CNOGl_eO.js → socials-D4goIlBt.js} +1 -1
- package/_assets/{styled-CljNQW-J.js → styled-CoVCpn99.js} +1 -1
- package/_assets/{swaps-D5haogfk.js → swaps-GJ4U9DHL.js} +1 -1
- package/_assets/{thirdweb-CC2bk-Up.js → thirdweb-F_-Px602.js} +3 -3
- package/_assets/{to-serializable-transaction-BB0M9pw8.js → to-serializable-transaction-BkPY6iHK.js} +2 -2
- package/_assets/{transactionReceipt-puJsrtjz.js → transactionReceipt-iJ97NYxd.js} +1 -1
- package/_assets/{transactions-BnYHwdat.js → transactions-Cl8fRRc0.js} +1 -1
- package/_assets/{useCreditPacks-xyyhS_80.js → useCreditPacks-Dsfos9wm.js} +1 -1
- package/_assets/{useImportable-Bh7jH6e9.js → useImportable-Bn9l5AUn.js} +1 -1
- package/_assets/{useInfiniteGrid-CV4TXaLn.js → useInfiniteGrid-VPnx9W8Q.js} +1 -1
- package/_assets/{useTheme-Czw2-J4G.js → useTheme-D2_ZQh6-.js} +1 -1
- package/_assets/{verifyHash-CAYWYGEG.js → verifyHash-DlqrxU4F.js} +1 -1
- package/_assets/{w3m-modal-Fr29zvJe.js → w3m-modal-BTAbPei6.js} +1 -1
- package/_assets/{w3m-modal-DtofW43q.js → w3m-modal-DRnBD4CD.js} +1 -1
- package/_assets/{wait-for-tx-receipt-mfzWqQ40.js → wait-for-tx-receipt-CETDDyPM.js} +1 -1
- package/_assets/{wallets-DT2LKaVF.js → wallets-91m5q0QW.js} +5 -5
- package/_assets/{web-connector-4TZSYYzx.js → web-connector-qXgR2Q4O.js} +3 -3
- package/_assets/{writeContract-CEQ0n4-z.js → writeContract-IIDoxAya.js} +1 -1
- package/_assets/{zoraTestnet-Cd1Th5ww.js → zoraTestnet-ev6ZVcwL.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/_assets/Activity-CJO4ONwi.js +0 -371
- package/_assets/LazyEmoteControls-D-xqLU4A.js +0 -2
- package/_assets/buy-CuFubBZY.js +0 -1
- package/_assets/buy-gasless-DO6cBuJ3.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aj as N,ak as w,al as o,am as n,K as D,w as M}from"./index-
|
|
1
|
+
import{aj as N,ak as w,al as o,am as n,K as D,w as M}from"./index-BpBLqmY7.js";import{r as U,j as g}from"./react-BYHuwl8r.js";import{g as z,a as E,c as I,b as K}from"./clsx-WwvpwSg0.js";import{s as v}from"./styled-CoVCpn99.js";function F(r){return z("MuiCircularProgress",r)}E("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const W=["className","color","disableShrink","size","style","thickness","value","variant"];let l=r=>r,P,b,S,$;const t=44,B=M(P||(P=l`
|
|
2
2
|
0% {
|
|
3
3
|
transform: rotate(0deg);
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,r as m,d as J,b as X}from"./react-BYHuwl8r.js";import{t as b,s,
|
|
1
|
+
import{j as e,r as m,d as J,b as X}from"./react-BYHuwl8r.js";import{t as b,s,bv as ee,a2 as te,D as F,bw as ae,bx as oe,I as ie,b as a,c as re,F as se,v as ne,x as ce,C as le,ar as R,as as de,by as pe,bz as xe}from"./index-BpBLqmY7.js";import{E as he}from"./ErrorNotice-BG4CBNkl.js";import{d as me,P as ge,C as ue,a as be,b as fe,A as ve}from"./collectionPage.styles-DGJTp7Uw.js";import{u as ye,S as W,a as je,F as Ce,c as we,P as $e,d as ke,H as Ne,e as Se}from"./categories-e7ryjlpc.js";import{L as Pe}from"./LoadMore-BLHzgyNQ.js";import{u as Ae}from"./useInfiniteGrid-VPnx9W8Q.js";import{G as Me}from"./grid.styles-DRngdZfp.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";import"./skeleton.styles-DagyoT5y.js";const Te=s.section`
|
|
2
2
|
position: relative;
|
|
3
3
|
border-radius: ${b.radius.card};
|
|
4
4
|
overflow: hidden;
|
|
@@ -11,20 +11,20 @@ import{j as e,r as m,d as J,b as X}from"./react-BYHuwl8r.js";import{t as b,s,bu
|
|
|
11
11
|
${b.media.maxWidth("mobile")} {
|
|
12
12
|
min-height: 140px;
|
|
13
13
|
}
|
|
14
|
-
`,
|
|
14
|
+
`,ze=s.div`
|
|
15
15
|
position: absolute;
|
|
16
16
|
inset: 0;
|
|
17
17
|
z-index: 0;
|
|
18
|
-
`,
|
|
18
|
+
`,Ee=s.img`
|
|
19
19
|
width: 100%;
|
|
20
20
|
height: 100%;
|
|
21
21
|
object-fit: cover;
|
|
22
22
|
display: block;
|
|
23
|
-
`,
|
|
23
|
+
`,Fe=s.div`
|
|
24
24
|
position: absolute;
|
|
25
25
|
inset: 0;
|
|
26
26
|
background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.55) 100%);
|
|
27
|
-
`,
|
|
27
|
+
`,Re=s.h1`
|
|
28
28
|
position: relative;
|
|
29
29
|
z-index: 1;
|
|
30
30
|
margin: 0;
|
|
@@ -42,7 +42,7 @@ import{j as e,r as m,d as J,b as X}from"./react-BYHuwl8r.js";import{t as b,s,bu
|
|
|
42
42
|
padding: 24px 16px;
|
|
43
43
|
font-size: 26px;
|
|
44
44
|
}
|
|
45
|
-
`;function We({name:o,creator:t}){const{data:n}=ee(t),p=(n==null?void 0:n.cover)||me;return e.jsxs(Te,{"data-testid":"collection-hero","aria-label":o,children:[e.jsxs(
|
|
45
|
+
`;function We({name:o,creator:t}){const{data:n}=ee(t),p=(n==null?void 0:n.cover)||me;return e.jsxs(Te,{"data-testid":"collection-hero","aria-label":o,children:[e.jsxs(ze,{children:[e.jsx(Ee,{src:p,alt:"",loading:"eager"}),e.jsx(Fe,{"aria-hidden":!0})]}),e.jsx(Re,{"data-testid":"collection-hero-title",children:o})]})}const{colors:c,radius:B}=b,Le=s.div`
|
|
46
46
|
display: flex;
|
|
47
47
|
flex-direction: column;
|
|
48
48
|
align-items: center;
|
|
@@ -116,7 +116,7 @@ import{j as e,r as m,d as J,b as X}from"./react-BYHuwl8r.js";import{t as b,s,bu
|
|
|
116
116
|
background: ${c.softWhite};
|
|
117
117
|
color: ${c.text};
|
|
118
118
|
}
|
|
119
|
-
`;function Ge({address:o}){var v,d;const{data:t}=te(o),[n,p]=m.useState(!1);if(!o)return null;const l=(t==null?void 0:t.name)||
|
|
119
|
+
`;function Ge({address:o}){var v,d;const{data:t}=te(o),[n,p]=m.useState(!1);if(!o)return null;const l=(t==null?void 0:t.name)||F(o),g=(d=(v=t==null?void 0:t.avatar)==null?void 0:v.snapshots)==null?void 0:d.face256,u=`${re.profileUrl}/${o}`,f=ae(oe({name:t==null?void 0:t.name,hasClaimedName:t==null?void 0:t.hasClaimedName,ethAddress:(t==null?void 0:t.ethAddress)??o}));async function x(){try{await navigator.clipboard.writeText(o),p(!0),window.setTimeout(()=>p(!1),1500)}catch(j){se(j,{flow:"copy_creator_address"})}}return e.jsxs(Le,{"data-testid":"creator-card",children:[g?e.jsx(L,{src:g,alt:"",loading:"eager",style:{backgroundColor:f}}):e.jsx(L,{as:"span","aria-hidden":!0,style:{backgroundColor:f}}),e.jsx(Be,{title:l,children:l}),e.jsxs(Ie,{type:"button",onClick:()=>void x(),title:n?a("collection.copied"):a("collection.copyAddress"),"aria-label":n?a("collection.copied"):a("collection.copyAddress"),children:[e.jsx("span",{children:F(o)}),e.jsx(ie,{name:"copy",size:16})]}),e.jsx(_e,{"data-testid":"creator-card-view",href:u,target:"_blank",rel:"noopener noreferrer",children:a("collection.viewProfile")})]})}const{colors:He,media:$}=b,Ue=s.div`
|
|
120
120
|
position: relative;
|
|
121
121
|
display: flex;
|
|
122
122
|
gap: 32px;
|
|
@@ -159,4 +159,4 @@ import{j as e,r as m,d as J,b as X}from"./react-BYHuwl8r.js";import{t as b,s,bu
|
|
|
159
159
|
visibility: visible;
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
|
-
`,De=48;function st(){var
|
|
162
|
+
`,De=48;function st(){var E;const{contractAddress:o}=J(),t=X(),[n,p]=m.useState("all"),[l,g]=m.useState(null),[u,f]=m.useState([]),[x,v]=m.useState(""),[d,j]=m.useState(""),[k,I]=m.useState("newest");ye(`${n}:${l??""}`);const N=x&&!Number.isNaN(Number(x))?Number(x):void 0,S=d&&!Number.isNaN(Number(d))?Number(d):void 0,_=l?Se[l]:void 0,G=(W.find(i=>i.key===k)??W[0]).server,P={category:n,rarities:u.length?u:void 0,wearableCategories:_,minPriceCredits:N,maxPriceCredits:S,sortBy:G},{items:y,total:H,isLoading:C,error:A,hasNextPage:U,isFetchingNextPage:M,isFetchNextPageError:Y,fetchNextPage:q}=Ae(["collection-page",o,P],i=>pe(o,{...P,first:De,skip:i}),{enabled:!!o}),{data:r}=ne({queryKey:["collection-meta",o],queryFn:()=>xe(o),enabled:!!o,staleTime:5*6e4}),T=(r==null?void 0:r.name)||a("collection.fallbackTitle");ce({title:r==null?void 0:r.name,description:r!=null&&r.name?a("seo.collection.description",{name:r.name}):void 0});const z=(r==null?void 0:r.creator)||((E=y[0])==null?void 0:E.creator);function D(i){p(i),g(null)}function K(i){f(h=>h.includes(i)?h.filter(Z=>Z!==i):[...h,i])}function O(){p("all"),g(null),f([]),v(""),j("")}const w=!!(N||S),Q=w?`${x||"0"}–${d||"∞"}`:a("filter.price"),V=n!=="all"||!!l||u.length>0||w;return e.jsxs(ge,{"data-testid":"collection-page",children:[e.jsxs(ue,{"aria-label":a("collection.breadcrumbAria"),children:[e.jsx(be,{onClick:()=>t("/items"),children:a("collection.breadcrumb")}),e.jsx("span",{children:"/"}),e.jsx(fe,{children:T})]}),e.jsx(We,{name:T,creator:z}),e.jsxs(Ue,{"data-testid":"browse",children:[e.jsxs(qe,{"data-testid":"browse-sidebar",children:[e.jsx(Ge,{address:z}),e.jsx(je,{category:n,subCategory:l,onCategory:D,onSub:g,title:a("collection.category"),flat:!0})]}),e.jsxs(Ye,{children:[!C&&y.length>0?e.jsx(ve,{items:y,source:"collection"}):null,e.jsx(Ce,{rarities:u,onToggleRarity:K,sort:k,onSort:I,total:H,loading:C,anyActive:V,onClear:O,renderTrailing:i=>e.jsx(we,{panelKey:"price",label:Q,active:w,panel:i,children:e.jsxs($e,{"data-variant":"price",children:[e.jsxs(ke,{children:[e.jsx("input",{type:"number",min:"0","aria-label":a("collection.priceMin"),placeholder:a("collection.priceMinPlaceholder"),value:x,onChange:h=>v(h.target.value)}),e.jsx("span",{children:"–"}),e.jsx("input",{type:"number",min:"0","aria-label":a("collection.priceMax"),placeholder:a("collection.priceMaxPlaceholder"),value:d,onChange:h=>j(h.target.value)})]}),e.jsx(Ne,{children:a("collection.priceHint",{currency:le.name})})]})})}),A?e.jsx(he,{message:a("collection.error")}):null,e.jsx(Me,{"data-testid":"grid",children:C?e.jsx(R,{count:15}):e.jsxs(e.Fragment,{children:[y.map(i=>e.jsx(de,{item:i},i.id)),M?e.jsx(R,{count:6}):null]})}),e.jsx(Pe,{hasNextPage:U,isFetching:M,isError:Y,onLoadMore:()=>void q()}),!C&&!A&&y.length===0?e.jsx("p",{className:"muted",children:a("collection.empty")}):null]})]})]})}export{st as Collection,st as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as t,r as v}from"./react-BYHuwl8r.js";import{s as e,t as r,b as m,z as j,L as C,
|
|
1
|
+
import{j as t,r as v}from"./react-BYHuwl8r.js";import{s as e,t as r,b as m,z as j,L as C,b_ as M,C as Z,w as J,I as X,F as Y,g as W,h as I,f as G,at as _,aa as ee,cn as F,as as te}from"./index-BpBLqmY7.js";import{s as ne,f as D,A as q,g as L,r as ae,m as ie,i as oe,j as se}from"./authorizations-CE0HtqU4.js";import{i as re}from"./errors-jURSB57c.js";import{E as de}from"./ErrorNotice-BG4CBNkl.js";import{l as ce,m as le,n as pe}from"./buy-BF3MKHeK.js";import{s as he,M as ue,E as xe}from"./sendMetaTransaction-CcYdCbY-.js";import{I as ge,C as fe}from"./ethers-BDpbhgX6.js";const P="shop:resume_after_signin",me=900*1e3;function dt(a){try{sessionStorage.setItem(P,JSON.stringify({...a,at:Date.now()}))}catch{}}function ct(a){let n;try{n=sessionStorage.getItem(P)}catch{return null}if(!n)return null;try{sessionStorage.removeItem(P)}catch{}let i;try{i=JSON.parse(n)}catch{return null}return!i||i.type!==a||typeof i.at!="number"||Date.now()-i.at>me?null:i.type==="cart-checkout"?{type:"cart-checkout"}:{type:"item-buy",path:i.path}}function be(a,n){return(a+n-1n)/n}function we(a,n,i){return a<=0||n<=0?0n:a>=n?i:be(i*BigInt(a),BigInt(n))}function lt(a){var b,h,y;const n=Number.isFinite(a.priceCents)?Math.max(0,Math.trunc(a.priceCents)):0,i=Number.isFinite(a.balanceCents)?Math.max(0,Math.trunc(a.balanceCents)):0,o=a.priceManaWei>0n?a.priceManaWei:0n,l=a.manaBalanceWei>0n?a.manaBalanceWei:0n;if(n<=0)return{options:[],preferred:null,manaShortfall:null};const d=[];if(i>=n&&d.push({method:"credits",creditsCents:n,manaWei:0n}),o>0n&&i>0&&i<n){const c=n-i,w=we(c,n,o);l>=w&&d.push({method:"combined",creditsCents:i,manaWei:w})}o>0n&&l>=o&&d.push({method:"mana",creditsCents:0,manaWei:o});const p=((b=d.find(c=>c.method==="credits"))==null?void 0:b.method)??((h=d.find(c=>c.method==="combined"))==null?void 0:h.method)??((y=d.find(c=>c.method==="mana"))==null?void 0:y.method)??null,g=!d.some(c=>c.method==="mana"||c.method==="combined")&&o>0n&&l>0n?{manaWei:l,manaCents:ye(l,n,o),priceCents:n}:null;return{options:d,preferred:p,manaShortfall:g}}function ye(a,n,i){return Number(a*BigInt(n)/i)}function pt(a,n){let i=Number.isFinite(n)?Math.max(0,Math.trunc(n)):0;return a.map(o=>{const l=Number.isFinite(o)?Math.max(0,Math.trunc(o)):0,d=Math.min(l,i);return i-=d,d})}function A(a){return Number.isFinite(a)?Math.max(0,a)/10:0}function ht(a,n){return a.options.find(i=>i.method===n)??null}function ut(a,n){if(!Number.isFinite(a)||a<=0||n<=0n)return null;const i=a/10;return Number(n)/1e18/i}const B="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Group%201'%3e%3cpath%20id='Vector'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12%202L22%2012L12%2022L2%2012L12%202ZM12%204.8L19.2%2012L12%2019.2L4.8%2012L12%204.8ZM12%2015.6C12.9548%2015.6001%2013.8705%2015.2209%2014.5457%2014.5459C15.2209%2013.8708%2015.6003%2012.9552%2015.6004%2012.0004C15.6005%2011.0456%2015.2213%2010.1299%2014.5463%209.45471C13.8712%208.7795%2012.9556%208.40011%2012.0008%208.4C11.0461%208.4%2010.1304%208.77928%209.45525%209.45442C8.78012%2010.1295%208.40083%2011.0452%208.40083%2012C8.40083%2012.9548%208.78012%2013.8705%209.45525%2014.5456C10.1304%2015.2207%2011.0461%2015.6%2012.0008%2015.6H12Z'%20fill='white'/%3e%3cg%20id='Rectangle%201'%3e%3c/g%3e%3c/g%3e%3c/svg%3e",ve=e.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: 12px;
|
|
@@ -109,7 +109,7 @@ import{j as t,r as v}from"./react-BYHuwl8r.js";import{s as e,t as r,b as m,z as
|
|
|
109
109
|
line-height: 1.4;
|
|
110
110
|
color: ${r.colors.muted};
|
|
111
111
|
text-align: center;
|
|
112
|
-
`;function xt({options:
|
|
112
|
+
`;function xt({options:a,totalCents:n,onPay:i,busy:o=!1,rateNote:l,creditsLabel:d,shortfall:p,showCreditsAmount:x=!0,creditsFallback:g=null}){const b=a.some(h=>h.method==="credits");return t.jsxs(ve,{children:[!b&&g?t.jsx(O,{type:"button","data-testid":"pay-with-credits-topup",onClick:g.onClick,disabled:o,children:t.jsx("span",{children:g.label})}):null,a.map(h=>h.method==="credits"?t.jsxs(O,{type:"button","data-testid":"pay-with-credits",onClick:()=>i("credits"),disabled:o,children:[t.jsx("span",{children:d??m("buyModal.buy")}),x?t.jsxs(z,{children:[t.jsx(j,{}),t.jsx("span",{children:C(A(h.creditsCents))})]}):null]},"credits"):h.method==="mana"?t.jsxs(N,{type:"button","data-testid":"pay-with-mana",onClick:()=>i("mana"),disabled:o,children:[t.jsx("span",{children:m("buyModal.buyWithMana")}),t.jsxs(z,{children:[t.jsx(E,{children:t.jsx("img",{src:B,alt:"","aria-hidden":!0})}),t.jsx("span",{children:M(h.manaWei)})]})]},"mana"):t.jsxs(N,{type:"button","data-testid":"pay-with-combined",onClick:()=>i("combined"),disabled:o,children:[t.jsx("span",{children:m("buyModal.buyWith")}),t.jsxs(z,{children:[t.jsx(j,{}),t.jsx("span",{children:C(A(h.creditsCents))}),t.jsx(je,{children:"+"}),t.jsx(E,{children:t.jsx("img",{src:B,alt:"","aria-hidden":!0})}),t.jsx("span",{children:M(h.manaWei)}),t.jsx(ke,{children:"MANA"})]})]},"combined")),p?t.jsxs(t.Fragment,{children:[t.jsxs(N,{type:"button","data-testid":"pay-with-mana-disabled",disabled:!0,children:[t.jsx("span",{children:m("buyModal.buyWithMana")}),t.jsxs(z,{children:[t.jsx(E,{children:t.jsx("img",{src:B,alt:"","aria-hidden":!0})}),t.jsx("span",{children:M(p.manaWei)})]})]},"mana-short"),t.jsx(Me,{"data-testid":"mana-shortfall-note",children:m("buyModal.manaWorth",{mana:M(p.manaWei),credits:C(A(p.manaCents)),price:C(A(p.priceCents)),currency:Z.name})})]}):null,l?t.jsx(Ce,{"data-testid":"mana-rate-note",children:l}):null,t.jsx("span",{hidden:!0,"data-testid":"pay-total-cents",children:n})]})}function gt(a,n){const i=(o,...l)=>void a.invalidateQueries({queryKey:n?[o,...l]:[o]});a.invalidateQueries({queryKey:["usd-balance"]}),a.invalidateQueries({queryKey:["detail-trade"]}),a.invalidateQueries({queryKey:["shop-item"]}),i("owned-token",n==null?void 0:n.contractAddress,n==null?void 0:n.tokenId),i("public-token",n==null?void 0:n.contractAddress,n==null?void 0:n.tokenId),i("item-resales",n==null?void 0:n.contractAddress,n==null?void 0:n.itemId),a.invalidateQueries({queryKey:["shop-items"]}),a.invalidateQueries({queryKey:["catalog-items"]}),a.invalidateQueries({queryKey:["overview-listings"]}),a.invalidateQueries({queryKey:["upsell-listings"]}),a.invalidateQueries({queryKey:["my-assets"]}),a.invalidateQueries({queryKey:["purchases"]}),a.invalidateQueries({queryKey:["owned-item-count"]})}const Ae=J`
|
|
113
113
|
to { transform: rotate(360deg); }
|
|
114
114
|
`,ze=e.div`
|
|
115
115
|
position: fixed;
|
|
@@ -289,7 +289,7 @@ import{j as t,r as v}from"./react-BYHuwl8r.js";import{s as e,t as r,b as m,z as
|
|
|
289
289
|
@media (prefers-reduced-motion: reduce) {
|
|
290
290
|
animation: none;
|
|
291
291
|
}
|
|
292
|
-
`;function ft({auth:
|
|
292
|
+
`;function ft({auth:a,signer:n,title:i,reason:o,name:l,image:d,icon:p,onAuthorized:x,onCancel:g,onClose:b}){const[h,y]=v.useState(!1),[c,w]=v.useState(null);async function k(){y(!0),w(null);try{await ne({auth:a,signer:n,active:!0}),x()}catch(u){re(u)?w(m("authorizeStep.errorRejected")):(Y(u,{flow:"authorize_step",kind:a.kind}),w(m("authorizeStep.errorGeneric"))),y(!1)}}return t.jsx(ze,{onClick:h?void 0:b,role:"presentation",children:t.jsxs(Te,{onClick:u=>u.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":i,children:[t.jsxs(We,{children:[t.jsx($e,{children:i}),t.jsx(Be,{onClick:b,disabled:h,"aria-label":m("authorizeStep.close"),children:t.jsx(X,{name:"close",className:"ico"})})]}),t.jsxs(Ne,{"data-testid":"authorize-step-row",children:[t.jsx(Ee,{children:d?t.jsx("img",{src:d,alt:""}):p}),t.jsxs(Ie,{children:[t.jsx(Pe,{title:l,children:l}),t.jsx(Se,{children:o})]})]}),t.jsx(Ve,{children:m("authorizeStep.note")}),t.jsx(de,{message:c}),t.jsxs(Fe,{children:[t.jsx(Le,{type:"button",onClick:g,disabled:h,children:m("authorizeStep.cancel")}),t.jsx(Oe,{type:"button","data-testid":"authorize-step-action",onClick:()=>void k(),disabled:h,children:h?t.jsxs(t.Fragment,{children:[t.jsx(Re,{"aria-hidden":!0}),m("authorizeStep.authorizing")]}):m("authorizeStep.authorize")})]})]})})}const mt="data:image/webp;base64,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";async function bt(a){const[n]=await Xe({...a,trades:[a.trade]});return n}async function Xe(a){const{trades:n,buyer:i,signer:o,onSigned:l}=a;if(n.length===0)throw new Error("No items to buy");const d=new Map;for(const x of n){const g=`${x.chainId}:${x.contract.toLowerCase()}`,b=d.get(g);b?b.push(x):d.set(g,[x])}const p=[];for(const x of d.values())p.push(await De({trades:x,buyer:i,signer:o,onSigned:l}));return p}async function De(a){const{trades:n,buyer:i,signer:o,onSigned:l}=a,d=n[0],p=W(G(d.contract),d.chainId),x=W(I.MANAToken,d.chainId);await D({auth:{kind:q.Allowance,contractAddress:x.address,spenderAddress:p.address,chainId:d.chainId},signer:o});const g=n.map(c=>le(c,i));if(L.enabled)try{const c=new ge(p.abi).encodeFunctionData("accept",[g]),w=ae(),k=ie(o.provider,w),u=await he(k,w,c,p,{serverURL:L.relayerUrl});return l==null||l(),await oe(u,"the MANA purchase"),u}catch(c){if(c instanceof ue&&c.code===xe.USER_DENIED||c instanceof se)throw c;console.warn("[buyWithMana] gasless meta-tx failed, falling back to a direct tx:",c)}await _(o.provider,d.chainId);const h=await new fe(p.address,p.abi,o).accept(g,pe(d.chainId));return l==null||l(),(await h.wait()).transactionHash}async function wt(a){const{trade:n,buyer:i,signer:o,credits:l,manaGapWei:d,onBroadcast:p,onReverted:x}=a;if(l.length===0)throw new Error("No credits to spend — use buyWithMana for a MANA-only purchase");if(d<=0n)throw new Error("No MANA gap to cover — use buyWithCredits for a credits-only purchase");const g=W(I.MANAToken,n.chainId),b=W(I.CreditsManager,n.chainId);await D({auth:{kind:q.Allowance,contractAddress:g.address,spenderAddress:b.address,chainId:n.chainId},signer:o});const y=(l.reduce((c,w)=>c+BigInt(w.availableAmount),0n)+d).toString();return ce({trade:n,buyer:i,signer:o,credits:l,maxCreditedValue:y,onBroadcast:p,onReverted:x})}function yt(a){return t.jsx("svg",{viewBox:"0 0 18 18",width:"18",height:"18","aria-hidden":!0,...a,children:t.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#161518",strokeWidth:"1.8",strokeLinecap:"round"})})}function vt(a){return t.jsx("svg",{viewBox:"0 0 20 20",width:"24",height:"24","aria-hidden":!0,...a,children:t.jsx("path",{fill:"#f48221",d:"M10 0a10 10 0 1 1 0 20 10 10 0 0 1 0-20Zm0 2a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm0 11a1 1 0 1 1 0 2 1 1 0 0 1 0-2Zm0-8a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0V6a1 1 0 0 1 1-1Z"})})}const{colors:s,gradients:Q,radius:H,z:qe}=r,kt=e.div`
|
|
293
293
|
position: fixed;
|
|
294
294
|
inset: 0;
|
|
295
295
|
z-index: ${qe.overlay};
|
|
@@ -575,10 +575,10 @@ import{j as t,r as v}from"./react-BYHuwl8r.js";import{s as e,t as r,b as m,z as
|
|
|
575
575
|
opacity: 0.6;
|
|
576
576
|
cursor: default;
|
|
577
577
|
}
|
|
578
|
-
`,
|
|
578
|
+
`,en=e.img`
|
|
579
579
|
width: 61px;
|
|
580
580
|
height: 61px;
|
|
581
|
-
`,
|
|
581
|
+
`,tn=e.div`
|
|
582
582
|
display: flex;
|
|
583
583
|
flex-direction: column;
|
|
584
584
|
align-items: center;
|
|
@@ -586,11 +586,11 @@ import{j as t,r as v}from"./react-BYHuwl8r.js";import{s as e,t as r,b as m,z as
|
|
|
586
586
|
background: rgba(255, 201, 213, 0.5);
|
|
587
587
|
border-radius: 16px;
|
|
588
588
|
padding: 24px 16px;
|
|
589
|
-
`,
|
|
589
|
+
`,nn=e.img`
|
|
590
590
|
width: 64px;
|
|
591
591
|
height: 80px;
|
|
592
592
|
object-fit: contain;
|
|
593
|
-
`,
|
|
593
|
+
`,an=e.p`
|
|
594
594
|
margin: 0;
|
|
595
595
|
text-align: center;
|
|
596
596
|
font-size: 20px;
|
|
@@ -601,19 +601,19 @@ import{j as t,r as v}from"./react-BYHuwl8r.js";import{s as e,t as r,b as m,z as
|
|
|
601
601
|
& b {
|
|
602
602
|
font-weight: 700;
|
|
603
603
|
}
|
|
604
|
-
`,
|
|
604
|
+
`,on=e.div`
|
|
605
605
|
font-size: 20px;
|
|
606
606
|
font-weight: 700;
|
|
607
607
|
color: ${s.text2};
|
|
608
608
|
text-align: center;
|
|
609
|
-
`,
|
|
609
|
+
`,sn=e.div`
|
|
610
610
|
width: 100%;
|
|
611
611
|
max-width: 456px;
|
|
612
612
|
height: 12px;
|
|
613
613
|
background: ${s.media};
|
|
614
614
|
border-radius: 100px;
|
|
615
615
|
overflow: hidden;
|
|
616
|
-
`,
|
|
616
|
+
`,rn=e.span`
|
|
617
617
|
display: block;
|
|
618
618
|
height: 100%;
|
|
619
619
|
width: 40%;
|
|
@@ -635,7 +635,7 @@ import{j as t,r as v}from"./react-BYHuwl8r.js";import{s as e,t as r,b as m,z as
|
|
|
635
635
|
min-width: 12px;
|
|
636
636
|
transition: width 0.35s ease;
|
|
637
637
|
}
|
|
638
|
-
`,
|
|
638
|
+
`,dn=e.div`
|
|
639
639
|
display: flex;
|
|
640
640
|
flex-direction: column;
|
|
641
641
|
align-items: center;
|
|
@@ -657,7 +657,7 @@ import{j as t,r as v}from"./react-BYHuwl8r.js";import{s as e,t as r,b as m,z as
|
|
|
657
657
|
padding: 16px;
|
|
658
658
|
}
|
|
659
659
|
}
|
|
660
|
-
`,
|
|
660
|
+
`,cn=e.p`
|
|
661
661
|
margin: 0;
|
|
662
662
|
font-size: 20px;
|
|
663
663
|
line-height: 1.334;
|
|
@@ -813,4 +813,4 @@ import{j as t,r as v}from"./react-BYHuwl8r.js";import{s as e,t as r,b as m,z as
|
|
|
813
813
|
opacity: 1;
|
|
814
814
|
transform: scale(1.1);
|
|
815
815
|
}
|
|
816
|
-
`;function
|
|
816
|
+
`;function ln({title:a,items:n,onViewAll:i}){const o=v.useRef(null),[l,d]=v.useState(1),[p,x]=v.useState(0),[g,b]=v.useState(!0),[h,y]=v.useState(!1),c=v.useCallback(()=>{const u=o.current;if(!u)return;const{scrollLeft:f,scrollWidth:S,clientWidth:$}=u,V=Math.max(1,Math.ceil(S/$));d(V),x(Math.min(V-1,Math.round(f/$))),b(f<=1),y(f+$>=S-1)},[]);if(v.useEffect(()=>{c();const u=o.current;if(u)return u.addEventListener("scroll",c,{passive:!0}),window.addEventListener("resize",c),()=>{u.removeEventListener("scroll",c),window.removeEventListener("resize",c)}},[c,n.length]),n.length===0)return null;function w(u){const f=o.current;f&&f.scrollBy({left:u*f.clientWidth,behavior:"smooth"})}function k(u){const f=o.current;f&&f.scrollTo({left:u*f.clientWidth,behavior:"smooth"})}return t.jsxs(Ke,{"data-testid":"carousel",children:[t.jsxs(Qe,{children:[t.jsx(He,{children:a}),i?t.jsxs(Ue,{onClick:i,children:[m("collectionCarousel.viewAll"),t.jsx(Ze,{name:"chevron-down",size:16})]}):null]}),t.jsxs(Je,{children:[t.jsx(R,{"data-side":"left",onClick:()=>w(-1),"aria-label":m("collectionCarousel.scrollLeft"),disabled:g,children:t.jsx("img",{src:F,alt:"","aria-hidden":!0})}),t.jsx(Ye,{ref:o,children:n.map(u=>t.jsx(te,{item:u},u.id))}),t.jsx(R,{"data-side":"right",onClick:()=>w(1),"aria-label":m("collectionCarousel.scrollRight"),disabled:h,children:t.jsx("img",{src:F,alt:"","aria-hidden":!0})})]}),l>1?t.jsx(Ge,{"aria-label":m("collectionCarousel.pages"),children:Array.from({length:l}).map((u,f)=>t.jsx(_e,{"data-active":f===p||void 0,"aria-label":m("collectionCarousel.goToPage",{page:f+1}),"aria-current":f===p?"true":void 0,onClick:()=>k(f)},f))}):null]})}export{we as $,It as A,Wt as B,Ct as C,mt as D,Qt as E,Ht as F,Ut as G,Mt as H,Zt as I,Jt as J,Yt as K,en as L,kt as M,lt as N,ct as O,xt as P,ln as Q,ft as R,jt as S,zt as T,B as U,dt as V,Rt as W,Tt as X,gt as Y,Xe as Z,pt as _,At as a,A as a0,dn as a1,cn as a2,bt as a3,ht as a4,wt as a5,yt as b,$t as c,Bt as d,Nt as e,Et as f,tn as g,nn as h,an as i,Gt as j,_t as k,on as l,ut as m,sn as n,rn as o,vt as p,Xt as q,Pt as r,St as s,Vt as t,Ft as u,Lt as v,Ot as w,Dt as x,qt as y,Kt as z};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/index.es-C4oAOZ2V.js","_assets/react-BYHuwl8r.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{s as o,_ as a}from"./index-
|
|
2
|
+
import{s as o,_ as a}from"./index-BpBLqmY7.js";import{r as n,j as e}from"./react-BYHuwl8r.js";const s=o.div`
|
|
3
3
|
position: fixed;
|
|
4
4
|
inset: 0;
|
|
5
5
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as de,j as e,L as Le,d as Me,u as Ae,r as L}from"./react-BYHuwl8r.js";import{u as Ie}from"./useUrlFilters-DH-gxdfV.js";import{u as
|
|
1
|
+
import{b as de,j as e,L as Le,d as Me,u as Ae,r as L}from"./react-BYHuwl8r.js";import{u as Ie}from"./useUrlFilters-DH-gxdfV.js";import{u as Re,S as Z,R as Be,F as Te,e as _e}from"./categories-e7ryjlpc.js";import{t as he,O as ze,Q as X,P as ee,s as i,bI as We,J as De,bJ as Oe,b as o,bK as Ke,bL as te,B as Ue,K as ue,a2 as me,bv as Ge,o as He,D as xe,bC as qe,bw as Ve,bx as Je,I as oe,c as Qe,x as Ye,v as Ze,an as Xe,ap as et,aq as tt,ar as M,as as re,bM as se,bN as ot}from"./index-BpBLqmY7.js";import{T as pe}from"./skeleton.styles-DagyoT5y.js";import{d as rt,P as st,C as it,a as at,b as nt,A as lt,c as ct,e as dt}from"./collectionPage.styles-DGJTp7Uw.js";import{g as ht,h as ut,i as mt,j as xt,k as pt,C as gt,l as ft,o as bt,m as wt,n as vt,M as yt,E as jt,p as Ct,q as kt,r as $t,s as St,t as Nt}from"./Assets.styles-c5XuGAG4.js";import{L as ie}from"./LoadMore-BLHzgyNQ.js";import{u as ae}from"./useInfiniteGrid-VPnx9W8Q.js";import{E as B}from"./ErrorNotice-BG4CBNkl.js";import{G as ne}from"./grid.styles-DRngdZfp.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";import"./Tooltip-CnjWof_H.js";function Et(r){const{gridLoading:s,gridError:a,gridCount:l,baselinePending:c,baselineError:d,baselineCount:b}=r;return s?"skeletons":a?"error":l>0?"items":c?"skeletons":d?"error":b===0?"no-creations":"filters"}const{colors:w,radius:ge,media:Pt}=he,Ft=i.article`
|
|
2
2
|
height: 300px;
|
|
3
3
|
background: ${w.bg};
|
|
4
4
|
border-radius: ${ge.card};
|
|
@@ -61,7 +61,7 @@ import{b as de,j as e,L as Le,d as Me,u as Ae,r as L}from"./react-BYHuwl8r.js";i
|
|
|
61
61
|
display: flex;
|
|
62
62
|
flex-direction: column;
|
|
63
63
|
gap: 8px;
|
|
64
|
-
`,
|
|
64
|
+
`,Rt=i.h3`
|
|
65
65
|
margin: 0;
|
|
66
66
|
font-weight: 700;
|
|
67
67
|
font-size: 18px;
|
|
@@ -74,7 +74,7 @@ import{b as de,j as e,L as Le,d as Me,u as Ae,r as L}from"./react-BYHuwl8r.js";i
|
|
|
74
74
|
${Pt.maxWidth("mobile")} {
|
|
75
75
|
font-size: 16px;
|
|
76
76
|
}
|
|
77
|
-
`,
|
|
77
|
+
`,Bt=i.div`
|
|
78
78
|
flex: 1;
|
|
79
79
|
min-height: 0;
|
|
80
80
|
display: grid;
|
|
@@ -135,7 +135,7 @@ import{b as de,j as e,L as Le,d as Me,u as Ae,r as L}from"./react-BYHuwl8r.js";i
|
|
|
135
135
|
&:active {
|
|
136
136
|
background: ${w.accentActive};
|
|
137
137
|
}
|
|
138
|
-
`;function Ot({collection:r,cover:s,itemCount:a}){const l=de(),{contractAddress:c,name:d,creator:b}=r,j=s==null||a==null,{data:n}=Oe(c,j),g=s==null?(n==null?void 0:n.items)??[]:[],f=a??(n==null?void 0:n.total);function h(){l(`/collection/${c}`)}return e.jsxs(Ft,{"data-testid":"coll-card",role:"link",tabIndex:0,onClick:h,onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),h())},children:[e.jsx(Lt,{children:s?e.jsx(Mt,{"data-testid":"coll-card-img",src:s,alt:"",loading:"lazy"}):g.length>0?e.jsx(At,{items:g,tinted:!1}):null}),e.jsxs(It,{children:[e.jsx(
|
|
138
|
+
`;function Ot({collection:r,cover:s,itemCount:a}){const l=de(),{contractAddress:c,name:d,creator:b}=r,j=s==null||a==null,{data:n}=Oe(c,j),g=s==null?(n==null?void 0:n.items)??[]:[],f=a??(n==null?void 0:n.total);function h(){l(`/collection/${c}`)}return e.jsxs(Ft,{"data-testid":"coll-card",role:"link",tabIndex:0,onClick:h,onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),h())},children:[e.jsx(Lt,{children:s?e.jsx(Mt,{"data-testid":"coll-card-img",src:s,alt:"",loading:"lazy"}):g.length>0?e.jsx(At,{items:g,tinted:!1}):null}),e.jsxs(It,{children:[e.jsx(Rt,{title:d,children:d}),e.jsxs(Bt,{children:[e.jsxs(Tt,{"data-meta":!0,"data-testid":"coll-card-meta",children:[b?e.jsx(_t,{address:b,linkToProfile:!0}):e.jsx(zt,{children:" "}),e.jsx(Wt,{"data-testid":"coll-card-count","aria-busy":f==null||void 0,children:f==null?e.jsx(pe,{className:"skeleton",width:54,"data-testid":"coll-card-count-skeleton","aria-hidden":!0}):o("collectionCard.itemCount",{count:f})})]}),e.jsx(Dt,{"data-view":!0,"data-testid":"coll-card-view",onClick:m=>{m.stopPropagation(),h()},tabIndex:-1,children:o("collectionCard.viewCollection")})]})]})]})}function Kt({address:r,className:s=""}){const a=Ke(),l=te(d=>d.followed.includes(r.toLowerCase())),c=te(d=>d.toggle);return!a||!r?null:e.jsx(Ue,{type:"button",size:"sm",variant:l?"ghost":"outline",className:s||void 0,"data-testid":"follow-button","aria-pressed":l,title:l?o("creator.unfollowTitle"):o("creator.followTitle"),onClick:()=>c(r),children:l?o("creator.following"):o("creator.follow")})}const{colors:v,radius:fe,media:y}=he,be=ue`
|
|
139
139
|
display: inline-flex;
|
|
140
140
|
align-items: center;
|
|
141
141
|
justify-content: center;
|
|
@@ -302,4 +302,4 @@ import{b as de,j as e,L as Le,d as Me,u as Ae,r as L}from"./react-BYHuwl8r.js";i
|
|
|
302
302
|
&:hover {
|
|
303
303
|
background: ${v.blackBtn};
|
|
304
304
|
}
|
|
305
|
-
`,oo={website:"website",twitter:"twitter",discord:"discord",facebook:"facebook"};function ro({address:r}){var m,C;const{data:s}=me(r),{data:a}=Ge(r),l=He(x=>{var $;return($=x.session)==null?void 0:$.address}),c=!!l&&l.toLowerCase()===r.toLowerCase(),d=(s==null?void 0:s.name)||xe(r),b=(C=(m=s==null?void 0:s.avatar)==null?void 0:m.snapshots)==null?void 0:C.face256,j=(a==null?void 0:a.cover)||rt,n=a==null?void 0:a.description,g=`${Qe.profileUrl}/${r}`,f=qe.filter(x=>a==null?void 0:a.links[x]),h=Ve(Je({name:s==null?void 0:s.name,hasClaimedName:s==null?void 0:s.hasClaimedName,ethAddress:(s==null?void 0:s.ethAddress)??r}));return e.jsxs(Ut,{"aria-label":`${d} storefront`,children:[e.jsxs(Gt,{children:[e.jsx(Ht,{src:j,alt:"",loading:"eager"}),e.jsx(qt,{"aria-hidden":!0})]}),(f.length>0||c)&&e.jsxs(Vt,{children:[f.map(x=>e.jsx(Jt,{"data-testid":"creator-hero-link",href:(a==null?void 0:a.links[x])??"",target:"_blank",rel:"noopener noreferrer",title:o(`creator.link.${x}`),"aria-label":o(`creator.link.${x}`),children:e.jsx(oe,{name:oo[x]})},x)),c&&e.jsx(Qt,{to:"/store-settings",title:o("creator.editStore"),"aria-label":o("creator.editStore"),children:e.jsx(oe,{name:"pen"})})]}),e.jsxs(Yt,{children:[b?e.jsx(le,{src:b,alt:"",loading:"eager",style:{backgroundColor:h}}):e.jsx(le,{as:"span","aria-hidden":!0,style:{backgroundColor:h}}),e.jsxs("div",{children:[e.jsx(Zt,{children:d}),n?e.jsx(Xt,{children:n}):null]}),e.jsxs(eo,{children:[e.jsx(to,{"data-testid":"creator-hero-view",href:g,target:"_blank",rel:"noopener noreferrer",children:o("creator.viewProfile")}),e.jsx(Kt,{address:r,className:"creator-hero__follow"})]})]})]})}const so=["all","on_sale","not_for_sale"],ce=48;function jo(){var Q,Y;const{address:r}=Me(),s=de(),[a]=Ae(),l=a.has("collections"),{data:c}=me(r),d=(c==null?void 0:c.name)||(r?xe(r):o("creator.fallbackName"));Ye({title:d,description:o("seo.creator.description",{name:d}),image:(Y=(Q=c==null?void 0:c.avatar)==null?void 0:Q.snapshots)==null?void 0:Y.face256});const b=L.useMemo(()=>({category:"all",status:"all",subCategory:null,rarities:[],priceMin:"",priceMax:"",smart:!1,sort:"newest"}),[]),[j,n]=Ie(b),{category:g,subCategory:f,rarities:h,priceMin:m,priceMax:C,smart:x,sort:$}=j,S=so.includes(j.status)?j.status:"all",T=t=>n({status:t});
|
|
305
|
+
`,oo={website:"website",twitter:"twitter",discord:"discord",facebook:"facebook"};function ro({address:r}){var m,C;const{data:s}=me(r),{data:a}=Ge(r),l=He(x=>{var $;return($=x.session)==null?void 0:$.address}),c=!!l&&l.toLowerCase()===r.toLowerCase(),d=(s==null?void 0:s.name)||xe(r),b=(C=(m=s==null?void 0:s.avatar)==null?void 0:m.snapshots)==null?void 0:C.face256,j=(a==null?void 0:a.cover)||rt,n=a==null?void 0:a.description,g=`${Qe.profileUrl}/${r}`,f=qe.filter(x=>a==null?void 0:a.links[x]),h=Ve(Je({name:s==null?void 0:s.name,hasClaimedName:s==null?void 0:s.hasClaimedName,ethAddress:(s==null?void 0:s.ethAddress)??r}));return e.jsxs(Ut,{"aria-label":`${d} storefront`,children:[e.jsxs(Gt,{children:[e.jsx(Ht,{src:j,alt:"",loading:"eager"}),e.jsx(qt,{"aria-hidden":!0})]}),(f.length>0||c)&&e.jsxs(Vt,{children:[f.map(x=>e.jsx(Jt,{"data-testid":"creator-hero-link",href:(a==null?void 0:a.links[x])??"",target:"_blank",rel:"noopener noreferrer",title:o(`creator.link.${x}`),"aria-label":o(`creator.link.${x}`),children:e.jsx(oe,{name:oo[x]})},x)),c&&e.jsx(Qt,{to:"/store-settings",title:o("creator.editStore"),"aria-label":o("creator.editStore"),children:e.jsx(oe,{name:"pen"})})]}),e.jsxs(Yt,{children:[b?e.jsx(le,{src:b,alt:"",loading:"eager",style:{backgroundColor:h}}):e.jsx(le,{as:"span","aria-hidden":!0,style:{backgroundColor:h}}),e.jsxs("div",{children:[e.jsx(Zt,{children:d}),n?e.jsx(Xt,{children:n}):null]}),e.jsxs(eo,{children:[e.jsx(to,{"data-testid":"creator-hero-view",href:g,target:"_blank",rel:"noopener noreferrer",children:o("creator.viewProfile")}),e.jsx(Kt,{address:r,className:"creator-hero__follow"})]})]})]})}const so=["all","on_sale","not_for_sale"],ce=48;function jo(){var Q,Y;const{address:r}=Me(),s=de(),[a]=Ae(),l=a.has("collections"),{data:c}=me(r),d=(c==null?void 0:c.name)||(r?xe(r):o("creator.fallbackName"));Ye({title:d,description:o("seo.creator.description",{name:d}),image:(Y=(Q=c==null?void 0:c.avatar)==null?void 0:Q.snapshots)==null?void 0:Y.face256});const b=L.useMemo(()=>({category:"all",status:"all",subCategory:null,rarities:[],priceMin:"",priceMax:"",smart:!1,sort:"newest"}),[]),[j,n]=Ie(b),{category:g,subCategory:f,rarities:h,priceMin:m,priceMax:C,smart:x,sort:$}=j,S=so.includes(j.status)?j.status:"all",T=t=>n({status:t});Re(`${l}:${g}:${f??""}`);const[E,N]=L.useState(!1);L.useEffect(()=>{if(!E)return;const t=Fe=>{Fe.key==="Escape"&&N(!1)};document.addEventListener("keydown",t);const p=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",t),document.body.style.overflow=p}},[E]);const _=m&&!Number.isNaN(Number(m))?Number(m):void 0,z=C&&!Number.isNaN(Number(C))?Number(C):void 0,ve=f?_e[f]:void 0,ye=(Z.find(t=>t.key===$)??Z[0]).server,W={creator:r,category:g,rarities:h.length?h:void 0,wearableCategories:ve,minPriceCredits:_,maxPriceCredits:z,isWearableSmart:x||void 0,isOnSale:S==="all"?void 0:S==="on_sale",sortBy:ye},{items:A,total:je,isLoading:Ce,isPlaceholderData:ke,error:D,hasNextPage:$e,isFetchingNextPage:O,isFetchNextPageError:Se,fetchNextPage:Ne}=ae(["creator-items",W],t=>se({...W,first:ce,skip:t}),{enabled:!!r&&!l}),P=Ze({queryKey:["creator-item-count",r],queryFn:()=>se({creator:r,first:1}).then(t=>t.total),enabled:!!r}),u=ae(["creator-collections",r],t=>ot(r,{first:ce,skip:t}).then(p=>({items:p.collections,total:p.total})),{enabled:!!r&&l});function K(t){n({category:t,subCategory:null},{drop:l?["collections"]:void 0})}function Ee(){const t=new URLSearchParams(a);t.delete("collections");const p=t.toString();s({search:p?`?${p}`:""},{replace:!0})}function Pe(){if(l){Ee();return}const t=new URLSearchParams(a);t.delete("collections");const p=t.toString();s({search:p?`?${p}&collections`:"?collections"},{replace:!0})}function U(t){n({rarities:h.includes(t)?h.filter(p=>p!==t):[...h,t]})}function G(){n(b)}const k=[];(g==="wearable"||g==="emote")&&k.push({key:"category",label:o(g==="emote"?"categories.emotes":"categories.wearables"),onRemove:()=>K("all")}),(_!=null||z!=null)&&k.push({key:"price",label:o("filter.price"),onRemove:()=>{n({priceMin:"",priceMax:""})}});for(const t of Be)h.includes(t)&&k.push({key:`rarity-${t}`,label:Xe(t),onRemove:()=>U(t)});x&&k.push({key:"smart",label:o("filter.smart"),onRemove:()=>n({smart:!1})}),S!=="all"&&k.push({key:"status",label:S==="on_sale"?o("filter.onSale"):o("filter.notForSale"),onRemove:()=>T("all")});const F=Et({gridLoading:Ce||ke,gridError:!!D,gridCount:A.length,baselinePending:P.isPending,baselineError:P.isError,baselineCount:P.data}),I=F==="skeletons",{data:H}=et(),q=L.useMemo(()=>A.map(t=>({...t,priceCredits:tt(t,H)})),[A,H]),V=t=>t.priceCredits>0||!!t.manaWei,J=q.filter(V),R=F==="items"||F==="skeletons"?null:F;return e.jsxs(st,{children:[e.jsxs(it,{"aria-label":o("creator.breadcrumbAria"),children:[e.jsx(at,{onClick:()=>s("/items"),children:o("creator.breadcrumb")}),e.jsx("span",{children:"/"}),e.jsx(nt,{children:d})]}),r?e.jsx(ro,{address:r}):null,!l&&!I&&J.length>0?e.jsx(lt,{items:J,source:"creator"}):null,e.jsxs(ht,{children:[E?e.jsx(ut,{onClick:()=>N(!1),"aria-hidden":!0}):null,e.jsxs(mt,{"data-open":E||void 0,"data-testid":"creator-sidebar",children:[e.jsxs(xt,{children:[e.jsx(pt,{children:o("assets.filters")}),e.jsx(gt,{onClick:()=>N(!1),"aria-label":o("assets.closeFilters"),children:"✕"})]}),e.jsx(ft,{children:e.jsx(bt,{category:g,subCategory:f,onCategory:K,onSub:t=>n({subCategory:t}),priceMin:m,priceMax:C,onPriceMin:t=>n({priceMin:t}),onPriceMax:t=>n({priceMax:t}),rarities:h,onToggleRarity:U,status:S,onStatus:T,smart:x,onSmart:t=>n({smart:t}),hideNames:!0,collections:l,onCollections:Pe})}),e.jsx(wt,{children:e.jsx(vt,{type:"button",onClick:()=>N(!1),children:o("assets.showItems")})})]}),e.jsx(yt,{children:l?e.jsxs(e.Fragment,{children:[e.jsx(ct,{children:e.jsx(dt,{"data-testid":"creator-collections-count","aria-busy":u.isLoading||void 0,children:u.isLoading?e.jsx(pe,{className:"skeleton",width:72,"data-testid":"creator-collections-count-skeleton","aria-hidden":!0}):o("creator.collectionsCount",{count:u.total})})}),u.error?e.jsx(B,{message:o("creator.error")}):null,e.jsx(ne,{"data-variant":"collections",children:u.isLoading?e.jsx(M,{count:9}):e.jsxs(e.Fragment,{children:[u.items.map(t=>e.jsx(Ot,{collection:t,itemCount:t.itemCount},t.contractAddress)),u.isFetchingNextPage?e.jsx(M,{count:6}):null]})}),e.jsx(ie,{hasNextPage:u.hasNextPage,isFetching:u.isFetchingNextPage,isError:u.isFetchNextPageError,onLoadMore:()=>void u.fetchNextPage()}),!u.isLoading&&!u.error&&u.items.length===0?e.jsx("p",{className:"muted",children:o("creator.collectionsEmpty")}):null]}):e.jsxs(e.Fragment,{children:[e.jsx(Te,{sort:$,onSort:t=>n({sort:t}),total:je,loading:I,onOpenFilters:()=>N(!0),chips:k,onClearChips:G}),D?e.jsx(B,{message:o("creator.error"),testId:"creator-error"}):null,e.jsx(ne,{"data-testid":"creator-grid",children:I?e.jsx(M,{count:15}):e.jsxs(e.Fragment,{children:[q.map(t=>V(t)?e.jsx(re,{item:t},t.id):e.jsx(re,{item:t,mode:"view"},t.id)),O?e.jsx(M,{count:6}):null]})}),e.jsx(ie,{hasNextPage:$e,isFetching:O,isError:Se,onLoadMore:()=>void Ne()}),R==="error"?e.jsx(B,{message:o("creator.error"),testId:"creator-empty-error"}):R==="no-creations"?e.jsx("p",{className:"muted","data-testid":"creator-empty-none",children:o("creator.emptyNoCreations")}):R==="filters"?e.jsxs(jt,{"data-testid":"creator-empty-filters",children:[e.jsxs(Ct,{children:[e.jsx(kt,{children:o("creator.emptyFilters.title")}),e.jsx($t,{children:o("creator.emptyFilters.body",{count:P.data??0})})]}),e.jsx(St,{children:e.jsx(Nt,{type:"button",onClick:G,children:o("filterBar.clearAll")})})]}):null]})})]})]})}export{jo as Creator,jo as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as r}from"./react-BYHuwl8r.js";import{I as i}from"./index-
|
|
1
|
+
import{j as r}from"./react-BYHuwl8r.js";import{I as i}from"./index-BpBLqmY7.js";function a({message:e,className:o,testId:t}){return e?r.jsxs("p",{className:o?`error-notice ${o}`:"error-notice","data-testid":t,role:"alert",children:[r.jsx(i,{name:"alert",className:"error-notice__ico",size:18}),r.jsx("span",{className:"error-notice__msg",children:e})]}):null}export{a as E};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as l,E as w,b as E,S as A,d as k,O as U,N as P,g as f,B as x,e as N,i as I,p as L}from"./W3MFrameProviderSingleton-
|
|
1
|
+
import{C as l,E as w,b as E,S as A,d as k,O as U,N as P,g as f,B as x,e as N,i as I,p as L}from"./W3MFrameProviderSingleton-BNh7T9LS.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-BwpU8az-.js";const D=0,C={paymentAsset:null,amount:null,tokenAmount:0,priceLoading:!1,error:null,exchanges:[],isLoading:!1,currentPayment:void 0,isPaymentInProgress:!1,paymentId:"",assets:[]},e=L(C),m={state:e,subscribe(t){return I(e,()=>t(e))},subscribeKey(t,n){return N(e,t,n)},resetState(){Object.assign(e,{...C})},async getAssetsForNetwork(t){const n=v(t),s=await m.getAssetsImageAndPrice(n),r=n.map(a=>{var c,o,p,y;const u=a.asset==="native"?f():`${a.network}:${a.asset}`,i=s.find(S=>{var g,d,h;return((h=(d=(g=S.fungibles)==null?void 0:g[0])==null?void 0:d.address)==null?void 0:h.toLowerCase())===u.toLowerCase()});return{...a,price:((o=(c=i==null?void 0:i.fungibles)==null?void 0:c[0])==null?void 0:o.price)||1,metadata:{...a.metadata,iconUrl:(y=(p=i==null?void 0:i.fungibles)==null?void 0:p[0])==null?void 0:y.iconUrl}}});return e.assets=r,r},async getAssetsImageAndPrice(t){const n=t.map(r=>r.asset==="native"?f():`${r.network}:${r.asset}`);return await Promise.all(n.map(r=>x.fetchTokenPrice({addresses:[r]})))},getTokenAmount(){var s;if(!((s=e==null?void 0:e.paymentAsset)!=null&&s.price))throw new Error("Cannot get token price");const t=P.bigNumber(e.amount??0).round(8),n=P.bigNumber(e.paymentAsset.price).round(8);return t.div(n).round(8).toNumber()},setAmount(t){var n;e.amount=t,(n=e.paymentAsset)!=null&&n.price&&(e.tokenAmount=m.getTokenAmount())},setPaymentAsset(t){e.paymentAsset=t},isPayWithExchangeEnabled(){var t;return(t=U.state.remoteFeatures)==null?void 0:t.payWithExchange},isPayWithExchangeSupported(){return m.isPayWithExchangeEnabled()&&l.state.activeCaipNetwork&&k.PAY_WITH_EXCHANGE_SUPPORTED_CHAIN_NAMESPACES.includes(l.state.activeCaipNetwork.chainNamespace)},async fetchExchanges(){var t;try{const n=m.isPayWithExchangeSupported();if(!e.paymentAsset||!n){e.exchanges=[],e.isLoading=!1;return}e.isLoading=!0;const s=await _({page:D,asset:b(e.paymentAsset.network,e.paymentAsset.asset),amount:((t=e.amount)==null?void 0:t.toString())??"0"});e.exchanges=s.exchanges.slice(0,2)}catch{throw A.showError("Unable to get exchanges"),new Error("Unable to get exchanges")}finally{e.isLoading=!1}},async getPayUrl(t,n){try{const s=Number(n.amount),r=await W({exchangeId:t,asset:b(n.network,n.asset),amount:s.toString(),recipient:`${n.network}:${n.recipient}`});return w.sendEvent({type:"track",event:"PAY_EXCHANGE_SELECTED",properties:{exchange:{id:t},configuration:{network:n.network,asset:n.asset,recipient:n.recipient,amount:s},currentPayment:{type:"exchange",exchangeId:t},source:"fund-from-exchange",headless:!1}}),r}catch(s){throw s instanceof Error&&s.message.includes("is not supported")?new Error("Asset not supported"):new Error(s.message)}},async handlePayWithExchange(t){var n;try{const s=(n=l.getAccountData())==null?void 0:n.address;if(!s)throw new Error("No account connected");if(!e.paymentAsset)throw new Error("No payment asset selected");const r=E.returnOpenHref("","popupWindow","scrollbar=yes,width=480,height=720");if(!r)throw new Error("Could not create popup window");e.isPaymentInProgress=!0,e.paymentId=crypto.randomUUID(),e.currentPayment={type:"exchange",exchangeId:t};const{network:a,asset:u}=e.paymentAsset,i={network:a,asset:u,amount:e.tokenAmount,recipient:s},c=await m.getPayUrl(t,i);if(!c){try{r.close()}catch(o){console.error("Unable to close popup window",o)}throw new Error("Unable to initiate payment")}e.currentPayment.sessionId=c.sessionId,e.currentPayment.status="IN_PROGRESS",e.currentPayment.exchangeId=t,r.location.href=c.url}catch{e.error="Unable to initiate payment",A.showError(e.error)}},async waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r=20}){const a=await m.getBuyStatus(t,n,s);if(a.status==="SUCCESS"||a.status==="FAILED")return a;if(r===0)throw new Error("Unable to get deposit status");return await new Promise(u=>{setTimeout(u,5e3)}),m.waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r-1})},async getBuyStatus(t,n,s){var r,a,u,i,c;try{if(!e.currentPayment)throw new Error("No current payment");const o=await T({sessionId:n,exchangeId:t});if(e.currentPayment.status=o.status,o.status==="SUCCESS"||o.status==="FAILED"){const p=(r=l.getAccountData())==null?void 0:r.address;e.currentPayment.result=o.txHash,e.isPaymentInProgress=!1,w.sendEvent({type:"track",event:o.status==="SUCCESS"?"PAY_SUCCESS":"PAY_ERROR",properties:{message:o.status==="FAILED"?E.parseError(e.error):void 0,source:"fund-from-exchange",paymentId:s,configuration:{network:((a=e.paymentAsset)==null?void 0:a.network)||"",asset:((u=e.paymentAsset)==null?void 0:u.asset)||"",recipient:p||"",amount:e.amount??0},currentPayment:{type:"exchange",exchangeId:(i=e.currentPayment)==null?void 0:i.exchangeId,sessionId:(c=e.currentPayment)==null?void 0:c.sessionId,result:o.txHash}}})}return o}catch{return{status:"UNKNOWN",txHash:""}}},reset(){e.currentPayment=void 0,e.isPaymentInProgress=!1,e.paymentId="",e.paymentAsset=null,e.amount=0,e.tokenAmount=0,e.priceLoading=!1,e.error=null,e.exchanges=[],e.isLoading=!1}};export{m as E};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as l,j as o}from"./react-BYHuwl8r.js";import{t as e,s as a,b as s,I as w}from"./index-
|
|
1
|
+
import{r as l,j as o}from"./react-BYHuwl8r.js";import{t as e,s as a,b as s,I as w}from"./index-BpBLqmY7.js";const m=a.section`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: 36px;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as ue,u as xe,r as l,j as t}from"./react-BYHuwl8r.js";import{s as i,t as e,w as F,x as ge,b as n,C as h,o as fe,A as me,$ as g,
|
|
1
|
+
import{b as ue,u as xe,r as l,j as t}from"./react-BYHuwl8r.js";import{s as i,t as e,w as F,x as ge,b as n,C as h,o as fe,A as me,$ as g,bj as be,F as U,bt as N,bX as we,bd as Q,z as re,I as ye,bY as H}from"./index-BpBLqmY7.js";import{C as ke}from"./Confetti-z9mEz7Mo.js";import{F as ve}from"./Faq-D7gV7iYA.js";import{R as D}from"./resume-buy-Bf0zIH7y.js";import{u as Ce,a as $e,R as je,c as Se,i as Ae,b as Pe}from"./useCreditPacks-Dsfos9wm.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";const A="https://cdn.decentraland.org/@dcl/shop/1.0.1/_assets/pack-coins-BDh1ZDbh.webp",ne="https://cdn.decentraland.org/@dcl/shop/1.0.1/_assets/pack-stacks-D-V2jSHW.webp",se="https://cdn.decentraland.org/@dcl/shop/1.0.1/_assets/pack-chest-BX_j84xW.webp",Re="https://cdn.decentraland.org/@dcl/shop/1.0.1/_assets/credit-coin-CmcTCd5i.webp",Te="data:image/svg+xml,%3csvg%20width='60'%20height='60'%20viewBox='0%200%2060%2060'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='60'%20height='60'%20rx='30'%20fill='%2334CE77'/%3e%3cpath%20d='M21.6583%2046.1067L11.4656%2036.0591C10.1688%2034.829%2010.1905%2032.7207%2011.4769%2031.4622L13.6868%2029.3591C14.9732%2028.1006%2017.1615%2028.1058%2018.4582%2029.3359L23.8747%2034.6197L41.9704%2015.6527C43.2568%2014.3942%2045.4291%2014.2093%2046.7258%2015.4394L48.8765%2017.3628C50.1732%2018.5929%2050.3491%2020.6844%2049.0626%2021.9429L26.6112%2045.8766C25.1433%2047.342%2022.955%2047.3368%2021.6583%2046.1067Z'%20fill='%23FCFCFC'/%3e%3c/svg%3e",Y="linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)",_e=i.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: 24px;
|
|
@@ -146,7 +146,7 @@ import{b as ue,u as xe,r as l,j as t}from"./react-BYHuwl8r.js";import{s as i,t a
|
|
|
146
146
|
line-height: 1.6;
|
|
147
147
|
color: ${e.colors.media};
|
|
148
148
|
text-align: center;
|
|
149
|
-
`,
|
|
149
|
+
`,K=i.div`
|
|
150
150
|
display: grid;
|
|
151
151
|
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
152
152
|
gap: 24px;
|
|
@@ -162,7 +162,7 @@ import{b as ue,u as xe,r as l,j as t}from"./react-BYHuwl8r.js";import{s as i,t a
|
|
|
162
162
|
gap: 12px;
|
|
163
163
|
row-gap: 24px;
|
|
164
164
|
}
|
|
165
|
-
`,
|
|
165
|
+
`,O=i.button`
|
|
166
166
|
position: relative;
|
|
167
167
|
display: flex;
|
|
168
168
|
flex-direction: column;
|
|
@@ -201,9 +201,9 @@ import{b as ue,u as xe,r as l,j as t}from"./react-BYHuwl8r.js";import{s as i,t a
|
|
|
201
201
|
inset: 0;
|
|
202
202
|
border-radius: inherit;
|
|
203
203
|
pointer-events: none;
|
|
204
|
-
-webkit-mask: ${
|
|
204
|
+
-webkit-mask: ${Y};
|
|
205
205
|
-webkit-mask-composite: xor;
|
|
206
|
-
mask: ${
|
|
206
|
+
mask: ${Y};
|
|
207
207
|
mask-composite: exclude;
|
|
208
208
|
transition: opacity 0.15s ease;
|
|
209
209
|
}
|
|
@@ -385,7 +385,7 @@ import{b as ue,u as xe,r as l,j as t}from"./react-BYHuwl8r.js";import{s as i,t a
|
|
|
385
385
|
transform: none;
|
|
386
386
|
}
|
|
387
387
|
}
|
|
388
|
-
`,
|
|
388
|
+
`,Ye=i.span`
|
|
389
389
|
display: flex;
|
|
390
390
|
align-items: center;
|
|
391
391
|
justify-content: center;
|
|
@@ -423,7 +423,7 @@ import{b as ue,u as xe,r as l,j as t}from"./react-BYHuwl8r.js";import{s as i,t a
|
|
|
423
423
|
font-size: 16px;
|
|
424
424
|
font-weight: 800;
|
|
425
425
|
}
|
|
426
|
-
`,
|
|
426
|
+
`,Ke=F`
|
|
427
427
|
to {
|
|
428
428
|
background-position: -200% 0;
|
|
429
429
|
}
|
|
@@ -436,12 +436,12 @@ import{b as ue,u as xe,r as l,j as t}from"./react-BYHuwl8r.js";import{s as i,t a
|
|
|
436
436
|
rgba(255, 255, 255, 0.08) 70%
|
|
437
437
|
);
|
|
438
438
|
background-size: 200% 100%;
|
|
439
|
-
animation: ${
|
|
439
|
+
animation: ${Ke} 1.4s infinite linear;
|
|
440
440
|
|
|
441
441
|
@media (prefers-reduced-motion: reduce) {
|
|
442
442
|
animation: none;
|
|
443
443
|
}
|
|
444
|
-
`,
|
|
444
|
+
`,Oe=i(P)`
|
|
445
445
|
width: 60%;
|
|
446
446
|
height: 30px;
|
|
447
447
|
border-radius: ${e.radius.chip};
|
|
@@ -742,4 +742,4 @@ import{b as ue,u as xe,r as l,j as t}from"./react-BYHuwl8r.js";import{s as i,t a
|
|
|
742
742
|
margin: 0;
|
|
743
743
|
font-family: ${e.font.sans};
|
|
744
744
|
color: ${e.colors.err};
|
|
745
|
-
`,C=Ae()?"mock":"stripe",te=[A,A,ne,se],$t={pack_5:A,pack_10:A,pack_25:ne,pack_50:se};function ae(d,s){return $t[d.id]??te[s%te.length]}function jt(d,s){return d.artUrl??ae(d,s)}const St=[{question:"faq.buyers.whatAreQ",answer:"faq.buyers.whatAreA"},{question:"faq.buyers.whatCanIBuyQ",answer:"faq.buyers.whatCanIBuyA"},{question:"faq.buyers.whereBuyQ",answer:"faq.buyers.whereBuyA"},{question:"faq.buyers.whereUseQ",answer:"faq.buyers.whereUseA"},{question:"faq.buyers.expireQ",answer:"faq.buyers.expireA"},{question:"faq.buyers.transferQ",answer:"faq.buyers.transferA"}];function ie(d){const s=d;if((s==null?void 0:s.name)==="AbortError")return n("getCredits.errorCanceled");const f=((s==null?void 0:s.message)??"").toLowerCase();return f.includes("sign in")?n("getCredits.errorSignIn",{currency:h.name}):f.includes("timed out")?n("getCredits.errorTimeout",{currency:h.name}):n("getCredits.errorGeneric")}function Wt(){var L;ge({title:n("nav.getCredits",{currency:h.name}),noindex:!0});const d=ue(),{session:s,signIn:f}=fe(),o=me(),[m,b]=xe(),{packs:$,isLoading:y}=Ce(),[u,p]=l.useState("select"),[c,q]=l.useState(null),[j,E]=l.useState(null),de=(j!=null?(L=$.find(r=>r.credits===j))==null?void 0:L.artUrl:void 0)??Re,[ce,k]=l.useState(null),[le,R]=l.useState(!1),T=l.useRef(null);l.useEffect(()=>()=>{var r;return(r=T.current)==null?void 0:r.abort()},[]);const I=l.useCallback(()=>{b(r=>{const a=new URLSearchParams(r);return a.delete("order"),a.delete("canceled"),a},{replace:!0})},[b]),_=l.useCallback(async r=>{p("processing");const a=new AbortController;T.current=a;try{const x=await $e(r,{signal:a.signal,address:s==null?void 0:s.address,identity:s==null?void 0:s.identity});if(x.status==="credited"){const w=x.creditsGranted??(c==null?void 0:c.credits)??0;E(w>0?w:null),p("success"),g("Shop Completed Buy Credits",{order_id:r,pack_usd:(c==null?void 0:c.usd)??null,credits:w>0?w:null,provider:C}),o.invalidateQueries({queryKey:["usd-balance"]});try{if(sessionStorage.getItem(je)){const S={resumeCheckout:!0,...w>0?{creditsAdded:w}:{}};d("/cart",{state:S});return}}catch{}try{const S=sessionStorage.getItem(D);if(S){sessionStorage.removeItem(D);const M=JSON.parse(S),G=be(M);if(G){d(G,{state:{item:M,resumeBuy:!0}});return}}}catch{}}else x.status==="pending"?(g("Shop Buy Credits Pending",{step:"grant",pack_usd:(c==null?void 0:c.usd)??null}),o.invalidateQueries({queryKey:["usd-balance"]}),p("pending")):(g("Shop Buy Credits Failed",{step:"grant",error_code:"grant_failed",pack_usd:(c==null?void 0:c.usd)??null}),k(x.error??n("getCredits.errorGrant",{currency:h.name})),p("error"))}catch(x){U(x,{flow:"get_credits",step:"grant",order_id:r}),g("Shop Buy Credits Failed",{step:"grant",error_code:N(x),pack_usd:(c==null?void 0:c.usd)??null}),k(ie(x)),p("error")}},[c,s,o,d]),pe=l.useCallback(async r=>{if(!s){f();return}k(null),R(!1),q(r),p(C==="mock"?"processing":"redirecting"),g("Shop Started Buy Credits",{pack_usd:r.usd,credits:r.credits,provider:C});try{const a=await Se(r.id,{address:s.address,identity:s.identity});if(a.mock)_(a.orderId);else if(a.url)g("Shop Redirected To Stripe",{order_id:a.orderId,pack_usd:r.usd,credits:r.credits}),window.location.href=a.url;else throw new Error("Checkout did not return a redirect url")}catch(a){U(a,{flow:"get_credits",step:"checkout",provider:C}),g("Shop Buy Credits Failed",{step:"checkout",error_code:N(a),pack_usd:r.usd}),k(ie(a)),p("error")}},[s,f,_]),z=l.useRef(!1),W=l.useRef(null);l.useEffect(()=>{if(z.current)return;const r=m.get("order");if(m.get("canceled")!=null){z.current=!0,g("Shop Buy Credits Cancelled",{order_id:r,provider:C}),r&&s&&we(r,s.identity),I(),R(!0),p("select");return}r&&(p("processing"),s&&(z.current=!0,I(),_(r)))},[m,s]);function B(){var r;(r=T.current)==null||r.abort(),p("select"),q(null),E(null),k(null),R(!1)}function he(){const r=W.current;if(!r)return;const a=window.matchMedia("(prefers-reduced-motion: reduce)").matches;r.scrollIntoView({behavior:a?"auto":"smooth",block:"center"}),r.focus({preventScroll:!0})}return t.jsxs(_e,{children:[(u==="select"||u==="redirecting")&&t.jsxs(t.Fragment,{children:[t.jsx(ze,{"data-testid":"credits-hero",children:t.jsxs(Be,{children:[t.jsxs(qe,{$hidden:u==="redirecting",children:[t.jsxs(Ee,{children:[t.jsx(Ie,{children:n("getCredits.title")}),t.jsxs(We,{children:[t.jsx(Le,{children:n("getCredits.subtitle")}),t.jsx(Me,{type:"button",onClick:he,"data-testid":"credits-learn-more",children:n("getCredits.learnMore")})]})]}),le&&t.jsx(Ge,{role:"status",children:n("getCredits.canceledNote")}),t.jsx(At,{packs:$,loading:y,onSelect:r=>void pe(r)})]}),u==="redirecting"&&t.jsxs(et,{role:"status","aria-live":"polite",children:[t.jsx(nt,{src:Q,alt:"",width:72,height:72}),t.jsx(tt,{children:n("getCredits.redirecting")})]})]})}),t.jsx(Fe,{ref:W,tabIndex:-1,"data-testid":"credits-faq",children:t.jsx(ve,{title:"faq.title",entries:St,tone:"on-dark"})})]}),u==="processing"&&t.jsxs(rt,{role:"status","aria-live":"polite",children:[t.jsx(oe,{src:Q,alt:"",width:61,height:61}),t.jsxs(st,{children:[t.jsxs(ot,{children:[t.jsx("strong",{children:n("getCredits.processing")}),"…"]}),t.jsxs(at,{"aria-hidden":!0,children:[t.jsx(ct,{children:t.jsx(lt,{})}),t.jsx(pt,{children:"1/1"})]})]})]}),u==="success"&&t.jsxs(ht,{role:"status","aria-live":"polite",children:[t.jsx(ke,{}),t.jsxs(ut,{children:[t.jsx(xt,{src:Te,alt:"",width:60,height:60}),t.jsxs(gt,{children:[t.jsx("strong",{children:n("getCredits.successTitle")})," ",n("getCredits.successBody",{currency:h.name})]})]}),j!=null&&t.jsx(ft,{children:t.jsxs(mt,{children:[t.jsx(bt,{src:de,alt:"",width:93,height:93}),t.jsxs(wt,{children:[t.jsx(re,{}),t.jsxs("span",{children:[t.jsx(yt,{children:n("getCredits.creditsAmount",{credits:j,currency:h.name})})," ",t.jsx(kt,{children:n("getCredits.creditsAdded")})]})]})]})}),t.jsxs(vt,{children:[t.jsx(v,{"data-variant":"outline",onClick:B,children:n("getCredits.buyMore",{currency:h.name})}),t.jsx(v,{onClick:()=>d("/items"),children:n("getCredits.startShopping")})]})]}),u==="pending"&&t.jsxs(Z,{role:"status","aria-live":"polite",children:[t.jsx(J,{children:n("getCredits.pendingTitle",{currency:h.name})}),t.jsx(Je,{children:n("getCredits.pendingBody")}),t.jsxs(ee,{children:[t.jsx(v,{onClick:()=>d("/items"),children:n("getCredits.startShopping")}),t.jsx(v,{"data-variant":"outline",onClick:B,children:n("getCredits.done")})]})]}),u==="error"&&t.jsxs(Z,{role:"alert",children:[t.jsx(J,{"data-tone":"error",children:n("getCredits.errorTitle")}),t.jsx(Ct,{children:ce}),t.jsx(ee,{children:t.jsx(v,{onClick:B,children:n("getCredits.tryAgain")})})]})]})}function At({packs:d,loading:s,onSelect:f}){return s?t.jsx(
|
|
745
|
+
`,C=Ae()?"mock":"stripe",te=[A,A,ne,se],$t={pack_5:A,pack_10:A,pack_25:ne,pack_50:se};function ae(d,s){return $t[d.id]??te[s%te.length]}function jt(d,s){return d.artUrl??ae(d,s)}const St=[{question:"faq.buyers.whatAreQ",answer:"faq.buyers.whatAreA"},{question:"faq.buyers.whatCanIBuyQ",answer:"faq.buyers.whatCanIBuyA"},{question:"faq.buyers.whereBuyQ",answer:"faq.buyers.whereBuyA"},{question:"faq.buyers.whereUseQ",answer:"faq.buyers.whereUseA"},{question:"faq.buyers.expireQ",answer:"faq.buyers.expireA"},{question:"faq.buyers.transferQ",answer:"faq.buyers.transferA"}];function ie(d){const s=d;if((s==null?void 0:s.name)==="AbortError")return n("getCredits.errorCanceled");const f=((s==null?void 0:s.message)??"").toLowerCase();return f.includes("sign in")?n("getCredits.errorSignIn",{currency:h.name}):f.includes("timed out")?n("getCredits.errorTimeout",{currency:h.name}):n("getCredits.errorGeneric")}function Wt(){var L;ge({title:n("nav.getCredits",{currency:h.name}),noindex:!0});const d=ue(),{session:s,signIn:f}=fe(),o=me(),[m,b]=xe(),{packs:$,isLoading:y}=Ce(),[u,p]=l.useState("select"),[c,q]=l.useState(null),[j,E]=l.useState(null),de=(j!=null?(L=$.find(r=>r.credits===j))==null?void 0:L.artUrl:void 0)??Re,[ce,k]=l.useState(null),[le,R]=l.useState(!1),T=l.useRef(null);l.useEffect(()=>()=>{var r;return(r=T.current)==null?void 0:r.abort()},[]);const I=l.useCallback(()=>{b(r=>{const a=new URLSearchParams(r);return a.delete("order"),a.delete("canceled"),a},{replace:!0})},[b]),_=l.useCallback(async r=>{p("processing");const a=new AbortController;T.current=a;try{const x=await $e(r,{signal:a.signal,address:s==null?void 0:s.address,identity:s==null?void 0:s.identity});if(x.status==="credited"){const w=x.creditsGranted??(c==null?void 0:c.credits)??0;E(w>0?w:null),p("success"),g("Shop Completed Buy Credits",{order_id:r,pack_usd:(c==null?void 0:c.usd)??null,credits:w>0?w:null,provider:C}),o.invalidateQueries({queryKey:["usd-balance"]});try{if(sessionStorage.getItem(je)){const S={resumeCheckout:!0,...w>0?{creditsAdded:w}:{}};d("/cart",{state:S});return}}catch{}try{const S=sessionStorage.getItem(D);if(S){sessionStorage.removeItem(D);const M=JSON.parse(S),G=be(M);if(G){d(G,{state:{item:M,resumeBuy:!0}});return}}}catch{}}else x.status==="pending"?(g("Shop Buy Credits Pending",{step:"grant",pack_usd:(c==null?void 0:c.usd)??null}),o.invalidateQueries({queryKey:["usd-balance"]}),p("pending")):(g("Shop Buy Credits Failed",{step:"grant",error_code:"grant_failed",pack_usd:(c==null?void 0:c.usd)??null}),k(x.error??n("getCredits.errorGrant",{currency:h.name})),p("error"))}catch(x){U(x,{flow:"get_credits",step:"grant",order_id:r}),g("Shop Buy Credits Failed",{step:"grant",error_code:N(x),pack_usd:(c==null?void 0:c.usd)??null}),k(ie(x)),p("error")}},[c,s,o,d]),pe=l.useCallback(async r=>{if(!s){f();return}k(null),R(!1),q(r),p(C==="mock"?"processing":"redirecting"),g("Shop Started Buy Credits",{pack_usd:r.usd,credits:r.credits,provider:C});try{const a=await Se(r.id,{address:s.address,identity:s.identity});if(a.mock)_(a.orderId);else if(a.url)g("Shop Redirected To Stripe",{order_id:a.orderId,pack_usd:r.usd,credits:r.credits}),window.location.href=a.url;else throw new Error("Checkout did not return a redirect url")}catch(a){U(a,{flow:"get_credits",step:"checkout",provider:C}),g("Shop Buy Credits Failed",{step:"checkout",error_code:N(a),pack_usd:r.usd}),k(ie(a)),p("error")}},[s,f,_]),z=l.useRef(!1),W=l.useRef(null);l.useEffect(()=>{if(z.current)return;const r=m.get("order");if(m.get("canceled")!=null){z.current=!0,g("Shop Buy Credits Cancelled",{order_id:r,provider:C}),r&&s&&we(r,s.identity),I(),R(!0),p("select");return}r&&(p("processing"),s&&(z.current=!0,I(),_(r)))},[m,s]);function B(){var r;(r=T.current)==null||r.abort(),p("select"),q(null),E(null),k(null),R(!1)}function he(){const r=W.current;if(!r)return;const a=window.matchMedia("(prefers-reduced-motion: reduce)").matches;r.scrollIntoView({behavior:a?"auto":"smooth",block:"center"}),r.focus({preventScroll:!0})}return t.jsxs(_e,{children:[(u==="select"||u==="redirecting")&&t.jsxs(t.Fragment,{children:[t.jsx(ze,{"data-testid":"credits-hero",children:t.jsxs(Be,{children:[t.jsxs(qe,{$hidden:u==="redirecting",children:[t.jsxs(Ee,{children:[t.jsx(Ie,{children:n("getCredits.title")}),t.jsxs(We,{children:[t.jsx(Le,{children:n("getCredits.subtitle")}),t.jsx(Me,{type:"button",onClick:he,"data-testid":"credits-learn-more",children:n("getCredits.learnMore")})]})]}),le&&t.jsx(Ge,{role:"status",children:n("getCredits.canceledNote")}),t.jsx(At,{packs:$,loading:y,onSelect:r=>void pe(r)})]}),u==="redirecting"&&t.jsxs(et,{role:"status","aria-live":"polite",children:[t.jsx(nt,{src:Q,alt:"",width:72,height:72}),t.jsx(tt,{children:n("getCredits.redirecting")})]})]})}),t.jsx(Fe,{ref:W,tabIndex:-1,"data-testid":"credits-faq",children:t.jsx(ve,{title:"faq.title",entries:St,tone:"on-dark"})})]}),u==="processing"&&t.jsxs(rt,{role:"status","aria-live":"polite",children:[t.jsx(oe,{src:Q,alt:"",width:61,height:61}),t.jsxs(st,{children:[t.jsxs(ot,{children:[t.jsx("strong",{children:n("getCredits.processing")}),"…"]}),t.jsxs(at,{"aria-hidden":!0,children:[t.jsx(ct,{children:t.jsx(lt,{})}),t.jsx(pt,{children:"1/1"})]})]})]}),u==="success"&&t.jsxs(ht,{role:"status","aria-live":"polite",children:[t.jsx(ke,{}),t.jsxs(ut,{children:[t.jsx(xt,{src:Te,alt:"",width:60,height:60}),t.jsxs(gt,{children:[t.jsx("strong",{children:n("getCredits.successTitle")})," ",n("getCredits.successBody",{currency:h.name})]})]}),j!=null&&t.jsx(ft,{children:t.jsxs(mt,{children:[t.jsx(bt,{src:de,alt:"",width:93,height:93}),t.jsxs(wt,{children:[t.jsx(re,{}),t.jsxs("span",{children:[t.jsx(yt,{children:n("getCredits.creditsAmount",{credits:j,currency:h.name})})," ",t.jsx(kt,{children:n("getCredits.creditsAdded")})]})]})]})}),t.jsxs(vt,{children:[t.jsx(v,{"data-variant":"outline",onClick:B,children:n("getCredits.buyMore",{currency:h.name})}),t.jsx(v,{onClick:()=>d("/items"),children:n("getCredits.startShopping")})]})]}),u==="pending"&&t.jsxs(Z,{role:"status","aria-live":"polite",children:[t.jsx(J,{children:n("getCredits.pendingTitle",{currency:h.name})}),t.jsx(Je,{children:n("getCredits.pendingBody")}),t.jsxs(ee,{children:[t.jsx(v,{onClick:()=>d("/items"),children:n("getCredits.startShopping")}),t.jsx(v,{"data-variant":"outline",onClick:B,children:n("getCredits.done")})]})]}),u==="error"&&t.jsxs(Z,{role:"alert",children:[t.jsx(J,{"data-tone":"error",children:n("getCredits.errorTitle")}),t.jsx(Ct,{children:ce}),t.jsx(ee,{children:t.jsx(v,{onClick:B,children:n("getCredits.tryAgain")})})]})]})}function At({packs:d,loading:s,onSelect:f}){return s?t.jsx(K,{"aria-busy":"true","aria-label":n("getCredits.packsLoading",{currency:h.name}),children:[0,1,2,3].map(o=>t.jsxs(O,{as:"div","data-skeleton":"true","data-testid":"pack-skeleton","aria-hidden":!0,children:[t.jsxs(V,{children:[t.jsxs(X,{children:[t.jsx(Oe,{}),t.jsx(Ve,{})]}),t.jsx(Xe,{})]}),t.jsx(Ze,{})]},o))}):t.jsx(K,{children:d.map((o,m)=>{const b=Pe(o,d);return t.jsxs(O,{type:"button","data-testid":"pack","data-best":o.bestValue?"true":void 0,onClick:()=>f(o),"aria-label":b?n("getCredits.packAriaBonus",{amount:H(o.credits),usd:o.usd,bonus:b.bonus,baseline:b.baseline}):n("getCredits.packAria",{amount:H(o.credits),usd:o.usd}),children:[o.bestValue&&t.jsxs(Ue,{children:[t.jsx(ye,{name:"star-rounded"}),n("getCredits.packBadge")]}),t.jsxs(V,{children:[t.jsxs(X,{children:[t.jsxs(Ne,{children:[t.jsx(re,{}),t.jsx(Qe,{children:o.credits})]}),t.jsx(He,{children:n("getCredits.packUnit",{currency:h.name})})]}),t.jsx(De,{children:t.jsx("img",{src:jt(o,m),alt:"",loading:"lazy",width:507,height:507,onError:$=>{const y=$.currentTarget;y.dataset.artFallback||(y.dataset.artFallback="done",y.src=ae(o,m))}})})]}),t.jsxs(Ye,{children:["$",o.usd.toFixed(2)]})]},o.id)})})}export{Wt as GetCredits,Wt as default};
|