ghost 6.37.1 → 6.38.0
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/components/tryghost-i18n-0.0.0.tgz +0 -0
- package/core/boot.js +13 -9
- package/core/bridge.js +10 -6
- package/core/built/admin/assets/{PolarAngleAxis-Cavik65s.js → PolarAngleAxis-CB-FJBDa.js} +1 -1
- package/core/built/admin/assets/{_baseAssignValue-CnqN6ZMT.js → _baseAssignValue-BEAjPAfy.js} +1 -1
- package/core/built/admin/assets/{a-large-small-Wi4LtZX-.js → a-large-small-L1BJa6mG.js} +1 -1
- package/core/built/admin/assets/admin-x-settings/admin-x-settings.js +1 -1
- package/core/built/admin/assets/admin-x-settings/{code-editor-view-Cf8T5Jfd.mjs → code-editor-view-bOZzJ3a1.mjs} +2 -2
- package/core/built/admin/assets/admin-x-settings/{index-BMWEh-vR.mjs → index-BRuMxaCz.mjs} +2 -2
- package/core/built/admin/assets/admin-x-settings/{index-Aj-hFSnY.mjs → index-CTAQj489.mjs} +5 -5
- package/core/built/admin/assets/admin-x-settings/{index-DjBJrXYn.mjs → index-WoKKBOe4.mjs} +2 -2
- package/core/built/admin/assets/admin-x-settings/{modals-8WpWZZdI.mjs → modals-BQ5M-RTA.mjs} +3 -3
- package/core/built/admin/assets/{arrow-right-BiAOKOto.js → arrow-right-B2j-ecEK.js} +1 -1
- package/core/built/admin/assets/{at-sign-z5gBMxDW.js → at-sign-CtAw8_lw.js} +1 -1
- package/core/built/admin/assets/{audience-DxNilLIv.js → audience-CvSOqHuo.js} +1 -1
- package/core/built/admin/assets/automations-BVUNuVOh.js +1 -0
- package/core/built/admin/assets/automations-Bi9RJq5E.js +1 -0
- package/core/built/admin/assets/{avatar-flipboard-5OzseZFV.js → avatar-flipboard-DocLTXLh.js} +1 -1
- package/core/built/admin/assets/{bluesky-sharing-D9YcSpW8.js → bluesky-sharing-DafX2lE1.js} +1 -1
- package/core/built/admin/assets/chart-BRQeD9eh.js +67 -0
- package/core/built/admin/assets/{chevron-up-DVt6fhV3.js → chevron-up-v4_QwmnL.js} +1 -1
- package/core/built/admin/assets/{chunk.524.fcd26ef812d73e2b0620.js → chunk.524.c3d844070c24d7984fd7.js} +4 -4
- package/core/built/admin/assets/{chunk.582.b61ffaad1c2fa4aba820.js → chunk.582.0e0ede1eac12926acceb.js} +6 -6
- package/core/built/admin/assets/{chunk.383.adb5a3fe32b6b98c43ff.js → chunk.995.4b32363ab39da3e7f5d7.js} +3 -3
- package/core/built/admin/assets/circle-alert-Dbz54fYb.js +1 -0
- package/core/built/admin/assets/{code-editor-view-CbQIqTrK.js → code-editor-view-D-pYCcdu.js} +1 -1
- package/core/built/admin/assets/comments-DSv09jRn.js +1 -0
- package/core/built/admin/assets/{content-helpers-jANWGIfA.js → content-helpers-DQdPPDGb.js} +1 -1
- package/core/built/admin/assets/{copy-BBLeLEnG.js → copy-BULQsPZ4.js} +1 -1
- package/core/built/admin/assets/{data-list-BveeOSGI.js → data-list-WxXC0iKE.js} +1 -1
- package/core/built/admin/assets/{deleted-feed-item-DupAEk4P.js → deleted-feed-item-ZBLfgRkK.js} +1 -1
- package/core/built/admin/assets/{dropzone-D3PSdAHN.js → dropzone-B8mAoWrn.js} +1 -1
- package/core/built/admin/assets/{edit-profile-NrCR9_bi.js → edit-profile-Bj3th8H0.js} +1 -1
- package/core/built/admin/assets/editor-BZV40eAE.css +1 -0
- package/core/built/admin/assets/editor-u20VuPzn.js +7 -0
- package/core/built/admin/assets/{empty-indicator-Dhi_KeYX.js → empty-indicator-P3IsUguf.js} +1 -1
- package/core/built/admin/assets/{en-BontI3SP.js → en-C9bUnuy7.js} +1 -1
- package/core/built/admin/assets/{feed-B3Kfiz5R.js → feed-B94mO944.js} +1 -1
- package/core/built/admin/assets/{filter-query-core-Dwh4Qulu.js → filter-query-core-CM0KKIr2.js} +1 -1
- package/core/built/admin/assets/filters-D52FTE0z.js +1 -0
- package/core/built/admin/assets/gh-chart-Xa6Nvzwz.js +1 -0
- package/core/built/admin/assets/{ghost-c25434d5bbf5a5429883d4c3590f1946.js → ghost-82f1c4ffe0e1cd058ce4b66b5253b620.js} +159 -201
- package/core/built/admin/assets/{ghost-dark-52df27573e5f2a75e6cf4b1d06eea9e4.css → ghost-dark-9897cf5102772faedf566e5e54d4fbee.css} +1 -1
- package/core/built/admin/assets/{ghost-fcf460028e04192f392f16e173f2e3a8.css → ghost-e11f1814be0f38e98bb77b49eba11178.css} +1 -1
- package/core/built/admin/assets/{growth-DRH8zUIJ.js → growth-D3TW3JIB.js} +1 -1
- package/core/built/admin/assets/{hash-UvX5iOa9.js → hash-CstXS-iB.js} +1 -1
- package/core/built/admin/assets/{header-G1a38jnf.js → header-StkTITw-.js} +1 -1
- package/core/built/admin/assets/{inbox-By7HZskI.js → inbox-D1RM3kVF.js} +1 -1
- package/core/built/admin/assets/index-BEkJ9xtY.css +1 -0
- package/core/built/admin/assets/{index-CS_ZmI8F.js → index-BJx5Uas5.js} +1 -1
- package/core/built/admin/assets/index-BKzg6OE7.js +1 -0
- package/core/built/admin/assets/{index-D7JyKf1m.js → index-BM-MBdD0.js} +1 -1
- package/core/built/admin/assets/index-BRzvVuXt.js +2 -0
- package/core/built/admin/assets/index-B_3xqeM9.js +1 -0
- package/core/built/admin/assets/{index-ydyrczVl.js → index-C-OdR2wJ.js} +1 -1
- package/core/built/admin/assets/{index-X-MG1ikg.js → index-C59QlJqT.js} +1 -1
- package/core/built/admin/assets/{index-CJo0Qh4V.js → index-CCq_1tCo.js} +1 -1
- package/core/built/admin/assets/{index-qHUvPjQB.js → index-CYyEyBYw.js} +11 -11
- package/core/built/admin/assets/{index-CX4ztLSk.js → index-DHbiBjyq.js} +1 -1
- package/core/built/admin/assets/{index-BP6hBbPK.js → index-DTVgSMyL.js} +2 -2
- package/core/built/admin/assets/{index-vZMbI8e8.js → index-DiUjEgRw.js} +1 -1
- package/core/built/admin/assets/{index-YM4ZplGj.js → index-DugxKzA6.js} +1 -1
- package/core/built/admin/assets/{index-D8InZCr2.js → index-DzVHlhO1.js} +1 -1
- package/core/built/admin/assets/{index-D4b7U6K-.js → index-LsaD9Cq7.js} +1 -1
- package/core/built/admin/assets/{index-DRUPF8nN.js → index-x0hNfyqU.js} +1 -1
- package/core/built/admin/assets/{inline-Bc9zHR7e.js → inline-B4cWemrJ.js} +1 -1
- package/core/built/admin/assets/{koenig-lexical-B-ZnqRE1.js → koenig-lexical-BOdeH3QJ.js} +1 -1
- package/core/built/admin/assets/{kpi-card-zyi5Onb0.js → kpi-card-P7zSpcx0.js} +1 -1
- package/core/built/admin/assets/{kpi-card-CzlPIEPE.js → kpi-card-plhYOEtA.js} +1 -1
- package/core/built/admin/assets/{kpi-tabs-Dsa5ldXK.js → kpi-tabs-DZw2Qktb.js} +1 -1
- package/core/built/admin/assets/{kpis-Cw5ZRQhk.js → kpis-CDHM0xhW.js} +1 -1
- package/core/built/admin/assets/{label-BvxmsD1M.js → label-Ckacdx14.js} +1 -1
- package/core/built/admin/assets/{links-CiS5BPKS.js → links-BtXE5d0Y.js} +1 -1
- package/core/built/admin/assets/{list-filter-zmkB7rg4.js → list-filter-DLjjiktn.js} +1 -1
- package/core/built/admin/assets/{list-header-Cp779e3H.js → list-header-Cc7Ia3nr.js} +1 -1
- package/core/built/admin/assets/loader-circle-DLJd-dNm.js +1 -0
- package/core/built/admin/assets/{mail-i2qs8CIG.js → mail-B97w28e2.js} +1 -1
- package/core/built/admin/assets/{main-layout-KCvKOX8F.js → main-layout-bwWvzc9B.js} +1 -1
- package/core/built/admin/assets/{members-w601v5JJ.js → members-CokS8MI2.js} +5 -5
- package/core/built/admin/assets/{message-square-text-bG9IoWIt.js → message-square-text-D3rsjDFR.js} +1 -1
- package/core/built/admin/assets/minus-BzXQVmMw.js +1 -0
- package/core/built/admin/assets/{modals-lNzhiL0o.js → modals-D0lip-iy.js} +2 -2
- package/core/built/admin/assets/{moderation-CyfNRSWj.js → moderation-Dv7AadCV.js} +1 -1
- package/core/built/admin/assets/newsletter-BazC5rIj.js +1 -0
- package/core/built/admin/assets/{newsletters-B8xSXSr_.js → newsletters-m6HQgU5J.js} +1 -1
- package/core/built/admin/assets/{note-dNfKEpxw.js → note-CCGiEKz-.js} +1 -1
- package/core/built/admin/assets/{onboarding-route-Drbw0QtT.js → onboarding-route-Cbt7qWNE.js} +1 -1
- package/core/built/admin/assets/overview-TN50tzUh.js +1 -0
- package/core/built/admin/assets/{pagemenu-VJXMoMB4.js → pagemenu-BXrHWtsU.js} +1 -1
- package/core/built/admin/assets/{pencil-DHNmlLjO.js → pencil-BL1r8KVy.js} +1 -1
- package/core/built/admin/assets/{post-analytics-PsqLsS2e.js → post-analytics-BqEXi6Ps.js} +1 -1
- package/core/built/admin/assets/{post-analytics-context-QLZsZCFg.js → post-analytics-context-DekYNlb3.js} +1 -1
- package/core/built/admin/assets/{post-analytics-header-PecXsIT-.js → post-analytics-header-AkNbn6uc.js} +1 -1
- package/core/built/admin/assets/{post-share-modal-B4Rvo7W1.js → post-share-modal-CXDGVKoQ.js} +1 -1
- package/core/built/admin/assets/posts/{app-utils-DIc5TmxO.mjs → app-utils-DxA7edI_.mjs} +2 -2
- package/core/built/admin/assets/posts/{automations-BZpT35kJ.mjs → automations-Cwu_gHl4.mjs} +64 -67
- package/core/built/admin/assets/posts/automations-D81hV_2c.mjs +13 -0
- package/core/built/admin/assets/posts/{avatar-K63cvqSS.mjs → avatar-IkjEzEjI.mjs} +19 -19
- package/core/built/admin/assets/posts/{button-ufGBCcsV.mjs → button-KaJZKcou.mjs} +21 -21
- package/core/built/admin/assets/posts/{check-IcEnuTpD.mjs → check-Cf74RvZ1.mjs} +21 -21
- package/core/built/admin/assets/posts/{comments-CyJU9Ums.mjs → comments-pdKhYbYG.mjs} +54 -52
- package/core/built/admin/assets/posts/createLucideIcon-Cj7h3r9g.mjs +320 -0
- package/core/built/admin/assets/posts/{dialog-D6_lBvtT.mjs → dialog-Ci3W8fjx.mjs} +71 -76
- package/core/built/admin/assets/posts/{dropdown-menu-BSSmAory.mjs → dropdown-menu-DZ9XCHSw.mjs} +5 -5
- package/core/built/admin/assets/posts/editor-Bb-xle0o.mjs +6084 -0
- package/core/built/admin/assets/posts/ellipsis-ChhZo9aT.mjs +10 -0
- package/core/built/admin/assets/posts/{empty-indicator-DvGCvRAX.mjs → empty-indicator-DnFs7hDy.mjs} +2 -2
- package/core/built/admin/assets/posts/{filters-BLBaHhJz.mjs → filters-CO_FUPX-.mjs} +42 -40
- package/core/built/admin/assets/posts/get-site-timezone-C21yKZT_.mjs +87 -0
- package/core/built/admin/assets/posts/{growth-Bz1ChJNB.mjs → growth-CtX9Efm2.mjs} +12 -12
- package/core/built/admin/assets/posts/heading-DZ_KtDTL.mjs +138 -0
- package/core/built/admin/assets/posts/{hooks-BEngBys9.mjs → hooks-DVhBDVlA.mjs} +3 -2
- package/core/built/admin/assets/posts/{index-BAF0YXsp.mjs → index-B4db8w_H.mjs} +181 -172
- package/core/built/admin/assets/posts/{inline-C2YFQAdU.mjs → inline-BfB-SNk0.mjs} +2 -2
- package/core/built/admin/assets/posts/{input-surface-TqJlNSp_.mjs → input-surface-CNwZJloi.mjs} +2 -2
- package/core/built/admin/assets/posts/{kpis-DAX5_0-Q.mjs → kpis-BvY_5Y1u.mjs} +8792 -8803
- package/core/built/admin/assets/posts/{links-A1YTsBbF.mjs → links-Ck-h7SKg.mjs} +57 -57
- package/core/built/admin/assets/posts/{loading-indicator-BZsjmp8g.mjs → loading-indicator-B_rU9Lie.mjs} +3 -3
- package/core/built/admin/assets/posts/mail-DiZ3oKEW.mjs +9 -0
- package/core/built/admin/assets/posts/{main-layout-D_HHTP_n.mjs → main-layout-aYo6qOBZ.mjs} +2 -2
- package/core/built/admin/assets/posts/{newsletter-BRzgjOIa.mjs → newsletter-BQc53TF2.mjs} +31 -30
- package/core/built/admin/assets/posts/{overview-C41VFjn7.mjs → overview-blz9Ak9q.mjs} +42 -41
- package/core/built/admin/assets/posts/plus-YVjtYaK3.mjs +15 -0
- package/core/built/admin/assets/posts/{post-analytics-DGgMkFaf.mjs → post-analytics-BQbWGoeu.mjs} +6 -6
- package/core/built/admin/assets/posts/{post-analytics-context-B1r3HBrp.mjs → post-analytics-context-Be7THgnd.mjs} +7 -7
- package/core/built/admin/assets/posts/{post-analytics-header-DTWSO0Aq.mjs → post-analytics-header-iDFy7Bao.mjs} +2762 -2764
- package/core/built/admin/assets/posts/{post-share-modal-ohHwk0Yt.mjs → post-share-modal-akP16idN.mjs} +50 -48
- package/core/built/admin/assets/posts/posts.js +2 -1
- package/core/built/admin/assets/posts/{settings-CZYL6Jhr.mjs → settings-BdQhfHxY.mjs} +2 -2
- package/core/built/admin/assets/posts/{sheet-D7YesQJE.mjs → sheet-3dBlKeXf.mjs} +14 -13
- package/core/built/admin/assets/posts/{skeleton-S1k58YKa.mjs → skeleton-DMgSvYqr.mjs} +11 -11
- package/core/built/admin/assets/posts/{source-icon-DnpCy5N4.mjs → source-icon-Bp5Qxq1E.mjs} +4 -4
- package/core/built/admin/assets/posts/{stats-CbOpowXb.mjs → stats-DJx9qc_u.mjs} +4 -4
- package/core/built/admin/assets/posts/{table-Cw3Wxf1C.mjs → table-BpVwuzeH.mjs} +2 -2
- package/core/built/admin/assets/posts/{data-list-BnZARP88.mjs → tabs-CbZCpxfI.mjs} +4885 -5284
- package/core/built/admin/assets/posts/{tags-BoMt6Ce3.mjs → tags-CNtvDS6f.mjs} +33 -33
- package/core/built/admin/assets/posts/{tags-CNdsvTtZ.mjs → tags-DFOoFZ_3.mjs} +2 -2
- package/core/built/admin/assets/posts/{tooltip-CTcyINxz.mjs → tooltip-Cc_09RDU.mjs} +106 -117
- package/core/built/admin/assets/posts/value-CwGM7M-1.mjs +410 -0
- package/core/built/admin/assets/posts/{virtual-list-window-Bs88yrut.mjs → virtual-list-window-D6nRoL0y.mjs} +5 -5
- package/core/built/admin/assets/posts/{web-Bsd8eTP6.mjs → web-yfPssEt8.mjs} +1042 -1040
- package/core/built/admin/assets/posts/x-DrUGcpfp.mjs +9 -0
- package/core/built/admin/assets/posts/zap-DAN0ur-o.mjs +24 -0
- package/core/built/admin/assets/posts-D-jyPPE6.js +1 -0
- package/core/built/admin/assets/power-Cc5ncYVl.js +1 -0
- package/core/built/admin/assets/{referrers-kcBT5smx.js → referrers-qnXsKsuv.js} +1 -1
- package/core/built/admin/assets/{repeat-Cn2sKd-L.js → repeat-BGIBynZH.js} +1 -1
- package/core/built/admin/assets/{reply-D7E-ZMd5.js → reply-DOKdAsL_.js} +1 -1
- package/core/built/admin/assets/{rocket-DnH0XAGW.js → rocket-CAN2NB82.js} +1 -1
- package/core/built/admin/assets/{select-f0MMMQWu.js → select-8S9kYGSM.js} +1 -1
- package/core/built/admin/assets/{settings-BAQNP3gU.js → settings-DeD-bmZc.js} +4 -4
- package/core/built/admin/assets/{settings-ORttG1jT.js → settings-e4IB9sx6.js} +1 -1
- package/core/built/admin/assets/{share-modal-CXU4tGY8.js → share-modal-CBavk20I.js} +1 -1
- package/core/built/admin/assets/{sort-button-BXMrChFu.js → sort-button-DlSKBzUq.js} +1 -1
- package/core/built/admin/assets/{source-icon-cjy79jGT.js → source-icon-27VIJSXr.js} +1 -1
- package/core/built/admin/assets/{sprout-DZ4tZ78G.js → sprout-D66nqc79.js} +1 -1
- package/core/built/admin/assets/{square-vOzqJf7x.js → square-DccaXQWe.js} +1 -1
- package/core/built/admin/assets/stats/{audience-5NeJICtP.mjs → audience-B84ClTDM.mjs} +3 -3
- package/core/built/admin/assets/stats/{content-helpers-DFSTl3uB.mjs → content-helpers-CBAddUg7.mjs} +4 -4
- package/core/built/admin/assets/stats/{index-C4T7u699.mjs → index-Bz5oVpED.mjs} +5 -5
- package/core/built/admin/assets/stats/{index-B8bp6qe2.mjs → index-Cs8i1uR4.mjs} +74 -75
- package/core/built/admin/assets/stats/{index-wvi17m79.mjs → index-DEsP_Tbd.mjs} +8 -8
- package/core/built/admin/assets/stats/{index-CFfAYHdD.mjs → index-Ds-pM47x.mjs} +5 -5
- package/core/built/admin/assets/stats/{index-Chqk7VlR.mjs → index-Wzk1IcAz.mjs} +6 -6
- package/core/built/admin/assets/stats/{kpi-tabs-Df9yOI2P.mjs → kpi-tabs-Cs4l8B_M.mjs} +7 -7
- package/core/built/admin/assets/stats/{sort-button-Doi8OgMU.mjs → sort-button-rR-GA9Hu.mjs} +3 -3
- package/core/built/admin/assets/stats/{stats-FXeCefyd.mjs → stats-RFpEJpEq.mjs} +34 -34
- package/core/built/admin/assets/stats/stats.js +1 -1
- package/core/built/admin/assets/stats/{use-growth-stats-93C_3EZk.mjs → use-growth-stats-DwgFzbq9.mjs} +3 -3
- package/core/built/admin/assets/{stats-CIGz2Win.js → stats-B4OybenW.js} +1 -1
- package/core/built/admin/assets/{stats-view-BTKRxYTQ.js → stats-view-BuExwFXa.js} +1 -1
- package/core/built/admin/assets/{step-1-BSMHbT-q.js → step-1-D_5LOQrC.js} +1 -1
- package/core/built/admin/assets/{step-2-_YC0LCZv.js → step-2-BZLBj8cj.js} +1 -1
- package/core/built/admin/assets/{step-3-DWMqP2bO.js → step-3-s5uNbcOH.js} +1 -1
- package/core/built/admin/assets/{table-mHKjXQba.js → table-pGS7EeJe.js} +1 -1
- package/core/built/admin/assets/{tabs-B93IVRBz.js → tabs-CjdKssUe.js} +1 -1
- package/core/built/admin/assets/{tags-DCb-x2ZB.js → tags-B0vRk0A6.js} +1 -1
- package/core/built/admin/assets/{tags-kUHJ1MZo.js → tags-Dso4-FA_.js} +1 -1
- package/core/built/admin/assets/{textarea-DswCtM7_.js → textarea-DzFnun0_.js} +1 -1
- package/core/built/admin/assets/{tiers-DueraQKd.js → tiers-4Vkr_D-L.js} +1 -1
- package/core/built/admin/assets/{toggle-group-ChTo8MPD.js → toggle-group-hDsr47IB.js} +1 -1
- package/core/built/admin/assets/{topic-filter-DrW3fYWo.js → topic-filter-C7TpPe1G.js} +1 -1
- package/core/built/admin/assets/{trash-B2ESGftj.js → trash-DCVuk7ZX.js} +1 -1
- package/core/built/admin/assets/{underline-vo-bPRac.js → underline-CjK8la2G.js} +1 -1
- package/core/built/admin/assets/{upload-DXQRkBBq.js → upload-CPYhmtWZ.js} +1 -1
- package/core/built/admin/assets/{use-growth-stats-CoB8-lsd.js → use-growth-stats-CaFSgp_R.js} +1 -1
- package/core/built/admin/assets/{use-simple-pagination-Y_Wv2N6g.js → use-simple-pagination-D0vJBMvF.js} +1 -1
- package/core/built/admin/assets/{user-round-check-Dp9a2x-e.js → user-round-check-CzQQeFd8.js} +1 -1
- package/core/built/admin/assets/{user-round-x-DwCTGlxc.js → user-round-x-BDFm8yQj.js} +1 -1
- package/core/built/admin/assets/value-BGBiTkF3.js +1 -0
- package/core/built/admin/assets/{vendor-17f3b979ba6f3898d1a8c5249cc22ff1.js → vendor-ce3fc901ccbcf37f36eb791b4e454138.js} +29 -31
- package/core/built/admin/assets/{virtual-list-window-BF7IvGMC.js → virtual-list-window-EKtWZ5cP.js} +1 -1
- package/core/built/admin/assets/{wallet-cards-IEmcxJvG.js → wallet-cards-C1NOBbWE.js} +1 -1
- package/core/built/admin/assets/web-DCA7HR1S.js +1 -0
- package/core/built/admin/index.html +8 -8
- package/core/frontend/helpers/social_accounts.js +91 -0
- package/core/frontend/services/sitemap/handler.js +14 -2
- package/core/frontend/services/sitemap/site-map-manager.js +133 -9
- package/core/frontend/web/middleware/handle-image-sizes.js +4 -0
- package/core/server/api/endpoints/automations.js +38 -45
- package/core/server/models/member.js +30 -25
- package/core/server/services/automations/automations-api.js +58 -0
- package/core/server/services/automations/automations-api.ts +71 -0
- package/core/server/services/automations/automations-repository.js +2 -0
- package/core/server/services/automations/automations-repository.ts +63 -0
- package/core/server/services/automations/fake-database-automations-repository.js +210 -0
- package/core/server/services/automations/fake-database-automations-repository.ts +273 -0
- package/core/server/services/automations/temporary-fake-database.js +5 -4
- package/core/server/services/gifts/email-templates/gift-purchase-confirmation.hbs +10 -32
- package/core/server/services/gifts/email-templates/gift-purchase-confirmation.js +6 -8
- package/core/server/services/gifts/email-templates/gift-purchase-confirmation.ts +6 -8
- package/core/server/services/gifts/email-templates/gift-reminder.hbs +12 -37
- package/core/server/services/gifts/email-templates/gift-reminder.js +5 -9
- package/core/server/services/gifts/email-templates/gift-reminder.ts +5 -9
- package/core/server/services/gifts/gift-service.js +1 -1
- package/core/server/services/gifts/gift-service.ts +2 -2
- package/core/server/services/member-welcome-emails/service.js +0 -1
- package/core/server/services/members/members-api/controllers/router-controller.js +52 -7
- package/core/server/services/members/members-api/services/member-bread-service.js +0 -8
- package/core/server/services/route-settings/route-settings.js +18 -2
- package/core/server/services/staff/email-templates/gift.hbs +1 -1
- package/core/server/services/staff/email-templates/gift.txt.js +1 -1
- package/core/server/services/staff/email-templates/new-gift-subscription.hbs +1 -1
- package/core/server/services/staff/email-templates/new-gift-subscription.txt.js +1 -1
- package/core/server/services/staff/staff-service-emails.js +1 -1
- package/core/server/services/url/index.js +16 -1
- package/core/server/services/url/lazy-find-resource.js +49 -0
- package/core/server/services/url/lazy-find-resource.ts +62 -0
- package/core/server/services/url/lazy-url-service.js +220 -0
- package/core/server/services/url/lazy-url-service.ts +265 -0
- package/core/server/web/api/endpoints/admin/routes.js +1 -0
- package/core/server/web/gift-preview/Inter.ttf +0 -0
- package/core/server/web/gift-preview/controller.js +56 -6
- package/core/server/web/gift-preview/gift-card-noise.png +0 -0
- package/core/server/web/gift-preview/gift-card-orb.png +0 -0
- package/core/server/web/gift-preview/image.js +170 -43
- package/core/shared/config/defaults.json +1 -0
- package/core/shared/one-at-a-time.js +28 -33
- package/core/shared/one-at-a-time.ts +58 -0
- package/package.json +18 -16
- package/pnpm-lock.yaml +989 -356
- package/core/built/admin/assets/automations-D1uMjd06.js +0 -1
- package/core/built/admin/assets/chart-_EXssQtm.js +0 -67
- package/core/built/admin/assets/comments-E00h1SbR.js +0 -1
- package/core/built/admin/assets/filters-CC7XfjOS.js +0 -1
- package/core/built/admin/assets/gh-chart-B9_ywrJJ.js +0 -1
- package/core/built/admin/assets/index-AsV-aY0z.css +0 -1
- package/core/built/admin/assets/index-B0y_ynZw.js +0 -1
- package/core/built/admin/assets/index-Bs6wWbLA.js +0 -2
- package/core/built/admin/assets/index-Cb4641XW.js +0 -1
- package/core/built/admin/assets/loader-circle-B5UPqSok.js +0 -1
- package/core/built/admin/assets/minus-DWx9VUtr.js +0 -1
- package/core/built/admin/assets/newsletter-fkQye9OK.js +0 -1
- package/core/built/admin/assets/overview-CZ-VrnXy.js +0 -1
- package/core/built/admin/assets/posts/createLucideIcon-DcUfTBt_.mjs +0 -454
- package/core/built/admin/assets/posts/get-site-timezone-DlXmHA3y.mjs +0 -93
- package/core/built/admin/assets/posts-Bx1RWrub.js +0 -1
- package/core/built/admin/assets/web-DSME3e8c.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as K,r as u,b as $,j as e,R as H,T as L,c7 as Ne,g as Ce,t as Ue,P as Me,V as Be,A as ae,B as j,m as ie,h as Pe,e as X,bD as De,F as ce,aZ as de,a1 as ue,cL as Te,a2 as xe,a3 as _,a4 as Y,a5 as W,H as q,bW as Fe,a$ as Oe,a6 as G,a7 as me,W as U,cM as Re,cN as Ie,cO as Ee,cP as ne,a8 as Se,a9 as Ae,u as fe,cq as $e,a as He,K as Le,M as ze,N as Ve,O as Qe,L as te,E as _e,c as Ye,S as R,b5 as We,D as qe,q as Ge,v as Ke,w as Xe,x as Ze,Q as Je,a0 as es,cQ as ss,s as re,o as ls,n as ns,cC as V,U as ts,bz as rs,bA as os,cR as as,cS as he,cT as is}from"./index-qHUvPjQB.js";import{P as cs}from"./pencil-DHNmlLjO.js";import{E as ds}from"./edit-profile-NrCR9_bi.js";import{T as us,a as xs,b as S,d as Q,c as A}from"./tabs-B93IVRBz.js";import{a as ms}from"./settings-ORttG1jT.js";import{U as fs}from"./user-round-x-DwCTGlxc.js";import{C as hs}from"./copy-BBLeLEnG.js";import"./label-BvxmsD1M.js";import"./textarea-DswCtM7_.js";import"./at-sign-z5gBMxDW.js";function ps(s){return typeof s.name=="string"?s.name:typeof s.preferredUsername=="string"?s.preferredUsername:typeof s.preferredUsername=="object"&&s.preferredUsername!==null&&"@value"in s.preferredUsername&&typeof s.preferredUsername["@value"]=="string"?s.preferredUsername["@value"]:"Unknown"}const pe=({noResultsMessage:s,actors:o,isLoading:n,fetchNextPage:c,hasNextPage:m,isFetchingNextPage:d})=>{const i=K("index","me"),{data:r}=i,t=u.useRef(null),a=u.useRef(null);u.useEffect(()=>(t.current&&t.current.disconnect(),t.current=new IntersectionObserver(l=>{l[0].isIntersecting&&m&&!d&&c()}),a.current&&t.current.observe(a.current),()=>{t.current&&t.current.disconnect()}),[m,d,c]);const x=$();return e.jsxs("div",{className:"pt-3","data-testid":"actor-list",children:[m===!1&&o.length===0?e.jsxs(H,{children:[e.jsx(L,{children:e.jsx(Ne,{})}),s]}):e.jsx("div",{className:"flex flex-col",children:o.map(({actor:l,isFollowing:h,blockedByMe:b,domainBlockedByMe:k})=>{const w=l.handle||Ce(l),y=w===r?.handle;return e.jsx(Ue.Fragment,{children:e.jsx(Me,{actor:l,align:"center",isCurrentUser:y,side:"left",children:e.jsx("div",{children:e.jsxs(Be,{"data-testid":"actor-item",onClick:()=>{Pe(l,x)},children:[e.jsx(ae,{author:l}),e.jsx("div",{children:e.jsxs("div",{className:"break-anywhere text-gray-600",children:[e.jsx("span",{className:"mr-1 line-clamp-1 font-bold text-black dark:text-white",children:ps(l)}),e.jsx("div",{className:"line-clamp-1 text-sm",children:w})]})}),b||k?e.jsx(j,{className:"pointer-events-none ml-auto min-w-[90px]",variant:"destructive",children:"Blocked"}):y?null:e.jsx(ie,{className:"ml-auto","data-testid":"follow-button",following:h,handle:w,type:"secondary"})]},l.id)})})},l.id)})}),e.jsx("div",{ref:a,className:"h-1"}),(d||n)&&e.jsx("div",{className:"mt-6 flex flex-col items-center justify-center gap-4 text-center",children:e.jsx(X,{size:"md"})})]})},js=({posts:s,fetchNextPage:o,hasNextPage:n,isFetchingNextPage:c,isLoading:m})=>{const d=u.useRef(null),i=u.useRef(null),r=u.useRef(null),t=Math.max(0,Math.floor(s.length*.75)-1);u.useEffect(()=>(d.current&&d.current.disconnect(),d.current=new IntersectionObserver(x=>{x[0].isIntersecting&&n&&!c&&o()}),i.current&&d.current.observe(i.current),r.current&&d.current.observe(r.current),()=>{d.current&&d.current.disconnect()}),[n,c,o]);const a=$();return e.jsxs(e.Fragment,{children:[n===!1&&s.length===0&&e.jsxs(H,{children:[e.jsx(L,{children:e.jsx(De,{})}),"You haven't liked anything yet."]}),e.jsxs("ul",{className:"mx-auto flex max-w-[640px] flex-col","data-testid":"profile-likes-list",children:[s.map((x,l)=>e.jsxs("li",{"data-testid":"profile-like-item","data-test-view-article":!0,children:[e.jsx(ce,{actor:x.actor,allowDelete:x.object.authored,commentCount:x.object.replyCount,isLoading:m,layout:"feed",likeCount:x.object.likeCount,object:x.object,repostCount:x.object.repostCount,type:x.type,onClick:()=>{x.object.type==="Note"?a(`/notes/${encodeURIComponent(x.object.id)}`):x.object.type==="Article"&&a(`/reader/${encodeURIComponent(x.object.id)}`)}}),l<s.length-1&&e.jsx(de,{}),l===t&&e.jsx("div",{ref:i,className:"h-1"})]},`likes-${x.id}`)),c&&e.jsx("li",{className:"flex flex-col items-center justify-center gap-4 text-center",children:e.jsx(X,{size:"md"})})]}),e.jsx("div",{ref:r,className:"h-1"})]})},bs=({posts:s,fetchNextPage:o,hasNextPage:n,isFetchingNextPage:c,isLoading:m,noResultsMessage:d})=>{const i=u.useRef(null),r=u.useRef(null),t=u.useRef(null),a=Math.max(0,Math.floor(s.length*.75)-1);u.useEffect(()=>(i.current&&i.current.disconnect(),i.current=new IntersectionObserver(l=>{l[0].isIntersecting&&n&&!c&&o()}),r.current&&i.current.observe(r.current),t.current&&i.current.observe(t.current),()=>{i.current&&i.current.disconnect()}),[n,c,o]);const x=$();return e.jsxs(e.Fragment,{children:[n===!1&&s.length===0&&e.jsxs(H,{children:[e.jsx(L,{children:e.jsx(cs,{})}),d]}),e.jsxs("ul",{className:"mx-auto flex max-w-[640px] flex-col","data-testid":"profile-posts-list",children:[s.map((l,h)=>e.jsxs("li",{"data-testid":"profile-post-item","data-test-view-article":!0,children:[e.jsx(ce,{actor:l.actor,allowDelete:l.object.authored,commentCount:l.object.replyCount,isLoading:m,layout:"feed",likeCount:l.object.likeCount,object:l.object,repostCount:l.object.repostCount,type:l.type,onClick:()=>{l.object.type==="Note"?x(`/notes/${encodeURIComponent(l.object.id)}`):l.object.type==="Article"&&x(`/reader/${encodeURIComponent(l.object.id)}`)}}),h<s.length-1&&e.jsx(de,{}),h===a&&e.jsx("div",{ref:r,className:"h-1"})]},`posts-${l.id}`)),c&&e.jsx("li",{className:"flex flex-col items-center justify-center gap-4 text-center",children:e.jsx(X,{size:"md"})})]}),e.jsx("div",{ref:t,className:"h-1"})]})},je=({handle:s,isUserBlocked:o,isDomainBlocked:n,onUnblockUser:c,onUnblockDomain:m,trigger:d,onUnblockComplete:i,isOpen:r,onOpenChange:t})=>{const[a,x]=u.useState(!1),[l,h]=u.useState(()=>{const p=o&&n,N=o&&!n,F=!o&&n;let g="idle";return p?g="dual":N?g="userOnly":F&&(g="domainOnly"),{mode:g,userUnblocked:!1,domainUnblocked:!1}}),b=r!==void 0,k=b?r:a,[w,y]=u.useState(!1),M=u.useCallback(()=>{const p=o&&n,N=o&&!n,F=!o&&n;let g="idle";p?g="dual":N?g="userOnly":F&&(g="domainOnly"),h(C=>({...C,mode:g,userUnblocked:!1,domainUnblocked:!1}))},[o,n]);u.useEffect(()=>{k&&!w?(M(),y(!0)):k||y(!1)},[k,w,M]);const D=()=>{b?t?.(!0):x(!0)},f=p=>{p||(b?t?.(!1):x(!1))},I=async()=>{await c(),h(p=>({...p,userUnblocked:!0})),(l.mode!=="dual"||l.domainUnblocked)&&(f(!1),i?.()),U.success("User unblocked")},E=async()=>{await m(),h(p=>({...p,domainUnblocked:!0})),(l.mode!=="dual"||l.userUnblocked)&&(f(!1),i?.()),U.success("Domain unblocked")},T=s.split("@").filter(Boolean)[1],B=()=>e.jsxs(e.Fragment,{children:[e.jsxs(_,{children:[e.jsx(Y,{className:"mb-1 flex flex-col gap-1",children:"Unblock"}),e.jsx(W,{className:"mt-4!",asChild:!0,children:e.jsxs("div",{className:"flex flex-col rounded-md border",children:[e.jsxs("div",{className:"flex justify-between gap-6 p-5",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(q,{children:"Unblock user"}),e.jsxs("p",{children:[e.jsx("span",{className:"font-semibold text-black",children:s})," will be able to follow you and engage with your public posts."]})]}),e.jsxs(j,{className:`gap-1 ${l.userUnblocked?"pointer-events-none border-green bg-green text-white hover:bg-green hover:text-white":"text-red hover:text-red-400"}`,variant:"outline",onClick:I,children:[e.jsx(Fe,{}),l.userUnblocked?"User unblocked":"Unblock user"]})]}),e.jsx("div",{className:"border-t"}),e.jsxs("div",{className:"flex justify-between gap-6 p-5",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(q,{children:"Unblock domain"}),e.jsxs("p",{children:["Users from ",e.jsx("span",{className:"font-semibold text-black",children:T})," will be able to follow you and engage with your public posts."]})]}),e.jsxs(j,{className:`gap-1 ${l.domainUnblocked?"pointer-events-none border-green bg-green text-white hover:bg-green hover:text-white":"text-red hover:text-red-400"}`,variant:"outline",onClick:E,children:[e.jsx(Oe,{}),l.domainUnblocked?"Domain unblocked":"Unblock domain"]})]})]})})]}),e.jsx(G,{children:e.jsx(j,{onClick:()=>f(!1),children:"OK"})})]}),P=()=>{const p=l.mode==="userOnly";return e.jsxs(e.Fragment,{children:[e.jsxs(_,{children:[e.jsx(Y,{className:"mb-1 flex flex-col gap-1",children:p?"Unblock this user?":"Unblock this domain?"}),e.jsx(W,{children:p?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-semibold text-black",children:s})," will be able to follow you and engage with your public posts."]}):e.jsxs(e.Fragment,{children:["Users from ",e.jsx("span",{className:"font-semibold text-black",children:T})," will be able to follow you and engage with your public posts."]})})]}),e.jsxs(G,{children:[e.jsx(me,{children:"Cancel"}),e.jsx(j,{onClick:p?I:E,children:"Unblock"})]})]})};return e.jsxs(ue,{open:k,onOpenChange:f,children:[d&&e.jsx(Te,{asChild:!0,onClick:D,children:d}),e.jsx(xe,{className:`${l.mode==="dual"&&"max-w-[600px]"}`,children:l.mode==="dual"?B():P()})]})},gs=({account:s,children:o,onCopyHandle:n,onBlockAccount:c,onBlockDomain:m,disabled:d=!1,isBlocked:i=!1,isDomainBlocked:r=!1})=>{const[t,a]=u.useState(null),[x,l]=u.useState(!1),h=f=>{f.stopPropagation(),n()},b=f=>{f.stopPropagation(),c()},k=f=>{f.stopPropagation(),m()},w=s?.handle,y=w?.split("@").filter(Boolean)[1],M=()=>e.jsx(ue,{open:x,onOpenChange:l,children:e.jsxs(xe,{onClick:f=>f.stopPropagation(),children:[e.jsxs(_,{children:[e.jsx(Y,{className:"mb-1 flex flex-col gap-1",children:t==="user"?"Block this user?":"Block this domain?"}),e.jsx(W,{children:t==="user"?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-semibold text-black",children:w})," will be able to see your public posts, but will no longer be able follow you or interact with your content on the social web."]}):e.jsxs(e.Fragment,{children:["All users from ",e.jsx("span",{className:"font-semibold text-black",children:y})," will be able to see your public posts, but won't be able to follow you or interact with your content."]})})]}),e.jsxs(G,{children:[t!=="domain"&&e.jsx(j,{className:"mr-auto -ml-3 hover:bg-transparent hover:opacity-80",variant:"ghost",onClick:f=>{f.stopPropagation(),a("domain")},children:"Block domain instead"}),e.jsx(me,{onClick:f=>f.stopPropagation(),children:"Cancel"}),e.jsx(Se,{className:Ae({variant:"destructive"}),onClick:t==="user"?b:k,children:"Block"})]})]})}),D=()=>s&&e.jsx(je,{handle:s.handle,isDomainBlocked:s.domainBlockedByMe,isOpen:x,isUserBlocked:s.blockedByMe,onOpenChange:l,onUnblockDomain:m,onUnblockUser:c});return e.jsxs(e.Fragment,{children:[e.jsxs(Re,{children:[e.jsx(Ie,{disabled:d,asChild:!0,onClick:f=>f.stopPropagation(),children:o}),e.jsx(Ee,{align:"end",className:"p-2",children:e.jsxs("div",{className:"flex w-48 flex-col",children:[e.jsx(ne,{asChild:!0,children:e.jsx(j,{className:"justify-start",variant:"ghost",onClick:h,children:"Copy handle"})}),e.jsx(ne,{asChild:!0,children:e.jsx(j,{className:"justify-start text-red hover:bg-red/5 hover:text-red",variant:"ghost",onClick:f=>{f.stopPropagation(),!i&&!r&&a("user"),l(!0)},children:i?"Unblock user":r?"Unblock domain":"Block user"})})]})})]}),i||r?D():M()]})},ks=({account:s,onUnblock:o,onDomainUnblock:n,className:c=""})=>{const[m,d]=u.useState(!1),i=e.jsx(j,{className:`min-w-[90px] ${c}`,variant:"destructive",onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),children:m?"Unblock":"Blocked"});return e.jsx(je,{handle:s.handle,isDomainBlocked:s.domainBlockedByMe,isUserBlocked:s.blockedByMe,trigger:i,onUnblockDomain:n,onUnblockUser:o})},oe=()=>{},ws=({account:s,customFields:o,isLoadingAccount:n,postsTab:c,likesTab:m,followingTab:d,followersTab:i})=>{const r=fe(),t=$e(),a=$(),{canGoBack:x}=He(),l=r.handle?`/profile/${r.handle}`:"/profile",h=!r.handle,b=r.handle?r.tab||"":t.pathname.split("/").pop()||"",k=u.useMemo(()=>h?["likes","following","followers"]:["following","followers"],[h]),w=k.includes(b)?b:"posts",y=Le("index"),M=ze("index"),D=Ve("index"),f=Qe("index"),I=K("index","me"),{data:E}=r.handle?I:{data:void 0},T=r.handle===E?.handle||!r.handle,B=s?.blockedByMe,P=s?.domainBlockedByMe,[p,N]=u.useState(!1),[F,g]=u.useState(!1),C=u.useRef(null);u.useEffect(()=>()=>{C.current&&window.clearTimeout(C.current)},[]);const Z=()=>{B?M.mutate(s):(y.mutate(s),U.success("User blocked")),N(!1)},J=()=>{P?f.mutate({url:s.apId,handle:s.handle}):(D.mutate({url:s.apId,handle:s.handle}),U.success("Domain blocked")),N(!1)},ee=async()=>{if(!s?.handle||!navigator?.clipboard?.writeText){U.error("Unable to copy handle");return}try{await navigator.clipboard.writeText(s.handle),g(!0),U.success("Handle copied"),C.current&&window.clearTimeout(C.current),C.current=window.setTimeout(()=>g(!1),2e3)}catch{U.error("Failed to copy handle"),g(!1)}},[O,be]=u.useState(!1),[ge,se]=u.useState(!1),ke=()=>{be(!O)},z=u.useRef(null),[le,we]=u.useState(!1);u.useEffect(()=>{z.current&&we(z.current.scrollHeight>160)},[O,s?.bio,o,n]),u.useEffect(()=>{b&&(k.includes(b)||a(l,{replace:!0}))},[k,l,a,b]);const ve=v=>v==="posts"?l:`${l}/${v}`,ye=v=>{v!==w&&a(ve(v),{replace:!0})};return!n&&!s?e.jsx(te,{children:e.jsx("div",{className:"mx-auto mt-4 flex w-full max-w-[620px] flex-col items-center [&_svg]:translate-x-px",children:e.jsxs(_e,{children:[e.jsx(Ye,{children:e.jsx(fs,{})}),e.jsx("div",{children:"Profile not found"})]})})}):e.jsx(te,{children:e.jsx("div",{className:"z-0 mx-[max(-4vw,-32px)] -mt-9 flex flex-col items-center pb-16",children:e.jsx("div",{className:"mx-auto w-full",children:e.jsxs(e.Fragment,{children:[s?.bannerImageUrl?e.jsx("div",{className:"h-[15vw] min-h-[200px] w-full overflow-hidden bg-gradient-to-tr from-gray-200 to-gray-100",children:e.jsx("img",{alt:s?.name,className:"size-full object-cover",referrerPolicy:"no-referrer",src:s?.bannerImageUrl})}):e.jsx("div",{className:"h-[max(8vw,132px)] w-full overflow-hidden bg-gradient-to-tr from-white to-white dark:from-black dark:to-black"}),e.jsxs("div",{className:`mx-auto max-w-[620px] px-6 ${!s?.bannerImageUrl&&!x?"-mt-8":"-mt-12"}`,children:[e.jsxs("div",{className:"flex items-end justify-between",children:[e.jsx("div",{className:"-ml-2 rounded-full bg-white p-1 dark:bg-black",children:n?e.jsx(R,{className:"size-[92px] rounded-full"}):e.jsx(ae,{author:{icon:{url:s?.avatarUrl},name:s?.name,handle:s?.handle},size:"lg"})}),!T&&!n&&e.jsxs("div",{className:"flex gap-2",children:[B||P?e.jsx(ks,{account:s,onDomainUnblock:J,onUnblock:Z}):e.jsx(ie,{following:s?.followedByMe,handle:s?.handle,type:"primary",onFollow:oe,onUnfollow:oe}),e.jsx(gs,{account:s,isBlocked:B,isDomainBlocked:P,onBlockAccount:Z,onBlockDomain:J,onCopyHandle:ee,children:e.jsx(j,{"aria-label":"Open profile menu",variant:"outline",children:e.jsx(We,{})})})]}),T&&!n&&e.jsxs(qe,{open:ge,onOpenChange:se,children:[e.jsx(Ge,{children:e.jsx(ms,{children:e.jsx(j,{variant:"secondary",children:"Edit profile"})})}),e.jsxs(Ke,{className:"w-full max-w-[520px]",onOpenAutoFocus:v=>v.preventDefault(),children:[e.jsx(Xe,{children:e.jsx(Ze,{children:"Profile settings"})}),s&&e.jsx(ds,{account:s,setIsEditingProfile:se})]})]})]}),e.jsx(Je,{className:"break-anywhere mt-4 truncate",children:n?e.jsx(R,{className:"w-32"}):s?.name}),e.jsxs("div",{className:"mb-4 flex items-center gap-2",children:[e.jsx("a",{className:"inline-flex max-w-full truncate text-[1.5rem] text-gray-800 hover:text-gray-900 dark:text-gray-600 dark:hover:text-gray-500",href:s?.url,rel:"noopener noreferrer",target:"_blank",children:e.jsx("span",{className:"truncate",children:n?e.jsx(R,{className:"w-full max-w-56"}):s?.handle})}),!n&&e.jsx(j,{className:"-ml-1.5 size-6 p-0 text-gray-800 hover:text-gray-900 dark:text-gray-700 dark:hover:text-gray-600",title:"Copy handle",variant:"link",onClick:ee,children:F?e.jsx(es,{size:16}):e.jsx(hs,{size:16})}),s?.followsMe&&!n&&e.jsx(ss,{className:"mt-px whitespace-nowrap",variant:"secondary",children:"Follows you"})]}),(s?.bio||o?.length>0)&&e.jsxs("div",{ref:z,className:`ap-profile-content break-anywhere relative text-[1.5rem] [&>p]:mb-3 ${O?"max-h-none pb-7":"max-h-[160px] overflow-hidden"} relative`,children:[n?e.jsxs(e.Fragment,{children:[e.jsx(R,{}),e.jsx(R,{className:"w-full max-w-48"})]}):e.jsx("div",{dangerouslySetInnerHTML:{__html:re(ls(ns(s?.bio??"",["a","br"])))}}),o?.map(v=>e.jsxs("span",{className:"mt-3 line-clamp-1 flex flex-col text-[1.5rem]",children:[e.jsx("span",{className:"text-xs font-semibold",children:v.name}),e.jsx("span",{dangerouslySetInnerHTML:{__html:re(v.value)},className:"ap-profile-content truncate"})]})),!O&&le&&e.jsx("div",{className:"absolute inset-x-0 bottom-0 h-16 bg-gradient-to-t from-white via-white/100 via-60% to-transparent dark:from-black dark:via-black/100"}),le&&e.jsx(j,{className:"absolute bottom-0 h-auto p-0 text-md",variant:"link",onClick:ke,children:O?"Show less":"Show all"})]}),e.jsxs(us,{className:"mt-5",value:w,variant:"underline",onValueChange:v=>ye(v),children:[e.jsxs(xs,{children:[e.jsx(S,{value:"posts",children:"Posts"}),h&&e.jsxs(S,{value:"likes",children:["Likes",e.jsx(Q,{children:V(s?.likedCount||0)})]}),e.jsxs(S,{value:"following",children:["Following",e.jsx(Q,{children:V(s?.followingCount||0)})]}),e.jsxs(S,{value:"followers",children:["Followers",e.jsx(Q,{children:V(s?.followerCount||0)})]})]}),e.jsx(A,{value:"posts",children:(B||P)&&!p?e.jsxs(H,{children:[e.jsx(L,{children:e.jsx(ts,{})}),e.jsxs("div",{className:"mt-2 flex flex-col items-center gap-0.5",children:[e.jsxs(q,{children:[s.name," is blocked"]}),e.jsx("p",{children:"You can view the posts, but it won't unblock the user."}),e.jsx(j,{className:"mt-4",variant:"secondary",onClick:()=>N(!0),children:"View posts"})]})]}):c}),h&&e.jsx(A,{value:"likes",children:m}),e.jsx(A,{value:"following",children:d}),e.jsx(A,{value:"followers",children:i})]},r.handle||s?.handle||"current-user")]})]})})})})},vs=({handle:s})=>{const{postsByAccountQuery:o}=as(s||"me",{enabled:!0}),{data:n,fetchNextPage:c,hasNextPage:m,isFetchingNextPage:d,isLoading:i}=o,r=n?.pages.flatMap(t=>t.posts)??Array.from({length:5},(t,a)=>({id:`placeholder-${a}`,object:{}}));return e.jsx(bs,{fetchNextPage:c,hasNextPage:m,isFetchingNextPage:d,isLoading:i,noResultsMessage:s?`${s} hasn't posted anything yet`:"You haven't posted anything yet.",posts:r})},ys=()=>{const{postsLikedByAccountQuery:s}=is({enabled:!0}),{data:o,fetchNextPage:n,hasNextPage:c,isFetchingNextPage:m,isLoading:d}=s,i=o?.pages.flatMap(r=>r.posts)??Array.from({length:5},(r,t)=>({id:`placeholder-${t}`,object:{}}));return e.jsx(js,{fetchNextPage:n,hasNextPage:c,isFetchingNextPage:m,isLoading:d,posts:i})},Ns=({handle:s})=>{const o=he(s===""?"me":s,"following"),{data:n,fetchNextPage:c,hasNextPage:m,isFetchingNextPage:d,isLoading:i}=o,r=n?.pages.flatMap(t=>"following"in t?t.following:"accounts"in t?t.accounts.map(a=>({actor:{id:a.id,name:a.name,handle:a.handle,icon:{url:a.avatarUrl}},isFollowing:a.isFollowing,blockedByMe:a.blockedByMe,domainBlockedByMe:a.domainBlockedByMe})):[])??[];return e.jsx(pe,{actors:r,fetchNextPage:c,hasNextPage:m,isFetchingNextPage:d,isLoading:i,noResultsMessage:`${s||"You"} have no following`})},Cs=({handle:s})=>{const o=he(s===""?"me":s,"followers"),{data:n,fetchNextPage:c,hasNextPage:m,isFetchingNextPage:d,isLoading:i}=o,r=n?.pages.flatMap(t=>"followers"in t?t.followers:"accounts"in t?t.accounts.map(a=>({actor:{id:a.id,name:a.name,handle:a.handle,icon:{url:a.avatarUrl}},isFollowing:a.isFollowing})):[])??[];return e.jsx(pe,{actors:r,fetchNextPage:c,hasNextPage:m,isFetchingNextPage:d,isLoading:i,noResultsMessage:`${s||"You"} have no followers yet`})},Es=({})=>{const s=fe(),{data:o,isLoading:n,error:c,refetch:m}=K("index",s.handle||"me");if(u.useEffect(()=>{m()},[s.handle,m]),c&&rs(c)&&c.statusCode!==404)return e.jsx(os,{errorCode:c.code,statusCode:c.statusCode});const d=Object.keys(o?.customFields||{}).map(x=>({name:x,value:o.customFields[x]}))||[],i=e.jsx(vs,{handle:s.handle||""}),r=e.jsx(ys,{}),t=e.jsx(Ns,{handle:s.handle||""}),a=e.jsx(Cs,{handle:s.handle||""});return e.jsx(ws,{account:o,customFields:d,followersTab:a,followingTab:t,isLoadingAccount:n,likesTab:r,postsTab:i})};export{Es as default};
|
|
1
|
+
import{l as K,r as u,b as $,j as e,R as H,T as L,c7 as Ne,g as Ce,t as Ue,P as Me,V as Be,A as ae,B as j,m as ie,h as Pe,e as X,bD as De,F as ce,aZ as de,a1 as ue,cL as Te,a2 as xe,a3 as _,a4 as Y,a5 as W,H as q,bW as Fe,a$ as Oe,a6 as G,a7 as me,W as U,cM as Re,cN as Ie,cO as Ee,cP as ne,a8 as Se,a9 as Ae,u as fe,cq as $e,a as He,K as Le,M as ze,N as Ve,O as Qe,L as te,E as _e,c as Ye,S as R,b5 as We,D as qe,q as Ge,v as Ke,w as Xe,x as Ze,Q as Je,a0 as es,cQ as ss,s as re,o as ls,n as ns,cC as V,U as ts,bz as rs,bA as os,cR as as,cS as he,cT as is}from"./index-CYyEyBYw.js";import{P as cs}from"./pencil-BL1r8KVy.js";import{E as ds}from"./edit-profile-Bj3th8H0.js";import{T as us,a as xs,b as S,d as Q,c as A}from"./tabs-CjdKssUe.js";import{a as ms}from"./settings-e4IB9sx6.js";import{U as fs}from"./user-round-x-BDFm8yQj.js";import{C as hs}from"./copy-BULQsPZ4.js";import"./label-Ckacdx14.js";import"./textarea-DzFnun0_.js";import"./at-sign-CtAw8_lw.js";function ps(s){return typeof s.name=="string"?s.name:typeof s.preferredUsername=="string"?s.preferredUsername:typeof s.preferredUsername=="object"&&s.preferredUsername!==null&&"@value"in s.preferredUsername&&typeof s.preferredUsername["@value"]=="string"?s.preferredUsername["@value"]:"Unknown"}const pe=({noResultsMessage:s,actors:o,isLoading:n,fetchNextPage:c,hasNextPage:m,isFetchingNextPage:d})=>{const i=K("index","me"),{data:r}=i,t=u.useRef(null),a=u.useRef(null);u.useEffect(()=>(t.current&&t.current.disconnect(),t.current=new IntersectionObserver(l=>{l[0].isIntersecting&&m&&!d&&c()}),a.current&&t.current.observe(a.current),()=>{t.current&&t.current.disconnect()}),[m,d,c]);const x=$();return e.jsxs("div",{className:"pt-3","data-testid":"actor-list",children:[m===!1&&o.length===0?e.jsxs(H,{children:[e.jsx(L,{children:e.jsx(Ne,{})}),s]}):e.jsx("div",{className:"flex flex-col",children:o.map(({actor:l,isFollowing:h,blockedByMe:b,domainBlockedByMe:k})=>{const w=l.handle||Ce(l),y=w===r?.handle;return e.jsx(Ue.Fragment,{children:e.jsx(Me,{actor:l,align:"center",isCurrentUser:y,side:"left",children:e.jsx("div",{children:e.jsxs(Be,{"data-testid":"actor-item",onClick:()=>{Pe(l,x)},children:[e.jsx(ae,{author:l}),e.jsx("div",{children:e.jsxs("div",{className:"break-anywhere text-gray-600",children:[e.jsx("span",{className:"mr-1 line-clamp-1 font-bold text-black dark:text-white",children:ps(l)}),e.jsx("div",{className:"line-clamp-1 text-sm",children:w})]})}),b||k?e.jsx(j,{className:"pointer-events-none ml-auto min-w-[90px]",variant:"destructive",children:"Blocked"}):y?null:e.jsx(ie,{className:"ml-auto","data-testid":"follow-button",following:h,handle:w,type:"secondary"})]},l.id)})})},l.id)})}),e.jsx("div",{ref:a,className:"h-1"}),(d||n)&&e.jsx("div",{className:"mt-6 flex flex-col items-center justify-center gap-4 text-center",children:e.jsx(X,{size:"md"})})]})},js=({posts:s,fetchNextPage:o,hasNextPage:n,isFetchingNextPage:c,isLoading:m})=>{const d=u.useRef(null),i=u.useRef(null),r=u.useRef(null),t=Math.max(0,Math.floor(s.length*.75)-1);u.useEffect(()=>(d.current&&d.current.disconnect(),d.current=new IntersectionObserver(x=>{x[0].isIntersecting&&n&&!c&&o()}),i.current&&d.current.observe(i.current),r.current&&d.current.observe(r.current),()=>{d.current&&d.current.disconnect()}),[n,c,o]);const a=$();return e.jsxs(e.Fragment,{children:[n===!1&&s.length===0&&e.jsxs(H,{children:[e.jsx(L,{children:e.jsx(De,{})}),"You haven't liked anything yet."]}),e.jsxs("ul",{className:"mx-auto flex max-w-[640px] flex-col","data-testid":"profile-likes-list",children:[s.map((x,l)=>e.jsxs("li",{"data-testid":"profile-like-item","data-test-view-article":!0,children:[e.jsx(ce,{actor:x.actor,allowDelete:x.object.authored,commentCount:x.object.replyCount,isLoading:m,layout:"feed",likeCount:x.object.likeCount,object:x.object,repostCount:x.object.repostCount,type:x.type,onClick:()=>{x.object.type==="Note"?a(`/notes/${encodeURIComponent(x.object.id)}`):x.object.type==="Article"&&a(`/reader/${encodeURIComponent(x.object.id)}`)}}),l<s.length-1&&e.jsx(de,{}),l===t&&e.jsx("div",{ref:i,className:"h-1"})]},`likes-${x.id}`)),c&&e.jsx("li",{className:"flex flex-col items-center justify-center gap-4 text-center",children:e.jsx(X,{size:"md"})})]}),e.jsx("div",{ref:r,className:"h-1"})]})},bs=({posts:s,fetchNextPage:o,hasNextPage:n,isFetchingNextPage:c,isLoading:m,noResultsMessage:d})=>{const i=u.useRef(null),r=u.useRef(null),t=u.useRef(null),a=Math.max(0,Math.floor(s.length*.75)-1);u.useEffect(()=>(i.current&&i.current.disconnect(),i.current=new IntersectionObserver(l=>{l[0].isIntersecting&&n&&!c&&o()}),r.current&&i.current.observe(r.current),t.current&&i.current.observe(t.current),()=>{i.current&&i.current.disconnect()}),[n,c,o]);const x=$();return e.jsxs(e.Fragment,{children:[n===!1&&s.length===0&&e.jsxs(H,{children:[e.jsx(L,{children:e.jsx(cs,{})}),d]}),e.jsxs("ul",{className:"mx-auto flex max-w-[640px] flex-col","data-testid":"profile-posts-list",children:[s.map((l,h)=>e.jsxs("li",{"data-testid":"profile-post-item","data-test-view-article":!0,children:[e.jsx(ce,{actor:l.actor,allowDelete:l.object.authored,commentCount:l.object.replyCount,isLoading:m,layout:"feed",likeCount:l.object.likeCount,object:l.object,repostCount:l.object.repostCount,type:l.type,onClick:()=>{l.object.type==="Note"?x(`/notes/${encodeURIComponent(l.object.id)}`):l.object.type==="Article"&&x(`/reader/${encodeURIComponent(l.object.id)}`)}}),h<s.length-1&&e.jsx(de,{}),h===a&&e.jsx("div",{ref:r,className:"h-1"})]},`posts-${l.id}`)),c&&e.jsx("li",{className:"flex flex-col items-center justify-center gap-4 text-center",children:e.jsx(X,{size:"md"})})]}),e.jsx("div",{ref:t,className:"h-1"})]})},je=({handle:s,isUserBlocked:o,isDomainBlocked:n,onUnblockUser:c,onUnblockDomain:m,trigger:d,onUnblockComplete:i,isOpen:r,onOpenChange:t})=>{const[a,x]=u.useState(!1),[l,h]=u.useState(()=>{const p=o&&n,N=o&&!n,F=!o&&n;let g="idle";return p?g="dual":N?g="userOnly":F&&(g="domainOnly"),{mode:g,userUnblocked:!1,domainUnblocked:!1}}),b=r!==void 0,k=b?r:a,[w,y]=u.useState(!1),M=u.useCallback(()=>{const p=o&&n,N=o&&!n,F=!o&&n;let g="idle";p?g="dual":N?g="userOnly":F&&(g="domainOnly"),h(C=>({...C,mode:g,userUnblocked:!1,domainUnblocked:!1}))},[o,n]);u.useEffect(()=>{k&&!w?(M(),y(!0)):k||y(!1)},[k,w,M]);const D=()=>{b?t?.(!0):x(!0)},f=p=>{p||(b?t?.(!1):x(!1))},I=async()=>{await c(),h(p=>({...p,userUnblocked:!0})),(l.mode!=="dual"||l.domainUnblocked)&&(f(!1),i?.()),U.success("User unblocked")},E=async()=>{await m(),h(p=>({...p,domainUnblocked:!0})),(l.mode!=="dual"||l.userUnblocked)&&(f(!1),i?.()),U.success("Domain unblocked")},T=s.split("@").filter(Boolean)[1],B=()=>e.jsxs(e.Fragment,{children:[e.jsxs(_,{children:[e.jsx(Y,{className:"mb-1 flex flex-col gap-1",children:"Unblock"}),e.jsx(W,{className:"mt-4!",asChild:!0,children:e.jsxs("div",{className:"flex flex-col rounded-md border",children:[e.jsxs("div",{className:"flex justify-between gap-6 p-5",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(q,{children:"Unblock user"}),e.jsxs("p",{children:[e.jsx("span",{className:"font-semibold text-black",children:s})," will be able to follow you and engage with your public posts."]})]}),e.jsxs(j,{className:`gap-1 ${l.userUnblocked?"pointer-events-none border-green bg-green text-white hover:bg-green hover:text-white":"text-red hover:text-red-400"}`,variant:"outline",onClick:I,children:[e.jsx(Fe,{}),l.userUnblocked?"User unblocked":"Unblock user"]})]}),e.jsx("div",{className:"border-t"}),e.jsxs("div",{className:"flex justify-between gap-6 p-5",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(q,{children:"Unblock domain"}),e.jsxs("p",{children:["Users from ",e.jsx("span",{className:"font-semibold text-black",children:T})," will be able to follow you and engage with your public posts."]})]}),e.jsxs(j,{className:`gap-1 ${l.domainUnblocked?"pointer-events-none border-green bg-green text-white hover:bg-green hover:text-white":"text-red hover:text-red-400"}`,variant:"outline",onClick:E,children:[e.jsx(Oe,{}),l.domainUnblocked?"Domain unblocked":"Unblock domain"]})]})]})})]}),e.jsx(G,{children:e.jsx(j,{onClick:()=>f(!1),children:"OK"})})]}),P=()=>{const p=l.mode==="userOnly";return e.jsxs(e.Fragment,{children:[e.jsxs(_,{children:[e.jsx(Y,{className:"mb-1 flex flex-col gap-1",children:p?"Unblock this user?":"Unblock this domain?"}),e.jsx(W,{children:p?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-semibold text-black",children:s})," will be able to follow you and engage with your public posts."]}):e.jsxs(e.Fragment,{children:["Users from ",e.jsx("span",{className:"font-semibold text-black",children:T})," will be able to follow you and engage with your public posts."]})})]}),e.jsxs(G,{children:[e.jsx(me,{children:"Cancel"}),e.jsx(j,{onClick:p?I:E,children:"Unblock"})]})]})};return e.jsxs(ue,{open:k,onOpenChange:f,children:[d&&e.jsx(Te,{asChild:!0,onClick:D,children:d}),e.jsx(xe,{className:`${l.mode==="dual"&&"max-w-[600px]"}`,children:l.mode==="dual"?B():P()})]})},gs=({account:s,children:o,onCopyHandle:n,onBlockAccount:c,onBlockDomain:m,disabled:d=!1,isBlocked:i=!1,isDomainBlocked:r=!1})=>{const[t,a]=u.useState(null),[x,l]=u.useState(!1),h=f=>{f.stopPropagation(),n()},b=f=>{f.stopPropagation(),c()},k=f=>{f.stopPropagation(),m()},w=s?.handle,y=w?.split("@").filter(Boolean)[1],M=()=>e.jsx(ue,{open:x,onOpenChange:l,children:e.jsxs(xe,{onClick:f=>f.stopPropagation(),children:[e.jsxs(_,{children:[e.jsx(Y,{className:"mb-1 flex flex-col gap-1",children:t==="user"?"Block this user?":"Block this domain?"}),e.jsx(W,{children:t==="user"?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-semibold text-black",children:w})," will be able to see your public posts, but will no longer be able follow you or interact with your content on the social web."]}):e.jsxs(e.Fragment,{children:["All users from ",e.jsx("span",{className:"font-semibold text-black",children:y})," will be able to see your public posts, but won't be able to follow you or interact with your content."]})})]}),e.jsxs(G,{children:[t!=="domain"&&e.jsx(j,{className:"mr-auto -ml-3 hover:bg-transparent hover:opacity-80",variant:"ghost",onClick:f=>{f.stopPropagation(),a("domain")},children:"Block domain instead"}),e.jsx(me,{onClick:f=>f.stopPropagation(),children:"Cancel"}),e.jsx(Se,{className:Ae({variant:"destructive"}),onClick:t==="user"?b:k,children:"Block"})]})]})}),D=()=>s&&e.jsx(je,{handle:s.handle,isDomainBlocked:s.domainBlockedByMe,isOpen:x,isUserBlocked:s.blockedByMe,onOpenChange:l,onUnblockDomain:m,onUnblockUser:c});return e.jsxs(e.Fragment,{children:[e.jsxs(Re,{children:[e.jsx(Ie,{disabled:d,asChild:!0,onClick:f=>f.stopPropagation(),children:o}),e.jsx(Ee,{align:"end",className:"p-2",children:e.jsxs("div",{className:"flex w-48 flex-col",children:[e.jsx(ne,{asChild:!0,children:e.jsx(j,{className:"justify-start",variant:"ghost",onClick:h,children:"Copy handle"})}),e.jsx(ne,{asChild:!0,children:e.jsx(j,{className:"justify-start text-red hover:bg-red/5 hover:text-red",variant:"ghost",onClick:f=>{f.stopPropagation(),!i&&!r&&a("user"),l(!0)},children:i?"Unblock user":r?"Unblock domain":"Block user"})})]})})]}),i||r?D():M()]})},ks=({account:s,onUnblock:o,onDomainUnblock:n,className:c=""})=>{const[m,d]=u.useState(!1),i=e.jsx(j,{className:`min-w-[90px] ${c}`,variant:"destructive",onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),children:m?"Unblock":"Blocked"});return e.jsx(je,{handle:s.handle,isDomainBlocked:s.domainBlockedByMe,isUserBlocked:s.blockedByMe,trigger:i,onUnblockDomain:n,onUnblockUser:o})},oe=()=>{},ws=({account:s,customFields:o,isLoadingAccount:n,postsTab:c,likesTab:m,followingTab:d,followersTab:i})=>{const r=fe(),t=$e(),a=$(),{canGoBack:x}=He(),l=r.handle?`/profile/${r.handle}`:"/profile",h=!r.handle,b=r.handle?r.tab||"":t.pathname.split("/").pop()||"",k=u.useMemo(()=>h?["likes","following","followers"]:["following","followers"],[h]),w=k.includes(b)?b:"posts",y=Le("index"),M=ze("index"),D=Ve("index"),f=Qe("index"),I=K("index","me"),{data:E}=r.handle?I:{data:void 0},T=r.handle===E?.handle||!r.handle,B=s?.blockedByMe,P=s?.domainBlockedByMe,[p,N]=u.useState(!1),[F,g]=u.useState(!1),C=u.useRef(null);u.useEffect(()=>()=>{C.current&&window.clearTimeout(C.current)},[]);const Z=()=>{B?M.mutate(s):(y.mutate(s),U.success("User blocked")),N(!1)},J=()=>{P?f.mutate({url:s.apId,handle:s.handle}):(D.mutate({url:s.apId,handle:s.handle}),U.success("Domain blocked")),N(!1)},ee=async()=>{if(!s?.handle||!navigator?.clipboard?.writeText){U.error("Unable to copy handle");return}try{await navigator.clipboard.writeText(s.handle),g(!0),U.success("Handle copied"),C.current&&window.clearTimeout(C.current),C.current=window.setTimeout(()=>g(!1),2e3)}catch{U.error("Failed to copy handle"),g(!1)}},[O,be]=u.useState(!1),[ge,se]=u.useState(!1),ke=()=>{be(!O)},z=u.useRef(null),[le,we]=u.useState(!1);u.useEffect(()=>{z.current&&we(z.current.scrollHeight>160)},[O,s?.bio,o,n]),u.useEffect(()=>{b&&(k.includes(b)||a(l,{replace:!0}))},[k,l,a,b]);const ve=v=>v==="posts"?l:`${l}/${v}`,ye=v=>{v!==w&&a(ve(v),{replace:!0})};return!n&&!s?e.jsx(te,{children:e.jsx("div",{className:"mx-auto mt-4 flex w-full max-w-[620px] flex-col items-center [&_svg]:translate-x-px",children:e.jsxs(_e,{children:[e.jsx(Ye,{children:e.jsx(fs,{})}),e.jsx("div",{children:"Profile not found"})]})})}):e.jsx(te,{children:e.jsx("div",{className:"z-0 mx-[max(-4vw,-32px)] -mt-9 flex flex-col items-center pb-16",children:e.jsx("div",{className:"mx-auto w-full",children:e.jsxs(e.Fragment,{children:[s?.bannerImageUrl?e.jsx("div",{className:"h-[15vw] min-h-[200px] w-full overflow-hidden bg-gradient-to-tr from-gray-200 to-gray-100",children:e.jsx("img",{alt:s?.name,className:"size-full object-cover",referrerPolicy:"no-referrer",src:s?.bannerImageUrl})}):e.jsx("div",{className:"h-[max(8vw,132px)] w-full overflow-hidden bg-gradient-to-tr from-white to-white dark:from-black dark:to-black"}),e.jsxs("div",{className:`mx-auto max-w-[620px] px-6 ${!s?.bannerImageUrl&&!x?"-mt-8":"-mt-12"}`,children:[e.jsxs("div",{className:"flex items-end justify-between",children:[e.jsx("div",{className:"-ml-2 rounded-full bg-white p-1 dark:bg-black",children:n?e.jsx(R,{className:"size-[92px] rounded-full"}):e.jsx(ae,{author:{icon:{url:s?.avatarUrl},name:s?.name,handle:s?.handle},size:"lg"})}),!T&&!n&&e.jsxs("div",{className:"flex gap-2",children:[B||P?e.jsx(ks,{account:s,onDomainUnblock:J,onUnblock:Z}):e.jsx(ie,{following:s?.followedByMe,handle:s?.handle,type:"primary",onFollow:oe,onUnfollow:oe}),e.jsx(gs,{account:s,isBlocked:B,isDomainBlocked:P,onBlockAccount:Z,onBlockDomain:J,onCopyHandle:ee,children:e.jsx(j,{"aria-label":"Open profile menu",variant:"outline",children:e.jsx(We,{})})})]}),T&&!n&&e.jsxs(qe,{open:ge,onOpenChange:se,children:[e.jsx(Ge,{children:e.jsx(ms,{children:e.jsx(j,{variant:"secondary",children:"Edit profile"})})}),e.jsxs(Ke,{className:"w-full max-w-[520px]",onOpenAutoFocus:v=>v.preventDefault(),children:[e.jsx(Xe,{children:e.jsx(Ze,{children:"Profile settings"})}),s&&e.jsx(ds,{account:s,setIsEditingProfile:se})]})]})]}),e.jsx(Je,{className:"break-anywhere mt-4 truncate",children:n?e.jsx(R,{className:"w-32"}):s?.name}),e.jsxs("div",{className:"mb-4 flex items-center gap-2",children:[e.jsx("a",{className:"inline-flex max-w-full truncate text-[1.5rem] text-gray-800 hover:text-gray-900 dark:text-gray-600 dark:hover:text-gray-500",href:s?.url,rel:"noopener noreferrer",target:"_blank",children:e.jsx("span",{className:"truncate",children:n?e.jsx(R,{className:"w-full max-w-56"}):s?.handle})}),!n&&e.jsx(j,{className:"-ml-1.5 size-6 p-0 text-gray-800 hover:text-gray-900 dark:text-gray-700 dark:hover:text-gray-600",title:"Copy handle",variant:"link",onClick:ee,children:F?e.jsx(es,{size:16}):e.jsx(hs,{size:16})}),s?.followsMe&&!n&&e.jsx(ss,{className:"mt-px whitespace-nowrap",variant:"secondary",children:"Follows you"})]}),(s?.bio||o?.length>0)&&e.jsxs("div",{ref:z,className:`ap-profile-content break-anywhere relative text-[1.5rem] [&>p]:mb-3 ${O?"max-h-none pb-7":"max-h-[160px] overflow-hidden"} relative`,children:[n?e.jsxs(e.Fragment,{children:[e.jsx(R,{}),e.jsx(R,{className:"w-full max-w-48"})]}):e.jsx("div",{dangerouslySetInnerHTML:{__html:re(ls(ns(s?.bio??"",["a","br"])))}}),o?.map(v=>e.jsxs("span",{className:"mt-3 line-clamp-1 flex flex-col text-[1.5rem]",children:[e.jsx("span",{className:"text-xs font-semibold",children:v.name}),e.jsx("span",{dangerouslySetInnerHTML:{__html:re(v.value)},className:"ap-profile-content truncate"})]})),!O&&le&&e.jsx("div",{className:"absolute inset-x-0 bottom-0 h-16 bg-gradient-to-t from-white via-white/100 via-60% to-transparent dark:from-black dark:via-black/100"}),le&&e.jsx(j,{className:"absolute bottom-0 h-auto p-0 text-md",variant:"link",onClick:ke,children:O?"Show less":"Show all"})]}),e.jsxs(us,{className:"mt-5",value:w,variant:"underline",onValueChange:v=>ye(v),children:[e.jsxs(xs,{children:[e.jsx(S,{value:"posts",children:"Posts"}),h&&e.jsxs(S,{value:"likes",children:["Likes",e.jsx(Q,{children:V(s?.likedCount||0)})]}),e.jsxs(S,{value:"following",children:["Following",e.jsx(Q,{children:V(s?.followingCount||0)})]}),e.jsxs(S,{value:"followers",children:["Followers",e.jsx(Q,{children:V(s?.followerCount||0)})]})]}),e.jsx(A,{value:"posts",children:(B||P)&&!p?e.jsxs(H,{children:[e.jsx(L,{children:e.jsx(ts,{})}),e.jsxs("div",{className:"mt-2 flex flex-col items-center gap-0.5",children:[e.jsxs(q,{children:[s.name," is blocked"]}),e.jsx("p",{children:"You can view the posts, but it won't unblock the user."}),e.jsx(j,{className:"mt-4",variant:"secondary",onClick:()=>N(!0),children:"View posts"})]})]}):c}),h&&e.jsx(A,{value:"likes",children:m}),e.jsx(A,{value:"following",children:d}),e.jsx(A,{value:"followers",children:i})]},r.handle||s?.handle||"current-user")]})]})})})})},vs=({handle:s})=>{const{postsByAccountQuery:o}=as(s||"me",{enabled:!0}),{data:n,fetchNextPage:c,hasNextPage:m,isFetchingNextPage:d,isLoading:i}=o,r=n?.pages.flatMap(t=>t.posts)??Array.from({length:5},(t,a)=>({id:`placeholder-${a}`,object:{}}));return e.jsx(bs,{fetchNextPage:c,hasNextPage:m,isFetchingNextPage:d,isLoading:i,noResultsMessage:s?`${s} hasn't posted anything yet`:"You haven't posted anything yet.",posts:r})},ys=()=>{const{postsLikedByAccountQuery:s}=is({enabled:!0}),{data:o,fetchNextPage:n,hasNextPage:c,isFetchingNextPage:m,isLoading:d}=s,i=o?.pages.flatMap(r=>r.posts)??Array.from({length:5},(r,t)=>({id:`placeholder-${t}`,object:{}}));return e.jsx(js,{fetchNextPage:n,hasNextPage:c,isFetchingNextPage:m,isLoading:d,posts:i})},Ns=({handle:s})=>{const o=he(s===""?"me":s,"following"),{data:n,fetchNextPage:c,hasNextPage:m,isFetchingNextPage:d,isLoading:i}=o,r=n?.pages.flatMap(t=>"following"in t?t.following:"accounts"in t?t.accounts.map(a=>({actor:{id:a.id,name:a.name,handle:a.handle,icon:{url:a.avatarUrl}},isFollowing:a.isFollowing,blockedByMe:a.blockedByMe,domainBlockedByMe:a.domainBlockedByMe})):[])??[];return e.jsx(pe,{actors:r,fetchNextPage:c,hasNextPage:m,isFetchingNextPage:d,isLoading:i,noResultsMessage:`${s||"You"} have no following`})},Cs=({handle:s})=>{const o=he(s===""?"me":s,"followers"),{data:n,fetchNextPage:c,hasNextPage:m,isFetchingNextPage:d,isLoading:i}=o,r=n?.pages.flatMap(t=>"followers"in t?t.followers:"accounts"in t?t.accounts.map(a=>({actor:{id:a.id,name:a.name,handle:a.handle,icon:{url:a.avatarUrl}},isFollowing:a.isFollowing})):[])??[];return e.jsx(pe,{actors:r,fetchNextPage:c,hasNextPage:m,isFetchingNextPage:d,isLoading:i,noResultsMessage:`${s||"You"} have no followers yet`})},Es=({})=>{const s=fe(),{data:o,isLoading:n,error:c,refetch:m}=K("index",s.handle||"me");if(u.useEffect(()=>{m()},[s.handle,m]),c&&rs(c)&&c.statusCode!==404)return e.jsx(os,{errorCode:c.code,statusCode:c.statusCode});const d=Object.keys(o?.customFields||{}).map(x=>({name:x,value:o.customFields[x]}))||[],i=e.jsx(vs,{handle:s.handle||""}),r=e.jsx(ys,{}),t=e.jsx(Ns,{handle:s.handle||""}),a=e.jsx(Cs,{handle:s.handle||""});return e.jsx(ws,{account:o,customFields:d,followersTab:a,followingTab:t,isLoadingAccount:n,likesTab:r,postsTab:i})};export{Es as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{aX as K,r as A,b_ as L,b$ as W,j as e,S as N,b9 as se,B as z,a$ as M,ap as m,bV as te,z as D,ao as Q,cz as re,aY as le,cA as O,t as ce,cB as q,cs as de,bS as me,cC as X,bW as ue,cD as pe,al as xe,am as T,b2 as U,$ as he,bX as ge}from"./index-CYyEyBYw.js";import{g as H,S as fe,a as be,D as je,b as ve}from"./stats-view-BuExwFXa.js";import{C as $,a as E,b as F,g as V,c as I,S as Ne,P as we,E as ye,u as ke,i as _e}from"./pagemenu-BXrHWtsU.js";import{E as P}from"./empty-indicator-P3IsUguf.js";import{P as Ce}from"./post-share-modal-CXDGVKoQ.js";import{g as Ae,c as Le}from"./post-helpers-DR3PcyZg.js";import{g as ae,a as ze}from"./audience-CvSOqHuo.js";import{e as Te,G as B,f as Me,L as We,g as J,h as De}from"./gh-chart-Xa6Nvzwz.js";import{a as Y,M as $e,S as Z}from"./upload-CPYhmtWZ.js";import{K as Ee,a as Fe,b as Ve}from"./kpi-card-P7zSpcx0.js";import{u as Ie}from"./use-growth-stats-CaFSgp_R.js";import{u as Re}from"./posts-D-jyPPE6.js";import{h as Ue,i as Be}from"./stats-B4OybenW.js";import"./select-8S9kYGSM.js";import"./chevron-up-v4_QwmnL.js";import"./loader-circle-DLJd-dNm.js";import"./mail-B97w28e2.js";import"./sprout-D66nqc79.js";import"./share-modal-CBavk20I.js";import"./copy-BULQsPZ4.js";import"./a-large-small-L1BJa6mG.js";import"./wallet-cards-C1NOBbWE.js";import"./list-filter-DLjjiktn.js";import"./arrow-right-B2j-ecEK.js";import"./chart-BRQeD9eh.js";import"./_baseAssignValue-BEAjPAfy.js";import"./index-x0hNfyqU.js";import"./value-BGBiTkF3.js";import"./at-sign-CtAw8_lw.js";import"./underline-CjK8la2G.js";import"./circle-alert-Dbz54fYb.js";import"./power-Cc5ncYVl.js";import"./message-square-text-D3rsjDFR.js";import"./hash-CstXS-iB.js";import"./inbox-D1RM3kVF.js";import"./minus-BzXQVmMw.js";import"./pencil-BL1r8KVy.js";import"./square-DccaXQWe.js";import"./user-round-check-CzQQeFd8.js";import"./repeat-BGIBynZH.js";import"./reply-DOKdAsL_.js";import"./rocket-CAN2NB82.js";import"./tags-Dso4-FA_.js";import"./trash-DCVuk7ZX.js";import"./user-round-x-BDFm8yQj.js";import"./currency-fEUUCkj0.js";const Ge=s=>s.email_only?"Sent":s.email?"Published and sent":"Published",Se=({latestPostStats:s,isLoading:n})=>{const t=K(),[a,i]=A.useState(!1),{site:c,settings:p}=L(),{appSettings:l}=W(),{emailTrackClicks:o,emailTrackOpens:h,webAnalytics:d=!1,membersTrackSources:v=!1}=l?.analytics||{},r=c.title||String(p.find(j=>j.key==="title")?.value||"Ghost Site"),x=String(p.find(j=>j.key==="timezone")?.value||"Etc/UTC"),f=s?Ae(s,{membersTrackSources:v}):null,b="group mr-2 flex flex-col gap-1.5 hover:cursor-pointer",y=!!s?.email,_=ae({postId:s?.id,hasEmailData:y,analytics:{webAnalytics:d,membersTrackSources:v}}),w=_.startsWith("/editor/");return e.jsxs($,{className:"group/card bg-gradient-to-tr from-muted/40 to-muted/0 to-50%","data-testid":"latest-post",children:[e.jsxs(E,{children:[e.jsx(F,{className:"flex items-baseline justify-between leading-snug font-medium text-muted-foreground",children:"Latest post performance"}),e.jsx(V,{className:"hidden",children:"How your last post did"})]}),e.jsxs(I,{className:"flex flex-col gap-6 px-0 lg:flex-row xl:grid xl:grid-cols-3",children:[n&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex w-full items-center gap-6 px-6 xl:col-span-2",children:[e.jsx("div",{className:"w-full max-w-[232px] grow",children:e.jsx(N,{className:"aspect-[16/10] rounded-md"})}),e.jsxs("div",{className:"w-full grow",children:[e.jsx(N,{className:"w-full max-w-[420px]"}),e.jsx(N,{className:"w-1/2"})]})]}),e.jsx("div",{className:"flex flex-col items-stretch gap-2 px-6 text-sm",children:e.jsxs("div",{className:"grid grid-cols-2 gap-5",children:[e.jsxs("div",{children:[e.jsx(N,{className:"w-3/4"}),e.jsx(N,{className:"h-10 w-1/3"})]}),e.jsxs("div",{children:[e.jsx(N,{className:"w-3/4"}),e.jsx(N,{className:"h-10 w-1/3"})]}),e.jsxs("div",{children:[e.jsx(N,{className:"w-3/4"}),e.jsx(N,{className:"h-10 w-1/3"})]}),e.jsxs("div",{children:[e.jsx(N,{className:"w-3/4"}),e.jsx(N,{className:"h-10 w-1/3"})]})]})})]}),!n&&s&&f?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col gap-6 px-6 transition-all md:flex-row md:items-start xl:col-span-2",children:[s.feature_image&&e.jsx("div",{className:"aspect-[16/10] w-full min-w-[100px] rounded-sm bg-cover bg-center sm:max-w-[170px] lg:max-w-[170px] xl:max-w-[232px]",style:{backgroundImage:`url(${s.feature_image})`}}),e.jsxs("div",{className:"flex grow flex-col items-start justify-center self-stretch",children:[e.jsx("div",{className:"text-lg leading-tighter font-semibold tracking-tight hover:cursor-pointer hover:opacity-75",onClick:()=>{!n&&s&&t(_,{crossApp:!0})},children:s.title}),e.jsxs("div",{className:"mt-0.5 text-sm text-muted-foreground",children:[s.authors&&s.authors.length>0&&e.jsxs("div",{children:["By ",s.authors.map(j=>j.name).join(", ")," – ",se(s.published_at,x)]}),e.jsx("div",{className:"mt-0.5",children:Ge(s)})]}),e.jsxs("div",{className:"mt-6 flex items-center gap-2",children:[!s.email_only&&e.jsx(Ce,{author:s.authors?.map(j=>j.name).join(", ")||"",description:"",faviconURL:c.icon||"",featureImageURL:s.feature_image||"",open:a,postExcerpt:s.excerpt||"",postTitle:s.title,postURL:s.url||"",siteTitle:r,onClose:()=>i(!1),onOpenChange:i,children:e.jsxs(z,{onClick:()=>i(!0),children:[e.jsx(Ne,{})," Share post"]})}),e.jsx(z,{className:s.email_only?"w-full":"",variant:"outline",onClick:()=>{t(_,{crossApp:!0})},children:w?e.jsxs(e.Fragment,{children:[e.jsx(we,{}),e.jsx("span",{className:"hidden md:visible! md:block!",children:"Edit post"})]}):e.jsxs(e.Fragment,{children:[e.jsx(Te,{}),e.jsx("span",{className:"hidden md:visible! md:block!",children:s.email_only?"Post analytics":"Analytics"})]})})]})]})]}),e.jsx("div",{className:"-ml-4 flex w-full flex-col items-stretch gap-2 pr-6 text-sm xl:h-full xl:max-w-none",children:e.jsxs("div",{className:"grid grid-cols-2 gap-6 pl-10 lg:border-l xl:h-full",children:[f.showWebMetrics&&d&&e.jsxs("div",{className:b,"data-testid":"latest-post-visitors",onClick:()=>{t(`/posts/analytics/${s.id}/web`,{crossApp:!0})},children:[e.jsxs("div",{className:"flex items-center gap-1.5 font-medium text-muted-foreground transition-all group-hover:text-foreground",children:[e.jsx(M,{size:16,strokeWidth:1.25}),e.jsx("span",{className:"hidden md:visible! md:block!",children:"Visitors"})]}),e.jsx("span",{className:"text-[2.2rem] leading-none font-semibold tracking-tighter",children:m(s.visitors)})]}),f.showMemberGrowth&&e.jsxs("div",{className:D(b,f.showEmailMetrics&&(!f.showWebMetrics||!d)&&"row-[2/3] col-[1/2]"),"data-testid":"latest-post-members",onClick:()=>{t(`/posts/analytics/${s.id}/growth`,{crossApp:!0})},children:[e.jsxs("div",{className:"flex items-center gap-1.5 font-medium text-muted-foreground transition-all group-hover:text-foreground",children:[e.jsx(te,{size:16,strokeWidth:1.25}),e.jsx("span",{className:"hidden md:visible! md:block!",children:"Members"})]}),e.jsx("span",{className:"text-[2.2rem] leading-none font-semibold tracking-tighter",children:s.member_delta?e.jsxs(e.Fragment,{children:["+",m(s.member_delta)]}):0})]}),f.showEmailMetrics&&s.email&&e.jsxs(e.Fragment,{children:[h&&e.jsxs("div",{className:b,onClick:()=>{t(`/posts/analytics/${s.id}/newsletter`,{crossApp:!0})},children:[e.jsxs("div",{className:"flex items-center gap-1.5 font-medium text-muted-foreground transition-all group-hover:text-foreground",children:[e.jsx(Y,{size:16,strokeWidth:1.25}),e.jsx("span",{className:"hidden whitespace-nowrap md:visible! md:block!",children:"Opens"})]}),e.jsx("span",{className:"text-[2.2rem] leading-none font-semibold tracking-tighter",children:s.email.email_count?Q((s.email.opened_count||0)/s.email.email_count):"0%"})]}),o&&e.jsxs("div",{className:b,onClick:()=>{t(`/posts/analytics/${s.id}/newsletter`,{crossApp:!0})},children:[e.jsxs("div",{className:"flex items-center gap-1.5 font-medium text-muted-foreground transition-all group-hover:text-foreground",children:[e.jsx($e,{size:16,strokeWidth:1.25}),e.jsx("span",{className:"hidden whitespace-nowrap md:visible! md:block!",children:"Clicks"})]}),e.jsx("span",{className:"text-[2.2rem] leading-none font-semibold tracking-tighter",children:s.email.email_count&&s.count?.clicks?Q((s.count.clicks||0)/s.email.email_count):"0%"})]})]})]})})]}):!n&&e.jsx(P,{actions:e.jsx(z,{variant:"secondary",onClick:()=>{t("/editor/post",{crossApp:!0})},children:"New post"}),className:"w-full pb-10 xl:col-span-3",description:"Once it's live, you can track performance here",title:"Publish your first post",children:e.jsx(re,{strokeWidth:1.5})})]})]})},Oe=()=>{const{data:s}=L();return{isLimited:t=>{const a=s?.config;return a?.hostSettings?.limits&&t==="limitAnalytics"?a.hostSettings.limits.limitAnalytics?.disabled===!0:!1}}},G=({title:s,iconName:n,description:t,color:a,diffDirection:i,diffValue:c,formattedValue:p,trendingFromValue:l,children:o,onClick:h})=>{const{range:d}=L(),v=n&&We[n],r=ce.useMemo(()=>{if(!i||i==="empty"||d===q.allTime.value||!c)return"";const x=i==="up"?"up":i==="down"?"down":"at",b=H(d).replace("in the ","").replace(/^\(|\)$/g,"");return i==="same"?e.jsxs("span",{children:["You're trending at the same level as ",e.jsx("span",{className:"font-semibold",children:p})," compared to the ",e.jsx("span",{className:"font-semibold",children:b})]}):e.jsxs("span",{children:["You're trending ",e.jsxs("span",{className:"font-semibold",children:[x," ",c]})," from ",e.jsx("span",{className:"font-semibold",children:l})," compared to the ",b]})},[i,c,l,p,d]);return e.jsxs($,{className:"group","data-testid":s,children:[e.jsxs(E,{className:"hidden",children:[e.jsx(F,{children:s}),e.jsx(V,{children:t})]}),e.jsxs(Ee,{className:"relative flex grow flex-row items-start justify-between gap-5 border-none pb-2 xl:pb-4",children:[e.jsxs("div",{className:"flex grow flex-col gap-1.5 border-none pb-0",children:[e.jsxs(Fe,{className:h&&"transition-all group-hover:text-foreground",children:[a&&e.jsx("span",{className:"inline-block size-2 rounded-full opacity-50",style:{backgroundColor:a}}),v&&e.jsx(v,{size:16,strokeWidth:1.5}),s]}),e.jsx(Ve,{diffDirection:d===q.allTime.value?"hidden":i,diffTooltip:r,diffValue:c,value:p})]}),h&&e.jsx(z,{className:"absolute right-6 translate-x-10 opacity-0 transition-all duration-200 group-hover:translate-x-0 group-hover:opacity-100",size:"sm",variant:"outline",onClick:h,children:"View more"})]}),e.jsx(I,{children:o})]})},He=({kpiValues:s,visitorsChartData:n,visitorsYRange:t,growthTotals:a,membersChartData:i,mrrChartData:c,currencySymbol:p,isLoading:l})=>{const o=K(),{range:h}=L(),{appSettings:d}=W(),r=Oe().isLimited("limitAnalytics"),x="-mb-3 h-[10vw] max-h-[200px] min-h-[100px] hover:cursor-pointer!";if(l)return e.jsx(ye,{className:"flex h-[calc(10vw+116px)] max-h-[416px] min-h-20 items-center justify-center hover:cursor-pointer!",children:e.jsx(le,{})});const f=d?.analytics.webAnalytics,b=r&&!f,y=!0,_=d?.paidMembersEnabled,w=[f,b,y,_].filter(Boolean).length;let j="lg:grid-cols-3";w===2?j="lg:grid-cols-2":w===1&&(j="lg:grid-cols-1");const R=`flex flex-col lg:grid ${j} gap-6`;return e.jsxs("div",{className:R,children:[f&&!b&&e.jsx(G,{description:"Number of individual people who visited your website",diffDirection:"empty",formattedValue:s.visits,iconName:"Globe",linkto:"/analytics/web/",title:"Unique visitors",onClick:()=>{o("/analytics/web/")},children:e.jsx(B,{className:x,color:"var(--chart-blue)",data:n,id:"visitors",range:h,showHorizontalLines:!0,showYAxisValues:!1,syncId:"overview-charts",yAxisRange:t})}),b&&e.jsxs($,{children:[e.jsxs(E,{className:"hidden",children:[e.jsx(F,{children:"Unlock web analytics"}),e.jsx(V,{children:"Get the full picture of what's working with detailed, cookie-free traffic analytics."})]}),e.jsx(I,{className:"flex h-full items-center justify-center p-6",children:e.jsx(P,{actions:e.jsx(z,{variant:"outline",onClick:()=>o("/pro",{crossApp:!0}),children:"Upgrade now"}),className:"py-10",description:"Get the full picture of what's working with detailed, cookie-free traffic analytics.",title:"Unlock web analytics",children:e.jsx(Me,{})})})]}),e.jsx(G,{description:"How number of members of your publication changed over time",diffDirection:a.directions.total,diffValue:a.percentChanges.total,formattedValue:m(a.totalMembers),iconName:"User",linkto:"/analytics/growth/",title:"Members",trendingFromValue:`${m(i[0].value)}`,onClick:()=>{o("/analytics/growth/?tab=total-members")},children:e.jsx(B,{className:x,color:"var(--chart-darkblue)",data:i,id:"members",range:h,showHorizontalLines:!0,showYAxisValues:!1,syncId:"overview-charts"})}),_&&e.jsx(G,{description:"Monthly recurring revenue changes over time",diffDirection:a.directions.mrr,diffValue:a.percentChanges.mrr,formattedValue:`${p}${m(O(a.mrr))}`,iconName:"Coins",linkto:"/analytics/growth/",title:"MRR",trendingFromValue:`${p}${m(c[0].value)}`,onClick:()=>{o("/analytics/growth/?tab=mrr")},children:e.jsx(B,{className:x,color:"var(--chart-teal)",data:c,id:"mrr",range:h,showHorizontalLines:!0,showYAxisValues:!1,syncId:"overview-charts"})})]})},Ye=({className:s})=>e.jsx("div",{className:D("rounded-sm bg-muted dark:bg-[#36373a] flex flex-col items-center justify-center gap-1 p-6",s),children:e.jsx(de,{className:"text-muted-foreground/50",size:18,strokeWidth:1.5})}),S=({className:s,metrics:n,title:t})=>e.jsx(e.Fragment,{children:e.jsxs("div",{className:D("pointer-events-none absolute bottom-[calc(100%+2px)] left-1/2 z-50 min-w-[160px] -translate-x-1/2 rounded-md bg-background p-3 text-sm opacity-0 shadow-md transition-all group-hover/tooltip:bottom-[calc(100%+12px)] group-hover/tooltip:opacity-100",s),children:[e.jsx("div",{className:"mb-1.5 border-b pr-10 pb-1.5 font-medium whitespace-nowrap text-muted-foreground",children:t}),e.jsx("div",{className:"flex flex-col gap-1.5",children:n?.map(a=>e.jsxs("div",{className:"flex items-center justify-between gap-5",children:[e.jsxs("div",{className:"flex items-center gap-1.5 whitespace-nowrap",children:[a.icon,a.label]}),e.jsx("span",{className:"font-mono",children:a.metric})]},a.label))})]})}),Ke=({topPostsData:s,isLoading:n})=>{const t=K(),{range:a,settings:i}=L(),{appSettings:c}=W(),p=String(i.find(r=>r.key==="timezone")?.value||"Etc/UTC"),{webAnalytics:l=!1,membersTrackSources:o=!1,emailTrackClicks:h=!1,emailTrackOpens:d=!1}=c?.analytics||{},v="flex items-center justify-end gap-1 rounded-md px-2 py-1 font-mono text-gray-800 hover:bg-muted-foreground/10 group-hover:text-foreground";return e.jsxs($,{className:"group/card w-full lg:col-span-2","data-testid":"top-posts-card",children:[e.jsxs(E,{children:[e.jsxs(F,{className:"flex items-baseline justify-between leading-snug font-medium text-muted-foreground",children:["Top posts ",H(a)]}),e.jsx(V,{className:"hidden",children:"Most viewed posts in this period"})]}),e.jsx(I,{children:n?e.jsx(me,{className:"mt-6"}):e.jsxs(e.Fragment,{children:[s?.stats?.map(r=>e.jsxs("div",{className:'group relative flex w-full items-start justify-between gap-5 border-t border-border/50 py-4 before:absolute before:-inset-x-4 before:inset-y-0 before:z-0 before:hidden before:rounded-md before:bg-accent before:opacity-80 before:content-[""] first:border-border! hover:cursor-pointer hover:border-transparent hover:before:block md:items-center dark:before:bg-accent/50 [&+div]:hover:border-transparent',children:[e.jsxs("div",{className:"z-10 flex min-w-[160px] grow items-start gap-4 md:items-center lg:min-w-[320px]",onClick:()=>{t(ae({postId:r.post_id,hasEmailData:r.sent_count!==null,analytics:{webAnalytics:l,membersTrackSources:o}}),{crossApp:!0})},children:[r.feature_image?e.jsx("div",{className:"hidden aspect-[16/10] w-[80px] shrink-0 rounded-sm bg-cover bg-center sm:visible! sm:block! lg:w-[100px]",style:{backgroundImage:`url(${r.feature_image})`}}):e.jsx(Ye,{className:"hidden aspect-[16/10] w-[80px] shrink-0 group-hover:bg-muted-foreground/10 sm:visible! sm:flex! lg:w-[100px]"}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"line-clamp-2 text-lg leading-[1.35em] font-semibold",children:r.title}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:["By ",r.authors," – ",se(r.published_at,p)]}),e.jsx("span",{className:"text-sm text-muted-foreground",children:Le(r)})]})]}),e.jsxs("div",{className:"z-10 flex flex-col items-end justify-center gap-0.5 text-sm md:flex-row md:items-center md:justify-end md:gap-3",children:[l&&e.jsxs("div",{className:"group/tooltip relative flex w-[66px] lg:w-[92px]","data-testid":"statistics-visitors",onClick:x=>{x.stopPropagation(),t(`/posts/analytics/${r.post_id}/web`,{crossApp:!0})},children:[e.jsx(S,{metrics:[{icon:e.jsx(M,{className:"shrink-0 text-muted-foreground",size:16,strokeWidth:1.5}),label:"Unique visitors",metric:m(r.views)}],title:"Web traffic"}),e.jsxs("div",{className:v,children:[e.jsx(M,{className:"text-muted-foreground group-hover:text-foreground",size:16,strokeWidth:1.5}),X(r.views)]})]}),r.sent_count!==null&&e.jsxs("div",{className:"group/tooltip relative flex w-[66px] lg:w-[92px]",onClick:x=>{x.stopPropagation(),t(`/posts/analytics/${r.post_id}/newsletter`,{crossApp:!0})},children:[e.jsx(S,{className:`${o?"":"right-0 left-auto translate-x-0"}`,metrics:[{icon:e.jsx(Z,{className:"shrink-0 text-muted-foreground",size:16,strokeWidth:1.5}),label:"Sent",metric:m(r.sent_count||0)},...d?[{icon:e.jsx(Y,{className:"shrink-0 text-muted-foreground",size:16,strokeWidth:1.5}),label:"Opens",metric:m(r.opened_count||0)}]:[],...h?[{icon:e.jsx(J,{className:"shrink-0 text-muted-foreground",size:16,strokeWidth:1.5}),label:"Clicks",metric:m(r.clicked_count||0)}]:[]],title:"Newsletter performance"}),e.jsx("div",{className:v,children:d?e.jsxs(e.Fragment,{children:[e.jsx(Y,{className:"text-muted-foreground group-hover:text-foreground",size:16,strokeWidth:1.5}),r.open_rate?`${Math.round(r.open_rate)}%`:"0%"]}):h?e.jsxs(e.Fragment,{children:[e.jsx(J,{className:"text-muted-foreground group-hover:text-foreground",size:16,strokeWidth:1.5}),r.click_rate?`${Math.round(r.click_rate)}%`:"0%"]}):e.jsxs(e.Fragment,{children:[e.jsx(Z,{className:"text-muted-foreground group-hover:text-foreground",size:16,strokeWidth:1.5}),X(r.sent_count||0)]})})]}),o&&e.jsxs("div",{className:"group/tooltip relative flex w-[66px] lg:w-[92px]","data-testid":"statistics-members",onClick:x=>{x.stopPropagation(),t(`/posts/analytics/${r.post_id}/growth`,{crossApp:!0})},children:[e.jsx(S,{className:"right-0 left-auto translate-x-0",metrics:[{icon:e.jsx(ue,{className:"shrink-0 text-muted-foreground",size:16,strokeWidth:1.5}),label:"Free",metric:r.free_members>0?`+${m(r.free_members)}`:"0"},...c?.paidMembersEnabled?[{icon:e.jsx(pe,{className:"shrink-0 text-muted-foreground",size:16,strokeWidth:1.5}),label:"Paid",metric:r.paid_members>0?`+${m(r.paid_members)}`:"0"}]:[]],title:"New members"}),e.jsxs("div",{className:v,children:[e.jsx(te,{className:"text-muted-foreground group-hover:text-foreground",size:16,strokeWidth:1.5}),r.members>0?`+${m(r.members)}`:"0"]})]})]})]},r.post_id)),(!s?.stats||s.stats.length===0)&&e.jsx(P,{className:"w-full pb-10",title:`No posts ${H(a)}`,children:e.jsx(re,{strokeWidth:1.5})})]})})]})},Pe=()=>{const{data:{posts:[s]}={posts:[]},isLoading:n}=Re({searchParams:{filter:"status:[published,sent]",order:"published_at DESC",limit:"1",include:"authors,email,count.clicks"}}),t=s,a=Ue(t?.id||"",{enabled:!!t?.id}),{data:i,isLoading:c}=a;return{data:A.useMemo(()=>{if(!t)return null;const l=i?.stats?.[0]||{id:t.id,recipient_count:null,opened_count:null,open_rate:null,member_delta:0,free_members:0,paid_members:0,visitors:0};return{id:t.id,uuid:t.uuid,title:t.title||"",slug:t.slug||"",feature_image:t.feature_image||null,published_at:t.published_at||"",url:t.url||"",excerpt:t.excerpt||"",email_only:t.email_only||!1,status:t.status,email:t.email,count:t.count,authors:t.authors||[],recipient_count:l.recipient_count,opened_count:l.opened_count,open_rate:l.open_rate,member_delta:l.member_delta,free_members:l.free_members,paid_members:l.paid_members,visitors:l.visitors,click_rate:null}},[t,i]),isLoading:n||!!t?.id&&c}},ee=({className:s,title:n,description:t,url:a,children:i})=>e.jsx("a",{className:D("block rounded-xl border bg-card p-6 transition-all hover:shadow-xs hover:bg-accent/50 group/card",s),href:a,rel:"noreferrer",target:"_blank",children:e.jsxs("div",{className:"flex items-center gap-6",children:[i,e.jsxs("div",{className:"flex flex-col gap-0.5 leading-tight",children:[e.jsx("span",{className:"text-base font-semibold",children:n}),e.jsx("span",{className:"text-sm font-normal text-gray-700",children:t})]})]})}),Bs=()=>{const{appSettings:s}=W(),{statsConfig:n,isLoading:t,range:a}=L(),{startDate:i,endDate:c,timezone:p}=xe(a),{isLoading:l,chartData:o,totals:h,currencySymbol:d}=Ie(a),{data:v,isLoading:r}=Pe(),{data:x,isLoading:f}=Be({searchParams:{date_from:T(i),date_to:T(c),limit:"5",timezone:p}}),b={site_uuid:n?.id||"",date_from:T(i),date_to:T(c),timezone:p,member_status:ze(ge)},{data:y,loading:_}=ke({endpoint:"api_kpis",statsConfig:n,params:b}),w=A.useMemo(()=>U(y||[],a,"visits","sum")?.map(g=>{const k=Number(g.visits),C=isNaN(k)?0:k;return{date:String(g.date),value:C,formattedValue:m(C),label:"Visitors"}}),[y,a]),j=A.useMemo(()=>{const g=[0,1];if(!w||w.length===0)return g;const k=w.map(u=>u.value).filter(u=>u>=0);return k.length===0?g:[0,Math.max(...k)||g[1]]},[w]),R=A.useMemo(()=>{if(!o||o.length===0)return[];let g=[];return g=U(o,a,"value","exact"),g.map(u=>({date:u.date,value:u.free+u.paid,formattedValue:m(u.free+u.paid),label:"Members"}))},[o,a]),ie=A.useMemo(()=>{if(!s?.paidMembersEnabled||!o||o.length===0)return[];let g=[];return g=U(o,a,"mrr","exact"),g.map(u=>({date:u.date,value:O(u.mrr),formattedValue:`${d}${m(O(u.mrr))}`,label:"MRR"}))},[o,a,d,s]),ne=A.useMemo(()=>{if(!y?.length)return{visits:"0"};const g=y.reduce((k,C)=>{const u=Number(C.visits);return k+(isNaN(u)?0:u)},0);return{visits:m(g)}},[y]),oe=t;return e.jsxs(fe,{children:[e.jsx(be,{children:e.jsx(_e,{children:e.jsx(je,{excludeRanges:["today"]})})}),e.jsxs(ve,{isLoading:oe,loadingComponent:e.jsx(e.Fragment,{}),children:[e.jsx(He,{currencySymbol:d,growthTotals:h,isLoading:_||l,kpiValues:ne,membersChartData:R,mrrChartData:ie,visitorsChartData:w,visitorsYRange:j}),e.jsx(Se,{isLoading:r,latestPostStats:v}),e.jsx(Ke,{isLoading:f,topPostsData:x}),e.jsxs("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-2",children:[e.jsx(he,{className:"mt-4 -mb-4 lg:col-span-2",children:"Grow your audience"}),e.jsx(ee,{description:"Find out how to review the performance of your content and get the most out of post analytics in Ghost.",title:"Understanding analytics in Ghost",url:"https://ghost.org/help/native-analytics",children:e.jsx("div",{className:"flex h-18 w-[100px] min-w-[100px] items-center justify-center rounded-md bg-gradient-to-tr from-[#14B8FF]/20 to-[#00BBA7]/20 p-4 opacity-80 transition-all group-hover/card:opacity-100",children:e.jsx(De,{className:"text-[#00BBA7]",size:20,strokeWidth:1.5})})}),e.jsx(ee,{description:"Use these content distribution tactics to get more people to discover your work and increase engagement.",title:"How to get your content seen online",url:"https://ghost.org/resources/content-distribution/",children:e.jsx("div",{className:"flex h-18 w-[100px] min-w-[100px] items-center justify-center rounded-md bg-gradient-to-tl from-[#FDC700]/20 to-[#FF2056]/20 p-4 opacity-80 transition-all group-hover/card:opacity-100",children:e.jsx(M,{className:"text-[#FE9A00]",size:20,strokeWidth:1.5})})})]})]})]})};export{Bs as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as v,u as b,b as j,k as y,r as k,j as e,L as F,H as P,B,X as E,t as C,e as T,l as H,P as S,A as U,S as x,m as A,s as L,o as M,n as z}from"./index-
|
|
1
|
+
import{f as v,u as b,b as j,k as y,r as k,j as e,L as F,H as P,B,X as E,t as C,e as T,l as H,P as S,A as U,S as x,m as A,s as L,o as M,n as z}from"./index-CYyEyBYw.js";import{T as I}from"./topic-filter-C7TpPe1G.js";import{S as _}from"./sprout-D66nqc79.js";const f=({profile:s,update:l,isLoading:t,onOpenChange:r})=>{const o=H("index","me"),{data:m}=o,n=s.handle===m?.handle,p=()=>{l(s.id,{followedByMe:!0})},i=()=>{l(s.id,{followedByMe:!1})},c=j();return e.jsx("div",{className:"flex w-full cursor-pointer items-start gap-3 pt-4 [&:last-of-type>:nth-child(2)]:border-none",onClick:()=>{c(`/profile/${s.handle}`)},children:e.jsxs("div",{className:"flex w-full flex-col gap-1 border-b border-gray-200 pb-4 dark:border-gray-950",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx(S,{actor:s,isCurrentUser:n,children:e.jsxs("div",{className:"flex gap-3",children:[e.jsx(U,{author:{icon:{url:s.avatarUrl},name:s.name,handle:s.handle},onClick:()=>r?.(!1)}),e.jsxs("div",{className:"break-anywhere -mt-0.5 flex grow flex-col",children:[e.jsx("span",{className:"line-clamp-1 font-semibold text-black dark:text-white",children:t?e.jsx(x,{className:"w-full max-w-48"}):s.name}),e.jsx("span",{className:"line-clamp-1 text-md text-gray-700 dark:text-gray-600",children:t?e.jsx(x,{className:"w-32"}):s.handle})]})]})}),t?e.jsx("div",{className:"inline-flex items-center",children:e.jsx(x,{className:"w-24"})}):n?null:e.jsx(A,{className:"ml-auto",following:s.followedByMe,handle:s.handle,type:"primary",onFollow:p,onUnfollow:i})]}),e.jsx("div",{className:"pl-[52px]",children:t?e.jsx(x,{className:"w-full max-w-96"}):s.bio&&e.jsx("div",{dangerouslySetInnerHTML:{__html:L(M(z(s.bio,["a","br"])))},className:"ap-profile-content break-anywhere pointer-events-none mt-0 line-clamp-2 max-w-[460px]"})})]})})},W=()=>{const{isExplainerClosed:s,setExplainerClosed:l}=v(),t=b(),r=j(),o=t.topic||"top",{exploreProfilesQuery:m,updateExploreProfile:n}=y("index",o),{data:p,isLoading:i,fetchNextPage:c,hasNextPage:h,isFetchingNextPage:u}=m,g=Array(10).fill(null).map((a,d)=>({id:`skeleton-${d}`,name:"",handle:"",avatarUrl:"",bio:"",url:"",followedByMe:!1})),w=p?.pages.flatMap(a=>a.accounts)||[];return k.useEffect(()=>{const a=document.querySelector(".load-more-trigger");if(!a)return;const d=new IntersectionObserver(N=>{N[0].isIntersecting&&h&&!u&&c()},{threshold:.1});return d.observe(a),()=>d.disconnect()},[h,u,c]),e.jsxs(F,{children:[!s&&e.jsxs("div",{className:"relative mb-6 flex items-start gap-1 rounded-md bg-gradient-to-r from-[#CFB0FF66] to-[#B6E8FF66] p-4 pr-10 dark:from-[#CFB0FF20] dark:to-[#B6E8FF20]",children:[e.jsx("div",{className:"min-w-[46px]",children:e.jsx(_,{className:"text-purple",size:46,strokeWidth:.75})}),e.jsxs("div",{className:"mt-1 flex flex-col gap-[2px]",children:[e.jsx(P,{className:"text-pretty",children:"The fastest way to grow your followers, is to follow others!"}),e.jsx("p",{className:"text-sm text-balance text-black/60 2xl:text-pretty dark:text-white/60",children:"Here are some recommendations to get you started, from Ghost publishers and other great accounts from around the social web."})]}),e.jsx(B,{className:"absolute top-[17px] right-4 size-6 opacity-40",variant:"link",onClick:()=>l(!0),children:e.jsx(E,{size:20})})]}),e.jsx(I,{currentTopic:o,excludeTopics:["following"],onTopicChange:a=>{a==="top"?r("/explore",{replace:!0}):r(`/explore/${a}`,{replace:!0})}}),e.jsx("div",{className:"mt-12 flex flex-col gap-12 pb-20 max-md:mt-5",children:i?e.jsx("div",{children:g.map(a=>e.jsx("div",{className:"mx-auto w-full max-w-[640px]",children:e.jsx(f,{isLoading:i,profile:a,update:()=>{}})},a.id))}):e.jsxs("div",{className:"mx-auto flex w-full max-w-[640px] flex-col items-center",children:[e.jsx("div",{className:"w-full",children:w.map(a=>e.jsx(C.Fragment,{children:e.jsx(f,{isLoading:!1,profile:a,update:n})},a.id))}),e.jsx("div",{className:"load-more-trigger h-4 w-full"}),u&&e.jsx("div",{className:"mt-2 flex w-full justify-center",children:e.jsx(T,{size:"sm"})})]})})]})};export{W as default};
|