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{r as c}from"./index-qHUvPjQB.js";const z=(n,t)=>n==null?t:t==null?n:Math.max(n,t),C=new WeakMap,ut={onUpdate(n,t,e){if(C.set(e,void 0),!e.computedTrend)return;const i=t.integer.concat(t.fraction).filter(o=>o.type==="integer"||o.type==="fraction"),s=n.integer.concat(n.fraction).filter(o=>o.type==="integer"||o.type==="fraction"),r=i.find(o=>!s.find(l=>l.pos===o.pos&&l.value===o.value)),a=s.find(o=>!i.find(l=>o.pos===l.pos&&o.value===l.value));C.set(e,z(r?.pos,a?.pos))},getDelta(n,t,e){const i=n-t,s=C.get(e.flow);if(!i&&s!=null&&s>=e.pos)return e.length*e.flow.computedTrend}},y=(n,t,e)=>{const i=document.createElement(n),[s,r]=Array.isArray(t)?[void 0,t]:[t,e];return s&&Object.assign(i,s),r?.forEach(a=>i.appendChild(a)),i},J=(n,t)=>{var e;return t==="left"?n.offsetLeft:(((e=n.offsetParent instanceof HTMLElement?n.offsetParent:null)==null?void 0:e.offsetWidth)??0)-n.offsetWidth-n.offsetLeft},G=n=>n.offsetWidth>0&&n.offsetHeight>0,Y=(n,t)=>{!customElements.get(n)&&customElements.define(n,t)};function Z(n,t,{reverse:e=!1}={}){const i=n.length;for(let s=e?i-1:0;e?s>=0:s<i;e?s--:s++)t(n[s],s)}function q(n,t,e,i){const s=t.formatToParts(n);e&&s.unshift({type:"prefix",value:e}),i&&s.push({type:"suffix",value:i});const r=[],a=[],o=[],l=[],u={},p=d=>`${d}:${u[d]=(u[d]??-1)+1}`;let f="",m=!1,g=!1;for(const d of s){f+=d.value;const h=d.type==="minusSign"||d.type==="plusSign"?"sign":d.type;h==="integer"?(m=!0,a.push(...d.value.split("").map(A=>({type:h,value:parseInt(A)})))):h==="group"?a.push({type:h,value:d.value}):h==="decimal"?(g=!0,o.push({type:h,value:d.value,key:p(h)})):h==="fraction"?o.push(...d.value.split("").map(A=>({type:h,value:parseInt(A),key:p(h),pos:-1-u[h]}))):(m||g?l:r).push({type:h,value:d.value,key:p(h)})}const M=[];for(let d=a.length-1;d>=0;d--){const h=a[d];M.unshift(h.type==="integer"?{...h,key:p(h.type),pos:u[h.type]}:{...h,key:p(h.type)})}return{pre:r,integer:M,fraction:o,post:l,valueAsString:f,value:typeof n=="string"?parseFloat(n):n}}const Q=String.raw,K=(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0})(),tt=typeof CSS<"u"&&CSS.supports&&CSS.supports("line-height","mod(1,1)"),w=typeof matchMedia<"u"?matchMedia("(prefers-reduced-motion: reduce)"):null,E="--_number-flow-d-opacity",U="--_number-flow-d-width",R="--_number-flow-dx",k="--_number-flow-d",et=(()=>{try{return CSS.registerProperty({name:E,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:R,syntax:"<length>",inherits:!0,initialValue:"0px"}),CSS.registerProperty({name:U,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:k,syntax:"<number>",inherits:!0,initialValue:"0"}),!0}catch{return!1}})(),it="var(--number-flow-char-height, 1em)",v="var(--number-flow-mask-height, 0.25em)",N=`calc(${v} / 2)`,$="var(--number-flow-mask-width, 0.5em)",_=`calc(${$} / var(--scale-x))`,b="#000 0, transparent 71%",P=Q`:host{display:inline-block;direction:ltr;white-space:nowrap;isolation:isolate;line-height:${it} !important}.number,.number__inner{display:inline-block;transform-origin:left top}:host([data-will-change]) :is(.number,.number__inner,.section,.digit,.digit__num,.symbol){will-change:transform}.number{--scale-x:calc(1 + var(${U}) / var(--width));transform:translateX(var(${R})) scaleX(var(--scale-x));margin:0 calc(-1 * ${$});position:relative;-webkit-mask-image:linear-gradient(to right,transparent 0,#000 ${_},#000 calc(100% - ${_}),transparent ),linear-gradient(to bottom,transparent 0,#000 ${v},#000 calc(100% - ${v}),transparent 100% ),radial-gradient(at bottom right,${b}),radial-gradient(at bottom left,${b}),radial-gradient(at top left,${b}),radial-gradient(at top right,${b});-webkit-mask-size:100% calc(100% - ${v} * 2),calc(100% - ${_} * 2) 100%,${_} ${v},${_} ${v},${_} ${v},${_} ${v};-webkit-mask-position:center,center,top left,top right,bottom right,bottom left;-webkit-mask-repeat:no-repeat}.number__inner{padding:${N} ${$};transform:scaleX(calc(1 / var(--scale-x))) translateX(calc(-1 * var(${R})))}:host > :not(.number){z-index:5}.section,.symbol{display:inline-block;position:relative;isolation:isolate}.section::after{content:'\200b';display:inline-block}.section--justify-left{transform-origin:center left}.section--justify-right{transform-origin:center right}.section > [inert],.symbol > [inert]{margin:0 !important;position:absolute !important;z-index:-1}.digit{display:inline-block;position:relative;--c:var(--current) + var(${k})}.digit__num,.number .section::after{padding:${N} 0}.digit__num{display:inline-block;--offset-raw:mod(var(--length) + var(--n) - mod(var(--c),var(--length)),var(--length));--offset:calc( var(--offset-raw) - var(--length) * round(down,var(--offset-raw) / (var(--length) / 2),1) );--y:clamp(-100%,var(--offset) * 100%,100%);transform:translateY(var(--y))}.digit__num[inert]{position:absolute;top:0;left:50%;transform:translateX(-50%) translateY(var(--y))}.digit:not(.is-spinning) .digit__num[inert]{display:none}.symbol__value{display:inline-block;mix-blend-mode:plus-lighter;white-space:pre}.section--justify-left .symbol > [inert]{left:0}.section--justify-right .symbol > [inert]{right:0}.animate-presence{opacity:calc(1 + var(${E}))}`,st=HTMLElement,B=tt&&K&&et;let S;class I extends st{constructor(){super(),this.created=!1,this.batched=!1;const{animated:t,...e}=this.constructor.defaultProps;this._animated=this.computedAnimated=t,Object.assign(this,e)}get animated(){return this._animated}set animated(t){var e;this.animated!==t&&(this._animated=t,(e=this.shadowRoot)==null||e.getAnimations().forEach(i=>i.finish()))}set data(t){var e;if(t==null)return;const{pre:i,integer:s,fraction:r,post:a,value:o}=t;if(this.created){const l=this._data;this._data=t,this.computedTrend=typeof this.trend=="function"?this.trend(l.value,o):this.trend,this.computedAnimated=B&&this._animated&&(!this.respectMotionPreference||!(w!=null&&w.matches))&&G(this),(e=this.plugins)==null||e.forEach(u=>{var p;return(p=u.onUpdate)==null?void 0:p.call(u,t,l,this)}),this.batched||this.willUpdate(),this._pre.update(i),this._num.update({integer:s,fraction:r}),this._post.update(a),this.batched||this.didUpdate()}else{this._data=t,this.attachShadow({mode:"open"});try{this._internals??(this._internals=this.attachInternals()),this._internals.role="img"}catch{}if(typeof CSSStyleSheet<"u"&&this.shadowRoot.adoptedStyleSheets)S||(S=new CSSStyleSheet,S.replaceSync(P)),this.shadowRoot.adoptedStyleSheets=[S];else{const l=document.createElement("style");l.textContent=P,this.shadowRoot.appendChild(l)}this._pre=new F(this,i,{justify:"right",part:"left"}),this.shadowRoot.appendChild(this._pre.el),this._num=new nt(this,s,r),this.shadowRoot.appendChild(this._num.el),this._post=new F(this,a,{justify:"left",part:"right"}),this.shadowRoot.appendChild(this._post.el),this.created=!0}try{this._internals.ariaLabel=t.valueAsString}catch{}}willUpdate(){this._pre.willUpdate(),this._num.willUpdate(),this._post.willUpdate()}didUpdate(){if(!this.computedAnimated)return;this._abortAnimationsFinish?this._abortAnimationsFinish.abort():this.dispatchEvent(new Event("animationsstart")),this._pre.didUpdate(),this._num.didUpdate(),this._post.didUpdate();const t=new AbortController;Promise.all(this.shadowRoot.getAnimations().map(e=>e.finished)).then(()=>{t.signal.aborted||(this.dispatchEvent(new Event("animationsfinish")),this._abortAnimationsFinish=void 0)}),this._abortAnimationsFinish=t}}I.defaultProps={transformTiming:{duration:900,easing:"linear(0,.005,.019,.039,.066,.096,.129,.165,.202,.24,.278,.316,.354,.39,.426,.461,.494,.526,.557,.586,.614,.64,.665,.689,.711,.731,.751,.769,.786,.802,.817,.831,.844,.856,.867,.877,.887,.896,.904,.912,.919,.925,.931,.937,.942,.947,.951,.955,.959,.962,.965,.968,.971,.973,.976,.978,.98,.981,.983,.984,.986,.987,.988,.989,.99,.991,.992,.992,.993,.994,.994,.995,.995,.996,.996,.9963,.9967,.9969,.9972,.9975,.9977,.9979,.9981,.9982,.9984,.9985,.9987,.9988,.9989,1)"},spinTiming:void 0,opacityTiming:{duration:450,easing:"ease-out"},animated:!0,trend:(n,t)=>Math.sign(t-n),respectMotionPreference:!0,plugins:void 0,digits:void 0};class nt{constructor(t,e,i,{className:s,...r}={}){this.flow=t,this._integer=new L(t,e,{justify:"right",part:"integer"}),this._fraction=new L(t,i,{justify:"left",part:"fraction"}),this._inner=y("span",{className:"number__inner"},[this._integer.el,this._fraction.el]),this.el=y("span",{...r,part:"number",className:`number ${s??""}`},[this._inner])}willUpdate(){this._prevWidth=this.el.offsetWidth,this._prevLeft=this.el.getBoundingClientRect().left,this._integer.willUpdate(),this._fraction.willUpdate()}update({integer:t,fraction:e}){this._integer.update(t),this._fraction.update(e)}didUpdate(){const t=this.el.getBoundingClientRect();this._integer.didUpdate(),this._fraction.didUpdate();const e=this._prevLeft-t.left,i=this.el.offsetWidth,s=this._prevWidth-i;this.el.style.setProperty("--width",String(i)),this.el.animate({[R]:[`${e}px`,"0px"],[U]:[s,0]},{...this.flow.transformTiming,composite:"accumulate"})}}class D{constructor(t,e,{justify:i,className:s,...r},a){this.flow=t,this.children=new Map,this.onCharRemove=l=>()=>{this.children.delete(l)},this.justify=i;const o=e.map(l=>this.addChar(l).el);this.el=y("span",{...r,className:`section section--justify-${i} ${s??""}`},a?a(o):o)}addChar(t,{startDigitsAtZero:e=!1,...i}={}){const s=t.type==="integer"||t.type==="fraction"?new X(this,t.type,e?0:t.value,t.pos,{...i,onRemove:this.onCharRemove(t.key)}):new at(this,t.type,t.value,{...i,onRemove:this.onCharRemove(t.key)});return this.children.set(t.key,s),s}unpop(t){t.el.removeAttribute("inert"),t.el.style.top="",t.el.style[this.justify]=""}pop(t){t.forEach(e=>{e.el.style.top=`${e.el.offsetTop}px`,e.el.style[this.justify]=`${J(e.el,this.justify)}px`}),t.forEach(e=>{e.el.setAttribute("inert",""),e.present=!1})}addNewAndUpdateExisting(t){const e=new Map,i=new Map,s=this.justify==="left",r=s?"prepend":"append";if(Z(t,a=>{let o;this.children.has(a.key)?(o=this.children.get(a.key),i.set(a,o),this.unpop(o),o.present=!0):(o=this.addChar(a,{startDigitsAtZero:!0,animateIn:!0}),e.set(a,o)),this.el[r](o.el)},{reverse:s}),this.flow.computedAnimated){const a=this.el.getBoundingClientRect();e.forEach(o=>{o.willUpdate(a)})}e.forEach((a,o)=>{a.update(o.value)}),i.forEach((a,o)=>{a.update(o.value)})}willUpdate(){const t=this.el.getBoundingClientRect();this._prevOffset=t[this.justify],this.children.forEach(e=>e.willUpdate(t))}didUpdate(){const t=this.el.getBoundingClientRect();this.children.forEach(s=>s.didUpdate(t));const e=t[this.justify],i=this._prevOffset-e;i&&this.children.size&&this.el.animate({transform:[`translateX(${i}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}}class L extends D{update(t){const e=new Map;this.children.forEach((i,s)=>{t.find(r=>r.key===s)||e.set(s,i),this.unpop(i)}),this.addNewAndUpdateExisting(t),e.forEach(i=>{i instanceof X&&i.update(0)}),this.pop(e)}}class F extends D{update(t){const e=new Map;this.children.forEach((i,s)=>{t.find(r=>r.key===s)||e.set(s,i)}),this.pop(e),this.addNewAndUpdateExisting(t)}}class x{constructor(t,e,{onRemove:i,animateIn:s=!1}={}){this.flow=t,this.el=e,this._present=!0,this._remove=()=>{var r;this.el.remove(),(r=this._onRemove)==null||r.call(this)},this.el.classList.add("animate-presence"),this.flow.computedAnimated&&s&&this.el.animate({[E]:[-.9999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),this._onRemove=i}get present(){return this._present}set present(t){if(this._present!==t){if(this._present=t,t?this.el.removeAttribute("inert"):this.el.setAttribute("inert",""),!this.flow.computedAnimated){t||this._remove();return}this.el.style.setProperty("--_number-flow-d-opacity",t?"0":"-.999"),this.el.animate({[E]:t?[-.9999,0]:[.999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),t?this.flow.removeEventListener("animationsfinish",this._remove):this.flow.addEventListener("animationsfinish",this._remove,{once:!0})}}}class W extends x{constructor(t,e,i,s){super(t.flow,i,s),this.section=t,this.value=e,this.el=i}}class X extends W{constructor(t,e,i,s,r){var a,o;const l=(((o=(a=t.flow.digits)==null?void 0:a[s])==null?void 0:o.max)??9)+1,u=Array.from({length:l}).map((f,m)=>{const g=y("span",{className:"digit__num"},[document.createTextNode(String(m))]);return m!==i&&g.setAttribute("inert",""),g.style.setProperty("--n",String(m)),g}),p=y("span",{part:`digit ${e}-digit`,className:"digit"},u);p.style.setProperty("--current",String(i)),p.style.setProperty("--length",String(l)),super(t,i,p,r),this.pos=s,this._onAnimationsFinish=()=>{this.el.classList.remove("is-spinning")},this._numbers=u,this.length=l}willUpdate(t){const e=this.el.getBoundingClientRect();this._prevValue=this.value;const i=e[this.section.justify]-t[this.section.justify],s=e.width/2;this._prevCenter=this.section.justify==="left"?i+s:i-s}update(t){this.el.style.setProperty("--current",String(t)),this._numbers.forEach((e,i)=>i===t?e.removeAttribute("inert"):e.setAttribute("inert","")),this.value=t}didUpdate(t){const e=this.el.getBoundingClientRect(),i=e[this.section.justify]-t[this.section.justify],s=e.width/2,r=this.section.justify==="left"?i+s:i-s,a=this._prevCenter-r;a&&this.el.animate({transform:[`translateX(${a}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"});const o=this.getDelta();o&&(this.el.classList.add("is-spinning"),this.el.animate({[k]:[-o,0]},{...this.flow.spinTiming??this.flow.transformTiming,composite:"accumulate"}),this.flow.addEventListener("animationsfinish",this._onAnimationsFinish,{once:!0}))}getDelta(){var t;if(this.flow.plugins)for(const s of this.flow.plugins){const r=(t=s.getDelta)==null?void 0:t.call(s,this.value,this._prevValue,this);if(r!=null)return r}const e=this.value-this._prevValue,i=this.flow.computedTrend||Math.sign(e);return i<0&&this.value>this._prevValue?this.value-this.length-this._prevValue:i>0&&this.value<this._prevValue?this.length-this._prevValue+this.value:e}}class at extends W{constructor(t,e,i,s){const r=y("span",{className:"symbol__value",textContent:i});super(t,i,y("span",{part:`symbol ${e}`,className:"symbol"},[r]),s),this.type=e,this._children=new Map,this._onChildRemove=a=>()=>{this._children.delete(a)},this._children.set(i,new x(this.flow,r,{onRemove:this._onChildRemove(i)}))}willUpdate(t){if(this.type==="decimal")return;const e=this.el.getBoundingClientRect();this._prevOffset=e[this.section.justify]-t[this.section.justify]}update(t){if(this.value!==t){const e=this._children.get(this.value);e&&(e.present=!1);const i=this._children.get(t);if(i)i.present=!0;else{const s=y("span",{className:"symbol__value",textContent:t});this.el.appendChild(s),this._children.set(t,new x(this.flow,s,{animateIn:!0,onRemove:this._onChildRemove(t)}))}}this.value=t}didUpdate(t){if(this.type==="decimal")return;const e=this.el.getBoundingClientRect()[this.section.justify]-t[this.section.justify],i=this._prevOffset-e;i&&this.el.animate({transform:[`translateX(${i}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}}const rt=parseInt(c.version.match(/^(\d+)\./)?.[1]),j=rt>=19,ot=["data","digits"];class T extends I{attributeChangedCallback(t,e,i){this[t]=JSON.parse(i)}}T.observedAttributes=j?[]:ot;Y("number-flow-react",T);const lt={},O=j?n=>n:JSON.stringify;function V(n){const{transformTiming:t,spinTiming:e,opacityTiming:i,animated:s,respectMotionPreference:r,trend:a,plugins:o,...l}=n;return[{transformTiming:t,spinTiming:e,opacityTiming:i,animated:s,respectMotionPreference:r,trend:a,plugins:o},l]}class ht extends c.Component{updateProperties(t){if(!this.el)return;this.el.batched=!this.props.isolate;const[e]=V(this.props);Object.entries(e).forEach(([i,s])=>{this.el[i]=s??T.defaultProps[i]}),t?.onAnimationsStart&&this.el.removeEventListener("animationsstart",t.onAnimationsStart),this.props.onAnimationsStart&&this.el.addEventListener("animationsstart",this.props.onAnimationsStart),t?.onAnimationsFinish&&this.el.removeEventListener("animationsfinish",t.onAnimationsFinish),this.props.onAnimationsFinish&&this.el.addEventListener("animationsfinish",this.props.onAnimationsFinish)}componentDidMount(){this.updateProperties(),j&&this.el&&(this.el.digits=this.props.digits,this.el.data=this.props.data)}getSnapshotBeforeUpdate(t){if(this.updateProperties(t),t.data!==this.props.data){if(this.props.group)return this.props.group.willUpdate(),()=>this.props.group?.didUpdate();if(!this.props.isolate)return this.el?.willUpdate(),()=>this.el?.didUpdate()}return null}componentDidUpdate(t,e,i){i?.()}handleRef(t){this.props.innerRef&&(this.props.innerRef.current=t),this.el=t}render(){const[t,{innerRef:e,className:i,data:s,willChange:r,isolate:a,group:o,digits:l,onAnimationsStart:u,onAnimationsFinish:p,...f}]=V(this.props);return c.createElement("number-flow-react",{ref:this.handleRef,"data-will-change":r?"":void 0,class:i,...f,dangerouslySetInnerHTML:{__html:""},suppressHydrationWarning:!0,digits:O(l),data:O(s)})}constructor(t){super(t),this.handleRef=this.handleRef.bind(this)}}const ft=c.forwardRef(function({value:t,locales:e,format:i,prefix:s,suffix:r,...a},o){c.useImperativeHandle(o,()=>l.current,[]);const l=c.useRef(),u=c.useContext(H);u?.useRegister(l);const p=c.useMemo(()=>e?JSON.stringify(e):"",[e]),f=c.useMemo(()=>i?JSON.stringify(i):"",[i]),m=c.useMemo(()=>{const g=lt[`${p}:${f}`]??=new Intl.NumberFormat(e,i);return q(t,g,s,r)},[t,p,f,s,r]);return c.createElement(ht,{...a,group:u,data:m,innerRef:l})}),H=c.createContext(void 0);function mt({children:n}){const t=c.useRef(new Set),e=c.useRef(!1),i=c.useRef(new WeakMap),s=c.useMemo(()=>({useRegister(r){c.useEffect(()=>(t.current.add(r),()=>{t.current.delete(r)}),[])},willUpdate(){e.current||(e.current=!0,t.current.forEach(r=>{const a=r.current;!a||!a.created||(a.willUpdate(),i.current.set(a,!0))}))},didUpdate(){t.current.forEach(r=>{const a=r.current;!a||!i.current.get(a)||(a.didUpdate(),i.current.delete(a))}),e.current=!1}}),[]);return c.createElement(H.Provider,{value:s},n)}const ct=()=>c.useSyncExternalStore(()=>()=>{},()=>B,()=>!1),dt=()=>c.useSyncExternalStore(n=>(w?.addEventListener("change",n),()=>w?.removeEventListener("change",n)),()=>w.matches,()=>!1);function gt({respectMotionPreference:n=!0}={}){const t=ct(),e=dt();return t&&(!n||!e)}export{T as NumberFlowElement,mt as NumberFlowGroup,ut as continuous,ft as default,gt as useCanAnimate,ct as useIsSupported,dt as usePrefersReducedMotion};
|
|
1
|
+
import{r as c}from"./index-CYyEyBYw.js";const z=(n,t)=>n==null?t:t==null?n:Math.max(n,t),C=new WeakMap,ut={onUpdate(n,t,e){if(C.set(e,void 0),!e.computedTrend)return;const i=t.integer.concat(t.fraction).filter(o=>o.type==="integer"||o.type==="fraction"),s=n.integer.concat(n.fraction).filter(o=>o.type==="integer"||o.type==="fraction"),r=i.find(o=>!s.find(l=>l.pos===o.pos&&l.value===o.value)),a=s.find(o=>!i.find(l=>o.pos===l.pos&&o.value===l.value));C.set(e,z(r?.pos,a?.pos))},getDelta(n,t,e){const i=n-t,s=C.get(e.flow);if(!i&&s!=null&&s>=e.pos)return e.length*e.flow.computedTrend}},y=(n,t,e)=>{const i=document.createElement(n),[s,r]=Array.isArray(t)?[void 0,t]:[t,e];return s&&Object.assign(i,s),r?.forEach(a=>i.appendChild(a)),i},J=(n,t)=>{var e;return t==="left"?n.offsetLeft:(((e=n.offsetParent instanceof HTMLElement?n.offsetParent:null)==null?void 0:e.offsetWidth)??0)-n.offsetWidth-n.offsetLeft},G=n=>n.offsetWidth>0&&n.offsetHeight>0,Y=(n,t)=>{!customElements.get(n)&&customElements.define(n,t)};function Z(n,t,{reverse:e=!1}={}){const i=n.length;for(let s=e?i-1:0;e?s>=0:s<i;e?s--:s++)t(n[s],s)}function q(n,t,e,i){const s=t.formatToParts(n);e&&s.unshift({type:"prefix",value:e}),i&&s.push({type:"suffix",value:i});const r=[],a=[],o=[],l=[],u={},p=d=>`${d}:${u[d]=(u[d]??-1)+1}`;let f="",m=!1,g=!1;for(const d of s){f+=d.value;const h=d.type==="minusSign"||d.type==="plusSign"?"sign":d.type;h==="integer"?(m=!0,a.push(...d.value.split("").map(A=>({type:h,value:parseInt(A)})))):h==="group"?a.push({type:h,value:d.value}):h==="decimal"?(g=!0,o.push({type:h,value:d.value,key:p(h)})):h==="fraction"?o.push(...d.value.split("").map(A=>({type:h,value:parseInt(A),key:p(h),pos:-1-u[h]}))):(m||g?l:r).push({type:h,value:d.value,key:p(h)})}const M=[];for(let d=a.length-1;d>=0;d--){const h=a[d];M.unshift(h.type==="integer"?{...h,key:p(h.type),pos:u[h.type]}:{...h,key:p(h.type)})}return{pre:r,integer:M,fraction:o,post:l,valueAsString:f,value:typeof n=="string"?parseFloat(n):n}}const Q=String.raw,K=(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0})(),tt=typeof CSS<"u"&&CSS.supports&&CSS.supports("line-height","mod(1,1)"),w=typeof matchMedia<"u"?matchMedia("(prefers-reduced-motion: reduce)"):null,E="--_number-flow-d-opacity",U="--_number-flow-d-width",R="--_number-flow-dx",k="--_number-flow-d",et=(()=>{try{return CSS.registerProperty({name:E,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:R,syntax:"<length>",inherits:!0,initialValue:"0px"}),CSS.registerProperty({name:U,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:k,syntax:"<number>",inherits:!0,initialValue:"0"}),!0}catch{return!1}})(),it="var(--number-flow-char-height, 1em)",v="var(--number-flow-mask-height, 0.25em)",N=`calc(${v} / 2)`,$="var(--number-flow-mask-width, 0.5em)",_=`calc(${$} / var(--scale-x))`,b="#000 0, transparent 71%",P=Q`:host{display:inline-block;direction:ltr;white-space:nowrap;isolation:isolate;line-height:${it} !important}.number,.number__inner{display:inline-block;transform-origin:left top}:host([data-will-change]) :is(.number,.number__inner,.section,.digit,.digit__num,.symbol){will-change:transform}.number{--scale-x:calc(1 + var(${U}) / var(--width));transform:translateX(var(${R})) scaleX(var(--scale-x));margin:0 calc(-1 * ${$});position:relative;-webkit-mask-image:linear-gradient(to right,transparent 0,#000 ${_},#000 calc(100% - ${_}),transparent ),linear-gradient(to bottom,transparent 0,#000 ${v},#000 calc(100% - ${v}),transparent 100% ),radial-gradient(at bottom right,${b}),radial-gradient(at bottom left,${b}),radial-gradient(at top left,${b}),radial-gradient(at top right,${b});-webkit-mask-size:100% calc(100% - ${v} * 2),calc(100% - ${_} * 2) 100%,${_} ${v},${_} ${v},${_} ${v},${_} ${v};-webkit-mask-position:center,center,top left,top right,bottom right,bottom left;-webkit-mask-repeat:no-repeat}.number__inner{padding:${N} ${$};transform:scaleX(calc(1 / var(--scale-x))) translateX(calc(-1 * var(${R})))}:host > :not(.number){z-index:5}.section,.symbol{display:inline-block;position:relative;isolation:isolate}.section::after{content:'\200b';display:inline-block}.section--justify-left{transform-origin:center left}.section--justify-right{transform-origin:center right}.section > [inert],.symbol > [inert]{margin:0 !important;position:absolute !important;z-index:-1}.digit{display:inline-block;position:relative;--c:var(--current) + var(${k})}.digit__num,.number .section::after{padding:${N} 0}.digit__num{display:inline-block;--offset-raw:mod(var(--length) + var(--n) - mod(var(--c),var(--length)),var(--length));--offset:calc( var(--offset-raw) - var(--length) * round(down,var(--offset-raw) / (var(--length) / 2),1) );--y:clamp(-100%,var(--offset) * 100%,100%);transform:translateY(var(--y))}.digit__num[inert]{position:absolute;top:0;left:50%;transform:translateX(-50%) translateY(var(--y))}.digit:not(.is-spinning) .digit__num[inert]{display:none}.symbol__value{display:inline-block;mix-blend-mode:plus-lighter;white-space:pre}.section--justify-left .symbol > [inert]{left:0}.section--justify-right .symbol > [inert]{right:0}.animate-presence{opacity:calc(1 + var(${E}))}`,st=HTMLElement,B=tt&&K&&et;let S;class I extends st{constructor(){super(),this.created=!1,this.batched=!1;const{animated:t,...e}=this.constructor.defaultProps;this._animated=this.computedAnimated=t,Object.assign(this,e)}get animated(){return this._animated}set animated(t){var e;this.animated!==t&&(this._animated=t,(e=this.shadowRoot)==null||e.getAnimations().forEach(i=>i.finish()))}set data(t){var e;if(t==null)return;const{pre:i,integer:s,fraction:r,post:a,value:o}=t;if(this.created){const l=this._data;this._data=t,this.computedTrend=typeof this.trend=="function"?this.trend(l.value,o):this.trend,this.computedAnimated=B&&this._animated&&(!this.respectMotionPreference||!(w!=null&&w.matches))&&G(this),(e=this.plugins)==null||e.forEach(u=>{var p;return(p=u.onUpdate)==null?void 0:p.call(u,t,l,this)}),this.batched||this.willUpdate(),this._pre.update(i),this._num.update({integer:s,fraction:r}),this._post.update(a),this.batched||this.didUpdate()}else{this._data=t,this.attachShadow({mode:"open"});try{this._internals??(this._internals=this.attachInternals()),this._internals.role="img"}catch{}if(typeof CSSStyleSheet<"u"&&this.shadowRoot.adoptedStyleSheets)S||(S=new CSSStyleSheet,S.replaceSync(P)),this.shadowRoot.adoptedStyleSheets=[S];else{const l=document.createElement("style");l.textContent=P,this.shadowRoot.appendChild(l)}this._pre=new F(this,i,{justify:"right",part:"left"}),this.shadowRoot.appendChild(this._pre.el),this._num=new nt(this,s,r),this.shadowRoot.appendChild(this._num.el),this._post=new F(this,a,{justify:"left",part:"right"}),this.shadowRoot.appendChild(this._post.el),this.created=!0}try{this._internals.ariaLabel=t.valueAsString}catch{}}willUpdate(){this._pre.willUpdate(),this._num.willUpdate(),this._post.willUpdate()}didUpdate(){if(!this.computedAnimated)return;this._abortAnimationsFinish?this._abortAnimationsFinish.abort():this.dispatchEvent(new Event("animationsstart")),this._pre.didUpdate(),this._num.didUpdate(),this._post.didUpdate();const t=new AbortController;Promise.all(this.shadowRoot.getAnimations().map(e=>e.finished)).then(()=>{t.signal.aborted||(this.dispatchEvent(new Event("animationsfinish")),this._abortAnimationsFinish=void 0)}),this._abortAnimationsFinish=t}}I.defaultProps={transformTiming:{duration:900,easing:"linear(0,.005,.019,.039,.066,.096,.129,.165,.202,.24,.278,.316,.354,.39,.426,.461,.494,.526,.557,.586,.614,.64,.665,.689,.711,.731,.751,.769,.786,.802,.817,.831,.844,.856,.867,.877,.887,.896,.904,.912,.919,.925,.931,.937,.942,.947,.951,.955,.959,.962,.965,.968,.971,.973,.976,.978,.98,.981,.983,.984,.986,.987,.988,.989,.99,.991,.992,.992,.993,.994,.994,.995,.995,.996,.996,.9963,.9967,.9969,.9972,.9975,.9977,.9979,.9981,.9982,.9984,.9985,.9987,.9988,.9989,1)"},spinTiming:void 0,opacityTiming:{duration:450,easing:"ease-out"},animated:!0,trend:(n,t)=>Math.sign(t-n),respectMotionPreference:!0,plugins:void 0,digits:void 0};class nt{constructor(t,e,i,{className:s,...r}={}){this.flow=t,this._integer=new L(t,e,{justify:"right",part:"integer"}),this._fraction=new L(t,i,{justify:"left",part:"fraction"}),this._inner=y("span",{className:"number__inner"},[this._integer.el,this._fraction.el]),this.el=y("span",{...r,part:"number",className:`number ${s??""}`},[this._inner])}willUpdate(){this._prevWidth=this.el.offsetWidth,this._prevLeft=this.el.getBoundingClientRect().left,this._integer.willUpdate(),this._fraction.willUpdate()}update({integer:t,fraction:e}){this._integer.update(t),this._fraction.update(e)}didUpdate(){const t=this.el.getBoundingClientRect();this._integer.didUpdate(),this._fraction.didUpdate();const e=this._prevLeft-t.left,i=this.el.offsetWidth,s=this._prevWidth-i;this.el.style.setProperty("--width",String(i)),this.el.animate({[R]:[`${e}px`,"0px"],[U]:[s,0]},{...this.flow.transformTiming,composite:"accumulate"})}}class D{constructor(t,e,{justify:i,className:s,...r},a){this.flow=t,this.children=new Map,this.onCharRemove=l=>()=>{this.children.delete(l)},this.justify=i;const o=e.map(l=>this.addChar(l).el);this.el=y("span",{...r,className:`section section--justify-${i} ${s??""}`},a?a(o):o)}addChar(t,{startDigitsAtZero:e=!1,...i}={}){const s=t.type==="integer"||t.type==="fraction"?new X(this,t.type,e?0:t.value,t.pos,{...i,onRemove:this.onCharRemove(t.key)}):new at(this,t.type,t.value,{...i,onRemove:this.onCharRemove(t.key)});return this.children.set(t.key,s),s}unpop(t){t.el.removeAttribute("inert"),t.el.style.top="",t.el.style[this.justify]=""}pop(t){t.forEach(e=>{e.el.style.top=`${e.el.offsetTop}px`,e.el.style[this.justify]=`${J(e.el,this.justify)}px`}),t.forEach(e=>{e.el.setAttribute("inert",""),e.present=!1})}addNewAndUpdateExisting(t){const e=new Map,i=new Map,s=this.justify==="left",r=s?"prepend":"append";if(Z(t,a=>{let o;this.children.has(a.key)?(o=this.children.get(a.key),i.set(a,o),this.unpop(o),o.present=!0):(o=this.addChar(a,{startDigitsAtZero:!0,animateIn:!0}),e.set(a,o)),this.el[r](o.el)},{reverse:s}),this.flow.computedAnimated){const a=this.el.getBoundingClientRect();e.forEach(o=>{o.willUpdate(a)})}e.forEach((a,o)=>{a.update(o.value)}),i.forEach((a,o)=>{a.update(o.value)})}willUpdate(){const t=this.el.getBoundingClientRect();this._prevOffset=t[this.justify],this.children.forEach(e=>e.willUpdate(t))}didUpdate(){const t=this.el.getBoundingClientRect();this.children.forEach(s=>s.didUpdate(t));const e=t[this.justify],i=this._prevOffset-e;i&&this.children.size&&this.el.animate({transform:[`translateX(${i}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}}class L extends D{update(t){const e=new Map;this.children.forEach((i,s)=>{t.find(r=>r.key===s)||e.set(s,i),this.unpop(i)}),this.addNewAndUpdateExisting(t),e.forEach(i=>{i instanceof X&&i.update(0)}),this.pop(e)}}class F extends D{update(t){const e=new Map;this.children.forEach((i,s)=>{t.find(r=>r.key===s)||e.set(s,i)}),this.pop(e),this.addNewAndUpdateExisting(t)}}class x{constructor(t,e,{onRemove:i,animateIn:s=!1}={}){this.flow=t,this.el=e,this._present=!0,this._remove=()=>{var r;this.el.remove(),(r=this._onRemove)==null||r.call(this)},this.el.classList.add("animate-presence"),this.flow.computedAnimated&&s&&this.el.animate({[E]:[-.9999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),this._onRemove=i}get present(){return this._present}set present(t){if(this._present!==t){if(this._present=t,t?this.el.removeAttribute("inert"):this.el.setAttribute("inert",""),!this.flow.computedAnimated){t||this._remove();return}this.el.style.setProperty("--_number-flow-d-opacity",t?"0":"-.999"),this.el.animate({[E]:t?[-.9999,0]:[.999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),t?this.flow.removeEventListener("animationsfinish",this._remove):this.flow.addEventListener("animationsfinish",this._remove,{once:!0})}}}class W extends x{constructor(t,e,i,s){super(t.flow,i,s),this.section=t,this.value=e,this.el=i}}class X extends W{constructor(t,e,i,s,r){var a,o;const l=(((o=(a=t.flow.digits)==null?void 0:a[s])==null?void 0:o.max)??9)+1,u=Array.from({length:l}).map((f,m)=>{const g=y("span",{className:"digit__num"},[document.createTextNode(String(m))]);return m!==i&&g.setAttribute("inert",""),g.style.setProperty("--n",String(m)),g}),p=y("span",{part:`digit ${e}-digit`,className:"digit"},u);p.style.setProperty("--current",String(i)),p.style.setProperty("--length",String(l)),super(t,i,p,r),this.pos=s,this._onAnimationsFinish=()=>{this.el.classList.remove("is-spinning")},this._numbers=u,this.length=l}willUpdate(t){const e=this.el.getBoundingClientRect();this._prevValue=this.value;const i=e[this.section.justify]-t[this.section.justify],s=e.width/2;this._prevCenter=this.section.justify==="left"?i+s:i-s}update(t){this.el.style.setProperty("--current",String(t)),this._numbers.forEach((e,i)=>i===t?e.removeAttribute("inert"):e.setAttribute("inert","")),this.value=t}didUpdate(t){const e=this.el.getBoundingClientRect(),i=e[this.section.justify]-t[this.section.justify],s=e.width/2,r=this.section.justify==="left"?i+s:i-s,a=this._prevCenter-r;a&&this.el.animate({transform:[`translateX(${a}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"});const o=this.getDelta();o&&(this.el.classList.add("is-spinning"),this.el.animate({[k]:[-o,0]},{...this.flow.spinTiming??this.flow.transformTiming,composite:"accumulate"}),this.flow.addEventListener("animationsfinish",this._onAnimationsFinish,{once:!0}))}getDelta(){var t;if(this.flow.plugins)for(const s of this.flow.plugins){const r=(t=s.getDelta)==null?void 0:t.call(s,this.value,this._prevValue,this);if(r!=null)return r}const e=this.value-this._prevValue,i=this.flow.computedTrend||Math.sign(e);return i<0&&this.value>this._prevValue?this.value-this.length-this._prevValue:i>0&&this.value<this._prevValue?this.length-this._prevValue+this.value:e}}class at extends W{constructor(t,e,i,s){const r=y("span",{className:"symbol__value",textContent:i});super(t,i,y("span",{part:`symbol ${e}`,className:"symbol"},[r]),s),this.type=e,this._children=new Map,this._onChildRemove=a=>()=>{this._children.delete(a)},this._children.set(i,new x(this.flow,r,{onRemove:this._onChildRemove(i)}))}willUpdate(t){if(this.type==="decimal")return;const e=this.el.getBoundingClientRect();this._prevOffset=e[this.section.justify]-t[this.section.justify]}update(t){if(this.value!==t){const e=this._children.get(this.value);e&&(e.present=!1);const i=this._children.get(t);if(i)i.present=!0;else{const s=y("span",{className:"symbol__value",textContent:t});this.el.appendChild(s),this._children.set(t,new x(this.flow,s,{animateIn:!0,onRemove:this._onChildRemove(t)}))}}this.value=t}didUpdate(t){if(this.type==="decimal")return;const e=this.el.getBoundingClientRect()[this.section.justify]-t[this.section.justify],i=this._prevOffset-e;i&&this.el.animate({transform:[`translateX(${i}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}}const rt=parseInt(c.version.match(/^(\d+)\./)?.[1]),j=rt>=19,ot=["data","digits"];class T extends I{attributeChangedCallback(t,e,i){this[t]=JSON.parse(i)}}T.observedAttributes=j?[]:ot;Y("number-flow-react",T);const lt={},O=j?n=>n:JSON.stringify;function V(n){const{transformTiming:t,spinTiming:e,opacityTiming:i,animated:s,respectMotionPreference:r,trend:a,plugins:o,...l}=n;return[{transformTiming:t,spinTiming:e,opacityTiming:i,animated:s,respectMotionPreference:r,trend:a,plugins:o},l]}class ht extends c.Component{updateProperties(t){if(!this.el)return;this.el.batched=!this.props.isolate;const[e]=V(this.props);Object.entries(e).forEach(([i,s])=>{this.el[i]=s??T.defaultProps[i]}),t?.onAnimationsStart&&this.el.removeEventListener("animationsstart",t.onAnimationsStart),this.props.onAnimationsStart&&this.el.addEventListener("animationsstart",this.props.onAnimationsStart),t?.onAnimationsFinish&&this.el.removeEventListener("animationsfinish",t.onAnimationsFinish),this.props.onAnimationsFinish&&this.el.addEventListener("animationsfinish",this.props.onAnimationsFinish)}componentDidMount(){this.updateProperties(),j&&this.el&&(this.el.digits=this.props.digits,this.el.data=this.props.data)}getSnapshotBeforeUpdate(t){if(this.updateProperties(t),t.data!==this.props.data){if(this.props.group)return this.props.group.willUpdate(),()=>this.props.group?.didUpdate();if(!this.props.isolate)return this.el?.willUpdate(),()=>this.el?.didUpdate()}return null}componentDidUpdate(t,e,i){i?.()}handleRef(t){this.props.innerRef&&(this.props.innerRef.current=t),this.el=t}render(){const[t,{innerRef:e,className:i,data:s,willChange:r,isolate:a,group:o,digits:l,onAnimationsStart:u,onAnimationsFinish:p,...f}]=V(this.props);return c.createElement("number-flow-react",{ref:this.handleRef,"data-will-change":r?"":void 0,class:i,...f,dangerouslySetInnerHTML:{__html:""},suppressHydrationWarning:!0,digits:O(l),data:O(s)})}constructor(t){super(t),this.handleRef=this.handleRef.bind(this)}}const ft=c.forwardRef(function({value:t,locales:e,format:i,prefix:s,suffix:r,...a},o){c.useImperativeHandle(o,()=>l.current,[]);const l=c.useRef(),u=c.useContext(H);u?.useRegister(l);const p=c.useMemo(()=>e?JSON.stringify(e):"",[e]),f=c.useMemo(()=>i?JSON.stringify(i):"",[i]),m=c.useMemo(()=>{const g=lt[`${p}:${f}`]??=new Intl.NumberFormat(e,i);return q(t,g,s,r)},[t,p,f,s,r]);return c.createElement(ht,{...a,group:u,data:m,innerRef:l})}),H=c.createContext(void 0);function mt({children:n}){const t=c.useRef(new Set),e=c.useRef(!1),i=c.useRef(new WeakMap),s=c.useMemo(()=>({useRegister(r){c.useEffect(()=>(t.current.add(r),()=>{t.current.delete(r)}),[])},willUpdate(){e.current||(e.current=!0,t.current.forEach(r=>{const a=r.current;!a||!a.created||(a.willUpdate(),i.current.set(a,!0))}))},didUpdate(){t.current.forEach(r=>{const a=r.current;!a||!i.current.get(a)||(a.didUpdate(),i.current.delete(a))}),e.current=!1}}),[]);return c.createElement(H.Provider,{value:s},n)}const ct=()=>c.useSyncExternalStore(()=>()=>{},()=>B,()=>!1),dt=()=>c.useSyncExternalStore(n=>(w?.addEventListener("change",n),()=>w?.removeEventListener("change",n)),()=>w.matches,()=>!1);function gt({respectMotionPreference:n=!0}={}){const t=ct(),e=dt();return t&&(!n||!e)}export{T as NumberFlowElement,mt as NumberFlowGroup,ut as continuous,ft as default,gt as useCanAnimate,ct as useIsSupported,dt as usePrefersReducedMotion};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{t as B,aF as ye,r as k,aX as De,j as e,B as Ce,b_ as Te,b$ as je,bU as Ke,ap as C,cA as X,aY as st,cB as V,aM as nt,aO as it,aN as ot,b7 as de,c_ as z,aZ as lt,al as le,bX as ct,am as ae,S as Ge,cz as dt,bM as ut,bN as mt,bO as pt,bP as ft,bQ as ht,bR as xt,an as E,b9 as Oe}from"./index-qHUvPjQB.js";import{s as ie,g as W,d as bt,S as gt,a as vt,D as jt,b as yt}from"./stats-view-BTKRxYTQ.js";import{E as ce}from"./empty-indicator-Dhi_KeYX.js";import{A as St}from"./wallet-cards-IEmcxJvG.js";import{T as $e,a as Ve,b as ue}from"./tabs-B93IVRBz.js";import{G as At,j as wt,C as Nt,X as Dt,Y as Ct,k as Tt,h as _t}from"./gh-chart-B9_ywrJJ.js";import{K as me,a as Y,b as kt}from"./kpi-tabs-Dsa5ldXK.js";import{a as Pt,c as Ot}from"./audience-DxNilLIv.js";import{S as ee,B as Mt}from"./sort-button-BXMrChFu.js";import{S as Rt,C as q,g as Et,b as Bt}from"./content-helpers-jANWGIfA.js";import{e as oe,c as K,f as I,g as It,a as Ye,b as ze,d as U}from"./table-mHKjXQba.js";import{g as Se}from"./currency-fEUUCkj0.js";import{g as Ft}from"./source-utils-B1S3ZHA2.js";import{a as Lt,b as Kt,k as Gt}from"./stats-CIGz2Win.js";import{u as $t}from"./referrers-kcBT5smx.js";import{T as Vt,C as be,a as _e,b as ke,g as Pe,c as ge,i as Yt}from"./pagemenu-VJXMoMB4.js";import{h as se,J as zt,F as Ut,b as fe,r as Ae,K as te,L as ne,o as Q,c as Wt,S as Ht,A as qt,M as Qt,i as Me,d as Xt,N as Z,u as Ue,e as Zt,O as Jt,G as ea,m as he,l as ta,n as aa,P as ra,Q as pe,U as Re,g as sa,s as na,C as We,a as He,v as ia,B as Ee}from"./chart-_EXssQtm.js";import{S as qe,a as Qe,b as Xe,c as Ze,f as we}from"./select-f0MMMQWu.js";import{u as oa}from"./tiers-DueraQKd.js";import{P as la,a as ca}from"./PolarAngleAxis-Cavik65s.js";import{u as da}from"./use-growth-stats-CoB8-lsd.js";import"./loader-circle-B5UPqSok.js";import"./mail-i2qs8CIG.js";import"./sprout-DZ4tZ78G.js";import"./a-large-small-Wi4LtZX-.js";import"./list-filter-zmkB7rg4.js";import"./upload-DXQRkBBq.js";import"./arrow-right-BiAOKOto.js";import"./at-sign-z5gBMxDW.js";import"./underline-vo-bPRac.js";import"./chevron-up-DVt6fhV3.js";import"./copy-BBLeLEnG.js";import"./message-square-text-bG9IoWIt.js";import"./hash-UvX5iOa9.js";import"./inbox-By7HZskI.js";import"./minus-DWx9VUtr.js";import"./pencil-DHNmlLjO.js";import"./square-vOzqJf7x.js";import"./user-round-check-Dp9a2x-e.js";import"./repeat-Cn2sKd-L.js";import"./reply-D7E-ZMd5.js";import"./rocket-DnH0XAGW.js";import"./tags-kUHJ1MZo.js";import"./trash-B2ESGftj.js";import"./user-round-x-DwCTGlxc.js";import"./_baseAssignValue-CnqN6ZMT.js";import"./index-DRUPF8nN.js";var xe;function re(r){"@babel/helpers - typeof";return re=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},re(r)}function J(){return J=Object.assign?Object.assign.bind():function(r){for(var a=1;a<arguments.length;a++){var n=arguments[a];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(r[t]=n[t])}return r},J.apply(this,arguments)}function Be(r,a){var n=Object.keys(r);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(r);a&&(t=t.filter(function(s){return Object.getOwnPropertyDescriptor(r,s).enumerable})),n.push.apply(n,t)}return n}function O(r){for(var a=1;a<arguments.length;a++){var n=arguments[a]!=null?arguments[a]:{};a%2?Be(Object(n),!0).forEach(function(t){L(r,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):Be(Object(n)).forEach(function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(n,t))})}return r}function ua(r,a){if(!(r instanceof a))throw new TypeError("Cannot call a class as a function")}function Ie(r,a){for(var n=0;n<a.length;n++){var t=a[n];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(r,et(t.key),t)}}function ma(r,a,n){return a&&Ie(r.prototype,a),n&&Ie(r,n),Object.defineProperty(r,"prototype",{writable:!1}),r}function pa(r,a,n){return a=ve(a),fa(r,Je()?Reflect.construct(a,n||[],ve(r).constructor):a.apply(r,n))}function fa(r,a){if(a&&(re(a)==="object"||typeof a=="function"))return a;if(a!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ha(r)}function ha(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function Je(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Je=function(){return!!r})()}function ve(r){return ve=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ve(r)}function xa(r,a){if(typeof a!="function"&&a!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(a&&a.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),a&&Ne(r,a)}function Ne(r,a){return Ne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,s){return t.__proto__=s,t},Ne(r,a)}function L(r,a,n){return a=et(a),a in r?Object.defineProperty(r,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):r[a]=n,r}function et(r){var a=ba(r,"string");return re(a)=="symbol"?a:a+""}function ba(r,a){if(re(r)!="object"||!r)return r;var n=r[Symbol.toPrimitive];if(n!==void 0){var t=n.call(r,a);if(re(t)!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}var G=(function(r){function a(n){var t;return ua(this,a),t=pa(this,a,[n]),L(t,"pieRef",null),L(t,"sectorRefs",[]),L(t,"id",Jt("recharts-pie-")),L(t,"handleAnimationEnd",function(){var s=t.props.onAnimationEnd;t.setState({isAnimationFinished:!0}),se(s)&&s()}),L(t,"handleAnimationStart",function(){var s=t.props.onAnimationStart;t.setState({isAnimationFinished:!1}),se(s)&&s()}),t.state={isAnimationFinished:!n.isAnimationActive,prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,sectorToFocus:0},t}return xa(a,r),ma(a,[{key:"isActiveIndex",value:function(t){var s=this.props.activeIndex;return Array.isArray(s)?s.indexOf(t)!==-1:t===s}},{key:"hasActiveIndex",value:function(){var t=this.props.activeIndex;return Array.isArray(t)?t.length!==0:t||t===0}},{key:"renderLabels",value:function(t){var s=this.props.isAnimationActive;if(s&&!this.state.isAnimationFinished)return null;var l=this.props,o=l.label,m=l.labelLine,b=l.dataKey,d=l.valueKey,c=fe(this.props,!1),x=fe(o,!1),A=fe(m,!1),f=o&&o.offsetRadius||20,S=t.map(function(p,g){var D=(p.startAngle+p.endAngle)/2,i=Ae(p.cx,p.cy,p.outerRadius+f,D),u=O(O(O(O({},c),p),{},{stroke:"none"},x),{},{index:g,textAnchor:a.getTextAnchor(i.x,p.cx)},i),N=O(O(O(O({},c),p),{},{fill:"none",stroke:p.fill},A),{},{index:g,points:[Ae(p.cx,p.cy,p.outerRadius,D),i]}),j=b;return te(b)&&te(d)?j="value":te(b)&&(j=d),B.createElement(ne,{key:"label-".concat(p.startAngle,"-").concat(p.endAngle,"-").concat(p.midAngle,"-").concat(g)},m&&a.renderLabelLineItem(m,N,"line"),a.renderLabelItem(o,u,Q(p,j)))});return B.createElement(ne,{className:"recharts-pie-labels"},S)}},{key:"renderSectorsStatically",value:function(t){var s=this,l=this.props,o=l.activeShape,m=l.blendStroke,b=l.inactiveShape;return t.map(function(d,c){if(d?.startAngle===0&&d?.endAngle===0&&t.length!==1)return null;var x=s.isActiveIndex(c),A=b&&s.hasActiveIndex()?b:null,f=x?o:A,S=O(O({},d),{},{stroke:m?d.fill:d.stroke,tabIndex:-1});return B.createElement(ne,J({ref:function(g){g&&!s.sectorRefs.includes(g)&&s.sectorRefs.push(g)},tabIndex:-1,className:"recharts-pie-sector"},Wt(s.props,d,c),{key:"sector-".concat(d?.startAngle,"-").concat(d?.endAngle,"-").concat(d.midAngle,"-").concat(c)}),B.createElement(Ht,J({option:f,isActive:x,shapeType:"sector"},S)))})}},{key:"renderSectorsWithAnimation",value:function(){var t=this,s=this.props,l=s.sectors,o=s.isAnimationActive,m=s.animationBegin,b=s.animationDuration,d=s.animationEasing,c=s.animationId,x=this.state,A=x.prevSectors,f=x.prevIsAnimationActive;return B.createElement(qt,{begin:m,duration:b,isActive:o,easing:d,from:{t:0},to:{t:1},key:"pie-".concat(c,"-").concat(f),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(S){var p=S.t,g=[],D=l&&l[0],i=D.startAngle;return l.forEach(function(u,N){var j=A&&A[N],w=N>0?Qt(u,"paddingAngle",0):0;if(j){var T=Me(j.endAngle-j.startAngle,u.endAngle-u.startAngle),h=O(O({},u),{},{startAngle:i+w,endAngle:i+T(p)+w});g.push(h),i=h.endAngle}else{var v=u.endAngle,y=u.startAngle,M=Me(0,v-y),P=M(p),F=O(O({},u),{},{startAngle:i+w,endAngle:i+P+w});g.push(F),i=F.endAngle}}),B.createElement(ne,null,t.renderSectorsStatically(g))})}},{key:"attachKeyboardHandlers",value:function(t){var s=this;t.onkeydown=function(l){if(!l.altKey)switch(l.key){case"ArrowLeft":{var o=++s.state.sectorToFocus%s.sectorRefs.length;s.sectorRefs[o].focus(),s.setState({sectorToFocus:o});break}case"ArrowRight":{var m=--s.state.sectorToFocus<0?s.sectorRefs.length-1:s.state.sectorToFocus%s.sectorRefs.length;s.sectorRefs[m].focus(),s.setState({sectorToFocus:m});break}case"Escape":{s.sectorRefs[s.state.sectorToFocus].blur(),s.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var t=this.props,s=t.sectors,l=t.isAnimationActive,o=this.state.prevSectors;return l&&s&&s.length&&(!o||!Xt(o,s))?this.renderSectorsWithAnimation():this.renderSectorsStatically(s)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var t=this,s=this.props,l=s.hide,o=s.sectors,m=s.className,b=s.label,d=s.cx,c=s.cy,x=s.innerRadius,A=s.outerRadius,f=s.isAnimationActive,S=this.state.isAnimationFinished;if(l||!o||!o.length||!Z(d)||!Z(c)||!Z(x)||!Z(A))return null;var p=ye("recharts-pie",m);return B.createElement(ne,{tabIndex:this.props.rootTabIndex,className:p,ref:function(D){t.pieRef=D}},this.renderSectors(),b&&this.renderLabels(o),Ue.renderCallByParent(this.props,null,!1),(!f||S)&&Zt.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(t,s){return s.prevIsAnimationActive!==t.isAnimationActive?{prevIsAnimationActive:t.isAnimationActive,prevAnimationId:t.animationId,curSectors:t.sectors,prevSectors:[],isAnimationFinished:!0}:t.isAnimationActive&&t.animationId!==s.prevAnimationId?{prevAnimationId:t.animationId,curSectors:t.sectors,prevSectors:s.curSectors,isAnimationFinished:!0}:t.sectors!==s.curSectors?{curSectors:t.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(t,s){return t>s?"start":t<s?"end":"middle"}},{key:"renderLabelLineItem",value:function(t,s,l){if(B.isValidElement(t))return B.cloneElement(t,s);if(se(t))return t(s);var o=ye("recharts-pie-label-line",typeof t!="boolean"?t.className:"");return B.createElement(zt,J({},s,{key:l,type:"linear",className:o}))}},{key:"renderLabelItem",value:function(t,s,l){if(B.isValidElement(t))return B.cloneElement(t,s);var o=l;if(se(t)&&(o=t(s),B.isValidElement(o)))return o;var m=ye("recharts-pie-label-text",typeof t!="boolean"&&!se(t)?t.className:"");return B.createElement(Ut,J({},s,{alignmentBaseline:"middle",className:m}),o)}}])})(k.PureComponent);xe=G;L(G,"displayName","Pie");L(G,"defaultProps",{stroke:"#fff",fill:"#808080",legendType:"rect",cx:"50%",cy:"50%",startAngle:0,endAngle:360,innerRadius:0,outerRadius:"80%",paddingAngle:0,labelLine:!0,hide:!1,minAngle:0,isAnimationActive:!ea.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});L(G,"parseDeltaAngle",function(r,a){var n=he(a-r),t=Math.min(Math.abs(a-r),360);return n*t});L(G,"getRealPieData",function(r){var a=r.data,n=r.children,t=fe(r,!1),s=ta(n,aa);return a&&a.length?a.map(function(l,o){return O(O(O({payload:l},t),l),s&&s[o]&&s[o].props)}):s&&s.length?s.map(function(l){return O(O({},t),l.props)}):[]});L(G,"parseCoordinateOfPie",function(r,a){var n=a.top,t=a.left,s=a.width,l=a.height,o=ra(s,l),m=t+pe(r.cx,s,s/2),b=n+pe(r.cy,l,l/2),d=pe(r.innerRadius,o,0),c=pe(r.outerRadius,o,o*.8),x=r.maxRadius||Math.sqrt(s*s+l*l)/2;return{cx:m,cy:b,innerRadius:d,outerRadius:c,maxRadius:x}});L(G,"getComposedData",function(r){var a=r.item,n=r.offset,t=a.type.defaultProps!==void 0?O(O({},a.type.defaultProps),a.props):a.props,s=xe.getRealPieData(t);if(!s||!s.length)return null;var l=t.cornerRadius,o=t.startAngle,m=t.endAngle,b=t.paddingAngle,d=t.dataKey,c=t.nameKey,x=t.valueKey,A=t.tooltipType,f=Math.abs(t.minAngle),S=xe.parseCoordinateOfPie(t,n),p=xe.parseDeltaAngle(o,m),g=Math.abs(p),D=d;te(d)&&te(x)?(Re(!1,`Use "dataKey" to specify the value of pie,
|
|
1
|
+
import{t as B,aF as ye,r as k,aX as De,j as e,B as Ce,b_ as Te,b$ as je,bU as Ke,ap as C,cA as X,aY as st,cB as V,aM as nt,aO as it,aN as ot,b7 as de,c_ as z,aZ as lt,al as le,bX as ct,am as ae,S as Ge,cz as dt,bM as mt,bN as ut,bO as pt,bP as ft,bQ as ht,bR as xt,an as E,b9 as Oe}from"./index-CYyEyBYw.js";import{s as ie,g as W,d as bt,S as gt,a as vt,D as jt,b as yt}from"./stats-view-BuExwFXa.js";import{E as ce}from"./empty-indicator-P3IsUguf.js";import{A as St}from"./wallet-cards-C1NOBbWE.js";import{T as $e,a as Ve,b as me}from"./tabs-CjdKssUe.js";import{G as At,j as wt,C as Nt,X as Dt,Y as Ct,k as Tt,h as _t}from"./gh-chart-Xa6Nvzwz.js";import{K as ue,a as Y,b as kt}from"./kpi-tabs-DZw2Qktb.js";import{a as Pt,c as Ot}from"./audience-CvSOqHuo.js";import{S as ee,B as Mt}from"./sort-button-DlSKBzUq.js";import{S as Rt,C as q,g as Et,b as Bt}from"./content-helpers-DQdPPDGb.js";import{e as oe,c as K,f as I,g as It,a as Ye,b as ze,d as U}from"./table-pGS7EeJe.js";import{g as Se}from"./currency-fEUUCkj0.js";import{g as Ft}from"./source-utils-B1S3ZHA2.js";import{a as Lt,b as Kt,k as Gt}from"./stats-B4OybenW.js";import{u as $t}from"./referrers-qnXsKsuv.js";import{T as Vt,C as be,a as _e,b as ke,g as Pe,c as ge,i as Yt}from"./pagemenu-BXrHWtsU.js";import{h as se,J as zt,F as Ut,b as fe,r as Ae,K as te,L as ne,o as Q,c as Wt,S as Ht,A as qt,M as Qt,i as Me,d as Xt,N as Z,u as Ue,e as Zt,O as Jt,G as ea,m as he,l as ta,n as aa,P as ra,Q as pe,U as Re,g as sa,s as na,C as We,a as He,v as ia,B as Ee}from"./chart-BRQeD9eh.js";import{S as qe,a as Qe,b as Xe,c as Ze,f as we}from"./select-8S9kYGSM.js";import{u as oa}from"./tiers-4Vkr_D-L.js";import{P as la,a as ca}from"./PolarAngleAxis-CB-FJBDa.js";import{u as da}from"./use-growth-stats-CaFSgp_R.js";import"./loader-circle-DLJd-dNm.js";import"./mail-B97w28e2.js";import"./sprout-D66nqc79.js";import"./a-large-small-L1BJa6mG.js";import"./list-filter-DLjjiktn.js";import"./upload-CPYhmtWZ.js";import"./arrow-right-B2j-ecEK.js";import"./at-sign-CtAw8_lw.js";import"./underline-CjK8la2G.js";import"./chevron-up-v4_QwmnL.js";import"./circle-alert-Dbz54fYb.js";import"./power-Cc5ncYVl.js";import"./copy-BULQsPZ4.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"./_baseAssignValue-BEAjPAfy.js";import"./index-x0hNfyqU.js";import"./value-BGBiTkF3.js";var xe;function re(r){"@babel/helpers - typeof";return re=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},re(r)}function J(){return J=Object.assign?Object.assign.bind():function(r){for(var a=1;a<arguments.length;a++){var n=arguments[a];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(r[t]=n[t])}return r},J.apply(this,arguments)}function Be(r,a){var n=Object.keys(r);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(r);a&&(t=t.filter(function(s){return Object.getOwnPropertyDescriptor(r,s).enumerable})),n.push.apply(n,t)}return n}function O(r){for(var a=1;a<arguments.length;a++){var n=arguments[a]!=null?arguments[a]:{};a%2?Be(Object(n),!0).forEach(function(t){L(r,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):Be(Object(n)).forEach(function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(n,t))})}return r}function ma(r,a){if(!(r instanceof a))throw new TypeError("Cannot call a class as a function")}function Ie(r,a){for(var n=0;n<a.length;n++){var t=a[n];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(r,et(t.key),t)}}function ua(r,a,n){return a&&Ie(r.prototype,a),n&&Ie(r,n),Object.defineProperty(r,"prototype",{writable:!1}),r}function pa(r,a,n){return a=ve(a),fa(r,Je()?Reflect.construct(a,n||[],ve(r).constructor):a.apply(r,n))}function fa(r,a){if(a&&(re(a)==="object"||typeof a=="function"))return a;if(a!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ha(r)}function ha(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function Je(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Je=function(){return!!r})()}function ve(r){return ve=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ve(r)}function xa(r,a){if(typeof a!="function"&&a!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(a&&a.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),a&&Ne(r,a)}function Ne(r,a){return Ne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,s){return t.__proto__=s,t},Ne(r,a)}function L(r,a,n){return a=et(a),a in r?Object.defineProperty(r,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):r[a]=n,r}function et(r){var a=ba(r,"string");return re(a)=="symbol"?a:a+""}function ba(r,a){if(re(r)!="object"||!r)return r;var n=r[Symbol.toPrimitive];if(n!==void 0){var t=n.call(r,a);if(re(t)!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}var G=(function(r){function a(n){var t;return ma(this,a),t=pa(this,a,[n]),L(t,"pieRef",null),L(t,"sectorRefs",[]),L(t,"id",Jt("recharts-pie-")),L(t,"handleAnimationEnd",function(){var s=t.props.onAnimationEnd;t.setState({isAnimationFinished:!0}),se(s)&&s()}),L(t,"handleAnimationStart",function(){var s=t.props.onAnimationStart;t.setState({isAnimationFinished:!1}),se(s)&&s()}),t.state={isAnimationFinished:!n.isAnimationActive,prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,sectorToFocus:0},t}return xa(a,r),ua(a,[{key:"isActiveIndex",value:function(t){var s=this.props.activeIndex;return Array.isArray(s)?s.indexOf(t)!==-1:t===s}},{key:"hasActiveIndex",value:function(){var t=this.props.activeIndex;return Array.isArray(t)?t.length!==0:t||t===0}},{key:"renderLabels",value:function(t){var s=this.props.isAnimationActive;if(s&&!this.state.isAnimationFinished)return null;var l=this.props,o=l.label,u=l.labelLine,b=l.dataKey,d=l.valueKey,c=fe(this.props,!1),x=fe(o,!1),A=fe(u,!1),f=o&&o.offsetRadius||20,S=t.map(function(p,g){var D=(p.startAngle+p.endAngle)/2,i=Ae(p.cx,p.cy,p.outerRadius+f,D),m=O(O(O(O({},c),p),{},{stroke:"none"},x),{},{index:g,textAnchor:a.getTextAnchor(i.x,p.cx)},i),N=O(O(O(O({},c),p),{},{fill:"none",stroke:p.fill},A),{},{index:g,points:[Ae(p.cx,p.cy,p.outerRadius,D),i]}),j=b;return te(b)&&te(d)?j="value":te(b)&&(j=d),B.createElement(ne,{key:"label-".concat(p.startAngle,"-").concat(p.endAngle,"-").concat(p.midAngle,"-").concat(g)},u&&a.renderLabelLineItem(u,N,"line"),a.renderLabelItem(o,m,Q(p,j)))});return B.createElement(ne,{className:"recharts-pie-labels"},S)}},{key:"renderSectorsStatically",value:function(t){var s=this,l=this.props,o=l.activeShape,u=l.blendStroke,b=l.inactiveShape;return t.map(function(d,c){if(d?.startAngle===0&&d?.endAngle===0&&t.length!==1)return null;var x=s.isActiveIndex(c),A=b&&s.hasActiveIndex()?b:null,f=x?o:A,S=O(O({},d),{},{stroke:u?d.fill:d.stroke,tabIndex:-1});return B.createElement(ne,J({ref:function(g){g&&!s.sectorRefs.includes(g)&&s.sectorRefs.push(g)},tabIndex:-1,className:"recharts-pie-sector"},Wt(s.props,d,c),{key:"sector-".concat(d?.startAngle,"-").concat(d?.endAngle,"-").concat(d.midAngle,"-").concat(c)}),B.createElement(Ht,J({option:f,isActive:x,shapeType:"sector"},S)))})}},{key:"renderSectorsWithAnimation",value:function(){var t=this,s=this.props,l=s.sectors,o=s.isAnimationActive,u=s.animationBegin,b=s.animationDuration,d=s.animationEasing,c=s.animationId,x=this.state,A=x.prevSectors,f=x.prevIsAnimationActive;return B.createElement(qt,{begin:u,duration:b,isActive:o,easing:d,from:{t:0},to:{t:1},key:"pie-".concat(c,"-").concat(f),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(S){var p=S.t,g=[],D=l&&l[0],i=D.startAngle;return l.forEach(function(m,N){var j=A&&A[N],w=N>0?Qt(m,"paddingAngle",0):0;if(j){var T=Me(j.endAngle-j.startAngle,m.endAngle-m.startAngle),h=O(O({},m),{},{startAngle:i+w,endAngle:i+T(p)+w});g.push(h),i=h.endAngle}else{var v=m.endAngle,y=m.startAngle,M=Me(0,v-y),P=M(p),F=O(O({},m),{},{startAngle:i+w,endAngle:i+P+w});g.push(F),i=F.endAngle}}),B.createElement(ne,null,t.renderSectorsStatically(g))})}},{key:"attachKeyboardHandlers",value:function(t){var s=this;t.onkeydown=function(l){if(!l.altKey)switch(l.key){case"ArrowLeft":{var o=++s.state.sectorToFocus%s.sectorRefs.length;s.sectorRefs[o].focus(),s.setState({sectorToFocus:o});break}case"ArrowRight":{var u=--s.state.sectorToFocus<0?s.sectorRefs.length-1:s.state.sectorToFocus%s.sectorRefs.length;s.sectorRefs[u].focus(),s.setState({sectorToFocus:u});break}case"Escape":{s.sectorRefs[s.state.sectorToFocus].blur(),s.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var t=this.props,s=t.sectors,l=t.isAnimationActive,o=this.state.prevSectors;return l&&s&&s.length&&(!o||!Xt(o,s))?this.renderSectorsWithAnimation():this.renderSectorsStatically(s)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var t=this,s=this.props,l=s.hide,o=s.sectors,u=s.className,b=s.label,d=s.cx,c=s.cy,x=s.innerRadius,A=s.outerRadius,f=s.isAnimationActive,S=this.state.isAnimationFinished;if(l||!o||!o.length||!Z(d)||!Z(c)||!Z(x)||!Z(A))return null;var p=ye("recharts-pie",u);return B.createElement(ne,{tabIndex:this.props.rootTabIndex,className:p,ref:function(D){t.pieRef=D}},this.renderSectors(),b&&this.renderLabels(o),Ue.renderCallByParent(this.props,null,!1),(!f||S)&&Zt.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(t,s){return s.prevIsAnimationActive!==t.isAnimationActive?{prevIsAnimationActive:t.isAnimationActive,prevAnimationId:t.animationId,curSectors:t.sectors,prevSectors:[],isAnimationFinished:!0}:t.isAnimationActive&&t.animationId!==s.prevAnimationId?{prevAnimationId:t.animationId,curSectors:t.sectors,prevSectors:s.curSectors,isAnimationFinished:!0}:t.sectors!==s.curSectors?{curSectors:t.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(t,s){return t>s?"start":t<s?"end":"middle"}},{key:"renderLabelLineItem",value:function(t,s,l){if(B.isValidElement(t))return B.cloneElement(t,s);if(se(t))return t(s);var o=ye("recharts-pie-label-line",typeof t!="boolean"?t.className:"");return B.createElement(zt,J({},s,{key:l,type:"linear",className:o}))}},{key:"renderLabelItem",value:function(t,s,l){if(B.isValidElement(t))return B.cloneElement(t,s);var o=l;if(se(t)&&(o=t(s),B.isValidElement(o)))return o;var u=ye("recharts-pie-label-text",typeof t!="boolean"&&!se(t)?t.className:"");return B.createElement(Ut,J({},s,{alignmentBaseline:"middle",className:u}),o)}}])})(k.PureComponent);xe=G;L(G,"displayName","Pie");L(G,"defaultProps",{stroke:"#fff",fill:"#808080",legendType:"rect",cx:"50%",cy:"50%",startAngle:0,endAngle:360,innerRadius:0,outerRadius:"80%",paddingAngle:0,labelLine:!0,hide:!1,minAngle:0,isAnimationActive:!ea.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});L(G,"parseDeltaAngle",function(r,a){var n=he(a-r),t=Math.min(Math.abs(a-r),360);return n*t});L(G,"getRealPieData",function(r){var a=r.data,n=r.children,t=fe(r,!1),s=ta(n,aa);return a&&a.length?a.map(function(l,o){return O(O(O({payload:l},t),l),s&&s[o]&&s[o].props)}):s&&s.length?s.map(function(l){return O(O({},t),l.props)}):[]});L(G,"parseCoordinateOfPie",function(r,a){var n=a.top,t=a.left,s=a.width,l=a.height,o=ra(s,l),u=t+pe(r.cx,s,s/2),b=n+pe(r.cy,l,l/2),d=pe(r.innerRadius,o,0),c=pe(r.outerRadius,o,o*.8),x=r.maxRadius||Math.sqrt(s*s+l*l)/2;return{cx:u,cy:b,innerRadius:d,outerRadius:c,maxRadius:x}});L(G,"getComposedData",function(r){var a=r.item,n=r.offset,t=a.type.defaultProps!==void 0?O(O({},a.type.defaultProps),a.props):a.props,s=xe.getRealPieData(t);if(!s||!s.length)return null;var l=t.cornerRadius,o=t.startAngle,u=t.endAngle,b=t.paddingAngle,d=t.dataKey,c=t.nameKey,x=t.valueKey,A=t.tooltipType,f=Math.abs(t.minAngle),S=xe.parseCoordinateOfPie(t,n),p=xe.parseDeltaAngle(o,u),g=Math.abs(p),D=d;te(d)&&te(x)?(Re(!1,`Use "dataKey" to specify the value of pie,
|
|
2
2
|
the props "valueKey" will be deprecated in 1.1.0`),D="value"):te(d)&&(Re(!1,`Use "dataKey" to specify the value of pie,
|
|
3
|
-
the props "valueKey" will be deprecated in 1.1.0`),D=x);var i=s.filter(function(h){return Q(h,D,0)!==0}).length,u=(g>=360?i:i-1)*b,N=g-i*f-u,j=s.reduce(function(h,v){var y=Q(v,D,0);return h+(Z(y)?y:0)},0),w;if(j>0){var T;w=s.map(function(h,v){var y=Q(h,D,0),M=Q(h,c,v),P=(Z(y)?y:0)/j,F;v?F=T.endAngle+he(p)*b*(y!==0?1:0):F=o;var _=F+he(p)*((y!==0?f:0)+P*N),R=(F+_)/2,$=(S.innerRadius+S.outerRadius)/2,H=[{name:M,value:y,payload:h,dataKey:D,type:A}],rt=Ae(S.cx,S.cy,$,R);return T=O(O(O({percent:P,cornerRadius:l,name:M,tooltipPayload:H,midAngle:R,middleRadius:$,tooltipPosition:rt},h),S),{},{value:Q(h,D),startAngle:F,endAngle:_,payload:h,paddingAngle:he(p)*b}),T})}return O(O({},S),{},{sectors:w,data:s})});var ga=sa({chartName:"PieChart",GraphicalChild:G,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:la},{axisType:"radiusAxis",AxisComp:ca}],formatAxisMap:na,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});const tt=({className:r})=>{const a=De();return e.jsx(ce,{actions:e.jsx(Ce,{variant:"outline",onClick:()=>a("/settings/analytics",{crossApp:!0}),children:"Open settings"}),className:r,description:"Enable member source tracking in settings to see which content drives member growth.",title:"Member sources have been disabled",children:e.jsx(St,{})})},va=r=>r==="total-members"||r==="free-members"||r==="paid-members"||r==="mrr",ja=({active:r,payload:a,range:n,color:t,showBreakdown:s,showGift:l})=>{if(!r||!a?.length)return null;const o=a[0].payload,{date:m,formattedValue:b,label:d,comped:c,gift:x}=o,A=o.value-(c||0)-(l&&x||0);return e.jsxs("div",{className:"min-w-[200px] rounded-lg border bg-background px-3 py-2 shadow-lg",children:[m&&e.jsx("div",{className:"mb-1 text-sm text-foreground",children:z(m,n||0)}),e.jsxs("div",{className:"flex flex-col gap-1",children:[s&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs("div",{className:"flex grow items-center justify-between gap-5",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:"Paid subscriptions"}),e.jsx("div",{className:"font-mono text-xs",children:C(A)})]})}),l&&e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs("div",{className:"flex grow items-center justify-between gap-5",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:"Gift subscriptions"}),e.jsx("div",{className:"font-mono text-xs",children:x!==void 0&&x>0?C(x):"0"})]})}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs("div",{className:"flex grow items-center justify-between gap-5",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:"Complimentary"}),e.jsx("div",{className:"font-mono text-xs",children:c!==void 0&&c>0?C(c):"0"})]})}),e.jsx(lt,{})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"inline-block size-2 rounded-full opacity-50",style:{backgroundColor:t||"var(--chart-purple)"}}),e.jsxs("div",{className:"flex grow items-center justify-between gap-5",children:[d&&e.jsx("div",{className:"text-sm text-muted-foreground",children:d}),e.jsx("div",{className:"font-mono font-medium",children:b})]})]})]})]})},ya=({chartData:r,totals:a,initialTab:n,currencySymbol:t,isLoading:s,onTabChange:l})=>{const o=va(n)?n:"total-members",[m,b]=k.useState(o),{range:d,data:c}=Te(),{appSettings:x}=je(),A=c?.labs?.giftSubscriptions===!0,f=De(),[S]=Ke();k.useEffect(()=>{b(o)},[o]);const p=v=>{b(v);const y=new URLSearchParams(S);y.set("tab",v),f(`?${y.toString()}`,{replace:!0}),l&&l(v)},{totalMembers:g,freeMembers:D,paidMembers:i,mrr:u,percentChanges:N,directions:j}=a,w=k.useMemo(()=>{if(!r||r.length===0)return[];let v=[],y="value";switch(m){case"free-members":y="free";break;case"paid-members":y="paid";break;case"mrr":{y="mrr";break}default:y="value"}v=ie(r,d,y,"exact");let M=[];switch(m){case"free-members":M=v.map(P=>({...P,value:P.free,formattedValue:C(P.free),label:"Free members"}));break;case"paid-members":M=v.map(P=>({...P,value:P.paid,formattedValue:C(P.paid),label:"Paid members",comped:P.comped,gift:P.gift,paid_subscribed:P.paid_subscribed}));break;case"mrr":M=v.map(P=>({...P,value:X(P.mrr),formattedValue:`${t}${C(X(P.mrr))}`,label:"MRR"}));break;default:M=v.map(P=>{const F=P.free+P.paid;return{...P,value:F,formattedValue:C(F),label:"Total members"}})}return M},[m,r,d,t]),T={"total-members":{color:"var(--chart-darkblue)"},"free-members":{color:"var(--chart-blue)"},"paid-members":{color:"var(--chart-purple)"},mrr:{color:"var(--chart-teal)"}};return s?e.jsx("div",{className:"-mb-6 flex h-[calc(16vw+132px)] w-full items-start justify-center",children:e.jsx(st,{})}):e.jsxs($e,{defaultValue:o,variant:"kpis",children:[e.jsxs(Ve,{className:`-mx-6 ${x?.paidMembersEnabled?"hidden grid-cols-4 lg:visible! lg:grid!":"grid grid-cols-4"}`,children:[e.jsx(me,{className:x?.paidMembersEnabled?"":"cursor-auto after:hidden",value:"total-members",onClick:()=>{x?.paidMembersEnabled&&p("total-members")},children:e.jsx(Y,{color:"var(--chart-darkblue)",diffDirection:d===V.allTime.value?"hidden":j.total,diffValue:N.total,label:"Total members",value:C(g)})}),x?.paidMembersEnabled&&e.jsxs(e.Fragment,{children:[e.jsx(me,{value:"free-members",onClick:()=>{p("free-members")},children:e.jsx(Y,{color:"var(--chart-blue)",diffDirection:d===V.allTime.value?"hidden":j.free,diffValue:N.free,label:"Free members",value:C(D)})}),e.jsx(me,{value:"paid-members",onClick:()=>{p("paid-members")},children:e.jsx(Y,{color:"var(--chart-purple)",diffDirection:d===V.allTime.value?"hidden":j.paid,diffValue:N.paid,label:"Paid members",value:C(i)})}),e.jsx(me,{value:"mrr",onClick:()=>{p("mrr")},children:e.jsx(Y,{color:"var(--chart-teal)",diffDirection:d===V.allTime.value?"hidden":j.mrr,diffValue:N.mrr,label:"MRR",value:`${t}${C(X(u))}`})})]})]}),x?.paidMembersEnabled&&e.jsxs(nt,{children:[e.jsx(it,{className:"lg:hidden",asChild:!0,children:e.jsxs(kt,{children:[m==="total-members"&&e.jsx(Y,{color:"var(--chart-darkblue)",diffDirection:d===V.allTime.value?"hidden":j.total,diffValue:N.total,label:"Total members",value:C(g)}),m==="free-members"&&e.jsx(Y,{color:"var(--chart-blue)",diffDirection:d===V.allTime.value?"hidden":j.free,diffValue:N.free,label:"Free members",value:C(D)}),m==="paid-members"&&e.jsx(Y,{color:"var(--chart-purple)",diffDirection:d===V.allTime.value?"hidden":j.paid,diffValue:N.paid,label:"Paid members",value:C(i)}),m==="mrr"&&e.jsx(Y,{color:"var(--chart-teal)",diffDirection:d===V.allTime.value?"hidden":j.mrr,diffValue:N.mrr,label:"MRR",value:`${t}${C(X(u))}`})]})}),e.jsxs(ot,{align:"end",className:"w-56",children:[e.jsx(de,{onClick:()=>p("total-members"),children:"Total members"}),e.jsx(de,{onClick:()=>p("free-members"),children:"Free members"}),e.jsx(de,{onClick:()=>p("paid-members"),children:"Paid members"}),e.jsx(de,{onClick:()=>p("mrr"),children:"MRR"})]})]}),e.jsx("div",{className:"my-4 [&_.recharts-cartesian-axis-tick-value]:fill-gray-500",children:e.jsx(At,{className:"-mb-3 h-[16vw] max-h-[320px] w-full min-h-[180px]",color:T[m].color,data:w,dataFormatter:m==="mrr"?v=>`${t}${C(v)}`:C,id:m,range:d,tooltipContent:m==="paid-members"?e.jsx(ja,{color:T["paid-members"].color,range:d,showBreakdown:!0,showGift:A}):void 0})})]})},Sa=(r,a="signups desc",n=50)=>{const{startDate:t,endDate:s,timezone:l}=le(r),o={date_from:ae(t),date_to:ae(s),member_status:Pt(ct),order:a,limit:n.toString()};return l&&(o.timezone=l),$t({searchParams:o})},Fe=({data:r,currencySymbol:a,limit:n,defaultSourceIconUrl:t})=>{const s=n?r.slice(0,n):r,{appSettings:l}=je();return e.jsx(oe,{children:s.map(o=>e.jsxs(K,{className:"last:border-none",children:[e.jsx(I,{className:"font-medium",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Rt,{defaultSourceIconUrl:t,displayName:o.displayName,iconSrc:o.iconSrc}),o.linkUrl?e.jsx("a",{className:"hover:underline",href:o.linkUrl,rel:"noreferrer",target:"_blank",children:o.displayName}):e.jsx("span",{children:o.displayName})]})}),e.jsxs(I,{className:"text-right font-mono text-sm",children:["+",C(o.free_members)]}),l?.paidMembersEnabled&&e.jsxs(e.Fragment,{children:[e.jsxs(I,{className:"text-right font-mono text-sm",children:["+",C(o.paid_members)]}),e.jsxs(I,{className:"text-right font-mono text-sm",children:["+",a,C(X(o.mrr))]})]})]},o.source))})},Aa=({range:r,limit:a=20,showViewAll:n=!1,sortBy:t,setSortBy:s})=>{const{data:l}=Te(),{data:o}=Lt(),{appSettings:m}=je(),[b,d]=k.useState("free_members desc"),c=t||b,x=s||d,A=c.replace("free_members","signups").replace("paid_members","paid_conversions"),{data:f,isLoading:S}=Sa(r,A,a),p=l?.url,g="https://www.google.com/s2/favicons?domain=ghost.org&sz=64",D=B.useMemo(()=>{if(o?.stats&&o?.meta?.totals){const j=o.meta.totals;let w=j[0];if(!w)return Se("usd");for(const T of j)T.mrr>w.mrr&&(w=T);return Se(w.currency)}return Se("usd")},[o]),i=B.useMemo(()=>f?.stats?f.stats.map(j=>{const w=j.source||"Direct",{domain:T}=Ft(w,p),h=T?`https://www.faviconextractor.com/favicon/${T}?larger=true`:g,v=T&&w!=="Direct"?`https://${T}`:void 0;return{source:w,free_members:j.signups,paid_members:j.paid_conversions,mrr:j.mrr,iconSrc:h,displayName:w,linkUrl:v}}):[],[f,p]),u="Top sources",N=`Where did your growth come from ${W(r)}`;return m?.analytics.membersTrackSources?S?e.jsx(oe,{children:e.jsx(K,{className:"last:border-none",children:e.jsx(I,{className:"border-none py-2",colSpan:1,children:e.jsx(Ge,{containerClassName:"space-y-2",count:5,maxWidth:75,randomize:!0})})})}):e.jsxs(e.Fragment,{children:[i.length>0?e.jsx(Fe,{currencySymbol:D,data:i,defaultSourceIconUrl:g,limit:a}):e.jsx(oe,{children:e.jsx(K,{className:"last:border-none",children:e.jsx(I,{className:"border-none py-12 group-hover:bg-transparent!",colSpan:m?.paidMembersEnabled?4:2,children:e.jsx(ce,{description:"Try adjusting your date range to see more data.",title:`No conversions ${W(r)}`,children:e.jsx(dt,{strokeWidth:1.5})})})})}),n&&i.length>a&&e.jsx(It,{className:"border-none bg-transparent hover:bg-transparent!",children:e.jsx(K,{children:e.jsx(I,{className:"border-none bg-transparent px-0 pb-0 hover:bg-transparent!",colSpan:4,children:e.jsxs(ut,{children:[e.jsx(mt,{asChild:!0,children:e.jsxs(Ce,{variant:"outline",children:["View all ",e.jsx(Vt,{})]})}),e.jsxs(pt,{className:"overflow-y-auto pt-0 sm:max-w-[600px]",children:[e.jsxs(ft,{className:"sticky top-0 z-40 -mx-6 bg-background/60 p-6 backdrop-blur",children:[e.jsx(ht,{children:u}),e.jsx(xt,{children:N})]}),e.jsx("div",{className:"group/datalist",children:e.jsxs(Ye,{children:[e.jsx(ze,{children:e.jsxs(K,{children:[e.jsx(U,{children:"Source"}),e.jsx(U,{className:"w-[110px] text-right",children:e.jsx(ee,{activeSortBy:c,setSortBy:x,sortBy:"free_members desc",children:"Free members"})}),m?.paidMembersEnabled&&e.jsxs(e.Fragment,{children:[e.jsx(U,{className:"w-[110px] text-right",children:e.jsx(ee,{activeSortBy:c,setSortBy:x,sortBy:"paid_members desc",children:"Paid members"})}),e.jsx(U,{className:"w-[110px] text-right",children:e.jsx(ee,{activeSortBy:c,setSortBy:x,sortBy:"mrr desc",children:"MRR impact"})})]})]})}),e.jsx(Fe,{currencySymbol:D,data:i,defaultSourceIconUrl:g})]})})]})]})})})})]}):e.jsx(oe,{children:e.jsx(K,{className:"last:border-none",children:e.jsx(I,{className:"border-none py-12 group-hover:bg-transparent!",colSpan:m?.paidMembersEnabled?4:2,children:e.jsx(tt,{})})})})},wa=({active:r,payload:a})=>{if(r&&a&&a.length){const n=a[0];return e.jsx("div",{className:"rounded-lg border bg-background p-2 shadow-sm",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"size-2 rounded-full opacity-50",style:{backgroundColor:n.payload.color}}),e.jsx("span",{className:"font-medium",children:n.name}),e.jsx("span",{className:"font-mono",children:C(n.value)})]})})}return null},Na=({isLoading:r,range:a})=>{const{data:n}=Kt(),{data:{tiers:t=[]}={}}=oa(),[s,l]=k.useState("billing-period"),{startDate:o,endDate:m}=k.useMemo(()=>le(a),[a]),b=k.useMemo(()=>ae(o),[o]),d=k.useMemo(()=>ae(m),[m]),c=k.useMemo(()=>t.filter(i=>i.type==="paid"&&i.active).map(i=>({id:i.id,name:i.name})),[t]),x=k.useMemo(()=>{if(!n?.stats)return[];const i=E(b),u=E(d),N=n.stats.filter(w=>{const T=E(w.date);return T.isSameOrAfter(i)&&T.isSameOrBefore(u)}).reduce((w,T)=>{const h=T.cadence;return w[h]||(w[h]=0),w[h]+=T.signups,w},{});return Object.entries(N).map(([w,T],h)=>{let v=w,y="url(#gradientPurple)",M="var(--chart-purple)";return w==="month"?(v="Monthly",y="url(#gradientPurple)",M="var(--chart-purple)"):w==="year"&&(v="Annual",y="url(#gradientTeal)",M="var(--chart-teal)"),{id:`cadence-${h}`,name:v,count:T,fill:y,color:M}})},[n,b,d]),A=k.useMemo(()=>{if(!n?.stats||c.length===0)return[];const i=E(b),u=E(d),N=n.stats.filter(v=>{const y=E(v.date);return y.isSameOrAfter(i)&&y.isSameOrBefore(u)}).reduce((v,y)=>{const M=y.tier;return v[M]||(v[M]=0),v[M]+=y.signups,v},{}),j=[{gradient:"url(#gradientPurple)",solid:"var(--chart-purple)"},{gradient:"url(#gradientTeal)",solid:"var(--chart-teal)"},{gradient:"url(#gradientBlue)",solid:"var(--chart-blue)"},{gradient:"url(#gradientRose)",solid:"var(--chart-rose)"},{gradient:"url(#gradientOrange)",solid:"var(--chart-orange)"},{gradient:"url(#gradientGreen)",solid:"var(--chart-green)"},{gradient:"url(#gradientAmber)",solid:"var(--chart-amber)"},{gradient:"url(#gradientYellow)",solid:"var(--chart-yellow)"},{gradient:"url(#gradientDarkblue)",solid:"var(--chart-darkblue)"},{gradient:"url(#gradientGray)",solid:"var(--chart-darkgray)"}];return[...c.map(v=>{const y=N[v.id]||0;return{id:v.id,name:v.name,count:y}})].sort((v,y)=>y.count-v.count).map((v,y)=>{const M=y%j.length;return{...v,fill:j[M].gradient,color:j[M].solid}})},[n,c,b,d]),f=s==="billing-period"?x:A,S=k.useMemo(()=>f.reduce((i,u)=>i+u.count,0),[f]),p=k.useMemo(()=>{const i={count:{label:"Subscriptions"}};return f.forEach(u=>{i[u.id]={label:u.name,color:u.color}}),i},[f]),g=k.useMemo(()=>S===0?[]:f.map(i=>({label:i.name,count:i.count,percentage:i.count/S*100,color:i.color})),[f,S]);if(r||!n?.stats)return null;const D=f.length>0&&S>0;return e.jsxs(be,{children:[e.jsx(_e,{children:e.jsxs("div",{className:"flex items-start justify-between gap-1.5",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(ke,{children:"Paid subscription breakdown"}),e.jsxs(Pe,{children:["New paid subscriptions ",W(a)]})]}),c.length>1&&e.jsx("div",{children:e.jsxs(qe,{value:s,onValueChange:i=>l(i),children:[e.jsx(Qe,{className:"w-full",children:e.jsx(Xe,{})}),e.jsxs(Ze,{align:"end",children:[e.jsx(we,{value:"billing-period",children:"Billing period"}),e.jsx(we,{value:"tiers",children:"Tiers"})]})]})})]})}),e.jsx(ge,{children:D?e.jsxs(e.Fragment,{children:[e.jsx(We,{className:"mx-auto aspect-square h-[250px] min-h-[250px] w-full",config:p,children:e.jsxs(ga,{children:[e.jsxs("defs",{children:[e.jsxs("linearGradient",{id:"gradientPurple",x1:"0",x2:"0",y1:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"var(--chart-purple)",stopOpacity:.8}),e.jsx("stop",{offset:"100%",stopColor:"var(--chart-purple)",stopOpacity:.6})]}),e.jsxs("linearGradient",{id:"gradientTeal",x1:"0",x2:"0",y1:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"var(--chart-teal)",stopOpacity:.8}),e.jsx("stop",{offset:"100%",stopColor:"var(--chart-teal)",stopOpacity:.6})]}),e.jsxs("linearGradient",{id:"gradientRose",x1:"0",x2:"0",y1:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"var(--chart-rose)",stopOpacity:.8}),e.jsx("stop",{offset:"100%",stopColor:"var(--chart-rose)",stopOpacity:.6})]}),e.jsxs("linearGradient",{id:"gradientBlue",x1:"0",x2:"0",y1:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"var(--chart-blue)",stopOpacity:.8}),e.jsx("stop",{offset:"100%",stopColor:"var(--chart-blue)",stopOpacity:.6})]}),e.jsxs("linearGradient",{id:"gradientOrange",x1:"0",x2:"0",y1:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"var(--chart-orange)",stopOpacity:.8}),e.jsx("stop",{offset:"100%",stopColor:"var(--chart-orange)",stopOpacity:.6})]}),e.jsxs("linearGradient",{id:"gradientGreen",x1:"0",x2:"0",y1:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"var(--chart-green)",stopOpacity:.8}),e.jsx("stop",{offset:"100%",stopColor:"var(--chart-green)",stopOpacity:.6})]}),e.jsxs("linearGradient",{id:"gradientAmber",x1:"0",x2:"0",y1:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"var(--chart-amber)",stopOpacity:.8}),e.jsx("stop",{offset:"100%",stopColor:"var(--chart-amber)",stopOpacity:.6})]}),e.jsxs("linearGradient",{id:"gradientYellow",x1:"0",x2:"0",y1:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"var(--chart-yellow)",stopOpacity:.8}),e.jsx("stop",{offset:"100%",stopColor:"var(--chart-yellow)",stopOpacity:.6})]}),e.jsxs("linearGradient",{id:"gradientDarkblue",x1:"0",x2:"0",y1:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"var(--chart-darkblue)",stopOpacity:.8}),e.jsx("stop",{offset:"100%",stopColor:"var(--chart-darkblue)",stopOpacity:.6})]}),e.jsxs("linearGradient",{id:"gradientGray",x1:"0",x2:"0",y1:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"var(--chart-darkgray)",stopOpacity:.8}),e.jsx("stop",{offset:"100%",stopColor:"var(--chart-darkgray)",stopOpacity:.6})]})]}),e.jsx(He,{content:e.jsx(wa,{}),cursor:!1}),e.jsx(G,{animationBegin:0,animationDuration:1e3,data:f,dataKey:"count",innerRadius:70,nameKey:"name",strokeWidth:5,children:e.jsx(Ue,{content:({viewBox:i})=>{if(i&&"cx"in i&&"cy"in i)return e.jsxs("text",{dominantBaseline:"middle",textAnchor:"middle",x:i.cx,y:i.cy,children:[e.jsx("tspan",{className:"fill-foreground text-2xl font-semibold tracking-tight",x:i.cx,y:i.cy,children:C(S)}),e.jsx("tspan",{className:"fill-muted-foreground",x:i.cx,y:(i.cy||0)+20,children:"Total"})]})}})})]})}),g.length>0&&e.jsx("div",{className:"mt-4 flex flex-wrap items-center justify-center gap-x-6 gap-y-1 text-sm text-muted-foreground",children:g.map(i=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"size-2 rounded-full opacity-50",style:{backgroundColor:i.color}}),e.jsx("span",{className:"max-w-[150px] truncate whitespace-nowrap",title:i.label,children:i.label}),e.jsxs("span",{className:"font-medium text-foreground",children:[Math.round(Number(i.percentage)||0),"%"]})]},i.label))})]}):e.jsx("div",{className:"py-12",children:e.jsx(ce,{description:`No new paid subscriptions ${W(a)}.`,title:"No new subscribers",children:e.jsx(wt,{strokeWidth:1.5})})})})]})},Da=(r,a,n)=>{if(a===1){const c=E().format("YYYY-MM-DD"),x=r.find(A=>A.date===c);return[{date:c,signups:x?.signups||0,cancellations:x?.cancellations||0}]}const{startDate:t,endDate:s}=le(a),l=E(s).diff(E(t),"days"),o=bt(a,l,"sum",n),m=new Map(r.map(c=>[c.date,c])),b=[],d=new Set;if(o==="monthly"){const c=E(t).startOf("month"),x=E(s).startOf("month");for(;c.isSameOrBefore(x);){const A=c.format("YYYY-MM-DD");if(!d.has(A)){d.add(A);const f=m.get(A);f?b.push(f):b.push({date:A,signups:0,cancellations:0})}c.add(1,"month")}}else if(o==="weekly"){const c=E(t).startOf("week"),x=E(s).startOf("week");for(;c.isSameOrBefore(x);){const A=c.format("YYYY-MM-DD");if(!d.has(A)){d.add(A);const f=m.get(A);f?b.push(f):b.push({date:A,signups:0,cancellations:0})}c.add(1,"week")}}else{const c=E(t),x=E(s);for(;c.isSameOrBefore(x);){const A=c.format("YYYY-MM-DD"),f=m.get(A);f?b.push(f):b.push({date:A,signups:0,cancellations:0}),c.add(1,"day")}}return b},at=r=>{if(r===-1){const{startDate:a,endDate:n}=le(r);return E(n).diff(E(a),"days")}return r},Ca=r=>{const a=at(r);return a<30?["daily"]:a>=91?["weekly","monthly"]:["daily","weekly"]},Le=r=>{const a=at(r);return a<30?"daily":a>=91?"monthly":"weekly"},Ta=({subscriptionData:r,memberData:a,range:n,isLoading:t})=>{const[s,l]=k.useState(()=>Le(n));k.useEffect(()=>{l(Le(n))},[n]);const o=k.useMemo(()=>Ca(n),[n]),m=k.useMemo(()=>{switch(s){case"daily":return"none";case"weekly":return"weekly";case"monthly":return"monthly"}},[s]),b=k.useMemo(()=>{if(r&&r.length>0){if(n===1){const u=E().format("YYYY-MM-DD"),N=r.find(j=>j.date===u);return[{date:z(u,n),rawDate:u,new:N?.signups||0,cancelled:-(N?.cancellations||0)}]}const f=ie(r,n,"signups","sum",m),S=ie(r,n,"cancellations","sum",m),p=new Map(S.map(u=>[u.date,u])),g=f.map(u=>({date:u.date,signups:u.signups||0,cancellations:p.get(u.date)?.cancellations||0})),D=new Set(g.map(u=>u.date));return S.forEach(u=>{D.has(u.date)||g.push({date:u.date,signups:0,cancellations:u.cancellations||0})}),g.sort((u,N)=>new Date(u.date).getTime()-new Date(N.date).getTime()),Da(g,n,m).map(u=>{let N=n;return s==="weekly"&&n<91?N=91:s==="monthly"&&n<365&&(N=365),{date:z(u.date,N),rawDate:u.date,new:u.signups||0,cancelled:-(u.cancellations||0)}})}else{if(!a||a.length===0)return[];if(n===1){const i=E().format("YYYY-MM-DD"),u=a.find(N=>N.date===i);return[{date:z(i,n),rawDate:i,new:u?.paid_subscribed||0,cancelled:-(u?.paid_canceled||0)}]}const f=ie(a,n,"paid_subscribed","sum",m),S=ie(a,n,"paid_canceled","sum",m),p=new Map(S.map(i=>[i.date,i])),g=f.map(i=>({date:i.date,paid_subscribed:i.paid_subscribed||0,paid_canceled:p.get(i.date)?.paid_canceled||0})),D=new Set(g.map(i=>i.date));return S.forEach(i=>{D.has(i.date)||g.push({date:i.date,paid_subscribed:0,paid_canceled:i.paid_canceled||0})}),g.sort((i,u)=>new Date(i.date).getTime()-new Date(u.date).getTime()),g.map(i=>{let u=n;return s==="weekly"&&n<91?u=91:s==="monthly"&&n<365&&(u=365),{date:z(i.date,u),rawDate:i.date,new:i.paid_subscribed||0,cancelled:-(i.paid_canceled||0)}})}},[a,r,n,m,s]),d={new:{label:"New",color:"var(--chart-teal)"},cancelled:{label:"Cancelled",color:"var(--chart-rose)"}},c=k.useMemo(()=>{const f=b.reduce((p,g)=>p+g.new,0),S=b.reduce((p,g)=>p+Math.abs(g.cancelled),0);return{new:f,cancelled:S}},[b]);if(t)return null;const x=b.length>0&&(c.new>0||c.cancelled>0),A=f=>f.charAt(0).toUpperCase()+f.slice(1);return e.jsxs(be,{"data-testid":"paid-members-change-card",children:[e.jsx(_e,{children:e.jsxs("div",{className:"flex items-start justify-between gap-1.5",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(ke,{children:"Paid subscriptions"}),e.jsxs(Pe,{children:["New and cancelled paid subscriptions ",W(n)]})]}),o.length>1&&e.jsx("div",{children:e.jsxs(qe,{value:s,onValueChange:f=>l(f),children:[e.jsx(Qe,{className:"w-[110px]",children:e.jsx(Xe,{})}),e.jsx(Ze,{align:"end",children:o.map(f=>e.jsx(we,{value:f,children:A(f)},f))})]})})]})}),e.jsx(ge,{children:x?e.jsxs("div",{children:[e.jsx(We,{className:"aspect-auto h-[200px] w-full md:h-[220px] xl:h-[260px]",config:d,children:e.jsxs(Mt,{data:b,stackOffset:"sign",children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:"tealGradient",x1:"0",x2:"0",y1:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"var(--color-new)",stopOpacity:.8}),e.jsx("stop",{offset:"100%",stopColor:"var(--color-new)",stopOpacity:.6})]})}),e.jsx("defs",{children:e.jsxs("linearGradient",{id:"roseGradient",x1:"0",x2:"0",y1:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"var(--color-cancelled)",stopOpacity:.6}),e.jsx("stop",{offset:"100%",stopColor:"var(--color-cancelled)",stopOpacity:.8})]})}),e.jsx(Nt,{stroke:"var(--border)",vertical:!1}),e.jsx(Dt,{axisLine:!1,dataKey:"date",tickFormatter:()=>"",tickLine:!1,tickMargin:10}),e.jsx(Ct,{axisLine:!1,tickFormatter:f=>f<0?C(f*-1):C(f),tickLine:!1}),e.jsx(He,{content:e.jsx(ia,{className:"min-w-[120px]! px-3 py-2",formatter:(f,S,p,g)=>{const D=Number(f);let i="0";D===0?i="0":i=D<0?C(D*-1):C(D);const u=Number(p?.payload?.new||0),N=Number(p?.payload?.cancelled||0),j=u+N,w=j===0?"0":j>0?`+${C(j)}`:C(j);let T=p?.payload?.date;return p?.payload?.rawDate&&(s==="monthly"?T=z(p.payload.rawDate,366):s==="weekly"?T=z(p.payload.rawDate,91):T=z(p.payload.rawDate,30)),e.jsxs("div",{className:"flex w-full flex-col",children:[g===0&&e.jsx("div",{className:"mb-1 text-sm font-medium text-foreground",children:T}),e.jsxs("div",{className:"flex w-full items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("div",{className:"size-2 shrink-0 rounded-full bg-[var(--color-bg)] opacity-50",style:{"--color-bg":`var(--color-${S})`}}),e.jsx("span",{className:"text-sm text-muted-foreground",children:d[S]?.label||S})]}),e.jsx("div",{className:"ml-auto flex items-baseline gap-0.5 font-mono font-medium text-foreground tabular-nums",children:i})]}),g===1&&e.jsxs("div",{className:"mt-1 flex w-full items-center justify-between gap-4 border-t pt-1",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Net change"}),e.jsx("div",{className:"ml-auto flex items-baseline gap-0.5 font-mono font-medium text-foreground tabular-nums",children:w})]})]})},hideLabel:!0}),cursor:!1,isAnimationActive:!1,position:{y:10}}),e.jsx(Ee,{activeBar:{fillOpacity:1},dataKey:"new",fill:"url(#tealGradient)",fillOpacity:.75,maxBarSize:32,minPointSize:3,radius:[4,4,0,0],stackId:"a"}),e.jsx(Ee,{activeBar:{fillOpacity:1},dataKey:"cancelled",fill:"url(#roseGradient)",fillOpacity:.75,maxBarSize:32,radius:[4,4,0,0],stackId:"a"})]})}),e.jsxs("div",{className:"mt-3 flex items-center justify-center gap-6 text-sm text-muted-foreground",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"size-2 rounded-full opacity-50",style:{backgroundColor:d.new.color}}),e.jsx("span",{children:"New"}),e.jsx("span",{className:"font-medium text-foreground",children:C(c.new)})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"size-2 rounded-full opacity-50",style:{backgroundColor:d.cancelled.color}}),e.jsx("span",{children:"Cancelled"}),e.jsx("span",{className:"font-medium text-foreground",children:C(c.cancelled)})]})]})]}):e.jsx("div",{className:"py-12",children:e.jsx(ce,{description:`No paid subscription changes ${W(n)}.`,title:"No paid member changes",children:e.jsx(Tt,{strokeWidth:1.5})})})})]})},_a=(r,a,n)=>{const t=r??30,s=a??"mrr desc",{startDate:l,endDate:o}=k.useMemo(()=>le(t),[t]),m=k.useMemo(()=>{const c={date_from:ae(l),date_to:ae(o),order:s};return n==="posts"?c.post_type="post":n==="pages"&&(c.post_type="page"),c},[l,o,s,n]),b=Object.fromEntries(Object.entries(m).filter(([,c])=>c!==void 0));return Gt({searchParams:b})},Ar=()=>{const{range:r,site:a,settings:n}=Te(),t=String(n.find(h=>h.key==="timezone")?.value||"Etc/UTC"),s=De(),[l,o]=k.useState("free_members desc"),[m,b]=k.useState(q.POSTS_AND_PAGES),[d]=Ke(),{appSettings:c}=je(),x=d.get("tab")||"total-members",[A,f]=k.useState(x);k.useEffect(()=>{x!==A&&f(x)},[x]);const{isLoading:S,chartData:p,totals:g,currencySymbol:D,subscriptionData:i}=da(r),{data:u,isLoading:N}=_a(r,l,m),j=k.useMemo(()=>{const v=(u?.stats||[]).reduce((_,R)=>{const $=R.post_id||(R.title&&R.title.trim()!==""?R.title:R.attribution_url);if(!$)return _;if(!_.has($))_.set($,R);else{const H=_.get($);H.free_members+=R.free_members,H.paid_members+=R.paid_members,H.mrr+=R.mrr,_.set($,H)}return _},new Map),y=Array.from(v.values()),M=y.reduce((_,R)=>_+R.free_members,0),P=y.reduce((_,R)=>_+R.paid_members,0),F=y.reduce((_,R)=>_+R.mrr,0);return y.map(_=>{let R=0;return l.includes("free_members")&&M>0?R=_.free_members/M:l.includes("paid_members")&&P>0?R=_.paid_members/P:l.includes("mrr")&&F>0&&(R=_.mrr/F),{title:_.title||_.attribution_url,post_id:_.post_id,attribution_url:_.attribution_url,attribution_type:_.attribution_type,attribution_id:_.attribution_id,free_members:_.free_members,paid_members:_.paid_members,mrr:_.mrr,percentage:R,published_at:_.published_at,url_exists:_.url_exists??!0}})},[u,l]),w=S,T=S||N;return e.jsxs(gt,{children:[e.jsx(vt,{children:e.jsx(Yt,{children:e.jsx(jt,{})})}),e.jsxs(yt,{data:w?void 0:p,isLoading:!1,loadingComponent:e.jsx(e.Fragment,{}),children:[e.jsx(be,{"data-testid":"total-members-card",children:e.jsx(ge,{children:e.jsx(ya,{chartData:p,currencySymbol:D,initialTab:x,isLoading:w,totals:g,onTabChange:f})})}),c?.paidMembersEnabled&&A==="paid-members"&&e.jsxs("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-2 xl:grid-cols-[2fr_minmax(460px,1fr)]",children:[e.jsx(Ta,{isLoading:w,memberData:p,range:r,subscriptionData:i}),e.jsx(Na,{isLoading:w,range:r})]}),e.jsxs(be,{className:"w-full overflow-x-auto","data-testid":"top-content-card",children:[e.jsxs(_e,{children:[e.jsx(ke,{children:Et(m)}),e.jsx(Pe,{children:Bt(m,r,W)})]}),e.jsx(ge,{children:e.jsxs(Ye,{children:[e.jsx(ze,{children:e.jsxs(K,{className:"[&>th]:h-auto [&>th]:pt-0 [&>th]:pb-2",children:[e.jsx(U,{className:"min-w-[320px] pl-0",children:e.jsx($e,{defaultValue:m,variant:"button-sm",onValueChange:h=>{b(h)},children:e.jsxs(Ve,{children:[e.jsx(ue,{value:q.POSTS_AND_PAGES,children:"Posts & pages"}),e.jsx(ue,{value:q.POSTS,children:"Posts"}),e.jsx(ue,{value:q.PAGES,children:"Pages"}),e.jsx(ue,{value:q.SOURCES,children:"Sources"})]})})}),e.jsx(U,{className:"w-[140px] text-right",children:c?.paidMembersEnabled?e.jsx(ee,{activeSortBy:l,setSortBy:o,sortBy:"free_members desc",children:"Free members"}):e.jsx(e.Fragment,{children:"Free members"})}),c?.paidMembersEnabled&&e.jsxs(e.Fragment,{children:[e.jsx(U,{className:"w-[140px] text-right",children:e.jsx(ee,{activeSortBy:l,setSortBy:o,sortBy:"paid_members desc",children:"Paid members"})}),e.jsx(U,{className:"w-[140px] text-right",children:e.jsx(ee,{activeSortBy:l,setSortBy:o,sortBy:"mrr desc",children:"MRR impact"})})]})]})}),m===q.SOURCES?e.jsx(Aa,{limit:20,range:r,setSortBy:h=>o(h),showViewAll:!0,sortBy:l}):e.jsx(oe,{children:T?e.jsx(K,{className:"last:border-none",children:e.jsx(I,{className:"border-none py-2",colSpan:1,children:e.jsx(Ge,{containerClassName:"space-y-2",count:5,maxWidth:75,randomize:!0})})}):c?.analytics.membersTrackSources?j.length>0?j.map((h,v)=>e.jsxs(K,{className:"last:border-none",children:[e.jsx(I,{children:e.jsxs("div",{className:"group/link inline-flex flex-col items-start gap-px",children:[h.post_id&&h.attribution_type==="post"?e.jsx(Ce,{className:"h-auto p-0 text-left leading-tight font-medium whitespace-normal hover:underline!",title:"View post analytics",variant:"link",onClick:Ot(h.attribution_url,h.post_id,a.url||"",s,h.attribution_type),children:h.title}):e.jsx("span",{className:"font-medium",children:h.title}),h.published_at&&Oe&&new Date(h.published_at).getTime()>0&&e.jsxs("span",{className:"text-muted-foreground",children:["Published on ",Oe(h.published_at,t)]})]})}),e.jsxs(I,{className:"text-right font-mono text-sm",children:[h.free_members>0&&"+",C(h.free_members)]}),c?.paidMembersEnabled&&e.jsxs(e.Fragment,{children:[e.jsxs(I,{className:"text-right font-mono text-sm",children:[h.paid_members>0&&"+",C(h.paid_members)]}),e.jsxs(I,{className:"text-right font-mono text-sm",children:[h.mrr>0&&"+",D,C(X(h.mrr))]})]})]},`${m}-${h.post_id||`${h.title}-${v}`}`)):e.jsx(K,{className:"border-none",children:e.jsx(I,{className:"py-12 group-hover:bg-transparent!",colSpan:c?.paidMembersEnabled?4:2,children:e.jsx(ce,{description:"Try adjusting your date range to see more data.",title:`No conversions ${W(r)}`,children:e.jsx(_t,{strokeWidth:1.5})})})}):e.jsx(K,{className:"last:border-none",children:e.jsx(I,{className:"border-none py-12 group-hover:bg-transparent!",colSpan:c?.paidMembersEnabled?4:2,children:e.jsx(tt,{})})})})]})})]})]})]})};export{Ar as default};
|
|
3
|
+
the props "valueKey" will be deprecated in 1.1.0`),D=x);var i=s.filter(function(h){return Q(h,D,0)!==0}).length,m=(g>=360?i:i-1)*b,N=g-i*f-m,j=s.reduce(function(h,v){var y=Q(v,D,0);return h+(Z(y)?y:0)},0),w;if(j>0){var T;w=s.map(function(h,v){var y=Q(h,D,0),M=Q(h,c,v),P=(Z(y)?y:0)/j,F;v?F=T.endAngle+he(p)*b*(y!==0?1:0):F=o;var _=F+he(p)*((y!==0?f:0)+P*N),R=(F+_)/2,$=(S.innerRadius+S.outerRadius)/2,H=[{name:M,value:y,payload:h,dataKey:D,type:A}],rt=Ae(S.cx,S.cy,$,R);return T=O(O(O({percent:P,cornerRadius:l,name:M,tooltipPayload:H,midAngle:R,middleRadius:$,tooltipPosition:rt},h),S),{},{value:Q(h,D),startAngle:F,endAngle:_,payload:h,paddingAngle:he(p)*b}),T})}return O(O({},S),{},{sectors:w,data:s})});var ga=sa({chartName:"PieChart",GraphicalChild:G,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:la},{axisType:"radiusAxis",AxisComp:ca}],formatAxisMap:na,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});const tt=({className:r})=>{const a=De();return e.jsx(ce,{actions:e.jsx(Ce,{variant:"outline",onClick:()=>a("/settings/analytics",{crossApp:!0}),children:"Open settings"}),className:r,description:"Enable member source tracking in settings to see which content drives member growth.",title:"Member sources have been disabled",children:e.jsx(St,{})})},va=r=>r==="total-members"||r==="free-members"||r==="paid-members"||r==="mrr",ja=({active:r,payload:a,range:n,color:t,showBreakdown:s,showGift:l})=>{if(!r||!a?.length)return null;const o=a[0].payload,{date:u,formattedValue:b,label:d,comped:c,gift:x}=o,A=o.value-(c||0)-(l&&x||0);return e.jsxs("div",{className:"min-w-[200px] rounded-lg border bg-background px-3 py-2 shadow-lg",children:[u&&e.jsx("div",{className:"mb-1 text-sm text-foreground",children:z(u,n||0)}),e.jsxs("div",{className:"flex flex-col gap-1",children:[s&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs("div",{className:"flex grow items-center justify-between gap-5",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:"Paid subscriptions"}),e.jsx("div",{className:"font-mono text-xs",children:C(A)})]})}),l&&e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs("div",{className:"flex grow items-center justify-between gap-5",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:"Gift subscriptions"}),e.jsx("div",{className:"font-mono text-xs",children:x!==void 0&&x>0?C(x):"0"})]})}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs("div",{className:"flex grow items-center justify-between gap-5",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:"Complimentary"}),e.jsx("div",{className:"font-mono text-xs",children:c!==void 0&&c>0?C(c):"0"})]})}),e.jsx(lt,{})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"inline-block size-2 rounded-full opacity-50",style:{backgroundColor:t||"var(--chart-purple)"}}),e.jsxs("div",{className:"flex grow items-center justify-between gap-5",children:[d&&e.jsx("div",{className:"text-sm text-muted-foreground",children:d}),e.jsx("div",{className:"font-mono font-medium",children:b})]})]})]})]})},ya=({chartData:r,totals:a,initialTab:n,currencySymbol:t,isLoading:s,onTabChange:l})=>{const o=va(n)?n:"total-members",[u,b]=k.useState(o),{range:d,data:c}=Te(),{appSettings:x}=je(),A=c?.labs?.giftSubscriptions===!0,f=De(),[S]=Ke();k.useEffect(()=>{b(o)},[o]);const p=v=>{b(v);const y=new URLSearchParams(S);y.set("tab",v),f(`?${y.toString()}`,{replace:!0}),l&&l(v)},{totalMembers:g,freeMembers:D,paidMembers:i,mrr:m,percentChanges:N,directions:j}=a,w=k.useMemo(()=>{if(!r||r.length===0)return[];let v=[],y="value";switch(u){case"free-members":y="free";break;case"paid-members":y="paid";break;case"mrr":{y="mrr";break}default:y="value"}v=ie(r,d,y,"exact");let M=[];switch(u){case"free-members":M=v.map(P=>({...P,value:P.free,formattedValue:C(P.free),label:"Free members"}));break;case"paid-members":M=v.map(P=>({...P,value:P.paid,formattedValue:C(P.paid),label:"Paid members",comped:P.comped,gift:P.gift,paid_subscribed:P.paid_subscribed}));break;case"mrr":M=v.map(P=>({...P,value:X(P.mrr),formattedValue:`${t}${C(X(P.mrr))}`,label:"MRR"}));break;default:M=v.map(P=>{const F=P.free+P.paid;return{...P,value:F,formattedValue:C(F),label:"Total members"}})}return M},[u,r,d,t]),T={"total-members":{color:"var(--chart-darkblue)"},"free-members":{color:"var(--chart-blue)"},"paid-members":{color:"var(--chart-purple)"},mrr:{color:"var(--chart-teal)"}};return s?e.jsx("div",{className:"-mb-6 flex h-[calc(16vw+132px)] w-full items-start justify-center",children:e.jsx(st,{})}):e.jsxs($e,{defaultValue:o,variant:"kpis",children:[e.jsxs(Ve,{className:`-mx-6 ${x?.paidMembersEnabled?"hidden grid-cols-4 lg:visible! lg:grid!":"grid grid-cols-4"}`,children:[e.jsx(ue,{className:x?.paidMembersEnabled?"":"cursor-auto after:hidden",value:"total-members",onClick:()=>{x?.paidMembersEnabled&&p("total-members")},children:e.jsx(Y,{color:"var(--chart-darkblue)",diffDirection:d===V.allTime.value?"hidden":j.total,diffValue:N.total,label:"Total members",value:C(g)})}),x?.paidMembersEnabled&&e.jsxs(e.Fragment,{children:[e.jsx(ue,{value:"free-members",onClick:()=>{p("free-members")},children:e.jsx(Y,{color:"var(--chart-blue)",diffDirection:d===V.allTime.value?"hidden":j.free,diffValue:N.free,label:"Free members",value:C(D)})}),e.jsx(ue,{value:"paid-members",onClick:()=>{p("paid-members")},children:e.jsx(Y,{color:"var(--chart-purple)",diffDirection:d===V.allTime.value?"hidden":j.paid,diffValue:N.paid,label:"Paid members",value:C(i)})}),e.jsx(ue,{value:"mrr",onClick:()=>{p("mrr")},children:e.jsx(Y,{color:"var(--chart-teal)",diffDirection:d===V.allTime.value?"hidden":j.mrr,diffValue:N.mrr,label:"MRR",value:`${t}${C(X(m))}`})})]})]}),x?.paidMembersEnabled&&e.jsxs(nt,{children:[e.jsx(it,{className:"lg:hidden",asChild:!0,children:e.jsxs(kt,{children:[u==="total-members"&&e.jsx(Y,{color:"var(--chart-darkblue)",diffDirection:d===V.allTime.value?"hidden":j.total,diffValue:N.total,label:"Total members",value:C(g)}),u==="free-members"&&e.jsx(Y,{color:"var(--chart-blue)",diffDirection:d===V.allTime.value?"hidden":j.free,diffValue:N.free,label:"Free members",value:C(D)}),u==="paid-members"&&e.jsx(Y,{color:"var(--chart-purple)",diffDirection:d===V.allTime.value?"hidden":j.paid,diffValue:N.paid,label:"Paid members",value:C(i)}),u==="mrr"&&e.jsx(Y,{color:"var(--chart-teal)",diffDirection:d===V.allTime.value?"hidden":j.mrr,diffValue:N.mrr,label:"MRR",value:`${t}${C(X(m))}`})]})}),e.jsxs(ot,{align:"end",className:"w-56",children:[e.jsx(de,{onClick:()=>p("total-members"),children:"Total members"}),e.jsx(de,{onClick:()=>p("free-members"),children:"Free members"}),e.jsx(de,{onClick:()=>p("paid-members"),children:"Paid members"}),e.jsx(de,{onClick:()=>p("mrr"),children:"MRR"})]})]}),e.jsx("div",{className:"my-4 [&_.recharts-cartesian-axis-tick-value]:fill-gray-500",children:e.jsx(At,{className:"-mb-3 h-[16vw] max-h-[320px] w-full min-h-[180px]",color:T[u].color,data:w,dataFormatter:u==="mrr"?v=>`${t}${C(v)}`:C,id:u,range:d,tooltipContent:u==="paid-members"?e.jsx(ja,{color:T["paid-members"].color,range:d,showBreakdown:!0,showGift:A}):void 0})})]})},Sa=(r,a="signups desc",n=50)=>{const{startDate:t,endDate:s,timezone:l}=le(r),o={date_from:ae(t),date_to:ae(s),member_status:Pt(ct),order:a,limit:n.toString()};return l&&(o.timezone=l),$t({searchParams:o})},Fe=({data:r,currencySymbol:a,limit:n,defaultSourceIconUrl:t})=>{const s=n?r.slice(0,n):r,{appSettings:l}=je();return e.jsx(oe,{children:s.map(o=>e.jsxs(K,{className:"last:border-none",children:[e.jsx(I,{className:"font-medium",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Rt,{defaultSourceIconUrl:t,displayName:o.displayName,iconSrc:o.iconSrc}),o.linkUrl?e.jsx("a",{className:"hover:underline",href:o.linkUrl,rel:"noreferrer",target:"_blank",children:o.displayName}):e.jsx("span",{children:o.displayName})]})}),e.jsxs(I,{className:"text-right font-mono text-sm",children:["+",C(o.free_members)]}),l?.paidMembersEnabled&&e.jsxs(e.Fragment,{children:[e.jsxs(I,{className:"text-right font-mono text-sm",children:["+",C(o.paid_members)]}),e.jsxs(I,{className:"text-right font-mono text-sm",children:["+",a,C(X(o.mrr))]})]})]},o.source))})},Aa=({range:r,limit:a=20,showViewAll:n=!1,sortBy:t,setSortBy:s})=>{const{data:l}=Te(),{data:o}=Lt(),{appSettings:u}=je(),[b,d]=k.useState("free_members desc"),c=t||b,x=s||d,A=c.replace("free_members","signups").replace("paid_members","paid_conversions"),{data:f,isLoading:S}=Sa(r,A,a),p=l?.url,g="https://www.google.com/s2/favicons?domain=ghost.org&sz=64",D=B.useMemo(()=>{if(o?.stats&&o?.meta?.totals){const j=o.meta.totals;let w=j[0];if(!w)return Se("usd");for(const T of j)T.mrr>w.mrr&&(w=T);return Se(w.currency)}return Se("usd")},[o]),i=B.useMemo(()=>f?.stats?f.stats.map(j=>{const w=j.source||"Direct",{domain:T}=Ft(w,p),h=T?`https://www.faviconextractor.com/favicon/${T}?larger=true`:g,v=T&&w!=="Direct"?`https://${T}`:void 0;return{source:w,free_members:j.signups,paid_members:j.paid_conversions,mrr:j.mrr,iconSrc:h,displayName:w,linkUrl:v}}):[],[f,p]),m="Top sources",N=`Where did your growth come from ${W(r)}`;return u?.analytics.membersTrackSources?S?e.jsx(oe,{children:e.jsx(K,{className:"last:border-none",children:e.jsx(I,{className:"border-none py-2",colSpan:1,children:e.jsx(Ge,{containerClassName:"space-y-2",count:5,maxWidth:75,randomize:!0})})})}):e.jsxs(e.Fragment,{children:[i.length>0?e.jsx(Fe,{currencySymbol:D,data:i,defaultSourceIconUrl:g,limit:a}):e.jsx(oe,{children:e.jsx(K,{className:"last:border-none",children:e.jsx(I,{className:"border-none py-12 group-hover:bg-transparent!",colSpan:u?.paidMembersEnabled?4:2,children:e.jsx(ce,{description:"Try adjusting your date range to see more data.",title:`No conversions ${W(r)}`,children:e.jsx(dt,{strokeWidth:1.5})})})})}),n&&i.length>a&&e.jsx(It,{className:"border-none bg-transparent hover:bg-transparent!",children:e.jsx(K,{children:e.jsx(I,{className:"border-none bg-transparent px-0 pb-0 hover:bg-transparent!",colSpan:4,children:e.jsxs(mt,{children:[e.jsx(ut,{asChild:!0,children:e.jsxs(Ce,{variant:"outline",children:["View all ",e.jsx(Vt,{})]})}),e.jsxs(pt,{className:"overflow-y-auto pt-0 sm:max-w-[600px]",children:[e.jsxs(ft,{className:"sticky top-0 z-40 -mx-6 bg-background/60 p-6 backdrop-blur",children:[e.jsx(ht,{children:m}),e.jsx(xt,{children:N})]}),e.jsx("div",{className:"group/datalist",children:e.jsxs(Ye,{children:[e.jsx(ze,{children:e.jsxs(K,{children:[e.jsx(U,{children:"Source"}),e.jsx(U,{className:"w-[110px] text-right",children:e.jsx(ee,{activeSortBy:c,setSortBy:x,sortBy:"free_members desc",children:"Free members"})}),u?.paidMembersEnabled&&e.jsxs(e.Fragment,{children:[e.jsx(U,{className:"w-[110px] text-right",children:e.jsx(ee,{activeSortBy:c,setSortBy:x,sortBy:"paid_members desc",children:"Paid members"})}),e.jsx(U,{className:"w-[110px] text-right",children:e.jsx(ee,{activeSortBy:c,setSortBy:x,sortBy:"mrr desc",children:"MRR impact"})})]})]})}),e.jsx(Fe,{currencySymbol:D,data:i,defaultSourceIconUrl:g})]})})]})]})})})})]}):e.jsx(oe,{children:e.jsx(K,{className:"last:border-none",children:e.jsx(I,{className:"border-none py-12 group-hover:bg-transparent!",colSpan:u?.paidMembersEnabled?4:2,children:e.jsx(tt,{})})})})},wa=({active:r,payload:a})=>{if(r&&a&&a.length){const n=a[0];return e.jsx("div",{className:"rounded-lg border bg-background p-2 shadow-sm",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"size-2 rounded-full opacity-50",style:{backgroundColor:n.payload.color}}),e.jsx("span",{className:"font-medium",children:n.name}),e.jsx("span",{className:"font-mono",children:C(n.value)})]})})}return null},Na=({isLoading:r,range:a})=>{const{data:n}=Kt(),{data:{tiers:t=[]}={}}=oa(),[s,l]=k.useState("billing-period"),{startDate:o,endDate:u}=k.useMemo(()=>le(a),[a]),b=k.useMemo(()=>ae(o),[o]),d=k.useMemo(()=>ae(u),[u]),c=k.useMemo(()=>t.filter(i=>i.type==="paid"&&i.active).map(i=>({id:i.id,name:i.name})),[t]),x=k.useMemo(()=>{if(!n?.stats)return[];const i=E(b),m=E(d),N=n.stats.filter(w=>{const T=E(w.date);return T.isSameOrAfter(i)&&T.isSameOrBefore(m)}).reduce((w,T)=>{const h=T.cadence;return w[h]||(w[h]=0),w[h]+=T.signups,w},{});return Object.entries(N).map(([w,T],h)=>{let v=w,y="url(#gradientPurple)",M="var(--chart-purple)";return w==="month"?(v="Monthly",y="url(#gradientPurple)",M="var(--chart-purple)"):w==="year"&&(v="Annual",y="url(#gradientTeal)",M="var(--chart-teal)"),{id:`cadence-${h}`,name:v,count:T,fill:y,color:M}})},[n,b,d]),A=k.useMemo(()=>{if(!n?.stats||c.length===0)return[];const i=E(b),m=E(d),N=n.stats.filter(v=>{const y=E(v.date);return y.isSameOrAfter(i)&&y.isSameOrBefore(m)}).reduce((v,y)=>{const M=y.tier;return v[M]||(v[M]=0),v[M]+=y.signups,v},{}),j=[{gradient:"url(#gradientPurple)",solid:"var(--chart-purple)"},{gradient:"url(#gradientTeal)",solid:"var(--chart-teal)"},{gradient:"url(#gradientBlue)",solid:"var(--chart-blue)"},{gradient:"url(#gradientRose)",solid:"var(--chart-rose)"},{gradient:"url(#gradientOrange)",solid:"var(--chart-orange)"},{gradient:"url(#gradientGreen)",solid:"var(--chart-green)"},{gradient:"url(#gradientAmber)",solid:"var(--chart-amber)"},{gradient:"url(#gradientYellow)",solid:"var(--chart-yellow)"},{gradient:"url(#gradientDarkblue)",solid:"var(--chart-darkblue)"},{gradient:"url(#gradientGray)",solid:"var(--chart-darkgray)"}];return[...c.map(v=>{const y=N[v.id]||0;return{id:v.id,name:v.name,count:y}})].sort((v,y)=>y.count-v.count).map((v,y)=>{const M=y%j.length;return{...v,fill:j[M].gradient,color:j[M].solid}})},[n,c,b,d]),f=s==="billing-period"?x:A,S=k.useMemo(()=>f.reduce((i,m)=>i+m.count,0),[f]),p=k.useMemo(()=>{const i={count:{label:"Subscriptions"}};return f.forEach(m=>{i[m.id]={label:m.name,color:m.color}}),i},[f]),g=k.useMemo(()=>S===0?[]:f.map(i=>({label:i.name,count:i.count,percentage:i.count/S*100,color:i.color})),[f,S]);if(r||!n?.stats)return null;const D=f.length>0&&S>0;return e.jsxs(be,{children:[e.jsx(_e,{children:e.jsxs("div",{className:"flex items-start justify-between gap-1.5",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(ke,{children:"Paid subscription breakdown"}),e.jsxs(Pe,{children:["New paid subscriptions ",W(a)]})]}),c.length>1&&e.jsx("div",{children:e.jsxs(qe,{value:s,onValueChange:i=>l(i),children:[e.jsx(Qe,{className:"w-full",children:e.jsx(Xe,{})}),e.jsxs(Ze,{align:"end",children:[e.jsx(we,{value:"billing-period",children:"Billing period"}),e.jsx(we,{value:"tiers",children:"Tiers"})]})]})})]})}),e.jsx(ge,{children:D?e.jsxs(e.Fragment,{children:[e.jsx(We,{className:"mx-auto aspect-square h-[250px] min-h-[250px] w-full",config:p,children:e.jsxs(ga,{children:[e.jsxs("defs",{children:[e.jsxs("linearGradient",{id:"gradientPurple",x1:"0",x2:"0",y1:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"var(--chart-purple)",stopOpacity:.8}),e.jsx("stop",{offset:"100%",stopColor:"var(--chart-purple)",stopOpacity:.6})]}),e.jsxs("linearGradient",{id:"gradientTeal",x1:"0",x2:"0",y1:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"var(--chart-teal)",stopOpacity:.8}),e.jsx("stop",{offset:"100%",stopColor:"var(--chart-teal)",stopOpacity:.6})]}),e.jsxs("linearGradient",{id:"gradientRose",x1:"0",x2:"0",y1:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"var(--chart-rose)",stopOpacity:.8}),e.jsx("stop",{offset:"100%",stopColor:"var(--chart-rose)",stopOpacity:.6})]}),e.jsxs("linearGradient",{id:"gradientBlue",x1:"0",x2:"0",y1:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"var(--chart-blue)",stopOpacity:.8}),e.jsx("stop",{offset:"100%",stopColor:"var(--chart-blue)",stopOpacity:.6})]}),e.jsxs("linearGradient",{id:"gradientOrange",x1:"0",x2:"0",y1:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"var(--chart-orange)",stopOpacity:.8}),e.jsx("stop",{offset:"100%",stopColor:"var(--chart-orange)",stopOpacity:.6})]}),e.jsxs("linearGradient",{id:"gradientGreen",x1:"0",x2:"0",y1:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"var(--chart-green)",stopOpacity:.8}),e.jsx("stop",{offset:"100%",stopColor:"var(--chart-green)",stopOpacity:.6})]}),e.jsxs("linearGradient",{id:"gradientAmber",x1:"0",x2:"0",y1:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"var(--chart-amber)",stopOpacity:.8}),e.jsx("stop",{offset:"100%",stopColor:"var(--chart-amber)",stopOpacity:.6})]}),e.jsxs("linearGradient",{id:"gradientYellow",x1:"0",x2:"0",y1:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"var(--chart-yellow)",stopOpacity:.8}),e.jsx("stop",{offset:"100%",stopColor:"var(--chart-yellow)",stopOpacity:.6})]}),e.jsxs("linearGradient",{id:"gradientDarkblue",x1:"0",x2:"0",y1:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"var(--chart-darkblue)",stopOpacity:.8}),e.jsx("stop",{offset:"100%",stopColor:"var(--chart-darkblue)",stopOpacity:.6})]}),e.jsxs("linearGradient",{id:"gradientGray",x1:"0",x2:"0",y1:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"var(--chart-darkgray)",stopOpacity:.8}),e.jsx("stop",{offset:"100%",stopColor:"var(--chart-darkgray)",stopOpacity:.6})]})]}),e.jsx(He,{content:e.jsx(wa,{}),cursor:!1}),e.jsx(G,{animationBegin:0,animationDuration:1e3,data:f,dataKey:"count",innerRadius:70,nameKey:"name",strokeWidth:5,children:e.jsx(Ue,{content:({viewBox:i})=>{if(i&&"cx"in i&&"cy"in i)return e.jsxs("text",{dominantBaseline:"middle",textAnchor:"middle",x:i.cx,y:i.cy,children:[e.jsx("tspan",{className:"fill-foreground text-2xl font-semibold tracking-tight",x:i.cx,y:i.cy,children:C(S)}),e.jsx("tspan",{className:"fill-muted-foreground",x:i.cx,y:(i.cy||0)+20,children:"Total"})]})}})})]})}),g.length>0&&e.jsx("div",{className:"mt-4 flex flex-wrap items-center justify-center gap-x-6 gap-y-1 text-sm text-muted-foreground",children:g.map(i=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"size-2 rounded-full opacity-50",style:{backgroundColor:i.color}}),e.jsx("span",{className:"max-w-[150px] truncate whitespace-nowrap",title:i.label,children:i.label}),e.jsxs("span",{className:"font-medium text-foreground",children:[Math.round(Number(i.percentage)||0),"%"]})]},i.label))})]}):e.jsx("div",{className:"py-12",children:e.jsx(ce,{description:`No new paid subscriptions ${W(a)}.`,title:"No new subscribers",children:e.jsx(wt,{strokeWidth:1.5})})})})]})},Da=(r,a,n)=>{if(a===1){const c=E().format("YYYY-MM-DD"),x=r.find(A=>A.date===c);return[{date:c,signups:x?.signups||0,cancellations:x?.cancellations||0}]}const{startDate:t,endDate:s}=le(a),l=E(s).diff(E(t),"days"),o=bt(a,l,"sum",n),u=new Map(r.map(c=>[c.date,c])),b=[],d=new Set;if(o==="monthly"){const c=E(t).startOf("month"),x=E(s).startOf("month");for(;c.isSameOrBefore(x);){const A=c.format("YYYY-MM-DD");if(!d.has(A)){d.add(A);const f=u.get(A);f?b.push(f):b.push({date:A,signups:0,cancellations:0})}c.add(1,"month")}}else if(o==="weekly"){const c=E(t).startOf("week"),x=E(s).startOf("week");for(;c.isSameOrBefore(x);){const A=c.format("YYYY-MM-DD");if(!d.has(A)){d.add(A);const f=u.get(A);f?b.push(f):b.push({date:A,signups:0,cancellations:0})}c.add(1,"week")}}else{const c=E(t),x=E(s);for(;c.isSameOrBefore(x);){const A=c.format("YYYY-MM-DD"),f=u.get(A);f?b.push(f):b.push({date:A,signups:0,cancellations:0}),c.add(1,"day")}}return b},at=r=>{if(r===-1){const{startDate:a,endDate:n}=le(r);return E(n).diff(E(a),"days")}return r},Ca=r=>{const a=at(r);return a<30?["daily"]:a>=91?["weekly","monthly"]:["daily","weekly"]},Le=r=>{const a=at(r);return a<30?"daily":a>=91?"monthly":"weekly"},Ta=({subscriptionData:r,memberData:a,range:n,isLoading:t})=>{const[s,l]=k.useState(()=>Le(n));k.useEffect(()=>{l(Le(n))},[n]);const o=k.useMemo(()=>Ca(n),[n]),u=k.useMemo(()=>{switch(s){case"daily":return"none";case"weekly":return"weekly";case"monthly":return"monthly"}},[s]),b=k.useMemo(()=>{if(r&&r.length>0){if(n===1){const m=E().format("YYYY-MM-DD"),N=r.find(j=>j.date===m);return[{date:z(m,n),rawDate:m,new:N?.signups||0,cancelled:-(N?.cancellations||0)}]}const f=ie(r,n,"signups","sum",u),S=ie(r,n,"cancellations","sum",u),p=new Map(S.map(m=>[m.date,m])),g=f.map(m=>({date:m.date,signups:m.signups||0,cancellations:p.get(m.date)?.cancellations||0})),D=new Set(g.map(m=>m.date));return S.forEach(m=>{D.has(m.date)||g.push({date:m.date,signups:0,cancellations:m.cancellations||0})}),g.sort((m,N)=>new Date(m.date).getTime()-new Date(N.date).getTime()),Da(g,n,u).map(m=>{let N=n;return s==="weekly"&&n<91?N=91:s==="monthly"&&n<365&&(N=365),{date:z(m.date,N),rawDate:m.date,new:m.signups||0,cancelled:-(m.cancellations||0)}})}else{if(!a||a.length===0)return[];if(n===1){const i=E().format("YYYY-MM-DD"),m=a.find(N=>N.date===i);return[{date:z(i,n),rawDate:i,new:m?.paid_subscribed||0,cancelled:-(m?.paid_canceled||0)}]}const f=ie(a,n,"paid_subscribed","sum",u),S=ie(a,n,"paid_canceled","sum",u),p=new Map(S.map(i=>[i.date,i])),g=f.map(i=>({date:i.date,paid_subscribed:i.paid_subscribed||0,paid_canceled:p.get(i.date)?.paid_canceled||0})),D=new Set(g.map(i=>i.date));return S.forEach(i=>{D.has(i.date)||g.push({date:i.date,paid_subscribed:0,paid_canceled:i.paid_canceled||0})}),g.sort((i,m)=>new Date(i.date).getTime()-new Date(m.date).getTime()),g.map(i=>{let m=n;return s==="weekly"&&n<91?m=91:s==="monthly"&&n<365&&(m=365),{date:z(i.date,m),rawDate:i.date,new:i.paid_subscribed||0,cancelled:-(i.paid_canceled||0)}})}},[a,r,n,u,s]),d={new:{label:"New",color:"var(--chart-teal)"},cancelled:{label:"Cancelled",color:"var(--chart-rose)"}},c=k.useMemo(()=>{const f=b.reduce((p,g)=>p+g.new,0),S=b.reduce((p,g)=>p+Math.abs(g.cancelled),0);return{new:f,cancelled:S}},[b]);if(t)return null;const x=b.length>0&&(c.new>0||c.cancelled>0),A=f=>f.charAt(0).toUpperCase()+f.slice(1);return e.jsxs(be,{"data-testid":"paid-members-change-card",children:[e.jsx(_e,{children:e.jsxs("div",{className:"flex items-start justify-between gap-1.5",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(ke,{children:"Paid subscriptions"}),e.jsxs(Pe,{children:["New and cancelled paid subscriptions ",W(n)]})]}),o.length>1&&e.jsx("div",{children:e.jsxs(qe,{value:s,onValueChange:f=>l(f),children:[e.jsx(Qe,{className:"w-[110px]",children:e.jsx(Xe,{})}),e.jsx(Ze,{align:"end",children:o.map(f=>e.jsx(we,{value:f,children:A(f)},f))})]})})]})}),e.jsx(ge,{children:x?e.jsxs("div",{children:[e.jsx(We,{className:"aspect-auto h-[200px] w-full md:h-[220px] xl:h-[260px]",config:d,children:e.jsxs(Mt,{data:b,stackOffset:"sign",children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:"tealGradient",x1:"0",x2:"0",y1:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"var(--color-new)",stopOpacity:.8}),e.jsx("stop",{offset:"100%",stopColor:"var(--color-new)",stopOpacity:.6})]})}),e.jsx("defs",{children:e.jsxs("linearGradient",{id:"roseGradient",x1:"0",x2:"0",y1:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"var(--color-cancelled)",stopOpacity:.6}),e.jsx("stop",{offset:"100%",stopColor:"var(--color-cancelled)",stopOpacity:.8})]})}),e.jsx(Nt,{stroke:"var(--border)",vertical:!1}),e.jsx(Dt,{axisLine:!1,dataKey:"date",tickFormatter:()=>"",tickLine:!1,tickMargin:10}),e.jsx(Ct,{axisLine:!1,tickFormatter:f=>f<0?C(f*-1):C(f),tickLine:!1}),e.jsx(He,{content:e.jsx(ia,{className:"min-w-[120px]! px-3 py-2",formatter:(f,S,p,g)=>{const D=Number(f);let i="0";D===0?i="0":i=D<0?C(D*-1):C(D);const m=Number(p?.payload?.new||0),N=Number(p?.payload?.cancelled||0),j=m+N,w=j===0?"0":j>0?`+${C(j)}`:C(j);let T=p?.payload?.date;return p?.payload?.rawDate&&(s==="monthly"?T=z(p.payload.rawDate,366):s==="weekly"?T=z(p.payload.rawDate,91):T=z(p.payload.rawDate,30)),e.jsxs("div",{className:"flex w-full flex-col",children:[g===0&&e.jsx("div",{className:"mb-1 text-sm font-medium text-foreground",children:T}),e.jsxs("div",{className:"flex w-full items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("div",{className:"size-2 shrink-0 rounded-full bg-[var(--color-bg)] opacity-50",style:{"--color-bg":`var(--color-${S})`}}),e.jsx("span",{className:"text-sm text-muted-foreground",children:d[S]?.label||S})]}),e.jsx("div",{className:"ml-auto flex items-baseline gap-0.5 font-mono font-medium text-foreground tabular-nums",children:i})]}),g===1&&e.jsxs("div",{className:"mt-1 flex w-full items-center justify-between gap-4 border-t pt-1",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Net change"}),e.jsx("div",{className:"ml-auto flex items-baseline gap-0.5 font-mono font-medium text-foreground tabular-nums",children:w})]})]})},hideLabel:!0}),cursor:!1,isAnimationActive:!1,position:{y:10}}),e.jsx(Ee,{activeBar:{fillOpacity:1},dataKey:"new",fill:"url(#tealGradient)",fillOpacity:.75,maxBarSize:32,minPointSize:3,radius:[4,4,0,0],stackId:"a"}),e.jsx(Ee,{activeBar:{fillOpacity:1},dataKey:"cancelled",fill:"url(#roseGradient)",fillOpacity:.75,maxBarSize:32,radius:[4,4,0,0],stackId:"a"})]})}),e.jsxs("div",{className:"mt-3 flex items-center justify-center gap-6 text-sm text-muted-foreground",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"size-2 rounded-full opacity-50",style:{backgroundColor:d.new.color}}),e.jsx("span",{children:"New"}),e.jsx("span",{className:"font-medium text-foreground",children:C(c.new)})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"size-2 rounded-full opacity-50",style:{backgroundColor:d.cancelled.color}}),e.jsx("span",{children:"Cancelled"}),e.jsx("span",{className:"font-medium text-foreground",children:C(c.cancelled)})]})]})]}):e.jsx("div",{className:"py-12",children:e.jsx(ce,{description:`No paid subscription changes ${W(n)}.`,title:"No paid member changes",children:e.jsx(Tt,{strokeWidth:1.5})})})})]})},_a=(r,a,n)=>{const t=r??30,s=a??"mrr desc",{startDate:l,endDate:o}=k.useMemo(()=>le(t),[t]),u=k.useMemo(()=>{const c={date_from:ae(l),date_to:ae(o),order:s};return n==="posts"?c.post_type="post":n==="pages"&&(c.post_type="page"),c},[l,o,s,n]),b=Object.fromEntries(Object.entries(u).filter(([,c])=>c!==void 0));return Gt({searchParams:b})},Dr=()=>{const{range:r,site:a,settings:n}=Te(),t=String(n.find(h=>h.key==="timezone")?.value||"Etc/UTC"),s=De(),[l,o]=k.useState("free_members desc"),[u,b]=k.useState(q.POSTS_AND_PAGES),[d]=Ke(),{appSettings:c}=je(),x=d.get("tab")||"total-members",[A,f]=k.useState(x);k.useEffect(()=>{x!==A&&f(x)},[x]);const{isLoading:S,chartData:p,totals:g,currencySymbol:D,subscriptionData:i}=da(r),{data:m,isLoading:N}=_a(r,l,u),j=k.useMemo(()=>{const v=(m?.stats||[]).reduce((_,R)=>{const $=R.post_id||(R.title&&R.title.trim()!==""?R.title:R.attribution_url);if(!$)return _;if(!_.has($))_.set($,R);else{const H=_.get($);H.free_members+=R.free_members,H.paid_members+=R.paid_members,H.mrr+=R.mrr,_.set($,H)}return _},new Map),y=Array.from(v.values()),M=y.reduce((_,R)=>_+R.free_members,0),P=y.reduce((_,R)=>_+R.paid_members,0),F=y.reduce((_,R)=>_+R.mrr,0);return y.map(_=>{let R=0;return l.includes("free_members")&&M>0?R=_.free_members/M:l.includes("paid_members")&&P>0?R=_.paid_members/P:l.includes("mrr")&&F>0&&(R=_.mrr/F),{title:_.title||_.attribution_url,post_id:_.post_id,attribution_url:_.attribution_url,attribution_type:_.attribution_type,attribution_id:_.attribution_id,free_members:_.free_members,paid_members:_.paid_members,mrr:_.mrr,percentage:R,published_at:_.published_at,url_exists:_.url_exists??!0}})},[m,l]),w=S,T=S||N;return e.jsxs(gt,{children:[e.jsx(vt,{children:e.jsx(Yt,{children:e.jsx(jt,{})})}),e.jsxs(yt,{data:w?void 0:p,isLoading:!1,loadingComponent:e.jsx(e.Fragment,{}),children:[e.jsx(be,{"data-testid":"total-members-card",children:e.jsx(ge,{children:e.jsx(ya,{chartData:p,currencySymbol:D,initialTab:x,isLoading:w,totals:g,onTabChange:f})})}),c?.paidMembersEnabled&&A==="paid-members"&&e.jsxs("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-2 xl:grid-cols-[2fr_minmax(460px,1fr)]",children:[e.jsx(Ta,{isLoading:w,memberData:p,range:r,subscriptionData:i}),e.jsx(Na,{isLoading:w,range:r})]}),e.jsxs(be,{className:"w-full overflow-x-auto","data-testid":"top-content-card",children:[e.jsxs(_e,{children:[e.jsx(ke,{children:Et(u)}),e.jsx(Pe,{children:Bt(u,r,W)})]}),e.jsx(ge,{children:e.jsxs(Ye,{children:[e.jsx(ze,{children:e.jsxs(K,{className:"[&>th]:h-auto [&>th]:pt-0 [&>th]:pb-2",children:[e.jsx(U,{className:"min-w-[320px] pl-0",children:e.jsx($e,{defaultValue:u,variant:"button-sm",onValueChange:h=>{b(h)},children:e.jsxs(Ve,{children:[e.jsx(me,{value:q.POSTS_AND_PAGES,children:"Posts & pages"}),e.jsx(me,{value:q.POSTS,children:"Posts"}),e.jsx(me,{value:q.PAGES,children:"Pages"}),e.jsx(me,{value:q.SOURCES,children:"Sources"})]})})}),e.jsx(U,{className:"w-[140px] text-right",children:c?.paidMembersEnabled?e.jsx(ee,{activeSortBy:l,setSortBy:o,sortBy:"free_members desc",children:"Free members"}):e.jsx(e.Fragment,{children:"Free members"})}),c?.paidMembersEnabled&&e.jsxs(e.Fragment,{children:[e.jsx(U,{className:"w-[140px] text-right",children:e.jsx(ee,{activeSortBy:l,setSortBy:o,sortBy:"paid_members desc",children:"Paid members"})}),e.jsx(U,{className:"w-[140px] text-right",children:e.jsx(ee,{activeSortBy:l,setSortBy:o,sortBy:"mrr desc",children:"MRR impact"})})]})]})}),u===q.SOURCES?e.jsx(Aa,{limit:20,range:r,setSortBy:h=>o(h),showViewAll:!0,sortBy:l}):e.jsx(oe,{children:T?e.jsx(K,{className:"last:border-none",children:e.jsx(I,{className:"border-none py-2",colSpan:1,children:e.jsx(Ge,{containerClassName:"space-y-2",count:5,maxWidth:75,randomize:!0})})}):c?.analytics.membersTrackSources?j.length>0?j.map((h,v)=>e.jsxs(K,{className:"last:border-none",children:[e.jsx(I,{children:e.jsxs("div",{className:"group/link inline-flex flex-col items-start gap-px",children:[h.post_id&&h.attribution_type==="post"?e.jsx(Ce,{className:"h-auto p-0 text-left leading-tight font-medium whitespace-normal hover:underline!",title:"View post analytics",variant:"link",onClick:Ot(h.attribution_url,h.post_id,a.url||"",s,h.attribution_type),children:h.title}):e.jsx("span",{className:"font-medium",children:h.title}),h.published_at&&Oe&&new Date(h.published_at).getTime()>0&&e.jsxs("span",{className:"text-muted-foreground",children:["Published on ",Oe(h.published_at,t)]})]})}),e.jsxs(I,{className:"text-right font-mono text-sm",children:[h.free_members>0&&"+",C(h.free_members)]}),c?.paidMembersEnabled&&e.jsxs(e.Fragment,{children:[e.jsxs(I,{className:"text-right font-mono text-sm",children:[h.paid_members>0&&"+",C(h.paid_members)]}),e.jsxs(I,{className:"text-right font-mono text-sm",children:[h.mrr>0&&"+",D,C(X(h.mrr))]})]})]},`${u}-${h.post_id||`${h.title}-${v}`}`)):e.jsx(K,{className:"border-none",children:e.jsx(I,{className:"py-12 group-hover:bg-transparent!",colSpan:c?.paidMembersEnabled?4:2,children:e.jsx(ce,{description:"Try adjusting your date range to see more data.",title:`No conversions ${W(r)}`,children:e.jsx(_t,{strokeWidth:1.5})})})}):e.jsx(K,{className:"last:border-none",children:e.jsx(I,{className:"border-none py-12 group-hover:bg-transparent!",colSpan:c?.paidMembersEnabled?4:2,children:e.jsx(tt,{})})})})]})})]})]})]})};export{Dr as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as o,j as n,cM as Sn,cN as En,B as A,cn as Vn,cO as _n,d7 as Yn,t as dn,d0 as Qn,b as Nn,d8 as pn,S as E,P as Zn,A as Jn,g as bn,d as Xn,h as Gn,m as ne,bH as ee,e as un,F as on,i as rn,d9 as te,da as D,db as xn,o as ae,a as oe,u as re,p as ie,L as de,aZ as se,D as ce,v as le,w as ge,x as pe,
|
|
1
|
+
import{r as o,j as n,cM as Sn,cN as En,B as A,cn as Vn,cO as _n,d7 as Yn,t as dn,d0 as Qn,b as Nn,d8 as pn,S as E,P as Zn,A as Jn,g as bn,d as Xn,h as Gn,m as ne,bH as ee,e as un,F as on,i as rn,d9 as te,da as D,db as xn,o as ae,a as oe,u as re,p as ie,L as de,aZ as se,D as ce,v as le,w as ge,x as pe,af as ue,dc as he,dd as me,bz as vn,bA as ke}from"./index-CYyEyBYw.js";import{M as fe}from"./minus-BzXQVmMw.js";import{u as be,D as xe,A as ve,S as yn}from"./deleted-feed-item-ZBLfgRkK.js";import{T as ye}from"./topic-filter-C7TpPe1G.js";import{E as wn}from"./empty-indicator-P3IsUguf.js";import{I as jn}from"./inbox-D1RM3kVF.js";import"./trash-DCVuk7ZX.js";const hn=["1.5rem","1.6rem","1.7rem","1.8rem","2rem"],W={BACKGROUND_COLOR:"ghost-ap-background-color",FONT_SIZE:"ghost-ap-font-size",FONT_STYLE:"ghost-ap-font-style"},P={SYSTEM:{id:"system",color:"#fff",background:"bg-white dark:bg-black",button:"bg-white dark:bg-black",border:"border-black/[8%] dark:border-gray-950"},SEPIA:{id:"sepia",color:"#FCF8F1",background:"bg-[#FCF8F1]",button:"bg-[#FCF8F1] hover:bg-black/[3%] text-black hover:text-black",border:"border-black/[8%]"},LIGHT:{id:"light",color:"#fff",background:"bg-white",button:"hover:bg-black/[3%] text-black hover:text-black",border:"border-black/[8%] dark:border-gray-950"},DARK:{id:"dark",color:"#15171a",background:"bg-black",button:"text-white dark:bg-black dark:hover:bg-gray-900",border:"border-black/[8%] dark:border-gray-950"}},we=()=>{const[t,c]=o.useState(()=>localStorage.getItem(W.BACKGROUND_COLOR)?.toUpperCase()||"SYSTEM"),[a,p]=o.useState(()=>{const r=localStorage.getItem(W.FONT_SIZE);return r?parseInt(r):2}),[s,k]=o.useState(()=>localStorage.getItem(W.FONT_STYLE)||"sans"),i=r=>{c(r),localStorage.setItem(W.BACKGROUND_COLOR,P[r].id)};return o.useEffect(()=>{localStorage.setItem(W.FONT_SIZE,a.toString())},[a]),o.useEffect(()=>{localStorage.setItem(W.FONT_STYLE,s)},[s]),{backgroundColor:t,currentFontSizeIndex:a,fontStyle:s,handleColorChange:i,setFontStyle:k,increaseFontSize:()=>{p(r=>Math.min(r+1,hn.length-1))},decreaseFontSize:()=>{p(r=>Math.max(r-1,0))},resetFontSize:()=>p(2),fontSize:hn[a]}},Cn=({backgroundColor:t,currentFontSizeIndex:c,fontStyle:a,onColorChange:p,onFontStyleChange:s,onDecreaseFontSize:k,onIncreaseFontSize:i,onResetFontSize:u,onOpenChange:v})=>{const h=l=>t===l,r=l=>a===l;return n.jsx(je,{backgroundColor:t,currentFontSizeIndex:c,fontStyle:a,isActiveColor:h,isActiveFont:r,onColorChange:p,onDecreaseFontSize:k,onFontStyleChange:s,onIncreaseFontSize:i,onOpenChange:v,onResetFontSize:u})},je=({backgroundColor:t,isActiveColor:c,isActiveFont:a,onColorChange:p,onFontStyleChange:s,currentFontSizeIndex:k,onDecreaseFontSize:i,onIncreaseFontSize:u,onResetFontSize:v,onOpenChange:h})=>n.jsxs(Sn,{modal:!1,onOpenChange:h,children:[n.jsx(En,{asChild:!0,children:n.jsx(A,{className:`size-9 rounded-full ${P[t].button}`,variant:"ghost",children:n.jsx(Vn.Typography,{className:"size-[18px]!"})})}),n.jsx(_n,{align:"end",className:"w-[224px]",onCloseAutoFocus:r=>r.preventDefault(),onOpenAutoFocus:r=>r.preventDefault(),children:n.jsxs("div",{className:"flex flex-col gap-4",children:[n.jsxs("div",{className:"flex items-center justify-between gap-[6px]",children:[n.jsx(A,{className:`h-7 flex-1 rounded-[6px] bg-gray-200 p-0 text-[1.1rem] text-black hover:bg-gray-250 dark:bg-gray-925 dark:text-white dark:hover:bg-gray-900 [&_svg]:size-[14px] ${c("SYSTEM")?"outline outline-2 outline-green":""}`,variant:"secondary",onClick:()=>p("SYSTEM"),children:"Auto"}),n.jsx(A,{className:`h-7 flex-1 rounded-[6px] bg-[#ece6d9] p-0 hover:bg-[#ece6d9] ${c("SEPIA")?"outline outline-2 outline-green":"border border-[#ece6d9]"}`,onClick:()=>p("SEPIA")}),n.jsx(A,{className:`h-7 flex-1 rounded-[6px] bg-white p-0 hover:bg-white ${c("LIGHT")?"outline outline-2 outline-green":"border border-gray-200"}`,onClick:()=>p("LIGHT")}),n.jsx(A,{className:`h-7 flex-1 rounded-[6px] bg-black p-0 hover:bg-black dark:border dark:border-gray-925 ${c("DARK")?"outline outline-2 outline-green":""}`,onClick:()=>p("DARK")})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsxs(A,{className:`flex h-auto w-full flex-col gap-1 rounded-[6px] bg-gray-200 text-black hover:bg-gray-250 dark:bg-gray-925 dark:text-white dark:hover:bg-gray-900 ${a("sans")&&"outline outline-2 outline-green"}`,variant:"secondary",onClick:()=>s("sans"),children:[n.jsx("span",{className:"text-[2rem] leading-none font-bold",children:"Aa"}),n.jsx("span",{className:"text-[1.1rem]",children:"System"})]}),n.jsxs(A,{className:`flex h-auto w-full flex-col gap-1 rounded-[6px] bg-gray-200 text-black hover:bg-gray-250 dark:bg-gray-925 dark:text-white dark:hover:bg-gray-900 ${a("serif")&&"outline outline-2 outline-green"}`,variant:"secondary",onClick:()=>s("serif"),children:[n.jsx("span",{className:"pt-1 font-serif text-[2rem] leading-none font-bold",children:"Aa"}),n.jsx("span",{className:"font-serif text-[1.2rem]",children:"Serif"})]})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx(A,{className:"h-8 w-full rounded-[6px] bg-gray-200 text-black hover:bg-gray-250 dark:bg-gray-925 dark:text-white dark:hover:bg-gray-900 [&_svg]:size-[14px]",disabled:k===0,variant:"secondary",onClick:i,children:n.jsx(fe,{})}),n.jsx(A,{className:"h-8 w-full rounded-[6px] bg-gray-200 text-black hover:bg-gray-250 dark:bg-gray-925 dark:text-white dark:hover:bg-gray-900",variant:"secondary",onClick:v,children:n.jsx("span",{className:"text-[1.6rem] font-bold",children:"Aa"})}),n.jsx(A,{className:"h-8 w-full rounded-[6px] bg-gray-200 text-black hover:bg-gray-250 dark:bg-gray-925 dark:text-white dark:hover:bg-gray-900 [&_svg]:size-[14px]",disabled:k===hn.length-1,variant:"secondary",onClick:u,children:n.jsx(Yn,{})})]})]})})]}),Ce=({tocItems:t,iframeElement:c,modalRef:a,className:p="visible! absolute inset-y-0 right-7 z-40 hidden lg:block!",onOpenChange:s})=>{const[k,i]=o.useState(null),u=dn.useRef(!1),v=h=>{if(!c?.contentDocument)return;const r=c.contentDocument.getElementById(h);r&&a.current&&(u.current=!0,i(h),a.current.scrollTo({top:r.offsetTop-20,behavior:"smooth"}),setTimeout(()=>{u.current=!1},1e3))};return o.useEffect(()=>{if(!c?.contentDocument||t.length<=1)return;const h=a.current;if(!h)return;const r=()=>{if(u.current)return;const d=c.contentDocument;if(!d)return;const _=h.scrollTop,F=100,B=t.map(z=>d.getElementById(z.id)).filter(z=>z!==null).map(z=>({id:z.id,top:z.offsetTop}));if(!B.length)return;const L=B.reduce((z,M)=>M.top-F<=_?M:z);i(L?.id||null)},l=()=>{requestAnimationFrame(r)};return h.addEventListener("scroll",l),r(),()=>{h.removeEventListener("scroll",l)}},[c,t,a]),t.length<=1?null:n.jsx("div",{className:p,children:n.jsx("div",{className:"sticky top-1/2 -translate-y-1/2",children:n.jsx(Ee,{activeHeading:k||"",items:t,onItemClick:v,onOpenChange:s})})})},ze={1:"w-3",2:"w-2",3:"w-1"},Se={1:"pl-2",2:"pl-6",3:"pl-10"},Ee=({items:t,activeHeading:c,onItemClick:a,onOpenChange:p})=>{const[s,k]=o.useState(!1),i=dn.useRef();if(dn.useEffect(()=>()=>{i.current&&clearTimeout(i.current)},[]),t.length===0)return null;const u=d=>Math.min(d,3),v=d=>ze[u(d)],h=d=>Se[u(d)],r=()=>{i.current&&clearTimeout(i.current),k(!0),p?.(!0)},l=()=>{i.current=setTimeout(()=>{k(!1),p?.(!1)},100)};return n.jsxs(Sn,{modal:!1,open:s,onOpenChange:k,children:[n.jsx(En,{asChild:!0,children:n.jsx("div",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 flex-col items-end gap-2 rounded-md p-2 text-base dark:bg-black",onMouseEnter:r,onMouseLeave:l,children:t.map(d=>n.jsx("div",{className:`h-[2px] rounded-sm ${c===d.id?"bg-black dark:bg-white":"bg-gray-400 dark:bg-gray-700"} pr-1 transition-all ${v(d.level)}`},d.id))})}),n.jsx(_n,{align:"center",className:"w-[240px] p-2",side:"left",sideOffset:-28,onCloseAutoFocus:d=>d.preventDefault(),onMouseEnter:r,onMouseLeave:l,onOpenAutoFocus:d=>d.preventDefault(),children:n.jsx("nav",{"aria-label":"Table of contents navigation",className:"max-h-[60vh] overflow-y-auto",role:"navigation",children:t.map(d=>n.jsx("button",{className:`line-clamp-2 block w-full cursor-pointer rounded py-1 text-left text-sm leading-tight ${c===d.id?"text-black dark:text-white":"text-gray-700 dark:text-gray-600"} hover:bg-gray-75 hover:text-gray-900 dark:hover:bg-grey-925 dark:hover:text-white ${h(d.level)}`,type:"button",onClick:()=>a(d.id),children:n.jsx("span",{className:"line-clamp-2",children:d.text})},d.id))})})]})},_e=()=>`<style>
|
|
2
2
|
|
|
3
3
|
/* Variables */
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a,j as u,as as F,at as I,au as L,av as S,aw as j,ax as O,ay as z,az as H}from"./index-
|
|
1
|
+
import{r as a,j as u,as as F,at as I,au as L,av as S,aw as j,ax as O,ay as z,az as H}from"./index-CYyEyBYw.js";var R="Checkbox",[G]=H(R),[K,P]=G(R);function U(t){const{__scopeCheckbox:c,checked:s,children:l,defaultChecked:r,disabled:e,form:f,name:h,onCheckedChange:d,required:C,value:k="on",internal_do_not_use_render:i}=t,[p,v]=L({prop:s,defaultProp:r??!1,onChange:d,caller:R}),[x,m]=a.useState(null),[E,o]=a.useState(null),n=a.useRef(!1),_=x?!!f||!!x.closest("form"):!0,y={checked:p,disabled:e,setChecked:v,control:x,setControl:m,name:h,form:f,value:k,hasConsumerStoppedPropagationRef:n,required:C,defaultChecked:b(r)?!1:r,isFormControl:_,bubbleInput:E,setBubbleInput:o};return u.jsx(K,{scope:c,...y,children:Q(i)?i(y):l})}var w="CheckboxTrigger",N=a.forwardRef(({__scopeCheckbox:t,onKeyDown:c,onClick:s,...l},r)=>{const{control:e,value:f,disabled:h,checked:d,required:C,setControl:k,setChecked:i,hasConsumerStoppedPropagationRef:p,isFormControl:v,bubbleInput:x}=P(w,t),m=S(r,k),E=a.useRef(d);return a.useEffect(()=>{const o=e?.form;if(o){const n=()=>i(E.current);return o.addEventListener("reset",n),()=>o.removeEventListener("reset",n)}},[e,i]),u.jsx(I.button,{type:"button",role:"checkbox","aria-checked":b(d)?"mixed":d,"aria-required":C,"data-state":q(d),"data-disabled":h?"":void 0,disabled:h,value:f,...l,ref:m,onKeyDown:j(c,o=>{o.key==="Enter"&&o.preventDefault()}),onClick:j(s,o=>{i(n=>b(n)?!0:!n),x&&v&&(p.current=o.isPropagationStopped(),p.current||o.stopPropagation())})})});N.displayName=w;var X=a.forwardRef((t,c)=>{const{__scopeCheckbox:s,name:l,checked:r,defaultChecked:e,required:f,disabled:h,value:d,onCheckedChange:C,form:k,...i}=t;return u.jsx(U,{__scopeCheckbox:s,checked:r,defaultChecked:e,disabled:h,required:f,onCheckedChange:C,name:l,form:k,value:d,internal_do_not_use_render:({isFormControl:p})=>u.jsxs(u.Fragment,{children:[u.jsx(N,{...i,ref:c,__scopeCheckbox:s}),p&&u.jsx(T,{__scopeCheckbox:s})]})})});X.displayName=R;var B="CheckboxIndicator",J=a.forwardRef((t,c)=>{const{__scopeCheckbox:s,forceMount:l,...r}=t,e=P(B,s);return u.jsx(F,{present:l||b(e.checked)||e.checked===!0,children:u.jsx(I.span,{"data-state":q(e.checked),"data-disabled":e.disabled?"":void 0,...r,ref:c,style:{pointerEvents:"none",...t.style}})})});J.displayName=B;var M="CheckboxBubbleInput",T=a.forwardRef(({__scopeCheckbox:t,...c},s)=>{const{control:l,hasConsumerStoppedPropagationRef:r,checked:e,defaultChecked:f,required:h,disabled:d,name:C,value:k,form:i,bubbleInput:p,setBubbleInput:v}=P(M,t),x=S(s,v),m=O(e),E=z(l);a.useEffect(()=>{const n=p;if(!n)return;const _=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(_,"checked").set,A=!r.current;if(m!==e&&g){const D=new Event("click",{bubbles:A});n.indeterminate=b(e),g.call(n,b(e)?!1:e),n.dispatchEvent(D)}},[p,m,e,r]);const o=a.useRef(b(e)?!1:e);return u.jsx(I.input,{type:"checkbox","aria-hidden":!0,defaultChecked:f??o.current,required:h,disabled:d,name:C,value:k,form:i,...c,tabIndex:-1,ref:x,style:{...c.style,...E,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});T.displayName=M;function Q(t){return typeof t=="function"}function b(t){return t==="indeterminate"}function q(t){return b(t)?"indeterminate":t?"checked":"unchecked"}export{X as C,J as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{dw as Sr,dx as Dt}from"./index-
|
|
1
|
+
import{dw as Sr,dx as Dt}from"./index-CYyEyBYw.js";import{_ as wr}from"./typeof-QjJsDpFa.js";function Jt(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var pe={},he={exports:{}};const Zt={},Yt=Object.freeze(Object.defineProperty({__proto__:null,default:Zt},Symbol.toStringTag,{value:"Module"})),_r=Sr(Yt);var Tr;function Kt(){return Tr||(Tr=1,(function(e,r){var o=(function(){var i=function(L,h,m,S){for(m=m||{},S=L.length;S--;m[L[S]]=h);return m},p=[1,5],y=[1,7],v=[1,8],u=[1,6,10],l=[1,9],g=[1,6,8,10],A=[1,24],d=[1,25],w=[1,26],C=[1,27],M=[1,28],B=[1,29],I=[1,30],k=[1,17],q=[1,18],_=[1,19],N=[21,22,23,24,25,29,30],J=[1,6,8,10,18],Z=[1,47],G=[6,18],Y={trace:function(){},yy:{},symbols_:{error:2,expressions:3,expression:4,andCondition:5,OR:6,filterExpr:7,AND:8,LPAREN:9,RPAREN:10,propExpr:11,valueExpr:12,PROP:13,NOT:14,REGEXPOP:15,LBRACKET:16,inExpr:17,RBRACKET:18,OP:19,VALUE:20,NULL:21,TRUE:22,FALSE:23,NUMBER:24,NOW:25,DATEOP:26,AMOUNT:27,INTERVAL:28,LITERAL:29,STRING:30,ADD:31,SUB:32,CONTAINS:33,STARTSWITH:34,ENDSWITH:35,GT:36,LT:37,GTE:38,LTE:39,$accept:0,$end:1},terminals_:{2:"error",6:"OR",8:"AND",9:"LPAREN",10:"RPAREN",13:"PROP",14:"NOT",16:"LBRACKET",18:"RBRACKET",21:"NULL",22:"TRUE",23:"FALSE",24:"NUMBER",25:"NOW",27:"AMOUNT",28:"INTERVAL",29:"LITERAL",30:"STRING",31:"ADD",32:"SUB",33:"CONTAINS",34:"STARTSWITH",35:"ENDSWITH",36:"GT",37:"LT",38:"GTE",39:"LTE"},productions_:[0,[3,1],[4,1],[4,3],[5,1],[5,3],[7,3],[7,2],[11,1],[12,2],[12,1],[12,4],[12,3],[12,2],[12,1],[17,3],[17,1],[20,1],[20,1],[20,1],[20,1],[20,4],[20,1],[20,1],[26,1],[26,1],[15,2],[15,2],[15,2],[19,1],[19,1],[19,1],[19,1],[19,1]],performAction:function(h,m,S,P,E,f,Q,W){var c=f.length-1;switch(E){case 1:return P.debug("expression",f[c]),P.debug("opt",W),f[c]&&f[c].yg?f[c].yg:f[c];case 2:P.debug("andCondition",f[c]),this.$=f[c];break;case 3:P.debug("expression OR andCondition",f[c-2],f[c]),f[c-2]=f[c-2].$or?f[c-2]:{$or:[P.ungroup(f[c-2])]},f[c-2].$or.push(P.ungroup(f[c])),this.$=f[c-2];break;case 4:P.debug("filterExpr",f[c]),this.$=f[c];break;case 5:P.debug("andCondition AND filterExpr",f[c-2],f[c]),f[c-2]=f[c-2].$and?f[c-2]:{$and:[P.ungroup(f[c-2])]},f[c-2].$and.push(P.ungroup(f[c])),this.$=f[c-2];break;case 6:P.debug("LPAREN expression RPAREN",f[c-1]),this.$={yg:f[c-1]};break;case 7:this.$={[f[c-1]]:f[c]};break;case 8:f[c]=f[c].replace(/:$/,""),f[c]=W.aliases&&W.aliases[f[c]]?W.aliases[f[c]]:f[c],this.$=f[c];break;case 9:this.$={$not:f[c]};break;case 10:this.$={$regex:f[c]};break;case 11:this.$={$nin:f[c-1]};break;case 12:this.$={$in:f[c-1]};break;case 13:this.$={},this.$[f[c-1]]=f[c];break;case 14:this.$=f[c];break;case 15:this.$.push(f[c]);break;case 16:this.$=[f[c]];break;case 17:this.$=null;break;case 18:this.$=!0;break;case 19:this.$=!1;break;case 20:this.$=parseInt(h);break;case 21:this.$=P.relDateToAbsolute(f[c-2],f[c-1],f[c]);break;case 22:this.$=P.unescape(f[c]);break;case 23:f[c]=f[c].replace(/^'|'$/g,""),this.$=P.unescape(f[c]);break;case 24:this.$="add";break;case 25:this.$="sub";break;case 26:f[c]=f[c].replace(/^'|'$/g,""),f[c]=P.unescape(f[c]),this.$=P.stringToRegExp(f[c]);break;case 27:f[c]=f[c].replace(/^'|'$/g,""),f[c]=P.unescape(f[c]),this.$=P.stringToRegExp(f[c],"^");break;case 28:f[c]=f[c].replace(/^'|'$/g,""),f[c]=P.unescape(f[c]),this.$=P.stringToRegExp(f[c],"$");break;case 29:this.$="$ne";break;case 30:this.$="$gt";break;case 31:this.$="$lt";break;case 32:this.$="$gte";break;case 33:this.$="$lte";break}},table:[{3:1,4:2,5:3,7:4,9:p,11:6,13:y},{1:[3]},{1:[2,1],6:v},i(u,[2,2],{8:l}),i(g,[2,4]),{4:10,5:3,7:4,9:p,11:6,13:y},{12:11,14:[1,12],15:13,16:[1,14],19:15,20:16,21:A,22:d,23:w,24:C,25:M,29:B,30:I,33:k,34:q,35:_,36:[1,20],37:[1,21],38:[1,22],39:[1,23]},i([14,16,21,22,23,24,25,29,30,33,34,35,36,37,38,39],[2,8]),{5:31,7:4,9:p,11:6,13:y},{7:32,9:p,11:6,13:y},{6:v,10:[1,33]},i(g,[2,7]),i(N,[2,29],{15:34,16:[1,35],33:k,34:q,35:_}),i(g,[2,10]),{17:36,20:37,21:A,22:d,23:w,24:C,25:M,29:B,30:I},{20:38,21:A,22:d,23:w,24:C,25:M,29:B,30:I},i(g,[2,14]),{30:[1,39]},{30:[1,40]},{30:[1,41]},i(N,[2,30]),i(N,[2,31]),i(N,[2,32]),i(N,[2,33]),i(J,[2,17]),i(J,[2,18]),i(J,[2,19]),i(J,[2,20]),{26:42,31:[1,43],32:[1,44]},i(J,[2,22]),i(J,[2,23]),i(u,[2,3],{8:l}),i(g,[2,5]),i(g,[2,6]),i(g,[2,9]),{17:45,20:37,21:A,22:d,23:w,24:C,25:M,29:B,30:I},{6:Z,18:[1,46]},i(G,[2,16]),i(g,[2,13]),i(g,[2,26]),i(g,[2,27]),i(g,[2,28]),{27:[1,48]},{27:[2,24]},{27:[2,25]},{6:Z,18:[1,49]},i(g,[2,12]),{20:50,21:A,22:d,23:w,24:C,25:M,29:B,30:I},{28:[1,51]},i(g,[2,11]),i(G,[2,15]),i(J,[2,21])],defaultActions:{43:[2,24],44:[2,25]},parseError:function(h,m){if(m.recoverable)this.trace(h);else{var S=new Error(h);throw S.hash=m,S}},parse:function(h){var m=this,S=[0],P=[null],E=[],f=this.table,Q="",W=0,c=0,ie=2,$=1,t=E.slice.call(arguments,1),n=Object.create(this.lexer),s={yy:{}};for(var T in this.yy)Object.prototype.hasOwnProperty.call(this.yy,T)&&(s.yy[T]=this.yy[T]);n.setInput(h,s.yy),s.yy.lexer=n,s.yy.parser=this,typeof n.yylloc>"u"&&(n.yylloc={});var F=n.yylloc;E.push(F);var D=n.options&&n.options.ranges;typeof s.yy.parseError=="function"?this.parseError=s.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var R=function(){var X;return X=n.lex()||$,typeof X!="number"&&(X=m.symbols_[X]||X),X},b,O,j,x,V={},z,U,ne,re;;){if(O=S[S.length-1],this.defaultActions[O]?j=this.defaultActions[O]:((b===null||typeof b>"u")&&(b=R()),j=f[O]&&f[O][b]),typeof j>"u"||!j.length||!j[0]){var a="";re=[];for(z in f[O])this.terminals_[z]&&z>ie&&re.push("'"+this.terminals_[z]+"'");n.showPosition?a="Parse error on line "+(W+1)+`:
|
|
2
2
|
`+n.showPosition()+`
|
|
3
3
|
Expecting `+re.join(", ")+", got '"+(this.terminals_[b]||b)+"'":a="Parse error on line "+(W+1)+": Unexpected "+(b==$?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(a,{text:n.match,token:this.terminals_[b]||b,line:n.yylineno,loc:F,expected:re})}if(j[0]instanceof Array&&j.length>1)throw new Error("Parse Error: multiple actions possible at state: "+O+", token: "+b);switch(j[0]){case 1:S.push(b),P.push(n.yytext),E.push(n.yylloc),S.push(j[1]),b=null,c=n.yyleng,Q=n.yytext,W=n.yylineno,F=n.yylloc;break;case 2:if(U=this.productions_[j[1]][1],V.$=P[P.length-U],V._$={first_line:E[E.length-(U||1)].first_line,last_line:E[E.length-1].last_line,first_column:E[E.length-(U||1)].first_column,last_column:E[E.length-1].last_column},D&&(V._$.range=[E[E.length-(U||1)].range[0],E[E.length-1].range[1]]),x=this.performAction.apply(V,[Q,c,W,s.yy,j[1],P,E].concat(t)),typeof x<"u")return x;U&&(S=S.slice(0,-1*U*2),P=P.slice(0,-1*U),E=E.slice(0,-1*U)),S.push(this.productions_[j[1]][0]),P.push(V.$),E.push(V._$),ne=f[S[S.length-2]][S[S.length-1]],S.push(ne);break;case 3:return!0}}return!0}};Y.parseError=function(L,h){var m=L.split(`
|
|
4
4
|
`);throw m[0]="Query Error: unexpected character in filter at char "+(h.loc.first_column+1),new Error(m.join(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t,bD as F,t as u,b as g,bE as z,r as j,bz as E,bA as T,L as S,E as M,c as P,bF as U,S as w,A as $,B as L,br as B,m as C,h as v,d as W,n as _,bG as D,bH as H,e as O,P as q}from"./index-qHUvPjQB.js";import{A as G}from"./at-sign-z5gBMxDW.js";import{R as V,U as K}from"./user-round-check-Dp9a2x-e.js";import{R as Q}from"./reply-D7E-ZMd5.js";const I=({notificationType:a,size:l="lg",className:i})=>{let r,s="";const n="white",c=l==="sm"?13:20,o=l==="sm"?2:1.5;switch(a){case"follow":r=t.jsx(K,{className:`-mt-0.5 -mr-0.5 ${l==="sm"&&"size-[11px]"}`,color:n,size:c,strokeWidth:o}),s="bg-blue-600";break;case"like":r=t.jsx(F,{className:`${l==="sm"?"size-[11px]":"mt-px size-5"}`,color:n,strokeWidth:o}),s="bg-pink-600";break;case"reply":r=t.jsx(Q,{className:"mr-px mb-px",color:n,size:c,strokeWidth:o}),s="bg-purple-600";break;case"repost":r=t.jsx(V,{color:n,size:c,strokeWidth:o}),s="bg-green-500";break;case"mention":r=t.jsx(G,{className:`${l==="sm"?"size-[12px]":"size-5"}`,color:n,size:c,strokeWidth:o}),s="bg-orange-500";break}return t.jsx("div",{className:`flex ${l==="sm"?"size-5":"size-9"} items-center justify-center rounded-full ${s} ${i&&i}`,children:r})},Z=u.createContext(void 0),h=({isGrouped:a,centerAlign:l,children:i,onClick:r,url:s,className:n})=>t.jsx(Z.Provider,{value:{onClick:r,url:s},children:t.jsx("div",{className:`group relative -mx-4 -my-px ${a?"grid":"flex"} ${l?"items-center":"items-start"} break-anywhere cursor-pointer grid-cols-[auto_1fr] gap-x-4 gap-y-2.5 rounded-lg px-4 py-5 text-left hover:bg-gray-75 ${n}`,role:"button",onClick:r,children:i})}),J=({size:a="lg",type:l})=>t.jsx("div",{className:"col-start-1 row-start-1",children:t.jsx(I,{notificationType:l,size:a})}),X=({children:a})=>t.jsx("div",{className:"col-start-2 row-start-1 flex gap-2",children:a}),Y=({children:a})=>t.jsx("div",{className:"col-start-2 row-start-2 -mt-0.5 grow overflow-hidden",children:a});h.Icon=J;h.Avatars=X;h.Content=Y;const ee=()=>t.jsx("div",{className:"h-px w-full bg-gray-150 dark:bg-gray-950"});function te(a){const r=new Date(a).getTime();return(Math.floor(r/864e5)*864e5).toString()}function se(a){const l={};let i=null,r=0;return a.forEach(s=>{s.type!==i&&(r+=1,i=s.type);let n="";const c=`_${te(s.createdAt)}`,o=`_seq${r}`;switch(s.type){case"like":s.post?.id&&(n=`like_${s.post.id}${c}${o}`);break;case"reply":n=`reply_${s.id}`;break;case"repost":s.post?.id&&(n=`repost_${s.post.id}${c}${o}`);break;case"follow":n=`follow_${c}${o}`;break;case"mention":n=`mention_${s.id}`;break}l[n]||(l[n]={id:s.id,type:s.type,actors:[],post:s.post,inReplyTo:s.inReplyTo,createdAt:s.createdAt}),l[n].actors.find(f=>f.id===s.actor.id)||l[n].actors.push(s.actor)}),Object.values(l)}const ae=({group:a})=>{const[l,...i]=a.actors,r=i.length>0,s="cursor-pointer font-semibold hover:underline text-black dark:text-white",n=g(),c=t.jsxs(t.Fragment,{children:[t.jsx(q,{actor:l,align:"center",isCurrentUser:!1,children:t.jsx("span",{className:s,onClick:o=>{o?.stopPropagation(),v(l.handle,n)},children:l.name})}),r&&` and ${i.length} ${i.length>1?"others":"other"}`]});switch(a.type){case"follow":return t.jsxs(t.Fragment,{children:[c," followed you"]});case"like":return t.jsxs(t.Fragment,{children:[c," liked your ",a.post?.type==="article"?"post":"note"]});case"repost":return t.jsxs(t.Fragment,{children:[c," reposted your ",a.post?.type==="article"?"post":"note"]});case"reply":if(a.inReplyTo&&typeof a.inReplyTo!="string")return c;break;case"mention":return c}return t.jsx(t.Fragment,{})},ne=({content:a,className:l,stripTags:i=[]})=>{const r=j.useRef(null),s=g();return j.useEffect(()=>{const n=r.current;if(!n)return;const c=o=>{const y=o.target.closest("a[data-profile]");if(y){const x=y.getAttribute("data-profile")?.trim();/^@([\w.-]+)@([\w-]+\.[\w.-]+[a-zA-Z])$/.test(x||"")&&x&&(o.preventDefault(),o.stopPropagation(),v(x,s))}};return n.addEventListener("click",c),()=>{n.removeEventListener("click",c)}},[s,a]),t.jsx("div",{dangerouslySetInnerHTML:{__html:_(a||"",i)},ref:r,className:l})},ce=()=>{const[a,l]=u.useState({}),i=g(),r=e=>{l(d=>({...d,[e]:!d[e]}))},s=()=>{},n=5,{data:c,error:o,fetchNextPage:f,hasNextPage:y,isFetchingNextPage:x,isLoading:b}=z("index"),k=c?.pages.flatMap(e=>se(e.notifications))??Array(10).fill({actors:[{}]}),p=j.useRef(null),N=j.useRef(null);j.useEffect(()=>(p.current&&p.current.disconnect(),p.current=new IntersectionObserver(e=>{e[0].isIntersecting&&y&&!x&&f()}),N.current&&p.current.observe(N.current),()=>{p.current&&p.current.disconnect()}),[y,x,f]);const R=(e,d)=>{switch(e.type){case"like":e.post&&i(`/${e.post.type==="article"?"reader":"notes"}/${encodeURIComponent(e.post.id)}`);break;case"reply":e.post&&e.inReplyTo&&i(`/notes/${encodeURIComponent(e.post.id)}`);break;case"repost":e.post&&i(`/${e.post.type==="article"?"reader":"notes"}/${encodeURIComponent(e.post.id)}`);break;case"follow":e.actors.length>1?r(e.id||`${e.type}_${d}`):v(e.actors[0].handle,i);break;case"mention":e.post&&i(`/notes/${encodeURIComponent(e.post.id)}`);break}};return o&&E(o)?t.jsx(T,{errorCode:o.code,statusCode:o.statusCode}):t.jsx(S,{children:t.jsxs("div",{className:"z-0 flex w-full flex-col items-center",children:[b===!1&&k.length===0&&t.jsxs(M,{children:[t.jsx(P,{children:t.jsx(U,{})}),"Quiet for now, but not for long! When someone likes, boosts, or replies to you, you'll find it here."]}),k.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"my-8 flex w-full max-w-[620px] flex-col max-md:mt-5",children:k.map((e,d)=>t.jsxs(u.Fragment,{children:[t.jsxs(h,{centerAlign:e.actors.length<2&&e.type==="follow",className:"hover:bg-gray-75 dark:hover:bg-gray-950",isGrouped:e.actors.length>1,onClick:()=>R(e,d),children:[b?t.jsx(w,{className:"rounded-full",containerClassName:"flex h-10 w-10"}):e.actors.length>1?t.jsx(h.Icon,{type:e.type}):t.jsxs("div",{className:"relative",children:[t.jsx($,{author:{icon:{url:e.actors[0].avatarUrl||""},name:e.actors[0].name,handle:e.actors[0].handle},size:"notification"},e.actors[0].id),t.jsx(I,{className:"absolute -right-1 -bottom-1 z-10 border-2 border-white dark:border-black",notificationType:e.type,size:"sm"})]}),e.actors.length>1&&t.jsx(h.Avatars,{children:t.jsxs("div",{className:"flex w-full flex-col",children:[t.jsxs("div",{className:"relative flex items-center pl-2",children:[!a[e.id||`${e.type}_${d}`]&&e.actors.slice(0,n).map(m=>t.jsx($,{author:{icon:{url:m.avatarUrl||""},name:m.name,handle:m.handle},className:"-ml-2 bg-[#F3F3F3]! outline outline-2 outline-white group-hover:bg-[#EDEEF0]! group-hover:outline-gray-75 dark:outline-black group-hover:dark:outline-gray-950",size:"notification"},m.id)),e.actors.length>n&&!a[e.id||`${e.type}_${d}`]&&t.jsx("div",{className:"absolute right-[28px] z-10 flex size-9 items-center justify-center rounded-full bg-black/50 text-base font-semibold tracking-tightest text-white",children:`+${e.actors.length-n}`}),e.actors.length>1&&t.jsxs(L,{className:`group flex items-center gap-0.5 text-gray-700 hover:bg-transparent hover:text-black dark:text-gray-600 dark:hover:text-white ${a[e.id||`${e.type}_${d}`]?"ml-[-20px]":"ml-0 w-[28px]"}`,variant:"ghost",onClick:m=>{m?.stopPropagation(),r(e.id||`${e.type}_${d}`)},children:[t.jsx(B,{className:`${a[e.id||`${e.type}_${d}`]?"rotate-180":""}`,size:20,strokeWidth:1.5}),a[e.id||`${e.type}_${d}`]?"Hide":t.jsx("span",{className:"sr-only",children:"Show all"})]})]}),t.jsx("div",{className:`overflow-hidden transition-all duration-300 ease-in-out ${a[e.id||`${e.type}_${d}`]?"mb-2 max-h-[1384px] opacity-100":"max-h-0 opacity-0"}`,children:a[e.id||`${e.type}_${d}`]&&e.actors.length>1&&t.jsx("div",{className:"flex flex-col gap-2 pt-2",children:e.actors.map(m=>t.jsxs("div",{className:"group/item break-anywhere flex items-center justify-between gap-4",onClick:A=>{A?.stopPropagation(),v(m.handle,i)},children:[t.jsxs("div",{className:"flex min-w-0 items-center",children:[t.jsx($,{author:{icon:{url:m.avatarUrl||""},name:m.name,handle:m.handle},size:"xs"}),t.jsx("span",{className:"ml-2 line-clamp-1 text-base font-semibold group-hover/item:underline dark:text-white",children:m.name}),t.jsx("span",{className:"ml-1 line-clamp-1 text-base text-gray-700 dark:text-gray-600",children:m.handle})]}),e.type==="follow"&&!m.followedByMe&&t.jsx(C,{following:!1,handle:m.handle,variant:"link"})]},m.id))})})]})}),t.jsxs(h.Content,{children:[t.jsx("div",{children:b?t.jsxs(t.Fragment,{children:[t.jsx(w,{}),t.jsx(w,{className:"w-full max-w-60"})]}):t.jsxs("div",{className:"flex justify-between",children:[t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"truncate",children:t.jsx(ae,{group:e})}),e.actors.length<2&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"mt-px text-[8px] text-gray-700 dark:text-gray-600",children:"•"}),t.jsx("span",{className:"mt-0.5 text-sm text-gray-700 dark:text-gray-600",children:W(e,!1)})]})]}),e.actors.length===1&&(e.type==="follow"||e.type==="reply"||e.type==="mention")&&!e.actors[0].followedByMe&&t.jsx(C,{following:!1,handle:e.actors[0].handle,variant:"link"})]})}),(e.type==="reply"&&e.inReplyTo||e.type==="mention"||e.type==="like"&&!e.post?.name&&e.post?.content||e.type==="repost"&&!e.post?.name&&e.post?.content)&&(e.type!=="reply"&&e.type!=="mention"?t.jsxs("div",{className:"ap-note-content mt-0.5 line-clamp-1 text-sm text-pretty text-gray-700 dark:text-gray-600",children:[e.post?.type==="article"&&e.post?.title&&t.jsxs(t.Fragment,{children:[e.post.title," — "]}),t.jsx("span",{dangerouslySetInnerHTML:{__html:_(e.post?.content||"")}})]}):t.jsx(t.Fragment,{children:t.jsxs("div",{className:"mt-2.5 rounded-md bg-gray-100 px-5 py-[14px] group-hover:bg-gray-200 dark:bg-gray-925/30 group-hover:dark:bg-black/40",children:[t.jsx(ne,{className:"ap-note-content text-pretty",content:e.post?.content||"",stripTags:["a"]}),e.post&&e.post.attachments&&e.post.attachments.length>0&&t.jsx("div",{className:"notification-attachments mb-1 [&_.attachment-gallery]:flex [&_.attachment-gallery]:flex-wrap [&_img]:aspect-square [&_img]:max-w-[calc(20%-6.4px)]",children:D({...e.post,type:"Note",attachment:e.post.attachments})})]})})),(e.type==="reply"&&e.post||e.type==="mention")&&t.jsx("div",{className:"mt-1.5",children:t.jsx(H,{actor:{...e.actors[0],icon:{url:e.actors[0].avatarUrl||""},id:e.actors[0].url,preferredUsername:e.actors[0].handle?.replace(/^@([^@]+)@.*$/,"$1")||"unknown"},buttonClassName:"hover:bg-gray-200",commentCount:e.post.replyCount||0,layout:"notification",likeCount:e.post.likeCount||0,object:{...e.post,liked:e.post.likedByMe,reposted:e.post.repostedByMe},repostCount:e.post.repostCount||0,onLikeClick:s})})]})]}),d<k.length-1&&t.jsx("div",{className:"pl-[52px]",children:t.jsx(ee,{})})]},e.id||`${e.type}_${d}`))}),t.jsx("div",{ref:N,className:"h-1"}),x&&t.jsx("div",{className:"-mt-4 mb-8 flex flex-col items-center justify-center gap-4 text-center",children:t.jsx(O,{size:"md"})})]})]})})};export{ce as default};
|
|
1
|
+
import{j as t,bD as F,t as u,b as g,bE as z,r as j,bz as E,bA as T,L as S,E as M,c as P,bF as U,S as w,A as $,B as L,br as B,m as C,h as v,d as W,n as _,bG as D,bH as H,e as O,P as q}from"./index-CYyEyBYw.js";import{A as G}from"./at-sign-CtAw8_lw.js";import{R as V,U as K}from"./user-round-check-CzQQeFd8.js";import{R as Q}from"./reply-DOKdAsL_.js";const I=({notificationType:a,size:l="lg",className:i})=>{let r,s="";const n="white",c=l==="sm"?13:20,o=l==="sm"?2:1.5;switch(a){case"follow":r=t.jsx(K,{className:`-mt-0.5 -mr-0.5 ${l==="sm"&&"size-[11px]"}`,color:n,size:c,strokeWidth:o}),s="bg-blue-600";break;case"like":r=t.jsx(F,{className:`${l==="sm"?"size-[11px]":"mt-px size-5"}`,color:n,strokeWidth:o}),s="bg-pink-600";break;case"reply":r=t.jsx(Q,{className:"mr-px mb-px",color:n,size:c,strokeWidth:o}),s="bg-purple-600";break;case"repost":r=t.jsx(V,{color:n,size:c,strokeWidth:o}),s="bg-green-500";break;case"mention":r=t.jsx(G,{className:`${l==="sm"?"size-[12px]":"size-5"}`,color:n,size:c,strokeWidth:o}),s="bg-orange-500";break}return t.jsx("div",{className:`flex ${l==="sm"?"size-5":"size-9"} items-center justify-center rounded-full ${s} ${i&&i}`,children:r})},Z=u.createContext(void 0),h=({isGrouped:a,centerAlign:l,children:i,onClick:r,url:s,className:n})=>t.jsx(Z.Provider,{value:{onClick:r,url:s},children:t.jsx("div",{className:`group relative -mx-4 -my-px ${a?"grid":"flex"} ${l?"items-center":"items-start"} break-anywhere cursor-pointer grid-cols-[auto_1fr] gap-x-4 gap-y-2.5 rounded-lg px-4 py-5 text-left hover:bg-gray-75 ${n}`,role:"button",onClick:r,children:i})}),J=({size:a="lg",type:l})=>t.jsx("div",{className:"col-start-1 row-start-1",children:t.jsx(I,{notificationType:l,size:a})}),X=({children:a})=>t.jsx("div",{className:"col-start-2 row-start-1 flex gap-2",children:a}),Y=({children:a})=>t.jsx("div",{className:"col-start-2 row-start-2 -mt-0.5 grow overflow-hidden",children:a});h.Icon=J;h.Avatars=X;h.Content=Y;const ee=()=>t.jsx("div",{className:"h-px w-full bg-gray-150 dark:bg-gray-950"});function te(a){const r=new Date(a).getTime();return(Math.floor(r/864e5)*864e5).toString()}function se(a){const l={};let i=null,r=0;return a.forEach(s=>{s.type!==i&&(r+=1,i=s.type);let n="";const c=`_${te(s.createdAt)}`,o=`_seq${r}`;switch(s.type){case"like":s.post?.id&&(n=`like_${s.post.id}${c}${o}`);break;case"reply":n=`reply_${s.id}`;break;case"repost":s.post?.id&&(n=`repost_${s.post.id}${c}${o}`);break;case"follow":n=`follow_${c}${o}`;break;case"mention":n=`mention_${s.id}`;break}l[n]||(l[n]={id:s.id,type:s.type,actors:[],post:s.post,inReplyTo:s.inReplyTo,createdAt:s.createdAt}),l[n].actors.find(f=>f.id===s.actor.id)||l[n].actors.push(s.actor)}),Object.values(l)}const ae=({group:a})=>{const[l,...i]=a.actors,r=i.length>0,s="cursor-pointer font-semibold hover:underline text-black dark:text-white",n=g(),c=t.jsxs(t.Fragment,{children:[t.jsx(q,{actor:l,align:"center",isCurrentUser:!1,children:t.jsx("span",{className:s,onClick:o=>{o?.stopPropagation(),v(l.handle,n)},children:l.name})}),r&&` and ${i.length} ${i.length>1?"others":"other"}`]});switch(a.type){case"follow":return t.jsxs(t.Fragment,{children:[c," followed you"]});case"like":return t.jsxs(t.Fragment,{children:[c," liked your ",a.post?.type==="article"?"post":"note"]});case"repost":return t.jsxs(t.Fragment,{children:[c," reposted your ",a.post?.type==="article"?"post":"note"]});case"reply":if(a.inReplyTo&&typeof a.inReplyTo!="string")return c;break;case"mention":return c}return t.jsx(t.Fragment,{})},ne=({content:a,className:l,stripTags:i=[]})=>{const r=j.useRef(null),s=g();return j.useEffect(()=>{const n=r.current;if(!n)return;const c=o=>{const y=o.target.closest("a[data-profile]");if(y){const x=y.getAttribute("data-profile")?.trim();/^@([\w.-]+)@([\w-]+\.[\w.-]+[a-zA-Z])$/.test(x||"")&&x&&(o.preventDefault(),o.stopPropagation(),v(x,s))}};return n.addEventListener("click",c),()=>{n.removeEventListener("click",c)}},[s,a]),t.jsx("div",{dangerouslySetInnerHTML:{__html:_(a||"",i)},ref:r,className:l})},ce=()=>{const[a,l]=u.useState({}),i=g(),r=e=>{l(d=>({...d,[e]:!d[e]}))},s=()=>{},n=5,{data:c,error:o,fetchNextPage:f,hasNextPage:y,isFetchingNextPage:x,isLoading:b}=z("index"),k=c?.pages.flatMap(e=>se(e.notifications))??Array(10).fill({actors:[{}]}),p=j.useRef(null),N=j.useRef(null);j.useEffect(()=>(p.current&&p.current.disconnect(),p.current=new IntersectionObserver(e=>{e[0].isIntersecting&&y&&!x&&f()}),N.current&&p.current.observe(N.current),()=>{p.current&&p.current.disconnect()}),[y,x,f]);const R=(e,d)=>{switch(e.type){case"like":e.post&&i(`/${e.post.type==="article"?"reader":"notes"}/${encodeURIComponent(e.post.id)}`);break;case"reply":e.post&&e.inReplyTo&&i(`/notes/${encodeURIComponent(e.post.id)}`);break;case"repost":e.post&&i(`/${e.post.type==="article"?"reader":"notes"}/${encodeURIComponent(e.post.id)}`);break;case"follow":e.actors.length>1?r(e.id||`${e.type}_${d}`):v(e.actors[0].handle,i);break;case"mention":e.post&&i(`/notes/${encodeURIComponent(e.post.id)}`);break}};return o&&E(o)?t.jsx(T,{errorCode:o.code,statusCode:o.statusCode}):t.jsx(S,{children:t.jsxs("div",{className:"z-0 flex w-full flex-col items-center",children:[b===!1&&k.length===0&&t.jsxs(M,{children:[t.jsx(P,{children:t.jsx(U,{})}),"Quiet for now, but not for long! When someone likes, boosts, or replies to you, you'll find it here."]}),k.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"my-8 flex w-full max-w-[620px] flex-col max-md:mt-5",children:k.map((e,d)=>t.jsxs(u.Fragment,{children:[t.jsxs(h,{centerAlign:e.actors.length<2&&e.type==="follow",className:"hover:bg-gray-75 dark:hover:bg-gray-950",isGrouped:e.actors.length>1,onClick:()=>R(e,d),children:[b?t.jsx(w,{className:"rounded-full",containerClassName:"flex h-10 w-10"}):e.actors.length>1?t.jsx(h.Icon,{type:e.type}):t.jsxs("div",{className:"relative",children:[t.jsx($,{author:{icon:{url:e.actors[0].avatarUrl||""},name:e.actors[0].name,handle:e.actors[0].handle},size:"notification"},e.actors[0].id),t.jsx(I,{className:"absolute -right-1 -bottom-1 z-10 border-2 border-white dark:border-black",notificationType:e.type,size:"sm"})]}),e.actors.length>1&&t.jsx(h.Avatars,{children:t.jsxs("div",{className:"flex w-full flex-col",children:[t.jsxs("div",{className:"relative flex items-center pl-2",children:[!a[e.id||`${e.type}_${d}`]&&e.actors.slice(0,n).map(m=>t.jsx($,{author:{icon:{url:m.avatarUrl||""},name:m.name,handle:m.handle},className:"-ml-2 bg-[#F3F3F3]! outline outline-2 outline-white group-hover:bg-[#EDEEF0]! group-hover:outline-gray-75 dark:outline-black group-hover:dark:outline-gray-950",size:"notification"},m.id)),e.actors.length>n&&!a[e.id||`${e.type}_${d}`]&&t.jsx("div",{className:"absolute right-[28px] z-10 flex size-9 items-center justify-center rounded-full bg-black/50 text-base font-semibold tracking-tightest text-white",children:`+${e.actors.length-n}`}),e.actors.length>1&&t.jsxs(L,{className:`group flex items-center gap-0.5 text-gray-700 hover:bg-transparent hover:text-black dark:text-gray-600 dark:hover:text-white ${a[e.id||`${e.type}_${d}`]?"ml-[-20px]":"ml-0 w-[28px]"}`,variant:"ghost",onClick:m=>{m?.stopPropagation(),r(e.id||`${e.type}_${d}`)},children:[t.jsx(B,{className:`${a[e.id||`${e.type}_${d}`]?"rotate-180":""}`,size:20,strokeWidth:1.5}),a[e.id||`${e.type}_${d}`]?"Hide":t.jsx("span",{className:"sr-only",children:"Show all"})]})]}),t.jsx("div",{className:`overflow-hidden transition-all duration-300 ease-in-out ${a[e.id||`${e.type}_${d}`]?"mb-2 max-h-[1384px] opacity-100":"max-h-0 opacity-0"}`,children:a[e.id||`${e.type}_${d}`]&&e.actors.length>1&&t.jsx("div",{className:"flex flex-col gap-2 pt-2",children:e.actors.map(m=>t.jsxs("div",{className:"group/item break-anywhere flex items-center justify-between gap-4",onClick:A=>{A?.stopPropagation(),v(m.handle,i)},children:[t.jsxs("div",{className:"flex min-w-0 items-center",children:[t.jsx($,{author:{icon:{url:m.avatarUrl||""},name:m.name,handle:m.handle},size:"xs"}),t.jsx("span",{className:"ml-2 line-clamp-1 text-base font-semibold group-hover/item:underline dark:text-white",children:m.name}),t.jsx("span",{className:"ml-1 line-clamp-1 text-base text-gray-700 dark:text-gray-600",children:m.handle})]}),e.type==="follow"&&!m.followedByMe&&t.jsx(C,{following:!1,handle:m.handle,variant:"link"})]},m.id))})})]})}),t.jsxs(h.Content,{children:[t.jsx("div",{children:b?t.jsxs(t.Fragment,{children:[t.jsx(w,{}),t.jsx(w,{className:"w-full max-w-60"})]}):t.jsxs("div",{className:"flex justify-between",children:[t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"truncate",children:t.jsx(ae,{group:e})}),e.actors.length<2&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"mt-px text-[8px] text-gray-700 dark:text-gray-600",children:"•"}),t.jsx("span",{className:"mt-0.5 text-sm text-gray-700 dark:text-gray-600",children:W(e,!1)})]})]}),e.actors.length===1&&(e.type==="follow"||e.type==="reply"||e.type==="mention")&&!e.actors[0].followedByMe&&t.jsx(C,{following:!1,handle:e.actors[0].handle,variant:"link"})]})}),(e.type==="reply"&&e.inReplyTo||e.type==="mention"||e.type==="like"&&!e.post?.name&&e.post?.content||e.type==="repost"&&!e.post?.name&&e.post?.content)&&(e.type!=="reply"&&e.type!=="mention"?t.jsxs("div",{className:"ap-note-content mt-0.5 line-clamp-1 text-sm text-pretty text-gray-700 dark:text-gray-600",children:[e.post?.type==="article"&&e.post?.title&&t.jsxs(t.Fragment,{children:[e.post.title," — "]}),t.jsx("span",{dangerouslySetInnerHTML:{__html:_(e.post?.content||"")}})]}):t.jsx(t.Fragment,{children:t.jsxs("div",{className:"mt-2.5 rounded-md bg-gray-100 px-5 py-[14px] group-hover:bg-gray-200 dark:bg-gray-925/30 group-hover:dark:bg-black/40",children:[t.jsx(ne,{className:"ap-note-content text-pretty",content:e.post?.content||"",stripTags:["a"]}),e.post&&e.post.attachments&&e.post.attachments.length>0&&t.jsx("div",{className:"notification-attachments mb-1 [&_.attachment-gallery]:flex [&_.attachment-gallery]:flex-wrap [&_img]:aspect-square [&_img]:max-w-[calc(20%-6.4px)]",children:D({...e.post,type:"Note",attachment:e.post.attachments})})]})})),(e.type==="reply"&&e.post||e.type==="mention")&&t.jsx("div",{className:"mt-1.5",children:t.jsx(H,{actor:{...e.actors[0],icon:{url:e.actors[0].avatarUrl||""},id:e.actors[0].url,preferredUsername:e.actors[0].handle?.replace(/^@([^@]+)@.*$/,"$1")||"unknown"},buttonClassName:"hover:bg-gray-200",commentCount:e.post.replyCount||0,layout:"notification",likeCount:e.post.likeCount||0,object:{...e.post,liked:e.post.likedByMe,reposted:e.post.repostedByMe},repostCount:e.post.repostCount||0,onLikeClick:s})})]})]}),d<k.length-1&&t.jsx("div",{className:"pl-[52px]",children:t.jsx(ee,{})})]},e.id||`${e.type}_${d}`))}),t.jsx("div",{ref:N,className:"h-1"}),x&&t.jsx("div",{className:"-mt-4 mb-8 flex flex-col items-center justify-center gap-4 text-center",children:t.jsx(O,{size:"md"})})]})]})})};export{ce as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ch as f}from"./index-
|
|
1
|
+
import{ch as f}from"./index-CYyEyBYw.js";var p={exports:{}},n,u;function m(){if(u)return n;u=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return n=t,n}var a,y;function P(){if(y)return a;y=1;var t=m();function i(){}function s(){}return s.resetWarningCache=i,a=function(){function e(v,S,g,_,d,T){if(T!==t){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}e.isRequired=e;function r(){return e}var o={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:r,element:e,elementType:e,instanceOf:r,node:e,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:s,resetWarningCache:i};return o.PropTypes=o,o},a}var h;function l(){return h||(h=1,p.exports=P()()),p.exports}var R=l();const b=f(R);export{b as P};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as c,j as f,z as m}from"./index-
|
|
1
|
+
import{t as c,j as f,z as m}from"./index-CYyEyBYw.js";const p={none:"gap-0",xs:"gap-1",sm:"gap-2",md:"gap-3",lg:"gap-4",xl:"gap-6","2xl":"gap-8"},d={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch",baseline:"items-baseline"},u={start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},x=c.forwardRef(function({as:e="div",className:t,gap:s="md",align:n="center",justify:a="start",wrap:r=!1,...i},o){const l=e;return f.jsx(l,{ref:o,className:m("flex flex-row",r?"flex-wrap":"flex-nowrap",p[s],d[n],u[a],t),...i})});x.displayName="Inline";export{d as A,p as G,x as I,u as J};
|