@dcl/shop 0.5.1-30942936446.commit-2065145 → 0.5.1-30944558724.commit-19fdddf
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-tm1GZBBE.js +357 -0
- package/_assets/{AnimatedBackground-D_NOZUsv.js → AnimatedBackground-PdNi-WfR.js} +2 -2
- package/_assets/Assets-DzU3XKtW.js +800 -0
- package/_assets/{Assets.styles-Dwkb-T-5.js → Assets.styles-ZM8Q2cFA.js} +1 -1
- package/_assets/{Authorizations-CwdWUCCN.js → Authorizations-BxBoJzQm.js} +7 -7
- package/_assets/{Cart-DJd7mRPw.js → Cart-CoA_J4Zn.js} +17 -17
- package/_assets/{CircularProgress-QCFQ5Q0T.js → CircularProgress-iDUU-7Dd.js} +5 -5
- package/_assets/{Collection-Du05-cah.js → Collection-DUnvQ9xs.js} +8 -8
- package/_assets/{CollectionCarousel-CzK6Sr6O.js → CollectionCarousel-nQamkKEm.js} +15 -15
- package/_assets/{Creator-9YR9zS8U.js → Creator-Dgszo59r.js} +11 -11
- package/_assets/{ErrorNotice-B-k-8lgH.js → ErrorNotice-CfA5EQ3B.js} +1 -1
- package/_assets/{ExchangeController-CgsMU6Of.js → ExchangeController-CdHvmoRP.js} +1 -1
- package/_assets/{GetCredits-BWKjSlQH.js → GetCredits-Dv4OnlPr.js} +16 -16
- package/_assets/{HelpersUtil-C9JEsHd1.js → HelpersUtil-DL3ySOBk.js} +1 -1
- package/_assets/{ItemDetail-ByJH66Dr.js → ItemDetail-B2_NA3qK.js} +15 -15
- package/_assets/{LoadMore-CDsECC_S.js → LoadMore-TnqPM5W_.js} +2 -2
- package/_assets/ManaPricingBanner.styles-C7faS-HZ.js +74 -0
- package/_assets/{MenuList-DniyjKZf.js → MenuList-DLBo9vKa.js} +1 -1
- package/_assets/{MyAssets-Cn5OcKcq.js → MyAssets-D-1HxNtf.js} +2 -2
- package/_assets/{MyFavorites-Dh3ERS1g.js → MyFavorites-27Kg0fu-.js} +1 -1
- package/_assets/NotFound-CF-eOmVc.js +13 -0
- package/_assets/{NotificationsBell-BWFTNvfH.js → NotificationsBell-BADWC1wN.js} +1 -1
- package/_assets/{OutfitDetail-C-O6ZG_T.js → OutfitDetail-CdadHpaC.js} +10 -10
- package/_assets/{OutfitPreview-3ZYOvLqd.js → OutfitPreview-JIaMYiWg.js} +2 -2
- package/_assets/{OutfitStudio-CdH7v1-f.js → OutfitStudio-D-Tn3MZ0.js} +17 -17
- package/_assets/{StoreSettings-ZBAETVqr.js → StoreSettings-5uZXoOvP.js} +7 -7
- package/_assets/{Success-Dcdg4j1H.js → Success-C4laQ6DO.js} +5 -5
- package/_assets/{SwapController-CJCQ0dFg.js → SwapController-h8IVGbcS.js} +1 -1
- package/_assets/{Tooltip-POp1BJ4y.js → Tooltip-ySlzdfvH.js} +1 -1
- package/_assets/{TradeService-CQMOkya7.js → TradeService-C_mQXbkZ.js} +1 -1
- package/_assets/{W3MFrameProviderSingleton-kdy7Kyep.js → W3MFrameProviderSingleton-Be2imJ8Z.js} +3 -3
- package/_assets/{WebCryptoP256-CmT290Aw.js → WebCryptoP256-I4V1QbUv.js} +1 -1
- package/_assets/{authorizations-CWm7pvjk.js → authorizations-D7XuRQgn.js} +1 -1
- package/_assets/{basic-2wXayEjj.js → basic-Cue7GVXe.js} +1 -1
- package/_assets/{biconomy-CrUwmLLN.js → biconomy-C-omatJP.js} +1 -1
- package/_assets/{builder-D3s6Xcg_.js → builder-MQPY8ChB.js} +1 -1
- package/_assets/buy-DGpUz8hz.js +1 -0
- package/_assets/{buy-gasless-D2u0Cuie.js → buy-gasless-Bl-OulBV.js} +1 -1
- package/_assets/{categories-CD0l2-IJ.js → categories-BQKh49D5.js} +1 -1
- package/_assets/{ccip-Bq7op_u4.js → ccip-BC-JPxWw.js} +1 -1
- package/_assets/{ccip-Dt-VmUCH.js → ccip-Yik4EQGY.js} +1 -1
- package/_assets/{clsx-BZmZfIZ7.js → clsx-Df3CFyaE.js} +2 -2
- package/_assets/{collectionPage.styles-DnFAUb4Q.js → collectionPage.styles-vmTcFGbQ.js} +8 -8
- package/_assets/{controller-DAvNn45R.js → controller-Bq2L0AX1.js} +2 -2
- package/_assets/{core-UWabPMJx.js → core-lz2OIs0H.js} +4 -4
- package/_assets/{createSvgIcon-B4LAM6aP.js → createSvgIcon-bfaHZSjd.js} +3 -3
- package/_assets/{custom-BjZ8TeJA.js → custom-DYDi3MJe.js} +1 -1
- package/_assets/{data-capture-CJaTah4x.js → data-capture-Y8xGExqA.js} +1 -1
- package/_assets/{email-nvRgEzbl.js → email-UTvBfzjL.js} +1 -1
- package/_assets/{embedded-wallet-m5nVefBN.js → embedded-wallet-hF59IEhH.js} +1 -1
- package/_assets/{emotion-styled.browser.esm-SPt1g8r5.js → emotion-styled.browser.esm-D23S089l.js} +1 -1
- package/_assets/{engine-BQ30rMc_.js → engine-CgRM_THA.js} +1 -1
- package/_assets/{errors-sEfj_aGG.js → errors-Wm6SH4-v.js} +1 -1
- package/_assets/{estimate-l1-fee-D55ttM53.js → estimate-l1-fee-DZHVdg7h.js} +1 -1
- package/_assets/{execute-20WfUFta.js → execute-BPgoblAE.js} +2 -2
- package/_assets/{features-B3g5o6I9.js → features-DYTS35jX.js} +1 -1
- package/_assets/{fetchTokenMetadata-C3taocSg.js → fetchTokenMetadata-BxGNbM_2.js} +2 -2
- package/_assets/{field.styles-Cv8EF1LN.js → field.styles-Bys6wE0V.js} +1 -1
- package/_assets/{get-ecosystem-wallet-info-C87cJBZ0.js → get-ecosystem-wallet-info-xvSXu74j.js} +1 -1
- package/_assets/{getBalance-DJFj4nll.js → getBalance-DLxh2RuD.js} +1 -1
- package/_assets/{getNFT-Db40YAe5.js → getNFT-BOSh5H84.js} +1 -1
- package/_assets/{getNFT-n1rLq0y8.js → getNFT-K4qjxWNY.js} +1 -1
- package/_assets/{getThemeProps-qixq943T.js → getThemeProps-mxNIag6l.js} +1 -1
- package/_assets/{grid.styles-V4B-yWuT.js → grid.styles-BaFKxOV8.js} +1 -1
- package/_assets/{hashTypedData-DmKA2WyG.js → hashTypedData-Bje_1GNe.js} +1 -1
- package/_assets/{hashTypedData-Cph7l-wN.js → hashTypedData-CCvvyerQ.js} +1 -1
- package/_assets/{in-app-BrwiASGV.js → in-app-DBzemWmV.js} +1 -1
- package/_assets/{in-app-wallet-calls-Cdw4VCOK.js → in-app-wallet-calls-CeM3dz7A.js} +1 -1
- package/_assets/{index-Bvu9JQbk.js → index--BUBq145.js} +1 -1
- package/_assets/{index-DmqmHJz0.js → index-9pYsulOA.js} +1 -1
- package/_assets/{index-BzlgQIWc.js → index-B-PyHfEF.js} +1 -1
- package/_assets/{index-Dfq9MSrW.js → index-B1WnOG_n.js} +3 -3
- package/_assets/{index-CpvNbkCX.js → index-B4iL_Vxm.js} +1 -1
- package/_assets/{index-BfbRuC2a.js → index-BCyVn8MQ.js} +1 -1
- package/_assets/{index-DSgPAG74.js → index-BIXkfL0f.js} +1 -1
- package/_assets/{index-B3dN6jXl.js → index-BKSx9kmy.js} +1 -1
- package/_assets/{index-fTx5OxT5.js → index-BNbfWSl_.js} +3 -3
- package/_assets/{index-jUw3qf0Z.js → index-BT9bqwmo.js} +1 -1
- package/_assets/{index-BqZsCXiJ.js → index-BW-7rl1w.js} +1 -1
- package/_assets/{index-BSYdl9Ph.js → index-BY-2ttcm.js} +1 -1
- package/_assets/{index-BvvXUkGO.js → index-BgL4tnd6.js} +1 -1
- package/_assets/{index-D8CMDKuk.js → index-BhRssk62.js} +1 -1
- package/_assets/{index-C_tTx02v.js → index-BwBZg-Cg.js} +1 -1
- package/_assets/{index-CMIeiz8J.js → index-C1hTWDfF.js} +1 -1
- package/_assets/{index-gMS2owiI.js → index-C6jx_7vf.js} +1 -1
- package/_assets/{index-CfQEZ4_J.js → index-C8VruoUX.js} +1 -1
- package/_assets/{index-Db25kjW1.js → index-CFUHl0Ma.js} +1 -1
- package/_assets/{index-CwkhI0tX.js → index-CJWQK5Lk.js} +1 -1
- package/_assets/{index-DxNuVfUW.js → index-CNwyt0TH.js} +1 -1
- package/_assets/{index-DfEcY6V7.js → index-COC826L7.js} +1 -1
- package/_assets/{index-BKV20Nhl.js → index-CTSAk3HZ.js} +1 -1
- package/_assets/{index-TLObYCeZ.js → index-CW0DN1u5.js} +1 -1
- package/_assets/{index-CuRsH7Jr.js → index-C_KycN_b.js} +1 -1
- package/_assets/{index-OIDpRQ7d.js → index-Cdnlri5M.js} +1 -1
- package/_assets/{index-qh5KEihJ.js → index-Cj0IFSYI.js} +1 -1
- package/_assets/{index-BZJRlKJd.js → index-Cx-FPP2C.js} +1 -1
- package/_assets/{index-BwJOXIY2.js → index-D1ncAmsg.js} +1 -1
- package/_assets/{index-B0GXKjok.js → index-D3a3O8EH.js} +1 -1
- package/_assets/{index-CoJ4w6mI.js → index-D5drugU6.js} +1 -1
- package/_assets/{index-DtXZOCTH.js → index-D7A-L9p9.js} +1 -1
- package/_assets/{index-DjwAceSs.js → index-DCdXL8QX.js} +2 -2
- package/_assets/{index-DtpiUbDD.js → index-DFaB3PXW.js} +1 -1
- package/_assets/{index-DI6lxGl3.js → index-DGDemPnB.js} +1 -1
- package/_assets/{index-tRBG96tO.js → index-DKr33OKQ.js} +1 -1
- package/_assets/{index-D90TiSbn.js → index-DMSY746R.js} +1 -1
- package/_assets/{index-BN6xB09s.js → index-DRJlDsJB.js} +1 -1
- package/_assets/{index-NZryii06.js → index-DZrXtOiH.js} +1 -1
- package/_assets/{index-B1ZZ9eYb.js → index-D_9mpAb0.js} +2 -2
- package/_assets/index-DaQaTpvn.js +3315 -0
- package/_assets/{index-Pc_h8OVk.js → index-DvkKq-3d.js} +1 -1
- package/_assets/{index-BEHNdwPO.js → index-Iqpx-phg.js} +13 -13
- package/_assets/{index-BG81Ew07.js → index-MZdslMn6.js} +1 -1
- package/_assets/{index-sBdhGti_.js → index-TvUj9AoT.js} +1 -1
- package/_assets/{index-aOM-5o2s.js → index-VpH-lUJq.js} +1 -1
- package/_assets/{index-fLV7Ojeb.js → index-WvEbTnHu.js} +1 -1
- package/_assets/{index-DQzoGDIO.js → index-Ypo9phAp.js} +2 -2
- package/_assets/{index-DHvFGs-V.js → index-cFnHRMx4.js} +2 -2
- package/_assets/{index-dV4DRjLe.js → index-fzBQEY_W.js} +1 -1
- package/_assets/{index-Dvh_4N8m.js → index-sofR0AzT.js} +1 -1
- package/_assets/{index-BuxC7_jg.js → index-vt25O9Am.js} +3 -3
- package/_assets/{index.es-Pw8SRe4y.js → index.es-B9ErMvUj.js} +4 -4
- package/_assets/{index.es-CX9AxHdS.js → index.es-DuthVFnh.js} +1 -1
- package/_assets/{index.es-J0I60DQn.js → index.es-rx-DH5wv.js} +1 -1
- package/_assets/{localBatchGatewayRequest-CprCDfDl.js → localBatchGatewayRequest-D_WhElUc.js} +1 -1
- package/_assets/{networks-BR41WM8b.js → networks-CjrnWm_p.js} +1 -1
- package/_assets/{onramp-BHoU1j8h.js → onramp-DTvBwKCe.js} +1 -1
- package/_assets/{openzeppelin-C3R3Ow9P.js → openzeppelin-C06zmVod.js} +1 -1
- package/_assets/{parseNft-HXsYyGMT.js → parseNft-CWL0AW1h.js} +2 -2
- package/_assets/{parseSignature-CfegJHxn.js → parseSignature-5VH_Alnl.js} +1 -1
- package/_assets/{parseSignature-B55K-BHw.js → parseSignature-C5YgXtpR.js} +3 -3
- package/_assets/{passkeys-BLEVv9is.js → passkeys-DiZlNP-q.js} +1 -1
- package/_assets/{pay-with-exchange-BDPb0fmB.js → pay-with-exchange-CNm1xvZ5.js} +1 -1
- package/_assets/{qr-overlay-Bn5u1TXh.js → qr-overlay-CpgjTugW.js} +1 -1
- package/_assets/{receive-DdEXjtdG.js → receive-CV4TgE-L.js} +1 -1
- package/_assets/{resolveImplementation-BTny85ZN.js → resolveImplementation-XYPJYD3T.js} +1 -1
- package/_assets/{rpc-C1vRekft.js → rpc-tLuHrGBn.js} +1 -1
- package/_assets/{secp256k1-BS_DtXn_.js → secp256k1-CDI-iBc2.js} +1 -1
- package/_assets/{secp256k1-DSewH7p4.js → secp256k1-CYEZP9R3.js} +1 -1
- package/_assets/{secp256k1-DjcGt-hf.js → secp256k1-CpiwnyMt.js} +1 -1
- package/_assets/{send-D36Kc8ar.js → send-D5VuBzPD.js} +1 -1
- package/_assets/{send-batch-transaction-9UPtmXhF.js → send-batch-transaction-BfHXn227.js} +1 -1
- package/_assets/{send-eip712-transaction-C-DlyYI4.js → send-eip712-transaction-t0wYgXj7.js} +2 -2
- package/_assets/{send-gasless-transaction-Clkbkp81.js → send-gasless-transaction-CgmsaSdY.js} +2 -2
- package/_assets/{send-transaction-ac0pElET.js → send-transaction-CrLGC-De.js} +2 -2
- package/_assets/{sendMetaTransaction-3Orn7mPE.js → sendMetaTransaction-ef-RXWfu.js} +1 -1
- package/_assets/{sendRawTransaction-Bd_d0DGd.js → sendRawTransaction-pS6CHcTu.js} +3 -3
- package/_assets/{serializeTransaction-tReIGWJj.js → serializeTransaction-KCGr6qFd.js} +1 -1
- package/_assets/{session-proposal-BGjlVk7r.js → session-proposal-sRmaUsXb.js} +1 -1
- package/_assets/{session-request-BAHn4jIb.js → session-request-CfwKiBxF.js} +2 -2
- package/_assets/{signing-BO2fbGm6.js → signing-DBbUwPle.js} +3 -3
- package/_assets/{socials-rfvGwJ98.js → socials-MOf37RiI.js} +1 -1
- package/_assets/{swaps-D7QVUfQw.js → swaps-bmMgRWV4.js} +1 -1
- package/_assets/{thirdweb-BdoDApEi.js → thirdweb--zGmSCRq.js} +3 -3
- package/_assets/{to-serializable-transaction-DJoSj0cy.js → to-serializable-transaction-DjbT77eY.js} +2 -2
- package/_assets/{trade-encoding-CitD9riU.js → trade-encoding-wpCgB2Av.js} +1 -1
- package/_assets/{transactionReceipt-CFvIhGab.js → transactionReceipt-CweRPSQa.js} +1 -1
- package/_assets/{transactions-BCaw00-L.js → transactions-dtEdgAGt.js} +1 -1
- package/_assets/useCreditPacks-CzOCruPU.js +1 -0
- package/_assets/useImportable-rrKOGrr4.js +1 -0
- package/_assets/{useInfiniteGrid-Crt1jGuz.js → useInfiniteGrid-XDOQyPRq.js} +1 -1
- package/_assets/useTheme-DGv_oEh8.js +1 -0
- package/_assets/{verifyHash-CONBvy81.js → verifyHash-CvfcirkG.js} +1 -1
- package/_assets/{w3m-modal-CmgRQ0lu.js → w3m-modal-BGA4lQKq.js} +1 -1
- package/_assets/{w3m-modal-DTboZx41.js → w3m-modal-PufzUctO.js} +1 -1
- package/_assets/{wait-for-tx-receipt-IG8mDnzG.js → wait-for-tx-receipt-0VbbjxzA.js} +1 -1
- package/_assets/{wallets-YFeaNJbJ.js → wallets-BopYfWq7.js} +5 -5
- package/_assets/{web-connector-CnAC5kme.js → web-connector-BSV6ourQ.js} +3 -3
- package/_assets/{writeContract-C-4vi3wG.js → writeContract-CCNcKbN2.js} +1 -1
- package/_assets/{zoraTestnet-BAdd9yw6.js → zoraTestnet-DJdUGbFi.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/_assets/Activity-DKyyVjF3.js +0 -357
- package/_assets/Assets-B-QxXzVp.js +0 -800
- package/_assets/ManaPricingBanner.styles-CBM3_pCR.js +0 -74
- package/_assets/NotFound-BLRVVTj-.js +0 -13
- package/_assets/buy-DH_c8xtw.js +0 -1
- package/_assets/index-BmdBaCyf.js +0 -3315
- package/_assets/mana-convert-DjCFeoQ3.js +0 -1
- package/_assets/useCreditPacks-DI0sJyEs.js +0 -1
- package/_assets/useImportable-B6LfqPpp.js +0 -1
- package/_assets/useManaRate-CVF6TzHy.js +0 -1
- package/_assets/useTheme-DDT9I-Gr.js +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,
|
|
1
|
+
import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,d as g,x as k,av as j,bC as C,e as G,q as Y,I as Q,D as X,g as W,C as B,a as Z,a1 as q,c3 as F,ah as J}from"./index-DaQaTpvn.js";import{s as ee,i as U,A as H,g as D,r as te,m as ne,c as ae,M as ie,e as oe}from"./authorizations-D7XuRQgn.js";import{i as se}from"./errors-Wm6SH4-v.js";import{E as re}from"./ErrorNotice-CfA5EQ3B.js";import{a as ce}from"./buy-DGpUz8hz.js";import{g as de,a as le}from"./trade-encoding-wpCgB2Av.js";import{s as pe,M as he,E as ue}from"./sendMetaTransaction-ef-RXWfu.js";import{I as xe,C as ge}from"./ethers-CtNGBird.js";const R="shop:resume_after_signin",fe=900*1e3;function dt(a){try{sessionStorage.setItem(R,JSON.stringify({...a,at:Date.now()}))}catch{}}function lt(a){let n;try{n=sessionStorage.getItem(R)}catch{return null}if(!n)return null;try{sessionStorage.removeItem(R)}catch{}let i;try{i=JSON.parse(n)}catch{return null}return!i||i.type!==a||typeof i.at!="number"||Date.now()-i.at>fe?null:i.type==="cart-checkout"?{type:"cart-checkout"}:{type:"item-buy",path:i.path}}function me(a,n){return(a+n-1n)/n}function be(a,n,i){return a<=0||n<=0?0n:a>=n?i:me(i*BigInt(a),BigInt(n))}function pt(a){var b,y,w;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,s=a.priceManaWei>0n?a.priceManaWei:0n,l=a.manaBalanceWei>0n?a.manaBalanceWei:0n;if(n<=0)return{options:[],preferred:null,manaShortfall:null};const c=[];if(i>=n&&c.push({method:"credits",creditsCents:n,manaWei:0n}),s>0n&&i>0&&i<n){const d=n-i,f=be(d,n,s);l>=f&&c.push({method:"combined",creditsCents:i,manaWei:f})}s>0n&&l>=s&&c.push({method:"mana",creditsCents:0,manaWei:s});const p=((b=c.find(d=>d.method==="credits"))==null?void 0:b.method)??((y=c.find(d=>d.method==="combined"))==null?void 0:y.method)??((w=c.find(d=>d.method==="mana"))==null?void 0:w.method)??null,m=!c.some(d=>d.method==="mana"||d.method==="combined")&&s>0n&&l>0n?{manaWei:l,manaCents:ye(l,n,s),priceCents:n}:null;return{options:c,preferred:p,manaShortfall:m}}function ye(a,n,i){return Number(a*BigInt(n)/i)}function ht(a,n){let i=Number.isFinite(n)?Math.max(0,Math.trunc(n)):0;return a.map(s=>{const l=Number.isFinite(s)?Math.max(0,Math.trunc(s)):0,c=Math.min(l,i);return i-=c,c})}function M(a){return Number.isFinite(a)?Math.max(0,a)/10:0}function ut(a,n){return a.options.find(i=>i.method===n)??null}function xt(a,n){if(!Number.isFinite(a)||a<=0||n<=0n)return null;const i=a/10;return Number(n)/1e18/i}const T="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",we=e.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: 12px;
|
|
5
5
|
align-items: stretch;
|
|
6
6
|
width: 100%;
|
|
7
|
-
`,
|
|
7
|
+
`,_=`
|
|
8
8
|
width: 100%;
|
|
9
9
|
min-height: 56px;
|
|
10
10
|
display: flex;
|
|
@@ -36,14 +36,14 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,b as g,q as
|
|
|
36
36
|
cursor: default;
|
|
37
37
|
}
|
|
38
38
|
`,ve=e.button`
|
|
39
|
-
${
|
|
39
|
+
${_}
|
|
40
40
|
background: ${o.gradients.amethyst};
|
|
41
41
|
|
|
42
42
|
&:hover:not(:disabled) {
|
|
43
43
|
filter: brightness(1.08);
|
|
44
44
|
}
|
|
45
45
|
`,N=e.button`
|
|
46
|
-
${
|
|
46
|
+
${_}
|
|
47
47
|
background: ${o.colors.text2};
|
|
48
48
|
|
|
49
49
|
&:hover:not(:disabled) {
|
|
@@ -248,7 +248,7 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,b as g,q as
|
|
|
248
248
|
outline: 2px solid ${o.colors.accent};
|
|
249
249
|
outline-offset: 2px;
|
|
250
250
|
}
|
|
251
|
-
`,
|
|
251
|
+
`,De=e.button`
|
|
252
252
|
flex: 1 1 0;
|
|
253
253
|
display: inline-flex;
|
|
254
254
|
align-items: center;
|
|
@@ -278,7 +278,7 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,b as g,q as
|
|
|
278
278
|
outline: 2px solid ${o.colors.accent};
|
|
279
279
|
outline-offset: 2px;
|
|
280
280
|
}
|
|
281
|
-
`,
|
|
281
|
+
`,Ke=e.span`
|
|
282
282
|
width: 16px;
|
|
283
283
|
height: 16px;
|
|
284
284
|
border-radius: 50%;
|
|
@@ -289,10 +289,10 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,b as g,q as
|
|
|
289
289
|
@media (prefers-reduced-motion: reduce) {
|
|
290
290
|
animation: none;
|
|
291
291
|
}
|
|
292
|
-
`;function mt({auth:a,signer:n,title:i,reason:s,name:l,image:c,icon:p,onAuthorized:h,onCancel:m,onClose:b}){const[y,w]=v.useState(!1),[d,f]=v.useState(null);async function $(){w(!0),f(null);try{await ee({auth:a,signer:n,active:!0}),h()}catch(u){se(u)?f(g("authorizeStep.errorRejected")):(X(u,{flow:"authorize_step",kind:a.kind}),f(g("authorizeStep.errorGeneric"))),w(!1)}}return t.jsx(ze,{onClick:y?void 0:b,role:"presentation",children:t.jsxs(Ae,{onClick:u=>u.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":i,children:[t.jsxs(We,{children:[t.jsx(Ie,{children:i}),t.jsx(Se,{onClick:b,disabled:y,"aria-label":g("authorizeStep.close"),children:t.jsx(Q,{name:"close",className:"ico"})})]}),t.jsxs(Te,{"data-testid":"authorize-step-row",children:[t.jsx(Ne,{children:c?t.jsx("img",{src:c,alt:""}):p}),t.jsxs(Ee,{children:[t.jsx(Be,{title:l,children:l}),t.jsx(Re,{children:s})]})]}),t.jsx(Le,{children:g("authorizeStep.note")}),t.jsx(re,{message:d}),t.jsxs(Pe,{children:[t.jsx(Fe,{type:"button",onClick:m,disabled:y,children:g("authorizeStep.cancel")}),t.jsx(
|
|
292
|
+
`;function mt({auth:a,signer:n,title:i,reason:s,name:l,image:c,icon:p,onAuthorized:h,onCancel:m,onClose:b}){const[y,w]=v.useState(!1),[d,f]=v.useState(null);async function $(){w(!0),f(null);try{await ee({auth:a,signer:n,active:!0}),h()}catch(u){se(u)?f(g("authorizeStep.errorRejected")):(X(u,{flow:"authorize_step",kind:a.kind}),f(g("authorizeStep.errorGeneric"))),w(!1)}}return t.jsx(ze,{onClick:y?void 0:b,role:"presentation",children:t.jsxs(Ae,{onClick:u=>u.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":i,children:[t.jsxs(We,{children:[t.jsx(Ie,{children:i}),t.jsx(Se,{onClick:b,disabled:y,"aria-label":g("authorizeStep.close"),children:t.jsx(Q,{name:"close",className:"ico"})})]}),t.jsxs(Te,{"data-testid":"authorize-step-row",children:[t.jsx(Ne,{children:c?t.jsx("img",{src:c,alt:""}):p}),t.jsxs(Ee,{children:[t.jsx(Be,{title:l,children:l}),t.jsx(Re,{children:s})]})]}),t.jsx(Le,{children:g("authorizeStep.note")}),t.jsx(re,{message:d}),t.jsxs(Pe,{children:[t.jsx(Fe,{type:"button",onClick:m,disabled:y,children:g("authorizeStep.cancel")}),t.jsx(De,{type:"button","data-testid":"authorize-step-action",onClick:()=>void $(),disabled:y,children:y?t.jsxs(t.Fragment,{children:[t.jsx(Ke,{"aria-hidden":!0}),g("authorizeStep.authorizing")]}):g("authorizeStep.authorize")})]})]})})}async function bt(a){const[n]=await Qe({...a,trades:[a.trade]});return n}async function Qe(a){const{trades:n,buyer:i,signer:s,onSigned:l}=a;if(n.length===0)throw new Error("No items to buy");const c=new Map;for(const h of n){const m=`${h.chainId}:${h.contract.toLowerCase()}`,b=c.get(m);b?b.push(h):c.set(m,[h])}const p=[];for(const h of c.values())p.push(await Ue({trades:h,buyer:i,signer:s,onSigned:l}));return p}async function Ue(a){const{trades:n,buyer:i,signer:s,onSigned:l}=a,c=n[0],p=W(Z(c.contract),c.chainId),h=W(B.MANAToken,c.chainId);await U({auth:{kind:H.Allowance,contractAddress:h.address,spenderAddress:p.address,chainId:c.chainId},signer:s});const m=n.map(d=>de(d,i));if(D.enabled)try{const d=new xe(p.abi).encodeFunctionData("accept",[m]),f=te(),$=ne(s.provider,f),u=await pe($,f,d,p,{serverURL:D.relayerUrl});return l==null||l(),await ae(u,"the MANA purchase"),u}catch(d){if(d instanceof he&&d.code===ue.USER_DENIED||d instanceof ie)throw d;console.warn("[buyWithMana] gasless meta-tx failed, falling back to a direct tx:",d)}await oe(s.provider,c.chainId);const y=await new ge(p.address,p.abi,s).accept(m,le(c.chainId));return l==null||l(),(await y.wait()).transactionHash}async function yt(a){const{trade:n,buyer:i,signer:s,credits:l,manaGapWei:c,onBroadcast:p,onReverted:h}=a;if(l.length===0)throw new Error("No credits to spend — use buyWithMana for a MANA-only purchase");if(c<=0n)throw new Error("No MANA gap to cover — use buyWithCredits for a credits-only purchase");const m=W(B.MANAToken,n.chainId),b=W(B.CreditsManager,n.chainId);await U({auth:{kind:H.Allowance,contractAddress:m.address,spenderAddress:b.address,chainId:n.chainId},signer:s});const w=(l.reduce((d,f)=>d+BigInt(f.availableAmount),0n)+c).toString();return ce({trade:n,buyer:i,signer:s,credits:l,maxCreditedValue:w,onBroadcast:p,onReverted:h})}function wt(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.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":!0,...a,children:[t.jsx("path",{d:"M12 3L2 20h20L12 3z",fill:"none",stroke:"#691fa9",strokeWidth:"1.8",strokeLinejoin:"round"}),t.jsx("path",{d:"M12 9v5",stroke:"#691fa9",strokeWidth:"1.8",strokeLinecap:"round"}),t.jsx("circle",{cx:"12",cy:"17",r:"1.1",fill:"#691fa9"})]})}const{colors:r,gradients:O,radius:V,z:He}=o,kt=e.div`
|
|
293
293
|
position: fixed;
|
|
294
294
|
inset: 0;
|
|
295
|
-
z-index: ${
|
|
295
|
+
z-index: ${He.overlay};
|
|
296
296
|
display: flex;
|
|
297
297
|
overflow-y: auto;
|
|
298
298
|
padding: 20px;
|
|
@@ -436,11 +436,11 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,b as g,q as
|
|
|
436
436
|
font-weight: 600;
|
|
437
437
|
color: ${r.text2};
|
|
438
438
|
}
|
|
439
|
-
`,
|
|
439
|
+
`,Dt=e(k)`
|
|
440
440
|
width: 24px;
|
|
441
441
|
height: 24px;
|
|
442
442
|
background: ${r.text2};
|
|
443
|
-
`,
|
|
443
|
+
`,Kt=e.div`
|
|
444
444
|
display: flex;
|
|
445
445
|
align-items: center;
|
|
446
446
|
gap: 8px;
|
|
@@ -461,7 +461,7 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,b as g,q as
|
|
|
461
461
|
`,Ut=e.div`
|
|
462
462
|
display: flex;
|
|
463
463
|
gap: 12px;
|
|
464
|
-
`,
|
|
464
|
+
`,Ht=e.button`
|
|
465
465
|
flex: 1;
|
|
466
466
|
height: 109px;
|
|
467
467
|
border: 1px solid ${r.muted2};
|
|
@@ -477,7 +477,7 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,b as g,q as
|
|
|
477
477
|
&[data-on] {
|
|
478
478
|
border: 4px solid ${r.magenta};
|
|
479
479
|
}
|
|
480
|
-
`,
|
|
480
|
+
`,_t=e(k)`
|
|
481
481
|
width: 24px;
|
|
482
482
|
height: 24px;
|
|
483
483
|
background: ${r.text};
|
|
@@ -665,7 +665,7 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,b as g,q as
|
|
|
665
665
|
text-align: center;
|
|
666
666
|
}
|
|
667
667
|
}
|
|
668
|
-
`,{colors:I,media:A}=o,
|
|
668
|
+
`,{colors:I,media:A}=o,_e=e.section`
|
|
669
669
|
margin-top: 40px;
|
|
670
670
|
`,Oe=e.div`
|
|
671
671
|
display: flex;
|
|
@@ -698,7 +698,7 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,b as g,q as
|
|
|
698
698
|
transform: rotate(-90deg);
|
|
699
699
|
`,Xe=e.div`
|
|
700
700
|
position: relative;
|
|
701
|
-
`,
|
|
701
|
+
`,K=e.button`
|
|
702
702
|
position: absolute;
|
|
703
703
|
top: 112px;
|
|
704
704
|
transform: translateY(-50%);
|
|
@@ -801,4 +801,4 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,b as g,q as
|
|
|
801
801
|
opacity: 1;
|
|
802
802
|
transform: scale(1.1);
|
|
803
803
|
}
|
|
804
|
-
`;function ln({title:a,items:n,onViewAll:i}){const s=v.useRef(null),[l,c]=v.useState(1),[p,h]=v.useState(0),[m,b]=v.useState(!0),[y,w]=v.useState(!1),d=v.useCallback(()=>{const u=s.current;if(!u)return;const{scrollLeft:x,scrollWidth:L,clientWidth:S}=u,P=Math.max(1,Math.ceil(L/S));c(P),h(Math.min(P-1,Math.round(x/S))),b(x<=1),w(x+S>=L-1)},[]);if(v.useEffect(()=>{d();const u=s.current;if(u)return u.addEventListener("scroll",d,{passive:!0}),window.addEventListener("resize",d),()=>{u.removeEventListener("scroll",d),window.removeEventListener("resize",d)}},[d,n.length]),n.length===0)return null;function f(u){const x=s.current;x&&x.scrollBy({left:u*x.clientWidth,behavior:"smooth"})}function $(u){const x=s.current;x&&x.scrollTo({left:u*x.clientWidth,behavior:"smooth"})}return t.jsxs(
|
|
804
|
+
`;function ln({title:a,items:n,onViewAll:i}){const s=v.useRef(null),[l,c]=v.useState(1),[p,h]=v.useState(0),[m,b]=v.useState(!0),[y,w]=v.useState(!1),d=v.useCallback(()=>{const u=s.current;if(!u)return;const{scrollLeft:x,scrollWidth:L,clientWidth:S}=u,P=Math.max(1,Math.ceil(L/S));c(P),h(Math.min(P-1,Math.round(x/S))),b(x<=1),w(x+S>=L-1)},[]);if(v.useEffect(()=>{d();const u=s.current;if(u)return u.addEventListener("scroll",d,{passive:!0}),window.addEventListener("resize",d),()=>{u.removeEventListener("scroll",d),window.removeEventListener("resize",d)}},[d,n.length]),n.length===0)return null;function f(u){const x=s.current;x&&x.scrollBy({left:u*x.clientWidth,behavior:"smooth"})}function $(u){const x=s.current;x&&x.scrollTo({left:u*x.clientWidth,behavior:"smooth"})}return t.jsxs(_e,{children:[t.jsxs(Oe,{children:[t.jsx(Ve,{children:a}),i?t.jsxs(Ge,{onClick:i,children:[g("collectionCarousel.viewAll"),t.jsx(Ye,{name:"chevron-down",size:16})]}):null]}),t.jsxs(Xe,{children:[t.jsx(K,{"data-side":"left",onClick:()=>f(-1),"aria-label":g("collectionCarousel.scrollLeft"),disabled:m,children:t.jsx("img",{src:F,alt:"","aria-hidden":!0})}),t.jsx(Ze,{ref:s,children:n.map(u=>t.jsx(J,{item:u},u.id))}),t.jsx(K,{"data-side":"right",onClick:()=>f(1),"aria-label":g("collectionCarousel.scrollRight"),disabled:y,children:t.jsx("img",{src:F,alt:"","aria-hidden":!0})})]}),l>1?t.jsx(qe,{"aria-label":g("collectionCarousel.pages"),children:Array.from({length:l}).map((u,x)=>t.jsx(Je,{"data-active":x===p||void 0,"aria-label":g("collectionCarousel.goToPage",{page:x+1}),"aria-current":x===p?"true":void 0,onClick:()=>$(x)},x))}):null]})}export{M as $,Et as A,Wt as B,jt as C,Ot as D,Vt as E,Gt as F,Yt as G,Ct as H,Xt as I,Zt as J,pt as K,en as L,kt as M,lt as N,ln as O,gt as P,mt as Q,T as R,$t as S,zt as T,dt as U,ft as V,Kt as W,At as X,Qe as Y,ht as Z,be as _,Mt as a,cn as a0,dn as a1,bt as a2,ut as a3,yt as a4,wt as b,It as c,St as d,Tt as e,Nt as f,tn as g,nn as h,an as i,qt as j,Jt as k,on as l,xt as m,sn as n,rn as o,vt as p,Qt as q,Bt as r,Rt as s,Lt as t,Pt as u,Ft as v,Dt as w,Ut as x,Ht as y,_t as z};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{d as de,j as e,L as Pe,u as Fe,e as Le,r as f}from"./react-DehiWSvs.js";import{t as he,
|
|
1
|
+
import{d as de,j as e,L as Pe,u as Fe,e as Le,r as f}from"./react-DehiWSvs.js";import{t as he,H as Ae,K as Y,J as Z,s,bD as Ie,au as Re,bE as ze,d as o,bF as Be,bG as ee,B as Me,ad as me,X as xe,bi as _e,l as Te,z as ue,bp as We,bj as De,bk as Ge,I as te,c as Oe,v as Ke,o as He,ae as Ue,ag as A,ah as oe,bH as re,bI as qe}from"./index-DaQaTpvn.js";import{d as Ve,P as Je,C as Qe,a as Xe,b as Ye,A as Ze,c as et,e as tt}from"./collectionPage.styles-vmTcFGbQ.js";import{g as ot,h as rt,i as it,j as st,k as at,C as nt,l as lt,o as ct,m as dt,n as ht,M as mt,E as xt,p as ut,q as pt,r as gt,s as ft,t as bt}from"./Assets.styles-ZM8Q2cFA.js";import{S as ie,R as wt,F as jt,e as vt}from"./categories-BQKh49D5.js";import{L as se}from"./LoadMore-TnqPM5W_.js";import{u as ae}from"./useInfiniteGrid-XDOQyPRq.js";import{E as W}from"./ErrorNotice-CfA5EQ3B.js";import{G as ne}from"./grid.styles-BaFKxOV8.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./Tooltip-ySlzdfvH.js";function yt(r){const{gridLoading:i,gridError:a,gridCount:n,baselinePending:h,baselineError:l,baselineCount:m}=r;return i?"skeletons":a?"error":n>0?"items":h?"skeletons":l?"error":m===0?"no-creations":"filters"}const{colors:b,radius:pe,media:Ct}=he,kt=s.article`
|
|
2
2
|
height: 300px;
|
|
3
3
|
background: ${b.bg};
|
|
4
4
|
border-radius: ${pe.card};
|
|
@@ -15,10 +15,10 @@ import{d as de,j as e,L as Pe,u as Fe,e as Le,r as f}from"./react-DehiWSvs.js";i
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
&:focus-visible {
|
|
18
|
-
${
|
|
18
|
+
${Y};
|
|
19
19
|
}
|
|
20
20
|
&:focus-visible::after {
|
|
21
|
-
${
|
|
21
|
+
${Z};
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
// The swap is a pointer affordance only: keyboard focus must not hide the creator row, whose profile
|
|
@@ -26,10 +26,10 @@ import{d as de,j as e,L as Pe,u as Fe,e as Le,r as f}from"./react-DehiWSvs.js";i
|
|
|
26
26
|
// already opens the collection.
|
|
27
27
|
@media (hover: hover) {
|
|
28
28
|
&:hover {
|
|
29
|
-
${
|
|
29
|
+
${Y};
|
|
30
30
|
}
|
|
31
31
|
&:hover::after {
|
|
32
|
-
${
|
|
32
|
+
${Z};
|
|
33
33
|
}
|
|
34
34
|
&:hover [data-view] {
|
|
35
35
|
visibility: visible;
|
|
@@ -243,7 +243,7 @@ import{d as de,j as e,L as Pe,u as Fe,e as Le,r as f}from"./react-DehiWSvs.js";i
|
|
|
243
243
|
height: 14px;
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
|
-
`,
|
|
246
|
+
`,Ht=s.div`
|
|
247
247
|
position: relative;
|
|
248
248
|
z-index: 1;
|
|
249
249
|
display: flex;
|
|
@@ -270,7 +270,7 @@ import{d as de,j as e,L as Pe,u as Fe,e as Le,r as f}from"./react-DehiWSvs.js";i
|
|
|
270
270
|
width: 88px;
|
|
271
271
|
height: 88px;
|
|
272
272
|
}
|
|
273
|
-
`,
|
|
273
|
+
`,Ut=s.h2`
|
|
274
274
|
margin: 0;
|
|
275
275
|
font-size: 18px;
|
|
276
276
|
font-weight: 700;
|
|
@@ -280,7 +280,7 @@ import{d as de,j as e,L as Pe,u as Fe,e as Le,r as f}from"./react-DehiWSvs.js";i
|
|
|
280
280
|
${v.maxWidth("mobile")} {
|
|
281
281
|
font-size: 16px;
|
|
282
282
|
}
|
|
283
|
-
`,
|
|
283
|
+
`,qt=s.p`
|
|
284
284
|
margin: 0;
|
|
285
285
|
font-size: 15px;
|
|
286
286
|
color: ${y.white};
|
|
@@ -290,17 +290,17 @@ import{d as de,j as e,L as Pe,u as Fe,e as Le,r as f}from"./react-DehiWSvs.js";i
|
|
|
290
290
|
${v.maxWidth("mobile")} {
|
|
291
291
|
font-size: 14px;
|
|
292
292
|
}
|
|
293
|
-
`,
|
|
293
|
+
`,Vt=s.div`
|
|
294
294
|
display: flex;
|
|
295
295
|
align-items: center;
|
|
296
296
|
gap: 12px;
|
|
297
297
|
flex-wrap: wrap;
|
|
298
298
|
justify-content: center;
|
|
299
|
-
`,
|
|
299
|
+
`,Jt=s.a`
|
|
300
300
|
${fe};
|
|
301
301
|
transition: background 0.15s ease;
|
|
302
302
|
|
|
303
303
|
&:hover {
|
|
304
304
|
background: rgba(255, 255, 255, 0.14);
|
|
305
305
|
}
|
|
306
|
-
`,
|
|
306
|
+
`,Qt={website:"website",twitter:"twitter",discord:"discord",facebook:"facebook"};function Xt({address:r}){var u,k;const{data:i}=xe(r),{data:a}=_e(r),n=Te(c=>{var $;return($=c.session)==null?void 0:$.address}),h=!!n&&n.toLowerCase()===r.toLowerCase(),l=(i==null?void 0:i.name)||ue(r),m=(k=(u=i==null?void 0:i.avatar)==null?void 0:u.snapshots)==null?void 0:k.face256,C=(a==null?void 0:a.cover)||Ve,x=a==null?void 0:a.description,j=`${Oe.profileUrl}/${r}`,g=We.filter(c=>a==null?void 0:a.links[c]),w=De(Ge({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(_t,{"aria-label":`${l} storefront`,children:[e.jsxs(Tt,{children:[e.jsx(Wt,{src:C,alt:"",loading:"eager"}),e.jsx(Dt,{"aria-hidden":!0})]}),(g.length>0||h)&&e.jsxs(Gt,{children:[g.map(c=>e.jsx(Ot,{"data-testid":"creator-hero-link",href:(a==null?void 0:a.links[c])??"",target:"_blank",rel:"noopener noreferrer",title:o(`creator.link.${c}`),"aria-label":o(`creator.link.${c}`),children:e.jsx(te,{name:Qt[c]})},c)),h&&e.jsx(Kt,{to:"/store-settings",title:o("creator.editStore"),"aria-label":o("creator.editStore"),children:e.jsx(te,{name:"pen"})})]}),e.jsxs(Ht,{children:[m?e.jsx(le,{src:m,alt:"",loading:"eager",style:{backgroundColor:w}}):e.jsx(le,{as:"span","aria-hidden":!0,style:{backgroundColor:w}}),e.jsxs("div",{children:[e.jsx(Ut,{children:l}),x?e.jsx(qt,{children:x}):null]}),e.jsxs(Vt,{children:[e.jsx(Jt,{"data-testid":"creator-hero-view",href:j,target:"_blank",rel:"noopener noreferrer",children:o("creator.viewProfile")}),e.jsx(Mt,{address:r,className:"creator-hero__follow"})]})]})]})}const ce=48;function xo(){const{address:r}=Fe(),i=de(),[a]=Le(),n=a.has("collections"),{data:h}=xe(r),l=(h==null?void 0:h.name)||(r?ue(r):o("creator.fallbackName"));Ke({title:l,description:o("seo.creator.description",{name:l})});const[m,C]=f.useState("all"),[x,j]=f.useState(null),[g,w]=f.useState([]),[u,k]=f.useState(""),[c,$]=f.useState(""),[N,I]=f.useState("all"),[R,z]=f.useState(!1),[D,we]=f.useState("newest"),[P,E]=f.useState(!1);f.useEffect(()=>{if(!P)return;const t=T=>{T.key==="Escape"&&E(!1)};document.addEventListener("keydown",t);const d=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",t),document.body.style.overflow=d}},[P]);const G=u&&!Number.isNaN(Number(u))?Number(u):void 0,O=c&&!Number.isNaN(Number(c))?Number(c):void 0,je=x?vt[x]:void 0,ve=(ie.find(t=>t.key===D)??ie[0]).server,K={creator:r,category:m,rarities:g.length?g:void 0,wearableCategories:je,minPriceCredits:G,maxPriceCredits:O,isWearableSmart:R||void 0,isOnSale:N==="all"?void 0:N==="on_sale",sortBy:ve},{items:B,total:ye,isLoading:Ce,isPlaceholderData:ke,error:H,hasNextPage:$e,isFetchingNextPage:U,isFetchNextPageError:Se,fetchNextPage:Ne}=ae(["creator-items",K],t=>re({...K,first:ce,skip:t}),{enabled:!!r&&!n}),F=He({queryKey:["creator-item-count",r],queryFn:()=>re({creator:r,first:1}).then(t=>t.total),enabled:!!r}),p=ae(["creator-collections",r],t=>qe(r,{first:ce,skip:t}).then(d=>({items:d.collections,total:d.total})),{enabled:!!r&&n});function q(t){C(t),j(null),n&&V()}function V(){const t=new URLSearchParams(a);t.delete("collections");const d=t.toString();i({search:d?`?${d}`:""},{replace:!0})}function Ee(){if(n){V();return}const t=new URLSearchParams(a);t.delete("collections");const d=t.toString();i({search:d?`?${d}&collections`:"?collections"},{replace:!0})}function J(t){w(d=>d.includes(t)?d.filter(T=>T!==t):[...d,t])}function Q(){C("all"),j(null),w([]),k(""),$(""),I("all"),z(!1)}const S=[];(m==="wearable"||m==="emote")&&S.push({key:"category",label:o(m==="emote"?"categories.emotes":"categories.wearables"),onRemove:()=>q("all")}),(G!=null||O!=null)&&S.push({key:"price",label:o("filter.price"),onRemove:()=>{k(""),$("")}});for(const t of wt)g.includes(t)&&S.push({key:`rarity-${t}`,label:Ue(t),onRemove:()=>J(t)});R&&S.push({key:"smart",label:o("filter.smart"),onRemove:()=>z(!1)}),N!=="all"&&S.push({key:"status",label:N==="on_sale"?o("filter.onSale"):o("filter.notForSale"),onRemove:()=>I("all")});const L=yt({gridLoading:Ce||ke,gridError:!!H,gridCount:B.length,baselinePending:F.isPending,baselineError:F.isError,baselineCount:F.data}),M=L==="skeletons",X=B.filter(t=>t.priceCredits>0),_=L==="items"||L==="skeletons"?null:L;return e.jsxs(Je,{children:[e.jsxs(Qe,{"aria-label":o("creator.breadcrumbAria"),children:[e.jsx(Xe,{onClick:()=>i("/items"),children:o("creator.breadcrumb")}),e.jsx("span",{children:"/"}),e.jsx(Ye,{children:l})]}),r?e.jsx(Xt,{address:r}):null,!n&&!M&&X.length>0?e.jsx(Ze,{items:X,source:"creator"}):null,e.jsxs(ot,{children:[P?e.jsx(rt,{onClick:()=>E(!1),"aria-hidden":!0}):null,e.jsxs(it,{"data-open":P||void 0,"data-testid":"creator-sidebar",children:[e.jsxs(st,{children:[e.jsx(at,{children:o("assets.filters")}),e.jsx(nt,{onClick:()=>E(!1),"aria-label":o("assets.closeFilters"),children:"✕"})]}),e.jsx(lt,{children:e.jsx(ct,{category:m,subCategory:x,onCategory:q,onSub:j,priceMin:u,priceMax:c,onPriceMin:k,onPriceMax:$,rarities:g,onToggleRarity:J,status:N,onStatus:I,smart:R,onSmart:z,hideNames:!0,collections:n,onCollections:Ee})}),e.jsx(dt,{children:e.jsx(ht,{type:"button",onClick:()=>E(!1),children:o("assets.showItems")})})]}),e.jsx(mt,{children:n?e.jsxs(e.Fragment,{children:[e.jsx(et,{children:e.jsx(tt,{children:p.isLoading?"…":o("creator.collectionsCount",{count:p.total})})}),p.error?e.jsx(W,{message:o("creator.error")}):null,e.jsx(ne,{"data-variant":"collections",children:p.isLoading?e.jsx(A,{count:9}):e.jsxs(e.Fragment,{children:[p.items.map(t=>e.jsx(Bt,{collection:t,itemCount:t.itemCount},t.contractAddress)),p.isFetchingNextPage?e.jsx(A,{count:6}):null]})}),e.jsx(se,{hasNextPage:p.hasNextPage,isFetching:p.isFetchingNextPage,isError:p.isFetchNextPageError,onLoadMore:()=>void p.fetchNextPage()}),!p.isLoading&&!p.error&&p.items.length===0?e.jsx("p",{className:"muted",children:o("creator.collectionsEmpty")}):null]}):e.jsxs(e.Fragment,{children:[e.jsx(jt,{sort:D,onSort:we,total:ye,loading:M,onOpenFilters:()=>E(!0),chips:S,onClearChips:Q}),H?e.jsx(W,{message:o("creator.error"),testId:"creator-error"}):null,e.jsx(ne,{"data-testid":"creator-grid",children:M?e.jsx(A,{count:15}):e.jsxs(e.Fragment,{children:[B.map(t=>t.priceCredits>0?e.jsx(oe,{item:t},t.id):e.jsx(oe,{item:t,mode:"view"},t.id)),U?e.jsx(A,{count:6}):null]})}),e.jsx(se,{hasNextPage:$e,isFetching:U,isError:Se,onLoadMore:()=>void Ne()}),_==="error"?e.jsx(W,{message:o("creator.error"),testId:"creator-empty-error"}):_==="no-creations"?e.jsx("p",{className:"muted","data-testid":"creator-empty-none",children:o("creator.emptyNoCreations")}):_==="filters"?e.jsxs(xt,{"data-testid":"creator-empty-filters",children:[e.jsxs(ut,{children:[e.jsx(pt,{children:o("creator.emptyFilters.title")}),e.jsx(gt,{children:o("creator.emptyFilters.body",{count:F.data??0})})]}),e.jsx(ft,{children:e.jsx(bt,{type:"button",onClick:Q,children:o("filterBar.clearAll")})})]}):null]})})]})]})}export{xo as Creator,xo as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as r}from"./react-DehiWSvs.js";import{I as i}from"./index-
|
|
1
|
+
import{j as r}from"./react-DehiWSvs.js";import{I as i}from"./index-DaQaTpvn.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-Be2imJ8Z.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-vt25O9Am.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{d as he,e as xe,r as l,j as t}from"./react-DehiWSvs.js";import{s as i,t as e,
|
|
1
|
+
import{d as he,e as xe,r as l,j as t}from"./react-DehiWSvs.js";import{s as i,t as e,q as B,v as ge,d as r,e as p,l as ue,y as fe,U as u,b7 as me,D as N,bg as U,I as ie,b0 as D,x as re,bJ as H}from"./index-DaQaTpvn.js";import{R as K}from"./resume-buy-Bf0zIH7y.js";import{u as be,a as we,R as ye,c as ke,i as Ce,b as ve}from"./useCreditPacks-CzOCruPU.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";const P="https://cdn.decentraland.org/@dcl/shop/0.5.1-30944558724.commit-19fdddf/_assets/pack-coins-BDh1ZDbh.webp",ne="https://cdn.decentraland.org/@dcl/shop/0.5.1-30944558724.commit-19fdddf/_assets/pack-stacks-D-V2jSHW.webp",oe="https://cdn.decentraland.org/@dcl/shop/0.5.1-30944558724.commit-19fdddf/_assets/pack-chest-BX_j84xW.webp",$e="https://cdn.decentraland.org/@dcl/shop/0.5.1-30944558724.commit-19fdddf/_assets/credit-coin-CmcTCd5i.webp",je="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",Se="https://cdn.decentraland.org/@dcl/shop/0.5.1-30944558724.commit-19fdddf/_assets/packs-backdrop-BcXiUPeP.webp",O="linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)",Pe=i.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: 24px;
|
|
@@ -284,7 +284,7 @@ import{d as he,e as xe,r as l,j as t}from"./react-DehiWSvs.js";import{s as i,t a
|
|
|
284
284
|
${e.media.maxWidth("mobile")} {
|
|
285
285
|
padding-top: 24px;
|
|
286
286
|
}
|
|
287
|
-
`,
|
|
287
|
+
`,X=i.span`
|
|
288
288
|
display: flex;
|
|
289
289
|
flex-direction: column;
|
|
290
290
|
align-items: center;
|
|
@@ -365,7 +365,7 @@ import{d as he,e as xe,r as l,j as t}from"./react-DehiWSvs.js";import{s as i,t a
|
|
|
365
365
|
letter-spacing: 0.46px;
|
|
366
366
|
color: ${e.colors.text2};
|
|
367
367
|
text-transform: uppercase;
|
|
368
|
-
`,
|
|
368
|
+
`,De=B`
|
|
369
369
|
to {
|
|
370
370
|
background-position: -200% 0;
|
|
371
371
|
}
|
|
@@ -378,12 +378,12 @@ import{d as he,e as xe,r as l,j as t}from"./react-DehiWSvs.js";import{s as i,t a
|
|
|
378
378
|
rgba(255, 255, 255, 0.08) 70%
|
|
379
379
|
);
|
|
380
380
|
background-size: 200% 100%;
|
|
381
|
-
animation: ${
|
|
381
|
+
animation: ${De} 1.4s infinite linear;
|
|
382
382
|
|
|
383
383
|
@media (prefers-reduced-motion: reduce) {
|
|
384
384
|
animation: none;
|
|
385
385
|
}
|
|
386
|
-
`,
|
|
386
|
+
`,He=i(E)`
|
|
387
387
|
width: 60%;
|
|
388
388
|
height: 30px;
|
|
389
389
|
border-radius: ${e.radius.chip};
|
|
@@ -417,7 +417,7 @@ import{d as he,e as xe,r as l,j as t}from"./react-DehiWSvs.js";import{s as i,t a
|
|
|
417
417
|
font-size: 16px;
|
|
418
418
|
line-height: 1.4;
|
|
419
419
|
color: rgba(255, 255, 255, 0.88);
|
|
420
|
-
`,
|
|
420
|
+
`,Xe=B`
|
|
421
421
|
0%, 100% {
|
|
422
422
|
transform: scale(1);
|
|
423
423
|
opacity: 1;
|
|
@@ -426,7 +426,7 @@ import{d as he,e as xe,r as l,j as t}from"./react-DehiWSvs.js";import{s as i,t a
|
|
|
426
426
|
transform: scale(0.88);
|
|
427
427
|
opacity: 0.7;
|
|
428
428
|
}
|
|
429
|
-
`,
|
|
429
|
+
`,Qe=i.div`
|
|
430
430
|
display: flex;
|
|
431
431
|
flex-direction: column;
|
|
432
432
|
align-items: center;
|
|
@@ -437,15 +437,15 @@ import{d as he,e as xe,r as l,j as t}from"./react-DehiWSvs.js";import{s as i,t a
|
|
|
437
437
|
`,se=i.img`
|
|
438
438
|
width: 61px;
|
|
439
439
|
height: 61px;
|
|
440
|
-
animation: ${
|
|
440
|
+
animation: ${Xe} 1.2s ease-in-out infinite;
|
|
441
441
|
|
|
442
442
|
@media (prefers-reduced-motion: reduce) {
|
|
443
443
|
animation: none;
|
|
444
444
|
}
|
|
445
|
-
`,
|
|
445
|
+
`,Je=i(se)`
|
|
446
446
|
width: 72px;
|
|
447
447
|
height: 72px;
|
|
448
|
-
`,
|
|
448
|
+
`,Ze=i.div`
|
|
449
449
|
display: flex;
|
|
450
450
|
flex-direction: column;
|
|
451
451
|
align-items: center;
|
|
@@ -590,11 +590,11 @@ import{d as he,e as xe,r as l,j as t}from"./react-DehiWSvs.js";import{s as i,t a
|
|
|
590
590
|
height: 30px;
|
|
591
591
|
color: ${e.colors.text};
|
|
592
592
|
}
|
|
593
|
-
`,
|
|
593
|
+
`,gt=i.strong`
|
|
594
594
|
font-size: 24px;
|
|
595
595
|
font-weight: 700;
|
|
596
596
|
text-transform: capitalize;
|
|
597
|
-
`,
|
|
597
|
+
`,ut=i.span`
|
|
598
598
|
font-size: 14px;
|
|
599
599
|
font-weight: 400;
|
|
600
600
|
`,ft=i.div`
|
|
@@ -641,7 +641,7 @@ import{d as he,e as xe,r as l,j as t}from"./react-DehiWSvs.js";import{s as i,t a
|
|
|
641
641
|
outline: 2px solid ${e.colors.accent};
|
|
642
642
|
outline-offset: 2px;
|
|
643
643
|
}
|
|
644
|
-
`,
|
|
644
|
+
`,Q=i.div`
|
|
645
645
|
display: flex;
|
|
646
646
|
flex-direction: column;
|
|
647
647
|
align-items: center;
|
|
@@ -650,7 +650,7 @@ import{d as he,e as xe,r as l,j as t}from"./react-DehiWSvs.js";import{s as i,t a
|
|
|
650
650
|
margin: 0 auto;
|
|
651
651
|
padding: 48px 24px;
|
|
652
652
|
text-align: center;
|
|
653
|
-
`,
|
|
653
|
+
`,J=i.p`
|
|
654
654
|
margin: 0;
|
|
655
655
|
font-family: ${e.font.sans};
|
|
656
656
|
font-size: 20px;
|
|
@@ -660,7 +660,7 @@ import{d as he,e as xe,r as l,j as t}from"./react-DehiWSvs.js";import{s as i,t a
|
|
|
660
660
|
&[data-tone='error'] {
|
|
661
661
|
color: ${e.colors.err};
|
|
662
662
|
}
|
|
663
|
-
`,
|
|
663
|
+
`,Z=i.div`
|
|
664
664
|
display: flex;
|
|
665
665
|
gap: 12px;
|
|
666
666
|
margin-top: 16px;
|
|
@@ -668,4 +668,4 @@ import{d as he,e as xe,r as l,j as t}from"./react-DehiWSvs.js";import{s as i,t a
|
|
|
668
668
|
margin: 0;
|
|
669
669
|
font-family: ${e.font.sans};
|
|
670
670
|
color: ${e.colors.err};
|
|
671
|
-
`,v=Ce()?"mock":"stripe",ee=[P,P,ne,oe],bt={pack_5:P,pack_10:P,pack_25:ne,pack_50:oe};function ae(a,o){return bt[a.id]??ee[o%ee.length]}function wt(a,o){return a.artUrl??ae(a,o)}const yt="https://docs.decentraland.org";function te(a){const o=a;if((o==null?void 0:o.name)==="AbortError")return r("getCredits.errorCanceled");const f=((o==null?void 0:o.message)??"").toLowerCase();return f.includes("sign in")?r("getCredits.errorSignIn",{currency:p.name}):f.includes("timed out")?r("getCredits.errorTimeout",{currency:p.name}):r("getCredits.errorGeneric")}function
|
|
671
|
+
`,v=Ce()?"mock":"stripe",ee=[P,P,ne,oe],bt={pack_5:P,pack_10:P,pack_25:ne,pack_50:oe};function ae(a,o){return bt[a.id]??ee[o%ee.length]}function wt(a,o){return a.artUrl??ae(a,o)}const yt="https://docs.decentraland.org";function te(a){const o=a;if((o==null?void 0:o.name)==="AbortError")return r("getCredits.errorCanceled");const f=((o==null?void 0:o.message)??"").toLowerCase();return f.includes("sign in")?r("getCredits.errorSignIn",{currency:p.name}):f.includes("timed out")?r("getCredits.errorTimeout",{currency:p.name}):r("getCredits.errorGeneric")}function Tt(){var W;ge({title:r("nav.getCredits",{currency:p.name}),noindex:!0});const a=he(),{session:o,signIn:f}=ue(),s=fe(),[m,b]=xe(),{packs:$,isLoading:y}=be(),[x,h]=l.useState("select"),[c,F]=l.useState(null),[j,L]=l.useState(null),de=(j!=null?(W=$.find(n=>n.credits===j))==null?void 0:W.artUrl:void 0)??$e,[ce,k]=l.useState(null),[le,_]=l.useState(!1),R=l.useRef(null);l.useEffect(()=>()=>{var n;return(n=R.current)==null?void 0:n.abort()},[]);const I=l.useCallback(()=>{b(n=>{const d=new URLSearchParams(n);return d.delete("order"),d.delete("canceled"),d},{replace:!0})},[b]),T=l.useCallback(async n=>{h("processing");const d=new AbortController;R.current=d;try{const g=await we(n,{signal:d.signal,address:o==null?void 0:o.address,identity:o==null?void 0:o.identity});if(g.status==="credited"){const w=g.creditsGranted??(c==null?void 0:c.credits)??0;L(w>0?w:null),h("success"),u("Shop Completed Buy Credits",{order_id:n,pack_usd:(c==null?void 0:c.usd)??null,credits:w>0?w:null,provider:v}),s.invalidateQueries({queryKey:["usd-balance"]});try{if(sessionStorage.getItem(ye)){const S={resumeCheckout:!0,...w>0?{creditsAdded:w}:{}};a("/cart",{state:S});return}}catch{}try{const S=sessionStorage.getItem(K);if(S){sessionStorage.removeItem(K);const M=JSON.parse(S),G=me(M);if(G){a(G,{state:{item:M,resumeBuy:!0}});return}}}catch{}}else g.status==="pending"?(u("Shop Buy Credits Pending",{step:"grant",pack_usd:(c==null?void 0:c.usd)??null}),s.invalidateQueries({queryKey:["usd-balance"]}),h("pending")):(u("Shop Buy Credits Failed",{step:"grant",error_code:"grant_failed",pack_usd:(c==null?void 0:c.usd)??null}),k(g.error??r("getCredits.errorGrant",{currency:p.name})),h("error"))}catch(g){N(g,{flow:"get_credits",step:"grant",order_id:n}),u("Shop Buy Credits Failed",{step:"grant",error_code:U(g),pack_usd:(c==null?void 0:c.usd)??null}),k(te(g)),h("error")}},[c,o,s,a]),pe=l.useCallback(async n=>{if(!o){f();return}k(null),_(!1),F(n),h(v==="mock"?"processing":"redirecting"),u("Shop Started Buy Credits",{pack_usd:n.usd,credits:n.credits,provider:v});try{const d=await ke(n.id,{address:o.address,identity:o.identity});if(d.mock)T(d.orderId);else if(d.url)u("Shop Redirected To Stripe",{order_id:d.orderId,pack_usd:n.usd,credits:n.credits}),window.location.href=d.url;else throw new Error("Checkout did not return a redirect url")}catch(d){N(d,{flow:"get_credits",step:"checkout",provider:v}),u("Shop Buy Credits Failed",{step:"checkout",error_code:U(d),pack_usd:n.usd}),k(te(d)),h("error")}},[o,f,T]),A=l.useRef(!1);l.useEffect(()=>{if(A.current)return;const n=m.get("order");if(m.get("canceled")!=null){A.current=!0,u("Shop Buy Credits Cancelled",{order_id:n,provider:v}),I(),_(!0),h("select");return}n&&(h("processing"),o&&(A.current=!0,I(),T(n)))},[m,o]);function z(){var n;(n=R.current)==null||n.abort(),h("select"),F(null),L(null),k(null),_(!1)}return t.jsxs(Pe,{children:[(x==="select"||x==="redirecting")&&t.jsxs(_e,{"data-testid":"credits-hero",children:[t.jsx(Re,{"aria-hidden":!0}),t.jsxs(Te,{$hidden:x==="redirecting",children:[t.jsxs(Ae,{children:[t.jsx(ze,{children:r("getCredits.title",{currency:p.name})}),t.jsxs(Be,{children:[t.jsx(Ee,{children:r("getCredits.subtitle",{currency:p.nameSingular})}),t.jsxs(Fe,{href:yt,target:"_blank",rel:"noreferrer",children:[r("getCredits.learnMore"),t.jsx(ie,{name:"link-out"})]})]})]}),le&&t.jsx(Le,{role:"status",children:r("getCredits.canceledNote")}),t.jsx(kt,{packs:$,loading:y,onSelect:n=>void pe(n)})]}),x==="redirecting"&&t.jsxs(Ve,{role:"status","aria-live":"polite",children:[t.jsx(Je,{src:D,alt:"",width:72,height:72}),t.jsx(qe,{children:r("getCredits.redirecting")})]})]}),x==="processing"&&t.jsxs(Qe,{role:"status","aria-live":"polite",children:[t.jsx(se,{src:D,alt:"",width:61,height:61}),t.jsxs(Ze,{children:[t.jsxs(et,{children:[t.jsx("strong",{children:r("getCredits.processing")}),"…"]}),t.jsxs(tt,{"aria-hidden":!0,children:[t.jsx(rt,{children:t.jsx(nt,{})}),t.jsx(ot,{children:"1/1"})]})]})]}),x==="success"&&t.jsxs(st,{role:"status","aria-live":"polite",children:[t.jsxs(at,{children:[t.jsx(dt,{src:je,alt:"",width:60,height:60}),t.jsxs(ct,{children:[t.jsx("strong",{children:r("getCredits.successTitle")})," ",r("getCredits.successBody",{currency:p.name})]})]}),j!=null&&t.jsx(lt,{children:t.jsxs(pt,{children:[t.jsx(ht,{src:de,alt:"",width:93,height:93}),t.jsxs(xt,{children:[t.jsx(re,{}),t.jsxs("span",{children:[t.jsx(gt,{children:r("getCredits.creditsAmount",{credits:j,currency:p.name})})," ",t.jsx(ut,{children:r("getCredits.creditsAdded")})]})]})]})}),t.jsxs(ft,{children:[t.jsx(C,{"data-variant":"outline",onClick:z,children:r("getCredits.buyMore",{currency:p.name})}),t.jsx(C,{onClick:()=>a("/items"),children:r("getCredits.startShopping")})]})]}),x==="pending"&&t.jsxs(Q,{role:"status","aria-live":"polite",children:[t.jsx(J,{children:r("getCredits.pendingTitle",{currency:p.name})}),t.jsx(Ye,{children:r("getCredits.pendingBody")}),t.jsxs(Z,{children:[t.jsx(C,{onClick:()=>a("/items"),children:r("getCredits.startShopping")}),t.jsx(C,{"data-variant":"outline",onClick:z,children:r("getCredits.done")})]})]}),x==="error"&&t.jsxs(Q,{role:"alert",children:[t.jsx(J,{"data-tone":"error",children:r("getCredits.errorTitle")}),t.jsx(mt,{children:ce}),t.jsx(Z,{children:t.jsx(C,{onClick:z,children:r("getCredits.tryAgain")})})]})]})}function kt({packs:a,loading:o,onSelect:f}){return o?t.jsx(Y,{"aria-busy":"true","aria-label":r("getCredits.packsLoading",{currency:p.name}),children:[0,1,2,3].map(s=>t.jsxs(V,{as:"div","data-skeleton":"true","data-testid":"pack-skeleton","aria-hidden":!0,children:[t.jsxs(q,{children:[t.jsx(X,{children:t.jsx(He,{})}),t.jsx(Ke,{})]}),t.jsx(Oe,{})]},s))}):t.jsx(Y,{children:a.map((s,m)=>{const b=ve(s,a);return t.jsxs(V,{type:"button","data-testid":"pack","data-best":s.bestValue?"true":void 0,onClick:()=>f(s),"aria-label":b?r("getCredits.packAriaBonus",{amount:H(s.credits),usd:s.usd,bonus:b.bonus,baseline:b.baseline}):r("getCredits.packAria",{amount:H(s.credits),usd:s.usd}),children:[s.bestValue&&t.jsxs(Ie,{children:[t.jsx(ie,{name:"star-rounded"}),r("getCredits.packBadge")]}),t.jsxs(q,{children:[t.jsxs(X,{children:[t.jsxs(We,{children:[t.jsx(re,{}),t.jsx(Me,{children:s.credits})]}),t.jsx(Ge,{children:r("getCredits.packUnit",{currency:p.name})})]}),t.jsx(Ne,{children:t.jsx("img",{src:wt(s,m),alt:"",loading:"lazy",width:507,height:507,onError:$=>{const y=$.currentTarget;y.dataset.artFallback||(y.dataset.artFallback="done",y.src=ae(s,m))}})})]}),t.jsxs(Ue,{children:["$",s.usd.toFixed(2)]})]},s.id)})})}export{Tt as GetCredits,Tt as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as f,b as h}from"./lit-element-B3y9oplH.js";import{n as m}from"./class-map-CxwNmq0D.js";import{c as p}from"./index-
|
|
1
|
+
import{i as f,b as h}from"./lit-element-B3y9oplH.js";import{n as m}from"./class-map-CxwNmq0D.js";import{c as p}from"./index-BCyVn8MQ.js";import{d as g,r as v}from"./index-vt25O9Am.js";import{C as c}from"./ConstantsUtil-Di3dRDAF.js";import{R as $,O as u}from"./W3MFrameProviderSingleton-Be2imJ8Z.js";import{au as y}from"./NetworkUtil-EoWQDMpU.js";const b=g`
|
|
2
2
|
:host {
|
|
3
3
|
display: flex;
|
|
4
4
|
justify-content: center;
|