ghost 6.68.0 → 6.69.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/ghost-storage-base-3.0.1.tgz +0 -0
- package/components/tryghost-adapter-base-cache-0.2.1.tgz +0 -0
- package/components/tryghost-adapter-base-scheduling-0.2.5.tgz +0 -0
- package/components/tryghost-adapter-base-sso-0.1.4.tgz +0 -0
- package/components/tryghost-app-contracts-0.0.0.tgz +0 -0
- package/components/tryghost-checkout-0.0.0.tgz +0 -0
- package/components/tryghost-i18n-0.0.0.tgz +0 -0
- package/components/tryghost-kg-card-factory-5.2.6.tgz +0 -0
- package/components/tryghost-kg-clean-basic-html-4.3.6.tgz +0 -0
- package/components/tryghost-kg-converters-1.2.6.tgz +0 -0
- package/components/tryghost-kg-default-cards-10.3.7.tgz +0 -0
- package/components/tryghost-kg-default-nodes-2.2.3.tgz +0 -0
- package/components/tryghost-kg-default-transforms-1.3.6.tgz +0 -0
- package/components/tryghost-kg-html-to-lexical-1.4.1.tgz +0 -0
- package/components/tryghost-kg-lexical-html-renderer-1.5.1.tgz +0 -0
- package/components/tryghost-kg-markdown-html-renderer-7.2.7.tgz +0 -0
- package/components/tryghost-kg-utils-1.1.6.tgz +0 -0
- package/components/tryghost-metafield-csv-0.0.0.tgz +0 -0
- package/components/tryghost-metafield-types-0.1.1.tgz +0 -0
- package/core/boot.js +6 -0
- package/core/built/admin/assets/{about-D_nwtf7X.js → about-Dxp30cNg.js} +1 -1
- package/core/built/admin/assets/{account-migration-BaecWw1T.js → account-migration-D05akW4q.js} +1 -1
- package/core/built/admin/assets/activitypub/{account-migration-4saTEZ6p.js → account-migration-BmiwuzXI.js} +6 -6
- package/core/built/admin/assets/activitypub/activitypub.js +2 -2
- package/core/built/admin/assets/activitypub/{bluesky-sharing-BHBNuZQH.js → bluesky-sharing-B1fzMdFb.js} +6 -6
- package/core/built/admin/assets/activitypub/{content-formatters-DVx9YktY.js → content-formatters-G0qBT5QE.js} +3 -3
- package/core/built/admin/assets/activitypub/{domain-rAmlMXBC.js → domain-B3UtdA1m.js} +7 -7
- package/core/built/admin/assets/activitypub/{edit-profile-CXYL4ZrS.js → edit-profile-9EodzviR.js} +4 -4
- package/core/built/admin/assets/activitypub/{explore-dqpEx3GA.js → explore-DmwPdxHI.js} +8 -8
- package/core/built/admin/assets/activitypub/{feed-Cb-wYNw9.js → feed-yauqnu7A.js} +5 -5
- package/core/built/admin/assets/activitypub/{field-JxegcPt6.js → field-CsrMjbg2.js} +2 -2
- package/core/built/admin/assets/activitypub/{inbox-2hXDJBn5.js → inbox-DV3RrpFH.js} +7 -7
- package/core/built/admin/assets/activitypub/{label-DRQzZ7lb.js → label-DPs40NLn.js} +2 -2
- package/core/built/admin/assets/activitypub/layout-CvOhndCA.js +1 -0
- package/core/built/admin/assets/activitypub/{moderation-BnYKcTXY.js → moderation-DGa6hVNH.js} +7 -7
- package/core/built/admin/assets/activitypub/{note-C6ucS3Wu.js → note-BVL6LVHF.js} +5 -5
- package/core/built/admin/assets/activitypub/{notifications-DgBW9wEC.js → notifications-CRUu_uMC.js} +5 -5
- package/core/built/admin/assets/activitypub/{onboarding-DGu6yG4L.js → onboarding-Dpm-nLkQ.js} +2 -2
- package/core/built/admin/assets/activitypub/{onboarding-Bq3fNf_a.js → onboarding-KtpJA-xb.js} +2 -2
- package/core/built/admin/assets/activitypub/{preferences-C3jI1eVN.js → preferences-CdFuVqIt.js} +7 -7
- package/core/built/admin/assets/activitypub/{profile-Cn3vRb5Z.js → profile-KnNAoHYu.js} +8 -8
- package/core/built/admin/assets/activitypub/{routes-DbrwlS9h.js → routes-BRndai50.js} +26 -26
- package/core/built/admin/assets/activitypub/{settings-D0BALDQu.js → settings-DU7ftJ8w.js} +4 -4
- package/core/built/admin/assets/activitypub/{site-BFGj8HuQ.js → site-D1ZYV3AT.js} +2 -2
- package/core/built/admin/assets/activitypub/{step-1-CaoPg0a5.js → step-1-9IHheE78.js} +4 -4
- package/core/built/admin/assets/activitypub/{step-3-5k0TkyC9.js → step-3-DBERnfa-.js} +3 -3
- package/core/built/admin/assets/activitypub/{tabs-BV4JU7Vg.js → tabs-CvkwStij.js} +4 -4
- package/core/built/admin/assets/activitypub/{topic-filter-71sX5nfN.js → topic-filter-CS0Jsf_4.js} +2 -2
- package/core/built/admin/assets/activitypub/{use-activity-pub-queries-B3srUuKt.js → use-activity-pub-queries-CGgtQrxL.js} +2 -2
- package/core/built/admin/assets/activitypub/{use-reply-chain-data-Cl6bGNy7.js → use-reply-chain-data-CLdUpx1t.js} +4 -4
- package/core/built/admin/assets/activitypub/{users-EcSPpds5.js → users-CyoMXlwX.js} +11 -3
- package/core/built/admin/assets/{add-integration-modal-DBFzeAUT.js → add-integration-modal-BVg-ec8i.js} +1 -1
- package/core/built/admin/assets/{add-newsletter-modal-CYJe-dTC.js → add-newsletter-modal-Du6th521.js} +1 -1
- package/core/built/admin/assets/{add-recommendation-modal-CgwGKH-_.js → add-recommendation-modal-BiCJ0-q5.js} +1 -1
- package/core/built/admin/assets/{analytics-CcXT_WqF.js → analytics-CQJzDDdJ.js} +1 -1
- package/core/built/admin/assets/{announcement-bar-modal-Ldcg-PB-.js → announcement-bar-modal-CskyZLzT.js} +1 -1
- package/core/built/admin/assets/{api-BLteQZ7W.js → api-BFocMbDg.js} +2 -2
- package/core/built/admin/assets/{api-keys-CoeerpwI.js → api-keys-CqKJHuAV.js} +1 -1
- package/core/built/admin/assets/{audience-Deg9lzfk.js → audience-Dn7LuH-r.js} +1 -1
- package/core/built/admin/assets/{auth-layout-CRaMX7g6.js → auth-layout-VLhXgXn5.js} +1 -1
- package/core/built/admin/assets/{automated-emails-WcjjRkRV.js → automated-emails-D5cFl1wr.js} +1 -1
- package/core/built/admin/assets/{automations-CbIdX0rd.js → automations-BpweKEcq.js} +1 -1
- package/core/built/admin/assets/automations-DBTYwNTJ.js +1 -0
- package/core/built/admin/assets/{bluesky-sharing-BJMNRwnU.js → bluesky-sharing-CrfpFHQ9.js} +1 -1
- package/core/built/admin/assets/{chart-helpers-D-3N170i.js → chart-helpers-BSuFLd6-.js} +1 -1
- package/core/built/admin/assets/{chunk.524.94ab17e1199b4c3f4615.js → chunk.524.e24d68bc6253b274b726.js} +4 -4
- package/core/built/admin/assets/{chunk.582.6f09b19a007e2805824e.js → chunk.582.47834285406dfa1abb29.js} +6 -6
- package/core/built/admin/assets/{chunk.476.53b5794a67d68111e0bf.js → chunk.837.e1454abc054e1fba1fe5.js} +5 -5
- package/core/built/admin/assets/{code-editor-view-DhTwpxxv.js → code-editor-view-BrGe3eS4.js} +1 -1
- package/core/built/admin/assets/{code-editor-view-C7wXGiuv.js → code-editor-view-CY6JCXNv.js} +1 -1
- package/core/built/admin/assets/{color-picker-field-Cjz2zY11.js → color-picker-field-DGe9HH6W.js} +1 -1
- package/core/built/admin/assets/{comments-DY-VLVxh.js → comments-iRbF6XiJ.js} +1 -1
- package/core/built/admin/assets/{config-B3HuCo0y.js → config-CRAZ4Civ.js} +1 -1
- package/core/built/admin/assets/{content-api-modal-2jt-jWiM.js → content-api-modal-B-XRbzeW.js} +1 -1
- package/core/built/admin/assets/{content-formatters-VqvNA7Pv.js → content-formatters-C08JJbUJ.js} +2 -2
- package/core/built/admin/assets/{context-menu-BWbk9nd5.js → context-menu-BxGXsgQO.js} +1 -1
- package/core/built/admin/assets/{custom-field-type-option-CIatEwIN.js → custom-field-type-option-C8Nt4X6x.js} +1 -1
- package/core/built/admin/assets/{custom-integration-modal-Cw0w2Tb3.js → custom-integration-modal-DzI16qjN.js} +1 -1
- package/core/built/admin/assets/{date-range-select-O-uA-BRV.js → date-range-select-BZqsYsGx.js} +1 -1
- package/core/built/admin/assets/{design-and-theme-modal-BLjNHRYN.js → design-and-theme-modal-1ty_KEkM.js} +2 -2
- package/core/built/admin/assets/{dist-DJhCsld6.js → dist-B4jqKAG5.js} +1 -1
- package/core/built/admin/assets/{dist-5Ol0DC_t.js → dist-Bmo2j_KH.js} +1 -1
- package/core/built/admin/assets/{dist-p52UDdoR.js → dist-C-_aTlvJ.js} +1 -1
- package/core/built/admin/assets/{dist-CcN1a5SB.js → dist-CWHIoxYn.js} +1 -1
- package/core/built/admin/assets/{dist-BcfsaiCV.js → dist-Cp2M5TzT.js} +1 -1
- package/core/built/admin/assets/{dist-kjTYGivb.js → dist-DQAAPbtg.js} +1 -1
- package/core/built/admin/assets/{dist-IMek6Acg.js → dist-DyO279y5.js} +1 -1
- package/core/built/admin/assets/{domain-DaPAeOFF.js → domain-DiFl_Z1A.js} +1 -1
- package/core/built/admin/assets/{edit-profile-BKO5qonH.js → edit-profile-PrLbJV3P.js} +1 -1
- package/core/built/admin/assets/editor-BBJDJL8U.js +8 -0
- package/core/built/admin/assets/{editor-screen-l4BUPE2o.js → editor-screen-nblrp808.js} +3 -3
- package/core/built/admin/assets/{email-previews-B1Ska3CF.js → email-previews-BKJxrW29.js} +1 -1
- package/core/built/admin/assets/{email-sending-status-provider-Bjn5KTy2.js → email-sending-status-provider-DB9ylBWk.js} +1 -1
- package/core/built/admin/assets/{emails-qxNbhO6X.js → emails-8YiSmC2X.js} +1 -1
- package/core/built/admin/assets/{embed-signup-form-modal-DSgds6Js.js → embed-signup-form-modal-CZmbYKfd.js} +1 -1
- package/core/built/admin/assets/{error-boundary-CJODV8Rg.js → error-boundary-DrxPFFO-.js} +1 -1
- package/core/built/admin/assets/{esm-CNLDtBMc.js → esm-_iCUCvbN.js} +1 -1
- package/core/built/admin/assets/{explore-C6V_JpUZ.js → explore-C69LSRVg.js} +1 -1
- package/core/built/admin/assets/{feed-B_TyFn9E.js → feed-B_0m7WhZ.js} +1 -1
- package/core/built/admin/assets/{feedback-gKOzmiGt.js → feedback-DW1DXdzT.js} +1 -1
- package/core/built/admin/assets/{filters-Bf6E1qAP.js → filters-Dr3vMnjZ.js} +1 -1
- package/core/built/admin/assets/{filters-DhsiEotO.js → filters-M2sRWPoF.js} +1 -1
- package/core/built/admin/assets/{first-promoter-modal-LmTXHr-z.js → first-promoter-modal-D43R2zhI.js} +1 -1
- package/core/built/admin/assets/{focus-koenig-editor-on-bottom-click-BAcLNJti.js → focus-koenig-editor-on-bottom-click-BzS8jiJf.js} +1 -1
- package/core/built/admin/assets/fullscreen-close-button-CWSp-MsK.js +1 -0
- package/core/built/admin/assets/{ghost-63bc7da4336844000c523a5a0819531e.js → ghost-ffde29676517b768b1aef5ec8d492418.js} +93 -96
- package/core/built/admin/assets/{gift-link-modal-uZtwRHzl.js → gift-link-modal-CNE7dfPD.js} +1 -1
- package/core/built/admin/assets/{gift-links-HVqaXear.js → gift-links-lQ7H_D8Z.js} +1 -1
- package/core/built/admin/assets/global-search-modal-DzRM3aON.js +1 -0
- package/core/built/admin/assets/{growth-BlPW4DHj.js → growth-CAi_5HIf.js} +1 -1
- package/core/built/admin/assets/{growth-CflU3vR0.js → growth-CMHbTWKE.js} +1 -1
- package/core/built/admin/assets/history-modal-BIz13vhr.js +1 -0
- package/core/built/admin/assets/{hooks-C-BDQ6Hs.js → hooks-0r7qxGEo.js} +2 -2
- package/core/built/admin/assets/{html-field-D6G0G1d_.js → html-field-vTe2q1be.js} +1 -1
- package/core/built/admin/assets/{iframe-buffering-DW-Axhvc.js → iframe-buffering-cu-yK7NA.js} +1 -1
- package/core/built/admin/assets/{images-BSUWxquu.js → images-DTZtaIAr.js} +1 -1
- package/core/built/admin/assets/{inbox-BkU3sg13.js → inbox-BHfpmmzn.js} +1 -1
- package/core/built/admin/assets/{index-z8-nEVdb.css → index-B02LJqc8.css} +1 -1
- package/core/built/admin/assets/{index-CuDhPtkB.js → index-RuRs_qGS.js} +3 -3
- package/core/built/admin/assets/{index.es-H6HOI4DG.js → index.es-rdb1skp_.js} +1 -1
- package/core/built/admin/assets/{integrations-BRo5DwA5.js → integrations-Deg9-u8X.js} +1 -1
- package/core/built/admin/assets/{invite-user-modal-CydBOG99.js → invite-user-modal-C4DeNcoO.js} +1 -1
- package/core/built/admin/assets/koenig-lexical/koenig-lexical.js +10483 -10455
- package/core/built/admin/assets/koenig-lexical/koenig-lexical.umd.js +131 -131
- package/core/built/admin/assets/{koenig-lexical-CG_eb4dw.js → koenig-lexical-BhXu1__-.js} +96 -96
- package/core/built/admin/assets/{kpi-helpers-CyRx_yD6.js → kpi-helpers-H-Hl6h7h.js} +1 -1
- package/core/built/admin/assets/{kpi-tabs-V1_Nu9sh.js → kpi-tabs-k4A9-imn.js} +1 -1
- package/core/built/admin/assets/{label-picker-GTIIlBQ6.js → label-picker-DaivLdMw.js} +1 -1
- package/core/built/admin/assets/{labels-BVGLgdAj.js → labels-BCj6D_nl.js} +1 -1
- package/core/built/admin/assets/{layout-CG58T6P7.js → layout-_g2xhB0L.js} +1 -1
- package/core/built/admin/assets/{lib-Dkic19kH.js → lib-Bre6UXdJ.js} +2 -2
- package/core/built/admin/assets/{links-jD8AkkIu.js → links-C8RnEJVJ.js} +1 -1
- package/core/built/admin/assets/{member-activity-JggQ0VNQ.js → member-activity-DNJPUW5X.js} +1 -1
- package/core/built/admin/assets/{member-activity-feed-BBeCZmLM.js → member-activity-feed-CvKEetHS.js} +1 -1
- package/core/built/admin/assets/{member-custom-fields-DPsyP1Hq.js → member-custom-fields-CBdiwPD9.js} +1 -1
- package/core/built/admin/assets/{member-detail-D7qugPN7.js → member-detail-BIoyIIsl.js} +1 -1
- package/core/built/admin/assets/{members-Cj_BUZUL.js → members-CH6KeXQc.js} +1 -1
- package/core/built/admin/assets/{members-alDWPKDd.js → members-Dd9RczFK.js} +1 -1
- package/core/built/admin/assets/{migrate-2uKKakld.js → migrate-CVQIWsXO.js} +1 -1
- package/core/built/admin/assets/{moderation-pCUKsxbF.js → moderation-OtjZoNOc.js} +1 -1
- package/core/built/admin/assets/{navigation-modal-D0FBI5-m.js → navigation-modal-Bl02NjtO.js} +1 -1
- package/core/built/admin/assets/{newsletter-4urgCSR_.js → newsletter-BXyT7o69.js} +1 -1
- package/core/built/admin/assets/{newsletter-detail-modal-Chh1jvjH.js → newsletter-detail-modal-DxuKNu_1.js} +1 -1
- package/core/built/admin/assets/{newsletter-emails-CzVCiC2K.js → newsletter-emails-DicgmnMU.js} +1 -1
- package/core/built/admin/assets/{newsletters-eRQTtOBH.js → newsletters-By25FmUs.js} +1 -1
- package/core/built/admin/assets/{newsletters-BMEgeL2l.js → newsletters-CACa0VCx.js} +1 -1
- package/core/built/admin/assets/{note-dqog4Bua.js → note-CF4LrSmR.js} +1 -1
- package/core/built/admin/assets/{notifications-rcEVv-gx.js → notifications-BmHJmqIJ.js} +1 -1
- package/core/built/admin/assets/{offers-hV7zBtsI.js → offers-Df9Jzay5.js} +1 -1
- package/core/built/admin/assets/{offers-container-modal-DgZgkMsA.js → offers-container-modal-R0HRwugm.js} +1 -1
- package/core/built/admin/assets/{onboarding-4TxbZb90.js → onboarding-Bpo1yTzA.js} +1 -1
- package/core/built/admin/assets/{onboarding-SGscZLIc.js → onboarding-bMq3R8jB.js} +1 -1
- package/core/built/admin/assets/{onboarding-route-B3mN9l7E.js → onboarding-route-flf5YWti.js} +1 -1
- package/core/built/admin/assets/{overview-D4EanvDG.js → overview-C9WvmmOC.js} +1 -1
- package/core/built/admin/assets/{overview-CCwbHet8.js → overview-CDkHdIJM.js} +1 -1
- package/core/built/admin/assets/{page-header-Baymg6VR.js → page-header-CxTb0je5.js} +1 -1
- package/core/built/admin/assets/{pagemenu--UL0gW1x.js → pagemenu-DXr_U43J.js} +1 -1
- package/core/built/admin/assets/{pages-Cbq1M2kG.js → pages-Bm-zFXyP.js} +1 -1
- package/core/built/admin/assets/pages-route-LCw94aIO.js +1 -0
- package/core/built/admin/assets/{pintura-modal-D6HGlnJa.js → pintura-modal-B5sIPWcj.js} +1 -1
- package/core/built/admin/assets/{portal-modal-Bhqsevn_.js → portal-modal-DjOO3Unv.js} +1 -1
- package/core/built/admin/assets/{post-analytics-header-DX9fETdi.js → post-analytics-header-D2anehCj.js} +1 -1
- package/core/built/admin/assets/{post-analytics-provider-U7RtOle1.js → post-analytics-provider-BLQvV5C0.js} +1 -1
- package/core/built/admin/assets/{post-analytics-BJWDtC3a.js → post-analytics-wdu9gq8u.js} +1 -1
- package/core/built/admin/assets/{post-debug-D1b8Amju.js → post-debug-BnABXMfD.js} +1 -1
- package/core/built/admin/assets/{posts-Lg-p_ZHg.js → posts-CftunZgV.js} +1 -1
- package/core/built/admin/assets/{posts-list-screen-CmsW18e_.js → posts-list-screen-CwXmvY68.js} +2 -2
- package/core/built/admin/assets/posts-route-J74fMhCe.js +1 -0
- package/core/built/admin/assets/{preferences-CMlDfHfa.js → preferences-DFhf_pJF.js} +1 -1
- package/core/built/admin/assets/{preview-modal-D8om_cQv.js → preview-modal-BrZza3R_.js} +1 -1
- package/core/built/admin/assets/{profile-yFsIoZom.js → profile-CS4fP60N.js} +1 -1
- package/core/built/admin/assets/{radio-group-DwgLjwWB.js → radio-group-Xfp-frJz.js} +1 -1
- package/core/built/admin/assets/{referrers-DzP5QoXL.js → referrers-C8LJlrBm.js} +1 -1
- package/core/built/admin/assets/{reload-CZ-KP3IQ.js → reload-D0fnKoCm.js} +1 -1
- package/core/built/admin/assets/{reset-CCAa8v35.js → reset-CB-ATcLE.js} +1 -1
- package/core/built/admin/assets/{restore-screen-Ba0i2Y1K.js → restore-screen-EaZf4V8j.js} +1 -1
- package/core/built/admin/assets/{routes-DrnhmKTT.js → routes-DKfpFMfF.js} +2 -2
- package/core/built/admin/assets/search-index-sM3OjEUl.js +1 -0
- package/core/built/admin/assets/settings-BWzod-5X.js +4 -0
- package/core/built/admin/assets/{settings-lqWkfSmT.js → settings-DvgngbFt.js} +1 -1
- package/core/built/admin/assets/{setup-BopRPuaM.js → setup-CdHAchG5.js} +1 -1
- package/core/built/admin/assets/{signin-e8NgsU9M.js → signin-CUEEme88.js} +1 -1
- package/core/built/admin/assets/{signin-verify-CHkFJevb.js → signin-verify-CYRphSrj.js} +1 -1
- package/core/built/admin/assets/{signout-DRvQZuWa.js → signout-kLCJau9G.js} +1 -1
- package/core/built/admin/assets/{signup-DQHi7jZz.js → signup-J2Vjq7Gt.js} +1 -1
- package/core/built/admin/assets/{slack-modal-BuGESzgn.js → slack-modal-DKamr_94.js} +1 -1
- package/core/built/admin/assets/source-icon-DqBCPDIK.js +1 -0
- package/core/built/admin/assets/{stats-CHOikfoP.js → stats-BL_FJ7Ns.js} +1 -1
- package/core/built/admin/assets/{stats-view-DQZzKeEz.js → stats-view-BwbdkdOQ.js} +1 -1
- package/core/built/admin/assets/{step-1-C8XwHcKt.js → step-1-CLYhNmG9.js} +1 -1
- package/core/built/admin/assets/{step-2-BXaXAdwY.js → step-2-B2ujMlpa.js} +1 -1
- package/core/built/admin/assets/{step-3-DytbqpJi.js → step-3-DoaTWqqj.js} +1 -1
- package/core/built/admin/assets/{stripe-connect-modal-BhudjSeO.js → stripe-connect-modal-DytxH9DJ.js} +1 -1
- package/core/built/admin/assets/{tabs-CDb_TceL.js → tabs-fHs3A8WC.js} +1 -1
- package/core/built/admin/assets/{tag-detail-V72Zlro8.js → tag-detail-BcO46Ids.js} +2 -2
- package/core/built/admin/assets/{tag-picker-M3fC-yOF.js → tag-picker-Ct6NeqWK.js} +1 -1
- package/core/built/admin/assets/{tags-CXqE2A2T.js → tags-C1h3wCpW.js} +1 -1
- package/core/built/admin/assets/{tags-ZhqbPPc6.js → tags-OlmRJ6Ps.js} +1 -1
- package/core/built/admin/assets/{testimonials-modal-Cn8gvIFA.js → testimonials-modal-DMsQzSCB.js} +1 -1
- package/core/built/admin/assets/{themes-pOHHvnkt.js → themes-CPJSMo_W.js} +1 -1
- package/core/built/admin/assets/{tier-detail-modal-CeDla1OO.js → tier-detail-modal-DssSmhkF.js} +1 -1
- package/core/built/admin/assets/{tiers-D7aGzwZ-.js → tiers-DlvS8D6_.js} +1 -1
- package/core/built/admin/assets/{toggle-group-D7ly9OGa.js → toggle-group-BFWCtH3p.js} +1 -1
- package/core/built/admin/assets/{topic-filter-DQ3pr6AB.js → topic-filter-DAJ-DFPb.js} +1 -1
- package/core/built/admin/assets/{transistor-modal-4_Yx2vRo.js → transistor-modal-CtyFRsD0.js} +1 -1
- package/core/built/admin/assets/{unsplash-modal-Dm7R4k4k.js → unsplash-modal-DHnnTPmZ.js} +1 -1
- package/core/built/admin/assets/{use-activity-pub-queries-Gy9_locM.js → use-activity-pub-queries-BgR1USeY.js} +1 -1
- package/core/built/admin/assets/{use-analytics-data-oJ2o0pSS.js → use-analytics-data-Byf83QE-.js} +1 -1
- package/core/built/admin/assets/{use-availability-BqL7Dvn_.js → use-availability-CgZC6L_V.js} +1 -1
- package/core/built/admin/assets/{use-check-theme-limit-error-CxC9uKJz.js → use-check-theme-limit-error-DjprzKAN.js} +1 -1
- package/core/built/admin/assets/use-definitions-CJuXLSob.js +1 -0
- package/core/built/admin/assets/{use-email-sending-status-BFAg5TIb.js → use-email-sending-status-7kopNcza.js} +1 -1
- package/core/built/admin/assets/{use-filter-params-BOo9yZ5j.js → use-filter-params-DQ7uX-Zp.js} +1 -1
- package/core/built/admin/assets/{use-filterable-api-BnNLaS_r.js → use-filterable-api-CDrrxoGD.js} +1 -1
- package/core/built/admin/assets/{use-growth-stats-BS62uyyn.js → use-growth-stats-CCpnBgqS.js} +1 -1
- package/core/built/admin/assets/{use-host-limits-CNh4AAEs.js → use-host-limits-BZx7rzRI.js} +1 -1
- package/core/built/admin/assets/{use-limiter-DPKxoO1_.js → use-limiter-gF219BEg.js} +1 -1
- package/core/built/admin/assets/{use-pintura-config-CyVO62ZV.js → use-pintura-config-D-pmGkn2.js} +1 -1
- package/core/built/admin/assets/{use-pintura-editor-B5VBPbiO.js → use-pintura-editor-D_4zhlGE.js} +1 -1
- package/core/built/admin/assets/{use-post-referrers-nUPolSk7.js → use-post-referrers-Bc8eq4uy.js} +1 -1
- package/core/built/admin/assets/{use-post-top-links-DCH4eO11.js → use-post-top-links-DjltnQuI.js} +1 -1
- package/core/built/admin/assets/{use-reply-chain-data-UMzFbDvh.js → use-reply-chain-data-BiV3Cl0B.js} +1 -1
- package/core/built/admin/assets/use-sending-eta-gE-2B0Zw.js +1 -0
- package/core/built/admin/assets/{use-setting-group-Bf3vY8br.js → use-setting-group-YP84CqrJ.js} +1 -1
- package/core/built/admin/assets/{use-staff-users-CcQzTHqH.js → use-staff-users-CnwfdSx1.js} +1 -1
- package/core/built/admin/assets/{use-tinybird-query-CPy5ipAP.js → use-tinybird-query-BYbl5gKY.js} +1 -1
- package/core/built/admin/assets/{use-tinybird-token-DVNHuhu_.js → use-tinybird-token-Dz37zvb7.js} +1 -1
- package/core/built/admin/assets/{use-unsaved-changes-guard-Bvcp_Rny.js → use-unsaved-changes-guard-BkCuSlvU.js} +1 -1
- package/core/built/admin/assets/{use-upgrade-route-Bsxw9ZLN.js → use-upgrade-route-C-V-Xfak.js} +1 -1
- package/core/built/admin/assets/{use-url-input-DPJ592FB.js → use-url-input-BeYKYMGh.js} +1 -1
- package/core/built/admin/assets/{user-detail-modal-6UY6GdNy.js → user-detail-modal-CSoj7vOC.js} +1 -1
- package/core/built/admin/assets/{users-CzgQKbfO.js → users-CKJaAxEJ.js} +1 -1
- package/core/built/admin/assets/{view-site-DA_-zfGq.js → view-site-SpMx4P7G.js} +1 -1
- package/core/built/admin/assets/{web-Cq5YiD2r.js → web-CZf-k4F0.js} +1 -1
- package/core/built/admin/assets/{web-DqFIrOxt.js → web-uAqgYPK9.js} +1 -1
- package/core/built/admin/assets/{zapier-modal-DgqU-OBB.js → zapier-modal-DENbgTyE.js} +1 -1
- package/core/built/admin/index.html +24 -24
- package/core/frontend/helpers/color_to_rgba.js +15 -13
- package/core/frontend/helpers/facebook_url.js +27 -15
- package/core/frontend/services/assets-minification/card-assets.js +1 -1
- package/core/frontend/services/helpers/register-ghost-helpers.js +2 -2
- package/core/server/api/endpoints/app-installations.js +36 -0
- package/core/server/api/endpoints/automations.js +1 -1
- package/core/server/api/endpoints/index.js +4 -0
- package/core/server/data/exporter/table-lists.js +2 -0
- package/core/server/data/migrations/versions/6.69/2026-10-07-06-20-43-add-app-installation-permissions.js +40 -0
- package/core/server/data/schema/fixtures/fixtures.json +21 -0
- package/core/server/data/schema/in-development.js +1 -1
- package/core/server/data/schema/schema.js +53 -0
- package/core/server/lib/after-commit.js +20 -0
- package/core/server/models/action.js +6 -0
- package/core/server/services/app-installations/actions.js +44 -0
- package/core/server/services/app-installations/codec.js +20 -0
- package/core/server/services/app-installations/index.js +42 -0
- package/core/server/services/app-installations/schema.js +52 -0
- package/core/server/services/app-installations/service.js +160 -0
- package/core/server/services/automations/README.md +3 -3
- package/core/server/services/automations/automations-api.js +1 -1
- package/core/server/services/comments/comments-service-emails.js +8 -6
- package/core/server/services/email-service/README.md +16 -0
- package/core/server/services/email-service/email-service-wrapper.js +1 -0
- package/core/server/services/email-service/email-service.js +94 -53
- package/core/server/services/email-service/sending-status-serializers.js +4 -1
- package/core/server/services/email-service/sending-status-service.js +13 -0
- package/core/server/services/email-service/sending-status.js +12 -1
- package/core/server/services/members/members-api/repositories/member-repository.js +5 -23
- package/core/server/services/posts/post-email-handler.js +61 -28
- package/core/server/services/posts/posts-service.js +27 -2
- package/core/server/services/service-inventory.yaml +93 -7
- package/core/server/services/stats/stats-service.js +1 -5
- package/core/server/services/tinybird-sync/index.js +0 -3
- package/core/server/services/tinybird-sync/tinybird-sync-service.js +2 -6
- package/core/server/web/api/endpoints/admin/routes.js +25 -12
- package/core/shared/labs.js +4 -6
- package/package.json +11 -10
- package/pnpm-lock.yaml +112 -100
- package/pnpm-workspace.yaml +14 -12
- package/components/ghost-storage-base-3.0.0.tgz +0 -0
- package/components/tryghost-adapter-base-cache-0.2.0.tgz +0 -0
- package/components/tryghost-checkout-0.0.1.tgz +0 -0
- package/components/tryghost-kg-card-factory-5.2.4.tgz +0 -0
- package/components/tryghost-kg-clean-basic-html-4.3.4.tgz +0 -0
- package/components/tryghost-kg-converters-1.2.5.tgz +0 -0
- package/components/tryghost-kg-default-transforms-1.3.4.tgz +0 -0
- package/components/tryghost-kg-html-to-lexical-1.4.0.tgz +0 -0
- package/components/tryghost-kg-markdown-html-renderer-7.2.6.tgz +0 -0
- package/components/tryghost-kg-utils-1.1.4.tgz +0 -0
- package/components/tryghost-metafield-csv-0.0.1.tgz +0 -0
- package/core/built/admin/assets/activitypub/layout-QTbY0t8e.js +0 -1
- package/core/built/admin/assets/automations-DVToctfJ.js +0 -1
- package/core/built/admin/assets/editor-CMXR0YvR.js +0 -8
- package/core/built/admin/assets/fullscreen-close-button-DXssPeDB.js +0 -1
- package/core/built/admin/assets/global-search-modal-C8LVJmiz.js +0 -1
- package/core/built/admin/assets/history-modal-parBtjpz.js +0 -1
- package/core/built/admin/assets/pages-route-CDk3V9rq.js +0 -1
- package/core/built/admin/assets/posts-route-CexHhklY.js +0 -1
- package/core/built/admin/assets/settings-xqakrAWa.js +0 -4
- package/core/built/admin/assets/source-icon-BjVangBd.js +0 -1
- package/core/built/admin/assets/use-definitions-DMVU3mTG.js +0 -1
- package/core/built/admin/assets/use-sending-eta-BsnKdQhv.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./dist-CmLdHFZT.js","./react-C9lG_SsT.js","./inbox-
|
|
2
|
-
(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`c33a7091-2c94-45e7-aad5-d337a831776e`,e._sentryDebugIdIdentifier=`sentry-dbid-c33a7091-2c94-45e7-aad5-d337a831776e`)}catch{}})();import{i as e,s as t,t as n}from"./react-C9lG_SsT.js";import{o as r}from"./hooks-C-BDQ6Hs.js";import{t as i}from"./jsx-runtime-Bm2_KH-0.js";import{n as a}from"./dist-pogVoW2G.js";import{t as o}from"./preload-helper-Ba4JejZL.js";import{f as s,g as c,i as l,n as u,s as d,u as f}from"./chunk-OB3PAWPO-D3muQBsq.js";import{a as p,i as m,o as h,r as g,s as _,t as v}from"./router-provider-Cf-bcYZr.js";import{A as y,F as b,H as x,L as S,O as C,Z as w,j as T,w as E,y as D}from"./shade-provider-DvrXKKQZ.js";import{t as O}from"./stack-C3OmgpUv.js";import{t as k}from"./text-BnCSdzao.js";import{i as A,r as j,t as M}from"./heading-Ch2Mb19A.js";import{t as N}from"./lazy-component-DNJLzmpQ.js";import{$ as ee,Bt as te,C as ne,D as re,Dr as P,Fr as F,Ft as ie,Mn as I,Nn as ae,Pn as oe,Q as se,Rt as ce,Sr as L,Tr as le,Un as ue,a as de,d as fe,fn as pe,gn as me,ir as he,kn as R,lt as ge,m as z,nn as B,nt as _e,p as ve,pn as ye,pt as be,rr as V,t as H,tt as xe,u as Se,vn as U}from"./button-CTHYSI-d.js";import{a as Ce,c as we,i as Te,l as Ee,n as De,o as Oe,r as ke,s as Ae,t as je}from"./alert-dialog-CAPLqwVs.js";import{n as Me,r as Ne,t as Pe}from"./avatar-YbECDnBI.js";import{t as Fe}from"./badge-DuMiqyUH.js";import{a as Ie,c as Le,i as Re,n as ze,o as Be,r as Ve,s as He,t as Ue}from"./dialog-BO1lcy8A.js";import{a as We,i as Ge,r as Ke,t as qe}from"./popover-r_3DwMi9.js";import{t as Je}from"./dist-sRp1p0JK.js";import{n as Ye,r as Xe,t as Ze}from"./hover-card-Bt4FXKiL.js";import{t as Qe}from"./input-BHb2A_DU.js";import{t as W}from"./skeleton-C1s6yr9e.js";import{n as $e}from"./loading-indicator-DaRyGrxv.js";import{n as et,t as tt}from"./no-value-label-CKNmidLC.js";import{n as nt,t as G}from"./use-navigate-with-base-path-pweMCFf6.js";import{i as rt,l as K,o as it,s as at,u as q}from"./content-formatters-VqvNA7Pv.js";import{A as ot,C as st,D as ct,F as lt,M as ut,N as dt,P as ft,R as pt,S as mt,U as ht,a as gt,f as _t,j as vt,p as yt,t as bt,x as xt,y as St,z as Ct}from"./use-activity-pub-queries-Gy9_locM.js";import{n as wt,t as Tt}from"./onboarding-SGscZLIc.js";import"./onboarding-4TxbZb90.js";import{n as Et}from"./index.module-CnPepLB9.js";var J=t(n(),1),Y=i(),Dt=(0,J.lazy)(()=>o(()=>import(`./dist-CmLdHFZT.js`),__vite__mapDeps([0,1]),import.meta.url)),Ot=e=>(0,Y.jsx)(J.Suspense,{fallback:(0,Y.jsx)(`div`,{}),children:(0,Y.jsx)(Dt,{...e})}),kt=[],At=(0,J.createContext)(void 0),jt=({children:e})=>{let t=f(),[n,r]=(0,J.useState)(()=>{let e=localStorage.getItem(`featureFlags`);return e?JSON.parse(e):Mt()});(0,J.useEffect)(()=>{let e=Nt(t.search);Object.keys(e).length>0&&r(t=>{let n={...t,...e};return localStorage.setItem(`featureFlags`,JSON.stringify(n)),n})},[t.search]);let i={isEnabled:e=>n[e]??!1,flags:n,allFlags:kt};return(0,Y.jsx)(At.Provider,{value:i,children:e})},Mt=()=>kt.reduce((e,t)=>({...e,[t]:!1}),{}),Nt=e=>{let t=new URLSearchParams(e),n={};return kt.forEach(e=>{let r=t.get(e);r===`ON`?n[e]=!0:r===`OFF`&&(n[e]=!1)}),n},Pt=()=>{let e=(0,J.useContext)(At);if(e===void 0)throw Error(`useFeatureFlags must be used within a FeatureFlagsProvider`);return e},Ft=({className:e,onClick:t})=>{let n=G(),{previousPath:r}=_();return(0,Y.jsx)(H,{className:S(`size-8 rounded-full bg-white/85 px-2 backdrop-blur-md focus-visible:ring-0 dark:bg-transparent dark:text-white [&_svg]:size-6`,e),variant:`ghost`,onClick:()=>{if(t){t();return}n(r?-1:`/`)},children:(0,Y.jsx)(F,{size:20,strokeWidth:1.25})})},It=()=>{let e=d(xr,f().pathname);if(!e)return null;let t=e.map(e=>e.route).filter(e=>e.pageTitle);return t[t.length-1]||e[e.length-1].route};function Lt(){let e=s(),t=e.findIndex(e=>e.handle===`activitypub-basepath`);if(t===-1)return``;let n=e[t+1];if(!n)return``;let r=e[t].pathname,i=n.pathname,a=i.startsWith(r)?i.slice(r.length):i;return a=a.replace(/^\//,``),a.split(`/`)[0]}var Rt=({title:e,backIcon:t})=>t?(0,Y.jsx)(Ft,{className:`-ml-2`}):(0,Y.jsx)(M,{className:`!text-[1.5rem] font-semibold tracking-normal`,children:e}),zt=({onToggleMobileSidebar:e})=>(0,Y.jsx)(H,{className:`px:0 mr-[-9px] w-[34px] rounded-full bg-white/85 backdrop-blur-md lg:hidden dark:bg-black/85 dark:text-white`,variant:`ghost`,onClick:e,children:(0,Y.jsx)(te,{className:`size-5!`})}),Bt=({onToggleMobileSidebar:e,showBorder:t=!0})=>{let{canGoBack:n}=_(),r=Lt(),i=h(),a=It(),o=!1;r===`profile`&&(o=!0),r===`notes`&&n&&(o=!0);let s=n&&i||a?.showBackButton===!0;return(0,Y.jsx)(Y.Fragment,{children:o?(0,Y.jsxs)(`div`,{className:`sticky top-5 left-0 z-50 max-lg:flex max-lg:justify-between max-lg:pr-[15.5px] max-md:top-4 ${r===`profile`?`block h-0 max-lg:items-start`:`inline-block max-lg:items-center`}`,children:[(0,Y.jsx)(`div`,{children:s&&(0,Y.jsx)(Ft,{className:`ml-6 max-md:ml-[10px]`})}),!s&&(0,Y.jsx)(zt,{onToggleMobileSidebar:e})]}):(0,Y.jsx)(`div`,{className:`sticky top-0 z-50 bg-white/85 backdrop-blur-md dark:bg-background`,"data-network-header":`header`,children:(0,Y.jsxs)(`div`,{className:`relative flex h-[72px] items-center justify-between gap-5 px-[min(4vw,24px)] max-md:h-[68px] ${t?`before:absolute before:inset-x-[min(4vw,24px)] before:bottom-0 before:block before:border-b before:border-gray-200 before:content-[""] dark:before:border-gray-950`:``}`,children:[(0,Y.jsx)(Rt,{backIcon:s,title:a?.pageTitle||``}),(0,Y.jsx)(zt,{onToggleMobileSidebar:e})]})})})},[Vt,Ht]=C(`Form`),Ut=`Form`,[Wt,Gt]=Vt(Ut),[Kt,qt]=Vt(Ut),Jt=J.forwardRef((e,t)=>{let{__scopeForm:n,onClearServerErrors:r=()=>{},...i}=e,a=y(t,J.useRef(null)),[o,s]=J.useState({}),c=J.useCallback(e=>o[e],[o]),l=J.useCallback((e,t)=>s(n=>({...n,[e]:{...n[e]??{},...t}})),[]),u=J.useCallback(e=>{s(t=>({...t,[e]:void 0})),_(t=>({...t,[e]:{}}))},[]),[d,f]=J.useState({}),p=J.useCallback(e=>d[e]??[],[d]),m=J.useCallback((e,t)=>{f(n=>({...n,[e]:[...n[e]??[],t]}))},[]),h=J.useCallback((e,t)=>{f(n=>({...n,[e]:(n[e]??[]).filter(e=>e.id!==t)}))},[]),[g,_]=J.useState({}),v=J.useCallback(e=>g[e]??{},[g]),b=J.useCallback((e,t)=>{_(n=>({...n,[e]:{...n[e]??{},...t}}))},[]),[x,S]=J.useState({});return(0,Y.jsx)(Wt,{scope:n,getFieldValidity:c,onFieldValidityChange:l,getFieldCustomMatcherEntries:p,onFieldCustomMatcherEntryAdd:m,onFieldCustomMatcherEntryRemove:h,getFieldCustomErrors:v,onFieldCustomErrorsChange:b,onFieldValiditionClear:u,children:(0,Y.jsx)(Kt,{scope:n,onFieldMessageIdAdd:J.useCallback((e,t)=>{S(n=>{let r=new Set(n[e]).add(t);return{...n,[e]:r}})},[]),onFieldMessageIdRemove:J.useCallback((e,t)=>{S(n=>{let r=new Set(n[e]);return r.delete(t),{...n,[e]:r}})},[]),getFieldDescription:J.useCallback(e=>Array.from(x[e]??[]).join(` `)||void 0,[x]),children:(0,Y.jsx)(E.form,{...i,ref:a,onInvalid:T(e.onInvalid,e=>{let t=yn(e.currentTarget);t===e.target&&t.focus(),e.preventDefault()}),onSubmit:T(e.onSubmit,r,{checkForDefaultPrevented:!1}),onReset:T(e.onReset,r)})})})});Jt.displayName=Ut;var Yt=`FormField`,[Xt,Zt]=Vt(Yt),Qt=J.forwardRef((e,t)=>{let{__scopeForm:n,name:r,serverInvalid:i=!1,...a}=e,o=Gt(Yt,n).getFieldValidity(r);return(0,Y.jsx)(Xt,{scope:n,id:D(),name:r,serverInvalid:i,children:(0,Y.jsx)(E.div,{"data-valid":wn(o,i),"data-invalid":Tn(o,i),...a,ref:t})})});Qt.displayName=Yt;var $t=`FormLabel`,en=J.forwardRef((e,t)=>{let{__scopeForm:n,...r}=e,i=Gt($t,n),a=Zt($t,n),o=r.htmlFor||a.id,s=i.getFieldValidity(a.name);return(0,Y.jsx)(Je,{"data-valid":wn(s,a.serverInvalid),"data-invalid":Tn(s,a.serverInvalid),...r,ref:t,htmlFor:o})});en.displayName=$t;var tn=`FormControl`,nn=J.forwardRef((e,t)=>{let{__scopeForm:n,...r}=e,i=Gt(tn,n),a=Zt(tn,n),o=qt(tn,n),s=J.useRef(null),c=y(t,s),l=r.name||a.name,u=r.id||a.id,d=i.getFieldCustomMatcherEntries(l),{onFieldValidityChange:f,onFieldCustomErrorsChange:p,onFieldValiditionClear:m}=i,h=J.useCallback(async e=>{if(Cn(e.validity)){let t=hn(e.validity);f(l,t);return}let t=e.form?new FormData(e.form):new FormData,n=[e.value,t],r=[],i=[];d.forEach(e=>{bn(e,n)?i.push(e):xn(e)&&r.push(e)});let a=r.map(({id:e,match:t})=>[e,t(...n)]),o=Object.fromEntries(a),s=Object.values(o).some(Boolean),c=s;e.setCustomValidity(c?rn:``);let u=hn(e.validity);if(f(l,u),p(l,o),!s&&i.length>0){let t=i.map(({id:e,match:t})=>t(...n).then(t=>[e,t])),r=await Promise.all(t),a=Object.fromEntries(r),o=Object.values(a).some(Boolean);e.setCustomValidity(o?rn:``);let s=hn(e.validity);f(l,s),p(l,a)}},[d,l,p,f]);J.useEffect(()=>{let e=s.current;if(e){let t=()=>h(e);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)}},[h]);let g=J.useCallback(()=>{let e=s.current;e&&(e.setCustomValidity(``),m(l))},[l,m]);J.useEffect(()=>{let e=s.current?.form;if(e)return e.addEventListener(`reset`,g),()=>e.removeEventListener(`reset`,g)},[g]),J.useEffect(()=>{let e=s.current,t=e?.closest(`form`);if(t&&a.serverInvalid){let n=yn(t);n===e&&n.focus()}},[a.serverInvalid]);let _=i.getFieldValidity(l);return(0,Y.jsx)(E.input,{"data-valid":wn(_,a.serverInvalid),"data-invalid":Tn(_,a.serverInvalid),"aria-invalid":a.serverInvalid?!0:void 0,"aria-describedby":o.getFieldDescription(l),title:``,...r,ref:c,id:u,name:l,onInvalid:T(e.onInvalid,e=>{let t=e.currentTarget;h(t)}),onChange:T(e.onChange,e=>{g()})})});nn.displayName=tn;var rn=`This value is not valid`,an={badInput:rn,patternMismatch:`This value does not match the required pattern`,rangeOverflow:`This value is too large`,rangeUnderflow:`This value is too small`,stepMismatch:`This value does not match the required step`,tooLong:`This value is too long`,tooShort:`This value is too short`,typeMismatch:`This value does not match the required type`,valid:void 0,valueMissing:`This value is missing`},on=`FormMessage`,sn=J.forwardRef((e,t)=>{let{match:n,name:r,...i}=e,a=Zt(on,e.__scopeForm),o=r??a.name;return n===void 0?(0,Y.jsx)(un,{...i,ref:t,name:o,children:e.children||rn}):typeof n==`function`?(0,Y.jsx)(ln,{match:n,...i,ref:t,name:o}):(0,Y.jsx)(cn,{match:n,...i,ref:t,name:o})});sn.displayName=on;var cn=J.forwardRef((e,t)=>{let{match:n,forceMatch:r=!1,name:i,children:a,...o}=e,s=Gt(on,o.__scopeForm).getFieldValidity(i);return r||s?.[n]?(0,Y.jsx)(un,{ref:t,...o,name:i,children:a??an[n]}):null}),ln=J.forwardRef((e,t)=>{let{match:n,forceMatch:r=!1,name:i,id:a,children:o,...s}=e,c=Gt(on,s.__scopeForm),l=y(t,J.useRef(null)),u=D(),d=a??u,f=J.useMemo(()=>({id:d,match:n}),[d,n]),{onFieldCustomMatcherEntryAdd:p,onFieldCustomMatcherEntryRemove:m}=c;J.useEffect(()=>(p(i,f),()=>m(i,f.id)),[f,i,p,m]);let h=c.getFieldValidity(i),g=c.getFieldCustomErrors(i)[d];return r||h&&!Cn(h)&&g?(0,Y.jsx)(un,{id:d,ref:l,...s,name:i,children:o??rn}):null}),un=J.forwardRef((e,t)=>{let{__scopeForm:n,id:r,name:i,...a}=e,o=qt(on,n),s=D(),c=r??s,{onFieldMessageIdAdd:l,onFieldMessageIdRemove:u}=o;return J.useEffect(()=>(l(i,c),()=>u(i,c)),[i,c,l,u]),(0,Y.jsx)(E.span,{id:c,...a,ref:t})}),dn=`FormValidityState`,fn=e=>{let{__scopeForm:t,name:n,children:r}=e,i=Gt(dn,t),a=Zt(dn,t),o=n??a.name;return(0,Y.jsx)(Y.Fragment,{children:r(i.getFieldValidity(o))})};fn.displayName=dn;var pn=`FormSubmit`,mn=J.forwardRef((e,t)=>{let{__scopeForm:n,...r}=e;return(0,Y.jsx)(E.button,{type:`submit`,...r,ref:t})});mn.displayName=pn;function hn(e){let t={};for(let n in e)t[n]=e[n];return t}function gn(e){return e instanceof HTMLElement}function _n(e){return`validity`in e}function vn(e){return _n(e)&&(e.validity.valid===!1||e.getAttribute(`aria-invalid`)===`true`)}function yn(e){let t=e.elements,[n]=Array.from(t).filter(gn).filter(vn);return n}function bn(e,t){return e.match.constructor.name===`AsyncFunction`||Sn(e.match,t)}function xn(e){return e.match.constructor.name===`Function`}function Sn(e,t){return e(...t)instanceof Promise}function Cn(e){let t=!1;for(let n in e){let r=n;if(r!==`valid`&&r!==`customError`&&e[r]){t=!0;break}}return t}function wn(e,t){if(e?.valid===!0&&!t)return!0}function Tn(e,t){if(e?.valid===!1||t)return!0}var En=Jt,Dn=Qt,On=nn,kn=({trigger:e,onCopyLink:t,onDelete:n,allowDelete:r=!1,disabled:i=!1,layout:a,followedByMe:o=!1,authoredByMe:s=!1,onFollow:c=()=>{},onUnfollow:l=()=>{}})=>(0,Y.jsxs)(je,{children:[(0,Y.jsxs)(qe,{children:[(0,Y.jsx)(We,{disabled:i,asChild:!0,onClick:e=>e.stopPropagation(),children:e}),(0,Y.jsx)(Ge,{align:`${a===`modal`?`start`:`end`}`,alignOffset:a===`modal`?-12:0,className:`p-2`,children:(0,Y.jsxs)(`div`,{className:`flex w-48 flex-col`,children:[(!r||a===`inbox`)&&(0,Y.jsx)(Ke,{asChild:!0,children:(0,Y.jsxs)(H,{className:`justify-start rounded-menu-item`,shape:`rounded`,variant:`ghost`,onClick:e=>{e.stopPropagation(),t()},children:[(0,Y.jsx)(B,{}),`Copy link`]})}),!s&&(0,Y.jsx)(Ke,{asChild:!0,children:(0,Y.jsxs)(H,{className:`justify-start rounded-menu-item`,shape:`rounded`,variant:`ghost`,onClick:e=>{e.stopPropagation(),o?l():c()},children:[o?(0,Y.jsx)(z,{}):(0,Y.jsx)(ve,{}),o?`Unfollow`:`Follow`]})}),r&&(0,Y.jsx)(Ee,{asChild:!0,children:(0,Y.jsx)(Ke,{asChild:!0,children:(0,Y.jsxs)(H,{className:`justify-start rounded-menu-item text-red hover:bg-red/5 hover:text-red`,shape:`rounded`,variant:`ghost`,onClick:e=>e.stopPropagation(),children:[(0,Y.jsx)(re,{}),`Delete`]})})})]})})]}),(0,Y.jsxs)(Te,{onClick:e=>e.stopPropagation(),children:[(0,Y.jsxs)(Ae,{children:[(0,Y.jsx)(we,{children:`Delete this post?`}),(0,Y.jsx)(Ce,{children:a===`inbox`?`This will remove the post from the Ghost social web, but it will remain on your website.`:(0,Y.jsx)(Y.Fragment,{children:`If you delete this post, you won't be able to restore it.`})})]}),(0,Y.jsxs)(Oe,{children:[(0,Y.jsx)(ke,{onClick:e=>e.stopPropagation(),children:`Cancel`}),(0,Y.jsx)(De,{variant:`destructive`,onClick:e=>{e.stopPropagation(),n()},children:`Delete`})]})]})]});function An(e){let[t,n]=(0,J.useState)({images:[],currentIndex:0,isOpen:!1}),r=e=>{let t=Q(e);if(!t)return[];if(Array.isArray(t))return t.map((e,t)=>({url:e.url,alt:e.name||`Image-${t}`}));if(t.mediaType?.startsWith(`image/`)||t.type===`Image`)return[{url:t.url,alt:t.name||`Image`}];if(e.image){let t;if(t=typeof e.image==`string`?e.image:e.image?.url,t)return[{url:t,alt:`Image`}]}return[]};return{lightboxState:t,openLightbox:t=>{if(!e)return;let i=r(e),a=i.findIndex(e=>e.url===t);a!==-1&&n({images:i,currentIndex:a,isOpen:!0})},closeLightbox:()=>{n(e=>({...e,isOpen:!1}))},navigateToIndex:e=>{n(t=>({...t,currentIndex:e}))}}}var jn=({images:e,currentIndex:t,isOpen:n,onClose:r,onNavigate:i})=>{let a=t===0,o=t===e.length-1,s=(0,J.useCallback)(()=>{e.length<=1||o||i((t+1)%e.length)},[e.length,o,t,i]),c=(0,J.useCallback)(()=>{e.length<=1||a||i((t-1+e.length)%e.length)},[e.length,a,t,i]);return(0,J.useEffect)(()=>{let e=e=>{n&&(e.key===`ArrowRight`&&!o?s():e.key===`ArrowLeft`&&!a&&c())};return window.addEventListener(`keydown`,e),()=>{window.removeEventListener(`keydown`,e)}},[n,t,e.length,s,c,o,a]),!n||e.length===0?null:(0,Y.jsx)(Ue,{open:n,onOpenChange:e=>{e||r()},children:(0,Y.jsxs)(Ve,{className:`top-[50%] h-[100vh] max-h-[100vh] w-[100vw] max-w-[100vw] translate-y-[-50%] items-center border-none bg-transparent p-0 shadow-none data-[state=closed]:zoom-out-100 data-[state=closed]:slide-out-to-top-[50%] data-[state=open]:zoom-in-100 data-[state=open]:slide-in-from-top-[50%]`,onClick:()=>r(),children:[(0,Y.jsx)(`img`,{alt:e[t].alt,className:`mx-auto max-h-[90vh] max-w-[90vw] object-contain`,src:e[t].url,onClick:e=>e.stopPropagation()}),e.length>1&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(H,{className:`absolute top-1/2 left-5 size-11 -translate-y-1/2 rounded-full bg-black/50 p-0 pr-0.5 hover:bg-black/70`,disabled:a,onClick:e=>{e.stopPropagation(),c()},children:[(0,Y.jsx)(he,{className:`size-6!`}),(0,Y.jsx)(`span`,{className:`sr-only`,children:`Previous image`})]}),(0,Y.jsxs)(H,{className:`absolute top-1/2 right-5 size-11 -translate-y-1/2 rounded-full bg-black/50 p-0 pl-0.5 hover:bg-black/70`,disabled:o,onClick:e=>{e.stopPropagation(),s()},children:[(0,Y.jsx)(V,{className:`size-6!`}),(0,Y.jsx)(`span`,{className:`sr-only`,children:`Next image`})]})]}),(0,Y.jsx)(ze,{asChild:!0,children:(0,Y.jsxs)(H,{className:`absolute top-5 right-5 size-11 rounded-full bg-black/50 p-0 hover:bg-black/70`,children:[(0,Y.jsx)(de,{className:`size-5!`}),(0,Y.jsx)(`span`,{className:`sr-only`,children:`Close`})]})})]})})},Mn=()=>{},Nn=({className:e,following:t,handle:n,variant:r=`default`,onFollow:i=Mn,onUnfollow:a=Mn,"data-testid":o})=>{let[s,c]=(0,J.useState)(t),l=pt(`index`,()=>{},()=>{c(!0)}),u=St(`index`,()=>{},()=>{c(!1)}),d=async()=>{s?(c(!1),a(),l.mutate(n)):(c(!0),i(),u.mutate(n))};(0,J.useEffect)(()=>{c(t)},[t]);let f=s?`Following`:`Follow`;return r===`link`?(0,Y.jsx)(H,{className:w(`p-0 font-medium`,s?`text-gray-700 hover:text-black dark:text-gray-600 dark:hover:text-white`:`text-purple hover:text-black dark:hover:text-white`,e),"data-testid":o,variant:`link`,onClick:e=>{e?.preventDefault(),e?.stopPropagation(),d()},children:f}):(0,Y.jsx)(H,{className:w(`min-w-[90px]`,e),"data-testid":o,title:s?`Click to unfollow`:``,variant:s?`outline`:`default`,onClick:e=>{e?.preventDefault(),e?.stopPropagation(),d()},children:f})},Pn=e=>`preferredUsername`in e,X=({actor:e,children:t,disabled:n=!1,side:r=`bottom`,align:i=`start`,isCurrentUser:a=!1})=>{let[o,s]=(0,J.useState)(!1),c=G(),l=e?.handle;!l&&e&&Pn(e)&&(l=q(e));let u=n||!l&&!e,d=gt(`index`,l||``,{enabled:o&&!!l}),f=d.isFetching||d.isLoading,p=d.error,m=d.data?typeof d.data.followerCount==`number`&&typeof d.data.followingCount==`number`&&d.data.bio!==void 0:!1;if((0,J.useEffect)(()=>{!o||!l||!m&&!f&&!p&&d.refetch({cancelRefetch:!1})},[d,f,p,m,o,l]),u)return(0,Y.jsx)(Y.Fragment,{children:t});let h=d.data||e,g=h?.handle??l??``,_=h?.name??``,v=h?.avatarUrl??(e&&Pn(e)?e.icon?.url:null)??null,y=!!h?.followsMe,x=typeof h?.followingCount==`number`?h.followingCount:Number(h?.followingCount)||0,S=typeof h?.followerCount==`number`?h.followerCount:Number(h?.followerCount)||0,C=h?.bio?rt(at(h.bio,[`a`])):void 0,w=()=>{g&&c(`/profile/${g}`)};return(0,Y.jsxs)(Ze,{onOpenChange:s,children:[(0,Y.jsx)(Xe,{asChild:!0,children:t}),(0,Y.jsx)(Ye,{align:i,className:`w-[320px] cursor-default rounded-2xl border-0 p-5 text-left text-gray-900 shadow-lg outline-hidden dark:bg-surface-elevated-2`,side:r,sideOffset:12,onClick:e=>e.stopPropagation(),children:(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsxs)(`div`,{className:`flex justify-between`,children:[(0,Y.jsxs)(Pe,{className:`size-14 cursor-pointer`,onClick:w,children:[v&&(0,Y.jsx)(Ne,{alt:_,className:`rounded-full outline-[0.5px] outline-offset-[-0.5px] outline-black/10`,src:v,onError:e=>{e.target.src=``,e.target.style.display=`none`}}),(0,Y.jsx)(Me,{className:`bg-gray-200 text-sm font-semibold text-gray-700 dark:bg-gray-800 dark:text-gray-200`,children:(0,Y.jsx)(fe,{className:`size-5 text-gray-500 dark:text-gray-400`,strokeWidth:1.5})})]}),!a&&(0,Y.jsx)(Nn,{following:!!h?.followedByMe,handle:g,type:`primary`})]}),(0,Y.jsxs)(`div`,{className:`flex cursor-pointer flex-col items-start`,onClick:w,children:[(0,Y.jsx)(j,{className:`w-full truncate`,children:_}),(0,Y.jsxs)(`div`,{className:`flex w-full gap-2`,children:[(0,Y.jsx)(`span`,{className:`truncate text-gray-700 dark:text-gray-600`,children:g}),y&&!a&&(0,Y.jsx)(Fe,{className:`mt-px whitespace-nowrap`,variant:`secondary`,children:`Follows you`})]})]})]}),(0,Y.jsx)(`div`,{className:`flex gap-3 dark:text-gray-300`,children:f?(0,Y.jsx)(W,{className:`h-4 w-32`}):!p&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`span`,{className:`cursor-pointer hover:underline`,onClick:()=>{g&&c(`/profile/${g}/following`)},children:[(0,Y.jsx)(`span`,{className:`font-bold text-black dark:text-white`,children:b(x)}),` `,`Following`]}),(0,Y.jsxs)(`span`,{className:`cursor-pointer hover:underline`,onClick:()=>{g&&c(`/profile/${g}/followers`)},children:[(0,Y.jsx)(`span`,{className:`font-bold text-black dark:text-white`,children:b(S)}),` `,`Followers`]})]})}),f?(0,Y.jsx)(W,{className:`h-4 w-48`}):!p&&C?(0,Y.jsx)(`div`,{dangerouslySetInnerHTML:{__html:it(C)},className:`leading-tight dark:text-gray-300 [&_.invisible]:hidden [&_a]:text-[#00a4eb] [&_a:hover]:underline`}):null]})})]})},Fn=(e={})=>{let[t,n]=(0,J.useState)(!1),r=f();return(0,J.useEffect)(()=>{let t=t=>{if(t.target instanceof HTMLInputElement||t.target instanceof HTMLTextAreaElement||t.target instanceof HTMLElement&&t.target.isContentEditable||t.target instanceof HTMLSelectElement||t.metaKey||t.ctrlKey||t.altKey||t.shiftKey)return;let i=document.querySelector(`[role="dialog"][data-state="open"]`);if(!(i&&(e.componentRef?.current)?.closest(`[role="dialog"]`)!==i))switch(t.key.toLowerCase()){case`n`:i||(t.preventDefault(),e.onOpenNewNote?e.onOpenNewNote():n(!0));break;case`r`:e.isReplyAvailable&&e.onOpenReply&&(r.pathname.includes(`/notes/`)||r.pathname.includes(`/reader/`))&&(t.preventDefault(),e.onOpenReply());break}};return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[e,r.pathname]),{isNewNoteModalOpen:t,setIsNewNoteModalOpen:n}},In=({actor:e,object:t,likeCount:n,commentCount:r,repostCount:i,layout:a,disabled:o=!1,buttonClassName:s=``,onLikeClick:c,onCommentClick:l,onReplyCountChange:u})=>{let[d,f]=(0,J.useState)(t.liked),[p,m]=(0,J.useState)(t.reposted),[h,g]=(0,J.useState)(!1),_=(0,J.useRef)(null);Fn({isReplyAvailable:!l&&a!==`reply`,onOpenReply:()=>g(!0),componentRef:_}),(0,J.useEffect)(()=>{f(t.liked),m(t.reposted)},[t.liked,t.reposted]),(0,J.useEffect)(()=>{w(i)},[i]);let v=xt(`index`),y=Ct(`index`),b=vt(`index`),S=yt(`index`),[C,w]=(0,J.useState)(i),T=async e=>{e.stopPropagation(),d?y.mutate(t.id):v.mutate(t.id,{onError(){f(!1)}}),f(!d),c()},E=e=>{e.stopPropagation(),l?l():g(!0)},D=`px-2 gap-1.5 font-normal text-md [&_svg]:size-[18px] transition-color ap-action-button text-gray-900 hover:text-gray-900 hover:bg-black/[3%] dark:hover:bg-gray-950 dark:text-gray-600 ${a===`inbox`?`rounded-md`:``} ${s}`;return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`div`,{ref:_,className:`flex ${a!==`inbox`&&`gap-1`}`,children:[(0,Y.jsxs)(H,{className:`${D} ${d&&`text-pink-500 hover:text-pink-500`}`,"data-testid":`like-button`,disabled:o,id:`like`,title:`${d?`Undo like`:`Like`}`,variant:`ghost`,onClick:e=>{e?.stopPropagation(),e&&T(e)},children:[(0,Y.jsx)(me,{className:`${d&&`fill-pink-500 text-pink-500`}`}),a!==`inbox`&&(0,Y.jsx)(Ot,{className:n===0?`-ml-1.5 w-0 overflow-hidden`:``,spinTiming:{duration:300},value:n})]}),(0,Y.jsxs)(H,{className:`${D}`,"data-testid":`reply-button`,disabled:o,id:`comment`,title:`Reply`,variant:`ghost`,onClick:E,children:[(0,Y.jsx)(ce,{className:`-mr-px`}),a!==`inbox`&&r>0&&x(r)]}),(0,Y.jsxs)(H,{className:`${D} ${p&&`text-green-500 hover:text-green-500`}`,"data-testid":`repost-button`,disabled:o,id:`repost`,title:`${p?`Undo repost`:`Repost`}`,variant:`ghost`,onClick:e=>{e?.stopPropagation(),p?(S.mutate(t.id),w(C-1)):(b.mutate(t.id,{onError(){m(!1),w(C-1)}}),w(C+1)),m(!p)},children:[(0,Y.jsx)(ge,{className:`${p&&`text-green-500`}`}),a!==`inbox`&&(0,Y.jsx)(Ot,{className:C===0?`-ml-1.5 w-0 overflow-hidden`:``,spinTiming:{duration:300},value:C})]})]}),h&&(0,Y.jsx)(rr,{open:h,replyTo:{object:t,actor:e},onOpenChange:e=>{g(e)},onReply:()=>{u?.(1),g(!1)},onReplyError:()=>{u?.(-1)}})]})};function Ln(e){let t=e.replace(/<[^>]*>/g,``).split(/\s+/).filter(e=>e.length>0).length;return`${Math.ceil(t/275)} min read`}var Z=(e,t,n)=>{n?.stopPropagation(),t(typeof e==`string`?`/profile/${e}`:`/profile/${q(e)}`)},Rn=e=>{let t=new Date,n=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()),r=n(t),i=n(new Date(t.getTime()-1440*60*1e3)),a=n(e);return a.getTime()===r.getTime()?zn(e):a.getTime()===i.getTime()?`Yesterday`:Bn(e)},zn=e=>{let t=Math.floor((new Date().getTime()-e.getTime())/1e3);if(t<1)return`Just now`;if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?`${n}m`:`${Math.floor(n/60)}h`},Bn=e=>{let t=new Date,n=e.getDate(),r=e.toLocaleString(`default`,{month:`short`});return e.getFullYear()===t.getFullYear()?`${n} ${r}`:`${n} ${r} ${e.getFullYear()}`};function Vn(e){return new Date(e).toLocaleDateString(`default`,{year:`numeric`,month:`short`,day:`2-digit`})+`, `+new Date(e).toLocaleTimeString(`default`,{hour:`2-digit`,minute:`2-digit`})}function Hn(e,t=!0){let n=new Date(e?.published??e?.createdAt??new Date),r=Vn(n),i=Rn(n);return t&&!e.url?.includes(`/.ghost/activitypub`)?(0,Y.jsx)(`a`,{className:`whitespace-nowrap text-gray-700 hover:underline`,href:e.url,rel:`noreferrer`,target:`_blank`,title:r,onClick:e=>e.stopPropagation(),children:i}):(0,Y.jsx)(`span`,{className:`whitespace-nowrap text-gray-700`,children:i})}function Un({contentWarning:e,sensitive:t,hasMedia:n,resetKey:r}){let{data:i}=ct(),a=i?.showSensitiveMedia??!1,[o,s]=(0,J.useState)(!1),[c,l]=(0,J.useState)(!1),[u,d]=(0,J.useState)(!1),[f,p]=(0,J.useState)(!0),[m,h]=(0,J.useState)(void 0),g=(0,J.useRef)(null);(0,J.useEffect)(()=>{s(!1),l(!1),d(!1),p(!0),h(void 0)},[r]),(0,J.useLayoutEffect)(()=>{!u||!f||(p(!1),h(void 0))},[u,f]);let _=e?.trim()||null,v=_!==null,y=t===!0&&n&&!v&&!a,b=y&&(c||!o);return{contentWarning:_,shouldHideContentWarning:v&&!u,shouldHideSensitiveMedia:b,canHideSensitiveMedia:y&&!b,isContentWarningRevealed:u,showContentWarningOverlay:f,contentWarningMinHeight:m,contentWarningWrapperRef:g,revealSensitiveMedia:e=>{e.stopPropagation(),l(!1),s(!0)},hideSensitiveMedia:e=>{e.stopPropagation(),l(!0),s(!1)},revealContentWarning:e=>{e.stopPropagation();let t=g.current?.offsetHeight;t&&h(t),d(!0)}}}function Q(e){let t;if(e.image&&(t=typeof e.image==`string`?{type:`Image`,url:e.image}:{type:e.image.type??`Image`,mediaType:e.image.mediaType,url:e.image.url}),e.type===`Note`&&!t&&(t=e.attachment),!t)return null;if(Array.isArray(t)){if(t.length===0)return null;if(t.length===1)return t[0]}return t}function Wn(e,t,n,r){let i=Q(e);if(!i)return null;let a=e=>n=>{n.stopPropagation(),t&&t(e)},o=e=>{r&&r(e)},s=(e,t=!1)=>(0,Y.jsx)(`div`,{className:`${e} ${t?`min-h-[200px]`:``} flex w-full items-center justify-center bg-gray-100 dark:bg-gray-950/30`,children:(0,Y.jsx)(ye,{className:`text-gray-400`,size:24,strokeWidth:1.5})});if(Array.isArray(i)){let e=i.length,r=``;return e===1?r=`grid-cols-1`:e>=2&&e<=4?r=`grid-cols-2 auto-rows-[150px]`:e>4&&(r=`grid-cols-3 auto-rows-[150px]`),(0,Y.jsx)(`div`,{className:`attachment-gallery mt-3 grid w-full ${r} gap-2`,children:i.map((r,i)=>{let c=`size-full rounded-md outline-1 -outline-offset-1 outline-black/10 ${e===3&&i===0?`row-span-2`:``}`;return n&&n.has(r.url)?s(c,e===1):(0,Y.jsx)(`img`,{alt:r.name||`Image-${i}`,className:`${c} cursor-pointer object-cover`,referrerPolicy:`no-referrer`,src:r.url,onClick:t?a(r.url):void 0,onError:()=>o(r.url)},r.url)})})}switch(i.mediaType){case`image/jpeg`:case`image/png`:case`image/gif`:case`image/webp`:return n&&n.has(i.url)?s(`${e.type===`Article`?`w-full rounded-t-md`:`mt-3 max-h-[420px] rounded-md outline-1 -outline-offset-1 outline-black/10`}`,!0):(0,Y.jsx)(`img`,{alt:i.name||`Image`,className:`cursor-pointer ${e.type===`Article`?`w-full rounded-t-md`:`mt-3 max-h-[420px] rounded-md outline-1 -outline-offset-1 outline-black/10`}`,referrerPolicy:`no-referrer`,src:i.url,onClick:t?a(i.url):void 0,onError:()=>o(i.url)});case`video/mp4`:case`video/webm`:return(0,Y.jsx)(`div`,{className:`relative mt-3 mb-4`,children:(0,Y.jsx)(`video`,{className:`h-[300px] w-full rounded object-cover`,src:i.url,controls:!0})});case`audio/mpeg`:case`audio/ogg`:return(0,Y.jsx)(`div`,{className:`relative mt-2 mb-4 w-full`,children:(0,Y.jsx)(`audio`,{className:`w-full`,src:i.url,controls:!0})});default:if(e.image||i.type===`Image`){let r=e.type===`Article`?`cursor-pointer aspect-[16/7.55] w-full rounded-t-md object-cover`:`cursor-pointer mt-3 max-h-[420px] rounded-md outline-1 -outline-offset-1 outline-black/10`,c;return c=e.image?typeof e.image==`string`?e.image:e.image?.url:i.url,n&&n.has(c)?s(r,!0):(0,Y.jsx)(`img`,{alt:i.name||`Image`,className:r,referrerPolicy:`no-referrer`,src:c,onClick:t?a(c):void 0,onError:()=>o(c)})}return null}}function Gn({className:e=``,isLayered:t=!1,size:n=`default`,showLabel:r=!0,onReveal:i}){let a=n===`compact`;return(0,Y.jsxs)(`div`,{className:w(`flex items-center justify-center overflow-hidden bg-foreground/45 text-background backdrop-blur-xl`,a?`p-2`:`[container-type:size] p-[clamp(0.75rem,6cqh,2rem)]`,t?`absolute inset-0 rounded-none`:a?`relative rounded-md`:`relative mt-3 min-h-[300px] w-full rounded-md`,e),"data-testid":`sensitive-media-overlay`,onClick:e=>e.stopPropagation(),children:[(0,Y.jsx)(`div`,{className:`absolute inset-0 bg-foreground/35`}),a?(0,Y.jsxs)(`div`,{className:`relative z-10 flex flex-col items-center justify-center gap-0.5 text-center`,children:[(0,Y.jsx)(I,{"aria-hidden":`true`,className:`size-5`,strokeWidth:2.25}),r&&(0,Y.jsx)(k,{className:`text-sm leading-none text-background`,weight:`bold`,children:`Sensitive media`}),(0,Y.jsx)(H,{"aria-label":`Show media`,className:`mt-0.5 h-6 rounded-full bg-background/35 px-3 text-xs font-bold text-background shadow-[0_0_0_1px_color-mix(in_oklab,var(--background)_35%,transparent)] hover:bg-background/25 hover:text-background`,size:`sm`,type:`button`,variant:`ghost`,onClick:i,children:`Show`})]}):(0,Y.jsxs)(`div`,{className:`relative z-10 grid size-full max-w-[520px] grid-rows-[minmax(0,1fr)_auto_minmax(0.5rem,6cqh)_auto_minmax(0.75rem,8cqh)_auto_minmax(0,1fr)] justify-items-center text-center`,children:[(0,Y.jsx)(I,{"aria-hidden":`true`,className:`row-start-2 size-[clamp(1.5rem,14cqh,2.25rem)]`,strokeWidth:2.25}),(0,Y.jsxs)(`div`,{className:`row-start-4 flex flex-col items-center gap-1`,children:[(0,Y.jsx)(k,{className:`text-background`,weight:`bold`,children:`Sensitive media`}),(0,Y.jsx)(k,{className:`leading-tight text-background`,children:`The following may contain sensitive material`})]}),(0,Y.jsx)(H,{"aria-label":`Show media`,className:`row-start-6 rounded-full bg-background/35 px-8 font-bold text-background shadow-[0_0_0_1px_color-mix(in_oklab,var(--background)_35%,transparent)] hover:bg-background/25 hover:text-background`,size:`default`,type:`button`,variant:`ghost`,onClick:i,children:`Show`})]})]})}function Kn({label:e=`Hide media`,layout:t=`overlay`,onHide:n}){return(0,Y.jsx)(H,{"aria-label":`Hide sensitive media`,className:w(`z-20 rounded-full bg-foreground/80 px-6 font-bold text-background hover:bg-foreground/90 hover:text-background`,t===`overlay`&&`absolute top-5 right-5`),size:`default`,type:`button`,variant:`ghost`,onClick:n,children:e})}function qn({className:e=``,isLayered:t=!1,label:n,size:r=`default`,onReveal:i}){let a=r===`compact`;return(0,Y.jsxs)(`div`,{className:w(`flex w-full items-center justify-center overflow-hidden bg-foreground/45 text-background backdrop-blur-xl`,a?`p-4`:`[container-type:inline-size] p-[clamp(0.75rem,6cqw,2rem)]`,t?`absolute inset-0 rounded-none`:a?`relative min-h-[73px] w-full rounded-md`:`relative min-h-[300px] w-full rounded-md`,e),"data-testid":`content-warning-overlay`,onClick:e=>e.stopPropagation(),children:[(0,Y.jsx)(`div`,{className:`absolute inset-0 bg-foreground/35`}),a?(0,Y.jsxs)(`div`,{className:`relative z-10 flex w-full max-w-[520px] flex-col items-center justify-center gap-2 text-center`,children:[(0,Y.jsx)(I,{"aria-hidden":`true`,className:`size-5`,strokeWidth:2.25}),(0,Y.jsxs)(`div`,{className:`flex flex-col items-center gap-0.5`,children:[(0,Y.jsx)(k,{className:`text-sm text-background`,weight:`bold`,children:`Content warning:`}),(0,Y.jsx)(k,{className:`text-sm leading-tight text-background`,children:n})]}),(0,Y.jsx)(H,{"aria-label":`Show post`,className:`rounded-full bg-background/35 px-6 text-sm font-bold text-background shadow-[0_0_0_1px_color-mix(in_oklab,var(--background)_35%,transparent)] hover:bg-background/25 hover:text-background`,size:`sm`,type:`button`,variant:`ghost`,onClick:i,children:`Show`})]}):(0,Y.jsxs)(`div`,{className:`relative z-10 grid size-full max-w-[520px] grid-rows-[minmax(0,1fr)_auto_clamp(1.25rem,3.85cqw,1.8rem)_auto_clamp(1.5rem,5.15cqw,2.4rem)_auto_minmax(0,1fr)] justify-items-center text-center`,children:[(0,Y.jsx)(I,{"aria-hidden":`true`,className:`row-start-2 size-[clamp(1.5rem,4.85cqw,2.25rem)]`,strokeWidth:2.25}),(0,Y.jsxs)(`div`,{className:`row-start-4 flex flex-col items-center gap-1`,children:[(0,Y.jsx)(k,{className:`text-background`,weight:`bold`,children:`Content warning:`}),(0,Y.jsx)(k,{className:`leading-tight text-background`,children:n})]}),(0,Y.jsx)(H,{"aria-label":`Show post`,className:`row-start-6 rounded-full bg-background/35 px-8 font-bold text-background shadow-[0_0_0_1px_color-mix(in_oklab,var(--background)_35%,transparent)] hover:bg-background/25 hover:text-background`,size:`default`,type:`button`,variant:`ghost`,onClick:i,children:`Show`})]})]})}function Jn(e,t){let n=Q(e),r=`ml-8 md:ml-9 shrink-0 rounded-md h-[91px] w-[121px] relative hidden @md/inbox-item:block`,i=w(`object-cover outline-1 -outline-offset-1 outline-black/[0.05]`,r);if(t)return(0,Y.jsx)(W,{className:`${i} outline-0`});if(!n)return null;if(Array.isArray(n))return(0,Y.jsx)(`img`,{className:i,referrerPolicy:`no-referrer`,src:n[0].url});switch(n.mediaType){case`image/jpeg`:case`image/png`:case`image/gif`:return(0,Y.jsx)(`img`,{className:i,referrerPolicy:`no-referrer`,src:n.url});case`video/mp4`:case`video/webm`:return(0,Y.jsxs)(`div`,{className:r,children:[(0,Y.jsx)(`video`,{className:`h-[80px] w-full rounded object-cover`,src:n.url}),(0,Y.jsx)(`div`,{className:`absolute inset-0 rounded bg-gray-900 opacity-50`}),(0,Y.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center`,children:(0,Y.jsx)(be,{color:`white`,fill:`white`,size:40})})]});case`audio/mpeg`:case`audio/ogg`:return(0,Y.jsx)(`div`,{className:`ml-8 w-[120px]`,children:(0,Y.jsx)(`div`,{className:`relative mt-2 mb-4 w-full`,children:(0,Y.jsx)(`audio`,{className:`w-full`,src:n.url,controls:!0})})});default:return e.image?(0,Y.jsx)(`img`,{className:i,referrerPolicy:`no-referrer`,src:typeof e.image==`string`?e.image:e.image?.url}):null}}var Yn=()=>{},Xn=(0,Y.jsx)(ge,{className:`shrink-0 text-gray-700 dark:text-gray-600`,size:16,strokeWidth:1.5}),Zn=({actor:e,allowDelete:t=!1,object:n,parentId:r=void 0,layout:i,type:o,commentCount:s=0,repostCount:c=0,likeCount:l=0,showHeader:u=!0,last:d,isLoading:f,isPending:p=!1,isCompact:m=!1,isChainContinuation:h=!1,isChainParent:g=!1,onClick:_=Yn,onDelete:v=Yn,showStats:y=!0})=>{let b=new Date(n?.published??new Date).toLocaleDateString(`default`,{year:`numeric`,month:`short`,day:`2-digit`})+`, `+new Date(n?.published??new Date).toLocaleTimeString(`default`,{hour:`2-digit`,minute:`2-digit`}),[,x]=(0,J.useState)(!1),[S,C]=(0,J.useState)(new Set),T=(0,J.useRef)(null),[E,D]=(0,J.useState)(!1),O=_t(`index`),k=G(),{contentWarning:j,shouldHideContentWarning:M,shouldHideSensitiveMedia:N,canHideSensitiveMedia:ee,isContentWarningRevealed:te,showContentWarningOverlay:ne,contentWarningMinHeight:re,contentWarningWrapperRef:P,revealSensitiveMedia:F,hideSensitiveMedia:ie,revealContentWarning:I}=Un({contentWarning:n?.contentWarning,sensitive:n?.sensitive,hasMedia:Q(n)!==null,resetKey:n?.id}),ae=St(`index`,()=>{a.success(`Followed ${R?.name}`)},()=>{a.error(`Failed to follow`)}),se=pt(`index`,()=>{a.info(`Unfollowed ${R?.name}`)},()=>{a.error(`Failed to unfollow`)});(0,J.useEffect)(()=>{let e=T.current;e&&D(e.scrollHeight>e.clientHeight)},[n?.content]),(0,J.useEffect)(()=>{let e=T.current;if(!e)return;let t=e=>{let t=e.target.closest(`a[data-profile]`);if(t){let n=t.getAttribute(`data-profile`)?.trim();/^@([\w.-]+)@([\w-]+\.[\w.-]+[a-zA-Z])$/.test(n||``)&&n&&(e.preventDefault(),e.stopPropagation(),Z(n,k))}};return e.addEventListener(`click`,t),()=>{e.removeEventListener(`click`,t)}},[k,n?.content]);let ce=()=>{},L=()=>{p||_()},le=()=>{O.mutate({id:n.id,parentId:r}),v()},ue=async()=>{n?.url&&(await navigator.clipboard.writeText(n.url),x(!0),a.success(`Link copied`),setTimeout(()=>x(!1),2e3))},de=e=>{C(t=>new Set(t).add(e))},fe=e=>{if(N){let e=Wn(n,void 0,S,de);return e?(0,Y.jsxs)(`div`,{className:w(`relative mt-3 overflow-hidden rounded-md [&>.attachment-gallery]:mt-0 [&>img]:mt-0 [&>img]:block`,Array.isArray(Q(n))?`w-full`:`w-fit max-w-full`),children:[e,(0,Y.jsx)(Gn,{isLayered:!0,onReveal:F})]}):(0,Y.jsx)(Gn,{onReveal:F})}let t=Wn(n,e,S,de);return t?ee?(0,Y.jsxs)(`div`,{className:w(`relative mt-3 [&>.attachment-gallery]:mt-0 [&>img]:mt-0 [&>img]:block`,Array.isArray(Q(n))?`w-full`:`w-fit max-w-full`),children:[t,(0,Y.jsx)(Kn,{label:`Hide`,onHide:ie})]}):t:null},pe=(e=!1)=>j?(0,Y.jsx)(qn,{isLayered:e,label:j,size:i===`inbox`||i===`reply`?`compact`:`default`,onReveal:I}):null,me=e=>{let{contentClassName:t=`ap-note-content break-anywhere line-clamp-[10] leading-[1.4285714286] tracking-[-0.006em] text-pretty text-gray-900 dark:text-gray-300 [&_p+p]:mt-3`,mediaClickHandler:r=xe,showName:i=!1}=e??{};return(0,Y.jsxs)(Y.Fragment,{children:[i&&n.name&&(0,Y.jsx)(A,{className:`break-anywhere mb-1 leading-tight`,"data-test-activity-heading":!0,children:n.name}),(0,Y.jsx)(`div`,{className:t,children:f?(0,Y.jsx)(W,{count:2}):(0,Y.jsx)(`div`,{dangerouslySetInnerHTML:{__html:it(rt(n.content||``)??``)},ref:T,onClick:e=>{let t=e.target;(t.tagName===`A`||t.closest(`a`))&&e.stopPropagation()}})}),E&&(0,Y.jsx)(`button`,{className:`mt-1 text-blue-600`,type:`button`,children:`Show more`}),fe(r)]})},he=e=>j?(0,Y.jsxs)(`div`,{ref:P,className:`relative w-full`,style:re?{minHeight:re}:void 0,children:[te&&me(e),ne&&pe(te)]}):me(e),R=e;o===`Announce`&&(R=typeof n.attributedTo==`object`?n.attributedTo:e);let ge=R?q(R):null,z=R?.followedByMe||!1,B=o===`Announce`?typeof n.attributedTo==`object`&&n.attributedTo&&!Array.isArray(n.attributedTo)&&`authored`in n.attributedTo?n.attributedTo.authored:typeof n.attributedTo==`object`&&n.attributedTo&&!Array.isArray(n.attributedTo)&&typeof e==`object`&&e&&n.attributedTo.id===e.id:n.authored,_e=o===`Announce`?n.reposted??!1:n.authored,ve=()=>{ge&&ae.mutate(ge)},ye=()=>{ge&&se.mutate(ge)},be=(0,Y.jsx)(H,{className:`relative z-10 size-[34px] ${i===`feed`?``:`rounded-md`} ${i===`inbox`||i===`modal`?`text-gray-900 hover:text-gray-900 dark:text-gray-600 dark:hover:text-gray-600`:`text-gray-500 hover:text-gray-500`} dark:hover:bg-gray-950 [&_svg]:size-5`,"data-testid":`menu-button`,shape:i===`feed`?`pill`:`rounded`,size:i===`feed`?`icon`:void 0,variant:`ghost`,children:(0,Y.jsx)(oe,{})}),{lightboxState:V,openLightbox:xe,closeLightbox:Se,navigateToIndex:U}=An(n);return i===`feed`?(0,Y.jsxs)(Y.Fragment,{children:[n&&(0,Y.jsxs)(`div`,{className:`group/article relative -mx-4 ${p?`pointer-events-none`:`cursor-pointer`} rounded-lg p-6 px-4 pb-[18px]`,"data-layout":`feed`,"data-object-id":n.id,onClick:L,children:[o===`Announce`&&(0,Y.jsxs)(`div`,{className:`z-10 mb-2 flex items-center gap-1.5 text-gray-700 dark:text-gray-600`,children:[Xn,(0,Y.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1 text-sm`,children:[(0,Y.jsx)(X,{actor:e,align:`center`,isCurrentUser:_e,children:(0,Y.jsx)(`span`,{className:`break-anywhere truncate hover:underline`,onClick:t=>{Z(e,k,t)},children:e.name})}),`reposted`]})]}),(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2.5`,"data-test-activity":!0,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Y.jsx)(X,{actor:R,isCurrentUser:B,children:(0,Y.jsxs)(`div`,{className:`flex min-w-0 grow items-center gap-3`,children:[(0,Y.jsx)(K,{author:R,disabled:p,showFollowButton:!B&&!z}),(0,Y.jsxs)(`div`,{className:`flex min-w-0 grow flex-col`,onClick:e=>{p||Z(R,k,e)},children:[(0,Y.jsx)(`span`,{className:`break-anywhere min-w-0 truncate font-semibold ${m?`text-lg`:`text-md`} ${p?``:`hover-underline`} dark:text-white`,"data-test-activity-heading":!0,children:f?(0,Y.jsx)(W,{className:`w-24`}):R.name}),(0,Y.jsxs)(`div`,{className:`flex w-full text-md text-gray-700 dark:text-gray-600`,children:[(0,Y.jsx)(`span`,{className:`truncate ${p?``:`hover-underline`}`,children:f?(0,Y.jsx)(W,{className:`w-56`}):q(R)}),(0,Y.jsx)(`div`,{className:`ml-1 before:mr-1 ${!f&&`before:content-["·"]`}`,title:`${b}`,children:f?(0,Y.jsx)(W,{className:`w-4`}):Hn(n,p===!1&&!n.authored)})]})]})]})}),(0,Y.jsx)(kn,{allowDelete:t,authoredByMe:B,disabled:p,followedByMe:z,layout:`feed`,trigger:be,onCopyLink:ue,onDelete:le,onFollow:ve,onUnfollow:ye})]}),(0,Y.jsx)(`div`,{className:`relative col-start-2 col-end-3 w-full gap-4 pl-[52px]`,children:(0,Y.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Y.jsx)(`div`,{className:``,children:n.type===`Article`?M?pe():(0,Y.jsxs)(`div`,{className:`rounded-md border border-gray-200 transition-colors hover:bg-gray-100 dark:border-gray-950 dark:hover:bg-gray-950`,children:[fe(L),(0,Y.jsxs)(`div`,{className:`p-5`,children:[(0,Y.jsx)(`div`,{className:`break-anywhere mb-1 line-clamp-2 text-lg leading-tight font-semibold tracking-tight text-pretty`,"data-test-activity-heading":!0,children:n.name}),(0,Y.jsx)(`div`,{className:`break-anywhere line-clamp-3 leading-[1.4em]`,children:n.preview?.content})]})]}):(0,Y.jsx)(`div`,{className:`relative`,children:he()})}),(0,Y.jsx)(`div`,{className:`space-between relative z-[30] mt-1 ml-[-8px] flex`,children:f?(0,Y.jsx)(W,{className:`ml-2 w-18`}):y&&(0,Y.jsx)(In,{actor:R,commentCount:s,disabled:p,layout:i,likeCount:l,object:n,repostCount:c,onLikeClick:ce})})]})})]})]}),(0,Y.jsx)(jn,{currentIndex:V.currentIndex,images:V.images,isOpen:V.isOpen,onClose:Se,onNavigate:U})]}):i===`modal`?(0,Y.jsxs)(Y.Fragment,{children:[n&&(0,Y.jsxs)(`div`,{"data-object-id":n.id,children:[(0,Y.jsxs)(`div`,{className:`group/article relative`,"data-layout":`modal`,onClick:L,children:[(0,Y.jsxs)(`div`,{className:`z-10 -my-1 grid grid-cols-[auto_1fr] grid-rows-[auto_1fr] gap-3 pt-4 pb-3`,"data-test-activity":!0,children:[u&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{className:`relative z-10 pt-[3px]`,children:(0,Y.jsx)(K,{author:R,showFollowButton:!B&&!z})}),(0,Y.jsxs)(`div`,{className:`relative z-10 flex w-full min-w-0 cursor-pointer flex-col overflow-visible text-[1.5rem]`,onClick:e=>{p||Z(R,k,e)},children:[(0,Y.jsxs)(`div`,{className:`flex w-full`,children:[(0,Y.jsx)(`span`,{className:`break-anywhere min-w-0 truncate font-semibold whitespace-nowrap after:mx-1 after:font-normal after:text-gray-700 after:content-["·"] after:dark:text-gray-600`,"data-test-activity-heading":!0,children:R.name}),(0,Y.jsx)(`div`,{children:Hn(n,!n.authored)})]}),(0,Y.jsx)(`div`,{className:`flex w-full`,children:(0,Y.jsx)(`span`,{className:`min-w-0 truncate text-gray-700 dark:text-gray-600`,children:q(R)})})]})]}),(0,Y.jsx)(`div`,{className:`relative z-10 col-start-1 col-end-3 w-full gap-4`,children:(0,Y.jsxs)(`div`,{className:`flex flex-col items-start`,children:[he({contentClassName:`ap-note-content-large break-anywhere text-[1.6rem] tracking-[-0.011em] text-pretty text-gray-900 dark:text-gray-300 [&_p+p]:mt-3`,showName:!0}),(0,Y.jsx)(`div`,{className:`space-between mt-3 ml-[-8px] flex`,children:y&&(0,Y.jsx)(In,{actor:R,commentCount:s,layout:i,likeCount:l,object:n,repostCount:c,onLikeClick:ce})})]})})]}),(0,Y.jsx)(`div`,{className:`absolute -inset-x-3 -inset-y-0 z-0 rounded transition-colors max-lg:hidden`})]}),(0,Y.jsx)(`div`,{className:`mt-3 h-px bg-gray-200 dark:bg-gray-950`})]}),(0,Y.jsx)(jn,{currentIndex:V.currentIndex,images:V.images,isOpen:V.isOpen,onClose:Se,onNavigate:U})]}):i===`reply`?(0,Y.jsxs)(Y.Fragment,{children:[n&&(0,Y.jsxs)(`div`,{className:`group/article relative ${m?`pb-6`:h?`pb-5`:`py-5`} ${p?`pointer-events-none`:`cursor-pointer`}`,"data-layout":`reply`,"data-object-id":n.id,onClick:L,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2.5 border-b-gray-200`,"data-test-activity":!0,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Y.jsx)(X,{actor:R,isCurrentUser:B,children:(0,Y.jsxs)(`div`,{className:`flex min-w-0 grow items-center gap-3`,children:[(0,Y.jsx)(K,{author:R,disabled:p,showFollowButton:!B&&!z}),(0,Y.jsxs)(`div`,{className:`flex min-w-0 grow flex-col`,onClick:e=>{p||Z(R,k,e)},children:[(0,Y.jsxs)(`div`,{className:`flex`,children:[(0,Y.jsx)(`span`,{className:`break-anywhere min-w-0 truncate font-semibold whitespace-nowrap text-black after:mx-1 after:font-normal after:text-gray-700 after:content-["·"] dark:text-white`,"data-test-activity-heading":!0,children:R.name}),(0,Y.jsx)(`div`,{children:Hn(n,p===!1&&!n.authored)})]}),(0,Y.jsx)(`div`,{className:`flex`,children:(0,Y.jsx)(`span`,{className:`truncate text-gray-700`,children:q(R)})})]})]})}),!m&&(0,Y.jsx)(kn,{allowDelete:t,authoredByMe:B,disabled:p,followedByMe:z,layout:`reply`,trigger:be,onCopyLink:ue,onDelete:le,onFollow:ve,onUnfollow:ye})]}),(0,Y.jsx)(`div`,{className:`relative z-10 col-start-2 col-end-3 w-full gap-4 pl-[52px]`,children:(0,Y.jsxs)(`div`,{className:`flex flex-col items-start`,children:[M?pe():(0,Y.jsxs)(Y.Fragment,{children:[n.type===`Article`&&fe(L),n.name&&(0,Y.jsx)(A,{className:`break-anywhere mt-2.5 leading-tight text-pretty`,"data-test-activity-heading":!0,children:n.name}),n.preview&&n.type===`Article`?(0,Y.jsx)(`div`,{className:`mt-1 line-clamp-3 leading-tight`,children:n.preview.content}):(0,Y.jsx)(`div`,{dangerouslySetInnerHTML:{__html:it(rt(n.content||``)??``)},ref:T,className:`ap-note-content break-anywhere tracking-[-0.006em] text-pretty text-gray-900 dark:text-gray-300 [&_p+p]:mt-3`}),n.type===`Note`&&fe(xe),n.type===`Article`&&(0,Y.jsx)(H,{className:`mt-3 w-full`,id:`read-more`,variant:`secondary`,children:`Read more`})]}),!m&&(0,Y.jsx)(`div`,{className:`space-between mt-2 ml-[-8px] flex`,children:y&&(0,Y.jsx)(In,{actor:R,commentCount:s,disabled:p,layout:i,likeCount:l,object:n,repostCount:c,onLikeClick:ce})})]})})]}),!d&&(0,Y.jsx)(`div`,{className:`absolute left-[19px] ${m?`top-[51px] bottom-[8px]`:h?`top-[51px] bottom-[5px]`:g?`top-[71px] bottom-[5px]`:`top-[71px] bottom-[-7px]`} z-0 w-[2px] rounded-sm bg-gray-200 dark:bg-gray-950`})]}),(0,Y.jsx)(jn,{currentIndex:V.currentIndex,images:V.images,isOpen:V.isOpen,onClose:Se,onNavigate:U})]}):i===`inbox`?(0,Y.jsx)(Y.Fragment,{children:n&&(0,Y.jsxs)(`div`,{className:`group/article @container/inbox-item relative -mx-4 -my-px flex min-h-[112px] min-w-0 cursor-pointer items-center justify-between rounded-lg p-6 hover:bg-gray-100 dark:hover:bg-gray-950/50`,"data-layout":`inbox`,"data-object-id":n.id,onClick:L,children:[(0,Y.jsxs)(`div`,{className:`w-full min-w-0`,children:[(0,Y.jsx)(`div`,{className:`z-10 mb-1.5 flex w-full min-w-0 items-center gap-1.5 text-sm group-hover/article:border-transparent`,children:f?(0,Y.jsx)(W,{className:`w-24`}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(X,{actor:R,isCurrentUser:B,children:(0,Y.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Y.jsx)(K,{author:R,size:`2xs`}),(0,Y.jsx)(`span`,{className:`min-w-0 truncate font-semibold text-gray-900 hover:underline dark:text-gray-600`,"data-test-activity-heading":!0,onClick:e=>{Z(R,k,e)},children:R.name})]})}),o===`Announce`&&(0,Y.jsxs)(`span`,{className:`z-10 flex items-center gap-1 text-gray-700 dark:text-gray-600`,children:[Xn,(0,Y.jsx)(X,{actor:e,align:`center`,isCurrentUser:_e,children:(0,Y.jsx)(`span`,{className:`line-clamp-1 hover:underline`,onClick:t=>{Z(e,k,t)},children:e.name})}),` `,`reposted`]}),(0,Y.jsx)(`span`,{className:`shrink-0 whitespace-nowrap text-gray-600 before:mr-1 before:content-["·"]`,title:`${b}`,children:Hn(n,!n.authored)})]})}),(0,Y.jsxs)(`div`,{className:`flex`,children:[(0,Y.jsx)(`div`,{className:`flex min-h-[73px] w-full min-w-0 flex-col items-start justify-start gap-1`,children:M?pe():(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(A,{className:`break-anywhere line-clamp-2 w-full max-w-[600px] leading-tight text-pretty`,"data-test-activity-heading":!0,children:f?(0,Y.jsx)(W,{className:`w-full max-w-96`}):n.name?n.name:(0,Y.jsx)(`span`,{dangerouslySetInnerHTML:{__html:it(at(n.content||``))}})}),(0,Y.jsx)(`div`,{className:`ap-note-content break-anywhere line-clamp-2 w-full max-w-[600px] text-base leading-normal text-pretty text-gray-900 dark:text-gray-300 [&_p+p]:mt-3`,children:f?(0,Y.jsx)(W,{count:2}):(0,Y.jsx)(`div`,{dangerouslySetInnerHTML:{__html:it(at(n.preview?.content??n.content??``))}})}),(0,Y.jsx)(`span`,{className:`mt-1 shrink-0 text-sm leading-none whitespace-nowrap text-gray-600`,children:f?(0,Y.jsx)(W,{className:`w-16`}):n.content&&`${Ln(n.content)}`})]})}),(0,Y.jsxs)(`div`,{className:`invisible absolute top-8 right-3 z-[49] flex -translate-y-1/2 rounded-lg bg-white p-1 shadow-md group-hover/article:visible dark:bg-black`,children:[y&&(0,Y.jsx)(In,{actor:R,commentCount:s,layout:i,likeCount:l,object:n,repostCount:c,onLikeClick:ce}),(0,Y.jsx)(kn,{allowDelete:t,authoredByMe:B,followedByMe:z,layout:`inbox`,trigger:be,onCopyLink:ue,onDelete:le,onFollow:ve,onUnfollow:ye})]})]})]}),M?null:N?(0,Y.jsx)(Gn,{className:`ml-8 hidden h-[91px] w-[121px] shrink-0 md:ml-9 @md/inbox-item:flex`,size:`compact`,onReveal:F}):Jn(n,f)]})}):(0,Y.jsx)(Y.Fragment,{})},Qn=5*1024*1024,$n=`Image must be less than 5MB in size.`,er=async e=>{try{let t=await fetch(e,{mode:`cors`});if(!t.ok)throw Error(`Failed to fetch image: ${t.status}`);let n=await t.blob();return new Promise((e,t)=>{let r=new FileReader;r.onload=()=>e(r.result),r.onerror=t,r.readAsDataURL(n)})}catch{return e}},tr=e=>new Promise(t=>{let n=new Image;n.onload=()=>{URL.revokeObjectURL(n.src),t(n.width===n.height)},n.src=URL.createObjectURL(e)}),nr=`Image must be square.`,rr=({children:e,replyTo:t,onReply:n,onReplyError:r,onOpenChange:i,...o})=>{let{data:s}=ht(`index`),c=mt(`index`,s),l=ot(`index`,s),{data:u,isLoading:d}=gt(`index`,`me`),[f,p]=(0,J.useState)(!1),m=(0,J.useRef)(null),h=(0,J.useRef)(null),[g,_]=(0,J.useState)(null),[v,y]=(0,J.useState)(!1),b=(0,J.useRef)(null),[x,S]=(0,J.useState)(``),[C,w]=(0,J.useState)(null),[T,E]=(0,J.useState)(``),[D,O]=(0,J.useState)(!1),[k,A]=(0,J.useState)(!1),[j,M]=(0,J.useState)(!1),N=G();(0,J.useEffect)(()=>{o.open!==void 0&&p(o.open)},[o.open]),(0,J.useEffect)(()=>{if(o.open===void 0?f:o.open){let e=setTimeout(()=>{M(!0)},300);return()=>clearTimeout(e)}else M(!1)},[f,o.open]);let ee=!x.trim()||!s||k||x.length>500,te=(0,J.useCallback)(async()=>{let e=x.trim();if(!(!e||!s))try{A(!0),t?(await l.mutateAsync({inReplyTo:t.object.id,content:e,imageUrl:C||void 0,altText:T||void 0}),n?.()):(await c.mutateAsync({content:e,imageUrl:C||void 0,altText:T||void 0}),N(`/notes`)),p(!1),i&&i(!1),a.success(t?`Reply posted`:`Note posted`)}catch{t&&r?.()}finally{A(!1)}},[x,s,t,l,c,C,T,n,r,p,N,i]),ne=e=>{S(e.target.value)};(0,J.useEffect)(()=>{m.current&&(m.current.style.height=`auto`,m.current.style.height=`${m.current.scrollHeight}px`)},[x]),(0,J.useEffect)(()=>{if((o.open===void 0?f:o.open)&&m.current){let e=setTimeout(()=>{m.current?.focus()},100);return()=>clearTimeout(e)}},[f,o.open]),(0,J.useEffect)(()=>{if(D&&h.current){let e=setTimeout(()=>{h.current?.focus()},100);return()=>clearTimeout(e)}},[D]),(0,J.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),!ee&&!v&&te())};if(o.open===void 0?f:o.open)return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[f,o.open,ee,v,te]);let P=(0,J.useCallback)(async e=>{let t=e.clipboardData?.items;if(t)for(let n=0;n<t.length;n++){let r=t[n];if(r.type.indexOf(`image`)!==-1){e.preventDefault();let t=r.getAsFile();if(t){if(t.size>5242880){a.error($n);return}let e=URL.createObjectURL(t);_(e),await F(t)}break}}},[]);(0,J.useEffect)(()=>{if(o.open===void 0?f:o.open)return document.addEventListener(`paste`,P),()=>document.removeEventListener(`paste`,P)},[f,o.open,P]);let F=async e=>{try{y(!0);let t=await bt(e);w(t)}catch(e){_(null);let t=`Failed to upload image. Try again.`;if(e&&typeof e==`object`&&`statusCode`in e)switch(e.statusCode){case 413:t=`Image size exceeds limit.`;break;case 415:t=`The file type is not supported.`;break;default:}a.error(t)}finally{y(!1)}},ie=async e=>{let t=e.target.files;if(t&&t.length>0){let n=t[0];if(n.size>5242880){a.error($n),e.target.value=``;return}let r=URL.createObjectURL(n);_(r),await F(n)}},I=e=>{e.stopPropagation(),_(null),w(null),E(``),O(!1),g&&URL.revokeObjectURL(g),b.current&&(b.current.value=``)},ae=e=>{e.stopPropagation(),O(!D)},oe=()=>{m.current?.focus()};(0,J.useEffect)(()=>()=>{g&&URL.revokeObjectURL(g)},[g]);let se=`What's new?`;if(t){let e=t.object.attributedTo||{};typeof e==`object`&&`preferredUsername`in e&&`id`in e&&(se=`Reply to ${q(e)}...`)}return(0,Y.jsxs)(Ue,{open:o.open===void 0?f:o.open,onOpenChange:e=>{e&&(S(``),_(null),w(null),E(``),O(!1),g&&URL.revokeObjectURL(g),b.current&&(b.current.value=``)),p(e),i&&i(e)},...o.open===void 0?o:{},children:[(0,Y.jsx)(Le,{asChild:!0,children:e}),(0,Y.jsxs)(Ve,{className:`max-h-[80vh] min-h-[240px] gap-0 overflow-y-auto pb-0`,"data-testid":`new-note-modal`,onClick:e=>e.stopPropagation(),children:[(0,Y.jsxs)(Be,{className:`hidden`,children:[(0,Y.jsx)(He,{children:t?`Reply`:`New note`}),(0,Y.jsx)(Re,{children:`Post your thoughts to the Social web`})]}),t&&(0,Y.jsx)(Zn,{actor:t.actor,allowDelete:!1,commentCount:t.object.replyCount??0,isCompact:!0,layout:`reply`,likeCount:t.object.likeCount??0,object:t.object,repostCount:t.object.repostCount??0,type:t.object.type===`Article`?`Article`:`Note`,onClick:()=>{}}),(0,Y.jsxs)(`div`,{className:`flex ${g?``:`min-h-36`} cursor-text items-start gap-3`,onClick:oe,children:[(0,Y.jsx)(`div`,{className:`sticky top-0`,children:(0,Y.jsx)(K,{author:s})}),(0,Y.jsx)(En,{asChild:!0,children:(0,Y.jsxs)(`div`,{className:`-mt-0.5 flex w-full flex-col gap-0.5`,children:[d?(0,Y.jsx)(W,{className:`w-10`}):(0,Y.jsx)(`span`,{className:`break-anywhere min-w-0 truncate font-semibold whitespace-nowrap text-black dark:text-white`,children:u?.name}),(0,Y.jsx)(Dn,{name:`content`,asChild:!0,children:(0,Y.jsx)(On,{asChild:!0,children:(0,Y.jsx)(`textarea`,{ref:m,autoFocus:!0,className:`ap-textarea break-anywhere w-full resize-none bg-transparent text-[1.5rem] dark:placeholder:text-gray-700`,"data-testid":`note-textarea`,placeholder:se,rows:1,value:x,onChange:ne,onPaste:P})})}),(0,Y.jsx)(Dn,{name:`image`,asChild:!0,children:(0,Y.jsx)(On,{asChild:!0,children:(0,Y.jsx)(`input`,{ref:b,accept:`image/jpeg,image/png,image/webp,image/gif`,className:`hidden`,type:`file`,onChange:ie})})})]})})]}),g&&(0,Y.jsxs)(`div`,{className:`group relative mt-6 flex min-h-[200px] w-full items-center justify-center`,children:[(0,Y.jsx)(`img`,{alt:`Image attachment preview`,className:`max-h-[320px] w-full rounded-sm object-cover outline-1 -outline-offset-1 outline-black/10 ${v&&`opacity-10`}`,src:g}),v&&(0,Y.jsx)(`div`,{className:`absolute leading-[0]`,children:(0,Y.jsx)($e,{size:`md`})}),(0,Y.jsx)(H,{className:`absolute top-3 right-3 size-8 bg-black/60 text-white opacity-0 group-hover:opacity-100 hover:bg-black/80`,onClick:I,children:(0,Y.jsx)(re,{})}),!v&&(0,Y.jsx)(H,{className:`absolute bottom-3 left-3 h-6 px-2 py-0 text-white ${D?`bg-green-500 hover:bg-green-500`:`bg-black/60 hover:bg-black/80`}`,onClick:ae,children:`Alt`})]}),g&&!v&&D&&(0,Y.jsx)(`div`,{className:`mt-1`,children:(0,Y.jsx)(Qe,{ref:h,className:`w-full border-0 bg-transparent px-0 focus-visible:border-0 focus-visible:bg-transparent focus-visible:shadow-none focus-visible:outline-0 dark:bg-(--color-popover) dark:text-white dark:placeholder:text-gray-800`,placeholder:`Type alt text for image (optional)`,type:`text`,value:T,onChange:e=>E(e.target.value)})}),(0,Y.jsxs)(Ie,{className:`${j?`sticky`:`static`} bottom-0 flex-row bg-background py-6 dark:bg-surface-elevated-2`,children:[(0,Y.jsx)(H,{className:`mr-auto w-[34px] min-w-0!`,variant:`outline`,onClick:()=>b.current?.click(),children:(0,Y.jsx)(pe,{})}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Y.jsxs)(`div`,{className:`text-sm ${x.length>=500?`text-red-500`:x.length>=500*.9?`text-yellow-600`:`text-gray-500`}`,children:[x.length,`/`,500]}),(0,Y.jsx)(H,{className:`min-w-16`,"data-testid":`post-button`,disabled:ee||v,onClick:te,children:k?(0,Y.jsx)($e,{color:`light`,size:`sm`}):`Post`})]})]})]})]})},ir=()=>{let e=G();function t(){e(`/notes/https%3A%2F%2Factivitypub.ghost.org%2F.ghost%2Factivitypub%2Fnote%2F6d6d7f57-b656-4caa-ba9e-efa1d9a4b3fb`)}return(0,Y.jsxs)(`div`,{className:`z-20 w-full bg-white dark:bg-background`,children:[(0,Y.jsxs)(`div`,{className:`flex w-full flex-col gap-0.5 border-t border-gray-200 bg-white px-3 pt-6 dark:border-gray-950 dark:bg-background`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(ie,{className:`text-purple-500`,size:20,strokeWidth:1.5}),(0,Y.jsx)(A,{children:`Beta feedback`})]}),(0,Y.jsx)(`span`,{className:`text-sm text-gray-700 dark:text-gray-600`,children:`Something not working? Let us know`}),(0,Y.jsx)(H,{className:`mt-2 dark:bg-gray-950/70 dark:hover:bg-gray-900`,variant:`secondary`,onClick:t,children:`Send feedback`})]}),(0,Y.jsxs)(`div`,{className:`-mb-1 ml-3 flex items-center gap-1.5 pt-4 pb-2 text-xs text-gray-400`,children:[(0,Y.jsx)(`a`,{className:`text-xs font-medium text-gray-700 hover:text-black dark:text-gray-600 dark:hover:text-white`,href:`https://ghost.org/help/social-web/`,rel:`noreferrer`,target:`_blank`,children:`Help`}),`⋅`,(0,Y.jsx)(`a`,{className:`text-xs font-medium text-gray-700 hover:text-black dark:text-gray-600 dark:hover:text-white`,href:`https://activitypub.ghost.org/archive`,rel:`noreferrer`,target:`_blank`,children:`Updates`})]})]})},ar=({children:e,url:t=null,onClick:n,"data-testid":r,isSelected:i=!1})=>{let a=J.Children.toArray(e),o=(0,Y.jsx)(`div`,{className:`relative flex w-full max-w-[620px] cursor-pointer flex-col before:absolute before:inset-x-[-16px] before:inset-y-[-1px] before:rounded-md before:bg-gray-50 before:transition-opacity hover:z-10 hover:cursor-pointer hover:border-b-transparent hover:before:opacity-100 dark:before:bg-gray-950 ${i?`z-10 before:opacity-100`:`before:opacity-0`}`,"data-testid":r,onClick:()=>{!t&&n&&n()},children:(0,Y.jsxs)(`div`,{className:`relative z-10 flex w-full items-center gap-3 py-3`,children:[a[0],a[1],a[2]]})});return t?(0,Y.jsx)(`a`,{href:t,rel:`noreferrer`,target:`_blank`,onClick:e=>{n&&(e.preventDefault(),n())},children:o}):o},or=()=>{let e=G(),{suggestedProfilesQuery:t}=ft(`index`,3),{data:n,isLoading:r}=t,i=r?[,,,].fill(null):n||[],{resetStack:a}=_();return!r&&(!n||n.length===0)?null:(0,Y.jsxs)(`div`,{className:`border-t border-gray-200 px-3 pt-6 dark:border-gray-950 [@media(max-height:740px)]:hidden`,children:[(0,Y.jsxs)(`div`,{className:`mb-3 flex flex-col gap-0.5`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(U,{className:`text-purple-500`,size:20,strokeWidth:1.5}),(0,Y.jsx)(A,{children:`Follow suggestions`})]}),(0,Y.jsx)(`span`,{className:`text-sm text-gray-700 dark:text-gray-600`,children:`Accounts you might be interested in`})]}),(0,Y.jsx)(`ul`,{className:`grow`,children:i.map((t,n)=>{let i=t?.id||`loading-${n}`,a=t?.name||``,o=t?.handle||``,s=t?.avatarUrl||``,c;switch(n){case 0:c=`[@media(max-height:740px)]:hidden`;break;case 1:c=`[@media(max-height:800px)]:hidden`;break;case 2:c=`[@media(max-height:860px)]:hidden`;break}return(0,Y.jsx)(J.Fragment,{children:(0,Y.jsx)(`li`,{className:c,children:(0,Y.jsx)(X,{actor:t,align:`center`,isCurrentUser:!1,side:`left`,children:(0,Y.jsx)(`div`,{children:(0,Y.jsxs)(ar,{onClick:()=>{!r&&t&&Z(t,e)},children:[r?(0,Y.jsx)(W,{className:`z-10 size-10`}):(0,Y.jsx)(K,{author:{icon:{url:s},name:a,handle:o},showFollowButton:!0}),(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,Y.jsx)(`span`,{className:`block max-w-[190px] truncate font-semibold text-black dark:text-white`,children:r?(0,Y.jsx)(W,{className:`w-24`}):a}),(0,Y.jsx)(`span`,{className:`block max-w-[190px] truncate text-sm text-gray-700 dark:text-gray-600`,children:r?(0,Y.jsx)(W,{className:`w-40`}):o})]})]})})})},i)},i)})}),(0,Y.jsx)(H,{className:`p-0 font-medium text-purple hover:text-black dark:hover:text-white`,variant:`link`,onClick:()=>{a(),e(`/explore`)},children:`Find more →`})]})},sr=({profile:e,update:t,isLoading:n,onOpenChange:r})=>{let i=()=>{t(e.id,{followedByMe:!0})},a=()=>{t(e.id,{followedByMe:!1})},o=G();return(0,Y.jsx)(X,{actor:e,align:`center`,isCurrentUser:!1,side:`left`,children:(0,Y.jsx)(`div`,{children:(0,Y.jsxs)(ar,{onClick:()=>{r?.(!1),o(`/profile/${e.handle}`)},children:[(0,Y.jsx)(K,{author:{icon:{url:e.avatarUrl},name:e.name,handle:e.handle},onClick:()=>r?.(!1)}),(0,Y.jsxs)(`div`,{className:`break-anywhere flex grow flex-col`,children:[(0,Y.jsx)(`span`,{className:`line-clamp-1 font-semibold text-black dark:text-white`,children:n?(0,Y.jsx)(W,{className:`w-full max-w-64`}):e.name}),(0,Y.jsx)(`span`,{className:`line-clamp-1 text-sm text-gray-700 dark:text-gray-600`,children:n?(0,Y.jsx)(W,{className:`w-24`}):e.handle})]}),n?(0,Y.jsx)(`div`,{className:`inline-flex items-center`,children:(0,Y.jsx)(W,{className:`w-12`})}):(0,Y.jsx)(Nn,{className:`ml-auto`,following:e.followedByMe,handle:e.handle,type:`secondary`,onFollow:i,onUnfollow:a})]},e.id)})})},cr=({onOpenChange:e})=>{let{suggestedProfilesQuery:t,updateSuggestedProfile:n}=ft(`index`,5),{data:r=[],isLoading:i}=t;return!i&&(!r||r.length===0)?null:(0,Y.jsx)(`div`,{className:`mb-[-15px] flex flex-col gap-3 pt-2`,children:(0,Y.jsx)(`div`,{className:`flex flex-col`,children:(i?[,,,,,].fill(null):r||[]).map((t,r)=>(0,Y.jsx)(J.Fragment,{children:(0,Y.jsx)(sr,{isLoading:i,profile:t||{id:``,name:``,handle:``,avatarUrl:``,bio:``,followerCount:0,followingCount:0,followedByMe:!1},update:n,onOpenChange:e})},t?.id||`loading-${r}`))})})},lr=80,ur=({onOpenChange:e,query:t,setQuery:n})=>{let r=(0,J.useRef)(null),i=(0,J.useRef)([]),a=(0,J.useRef)(0),o=G(),[s]=Et(t,300),c=t.length>=2,{searchQuery:l,updateAccountSearchResult:u}=dt(`index`,c?s:``),{data:d,isFetching:f,isFetched:p}=l,{suggestedProfilesQuery:m}=ft(`index`,5),{data:h,isLoading:g}=m,_=g||h&&h.length>0,{topicsQuery:v}=lt(),{data:y}=v,{data:b}=gt(`index`,`me`),[x,S]=(0,J.useState)([]),[C,w]=(0,J.useState)(null),[T,E]=(0,J.useState)(0),D=(0,J.useMemo)(()=>{let e=y?.topics||[];if(!c||e.length===0)return[];let n=t.toLowerCase();return e.filter(e=>e.slug===`following`?!1:e.name.toLowerCase().startsWith(n)||e.slug.toLowerCase().startsWith(n))},[t,c,y?.topics]),O=(0,J.useMemo)(()=>[...D.map(e=>({type:`topic`,data:e})),...x.map(e=>({type:`account`,data:e}))],[D,x]);(0,J.useEffect)(()=>{if(!c){S([]),w(null);return}p&&(d?.accounts&&d.accounts.length>0?(S(d.accounts),w(`results`),E(0)):(S([]),w(`none`),E(0)))},[d?.accounts,p,c]);let k=f&&c,j=t.length<2||!C&&c&&D.length===0,M=!j&&C===`none`&&D.length===0,N=!j&&(x.length>0||D.length>0);return(0,J.useEffect)(()=>{r.current?.focus()},[]),(0,J.useEffect)(()=>{let e=i.current[T];if(!e)return;let t=e.closest(`[data-radix-scroll-area-viewport]`)||e.closest(`.overflow-y-auto`);if(!t){e.scrollIntoView({block:`nearest`});return}let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();r.top<n.top+lr?t.scrollTo({top:t.scrollTop-(n.top+lr-r.top),behavior:`smooth`}):r.bottom>n.bottom-lr&&t.scrollTo({top:t.scrollTop+(r.bottom-n.bottom+lr),behavior:`smooth`})},[T]),(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`div`,{className:`sticky -top-6 z-30 -mt-6 flex h-[72px] shrink-0 items-center gap-2 bg-white pt-3 pb-2 before:pointer-events-none before:absolute before:-inset-x-6 before:bottom-0 before:h-0 before:border-b before:border-b-gray-200 before:content-[""] dark:bg-surface-elevated-2 dark:before:border-b-gray-950`,children:[(0,Y.jsx)(_e,{className:`text-gray-600`,size:18,strokeWidth:1.5}),(0,Y.jsx)(Qe,{ref:r,autoComplete:`off`,className:`flex h-10 w-full items-center rounded-lg border-0 bg-transparent px-0 py-1.5 text-lg !shadow-none !outline-none focus-visible:!border-0 focus-visible:bg-transparent focus-visible:!shadow-none focus-visible:!ring-0 focus-visible:!outline-0 dark:bg-surface-elevated-2 dark:text-white dark:placeholder:text-gray-800`,placeholder:`Search by name, handle, or URL...`,title:`Search`,type:`text`,value:t,onChange:e=>n(e.target.value),onKeyDown:t=>{if(!(!N||O.length===0)){if(t.key===`ArrowDown`||t.key===`ArrowUp`){t.preventDefault();let e=Date.now();if(e-a.current<50)return;a.current=e,t.key===`ArrowDown`?E(e=>(e+1)%O.length):E(e=>(e-1+O.length)%O.length)}else if(t.key===`Enter`){let n=O[T];if(!n)return;t.preventDefault(),e?.(!1),n.type===`topic`?o(`/explore/${n.data.slug}`):o(`/profile/${n.data.handle}`)}}}}),k&&(0,Y.jsx)($e,{className:`absolute! right-0 mr-0.5 shrink-0`,size:`sm`})]}),(0,Y.jsxs)(`div`,{className:`h-full`,children:[M&&(0,Y.jsx)(`div`,{className:`flex h-full items-center justify-center pb-14`,children:(0,Y.jsxs)(tt,{children:[(0,Y.jsx)(et,{children:(0,Y.jsx)(fe,{})}),`No users matching this handle or account URL`]})}),N&&(0,Y.jsx)(`div`,{className:`mt-[-14px] pb-2`,children:O.map((t,n)=>{let r=n===T;if(t.type===`topic`)return(0,Y.jsx)(`div`,{ref:e=>i.current[n]=e,children:(0,Y.jsxs)(ar,{isSelected:r,onClick:()=>{e?.(!1),o(`/explore/${t.data.slug}`)},children:[(0,Y.jsx)(`div`,{className:`flex size-10 shrink-0 items-center justify-center rounded-full bg-gray-100 dark:bg-gray-900`,children:(0,Y.jsx)(U,{className:`text-gray-700 dark:text-gray-500`,size:18,strokeWidth:1.5})}),(0,Y.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Y.jsx)(`span`,{className:`font-semibold text-black dark:text-white`,children:t.data.name}),(0,Y.jsx)(`span`,{className:`text-sm text-gray-700 dark:text-gray-600`,children:`Topic`})]})]})},t.data.slug);let a=t.data,s=a.handle===b?.handle;return(0,Y.jsx)(X,{actor:a,align:`center`,isCurrentUser:s,side:`left`,children:(0,Y.jsx)(`div`,{ref:e=>i.current[n]=e,children:(0,Y.jsxs)(ar,{isSelected:r,onClick:()=>{e?.(!1),o(`/profile/${a.handle}`)},children:[(0,Y.jsx)(K,{author:{icon:{url:a.avatarUrl},name:a.name,handle:a.handle}}),(0,Y.jsxs)(`div`,{className:`break-anywhere flex flex-col`,children:[(0,Y.jsx)(`span`,{className:`line-clamp-1 font-semibold text-black dark:text-white`,children:a.name}),(0,Y.jsx)(`span`,{className:`line-clamp-1 text-sm text-gray-700 dark:text-gray-600`,children:a.handle})]}),a.blockedByMe||a.domainBlockedByMe?(0,Y.jsx)(H,{className:`pointer-events-none ml-auto min-w-[90px]`,variant:`destructive`,children:`Blocked`}):s?null:(0,Y.jsx)(Nn,{className:`ml-auto`,following:a.followedByMe,handle:a.handle,type:`secondary`,onFollow:()=>u(a.id,{followedByMe:!0}),onUnfollow:()=>u(a.id,{followedByMe:!1})})]})})},a.id)})}),j&&_&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(A,{children:`More people to follow`}),(0,Y.jsx)(cr,{onOpenChange:e})]})]})]})},dr=()=>(0,Y.jsxs)(`div`,{className:`inline-flex h-9 w-full items-center justify-start gap-2 rounded-full bg-gray-100 px-3 font-normal text-gray-600 hover:bg-gray-200 hover:text-gray-600 dark:bg-gray-950/70 dark:text-gray-700 dark:hover:bg-gray-950 [&_svg]:size-[18px]`,children:[(0,Y.jsx)(_e,{size:18,strokeWidth:1.5}),` Search the social web`]}),$=J.forwardRef(({to:e,children:t,count:n,...r},i)=>{let a=f(),{resetStack:o}=_(),s=nt(),c=e&&e.startsWith(`/`)?`${s}${e}`:e,l=S(`h-8 justify-start font-medium text-gray-800 dark:text-gray-500 dark:hover:bg-gray-950/70 [&_svg]:size-[18px]`,c&&(a.pathname===c||a.pathname.startsWith(`${c}/`))&&`bg-gray-100 font-semibold text-black dark:bg-gray-950/70 dark:text-white`),d=n&&n>0?(0,Y.jsx)(`span`,{className:S(`ml-auto flex h-5 min-w-[20px] items-center justify-center rounded-full bg-purple-500 px-1.5 py-1 text-xs font-semibold text-white`),children:x(n)}):null;return c?(0,Y.jsx)(H,{className:l,shape:`rounded`,variant:`ghost`,asChild:!0,children:(0,Y.jsxs)(u,{to:c,onClick:()=>{o(),m(c)},children:[t,d]})}):(0,Y.jsxs)(H,{ref:i,className:l,shape:`rounded`,variant:`ghost`,onClick:r.onClick,...r,children:[t,d]})});$.displayName=`SidebarMenuLink`;var fr=({isMobileSidebarOpen:e})=>{let{allFlags:t,flags:n}=Pt(),[i,a]=J.useState(!1),[o,s]=J.useState(``),{data:c}=r(),l=f(),u=nt(),{data:d}=st(c?.slug||``),p=ut(c?.slug||``),{topicsQuery:m}=lt(),{data:h,isLoading:g}=m,_=!g&&h&&h.topics.length===0;J.useEffect(()=>{l.pathname===`${u}/notifications`&&d&&d>0&&p.mutate()},[l.pathname,u,d,p]);let v=J.useCallback(()=>{d&&d>0&&p.mutate()},[d,p]);return(0,Y.jsx)(`div`,{className:`sticky top-0 flex min-h-screen w-[320px] flex-col border-l border-gray-200 pr-[var(--network-gutter,1.5rem)] transition-transform duration-300 ease-in-out max-lg:fixed max-lg:inset-y-0 max-lg:right-0 max-lg:z-50 max-lg:border-0 max-lg:bg-white max-lg:shadow-xl max-md:bottom-[72px] max-md:min-h-[auto] max-md:overflow-y-scroll dark:border-gray-950 max-lg:dark:bg-black ${e?`max-lg:translate-x-0`:`max-lg:translate-x-full`}`,children:(0,Y.jsxs)(`div`,{className:`flex grow flex-col justify-between`,children:[(0,Y.jsxs)(`div`,{className:`isolate flex w-full flex-col items-start gap-6 pt-5 pl-6`,children:[(0,Y.jsx)(`div`,{className:`flex w-full items-center`,children:(0,Y.jsxs)(Ue,{open:i,onOpenChange:a,children:[(0,Y.jsx)(Le,{className:`mt-0.5 w-full`,children:(0,Y.jsx)(dr,{})}),(0,Y.jsx)(Ve,{className:`flex h-full max-h-[452px] flex-col overflow-y-auto pb-0`,children:(0,Y.jsx)(ur,{query:o,setQuery:s,onOpenChange:a})})]})}),(0,Y.jsxs)(`div`,{className:`flex w-full flex-col gap-px`,children:[(0,Y.jsxs)($,{to:`/reader`,children:[(0,Y.jsx)(L,{size:18,strokeWidth:1.5}),`Reader`]}),(0,Y.jsxs)($,{to:`/notes`,children:[(0,Y.jsx)(ce,{size:18,strokeWidth:1.5}),`Notes`]}),(0,Y.jsxs)($,{count:l.pathname===`${u}/notifications`?void 0:d,to:`/notifications`,onClick:v,children:[(0,Y.jsx)(le,{size:18,strokeWidth:1.5}),`Notifications`]}),_?(0,Y.jsx)(H,{className:`inline-flex w-full items-center gap-2 px-3 py-2.5 text-left font-medium text-gray-800 transition-colors hover:bg-gray-100 dark:text-gray-500 dark:hover:bg-gray-950/70`,shape:`rounded`,variant:`ghost`,asChild:!0,children:(0,Y.jsxs)(`a`,{href:`https://explore.ghost.org/social-web`,rel:`noopener noreferrer`,target:`_blank`,children:[(0,Y.jsx)(U,{size:18,strokeWidth:1.5}),`Explore`,(0,Y.jsx)(ae,{className:`ml-auto`,size:14,strokeWidth:1.5})]})}):(0,Y.jsxs)($,{to:`/explore`,children:[(0,Y.jsx)(U,{size:18,strokeWidth:1.5}),`Explore`]}),(0,Y.jsxs)($,{to:`/profile`,children:[(0,Y.jsx)(Se,{size:18,strokeWidth:1.5}),`Profile`]}),(0,Y.jsxs)($,{to:`/preferences`,children:[(0,Y.jsx)(ee,{size:18,strokeWidth:1.5}),`Preferences`]})]}),(0,Y.jsx)(rr,{children:(0,Y.jsxs)(H,{className:`h-9 rounded-full bg-purple-500 px-3 text-white hover:bg-purple-600 dark:hover:bg-purple-600`,children:[(0,Y.jsx)(R,{}),`New note`]})}),(0,Y.jsx)(or,{}),t.map(e=>n[e]?(0,Y.jsxs)(`div`,{className:`flex items-center justify-between gap-1 pl-3 opacity-50`,children:[(0,Y.jsx)(`span`,{className:`font-mono text-xs`,children:e}),(0,Y.jsx)(`span`,{className:`inline-flex items-center rounded bg-green-100 px-1 py-0.5 text-xs font-medium text-green-800`,children:`ON`})]},e):(0,Y.jsx)(Y.Fragment,{}))]}),(0,Y.jsx)(`div`,{className:`sticky bottom-0 flex items-center gap-2 bg-white pb-4 pl-4 dark:bg-background`,children:(0,Y.jsx)(ir,{})})]})})};fr.displayName=`Sidebar`;var pr=(0,J.createContext)(void 0),mr=pr.Provider,hr=()=>(0,J.useContext)(pr),gr=({children:e,className:t,style:n,...i})=>{let a=hr(),{isOnboarded:o}=wt(),s=nt(),{data:c,isLoading:l}=r(),u=(0,J.useRef)(null),[d,f]=(0,J.useState)(!1),p=Lt(),{topicsQuery:m}=lt(),{data:h}=m,_=h&&h.topics.length>0,{isNewNoteModalOpen:y,setIsNewNoteModalOpen:b}=Fn(),x=()=>{f(!d)},C=()=>{f(!1)};return l||!c?null:o?(0,Y.jsxs)(`div`,{ref:u,className:`h-screen w-full ${o&&`overflow-y-auto`}`,"data-scrollable-container":!0,children:[(0,Y.jsx)(g,{containerRef:u}),(0,Y.jsx)(`div`,{className:S(`relative mx-auto flex flex-col`,t,a?.contentClassName??`max-w-page`),style:{...n,"--network-gutter":a?.contentGutter},...i,children:o?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`div`,{className:`block grid-cols-[auto_320px] items-start lg:grid`,children:[(0,Y.jsxs)(`div`,{className:`z-0 min-w-0`,children:[(0,Y.jsx)(Bt,{showBorder:!(p===`reader`&&_)&&p!==`explore`,onToggleMobileSidebar:x}),(0,Y.jsx)(`div`,{className:p===`profile`?S(`px-2 pt-2`,a?.profileContentClassName):`px-[var(--network-gutter,min(4vw,24px))]`,children:e})]}),(0,Y.jsx)(fr,{isMobileSidebarOpen:d,onCloseMobileSidebar:C})]}),d&&(0,Y.jsx)(`div`,{className:`fixed inset-0 z-40 lg:hidden`,onClick:C})]}):(0,Y.jsx)(Tt,{})}),(0,Y.jsx)(rr,{open:y,onOpenChange:b})]}):(0,Y.jsx)(v,{to:`${s}/welcome`,replace:!0})},_r=({children:e})=>(0,Y.jsx)(`div`,{className:`flex max-h-12 max-w-12 grow-0 items-center justify-center rounded-full bg-gray-100 p-3 text-gray-700 dark:bg-gray-950/70 [&_svg]:size-8 [&_svg]:stroke-1`,children:e}),vr=({children:e,className:t})=>(0,Y.jsx)(`div`,{className:`mx-auto mt-[24vh] flex max-w-[500px] flex-col items-center gap-5 text-center text-gray-700 ${t||``}`,children:e}),yr=({statusCode:e,errorCode:t})=>{let n=c(),r=p();return n?(0,Y.jsx)(gr,{children:(0,Y.jsxs)(vr,{children:[(0,Y.jsx)(_r,{children:(0,Y.jsx)(xe,{})}),(0,Y.jsx)(A,{className:`-mb-4`,children:`Oops, page not found!`}),(0,Y.jsx)(`div`,{children:`We couldn't find the page you were looking for. It may have been moved, deleted, or never existed in the first place.`})]})}):e===429?(0,Y.jsxs)(vr,{className:`mt-[50vh] -translate-y-1/2`,children:[(0,Y.jsx)(_r,{children:(0,Y.jsx)(ne,{})}),(0,Y.jsx)(A,{className:`-mb-4`,children:`Rate limit exceeded`}),(0,Y.jsx)(`div`,{children:`You've made too many requests. Please try again in a moment.`}),(0,Y.jsx)(H,{asChild:!0,children:(0,Y.jsx)(`a`,{href:`https://ghost.org/help/social-web/`,rel:`noopener noreferrer`,target:`_blank`,children:`Learn more →`})})]}):e===403?t===`ROLE_MISSING`||t===`SITE_MISSING`?(0,Y.jsxs)(vr,{className:`mt-[50vh] -translate-y-1/2`,children:[(0,Y.jsx)(_r,{children:(0,Y.jsx)(se,{})}),(0,Y.jsx)(A,{className:`-mb-4`,children:`Site not configured correctly`}),(0,Y.jsx)(`div`,{children:`This feature can't be used because the site isn't set up correctly. If you manage this site, check your settings or server logs, or contact support.`}),(0,Y.jsx)(H,{asChild:!0,children:(0,Y.jsx)(`a`,{href:`https://ghost.org/help/social-web/`,rel:`noopener noreferrer`,target:`_blank`,children:`Learn more →`})})]}):(0,Y.jsxs)(vr,{className:`mt-[50vh] -translate-y-1/2`,children:[(0,Y.jsx)(_r,{children:(0,Y.jsx)(P,{})}),(0,Y.jsx)(A,{className:`-mb-4`,children:`Account suspended`}),(0,Y.jsx)(`div`,{children:`Your account has been suspended due to policy violations.`}),(0,Y.jsx)(H,{asChild:!0,children:(0,Y.jsx)(`a`,{href:`https://ghost.org/help/social-web/`,rel:`noopener noreferrer`,target:`_blank`,children:`Learn more →`})})]}):e===410&&t===`INVALID_VERSION`?(0,Y.jsxs)(vr,{className:`mt-[50vh] -translate-y-1/2`,children:[(0,Y.jsx)(_r,{children:(0,Y.jsx)(ue,{})}),(0,Y.jsx)(A,{className:`-mb-4`,children:`New version available`}),(0,Y.jsx)(`div`,{children:`We've made some updates! Refresh your page to see what's new`}),(0,Y.jsx)(H,{asChild:!0,children:(0,Y.jsx)(`button`,{type:`button`,onClick:()=>window.location.reload(),children:`Refresh your page`})})]}):(0,Y.jsx)(O,{align:`center`,className:`h-screen w-full bg-background`,gap:`none`,justify:`center`,children:(0,Y.jsxs)(O,{align:`start`,className:`max-w-xl rounded-[20px] bg-surface-elevated p-[5vmin] text-card-foreground shadow-lg`,gap:`lg`,children:[(0,Y.jsx)(`h1`,{className:`text-[2.9rem] leading-[1.3] font-bold tracking-[-0.021em]`,children:`Loading interrupted`}),(0,Y.jsx)(`p`,{children:`They say life is a series of trials and tribulations. This moment right here? It's a tribulation. Our app was supposed to load, and yet here we are. Loadless. Click back to the dashboard to try again.`}),(0,Y.jsx)(`a`,{className:`mt-2 cursor-pointer rounded-sm border border-current px-2.5 py-1.5 text-green`,onClick:e=>{e.preventDefault(),r(`/analytics/`,{crossApp:!0})},children:`← Back to the homepage`})]})})},br=e({default:()=>yr}),xr=[{path:`activitypub`,element:(0,Y.jsx)(l,{}),errorElement:(0,Y.jsx)(yr,{}),handle:`activitypub-basepath`,children:[{index:!0,element:(0,Y.jsx)(v,{to:`reader`})},{path:`inbox`,element:(0,Y.jsx)(v,{to:`../reader`,replace:!0})},{path:`feed`,element:(0,Y.jsx)(v,{to:`../notes`,replace:!0})},{path:`reader`,lazy:N(()=>o(()=>import(`./inbox-BkU3sg13.js`),__vite__mapDeps([2,1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60]),import.meta.url)),pageTitle:`Reader`},{path:`reader/:postId`,lazy:N(()=>o(()=>import(`./inbox-BkU3sg13.js`),__vite__mapDeps([2,1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60]),import.meta.url)),pageTitle:`Reader`},{path:`notes`,lazy:N(()=>o(()=>import(`./feed-B_TyFn9E.js`),__vite__mapDeps([61,1,3,62,8,9,10,35,14,21,22,23,4,5,6,7,11,12,13,24,25,26,28,29,30,31,32,33,34,36,37,38,39,40,17,16,41,42,15,19,20,43,44,45,46,47,48,49,18,27,50,51,52,53,54,55,56,57,58]),import.meta.url)),pageTitle:`Notes`},{path:`notes/:postId`,lazy:N(()=>o(()=>import(`./note-dqog4Bua.js`),__vite__mapDeps([63,1,3,4,5,6,7,8,9,10,11,12,13,14,21,22,23,24,25,26,60]),import.meta.url)),pageTitle:`Note`},{path:`notifications`,lazy:N(()=>o(()=>import(`./notifications-rcEVv-gx.js`),__vite__mapDeps([64,1,3,8,9,10,14,21,22,23,4,5,6,7,11,12,13,24,25,26,58]),import.meta.url)),pageTitle:`Notifications`},{path:`explore`,lazy:N(()=>o(()=>import(`./explore-C6V_JpUZ.js`),__vite__mapDeps([65,1,3,4,5,62,8,9,10,35,14,21,22,23,6,7,11,12,13,24,25,26,66,31,32,67,58,59]),import.meta.url)),pageTitle:`Explore`},{path:`explore/:topic`,lazy:N(()=>o(()=>import(`./explore-C6V_JpUZ.js`),__vite__mapDeps([65,1,3,4,5,62,8,9,10,35,14,21,22,23,6,7,11,12,13,24,25,26,66,31,32,67,58,59]),import.meta.url)),pageTitle:`Explore`},{path:`profile`,lazy:N(()=>o(()=>import(`./profile-yFsIoZom.js`),__vite__mapDeps([68,1,3,10,9,4,5,6,7,8,11,12,13,62,35,14,69,16,17,42,15,18,19,70,71,72,43,44,22,21,73,25,26,53,74,75,76,39,28,29,30,31,32,33,34,36,37,38,40,41,20,45,46,47,48,49,27,50,51,52,54,55,56,57,23,24,58,77]),import.meta.url)),pageTitle:`Profile`},{path:`profile/likes`,lazy:N(()=>o(()=>import(`./profile-yFsIoZom.js`),__vite__mapDeps([68,1,3,10,9,4,5,6,7,8,11,12,13,62,35,14,69,16,17,42,15,18,19,70,71,72,43,44,22,21,73,25,26,53,74,75,76,39,28,29,30,31,32,33,34,36,37,38,40,41,20,45,46,47,48,49,27,50,51,52,54,55,56,57,23,24,58,77]),import.meta.url)),pageTitle:`Profile`},{path:`profile/following`,lazy:N(()=>o(()=>import(`./profile-yFsIoZom.js`),__vite__mapDeps([68,1,3,10,9,4,5,6,7,8,11,12,13,62,35,14,69,16,17,42,15,18,19,70,71,72,43,44,22,21,73,25,26,53,74,75,76,39,28,29,30,31,32,33,34,36,37,38,40,41,20,45,46,47,48,49,27,50,51,52,54,55,56,57,23,24,58,77]),import.meta.url)),pageTitle:`Profile`},{path:`profile/followers`,lazy:N(()=>o(()=>import(`./profile-yFsIoZom.js`),__vite__mapDeps([68,1,3,10,9,4,5,6,7,8,11,12,13,62,35,14,69,16,17,42,15,18,19,70,71,72,43,44,22,21,73,25,26,53,74,75,76,39,28,29,30,31,32,33,34,36,37,38,40,41,20,45,46,47,48,49,27,50,51,52,54,55,56,57,23,24,58,77]),import.meta.url)),pageTitle:`Profile`},{path:`profile/:handle/:tab?`,lazy:N(()=>o(()=>import(`./profile-yFsIoZom.js`),__vite__mapDeps([68,1,3,10,9,4,5,6,7,8,11,12,13,62,35,14,69,16,17,42,15,18,19,70,71,72,43,44,22,21,73,25,26,53,74,75,76,39,28,29,30,31,32,33,34,36,37,38,40,41,20,45,46,47,48,49,27,50,51,52,54,55,56,57,23,24,58,77]),import.meta.url)),pageTitle:`Profile`},{path:`preferences`,lazy:N(()=>o(()=>import(`./preferences-CMlDfHfa.js`),__vite__mapDeps([78,1,3,10,9,8,62,35,14,21,22,79,39,28,7,26,29,30,31,32,33,5,4,6,11,12,13,34,36,37,38,40,17,16,41,42,15,19,20,43,44,45,46,47,48,49,18,27,50,51,52,25,53,54,55,56,57,24,23,58,77,70,71,72,73,74]),import.meta.url)),pageTitle:`Preferences`},{path:`preferences/moderation`,lazy:N(()=>o(()=>import(`./moderation-pCUKsxbF.js`),__vite__mapDeps([80,1,3,10,9,62,8,35,14,21,75,81,82,76,39,28,7,26,29,30,31,32,33,5,4,6,11,12,13,34,36,37,38,40,17,16,41,42,15,19,20,43,44,45,22,46,47,48,49,18,27,50,51,52,25,53,54,55,56,57,23,24,58,77,70,71,72,73,74]),import.meta.url)),pageTitle:`Moderation`,showBackButton:!0},{path:`preferences/bluesky-sharing`,lazy:N(()=>o(()=>import(`./bluesky-sharing-BJMNRwnU.js`),__vite__mapDeps([83,1,3,10,9,62,8,35,14,69,16,17,15,70,71,72,43,44,22,21,73,25,7,26,53,74,24,23,4,5,6,11,12,13,58]),import.meta.url)),showBackButton:!0},{path:`preferences/move`,lazy:N(()=>o(()=>import(`./account-migration-BaecWw1T.js`),__vite__mapDeps([84,1,3,62,8,9,10,35,14,85,71,72,43,44,21,22,25,7,26,58]),import.meta.url)),pageTitle:`Account migration`,showBackButton:!0},{path:`preferences/handle`,lazy:N(()=>o(()=>import(`./domain-DaPAeOFF.js`),__vite__mapDeps([86,1,3,8,9,10,34,12,62,35,14,85,71,72,43,44,21,22,25,7,26,28,29,30,31,32,33,5,4,6,11,13,36,37,38,39,40,17,16,41,42,15,19,20,45,46,47,48,49,18,27,50,51,52,53,54,55,56,57,58,74]),import.meta.url)),pageTitle:`Handle`,showBackButton:!0},{path:`welcome`,lazy:N(()=>o(()=>import(`./onboarding-4TxbZb90.js`).then(e=>e.t),__vite__mapDeps([67,1,66,26,7,3,10,9,4,5,31,32]),import.meta.url)),pageTitle:`Welcome`,children:[{path:``,element:(0,Y.jsx)(v,{to:`1`,replace:!0})},{path:`1`,lazy:N(()=>o(()=>import(`./step-1-C8XwHcKt.js`),__vite__mapDeps([87,1,3,62,8,9,10,35,14,21,23,4,5,6,7,11,12,13,24,25,26,31,32]),import.meta.url))},{path:`2`,lazy:N(()=>o(()=>import(`./step-2-BXaXAdwY.js`),__vite__mapDeps([88,1,3,14,8,9,10,41,23,4,5,6,7,11,12,13,28,26,29,30,31,32,33,34,35,36,37,38,39,40,17,16,42,15,19,20,43,44,45,21,22,46,47,48,49,18,27,50,51,52,25,53,54,55,56,57,89]),import.meta.url))},{path:`3`,lazy:N(()=>o(()=>import(`./step-3-DytbqpJi.js`),__vite__mapDeps([90,1,3,62,8,9,10,35,14,41,23,4,5,6,7,11,12,13,25,26,66,31,32,28,29,30,33,34,36,37,38,39,40,17,16,42,15,19,20,43,44,45,21,22,46,47,48,49,18,27,50,51,52,53,54,55,56,57,89]),import.meta.url))},{path:`*`,element:(0,Y.jsx)(v,{to:`1`,replace:!0})}]},{path:`*`,lazy:N(()=>o(()=>Promise.resolve().then(()=>br),void 0,import.meta.url))}]}];export{Ln as C,Ft as D,Nn as E,jt as O,Z as S,X as T,Gn as _,gr as a,Un as b,rr as c,nr as d,er as f,Kn as g,Zn as h,vr as i,$n as l,qn as m,yr as n,mr as o,tr as p,_r as r,ar as s,xr as t,Qn as u,Q as v,In as w,Hn as x,Wn as y};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./dist-CmLdHFZT.js","./react-C9lG_SsT.js","./inbox-BHfpmmzn.js","./jsx-runtime-Bm2_KH-0.js","./chunk-OB3PAWPO-D3muQBsq.js","./preload-helper-Ba4JejZL.js","./router-provider-Cf-bcYZr.js","./framework-provider-CIvHFnik.js","./shade-provider-DvrXKKQZ.js","./react-dom-t7VxfrkA.js","./dist-pogVoW2G.js","./stack-C3OmgpUv.js","./types-1riS5y4E.js","./feature-flag-overrides-context-o_oxK9Lh.js","./button-CTHYSI-d.js","./dialog-BO1lcy8A.js","./dist-DH_36i66.js","./es2015-8TGMBpHz.js","./popover-r_3DwMi9.js","./overlay-escape-DzyuD9tc.js","./empty-indicator-BhVwqSVH.js","./skeleton-C1s6yr9e.js","./loading-indicator-DaRyGrxv.js","./use-navigate-with-base-path-pweMCFf6.js","./content-formatters-C08JJbUJ.js","./use-activity-pub-queries-BgR1USeY.js","./hooks-0r7qxGEo.js","./index.module-CnPepLB9.js","./index-RuRs_qGS.js","./members-CH6KeXQc.js","./src-BwdakGcc.js","./users-CKJaAxEJ.js","./update-queries-sbOKc6_E.js","./config-CRAZ4Civ.js","./inline-Qoyy4r2g.js","./text-BnCSdzao.js","./lazy-component-DNJLzmpQ.js","./api-BFocMbDg.js","./list-return-state-B91WMz_J.js","./dist-xChRm5l0.js","./accordion-BB5V0RD1.js","./avatar-YbECDnBI.js","./badge-DuMiqyUH.js","./input-BHb2A_DU.js","./input-surface-DoDPknjt.js","./input-group-DL5EFP5r.js","./label-picker-DaivLdMw.js","./posts-CftunZgV.js","./tags-OlmRJ6Ps.js","./multi-select-combobox-BzBMUFst.js","./labels-BCj6D_nl.js","./pages-Bm-zFXyP.js","./tiers-DlvS8D6_.js","./schemas-21VB7GGY.js","./iso-B3K0cJod.js","./themes-CPJSMo_W.js","./reload-D0fnKoCm.js","./index-B02LJqc8.css","./layout-_g2xhB0L.js","./topic-filter-DAJ-DFPb.js","./use-reply-chain-data-BiV3Cl0B.js","./feed-B_0m7WhZ.js","./heading-Ch2Mb19A.js","./note-CF4LrSmR.js","./notifications-BmHJmqIJ.js","./explore-C69LSRVg.js","./onboarding-bMq3R8jB.js","./onboarding-Bpo1yTzA.js","./profile-CS4fP60N.js","./alert-dialog-CAPLqwVs.js","./edit-profile-PrLbJV3P.js","./label-CxXFmzcd.js","./dist-sRp1p0JK.js","./textarea-B_rfKtjs.js","./social-web-handle-D4x-qX4y.js","./no-value-label-CKNmidLC.js","./tabs-fHs3A8WC.js","./settings-DvgngbFt.js","./preferences-DFhf_pJF.js","./toggle-group-BFWCtH3p.js","./moderation-OtjZoNOc.js","./switch-BppWscjz.js","./dist-C4Jqtl6e.js","./bluesky-sharing-CrfpFHQ9.js","./account-migration-D05akW4q.js","./field-DCPPrQDr.js","./domain-DiFl_Z1A.js","./step-1-CLYhNmG9.js","./step-2-B2ujMlpa.js","./avatar-flipboard-BiixrTQO.js","./step-3-DoaTWqqj.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`c70ff5f2-f8e5-4daf-a62c-c3f15452426d`,e._sentryDebugIdIdentifier=`sentry-dbid-c70ff5f2-f8e5-4daf-a62c-c3f15452426d`)}catch{}})();import{i as e,s as t,t as n}from"./react-C9lG_SsT.js";import{o as r}from"./hooks-0r7qxGEo.js";import{t as i}from"./jsx-runtime-Bm2_KH-0.js";import{n as a}from"./dist-pogVoW2G.js";import{t as o}from"./preload-helper-Ba4JejZL.js";import{f as s,g as c,i as l,n as u,s as d,u as f}from"./chunk-OB3PAWPO-D3muQBsq.js";import{a as p,i as m,o as h,r as g,s as _,t as v}from"./router-provider-Cf-bcYZr.js";import{A as y,F as b,H as x,L as S,O as C,Z as w,j as T,w as E,y as D}from"./shade-provider-DvrXKKQZ.js";import{t as O}from"./stack-C3OmgpUv.js";import{t as k}from"./text-BnCSdzao.js";import{i as A,r as j,t as M}from"./heading-Ch2Mb19A.js";import{t as N}from"./lazy-component-DNJLzmpQ.js";import{$ as ee,Bt as te,C as ne,D as re,Dr as P,Fr as F,Ft as ie,Mn as I,Nn as ae,Pn as oe,Q as se,Rt as ce,Sr as L,Tr as le,Un as ue,a as de,d as fe,fn as pe,gn as me,ir as he,kn as R,lt as ge,m as z,nn as B,nt as _e,p as ve,pn as ye,pt as be,rr as V,t as H,tt as xe,u as Se,vn as U}from"./button-CTHYSI-d.js";import{a as Ce,c as we,i as Te,l as Ee,n as De,o as Oe,r as ke,s as Ae,t as je}from"./alert-dialog-CAPLqwVs.js";import{n as Me,r as Ne,t as Pe}from"./avatar-YbECDnBI.js";import{t as Fe}from"./badge-DuMiqyUH.js";import{a as Ie,c as Le,i as Re,n as ze,o as Be,r as Ve,s as He,t as Ue}from"./dialog-BO1lcy8A.js";import{a as We,i as Ge,r as Ke,t as qe}from"./popover-r_3DwMi9.js";import{t as Je}from"./dist-sRp1p0JK.js";import{n as Ye,r as Xe,t as Ze}from"./hover-card-Bt4FXKiL.js";import{t as Qe}from"./input-BHb2A_DU.js";import{t as W}from"./skeleton-C1s6yr9e.js";import{n as $e}from"./loading-indicator-DaRyGrxv.js";import{n as et,t as tt}from"./no-value-label-CKNmidLC.js";import{n as nt,t as G}from"./use-navigate-with-base-path-pweMCFf6.js";import{i as rt,l as K,o as it,s as at,u as q}from"./content-formatters-C08JJbUJ.js";import{A as ot,C as st,D as ct,F as lt,M as ut,N as dt,P as ft,R as pt,S as mt,U as ht,a as gt,f as _t,j as vt,p as yt,t as bt,x as xt,y as St,z as Ct}from"./use-activity-pub-queries-BgR1USeY.js";import{n as wt,t as Tt}from"./onboarding-bMq3R8jB.js";import"./onboarding-Bpo1yTzA.js";import{n as Et}from"./index.module-CnPepLB9.js";var J=t(n(),1),Y=i(),Dt=(0,J.lazy)(()=>o(()=>import(`./dist-CmLdHFZT.js`),__vite__mapDeps([0,1]),import.meta.url)),Ot=e=>(0,Y.jsx)(J.Suspense,{fallback:(0,Y.jsx)(`div`,{}),children:(0,Y.jsx)(Dt,{...e})}),kt=[],At=(0,J.createContext)(void 0),jt=({children:e})=>{let t=f(),[n,r]=(0,J.useState)(()=>{let e=localStorage.getItem(`featureFlags`);return e?JSON.parse(e):Mt()});(0,J.useEffect)(()=>{let e=Nt(t.search);Object.keys(e).length>0&&r(t=>{let n={...t,...e};return localStorage.setItem(`featureFlags`,JSON.stringify(n)),n})},[t.search]);let i={isEnabled:e=>n[e]??!1,flags:n,allFlags:kt};return(0,Y.jsx)(At.Provider,{value:i,children:e})},Mt=()=>kt.reduce((e,t)=>({...e,[t]:!1}),{}),Nt=e=>{let t=new URLSearchParams(e),n={};return kt.forEach(e=>{let r=t.get(e);r===`ON`?n[e]=!0:r===`OFF`&&(n[e]=!1)}),n},Pt=()=>{let e=(0,J.useContext)(At);if(e===void 0)throw Error(`useFeatureFlags must be used within a FeatureFlagsProvider`);return e},Ft=({className:e,onClick:t})=>{let n=G(),{previousPath:r}=_();return(0,Y.jsx)(H,{className:S(`size-8 rounded-full bg-white/85 px-2 backdrop-blur-md focus-visible:ring-0 dark:bg-transparent dark:text-white [&_svg]:size-6`,e),variant:`ghost`,onClick:()=>{if(t){t();return}n(r?-1:`/`)},children:(0,Y.jsx)(F,{size:20,strokeWidth:1.25})})},It=()=>{let e=d(xr,f().pathname);if(!e)return null;let t=e.map(e=>e.route).filter(e=>e.pageTitle);return t[t.length-1]||e[e.length-1].route};function Lt(){let e=s(),t=e.findIndex(e=>e.handle===`activitypub-basepath`);if(t===-1)return``;let n=e[t+1];if(!n)return``;let r=e[t].pathname,i=n.pathname,a=i.startsWith(r)?i.slice(r.length):i;return a=a.replace(/^\//,``),a.split(`/`)[0]}var Rt=({title:e,backIcon:t})=>t?(0,Y.jsx)(Ft,{className:`-ml-2`}):(0,Y.jsx)(M,{className:`!text-[1.5rem] font-semibold tracking-normal`,children:e}),zt=({onToggleMobileSidebar:e})=>(0,Y.jsx)(H,{className:`px:0 mr-[-9px] w-[34px] rounded-full bg-white/85 backdrop-blur-md lg:hidden dark:bg-black/85 dark:text-white`,variant:`ghost`,onClick:e,children:(0,Y.jsx)(te,{className:`size-5!`})}),Bt=({onToggleMobileSidebar:e,showBorder:t=!0})=>{let{canGoBack:n}=_(),r=Lt(),i=h(),a=It(),o=!1;r===`profile`&&(o=!0),r===`notes`&&n&&(o=!0);let s=n&&i||a?.showBackButton===!0;return(0,Y.jsx)(Y.Fragment,{children:o?(0,Y.jsxs)(`div`,{className:`sticky top-5 left-0 z-50 max-lg:flex max-lg:justify-between max-lg:pr-[15.5px] max-md:top-4 ${r===`profile`?`block h-0 max-lg:items-start`:`inline-block max-lg:items-center`}`,children:[(0,Y.jsx)(`div`,{children:s&&(0,Y.jsx)(Ft,{className:`ml-6 max-md:ml-[10px]`})}),!s&&(0,Y.jsx)(zt,{onToggleMobileSidebar:e})]}):(0,Y.jsx)(`div`,{className:`sticky top-0 z-50 bg-white/85 backdrop-blur-md dark:bg-background`,"data-network-header":`header`,children:(0,Y.jsxs)(`div`,{className:`relative flex h-[72px] items-center justify-between gap-5 px-[min(4vw,24px)] max-md:h-[68px] ${t?`before:absolute before:inset-x-[min(4vw,24px)] before:bottom-0 before:block before:border-b before:border-gray-200 before:content-[""] dark:before:border-gray-950`:``}`,children:[(0,Y.jsx)(Rt,{backIcon:s,title:a?.pageTitle||``}),(0,Y.jsx)(zt,{onToggleMobileSidebar:e})]})})})},[Vt,Ht]=C(`Form`),Ut=`Form`,[Wt,Gt]=Vt(Ut),[Kt,qt]=Vt(Ut),Jt=J.forwardRef((e,t)=>{let{__scopeForm:n,onClearServerErrors:r=()=>{},...i}=e,a=y(t,J.useRef(null)),[o,s]=J.useState({}),c=J.useCallback(e=>o[e],[o]),l=J.useCallback((e,t)=>s(n=>({...n,[e]:{...n[e]??{},...t}})),[]),u=J.useCallback(e=>{s(t=>({...t,[e]:void 0})),_(t=>({...t,[e]:{}}))},[]),[d,f]=J.useState({}),p=J.useCallback(e=>d[e]??[],[d]),m=J.useCallback((e,t)=>{f(n=>({...n,[e]:[...n[e]??[],t]}))},[]),h=J.useCallback((e,t)=>{f(n=>({...n,[e]:(n[e]??[]).filter(e=>e.id!==t)}))},[]),[g,_]=J.useState({}),v=J.useCallback(e=>g[e]??{},[g]),b=J.useCallback((e,t)=>{_(n=>({...n,[e]:{...n[e]??{},...t}}))},[]),[x,S]=J.useState({});return(0,Y.jsx)(Wt,{scope:n,getFieldValidity:c,onFieldValidityChange:l,getFieldCustomMatcherEntries:p,onFieldCustomMatcherEntryAdd:m,onFieldCustomMatcherEntryRemove:h,getFieldCustomErrors:v,onFieldCustomErrorsChange:b,onFieldValiditionClear:u,children:(0,Y.jsx)(Kt,{scope:n,onFieldMessageIdAdd:J.useCallback((e,t)=>{S(n=>{let r=new Set(n[e]).add(t);return{...n,[e]:r}})},[]),onFieldMessageIdRemove:J.useCallback((e,t)=>{S(n=>{let r=new Set(n[e]);return r.delete(t),{...n,[e]:r}})},[]),getFieldDescription:J.useCallback(e=>Array.from(x[e]??[]).join(` `)||void 0,[x]),children:(0,Y.jsx)(E.form,{...i,ref:a,onInvalid:T(e.onInvalid,e=>{let t=yn(e.currentTarget);t===e.target&&t.focus(),e.preventDefault()}),onSubmit:T(e.onSubmit,r,{checkForDefaultPrevented:!1}),onReset:T(e.onReset,r)})})})});Jt.displayName=Ut;var Yt=`FormField`,[Xt,Zt]=Vt(Yt),Qt=J.forwardRef((e,t)=>{let{__scopeForm:n,name:r,serverInvalid:i=!1,...a}=e,o=Gt(Yt,n).getFieldValidity(r);return(0,Y.jsx)(Xt,{scope:n,id:D(),name:r,serverInvalid:i,children:(0,Y.jsx)(E.div,{"data-valid":wn(o,i),"data-invalid":Tn(o,i),...a,ref:t})})});Qt.displayName=Yt;var $t=`FormLabel`,en=J.forwardRef((e,t)=>{let{__scopeForm:n,...r}=e,i=Gt($t,n),a=Zt($t,n),o=r.htmlFor||a.id,s=i.getFieldValidity(a.name);return(0,Y.jsx)(Je,{"data-valid":wn(s,a.serverInvalid),"data-invalid":Tn(s,a.serverInvalid),...r,ref:t,htmlFor:o})});en.displayName=$t;var tn=`FormControl`,nn=J.forwardRef((e,t)=>{let{__scopeForm:n,...r}=e,i=Gt(tn,n),a=Zt(tn,n),o=qt(tn,n),s=J.useRef(null),c=y(t,s),l=r.name||a.name,u=r.id||a.id,d=i.getFieldCustomMatcherEntries(l),{onFieldValidityChange:f,onFieldCustomErrorsChange:p,onFieldValiditionClear:m}=i,h=J.useCallback(async e=>{if(Cn(e.validity)){let t=hn(e.validity);f(l,t);return}let t=e.form?new FormData(e.form):new FormData,n=[e.value,t],r=[],i=[];d.forEach(e=>{bn(e,n)?i.push(e):xn(e)&&r.push(e)});let a=r.map(({id:e,match:t})=>[e,t(...n)]),o=Object.fromEntries(a),s=Object.values(o).some(Boolean),c=s;e.setCustomValidity(c?rn:``);let u=hn(e.validity);if(f(l,u),p(l,o),!s&&i.length>0){let t=i.map(({id:e,match:t})=>t(...n).then(t=>[e,t])),r=await Promise.all(t),a=Object.fromEntries(r),o=Object.values(a).some(Boolean);e.setCustomValidity(o?rn:``);let s=hn(e.validity);f(l,s),p(l,a)}},[d,l,p,f]);J.useEffect(()=>{let e=s.current;if(e){let t=()=>h(e);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)}},[h]);let g=J.useCallback(()=>{let e=s.current;e&&(e.setCustomValidity(``),m(l))},[l,m]);J.useEffect(()=>{let e=s.current?.form;if(e)return e.addEventListener(`reset`,g),()=>e.removeEventListener(`reset`,g)},[g]),J.useEffect(()=>{let e=s.current,t=e?.closest(`form`);if(t&&a.serverInvalid){let n=yn(t);n===e&&n.focus()}},[a.serverInvalid]);let _=i.getFieldValidity(l);return(0,Y.jsx)(E.input,{"data-valid":wn(_,a.serverInvalid),"data-invalid":Tn(_,a.serverInvalid),"aria-invalid":a.serverInvalid?!0:void 0,"aria-describedby":o.getFieldDescription(l),title:``,...r,ref:c,id:u,name:l,onInvalid:T(e.onInvalid,e=>{let t=e.currentTarget;h(t)}),onChange:T(e.onChange,e=>{g()})})});nn.displayName=tn;var rn=`This value is not valid`,an={badInput:rn,patternMismatch:`This value does not match the required pattern`,rangeOverflow:`This value is too large`,rangeUnderflow:`This value is too small`,stepMismatch:`This value does not match the required step`,tooLong:`This value is too long`,tooShort:`This value is too short`,typeMismatch:`This value does not match the required type`,valid:void 0,valueMissing:`This value is missing`},on=`FormMessage`,sn=J.forwardRef((e,t)=>{let{match:n,name:r,...i}=e,a=Zt(on,e.__scopeForm),o=r??a.name;return n===void 0?(0,Y.jsx)(un,{...i,ref:t,name:o,children:e.children||rn}):typeof n==`function`?(0,Y.jsx)(ln,{match:n,...i,ref:t,name:o}):(0,Y.jsx)(cn,{match:n,...i,ref:t,name:o})});sn.displayName=on;var cn=J.forwardRef((e,t)=>{let{match:n,forceMatch:r=!1,name:i,children:a,...o}=e,s=Gt(on,o.__scopeForm).getFieldValidity(i);return r||s?.[n]?(0,Y.jsx)(un,{ref:t,...o,name:i,children:a??an[n]}):null}),ln=J.forwardRef((e,t)=>{let{match:n,forceMatch:r=!1,name:i,id:a,children:o,...s}=e,c=Gt(on,s.__scopeForm),l=y(t,J.useRef(null)),u=D(),d=a??u,f=J.useMemo(()=>({id:d,match:n}),[d,n]),{onFieldCustomMatcherEntryAdd:p,onFieldCustomMatcherEntryRemove:m}=c;J.useEffect(()=>(p(i,f),()=>m(i,f.id)),[f,i,p,m]);let h=c.getFieldValidity(i),g=c.getFieldCustomErrors(i)[d];return r||h&&!Cn(h)&&g?(0,Y.jsx)(un,{id:d,ref:l,...s,name:i,children:o??rn}):null}),un=J.forwardRef((e,t)=>{let{__scopeForm:n,id:r,name:i,...a}=e,o=qt(on,n),s=D(),c=r??s,{onFieldMessageIdAdd:l,onFieldMessageIdRemove:u}=o;return J.useEffect(()=>(l(i,c),()=>u(i,c)),[i,c,l,u]),(0,Y.jsx)(E.span,{id:c,...a,ref:t})}),dn=`FormValidityState`,fn=e=>{let{__scopeForm:t,name:n,children:r}=e,i=Gt(dn,t),a=Zt(dn,t),o=n??a.name;return(0,Y.jsx)(Y.Fragment,{children:r(i.getFieldValidity(o))})};fn.displayName=dn;var pn=`FormSubmit`,mn=J.forwardRef((e,t)=>{let{__scopeForm:n,...r}=e;return(0,Y.jsx)(E.button,{type:`submit`,...r,ref:t})});mn.displayName=pn;function hn(e){let t={};for(let n in e)t[n]=e[n];return t}function gn(e){return e instanceof HTMLElement}function _n(e){return`validity`in e}function vn(e){return _n(e)&&(e.validity.valid===!1||e.getAttribute(`aria-invalid`)===`true`)}function yn(e){let t=e.elements,[n]=Array.from(t).filter(gn).filter(vn);return n}function bn(e,t){return e.match.constructor.name===`AsyncFunction`||Sn(e.match,t)}function xn(e){return e.match.constructor.name===`Function`}function Sn(e,t){return e(...t)instanceof Promise}function Cn(e){let t=!1;for(let n in e){let r=n;if(r!==`valid`&&r!==`customError`&&e[r]){t=!0;break}}return t}function wn(e,t){if(e?.valid===!0&&!t)return!0}function Tn(e,t){if(e?.valid===!1||t)return!0}var En=Jt,Dn=Qt,On=nn,kn=({trigger:e,onCopyLink:t,onDelete:n,allowDelete:r=!1,disabled:i=!1,layout:a,followedByMe:o=!1,authoredByMe:s=!1,onFollow:c=()=>{},onUnfollow:l=()=>{}})=>(0,Y.jsxs)(je,{children:[(0,Y.jsxs)(qe,{children:[(0,Y.jsx)(We,{disabled:i,asChild:!0,onClick:e=>e.stopPropagation(),children:e}),(0,Y.jsx)(Ge,{align:`${a===`modal`?`start`:`end`}`,alignOffset:a===`modal`?-12:0,className:`p-2`,children:(0,Y.jsxs)(`div`,{className:`flex w-48 flex-col`,children:[(!r||a===`inbox`)&&(0,Y.jsx)(Ke,{asChild:!0,children:(0,Y.jsxs)(H,{className:`justify-start rounded-menu-item`,shape:`rounded`,variant:`ghost`,onClick:e=>{e.stopPropagation(),t()},children:[(0,Y.jsx)(B,{}),`Copy link`]})}),!s&&(0,Y.jsx)(Ke,{asChild:!0,children:(0,Y.jsxs)(H,{className:`justify-start rounded-menu-item`,shape:`rounded`,variant:`ghost`,onClick:e=>{e.stopPropagation(),o?l():c()},children:[o?(0,Y.jsx)(z,{}):(0,Y.jsx)(ve,{}),o?`Unfollow`:`Follow`]})}),r&&(0,Y.jsx)(Ee,{asChild:!0,children:(0,Y.jsx)(Ke,{asChild:!0,children:(0,Y.jsxs)(H,{className:`justify-start rounded-menu-item text-red hover:bg-red/5 hover:text-red`,shape:`rounded`,variant:`ghost`,onClick:e=>e.stopPropagation(),children:[(0,Y.jsx)(re,{}),`Delete`]})})})]})})]}),(0,Y.jsxs)(Te,{onClick:e=>e.stopPropagation(),children:[(0,Y.jsxs)(Ae,{children:[(0,Y.jsx)(we,{children:`Delete this post?`}),(0,Y.jsx)(Ce,{children:a===`inbox`?`This will remove the post from the Ghost social web, but it will remain on your website.`:(0,Y.jsx)(Y.Fragment,{children:`If you delete this post, you won't be able to restore it.`})})]}),(0,Y.jsxs)(Oe,{children:[(0,Y.jsx)(ke,{onClick:e=>e.stopPropagation(),children:`Cancel`}),(0,Y.jsx)(De,{variant:`destructive`,onClick:e=>{e.stopPropagation(),n()},children:`Delete`})]})]})]});function An(e){let[t,n]=(0,J.useState)({images:[],currentIndex:0,isOpen:!1}),r=e=>{let t=Q(e);if(!t)return[];if(Array.isArray(t))return t.map((e,t)=>({url:e.url,alt:e.name||`Image-${t}`}));if(t.mediaType?.startsWith(`image/`)||t.type===`Image`)return[{url:t.url,alt:t.name||`Image`}];if(e.image){let t;if(t=typeof e.image==`string`?e.image:e.image?.url,t)return[{url:t,alt:`Image`}]}return[]};return{lightboxState:t,openLightbox:t=>{if(!e)return;let i=r(e),a=i.findIndex(e=>e.url===t);a!==-1&&n({images:i,currentIndex:a,isOpen:!0})},closeLightbox:()=>{n(e=>({...e,isOpen:!1}))},navigateToIndex:e=>{n(t=>({...t,currentIndex:e}))}}}var jn=({images:e,currentIndex:t,isOpen:n,onClose:r,onNavigate:i})=>{let a=t===0,o=t===e.length-1,s=(0,J.useCallback)(()=>{e.length<=1||o||i((t+1)%e.length)},[e.length,o,t,i]),c=(0,J.useCallback)(()=>{e.length<=1||a||i((t-1+e.length)%e.length)},[e.length,a,t,i]);return(0,J.useEffect)(()=>{let e=e=>{n&&(e.key===`ArrowRight`&&!o?s():e.key===`ArrowLeft`&&!a&&c())};return window.addEventListener(`keydown`,e),()=>{window.removeEventListener(`keydown`,e)}},[n,t,e.length,s,c,o,a]),!n||e.length===0?null:(0,Y.jsx)(Ue,{open:n,onOpenChange:e=>{e||r()},children:(0,Y.jsxs)(Ve,{className:`top-[50%] h-[100vh] max-h-[100vh] w-[100vw] max-w-[100vw] translate-y-[-50%] items-center border-none bg-transparent p-0 shadow-none data-[state=closed]:zoom-out-100 data-[state=closed]:slide-out-to-top-[50%] data-[state=open]:zoom-in-100 data-[state=open]:slide-in-from-top-[50%]`,onClick:()=>r(),children:[(0,Y.jsx)(`img`,{alt:e[t].alt,className:`mx-auto max-h-[90vh] max-w-[90vw] object-contain`,src:e[t].url,onClick:e=>e.stopPropagation()}),e.length>1&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(H,{className:`absolute top-1/2 left-5 size-11 -translate-y-1/2 rounded-full bg-black/50 p-0 pr-0.5 hover:bg-black/70`,disabled:a,onClick:e=>{e.stopPropagation(),c()},children:[(0,Y.jsx)(he,{className:`size-6!`}),(0,Y.jsx)(`span`,{className:`sr-only`,children:`Previous image`})]}),(0,Y.jsxs)(H,{className:`absolute top-1/2 right-5 size-11 -translate-y-1/2 rounded-full bg-black/50 p-0 pl-0.5 hover:bg-black/70`,disabled:o,onClick:e=>{e.stopPropagation(),s()},children:[(0,Y.jsx)(V,{className:`size-6!`}),(0,Y.jsx)(`span`,{className:`sr-only`,children:`Next image`})]})]}),(0,Y.jsx)(ze,{asChild:!0,children:(0,Y.jsxs)(H,{className:`absolute top-5 right-5 size-11 rounded-full bg-black/50 p-0 hover:bg-black/70`,children:[(0,Y.jsx)(de,{className:`size-5!`}),(0,Y.jsx)(`span`,{className:`sr-only`,children:`Close`})]})})]})})},Mn=()=>{},Nn=({className:e,following:t,handle:n,variant:r=`default`,onFollow:i=Mn,onUnfollow:a=Mn,"data-testid":o})=>{let[s,c]=(0,J.useState)(t),l=pt(`index`,()=>{},()=>{c(!0)}),u=St(`index`,()=>{},()=>{c(!1)}),d=async()=>{s?(c(!1),a(),l.mutate(n)):(c(!0),i(),u.mutate(n))};(0,J.useEffect)(()=>{c(t)},[t]);let f=s?`Following`:`Follow`;return r===`link`?(0,Y.jsx)(H,{className:w(`p-0 font-medium`,s?`text-gray-700 hover:text-black dark:text-gray-600 dark:hover:text-white`:`text-purple hover:text-black dark:hover:text-white`,e),"data-testid":o,variant:`link`,onClick:e=>{e?.preventDefault(),e?.stopPropagation(),d()},children:f}):(0,Y.jsx)(H,{className:w(`min-w-[90px]`,e),"data-testid":o,title:s?`Click to unfollow`:``,variant:s?`outline`:`default`,onClick:e=>{e?.preventDefault(),e?.stopPropagation(),d()},children:f})},Pn=e=>`preferredUsername`in e,X=({actor:e,children:t,disabled:n=!1,side:r=`bottom`,align:i=`start`,isCurrentUser:a=!1})=>{let[o,s]=(0,J.useState)(!1),c=G(),l=e?.handle;!l&&e&&Pn(e)&&(l=q(e));let u=n||!l&&!e,d=gt(`index`,l||``,{enabled:o&&!!l}),f=d.isFetching||d.isLoading,p=d.error,m=d.data?typeof d.data.followerCount==`number`&&typeof d.data.followingCount==`number`&&d.data.bio!==void 0:!1;if((0,J.useEffect)(()=>{!o||!l||!m&&!f&&!p&&d.refetch({cancelRefetch:!1})},[d,f,p,m,o,l]),u)return(0,Y.jsx)(Y.Fragment,{children:t});let h=d.data||e,g=h?.handle??l??``,_=h?.name??``,v=h?.avatarUrl??(e&&Pn(e)?e.icon?.url:null)??null,y=!!h?.followsMe,x=typeof h?.followingCount==`number`?h.followingCount:Number(h?.followingCount)||0,S=typeof h?.followerCount==`number`?h.followerCount:Number(h?.followerCount)||0,C=h?.bio?rt(at(h.bio,[`a`])):void 0,w=()=>{g&&c(`/profile/${g}`)};return(0,Y.jsxs)(Ze,{onOpenChange:s,children:[(0,Y.jsx)(Xe,{asChild:!0,children:t}),(0,Y.jsx)(Ye,{align:i,className:`w-[320px] cursor-default rounded-2xl border-0 p-5 text-left text-gray-900 shadow-lg outline-hidden dark:bg-surface-elevated-2`,side:r,sideOffset:12,onClick:e=>e.stopPropagation(),children:(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsxs)(`div`,{className:`flex justify-between`,children:[(0,Y.jsxs)(Pe,{className:`size-14 cursor-pointer`,onClick:w,children:[v&&(0,Y.jsx)(Ne,{alt:_,className:`rounded-full outline-[0.5px] outline-offset-[-0.5px] outline-black/10`,src:v,onError:e=>{e.target.src=``,e.target.style.display=`none`}}),(0,Y.jsx)(Me,{className:`bg-gray-200 text-sm font-semibold text-gray-700 dark:bg-gray-800 dark:text-gray-200`,children:(0,Y.jsx)(fe,{className:`size-5 text-gray-500 dark:text-gray-400`,strokeWidth:1.5})})]}),!a&&(0,Y.jsx)(Nn,{following:!!h?.followedByMe,handle:g,type:`primary`})]}),(0,Y.jsxs)(`div`,{className:`flex cursor-pointer flex-col items-start`,onClick:w,children:[(0,Y.jsx)(j,{className:`w-full truncate`,children:_}),(0,Y.jsxs)(`div`,{className:`flex w-full gap-2`,children:[(0,Y.jsx)(`span`,{className:`truncate text-gray-700 dark:text-gray-600`,children:g}),y&&!a&&(0,Y.jsx)(Fe,{className:`mt-px whitespace-nowrap`,variant:`secondary`,children:`Follows you`})]})]})]}),(0,Y.jsx)(`div`,{className:`flex gap-3 dark:text-gray-300`,children:f?(0,Y.jsx)(W,{className:`h-4 w-32`}):!p&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`span`,{className:`cursor-pointer hover:underline`,onClick:()=>{g&&c(`/profile/${g}/following`)},children:[(0,Y.jsx)(`span`,{className:`font-bold text-black dark:text-white`,children:b(x)}),` `,`Following`]}),(0,Y.jsxs)(`span`,{className:`cursor-pointer hover:underline`,onClick:()=>{g&&c(`/profile/${g}/followers`)},children:[(0,Y.jsx)(`span`,{className:`font-bold text-black dark:text-white`,children:b(S)}),` `,`Followers`]})]})}),f?(0,Y.jsx)(W,{className:`h-4 w-48`}):!p&&C?(0,Y.jsx)(`div`,{dangerouslySetInnerHTML:{__html:it(C)},className:`leading-tight dark:text-gray-300 [&_.invisible]:hidden [&_a]:text-[#00a4eb] [&_a:hover]:underline`}):null]})})]})},Fn=(e={})=>{let[t,n]=(0,J.useState)(!1),r=f();return(0,J.useEffect)(()=>{let t=t=>{if(t.target instanceof HTMLInputElement||t.target instanceof HTMLTextAreaElement||t.target instanceof HTMLElement&&t.target.isContentEditable||t.target instanceof HTMLSelectElement||t.metaKey||t.ctrlKey||t.altKey||t.shiftKey)return;let i=document.querySelector(`[role="dialog"][data-state="open"]`);if(!(i&&(e.componentRef?.current)?.closest(`[role="dialog"]`)!==i))switch(t.key.toLowerCase()){case`n`:i||(t.preventDefault(),e.onOpenNewNote?e.onOpenNewNote():n(!0));break;case`r`:e.isReplyAvailable&&e.onOpenReply&&(r.pathname.includes(`/notes/`)||r.pathname.includes(`/reader/`))&&(t.preventDefault(),e.onOpenReply());break}};return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[e,r.pathname]),{isNewNoteModalOpen:t,setIsNewNoteModalOpen:n}},In=({actor:e,object:t,likeCount:n,commentCount:r,repostCount:i,layout:a,disabled:o=!1,buttonClassName:s=``,onLikeClick:c,onCommentClick:l,onReplyCountChange:u})=>{let[d,f]=(0,J.useState)(t.liked),[p,m]=(0,J.useState)(t.reposted),[h,g]=(0,J.useState)(!1),_=(0,J.useRef)(null);Fn({isReplyAvailable:!l&&a!==`reply`,onOpenReply:()=>g(!0),componentRef:_}),(0,J.useEffect)(()=>{f(t.liked),m(t.reposted)},[t.liked,t.reposted]),(0,J.useEffect)(()=>{w(i)},[i]);let v=xt(`index`),y=Ct(`index`),b=vt(`index`),S=yt(`index`),[C,w]=(0,J.useState)(i),T=async e=>{e.stopPropagation(),d?y.mutate(t.id):v.mutate(t.id,{onError(){f(!1)}}),f(!d),c()},E=e=>{e.stopPropagation(),l?l():g(!0)},D=`px-2 gap-1.5 font-normal text-md [&_svg]:size-[18px] transition-color ap-action-button text-gray-900 hover:text-gray-900 hover:bg-black/[3%] dark:hover:bg-gray-950 dark:text-gray-600 ${a===`inbox`?`rounded-md`:``} ${s}`;return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`div`,{ref:_,className:`flex ${a!==`inbox`&&`gap-1`}`,children:[(0,Y.jsxs)(H,{className:`${D} ${d&&`text-pink-500 hover:text-pink-500`}`,"data-testid":`like-button`,disabled:o,id:`like`,title:`${d?`Undo like`:`Like`}`,variant:`ghost`,onClick:e=>{e?.stopPropagation(),e&&T(e)},children:[(0,Y.jsx)(me,{className:`${d&&`fill-pink-500 text-pink-500`}`}),a!==`inbox`&&(0,Y.jsx)(Ot,{className:n===0?`-ml-1.5 w-0 overflow-hidden`:``,spinTiming:{duration:300},value:n})]}),(0,Y.jsxs)(H,{className:`${D}`,"data-testid":`reply-button`,disabled:o,id:`comment`,title:`Reply`,variant:`ghost`,onClick:E,children:[(0,Y.jsx)(ce,{className:`-mr-px`}),a!==`inbox`&&r>0&&x(r)]}),(0,Y.jsxs)(H,{className:`${D} ${p&&`text-green-500 hover:text-green-500`}`,"data-testid":`repost-button`,disabled:o,id:`repost`,title:`${p?`Undo repost`:`Repost`}`,variant:`ghost`,onClick:e=>{e?.stopPropagation(),p?(S.mutate(t.id),w(C-1)):(b.mutate(t.id,{onError(){m(!1),w(C-1)}}),w(C+1)),m(!p)},children:[(0,Y.jsx)(ge,{className:`${p&&`text-green-500`}`}),a!==`inbox`&&(0,Y.jsx)(Ot,{className:C===0?`-ml-1.5 w-0 overflow-hidden`:``,spinTiming:{duration:300},value:C})]})]}),h&&(0,Y.jsx)(rr,{open:h,replyTo:{object:t,actor:e},onOpenChange:e=>{g(e)},onReply:()=>{u?.(1),g(!1)},onReplyError:()=>{u?.(-1)}})]})};function Ln(e){let t=e.replace(/<[^>]*>/g,``).split(/\s+/).filter(e=>e.length>0).length;return`${Math.ceil(t/275)} min read`}var Z=(e,t,n)=>{n?.stopPropagation(),t(typeof e==`string`?`/profile/${e}`:`/profile/${q(e)}`)},Rn=e=>{let t=new Date,n=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()),r=n(t),i=n(new Date(t.getTime()-1440*60*1e3)),a=n(e);return a.getTime()===r.getTime()?zn(e):a.getTime()===i.getTime()?`Yesterday`:Bn(e)},zn=e=>{let t=Math.floor((new Date().getTime()-e.getTime())/1e3);if(t<1)return`Just now`;if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?`${n}m`:`${Math.floor(n/60)}h`},Bn=e=>{let t=new Date,n=e.getDate(),r=e.toLocaleString(`default`,{month:`short`});return e.getFullYear()===t.getFullYear()?`${n} ${r}`:`${n} ${r} ${e.getFullYear()}`};function Vn(e){return new Date(e).toLocaleDateString(`default`,{year:`numeric`,month:`short`,day:`2-digit`})+`, `+new Date(e).toLocaleTimeString(`default`,{hour:`2-digit`,minute:`2-digit`})}function Hn(e,t=!0){let n=new Date(e?.published??e?.createdAt??new Date),r=Vn(n),i=Rn(n);return t&&!e.url?.includes(`/.ghost/activitypub`)?(0,Y.jsx)(`a`,{className:`whitespace-nowrap text-gray-700 hover:underline`,href:e.url,rel:`noreferrer`,target:`_blank`,title:r,onClick:e=>e.stopPropagation(),children:i}):(0,Y.jsx)(`span`,{className:`whitespace-nowrap text-gray-700`,children:i})}function Un({contentWarning:e,sensitive:t,hasMedia:n,resetKey:r}){let{data:i}=ct(),a=i?.showSensitiveMedia??!1,[o,s]=(0,J.useState)(!1),[c,l]=(0,J.useState)(!1),[u,d]=(0,J.useState)(!1),[f,p]=(0,J.useState)(!0),[m,h]=(0,J.useState)(void 0),g=(0,J.useRef)(null);(0,J.useEffect)(()=>{s(!1),l(!1),d(!1),p(!0),h(void 0)},[r]),(0,J.useLayoutEffect)(()=>{!u||!f||(p(!1),h(void 0))},[u,f]);let _=e?.trim()||null,v=_!==null,y=t===!0&&n&&!v&&!a,b=y&&(c||!o);return{contentWarning:_,shouldHideContentWarning:v&&!u,shouldHideSensitiveMedia:b,canHideSensitiveMedia:y&&!b,isContentWarningRevealed:u,showContentWarningOverlay:f,contentWarningMinHeight:m,contentWarningWrapperRef:g,revealSensitiveMedia:e=>{e.stopPropagation(),l(!1),s(!0)},hideSensitiveMedia:e=>{e.stopPropagation(),l(!0),s(!1)},revealContentWarning:e=>{e.stopPropagation();let t=g.current?.offsetHeight;t&&h(t),d(!0)}}}function Q(e){let t;if(e.image&&(t=typeof e.image==`string`?{type:`Image`,url:e.image}:{type:e.image.type??`Image`,mediaType:e.image.mediaType,url:e.image.url}),e.type===`Note`&&!t&&(t=e.attachment),!t)return null;if(Array.isArray(t)){if(t.length===0)return null;if(t.length===1)return t[0]}return t}function Wn(e,t,n,r){let i=Q(e);if(!i)return null;let a=e=>n=>{n.stopPropagation(),t&&t(e)},o=e=>{r&&r(e)},s=(e,t=!1)=>(0,Y.jsx)(`div`,{className:`${e} ${t?`min-h-[200px]`:``} flex w-full items-center justify-center bg-gray-100 dark:bg-gray-950/30`,children:(0,Y.jsx)(ye,{className:`text-gray-400`,size:24,strokeWidth:1.5})});if(Array.isArray(i)){let e=i.length,r=``;return e===1?r=`grid-cols-1`:e>=2&&e<=4?r=`grid-cols-2 auto-rows-[150px]`:e>4&&(r=`grid-cols-3 auto-rows-[150px]`),(0,Y.jsx)(`div`,{className:`attachment-gallery mt-3 grid w-full ${r} gap-2`,children:i.map((r,i)=>{let c=`size-full rounded-md outline-1 -outline-offset-1 outline-black/10 ${e===3&&i===0?`row-span-2`:``}`;return n&&n.has(r.url)?s(c,e===1):(0,Y.jsx)(`img`,{alt:r.name||`Image-${i}`,className:`${c} cursor-pointer object-cover`,referrerPolicy:`no-referrer`,src:r.url,onClick:t?a(r.url):void 0,onError:()=>o(r.url)},r.url)})})}switch(i.mediaType){case`image/jpeg`:case`image/png`:case`image/gif`:case`image/webp`:return n&&n.has(i.url)?s(`${e.type===`Article`?`w-full rounded-t-md`:`mt-3 max-h-[420px] rounded-md outline-1 -outline-offset-1 outline-black/10`}`,!0):(0,Y.jsx)(`img`,{alt:i.name||`Image`,className:`cursor-pointer ${e.type===`Article`?`w-full rounded-t-md`:`mt-3 max-h-[420px] rounded-md outline-1 -outline-offset-1 outline-black/10`}`,referrerPolicy:`no-referrer`,src:i.url,onClick:t?a(i.url):void 0,onError:()=>o(i.url)});case`video/mp4`:case`video/webm`:return(0,Y.jsx)(`div`,{className:`relative mt-3 mb-4`,children:(0,Y.jsx)(`video`,{className:`h-[300px] w-full rounded object-cover`,src:i.url,controls:!0})});case`audio/mpeg`:case`audio/ogg`:return(0,Y.jsx)(`div`,{className:`relative mt-2 mb-4 w-full`,children:(0,Y.jsx)(`audio`,{className:`w-full`,src:i.url,controls:!0})});default:if(e.image||i.type===`Image`){let r=e.type===`Article`?`cursor-pointer aspect-[16/7.55] w-full rounded-t-md object-cover`:`cursor-pointer mt-3 max-h-[420px] rounded-md outline-1 -outline-offset-1 outline-black/10`,c;return c=e.image?typeof e.image==`string`?e.image:e.image?.url:i.url,n&&n.has(c)?s(r,!0):(0,Y.jsx)(`img`,{alt:i.name||`Image`,className:r,referrerPolicy:`no-referrer`,src:c,onClick:t?a(c):void 0,onError:()=>o(c)})}return null}}function Gn({className:e=``,isLayered:t=!1,size:n=`default`,showLabel:r=!0,onReveal:i}){let a=n===`compact`;return(0,Y.jsxs)(`div`,{className:w(`flex items-center justify-center overflow-hidden bg-foreground/45 text-background backdrop-blur-xl`,a?`p-2`:`[container-type:size] p-[clamp(0.75rem,6cqh,2rem)]`,t?`absolute inset-0 rounded-none`:a?`relative rounded-md`:`relative mt-3 min-h-[300px] w-full rounded-md`,e),"data-testid":`sensitive-media-overlay`,onClick:e=>e.stopPropagation(),children:[(0,Y.jsx)(`div`,{className:`absolute inset-0 bg-foreground/35`}),a?(0,Y.jsxs)(`div`,{className:`relative z-10 flex flex-col items-center justify-center gap-0.5 text-center`,children:[(0,Y.jsx)(I,{"aria-hidden":`true`,className:`size-5`,strokeWidth:2.25}),r&&(0,Y.jsx)(k,{className:`text-sm leading-none text-background`,weight:`bold`,children:`Sensitive media`}),(0,Y.jsx)(H,{"aria-label":`Show media`,className:`mt-0.5 h-6 rounded-full bg-background/35 px-3 text-xs font-bold text-background shadow-[0_0_0_1px_color-mix(in_oklab,var(--background)_35%,transparent)] hover:bg-background/25 hover:text-background`,size:`sm`,type:`button`,variant:`ghost`,onClick:i,children:`Show`})]}):(0,Y.jsxs)(`div`,{className:`relative z-10 grid size-full max-w-[520px] grid-rows-[minmax(0,1fr)_auto_minmax(0.5rem,6cqh)_auto_minmax(0.75rem,8cqh)_auto_minmax(0,1fr)] justify-items-center text-center`,children:[(0,Y.jsx)(I,{"aria-hidden":`true`,className:`row-start-2 size-[clamp(1.5rem,14cqh,2.25rem)]`,strokeWidth:2.25}),(0,Y.jsxs)(`div`,{className:`row-start-4 flex flex-col items-center gap-1`,children:[(0,Y.jsx)(k,{className:`text-background`,weight:`bold`,children:`Sensitive media`}),(0,Y.jsx)(k,{className:`leading-tight text-background`,children:`The following may contain sensitive material`})]}),(0,Y.jsx)(H,{"aria-label":`Show media`,className:`row-start-6 rounded-full bg-background/35 px-8 font-bold text-background shadow-[0_0_0_1px_color-mix(in_oklab,var(--background)_35%,transparent)] hover:bg-background/25 hover:text-background`,size:`default`,type:`button`,variant:`ghost`,onClick:i,children:`Show`})]})]})}function Kn({label:e=`Hide media`,layout:t=`overlay`,onHide:n}){return(0,Y.jsx)(H,{"aria-label":`Hide sensitive media`,className:w(`z-20 rounded-full bg-foreground/80 px-6 font-bold text-background hover:bg-foreground/90 hover:text-background`,t===`overlay`&&`absolute top-5 right-5`),size:`default`,type:`button`,variant:`ghost`,onClick:n,children:e})}function qn({className:e=``,isLayered:t=!1,label:n,size:r=`default`,onReveal:i}){let a=r===`compact`;return(0,Y.jsxs)(`div`,{className:w(`flex w-full items-center justify-center overflow-hidden bg-foreground/45 text-background backdrop-blur-xl`,a?`p-4`:`[container-type:inline-size] p-[clamp(0.75rem,6cqw,2rem)]`,t?`absolute inset-0 rounded-none`:a?`relative min-h-[73px] w-full rounded-md`:`relative min-h-[300px] w-full rounded-md`,e),"data-testid":`content-warning-overlay`,onClick:e=>e.stopPropagation(),children:[(0,Y.jsx)(`div`,{className:`absolute inset-0 bg-foreground/35`}),a?(0,Y.jsxs)(`div`,{className:`relative z-10 flex w-full max-w-[520px] flex-col items-center justify-center gap-2 text-center`,children:[(0,Y.jsx)(I,{"aria-hidden":`true`,className:`size-5`,strokeWidth:2.25}),(0,Y.jsxs)(`div`,{className:`flex flex-col items-center gap-0.5`,children:[(0,Y.jsx)(k,{className:`text-sm text-background`,weight:`bold`,children:`Content warning:`}),(0,Y.jsx)(k,{className:`text-sm leading-tight text-background`,children:n})]}),(0,Y.jsx)(H,{"aria-label":`Show post`,className:`rounded-full bg-background/35 px-6 text-sm font-bold text-background shadow-[0_0_0_1px_color-mix(in_oklab,var(--background)_35%,transparent)] hover:bg-background/25 hover:text-background`,size:`sm`,type:`button`,variant:`ghost`,onClick:i,children:`Show`})]}):(0,Y.jsxs)(`div`,{className:`relative z-10 grid size-full max-w-[520px] grid-rows-[minmax(0,1fr)_auto_clamp(1.25rem,3.85cqw,1.8rem)_auto_clamp(1.5rem,5.15cqw,2.4rem)_auto_minmax(0,1fr)] justify-items-center text-center`,children:[(0,Y.jsx)(I,{"aria-hidden":`true`,className:`row-start-2 size-[clamp(1.5rem,4.85cqw,2.25rem)]`,strokeWidth:2.25}),(0,Y.jsxs)(`div`,{className:`row-start-4 flex flex-col items-center gap-1`,children:[(0,Y.jsx)(k,{className:`text-background`,weight:`bold`,children:`Content warning:`}),(0,Y.jsx)(k,{className:`leading-tight text-background`,children:n})]}),(0,Y.jsx)(H,{"aria-label":`Show post`,className:`row-start-6 rounded-full bg-background/35 px-8 font-bold text-background shadow-[0_0_0_1px_color-mix(in_oklab,var(--background)_35%,transparent)] hover:bg-background/25 hover:text-background`,size:`default`,type:`button`,variant:`ghost`,onClick:i,children:`Show`})]})]})}function Jn(e,t){let n=Q(e),r=`ml-8 md:ml-9 shrink-0 rounded-md h-[91px] w-[121px] relative hidden @md/inbox-item:block`,i=w(`object-cover outline-1 -outline-offset-1 outline-black/[0.05]`,r);if(t)return(0,Y.jsx)(W,{className:`${i} outline-0`});if(!n)return null;if(Array.isArray(n))return(0,Y.jsx)(`img`,{className:i,referrerPolicy:`no-referrer`,src:n[0].url});switch(n.mediaType){case`image/jpeg`:case`image/png`:case`image/gif`:return(0,Y.jsx)(`img`,{className:i,referrerPolicy:`no-referrer`,src:n.url});case`video/mp4`:case`video/webm`:return(0,Y.jsxs)(`div`,{className:r,children:[(0,Y.jsx)(`video`,{className:`h-[80px] w-full rounded object-cover`,src:n.url}),(0,Y.jsx)(`div`,{className:`absolute inset-0 rounded bg-gray-900 opacity-50`}),(0,Y.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center`,children:(0,Y.jsx)(be,{color:`white`,fill:`white`,size:40})})]});case`audio/mpeg`:case`audio/ogg`:return(0,Y.jsx)(`div`,{className:`ml-8 w-[120px]`,children:(0,Y.jsx)(`div`,{className:`relative mt-2 mb-4 w-full`,children:(0,Y.jsx)(`audio`,{className:`w-full`,src:n.url,controls:!0})})});default:return e.image?(0,Y.jsx)(`img`,{className:i,referrerPolicy:`no-referrer`,src:typeof e.image==`string`?e.image:e.image?.url}):null}}var Yn=()=>{},Xn=(0,Y.jsx)(ge,{className:`shrink-0 text-gray-700 dark:text-gray-600`,size:16,strokeWidth:1.5}),Zn=({actor:e,allowDelete:t=!1,object:n,parentId:r=void 0,layout:i,type:o,commentCount:s=0,repostCount:c=0,likeCount:l=0,showHeader:u=!0,last:d,isLoading:f,isPending:p=!1,isCompact:m=!1,isChainContinuation:h=!1,isChainParent:g=!1,onClick:_=Yn,onDelete:v=Yn,showStats:y=!0})=>{let b=new Date(n?.published??new Date).toLocaleDateString(`default`,{year:`numeric`,month:`short`,day:`2-digit`})+`, `+new Date(n?.published??new Date).toLocaleTimeString(`default`,{hour:`2-digit`,minute:`2-digit`}),[,x]=(0,J.useState)(!1),[S,C]=(0,J.useState)(new Set),T=(0,J.useRef)(null),[E,D]=(0,J.useState)(!1),O=_t(`index`),k=G(),{contentWarning:j,shouldHideContentWarning:M,shouldHideSensitiveMedia:N,canHideSensitiveMedia:ee,isContentWarningRevealed:te,showContentWarningOverlay:ne,contentWarningMinHeight:re,contentWarningWrapperRef:P,revealSensitiveMedia:F,hideSensitiveMedia:ie,revealContentWarning:I}=Un({contentWarning:n?.contentWarning,sensitive:n?.sensitive,hasMedia:Q(n)!==null,resetKey:n?.id}),ae=St(`index`,()=>{a.success(`Followed ${R?.name}`)},()=>{a.error(`Failed to follow`)}),se=pt(`index`,()=>{a.info(`Unfollowed ${R?.name}`)},()=>{a.error(`Failed to unfollow`)});(0,J.useEffect)(()=>{let e=T.current;e&&D(e.scrollHeight>e.clientHeight)},[n?.content]),(0,J.useEffect)(()=>{let e=T.current;if(!e)return;let t=e=>{let t=e.target.closest(`a[data-profile]`);if(t){let n=t.getAttribute(`data-profile`)?.trim();/^@([\w.-]+)@([\w-]+\.[\w.-]+[a-zA-Z])$/.test(n||``)&&n&&(e.preventDefault(),e.stopPropagation(),Z(n,k))}};return e.addEventListener(`click`,t),()=>{e.removeEventListener(`click`,t)}},[k,n?.content]);let ce=()=>{},L=()=>{p||_()},le=()=>{O.mutate({id:n.id,parentId:r}),v()},ue=async()=>{n?.url&&(await navigator.clipboard.writeText(n.url),x(!0),a.success(`Link copied`),setTimeout(()=>x(!1),2e3))},de=e=>{C(t=>new Set(t).add(e))},fe=e=>{if(N){let e=Wn(n,void 0,S,de);return e?(0,Y.jsxs)(`div`,{className:w(`relative mt-3 overflow-hidden rounded-md [&>.attachment-gallery]:mt-0 [&>img]:mt-0 [&>img]:block`,Array.isArray(Q(n))?`w-full`:`w-fit max-w-full`),children:[e,(0,Y.jsx)(Gn,{isLayered:!0,onReveal:F})]}):(0,Y.jsx)(Gn,{onReveal:F})}let t=Wn(n,e,S,de);return t?ee?(0,Y.jsxs)(`div`,{className:w(`relative mt-3 [&>.attachment-gallery]:mt-0 [&>img]:mt-0 [&>img]:block`,Array.isArray(Q(n))?`w-full`:`w-fit max-w-full`),children:[t,(0,Y.jsx)(Kn,{label:`Hide`,onHide:ie})]}):t:null},pe=(e=!1)=>j?(0,Y.jsx)(qn,{isLayered:e,label:j,size:i===`inbox`||i===`reply`?`compact`:`default`,onReveal:I}):null,me=e=>{let{contentClassName:t=`ap-note-content break-anywhere line-clamp-[10] leading-[1.4285714286] tracking-[-0.006em] text-pretty text-gray-900 dark:text-gray-300 [&_p+p]:mt-3`,mediaClickHandler:r=xe,showName:i=!1}=e??{};return(0,Y.jsxs)(Y.Fragment,{children:[i&&n.name&&(0,Y.jsx)(A,{className:`break-anywhere mb-1 leading-tight`,"data-test-activity-heading":!0,children:n.name}),(0,Y.jsx)(`div`,{className:t,children:f?(0,Y.jsx)(W,{count:2}):(0,Y.jsx)(`div`,{dangerouslySetInnerHTML:{__html:it(rt(n.content||``)??``)},ref:T,onClick:e=>{let t=e.target;(t.tagName===`A`||t.closest(`a`))&&e.stopPropagation()}})}),E&&(0,Y.jsx)(`button`,{className:`mt-1 text-blue-600`,type:`button`,children:`Show more`}),fe(r)]})},he=e=>j?(0,Y.jsxs)(`div`,{ref:P,className:`relative w-full`,style:re?{minHeight:re}:void 0,children:[te&&me(e),ne&&pe(te)]}):me(e),R=e;o===`Announce`&&(R=typeof n.attributedTo==`object`?n.attributedTo:e);let ge=R?q(R):null,z=R?.followedByMe||!1,B=o===`Announce`?typeof n.attributedTo==`object`&&n.attributedTo&&!Array.isArray(n.attributedTo)&&`authored`in n.attributedTo?n.attributedTo.authored:typeof n.attributedTo==`object`&&n.attributedTo&&!Array.isArray(n.attributedTo)&&typeof e==`object`&&e&&n.attributedTo.id===e.id:n.authored,_e=o===`Announce`?n.reposted??!1:n.authored,ve=()=>{ge&&ae.mutate(ge)},ye=()=>{ge&&se.mutate(ge)},be=(0,Y.jsx)(H,{className:`relative z-10 size-[34px] ${i===`feed`?``:`rounded-md`} ${i===`inbox`||i===`modal`?`text-gray-900 hover:text-gray-900 dark:text-gray-600 dark:hover:text-gray-600`:`text-gray-500 hover:text-gray-500`} dark:hover:bg-gray-950 [&_svg]:size-5`,"data-testid":`menu-button`,shape:i===`feed`?`pill`:`rounded`,size:i===`feed`?`icon`:void 0,variant:`ghost`,children:(0,Y.jsx)(oe,{})}),{lightboxState:V,openLightbox:xe,closeLightbox:Se,navigateToIndex:U}=An(n);return i===`feed`?(0,Y.jsxs)(Y.Fragment,{children:[n&&(0,Y.jsxs)(`div`,{className:`group/article relative -mx-4 ${p?`pointer-events-none`:`cursor-pointer`} rounded-lg p-6 px-4 pb-[18px]`,"data-layout":`feed`,"data-object-id":n.id,onClick:L,children:[o===`Announce`&&(0,Y.jsxs)(`div`,{className:`z-10 mb-2 flex items-center gap-1.5 text-gray-700 dark:text-gray-600`,children:[Xn,(0,Y.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1 text-sm`,children:[(0,Y.jsx)(X,{actor:e,align:`center`,isCurrentUser:_e,children:(0,Y.jsx)(`span`,{className:`break-anywhere truncate hover:underline`,onClick:t=>{Z(e,k,t)},children:e.name})}),`reposted`]})]}),(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2.5`,"data-test-activity":!0,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Y.jsx)(X,{actor:R,isCurrentUser:B,children:(0,Y.jsxs)(`div`,{className:`flex min-w-0 grow items-center gap-3`,children:[(0,Y.jsx)(K,{author:R,disabled:p,showFollowButton:!B&&!z}),(0,Y.jsxs)(`div`,{className:`flex min-w-0 grow flex-col`,onClick:e=>{p||Z(R,k,e)},children:[(0,Y.jsx)(`span`,{className:`break-anywhere min-w-0 truncate font-semibold ${m?`text-lg`:`text-md`} ${p?``:`hover-underline`} dark:text-white`,"data-test-activity-heading":!0,children:f?(0,Y.jsx)(W,{className:`w-24`}):R.name}),(0,Y.jsxs)(`div`,{className:`flex w-full text-md text-gray-700 dark:text-gray-600`,children:[(0,Y.jsx)(`span`,{className:`truncate ${p?``:`hover-underline`}`,children:f?(0,Y.jsx)(W,{className:`w-56`}):q(R)}),(0,Y.jsx)(`div`,{className:`ml-1 before:mr-1 ${!f&&`before:content-["·"]`}`,title:`${b}`,children:f?(0,Y.jsx)(W,{className:`w-4`}):Hn(n,p===!1&&!n.authored)})]})]})]})}),(0,Y.jsx)(kn,{allowDelete:t,authoredByMe:B,disabled:p,followedByMe:z,layout:`feed`,trigger:be,onCopyLink:ue,onDelete:le,onFollow:ve,onUnfollow:ye})]}),(0,Y.jsx)(`div`,{className:`relative col-start-2 col-end-3 w-full gap-4 pl-[52px]`,children:(0,Y.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Y.jsx)(`div`,{className:``,children:n.type===`Article`?M?pe():(0,Y.jsxs)(`div`,{className:`rounded-md border border-gray-200 transition-colors hover:bg-gray-100 dark:border-gray-950 dark:hover:bg-gray-950`,children:[fe(L),(0,Y.jsxs)(`div`,{className:`p-5`,children:[(0,Y.jsx)(`div`,{className:`break-anywhere mb-1 line-clamp-2 text-lg leading-tight font-semibold tracking-tight text-pretty`,"data-test-activity-heading":!0,children:n.name}),(0,Y.jsx)(`div`,{className:`break-anywhere line-clamp-3 leading-[1.4em]`,children:n.preview?.content})]})]}):(0,Y.jsx)(`div`,{className:`relative`,children:he()})}),(0,Y.jsx)(`div`,{className:`space-between relative z-[30] mt-1 ml-[-8px] flex`,children:f?(0,Y.jsx)(W,{className:`ml-2 w-18`}):y&&(0,Y.jsx)(In,{actor:R,commentCount:s,disabled:p,layout:i,likeCount:l,object:n,repostCount:c,onLikeClick:ce})})]})})]})]}),(0,Y.jsx)(jn,{currentIndex:V.currentIndex,images:V.images,isOpen:V.isOpen,onClose:Se,onNavigate:U})]}):i===`modal`?(0,Y.jsxs)(Y.Fragment,{children:[n&&(0,Y.jsxs)(`div`,{"data-object-id":n.id,children:[(0,Y.jsxs)(`div`,{className:`group/article relative`,"data-layout":`modal`,onClick:L,children:[(0,Y.jsxs)(`div`,{className:`z-10 -my-1 grid grid-cols-[auto_1fr] grid-rows-[auto_1fr] gap-3 pt-4 pb-3`,"data-test-activity":!0,children:[u&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{className:`relative z-10 pt-[3px]`,children:(0,Y.jsx)(K,{author:R,showFollowButton:!B&&!z})}),(0,Y.jsxs)(`div`,{className:`relative z-10 flex w-full min-w-0 cursor-pointer flex-col overflow-visible text-[1.5rem]`,onClick:e=>{p||Z(R,k,e)},children:[(0,Y.jsxs)(`div`,{className:`flex w-full`,children:[(0,Y.jsx)(`span`,{className:`break-anywhere min-w-0 truncate font-semibold whitespace-nowrap after:mx-1 after:font-normal after:text-gray-700 after:content-["·"] after:dark:text-gray-600`,"data-test-activity-heading":!0,children:R.name}),(0,Y.jsx)(`div`,{children:Hn(n,!n.authored)})]}),(0,Y.jsx)(`div`,{className:`flex w-full`,children:(0,Y.jsx)(`span`,{className:`min-w-0 truncate text-gray-700 dark:text-gray-600`,children:q(R)})})]})]}),(0,Y.jsx)(`div`,{className:`relative z-10 col-start-1 col-end-3 w-full gap-4`,children:(0,Y.jsxs)(`div`,{className:`flex flex-col items-start`,children:[he({contentClassName:`ap-note-content-large break-anywhere text-[1.6rem] tracking-[-0.011em] text-pretty text-gray-900 dark:text-gray-300 [&_p+p]:mt-3`,showName:!0}),(0,Y.jsx)(`div`,{className:`space-between mt-3 ml-[-8px] flex`,children:y&&(0,Y.jsx)(In,{actor:R,commentCount:s,layout:i,likeCount:l,object:n,repostCount:c,onLikeClick:ce})})]})})]}),(0,Y.jsx)(`div`,{className:`absolute -inset-x-3 -inset-y-0 z-0 rounded transition-colors max-lg:hidden`})]}),(0,Y.jsx)(`div`,{className:`mt-3 h-px bg-gray-200 dark:bg-gray-950`})]}),(0,Y.jsx)(jn,{currentIndex:V.currentIndex,images:V.images,isOpen:V.isOpen,onClose:Se,onNavigate:U})]}):i===`reply`?(0,Y.jsxs)(Y.Fragment,{children:[n&&(0,Y.jsxs)(`div`,{className:`group/article relative ${m?`pb-6`:h?`pb-5`:`py-5`} ${p?`pointer-events-none`:`cursor-pointer`}`,"data-layout":`reply`,"data-object-id":n.id,onClick:L,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2.5 border-b-gray-200`,"data-test-activity":!0,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Y.jsx)(X,{actor:R,isCurrentUser:B,children:(0,Y.jsxs)(`div`,{className:`flex min-w-0 grow items-center gap-3`,children:[(0,Y.jsx)(K,{author:R,disabled:p,showFollowButton:!B&&!z}),(0,Y.jsxs)(`div`,{className:`flex min-w-0 grow flex-col`,onClick:e=>{p||Z(R,k,e)},children:[(0,Y.jsxs)(`div`,{className:`flex`,children:[(0,Y.jsx)(`span`,{className:`break-anywhere min-w-0 truncate font-semibold whitespace-nowrap text-black after:mx-1 after:font-normal after:text-gray-700 after:content-["·"] dark:text-white`,"data-test-activity-heading":!0,children:R.name}),(0,Y.jsx)(`div`,{children:Hn(n,p===!1&&!n.authored)})]}),(0,Y.jsx)(`div`,{className:`flex`,children:(0,Y.jsx)(`span`,{className:`truncate text-gray-700`,children:q(R)})})]})]})}),!m&&(0,Y.jsx)(kn,{allowDelete:t,authoredByMe:B,disabled:p,followedByMe:z,layout:`reply`,trigger:be,onCopyLink:ue,onDelete:le,onFollow:ve,onUnfollow:ye})]}),(0,Y.jsx)(`div`,{className:`relative z-10 col-start-2 col-end-3 w-full gap-4 pl-[52px]`,children:(0,Y.jsxs)(`div`,{className:`flex flex-col items-start`,children:[M?pe():(0,Y.jsxs)(Y.Fragment,{children:[n.type===`Article`&&fe(L),n.name&&(0,Y.jsx)(A,{className:`break-anywhere mt-2.5 leading-tight text-pretty`,"data-test-activity-heading":!0,children:n.name}),n.preview&&n.type===`Article`?(0,Y.jsx)(`div`,{className:`mt-1 line-clamp-3 leading-tight`,children:n.preview.content}):(0,Y.jsx)(`div`,{dangerouslySetInnerHTML:{__html:it(rt(n.content||``)??``)},ref:T,className:`ap-note-content break-anywhere tracking-[-0.006em] text-pretty text-gray-900 dark:text-gray-300 [&_p+p]:mt-3`}),n.type===`Note`&&fe(xe),n.type===`Article`&&(0,Y.jsx)(H,{className:`mt-3 w-full`,id:`read-more`,variant:`secondary`,children:`Read more`})]}),!m&&(0,Y.jsx)(`div`,{className:`space-between mt-2 ml-[-8px] flex`,children:y&&(0,Y.jsx)(In,{actor:R,commentCount:s,disabled:p,layout:i,likeCount:l,object:n,repostCount:c,onLikeClick:ce})})]})})]}),!d&&(0,Y.jsx)(`div`,{className:`absolute left-[19px] ${m?`top-[51px] bottom-[8px]`:h?`top-[51px] bottom-[5px]`:g?`top-[71px] bottom-[5px]`:`top-[71px] bottom-[-7px]`} z-0 w-[2px] rounded-sm bg-gray-200 dark:bg-gray-950`})]}),(0,Y.jsx)(jn,{currentIndex:V.currentIndex,images:V.images,isOpen:V.isOpen,onClose:Se,onNavigate:U})]}):i===`inbox`?(0,Y.jsx)(Y.Fragment,{children:n&&(0,Y.jsxs)(`div`,{className:`group/article @container/inbox-item relative -mx-4 -my-px flex min-h-[112px] min-w-0 cursor-pointer items-center justify-between rounded-lg p-6 hover:bg-gray-100 dark:hover:bg-gray-950/50`,"data-layout":`inbox`,"data-object-id":n.id,onClick:L,children:[(0,Y.jsxs)(`div`,{className:`w-full min-w-0`,children:[(0,Y.jsx)(`div`,{className:`z-10 mb-1.5 flex w-full min-w-0 items-center gap-1.5 text-sm group-hover/article:border-transparent`,children:f?(0,Y.jsx)(W,{className:`w-24`}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(X,{actor:R,isCurrentUser:B,children:(0,Y.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Y.jsx)(K,{author:R,size:`2xs`}),(0,Y.jsx)(`span`,{className:`min-w-0 truncate font-semibold text-gray-900 hover:underline dark:text-gray-600`,"data-test-activity-heading":!0,onClick:e=>{Z(R,k,e)},children:R.name})]})}),o===`Announce`&&(0,Y.jsxs)(`span`,{className:`z-10 flex items-center gap-1 text-gray-700 dark:text-gray-600`,children:[Xn,(0,Y.jsx)(X,{actor:e,align:`center`,isCurrentUser:_e,children:(0,Y.jsx)(`span`,{className:`line-clamp-1 hover:underline`,onClick:t=>{Z(e,k,t)},children:e.name})}),` `,`reposted`]}),(0,Y.jsx)(`span`,{className:`shrink-0 whitespace-nowrap text-gray-600 before:mr-1 before:content-["·"]`,title:`${b}`,children:Hn(n,!n.authored)})]})}),(0,Y.jsxs)(`div`,{className:`flex`,children:[(0,Y.jsx)(`div`,{className:`flex min-h-[73px] w-full min-w-0 flex-col items-start justify-start gap-1`,children:M?pe():(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(A,{className:`break-anywhere line-clamp-2 w-full max-w-[600px] leading-tight text-pretty`,"data-test-activity-heading":!0,children:f?(0,Y.jsx)(W,{className:`w-full max-w-96`}):n.name?n.name:(0,Y.jsx)(`span`,{dangerouslySetInnerHTML:{__html:it(at(n.content||``))}})}),(0,Y.jsx)(`div`,{className:`ap-note-content break-anywhere line-clamp-2 w-full max-w-[600px] text-base leading-normal text-pretty text-gray-900 dark:text-gray-300 [&_p+p]:mt-3`,children:f?(0,Y.jsx)(W,{count:2}):(0,Y.jsx)(`div`,{dangerouslySetInnerHTML:{__html:it(at(n.preview?.content??n.content??``))}})}),(0,Y.jsx)(`span`,{className:`mt-1 shrink-0 text-sm leading-none whitespace-nowrap text-gray-600`,children:f?(0,Y.jsx)(W,{className:`w-16`}):n.content&&`${Ln(n.content)}`})]})}),(0,Y.jsxs)(`div`,{className:`invisible absolute top-8 right-3 z-[49] flex -translate-y-1/2 rounded-lg bg-white p-1 shadow-md group-hover/article:visible dark:bg-black`,children:[y&&(0,Y.jsx)(In,{actor:R,commentCount:s,layout:i,likeCount:l,object:n,repostCount:c,onLikeClick:ce}),(0,Y.jsx)(kn,{allowDelete:t,authoredByMe:B,followedByMe:z,layout:`inbox`,trigger:be,onCopyLink:ue,onDelete:le,onFollow:ve,onUnfollow:ye})]})]})]}),M?null:N?(0,Y.jsx)(Gn,{className:`ml-8 hidden h-[91px] w-[121px] shrink-0 md:ml-9 @md/inbox-item:flex`,size:`compact`,onReveal:F}):Jn(n,f)]})}):(0,Y.jsx)(Y.Fragment,{})},Qn=5*1024*1024,$n=`Image must be less than 5MB in size.`,er=async e=>{try{let t=await fetch(e,{mode:`cors`});if(!t.ok)throw Error(`Failed to fetch image: ${t.status}`);let n=await t.blob();return new Promise((e,t)=>{let r=new FileReader;r.onload=()=>e(r.result),r.onerror=t,r.readAsDataURL(n)})}catch{return e}},tr=e=>new Promise(t=>{let n=new Image;n.onload=()=>{URL.revokeObjectURL(n.src),t(n.width===n.height)},n.src=URL.createObjectURL(e)}),nr=`Image must be square.`,rr=({children:e,replyTo:t,onReply:n,onReplyError:r,onOpenChange:i,...o})=>{let{data:s}=ht(`index`),c=mt(`index`,s),l=ot(`index`,s),{data:u,isLoading:d}=gt(`index`,`me`),[f,p]=(0,J.useState)(!1),m=(0,J.useRef)(null),h=(0,J.useRef)(null),[g,_]=(0,J.useState)(null),[v,y]=(0,J.useState)(!1),b=(0,J.useRef)(null),[x,S]=(0,J.useState)(``),[C,w]=(0,J.useState)(null),[T,E]=(0,J.useState)(``),[D,O]=(0,J.useState)(!1),[k,A]=(0,J.useState)(!1),[j,M]=(0,J.useState)(!1),N=G();(0,J.useEffect)(()=>{o.open!==void 0&&p(o.open)},[o.open]),(0,J.useEffect)(()=>{if(o.open===void 0?f:o.open){let e=setTimeout(()=>{M(!0)},300);return()=>clearTimeout(e)}else M(!1)},[f,o.open]);let ee=!x.trim()||!s||k||x.length>500,te=(0,J.useCallback)(async()=>{let e=x.trim();if(!(!e||!s))try{A(!0),t?(await l.mutateAsync({inReplyTo:t.object.id,content:e,imageUrl:C||void 0,altText:T||void 0}),n?.()):(await c.mutateAsync({content:e,imageUrl:C||void 0,altText:T||void 0}),N(`/notes`)),p(!1),i&&i(!1),a.success(t?`Reply posted`:`Note posted`)}catch{t&&r?.()}finally{A(!1)}},[x,s,t,l,c,C,T,n,r,p,N,i]),ne=e=>{S(e.target.value)};(0,J.useEffect)(()=>{m.current&&(m.current.style.height=`auto`,m.current.style.height=`${m.current.scrollHeight}px`)},[x]),(0,J.useEffect)(()=>{if((o.open===void 0?f:o.open)&&m.current){let e=setTimeout(()=>{m.current?.focus()},100);return()=>clearTimeout(e)}},[f,o.open]),(0,J.useEffect)(()=>{if(D&&h.current){let e=setTimeout(()=>{h.current?.focus()},100);return()=>clearTimeout(e)}},[D]),(0,J.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),!ee&&!v&&te())};if(o.open===void 0?f:o.open)return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[f,o.open,ee,v,te]);let P=(0,J.useCallback)(async e=>{let t=e.clipboardData?.items;if(t)for(let n=0;n<t.length;n++){let r=t[n];if(r.type.indexOf(`image`)!==-1){e.preventDefault();let t=r.getAsFile();if(t){if(t.size>5242880){a.error($n);return}let e=URL.createObjectURL(t);_(e),await F(t)}break}}},[]);(0,J.useEffect)(()=>{if(o.open===void 0?f:o.open)return document.addEventListener(`paste`,P),()=>document.removeEventListener(`paste`,P)},[f,o.open,P]);let F=async e=>{try{y(!0);let t=await bt(e);w(t)}catch(e){_(null);let t=`Failed to upload image. Try again.`;if(e&&typeof e==`object`&&`statusCode`in e)switch(e.statusCode){case 413:t=`Image size exceeds limit.`;break;case 415:t=`The file type is not supported.`;break;default:}a.error(t)}finally{y(!1)}},ie=async e=>{let t=e.target.files;if(t&&t.length>0){let n=t[0];if(n.size>5242880){a.error($n),e.target.value=``;return}let r=URL.createObjectURL(n);_(r),await F(n)}},I=e=>{e.stopPropagation(),_(null),w(null),E(``),O(!1),g&&URL.revokeObjectURL(g),b.current&&(b.current.value=``)},ae=e=>{e.stopPropagation(),O(!D)},oe=()=>{m.current?.focus()};(0,J.useEffect)(()=>()=>{g&&URL.revokeObjectURL(g)},[g]);let se=`What's new?`;if(t){let e=t.object.attributedTo||{};typeof e==`object`&&`preferredUsername`in e&&`id`in e&&(se=`Reply to ${q(e)}...`)}return(0,Y.jsxs)(Ue,{open:o.open===void 0?f:o.open,onOpenChange:e=>{e&&(S(``),_(null),w(null),E(``),O(!1),g&&URL.revokeObjectURL(g),b.current&&(b.current.value=``)),p(e),i&&i(e)},...o.open===void 0?o:{},children:[(0,Y.jsx)(Le,{asChild:!0,children:e}),(0,Y.jsxs)(Ve,{className:`max-h-[80vh] min-h-[240px] gap-0 overflow-y-auto pb-0`,"data-testid":`new-note-modal`,onClick:e=>e.stopPropagation(),children:[(0,Y.jsxs)(Be,{className:`hidden`,children:[(0,Y.jsx)(He,{children:t?`Reply`:`New note`}),(0,Y.jsx)(Re,{children:`Post your thoughts to the Social web`})]}),t&&(0,Y.jsx)(Zn,{actor:t.actor,allowDelete:!1,commentCount:t.object.replyCount??0,isCompact:!0,layout:`reply`,likeCount:t.object.likeCount??0,object:t.object,repostCount:t.object.repostCount??0,type:t.object.type===`Article`?`Article`:`Note`,onClick:()=>{}}),(0,Y.jsxs)(`div`,{className:`flex ${g?``:`min-h-36`} cursor-text items-start gap-3`,onClick:oe,children:[(0,Y.jsx)(`div`,{className:`sticky top-0`,children:(0,Y.jsx)(K,{author:s})}),(0,Y.jsx)(En,{asChild:!0,children:(0,Y.jsxs)(`div`,{className:`-mt-0.5 flex w-full flex-col gap-0.5`,children:[d?(0,Y.jsx)(W,{className:`w-10`}):(0,Y.jsx)(`span`,{className:`break-anywhere min-w-0 truncate font-semibold whitespace-nowrap text-black dark:text-white`,children:u?.name}),(0,Y.jsx)(Dn,{name:`content`,asChild:!0,children:(0,Y.jsx)(On,{asChild:!0,children:(0,Y.jsx)(`textarea`,{ref:m,autoFocus:!0,className:`ap-textarea break-anywhere w-full resize-none bg-transparent text-[1.5rem] dark:placeholder:text-gray-700`,"data-testid":`note-textarea`,placeholder:se,rows:1,value:x,onChange:ne,onPaste:P})})}),(0,Y.jsx)(Dn,{name:`image`,asChild:!0,children:(0,Y.jsx)(On,{asChild:!0,children:(0,Y.jsx)(`input`,{ref:b,accept:`image/jpeg,image/png,image/webp,image/gif`,className:`hidden`,type:`file`,onChange:ie})})})]})})]}),g&&(0,Y.jsxs)(`div`,{className:`group relative mt-6 flex min-h-[200px] w-full items-center justify-center`,children:[(0,Y.jsx)(`img`,{alt:`Image attachment preview`,className:`max-h-[320px] w-full rounded-sm object-cover outline-1 -outline-offset-1 outline-black/10 ${v&&`opacity-10`}`,src:g}),v&&(0,Y.jsx)(`div`,{className:`absolute leading-[0]`,children:(0,Y.jsx)($e,{size:`md`})}),(0,Y.jsx)(H,{className:`absolute top-3 right-3 size-8 bg-black/60 text-white opacity-0 group-hover:opacity-100 hover:bg-black/80`,onClick:I,children:(0,Y.jsx)(re,{})}),!v&&(0,Y.jsx)(H,{className:`absolute bottom-3 left-3 h-6 px-2 py-0 text-white ${D?`bg-green-500 hover:bg-green-500`:`bg-black/60 hover:bg-black/80`}`,onClick:ae,children:`Alt`})]}),g&&!v&&D&&(0,Y.jsx)(`div`,{className:`mt-1`,children:(0,Y.jsx)(Qe,{ref:h,className:`w-full border-0 bg-transparent px-0 focus-visible:border-0 focus-visible:bg-transparent focus-visible:shadow-none focus-visible:outline-0 dark:bg-(--color-popover) dark:text-white dark:placeholder:text-gray-800`,placeholder:`Type alt text for image (optional)`,type:`text`,value:T,onChange:e=>E(e.target.value)})}),(0,Y.jsxs)(Ie,{className:`${j?`sticky`:`static`} bottom-0 flex-row bg-background py-6 dark:bg-surface-elevated-2`,children:[(0,Y.jsx)(H,{className:`mr-auto w-[34px] min-w-0!`,variant:`outline`,onClick:()=>b.current?.click(),children:(0,Y.jsx)(pe,{})}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Y.jsxs)(`div`,{className:`text-sm ${x.length>=500?`text-red-500`:x.length>=500*.9?`text-yellow-600`:`text-gray-500`}`,children:[x.length,`/`,500]}),(0,Y.jsx)(H,{className:`min-w-16`,"data-testid":`post-button`,disabled:ee||v,onClick:te,children:k?(0,Y.jsx)($e,{color:`light`,size:`sm`}):`Post`})]})]})]})]})},ir=()=>{let e=G();function t(){e(`/notes/https%3A%2F%2Factivitypub.ghost.org%2F.ghost%2Factivitypub%2Fnote%2F6d6d7f57-b656-4caa-ba9e-efa1d9a4b3fb`)}return(0,Y.jsxs)(`div`,{className:`z-20 w-full bg-white dark:bg-background`,children:[(0,Y.jsxs)(`div`,{className:`flex w-full flex-col gap-0.5 border-t border-gray-200 bg-white px-3 pt-6 dark:border-gray-950 dark:bg-background`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(ie,{className:`text-purple-500`,size:20,strokeWidth:1.5}),(0,Y.jsx)(A,{children:`Beta feedback`})]}),(0,Y.jsx)(`span`,{className:`text-sm text-gray-700 dark:text-gray-600`,children:`Something not working? Let us know`}),(0,Y.jsx)(H,{className:`mt-2 dark:bg-gray-950/70 dark:hover:bg-gray-900`,variant:`secondary`,onClick:t,children:`Send feedback`})]}),(0,Y.jsxs)(`div`,{className:`-mb-1 ml-3 flex items-center gap-1.5 pt-4 pb-2 text-xs text-gray-400`,children:[(0,Y.jsx)(`a`,{className:`text-xs font-medium text-gray-700 hover:text-black dark:text-gray-600 dark:hover:text-white`,href:`https://ghost.org/help/social-web/`,rel:`noreferrer`,target:`_blank`,children:`Help`}),`⋅`,(0,Y.jsx)(`a`,{className:`text-xs font-medium text-gray-700 hover:text-black dark:text-gray-600 dark:hover:text-white`,href:`https://activitypub.ghost.org/archive`,rel:`noreferrer`,target:`_blank`,children:`Updates`})]})]})},ar=({children:e,url:t=null,onClick:n,"data-testid":r,isSelected:i=!1})=>{let a=J.Children.toArray(e),o=(0,Y.jsx)(`div`,{className:`relative flex w-full max-w-[620px] cursor-pointer flex-col before:absolute before:inset-x-[-16px] before:inset-y-[-1px] before:rounded-md before:bg-gray-50 before:transition-opacity hover:z-10 hover:cursor-pointer hover:border-b-transparent hover:before:opacity-100 dark:before:bg-gray-950 ${i?`z-10 before:opacity-100`:`before:opacity-0`}`,"data-testid":r,onClick:()=>{!t&&n&&n()},children:(0,Y.jsxs)(`div`,{className:`relative z-10 flex w-full items-center gap-3 py-3`,children:[a[0],a[1],a[2]]})});return t?(0,Y.jsx)(`a`,{href:t,rel:`noreferrer`,target:`_blank`,onClick:e=>{n&&(e.preventDefault(),n())},children:o}):o},or=()=>{let e=G(),{suggestedProfilesQuery:t}=ft(`index`,3),{data:n,isLoading:r}=t,i=r?[,,,].fill(null):n||[],{resetStack:a}=_();return!r&&(!n||n.length===0)?null:(0,Y.jsxs)(`div`,{className:`border-t border-gray-200 px-3 pt-6 dark:border-gray-950 [@media(max-height:740px)]:hidden`,children:[(0,Y.jsxs)(`div`,{className:`mb-3 flex flex-col gap-0.5`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(U,{className:`text-purple-500`,size:20,strokeWidth:1.5}),(0,Y.jsx)(A,{children:`Follow suggestions`})]}),(0,Y.jsx)(`span`,{className:`text-sm text-gray-700 dark:text-gray-600`,children:`Accounts you might be interested in`})]}),(0,Y.jsx)(`ul`,{className:`grow`,children:i.map((t,n)=>{let i=t?.id||`loading-${n}`,a=t?.name||``,o=t?.handle||``,s=t?.avatarUrl||``,c;switch(n){case 0:c=`[@media(max-height:740px)]:hidden`;break;case 1:c=`[@media(max-height:800px)]:hidden`;break;case 2:c=`[@media(max-height:860px)]:hidden`;break}return(0,Y.jsx)(J.Fragment,{children:(0,Y.jsx)(`li`,{className:c,children:(0,Y.jsx)(X,{actor:t,align:`center`,isCurrentUser:!1,side:`left`,children:(0,Y.jsx)(`div`,{children:(0,Y.jsxs)(ar,{onClick:()=>{!r&&t&&Z(t,e)},children:[r?(0,Y.jsx)(W,{className:`z-10 size-10`}):(0,Y.jsx)(K,{author:{icon:{url:s},name:a,handle:o},showFollowButton:!0}),(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,Y.jsx)(`span`,{className:`block max-w-[190px] truncate font-semibold text-black dark:text-white`,children:r?(0,Y.jsx)(W,{className:`w-24`}):a}),(0,Y.jsx)(`span`,{className:`block max-w-[190px] truncate text-sm text-gray-700 dark:text-gray-600`,children:r?(0,Y.jsx)(W,{className:`w-40`}):o})]})]})})})},i)},i)})}),(0,Y.jsx)(H,{className:`p-0 font-medium text-purple hover:text-black dark:hover:text-white`,variant:`link`,onClick:()=>{a(),e(`/explore`)},children:`Find more →`})]})},sr=({profile:e,update:t,isLoading:n,onOpenChange:r})=>{let i=()=>{t(e.id,{followedByMe:!0})},a=()=>{t(e.id,{followedByMe:!1})},o=G();return(0,Y.jsx)(X,{actor:e,align:`center`,isCurrentUser:!1,side:`left`,children:(0,Y.jsx)(`div`,{children:(0,Y.jsxs)(ar,{onClick:()=>{r?.(!1),o(`/profile/${e.handle}`)},children:[(0,Y.jsx)(K,{author:{icon:{url:e.avatarUrl},name:e.name,handle:e.handle},onClick:()=>r?.(!1)}),(0,Y.jsxs)(`div`,{className:`break-anywhere flex grow flex-col`,children:[(0,Y.jsx)(`span`,{className:`line-clamp-1 font-semibold text-black dark:text-white`,children:n?(0,Y.jsx)(W,{className:`w-full max-w-64`}):e.name}),(0,Y.jsx)(`span`,{className:`line-clamp-1 text-sm text-gray-700 dark:text-gray-600`,children:n?(0,Y.jsx)(W,{className:`w-24`}):e.handle})]}),n?(0,Y.jsx)(`div`,{className:`inline-flex items-center`,children:(0,Y.jsx)(W,{className:`w-12`})}):(0,Y.jsx)(Nn,{className:`ml-auto`,following:e.followedByMe,handle:e.handle,type:`secondary`,onFollow:i,onUnfollow:a})]},e.id)})})},cr=({onOpenChange:e})=>{let{suggestedProfilesQuery:t,updateSuggestedProfile:n}=ft(`index`,5),{data:r=[],isLoading:i}=t;return!i&&(!r||r.length===0)?null:(0,Y.jsx)(`div`,{className:`mb-[-15px] flex flex-col gap-3 pt-2`,children:(0,Y.jsx)(`div`,{className:`flex flex-col`,children:(i?[,,,,,].fill(null):r||[]).map((t,r)=>(0,Y.jsx)(J.Fragment,{children:(0,Y.jsx)(sr,{isLoading:i,profile:t||{id:``,name:``,handle:``,avatarUrl:``,bio:``,followerCount:0,followingCount:0,followedByMe:!1},update:n,onOpenChange:e})},t?.id||`loading-${r}`))})})},lr=80,ur=({onOpenChange:e,query:t,setQuery:n})=>{let r=(0,J.useRef)(null),i=(0,J.useRef)([]),a=(0,J.useRef)(0),o=G(),[s]=Et(t,300),c=t.length>=2,{searchQuery:l,updateAccountSearchResult:u}=dt(`index`,c?s:``),{data:d,isFetching:f,isFetched:p}=l,{suggestedProfilesQuery:m}=ft(`index`,5),{data:h,isLoading:g}=m,_=g||h&&h.length>0,{topicsQuery:v}=lt(),{data:y}=v,{data:b}=gt(`index`,`me`),[x,S]=(0,J.useState)([]),[C,w]=(0,J.useState)(null),[T,E]=(0,J.useState)(0),D=(0,J.useMemo)(()=>{let e=y?.topics||[];if(!c||e.length===0)return[];let n=t.toLowerCase();return e.filter(e=>e.slug===`following`?!1:e.name.toLowerCase().startsWith(n)||e.slug.toLowerCase().startsWith(n))},[t,c,y?.topics]),O=(0,J.useMemo)(()=>[...D.map(e=>({type:`topic`,data:e})),...x.map(e=>({type:`account`,data:e}))],[D,x]);(0,J.useEffect)(()=>{if(!c){S([]),w(null);return}p&&(d?.accounts&&d.accounts.length>0?(S(d.accounts),w(`results`),E(0)):(S([]),w(`none`),E(0)))},[d?.accounts,p,c]);let k=f&&c,j=t.length<2||!C&&c&&D.length===0,M=!j&&C===`none`&&D.length===0,N=!j&&(x.length>0||D.length>0);return(0,J.useEffect)(()=>{r.current?.focus()},[]),(0,J.useEffect)(()=>{let e=i.current[T];if(!e)return;let t=e.closest(`[data-radix-scroll-area-viewport]`)||e.closest(`.overflow-y-auto`);if(!t){e.scrollIntoView({block:`nearest`});return}let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();r.top<n.top+lr?t.scrollTo({top:t.scrollTop-(n.top+lr-r.top),behavior:`smooth`}):r.bottom>n.bottom-lr&&t.scrollTo({top:t.scrollTop+(r.bottom-n.bottom+lr),behavior:`smooth`})},[T]),(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`div`,{className:`sticky -top-6 z-30 -mt-6 flex h-[72px] shrink-0 items-center gap-2 bg-white pt-3 pb-2 before:pointer-events-none before:absolute before:-inset-x-6 before:bottom-0 before:h-0 before:border-b before:border-b-gray-200 before:content-[""] dark:bg-surface-elevated-2 dark:before:border-b-gray-950`,children:[(0,Y.jsx)(_e,{className:`text-gray-600`,size:18,strokeWidth:1.5}),(0,Y.jsx)(Qe,{ref:r,autoComplete:`off`,className:`flex h-10 w-full items-center rounded-lg border-0 bg-transparent px-0 py-1.5 text-lg !shadow-none !outline-none focus-visible:!border-0 focus-visible:bg-transparent focus-visible:!shadow-none focus-visible:!ring-0 focus-visible:!outline-0 dark:bg-surface-elevated-2 dark:text-white dark:placeholder:text-gray-800`,placeholder:`Search by name, handle, or URL...`,title:`Search`,type:`text`,value:t,onChange:e=>n(e.target.value),onKeyDown:t=>{if(!(!N||O.length===0)){if(t.key===`ArrowDown`||t.key===`ArrowUp`){t.preventDefault();let e=Date.now();if(e-a.current<50)return;a.current=e,t.key===`ArrowDown`?E(e=>(e+1)%O.length):E(e=>(e-1+O.length)%O.length)}else if(t.key===`Enter`){let n=O[T];if(!n)return;t.preventDefault(),e?.(!1),n.type===`topic`?o(`/explore/${n.data.slug}`):o(`/profile/${n.data.handle}`)}}}}),k&&(0,Y.jsx)($e,{className:`absolute! right-0 mr-0.5 shrink-0`,size:`sm`})]}),(0,Y.jsxs)(`div`,{className:`h-full`,children:[M&&(0,Y.jsx)(`div`,{className:`flex h-full items-center justify-center pb-14`,children:(0,Y.jsxs)(tt,{children:[(0,Y.jsx)(et,{children:(0,Y.jsx)(fe,{})}),`No users matching this handle or account URL`]})}),N&&(0,Y.jsx)(`div`,{className:`mt-[-14px] pb-2`,children:O.map((t,n)=>{let r=n===T;if(t.type===`topic`)return(0,Y.jsx)(`div`,{ref:e=>i.current[n]=e,children:(0,Y.jsxs)(ar,{isSelected:r,onClick:()=>{e?.(!1),o(`/explore/${t.data.slug}`)},children:[(0,Y.jsx)(`div`,{className:`flex size-10 shrink-0 items-center justify-center rounded-full bg-gray-100 dark:bg-gray-900`,children:(0,Y.jsx)(U,{className:`text-gray-700 dark:text-gray-500`,size:18,strokeWidth:1.5})}),(0,Y.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Y.jsx)(`span`,{className:`font-semibold text-black dark:text-white`,children:t.data.name}),(0,Y.jsx)(`span`,{className:`text-sm text-gray-700 dark:text-gray-600`,children:`Topic`})]})]})},t.data.slug);let a=t.data,s=a.handle===b?.handle;return(0,Y.jsx)(X,{actor:a,align:`center`,isCurrentUser:s,side:`left`,children:(0,Y.jsx)(`div`,{ref:e=>i.current[n]=e,children:(0,Y.jsxs)(ar,{isSelected:r,onClick:()=>{e?.(!1),o(`/profile/${a.handle}`)},children:[(0,Y.jsx)(K,{author:{icon:{url:a.avatarUrl},name:a.name,handle:a.handle}}),(0,Y.jsxs)(`div`,{className:`break-anywhere flex flex-col`,children:[(0,Y.jsx)(`span`,{className:`line-clamp-1 font-semibold text-black dark:text-white`,children:a.name}),(0,Y.jsx)(`span`,{className:`line-clamp-1 text-sm text-gray-700 dark:text-gray-600`,children:a.handle})]}),a.blockedByMe||a.domainBlockedByMe?(0,Y.jsx)(H,{className:`pointer-events-none ml-auto min-w-[90px]`,variant:`destructive`,children:`Blocked`}):s?null:(0,Y.jsx)(Nn,{className:`ml-auto`,following:a.followedByMe,handle:a.handle,type:`secondary`,onFollow:()=>u(a.id,{followedByMe:!0}),onUnfollow:()=>u(a.id,{followedByMe:!1})})]})})},a.id)})}),j&&_&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(A,{children:`More people to follow`}),(0,Y.jsx)(cr,{onOpenChange:e})]})]})]})},dr=()=>(0,Y.jsxs)(`div`,{className:`inline-flex h-9 w-full items-center justify-start gap-2 rounded-full bg-gray-100 px-3 font-normal text-gray-600 hover:bg-gray-200 hover:text-gray-600 dark:bg-gray-950/70 dark:text-gray-700 dark:hover:bg-gray-950 [&_svg]:size-[18px]`,children:[(0,Y.jsx)(_e,{size:18,strokeWidth:1.5}),` Search the social web`]}),$=J.forwardRef(({to:e,children:t,count:n,...r},i)=>{let a=f(),{resetStack:o}=_(),s=nt(),c=e&&e.startsWith(`/`)?`${s}${e}`:e,l=S(`h-8 justify-start font-medium text-gray-800 dark:text-gray-500 dark:hover:bg-gray-950/70 [&_svg]:size-[18px]`,c&&(a.pathname===c||a.pathname.startsWith(`${c}/`))&&`bg-gray-100 font-semibold text-black dark:bg-gray-950/70 dark:text-white`),d=n&&n>0?(0,Y.jsx)(`span`,{className:S(`ml-auto flex h-5 min-w-[20px] items-center justify-center rounded-full bg-purple-500 px-1.5 py-1 text-xs font-semibold text-white`),children:x(n)}):null;return c?(0,Y.jsx)(H,{className:l,shape:`rounded`,variant:`ghost`,asChild:!0,children:(0,Y.jsxs)(u,{to:c,onClick:()=>{o(),m(c)},children:[t,d]})}):(0,Y.jsxs)(H,{ref:i,className:l,shape:`rounded`,variant:`ghost`,onClick:r.onClick,...r,children:[t,d]})});$.displayName=`SidebarMenuLink`;var fr=({isMobileSidebarOpen:e})=>{let{allFlags:t,flags:n}=Pt(),[i,a]=J.useState(!1),[o,s]=J.useState(``),{data:c}=r(),l=f(),u=nt(),{data:d}=st(c?.slug||``),p=ut(c?.slug||``),{topicsQuery:m}=lt(),{data:h,isLoading:g}=m,_=!g&&h&&h.topics.length===0;J.useEffect(()=>{l.pathname===`${u}/notifications`&&d&&d>0&&p.mutate()},[l.pathname,u,d,p]);let v=J.useCallback(()=>{d&&d>0&&p.mutate()},[d,p]);return(0,Y.jsx)(`div`,{className:`sticky top-0 flex min-h-screen w-[320px] flex-col border-l border-gray-200 pr-[var(--network-gutter,1.5rem)] transition-transform duration-300 ease-in-out max-lg:fixed max-lg:inset-y-0 max-lg:right-0 max-lg:z-50 max-lg:border-0 max-lg:bg-white max-lg:shadow-xl max-md:bottom-[72px] max-md:min-h-[auto] max-md:overflow-y-scroll dark:border-gray-950 max-lg:dark:bg-black ${e?`max-lg:translate-x-0`:`max-lg:translate-x-full`}`,children:(0,Y.jsxs)(`div`,{className:`flex grow flex-col justify-between`,children:[(0,Y.jsxs)(`div`,{className:`isolate flex w-full flex-col items-start gap-6 pt-5 pl-6`,children:[(0,Y.jsx)(`div`,{className:`flex w-full items-center`,children:(0,Y.jsxs)(Ue,{open:i,onOpenChange:a,children:[(0,Y.jsx)(Le,{className:`mt-0.5 w-full`,children:(0,Y.jsx)(dr,{})}),(0,Y.jsx)(Ve,{className:`flex h-full max-h-[452px] flex-col overflow-y-auto pb-0`,children:(0,Y.jsx)(ur,{query:o,setQuery:s,onOpenChange:a})})]})}),(0,Y.jsxs)(`div`,{className:`flex w-full flex-col gap-px`,children:[(0,Y.jsxs)($,{to:`/reader`,children:[(0,Y.jsx)(L,{size:18,strokeWidth:1.5}),`Reader`]}),(0,Y.jsxs)($,{to:`/notes`,children:[(0,Y.jsx)(ce,{size:18,strokeWidth:1.5}),`Notes`]}),(0,Y.jsxs)($,{count:l.pathname===`${u}/notifications`?void 0:d,to:`/notifications`,onClick:v,children:[(0,Y.jsx)(le,{size:18,strokeWidth:1.5}),`Notifications`]}),_?(0,Y.jsx)(H,{className:`inline-flex w-full items-center gap-2 px-3 py-2.5 text-left font-medium text-gray-800 transition-colors hover:bg-gray-100 dark:text-gray-500 dark:hover:bg-gray-950/70`,shape:`rounded`,variant:`ghost`,asChild:!0,children:(0,Y.jsxs)(`a`,{href:`https://explore.ghost.org/social-web`,rel:`noopener noreferrer`,target:`_blank`,children:[(0,Y.jsx)(U,{size:18,strokeWidth:1.5}),`Explore`,(0,Y.jsx)(ae,{className:`ml-auto`,size:14,strokeWidth:1.5})]})}):(0,Y.jsxs)($,{to:`/explore`,children:[(0,Y.jsx)(U,{size:18,strokeWidth:1.5}),`Explore`]}),(0,Y.jsxs)($,{to:`/profile`,children:[(0,Y.jsx)(Se,{size:18,strokeWidth:1.5}),`Profile`]}),(0,Y.jsxs)($,{to:`/preferences`,children:[(0,Y.jsx)(ee,{size:18,strokeWidth:1.5}),`Preferences`]})]}),(0,Y.jsx)(rr,{children:(0,Y.jsxs)(H,{className:`h-9 rounded-full bg-purple-500 px-3 text-white hover:bg-purple-600 dark:hover:bg-purple-600`,children:[(0,Y.jsx)(R,{}),`New note`]})}),(0,Y.jsx)(or,{}),t.map(e=>n[e]?(0,Y.jsxs)(`div`,{className:`flex items-center justify-between gap-1 pl-3 opacity-50`,children:[(0,Y.jsx)(`span`,{className:`font-mono text-xs`,children:e}),(0,Y.jsx)(`span`,{className:`inline-flex items-center rounded bg-green-100 px-1 py-0.5 text-xs font-medium text-green-800`,children:`ON`})]},e):(0,Y.jsx)(Y.Fragment,{}))]}),(0,Y.jsx)(`div`,{className:`sticky bottom-0 flex items-center gap-2 bg-white pb-4 pl-4 dark:bg-background`,children:(0,Y.jsx)(ir,{})})]})})};fr.displayName=`Sidebar`;var pr=(0,J.createContext)(void 0),mr=pr.Provider,hr=()=>(0,J.useContext)(pr),gr=({children:e,className:t,style:n,...i})=>{let a=hr(),{isOnboarded:o}=wt(),s=nt(),{data:c,isLoading:l}=r(),u=(0,J.useRef)(null),[d,f]=(0,J.useState)(!1),p=Lt(),{topicsQuery:m}=lt(),{data:h}=m,_=h&&h.topics.length>0,{isNewNoteModalOpen:y,setIsNewNoteModalOpen:b}=Fn(),x=()=>{f(!d)},C=()=>{f(!1)};return l||!c?null:o?(0,Y.jsxs)(`div`,{ref:u,className:`h-screen w-full ${o&&`overflow-y-auto`}`,"data-scrollable-container":!0,children:[(0,Y.jsx)(g,{containerRef:u}),(0,Y.jsx)(`div`,{className:S(`relative mx-auto flex flex-col`,t,a?.contentClassName??`max-w-page`),style:{...n,"--network-gutter":a?.contentGutter},...i,children:o?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`div`,{className:`block grid-cols-[auto_320px] items-start lg:grid`,children:[(0,Y.jsxs)(`div`,{className:`z-0 min-w-0`,children:[(0,Y.jsx)(Bt,{showBorder:!(p===`reader`&&_)&&p!==`explore`,onToggleMobileSidebar:x}),(0,Y.jsx)(`div`,{className:p===`profile`?S(`px-2 pt-2`,a?.profileContentClassName):`px-[var(--network-gutter,min(4vw,24px))]`,children:e})]}),(0,Y.jsx)(fr,{isMobileSidebarOpen:d,onCloseMobileSidebar:C})]}),d&&(0,Y.jsx)(`div`,{className:`fixed inset-0 z-40 lg:hidden`,onClick:C})]}):(0,Y.jsx)(Tt,{})}),(0,Y.jsx)(rr,{open:y,onOpenChange:b})]}):(0,Y.jsx)(v,{to:`${s}/welcome`,replace:!0})},_r=({children:e})=>(0,Y.jsx)(`div`,{className:`flex max-h-12 max-w-12 grow-0 items-center justify-center rounded-full bg-gray-100 p-3 text-gray-700 dark:bg-gray-950/70 [&_svg]:size-8 [&_svg]:stroke-1`,children:e}),vr=({children:e,className:t})=>(0,Y.jsx)(`div`,{className:`mx-auto mt-[24vh] flex max-w-[500px] flex-col items-center gap-5 text-center text-gray-700 ${t||``}`,children:e}),yr=({statusCode:e,errorCode:t})=>{let n=c(),r=p();return n?(0,Y.jsx)(gr,{children:(0,Y.jsxs)(vr,{children:[(0,Y.jsx)(_r,{children:(0,Y.jsx)(xe,{})}),(0,Y.jsx)(A,{className:`-mb-4`,children:`Oops, page not found!`}),(0,Y.jsx)(`div`,{children:`We couldn't find the page you were looking for. It may have been moved, deleted, or never existed in the first place.`})]})}):e===429?(0,Y.jsxs)(vr,{className:`mt-[50vh] -translate-y-1/2`,children:[(0,Y.jsx)(_r,{children:(0,Y.jsx)(ne,{})}),(0,Y.jsx)(A,{className:`-mb-4`,children:`Rate limit exceeded`}),(0,Y.jsx)(`div`,{children:`You've made too many requests. Please try again in a moment.`}),(0,Y.jsx)(H,{asChild:!0,children:(0,Y.jsx)(`a`,{href:`https://ghost.org/help/social-web/`,rel:`noopener noreferrer`,target:`_blank`,children:`Learn more →`})})]}):e===403?t===`ROLE_MISSING`||t===`SITE_MISSING`?(0,Y.jsxs)(vr,{className:`mt-[50vh] -translate-y-1/2`,children:[(0,Y.jsx)(_r,{children:(0,Y.jsx)(se,{})}),(0,Y.jsx)(A,{className:`-mb-4`,children:`Site not configured correctly`}),(0,Y.jsx)(`div`,{children:`This feature can't be used because the site isn't set up correctly. If you manage this site, check your settings or server logs, or contact support.`}),(0,Y.jsx)(H,{asChild:!0,children:(0,Y.jsx)(`a`,{href:`https://ghost.org/help/social-web/`,rel:`noopener noreferrer`,target:`_blank`,children:`Learn more →`})})]}):(0,Y.jsxs)(vr,{className:`mt-[50vh] -translate-y-1/2`,children:[(0,Y.jsx)(_r,{children:(0,Y.jsx)(P,{})}),(0,Y.jsx)(A,{className:`-mb-4`,children:`Account suspended`}),(0,Y.jsx)(`div`,{children:`Your account has been suspended due to policy violations.`}),(0,Y.jsx)(H,{asChild:!0,children:(0,Y.jsx)(`a`,{href:`https://ghost.org/help/social-web/`,rel:`noopener noreferrer`,target:`_blank`,children:`Learn more →`})})]}):e===410&&t===`INVALID_VERSION`?(0,Y.jsxs)(vr,{className:`mt-[50vh] -translate-y-1/2`,children:[(0,Y.jsx)(_r,{children:(0,Y.jsx)(ue,{})}),(0,Y.jsx)(A,{className:`-mb-4`,children:`New version available`}),(0,Y.jsx)(`div`,{children:`We've made some updates! Refresh your page to see what's new`}),(0,Y.jsx)(H,{asChild:!0,children:(0,Y.jsx)(`button`,{type:`button`,onClick:()=>window.location.reload(),children:`Refresh your page`})})]}):(0,Y.jsx)(O,{align:`center`,className:`h-screen w-full bg-background`,gap:`none`,justify:`center`,children:(0,Y.jsxs)(O,{align:`start`,className:`max-w-xl rounded-[20px] bg-surface-elevated p-[5vmin] text-card-foreground shadow-lg`,gap:`lg`,children:[(0,Y.jsx)(`h1`,{className:`text-[2.9rem] leading-[1.3] font-bold tracking-[-0.021em]`,children:`Loading interrupted`}),(0,Y.jsx)(`p`,{children:`They say life is a series of trials and tribulations. This moment right here? It's a tribulation. Our app was supposed to load, and yet here we are. Loadless. Click back to the dashboard to try again.`}),(0,Y.jsx)(`a`,{className:`mt-2 cursor-pointer rounded-sm border border-current px-2.5 py-1.5 text-green`,onClick:e=>{e.preventDefault(),r(`/analytics/`,{crossApp:!0})},children:`← Back to the homepage`})]})})},br=e({default:()=>yr}),xr=[{path:`activitypub`,element:(0,Y.jsx)(l,{}),errorElement:(0,Y.jsx)(yr,{}),handle:`activitypub-basepath`,children:[{index:!0,element:(0,Y.jsx)(v,{to:`reader`})},{path:`inbox`,element:(0,Y.jsx)(v,{to:`../reader`,replace:!0})},{path:`feed`,element:(0,Y.jsx)(v,{to:`../notes`,replace:!0})},{path:`reader`,lazy:N(()=>o(()=>import(`./inbox-BHfpmmzn.js`),__vite__mapDeps([2,1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60]),import.meta.url)),pageTitle:`Reader`},{path:`reader/:postId`,lazy:N(()=>o(()=>import(`./inbox-BHfpmmzn.js`),__vite__mapDeps([2,1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60]),import.meta.url)),pageTitle:`Reader`},{path:`notes`,lazy:N(()=>o(()=>import(`./feed-B_0m7WhZ.js`),__vite__mapDeps([61,1,3,62,8,9,10,35,14,21,22,23,4,5,6,7,11,12,13,24,25,26,28,29,30,31,32,33,34,36,37,38,39,40,17,16,41,42,15,19,20,43,44,45,46,47,48,49,18,27,50,51,52,53,54,55,56,57,58]),import.meta.url)),pageTitle:`Notes`},{path:`notes/:postId`,lazy:N(()=>o(()=>import(`./note-CF4LrSmR.js`),__vite__mapDeps([63,1,3,4,5,6,7,8,9,10,11,12,13,14,21,22,23,24,25,26,60]),import.meta.url)),pageTitle:`Note`},{path:`notifications`,lazy:N(()=>o(()=>import(`./notifications-BmHJmqIJ.js`),__vite__mapDeps([64,1,3,8,9,10,14,21,22,23,4,5,6,7,11,12,13,24,25,26,58]),import.meta.url)),pageTitle:`Notifications`},{path:`explore`,lazy:N(()=>o(()=>import(`./explore-C69LSRVg.js`),__vite__mapDeps([65,1,3,4,5,62,8,9,10,35,14,21,22,23,6,7,11,12,13,24,25,26,66,31,32,67,58,59]),import.meta.url)),pageTitle:`Explore`},{path:`explore/:topic`,lazy:N(()=>o(()=>import(`./explore-C69LSRVg.js`),__vite__mapDeps([65,1,3,4,5,62,8,9,10,35,14,21,22,23,6,7,11,12,13,24,25,26,66,31,32,67,58,59]),import.meta.url)),pageTitle:`Explore`},{path:`profile`,lazy:N(()=>o(()=>import(`./profile-CS4fP60N.js`),__vite__mapDeps([68,1,3,10,9,4,5,6,7,8,11,12,13,62,35,14,69,16,17,42,15,18,19,70,71,72,43,44,22,21,73,25,26,53,74,75,76,39,28,29,30,31,32,33,34,36,37,38,40,41,20,45,46,47,48,49,27,50,51,52,54,55,56,57,23,24,58,77]),import.meta.url)),pageTitle:`Profile`},{path:`profile/likes`,lazy:N(()=>o(()=>import(`./profile-CS4fP60N.js`),__vite__mapDeps([68,1,3,10,9,4,5,6,7,8,11,12,13,62,35,14,69,16,17,42,15,18,19,70,71,72,43,44,22,21,73,25,26,53,74,75,76,39,28,29,30,31,32,33,34,36,37,38,40,41,20,45,46,47,48,49,27,50,51,52,54,55,56,57,23,24,58,77]),import.meta.url)),pageTitle:`Profile`},{path:`profile/following`,lazy:N(()=>o(()=>import(`./profile-CS4fP60N.js`),__vite__mapDeps([68,1,3,10,9,4,5,6,7,8,11,12,13,62,35,14,69,16,17,42,15,18,19,70,71,72,43,44,22,21,73,25,26,53,74,75,76,39,28,29,30,31,32,33,34,36,37,38,40,41,20,45,46,47,48,49,27,50,51,52,54,55,56,57,23,24,58,77]),import.meta.url)),pageTitle:`Profile`},{path:`profile/followers`,lazy:N(()=>o(()=>import(`./profile-CS4fP60N.js`),__vite__mapDeps([68,1,3,10,9,4,5,6,7,8,11,12,13,62,35,14,69,16,17,42,15,18,19,70,71,72,43,44,22,21,73,25,26,53,74,75,76,39,28,29,30,31,32,33,34,36,37,38,40,41,20,45,46,47,48,49,27,50,51,52,54,55,56,57,23,24,58,77]),import.meta.url)),pageTitle:`Profile`},{path:`profile/:handle/:tab?`,lazy:N(()=>o(()=>import(`./profile-CS4fP60N.js`),__vite__mapDeps([68,1,3,10,9,4,5,6,7,8,11,12,13,62,35,14,69,16,17,42,15,18,19,70,71,72,43,44,22,21,73,25,26,53,74,75,76,39,28,29,30,31,32,33,34,36,37,38,40,41,20,45,46,47,48,49,27,50,51,52,54,55,56,57,23,24,58,77]),import.meta.url)),pageTitle:`Profile`},{path:`preferences`,lazy:N(()=>o(()=>import(`./preferences-DFhf_pJF.js`),__vite__mapDeps([78,1,3,10,9,8,62,35,14,21,22,79,39,28,7,26,29,30,31,32,33,5,4,6,11,12,13,34,36,37,38,40,17,16,41,42,15,19,20,43,44,45,46,47,48,49,18,27,50,51,52,25,53,54,55,56,57,24,23,58,77,70,71,72,73,74]),import.meta.url)),pageTitle:`Preferences`},{path:`preferences/moderation`,lazy:N(()=>o(()=>import(`./moderation-OtjZoNOc.js`),__vite__mapDeps([80,1,3,10,9,62,8,35,14,21,75,81,82,76,39,28,7,26,29,30,31,32,33,5,4,6,11,12,13,34,36,37,38,40,17,16,41,42,15,19,20,43,44,45,22,46,47,48,49,18,27,50,51,52,25,53,54,55,56,57,23,24,58,77,70,71,72,73,74]),import.meta.url)),pageTitle:`Moderation`,showBackButton:!0},{path:`preferences/bluesky-sharing`,lazy:N(()=>o(()=>import(`./bluesky-sharing-CrfpFHQ9.js`),__vite__mapDeps([83,1,3,10,9,62,8,35,14,69,16,17,15,70,71,72,43,44,22,21,73,25,7,26,53,74,24,23,4,5,6,11,12,13,58]),import.meta.url)),showBackButton:!0},{path:`preferences/move`,lazy:N(()=>o(()=>import(`./account-migration-D05akW4q.js`),__vite__mapDeps([84,1,3,62,8,9,10,35,14,85,71,72,43,44,21,22,25,7,26,58]),import.meta.url)),pageTitle:`Account migration`,showBackButton:!0},{path:`preferences/handle`,lazy:N(()=>o(()=>import(`./domain-DiFl_Z1A.js`),__vite__mapDeps([86,1,3,8,9,10,34,12,62,35,14,85,71,72,43,44,21,22,25,7,26,28,29,30,31,32,33,5,4,6,11,13,36,37,38,39,40,17,16,41,42,15,19,20,45,46,47,48,49,18,27,50,51,52,53,54,55,56,57,58,74]),import.meta.url)),pageTitle:`Handle`,showBackButton:!0},{path:`welcome`,lazy:N(()=>o(()=>import(`./onboarding-Bpo1yTzA.js`).then(e=>e.t),__vite__mapDeps([67,1,66,26,7,3,10,9,4,5,31,32]),import.meta.url)),pageTitle:`Welcome`,children:[{path:``,element:(0,Y.jsx)(v,{to:`1`,replace:!0})},{path:`1`,lazy:N(()=>o(()=>import(`./step-1-CLYhNmG9.js`),__vite__mapDeps([87,1,3,62,8,9,10,35,14,21,23,4,5,6,7,11,12,13,24,25,26,31,32]),import.meta.url))},{path:`2`,lazy:N(()=>o(()=>import(`./step-2-B2ujMlpa.js`),__vite__mapDeps([88,1,3,14,8,9,10,41,23,4,5,6,7,11,12,13,28,26,29,30,31,32,33,34,35,36,37,38,39,40,17,16,42,15,19,20,43,44,45,21,22,46,47,48,49,18,27,50,51,52,25,53,54,55,56,57,89]),import.meta.url))},{path:`3`,lazy:N(()=>o(()=>import(`./step-3-DoaTWqqj.js`),__vite__mapDeps([90,1,3,62,8,9,10,35,14,41,23,4,5,6,7,11,12,13,25,26,66,31,32,28,29,30,33,34,36,37,38,39,40,17,16,42,15,19,20,43,44,45,21,22,46,47,48,49,18,27,50,51,52,53,54,55,56,57,89]),import.meta.url))},{path:`*`,element:(0,Y.jsx)(v,{to:`1`,replace:!0})}]},{path:`*`,lazy:N(()=>o(()=>Promise.resolve().then(()=>br),void 0,import.meta.url))}]}];export{Ln as C,Ft as D,Nn as E,jt as O,Z as S,X as T,Gn as _,gr as a,Un as b,rr as c,nr as d,er as f,Kn as g,Zn as h,vr as i,$n as l,qn as m,yr as n,mr as o,tr as p,_r as r,ar as s,xr as t,Qn as u,Q as v,In as w,Hn as x,Wn as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`0013ce64-ccf2-4d19-a295-3074104b742d`,e._sentryDebugIdIdentifier=`sentry-dbid-0013ce64-ccf2-4d19-a295-3074104b742d`)}catch{}})();import{c as e,s as t}from"./hooks-0r7qxGEo.js";import{t as n}from"./posts-CftunZgV.js";import{g as r,p as i}from"./schemas-21VB7GGY.js";import{t as a}from"./pages-Bm-zFXyP.js";var o={posts:n,pages:a,tags:`TagsResponseType`,users:t},s=i({id:r(),slug:r().optional(),name:r().optional(),title:r().optional(),status:r().optional(),url:r().nullable().optional(),visibility:r().optional(),published_at:r().nullable().optional()});function c(e){return Array.isArray(e)?e.flatMap(e=>{let t=s.safeParse(e);return t.success?[t.data]:[]}):[]}function l(t,n,r){let i=e(`/search-index/${t}/`);return{queryKey:[o[t],i],queryFn:async()=>{let e=await n(i,r);return{[t]:c(e[t])}},staleTime:1/0,gcTime:1/0}}export{l as t};
|