ghost 6.16.0 → 6.16.1

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.
Files changed (105) hide show
  1. package/components/tryghost-i18n-6.16.1.tgz +0 -0
  2. package/components/{tryghost-parse-email-address-6.16.0.tgz → tryghost-parse-email-address-6.16.1.tgz} +0 -0
  3. package/core/built/admin/assets/{PolarAngleAxis-xPy2tnwX.js → PolarAngleAxis-DUgbFtOk.js} +1 -1
  4. package/core/built/admin/assets/{_baseAssignValue-DyITDSi7.js → _baseAssignValue-DRkJyH0k.js} +1 -1
  5. package/core/built/admin/assets/{a-large-small-L2U_wPWJ.js → a-large-small-DeaMDhiq.js} +1 -1
  6. package/core/built/admin/assets/{at-sign-zn6VHHIb.js → at-sign-DpSvWaBL.js} +1 -1
  7. package/core/built/admin/assets/{audience-C5nYXN-z.js → audience-DyqogFKk.js} +1 -1
  8. package/core/built/admin/assets/{avatar-flipboard-D61vqpZi.js → avatar-flipboard-DUUQeCKh.js} +1 -1
  9. package/core/built/admin/assets/{bluesky-sharing-YNHtFCeH.js → bluesky-sharing-DDW1Nub2.js} +1 -1
  10. package/core/built/admin/assets/{chart-2aLRupgZ.js → chart-DKdadfuk.js} +1 -1
  11. package/core/built/admin/assets/{chunk.524.646bf523352edaa738e4.js → chunk.524.d561c6d103132c453611.js} +7 -7
  12. package/core/built/admin/assets/{chunk.582.9bda90fed502e6e1c3be.js → chunk.582.fbd6ac96278274d050d9.js} +9 -9
  13. package/core/built/admin/assets/{code-editor-view-8Hho-G3u.js → code-editor-view-lAF4hhO4.js} +1 -1
  14. package/core/built/admin/assets/{comments-CtogcEO1.js → comments-DtPXetSc.js} +1 -1
  15. package/core/built/admin/assets/{copy-Bm8UN6-f.js → copy-DdFJ2rqh.js} +1 -1
  16. package/core/built/admin/assets/{data-list-C6hL1gtO.js → data-list-DxMYpFN2.js} +1 -1
  17. package/core/built/admin/assets/{deleted-feed-item-CwkvAbyU.js → deleted-feed-item-CFiQ2QmG.js} +1 -1
  18. package/core/built/admin/assets/{edit-profile-mtuPrl5U.js → edit-profile-DGrB1iyq.js} +1 -1
  19. package/core/built/admin/assets/{empty-indicator-STQxMsTH.js → empty-indicator-3LXlr_8k.js} +1 -1
  20. package/core/built/admin/assets/{en-DP-4OPPt.js → en-W8EN-kc6.js} +1 -1
  21. package/core/built/admin/assets/{feed-Eo5LuGaJ.js → feed-DDLXNcGg.js} +1 -1
  22. package/core/built/admin/assets/{filters-stQv1t2Q.js → filters-DJ9IfdqI.js} +1 -1
  23. package/core/built/admin/assets/{gh-chart-BWmTwsXH.js → gh-chart-CTNejk4b.js} +1 -1
  24. package/core/built/admin/assets/{growth-CTfPUXNh.js → growth-CYRGfktJ.js} +1 -1
  25. package/core/built/admin/assets/{hash-Bydeiaa9.js → hash-DqdFciUO.js} +1 -1
  26. package/core/built/admin/assets/{inbox-Ion97X3-.js → inbox-BvEfoBsw.js} +1 -1
  27. package/core/built/admin/assets/{index-CR1X4uHr.js → index-BDtDeIk7.js} +1 -1
  28. package/core/built/admin/assets/{index-DkdzYzw_.js → index-BZgoelCE.js} +1 -1
  29. package/core/built/admin/assets/{index-fW_jLZOq.js → index-BZqobMDm.js} +1 -1
  30. package/core/built/admin/assets/{index-GwDp7cne.js → index-Byclwr0r.js} +1 -1
  31. package/core/built/admin/assets/{index-DD-rVvO7.js → index-C9DrFLgj.js} +1 -1
  32. package/core/built/admin/assets/{index-mFLKOVzo.js → index-CvBG2BMA.js} +1 -1
  33. package/core/built/admin/assets/{index-CI2E0Omu.js → index-DAWuNQ5w.js} +1 -1
  34. package/core/built/admin/assets/{index-D5TMbQVo.js → index-DM_AXvZ2.js} +1 -1
  35. package/core/built/admin/assets/{index-DpFOl82I.js → index-DN0lnLj_.js} +1 -1
  36. package/core/built/admin/assets/{index-Cb1bmBmK.js → index-DRKV2w8e.js} +3 -3
  37. package/core/built/admin/assets/{index-CCPvhqfN.js → index-DcH37nFw.js} +1 -1
  38. package/core/built/admin/assets/{index-xYoJrUpW.js → index-U4HnwjaT.js} +1 -1
  39. package/core/built/admin/assets/{index-CBtTUuJD.js → index-U6n3pegZ.js} +1 -1
  40. package/core/built/admin/assets/{index-DR46F9P3.js → index-V6YnSoDg.js} +1 -1
  41. package/core/built/admin/assets/{koenig-lexical--bOXjfhF.js → koenig-lexical-CUBpynl8.js} +1 -1
  42. package/core/built/admin/assets/{kpi-card-D4XD3Q8u.js → kpi-card-B6Rn7bqN.js} +1 -1
  43. package/core/built/admin/assets/{kpis-sGrWOljw.js → kpis-BcrivX9l.js} +1 -1
  44. package/core/built/admin/assets/{links-D7bU3bf9.js → links-riUbeEgg.js} +1 -1
  45. package/core/built/admin/assets/{lucide-react-BXPXAfiK.js → lucide-react-BtdIj8wV.js} +1 -1
  46. package/core/built/admin/assets/{main-layout-BungCBHk.js → main-layout-5-bO8zds.js} +1 -1
  47. package/core/built/admin/assets/{message-square-text-Cl7f2tbO.js → message-square-text-CAxBZ_19.js} +1 -1
  48. package/core/built/admin/assets/{minus-C6PAFjHJ.js → minus-CkijqNoR.js} +1 -1
  49. package/core/built/admin/assets/{modals-C3u2jQgI.js → modals-0SenZkXa.js} +1 -1
  50. package/core/built/admin/assets/{moderation-Dq51J7FU.js → moderation-HKkI8Sxh.js} +1 -1
  51. package/core/built/admin/assets/{newsletter-IlWRVsHS.js → newsletter-DKF9Mp-n.js} +1 -1
  52. package/core/built/admin/assets/{newsletters-DuR8KKD7.js → newsletters-Cbw9jVdg.js} +1 -1
  53. package/core/built/admin/assets/{note-pOWzgRq4.js → note-ogkcCZSR.js} +1 -1
  54. package/core/built/admin/assets/{overview-1aw3_iYw.js → overview-CiiVNdYO.js} +1 -1
  55. package/core/built/admin/assets/{pagemenu-CaoSRAM6.js → pagemenu-CyAPL2jR.js} +1 -1
  56. package/core/built/admin/assets/{post-analytics-DemICx0T.js → post-analytics-D18eSSAi.js} +1 -1
  57. package/core/built/admin/assets/{post-analytics-context-BAVa6pkz.js → post-analytics-context-Q5WH1OnQ.js} +1 -1
  58. package/core/built/admin/assets/{post-analytics-header-BJ1wQ3zm.js → post-analytics-header-D9ypJ8U0.js} +1 -1
  59. package/core/built/admin/assets/{post-share-modal-Dki8ifFg.js → post-share-modal-FoeSNnKZ.js} +1 -1
  60. package/core/built/admin/assets/{posts-BnlRx8vs.js → posts-DjtbHmIO.js} +1 -1
  61. package/core/built/admin/assets/{repeat-DidFh0Da.js → repeat-B8wqzbtG.js} +1 -1
  62. package/core/built/admin/assets/{reply-CSbAYEM2.js → reply-B5bZTNpu.js} +1 -1
  63. package/core/built/admin/assets/{select-DjnPV9qj.js → select-DOWPuNp3.js} +1 -1
  64. package/core/built/admin/assets/{settings-Cws6_k-O.js → settings-BtfI1H6K.js} +1 -1
  65. package/core/built/admin/assets/{settings-BUwtf2g_.js → settings-CRoQOSBR.js} +4 -4
  66. package/core/built/admin/assets/{sort-button-CZTvB1vb.js → sort-button--2hLal4K.js} +1 -1
  67. package/core/built/admin/assets/{source-icon-BiiFDIy-.js → source-icon-B4Vu6UAT.js} +1 -1
  68. package/core/built/admin/assets/{sprout-CrEApBZc.js → sprout-DdSwjAnU.js} +1 -1
  69. package/core/built/admin/assets/{square-BoXJyuwE.js → square-CIGK666V.js} +1 -1
  70. package/core/built/admin/assets/stats/{audience-BjmWFjxw.mjs → audience-BcaCq-Fd.mjs} +3 -3
  71. package/core/built/admin/assets/stats/{index-yub8Kwor.mjs → index-BGGBMIln.mjs} +55 -55
  72. package/core/built/admin/assets/stats/{index-BxbeiQvY.mjs → index-CVZw5m-6.mjs} +5 -5
  73. package/core/built/admin/assets/stats/{index-BrfRXwHV.mjs → index-Cki6EmBM.mjs} +6 -6
  74. package/core/built/admin/assets/stats/{index-Brz-om_L.mjs → index-CntWQWvw.mjs} +8 -8
  75. package/core/built/admin/assets/stats/{index-Bh1sPDPK.mjs → index-ZpNYGQ3X.mjs} +5 -5
  76. package/core/built/admin/assets/stats/{sort-button-D282Qcym.mjs → sort-button-BmNuHcpY.mjs} +3 -3
  77. package/core/built/admin/assets/stats/{stats-CtTAHMmO.mjs → stats-CguVnNF1.mjs} +2 -2
  78. package/core/built/admin/assets/stats/stats.js +1 -1
  79. package/core/built/admin/assets/stats/{tabs-BmbSUTvo.mjs → tabs-Bg2EDT_5.mjs} +3 -3
  80. package/core/built/admin/assets/stats/{url-helpers-lInkyUAU.mjs → url-helpers-BRedk_Wi.mjs} +4 -4
  81. package/core/built/admin/assets/stats/{use-growth-stats-BWm__o-y.mjs → use-growth-stats-BGYDivJD.mjs} +3 -3
  82. package/core/built/admin/assets/{stats-Dw3ZL_6y.js → stats-6tjwXr7z.js} +1 -1
  83. package/core/built/admin/assets/{stats-view-_b1cFjiO.js → stats-view-DnjRNHBG.js} +1 -1
  84. package/core/built/admin/assets/{step-1-19iQ9zfQ.js → step-1-CA4uyLlu.js} +1 -1
  85. package/core/built/admin/assets/{step-2-Bm58XNFW.js → step-2-O7Xt_jes.js} +1 -1
  86. package/core/built/admin/assets/{step-3-CpwBi-6n.js → step-3-qS8gvQIT.js} +1 -1
  87. package/core/built/admin/assets/{table-BCNL2H8K.js → table-OQrUez6I.js} +1 -1
  88. package/core/built/admin/assets/{tabs-CO6vVNPx.js → tabs-ViFVsWFd.js} +1 -1
  89. package/core/built/admin/assets/{tags-dQNmC1sJ.js → tags-FYRO3JRl.js} +1 -1
  90. package/core/built/admin/assets/{tags-CgR3Ypcp.js → tags-tIPIuOOB.js} +1 -1
  91. package/core/built/admin/assets/{tiers-fc-_DxMc.js → tiers-DtX0it9j.js} +1 -1
  92. package/core/built/admin/assets/{toggle-group-XS6-nm1Q.js → toggle-group-CBcpMWEr.js} +1 -1
  93. package/core/built/admin/assets/{topic-filter-CKAqg69m.js → topic-filter-DM673fsL.js} +1 -1
  94. package/core/built/admin/assets/{trash-Cud6S0eh.js → trash-VI9DRMRe.js} +1 -1
  95. package/core/built/admin/assets/{url-helpers-DC2N8g7b.js → url-helpers-BpGl4uFV.js} +1 -1
  96. package/core/built/admin/assets/{use-growth-stats-DjrWrGR0.js → use-growth-stats-DJmJniVR.js} +1 -1
  97. package/core/built/admin/assets/{use-infinite-virtual-scroll-BzrtTHt0.js → use-infinite-virtual-scroll-CDpt_LdL.js} +1 -1
  98. package/core/built/admin/assets/{use-simple-pagination-CycwbYmf.js → use-simple-pagination-CeXU8p97.js} +1 -1
  99. package/core/built/admin/assets/{user-round-check-C27cgk4d.js → user-round-check-C4hZJ4Qo.js} +1 -1
  100. package/core/built/admin/assets/{wallet-cards-BZPIYDeM.js → wallet-cards-BXHaaW90.js} +1 -1
  101. package/core/built/admin/assets/{web-BxHOEYyW.js → web-DETqckpf.js} +1 -1
  102. package/core/built/admin/index.html +3 -3
  103. package/core/server/services/members/members-api/controllers/router-controller.js +1 -1
  104. package/package.json +5 -5
  105. package/components/tryghost-i18n-6.16.0.tgz +0 -0
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-DR46F9P3.js","./minus-C6PAFjHJ.js","./deleted-feed-item-CwkvAbyU.js","./trash-Cud6S0eh.js","./topic-filter-CKAqg69m.js","./empty-indicator-STQxMsTH.js","./inbox-Ion97X3-.js","./feed-Eo5LuGaJ.js","./hash-Bydeiaa9.js","./note-pOWzgRq4.js","./index-CR1X4uHr.js","./at-sign-zn6VHHIb.js","./user-round-check-C27cgk4d.js","./reply-CSbAYEM2.js","./index-CBtTUuJD.js","./sprout-CrEApBZc.js","./index-DkdzYzw_.js","./tags-dQNmC1sJ.js","./edit-profile-mtuPrl5U.js","./tabs-CO6vVNPx.js","./index-D5TMbQVo.js","./lucide-react-BXPXAfiK.js","./a-large-small-L2U_wPWJ.js","./wallet-cards-BZPIYDeM.js","./message-square-text-Cl7f2tbO.js","./copy-Bm8UN6-f.js","./square-BoXJyuwE.js","./repeat-DidFh0Da.js","./settings-Cws6_k-O.js","./index-CI2E0Omu.js","./toggle-group-XS6-nm1Q.js","./moderation-Dq51J7FU.js","./bluesky-sharing-YNHtFCeH.js","./step-1-19iQ9zfQ.js","./step-2-Bm58XNFW.js","./avatar-flipboard-D61vqpZi.js","./step-3-CpwBi-6n.js","./post-analytics-context-BAVa6pkz.js","./posts-BnlRx8vs.js","./post-analytics-DemICx0T.js","./main-layout-BungCBHk.js","./post-share-modal-Dki8ifFg.js","./overview-1aw3_iYw.js","./kpi-card-D4XD3Q8u.js","./pagemenu-CaoSRAM6.js","./data-list-C6hL1gtO.js","./links-D7bU3bf9.js","./chart-2aLRupgZ.js","./_baseAssignValue-DyITDSi7.js","./PolarAngleAxis-xPy2tnwX.js","./post-analytics-header-BJ1wQ3zm.js","./post-helpers-gInwAwEv.js","./kpis-sGrWOljw.js","./source-icon-BiiFDIy-.js","./source-utils-B1S3ZHA2.js","./gh-chart-BWmTwsXH.js","./growth-CTfPUXNh.js","./table-BCNL2H8K.js","./currency-fEUUCkj0.js","./stats-Dw3ZL_6y.js","./web-BxHOEYyW.js","./select-DjnPV9qj.js","./en-DP-4OPPt.js","./filters-stQv1t2Q.js","./newsletter-IlWRVsHS.js","./use-simple-pagination-CycwbYmf.js","./tags-CgR3Ypcp.js","./use-infinite-virtual-scroll-BzrtTHt0.js","./comments-CtogcEO1.js","./index-mFLKOVzo.js","./stats-view-_b1cFjiO.js","./audience-C5nYXN-z.js","./use-growth-stats-DjrWrGR0.js","./index-GwDp7cne.js","./url-helpers-DC2N8g7b.js","./index-fW_jLZOq.js","./sort-button-CZTvB1vb.js","./tiers-fc-_DxMc.js","./index-xYoJrUpW.js","./newsletters-DuR8KKD7.js","./settings-BUwtf2g_.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-V6YnSoDg.js","./minus-CkijqNoR.js","./deleted-feed-item-CFiQ2QmG.js","./trash-VI9DRMRe.js","./topic-filter-DM673fsL.js","./empty-indicator-3LXlr_8k.js","./inbox-BvEfoBsw.js","./feed-DDLXNcGg.js","./hash-DqdFciUO.js","./note-ogkcCZSR.js","./index-BDtDeIk7.js","./at-sign-DpSvWaBL.js","./user-round-check-C4hZJ4Qo.js","./reply-B5bZTNpu.js","./index-U6n3pegZ.js","./sprout-DdSwjAnU.js","./index-BZgoelCE.js","./tags-FYRO3JRl.js","./edit-profile-DGrB1iyq.js","./tabs-ViFVsWFd.js","./index-DM_AXvZ2.js","./lucide-react-BtdIj8wV.js","./a-large-small-DeaMDhiq.js","./wallet-cards-BXHaaW90.js","./message-square-text-CAxBZ_19.js","./copy-DdFJ2rqh.js","./square-CIGK666V.js","./repeat-B8wqzbtG.js","./settings-BtfI1H6K.js","./index-DAWuNQ5w.js","./toggle-group-CBcpMWEr.js","./moderation-HKkI8Sxh.js","./bluesky-sharing-DDW1Nub2.js","./step-1-CA4uyLlu.js","./step-2-O7Xt_jes.js","./avatar-flipboard-DUUQeCKh.js","./step-3-qS8gvQIT.js","./post-analytics-context-Q5WH1OnQ.js","./posts-DjtbHmIO.js","./post-analytics-D18eSSAi.js","./main-layout-5-bO8zds.js","./post-share-modal-FoeSNnKZ.js","./overview-CiiVNdYO.js","./kpi-card-B6Rn7bqN.js","./pagemenu-CyAPL2jR.js","./data-list-DxMYpFN2.js","./links-riUbeEgg.js","./chart-DKdadfuk.js","./_baseAssignValue-DRkJyH0k.js","./PolarAngleAxis-DUgbFtOk.js","./post-analytics-header-D9ypJ8U0.js","./post-helpers-gInwAwEv.js","./kpis-BcrivX9l.js","./source-icon-B4Vu6UAT.js","./source-utils-B1S3ZHA2.js","./gh-chart-CTNejk4b.js","./growth-CYRGfktJ.js","./table-OQrUez6I.js","./currency-fEUUCkj0.js","./stats-6tjwXr7z.js","./web-DETqckpf.js","./select-DOWPuNp3.js","./en-W8EN-kc6.js","./filters-DJ9IfdqI.js","./newsletter-DKF9Mp-n.js","./use-simple-pagination-CeXU8p97.js","./tags-tIPIuOOB.js","./use-infinite-virtual-scroll-CDpt_LdL.js","./comments-DtPXetSc.js","./index-CvBG2BMA.js","./stats-view-DnjRNHBG.js","./audience-DyqogFKk.js","./use-growth-stats-DJmJniVR.js","./index-Byclwr0r.js","./url-helpers-BpGl4uFV.js","./index-BZqobMDm.js","./sort-button--2hLal4K.js","./tiers-DtX0it9j.js","./index-U4HnwjaT.js","./newsletters-Cbw9jVdg.js","./settings-CRoQOSBR.js"])))=>i.map(i=>d[i]);
2
2
  function KR(e,t){for(var o=0;o<t.length;o++){const n=t[o];if(typeof n!="string"&&!Array.isArray(n)){for(const r in n)if(r!=="default"&&!(r in e)){const a=Object.getOwnPropertyDescriptor(n,r);a&&Object.defineProperty(e,r,a.get?a:{enumerable:!0,get:()=>n[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))n(r);new MutationObserver(r=>{for(const a of r)if(a.type==="childList")for(const i of a.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&n(i)}).observe(document,{childList:!0,subtree:!0});function o(r){const a={};return r.integrity&&(a.integrity=r.integrity),r.referrerPolicy&&(a.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?a.credentials="include":r.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(r){if(r.ep)return;r.ep=!0;const a=o(r);fetch(r.href,a)}})();var rc0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Fz(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function YR(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var o=function n(){var r=!1;try{r=this instanceof n}catch{}return r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};o.prototype=t.prototype}else o={};return Object.defineProperty(o,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(o,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}),o}var Eb={exports:{}},Xc={},Sb={exports:{}},s1={};/**
3
3
  * @license React
4
4
  * react.production.min.js
@@ -596,7 +596,7 @@ y0.version="2.24.0";aU(T1);y0.fn=h0;y0.min=$V;y0.max=QV;y0.now=ZV;y0.utc=qt;y0.u
596
596
  * See the LICENSE file in the root directory of this source tree.
597
597
  */const _G=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],qd=V0("x",_G),O3=Jt("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:stroke-[1.5px]",{variants:{variant:{default:"bg-primary font-medium text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive font-medium text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background font-medium hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary font-medium text-secondary-foreground hover:bg-secondary/80 dark:bg-gray-925/70 dark:hover:bg-gray-900",ghost:"font-medium hover:bg-accent hover:text-accent-foreground",link:"font-medium text-primary underline-offset-4 hover:underline",dropdown:"border border-input bg-background hover:bg-accent hover:text-accent-foreground"},size:{default:"h-[34px] px-3 py-2",sm:"h-7 rounded-md px-3 text-xs [&_svg]:size-3",lg:"h-11 rounded-md px-8 text-md font-semibold",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}}),o1=p.forwardRef(({className:e,variant:t,size:o,asChild:n=!1,children:r,...a},i)=>{const b=n?Zr:"button",l=t==="dropdown"?z.jsxs(z.Fragment,{children:[r,z.jsx(hZ,{className:"!-ml-1 !-mr-0.5 size-4 !stroke-[2px] opacity-50",strokeWidth:2})]}):r;return z.jsx(b,{ref:i,className:g0(O3({variant:t,size:o,className:e})),...a,children:l})});o1.displayName="Button";function EG(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",t.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}const SG=e=>{switch(e){case"success":return XG;case"info":return DG;case"warning":return jG;case"error":return IG;default:return null}},TG=Array(12).fill(0),PG=({visible:e,className:t})=>b0.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},b0.createElement("div",{className:"sonner-spinner"},TG.map((o,n)=>b0.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),XG=b0.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},b0.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),jG=b0.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},b0.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),DG=b0.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},b0.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),IG=b0.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},b0.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),FG=b0.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},b0.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),b0.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),HG=()=>{const[e,t]=b0.useState(document.hidden);return b0.useEffect(()=>{const o=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",o),()=>window.removeEventListener("visibilitychange",o)},[]),e};let fz=1;class UG{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const o=this.subscribers.indexOf(t);this.subscribers.splice(o,1)}),this.publish=t=>{this.subscribers.forEach(o=>o(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var o;const{message:n,...r}=t,a=typeof t?.id=="number"||((o=t.id)==null?void 0:o.length)>0?t.id:fz++,i=this.toasts.find(l=>l.id===a),b=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),i?this.toasts=this.toasts.map(l=>l.id===a?(this.publish({...l,...t,id:a,title:n}),{...l,...t,id:a,dismissible:b,title:n}):l):this.addToast({title:n,...r,dismissible:b,id:a}),a},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(o=>o({id:t,dismiss:!0})))):this.toasts.forEach(o=>{this.subscribers.forEach(n=>n({id:o.id,dismiss:!0}))}),t),this.message=(t,o)=>this.create({...o,message:t}),this.error=(t,o)=>this.create({...o,message:t,type:"error"}),this.success=(t,o)=>this.create({...o,type:"success",message:t}),this.info=(t,o)=>this.create({...o,type:"info",message:t}),this.warning=(t,o)=>this.create({...o,type:"warning",message:t}),this.loading=(t,o)=>this.create({...o,type:"loading",message:t}),this.promise=(t,o)=>{if(!o)return;let n;o.loading!==void 0&&(n=this.create({...o,promise:t,type:"loading",message:o.loading,description:typeof o.description!="function"?o.description:void 0}));const r=Promise.resolve(t instanceof Function?t():t);let a=n!==void 0,i;const b=r.then(async u=>{if(i=["resolve",u],b0.isValidElement(u))a=!1,this.create({id:n,type:"default",message:u});else if($G(u)&&!u.ok){a=!1;const O=typeof o.error=="function"?await o.error(`HTTP error! status: ${u.status}`):o.error,h=typeof o.description=="function"?await o.description(`HTTP error! status: ${u.status}`):o.description,g=typeof O=="object"&&!b0.isValidElement(O)?O:{message:O};this.create({id:n,type:"error",description:h,...g})}else if(u instanceof Error){a=!1;const O=typeof o.error=="function"?await o.error(u):o.error,h=typeof o.description=="function"?await o.description(u):o.description,g=typeof O=="object"&&!b0.isValidElement(O)?O:{message:O};this.create({id:n,type:"error",description:h,...g})}else if(o.success!==void 0){a=!1;const O=typeof o.success=="function"?await o.success(u):o.success,h=typeof o.description=="function"?await o.description(u):o.description,g=typeof O=="object"&&!b0.isValidElement(O)?O:{message:O};this.create({id:n,type:"success",description:h,...g})}}).catch(async u=>{if(i=["reject",u],o.error!==void 0){a=!1;const f=typeof o.error=="function"?await o.error(u):o.error,O=typeof o.description=="function"?await o.description(u):o.description,q=typeof f=="object"&&!b0.isValidElement(f)?f:{message:f};this.create({id:n,type:"error",description:O,...q})}}).finally(()=>{a&&(this.dismiss(n),n=void 0),o.finally==null||o.finally.call(o)}),l=()=>new Promise((u,f)=>b.then(()=>i[0]==="reject"?f(i[1]):u(i[1])).catch(f));return typeof n!="string"&&typeof n!="number"?{unwrap:l}:Object.assign(n,{unwrap:l})},this.custom=(t,o)=>{const n=o?.id||fz++;return this.create({jsx:t(n),id:n,...o}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Ye=new UG,VG=(e,t)=>{const o=t?.id||fz++;return Ye.addToast({title:e,...t,id:o}),o},$G=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",QG=VG,ZG=()=>Ye.toasts,GG=()=>Ye.getActiveToasts(),ve=Object.assign(QG,{success:Ye.success,info:Ye.info,warning:Ye.warning,error:Ye.error,custom:Ye.custom,message:Ye.message,promise:Ye.promise,dismiss:Ye.dismiss,loading:Ye.loading},{getHistory:ZG,getToasts:GG});EG("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function fi(e){return e.label!==void 0}const KG=3,YG="24px",JG="16px",Tf=4e3,eK=356,tK=14,oK=45,nK=200;function Mt(...e){return e.filter(Boolean).join(" ")}function rK(e){const[t,o]=e.split("-"),n=[];return t&&n.push(t),o&&n.push(o),n}const cK=e=>{var t,o,n,r,a,i,b,l,u;const{invert:f,toast:O,unstyled:h,interacting:q,setHeights:g,visibleToasts:W,heights:v,index:y,toasts:x,expanded:k,removeToast:L,defaultRichColors:C,closeButton:w,style:N,cancelButtonStyle:D,actionButtonStyle:Y,className:V="",descriptionClassName:J="",duration:t0,position:K,gap:a0,expandByDefault:q0,classNames:Z,icons:z0,closeButtonAriaLabel:U="Close toast"}=e,[X,G]=b0.useState(null),[_,I]=b0.useState(null),[i0,d0]=b0.useState(!1),[m0,W0]=b0.useState(!1),[s0,e0]=b0.useState(!1),[w0,x0]=b0.useState(!1),[j0,p1]=b0.useState(!1),[S,o0]=b0.useState(0),[r0,A0]=b0.useState(0),E0=b0.useRef(O.duration||t0||Tf),t1=b0.useRef(null),b1=b0.useRef(null),n1=y===0,d1=y+1<=W,L1=O.type,Te=O.dismissible!==!1,nn=O.className||"",to=O.descriptionClassName||"",qe=b0.useMemo(()=>v.findIndex(Z0=>Z0.toastId===O.id)||0,[v,O.id]),Pe=b0.useMemo(()=>{var Z0;return(Z0=O.closeButton)!=null?Z0:w},[O.closeButton,w]),et=b0.useMemo(()=>O.duration||t0||Tf,[O.duration,t0]),oo=b0.useRef(0),Le=b0.useRef(0),tt=b0.useRef(0),ze=b0.useRef(null),[rn,cn]=K.split("-"),an=b0.useMemo(()=>v.reduce((Z0,x1,j1)=>j1>=qe?Z0:Z0+x1.height,0),[v,qe]),no=HG(),ro=O.invert||f,b2=L1==="loading";Le.current=b0.useMemo(()=>qe*a0+an,[qe,an]),b0.useEffect(()=>{E0.current=et},[et]),b0.useEffect(()=>{d0(!0)},[]),b0.useEffect(()=>{const Z0=b1.current;if(Z0){const x1=Z0.getBoundingClientRect().height;return A0(x1),g(j1=>[{toastId:O.id,height:x1,position:O.position},...j1]),()=>g(j1=>j1.filter(ue=>ue.toastId!==O.id))}},[g,O.id]),b0.useLayoutEffect(()=>{if(!i0)return;const Z0=b1.current,x1=Z0.style.height;Z0.style.height="auto";const j1=Z0.getBoundingClientRect().height;Z0.style.height=x1,A0(j1),g(ue=>ue.find(E=>E.toastId===O.id)?ue.map(E=>E.toastId===O.id?{...E,height:j1}:E):[{toastId:O.id,height:j1,position:O.position},...ue])},[i0,O.title,O.description,g,O.id,O.jsx,O.action,O.cancel]);const Xe=b0.useCallback(()=>{W0(!0),o0(Le.current),g(Z0=>Z0.filter(x1=>x1.toastId!==O.id)),setTimeout(()=>{L(O)},nK)},[O,L,g,Le]);b0.useEffect(()=>{if(O.promise&&L1==="loading"||O.duration===1/0||O.type==="loading")return;let Z0;return k||q||no?(()=>{if(tt.current<oo.current){const ue=new Date().getTime()-oo.current;E0.current=E0.current-ue}tt.current=new Date().getTime()})():(()=>{E0.current!==1/0&&(oo.current=new Date().getTime(),Z0=setTimeout(()=>{O.onAutoClose==null||O.onAutoClose.call(O,O),Xe()},E0.current))})(),()=>clearTimeout(Z0)},[k,q,O,L1,no,Xe]),b0.useEffect(()=>{O.delete&&(Xe(),O.onDismiss==null||O.onDismiss.call(O,O))},[Xe,O.delete]);function gt(){var Z0;if(z0?.loading){var x1;return b0.createElement("div",{className:Mt(Z?.loader,O==null||(x1=O.classNames)==null?void 0:x1.loader,"sonner-loader"),"data-visible":L1==="loading"},z0.loading)}return b0.createElement(PG,{className:Mt(Z?.loader,O==null||(Z0=O.classNames)==null?void 0:Z0.loader),visible:L1==="loading"})}const ot=O.icon||z0?.[L1]||SG(L1);var l2,sn;return b0.createElement("li",{tabIndex:0,ref:b1,className:Mt(V,nn,Z?.toast,O==null||(t=O.classNames)==null?void 0:t.toast,Z?.default,Z?.[L1],O==null||(o=O.classNames)==null?void 0:o[L1]),"data-sonner-toast":"","data-rich-colors":(l2=O.richColors)!=null?l2:C,"data-styled":!(O.jsx||O.unstyled||h),"data-mounted":i0,"data-promise":!!O.promise,"data-swiped":j0,"data-removed":m0,"data-visible":d1,"data-y-position":rn,"data-x-position":cn,"data-index":y,"data-front":n1,"data-swiping":s0,"data-dismissible":Te,"data-type":L1,"data-invert":ro,"data-swipe-out":w0,"data-swipe-direction":_,"data-expanded":!!(k||q0&&i0),"data-testid":O.testId,style:{"--index":y,"--toasts-before":y,"--z-index":x.length-y,"--offset":`${m0?S:Le.current}px`,"--initial-height":q0?"auto":`${r0}px`,...N,...O.style},onDragEnd:()=>{e0(!1),G(null),ze.current=null},onPointerDown:Z0=>{Z0.button!==2&&(b2||!Te||(t1.current=new Date,o0(Le.current),Z0.target.setPointerCapture(Z0.pointerId),Z0.target.tagName!=="BUTTON"&&(e0(!0),ze.current={x:Z0.clientX,y:Z0.clientY})))},onPointerUp:()=>{var Z0,x1,j1;if(w0||!Te)return;ze.current=null;const ue=Number(((Z0=b1.current)==null?void 0:Z0.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),nt=Number(((x1=b1.current)==null?void 0:x1.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),E=new Date().getTime()-((j1=t1.current)==null?void 0:j1.getTime()),j=X==="x"?ue:nt,$=Math.abs(j)/E;if(Math.abs(j)>=oK||$>.11){o0(Le.current),O.onDismiss==null||O.onDismiss.call(O,O),I(X==="x"?ue>0?"right":"left":nt>0?"down":"up"),Xe(),x0(!0);return}else{var c0,O0;(c0=b1.current)==null||c0.style.setProperty("--swipe-amount-x","0px"),(O0=b1.current)==null||O0.style.setProperty("--swipe-amount-y","0px")}p1(!1),e0(!1),G(null)},onPointerMove:Z0=>{var x1,j1,ue;if(!ze.current||!Te||((x1=window.getSelection())==null?void 0:x1.toString().length)>0)return;const E=Z0.clientY-ze.current.y,j=Z0.clientX-ze.current.x;var $;const c0=($=e.swipeDirections)!=null?$:rK(K);!X&&(Math.abs(j)>1||Math.abs(E)>1)&&G(Math.abs(j)>Math.abs(E)?"x":"y");let O0={x:0,y:0};const k0=R0=>1/(1.5+Math.abs(R0)/20);if(X==="y"){if(c0.includes("top")||c0.includes("bottom"))if(c0.includes("top")&&E<0||c0.includes("bottom")&&E>0)O0.y=E;else{const R0=E*k0(E);O0.y=Math.abs(R0)<Math.abs(E)?R0:E}}else if(X==="x"&&(c0.includes("left")||c0.includes("right")))if(c0.includes("left")&&j<0||c0.includes("right")&&j>0)O0.x=j;else{const R0=j*k0(j);O0.x=Math.abs(R0)<Math.abs(j)?R0:j}(Math.abs(O0.x)>0||Math.abs(O0.y)>0)&&p1(!0),(j1=b1.current)==null||j1.style.setProperty("--swipe-amount-x",`${O0.x}px`),(ue=b1.current)==null||ue.style.setProperty("--swipe-amount-y",`${O0.y}px`)}},Pe&&!O.jsx&&L1!=="loading"?b0.createElement("button",{"aria-label":U,"data-disabled":b2,"data-close-button":!0,onClick:b2||!Te?()=>{}:()=>{Xe(),O.onDismiss==null||O.onDismiss.call(O,O)},className:Mt(Z?.closeButton,O==null||(n=O.classNames)==null?void 0:n.closeButton)},(sn=z0?.close)!=null?sn:FG):null,(L1||O.icon||O.promise)&&O.icon!==null&&(z0?.[L1]!==null||O.icon)?b0.createElement("div",{"data-icon":"",className:Mt(Z?.icon,O==null||(r=O.classNames)==null?void 0:r.icon)},O.promise||O.type==="loading"&&!O.icon?O.icon||gt():null,O.type!=="loading"?ot:null):null,b0.createElement("div",{"data-content":"",className:Mt(Z?.content,O==null||(a=O.classNames)==null?void 0:a.content)},b0.createElement("div",{"data-title":"",className:Mt(Z?.title,O==null||(i=O.classNames)==null?void 0:i.title)},O.jsx?O.jsx:typeof O.title=="function"?O.title():O.title),O.description?b0.createElement("div",{"data-description":"",className:Mt(J,to,Z?.description,O==null||(b=O.classNames)==null?void 0:b.description)},typeof O.description=="function"?O.description():O.description):null),b0.isValidElement(O.cancel)?O.cancel:O.cancel&&fi(O.cancel)?b0.createElement("button",{"data-button":!0,"data-cancel":!0,style:O.cancelButtonStyle||D,onClick:Z0=>{fi(O.cancel)&&Te&&(O.cancel.onClick==null||O.cancel.onClick.call(O.cancel,Z0),Xe())},className:Mt(Z?.cancelButton,O==null||(l=O.classNames)==null?void 0:l.cancelButton)},O.cancel.label):null,b0.isValidElement(O.action)?O.action:O.action&&fi(O.action)?b0.createElement("button",{"data-button":!0,"data-action":!0,style:O.actionButtonStyle||Y,onClick:Z0=>{fi(O.action)&&(O.action.onClick==null||O.action.onClick.call(O.action,Z0),!Z0.defaultPrevented&&Xe())},className:Mt(Z?.actionButton,O==null||(u=O.classNames)==null?void 0:u.actionButton)},O.action.label):null)};function Pf(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function aK(e,t){const o={};return[e,t].forEach((n,r)=>{const a=r===1,i=a?"--mobile-offset":"--offset",b=a?JG:YG;function l(u){["top","right","bottom","left"].forEach(f=>{o[`${i}-${f}`]=typeof u=="number"?`${u}px`:u})}typeof n=="number"||typeof n=="string"?l(n):typeof n=="object"?["top","right","bottom","left"].forEach(u=>{n[u]===void 0?o[`${i}-${u}`]=b:o[`${i}-${u}`]=typeof n[u]=="number"?`${n[u]}px`:n[u]}):l(b)}),o}const sK=b0.forwardRef(function(t,o){const{id:n,invert:r,position:a="bottom-right",hotkey:i=["altKey","KeyT"],expand:b,closeButton:l,className:u,offset:f,mobileOffset:O,theme:h="light",richColors:q,duration:g,style:W,visibleToasts:v=KG,toastOptions:y,dir:x=Pf(),gap:k=tK,icons:L,containerAriaLabel:C="Notifications"}=t,[w,N]=b0.useState([]),D=b0.useMemo(()=>n?w.filter(i0=>i0.toasterId===n):w.filter(i0=>!i0.toasterId),[w,n]),Y=b0.useMemo(()=>Array.from(new Set([a].concat(D.filter(i0=>i0.position).map(i0=>i0.position)))),[D,a]),[V,J]=b0.useState([]),[t0,K]=b0.useState(!1),[a0,q0]=b0.useState(!1),[Z,z0]=b0.useState(h!=="system"?h:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),U=b0.useRef(null),X=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),G=b0.useRef(null),_=b0.useRef(!1),I=b0.useCallback(i0=>{N(d0=>{var m0;return(m0=d0.find(W0=>W0.id===i0.id))!=null&&m0.delete||Ye.dismiss(i0.id),d0.filter(({id:W0})=>W0!==i0.id)})},[]);return b0.useEffect(()=>Ye.subscribe(i0=>{if(i0.dismiss){requestAnimationFrame(()=>{N(d0=>d0.map(m0=>m0.id===i0.id?{...m0,delete:!0}:m0))});return}setTimeout(()=>{bh.flushSync(()=>{N(d0=>{const m0=d0.findIndex(W0=>W0.id===i0.id);return m0!==-1?[...d0.slice(0,m0),{...d0[m0],...i0},...d0.slice(m0+1)]:[i0,...d0]})})})}),[w]),b0.useEffect(()=>{if(h!=="system"){z0(h);return}if(h==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?z0("dark"):z0("light")),typeof window>"u")return;const i0=window.matchMedia("(prefers-color-scheme: dark)");try{i0.addEventListener("change",({matches:d0})=>{z0(d0?"dark":"light")})}catch{i0.addListener(({matches:m0})=>{try{z0(m0?"dark":"light")}catch(W0){console.error(W0)}})}},[h]),b0.useEffect(()=>{w.length<=1&&K(!1)},[w]),b0.useEffect(()=>{const i0=d0=>{var m0;if(i.every(e0=>d0[e0]||d0.code===e0)){var s0;K(!0),(s0=U.current)==null||s0.focus()}d0.code==="Escape"&&(document.activeElement===U.current||(m0=U.current)!=null&&m0.contains(document.activeElement))&&K(!1)};return document.addEventListener("keydown",i0),()=>document.removeEventListener("keydown",i0)},[i]),b0.useEffect(()=>{if(U.current)return()=>{G.current&&(G.current.focus({preventScroll:!0}),G.current=null,_.current=!1)}},[U.current]),b0.createElement("section",{ref:o,"aria-label":`${C} ${X}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},Y.map((i0,d0)=>{var m0;const[W0,s0]=i0.split("-");return D.length?b0.createElement("ol",{key:i0,dir:x==="auto"?Pf():x,tabIndex:-1,ref:U,className:u,"data-sonner-toaster":!0,"data-sonner-theme":Z,"data-y-position":W0,"data-x-position":s0,style:{"--front-toast-height":`${((m0=V[0])==null?void 0:m0.height)||0}px`,"--width":`${eK}px`,"--gap":`${k}px`,...W,...aK(f,O)},onBlur:e0=>{_.current&&!e0.currentTarget.contains(e0.relatedTarget)&&(_.current=!1,G.current&&(G.current.focus({preventScroll:!0}),G.current=null))},onFocus:e0=>{e0.target instanceof HTMLElement&&e0.target.dataset.dismissible==="false"||_.current||(_.current=!0,G.current=e0.relatedTarget)},onMouseEnter:()=>K(!0),onMouseMove:()=>K(!0),onMouseLeave:()=>{a0||K(!1)},onDragEnd:()=>K(!1),onPointerDown:e0=>{e0.target instanceof HTMLElement&&e0.target.dataset.dismissible==="false"||q0(!0)},onPointerUp:()=>q0(!1)},D.filter(e0=>!e0.position&&d0===0||e0.position===i0).map((e0,w0)=>{var x0,j0;return b0.createElement(cK,{key:e0.id,icons:L,index:w0,toast:e0,defaultRichColors:q,duration:(x0=y?.duration)!=null?x0:g,className:y?.className,descriptionClassName:y?.descriptionClassName,invert:r,visibleToasts:v,closeButton:(j0=y?.closeButton)!=null?j0:l,interacting:a0,position:i0,style:y?.style,unstyled:y?.unstyled,classNames:y?.classNames,cancelButtonStyle:y?.cancelButtonStyle,actionButtonStyle:y?.actionButtonStyle,closeButtonAriaLabel:y?.closeButtonAriaLabel,removeToast:I,toasts:D.filter(p1=>p1.position==e0.position),heights:V.filter(p1=>p1.position==e0.position),setHeights:J,expandByDefault:b,gap:k,expanded:t0,swipeDirections:t.swipeDirections})})):null}))}),iK=({...e})=>z.jsx(sK,{className:"toaster group",style:{"--normal-bg":"hsl(var(--background))","--normal-text":"hsl(var(--foreground))","--normal-border":"hsl(var(--border))"},theme:"light",...e}),pK=b0.createContext({isDirty:!1,setGlobalDirtyState:()=>{}}),MK=({children:e})=>{const[t,o]=p.useState([]),n=p.useCallback((r,a)=>{o(i=>a&&!i.includes(r)?[...i,r]:!a&&i.includes(r)?i.filter(b=>b!==r):i)},[]);return z.jsx(pK.Provider,{value:{isDirty:t.length>0,setGlobalDirtyState:n},children:e})},bK=e=>p.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",height:24,width:24,id:"Alert-Triangle--Streamline-Ultimate",...e},p.createElement("desc",null,"Alert Triangle Streamline Icon: https://streamlinehq.com"),p.createElement("path",{d:"m23.77 20.57 -10 -19A2 2 0 0 0 12 0.5a2 2 0 0 0 -1.77 1.07l-10 19a2 2 0 0 0 0.06 2A2 2 0 0 0 2 23.5h20a2 2 0 0 0 1.77 -2.93ZM11 8.5a1 1 0 0 1 2 0v6a1 1 0 0 1 -2 0ZM12.05 20a1.53 1.53 0 0 1 -1.52 -1.47A1.48 1.48 0 0 1 12 17a1.53 1.53 0 0 1 1.52 1.47A1.48 1.48 0 0 1 12.05 20Z",fill:"currentColor",strokeWidth:1})),lK="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20height='24'%20width='24'%20id='Alert-Triangle--Streamline-Ultimate'%3e%3cdesc%3eAlert%20Triangle%20Streamline%20Icon:%20https://streamlinehq.com%3c/desc%3e%3cpath%20d='m23.77%2020.57%20-10%20-19A2%202%200%200%200%2012%200.5a2%202%200%200%200%20-1.77%201.07l-10%2019a2%202%200%200%200%200.06%202A2%202%200%200%200%202%2023.5h20a2%202%200%200%200%201.77%20-2.93ZM11%208.5a1%201%200%200%201%202%200v6a1%201%200%200%201%20-2%200ZM12.05%2020a1.53%201.53%200%200%201%20-1.52%20-1.47A1.48%201.48%200%200%201%2012%2017a1.53%201.53%200%200%201%201.52%201.47A1.48%201.48%200%200%201%2012.05%2020Z'%20fill='currentColor'%20stroke-width='1'%3e%3c/path%3e%3c/svg%3e",zK=Object.freeze(Object.defineProperty({__proto__:null,ReactComponent:bK,default:lK},Symbol.toStringTag,{value:"Module"})),uK=e=>p.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",height:24,width:24,id:"Information-Circle--Streamline-Ultimate",...e},p.createElement("desc",null,"Information Circle Streamline Icon: https://streamlinehq.com"),p.createElement("path",{d:"M12 0a12 12 0 1 0 12 12A12 12 0 0 0 12 0Zm0.25 5a1.5 1.5 0 1 1 -1.5 1.5 1.5 1.5 0 0 1 1.5 -1.5Zm2.25 13.5h-4a1 1 0 0 1 0 -2h0.75a0.25 0.25 0 0 0 0.25 -0.25v-4.5a0.25 0.25 0 0 0 -0.25 -0.25h-0.75a1 1 0 0 1 0 -2h1a2 2 0 0 1 2 2v4.75a0.25 0.25 0 0 0 0.25 0.25h0.75a1 1 0 0 1 0 2Z",fill:"currentcolor",strokeWidth:1})),dK="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20height='24'%20width='24'%20id='Information-Circle--Streamline-Ultimate'%3e%3cdesc%3eInformation%20Circle%20Streamline%20Icon:%20https://streamlinehq.com%3c/desc%3e%3cpath%20d='M12%200a12%2012%200%201%200%2012%2012A12%2012%200%200%200%2012%200Zm0.25%205a1.5%201.5%200%201%201%20-1.5%201.5%201.5%201.5%200%200%201%201.5%20-1.5Zm2.25%2013.5h-4a1%201%200%200%201%200%20-2h0.75a0.25%200.25%200%200%200%200.25%20-0.25v-4.5a0.25%200.25%200%200%200%20-0.25%20-0.25h-0.75a1%201%200%200%201%200%20-2h1a2%202%200%200%201%202%202v4.75a0.25%200.25%200%200%200%200.25%200.25h0.75a1%201%200%200%201%200%202Z'%20fill='currentcolor'%20stroke-width='1'%3e%3c/path%3e%3c/svg%3e",OK=Object.freeze(Object.defineProperty({__proto__:null,ReactComponent:uK,default:dK},Symbol.toStringTag,{value:"Module"})),fK=e=>p.createElement("svg",{height:16,id:"Skull-2--Streamline-Ultimate",viewBox:"0 0 16 16",width:16,xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("desc",null,`
598
598
  Skull 2 Streamline Icon: https://streamlinehq.com
599
- `),p.createElement("g",null,p.createElement("path",{d:"M12.333333333333332 7.333333333333333a4.333333333333333 4.333333333333333 0 1 0 -7.333333333333333 3.126666666666667v1.88a1 1 0 0 0 2 0 1 1 0 0 0 2 0 1 1 0 1 0 2 0v-1.88a4.326666666666666 4.326666666666666 0 0 0 1.3333333333333333 -3.126666666666667Zm-6.253333333333334 1a1 1 0 1 1 1 -1 1 1 0 0 1 -1 1Zm4 0a1 1 0 1 1 1 -1 1 1 0 0 1 -1 1Z",fill:"currentColor",strokeWidth:.6667}),p.createElement("path",{d:"m1.8666666666666665 3.28 1.22 1.22a0.3466666666666667 0.3466666666666667 0 0 0 0.26666666666666666 0.09333333333333334 0.35333333333333333 0.35333333333333333 0 0 0 0.24666666666666665 -0.14666666666666667 5.133333333333333 5.133333333333333 0 0 1 0.8066666666666666 -0.9733333333333333 0.3133333333333333 0.3133333333333333 0 0 0 0.09999999999999999 -0.2333333333333333 0.3666666666666667 0.3666666666666667 0 0 0 -0.09333333333333334 -0.24666666666666665L3.28 1.8666666666666665A1.1666666666666665 1.1666666666666665 0 0 0 1.8399999999999999 0.11333333333333334a0.6666666666666666 0.6666666666666666 0 0 0 -0.3666666666666667 0.48l-0.09999999999999999 0.5133333333333333a0.31999999999999995 0.31999999999999995 0 0 1 -0.26 0.26666666666666666l-0.52 0.09999999999999999a0.6666666666666666 0.6666666666666666 0 0 0 -0.48 0.3666666666666667A1.1666666666666665 1.1666666666666665 0 0 0 1.8666666666666665 3.28Z",fill:"currentColor",strokeWidth:.6667}),p.createElement("path",{d:"M12.4 4.446666666666666a0.35333333333333333 0.35333333333333333 0 0 0 0.24666666666666665 0.14666666666666667 0.3466666666666667 0.3466666666666667 0 0 0 0.26666666666666666 -0.09333333333333334l1.22 -1.22a1.1666666666666665 1.1666666666666665 0 0 0 1.7533333333333332 -1.44 0.6666666666666666 0.6666666666666666 0 0 0 -0.48 -0.3666666666666667l-0.52 -0.09999999999999999a0.31999999999999995 0.31999999999999995 0 0 1 -0.26 -0.26666666666666666l-0.09999999999999999 -0.5133333333333333a0.6666666666666666 0.6666666666666666 0 0 0 -0.3666666666666667 -0.48 1.1666666666666665 1.1666666666666665 0 0 0 -1.44 1.7533333333333332l-1.1333333333333333 1.1266666666666665a0.3666666666666667 0.3666666666666667 0 0 0 -0.09333333333333334 0.24666666666666665 0.3133333333333333 0.3133333333333333 0 0 0 0.09999999999999999 0.2333333333333333 5.133333333333333 5.133333333333333 0 0 1 0.8066666666666666 0.9733333333333333Z",fill:"currentColor",strokeWidth:.6667}),p.createElement("path",{d:"M3.6 11.559999999999999a0.33999999999999997 0.33999999999999997 0 0 0 -0.26666666666666666 -0.15333333333333332 0.3466666666666667 0.3466666666666667 0 0 0 -0.26666666666666666 0.09333333333333334l-1.2 1.22a1.1666666666666665 1.1666666666666665 0 0 0 -1.7533333333333332 1.44 0.6666666666666666 0.6666666666666666 0 0 0 0.48 0.3666666666666667l0.52 0.09999999999999999a0.31999999999999995 0.31999999999999995 0 0 1 0.26 0.26666666666666666l0.09999999999999999 0.5133333333333333a0.6666666666666666 0.6666666666666666 0 0 0 0.3666666666666667 0.48 1.1666666666666665 1.1666666666666665 0 0 0 1.44 -1.7533333333333332l1.1333333333333333 -1.1266666666666665a0.36 0.36 0 0 0 0.09333333333333334 -0.24 0.31999999999999995 0.31999999999999995 0 0 0 -0.09999999999999999 -0.24 5.333333333333333 5.333333333333333 0 0 1 -0.8066666666666666 -0.9666666666666666Z",fill:"currentColor",strokeWidth:.6667}),p.createElement("path",{d:"m14.133333333333333 12.719999999999999 -1.22 -1.22a0.3466666666666667 0.3466666666666667 0 0 0 -0.26666666666666666 -0.09333333333333334 0.33999999999999997 0.33999999999999997 0 0 0 -0.24666666666666665 0.15333333333333332 5.333333333333333 5.333333333333333 0 0 1 -0.8066666666666666 0.9666666666666666 0.31999999999999995 0.31999999999999995 0 0 0 -0.09999999999999999 0.24 0.36 0.36 0 0 0 0.09333333333333334 0.24l1.1333333333333333 1.1266666666666665a1.1666666666666665 1.1666666666666665 0 0 0 1.44 1.7533333333333332 0.6666666666666666 0.6666666666666666 0 0 0 0.3666666666666667 -0.48l0.09999999999999999 -0.5133333333333333a0.31999999999999995 0.31999999999999995 0 0 1 0.26 -0.26666666666666666l0.52 -0.09999999999999999a0.6666666666666666 0.6666666666666666 0 0 0 0.48 -0.3666666666666667 1.1666666666666665 1.1666666666666665 0 0 0 -1.7533333333333332 -1.44Z",fill:"currentColor",strokeWidth:.6667}))),AK="data:image/svg+xml,%3csvg%20height='16'%20id='Skull-2--Streamline-Ultimate'%20viewBox='0%200%2016%2016'%20width='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cdesc%3e%20Skull%202%20Streamline%20Icon:%20https://streamlinehq.com%20%3c/desc%3e%3cg%3e%3cpath%20d='M12.333333333333332%207.333333333333333a4.333333333333333%204.333333333333333%200%201%200%20-7.333333333333333%203.126666666666667v1.88a1%201%200%200%200%202%200%201%201%200%200%200%202%200%201%201%200%201%200%202%200v-1.88a4.326666666666666%204.326666666666666%200%200%200%201.3333333333333333%20-3.126666666666667Zm-6.253333333333334%201a1%201%200%201%201%201%20-1%201%201%200%200%201%20-1%201Zm4%200a1%201%200%201%201%201%20-1%201%201%200%200%201%20-1%201Z'%20fill='currentColor'%20strokeWidth='0.6667'%3e%3c/path%3e%3cpath%20d='m1.8666666666666665%203.28%201.22%201.22a0.3466666666666667%200.3466666666666667%200%200%200%200.26666666666666666%200.09333333333333334%200.35333333333333333%200.35333333333333333%200%200%200%200.24666666666666665%20-0.14666666666666667%205.133333333333333%205.133333333333333%200%200%201%200.8066666666666666%20-0.9733333333333333%200.3133333333333333%200.3133333333333333%200%200%200%200.09999999999999999%20-0.2333333333333333%200.3666666666666667%200.3666666666666667%200%200%200%20-0.09333333333333334%20-0.24666666666666665L3.28%201.8666666666666665A1.1666666666666665%201.1666666666666665%200%200%200%201.8399999999999999%200.11333333333333334a0.6666666666666666%200.6666666666666666%200%200%200%20-0.3666666666666667%200.48l-0.09999999999999999%200.5133333333333333a0.31999999999999995%200.31999999999999995%200%200%201%20-0.26%200.26666666666666666l-0.52%200.09999999999999999a0.6666666666666666%200.6666666666666666%200%200%200%20-0.48%200.3666666666666667A1.1666666666666665%201.1666666666666665%200%200%200%201.8666666666666665%203.28Z'%20fill='currentColor'%20strokeWidth='0.6667'%3e%3c/path%3e%3cpath%20d='M12.4%204.446666666666666a0.35333333333333333%200.35333333333333333%200%200%200%200.24666666666666665%200.14666666666666667%200.3466666666666667%200.3466666666666667%200%200%200%200.26666666666666666%20-0.09333333333333334l1.22%20-1.22a1.1666666666666665%201.1666666666666665%200%200%200%201.7533333333333332%20-1.44%200.6666666666666666%200.6666666666666666%200%200%200%20-0.48%20-0.3666666666666667l-0.52%20-0.09999999999999999a0.31999999999999995%200.31999999999999995%200%200%201%20-0.26%20-0.26666666666666666l-0.09999999999999999%20-0.5133333333333333a0.6666666666666666%200.6666666666666666%200%200%200%20-0.3666666666666667%20-0.48%201.1666666666666665%201.1666666666666665%200%200%200%20-1.44%201.7533333333333332l-1.1333333333333333%201.1266666666666665a0.3666666666666667%200.3666666666666667%200%200%200%20-0.09333333333333334%200.24666666666666665%200.3133333333333333%200.3133333333333333%200%200%200%200.09999999999999999%200.2333333333333333%205.133333333333333%205.133333333333333%200%200%201%200.8066666666666666%200.9733333333333333Z'%20fill='currentColor'%20strokeWidth='0.6667'%3e%3c/path%3e%3cpath%20d='M3.6%2011.559999999999999a0.33999999999999997%200.33999999999999997%200%200%200%20-0.26666666666666666%20-0.15333333333333332%200.3466666666666667%200.3466666666666667%200%200%200%20-0.26666666666666666%200.09333333333333334l-1.2%201.22a1.1666666666666665%201.1666666666666665%200%200%200%20-1.7533333333333332%201.44%200.6666666666666666%200.6666666666666666%200%200%200%200.48%200.3666666666666667l0.52%200.09999999999999999a0.31999999999999995%200.31999999999999995%200%200%201%200.26%200.26666666666666666l0.09999999999999999%200.5133333333333333a0.6666666666666666%200.6666666666666666%200%200%200%200.3666666666666667%200.48%201.1666666666666665%201.1666666666666665%200%200%200%201.44%20-1.7533333333333332l1.1333333333333333%20-1.1266666666666665a0.36%200.36%200%200%200%200.09333333333333334%20-0.24%200.31999999999999995%200.31999999999999995%200%200%200%20-0.09999999999999999%20-0.24%205.333333333333333%205.333333333333333%200%200%201%20-0.8066666666666666%20-0.9666666666666666Z'%20fill='currentColor'%20strokeWidth='0.6667'%3e%3c/path%3e%3cpath%20d='m14.133333333333333%2012.719999999999999%20-1.22%20-1.22a0.3466666666666667%200.3466666666666667%200%200%200%20-0.26666666666666666%20-0.09333333333333334%200.33999999999999997%200.33999999999999997%200%200%200%20-0.24666666666666665%200.15333333333333332%205.333333333333333%205.333333333333333%200%200%201%20-0.8066666666666666%200.9666666666666666%200.31999999999999995%200.31999999999999995%200%200%200%20-0.09999999999999999%200.24%200.36%200.36%200%200%200%200.09333333333333334%200.24l1.1333333333333333%201.1266666666666665a1.1666666666666665%201.1666666666666665%200%200%200%201.44%201.7533333333333332%200.6666666666666666%200.6666666666666666%200%200%200%200.3666666666666667%20-0.48l0.09999999999999999%20-0.5133333333333333a0.31999999999999995%200.31999999999999995%200%200%201%200.26%20-0.26666666666666666l0.52%20-0.09999999999999999a0.6666666666666666%200.6666666666666666%200%200%200%200.48%20-0.3666666666666667%201.1666666666666665%201.1666666666666665%200%200%200%20-1.7533333333333332%20-1.44Z'%20fill='currentColor'%20strokeWidth='0.6667'%3e%3c/path%3e%3c/g%3e%3c/svg%3e",hK=Object.freeze(Object.defineProperty({__proto__:null,ReactComponent:fK,default:AK},Symbol.toStringTag,{value:"Module"})),qK=e=>p.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",height:24,width:24,id:"Check-Circle-1--Streamline-Ultimate",...e},p.createElement("desc",null,"Check Circle 1 Streamline Icon: https://streamlinehq.com"),p.createElement("path",{d:"M12 0a12 12 0 1 0 12 12A12 12 0 0 0 12 0Zm6.93 8.2 -6.85 9.29a1 1 0 0 1 -1.43 0.19l-4.89 -3.91a1 1 0 0 1 -0.15 -1.41A1 1 0 0 1 7 12.21l4.08 3.26L17.32 7a1 1 0 0 1 1.39 -0.21 1 1 0 0 1 0.22 1.41Z",fill:"currentcolor",strokeWidth:1})),mK="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20height='24'%20width='24'%20id='Check-Circle-1--Streamline-Ultimate'%3e%3cdesc%3eCheck%20Circle%201%20Streamline%20Icon:%20https://streamlinehq.com%3c/desc%3e%3cpath%20d='M12%200a12%2012%200%201%200%2012%2012A12%2012%200%200%200%2012%200Zm6.93%208.2%20-6.85%209.29a1%201%200%200%201%20-1.43%200.19l-4.89%20-3.91a1%201%200%200%201%20-0.15%20-1.41A1%201%200%200%201%207%2012.21l4.08%203.26L17.32%207a1%201%200%200%201%201.39%20-0.21%201%201%200%200%201%200.22%201.41Z'%20fill='currentcolor'%20stroke-width='1'%3e%3c/path%3e%3c/svg%3e",gK=Object.freeze(Object.defineProperty({__proto__:null,ReactComponent:qK,default:mK},Symbol.toStringTag,{value:"Module"})),WK=e=>p.createElement("svg",{viewBox:"-0.75 -0.75 20 20",xmlns:"http://www.w3.org/2000/svg",height:24,width:24,...e},p.createElement("desc",null,"Typography"),p.createElement("path",{d:"m0.578125 9.827354166666668 8.09375 0",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5}),p.createElement("path",{d:"m12.140625 13.296104166666666 5.78125 0",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5}),p.createElement("path",{d:"M12.140625 16.764854166666666V10.40625a2.890625 2.890625 0 0 1 5.78125 0v6.359375",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5}),p.createElement("path",{d:"M0.578125 16.764854166666666V5.78125a4.046875 4.046875 0 0 1 8.09375 0v10.984375",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5})),vK="data:image/svg+xml,%3csvg%20viewBox='-0.75%20-0.75%2020%2020'%20xmlns='http://www.w3.org/2000/svg'%20height='24'%20width='24'%3e%3cdesc%3eTypography%3c/desc%3e%3cpath%20d='m0.578125%209.827354166666668%208.09375%200'%20fill='none'%20stroke='currentColor'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='1.5'%3e%3c/path%3e%3cpath%20d='m12.140625%2013.296104166666666%205.78125%200'%20fill='none'%20stroke='currentColor'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='1.5'%3e%3c/path%3e%3cpath%20d='M12.140625%2016.764854166666666V10.40625a2.890625%202.890625%200%200%201%205.78125%200v6.359375'%20fill='none'%20stroke='currentColor'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='1.5'%3e%3c/path%3e%3cpath%20d='M0.578125%2016.764854166666666V5.78125a4.046875%204.046875%200%200%201%208.09375%200v10.984375'%20fill='none'%20stroke='currentColor'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='1.5'%3e%3c/path%3e%3c/svg%3e",RK=Object.freeze(Object.defineProperty({__proto__:null,ReactComponent:WK,default:vK},Symbol.toStringTag,{value:"Module"})),yK=Jt("",{variants:{size:{sm:"size-3",md:"size-4",lg:"size-6",xl:"size-8"}},defaultVariants:{size:"md"}}),wK=Object.assign({"../../assets/icons/error-fill.svg":zK,"../../assets/icons/info-fill.svg":OK,"../../assets/icons/skull-and-bones.svg":hK,"../../assets/icons/success-fill.svg":gK,"../../assets/icons/typography.svg":RK}),Hi=Object.entries(wK).reduce((e,[t,o])=>{var n;const r=((n=t.match(/[^/]+(?=\.svg$)/))==null?void 0:n[0])??"",a=YQ(r),i=b=>{const{size:l,className:u,...f}=b,O=g0(yK({size:l,className:u}));return b0.createElement(o.ReactComponent,{...f,className:O})};return i.displayName=`Icon.${a}`,e[a]=i,e},{}),xc0=Hi,LK=p.createContext({isAnyTextFieldFocused:!1,setFocusState:()=>{},darkMode:!1}),xK=()=>{const[e,t]=p.useState(!1);return p.useEffect(()=>(t(!0),()=>t(!1)),[]),e?Pp.createPortal(z.jsx("div",{className:tn,style:{width:"unset",height:"unset"},children:z.jsx(iK,{icons:{error:z.jsx(Hi.ErrorFill,{className:"text-red"}),success:z.jsx(Hi.SuccessFill,{className:"text-green"}),info:z.jsx(Hi.InfoFill,{className:"text-gray-500"})},position:"bottom-left",toastOptions:{classNames:{title:"!mt-[-1px] !text-md !font-semibold !leading-tighter !tracking-[0.1px]",description:"!text-gray-900 dark:!text-gray-300 !text-sm !mt-px",icon:"!ml-0"},style:{alignItems:"flex-start",maxWidth:"290px"}}})}),document.body):null},kK=({darkMode:e,children:t})=>{const[o,n]=p.useState(!1),r=a=>{n(a)};return z.jsx(LK.Provider,{value:{isAnyTextFieldFocused:o,setFocusState:r,darkMode:e},children:z.jsxs(MK,{children:[t,z.jsx(xK,{})]})})},tn="shade shade-admin shade-activitypub shade-stats shade-posts",CK=({darkMode:e,fetchKoenigLexical:t,className:o,children:n,...r})=>{const a=Z1("shade",o);return z.jsx("div",{className:a,...r,children:z.jsx(kK,{darkMode:e,children:n})})},NK=RH,BK=yH,_K=wH,A9=p.forwardRef(({className:e,...t},o)=>z.jsx(r8,{className:g0("fixed inset-0 z-50 bg-black/30 backdrop-blur-none transform-gpu data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=open]:backdrop-blur-[3px]",e),...t,ref:o}));A9.displayName=r8.displayName;const h9=p.forwardRef(({className:e,...t},o)=>z.jsx(_K,{children:z.jsxs("div",{className:tn,children:[z.jsx(A9,{onClick:n=>n.stopPropagation()}),z.jsx(c8,{ref:o,className:g0("fixed left-[50%] top-[20%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-20%] gap-6 bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[18%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[18%] sm:rounded-lg",e),...t})]})}));h9.displayName=c8.displayName;const q9=({className:e,...t})=>z.jsx("div",{className:g0("flex flex-col space-y-2 text-center sm:text-left",e),...t});q9.displayName="AlertDialogHeader";const m9=({className:e,...t})=>z.jsx("div",{className:g0("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 [&>button]:min-w-20",e),...t});m9.displayName="AlertDialogFooter";const g9=p.forwardRef(({className:e,...t},o)=>z.jsx(i8,{ref:o,className:g0("text-xl font-semibold",e),...t}));g9.displayName=i8.displayName;const W9=p.forwardRef(({className:e,...t},o)=>z.jsx(p8,{ref:o,className:g0("text-base",e),...t}));W9.displayName=p8.displayName;const v9=p.forwardRef(({className:e,...t},o)=>z.jsx(a8,{ref:o,className:g0(O3(),e),...t}));v9.displayName=a8.displayName;const R9=p.forwardRef(({className:e,...t},o)=>z.jsx(s8,{ref:o,className:g0(O3({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));R9.displayName=s8.displayName;const EK=p.lazy(()=>z1(()=>import("./index-DpFOl82I.js"),[],import.meta.url)),Xf=e=>z.jsx(p.Suspense,{fallback:z.jsx("div",{}),children:z.jsx(EK,{...e})}),md=p.forwardRef(({className:e,...t},o)=>z.jsx(R7,{ref:o,className:g0("relative flex h-8 w-8 shrink-0 overflow-hidden rounded-full",e),...t}));md.displayName=R7.displayName;const gd=p.forwardRef(({className:e,...t},o)=>z.jsx(y7,{ref:o,className:g0("aspect-square h-full w-full",e),...t}));gd.displayName=y7.displayName;const Wd=p.forwardRef(({className:e,...t},o)=>z.jsx(w7,{ref:o,className:g0("flex h-full w-full items-center justify-center rounded-full bg-muted [&_svg]:size-4",e),...t}));Wd.displayName=w7.displayName;const SK=Jt("inline-flex items-center rounded-sm border px-1.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground/70",destructive:"border-transparent bg-destructive/20 text-destructive",success:"border-transparent bg-green/20 text-green",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function TK({className:e,variant:t,...o}){return z.jsx("div",{className:g0(SK({variant:t}),e),...o})}const PK=Jt("relative block rounded-lg transition-all duration-300",{variants:{variant:{default:"border border-border bg-background shadow-sm hover:shadow-md",gradient:["cursor-pointer border border-gray-100 bg-white","shadow-[rgb(75_225_226_/_28%)_-7px_-6px_42px_8px,rgb(202_103_255_/_32%)_7px_6px_42px_8px]","hover:shadow-[rgb(75_225_226_/_38%)_-7px_-4px_42px_10px,rgb(202_103_255_/_42%)_7px_8px_42px_10px]","hover:translate-y-[-2px] hover:scale-[1.01]"],info:"bg-blue-50 border-blue-200 dark:bg-blue-950/30 dark:border-blue-800 border",success:"bg-green-50 border-green-200 dark:bg-green-950/30 dark:border-green-800 border",warning:"bg-yellow-50 border-yellow-200 dark:bg-yellow-950/30 dark:border-yellow-800 border",destructive:"bg-red-50 border-red-200 dark:bg-red-950/30 dark:border-red-800 border"},size:{sm:"p-2 text-sm",md:"p-3",lg:"p-4"}},defaultVariants:{variant:"default",size:"md"}}),vd=p.forwardRef((e,t)=>{const{variant:o,size:n,dismissible:r=!1,onDismiss:a,role:i="status",className:b,children:l,...u}=e,f=O=>{O.preventDefault(),O.stopPropagation(),r&&a&&a()};return z.jsxs("div",{ref:t,className:g0(PK({variant:o,size:n}),b),role:i,...u,children:[r&&z.jsx(o1,{"aria-label":"Dismiss notification",className:"absolute right-1 top-1 size-8 text-gray-600",size:"icon",variant:"ghost",onClick:f,children:z.jsx(qd,{className:"size-5"})}),l]})});vd.displayName="Banner";function Do(e,t,{checkForDefaultPrevented:o=!0}={}){return function(r){if(e?.(r),o===!1||!r.defaultPrevented)return t?.(r)}}var XK="DismissableLayer",Az="dismissableLayer.update",jK="dismissableLayer.pointerDownOutside",DK="dismissableLayer.focusOutside",jf,y9=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),w9=p.forwardRef((e,t)=>{const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:n,onPointerDownOutside:r,onFocusOutside:a,onInteractOutside:i,onDismiss:b,...l}=e,u=p.useContext(y9),[f,O]=p.useState(null),h=f?.ownerDocument??globalThis?.document,[,q]=p.useState({}),g=Y0(t,N=>O(N)),W=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=W.indexOf(v),x=f?W.indexOf(f):-1,k=u.layersWithOutsidePointerEventsDisabled.size>0,L=x>=y,C=HK(N=>{const D=N.target,Y=[...u.branches].some(V=>V.contains(D));!L||Y||(r?.(N),i?.(N),N.defaultPrevented||b?.())},h),w=UK(N=>{const D=N.target;[...u.branches].some(V=>V.contains(D))||(a?.(N),i?.(N),N.defaultPrevented||b?.())},h);return Up(N=>{x===u.layers.size-1&&(n?.(N),!N.defaultPrevented&&b&&(N.preventDefault(),b()))},h),p.useEffect(()=>{if(f)return o&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(jf=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),Df(),()=>{o&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=jf)}},[f,h,o,u]),p.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),Df())},[f,u]),p.useEffect(()=>{const N=()=>q({});return document.addEventListener(Az,N),()=>document.removeEventListener(Az,N)},[]),z.jsx(H0.div,{...l,ref:g,style:{pointerEvents:k?L?"auto":"none":void 0,...e.style},onFocusCapture:Do(e.onFocusCapture,w.onFocusCapture),onBlurCapture:Do(e.onBlurCapture,w.onBlurCapture),onPointerDownCapture:Do(e.onPointerDownCapture,C.onPointerDownCapture)})});w9.displayName=XK;var IK="DismissableLayerBranch",FK=p.forwardRef((e,t)=>{const o=p.useContext(y9),n=p.useRef(null),r=Y0(t,n);return p.useEffect(()=>{const a=n.current;if(a)return o.branches.add(a),()=>{o.branches.delete(a)}},[o.branches]),z.jsx(H0.div,{...e,ref:r})});FK.displayName=IK;function HK(e,t=globalThis?.document){const o=he(e),n=p.useRef(!1),r=p.useRef(()=>{});return p.useEffect(()=>{const a=b=>{if(b.target&&!n.current){let l=function(){L9(jK,o,u,{discrete:!0})};const u={originalEvent:b};b.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=l,t.addEventListener("click",r.current,{once:!0})):l()}else t.removeEventListener("click",r.current);n.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",a),t.removeEventListener("click",r.current)}},[t,o]),{onPointerDownCapture:()=>n.current=!0}}function UK(e,t=globalThis?.document){const o=he(e),n=p.useRef(!1);return p.useEffect(()=>{const r=a=>{a.target&&!n.current&&L9(DK,o,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,o]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function Df(){const e=new CustomEvent(Az);document.dispatchEvent(e)}function L9(e,t,o,{discrete:n}){const r=o.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:o});t&&r.addEventListener(e,t,{once:!0}),n?ga(r,a):r.dispatchEvent(a)}function VK(e,t){return p.useReducer((o,n)=>t[o][n]??o,e)}var f3=e=>{const{present:t,children:o}=e,n=$K(t),r=typeof o=="function"?o({present:n.isPresent}):p.Children.only(o),a=Y0(n.ref,QK(r));return typeof o=="function"||n.isPresent?p.cloneElement(r,{ref:a}):null};f3.displayName="Presence";function $K(e){const[t,o]=p.useState(),n=p.useRef(null),r=p.useRef(e),a=p.useRef("none"),i=e?"mounted":"unmounted",[b,l]=VK(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const u=Ai(n.current);a.current=b==="mounted"?u:"none"},[b]),re(()=>{const u=n.current,f=r.current;if(f!==e){const h=a.current,q=Ai(u);e?l("MOUNT"):q==="none"||u?.display==="none"?l("UNMOUNT"):l(f&&h!==q?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,l]),re(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,O=q=>{const W=Ai(n.current).includes(CSS.escape(q.animationName));if(q.target===t&&W&&(l("ANIMATION_END"),!r.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",u=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},h=q=>{q.target===t&&(a.current=Ai(n.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",O),t.addEventListener("animationend",O),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",O),t.removeEventListener("animationend",O)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(b),ref:p.useCallback(u=>{n.current=u?getComputedStyle(u):null,o(u)},[])}}function Ai(e){return e?.animationName||"none"}function QK(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning;return o?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}var Ol=0;function ZK(){p.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??If()),document.body.insertAdjacentElement("beforeend",e[1]??If()),Ol++,()=>{Ol===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ol--}},[])}function If(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var A3="Dialog",[x9]=_e(A3),[GK,J2]=x9(A3),k9=e=>{const{__scopeDialog:t,children:o,open:n,defaultOpen:r,onOpenChange:a,modal:i=!0}=e,b=p.useRef(null),l=p.useRef(null),[u,f]=Yo({prop:n,defaultProp:r??!1,onChange:a,caller:A3});return z.jsx(GK,{scope:t,triggerRef:b,contentRef:l,contentId:e2(),titleId:e2(),descriptionId:e2(),open:u,onOpenChange:f,onOpenToggle:p.useCallback(()=>f(O=>!O),[f]),modal:i,children:o})};k9.displayName=A3;var C9="DialogTrigger",N9=p.forwardRef((e,t)=>{const{__scopeDialog:o,...n}=e,r=J2(C9,o),a=Y0(t,r.triggerRef);return z.jsx(H0.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":wd(r.open),...n,ref:a,onClick:Do(e.onClick,r.onOpenToggle)})});N9.displayName=C9;var Rd="DialogPortal",[KK,B9]=x9(Rd,{forceMount:void 0}),_9=e=>{const{__scopeDialog:t,forceMount:o,children:n,container:r}=e,a=J2(Rd,t);return z.jsx(KK,{scope:t,forceMount:o,children:p.Children.map(n,i=>z.jsx(f3,{present:o||a.open,children:z.jsx(Yr,{asChild:!0,container:r,children:i})}))})};_9.displayName=Rd;var Op="DialogOverlay",E9=p.forwardRef((e,t)=>{const o=B9(Op,e.__scopeDialog),{forceMount:n=o.forceMount,...r}=e,a=J2(Op,e.__scopeDialog);return a.modal?z.jsx(f3,{present:n||a.open,children:z.jsx(JK,{...r,ref:t})}):null});E9.displayName=Op;var YK=Ho("DialogOverlay.RemoveScroll"),JK=p.forwardRef((e,t)=>{const{__scopeDialog:o,...n}=e,r=J2(Op,o);return z.jsx(xa,{as:YK,allowPinchZoom:!0,shards:[r.contentRef],children:z.jsx(H0.div,{"data-state":wd(r.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),jn="DialogContent",S9=p.forwardRef((e,t)=>{const o=B9(jn,e.__scopeDialog),{forceMount:n=o.forceMount,...r}=e,a=J2(jn,e.__scopeDialog);return z.jsx(f3,{present:n||a.open,children:a.modal?z.jsx(eY,{...r,ref:t}):z.jsx(tY,{...r,ref:t})})});S9.displayName=jn;var eY=p.forwardRef((e,t)=>{const o=J2(jn,e.__scopeDialog),n=p.useRef(null),r=Y0(t,o.contentRef,n);return p.useEffect(()=>{const a=n.current;if(a)return Qp(a)},[]),z.jsx(T9,{...e,ref:r,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Do(e.onCloseAutoFocus,a=>{a.preventDefault(),o.triggerRef.current?.focus()}),onPointerDownOutside:Do(e.onPointerDownOutside,a=>{const i=a.detail.originalEvent,b=i.button===0&&i.ctrlKey===!0;(i.button===2||b)&&a.preventDefault()}),onFocusOutside:Do(e.onFocusOutside,a=>a.preventDefault())})}),tY=p.forwardRef((e,t)=>{const o=J2(jn,e.__scopeDialog),n=p.useRef(!1),r=p.useRef(!1);return z.jsx(T9,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{e.onCloseAutoFocus?.(a),a.defaultPrevented||(n.current||o.triggerRef.current?.focus(),a.preventDefault()),n.current=!1,r.current=!1},onInteractOutside:a=>{e.onInteractOutside?.(a),a.defaultPrevented||(n.current=!0,a.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const i=a.target;o.triggerRef.current?.contains(i)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&r.current&&a.preventDefault()}})}),T9=p.forwardRef((e,t)=>{const{__scopeDialog:o,trapFocus:n,onOpenAutoFocus:r,onCloseAutoFocus:a,...i}=e,b=J2(jn,o),l=p.useRef(null),u=Y0(t,l);return ZK(),z.jsxs(z.Fragment,{children:[z.jsx(La,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:r,onUnmountAutoFocus:a,children:z.jsx(w9,{role:"dialog",id:b.contentId,"aria-describedby":b.descriptionId,"aria-labelledby":b.titleId,"data-state":wd(b.open),...i,ref:u,onDismiss:()=>b.onOpenChange(!1)})}),z.jsxs(z.Fragment,{children:[z.jsx(oY,{titleId:b.titleId}),z.jsx(rY,{contentRef:l,descriptionId:b.descriptionId})]})]})}),yd="DialogTitle",P9=p.forwardRef((e,t)=>{const{__scopeDialog:o,...n}=e,r=J2(yd,o);return z.jsx(H0.h2,{id:r.titleId,...n,ref:t})});P9.displayName=yd;var X9="DialogDescription",j9=p.forwardRef((e,t)=>{const{__scopeDialog:o,...n}=e,r=J2(X9,o);return z.jsx(H0.p,{id:r.descriptionId,...n,ref:t})});j9.displayName=X9;var D9="DialogClose",I9=p.forwardRef((e,t)=>{const{__scopeDialog:o,...n}=e,r=J2(D9,o);return z.jsx(H0.button,{type:"button",...n,ref:t,onClick:Do(e.onClick,()=>r.onOpenChange(!1))})});I9.displayName=D9;function wd(e){return e?"open":"closed"}var F9="DialogTitleWarning",[kc0,H9]=mh(F9,{contentName:jn,titleName:yd,docsSlug:"dialog"}),oY=({titleId:e})=>{const t=H9(F9),o=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
599
+ `),p.createElement("g",null,p.createElement("path",{d:"M12.333333333333332 7.333333333333333a4.333333333333333 4.333333333333333 0 1 0 -7.333333333333333 3.126666666666667v1.88a1 1 0 0 0 2 0 1 1 0 0 0 2 0 1 1 0 1 0 2 0v-1.88a4.326666666666666 4.326666666666666 0 0 0 1.3333333333333333 -3.126666666666667Zm-6.253333333333334 1a1 1 0 1 1 1 -1 1 1 0 0 1 -1 1Zm4 0a1 1 0 1 1 1 -1 1 1 0 0 1 -1 1Z",fill:"currentColor",strokeWidth:.6667}),p.createElement("path",{d:"m1.8666666666666665 3.28 1.22 1.22a0.3466666666666667 0.3466666666666667 0 0 0 0.26666666666666666 0.09333333333333334 0.35333333333333333 0.35333333333333333 0 0 0 0.24666666666666665 -0.14666666666666667 5.133333333333333 5.133333333333333 0 0 1 0.8066666666666666 -0.9733333333333333 0.3133333333333333 0.3133333333333333 0 0 0 0.09999999999999999 -0.2333333333333333 0.3666666666666667 0.3666666666666667 0 0 0 -0.09333333333333334 -0.24666666666666665L3.28 1.8666666666666665A1.1666666666666665 1.1666666666666665 0 0 0 1.8399999999999999 0.11333333333333334a0.6666666666666666 0.6666666666666666 0 0 0 -0.3666666666666667 0.48l-0.09999999999999999 0.5133333333333333a0.31999999999999995 0.31999999999999995 0 0 1 -0.26 0.26666666666666666l-0.52 0.09999999999999999a0.6666666666666666 0.6666666666666666 0 0 0 -0.48 0.3666666666666667A1.1666666666666665 1.1666666666666665 0 0 0 1.8666666666666665 3.28Z",fill:"currentColor",strokeWidth:.6667}),p.createElement("path",{d:"M12.4 4.446666666666666a0.35333333333333333 0.35333333333333333 0 0 0 0.24666666666666665 0.14666666666666667 0.3466666666666667 0.3466666666666667 0 0 0 0.26666666666666666 -0.09333333333333334l1.22 -1.22a1.1666666666666665 1.1666666666666665 0 0 0 1.7533333333333332 -1.44 0.6666666666666666 0.6666666666666666 0 0 0 -0.48 -0.3666666666666667l-0.52 -0.09999999999999999a0.31999999999999995 0.31999999999999995 0 0 1 -0.26 -0.26666666666666666l-0.09999999999999999 -0.5133333333333333a0.6666666666666666 0.6666666666666666 0 0 0 -0.3666666666666667 -0.48 1.1666666666666665 1.1666666666666665 0 0 0 -1.44 1.7533333333333332l-1.1333333333333333 1.1266666666666665a0.3666666666666667 0.3666666666666667 0 0 0 -0.09333333333333334 0.24666666666666665 0.3133333333333333 0.3133333333333333 0 0 0 0.09999999999999999 0.2333333333333333 5.133333333333333 5.133333333333333 0 0 1 0.8066666666666666 0.9733333333333333Z",fill:"currentColor",strokeWidth:.6667}),p.createElement("path",{d:"M3.6 11.559999999999999a0.33999999999999997 0.33999999999999997 0 0 0 -0.26666666666666666 -0.15333333333333332 0.3466666666666667 0.3466666666666667 0 0 0 -0.26666666666666666 0.09333333333333334l-1.2 1.22a1.1666666666666665 1.1666666666666665 0 0 0 -1.7533333333333332 1.44 0.6666666666666666 0.6666666666666666 0 0 0 0.48 0.3666666666666667l0.52 0.09999999999999999a0.31999999999999995 0.31999999999999995 0 0 1 0.26 0.26666666666666666l0.09999999999999999 0.5133333333333333a0.6666666666666666 0.6666666666666666 0 0 0 0.3666666666666667 0.48 1.1666666666666665 1.1666666666666665 0 0 0 1.44 -1.7533333333333332l1.1333333333333333 -1.1266666666666665a0.36 0.36 0 0 0 0.09333333333333334 -0.24 0.31999999999999995 0.31999999999999995 0 0 0 -0.09999999999999999 -0.24 5.333333333333333 5.333333333333333 0 0 1 -0.8066666666666666 -0.9666666666666666Z",fill:"currentColor",strokeWidth:.6667}),p.createElement("path",{d:"m14.133333333333333 12.719999999999999 -1.22 -1.22a0.3466666666666667 0.3466666666666667 0 0 0 -0.26666666666666666 -0.09333333333333334 0.33999999999999997 0.33999999999999997 0 0 0 -0.24666666666666665 0.15333333333333332 5.333333333333333 5.333333333333333 0 0 1 -0.8066666666666666 0.9666666666666666 0.31999999999999995 0.31999999999999995 0 0 0 -0.09999999999999999 0.24 0.36 0.36 0 0 0 0.09333333333333334 0.24l1.1333333333333333 1.1266666666666665a1.1666666666666665 1.1666666666666665 0 0 0 1.44 1.7533333333333332 0.6666666666666666 0.6666666666666666 0 0 0 0.3666666666666667 -0.48l0.09999999999999999 -0.5133333333333333a0.31999999999999995 0.31999999999999995 0 0 1 0.26 -0.26666666666666666l0.52 -0.09999999999999999a0.6666666666666666 0.6666666666666666 0 0 0 0.48 -0.3666666666666667 1.1666666666666665 1.1666666666666665 0 0 0 -1.7533333333333332 -1.44Z",fill:"currentColor",strokeWidth:.6667}))),AK="data:image/svg+xml,%3csvg%20height='16'%20id='Skull-2--Streamline-Ultimate'%20viewBox='0%200%2016%2016'%20width='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cdesc%3e%20Skull%202%20Streamline%20Icon:%20https://streamlinehq.com%20%3c/desc%3e%3cg%3e%3cpath%20d='M12.333333333333332%207.333333333333333a4.333333333333333%204.333333333333333%200%201%200%20-7.333333333333333%203.126666666666667v1.88a1%201%200%200%200%202%200%201%201%200%200%200%202%200%201%201%200%201%200%202%200v-1.88a4.326666666666666%204.326666666666666%200%200%200%201.3333333333333333%20-3.126666666666667Zm-6.253333333333334%201a1%201%200%201%201%201%20-1%201%201%200%200%201%20-1%201Zm4%200a1%201%200%201%201%201%20-1%201%201%200%200%201%20-1%201Z'%20fill='currentColor'%20strokeWidth='0.6667'%3e%3c/path%3e%3cpath%20d='m1.8666666666666665%203.28%201.22%201.22a0.3466666666666667%200.3466666666666667%200%200%200%200.26666666666666666%200.09333333333333334%200.35333333333333333%200.35333333333333333%200%200%200%200.24666666666666665%20-0.14666666666666667%205.133333333333333%205.133333333333333%200%200%201%200.8066666666666666%20-0.9733333333333333%200.3133333333333333%200.3133333333333333%200%200%200%200.09999999999999999%20-0.2333333333333333%200.3666666666666667%200.3666666666666667%200%200%200%20-0.09333333333333334%20-0.24666666666666665L3.28%201.8666666666666665A1.1666666666666665%201.1666666666666665%200%200%200%201.8399999999999999%200.11333333333333334a0.6666666666666666%200.6666666666666666%200%200%200%20-0.3666666666666667%200.48l-0.09999999999999999%200.5133333333333333a0.31999999999999995%200.31999999999999995%200%200%201%20-0.26%200.26666666666666666l-0.52%200.09999999999999999a0.6666666666666666%200.6666666666666666%200%200%200%20-0.48%200.3666666666666667A1.1666666666666665%201.1666666666666665%200%200%200%201.8666666666666665%203.28Z'%20fill='currentColor'%20strokeWidth='0.6667'%3e%3c/path%3e%3cpath%20d='M12.4%204.446666666666666a0.35333333333333333%200.35333333333333333%200%200%200%200.24666666666666665%200.14666666666666667%200.3466666666666667%200.3466666666666667%200%200%200%200.26666666666666666%20-0.09333333333333334l1.22%20-1.22a1.1666666666666665%201.1666666666666665%200%200%200%201.7533333333333332%20-1.44%200.6666666666666666%200.6666666666666666%200%200%200%20-0.48%20-0.3666666666666667l-0.52%20-0.09999999999999999a0.31999999999999995%200.31999999999999995%200%200%201%20-0.26%20-0.26666666666666666l-0.09999999999999999%20-0.5133333333333333a0.6666666666666666%200.6666666666666666%200%200%200%20-0.3666666666666667%20-0.48%201.1666666666666665%201.1666666666666665%200%200%200%20-1.44%201.7533333333333332l-1.1333333333333333%201.1266666666666665a0.3666666666666667%200.3666666666666667%200%200%200%20-0.09333333333333334%200.24666666666666665%200.3133333333333333%200.3133333333333333%200%200%200%200.09999999999999999%200.2333333333333333%205.133333333333333%205.133333333333333%200%200%201%200.8066666666666666%200.9733333333333333Z'%20fill='currentColor'%20strokeWidth='0.6667'%3e%3c/path%3e%3cpath%20d='M3.6%2011.559999999999999a0.33999999999999997%200.33999999999999997%200%200%200%20-0.26666666666666666%20-0.15333333333333332%200.3466666666666667%200.3466666666666667%200%200%200%20-0.26666666666666666%200.09333333333333334l-1.2%201.22a1.1666666666666665%201.1666666666666665%200%200%200%20-1.7533333333333332%201.44%200.6666666666666666%200.6666666666666666%200%200%200%200.48%200.3666666666666667l0.52%200.09999999999999999a0.31999999999999995%200.31999999999999995%200%200%201%200.26%200.26666666666666666l0.09999999999999999%200.5133333333333333a0.6666666666666666%200.6666666666666666%200%200%200%200.3666666666666667%200.48%201.1666666666666665%201.1666666666666665%200%200%200%201.44%20-1.7533333333333332l1.1333333333333333%20-1.1266666666666665a0.36%200.36%200%200%200%200.09333333333333334%20-0.24%200.31999999999999995%200.31999999999999995%200%200%200%20-0.09999999999999999%20-0.24%205.333333333333333%205.333333333333333%200%200%201%20-0.8066666666666666%20-0.9666666666666666Z'%20fill='currentColor'%20strokeWidth='0.6667'%3e%3c/path%3e%3cpath%20d='m14.133333333333333%2012.719999999999999%20-1.22%20-1.22a0.3466666666666667%200.3466666666666667%200%200%200%20-0.26666666666666666%20-0.09333333333333334%200.33999999999999997%200.33999999999999997%200%200%200%20-0.24666666666666665%200.15333333333333332%205.333333333333333%205.333333333333333%200%200%201%20-0.8066666666666666%200.9666666666666666%200.31999999999999995%200.31999999999999995%200%200%200%20-0.09999999999999999%200.24%200.36%200.36%200%200%200%200.09333333333333334%200.24l1.1333333333333333%201.1266666666666665a1.1666666666666665%201.1666666666666665%200%200%200%201.44%201.7533333333333332%200.6666666666666666%200.6666666666666666%200%200%200%200.3666666666666667%20-0.48l0.09999999999999999%20-0.5133333333333333a0.31999999999999995%200.31999999999999995%200%200%201%200.26%20-0.26666666666666666l0.52%20-0.09999999999999999a0.6666666666666666%200.6666666666666666%200%200%200%200.48%20-0.3666666666666667%201.1666666666666665%201.1666666666666665%200%200%200%20-1.7533333333333332%20-1.44Z'%20fill='currentColor'%20strokeWidth='0.6667'%3e%3c/path%3e%3c/g%3e%3c/svg%3e",hK=Object.freeze(Object.defineProperty({__proto__:null,ReactComponent:fK,default:AK},Symbol.toStringTag,{value:"Module"})),qK=e=>p.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",height:24,width:24,id:"Check-Circle-1--Streamline-Ultimate",...e},p.createElement("desc",null,"Check Circle 1 Streamline Icon: https://streamlinehq.com"),p.createElement("path",{d:"M12 0a12 12 0 1 0 12 12A12 12 0 0 0 12 0Zm6.93 8.2 -6.85 9.29a1 1 0 0 1 -1.43 0.19l-4.89 -3.91a1 1 0 0 1 -0.15 -1.41A1 1 0 0 1 7 12.21l4.08 3.26L17.32 7a1 1 0 0 1 1.39 -0.21 1 1 0 0 1 0.22 1.41Z",fill:"currentcolor",strokeWidth:1})),mK="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20height='24'%20width='24'%20id='Check-Circle-1--Streamline-Ultimate'%3e%3cdesc%3eCheck%20Circle%201%20Streamline%20Icon:%20https://streamlinehq.com%3c/desc%3e%3cpath%20d='M12%200a12%2012%200%201%200%2012%2012A12%2012%200%200%200%2012%200Zm6.93%208.2%20-6.85%209.29a1%201%200%200%201%20-1.43%200.19l-4.89%20-3.91a1%201%200%200%201%20-0.15%20-1.41A1%201%200%200%201%207%2012.21l4.08%203.26L17.32%207a1%201%200%200%201%201.39%20-0.21%201%201%200%200%201%200.22%201.41Z'%20fill='currentcolor'%20stroke-width='1'%3e%3c/path%3e%3c/svg%3e",gK=Object.freeze(Object.defineProperty({__proto__:null,ReactComponent:qK,default:mK},Symbol.toStringTag,{value:"Module"})),WK=e=>p.createElement("svg",{viewBox:"-0.75 -0.75 20 20",xmlns:"http://www.w3.org/2000/svg",height:24,width:24,...e},p.createElement("desc",null,"Typography"),p.createElement("path",{d:"m0.578125 9.827354166666668 8.09375 0",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5}),p.createElement("path",{d:"m12.140625 13.296104166666666 5.78125 0",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5}),p.createElement("path",{d:"M12.140625 16.764854166666666V10.40625a2.890625 2.890625 0 0 1 5.78125 0v6.359375",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5}),p.createElement("path",{d:"M0.578125 16.764854166666666V5.78125a4.046875 4.046875 0 0 1 8.09375 0v10.984375",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5})),vK="data:image/svg+xml,%3csvg%20viewBox='-0.75%20-0.75%2020%2020'%20xmlns='http://www.w3.org/2000/svg'%20height='24'%20width='24'%3e%3cdesc%3eTypography%3c/desc%3e%3cpath%20d='m0.578125%209.827354166666668%208.09375%200'%20fill='none'%20stroke='currentColor'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='1.5'%3e%3c/path%3e%3cpath%20d='m12.140625%2013.296104166666666%205.78125%200'%20fill='none'%20stroke='currentColor'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='1.5'%3e%3c/path%3e%3cpath%20d='M12.140625%2016.764854166666666V10.40625a2.890625%202.890625%200%200%201%205.78125%200v6.359375'%20fill='none'%20stroke='currentColor'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='1.5'%3e%3c/path%3e%3cpath%20d='M0.578125%2016.764854166666666V5.78125a4.046875%204.046875%200%200%201%208.09375%200v10.984375'%20fill='none'%20stroke='currentColor'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='1.5'%3e%3c/path%3e%3c/svg%3e",RK=Object.freeze(Object.defineProperty({__proto__:null,ReactComponent:WK,default:vK},Symbol.toStringTag,{value:"Module"})),yK=Jt("",{variants:{size:{sm:"size-3",md:"size-4",lg:"size-6",xl:"size-8"}},defaultVariants:{size:"md"}}),wK=Object.assign({"../../assets/icons/error-fill.svg":zK,"../../assets/icons/info-fill.svg":OK,"../../assets/icons/skull-and-bones.svg":hK,"../../assets/icons/success-fill.svg":gK,"../../assets/icons/typography.svg":RK}),Hi=Object.entries(wK).reduce((e,[t,o])=>{var n;const r=((n=t.match(/[^/]+(?=\.svg$)/))==null?void 0:n[0])??"",a=YQ(r),i=b=>{const{size:l,className:u,...f}=b,O=g0(yK({size:l,className:u}));return b0.createElement(o.ReactComponent,{...f,className:O})};return i.displayName=`Icon.${a}`,e[a]=i,e},{}),xc0=Hi,LK=p.createContext({isAnyTextFieldFocused:!1,setFocusState:()=>{},darkMode:!1}),xK=()=>{const[e,t]=p.useState(!1);return p.useEffect(()=>(t(!0),()=>t(!1)),[]),e?Pp.createPortal(z.jsx("div",{className:tn,style:{width:"unset",height:"unset"},children:z.jsx(iK,{icons:{error:z.jsx(Hi.ErrorFill,{className:"text-red"}),success:z.jsx(Hi.SuccessFill,{className:"text-green"}),info:z.jsx(Hi.InfoFill,{className:"text-gray-500"})},position:"bottom-left",toastOptions:{classNames:{title:"!mt-[-1px] !text-md !font-semibold !leading-tighter !tracking-[0.1px]",description:"!text-gray-900 dark:!text-gray-300 !text-sm !mt-px",icon:"!ml-0"},style:{alignItems:"flex-start",maxWidth:"290px"}}})}),document.body):null},kK=({darkMode:e,children:t})=>{const[o,n]=p.useState(!1),r=a=>{n(a)};return z.jsx(LK.Provider,{value:{isAnyTextFieldFocused:o,setFocusState:r,darkMode:e},children:z.jsxs(MK,{children:[t,z.jsx(xK,{})]})})},tn="shade shade-admin shade-activitypub shade-stats shade-posts",CK=({darkMode:e,fetchKoenigLexical:t,className:o,children:n,...r})=>{const a=Z1("shade",o);return z.jsx("div",{className:a,...r,children:z.jsx(kK,{darkMode:e,children:n})})},NK=RH,BK=yH,_K=wH,A9=p.forwardRef(({className:e,...t},o)=>z.jsx(r8,{className:g0("fixed inset-0 z-50 bg-black/30 backdrop-blur-none transform-gpu data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=open]:backdrop-blur-[3px]",e),...t,ref:o}));A9.displayName=r8.displayName;const h9=p.forwardRef(({className:e,...t},o)=>z.jsx(_K,{children:z.jsxs("div",{className:tn,children:[z.jsx(A9,{onClick:n=>n.stopPropagation()}),z.jsx(c8,{ref:o,className:g0("fixed left-[50%] top-[20%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-20%] gap-6 bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[18%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[18%] sm:rounded-lg",e),...t})]})}));h9.displayName=c8.displayName;const q9=({className:e,...t})=>z.jsx("div",{className:g0("flex flex-col space-y-2 text-center sm:text-left",e),...t});q9.displayName="AlertDialogHeader";const m9=({className:e,...t})=>z.jsx("div",{className:g0("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 [&>button]:min-w-20",e),...t});m9.displayName="AlertDialogFooter";const g9=p.forwardRef(({className:e,...t},o)=>z.jsx(i8,{ref:o,className:g0("text-xl font-semibold",e),...t}));g9.displayName=i8.displayName;const W9=p.forwardRef(({className:e,...t},o)=>z.jsx(p8,{ref:o,className:g0("text-base",e),...t}));W9.displayName=p8.displayName;const v9=p.forwardRef(({className:e,...t},o)=>z.jsx(a8,{ref:o,className:g0(O3(),e),...t}));v9.displayName=a8.displayName;const R9=p.forwardRef(({className:e,...t},o)=>z.jsx(s8,{ref:o,className:g0(O3({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));R9.displayName=s8.displayName;const EK=p.lazy(()=>z1(()=>import("./index-DN0lnLj_.js"),[],import.meta.url)),Xf=e=>z.jsx(p.Suspense,{fallback:z.jsx("div",{}),children:z.jsx(EK,{...e})}),md=p.forwardRef(({className:e,...t},o)=>z.jsx(R7,{ref:o,className:g0("relative flex h-8 w-8 shrink-0 overflow-hidden rounded-full",e),...t}));md.displayName=R7.displayName;const gd=p.forwardRef(({className:e,...t},o)=>z.jsx(y7,{ref:o,className:g0("aspect-square h-full w-full",e),...t}));gd.displayName=y7.displayName;const Wd=p.forwardRef(({className:e,...t},o)=>z.jsx(w7,{ref:o,className:g0("flex h-full w-full items-center justify-center rounded-full bg-muted [&_svg]:size-4",e),...t}));Wd.displayName=w7.displayName;const SK=Jt("inline-flex items-center rounded-sm border px-1.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground/70",destructive:"border-transparent bg-destructive/20 text-destructive",success:"border-transparent bg-green/20 text-green",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function TK({className:e,variant:t,...o}){return z.jsx("div",{className:g0(SK({variant:t}),e),...o})}const PK=Jt("relative block rounded-lg transition-all duration-300",{variants:{variant:{default:"border border-border bg-background shadow-sm hover:shadow-md",gradient:["cursor-pointer border border-gray-100 bg-white","shadow-[rgb(75_225_226_/_28%)_-7px_-6px_42px_8px,rgb(202_103_255_/_32%)_7px_6px_42px_8px]","hover:shadow-[rgb(75_225_226_/_38%)_-7px_-4px_42px_10px,rgb(202_103_255_/_42%)_7px_8px_42px_10px]","hover:translate-y-[-2px] hover:scale-[1.01]"],info:"bg-blue-50 border-blue-200 dark:bg-blue-950/30 dark:border-blue-800 border",success:"bg-green-50 border-green-200 dark:bg-green-950/30 dark:border-green-800 border",warning:"bg-yellow-50 border-yellow-200 dark:bg-yellow-950/30 dark:border-yellow-800 border",destructive:"bg-red-50 border-red-200 dark:bg-red-950/30 dark:border-red-800 border"},size:{sm:"p-2 text-sm",md:"p-3",lg:"p-4"}},defaultVariants:{variant:"default",size:"md"}}),vd=p.forwardRef((e,t)=>{const{variant:o,size:n,dismissible:r=!1,onDismiss:a,role:i="status",className:b,children:l,...u}=e,f=O=>{O.preventDefault(),O.stopPropagation(),r&&a&&a()};return z.jsxs("div",{ref:t,className:g0(PK({variant:o,size:n}),b),role:i,...u,children:[r&&z.jsx(o1,{"aria-label":"Dismiss notification",className:"absolute right-1 top-1 size-8 text-gray-600",size:"icon",variant:"ghost",onClick:f,children:z.jsx(qd,{className:"size-5"})}),l]})});vd.displayName="Banner";function Do(e,t,{checkForDefaultPrevented:o=!0}={}){return function(r){if(e?.(r),o===!1||!r.defaultPrevented)return t?.(r)}}var XK="DismissableLayer",Az="dismissableLayer.update",jK="dismissableLayer.pointerDownOutside",DK="dismissableLayer.focusOutside",jf,y9=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),w9=p.forwardRef((e,t)=>{const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:n,onPointerDownOutside:r,onFocusOutside:a,onInteractOutside:i,onDismiss:b,...l}=e,u=p.useContext(y9),[f,O]=p.useState(null),h=f?.ownerDocument??globalThis?.document,[,q]=p.useState({}),g=Y0(t,N=>O(N)),W=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=W.indexOf(v),x=f?W.indexOf(f):-1,k=u.layersWithOutsidePointerEventsDisabled.size>0,L=x>=y,C=HK(N=>{const D=N.target,Y=[...u.branches].some(V=>V.contains(D));!L||Y||(r?.(N),i?.(N),N.defaultPrevented||b?.())},h),w=UK(N=>{const D=N.target;[...u.branches].some(V=>V.contains(D))||(a?.(N),i?.(N),N.defaultPrevented||b?.())},h);return Up(N=>{x===u.layers.size-1&&(n?.(N),!N.defaultPrevented&&b&&(N.preventDefault(),b()))},h),p.useEffect(()=>{if(f)return o&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(jf=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),Df(),()=>{o&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=jf)}},[f,h,o,u]),p.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),Df())},[f,u]),p.useEffect(()=>{const N=()=>q({});return document.addEventListener(Az,N),()=>document.removeEventListener(Az,N)},[]),z.jsx(H0.div,{...l,ref:g,style:{pointerEvents:k?L?"auto":"none":void 0,...e.style},onFocusCapture:Do(e.onFocusCapture,w.onFocusCapture),onBlurCapture:Do(e.onBlurCapture,w.onBlurCapture),onPointerDownCapture:Do(e.onPointerDownCapture,C.onPointerDownCapture)})});w9.displayName=XK;var IK="DismissableLayerBranch",FK=p.forwardRef((e,t)=>{const o=p.useContext(y9),n=p.useRef(null),r=Y0(t,n);return p.useEffect(()=>{const a=n.current;if(a)return o.branches.add(a),()=>{o.branches.delete(a)}},[o.branches]),z.jsx(H0.div,{...e,ref:r})});FK.displayName=IK;function HK(e,t=globalThis?.document){const o=he(e),n=p.useRef(!1),r=p.useRef(()=>{});return p.useEffect(()=>{const a=b=>{if(b.target&&!n.current){let l=function(){L9(jK,o,u,{discrete:!0})};const u={originalEvent:b};b.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=l,t.addEventListener("click",r.current,{once:!0})):l()}else t.removeEventListener("click",r.current);n.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",a),t.removeEventListener("click",r.current)}},[t,o]),{onPointerDownCapture:()=>n.current=!0}}function UK(e,t=globalThis?.document){const o=he(e),n=p.useRef(!1);return p.useEffect(()=>{const r=a=>{a.target&&!n.current&&L9(DK,o,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,o]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function Df(){const e=new CustomEvent(Az);document.dispatchEvent(e)}function L9(e,t,o,{discrete:n}){const r=o.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:o});t&&r.addEventListener(e,t,{once:!0}),n?ga(r,a):r.dispatchEvent(a)}function VK(e,t){return p.useReducer((o,n)=>t[o][n]??o,e)}var f3=e=>{const{present:t,children:o}=e,n=$K(t),r=typeof o=="function"?o({present:n.isPresent}):p.Children.only(o),a=Y0(n.ref,QK(r));return typeof o=="function"||n.isPresent?p.cloneElement(r,{ref:a}):null};f3.displayName="Presence";function $K(e){const[t,o]=p.useState(),n=p.useRef(null),r=p.useRef(e),a=p.useRef("none"),i=e?"mounted":"unmounted",[b,l]=VK(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const u=Ai(n.current);a.current=b==="mounted"?u:"none"},[b]),re(()=>{const u=n.current,f=r.current;if(f!==e){const h=a.current,q=Ai(u);e?l("MOUNT"):q==="none"||u?.display==="none"?l("UNMOUNT"):l(f&&h!==q?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,l]),re(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,O=q=>{const W=Ai(n.current).includes(CSS.escape(q.animationName));if(q.target===t&&W&&(l("ANIMATION_END"),!r.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",u=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},h=q=>{q.target===t&&(a.current=Ai(n.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",O),t.addEventListener("animationend",O),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",O),t.removeEventListener("animationend",O)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(b),ref:p.useCallback(u=>{n.current=u?getComputedStyle(u):null,o(u)},[])}}function Ai(e){return e?.animationName||"none"}function QK(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning;return o?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}var Ol=0;function ZK(){p.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??If()),document.body.insertAdjacentElement("beforeend",e[1]??If()),Ol++,()=>{Ol===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ol--}},[])}function If(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var A3="Dialog",[x9]=_e(A3),[GK,J2]=x9(A3),k9=e=>{const{__scopeDialog:t,children:o,open:n,defaultOpen:r,onOpenChange:a,modal:i=!0}=e,b=p.useRef(null),l=p.useRef(null),[u,f]=Yo({prop:n,defaultProp:r??!1,onChange:a,caller:A3});return z.jsx(GK,{scope:t,triggerRef:b,contentRef:l,contentId:e2(),titleId:e2(),descriptionId:e2(),open:u,onOpenChange:f,onOpenToggle:p.useCallback(()=>f(O=>!O),[f]),modal:i,children:o})};k9.displayName=A3;var C9="DialogTrigger",N9=p.forwardRef((e,t)=>{const{__scopeDialog:o,...n}=e,r=J2(C9,o),a=Y0(t,r.triggerRef);return z.jsx(H0.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":wd(r.open),...n,ref:a,onClick:Do(e.onClick,r.onOpenToggle)})});N9.displayName=C9;var Rd="DialogPortal",[KK,B9]=x9(Rd,{forceMount:void 0}),_9=e=>{const{__scopeDialog:t,forceMount:o,children:n,container:r}=e,a=J2(Rd,t);return z.jsx(KK,{scope:t,forceMount:o,children:p.Children.map(n,i=>z.jsx(f3,{present:o||a.open,children:z.jsx(Yr,{asChild:!0,container:r,children:i})}))})};_9.displayName=Rd;var Op="DialogOverlay",E9=p.forwardRef((e,t)=>{const o=B9(Op,e.__scopeDialog),{forceMount:n=o.forceMount,...r}=e,a=J2(Op,e.__scopeDialog);return a.modal?z.jsx(f3,{present:n||a.open,children:z.jsx(JK,{...r,ref:t})}):null});E9.displayName=Op;var YK=Ho("DialogOverlay.RemoveScroll"),JK=p.forwardRef((e,t)=>{const{__scopeDialog:o,...n}=e,r=J2(Op,o);return z.jsx(xa,{as:YK,allowPinchZoom:!0,shards:[r.contentRef],children:z.jsx(H0.div,{"data-state":wd(r.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),jn="DialogContent",S9=p.forwardRef((e,t)=>{const o=B9(jn,e.__scopeDialog),{forceMount:n=o.forceMount,...r}=e,a=J2(jn,e.__scopeDialog);return z.jsx(f3,{present:n||a.open,children:a.modal?z.jsx(eY,{...r,ref:t}):z.jsx(tY,{...r,ref:t})})});S9.displayName=jn;var eY=p.forwardRef((e,t)=>{const o=J2(jn,e.__scopeDialog),n=p.useRef(null),r=Y0(t,o.contentRef,n);return p.useEffect(()=>{const a=n.current;if(a)return Qp(a)},[]),z.jsx(T9,{...e,ref:r,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Do(e.onCloseAutoFocus,a=>{a.preventDefault(),o.triggerRef.current?.focus()}),onPointerDownOutside:Do(e.onPointerDownOutside,a=>{const i=a.detail.originalEvent,b=i.button===0&&i.ctrlKey===!0;(i.button===2||b)&&a.preventDefault()}),onFocusOutside:Do(e.onFocusOutside,a=>a.preventDefault())})}),tY=p.forwardRef((e,t)=>{const o=J2(jn,e.__scopeDialog),n=p.useRef(!1),r=p.useRef(!1);return z.jsx(T9,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{e.onCloseAutoFocus?.(a),a.defaultPrevented||(n.current||o.triggerRef.current?.focus(),a.preventDefault()),n.current=!1,r.current=!1},onInteractOutside:a=>{e.onInteractOutside?.(a),a.defaultPrevented||(n.current=!0,a.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const i=a.target;o.triggerRef.current?.contains(i)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&r.current&&a.preventDefault()}})}),T9=p.forwardRef((e,t)=>{const{__scopeDialog:o,trapFocus:n,onOpenAutoFocus:r,onCloseAutoFocus:a,...i}=e,b=J2(jn,o),l=p.useRef(null),u=Y0(t,l);return ZK(),z.jsxs(z.Fragment,{children:[z.jsx(La,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:r,onUnmountAutoFocus:a,children:z.jsx(w9,{role:"dialog",id:b.contentId,"aria-describedby":b.descriptionId,"aria-labelledby":b.titleId,"data-state":wd(b.open),...i,ref:u,onDismiss:()=>b.onOpenChange(!1)})}),z.jsxs(z.Fragment,{children:[z.jsx(oY,{titleId:b.titleId}),z.jsx(rY,{contentRef:l,descriptionId:b.descriptionId})]})]})}),yd="DialogTitle",P9=p.forwardRef((e,t)=>{const{__scopeDialog:o,...n}=e,r=J2(yd,o);return z.jsx(H0.h2,{id:r.titleId,...n,ref:t})});P9.displayName=yd;var X9="DialogDescription",j9=p.forwardRef((e,t)=>{const{__scopeDialog:o,...n}=e,r=J2(X9,o);return z.jsx(H0.p,{id:r.descriptionId,...n,ref:t})});j9.displayName=X9;var D9="DialogClose",I9=p.forwardRef((e,t)=>{const{__scopeDialog:o,...n}=e,r=J2(D9,o);return z.jsx(H0.button,{type:"button",...n,ref:t,onClick:Do(e.onClick,()=>r.onOpenChange(!1))})});I9.displayName=D9;function wd(e){return e?"open":"closed"}var F9="DialogTitleWarning",[kc0,H9]=mh(F9,{contentName:jn,titleName:yd,docsSlug:"dialog"}),oY=({titleId:e})=>{const t=H9(F9),o=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
600
600
 
601
601
  If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
602
602
 
@@ -619,4 +619,4 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
619
619
  newResult[${C}] = ${L}.value;
620
620
  }
621
621
 
622
- `)}q.write("payload.value = newResult;"),q.write("return payload;");const x=q.compile();return(k,L)=>x(h,k,L)};let a;const i=Wp,b=!AW.jitless,u=b&&se0.value,f=t.catchall;let O;e._zod.parse=(h,q)=>{O??(O=n.value);const g=h.value;return i(g)?b&&u&&q?.async===!1&&q.jitless!==!0?(a||(a=r(t.shape)),h=a(h,q),f?kW([],g,h,q,O,e):h):o(h,q):(h.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),h)}});function tA(e,t,o,n){for(const a of e)if(a.issues.length===0)return t.value=a.value,t;const r=e.filter(a=>!xr(a));return r.length===1?(t.value=r[0].value,r[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:o,errors:e.map(a=>a.issues.map(i=>Go(i,n,Zo())))}),t)}const U20=n0("$ZodUnion",(e,t)=>{V1.init(e,t),m1(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),m1(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),m1(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),m1(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){const r=t.options.map(a=>a._zod.pattern);return new RegExp(`^(${r.map(a=>Yd(a.source)).join("|")})$`)}});const o=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(r,a)=>{if(o)return n(r,a);let i=!1;const b=[];for(const l of t.options){const u=l._zod.run({value:r.value,issues:[]},a);if(u instanceof Promise)b.push(u),i=!0;else{if(u.issues.length===0)return u;b.push(u)}}return i?Promise.all(b).then(l=>tA(l,r,e,a)):tA(b,r,e,a)}}),V20=n0("$ZodIntersection",(e,t)=>{V1.init(e,t),e._zod.parse=(o,n)=>{const r=o.value,a=t.left._zod.run({value:r,issues:[]},n),i=t.right._zod.run({value:r,issues:[]},n);return a instanceof Promise||i instanceof Promise?Promise.all([a,i]).then(([l,u])=>oA(o,l,u)):oA(o,a,i)}});function Lz(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Vr(e)&&Vr(t)){const o=Object.keys(t),n=Object.keys(e).filter(a=>o.indexOf(a)!==-1),r={...e,...t};for(const a of n){const i=Lz(e[a],t[a]);if(!i.valid)return{valid:!1,mergeErrorPath:[a,...i.mergeErrorPath]};r[a]=i.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const o=[];for(let n=0;n<e.length;n++){const r=e[n],a=t[n],i=Lz(r,a);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};o.push(i.data)}return{valid:!0,data:o}}return{valid:!1,mergeErrorPath:[]}}function oA(e,t,o){if(t.issues.length&&e.issues.push(...t.issues),o.issues.length&&e.issues.push(...o.issues),xr(e))return e;const n=Lz(t.value,o.value);if(!n.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return e.value=n.data,e}const $20=n0("$ZodRecord",(e,t)=>{V1.init(e,t),e._zod.parse=(o,n)=>{const r=o.value;if(!Vr(r))return o.issues.push({expected:"record",code:"invalid_type",input:r,inst:e}),o;const a=[];if(t.keyType._zod.values){const i=t.keyType._zod.values;o.value={};for(const l of i)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){const u=t.valueType._zod.run({value:r[l],issues:[]},n);u instanceof Promise?a.push(u.then(f=>{f.issues.length&&o.issues.push(...kr(l,f.issues)),o.value[l]=f.value})):(u.issues.length&&o.issues.push(...kr(l,u.issues)),o.value[l]=u.value)}let b;for(const l in r)i.has(l)||(b=b??[],b.push(l));b&&b.length>0&&o.issues.push({code:"unrecognized_keys",input:r,inst:e,keys:b})}else{o.value={};for(const i of Reflect.ownKeys(r)){if(i==="__proto__")continue;const b=t.keyType._zod.run({value:i,issues:[]},n);if(b instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(b.issues.length){o.issues.push({code:"invalid_key",origin:"record",issues:b.issues.map(u=>Go(u,n,Zo())),input:i,path:[i],inst:e}),o.value[b.value]=b.value;continue}const l=t.valueType._zod.run({value:r[i],issues:[]},n);l instanceof Promise?a.push(l.then(u=>{u.issues.length&&o.issues.push(...kr(i,u.issues)),o.value[b.value]=u.value})):(l.issues.length&&o.issues.push(...kr(i,l.issues)),o.value[b.value]=l.value)}}return a.length?Promise.all(a).then(()=>o):o}}),Q20=n0("$ZodEnum",(e,t)=>{V1.init(e,t);const o=ae0(t.entries),n=new Set(o);e._zod.values=n,e._zod.pattern=new RegExp(`^(${o.filter(r=>ie0.has(typeof r)).map(r=>typeof r=="string"?j3(r):r.toString()).join("|")})$`),e._zod.parse=(r,a)=>{const i=r.value;return n.has(i)||r.issues.push({code:"invalid_value",values:o,input:i,inst:e}),r}}),Z20=n0("$ZodTransform",(e,t)=>{V1.init(e,t),e._zod.parse=(o,n)=>{if(n.direction==="backward")throw new fW(e.constructor.name);const r=t.transform(o.value,o);if(n.async)return(r instanceof Promise?r:Promise.resolve(r)).then(i=>(o.value=i,o));if(r instanceof Promise)throw new jr;return o.value=r,o}});function nA(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const G20=n0("$ZodOptional",(e,t)=>{V1.init(e,t),e._zod.optin="optional",e._zod.optout="optional",m1(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),m1(e._zod,"pattern",()=>{const o=t.innerType._zod.pattern;return o?new RegExp(`^(${Yd(o.source)})?$`):void 0}),e._zod.parse=(o,n)=>{if(t.innerType._zod.optin==="optional"){const r=t.innerType._zod.run(o,n);return r instanceof Promise?r.then(a=>nA(a,o.value)):nA(r,o.value)}return o.value===void 0?o:t.innerType._zod.run(o,n)}}),K20=n0("$ZodNullable",(e,t)=>{V1.init(e,t),m1(e._zod,"optin",()=>t.innerType._zod.optin),m1(e._zod,"optout",()=>t.innerType._zod.optout),m1(e._zod,"pattern",()=>{const o=t.innerType._zod.pattern;return o?new RegExp(`^(${Yd(o.source)}|null)$`):void 0}),m1(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(o,n)=>o.value===null?o:t.innerType._zod.run(o,n)}),Y20=n0("$ZodDefault",(e,t)=>{V1.init(e,t),e._zod.optin="optional",m1(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,n)=>{if(n.direction==="backward")return t.innerType._zod.run(o,n);if(o.value===void 0)return o.value=t.defaultValue,o;const r=t.innerType._zod.run(o,n);return r instanceof Promise?r.then(a=>rA(a,t)):rA(r,t)}});function rA(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const J20=n0("$ZodPrefault",(e,t)=>{V1.init(e,t),e._zod.optin="optional",m1(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,n)=>(n.direction==="backward"||o.value===void 0&&(o.value=t.defaultValue),t.innerType._zod.run(o,n))}),et0=n0("$ZodNonOptional",(e,t)=>{V1.init(e,t),m1(e._zod,"values",()=>{const o=t.innerType._zod.values;return o?new Set([...o].filter(n=>n!==void 0)):void 0}),e._zod.parse=(o,n)=>{const r=t.innerType._zod.run(o,n);return r instanceof Promise?r.then(a=>cA(a,e)):cA(r,e)}});function cA(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const tt0=n0("$ZodCatch",(e,t)=>{V1.init(e,t),m1(e._zod,"optin",()=>t.innerType._zod.optin),m1(e._zod,"optout",()=>t.innerType._zod.optout),m1(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,n)=>{if(n.direction==="backward")return t.innerType._zod.run(o,n);const r=t.innerType._zod.run(o,n);return r instanceof Promise?r.then(a=>(o.value=a.value,a.issues.length&&(o.value=t.catchValue({...o,error:{issues:a.issues.map(i=>Go(i,n,Zo()))},input:o.value}),o.issues=[]),o)):(o.value=r.value,r.issues.length&&(o.value=t.catchValue({...o,error:{issues:r.issues.map(a=>Go(a,n,Zo()))},input:o.value}),o.issues=[]),o)}}),ot0=n0("$ZodPipe",(e,t)=>{V1.init(e,t),m1(e._zod,"values",()=>t.in._zod.values),m1(e._zod,"optin",()=>t.in._zod.optin),m1(e._zod,"optout",()=>t.out._zod.optout),m1(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(o,n)=>{if(n.direction==="backward"){const a=t.out._zod.run(o,n);return a instanceof Promise?a.then(i=>gi(i,t.in,n)):gi(a,t.in,n)}const r=t.in._zod.run(o,n);return r instanceof Promise?r.then(a=>gi(a,t.out,n)):gi(r,t.out,n)}});function gi(e,t,o){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},o)}const CW=n0("$ZodCodec",(e,t)=>{V1.init(e,t),m1(e._zod,"values",()=>t.in._zod.values),m1(e._zod,"optin",()=>t.in._zod.optin),m1(e._zod,"optout",()=>t.out._zod.optout),m1(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(o,n)=>{if((n.direction||"forward")==="forward"){const a=t.in._zod.run(o,n);return a instanceof Promise?a.then(i=>Wi(i,t,n)):Wi(a,t,n)}else{const a=t.out._zod.run(o,n);return a instanceof Promise?a.then(i=>Wi(i,t,n)):Wi(a,t,n)}}});function Wi(e,t,o){if(e.issues.length)return e.aborted=!0,e;if((o.direction||"forward")==="forward"){const r=t.transform(e.value,e);return r instanceof Promise?r.then(a=>vi(e,a,t.out,o)):vi(e,r,t.out,o)}else{const r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(a=>vi(e,a,t.in,o)):vi(e,r,t.in,o)}}function vi(e,t,o,n){return e.issues.length?(e.aborted=!0,e):o._zod.run({value:t,issues:e.issues},n)}const nt0=n0("$ZodReadonly",(e,t)=>{V1.init(e,t),m1(e._zod,"propValues",()=>t.innerType._zod.propValues),m1(e._zod,"values",()=>t.innerType._zod.values),m1(e._zod,"optin",()=>t.innerType._zod.optin),m1(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(o,n)=>{if(n.direction==="backward")return t.innerType._zod.run(o,n);const r=t.innerType._zod.run(o,n);return r instanceof Promise?r.then(aA):aA(r)}});function aA(e){return e.value=Object.freeze(e.value),e}const rt0=n0("$ZodCustom",(e,t)=>{B2.init(e,t),V1.init(e,t),e._zod.parse=(o,n)=>o,e._zod.check=o=>{const n=o.value,r=t.fn(n);if(r instanceof Promise)return r.then(a=>sA(a,o,n,e));sA(r,o,n,e)}});function sA(e,t,o,n){if(!e){const r={code:"custom",input:o,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(r.params=n._zod.def.params),t.issues.push(Aa(r))}}class ct0{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...o){const n=o[0];if(this._map.set(t,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,t)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const o=this._map.get(t);return o&&typeof o=="object"&&"id"in o&&this._idmap.delete(o.id),this._map.delete(t),this}get(t){const o=t._zod.parent;if(o){const n={...this.get(o)??{}};delete n.id;const r={...n,...this._map.get(t)};return Object.keys(r).length?r:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function at0(){return new ct0}const Ri=at0();function st0(e,t){return new e({type:"string",...D0(t)})}function it0(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...D0(t)})}function iA(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...D0(t)})}function pt0(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...D0(t)})}function Mt0(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...D0(t)})}function bt0(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...D0(t)})}function lt0(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...D0(t)})}function zt0(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...D0(t)})}function ut0(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...D0(t)})}function dt0(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...D0(t)})}function Ot0(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...D0(t)})}function ft0(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...D0(t)})}function At0(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...D0(t)})}function ht0(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...D0(t)})}function qt0(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...D0(t)})}function mt0(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...D0(t)})}function gt0(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...D0(t)})}function Wt0(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...D0(t)})}function vt0(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...D0(t)})}function Rt0(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...D0(t)})}function yt0(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...D0(t)})}function wt0(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...D0(t)})}function Lt0(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...D0(t)})}function xt0(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...D0(t)})}function kt0(e,t){return new e({type:"string",format:"date",check:"string_format",...D0(t)})}function Ct0(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...D0(t)})}function Nt0(e,t){return new e({type:"string",format:"duration",check:"string_format",...D0(t)})}function Bt0(e,t){return new e({type:"boolean",...D0(t)})}function _t0(e){return new e({type:"unknown"})}function Et0(e,t){return new e({type:"never",...D0(t)})}function St0(e,t){return new e({type:"date",...D0(t)})}function Tt0(e,t){return new e20({check:"less_than",...D0(t),value:e,inclusive:!0})}function Pt0(e,t){return new t20({check:"greater_than",...D0(t),value:e,inclusive:!0})}function NW(e,t){return new o20({check:"max_length",...D0(t),maximum:e})}function Rp(e,t){return new n20({check:"min_length",...D0(t),minimum:e})}function BW(e,t){return new r20({check:"length_equals",...D0(t),length:e})}function Xt0(e,t){return new c20({check:"string_format",format:"regex",...D0(t),pattern:e})}function jt0(e){return new a20({check:"string_format",format:"lowercase",...D0(e)})}function Dt0(e){return new s20({check:"string_format",format:"uppercase",...D0(e)})}function It0(e,t){return new i20({check:"string_format",format:"includes",...D0(t),includes:e})}function Ft0(e,t){return new p20({check:"string_format",format:"starts_with",...D0(t),prefix:e})}function Ht0(e,t){return new M20({check:"string_format",format:"ends_with",...D0(t),suffix:e})}function $a(e){return new b20({check:"overwrite",tx:e})}function Ut0(e){return $a(t=>t.normalize(e))}function Vt0(){return $a(e=>e.trim())}function $t0(){return $a(e=>e.toLowerCase())}function Qt0(){return $a(e=>e.toUpperCase())}function Zt0(e,t,o){return new e({type:"array",element:t,...D0(o)})}function Gt0(e,t,o){return new e({type:"custom",check:"custom",fn:t,...D0(o)})}function Kt0(e){const t=Yt0(o=>(o.addIssue=n=>{if(typeof n=="string")o.issues.push(Aa(n,o.value,t._zod.def));else{const r=n;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=o.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),o.issues.push(Aa(r))}},e(o.value,o)));return t}function Yt0(e,t){const o=new B2({check:"custom",...D0(t)});return o._zod.check=e,o}function Jt0(e,t){const o=D0(t);let n=o.truthy??["true","1","yes","on","y","enabled"],r=o.falsy??["false","0","no","off","n","disabled"];o.case!=="sensitive"&&(n=n.map(q=>typeof q=="string"?q.toLowerCase():q),r=r.map(q=>typeof q=="string"?q.toLowerCase():q));const a=new Set(n),i=new Set(r),b=e.Codec??CW,l=e.Boolean??LW,u=e.String??$3,f=new u({type:"string",error:o.error}),O=new l({type:"boolean",error:o.error}),h=new b({type:"pipe",in:f,out:O,transform:((q,g)=>{let W=q;return o.case!=="sensitive"&&(W=W.toLowerCase()),a.has(W)?!0:i.has(W)?!1:(g.issues.push({code:"invalid_value",expected:"stringbool",values:[...a,...i],input:g.value,inst:h,continue:!1}),{})}),reverseTransform:((q,g)=>q===!0?n[0]||"true":r[0]||"false"),error:o.error});return h}const eo0=n0("ZodISODateTime",(e,t)=>{R20.init(e,t),$1.init(e,t)});function _W(e){return xt0(eo0,e)}const to0=n0("ZodISODate",(e,t)=>{y20.init(e,t),$1.init(e,t)});function oo0(e){return kt0(to0,e)}const no0=n0("ZodISOTime",(e,t)=>{w20.init(e,t),$1.init(e,t)});function ro0(e){return Ct0(no0,e)}const co0=n0("ZodISODuration",(e,t)=>{L20.init(e,t),$1.init(e,t)});function ao0(e){return Nt0(co0,e)}const so0=(e,t)=>{gW.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:o=>Ae0(e,o)},flatten:{value:o=>fe0(e,o)},addIssue:{value:o=>{e.issues.push(o),e.message=JSON.stringify(e.issues,wz,2)}},addIssues:{value:o=>{e.issues.push(...o),e.message=JSON.stringify(e.issues,wz,2)}},isEmpty:{get(){return e.issues.length===0}}})},_2=n0("ZodError",so0,{Parent:Error}),io0=I3(_2),po0=F3(_2),Mo0=H3(_2),bo0=U3(_2),lo0=me0(_2),zo0=ge0(_2),uo0=We0(_2),do0=ve0(_2),Oo0=Re0(_2),fo0=ye0(_2),Ao0=we0(_2),ho0=Le0(_2),ce=n0("ZodType",(e,t)=>(V1.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...o)=>e.clone(Yn(t,{checks:[...t.checks??[],...o.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]})),e.clone=(o,n)=>on(e,o,n),e.brand=()=>e,e.register=((o,n)=>(o.add(e,n),e)),e.parse=(o,n)=>io0(e,o,n,{callee:e.parse}),e.safeParse=(o,n)=>Mo0(e,o,n),e.parseAsync=async(o,n)=>po0(e,o,n,{callee:e.parseAsync}),e.safeParseAsync=async(o,n)=>bo0(e,o,n),e.spa=e.safeParseAsync,e.encode=(o,n)=>lo0(e,o,n),e.decode=(o,n)=>zo0(e,o,n),e.encodeAsync=async(o,n)=>uo0(e,o,n),e.decodeAsync=async(o,n)=>do0(e,o,n),e.safeEncode=(o,n)=>Oo0(e,o,n),e.safeDecode=(o,n)=>fo0(e,o,n),e.safeEncodeAsync=async(o,n)=>Ao0(e,o,n),e.safeDecodeAsync=async(o,n)=>ho0(e,o,n),e.refine=(o,n)=>e.check(Mn0(o,n)),e.superRefine=o=>e.check(bn0(o)),e.overwrite=o=>e.check($a(o)),e.optional=()=>MA(e),e.nullable=()=>bA(e),e.nullish=()=>MA(bA(e)),e.nonoptional=o=>nn0(e,o),e.array=()=>e5(e),e.or=o=>Ho0([e,o]),e.and=o=>Vo0(e,o),e.transform=o=>lA(e,Ko0(o)),e.default=o=>en0(e,o),e.prefault=o=>on0(e,o),e.catch=o=>cn0(e,o),e.pipe=o=>lA(e,o),e.readonly=()=>in0(e),e.describe=o=>{const n=e.clone();return Ri.add(n,{description:o}),n},Object.defineProperty(e,"description",{get(){return Ri.get(e)?.description},configurable:!0}),e.meta=(...o)=>{if(o.length===0)return Ri.get(e);const n=e.clone();return Ri.add(n,o[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),EW=n0("_ZodString",(e,t)=>{$3.init(e,t),ce.init(e,t);const o=e._zod.bag;e.format=o.format??null,e.minLength=o.minimum??null,e.maxLength=o.maximum??null,e.regex=(...n)=>e.check(Xt0(...n)),e.includes=(...n)=>e.check(It0(...n)),e.startsWith=(...n)=>e.check(Ft0(...n)),e.endsWith=(...n)=>e.check(Ht0(...n)),e.min=(...n)=>e.check(Rp(...n)),e.max=(...n)=>e.check(NW(...n)),e.length=(...n)=>e.check(BW(...n)),e.nonempty=(...n)=>e.check(Rp(1,...n)),e.lowercase=n=>e.check(jt0(n)),e.uppercase=n=>e.check(Dt0(n)),e.trim=()=>e.check(Vt0()),e.normalize=(...n)=>e.check(Ut0(...n)),e.toLowerCase=()=>e.check($t0()),e.toUpperCase=()=>e.check(Qt0())}),SW=n0("ZodString",(e,t)=>{$3.init(e,t),EW.init(e,t),e.email=o=>e.check(it0(qo0,o)),e.url=o=>e.check(zt0(mo0,o)),e.jwt=o=>e.check(Lt0(So0,o)),e.emoji=o=>e.check(ut0(go0,o)),e.guid=o=>e.check(iA(pA,o)),e.uuid=o=>e.check(pt0(yi,o)),e.uuidv4=o=>e.check(Mt0(yi,o)),e.uuidv6=o=>e.check(bt0(yi,o)),e.uuidv7=o=>e.check(lt0(yi,o)),e.nanoid=o=>e.check(dt0(Wo0,o)),e.guid=o=>e.check(iA(pA,o)),e.cuid=o=>e.check(Ot0(vo0,o)),e.cuid2=o=>e.check(ft0(Ro0,o)),e.ulid=o=>e.check(At0(yo0,o)),e.base64=o=>e.check(Rt0(Bo0,o)),e.base64url=o=>e.check(yt0(_o0,o)),e.xid=o=>e.check(ht0(wo0,o)),e.ksuid=o=>e.check(qt0(Lo0,o)),e.ipv4=o=>e.check(mt0(xo0,o)),e.ipv6=o=>e.check(gt0(ko0,o)),e.cidrv4=o=>e.check(Wt0(Co0,o)),e.cidrv6=o=>e.check(vt0(No0,o)),e.e164=o=>e.check(wt0(Eo0,o)),e.datetime=o=>e.check(_W(o)),e.date=o=>e.check(oo0(o)),e.time=o=>e.check(ro0(o)),e.duration=o=>e.check(ao0(o))});function s2(e){return st0(SW,e)}const $1=n0("ZodStringFormat",(e,t)=>{I1.init(e,t),EW.init(e,t)}),qo0=n0("ZodEmail",(e,t)=>{O20.init(e,t),$1.init(e,t)}),pA=n0("ZodGUID",(e,t)=>{u20.init(e,t),$1.init(e,t)}),yi=n0("ZodUUID",(e,t)=>{d20.init(e,t),$1.init(e,t)}),mo0=n0("ZodURL",(e,t)=>{f20.init(e,t),$1.init(e,t)}),go0=n0("ZodEmoji",(e,t)=>{A20.init(e,t),$1.init(e,t)}),Wo0=n0("ZodNanoID",(e,t)=>{h20.init(e,t),$1.init(e,t)}),vo0=n0("ZodCUID",(e,t)=>{q20.init(e,t),$1.init(e,t)}),Ro0=n0("ZodCUID2",(e,t)=>{m20.init(e,t),$1.init(e,t)}),yo0=n0("ZodULID",(e,t)=>{g20.init(e,t),$1.init(e,t)}),wo0=n0("ZodXID",(e,t)=>{W20.init(e,t),$1.init(e,t)}),Lo0=n0("ZodKSUID",(e,t)=>{v20.init(e,t),$1.init(e,t)}),xo0=n0("ZodIPv4",(e,t)=>{x20.init(e,t),$1.init(e,t)}),ko0=n0("ZodIPv6",(e,t)=>{k20.init(e,t),$1.init(e,t)}),Co0=n0("ZodCIDRv4",(e,t)=>{C20.init(e,t),$1.init(e,t)}),No0=n0("ZodCIDRv6",(e,t)=>{N20.init(e,t),$1.init(e,t)}),Bo0=n0("ZodBase64",(e,t)=>{B20.init(e,t),$1.init(e,t)}),_o0=n0("ZodBase64URL",(e,t)=>{E20.init(e,t),$1.init(e,t)}),Eo0=n0("ZodE164",(e,t)=>{S20.init(e,t),$1.init(e,t)}),So0=n0("ZodJWT",(e,t)=>{P20.init(e,t),$1.init(e,t)}),TW=n0("ZodBoolean",(e,t)=>{LW.init(e,t),ce.init(e,t)});function xz(e){return Bt0(TW,e)}const To0=n0("ZodUnknown",(e,t)=>{X20.init(e,t),ce.init(e,t)});function kz(){return _t0(To0)}const Po0=n0("ZodNever",(e,t)=>{j20.init(e,t),ce.init(e,t)});function Xo0(e){return Et0(Po0,e)}const jo0=n0("ZodDate",(e,t)=>{D20.init(e,t),ce.init(e,t),e.min=(n,r)=>e.check(Pt0(n,r)),e.max=(n,r)=>e.check(Tt0(n,r));const o=e._zod.bag;e.minDate=o.minimum?new Date(o.minimum):null,e.maxDate=o.maximum?new Date(o.maximum):null});function Do0(e){return St0(jo0,e)}const Io0=n0("ZodArray",(e,t)=>{I20.init(e,t),ce.init(e,t),e.element=t.element,e.min=(o,n)=>e.check(Rp(o,n)),e.nonempty=o=>e.check(Rp(1,o)),e.max=(o,n)=>e.check(NW(o,n)),e.length=(o,n)=>e.check(BW(o,n)),e.unwrap=()=>e.element});function e5(e,t){return Zt0(Io0,e,t)}const PW=n0("ZodObject",(e,t)=>{H20.init(e,t),ce.init(e,t),m1(e,"shape",()=>t.shape),e.keyof=()=>Zo0(Object.keys(e._zod.def.shape)),e.catchall=o=>e.clone({...e._zod.def,catchall:o}),e.passthrough=()=>e.clone({...e._zod.def,catchall:kz()}),e.loose=()=>e.clone({...e._zod.def,catchall:kz()}),e.strict=()=>e.clone({...e._zod.def,catchall:Xo0()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=o=>le0(e,o),e.safeExtend=o=>ze0(e,o),e.merge=o=>ue0(e,o),e.pick=o=>Me0(e,o),e.omit=o=>be0(e,o),e.partial=(...o)=>de0(XW,e,o[0]),e.required=(...o)=>Oe0(jW,e,o[0])});function yp(e,t){const o={type:"object",shape:e??{},...D0(t)};return new PW(o)}function Q3(e,t){return new PW({type:"object",shape:e,catchall:kz(),...D0(t)})}const Fo0=n0("ZodUnion",(e,t)=>{U20.init(e,t),ce.init(e,t),e.options=t.options});function Ho0(e,t){return new Fo0({type:"union",options:e,...D0(t)})}const Uo0=n0("ZodIntersection",(e,t)=>{V20.init(e,t),ce.init(e,t)});function Vo0(e,t){return new Uo0({type:"intersection",left:e,right:t})}const $o0=n0("ZodRecord",(e,t)=>{$20.init(e,t),ce.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function Qo0(e,t,o){return new $o0({type:"record",keyType:e,valueType:t,...D0(o)})}const Cz=n0("ZodEnum",(e,t)=>{Q20.init(e,t),ce.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const o=new Set(Object.keys(t.entries));e.extract=(n,r)=>{const a={};for(const i of n)if(o.has(i))a[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new Cz({...t,checks:[],...D0(r),entries:a})},e.exclude=(n,r)=>{const a={...t.entries};for(const i of n)if(o.has(i))delete a[i];else throw new Error(`Key ${i} not found in enum`);return new Cz({...t,checks:[],...D0(r),entries:a})}});function Zo0(e,t){const o=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Cz({type:"enum",entries:o,...D0(t)})}const Go0=n0("ZodTransform",(e,t)=>{Z20.init(e,t),ce.init(e,t),e._zod.parse=(o,n)=>{if(n.direction==="backward")throw new fW(e.constructor.name);o.addIssue=a=>{if(typeof a=="string")o.issues.push(Aa(a,o.value,t));else{const i=a;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=o.value),i.inst??(i.inst=e),o.issues.push(Aa(i))}};const r=t.transform(o.value,o);return r instanceof Promise?r.then(a=>(o.value=a,o)):(o.value=r,o)}});function Ko0(e){return new Go0({type:"transform",transform:e})}const XW=n0("ZodOptional",(e,t)=>{G20.init(e,t),ce.init(e,t),e.unwrap=()=>e._zod.def.innerType});function MA(e){return new XW({type:"optional",innerType:e})}const Yo0=n0("ZodNullable",(e,t)=>{K20.init(e,t),ce.init(e,t),e.unwrap=()=>e._zod.def.innerType});function bA(e){return new Yo0({type:"nullable",innerType:e})}const Jo0=n0("ZodDefault",(e,t)=>{Y20.init(e,t),ce.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function en0(e,t){return new Jo0({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():qW(t)}})}const tn0=n0("ZodPrefault",(e,t)=>{J20.init(e,t),ce.init(e,t),e.unwrap=()=>e._zod.def.innerType});function on0(e,t){return new tn0({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():qW(t)}})}const jW=n0("ZodNonOptional",(e,t)=>{et0.init(e,t),ce.init(e,t),e.unwrap=()=>e._zod.def.innerType});function nn0(e,t){return new jW({type:"nonoptional",innerType:e,...D0(t)})}const rn0=n0("ZodCatch",(e,t)=>{tt0.init(e,t),ce.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function cn0(e,t){return new rn0({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const DW=n0("ZodPipe",(e,t)=>{ot0.init(e,t),ce.init(e,t),e.in=t.in,e.out=t.out});function lA(e,t){return new DW({type:"pipe",in:e,out:t})}const IW=n0("ZodCodec",(e,t)=>{DW.init(e,t),CW.init(e,t)});function an0(e,t,o){return new IW({type:"pipe",in:e,out:t,transform:o.decode,reverseTransform:o.encode})}const sn0=n0("ZodReadonly",(e,t)=>{nt0.init(e,t),ce.init(e,t),e.unwrap=()=>e._zod.def.innerType});function in0(e){return new sn0({type:"readonly",innerType:e})}const pn0=n0("ZodCustom",(e,t)=>{rt0.init(e,t),ce.init(e,t)});function Mn0(e,t={}){return Gt0(pn0,e,t)}function bn0(e){return Kt0(e)}const ln0=(...e)=>Jt0({Codec:IW,Boolean:TW,String:SW},...e),FW=an0(_W({offset:!0}),Do0(),{decode:e=>new Date(e),encode:e=>e.toISOString()}),zn0=Q3({slug:s2(),title:s2(),custom_excerpt:s2(),url:s2().url(),published_at:FW,featured:ln0(),feature_image:s2().url().optional(),html:s2().optional()}).transform(e=>({slug:e.slug,title:e.title,customExcerpt:e.custom_excerpt,url:e.url,publishedAt:e.published_at,featured:e.featured,featureImage:e.feature_image,html:e.html})),un0=yp({posts:e5(zn0).default([]),changelogUrl:s2().url().default("https://ghost.org/changelog")}).transform(e=>({entries:e.posts,changelogUrl:e.changelogUrl})),Z3=()=>x2({queryKey:["changelog"],queryFn:async()=>{const e=await fetch("https://ghost.org/changelog.json");if(!e.ok)throw new Error(`Failed to fetch changelog: ${e.status}`);const t=await e.json();return un0.parse(t)},staleTime:1/0});function zA(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function HW(e,t){const o={...e};for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)){const r=t[n],a=e[n];r!==void 0&&(zA(r)&&zA(a)?o[n]=HW(a,r):o[n]=r)}return o}const dn0=Q3({lastSeenDate:FW.optional().catch(void 0)}),uA={expanded:{posts:!0},menu:{visible:!0}},On0=Q3({expanded:yp({posts:xz()}),menu:yp({visible:xz()})}),Nz=Q3({whatsNew:dn0.optional().catch(void 0),nightShift:xz().optional(),navigation:On0.default(uA).catch(uA)}),UW=e=>["userPreferences",e?.id,e?.accessibility];function G3(e){const{data:t}=ye();return x2({...e,queryKey:UW(t),queryFn:()=>{if(!t)throw new Error("User not loaded");const o=t.accessibility||"{}",n=JSON.parse(o);return Nz.parse(n)},enabled:!!t,staleTime:1/0,cacheTime:0})}const K3=()=>{const e=f1(),{data:t}=ye(),{mutateAsync:o}=dW();return Y1({mutationFn:async n=>{if(!t)throw new Error("User is not loaded");const r=e.getQueryData(UW(t))??Nz.parse({}),a=HW(r,n),i=Nz.encode(a);await o({...t,accessibility:JSON.stringify(i)})}})};function fn0(){return{lastSeenDate:new Date}}const An0=(e,t)=>["whatsNew",e?.whatsNew?.lastSeenDate?.toISOString(),t?.publishedAt.toISOString()],VW=()=>{const{data:e,isSuccess:t}=G3(),{data:o,isSuccess:n}=Z3(),{mutateAsync:r}=K3(),a=!!e?.whatsNew?.lastSeenDate;p.useEffect(()=>{!a&&t&&r({whatsNew:fn0()})},[a,t,r]);const i=o?.entries[0];return x2({queryKey:An0(e,i),queryFn:()=>{if(!i)return{hasNew:!1,hasNewFeatured:!1};const b=e.whatsNew.lastSeenDate,l=i.publishedAt>b,u=l&&i.featured===!0;return{hasNew:l,hasNewFeatured:u}},enabled:n&&a,staleTime:1/0,cacheTime:0})},$W=()=>{const{data:e}=Z3(),{mutateAsync:t}=K3();return Y1({mutationFn:async()=>{const o=e?.entries[0];if(!o)return;const n={lastSeenDate:o.publishedAt};await t({whatsNew:n})}})};function hn0(e){return e.toLocaleDateString("en-GB",{day:"2-digit",month:"long",year:"numeric"})}function qn0({entry:e}){return z.jsxs("a",{className:"flex items-start gap-6 p-2 -mx-2 rounded-md hover:bg-muted/80 transition-colors","data-test-entry":!0,href:e.url,rel:"noopener noreferrer",target:"_blank",children:[e.featureImage&&z.jsx("img",{alt:e.title,className:"flex-shrink-0 w-40 h-[110px] object-cover rounded","data-test-entry-image":!0,src:e.featureImage}),z.jsxs("div",{className:"flex flex-col gap-2 min-w-0 flex-1",children:[z.jsx("h2",{className:"text-[17px] font-semibold text-foreground mt-1.5","data-test-entry-title":!0,children:e.title}),z.jsx("p",{className:"text-sm text-gray-700 leading-[1.45] line-clamp-2","data-test-entry-excerpt":!0,children:e.customExcerpt}),z.jsx("span",{className:"text-sm text-gray-600","data-test-entry-date":!0,children:hn0(e.publishedAt)})]})]})}function mn0({open:e,onOpenChange:t}){const{data:o}=Z3(),{mutate:n}=$W();return p.useEffect(()=>{e&&n()},[e,n]),z.jsx(W3,{open:e,onOpenChange:t,children:z.jsxs(Xa,{className:"max-w-2xl max-h-[85vh] flex flex-col","data-test-modal":"whats-new",role:"dialog","aria-modal":"true","aria-labelledby":"whats-new-modal-title",children:[z.jsx(Ld,{children:z.jsx(kd,{id:"whats-new-modal-title","data-test-modal-title":!0,className:"text-2xl tracking-tighter",children:"What’s new?"})}),o?z.jsxs(z.Fragment,{children:[z.jsx("section",{className:"flex-1 overflow-y-auto space-y-2 -mx-6 px-6","data-test-entries":!0,children:o.entries.map(r=>z.jsx(qn0,{entry:r},r.slug))}),z.jsxs(xd,{className:"flex-row justify-between sm:justify-between gap-3",children:[z.jsx(o1,{asChild:!0,variant:"outline",children:z.jsx("a",{href:`${o.changelogUrl}#/portal/signup`,rel:"noopener noreferrer",target:"_blank",children:"Turn on notifications"})}),z.jsx(o1,{asChild:!0,children:z.jsx("a",{href:o.changelogUrl,rel:"noopener noreferrer",target:"_blank",children:"All updates →"})})]})]}):z.jsx("div",{className:"flex-1 flex items-center justify-center py-12",children:z.jsx(mp,{size:"lg"})})]})})}function QW(){const e=lW(),t=!!e?.subscription?.isActiveTrial,o=e?.subscription?.trial_end?Math.ceil((new Date(e.subscription.trial_end).getTime()-Date.now())/(1e3*60*60*24)):0;return{showUpgradeBanner:t,trialDaysRemaining:o}}function gn0({children:e,...t}){return z.jsx("span",{className:"flex-1",...t,children:e})}const Ie=({children:e,...t})=>z.jsx(Qm,{className:"cursor-pointer text-base",asChild:!0,...t,children:e});Ie.Label=gn0;function wp(e){const t=ye();return z.jsxs(md,{...e,children:[t.data?.profile_image&&z.jsx(gd,{src:t.data?.profile_image}),z.jsx(Wd,{className:"text-foreground-muted hover:text-foreground",children:z.jsx(hd,{})})]})}function ZW({name:e,email:t,children:o}){return z.jsx("div",{className:"p-3",children:z.jsxs("div",{className:"flex items-center gap-3",children:[o,z.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[z.jsx("span",{className:"text-base font-semibold text-foreground truncate",children:e}),z.jsx("span",{className:"text-xs text-foreground-muted -mt-px truncate",children:t})]})]})})}function GW(){const e=ye();return z.jsx(Ie,{children:z.jsxs(Ea,{to:`/settings/staff/${e.data?.slug}`,children:[z.jsx(hd,{}),z.jsx(Ie.Label,{children:"Your profile"})]})})}function KW(){const{data:e}=G3(),{mutateAsync:t,isLoading:o}=K3(),n=r=>{t({nightShift:r})};return z.jsxs(Ie,{asChild:!1,onSelect:r=>{r.preventDefault(),n(!e?.nightShift)},children:[z.jsx(aG,{}),z.jsx(Ie.Label,{className:"flex-1",children:"Dark mode"}),z.jsx(ng,{size:"sm",checked:e?.nightShift??!1,disabled:o,onCheckedChange:n,onClick:r=>r.stopPropagation(),tabIndex:-1})]})}function YW(){const e=()=>{fetch("/ghost/api/admin/session",{method:"DELETE"}).then(()=>{window.location.href="/ghost"}).catch(t=>{console.error(t)})};return z.jsxs(Ie,{asChild:!1,onSelect:e,children:[z.jsx(KZ,{}),z.jsx(Ie.Label,{children:"Sign out"})]})}function Wn0(e){const t=ye(),{data:o}=VW(),{showUpgradeBanner:n}=QW();return z.jsxs(Vm,{...e,children:[z.jsx($m,{asChild:!0,className:"focus-visible:ring-0",children:z.jsxs(E3,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground","aria-label":"User menu",children:[z.jsxs("div",{className:"relative",children:[z.jsx(wp,{}),o?.hasNew&&z.jsx("span",{className:"absolute -top-0.5 -right-0.5",children:z.jsx(Qf,{variant:"success",size:"sm",label:"New updates available","data-test-whats-new-avatar-badge":!0})})]}),z.jsxs("div",{className:"grid flex-1 text-left text-base leading-tight",children:[z.jsx("span",{className:"truncate font-semibold",children:t.data?.name}),z.jsx("span",{className:"text-muted-foreground truncate text-xs -mt-px",children:t.data?.email})]}),z.jsx(vZ,{className:"ml-auto size-4 text-grey-700","data-test-nav":"arrow-down"})]})}),z.jsxs(Pd,{align:"start",sideOffset:10,className:`w-[var(--radix-dropdown-menu-trigger-width)] ${n?"shadow-[0_18px_80px_0_rgba(0,0,0,0.07),0_7.52px_33.422px_0_rgba(0,0,0,0.05),0_4.021px_17.869px_0_rgba(0,0,0,0.04),0_2.254px_10.017px_0_rgba(0,0,0,0.04),0_1.197px_5.32px_0_rgba(0,0,0,0.03),0_0.498px_2.214px_0_rgba(0,0,0,0.02)]":""}`,children:[z.jsx(ZW,{name:t.data?.name,email:t.data?.email,children:z.jsx(wp,{})}),z.jsx(_n,{}),z.jsxs(Ie,{"data-test-nav":"whatsnew",asChild:!1,onSelect:()=>{queueMicrotask(()=>e.onOpenWhatsNew?.())},children:[z.jsx(u9,{}),z.jsx(Ie.Label,{children:"What’s new?"}),o?.hasNew&&z.jsx("div",{className:"flex-1 flex justify-end",children:z.jsx(Qf,{variant:"success",size:"sm",label:"New updates available","data-test-whats-new-menu-badge":!0})})]}),z.jsx(GW,{}),z.jsx(_n,{}),z.jsx(Ie,{children:z.jsxs("a",{href:"https://ghost.org/resources?utm_source=admin&utm_campaign=resources",target:"_blank",rel:"noopener noreferrer",children:[z.jsx(OZ,{}),z.jsx(Ie.Label,{children:"Resources & guides"})]})}),z.jsx(KW,{}),z.jsx(_n,{}),z.jsx(YW,{})]})]})}function vn0(){const e=ye(),o=X3().data?.site.url??"";return z.jsxs(Vm,{children:[z.jsx($m,{asChild:!0,children:z.jsx("button",{className:"rounded-full shadow-lg hover:shadow-xl transition-shadow focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 p-0.5 flex items-center justify-center border border-border dark:bg-muted bg-background","aria-label":"Open user menu",children:z.jsx(wp,{className:"w-11 h-11"})})}),z.jsxs(Pd,{align:"start",side:"top",sideOffset:10,className:"w-[var(--radix-dropdown-menu-trigger-width)] mb-2",children:[z.jsx(ZW,{name:e.data?.name,email:e.data?.email,children:z.jsx(wp,{})}),z.jsx(_n,{}),z.jsx(Ie,{children:z.jsxs(Ea,{to:"/",children:[z.jsx(PZ,{}),z.jsx(Ie.Label,{children:"Posts"})]})}),z.jsx(Ie,{children:z.jsxs("a",{href:o,target:"_blank",rel:"noopener noreferrer",children:[z.jsx(dd,{}),z.jsx(Ie.Label,{children:"View site"})]})}),z.jsx(_n,{}),z.jsx(GW,{}),z.jsx(KW,{}),z.jsx(_n,{}),z.jsx(YW,{})]})]})}function Rn0({...e}){const[t,o]=p.useState(!1);return z.jsxs(z.Fragment,{children:[z.jsx(nW,{...e,children:z.jsx(nc,{children:z.jsx(rc,{children:z.jsx(Qd,{children:z.jsx(Wn0,{onOpenWhatsNew:()=>o(!0)})})})})}),z.jsx(mn0,{open:t,onOpenChange:o})]})}function yn0(){const{data:e}=VW(),{data:t}=Z3(),{mutate:o}=$W(),[n,r]=p.useState(!1);if(n||!e?.hasNewFeatured)return null;const a=t?.entries[0];if(!a)return null;const i=()=>{r(!0),o()},b=()=>{o()};return z.jsx(vd,{"data-test-toast":"whats-new",role:"status","aria-label":"What’s new notification","aria-live":"polite",variant:"gradient",dismissible:!0,onDismiss:i,children:z.jsxs("a",{href:a.url,target:"_blank",rel:"noopener noreferrer",className:"block pr-8",onClick:b,"data-test-toast-link":!0,children:[z.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[z.jsx(u9,{className:"size-4 text-purple-600"}),z.jsx("span",{className:"text-xs font-semibold text-gray-700 uppercase tracking-wide",children:"What’s new?"})]}),z.jsx("div",{className:"text-base font-semibold text-gray-900 mb-1","data-test-toast-title":!0,children:a.title}),z.jsx("div",{className:"text-sm text-gray-700","data-test-toast-excerpt":!0,children:a.customExcerpt})]})})}const Lp="SettingsResponseType",Y3=Hn({dataType:Lp,path:"/settings/",defaultSearchParams:{group:"site,theme,private,members,portal,newsletter,email,labs,slack,unsplash,views,firstpromoter,editor,comments,analytics,announcement,pintura,donations,security,social_web,explore,transistor"}}),$c0=Zt({method:"PUT",path:()=>"/settings/",body:e=>({settings:e.map(({key:t,value:o})=>({key:t,value:o}))}),updateQueries:{dataType:Lp,emberUpdateType:"createOrUpdate",update:e=>({...e,settings:e.settings})},invalidateQueries:{filters:{predicate(e){return e.queryKey[0]!==Lp}}}}),Qc0=Zt({method:"DELETE",path:()=>"/settings/stripe/connect/",invalidateQueries:{dataType:Lp}}),Zc0=Zt({method:"POST",path:()=>"/slack/test/"});function Gc0(e){const t=["API","CTA","RSS"];return e.replace(/^[a-z]/,o=>o.toUpperCase()).replace(/_/g," ").replace(new RegExp(`\\b(${t.join("|")})\\b`,"ig"),o=>o.toUpperCase())}function Kc0(e,t){return t.map(o=>{var n;return(n=e?.find(r=>r.key===o))==null?void 0:n.value})}function Tt(e,t){if(!e)return null;const o=e.find(n=>n.key===t);return o?.value||null}function Yc0(e,t){if(!e)return;const o=e.find(n=>n.key===t);return o?.is_read_only||!1}function Jc0(e,t){const o=a=>e.some(i=>i.key===a&&i.value),n=o("stripe_secret_key")&&o("stripe_publishable_key"),r=o("stripe_connect_secret_key")&&o("stripe_connect_publishable_key");return t.stripeDirect?n:r||n}const t5=[],JW=p.createContext(void 0),wn0=({children:e})=>{const t=we(),[o,n]=p.useState(()=>{const i=localStorage.getItem("featureFlags");return i?JSON.parse(i):Ln0()});p.useEffect(()=>{const i=xn0(t.search);Object.keys(i).length>0&&n(b=>{const l={...b,...i};return localStorage.setItem("featureFlags",JSON.stringify(l)),l})},[t.search]);const a={isEnabled:i=>o[i]??!1,flags:o,allFlags:t5};return z.jsx(JW.Provider,{value:a,children:e})},Ln0=()=>t5.reduce((e,t)=>({...e,[t]:!1}),{}),xn0=e=>{const t=new URLSearchParams(e),o={};return t5.forEach(n=>{const r=t.get(n);r==="ON"?o[n]=!0:r==="OFF"&&(o[n]=!1)}),o},kn0=()=>{const e=p.useContext(JW);if(e===void 0)throw new Error("useFeatureFlags must be used within a FeatureFlagsProvider");return e};function J3(){const t=Hu().find(o=>o.handle==="activitypub-basepath")?.pathname??"";return t.endsWith("/")?t.slice(0,-1):t}function eo(){const e=sW(),t=J3();return p.useCallback((o,n)=>{if(typeof o=="number"){e(o,n);return}o.startsWith("/")?e(`${t}${o}`,n):e(o,n)},[e,t])}const ev=({className:e,onClick:t})=>{const o=eo(),{previousPath:n}=t3();return z.jsx(o1,{className:g0("size-9 rounded-full bg-white/85 px-2 backdrop-blur-md dark:bg-black/85 dark:text-white [&_svg]:size-6 focus-visible:ring-0",e),variant:"ghost",onClick:()=>{if(t){t();return}o(n?-1:"/")},children:z.jsx(iZ,{size:24,strokeWidth:1.25})})},Cn0=()=>{const e=we(),t=Pt(lv,e.pathname);if(!t)return null;const o=t.map(n=>n.route).filter(n=>n.pageTitle);return o[o.length-1]||t[t.length-1].route};function tv(){const e=Hu(),t=e.findIndex(l=>l.handle==="activitypub-basepath");if(t===-1)return"";const o=e[t+1];if(!o)return"";const r=e[t].pathname,a=o.pathname;let i=a.startsWith(r)?a.slice(r.length):a;return i=i.replace(/^\//,""),i.split("/")[0]}const Nn0=({title:e,backIcon:t})=>t?z.jsx(ev,{className:"-ml-2"}):z.jsx(cW,{className:"max-md:text-[2.4rem]",children:e}),dA=({onToggleMobileSidebar:e})=>z.jsx(o1,{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:z.jsx(JZ,{className:"!size-5"})}),Bn0=({onToggleMobileSidebar:e,showBorder:t=!0})=>{const{canGoBack:o}=t3(),n=tv(),r=C10(),a=Cn0();let i=!1;n==="profile"&&(i=!0),n==="notes"&&o&&(i=!0);const b=o&&r||a?.showBackButton===!0;return z.jsx(z.Fragment,{children:i?z.jsxs("div",{className:"sticky left-0 top-8 z-50 inline-block max-lg:flex max-lg:items-center max-lg:justify-between max-lg:pr-[15.5px] max-md:top-4",children:[z.jsx("div",{children:b&&z.jsx(ev,{className:"ml-6 max-md:ml-[10px]"})}),!b&&z.jsx(dA,{onToggleMobileSidebar:e})]}):z.jsx("div",{className:"sticky top-0 z-50 bg-white/85 backdrop-blur-md dark:bg-black",children:z.jsxs("div",{className:`relative flex h-[102px] items-center justify-between gap-5 px-[min(4vw,32px)] max-md:h-[68px] ${t?'before:absolute before:inset-x-[min(4vw,32px)] before:bottom-0 before:block before:border-b before:border-gray-200 before:content-[""] before:dark:border-gray-950':""}`,children:[z.jsx(Nn0,{backIcon:b,title:a?.pageTitle||""}),z.jsx(dA,{onToggleMobileSidebar:e})]})})})};function Xo(e){if(!e.preferredUsername||!e.id)return"@unknown@unknown";try{return`@${e.preferredUsername}@${new URL(e.id).hostname.replace(/^www\./,"")}`}catch{return"@unknown@unknown"}}var Bz=(e=>(e[e.Note=0]="Note",e[e.Article=1]="Article",e[e.Tombstone=2]="Tombstone",e))(Bz||{});const _n0=e=>typeof e=="object"&&e!==null&&"statusCode"in e&&"message"in e&&typeof e.statusCode=="number"&&typeof e.message=="string";class En0{constructor(t,o,n,r=window.fetch.bind(window)){this.apiUrl=t,this.authApiUrl=o,this.handle=n,this.fetch=r}async getToken(){try{return(await(await this.fetch(this.authApiUrl)).json())?.identities?.[0]?.token||null}catch{return null}}async fetchJSON(t,o="GET",n){const r=await this.getToken(),a={method:o,headers:{Authorization:`Bearer ${r}`,Accept:"application/activity+json"}};n&&(a.body=JSON.stringify(n),a.headers["Content-Type"]="application/json");const i=await this.fetch(t,a);if(i.status===204||i.status===202)return null;if(!i.ok){const b={message:"Something went wrong, please try again.",statusCode:i.status};try{const l=await i.json(),u=l.message||l.error;u&&(b.message=u),l.code&&(b.code=l.code)}catch{}throw b}return await i.json()}async blockDomain(t){const o=new URL(`.ghost/activitypub/v1/actions/block/domain/${encodeURIComponent(t.href)}`,this.apiUrl);return await this.fetchJSON(o,"POST"),!0}async unblockDomain(t){const o=new URL(`.ghost/activitypub/v1/actions/unblock/domain/${encodeURIComponent(t.href)}`,this.apiUrl);return await this.fetchJSON(o,"POST"),!0}async block(t){const o=new URL(`.ghost/activitypub/v1/actions/block/${encodeURIComponent(t.href)}`,this.apiUrl);return await this.fetchJSON(o,"POST"),!0}async unblock(t){const o=new URL(`.ghost/activitypub/v1/actions/unblock/${encodeURIComponent(t.href)}`,this.apiUrl);return await this.fetchJSON(o,"POST"),!0}async follow(t){const o=new URL(`.ghost/activitypub/v1/actions/follow/${t}`,this.apiUrl);return await this.fetchJSON(o,"POST")}async unfollow(t){const o=new URL(`.ghost/activitypub/v1/actions/unfollow/${t}`,this.apiUrl);return await this.fetchJSON(o,"POST")}async like(t){const o=new URL(`.ghost/activitypub/v1/actions/like/${encodeURIComponent(t)}`,this.apiUrl);await this.fetchJSON(o,"POST")}async unlike(t){const o=new URL(`.ghost/activitypub/v1/actions/unlike/${encodeURIComponent(t)}`,this.apiUrl);await this.fetchJSON(o,"POST")}async repost(t){const o=new URL(`.ghost/activitypub/v1/actions/repost/${encodeURIComponent(t)}`,this.apiUrl);await this.fetchJSON(o,"POST")}async derepost(t){const o=new URL(`.ghost/activitypub/v1/actions/derepost/${encodeURIComponent(t)}`,this.apiUrl);await this.fetchJSON(o,"POST")}async reply(t,o,n){const r=new URL(`.ghost/activitypub/v1/actions/reply/${encodeURIComponent(t)}`,this.apiUrl),a={content:o};return n&&(a.image=n),await this.fetchJSON(r,"POST",a)}async note(t,o){const n=new URL(".ghost/activitypub/v1/actions/note",this.apiUrl),r={content:t};return o&&(r.image=o),(await this.fetchJSON(n,"POST",r)).post}async delete(t){const o=new URL(`.ghost/activitypub/v1/post/${encodeURIComponent(t)}`,this.apiUrl);await this.fetchJSON(o,"DELETE")}get userApiUrl(){return new URL(`.ghost/activitypub/users/${this.handle}`,this.apiUrl)}async getUser(){return await this.fetchJSON(this.userApiUrl)}get searchApiUrl(){return new URL(".ghost/activitypub/v1/actions/search",this.apiUrl)}async search(t){const o=this.searchApiUrl;o.searchParams.set("query",t);const n=await this.fetchJSON(o,"GET");return n&&"accounts"in n?n:{accounts:[]}}async getThread(t){const o=new URL(`.ghost/activitypub/v1/thread/${encodeURIComponent(t)}`,this.apiUrl);return await this.fetchJSON(o)}async getAccount(t){const o=new URL(`.ghost/activitypub/v1/account/${t}`,this.apiUrl);return await this.fetchJSON(o)}async getAccountFollows(t,o,n){const r=new URL(`.ghost/activitypub/v1/account/${t}/follows/${o}`,this.apiUrl);n&&r.searchParams.set("next",n);const a=await this.fetchJSON(r);if(a===null)return{accounts:[],next:null};if(!("accounts"in a))return{accounts:[],next:null};const i=Array.isArray(a.accounts)?a.accounts:[],b="next"in a&&typeof a.next=="string"?a.next:null;return{accounts:i,next:b}}async getFeed(t){return this.getPaginatedPosts(".ghost/activitypub/v1/feed/notes",t)}async getInbox(t){return this.getPaginatedPosts(".ghost/activitypub/v1/feed/reader",t)}async getDiscoveryFeed(t,o){const n=`.ghost/activitypub/v1/feed/discover/${t}`;return this.getPaginatedPosts(n,o)}async getExploreAccounts(t,o){const n=`.ghost/activitypub/v1/explore/${t}`;return this.getPaginatedExploreAccounts(n,o)}async getTopics(){const t=new URL(".ghost/activitypub/v1/topics",this.apiUrl),o=await this.fetchJSON(t);return{topics:o&&"topics"in o&&Array.isArray(o.topics)?o.topics:[]}}async getRecommendations(t){const o=new URL(".ghost/activitypub/v1/recommendations",this.apiUrl);t&&o.searchParams.set("limit",t.toString());const n=await this.fetchJSON(o);return{accounts:n&&"accounts"in n&&Array.isArray(n.accounts)?n.accounts:[]}}async getPostsByAccount(t,o){return this.getPaginatedPosts(`.ghost/activitypub/v1/posts/${t}`,o)}async getPostsLikedByAccount(t){return this.getPaginatedPosts(".ghost/activitypub/v1/posts/me/liked",t)}async getPaginatedPosts(t,o){const n=new URL(t,this.apiUrl);o&&n.searchParams.set("next",o);const r=await this.fetchJSON(n);if(r===null||!("posts"in r))return{posts:[],next:null};const a=Array.isArray(r.posts)?r.posts:[],i="next"in r&&typeof r.next=="string"?r.next:null;return{posts:a,next:i}}async getNotifications(t){const o=new URL(".ghost/activitypub/v1/notifications",this.apiUrl);t&&o.searchParams.set("next",t);const n=await this.fetchJSON(o);if(n===null)return{notifications:[],next:null};if(!("notifications"in n))return{notifications:[],next:null};const r=Array.isArray(n.notifications)?n.notifications:[],a="next"in n&&typeof n.next=="string"?n.next:null;return{notifications:r,next:a}}async getNotificationsCount(){const t=new URL(".ghost/activitypub/v1/notifications/unread/count",this.apiUrl),o=await this.fetchJSON(t);return o===null?{count:0}:{count:typeof o.count=="number"?o.count:0}}async resetNotificationsCount(){const t=new URL(".ghost/activitypub/v1/notifications/unread/reset",this.apiUrl);return await this.fetchJSON(t,"PUT"),!0}async getBlockedAccounts(t){const o=new URL(".ghost/activitypub/v1/blocks/accounts",this.apiUrl);t&&o.searchParams.set("next",t);const n=await this.fetchJSON(o);if(n===null)return{accounts:[],next:null};const r="blocked_accounts"in n&&Array.isArray(n.blocked_accounts)?n.blocked_accounts:[],a="next"in n&&typeof n.next=="string"?n.next:null;return{accounts:r,next:a}}async getBlockedDomains(t){const o=new URL(".ghost/activitypub/v1/blocks/domains",this.apiUrl);t&&o.searchParams.set("next",t);const n=await this.fetchJSON(o);if(n===null)return{domains:[],next:null};const r="blocked_domains"in n&&Array.isArray(n.blocked_domains)?n.blocked_domains:[],a="next"in n&&typeof n.next=="string"?n.next:null;return{domains:r,next:a}}async getPaginatedExploreAccounts(t,o){const n=new URL(t,this.apiUrl);o&&n.searchParams.set("next",o);const r=await this.fetchJSON(n);if(r===null||!("accounts"in r))return{accounts:[],next:null};const a=Array.isArray(r.accounts)?r.accounts:[],i="next"in r&&typeof r.next=="string"?r.next:null;return{accounts:a,next:i}}async getPost(t){const o=new URL(`.ghost/activitypub/v1/post/${encodeURIComponent(t)}`,this.apiUrl);return await this.fetchJSON(o)}async getReplies(t,o){const n=new URL(`.ghost/activitypub/v1/replies/${encodeURIComponent(t)}`,this.apiUrl);return o&&n.searchParams.set("next",o),await this.fetchJSON(n)}async updateAccount({name:t,username:o,bio:n,avatarUrl:r,bannerImageUrl:a}){const i=new URL(".ghost/activitypub/v1/account",this.apiUrl);await this.fetchJSON(i,"PUT",{name:t,username:o,bio:n,avatarUrl:r,bannerImageUrl:a})}async upload(t){const o=new URL(".ghost/activitypub/v1/upload/image",this.apiUrl),n=new FormData;n.append("file",t);const r=await this.getToken(),a=await this.fetch(o,{method:"POST",headers:{Authorization:`Bearer ${r}`},body:n});if(!a.ok)throw{message:"Upload failed",statusCode:a.status};return(await a.json()).fileUrl}async enableBluesky(){const t=new URL(".ghost/activitypub/v2/actions/bluesky/enable",this.apiUrl);await this.fetchJSON(t,"POST")}async disableBluesky(){const t=new URL(".ghost/activitypub/v2/actions/bluesky/disable",this.apiUrl);await this.fetchJSON(t,"POST")}async confirmBlueskyHandle(){const t=new URL(".ghost/activitypub/v2/actions/bluesky/confirm-handle",this.apiUrl),o=await this.fetchJSON(t,"POST");return o===null||!("handle"in o)||typeof o.handle!="string"?"":String(o.handle)}}const ov="pending-";function nv(){return`${ov}${crypto.randomUUID()}`}function ea0(e){return e.startsWith(ov)}function Sn0(e,t,o,n){const r={id:e.url,icon:e.icon,name:e.name,preferredUsername:e.preferredUsername,"@context":"",discoverable:!1,featured:"",followers:"",following:"",image:{url:""},inbox:"",manuallyApprovesFollowers:!1,outbox:"",publicKey:{id:"",owner:"",publicKeyPem:""},published:"",summary:"",type:"Person",url:""};return{id:t,type:"Create",actor:r,object:{type:"Note",name:"",content:o,summary:null,url:"",attributedTo:r,image:n||"",published:new Date().toISOString(),attachment:[],preview:{type:"Note",content:o},id:t,replyCount:0,liked:!1,reposted:!1,repostCount:0,authored:!0,"@context":""},"@context":"",to:""}}function Tn0(e){return e.replace(/\n/g,"<br />")}function cc(e){let t="";e.repostedBy!==null?t="Announce":t="Create";const o={id:e.author.url,icon:{url:e.author.avatarUrl},name:e.author.name,preferredUsername:e.author.handle.split("@")[1],followedByMe:e.author.followedByMe,"@context":"",discoverable:!1,featured:"",followers:"",following:"",image:{url:""},inbox:"",manuallyApprovesFollowers:!1,outbox:"",publicKey:{id:"",owner:"",publicKeyPem:""},published:"",summary:"",type:"Person",url:""};let n=null;e.repostedBy!==null&&(n={id:e.repostedBy.url,icon:{url:e.repostedBy.avatarUrl},name:e.repostedBy.name,preferredUsername:e.repostedBy.handle.split("@")[1],followedByMe:e.repostedBy.followedByMe,"@context":"",discoverable:!1,featured:"",followers:"",following:"",image:{url:""},inbox:"",manuallyApprovesFollowers:!1,outbox:"",publicKey:{id:"",owner:"",publicKeyPem:""},published:"",summary:"",type:"Person",url:""});let r="Note";e.type===Bz.Article?r="Article":e.type===Bz.Tombstone&&(r="Tombstone");const a={type:r,name:e.title,content:e.content,summary:e.summary,url:e.url,attributedTo:o,image:e.featureImageUrl??"",published:e.publishedAt,attachment:e.attachments,preview:{type:"",content:e.excerpt},id:e.id,replyCount:e.replyCount,likeCount:e.likeCount,liked:e.likedByMe,reposted:e.repostedByMe,repostCount:e.repostCount,authored:e.authoredByMe===!0,metadata:e.metadata,"@context":""};return{id:e.id,type:t,actor:n!==null?n:o,object:a,"@context":"",to:""}}let ql;async function c1(){return ql||(ql=(await(await fetch("/ghost/api/admin/site/")).json()).site.url),ql}function a1(e,t){return new En0(new URL(t),new URL("/ghost/api/admin/identities/",window.location.origin),e)}function He(e="Rate limit exceeded",t="You've made too many requests. Please try again later."){ve.error(e,{description:t})}function eM(e="Action failed",t="This user has restricted who can interact with their account."){ve.error(e,{description:t})}const l0={outbox:e=>["outbox",e],liked:e=>["liked",e],user:e=>["user",e],profilePosts:e=>e===null?["profile_posts"]:["profile_posts",e],account:e=>["account",e],accountFollows:(e,t)=>["account_follows",e,t],searchResults:e=>["search_results",e],suggestedProfiles:(e,t)=>["suggested_profiles",e,t],exploreProfiles:e=>["explore_profiles",e],replyChain:e=>e===null?["reply_chain"]:["reply_chain",e],feed:["feed"],inbox:["inbox"],discoveryFeed:["discovery_feed"],postsByAccount:["account_posts"],postsLikedByAccount:["account_liked_posts"],notifications:e=>["notifications",e],notificationsCount:e=>["notifications_count",e],blockedAccounts:e=>["blocked_accounts",e],blockedDomains:e=>["blocked_domains",e],topics:()=>["topics"]};function _z(e,t,o){const n=[l0.feed,l0.inbox,l0.discoveryFeed,l0.postsLikedByAccount,l0.profilePosts(null)];for(const r of n)e.setQueriesData(r,a=>a===void 0?a:{...a,pages:a.pages.map(i=>({...i,posts:i.posts.map(b=>b.object.id===t?{...b,object:{...b.object,liked:o,likeCount:Math.max(o?(b.object.likeCount||0)+1:(b.object.likeCount||0)-1,0)}}:b)}))}),r===l0.postsLikedByAccount&&(e.setQueriesData(r,a=>a&&{...a,pages:a.pages.map(i=>({...i,posts:o?i.posts:i.posts.filter(b=>b.object.id!==t)}))}),o&&e.invalidateQueries({queryKey:l0.postsLikedByAccount}))}function rv(e,t,o,n){const r=[l0.feed,l0.inbox,l0.discoveryFeed,l0.profilePosts("index")],a=o.split("@")[1];for(const b of r)e.setQueriesData(b,l=>l===void 0?l:{...l,pages:l.pages.map(u=>({...u,posts:u.posts.map(f=>f.type!=="Announce"&&f.actor?.preferredUsername===a?{...f,actor:{...f.actor,followedByMe:n}}:f.type==="Announce"&&typeof f.object.attributedTo=="object"&&f.object.attributedTo&&!Array.isArray(f.object.attributedTo)&&"preferredUsername"in f.object.attributedTo&&f.object.attributedTo.preferredUsername===a?{...f,object:{...f.object,attributedTo:{...f.object.attributedTo,followedByMe:n}}}:f)}))});const i=l0.replyChain(null);e.setQueriesData(i,b=>{if(!b)return b;const l=u=>u.author.handle===o?{...u,author:{...u.author,followedByMe:n}}:u;return{...b,post:l(b.post),ancestors:{...b.ancestors,chain:b.ancestors.chain.map(l)},children:b.children.map(u=>({...u,post:l(u.post),chain:u.chain.map(l)}))}})}function cv(e,t,o){e.getQueryCache().getAll().forEach(a=>{const i=a.queryKey;Array.isArray(i)&&i[0]==="account_follows"&&e.setQueryData(i,b=>b?.pages?{...b,pages:b.pages.map(l=>({...l,accounts:l.accounts.map(u=>u.handle===t?{...u,isFollowing:o}:u)}))}:b)})}function Ez(e,t,o){const n=l0.replyChain(null);e.setQueriesData(n,r=>{if(!r)return r;const a=i=>i.id===t?{...i,likedByMe:o,likeCount:Math.max(o?(i.likeCount||0)+1:(i.likeCount||0)-1,0)}:i;return{...r,post:a(r.post),ancestors:{...r.ancestors,chain:r.ancestors.chain.map(a)},children:r.children.map(i=>({...i,post:a(i.post),chain:i.chain.map(a)}))}}),e.setQueryData(l0.account("index"),r=>r&&{...r,likedCount:Math.max(0,r.likedCount+(o?1:-1))})}function Sz(e,t,o,n){const r=l0.notifications(t);e.setQueriesData({queryKey:r},a=>{if(!a||!a.pages)return a;try{return{...a,pages:a.pages.map(i=>!i||!i.notifications?i:{...i,notifications:i.notifications.map(b=>!b||!b.post?b:b.post.id===o?{...b,post:{...b.post,likedByMe:n,likeCount:Math.max(n?b.post.likeCount+1:b.post.likeCount-1,0)}}:b)})}}catch{return a}})}function Tz(e,t,o,n){const r=l0.notifications(t);e.setQueriesData({queryKey:r},a=>{if(!a||!a.pages)return a;try{return{...a,pages:a.pages.map(i=>!i||!i.notifications?i:{...i,notifications:i.notifications.map(b=>!b||!b.post?b:b.post.id===o?{...b,post:{...b.post,repostedByMe:n,repostCount:Math.max(n?b.post.repostCount+1:b.post.repostCount-1,0)}}:b)})}}catch{return a}})}function Pz(e,t,o,n){const r=l0.notifications(t);e.setQueriesData({queryKey:r},a=>{if(!a||!a.pages)return a;try{return{...a,pages:a.pages.map(i=>!i||!i.notifications?i:{...i,notifications:i.notifications.map(b=>!b||!b.post?b:b.post.id===o?{...b,post:{...b.post,replyCount:Math.max((b.post.replyCount??0)+n,0)}}:b)})}}catch{return a}})}function OA(e,t,o){const n=[l0.feed,l0.inbox,l0.discoveryFeed,l0.profilePosts("index"),l0.postsLikedByAccount];for(const r of n)e.setQueriesData(r,a=>a&&{...a,pages:a.pages.map(i=>({...i,posts:i.posts.map(b=>b.object.id===t?{...b,object:{...b.object,replyCount:Math.max((b.object.replyCount??0)+o,0)}}:b)}))})}function fA(e,t,o){const n=l0.replyChain(null);e.setQueriesData({queryKey:n,exact:!1},r=>{if(!r)return r;const a=i=>i.id===t?{...i,replyCount:Math.max((i.replyCount||0)+o,0)}:i;return{...r,post:a(r.post),ancestors:{...r.ancestors,chain:r.ancestors.chain.map(a)},children:r.children.map(i=>({...i,post:a(i.post),chain:i.chain.map(a)}))}})}function ta0(e){return Z2({queryKey:l0.blockedAccounts(e),refetchOnMount:"always",async queryFn({pageParam:t}){const o=await c1();return a1(e,o).getBlockedAccounts(t)},getNextPageParam(t){return t.next}})}function oa0(e){return Z2({queryKey:l0.blockedDomains(e),refetchOnMount:"always",async queryFn({pageParam:t}){const o=await c1();return a1(e,o).getBlockedDomains(t)},getNextPageParam(t){return t.next}})}function Pn0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).like(o)},onMutate:o=>{_z(t,o,!0),Ez(t,o,!0),Sz(t,e,o,!0)},onError(o,n){_z(t,n,!1),Ez(t,n,!1),Sz(t,e,n,!1),o.statusCode===403&&eM(),o.statusCode===429&&He()}})}function Xn0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).unlike(o)},onMutate:o=>{_z(t,o,!1),Ez(t,o,!1),Sz(t,e,o,!1)},onError(o){o.statusCode===429&&He()}})}function na0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).blockDomain(new URL(o.url))},onMutate:o=>{o.handle&&t.setQueryData(l0.account(o.handle),n=>n&&{...n,domainBlockedByMe:!0,followedByMe:!1,followsMe:!1})},onError(o){o.statusCode===429&&He()}})}function ra0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).unblockDomain(new URL(o.url))},onMutate:o=>{o.handle&&t.setQueryData(l0.account(o.handle),n=>n&&{...n,domainBlockedByMe:!1})},onError(o){o.statusCode===429&&He()}})}function ca0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).block(new URL(o.apId))},onMutate:o=>{t.setQueryData(l0.account(o.handle),n=>n&&{...n,blockedByMe:!0,followedByMe:!1,followsMe:!1}),t.invalidateQueries({queryKey:l0.feed}),t.invalidateQueries({queryKey:l0.inbox}),t.invalidateQueries({queryKey:l0.discoveryFeed})},onError(o){o.statusCode===429&&He()}})}function aa0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).unblock(new URL(o.apId))},onMutate:o=>{t.setQueryData(l0.account(o.handle),n=>n&&{...n,blockedByMe:!1})},onError(o){o.statusCode===429&&He()}})}function Xz(e,t,o){const n=[l0.feed,l0.inbox,l0.discoveryFeed,l0.profilePosts(null)];for(const r of n)e.setQueriesData(r,a=>a===void 0?a:{...a,pages:a.pages.map(i=>({...i,posts:i.posts.map(b=>b.object.id===t?{...b,object:{...b.object,reposted:o,repostCount:Math.max(o?b.object.repostCount+1:b.object.repostCount-1,0)}}:b)}))})}function jz(e,t,o){const n=l0.replyChain(null);e.setQueriesData(n,r=>{if(!r)return r;const a=i=>i.id===t?{...i,repostedByMe:o,repostCount:Math.max(o?(i.repostCount||0)+1:(i.repostCount||0)-1,0)}:i;return{...r,post:a(r.post),ancestors:{...r.ancestors,chain:r.ancestors.chain.map(a)},children:r.children.map(i=>({...i,post:a(i.post),chain:i.chain.map(a)}))}})}function jn0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).repost(o)},onMutate:o=>{Xz(t,o,!0),jz(t,o,!0),Tz(t,e,o,!0)},onError(o,n){Xz(t,n,!1),jz(t,n,!1),Tz(t,e,n,!1),o.statusCode===403&&eM(),o.statusCode===429&&He()}})}function Dn0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).derepost(o)},onMutate:o=>{Xz(t,o,!1),jz(t,o,!1),Tz(t,e,o,!1)},onError(o){o.statusCode===429&&He()}})}function In0(e){return x2({queryKey:l0.user(e),async queryFn(){const t=await c1();return a1(e,t).getUser()}})}function o5(e,t,o){const n=f1();return Y1({async mutationFn(r){const a=await c1();return a1(e,a).unfollow(r)},onSuccess(r,a){const i=l0.account(a==="me"?"index":a);n.setQueryData(i,h=>h&&{...h,followedByMe:!1,followerCount:h.followerCount-1<0?0:h.followerCount-1});const b=l0.accountFollows(a,"followers");n.setQueryData(b,h=>{if(!h?.pages?.[0])return h;const q=n.getQueryData(l0.account("index"));return q?{...h,pages:h.pages.map(g=>({...g,accounts:g.accounts.filter(W=>W.name!==q.name)}))}:h});const l=l0.account("index");n.setQueryData(l,h=>h&&{...h,followingCount:h.followingCount-1});const f=l0.accountFollows("me","following");n.getQueryData(f)?n.setQueryData(f,h=>h?.pages?{...h,pages:h.pages.map(q=>({...q,accounts:q.accounts.filter(g=>g.handle!==a)}))}:h):n.invalidateQueries({queryKey:f}),cv(n,a,!1),n.setQueryData(l0.exploreProfiles(e),h=>{if(!h)return h;const q=h.pages.map(g=>{const W=Object.entries(g.results).reduce((v,[y,x])=>{const k=x.sites.map(L=>L.handle===a?{...L,followedByMe:!1,followerCount:Math.max(0,L.followerCount-1)}:L);return v[y]={...x,sites:k},v},{});return{...g,results:W}});return{...h,pages:q}}),n.setQueriesData({queryKey:["suggested_profiles"],exact:!1},h=>h&&h.map(q=>q.handle===a?{...q,followedByMe:!1,followerCount:Math.max(0,q.followerCount-1)}:q)),rv(n,e,a,!1),t()},onError:r=>{r.statusCode===429&&He(),o()}})}function n5(e,t,o){const n=f1();return Y1({async mutationFn(r){const a=await c1();return a1(e,a).follow(r)},onSuccess(r,a){const i=l0.account(a==="me"?"index":a);n.setQueryData(i,h=>h&&{...h,followedByMe:!0,followerCount:h.followerCount+1});const b=l0.account("index");n.setQueryData(b,h=>h&&{...h,followingCount:h.followingCount+1});const l=l0.accountFollows(a,"followers"),f=l0.accountFollows("me","following");n.getQueryData(f)?n.setQueryData(f,h=>{if(!h?.pages?.[0])return h;const q=n.getQueryData(l0.account(a==="me"?"index":a));if(!q)return h;const g={id:q.id,name:q.name,handle:q.handle,avatarUrl:q.avatarUrl,blockedByMe:q.blockedByMe,domainBlockedByMe:q.domainBlockedByMe,isFollowing:!0};return{...h,pages:[{...h.pages[0],accounts:[g,...h.pages[0].accounts]},...h.pages.slice(1)]}}):n.invalidateQueries({queryKey:f}),cv(n,a,!0),n.setQueryData(l0.exploreProfiles(e),h=>{if(!h)return h;const q=h.pages.map(g=>{const W=Object.entries(g.results).reduce((v,[y,x])=>{const k=x.sites.map(L=>L.handle===a?{...L,followedByMe:!0,followerCount:L.followerCount+1}:L);return v[y]={...x,sites:k},v},{});return{...g,results:W}});return{...h,pages:q}}),n.setQueriesData({queryKey:["suggested_profiles"],exact:!1},h=>h&&h.map(q=>q.handle===a?{...q,followedByMe:!0,followerCount:q.followerCount+1}:q)),n.setQueryData(l,h=>{if(!h?.pages?.[0])return h;const q=n.getQueryData(l0.account("index"));if(!q)return h;const g={id:q.url,type:"Person",preferredUsername:"index",name:q.name,url:q.url,handle:`index@${new URL(q.url).hostname}`,icon:{type:"Image",url:q.avatarUrl},isFollowing:!1};return{...h,pages:[{...h.pages[0],accounts:[g,...h.pages[0].accounts]},...h.pages.slice(1)]}}),rv(n,e,a,!0),t()},onError(r){o(),r.statusCode===429&&He(),r.statusCode===403&&eM()}})}function Fn0(e,t){const o=f1(),n=l0.searchResults(t);return{searchQuery:x2({queryKey:n,enabled:t.length>0,refetchOnMount:"always",async queryFn(){const i=await c1();return a1(e,i).search(t)}}),updateAccountSearchResult:(i,b)=>{o.setQueryData(n,l=>l&&{...l,accounts:l.accounts.map(u=>u.id===i?{...u,...b}:u)})}}}function ml(e,t,o,n){e.setQueryData(t,r=>r&&{...r,pages:r.pages.map((a,i)=>i===0?{...a,[o]:[n,...a[o]]}:a)})}function Io(e,t,o,n,r){e.setQueryData(t,a=>a&&{...a,pages:a.pages.map(i=>({...i,[o]:i[o].map(b=>b.id===n?r(b):b)}))})}function gl(e,t,o,n){e.setQueryData(t,r=>r&&{...r,pages:r.pages.map(a=>({...a,[o]:a[o].filter(i=>i.id!==n)}))})}function Hn0(e,t){const o=f1();return Y1({async mutationFn({inReplyTo:n,content:r,imageUrl:a,altText:i}){const b=await c1(),l=a1(e,b),u=a?{url:a,altText:i}:void 0;return l.reply(n,r,u)},onMutate:({inReplyTo:n})=>{if(!t)throw new Error("Cannot create reply without actor props");const r=nv();return OA(o,n,1),fA(o,n,1),Pz(o,e,n,1),{id:r}},onSuccess:(n,r)=>{if(n.id===void 0)throw new Error("Activity returned from API has no id");o.invalidateQueries({queryKey:l0.replyChain(r.inReplyTo)})},onError(n,r){console.error(n),OA(o,r.inReplyTo,-1),fA(o,r.inReplyTo,-1),Pz(o,e,r.inReplyTo,-1),n.statusCode===403&&eM(),n.statusCode===429&&He(),ve.error("An error occurred while sending your reply.")}})}function Un0(e,t){const o=f1(),n=l0.feed,r=l0.outbox(e),a=l0.profilePosts("index");return Y1({async mutationFn({content:i,imageUrl:b,altText:l}){const u=await c1(),f=a1(e,u),O=b?{url:b,altText:l}:void 0;return f.note(i,O)},onMutate:({content:i,imageUrl:b})=>{if(!t)throw new Error("Cannot create note without actor props");const l=Tn0(i),u=nv(),f=Sn0(t,u,l,b);return ml(o,n,"posts",f),ml(o,r,"data",f),ml(o,a,"posts",f),{id:u}},onSuccess:(i,b,l)=>{if(i.id===void 0)throw new Error("Post returned from API has no id");const u=cc(i);Io(o,n,"posts",l?.id??"",()=>u),Io(o,r,"data",l?.id??"",()=>u),Io(o,a,"posts",l?.id??"",()=>u)},onError(i,b,l){console.error(i),gl(o,n,"posts",l?.id??""),gl(o,r,"data",l?.id??""),gl(o,a,"posts",l?.id??""),i.statusCode===429&&He(),ve.error("An error occurred while posting your note.")}})}function r5(e,t,o){const n=o?.enabled!==!1;return x2({queryKey:l0.account(t==="me"?"index":t),enabled:n,async queryFn(){const r=await c1();return a1(e,r).getAccount(t)}})}function sa0(e,t){const o=f1();return Z2({queryKey:l0.accountFollows(e,t),async queryFn({pageParam:n}){const r=await c1(),i=await a1("index",r).getAccountFollows(e,t,n);return i.accounts&&i.accounts.forEach(b=>{o.setQueryData(l0.account(b.handle),b)}),i},getNextPageParam(n){return n.next}})}function ia0(e){const t=l0.feed,o=f1();return{feedQuery:Z2({queryKey:t,enabled:e.enabled,staleTime:60*1e3,async queryFn({pageParam:a}){const i=await c1();return a1("index",i).getFeed(a).then(l=>({posts:l.posts.map(cc),next:l.next}))},getNextPageParam(a){return a.next}}),updateFeedActivity:(a,i)=>{Io(o,t,"posts",a,b=>({...b,...i}))}}}function pa0(e){const t=l0.inbox,o=f1();return{inboxQuery:Z2({queryKey:t,enabled:e.enabled,staleTime:20*1e3,async queryFn({pageParam:a}){const i=await c1();return a1("index",i).getInbox(a).then(l=>({posts:l.posts.map(cc),next:l.next}))},getNextPageParam(a){return a.next}}),updateInboxActivity:(a,i)=>{Io(o,t,"posts",a,b=>({...b,...i}))}}}function Ma0(e){const t=[...l0.discoveryFeed,e.topic],o=f1();return{discoveryFeedQuery:Z2({queryKey:t,enabled:e.enabled,staleTime:20*1e3,async queryFn({pageParam:a}){const i=await c1();return a1("index",i).getDiscoveryFeed(e.topic,a).then(l=>({posts:l.posts.map(cc),next:l.next}))},getNextPageParam(a){return a.next}}),updateDiscoveryFeedActivity:(a,i)=>{Io(o,t,"posts",a,b=>({...b,...i}))}}}function ba0(e,t){const o=l0.profilePosts(e==="me"?"index":e),n=f1();return{postsByAccountQuery:Z2({queryKey:o,enabled:t.enabled,async queryFn({pageParam:i}){const b=await c1();return a1("index",b).getPostsByAccount(e,i).then(u=>({posts:u.posts.map(cc),next:u.next})).catch(()=>({posts:[],next:null}))},getNextPageParam(i){return i.next}}),updatePostsByAccount:(i,b)=>{Io(n,o,"posts",i,l=>({...l,...b}))}}}function la0(e){const t=l0.postsLikedByAccount,o=f1();return{postsLikedByAccountQuery:Z2({queryKey:t,enabled:e.enabled,async queryFn({pageParam:a}){const i=await c1();return a1("index",i).getPostsLikedByAccount(a).then(l=>({posts:l.posts.map(cc),next:l.next}))},getNextPageParam(a){return a.next}}),updatePostsLikedByAccount:(a,i)=>{Io(o,t,"posts",a,b=>({...b,...i}))}}}function Vn0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).delete(o.id)},onMutate:({id:o,parentId:n})=>{const r=t.getQueryData(l0.feed);t.setQueryData(l0.feed,L=>L&&{...L,pages:L.pages.map(C=>({...C,posts:C.posts.filter(w=>w.id!==o).map(w=>w.object.id===n?{...w,object:{...w.object,replyCount:w.object.replyCount-1}}:w)}))});const a=t.getQueryData(l0.inbox);t.setQueryData(l0.inbox,L=>L&&{...L,pages:L.pages.map(C=>({...C,posts:C.posts.filter(w=>w.id!==o).map(w=>w.object.id===n?{...w,object:{...w.object,replyCount:w.object.replyCount-1}}:w)}))}),n&&Pz(t,e,n,-1);const i=l0.outbox(e),b=t.getQueryData(i);t.setQueryData(i,L=>L&&{...L,pages:L.pages.map(C=>({...C,data:C.data.filter(w=>w.object.id!==o)}))});const l=l0.liked(e),u=t.getQueryData(l);let f=!1;t.setQueryData(l,L=>L&&{...L,pages:L.pages.map(C=>(f=C.data.some(w=>w.object.id===o),{...C,data:C.data.filter(w=>w.object.id!==o)}))}),[l0.feed,l0.inbox,l0.discoveryFeed,l0.profilePosts("index"),l0.postsLikedByAccount].some(L=>t.getQueryData(L)?.pages.some(w=>w.posts.some(N=>N.id===o&&N.object.liked)))&&t.setQueryData(l0.account(e),L=>L&&{...L,likedCount:Math.max(0,L.likedCount-1)});const h=l0.profilePosts(null),q=t.getQueriesData(h);t.setQueriesData(h,L=>L&&{...L,pages:L.pages.map(C=>({...C,posts:C.posts.filter(w=>w.object.id!==o)}))});let g=[],W;f&&(g=l0.account(e),W=t.getQueryData(g),t.setQueryData(g,L=>L&&{...L,likedCount:L.likedCount-1<0?0:L.likedCount-1}));const v=l0.profilePosts("index"),y=t.getQueryData(v);t.setQueryData(v,L=>L&&{...L,pages:L.pages.map(C=>({...C,posts:C.posts.filter(w=>w.object.id!==o)}))});const x=l0.postsLikedByAccount,k=t.getQueryData(x);return t.setQueryData(x,L=>L&&{...L,pages:L.pages.map(C=>({...C,posts:C.posts.filter(w=>w.object.id!==o)}))}),n&&t.setQueriesData({queryKey:["reply_chain"],exact:!1},L=>{if(!L)return L;const C=L.children.filter(N=>N.post.id!==o).map(N=>({...N,chain:N.chain.filter(D=>D.id!==o)}));let w=L.post;return L.post.id===n&&(w={...L.post,replyCount:Math.max(0,(L.post.replyCount||0)-1)}),{...L,post:w,children:C}}),{previousFeed:{key:l0.feed,data:r},previousInbox:{key:l0.inbox,data:a},previousOutbox:{key:i,data:b},previousLiked:{key:l,data:u},previousProfilePosts:{key:h,data:q},previousAccount:f?{key:g,data:W}:null,previousPostsByAccount:{key:l0.profilePosts("index"),data:y},previousPostsLikedByAccount:{key:l0.postsLikedByAccount,data:k}}},onError:(o,n,r)=>{r&&(t.setQueryData(r.previousFeed.key,r.previousFeed.data),t.setQueryData(r.previousInbox.key,r.previousInbox.data),t.setQueryData(r.previousOutbox.key,r.previousOutbox.data),t.setQueryData(r.previousLiked.key,r.previousLiked.data),t.setQueriesData(r.previousProfilePosts.key,r.previousProfilePosts.data),r.previousAccount&&t.setQueryData(r.previousAccount.key,r.previousAccount.data),r.previousPostsByAccount&&t.setQueryData(l0.profilePosts("index"),r.previousPostsByAccount),r.previousPostsLikedByAccount&&t.setQueryData(l0.postsLikedByAccount,r.previousPostsLikedByAccount))},onSuccess:(o,{parentId:n})=>{t.invalidateQueries({queryKey:["reply_chain"]}),n&&(t.invalidateQueries({queryKey:l0.feed}),t.invalidateQueries({queryKey:l0.inbox}))}})}function za0(e){return Z2({queryKey:l0.notifications(e),async queryFn({pageParam:t}){const o=await c1();return a1(e,o).getNotifications(t)},getNextPageParam(t){return t.next}})}function ua0(e,t){const o=x2({queryKey:l0.replyChain(t),enabled:!!t,async queryFn(){if(!t)throw new Error("Post ID is required");const f=await c1(),O=a1(e,f);try{return await O.getReplies(t)}catch(h){if(_n0(h)&&h.statusCode===404)return await O.getPost(t),await O.getReplies(t);throw h}}}),[n,r]=p.useState(null),[a,i]=p.useState(null);p.useEffect(()=>{o.data?r(o.data):o.error&&i(o.error)},[o.data,o.error]);const b=p.useCallback(async()=>{if(!(!n?.ancestors.hasMore||!n?.ancestors.chain[0]))try{const f=await c1(),h=await a1(e,f).getReplies(n.ancestors.chain[0].id);r(q=>q&&{...q,ancestors:{chain:[...h.ancestors.chain,...q.ancestors.chain],hasMore:h.ancestors.hasMore}})}catch(f){i(f instanceof Error?f:new Error("Failed to load more ancestors"))}},[e,n?.ancestors.hasMore,n?.ancestors.chain]),l=p.useCallback(async()=>{if(n?.next&&t)try{const f=await c1(),h=await a1(e,f).getReplies(t,n.next);r(q=>q&&{...q,children:[...q.children,...h.children],next:h.next})}catch(f){i(f instanceof Error?f:new Error("Failed to load more children"))}},[e,n?.next,t]),u=p.useCallback(async f=>{if(n?.children[f]?.hasMore)try{const O=await c1(),h=a1(e,O),q=n.children[f],g=q.chain.length>1?q.chain[q.chain.length-2]:q.post,W=await h.getReplies(g.id),v=W.children[0].chain;r(y=>{if(!y)return y;const x=[...y.children];return x[f]={...q,chain:[...q.chain,...v],hasMore:W.children[0].hasMore},{...y,children:x}})}catch(O){i(O instanceof Error?O:new Error("Failed to load more child replies"))}},[e,n]);return{data:n,isLoading:o.isLoading,error:a,loadMoreAncestors:b,loadMoreChildren:l,loadMoreChildReplies:u,hasMoreAncestors:!!n?.ancestors.hasMore,hasMoreChildren:!!n?.next,hasMoreChildReplies:f=>!!n?.children[f]?.hasMore}}function da0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).updateAccount(o)},onSuccess(){t.invalidateQueries({queryKey:l0.account("index")})}})}async function $n0(e){const t=await c1();return a1("index",t).upload(e)}function av(e,t=!0){const o=p.useCallback(async()=>await c1(),[]),n=p.useCallback(async()=>{const r=await o();return a1(e,r)},[e,o]);return x2({queryKey:l0.notificationsCount(e),enabled:t,async queryFn(){return(await(await n()).getNotificationsCount()).count}})}function Qn0(e){const t=f1(),o=p.useCallback(async()=>await c1(),[]),n=p.useCallback(async()=>{const r=await o();return a1(e,r)},[e,o]);return Y1({async mutationFn(){return t.setQueryData(l0.notificationsCount(e),0),(await n()).resetNotificationsCount()}})}function Oa0(e,t){const o=f1(),n=[...l0.exploreProfiles(e),t];return{exploreProfilesQuery:Z2({queryKey:n,staleTime:3600*1e3,async queryFn({pageParam:i}){const b=await c1(),u=await a1(e,b).getExploreAccounts(t,i);return u.accounts.forEach(f=>{o.setQueryData(l0.account(f.handle),f)}),{accounts:u.accounts,next:u.next}},getNextPageParam(i){return i.next}}),updateExploreProfile:(i,b)=>{o.setQueryData(n,l=>{if(!l)return l;const u=l.pages.map(f=>{const O=f.accounts.map(h=>h.id===i?{...h,...b}:h);return{...f,accounts:O}});return{...l,pages:u}})}}}function c5(e,t=3){const o=f1(),n=l0.suggestedProfiles(e,t);return{suggestedProfilesQuery:x2({queryKey:n,async queryFn(){const i=await c1(),u=(await a1("index",i).getRecommendations(t)).accounts;return u.length>0&&u.forEach(f=>{o.setQueryData(l0.account(f.handle),f)}),u.length>0?u:null},retry:!1,staleTime:3600*1e3}),updateSuggestedProfile:(i,b)=>{o.setQueryData(n,l=>l&&l.map(u=>u.id===i?{...u,...b}:u))}}}function a5(){return{topicsQuery:x2({queryKey:l0.topics(),async queryFn(){const t=await c1();return a1("index",t).getTopics()},staleTime:864e5,retry:!1})}}function s5(e,t){const o=l0.account("index");e.setQueryData(o,n=>n&&{...n,...t})}function fa0(e){const t=f1();return Y1({async mutationFn(){const o=await c1();return a1(e,o).enableBluesky()},onSuccess(){s5(t,{blueskyEnabled:!0,blueskyHandleConfirmed:!1,blueskyHandle:null}),t.invalidateQueries({queryKey:l0.accountFollows("index","following")})},onError(o){o.statusCode===429&&He()}})}function Aa0(e){const t=f1();return Y1({async mutationFn(){const o=await c1();return a1(e,o).disableBluesky()},onSuccess(){s5(t,{blueskyEnabled:!1,blueskyHandleConfirmed:!1,blueskyHandle:null}),t.invalidateQueries({queryKey:l0.accountFollows("index","following")})},onError(o){o.statusCode===429&&He()}})}function ha0(e){const t=f1();return Y1({async mutationFn(){const o=await c1();return a1(e,o).confirmBlueskyHandle()},onSuccess(o){o!==""&&s5(t,{blueskyEnabled:!0,blueskyHandleConfirmed:!0,blueskyHandle:o})},onError(o){o.statusCode===429&&He()}})}let Ui=null;const AA=({onFollow:e,onUnfollow:t,authorHandle:o,followedByMe:n})=>{const[,r]=b0.useReducer(l=>l+1,0),i=Ui===o&&!n,b=l=>{i?(t(l),setTimeout(()=>{Ui=null,r()},0)):(Ui=o,r(),e(l))};return z.jsx(o1,{className:"absolute -right-1.5 bottom-px z-10 flex size-4 items-center justify-center rounded-full p-0 outline outline-2 outline-white transition-transform hover:scale-105 active:scale-100 dark:outline-black",title:i?"Unfollow":"Follow",onClick:b,children:i?z.jsx(i9,{className:"-mb-px !size-3 !stroke-[2.4]"}):z.jsx(b9,{className:"!size-[14px] !stroke-2"})})},jo=({author:e,size:t,isLoading:o=!1,disabled:n=!1,className:r="",showFollowButton:a=!1})=>{let i=20,b=`shrink-0 items-center justify-center rounded-full relative z-10 flex bg-black/5 dark:bg-gray-900 ${t==="lg"||n?"":"cursor-pointer"} ${r}`,l="z-10 object-cover rounded-full outline outline-[0.5px] outline-offset-[-0.5px] outline-black/10";const[u,f]=p.useState(e?.icon?.url),O=eo(),h=n5("index",()=>{ve.success(`Followed ${e?.name}`)},()=>{ve.error("Failed to follow")}),q=o5("index",()=>{ve.info(`Unfollowed ${e?.name}`)},()=>{ve.error("Failed to unfollow")});switch(p.useEffect(()=>{f(e?.icon?.url)},[e?.icon?.url]),t){case"2xs":i=10,b=Z1("size-4",b),l=Z1("size-4",l);break;case"xs":i=12,b=Z1("size-6",b),l=Z1("size-6",l);break;case"notification":i=16,b=Z1("size-9",b),l=Z1("size-9",l);break;case"sm":b=Z1("size-10",b),l=Z1("size-10",l);break;case"md":b=Z1("size-[60px]",b),l=Z1("size-[60px]",l);break;case"lg":i=32,b=Z1("size-22",b),l=Z1("size-22",l);break;default:b=Z1("size-10",b),l=Z1("size-10",l);break}if(!e||o)return z.jsx(w1,{className:l,containerClassName:b});const g=e?.handle||Xo(e),W=L=>{L.stopPropagation(),O(`/profile/${g}`)},v=L=>{L.stopPropagation(),h.mutate(g)},y=L=>{L.stopPropagation(),q.mutate(g)},k=a||Ui===g;return u?z.jsxs("div",{className:b,onClick:t==="lg"||n?void 0:W,children:[z.jsx("img",{className:l,referrerPolicy:"no-referrer",src:u,onError:()=>f(void 0)}),k&&z.jsx(AA,{authorHandle:g,followedByMe:!1,onFollow:v,onUnfollow:y})]}):z.jsxs("div",{className:b,onClick:n?void 0:W,children:[z.jsx(Ad,{className:"text-gray-600",size:i,strokeWidth:1.5}),k&&z.jsx(AA,{authorHandle:g,followedByMe:!1,onFollow:v,onUnfollow:y})]})},Wl=({trigger:e,onCopyLink:t,onDelete:o,allowDelete:n=!1,disabled:r=!1,layout:a,followedByMe:i=!1,authoredByMe:b=!1,onFollow:l=()=>{},onUnfollow:u=()=>{}})=>{const f=q=>{q.stopPropagation(),t()},O=q=>{q.stopPropagation(),o()},h=q=>{q.stopPropagation(),i?u():l()};return z.jsxs(NK,{children:[z.jsxs(mJ,{children:[z.jsx(gJ,{disabled:r,asChild:!0,onClick:q=>q.stopPropagation(),children:e}),z.jsx(Gm,{align:`${a==="modal"?"start":"end"}`,alignOffset:a==="modal"?-12:0,className:"p-2",children:z.jsxs("div",{className:"flex w-48 flex-col",children:[(!n||a==="inbox")&&z.jsx(fl,{asChild:!0,children:z.jsxs(o1,{className:"justify-start",variant:"ghost",onClick:f,children:[z.jsx(ZZ,{}),"Copy link"]})}),!b&&z.jsx(fl,{asChild:!0,children:z.jsxs(o1,{className:"justify-start",variant:"ghost",onClick:h,children:[i?z.jsx(LG,{}):z.jsx(kG,{}),i?"Unfollow":"Follow"]})}),n&&z.jsx(BK,{asChild:!0,children:z.jsx(fl,{asChild:!0,children:z.jsxs(o1,{className:"justify-start text-red hover:bg-red/5 hover:text-red",variant:"ghost",onClick:q=>q.stopPropagation(),children:[z.jsx(d9,{}),"Delete"]})})})]})})]}),z.jsxs(h9,{onClick:q=>q.stopPropagation(),children:[z.jsxs(q9,{children:[z.jsx(g9,{children:"Delete this post?"}),z.jsx(W9,{children:a==="inbox"?"This will remove the post from the Ghost social web, but it will remain on your website.":z.jsx(z.Fragment,{children:"If you delete this post, you won't be able to restore it."})})]}),z.jsxs(m9,{children:[z.jsx(R9,{onClick:q=>q.stopPropagation(),children:"Cancel"}),z.jsx(v9,{className:O3({variant:"destructive"}),onClick:O,children:"Delete"})]})]})]})};function Zn0(e){const[t,o]=p.useState({images:[],currentIndex:0,isOpen:!1}),n=b=>{const l=p5(b);if(!l)return[];if(Array.isArray(l))return l.map((u,f)=>({url:u.url,alt:u.name||`Image-${f}`}));if(l.mediaType?.startsWith("image/")||l.type==="Image")return[{url:l.url,alt:l.name||"Image"}];if(b.image){let u;if(typeof b.image=="string"?u=b.image:u=b.image?.url,u)return[{url:u,alt:"Image"}]}return[]};return{lightboxState:t,openLightbox:b=>{if(!e)return;const l=n(e),u=l.findIndex(f=>f.url===b);u!==-1&&o({images:l,currentIndex:u,isOpen:!0})},closeLightbox:()=>{o(b=>({...b,isOpen:!1}))},navigateToIndex:b=>{o(l=>({...l,currentIndex:b}))}}}const vl=({images:e,currentIndex:t,isOpen:o,onClose:n,onNavigate:r})=>{const a=t===0,i=t===e.length-1,b=p.useCallback(()=>{if(e.length<=1||i)return;const u=(t+1)%e.length;r(u)},[e.length,i,t,r]),l=p.useCallback(()=>{if(e.length<=1||a)return;const u=(t-1+e.length)%e.length;r(u)},[e.length,a,t,r]);return p.useEffect(()=>{const u=f=>{o&&(f.key==="ArrowRight"&&!i?b():f.key==="ArrowLeft"&&!a&&l())};return window.addEventListener("keydown",u),()=>{window.removeEventListener("keydown",u)}},[o,t,e.length,b,l,i,a]),!o||e.length===0?null:z.jsx(W3,{open:o,onOpenChange:u=>{u||n()},children:z.jsxs(Xa,{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=open]:zoom-in-100 data-[state=closed]:slide-out-to-top-[50%] data-[state=open]:slide-in-from-top-[50%]",onClick:()=>n(),children:[z.jsx("img",{alt:e[t].alt,className:"mx-auto max-h-[90vh] max-w-[90vw] object-contain",src:e[t].url,onClick:u=>u.stopPropagation()}),e.length>1&&z.jsxs(z.Fragment,{children:[z.jsxs(o1,{className:"absolute left-5 top-1/2 size-11 -translate-y-1/2 rounded-full bg-black/50 p-0 pr-0.5 hover:bg-black/70",disabled:a,onClick:u=>{u.stopPropagation(),l()},children:[z.jsx(mZ,{className:"!size-6"}),z.jsx("span",{className:"sr-only",children:"Previous image"})]}),z.jsxs(o1,{className:"absolute right-5 top-1/2 size-11 -translate-y-1/2 rounded-full bg-black/50 p-0 pl-0.5 hover:bg-black/70",disabled:i,onClick:u=>{u.stopPropagation(),b()},children:[z.jsx(ud,{className:"!size-6"}),z.jsx("span",{className:"sr-only",children:"Next image"})]})]}),z.jsx(aY,{asChild:!0,children:z.jsxs(o1,{className:"absolute right-5 top-5 size-11 rounded-full bg-black/50 p-0 hover:bg-black/70",children:[z.jsx(qd,{className:"!size-5"}),z.jsx("span",{className:"sr-only",children:"Close"})]})})]})})},hA=()=>{},i5=({className:e,following:t,handle:o,variant:n="default",onFollow:r=hA,onUnfollow:a=hA,"data-testid":i})=>{const[b,l]=p.useState(t),u=o5("index",()=>{},()=>{l(!0)}),f=n5("index",()=>{},()=>{l(!1)}),O=async()=>{b?(l(!1),a(),u.mutate(o)):(l(!0),r(),f.mutate(o))};p.useEffect(()=>{l(t)},[t]);const h=b?"Following":"Follow";return n==="link"?z.jsx(o1,{className:Z1("p-0 font-medium",b?"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":i,variant:"link",onClick:q=>{q?.preventDefault(),q?.stopPropagation(),O()},children:h}):z.jsx(o1,{className:Z1("min-w-[90px]",e),"data-testid":i,title:b?"Click to unfollow":"",variant:b?"outline":"default",onClick:q=>{q?.preventDefault(),q?.stopPropagation(),O()},children:h})};function Dz(e,t=[]){if(t.length===0)return e.replace(/<br\s*\/?>/gi," ").replace(/<\/p>\s*<p>|<\/div>\s*<div>|<\/h[1-6]>\s*<|<\/li>\s*<li>|<\/a>/gi," ").replace(/<[^>]*>/g,"").replace(/\s+/g," ").trim();const o=t.map(u=>u.toLowerCase()),n={};let r=0,i=e.replace(/<\/(h[1-6]|p|div|li|blockquote|pre)>/gi,"<br>");for(const u of o){const f=new RegExp(`<${u}[^>]*>.*?<\\/${u}>|<${u}[^>]*\\/?>`,"gis");i=i.replace(f,O=>{const h=`__EXCLUDED_TAG_${r+=1}__`;return n[h]=O,h})}let b=i;o.includes("br")||(b=i.replace(/<br\s*\/?>/gi," "));let l=b.replace(/<[^>]*>/g,"").replace(/\s+/g," ").trim();for(const[u,f]of Object.entries(n))l=l.replace(u,f);return l}const Vi=e=>{const t=document.createElement("div");t.innerHTML=e;const o=t.getElementsByTagName("a");for(let n=0;n<o.length;n++)(o[n].getAttribute("href")||"").match(/^\s*(javascript|data|vbscript):/i)&&o[n].removeAttribute("href"),o[n].setAttribute("target","_blank"),o[n].setAttribute("rel","noopener noreferrer");return t.innerHTML},qA=e=>"preferredUsername"in e,So=({actor:e,children:t,disabled:o=!1,side:n="bottom",align:r="start",isCurrentUser:a=!1})=>{const[i,b]=p.useState(!1),l=eo();let u=e?.handle;!u&&e&&qA(e)&&(u=Xo(e));const f=o||!u&&!e,O=r5("index",u||"",{enabled:i&&!!u}),h=O.isFetching||O.isLoading,q=O.error,g=O.data?typeof O.data.followerCount=="number"&&typeof O.data.followingCount=="number"&&O.data.bio!==void 0:!1;if(p.useEffect(()=>{!i||!u||!g&&!h&&!q&&O.refetch({cancelRefetch:!1})},[O,h,q,g,i,u]),f)return z.jsx(z.Fragment,{children:t});const v=O.data||e,y=v?.handle??u??"",x=v?.name??"",k=v?.avatarUrl??(e&&qA(e)?e.icon?.url:null)??null,L=!!v?.followsMe,C=typeof v?.followingCount=="number"?v.followingCount:Number(v?.followingCount)||0,w=typeof v?.followerCount=="number"?v.followerCount:Number(v?.followerCount)||0,N=v?.bio?Vi(Dz(v.bio,["a"])):void 0,D=()=>{y&&l(`/profile/${y}`)},Y=()=>{y&&l(`/profile/${y}/following`)},V=()=>{y&&l(`/profile/${y}/followers`)};return z.jsxs(Z00,{onOpenChange:b,children:[z.jsx(G00,{asChild:!0,children:t}),z.jsx($g,{align:r,className:"w-[320px] cursor-default rounded-2xl border-0 p-5 text-left text-gray-900 shadow-[0_5px_24px_0px_rgba(0,0,0,0.02),0px_2px_5px_0px_rgba(0,0,0,0.07),0px_0px_1px_0px_rgba(0,0,0,0.25)] outline-none dark:bg-[#101114] dark:shadow-none",side:n,sideOffset:12,onClick:J=>J.stopPropagation(),children:z.jsxs("div",{className:"flex flex-col gap-2",children:[z.jsxs("div",{className:"flex flex-col gap-2",children:[z.jsxs("div",{className:"flex justify-between",children:[z.jsxs(md,{className:"size-14 cursor-pointer",onClick:D,children:[k&&z.jsx(gd,{alt:x,className:"rounded-full outline outline-[0.5px] outline-offset-[-0.5px] outline-black/10",src:k,onError:J=>{J.target.src="",J.target.style.display="none"}}),z.jsx(Wd,{className:"bg-gray-200 text-sm font-semibold text-gray-700 dark:bg-gray-800 dark:text-gray-200",children:z.jsx(Ad,{className:"size-5 text-gray-500 dark:text-gray-400",strokeWidth:1.5})})]}),!a&&z.jsx(i5,{following:!!v?.followedByMe,handle:y,type:"primary"})]}),z.jsxs("div",{className:"flex cursor-pointer flex-col items-start",onClick:D,children:[z.jsx(aW,{className:"w-full truncate",children:x}),z.jsxs("div",{className:"flex w-full gap-2",children:[z.jsx("span",{className:"truncate text-gray-700 dark:text-gray-600",children:y}),L&&!a&&z.jsx(TK,{className:"mt-px whitespace-nowrap",variant:"secondary",children:"Follows you"})]})]})]}),z.jsx("div",{className:"flex gap-3 dark:text-gray-300",children:h?z.jsx(w1,{className:"h-4 w-32"}):!q&&z.jsxs(z.Fragment,{children:[z.jsxs("span",{className:"cursor-pointer hover:underline",onClick:Y,children:[z.jsx("span",{className:"font-bold text-black dark:text-white",children:Bf(C)})," ","Following"]}),z.jsxs("span",{className:"cursor-pointer hover:underline",onClick:V,children:[z.jsx("span",{className:"font-bold text-black dark:text-white",children:Bf(w)})," ","Followers"]})]})}),h?z.jsx(w1,{className:"h-4 w-48"}):!q&&N?z.jsx("div",{dangerouslySetInnerHTML:{__html:N},className:"leading-tight dark:text-gray-300 [&_.invisible]:hidden [&_a:hover]:underline [&_a]:text-[#00a4eb]"}):null]})})]})},sv=(e={})=>{const[t,o]=p.useState(!1),n=we();return p.useEffect(()=>{const r=a=>{if(a.target instanceof HTMLInputElement||a.target instanceof HTMLTextAreaElement||a.target instanceof HTMLElement&&a.target.isContentEditable||a.target instanceof HTMLSelectElement||a.metaKey||a.ctrlKey||a.altKey||a.shiftKey)return;const i=document.querySelector('[role="dialog"][data-state="open"]');if(!(i&&!(e.componentRef?.current?.closest('[role="dialog"]')===i)))switch(a.key.toLowerCase()){case"n":i||(a.preventDefault(),e.onOpenNewNote?e.onOpenNewNote():o(!0));break;case"r":e.isReplyAvailable&&e.onOpenReply&&(n.pathname.includes("/notes/")||n.pathname.includes("/reader/"))&&(a.preventDefault(),e.onOpenReply());break}};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e,n.pathname]),{isNewNoteModalOpen:t,setIsNewNoteModalOpen:o}},wi=({actor:e,object:t,likeCount:o,commentCount:n,repostCount:r,layout:a,disabled:i=!1,buttonClassName:b="",onLikeClick:l,onCommentClick:u,onReplyCountChange:f})=>{const[O,h]=p.useState(t.liked),[q,g]=p.useState(t.reposted),[W,v]=p.useState(!1),y=p.useRef(null);sv({isReplyAvailable:!u&&a!=="reply",onOpenReply:()=>v(!0),componentRef:y}),p.useEffect(()=>{h(t.liked),g(t.reposted)},[t.liked,t.reposted]),p.useEffect(()=>{N(r)},[r]);const x=Pn0("index"),k=Xn0("index"),L=jn0("index"),C=Dn0("index"),[w,N]=p.useState(r),D=async J=>{J.stopPropagation(),O?k.mutate(t.id):x.mutate(t.id,{onError(){h(!1)}}),h(!O),l()},Y=J=>{J.stopPropagation(),u?u():v(!0)},V=`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:bg-black dark:hover:bg-gray-950 dark:text-gray-600 ${b}`;return z.jsxs(z.Fragment,{children:[z.jsxs("div",{ref:y,className:`flex ${a!=="inbox"&&"gap-1"}`,children:[z.jsxs(o1,{className:`${V} ${O&&"text-pink-500 hover:text-pink-500"}`,"data-testid":"like-button",disabled:i,id:"like",title:`${O?"Undo like":"Like"}`,variant:"ghost",onClick:J=>{J?.stopPropagation(),J&&D(J)},children:[z.jsx(FZ,{className:`${O&&"fill-pink-500 text-pink-500"}`}),a!=="inbox"&&z.jsx(Xf,{className:o===0?"-ml-1.5 w-0 overflow-hidden":"",spinTiming:{duration:300},value:o})]}),z.jsxs(o1,{className:`${V}`,"data-testid":"reply-button",disabled:i,id:"comment",title:"Reply",variant:"ghost",onClick:Y,children:[z.jsx(Od,{className:"-mr-px"}),a!=="inbox"&&n>0&&zd(n)]}),z.jsxs(o1,{className:`${V} ${q&&"text-green-500 hover:text-green-500"}`,"data-testid":"repost-button",disabled:i,id:"repost",title:`${q?"Undo repost":"Repost"}`,variant:"ghost",onClick:J=>{J?.stopPropagation(),q?(C.mutate(t.id),N(w-1)):(L.mutate(t.id,{onError(){g(!1),N(w-1)}}),N(w+1)),g(!q)},children:[z.jsx(l9,{className:`${q&&"text-green-500"}`}),a!=="inbox"&&z.jsx(Xf,{className:w===0?"-ml-1.5 w-0 overflow-hidden":"",spinTiming:{duration:300},value:w})]})]}),W&&z.jsx(M5,{open:W,replyTo:{object:t,actor:e},onOpenChange:J=>{v(J)},onReply:()=>{f?.(1),v(!1)},onReplyError:()=>{f?.(-1)}})]})};function Gn0(e){const o=e.replace(/<[^>]*>/g,"").split(/\s+/).filter(r=>r.length>0).length;return`${Math.ceil(o/275)} min read`}const xo=(e,t,o)=>{o?.stopPropagation(),t(typeof e=="string"?`/profile/${e}`:`/profile/${e.handle||Xo(e)}`)},Kn0=e=>{const t=new Date,o=i=>new Date(i.getFullYear(),i.getMonth(),i.getDate()),n=o(t),r=o(new Date(t.getTime()-1440*60*1e3)),a=o(e);return a.getTime()===n.getTime()?Yn0(e):a.getTime()===r.getTime()?"Yesterday":Jn0(e)},Yn0=e=>{const o=Math.floor((new Date().getTime()-e.getTime())/1e3);if(o<1)return"Just now";if(o<60)return`${o}s`;const n=Math.floor(o/60);return n<60?`${n}m`:`${Math.floor(n/60)}h`},Jn0=e=>{const t=new Date,o=e.getDate(),n=e.toLocaleString("default",{month:"short"});return e.getFullYear()===t.getFullYear()?`${o} ${n}`:`${o} ${n} ${e.getFullYear()}`};function er0(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 Li(e,t=!0){const o=new Date(e?.published??e?.createdAt??new Date),n=er0(o),r=Kn0(o);return t&&!e.url?.includes("/.ghost/activitypub")?z.jsx("a",{className:"whitespace-nowrap text-gray-700 hover:underline",href:e.url,rel:"noreferrer",target:"_blank",title:n,onClick:a=>a.stopPropagation(),children:r}):z.jsx("span",{className:"whitespace-nowrap text-gray-700",children:r})}function p5(e){let t;if(e.image&&(t=e.image),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 Qc(e,t,o,n){const r=p5(e);if(!r)return null;const a=l=>u=>{u.stopPropagation(),t&&t(l)},i=l=>{n&&n(l)},b=(l,u=!1)=>{const f=u?"min-h-[200px]":"";return z.jsx("div",{className:`${l} ${f} flex w-full items-center justify-center bg-gray-100 dark:bg-gray-925/30`,children:z.jsx(UZ,{className:"text-gray-400",size:24,strokeWidth:1.5})})};if(Array.isArray(r)){const l=r.length;let u="";return l===1?u="grid-cols-1":l>=2&&l<=4?u="grid-cols-2 auto-rows-[150px]":l>4&&(u="grid-cols-3 auto-rows-[150px]"),z.jsx("div",{className:`attachment-gallery mt-3 grid w-full ${u} gap-2`,children:r.map((f,O)=>{const h=`size-full rounded-md outline outline-1 -outline-offset-1 outline-black/10 ${l===3&&O===0?"row-span-2":""}`;return o&&o.has(f.url)?b(h,l===1):z.jsx("img",{alt:f.name||`Image-${O}`,className:`${h} cursor-pointer object-cover`,referrerPolicy:"no-referrer",src:f.url,onClick:t?a(f.url):void 0,onError:()=>i(f.url)},f.url)})})}switch(r.mediaType){case"image/jpeg":case"image/png":case"image/gif":case"image/webp":return o&&o.has(r.url)?b(`${e.type==="Article"?"w-full rounded-t-md":"mt-3 max-h-[420px] rounded-md outline outline-1 -outline-offset-1 outline-black/10"}`,!0):z.jsx("img",{alt:r.name||"Image",className:`cursor-pointer ${e.type==="Article"?"w-full rounded-t-md":"mt-3 max-h-[420px] rounded-md outline outline-1 -outline-offset-1 outline-black/10"}`,referrerPolicy:"no-referrer",src:r.url,onClick:t?a(r.url):void 0,onError:()=>i(r.url)});case"video/mp4":case"video/webm":return z.jsx("div",{className:"relative mb-4 mt-3",children:z.jsx("video",{className:"h-[300px] w-full rounded object-cover",src:r.url,controls:!0})});case"audio/mpeg":case"audio/ogg":return z.jsx("div",{className:"relative mb-4 mt-2 w-full",children:z.jsx("audio",{className:"w-full",src:r.url,controls:!0})});default:if(e.image||r.type==="Image"){const l=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 outline-1 -outline-offset-1 outline-black/10";let u;return e.image?typeof e.image=="string"?u=e.image:u=e.image?.url:u=r.url,o&&o.has(u)?b(l,!0):z.jsx("img",{alt:r.name||"Image",className:l,referrerPolicy:"no-referrer",src:u,onClick:t?a(u):void 0,onError:()=>i(u)})}return null}}function tr0(e,t){const o=p5(e),n="ml-8 md:ml-9 shrink-0 rounded-md h-[91px] w-[121px] relative",r=Z1("object-cover outline outline-1 -outline-offset-1 outline-black/[0.05]",n);if(t)return z.jsx(w1,{className:`${r} outline-0`});if(!o)return null;if(Array.isArray(o))return z.jsx("img",{className:r,referrerPolicy:"no-referrer",src:o[0].url});switch(o.mediaType){case"image/jpeg":case"image/png":case"image/gif":return z.jsx("img",{className:r,referrerPolicy:"no-referrer",src:o.url});case"video/mp4":case"video/webm":return z.jsxs("div",{className:n,children:[z.jsx("video",{className:"h-[80px] w-full rounded object-cover",src:o.url}),z.jsx("div",{className:"absolute inset-0 rounded bg-gray-900 opacity-50"}),z.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:z.jsx(bG,{color:"white",fill:"white",size:40})})]});case"audio/mpeg":case"audio/ogg":return z.jsx("div",{className:"ml-8 w-[120px]",children:z.jsx("div",{className:"relative mb-4 mt-2 w-full",children:z.jsx("audio",{className:"w-full",src:o.url,controls:!0})})});default:return e.image?z.jsx("img",{className:r,referrerPolicy:"no-referrer",src:typeof e.image=="string"?e.image:e.image?.url}):null}}const mA=()=>{},gA=z.jsx(l9,{className:"shrink-0 text-gray-700 dark:text-gray-600",size:16,strokeWidth:1.5}),or0=({actor:e,allowDelete:t=!1,object:o,parentId:n=void 0,layout:r,type:a,commentCount:i=0,repostCount:b=0,likeCount:l=0,showHeader:u=!0,last:f,isLoading:O,isPending:h=!1,isCompact:q=!1,isChainContinuation:g=!1,isChainParent:W=!1,onClick:v=mA,onDelete:y=mA,showStats:x=!0})=>{const k=new Date(o?.published??new Date).toLocaleDateString("default",{year:"numeric",month:"short",day:"2-digit"})+", "+new Date(o?.published??new Date).toLocaleTimeString("default",{hour:"2-digit",minute:"2-digit"}),[,L]=p.useState(!1),[C,w]=p.useState(new Set),N=p.useRef(null),[D,Y]=p.useState(!1),V=Vn0("index"),J=eo(),t0=n5("index",()=>{ve.success(`Followed ${X?.name}`)},()=>{ve.error("Failed to follow")}),K=o5("index",()=>{ve.info(`Unfollowed ${X?.name}`)},()=>{ve.error("Failed to unfollow")});p.useEffect(()=>{const j0=N.current;j0&&Y(j0.scrollHeight>j0.clientHeight)},[o?.content]),p.useEffect(()=>{const j0=N.current;if(!j0)return;const p1=S=>{const r0=S.target.closest("a[data-profile]");if(r0){const A0=r0.getAttribute("data-profile")?.trim();/^@([\w.-]+)@([\w-]+\.[\w.-]+[a-zA-Z])$/.test(A0||"")&&A0&&(S.preventDefault(),S.stopPropagation(),xo(A0,J))}};return j0.addEventListener("click",p1),()=>{j0.removeEventListener("click",p1)}},[J,o?.content]);const a0=()=>{},q0=()=>{h||v()},Z=()=>{V.mutate({id:o.id,parentId:n}),y()},z0=async()=>{o?.url&&(await navigator.clipboard.writeText(o.url),L(!0),ve.success("Link copied"),setTimeout(()=>L(!1),2e3))},U=j0=>{w(p1=>new Set(p1).add(j0))};let X=e;a==="Announce"&&(X=typeof o.attributedTo=="object"?o.attributedTo:e);const G=X?Xo(X):null,_=X?.followedByMe||!1,I=a==="Announce"?typeof o.attributedTo=="object"&&o.attributedTo&&!Array.isArray(o.attributedTo)&&"authored"in o.attributedTo?o.attributedTo.authored:typeof o.attributedTo=="object"&&o.attributedTo&&!Array.isArray(o.attributedTo)&&typeof e=="object"&&e&&o.attributedTo.id===e.id:o.authored,i0=a==="Announce"?o.reposted??!1:o.authored,d0=()=>{G&&t0.mutate(G)},m0=()=>{G&&K.mutate(G)},W0=z.jsx(o1,{className:`relative z-10 size-[34px] rounded-md ${r==="inbox"||r==="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:bg-black dark:hover:bg-gray-950 [&_svg]:size-5`,"data-testid":"menu-button",variant:"ghost",children:z.jsx(p9,{})}),{lightboxState:s0,openLightbox:e0,closeLightbox:w0,navigateToIndex:x0}=Zn0(o);return r==="feed"?z.jsxs(z.Fragment,{children:[o&&z.jsxs("div",{className:`group/article relative -mx-4 ${h?"pointer-events-none":"cursor-pointer"} rounded-lg p-6 px-4 pb-[18px]`,"data-layout":"feed","data-object-id":o.id,onClick:q0,children:[a==="Announce"&&z.jsxs("div",{className:"z-10 mb-2 flex items-center gap-1.5 text-gray-700 dark:text-gray-600",children:[gA,z.jsxs("div",{className:"flex min-w-0 items-center gap-1 text-sm",children:[z.jsx(So,{actor:e,align:"center",isCurrentUser:i0,children:z.jsx("span",{className:"truncate break-anywhere hover:underline",onClick:j0=>{xo(e,J,j0)},children:e.name})}),"reposted"]})]}),z.jsxs("div",{className:"border-1 flex flex-col gap-2.5","data-test-activity":!0,children:[z.jsxs("div",{className:"flex items-center justify-between",children:[z.jsx(So,{actor:X,isCurrentUser:I,children:z.jsxs("div",{className:"flex min-w-0 grow items-center gap-3",children:[z.jsx(jo,{author:X,disabled:h,showFollowButton:!I&&!_}),z.jsxs("div",{className:"flex min-w-0 grow flex-col",onClick:j0=>{h||xo(X,J,j0)},children:[z.jsx("span",{className:`min-w-0 truncate font-semibold break-anywhere ${q?"text-lg":"text-md"} ${h?"":"hover-underline"} dark:text-white`,"data-test-activity-heading":!0,children:O?z.jsx(w1,{className:"w-24"}):X.name}),z.jsxs("div",{className:"flex w-full text-md text-gray-700 dark:text-gray-600",children:[z.jsx("span",{className:`truncate ${h?"":"hover-underline"}`,children:O?z.jsx(w1,{className:"w-56"}):Xo(X)}),z.jsx("div",{className:`ml-1 before:mr-1 ${!O&&'before:content-["·"]'}`,title:`${k}`,children:O?z.jsx(w1,{className:"w-4"}):Li(o,h===!1&&!o.authored)})]})]})]})}),z.jsx(Wl,{allowDelete:t,authoredByMe:I,disabled:h,followedByMe:_,layout:"feed",trigger:W0,onCopyLink:z0,onDelete:Z,onFollow:d0,onUnfollow:m0})]}),z.jsx("div",{className:"relative col-start-2 col-end-3 w-full gap-4 pl-[52px]",children:z.jsxs("div",{className:"flex flex-col",children:[z.jsx("div",{className:"",children:o.type==="Article"?z.jsxs("div",{className:"rounded-md border border-gray-150 transition-colors hover:bg-gray-75 dark:border-gray-950 dark:hover:bg-gray-950",children:[Qc(o,q0,C,U),z.jsxs("div",{className:"p-5",children:[z.jsx("div",{className:"mb-1 line-clamp-2 text-pretty text-lg font-semibold leading-tight tracking-tight break-anywhere","data-test-activity-heading":!0,children:o.name}),z.jsx("div",{className:"line-clamp-3 leading-[1.4em] break-anywhere",children:o.preview?.content})]})]}):z.jsxs("div",{className:"relative",children:[z.jsx("div",{className:"ap-note-content line-clamp-[10] text-pretty leading-[1.4285714286] tracking-[-0.006em] text-gray-900 break-anywhere dark:text-gray-300 [&_p+p]:mt-3",children:O?z.jsx(w1,{count:2}):z.jsx("div",{dangerouslySetInnerHTML:{__html:Vi(o.content||"")??""},ref:N,onClick:j0=>{const p1=j0.target;(p1.tagName==="A"||p1.closest("a"))&&j0.stopPropagation()}})}),D&&z.jsx("button",{className:"mt-1 text-blue-600",type:"button",children:"Show more"}),Qc(o,e0,C,U)]})}),z.jsx("div",{className:"space-between relative z-[30] ml-[-8px] mt-1 flex",children:O?z.jsx(w1,{className:"ml-2 w-18"}):x&&z.jsx(wi,{actor:X,commentCount:i,disabled:h,layout:r,likeCount:l,object:o,repostCount:b,onLikeClick:a0})})]})})]})]}),z.jsx(vl,{currentIndex:s0.currentIndex,images:s0.images,isOpen:s0.isOpen,onClose:w0,onNavigate:x0})]}):r==="modal"?z.jsxs(z.Fragment,{children:[o&&z.jsxs("div",{"data-object-id":o.id,children:[z.jsxs("div",{className:"group/article relative","data-layout":"modal",onClick:q0,children:[z.jsxs("div",{className:"z-10 -my-1 grid grid-cols-[auto_1fr] grid-rows-[auto_1fr] gap-3 pb-3 pt-4","data-test-activity":!0,children:[u&&z.jsxs(z.Fragment,{children:[z.jsx("div",{className:"relative z-10 pt-[3px]",children:z.jsx(jo,{author:X,showFollowButton:!I&&!_})}),z.jsxs("div",{className:"relative z-10 flex w-full min-w-0 cursor-pointer flex-col overflow-visible text-[1.5rem]",onClick:j0=>{h||xo(X,J,j0)},children:[z.jsxs("div",{className:"flex w-full",children:[z.jsx("span",{className:'min-w-0 truncate whitespace-nowrap font-semibold break-anywhere after:mx-1 after:font-normal after:text-gray-700 after:content-["·"] after:dark:text-gray-600',"data-test-activity-heading":!0,children:X.name}),z.jsx("div",{children:Li(o,!o.authored)})]}),z.jsx("div",{className:"flex w-full",children:z.jsx("span",{className:"min-w-0 truncate text-gray-700 dark:text-gray-600",children:Xo(X)})})]})]}),z.jsx("div",{className:"relative z-10 col-start-1 col-end-3 w-full gap-4",children:z.jsxs("div",{className:"flex flex-col items-start",children:[o.name&&z.jsx(v2,{className:"mb-1 leading-tight break-anywhere","data-test-activity-heading":!0,children:o.name}),z.jsx("div",{dangerouslySetInnerHTML:{__html:Vi(o.content||"")??""},ref:N,className:"ap-note-content-large text-pretty text-[1.6rem] tracking-[-0.011em] text-gray-900 break-anywhere dark:text-gray-300 [&_p+p]:mt-3"}),Qc(o,e0,C,U),z.jsx("div",{className:"space-between ml-[-8px] mt-3 flex",children:x&&z.jsx(wi,{actor:X,commentCount:i,layout:r,likeCount:l,object:o,repostCount:b,onLikeClick:a0})})]})})]}),z.jsx("div",{className:"absolute -inset-x-3 -inset-y-0 z-0 rounded transition-colors max-lg:hidden"})]}),z.jsx("div",{className:"mt-3 h-px bg-gray-200 dark:bg-gray-950"})]}),z.jsx(vl,{currentIndex:s0.currentIndex,images:s0.images,isOpen:s0.isOpen,onClose:w0,onNavigate:x0})]}):r==="reply"?z.jsxs(z.Fragment,{children:[o&&z.jsxs("div",{className:`group/article relative ${q?"pb-6":g?"pb-5":"py-5"} ${h?"pointer-events-none":"cursor-pointer"}`,"data-layout":"reply","data-object-id":o.id,onClick:q0,children:[z.jsxs("div",{className:"border-1 flex flex-col gap-2.5 border-b-gray-200","data-test-activity":!0,children:[z.jsxs("div",{className:"flex items-center justify-between",children:[z.jsx(So,{actor:X,isCurrentUser:I,children:z.jsxs("div",{className:"flex min-w-0 grow items-center gap-3",children:[z.jsx(jo,{author:X,disabled:h,showFollowButton:!I&&!_}),z.jsxs("div",{className:"flex min-w-0 grow flex-col",onClick:j0=>{h||xo(X,J,j0)},children:[z.jsxs("div",{className:"flex",children:[z.jsx("span",{className:'min-w-0 truncate whitespace-nowrap font-semibold text-black break-anywhere after:mx-1 after:font-normal after:text-gray-700 after:content-["·"] dark:text-white',"data-test-activity-heading":!0,children:X.name}),z.jsx("div",{children:Li(o,h===!1&&!o.authored)})]}),z.jsx("div",{className:"flex",children:z.jsx("span",{className:"truncate text-gray-700",children:Xo(X)})})]})]})}),!q&&z.jsx(Wl,{allowDelete:t,authoredByMe:I,disabled:h,followedByMe:_,layout:"reply",trigger:W0,onCopyLink:z0,onDelete:Z,onFollow:d0,onUnfollow:m0})]}),z.jsx("div",{className:"relative z-10 col-start-2 col-end-3 w-full gap-4 pl-[52px]",children:z.jsxs("div",{className:"flex flex-col items-start",children:[o.type==="Article"&&Qc(o,q0,C,U),o.name&&z.jsx(v2,{className:"mt-2.5 text-pretty leading-tight break-anywhere","data-test-activity-heading":!0,children:o.name}),o.preview&&o.type==="Article"?z.jsx("div",{className:"mt-1 line-clamp-3 leading-tight",children:o.preview.content}):z.jsx("div",{dangerouslySetInnerHTML:{__html:Vi(o.content||"")??""},ref:N,className:"ap-note-content text-pretty tracking-[-0.006em] text-gray-900 break-anywhere dark:text-gray-300 [&_p+p]:mt-3"}),o.type==="Note"&&Qc(o,e0,C,U),o.type==="Article"&&z.jsx(o1,{className:"mt-3 w-full",id:"read-more",variant:"secondary",children:"Read more"}),!q&&z.jsx("div",{className:"space-between ml-[-8px] mt-2 flex",children:x&&z.jsx(wi,{actor:X,commentCount:i,disabled:h,layout:r,likeCount:l,object:o,repostCount:b,onLikeClick:a0})})]})})]}),!f&&z.jsx("div",{className:`absolute left-[19px] ${q?"bottom-[8px] top-[51px]":g?"bottom-[5px] top-[51px]":W?"bottom-[5px] top-[71px]":"bottom-[-7px] top-[71px]"} z-0 w-[2px] rounded-sm bg-gray-200 dark:bg-gray-950`})]}),z.jsx(vl,{currentIndex:s0.currentIndex,images:s0.images,isOpen:s0.isOpen,onClose:w0,onNavigate:x0})]}):r==="inbox"?z.jsx(z.Fragment,{children:o&&z.jsxs("div",{className:"group/article 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-75 dark:hover:bg-gray-950/50","data-layout":"inbox","data-object-id":o.id,onClick:q0,children:[z.jsxs("div",{className:"w-full min-w-0",children:[z.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:O?z.jsx(w1,{className:"w-24"}):z.jsxs(z.Fragment,{children:[z.jsx(So,{actor:X,isCurrentUser:I,children:z.jsxs("div",{className:"flex items-center gap-1",children:[z.jsx(jo,{author:X,size:"2xs"}),z.jsx("span",{className:"min-w-0 font-semibold text-gray-900 break-anywhere hover:underline dark:text-gray-600","data-test-activity-heading":!0,onClick:j0=>{xo(X,J,j0)},children:X.name})]})}),a==="Announce"&&z.jsxs("span",{className:"z-10 flex items-center gap-1 text-gray-700 dark:text-gray-600",children:[gA,z.jsx(So,{actor:e,align:"center",isCurrentUser:i0,children:z.jsx("span",{className:"line-clamp-1 hover:underline",onClick:j0=>{xo(e,J,j0)},children:e.name})})," reposted"]}),z.jsx("span",{className:'shrink-0 whitespace-nowrap text-gray-600 before:mr-1 before:content-["·"]',title:`${k}`,children:Li(o,!o.authored)})]})}),z.jsxs("div",{className:"flex",children:[z.jsxs("div",{className:"flex min-h-[73px] w-full min-w-0 flex-col items-start justify-start gap-1",children:[z.jsx(v2,{className:"line-clamp-2 w-full max-w-[600px] text-pretty leading-tight break-anywhere","data-test-activity-heading":!0,children:O?z.jsx(w1,{className:"w-full max-w-96"}):o.name?o.name:z.jsx("span",{dangerouslySetInnerHTML:{__html:Dz(o.content||"")}})}),z.jsx("div",{className:"ap-note-content line-clamp-2 w-full max-w-[600px] text-pretty text-base leading-normal text-gray-900 break-anywhere dark:text-gray-300 [&_p+p]:mt-3",children:O?z.jsx(w1,{count:2}):z.jsx("div",{dangerouslySetInnerHTML:{__html:Dz(o.preview?.content??o.content??"")}})}),z.jsx("span",{className:"mt-1 shrink-0 whitespace-nowrap text-sm leading-none text-gray-600",children:O?z.jsx(w1,{className:"w-16"}):o.content&&`${Gn0(o.content)}`})]}),z.jsxs("div",{className:"invisible absolute right-3 top-8 z-[49] flex -translate-y-1/2 rounded-lg bg-white p-1 shadow-md group-hover/article:visible dark:bg-black",children:[x&&z.jsx(wi,{actor:X,commentCount:i,layout:r,likeCount:l,object:o,repostCount:b,onLikeClick:a0}),z.jsx(Wl,{allowDelete:t,authoredByMe:I,followedByMe:_,layout:"inbox",trigger:W0,onCopyLink:z0,onDelete:Z,onFollow:d0,onUnfollow:m0})]})]})]}),tr0(o,O)]})}):z.jsx(z.Fragment,{})},WA=5*1024*1024,vA="Image must be less than 5MB in size.",qa0=async e=>{try{const t=await fetch(e,{mode:"cors"});if(!t.ok)throw new Error(`Failed to fetch image: ${t.status}`);const o=await t.blob();return new Promise((n,r)=>{const a=new FileReader;a.onload=()=>n(a.result),a.onerror=r,a.readAsDataURL(o)})}catch{return e}},ma0=e=>new Promise(t=>{const o=new Image;o.onload=()=>{URL.revokeObjectURL(o.src),t(o.width===o.height)},o.src=URL.createObjectURL(e)}),ga0="Image must be square.",M5=({children:e,replyTo:t,onReply:o,onReplyError:n,onOpenChange:r,...a})=>{const{data:i}=In0("index"),b=Un0("index",i),l=Hn0("index",i),{data:u,isLoading:f}=r5("index","me"),[O,h]=p.useState(!1),q=p.useRef(null),g=p.useRef(null),[W,v]=p.useState(null),[y,x]=p.useState(!1),k=p.useRef(null),[L,C]=p.useState(""),[w,N]=p.useState(null),[D,Y]=p.useState(""),[V,J]=p.useState(!1),[t0,K]=p.useState(!1),[a0,q0]=p.useState(!1),Z=eo(),z0=500;p.useEffect(()=>{a.open!==void 0&&h(a.open)},[a.open]),p.useEffect(()=>{if(a.open!==void 0?a.open:O){const w0=setTimeout(()=>{q0(!0)},300);return()=>clearTimeout(w0)}else q0(!1)},[O,a.open]);const U=!L.trim()||!i||t0||L.length>z0,X=p.useCallback(async()=>{const e0=L.trim();if(!(!e0||!i))try{K(!0),t?(await l.mutateAsync({inReplyTo:t.object.id,content:e0,imageUrl:w||void 0,altText:D||void 0}),o?.()):(await b.mutateAsync({content:e0,imageUrl:w||void 0,altText:D||void 0}),Z("/notes")),h(!1),r&&r(!1),ve.success(t?"Reply posted":"Note posted")}catch{t&&n?.()}finally{K(!1)}},[L,i,t,l,b,w,D,o,n,h,Z,r]),G=e0=>{C(e0.target.value)};p.useEffect(()=>{q.current&&(q.current.style.height="auto",q.current.style.height=`${q.current.scrollHeight}px`)},[L]),p.useEffect(()=>{if((a.open!==void 0?a.open:O)&&q.current){const w0=setTimeout(()=>{q.current?.focus()},100);return()=>clearTimeout(w0)}},[O,a.open]),p.useEffect(()=>{if(V&&g.current){const e0=setTimeout(()=>{g.current?.focus()},100);return()=>clearTimeout(e0)}},[V]),p.useEffect(()=>{const e0=x0=>{(x0.metaKey||x0.ctrlKey)&&x0.key==="Enter"&&(x0.preventDefault(),!U&&!y&&X())};if(a.open!==void 0?a.open:O)return document.addEventListener("keydown",e0),()=>document.removeEventListener("keydown",e0)},[O,a.open,U,y,X]);const _=p.useCallback(async e0=>{const w0=e0.clipboardData?.items;if(w0)for(let x0=0;x0<w0.length;x0++){const j0=w0[x0];if(j0.type.indexOf("image")!==-1){e0.preventDefault();const p1=j0.getAsFile();if(p1){if(p1.size>WA){ve.error(vA);return}const S=URL.createObjectURL(p1);v(S),await I(p1)}break}}},[]);p.useEffect(()=>{if(a.open!==void 0?a.open:O)return document.addEventListener("paste",_),()=>document.removeEventListener("paste",_)},[O,a.open,_]);const I=async e0=>{try{x(!0);const w0=await $n0(e0);N(w0)}catch(w0){v(null);let x0="Failed to upload image. Try again.";if(w0&&typeof w0=="object"&&"statusCode"in w0)switch(w0.statusCode){case 413:x0="Image size exceeds limit.";break;case 415:x0="The file type is not supported.";break}ve.error(x0)}finally{x(!1)}},i0=async e0=>{const w0=e0.target.files;if(w0&&w0.length>0){const x0=w0[0];if(x0.size>WA){ve.error(vA),e0.target.value="";return}const j0=URL.createObjectURL(x0);v(j0),await I(x0)}},d0=e0=>{e0.stopPropagation(),v(null),N(null),Y(""),J(!1),W&&URL.revokeObjectURL(W),k.current&&(k.current.value="")},m0=e0=>{e0.stopPropagation(),J(!V)},W0=()=>{q.current?.focus()};p.useEffect(()=>()=>{W&&URL.revokeObjectURL(W)},[W]);let s0="What's new?";if(t){const e0=t.object.attributedTo||{};typeof e0=="object"&&"preferredUsername"in e0&&"id"in e0&&(s0=`Reply to ${Xo(e0)}...`)}return z.jsxs(W3,{open:a.open!==void 0?a.open:O,onOpenChange:e0=>{e0&&(C(""),v(null),N(null),Y(""),J(!1),W&&URL.revokeObjectURL(W),k.current&&(k.current.value="")),h(e0),r&&r(e0)},...a.open!==void 0?{}:a,children:[z.jsx(Z9,{asChild:!0,children:e}),z.jsxs(Xa,{className:"max-h-[80vh] min-h-[240px] gap-0 overflow-y-auto pb-0","data-testid":"new-note-modal",onClick:e0=>e0.stopPropagation(),children:[z.jsxs(Ld,{className:"hidden",children:[z.jsx(kd,{children:t?"Reply":"New note"}),z.jsx(K9,{children:"Post your thoughts to the Social web"})]}),t&&z.jsx(or0,{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:()=>{}}),z.jsxs("div",{className:`flex ${W?"":"min-h-36"} cursor-text items-start gap-3`,onClick:W0,children:[z.jsx("div",{className:"sticky top-0",children:z.jsx(jo,{author:i})}),z.jsx(cX,{asChild:!0,children:z.jsxs("div",{className:"-mt-0.5 flex w-full flex-col gap-0.5",children:[f?z.jsx(w1,{className:"w-10"}):z.jsx("span",{className:"min-w-0 truncate whitespace-nowrap font-semibold text-black break-anywhere dark:text-white",children:u?.name}),z.jsx(C6,{name:"content",asChild:!0,children:z.jsx(N6,{asChild:!0,children:z.jsx("textarea",{ref:q,autoFocus:!0,className:"ap-textarea w-full resize-none bg-transparent text-[1.5rem] break-anywhere","data-testid":"note-textarea",placeholder:s0,rows:1,value:L,onChange:G,onPaste:_})})}),z.jsx(C6,{name:"image",asChild:!0,children:z.jsx(N6,{asChild:!0,children:z.jsx("input",{ref:k,accept:"image/jpeg,image/png,image/webp,image/gif",className:"hidden",type:"file",onChange:i0})})})]})})]}),W&&z.jsxs("div",{className:"group relative mt-6 flex min-h-[200px] w-full items-center justify-center",children:[z.jsx("img",{alt:"Image attachment preview",className:`max-h-[320px] w-full rounded-sm object-cover outline outline-1 -outline-offset-1 outline-black/10 ${y&&"opacity-10"}`,src:W}),y&&z.jsx("div",{className:"absolute leading-[0]",children:z.jsx(mp,{size:"md"})}),z.jsx(o1,{className:"absolute right-3 top-3 size-8 bg-black/60 text-white opacity-0 hover:bg-black/80 group-hover:opacity-100",onClick:d0,children:z.jsx(d9,{})}),!y&&z.jsx(o1,{className:`absolute bottom-3 left-3 h-6 px-2 py-0 text-white ${V?"bg-green-500 hover:bg-green-500":"bg-black/60 hover:bg-black/80"}`,onClick:m0,children:"Alt"})]}),W&&!y&&V&&z.jsx("div",{className:"mt-1",children:z.jsx(B3,{ref:g,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-[#101114] dark:text-white dark:placeholder:text-gray-800",placeholder:"Type alt text for image (optional)",type:"text",value:D,onChange:e0=>Y(e0.target.value)})}),z.jsxs(xd,{className:`${a0?"sticky":"static"} bottom-0 flex-row bg-background py-6 dark:bg-[#101114]`,children:[z.jsx(o1,{className:"mr-auto w-[34px] !min-w-0",variant:"outline",onClick:()=>k.current?.click(),children:z.jsx($Z,{})}),z.jsxs("div",{className:"flex items-center space-x-3",children:[z.jsxs("div",{className:`text-sm ${L.length>=z0?"text-red-500":L.length>=z0*.9?"text-yellow-600":"text-gray-500"}`,children:[L.length,"/",z0]}),z.jsx(o1,{className:"min-w-16","data-testid":"post-button",disabled:U||y,onClick:X,children:t0?z.jsx(mp,{color:"light",size:"sm"}):"Post"})]})]})]})]})};function Iz(e){if(!e)return{};try{return JSON.parse(e)}catch{return{}}}function nr0(e,t){const o=Iz(e);return JSON.stringify({...o,...t})}const iv=()=>{const{data:e}=ye(),{mutateAsync:t}=dW(),o=b0.useMemo(()=>e?.accessibility?Iz(e.accessibility).apOnboarding||{}:{},[e?.accessibility]),n=b0.useCallback(async r=>{if(!e)return;const a=Iz(e.accessibility),i=nr0(e.accessibility,{apOnboarding:{...a.apOnboarding,...r}});await t({...e,accessibility:i})},[e,t]);return{isOnboarded:!!o.welcomeStepsFinished,isExplainerClosed:!!o.exploreExplainerClosed,setOnboarded:r=>n({welcomeStepsFinished:r}),setExplainerClosed:r=>n({exploreExplainerClosed:r})}},pv=()=>z.jsx("div",{className:"h-full pt-14",children:z.jsx(Cn,{})}),rr0=Object.freeze(Object.defineProperty({__proto__:null,default:pv,useOnboardingStatus:iv},Symbol.toStringTag,{value:"Module"})),cr0=()=>{const e=eo();function t(){e(`/notes/${encodeURIComponent("https://activitypub.ghost.org/.ghost/activitypub/note/6d6d7f57-b656-4caa-ba9e-efa1d9a4b3fb")}`)}return z.jsxs("div",{className:"z-20 w-full bg-white dark:bg-black",children:[z.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-black",children:[z.jsxs("div",{className:"flex items-center gap-2",children:[z.jsx(oG,{className:"text-purple-500",size:20,strokeWidth:1.5}),z.jsx(v2,{children:"Beta feedback"})]}),z.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-600",children:"Something not working? Let us know"}),z.jsx(o1,{className:"mt-2 dark:bg-gray-925/70 dark:hover:bg-gray-900",variant:"secondary",onClick:t,children:"Send feedback"})]}),z.jsxs("div",{className:"-mb-1 ml-3 flex items-center gap-1.5 pb-2 pt-4 text-xs text-gray-400",children:[z.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"}),"⋅",z.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"})]})]})},xp=({children:e,url:t=null,onClick:o,"data-testid":n,isSelected:r=!1})=>{const a=b0.Children.toArray(e),i=z.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 ${r?"z-10 before:opacity-100":"before:opacity-0"}`,"data-testid":n,onClick:()=>{!t&&o&&o()},children:z.jsxs("div",{className:"relative z-10 flex w-full items-center gap-3 py-3",children:[a[0],a[1],a[2]]})});return t?z.jsx("a",{href:t,rel:"noreferrer",target:"_blank",onClick:b=>{o&&(b.preventDefault(),o())},children:i}):i},ar0=()=>{const e=eo(),{suggestedProfilesQuery:t}=c5("index",3),{data:o,isLoading:n}=t,r=n?Array(3).fill(null):o||[],{resetStack:a}=t3(),i="[@media(max-height:740px)]:hidden";return!n&&(!o||o.length===0)?null:z.jsxs("div",{className:`border-t border-gray-200 px-3 pt-6 dark:border-gray-950 ${i}`,children:[z.jsxs("div",{className:"mb-3 flex flex-col gap-0.5",children:[z.jsxs("div",{className:"flex items-center gap-2",children:[z.jsx(dp,{className:"text-purple-500",size:20,strokeWidth:1.5}),z.jsx(v2,{children:"Follow suggestions"})]}),z.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-600",children:"Accounts you might be interested in"})]}),z.jsx("ul",{className:"grow",children:r.map((b,l)=>{const u=b?.id||`loading-${l}`,f=b?.name||"",O=b?.handle||"",h=b?.avatarUrl||"";let q;switch(l){case 0:q="[@media(max-height:740px)]:hidden";break;case 1:q="[@media(max-height:800px)]:hidden";break;case 2:q="[@media(max-height:860px)]:hidden";break}return z.jsx(p.Fragment,{children:z.jsx("li",{className:q,children:z.jsx(So,{actor:b,align:"center",isCurrentUser:!1,side:"left",children:z.jsx("div",{children:z.jsxs(xp,{onClick:()=>{!n&&b&&xo(b,e)},children:[n?z.jsx(w1,{className:"z-10 size-10"}):z.jsx(jo,{author:{icon:{url:h},name:f,handle:O},showFollowButton:!0}),z.jsxs("div",{className:"flex min-w-0 flex-col",children:[z.jsx("span",{className:"block max-w-[190px] truncate font-semibold text-black dark:text-white",children:n?z.jsx(w1,{className:"w-24"}):f}),z.jsx("span",{className:"block max-w-[190px] truncate text-sm text-gray-700 dark:text-gray-600",children:n?z.jsx(w1,{className:"w-40"}):O})]})]})})})},u)},u)})}),z.jsx(o1,{className:"p-0 font-medium text-purple hover:text-black dark:hover:text-white",variant:"link",onClick:()=>{a(),e("/explore")},children:"Find more →"})]})},sr0=({profile:e,update:t,isLoading:o,onOpenChange:n})=>{const r=()=>{t(e.id,{followedByMe:!0})},a=()=>{t(e.id,{followedByMe:!1})},i=eo();return z.jsx(So,{actor:e,align:"center",isCurrentUser:!1,side:"left",children:z.jsx("div",{children:z.jsxs(xp,{onClick:()=>{n?.(!1),i(`/profile/${e.handle}`)},children:[z.jsx(jo,{author:{icon:{url:e.avatarUrl},name:e.name,handle:e.handle},onClick:()=>n?.(!1)}),z.jsxs("div",{className:"flex grow flex-col break-anywhere",children:[z.jsx("span",{className:"line-clamp-1 font-semibold text-black dark:text-white",children:o?z.jsx(w1,{className:"w-full max-w-64"}):e.name}),z.jsx("span",{className:"line-clamp-1 text-sm text-gray-700 dark:text-gray-600",children:o?z.jsx(w1,{className:"w-24"}):e.handle})]}),o?z.jsx("div",{className:"inline-flex items-center",children:z.jsx(w1,{className:"w-12"})}):z.jsx(i5,{className:"ml-auto",following:e.followedByMe,handle:e.handle,type:"secondary",onFollow:r,onUnfollow:a})]},e.id)})})},ir0=({onOpenChange:e})=>{const{suggestedProfilesQuery:t,updateSuggestedProfile:o}=c5("index",5),{data:n=[],isLoading:r}=t;return!r&&(!n||n.length===0)?null:z.jsx("div",{className:"mb-[-15px] flex flex-col gap-3 pt-2",children:z.jsx("div",{className:"flex flex-col",children:(r?Array(5).fill(null):n||[]).map((a,i)=>z.jsx(b0.Fragment,{children:z.jsx(sr0,{isLoading:r,profile:a||{id:"",name:"",handle:"",avatarUrl:"",bio:"",followerCount:0,followingCount:0,followedByMe:!1},update:o,onOpenChange:e})},a?.id||`loading-${i}`))})})};function pr0(e,t,o,n){var r=this,a=p.useRef(null),i=p.useRef(0),b=p.useRef(0),l=p.useRef(null),u=p.useRef([]),f=p.useRef(),O=p.useRef(),h=p.useRef(e),q=p.useRef(!0);h.current=e;var g=typeof window<"u",W=!t&&t!==0&&g;if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var v=!!(o=o||{}).leading,y=!("trailing"in o)||!!o.trailing,x="maxWait"in o,k="debounceOnServer"in o&&!!o.debounceOnServer,L=x?Math.max(+o.maxWait||0,t):null;p.useEffect(function(){return q.current=!0,function(){q.current=!1}},[]);var C=p.useMemo(function(){var w=function(K){var a0=u.current,q0=f.current;return u.current=f.current=null,i.current=K,b.current=b.current||K,O.current=h.current.apply(q0,a0)},N=function(K,a0){W&&cancelAnimationFrame(l.current),l.current=W?requestAnimationFrame(K):setTimeout(K,a0)},D=function(K){if(!q.current)return!1;var a0=K-a.current;return!a.current||a0>=t||a0<0||x&&K-i.current>=L},Y=function(K){return l.current=null,y&&u.current?w(K):(u.current=f.current=null,O.current)},V=function K(){var a0=Date.now();if(v&&b.current===i.current&&J(),D(a0))return Y(a0);if(q.current){var q0=t-(a0-a.current),Z=x?Math.min(q0,L-(a0-i.current)):q0;N(K,Z)}},J=function(){n&&n({})},t0=function(){if(g||k){var K=Date.now(),a0=D(K);if(u.current=[].slice.call(arguments),f.current=r,a.current=K,a0){if(!l.current&&q.current)return i.current=a.current,N(V,t),v?w(a.current):O.current;if(x)return N(V,t),w(a.current)}return l.current||N(V,t),O.current}};return t0.cancel=function(){var K=l.current;K&&(W?cancelAnimationFrame(l.current):clearTimeout(l.current)),i.current=0,u.current=a.current=f.current=l.current=null,K&&n&&n({})},t0.isPending=function(){return!!l.current},t0.flush=function(){return l.current?Y(Date.now()):O.current},t0},[v,x,t,L,y,W,g,k,n]);return C}function Mr0(e,t){return e===t}function br0(e,t,o){var n=Mr0,r=p.useRef(e),a=p.useState({})[1],i=pr0(p.useCallback(function(l){r.current=l,a({})},[a]),t,o,a),b=p.useRef(e);return n(b.current,e)||(i(e),b.current=e),[r.current,i]}const xi=80,lr0=({onOpenChange:e,query:t,setQuery:o})=>{const n=p.useRef(null),r=p.useRef([]),a=p.useRef(0),i=eo(),[b]=br0(t,300),l=t.length>=2,{searchQuery:u,updateAccountSearchResult:f}=Fn0("index",l?b:""),{data:O,isFetching:h,isFetched:q}=u,{suggestedProfilesQuery:g}=c5("index",5),{data:W,isLoading:v}=g,y=v||W&&W.length>0,{topicsQuery:x}=a5(),{data:k}=x,L=r5("index","me"),{data:C}=L,[w,N]=p.useState([]),[D,Y]=p.useState(null),[V,J]=p.useState(0),t0=p.useMemo(()=>{const X=k?.topics||[];if(!l||X.length===0)return[];const G=t.toLowerCase();return X.filter(_=>_.slug==="following"?!1:_.name.toLowerCase().startsWith(G)||_.slug.toLowerCase().startsWith(G))},[t,l,k?.topics]),K=p.useMemo(()=>[...t0.map(X=>({type:"topic",data:X})),...w.map(X=>({type:"account",data:X}))],[t0,w]);p.useEffect(()=>{if(!l){N([]),Y(null);return}q&&(O?.accounts&&O.accounts.length>0?(N(O.accounts),Y("results"),J(0)):(N([]),Y("none"),J(0)))},[O?.accounts,q,l]);const a0=h&&l,q0=t.length<2||!D&&l&&t0.length===0,Z=!q0&&D==="none"&&t0.length===0,z0=!q0&&(w.length>0||t0.length>0);p.useEffect(()=>{n.current?.focus()},[]),p.useEffect(()=>{const X=r.current[V];if(!X)return;const G=X.closest("[data-radix-scroll-area-viewport]")||X.closest(".overflow-y-auto");if(!G){X.scrollIntoView({block:"nearest"});return}const _=G.getBoundingClientRect(),I=X.getBoundingClientRect();I.top<_.top+xi?G.scrollTo({top:G.scrollTop-(_.top+xi-I.top),behavior:"smooth"}):I.bottom>_.bottom-xi&&G.scrollTo({top:G.scrollTop+(I.bottom-_.bottom+xi),behavior:"smooth"})},[V]);const U=X=>{if(!(!z0||K.length===0)){if(X.key==="ArrowDown"||X.key==="ArrowUp"){X.preventDefault();const G=Date.now();if(G-a.current<50)return;a.current=G,X.key==="ArrowDown"?J(_=>(_+1)%K.length):J(_=>(_-1+K.length)%K.length)}else if(X.key==="Enter"){const G=K[V];if(!G)return;X.preventDefault(),e?.(!1),G.type==="topic"?i(`/explore/${G.data.slug}`):i(`/profile/${G.data.handle}`)}}};return z.jsxs(z.Fragment,{children:[z.jsxs("div",{className:'sticky -top-6 z-30 -mt-6 flex h-[72px] shrink-0 items-center gap-2 bg-white pb-2 pt-3 before:pointer-events-none before:absolute before:-inset-x-6 before:bottom-0 before:h-0 before:border-b before:border-b-gray-150 before:content-[""] dark:bg-[#101114] dark:before:border-b-gray-950',children:[z.jsx(fd,{className:"text-gray-600",size:18,strokeWidth:1.5}),z.jsx(B3,{ref:n,autoComplete:"off",className:"flex h-10 w-full items-center rounded-lg border-0 bg-transparent px-0 py-1.5 text-lg focus-visible:border-0 focus-visible:bg-transparent focus-visible:shadow-none focus-visible:outline-0 dark:bg-[#101114] dark:text-white dark:placeholder:text-gray-800",placeholder:"Search by name, handle, or URL...",title:"Search",type:"text",value:t,onChange:X=>o(X.target.value),onKeyDown:U}),a0&&z.jsx(mp,{className:"!absolute right-0 mr-0.5 shrink-0",size:"sm"})]}),z.jsxs("div",{className:"h-full",children:[Z&&z.jsx("div",{className:"flex h-full items-center justify-center pb-14",children:z.jsxs(e10,{children:[z.jsx(t10,{children:z.jsx(Ad,{})}),"No users matching this handle or account URL"]})}),z0&&z.jsx("div",{className:"mt-[-14px] pb-2",children:K.map((X,G)=>{const _=G===V;if(X.type==="topic")return z.jsx("div",{ref:d0=>r.current[G]=d0,children:z.jsxs(xp,{isSelected:_,onClick:()=>{e?.(!1),i(`/explore/${X.data.slug}`)},children:[z.jsx("div",{className:"flex size-10 shrink-0 items-center justify-center rounded-full bg-gray-100 dark:bg-gray-900",children:z.jsx(dp,{className:"text-gray-700 dark:text-gray-500",size:18,strokeWidth:1.5})}),z.jsxs("div",{className:"flex flex-col",children:[z.jsx("span",{className:"font-semibold text-black dark:text-white",children:X.data.name}),z.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-600",children:"Topic"})]})]})},X.data.slug);const I=X.data,i0=I.handle===C?.handle;return z.jsx(So,{actor:I,align:"center",isCurrentUser:i0,side:"left",children:z.jsx("div",{ref:d0=>r.current[G]=d0,children:z.jsxs(xp,{isSelected:_,onClick:()=>{e?.(!1),i(`/profile/${I.handle}`)},children:[z.jsx(jo,{author:{icon:{url:I.avatarUrl},name:I.name,handle:I.handle}}),z.jsxs("div",{className:"flex flex-col break-anywhere",children:[z.jsx("span",{className:"line-clamp-1 font-semibold text-black dark:text-white",children:I.name}),z.jsx("span",{className:"line-clamp-1 text-sm text-gray-700 dark:text-gray-600",children:I.handle})]}),I.blockedByMe||I.domainBlockedByMe?z.jsx(o1,{className:"pointer-events-none ml-auto min-w-[90px]",variant:"destructive",children:"Blocked"}):i0?null:z.jsx(i5,{className:"ml-auto",following:I.followedByMe,handle:I.handle,type:"secondary",onFollow:()=>f(I.id,{followedByMe:!0}),onUnfollow:()=>f(I.id,{followedByMe:!1})})]})})},I.id)})}),q0&&y&&z.jsxs(z.Fragment,{children:[z.jsx(v2,{children:"More people to follow"}),z.jsx(ir0,{onOpenChange:e})]})]})]})},zr0=()=>z.jsxs("div",{className:"inline-flex h-9 w-full items-center justify-start gap-2 rounded-full bg-gray-100 px-3 text-md font-normal text-gray-600 hover:bg-gray-200 hover:text-gray-600 dark:bg-gray-925/70 dark:text-gray-700 dark:hover:bg-gray-925 [&_svg]:size-[18px]",children:[z.jsx(fd,{size:18,strokeWidth:1.5})," Search the social web"]}),vn=p.forwardRef(({to:e,children:t,count:o,...n},r)=>{const a=we(),{resetStack:i}=t3(),b=J3(),l=e&&e.startsWith("/")?`${b}${e}`:e,u=l&&(a.pathname===l||a.pathname.startsWith(`${l}/`)),f=g0("justify-start text-md font-medium text-gray-800 dark:hover:bg-gray-925/70 dark:text-gray-500 h-9 [&_svg]:size-[18px]",u&&"bg-gray-100 dark:bg-gray-925/70 dark:text-white text-black font-semibold"),O=o&&o>0?z.jsx("span",{className:g0("ml-auto bg-purple-500 text-white text-xs font-semibold py-1 px-1.5 rounded-full min-w-[20px] h-5 flex items-center justify-center"),children:zd(o)}):null;return l?z.jsx(o1,{className:f,variant:"ghost",asChild:!0,children:z.jsxs(Ea,{to:l,onClick:()=>{i(),L10(l)},children:[t,O]})}):z.jsxs(o1,{ref:r,className:f,variant:"ghost",onClick:n.onClick,...n,children:[t,O]})});vn.displayName="SidebarMenuLink";const Mv=({isMobileSidebarOpen:e})=>{const{allFlags:t,flags:o}=kn0(),[n,r]=p.useState(!1),[a,i]=p.useState(""),{data:b}=ye(),l=we(),u=J3(),{data:f}=av(b?.slug||""),O=Qn0(b?.slug||""),{topicsQuery:h}=a5(),{data:q,isLoading:g}=h,W=!g&&q&&q.topics.length===0;p.useEffect(()=>{l.pathname===`${u}/notifications`&&f&&f>0&&O.mutate()},[l.pathname,u,f,O]);const v=p.useCallback(()=>{f&&f>0&&O.mutate()},[f,O]);return z.jsx("div",{className:`sticky top-0 flex min-h-screen w-[320px] flex-col border-l border-gray-200 pr-8 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:z.jsxs("div",{className:"flex grow flex-col justify-between",children:[z.jsxs("div",{className:"isolate flex w-full flex-col items-start gap-6 pl-6 pt-6",children:[z.jsx("div",{className:"flex h-[52px] w-full items-center",children:z.jsxs(W3,{open:n,onOpenChange:r,children:[z.jsx(Z9,{className:"mt-0.5 w-full",children:z.jsx(zr0,{})}),z.jsx(Xa,{className:"flex h-full max-h-[452px] flex-col overflow-y-auto pb-0",children:z.jsx(lr0,{query:a,setQuery:i,onOpenChange:r})})]})}),z.jsxs("div",{className:"flex w-full flex-col gap-px",children:[z.jsxs(vn,{to:"/reader",children:[z.jsx(uZ,{size:18,strokeWidth:1.5}),"Reader"]}),z.jsxs(vn,{to:"/notes",children:[z.jsx(Od,{size:18,strokeWidth:1.5}),"Notes"]}),z.jsxs(vn,{count:l.pathname!==`${u}/notifications`?f:void 0,to:"/notifications",onClick:v,children:[z.jsx(lZ,{size:18,strokeWidth:1.5}),"Notifications"]}),W?z.jsx(o1,{className:"inline-flex w-full items-center gap-2 rounded-sm px-3 py-2.5 text-left text-md font-medium text-gray-800 transition-colors hover:bg-gray-100 dark:text-gray-500 dark:hover:bg-gray-925/70",variant:"ghost",asChild:!0,children:z.jsxs("a",{href:"https://explore.ghost.org/social-web",rel:"noopener noreferrer",target:"_blank",children:[z.jsx(dp,{size:18,strokeWidth:1.5}),"Explore",z.jsx(dd,{className:"ml-auto",size:14,strokeWidth:1.5})]})}):z.jsxs(vn,{to:"/explore",children:[z.jsx(dp,{size:18,strokeWidth:1.5}),"Explore"]}),z.jsxs(vn,{to:"/profile",children:[z.jsx(hd,{size:18,strokeWidth:1.5}),"Profile"]}),z.jsxs(vn,{to:"/preferences",children:[z.jsx(AG,{size:18,strokeWidth:1.5}),"Preferences"]})]}),z.jsx(M5,{children:z.jsxs(o1,{className:"h-9 rounded-full bg-purple-500 px-3 text-md text-white hover:bg-purple-600 dark:hover:bg-purple-600",children:[z.jsx(SZ,{}),"New note"]})}),z.jsx(ar0,{}),t.map(y=>o[y]?z.jsxs("div",{className:"flex items-center justify-between gap-1 pl-3 opacity-50",children:[z.jsx("span",{className:"font-mono text-xs",children:y}),z.jsx("span",{className:"text-green-800 inline-flex items-center rounded bg-green-100 px-1 py-0.5 text-xs font-medium",children:"ON"})]},y):z.jsx(z.Fragment,{}))]}),z.jsx("div",{className:"sticky bottom-0 flex items-center gap-2 bg-white pb-4 pl-4 dark:bg-black",children:z.jsx(cr0,{})})]})})};Mv.displayName="Sidebar";const ur0=({children:e,...t})=>{const{isOnboarded:o}=iv(),n=J3(),{data:r,isLoading:a}=ye(),i=p.useRef(null),[b,l]=p.useState(!1),u=tv(),{topicsQuery:f}=a5(),{data:O}=f,h=O&&O.topics.length>0,{isNewNoteModalOpen:q,setIsNewNoteModalOpen:g}=sv(),W=()=>{l(!b)},v=()=>{l(!1)};return a||!r?null:o?z.jsxs("div",{ref:i,className:`h-screen w-full ${o&&"overflow-y-auto"}`,"data-scrollable-container":!0,children:[z.jsx(x10,{containerRef:i}),z.jsx("div",{className:"relative mx-auto flex max-w-page flex-col",...t,children:o?z.jsxs(z.Fragment,{children:[z.jsxs("div",{className:"block grid-cols-[auto_320px] items-start lg:grid",children:[z.jsxs("div",{className:"z-0 min-w-0",children:[z.jsx(Bn0,{showBorder:!(u==="reader"&&h)&&u!=="explore",onToggleMobileSidebar:W}),z.jsx("div",{className:"px-[min(4vw,32px)]",children:e})]}),z.jsx(Mv,{isMobileSidebarOpen:b,onCloseMobileSidebar:v})]}),b&&z.jsx("div",{className:"fixed inset-0 z-40 lg:hidden",onClick:v})]}):z.jsx(pv,{})}),z.jsx(M5,{open:q,onOpenChange:g})]}):z.jsx(Rn,{to:`${n}/welcome`,replace:!0})},Zc=({children:e})=>z.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-925/70 [&_svg]:size-8 [&_svg]:stroke-1",children:e}),Gc=({children:e,className:t})=>z.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}),bv=({statusCode:e,errorCode:t})=>{const o=hq(),n=sW(),r=a=>{a.preventDefault(),n("/analytics/",{crossApp:!0})};return o?z.jsx(ur0,{children:z.jsxs(Gc,{children:[z.jsx(Zc,{children:z.jsx(dG,{})}),z.jsx(v2,{className:"-mb-4",children:"Oops, page not found!"}),z.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?z.jsxs(Gc,{className:"mt-[50vh] -translate-y-1/2",children:[z.jsx(Zc,{children:z.jsx(yG,{})}),z.jsx(v2,{className:"-mb-4",children:"Rate limit exceeded"}),z.jsx("div",{children:"You've made too many requests. Please try again in a moment."}),z.jsx(o1,{asChild:!0,children:z.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"?z.jsxs(Gc,{className:"mt-[50vh] -translate-y-1/2",children:[z.jsx(Zc,{children:z.jsx(z9,{})}),z.jsx(v2,{className:"-mb-4",children:"Site not configured correctly"}),z.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."}),z.jsx(o1,{asChild:!0,children:z.jsx("a",{href:"https://ghost.org/help/social-web/",rel:"noopener noreferrer",target:"_blank",children:"Learn more →"})})]}):z.jsxs(Gc,{className:"mt-[50vh] -translate-y-1/2",children:[z.jsx(Zc,{children:z.jsx(MZ,{})}),z.jsx(v2,{className:"-mb-4",children:"Account suspended"}),z.jsx("div",{children:"Your account has been suspended due to policy violations."}),z.jsx(o1,{asChild:!0,children:z.jsx("a",{href:"https://ghost.org/help/social-web/",rel:"noopener noreferrer",target:"_blank",children:"Learn more →"})})]}):e===410&&t==="INVALID_VERSION"?z.jsxs(Gc,{className:"mt-[50vh] -translate-y-1/2",children:[z.jsx(Zc,{children:z.jsx(kZ,{})}),z.jsx(v2,{className:"-mb-4",children:"New version available"}),z.jsx("div",{children:"We've made some updates! Refresh your page to see what's new"}),z.jsx(o1,{asChild:!0,children:z.jsx("button",{type:"button",onClick:()=>window.location.reload(),children:"Refresh your page"})})]}):z.jsx("div",{className:"admin-x-container-error",children:z.jsxs("div",{className:"admin-x-error max-w-xl",children:[z.jsx("h1",{children:"Loading interrupted"}),z.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."}),z.jsx("a",{className:"cursor-pointer text-green",onClick:r,children:"← Back to the homepage"})]})})},dr0=Object.freeze(Object.defineProperty({__proto__:null,default:bv},Symbol.toStringTag,{value:"Module"})),Or0="activitypub",lv=[{path:Or0,element:z.jsx(Cn,{}),errorElement:z.jsx(bv,{}),handle:"activitypub-basepath",children:[{index:!0,element:z.jsx(Rn,{to:"reader"})},{path:"inbox",element:z.jsx(Rn,{to:"../reader",replace:!0})},{path:"feed",element:z.jsx(Rn,{to:"../notes",replace:!0})},{path:"reader",lazy:h1(()=>z1(()=>import("./index-DR46F9P3.js"),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url)),pageTitle:"Reader"},{path:"reader/:postId",lazy:h1(()=>z1(()=>import("./index-DR46F9P3.js"),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url)),pageTitle:"Reader"},{path:"notes",lazy:h1(()=>z1(()=>import("./feed-Eo5LuGaJ.js"),__vite__mapDeps([7,8]),import.meta.url)),pageTitle:"Notes"},{path:"notes/:postId",lazy:h1(()=>z1(()=>import("./note-pOWzgRq4.js"),__vite__mapDeps([9,2,3,8]),import.meta.url)),pageTitle:"Note"},{path:"notifications",lazy:h1(()=>z1(()=>import("./index-CR1X4uHr.js"),__vite__mapDeps([10,11,12,13]),import.meta.url)),pageTitle:"Notifications"},{path:"explore",lazy:h1(()=>z1(()=>import("./index-CBtTUuJD.js"),__vite__mapDeps([14,4,15]),import.meta.url)),pageTitle:"Explore"},{path:"explore/:topic",lazy:h1(()=>z1(()=>import("./index-CBtTUuJD.js"),__vite__mapDeps([14,4,15]),import.meta.url)),pageTitle:"Explore"},{path:"profile",lazy:h1(()=>z1(()=>import("./index-DkdzYzw_.js"),__vite__mapDeps([16,17,18,11,19,20,21,22,23,24,25,8,6,1,26,12,27,13,15,3,28]),import.meta.url)),pageTitle:"Profile"},{path:"profile/likes",lazy:h1(()=>z1(()=>import("./index-DkdzYzw_.js"),__vite__mapDeps([16,17,18,11,19,20,21,22,23,24,25,8,6,1,26,12,27,13,15,3,28]),import.meta.url)),pageTitle:"Profile"},{path:"profile/following",lazy:h1(()=>z1(()=>import("./index-DkdzYzw_.js"),__vite__mapDeps([16,17,18,11,19,20,21,22,23,24,25,8,6,1,26,12,27,13,15,3,28]),import.meta.url)),pageTitle:"Profile"},{path:"profile/followers",lazy:h1(()=>z1(()=>import("./index-DkdzYzw_.js"),__vite__mapDeps([16,17,18,11,19,20,21,22,23,24,25,8,6,1,26,12,27,13,15,3,28]),import.meta.url)),pageTitle:"Profile"},{path:"profile/:handle/:tab?",lazy:h1(()=>z1(()=>import("./index-DkdzYzw_.js"),__vite__mapDeps([16,17,18,11,19,20,21,22,23,24,25,8,6,1,26,12,27,13,15,3,28]),import.meta.url)),pageTitle:"Profile"},{path:"preferences",lazy:h1(()=>z1(()=>import("./index-CI2E0Omu.js"),__vite__mapDeps([29,30,26,25,28,18,11]),import.meta.url)),pageTitle:"Preferences"},{path:"preferences/moderation",lazy:h1(()=>z1(()=>import("./moderation-Dq51J7FU.js"),__vite__mapDeps([31,19,20,21,22,23,11,24,25,8,6,1,17,26,12,27,13,15,3]),import.meta.url)),pageTitle:"Moderation",showBackButton:!0},{path:"preferences/bluesky-sharing",lazy:h1(()=>z1(()=>import("./bluesky-sharing-YNHtFCeH.js"),__vite__mapDeps([32,18,11,25]),import.meta.url)),showBackButton:!0},{path:"welcome",lazy:h1(()=>z1(()=>Promise.resolve().then(()=>rr0),void 0,import.meta.url)),pageTitle:"Welcome",children:[{path:"",element:z.jsx(Rn,{to:"1",replace:!0})},{path:"1",lazy:h1(()=>z1(()=>import("./step-1-19iQ9zfQ.js"),__vite__mapDeps([33,25]),import.meta.url))},{path:"2",lazy:h1(()=>z1(()=>import("./step-2-Bm58XNFW.js"),__vite__mapDeps([34,35,13,27]),import.meta.url))},{path:"3",lazy:h1(()=>z1(()=>import("./step-3-CpwBi-6n.js"),__vite__mapDeps([36,35,13,27,22,6,8]),import.meta.url))},{path:"*",element:z.jsx(Rn,{to:"1",replace:!0})}]},{path:"*",lazy:h1(()=>z1(()=>Promise.resolve().then(()=>dr0),void 0,import.meta.url))}]}];function fr0(){return z.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[z.jsx("path",{d:"M3.6349 20.3723C3.80192 20.5393 4.00019 20.6718 4.21841 20.7622C4.43663 20.8525 4.67052 20.8991 4.90672 20.8991C5.14291 20.8991 5.3768 20.8525 5.59502 20.7622C5.81324 20.6718 6.01152 20.5393 6.17853 20.3723C6.34555 20.2052 6.47804 20.007 6.56843 19.7888C6.65882 19.5705 6.70534 19.3366 6.70534 19.1004C6.70534 18.8643 6.65882 18.6304 6.56843 18.4121C6.47804 18.1939 6.34555 17.9956 6.17853 17.8286C5.84123 17.4913 5.38374 17.3018 4.90672 17.3018C4.42969 17.3018 3.9722 17.4913 3.6349 17.8286C3.29759 18.1659 3.10809 18.6234 3.10809 19.1004C3.10809 19.5775 3.29759 20.035 3.6349 20.3723ZM17.7153 6.17951C17.8823 6.34653 18.0806 6.47901 18.2988 6.5694C18.517 6.65979 18.7509 6.70632 18.9871 6.70632C19.2233 6.70632 19.4572 6.65979 19.6754 6.5694C19.8936 6.47901 20.0919 6.34653 20.2589 6.17951C20.4259 6.01249 20.5584 5.81421 20.6488 5.596C20.7392 5.37778 20.7857 5.14389 20.7857 4.90769C20.7857 4.67149 20.7392 4.43761 20.6488 4.21939C20.5584 4.00117 20.4259 3.80289 20.2589 3.63587C19.9216 3.29857 19.4641 3.10907 18.9871 3.10907C18.5101 3.10907 18.0526 3.29857 17.7153 3.63587C17.378 3.97318 17.1885 4.43067 17.1885 4.90769C17.1885 5.38472 17.378 5.8422 17.7153 6.17951ZM7.50655 12.0023C7.50655 13.1946 7.98019 14.3381 8.82329 15.1812C9.66639 16.0243 10.8099 16.4979 12.0022 16.4979C13.1945 16.4979 14.338 16.0243 15.1811 15.1812C16.0242 14.3381 16.4978 13.1946 16.4978 12.0023C16.4978 10.81 16.0242 9.66647 15.1811 8.82337C14.338 7.98027 13.1945 7.50663 12.0022 7.50663C10.8099 7.50663 9.66639 7.98027 8.82329 8.82337C7.98019 9.66647 7.50655 10.81 7.50655 12.0023Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),z.jsx("path",{d:"M8.79319 21.5246C10.5669 22.1224 12.4724 22.2127 14.2947 21.7854C16.1171 21.3581 17.7838 20.4302 19.1069 19.1062C20.4302 17.7827 21.3577 16.116 21.7848 14.2937C22.2119 12.4715 22.1217 10.5662 21.5243 8.79251M2.47582 15.2081C1.87829 13.4342 1.78805 11.5287 2.21527 9.70622C2.64249 7.88378 3.57019 6.21687 4.89383 4.89332C6.21747 3.56977 7.88445 2.64219 9.70692 2.21511C11.5294 1.78802 13.4349 1.87839 15.2088 2.47605",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}function kp({path:e,activeOnSubpath:t=!1}){const o=t&&e?`${e}/*`:e;return QI(o||"")!==null}function U0({children:e,...t}){return z.jsx(Qd,{...t,children:e})}function Ar0({to:e,target:t,rel:o,activeOnSubpath:n=!1,isActive:r,children:a,...i}){const b=`#/${e?.replace(/^\/?#\//,"")}`,l=kp({path:e,activeOnSubpath:n}),u=r!==void 0?r:l,{isMobile:f,setOpenMobile:O}=Gn(),h=()=>{f&&O(!1)};return z.jsx(E3,{asChild:!0,isActive:u,...i,children:z.jsx("a",{href:t==="_blank"?e:b,rel:t==="_blank"?o??"noopener noreferrer":o,target:t,"aria-current":u?"page":void 0,onClick:h,children:a})})}function hr0({children:e,...t}){return z.jsx("span",{...t,children:e})}function qr0({onClick:e,children:t,...o}){const{isMobile:n,setOpenMobile:r}=Gn(),a=()=>{n&&r(!1),e?.()};return z.jsx(E3,{onClick:a,...o,children:t})}U0.Link=Ar0;U0.Label=hr0;U0.Button=qr0;function mr0({...e}){const{data:t}=ye(),{data:o}=Y3(),n=Tt(o?.settings,"social_web_enabled")??!1,a=X3().data?.site.url,{data:i=0}=av(t?.slug||"",n),b=kp({path:"network",activeOnSubpath:!0}),l=kp({path:"activitypub",activeOnSubpath:!0}),u=i>0&&!b&&!l;return!t||!ee0(t)?null:z.jsx(nc,{...e,children:z.jsx(Fa,{children:z.jsxs(rc,{children:[z.jsx(U0,{children:z.jsxs(U0.Link,{to:"analytics",activeOnSubpath:!0,children:[z.jsx(O9,{}),z.jsx(U0.Label,{children:"Analytics"})]})}),n&&z.jsxs(U0,{children:[z.jsxs(U0.Link,{to:"network",isActive:b||l,children:[z.jsx(fr0,{}),z.jsx(U0.Label,{children:"Network"})]}),u&&z.jsx(Zd,{children:i})]}),z.jsxs(U0,{className:"relative group/viewsite",children:[z.jsxs(U0.Link,{to:"site",children:[z.jsx(aZ,{}),z.jsx(U0.Label,{children:"View site"})]}),z.jsx("a",{href:a,target:"_blank","aria-label":"View site in new tab",rel:"noopener noreferrer",className:"absolute opacity-0 group-hover/viewsite:opacity-100 right-0 top-0 size-8 hover:bg-sidebar-accent flex items-center justify-center rounded-full text-gray-700 hover:text-sidebar-accent-foreground transition-all",children:z.jsx(dd,{size:16})})]})]})})})}function gr0({isExpanded:e,children:t,id:o}){return z.jsx("div",{id:o,className:`grid transition-all duration-200 ease-out ${e?"grid-rows-[1fr] mb-5":"grid-rows-[0fr] mb-0"}`,children:z.jsx("div",{className:"overflow-hidden",children:t})})}const Wr0="MembersResponseType",vr0=Hn({dataType:Wr0,path:"/members/"}),Wa0=Zt({method:"POST",path:({id:e})=>`/members/${e}/commenting/disable`,body:({reason:e})=>({reason:e}),invalidateQueries:{dataType:"CommentsResponseType"}}),va0=Zt({method:"POST",path:({id:e})=>`/members/${e}/commenting/enable`,body:()=>({}),invalidateQueries:{dataType:"CommentsResponseType"}});function Rr0(){const{data:e}=vr0({searchParams:{limit:"1"}});return e?.meta?.pagination.total}const yr0=()=>G3({select:e=>e.navigation}),wr0=()=>{const{mutateAsync:e}=K3();return Y1({mutationFn:async t=>{await e({navigation:t})}})},Lr0=e=>{const{data:t}=yr0(),{mutateAsync:o}=wr0();return[t?.expanded[e]??!0,async a=>o({expanded:{[e]:a}})]},xr0=yp({name:s2(),route:s2(),color:s2(),icon:s2().optional(),filter:Qo0(s2(),s2().nullable())}),kr0=e5(xr0);function Cr0(e){return{midgrey:"#7C8B9A",blue:"#14b8ff",green:"#30cf43",red:"#f50b23",teal:"#4dcddc",purple:"#8e42ff",yellow:"#ffb41f",orange:"#fe8b05",pink:"#fb2d8d"}[e]||"#7C8B9A"}function Nr0({route:e="posts"}){const{data:t}=Y3(),o=zW(),n=p.useMemo(()=>{const r=Tt(t?.settings,"shared_views")??"[]";try{const a=JSON.parse(r),i=kr0.safeParse(a);return i.success?i.data.filter(b=>b.route===e):(console.error("Failed to validate shared_views setting:",i.error),[])}catch(a){return console.error("Failed to parse shared_views setting:",a),[]}},[t,e]);return n.length===0?null:z.jsx(z.Fragment,{children:n.map(r=>{const a=o.getRouteUrl(e,r.filter),i=o.isRouteActive(e,r.filter);return z.jsx(U0,{children:z.jsxs(U0.Link,{className:"pl-9",to:a,isActive:i,children:[z.jsx(U0.Label,{className:"grow",children:r.name}),z.jsx("span",{className:"size-2 rounded-full shrink-0 mx-0.5",style:{backgroundColor:Cr0(r.color)},"data-color":r.color,"aria-hidden":"true"})]})},a)})})}const b5=e=>{const{data:t}=Ha();return t?.config.labs?.[e]??!1};function Br0({...e}){const{data:t}=ye(),[o,n]=Lr0("posts"),r=Rr0(),a=zW(),i=b5("commentModeration"),b=t&&J10(t),l=t&&Y10(t);return z.jsx(nc,{...e,children:z.jsx(Fa,{children:z.jsxs(rc,{children:[z.jsxs(U0,{children:[z.jsx(o1,{"aria-controls":"posts-submenu","aria-expanded":o,"aria-label":"Toggle post views",variant:"ghost",size:"icon",className:"!h-[34px] absolute sidebar:opacity-0 group-hover/menu-item:opacity-100 focus-visible:opacity-100 transition-all left-3 top-0 p-0 h-9 w-auto text-sidebar-accent-foreground hover:text-gray-black hover:bg-transparent",onClick:()=>void n(!o),children:z.jsx(ud,{size:16,className:`transition-all ${o&&"rotate-[90deg]"}`})}),z.jsxs(U0.Link,{to:a.getRouteUrl("posts"),isActive:a.isRouteActive("posts"),children:[z.jsx(M9,{className:"opacity-0 sidebar:opacity-100 sidebar:group-hover/menu-item:opacity-0 pointer-events-none transition-all"}),z.jsx(U0.Label,{children:"Posts"})]}),z.jsx("a",{href:"#/editor/post","aria-label":"Create new post",className:"flex items-center justify-center absolute hover:bg-sidebar-accent transition-all rounded-full right-0 top-0 p-0 size-8 text-gray-700 hover:text-sidebar-accent-foreground",children:z.jsx(b9,{size:20,className:"!stroke-[1.5px] mt-px"})})]}),z.jsxs(gr0,{isExpanded:o,id:"posts-submenu",children:[z.jsx(U0,{children:z.jsx(U0.Link,{className:"pl-9",to:"posts?type=draft",isActive:a.isRouteActive("posts",{type:"draft"}),children:z.jsx(U0.Label,{children:"Drafts"})})}),z.jsx(U0,{children:z.jsx(U0.Link,{className:"pl-9",to:"posts?type=scheduled",isActive:a.isRouteActive("posts",{type:"scheduled"}),children:z.jsx(U0.Label,{children:"Scheduled"})})}),z.jsx(U0,{children:z.jsx(U0.Link,{className:"pl-9",to:"posts?type=published",isActive:a.isRouteActive("posts",{type:"published"}),children:z.jsx(U0.Label,{children:"Published"})})}),z.jsx(Nr0,{})]}),z.jsx(U0,{children:z.jsxs(U0.Link,{to:a.getRouteUrl("pages"),isActive:a.isRouteActive("pages"),children:[z.jsx(jZ,{}),z.jsx(U0.Label,{children:"Pages"})]})}),b&&z.jsx(U0,{children:z.jsxs(U0.Link,{to:"tags",isActive:a.isRouteActive(["tags","tag","tag.new"]),children:[z.jsx(gG,{}),z.jsx(U0.Label,{children:"Tags"})]})}),l&&z.jsxs(U0,{children:[z.jsxs(U0.Link,{to:a.getRouteUrl("members"),isActive:a.isRouteActive(["members","member","member.new"]),children:[z.jsx(f9,{}),z.jsx(U0.Label,{children:"Members"})]}),r!=null&&z.jsx(Zd,{children:r})]}),l&&i&&z.jsx(U0,{children:z.jsxs(U0.Link,{to:"comments",activeOnSubpath:!0,children:[z.jsx(rG,{}),z.jsx(U0.Label,{children:"Comments"})]})})]})})})}const RA=function(){let t,o;return{promise:new Promise((r,a)=>{t=r,o=a}),resolve:t,reject:o}},Rl="https://do.featurebase.app/js/sdk.js",_r0="Feature Request";let ea=null;function Er0(){return ea||(ea=new Promise((e,t)=>{if(document.querySelector(`script[src="${Rl}"]`)){e();return}const n=document.createElement("script");n.src=Rl,n.onload=()=>e(),n.onerror=r=>{n.remove(),ea=null;const a=new Error(`[Featurebase] Failed to load SDK from ${Rl}`,{cause:r});console.error(a),t(a)},document.head.appendChild(n)})),ea}function Sr0(){const{data:e}=Ha(),{data:t}=G3(),o=b5("featurebaseFeedback"),[n,r]=p.useState(!1),{organization:a,enabled:i}=e?.config.featurebase??{},b=!!(o&&i),l=t?.nightShift?"dark":"light",{data:u}=E10({enabled:b&&n}),f=u?.featurebase?.token;p.useEffect(()=>{n&&Er0().catch(g=>{console.error("[Featurebase] Failed to load SDK:",g)})},[n]);const O=p.useRef(RA());p.useEffect(()=>{!n||!a||!f||ea?.then(()=>{window.Featurebase?.("initialize_feedback_widget",{organization:a,theme:l,defaultBoard:_r0,featurebaseJwt:f},g=>{g?(console.error("[Featurebase] Failed to initialize widget:",g),O.current.reject(g),O.current=RA(),r(!1)):O.current.resolve()})})},[a,l,f,n]);const h=p.useCallback(()=>{b&&r(!0)},[b]);return{openFeedbackWidget:p.useCallback(g=>{b&&(r(!0),O.current.promise.then(()=>{window.postMessage({target:"FeaturebaseWidget",data:{action:"openFeedbackWidget",...g?.board&&{setBoard:g.board}}},"*")}))},[b]),preloadFeedbackWidget:h}}function Tr0({...e}){const{data:t}=ye(),{data:o}=Ha(),n=b5("featurebaseFeedback"),{openFeedbackWidget:r,preloadFeedbackWidget:a}=Sr0();if(!t)return null;const b=o?.config.hostSettings?.billing?.enabled&&Va(t),l=n&&!P3(t)&&o?.config.featurebase?.enabled;return!b&&!l?null:z.jsx(nc,{...e,children:z.jsx(Fa,{children:z.jsxs(rc,{children:[b&&z.jsx(U0,{children:z.jsxs(U0.Link,{to:"pro",children:[z.jsx(NZ,{}),z.jsx(U0.Label,{children:"Ghost(Pro)"})]})}),l&&z.jsx(U0,{children:z.jsxs(U0.Button,{onClick:r,onMouseEnter:a,onFocus:a,children:[z.jsx(Od,{}),z.jsx(U0.Label,{children:"Feedback"})]})})]})})})}function Pr0({...e}){const{data:t}=ye(),o=t&&K10(t);return z.jsx(nc,{...e,children:z.jsx(Fa,{children:z.jsxs(rc,{children:[o&&z.jsx(U0,{children:z.jsxs(U0.Link,{to:"settings",children:[z.jsx(z9,{}),z.jsx(U0.Label,{children:"Settings"})]})}),z.jsx(U0,{children:z.jsxs(U0.Link,{to:"https://ghost.org/help?utm_source=admin&utm_campaign=help",target:"_blank",rel:"noopener noreferrer",children:[z.jsx(yZ,{}),z.jsx(U0.Label,{children:"Help"})]})})]})})})}const Xr0=""+new URL("ghost-pro-logo-B1sXD_MX.png",import.meta.url).href;function jr0({trialDaysRemaining:e}){return z.jsxs(vd,{variant:"gradient",size:"lg",className:"mx-2 my-5 flex flex-col items-stretch",children:[z.jsx("div",{children:z.jsx("img",{src:Xr0,alt:"Ghost Pro",className:"max-h-[33px]"})}),z.jsx("div",{className:"text-base mt-3 font-semibold",children:"Unlock every feature"}),z.jsxs("div",{className:"mt-2 text-gray-700 text-sm mb-4",children:["Choose a plan to access the full power of Ghost right away, you have ",z.jsxs("span",{className:"font-semibold text-black",children:[e," days"]})," free trial remaining."]}),z.jsx(o1,{asChild:!0,children:z.jsx("a",{href:"#/pro/billing/plans",children:"Upgrade now"})})]})}function Dr0(){const{showUpgradeBanner:e,trialDaysRemaining:t}=QW();return z.jsxs(rW,{className:"px-3 pt-4 justify-between",children:[z.jsxs("div",{className:"flex flex-col gap-2 sidebar:gap-4",children:[z.jsx(mr0,{}),z.jsx(Br0,{}),z.jsx(Tr0,{})]}),z.jsxs("div",{className:"flex flex-col gap-2 sidebar:gap-4",children:[e?z.jsx(jr0,{trialDaysRemaining:t}):z.jsx(yn0,{}),z.jsx(Pr0,{className:"pb-0"})]})]})}function Ir0({...e}){return z.jsxs(Jg,{...e,children:[z.jsx(ce0,{className:"px-5 pt-6 pb-0"}),z.jsx(Dr0,{}),z.jsx(Rn0,{className:"p-3 gap-0"})]})}const ki=1.5;function yl({to:e,activeOnSubpath:t=!1,children:o,...n}){const r=kp({path:e,activeOnSubpath:t});return z.jsx(o1,{asChild:!0,className:`rounded-full w-full max-w-16 min-w-9 hover:bg-gray-200 ${r?"bg-gray-200":"bg-transparent"}`,...n,variant:"ghost",size:"icon","data-active":r,children:z.jsx("a",{href:e,children:o})})}function Fr0(){const{isMobile:e}=Gn();return e?z.jsx("div",{className:"fixed sidebar:hidden bottom-0 left-0 right-0 h-[var(--mobile-navbar-height)] bg-sidebar/80 backdrop-blur-md border-t border-sidebar-border z-50 safe-area-inset-bottom",children:z.jsxs("div",{className:"grid grid-cols-4 items-center w-full justify-items-center max-w-[300px] h-full mx-auto px-5",children:[z.jsxs(yl,{activeOnSubpath:!0,to:"analytics",children:[z.jsx(O9,{strokeWidth:ki}),z.jsx("span",{className:"sr-only",children:"Analytics"})]}),z.jsxs(yl,{activeOnSubpath:!0,to:"posts",children:[z.jsx(M9,{strokeWidth:ki}),z.jsx("span",{className:"sr-only",children:"Posts"})]}),z.jsxs(yl,{activeOnSubpath:!0,to:"members",children:[z.jsx(f9,{strokeWidth:ki}),z.jsx("span",{className:"sr-only",children:"Members"})]}),z.jsxs(eW,{className:"rounded-full px-8 h-9 hover:bg-transparent",children:[z.jsx(p9,{strokeWidth:ki}),z.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})]})}):z.jsx(z.Fragment,{})}function Hr0({children:e}){const{data:t}=ye(),o=H10();return t&&P3(t)?z.jsxs("div",{className:"relative h-full bg-background",children:[z.jsx("main",{className:"h-full overflow-auto",children:e}),z.jsx("div",{className:"fixed bottom-3.5 left-3.5 lg:bottom-8 lg:left-8 z-20",children:z.jsx(vn0,{})})]}):z.jsxs(Yg,{open:!!t&&o,children:[z.jsx(Ir0,{}),z.jsxs(tW,{className:"bg-background overflow-y-scroll max-h-[calc(100%-var(--mobile-navbar-height))] sidebar:max-h-full",children:[z.jsx("main",{className:"flex-1",children:e}),z.jsx(Fr0,{})]})]})}function Ur0(){const{data:e}=ye();return I10(),D10(),z.jsx(S10,{children:e?z.jsxs(Hr0,{children:[z.jsx(Cn,{}),z.jsx(Zf,{})]}):z.jsxs(z.Fragment,{children:[z.jsx(Rz,{}),z.jsx(Zf,{})]})})}const zv=p.createContext(void 0),Ra0=()=>{const e=p.useContext(zv);if(e===void 0)throw new Error("useAppContext must be used within an AppProvider");return e},Vr0=({children:e,value:t})=>{const o=p.useContext(cu),n=t.externalNavigate??o?.externalNavigate;if(!n)throw new Error("External navigate function is required");const r={externalNavigate:n,fromAnalytics:!1,...o,...t};return z.jsx(zv.Provider,{value:r,children:e})},$r0=[{path:"",errorElement:z.jsx(gp,{onBackToDashboard:()=>{}}),children:[{path:"posts/analytics/:postId",lazy:async()=>{const[{default:e},{default:t}]=await Promise.all([z1(()=>import("./post-analytics-context-BAVa6pkz.js").then(o=>o.p),__vite__mapDeps([37,38]),import.meta.url),z1(()=>import("./post-analytics-DemICx0T.js"),__vite__mapDeps([39,40,41,38,37]),import.meta.url)]);return{element:z.jsx(e,{children:z.jsx(t,{})})}},children:[{path:"",lazy:h1(()=>z1(()=>import("./overview-1aw3_iYw.js"),__vite__mapDeps([42,43,44,23,45,46,47,48,49,50,41,37,38,51,3,15,52,53,54,21,22,11,24,25,8,6,1,17,26,12,27,13,55,19,20,5,56,57,58,59]),import.meta.url))},{path:"web",lazy:h1(()=>z1(()=>import("./web-BxHOEYyW.js"),__vite__mapDeps([60,61,24,37,38,52,53,23,54,44,45,21,22,11,25,8,6,1,17,26,12,27,13,15,3,55,47,48,19,20,62,50,41,51,63,5]),import.meta.url))},{path:"growth",lazy:h1(()=>z1(()=>import("./growth-CTfPUXNh.js").then(e=>e.g),__vite__mapDeps([56,5,23,53,54,44,57,43,50,41,37,38,51,3,15,58,59]),import.meta.url))},{path:"newsletter",lazy:h1(()=>z1(()=>import("./newsletter-IlWRVsHS.js"),__vite__mapDeps([64,44,23,65,21,22,11,24,25,8,6,1,17,26,12,27,13,15,3,19,20,43,50,41,37,38,51,45,46,47,48,49,59]),import.meta.url))}]},{path:"tags",children:[{index:!0,lazy:h1(()=>z1(()=>import("./tags-CgR3Ypcp.js"),__vite__mapDeps([66,30,67,40,57,17,5]),import.meta.url))},{path:":tagSlug",element:null}]},{path:"comments",lazy:h1(()=>z1(()=>import("./comments-CtogcEO1.js"),__vite__mapDeps([68,63,24,38,67,40,13,5]),import.meta.url))},{path:"*",element:z.jsx(gp,{onBackToDashboard:()=>{}})}]}],Qr0={today:{name:"Today",value:1},last7Days:{name:"Last 7 days",value:7},last30Days:{name:"Last 30 days",value:31},last3Months:{name:"Last 90 days",value:91},yearToDate:{name:"Year to date",value:-1},last12Months:{name:"Last 12 months",value:372},allTime:{name:"All time",value:1e3}},Zr0=Object.values(Qr0),Gr0=2,ya0={US:"United States",TWN:"Taiwan",TW:"Taiwan","mobile-ios":"iOS","mobile-android":"Android",macos:"macOS","google.com":"Google","ghost.org":"Ghost","bing.com":"Bing","bsky.app":"Bluesky","yahoo.com":"Yahoo","duckduckgo.com":"DuckDuckGo",unknown:"Unknown",Others:"Unknown",Other:"Unknown",NULL:"Unknown","ᴺᵁᴸᴸ":"Unknown"},wa0=["NULL","ᴺᵁᴸᴸ","","Others","Other"],La0="https://static.ghost.org/v5.0.0/images/globe-icon.svg",Dr={PUBLIC:1,FREE:2,PAID:4},xa0=Dr.PUBLIC|Dr.FREE|Dr.PAID,ka0=[{name:"Public visitors",value:"undefined",bit:Dr.PUBLIC},{name:"Free members",value:"free",bit:Dr.FREE},{name:"Paid members",value:"paid",bit:Dr.PAID}],uv=p.createContext(void 0),Ca0=()=>{const e=p.useContext(uv);if(e===void 0)throw new Error("useGlobalData must be used within a GlobalDataProvider");return e},Kr0=({children:e})=>{const t=Y3(),o=X3(),n=Ha(),r=n.data?.config,a=!!r?.stats,i=XD({enabled:a}),[b,l]=p.useState(Zr0[Gr0].value),[u,f]=p.useState(null),O=[n,t,o],h=O.map(k=>k.error).find(Boolean),q=a?i.error:null,g=h||q,W=O.some(k=>k.isLoading),v=a?i.isLoading:!1,y=W||v;if(g)throw g;const x={url:o.data?.site.url,icon:o.data?.site.icon,title:o.data?.site.title};return z.jsx(uv.Provider,{value:{data:r,site:x,statsConfig:r?.stats,tinybirdToken:i.token,isLoading:y,range:b,setRange:l,settings:t.data?.settings||[],selectedNewsletterId:u,setSelectedNewsletterId:f},children:e})},Yr0=[{path:"analytics",children:[{index:!0,lazy:h1(()=>z1(()=>import("./index-mFLKOVzo.js"),__vite__mapDeps([69,70,61,24,44,23,15,21,22,11,25,8,6,1,17,26,12,27,13,3,5,41,51,55,47,48,71,72,59,58,38]),import.meta.url))},{path:"web",lazy:h1(()=>z1(()=>import("./index-GwDp7cne.js"),__vite__mapDeps([73,70,61,24,44,23,15,21,22,11,25,8,6,1,17,26,12,27,13,3,62,45,5,65,74,54,63,71,59,19,20,55,47,48]),import.meta.url))},{path:"growth",lazy:h1(()=>z1(()=>import("./index-fW_jLZOq.js"),__vite__mapDeps([75,70,61,24,44,23,15,21,22,11,25,8,6,1,17,26,12,27,13,3,5,55,47,48,19,20,71,76,57,74,58,54,59,77,49,72]),import.meta.url))},{path:"newsletters",lazy:h1(()=>z1(()=>import("./index-xYoJrUpW.js"),__vite__mapDeps([78,70,61,24,44,23,15,21,22,11,25,8,6,1,17,26,12,27,13,3,47,48,5,55,19,20,76,57,79,59]),import.meta.url))}]}],Jr0=[{element:z.jsx($10,{}),children:[{path:"/tags/:tagSlug",Component:Rz,handle:{allowInForceUpgrade:!0}},{element:z.jsx(Vr0,{value:{fromAnalytics:!0},children:z.jsx(Cn,{})}),children:$r0[0].children.filter(e=>e.path!=="*")},{element:z.jsx(Kr0,{children:z.jsx(Cn,{})}),children:Yr0},{path:"network",loader:()=>zI("/activitypub")},{path:"",element:z.jsx(wn0,{children:z.jsx(Cn,{})}),children:lv},{path:"settings/*",lazy:h1(()=>z1(()=>import("./settings-BUwtf2g_.js").then(e=>e.bo),__vite__mapDeps([80,20,79,38,77]),import.meta.url)),handle:{allowInForceUpgrade:!0}},{path:"*",Component:Rz,handle:{allowInForceUpgrade:!0}}]}],ec0=["http:","https:","mailto:","tel:"];function tc0(e){if(e.match(/^[a-z]+:/i))try{const t=new URL(e);return ec0.includes(t.protocol)?(window.location.href=e,!0):!1}catch{const t=e.startsWith("/")?e:`/${e}`;return window.location.hash=t,!0}else{const t=e.startsWith("/")?e:`/${e}`;return window.location.hash=t,!0}}function oc0({children:e}){const{data:t}=Y3(),o=p.useMemo(()=>{if(!t?.settings)return;const n=t.settings;return{paidMembersEnabled:Tt(n,"paid_members_enabled")??!1,newslettersEnabled:Tt(n,"editor_default_email_recipients")!=="disabled",analytics:{emailTrackOpens:Tt(n,"email_track_opens")??!1,emailTrackClicks:Tt(n,"email_track_clicks")??!1,membersTrackSources:Tt(n,"members_track_sources")??!1,outboundLinkTagging:Tt(n,"outbound_link_tagging")??!1,webAnalytics:Tt(n,"web_analytics_enabled")??!1}}},[t]);return z.jsx(_x,{appSettings:o,children:e})}const nc0={ghostVersion:"",externalNavigate:e=>{tc0(e.route)},unsplashConfig:{Authorization:"","Accept-Version":"","Content-Type":"","App-Pragma":"","X-Unsplash-Cache":!0},sentryDSN:null,onUpdate:(e,t)=>{window.EmberBridge?.state.onUpdate(e,t)},onInvalidate:e=>{window.EmberBridge?.state.onInvalidate(e)},onDelete:(e,t)=>{window.EmberBridge?.state.onDelete(e,t)}};ay.createRoot(document.getElementById("root")).render(z.jsx(p.StrictMode,{children:z.jsx(Bx,{...nc0,children:z.jsx(k10,{prefix:"/",routes:Jr0,children:z.jsx(oc0,{children:z.jsx(CK,{className:"shade-admin",darkMode:!1,fetchKoenigLexical:null,children:z.jsx(Ur0,{})})})})})}));export{i9 as $,jo as A,o1 as B,ud as C,W3 as D,Gc as E,or0 as F,ta0 as G,v2 as H,oa0 as I,ca0 as J,aa0 as K,ur0 as L,na0 as M,ra0 as N,y10 as O,So as P,e10 as Q,t10 as R,w1 as S,MZ as T,xp as U,ve as V,fa0 as W,qd as X,Aa0 as Y,ha0 as Z,aW as _,t3 as a,_n as a$,NK as a0,h9 as a1,q9 as a2,g9 as a3,W9 as a4,m9 as a5,R9 as a6,v9 as a7,O3 as a8,K9 as a9,V0 as aA,Pp as aB,z1 as aC,bh as aD,Z1 as aE,Ha as aF,X3 as aG,Y3 as aH,XD as aI,iZ as aJ,Tc0 as aK,Cn as aL,sW as aM,Bc0 as aN,Zm as aO,w10 as aP,dp as aQ,Ra0 as aR,Wc0 as aS,Rc0 as aT,Zr as aU,Su as aV,Vm as aW,p9 as aX,Pd as aY,Nc0 as aZ,Qm as a_,xd as aa,ZZ as ab,Hn as ac,Zt as ad,BD as ae,vc0 as af,Oc0 as ag,y0 as ah,hc0 as ai,zd as aj,ND as ak,Sc0 as al,uW as am,Jt as an,O9 as ao,$m as ap,Zh as aq,Yo as ar,_e as as,e2 as at,H0 as au,Kh as av,UX as aw,VX as ax,Q0 as ay,$t as az,eo as b,xc0 as b$,cW as b0,R2 as b1,xa0 as b2,ka0 as b3,Dr as b4,$p as b5,d7 as b6,Qh as b7,Y0 as b8,re as b9,za0 as bA,lZ as bB,Qc as bC,wi as bD,md as bE,gd as bF,Wd as bG,o10 as bH,_c0 as bI,Zg as bJ,c10 as bK,a10 as bL,s10 as bM,J00 as bN,Ac0 as bO,dc0 as bP,hd as bQ,Ca0 as bR,ac0 as bS,gc0 as bT,Nf as bU,Rn as bV,qa0 as bW,O00 as bX,f00 as bY,A00 as bZ,yg as b_,jx as ba,ij as bb,Bu as bc,Yr as bd,he as be,Qp as bf,Eu as bg,xa as bh,Ho as bi,La as bj,Vp as bk,O7 as bl,f7 as bm,hZ as bn,tn as bo,M5 as bp,c5 as bq,mZ as br,SZ as bs,ia0 as bt,In0 as bu,_n0 as bv,bv as bw,ua0 as bx,cc as by,FZ as bz,Zc as c,ev as c$,f9 as c0,gG as c1,we as c2,yA as c3,Xp as c4,U9 as c5,$9 as c6,h3 as c7,q3 as c8,fd as c9,qc0 as cA,Qr0 as cB,$Z as cC,Bf as cD,NZ as cE,Fz as cF,Zr0 as cG,BK as cH,fl as cI,TK as cJ,ba0 as cK,sa0 as cL,la0 as cM,Cp as cN,wa0 as cO,ya0 as cP,M9 as cQ,mc0 as cR,La0 as cS,yc0 as cT,br0 as cU,vr0 as cV,LZ as cW,Wa0 as cX,va0 as cY,Od as cZ,oG as c_,mJ as ca,gJ as cb,b9 as cc,Gm as cd,ng as ce,pc0 as cf,Uc0 as cg,Vc0 as ch,gW as ci,da0 as cj,d9 as ck,kG as cl,B3 as cm,aY as cn,yp as co,WA as cp,vA as cq,ma0 as cr,ga0 as cs,s2 as ct,$n0 as cu,JQ as cv,wc0 as cw,Lc0 as cx,fc0 as cy,PZ as cz,Li as d,sa as d$,Gn0 as d0,pa0 as d1,Ma0 as d2,rc0 as d3,YR as d4,jp as d5,kN as d6,x6 as d7,Z7 as d8,$c0 as d9,Va as dA,Pc0 as dB,dW as dC,Xc0 as dD,Dc0 as dE,K10 as dF,OW as dG,Ic0 as dH,T3 as dI,yh as dJ,ic0 as dK,cX as dL,C6 as dM,N6 as dN,Jz as dO,wu as dP,Wh as dQ,Mj as dR,R7 as dS,y7 as dT,w7 as dU,ek as dV,dD as dW,bc0 as dX,OD as dY,$7 as dZ,Kp as d_,Kc0 as da,ol as db,lc0 as dc,zc0 as dd,Yz as de,Fc0 as df,yD as dg,Jr as dh,ma as di,Gc0 as dj,$2 as dk,T10 as dl,P10 as dm,X10 as dn,Tt as dp,XP as dq,Hc0 as dr,oe0 as ds,Jc0 as dt,Zc0 as du,Qc0 as dv,K1 as dw,ee0 as dx,jc0 as dy,oz as dz,b0 as e,ye as e0,uc0 as e1,f1 as e2,mw as e3,Ec0 as e4,Q10 as e5,Yc0 as e6,P3 as e7,lh as e8,sc0 as e9,qh as ea,aZ as eb,OZ as ec,uZ as ed,vZ as ee,yZ as ef,kZ as eg,jZ as eh,UZ as ei,KZ as ej,JZ as ek,rG as el,aG as em,iG as en,bG as eo,l9 as ep,dG as eq,z9 as er,AG as es,u9 as et,yG as eu,Ad as ev,LG as ew,rZ as ex,mp as f,Xo as g,xo as h,ea0 as i,z as j,iv as k,Oa0 as l,r5 as m,i5 as n,Vi as o,a5 as p,Z9 as q,p as r,Dz as s,Xa as t,YI as u,Ld as v,kd as w,dd as x,g0 as y,Ea as z};
622
+ `)}q.write("payload.value = newResult;"),q.write("return payload;");const x=q.compile();return(k,L)=>x(h,k,L)};let a;const i=Wp,b=!AW.jitless,u=b&&se0.value,f=t.catchall;let O;e._zod.parse=(h,q)=>{O??(O=n.value);const g=h.value;return i(g)?b&&u&&q?.async===!1&&q.jitless!==!0?(a||(a=r(t.shape)),h=a(h,q),f?kW([],g,h,q,O,e):h):o(h,q):(h.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),h)}});function tA(e,t,o,n){for(const a of e)if(a.issues.length===0)return t.value=a.value,t;const r=e.filter(a=>!xr(a));return r.length===1?(t.value=r[0].value,r[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:o,errors:e.map(a=>a.issues.map(i=>Go(i,n,Zo())))}),t)}const U20=n0("$ZodUnion",(e,t)=>{V1.init(e,t),m1(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),m1(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),m1(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),m1(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){const r=t.options.map(a=>a._zod.pattern);return new RegExp(`^(${r.map(a=>Yd(a.source)).join("|")})$`)}});const o=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(r,a)=>{if(o)return n(r,a);let i=!1;const b=[];for(const l of t.options){const u=l._zod.run({value:r.value,issues:[]},a);if(u instanceof Promise)b.push(u),i=!0;else{if(u.issues.length===0)return u;b.push(u)}}return i?Promise.all(b).then(l=>tA(l,r,e,a)):tA(b,r,e,a)}}),V20=n0("$ZodIntersection",(e,t)=>{V1.init(e,t),e._zod.parse=(o,n)=>{const r=o.value,a=t.left._zod.run({value:r,issues:[]},n),i=t.right._zod.run({value:r,issues:[]},n);return a instanceof Promise||i instanceof Promise?Promise.all([a,i]).then(([l,u])=>oA(o,l,u)):oA(o,a,i)}});function Lz(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Vr(e)&&Vr(t)){const o=Object.keys(t),n=Object.keys(e).filter(a=>o.indexOf(a)!==-1),r={...e,...t};for(const a of n){const i=Lz(e[a],t[a]);if(!i.valid)return{valid:!1,mergeErrorPath:[a,...i.mergeErrorPath]};r[a]=i.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const o=[];for(let n=0;n<e.length;n++){const r=e[n],a=t[n],i=Lz(r,a);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};o.push(i.data)}return{valid:!0,data:o}}return{valid:!1,mergeErrorPath:[]}}function oA(e,t,o){if(t.issues.length&&e.issues.push(...t.issues),o.issues.length&&e.issues.push(...o.issues),xr(e))return e;const n=Lz(t.value,o.value);if(!n.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return e.value=n.data,e}const $20=n0("$ZodRecord",(e,t)=>{V1.init(e,t),e._zod.parse=(o,n)=>{const r=o.value;if(!Vr(r))return o.issues.push({expected:"record",code:"invalid_type",input:r,inst:e}),o;const a=[];if(t.keyType._zod.values){const i=t.keyType._zod.values;o.value={};for(const l of i)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){const u=t.valueType._zod.run({value:r[l],issues:[]},n);u instanceof Promise?a.push(u.then(f=>{f.issues.length&&o.issues.push(...kr(l,f.issues)),o.value[l]=f.value})):(u.issues.length&&o.issues.push(...kr(l,u.issues)),o.value[l]=u.value)}let b;for(const l in r)i.has(l)||(b=b??[],b.push(l));b&&b.length>0&&o.issues.push({code:"unrecognized_keys",input:r,inst:e,keys:b})}else{o.value={};for(const i of Reflect.ownKeys(r)){if(i==="__proto__")continue;const b=t.keyType._zod.run({value:i,issues:[]},n);if(b instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(b.issues.length){o.issues.push({code:"invalid_key",origin:"record",issues:b.issues.map(u=>Go(u,n,Zo())),input:i,path:[i],inst:e}),o.value[b.value]=b.value;continue}const l=t.valueType._zod.run({value:r[i],issues:[]},n);l instanceof Promise?a.push(l.then(u=>{u.issues.length&&o.issues.push(...kr(i,u.issues)),o.value[b.value]=u.value})):(l.issues.length&&o.issues.push(...kr(i,l.issues)),o.value[b.value]=l.value)}}return a.length?Promise.all(a).then(()=>o):o}}),Q20=n0("$ZodEnum",(e,t)=>{V1.init(e,t);const o=ae0(t.entries),n=new Set(o);e._zod.values=n,e._zod.pattern=new RegExp(`^(${o.filter(r=>ie0.has(typeof r)).map(r=>typeof r=="string"?j3(r):r.toString()).join("|")})$`),e._zod.parse=(r,a)=>{const i=r.value;return n.has(i)||r.issues.push({code:"invalid_value",values:o,input:i,inst:e}),r}}),Z20=n0("$ZodTransform",(e,t)=>{V1.init(e,t),e._zod.parse=(o,n)=>{if(n.direction==="backward")throw new fW(e.constructor.name);const r=t.transform(o.value,o);if(n.async)return(r instanceof Promise?r:Promise.resolve(r)).then(i=>(o.value=i,o));if(r instanceof Promise)throw new jr;return o.value=r,o}});function nA(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const G20=n0("$ZodOptional",(e,t)=>{V1.init(e,t),e._zod.optin="optional",e._zod.optout="optional",m1(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),m1(e._zod,"pattern",()=>{const o=t.innerType._zod.pattern;return o?new RegExp(`^(${Yd(o.source)})?$`):void 0}),e._zod.parse=(o,n)=>{if(t.innerType._zod.optin==="optional"){const r=t.innerType._zod.run(o,n);return r instanceof Promise?r.then(a=>nA(a,o.value)):nA(r,o.value)}return o.value===void 0?o:t.innerType._zod.run(o,n)}}),K20=n0("$ZodNullable",(e,t)=>{V1.init(e,t),m1(e._zod,"optin",()=>t.innerType._zod.optin),m1(e._zod,"optout",()=>t.innerType._zod.optout),m1(e._zod,"pattern",()=>{const o=t.innerType._zod.pattern;return o?new RegExp(`^(${Yd(o.source)}|null)$`):void 0}),m1(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(o,n)=>o.value===null?o:t.innerType._zod.run(o,n)}),Y20=n0("$ZodDefault",(e,t)=>{V1.init(e,t),e._zod.optin="optional",m1(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,n)=>{if(n.direction==="backward")return t.innerType._zod.run(o,n);if(o.value===void 0)return o.value=t.defaultValue,o;const r=t.innerType._zod.run(o,n);return r instanceof Promise?r.then(a=>rA(a,t)):rA(r,t)}});function rA(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const J20=n0("$ZodPrefault",(e,t)=>{V1.init(e,t),e._zod.optin="optional",m1(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,n)=>(n.direction==="backward"||o.value===void 0&&(o.value=t.defaultValue),t.innerType._zod.run(o,n))}),et0=n0("$ZodNonOptional",(e,t)=>{V1.init(e,t),m1(e._zod,"values",()=>{const o=t.innerType._zod.values;return o?new Set([...o].filter(n=>n!==void 0)):void 0}),e._zod.parse=(o,n)=>{const r=t.innerType._zod.run(o,n);return r instanceof Promise?r.then(a=>cA(a,e)):cA(r,e)}});function cA(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const tt0=n0("$ZodCatch",(e,t)=>{V1.init(e,t),m1(e._zod,"optin",()=>t.innerType._zod.optin),m1(e._zod,"optout",()=>t.innerType._zod.optout),m1(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,n)=>{if(n.direction==="backward")return t.innerType._zod.run(o,n);const r=t.innerType._zod.run(o,n);return r instanceof Promise?r.then(a=>(o.value=a.value,a.issues.length&&(o.value=t.catchValue({...o,error:{issues:a.issues.map(i=>Go(i,n,Zo()))},input:o.value}),o.issues=[]),o)):(o.value=r.value,r.issues.length&&(o.value=t.catchValue({...o,error:{issues:r.issues.map(a=>Go(a,n,Zo()))},input:o.value}),o.issues=[]),o)}}),ot0=n0("$ZodPipe",(e,t)=>{V1.init(e,t),m1(e._zod,"values",()=>t.in._zod.values),m1(e._zod,"optin",()=>t.in._zod.optin),m1(e._zod,"optout",()=>t.out._zod.optout),m1(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(o,n)=>{if(n.direction==="backward"){const a=t.out._zod.run(o,n);return a instanceof Promise?a.then(i=>gi(i,t.in,n)):gi(a,t.in,n)}const r=t.in._zod.run(o,n);return r instanceof Promise?r.then(a=>gi(a,t.out,n)):gi(r,t.out,n)}});function gi(e,t,o){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},o)}const CW=n0("$ZodCodec",(e,t)=>{V1.init(e,t),m1(e._zod,"values",()=>t.in._zod.values),m1(e._zod,"optin",()=>t.in._zod.optin),m1(e._zod,"optout",()=>t.out._zod.optout),m1(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(o,n)=>{if((n.direction||"forward")==="forward"){const a=t.in._zod.run(o,n);return a instanceof Promise?a.then(i=>Wi(i,t,n)):Wi(a,t,n)}else{const a=t.out._zod.run(o,n);return a instanceof Promise?a.then(i=>Wi(i,t,n)):Wi(a,t,n)}}});function Wi(e,t,o){if(e.issues.length)return e.aborted=!0,e;if((o.direction||"forward")==="forward"){const r=t.transform(e.value,e);return r instanceof Promise?r.then(a=>vi(e,a,t.out,o)):vi(e,r,t.out,o)}else{const r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(a=>vi(e,a,t.in,o)):vi(e,r,t.in,o)}}function vi(e,t,o,n){return e.issues.length?(e.aborted=!0,e):o._zod.run({value:t,issues:e.issues},n)}const nt0=n0("$ZodReadonly",(e,t)=>{V1.init(e,t),m1(e._zod,"propValues",()=>t.innerType._zod.propValues),m1(e._zod,"values",()=>t.innerType._zod.values),m1(e._zod,"optin",()=>t.innerType._zod.optin),m1(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(o,n)=>{if(n.direction==="backward")return t.innerType._zod.run(o,n);const r=t.innerType._zod.run(o,n);return r instanceof Promise?r.then(aA):aA(r)}});function aA(e){return e.value=Object.freeze(e.value),e}const rt0=n0("$ZodCustom",(e,t)=>{B2.init(e,t),V1.init(e,t),e._zod.parse=(o,n)=>o,e._zod.check=o=>{const n=o.value,r=t.fn(n);if(r instanceof Promise)return r.then(a=>sA(a,o,n,e));sA(r,o,n,e)}});function sA(e,t,o,n){if(!e){const r={code:"custom",input:o,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(r.params=n._zod.def.params),t.issues.push(Aa(r))}}class ct0{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...o){const n=o[0];if(this._map.set(t,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,t)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const o=this._map.get(t);return o&&typeof o=="object"&&"id"in o&&this._idmap.delete(o.id),this._map.delete(t),this}get(t){const o=t._zod.parent;if(o){const n={...this.get(o)??{}};delete n.id;const r={...n,...this._map.get(t)};return Object.keys(r).length?r:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function at0(){return new ct0}const Ri=at0();function st0(e,t){return new e({type:"string",...D0(t)})}function it0(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...D0(t)})}function iA(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...D0(t)})}function pt0(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...D0(t)})}function Mt0(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...D0(t)})}function bt0(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...D0(t)})}function lt0(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...D0(t)})}function zt0(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...D0(t)})}function ut0(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...D0(t)})}function dt0(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...D0(t)})}function Ot0(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...D0(t)})}function ft0(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...D0(t)})}function At0(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...D0(t)})}function ht0(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...D0(t)})}function qt0(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...D0(t)})}function mt0(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...D0(t)})}function gt0(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...D0(t)})}function Wt0(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...D0(t)})}function vt0(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...D0(t)})}function Rt0(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...D0(t)})}function yt0(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...D0(t)})}function wt0(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...D0(t)})}function Lt0(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...D0(t)})}function xt0(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...D0(t)})}function kt0(e,t){return new e({type:"string",format:"date",check:"string_format",...D0(t)})}function Ct0(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...D0(t)})}function Nt0(e,t){return new e({type:"string",format:"duration",check:"string_format",...D0(t)})}function Bt0(e,t){return new e({type:"boolean",...D0(t)})}function _t0(e){return new e({type:"unknown"})}function Et0(e,t){return new e({type:"never",...D0(t)})}function St0(e,t){return new e({type:"date",...D0(t)})}function Tt0(e,t){return new e20({check:"less_than",...D0(t),value:e,inclusive:!0})}function Pt0(e,t){return new t20({check:"greater_than",...D0(t),value:e,inclusive:!0})}function NW(e,t){return new o20({check:"max_length",...D0(t),maximum:e})}function Rp(e,t){return new n20({check:"min_length",...D0(t),minimum:e})}function BW(e,t){return new r20({check:"length_equals",...D0(t),length:e})}function Xt0(e,t){return new c20({check:"string_format",format:"regex",...D0(t),pattern:e})}function jt0(e){return new a20({check:"string_format",format:"lowercase",...D0(e)})}function Dt0(e){return new s20({check:"string_format",format:"uppercase",...D0(e)})}function It0(e,t){return new i20({check:"string_format",format:"includes",...D0(t),includes:e})}function Ft0(e,t){return new p20({check:"string_format",format:"starts_with",...D0(t),prefix:e})}function Ht0(e,t){return new M20({check:"string_format",format:"ends_with",...D0(t),suffix:e})}function $a(e){return new b20({check:"overwrite",tx:e})}function Ut0(e){return $a(t=>t.normalize(e))}function Vt0(){return $a(e=>e.trim())}function $t0(){return $a(e=>e.toLowerCase())}function Qt0(){return $a(e=>e.toUpperCase())}function Zt0(e,t,o){return new e({type:"array",element:t,...D0(o)})}function Gt0(e,t,o){return new e({type:"custom",check:"custom",fn:t,...D0(o)})}function Kt0(e){const t=Yt0(o=>(o.addIssue=n=>{if(typeof n=="string")o.issues.push(Aa(n,o.value,t._zod.def));else{const r=n;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=o.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),o.issues.push(Aa(r))}},e(o.value,o)));return t}function Yt0(e,t){const o=new B2({check:"custom",...D0(t)});return o._zod.check=e,o}function Jt0(e,t){const o=D0(t);let n=o.truthy??["true","1","yes","on","y","enabled"],r=o.falsy??["false","0","no","off","n","disabled"];o.case!=="sensitive"&&(n=n.map(q=>typeof q=="string"?q.toLowerCase():q),r=r.map(q=>typeof q=="string"?q.toLowerCase():q));const a=new Set(n),i=new Set(r),b=e.Codec??CW,l=e.Boolean??LW,u=e.String??$3,f=new u({type:"string",error:o.error}),O=new l({type:"boolean",error:o.error}),h=new b({type:"pipe",in:f,out:O,transform:((q,g)=>{let W=q;return o.case!=="sensitive"&&(W=W.toLowerCase()),a.has(W)?!0:i.has(W)?!1:(g.issues.push({code:"invalid_value",expected:"stringbool",values:[...a,...i],input:g.value,inst:h,continue:!1}),{})}),reverseTransform:((q,g)=>q===!0?n[0]||"true":r[0]||"false"),error:o.error});return h}const eo0=n0("ZodISODateTime",(e,t)=>{R20.init(e,t),$1.init(e,t)});function _W(e){return xt0(eo0,e)}const to0=n0("ZodISODate",(e,t)=>{y20.init(e,t),$1.init(e,t)});function oo0(e){return kt0(to0,e)}const no0=n0("ZodISOTime",(e,t)=>{w20.init(e,t),$1.init(e,t)});function ro0(e){return Ct0(no0,e)}const co0=n0("ZodISODuration",(e,t)=>{L20.init(e,t),$1.init(e,t)});function ao0(e){return Nt0(co0,e)}const so0=(e,t)=>{gW.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:o=>Ae0(e,o)},flatten:{value:o=>fe0(e,o)},addIssue:{value:o=>{e.issues.push(o),e.message=JSON.stringify(e.issues,wz,2)}},addIssues:{value:o=>{e.issues.push(...o),e.message=JSON.stringify(e.issues,wz,2)}},isEmpty:{get(){return e.issues.length===0}}})},_2=n0("ZodError",so0,{Parent:Error}),io0=I3(_2),po0=F3(_2),Mo0=H3(_2),bo0=U3(_2),lo0=me0(_2),zo0=ge0(_2),uo0=We0(_2),do0=ve0(_2),Oo0=Re0(_2),fo0=ye0(_2),Ao0=we0(_2),ho0=Le0(_2),ce=n0("ZodType",(e,t)=>(V1.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...o)=>e.clone(Yn(t,{checks:[...t.checks??[],...o.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]})),e.clone=(o,n)=>on(e,o,n),e.brand=()=>e,e.register=((o,n)=>(o.add(e,n),e)),e.parse=(o,n)=>io0(e,o,n,{callee:e.parse}),e.safeParse=(o,n)=>Mo0(e,o,n),e.parseAsync=async(o,n)=>po0(e,o,n,{callee:e.parseAsync}),e.safeParseAsync=async(o,n)=>bo0(e,o,n),e.spa=e.safeParseAsync,e.encode=(o,n)=>lo0(e,o,n),e.decode=(o,n)=>zo0(e,o,n),e.encodeAsync=async(o,n)=>uo0(e,o,n),e.decodeAsync=async(o,n)=>do0(e,o,n),e.safeEncode=(o,n)=>Oo0(e,o,n),e.safeDecode=(o,n)=>fo0(e,o,n),e.safeEncodeAsync=async(o,n)=>Ao0(e,o,n),e.safeDecodeAsync=async(o,n)=>ho0(e,o,n),e.refine=(o,n)=>e.check(Mn0(o,n)),e.superRefine=o=>e.check(bn0(o)),e.overwrite=o=>e.check($a(o)),e.optional=()=>MA(e),e.nullable=()=>bA(e),e.nullish=()=>MA(bA(e)),e.nonoptional=o=>nn0(e,o),e.array=()=>e5(e),e.or=o=>Ho0([e,o]),e.and=o=>Vo0(e,o),e.transform=o=>lA(e,Ko0(o)),e.default=o=>en0(e,o),e.prefault=o=>on0(e,o),e.catch=o=>cn0(e,o),e.pipe=o=>lA(e,o),e.readonly=()=>in0(e),e.describe=o=>{const n=e.clone();return Ri.add(n,{description:o}),n},Object.defineProperty(e,"description",{get(){return Ri.get(e)?.description},configurable:!0}),e.meta=(...o)=>{if(o.length===0)return Ri.get(e);const n=e.clone();return Ri.add(n,o[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),EW=n0("_ZodString",(e,t)=>{$3.init(e,t),ce.init(e,t);const o=e._zod.bag;e.format=o.format??null,e.minLength=o.minimum??null,e.maxLength=o.maximum??null,e.regex=(...n)=>e.check(Xt0(...n)),e.includes=(...n)=>e.check(It0(...n)),e.startsWith=(...n)=>e.check(Ft0(...n)),e.endsWith=(...n)=>e.check(Ht0(...n)),e.min=(...n)=>e.check(Rp(...n)),e.max=(...n)=>e.check(NW(...n)),e.length=(...n)=>e.check(BW(...n)),e.nonempty=(...n)=>e.check(Rp(1,...n)),e.lowercase=n=>e.check(jt0(n)),e.uppercase=n=>e.check(Dt0(n)),e.trim=()=>e.check(Vt0()),e.normalize=(...n)=>e.check(Ut0(...n)),e.toLowerCase=()=>e.check($t0()),e.toUpperCase=()=>e.check(Qt0())}),SW=n0("ZodString",(e,t)=>{$3.init(e,t),EW.init(e,t),e.email=o=>e.check(it0(qo0,o)),e.url=o=>e.check(zt0(mo0,o)),e.jwt=o=>e.check(Lt0(So0,o)),e.emoji=o=>e.check(ut0(go0,o)),e.guid=o=>e.check(iA(pA,o)),e.uuid=o=>e.check(pt0(yi,o)),e.uuidv4=o=>e.check(Mt0(yi,o)),e.uuidv6=o=>e.check(bt0(yi,o)),e.uuidv7=o=>e.check(lt0(yi,o)),e.nanoid=o=>e.check(dt0(Wo0,o)),e.guid=o=>e.check(iA(pA,o)),e.cuid=o=>e.check(Ot0(vo0,o)),e.cuid2=o=>e.check(ft0(Ro0,o)),e.ulid=o=>e.check(At0(yo0,o)),e.base64=o=>e.check(Rt0(Bo0,o)),e.base64url=o=>e.check(yt0(_o0,o)),e.xid=o=>e.check(ht0(wo0,o)),e.ksuid=o=>e.check(qt0(Lo0,o)),e.ipv4=o=>e.check(mt0(xo0,o)),e.ipv6=o=>e.check(gt0(ko0,o)),e.cidrv4=o=>e.check(Wt0(Co0,o)),e.cidrv6=o=>e.check(vt0(No0,o)),e.e164=o=>e.check(wt0(Eo0,o)),e.datetime=o=>e.check(_W(o)),e.date=o=>e.check(oo0(o)),e.time=o=>e.check(ro0(o)),e.duration=o=>e.check(ao0(o))});function s2(e){return st0(SW,e)}const $1=n0("ZodStringFormat",(e,t)=>{I1.init(e,t),EW.init(e,t)}),qo0=n0("ZodEmail",(e,t)=>{O20.init(e,t),$1.init(e,t)}),pA=n0("ZodGUID",(e,t)=>{u20.init(e,t),$1.init(e,t)}),yi=n0("ZodUUID",(e,t)=>{d20.init(e,t),$1.init(e,t)}),mo0=n0("ZodURL",(e,t)=>{f20.init(e,t),$1.init(e,t)}),go0=n0("ZodEmoji",(e,t)=>{A20.init(e,t),$1.init(e,t)}),Wo0=n0("ZodNanoID",(e,t)=>{h20.init(e,t),$1.init(e,t)}),vo0=n0("ZodCUID",(e,t)=>{q20.init(e,t),$1.init(e,t)}),Ro0=n0("ZodCUID2",(e,t)=>{m20.init(e,t),$1.init(e,t)}),yo0=n0("ZodULID",(e,t)=>{g20.init(e,t),$1.init(e,t)}),wo0=n0("ZodXID",(e,t)=>{W20.init(e,t),$1.init(e,t)}),Lo0=n0("ZodKSUID",(e,t)=>{v20.init(e,t),$1.init(e,t)}),xo0=n0("ZodIPv4",(e,t)=>{x20.init(e,t),$1.init(e,t)}),ko0=n0("ZodIPv6",(e,t)=>{k20.init(e,t),$1.init(e,t)}),Co0=n0("ZodCIDRv4",(e,t)=>{C20.init(e,t),$1.init(e,t)}),No0=n0("ZodCIDRv6",(e,t)=>{N20.init(e,t),$1.init(e,t)}),Bo0=n0("ZodBase64",(e,t)=>{B20.init(e,t),$1.init(e,t)}),_o0=n0("ZodBase64URL",(e,t)=>{E20.init(e,t),$1.init(e,t)}),Eo0=n0("ZodE164",(e,t)=>{S20.init(e,t),$1.init(e,t)}),So0=n0("ZodJWT",(e,t)=>{P20.init(e,t),$1.init(e,t)}),TW=n0("ZodBoolean",(e,t)=>{LW.init(e,t),ce.init(e,t)});function xz(e){return Bt0(TW,e)}const To0=n0("ZodUnknown",(e,t)=>{X20.init(e,t),ce.init(e,t)});function kz(){return _t0(To0)}const Po0=n0("ZodNever",(e,t)=>{j20.init(e,t),ce.init(e,t)});function Xo0(e){return Et0(Po0,e)}const jo0=n0("ZodDate",(e,t)=>{D20.init(e,t),ce.init(e,t),e.min=(n,r)=>e.check(Pt0(n,r)),e.max=(n,r)=>e.check(Tt0(n,r));const o=e._zod.bag;e.minDate=o.minimum?new Date(o.minimum):null,e.maxDate=o.maximum?new Date(o.maximum):null});function Do0(e){return St0(jo0,e)}const Io0=n0("ZodArray",(e,t)=>{I20.init(e,t),ce.init(e,t),e.element=t.element,e.min=(o,n)=>e.check(Rp(o,n)),e.nonempty=o=>e.check(Rp(1,o)),e.max=(o,n)=>e.check(NW(o,n)),e.length=(o,n)=>e.check(BW(o,n)),e.unwrap=()=>e.element});function e5(e,t){return Zt0(Io0,e,t)}const PW=n0("ZodObject",(e,t)=>{H20.init(e,t),ce.init(e,t),m1(e,"shape",()=>t.shape),e.keyof=()=>Zo0(Object.keys(e._zod.def.shape)),e.catchall=o=>e.clone({...e._zod.def,catchall:o}),e.passthrough=()=>e.clone({...e._zod.def,catchall:kz()}),e.loose=()=>e.clone({...e._zod.def,catchall:kz()}),e.strict=()=>e.clone({...e._zod.def,catchall:Xo0()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=o=>le0(e,o),e.safeExtend=o=>ze0(e,o),e.merge=o=>ue0(e,o),e.pick=o=>Me0(e,o),e.omit=o=>be0(e,o),e.partial=(...o)=>de0(XW,e,o[0]),e.required=(...o)=>Oe0(jW,e,o[0])});function yp(e,t){const o={type:"object",shape:e??{},...D0(t)};return new PW(o)}function Q3(e,t){return new PW({type:"object",shape:e,catchall:kz(),...D0(t)})}const Fo0=n0("ZodUnion",(e,t)=>{U20.init(e,t),ce.init(e,t),e.options=t.options});function Ho0(e,t){return new Fo0({type:"union",options:e,...D0(t)})}const Uo0=n0("ZodIntersection",(e,t)=>{V20.init(e,t),ce.init(e,t)});function Vo0(e,t){return new Uo0({type:"intersection",left:e,right:t})}const $o0=n0("ZodRecord",(e,t)=>{$20.init(e,t),ce.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function Qo0(e,t,o){return new $o0({type:"record",keyType:e,valueType:t,...D0(o)})}const Cz=n0("ZodEnum",(e,t)=>{Q20.init(e,t),ce.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const o=new Set(Object.keys(t.entries));e.extract=(n,r)=>{const a={};for(const i of n)if(o.has(i))a[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new Cz({...t,checks:[],...D0(r),entries:a})},e.exclude=(n,r)=>{const a={...t.entries};for(const i of n)if(o.has(i))delete a[i];else throw new Error(`Key ${i} not found in enum`);return new Cz({...t,checks:[],...D0(r),entries:a})}});function Zo0(e,t){const o=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Cz({type:"enum",entries:o,...D0(t)})}const Go0=n0("ZodTransform",(e,t)=>{Z20.init(e,t),ce.init(e,t),e._zod.parse=(o,n)=>{if(n.direction==="backward")throw new fW(e.constructor.name);o.addIssue=a=>{if(typeof a=="string")o.issues.push(Aa(a,o.value,t));else{const i=a;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=o.value),i.inst??(i.inst=e),o.issues.push(Aa(i))}};const r=t.transform(o.value,o);return r instanceof Promise?r.then(a=>(o.value=a,o)):(o.value=r,o)}});function Ko0(e){return new Go0({type:"transform",transform:e})}const XW=n0("ZodOptional",(e,t)=>{G20.init(e,t),ce.init(e,t),e.unwrap=()=>e._zod.def.innerType});function MA(e){return new XW({type:"optional",innerType:e})}const Yo0=n0("ZodNullable",(e,t)=>{K20.init(e,t),ce.init(e,t),e.unwrap=()=>e._zod.def.innerType});function bA(e){return new Yo0({type:"nullable",innerType:e})}const Jo0=n0("ZodDefault",(e,t)=>{Y20.init(e,t),ce.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function en0(e,t){return new Jo0({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():qW(t)}})}const tn0=n0("ZodPrefault",(e,t)=>{J20.init(e,t),ce.init(e,t),e.unwrap=()=>e._zod.def.innerType});function on0(e,t){return new tn0({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():qW(t)}})}const jW=n0("ZodNonOptional",(e,t)=>{et0.init(e,t),ce.init(e,t),e.unwrap=()=>e._zod.def.innerType});function nn0(e,t){return new jW({type:"nonoptional",innerType:e,...D0(t)})}const rn0=n0("ZodCatch",(e,t)=>{tt0.init(e,t),ce.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function cn0(e,t){return new rn0({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const DW=n0("ZodPipe",(e,t)=>{ot0.init(e,t),ce.init(e,t),e.in=t.in,e.out=t.out});function lA(e,t){return new DW({type:"pipe",in:e,out:t})}const IW=n0("ZodCodec",(e,t)=>{DW.init(e,t),CW.init(e,t)});function an0(e,t,o){return new IW({type:"pipe",in:e,out:t,transform:o.decode,reverseTransform:o.encode})}const sn0=n0("ZodReadonly",(e,t)=>{nt0.init(e,t),ce.init(e,t),e.unwrap=()=>e._zod.def.innerType});function in0(e){return new sn0({type:"readonly",innerType:e})}const pn0=n0("ZodCustom",(e,t)=>{rt0.init(e,t),ce.init(e,t)});function Mn0(e,t={}){return Gt0(pn0,e,t)}function bn0(e){return Kt0(e)}const ln0=(...e)=>Jt0({Codec:IW,Boolean:TW,String:SW},...e),FW=an0(_W({offset:!0}),Do0(),{decode:e=>new Date(e),encode:e=>e.toISOString()}),zn0=Q3({slug:s2(),title:s2(),custom_excerpt:s2(),url:s2().url(),published_at:FW,featured:ln0(),feature_image:s2().url().optional(),html:s2().optional()}).transform(e=>({slug:e.slug,title:e.title,customExcerpt:e.custom_excerpt,url:e.url,publishedAt:e.published_at,featured:e.featured,featureImage:e.feature_image,html:e.html})),un0=yp({posts:e5(zn0).default([]),changelogUrl:s2().url().default("https://ghost.org/changelog")}).transform(e=>({entries:e.posts,changelogUrl:e.changelogUrl})),Z3=()=>x2({queryKey:["changelog"],queryFn:async()=>{const e=await fetch("https://ghost.org/changelog.json");if(!e.ok)throw new Error(`Failed to fetch changelog: ${e.status}`);const t=await e.json();return un0.parse(t)},staleTime:1/0});function zA(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function HW(e,t){const o={...e};for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)){const r=t[n],a=e[n];r!==void 0&&(zA(r)&&zA(a)?o[n]=HW(a,r):o[n]=r)}return o}const dn0=Q3({lastSeenDate:FW.optional().catch(void 0)}),uA={expanded:{posts:!0},menu:{visible:!0}},On0=Q3({expanded:yp({posts:xz()}),menu:yp({visible:xz()})}),Nz=Q3({whatsNew:dn0.optional().catch(void 0),nightShift:xz().optional(),navigation:On0.default(uA).catch(uA)}),UW=e=>["userPreferences",e?.id,e?.accessibility];function G3(e){const{data:t}=ye();return x2({...e,queryKey:UW(t),queryFn:()=>{if(!t)throw new Error("User not loaded");const o=t.accessibility||"{}",n=JSON.parse(o);return Nz.parse(n)},enabled:!!t,staleTime:1/0,cacheTime:0})}const K3=()=>{const e=f1(),{data:t}=ye(),{mutateAsync:o}=dW();return Y1({mutationFn:async n=>{if(!t)throw new Error("User is not loaded");const r=e.getQueryData(UW(t))??Nz.parse({}),a=HW(r,n),i=Nz.encode(a);await o({...t,accessibility:JSON.stringify(i)})}})};function fn0(){return{lastSeenDate:new Date}}const An0=(e,t)=>["whatsNew",e?.whatsNew?.lastSeenDate?.toISOString(),t?.publishedAt.toISOString()],VW=()=>{const{data:e,isSuccess:t}=G3(),{data:o,isSuccess:n}=Z3(),{mutateAsync:r}=K3(),a=!!e?.whatsNew?.lastSeenDate;p.useEffect(()=>{!a&&t&&r({whatsNew:fn0()})},[a,t,r]);const i=o?.entries[0];return x2({queryKey:An0(e,i),queryFn:()=>{if(!i)return{hasNew:!1,hasNewFeatured:!1};const b=e.whatsNew.lastSeenDate,l=i.publishedAt>b,u=l&&i.featured===!0;return{hasNew:l,hasNewFeatured:u}},enabled:n&&a,staleTime:1/0,cacheTime:0})},$W=()=>{const{data:e}=Z3(),{mutateAsync:t}=K3();return Y1({mutationFn:async()=>{const o=e?.entries[0];if(!o)return;const n={lastSeenDate:o.publishedAt};await t({whatsNew:n})}})};function hn0(e){return e.toLocaleDateString("en-GB",{day:"2-digit",month:"long",year:"numeric"})}function qn0({entry:e}){return z.jsxs("a",{className:"flex items-start gap-6 p-2 -mx-2 rounded-md hover:bg-muted/80 transition-colors","data-test-entry":!0,href:e.url,rel:"noopener noreferrer",target:"_blank",children:[e.featureImage&&z.jsx("img",{alt:e.title,className:"flex-shrink-0 w-40 h-[110px] object-cover rounded","data-test-entry-image":!0,src:e.featureImage}),z.jsxs("div",{className:"flex flex-col gap-2 min-w-0 flex-1",children:[z.jsx("h2",{className:"text-[17px] font-semibold text-foreground mt-1.5","data-test-entry-title":!0,children:e.title}),z.jsx("p",{className:"text-sm text-gray-700 leading-[1.45] line-clamp-2","data-test-entry-excerpt":!0,children:e.customExcerpt}),z.jsx("span",{className:"text-sm text-gray-600","data-test-entry-date":!0,children:hn0(e.publishedAt)})]})]})}function mn0({open:e,onOpenChange:t}){const{data:o}=Z3(),{mutate:n}=$W();return p.useEffect(()=>{e&&n()},[e,n]),z.jsx(W3,{open:e,onOpenChange:t,children:z.jsxs(Xa,{className:"max-w-2xl max-h-[85vh] flex flex-col","data-test-modal":"whats-new",role:"dialog","aria-modal":"true","aria-labelledby":"whats-new-modal-title",children:[z.jsx(Ld,{children:z.jsx(kd,{id:"whats-new-modal-title","data-test-modal-title":!0,className:"text-2xl tracking-tighter",children:"What’s new?"})}),o?z.jsxs(z.Fragment,{children:[z.jsx("section",{className:"flex-1 overflow-y-auto space-y-2 -mx-6 px-6","data-test-entries":!0,children:o.entries.map(r=>z.jsx(qn0,{entry:r},r.slug))}),z.jsxs(xd,{className:"flex-row justify-between sm:justify-between gap-3",children:[z.jsx(o1,{asChild:!0,variant:"outline",children:z.jsx("a",{href:`${o.changelogUrl}#/portal/signup`,rel:"noopener noreferrer",target:"_blank",children:"Turn on notifications"})}),z.jsx(o1,{asChild:!0,children:z.jsx("a",{href:o.changelogUrl,rel:"noopener noreferrer",target:"_blank",children:"All updates →"})})]})]}):z.jsx("div",{className:"flex-1 flex items-center justify-center py-12",children:z.jsx(mp,{size:"lg"})})]})})}function QW(){const e=lW(),t=!!e?.subscription?.isActiveTrial,o=e?.subscription?.trial_end?Math.ceil((new Date(e.subscription.trial_end).getTime()-Date.now())/(1e3*60*60*24)):0;return{showUpgradeBanner:t,trialDaysRemaining:o}}function gn0({children:e,...t}){return z.jsx("span",{className:"flex-1",...t,children:e})}const Ie=({children:e,...t})=>z.jsx(Qm,{className:"cursor-pointer text-base",asChild:!0,...t,children:e});Ie.Label=gn0;function wp(e){const t=ye();return z.jsxs(md,{...e,children:[t.data?.profile_image&&z.jsx(gd,{src:t.data?.profile_image}),z.jsx(Wd,{className:"text-foreground-muted hover:text-foreground",children:z.jsx(hd,{})})]})}function ZW({name:e,email:t,children:o}){return z.jsx("div",{className:"p-3",children:z.jsxs("div",{className:"flex items-center gap-3",children:[o,z.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[z.jsx("span",{className:"text-base font-semibold text-foreground truncate",children:e}),z.jsx("span",{className:"text-xs text-foreground-muted -mt-px truncate",children:t})]})]})})}function GW(){const e=ye();return z.jsx(Ie,{children:z.jsxs(Ea,{to:`/settings/staff/${e.data?.slug}`,children:[z.jsx(hd,{}),z.jsx(Ie.Label,{children:"Your profile"})]})})}function KW(){const{data:e}=G3(),{mutateAsync:t,isLoading:o}=K3(),n=r=>{t({nightShift:r})};return z.jsxs(Ie,{asChild:!1,onSelect:r=>{r.preventDefault(),n(!e?.nightShift)},children:[z.jsx(aG,{}),z.jsx(Ie.Label,{className:"flex-1",children:"Dark mode"}),z.jsx(ng,{size:"sm",checked:e?.nightShift??!1,disabled:o,onCheckedChange:n,onClick:r=>r.stopPropagation(),tabIndex:-1})]})}function YW(){const e=()=>{fetch("/ghost/api/admin/session",{method:"DELETE"}).then(()=>{window.location.href="/ghost"}).catch(t=>{console.error(t)})};return z.jsxs(Ie,{asChild:!1,onSelect:e,children:[z.jsx(KZ,{}),z.jsx(Ie.Label,{children:"Sign out"})]})}function Wn0(e){const t=ye(),{data:o}=VW(),{showUpgradeBanner:n}=QW();return z.jsxs(Vm,{...e,children:[z.jsx($m,{asChild:!0,className:"focus-visible:ring-0",children:z.jsxs(E3,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground","aria-label":"User menu",children:[z.jsxs("div",{className:"relative",children:[z.jsx(wp,{}),o?.hasNew&&z.jsx("span",{className:"absolute -top-0.5 -right-0.5",children:z.jsx(Qf,{variant:"success",size:"sm",label:"New updates available","data-test-whats-new-avatar-badge":!0})})]}),z.jsxs("div",{className:"grid flex-1 text-left text-base leading-tight",children:[z.jsx("span",{className:"truncate font-semibold",children:t.data?.name}),z.jsx("span",{className:"text-muted-foreground truncate text-xs -mt-px",children:t.data?.email})]}),z.jsx(vZ,{className:"ml-auto size-4 text-grey-700","data-test-nav":"arrow-down"})]})}),z.jsxs(Pd,{align:"start",sideOffset:10,className:`w-[var(--radix-dropdown-menu-trigger-width)] ${n?"shadow-[0_18px_80px_0_rgba(0,0,0,0.07),0_7.52px_33.422px_0_rgba(0,0,0,0.05),0_4.021px_17.869px_0_rgba(0,0,0,0.04),0_2.254px_10.017px_0_rgba(0,0,0,0.04),0_1.197px_5.32px_0_rgba(0,0,0,0.03),0_0.498px_2.214px_0_rgba(0,0,0,0.02)]":""}`,children:[z.jsx(ZW,{name:t.data?.name,email:t.data?.email,children:z.jsx(wp,{})}),z.jsx(_n,{}),z.jsxs(Ie,{"data-test-nav":"whatsnew",asChild:!1,onSelect:()=>{queueMicrotask(()=>e.onOpenWhatsNew?.())},children:[z.jsx(u9,{}),z.jsx(Ie.Label,{children:"What’s new?"}),o?.hasNew&&z.jsx("div",{className:"flex-1 flex justify-end",children:z.jsx(Qf,{variant:"success",size:"sm",label:"New updates available","data-test-whats-new-menu-badge":!0})})]}),z.jsx(GW,{}),z.jsx(_n,{}),z.jsx(Ie,{children:z.jsxs("a",{href:"https://ghost.org/resources?utm_source=admin&utm_campaign=resources",target:"_blank",rel:"noopener noreferrer",children:[z.jsx(OZ,{}),z.jsx(Ie.Label,{children:"Resources & guides"})]})}),z.jsx(KW,{}),z.jsx(_n,{}),z.jsx(YW,{})]})]})}function vn0(){const e=ye(),o=X3().data?.site.url??"";return z.jsxs(Vm,{children:[z.jsx($m,{asChild:!0,children:z.jsx("button",{className:"rounded-full shadow-lg hover:shadow-xl transition-shadow focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 p-0.5 flex items-center justify-center border border-border dark:bg-muted bg-background","aria-label":"Open user menu",children:z.jsx(wp,{className:"w-11 h-11"})})}),z.jsxs(Pd,{align:"start",side:"top",sideOffset:10,className:"w-[var(--radix-dropdown-menu-trigger-width)] mb-2",children:[z.jsx(ZW,{name:e.data?.name,email:e.data?.email,children:z.jsx(wp,{})}),z.jsx(_n,{}),z.jsx(Ie,{children:z.jsxs(Ea,{to:"/",children:[z.jsx(PZ,{}),z.jsx(Ie.Label,{children:"Posts"})]})}),z.jsx(Ie,{children:z.jsxs("a",{href:o,target:"_blank",rel:"noopener noreferrer",children:[z.jsx(dd,{}),z.jsx(Ie.Label,{children:"View site"})]})}),z.jsx(_n,{}),z.jsx(GW,{}),z.jsx(KW,{}),z.jsx(_n,{}),z.jsx(YW,{})]})]})}function Rn0({...e}){const[t,o]=p.useState(!1);return z.jsxs(z.Fragment,{children:[z.jsx(nW,{...e,children:z.jsx(nc,{children:z.jsx(rc,{children:z.jsx(Qd,{children:z.jsx(Wn0,{onOpenWhatsNew:()=>o(!0)})})})})}),z.jsx(mn0,{open:t,onOpenChange:o})]})}function yn0(){const{data:e}=VW(),{data:t}=Z3(),{mutate:o}=$W(),[n,r]=p.useState(!1);if(n||!e?.hasNewFeatured)return null;const a=t?.entries[0];if(!a)return null;const i=()=>{r(!0),o()},b=()=>{o()};return z.jsx(vd,{"data-test-toast":"whats-new",role:"status","aria-label":"What’s new notification","aria-live":"polite",variant:"gradient",dismissible:!0,onDismiss:i,children:z.jsxs("a",{href:a.url,target:"_blank",rel:"noopener noreferrer",className:"block pr-8",onClick:b,"data-test-toast-link":!0,children:[z.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[z.jsx(u9,{className:"size-4 text-purple-600"}),z.jsx("span",{className:"text-xs font-semibold text-gray-700 uppercase tracking-wide",children:"What’s new?"})]}),z.jsx("div",{className:"text-base font-semibold text-gray-900 mb-1","data-test-toast-title":!0,children:a.title}),z.jsx("div",{className:"text-sm text-gray-700","data-test-toast-excerpt":!0,children:a.customExcerpt})]})})}const Lp="SettingsResponseType",Y3=Hn({dataType:Lp,path:"/settings/",defaultSearchParams:{group:"site,theme,private,members,portal,newsletter,email,labs,slack,unsplash,views,firstpromoter,editor,comments,analytics,announcement,pintura,donations,security,social_web,explore,transistor"}}),$c0=Zt({method:"PUT",path:()=>"/settings/",body:e=>({settings:e.map(({key:t,value:o})=>({key:t,value:o}))}),updateQueries:{dataType:Lp,emberUpdateType:"createOrUpdate",update:e=>({...e,settings:e.settings})},invalidateQueries:{filters:{predicate(e){return e.queryKey[0]!==Lp}}}}),Qc0=Zt({method:"DELETE",path:()=>"/settings/stripe/connect/",invalidateQueries:{dataType:Lp}}),Zc0=Zt({method:"POST",path:()=>"/slack/test/"});function Gc0(e){const t=["API","CTA","RSS"];return e.replace(/^[a-z]/,o=>o.toUpperCase()).replace(/_/g," ").replace(new RegExp(`\\b(${t.join("|")})\\b`,"ig"),o=>o.toUpperCase())}function Kc0(e,t){return t.map(o=>{var n;return(n=e?.find(r=>r.key===o))==null?void 0:n.value})}function Tt(e,t){if(!e)return null;const o=e.find(n=>n.key===t);return o?.value||null}function Yc0(e,t){if(!e)return;const o=e.find(n=>n.key===t);return o?.is_read_only||!1}function Jc0(e,t){const o=a=>e.some(i=>i.key===a&&i.value),n=o("stripe_secret_key")&&o("stripe_publishable_key"),r=o("stripe_connect_secret_key")&&o("stripe_connect_publishable_key");return t.stripeDirect?n:r||n}const t5=[],JW=p.createContext(void 0),wn0=({children:e})=>{const t=we(),[o,n]=p.useState(()=>{const i=localStorage.getItem("featureFlags");return i?JSON.parse(i):Ln0()});p.useEffect(()=>{const i=xn0(t.search);Object.keys(i).length>0&&n(b=>{const l={...b,...i};return localStorage.setItem("featureFlags",JSON.stringify(l)),l})},[t.search]);const a={isEnabled:i=>o[i]??!1,flags:o,allFlags:t5};return z.jsx(JW.Provider,{value:a,children:e})},Ln0=()=>t5.reduce((e,t)=>({...e,[t]:!1}),{}),xn0=e=>{const t=new URLSearchParams(e),o={};return t5.forEach(n=>{const r=t.get(n);r==="ON"?o[n]=!0:r==="OFF"&&(o[n]=!1)}),o},kn0=()=>{const e=p.useContext(JW);if(e===void 0)throw new Error("useFeatureFlags must be used within a FeatureFlagsProvider");return e};function J3(){const t=Hu().find(o=>o.handle==="activitypub-basepath")?.pathname??"";return t.endsWith("/")?t.slice(0,-1):t}function eo(){const e=sW(),t=J3();return p.useCallback((o,n)=>{if(typeof o=="number"){e(o,n);return}o.startsWith("/")?e(`${t}${o}`,n):e(o,n)},[e,t])}const ev=({className:e,onClick:t})=>{const o=eo(),{previousPath:n}=t3();return z.jsx(o1,{className:g0("size-9 rounded-full bg-white/85 px-2 backdrop-blur-md dark:bg-black/85 dark:text-white [&_svg]:size-6 focus-visible:ring-0",e),variant:"ghost",onClick:()=>{if(t){t();return}o(n?-1:"/")},children:z.jsx(iZ,{size:24,strokeWidth:1.25})})},Cn0=()=>{const e=we(),t=Pt(lv,e.pathname);if(!t)return null;const o=t.map(n=>n.route).filter(n=>n.pageTitle);return o[o.length-1]||t[t.length-1].route};function tv(){const e=Hu(),t=e.findIndex(l=>l.handle==="activitypub-basepath");if(t===-1)return"";const o=e[t+1];if(!o)return"";const r=e[t].pathname,a=o.pathname;let i=a.startsWith(r)?a.slice(r.length):a;return i=i.replace(/^\//,""),i.split("/")[0]}const Nn0=({title:e,backIcon:t})=>t?z.jsx(ev,{className:"-ml-2"}):z.jsx(cW,{className:"max-md:text-[2.4rem]",children:e}),dA=({onToggleMobileSidebar:e})=>z.jsx(o1,{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:z.jsx(JZ,{className:"!size-5"})}),Bn0=({onToggleMobileSidebar:e,showBorder:t=!0})=>{const{canGoBack:o}=t3(),n=tv(),r=C10(),a=Cn0();let i=!1;n==="profile"&&(i=!0),n==="notes"&&o&&(i=!0);const b=o&&r||a?.showBackButton===!0;return z.jsx(z.Fragment,{children:i?z.jsxs("div",{className:"sticky left-0 top-8 z-50 inline-block max-lg:flex max-lg:items-center max-lg:justify-between max-lg:pr-[15.5px] max-md:top-4",children:[z.jsx("div",{children:b&&z.jsx(ev,{className:"ml-6 max-md:ml-[10px]"})}),!b&&z.jsx(dA,{onToggleMobileSidebar:e})]}):z.jsx("div",{className:"sticky top-0 z-50 bg-white/85 backdrop-blur-md dark:bg-black",children:z.jsxs("div",{className:`relative flex h-[102px] items-center justify-between gap-5 px-[min(4vw,32px)] max-md:h-[68px] ${t?'before:absolute before:inset-x-[min(4vw,32px)] before:bottom-0 before:block before:border-b before:border-gray-200 before:content-[""] before:dark:border-gray-950':""}`,children:[z.jsx(Nn0,{backIcon:b,title:a?.pageTitle||""}),z.jsx(dA,{onToggleMobileSidebar:e})]})})})};function Xo(e){if(!e.preferredUsername||!e.id)return"@unknown@unknown";try{return`@${e.preferredUsername}@${new URL(e.id).hostname.replace(/^www\./,"")}`}catch{return"@unknown@unknown"}}var Bz=(e=>(e[e.Note=0]="Note",e[e.Article=1]="Article",e[e.Tombstone=2]="Tombstone",e))(Bz||{});const _n0=e=>typeof e=="object"&&e!==null&&"statusCode"in e&&"message"in e&&typeof e.statusCode=="number"&&typeof e.message=="string";class En0{constructor(t,o,n,r=window.fetch.bind(window)){this.apiUrl=t,this.authApiUrl=o,this.handle=n,this.fetch=r}async getToken(){try{return(await(await this.fetch(this.authApiUrl)).json())?.identities?.[0]?.token||null}catch{return null}}async fetchJSON(t,o="GET",n){const r=await this.getToken(),a={method:o,headers:{Authorization:`Bearer ${r}`,Accept:"application/activity+json"}};n&&(a.body=JSON.stringify(n),a.headers["Content-Type"]="application/json");const i=await this.fetch(t,a);if(i.status===204||i.status===202)return null;if(!i.ok){const b={message:"Something went wrong, please try again.",statusCode:i.status};try{const l=await i.json(),u=l.message||l.error;u&&(b.message=u),l.code&&(b.code=l.code)}catch{}throw b}return await i.json()}async blockDomain(t){const o=new URL(`.ghost/activitypub/v1/actions/block/domain/${encodeURIComponent(t.href)}`,this.apiUrl);return await this.fetchJSON(o,"POST"),!0}async unblockDomain(t){const o=new URL(`.ghost/activitypub/v1/actions/unblock/domain/${encodeURIComponent(t.href)}`,this.apiUrl);return await this.fetchJSON(o,"POST"),!0}async block(t){const o=new URL(`.ghost/activitypub/v1/actions/block/${encodeURIComponent(t.href)}`,this.apiUrl);return await this.fetchJSON(o,"POST"),!0}async unblock(t){const o=new URL(`.ghost/activitypub/v1/actions/unblock/${encodeURIComponent(t.href)}`,this.apiUrl);return await this.fetchJSON(o,"POST"),!0}async follow(t){const o=new URL(`.ghost/activitypub/v1/actions/follow/${t}`,this.apiUrl);return await this.fetchJSON(o,"POST")}async unfollow(t){const o=new URL(`.ghost/activitypub/v1/actions/unfollow/${t}`,this.apiUrl);return await this.fetchJSON(o,"POST")}async like(t){const o=new URL(`.ghost/activitypub/v1/actions/like/${encodeURIComponent(t)}`,this.apiUrl);await this.fetchJSON(o,"POST")}async unlike(t){const o=new URL(`.ghost/activitypub/v1/actions/unlike/${encodeURIComponent(t)}`,this.apiUrl);await this.fetchJSON(o,"POST")}async repost(t){const o=new URL(`.ghost/activitypub/v1/actions/repost/${encodeURIComponent(t)}`,this.apiUrl);await this.fetchJSON(o,"POST")}async derepost(t){const o=new URL(`.ghost/activitypub/v1/actions/derepost/${encodeURIComponent(t)}`,this.apiUrl);await this.fetchJSON(o,"POST")}async reply(t,o,n){const r=new URL(`.ghost/activitypub/v1/actions/reply/${encodeURIComponent(t)}`,this.apiUrl),a={content:o};return n&&(a.image=n),await this.fetchJSON(r,"POST",a)}async note(t,o){const n=new URL(".ghost/activitypub/v1/actions/note",this.apiUrl),r={content:t};return o&&(r.image=o),(await this.fetchJSON(n,"POST",r)).post}async delete(t){const o=new URL(`.ghost/activitypub/v1/post/${encodeURIComponent(t)}`,this.apiUrl);await this.fetchJSON(o,"DELETE")}get userApiUrl(){return new URL(`.ghost/activitypub/users/${this.handle}`,this.apiUrl)}async getUser(){return await this.fetchJSON(this.userApiUrl)}get searchApiUrl(){return new URL(".ghost/activitypub/v1/actions/search",this.apiUrl)}async search(t){const o=this.searchApiUrl;o.searchParams.set("query",t);const n=await this.fetchJSON(o,"GET");return n&&"accounts"in n?n:{accounts:[]}}async getThread(t){const o=new URL(`.ghost/activitypub/v1/thread/${encodeURIComponent(t)}`,this.apiUrl);return await this.fetchJSON(o)}async getAccount(t){const o=new URL(`.ghost/activitypub/v1/account/${t}`,this.apiUrl);return await this.fetchJSON(o)}async getAccountFollows(t,o,n){const r=new URL(`.ghost/activitypub/v1/account/${t}/follows/${o}`,this.apiUrl);n&&r.searchParams.set("next",n);const a=await this.fetchJSON(r);if(a===null)return{accounts:[],next:null};if(!("accounts"in a))return{accounts:[],next:null};const i=Array.isArray(a.accounts)?a.accounts:[],b="next"in a&&typeof a.next=="string"?a.next:null;return{accounts:i,next:b}}async getFeed(t){return this.getPaginatedPosts(".ghost/activitypub/v1/feed/notes",t)}async getInbox(t){return this.getPaginatedPosts(".ghost/activitypub/v1/feed/reader",t)}async getDiscoveryFeed(t,o){const n=`.ghost/activitypub/v1/feed/discover/${t}`;return this.getPaginatedPosts(n,o)}async getExploreAccounts(t,o){const n=`.ghost/activitypub/v1/explore/${t}`;return this.getPaginatedExploreAccounts(n,o)}async getTopics(){const t=new URL(".ghost/activitypub/v1/topics",this.apiUrl),o=await this.fetchJSON(t);return{topics:o&&"topics"in o&&Array.isArray(o.topics)?o.topics:[]}}async getRecommendations(t){const o=new URL(".ghost/activitypub/v1/recommendations",this.apiUrl);t&&o.searchParams.set("limit",t.toString());const n=await this.fetchJSON(o);return{accounts:n&&"accounts"in n&&Array.isArray(n.accounts)?n.accounts:[]}}async getPostsByAccount(t,o){return this.getPaginatedPosts(`.ghost/activitypub/v1/posts/${t}`,o)}async getPostsLikedByAccount(t){return this.getPaginatedPosts(".ghost/activitypub/v1/posts/me/liked",t)}async getPaginatedPosts(t,o){const n=new URL(t,this.apiUrl);o&&n.searchParams.set("next",o);const r=await this.fetchJSON(n);if(r===null||!("posts"in r))return{posts:[],next:null};const a=Array.isArray(r.posts)?r.posts:[],i="next"in r&&typeof r.next=="string"?r.next:null;return{posts:a,next:i}}async getNotifications(t){const o=new URL(".ghost/activitypub/v1/notifications",this.apiUrl);t&&o.searchParams.set("next",t);const n=await this.fetchJSON(o);if(n===null)return{notifications:[],next:null};if(!("notifications"in n))return{notifications:[],next:null};const r=Array.isArray(n.notifications)?n.notifications:[],a="next"in n&&typeof n.next=="string"?n.next:null;return{notifications:r,next:a}}async getNotificationsCount(){const t=new URL(".ghost/activitypub/v1/notifications/unread/count",this.apiUrl),o=await this.fetchJSON(t);return o===null?{count:0}:{count:typeof o.count=="number"?o.count:0}}async resetNotificationsCount(){const t=new URL(".ghost/activitypub/v1/notifications/unread/reset",this.apiUrl);return await this.fetchJSON(t,"PUT"),!0}async getBlockedAccounts(t){const o=new URL(".ghost/activitypub/v1/blocks/accounts",this.apiUrl);t&&o.searchParams.set("next",t);const n=await this.fetchJSON(o);if(n===null)return{accounts:[],next:null};const r="blocked_accounts"in n&&Array.isArray(n.blocked_accounts)?n.blocked_accounts:[],a="next"in n&&typeof n.next=="string"?n.next:null;return{accounts:r,next:a}}async getBlockedDomains(t){const o=new URL(".ghost/activitypub/v1/blocks/domains",this.apiUrl);t&&o.searchParams.set("next",t);const n=await this.fetchJSON(o);if(n===null)return{domains:[],next:null};const r="blocked_domains"in n&&Array.isArray(n.blocked_domains)?n.blocked_domains:[],a="next"in n&&typeof n.next=="string"?n.next:null;return{domains:r,next:a}}async getPaginatedExploreAccounts(t,o){const n=new URL(t,this.apiUrl);o&&n.searchParams.set("next",o);const r=await this.fetchJSON(n);if(r===null||!("accounts"in r))return{accounts:[],next:null};const a=Array.isArray(r.accounts)?r.accounts:[],i="next"in r&&typeof r.next=="string"?r.next:null;return{accounts:a,next:i}}async getPost(t){const o=new URL(`.ghost/activitypub/v1/post/${encodeURIComponent(t)}`,this.apiUrl);return await this.fetchJSON(o)}async getReplies(t,o){const n=new URL(`.ghost/activitypub/v1/replies/${encodeURIComponent(t)}`,this.apiUrl);return o&&n.searchParams.set("next",o),await this.fetchJSON(n)}async updateAccount({name:t,username:o,bio:n,avatarUrl:r,bannerImageUrl:a}){const i=new URL(".ghost/activitypub/v1/account",this.apiUrl);await this.fetchJSON(i,"PUT",{name:t,username:o,bio:n,avatarUrl:r,bannerImageUrl:a})}async upload(t){const o=new URL(".ghost/activitypub/v1/upload/image",this.apiUrl),n=new FormData;n.append("file",t);const r=await this.getToken(),a=await this.fetch(o,{method:"POST",headers:{Authorization:`Bearer ${r}`},body:n});if(!a.ok)throw{message:"Upload failed",statusCode:a.status};return(await a.json()).fileUrl}async enableBluesky(){const t=new URL(".ghost/activitypub/v2/actions/bluesky/enable",this.apiUrl);await this.fetchJSON(t,"POST")}async disableBluesky(){const t=new URL(".ghost/activitypub/v2/actions/bluesky/disable",this.apiUrl);await this.fetchJSON(t,"POST")}async confirmBlueskyHandle(){const t=new URL(".ghost/activitypub/v2/actions/bluesky/confirm-handle",this.apiUrl),o=await this.fetchJSON(t,"POST");return o===null||!("handle"in o)||typeof o.handle!="string"?"":String(o.handle)}}const ov="pending-";function nv(){return`${ov}${crypto.randomUUID()}`}function ea0(e){return e.startsWith(ov)}function Sn0(e,t,o,n){const r={id:e.url,icon:e.icon,name:e.name,preferredUsername:e.preferredUsername,"@context":"",discoverable:!1,featured:"",followers:"",following:"",image:{url:""},inbox:"",manuallyApprovesFollowers:!1,outbox:"",publicKey:{id:"",owner:"",publicKeyPem:""},published:"",summary:"",type:"Person",url:""};return{id:t,type:"Create",actor:r,object:{type:"Note",name:"",content:o,summary:null,url:"",attributedTo:r,image:n||"",published:new Date().toISOString(),attachment:[],preview:{type:"Note",content:o},id:t,replyCount:0,liked:!1,reposted:!1,repostCount:0,authored:!0,"@context":""},"@context":"",to:""}}function Tn0(e){return e.replace(/\n/g,"<br />")}function cc(e){let t="";e.repostedBy!==null?t="Announce":t="Create";const o={id:e.author.url,icon:{url:e.author.avatarUrl},name:e.author.name,preferredUsername:e.author.handle.split("@")[1],followedByMe:e.author.followedByMe,"@context":"",discoverable:!1,featured:"",followers:"",following:"",image:{url:""},inbox:"",manuallyApprovesFollowers:!1,outbox:"",publicKey:{id:"",owner:"",publicKeyPem:""},published:"",summary:"",type:"Person",url:""};let n=null;e.repostedBy!==null&&(n={id:e.repostedBy.url,icon:{url:e.repostedBy.avatarUrl},name:e.repostedBy.name,preferredUsername:e.repostedBy.handle.split("@")[1],followedByMe:e.repostedBy.followedByMe,"@context":"",discoverable:!1,featured:"",followers:"",following:"",image:{url:""},inbox:"",manuallyApprovesFollowers:!1,outbox:"",publicKey:{id:"",owner:"",publicKeyPem:""},published:"",summary:"",type:"Person",url:""});let r="Note";e.type===Bz.Article?r="Article":e.type===Bz.Tombstone&&(r="Tombstone");const a={type:r,name:e.title,content:e.content,summary:e.summary,url:e.url,attributedTo:o,image:e.featureImageUrl??"",published:e.publishedAt,attachment:e.attachments,preview:{type:"",content:e.excerpt},id:e.id,replyCount:e.replyCount,likeCount:e.likeCount,liked:e.likedByMe,reposted:e.repostedByMe,repostCount:e.repostCount,authored:e.authoredByMe===!0,metadata:e.metadata,"@context":""};return{id:e.id,type:t,actor:n!==null?n:o,object:a,"@context":"",to:""}}let ql;async function c1(){return ql||(ql=(await(await fetch("/ghost/api/admin/site/")).json()).site.url),ql}function a1(e,t){return new En0(new URL(t),new URL("/ghost/api/admin/identities/",window.location.origin),e)}function He(e="Rate limit exceeded",t="You've made too many requests. Please try again later."){ve.error(e,{description:t})}function eM(e="Action failed",t="This user has restricted who can interact with their account."){ve.error(e,{description:t})}const l0={outbox:e=>["outbox",e],liked:e=>["liked",e],user:e=>["user",e],profilePosts:e=>e===null?["profile_posts"]:["profile_posts",e],account:e=>["account",e],accountFollows:(e,t)=>["account_follows",e,t],searchResults:e=>["search_results",e],suggestedProfiles:(e,t)=>["suggested_profiles",e,t],exploreProfiles:e=>["explore_profiles",e],replyChain:e=>e===null?["reply_chain"]:["reply_chain",e],feed:["feed"],inbox:["inbox"],discoveryFeed:["discovery_feed"],postsByAccount:["account_posts"],postsLikedByAccount:["account_liked_posts"],notifications:e=>["notifications",e],notificationsCount:e=>["notifications_count",e],blockedAccounts:e=>["blocked_accounts",e],blockedDomains:e=>["blocked_domains",e],topics:()=>["topics"]};function _z(e,t,o){const n=[l0.feed,l0.inbox,l0.discoveryFeed,l0.postsLikedByAccount,l0.profilePosts(null)];for(const r of n)e.setQueriesData(r,a=>a===void 0?a:{...a,pages:a.pages.map(i=>({...i,posts:i.posts.map(b=>b.object.id===t?{...b,object:{...b.object,liked:o,likeCount:Math.max(o?(b.object.likeCount||0)+1:(b.object.likeCount||0)-1,0)}}:b)}))}),r===l0.postsLikedByAccount&&(e.setQueriesData(r,a=>a&&{...a,pages:a.pages.map(i=>({...i,posts:o?i.posts:i.posts.filter(b=>b.object.id!==t)}))}),o&&e.invalidateQueries({queryKey:l0.postsLikedByAccount}))}function rv(e,t,o,n){const r=[l0.feed,l0.inbox,l0.discoveryFeed,l0.profilePosts("index")],a=o.split("@")[1];for(const b of r)e.setQueriesData(b,l=>l===void 0?l:{...l,pages:l.pages.map(u=>({...u,posts:u.posts.map(f=>f.type!=="Announce"&&f.actor?.preferredUsername===a?{...f,actor:{...f.actor,followedByMe:n}}:f.type==="Announce"&&typeof f.object.attributedTo=="object"&&f.object.attributedTo&&!Array.isArray(f.object.attributedTo)&&"preferredUsername"in f.object.attributedTo&&f.object.attributedTo.preferredUsername===a?{...f,object:{...f.object,attributedTo:{...f.object.attributedTo,followedByMe:n}}}:f)}))});const i=l0.replyChain(null);e.setQueriesData(i,b=>{if(!b)return b;const l=u=>u.author.handle===o?{...u,author:{...u.author,followedByMe:n}}:u;return{...b,post:l(b.post),ancestors:{...b.ancestors,chain:b.ancestors.chain.map(l)},children:b.children.map(u=>({...u,post:l(u.post),chain:u.chain.map(l)}))}})}function cv(e,t,o){e.getQueryCache().getAll().forEach(a=>{const i=a.queryKey;Array.isArray(i)&&i[0]==="account_follows"&&e.setQueryData(i,b=>b?.pages?{...b,pages:b.pages.map(l=>({...l,accounts:l.accounts.map(u=>u.handle===t?{...u,isFollowing:o}:u)}))}:b)})}function Ez(e,t,o){const n=l0.replyChain(null);e.setQueriesData(n,r=>{if(!r)return r;const a=i=>i.id===t?{...i,likedByMe:o,likeCount:Math.max(o?(i.likeCount||0)+1:(i.likeCount||0)-1,0)}:i;return{...r,post:a(r.post),ancestors:{...r.ancestors,chain:r.ancestors.chain.map(a)},children:r.children.map(i=>({...i,post:a(i.post),chain:i.chain.map(a)}))}}),e.setQueryData(l0.account("index"),r=>r&&{...r,likedCount:Math.max(0,r.likedCount+(o?1:-1))})}function Sz(e,t,o,n){const r=l0.notifications(t);e.setQueriesData({queryKey:r},a=>{if(!a||!a.pages)return a;try{return{...a,pages:a.pages.map(i=>!i||!i.notifications?i:{...i,notifications:i.notifications.map(b=>!b||!b.post?b:b.post.id===o?{...b,post:{...b.post,likedByMe:n,likeCount:Math.max(n?b.post.likeCount+1:b.post.likeCount-1,0)}}:b)})}}catch{return a}})}function Tz(e,t,o,n){const r=l0.notifications(t);e.setQueriesData({queryKey:r},a=>{if(!a||!a.pages)return a;try{return{...a,pages:a.pages.map(i=>!i||!i.notifications?i:{...i,notifications:i.notifications.map(b=>!b||!b.post?b:b.post.id===o?{...b,post:{...b.post,repostedByMe:n,repostCount:Math.max(n?b.post.repostCount+1:b.post.repostCount-1,0)}}:b)})}}catch{return a}})}function Pz(e,t,o,n){const r=l0.notifications(t);e.setQueriesData({queryKey:r},a=>{if(!a||!a.pages)return a;try{return{...a,pages:a.pages.map(i=>!i||!i.notifications?i:{...i,notifications:i.notifications.map(b=>!b||!b.post?b:b.post.id===o?{...b,post:{...b.post,replyCount:Math.max((b.post.replyCount??0)+n,0)}}:b)})}}catch{return a}})}function OA(e,t,o){const n=[l0.feed,l0.inbox,l0.discoveryFeed,l0.profilePosts("index"),l0.postsLikedByAccount];for(const r of n)e.setQueriesData(r,a=>a&&{...a,pages:a.pages.map(i=>({...i,posts:i.posts.map(b=>b.object.id===t?{...b,object:{...b.object,replyCount:Math.max((b.object.replyCount??0)+o,0)}}:b)}))})}function fA(e,t,o){const n=l0.replyChain(null);e.setQueriesData({queryKey:n,exact:!1},r=>{if(!r)return r;const a=i=>i.id===t?{...i,replyCount:Math.max((i.replyCount||0)+o,0)}:i;return{...r,post:a(r.post),ancestors:{...r.ancestors,chain:r.ancestors.chain.map(a)},children:r.children.map(i=>({...i,post:a(i.post),chain:i.chain.map(a)}))}})}function ta0(e){return Z2({queryKey:l0.blockedAccounts(e),refetchOnMount:"always",async queryFn({pageParam:t}){const o=await c1();return a1(e,o).getBlockedAccounts(t)},getNextPageParam(t){return t.next}})}function oa0(e){return Z2({queryKey:l0.blockedDomains(e),refetchOnMount:"always",async queryFn({pageParam:t}){const o=await c1();return a1(e,o).getBlockedDomains(t)},getNextPageParam(t){return t.next}})}function Pn0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).like(o)},onMutate:o=>{_z(t,o,!0),Ez(t,o,!0),Sz(t,e,o,!0)},onError(o,n){_z(t,n,!1),Ez(t,n,!1),Sz(t,e,n,!1),o.statusCode===403&&eM(),o.statusCode===429&&He()}})}function Xn0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).unlike(o)},onMutate:o=>{_z(t,o,!1),Ez(t,o,!1),Sz(t,e,o,!1)},onError(o){o.statusCode===429&&He()}})}function na0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).blockDomain(new URL(o.url))},onMutate:o=>{o.handle&&t.setQueryData(l0.account(o.handle),n=>n&&{...n,domainBlockedByMe:!0,followedByMe:!1,followsMe:!1})},onError(o){o.statusCode===429&&He()}})}function ra0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).unblockDomain(new URL(o.url))},onMutate:o=>{o.handle&&t.setQueryData(l0.account(o.handle),n=>n&&{...n,domainBlockedByMe:!1})},onError(o){o.statusCode===429&&He()}})}function ca0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).block(new URL(o.apId))},onMutate:o=>{t.setQueryData(l0.account(o.handle),n=>n&&{...n,blockedByMe:!0,followedByMe:!1,followsMe:!1}),t.invalidateQueries({queryKey:l0.feed}),t.invalidateQueries({queryKey:l0.inbox}),t.invalidateQueries({queryKey:l0.discoveryFeed})},onError(o){o.statusCode===429&&He()}})}function aa0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).unblock(new URL(o.apId))},onMutate:o=>{t.setQueryData(l0.account(o.handle),n=>n&&{...n,blockedByMe:!1})},onError(o){o.statusCode===429&&He()}})}function Xz(e,t,o){const n=[l0.feed,l0.inbox,l0.discoveryFeed,l0.profilePosts(null)];for(const r of n)e.setQueriesData(r,a=>a===void 0?a:{...a,pages:a.pages.map(i=>({...i,posts:i.posts.map(b=>b.object.id===t?{...b,object:{...b.object,reposted:o,repostCount:Math.max(o?b.object.repostCount+1:b.object.repostCount-1,0)}}:b)}))})}function jz(e,t,o){const n=l0.replyChain(null);e.setQueriesData(n,r=>{if(!r)return r;const a=i=>i.id===t?{...i,repostedByMe:o,repostCount:Math.max(o?(i.repostCount||0)+1:(i.repostCount||0)-1,0)}:i;return{...r,post:a(r.post),ancestors:{...r.ancestors,chain:r.ancestors.chain.map(a)},children:r.children.map(i=>({...i,post:a(i.post),chain:i.chain.map(a)}))}})}function jn0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).repost(o)},onMutate:o=>{Xz(t,o,!0),jz(t,o,!0),Tz(t,e,o,!0)},onError(o,n){Xz(t,n,!1),jz(t,n,!1),Tz(t,e,n,!1),o.statusCode===403&&eM(),o.statusCode===429&&He()}})}function Dn0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).derepost(o)},onMutate:o=>{Xz(t,o,!1),jz(t,o,!1),Tz(t,e,o,!1)},onError(o){o.statusCode===429&&He()}})}function In0(e){return x2({queryKey:l0.user(e),async queryFn(){const t=await c1();return a1(e,t).getUser()}})}function o5(e,t,o){const n=f1();return Y1({async mutationFn(r){const a=await c1();return a1(e,a).unfollow(r)},onSuccess(r,a){const i=l0.account(a==="me"?"index":a);n.setQueryData(i,h=>h&&{...h,followedByMe:!1,followerCount:h.followerCount-1<0?0:h.followerCount-1});const b=l0.accountFollows(a,"followers");n.setQueryData(b,h=>{if(!h?.pages?.[0])return h;const q=n.getQueryData(l0.account("index"));return q?{...h,pages:h.pages.map(g=>({...g,accounts:g.accounts.filter(W=>W.name!==q.name)}))}:h});const l=l0.account("index");n.setQueryData(l,h=>h&&{...h,followingCount:h.followingCount-1});const f=l0.accountFollows("me","following");n.getQueryData(f)?n.setQueryData(f,h=>h?.pages?{...h,pages:h.pages.map(q=>({...q,accounts:q.accounts.filter(g=>g.handle!==a)}))}:h):n.invalidateQueries({queryKey:f}),cv(n,a,!1),n.setQueryData(l0.exploreProfiles(e),h=>{if(!h)return h;const q=h.pages.map(g=>{const W=Object.entries(g.results).reduce((v,[y,x])=>{const k=x.sites.map(L=>L.handle===a?{...L,followedByMe:!1,followerCount:Math.max(0,L.followerCount-1)}:L);return v[y]={...x,sites:k},v},{});return{...g,results:W}});return{...h,pages:q}}),n.setQueriesData({queryKey:["suggested_profiles"],exact:!1},h=>h&&h.map(q=>q.handle===a?{...q,followedByMe:!1,followerCount:Math.max(0,q.followerCount-1)}:q)),rv(n,e,a,!1),t()},onError:r=>{r.statusCode===429&&He(),o()}})}function n5(e,t,o){const n=f1();return Y1({async mutationFn(r){const a=await c1();return a1(e,a).follow(r)},onSuccess(r,a){const i=l0.account(a==="me"?"index":a);n.setQueryData(i,h=>h&&{...h,followedByMe:!0,followerCount:h.followerCount+1});const b=l0.account("index");n.setQueryData(b,h=>h&&{...h,followingCount:h.followingCount+1});const l=l0.accountFollows(a,"followers"),f=l0.accountFollows("me","following");n.getQueryData(f)?n.setQueryData(f,h=>{if(!h?.pages?.[0])return h;const q=n.getQueryData(l0.account(a==="me"?"index":a));if(!q)return h;const g={id:q.id,name:q.name,handle:q.handle,avatarUrl:q.avatarUrl,blockedByMe:q.blockedByMe,domainBlockedByMe:q.domainBlockedByMe,isFollowing:!0};return{...h,pages:[{...h.pages[0],accounts:[g,...h.pages[0].accounts]},...h.pages.slice(1)]}}):n.invalidateQueries({queryKey:f}),cv(n,a,!0),n.setQueryData(l0.exploreProfiles(e),h=>{if(!h)return h;const q=h.pages.map(g=>{const W=Object.entries(g.results).reduce((v,[y,x])=>{const k=x.sites.map(L=>L.handle===a?{...L,followedByMe:!0,followerCount:L.followerCount+1}:L);return v[y]={...x,sites:k},v},{});return{...g,results:W}});return{...h,pages:q}}),n.setQueriesData({queryKey:["suggested_profiles"],exact:!1},h=>h&&h.map(q=>q.handle===a?{...q,followedByMe:!0,followerCount:q.followerCount+1}:q)),n.setQueryData(l,h=>{if(!h?.pages?.[0])return h;const q=n.getQueryData(l0.account("index"));if(!q)return h;const g={id:q.url,type:"Person",preferredUsername:"index",name:q.name,url:q.url,handle:`index@${new URL(q.url).hostname}`,icon:{type:"Image",url:q.avatarUrl},isFollowing:!1};return{...h,pages:[{...h.pages[0],accounts:[g,...h.pages[0].accounts]},...h.pages.slice(1)]}}),rv(n,e,a,!0),t()},onError(r){o(),r.statusCode===429&&He(),r.statusCode===403&&eM()}})}function Fn0(e,t){const o=f1(),n=l0.searchResults(t);return{searchQuery:x2({queryKey:n,enabled:t.length>0,refetchOnMount:"always",async queryFn(){const i=await c1();return a1(e,i).search(t)}}),updateAccountSearchResult:(i,b)=>{o.setQueryData(n,l=>l&&{...l,accounts:l.accounts.map(u=>u.id===i?{...u,...b}:u)})}}}function ml(e,t,o,n){e.setQueryData(t,r=>r&&{...r,pages:r.pages.map((a,i)=>i===0?{...a,[o]:[n,...a[o]]}:a)})}function Io(e,t,o,n,r){e.setQueryData(t,a=>a&&{...a,pages:a.pages.map(i=>({...i,[o]:i[o].map(b=>b.id===n?r(b):b)}))})}function gl(e,t,o,n){e.setQueryData(t,r=>r&&{...r,pages:r.pages.map(a=>({...a,[o]:a[o].filter(i=>i.id!==n)}))})}function Hn0(e,t){const o=f1();return Y1({async mutationFn({inReplyTo:n,content:r,imageUrl:a,altText:i}){const b=await c1(),l=a1(e,b),u=a?{url:a,altText:i}:void 0;return l.reply(n,r,u)},onMutate:({inReplyTo:n})=>{if(!t)throw new Error("Cannot create reply without actor props");const r=nv();return OA(o,n,1),fA(o,n,1),Pz(o,e,n,1),{id:r}},onSuccess:(n,r)=>{if(n.id===void 0)throw new Error("Activity returned from API has no id");o.invalidateQueries({queryKey:l0.replyChain(r.inReplyTo)})},onError(n,r){console.error(n),OA(o,r.inReplyTo,-1),fA(o,r.inReplyTo,-1),Pz(o,e,r.inReplyTo,-1),n.statusCode===403&&eM(),n.statusCode===429&&He(),ve.error("An error occurred while sending your reply.")}})}function Un0(e,t){const o=f1(),n=l0.feed,r=l0.outbox(e),a=l0.profilePosts("index");return Y1({async mutationFn({content:i,imageUrl:b,altText:l}){const u=await c1(),f=a1(e,u),O=b?{url:b,altText:l}:void 0;return f.note(i,O)},onMutate:({content:i,imageUrl:b})=>{if(!t)throw new Error("Cannot create note without actor props");const l=Tn0(i),u=nv(),f=Sn0(t,u,l,b);return ml(o,n,"posts",f),ml(o,r,"data",f),ml(o,a,"posts",f),{id:u}},onSuccess:(i,b,l)=>{if(i.id===void 0)throw new Error("Post returned from API has no id");const u=cc(i);Io(o,n,"posts",l?.id??"",()=>u),Io(o,r,"data",l?.id??"",()=>u),Io(o,a,"posts",l?.id??"",()=>u)},onError(i,b,l){console.error(i),gl(o,n,"posts",l?.id??""),gl(o,r,"data",l?.id??""),gl(o,a,"posts",l?.id??""),i.statusCode===429&&He(),ve.error("An error occurred while posting your note.")}})}function r5(e,t,o){const n=o?.enabled!==!1;return x2({queryKey:l0.account(t==="me"?"index":t),enabled:n,async queryFn(){const r=await c1();return a1(e,r).getAccount(t)}})}function sa0(e,t){const o=f1();return Z2({queryKey:l0.accountFollows(e,t),async queryFn({pageParam:n}){const r=await c1(),i=await a1("index",r).getAccountFollows(e,t,n);return i.accounts&&i.accounts.forEach(b=>{o.setQueryData(l0.account(b.handle),b)}),i},getNextPageParam(n){return n.next}})}function ia0(e){const t=l0.feed,o=f1();return{feedQuery:Z2({queryKey:t,enabled:e.enabled,staleTime:60*1e3,async queryFn({pageParam:a}){const i=await c1();return a1("index",i).getFeed(a).then(l=>({posts:l.posts.map(cc),next:l.next}))},getNextPageParam(a){return a.next}}),updateFeedActivity:(a,i)=>{Io(o,t,"posts",a,b=>({...b,...i}))}}}function pa0(e){const t=l0.inbox,o=f1();return{inboxQuery:Z2({queryKey:t,enabled:e.enabled,staleTime:20*1e3,async queryFn({pageParam:a}){const i=await c1();return a1("index",i).getInbox(a).then(l=>({posts:l.posts.map(cc),next:l.next}))},getNextPageParam(a){return a.next}}),updateInboxActivity:(a,i)=>{Io(o,t,"posts",a,b=>({...b,...i}))}}}function Ma0(e){const t=[...l0.discoveryFeed,e.topic],o=f1();return{discoveryFeedQuery:Z2({queryKey:t,enabled:e.enabled,staleTime:20*1e3,async queryFn({pageParam:a}){const i=await c1();return a1("index",i).getDiscoveryFeed(e.topic,a).then(l=>({posts:l.posts.map(cc),next:l.next}))},getNextPageParam(a){return a.next}}),updateDiscoveryFeedActivity:(a,i)=>{Io(o,t,"posts",a,b=>({...b,...i}))}}}function ba0(e,t){const o=l0.profilePosts(e==="me"?"index":e),n=f1();return{postsByAccountQuery:Z2({queryKey:o,enabled:t.enabled,async queryFn({pageParam:i}){const b=await c1();return a1("index",b).getPostsByAccount(e,i).then(u=>({posts:u.posts.map(cc),next:u.next})).catch(()=>({posts:[],next:null}))},getNextPageParam(i){return i.next}}),updatePostsByAccount:(i,b)=>{Io(n,o,"posts",i,l=>({...l,...b}))}}}function la0(e){const t=l0.postsLikedByAccount,o=f1();return{postsLikedByAccountQuery:Z2({queryKey:t,enabled:e.enabled,async queryFn({pageParam:a}){const i=await c1();return a1("index",i).getPostsLikedByAccount(a).then(l=>({posts:l.posts.map(cc),next:l.next}))},getNextPageParam(a){return a.next}}),updatePostsLikedByAccount:(a,i)=>{Io(o,t,"posts",a,b=>({...b,...i}))}}}function Vn0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).delete(o.id)},onMutate:({id:o,parentId:n})=>{const r=t.getQueryData(l0.feed);t.setQueryData(l0.feed,L=>L&&{...L,pages:L.pages.map(C=>({...C,posts:C.posts.filter(w=>w.id!==o).map(w=>w.object.id===n?{...w,object:{...w.object,replyCount:w.object.replyCount-1}}:w)}))});const a=t.getQueryData(l0.inbox);t.setQueryData(l0.inbox,L=>L&&{...L,pages:L.pages.map(C=>({...C,posts:C.posts.filter(w=>w.id!==o).map(w=>w.object.id===n?{...w,object:{...w.object,replyCount:w.object.replyCount-1}}:w)}))}),n&&Pz(t,e,n,-1);const i=l0.outbox(e),b=t.getQueryData(i);t.setQueryData(i,L=>L&&{...L,pages:L.pages.map(C=>({...C,data:C.data.filter(w=>w.object.id!==o)}))});const l=l0.liked(e),u=t.getQueryData(l);let f=!1;t.setQueryData(l,L=>L&&{...L,pages:L.pages.map(C=>(f=C.data.some(w=>w.object.id===o),{...C,data:C.data.filter(w=>w.object.id!==o)}))}),[l0.feed,l0.inbox,l0.discoveryFeed,l0.profilePosts("index"),l0.postsLikedByAccount].some(L=>t.getQueryData(L)?.pages.some(w=>w.posts.some(N=>N.id===o&&N.object.liked)))&&t.setQueryData(l0.account(e),L=>L&&{...L,likedCount:Math.max(0,L.likedCount-1)});const h=l0.profilePosts(null),q=t.getQueriesData(h);t.setQueriesData(h,L=>L&&{...L,pages:L.pages.map(C=>({...C,posts:C.posts.filter(w=>w.object.id!==o)}))});let g=[],W;f&&(g=l0.account(e),W=t.getQueryData(g),t.setQueryData(g,L=>L&&{...L,likedCount:L.likedCount-1<0?0:L.likedCount-1}));const v=l0.profilePosts("index"),y=t.getQueryData(v);t.setQueryData(v,L=>L&&{...L,pages:L.pages.map(C=>({...C,posts:C.posts.filter(w=>w.object.id!==o)}))});const x=l0.postsLikedByAccount,k=t.getQueryData(x);return t.setQueryData(x,L=>L&&{...L,pages:L.pages.map(C=>({...C,posts:C.posts.filter(w=>w.object.id!==o)}))}),n&&t.setQueriesData({queryKey:["reply_chain"],exact:!1},L=>{if(!L)return L;const C=L.children.filter(N=>N.post.id!==o).map(N=>({...N,chain:N.chain.filter(D=>D.id!==o)}));let w=L.post;return L.post.id===n&&(w={...L.post,replyCount:Math.max(0,(L.post.replyCount||0)-1)}),{...L,post:w,children:C}}),{previousFeed:{key:l0.feed,data:r},previousInbox:{key:l0.inbox,data:a},previousOutbox:{key:i,data:b},previousLiked:{key:l,data:u},previousProfilePosts:{key:h,data:q},previousAccount:f?{key:g,data:W}:null,previousPostsByAccount:{key:l0.profilePosts("index"),data:y},previousPostsLikedByAccount:{key:l0.postsLikedByAccount,data:k}}},onError:(o,n,r)=>{r&&(t.setQueryData(r.previousFeed.key,r.previousFeed.data),t.setQueryData(r.previousInbox.key,r.previousInbox.data),t.setQueryData(r.previousOutbox.key,r.previousOutbox.data),t.setQueryData(r.previousLiked.key,r.previousLiked.data),t.setQueriesData(r.previousProfilePosts.key,r.previousProfilePosts.data),r.previousAccount&&t.setQueryData(r.previousAccount.key,r.previousAccount.data),r.previousPostsByAccount&&t.setQueryData(l0.profilePosts("index"),r.previousPostsByAccount),r.previousPostsLikedByAccount&&t.setQueryData(l0.postsLikedByAccount,r.previousPostsLikedByAccount))},onSuccess:(o,{parentId:n})=>{t.invalidateQueries({queryKey:["reply_chain"]}),n&&(t.invalidateQueries({queryKey:l0.feed}),t.invalidateQueries({queryKey:l0.inbox}))}})}function za0(e){return Z2({queryKey:l0.notifications(e),async queryFn({pageParam:t}){const o=await c1();return a1(e,o).getNotifications(t)},getNextPageParam(t){return t.next}})}function ua0(e,t){const o=x2({queryKey:l0.replyChain(t),enabled:!!t,async queryFn(){if(!t)throw new Error("Post ID is required");const f=await c1(),O=a1(e,f);try{return await O.getReplies(t)}catch(h){if(_n0(h)&&h.statusCode===404)return await O.getPost(t),await O.getReplies(t);throw h}}}),[n,r]=p.useState(null),[a,i]=p.useState(null);p.useEffect(()=>{o.data?r(o.data):o.error&&i(o.error)},[o.data,o.error]);const b=p.useCallback(async()=>{if(!(!n?.ancestors.hasMore||!n?.ancestors.chain[0]))try{const f=await c1(),h=await a1(e,f).getReplies(n.ancestors.chain[0].id);r(q=>q&&{...q,ancestors:{chain:[...h.ancestors.chain,...q.ancestors.chain],hasMore:h.ancestors.hasMore}})}catch(f){i(f instanceof Error?f:new Error("Failed to load more ancestors"))}},[e,n?.ancestors.hasMore,n?.ancestors.chain]),l=p.useCallback(async()=>{if(n?.next&&t)try{const f=await c1(),h=await a1(e,f).getReplies(t,n.next);r(q=>q&&{...q,children:[...q.children,...h.children],next:h.next})}catch(f){i(f instanceof Error?f:new Error("Failed to load more children"))}},[e,n?.next,t]),u=p.useCallback(async f=>{if(n?.children[f]?.hasMore)try{const O=await c1(),h=a1(e,O),q=n.children[f],g=q.chain.length>1?q.chain[q.chain.length-2]:q.post,W=await h.getReplies(g.id),v=W.children[0].chain;r(y=>{if(!y)return y;const x=[...y.children];return x[f]={...q,chain:[...q.chain,...v],hasMore:W.children[0].hasMore},{...y,children:x}})}catch(O){i(O instanceof Error?O:new Error("Failed to load more child replies"))}},[e,n]);return{data:n,isLoading:o.isLoading,error:a,loadMoreAncestors:b,loadMoreChildren:l,loadMoreChildReplies:u,hasMoreAncestors:!!n?.ancestors.hasMore,hasMoreChildren:!!n?.next,hasMoreChildReplies:f=>!!n?.children[f]?.hasMore}}function da0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).updateAccount(o)},onSuccess(){t.invalidateQueries({queryKey:l0.account("index")})}})}async function $n0(e){const t=await c1();return a1("index",t).upload(e)}function av(e,t=!0){const o=p.useCallback(async()=>await c1(),[]),n=p.useCallback(async()=>{const r=await o();return a1(e,r)},[e,o]);return x2({queryKey:l0.notificationsCount(e),enabled:t,async queryFn(){return(await(await n()).getNotificationsCount()).count}})}function Qn0(e){const t=f1(),o=p.useCallback(async()=>await c1(),[]),n=p.useCallback(async()=>{const r=await o();return a1(e,r)},[e,o]);return Y1({async mutationFn(){return t.setQueryData(l0.notificationsCount(e),0),(await n()).resetNotificationsCount()}})}function Oa0(e,t){const o=f1(),n=[...l0.exploreProfiles(e),t];return{exploreProfilesQuery:Z2({queryKey:n,staleTime:3600*1e3,async queryFn({pageParam:i}){const b=await c1(),u=await a1(e,b).getExploreAccounts(t,i);return u.accounts.forEach(f=>{o.setQueryData(l0.account(f.handle),f)}),{accounts:u.accounts,next:u.next}},getNextPageParam(i){return i.next}}),updateExploreProfile:(i,b)=>{o.setQueryData(n,l=>{if(!l)return l;const u=l.pages.map(f=>{const O=f.accounts.map(h=>h.id===i?{...h,...b}:h);return{...f,accounts:O}});return{...l,pages:u}})}}}function c5(e,t=3){const o=f1(),n=l0.suggestedProfiles(e,t);return{suggestedProfilesQuery:x2({queryKey:n,async queryFn(){const i=await c1(),u=(await a1("index",i).getRecommendations(t)).accounts;return u.length>0&&u.forEach(f=>{o.setQueryData(l0.account(f.handle),f)}),u.length>0?u:null},retry:!1,staleTime:3600*1e3}),updateSuggestedProfile:(i,b)=>{o.setQueryData(n,l=>l&&l.map(u=>u.id===i?{...u,...b}:u))}}}function a5(){return{topicsQuery:x2({queryKey:l0.topics(),async queryFn(){const t=await c1();return a1("index",t).getTopics()},staleTime:864e5,retry:!1})}}function s5(e,t){const o=l0.account("index");e.setQueryData(o,n=>n&&{...n,...t})}function fa0(e){const t=f1();return Y1({async mutationFn(){const o=await c1();return a1(e,o).enableBluesky()},onSuccess(){s5(t,{blueskyEnabled:!0,blueskyHandleConfirmed:!1,blueskyHandle:null}),t.invalidateQueries({queryKey:l0.accountFollows("index","following")})},onError(o){o.statusCode===429&&He()}})}function Aa0(e){const t=f1();return Y1({async mutationFn(){const o=await c1();return a1(e,o).disableBluesky()},onSuccess(){s5(t,{blueskyEnabled:!1,blueskyHandleConfirmed:!1,blueskyHandle:null}),t.invalidateQueries({queryKey:l0.accountFollows("index","following")})},onError(o){o.statusCode===429&&He()}})}function ha0(e){const t=f1();return Y1({async mutationFn(){const o=await c1();return a1(e,o).confirmBlueskyHandle()},onSuccess(o){o!==""&&s5(t,{blueskyEnabled:!0,blueskyHandleConfirmed:!0,blueskyHandle:o})},onError(o){o.statusCode===429&&He()}})}let Ui=null;const AA=({onFollow:e,onUnfollow:t,authorHandle:o,followedByMe:n})=>{const[,r]=b0.useReducer(l=>l+1,0),i=Ui===o&&!n,b=l=>{i?(t(l),setTimeout(()=>{Ui=null,r()},0)):(Ui=o,r(),e(l))};return z.jsx(o1,{className:"absolute -right-1.5 bottom-px z-10 flex size-4 items-center justify-center rounded-full p-0 outline outline-2 outline-white transition-transform hover:scale-105 active:scale-100 dark:outline-black",title:i?"Unfollow":"Follow",onClick:b,children:i?z.jsx(i9,{className:"-mb-px !size-3 !stroke-[2.4]"}):z.jsx(b9,{className:"!size-[14px] !stroke-2"})})},jo=({author:e,size:t,isLoading:o=!1,disabled:n=!1,className:r="",showFollowButton:a=!1})=>{let i=20,b=`shrink-0 items-center justify-center rounded-full relative z-10 flex bg-black/5 dark:bg-gray-900 ${t==="lg"||n?"":"cursor-pointer"} ${r}`,l="z-10 object-cover rounded-full outline outline-[0.5px] outline-offset-[-0.5px] outline-black/10";const[u,f]=p.useState(e?.icon?.url),O=eo(),h=n5("index",()=>{ve.success(`Followed ${e?.name}`)},()=>{ve.error("Failed to follow")}),q=o5("index",()=>{ve.info(`Unfollowed ${e?.name}`)},()=>{ve.error("Failed to unfollow")});switch(p.useEffect(()=>{f(e?.icon?.url)},[e?.icon?.url]),t){case"2xs":i=10,b=Z1("size-4",b),l=Z1("size-4",l);break;case"xs":i=12,b=Z1("size-6",b),l=Z1("size-6",l);break;case"notification":i=16,b=Z1("size-9",b),l=Z1("size-9",l);break;case"sm":b=Z1("size-10",b),l=Z1("size-10",l);break;case"md":b=Z1("size-[60px]",b),l=Z1("size-[60px]",l);break;case"lg":i=32,b=Z1("size-22",b),l=Z1("size-22",l);break;default:b=Z1("size-10",b),l=Z1("size-10",l);break}if(!e||o)return z.jsx(w1,{className:l,containerClassName:b});const g=e?.handle||Xo(e),W=L=>{L.stopPropagation(),O(`/profile/${g}`)},v=L=>{L.stopPropagation(),h.mutate(g)},y=L=>{L.stopPropagation(),q.mutate(g)},k=a||Ui===g;return u?z.jsxs("div",{className:b,onClick:t==="lg"||n?void 0:W,children:[z.jsx("img",{className:l,referrerPolicy:"no-referrer",src:u,onError:()=>f(void 0)}),k&&z.jsx(AA,{authorHandle:g,followedByMe:!1,onFollow:v,onUnfollow:y})]}):z.jsxs("div",{className:b,onClick:n?void 0:W,children:[z.jsx(Ad,{className:"text-gray-600",size:i,strokeWidth:1.5}),k&&z.jsx(AA,{authorHandle:g,followedByMe:!1,onFollow:v,onUnfollow:y})]})},Wl=({trigger:e,onCopyLink:t,onDelete:o,allowDelete:n=!1,disabled:r=!1,layout:a,followedByMe:i=!1,authoredByMe:b=!1,onFollow:l=()=>{},onUnfollow:u=()=>{}})=>{const f=q=>{q.stopPropagation(),t()},O=q=>{q.stopPropagation(),o()},h=q=>{q.stopPropagation(),i?u():l()};return z.jsxs(NK,{children:[z.jsxs(mJ,{children:[z.jsx(gJ,{disabled:r,asChild:!0,onClick:q=>q.stopPropagation(),children:e}),z.jsx(Gm,{align:`${a==="modal"?"start":"end"}`,alignOffset:a==="modal"?-12:0,className:"p-2",children:z.jsxs("div",{className:"flex w-48 flex-col",children:[(!n||a==="inbox")&&z.jsx(fl,{asChild:!0,children:z.jsxs(o1,{className:"justify-start",variant:"ghost",onClick:f,children:[z.jsx(ZZ,{}),"Copy link"]})}),!b&&z.jsx(fl,{asChild:!0,children:z.jsxs(o1,{className:"justify-start",variant:"ghost",onClick:h,children:[i?z.jsx(LG,{}):z.jsx(kG,{}),i?"Unfollow":"Follow"]})}),n&&z.jsx(BK,{asChild:!0,children:z.jsx(fl,{asChild:!0,children:z.jsxs(o1,{className:"justify-start text-red hover:bg-red/5 hover:text-red",variant:"ghost",onClick:q=>q.stopPropagation(),children:[z.jsx(d9,{}),"Delete"]})})})]})})]}),z.jsxs(h9,{onClick:q=>q.stopPropagation(),children:[z.jsxs(q9,{children:[z.jsx(g9,{children:"Delete this post?"}),z.jsx(W9,{children:a==="inbox"?"This will remove the post from the Ghost social web, but it will remain on your website.":z.jsx(z.Fragment,{children:"If you delete this post, you won't be able to restore it."})})]}),z.jsxs(m9,{children:[z.jsx(R9,{onClick:q=>q.stopPropagation(),children:"Cancel"}),z.jsx(v9,{className:O3({variant:"destructive"}),onClick:O,children:"Delete"})]})]})]})};function Zn0(e){const[t,o]=p.useState({images:[],currentIndex:0,isOpen:!1}),n=b=>{const l=p5(b);if(!l)return[];if(Array.isArray(l))return l.map((u,f)=>({url:u.url,alt:u.name||`Image-${f}`}));if(l.mediaType?.startsWith("image/")||l.type==="Image")return[{url:l.url,alt:l.name||"Image"}];if(b.image){let u;if(typeof b.image=="string"?u=b.image:u=b.image?.url,u)return[{url:u,alt:"Image"}]}return[]};return{lightboxState:t,openLightbox:b=>{if(!e)return;const l=n(e),u=l.findIndex(f=>f.url===b);u!==-1&&o({images:l,currentIndex:u,isOpen:!0})},closeLightbox:()=>{o(b=>({...b,isOpen:!1}))},navigateToIndex:b=>{o(l=>({...l,currentIndex:b}))}}}const vl=({images:e,currentIndex:t,isOpen:o,onClose:n,onNavigate:r})=>{const a=t===0,i=t===e.length-1,b=p.useCallback(()=>{if(e.length<=1||i)return;const u=(t+1)%e.length;r(u)},[e.length,i,t,r]),l=p.useCallback(()=>{if(e.length<=1||a)return;const u=(t-1+e.length)%e.length;r(u)},[e.length,a,t,r]);return p.useEffect(()=>{const u=f=>{o&&(f.key==="ArrowRight"&&!i?b():f.key==="ArrowLeft"&&!a&&l())};return window.addEventListener("keydown",u),()=>{window.removeEventListener("keydown",u)}},[o,t,e.length,b,l,i,a]),!o||e.length===0?null:z.jsx(W3,{open:o,onOpenChange:u=>{u||n()},children:z.jsxs(Xa,{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=open]:zoom-in-100 data-[state=closed]:slide-out-to-top-[50%] data-[state=open]:slide-in-from-top-[50%]",onClick:()=>n(),children:[z.jsx("img",{alt:e[t].alt,className:"mx-auto max-h-[90vh] max-w-[90vw] object-contain",src:e[t].url,onClick:u=>u.stopPropagation()}),e.length>1&&z.jsxs(z.Fragment,{children:[z.jsxs(o1,{className:"absolute left-5 top-1/2 size-11 -translate-y-1/2 rounded-full bg-black/50 p-0 pr-0.5 hover:bg-black/70",disabled:a,onClick:u=>{u.stopPropagation(),l()},children:[z.jsx(mZ,{className:"!size-6"}),z.jsx("span",{className:"sr-only",children:"Previous image"})]}),z.jsxs(o1,{className:"absolute right-5 top-1/2 size-11 -translate-y-1/2 rounded-full bg-black/50 p-0 pl-0.5 hover:bg-black/70",disabled:i,onClick:u=>{u.stopPropagation(),b()},children:[z.jsx(ud,{className:"!size-6"}),z.jsx("span",{className:"sr-only",children:"Next image"})]})]}),z.jsx(aY,{asChild:!0,children:z.jsxs(o1,{className:"absolute right-5 top-5 size-11 rounded-full bg-black/50 p-0 hover:bg-black/70",children:[z.jsx(qd,{className:"!size-5"}),z.jsx("span",{className:"sr-only",children:"Close"})]})})]})})},hA=()=>{},i5=({className:e,following:t,handle:o,variant:n="default",onFollow:r=hA,onUnfollow:a=hA,"data-testid":i})=>{const[b,l]=p.useState(t),u=o5("index",()=>{},()=>{l(!0)}),f=n5("index",()=>{},()=>{l(!1)}),O=async()=>{b?(l(!1),a(),u.mutate(o)):(l(!0),r(),f.mutate(o))};p.useEffect(()=>{l(t)},[t]);const h=b?"Following":"Follow";return n==="link"?z.jsx(o1,{className:Z1("p-0 font-medium",b?"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":i,variant:"link",onClick:q=>{q?.preventDefault(),q?.stopPropagation(),O()},children:h}):z.jsx(o1,{className:Z1("min-w-[90px]",e),"data-testid":i,title:b?"Click to unfollow":"",variant:b?"outline":"default",onClick:q=>{q?.preventDefault(),q?.stopPropagation(),O()},children:h})};function Dz(e,t=[]){if(t.length===0)return e.replace(/<br\s*\/?>/gi," ").replace(/<\/p>\s*<p>|<\/div>\s*<div>|<\/h[1-6]>\s*<|<\/li>\s*<li>|<\/a>/gi," ").replace(/<[^>]*>/g,"").replace(/\s+/g," ").trim();const o=t.map(u=>u.toLowerCase()),n={};let r=0,i=e.replace(/<\/(h[1-6]|p|div|li|blockquote|pre)>/gi,"<br>");for(const u of o){const f=new RegExp(`<${u}[^>]*>.*?<\\/${u}>|<${u}[^>]*\\/?>`,"gis");i=i.replace(f,O=>{const h=`__EXCLUDED_TAG_${r+=1}__`;return n[h]=O,h})}let b=i;o.includes("br")||(b=i.replace(/<br\s*\/?>/gi," "));let l=b.replace(/<[^>]*>/g,"").replace(/\s+/g," ").trim();for(const[u,f]of Object.entries(n))l=l.replace(u,f);return l}const Vi=e=>{const t=document.createElement("div");t.innerHTML=e;const o=t.getElementsByTagName("a");for(let n=0;n<o.length;n++)(o[n].getAttribute("href")||"").match(/^\s*(javascript|data|vbscript):/i)&&o[n].removeAttribute("href"),o[n].setAttribute("target","_blank"),o[n].setAttribute("rel","noopener noreferrer");return t.innerHTML},qA=e=>"preferredUsername"in e,So=({actor:e,children:t,disabled:o=!1,side:n="bottom",align:r="start",isCurrentUser:a=!1})=>{const[i,b]=p.useState(!1),l=eo();let u=e?.handle;!u&&e&&qA(e)&&(u=Xo(e));const f=o||!u&&!e,O=r5("index",u||"",{enabled:i&&!!u}),h=O.isFetching||O.isLoading,q=O.error,g=O.data?typeof O.data.followerCount=="number"&&typeof O.data.followingCount=="number"&&O.data.bio!==void 0:!1;if(p.useEffect(()=>{!i||!u||!g&&!h&&!q&&O.refetch({cancelRefetch:!1})},[O,h,q,g,i,u]),f)return z.jsx(z.Fragment,{children:t});const v=O.data||e,y=v?.handle??u??"",x=v?.name??"",k=v?.avatarUrl??(e&&qA(e)?e.icon?.url:null)??null,L=!!v?.followsMe,C=typeof v?.followingCount=="number"?v.followingCount:Number(v?.followingCount)||0,w=typeof v?.followerCount=="number"?v.followerCount:Number(v?.followerCount)||0,N=v?.bio?Vi(Dz(v.bio,["a"])):void 0,D=()=>{y&&l(`/profile/${y}`)},Y=()=>{y&&l(`/profile/${y}/following`)},V=()=>{y&&l(`/profile/${y}/followers`)};return z.jsxs(Z00,{onOpenChange:b,children:[z.jsx(G00,{asChild:!0,children:t}),z.jsx($g,{align:r,className:"w-[320px] cursor-default rounded-2xl border-0 p-5 text-left text-gray-900 shadow-[0_5px_24px_0px_rgba(0,0,0,0.02),0px_2px_5px_0px_rgba(0,0,0,0.07),0px_0px_1px_0px_rgba(0,0,0,0.25)] outline-none dark:bg-[#101114] dark:shadow-none",side:n,sideOffset:12,onClick:J=>J.stopPropagation(),children:z.jsxs("div",{className:"flex flex-col gap-2",children:[z.jsxs("div",{className:"flex flex-col gap-2",children:[z.jsxs("div",{className:"flex justify-between",children:[z.jsxs(md,{className:"size-14 cursor-pointer",onClick:D,children:[k&&z.jsx(gd,{alt:x,className:"rounded-full outline outline-[0.5px] outline-offset-[-0.5px] outline-black/10",src:k,onError:J=>{J.target.src="",J.target.style.display="none"}}),z.jsx(Wd,{className:"bg-gray-200 text-sm font-semibold text-gray-700 dark:bg-gray-800 dark:text-gray-200",children:z.jsx(Ad,{className:"size-5 text-gray-500 dark:text-gray-400",strokeWidth:1.5})})]}),!a&&z.jsx(i5,{following:!!v?.followedByMe,handle:y,type:"primary"})]}),z.jsxs("div",{className:"flex cursor-pointer flex-col items-start",onClick:D,children:[z.jsx(aW,{className:"w-full truncate",children:x}),z.jsxs("div",{className:"flex w-full gap-2",children:[z.jsx("span",{className:"truncate text-gray-700 dark:text-gray-600",children:y}),L&&!a&&z.jsx(TK,{className:"mt-px whitespace-nowrap",variant:"secondary",children:"Follows you"})]})]})]}),z.jsx("div",{className:"flex gap-3 dark:text-gray-300",children:h?z.jsx(w1,{className:"h-4 w-32"}):!q&&z.jsxs(z.Fragment,{children:[z.jsxs("span",{className:"cursor-pointer hover:underline",onClick:Y,children:[z.jsx("span",{className:"font-bold text-black dark:text-white",children:Bf(C)})," ","Following"]}),z.jsxs("span",{className:"cursor-pointer hover:underline",onClick:V,children:[z.jsx("span",{className:"font-bold text-black dark:text-white",children:Bf(w)})," ","Followers"]})]})}),h?z.jsx(w1,{className:"h-4 w-48"}):!q&&N?z.jsx("div",{dangerouslySetInnerHTML:{__html:N},className:"leading-tight dark:text-gray-300 [&_.invisible]:hidden [&_a:hover]:underline [&_a]:text-[#00a4eb]"}):null]})})]})},sv=(e={})=>{const[t,o]=p.useState(!1),n=we();return p.useEffect(()=>{const r=a=>{if(a.target instanceof HTMLInputElement||a.target instanceof HTMLTextAreaElement||a.target instanceof HTMLElement&&a.target.isContentEditable||a.target instanceof HTMLSelectElement||a.metaKey||a.ctrlKey||a.altKey||a.shiftKey)return;const i=document.querySelector('[role="dialog"][data-state="open"]');if(!(i&&!(e.componentRef?.current?.closest('[role="dialog"]')===i)))switch(a.key.toLowerCase()){case"n":i||(a.preventDefault(),e.onOpenNewNote?e.onOpenNewNote():o(!0));break;case"r":e.isReplyAvailable&&e.onOpenReply&&(n.pathname.includes("/notes/")||n.pathname.includes("/reader/"))&&(a.preventDefault(),e.onOpenReply());break}};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e,n.pathname]),{isNewNoteModalOpen:t,setIsNewNoteModalOpen:o}},wi=({actor:e,object:t,likeCount:o,commentCount:n,repostCount:r,layout:a,disabled:i=!1,buttonClassName:b="",onLikeClick:l,onCommentClick:u,onReplyCountChange:f})=>{const[O,h]=p.useState(t.liked),[q,g]=p.useState(t.reposted),[W,v]=p.useState(!1),y=p.useRef(null);sv({isReplyAvailable:!u&&a!=="reply",onOpenReply:()=>v(!0),componentRef:y}),p.useEffect(()=>{h(t.liked),g(t.reposted)},[t.liked,t.reposted]),p.useEffect(()=>{N(r)},[r]);const x=Pn0("index"),k=Xn0("index"),L=jn0("index"),C=Dn0("index"),[w,N]=p.useState(r),D=async J=>{J.stopPropagation(),O?k.mutate(t.id):x.mutate(t.id,{onError(){h(!1)}}),h(!O),l()},Y=J=>{J.stopPropagation(),u?u():v(!0)},V=`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:bg-black dark:hover:bg-gray-950 dark:text-gray-600 ${b}`;return z.jsxs(z.Fragment,{children:[z.jsxs("div",{ref:y,className:`flex ${a!=="inbox"&&"gap-1"}`,children:[z.jsxs(o1,{className:`${V} ${O&&"text-pink-500 hover:text-pink-500"}`,"data-testid":"like-button",disabled:i,id:"like",title:`${O?"Undo like":"Like"}`,variant:"ghost",onClick:J=>{J?.stopPropagation(),J&&D(J)},children:[z.jsx(FZ,{className:`${O&&"fill-pink-500 text-pink-500"}`}),a!=="inbox"&&z.jsx(Xf,{className:o===0?"-ml-1.5 w-0 overflow-hidden":"",spinTiming:{duration:300},value:o})]}),z.jsxs(o1,{className:`${V}`,"data-testid":"reply-button",disabled:i,id:"comment",title:"Reply",variant:"ghost",onClick:Y,children:[z.jsx(Od,{className:"-mr-px"}),a!=="inbox"&&n>0&&zd(n)]}),z.jsxs(o1,{className:`${V} ${q&&"text-green-500 hover:text-green-500"}`,"data-testid":"repost-button",disabled:i,id:"repost",title:`${q?"Undo repost":"Repost"}`,variant:"ghost",onClick:J=>{J?.stopPropagation(),q?(C.mutate(t.id),N(w-1)):(L.mutate(t.id,{onError(){g(!1),N(w-1)}}),N(w+1)),g(!q)},children:[z.jsx(l9,{className:`${q&&"text-green-500"}`}),a!=="inbox"&&z.jsx(Xf,{className:w===0?"-ml-1.5 w-0 overflow-hidden":"",spinTiming:{duration:300},value:w})]})]}),W&&z.jsx(M5,{open:W,replyTo:{object:t,actor:e},onOpenChange:J=>{v(J)},onReply:()=>{f?.(1),v(!1)},onReplyError:()=>{f?.(-1)}})]})};function Gn0(e){const o=e.replace(/<[^>]*>/g,"").split(/\s+/).filter(r=>r.length>0).length;return`${Math.ceil(o/275)} min read`}const xo=(e,t,o)=>{o?.stopPropagation(),t(typeof e=="string"?`/profile/${e}`:`/profile/${e.handle||Xo(e)}`)},Kn0=e=>{const t=new Date,o=i=>new Date(i.getFullYear(),i.getMonth(),i.getDate()),n=o(t),r=o(new Date(t.getTime()-1440*60*1e3)),a=o(e);return a.getTime()===n.getTime()?Yn0(e):a.getTime()===r.getTime()?"Yesterday":Jn0(e)},Yn0=e=>{const o=Math.floor((new Date().getTime()-e.getTime())/1e3);if(o<1)return"Just now";if(o<60)return`${o}s`;const n=Math.floor(o/60);return n<60?`${n}m`:`${Math.floor(n/60)}h`},Jn0=e=>{const t=new Date,o=e.getDate(),n=e.toLocaleString("default",{month:"short"});return e.getFullYear()===t.getFullYear()?`${o} ${n}`:`${o} ${n} ${e.getFullYear()}`};function er0(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 Li(e,t=!0){const o=new Date(e?.published??e?.createdAt??new Date),n=er0(o),r=Kn0(o);return t&&!e.url?.includes("/.ghost/activitypub")?z.jsx("a",{className:"whitespace-nowrap text-gray-700 hover:underline",href:e.url,rel:"noreferrer",target:"_blank",title:n,onClick:a=>a.stopPropagation(),children:r}):z.jsx("span",{className:"whitespace-nowrap text-gray-700",children:r})}function p5(e){let t;if(e.image&&(t=e.image),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 Qc(e,t,o,n){const r=p5(e);if(!r)return null;const a=l=>u=>{u.stopPropagation(),t&&t(l)},i=l=>{n&&n(l)},b=(l,u=!1)=>{const f=u?"min-h-[200px]":"";return z.jsx("div",{className:`${l} ${f} flex w-full items-center justify-center bg-gray-100 dark:bg-gray-925/30`,children:z.jsx(UZ,{className:"text-gray-400",size:24,strokeWidth:1.5})})};if(Array.isArray(r)){const l=r.length;let u="";return l===1?u="grid-cols-1":l>=2&&l<=4?u="grid-cols-2 auto-rows-[150px]":l>4&&(u="grid-cols-3 auto-rows-[150px]"),z.jsx("div",{className:`attachment-gallery mt-3 grid w-full ${u} gap-2`,children:r.map((f,O)=>{const h=`size-full rounded-md outline outline-1 -outline-offset-1 outline-black/10 ${l===3&&O===0?"row-span-2":""}`;return o&&o.has(f.url)?b(h,l===1):z.jsx("img",{alt:f.name||`Image-${O}`,className:`${h} cursor-pointer object-cover`,referrerPolicy:"no-referrer",src:f.url,onClick:t?a(f.url):void 0,onError:()=>i(f.url)},f.url)})})}switch(r.mediaType){case"image/jpeg":case"image/png":case"image/gif":case"image/webp":return o&&o.has(r.url)?b(`${e.type==="Article"?"w-full rounded-t-md":"mt-3 max-h-[420px] rounded-md outline outline-1 -outline-offset-1 outline-black/10"}`,!0):z.jsx("img",{alt:r.name||"Image",className:`cursor-pointer ${e.type==="Article"?"w-full rounded-t-md":"mt-3 max-h-[420px] rounded-md outline outline-1 -outline-offset-1 outline-black/10"}`,referrerPolicy:"no-referrer",src:r.url,onClick:t?a(r.url):void 0,onError:()=>i(r.url)});case"video/mp4":case"video/webm":return z.jsx("div",{className:"relative mb-4 mt-3",children:z.jsx("video",{className:"h-[300px] w-full rounded object-cover",src:r.url,controls:!0})});case"audio/mpeg":case"audio/ogg":return z.jsx("div",{className:"relative mb-4 mt-2 w-full",children:z.jsx("audio",{className:"w-full",src:r.url,controls:!0})});default:if(e.image||r.type==="Image"){const l=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 outline-1 -outline-offset-1 outline-black/10";let u;return e.image?typeof e.image=="string"?u=e.image:u=e.image?.url:u=r.url,o&&o.has(u)?b(l,!0):z.jsx("img",{alt:r.name||"Image",className:l,referrerPolicy:"no-referrer",src:u,onClick:t?a(u):void 0,onError:()=>i(u)})}return null}}function tr0(e,t){const o=p5(e),n="ml-8 md:ml-9 shrink-0 rounded-md h-[91px] w-[121px] relative",r=Z1("object-cover outline outline-1 -outline-offset-1 outline-black/[0.05]",n);if(t)return z.jsx(w1,{className:`${r} outline-0`});if(!o)return null;if(Array.isArray(o))return z.jsx("img",{className:r,referrerPolicy:"no-referrer",src:o[0].url});switch(o.mediaType){case"image/jpeg":case"image/png":case"image/gif":return z.jsx("img",{className:r,referrerPolicy:"no-referrer",src:o.url});case"video/mp4":case"video/webm":return z.jsxs("div",{className:n,children:[z.jsx("video",{className:"h-[80px] w-full rounded object-cover",src:o.url}),z.jsx("div",{className:"absolute inset-0 rounded bg-gray-900 opacity-50"}),z.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:z.jsx(bG,{color:"white",fill:"white",size:40})})]});case"audio/mpeg":case"audio/ogg":return z.jsx("div",{className:"ml-8 w-[120px]",children:z.jsx("div",{className:"relative mb-4 mt-2 w-full",children:z.jsx("audio",{className:"w-full",src:o.url,controls:!0})})});default:return e.image?z.jsx("img",{className:r,referrerPolicy:"no-referrer",src:typeof e.image=="string"?e.image:e.image?.url}):null}}const mA=()=>{},gA=z.jsx(l9,{className:"shrink-0 text-gray-700 dark:text-gray-600",size:16,strokeWidth:1.5}),or0=({actor:e,allowDelete:t=!1,object:o,parentId:n=void 0,layout:r,type:a,commentCount:i=0,repostCount:b=0,likeCount:l=0,showHeader:u=!0,last:f,isLoading:O,isPending:h=!1,isCompact:q=!1,isChainContinuation:g=!1,isChainParent:W=!1,onClick:v=mA,onDelete:y=mA,showStats:x=!0})=>{const k=new Date(o?.published??new Date).toLocaleDateString("default",{year:"numeric",month:"short",day:"2-digit"})+", "+new Date(o?.published??new Date).toLocaleTimeString("default",{hour:"2-digit",minute:"2-digit"}),[,L]=p.useState(!1),[C,w]=p.useState(new Set),N=p.useRef(null),[D,Y]=p.useState(!1),V=Vn0("index"),J=eo(),t0=n5("index",()=>{ve.success(`Followed ${X?.name}`)},()=>{ve.error("Failed to follow")}),K=o5("index",()=>{ve.info(`Unfollowed ${X?.name}`)},()=>{ve.error("Failed to unfollow")});p.useEffect(()=>{const j0=N.current;j0&&Y(j0.scrollHeight>j0.clientHeight)},[o?.content]),p.useEffect(()=>{const j0=N.current;if(!j0)return;const p1=S=>{const r0=S.target.closest("a[data-profile]");if(r0){const A0=r0.getAttribute("data-profile")?.trim();/^@([\w.-]+)@([\w-]+\.[\w.-]+[a-zA-Z])$/.test(A0||"")&&A0&&(S.preventDefault(),S.stopPropagation(),xo(A0,J))}};return j0.addEventListener("click",p1),()=>{j0.removeEventListener("click",p1)}},[J,o?.content]);const a0=()=>{},q0=()=>{h||v()},Z=()=>{V.mutate({id:o.id,parentId:n}),y()},z0=async()=>{o?.url&&(await navigator.clipboard.writeText(o.url),L(!0),ve.success("Link copied"),setTimeout(()=>L(!1),2e3))},U=j0=>{w(p1=>new Set(p1).add(j0))};let X=e;a==="Announce"&&(X=typeof o.attributedTo=="object"?o.attributedTo:e);const G=X?Xo(X):null,_=X?.followedByMe||!1,I=a==="Announce"?typeof o.attributedTo=="object"&&o.attributedTo&&!Array.isArray(o.attributedTo)&&"authored"in o.attributedTo?o.attributedTo.authored:typeof o.attributedTo=="object"&&o.attributedTo&&!Array.isArray(o.attributedTo)&&typeof e=="object"&&e&&o.attributedTo.id===e.id:o.authored,i0=a==="Announce"?o.reposted??!1:o.authored,d0=()=>{G&&t0.mutate(G)},m0=()=>{G&&K.mutate(G)},W0=z.jsx(o1,{className:`relative z-10 size-[34px] rounded-md ${r==="inbox"||r==="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:bg-black dark:hover:bg-gray-950 [&_svg]:size-5`,"data-testid":"menu-button",variant:"ghost",children:z.jsx(p9,{})}),{lightboxState:s0,openLightbox:e0,closeLightbox:w0,navigateToIndex:x0}=Zn0(o);return r==="feed"?z.jsxs(z.Fragment,{children:[o&&z.jsxs("div",{className:`group/article relative -mx-4 ${h?"pointer-events-none":"cursor-pointer"} rounded-lg p-6 px-4 pb-[18px]`,"data-layout":"feed","data-object-id":o.id,onClick:q0,children:[a==="Announce"&&z.jsxs("div",{className:"z-10 mb-2 flex items-center gap-1.5 text-gray-700 dark:text-gray-600",children:[gA,z.jsxs("div",{className:"flex min-w-0 items-center gap-1 text-sm",children:[z.jsx(So,{actor:e,align:"center",isCurrentUser:i0,children:z.jsx("span",{className:"truncate break-anywhere hover:underline",onClick:j0=>{xo(e,J,j0)},children:e.name})}),"reposted"]})]}),z.jsxs("div",{className:"border-1 flex flex-col gap-2.5","data-test-activity":!0,children:[z.jsxs("div",{className:"flex items-center justify-between",children:[z.jsx(So,{actor:X,isCurrentUser:I,children:z.jsxs("div",{className:"flex min-w-0 grow items-center gap-3",children:[z.jsx(jo,{author:X,disabled:h,showFollowButton:!I&&!_}),z.jsxs("div",{className:"flex min-w-0 grow flex-col",onClick:j0=>{h||xo(X,J,j0)},children:[z.jsx("span",{className:`min-w-0 truncate font-semibold break-anywhere ${q?"text-lg":"text-md"} ${h?"":"hover-underline"} dark:text-white`,"data-test-activity-heading":!0,children:O?z.jsx(w1,{className:"w-24"}):X.name}),z.jsxs("div",{className:"flex w-full text-md text-gray-700 dark:text-gray-600",children:[z.jsx("span",{className:`truncate ${h?"":"hover-underline"}`,children:O?z.jsx(w1,{className:"w-56"}):Xo(X)}),z.jsx("div",{className:`ml-1 before:mr-1 ${!O&&'before:content-["·"]'}`,title:`${k}`,children:O?z.jsx(w1,{className:"w-4"}):Li(o,h===!1&&!o.authored)})]})]})]})}),z.jsx(Wl,{allowDelete:t,authoredByMe:I,disabled:h,followedByMe:_,layout:"feed",trigger:W0,onCopyLink:z0,onDelete:Z,onFollow:d0,onUnfollow:m0})]}),z.jsx("div",{className:"relative col-start-2 col-end-3 w-full gap-4 pl-[52px]",children:z.jsxs("div",{className:"flex flex-col",children:[z.jsx("div",{className:"",children:o.type==="Article"?z.jsxs("div",{className:"rounded-md border border-gray-150 transition-colors hover:bg-gray-75 dark:border-gray-950 dark:hover:bg-gray-950",children:[Qc(o,q0,C,U),z.jsxs("div",{className:"p-5",children:[z.jsx("div",{className:"mb-1 line-clamp-2 text-pretty text-lg font-semibold leading-tight tracking-tight break-anywhere","data-test-activity-heading":!0,children:o.name}),z.jsx("div",{className:"line-clamp-3 leading-[1.4em] break-anywhere",children:o.preview?.content})]})]}):z.jsxs("div",{className:"relative",children:[z.jsx("div",{className:"ap-note-content line-clamp-[10] text-pretty leading-[1.4285714286] tracking-[-0.006em] text-gray-900 break-anywhere dark:text-gray-300 [&_p+p]:mt-3",children:O?z.jsx(w1,{count:2}):z.jsx("div",{dangerouslySetInnerHTML:{__html:Vi(o.content||"")??""},ref:N,onClick:j0=>{const p1=j0.target;(p1.tagName==="A"||p1.closest("a"))&&j0.stopPropagation()}})}),D&&z.jsx("button",{className:"mt-1 text-blue-600",type:"button",children:"Show more"}),Qc(o,e0,C,U)]})}),z.jsx("div",{className:"space-between relative z-[30] ml-[-8px] mt-1 flex",children:O?z.jsx(w1,{className:"ml-2 w-18"}):x&&z.jsx(wi,{actor:X,commentCount:i,disabled:h,layout:r,likeCount:l,object:o,repostCount:b,onLikeClick:a0})})]})})]})]}),z.jsx(vl,{currentIndex:s0.currentIndex,images:s0.images,isOpen:s0.isOpen,onClose:w0,onNavigate:x0})]}):r==="modal"?z.jsxs(z.Fragment,{children:[o&&z.jsxs("div",{"data-object-id":o.id,children:[z.jsxs("div",{className:"group/article relative","data-layout":"modal",onClick:q0,children:[z.jsxs("div",{className:"z-10 -my-1 grid grid-cols-[auto_1fr] grid-rows-[auto_1fr] gap-3 pb-3 pt-4","data-test-activity":!0,children:[u&&z.jsxs(z.Fragment,{children:[z.jsx("div",{className:"relative z-10 pt-[3px]",children:z.jsx(jo,{author:X,showFollowButton:!I&&!_})}),z.jsxs("div",{className:"relative z-10 flex w-full min-w-0 cursor-pointer flex-col overflow-visible text-[1.5rem]",onClick:j0=>{h||xo(X,J,j0)},children:[z.jsxs("div",{className:"flex w-full",children:[z.jsx("span",{className:'min-w-0 truncate whitespace-nowrap font-semibold break-anywhere after:mx-1 after:font-normal after:text-gray-700 after:content-["·"] after:dark:text-gray-600',"data-test-activity-heading":!0,children:X.name}),z.jsx("div",{children:Li(o,!o.authored)})]}),z.jsx("div",{className:"flex w-full",children:z.jsx("span",{className:"min-w-0 truncate text-gray-700 dark:text-gray-600",children:Xo(X)})})]})]}),z.jsx("div",{className:"relative z-10 col-start-1 col-end-3 w-full gap-4",children:z.jsxs("div",{className:"flex flex-col items-start",children:[o.name&&z.jsx(v2,{className:"mb-1 leading-tight break-anywhere","data-test-activity-heading":!0,children:o.name}),z.jsx("div",{dangerouslySetInnerHTML:{__html:Vi(o.content||"")??""},ref:N,className:"ap-note-content-large text-pretty text-[1.6rem] tracking-[-0.011em] text-gray-900 break-anywhere dark:text-gray-300 [&_p+p]:mt-3"}),Qc(o,e0,C,U),z.jsx("div",{className:"space-between ml-[-8px] mt-3 flex",children:x&&z.jsx(wi,{actor:X,commentCount:i,layout:r,likeCount:l,object:o,repostCount:b,onLikeClick:a0})})]})})]}),z.jsx("div",{className:"absolute -inset-x-3 -inset-y-0 z-0 rounded transition-colors max-lg:hidden"})]}),z.jsx("div",{className:"mt-3 h-px bg-gray-200 dark:bg-gray-950"})]}),z.jsx(vl,{currentIndex:s0.currentIndex,images:s0.images,isOpen:s0.isOpen,onClose:w0,onNavigate:x0})]}):r==="reply"?z.jsxs(z.Fragment,{children:[o&&z.jsxs("div",{className:`group/article relative ${q?"pb-6":g?"pb-5":"py-5"} ${h?"pointer-events-none":"cursor-pointer"}`,"data-layout":"reply","data-object-id":o.id,onClick:q0,children:[z.jsxs("div",{className:"border-1 flex flex-col gap-2.5 border-b-gray-200","data-test-activity":!0,children:[z.jsxs("div",{className:"flex items-center justify-between",children:[z.jsx(So,{actor:X,isCurrentUser:I,children:z.jsxs("div",{className:"flex min-w-0 grow items-center gap-3",children:[z.jsx(jo,{author:X,disabled:h,showFollowButton:!I&&!_}),z.jsxs("div",{className:"flex min-w-0 grow flex-col",onClick:j0=>{h||xo(X,J,j0)},children:[z.jsxs("div",{className:"flex",children:[z.jsx("span",{className:'min-w-0 truncate whitespace-nowrap font-semibold text-black break-anywhere after:mx-1 after:font-normal after:text-gray-700 after:content-["·"] dark:text-white',"data-test-activity-heading":!0,children:X.name}),z.jsx("div",{children:Li(o,h===!1&&!o.authored)})]}),z.jsx("div",{className:"flex",children:z.jsx("span",{className:"truncate text-gray-700",children:Xo(X)})})]})]})}),!q&&z.jsx(Wl,{allowDelete:t,authoredByMe:I,disabled:h,followedByMe:_,layout:"reply",trigger:W0,onCopyLink:z0,onDelete:Z,onFollow:d0,onUnfollow:m0})]}),z.jsx("div",{className:"relative z-10 col-start-2 col-end-3 w-full gap-4 pl-[52px]",children:z.jsxs("div",{className:"flex flex-col items-start",children:[o.type==="Article"&&Qc(o,q0,C,U),o.name&&z.jsx(v2,{className:"mt-2.5 text-pretty leading-tight break-anywhere","data-test-activity-heading":!0,children:o.name}),o.preview&&o.type==="Article"?z.jsx("div",{className:"mt-1 line-clamp-3 leading-tight",children:o.preview.content}):z.jsx("div",{dangerouslySetInnerHTML:{__html:Vi(o.content||"")??""},ref:N,className:"ap-note-content text-pretty tracking-[-0.006em] text-gray-900 break-anywhere dark:text-gray-300 [&_p+p]:mt-3"}),o.type==="Note"&&Qc(o,e0,C,U),o.type==="Article"&&z.jsx(o1,{className:"mt-3 w-full",id:"read-more",variant:"secondary",children:"Read more"}),!q&&z.jsx("div",{className:"space-between ml-[-8px] mt-2 flex",children:x&&z.jsx(wi,{actor:X,commentCount:i,disabled:h,layout:r,likeCount:l,object:o,repostCount:b,onLikeClick:a0})})]})})]}),!f&&z.jsx("div",{className:`absolute left-[19px] ${q?"bottom-[8px] top-[51px]":g?"bottom-[5px] top-[51px]":W?"bottom-[5px] top-[71px]":"bottom-[-7px] top-[71px]"} z-0 w-[2px] rounded-sm bg-gray-200 dark:bg-gray-950`})]}),z.jsx(vl,{currentIndex:s0.currentIndex,images:s0.images,isOpen:s0.isOpen,onClose:w0,onNavigate:x0})]}):r==="inbox"?z.jsx(z.Fragment,{children:o&&z.jsxs("div",{className:"group/article 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-75 dark:hover:bg-gray-950/50","data-layout":"inbox","data-object-id":o.id,onClick:q0,children:[z.jsxs("div",{className:"w-full min-w-0",children:[z.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:O?z.jsx(w1,{className:"w-24"}):z.jsxs(z.Fragment,{children:[z.jsx(So,{actor:X,isCurrentUser:I,children:z.jsxs("div",{className:"flex items-center gap-1",children:[z.jsx(jo,{author:X,size:"2xs"}),z.jsx("span",{className:"min-w-0 font-semibold text-gray-900 break-anywhere hover:underline dark:text-gray-600","data-test-activity-heading":!0,onClick:j0=>{xo(X,J,j0)},children:X.name})]})}),a==="Announce"&&z.jsxs("span",{className:"z-10 flex items-center gap-1 text-gray-700 dark:text-gray-600",children:[gA,z.jsx(So,{actor:e,align:"center",isCurrentUser:i0,children:z.jsx("span",{className:"line-clamp-1 hover:underline",onClick:j0=>{xo(e,J,j0)},children:e.name})})," reposted"]}),z.jsx("span",{className:'shrink-0 whitespace-nowrap text-gray-600 before:mr-1 before:content-["·"]',title:`${k}`,children:Li(o,!o.authored)})]})}),z.jsxs("div",{className:"flex",children:[z.jsxs("div",{className:"flex min-h-[73px] w-full min-w-0 flex-col items-start justify-start gap-1",children:[z.jsx(v2,{className:"line-clamp-2 w-full max-w-[600px] text-pretty leading-tight break-anywhere","data-test-activity-heading":!0,children:O?z.jsx(w1,{className:"w-full max-w-96"}):o.name?o.name:z.jsx("span",{dangerouslySetInnerHTML:{__html:Dz(o.content||"")}})}),z.jsx("div",{className:"ap-note-content line-clamp-2 w-full max-w-[600px] text-pretty text-base leading-normal text-gray-900 break-anywhere dark:text-gray-300 [&_p+p]:mt-3",children:O?z.jsx(w1,{count:2}):z.jsx("div",{dangerouslySetInnerHTML:{__html:Dz(o.preview?.content??o.content??"")}})}),z.jsx("span",{className:"mt-1 shrink-0 whitespace-nowrap text-sm leading-none text-gray-600",children:O?z.jsx(w1,{className:"w-16"}):o.content&&`${Gn0(o.content)}`})]}),z.jsxs("div",{className:"invisible absolute right-3 top-8 z-[49] flex -translate-y-1/2 rounded-lg bg-white p-1 shadow-md group-hover/article:visible dark:bg-black",children:[x&&z.jsx(wi,{actor:X,commentCount:i,layout:r,likeCount:l,object:o,repostCount:b,onLikeClick:a0}),z.jsx(Wl,{allowDelete:t,authoredByMe:I,followedByMe:_,layout:"inbox",trigger:W0,onCopyLink:z0,onDelete:Z,onFollow:d0,onUnfollow:m0})]})]})]}),tr0(o,O)]})}):z.jsx(z.Fragment,{})},WA=5*1024*1024,vA="Image must be less than 5MB in size.",qa0=async e=>{try{const t=await fetch(e,{mode:"cors"});if(!t.ok)throw new Error(`Failed to fetch image: ${t.status}`);const o=await t.blob();return new Promise((n,r)=>{const a=new FileReader;a.onload=()=>n(a.result),a.onerror=r,a.readAsDataURL(o)})}catch{return e}},ma0=e=>new Promise(t=>{const o=new Image;o.onload=()=>{URL.revokeObjectURL(o.src),t(o.width===o.height)},o.src=URL.createObjectURL(e)}),ga0="Image must be square.",M5=({children:e,replyTo:t,onReply:o,onReplyError:n,onOpenChange:r,...a})=>{const{data:i}=In0("index"),b=Un0("index",i),l=Hn0("index",i),{data:u,isLoading:f}=r5("index","me"),[O,h]=p.useState(!1),q=p.useRef(null),g=p.useRef(null),[W,v]=p.useState(null),[y,x]=p.useState(!1),k=p.useRef(null),[L,C]=p.useState(""),[w,N]=p.useState(null),[D,Y]=p.useState(""),[V,J]=p.useState(!1),[t0,K]=p.useState(!1),[a0,q0]=p.useState(!1),Z=eo(),z0=500;p.useEffect(()=>{a.open!==void 0&&h(a.open)},[a.open]),p.useEffect(()=>{if(a.open!==void 0?a.open:O){const w0=setTimeout(()=>{q0(!0)},300);return()=>clearTimeout(w0)}else q0(!1)},[O,a.open]);const U=!L.trim()||!i||t0||L.length>z0,X=p.useCallback(async()=>{const e0=L.trim();if(!(!e0||!i))try{K(!0),t?(await l.mutateAsync({inReplyTo:t.object.id,content:e0,imageUrl:w||void 0,altText:D||void 0}),o?.()):(await b.mutateAsync({content:e0,imageUrl:w||void 0,altText:D||void 0}),Z("/notes")),h(!1),r&&r(!1),ve.success(t?"Reply posted":"Note posted")}catch{t&&n?.()}finally{K(!1)}},[L,i,t,l,b,w,D,o,n,h,Z,r]),G=e0=>{C(e0.target.value)};p.useEffect(()=>{q.current&&(q.current.style.height="auto",q.current.style.height=`${q.current.scrollHeight}px`)},[L]),p.useEffect(()=>{if((a.open!==void 0?a.open:O)&&q.current){const w0=setTimeout(()=>{q.current?.focus()},100);return()=>clearTimeout(w0)}},[O,a.open]),p.useEffect(()=>{if(V&&g.current){const e0=setTimeout(()=>{g.current?.focus()},100);return()=>clearTimeout(e0)}},[V]),p.useEffect(()=>{const e0=x0=>{(x0.metaKey||x0.ctrlKey)&&x0.key==="Enter"&&(x0.preventDefault(),!U&&!y&&X())};if(a.open!==void 0?a.open:O)return document.addEventListener("keydown",e0),()=>document.removeEventListener("keydown",e0)},[O,a.open,U,y,X]);const _=p.useCallback(async e0=>{const w0=e0.clipboardData?.items;if(w0)for(let x0=0;x0<w0.length;x0++){const j0=w0[x0];if(j0.type.indexOf("image")!==-1){e0.preventDefault();const p1=j0.getAsFile();if(p1){if(p1.size>WA){ve.error(vA);return}const S=URL.createObjectURL(p1);v(S),await I(p1)}break}}},[]);p.useEffect(()=>{if(a.open!==void 0?a.open:O)return document.addEventListener("paste",_),()=>document.removeEventListener("paste",_)},[O,a.open,_]);const I=async e0=>{try{x(!0);const w0=await $n0(e0);N(w0)}catch(w0){v(null);let x0="Failed to upload image. Try again.";if(w0&&typeof w0=="object"&&"statusCode"in w0)switch(w0.statusCode){case 413:x0="Image size exceeds limit.";break;case 415:x0="The file type is not supported.";break}ve.error(x0)}finally{x(!1)}},i0=async e0=>{const w0=e0.target.files;if(w0&&w0.length>0){const x0=w0[0];if(x0.size>WA){ve.error(vA),e0.target.value="";return}const j0=URL.createObjectURL(x0);v(j0),await I(x0)}},d0=e0=>{e0.stopPropagation(),v(null),N(null),Y(""),J(!1),W&&URL.revokeObjectURL(W),k.current&&(k.current.value="")},m0=e0=>{e0.stopPropagation(),J(!V)},W0=()=>{q.current?.focus()};p.useEffect(()=>()=>{W&&URL.revokeObjectURL(W)},[W]);let s0="What's new?";if(t){const e0=t.object.attributedTo||{};typeof e0=="object"&&"preferredUsername"in e0&&"id"in e0&&(s0=`Reply to ${Xo(e0)}...`)}return z.jsxs(W3,{open:a.open!==void 0?a.open:O,onOpenChange:e0=>{e0&&(C(""),v(null),N(null),Y(""),J(!1),W&&URL.revokeObjectURL(W),k.current&&(k.current.value="")),h(e0),r&&r(e0)},...a.open!==void 0?{}:a,children:[z.jsx(Z9,{asChild:!0,children:e}),z.jsxs(Xa,{className:"max-h-[80vh] min-h-[240px] gap-0 overflow-y-auto pb-0","data-testid":"new-note-modal",onClick:e0=>e0.stopPropagation(),children:[z.jsxs(Ld,{className:"hidden",children:[z.jsx(kd,{children:t?"Reply":"New note"}),z.jsx(K9,{children:"Post your thoughts to the Social web"})]}),t&&z.jsx(or0,{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:()=>{}}),z.jsxs("div",{className:`flex ${W?"":"min-h-36"} cursor-text items-start gap-3`,onClick:W0,children:[z.jsx("div",{className:"sticky top-0",children:z.jsx(jo,{author:i})}),z.jsx(cX,{asChild:!0,children:z.jsxs("div",{className:"-mt-0.5 flex w-full flex-col gap-0.5",children:[f?z.jsx(w1,{className:"w-10"}):z.jsx("span",{className:"min-w-0 truncate whitespace-nowrap font-semibold text-black break-anywhere dark:text-white",children:u?.name}),z.jsx(C6,{name:"content",asChild:!0,children:z.jsx(N6,{asChild:!0,children:z.jsx("textarea",{ref:q,autoFocus:!0,className:"ap-textarea w-full resize-none bg-transparent text-[1.5rem] break-anywhere","data-testid":"note-textarea",placeholder:s0,rows:1,value:L,onChange:G,onPaste:_})})}),z.jsx(C6,{name:"image",asChild:!0,children:z.jsx(N6,{asChild:!0,children:z.jsx("input",{ref:k,accept:"image/jpeg,image/png,image/webp,image/gif",className:"hidden",type:"file",onChange:i0})})})]})})]}),W&&z.jsxs("div",{className:"group relative mt-6 flex min-h-[200px] w-full items-center justify-center",children:[z.jsx("img",{alt:"Image attachment preview",className:`max-h-[320px] w-full rounded-sm object-cover outline outline-1 -outline-offset-1 outline-black/10 ${y&&"opacity-10"}`,src:W}),y&&z.jsx("div",{className:"absolute leading-[0]",children:z.jsx(mp,{size:"md"})}),z.jsx(o1,{className:"absolute right-3 top-3 size-8 bg-black/60 text-white opacity-0 hover:bg-black/80 group-hover:opacity-100",onClick:d0,children:z.jsx(d9,{})}),!y&&z.jsx(o1,{className:`absolute bottom-3 left-3 h-6 px-2 py-0 text-white ${V?"bg-green-500 hover:bg-green-500":"bg-black/60 hover:bg-black/80"}`,onClick:m0,children:"Alt"})]}),W&&!y&&V&&z.jsx("div",{className:"mt-1",children:z.jsx(B3,{ref:g,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-[#101114] dark:text-white dark:placeholder:text-gray-800",placeholder:"Type alt text for image (optional)",type:"text",value:D,onChange:e0=>Y(e0.target.value)})}),z.jsxs(xd,{className:`${a0?"sticky":"static"} bottom-0 flex-row bg-background py-6 dark:bg-[#101114]`,children:[z.jsx(o1,{className:"mr-auto w-[34px] !min-w-0",variant:"outline",onClick:()=>k.current?.click(),children:z.jsx($Z,{})}),z.jsxs("div",{className:"flex items-center space-x-3",children:[z.jsxs("div",{className:`text-sm ${L.length>=z0?"text-red-500":L.length>=z0*.9?"text-yellow-600":"text-gray-500"}`,children:[L.length,"/",z0]}),z.jsx(o1,{className:"min-w-16","data-testid":"post-button",disabled:U||y,onClick:X,children:t0?z.jsx(mp,{color:"light",size:"sm"}):"Post"})]})]})]})]})};function Iz(e){if(!e)return{};try{return JSON.parse(e)}catch{return{}}}function nr0(e,t){const o=Iz(e);return JSON.stringify({...o,...t})}const iv=()=>{const{data:e}=ye(),{mutateAsync:t}=dW(),o=b0.useMemo(()=>e?.accessibility?Iz(e.accessibility).apOnboarding||{}:{},[e?.accessibility]),n=b0.useCallback(async r=>{if(!e)return;const a=Iz(e.accessibility),i=nr0(e.accessibility,{apOnboarding:{...a.apOnboarding,...r}});await t({...e,accessibility:i})},[e,t]);return{isOnboarded:!!o.welcomeStepsFinished,isExplainerClosed:!!o.exploreExplainerClosed,setOnboarded:r=>n({welcomeStepsFinished:r}),setExplainerClosed:r=>n({exploreExplainerClosed:r})}},pv=()=>z.jsx("div",{className:"h-full pt-14",children:z.jsx(Cn,{})}),rr0=Object.freeze(Object.defineProperty({__proto__:null,default:pv,useOnboardingStatus:iv},Symbol.toStringTag,{value:"Module"})),cr0=()=>{const e=eo();function t(){e(`/notes/${encodeURIComponent("https://activitypub.ghost.org/.ghost/activitypub/note/6d6d7f57-b656-4caa-ba9e-efa1d9a4b3fb")}`)}return z.jsxs("div",{className:"z-20 w-full bg-white dark:bg-black",children:[z.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-black",children:[z.jsxs("div",{className:"flex items-center gap-2",children:[z.jsx(oG,{className:"text-purple-500",size:20,strokeWidth:1.5}),z.jsx(v2,{children:"Beta feedback"})]}),z.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-600",children:"Something not working? Let us know"}),z.jsx(o1,{className:"mt-2 dark:bg-gray-925/70 dark:hover:bg-gray-900",variant:"secondary",onClick:t,children:"Send feedback"})]}),z.jsxs("div",{className:"-mb-1 ml-3 flex items-center gap-1.5 pb-2 pt-4 text-xs text-gray-400",children:[z.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"}),"⋅",z.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"})]})]})},xp=({children:e,url:t=null,onClick:o,"data-testid":n,isSelected:r=!1})=>{const a=b0.Children.toArray(e),i=z.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 ${r?"z-10 before:opacity-100":"before:opacity-0"}`,"data-testid":n,onClick:()=>{!t&&o&&o()},children:z.jsxs("div",{className:"relative z-10 flex w-full items-center gap-3 py-3",children:[a[0],a[1],a[2]]})});return t?z.jsx("a",{href:t,rel:"noreferrer",target:"_blank",onClick:b=>{o&&(b.preventDefault(),o())},children:i}):i},ar0=()=>{const e=eo(),{suggestedProfilesQuery:t}=c5("index",3),{data:o,isLoading:n}=t,r=n?Array(3).fill(null):o||[],{resetStack:a}=t3(),i="[@media(max-height:740px)]:hidden";return!n&&(!o||o.length===0)?null:z.jsxs("div",{className:`border-t border-gray-200 px-3 pt-6 dark:border-gray-950 ${i}`,children:[z.jsxs("div",{className:"mb-3 flex flex-col gap-0.5",children:[z.jsxs("div",{className:"flex items-center gap-2",children:[z.jsx(dp,{className:"text-purple-500",size:20,strokeWidth:1.5}),z.jsx(v2,{children:"Follow suggestions"})]}),z.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-600",children:"Accounts you might be interested in"})]}),z.jsx("ul",{className:"grow",children:r.map((b,l)=>{const u=b?.id||`loading-${l}`,f=b?.name||"",O=b?.handle||"",h=b?.avatarUrl||"";let q;switch(l){case 0:q="[@media(max-height:740px)]:hidden";break;case 1:q="[@media(max-height:800px)]:hidden";break;case 2:q="[@media(max-height:860px)]:hidden";break}return z.jsx(p.Fragment,{children:z.jsx("li",{className:q,children:z.jsx(So,{actor:b,align:"center",isCurrentUser:!1,side:"left",children:z.jsx("div",{children:z.jsxs(xp,{onClick:()=>{!n&&b&&xo(b,e)},children:[n?z.jsx(w1,{className:"z-10 size-10"}):z.jsx(jo,{author:{icon:{url:h},name:f,handle:O},showFollowButton:!0}),z.jsxs("div",{className:"flex min-w-0 flex-col",children:[z.jsx("span",{className:"block max-w-[190px] truncate font-semibold text-black dark:text-white",children:n?z.jsx(w1,{className:"w-24"}):f}),z.jsx("span",{className:"block max-w-[190px] truncate text-sm text-gray-700 dark:text-gray-600",children:n?z.jsx(w1,{className:"w-40"}):O})]})]})})})},u)},u)})}),z.jsx(o1,{className:"p-0 font-medium text-purple hover:text-black dark:hover:text-white",variant:"link",onClick:()=>{a(),e("/explore")},children:"Find more →"})]})},sr0=({profile:e,update:t,isLoading:o,onOpenChange:n})=>{const r=()=>{t(e.id,{followedByMe:!0})},a=()=>{t(e.id,{followedByMe:!1})},i=eo();return z.jsx(So,{actor:e,align:"center",isCurrentUser:!1,side:"left",children:z.jsx("div",{children:z.jsxs(xp,{onClick:()=>{n?.(!1),i(`/profile/${e.handle}`)},children:[z.jsx(jo,{author:{icon:{url:e.avatarUrl},name:e.name,handle:e.handle},onClick:()=>n?.(!1)}),z.jsxs("div",{className:"flex grow flex-col break-anywhere",children:[z.jsx("span",{className:"line-clamp-1 font-semibold text-black dark:text-white",children:o?z.jsx(w1,{className:"w-full max-w-64"}):e.name}),z.jsx("span",{className:"line-clamp-1 text-sm text-gray-700 dark:text-gray-600",children:o?z.jsx(w1,{className:"w-24"}):e.handle})]}),o?z.jsx("div",{className:"inline-flex items-center",children:z.jsx(w1,{className:"w-12"})}):z.jsx(i5,{className:"ml-auto",following:e.followedByMe,handle:e.handle,type:"secondary",onFollow:r,onUnfollow:a})]},e.id)})})},ir0=({onOpenChange:e})=>{const{suggestedProfilesQuery:t,updateSuggestedProfile:o}=c5("index",5),{data:n=[],isLoading:r}=t;return!r&&(!n||n.length===0)?null:z.jsx("div",{className:"mb-[-15px] flex flex-col gap-3 pt-2",children:z.jsx("div",{className:"flex flex-col",children:(r?Array(5).fill(null):n||[]).map((a,i)=>z.jsx(b0.Fragment,{children:z.jsx(sr0,{isLoading:r,profile:a||{id:"",name:"",handle:"",avatarUrl:"",bio:"",followerCount:0,followingCount:0,followedByMe:!1},update:o,onOpenChange:e})},a?.id||`loading-${i}`))})})};function pr0(e,t,o,n){var r=this,a=p.useRef(null),i=p.useRef(0),b=p.useRef(0),l=p.useRef(null),u=p.useRef([]),f=p.useRef(),O=p.useRef(),h=p.useRef(e),q=p.useRef(!0);h.current=e;var g=typeof window<"u",W=!t&&t!==0&&g;if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var v=!!(o=o||{}).leading,y=!("trailing"in o)||!!o.trailing,x="maxWait"in o,k="debounceOnServer"in o&&!!o.debounceOnServer,L=x?Math.max(+o.maxWait||0,t):null;p.useEffect(function(){return q.current=!0,function(){q.current=!1}},[]);var C=p.useMemo(function(){var w=function(K){var a0=u.current,q0=f.current;return u.current=f.current=null,i.current=K,b.current=b.current||K,O.current=h.current.apply(q0,a0)},N=function(K,a0){W&&cancelAnimationFrame(l.current),l.current=W?requestAnimationFrame(K):setTimeout(K,a0)},D=function(K){if(!q.current)return!1;var a0=K-a.current;return!a.current||a0>=t||a0<0||x&&K-i.current>=L},Y=function(K){return l.current=null,y&&u.current?w(K):(u.current=f.current=null,O.current)},V=function K(){var a0=Date.now();if(v&&b.current===i.current&&J(),D(a0))return Y(a0);if(q.current){var q0=t-(a0-a.current),Z=x?Math.min(q0,L-(a0-i.current)):q0;N(K,Z)}},J=function(){n&&n({})},t0=function(){if(g||k){var K=Date.now(),a0=D(K);if(u.current=[].slice.call(arguments),f.current=r,a.current=K,a0){if(!l.current&&q.current)return i.current=a.current,N(V,t),v?w(a.current):O.current;if(x)return N(V,t),w(a.current)}return l.current||N(V,t),O.current}};return t0.cancel=function(){var K=l.current;K&&(W?cancelAnimationFrame(l.current):clearTimeout(l.current)),i.current=0,u.current=a.current=f.current=l.current=null,K&&n&&n({})},t0.isPending=function(){return!!l.current},t0.flush=function(){return l.current?Y(Date.now()):O.current},t0},[v,x,t,L,y,W,g,k,n]);return C}function Mr0(e,t){return e===t}function br0(e,t,o){var n=Mr0,r=p.useRef(e),a=p.useState({})[1],i=pr0(p.useCallback(function(l){r.current=l,a({})},[a]),t,o,a),b=p.useRef(e);return n(b.current,e)||(i(e),b.current=e),[r.current,i]}const xi=80,lr0=({onOpenChange:e,query:t,setQuery:o})=>{const n=p.useRef(null),r=p.useRef([]),a=p.useRef(0),i=eo(),[b]=br0(t,300),l=t.length>=2,{searchQuery:u,updateAccountSearchResult:f}=Fn0("index",l?b:""),{data:O,isFetching:h,isFetched:q}=u,{suggestedProfilesQuery:g}=c5("index",5),{data:W,isLoading:v}=g,y=v||W&&W.length>0,{topicsQuery:x}=a5(),{data:k}=x,L=r5("index","me"),{data:C}=L,[w,N]=p.useState([]),[D,Y]=p.useState(null),[V,J]=p.useState(0),t0=p.useMemo(()=>{const X=k?.topics||[];if(!l||X.length===0)return[];const G=t.toLowerCase();return X.filter(_=>_.slug==="following"?!1:_.name.toLowerCase().startsWith(G)||_.slug.toLowerCase().startsWith(G))},[t,l,k?.topics]),K=p.useMemo(()=>[...t0.map(X=>({type:"topic",data:X})),...w.map(X=>({type:"account",data:X}))],[t0,w]);p.useEffect(()=>{if(!l){N([]),Y(null);return}q&&(O?.accounts&&O.accounts.length>0?(N(O.accounts),Y("results"),J(0)):(N([]),Y("none"),J(0)))},[O?.accounts,q,l]);const a0=h&&l,q0=t.length<2||!D&&l&&t0.length===0,Z=!q0&&D==="none"&&t0.length===0,z0=!q0&&(w.length>0||t0.length>0);p.useEffect(()=>{n.current?.focus()},[]),p.useEffect(()=>{const X=r.current[V];if(!X)return;const G=X.closest("[data-radix-scroll-area-viewport]")||X.closest(".overflow-y-auto");if(!G){X.scrollIntoView({block:"nearest"});return}const _=G.getBoundingClientRect(),I=X.getBoundingClientRect();I.top<_.top+xi?G.scrollTo({top:G.scrollTop-(_.top+xi-I.top),behavior:"smooth"}):I.bottom>_.bottom-xi&&G.scrollTo({top:G.scrollTop+(I.bottom-_.bottom+xi),behavior:"smooth"})},[V]);const U=X=>{if(!(!z0||K.length===0)){if(X.key==="ArrowDown"||X.key==="ArrowUp"){X.preventDefault();const G=Date.now();if(G-a.current<50)return;a.current=G,X.key==="ArrowDown"?J(_=>(_+1)%K.length):J(_=>(_-1+K.length)%K.length)}else if(X.key==="Enter"){const G=K[V];if(!G)return;X.preventDefault(),e?.(!1),G.type==="topic"?i(`/explore/${G.data.slug}`):i(`/profile/${G.data.handle}`)}}};return z.jsxs(z.Fragment,{children:[z.jsxs("div",{className:'sticky -top-6 z-30 -mt-6 flex h-[72px] shrink-0 items-center gap-2 bg-white pb-2 pt-3 before:pointer-events-none before:absolute before:-inset-x-6 before:bottom-0 before:h-0 before:border-b before:border-b-gray-150 before:content-[""] dark:bg-[#101114] dark:before:border-b-gray-950',children:[z.jsx(fd,{className:"text-gray-600",size:18,strokeWidth:1.5}),z.jsx(B3,{ref:n,autoComplete:"off",className:"flex h-10 w-full items-center rounded-lg border-0 bg-transparent px-0 py-1.5 text-lg focus-visible:border-0 focus-visible:bg-transparent focus-visible:shadow-none focus-visible:outline-0 dark:bg-[#101114] dark:text-white dark:placeholder:text-gray-800",placeholder:"Search by name, handle, or URL...",title:"Search",type:"text",value:t,onChange:X=>o(X.target.value),onKeyDown:U}),a0&&z.jsx(mp,{className:"!absolute right-0 mr-0.5 shrink-0",size:"sm"})]}),z.jsxs("div",{className:"h-full",children:[Z&&z.jsx("div",{className:"flex h-full items-center justify-center pb-14",children:z.jsxs(e10,{children:[z.jsx(t10,{children:z.jsx(Ad,{})}),"No users matching this handle or account URL"]})}),z0&&z.jsx("div",{className:"mt-[-14px] pb-2",children:K.map((X,G)=>{const _=G===V;if(X.type==="topic")return z.jsx("div",{ref:d0=>r.current[G]=d0,children:z.jsxs(xp,{isSelected:_,onClick:()=>{e?.(!1),i(`/explore/${X.data.slug}`)},children:[z.jsx("div",{className:"flex size-10 shrink-0 items-center justify-center rounded-full bg-gray-100 dark:bg-gray-900",children:z.jsx(dp,{className:"text-gray-700 dark:text-gray-500",size:18,strokeWidth:1.5})}),z.jsxs("div",{className:"flex flex-col",children:[z.jsx("span",{className:"font-semibold text-black dark:text-white",children:X.data.name}),z.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-600",children:"Topic"})]})]})},X.data.slug);const I=X.data,i0=I.handle===C?.handle;return z.jsx(So,{actor:I,align:"center",isCurrentUser:i0,side:"left",children:z.jsx("div",{ref:d0=>r.current[G]=d0,children:z.jsxs(xp,{isSelected:_,onClick:()=>{e?.(!1),i(`/profile/${I.handle}`)},children:[z.jsx(jo,{author:{icon:{url:I.avatarUrl},name:I.name,handle:I.handle}}),z.jsxs("div",{className:"flex flex-col break-anywhere",children:[z.jsx("span",{className:"line-clamp-1 font-semibold text-black dark:text-white",children:I.name}),z.jsx("span",{className:"line-clamp-1 text-sm text-gray-700 dark:text-gray-600",children:I.handle})]}),I.blockedByMe||I.domainBlockedByMe?z.jsx(o1,{className:"pointer-events-none ml-auto min-w-[90px]",variant:"destructive",children:"Blocked"}):i0?null:z.jsx(i5,{className:"ml-auto",following:I.followedByMe,handle:I.handle,type:"secondary",onFollow:()=>f(I.id,{followedByMe:!0}),onUnfollow:()=>f(I.id,{followedByMe:!1})})]})})},I.id)})}),q0&&y&&z.jsxs(z.Fragment,{children:[z.jsx(v2,{children:"More people to follow"}),z.jsx(ir0,{onOpenChange:e})]})]})]})},zr0=()=>z.jsxs("div",{className:"inline-flex h-9 w-full items-center justify-start gap-2 rounded-full bg-gray-100 px-3 text-md font-normal text-gray-600 hover:bg-gray-200 hover:text-gray-600 dark:bg-gray-925/70 dark:text-gray-700 dark:hover:bg-gray-925 [&_svg]:size-[18px]",children:[z.jsx(fd,{size:18,strokeWidth:1.5})," Search the social web"]}),vn=p.forwardRef(({to:e,children:t,count:o,...n},r)=>{const a=we(),{resetStack:i}=t3(),b=J3(),l=e&&e.startsWith("/")?`${b}${e}`:e,u=l&&(a.pathname===l||a.pathname.startsWith(`${l}/`)),f=g0("justify-start text-md font-medium text-gray-800 dark:hover:bg-gray-925/70 dark:text-gray-500 h-9 [&_svg]:size-[18px]",u&&"bg-gray-100 dark:bg-gray-925/70 dark:text-white text-black font-semibold"),O=o&&o>0?z.jsx("span",{className:g0("ml-auto bg-purple-500 text-white text-xs font-semibold py-1 px-1.5 rounded-full min-w-[20px] h-5 flex items-center justify-center"),children:zd(o)}):null;return l?z.jsx(o1,{className:f,variant:"ghost",asChild:!0,children:z.jsxs(Ea,{to:l,onClick:()=>{i(),L10(l)},children:[t,O]})}):z.jsxs(o1,{ref:r,className:f,variant:"ghost",onClick:n.onClick,...n,children:[t,O]})});vn.displayName="SidebarMenuLink";const Mv=({isMobileSidebarOpen:e})=>{const{allFlags:t,flags:o}=kn0(),[n,r]=p.useState(!1),[a,i]=p.useState(""),{data:b}=ye(),l=we(),u=J3(),{data:f}=av(b?.slug||""),O=Qn0(b?.slug||""),{topicsQuery:h}=a5(),{data:q,isLoading:g}=h,W=!g&&q&&q.topics.length===0;p.useEffect(()=>{l.pathname===`${u}/notifications`&&f&&f>0&&O.mutate()},[l.pathname,u,f,O]);const v=p.useCallback(()=>{f&&f>0&&O.mutate()},[f,O]);return z.jsx("div",{className:`sticky top-0 flex min-h-screen w-[320px] flex-col border-l border-gray-200 pr-8 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:z.jsxs("div",{className:"flex grow flex-col justify-between",children:[z.jsxs("div",{className:"isolate flex w-full flex-col items-start gap-6 pl-6 pt-6",children:[z.jsx("div",{className:"flex h-[52px] w-full items-center",children:z.jsxs(W3,{open:n,onOpenChange:r,children:[z.jsx(Z9,{className:"mt-0.5 w-full",children:z.jsx(zr0,{})}),z.jsx(Xa,{className:"flex h-full max-h-[452px] flex-col overflow-y-auto pb-0",children:z.jsx(lr0,{query:a,setQuery:i,onOpenChange:r})})]})}),z.jsxs("div",{className:"flex w-full flex-col gap-px",children:[z.jsxs(vn,{to:"/reader",children:[z.jsx(uZ,{size:18,strokeWidth:1.5}),"Reader"]}),z.jsxs(vn,{to:"/notes",children:[z.jsx(Od,{size:18,strokeWidth:1.5}),"Notes"]}),z.jsxs(vn,{count:l.pathname!==`${u}/notifications`?f:void 0,to:"/notifications",onClick:v,children:[z.jsx(lZ,{size:18,strokeWidth:1.5}),"Notifications"]}),W?z.jsx(o1,{className:"inline-flex w-full items-center gap-2 rounded-sm px-3 py-2.5 text-left text-md font-medium text-gray-800 transition-colors hover:bg-gray-100 dark:text-gray-500 dark:hover:bg-gray-925/70",variant:"ghost",asChild:!0,children:z.jsxs("a",{href:"https://explore.ghost.org/social-web",rel:"noopener noreferrer",target:"_blank",children:[z.jsx(dp,{size:18,strokeWidth:1.5}),"Explore",z.jsx(dd,{className:"ml-auto",size:14,strokeWidth:1.5})]})}):z.jsxs(vn,{to:"/explore",children:[z.jsx(dp,{size:18,strokeWidth:1.5}),"Explore"]}),z.jsxs(vn,{to:"/profile",children:[z.jsx(hd,{size:18,strokeWidth:1.5}),"Profile"]}),z.jsxs(vn,{to:"/preferences",children:[z.jsx(AG,{size:18,strokeWidth:1.5}),"Preferences"]})]}),z.jsx(M5,{children:z.jsxs(o1,{className:"h-9 rounded-full bg-purple-500 px-3 text-md text-white hover:bg-purple-600 dark:hover:bg-purple-600",children:[z.jsx(SZ,{}),"New note"]})}),z.jsx(ar0,{}),t.map(y=>o[y]?z.jsxs("div",{className:"flex items-center justify-between gap-1 pl-3 opacity-50",children:[z.jsx("span",{className:"font-mono text-xs",children:y}),z.jsx("span",{className:"text-green-800 inline-flex items-center rounded bg-green-100 px-1 py-0.5 text-xs font-medium",children:"ON"})]},y):z.jsx(z.Fragment,{}))]}),z.jsx("div",{className:"sticky bottom-0 flex items-center gap-2 bg-white pb-4 pl-4 dark:bg-black",children:z.jsx(cr0,{})})]})})};Mv.displayName="Sidebar";const ur0=({children:e,...t})=>{const{isOnboarded:o}=iv(),n=J3(),{data:r,isLoading:a}=ye(),i=p.useRef(null),[b,l]=p.useState(!1),u=tv(),{topicsQuery:f}=a5(),{data:O}=f,h=O&&O.topics.length>0,{isNewNoteModalOpen:q,setIsNewNoteModalOpen:g}=sv(),W=()=>{l(!b)},v=()=>{l(!1)};return a||!r?null:o?z.jsxs("div",{ref:i,className:`h-screen w-full ${o&&"overflow-y-auto"}`,"data-scrollable-container":!0,children:[z.jsx(x10,{containerRef:i}),z.jsx("div",{className:"relative mx-auto flex max-w-page flex-col",...t,children:o?z.jsxs(z.Fragment,{children:[z.jsxs("div",{className:"block grid-cols-[auto_320px] items-start lg:grid",children:[z.jsxs("div",{className:"z-0 min-w-0",children:[z.jsx(Bn0,{showBorder:!(u==="reader"&&h)&&u!=="explore",onToggleMobileSidebar:W}),z.jsx("div",{className:"px-[min(4vw,32px)]",children:e})]}),z.jsx(Mv,{isMobileSidebarOpen:b,onCloseMobileSidebar:v})]}),b&&z.jsx("div",{className:"fixed inset-0 z-40 lg:hidden",onClick:v})]}):z.jsx(pv,{})}),z.jsx(M5,{open:q,onOpenChange:g})]}):z.jsx(Rn,{to:`${n}/welcome`,replace:!0})},Zc=({children:e})=>z.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-925/70 [&_svg]:size-8 [&_svg]:stroke-1",children:e}),Gc=({children:e,className:t})=>z.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}),bv=({statusCode:e,errorCode:t})=>{const o=hq(),n=sW(),r=a=>{a.preventDefault(),n("/analytics/",{crossApp:!0})};return o?z.jsx(ur0,{children:z.jsxs(Gc,{children:[z.jsx(Zc,{children:z.jsx(dG,{})}),z.jsx(v2,{className:"-mb-4",children:"Oops, page not found!"}),z.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?z.jsxs(Gc,{className:"mt-[50vh] -translate-y-1/2",children:[z.jsx(Zc,{children:z.jsx(yG,{})}),z.jsx(v2,{className:"-mb-4",children:"Rate limit exceeded"}),z.jsx("div",{children:"You've made too many requests. Please try again in a moment."}),z.jsx(o1,{asChild:!0,children:z.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"?z.jsxs(Gc,{className:"mt-[50vh] -translate-y-1/2",children:[z.jsx(Zc,{children:z.jsx(z9,{})}),z.jsx(v2,{className:"-mb-4",children:"Site not configured correctly"}),z.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."}),z.jsx(o1,{asChild:!0,children:z.jsx("a",{href:"https://ghost.org/help/social-web/",rel:"noopener noreferrer",target:"_blank",children:"Learn more →"})})]}):z.jsxs(Gc,{className:"mt-[50vh] -translate-y-1/2",children:[z.jsx(Zc,{children:z.jsx(MZ,{})}),z.jsx(v2,{className:"-mb-4",children:"Account suspended"}),z.jsx("div",{children:"Your account has been suspended due to policy violations."}),z.jsx(o1,{asChild:!0,children:z.jsx("a",{href:"https://ghost.org/help/social-web/",rel:"noopener noreferrer",target:"_blank",children:"Learn more →"})})]}):e===410&&t==="INVALID_VERSION"?z.jsxs(Gc,{className:"mt-[50vh] -translate-y-1/2",children:[z.jsx(Zc,{children:z.jsx(kZ,{})}),z.jsx(v2,{className:"-mb-4",children:"New version available"}),z.jsx("div",{children:"We've made some updates! Refresh your page to see what's new"}),z.jsx(o1,{asChild:!0,children:z.jsx("button",{type:"button",onClick:()=>window.location.reload(),children:"Refresh your page"})})]}):z.jsx("div",{className:"admin-x-container-error",children:z.jsxs("div",{className:"admin-x-error max-w-xl",children:[z.jsx("h1",{children:"Loading interrupted"}),z.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."}),z.jsx("a",{className:"cursor-pointer text-green",onClick:r,children:"← Back to the homepage"})]})})},dr0=Object.freeze(Object.defineProperty({__proto__:null,default:bv},Symbol.toStringTag,{value:"Module"})),Or0="activitypub",lv=[{path:Or0,element:z.jsx(Cn,{}),errorElement:z.jsx(bv,{}),handle:"activitypub-basepath",children:[{index:!0,element:z.jsx(Rn,{to:"reader"})},{path:"inbox",element:z.jsx(Rn,{to:"../reader",replace:!0})},{path:"feed",element:z.jsx(Rn,{to:"../notes",replace:!0})},{path:"reader",lazy:h1(()=>z1(()=>import("./index-V6YnSoDg.js"),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url)),pageTitle:"Reader"},{path:"reader/:postId",lazy:h1(()=>z1(()=>import("./index-V6YnSoDg.js"),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url)),pageTitle:"Reader"},{path:"notes",lazy:h1(()=>z1(()=>import("./feed-DDLXNcGg.js"),__vite__mapDeps([7,8]),import.meta.url)),pageTitle:"Notes"},{path:"notes/:postId",lazy:h1(()=>z1(()=>import("./note-ogkcCZSR.js"),__vite__mapDeps([9,2,3,8]),import.meta.url)),pageTitle:"Note"},{path:"notifications",lazy:h1(()=>z1(()=>import("./index-BDtDeIk7.js"),__vite__mapDeps([10,11,12,13]),import.meta.url)),pageTitle:"Notifications"},{path:"explore",lazy:h1(()=>z1(()=>import("./index-U6n3pegZ.js"),__vite__mapDeps([14,4,15]),import.meta.url)),pageTitle:"Explore"},{path:"explore/:topic",lazy:h1(()=>z1(()=>import("./index-U6n3pegZ.js"),__vite__mapDeps([14,4,15]),import.meta.url)),pageTitle:"Explore"},{path:"profile",lazy:h1(()=>z1(()=>import("./index-BZgoelCE.js"),__vite__mapDeps([16,17,18,11,19,20,21,22,23,24,25,8,6,1,26,12,27,13,15,3,28]),import.meta.url)),pageTitle:"Profile"},{path:"profile/likes",lazy:h1(()=>z1(()=>import("./index-BZgoelCE.js"),__vite__mapDeps([16,17,18,11,19,20,21,22,23,24,25,8,6,1,26,12,27,13,15,3,28]),import.meta.url)),pageTitle:"Profile"},{path:"profile/following",lazy:h1(()=>z1(()=>import("./index-BZgoelCE.js"),__vite__mapDeps([16,17,18,11,19,20,21,22,23,24,25,8,6,1,26,12,27,13,15,3,28]),import.meta.url)),pageTitle:"Profile"},{path:"profile/followers",lazy:h1(()=>z1(()=>import("./index-BZgoelCE.js"),__vite__mapDeps([16,17,18,11,19,20,21,22,23,24,25,8,6,1,26,12,27,13,15,3,28]),import.meta.url)),pageTitle:"Profile"},{path:"profile/:handle/:tab?",lazy:h1(()=>z1(()=>import("./index-BZgoelCE.js"),__vite__mapDeps([16,17,18,11,19,20,21,22,23,24,25,8,6,1,26,12,27,13,15,3,28]),import.meta.url)),pageTitle:"Profile"},{path:"preferences",lazy:h1(()=>z1(()=>import("./index-DAWuNQ5w.js"),__vite__mapDeps([29,30,26,25,28,18,11]),import.meta.url)),pageTitle:"Preferences"},{path:"preferences/moderation",lazy:h1(()=>z1(()=>import("./moderation-HKkI8Sxh.js"),__vite__mapDeps([31,19,20,21,22,23,11,24,25,8,6,1,17,26,12,27,13,15,3]),import.meta.url)),pageTitle:"Moderation",showBackButton:!0},{path:"preferences/bluesky-sharing",lazy:h1(()=>z1(()=>import("./bluesky-sharing-DDW1Nub2.js"),__vite__mapDeps([32,18,11,25]),import.meta.url)),showBackButton:!0},{path:"welcome",lazy:h1(()=>z1(()=>Promise.resolve().then(()=>rr0),void 0,import.meta.url)),pageTitle:"Welcome",children:[{path:"",element:z.jsx(Rn,{to:"1",replace:!0})},{path:"1",lazy:h1(()=>z1(()=>import("./step-1-CA4uyLlu.js"),__vite__mapDeps([33,25]),import.meta.url))},{path:"2",lazy:h1(()=>z1(()=>import("./step-2-O7Xt_jes.js"),__vite__mapDeps([34,35,13,27]),import.meta.url))},{path:"3",lazy:h1(()=>z1(()=>import("./step-3-qS8gvQIT.js"),__vite__mapDeps([36,35,13,27,22,6,8]),import.meta.url))},{path:"*",element:z.jsx(Rn,{to:"1",replace:!0})}]},{path:"*",lazy:h1(()=>z1(()=>Promise.resolve().then(()=>dr0),void 0,import.meta.url))}]}];function fr0(){return z.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[z.jsx("path",{d:"M3.6349 20.3723C3.80192 20.5393 4.00019 20.6718 4.21841 20.7622C4.43663 20.8525 4.67052 20.8991 4.90672 20.8991C5.14291 20.8991 5.3768 20.8525 5.59502 20.7622C5.81324 20.6718 6.01152 20.5393 6.17853 20.3723C6.34555 20.2052 6.47804 20.007 6.56843 19.7888C6.65882 19.5705 6.70534 19.3366 6.70534 19.1004C6.70534 18.8643 6.65882 18.6304 6.56843 18.4121C6.47804 18.1939 6.34555 17.9956 6.17853 17.8286C5.84123 17.4913 5.38374 17.3018 4.90672 17.3018C4.42969 17.3018 3.9722 17.4913 3.6349 17.8286C3.29759 18.1659 3.10809 18.6234 3.10809 19.1004C3.10809 19.5775 3.29759 20.035 3.6349 20.3723ZM17.7153 6.17951C17.8823 6.34653 18.0806 6.47901 18.2988 6.5694C18.517 6.65979 18.7509 6.70632 18.9871 6.70632C19.2233 6.70632 19.4572 6.65979 19.6754 6.5694C19.8936 6.47901 20.0919 6.34653 20.2589 6.17951C20.4259 6.01249 20.5584 5.81421 20.6488 5.596C20.7392 5.37778 20.7857 5.14389 20.7857 4.90769C20.7857 4.67149 20.7392 4.43761 20.6488 4.21939C20.5584 4.00117 20.4259 3.80289 20.2589 3.63587C19.9216 3.29857 19.4641 3.10907 18.9871 3.10907C18.5101 3.10907 18.0526 3.29857 17.7153 3.63587C17.378 3.97318 17.1885 4.43067 17.1885 4.90769C17.1885 5.38472 17.378 5.8422 17.7153 6.17951ZM7.50655 12.0023C7.50655 13.1946 7.98019 14.3381 8.82329 15.1812C9.66639 16.0243 10.8099 16.4979 12.0022 16.4979C13.1945 16.4979 14.338 16.0243 15.1811 15.1812C16.0242 14.3381 16.4978 13.1946 16.4978 12.0023C16.4978 10.81 16.0242 9.66647 15.1811 8.82337C14.338 7.98027 13.1945 7.50663 12.0022 7.50663C10.8099 7.50663 9.66639 7.98027 8.82329 8.82337C7.98019 9.66647 7.50655 10.81 7.50655 12.0023Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),z.jsx("path",{d:"M8.79319 21.5246C10.5669 22.1224 12.4724 22.2127 14.2947 21.7854C16.1171 21.3581 17.7838 20.4302 19.1069 19.1062C20.4302 17.7827 21.3577 16.116 21.7848 14.2937C22.2119 12.4715 22.1217 10.5662 21.5243 8.79251M2.47582 15.2081C1.87829 13.4342 1.78805 11.5287 2.21527 9.70622C2.64249 7.88378 3.57019 6.21687 4.89383 4.89332C6.21747 3.56977 7.88445 2.64219 9.70692 2.21511C11.5294 1.78802 13.4349 1.87839 15.2088 2.47605",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}function kp({path:e,activeOnSubpath:t=!1}){const o=t&&e?`${e}/*`:e;return QI(o||"")!==null}function U0({children:e,...t}){return z.jsx(Qd,{...t,children:e})}function Ar0({to:e,target:t,rel:o,activeOnSubpath:n=!1,isActive:r,children:a,...i}){const b=`#/${e?.replace(/^\/?#\//,"")}`,l=kp({path:e,activeOnSubpath:n}),u=r!==void 0?r:l,{isMobile:f,setOpenMobile:O}=Gn(),h=()=>{f&&O(!1)};return z.jsx(E3,{asChild:!0,isActive:u,...i,children:z.jsx("a",{href:t==="_blank"?e:b,rel:t==="_blank"?o??"noopener noreferrer":o,target:t,"aria-current":u?"page":void 0,onClick:h,children:a})})}function hr0({children:e,...t}){return z.jsx("span",{...t,children:e})}function qr0({onClick:e,children:t,...o}){const{isMobile:n,setOpenMobile:r}=Gn(),a=()=>{n&&r(!1),e?.()};return z.jsx(E3,{onClick:a,...o,children:t})}U0.Link=Ar0;U0.Label=hr0;U0.Button=qr0;function mr0({...e}){const{data:t}=ye(),{data:o}=Y3(),n=Tt(o?.settings,"social_web_enabled")??!1,a=X3().data?.site.url,{data:i=0}=av(t?.slug||"",n),b=kp({path:"network",activeOnSubpath:!0}),l=kp({path:"activitypub",activeOnSubpath:!0}),u=i>0&&!b&&!l;return!t||!ee0(t)?null:z.jsx(nc,{...e,children:z.jsx(Fa,{children:z.jsxs(rc,{children:[z.jsx(U0,{children:z.jsxs(U0.Link,{to:"analytics",activeOnSubpath:!0,children:[z.jsx(O9,{}),z.jsx(U0.Label,{children:"Analytics"})]})}),n&&z.jsxs(U0,{children:[z.jsxs(U0.Link,{to:"network",isActive:b||l,children:[z.jsx(fr0,{}),z.jsx(U0.Label,{children:"Network"})]}),u&&z.jsx(Zd,{children:i})]}),z.jsxs(U0,{className:"relative group/viewsite",children:[z.jsxs(U0.Link,{to:"site",children:[z.jsx(aZ,{}),z.jsx(U0.Label,{children:"View site"})]}),z.jsx("a",{href:a,target:"_blank","aria-label":"View site in new tab",rel:"noopener noreferrer",className:"absolute opacity-0 group-hover/viewsite:opacity-100 right-0 top-0 size-8 hover:bg-sidebar-accent flex items-center justify-center rounded-full text-gray-700 hover:text-sidebar-accent-foreground transition-all",children:z.jsx(dd,{size:16})})]})]})})})}function gr0({isExpanded:e,children:t,id:o}){return z.jsx("div",{id:o,className:`grid transition-all duration-200 ease-out ${e?"grid-rows-[1fr] mb-5":"grid-rows-[0fr] mb-0"}`,children:z.jsx("div",{className:"overflow-hidden",children:t})})}const Wr0="MembersResponseType",vr0=Hn({dataType:Wr0,path:"/members/"}),Wa0=Zt({method:"POST",path:({id:e})=>`/members/${e}/commenting/disable`,body:({reason:e})=>({reason:e}),invalidateQueries:{dataType:"CommentsResponseType"}}),va0=Zt({method:"POST",path:({id:e})=>`/members/${e}/commenting/enable`,body:()=>({}),invalidateQueries:{dataType:"CommentsResponseType"}});function Rr0(){const{data:e}=vr0({searchParams:{limit:"1"}});return e?.meta?.pagination.total}const yr0=()=>G3({select:e=>e.navigation}),wr0=()=>{const{mutateAsync:e}=K3();return Y1({mutationFn:async t=>{await e({navigation:t})}})},Lr0=e=>{const{data:t}=yr0(),{mutateAsync:o}=wr0();return[t?.expanded[e]??!0,async a=>o({expanded:{[e]:a}})]},xr0=yp({name:s2(),route:s2(),color:s2(),icon:s2().optional(),filter:Qo0(s2(),s2().nullable())}),kr0=e5(xr0);function Cr0(e){return{midgrey:"#7C8B9A",blue:"#14b8ff",green:"#30cf43",red:"#f50b23",teal:"#4dcddc",purple:"#8e42ff",yellow:"#ffb41f",orange:"#fe8b05",pink:"#fb2d8d"}[e]||"#7C8B9A"}function Nr0({route:e="posts"}){const{data:t}=Y3(),o=zW(),n=p.useMemo(()=>{const r=Tt(t?.settings,"shared_views")??"[]";try{const a=JSON.parse(r),i=kr0.safeParse(a);return i.success?i.data.filter(b=>b.route===e):(console.error("Failed to validate shared_views setting:",i.error),[])}catch(a){return console.error("Failed to parse shared_views setting:",a),[]}},[t,e]);return n.length===0?null:z.jsx(z.Fragment,{children:n.map(r=>{const a=o.getRouteUrl(e,r.filter),i=o.isRouteActive(e,r.filter);return z.jsx(U0,{children:z.jsxs(U0.Link,{className:"pl-9",to:a,isActive:i,children:[z.jsx(U0.Label,{className:"grow",children:r.name}),z.jsx("span",{className:"size-2 rounded-full shrink-0 mx-0.5",style:{backgroundColor:Cr0(r.color)},"data-color":r.color,"aria-hidden":"true"})]})},a)})})}const b5=e=>{const{data:t}=Ha();return t?.config.labs?.[e]??!1};function Br0({...e}){const{data:t}=ye(),[o,n]=Lr0("posts"),r=Rr0(),a=zW(),i=b5("commentModeration"),b=t&&J10(t),l=t&&Y10(t);return z.jsx(nc,{...e,children:z.jsx(Fa,{children:z.jsxs(rc,{children:[z.jsxs(U0,{children:[z.jsx(o1,{"aria-controls":"posts-submenu","aria-expanded":o,"aria-label":"Toggle post views",variant:"ghost",size:"icon",className:"!h-[34px] absolute sidebar:opacity-0 group-hover/menu-item:opacity-100 focus-visible:opacity-100 transition-all left-3 top-0 p-0 h-9 w-auto text-sidebar-accent-foreground hover:text-gray-black hover:bg-transparent",onClick:()=>void n(!o),children:z.jsx(ud,{size:16,className:`transition-all ${o&&"rotate-[90deg]"}`})}),z.jsxs(U0.Link,{to:a.getRouteUrl("posts"),isActive:a.isRouteActive("posts"),children:[z.jsx(M9,{className:"opacity-0 sidebar:opacity-100 sidebar:group-hover/menu-item:opacity-0 pointer-events-none transition-all"}),z.jsx(U0.Label,{children:"Posts"})]}),z.jsx("a",{href:"#/editor/post","aria-label":"Create new post",className:"flex items-center justify-center absolute hover:bg-sidebar-accent transition-all rounded-full right-0 top-0 p-0 size-8 text-gray-700 hover:text-sidebar-accent-foreground",children:z.jsx(b9,{size:20,className:"!stroke-[1.5px] mt-px"})})]}),z.jsxs(gr0,{isExpanded:o,id:"posts-submenu",children:[z.jsx(U0,{children:z.jsx(U0.Link,{className:"pl-9",to:"posts?type=draft",isActive:a.isRouteActive("posts",{type:"draft"}),children:z.jsx(U0.Label,{children:"Drafts"})})}),z.jsx(U0,{children:z.jsx(U0.Link,{className:"pl-9",to:"posts?type=scheduled",isActive:a.isRouteActive("posts",{type:"scheduled"}),children:z.jsx(U0.Label,{children:"Scheduled"})})}),z.jsx(U0,{children:z.jsx(U0.Link,{className:"pl-9",to:"posts?type=published",isActive:a.isRouteActive("posts",{type:"published"}),children:z.jsx(U0.Label,{children:"Published"})})}),z.jsx(Nr0,{})]}),z.jsx(U0,{children:z.jsxs(U0.Link,{to:a.getRouteUrl("pages"),isActive:a.isRouteActive("pages"),children:[z.jsx(jZ,{}),z.jsx(U0.Label,{children:"Pages"})]})}),b&&z.jsx(U0,{children:z.jsxs(U0.Link,{to:"tags",isActive:a.isRouteActive(["tags","tag","tag.new"]),children:[z.jsx(gG,{}),z.jsx(U0.Label,{children:"Tags"})]})}),l&&z.jsxs(U0,{children:[z.jsxs(U0.Link,{to:a.getRouteUrl("members"),isActive:a.isRouteActive(["members","member","member.new"]),children:[z.jsx(f9,{}),z.jsx(U0.Label,{children:"Members"})]}),r!=null&&z.jsx(Zd,{children:r})]}),l&&i&&z.jsx(U0,{children:z.jsxs(U0.Link,{to:"comments",activeOnSubpath:!0,children:[z.jsx(rG,{}),z.jsx(U0.Label,{children:"Comments"})]})})]})})})}const RA=function(){let t,o;return{promise:new Promise((r,a)=>{t=r,o=a}),resolve:t,reject:o}},Rl="https://do.featurebase.app/js/sdk.js",_r0="Feature Request";let ea=null;function Er0(){return ea||(ea=new Promise((e,t)=>{if(document.querySelector(`script[src="${Rl}"]`)){e();return}const n=document.createElement("script");n.src=Rl,n.onload=()=>e(),n.onerror=r=>{n.remove(),ea=null;const a=new Error(`[Featurebase] Failed to load SDK from ${Rl}`,{cause:r});console.error(a),t(a)},document.head.appendChild(n)})),ea}function Sr0(){const{data:e}=Ha(),{data:t}=G3(),o=b5("featurebaseFeedback"),[n,r]=p.useState(!1),{organization:a,enabled:i}=e?.config.featurebase??{},b=!!(o&&i),l=t?.nightShift?"dark":"light",{data:u}=E10({enabled:b&&n}),f=u?.featurebase?.token;p.useEffect(()=>{n&&Er0().catch(g=>{console.error("[Featurebase] Failed to load SDK:",g)})},[n]);const O=p.useRef(RA());p.useEffect(()=>{!n||!a||!f||ea?.then(()=>{window.Featurebase?.("initialize_feedback_widget",{organization:a,theme:l,defaultBoard:_r0,featurebaseJwt:f},g=>{g?(console.error("[Featurebase] Failed to initialize widget:",g),O.current.reject(g),O.current=RA(),r(!1)):O.current.resolve()})})},[a,l,f,n]);const h=p.useCallback(()=>{b&&r(!0)},[b]);return{openFeedbackWidget:p.useCallback(g=>{b&&(r(!0),O.current.promise.then(()=>{window.postMessage({target:"FeaturebaseWidget",data:{action:"openFeedbackWidget",...g?.board&&{setBoard:g.board}}},"*")}))},[b]),preloadFeedbackWidget:h}}function Tr0({...e}){const{data:t}=ye(),{data:o}=Ha(),n=b5("featurebaseFeedback"),{openFeedbackWidget:r,preloadFeedbackWidget:a}=Sr0();if(!t)return null;const b=o?.config.hostSettings?.billing?.enabled&&Va(t),l=n&&!P3(t)&&o?.config.featurebase?.enabled;return!b&&!l?null:z.jsx(nc,{...e,children:z.jsx(Fa,{children:z.jsxs(rc,{children:[b&&z.jsx(U0,{children:z.jsxs(U0.Link,{to:"pro",children:[z.jsx(NZ,{}),z.jsx(U0.Label,{children:"Ghost(Pro)"})]})}),l&&z.jsx(U0,{children:z.jsxs(U0.Button,{onClick:r,onMouseEnter:a,onFocus:a,children:[z.jsx(Od,{}),z.jsx(U0.Label,{children:"Feedback"})]})})]})})})}function Pr0({...e}){const{data:t}=ye(),o=t&&K10(t);return z.jsx(nc,{...e,children:z.jsx(Fa,{children:z.jsxs(rc,{children:[o&&z.jsx(U0,{children:z.jsxs(U0.Link,{to:"settings",children:[z.jsx(z9,{}),z.jsx(U0.Label,{children:"Settings"})]})}),z.jsx(U0,{children:z.jsxs(U0.Link,{to:"https://ghost.org/help?utm_source=admin&utm_campaign=help",target:"_blank",rel:"noopener noreferrer",children:[z.jsx(yZ,{}),z.jsx(U0.Label,{children:"Help"})]})})]})})})}const Xr0=""+new URL("ghost-pro-logo-B1sXD_MX.png",import.meta.url).href;function jr0({trialDaysRemaining:e}){return z.jsxs(vd,{variant:"gradient",size:"lg",className:"mx-2 my-5 flex flex-col items-stretch",children:[z.jsx("div",{children:z.jsx("img",{src:Xr0,alt:"Ghost Pro",className:"max-h-[33px]"})}),z.jsx("div",{className:"text-base mt-3 font-semibold",children:"Unlock every feature"}),z.jsxs("div",{className:"mt-2 text-gray-700 text-sm mb-4",children:["Choose a plan to access the full power of Ghost right away, you have ",z.jsxs("span",{className:"font-semibold text-black",children:[e," days"]})," free trial remaining."]}),z.jsx(o1,{asChild:!0,children:z.jsx("a",{href:"#/pro/billing/plans",children:"Upgrade now"})})]})}function Dr0(){const{showUpgradeBanner:e,trialDaysRemaining:t}=QW();return z.jsxs(rW,{className:"px-3 pt-4 justify-between",children:[z.jsxs("div",{className:"flex flex-col gap-2 sidebar:gap-4",children:[z.jsx(mr0,{}),z.jsx(Br0,{}),z.jsx(Tr0,{})]}),z.jsxs("div",{className:"flex flex-col gap-2 sidebar:gap-4",children:[e?z.jsx(jr0,{trialDaysRemaining:t}):z.jsx(yn0,{}),z.jsx(Pr0,{className:"pb-0"})]})]})}function Ir0({...e}){return z.jsxs(Jg,{...e,children:[z.jsx(ce0,{className:"px-5 pt-6 pb-0"}),z.jsx(Dr0,{}),z.jsx(Rn0,{className:"p-3 gap-0"})]})}const ki=1.5;function yl({to:e,activeOnSubpath:t=!1,children:o,...n}){const r=kp({path:e,activeOnSubpath:t});return z.jsx(o1,{asChild:!0,className:`rounded-full w-full max-w-16 min-w-9 hover:bg-gray-200 ${r?"bg-gray-200":"bg-transparent"}`,...n,variant:"ghost",size:"icon","data-active":r,children:z.jsx("a",{href:e,children:o})})}function Fr0(){const{isMobile:e}=Gn();return e?z.jsx("div",{className:"fixed sidebar:hidden bottom-0 left-0 right-0 h-[var(--mobile-navbar-height)] bg-sidebar/80 backdrop-blur-md border-t border-sidebar-border z-50 safe-area-inset-bottom",children:z.jsxs("div",{className:"grid grid-cols-4 items-center w-full justify-items-center max-w-[300px] h-full mx-auto px-5",children:[z.jsxs(yl,{activeOnSubpath:!0,to:"analytics",children:[z.jsx(O9,{strokeWidth:ki}),z.jsx("span",{className:"sr-only",children:"Analytics"})]}),z.jsxs(yl,{activeOnSubpath:!0,to:"posts",children:[z.jsx(M9,{strokeWidth:ki}),z.jsx("span",{className:"sr-only",children:"Posts"})]}),z.jsxs(yl,{activeOnSubpath:!0,to:"members",children:[z.jsx(f9,{strokeWidth:ki}),z.jsx("span",{className:"sr-only",children:"Members"})]}),z.jsxs(eW,{className:"rounded-full px-8 h-9 hover:bg-transparent",children:[z.jsx(p9,{strokeWidth:ki}),z.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})]})}):z.jsx(z.Fragment,{})}function Hr0({children:e}){const{data:t}=ye(),o=H10();return t&&P3(t)?z.jsxs("div",{className:"relative h-full bg-background",children:[z.jsx("main",{className:"h-full overflow-auto",children:e}),z.jsx("div",{className:"fixed bottom-3.5 left-3.5 lg:bottom-8 lg:left-8 z-20",children:z.jsx(vn0,{})})]}):z.jsxs(Yg,{open:!!t&&o,children:[z.jsx(Ir0,{}),z.jsxs(tW,{className:"bg-background overflow-y-scroll max-h-[calc(100%-var(--mobile-navbar-height))] sidebar:max-h-full",children:[z.jsx("main",{className:"flex-1",children:e}),z.jsx(Fr0,{})]})]})}function Ur0(){const{data:e}=ye();return I10(),D10(),z.jsx(S10,{children:e?z.jsxs(Hr0,{children:[z.jsx(Cn,{}),z.jsx(Zf,{})]}):z.jsxs(z.Fragment,{children:[z.jsx(Rz,{}),z.jsx(Zf,{})]})})}const zv=p.createContext(void 0),Ra0=()=>{const e=p.useContext(zv);if(e===void 0)throw new Error("useAppContext must be used within an AppProvider");return e},Vr0=({children:e,value:t})=>{const o=p.useContext(cu),n=t.externalNavigate??o?.externalNavigate;if(!n)throw new Error("External navigate function is required");const r={externalNavigate:n,fromAnalytics:!1,...o,...t};return z.jsx(zv.Provider,{value:r,children:e})},$r0=[{path:"",errorElement:z.jsx(gp,{onBackToDashboard:()=>{}}),children:[{path:"posts/analytics/:postId",lazy:async()=>{const[{default:e},{default:t}]=await Promise.all([z1(()=>import("./post-analytics-context-Q5WH1OnQ.js").then(o=>o.p),__vite__mapDeps([37,38]),import.meta.url),z1(()=>import("./post-analytics-D18eSSAi.js"),__vite__mapDeps([39,40,41,38,37]),import.meta.url)]);return{element:z.jsx(e,{children:z.jsx(t,{})})}},children:[{path:"",lazy:h1(()=>z1(()=>import("./overview-CiiVNdYO.js"),__vite__mapDeps([42,43,44,23,45,46,47,48,49,50,41,37,38,51,3,15,52,53,54,21,22,11,24,25,8,6,1,17,26,12,27,13,55,19,20,5,56,57,58,59]),import.meta.url))},{path:"web",lazy:h1(()=>z1(()=>import("./web-DETqckpf.js"),__vite__mapDeps([60,61,24,37,38,52,53,23,54,44,45,21,22,11,25,8,6,1,17,26,12,27,13,15,3,55,47,48,19,20,62,50,41,51,63,5]),import.meta.url))},{path:"growth",lazy:h1(()=>z1(()=>import("./growth-CYRGfktJ.js").then(e=>e.g),__vite__mapDeps([56,5,23,53,54,44,57,43,50,41,37,38,51,3,15,58,59]),import.meta.url))},{path:"newsletter",lazy:h1(()=>z1(()=>import("./newsletter-DKF9Mp-n.js"),__vite__mapDeps([64,44,23,65,21,22,11,24,25,8,6,1,17,26,12,27,13,15,3,19,20,43,50,41,37,38,51,45,46,47,48,49,59]),import.meta.url))}]},{path:"tags",children:[{index:!0,lazy:h1(()=>z1(()=>import("./tags-tIPIuOOB.js"),__vite__mapDeps([66,30,67,40,57,17,5]),import.meta.url))},{path:":tagSlug",element:null}]},{path:"comments",lazy:h1(()=>z1(()=>import("./comments-DtPXetSc.js"),__vite__mapDeps([68,63,24,38,67,40,13,5]),import.meta.url))},{path:"*",element:z.jsx(gp,{onBackToDashboard:()=>{}})}]}],Qr0={today:{name:"Today",value:1},last7Days:{name:"Last 7 days",value:7},last30Days:{name:"Last 30 days",value:31},last3Months:{name:"Last 90 days",value:91},yearToDate:{name:"Year to date",value:-1},last12Months:{name:"Last 12 months",value:372},allTime:{name:"All time",value:1e3}},Zr0=Object.values(Qr0),Gr0=2,ya0={US:"United States",TWN:"Taiwan",TW:"Taiwan","mobile-ios":"iOS","mobile-android":"Android",macos:"macOS","google.com":"Google","ghost.org":"Ghost","bing.com":"Bing","bsky.app":"Bluesky","yahoo.com":"Yahoo","duckduckgo.com":"DuckDuckGo",unknown:"Unknown",Others:"Unknown",Other:"Unknown",NULL:"Unknown","ᴺᵁᴸᴸ":"Unknown"},wa0=["NULL","ᴺᵁᴸᴸ","","Others","Other"],La0="https://static.ghost.org/v5.0.0/images/globe-icon.svg",Dr={PUBLIC:1,FREE:2,PAID:4},xa0=Dr.PUBLIC|Dr.FREE|Dr.PAID,ka0=[{name:"Public visitors",value:"undefined",bit:Dr.PUBLIC},{name:"Free members",value:"free",bit:Dr.FREE},{name:"Paid members",value:"paid",bit:Dr.PAID}],uv=p.createContext(void 0),Ca0=()=>{const e=p.useContext(uv);if(e===void 0)throw new Error("useGlobalData must be used within a GlobalDataProvider");return e},Kr0=({children:e})=>{const t=Y3(),o=X3(),n=Ha(),r=n.data?.config,a=!!r?.stats,i=XD({enabled:a}),[b,l]=p.useState(Zr0[Gr0].value),[u,f]=p.useState(null),O=[n,t,o],h=O.map(k=>k.error).find(Boolean),q=a?i.error:null,g=h||q,W=O.some(k=>k.isLoading),v=a?i.isLoading:!1,y=W||v;if(g)throw g;const x={url:o.data?.site.url,icon:o.data?.site.icon,title:o.data?.site.title};return z.jsx(uv.Provider,{value:{data:r,site:x,statsConfig:r?.stats,tinybirdToken:i.token,isLoading:y,range:b,setRange:l,settings:t.data?.settings||[],selectedNewsletterId:u,setSelectedNewsletterId:f},children:e})},Yr0=[{path:"analytics",children:[{index:!0,lazy:h1(()=>z1(()=>import("./index-CvBG2BMA.js"),__vite__mapDeps([69,70,61,24,44,23,15,21,22,11,25,8,6,1,17,26,12,27,13,3,5,41,51,55,47,48,71,72,59,58,38]),import.meta.url))},{path:"web",lazy:h1(()=>z1(()=>import("./index-Byclwr0r.js"),__vite__mapDeps([73,70,61,24,44,23,15,21,22,11,25,8,6,1,17,26,12,27,13,3,62,45,5,65,74,54,63,71,59,19,20,55,47,48]),import.meta.url))},{path:"growth",lazy:h1(()=>z1(()=>import("./index-BZqobMDm.js"),__vite__mapDeps([75,70,61,24,44,23,15,21,22,11,25,8,6,1,17,26,12,27,13,3,5,55,47,48,19,20,71,76,57,74,58,54,59,77,49,72]),import.meta.url))},{path:"newsletters",lazy:h1(()=>z1(()=>import("./index-U4HnwjaT.js"),__vite__mapDeps([78,70,61,24,44,23,15,21,22,11,25,8,6,1,17,26,12,27,13,3,47,48,5,55,19,20,76,57,79,59]),import.meta.url))}]}],Jr0=[{element:z.jsx($10,{}),children:[{path:"/tags/:tagSlug",Component:Rz,handle:{allowInForceUpgrade:!0}},{element:z.jsx(Vr0,{value:{fromAnalytics:!0},children:z.jsx(Cn,{})}),children:$r0[0].children.filter(e=>e.path!=="*")},{element:z.jsx(Kr0,{children:z.jsx(Cn,{})}),children:Yr0},{path:"network",loader:()=>zI("/activitypub")},{path:"",element:z.jsx(wn0,{children:z.jsx(Cn,{})}),children:lv},{path:"settings/*",lazy:h1(()=>z1(()=>import("./settings-CRoQOSBR.js").then(e=>e.bo),__vite__mapDeps([80,20,79,38,77]),import.meta.url)),handle:{allowInForceUpgrade:!0}},{path:"*",Component:Rz,handle:{allowInForceUpgrade:!0}}]}],ec0=["http:","https:","mailto:","tel:"];function tc0(e){if(e.match(/^[a-z]+:/i))try{const t=new URL(e);return ec0.includes(t.protocol)?(window.location.href=e,!0):!1}catch{const t=e.startsWith("/")?e:`/${e}`;return window.location.hash=t,!0}else{const t=e.startsWith("/")?e:`/${e}`;return window.location.hash=t,!0}}function oc0({children:e}){const{data:t}=Y3(),o=p.useMemo(()=>{if(!t?.settings)return;const n=t.settings;return{paidMembersEnabled:Tt(n,"paid_members_enabled")??!1,newslettersEnabled:Tt(n,"editor_default_email_recipients")!=="disabled",analytics:{emailTrackOpens:Tt(n,"email_track_opens")??!1,emailTrackClicks:Tt(n,"email_track_clicks")??!1,membersTrackSources:Tt(n,"members_track_sources")??!1,outboundLinkTagging:Tt(n,"outbound_link_tagging")??!1,webAnalytics:Tt(n,"web_analytics_enabled")??!1}}},[t]);return z.jsx(_x,{appSettings:o,children:e})}const nc0={ghostVersion:"",externalNavigate:e=>{tc0(e.route)},unsplashConfig:{Authorization:"","Accept-Version":"","Content-Type":"","App-Pragma":"","X-Unsplash-Cache":!0},sentryDSN:null,onUpdate:(e,t)=>{window.EmberBridge?.state.onUpdate(e,t)},onInvalidate:e=>{window.EmberBridge?.state.onInvalidate(e)},onDelete:(e,t)=>{window.EmberBridge?.state.onDelete(e,t)}};ay.createRoot(document.getElementById("root")).render(z.jsx(p.StrictMode,{children:z.jsx(Bx,{...nc0,children:z.jsx(k10,{prefix:"/",routes:Jr0,children:z.jsx(oc0,{children:z.jsx(CK,{className:"shade-admin",darkMode:!1,fetchKoenigLexical:null,children:z.jsx(Ur0,{})})})})})}));export{i9 as $,jo as A,o1 as B,ud as C,W3 as D,Gc as E,or0 as F,ta0 as G,v2 as H,oa0 as I,ca0 as J,aa0 as K,ur0 as L,na0 as M,ra0 as N,y10 as O,So as P,e10 as Q,t10 as R,w1 as S,MZ as T,xp as U,ve as V,fa0 as W,qd as X,Aa0 as Y,ha0 as Z,aW as _,t3 as a,_n as a$,NK as a0,h9 as a1,q9 as a2,g9 as a3,W9 as a4,m9 as a5,R9 as a6,v9 as a7,O3 as a8,K9 as a9,V0 as aA,Pp as aB,z1 as aC,bh as aD,Z1 as aE,Ha as aF,X3 as aG,Y3 as aH,XD as aI,iZ as aJ,Tc0 as aK,Cn as aL,sW as aM,Bc0 as aN,Zm as aO,w10 as aP,dp as aQ,Ra0 as aR,Wc0 as aS,Rc0 as aT,Zr as aU,Su as aV,Vm as aW,p9 as aX,Pd as aY,Nc0 as aZ,Qm as a_,xd as aa,ZZ as ab,Hn as ac,Zt as ad,BD as ae,vc0 as af,Oc0 as ag,y0 as ah,hc0 as ai,zd as aj,ND as ak,Sc0 as al,uW as am,Jt as an,O9 as ao,$m as ap,Zh as aq,Yo as ar,_e as as,e2 as at,H0 as au,Kh as av,UX as aw,VX as ax,Q0 as ay,$t as az,eo as b,xc0 as b$,cW as b0,R2 as b1,xa0 as b2,ka0 as b3,Dr as b4,$p as b5,d7 as b6,Qh as b7,Y0 as b8,re as b9,za0 as bA,lZ as bB,Qc as bC,wi as bD,md as bE,gd as bF,Wd as bG,o10 as bH,_c0 as bI,Zg as bJ,c10 as bK,a10 as bL,s10 as bM,J00 as bN,Ac0 as bO,dc0 as bP,hd as bQ,Ca0 as bR,ac0 as bS,gc0 as bT,Nf as bU,Rn as bV,qa0 as bW,O00 as bX,f00 as bY,A00 as bZ,yg as b_,jx as ba,ij as bb,Bu as bc,Yr as bd,he as be,Qp as bf,Eu as bg,xa as bh,Ho as bi,La as bj,Vp as bk,O7 as bl,f7 as bm,hZ as bn,tn as bo,M5 as bp,c5 as bq,mZ as br,SZ as bs,ia0 as bt,In0 as bu,_n0 as bv,bv as bw,ua0 as bx,cc as by,FZ as bz,Zc as c,ev as c$,f9 as c0,gG as c1,we as c2,yA as c3,Xp as c4,U9 as c5,$9 as c6,h3 as c7,q3 as c8,fd as c9,qc0 as cA,Qr0 as cB,$Z as cC,Bf as cD,NZ as cE,Fz as cF,Zr0 as cG,BK as cH,fl as cI,TK as cJ,ba0 as cK,sa0 as cL,la0 as cM,Cp as cN,wa0 as cO,ya0 as cP,M9 as cQ,mc0 as cR,La0 as cS,yc0 as cT,br0 as cU,vr0 as cV,LZ as cW,Wa0 as cX,va0 as cY,Od as cZ,oG as c_,mJ as ca,gJ as cb,b9 as cc,Gm as cd,ng as ce,pc0 as cf,Uc0 as cg,Vc0 as ch,gW as ci,da0 as cj,d9 as ck,kG as cl,B3 as cm,aY as cn,yp as co,WA as cp,vA as cq,ma0 as cr,ga0 as cs,s2 as ct,$n0 as cu,JQ as cv,wc0 as cw,Lc0 as cx,fc0 as cy,PZ as cz,Li as d,sa as d$,Gn0 as d0,pa0 as d1,Ma0 as d2,rc0 as d3,YR as d4,jp as d5,kN as d6,x6 as d7,Z7 as d8,$c0 as d9,Va as dA,Pc0 as dB,dW as dC,Xc0 as dD,Dc0 as dE,K10 as dF,OW as dG,Ic0 as dH,T3 as dI,yh as dJ,ic0 as dK,cX as dL,C6 as dM,N6 as dN,Jz as dO,wu as dP,Wh as dQ,Mj as dR,R7 as dS,y7 as dT,w7 as dU,ek as dV,dD as dW,bc0 as dX,OD as dY,$7 as dZ,Kp as d_,Kc0 as da,ol as db,lc0 as dc,zc0 as dd,Yz as de,Fc0 as df,yD as dg,Jr as dh,ma as di,Gc0 as dj,$2 as dk,T10 as dl,P10 as dm,X10 as dn,Tt as dp,XP as dq,Hc0 as dr,oe0 as ds,Jc0 as dt,Zc0 as du,Qc0 as dv,K1 as dw,ee0 as dx,jc0 as dy,oz as dz,b0 as e,ye as e0,uc0 as e1,f1 as e2,mw as e3,Ec0 as e4,Q10 as e5,Yc0 as e6,P3 as e7,lh as e8,sc0 as e9,qh as ea,aZ as eb,OZ as ec,uZ as ed,vZ as ee,yZ as ef,kZ as eg,jZ as eh,UZ as ei,KZ as ej,JZ as ek,rG as el,aG as em,iG as en,bG as eo,l9 as ep,dG as eq,z9 as er,AG as es,u9 as et,yG as eu,Ad as ev,LG as ew,rZ as ex,mp as f,Xo as g,xo as h,ea0 as i,z as j,iv as k,Oa0 as l,r5 as m,i5 as n,Vi as o,a5 as p,Z9 as q,p as r,Dz as s,Xa as t,YI as u,Ld as v,kd as w,dd as x,g0 as y,Ea as z};