@dcl/shop 1.0.2-31061952187.commit-8d8b09e → 1.0.2-31075138109.commit-b4b8f60
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-D_fQdZon.js → Activity-CNizYJay.js} +29 -29
- package/_assets/{AnimatedBackground-C9W4RBcZ.js → AnimatedBackground-C1p4psE2.js} +2 -2
- package/_assets/Assets-BcQ10xPp.js +892 -0
- package/_assets/{Assets.styles-BBWJCcMx.js → Assets.styles-B9PWoIMZ.js} +80 -72
- package/_assets/{Authorizations-DVwQ95Ww.js → Authorizations-C_xGdM-p.js} +1 -1
- package/_assets/Cart-DYZGi78I.js +706 -0
- package/_assets/{CircularProgress-D09608yv.js → CircularProgress-B_hinbN9.js} +1 -1
- package/_assets/{Collection-DllncUVv.js → Collection-DTJYViBJ.js} +11 -11
- package/_assets/{CollectionCarousel-B9HmGuVb.js → CollectionCarousel-DZxVlfxf.js} +182 -126
- package/_assets/{Confetti-Dl6FT7nL.js → Confetti-mgEJ457s.js} +1 -1
- package/_assets/Creator-BVn3jG76.js +307 -0
- package/_assets/{ErrorNotice-OUNK486K.js → ErrorNotice-CCUuPON0.js} +1 -1
- package/_assets/{ExchangeController-Cp3qbfAM.js → ExchangeController-CXuE8lHA.js} +1 -1
- package/_assets/{Faq-DXtTtsuA.js → Faq-Bkcjo8OM.js} +1 -1
- package/_assets/{GetCredits-BhRNCaTG.js → GetCredits-Bq6LvsYg.js} +19 -12
- package/_assets/{Grow-DXdR0gI9.js → Grow-DBDllnzs.js} +1 -1
- package/_assets/{HelpersUtil-rQp5uDAx.js → HelpersUtil-CTTzLGBA.js} +1 -1
- package/_assets/ItemDetail-CBafDPtx.js +3552 -0
- package/_assets/JumpInIcon-CfzbSVBF.js +1 -0
- package/_assets/LazyEmoteControls-PQ3Pg2sc.js +2 -0
- package/_assets/{LoadMore-jSNRJiwZ.js → LoadMore-DY0yTnWX.js} +1 -1
- package/_assets/{ManaPricingBanner.styles-vDUAKLLe.js → ManaPricingBanner.styles-CLzKIrR0.js} +2 -2
- package/_assets/MyAssets-BuEVkMOy.js +396 -0
- package/_assets/{MyFavorites-BLrz2vwY.js → MyFavorites-5YJaSyop.js} +20 -17
- package/_assets/{NotFound-DP4nosOd.js → NotFound-1ks_XjFT.js} +1 -1
- package/_assets/{NotificationsBell-ARziPv8W.js → NotificationsBell-CPTnotbb.js} +1 -1
- package/_assets/{OutfitDetail-CLmuEgB3.js → OutfitDetail-N4whvhsJ.js} +12 -9
- package/_assets/{OutfitPreview-PWdXvCaE.js → OutfitPreview-D7BVurmj.js} +1 -1
- package/_assets/{OutfitStudio-Cx3Xm6ff.js → OutfitStudio-WKWXKKDM.js} +46 -46
- package/_assets/{StoreSettings-BQtEgWRm.js → StoreSettings-CDOaTUdX.js} +4 -4
- package/_assets/Success-CAR1N5YA.js +353 -0
- package/_assets/{SwapController-Bf58lQ6b.js → SwapController-DFi1XX34.js} +1 -1
- package/_assets/{Tooltip-BDmKiALz.js → Tooltip-Cwe0Yraw.js} +1 -1
- package/_assets/{TradeService-Yecm1OxI.js → TradeService-BaPRI5UX.js} +1 -1
- package/_assets/{W3MFrameProviderSingleton-BQyeyr-U.js → W3MFrameProviderSingleton-ZccF4Y9V.js} +3 -3
- package/_assets/{WebCryptoP256-Ou_F2OJp.js → WebCryptoP256-Jedmnano.js} +1 -1
- package/_assets/{authorizations-B3AvOvOm.js → authorizations-CAdQPCMI.js} +1 -1
- package/_assets/{basic-DTDRwam-.js → basic-D7xW8zKi.js} +1 -1
- package/_assets/{biconomy-DaLi1O64.js → biconomy-DSBuvNuK.js} +1 -1
- package/_assets/{builder-DxumJmKw.js → builder-0yNVIzVD.js} +1 -1
- package/_assets/{buy-gasless-BfTEWjT9.js → buy-gasless-BqufOfFB.js} +1 -1
- package/_assets/{buy-BHkfYJLe.js → buy-p0P2Zs7_.js} +1 -1
- package/_assets/{categories-D23W_J-A.js → categories-Q8-sA-ag.js} +73 -58
- package/_assets/{ccip-DGVhZCZ4.js → ccip-DARfTvaF.js} +1 -1
- package/_assets/{ccip-qhHiv1gU.js → ccip-DsdggBKA.js} +1 -1
- package/_assets/collectionPage.styles-DQbgY52P.js +32 -0
- package/_assets/{controller-DGtmLk4f.js → controller-Zsb3xV7z.js} +2 -2
- package/_assets/{core-BAqS3vu7.js → core-CkqGyNBY.js} +4 -4
- package/_assets/{createSvgIcon-Bm9nxGqG.js → createSvgIcon-CZWQfAYI.js} +2 -2
- package/_assets/{custom-MaGTnz7S.js → custom-Bxjd11Bv.js} +1 -1
- package/_assets/{data-capture-5Vi1cyBa.js → data-capture-C_h8eQxX.js} +1 -1
- package/_assets/{email-BG6hRXMo.js → email-CoonlLSw.js} +1 -1
- package/_assets/{embedded-wallet-CfnknCH8.js → embedded-wallet-CZSkNi4z.js} +1 -1
- package/_assets/{emotion-styled.browser.esm-CoxAZUrJ.js → emotion-styled.browser.esm-BbXohUUc.js} +1 -1
- package/_assets/{engine-nQGCV50K.js → engine-C7WUjAl2.js} +1 -1
- package/_assets/{errors-DZ_QWsza.js → errors-BUHoc-y5.js} +1 -1
- package/_assets/{estimate-l1-fee-CVpJ9ym5.js → estimate-l1-fee-UKT25sin.js} +1 -1
- package/_assets/{execute-DFvUDrLY.js → execute-CPTN8FKu.js} +2 -2
- package/_assets/{features-BXUedULM.js → features-D6748kEh.js} +1 -1
- package/_assets/{fetchTokenMetadata-CkQcnzmO.js → fetchTokenMetadata-CPl8yMoH.js} +2 -2
- package/_assets/{field.styles-PE4ZasC2.js → field.styles-dfnZT-br.js} +1 -1
- package/_assets/{get-ecosystem-wallet-info-CRLH8I6C.js → get-ecosystem-wallet-info-CUrAtQ3b.js} +1 -1
- package/_assets/{getBalance-CiV48JsZ.js → getBalance-CUN1GDsO.js} +1 -1
- package/_assets/{getNFT-CV3N9TTA.js → getNFT-BDJqqYqb.js} +1 -1
- package/_assets/{getNFT-C3ucNb89.js → getNFT-DFlqYNlO.js} +1 -1
- package/_assets/{grid.styles-hOZTJ80g.js → grid.styles-DODm717m.js} +1 -1
- package/_assets/{hashTypedData-gTABcRB5.js → hashTypedData-D3XiRshp.js} +1 -1
- package/_assets/{hashTypedData-BtF2J233.js → hashTypedData-bAoo1co0.js} +1 -1
- package/_assets/identity-icon-C8yAW_Gq.svg +8 -0
- package/_assets/{in-app-CSDr4Blb.js → in-app-Dx0lK6d1.js} +1 -1
- package/_assets/{in-app-wallet-calls-Crivl9zc.js → in-app-wallet-calls-H4N-BNbO.js} +1 -1
- package/_assets/{index-KWEbYeSY.js → index--4i0Lw-m.js} +1 -1
- package/_assets/{index-Cf-gi-Qq.js → index-1YcJ_AMk.js} +1 -1
- package/_assets/{index-CS27am7J.js → index-4jPZivXl.js} +1 -1
- package/_assets/{index-DgOiZShm.js → index-5tC1hlhU.js} +1 -1
- package/_assets/{index-HAEoS9R6.js → index-AaJs3SZg.js} +1 -1
- package/_assets/{index-BTDIKmoC.js → index-B8xkUObo.js} +1 -1
- package/_assets/{index-Bg_gOSx_.js → index-BBYOztfl.js} +1 -1
- package/_assets/{index-CGBg3yUz.js → index-BGKTqnNJ.js} +5 -5
- package/_assets/{index-Bs4LvV4K.js → index-BPiB7yPn.js} +2 -2
- package/_assets/{index-EKmmXx1j.js → index-BTVtZV-4.js} +1 -1
- package/_assets/{index-BBbwMaBz.js → index-BY8CUKv-.js} +1 -1
- package/_assets/{index-DKHMu0o3.js → index-BhTQhn8o.js} +1 -1
- package/_assets/{index-D7LYoLo4.js → index-BiAWEM1Y.js} +1 -1
- package/_assets/{index-DXRL-4ld.js → index-BpsSIJDP.js} +1 -1
- package/_assets/{index-CHf7lsmp.js → index-BzIFn1gg.js} +1 -1
- package/_assets/{index-DLFQdlEW.js → index-C-Qu30M3.js} +1 -1
- package/_assets/{index-C5Evg5sh.js → index-C1TeecjZ.js} +1 -1
- package/_assets/{index-hKv-BpxY.js → index-C3oB2anL.js} +1 -1
- package/_assets/{index-DnJJn52L.js → index-CA_IOkJ5.js} +1 -1
- package/_assets/{index-C7hpB9s1.js → index-CEwRybny.js} +3 -3
- package/_assets/{index-DoGz07sk.js → index-CKW9ikJj.js} +1 -1
- package/_assets/{index-qGMuaBIs.js → index-CLKXx6rf.js} +1 -1
- package/_assets/{index-D5eMvKb_.js → index-CPsldIhs.js} +1 -1
- package/_assets/{index-CHolIX6U.js → index-CcYSrQZB.js} +1 -1
- package/_assets/{index-DwX-9Zo4.js → index-Ci8wltbz.js} +1 -1
- package/_assets/{index-D769FdFr.js → index-CkTj0rBr.js} +1 -1
- package/_assets/{index-CmY0V0eX.js → index-Cwuc6_4X.js} +1 -1
- package/_assets/{index-BNBzDf6z.js → index-CzAnnYNM.js} +1 -1
- package/_assets/{index-Dp2641E3.js → index-D0g-gu9R.js} +1 -1
- package/_assets/{index-wRmEiTlP.js → index-D2Uzczc0.js} +2 -2
- package/_assets/{index-ClUPCoEW.js → index-DAnmGKDS.js} +1 -1
- package/_assets/{index-BYP7oMPZ.css → index-DB6GvbxL.css} +1 -1
- package/_assets/{index-CvwosU6Y.js → index-DFQi7e3d.js} +1 -1
- package/_assets/{index-UyXkCiLs.js → index-DGCl01Aq.js} +1 -1
- package/_assets/{index-C23D_vyT.js → index-DLa23Ln5.js} +1 -1
- package/_assets/{index-ItjVcw1b.js → index-DPvEn0Us.js} +1 -1
- package/_assets/{index-CkGO7qOd.js → index-DQTv184M.js} +1 -1
- package/_assets/{index-DSuiX4WG.js → index-DWpfZF5x.js} +1 -1
- package/_assets/{index-DKdQUEzy.js → index-Di8inWXw.js} +1 -1
- package/_assets/{index-S0X-BG2b.js → index-DidVPhMo.js} +1 -1
- package/_assets/{index-9_4ZEs3N.js → index-DmMEC2q9.js} +1 -1
- package/_assets/{index-DjTNPtj2.js → index-Ds0rafrR.js} +1 -1
- package/_assets/{index-CyRHowbs.js → index-DvCZhQ4M.js} +1 -1
- package/_assets/{index-DY1xBku2.js → index-DzcxBj5H.js} +1 -1
- package/_assets/{index-CwRTjZPC.js → index-FSR-tXEG.js} +3 -3
- package/_assets/{index-CKUuopSw.js → index-H0_FOTS1.js} +526 -451
- package/_assets/{index-1oceTWwb.js → index-IiqyrxDp.js} +3 -3
- package/_assets/{index-Dh85kccn.js → index-P6CBRm57.js} +1 -1
- package/_assets/{index-C0pcaEQl.js → index-bQcvt8Yc.js} +1 -1
- package/_assets/{index-DkV5TYom.js → index-eG9hxr4C.js} +1 -1
- package/_assets/{index-9x1mGBeU.js → index-gFP2sFjS.js} +1 -1
- package/_assets/{index-BniGBCAO.js → index-h6pTnuHR.js} +1 -1
- package/_assets/{index-DdmULNRk.js → index-xIqXdiX9.js} +2 -2
- package/_assets/{index.es-g_bB-nFv.js → index.es-Bezpyz9G.js} +1 -1
- package/_assets/{index.es-wpL2Ycto.js → index.es-C5RZM_Pw.js} +4 -4
- package/_assets/{index.es-DnMGDxtr.js → index.es-CfiB2nB-.js} +1 -1
- package/_assets/invite-icon-Bz6lCTuB.svg +11 -0
- package/_assets/{localBatchGatewayRequest-DtELSHiE.js → localBatchGatewayRequest-BEJ4F0kB.js} +1 -1
- package/_assets/{networks-ZmRqsvV6.js → networks-sj6IF-js.js} +1 -1
- package/_assets/{onramp-Bffl3qa3.js → onramp-BubqiUY-.js} +1 -1
- package/_assets/{openzeppelin-BmH-LNci.js → openzeppelin-Chy7gkut.js} +1 -1
- package/_assets/{parseNft-PSjb4qKi.js → parseNft-kgJMEL-I.js} +2 -2
- package/_assets/{parseSignature-D947kFfv.js → parseSignature-49G14sv1.js} +3 -3
- package/_assets/{parseSignature-IigTmAp7.js → parseSignature-CJ8NsFbD.js} +1 -1
- package/_assets/{passkeys-BsJVcpuM.js → passkeys-BvVbeMXS.js} +1 -1
- package/_assets/{pay-with-exchange-CU_HZd9F.js → pay-with-exchange-Cc0055L1.js} +1 -1
- package/_assets/{qr-overlay-EMShc5uE.js → qr-overlay-D10vlv1f.js} +1 -1
- package/_assets/{receive-CO6WElZa.js → receive-Cuwu3mHS.js} +1 -1
- package/_assets/{resolveImplementation-CUngPhAv.js → resolveImplementation-Dfj0L4Ai.js} +1 -1
- package/_assets/{rpc-BqH_VMy9.js → rpc-CnHNtgxw.js} +1 -1
- package/_assets/{secp256k1-CTsmRKJj.js → secp256k1-B3l9Rkyd.js} +1 -1
- package/_assets/{secp256k1-DneM3aYG.js → secp256k1-CR-cgYPx.js} +1 -1
- package/_assets/{secp256k1-D7kpLshE.js → secp256k1-Cc9GlXlU.js} +1 -1
- package/_assets/{send-DnwW2LgN.js → send-CsVYUzzr.js} +1 -1
- package/_assets/{send-batch-transaction-BgJnfEM8.js → send-batch-transaction-B6mk0_i_.js} +1 -1
- package/_assets/{send-eip712-transaction-Cw3ykz5y.js → send-eip712-transaction-BfUkLu-i.js} +2 -2
- package/_assets/{send-gasless-transaction-BjGhnCwR.js → send-gasless-transaction-BlLmbQ26.js} +2 -2
- package/_assets/{send-transaction-COKVeGfk.js → send-transaction-D0wENyPk.js} +2 -2
- package/_assets/{sendMetaTransaction-Bp3kwdLJ.js → sendMetaTransaction-CnhA6a-k.js} +1 -1
- package/_assets/{sendRawTransaction-eVli2oE3.js → sendRawTransaction-BsyxcfGv.js} +3 -3
- package/_assets/{serializeTransaction-CIM9i_-w.js → serializeTransaction-DVId8Rs6.js} +1 -1
- package/_assets/{session-proposal-KGl_Ah2b.js → session-proposal-DUVy-dyq.js} +1 -1
- package/_assets/{session-request-VAEXTksW.js → session-request-DSQfWHt6.js} +2 -2
- package/_assets/{signing-Cgx49_1X.js → signing-Bd6C4KXQ.js} +3 -3
- package/_assets/{skeleton.styles-BXNXDWEi.js → skeleton.styles-sGub2C43.js} +1 -1
- package/_assets/{socials-oKAOeF-k.js → socials-Bx-bKnd9.js} +1 -1
- package/_assets/{styled-pD_2hanx.js → styled-B8vpPdOK.js} +1 -1
- package/_assets/{swaps-BcAY_D99.js → swaps-BwNRCNkw.js} +1 -1
- package/_assets/{thirdweb-ChAqWFCO.js → thirdweb-bDUpez-k.js} +3 -3
- package/_assets/{to-serializable-transaction-D9qGbcrS.js → to-serializable-transaction-CrmYGVf0.js} +2 -2
- package/_assets/{transactionReceipt-BMw52z-f.js → transactionReceipt-Dwol6pvh.js} +1 -1
- package/_assets/{transactions-CeENvGIt.js → transactions-CJMbROug.js} +1 -1
- package/_assets/{useCreditPacks-BcavayJ3.js → useCreditPacks-D_gG97Vg.js} +1 -1
- package/_assets/{useImportable-CqnIvzif.js → useImportable-G1z46qnF.js} +1 -1
- package/_assets/{useInfiniteGrid-BjEQAabI.js → useInfiniteGrid-BHHEAbZ5.js} +1 -1
- package/_assets/{useTheme-BnnteKI4.js → useTheme-BxVqPd4e.js} +1 -1
- package/_assets/{verifyHash-CuRmy06R.js → verifyHash-BtpuSxEE.js} +1 -1
- package/_assets/{w3m-modal-CkBFH4cA.js → w3m-modal-BJMDIvH7.js} +1 -1
- package/_assets/{w3m-modal-BvOCJx7k.js → w3m-modal-Co4ZJh9U.js} +1 -1
- package/_assets/{wait-for-tx-receipt-B2KaPYJT.js → wait-for-tx-receipt-CKXB2fpc.js} +1 -1
- package/_assets/{wallets-CpXU08d2.js → wallets-BNoMqUPP.js} +5 -5
- package/_assets/{web-connector-BHRkWbB9.js → web-connector-DxsgtKod.js} +3 -3
- package/_assets/world-icon-6xQ-PmmW.svg +7 -0
- package/_assets/{writeContract-DNDGvg0r.js → writeContract-PCmQXj1B.js} +1 -1
- package/_assets/{zoraTestnet-CCn01jlp.js → zoraTestnet-sfJI3-xK.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/_assets/Assets-CvZql_4R.js +0 -866
- package/_assets/Cart-CBLHJRVj.js +0 -706
- package/_assets/Creator-BreBnKPX.js +0 -305
- package/_assets/ItemDetail-clRbfaLQ.js +0 -3551
- package/_assets/LazyEmoteControls-B7UYn8xk.js +0 -2
- package/_assets/MyAssets-CsWhc-qa.js +0 -381
- package/_assets/Success-BWfI3_Mu.js +0 -280
- package/_assets/collectionPage.styles-CoEdrsfq.js +0 -49
- package/_assets/governance-DnazlIjy.webp +0 -0
- package/_assets/identity-B4DXDuJP.webp +0 -0
- package/_assets/invite-BfwIhP2C.webp +0 -0
- package/_assets/world-B-9aPlxu.webp +0 -0
|
@@ -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-H0_FOTS1.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
|
/**
|
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
import{b as ce,j as e,L as Me,d as Ie,u as Be,r as L}from"./react-BYHuwl8r.js";import{u as Re}from"./useUrlFilters-DH-gxdfV.js";import{u as Ae,S as Y,R as Te,F as _e,e as ze}from"./categories-Q8-sA-ag.js";import{t as de,bF as We,P as Z,O as X,s,bG as De,J as Oe,bH as Ke,b as o,bI as Ge,bJ as ee,B as Ue,K as he,a1 as pe,bs as He,o as qe,D as ue,bz as Ve,bt as Je,bu as Qe,I as te,c as Ye,x as Ze,v as Xe,ac as et,an as tt,ao as ot,ap as M,aq as oe,bK as re,bL as rt}from"./index-H0_FOTS1.js";import{T as xe}from"./skeleton.styles-sGub2C43.js";import{d as it,P as st,C as at,a as nt,b as lt,c as ct,e as dt}from"./collectionPage.styles-DQbgY52P.js";import{g as ht,h as pt,i as ut,j as xt,k as mt,C as gt,l as ft,o as bt,m as wt,n as yt,M as vt,E as R,p as A,q as jt,r as Ct,s as kt,t as $t}from"./Assets.styles-B9PWoIMZ.js";import{L as ie}from"./LoadMore-DY0yTnWX.js";import{u as se}from"./useInfiniteGrid-BHHEAbZ5.js";import{E as T}from"./ErrorNotice-CCUuPON0.js";import{G as ae}from"./grid.styles-DODm717m.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";import"./Tooltip-Cwe0Yraw.js";function St(r){const{gridLoading:i,gridError:a,gridCount:l,baselinePending:c,baselineError:d,baselineCount:b}=r;return i?"skeletons":a?"error":l>0?"items":c?"skeletons":d?"error":b===0?"no-creations":"filters"}const{colors:w,radius:me,media:Nt}=de,Et=s.article`
|
|
2
|
+
height: 300px;
|
|
3
|
+
/* No fill of its own (Figma 922:183803): the mosaic covers the top and the footer paints its own
|
|
4
|
+
translucent black, so the page field is what shows through the corners. */
|
|
5
|
+
background: transparent;
|
|
6
|
+
border-radius: ${me.card};
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
position: relative;
|
|
9
|
+
isolation: isolate;
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
cursor: pointer;
|
|
13
|
+
transition: box-shadow 0.15s ease;
|
|
14
|
+
|
|
15
|
+
&::after {
|
|
16
|
+
${We};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&:focus-visible {
|
|
20
|
+
${Z};
|
|
21
|
+
}
|
|
22
|
+
&:focus-visible::after {
|
|
23
|
+
${X};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// The swap is a pointer affordance only: keyboard focus must not hide the creator row, whose profile
|
|
27
|
+
// link is focusable (visibility: hidden would drop it from the tab order). Enter/Space on the card
|
|
28
|
+
// already opens the collection.
|
|
29
|
+
@media (hover: hover) {
|
|
30
|
+
&:hover {
|
|
31
|
+
${Z};
|
|
32
|
+
}
|
|
33
|
+
&:hover::after {
|
|
34
|
+
${X};
|
|
35
|
+
}
|
|
36
|
+
&:hover [data-view] {
|
|
37
|
+
visibility: visible;
|
|
38
|
+
}
|
|
39
|
+
&:hover [data-meta] {
|
|
40
|
+
visibility: hidden;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
`,Pt=s.div`
|
|
44
|
+
position: relative;
|
|
45
|
+
flex: 1;
|
|
46
|
+
min-height: 0;
|
|
47
|
+
background: ${w.media};
|
|
48
|
+
overflow: hidden;
|
|
49
|
+
`,Ft=s.img`
|
|
50
|
+
width: 100%;
|
|
51
|
+
height: 100%;
|
|
52
|
+
object-fit: cover;
|
|
53
|
+
display: block;
|
|
54
|
+
`,Lt=s(De)`
|
|
55
|
+
& [data-testid='coll-thumb-cell'] img {
|
|
56
|
+
object-fit: contain;
|
|
57
|
+
padding: 10px;
|
|
58
|
+
}
|
|
59
|
+
`,Mt=s.div`
|
|
60
|
+
flex: 0 0 102px;
|
|
61
|
+
height: 102px;
|
|
62
|
+
padding: 12px 12px 16px 16px;
|
|
63
|
+
display: flex;
|
|
64
|
+
flex-direction: column;
|
|
65
|
+
gap: 8px;
|
|
66
|
+
background: ${w.overlay};
|
|
67
|
+
`,It=s.h3`
|
|
68
|
+
margin: 0;
|
|
69
|
+
font-weight: 700;
|
|
70
|
+
font-size: 16px;
|
|
71
|
+
line-height: 1.6;
|
|
72
|
+
color: ${w.white};
|
|
73
|
+
white-space: nowrap;
|
|
74
|
+
overflow: hidden;
|
|
75
|
+
text-overflow: ellipsis;
|
|
76
|
+
|
|
77
|
+
${Nt.maxWidth("mobile")} {
|
|
78
|
+
font-size: 16px;
|
|
79
|
+
}
|
|
80
|
+
`,Bt=s.div`
|
|
81
|
+
flex: 1;
|
|
82
|
+
min-height: 0;
|
|
83
|
+
display: grid;
|
|
84
|
+
grid-template-areas: 'stack';
|
|
85
|
+
align-items: center;
|
|
86
|
+
|
|
87
|
+
& > * {
|
|
88
|
+
grid-area: stack;
|
|
89
|
+
}
|
|
90
|
+
`,Rt=s.div`
|
|
91
|
+
display: flex;
|
|
92
|
+
align-items: center;
|
|
93
|
+
justify-content: space-between;
|
|
94
|
+
gap: 10px;
|
|
95
|
+
`,At=s(Oe)`
|
|
96
|
+
min-width: 0;
|
|
97
|
+
color: ${w.gray4};
|
|
98
|
+
|
|
99
|
+
& [data-avatar] {
|
|
100
|
+
width: 24px;
|
|
101
|
+
height: 24px;
|
|
102
|
+
}
|
|
103
|
+
& [data-testid='creator-name'] {
|
|
104
|
+
font-size: 14px;
|
|
105
|
+
}
|
|
106
|
+
& [data-testid='creator-display'] {
|
|
107
|
+
color: ${w.white};
|
|
108
|
+
font-weight: 600;
|
|
109
|
+
}
|
|
110
|
+
`,Tt=s.span`
|
|
111
|
+
min-width: 0;
|
|
112
|
+
`,_t=s.span`
|
|
113
|
+
flex: none;
|
|
114
|
+
color: ${w.gray4};
|
|
115
|
+
font-weight: 600;
|
|
116
|
+
font-size: 14px;
|
|
117
|
+
white-space: nowrap;
|
|
118
|
+
`,zt=s.button`
|
|
119
|
+
visibility: hidden;
|
|
120
|
+
width: 100%;
|
|
121
|
+
height: 46px;
|
|
122
|
+
display: flex;
|
|
123
|
+
align-items: center;
|
|
124
|
+
justify-content: center;
|
|
125
|
+
background: ${w.overlay};
|
|
126
|
+
color: ${w.softWhite};
|
|
127
|
+
border: 0;
|
|
128
|
+
border-radius: ${me.card};
|
|
129
|
+
font-weight: 600;
|
|
130
|
+
font-size: 13px;
|
|
131
|
+
line-height: 24px;
|
|
132
|
+
text-transform: uppercase;
|
|
133
|
+
letter-spacing: 0.46px;
|
|
134
|
+
transition: background 0.15s ease;
|
|
135
|
+
|
|
136
|
+
&:hover,
|
|
137
|
+
&:active {
|
|
138
|
+
background: ${w.text2};
|
|
139
|
+
}
|
|
140
|
+
`;function Wt({collection:r,cover:i,itemCount:a}){const l=ce(),{contractAddress:c,name:d,creator:b}=r,j=i==null||a==null,{data:n}=Ke(c,j),g=i==null?(n==null?void 0:n.items)??[]:[],f=a??(n==null?void 0:n.total);function h(){l(`/collection/${c}`)}return e.jsxs(Et,{"data-testid":"coll-card",role:"link",tabIndex:0,onClick:h,onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),h())},children:[e.jsx(Pt,{children:i?e.jsx(Ft,{"data-testid":"coll-card-img",src:i,alt:"",loading:"lazy"}):g.length>0?e.jsx(Lt,{items:g,tinted:!1}):null}),e.jsxs(Mt,{children:[e.jsx(It,{title:d,children:d}),e.jsxs(Bt,{children:[e.jsxs(Rt,{"data-meta":!0,"data-testid":"coll-card-meta",children:[b?e.jsx(At,{address:b,linkToProfile:!0}):e.jsx(Tt,{children:" "}),e.jsx(_t,{"data-testid":"coll-card-count","aria-busy":f==null||void 0,children:f==null?e.jsx(xe,{className:"skeleton",width:54,"data-testid":"coll-card-count-skeleton","aria-hidden":!0}):o("collectionCard.itemCount",{count:f})})]}),e.jsx(zt,{"data-view":!0,"data-testid":"coll-card-view",onClick:u=>{u.stopPropagation(),h()},tabIndex:-1,children:o("collectionCard.viewCollection")})]})]})]})}function Dt({address:r,className:i=""}){const a=Ge(),l=ee(d=>d.followed.includes(r.toLowerCase())),c=ee(d=>d.toggle);return!a||!r?null:e.jsx(Ue,{type:"button",size:"sm",variant:l?"ghost":"outline",className:i||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:y,radius:ge,media:v}=de,fe=he`
|
|
141
|
+
display: inline-flex;
|
|
142
|
+
align-items: center;
|
|
143
|
+
justify-content: center;
|
|
144
|
+
height: 40px;
|
|
145
|
+
padding: 0 28px;
|
|
146
|
+
border-radius: ${ge.btn};
|
|
147
|
+
background: rgba(0, 0, 0, 0.5);
|
|
148
|
+
color: ${y.white};
|
|
149
|
+
font-weight: 600;
|
|
150
|
+
font-size: 13px;
|
|
151
|
+
text-transform: uppercase;
|
|
152
|
+
letter-spacing: 0.046em;
|
|
153
|
+
text-decoration: none;
|
|
154
|
+
`,Ot=s.section`
|
|
155
|
+
position: relative;
|
|
156
|
+
border-radius: ${ge.card};
|
|
157
|
+
overflow: hidden;
|
|
158
|
+
margin-bottom: 24px;
|
|
159
|
+
min-height: 360px;
|
|
160
|
+
display: flex;
|
|
161
|
+
align-items: center;
|
|
162
|
+
justify-content: center;
|
|
163
|
+
|
|
164
|
+
&& .creator-hero__follow {
|
|
165
|
+
${fe};
|
|
166
|
+
}
|
|
167
|
+
&& .creator-hero__follow:hover:not(:disabled) {
|
|
168
|
+
background: ${y.blackBtn};
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
${v.maxWidth("mobile")} {
|
|
172
|
+
min-height: 260px;
|
|
173
|
+
}
|
|
174
|
+
`,Kt=s.div`
|
|
175
|
+
position: absolute;
|
|
176
|
+
inset: 0;
|
|
177
|
+
z-index: 0;
|
|
178
|
+
`,Gt=s.img`
|
|
179
|
+
width: 100%;
|
|
180
|
+
height: 100%;
|
|
181
|
+
object-fit: cover;
|
|
182
|
+
display: block;
|
|
183
|
+
`,Ut=s.div`
|
|
184
|
+
position: absolute;
|
|
185
|
+
inset: 0;
|
|
186
|
+
background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.5) 100%);
|
|
187
|
+
`,Ht=s.div`
|
|
188
|
+
position: absolute;
|
|
189
|
+
top: 16px;
|
|
190
|
+
right: 16px;
|
|
191
|
+
z-index: 2;
|
|
192
|
+
display: flex;
|
|
193
|
+
align-items: center;
|
|
194
|
+
gap: 8px;
|
|
195
|
+
|
|
196
|
+
${v.maxWidth("mobile")} {
|
|
197
|
+
top: 12px;
|
|
198
|
+
right: 12px;
|
|
199
|
+
gap: 6px;
|
|
200
|
+
}
|
|
201
|
+
`,be=he`
|
|
202
|
+
display: flex;
|
|
203
|
+
align-items: center;
|
|
204
|
+
justify-content: center;
|
|
205
|
+
color: ${y.white};
|
|
206
|
+
transition: opacity 0.15s linear;
|
|
207
|
+
|
|
208
|
+
&:hover {
|
|
209
|
+
opacity: 0.8;
|
|
210
|
+
}
|
|
211
|
+
& .ico {
|
|
212
|
+
width: 36px;
|
|
213
|
+
height: 36px;
|
|
214
|
+
}
|
|
215
|
+
${v.maxWidth("mobile")} {
|
|
216
|
+
& .ico {
|
|
217
|
+
width: 30px;
|
|
218
|
+
height: 30px;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
`,qt=s.a`
|
|
222
|
+
${be};
|
|
223
|
+
`,Vt=s(Me)`
|
|
224
|
+
${be};
|
|
225
|
+
width: 32px;
|
|
226
|
+
height: 32px;
|
|
227
|
+
border-radius: 50%;
|
|
228
|
+
border: 2px solid ${y.white};
|
|
229
|
+
transition: background-color 0.15s linear;
|
|
230
|
+
|
|
231
|
+
&:hover {
|
|
232
|
+
opacity: 1;
|
|
233
|
+
background: rgba(255, 255, 255, 0.24);
|
|
234
|
+
}
|
|
235
|
+
& .ico {
|
|
236
|
+
width: 16px;
|
|
237
|
+
height: 16px;
|
|
238
|
+
}
|
|
239
|
+
${v.maxWidth("mobile")} {
|
|
240
|
+
width: 28px;
|
|
241
|
+
height: 28px;
|
|
242
|
+
& .ico {
|
|
243
|
+
width: 14px;
|
|
244
|
+
height: 14px;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
`,Jt=s.div`
|
|
248
|
+
position: relative;
|
|
249
|
+
z-index: 1;
|
|
250
|
+
display: flex;
|
|
251
|
+
flex-direction: column;
|
|
252
|
+
align-items: center;
|
|
253
|
+
text-align: center;
|
|
254
|
+
gap: 24px;
|
|
255
|
+
padding: 40px 20px;
|
|
256
|
+
|
|
257
|
+
${v.maxWidth("mobile")} {
|
|
258
|
+
padding: 56px 16px 24px;
|
|
259
|
+
}
|
|
260
|
+
`,ne=s.img`
|
|
261
|
+
display: block;
|
|
262
|
+
width: 112px;
|
|
263
|
+
height: 112px;
|
|
264
|
+
border-radius: 50%;
|
|
265
|
+
object-fit: cover;
|
|
266
|
+
border: 4px solid ${y.white};
|
|
267
|
+
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
|
|
268
|
+
background: #ff4bed;
|
|
269
|
+
|
|
270
|
+
${v.maxWidth("mobile")} {
|
|
271
|
+
width: 88px;
|
|
272
|
+
height: 88px;
|
|
273
|
+
}
|
|
274
|
+
`,Qt=s.h2`
|
|
275
|
+
margin: 0;
|
|
276
|
+
font-size: 18px;
|
|
277
|
+
font-weight: 700;
|
|
278
|
+
color: ${y.white};
|
|
279
|
+
line-height: 1.6;
|
|
280
|
+
|
|
281
|
+
${v.maxWidth("mobile")} {
|
|
282
|
+
font-size: 16px;
|
|
283
|
+
}
|
|
284
|
+
`,Yt=s.p`
|
|
285
|
+
margin: 0;
|
|
286
|
+
font-size: 15px;
|
|
287
|
+
color: ${y.white};
|
|
288
|
+
line-height: 1.6;
|
|
289
|
+
max-width: 520px;
|
|
290
|
+
|
|
291
|
+
${v.maxWidth("mobile")} {
|
|
292
|
+
font-size: 14px;
|
|
293
|
+
}
|
|
294
|
+
`,Zt=s.div`
|
|
295
|
+
display: flex;
|
|
296
|
+
align-items: center;
|
|
297
|
+
gap: 12px;
|
|
298
|
+
flex-wrap: wrap;
|
|
299
|
+
justify-content: center;
|
|
300
|
+
`,Xt=s.a`
|
|
301
|
+
${fe};
|
|
302
|
+
transition: background 0.15s ease;
|
|
303
|
+
|
|
304
|
+
&:hover {
|
|
305
|
+
background: ${y.blackBtn};
|
|
306
|
+
}
|
|
307
|
+
`,eo={website:"website",twitter:"twitter",discord:"discord",facebook:"facebook"};function to({address:r}){var u,C;const{data:i}=pe(r),{data:a}=He(r),l=qe(x=>{var $;return($=x.session)==null?void 0:$.address}),c=!!l&&l.toLowerCase()===r.toLowerCase(),d=(i==null?void 0:i.name)||ue(r),b=(C=(u=i==null?void 0:i.avatar)==null?void 0:u.snapshots)==null?void 0:C.face256,j=(a==null?void 0:a.cover)||it,n=a==null?void 0:a.description,g=`${Ye.profileUrl}/${r}`,f=Ve.filter(x=>a==null?void 0:a.links[x]),h=Je(Qe({name:i==null?void 0:i.name,hasClaimedName:i==null?void 0:i.hasClaimedName,ethAddress:(i==null?void 0:i.ethAddress)??r}));return e.jsxs(Ot,{"aria-label":`${d} storefront`,children:[e.jsxs(Kt,{children:[e.jsx(Gt,{src:j,alt:"",loading:"eager"}),e.jsx(Ut,{"aria-hidden":!0})]}),(f.length>0||c)&&e.jsxs(Ht,{children:[f.map(x=>e.jsx(qt,{"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(te,{name:eo[x]})},x)),c&&e.jsx(Vt,{to:"/store-settings",title:o("creator.editStore"),"aria-label":o("creator.editStore"),children:e.jsx(te,{name:"pen"})})]}),e.jsxs(Jt,{children:[b?e.jsx(ne,{src:b,alt:"",loading:"eager",style:{backgroundColor:h}}):e.jsx(ne,{as:"span","aria-hidden":!0,style:{backgroundColor:h}}),e.jsxs("div",{children:[e.jsx(Qt,{children:d}),n?e.jsx(Yt,{children:n}):null]}),e.jsxs(Zt,{children:[e.jsx(Xt,{"data-testid":"creator-hero-view",href:g,target:"_blank",rel:"noopener noreferrer",children:o("creator.viewProfile")}),e.jsx(Dt,{address:r,className:"creator-hero__follow"})]})]})]})}const oo=["all","on_sale","not_for_sale"],le=48;function yo(){var J,Q;const{address:r}=Ie(),i=ce(),[a]=Be(),l=a.has("collections"),{data:c}=pe(r),d=(c==null?void 0:c.name)||(r?ue(r):o("creator.fallbackName"));Ze({title:d,description:o("seo.creator.description",{name:d}),image:(Q=(J=c==null?void 0:c.avatar)==null?void 0:J.snapshots)==null?void 0:Q.face256});const b=L.useMemo(()=>({category:"all",status:"all",subCategory:null,rarities:[],priceMin:"",priceMax:"",smart:!1,sort:"newest"}),[]),[j,n]=Re(b),{category:g,subCategory:f,rarities:h,priceMin:u,priceMax:C,smart:x,sort:$}=j,S=oo.includes(j.status)?j.status:"all",_=t=>n({status:t});Ae(`${l}:${g}:${f??""}`);const[E,N]=L.useState(!1);L.useEffect(()=>{if(!E)return;const t=Le=>{Le.key==="Escape"&&N(!1)};document.addEventListener("keydown",t);const m=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",t),document.body.style.overflow=m}},[E]);const z=u&&!Number.isNaN(Number(u))?Number(u):void 0,W=C&&!Number.isNaN(Number(C))?Number(C):void 0,we=f?ze[f]:void 0,ye=(Y.find(t=>t.key===$)??Y[0]).server,D={creator:r,category:g,rarities:h.length?h:void 0,wearableCategories:we,minPriceCredits:z,maxPriceCredits:W,isWearableSmart:x||void 0,isOnSale:S==="all"?void 0:S==="on_sale",sortBy:ye},{items:I,total:ve,isLoading:je,isPlaceholderData:Ce,error:O,hasNextPage:ke,isFetchingNextPage:K,isFetchNextPageError:$e,fetchNextPage:Se}=se(["creator-items",D],t=>re({...D,first:le,skip:t}),{enabled:!!r&&!l}),P=Xe({queryKey:["creator-item-count",r],queryFn:()=>re({creator:r,first:1}).then(t=>t.total),enabled:!!r}),p=se(["creator-collections",r],t=>rt(r,{first:le,skip:t}).then(m=>({items:m.collections,total:m.total})),{enabled:!!r&&l});function G(t){n({category:t,subCategory:null},{drop:l?["collections"]:void 0})}function Ne(){const t=new URLSearchParams(a);t.delete("collections");const m=t.toString();i({search:m?`?${m}`:""},{replace:!0})}function Ee(){if(l){Ne();return}const t=new URLSearchParams(a);t.delete("collections");const m=t.toString();i({search:m?`?${m}&collections`:"?collections"},{replace:!0})}function U(t){n({rarities:h.includes(t)?h.filter(m=>m!==t):[...h,t]})}function H(){n(b)}const k=[];(g==="wearable"||g==="emote")&&k.push({key:"category",label:o(g==="emote"?"categories.emotes":"categories.wearables"),onRemove:()=>G("all")}),(z!=null||W!=null)&&k.push({key:"price",label:o("filter.price"),onRemove:()=>{n({priceMin:"",priceMax:""})}});for(const t of Te)h.includes(t)&&k.push({key:`rarity-${t}`,label:et(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:()=>_("all")});const F=St({gridLoading:je||Ce,gridError:!!O,gridCount:I.length,baselinePending:P.isPending,baselineError:P.isError,baselineCount:P.data}),q=F==="skeletons",{data:V}=tt(),Pe=L.useMemo(()=>I.map(t=>({...t,priceCredits:ot(t,V)})),[I,V]),Fe=t=>t.priceCredits>0||!!t.manaWei,B=F==="items"||F==="skeletons"?null:F;return e.jsxs(st,{children:[e.jsxs(at,{"aria-label":o("creator.breadcrumbAria"),children:[e.jsx(nt,{onClick:()=>i("/items"),children:o("creator.breadcrumb")}),e.jsx("span",{children:"/"}),e.jsx(lt,{children:d})]}),r?e.jsx(to,{address:r}):null,e.jsxs(ht,{children:[E?e.jsx(pt,{onClick:()=>N(!1),"aria-hidden":!0}):null,e.jsxs(ut,{"data-open":E||void 0,"data-testid":"creator-sidebar",children:[e.jsxs(xt,{children:[e.jsx(mt,{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:G,onSub:t=>n({subCategory:t}),priceMin:u,priceMax:C,onPriceMin:t=>n({priceMin:t}),onPriceMax:t=>n({priceMax:t}),rarities:h,onToggleRarity:U,status:S,onStatus:_,smart:x,onSmart:t=>n({smart:t}),hideNames:!0,collections:l,onCollections:Ee})}),e.jsx(wt,{children:e.jsx(yt,{type:"button",onClick:()=>N(!1),children:o("assets.showItems")})})]}),e.jsx(vt,{children:l?e.jsxs(e.Fragment,{children:[e.jsx(ct,{children:e.jsx(dt,{"data-testid":"creator-collections-count","aria-busy":p.isLoading||void 0,children:p.isLoading?e.jsx(xe,{className:"skeleton",width:72,"data-testid":"creator-collections-count-skeleton","aria-hidden":!0}):o("creator.collectionsCount",{count:p.total})})}),p.error?e.jsx(T,{message:o("creator.error")}):null,e.jsx(ae,{"data-variant":"collections",children:p.isLoading?e.jsx(M,{count:9}):e.jsxs(e.Fragment,{children:[p.items.map(t=>e.jsx(Wt,{collection:t,itemCount:t.itemCount},t.contractAddress)),p.isFetchingNextPage?e.jsx(M,{count:6}):null]})}),e.jsx(ie,{hasNextPage:p.hasNextPage,isFetching:p.isFetchingNextPage,isError:p.isFetchNextPageError,onLoadMore:()=>void p.fetchNextPage()}),!p.isLoading&&!p.error&&p.items.length===0?e.jsx(R,{children:e.jsx(A,{children:o("creator.collectionsEmpty")})}):null]}):e.jsxs(e.Fragment,{children:[e.jsx(_e,{sort:$,onSort:t=>n({sort:t}),total:ve,loading:q,onOpenFilters:()=>N(!0),chips:k,onClearChips:H}),O?e.jsx(T,{message:o("creator.error"),testId:"creator-error"}):null,e.jsx(ae,{"data-testid":"creator-grid",children:q?e.jsx(M,{count:15}):e.jsxs(e.Fragment,{children:[Pe.map(t=>Fe(t)?e.jsx(oe,{item:t},t.id):e.jsx(oe,{item:t,mode:"view"},t.id)),K?e.jsx(M,{count:6}):null]})}),e.jsx(ie,{hasNextPage:ke,isFetching:K,isError:$e,onLoadMore:()=>void Se()}),B==="error"?e.jsx(T,{message:o("creator.error"),testId:"creator-empty-error"}):B==="no-creations"?e.jsx(R,{children:e.jsx(A,{"data-testid":"creator-empty-none",children:o("creator.emptyNoCreations")})}):B==="filters"?e.jsxs(jt,{"data-testid":"creator-empty-filters",children:[e.jsxs(R,{children:[e.jsx(Ct,{children:o("creator.emptyFilters.title")}),e.jsx(A,{children:o("creator.emptyFilters.body",{count:P.data??0})})]}),e.jsx(kt,{children:e.jsx($t,{type:"button",onClick:H,children:o("filterBar.clearAll")})})]}):null]})})]})]})}export{yo as Creator,yo 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-H0_FOTS1.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-ZccF4Y9V.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-CEwRybny.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-H0_FOTS1.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,Z 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,Z as g,aE as be,F as U,aO as N,bV as we,ax as Q,z as re,I as ye,bW as H}from"./index-H0_FOTS1.js";import{C as ke}from"./Confetti-mgEJ457s.js";import{F as ve}from"./Faq-Bkcjo8OM.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-D_gG97Vg.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.2-31075138109.commit-b4b8f60/_assets/pack-coins-BDh1ZDbh.webp",ne="https://cdn.decentraland.org/@dcl/shop/1.0.2-31075138109.commit-b4b8f60/_assets/pack-stacks-D-V2jSHW.webp",se="https://cdn.decentraland.org/@dcl/shop/1.0.2-31075138109.commit-b4b8f60/_assets/pack-chest-BX_j84xW.webp",Re="https://cdn.decentraland.org/@dcl/shop/1.0.2-31075138109.commit-b4b8f60/_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",O="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
|
+
`,V=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: ${O};
|
|
205
205
|
-webkit-mask-composite: xor;
|
|
206
|
-
mask: ${
|
|
206
|
+
mask: ${O};
|
|
207
207
|
mask-composite: exclude;
|
|
208
208
|
transition: opacity 0.15s ease;
|
|
209
209
|
}
|
|
@@ -299,7 +299,7 @@ import{b as ue,u as xe,r as l,j as t}from"./react-BYHuwl8r.js";import{s as i,t a
|
|
|
299
299
|
height: 18px;
|
|
300
300
|
}
|
|
301
301
|
}
|
|
302
|
-
`,
|
|
302
|
+
`,Y=i.span`
|
|
303
303
|
align-self: stretch;
|
|
304
304
|
display: flex;
|
|
305
305
|
flex-direction: column;
|
|
@@ -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
|
+
`,Oe=i.span`
|
|
389
389
|
display: flex;
|
|
390
390
|
align-items: center;
|
|
391
391
|
justify-content: center;
|
|
@@ -423,7 +423,14 @@ 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
|
+
|
|
427
|
+
${e.media.maxWidth("mobile")} {
|
|
428
|
+
background: ${e.colors.white};
|
|
429
|
+
color: ${e.colors.text2};
|
|
430
|
+
font-size: 16px;
|
|
431
|
+
font-weight: 800;
|
|
432
|
+
}
|
|
433
|
+
`,Ke=F`
|
|
427
434
|
to {
|
|
428
435
|
background-position: -200% 0;
|
|
429
436
|
}
|
|
@@ -436,12 +443,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
443
|
rgba(255, 255, 255, 0.08) 70%
|
|
437
444
|
);
|
|
438
445
|
background-size: 200% 100%;
|
|
439
|
-
animation: ${
|
|
446
|
+
animation: ${Ke} 1.4s infinite linear;
|
|
440
447
|
|
|
441
448
|
@media (prefers-reduced-motion: reduce) {
|
|
442
449
|
animation: none;
|
|
443
450
|
}
|
|
444
|
-
`,
|
|
451
|
+
`,Ve=i(P)`
|
|
445
452
|
width: 60%;
|
|
446
453
|
height: 30px;
|
|
447
454
|
border-radius: ${e.radius.chip};
|
|
@@ -449,7 +456,7 @@ import{b as ue,u as xe,r as l,j as t}from"./react-BYHuwl8r.js";import{s as i,t a
|
|
|
449
456
|
${e.media.maxWidth("mobile")} {
|
|
450
457
|
height: 24px;
|
|
451
458
|
}
|
|
452
|
-
`,
|
|
459
|
+
`,Ye=i(P)`
|
|
453
460
|
width: 36%;
|
|
454
461
|
height: 15px;
|
|
455
462
|
border-radius: ${e.radius.chip};
|
|
@@ -742,4 +749,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
749
|
margin: 0;
|
|
743
750
|
font-family: ${e.font.sans};
|
|
744
751
|
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(
|
|
752
|
+
`,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(V,{as:"div","data-skeleton":"true","data-testid":"pack-skeleton","aria-hidden":!0,children:[t.jsxs(Y,{children:[t.jsxs(X,{children:[t.jsx(Ve,{}),t.jsx(Ye,{})]}),t.jsx(Xe,{})]}),t.jsx(Ze,{})]},o))}):t.jsx(K,{children:d.map((o,m)=>{const b=Pe(o,d);return t.jsxs(V,{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(Y,{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(Oe,{children:["$",o.usd.toFixed(2)]})]},o.id)})})}export{Wt as GetCredits,Wt as default};
|