@remit/web-client-dist 0.0.690 → 0.0.691

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 (233) hide show
  1. package/assets/{BriefPane-uF6csCem.js → BriefPane-uBrSdO9E.js} +1 -1
  2. package/assets/{CalendarEventEditor-B0SWzPqQ.js → CalendarEventEditor-CW-VkuRj.js} +1 -1
  3. package/assets/{CalendarEventPopup-V9BZRnwN.js → CalendarEventPopup-Dr1Zl88E.js} +1 -1
  4. package/assets/{CalendarLoadFailed-CU4C4nFf.js → CalendarLoadFailed-CqaZI6s0.js} +1 -1
  5. package/assets/CalendarQuickCreate-BSauej6s.js +1 -0
  6. package/assets/{CalendarSession-Ub9ZzsQN.js → CalendarSession-UbavgUO4.js} +1 -1
  7. package/assets/DesktopChrome-DSs02PMr.js +1 -0
  8. package/assets/{DropdownMenu-CGhv-K3k.js → DropdownMenu-DlTVA419.js} +1 -1
  9. package/assets/{EmptyState-B_Kthrla.js → EmptyState-3mzd9Rr2.js} +1 -1
  10. package/assets/{ErrorState-BB0xpcCi.js → ErrorState-Czrn8Njd.js} +1 -1
  11. package/assets/{FlaggedPane-CyyX0x8y.js → FlaggedPane-Duxks4wd.js} +1 -1
  12. package/assets/{FullCompose-sAZlqUaR.js → FullCompose-C6ydcOqj.js} +1 -1
  13. package/assets/{LabelApplyTrigger-ChzWyjHs.js → LabelApplyTrigger-BeYgQjx0.js} +1 -1
  14. package/assets/{MailShell-DY2Ot0ah.js → MailShell-qe4eiESL.js} +1 -1
  15. package/assets/{MailViewChrome-U9YpZx_B.js → MailViewChrome-DmD7yKe9.js} +1 -1
  16. package/assets/{MailboxPane-DszlAx2f.js → MailboxPane-Cd7n8_0e.js} +1 -1
  17. package/assets/MessageBody-Dx9mvb7l.js +84 -0
  18. package/assets/MessageToolbar-D_XE8m4l.js +1 -0
  19. package/assets/{NavMenuButton-B_c3nIpV.js → NavMenuButton-B9iy2p3f.js} +1 -1
  20. package/assets/OnboardingWizard-Cb8hwkpv.js +1 -0
  21. package/assets/{OutboxPane-D47KP_dW.js → OutboxPane-CByBDVdV.js} +1 -1
  22. package/assets/{ReportLink-C4yyzfnn.js → ReportLink-CVPckN6-.js} +1 -1
  23. package/assets/_calendarObjectId-Dus6Z_aO.js +1 -0
  24. package/assets/_mailboxId-DA2rNZ6D.js +1 -0
  25. package/assets/_messageId-CBEFnj_-.js +1 -0
  26. package/assets/_messageId-CoU9lExJ.js +1 -0
  27. package/assets/_messageId-UN1wPrb5.js +1 -0
  28. package/assets/_outboxMessageId-Crw8NNd4.js +1 -0
  29. package/assets/_recurrenceId-DN3W2Byk.js +1 -0
  30. package/assets/_slotId-BLO1Rmfd.js +1 -0
  31. package/assets/_threadId-CGEJtUok.js +1 -0
  32. package/assets/_threadId-CrzKmCrt.js +1 -0
  33. package/assets/_threadId-D5at7_2j.js +1 -0
  34. package/assets/_view._date-CZiRXVFR.js +1 -0
  35. package/assets/account-service-status-DLPjTYw9.js +1 -0
  36. package/assets/accounts-Dl4YCzpm.js +1 -0
  37. package/assets/advanced-CgXbUOtb.js +1 -0
  38. package/assets/agenda-time-KJVZW5dD.js +1 -0
  39. package/assets/{app-chrome-BI9iJnw3.js → app-chrome-1USNGfE3.js} +1 -1
  40. package/assets/appearance-C6nkCe1H.js +1 -0
  41. package/assets/{avatar-COXPYlBH.js → avatar-Bo0EUTkm.js} +1 -1
  42. package/assets/{badge-DLlDkvBl.js → badge-C7MFP1pN.js} +1 -1
  43. package/assets/{bottom-sheet-BUOc_BG6.js → bottom-sheet-C9u72VJg.js} +1 -1
  44. package/assets/{brief-iq8Ra5O_.js → brief-CMzu4LMD.js} +1 -1
  45. package/assets/brief-DYSQ_oRb.js +1 -0
  46. package/assets/{calendar-Cmzt0eKc.js → calendar-B8lLrLAb.js} +1 -1
  47. package/assets/{calendar-event-popup-BvI6Qwla.js → calendar-event-popup-C92tAdsE.js} +1 -1
  48. package/assets/{calendar-event-sidebar-Dx3WbbPv.js → calendar-event-sidebar-CahohNiL.js} +1 -1
  49. package/assets/{calendar-failure-note-BRyIsChq.js → calendar-failure-note-D746wu0r.js} +1 -1
  50. package/assets/calendar-guests-DnrOkTr7.js +1 -0
  51. package/assets/{calendar-DCTglXEB.js → calendar-iY8BLzO2.js} +1 -1
  52. package/assets/calendar-suggestion-yCUw5guW.js +1 -0
  53. package/assets/calendars-ZADJ8TZ1.js +1 -0
  54. package/assets/{card-XAEgDd1b.js → card-5b65wlka.js} +1 -1
  55. package/assets/checkbox-CvgfSohd.js +1 -0
  56. package/assets/chevron-down-CR89KUgK.js +1 -0
  57. package/assets/chevron-left-DSaOqH7y.js +1 -0
  58. package/assets/circle-check-9HYVTIrG.js +1 -0
  59. package/assets/circle-check-big-p6il4Jr3.js +1 -0
  60. package/assets/circle-question-mark-BVVFmkJG.js +1 -0
  61. package/assets/classification-BoqrRObl.js +1 -0
  62. package/assets/clock-D6gctGNH.js +1 -0
  63. package/assets/compose._-_outboxMessageId_-Cv8p7Ifc.js +1 -0
  64. package/assets/compose._-_outboxMessageId_-Dj0vXnYT.js +1 -0
  65. package/assets/compose._-_outboxMessageId_-Dsv-7Ma0.js +1 -0
  66. package/assets/compose._-_outboxMessageId_-_t-bMwDD.js +1 -0
  67. package/assets/{config-import-DZkZ73sW.js → config-import-BtJdN8VN.js} +1 -1
  68. package/assets/{confirm-dialog-D33DXPkQ.js → confirm-dialog-DYNhLVrG.js} +1 -1
  69. package/assets/copy-BwtY4IWi.js +1 -0
  70. package/assets/credential-steps-Czm9bF6Y.js +1 -0
  71. package/assets/download-V38kBiT1.js +1 -0
  72. package/assets/{draft--MHSP3BT.js → draft-C849UdJB.js} +1 -1
  73. package/assets/edit-D9CdMYNH.js +1 -0
  74. package/assets/edit-Dhgn_BMZ.js +1 -0
  75. package/assets/external-link-BVJU7bpX.js +1 -0
  76. package/assets/file-braces-CEQVt7jm.js +1 -0
  77. package/assets/filters-D9G5dAF4.js +1 -0
  78. package/assets/{flagged-C-DEfMAa.js → flagged-CwOw5Xxs.js} +1 -1
  79. package/assets/flagged-aucGpj-Z.js +1 -0
  80. package/assets/folder-input-Bgx-bBiO.js +1 -0
  81. package/assets/folders-Bn_4Y9H0.js +1 -0
  82. package/assets/{help-copy-DodnPf1K.js → help-copy-Bo651f-_.js} +1 -1
  83. package/assets/import-BfiMMK8M.js +1 -0
  84. package/assets/index--IxFGldl.js +1 -0
  85. package/assets/{index-DqlUjB9k.js → index-B7CBca9v.js} +15 -15
  86. package/assets/index-BWpSJ9nc.js +1 -0
  87. package/assets/index-BkkdzHr6.js +1 -0
  88. package/assets/{index-9JWzpiiR.js → index-BnBpXn45.js} +65 -65
  89. package/assets/index-CBEFnj_-.js +1 -0
  90. package/assets/index-CoU9lExJ.js +1 -0
  91. package/assets/index-CqG3g67K.js +1 -0
  92. package/assets/index-DL3ZaCDr.js +1 -0
  93. package/assets/index-DlNRygfs.js +1 -0
  94. package/assets/index-Dw2xSkAT.js +1 -0
  95. package/assets/index-UN1wPrb5.js +1 -0
  96. package/assets/{kbd-D_0s6Sx_.js → kbd-CE7JGsTx.js} +1 -1
  97. package/assets/{label-chip-zJi2r8mQ.js → label-chip-CbKg_yMt.js} +1 -1
  98. package/assets/labels-DWadctIQ.js +1 -0
  99. package/assets/mail-BG3D2i2e.js +1 -0
  100. package/assets/mail-DtD-4wOO.js +1 -0
  101. package/assets/menu-B8nM2lya.js +1 -0
  102. package/assets/{nav-link-8l24_oWF.js → nav-link-CjSE3MDU.js} +1 -1
  103. package/assets/new-C7PkD0CK.js +1 -0
  104. package/assets/onboarding-BSC6mmKf.js +1 -0
  105. package/assets/{onboarding-completion-Z1EOTA33.js → onboarding-completion-EUidFdVK.js} +1 -1
  106. package/assets/outbox-DQD-mHZK.js +1 -0
  107. package/assets/pencil-rhg9PvnD.js +1 -0
  108. package/assets/people-DWWALdDd.js +1 -0
  109. package/assets/plus-B2EF0VhA.js +1 -0
  110. package/assets/popover-menu-nz-n7B2h.js +1 -0
  111. package/assets/refresh-cw-COcXRex1.js +1 -0
  112. package/assets/{reply-BUVhW3yq.js → reply-CzX8Q1T1.js} +1 -1
  113. package/assets/{rich-text-HpMiPjFH.js → rich-text-BIDloC3-.js} +23 -23
  114. package/assets/{rich-text-spellcheck-worker-provider-BfhfcGZ2.js → rich-text-spellcheck-worker-provider-BahuahVp.js} +1 -1
  115. package/assets/rotate-ccw-D5rIVkpa.js +1 -0
  116. package/assets/{roving-focus-C87O2raY.js → roving-focus-DWCPniMZ.js} +1 -1
  117. package/assets/{row-actions-cUhOCilI.js → row-actions-CLp_pk6R.js} +1 -1
  118. package/assets/{search-mirror-B0C9oCpr.js → search-mirror-CM2HNuGA.js} +1 -1
  119. package/assets/{search-scope-aZ2AZX-k.js → search-scope-fyP_uHeh.js} +1 -1
  120. package/assets/search-token-index-YOjFNFJN.js +1 -0
  121. package/assets/{sections-BtFAPYYy.js → sections-DsqY4M13.js} +1 -1
  122. package/assets/{segmented-control-tpWp-yev.js → segmented-control-IDK8fpO7.js} +1 -1
  123. package/assets/{select-Dv65Mqkl.js → select-DWBegMNA.js} +1 -1
  124. package/assets/senders-ap9QQK-k.js +1 -0
  125. package/assets/settings-D2KYecr5.js +1 -0
  126. package/assets/settings-screen-BN-3qNrj.js +1 -0
  127. package/assets/shield-check-CW6Yah30.js +1 -0
  128. package/assets/{suggest-list-xX77W_hF.js → suggest-list-DMRnmTaR.js} +1 -1
  129. package/assets/{suggested-vips-DRijwoFY.js → suggested-vips-Gtwi6sFb.js} +1 -1
  130. package/assets/suggestion._suggestionId-BHxPFUy0.js +1 -0
  131. package/assets/{switch-CGmUk-Wh.js → switch-B87JY9ce.js} +1 -1
  132. package/assets/task._calendarTaskId-r7Jl9ABh.js +1 -0
  133. package/assets/undo-2-D-cmVG46.js +1 -0
  134. package/assets/{useCalendarData-D07VZ1QE.js → useCalendarData-Djtg1pj2.js} +1 -1
  135. package/assets/{useCalendarScheduling-CnlDrC-W.js → useCalendarScheduling-D222yR_U.js} +1 -1
  136. package/assets/useCalendarSuggestions-COzKAJgT.js +1 -0
  137. package/assets/{useCalendarTasks-CV-ORktM.js → useCalendarTasks-D5yN61q_.js} +1 -1
  138. package/assets/{useDebouncedValue-DRrHzwce.js → useDebouncedValue-CahHw3v4.js} +1 -1
  139. package/assets/{useFilters-DdYKMP_s.js → useFilters-CmYwNOKM.js} +1 -1
  140. package/assets/{useLabels-ouqsQR1c.js → useLabels-BxK35B_o.js} +1 -1
  141. package/assets/{useLayoutTier-CeBSbbkD.js → useLayoutTier-xkhKNk1V.js} +1 -1
  142. package/assets/{useMediaQuery-BzGo-bVp.js → useMediaQuery-DOpCuIgp.js} +1 -1
  143. package/assets/{useMessageBodyContent-D9UpR1Dh.js → useMessageBodyContent-DzlZ514L.js} +1 -1
  144. package/assets/{useQueries-Des6lpmI.js → useQueries-BomGTQs-.js} +1 -1
  145. package/assets/{useRefreshControl-CWSpNwGo.js → useRefreshControl-BAZSbaBz.js} +1 -1
  146. package/assets/useResultFolderIndex-D9sJhyey.js +1 -0
  147. package/assets/{useSignature-CQsNwcJm.js → useSignature-Boz2_w0h.js} +1 -1
  148. package/assets/{warnings-CDdQ-K5m.js → warnings-BEW4lkgR.js} +1 -1
  149. package/index.html +1 -1
  150. package/package.json +1 -1
  151. package/assets/CalendarQuickCreate-CaO2GHZr.js +0 -1
  152. package/assets/DesktopChrome-H9yEQYFf.js +0 -1
  153. package/assets/MessageBody-zT-at0bi.js +0 -84
  154. package/assets/MessageToolbar-mGmOl_Xf.js +0 -1
  155. package/assets/OnboardingWizard-ezuAE6sx.js +0 -1
  156. package/assets/_calendarObjectId-5z-o0pQB.js +0 -1
  157. package/assets/_mailboxId-CBxHNU1m.js +0 -1
  158. package/assets/_messageId-DHvQcDnk.js +0 -1
  159. package/assets/_messageId-Dk8Pv3WS.js +0 -1
  160. package/assets/_messageId-q5-pR6qn.js +0 -1
  161. package/assets/_outboxMessageId-Akv-3HPP.js +0 -1
  162. package/assets/_recurrenceId-DrNRvEqM.js +0 -1
  163. package/assets/_slotId-BbhN8swS.js +0 -1
  164. package/assets/_threadId-9uIkuh2L.js +0 -1
  165. package/assets/_threadId-DdQZmst0.js +0 -1
  166. package/assets/_threadId-mITrrqLR.js +0 -1
  167. package/assets/_view._date-DyseRkCh.js +0 -1
  168. package/assets/account-service-status-HIGoykok.js +0 -1
  169. package/assets/accounts-DwJx265B.js +0 -1
  170. package/assets/advanced-4BQF-R7r.js +0 -1
  171. package/assets/agenda-time-hKUG2dhl.js +0 -1
  172. package/assets/appearance-BHnbKYJT.js +0 -1
  173. package/assets/brief-CJySko3D.js +0 -1
  174. package/assets/calendar-guests-7MqnVXzX.js +0 -1
  175. package/assets/calendar-suggestion-CpOWds4W.js +0 -1
  176. package/assets/calendars-CbchUImt.js +0 -1
  177. package/assets/checkbox-CzFLh5Dk.js +0 -1
  178. package/assets/chevron-down-Q4i_URUt.js +0 -1
  179. package/assets/chevron-left-gBxhdHb5.js +0 -1
  180. package/assets/circle-check-BucqMsie.js +0 -1
  181. package/assets/circle-check-big-CDjntmXC.js +0 -1
  182. package/assets/circle-help-B6Fn573l.js +0 -1
  183. package/assets/classification-DzmiHklC.js +0 -1
  184. package/assets/clock-jwuPTxhb.js +0 -1
  185. package/assets/compose._-_outboxMessageId_-B7D1W3Sx.js +0 -1
  186. package/assets/compose._-_outboxMessageId_-CO4UJXl9.js +0 -1
  187. package/assets/compose._-_outboxMessageId_-D0T64VP0.js +0 -1
  188. package/assets/compose._-_outboxMessageId_-pcn-0-gQ.js +0 -1
  189. package/assets/copy-Be7MLulJ.js +0 -1
  190. package/assets/credential-steps-MLDe683C.js +0 -1
  191. package/assets/download-BSz8KKlH.js +0 -1
  192. package/assets/edit-DCtOcxf9.js +0 -1
  193. package/assets/edit-DbSsj2wh.js +0 -1
  194. package/assets/external-link-o4VBX-Sp.js +0 -1
  195. package/assets/file-json-B3Qb4sPC.js +0 -1
  196. package/assets/filters-Mgogmt5O.js +0 -1
  197. package/assets/flagged-D0pl5Vka.js +0 -1
  198. package/assets/folder-input-C8-nffA0.js +0 -1
  199. package/assets/folders-DodnBZua.js +0 -1
  200. package/assets/import-C-0_jeuq.js +0 -1
  201. package/assets/index-BnElevbT.js +0 -1
  202. package/assets/index-DHvQcDnk.js +0 -1
  203. package/assets/index-DcMLhAhx.js +0 -1
  204. package/assets/index-DfAafcCq.js +0 -1
  205. package/assets/index-Dk8Pv3WS.js +0 -1
  206. package/assets/index-Dvms4bLC.js +0 -1
  207. package/assets/index-DxDWr9QM.js +0 -1
  208. package/assets/index-JdYKPBmV.js +0 -1
  209. package/assets/index-Tl1Nlwxt.js +0 -1
  210. package/assets/index-q5-pR6qn.js +0 -1
  211. package/assets/labels-BLy-VSyB.js +0 -1
  212. package/assets/mail-Bh469T8t.js +0 -1
  213. package/assets/mail-CXavFmSm.js +0 -1
  214. package/assets/menu-Dro5vzLW.js +0 -1
  215. package/assets/new-D7laO9Pg.js +0 -1
  216. package/assets/onboarding-D-4ZdWHj.js +0 -1
  217. package/assets/outbox-DzVji2w9.js +0 -1
  218. package/assets/pencil-Dz-yZ9zw.js +0 -1
  219. package/assets/people-DoJm1MLz.js +0 -1
  220. package/assets/plus-Cp9K9QJ4.js +0 -1
  221. package/assets/popover-menu-BCEzStJs.js +0 -1
  222. package/assets/refresh-cw-0FbK4O4v.js +0 -1
  223. package/assets/rotate-ccw-DCzt84SY.js +0 -1
  224. package/assets/search-token-index--Pzg9wI2.js +0 -1
  225. package/assets/senders-BjvP6Oq9.js +0 -1
  226. package/assets/settings-fP9o8EL9.js +0 -1
  227. package/assets/settings-screen-DPboZsK5.js +0 -1
  228. package/assets/shield-check-BbF5QmrH.js +0 -1
  229. package/assets/suggestion._suggestionId-Ca3k8ej7.js +0 -1
  230. package/assets/task._calendarTaskId-CvuxUcFe.js +0 -1
  231. package/assets/undo-2-CGWL2haZ.js +0 -1
  232. package/assets/useCalendarSuggestions-DW7WFMvd.js +0 -1
  233. package/assets/useResultFolderIndex-DRfqL3r_.js +0 -1
@@ -1 +0,0 @@
1
- import{e_ as o,j as r}from"./index-9JWzpiiR.js";import{a as i}from"./CalendarEventEditor-B0SWzPqQ.js";import"./draft--MHSP3BT.js";import"./agenda-time-hKUG2dhl.js";import"./calendar-guests-7MqnVXzX.js";import"./calendar-event-popup-BvI6Qwla.js";import"./useCalendarSuggestions-DW7WFMvd.js";import"./ErrorState-BB0xpcCi.js";import"./useQueries-Des6lpmI.js";import"./pencil-Dz-yZ9zw.js";import"./circle-help-B6Fn573l.js";import"./useCalendarData-D07VZ1QE.js";import"./useCalendarTasks-CV-ORktM.js";import"./useCalendarScheduling-CnlDrC-W.js";import"./useDebouncedValue-DRrHzwce.js";import"./calendar-format-BwCpz-JZ.js";import"./nav-link-8l24_oWF.js";import"./useMediaQuery-BzGo-bVp.js";import"./calendar-Cmzt0eKc.js";import"./reply-BUVhW3yq.js";import"./CalendarQuickCreate-CaO2GHZr.js";import"./CalendarSession-Ub9ZzsQN.js";import"./calendar-event-sidebar-Dx3WbbPv.js";import"./select-Dv65Mqkl.js";import"./chevron-down-Q4i_URUt.js";import"./confirm-dialog-D33DXPkQ.js";function q(){const{calendarObjectId:t}=o.useParams();return r.jsx(i,{calendarObjectId:t})}export{q as component};
@@ -1 +0,0 @@
1
- import{f1 as o,j as i}from"./index-9JWzpiiR.js";import{a as m}from"./CalendarEventEditor-B0SWzPqQ.js";import"./draft--MHSP3BT.js";import"./agenda-time-hKUG2dhl.js";import"./calendar-guests-7MqnVXzX.js";import"./calendar-event-popup-BvI6Qwla.js";import"./useCalendarSuggestions-DW7WFMvd.js";import"./ErrorState-BB0xpcCi.js";import"./useQueries-Des6lpmI.js";import"./pencil-Dz-yZ9zw.js";import"./circle-help-B6Fn573l.js";import"./useCalendarData-D07VZ1QE.js";import"./useCalendarTasks-CV-ORktM.js";import"./useCalendarScheduling-CnlDrC-W.js";import"./useDebouncedValue-DRrHzwce.js";import"./calendar-format-BwCpz-JZ.js";import"./nav-link-8l24_oWF.js";import"./useMediaQuery-BzGo-bVp.js";import"./calendar-Cmzt0eKc.js";import"./reply-BUVhW3yq.js";import"./CalendarQuickCreate-CaO2GHZr.js";import"./CalendarSession-Ub9ZzsQN.js";import"./calendar-event-sidebar-Dx3WbbPv.js";import"./select-Dv65Mqkl.js";import"./chevron-down-Q4i_URUt.js";import"./confirm-dialog-D33DXPkQ.js";function y(){const{calendarObjectId:r,recurrenceId:t}=o.useParams();return i.jsx(m,{calendarObjectId:r,recurrenceId:t})}export{y as component};
@@ -1 +0,0 @@
1
- import{b as a}from"./index-9JWzpiiR.js";const e=a("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);export{e as E};
@@ -1 +0,0 @@
1
- import{b as a}from"./index-9JWzpiiR.js";const o=a("FileJson",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]]);export{o as F};
@@ -1 +0,0 @@
1
- import{ba as ee,j as e,L as B,ad as oe,p as ce,bb as de,bc as me,r as m,ao as H,B as F,bd as ue,be as J,bf as xe,bg as pe,aP as fe,e as he,f as ge,bh as be,bi as je,bj as ve,aB as Ne,T as ye,aw as te,ax as se,a as ae,U as Ce,bk as Se,W as we,Y as ke,bl as Fe,bm as Ie,u as Me,ac as Re,c as Ee}from"./index-9JWzpiiR.js";import{E as K,f as Oe}from"./ErrorState-BB0xpcCi.js";import{u as De}from"./useMediaQuery-BzGo-bVp.js";import{u as Le,a as Ae}from"./useLabels-ouqsQR1c.js";import{C as Te,A as ze,a as $e,b as Pe,N as E,p as Be,u as Ue,r as _e,c as ne,S as Q,d as He,n as Ke,f as qe,e as Je,g as Qe,h as Ve,i as Ge,j as We}from"./useFilters-DdYKMP_s.js";import{L as ie}from"./label-chip-zJi2r8mQ.js";import{S as V}from"./segmented-control-tpWp-yev.js";import{S as Ye}from"./select-Dv65Mqkl.js";import{C as q}from"./circle-check-BucqMsie.js";import{B as Xe}from"./bottom-sheet-BUOc_BG6.js";import{B as Ze}from"./badge-DLlDkvBl.js";import{a as et}from"./sections-BtFAPYYy.js";import{S as tt}from"./settings-screen-DPboZsK5.js";import"./suggest-list-xX77W_hF.js";import"./plus-Cp9K9QJ4.js";import"./chevron-down-Q4i_URUt.js";import"./avatar-COXPYlBH.js";import"./chevron-left-gBxhdHb5.js";import"./menu-Dro5vzLW.js";import"./circle-help-B6Fn573l.js";function st({preview:t}){const s=ee(t);if(t.status==="loading")return e.jsxs("p",{className:"flex items-center gap-2 text-xs text-fg-muted","aria-live":"polite",children:[e.jsx(B,{className:"size-3.5 animate-spin","aria-hidden":"true"}),s]});if(t.status==="error")return e.jsxs("p",{className:"flex items-center gap-2 text-xs text-danger",role:"alert",children:[e.jsx(oe,{className:"size-3.5 shrink-0","aria-hidden":"true"}),s]});const a=t.count===0;return e.jsxs("p",{className:ce("flex items-center gap-2 text-xs",t.stale?"text-fg-subtle":a?"text-fg-muted":"font-medium text-fg"),"aria-live":"polite",children:[t.stale&&e.jsx(B,{className:"size-3.5 animate-spin","aria-hidden":"true"}),s]})}const at=[{value:"all",label:J("all")},{value:"any",label:J("any")}],G=[{value:"once",label:"Just once"},{value:"standing",label:"Keep doing this"},{value:"until",label:"Until a date"}],W="__filter_create_label__";function nt({folders:t,value:s,delimiter:a="/",onChangeMove:n,onCreateFolder:u}){const[x,j]=m.useState(!1),[f,h]=m.useState(),[o,g]=m.useState([]),S=m.useMemo(()=>{const v=new Set(t.map(p=>p.id));return[...t,...o.filter(p=>!v.has(p.id))]},[t,o]),l=m.useMemo(()=>{if(u)return async(v,p,r)=>{const d=await u(v,p,r);return g(w=>w.some(M=>M.id===d.id)?w:[...w,d]),d}},[u]),k=S.find(v=>v.id===s),y=S.find(v=>v.id===f),b=v=>{const p=pe(v.path,a);return p.map((r,d)=>{const w=p.slice(0,d+1).join(a);return S.find(M=>M.path===w)?.label??r}).join(" / ")},C=()=>{j(!1),h(void 0)};return x?e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"flex h-72 min-h-0 overflow-hidden rounded-md border border-line bg-surface",children:e.jsx(xe,{folders:S,selectedId:f,delimiter:a,onSelect:h,onCreateFolder:l,onCancel:C,labels:{createPending:"Waiting for the mail server to confirm the folder…"}})}),y?e.jsx(F,{variant:"primary",onClick:()=>{n?.(y.id),C()},className:"w-full",children:e.jsx("span",{className:"truncate",children:`Move matches to ${b(y)}`})}):e.jsx("p",{className:"text-2xs text-fg-subtle",children:"Tap a folder to open it, or make a new one where you want it."}),e.jsx(F,{variant:"ghost",size:"sm",onClick:C,className:"w-full",children:"Cancel"})]}):e.jsxs("div",{className:"rounded-md border border-line bg-surface-sunken p-3",children:[e.jsx("p",{className:"text-sm font-medium text-fg",children:k?b(k):"No folder yet"}),e.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-3",children:[e.jsx(F,{variant:"ghost",size:"sm",className:"px-0",onClick:()=>{h(s),j(!0)},children:"Choose a folder"}),k&&e.jsx(F,{variant:"ghost",size:"sm",className:"px-0",onClick:()=>n?.(""),children:"Don't move matches"})]})]})}function it({labels:t,value:s,onChangeLabel:a,onCreateLabel:n}){const[u,x]=m.useState(!1),[j,f]=m.useState(""),[h,o]=m.useState(!1),[g,S]=m.useState(),[l,k]=m.useState([]),y=m.useMemo(()=>{const r=new Set(t.map(d=>d.id));return[...t,...l.filter(d=>!r.has(d.id))]},[t,l]),b=y.find(r=>r.id===s),C=r=>{if(r===W){S(void 0),x(!0);return}a?.(r)},v=()=>{if(!n)return;const r=j.trim();r!==""&&(o(!0),S(void 0),n(r).then(d=>{k(w=>w.some(M=>M.id===d.id)?w:[...w,d]),a?.(d.id),x(!1),f(""),o(!1)}).catch(d=>{S(d instanceof Error?d.message:"Couldn't create that label. Please try again."),o(!1)}))},p=()=>{x(!1),f(""),S(void 0)};return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(Ye,{"aria-label":"Label to apply",value:s,onChange:r=>C(r.target.value),className:"flex-1",children:[e.jsx("option",{value:"",children:"No label"}),y.map(r=>e.jsx("option",{value:r.id,children:r.name},r.id)),n&&e.jsx("option",{value:W,children:"+ New label…"})]}),b&&e.jsx(ie,{label:{...b,labelId:b.id}})]}),u&&e.jsxs("div",{className:"space-y-2 rounded-md border border-line bg-surface-sunken p-2",children:[e.jsx(H,{value:j,onChange:r=>f(r.target.value),placeholder:"Label name","aria-label":"New label name",disabled:h,autoFocus:!0,onKeyDown:r=>{r.key==="Enter"&&(r.preventDefault(),v()),r.key==="Escape"&&(r.preventDefault(),p())}}),g&&e.jsx("p",{className:"text-2xs text-danger",role:"alert",children:g}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(F,{variant:"primary",size:"sm",onClick:v,disabled:h||j.trim()==="",children:h?"Creating…":"Create label"}),e.jsx(F,{variant:"ghost",size:"sm",onClick:p,disabled:h,children:"Cancel"})]})]})]})}function rt({rule:t,folders:s,delimiter:a,labels:n=[],preview:u,notice:x,clauseFields:j,persisted:f=!1,clauseSuggestions:h,clauseEdit:o,onStartAddClause:g,onStartEditClause:S,onRemoveClause:l,onChangeDraftField:k,onChangeDraftValue:y,onSubmitClause:b,onCancelClause:C,onChangeMatchOperator:v,onChangeMove:p,onCreateFolder:r,onChangeLabel:d,onCreateLabel:w,onChangeScope:M,onChangeName:O,onChangeUntil:L,onCommit:D,onCancel:z}){const A=t.clauses.length>=2,$=de(t.matchOperator),N=me(t,u),T=t.scope==="standing"||t.scope==="until",P=f?G.filter(I=>I.value!=="once"):G;return e.jsxs("div",{className:"flex min-h-0 flex-col",children:[e.jsxs("div",{className:"border-b border-line px-5 py-3",children:[e.jsx("h2",{className:"text-sm font-semibold text-fg",children:"Filter rule"}),e.jsx("p",{className:"mt-0.5 text-xs text-fg-muted",children:"These chips are the whole rule — what you see is what applies."})]}),e.jsxs("div",{className:"min-h-0 flex-1 space-y-5 overflow-y-auto px-5 py-4",children:[x,e.jsxs("section",{className:"space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[t.clauses.map((I,U)=>e.jsxs(m.Fragment,{children:[U>0&&e.jsx("span",{className:"text-2xs font-medium uppercase text-fg-subtle",children:$}),e.jsx(Te,{clause:I,onEdit:()=>S?.(I.id),onRemove:()=>l?.(I.id)})]},I.id)),!o&&e.jsx(ze,{label:"Add clause",onClick:g})]}),o&&e.jsx($e,{draft:o.draft,mode:o.mode,fields:j,suggestions:h,onChangeField:k,onChangeValue:y,onSubmit:b,onCancel:C}),A&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs text-fg-muted",children:"Match"}),e.jsx(V,{name:"match-operator",size:"sm","aria-label":"Match operator",options:at,value:t.matchOperator,onChange:I=>v?.(I)})]})]}),e.jsxs("section",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs font-medium text-fg-muted",children:"Move matches to"}),e.jsx(nt,{folders:s,value:t.moveMailboxId,delimiter:a,onChangeMove:p,onCreateFolder:r})]}),e.jsxs("section",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs font-medium text-fg-muted",children:"Apply a label"}),e.jsx(it,{labels:n,value:t.labelId??"",onChangeLabel:d,onCreateLabel:w})]}),e.jsxs("section",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs font-medium text-fg-muted",children:"How long"}),e.jsx(V,{name:"rule-scope",size:"sm","aria-label":"Rule scope",options:P,value:t.scope,onChange:I=>M?.(I)}),T&&e.jsx(H,{value:t.name??"",onChange:I=>O?.(I.target.value),placeholder:"Name this rule (e.g. Receipts)","aria-label":"Rule name",className:"w-full"}),t.scope==="until"&&e.jsxs("div",{className:"flex items-center gap-2 text-xs text-fg-muted",children:[e.jsx("span",{children:"Until"}),e.jsx(H,{type:"date",value:t.until??"",onChange:I=>L?.(I.target.value),"aria-label":"Expiry date",className:"flex-1"})]})]}),e.jsx("div",{className:"border-t border-line pt-3",children:e.jsx(st,{preview:u})})]}),e.jsxs("div",{className:"space-y-2 border-t border-line px-5 py-3",children:[N&&e.jsx("p",{className:"text-xs text-fg-subtle",role:"status",children:N}),e.jsx(F,{variant:"primary",onClick:D,disabled:N!==void 0,className:"w-full",children:ue(t.scope)}),e.jsx(F,{variant:"ghost",onClick:z,className:"w-full",children:"Not now"})]})]})}const lt=t=>{const s=fe(t);return s!==void 0&&s>=400&&s<500};function Y({title:t,error:s,onRetry:a,reportHref:n}){return e.jsxs("div",{className:"space-y-1",children:[e.jsx(K,{variant:"inline",title:t,error:s,onRetry:lt(s)?void 0:a}),e.jsx("a",{href:n(Oe(s)),target:"_blank",rel:"noreferrer",className:"text-xs text-accent hover:underline",children:"Report an issue"})]})}const ot=(t,s)=>{const a=he(),n=ge({...je(),onSuccess:()=>{t&&(a.invalidateQueries({queryKey:Pe(t)}),s&&a.invalidateQueries({queryKey:be({path:{accountId:t,filterId:s}})}))}}),{mutate:u}=n;return{updateFilter:m.useCallback(j=>{!t||!s||u({path:{accountId:t,filterId:s},body:j})},[t,s,u]),isPending:n.isPending,isSuccess:n.isSuccess,isError:n.isError,error:n.error,reset:n.reset}},ct=t=>({clauses:t.literalClauses.map((a,n)=>({id:`clause-${n}`,field:a.field,value:a.value})),matchOperator:t.matchOperator==="And"?"all":"any",moveMailboxId:t.actionMailboxId!==E?t.actionMailboxId:void 0,labelId:t.actionLabelId!==E?t.actionLabelId:void 0,scope:t.scope==="Temporary"?"until":"standing",until:t.scope==="Temporary"?dt(t.expiresAt):void 0,name:t.name}),dt=t=>{if(!t)return"";const s=Date.parse(t);if(Number.isNaN(s))return"";const a=new Date(s),n=u=>String(u).padStart(2,"0");return`${a.getFullYear()}-${n(a.getMonth()+1)}-${n(a.getDate())}`},X=t=>JSON.stringify({clauses:t.clauses.map(s=>[s.field,s.value]),operator:t.matchOperator,move:t.moveMailboxId??null,label:t.labelId??null}),re=(t,s)=>X(t)!==X(s),Z=t=>JSON.stringify({scope:t.scope==="until"?"until":"standing",until:t.scope==="until"?t.until??"":""}),le=(t,s)=>Z(t)!==Z(s),mt=(t,s)=>{const a={},n=(t.name??"").trim();return n!==(s.name??"").trim()&&(a.name=n),re(t,s)&&(a.matchOperator=t.matchOperator==="all"?"And":"Or",a.literalClauses=t.clauses.map(u=>({field:u.field,value:u.value})),a.actionMailboxId=t.moveMailboxId??E,a.actionLabelId=t.labelId??E),le(t,s)&&(a.scope=t.scope==="until"?"Temporary":"Standing",t.scope==="until"&&(a.expiresAt=Be(t.until??""))),a};function ut({accountId:t,filter:s,folders:a,delimiter:n,labels:u,onClose:x}){const j=m.useMemo(()=>ct(s),[s]),[f,h]=m.useState(j),[o,g]=m.useState(),[S,l]=m.useState(!1),k=m.useRef(0),{count:y}=Ue(t,_e(f)),b=ot(t,s.filterId),C=ne(t),{createFolderIn:v}=ve(t),{createLabel:p}=Le(t),r=async c=>{const i=await p(c);return{id:i.labelId,name:i.name,color:i.color}},d=()=>g({mode:"add",draft:{field:Q[0],value:""}}),w=c=>{const i=f.clauses.find(R=>R.id===c);i&&g({mode:"edit",clauseId:c,draft:{field:i.field,value:i.value}})},M=c=>g(i=>i&&{...i,draft:{...i.draft,field:c}}),O=c=>g(i=>i&&{...i,draft:{...i.draft,value:c}}),L=()=>{if(!o)return;const c=o.draft.field,i=Ke(c,o.draft.value);i!==""&&(h(R=>o.mode==="edit"&&o.clauseId?{...R,clauses:R.clauses.map(_=>_.id===o.clauseId?{id:_.id,field:c,value:i}:_)}:(k.current+=1,{...R,clauses:[...R.clauses,{id:`new-${k.current}`,field:c,value:i}]})),g(void 0))},D=c=>h(i=>({...i,clauses:i.clauses.filter(R=>R.id!==c)})),z=c=>h(i=>({...i,matchOperator:c})),A=c=>h(i=>({...i,moveMailboxId:c||void 0})),$=c=>h(i=>({...i,labelId:c||void 0})),N=c=>h(i=>({...i,name:c})),T=c=>h(i=>({...i,scope:c,until:c==="until"?i.until:void 0})),P=c=>h(i=>({...i,until:c})),I=()=>{const c=re(f,j)||le(f,j),i=mt(f,j);if(Object.keys(i).length===0){x();return}l(c),b.updateFilter(i)},U=()=>C.start(He(f));return C.isStarting||C.isRunning||C.isDone?e.jsx(ht,{progress:C.progress,isDone:C.isDone,onClose:x}):b.isPending?e.jsx(xt,{}):b.isError?e.jsx(gt,{onRetry:b.reset,onClose:x}):b.isSuccess?S?e.jsx(ft,{preview:ee(y),blocked:y.status!=="ready"||y.stale===!0,onReapply:U,onClose:x}):e.jsx(pt,{onClose:x}):e.jsx(rt,{rule:f,folders:a,delimiter:n,labels:u,preview:y,clauseFields:Q,persisted:!0,clauseEdit:o,onStartAddClause:d,onStartEditClause:w,onRemoveClause:D,onChangeDraftField:M,onChangeDraftValue:O,onSubmitClause:L,onCancelClause:()=>g(void 0),onChangeMatchOperator:z,onChangeMove:A,onCreateFolder:v,onChangeLabel:$,onCreateLabel:r,onChangeName:N,onChangeScope:T,onChangeUntil:P,onCommit:I,onCancel:x})}function xt(){return e.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-10 text-center",children:[e.jsx(B,{className:"size-8 animate-spin text-accent-2"}),e.jsx("p",{className:"text-sm font-medium text-fg",children:"Saving changes…"})]})}function pt({onClose:t}){return e.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-8 text-center",children:[e.jsx(q,{className:"size-8 text-positive"}),e.jsx("p",{className:"text-sm font-medium text-fg",children:"Filter updated"}),e.jsx(F,{variant:"primary",onClick:t,className:"mt-2",children:"Done"})]})}function ft({preview:t,blocked:s,onReapply:a,onClose:n}){return e.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-8 text-center",children:[e.jsx(q,{className:"size-8 text-positive"}),e.jsx("p",{className:"text-sm font-medium text-fg",children:"Rule saved"}),e.jsxs("p",{className:"max-w-xs text-xs text-fg-muted",children:["New mail follows the rule automatically. ",t," — move the mail already in your mailbox too?"]}),e.jsxs("div",{className:"mt-2 flex gap-2",children:[e.jsx(F,{variant:"primary",onClick:a,disabled:s,children:"Move existing mail"}),e.jsx(F,{variant:"ghost",onClick:n,children:"Not now"})]})]})}function ht({progress:t,isDone:s,onClose:a}){const n=t.state==="Failed";return e.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-8 text-center",children:[s?n?e.jsx("span",{className:"text-sm font-semibold text-danger",children:"Move failed"}):e.jsx(q,{className:"size-8 text-positive"}):e.jsx(B,{className:"size-8 animate-spin text-accent-2"}),!s&&e.jsx("p",{className:"text-sm font-medium text-fg",children:"Moving existing mail…"}),s&&!n&&e.jsxs("div",{className:"text-sm text-fg",children:[e.jsx("p",{className:"font-medium",children:"Done"}),e.jsxs("p",{className:"mt-1 text-xs text-fg-muted",children:[t.appliedCount," of ",t.matchedCount," moved",t.failedCount>0?` · ${t.failedCount} failed`:"","."]})]}),s&&n&&e.jsx("p",{className:"max-w-xs text-xs text-fg-muted",children:t.errorMessage||"Something went wrong. Please try again."}),s&&e.jsx(F,{variant:"primary",onClick:a,className:"mt-2",children:"Done"})]})}function gt({onRetry:t,onClose:s}){return e.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-8 text-center",children:[e.jsx("p",{className:"text-sm font-medium text-danger",children:"Couldn't save changes"}),e.jsx("p",{className:"max-w-xs text-xs text-fg-muted",children:"Please try again."}),e.jsxs("div",{className:"mt-2 flex gap-2",children:[e.jsx(F,{variant:"primary",onClick:t,children:"Try again"}),e.jsx(F,{variant:"ghost",onClick:s,children:"Not now"})]})]})}function bt({accountId:t,filter:s,folders:a,delimiter:n,labels:u,onClose:x}){const j=De(),f=e.jsx(ut,{accountId:t,filter:s,folders:a,delimiter:n,labels:u,onClose:x});return j?e.jsx(Ne,{open:!0,onClose:x,title:"Filter rule",children:f}):e.jsx(Xe,{open:!0,onClose:x,label:"Filter rule",dismissLabel:"Dismiss filter rule",children:f})}const jt=t=>{switch(t.kind){case"queuing":case"running":return"Running over the inbox…";case"done":return t.matched===0?"Done. Nothing in the inbox matched.":`Done. Filed ${t.applied} of ${t.matched} matching messages in the inbox.`;case"failed":return}};function vt({filters:t,mailboxName:s,labelById:a,onEdit:n,onDelete:u,deletingFilterId:x,onToggle:j,togglingFilterId:f,onRunNow:h,runFilterId:o,runStatus:g,now:S=Date.now()}){return t.length===0?e.jsx("p",{className:"py-6 text-sm text-fg-muted",children:"No filters yet. Select a few messages in the inbox and choose Organize to make one."}):e.jsx("ul",{className:"divide-y divide-line rounded-md border border-line",children:t.map(l=>{const k=qe(l,S),y=k==="Expired",b=k==="Disabled",C=b?Je(l):void 0,v=l.actionMailboxId!==E?s(l.actionMailboxId):void 0,p=l.actionLabelId!==E?a.get(l.actionLabelId):void 0,r=Qe(l.expiresAt),d=o===l.filterId?g:void 0,w=d?.kind==="queuing"||d?.kind==="running",M=d?jt(d):void 0,O=k==="Active"&&(l.actionMailboxId!==E||l.actionLabelId!==E);return e.jsxs("li",{className:"flex items-start gap-3 px-3 py-2.5",children:[e.jsxs("button",{type:"button",onClick:()=>n(l.filterId),"aria-label":`Edit filter ${l.name}`,className:"min-w-0 flex-1 rounded-sm text-left hover:opacity-80",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`truncate text-sm font-medium ${y||b?"text-fg-muted":"text-fg"}`,children:l.name}),e.jsx(Ze,{tone:y?"neutral":b?"warning":"positive",dot:!0,children:k})]}),e.jsxs("p",{className:"mt-0.5 text-xs text-fg-subtle",children:[v?`Moves matches to ${v}`:"No move action",l.scope==="Temporary"&&r?y?` · expired ${r}`:` · until ${r}`:l.scope==="Standing"?" · always":""]}),C&&e.jsx("p",{className:"mt-0.5 text-xs text-warning",children:C}),M&&e.jsx("p",{role:"status",className:"mt-0.5 text-xs text-fg-muted",children:M}),p&&e.jsx("div",{className:"mt-1.5 flex flex-wrap gap-1.5",children:e.jsx(ie,{label:{labelId:p.id,name:p.name,color:p.color}})})]}),O&&e.jsx(F,{variant:"ghost",size:"sm",onClick:()=>h(l.filterId),disabled:w,"aria-label":`Run now: filter ${l.name}`,children:w?"Running…":"Run now"}),!y&&e.jsx(F,{variant:"ghost",size:"sm",onClick:()=>j(l.filterId,b),disabled:f===l.filterId,"aria-label":`${b?"Turn on":"Turn off"} filter ${l.name}`,children:b?"Turn on":"Turn off"}),e.jsx(F,{variant:"ghost",size:"sm",icon:e.jsx(ye,{className:"size-4 text-danger"}),onClick:()=>u(l.filterId),disabled:x===l.filterId,"aria-label":`Delete filter ${l.name}`})]},l.filterId)})})}function Nt(t){return te(se({title:`Filter toggle: ${t}`,errorMessage:t}))}function yt(t){return te(se({title:`Filter run now: ${t}`,errorMessage:t}))}const Ct=t=>{if(t.failure)return{kind:"failed",error:t.failure.error};if(t.isStarting)return{kind:"queuing"};if(t.isDone)return t.progress.state==="Failed"?{kind:"failed",error:new Error(t.progress.errorMessage||"The run over the inbox failed.")}:{kind:"done",matched:t.progress.matchedCount,applied:t.progress.appliedCount};if(t.isRunning)return{kind:"running"}},St=e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{children:["Filters are the standing rules Organize creates. A"," ",e.jsx("strong",{children:"Standing"})," filter keeps working on new mail; a"," ",e.jsx("strong",{children:"Temporary"})," one stops on its own at the date you picked."]}),e.jsx("p",{children:"An expired filter isn't deleted the instant it lapses — it stays here, marked Expired, so you can see what it did and when it stopped."}),e.jsx("p",{children:"A filter that can't do its job turns itself off and says why, for example when its folder no longer exists. Turn it back on once that is fixed."})]});function wt({account:t}){const s=t.accountId,{filters:a,isPending:n,isError:u,error:x,refetch:j}=Ve(s),{deleteFilter:f,deletingFilterId:h}=Ge(s),o=We(s),g=ne(s),{startForFilter:S}=g,[l,k]=m.useState(),y=m.useCallback(N=>{k(N),S(N)},[S]),b=Ct(g),[C,v]=m.useState(),{data:p}=ae({...Ce({path:{accountId:s}}),staleTime:1/0}),r=Se(),d=m.useMemo(()=>we(t.folderAppointments),[t.folderAppointments]),w=m.useCallback(N=>{const T=p?.items.find(P=>P.mailboxId===N);if(T)return ke(T,d.get(N),r)},[p?.items,d,r]),M=m.useMemo(()=>Fe({mailboxes:p?.items??[],folderAppointments:t.folderAppointments,translator:r}),[p?.items,t.folderAppointments,r]),O=Ie(p?.items??[]),{labels:L}=Ae(s),D=m.useMemo(()=>L.map(N=>({id:N.labelId,name:N.name,color:N.color})),[L]),z=m.useMemo(()=>new Map(D.map(N=>[N.id,N])),[D]),A=a.find(N=>N.filterId===C),$=a.find(N=>N.filterId===l)?.name;return e.jsxs("section",{className:"space-y-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-fg",children:t.email}),A&&e.jsx(bt,{accountId:s,filter:A,folders:M,delimiter:O,labels:D,onClose:()=>v(void 0)}),n?e.jsx("div",{className:"h-16 animate-pulse rounded-md border border-line bg-surface","aria-busy":"true","aria-label":`Loading filters for ${t.email}`}):u?e.jsx(K,{variant:"inline",title:`Couldn't load filters for ${t.email}`,error:x,onRetry:()=>{j()}}):e.jsxs(e.Fragment,{children:[o.isError&&e.jsx(Y,{title:o.enabling?"Couldn't turn the filter on":"Couldn't turn the filter off",error:o.error,onRetry:o.retry,reportHref:Nt}),l&&b?.kind==="failed"&&e.jsx(Y,{title:`Couldn't run ${$??"the filter"} over the inbox`,error:b.error,onRetry:g.failure?.kind==="statusUnreadable"?g.refreshStatus:()=>y(l),reportHref:yt}),e.jsx(vt,{filters:a,mailboxName:w,labelById:z,onEdit:v,onDelete:f,deletingFilterId:h,onToggle:o.toggleFilter,togglingFilterId:o.togglingFilterId,onRunNow:y,runFilterId:l,runStatus:b})]})]})}function Jt(){const t=Me(),s=Re(),a=et(),[n,u]=m.useState(!0),{data:x,isPending:j,isError:f,error:h,refetch:o}=ae(Ee());return e.jsx(tt,{items:s,activeId:"filters",title:"Filters",description:"Standing and temporary rules created by Organize, per account.",help:St,helpOpen:n,onToggleHelp:()=>u(g=>!g),onSelect:a,onBackToMail:()=>{t({to:"/mail"})},children:j?e.jsx("div",{className:"h-24 animate-pulse rounded-sm border border-line bg-surface","aria-busy":"true","aria-label":"Loading accounts"}):f?e.jsx(K,{title:"Couldn't load accounts",error:h,onRetry:()=>{o()}}):x.accounts.length===0?e.jsx("p",{className:"py-12 text-sm text-fg-muted",children:"No accounts configured."}):e.jsx("div",{className:"space-y-8",children:x.accounts.map(g=>e.jsx(wt,{account:g},g.accountId))})})}export{wt as AccountFilters,Jt as component};
@@ -1 +0,0 @@
1
- import{j as o,O as i}from"./index-9JWzpiiR.js";import{a as m}from"./MailShell-DY2Ot0ah.js";import{F as r}from"./FlaggedPane-CyyX0x8y.js";import"./nav-link-8l24_oWF.js";import{a as p}from"./search-token-index--Pzg9wI2.js";import"./reply-BUVhW3yq.js";import{u as e}from"./search-mirror-B0C9oCpr.js";import"./useMessageBodyContent-D9UpR1Dh.js";import"./FullCompose-sAZlqUaR.js";import"./index-DqlUjB9k.js";import"./useSignature-CQsNwcJm.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-DRrHzwce.js";import"./suggest-list-xX77W_hF.js";import"./sections-BtFAPYYy.js";import"./useMediaQuery-BzGo-bVp.js";import"./chevron-down-Q4i_URUt.js";import"./ErrorState-BB0xpcCi.js";import"./confirm-dialog-D33DXPkQ.js";import"./search-scope-aZ2AZX-k.js";import"./app-chrome-BI9iJnw3.js";import"./MessageToolbar-mGmOl_Xf.js";import"./MessageBody-zT-at0bi.js";import"./kbd-D_0s6Sx_.js";import"./roving-focus-C87O2raY.js";import"./useQueries-Des6lpmI.js";import"./badge-DLlDkvBl.js";import"./undo-2-CGWL2haZ.js";import"./DropdownMenu-CGhv-K3k.js";import"./popover-menu-BCEzStJs.js";import"./mail-CXavFmSm.js";import"./download-BSz8KKlH.js";import"./avatar-COXPYlBH.js";import"./EmptyState-B_Kthrla.js";import"./calendar-suggestion-CpOWds4W.js";import"./useCalendarSuggestions-DW7WFMvd.js";import"./agenda-time-hKUG2dhl.js";import"./plus-Cp9K9QJ4.js";import"./calendar-format-BwCpz-JZ.js";import"./calendar-Cmzt0eKc.js";import"./calendar-failure-note-BRyIsChq.js";import"./checkbox-CzFLh5Dk.js";import"./clock-jwuPTxhb.js";import"./segmented-control-tpWp-yev.js";import"./shield-check-BbF5QmrH.js";import"./useLayoutTier-CeBSbbkD.js";import"./menu-Dro5vzLW.js";import"./useFilters-DdYKMP_s.js";import"./select-Dv65Mqkl.js";import"./folder-input-C8-nffA0.js";import"./label-chip-zJi2r8mQ.js";import"./MailViewChrome-U9YpZx_B.js";import"./refresh-cw-0FbK4O4v.js";import"./wizard-selection-zWa1qc6-.js";function ao(){const t=p();return e({to:"/mail/flagged"}),o.jsx(r,{thread:t,children:o.jsx(m,{phone:o.jsx(r.Phone,{}),list:o.jsx(r.List,{}),reading:o.jsx(i,{}),intelligence:o.jsx(r.Intelligence,{}),hasThread:!!t})})}export{ao as component};
@@ -1 +0,0 @@
1
- import{b as a}from"./index-9JWzpiiR.js";const e=a("FolderInput",[["path",{d:"M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1",key:"fm4g5t"}],["path",{d:"M2 13h10",key:"pgb2dq"}],["path",{d:"m9 16 3-3-3-3",key:"6m91ic"}]]);export{e as F};
@@ -1 +0,0 @@
1
- import{j as e,B as y,T as B,bf as Y,r as c,aB as W,X,aG as he,ao as Z,F as xe,bn as H,bo as fe,aq as pe,d as z,bp as ge,bq as be,e as J,a1 as ee,k as se,br as ve,bs as je,aF as ye,a0 as Ne,bt as ke,bu as _,bv as Ce,bw as we,bx as te,by as Se,bz as K,bj as ae,bk as re,bl as Me,Y as q,W as ne,L as G,bA as Q,ad as Ie,bB as Ee,u as Ae,ac as De,a as ie,c as Oe,U as Fe,f as U,s as Re,bC as Te,bD as Pe,bE as $e,bF as Le,bG as ze,bH as _e}from"./index-9JWzpiiR.js";import{F as Be}from"./folder-input-C8-nffA0.js";import{f as qe}from"./folder-failure-CqkVSsrb.js";import{a as Ge}from"./sections-BtFAPYYy.js";import{S as He}from"./settings-screen-DPboZsK5.js";import{E as oe}from"./ErrorState-BB0xpcCi.js";import{S as Ke}from"./select-Dv65Mqkl.js";import{P as Qe}from"./pencil-Dz-yZ9zw.js";import"./avatar-COXPYlBH.js";import"./badge-DLlDkvBl.js";import"./chevron-left-gBxhdHb5.js";import"./menu-Dro5vzLW.js";import"./circle-help-B6Fn573l.js";import"./chevron-down-Q4i_URUt.js";const Ue=({label:s,onRename:t,onDelete:r,deleteBlockedReason:l,renameLabel:d=m=>`Rename ${m}`,deleteLabel:a=m=>`Delete ${m}`})=>{const m=l?`${a(s)} — ${l}`:a(s);return e.jsxs("span",{className:"flex shrink-0 items-center gap-0.5 pr-2",children:[e.jsx(y,{variant:"ghost",size:"sm",icon:e.jsx(Qe,{className:"size-3.5"}),"aria-label":d(s),onClick:t}),e.jsx("span",{title:l,children:e.jsx(y,{variant:"ghost",size:"sm",icon:e.jsx(B,{className:"size-3.5"}),"aria-label":m,disabled:l!==void 0,onClick:r})})]})},Ve=({folders:s,onRename:t,onDelete:r,onCreateFolder:l,delimiter:d,labels:a})=>{const m=new Map(s.map(o=>[o.id,o]));return e.jsx(Y,{folders:s,onCreateFolder:l,delimiter:d,labels:{treeAriaLabel:"Your folders",optionLabel:o=>o.label,...a},rowFailure:o=>m.get(o.id)?.failure,rowActions:o=>{const i=m.get(o.id);return i?e.jsx(Ue,{label:i.label,deleteBlockedReason:i.deleteBlockedReason,renameLabel:a?.rename,deleteLabel:a?.remove,onRename:()=>t(i),onDelete:()=>r(i)}):null}})},Ye=({open:s,folderLabel:t,defaultLabel:r,name:l,onNameChange:d,onSubmit:a,onClose:m,pending:o=!1,error:i})=>{const h=c.useId(),p=`Rename ${t}`;return s?e.jsxs(W,{open:s,onClose:m,title:p,children:[e.jsxs("header",{className:"flex items-center gap-2 border-b border-line px-5 py-3",children:[e.jsx("span",{className:"flex-1 text-sm font-semibold text-fg",children:p}),e.jsx(y,{variant:"ghost",size:"sm",icon:e.jsx(X,{className:"size-3.5"}),onClick:m,"aria-label":"Cancel"})]}),e.jsxs("div",{className:"space-y-3 px-5 py-4",children:[e.jsxs("div",{children:[e.jsx(he,{htmlFor:h,children:"Folder name"}),e.jsx(Z,{id:h,value:l,placeholder:r,onChange:g=>d(g.target.value),onKeyDown:g=>{g.key==="Enter"&&(g.preventDefault(),a())}})]}),e.jsxs("p",{className:"text-xs text-fg-muted",children:["Shown everywhere in Remit. Leave it blank to use"," ",e.jsx("span",{className:"font-medium text-fg",children:r}),"."]}),i&&e.jsx("p",{className:"text-xs text-danger",role:"alert",children:i})]}),e.jsxs("footer",{className:"flex items-center justify-end gap-2 border-t border-line px-5 py-3",children:[e.jsx(y,{variant:"secondary",size:"sm",onClick:m,children:"Cancel"}),e.jsx(y,{variant:"primary",size:"sm",onClick:a,disabled:o,children:o?"Saving…":"Save name"})]})]}):null},We=["inbox","drafts","sent","archive","junk","trash"],V="",Xe={mailboxId:null,source:"None"};function Ze(s){const t=s.messageCount===1?"msg":"msgs";return`${H(s.providerPath,s.hierarchyDelimiter)} · ${s.messageCount} ${t}`}const le=s=>`${s} ${s===1?"message":"messages"}`,Je=(s,t)=>s==="Appointed"?"Chosen by you":s==="Flagged"?`The mail server marks it as ${t}`:s==="Reserved"?"The account's own INBOX":"Matched by name, not confirmed";function es({role:s,folders:t,appointment:r,displayName:l,onAppoint:d,onRename:a}){const[m,o]=c.useState(l),i=c.useRef(null),h=c.useRef(!1),p=c.useId(),{mailboxId:g,source:v,staleFolderPath:j}=r,u=t.find(N=>N.mailboxId===g)??null,f=ge(s),O=u!=null&&m.trim()!==l.trim();c.useEffect(()=>{!h.current||v==="Proposed"||(h.current=!1,i.current?.focus())},[v]);const I=(()=>{if(v==="None"){const N=s==="trash"?" Deleting mail needs one.":"";return e.jsx("span",{id:p,className:"pl-[7.5rem] text-xs text-fg-muted",children:`Not set — pick the folder this account uses for ${f}.${N}`})}return v==="Stale"||!u?null:e.jsx("span",{id:p,className:"truncate pl-[7.5rem] text-2xs text-fg-subtle",title:u.providerPath,children:`${Je(v,f)} · ${u.providerPath} · ${le(u.messageCount)}`})})(),w=s==="trash"?" Deleting mail is stopped until you pick another one.":u?` reader is using ${H(u.providerPath,u.hierarchyDelimiter)} instead.`:"",D=`The folder you chose for ${f}${j?` — ${j} —`:""} is gone from the mail server.${w}`;return e.jsxs("div",{className:"flex flex-col gap-1 border-b border-line px-row-inset py-2.5 last:border-b-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"flex w-28 shrink-0 items-center gap-2 text-sm font-medium text-fg",children:[fe(s),f]}),e.jsxs(Ke,{ref:i,className:"w-56 shrink-0",value:u?.mailboxId??V,"aria-label":`Folder for ${f}`,"aria-describedby":I||v==="Stale"?p:void 0,onChange:N=>d(s,N.target.value),children:[!u&&e.jsx("option",{value:V,disabled:!0,children:"Choose a folder"}),t.map(N=>e.jsx("option",{value:N.mailboxId,children:Ze(N)},N.mailboxId))]}),v==="Proposed"&&u&&e.jsx(y,{variant:"secondary",size:"sm",className:"shrink-0",onClick:()=>{h.current=!0,d(s,u.mailboxId)},children:`Set as ${f}`}),u&&e.jsxs(e.Fragment,{children:[e.jsx(Z,{className:"flex-1",value:m,placeholder:f,"aria-label":`Display name for ${f}`,onChange:N=>o(N.target.value)}),O&&e.jsx(y,{variant:"ghost",size:"sm",className:"shrink-0",icon:e.jsx(pe,{className:"size-4"}),"aria-label":"Save display name",onClick:()=>a(u.mailboxId,m)})]})]}),I,v==="Stale"&&e.jsx(z,{tone:"warning",variant:"soft",className:"ml-[7.5rem]",children:e.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{id:p,className:"flex-1",children:D}),e.jsx(y,{variant:"secondary",size:"sm",className:"shrink-0",onClick:()=>i.current?.focus(),children:"Pick a folder"})]})})]})}function ss(){return e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Each canonical role — Inbox, Drafts, Sent, Archive, Spam, Trash — points at one of your account's real folders. Pick the one that actually holds the mail; the message counts tell real folders from empty look-alikes."}),e.jsx("p",{children:`Appointing a folder to a role here doesn't touch any other role, and doesn't move or rename anything on the server — it just tells Remit which folder to treat as e.g. "Drafts" everywhere (sidebar, unread badges, the compose flow).`}),e.jsxs("p",{children:[e.jsx("strong",{className:"text-fg",children:"Your folders"})," is the account's real hierarchy. Open a folder to see what's inside it, make a new one where you're looking, and rename or delete any of them from its row."]})]})}function ts({accountEmail:s,folders:t,appointments:r,displayNames:l={},onAppoint:d,onRename:a}){const m=new Set(Object.values(r).map(i=>i.mailboxId).filter(i=>i!=null)),o=t.filter(i=>!m.has(i.mailboxId));return e.jsxs("section",{className:"space-y-3",children:[e.jsxs("header",{className:"space-y-1",children:[e.jsxs("h2",{className:"text-sm font-semibold text-fg",children:["Folder roles — ",s]}),e.jsx("p",{className:"text-xs text-fg-muted",children:"Each row says where its answer came from — your choice, the mail server's own flag, or a name reader matched."})]}),e.jsx("div",{className:"rounded-sm border border-line bg-surface",children:We.map(i=>{const h=r[i]??Xe;return e.jsx(es,{role:i,folders:t,appointment:h,displayName:h.mailboxId?l[h.mailboxId]??"":"",onAppoint:d,onRename:a},i)})}),o.length>0&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("h3",{className:"text-xs font-medium text-fg-muted",children:"Other folders"}),e.jsx("ul",{className:"rounded-sm border border-line bg-surface",children:o.map(i=>e.jsxs("li",{className:"flex items-center gap-2 border-b border-line px-row-inset py-2 text-sm text-fg last:border-b-0",children:[e.jsx(xe,{className:"size-4 shrink-0 text-fg-subtle"}),e.jsx("span",{className:"truncate",children:H(i.providerPath,i.hierarchyDelimiter)}),e.jsx("span",{className:"ml-auto shrink-0 text-2xs text-fg-subtle",children:le(i.messageCount)})]},i.mailboxId))})]})]})}const as=12e4,rs=2e3,ns="This folder is no longer in the account's folder list, so nothing was deleted.",ce=(s,t)=>{const r=s.find(l=>l.mailboxId===t);if(!r)throw new Error(ns);return r},is=(s,t)=>ce(s,t).lastSyncedAt??0;async function os({readMailboxes:s,mailboxId:t,since:r,signal:l,segmentMs:d=as,pollIntervalMs:a=rs,delay:m=be,now:o=Date.now}){const i=o()+d;for(;;){l?.throwIfAborted();const h=ce(await s(),t);if((h.lastSyncedAt??0)>r)return{status:"fresh",messageCount:h.messagesTotal};if(o()>=i)return{status:"pending"};await m(a,l)}}const de=50,ls=s=>s instanceof Error?s.message:"Something went wrong.",$=s=>s.then(t=>({ok:!0,value:t}),t=>({ok:!1,error:ls(t)})),cs=async(s,t,r,l)=>{const d=[];let a;for(let m=0;m<de;m+=1){if(l.aborted)return d;const{data:o}=await te({path:{mailboxId:s},query:{order:"desc",continuationToken:a},throwOnError:!0});for(const i of o.items)if(!t.has(i.messageId)&&!d.includes(i.messageId)&&(d.push(i.messageId),d.length>=r))return d;if(!o.continuationToken)break;a=o.continuationToken}return d},ds=async(s,t)=>{let r=0,l;for(let d=0;d<de;d+=1){if(t.aborted)return r;const{data:a}=await te({path:{mailboxId:s},query:{order:"desc",continuationToken:l},throwOnError:!0});if(r+=a.items.length,!a.continuationToken)break;l=a.continuationToken}return r};function ms({accountId:s,mailboxId:t,onDeleted:r}){const l=J(),[d,a]=c.useState("idle"),[m,o]=c.useState(null),[i,h]=c.useState(),[p,g]=c.useState(),v=c.useRef(null),j=c.useRef(void 0),u=c.useCallback(()=>{l.invalidateQueries({queryKey:ee({path:{accountId:s}})}),l.invalidateQueries({queryKey:se()})},[l,s]),f=c.useCallback(async()=>{a("deleting");const k=await $(ve({path:{accountId:s,mailboxId:t},throwOnError:!0}));if(!k.ok){h(k.error),a("error");return}u(),a("done"),r()},[s,t,u,r]),O=c.useCallback(()=>je({path:{accountId:s},throwOnError:!0}).then(({data:k})=>k.items.find(S=>S.mailboxId===t)?.messageCount??0),[s,t]),I=c.useCallback(()=>l.fetchQuery({...ye({path:{accountId:s}}),staleTime:0}).then(k=>k.mailboxes??[]),[l,s]),w=c.useCallback(async()=>{const k=new AbortController;v.current=k;const{signal:S}=k;a("checking"),h(void 0);const M=j.current!==void 0,C=await $((async()=>(M||(S.throwIfAborted(),j.current=is(await I(),t),S.throwIfAborted(),g(Date.now()),await Ne({path:{accountId:s},throwOnError:!0})),os({readMailboxes:I,mailboxId:t,since:j.current??0,signal:S})))());return S.aborted?(a("idle"),j.current=void 0,{status:"failed"}):C.ok?C.value.status==="pending"?(a("check-stalled"),{status:"pending"}):(j.current=void 0,C.value.messageCount>0?(a("idle"),u(),{status:"blocked",messageCount:C.value.messageCount}):(await f(),{status:"deleted"})):(j.current=void 0,h(C.error),a("error"),{status:"failed"})},[s,t,I,f,u]),D=c.useCallback(()=>{v.current?.abort()},[]),N=c.useCallback(async k=>{const S=new AbortController;v.current=S;const{signal:M}=S;a("moving"),h(void 0);const C=await $(O());if(M.aborted)return;if(!C.ok){h(C.error),a("error");return}let x=ke(C.value);o(x);const E=new Set;for(;;){if(M.aborted)return;const n=await $(cs(t,E,Se,M));if(M.aborted)return;if(!n.ok){x=_(x,n.error),o(x),h(n.error),a("error");return}const b=n.value;if(b.length===0)break;const F=await $(Ce({body:{messageIds:b,destinationMailboxId:k},throwOnError:!0}));if(M.aborted)return;if(!F.ok){x=_(x,F.error),o(x),h(F.error),a("error");return}for(const P of b)E.add(P);x=we(x,b.length),o(x)}const A=await $(ds(t,M));if(!M.aborted){if(!A.ok){x=_(x,A.error),o(x),h(A.error),a("error");return}if(A.value>0){const n=`${A.value} ${A.value===1?"email is":"emails are"} still syncing. Re-open delete to finish removing this folder.`;x=_(x,n),o(x),h(n),a("error"),u();return}await f()}},[t,O,f,u]),R=c.useCallback(()=>{v.current?.abort(),v.current=null,j.current=void 0,a("idle"),o(null),h(void 0),g(void 0)},[]);return{phase:d,progress:m,errorMessage:i,checkStartedAt:p,deleteMailbox:f,deleteIfEmpty:w,moveThenDelete:N,cancel:D,reset:R}}const L=s=>`${s} ${s===1?"email":"emails"}`;function us({open:s,accountId:t,folder:r,mailboxes:l,appointments:d,onClose:a}){const[m,o]=c.useState(()=>K(r.messageCount)),[i,h]=c.useState(),[p,g]=c.useState(),{createFolderIn:v}=ae(t),j=re(),{phase:u,progress:f,errorMessage:O,checkStartedAt:I,deleteMailbox:w,deleteIfEmpty:D,moveThenDelete:N,cancel:R,reset:k}=ms({accountId:t,mailboxId:r.mailboxId,onDeleted:a}),[S,M]=c.useState("0:00"),C=u==="checking"||u==="check-stalled";c.useEffect(()=>{if(!C||I===void 0)return;const T=()=>M(Ee(Date.now()-I));T();const ue=setInterval(T,1e3);return()=>clearInterval(ue)},[C,I]),c.useEffect(()=>{s&&(o(K(r.messageCount)),h(void 0),k())},[s,k]),c.useEffect(()=>{s&&g(void 0)},[s]),c.useEffect(()=>R,[R]);const x=c.useCallback(()=>{R(),a()},[R,a]),E=c.useCallback(async()=>{const T=await D();T.status==="blocked"&&(h(T.messageCount),o("choose-fate"))},[D]),A=c.useMemo(()=>Me({mailboxes:l,folderAppointments:d,excludeMailboxId:r.mailboxId,translator:j}),[l,d,r.mailboxId,j]),n=A.find(T=>T.id===p),b=c.useMemo(()=>q(r,ne(d).get(r.mailboxId),j),[r,d,j]);if(!s)return null;const F=`Delete ${b}`,P=i??r.messageCount,me=u==="moving"?e.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-10 text-center",children:[e.jsx(G,{className:"size-8 animate-spin text-accent-2"}),e.jsx("p",{className:"text-sm font-medium text-fg",children:"Moving emails…"}),e.jsx("p",{className:"text-xs text-fg-muted",role:"status","aria-live":"polite",children:f?Q(f):"Moved 0 of 0"})]}):u==="checking"?e.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-10 text-center",children:[e.jsx(G,{className:"size-8 animate-spin text-accent-2"}),e.jsx("p",{className:"text-sm font-medium text-fg",children:"Checking the folder on the mail server…"}),e.jsx("p",{className:"text-xs text-fg-muted",role:"status","aria-live":"polite",children:`Waiting ${S}. Nothing is deleted until the server answers.`})]}):u==="check-stalled"?e.jsxs("div",{className:"space-y-4 px-5 py-4",children:[e.jsx(z,{tone:"warning",variant:"soft",children:`The mail server hasn't reported back on this folder yet — ${S} so far. Nothing has been deleted.`}),e.jsx("p",{className:"text-xs text-fg-muted",children:"A sync covers the whole account, so a busy mailbox can take a while to come round to this folder."}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(y,{variant:"secondary",size:"sm",onClick:x,children:"Cancel"}),e.jsx(y,{size:"sm",onClick:()=>E(),children:"Keep waiting"})]})]}):u==="deleting"||u==="done"?e.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-10 text-center",children:[e.jsx(G,{className:"size-8 animate-spin text-accent-2"}),e.jsx("p",{className:"text-sm font-medium text-fg",children:"Deleting folder…"})]}):u==="error"?e.jsxs("div",{className:"space-y-4 px-5 py-4",children:[e.jsx(z,{tone:"danger",variant:"soft",children:O??"Something went wrong. Please try again."}),f&&e.jsxs("p",{className:"text-xs text-fg-muted",children:[Q(f),". Already-moved emails stay moved — re-open delete to continue with the rest."]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(y,{variant:"secondary",size:"sm",onClick:x,children:"Close"})})]}):m==="confirm-empty"?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"space-y-3 px-5 py-4 text-sm text-fg-muted",children:e.jsxs("p",{children:["Delete ",e.jsx("strong",{className:"text-fg",children:b}),"? This folder is empty and will be removed from the server."]})}),e.jsxs("footer",{className:"flex items-center justify-end gap-2 border-t border-line px-5 py-3",children:[e.jsx(y,{variant:"secondary",size:"sm",onClick:x,children:"Cancel"}),e.jsx(y,{variant:"danger",size:"sm",icon:e.jsx(B,{className:"size-3.5"}),onClick:()=>E(),children:"Delete folder"})]})]}):m==="choose-fate"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-3 px-5 py-4 text-sm text-fg-muted",children:[i!==void 0&&e.jsx(z,{tone:"warning",variant:"soft",children:`This folder is not empty: the mail server reports ${L(i)} in it. Nothing was deleted.`}),e.jsxs("p",{children:[e.jsx("strong",{className:"text-fg",children:b})," holds"," ",L(P),". What should happen to them?"]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("button",{type:"button",onClick:()=>o("confirm-delete-all"),className:"flex w-full items-center gap-3 rounded-sm border border-line px-3 py-2.5 text-left hover:bg-surface-raised",children:[e.jsx(B,{className:"size-4 shrink-0 text-danger"}),e.jsxs("span",{className:"flex-1",children:[e.jsx("span",{className:"block text-sm font-medium text-fg",children:"Delete them with the folder"}),e.jsx("span",{className:"block text-xs text-fg-muted",children:"The emails are removed from the server and can't be recovered."})]})]}),e.jsxs("button",{type:"button",onClick:()=>o("pick-destination"),className:"flex w-full items-center gap-3 rounded-sm border border-line px-3 py-2.5 text-left hover:bg-surface-raised",children:[e.jsx(Be,{className:"size-4 shrink-0 text-accent-2"}),e.jsxs("span",{className:"flex-1",children:[e.jsx("span",{className:"block text-sm font-medium text-fg",children:"Move them to another folder"}),e.jsx("span",{className:"block text-xs text-fg-muted",children:"Keep the emails, then delete the emptied folder."})]})]})]})]}),e.jsx("footer",{className:"flex items-center justify-end gap-2 border-t border-line px-5 py-3",children:e.jsx(y,{variant:"secondary",size:"sm",onClick:x,children:"Cancel"})})]}):m==="confirm-delete-all"?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"space-y-3 px-5 py-4 text-sm text-fg-muted",children:e.jsxs("p",{children:["Delete ",e.jsx("strong",{className:"text-fg",children:b})," and its"," ",L(P),"? The messages are removed from the server with the folder and can't be recovered."]})}),e.jsxs("footer",{className:"flex items-center justify-end gap-2 border-t border-line px-5 py-3",children:[e.jsx(y,{variant:"secondary",size:"sm",onClick:()=>o("choose-fate"),children:"Back"}),e.jsx(y,{variant:"danger",size:"sm",icon:e.jsx(B,{className:"size-3.5"}),onClick:()=>w(),children:"Delete folder and emails"})]})]}):e.jsxs("div",{className:"flex h-[26rem] flex-col",children:[e.jsxs("p",{className:"px-5 pt-4 text-sm text-fg-muted",children:["Move the ",L(P)," in"," ",e.jsx("strong",{className:"text-fg",children:b})," to:"]}),e.jsx("div",{className:"flex min-h-0 flex-1 overflow-hidden",children:e.jsx(Y,{folders:A,selectedId:p,delimiter:l[0]?.hierarchyDelimiter??"/",onSelect:g,onCreateFolder:v,onCancel:()=>{g(void 0),o("choose-fate")},labels:{filterPlaceholder:"Move emails to…"}})}),n&&e.jsx("footer",{className:"shrink-0 border-t border-line p-2",children:e.jsx(y,{variant:"danger",onClick:()=>N(n.id),className:"h-11 w-full font-semibold",children:e.jsx("span",{className:"truncate",children:`Move ${L(P)} to ${n.label}`})})})]});return e.jsxs(W,{open:s,onClose:x,title:F,children:[e.jsxs("header",{className:"flex items-center gap-2 border-b border-line px-5 py-3",children:[e.jsx(Ie,{className:"size-4 shrink-0 text-danger"}),e.jsx("span",{className:"flex-1 text-sm font-semibold text-fg",children:F}),e.jsx(y,{variant:"ghost",size:"sm",icon:e.jsx(X,{className:"size-3.5"}),onClick:x,"aria-label":"Cancel"})]}),me]})}function hs({account:s}){const t=J(),r=s.accountId,l=re(),{data:d,isPending:a,isError:m,error:o,refetch:i}=ie(Fe({path:{accountId:r}})),{createFolderIn:h}=ae(r),p=U({...Te(),meta:Re(409),onSuccess:()=>{t.invalidateQueries({queryKey:se()})}}),g=U({...Pe(),onSuccess:()=>{t.invalidateQueries({queryKey:ee({path:{accountId:r}})})}}),[v,j]=c.useState(),[u,f]=c.useState(),[O,I]=c.useState(""),w=c.useMemo(()=>d?.items??[],[d]),D=c.useMemo(()=>ne(s.folderAppointments),[s.folderAppointments]),N=c.useMemo(()=>w.map(n=>({id:n.mailboxId,label:q(n,D.get(n.mailboxId),l),path:n.fullPath,deleteBlockedReason:$e(n,w,s.folderAppointments).message,failure:qe(n)})),[w,D,l,s.folderAppointments]),R=(n,b)=>{p.mutate({path:{accountId:r,role:_e[n]},body:{mailboxId:b}})},k=(n,b)=>{const F=b.trim();g.mutate({path:{accountId:r,mailboxId:n},body:{displayNameOverride:F===""?null:F}})};if(a)return e.jsx("div",{className:"h-24 animate-pulse rounded-sm border border-line bg-surface","aria-busy":"true","aria-label":`Loading folders for ${s.email}`});if(m)return e.jsx(oe,{variant:"inline",title:`Couldn't load folders for ${s.email}`,error:o,onRetry:()=>{i()}});const S=w.map(n=>({mailboxId:n.mailboxId,providerPath:n.fullPath,hierarchyDelimiter:n.hierarchyDelimiter,messageCount:n.messageCount})),M={};for(const n of s.folderAppointments){const b=Le[n.role];b&&(M[b]={mailboxId:n.mailboxId??null,source:n.source,staleFolderPath:n.staleAppointmentPath})}const C={};for(const n of w)n.displayNameOverride&&(C[n.mailboxId]=n.displayNameOverride);const x=n=>w.find(b=>b.mailboxId===n),E=x(u),A=x(v);return e.jsxs("div",{className:"space-y-4",children:[(p.isError||g.isError)&&e.jsx(z,{tone:"danger",variant:"soft",children:ze(p.error)?"That folder is still being created on the mail server — wait for it to finish, then try again.":"Couldn't save that change. Please try again."}),e.jsx(ts,{accountEmail:s.email,folders:S,appointments:M,displayNames:C,onAppoint:R,onRename:k}),e.jsxs("section",{className:"space-y-1.5",children:[e.jsxs("h3",{className:"text-sm font-semibold text-fg",children:["Your folders — ",s.email]}),e.jsx("div",{className:"flex h-[28rem] flex-col overflow-hidden rounded-sm border border-line bg-surface",children:e.jsx(Ve,{folders:N,delimiter:w[0]?.hierarchyDelimiter??"/",onCreateFolder:h,onRename:n=>{f(n.id),I(x(n.id)?.displayNameOverride?.trim()??"")},onDelete:n=>j(n.id),labels:{treeAriaLabel:`All folders for ${s.email}`}})})]}),E&&e.jsx(Ye,{open:!0,folderLabel:q(E,D.get(E.mailboxId),l),defaultLabel:q({fullPath:E.fullPath,hierarchyDelimiter:E.hierarchyDelimiter},D.get(E.mailboxId),l),name:O,onNameChange:I,pending:g.isPending,error:g.isError?"Couldn't save that name. Please try again.":void 0,onSubmit:()=>{const n=O.trim();g.mutate({path:{accountId:r,mailboxId:E.mailboxId},body:{displayNameOverride:n===""?null:n}},{onSuccess:()=>f(void 0)})},onClose:()=>f(void 0)}),A&&e.jsx(us,{open:!0,accountId:r,folder:A,mailboxes:w,appointments:s.folderAppointments,onClose:()=>j(void 0)})]})}function Is(){const s=Ae(),t=De(),r=Ge(),[l,d]=c.useState(!0),{data:a,isPending:m,isError:o,error:i,refetch:h}=ie(Oe());return e.jsx(He,{items:t,activeId:"folders",title:"Folder roles",description:"Appoint which real folder fills each canonical role, per account.",help:e.jsx(ss,{}),helpOpen:l,onToggleHelp:()=>d(p=>!p),onSelect:r,onBackToMail:()=>{s({to:"/mail"})},children:m?e.jsx("div",{className:"h-24 animate-pulse rounded-sm border border-line bg-surface","aria-busy":"true","aria-label":"Loading accounts"}):o?e.jsx(oe,{title:"Couldn't load accounts",error:i,onRetry:()=>{h()}}):a.accounts.length===0?e.jsx("p",{className:"py-12 text-sm text-fg-muted",children:"No accounts configured."}):e.jsx("div",{className:"space-y-8",children:a.accounts.map(p=>e.jsx(hs,{account:p},p.accountId))})})}export{Is as component};
@@ -1 +0,0 @@
1
- import{b as W,j as e,d as x,B as f,L as _,X as Ee,r,I as Oe,e as pe,a as ze,c as Be,f as q,s as de,g as $e,h as Pe,i as De,m as Le,k as J,l as qe}from"./index-9JWzpiiR.js";import{W as k,C as fe,a as le,u as He,b as We,c as _e,d as Ke,S as Qe,R as Ue}from"./credential-steps-MLDe683C.js";import{c as ge,f as Ve,v as xe,r as Ge,a as Je,b as ue,w as me,p as Xe,W as Ye,s as Ze,g as et}from"./config-import-DZkZ73sW.js";import{F as tt}from"./file-json-B3Qb4sPC.js";import{B as O}from"./badge-DLlDkvBl.js";import{c as st}from"./onboarding-completion-Z1EOTA33.js";import"./select-Dv65Mqkl.js";import"./chevron-down-Q4i_URUt.js";import"./card-XAEgDd1b.js";const nt=W("FolderClock",[["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}],["path",{d:"M7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2",key:"1urifu"}],["path",{d:"M16 14v2l1 1",key:"xth2jh"}]]);const it=W("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);const at=W("Merge",[["path",{d:"m8 6 4-4 4 4",key:"ybng9g"}],["path",{d:"M12 2v10.3a4 4 0 0 1-1.172 2.872L4 22",key:"1hyw0i"}],["path",{d:"m20 22-5-5",key:"1m27yz"}]]);const rt=W("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]),y=["File","Review","Credentials","Folders"];function Y({children:t}){return e.jsx("code",{className:"block rounded bg-surface-sunken px-2.5 py-2 text-2xs text-fg-muted",children:t})}function ot({state:t="idle",file:n,ready:i=!1,failure:s,onChoose:d,onDragStateChange:l,onNext:h}){const w=r.useId(),u=r.useRef(null),p=t==="dragging",j=t==="reading",N=t==="checking",R=j||N,S=m=>{m.preventDefault(),l?.(!1);const b=m.dataTransfer.files.item(0);b&&d?.(b)};return e.jsx(k,{steps:y,activeStep:0,title:"Import a config file",subtitle:"Accounts, folder roles, rules, senders and appearance — everything except passwords.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-2xs text-fg-subtle",children:"Nothing is written until you have seen what will change."}),e.jsx(f,{variant:"primary",disabled:R||!i,icon:R?e.jsx(_,{className:"size-3.5 animate-spin"}):void 0,onClick:h,children:j?"Reading…":N?"Checking…":"Check the file"})]}),children:e.jsxs("div",{className:"space-y-4",children:[s&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(x,{tone:"danger",children:s.title}),e.jsx("p",{className:"text-sm text-fg",children:s.explanation}),e.jsx("p",{className:"text-sm text-fg-muted",children:s.fix}),e.jsx(Y,{children:s.raw})]}),e.jsxs("div",{onDragOver:m=>{m.preventDefault(),l?.(!0)},onDragLeave:()=>l?.(!1),onDrop:S,className:p?"flex flex-col items-center gap-3 rounded-sm border-2 border-dashed border-accent bg-accent-soft px-4 py-9 text-center":"flex flex-col items-center gap-3 rounded-sm border-2 border-dashed border-line px-4 py-9 text-center",children:[e.jsx("span",{className:"flex size-11 items-center justify-center rounded-md bg-surface-sunken",children:e.jsx(rt,{className:"size-5 text-fg-muted"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-fg",children:p?"Drop it here":"Drop a config file here, or choose one"}),e.jsx("p",{className:"mt-1 text-xs text-fg-subtle",children:"A .json file written by Reader — up to 2 MB."})]}),e.jsx("input",{ref:u,id:w,type:"file",accept:"application/json,.json",className:"sr-only",onChange:m=>{const b=m.target.files?.item(0);b&&d?.(b)}}),e.jsx(f,{variant:"secondary",size:"sm",onClick:()=>u.current?.click(),children:"Choose file"})]}),n&&e.jsxs("div",{className:"flex items-start gap-3 rounded-sm border border-line px-3 py-2.5",children:[e.jsx(tt,{className:"mt-0.5 size-4 shrink-0 text-fg-muted"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-sm text-fg",children:n.name}),e.jsxs("p",{className:"mt-0.5 text-xs text-fg-subtle",children:[Ve(n.size)," ·"," ",j?"reading it from disk":N?"checking it against this instance":i?"ready to check — nothing has been sent yet":"not a configuration this instance can read"]})]})]}),e.jsxs("p",{className:"text-2xs text-fg-subtle",children:["Export one from Settings → Advanced on the instance you are moving from, or run"," ",e.jsx("code",{className:"rounded bg-surface-sunken px-1 py-0.5",children:"remit config save"})," ","on its host."]})]})})}function ct({sections:t}){const n=ge(t.flatMap(i=>i.entries.map(s=>({section:i.id,key:s.label,verdict:s.verdict}))));return e.jsx("div",{className:"flex flex-wrap gap-1.5",children:["created","updated","unchanged","skipped","rejected"].filter(i=>n[i]>0).map(i=>e.jsxs(O,{tone:xe[i],dot:!0,children:[n[i]," ",i]},i))})}function dt({section:t}){return e.jsxs("section",{children:[e.jsx("h2",{className:"text-sm font-semibold text-fg",children:t.title}),e.jsx("ul",{className:"mt-1.5 divide-y divide-line",children:t.entries.map(n=>e.jsxs("li",{className:"flex items-start gap-3 py-2",children:[e.jsx(O,{tone:xe[n.verdict],className:"mt-0.5 shrink-0",children:n.verdict}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-sm text-fg",children:n.label}),n.reason&&e.jsx("p",{className:n.verdict==="rejected"?"mt-1 text-xs text-danger":"mt-1 text-xs text-warning",children:n.reason})]})]},n.id))})]})}function lt({sections:t,fileName:n,warnings:i=[],applying:s=!1,onBack:d,onNext:l}){const h=ge(t.flatMap(p=>p.entries.map(j=>({section:p.id,key:j.label,verdict:j.verdict})))),w=h.created+h.updated,u=h.skipped+h.rejected;return e.jsx(k,{steps:y,activeStep:1,title:"What this file will change",subtitle:`${n} · nothing has been written yet.`,footer:e.jsxs(e.Fragment,{children:[e.jsx(f,{variant:"ghost",onClick:d,children:"Choose another file"}),e.jsx(f,{variant:"primary",disabled:s,icon:s?e.jsx(_,{className:"size-3.5 animate-spin"}):void 0,onClick:l,children:s?"Importing…":`Import ${w} changes`})]}),children:e.jsxs("div",{className:"space-y-5",children:[e.jsx(ct,{sections:t}),u>0&&e.jsxs(x,{tone:"warning",children:[u," entries will not be imported. Each says why below — read them before you continue, because nothing here retries on its own."]}),i.length>0&&e.jsx("ul",{className:"space-y-1 text-xs text-warning",children:i.map(p=>e.jsx("li",{children:p},p))}),t.map(p=>e.jsx(dt,{section:p},p.id))]})})}function ut({choice:t,held:n,onChoose:i,onBack:s,onNext:d}){return e.jsx(k,{steps:y,activeStep:1,title:"This instance already has configuration",subtitle:n,footer:e.jsxs(e.Fragment,{children:[e.jsx(f,{variant:"ghost",onClick:s,children:"Choose another file"}),e.jsx(f,{variant:"primary",disabled:!t,onClick:d,children:t==="merge"?"Continue with merge":"Continue"})]}),children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(x,{tone:"warning",children:"An import into a configured instance can only add and update — it never deletes what is here. Pick how the two should meet."}),e.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[e.jsx(le,{name:"Stop, keep this instance",description:"Nothing is written. Use this if you meant to import into a fresh instance.",icon:e.jsx(Ee,{className:"size-5"}),selected:t==="abort",onSelect:()=>i?.("abort")}),e.jsx(le,{name:"Merge the file in",description:"Adds what is missing and updates what differs. Existing accounts keep their server settings.",icon:e.jsx(at,{className:"size-5"}),selected:t==="merge",onSelect:()=>i?.("merge")})]}),t==="merge"&&e.jsx("p",{className:"text-xs text-fg-muted",children:"The next screen lists every add and update before anything is written."})]})})}function mt(t){return t==="entered"?e.jsx(O,{tone:"positive",children:"ready"}):t==="failed"?e.jsx(O,{tone:"danger",children:"sign-in failed"}):e.jsx(O,{tone:"danger",children:"credentials needed"})}function ht({accounts:t,busyAccountId:n,onOpen:i}){return e.jsx("ul",{className:"divide-y divide-line",children:t.map(s=>e.jsxs("li",{className:s.state==="entered"?"flex flex-wrap items-start justify-between gap-3 py-3":"flex flex-wrap items-start justify-between gap-3 border-l-2 border-danger bg-danger-soft py-3 pl-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-fg",children:s.address}),mt(s.state)]}),e.jsxs("p",{className:"mt-0.5 text-xs text-fg-subtle",children:[s.displayName," ·"," ",s.connector==="microsoft"?"Microsoft 365":"IMAP / SMTP"," ","· ",s.server]}),s.state!=="entered"&&e.jsx("p",{className:"mt-1 text-xs text-danger",children:s.failure??(s.connector==="microsoft"?"Config files never carry OAuth tokens. Reconnect with Microsoft to start syncing this account.":"Config files never carry passwords. Enter this mailbox's password to start syncing.")})]}),s.state!=="entered"&&e.jsx(f,{variant:"primary",size:"sm",disabled:n===s.accountId,icon:n===s.accountId?e.jsx(_,{className:"size-3.5 animate-spin"}):s.connector==="microsoft"?e.jsx(Oe,{className:"size-3.5"}):e.jsx(it,{className:"size-3.5"}),onClick:()=>i?.(s),children:n===s.accountId?"Redirecting…":s.connector==="microsoft"?"Reconnect":s.state==="failed"?"Try again":"Enter password"})]},s.accountId))})}function pt({accounts:t,busyAccountId:n,error:i,onOpen:s,onNext:d}){const l=t.filter(h=>h.state!=="entered").length;return e.jsx(k,{steps:y,activeStep:2,title:"These accounts need credentials",subtitle:"The config file carries servers and settings. Passwords and Microsoft sign-ins it deliberately leaves out.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-2xs text-fg-subtle",children:l>0?"Settings › Accounts keeps asking until every account is signed in.":"Every account can sync."}),e.jsx(f,{variant:"primary",onClick:d,children:l>0?"Finish later":"All accounts connected"})]}),children:e.jsxs("div",{className:"space-y-4",children:[i&&e.jsx(x,{tone:"danger",children:i}),l>0&&e.jsxs(x,{tone:"danger",children:[l," of ",t.length," accounts cannot sync yet. They stay listed in Settings, marked like this, until you sign in — no mail arrives for them in the meantime."]}),e.jsx(ht,{accounts:t,busyAccountId:n,onOpen:s})]})})}function ft({account:t,position:n,total:i,error:s,busy:d=!1,onBack:l,onNext:h}){return e.jsx(k,{steps:y,activeStep:2,title:`Reconnect ${t.address}`,subtitle:`Account ${n} of ${i} · Microsoft 365`,footer:e.jsxs(e.Fragment,{children:[e.jsx(f,{variant:"ghost",onClick:l,children:"Back"}),e.jsx(f,{variant:"primary",disabled:d,icon:d?e.jsx(_,{className:"size-3.5 animate-spin"}):void 0,onClick:h,children:d?"Redirecting…":"Sign in with Microsoft"})]}),children:e.jsxs("div",{className:"space-y-4",children:[s&&e.jsx(x,{tone:"danger",children:s}),e.jsx(x,{tone:"info",children:"A config file never carries an OAuth token — one only works for the instance it was granted to. Signing in here mints a fresh one for this instance."}),e.jsxs("div",{className:"rounded-sm border border-line px-3 py-2.5",children:[e.jsx("p",{className:"text-sm text-fg",children:t.displayName}),e.jsxs("p",{className:"mt-0.5 text-xs text-fg-subtle",children:[t.address," · ",t.server]})]}),e.jsx("p",{className:"text-2xs text-fg-subtle",children:"You will be sent to Microsoft and returned here. If your organisation requires admin approval, the sign-in stops there and this account keeps waiting."})]})})}function gt({folders:t,onNext:n}){return e.jsx(k,{steps:y,activeStep:3,title:t.length>0?"Creating folders":"Import finished",subtitle:t.length>0?"The config names folders this account does not have yet. Reader creates them on the mail server.":"Everything in the file landed, and every folder it named resolved.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-2xs text-fg-subtle",children:"Folder discovery runs with every sync."}),e.jsx(f,{variant:"primary",onClick:n,children:"Go to inbox"})]}),children:e.jsx("div",{className:"space-y-4",children:t.length>0?e.jsxs(e.Fragment,{children:[e.jsxs(x,{tone:"warning",children:[t.length," settings are imported but switched off. Reader creates each missing folder on the mail server the next time the account syncs, and turns the setting on once the server confirms it. A rule whose folder cannot be created stays off, and Settings → Filters says why."]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-fg-muted",children:[e.jsx(nt,{className:"size-4"}),"Folder discovery runs with every sync of the account."]}),e.jsx("div",{className:"divide-y divide-line",children:t.map(i=>e.jsx(fe,{label:i.path,detail:i.waitingFor,state:"pending"},`${i.accountId??""}-${i.path}-${i.waitingFor}`))})]}):e.jsx(x,{tone:"success",children:"Every account, rule, label and sender in the file is live on this instance."})})})}function xt({failure:t,onBack:n}){return e.jsx(k,{steps:y,activeStep:0,title:t.title,subtitle:"Nothing was imported.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-2xs text-fg-subtle",children:"This instance is unchanged."}),e.jsx(f,{variant:"primary",onClick:n,children:"Choose another file"})]}),children:e.jsxs("div",{className:"space-y-3",children:[e.jsx(x,{tone:"danger",children:t.explanation}),e.jsx("p",{className:"text-sm text-fg",children:t.fix}),e.jsx(Y,{children:t.raw})]})})}function jt(t){return t==="landed"?"ok":t==="failed"||t==="unknown"?"failed":"pending"}function vt({results:t,message:n,raw:i,nothingLanded:s,onBack:d,onNext:l}){const h=t.filter(u=>u.state==="landed").length,w=t.some(u=>u.state==="unknown");return e.jsx(k,{steps:y,activeStep:1,title:s?"The import stopped, and nothing landed":"The import stopped part-way",subtitle:s?"No section of the file was written.":w?"It did not say how far it got, so check Settings before importing again.":`${h} of ${t.length} sections landed.`,footer:e.jsxs(e.Fragment,{children:[e.jsx(f,{variant:"ghost",onClick:d,children:"Choose another file"}),e.jsx(f,{variant:"primary",onClick:l,children:s?"Try the import again":"Retry the rest"})]}),children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(x,{tone:"danger",children:n}),e.jsx("p",{className:"text-sm text-fg-muted",children:"Retrying is safe: an import folds into what is already here rather than replacing it, so what landed is recognised and left alone."}),e.jsx("div",{className:"divide-y divide-line",children:t.map(u=>e.jsx(fe,{label:u.title,detail:u.detail,state:jt(u.state)},u.section))}),e.jsx(Y,{children:i})]})})}const je=(t,n)=>t?"tls":n?"starttls":"none",yt=t=>({host:t.imapHost,port:t.imapPort,security:je(t.imapTls,t.imapStartTls)}),wt=t=>({host:t.smtpEnabled?t.smtpHost:"",port:t.smtpPort,security:je(t.smtpTls,t.smtpStartTls)}),he=(t,n,i)=>{const s=t.authType==="oauthMicrosoft"?"microsoft":"imap",d=!i&&(s==="microsoft"?t.connectionState==="reauth_required":t.connectionState==="credentials_missing");return{accountId:t.accountId,address:t.email,displayName:t.displayName?.trim()||t.email,connector:s,server:`${t.imapHost}:${t.imapPort}`,state:n?"failed":d?"needed":"entered",failure:n}},bt=t=>{if(!t)return"This instance already holds configuration of its own.";const n=[["accounts","account"],["labels","label"],["filters","rule"],["addressFlags","flagged sender"]].map(([i,s])=>({count:Number(t[i]??0),noun:s})).filter(i=>i.count>0).map(i=>`${i.count} ${i.noun}${i.count===1?"":"s"}`);return n.length===0?"This instance already holds configuration of its own.":`${n.join(", ")} are set up here already.`},H=(t,n)=>{if(t instanceof Error)return t.message;if(typeof t=="object"&&t!==null){const i=t.message;if(typeof i=="string")return i}return n};function kt({onDone:t}){const n=pe(),[i,s]=r.useState("file"),[d,l]=r.useState(!1),[h,w]=r.useState(!1),[u,p]=r.useState(void 0),[j,N]=r.useState(void 0),[R,S]=r.useState(void 0),[m,b]=r.useState(void 0),[Z,ee]=r.useState("abort"),[te,se]=r.useState(void 0),[ye,K]=r.useState(void 0),[C,we]=r.useState([]),[Q,be]=r.useState([]),[g,I]=r.useState(null),[T,U]=r.useState({username:"",password:""}),[F,V]=r.useState({}),[ke,ne]=r.useState(void 0),[G,z]=r.useState(null),[B,Ne]=r.useState([]),{data:$}=ze({...Be(),enabled:C.length>0||i==="folders"}),A=r.useMemo(()=>{const a=new Map;for(const o of $?.accounts??[])a.set(o.accountId,o);return a},[$]),Se=r.useMemo(()=>C.map(a=>A.get(a)).filter(a=>!!a).map(a=>he(a,F[a.accountId],Q.includes(a.accountId))),[C,A,F,Q]),c=g?A.get(g):void 0,ie=g?C.indexOf(g)+1:0,P=q({...$e(),meta:de(409)}),ae=q({...Pe(),meta:de(403,404)}),re=q(De()),oe=q(Le());He(G!==null,()=>{n.invalidateQueries({queryKey:J()}),z(null)});const ce=We(a=>{z(null),a==="stalled"&&ne(Ue)}),Ce=r.useCallback(a=>{l(!1),w(!0),p({name:a.name,size:a.size}),S(void 0),N(void 0),a.text().then(o=>Ge(a.name,a.size,o)).then(o=>{if(w(!1),!o.ok){S(o.failure);return}N(o.document)}).catch(o=>{w(!1),S({title:"That file could not be read",explanation:`The browser could not read ${a.name} from disk, so nothing was sent.`,fix:"Check the file is still there and try again.",raw:H(o,"the file read was refused")})})},[]),D=r.useCallback((a,o)=>{j&&(K(void 0),P.mutate({body:{mode:a,onExisting:o,document:j}},{onSuccess:v=>{if(b(v),ue(v)){s("rejected");return}if(me(v)){s("partial");return}if(a==="validate"){s("review");return}if(Ne(Xe(v)),n.invalidateQueries({queryKey:J()}),v.accountsNeedingCredentials.length>0){we([...v.accountsNeedingCredentials]),s("credentials");return}s("folders")},onError:v=>{const L=Je(v);if(L){K(L),se(void 0),s("conflict");return}S({title:"The import could not be sent",explanation:"The request to this instance failed before it produced a report, so nothing was written.",fix:"Check your connection and try again.",raw:H(v,"POST /config/import failed")}),s("file")}}))},[j,P,n]),Ie=r.useCallback(a=>{if(I(a.accountId),ne(void 0),a.connector==="microsoft"){s("account-oauth");return}const o=A.get(a.accountId);U({username:o?.username||a.address,password:""}),s("account-password")},[A]),Te=r.useCallback(()=>{g&&ae.mutate({path:{accountId:g},body:{password:T.password,isActive:!0}},{onSuccess:()=>{re.mutate({path:{accountId:g}}),be(a=>a.includes(g)?a:[...a,g]),V(a=>{const o={...a};return delete o[g],o}),n.invalidateQueries({queryKey:J()}),U({username:"",password:""}),I(null),s("credentials")},onError:a=>{V(o=>({...o,[g]:H(a,"The password was verified but could not be stored. Try again.")})),I(null),s("credentials")}})},[g,T.password,n,re,ae]),Re=r.useCallback(()=>{c&&(z(c.accountId),oe.mutate({body:{email:c.email}},{onSuccess:a=>{ce(),window.location.assign(a.authorizationUrl)},onError:a=>{z(null),V(o=>({...o,[c.accountId]:H(a,"Microsoft sign-in could not be started.")})),I(null),s("credentials")}}))},[c,ce,oe]),Fe=r.useCallback((a,o)=>U({username:a,password:o}),[]),Ae=r.useMemo(()=>{const a=$?.pendingImport?.folderPaths;if(!a)return B;const o=new Set(a),v=B.filter(E=>o.has(E.path)),L=a.filter(E=>!B.some(Me=>Me.path===E)).map(E=>({path:E,waitingFor:"An imported setting"}));return[...v,...L]},[$,B]),M=r.useCallback(()=>{b(void 0),K(void 0),S(void 0),p(void 0),N(void 0),ee("abort"),s("file")},[]);switch(i){case"file":return e.jsx(ot,{state:h?"reading":P.isPending?"checking":d?"dragging":"idle",file:u,ready:j!==void 0,failure:R,onChoose:Ce,onDragStateChange:l,onNext:()=>D("validate",Z)});case"rejected":return e.jsx(xt,{failure:(m&&ue(m))??R??{title:"The file could not be imported",explanation:"The import was refused and nothing was written.",fix:"Re-export the configuration and try again.",raw:"no error was reported"},onBack:M});case"conflict":return e.jsx(ut,{choice:te,held:bt(ye?.details),onChoose:se,onBack:M,onNext:()=>{if(te==="abort"){t("abandoned");return}ee("merge"),D("validate","merge")}});case"review":return e.jsx(lt,{sections:et(m?.items??[]),fileName:u?.name??"the config file",warnings:(m?.warnings??[]).map(a=>a.message),applying:P.isPending,onBack:M,onNext:()=>D("apply",Z)});case"partial":{if(!m)return e.jsx(Nt,{onBack:M});const a=me(m);return e.jsx(vt,{results:Ze(m),message:a?.message??"The import stopped before it finished.",raw:`${a?.code??Ye}: ${a?.message??"no message"}`,nothingLanded:!m.applied,onBack:M,onNext:()=>D("apply","merge")})}case"credentials":return e.jsx(pt,{accounts:Se,busyAccountId:G??void 0,error:ke,onOpen:Ie,onNext:()=>s("folders")});case"account-password":return c?e.jsx(Ke,{steps:y,activeStep:2,title:`Sign in to ${c.email}`,subtitle:`Account ${ie} of ${C.length} · ${c.imapHost}:${c.imapPort}`,email:c.email,username:T.username,password:T.password,error:F[c.accountId],continueLabel:"Test and continue",notice:e.jsxs("div",{className:"flex items-center gap-2 text-xs text-fg-muted",children:[e.jsx(Qe,{className:"size-3.5"}),"Server settings came from the config file — edit them in Settings if they are wrong."]}),onContinue:()=>s("account-test"),onBack:()=>{I(null),s("credentials")},onChange:Fe}):e.jsx(X,{onBack:()=>t("abandoned")});case"account-test":return c?e.jsx(_e,{steps:y,activeStep:2,email:c.email,imapConfig:yt(c),smtpConfig:wt(c),username:T.username,password:T.password,credentialsBackLabel:"Back to the password",serversBackLabel:"Back to the password",successLabel:"Save and continue",onSuccess:Te,onBackToCredentials:()=>s("account-password"),onBackToServers:()=>s("account-password")}):e.jsx(X,{onBack:()=>t("abandoned")});case"account-oauth":return c?e.jsx(ft,{account:he(c,F[c.accountId],Q.includes(c.accountId)),position:ie,total:C.length,error:F[c.accountId],busy:G===c.accountId,onBack:()=>{I(null),s("credentials")},onNext:Re}):e.jsx(X,{onBack:()=>t("abandoned")});case"folders":return e.jsx(gt,{folders:Ae,onNext:()=>t("imported")})}}function ve({children:t,label:n,onBack:i}){return e.jsxs("div",{className:"mx-auto max-w-lg p-6",children:[e.jsx(x,{tone:"danger",children:t}),e.jsx("button",{type:"button",className:"mt-3 text-sm text-accent underline",onClick:i,children:n})]})}function X({onBack:t}){return e.jsx(ve,{label:"Go to inbox",onBack:t,children:"That account is no longer in this instance's configuration, so there is nothing left to sign in to. Open Settings › Accounts to see what is here."})}function Nt({onBack:t}){return e.jsx(ve,{label:"Choose another file",onBack:t,children:"The import stopped but produced no report, so nothing here can say what it wrote. Open Settings to see what this instance holds before importing again."})}function Ot(){const t=qe(),n=pe(),i=r.useCallback(s=>{st({queryClient:n,recordCompleted:()=>{s==="imported"&&t.recordEvent("config.imported")},navigateToInbox:()=>{window.location.assign("/mail")}})},[t,n]);return e.jsx(kt,{onDone:i})}export{Ot as component};
@@ -1 +0,0 @@
1
- import{j as t,aa as o}from"./index-9JWzpiiR.js";const a=()=>t.jsx(o,{to:"/settings/accounts"});export{a as component};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-9JWzpiiR.js";import{M as r}from"./MailboxPane-DszlAx2f.js";import"./MailViewChrome-U9YpZx_B.js";import"./search-token-index--Pzg9wI2.js";import"./reply-BUVhW3yq.js";import"./nav-link-8l24_oWF.js";import"./useMediaQuery-BzGo-bVp.js";import"./search-scope-aZ2AZX-k.js";import"./app-chrome-BI9iJnw3.js";import"./useQueries-Des6lpmI.js";import"./roving-focus-C87O2raY.js";import"./MessageToolbar-mGmOl_Xf.js";import"./MessageBody-zT-at0bi.js";import"./kbd-D_0s6Sx_.js";import"./useMessageBodyContent-D9UpR1Dh.js";import"./chevron-down-Q4i_URUt.js";import"./index-DqlUjB9k.js";import"./useSignature-CQsNwcJm.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-DRrHzwce.js";import"./suggest-list-xX77W_hF.js";import"./sections-BtFAPYYy.js";import"./badge-DLlDkvBl.js";import"./undo-2-CGWL2haZ.js";import"./DropdownMenu-CGhv-K3k.js";import"./popover-menu-BCEzStJs.js";import"./ErrorState-BB0xpcCi.js";import"./mail-CXavFmSm.js";import"./download-BSz8KKlH.js";import"./avatar-COXPYlBH.js";import"./EmptyState-B_Kthrla.js";import"./calendar-suggestion-CpOWds4W.js";import"./useCalendarSuggestions-DW7WFMvd.js";import"./agenda-time-hKUG2dhl.js";import"./plus-Cp9K9QJ4.js";import"./calendar-format-BwCpz-JZ.js";import"./calendar-Cmzt0eKc.js";import"./calendar-failure-note-BRyIsChq.js";import"./checkbox-CzFLh5Dk.js";import"./clock-jwuPTxhb.js";import"./segmented-control-tpWp-yev.js";import"./shield-check-BbF5QmrH.js";import"./useLayoutTier-CeBSbbkD.js";import"./menu-Dro5vzLW.js";import"./useFilters-DdYKMP_s.js";import"./select-Dv65Mqkl.js";import"./folder-input-C8-nffA0.js";import"./confirm-dialog-D33DXPkQ.js";import"./label-chip-zJi2r8mQ.js";import"./refresh-cw-0FbK4O4v.js";import"./useRefreshControl-CWSpNwGo.js";import"./circle-check-big-CDjntmXC.js";import"./LabelApplyTrigger-ChzWyjHs.js";import"./useLabels-ouqsQR1c.js";import"./NavMenuButton-B_c3nIpV.js";import"./bottom-sheet-BUOc_BG6.js";import"./circle-help-B6Fn573l.js";import"./circle-check-BucqMsie.js";function ao(){return o.jsx(r.Reading,{})}export{ao as component};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-9JWzpiiR.js";import{M as i}from"./MailboxPane-DszlAx2f.js";import"./MailViewChrome-U9YpZx_B.js";import"./search-token-index--Pzg9wI2.js";import"./reply-BUVhW3yq.js";import"./nav-link-8l24_oWF.js";import"./useMediaQuery-BzGo-bVp.js";import"./search-scope-aZ2AZX-k.js";import"./app-chrome-BI9iJnw3.js";import"./useQueries-Des6lpmI.js";import"./roving-focus-C87O2raY.js";import"./MessageToolbar-mGmOl_Xf.js";import"./MessageBody-zT-at0bi.js";import"./kbd-D_0s6Sx_.js";import"./useMessageBodyContent-D9UpR1Dh.js";import"./chevron-down-Q4i_URUt.js";import"./index-DqlUjB9k.js";import"./useSignature-CQsNwcJm.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-DRrHzwce.js";import"./suggest-list-xX77W_hF.js";import"./sections-BtFAPYYy.js";import"./badge-DLlDkvBl.js";import"./undo-2-CGWL2haZ.js";import"./DropdownMenu-CGhv-K3k.js";import"./popover-menu-BCEzStJs.js";import"./ErrorState-BB0xpcCi.js";import"./mail-CXavFmSm.js";import"./download-BSz8KKlH.js";import"./avatar-COXPYlBH.js";import"./EmptyState-B_Kthrla.js";import"./calendar-suggestion-CpOWds4W.js";import"./useCalendarSuggestions-DW7WFMvd.js";import"./agenda-time-hKUG2dhl.js";import"./plus-Cp9K9QJ4.js";import"./calendar-format-BwCpz-JZ.js";import"./calendar-Cmzt0eKc.js";import"./calendar-failure-note-BRyIsChq.js";import"./checkbox-CzFLh5Dk.js";import"./clock-jwuPTxhb.js";import"./segmented-control-tpWp-yev.js";import"./shield-check-BbF5QmrH.js";import"./useLayoutTier-CeBSbbkD.js";import"./menu-Dro5vzLW.js";import"./useFilters-DdYKMP_s.js";import"./select-Dv65Mqkl.js";import"./folder-input-C8-nffA0.js";import"./confirm-dialog-D33DXPkQ.js";import"./label-chip-zJi2r8mQ.js";import"./refresh-cw-0FbK4O4v.js";import"./useRefreshControl-CWSpNwGo.js";import"./circle-check-big-CDjntmXC.js";import"./LabelApplyTrigger-ChzWyjHs.js";import"./useLabels-ouqsQR1c.js";import"./NavMenuButton-B_c3nIpV.js";import"./bottom-sheet-BUOc_BG6.js";import"./circle-help-B6Fn573l.js";import"./circle-check-BucqMsie.js";function no(){return o.jsx(i.Reading,{})}export{no as component};
@@ -1 +0,0 @@
1
- import{f0 as t,j as m}from"./index-9JWzpiiR.js";import{C as p}from"./CalendarEventPopup-V9BZRnwN.js";import"./useCalendarSuggestions-DW7WFMvd.js";import"./ErrorState-BB0xpcCi.js";import"./useQueries-Des6lpmI.js";import"./useCalendarData-D07VZ1QE.js";import"./useCalendarTasks-CV-ORktM.js";import"./calendar-format-BwCpz-JZ.js";import"./nav-link-8l24_oWF.js";import"./useMediaQuery-BzGo-bVp.js";import"./calendar-Cmzt0eKc.js";import"./reply-BUVhW3yq.js";import"./CalendarSession-Ub9ZzsQN.js";import"./calendar-event-popup-BvI6Qwla.js";import"./pencil-Dz-yZ9zw.js";import"./calendar-guests-7MqnVXzX.js";import"./circle-help-B6Fn573l.js";import"./confirm-dialog-D33DXPkQ.js";function b(){const{calendarObjectId:r,recurrenceId:o}=t.useParams();return m.jsx(p,{calendarObjectId:r,recurrenceId:o})}export{b as component};
@@ -1 +0,0 @@
1
- import{j as r}from"./index-9JWzpiiR.js";import{B as o}from"./BriefPane-uF6csCem.js";import"./MessageToolbar-mGmOl_Xf.js";import"./MessageBody-zT-at0bi.js";import"./kbd-D_0s6Sx_.js";import"./search-scope-aZ2AZX-k.js";import"./app-chrome-BI9iJnw3.js";import"./nav-link-8l24_oWF.js";import"./useMediaQuery-BzGo-bVp.js";import"./reply-BUVhW3yq.js";import"./useMessageBodyContent-D9UpR1Dh.js";import"./roving-focus-C87O2raY.js";import"./chevron-down-Q4i_URUt.js";import"./search-token-index--Pzg9wI2.js";import"./useQueries-Des6lpmI.js";import"./index-DqlUjB9k.js";import"./useSignature-CQsNwcJm.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-DRrHzwce.js";import"./suggest-list-xX77W_hF.js";import"./sections-BtFAPYYy.js";import"./badge-DLlDkvBl.js";import"./undo-2-CGWL2haZ.js";import"./DropdownMenu-CGhv-K3k.js";import"./popover-menu-BCEzStJs.js";import"./ErrorState-BB0xpcCi.js";import"./mail-CXavFmSm.js";import"./download-BSz8KKlH.js";import"./avatar-COXPYlBH.js";import"./EmptyState-B_Kthrla.js";import"./calendar-suggestion-CpOWds4W.js";import"./useCalendarSuggestions-DW7WFMvd.js";import"./agenda-time-hKUG2dhl.js";import"./plus-Cp9K9QJ4.js";import"./calendar-format-BwCpz-JZ.js";import"./calendar-Cmzt0eKc.js";import"./calendar-failure-note-BRyIsChq.js";import"./checkbox-CzFLh5Dk.js";import"./clock-jwuPTxhb.js";import"./segmented-control-tpWp-yev.js";import"./shield-check-BbF5QmrH.js";import"./useLayoutTier-CeBSbbkD.js";import"./menu-Dro5vzLW.js";import"./useFilters-DdYKMP_s.js";import"./select-Dv65Mqkl.js";import"./folder-input-C8-nffA0.js";import"./confirm-dialog-D33DXPkQ.js";import"./label-chip-zJi2r8mQ.js";import"./LabelApplyTrigger-ChzWyjHs.js";import"./useLabels-ouqsQR1c.js";import"./useRefreshControl-CWSpNwGo.js";import"./circle-check-big-CDjntmXC.js";import"./refresh-cw-0FbK4O4v.js";import"./wizard-selection-zWa1qc6-.js";function tr(){return r.jsx(o.Reading,{})}export{tr as component};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-9JWzpiiR.js";import{F as r}from"./FlaggedPane-CyyX0x8y.js";import"./MessageToolbar-mGmOl_Xf.js";import"./MessageBody-zT-at0bi.js";import"./kbd-D_0s6Sx_.js";import"./search-scope-aZ2AZX-k.js";import"./app-chrome-BI9iJnw3.js";import"./nav-link-8l24_oWF.js";import"./useMediaQuery-BzGo-bVp.js";import"./reply-BUVhW3yq.js";import"./useMessageBodyContent-D9UpR1Dh.js";import"./roving-focus-C87O2raY.js";import"./chevron-down-Q4i_URUt.js";import"./search-token-index--Pzg9wI2.js";import"./useQueries-Des6lpmI.js";import"./index-DqlUjB9k.js";import"./useSignature-CQsNwcJm.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-DRrHzwce.js";import"./suggest-list-xX77W_hF.js";import"./sections-BtFAPYYy.js";import"./badge-DLlDkvBl.js";import"./undo-2-CGWL2haZ.js";import"./DropdownMenu-CGhv-K3k.js";import"./popover-menu-BCEzStJs.js";import"./ErrorState-BB0xpcCi.js";import"./mail-CXavFmSm.js";import"./download-BSz8KKlH.js";import"./avatar-COXPYlBH.js";import"./EmptyState-B_Kthrla.js";import"./calendar-suggestion-CpOWds4W.js";import"./useCalendarSuggestions-DW7WFMvd.js";import"./agenda-time-hKUG2dhl.js";import"./plus-Cp9K9QJ4.js";import"./calendar-format-BwCpz-JZ.js";import"./calendar-Cmzt0eKc.js";import"./calendar-failure-note-BRyIsChq.js";import"./checkbox-CzFLh5Dk.js";import"./clock-jwuPTxhb.js";import"./segmented-control-tpWp-yev.js";import"./shield-check-BbF5QmrH.js";import"./useLayoutTier-CeBSbbkD.js";import"./menu-Dro5vzLW.js";import"./useFilters-DdYKMP_s.js";import"./select-Dv65Mqkl.js";import"./folder-input-C8-nffA0.js";import"./confirm-dialog-D33DXPkQ.js";import"./label-chip-zJi2r8mQ.js";import"./MailViewChrome-U9YpZx_B.js";import"./refresh-cw-0FbK4O4v.js";import"./wizard-selection-zWa1qc6-.js";function $(){return o.jsx(r.Reading,{})}export{$ as component};
@@ -1 +0,0 @@
1
- import{j as r}from"./index-9JWzpiiR.js";import{B as o}from"./BriefPane-uF6csCem.js";import"./MessageToolbar-mGmOl_Xf.js";import"./MessageBody-zT-at0bi.js";import"./kbd-D_0s6Sx_.js";import"./search-scope-aZ2AZX-k.js";import"./app-chrome-BI9iJnw3.js";import"./nav-link-8l24_oWF.js";import"./useMediaQuery-BzGo-bVp.js";import"./reply-BUVhW3yq.js";import"./useMessageBodyContent-D9UpR1Dh.js";import"./roving-focus-C87O2raY.js";import"./chevron-down-Q4i_URUt.js";import"./search-token-index--Pzg9wI2.js";import"./useQueries-Des6lpmI.js";import"./index-DqlUjB9k.js";import"./useSignature-CQsNwcJm.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-DRrHzwce.js";import"./suggest-list-xX77W_hF.js";import"./sections-BtFAPYYy.js";import"./badge-DLlDkvBl.js";import"./undo-2-CGWL2haZ.js";import"./DropdownMenu-CGhv-K3k.js";import"./popover-menu-BCEzStJs.js";import"./ErrorState-BB0xpcCi.js";import"./mail-CXavFmSm.js";import"./download-BSz8KKlH.js";import"./avatar-COXPYlBH.js";import"./EmptyState-B_Kthrla.js";import"./calendar-suggestion-CpOWds4W.js";import"./useCalendarSuggestions-DW7WFMvd.js";import"./agenda-time-hKUG2dhl.js";import"./plus-Cp9K9QJ4.js";import"./calendar-format-BwCpz-JZ.js";import"./calendar-Cmzt0eKc.js";import"./calendar-failure-note-BRyIsChq.js";import"./checkbox-CzFLh5Dk.js";import"./clock-jwuPTxhb.js";import"./segmented-control-tpWp-yev.js";import"./shield-check-BbF5QmrH.js";import"./useLayoutTier-CeBSbbkD.js";import"./menu-Dro5vzLW.js";import"./useFilters-DdYKMP_s.js";import"./select-Dv65Mqkl.js";import"./folder-input-C8-nffA0.js";import"./confirm-dialog-D33DXPkQ.js";import"./label-chip-zJi2r8mQ.js";import"./LabelApplyTrigger-ChzWyjHs.js";import"./useLabels-ouqsQR1c.js";import"./useRefreshControl-CWSpNwGo.js";import"./circle-check-big-CDjntmXC.js";import"./refresh-cw-0FbK4O4v.js";import"./wizard-selection-zWa1qc6-.js";function ir(){return r.jsx(o.Reading,{})}export{ir as component};
@@ -1 +0,0 @@
1
- import{eZ as o,j as r}from"./index-9JWzpiiR.js";import{C as m}from"./CalendarEventPopup-V9BZRnwN.js";import"./useCalendarSuggestions-DW7WFMvd.js";import"./ErrorState-BB0xpcCi.js";import"./useQueries-Des6lpmI.js";import"./useCalendarData-D07VZ1QE.js";import"./useCalendarTasks-CV-ORktM.js";import"./calendar-format-BwCpz-JZ.js";import"./nav-link-8l24_oWF.js";import"./useMediaQuery-BzGo-bVp.js";import"./calendar-Cmzt0eKc.js";import"./reply-BUVhW3yq.js";import"./CalendarSession-Ub9ZzsQN.js";import"./calendar-event-popup-BvI6Qwla.js";import"./pencil-Dz-yZ9zw.js";import"./calendar-guests-7MqnVXzX.js";import"./circle-help-B6Fn573l.js";import"./confirm-dialog-D33DXPkQ.js";function b(){const{calendarObjectId:t}=o.useParams();return r.jsx(m,{calendarObjectId:t})}export{b as component};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-9JWzpiiR.js";import{O as t}from"./OutboxPane-D47KP_dW.js";import"./MessageBody-zT-at0bi.js";import"./kbd-D_0s6Sx_.js";import"./search-scope-aZ2AZX-k.js";import"./app-chrome-BI9iJnw3.js";import"./nav-link-8l24_oWF.js";import"./useMediaQuery-BzGo-bVp.js";import"./reply-BUVhW3yq.js";import"./useMessageBodyContent-D9UpR1Dh.js";import"./outbox-status-BlKn6P0x.js";import"./NavMenuButton-B_c3nIpV.js";import"./menu-Dro5vzLW.js";import"./roving-focus-C87O2raY.js";import"./circle-check-big-CDjntmXC.js";import"./clock-jwuPTxhb.js";import"./row-actions-cUhOCilI.js";import"./rotate-ccw-DCzt84SY.js";function P(){return o.jsx(t.Reading,{})}export{P as component};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-9JWzpiiR.js";import{F as r}from"./FlaggedPane-CyyX0x8y.js";import"./MessageToolbar-mGmOl_Xf.js";import"./MessageBody-zT-at0bi.js";import"./kbd-D_0s6Sx_.js";import"./search-scope-aZ2AZX-k.js";import"./app-chrome-BI9iJnw3.js";import"./nav-link-8l24_oWF.js";import"./useMediaQuery-BzGo-bVp.js";import"./reply-BUVhW3yq.js";import"./useMessageBodyContent-D9UpR1Dh.js";import"./roving-focus-C87O2raY.js";import"./chevron-down-Q4i_URUt.js";import"./search-token-index--Pzg9wI2.js";import"./useQueries-Des6lpmI.js";import"./index-DqlUjB9k.js";import"./useSignature-CQsNwcJm.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-DRrHzwce.js";import"./suggest-list-xX77W_hF.js";import"./sections-BtFAPYYy.js";import"./badge-DLlDkvBl.js";import"./undo-2-CGWL2haZ.js";import"./DropdownMenu-CGhv-K3k.js";import"./popover-menu-BCEzStJs.js";import"./ErrorState-BB0xpcCi.js";import"./mail-CXavFmSm.js";import"./download-BSz8KKlH.js";import"./avatar-COXPYlBH.js";import"./EmptyState-B_Kthrla.js";import"./calendar-suggestion-CpOWds4W.js";import"./useCalendarSuggestions-DW7WFMvd.js";import"./agenda-time-hKUG2dhl.js";import"./plus-Cp9K9QJ4.js";import"./calendar-format-BwCpz-JZ.js";import"./calendar-Cmzt0eKc.js";import"./calendar-failure-note-BRyIsChq.js";import"./checkbox-CzFLh5Dk.js";import"./clock-jwuPTxhb.js";import"./segmented-control-tpWp-yev.js";import"./shield-check-BbF5QmrH.js";import"./useLayoutTier-CeBSbbkD.js";import"./menu-Dro5vzLW.js";import"./useFilters-DdYKMP_s.js";import"./select-Dv65Mqkl.js";import"./folder-input-C8-nffA0.js";import"./confirm-dialog-D33DXPkQ.js";import"./label-chip-zJi2r8mQ.js";import"./MailViewChrome-U9YpZx_B.js";import"./refresh-cw-0FbK4O4v.js";import"./wizard-selection-zWa1qc6-.js";function $(){return o.jsx(r.Reading,{})}export{$ as component};
@@ -1 +0,0 @@
1
- import{r as f,j as e,ao as h,B as b,T as y,u as N,ac as C,a as L,c as I,d as S}from"./index-9JWzpiiR.js";import{L as D,l as g}from"./label-chip-zJi2r8mQ.js";import{S as v}from"./select-Dv65Mqkl.js";import{a as w,b as $,c as E,u as k}from"./useLabels-ouqsQR1c.js";import{a as R}from"./sections-BtFAPYYy.js";import{S as O}from"./settings-screen-DPboZsK5.js";import{E as j}from"./ErrorState-BB0xpcCi.js";import{C as B}from"./confirm-dialog-D33DXPkQ.js";import"./chevron-down-Q4i_URUt.js";import"./avatar-COXPYlBH.js";import"./badge-DLlDkvBl.js";import"./chevron-left-gBxhdHb5.js";import"./menu-Dro5vzLW.js";import"./circle-help-B6Fn573l.js";function P({labels:n,onRename:i,onRecolor:l,onDelete:u,deletingLabelId:c}){const[d,r]=f.useState(),[o,m]=f.useState("");if(n.length===0)return e.jsx("p",{className:"py-6 text-sm text-fg-muted",children:"No labels yet. Create one below, then use it in a filter or apply it to mail directly."});const a=t=>{const s=o.trim();s!==""&&i(t,s),r(void 0)};return e.jsx("ul",{className:"divide-y divide-line rounded-md border border-line",children:n.map(t=>e.jsxs("li",{className:"flex items-center gap-3 px-3 py-2.5",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[d===t.labelId?e.jsx(h,{autoFocus:!0,value:o,onChange:s=>m(s.target.value),onBlur:()=>a(t.labelId),onKeyDown:s=>{s.key==="Enter"&&(s.preventDefault(),a(t.labelId)),s.key==="Escape"&&(s.preventDefault(),r(void 0))},"aria-label":`Rename label ${t.name}`}):e.jsx("button",{type:"button",onClick:()=>{r(t.labelId),m(t.name)},"aria-label":`Rename label ${t.name}`,className:"flex items-center gap-2 rounded-sm text-left hover:opacity-80",children:e.jsx(D,{label:t})}),e.jsx("p",{className:"mt-0.5 text-xs text-fg-subtle",children:t.filterCount===0?"Not used in any filter":`Used in ${t.filterCount} ${t.filterCount===1?"filter":"filters"}`})]}),e.jsx(v,{"aria-label":`Color for ${t.name}`,value:t.color,onChange:s=>l(t.labelId,s.target.value),className:"w-28 shrink-0",children:g.map(s=>e.jsx("option",{value:s,children:s},s))}),e.jsx(b,{variant:"ghost",size:"sm",icon:e.jsx(y,{className:"size-4 text-danger"}),onClick:()=>u(t),disabled:c===t.labelId,"aria-label":`Delete label ${t.name}`})]},t.labelId))})}const T=(n,i)=>{if(i===0)return{title:`Delete the "${n}" label?`};const l=i===1?"filter":"filters";return{title:`Delete the "${n}" label?`,description:`This also deletes ${i} ${l} that ${i===1?"applies":"apply"} it — they can't be recovered.`}},H=e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Labels mark mail without moving it — a message can carry any number of them alongside whichever folder it lives in."}),e.jsx("p",{children:"Use a label in a filter's action to have new (and existing) mail label itself automatically, or apply one to a selection directly from the mailbox."}),e.jsx("p",{children:"Deleting a label removes it from every message, and deletes every filter that applies it — the confirmation names how many."})]});function U({accountId:n}){const{createLabel:i,isPending:l,isError:u}=k(n),[c,d]=f.useState(""),[r,o]=f.useState("Default"),m=()=>{const a=c.trim();a!==""&&i(a,r).then(()=>{d(""),o("Default")})};return e.jsxs("div",{className:"space-y-2 rounded-sm border border-line bg-surface p-3",children:[e.jsx("p",{className:"text-sm font-medium text-fg",children:"New label"}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-end",children:[e.jsxs("div",{className:"flex-1 space-y-1",children:[e.jsx("span",{className:"text-xs text-fg-muted",children:"Name"}),e.jsx(h,{value:c,onChange:a=>d(a.target.value),placeholder:"e.g. Receipts","aria-label":"Label name",onKeyDown:a=>{a.key==="Enter"&&(a.preventDefault(),m())}})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("span",{className:"text-xs text-fg-muted",children:"Color"}),e.jsx(v,{value:r,onChange:a=>o(a.target.value),"aria-label":"Label color",className:"w-28",children:g.map(a=>e.jsx("option",{value:a,children:a},a))})]}),e.jsx(b,{variant:"primary",onClick:m,disabled:l||c.trim()==="",children:l?"Creating…":"Create label"})]}),u&&e.jsx(S,{tone:"danger",variant:"soft",children:"Couldn't create that label. Please try again."})]})}function z({account:n}){const i=n.accountId,{labels:l,isPending:u,isError:c,error:d,refetch:r}=w(i),{updateLabel:o}=$(i),{deleteLabel:m,deletingLabelId:a}=E(i),[t,s]=f.useState();return e.jsxs("section",{className:"space-y-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-fg",children:n.email}),u?e.jsx("div",{className:"h-16 animate-pulse rounded-md border border-line bg-surface","aria-busy":"true","aria-label":`Loading labels for ${n.email}`}):c?e.jsx(j,{variant:"inline",title:`Couldn't load labels for ${n.email}`,error:d,onRetry:()=>{r()}}):e.jsx(P,{labels:l,onRename:(p,x)=>o(p,{name:x}),onRecolor:(p,x)=>o(p,{color:x}),onDelete:s,deletingLabelId:a}),e.jsx(U,{accountId:i}),t&&(()=>{const p=T(t.name,t.filterCount);return e.jsx(B,{isOpen:!0,title:p.title,description:p.description,confirmLabel:"Delete label",destructive:!0,isBusy:a===t.labelId,onConfirm:()=>{m(t.labelId),s(void 0)},onCancel:()=>s(void 0)})})()]})}function ee(){const n=N(),i=C(),l=R(),[u,c]=f.useState(!0),{data:d,isPending:r,isError:o,error:m,refetch:a}=L(I());return e.jsx(O,{items:i,activeId:"labels",title:"Labels",description:"Mark mail without moving it, per account.",help:H,helpOpen:u,onToggleHelp:()=>c(t=>!t),onSelect:l,onBackToMail:()=>{n({to:"/mail"})},children:r?e.jsx("div",{className:"h-24 animate-pulse rounded-sm border border-line bg-surface","aria-busy":"true","aria-label":"Loading accounts"}):o?e.jsx(j,{title:"Couldn't load accounts",error:m,onRetry:()=>{a()}}):d.accounts.length===0?e.jsx("p",{className:"py-12 text-sm text-fg-muted",children:"No accounts configured."}):e.jsx("div",{className:"space-y-8",children:d.accounts.map(t=>e.jsx(z,{account:t},t.accountId))})})}export{ee as component};
@@ -1 +0,0 @@
1
- import{b as Me,j as e,r as p,n as Ee,o as Pe,D as Le,X as Te,p as I,S as Fe,C as Ae,q as oe,t as Q,v as re,w as ie,F as ze,T as De,x as _e,M as Be,y as Ke,z as Qe,I as qe,B as E,E as le,G as He,H as $e,J as ce,e as B,K as ue,N as de,P as Ve,Q as Ue,R as We,U as me,a as xe,V as Ge,W as Ye,Y as z,Z as Je,_ as Xe,$ as Ze,a0 as es,a1 as ss,a2 as ts,a3 as as,a4 as ns,a5 as os,u as rs,c as is,a6 as ls,O as cs}from"./index-9JWzpiiR.js";import{l as O,u as D,m as q,a as us,b as ds,c as ms}from"./reply-BUVhW3yq.js";import{A as xs,S as fe,a as fs,c as ps,L as hs,b as gs,D as bs,d as vs}from"./DesktopChrome-H9yEQYFf.js";import{u as ys,N as C,a as js,b as Ns,i as Ss}from"./nav-link-8l24_oWF.js";import{u as K,a as Cs}from"./useMessageBodyContent-D9UpR1Dh.js";import{P as Is}from"./pencil-Dz-yZ9zw.js";import{c as ws,s as Os,M as ks}from"./MailShell-DY2Ot0ah.js";import{u as Rs,a as Ms,R as Es,s as Ps,i as Ls,H as Ts,M as Fs}from"./useRefreshControl-CWSpNwGo.js";import{K as As,B as zs,S as Ds,u as _s,s as Bs,b as Ks,a as Qs,c as qs,d as Hs}from"./search-token-index--Pzg9wI2.js";import{u as $s}from"./sections-BtFAPYYy.js";import{u as pe}from"./search-scope-aZ2AZX-k.js";import{M as Vs}from"./menu-Dro5vzLW.js";import{B as he,u as Us}from"./useResultFolderIndex-DRfqL3r_.js";import{u as ge}from"./useQueries-Des6lpmI.js";import{f as Ws}from"./folder-failure-CqkVSsrb.js";import{i as Gs}from"./outbox-status-BlKn6P0x.js";import{u as Ys}from"./roving-focus-C87O2raY.js";import{C as Js,A as Xs}from"./account-service-status-HIGoykok.js";import{C as H}from"./chevron-down-Q4i_URUt.js";import{u as Zs}from"./index-DqlUjB9k.js";import{u as be,i as et}from"./useLayoutTier-CeBSbbkD.js";import{u as st}from"./useDebouncedValue-DRrHzwce.js";import{E as tt}from"./ErrorState-BB0xpcCi.js";import{K as $}from"./kbd-D_0s6Sx_.js";import"./avatar-COXPYlBH.js";import"./popover-menu-BCEzStJs.js";import"./mail-CXavFmSm.js";import"./app-chrome-BI9iJnw3.js";import"./useMediaQuery-BzGo-bVp.js";import"./FullCompose-sAZlqUaR.js";import"./confirm-dialog-D33DXPkQ.js";import"./circle-check-big-CDjntmXC.js";import"./refresh-cw-0FbK4O4v.js";import"./useSignature-CQsNwcJm.js";import"./account-form-helpers-DhckT_PN.js";import"./suggest-list-xX77W_hF.js";const at=Me("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);function nt({onCompose:s}){return e.jsx("button",{type:"button",onClick:s,"aria-label":"Compose new message",className:"lg:hidden fixed right-4 z-30 h-14 w-14 rounded-full bg-accent text-accent-fg shadow-lg flex items-center justify-center hover:opacity-90 active:scale-95 transition-all",style:{bottom:"calc(var(--app-tab-bar, 0px) + env(safe-area-inset-bottom, 0px) + 1rem)"},children:e.jsx(Is,{className:"size-6"})})}const ot=({isOpen:s,onClose:t})=>{const a=p.useRef(null);return Ee({id:"shortcuts",open:s,answers:{back:t}}),Pe(a,s),s?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[e.jsx(Le,{label:"Dismiss keyboard shortcuts",onDismiss:t,className:"backdrop-blur-sm"}),e.jsxs("div",{ref:a,role:"dialog","aria-modal":"true","aria-label":"Keyboard shortcuts",tabIndex:-1,className:I("relative z-10 max-h-[85vh] w-full max-w-2xl overflow-y-auto","rounded-lg border border-line bg-surface shadow-lg","p-6"),children:[e.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Keyboard shortcuts"}),e.jsx("button",{type:"button",onClick:t,className:"p-1 text-fg-muted transition-colors hover:text-fg","aria-label":"Close",children:e.jsx(Te,{className:"size-5"})})]}),e.jsx("div",{className:"grid gap-x-8 gap-y-6 sm:grid-cols-2",children:As.map(n=>e.jsxs("div",{children:[e.jsx("h3",{className:"mb-3 text-sm font-medium text-fg-muted",children:n.title}),e.jsx("div",{className:"space-y-2",children:n.hints.map(o=>e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("span",{className:"text-sm",children:o.description}),e.jsx("span",{className:"flex shrink-0 items-center gap-1",children:o.keys.map((r,c)=>e.jsxs(p.Fragment,{children:[c>0&&o.keys[0]==="g"&&e.jsx("span",{className:"text-2xs text-fg-subtle",children:"then"}),e.jsx($,{children:r})]},r))})]},`${o.action}-${o.keys.join("+")}`))})]},n.title))}),e.jsx("div",{className:"mt-6 border-t border-line pt-4",children:e.jsxs("p",{className:"text-center text-xs text-fg-muted",children:["Press ",e.jsx($,{children:"Esc"})," to close"]})})]})]}):null},rt="button:not([disabled]), a[href]",P="outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-surface-sunken";function it({active:s,dimmed:t,indent:a}){return I("flex w-full items-center gap-2 rounded-md px-2 py-1 text-left text-sm transition-colors",P,a&&"pl-7",s?"bg-accent-2-soft font-medium text-accent-2":"text-fg-muted hover:bg-surface hover:text-fg",t&&"opacity-55")}function lt({icon:s,label:t,count:a,active:n,failure:o}){return e.jsxs(e.Fragment,{children:[s&&e.jsx("span",{className:I("shrink-0",n?"text-accent-2":"text-fg-subtle"),children:s}),e.jsx("span",{className:"flex-1 truncate",children:t}),o&&e.jsx(re,{className:"size-3.5 shrink-0 text-danger","aria-hidden":"true"}),a!=null&&a>0&&e.jsx("span",{className:I("text-2xs tabular-nums",n?"text-accent-2":"text-fg-subtle"),children:a})]})}function w({icon:s,label:t,count:a,active:n,dimmed:o,indent:r,navId:c,linkComponent:u,ariaLabel:x,title:d,failure:h,onClick:y}){const g=it({active:n,dimmed:o,indent:r}),l=e.jsx(lt,{icon:s,label:t,count:a,active:n,failure:h}),v=x??t,m=h?`${v} — ${h}`:v,f=h?`${d??t} — ${h}`:d;return c&&u?u({navId:c,className:g,ariaLabel:m,title:f,onClick:y,children:l}):e.jsx("button",{type:"button",onClick:y,className:g,"aria-label":h?m:x,title:f,children:l})}const V={inbox:0,flagged:1,drafts:2,sent:3,archive:4,all:5,junk:6,trash:7};function ct(s){switch(s){case"inbox":return e.jsx(qe,{className:"size-4"});case"flagged":return e.jsx(oe,{className:"size-4"});case"drafts":return e.jsx(Qe,{className:"size-4"});case"sent":return e.jsx(ie,{className:"size-4"});case"archive":return e.jsx(Ke,{className:"size-4"});case"all":return e.jsx(Be,{className:"size-4"});case"junk":return e.jsx(_e,{className:"size-4"});case"trash":return e.jsx(De,{className:"size-4"})}}const U=s=>s.role!=null,A=8,W="remit.nav.folders.open.",G="remit.nav.account.open.";function Y(s,t,a){if(typeof localStorage>"u")return a;const n=localStorage.getItem(s+t);return n===null?a:n!=="0"}function J(s,t,a){typeof localStorage>"u"||localStorage.setItem(s+t,a?"1":"0")}function ut({account:s,selectedNavId:t,onSelectNav:a,linkComponent:n}){const[o,r]=p.useState(()=>Y(G,s.id,!0)),[c,u]=p.useState(()=>Y(W,s.id,!0)),[x,d]=p.useState(!1),h=()=>{r(i=>{const j=!i;return J(G,s.id,j),j})},y=()=>{u(i=>{const j=!i;return J(W,s.id,j),j})},g=s.mailboxes.filter(U).sort((i,j)=>V[i.role]-V[j.role]),l=s.mailboxes.filter(i=>!U(i)),v=x||l.length<=A?l:l.slice(0,A),m=l.length-v.length,f=s.status??"ready",b=s.syncedServices!==void 0&&!s.syncedServices.includes("Mail"),N=f==="ready"&&g.length===0&&l.length===0;return e.jsxs("div",{className:"mt-3",children:[e.jsxs("button",{type:"button",onClick:h,"aria-expanded":o,className:I("flex w-full items-center gap-1.5 px-2 pb-1 text-left transition-colors hover:text-fg",P,s.muted&&"opacity-55"),children:[o?e.jsx(H,{className:"size-3 shrink-0 text-fg-subtle"}):e.jsx(Q,{className:"size-3 shrink-0 text-fg-subtle"}),e.jsx("span",{className:"truncate text-2xs font-semibold uppercase tracking-wider text-fg-subtle",children:s.label}),s.muted&&e.jsxs(e.Fragment,{children:[e.jsx(zs,{className:"size-3 shrink-0 text-fg-subtle"}),e.jsx("span",{className:"text-2xs text-fg-subtle",children:"muted"})]}),b&&e.jsxs(e.Fragment,{children:[e.jsx(Js,{className:"size-3 shrink-0 text-fg-subtle"}),e.jsx("span",{className:"text-2xs text-fg-subtle",children:Xs.Mail})]})]}),o&&e.jsxs(e.Fragment,{children:[f==="loading"&&e.jsx("div",{className:"px-2 py-1 text-sm text-fg-muted",children:"Loading…"}),f==="error"&&e.jsxs("div",{role:"alert",className:"mx-2 my-1 flex items-start gap-2 rounded-md border border-danger/40 bg-danger-soft px-2 py-1.5 text-sm",children:[e.jsx(re,{className:"mt-0.5 size-4 shrink-0 text-danger","aria-hidden":"true"}),e.jsx("div",{className:"min-w-0 flex-1",children:e.jsx("p",{className:"font-medium text-danger",children:"Couldn't load mailboxes"})}),s.onRetry&&e.jsx("button",{type:"button",onClick:s.onRetry,className:"shrink-0 text-sm font-medium text-accent hover:underline",children:"Retry"})]}),N&&e.jsx("div",{className:"px-2 py-1 text-sm text-fg-muted",children:"No mailboxes"}),f==="ready"&&e.jsxs(e.Fragment,{children:[g.map(i=>e.jsx(w,{navId:i.id,linkComponent:n,icon:ct(i.role),label:i.name,ariaLabel:i.name,title:i.fullPath??i.name,failure:i.failure,count:i.unseen,active:t===i.id,dimmed:s.muted,onClick:()=>a?.(i.id)},i.id)),s.outboxPending!==void 0&&e.jsx(w,{navId:"outbox",linkComponent:n,icon:e.jsx(ie,{className:"size-4"}),label:"Outbox",ariaLabel:"Outbox",count:s.outboxPending>0?s.outboxPending:void 0,active:t==="outbox",dimmed:s.muted,onClick:()=>a?.("outbox")}),l.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",onClick:y,"aria-expanded":c,className:I("mt-1 flex w-full items-center gap-1 px-2 py-1 text-left text-2xs font-semibold uppercase tracking-wider text-fg-subtle transition-colors hover:text-fg",P),children:[c?e.jsx(H,{className:"size-3 shrink-0"}):e.jsx(Q,{className:"size-3 shrink-0"}),e.jsx("span",{className:"flex-1",children:"Folders"}),e.jsx("span",{className:"tabular-nums opacity-70",children:l.length})]}),c&&e.jsxs(e.Fragment,{children:[v.map(i=>e.jsx(w,{navId:i.id,linkComponent:n,icon:e.jsx(ze,{className:"size-4"}),label:i.name,ariaLabel:i.name,title:i.fullPath??i.name,failure:i.failure,count:i.unseen,active:t===i.id,dimmed:s.muted,onClick:()=>a?.(i.id)},i.id)),(m>0||x)&&l.length>A&&e.jsx("button",{type:"button",onClick:()=>d(i=>!i),className:I("ml-7 flex items-center px-2 py-1 text-2xs font-medium text-accent transition-colors hover:underline",P),children:x?"Show less":`Show all (${l.length})`})]})]})]})]})]})}function dt({accounts:s,selectedNavId:t,briefUnseen:a,onSelectNav:n,variant:o="desktop",linkComponent:r,calendarNav:c="hidden"}){const u=p.useRef(null);Ys({containerRef:u,itemSelector:rt});const x=o==="drawer",d=e.jsxs("nav",{ref:x?u:void 0,className:x?"px-2 py-2":"flex-1 overflow-y-auto px-2 py-2","aria-label":"Mailboxes",children:[e.jsx(w,{navId:"brief",linkComponent:r,icon:e.jsx(Fe,{className:"size-4"}),label:"Daily brief",ariaLabel:"Daily brief",count:a,active:t==="brief",onClick:()=>n?.("brief")}),c==="shown"&&e.jsx(w,{navId:"calendar",linkComponent:r,icon:e.jsx(Ae,{className:"size-4"}),label:"Calendar",ariaLabel:"Calendar",active:t==="calendar",onClick:()=>n?.("calendar")}),e.jsx(w,{navId:"flagged",linkComponent:r,icon:e.jsx(oe,{className:"size-4"}),label:"Starred",ariaLabel:"Starred",active:t==="flagged",onClick:()=>n?.("flagged")}),s.length===0?e.jsx("div",{className:"px-2 py-4 text-center text-sm text-fg-muted",children:"No accounts configured"}):s.map(h=>e.jsx(ut,{account:h,selectedNavId:t,onSelectNav:n,linkComponent:r},h.id))]});return x?d:e.jsx("aside",{ref:u,className:"flex h-full w-full flex-col bg-surface-sunken",children:d})}function mt(){const s=pe();if(!s)return null;const t=s.showNavPane?!s.navCollapsed:!1;return e.jsx(E,{variant:"ghost",size:"sm",icon:e.jsx(Vs,{className:"size-4"}),onClick:s.toggleNav,"aria-label":t?"Hide folders":"Show folders","aria-expanded":t,title:"Folders",className:"shrink-0"})}const xt={global:"Search all mail",pending:"Search mail",scoped:"Search this folder"};function ft({search:s,onCompose:t,onReportBug:a,onOpenSettings:n,settingsAttention:o,composeShortcut:r,refreshControl:c,account:u}){return e.jsx(xs,{leading:e.jsx(mt,{}),search:e.jsx(Ds,{value:s.value,onChange:s.onChange,onClear:s.onClear,onClearQuery:s.onClearQuery,chips:s.chips,onRemoveChip:s.onRemoveChip,placeholder:xt[s.scope]}),actions:e.jsxs(e.Fragment,{children:[e.jsx(E,{variant:"ghost",size:"sm",icon:e.jsx(at,{className:"size-4"}),title:r?`Compose (${r})`:"Compose","aria-label":"Compose",onClick:t}),e.jsx(E,{variant:"ghost",size:"sm",icon:e.jsx(he,{className:"size-4"}),title:"Report a bug","aria-label":"Report a bug",onClick:a}),e.jsx(E,{variant:"ghost",size:"sm",icon:e.jsx(le,{label:o,children:e.jsx(fe,{className:"size-4"})}),title:"Settings","aria-label":o?`Settings — ${o}`:"Settings",onClick:n}),c,u]})})}function pt(){const{pathname:s}=ys(),t=He({from:"/mail/$mailboxId",shouldThrow:!1});return O(s,"/settings")?"settings":O(s,"/calendar")?"calendar":O(s,"/mail/outbox")?"outbox":O(s,"/mail/flagged")?"flagged":O(s,"/mail/brief")?"brief":t?.mailboxId??""}function ht(){const s=$e(),t=D({select:d=>q(d.location.pathname)}),a=D({select:d=>us(d.location.search)}),[n,o]=p.useState(a),r=st(n,200),[c,u]=p.useState(t);if(c!==t){const d=Os(c,t,a);u(t),d!==void 0&&o(d)}const x=p.useCallback(d=>{u(q(s.state.location.pathname)),o(d)},[s]);return{searchInput:n,committedQuery:ws(n,r),viewKey:t,setSearchInput:x}}const gt=()=>{const s=K();return ds()?null:e.jsx(nt,{onCompose:s})};function X({accounts:s}){const{searchInput:t,onSearchChange:a,onSearchClear:n,onSearchClearQuery:o,resultFolderIndex:r}=ce(),c=B(),u=$s(),x=K(),{scope:d,clearScope:h}=_s(s),y=ue(),g=d.kind==="scoped"?[{id:d.chip.id,label:d.chip.label,tone:"scope"}]:void 0,l=p.useMemo(()=>s.map(N=>N.accountId),[s]),{hasNewMail:v}=Rs(),{state:m,errorMessage:f,refresh:b}=Ms(l,{onSettled:()=>Ve(c,Ue(r.keys()))});return e.jsx(ft,{search:{value:t,scope:d.kind,chips:g,onChange:a,onClear:n,onClearQuery:o,onRemoveChip:h},onCompose:x,onReportBug:de,onOpenSettings:()=>u("accounts"),settingsAttention:y,composeShortcut:Bs("compose"),refreshControl:e.jsx(Es,{state:m,onRefresh:b,label:"Refresh all accounts",errorMessage:f,hasUpdate:v(l)}),account:e.jsx(fs,{})})}function bt(){return e.jsxs("button",{type:"button",onClick:de,className:"flex w-full items-center gap-2 rounded-md px-2 py-1 text-sm text-fg-muted transition-colors hover:bg-surface hover:text-fg",children:[e.jsx(he,{className:"size-4 shrink-0"}),e.jsx("span",{className:"flex-1 truncate text-left",children:"Report a bug"})]})}const Z=s=>/^\d/.test(s),vt=(s,t)=>{const a=Z(s),n=Z(t);return a&&!n?-1:!a&&n?1:s.localeCompare(t,void 0,{sensitivity:"base",numeric:!0})};function yt(s,t,a){const n=[],o=[];for(const r of s)t.has(r.mailboxId)?n.push(r):o.push(r);return o.sort((r,c)=>vt(z(r,void 0,a),z(c,void 0,a))),{system:n,labels:o}}function jt(s,t,a){const n=Je(t)&&s.unseenCount>0;return{id:s.mailboxId,name:z(s,t,a),unseen:n?s.unseenCount:void 0,role:t,fullPath:s.fullPath,failure:Ws(s)}}function ee({accounts:s,onMailboxSelect:t,variant:a="desktop"}){const n=B(),o=pt(),{onSearchChange:r}=ce(),{t:c}=We("mail",{useSuspense:!1}),u=p.useCallback((m,f)=>c(m,{defaultValue:f}),[c]),x=ge({queries:s.map(m=>({...me({path:{accountId:m.accountId}}),staleTime:1/0}))}),{data:d}=xe(Ge()),h=p.useMemo(()=>(d?.items??[]).filter(m=>Gs(m.status)).length,[d?.items]),y=p.useMemo(()=>s.map((m,f)=>{const b=x[f],N=b?.data?.items??[],i=Ye(m.folderAppointments),{system:j,labels:L}=yt(N,i,u),T=b?.isError?"error":b?.isLoading?"loading":"ready";return{id:m.accountId,label:m.email,email:m.email,muted:!!m.muted,outboxPending:h,status:T,onRetry:()=>b?.refetch(),mailboxes:[...j,...L].map(k=>jt(k,i.get(k.mailboxId),u))}}),[s,x,h,u]),g=m=>{n.invalidateQueries({queryKey:Xe({path:{mailboxId:m},query:{order:"desc"}})})},l=({navId:m,className:f,ariaLabel:b,title:N,children:i,onClick:j})=>m==="brief"?e.jsx(C,{to:"/mail/brief",search:{q:void 0},activeOptions:{includeSearch:!1},onClick:()=>j?.(),className:f,"aria-label":b,title:N,children:i}):m==="calendar"?e.jsx(C,{to:"/calendar",onClick:()=>j?.(),className:f,"aria-label":b,title:N,children:i}):m==="outbox"?e.jsx(C,{to:"/mail/outbox",search:{q:void 0},onClick:()=>j?.(),className:f,"aria-label":b,title:N,children:i}):m==="flagged"?e.jsx(C,{to:"/mail/flagged",search:{q:void 0},onClick:()=>j?.(),className:f,"aria-label":b,title:N,children:i}):m==="settings"?e.jsx(C,{to:"/settings/accounts",onClick:()=>j?.(),className:f,"aria-label":b,title:N,children:i}):e.jsx(C,{to:"/mail/$mailboxId",params:{mailboxId:m},search:{q:void 0},onClick:()=>{g(m),j?.()},className:f,"aria-label":b,title:N,children:i}),v=()=>{r(""),t?.()};return e.jsx(dt,{accounts:y,selectedNavId:o,onSelectNav:v,linkComponent:l,variant:a})}function Nt({accounts:s,onMailboxSelect:t}){const n=pe()?.showNavPane??!0,o=ue();return n?e.jsx(ee,{accounts:s}):e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsx(ee,{accounts:s,onMailboxSelect:t,variant:"drawer"})}),e.jsxs("div",{className:"border-t border-line px-2 py-2",children:[e.jsxs(C,{to:"/settings/accounts",onClick:t,children:[e.jsx(le,{label:o,children:e.jsx(fe,{className:"size-4 shrink-0"})}),e.jsx("span",{className:"flex-1 truncate text-left",children:"Settings"})]}),e.jsx(bt,{}),e.jsx(ps,{children:({signOut:r})=>e.jsxs("button",{type:"button",onClick:()=>{t?.(),r()},className:"flex min-h-11 w-full items-center gap-2 rounded-md px-2 py-1 text-sm text-fg-muted transition-colors hover:bg-surface hover:text-fg","data-testid":"sign-out-button",children:[e.jsx(hs,{className:"size-4 shrink-0"}),e.jsx("span",{className:"flex-1 truncate text-left",children:"Sign out"})]})})]})]})}function St(s){const t=ge({queries:s.map(a=>({...me({path:{accountId:a.accountId}}),staleTime:1/0}))});return p.useMemo(()=>Ks(t.map(a=>a.data?.items??[])),[t])}const ve="remit:intelligence-open";function Ct(){try{return localStorage.getItem(ve)!=="closed"}catch{return!0}}function It(s){try{localStorage.setItem(ve,s?"open":"closed")}catch{}}function se({panels:s,prefersOpen:t,isDesktop:a,hasThread:n,raisedFor:o,openMessage:r}){if(o!==null&&o===r)return!0;const c=s.filter(u=>u!=="sidebar");return c.length>0?c.includes("intelligence"):a&&n&&t}const wt=()=>{const s=be(),t=js(),a=Ns(),n=t.find(Ss),o=Qs(),[r,c]=p.useState(Ct),u=o?`${o.threadId}/${o.messageId??""}`:null,[x,d]=p.useState(null),h={panels:t,prefersOpen:r,isDesktop:s==="desktop",hasThread:o!==void 0,openMessage:u},y=se({...h,raisedFor:x}),g=se({...h,raisedFor:null}),l=p.useCallback((b,N)=>{a([...b?["intelligence"]:[],...N?[N]:[]])},[a]),v=p.useCallback(b=>{l(g,b)},[g,l]),m=p.useCallback(()=>{if(y&&!g){d(null);return}const b=!y;It(b),c(b),d(null),l(b,n)},[g,y,n,l]),f=p.useCallback(()=>{d(u)},[u]);return{openOverlay:n,intelligenceOpen:y,showOverlay:v,toggleIntelligence:m,raiseIntelligence:f}};var R={exports:{}},te;function Ot(){if(te)return R.exports;te=1;const s=(t,a,n)=>new Promise((o,r)=>{if(n=Object.assign({concurrency:1/0},n),typeof a!="function")throw new TypeError("Mapper function is required");const{concurrency:c}=n;if(!(typeof c=="number"&&c>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${c}\` (${typeof c})`);const u=[],x=t[Symbol.iterator]();let d=!1,h=!1,y=0,g=0;const l=()=>{if(d)return;const v=x.next(),m=g;if(g++,v.done){h=!0,y===0&&o(u);return}y++,Promise.resolve(v.value).then(f=>a(f,m)).then(f=>{u[m]=f,y--,l()},f=>{d=!0,r(f)})};for(let v=0;v<c&&(l(),!h);v++);});return R.exports=s,R.exports.default=s,R.exports}var kt=Ot();const Rt=Ze(kt),Mt=900*1e3,Et=30,Pt=(s,t)=>{if(!s)return t;const a=Number.parseInt(s,10);return Number.isFinite(a)&&a>0?a:t},Lt=30*1e3,Tt=s=>Math.max(Pt(s,Et)*1e3,Lt),ye=Tt(os().mailboxPollIntervalSeconds),M=(s=Date.now(),t=ye)=>Ls(s)?Math.min(Ts,t):t,Ft=5,_=new Set,At=(s,t,a=Mt)=>s.filter(n=>{const o=n.lastSyncAt;return o==null?!0:t-o>a}).map(n=>n.accountId),zt=(s,t,a=ye)=>s-t>=a,Dt=(s,t)=>s.filter(a=>!t.has(a)),ae=(s,t)=>{if(_.delete(s),ts(t)||as(t,{softError:!0})){ns(t,{softError:!0});return}console.warn("[remit] background mailbox sync failed",{accountId:s,error:t})},ne=(s,t)=>es({path:{accountId:s},throwOnError:!0}).then(()=>{t.invalidateQueries({queryKey:ss({path:{accountId:s}})})}),_t=s=>{const t=B(),a=p.useRef(s);a.current=s;const n=s.map(o=>o.accountId).join(",");p.useEffect(()=>{const o=Date.now(),c=At(a.current,o).filter(u=>!_.has(u));if(c.length!==0)for(const u of c)_.add(u),ne(u,t).catch(x=>{ae(u,x)})},[n,t]),p.useEffect(()=>{let o=Date.now(),r;const c=new Set,u=()=>{o=Date.now();const g=Dt(a.current.map(l=>l.accountId),c);for(const l of g)c.add(l);Rt(g,l=>ne(l,t).catch(v=>{ae(l,v)}).finally(()=>{c.delete(l)}),{concurrency:Ft})},x=()=>{if(document.visibilityState==="visible"){u(),r=setTimeout(x,M());return}},d=()=>{if(document.visibilityState!=="visible")return;r!==void 0&&clearTimeout(r);const g=Date.now(),l=M(g);if(zt(g,o,l)){u(),r=setTimeout(x,l);return}r=setTimeout(x,o+l-g)},h=()=>{document.visibilityState==="visible"&&(r!==void 0&&clearTimeout(r),o=Date.now(),r=setTimeout(x,M()))};r=setTimeout(x,M()),document.addEventListener("visibilitychange",d);const y=Ps(h);return()=>{r!==void 0&&clearTimeout(r),document.removeEventListener("visibilitychange",d),y()}},[n,t])};function Na(){const s=rs(),t=be(),a=et(t),{openOverlay:n,intelligenceOpen:o,showOverlay:r,toggleIntelligence:c,raiseIntelligence:u}=wt(),x=n==="shortcuts",d=n==="nav",{searchInput:h,committedQuery:y,viewKey:g,setSearchInput:l}=ht(),{data:v,isLoading:m,isError:f,error:b,refetch:N}=xe({...is(),staleTime:1/0}),i=!!(v&&(v.accounts?.length??0)===0);p.useEffect(()=>{i&&s({to:"/onboarding",replace:!0})},[i,s]),Zs({enabled:!x,bindings:[{key:"?",action:"help",handler:()=>r("shortcuts"),noModifiers:!1,preventDefault:!0}]});const j=K(),L=Cs(),T=D({select:F=>ms(F.matches)?.list==="mailbox"}),k=p.useMemo(()=>({compose:j}),[j]);qs({enabled:!T&&!L,handlers:k});const je=p.useCallback(()=>{l("")},[l]),Ne=p.useCallback(()=>{l("")},[l]),S=v?.accounts??[],Se=p.useMemo(()=>S.map(F=>F.accountId),[S]),Ce=St(S),Ie=Us(S).index,we=p.useMemo(()=>Hs(S),[S]);_t(S);const Oe=p.useCallback(()=>{n==="nav"&&r(void 0)},[n,r]),ke={accounts:S,mailboxNameIndex:Ce,accountNameIndex:we,resultFolderIndex:Ie,searchQuery:y,searchInput:h,searchViewKey:g,onSearchChange:l,onSearchClear:je,onSearchClearQuery:Ne,intelligenceOpen:o,onToggleIntelligence:c,onRaiseIntelligence:u},Re={isSinglePane:a,isLoading:m||i,intelligenceOpen:o,nav:e.jsx(Nt,{accounts:S,onMailboxSelect:Oe}),topBar:a?void 0:e.jsx(X,{accounts:S}),appBar:t==="phone"?void 0:e.jsx(vs,{}),overlay:a?e.jsx(gt,{}):void 0,navOpen:d,onOpenNav:()=>r("nav"),onCloseNav:()=>r(void 0)};return e.jsx(ls.Provider,{value:ke,children:e.jsxs(Fs,{accountIds:Se,children:[e.jsx(gs,{children:f?e.jsx(bs,{topBar:e.jsx(X,{accounts:S}),children:e.jsx("div",{className:"flex h-full items-center justify-center bg-canvas p-4",children:e.jsx(tt,{title:"Couldn't load your account",error:b,onRetry:()=>{N()}})})}):e.jsx(ks,{chrome:Re,children:e.jsx(cs,{})})}),e.jsx(ot,{isOpen:x,onClose:()=>r(void 0)})]})})}export{Na as component,ce as useMailContext};
@@ -1 +0,0 @@
1
- import{b as e}from"./index-9JWzpiiR.js";const a=e("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);export{a as M};
@@ -1 +0,0 @@
1
- import{b as e}from"./index-9JWzpiiR.js";const n=e("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);export{n as M};
@@ -1 +0,0 @@
1
- import{C as o}from"./CalendarEventEditor-B0SWzPqQ.js";import"./index-9JWzpiiR.js";import"./draft--MHSP3BT.js";import"./agenda-time-hKUG2dhl.js";import"./calendar-guests-7MqnVXzX.js";import"./calendar-event-popup-BvI6Qwla.js";import"./useCalendarSuggestions-DW7WFMvd.js";import"./ErrorState-BB0xpcCi.js";import"./useQueries-Des6lpmI.js";import"./pencil-Dz-yZ9zw.js";import"./circle-help-B6Fn573l.js";import"./useCalendarData-D07VZ1QE.js";import"./useCalendarTasks-CV-ORktM.js";import"./useCalendarScheduling-CnlDrC-W.js";import"./useDebouncedValue-DRrHzwce.js";import"./calendar-format-BwCpz-JZ.js";import"./nav-link-8l24_oWF.js";import"./useMediaQuery-BzGo-bVp.js";import"./calendar-Cmzt0eKc.js";import"./reply-BUVhW3yq.js";import"./CalendarQuickCreate-CaO2GHZr.js";import"./CalendarSession-Ub9ZzsQN.js";import"./calendar-event-sidebar-Dx3WbbPv.js";import"./select-Dv65Mqkl.js";import"./chevron-down-Q4i_URUt.js";import"./confirm-dialog-D33DXPkQ.js";const u=o;export{u as component};
@@ -1 +0,0 @@
1
- import{l as i,e as n,u as a,r as m,j as p}from"./index-9JWzpiiR.js";import{O as s}from"./OnboardingWizard-ezuAE6sx.js";import{c}from"./onboarding-completion-Z1EOTA33.js";import"./credential-steps-MLDe683C.js";import"./select-Dv65Mqkl.js";import"./chevron-down-Q4i_URUt.js";import"./badge-DLlDkvBl.js";import"./card-XAEgDd1b.js";import"./account-form-helpers-DhckT_PN.js";import"./mail-CXavFmSm.js";import"./file-json-B3Qb4sPC.js";import"./kbd-D_0s6Sx_.js";import"./checkbox-CzFLh5Dk.js";function k(){const o=i(),t=n(),e=a(),r=m.useCallback(l=>{c({queryClient:t,recordCompleted:()=>o.recordEvent("onboarding.completed"),navigateToInbox:()=>{window.location.assign("/mail")}})},[o,t]);return p.jsx(s,{skipWelcome:!1,onComplete:r,onImportConfig:()=>{e({to:"/import"})}})}export{k as component};
@@ -1 +0,0 @@
1
- import{j as o,O as i}from"./index-9JWzpiiR.js";import{a as m}from"./MailShell-DY2Ot0ah.js";import{u as p,O as t}from"./OutboxPane-D47KP_dW.js";import"./nav-link-8l24_oWF.js";import"./reply-BUVhW3yq.js";import{u as s}from"./search-mirror-B0C9oCpr.js";import"./useMessageBodyContent-D9UpR1Dh.js";import"./FullCompose-sAZlqUaR.js";import"./index-DqlUjB9k.js";import"./useSignature-CQsNwcJm.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-DRrHzwce.js";import"./suggest-list-xX77W_hF.js";import"./sections-BtFAPYYy.js";import"./useMediaQuery-BzGo-bVp.js";import"./chevron-down-Q4i_URUt.js";import"./ErrorState-BB0xpcCi.js";import"./confirm-dialog-D33DXPkQ.js";import"./search-scope-aZ2AZX-k.js";import"./app-chrome-BI9iJnw3.js";import"./MessageBody-zT-at0bi.js";import"./kbd-D_0s6Sx_.js";import"./outbox-status-BlKn6P0x.js";import"./NavMenuButton-B_c3nIpV.js";import"./menu-Dro5vzLW.js";import"./roving-focus-C87O2raY.js";import"./circle-check-big-CDjntmXC.js";import"./clock-jwuPTxhb.js";import"./row-actions-cUhOCilI.js";import"./rotate-ccw-DCzt84SY.js";function C(){const r=p();return s({to:"/mail/outbox"}),o.jsx(t,{outboxMessageId:r,children:o.jsx(m,{phone:o.jsx(t.Phone,{}),list:o.jsx(t.List,{}),reading:o.jsx(i,{})})})}export{C as component};
@@ -1 +0,0 @@
1
- import{b as a}from"./index-9JWzpiiR.js";const c=a("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);export{c as P};
@@ -1 +0,0 @@
1
- import{b as D,e as O,f as I,bI as E,bJ as R,bK as T,bL as A,bM as L,bN as F,bO as z,bP as v,r as c,j as e,aB as k,B as m,X as M,ap as U,bQ as g,b5 as B,aq as H,bR as Q,d as b,bS as q,bT as C,bU as w,u as K,ac as W}from"./index-9JWzpiiR.js";import{R as S}from"./ReportLink-C4yyzfnn.js";import{C as Y}from"./copy-Be7MLulJ.js";import{D as G,a as h,b as _}from"./DropdownMenu-CGhv-K3k.js";import{a as $}from"./sections-BtFAPYYy.js";import{S as J}from"./settings-screen-DPboZsK5.js";import"./avatar-COXPYlBH.js";import"./badge-DLlDkvBl.js";import"./chevron-left-gBxhdHb5.js";import"./menu-Dro5vzLW.js";import"./circle-help-B6Fn573l.js";const X=D("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]),V=async({action:s,person:t},r)=>{const n={userId:t.userId};if(s==="SignOut"){const{data:a}=await L({path:n,body:{stepUpToken:r},throwOnError:!0});return{person:a,resetUrl:void 0}}if(s==="ResetPassword"){const{data:a}=await F({path:n,body:{stepUpToken:r},throwOnError:!0});return{person:a.person,resetUrl:a.resetUrl}}const{data:o}=await z({path:n,body:{status:s==="Disable"?"Disabled":"Active",stepUpToken:r},throwOnError:!0});return{person:o,resetUrl:void 0}},Z=s=>{const t=O();return I({meta:E,gcTime:0,mutationFn:async r=>{const{data:n}=await A({body:{password:s,action:r.action,userId:r.person.userId},throwOnError:!0});return V(r,n.stepUpToken)},onSuccess:({person:r})=>{t.setQueryData(R(),n=>n&&{people:T(n.people,r)})}})},ee="That is not your password. Try again.",se="Five wrong passwords in 15 minutes. Wait 15 minutes, then try again.";function te({action:s,person:t,onCancel:r,onDone:n,onFailed:o}){const a=v(s,t.email),[l,p]=c.useState(""),[u,x]=c.useState(null),i=Z(l),d=()=>{i.isPending||r()},P=f=>{f.preventDefault(),!(i.isPending||l==="")&&(x(null),i.mutate({action:s,person:t},{onSuccess:n,onError:y=>{const j=g(y);if(j.kind==="wrongPassword"){p(""),x(ee);return}if(j.kind==="locked"){p(""),x(se);return}if(j.kind==="signedOut"){r(),B();return}o(y)}}))};return e.jsx(k,{open:!0,onClose:d,title:a.title,children:e.jsxs("form",{onSubmit:P,children:[e.jsxs("header",{className:"flex items-center gap-2 border-b border-line px-5 py-3",children:[e.jsx("span",{className:"flex-1 text-sm font-semibold text-fg",children:a.title}),e.jsx(m,{variant:"ghost",size:"sm",icon:e.jsx(M,{className:"size-3.5"}),onClick:d,"aria-label":"Close"})]}),e.jsxs("div",{className:"space-y-4 px-5 py-4 text-sm text-fg-muted",children:[e.jsx("p",{children:a.body}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{htmlFor:"people-step-up-password",className:"text-xs font-medium text-fg",children:"Your password"}),e.jsx(U,{id:"people-step-up-password",autoComplete:"current-password",value:l,onChange:f=>{p(f.target.value),x(null)},"aria-invalid":u!==null,"aria-describedby":"people-step-up-hint",required:!0}),e.jsx("p",{id:"people-step-up-hint",className:"text-xs",children:u?e.jsx("span",{className:"text-danger",role:"alert",children:u}):"Confirm with your own password. It counts for this one action."})]})]}),e.jsxs("footer",{className:"flex items-center justify-end gap-2 border-t border-line px-5 py-3",children:[e.jsx(m,{variant:"secondary",size:"sm",onClick:d,children:"Cancel"}),e.jsx(m,{type:"submit",variant:a.destructive?"danger":"primary",size:"sm",disabled:l==="","aria-busy":i.isPending,children:a.confirmLabel})]})]})})}const ne=()=>{};function re({email:s,resetUrl:t,onDone:r}){const[n,o]=c.useState(!1),[a,l]=c.useState(!1),p=()=>{navigator.clipboard.writeText(t).then(()=>{l(!1),o(!0)}).catch(()=>l(!0))};return e.jsxs(k,{open:!0,onClose:ne,title:`Reset link for ${s}`,children:[e.jsxs("header",{className:"border-b border-line px-5 py-3 text-sm font-semibold text-fg",children:["Reset link for ",s]}),e.jsxs("div",{className:"space-y-4 px-5 py-4 text-sm text-fg-muted",children:[e.jsx("p",{children:"They are signed out everywhere. Give them this link, by message or in person. It works once, for 24 hours."}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[e.jsx(m,{variant:"primary",size:"sm",icon:n?e.jsx(H,{className:"size-3.5"}):e.jsx(Y,{className:"size-3.5"}),onClick:p,children:n?"Copied":"Copy"}),e.jsx("input",{readOnly:!0,tabIndex:-1,value:t,"aria-label":`Reset link for ${s}`,onFocus:u=>u.currentTarget.select(),className:"min-w-0 flex-1 rounded-sm border border-line bg-surface px-2 py-1.5 font-mono text-xs text-fg sm:order-first"})]}),a&&e.jsx("p",{className:"text-xs text-danger",role:"alert",children:"Copying did not work in this browser. Select the link and copy it by hand."}),e.jsx("p",{children:"You see this link only now. Close this window and it is gone. Make a new one if it gets lost."})]}),e.jsx("footer",{className:"flex justify-end border-t border-line px-5 py-3",children:e.jsx(m,{variant:"secondary",size:"sm",onClick:r,children:"Done"})})]})}const N="The list of people did not load";function ae({failure:s}){const t=c.useRef(null);return c.useEffect(()=>{t.current?.focus()},[]),e.jsx("div",{ref:t,tabIndex:-1,className:"outline-none",children:e.jsxs(b,{tone:"danger",children:[e.jsx("p",{className:"font-medium",children:s.title}),e.jsx("p",{className:"mt-1 text-fg-muted",children:s.reason}),e.jsx("p",{className:"mt-1",children:e.jsx(S,{href:C(s.title,s.error)})})]})})}function oe({person:s,onPick:t}){const r=s.status==="Disabled";return e.jsxs(G,{trigger:e.jsxs(e.Fragment,{children:[e.jsx(X,{className:"size-4","aria-hidden":"true"}),e.jsxs("span",{className:"sr-only",children:["Actions for ",s.email]})]}),children:[e.jsx(h,{onClick:()=>t("SignOut"),children:"Sign out everywhere"}),e.jsx(h,{onClick:()=>t("ResetPassword"),children:"Reset password"}),e.jsx(_,{}),r?e.jsx(h,{onClick:()=>t("Enable"),children:"Enable"}):e.jsx(h,{onClick:()=>t("Disable"),disabled:s.isCaller,destructive:!s.isCaller,children:e.jsxs("span",{className:"flex flex-col",children:[e.jsx("span",{children:"Disable"}),s.isCaller&&e.jsx("span",{className:"text-xs text-fg-subtle",children:"Not your own account"})]})})]})}function ie({people:s,onPick:t}){const r=new Date;return e.jsx("div",{className:"overflow-x-auto rounded-sm border border-line bg-surface",children:e.jsxs("table",{className:"w-full text-left text-sm",children:[e.jsx("thead",{className:"border-b border-line text-xs text-fg-muted",children:e.jsxs("tr",{children:[e.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Email"}),e.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Created"}),e.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Last sign-in"}),e.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Sessions"}),e.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Status"}),e.jsx("th",{scope:"col",className:"w-12 px-1 py-2",children:e.jsx("span",{className:"sr-only",children:"Actions"})})]})}),e.jsx("tbody",{children:s.map(n=>e.jsxs("tr",{className:"border-b border-line last:border-b-0",children:[e.jsxs("td",{className:"px-3 py-1 text-fg",children:[n.email,n.isCaller&&e.jsx("span",{className:"text-fg-muted",children:" (you)"})]}),e.jsx("td",{className:"px-3 py-1 text-fg-muted",children:w(n.createdAt,r)}),e.jsx("td",{className:"px-3 py-1 text-fg-muted",children:w(n.lastSignInAt,r)}),e.jsx("td",{className:"px-3 py-1 tabular-nums text-fg-muted",children:n.sessionCount}),e.jsx("td",{className:n.status==="Disabled"?"px-3 py-1 text-danger":"px-3 py-1 text-fg-muted",children:n.status}),e.jsx("td",{className:"px-1 py-1",children:e.jsx(oe,{person:n,onPick:o=>t(o,n)})})]},n.userId))})]})})}function le(){const s=Q(),[t,r]=c.useState(null),[n,o]=c.useState(null),[a,l]=c.useState(null);if(s.isPending)return e.jsx("div",{className:"h-24 animate-pulse rounded-sm border border-line bg-surface","aria-busy":"true","aria-label":"Loading people"});if(s.unavailable)return e.jsx(b,{tone:"info",children:"This server has no People page. It shows on a self-hosted server once self sign-up is turned off."});if(s.isError)return g(s.error).kind==="signedOut"?null:e.jsxs(b,{tone:"danger",children:[e.jsxs("p",{className:"font-medium",children:[N,"."]}),e.jsx("p",{className:"mt-1 text-fg-muted",children:q(s.error)}),e.jsxs("p",{className:"mt-2 flex items-center gap-3",children:[e.jsx(m,{variant:"secondary",size:"sm",onClick:()=>{s.refetch()},children:"Try again"}),e.jsx(S,{href:C(N,s.error)})]})]});const p=(i,d)=>{o(null),r({action:i,person:d})},u=i=>{i.resetUrl&&t&&l({email:t.person.email,resetUrl:i.resetUrl}),r(null)},x=i=>{if(!t)return;const d=g(i);o({title:v(t.action,t.person.email).failedTitle,reason:d.kind==="failed"?d.reason:"Something went wrong. Nothing changed. Try again.",error:i}),r(null)};return e.jsxs("div",{className:"space-y-4",children:[n&&e.jsx(ae,{failure:n}),e.jsx(ie,{people:s.data.people,onPick:p}),t&&e.jsx(te,{action:t.action,person:t.person,onCancel:()=>r(null),onDone:u,onFailed:x}),a&&e.jsx(re,{email:a.email,resetUrl:a.resetUrl,onDone:()=>l(null)})]})}const ce=e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Anyone signed in here can manage every account. Each action asks for your own password first, and is recorded with who took it and from where."}),e.jsx("p",{children:"Disabling an account signs that person out within 15 minutes and stops their calendar feed links. Their mail stays. You cannot disable your own account, so one account always stays on."}),e.jsx("p",{children:"A reset link works once, for 24 hours, and is shown only once. Making one stops the old password at once."}),e.jsxs("p",{children:["The person who runs this server can turn all sign-in off with"," ",e.jsx("code",{children:"remit sign-in off"}),", and recover an account from the host with"," ",e.jsx("code",{children:"remit people enable"})," or ",e.jsx("code",{children:"remit people reset"}),"."]})]});function we(){const s=K(),t=W(),r=$(),[n,o]=c.useState(!0);return e.jsx(J,{items:t,activeId:"people",title:"People",description:"Everyone with an account on this server.",help:ce,helpOpen:n,onToggleHelp:()=>o(a=>!a),onSelect:r,onBackToMail:()=>{s({to:"/mail"})},children:e.jsx(le,{})})}export{we as component};
@@ -1 +0,0 @@
1
- import{b as e}from"./index-9JWzpiiR.js";const a=e("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);export{a as P};
@@ -1 +0,0 @@
1
- import{b as y,r as f,n as E,c3 as P,j as a,p as b,B as R}from"./index-9JWzpiiR.js";const j=y("EllipsisVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]),g=4,v=8;function k(e,t,n){const o=Math.max(v,window.innerWidth-t.width-v),r=n==="end"?e.right-t.width:e.left,s=Math.min(Math.max(r,v),o),c=e.bottom+g,i=e.top-g-t.height,d=c+t.height<=window.innerHeight-v||i<v?c:i;return{left:s,top:d}}function L(e,t,n,o){const[r,s]=f.useState(null),c=f.useRef(o);return c.current=o,f.useLayoutEffect(()=>{if(!t){s(null);return}const i=()=>{const x=e.current,h=c.current();if(!x||!h)return;const p=x.getBoundingClientRect(),w={width:p.right-p.left,height:p.bottom-p.top},m=k(h,w,n);s(l=>l?.left===m.left&&l.top===m.top?l:{position:"fixed",left:m.left,top:m.top})};i(),window.addEventListener("resize",i),window.addEventListener("scroll",i,!0);const u=e.current;let d=null;return u&&typeof ResizeObserver<"u"&&(d=new ResizeObserver(i),d.observe(u)),()=>{d?.disconnect(),window.removeEventListener("resize",i),window.removeEventListener("scroll",i,!0)}},[t,n,e]),r}function z(e,t){const[n,o]=f.useState(!1),r=f.useRef(null),s=f.useRef(null);return E({id:e,open:n,answers:{back:()=>{o(!1),t?.()}}}),f.useEffect(()=>{if(!n)return;const c=i=>{const u=i.target;r.current?.contains(u)||s.current?.contains(u)||o(!1)};return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[n]),{open:n,setOpen:o,containerRef:r,panelRef:s,getAnchor:()=>r.current?.getBoundingClientRect()??null}}function M({open:e,align:t="start",getAnchor:n,panelRef:o,children:r}){const s=L(o,e,t,n);return e?P.createPortal(a.jsx("div",{className:"z-50",style:s??{position:"fixed",visibility:"hidden"},children:r}),document.body):null}function N({label:e,children:t,className:n,ref:o,onKeyDown:r,"data-testid":s}){return a.jsx("div",{ref:o,role:"menu","aria-label":e,tabIndex:-1,onKeyDown:r,"data-testid":s,className:b("z-50 flex max-h-[60dvh] min-w-44 flex-col overflow-y-auto overscroll-contain rounded-md border border-line bg-surface py-1 shadow-lg outline-none",n),children:t})}function O({label:e,icon:t,onSelect:n,className:o,lang:r,"data-testid":s}){return a.jsxs("button",{type:"button",role:"menuitem",lang:r,onClick:n,"data-testid":s,className:b("flex min-h-11 items-center gap-3 px-4 py-2.5 text-left text-sm text-fg transition-colors hover:bg-surface-sunken",o),children:[t&&a.jsx("span",{className:"shrink-0 text-fg-subtle",children:t}),e]})}function A({triggerLabel:e,triggerIcon:t,triggerText:n,items:o,align:r="end",touch:s=!0,className:c,triggerClassName:i,nested:u=!1,children:d}){const{open:x,setOpen:h,containerRef:p,panelRef:w,getAnchor:m}=z("popover-menu");return o.length===0&&!d?null:a.jsxs("div",{ref:p,className:b("relative",c),...u?{role:"none"}:{},children:[a.jsx(R,{variant:"ghost",size:"sm",icon:t??a.jsx(j,{className:"size-5"}),onClick:()=>h(l=>!l),"aria-label":e,"aria-haspopup":"menu","aria-expanded":x,...u?{role:"menuitem"}:{},className:b(s&&"min-h-11 min-w-11 px-0",i),children:n}),a.jsx(M,{open:x,align:r,panelRef:w,getAnchor:m,children:a.jsxs(N,{ref:w,children:[o.map(l=>a.jsx(O,{label:l.label,icon:l.icon,onSelect:()=>{h(!1),l.onSelect()}},l.key)),d]})})]})}export{j as E,M as P,N as a,O as b,A as c,z as u};
@@ -1 +0,0 @@
1
- import{b as e}from"./index-9JWzpiiR.js";const t=e("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);export{t as R};
@@ -1 +0,0 @@
1
- import{b as t}from"./index-9JWzpiiR.js";const e=t("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);export{e as R};
@@ -1 +0,0 @@
1
- import{b as G,r as l,j as d,p as y,X as R,bX as Q,cm as D,cz as X,cA as J,cB as Y,cC as W,G as k,u as j,R as Z,U as M,W as ee,Y as te,J as ne,cD as E}from"./index-9JWzpiiR.js";import{e as I,f as re}from"./reply-BUVhW3yq.js";import{c as se}from"./nav-link-8l24_oWF.js";import{s as oe,S as ae}from"./search-scope-aZ2AZX-k.js";import{u as K}from"./useQueries-Des6lpmI.js";const Se=G("BellOff",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742",key:"178tsu"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05",key:"1hqiys"}]]),ie=[{action:"focusNext",keys:["j","k"],label:"navigate"},{action:"muteSender",keys:["m"],label:"mute"},{action:"help",keys:["?"],label:"all shortcuts"}];function ve(e){return ie.filter(t=>e[t.action]!==void 0)}const ce=[{title:"Navigation",hints:[{action:"focusNext",keys:["j"],description:"Focus the message below"},{action:"focusPrevious",keys:["k"],description:"Focus the message above"},{action:"focusNext",keys:["↓"],description:"Focus the message below"},{action:"focusPrevious",keys:["↑"],description:"Focus the message above"},{action:"focusFirst",keys:["Home"],description:"Focus first"},{action:"focusLast",keys:["End"],description:"Focus last"},{action:"openFocused",keys:["Enter"],description:"Open focused thread"},{action:"back",keys:["Esc"],description:"Back / close overlay"}]},{title:"Selection",hints:[{action:"toggleSelect",keys:["x"],description:"Toggle select"},{action:"toggleSelect",keys:["Space"],description:"Toggle select"},{action:"extendSelectDown",keys:["Shift","j"],description:"Extend selection down"},{action:"extendSelectUp",keys:["Shift","k"],description:"Extend selection up"},{action:"extendSelectDown",keys:["Shift","↓"],description:"Extend selection down"},{action:"extendSelectUp",keys:["Shift","↑"],description:"Extend selection up"},{action:"selectAll",keys:["⌘","A"],description:"Select all"}]},{title:"Actions",hints:[{action:"reply",keys:["r"],description:"Reply"},{action:"replyAll",keys:["a"],description:"Reply all"},{action:"forward",keys:["f"],description:"Forward"},{action:"delete",keys:["#"],description:"Delete"},{action:"toggleStar",keys:["s"],description:"Star / unstar"},{action:"toggleRead",keys:["u"],description:"Toggle read / unread"}]},{title:"Sender",hints:[{action:"muteSender",keys:["m"],description:"Mute sender"},{action:"blockSender",keys:["b"],description:"Block sender"},{action:"vipSender",keys:["v"],description:"VIP sender"},{action:"markJunk",keys:["!"],description:"Mark junk"}]},{title:"Go to",hints:[{action:"goBrief",keys:["g","b"],description:"Daily brief"},{action:"goInbox",keys:["g","i"],description:"Inbox"},{action:"goSent",keys:["g","s"],description:"Sent"},{action:"goFlagged",keys:["g","f"],description:"Starred"},{action:"goSettings",keys:["g",","],description:"Settings"}]},{title:"View & global",hints:[{action:"toggleIntelligence",keys:["i"],description:"Toggle intelligence"},{action:"toggleDensity",keys:["d"],description:"Toggle density"},{action:"focusSearch",keys:["/"],description:"Focus search"},{action:"compose",keys:["c"],description:"Compose"},{action:"compose",keys:["⌘","N"],description:"Compose"},{action:"help",keys:["?"],description:"Shortcut help"}]}];function le(e){for(const t of ce){const n=t.hints.find(r=>r.action===e);if(n)return n.keys}}function ue(e){const t=le(e);return!t||t.length===0?"":t.length===1?t[0]??"":t[0]==="g"?t.join(" then "):t.join("")}function Te(e){const t=ue(e);return t===""?"":`(${t})`}function de({key:e,shiftKey:t=!1,repeat:n=!1,caretAtStart:r,hasValue:i,chipCount:s}){const a=s-1;return e==="Escape"?i?{type:"clearQuery"}:{type:"blur"}:e==="Tab"&&t?s===0?{type:"none"}:{type:"focusChip",index:a}:e==="Backspace"||e==="ArrowLeft"?!r||s===0?{type:"none"}:n?{type:"none"}:{type:"focusChip",index:a}:{type:"none"}}function fe({key:e,repeat:t=!1,index:n,chipCount:r}){return e==="Backspace"||e==="Delete"?t?{type:"none"}:{type:"removeChip",index:n}:e==="ArrowLeft"?n===0?{type:"none"}:{type:"focusChip",index:n-1}:e==="ArrowRight"?n>=r-1?{type:"focusInput"}:{type:"focusChip",index:n+1}:e==="Enter"||e===" "?{type:"activateChip",index:n}:e==="Escape"?{type:"focusInput"}:{type:"none"}}function pe(e,t){const n=t-1;return n<=0?null:e<n?e:n-1}const q={filter:"border-line bg-surface-sunken text-fg-muted",scope:"border-accent-2/40 bg-accent-2-soft text-accent-2"},me=({label:e,onRemove:t,tone:n="filter",className:r})=>d.jsxs("span",{className:y("inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-2xs",q[n],r),children:[d.jsx("span",{children:e}),d.jsx("button",{type:"button",onClick:t,className:"shrink-0 rounded-full p-0.5 hover:bg-fg-muted/20 transition-colors","aria-label":`Remove filter: ${e}`,children:d.jsx(R,{className:"size-3"})})]}),B=l.forwardRef(({label:e,onRemove:t,onActivate:n,tone:r="filter",focused:i=!1,onKeyDown:s,onFocusLabel:a,className:u},f)=>d.jsxs("span",{role:"row",tabIndex:-1,className:y("inline-flex max-w-48 items-center gap-1 rounded-full border px-2 py-0.5 text-2xs transition-colors",q[r],i&&"ring-2 ring-ring",u),children:[d.jsx("button",{ref:f,type:"button",role:"gridcell",tabIndex:i?0:-1,onClick:n,onFocus:a,onKeyDown:s,className:y("block min-w-0 max-w-full truncate rounded-full outline-none",n?"cursor-pointer":"cursor-default"),children:e}),d.jsx("button",{type:"button",role:"gridcell",tabIndex:-1,onClick:t,className:"block shrink-0 rounded-full p-0.5 transition-colors hover:bg-fg-muted/20","aria-label":`Remove filter: ${e}`,children:d.jsx(R,{className:"size-3"})})]}));B.displayName="SearchChipRow";const Ne=({tokens:e,className:t})=>e.length===0?null:d.jsx("div",{className:y("flex flex-wrap items-center gap-1.5 border-b border-line bg-surface px-row-inset py-1.5",t),children:e.map(n=>d.jsx(me,{label:n.label,onRemove:n.onRemove},n.label))}),he=e=>e instanceof HTMLElement?e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable:!1,ge=({chips:e=[],onRemoveChip:t,value:n,onChange:r,onClear:i,onClearQuery:s,placeholder:a="Search mail...",globalFocusKey:u=!0,showClearButton:f=!0,size:h="sm",inputId:p,suggest:m,className:x})=>{const O=l.useId(),F=p??O,C=l.useRef(null),$=l.useRef([]),A=s??i,[P,w]=l.useState(null),v=l.useRef(void 0),[H,U]=l.useState(""),T=e.length>0;l.useEffect(()=>{w(o=>o!==null&&o>=e.length?null:o)},[e.length]),l.useEffect(()=>{const o=v.current;if(o!==void 0){if(v.current=void 0,o===null){C.current?.focus();return}$.current[o]?.focus()}});const L=l.useRef(void 0);l.useEffect(()=>{const o=m?.caret;if(!o||o===L.current)return;L.current=o;const c=C.current;!c||c.ownerDocument.activeElement!==c||(c.setSelectionRange(o.cursor,o.cursor),m?.onCaretChange(o.cursor))});const S=o=>{m?.onCaretChange(o.selectionStart??o.value.length)},g=l.useCallback(o=>{w(o),v.current=o},[]),N=l.useCallback(o=>{const c=e[o];c&&t&&(g(pe(o,e.length)),U(`${c.label} removed`),t(c.id))},[e,t,g]),V=l.useCallback(()=>{g(null),i()},[i,g]),z=l.useCallback(o=>{const c=o.currentTarget;if(m?.onKeyDown(o))return;const b=de({key:o.key,shiftKey:o.shiftKey,repeat:o.repeat,caretAtStart:c.selectionStart===0&&c.selectionEnd===0,hasValue:n.length>0,chipCount:e.length});switch(b.type){case"focusChip":o.preventDefault(),g(b.index);return;case"clearQuery":A();return;case"blur":c.blur();return;case"none":return}},[e.length,n,A,g,m]),_=l.useCallback(o=>c=>{const b=fe({key:c.key,repeat:c.repeat,index:o,chipCount:e.length});switch(b.type!=="none"&&c.preventDefault(),b.type){case"removeChip":N(b.index);return;case"focusChip":g(b.index);return;case"focusInput":g(null);return;case"activateChip":return;case"none":return}},[e,N,g]);return l.useEffect(()=>{if(!u)return;const o=c=>{c.key!=="/"||c.metaKey||c.ctrlKey||c.altKey||he(c.target)||D("focusSearch")||(c.preventDefault(),C.current?.focus())};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[u]),d.jsxs("label",{htmlFor:F,className:y("flex w-full items-center gap-1.5 text-sm","bg-surface-sunken/50 border border-transparent","focus-within:bg-canvas focus-within:border-line focus-within:ring-2 focus-within:ring-ring","transition-colors",h==="lg"?"rounded-xl px-4 py-2":"rounded-md px-2.5 py-1",x),children:[d.jsx(Q,{className:y("shrink-0 text-fg-muted pointer-events-none",h==="lg"?"size-5":"size-4")}),d.jsxs("div",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-1",children:[T&&d.jsx("div",{role:"grid","aria-label":"Search filters",className:"flex min-w-0 flex-wrap items-center gap-1",children:e.map((o,c)=>d.jsx(B,{ref:b=>{$.current[c]=b},label:o.label,tone:o.tone,focused:P===c,onFocusLabel:()=>w(c),onKeyDown:_(c),onRemove:()=>N(c)},o.id))}),d.jsx("input",{ref:C,id:F,name:"q",type:"text","aria-label":"Search mail",autoComplete:"off",value:n,tabIndex:P===null?0:-1,onChange:o=>{r(o.target.value),S(o.target)},onKeyDown:z,onKeyUp:o=>S(o.currentTarget),onClick:o=>S(o.currentTarget),onFocus:o=>{w(null),m?.onFocusChange?.(!0),S(o.currentTarget)},onBlur:()=>m?.onFocusChange?.(!1),...m?.comboboxProps,placeholder:T?void 0:a,className:"min-w-24 flex-1 bg-transparent text-fg outline-none placeholder:text-fg-muted"})]}),(n||T)&&f&&d.jsx("button",{type:"button",onClick:V,className:"shrink-0 rounded p-0.5 hover:bg-surface-raised transition-colors","aria-label":"Clear search",children:d.jsx(R,{className:y("text-fg-muted",h==="lg"?"size-5":"size-4")})}),d.jsx("span",{role:"status","aria-live":"polite",className:"sr-only",children:H})]})},Ee=({value:e,onChange:t,onClear:n,onClearQuery:r,chips:i,onRemoveChip:s,placeholder:a="Search mail...",globalFocusKey:u=!0,showClearButton:f=!0,size:h,inputId:p,suggest:m,className:x})=>d.jsx(ge,{value:e,onChange:t,onClear:n,onClearQuery:r,chips:i,onRemoveChip:s,placeholder:a,globalFocusKey:u,showClearButton:f,size:h,inputId:p,suggest:m,className:x});function Re({handlers:e,enabled:t=!0,target:n,sequenceTimeoutMs:r=1e3}){const i=l.useRef(e);i.current=e;const s=l.useRef(null),a=l.useRef(null);l.useEffect(()=>{if(!t)return;const u=()=>{a.current!==null&&(clearTimeout(a.current),a.current=null)},f=p=>{const m=X({key:p.key,shiftKey:p.shiftKey,metaKey:p.metaKey,ctrlKey:p.ctrlKey,altKey:p.altKey,inEditable:Y(p.target),onControl:J(p.target)},s.current);if(W().length>0){u(),s.current=null;return}if(u(),s.current=m.nextPrefix,m.nextPrefix!==null&&(a.current=setTimeout(()=>{s.current=null,a.current=null},r)),m.action===null||D(m.action)!==null)return;const x=i.current[m.action];x&&(m.preventDefault&&p.preventDefault(),x())},h=n===void 0?window:n;if(h!==null)return h.addEventListener("keydown",f),()=>{h.removeEventListener("keydown",f),u(),s.current=null}},[t,r,n])}function je(){const e=k({from:"/mail/brief/$threadId",shouldThrow:!1}),t=k({from:"/mail/brief/$threadId/$messageId",shouldThrow:!1}),n=k({from:"/mail/flagged/$threadId",shouldThrow:!1}),r=k({from:"/mail/flagged/$threadId/$messageId",shouldThrow:!1}),i=k({from:"/mail/$mailboxId/$threadId",shouldThrow:!1}),s=k({from:"/mail/$mailboxId/$threadId/$messageId",shouldThrow:!1}),a=e?.threadId??n?.threadId??i?.threadId,u=t?.messageId??r?.messageId??s?.messageId;return l.useMemo(()=>a?{threadId:a,messageId:u}:void 0,[a,u])}function Me(){const e=j(),t=se(),{list:n,mailboxId:r}=I();return l.useCallback((i,s)=>{const a=s?.query,f={search:p=>a===void 0?p:{...p,q:a||void 0},hash:t,replace:s?.replace??!1};if(n==="flagged"){e({to:"/mail/flagged/$threadId/$messageId",params:i,...f});return}const h=s?.mailboxId??r;if(n==="mailbox"&&h){e({to:"/mail/$mailboxId/$threadId/$messageId",params:{mailboxId:h,...i},...f});return}e({to:"/mail/brief/$threadId/$messageId",params:i,...f})},[e,t,n,r])}function Ke(){return re()}function be(){const e=j();return l.useCallback(t=>{e({to:"/mail/brief",search:{q:t||void 0}})},[e])}function Fe(){const e=j();return l.useCallback((t,n)=>{e({to:"/mail/$mailboxId",params:{mailboxId:t},search:{q:n||void 0}})},[e])}const ye=({accounts:e})=>{const{list:t,mailboxId:n}=I(),{t:r}=Z("mail",{useSuspense:!1}),i=l.useCallback((a,u)=>r(a,{defaultValue:u}),[r]),s=K({queries:e.map(a=>({...M({path:{accountId:a.accountId}}),staleTime:1/0}))});if(t==="outbox")return"Outbox";if(!n)return null;for(let a=0;a<e.length;a++){const u=s[a]?.data?.items;if(!u)continue;const f=u.find(p=>p.mailboxId===n);if(!f)continue;const h=ee(e[a].folderAppointments);return te(f,h.get(n),i)}return null},$e=({accounts:e})=>{const{mailboxId:t}=I(),n=K({queries:e.map(r=>({...M({path:{accountId:r.accountId}}),staleTime:1/0}))});if(!t)return null;for(const r of n){const i=r.data?.items;if(!i)continue;const s=i.find(a=>a.mailboxId===t);if(s)return s.unseenCount}return null},Ae=({accounts:e})=>{const{mailboxId:t}=I(),n=K({queries:e.map(r=>({...M({path:{accountId:r.accountId}}),staleTime:1/0}))});if(!t)return 0;for(const r of n){const i=r.data?.items;if(!i)continue;const s=i.find(a=>a.mailboxId===t);if(s)return s.messageCount}return 0};function Pe(e){const t=be(),{searchInput:n}=ne(),r=ye({accounts:e}),i=I(),s=l.useMemo(()=>oe(i,r),[i,r]),a=l.useCallback(u=>{u===ae&&t(n)},[t,n]);return{scope:s,clearScope:a}}function Le(e){const t=new Map;for(const n of e){const r=n.email.toLowerCase(),i=r.split("@")[0];i&&!t.has(i)&&t.set(i,n.accountId),t.has(r)||t.set(r,n.accountId)}return t}function De(e){const t=new Map;for(const n of e)for(const r of n){const i=r.fullPath?.toLowerCase();if(!i)continue;const s=E(r).toLowerCase();t.has(i)||t.set(i,r.mailboxId),t.has(s)||t.set(s,r.mailboxId)}return t}function qe(e,t=[]){const n=e.flat().filter(s=>s.fullPath),r=new Map;for(const s of n){const a=E(s).toLowerCase();r.set(a,(r.get(a)??0)+1)}const i=new Map(t.map(s=>[s.accountId,s.email]));return n.map(s=>{const a=E(s),u=r.get(a.toLowerCase())===1,f=t.length>1?i.get(s.accountId):void 0;return{value:u?a:s.fullPath,label:s.displayNameOverride?.trim()||a,...f?{hint:f}:{}}})}function Be(e){const t=new Map;for(const n of e){const r=n.email.toLowerCase().split("@")[0]??"";t.set(r,(t.get(r)??0)+1)}return e.map(n=>{const r=n.email.split("@")[0]??n.email,i=t.get(r.toLowerCase())===1,s=n.displayName?.trim();return{value:i?r:n.email,label:s||n.email,...s?{hint:n.email}:{}}})}export{Se as B,ce as K,Ee as S,je as a,De as b,Re as c,Le as d,Me as e,Ke as f,ye as g,$e as h,Ae as i,ie as j,ve as k,Ne as l,qe as m,Be as n,Fe as o,ue as s,Te as t,Pe as u};
@@ -1 +0,0 @@
1
- import{j as e,p as w,e as I,r as o,bV as L,a as C,f as k,bW as P,b2 as O,B as N,X as $,u as q,ac as A,ao as R,bX as M,bY as Q,bZ as B,q as D}from"./index-9JWzpiiR.js";import{u as K}from"./useDebouncedValue-DRrHzwce.js";import{a as F}from"./sections-BtFAPYYy.js";import{s as G}from"./help-copy-DodnPf1K.js";import{K as y}from"./kbd-D_0s6Sx_.js";import{E}from"./ErrorState-BB0xpcCi.js";import{a as V,S as H}from"./settings-screen-DPboZsK5.js";import"./avatar-COXPYlBH.js";import"./badge-DLlDkvBl.js";import"./chevron-left-gBxhdHb5.js";import"./menu-Dro5vzLW.js";import"./circle-help-B6Fn573l.js";function T({options:a,active:u,onSelect:m}){return e.jsx("div",{role:"tablist",className:w("flex shrink-0 gap-1 overflow-x-auto border-b border-line p-2","lg:w-44 lg:flex-col lg:gap-0 lg:overflow-visible lg:border-r lg:border-b-0 lg:py-2 lg:pr-2 lg:pl-3"),children:a.map(t=>{const d=t.id===u;return e.jsxs("button",{type:"button",role:"tab","aria-selected":d,onClick:()=>m(t.id),className:w("flex min-h-11 shrink-0 items-center gap-2 rounded-md px-3 text-left text-sm transition-colors lg:min-h-0 lg:px-2 lg:py-1",d?"bg-accent-2-soft font-medium text-accent-2":"text-fg-muted hover:bg-surface-sunken hover:text-fg"),children:[e.jsx("span",{className:"flex-1 truncate",children:t.label}),e.jsx("span",{className:w("text-2xs tabular-nums",d?"text-accent-2":"text-fg-subtle"),children:t.count??"—"})]},t.id)})})}const S={vip:"VIPs",muted:"Muted",blocked:"Blocked"};function X({query:a,onCount:u}){const{data:m,isPending:t,isError:d,error:x}=C(Q()),g=I(),i=k({...P(),onSettled:()=>{g.invalidateQueries({queryKey:B()})}}),l=m?.suggestions??[],p=a.trim().toLowerCase(),c=p?l.filter(r=>(r.displayName??"").toLowerCase().includes(p)||r.normalizedEmail.toLowerCase().includes(p)):l;return o.useEffect(()=>{u?.(c.length,l.length)},[u,c.length,l.length]),t?e.jsx("div",{className:"px-row-inset py-3 text-sm text-fg-subtle animate-pulse",children:"Loading VIP suggestions…"}):d?e.jsx("div",{className:"px-row-inset py-3",children:e.jsx(E,{variant:"inline",title:"Couldn't load VIP suggestions",error:x})}):l.length===0?e.jsxs("div",{className:"px-row-inset py-5 text-sm text-fg-subtle",children:["No VIP suggestions yet. As you reply to senders, they'll appear here. Press ",e.jsx(y,{children:"v"})," on any message to promote a sender to VIP."]}):c.length===0?e.jsxs("p",{className:"px-row-inset py-5 text-sm text-fg-subtle",children:["No VIPs match “",a,"”."]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-row-inset py-1 text-2xs font-semibold uppercase tracking-wider text-fg-subtle",children:"Suggested — promote to VIP"}),c.map(r=>e.jsx(V,{name:r.displayName??r.normalizedEmail,email:r.normalizedEmail,meta:r.replyCount>0?`${r.inboundCount} received · you replied ${r.replyCount}×`:`${r.inboundCount} received · you've never replied`,trailing:e.jsx(N,{variant:"ghost",size:"sm",icon:e.jsx(D,{className:"size-3.5"}),"aria-busy":i.isPending,onClick:()=>{i.isPending||i.mutate({path:{addressId:r.addressId},body:{flags:{vip:{value:!0,setAt:Date.now(),setBy:"user"}}}})},children:"Add VIP"})},r.addressId))]})}function U({group:a,query:u,onCount:m}){const t=K(u.trim(),300),d=I(),[x,g]=o.useState(null),i=t.length>=2,l=L({query:{q:t,limit:50}}),{data:p,isPending:c,isError:r,error:v}=C({...l,enabled:i}),f=k({...P(),onSuccess:()=>{d.invalidateQueries({queryKey:l.queryKey})}}),h=(p?.items??[]).filter(n=>a==="muted"?n.flags?.muted?.value??!1:n.flags?.blocked?.value??!1);return o.useEffect(()=>{m?.(i?h.length:0,null)},[m,i,h.length]),i?c?e.jsx("div",{className:"px-row-inset py-3 text-sm text-fg-subtle animate-pulse",children:"Searching…"}):r?e.jsx("div",{className:"px-row-inset py-3",children:e.jsx(E,{variant:"inline",title:"Search failed",error:v})}):h.length===0?e.jsxs("p",{className:"px-row-inset py-5 text-sm text-fg-subtle",children:["No ",S[a].toLowerCase()," senders matching “",t,"”."]}):e.jsx(e.Fragment,{children:h.map(n=>{const s=a==="muted"?n.flags?.muted:n.flags?.blocked,j=s?[`${a}`,s.setAt&&O(s.setAt,{month:"short",year:"numeric"})||null,s.reason?`— ${s.reason}`:null].filter(Boolean).join(" "):a,b=f.isPending&&f.variables?.path.addressId===n.addressId,z=f.isError&&x===n.addressId;return e.jsx(V,{name:n.displayName??n.normalizedEmail,email:n.normalizedEmail,danger:a==="blocked",meta:j,trailing:z?e.jsx(N,{variant:"secondary",size:"sm",onClick:()=>{g(n.addressId),f.mutate({path:{addressId:n.addressId},body:{flags:{[a]:{value:!1,setAt:Date.now()}}}})},children:"Retry"}):e.jsx(N,{variant:"ghost",size:"sm",icon:e.jsx($,{className:"size-3.5"}),"aria-busy":b,"aria-label":`Remove ${a} flag`,onClick:()=>{b||(g(n.addressId),f.mutate({path:{addressId:n.addressId},body:{flags:{[a]:{value:!1,setAt:Date.now()}}}}))}})},n.addressId)})}):e.jsxs("div",{className:"px-row-inset py-5 text-sm text-fg-subtle space-y-2",children:[e.jsxs("p",{children:["Type 2+ characters to search ",S[a].toLowerCase()," ","senders by name or address."]}),e.jsxs("p",{className:"text-2xs text-fg-subtle",children:["Note: a dedicated flagged-address list endpoint is in the backlog. Press ",e.jsx(y,{children:"m"})," on any message to mute its sender; ",e.jsx(y,{children:"b"})," to block."]})]})}function le(){const a=q(),u=A(),m=F(),[t,d]=o.useState("vip"),[x,g]=o.useState(""),[i,l]=o.useState(!0),[p,c]=o.useState(0),[r,v]=o.useState({vip:0,muted:null,blocked:null}),f=o.useCallback((s,j)=>{c(s),v(b=>({...b,vip:j}))},[]),h=o.useCallback((s,j)=>{c(s),v(b=>({...b,[t]:s}))},[t]),n=r[t];return e.jsx(H,{items:u,activeId:"senders",title:"Senders & Rules",description:"Per-sender preferences — set with one key from any message, managed here.",flush:!0,help:G,helpOpen:i,onToggleHelp:()=>l(s=>!s),onSelect:m,onBackToMail:()=>{a({to:"/mail"})},children:e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col lg:flex-row",children:[e.jsx(T,{active:t,onSelect:s=>{d(s),g("")},options:["vip","muted","blocked"].map(s=>({id:s,label:S[s],count:r[s]}))}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[e.jsx("div",{className:"border-b border-line px-row-inset py-2",children:e.jsx(R,{icon:e.jsx(M,{className:"size-4"}),placeholder:`Filter ${S[t].toLowerCase()} by name or address`,className:"h-8 max-w-sm",value:x,onChange:s=>g(s.target.value)})}),e.jsx("div",{className:"min-h-0 flex-1 divide-y divide-line overflow-y-auto",children:t==="vip"?e.jsx(X,{query:x,onCount:f}):e.jsx(U,{group:t,query:x,onCount:h})}),e.jsxs("footer",{className:"flex items-center justify-between border-t border-line px-row-inset py-1 text-2xs text-fg-subtle",children:[e.jsx("span",{children:n!=null?`${p} of ${n} flagged senders`:`${p} flagged senders`}),e.jsxs("span",{children:[e.jsx(y,{children:"j"})," ",e.jsx(y,{children:"k"})," navigate · ",e.jsx(y,{children:"⌫"})," remove flag"]})]})]})]})})}export{U as SearchGroupPane,le as component};
@@ -1 +0,0 @@
1
- import{j as t,O as o}from"./index-9JWzpiiR.js";const n=()=>t.jsx(o,{});export{n as component};
@@ -1 +0,0 @@
1
- import{r as j,j as e,p as f,B as i,X as N}from"./index-9JWzpiiR.js";import{A as w}from"./avatar-COXPYlBH.js";import{B as z}from"./badge-DLlDkvBl.js";import{C as h}from"./chevron-left-gBxhdHb5.js";import{M as S}from"./menu-Dro5vzLW.js";import{C as v}from"./circle-help-B6Fn573l.js";function L({items:l,activeId:t,title:x,description:n,children:r,help:s,helpOpen:d=!0,flush:o,onSelect:k,onToggleHelp:u,onBackToMail:m}){const[y,c]=j.useState(!1),[p,C]=j.useState(!1),b=!!s&&d,g=e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-3 pt-3 pb-1 text-2xs font-semibold uppercase tracking-wider text-fg-subtle",children:"Settings"}),e.jsx("nav",{className:"flex-1 overflow-y-auto px-2 py-1",children:l.map(a=>e.jsxs("button",{type:"button",onClick:()=>{k?.(a.id),c(!1)},className:f("flex min-h-11 w-full items-center gap-2 rounded-md px-2 py-1 text-left text-sm transition-colors lg:min-h-0",a.id===t?"bg-accent-2-soft font-medium text-accent-2":"text-fg-muted hover:bg-surface hover:text-fg"),children:[a.icon&&e.jsx("span",{className:f("shrink-0",a.id===t?"text-accent-2":"text-fg-subtle"),children:a.icon}),a.label]},a.id))})]});return e.jsxs("div",{className:"safe-area-frame flex h-dvh w-full overflow-hidden bg-canvas font-sans text-fg",children:[e.jsxs("aside",{className:"hidden w-60 shrink-0 flex-col border-r border-line bg-surface-sunken lg:flex",children:[e.jsx("div",{className:"flex h-pane-header shrink-0 items-center border-b border-line px-2",children:e.jsxs("button",{type:"button",onClick:m,className:"flex w-full items-center gap-2 rounded-md px-2 py-1 text-left text-sm text-fg-muted hover:bg-surface hover:text-fg",children:[e.jsx(h,{className:"size-4 text-fg-subtle"}),"Back to mail"]})}),g]}),y&&e.jsxs("div",{className:"fixed inset-0 z-50 flex lg:hidden",children:[e.jsx("button",{type:"button","aria-label":"Close menu",className:"absolute inset-0 bg-canvas/60",onClick:()=>c(!1)}),e.jsxs("aside",{className:"safe-area-frame relative flex w-72 max-w-[85%] flex-col border-r border-line bg-surface-sunken",children:[e.jsxs("div",{className:"flex h-pane-header shrink-0 items-center justify-between border-b border-line px-2",children:[e.jsxs("button",{type:"button",onClick:()=>{m?.(),c(!1)},className:"flex items-center gap-2 rounded-md px-2 py-1 text-left text-sm text-fg-muted hover:bg-surface hover:text-fg",children:[e.jsx(h,{className:"size-4 text-fg-subtle"}),"Back to mail"]}),e.jsx(i,{variant:"ghost",size:"sm",icon:e.jsx(N,{className:"size-4"}),onClick:()=>c(!1),"aria-label":"Close menu"})]}),g]})]}),e.jsxs("main",{className:"flex min-w-0 flex-1 flex-col",children:[e.jsxs("header",{className:"flex h-pane-header shrink-0 items-center gap-3 border-b border-line px-3 lg:px-5",children:[m&&e.jsx(i,{variant:"ghost",size:"sm",icon:e.jsx(h,{className:"size-4"}),className:"-ml-1 lg:hidden",onClick:m,"aria-label":"Back to mail"}),e.jsx(i,{variant:"ghost",size:"sm",icon:e.jsx(S,{className:"size-4"}),className:"lg:hidden",onClick:()=>c(!0),"aria-label":"Open settings menu"}),e.jsx("h1",{className:"text-md font-semibold text-fg",children:x}),n&&e.jsx("p",{className:"hidden min-w-0 truncate text-xs text-fg-subtle lg:block",children:n}),s&&e.jsx(i,{variant:"ghost",size:"sm",icon:e.jsx(v,{className:"size-4"}),className:"ml-auto lg:hidden",onClick:()=>C(a=>!a),"aria-label":"Tips","aria-expanded":p}),s&&!b&&e.jsx(i,{variant:"ghost",size:"sm",icon:e.jsx(v,{className:"size-4"}),className:"hidden ml-auto lg:inline-flex",onClick:u,"aria-label":"Show tips"})]}),s&&p&&e.jsx("div",{className:"border-b border-line bg-surface-sunken px-row-inset py-3 text-xs leading-relaxed text-fg-muted lg:hidden",children:s}),o?e.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:r}):e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e.jsx("div",{className:"max-w-2xl px-3 py-5 lg:px-5",children:e.jsx("div",{className:"space-y-5",children:r})})})]}),b&&e.jsxs("aside",{className:"hidden w-64 shrink-0 flex-col border-l border-line bg-surface-sunken lg:flex",children:[e.jsxs("header",{className:"flex h-pane-header shrink-0 items-center justify-between border-b border-line px-row-inset",children:[e.jsx("span",{className:"text-2xs font-semibold uppercase tracking-wider text-fg-subtle",children:"Tips & tricks"}),e.jsx(i,{variant:"ghost",size:"sm",icon:e.jsx(N,{className:"size-3.5"}),onClick:u,"aria-label":"Collapse tips"})]}),e.jsx("div",{className:"flex-1 overflow-y-auto px-row-inset py-3 text-xs leading-relaxed text-fg-muted",children:s})]})]})}function X({name:l,email:t,meta:x,caption:n,danger:r,trailing:s}){return e.jsxs("div",{className:"flex items-center gap-3 px-row-inset py-2 hover:bg-surface-sunken",children:[e.jsx("span",{className:f(r&&"rounded-full ring-2 ring-danger/40"),children:e.jsx(w,{name:l,email:t,size:"sm"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-col gap-0 sm:flex-row sm:items-baseline sm:gap-2",children:[e.jsx("span",{className:"truncate text-sm font-medium text-fg",children:l}),e.jsx("span",{className:"truncate text-2xs text-fg-subtle",children:t})]}),e.jsxs("div",{className:"text-xs text-fg-subtle",children:[x,n&&e.jsxs("span",{className:"text-fg-muted",children:[" · ",n]})]})]}),s&&e.jsx("div",{className:"shrink-0",children:s})]})}const B={healthy:{tone:"positive",label:"healthy"},error:{tone:"danger",label:"error"},muted:{tone:"neutral",label:"muted"}};function q({label:l,email:t,connector:x,syncLabel:n,state:r,errorDetail:s,trailing:d}){const o=B[r];return e.jsxs("div",{className:f("rounded-sm border border-line bg-surface",r==="muted"&&"opacity-65"),children:[e.jsxs("div",{className:"flex flex-col gap-3 px-row-inset py-3 sm:flex-row sm:items-center",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[e.jsx(w,{name:l,email:t,size:"md"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"truncate text-sm font-semibold text-fg",children:l}),e.jsx(z,{tone:o.tone,dot:!0,children:o.label})]}),e.jsxs("div",{className:"truncate text-xs text-fg-subtle",children:[t," · ",x," · ",n]})]})]}),d&&e.jsx("div",{className:"shrink-0",children:d})]}),s&&e.jsx("div",{className:"border-t border-line px-row-inset py-2",children:e.jsx("code",{className:"block rounded-xs bg-danger-soft px-2 py-1 text-2xs text-danger",children:s})})]})}export{q as A,L as S,X as a};
@@ -1 +0,0 @@
1
- import{b as e}from"./index-9JWzpiiR.js";const d=e("CloudOff",[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5.782 5.782A7 7 0 0 0 9 19h8.5a4.5 4.5 0 0 0 1.307-.193",key:"yfwify"}],["path",{d:"M21.532 16.5A4.5 4.5 0 0 0 17.5 10h-1.79A7.008 7.008 0 0 0 10 5.07",key:"jlfiyv"}]]);const h=e("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);export{d as C,h as S};