@burdenoff/microfe-subscriberbot 2026.1102.6 → 2026.1103.2

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.
@@ -8,14 +8,14 @@ import { Modal as c } from "../components/Modal.js";
8
8
  import { useTr as l } from "../hooks/useTr.js";
9
9
  import { ErrorView as u, LoadingView as d, Section as f } from "../components/StateViews.js";
10
10
  import { MiniProgress as p } from "../components/viz.js";
11
- import { useChannels as m, useCreateChannel as h, useInboxMessages as g, useIngestMessage as _, useMarkMessageRead as v, useVerifyChannel as y } from "../hooks/useSubscriberBotApi.js";
12
- import { useRouteSelection as b } from "../hooks/useRouteSelection.js";
13
- import { useState as x } from "react";
14
- import { AlertTriangle as S, BadgeCheck as C, Bell as w, ChevronRight as T, Hash as E, Inbox as D, Mail as O, MailOpen as k, MessageSquare as A, MessagesSquare as j, MousePointerClick as M, Phone as N, Plus as P, Radio as F, Send as I, ShieldAlert as L, Sparkles as R, Webhook as z } from "lucide-react";
15
- import { Fragment as B, jsx as V, jsxs as H } from "react/jsx-runtime";
16
- import { GlassCard as U, PagePurpose as W } from "@burdenoff/fe-libs/ui";
11
+ import { useChannels as m, useCreateChannel as h, useInboxMessages as g, useIngestMessage as _, useMarkMessageRead as v, useMarkMessageUnread as ee, useVerifyChannel as y } from "../hooks/useSubscriberBotApi.js";
12
+ import { useRouteSelection as te } from "../hooks/useRouteSelection.js";
13
+ import { useRef as ne, useState as b } from "react";
14
+ import { AlertTriangle as x, BadgeCheck as S, Bell as C, ChevronRight as w, Hash as T, Inbox as re, Mail as E, MailOpen as D, MessageSquare as O, MessagesSquare as k, MoreHorizontal as A, MousePointerClick as j, Phone as M, Plus as N, Radio as P, Send as F, ShieldAlert as I, Sparkles as L, Webhook as R } from "lucide-react";
15
+ import { Fragment as z, jsx as B, jsxs as V } from "react/jsx-runtime";
16
+ import { DropdownMenu as H, DropdownMenuContent as U, DropdownMenuItem as W, DropdownMenuTrigger as G, GlassCard as K, PagePurpose as ie } from "@burdenoff/fe-libs/ui";
17
17
  //#region src/subscriberbot/pages/InboxPage.tsx
18
- var G = 25, K = "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]", q = "mb-1 block text-xs font-medium text-text-secondary", J = [
18
+ var q = 25, J = "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]", Y = "mb-1 block text-xs font-medium text-text-secondary", ae = [
19
19
  "BILLING",
20
20
  "RENEWAL",
21
21
  "REQUIRED_ACTION",
@@ -23,7 +23,7 @@ var G = 25, K = "w-full rounded-lg border border-border-subtle bg-bg-surface px-
23
23
  "PRODUCT_UPDATE",
24
24
  "MARKETING",
25
25
  "OTHER"
26
- ], ee = [
26
+ ], oe = [
27
27
  "EMAIL",
28
28
  "SMS",
29
29
  "SLACK",
@@ -31,7 +31,7 @@ var G = 25, K = "w-full rounded-lg border border-border-subtle bg-bg-surface px-
31
31
  "WHATSAPP",
32
32
  "PUSH",
33
33
  "WEBHOOK"
34
- ], Y = {
34
+ ], X = {
35
35
  BILLING: "inbox.categories.billing",
36
36
  RENEWAL: "inbox.categories.renewal",
37
37
  REQUIRED_ACTION: "inbox.categories.requiredAction",
@@ -39,7 +39,7 @@ var G = 25, K = "w-full rounded-lg border border-border-subtle bg-bg-surface px-
39
39
  PRODUCT_UPDATE: "inbox.categories.productUpdate",
40
40
  MARKETING: "inbox.categories.marketing",
41
41
  OTHER: "inbox.categories.other"
42
- }, te = [
42
+ }, se = [
43
43
  {
44
44
  value: "",
45
45
  key: "inbox.categories.all",
@@ -47,40 +47,40 @@ var G = 25, K = "w-full rounded-lg border border-border-subtle bg-bg-surface px-
47
47
  },
48
48
  {
49
49
  value: "BILLING",
50
- key: Y.BILLING,
50
+ key: X.BILLING,
51
51
  fallback: "Billing"
52
52
  },
53
53
  {
54
54
  value: "RENEWAL",
55
- key: Y.RENEWAL,
55
+ key: X.RENEWAL,
56
56
  fallback: "Renewals"
57
57
  },
58
58
  {
59
59
  value: "REQUIRED_ACTION",
60
- key: Y.REQUIRED_ACTION,
60
+ key: X.REQUIRED_ACTION,
61
61
  fallback: "Required actions"
62
62
  },
63
63
  {
64
64
  value: "SECURITY_ALERT",
65
- key: Y.SECURITY_ALERT,
65
+ key: X.SECURITY_ALERT,
66
66
  fallback: "Security"
67
67
  },
68
68
  {
69
69
  value: "PRODUCT_UPDATE",
70
- key: Y.PRODUCT_UPDATE,
70
+ key: X.PRODUCT_UPDATE,
71
71
  fallback: "Product updates"
72
72
  },
73
73
  {
74
74
  value: "MARKETING",
75
- key: Y.MARKETING,
75
+ key: X.MARKETING,
76
76
  fallback: "Marketing"
77
77
  },
78
78
  {
79
79
  value: "OTHER",
80
- key: Y.OTHER,
80
+ key: X.OTHER,
81
81
  fallback: "Other"
82
82
  }
83
- ], ne = {
83
+ ], ce = {
84
84
  BILLING: "bg-[var(--color-accent-soft)] text-text-primary",
85
85
  RENEWAL: "bg-status-success-bg-subtle text-status-success-text",
86
86
  REQUIRED_ACTION: "bg-status-warning-bg-subtle text-status-warning-text",
@@ -88,40 +88,40 @@ var G = 25, K = "w-full rounded-lg border border-border-subtle bg-bg-surface px-
88
88
  PRODUCT_UPDATE: "bg-[var(--color-accent-soft)] text-text-primary",
89
89
  MARKETING: "bg-bg-sunken text-text-secondary",
90
90
  OTHER: "bg-bg-sunken text-text-secondary"
91
- }, X = {
92
- EMAIL: O,
93
- SMS: A,
94
- SLACK: E,
95
- DISCORD: j,
96
- WHATSAPP: N,
97
- PUSH: w,
98
- WEBHOOK: z
91
+ }, Z = {
92
+ EMAIL: E,
93
+ SMS: O,
94
+ SLACK: T,
95
+ DISCORD: k,
96
+ WHATSAPP: M,
97
+ PUSH: C,
98
+ WEBHOOK: R
99
99
  };
100
- function Z({ category: e }) {
101
- return /* @__PURE__ */ V("span", {
102
- className: t("inline-flex items-center rounded-full px-2 py-0.5 text-[11px] font-medium", ne[e]),
100
+ function Q({ category: e }) {
101
+ return /* @__PURE__ */ B("span", {
102
+ className: t("inline-flex items-center rounded-full px-2 py-0.5 text-[11px] font-medium", ce[e]),
103
103
  children: i(e)
104
104
  });
105
105
  }
106
- function Q({ className: e }) {
106
+ function le({ className: e }) {
107
107
  let n = l();
108
- return /* @__PURE__ */ H("span", {
108
+ return /* @__PURE__ */ V("span", {
109
109
  title: n("inbox.message.actionRequiredTitle", "Action required"),
110
110
  className: t("inline-flex items-center gap-1 rounded-full bg-status-warning-bg-subtle px-2 py-0.5 text-[10px] font-medium text-status-warning-text", e),
111
111
  children: [
112
- /* @__PURE__ */ V(S, { className: "h-3 w-3" }),
112
+ /* @__PURE__ */ B(x, { className: "h-3 w-3" }),
113
113
  " ",
114
114
  n("inbox.message.actionFlag", "Action")
115
115
  ]
116
116
  });
117
117
  }
118
- function re({ onClose: e }) {
119
- let t = l(), n = h(), [r, a] = x("EMAIL"), [o, s] = x(""), [u, d] = x(""), [f, p] = x(!0), [m, g] = x(null);
120
- return /* @__PURE__ */ V(c, {
118
+ function ue({ onClose: e }) {
119
+ let t = l(), n = h(), [r, a] = b("EMAIL"), [o, s] = b(""), [u, d] = b(""), [f, p] = b(!0), [m, g] = b(null);
120
+ return /* @__PURE__ */ B(c, {
121
121
  title: t("inbox.addChannelModal.title", "Add channel"),
122
122
  onClose: e,
123
123
  maxWidthClassName: "max-w-xl",
124
- children: /* @__PURE__ */ H("form", {
124
+ children: /* @__PURE__ */ V("form", {
125
125
  onSubmit: (i) => {
126
126
  if (i.preventDefault(), g(null), !o.trim()) {
127
127
  g(t("inbox.addChannelModal.addressRequired", "An address is required."));
@@ -139,75 +139,75 @@ function re({ onClose: e }) {
139
139
  },
140
140
  className: "space-y-4",
141
141
  children: [
142
- m && /* @__PURE__ */ V("div", {
142
+ m && /* @__PURE__ */ B("div", {
143
143
  className: "rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text",
144
144
  children: m
145
145
  }),
146
- /* @__PURE__ */ H("div", {
146
+ /* @__PURE__ */ V("div", {
147
147
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
148
- children: [/* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V("label", {
148
+ children: [/* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("label", {
149
149
  htmlFor: "ch-type",
150
- className: q,
150
+ className: Y,
151
151
  children: t("inbox.addChannelModal.typeLabel", "Type")
152
- }), /* @__PURE__ */ V("select", {
152
+ }), /* @__PURE__ */ B("select", {
153
153
  id: "ch-type",
154
154
  value: r,
155
155
  onChange: (e) => a(e.target.value),
156
- className: K,
157
- children: ee.map((e) => /* @__PURE__ */ V("option", {
156
+ className: J,
157
+ children: oe.map((e) => /* @__PURE__ */ B("option", {
158
158
  value: e,
159
159
  children: i(e)
160
160
  }, e))
161
- })] }), /* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V("label", {
161
+ })] }), /* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("label", {
162
162
  htmlFor: "ch-label",
163
- className: q,
163
+ className: Y,
164
164
  children: t("inbox.addChannelModal.labelLabel", "Label")
165
- }), /* @__PURE__ */ V("input", {
165
+ }), /* @__PURE__ */ B("input", {
166
166
  id: "ch-label",
167
167
  type: "text",
168
168
  value: u,
169
169
  onChange: (e) => d(e.target.value),
170
170
  placeholder: t("inbox.addChannelModal.labelPlaceholder", "e.g. Billing inbox"),
171
- className: K
171
+ className: J
172
172
  })] })]
173
173
  }),
174
- /* @__PURE__ */ H("div", { children: [/* @__PURE__ */ H("label", {
174
+ /* @__PURE__ */ V("div", { children: [/* @__PURE__ */ V("label", {
175
175
  htmlFor: "ch-address",
176
- className: q,
176
+ className: Y,
177
177
  children: [
178
178
  t("inbox.addChannelModal.addressLabel", "Address"),
179
179
  " ",
180
- /* @__PURE__ */ V("span", {
180
+ /* @__PURE__ */ B("span", {
181
181
  className: "text-status-error-text",
182
182
  children: "*"
183
183
  })
184
184
  ]
185
- }), /* @__PURE__ */ V("input", {
185
+ }), /* @__PURE__ */ B("input", {
186
186
  id: "ch-address",
187
187
  type: "text",
188
188
  value: o,
189
189
  onChange: (e) => s(e.target.value),
190
190
  placeholder: t("inbox.addChannelModal.addressPlaceholder", "e.g. billing@acme.com, +1…, a webhook URL"),
191
- className: K,
191
+ className: J,
192
192
  required: !0
193
193
  })] }),
194
- /* @__PURE__ */ H("label", {
194
+ /* @__PURE__ */ V("label", {
195
195
  className: "flex items-center gap-2 text-sm text-text-primary",
196
- children: [/* @__PURE__ */ V("input", {
196
+ children: [/* @__PURE__ */ B("input", {
197
197
  type: "checkbox",
198
198
  checked: f,
199
199
  onChange: (e) => p(e.target.checked),
200
200
  className: "size-4 rounded border-border-subtle"
201
201
  }), t("inbox.addChannelModal.ingestLabel", "Ingest messages from this channel")]
202
202
  }),
203
- /* @__PURE__ */ H("div", {
203
+ /* @__PURE__ */ V("div", {
204
204
  className: "flex justify-end gap-3",
205
- children: [/* @__PURE__ */ V("button", {
205
+ children: [/* @__PURE__ */ B("button", {
206
206
  type: "button",
207
207
  onClick: e,
208
208
  className: "rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
209
209
  children: t("inbox.addChannelModal.cancel", "Cancel")
210
- }), /* @__PURE__ */ V("button", {
210
+ }), /* @__PURE__ */ B("button", {
211
211
  type: "submit",
212
212
  disabled: n.isPending,
213
213
  className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50",
@@ -218,13 +218,13 @@ function re({ onClose: e }) {
218
218
  })
219
219
  });
220
220
  }
221
- function ie({ channel: e, onClose: t }) {
222
- let n = l(), r = _(), [a, o] = x(""), [s, u] = x(""), [d, f] = x("OTHER"), [p, m] = x(!1), [h, g] = x(null);
223
- return /* @__PURE__ */ V(c, {
221
+ function de({ channel: e, onClose: t }) {
222
+ let n = l(), r = _(), [a, o] = b(""), [s, u] = b(""), [d, f] = b("OTHER"), [p, m] = b(!1), [h, g] = b(null);
223
+ return /* @__PURE__ */ B(c, {
224
224
  title: n("inbox.logMessageModal.title", "Log test message"),
225
225
  description: n("inbox.logMessageModal.description", "Simulate an ingested message from {channel}.", { channel: e.label || e.address }),
226
226
  onClose: t,
227
- children: /* @__PURE__ */ H("form", {
227
+ children: /* @__PURE__ */ V("form", {
228
228
  onSubmit: (i) => {
229
229
  i.preventDefault(), g(null), r.mutate({
230
230
  channelId: e.id,
@@ -240,64 +240,64 @@ function ie({ channel: e, onClose: t }) {
240
240
  },
241
241
  className: "space-y-4",
242
242
  children: [
243
- h && /* @__PURE__ */ V("div", {
243
+ h && /* @__PURE__ */ B("div", {
244
244
  className: "rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text",
245
245
  children: h
246
246
  }),
247
- /* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V("label", {
247
+ /* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("label", {
248
248
  htmlFor: "msg-subject",
249
- className: q,
249
+ className: Y,
250
250
  children: n("inbox.logMessageModal.subjectLabel", "Subject")
251
- }), /* @__PURE__ */ V("input", {
251
+ }), /* @__PURE__ */ B("input", {
252
252
  id: "msg-subject",
253
253
  type: "text",
254
254
  value: a,
255
255
  onChange: (e) => o(e.target.value),
256
256
  placeholder: n("inbox.logMessageModal.subjectPlaceholder", "e.g. Your plan renews in 3 days"),
257
- className: K
257
+ className: J
258
258
  })] }),
259
- /* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V("label", {
259
+ /* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("label", {
260
260
  htmlFor: "msg-preview",
261
- className: q,
261
+ className: Y,
262
262
  children: n("inbox.logMessageModal.previewLabel", "Preview")
263
- }), /* @__PURE__ */ V("textarea", {
263
+ }), /* @__PURE__ */ B("textarea", {
264
264
  id: "msg-preview",
265
265
  value: s,
266
266
  onChange: (e) => u(e.target.value),
267
267
  rows: 2,
268
- className: K
268
+ className: J
269
269
  })] }),
270
- /* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V("label", {
270
+ /* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("label", {
271
271
  htmlFor: "msg-category",
272
- className: q,
272
+ className: Y,
273
273
  children: n("inbox.logMessageModal.categoryLabel", "Category")
274
- }), /* @__PURE__ */ V("select", {
274
+ }), /* @__PURE__ */ B("select", {
275
275
  id: "msg-category",
276
276
  value: d,
277
277
  onChange: (e) => f(e.target.value),
278
- className: K,
279
- children: J.map((e) => /* @__PURE__ */ V("option", {
278
+ className: J,
279
+ children: ae.map((e) => /* @__PURE__ */ B("option", {
280
280
  value: e,
281
- children: n(Y[e], i(e))
281
+ children: n(X[e], i(e))
282
282
  }, e))
283
283
  })] }),
284
- /* @__PURE__ */ H("label", {
284
+ /* @__PURE__ */ V("label", {
285
285
  className: "flex items-center gap-2 text-sm text-text-primary",
286
- children: [/* @__PURE__ */ V("input", {
286
+ children: [/* @__PURE__ */ B("input", {
287
287
  type: "checkbox",
288
288
  checked: p,
289
289
  onChange: (e) => m(e.target.checked),
290
290
  className: "size-4 rounded border-border-subtle"
291
291
  }), n("inbox.logMessageModal.actionRequired", "Requires action")]
292
292
  }),
293
- /* @__PURE__ */ H("div", {
293
+ /* @__PURE__ */ V("div", {
294
294
  className: "flex justify-end gap-3",
295
- children: [/* @__PURE__ */ V("button", {
295
+ children: [/* @__PURE__ */ B("button", {
296
296
  type: "button",
297
297
  onClick: t,
298
298
  className: "rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
299
299
  children: n("inbox.logMessageModal.cancel", "Cancel")
300
- }), /* @__PURE__ */ V("button", {
300
+ }), /* @__PURE__ */ B("button", {
301
301
  type: "submit",
302
302
  disabled: r.isPending,
303
303
  className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50",
@@ -308,67 +308,67 @@ function ie({ channel: e, onClose: t }) {
308
308
  })
309
309
  });
310
310
  }
311
- function ae({ channel: e, onVerify: t, verifying: n, onLog: r }) {
312
- let a = l(), s = X[e.type] ?? F, c = e.status === "VERIFIED";
313
- return /* @__PURE__ */ H(U, {
311
+ function fe({ channel: e, onVerify: t, verifying: n, onLog: r }) {
312
+ let a = l(), s = Z[e.type] ?? P, c = e.status === "VERIFIED";
313
+ return /* @__PURE__ */ V(K, {
314
314
  treatment: "metric",
315
315
  className: "flex flex-col p-4",
316
316
  children: [
317
- /* @__PURE__ */ H("div", {
317
+ /* @__PURE__ */ V("div", {
318
318
  className: "flex items-start justify-between gap-2",
319
- children: [/* @__PURE__ */ H("div", {
319
+ children: [/* @__PURE__ */ V("div", {
320
320
  className: "flex min-w-0 items-center gap-2.5",
321
- children: [/* @__PURE__ */ V("span", {
321
+ children: [/* @__PURE__ */ B("span", {
322
322
  className: "flex size-9 shrink-0 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-text-primary",
323
- children: /* @__PURE__ */ V(s, { className: "h-4 w-4" })
324
- }), /* @__PURE__ */ H("div", {
323
+ children: /* @__PURE__ */ B(s, { className: "h-4 w-4" })
324
+ }), /* @__PURE__ */ V("div", {
325
325
  className: "min-w-0",
326
- children: [/* @__PURE__ */ V("p", {
326
+ children: [/* @__PURE__ */ B("p", {
327
327
  className: "truncate text-sm font-semibold text-text-primary",
328
328
  children: i(e.type)
329
- }), e.label && /* @__PURE__ */ V("p", {
329
+ }), e.label && /* @__PURE__ */ B("p", {
330
330
  className: "truncate text-xs text-text-secondary",
331
331
  children: e.label
332
332
  })]
333
333
  })]
334
- }), /* @__PURE__ */ V(o, { status: e.status })]
334
+ }), /* @__PURE__ */ B(o, { status: e.status })]
335
335
  }),
336
- /* @__PURE__ */ H("div", {
336
+ /* @__PURE__ */ V("div", {
337
337
  className: "mt-3 border-t border-border-subtle pt-3",
338
- children: [/* @__PURE__ */ V("p", {
338
+ children: [/* @__PURE__ */ B("p", {
339
339
  className: "text-[11px] uppercase tracking-wide text-text-secondary",
340
340
  children: e.ingestEnabled ? a("inbox.channels.ingestingFrom", "Ingesting from") : a("inbox.channels.ingestPaused", "Ingest paused")
341
- }), /* @__PURE__ */ V("p", {
341
+ }), /* @__PURE__ */ B("p", {
342
342
  className: "mt-0.5 truncate text-sm text-text-primary",
343
343
  title: e.address,
344
344
  children: e.address
345
345
  })]
346
346
  }),
347
- /* @__PURE__ */ H("div", {
347
+ /* @__PURE__ */ V("div", {
348
348
  className: "mt-auto flex flex-wrap items-center gap-2 pt-3",
349
349
  children: [
350
- e.status === "PENDING" && /* @__PURE__ */ H("button", {
350
+ e.status === "PENDING" && /* @__PURE__ */ V("button", {
351
351
  type: "button",
352
352
  disabled: n,
353
353
  onClick: () => t(e.id),
354
354
  className: "inline-flex items-center gap-1 rounded-lg bg-action-primary-bg px-3 py-1.5 text-xs font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50",
355
355
  children: [
356
- /* @__PURE__ */ V(C, { className: "h-3.5 w-3.5" }),
356
+ /* @__PURE__ */ B(S, { className: "h-3.5 w-3.5" }),
357
357
  " ",
358
358
  a("inbox.channels.verify", "Verify")
359
359
  ]
360
360
  }),
361
- c && e.ingestEnabled && /* @__PURE__ */ H("button", {
361
+ c && e.ingestEnabled && /* @__PURE__ */ V("button", {
362
362
  type: "button",
363
363
  onClick: () => r(e),
364
364
  className: "inline-flex items-center gap-1 rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken",
365
365
  children: [
366
- /* @__PURE__ */ V(I, { className: "h-3.5 w-3.5" }),
366
+ /* @__PURE__ */ B(F, { className: "h-3.5 w-3.5" }),
367
367
  " ",
368
368
  a("inbox.channels.logTestMessage", "Log test message")
369
369
  ]
370
370
  }),
371
- e.status === "DISABLED" && /* @__PURE__ */ V("span", {
371
+ e.status === "DISABLED" && /* @__PURE__ */ B("span", {
372
372
  className: "text-xs text-text-secondary",
373
373
  children: a("inbox.channels.disabled", "Channel disabled")
374
374
  })
@@ -377,112 +377,113 @@ function ae({ channel: e, onVerify: t, verifying: n, onLog: r }) {
377
377
  ]
378
378
  });
379
379
  }
380
- function oe() {
381
- let e = l(), { data: t, isLoading: n, isError: r, refetch: i } = m(), a = y(), [o, c] = x(!1), [p, h] = x(null), g = t ?? [], _ = g.filter((e) => e.status === "VERIFIED").length, v = g.filter((e) => e.status === "PENDING").length;
382
- return /* @__PURE__ */ H(f, {
380
+ function pe() {
381
+ let e = l(), { data: t, isLoading: n, isError: r, refetch: i } = m(), a = y(), [o, c] = b(!1), [p, h] = b(null), g = t ?? [], _ = g.filter((e) => e.status === "VERIFIED").length, v = g.filter((e) => e.status === "PENDING").length;
382
+ return /* @__PURE__ */ V(f, {
383
383
  title: e("inbox.channels.title", "Ingest channels"),
384
384
  description: e("inbox.channels.description", "The sources the Universal Inbox pulls subscription communication from"),
385
- action: /* @__PURE__ */ H("button", {
385
+ action: /* @__PURE__ */ V("button", {
386
386
  type: "button",
387
387
  onClick: () => c(!0),
388
388
  className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-3 py-1.5 text-xs font-medium text-action-primary-text hover:opacity-90",
389
389
  children: [
390
- /* @__PURE__ */ V(P, { className: "h-3.5 w-3.5" }),
390
+ /* @__PURE__ */ B(N, { className: "h-3.5 w-3.5" }),
391
391
  " ",
392
392
  e("inbox.channels.add", "Add channel")
393
393
  ]
394
394
  }),
395
395
  children: [
396
- n ? /* @__PURE__ */ V(d, { label: e("inbox.channels.loading", "Loading channels…") }) : r ? /* @__PURE__ */ V(u, {
396
+ n ? /* @__PURE__ */ B(d, { label: e("inbox.channels.loading", "Loading channels…") }) : r ? /* @__PURE__ */ B(u, {
397
397
  message: e("inbox.channels.error", "Could not load channels."),
398
398
  onRetry: () => void i()
399
- }) : g.length === 0 ? /* @__PURE__ */ V(s, {
399
+ }) : g.length === 0 ? /* @__PURE__ */ B(s, {
400
400
  illustration: "empty-data",
401
- icon: /* @__PURE__ */ V(F, { className: "h-12 w-12" }),
401
+ icon: /* @__PURE__ */ B(P, { className: "h-12 w-12" }),
402
402
  title: e("inbox.channels.emptyTitle", "No channels yet"),
403
403
  description: e("inbox.channels.emptyDescription", "Add an email, SMS, Slack or webhook channel to start ingesting subscription communication.")
404
- }) : /* @__PURE__ */ H(B, { children: [(_ > 0 || v > 0) && /* @__PURE__ */ H("div", {
404
+ }) : /* @__PURE__ */ V(z, { children: [(_ > 0 || v > 0) && /* @__PURE__ */ V("div", {
405
405
  className: "mb-3 flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-text-secondary",
406
- children: [/* @__PURE__ */ H("span", {
406
+ children: [/* @__PURE__ */ V("span", {
407
407
  className: "inline-flex items-center gap-1.5",
408
- children: [/* @__PURE__ */ V("span", {
408
+ children: [/* @__PURE__ */ B("span", {
409
409
  className: "size-1.5 rounded-full bg-status-success-text",
410
410
  "aria-hidden": !0
411
411
  }), e("inbox.channels.verified", "{{count}} verified", { count: _ })]
412
- }), v > 0 && /* @__PURE__ */ H("span", {
412
+ }), v > 0 && /* @__PURE__ */ V("span", {
413
413
  className: "inline-flex items-center gap-1.5",
414
- children: [/* @__PURE__ */ V("span", {
414
+ children: [/* @__PURE__ */ B("span", {
415
415
  className: "size-1.5 rounded-full bg-status-warning-text",
416
416
  "aria-hidden": !0
417
417
  }), e("inbox.channels.pending", "{{count}} pending verification", { count: v })]
418
418
  })]
419
- }), /* @__PURE__ */ V("div", {
419
+ }), /* @__PURE__ */ B("div", {
420
420
  className: "grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",
421
- children: g.map((e) => /* @__PURE__ */ V(ae, {
421
+ children: g.map((e) => /* @__PURE__ */ B(fe, {
422
422
  channel: e,
423
423
  verifying: a.isPending,
424
424
  onVerify: (e) => a.mutate(e),
425
425
  onLog: (e) => h(e)
426
426
  }, e.id))
427
427
  })] }),
428
- o && /* @__PURE__ */ V(re, { onClose: () => c(!1) }),
429
- p && /* @__PURE__ */ V(ie, {
428
+ o && /* @__PURE__ */ B(ue, { onClose: () => c(!1) }),
429
+ p && /* @__PURE__ */ B(de, {
430
430
  channel: p,
431
431
  onClose: () => h(null)
432
432
  })
433
433
  ]
434
434
  });
435
435
  }
436
- function se({ message: e, active: n, onSelect: r, onMarkRead: i, markPending: o, onViewRelationship: s }) {
436
+ function me({ message: e, active: n, onSelect: r, onChangeReadState: i, markPending: o, onViewRelationship: s }) {
437
437
  let c = l(), u = !e.isRead;
438
- return /* @__PURE__ */ H("div", {
438
+ return /* @__PURE__ */ V("div", {
439
439
  role: "button",
440
440
  tabIndex: 0,
441
441
  "aria-pressed": n,
442
+ "aria-label": c("inbox.message.open", "Open message: {{subject}}", { subject: e.subject || c("inbox.message.noSubject", "(no subject)") }),
442
443
  onClick: r,
443
444
  onKeyDown: (e) => {
444
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), r());
445
+ e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), r());
445
446
  },
446
447
  className: t("relative flex cursor-pointer items-start gap-3 p-4 transition-colors", "focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] focus-visible:ring-inset", n ? "bg-bg-sunken" : u ? "bg-accent-wash" : "hover:bg-bg-sunken/60"),
447
448
  children: [
448
- u && /* @__PURE__ */ V("span", {
449
+ u && /* @__PURE__ */ B("span", {
449
450
  "aria-hidden": !0,
450
451
  className: "absolute inset-y-0 left-0 w-0.5 bg-text-link"
451
452
  }),
452
- /* @__PURE__ */ V("span", {
453
+ /* @__PURE__ */ B("span", {
453
454
  className: "mt-0.5 shrink-0 text-text-secondary",
454
- children: u ? /* @__PURE__ */ V(O, { className: "h-4 w-4 text-text-link" }) : /* @__PURE__ */ V(k, { className: "h-4 w-4" })
455
+ children: u ? /* @__PURE__ */ B(E, { className: "h-4 w-4 text-text-link" }) : /* @__PURE__ */ B(D, { className: "h-4 w-4" })
455
456
  }),
456
- /* @__PURE__ */ H("div", {
457
+ /* @__PURE__ */ V("div", {
457
458
  className: "min-w-0 flex-1",
458
459
  children: [
459
- /* @__PURE__ */ H("div", {
460
+ /* @__PURE__ */ V("div", {
460
461
  className: "flex items-center gap-2",
461
462
  children: [
462
- u && /* @__PURE__ */ V("span", {
463
+ u && /* @__PURE__ */ B("span", {
463
464
  "aria-label": c("inbox.message.unreadAria", "Unread"),
464
465
  className: "size-1.5 shrink-0 rounded-full bg-text-link"
465
466
  }),
466
- /* @__PURE__ */ V("p", {
467
+ /* @__PURE__ */ B("p", {
467
468
  className: t("min-w-0 flex-1 truncate text-sm", u ? "font-semibold text-text-primary" : "font-normal text-text-primary"),
468
469
  children: e.subject || c("inbox.message.noSubject", "(no subject)")
469
470
  }),
470
- /* @__PURE__ */ V("span", {
471
+ /* @__PURE__ */ B("span", {
471
472
  className: "shrink-0 text-xs tabular-nums text-text-secondary",
472
473
  children: a(e.receivedAt)
473
474
  })
474
475
  ]
475
476
  }),
476
- e.preview && /* @__PURE__ */ V("p", {
477
+ e.preview && /* @__PURE__ */ B("p", {
477
478
  className: "mt-0.5 line-clamp-2 text-xs text-text-secondary",
478
479
  children: e.preview
479
480
  }),
480
- /* @__PURE__ */ H("div", {
481
+ /* @__PURE__ */ V("div", {
481
482
  className: "mt-1.5 flex flex-wrap items-center gap-2",
482
483
  children: [
483
- /* @__PURE__ */ V(Z, { category: e.category }),
484
- e.actionRequired && /* @__PURE__ */ V(Q, {}),
485
- s && /* @__PURE__ */ V("button", {
484
+ /* @__PURE__ */ B(Q, { category: e.category }),
485
+ e.actionRequired && /* @__PURE__ */ B(le, {}),
486
+ s && /* @__PURE__ */ B("button", {
486
487
  type: "button",
487
488
  onClick: (e) => {
488
489
  e.stopPropagation(), s();
@@ -490,15 +491,29 @@ function se({ message: e, active: n, onSelect: r, onMarkRead: i, markPending: o,
490
491
  className: "text-xs font-medium text-text-link hover:underline",
491
492
  children: c("inbox.message.viewRelationship", "View relationship")
492
493
  }),
493
- u && /* @__PURE__ */ V("button", {
494
- type: "button",
495
- disabled: o,
496
- onClick: (e) => {
497
- e.stopPropagation(), i();
498
- },
499
- className: "ml-auto shrink-0 rounded-lg border border-border-subtle px-2.5 py-1 text-xs font-medium text-text-primary hover:bg-bg-sunken disabled:opacity-50",
500
- children: c("inbox.message.markRead", "Mark read")
501
- })
494
+ /* @__PURE__ */ V(H, { children: [/* @__PURE__ */ B(G, {
495
+ asChild: !0,
496
+ children: /* @__PURE__ */ B("button", {
497
+ type: "button",
498
+ disabled: o,
499
+ "aria-label": c("inbox.message.actions", "Message actions for {{subject}}", { subject: e.subject || c("inbox.message.noSubject", "(no subject)") }),
500
+ onClick: (e) => e.stopPropagation(),
501
+ className: "ml-auto shrink-0 rounded-lg border border-border-subtle px-2.5 py-1 text-xs font-medium text-text-primary hover:bg-bg-sunken disabled:opacity-50",
502
+ children: /* @__PURE__ */ B(A, {
503
+ className: "h-4 w-4",
504
+ "aria-hidden": !0
505
+ })
506
+ })
507
+ }), /* @__PURE__ */ B(U, {
508
+ align: "end",
509
+ onClick: (e) => e.stopPropagation(),
510
+ onKeyDown: (e) => e.stopPropagation(),
511
+ children: /* @__PURE__ */ B(W, {
512
+ disabled: o,
513
+ onSelect: i,
514
+ children: u ? c("inbox.message.markRead", "Mark read") : c("inbox.message.markUnread", "Mark unread")
515
+ })
516
+ })] })
502
517
  ]
503
518
  })
504
519
  ]
@@ -506,114 +521,114 @@ function se({ message: e, active: n, onSelect: r, onMarkRead: i, markPending: o,
506
521
  ]
507
522
  });
508
523
  }
509
- function ce({ message: e, channel: t, onMarkRead: n, markPending: i, onViewRelationship: a }) {
524
+ function he({ message: e, channel: t, onChangeReadState: n, markPending: i, onViewRelationship: a }) {
510
525
  let o = l();
511
- if (!e) return /* @__PURE__ */ H(U, {
526
+ if (!e) return /* @__PURE__ */ V(K, {
512
527
  treatment: "metric",
513
528
  className: "flex min-h-[20rem] flex-col items-center justify-center p-8 text-center",
514
529
  children: [
515
- /* @__PURE__ */ V(M, { className: "h-10 w-10 text-text-secondary" }),
516
- /* @__PURE__ */ V("p", {
530
+ /* @__PURE__ */ B(j, { className: "h-10 w-10 text-text-secondary" }),
531
+ /* @__PURE__ */ B("p", {
517
532
  className: "mt-3 text-sm font-medium text-text-primary",
518
533
  children: o("inbox.readingPane.selectTitle", "Select a message")
519
534
  }),
520
- /* @__PURE__ */ V("p", {
535
+ /* @__PURE__ */ B("p", {
521
536
  className: "mt-1 max-w-[16rem] text-xs text-text-secondary",
522
537
  children: o("inbox.readingPane.selectDescription", "Pick any message from the list to read the full details here.")
523
538
  })
524
539
  ]
525
540
  });
526
- let s = t ? X[t.type] ?? F : F, c = e.categoryConfidence == null ? null : Math.round(Math.max(0, Math.min(1, e.categoryConfidence)) * 100);
527
- return /* @__PURE__ */ H(U, {
541
+ let s = t ? Z[t.type] ?? P : P, c = e.categoryConfidence == null ? null : Math.round(Math.max(0, Math.min(1, e.categoryConfidence)) * 100);
542
+ return /* @__PURE__ */ V(K, {
528
543
  treatment: "metric",
529
544
  className: "flex flex-col p-5",
530
545
  children: [
531
- /* @__PURE__ */ H("div", {
546
+ /* @__PURE__ */ V("div", {
532
547
  className: "flex items-start justify-between gap-3",
533
- children: [/* @__PURE__ */ V("h3", {
548
+ children: [/* @__PURE__ */ B("h3", {
534
549
  className: "text-base font-semibold text-text-primary",
535
550
  children: e.subject || o("inbox.message.noSubject", "(no subject)")
536
- }), !e.isRead && /* @__PURE__ */ V("button", {
551
+ }), /* @__PURE__ */ B("button", {
537
552
  type: "button",
538
553
  disabled: i,
539
554
  onClick: n,
540
555
  className: "shrink-0 rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken disabled:opacity-50",
541
- children: o("inbox.message.markRead", "Mark read")
556
+ children: i ? o("inbox.message.saving", "Saving…") : e.isRead ? o("inbox.message.markUnread", "Mark unread") : o("inbox.message.markRead", "Mark read")
542
557
  })]
543
558
  }),
544
- t && /* @__PURE__ */ H("div", {
559
+ t && /* @__PURE__ */ V("div", {
545
560
  className: "mt-2 flex items-center gap-2 text-sm",
546
- children: [/* @__PURE__ */ V(s, { className: "h-4 w-4 shrink-0 text-text-secondary" }), /* @__PURE__ */ V("span", {
561
+ children: [/* @__PURE__ */ B(s, { className: "h-4 w-4 shrink-0 text-text-secondary" }), /* @__PURE__ */ B("span", {
547
562
  className: "truncate text-text-secondary",
548
563
  title: t.address,
549
564
  children: t.address
550
565
  })]
551
566
  }),
552
- /* @__PURE__ */ H("div", {
567
+ /* @__PURE__ */ V("div", {
553
568
  className: "mt-3 flex flex-wrap items-center gap-2",
554
569
  children: [
555
- /* @__PURE__ */ V(Z, { category: e.category }),
556
- e.actionRequired && /* @__PURE__ */ V(Q, {}),
557
- /* @__PURE__ */ V("span", {
570
+ /* @__PURE__ */ B(Q, { category: e.category }),
571
+ e.actionRequired && /* @__PURE__ */ B(le, {}),
572
+ /* @__PURE__ */ B("span", {
558
573
  className: "text-xs text-text-secondary",
559
574
  children: r(e.receivedAt)
560
575
  })
561
576
  ]
562
577
  }),
563
- c != null && /* @__PURE__ */ H("div", {
578
+ c != null && /* @__PURE__ */ V("div", {
564
579
  className: "mt-4 rounded-lg border border-border-subtle bg-bg-surface p-3",
565
- children: [/* @__PURE__ */ H("div", {
580
+ children: [/* @__PURE__ */ V("div", {
566
581
  className: "flex items-center justify-between text-xs",
567
- children: [/* @__PURE__ */ H("span", {
582
+ children: [/* @__PURE__ */ V("span", {
568
583
  className: "inline-flex items-center gap-1.5 font-medium text-text-primary",
569
584
  children: [
570
- /* @__PURE__ */ V(R, { className: "h-3.5 w-3.5 text-text-link" }),
585
+ /* @__PURE__ */ B(L, { className: "h-3.5 w-3.5 text-text-link" }),
571
586
  " ",
572
587
  o("inbox.readingPane.aiCategorization", "AI categorization")
573
588
  ]
574
- }), /* @__PURE__ */ V("span", {
589
+ }), /* @__PURE__ */ B("span", {
575
590
  className: "tabular-nums text-text-secondary",
576
591
  children: o("inbox.readingPane.confidence", "{{pct}}% confidence", { pct: c })
577
592
  })]
578
- }), /* @__PURE__ */ V(p, {
593
+ }), /* @__PURE__ */ B(p, {
579
594
  value: c,
580
595
  max: 100,
581
596
  tone: c >= 66 ? "positive" : c >= 33 ? "accent" : "warning",
582
597
  className: "mt-2"
583
598
  })]
584
599
  }),
585
- /* @__PURE__ */ V("div", {
600
+ /* @__PURE__ */ B("div", {
586
601
  className: "mt-4 border-t border-border-subtle pt-4",
587
- children: e.preview ? /* @__PURE__ */ V("p", {
602
+ children: e.preview ? /* @__PURE__ */ B("p", {
588
603
  className: "whitespace-pre-wrap text-sm leading-relaxed text-text-primary",
589
604
  children: e.preview
590
- }) : /* @__PURE__ */ V("p", {
605
+ }) : /* @__PURE__ */ B("p", {
591
606
  className: "text-sm italic text-text-secondary",
592
607
  children: o("inbox.readingPane.noPreview", "No preview available for this message.")
593
608
  })
594
609
  }),
595
- e.actionRequired && /* @__PURE__ */ H("div", {
610
+ e.actionRequired && /* @__PURE__ */ V("div", {
596
611
  className: "mt-4 flex items-start gap-2 rounded-lg border border-status-warning-text/30 bg-status-warning-bg-subtle p-3",
597
- children: [/* @__PURE__ */ V(L, { className: "mt-0.5 h-4 w-4 shrink-0 text-status-warning-text" }), /* @__PURE__ */ V("p", {
612
+ children: [/* @__PURE__ */ B(I, { className: "mt-0.5 h-4 w-4 shrink-0 text-status-warning-text" }), /* @__PURE__ */ B("p", {
598
613
  className: "text-xs text-status-warning-text",
599
614
  children: o("inbox.readingPane.attention", "This message needs your attention — review it before its provider deadline.")
600
615
  })]
601
616
  }),
602
- a && /* @__PURE__ */ H("button", {
617
+ a && /* @__PURE__ */ V("button", {
603
618
  type: "button",
604
619
  onClick: a,
605
620
  className: "mt-4 inline-flex items-center gap-1 self-start text-sm font-medium text-text-link hover:underline",
606
621
  children: [
607
622
  o("inbox.message.viewRelationship", "View relationship"),
608
623
  " ",
609
- /* @__PURE__ */ V(T, { className: "h-4 w-4" })
624
+ /* @__PURE__ */ B(w, { className: "h-4 w-4" })
610
625
  ]
611
626
  })
612
627
  ]
613
628
  });
614
629
  }
615
630
  function $({ active: e, onClick: n, children: r, tone: i = "default" }) {
616
- return /* @__PURE__ */ V("button", {
631
+ return /* @__PURE__ */ B("button", {
617
632
  type: "button",
618
633
  onClick: n,
619
634
  "aria-pressed": e,
@@ -621,158 +636,181 @@ function $({ active: e, onClick: n, children: r, tone: i = "default" }) {
621
636
  children: r
622
637
  });
623
638
  }
624
- function le() {
625
- let r = l(), { navigateTo: i } = e(), [a, o] = x(0), [c, f] = x(""), [p, h] = x(!1), [_, y] = x(!1), [C, w] = b("inbox"), { data: T, isLoading: E, isError: k, refetch: A, isFetching: j } = g({
639
+ function ge() {
640
+ let r = l(), { navigateTo: i } = e(), [a, o] = b(0), [c, f] = b(""), [p, h] = b(!1), [_, y] = b(!1), [S, C] = te("inbox"), { data: w, isLoading: T, isError: D, refetch: O, isFetching: k } = g({
626
641
  category: c || void 0,
627
642
  unreadOnly: p || void 0,
628
643
  pagination: {
629
- limit: G,
630
- offset: a * G
644
+ limit: q,
645
+ offset: a * q
631
646
  }
632
- }), { data: M } = m(), N = v(), P = T?.items ?? [], F = T?.pageInfo.hasMore ?? !1, I = _ ? P.filter((e) => e.actionRequired) : P, L = P.filter((e) => !e.isRead).length, R = P.filter((e) => e.actionRequired).length, z = new Map((M ?? []).map((e) => [e.id, e])), B = I.find((e) => e.id === C) ?? null, U = B ? z.get(B.channelId) : void 0, K = () => {
633
- o(0), w(null);
647
+ }), { data: A } = m(), j = v(), M = ee(), N = ne(!1), [P, F] = b(!1), I = j.isPending || M.isPending, L = async (e) => {
648
+ if (!N.current) {
649
+ N.current = !0, F(!1);
650
+ try {
651
+ await (e.isRead ? M : j).mutateAsync(e.id);
652
+ } catch {
653
+ F(!0);
654
+ } finally {
655
+ N.current = !1;
656
+ }
657
+ }
658
+ }, R = w?.items ?? [], z = w?.pageInfo.hasMore ?? !1, H = _ ? R.filter((e) => e.actionRequired) : R, U = R.filter((e) => !e.isRead).length, W = R.filter((e) => e.actionRequired).length, G = new Map((A ?? []).map((e) => [e.id, e])), K = H.find((e) => e.id === S) ?? null, J = K ? G.get(K.channelId) : void 0, Y = () => {
659
+ o(0), C(null);
634
660
  };
635
- return /* @__PURE__ */ H(n, {
661
+ return /* @__PURE__ */ V(n, {
636
662
  title: r("inbox.title", "Universal Inbox"),
637
663
  description: r("inbox.description", "Every subscription communication, merged and categorized"),
638
664
  children: [
639
- /* @__PURE__ */ V(W, {
665
+ /* @__PURE__ */ B(ie, {
640
666
  className: "mb-4",
641
667
  children: r("inbox.purpose", "Subscription communication is noisy and scattered. The Universal Inbox merges every channel a provider uses and uses AI to categorize each message so you never miss a renewal, required action or security notice.")
642
668
  }),
643
- /* @__PURE__ */ V("div", {
669
+ /* @__PURE__ */ B("div", {
644
670
  className: "-mx-1 flex gap-2 overflow-x-auto px-1 pb-1",
645
- children: te.map((e) => /* @__PURE__ */ V("span", {
671
+ children: se.map((e) => /* @__PURE__ */ B("span", {
646
672
  className: "shrink-0",
647
- children: /* @__PURE__ */ V($, {
673
+ children: /* @__PURE__ */ B($, {
648
674
  active: c === e.value,
649
675
  onClick: () => {
650
- f(e.value), K();
676
+ f(e.value), Y();
651
677
  },
652
678
  children: r(e.key, e.fallback)
653
679
  })
654
680
  }, e.value))
655
681
  }),
656
- /* @__PURE__ */ H("div", {
682
+ /* @__PURE__ */ V("div", {
657
683
  className: "mt-3 flex flex-wrap items-center gap-2",
658
684
  children: [
659
- /* @__PURE__ */ H($, {
685
+ /* @__PURE__ */ V($, {
660
686
  active: _,
661
687
  tone: "warning",
662
688
  onClick: () => {
663
- y((e) => !e), w(null);
689
+ y((e) => !e), C(null);
664
690
  },
665
691
  children: [
666
- /* @__PURE__ */ V(S, { className: "h-3.5 w-3.5" }),
692
+ /* @__PURE__ */ B(x, { className: "h-3.5 w-3.5" }),
667
693
  " ",
668
694
  r("inbox.filters.actionRequired", "Action required")
669
695
  ]
670
696
  }),
671
- /* @__PURE__ */ H($, {
697
+ /* @__PURE__ */ V($, {
672
698
  active: p,
673
699
  onClick: () => {
674
- h((e) => !e), K();
700
+ h((e) => !e), Y();
675
701
  },
676
702
  children: [
677
- /* @__PURE__ */ V(O, { className: "h-3.5 w-3.5" }),
703
+ /* @__PURE__ */ B(E, { className: "h-3.5 w-3.5" }),
678
704
  " ",
679
705
  r("inbox.filters.unreadOnly", "Unread only")
680
706
  ]
681
707
  }),
682
- !E && !k && P.length > 0 && /* @__PURE__ */ H("p", {
708
+ !T && !D && R.length > 0 && /* @__PURE__ */ V("p", {
683
709
  className: "ml-auto text-xs text-text-secondary",
684
710
  children: [
685
- r("inbox.filters.unreadCount", "{{count}} unread", { count: L }),
711
+ r("inbox.filters.unreadCount", "{{count}} unread", { count: U }),
686
712
  " · ",
687
- r("inbox.filters.actionCount", "{{count}} need action", { count: R }),
688
- j ? ` · ${r("inbox.filters.refreshing", "refreshing…")}` : ""
713
+ r("inbox.filters.actionCount", "{{count}} need action", { count: W }),
714
+ k ? ` · ${r("inbox.filters.refreshing", "refreshing…")}` : ""
689
715
  ]
690
716
  })
691
717
  ]
692
718
  }),
693
- E ? /* @__PURE__ */ V(d, { label: r("inbox.loading", "Loading inbox…") }) : k ? /* @__PURE__ */ V(u, {
719
+ I && /* @__PURE__ */ B("p", {
720
+ role: "status",
721
+ className: "mt-3 text-sm text-text-secondary",
722
+ children: r("inbox.message.saving", "Saving…")
723
+ }),
724
+ P && /* @__PURE__ */ B("p", {
725
+ role: "alert",
726
+ className: "mt-3 text-sm text-status-error-text",
727
+ children: r("inbox.message.updateError", "Could not update the message. Please try again.")
728
+ }),
729
+ T ? /* @__PURE__ */ B(d, { label: r("inbox.loading", "Loading inbox…") }) : D ? /* @__PURE__ */ B(u, {
694
730
  message: r("inbox.error", "Could not load the inbox."),
695
- onRetry: () => void A()
696
- }) : P.length === 0 ? /* @__PURE__ */ V("div", {
731
+ onRetry: () => void O()
732
+ }) : R.length === 0 ? /* @__PURE__ */ B("div", {
697
733
  className: "mt-6",
698
- children: /* @__PURE__ */ V(s, {
734
+ children: /* @__PURE__ */ B(s, {
699
735
  illustration: "empty-inbox",
700
- icon: /* @__PURE__ */ V(D, { className: "h-12 w-12" }),
736
+ icon: /* @__PURE__ */ B(re, { className: "h-12 w-12" }),
701
737
  title: r("inbox.emptyTitle", "Inbox is empty"),
702
738
  description: p || c ? r("inbox.emptyDescriptionFiltered", "No messages match these filters.") : r("inbox.emptyDescription", "Merged subscription communications will appear here once channels start ingesting.")
703
739
  })
704
- }) : /* @__PURE__ */ H("div", {
740
+ }) : /* @__PURE__ */ V("div", {
705
741
  className: "mt-5 grid grid-cols-1 gap-5 lg:grid-cols-[minmax(0,1fr)_380px]",
706
- children: [/* @__PURE__ */ H("div", {
742
+ children: [/* @__PURE__ */ V("div", {
707
743
  className: "min-w-0",
708
- children: [I.length === 0 ? /* @__PURE__ */ H("div", {
744
+ children: [H.length === 0 ? /* @__PURE__ */ V("div", {
709
745
  className: "rounded-xl border border-border-subtle bg-bg-surface p-8 text-center",
710
746
  children: [
711
- /* @__PURE__ */ V(S, { className: "mx-auto h-8 w-8 text-text-secondary" }),
712
- /* @__PURE__ */ V("p", {
747
+ /* @__PURE__ */ B(x, { className: "mx-auto h-8 w-8 text-text-secondary" }),
748
+ /* @__PURE__ */ B("p", {
713
749
  className: "mt-2 text-sm font-medium text-text-primary",
714
750
  children: r("inbox.noActionTitle", "No action-required messages on this page")
715
751
  }),
716
- /* @__PURE__ */ V("p", {
752
+ /* @__PURE__ */ B("p", {
717
753
  className: "mt-1 text-xs text-text-secondary",
718
754
  children: r("inbox.noActionDescription", "Turn off the “Action required” lens or move to another page.")
719
755
  })
720
756
  ]
721
- }) : /* @__PURE__ */ V("div", {
757
+ }) : /* @__PURE__ */ B("div", {
722
758
  className: "divide-y divide-border-subtle overflow-hidden rounded-xl border border-border-subtle bg-bg-surface",
723
- children: I.map((e) => /* @__PURE__ */ V(se, {
759
+ children: H.map((e) => /* @__PURE__ */ B(me, {
724
760
  message: e,
725
- active: e.id === C,
726
- onSelect: () => w(e.id),
727
- onMarkRead: () => N.mutate(e.id),
728
- markPending: N.isPending,
761
+ active: e.id === S,
762
+ onSelect: () => C(e.id),
763
+ onChangeReadState: () => void L(e),
764
+ markPending: I,
729
765
  onViewRelationship: e.relationshipId ? () => i(`/relationships/${e.relationshipId}`) : null
730
766
  }, e.id))
731
- }), /* @__PURE__ */ H("div", {
767
+ }), /* @__PURE__ */ V("div", {
732
768
  className: "mt-4 flex items-center justify-between",
733
- children: [/* @__PURE__ */ H("p", {
769
+ children: [/* @__PURE__ */ V("p", {
734
770
  className: "text-xs text-text-secondary",
735
- children: [r("inbox.pagination.page", "Page {{page}}", { page: a + 1 }), j ? ` · ${r("inbox.filters.refreshing", "refreshing…")}` : ""]
736
- }), /* @__PURE__ */ H("div", {
771
+ children: [r("inbox.pagination.page", "Page {{page}}", { page: a + 1 }), k ? ` · ${r("inbox.filters.refreshing", "refreshing…")}` : ""]
772
+ }), /* @__PURE__ */ V("div", {
737
773
  className: "flex gap-2",
738
- children: [/* @__PURE__ */ V("button", {
774
+ children: [/* @__PURE__ */ B("button", {
739
775
  type: "button",
740
776
  disabled: a === 0,
741
777
  onClick: () => {
742
- o((e) => Math.max(0, e - 1)), w(null);
778
+ o((e) => Math.max(0, e - 1)), C(null);
743
779
  },
744
780
  className: t("rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium", a === 0 ? "cursor-not-allowed text-text-secondary opacity-50" : "text-text-primary hover:bg-bg-sunken"),
745
781
  children: r("inbox.pagination.previous", "Previous")
746
- }), /* @__PURE__ */ V("button", {
782
+ }), /* @__PURE__ */ B("button", {
747
783
  type: "button",
748
- disabled: !F,
784
+ disabled: !z,
749
785
  onClick: () => {
750
- o((e) => e + 1), w(null);
786
+ o((e) => e + 1), C(null);
751
787
  },
752
- className: t("rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium", F ? "text-text-primary hover:bg-bg-sunken" : "cursor-not-allowed text-text-secondary opacity-50"),
788
+ className: t("rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium", z ? "text-text-primary hover:bg-bg-sunken" : "cursor-not-allowed text-text-secondary opacity-50"),
753
789
  children: r("inbox.pagination.next", "Next")
754
790
  })]
755
791
  })]
756
792
  })]
757
- }), /* @__PURE__ */ V("aside", {
793
+ }), /* @__PURE__ */ B("aside", {
758
794
  className: "hidden lg:block",
759
- children: /* @__PURE__ */ V("div", {
795
+ children: /* @__PURE__ */ B("div", {
760
796
  className: "lg:sticky lg:top-4",
761
- children: /* @__PURE__ */ V(ce, {
762
- message: B,
763
- channel: U,
764
- onMarkRead: () => B && N.mutate(B.id),
765
- markPending: N.isPending,
766
- onViewRelationship: B?.relationshipId ? () => i(`/relationships/${B.relationshipId}`) : null
797
+ children: /* @__PURE__ */ B(he, {
798
+ message: K,
799
+ channel: J,
800
+ onChangeReadState: () => {
801
+ K && L(K);
802
+ },
803
+ markPending: I,
804
+ onViewRelationship: K?.relationshipId ? () => i(`/relationships/${K.relationshipId}`) : null
767
805
  })
768
806
  })
769
807
  })]
770
808
  }),
771
- /* @__PURE__ */ V(oe, {})
809
+ /* @__PURE__ */ B(pe, {})
772
810
  ]
773
811
  });
774
812
  }
775
813
  //#endregion
776
- export { le as InboxPage };
814
+ export { ge as InboxPage };
777
815
 
778
816
  //# sourceMappingURL=InboxPage.js.map