@burdenoff/microfe-integrations 2026.1107.1 → 2026.1109.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (245) hide show
  1. package/dist/dev/main.d.ts +0 -2
  2. package/dist/generated/global-operations.d.ts +4 -2
  3. package/dist/generated/global-types.d.ts +210 -190
  4. package/dist/generated/wspace-operations.d.ts +1195 -670
  5. package/dist/generated/wspace-operations.js +265 -149
  6. package/dist/generated/wspace-operations.js.map +1 -1
  7. package/dist/generated/wspace-types.d.ts +8728 -376
  8. package/dist/generated/wspace-types.js +6 -3
  9. package/dist/generated/wspace-types.js.map +1 -1
  10. package/dist/index.d.ts +0 -1
  11. package/dist/integrations/ConnectSourceDialog.d.ts +0 -2
  12. package/dist/integrations/ConnectSourceDialog.js +13 -14
  13. package/dist/integrations/ConnectSourceDialog.js.map +1 -1
  14. package/dist/integrations/ConnectionsPanel.d.ts +0 -2
  15. package/dist/integrations/ConnectionsPanel.js +5 -6
  16. package/dist/integrations/ConnectionsPanel.js.map +1 -1
  17. package/dist/integrations/IntegrationsAdminRoot.d.ts +0 -2
  18. package/dist/integrations/IntegrationsAdminRoot.js +14 -11
  19. package/dist/integrations/IntegrationsAdminRoot.js.map +1 -1
  20. package/dist/integrations/IntegrationsAdminRoutes.d.ts +1 -2
  21. package/dist/integrations/IntegrationsAdminRoutes.js +1 -2
  22. package/dist/integrations/IntegrationsAdminRoutes.js.map +1 -1
  23. package/dist/integrations/IntegrationsRoot.d.ts +0 -2
  24. package/dist/integrations/IntegrationsRoot.js +9 -6
  25. package/dist/integrations/IntegrationsRoot.js.map +1 -1
  26. package/dist/integrations/IntegrationsUserRoutes.d.ts +1 -2
  27. package/dist/integrations/IntegrationsUserRoutes.js +7 -8
  28. package/dist/integrations/IntegrationsUserRoutes.js.map +1 -1
  29. package/dist/integrations/components/AddConnectionDialog.d.ts +1 -3
  30. package/dist/integrations/components/AddConnectionDialog.js +12 -15
  31. package/dist/integrations/components/AddConnectionDialog.js.map +1 -1
  32. package/dist/integrations/components/AuthMethodsEditor.d.ts +0 -2
  33. package/dist/integrations/components/AuthMethodsEditor.js +1 -2
  34. package/dist/integrations/components/AuthMethodsEditor.js.map +1 -1
  35. package/dist/integrations/components/ConfirmDialog.d.ts +1 -3
  36. package/dist/integrations/components/ConfirmDialog.js +1 -2
  37. package/dist/integrations/components/ConfirmDialog.js.map +1 -1
  38. package/dist/integrations/components/ConnectionCard.d.ts +0 -2
  39. package/dist/integrations/components/ConnectionCard.js +9 -10
  40. package/dist/integrations/components/ConnectionCard.js.map +1 -1
  41. package/dist/integrations/components/ConnectionModalFrame.d.ts +0 -2
  42. package/dist/integrations/components/ConnectionModalFrame.js +2 -3
  43. package/dist/integrations/components/ConnectionModalFrame.js.map +1 -1
  44. package/dist/integrations/components/ConnectionSharing.d.ts +0 -2
  45. package/dist/integrations/components/ConnectionSharing.js +7 -8
  46. package/dist/integrations/components/ConnectionSharing.js.map +1 -1
  47. package/dist/integrations/components/ConnectionStatusBadge.d.ts +0 -2
  48. package/dist/integrations/components/ConnectionStatusBadge.js +1 -2
  49. package/dist/integrations/components/ConnectionStatusBadge.js.map +1 -1
  50. package/dist/integrations/components/ConnectorSubmissionCard.d.ts +2 -4
  51. package/dist/integrations/components/ConnectorSubmissionCard.js +8 -9
  52. package/dist/integrations/components/ConnectorSubmissionCard.js.map +1 -1
  53. package/dist/integrations/components/ConnectorSubmissionPager.d.ts +1 -2
  54. package/dist/integrations/components/ConnectorSubmissionPager.js +1 -2
  55. package/dist/integrations/components/ConnectorSubmissionPager.js.map +1 -1
  56. package/dist/integrations/components/MailMessageBody.d.ts +5 -0
  57. package/dist/integrations/components/MailMessageBody.js +174 -0
  58. package/dist/integrations/components/MailMessageBody.js.map +1 -0
  59. package/dist/integrations/components/ProviderCard.d.ts +0 -2
  60. package/dist/integrations/components/ProviderCard.js +8 -9
  61. package/dist/integrations/components/ProviderCard.js.map +1 -1
  62. package/dist/integrations/constants/featureFlags.d.ts +0 -1
  63. package/dist/integrations/constants/featureFlags.js +1 -2
  64. package/dist/integrations/constants/featureFlags.js.map +1 -1
  65. package/dist/integrations/constants/permissions.d.ts +0 -1
  66. package/dist/integrations/constants/permissions.js +1 -2
  67. package/dist/integrations/constants/permissions.js.map +1 -1
  68. package/dist/integrations/events/integrations-events.d.ts +0 -1
  69. package/dist/integrations/events/useIntegrationsEventBus.d.ts +0 -2
  70. package/dist/integrations/events/useIntegrationsEventBus.js +1 -2
  71. package/dist/integrations/events/useIntegrationsEventBus.js.map +1 -1
  72. package/dist/integrations/hooks/useConnections.d.ts +3 -14
  73. package/dist/integrations/hooks/useConnections.js +74 -75
  74. package/dist/integrations/hooks/useConnections.js.map +1 -1
  75. package/dist/integrations/hooks/useConnectorSubmissions.d.ts +2 -10
  76. package/dist/integrations/hooks/useConnectorSubmissions.js +23 -24
  77. package/dist/integrations/hooks/useConnectorSubmissions.js.map +1 -1
  78. package/dist/integrations/hooks/useFormatDate.d.ts +0 -1
  79. package/dist/integrations/hooks/useFormatDate.js +1 -2
  80. package/dist/integrations/hooks/useFormatDate.js.map +1 -1
  81. package/dist/integrations/hooks/useFormatLastUsed.d.ts +0 -1
  82. package/dist/integrations/hooks/useFormatLastUsed.js +1 -2
  83. package/dist/integrations/hooks/useFormatLastUsed.js.map +1 -1
  84. package/dist/integrations/hooks/useLabel.d.ts +0 -2
  85. package/dist/integrations/hooks/useLabel.js +1 -2
  86. package/dist/integrations/hooks/useLabel.js.map +1 -1
  87. package/dist/integrations/hooks/useLogs.d.ts +1 -6
  88. package/dist/integrations/hooks/useLogs.js +6 -7
  89. package/dist/integrations/hooks/useLogs.js.map +1 -1
  90. package/dist/integrations/hooks/useMailbox.d.ts +77 -40
  91. package/dist/integrations/hooks/useMailbox.js +113 -35
  92. package/dist/integrations/hooks/useMailbox.js.map +1 -1
  93. package/dist/integrations/hooks/useProviders.d.ts +3 -14
  94. package/dist/integrations/hooks/useProviders.js +42 -43
  95. package/dist/integrations/hooks/useProviders.js.map +1 -1
  96. package/dist/integrations/hooks/useTr.d.ts +0 -1
  97. package/dist/integrations/hooks/useTr.js +1 -2
  98. package/dist/integrations/hooks/useTr.js.map +1 -1
  99. package/dist/integrations/index.d.ts +0 -1
  100. package/dist/integrations/index.js +9 -8
  101. package/dist/integrations/pages/AddConnectionWizard.d.ts +1 -2
  102. package/dist/integrations/pages/AddConnectionWizard.js +291 -306
  103. package/dist/integrations/pages/AddConnectionWizard.js.map +1 -1
  104. package/dist/integrations/pages/ConnectionDetail.d.ts +1 -2
  105. package/dist/integrations/pages/ConnectionDetail.js +241 -246
  106. package/dist/integrations/pages/ConnectionDetail.js.map +1 -1
  107. package/dist/integrations/pages/ConnectionLogs.d.ts +1 -2
  108. package/dist/integrations/pages/ConnectionLogs.js +154 -155
  109. package/dist/integrations/pages/ConnectionLogs.js.map +1 -1
  110. package/dist/integrations/pages/ConnectionsList.d.ts +1 -2
  111. package/dist/integrations/pages/ConnectionsList.js +40 -41
  112. package/dist/integrations/pages/ConnectionsList.js.map +1 -1
  113. package/dist/integrations/pages/ConnectorReviewQueuePage.d.ts +1 -2
  114. package/dist/integrations/pages/ConnectorReviewQueuePage.js +9 -10
  115. package/dist/integrations/pages/ConnectorReviewQueuePage.js.map +1 -1
  116. package/dist/integrations/pages/ConnectorSubmissionsPage.d.ts +1 -2
  117. package/dist/integrations/pages/ConnectorSubmissionsPage.js +138 -139
  118. package/dist/integrations/pages/ConnectorSubmissionsPage.js.map +1 -1
  119. package/dist/integrations/pages/IntegrationsOverview.d.ts +1 -2
  120. package/dist/integrations/pages/IntegrationsOverview.js +35 -36
  121. package/dist/integrations/pages/IntegrationsOverview.js.map +1 -1
  122. package/dist/integrations/pages/IntegrationsSettings.d.ts +1 -2
  123. package/dist/integrations/pages/IntegrationsSettings.js +7 -8
  124. package/dist/integrations/pages/IntegrationsSettings.js.map +1 -1
  125. package/dist/integrations/pages/IntegrationsUserLandingPage.d.ts +1 -2
  126. package/dist/integrations/pages/IntegrationsUserLandingPage.js +1 -2
  127. package/dist/integrations/pages/IntegrationsUserLandingPage.js.map +1 -1
  128. package/dist/integrations/pages/MailboxInbox.d.ts +1 -2
  129. package/dist/integrations/pages/MailboxInbox.js +442 -280
  130. package/dist/integrations/pages/MailboxInbox.js.map +1 -1
  131. package/dist/integrations/pages/ProviderCatalog.d.ts +1 -2
  132. package/dist/integrations/pages/ProviderCatalog.js +107 -108
  133. package/dist/integrations/pages/ProviderCatalog.js.map +1 -1
  134. package/dist/integrations/pages/ProviderDetail.d.ts +1 -2
  135. package/dist/integrations/pages/ProviderDetail.js +21 -22
  136. package/dist/integrations/pages/ProviderDetail.js.map +1 -1
  137. package/dist/integrations/pages/ProviderEditorPage.d.ts +1 -2
  138. package/dist/integrations/pages/ProviderEditorPage.js +261 -264
  139. package/dist/integrations/pages/ProviderEditorPage.js.map +1 -1
  140. package/dist/integrations/providers/IntegrationsProvider.d.ts +0 -2
  141. package/dist/integrations/providers/IntegrationsProvider.js +109 -96
  142. package/dist/integrations/providers/IntegrationsProvider.js.map +1 -1
  143. package/dist/integrations/store/integrationsStore.d.ts +0 -2
  144. package/dist/integrations/store/integrationsStore.js +1 -2
  145. package/dist/integrations/store/integrationsStore.js.map +1 -1
  146. package/dist/integrations/store/mailboxStore.d.ts +3 -2
  147. package/dist/integrations/store/mailboxStore.js +8 -2
  148. package/dist/integrations/store/mailboxStore.js.map +1 -1
  149. package/dist/integrations/translations/en.d.ts +0 -1
  150. package/dist/integrations/types/index.d.ts +0 -1
  151. package/dist/integrations/utils/appearance.d.ts +0 -1
  152. package/dist/integrations/utils/appearance.js +1 -2
  153. package/dist/integrations/utils/appearance.js.map +1 -1
  154. package/dist/integrations/utils/cn.d.ts +0 -2
  155. package/dist/integrations/utils/cn.js +2 -3
  156. package/dist/integrations/utils/cn.js.map +1 -1
  157. package/dist/integrations/utils/constants.d.ts +0 -1
  158. package/dist/integrations/utils/constants.js +1 -2
  159. package/dist/integrations/utils/constants.js.map +1 -1
  160. package/dist/integrations/utils/integrationsHelpers.d.ts +0 -2
  161. package/dist/integrations/utils/integrationsHelpers.js +1 -2
  162. package/dist/integrations/utils/integrationsHelpers.js.map +1 -1
  163. package/dist/integrations/utils/mailHtml.d.ts +31 -0
  164. package/dist/integrations/utils/mailHtml.js +126 -0
  165. package/dist/integrations/utils/mailHtml.js.map +1 -0
  166. package/dist/integrations/utils/mappers.d.ts +0 -2
  167. package/dist/integrations/utils/mappers.js +2 -3
  168. package/dist/integrations/utils/mappers.js.map +1 -1
  169. package/dist/integrations/utils/navigation.d.ts +0 -1
  170. package/dist/integrations/utils/navigation.js +2 -8
  171. package/dist/integrations/utils/navigation.js.map +1 -1
  172. package/dist/integrations/utils/paths.d.ts +0 -1
  173. package/dist/integrations/utils/paths.js +1 -2
  174. package/dist/integrations/utils/paths.js.map +1 -1
  175. package/dist/node_modules/clsx/dist/clsx.js +8 -7
  176. package/dist/node_modules/clsx/dist/clsx.js.map +1 -1
  177. package/dist/node_modules/dompurify/dist/purify.es.js +878 -0
  178. package/dist/node_modules/dompurify/dist/purify.es.js.map +1 -0
  179. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +229 -167
  180. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -1
  181. package/dist/utils/nativeBridge.d.ts +0 -1
  182. package/dist/utils/nativeBridge.js +1 -2
  183. package/package.json +67 -50
  184. package/dist/dev/main.d.ts.map +0 -1
  185. package/dist/generated/global-operations.d.ts.map +0 -1
  186. package/dist/generated/global-types.d.ts.map +0 -1
  187. package/dist/generated/wspace-operations.d.ts.map +0 -1
  188. package/dist/generated/wspace-types.d.ts.map +0 -1
  189. package/dist/index.d.ts.map +0 -1
  190. package/dist/integrations/ConnectSourceDialog.d.ts.map +0 -1
  191. package/dist/integrations/ConnectionsPanel.d.ts.map +0 -1
  192. package/dist/integrations/IntegrationsAdminRoot.d.ts.map +0 -1
  193. package/dist/integrations/IntegrationsAdminRoutes.d.ts.map +0 -1
  194. package/dist/integrations/IntegrationsRoot.d.ts.map +0 -1
  195. package/dist/integrations/IntegrationsUserRoutes.d.ts.map +0 -1
  196. package/dist/integrations/components/AddConnectionDialog.d.ts.map +0 -1
  197. package/dist/integrations/components/AuthMethodsEditor.d.ts.map +0 -1
  198. package/dist/integrations/components/ConfirmDialog.d.ts.map +0 -1
  199. package/dist/integrations/components/ConnectionCard.d.ts.map +0 -1
  200. package/dist/integrations/components/ConnectionModalFrame.d.ts.map +0 -1
  201. package/dist/integrations/components/ConnectionSharing.d.ts.map +0 -1
  202. package/dist/integrations/components/ConnectionStatusBadge.d.ts.map +0 -1
  203. package/dist/integrations/components/ConnectorSubmissionCard.d.ts.map +0 -1
  204. package/dist/integrations/components/ConnectorSubmissionPager.d.ts.map +0 -1
  205. package/dist/integrations/components/ProviderCard.d.ts.map +0 -1
  206. package/dist/integrations/constants/featureFlags.d.ts.map +0 -1
  207. package/dist/integrations/constants/permissions.d.ts.map +0 -1
  208. package/dist/integrations/events/integrations-events.d.ts.map +0 -1
  209. package/dist/integrations/events/useIntegrationsEventBus.d.ts.map +0 -1
  210. package/dist/integrations/hooks/useConnections.d.ts.map +0 -1
  211. package/dist/integrations/hooks/useConnectorSubmissions.d.ts.map +0 -1
  212. package/dist/integrations/hooks/useFormatDate.d.ts.map +0 -1
  213. package/dist/integrations/hooks/useFormatLastUsed.d.ts.map +0 -1
  214. package/dist/integrations/hooks/useLabel.d.ts.map +0 -1
  215. package/dist/integrations/hooks/useLogs.d.ts.map +0 -1
  216. package/dist/integrations/hooks/useMailbox.d.ts.map +0 -1
  217. package/dist/integrations/hooks/useProviders.d.ts.map +0 -1
  218. package/dist/integrations/hooks/useTr.d.ts.map +0 -1
  219. package/dist/integrations/index.d.ts.map +0 -1
  220. package/dist/integrations/pages/AddConnectionWizard.d.ts.map +0 -1
  221. package/dist/integrations/pages/ConnectionDetail.d.ts.map +0 -1
  222. package/dist/integrations/pages/ConnectionLogs.d.ts.map +0 -1
  223. package/dist/integrations/pages/ConnectionsList.d.ts.map +0 -1
  224. package/dist/integrations/pages/ConnectorReviewQueuePage.d.ts.map +0 -1
  225. package/dist/integrations/pages/ConnectorSubmissionsPage.d.ts.map +0 -1
  226. package/dist/integrations/pages/IntegrationsOverview.d.ts.map +0 -1
  227. package/dist/integrations/pages/IntegrationsSettings.d.ts.map +0 -1
  228. package/dist/integrations/pages/IntegrationsUserLandingPage.d.ts.map +0 -1
  229. package/dist/integrations/pages/MailboxInbox.d.ts.map +0 -1
  230. package/dist/integrations/pages/ProviderCatalog.d.ts.map +0 -1
  231. package/dist/integrations/pages/ProviderDetail.d.ts.map +0 -1
  232. package/dist/integrations/pages/ProviderEditorPage.d.ts.map +0 -1
  233. package/dist/integrations/providers/IntegrationsProvider.d.ts.map +0 -1
  234. package/dist/integrations/store/integrationsStore.d.ts.map +0 -1
  235. package/dist/integrations/store/mailboxStore.d.ts.map +0 -1
  236. package/dist/integrations/translations/en.d.ts.map +0 -1
  237. package/dist/integrations/types/index.d.ts.map +0 -1
  238. package/dist/integrations/utils/appearance.d.ts.map +0 -1
  239. package/dist/integrations/utils/cn.d.ts.map +0 -1
  240. package/dist/integrations/utils/constants.d.ts.map +0 -1
  241. package/dist/integrations/utils/integrationsHelpers.d.ts.map +0 -1
  242. package/dist/integrations/utils/mappers.d.ts.map +0 -1
  243. package/dist/integrations/utils/navigation.d.ts.map +0 -1
  244. package/dist/integrations/utils/paths.d.ts.map +0 -1
  245. package/dist/utils/nativeBridge.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"MailboxInbox.js","names":[],"sources":["../../../src/integrations/pages/MailboxInbox.tsx"],"sourcesContent":["import { useEffect, useId, useState, type FormEvent } from 'react';\nimport {\n ArrowLeft,\n Inbox,\n Loader2,\n Mail,\n MailOpen,\n Paperclip,\n PenSquare,\n RefreshCw,\n Reply,\n Search,\n Send,\n X,\n} from 'lucide-react';\nimport { Button, IllustratedEmptyState, PagePurpose } from '@burdenoff/fe-libs/ui';\n\nimport { cn } from '../utils/cn';\nimport { joinPath } from '../utils/paths';\nimport { useTr } from '../hooks/useTr';\nimport { useFormatDate } from '../hooks/useFormatDate';\nimport { useIntegrations } from '../providers/IntegrationsProvider';\nimport {\n MailboxFolder,\n splitRecipients,\n useMailboxAccounts,\n useMailboxMessages,\n useMailboxThread,\n useSendMail,\n useSetMailRead,\n} from '../hooks/useMailbox';\nimport type { MailboxAccount, MailboxMessageSummary } from '../hooks/useMailbox';\nimport { useMailboxStore } from '../store/mailboxStore';\n\ninterface Address {\n name?: string | null;\n email: string;\n}\n\nfunction displayAddress(address: Address | null | undefined): string {\n if (!address) return '';\n return address.name ? `${address.name} <${address.email}>` : address.email;\n}\n\nfunction shortAddress(address: Address | null | undefined): string {\n if (!address) return '';\n return address.name || address.email;\n}\n\nconst FOLDERS: Array<{ value: MailboxFolder; key: string; label: string }> = [\n { value: MailboxFolder.Inbox, key: 'inbox', label: 'Inbox' },\n { value: MailboxFolder.Sent, key: 'sent', label: 'Sent' },\n { value: MailboxFolder.All, key: 'all', label: 'All mail' },\n];\n\n/** Compose a new message or a reply. */\nfunction ComposePanel(props: {\n connectionId: string;\n replyTo?: { messageId: string; to: string; subject: string } | null;\n onClose: () => void;\n onSent: () => void;\n}) {\n const { connectionId, replyTo, onClose, onSent } = props;\n const tr = useTr();\n const ids = useId();\n const { send, sending } = useSendMail();\n const [to, setTo] = useState(replyTo?.to ?? '');\n const [cc, setCc] = useState('');\n const [subject, setSubject] = useState(replyTo?.subject ?? '');\n const [body, setBody] = useState('');\n const [error, setError] = useState<string | null>(null);\n\n const handleSubmit = async (event: FormEvent) => {\n event.preventDefault();\n setError(null);\n try {\n await send({\n connectionId,\n to: splitRecipients(to),\n cc: splitRecipients(cc),\n subject,\n bodyText: body,\n replyToMessageId: replyTo?.messageId,\n });\n onSent();\n } catch (err) {\n setError(\n err instanceof Error\n ? err.message\n : tr('integrations.mailbox.compose.failed', 'Could not send')\n );\n }\n };\n\n const inputClass =\n 'w-full px-3 py-2 border border-border-subtle rounded-lg bg-bg-surface text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary';\n\n return (\n <form\n onSubmit={handleSubmit}\n className=\"rounded-xl border border-border-seam bg-bg-surface p-4 space-y-3\"\n aria-label={\n replyTo\n ? tr('integrations.mailbox.compose.replyTitle', 'Reply')\n : tr('integrations.mailbox.compose.title', 'New message')\n }\n >\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-sm font-semibold text-text-primary\">\n {replyTo\n ? tr('integrations.mailbox.compose.replyTitle', 'Reply')\n : tr('integrations.mailbox.compose.title', 'New message')}\n </h2>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon\"\n onClick={onClose}\n // A pending send must finish before its draft can be dismissed, so it\n // can never close a newer draft when it completes.\n disabled={sending}\n aria-label={tr('integrations.common.close', 'Close')}\n >\n <X size={16} />\n </Button>\n </div>\n <div className=\"space-y-1\">\n <label htmlFor={`${ids}-to`} className=\"text-xs font-medium text-text-secondary\">\n {tr('integrations.mailbox.compose.to', 'To')}\n </label>\n <input\n id={`${ids}-to`}\n type=\"text\"\n value={to}\n onChange={(e) => setTo(e.target.value)}\n placeholder={tr(\n 'integrations.mailbox.compose.toPlaceholder',\n 'name@example.com, another@example.com'\n )}\n className={inputClass}\n required\n />\n </div>\n <div className=\"space-y-1\">\n <label htmlFor={`${ids}-cc`} className=\"text-xs font-medium text-text-secondary\">\n {tr('integrations.mailbox.compose.cc', 'Cc')}\n </label>\n <input\n id={`${ids}-cc`}\n type=\"text\"\n value={cc}\n onChange={(e) => setCc(e.target.value)}\n className={inputClass}\n />\n </div>\n {!replyTo && (\n <div className=\"space-y-1\">\n <label htmlFor={`${ids}-subject`} className=\"text-xs font-medium text-text-secondary\">\n {tr('integrations.mailbox.compose.subject', 'Subject')}\n </label>\n <input\n id={`${ids}-subject`}\n type=\"text\"\n value={subject}\n onChange={(e) => setSubject(e.target.value)}\n maxLength={998}\n className={inputClass}\n />\n </div>\n )}\n <div className=\"space-y-1\">\n <label htmlFor={`${ids}-body`} className=\"text-xs font-medium text-text-secondary\">\n {tr('integrations.mailbox.compose.body', 'Message')}\n </label>\n <textarea\n id={`${ids}-body`}\n value={body}\n onChange={(e) => setBody(e.target.value)}\n rows={8}\n className={cn(inputClass, 'resize-y')}\n required\n />\n </div>\n {error && (\n <p role=\"alert\" className=\"text-sm text-status-error-text\">\n {error}\n </p>\n )}\n <div className=\"flex justify-end gap-2\">\n <Button type=\"button\" variant=\"outline\" onClick={onClose} disabled={sending}>\n {tr('integrations.common.cancel', 'Cancel')}\n </Button>\n <Button type=\"submit\" disabled={sending || !body.trim() || !to.trim()}>\n {sending ? <Loader2 size={16} className=\"animate-spin\" /> : <Send size={16} />}\n {tr('integrations.mailbox.compose.send', 'Send')}\n </Button>\n </div>\n </form>\n );\n}\n\n/** One conversation, oldest message first, with a reply box. */\nfunction ThreadView(props: {\n connectionId: string;\n threadId: string;\n /** The connected account's own address, used to pick the reply recipient. */\n accountEmail: string | null;\n onBack: () => void;\n}) {\n const { connectionId, threadId, accountEmail, onBack } = props;\n const tr = useTr();\n const formatDate = useFormatDate();\n const { thread, loading, error, refetch } = useMailboxThread(connectionId, threadId);\n // The parent keys this view by thread id, so reply / notice state starts\n // fresh for every conversation without resetting it in an effect.\n const [replyOpen, setReplyOpen] = useState(false);\n const [sentNotice, setSentNotice] = useState(false);\n\n if (loading && !thread) {\n return (\n <div className=\"flex items-center justify-center py-16\">\n <Loader2 className=\"size-6 animate-spin text-primary\" />\n </div>\n );\n }\n if (error || !thread) {\n return (\n <div className=\"p-6 space-y-3 text-center\">\n <p role=\"alert\" className=\"text-sm text-status-error-text\">\n {error?.message ?? tr('integrations.mailbox.thread.notFound', 'Conversation not found')}\n </p>\n <div className=\"flex flex-wrap justify-center gap-2\">\n <Button variant=\"ghost\" onClick={onBack}>\n <ArrowLeft size={16} /> {tr('integrations.common.back', 'Back')}\n </Button>\n <Button variant=\"outline\" onClick={() => refetch()}>\n <RefreshCw size={16} /> {tr('integrations.mailbox.actions.retry', 'Try again')}\n </Button>\n </div>\n </div>\n );\n }\n\n const last = thread.messages[thread.messages.length - 1];\n const ownAddress = accountEmail?.trim().toLowerCase() ?? null;\n // Replying to a message the connected account sent itself (from Sent, or a\n // follow-up) goes to that message's recipients, never back to the account.\n const replyRecipients = last\n ? ownAddress && last.from?.email.toLowerCase() === ownAddress\n ? last.to\n .map((address) => address.email)\n .filter((email) => email.toLowerCase() !== ownAddress)\n : [last.from?.email ?? '']\n : [];\n return (\n <div className=\"space-y-4\" data-testid=\"mailbox-thread\">\n <div className=\"flex items-start gap-2\">\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className=\"lg:hidden\"\n onClick={onBack}\n aria-label={tr('integrations.common.back', 'Back')}\n >\n <ArrowLeft size={18} />\n </Button>\n <h2 className=\"text-lg font-semibold text-text-primary break-words\">\n {thread.subject || tr('integrations.mailbox.noSubject', '(no subject)')}\n </h2>\n </div>\n {thread.messages.map((message) => (\n <article\n key={message.id}\n className=\"rounded-xl border border-border-subtle bg-bg-surface p-4 space-y-2\"\n >\n <header className=\"flex flex-wrap items-baseline justify-between gap-2\">\n <div className=\"min-w-0\">\n <p className=\"text-sm font-medium text-text-primary break-all\">\n {displayAddress(message.from)}\n </p>\n <p className=\"text-xs text-text-secondary break-all\">\n {tr('integrations.mailbox.thread.to', 'To')}:{' '}\n {message.to.map(displayAddress).join(', ')}\n {message.cc.length > 0 &&\n ` · ${tr('integrations.mailbox.thread.cc', 'Cc')}: ${message.cc.map(displayAddress).join(', ')}`}\n </p>\n </div>\n <div className=\"flex items-center gap-2 text-xs text-text-tertiary\">\n {message.hasAttachments && (\n <Paperclip\n size={14}\n aria-label={tr('integrations.mailbox.attachments', 'Has attachments')}\n />\n )}\n {message.receivedAt && (\n <time dateTime={message.receivedAt}>{formatDate(message.receivedAt)}</time>\n )}\n </div>\n </header>\n <div className=\"whitespace-pre-wrap break-words text-sm text-text-primary\">\n {message.bodyText}\n </div>\n </article>\n ))}\n {sentNotice && (\n <p role=\"status\" className=\"text-sm text-status-success-text\">\n {tr('integrations.mailbox.compose.sent', 'Message sent')}\n </p>\n )}\n {last &&\n (replyOpen ? (\n <ComposePanel\n connectionId={connectionId}\n replyTo={{\n messageId: last.id,\n to: replyRecipients.filter(Boolean).join(', '),\n subject: thread.subject,\n }}\n onClose={() => setReplyOpen(false)}\n onSent={() => {\n setReplyOpen(false);\n setSentNotice(true);\n void refetch();\n }}\n />\n ) : (\n <Button variant=\"outline\" onClick={() => setReplyOpen(true)}>\n <Reply size={16} /> {tr('integrations.mailbox.actions.reply', 'Reply')}\n </Button>\n ))}\n </div>\n );\n}\n\n/** One page of messages in the selected folder, with paging. */\nfunction MessageList(props: {\n messages: MailboxMessageSummary[];\n loading: boolean;\n error: { message: string } | undefined;\n refetch: () => unknown;\n folder: MailboxFolder;\n threadId: string | null;\n hasPrevious: boolean;\n nextPageToken: string | null;\n onOpen: (threadId: string, messageId: string, unread: boolean) => void;\n onPrevious: () => void;\n onNext: (token: string) => void;\n}) {\n const {\n messages,\n loading,\n error,\n refetch,\n folder,\n threadId,\n hasPrevious,\n nextPageToken,\n onOpen,\n onPrevious,\n onNext,\n } = props;\n const tr = useTr();\n const formatDate = useFormatDate();\n return (\n <>\n {error ? (\n <div className=\"p-6 text-center space-y-3\">\n <p role=\"alert\" className=\"text-sm text-status-error-text\">\n {error.message}\n </p>\n <Button variant=\"outline\" onClick={() => refetch()}>\n <RefreshCw size={16} /> {tr('integrations.mailbox.actions.retry', 'Try again')}\n </Button>\n </div>\n ) : loading && messages.length === 0 ? (\n <div className=\"flex items-center justify-center py-16\">\n <Loader2 className=\"size-6 animate-spin text-primary\" />\n </div>\n ) : messages.length === 0 ? (\n <p className=\"p-6 text-sm text-text-secondary text-center\">\n {tr('integrations.mailbox.list.empty', 'No messages here')}\n </p>\n ) : (\n <ul className=\"divide-y divide-border-subtle\" data-testid=\"mailbox-message-list\">\n {messages.map((message) => (\n <li key={message.id}>\n <button\n type=\"button\"\n onClick={() => onOpen(message.threadId, message.id, message.isUnread)}\n aria-current={threadId === message.threadId ? 'true' : undefined}\n className={cn(\n 'w-full text-left px-4 py-3 transition-colors hover:bg-accent focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/30',\n threadId === message.threadId && 'bg-accent'\n )}\n >\n <div className=\"flex items-center justify-between gap-2\">\n <span\n className={cn(\n 'truncate text-sm',\n message.isUnread ? 'font-semibold text-text-primary' : 'text-text-secondary'\n )}\n >\n {folder === MailboxFolder.Sent\n ? message.to.map(shortAddress).join(', ')\n : shortAddress(message.from)}\n </span>\n <span className=\"flex shrink-0 items-center gap-1 text-xs text-text-tertiary\">\n {message.hasAttachments && <Paperclip size={12} />}\n {message.isUnread ? <Mail size={12} /> : <MailOpen size={12} />}\n {message.receivedAt ? formatDate(message.receivedAt) : ''}\n </span>\n </div>\n <p\n className={cn(\n 'truncate text-sm',\n message.isUnread ? 'font-medium text-text-primary' : 'text-text-primary'\n )}\n >\n {message.subject || tr('integrations.mailbox.noSubject', '(no subject)')}\n </p>\n <p className=\"truncate text-xs text-text-secondary\">{message.snippet}</p>\n </button>\n </li>\n ))}\n </ul>\n )}\n {(hasPrevious || nextPageToken) && (\n <div className=\"flex justify-between gap-2 border-t border-border-subtle p-3\">\n <Button\n variant=\"outline\"\n size=\"sm\"\n disabled={!hasPrevious || loading}\n onClick={onPrevious}\n >\n {tr('integrations.common.previous', 'Previous')}\n </Button>\n <Button\n variant=\"outline\"\n size=\"sm\"\n disabled={!nextPageToken || loading}\n onClick={() => nextPageToken && onNext(nextPageToken)}\n >\n {tr('integrations.common.next', 'Next')}\n </Button>\n </div>\n )}\n </>\n );\n}\n\n/** Shown until a Gmail or Outlook connection exists (or when listing them failed). */\nfunction MailboxEmptyState(props: { errorMessage: string | null }) {\n const tr = useTr();\n const { basePath = '/', navigate } = useIntegrations();\n const connectPath = joinPath(basePath, 'providers');\n return (\n <div className=\"space-y-6 p-6 max-w-5xl mx-auto\">\n <PagePurpose icon={<Mail size={16} />}>\n {tr(\n 'integrations.mailbox.purpose',\n 'Read and send mail from your own Gmail or Outlook account without leaving Workspaces. Only you can open your mailbox; sharing a connection never shares your mail.'\n )}\n </PagePurpose>\n {props.errorMessage ? (\n <p role=\"alert\" className=\"text-sm text-status-error-text text-center\">\n {props.errorMessage}\n </p>\n ) : (\n <IllustratedEmptyState\n illustration=\"empty-data\"\n title={tr('integrations.mailbox.empty.title', 'Connect a mailbox')}\n description={tr(\n 'integrations.mailbox.empty.description',\n 'Connect Google Gmail or Microsoft Outlook from Providers, then come back here to read and send mail.'\n )}\n action={\n <Button onClick={() => navigate?.(connectPath)}>\n <Mail size={16} />{' '}\n {tr('integrations.mailbox.empty.action', 'Connect Gmail or Outlook')}\n </Button>\n }\n />\n )}\n </div>\n );\n}\n\n/** Title, mailbox switcher and the Compose action. */\nfunction MailboxHeader(props: { accounts: MailboxAccount[]; connectionId: string | null }) {\n const { accounts, connectionId } = props;\n const tr = useTr();\n const ids = useId();\n const composing = useMailboxStore((s) => s.composing);\n const selectConnection = useMailboxStore((s) => s.selectConnection);\n const startCompose = useMailboxStore((s) => s.startCompose);\n const account = accounts.find((a) => a.connectionId === connectionId) ?? null;\n return (\n <div className=\"rounded-xl border border-border-seam bg-accent-wash p-4 sm:p-6\">\n <div className=\"flex flex-wrap items-center justify-between gap-4\">\n <div className=\"flex items-center gap-3\">\n <div className=\"p-2.5 rounded-lg bg-action-primary-bg/10\">\n <Inbox size={24} className=\"text-primary\" />\n </div>\n <div>\n <h1 className=\"text-2xl font-bold text-text-primary\">\n {tr('integrations.mailbox.title', 'Inbox')}\n </h1>\n <p className=\"text-sm text-text-secondary\">\n {account?.emailAddress ??\n account?.name ??\n tr('integrations.mailbox.subtitle', 'Your connected mail')}\n </p>\n </div>\n </div>\n <div className=\"flex flex-wrap items-center gap-2\">\n {accounts.length > 1 && (\n <>\n <label htmlFor={`${ids}-account`} className=\"sr-only\">\n {tr('integrations.mailbox.account', 'Mailbox')}\n </label>\n <select\n id={`${ids}-account`}\n value={connectionId ?? ''}\n // An open draft stays bound to the mailbox it was started in.\n disabled={composing}\n onChange={(e) => selectConnection(e.target.value)}\n className=\"px-3 py-2 border border-border-subtle rounded-lg bg-bg-surface text-sm text-text-primary\"\n >\n {accounts.map((a) => (\n <option key={a.connectionId} value={a.connectionId}>\n {a.emailAddress ?? a.name}\n </option>\n ))}\n </select>\n </>\n )}\n <Button onClick={startCompose}>\n <PenSquare size={16} /> {tr('integrations.mailbox.actions.compose', 'Compose')}\n </Button>\n </div>\n </div>\n </div>\n );\n}\n\n/** Folder switcher, search box and refresh. */\nfunction MailboxToolbar(props: { loading: boolean; onRefresh: () => void }) {\n const tr = useTr();\n const folder = useMailboxStore((s) => s.folder);\n const query = useMailboxStore((s) => s.query);\n const selectFolder = useMailboxStore((s) => s.selectFolder);\n const search = useMailboxStore((s) => s.search);\n // The text being typed is a form draft; it becomes the query on submit.\n const [searchInput, setSearchInput] = useState(query);\n return (\n <div className=\"flex flex-col sm:flex-row gap-3\">\n <div\n className=\"flex gap-1 rounded-lg border border-border-subtle bg-bg-surface p-1\"\n role=\"group\"\n aria-label={tr('integrations.mailbox.folders.ariaLabel', 'Folders')}\n >\n {FOLDERS.map((f) => (\n <button\n key={f.value}\n type=\"button\"\n aria-pressed={folder === f.value}\n onClick={() => selectFolder(f.value)}\n className={cn(\n 'px-3 py-1.5 text-sm rounded-md transition-colors',\n folder === f.value\n ? 'bg-action-primary-bg text-action-primary-text'\n : 'text-text-secondary hover:bg-accent'\n )}\n >\n {tr(`integrations.mailbox.folders.${f.key}`, f.label)}\n </button>\n ))}\n </div>\n <form\n className=\"flex-1 relative\"\n onSubmit={(e) => {\n e.preventDefault();\n search(searchInput);\n }}\n >\n <Search\n size={16}\n className=\"absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary\"\n />\n <input\n type=\"search\"\n value={searchInput}\n onChange={(e) => setSearchInput(e.target.value)}\n maxLength={500}\n aria-label={tr('integrations.mailbox.search.ariaLabel', 'Search mail')}\n placeholder={tr('integrations.mailbox.search.placeholder', 'Search mail')}\n className=\"w-full pl-9 pr-3 py-2 border border-border-subtle rounded-lg bg-bg-surface text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary\"\n />\n </form>\n <Button variant=\"outline\" onClick={props.onRefresh} disabled={props.loading}>\n <RefreshCw size={16} className={cn(props.loading && 'animate-spin')} />{' '}\n {tr('integrations.mailbox.actions.refresh', 'Refresh')}\n </Button>\n </div>\n );\n}\n\n/** Message list and the reading / compose pane for one connected mailbox. */\nfunction MailboxWorkspace(props: { accounts: MailboxAccount[] }) {\n const { accounts } = props;\n const tr = useTr();\n const state = useMailboxStore();\n const resetMailbox = useMailboxStore((s) => s.reset);\n const setRead = useSetMailRead();\n\n // Leaving the Inbox (or switching workspace) starts the next visit clean.\n useEffect(() => resetMailbox, [resetMailbox]);\n\n // Default to the first connected mailbox until the person picks another one;\n // a selection that is no longer connected falls back the same way.\n const account =\n accounts.find((a) => a.connectionId === state.selectedConnectionId) ?? accounts[0] ?? null;\n const connectionId = account?.connectionId ?? null;\n\n const { messages, nextPageToken, loading, error, refetch } = useMailboxMessages({\n connectionId,\n folder: state.folder,\n query: state.query,\n pageToken: state.pageTokens[state.pageTokens.length - 1] ?? null,\n });\n\n const openThread = (id: string, messageId: string, unread: boolean) => {\n state.openThread(id);\n if (unread && connectionId) {\n // Best effort: a failed mark-read must not block reading.\n setRead(connectionId, messageId, true).then(\n () => refetch(),\n () => undefined\n );\n }\n };\n\n const detailOpen = Boolean(state.threadId || state.composing);\n\n return (\n <div className=\"space-y-4 p-4 sm:p-6 max-w-7xl mx-auto\" data-testid=\"mailbox-inbox\">\n <MailboxHeader accounts={accounts} connectionId={connectionId} />\n <MailboxToolbar loading={loading} onRefresh={() => void refetch()} />\n\n {state.sentNotice && (\n <p role=\"status\" className=\"text-sm text-status-success-text\">\n {tr('integrations.mailbox.compose.sent', 'Message sent')}\n </p>\n )}\n\n <div className=\"grid gap-4 lg:grid-cols-[minmax(0,2fr)_minmax(0,3fr)]\">\n <section\n aria-label={tr('integrations.mailbox.list.ariaLabel', 'Messages')}\n className={cn(\n 'rounded-xl border border-border-subtle bg-bg-surface overflow-hidden',\n detailOpen && 'hidden lg:block'\n )}\n >\n <MessageList\n messages={messages}\n loading={loading}\n error={error}\n refetch={refetch}\n folder={state.folder}\n threadId={state.threadId}\n hasPrevious={state.pageTokens.length > 1}\n nextPageToken={nextPageToken}\n onOpen={openThread}\n onPrevious={state.previousPage}\n onNext={state.nextPage}\n />\n </section>\n\n <section className={cn(!detailOpen && 'hidden lg:block')}>\n {state.composing && connectionId ? (\n <ComposePanel\n connectionId={connectionId}\n onClose={state.closeCompose}\n onSent={() => {\n state.composeSent();\n if (state.folder === MailboxFolder.Sent) void refetch();\n }}\n />\n ) : state.threadId && connectionId ? (\n <ThreadView\n key={`${connectionId}:${state.threadId}`}\n connectionId={connectionId}\n threadId={state.threadId}\n accountEmail={account?.emailAddress ?? null}\n onBack={state.closeThread}\n />\n ) : (\n <div className=\"rounded-xl border border-dashed border-border-subtle p-10 text-center text-sm text-text-secondary\">\n {tr('integrations.mailbox.thread.placeholder', 'Select a message to read it')}\n </div>\n )}\n </section>\n </div>\n </div>\n );\n}\n\n/**\n * Inbox — read, search, reply to and send mail from the caller's own Gmail or\n * Outlook account, connected as an integration (BOFF-4422). Workspaces does not\n * host mail; only the connection owner can open a mailbox.\n */\nexport function MailboxInbox() {\n const { accounts, answered, error } = useMailboxAccounts();\n\n // Until the accounts query has actually answered (it waits for the\n // workspace context), an empty list means \"not asked yet\", not \"none\".\n if (!answered && !error) {\n return (\n <div className=\"flex items-center justify-center py-24\" data-testid=\"mailbox-loading\">\n <Loader2 className=\"size-6 animate-spin text-primary\" />\n </div>\n );\n }\n if (accounts.length === 0) {\n return <MailboxEmptyState errorMessage={error?.message ?? null} />;\n }\n return <MailboxWorkspace accounts={accounts} />;\n}\n"],"mappings":";;;;;;;;;;;;;AAuCA,SAAS,EAAe,G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CAAC,KAAY,CAAC,IAEd,kBAAC,OAAD;EAAK,WAAU;EAAyC,eAAY;YAClE,kBAAC,GAAD,EAAS,WAAU,oCAAqC,CAAA;EACpD,CAAA,GAGN,EAAS,WAAW,IACf,kBAAC,GAAD,EAAmB,cAAc,GAAO,WAAW,MAAQ,CAAA,GAE7D,kBAAC,GAAD,EAA4B,aAAY,CAAA"}
1
+ {"version":3,"file":"MailboxInbox.js","names":["_Fragment","displayAddress","address","shortAddress","FOLDERS","MailboxFolder","ComposePanel","props","tr","useTr","ids","useId","useSendMail","upload","useUploadMailAttachment","fileInput","useRef","attachments","setAttachments","useState","uploading","setUploading","capBytes","MAILBOX_SEND_ATTACHMENT_BYTES","kind","capMb","addFiles","picked","list","setError","sum","f","file","uploaded","current","err","to","setTo","replyTo","cc","setCc","subject","setSubject","body","setBody","error","handleSubmit","event","send","splitRecipients","a","onSent","inputClass","Button","onClose","sending","X","cn","Loader2","Paperclip","formatBytes","Send","ThreadView","formatDate","useFormatDate","useMailboxThread","connectionId","threadId","useMailboxThreadActions","confirmTrash","setConfirmTrash","actionError","setActionError","runAction","action","archiveThread","trashThread","onRemoved","replyOpen","setReplyOpen","sentNotice","setSentNotice","loading","thread","onBack","ArrowLeft","refetch","RefreshCw","last","ownAddress","accountEmail","replyRecipients","email","busy","Archive","Trash2","ConfirmDialog","MailboxKind","message","MailMessageBody","Reply","MessageList","Fragment","messages","onOpen","folder","Mail","MailOpen","hasPrevious","nextPageToken","onPrevious","onNext","MailboxEmptyState","useIntegrations","connectPath","joinPath","basePath","PagePurpose","IllustratedEmptyState","navigate","MailboxHeader","composing","useMailboxStore","s","selectConnection","startCompose","account","accounts","Inbox","PenSquare","FOLDER_BUTTON_LABELS","MailboxToolbar","folderId","query","selectFolder","selectLabel","search","useMailboxLabels","extraLabels","labels","l","MailboxLabelKind","searchInput","setSearchInput","label","Search","MailboxWorkspace","state","resetMailbox","setRead","useSetMailRead","notice","setNotice","useMailboxMessages","openThread","id","unread","messageId","detailOpen","MailboxInbox","useMailboxAccounts","answered"],"sources":["../../../src/integrations/pages/MailboxInbox.tsx"],"sourcesContent":["import { useEffect, useId, useRef, useState, type FormEvent } from 'react';\nimport {\n Archive,\n ArrowLeft,\n Inbox,\n Loader2,\n Mail,\n MailOpen,\n Paperclip,\n PenSquare,\n RefreshCw,\n Reply,\n Search,\n Send,\n Trash2,\n X,\n} from 'lucide-react';\nimport { Button, IllustratedEmptyState, PagePurpose } from '@burdenoff/fe-libs/ui';\n\nimport { cn } from '../utils/cn';\nimport { joinPath } from '../utils/paths';\nimport { useTr } from '../hooks/useTr';\nimport { useFormatDate } from '../hooks/useFormatDate';\nimport { useIntegrations } from '../providers/IntegrationsProvider';\nimport {\n MAILBOX_MAX_ATTACHMENTS,\n MAILBOX_SEND_ATTACHMENT_BYTES,\n MailboxFolder,\n MailboxKind,\n MailboxLabelKind,\n splitRecipients,\n useMailboxAccounts,\n useMailboxLabels,\n useMailboxMessages,\n useMailboxThread,\n useMailboxThreadActions,\n useSendMail,\n useSetMailRead,\n useUploadMailAttachment,\n} from '../hooks/useMailbox';\nimport type {\n MailboxAccount,\n MailboxMessageSummary,\n PendingMailAttachment,\n} from '../hooks/useMailbox';\nimport { useMailboxStore } from '../store/mailboxStore';\nimport { ConfirmDialog } from '../components/ConfirmDialog';\nimport { MailMessageBody } from '../components/MailMessageBody';\nimport { formatBytes } from '../utils/mailHtml';\n\ninterface Address {\n name?: string | null;\n email: string;\n}\n\nfunction displayAddress(address: Address | null | undefined): string {\n if (!address) return '';\n return address.name ? `${address.name} <${address.email}>` : address.email;\n}\n\nfunction shortAddress(address: Address | null | undefined): string {\n if (!address) return '';\n return address.name || address.email;\n}\n\nconst FOLDERS: Array<{ value: MailboxFolder; key: string; label: string }> = [\n { value: MailboxFolder.Inbox, key: 'inbox', label: 'Inbox' },\n { value: MailboxFolder.Sent, key: 'sent', label: 'Sent' },\n { value: MailboxFolder.All, key: 'all', label: 'All mail' },\n];\n\n/** Compose a new message or a reply. */\nfunction ComposePanel(props: {\n connectionId: string;\n kind: MailboxKind;\n replyTo?: { messageId: string; to: string; subject: string } | null;\n onClose: () => void;\n onSent: () => void;\n}) {\n const { connectionId, kind, replyTo, onClose, onSent } = props;\n const tr = useTr();\n const ids = useId();\n const { send, sending } = useSendMail();\n const upload = useUploadMailAttachment();\n const fileInput = useRef<HTMLInputElement | null>(null);\n const [attachments, setAttachments] = useState<PendingMailAttachment[]>([]);\n const [uploading, setUploading] = useState(false);\n const capBytes = MAILBOX_SEND_ATTACHMENT_BYTES[kind];\n const capMb = Math.round((capBytes / (1024 * 1024)) * 10) / 10;\n\n const addFiles = async (list: FileList | null) => {\n const picked = Array.from(list ?? []);\n if (fileInput.current) fileInput.current.value = '';\n if (picked.length === 0) return;\n setError(null);\n if (attachments.length + picked.length > MAILBOX_MAX_ATTACHMENTS) {\n setError(\n tr(\n 'integrations.mailbox.compose.tooManyFiles',\n 'A message can have at most {{max}} attachments',\n { max: MAILBOX_MAX_ATTACHMENTS }\n )\n );\n return;\n }\n const total = [...attachments, ...picked].reduce((sum, f) => sum + f.size, 0);\n if (total > capBytes) {\n setError(\n tr(\n 'integrations.mailbox.compose.filesTooLarge',\n 'Attachments on one message can total at most {{max}} MB with this mailbox',\n { max: capMb }\n )\n );\n return;\n }\n setUploading(true);\n try {\n for (const file of picked) {\n const uploaded = await upload(file);\n setAttachments((current) => [...current, uploaded]);\n }\n } catch (err) {\n setError(\n err instanceof Error\n ? err.message\n : tr('integrations.mailbox.compose.uploadFailed', 'Could not upload the file')\n );\n } finally {\n setUploading(false);\n }\n };\n const [to, setTo] = useState(replyTo?.to ?? '');\n const [cc, setCc] = useState('');\n const [subject, setSubject] = useState(replyTo?.subject ?? '');\n const [body, setBody] = useState('');\n const [error, setError] = useState<string | null>(null);\n\n const handleSubmit = async (event: FormEvent) => {\n event.preventDefault();\n setError(null);\n try {\n await send({\n connectionId,\n to: splitRecipients(to),\n cc: splitRecipients(cc),\n subject,\n bodyText: body,\n replyToMessageId: replyTo?.messageId,\n attachmentFileIds: attachments.map((a) => a.fileId),\n });\n onSent();\n } catch (err) {\n setError(\n err instanceof Error\n ? err.message\n : tr('integrations.mailbox.compose.failed', 'Could not send')\n );\n }\n };\n\n const inputClass =\n 'w-full px-3 py-2 border border-border-subtle rounded-lg bg-bg-surface text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary';\n\n return (\n <form\n onSubmit={handleSubmit}\n className=\"rounded-xl border border-border-seam bg-bg-surface p-4 space-y-3\"\n aria-label={\n replyTo\n ? tr('integrations.mailbox.compose.replyTitle', 'Reply')\n : tr('integrations.mailbox.compose.title', 'New message')\n }\n >\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-sm font-semibold text-text-primary\">\n {replyTo\n ? tr('integrations.mailbox.compose.replyTitle', 'Reply')\n : tr('integrations.mailbox.compose.title', 'New message')}\n </h2>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon\"\n onClick={onClose}\n // A pending send must finish before its draft can be dismissed, so it\n // can never close a newer draft when it completes.\n disabled={sending}\n aria-label={tr('integrations.common.close', 'Close')}\n >\n <X size={16} />\n </Button>\n </div>\n <div className=\"space-y-1\">\n <label htmlFor={`${ids}-to`} className=\"text-xs font-medium text-text-secondary\">\n {tr('integrations.mailbox.compose.to', 'To')}\n </label>\n <input\n id={`${ids}-to`}\n type=\"text\"\n value={to}\n onChange={(e) => setTo(e.target.value)}\n placeholder={tr(\n 'integrations.mailbox.compose.toPlaceholder',\n 'name@example.com, another@example.com'\n )}\n className={inputClass}\n required\n />\n </div>\n <div className=\"space-y-1\">\n <label htmlFor={`${ids}-cc`} className=\"text-xs font-medium text-text-secondary\">\n {tr('integrations.mailbox.compose.cc', 'Cc')}\n </label>\n <input\n id={`${ids}-cc`}\n type=\"text\"\n value={cc}\n onChange={(e) => setCc(e.target.value)}\n className={inputClass}\n />\n </div>\n {!replyTo && (\n <div className=\"space-y-1\">\n <label htmlFor={`${ids}-subject`} className=\"text-xs font-medium text-text-secondary\">\n {tr('integrations.mailbox.compose.subject', 'Subject')}\n </label>\n <input\n id={`${ids}-subject`}\n type=\"text\"\n value={subject}\n onChange={(e) => setSubject(e.target.value)}\n maxLength={998}\n className={inputClass}\n />\n </div>\n )}\n <div className=\"space-y-1\">\n <label htmlFor={`${ids}-body`} className=\"text-xs font-medium text-text-secondary\">\n {tr('integrations.mailbox.compose.body', 'Message')}\n </label>\n <textarea\n id={`${ids}-body`}\n value={body}\n onChange={(e) => setBody(e.target.value)}\n rows={8}\n className={cn(inputClass, 'resize-y')}\n required\n />\n </div>\n <div className=\"space-y-2\">\n <input\n ref={fileInput}\n id={`${ids}-files`}\n type=\"file\"\n multiple\n aria-label={tr('integrations.mailbox.compose.attach', 'Attach files')}\n tabIndex={-1}\n className=\"sr-only\"\n onChange={(e) => void addFiles(e.target.files)}\n disabled={sending || uploading}\n />\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n disabled={sending || uploading || attachments.length >= MAILBOX_MAX_ATTACHMENTS}\n onClick={() => fileInput.current?.click()}\n >\n {uploading ? <Loader2 size={14} className=\"animate-spin\" /> : <Paperclip size={14} />}\n {uploading\n ? tr('integrations.mailbox.compose.uploading', 'Uploading…')\n : tr('integrations.mailbox.compose.attach', 'Attach files')}\n </Button>\n <p className=\"text-xs text-text-tertiary\">\n {tr(\n 'integrations.mailbox.compose.attachHint',\n 'Up to {{count}} files, {{max}} MB in total. A copy is kept in your Files.',\n { count: MAILBOX_MAX_ATTACHMENTS, max: capMb }\n )}\n </p>\n {attachments.length > 0 && (\n <ul className=\"flex flex-wrap gap-2\" data-testid=\"mailbox-compose-attachments\">\n {attachments.map((file) => (\n <li\n key={file.fileId}\n className=\"flex items-center gap-1 rounded-full border border-border-subtle px-3 py-1 text-xs text-text-primary\"\n >\n <Paperclip size={12} />\n <span className=\"max-w-48 truncate\">{file.name}</span>\n <span className=\"text-text-tertiary\">{formatBytes(file.size)}</span>\n <button\n type=\"button\"\n className=\"ml-1 rounded-full p-0.5 hover:bg-accent\"\n disabled={sending}\n aria-label={tr('integrations.mailbox.compose.removeFile', 'Remove {{name}}', {\n name: file.name,\n })}\n onClick={() =>\n setAttachments((current) => current.filter((f) => f.fileId !== file.fileId))\n }\n >\n <X size={12} />\n </button>\n </li>\n ))}\n </ul>\n )}\n </div>\n {error && (\n <p role=\"alert\" className=\"text-sm text-status-error-text\">\n {error}\n </p>\n )}\n <div className=\"flex justify-end gap-2\">\n <Button type=\"button\" variant=\"outline\" onClick={onClose} disabled={sending}>\n {tr('integrations.common.cancel', 'Cancel')}\n </Button>\n <Button type=\"submit\" disabled={sending || uploading || !body.trim() || !to.trim()}>\n {sending ? <Loader2 size={16} className=\"animate-spin\" /> : <Send size={16} />}\n {tr('integrations.mailbox.compose.send', 'Send')}\n </Button>\n </div>\n </form>\n );\n}\n\n/** One conversation, oldest message first, with a reply box. */\nfunction ThreadView(props: {\n connectionId: string;\n kind: MailboxKind;\n threadId: string;\n /** The connected account's own address, used to pick the reply recipient. */\n accountEmail: string | null;\n onBack: () => void;\n /** Called after the conversation was archived or moved to the trash. */\n onRemoved: (action: 'archived' | 'trashed') => void;\n}) {\n const { connectionId, kind, threadId, accountEmail, onBack, onRemoved } = props;\n const tr = useTr();\n const formatDate = useFormatDate();\n const { thread, loading, error, refetch } = useMailboxThread(connectionId, threadId);\n const { archiveThread, trashThread, busy } = useMailboxThreadActions();\n const [confirmTrash, setConfirmTrash] = useState(false);\n const [actionError, setActionError] = useState<string | null>(null);\n\n const runAction = async (action: 'archived' | 'trashed') => {\n setActionError(null);\n try {\n if (action === 'archived') await archiveThread(connectionId, threadId);\n else await trashThread(connectionId, threadId);\n setConfirmTrash(false);\n onRemoved(action);\n } catch (err) {\n setConfirmTrash(false);\n setActionError(\n err instanceof Error\n ? err.message\n : tr('integrations.mailbox.actions.failed', 'That did not work. Try again.')\n );\n }\n };\n // The parent keys this view by thread id, so reply / notice state starts\n // fresh for every conversation without resetting it in an effect.\n const [replyOpen, setReplyOpen] = useState(false);\n const [sentNotice, setSentNotice] = useState(false);\n\n if (loading && !thread) {\n return (\n <div className=\"flex items-center justify-center py-16\">\n <Loader2 className=\"size-6 animate-spin text-primary\" />\n </div>\n );\n }\n if (error || !thread) {\n return (\n <div className=\"p-6 space-y-3 text-center\">\n <p role=\"alert\" className=\"text-sm text-status-error-text\">\n {error?.message ?? tr('integrations.mailbox.thread.notFound', 'Conversation not found')}\n </p>\n <div className=\"flex flex-wrap justify-center gap-2\">\n <Button variant=\"ghost\" onClick={onBack}>\n <ArrowLeft size={16} /> {tr('integrations.common.back', 'Back')}\n </Button>\n <Button variant=\"outline\" onClick={() => refetch()}>\n <RefreshCw size={16} /> {tr('integrations.mailbox.actions.retry', 'Try again')}\n </Button>\n </div>\n </div>\n );\n }\n\n const last = thread.messages[thread.messages.length - 1];\n const ownAddress = accountEmail?.trim().toLowerCase() ?? null;\n // Replying to a message the connected account sent itself (from Sent, or a\n // follow-up) goes to that message's recipients, never back to the account.\n const replyRecipients = last\n ? ownAddress && last.from?.email.toLowerCase() === ownAddress\n ? last.to\n .map((address) => address.email)\n .filter((email) => email.toLowerCase() !== ownAddress)\n : [last.from?.email ?? '']\n : [];\n return (\n <div className=\"space-y-4\" data-testid=\"mailbox-thread\">\n <div className=\"flex items-start gap-2\">\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className=\"lg:hidden\"\n onClick={onBack}\n aria-label={tr('integrations.common.back', 'Back')}\n >\n <ArrowLeft size={18} />\n </Button>\n <h2 className=\"min-w-0 flex-1 text-lg font-semibold text-text-primary break-words\">\n {thread.subject || tr('integrations.mailbox.noSubject', '(no subject)')}\n </h2>\n <div className=\"flex shrink-0 gap-1\">\n <Button\n variant=\"ghost\"\n size=\"icon\"\n disabled={busy}\n onClick={() => void runAction('archived')}\n aria-label={tr('integrations.mailbox.actions.archive', 'Archive')}\n title={tr('integrations.mailbox.actions.archive', 'Archive')}\n >\n <Archive size={18} />\n </Button>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n disabled={busy}\n onClick={() => setConfirmTrash(true)}\n aria-label={tr('integrations.mailbox.actions.trash', 'Delete')}\n title={tr('integrations.mailbox.actions.trash', 'Delete')}\n >\n <Trash2 size={18} />\n </Button>\n </div>\n </div>\n {actionError && (\n <p role=\"alert\" className=\"text-sm text-status-error-text\">\n {actionError}\n </p>\n )}\n <ConfirmDialog\n open={confirmTrash}\n title={tr('integrations.mailbox.trash.title', 'Delete this conversation?')}\n description={\n kind === MailboxKind.Outlook\n ? tr(\n 'integrations.mailbox.trash.descriptionOutlook',\n 'It moves to Deleted Items in Outlook, where you can restore it.'\n )\n : tr(\n 'integrations.mailbox.trash.descriptionGmail',\n 'It moves to Trash in Gmail, where you can restore it for 30 days.'\n )\n }\n confirmLabel={tr('integrations.mailbox.actions.trash', 'Delete')}\n cancelLabel={tr('integrations.common.cancel', 'Cancel')}\n loading={busy}\n destructive\n onConfirm={() => void runAction('trashed')}\n onCancel={() => setConfirmTrash(false)}\n />\n {thread.messages.map((message) => (\n <article\n key={message.id}\n className=\"rounded-xl border border-border-subtle bg-bg-surface p-4 space-y-2\"\n >\n <header className=\"flex flex-wrap items-baseline justify-between gap-2\">\n <div className=\"min-w-0\">\n <p className=\"text-sm font-medium text-text-primary break-all\">\n {displayAddress(message.from)}\n </p>\n <p className=\"text-xs text-text-secondary break-all\">\n {tr('integrations.mailbox.thread.to', 'To')}:{' '}\n {message.to.map(displayAddress).join(', ')}\n {message.cc.length > 0 &&\n ` · ${tr('integrations.mailbox.thread.cc', 'Cc')}: ${message.cc.map(displayAddress).join(', ')}`}\n </p>\n </div>\n <div className=\"flex items-center gap-2 text-xs text-text-tertiary\">\n {message.hasAttachments && (\n <Paperclip\n size={14}\n aria-label={tr('integrations.mailbox.attachments', 'Has attachments')}\n />\n )}\n {message.receivedAt && (\n <time dateTime={message.receivedAt}>{formatDate(message.receivedAt)}</time>\n )}\n </div>\n </header>\n <MailMessageBody connectionId={connectionId} message={message} />\n </article>\n ))}\n {sentNotice && (\n <p role=\"status\" className=\"text-sm text-status-success-text\">\n {tr('integrations.mailbox.compose.sent', 'Message sent')}\n </p>\n )}\n {last &&\n (replyOpen ? (\n <ComposePanel\n connectionId={connectionId}\n kind={kind}\n replyTo={{\n messageId: last.id,\n to: replyRecipients.filter(Boolean).join(', '),\n subject: thread.subject,\n }}\n onClose={() => setReplyOpen(false)}\n onSent={() => {\n setReplyOpen(false);\n setSentNotice(true);\n void refetch();\n }}\n />\n ) : (\n <Button variant=\"outline\" onClick={() => setReplyOpen(true)}>\n <Reply size={16} /> {tr('integrations.mailbox.actions.reply', 'Reply')}\n </Button>\n ))}\n </div>\n );\n}\n\n/** One page of messages in the selected folder, with paging. */\nfunction MessageList(props: {\n messages: MailboxMessageSummary[];\n loading: boolean;\n error: { message: string } | undefined;\n refetch: () => unknown;\n folder: MailboxFolder;\n threadId: string | null;\n hasPrevious: boolean;\n nextPageToken: string | null;\n onOpen: (threadId: string, messageId: string, unread: boolean) => void;\n onPrevious: () => void;\n onNext: (token: string) => void;\n}) {\n const {\n messages,\n loading,\n error,\n refetch,\n folder,\n threadId,\n hasPrevious,\n nextPageToken,\n onOpen,\n onPrevious,\n onNext,\n } = props;\n const tr = useTr();\n const formatDate = useFormatDate();\n return (\n <>\n {error ? (\n <div className=\"p-6 text-center space-y-3\">\n <p role=\"alert\" className=\"text-sm text-status-error-text\">\n {error.message}\n </p>\n <Button variant=\"outline\" onClick={() => refetch()}>\n <RefreshCw size={16} /> {tr('integrations.mailbox.actions.retry', 'Try again')}\n </Button>\n </div>\n ) : loading && messages.length === 0 ? (\n <div className=\"flex items-center justify-center py-16\">\n <Loader2 className=\"size-6 animate-spin text-primary\" />\n </div>\n ) : messages.length === 0 ? (\n <p className=\"p-6 text-sm text-text-secondary text-center\">\n {tr('integrations.mailbox.list.empty', 'No messages here')}\n </p>\n ) : (\n <ul className=\"divide-y divide-border-subtle\" data-testid=\"mailbox-message-list\">\n {messages.map((message) => (\n <li key={message.id}>\n <button\n type=\"button\"\n onClick={() => onOpen(message.threadId, message.id, message.isUnread)}\n aria-current={threadId === message.threadId ? 'true' : undefined}\n className={cn(\n 'w-full text-left px-4 py-3 transition-colors hover:bg-accent focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/30',\n threadId === message.threadId && 'bg-accent'\n )}\n >\n <div className=\"flex items-center justify-between gap-2\">\n <span\n className={cn(\n 'truncate text-sm',\n message.isUnread ? 'font-semibold text-text-primary' : 'text-text-secondary'\n )}\n >\n {folder === MailboxFolder.Sent\n ? message.to.map(shortAddress).join(', ')\n : shortAddress(message.from)}\n </span>\n <span className=\"flex shrink-0 items-center gap-1 text-xs text-text-tertiary\">\n {message.hasAttachments && <Paperclip size={12} />}\n {message.isUnread ? <Mail size={12} /> : <MailOpen size={12} />}\n {message.receivedAt ? formatDate(message.receivedAt) : ''}\n </span>\n </div>\n <p\n className={cn(\n 'truncate text-sm',\n message.isUnread ? 'font-medium text-text-primary' : 'text-text-primary'\n )}\n >\n {message.subject || tr('integrations.mailbox.noSubject', '(no subject)')}\n </p>\n <p className=\"truncate text-xs text-text-secondary\">{message.snippet}</p>\n </button>\n </li>\n ))}\n </ul>\n )}\n {(hasPrevious || nextPageToken) && (\n <div className=\"flex justify-between gap-2 border-t border-border-subtle p-3\">\n <Button\n variant=\"outline\"\n size=\"sm\"\n disabled={!hasPrevious || loading}\n onClick={onPrevious}\n >\n {tr('integrations.common.previous', 'Previous')}\n </Button>\n <Button\n variant=\"outline\"\n size=\"sm\"\n disabled={!nextPageToken || loading}\n onClick={() => nextPageToken && onNext(nextPageToken)}\n >\n {tr('integrations.common.next', 'Next')}\n </Button>\n </div>\n )}\n </>\n );\n}\n\n/** Shown until a Gmail or Outlook connection exists (or when listing them failed). */\nfunction MailboxEmptyState(props: { errorMessage: string | null }) {\n const tr = useTr();\n const { basePath = '/', navigate } = useIntegrations();\n const connectPath = joinPath(basePath, 'providers');\n return (\n <div className=\"space-y-6 p-6 max-w-5xl mx-auto\">\n <PagePurpose icon={<Mail size={16} />}>\n {tr(\n 'integrations.mailbox.purpose',\n 'Read and send mail from your own Gmail or Outlook account without leaving Workspaces. Only you can open your mailbox; sharing a connection never shares your mail.'\n )}\n </PagePurpose>\n {props.errorMessage ? (\n <p role=\"alert\" className=\"text-sm text-status-error-text text-center\">\n {props.errorMessage}\n </p>\n ) : (\n <IllustratedEmptyState\n illustration=\"empty-data\"\n title={tr('integrations.mailbox.empty.title', 'Connect a mailbox')}\n description={tr(\n 'integrations.mailbox.empty.description',\n 'Connect Google Gmail or Microsoft Outlook from Providers, then come back here to read and send mail.'\n )}\n action={\n <Button onClick={() => navigate?.(connectPath)}>\n <Mail size={16} />{' '}\n {tr('integrations.mailbox.empty.action', 'Connect Gmail or Outlook')}\n </Button>\n }\n />\n )}\n </div>\n );\n}\n\n/** Title, mailbox switcher and the Compose action. */\nfunction MailboxHeader(props: { accounts: MailboxAccount[]; connectionId: string | null }) {\n const { accounts, connectionId } = props;\n const tr = useTr();\n const ids = useId();\n const composing = useMailboxStore((s) => s.composing);\n const selectConnection = useMailboxStore((s) => s.selectConnection);\n const startCompose = useMailboxStore((s) => s.startCompose);\n const account = accounts.find((a) => a.connectionId === connectionId) ?? null;\n return (\n <div className=\"rounded-xl border border-border-seam bg-accent-wash p-4 sm:p-6\">\n <div className=\"flex flex-wrap items-center justify-between gap-4\">\n <div className=\"flex items-center gap-3\">\n <div className=\"p-2.5 rounded-lg bg-action-primary-bg/10\">\n <Inbox size={24} className=\"text-primary\" />\n </div>\n <div>\n <h1 className=\"text-2xl font-bold text-text-primary\">\n {tr('integrations.mailbox.title', 'Inbox')}\n </h1>\n <p className=\"text-sm text-text-secondary\">\n {account?.emailAddress ??\n account?.name ??\n tr('integrations.mailbox.subtitle', 'Your connected mail')}\n </p>\n </div>\n </div>\n <div className=\"flex flex-wrap items-center gap-2\">\n {accounts.length > 1 && (\n <>\n <label htmlFor={`${ids}-account`} className=\"sr-only\">\n {tr('integrations.mailbox.account', 'Mailbox')}\n </label>\n <select\n id={`${ids}-account`}\n value={connectionId ?? ''}\n // An open draft stays bound to the mailbox it was started in.\n disabled={composing}\n onChange={(e) => selectConnection(e.target.value)}\n className=\"px-3 py-2 border border-border-subtle rounded-lg bg-bg-surface text-sm text-text-primary\"\n >\n {accounts.map((a) => (\n <option key={a.connectionId} value={a.connectionId}>\n {a.emailAddress ?? a.name}\n </option>\n ))}\n </select>\n </>\n )}\n <Button onClick={startCompose}>\n <PenSquare size={16} /> {tr('integrations.mailbox.actions.compose', 'Compose')}\n </Button>\n </div>\n </div>\n </div>\n );\n}\n\n/** Folder switcher, search box and refresh. */\n/** Gmail labels already covered by the folder buttons. */\nconst FOLDER_BUTTON_LABELS = new Set(['INBOX', 'SENT']);\n\nfunction MailboxToolbar(props: {\n connectionId: string | null;\n loading: boolean;\n onRefresh: () => void;\n}) {\n const tr = useTr();\n const ids = useId();\n const folder = useMailboxStore((s) => s.folder);\n const folderId = useMailboxStore((s) => s.folderId);\n const query = useMailboxStore((s) => s.query);\n const selectFolder = useMailboxStore((s) => s.selectFolder);\n const selectLabel = useMailboxStore((s) => s.selectLabel);\n const search = useMailboxStore((s) => s.search);\n const { labels } = useMailboxLabels(props.connectionId);\n const extraLabels = labels.filter(\n (l) => !(l.kind === MailboxLabelKind.System && FOLDER_BUTTON_LABELS.has(l.id))\n );\n // The text being typed is a form draft; it becomes the query on submit.\n const [searchInput, setSearchInput] = useState(query);\n return (\n <div className=\"flex flex-col sm:flex-row gap-3\">\n <div\n className=\"flex gap-1 rounded-lg border border-border-subtle bg-bg-surface p-1\"\n role=\"group\"\n aria-label={tr('integrations.mailbox.folders.ariaLabel', 'Folders')}\n >\n {FOLDERS.map((f) => (\n <button\n key={f.value}\n type=\"button\"\n aria-pressed={!folderId && folder === f.value}\n onClick={() => selectFolder(f.value)}\n className={cn(\n 'px-3 py-1.5 text-sm rounded-md transition-colors',\n !folderId && folder === f.value\n ? 'bg-action-primary-bg text-action-primary-text'\n : 'text-text-secondary hover:bg-accent'\n )}\n >\n {tr(`integrations.mailbox.folders.${f.key}`, f.label)}\n </button>\n ))}\n </div>\n {extraLabels.length > 0 && (\n <div>\n <label htmlFor={`${ids}-label`} className=\"sr-only\">\n {tr('integrations.mailbox.labels.ariaLabel', 'Labels and folders')}\n </label>\n <select\n id={`${ids}-label`}\n value={folderId ?? ''}\n onChange={(e) => {\n if (e.target.value) selectLabel(e.target.value);\n else selectFolder(folder);\n }}\n className=\"w-full sm:w-48 px-3 py-2 border border-border-subtle rounded-lg bg-bg-surface text-sm text-text-primary\"\n data-testid=\"mailbox-label-select\"\n >\n <option value=\"\">\n {tr('integrations.mailbox.labels.placeholder', 'More folders…')}\n </option>\n {extraLabels.map((label) => (\n <option key={label.id} value={label.id}>\n {label.unreadCount ? `${label.name} (${label.unreadCount})` : label.name}\n </option>\n ))}\n </select>\n </div>\n )}\n <form\n className=\"flex-1 relative\"\n onSubmit={(e) => {\n e.preventDefault();\n search(searchInput);\n }}\n >\n <Search\n size={16}\n className=\"absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary\"\n />\n <input\n type=\"search\"\n value={searchInput}\n onChange={(e) => setSearchInput(e.target.value)}\n maxLength={500}\n aria-label={tr('integrations.mailbox.search.ariaLabel', 'Search mail')}\n placeholder={tr('integrations.mailbox.search.placeholder', 'Search mail')}\n className=\"w-full pl-9 pr-3 py-2 border border-border-subtle rounded-lg bg-bg-surface text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary\"\n />\n </form>\n <Button variant=\"outline\" onClick={props.onRefresh} disabled={props.loading}>\n <RefreshCw size={16} className={cn(props.loading && 'animate-spin')} />{' '}\n {tr('integrations.mailbox.actions.refresh', 'Refresh')}\n </Button>\n </div>\n );\n}\n\n/** Message list and the reading / compose pane for one connected mailbox. */\nfunction MailboxWorkspace(props: { accounts: MailboxAccount[] }) {\n const { accounts } = props;\n const tr = useTr();\n const state = useMailboxStore();\n const resetMailbox = useMailboxStore((s) => s.reset);\n const setRead = useSetMailRead();\n\n // Leaving the Inbox (or switching workspace) starts the next visit clean.\n useEffect(() => resetMailbox, [resetMailbox]);\n\n // Default to the first connected mailbox until the person picks another one;\n // a selection that is no longer connected falls back the same way.\n const account =\n accounts.find((a) => a.connectionId === state.selectedConnectionId) ?? accounts[0] ?? null;\n const connectionId = account?.connectionId ?? null;\n\n const [notice, setNotice] = useState<string | null>(null);\n const { messages, nextPageToken, loading, error, refetch } = useMailboxMessages({\n connectionId,\n folder: state.folder,\n folderId: state.folderId,\n query: state.query,\n pageToken: state.pageTokens[state.pageTokens.length - 1] ?? null,\n });\n\n const openThread = (id: string, messageId: string, unread: boolean) => {\n setNotice(null);\n state.openThread(id);\n if (unread && connectionId) {\n // Best effort: a failed mark-read must not block reading.\n setRead(connectionId, messageId, true).then(\n () => refetch(),\n () => undefined\n );\n }\n };\n\n const detailOpen = Boolean(state.threadId || state.composing);\n\n return (\n <div className=\"space-y-4 p-4 sm:p-6 max-w-7xl mx-auto\" data-testid=\"mailbox-inbox\">\n <MailboxHeader accounts={accounts} connectionId={connectionId} />\n <MailboxToolbar\n key={connectionId ?? 'none'}\n connectionId={connectionId}\n loading={loading}\n onRefresh={() => void refetch()}\n />\n {notice && !state.threadId && (\n <p role=\"status\" className=\"text-sm text-status-success-text\">\n {notice}\n </p>\n )}\n\n {state.sentNotice && (\n <p role=\"status\" className=\"text-sm text-status-success-text\">\n {tr('integrations.mailbox.compose.sent', 'Message sent')}\n </p>\n )}\n\n <div className=\"grid gap-4 lg:grid-cols-[minmax(0,2fr)_minmax(0,3fr)]\">\n <section\n aria-label={tr('integrations.mailbox.list.ariaLabel', 'Messages')}\n className={cn(\n 'rounded-xl border border-border-subtle bg-bg-surface overflow-hidden',\n detailOpen && 'hidden lg:block'\n )}\n >\n <MessageList\n messages={messages}\n loading={loading}\n error={error}\n refetch={refetch}\n folder={state.folder}\n threadId={state.threadId}\n hasPrevious={state.pageTokens.length > 1}\n nextPageToken={nextPageToken}\n onOpen={openThread}\n onPrevious={state.previousPage}\n onNext={state.nextPage}\n />\n </section>\n\n <section className={cn(!detailOpen && 'hidden lg:block')}>\n {state.composing && connectionId ? (\n <ComposePanel\n connectionId={connectionId}\n kind={account?.kind ?? MailboxKind.Gmail}\n onClose={state.closeCompose}\n onSent={() => {\n state.composeSent();\n if (state.folder === MailboxFolder.Sent) void refetch();\n }}\n />\n ) : state.threadId && connectionId ? (\n <ThreadView\n key={`${connectionId}:${state.threadId}`}\n connectionId={connectionId}\n kind={account?.kind ?? MailboxKind.Gmail}\n threadId={state.threadId}\n accountEmail={account?.emailAddress ?? null}\n onBack={state.closeThread}\n onRemoved={(action) => {\n state.closeThread();\n setNotice(\n action === 'archived'\n ? tr('integrations.mailbox.notice.archived', 'Conversation archived')\n : tr('integrations.mailbox.notice.trashed', 'Conversation moved to the trash')\n );\n void refetch();\n }}\n />\n ) : (\n <div className=\"rounded-xl border border-dashed border-border-subtle p-10 text-center text-sm text-text-secondary\">\n {tr('integrations.mailbox.thread.placeholder', 'Select a message to read it')}\n </div>\n )}\n </section>\n </div>\n </div>\n );\n}\n\n/**\n * Inbox — read, search, reply to and send mail from the caller's own Gmail or\n * Outlook account, connected as an integration (BOFF-4422). Workspaces does not\n * host mail; only the connection owner can open a mailbox.\n */\nexport function MailboxInbox() {\n const { accounts, answered, error } = useMailboxAccounts();\n\n // Until the accounts query has actually answered (it waits for the\n // workspace context), an empty list means \"not asked yet\", not \"none\".\n if (!answered && !error) {\n return (\n <div className=\"flex items-center justify-center py-24\" data-testid=\"mailbox-loading\">\n <Loader2 className=\"size-6 animate-spin text-primary\" />\n </div>\n );\n }\n if (accounts.length === 0) {\n return <MailboxEmptyState errorMessage={error?.message ?? null} />;\n }\n return <MailboxWorkspace accounts={accounts} />;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAuDA,SAASC,EAAe,GAA6C;CAEnE,OADKC,IACEA,EAAQ,OAAO,GAAGA,EAAQ,KAAK,IAAIA,EAAQ,MAAM,KAAKA,EAAQ,QADhD;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f;KACD,GAfM,GAAGpB,EAAa,GAAGiF,EAAM,UAe/B,IAED,kBAAC,OAAD;MAAK,WAAU;MACZ,UAAA3I,EAAG,2CAA2C,6BAA6B;KACzE,CAAA;IAEA,CAAA,CACN;;EACF;;AAET;AAOA,SAAgBuJ,KAAe;CAC7B,IAAM,EAAE,aAAU,aAAU,aAAUC,EAAmB;CAczD,OAVI,CAACC,KAAY,CAACpH,IAEd,kBAAC,OAAD;EAAK,WAAU;EAAyC,eAAY;EAClE,UAAA,kBAACa,GAAD,EAAS,WAAU,mCAAoC,CAAA;CACpD,CAAA,IAGLqE,EAAS,WAAW,IACf,kBAACf,GAAD,EAAmB,cAAcnE,GAAO,WAAW,KAAO,CAAA,IAE5D,kBAACqG,IAAD,EAA4B,YAAW,CAAA;AAChD"}
@@ -4,6 +4,5 @@ interface ProviderCatalogProps {
4
4
  /**
5
5
  * Provider Catalog — Grid/list view of available providers with filtering.
6
6
  */
7
- export declare function ProviderCatalog({ showCreateProviderButton }: ProviderCatalogProps): import("react").JSX.Element;
7
+ export declare function ProviderCatalog({ showCreateProviderButton }: ProviderCatalogProps): import('react').JSX.Element;
8
8
  export {};
9
- //# sourceMappingURL=ProviderCatalog.d.ts.map