@burdenoff/microfe-notification 2026.625.2 → 2026.626.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.
@@ -10,28 +10,28 @@ import { useUserSearch as ie } from "../hooks/useUserSearch.js";
10
10
  import { RecipientSelector as ae } from "../components/RecipientSelector.js";
11
11
  import { useMemo as a, useState as o } from "react";
12
12
  import { useGlobalUi as oe, usePermissions as se } from "@burdenoff/fe-libs/shared/providers/shell";
13
- import { AlertCircle as ce, ArrowLeft as le, Bell as ue, CheckCircle2 as s, Eye as de, EyeOff as fe, FileText as pe, ImagePlus as me, Link2 as he, Loader2 as c, Mail as l, MessageSquare as u, Send as ge, Smartphone as _e, User as d, Users as ve, X as ye } from "lucide-react";
14
- import { useNavigate as be } from "react-router-dom";
15
- import { Fragment as xe, jsx as f, jsxs as p } from "react/jsx-runtime";
16
- import { CTAOverflowMenu as Se, GlassCard as Ce } from "@burdenoff/fe-libs/ui";
13
+ import { AlertCircle as ce, ArrowLeft as le, Bell as ue, CheckCircle2 as s, Eye as de, EyeOff as fe, FileText as pe, ImagePlus as me, Link2 as he, Loader2 as c, Mail as ge, MessageSquare as l, Send as _e, Smartphone as ve, User as u, Users as ye, X as be } from "lucide-react";
14
+ import { useNavigate as xe } from "react-router-dom";
15
+ import { Fragment as Se, jsx as d, jsxs as f } from "react/jsx-runtime";
16
+ import { CTAOverflowMenu as Ce, GlassCard as we, IllustratedEmptyState as Te, NextSteps as Ee, PagePurpose as De } from "@burdenoff/fe-libs/ui";
17
17
  //#region src/pages/CreateNotificationPage.tsx
18
- var we = [
18
+ var Oe = [
19
19
  {
20
20
  value: "EMAIL",
21
21
  label: "Email",
22
- icon: l,
22
+ icon: ge,
23
23
  description: "Send via email"
24
24
  },
25
25
  {
26
26
  value: "SMS",
27
27
  label: "SMS",
28
- icon: u,
28
+ icon: l,
29
29
  description: "Send text message"
30
30
  },
31
31
  {
32
32
  value: "PUSH",
33
33
  label: "Push",
34
- icon: _e,
34
+ icon: ve,
35
35
  description: "Mobile push notification"
36
36
  },
37
37
  {
@@ -43,34 +43,34 @@ var we = [
43
43
  {
44
44
  value: "WHATSAPP",
45
45
  label: "WhatsApp",
46
- icon: u,
46
+ icon: l,
47
47
  description: "Send via WhatsApp"
48
48
  },
49
49
  {
50
50
  value: "SLACK",
51
51
  label: "Slack",
52
- icon: u,
52
+ icon: l,
53
53
  description: "Send to Slack"
54
54
  },
55
55
  {
56
56
  value: "TEAMS",
57
57
  label: "Teams",
58
- icon: u,
58
+ icon: l,
59
59
  description: "Send to Microsoft Teams"
60
60
  },
61
61
  {
62
62
  value: "TELEGRAM",
63
63
  label: "Telegram",
64
- icon: u,
64
+ icon: l,
65
65
  description: "Send to Telegram"
66
66
  },
67
67
  {
68
68
  value: "DISCORD",
69
69
  label: "Discord",
70
- icon: u,
70
+ icon: l,
71
71
  description: "Send to Discord"
72
72
  }
73
- ], Te = [
73
+ ], ke = [
74
74
  {
75
75
  value: "TRANSACTIONAL",
76
76
  label: "Transactional",
@@ -91,7 +91,7 @@ var we = [
91
91
  label: "Alert",
92
92
  description: "Important alerts and warnings"
93
93
  }
94
- ], Ee = [
94
+ ], Ae = [
95
95
  {
96
96
  value: "LOW",
97
97
  label: "Low",
@@ -112,7 +112,7 @@ var we = [
112
112
  label: "Urgent",
113
113
  color: "bg-status-error-bg-subtle text-status-error-text"
114
114
  }
115
- ], De = [
115
+ ], je = [
116
116
  {
117
117
  value: "",
118
118
  label: "All Roles"
@@ -141,7 +141,7 @@ var we = [
141
141
  value: "GUEST",
142
142
  label: "Guest"
143
143
  }
144
- ], Oe = [
144
+ ], Me = [
145
145
  {
146
146
  value: "",
147
147
  label: "All Statuses"
@@ -163,24 +163,24 @@ var we = [
163
163
  label: "Inactive"
164
164
  }
165
165
  ];
166
- function ke() {
167
- let l = be(), u = n(), { hasPermission: _e, isLoading: ke, refreshPermissions: Ae } = se(), { showToast: je } = oe(), { sendNotification: Me, sendBatch: Ne, sendWithTemplate: Pe, isSending: m, error: Fe, lastResult: Ie, clearError: Le, clearResult: Re } = ne(), { templates: h, isLoading: ze } = re(), { trackNotificationSent: Be } = e(), { searchUsers: g, fetchAllUsers: Ve, results: _, isLoading: He, error: v } = ie(), { topics: Ue } = t({ isActive: !0 }), [y, We] = o("compose"), [b, Ge] = o("EMAIL"), [x, Ke] = o("MARKETING"), [S, qe] = o("MEDIUM"), [C, Je] = o([]), [w, T] = o("manual"), [E, D] = o([]), [O, Ye] = o(!1), [k, Xe] = o(""), [A, Ze] = o(""), [j, Qe] = o(""), [M, $e] = o(""), [et, tt] = o(""), [nt, rt] = o(!1), [N, it] = o(""), [at, P] = o([{
166
+ function Ne() {
167
+ let ge = xe(), l = n(), { hasPermission: ve, isLoading: Ne, refreshPermissions: Pe } = se(), { showToast: Fe } = oe(), { sendNotification: Ie, sendBatch: Le, sendWithTemplate: Re, isSending: p, error: ze, lastResult: Be, clearError: Ve, clearResult: He } = ne(), { templates: m, isLoading: Ue } = re(), { trackNotificationSent: We } = e(), { searchUsers: h, fetchAllUsers: Ge, results: g, isLoading: Ke, error: _ } = ie(), { topics: qe } = t({ isActive: !0 }), [v, Je] = o("compose"), [y, Ye] = o("EMAIL"), [b, Xe] = o("MARKETING"), [x, Ze] = o("MEDIUM"), [S, Qe] = o([]), [C, w] = o("manual"), [T, E] = o([]), [D, O] = o(!1), [k, $e] = o(""), [A, et] = o(""), [j, tt] = o(""), [M, nt] = o(""), [N, rt] = o(""), [it, at] = o(!1), [P, ot] = o(""), [st, F] = o([{
168
168
  url: "",
169
169
  label: "",
170
170
  kind: "image"
171
- }]), [F, I] = o([{
171
+ }]), [ct, I] = o([{
172
172
  id: "primary-action",
173
173
  label: "",
174
174
  url: "",
175
175
  style: "primary"
176
- }]), [L, ot] = o(!1), [R, z] = o([]), [B, V] = o(""), [H, st] = o(""), [U, ct] = o({}), [W, lt] = o(!1), [G, ut] = o(""), [K, dt] = o(!0), [ft, q] = o(null), [J, Y] = o(!1), X = a(() => h.find((e) => e.slug === H), [h, H]), Z = a(() => {
176
+ }]), [L, lt] = o(!1), [R, z] = o([]), [B, V] = o(""), [H, ut] = o(""), [U, dt] = o({}), [W, ft] = o(!1), [G, pt] = o(""), [K, mt] = o(!0), [ht, q] = o(null), [J, Y] = o(!1), X = a(() => m.find((e) => e.slug === H), [m, H]), Z = a(() => {
177
177
  if (!X?.variables) return null;
178
178
  try {
179
179
  return typeof X.variables == "string" ? JSON.parse(X.variables) : X.variables;
180
180
  } catch {
181
181
  return null;
182
182
  }
183
- }, [X]), pt = a(() => Z ? Array.isArray(Z) ? Z.filter((e) => e && typeof e.name == "string").map((e) => ({
183
+ }, [X]), gt = a(() => Z ? Array.isArray(Z) ? Z.filter((e) => e && typeof e.name == "string").map((e) => ({
184
184
  key: e.name,
185
185
  type: e.type || "string",
186
186
  required: !!e.required,
@@ -192,60 +192,60 @@ function ke() {
192
192
  required: !1,
193
193
  description: "",
194
194
  defaultValue: ""
195
- })) : [] : [], [Z]), mt = (e) => {
195
+ })) : [] : [], [Z]), _t = (e) => {
196
196
  let t = e;
197
197
  for (let [e, n] of Object.entries(U)) t = t.replace(RegExp(`\\{\\{${e}\\}\\}`, "g"), n || `{{${e}}}`);
198
198
  return t;
199
- }, ht = a(() => y === "template" && X ? mt(X.bodyTemplate || "") : M, [
200
- y,
199
+ }, vt = a(() => v === "template" && X ? _t(X.bodyTemplate || "") : M, [
200
+ v,
201
201
  X,
202
202
  U,
203
203
  M
204
- ]), gt = a(() => y === "template" && X?.subject ? mt(X.subject) : j, [
205
- y,
204
+ ]), yt = a(() => v === "template" && X?.subject ? _t(X.subject) : j, [
205
+ v,
206
206
  X,
207
207
  U,
208
208
  j
209
- ]), _t = [
209
+ ]), bt = [
210
210
  "EMAIL",
211
211
  "SMS",
212
212
  "WHATSAPP"
213
- ].includes(b), Q = a(() => F.filter((e) => e.label.trim() && e.url.trim()).map((e) => ({
213
+ ].includes(y), Q = a(() => ct.filter((e) => e.label.trim() && e.url.trim()).map((e) => ({
214
214
  id: e.id,
215
215
  label: e.label.trim(),
216
216
  url: e.url.trim(),
217
217
  style: e.style
218
- })), [F]), $ = a(() => at.filter((e) => e.url.trim()).map((e) => ({
218
+ })), [ct]), $ = a(() => st.filter((e) => e.url.trim()).map((e) => ({
219
219
  url: e.url.trim(),
220
220
  label: e.label.trim() || void 0,
221
221
  kind: e.kind
222
- })), [at]);
223
- if (ke) return /* @__PURE__ */ f("div", {
222
+ })), [st]);
223
+ if (Ne) return /* @__PURE__ */ d("div", {
224
224
  className: "flex h-64 items-center justify-center",
225
- children: /* @__PURE__ */ f("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" })
225
+ children: /* @__PURE__ */ d("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" })
226
226
  });
227
- let vt = _e(te.NOTIFICATION_CREATE), yt = _e(te.NOTIFICATION_SEND);
228
- if (!vt || !yt) return /* @__PURE__ */ f("div", {
227
+ let xt = ve(te.NOTIFICATION_CREATE), St = ve(te.NOTIFICATION_SEND);
228
+ if (!xt || !St) return /* @__PURE__ */ d("div", {
229
229
  className: "p-8 text-center text-text-secondary",
230
- children: u("notifications.noPermissionCreateAndSend", "You don't have permission to create and send notifications.")
230
+ children: l("notifications.noPermissionCreateAndSend", "You don't have permission to create and send notifications.")
231
231
  });
232
- let bt = (e) => b === "EMAIL" ? {
232
+ let Ct = (e) => y === "EMAIL" ? {
233
233
  userId: e.id,
234
234
  email: e.email
235
- } : b === "SMS" ? e.phoneNumber ? {
235
+ } : y === "SMS" ? e.phoneNumber ? {
236
236
  userId: e.id,
237
237
  phoneNumber: e.phoneNumber
238
- } : null : b === "WHATSAPP" ? e.phoneNumber ? {
238
+ } : null : y === "WHATSAPP" ? e.phoneNumber ? {
239
239
  userId: e.id,
240
240
  whatsappNumber: e.phoneNumber
241
241
  } : null : {
242
242
  userId: e.id,
243
243
  email: e.email
244
- }, xt = async () => (O ? await Ve({
244
+ }, wt = async () => (D ? await Ge({
245
245
  search: B,
246
246
  role: k || void 0,
247
247
  status: A || void 0
248
- }) : E).map((e) => bt(e)).filter((e) => !!e), St = () => C.map((e) => ({
248
+ }) : T).map((e) => Ct(e)).filter((e) => !!e), Tt = () => S.map((e) => ({
249
249
  email: e.email,
250
250
  phoneNumber: e.phoneNumber,
251
251
  pushToken: e.pushToken,
@@ -254,27 +254,27 @@ function ke() {
254
254
  teamsUserId: e.teamsUserId,
255
255
  webhookUrl: e.webhookUrl,
256
256
  userId: e.userId
257
- })), Ct = () => {
258
- if (q(null), w === "manual" && C.length === 0) return q(u("notifications.addRecipientRequired", "Please add at least one recipient")), !1;
259
- if (w === "directory" && E.length === 0 && !O) return q(u("notifications.selectDirectoryUsersRequired", "Please select at least one user")), !1;
260
- if (L && R.length === 0) return q(u("notifications.selectUsersRequired", "Please select users for in-app notifications")), !1;
261
- if (x === "MARKETING" && !N) return q(u("notifications.selectTopicRequired", "Please choose a topic for promotional notifications")), !1;
262
- if (y === "compose") {
263
- if (!M.trim()) return q(u("notifications.bodyRequired", "Message body is required")), !1;
264
- if (b === "EMAIL" && !j.trim()) return q(u("notifications.subjectRequired", "Subject is required for email notifications")), !1;
265
- } else if (!H) return q(u("notifications.selectTemplateRequired", "Please select a template")), !1;
257
+ })), Et = () => {
258
+ if (q(null), C === "manual" && S.length === 0) return q(l("notifications.addRecipientRequired", "Please add at least one recipient")), !1;
259
+ if (C === "directory" && T.length === 0 && !D) return q(l("notifications.selectDirectoryUsersRequired", "Please select at least one user")), !1;
260
+ if (L && R.length === 0) return q(l("notifications.selectUsersRequired", "Please select users for in-app notifications")), !1;
261
+ if (b === "MARKETING" && !P) return q(l("notifications.selectTopicRequired", "Please choose a topic for promotional notifications")), !1;
262
+ if (v === "compose") {
263
+ if (!M.trim()) return q(l("notifications.bodyRequired", "Message body is required")), !1;
264
+ if (y === "EMAIL" && !j.trim()) return q(l("notifications.subjectRequired", "Subject is required for email notifications")), !1;
265
+ } else if (!H) return q(l("notifications.selectTemplateRequired", "Please select a template")), !1;
266
266
  return !0;
267
- }, wt = async () => {
268
- if (ee("light"), Ct()) {
269
- Le(), Re(), Y(!1);
267
+ }, Dt = async () => {
268
+ if (ee("light"), Et()) {
269
+ Ve(), He(), Y(!1);
270
270
  try {
271
- let e = w === "directory" ? await xt() : St(), t = e.length + (L ? R.length : 0), n = (e, n) => {
272
- Be({
273
- mode: y,
274
- channel: b,
275
- type: y === "template" && X?.type || x,
276
- priority: S,
277
- recipientSource: w,
271
+ let e = C === "directory" ? await wt() : Tt(), t = e.length + (L ? R.length : 0), n = (e, n) => {
272
+ We({
273
+ mode: v,
274
+ channel: y,
275
+ type: v === "template" && X?.type || b,
276
+ priority: x,
277
+ recipientSource: C,
278
278
  recipientCount: t,
279
279
  successCount: e,
280
280
  failedCount: n,
@@ -285,17 +285,17 @@ function ke() {
285
285
  });
286
286
  };
287
287
  if (e.length === 0) {
288
- q(u("notifications.noDeliverableRecipients", "No valid recipients matched the selected channel and filters"));
288
+ q(l("notifications.noDeliverableRecipients", "No valid recipients matched the selected channel and filters"));
289
289
  return;
290
290
  }
291
- if (y === "template") {
292
- let t = await Pe({
291
+ if (v === "template") {
292
+ let t = await Re({
293
293
  templateSlug: H,
294
294
  variables: U,
295
295
  recipients: e,
296
- platform: b,
297
- priority: S,
298
- topicId: N || void 0,
296
+ platform: y,
297
+ priority: x,
298
+ topicId: P || void 0,
299
299
  actions: Q,
300
300
  media: $,
301
301
  redirectUrl: Q[0]?.url,
@@ -312,19 +312,19 @@ function ke() {
312
312
  } else {
313
313
  let t = e.map((e) => ({
314
314
  body: M,
315
- channel: b,
315
+ channel: y,
316
316
  recipient: e,
317
- subject: b === "EMAIL" ? j : void 0,
318
- htmlBody: nt && et ? et : void 0,
319
- type: x,
320
- priority: S,
321
- topicId: N || void 0,
317
+ subject: y === "EMAIL" ? j : void 0,
318
+ htmlBody: it && N ? N : void 0,
319
+ type: b,
320
+ priority: x,
321
+ topicId: P || void 0,
322
322
  redirectUrl: Q[0]?.url,
323
323
  actions: Q,
324
324
  media: $
325
325
  }));
326
326
  if (W || t.length > 1) {
327
- let e = await Ne({
327
+ let e = await Le({
328
328
  notifications: t,
329
329
  ...W && G && {
330
330
  scheduledFor: new Date(G).toISOString(),
@@ -332,9 +332,9 @@ function ke() {
332
332
  }
333
333
  });
334
334
  e && (e.successCount > 0 || e.totalRequested > 0) && (n(e.successCount, e.failureCount), Y(!0), i("success"));
335
- } else (await Me({
335
+ } else (await Ie({
336
336
  notification: t[0],
337
- platform: b,
337
+ platform: y,
338
338
  ...L && {
339
339
  includeInApp: L,
340
340
  userIds: R.map((e) => e.id)
@@ -343,14 +343,14 @@ function ke() {
343
343
  }
344
344
  } catch (e) {
345
345
  if (i("error"), r(e)) {
346
- Le(), je(u("notifications.permissionDeniedOnSend", "You don't have permission to send that notification. Refreshing access…"), "warning"), Ae().catch((e) => console.warn("[permissions] refresh failed after send denial:", e));
346
+ Ve(), Fe(l("notifications.permissionDeniedOnSend", "You don't have permission to send that notification. Refreshing access…"), "warning"), Pe().catch((e) => console.warn("[permissions] refresh failed after send denial:", e));
347
347
  return;
348
348
  }
349
349
  console.error("Failed to send notification:", e);
350
350
  }
351
351
  }
352
- }, Tt = () => {
353
- Je([]), T("manual"), D([]), Ye(!1), Xe(""), Ze(""), Qe(""), $e(""), tt(""), it(""), P([{
352
+ }, Ot = () => {
353
+ Qe([]), w("manual"), E([]), O(!1), $e(""), et(""), tt(""), nt(""), rt(""), ot(""), F([{
354
354
  url: "",
355
355
  label: "",
356
356
  kind: "image"
@@ -359,189 +359,218 @@ function ke() {
359
359
  label: "",
360
360
  url: "",
361
361
  style: "primary"
362
- }]), st(""), ct({}), ot(!1), z([]), V(""), lt(!1), ut(""), Y(!1), Le(), Re();
363
- }, Et = ft || Fe;
364
- return /* @__PURE__ */ p("div", {
362
+ }]), ut(""), dt({}), lt(!1), z([]), V(""), ft(!1), pt(""), Y(!1), Ve(), He();
363
+ }, kt = ht || ze;
364
+ return /* @__PURE__ */ f("div", {
365
365
  className: "min-h-screen bg-bg-canvas",
366
366
  children: [
367
- /* @__PURE__ */ p("div", {
367
+ /* @__PURE__ */ f("div", {
368
368
  className: "sticky top-0 z-10 flex items-center justify-between gap-3 px-6 py-4 bg-bg-surface border-b border-border-seam",
369
- children: [/* @__PURE__ */ p("div", {
369
+ children: [/* @__PURE__ */ f("div", {
370
370
  className: "flex items-center gap-4",
371
- children: [/* @__PURE__ */ f("button", {
372
- onClick: () => l("/notifications/center"),
371
+ children: [/* @__PURE__ */ d("button", {
372
+ onClick: () => ge("/notifications/center"),
373
373
  className: "p-2 text-text-secondary hover:text-text-primary hover:bg-bg-sunken rounded-lg transition-colors",
374
- children: /* @__PURE__ */ f(le, { size: 20 })
375
- }), /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("h1", {
374
+ children: /* @__PURE__ */ d(le, { size: 20 })
375
+ }), /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("h1", {
376
376
  className: "text-xl font-semibold text-text-primary",
377
- children: u("notifications.sendTitle", "Send Notification")
378
- }), /* @__PURE__ */ f("p", {
377
+ children: l("notifications.sendTitle", "Send Notification")
378
+ }), /* @__PURE__ */ d("p", {
379
379
  className: "text-sm text-text-secondary",
380
- children: u("notifications.sendSubtitle", "Compose and send notifications to users")
380
+ children: l("notifications.sendSubtitle", "Compose and send notifications to users")
381
381
  })] })]
382
- }), /* @__PURE__ */ f(Se, {
382
+ }), /* @__PURE__ */ d(Ce, {
383
383
  primary: {
384
- label: m ? u("notifications.sending", "Sending...") : J ? u("notifications.sent", "Sent!") : W ? u("notifications.schedule", "Schedule") : u("notifications.sendNotification", "Send Notification"),
385
- onSelect: wt,
386
- disabled: m || J,
387
- icon: m ? /* @__PURE__ */ f(c, {
384
+ label: p ? l("notifications.sending", "Sending...") : J ? l("notifications.sent", "Sent!") : W ? l("notifications.schedule", "Schedule") : l("notifications.sendNotification", "Send Notification"),
385
+ onSelect: Dt,
386
+ disabled: p || J,
387
+ icon: p ? /* @__PURE__ */ d(c, {
388
388
  size: 16,
389
389
  className: "animate-spin"
390
- }) : f(J ? s : ge, { size: 16 })
390
+ }) : d(J ? s : _e, { size: 16 })
391
391
  },
392
392
  actions: [{
393
- label: K ? u("notifications.hidePreview", "Hide preview") : u("notifications.showPreview", "Show preview"),
394
- onSelect: () => dt(!K),
395
- icon: f(K ? fe : de, { size: 16 })
393
+ label: K ? l("notifications.hidePreview", "Hide preview") : l("notifications.showPreview", "Show preview"),
394
+ onSelect: () => mt(!K),
395
+ icon: d(K ? fe : de, { size: 16 })
396
396
  }]
397
397
  })]
398
398
  }),
399
- J && /* @__PURE__ */ p("div", {
399
+ J && /* @__PURE__ */ f("div", {
400
400
  className: "mx-6 mt-4 flex items-center justify-between p-4 bg-status-success-bg-subtle border border-border-seam rounded-lg",
401
- children: [/* @__PURE__ */ p("div", {
401
+ children: [/* @__PURE__ */ f("div", {
402
402
  className: "flex items-center gap-3",
403
- children: [/* @__PURE__ */ f(s, {
403
+ children: [/* @__PURE__ */ d(s, {
404
404
  size: 20,
405
405
  className: "text-status-success-text"
406
- }), /* @__PURE__ */ p("p", {
406
+ }), /* @__PURE__ */ f("p", {
407
407
  className: "text-sm text-status-success-text",
408
408
  children: [
409
- u("notifications.sentSuccessfully", "Notification sent successfully to"),
409
+ l("notifications.sentSuccessfully", "Notification sent successfully to"),
410
410
  " ",
411
- C.length,
411
+ S.length,
412
412
  " ",
413
- u("notifications.recipientCount", "recipient"),
414
- C.length === 1 ? "" : "s",
413
+ l("notifications.recipientCount", "recipient"),
414
+ S.length === 1 ? "" : "s",
415
415
  "!"
416
416
  ]
417
417
  })]
418
- }), /* @__PURE__ */ f("button", {
419
- onClick: Tt,
418
+ }), /* @__PURE__ */ d("button", {
419
+ onClick: Ot,
420
420
  className: "px-3 py-1.5 text-sm font-medium text-status-success-text hover:bg-status-success-bg-subtle rounded-lg transition-colors",
421
- children: u("notifications.sendAnother", "Send Another")
421
+ children: l("notifications.sendAnother", "Send Another")
422
422
  })]
423
423
  }),
424
- Et && /* @__PURE__ */ p("div", {
424
+ kt && /* @__PURE__ */ f("div", {
425
425
  className: "mx-6 mt-4 flex items-center gap-3 p-4 bg-status-error-bg-subtle border border-border-seam rounded-lg",
426
- children: [/* @__PURE__ */ f(ce, {
426
+ children: [/* @__PURE__ */ d(ce, {
427
427
  size: 20,
428
428
  className: "text-status-error-text flex-shrink-0"
429
- }), /* @__PURE__ */ f("p", {
429
+ }), /* @__PURE__ */ d("p", {
430
430
  className: "text-sm text-status-error-text",
431
- children: Et
431
+ children: kt
432
432
  })]
433
433
  }),
434
- /* @__PURE__ */ p("div", {
434
+ /* @__PURE__ */ f("div", {
435
+ className: "px-6 pt-4 space-y-4",
436
+ children: [/* @__PURE__ */ d(De, {
437
+ icon: /* @__PURE__ */ d(_e, { size: 16 }),
438
+ children: l("notifications.sendPurpose", "Compose and dispatch a one-off notification to specific people. Pick a delivery channel (email, SMS, push, Slack, webhook…), write the message or start from a saved template, choose recipients individually or by directory query, and send now or schedule it for later. A live preview on the right shows exactly what each recipient will get.")
439
+ }), /* @__PURE__ */ d(Ee, {
440
+ storageKey: "notification-create",
441
+ steps: [
442
+ {
443
+ id: "template",
444
+ label: l("notifications.nextUseTemplateLabel", "Start from a template"),
445
+ description: l("notifications.nextUseTemplateDesc", "Reuse an approved template instead of writing the message from scratch."),
446
+ onClick: () => Je("template")
447
+ },
448
+ {
449
+ id: "recipients",
450
+ label: l("notifications.nextRecipientsLabel", "Target by directory"),
451
+ description: l("notifications.nextRecipientsDesc", "Send to everyone matching a role or status filter instead of picking users one by one."),
452
+ onClick: () => w("directory")
453
+ },
454
+ {
455
+ id: "preview",
456
+ label: l("notifications.nextPreviewLabel", "Check the live preview"),
457
+ description: l("notifications.nextPreviewDesc", "Confirm the rendered message, recipients and actions look right before you send."),
458
+ onClick: () => mt(!0)
459
+ }
460
+ ]
461
+ })]
462
+ }),
463
+ /* @__PURE__ */ f("div", {
435
464
  className: "flex gap-6 p-6",
436
- children: [/* @__PURE__ */ p("div", {
465
+ children: [/* @__PURE__ */ f("div", {
437
466
  className: `flex-1 space-y-6 ${K ? "max-w-2xl" : ""}`,
438
467
  children: [
439
- /* @__PURE__ */ p("div", {
468
+ /* @__PURE__ */ f("div", {
440
469
  className: "bg-bg-surface rounded-lg border border-border-seam p-4",
441
- children: [/* @__PURE__ */ p("div", {
470
+ children: [/* @__PURE__ */ f("div", {
442
471
  className: "flex items-center gap-2 mb-4",
443
- children: [/* @__PURE__ */ f(pe, {
472
+ children: [/* @__PURE__ */ d(pe, {
444
473
  size: 18,
445
474
  className: "text-text-secondary"
446
- }), /* @__PURE__ */ f("h2", {
475
+ }), /* @__PURE__ */ d("h2", {
447
476
  className: "text-sm font-medium text-text-primary",
448
- children: u("notifications.sendMode", "Send Mode")
477
+ children: l("notifications.sendMode", "Send Mode")
449
478
  })]
450
- }), /* @__PURE__ */ p("div", {
479
+ }), /* @__PURE__ */ f("div", {
451
480
  className: "flex gap-2",
452
- children: [/* @__PURE__ */ f("button", {
453
- onClick: () => We("compose"),
454
- className: `flex-1 px-4 py-3 text-sm font-medium rounded-lg border transition-colors ${y === "compose" ? "bg-primary-50 dark:bg-primary-900/30 border-primary-500 text-primary-700 dark:text-primary-300" : "bg-bg-canvas border-border-subtle text-text-secondary hover:bg-bg-sunken"}`,
455
- children: u("notifications.composeMessage", "Compose Message")
456
- }), /* @__PURE__ */ f("button", {
457
- onClick: () => We("template"),
458
- className: `flex-1 px-4 py-3 text-sm font-medium rounded-lg border transition-colors ${y === "template" ? "bg-primary-50 dark:bg-primary-900/30 border-primary-500 text-primary-700 dark:text-primary-300" : "bg-bg-canvas border-border-subtle text-text-secondary hover:bg-bg-sunken"}`,
459
- children: u("notifications.useTemplate", "Use Template")
481
+ children: [/* @__PURE__ */ d("button", {
482
+ onClick: () => Je("compose"),
483
+ className: `flex-1 px-4 py-3 text-sm font-medium rounded-lg border transition-colors ${v === "compose" ? "bg-primary-50 dark:bg-primary-900/30 border-primary-500 text-primary-700 dark:text-primary-300" : "bg-bg-canvas border-border-subtle text-text-secondary hover:bg-bg-sunken"}`,
484
+ children: l("notifications.composeMessage", "Compose Message")
485
+ }), /* @__PURE__ */ d("button", {
486
+ onClick: () => Je("template"),
487
+ className: `flex-1 px-4 py-3 text-sm font-medium rounded-lg border transition-colors ${v === "template" ? "bg-primary-50 dark:bg-primary-900/30 border-primary-500 text-primary-700 dark:text-primary-300" : "bg-bg-canvas border-border-subtle text-text-secondary hover:bg-bg-sunken"}`,
488
+ children: l("notifications.useTemplate", "Use Template")
460
489
  })]
461
490
  })]
462
491
  }),
463
- /* @__PURE__ */ p("div", {
492
+ /* @__PURE__ */ f("div", {
464
493
  className: "bg-bg-surface rounded-lg border border-border-seam p-4",
465
494
  children: [
466
- /* @__PURE__ */ f("h2", {
495
+ /* @__PURE__ */ d("h2", {
467
496
  className: "text-sm font-medium text-text-primary mb-4",
468
- children: u("notifications.channel", "Channel")
497
+ children: l("notifications.channel", "Channel")
469
498
  }),
470
- /* @__PURE__ */ f("div", {
499
+ /* @__PURE__ */ d("div", {
471
500
  className: "grid grid-cols-2 sm:grid-cols-4 gap-2",
472
- children: we.map((e) => {
501
+ children: Oe.map((e) => {
473
502
  let t = e.icon;
474
- return /* @__PURE__ */ p("button", {
503
+ return /* @__PURE__ */ f("button", {
475
504
  onClick: () => {
476
- Ge(e.value), Je([]), D([]), [
505
+ Ye(e.value), Qe([]), E([]), [
477
506
  "EMAIL",
478
507
  "SMS",
479
508
  "WHATSAPP"
480
- ].includes(e.value) || (T("manual"), Ye(!1));
509
+ ].includes(e.value) || (w("manual"), O(!1));
481
510
  },
482
- className: `flex flex-col items-center gap-2 p-3 rounded-lg border transition-colors ${b === e.value ? "bg-primary-50 dark:bg-primary-900/30 border-primary-500 text-primary-700 dark:text-primary-300" : "bg-bg-canvas border-border-subtle text-text-secondary hover:bg-bg-sunken"}`,
483
- children: [/* @__PURE__ */ f(t, { size: 20 }), /* @__PURE__ */ f("span", {
511
+ className: `flex flex-col items-center gap-2 p-3 rounded-lg border transition-colors ${y === e.value ? "bg-primary-50 dark:bg-primary-900/30 border-primary-500 text-primary-700 dark:text-primary-300" : "bg-bg-canvas border-border-subtle text-text-secondary hover:bg-bg-sunken"}`,
512
+ children: [/* @__PURE__ */ d(t, { size: 20 }), /* @__PURE__ */ d("span", {
484
513
  className: "text-xs font-medium",
485
- children: u(`notifications.channel.${e.value}`, e.label)
514
+ children: l(`notifications.channel.${e.value}`, e.label)
486
515
  })]
487
516
  }, e.value);
488
517
  })
489
518
  }),
490
- /* @__PURE__ */ p("div", {
519
+ /* @__PURE__ */ f("div", {
491
520
  className: "mt-4 pt-4 border-t border-border-subtle",
492
- children: [/* @__PURE__ */ p("label", {
521
+ children: [/* @__PURE__ */ f("label", {
493
522
  className: "flex items-center gap-3 cursor-pointer",
494
- children: [/* @__PURE__ */ f("input", {
523
+ children: [/* @__PURE__ */ d("input", {
495
524
  type: "checkbox",
496
525
  checked: L,
497
526
  onChange: (e) => {
498
- ot(e.target.checked), e.target.checked || (z([]), V(""));
527
+ lt(e.target.checked), e.target.checked || (z([]), V(""));
499
528
  },
500
529
  className: "w-4 h-4 rounded border-border-default text-primary-600 focus:ring-primary-500"
501
- }), /* @__PURE__ */ p("div", {
530
+ }), /* @__PURE__ */ f("div", {
502
531
  className: "flex items-center gap-2",
503
- children: [/* @__PURE__ */ f(ue, {
532
+ children: [/* @__PURE__ */ d(ue, {
504
533
  size: 16,
505
534
  className: "text-primary-500"
506
- }), /* @__PURE__ */ f("span", {
535
+ }), /* @__PURE__ */ d("span", {
507
536
  className: "text-sm font-medium text-text-primary",
508
- children: u("notifications.alsoSendInApp", "Also send as In-App notification")
537
+ children: l("notifications.alsoSendInApp", "Also send as In-App notification")
509
538
  })]
510
539
  })]
511
- }), /* @__PURE__ */ f("p", {
540
+ }), /* @__PURE__ */ d("p", {
512
541
  className: "text-xs text-text-secondary ml-7 mt-1",
513
- children: u("notifications.inAppDescription", "Show this notification in the app's notification center alongside the selected channel")
542
+ children: l("notifications.inAppDescription", "Show this notification in the app's notification center alongside the selected channel")
514
543
  })]
515
544
  })
516
545
  ]
517
546
  }),
518
- /* @__PURE__ */ p("div", {
547
+ /* @__PURE__ */ f("div", {
519
548
  className: "bg-bg-surface rounded-lg border border-border-seam p-4",
520
- children: [/* @__PURE__ */ p("label", {
549
+ children: [/* @__PURE__ */ f("label", {
521
550
  className: "flex items-center gap-3 cursor-pointer",
522
- children: [/* @__PURE__ */ f("input", {
551
+ children: [/* @__PURE__ */ d("input", {
523
552
  type: "checkbox",
524
553
  checked: W,
525
554
  onChange: (e) => {
526
- lt(e.target.checked), e.target.checked || ut("");
555
+ ft(e.target.checked), e.target.checked || pt("");
527
556
  },
528
557
  className: "w-4 h-4 rounded border-border-default text-primary-600 focus:ring-primary-500"
529
- }), /* @__PURE__ */ f("span", {
558
+ }), /* @__PURE__ */ d("span", {
530
559
  className: "text-sm font-medium text-text-primary",
531
- children: u("notifications.scheduleForLater", "Schedule for later")
560
+ children: l("notifications.scheduleForLater", "Schedule for later")
532
561
  })]
533
- }), W && /* @__PURE__ */ p("div", {
562
+ }), W && /* @__PURE__ */ f("div", {
534
563
  className: "mt-3 ml-7",
535
- children: [/* @__PURE__ */ f("input", {
564
+ children: [/* @__PURE__ */ d("input", {
536
565
  type: "datetime-local",
537
566
  value: G,
538
567
  min: (/* @__PURE__ */ new Date()).toISOString().slice(0, 16),
539
- onChange: (e) => ut(e.target.value),
568
+ onChange: (e) => pt(e.target.value),
540
569
  className: "px-4 py-2 text-sm bg-bg-canvas border border-border-subtle rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500"
541
- }), /* @__PURE__ */ p("p", {
570
+ }), /* @__PURE__ */ f("p", {
542
571
  className: "text-xs text-text-tertiary mt-1",
543
572
  children: [
544
- u("notifications.timezone", "Timezone"),
573
+ l("notifications.timezone", "Timezone"),
545
574
  ":",
546
575
  " ",
547
576
  Intl.DateTimeFormat().resolvedOptions().timeZone
@@ -549,24 +578,24 @@ function ke() {
549
578
  })]
550
579
  })]
551
580
  }),
552
- /* @__PURE__ */ p("div", {
581
+ /* @__PURE__ */ f("div", {
553
582
  className: "bg-bg-surface rounded-lg border border-border-seam p-4",
554
583
  children: [
555
- /* @__PURE__ */ p("label", {
584
+ /* @__PURE__ */ f("label", {
556
585
  className: "block text-sm font-medium text-text-primary mb-2",
557
- children: [u("notifications.topic", "Topic"), x === "MARKETING" && /* @__PURE__ */ f("span", {
586
+ children: [l("notifications.topic", "Topic"), b === "MARKETING" && /* @__PURE__ */ d("span", {
558
587
  className: "text-status-error-text ml-1",
559
588
  children: "*"
560
589
  })]
561
590
  }),
562
- /* @__PURE__ */ p("select", {
563
- value: N,
564
- onChange: (e) => it(e.target.value),
591
+ /* @__PURE__ */ f("select", {
592
+ value: P,
593
+ onChange: (e) => ot(e.target.value),
565
594
  className: "w-full rounded-lg border border-border-subtle bg-bg-canvas px-4 py-3 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-primary-500",
566
- children: [/* @__PURE__ */ f("option", {
595
+ children: [/* @__PURE__ */ d("option", {
567
596
  value: "",
568
- children: u("notifications.selectTopic", "Select a topic")
569
- }), Ue.map((e) => /* @__PURE__ */ p("option", {
597
+ children: l("notifications.selectTopic", "Select a topic")
598
+ }), qe.map((e) => /* @__PURE__ */ f("option", {
570
599
  value: e.id,
571
600
  children: [
572
601
  e.name,
@@ -576,189 +605,189 @@ function ke() {
576
605
  ]
577
606
  }, e.id))]
578
607
  }),
579
- /* @__PURE__ */ f("p", {
608
+ /* @__PURE__ */ d("p", {
580
609
  className: "mt-2 text-xs text-text-secondary",
581
- children: u("notifications.topicHelper", "Topics help users unsubscribe from promotional content they do not want.")
610
+ children: l("notifications.topicHelper", "Topics help users unsubscribe from promotional content they do not want.")
582
611
  })
583
612
  ]
584
613
  }),
585
- /* @__PURE__ */ p("div", {
614
+ /* @__PURE__ */ f("div", {
586
615
  className: "bg-bg-surface rounded-lg border border-border-seam p-4",
587
616
  children: [
588
- /* @__PURE__ */ p("div", {
617
+ /* @__PURE__ */ f("div", {
589
618
  className: "flex items-center gap-2 mb-4",
590
- children: [/* @__PURE__ */ f(ve, {
619
+ children: [/* @__PURE__ */ d(ye, {
591
620
  size: 18,
592
621
  className: "text-text-secondary"
593
- }), /* @__PURE__ */ p("h2", {
622
+ }), /* @__PURE__ */ f("h2", {
594
623
  className: "text-sm font-medium text-text-primary",
595
624
  children: [
596
- u("notifications.recipients", "Recipients"),
625
+ l("notifications.recipients", "Recipients"),
597
626
  " ",
598
- /* @__PURE__ */ f("span", {
627
+ /* @__PURE__ */ d("span", {
599
628
  className: "text-status-error-text",
600
629
  children: "*"
601
630
  })
602
631
  ]
603
632
  })]
604
633
  }),
605
- _t && /* @__PURE__ */ p("div", {
634
+ bt && /* @__PURE__ */ f("div", {
606
635
  className: "mb-4 flex gap-2",
607
- children: [/* @__PURE__ */ f("button", {
608
- onClick: () => T("manual"),
609
- className: `flex-1 rounded-lg border px-4 py-2 text-sm font-medium ${w === "manual" ? "border-primary-500 bg-primary-50 text-primary-700 dark:bg-primary-900/30 dark:text-primary-300" : "border-border-subtle bg-bg-canvas text-text-secondary hover:bg-bg-sunken"}`,
610
- children: u("notifications.manualRecipients", "Manual recipients")
611
- }), /* @__PURE__ */ f("button", {
612
- onClick: () => T("directory"),
613
- className: `flex-1 rounded-lg border px-4 py-2 text-sm font-medium ${w === "directory" ? "border-primary-500 bg-primary-50 text-primary-700 dark:bg-primary-900/30 dark:text-primary-300" : "border-border-subtle bg-bg-canvas text-text-secondary hover:bg-bg-sunken"}`,
614
- children: u("notifications.userDirectory", "User directory")
636
+ children: [/* @__PURE__ */ d("button", {
637
+ onClick: () => w("manual"),
638
+ className: `flex-1 rounded-lg border px-4 py-2 text-sm font-medium ${C === "manual" ? "border-primary-500 bg-primary-50 text-primary-700 dark:bg-primary-900/30 dark:text-primary-300" : "border-border-subtle bg-bg-canvas text-text-secondary hover:bg-bg-sunken"}`,
639
+ children: l("notifications.manualRecipients", "Manual recipients")
640
+ }), /* @__PURE__ */ d("button", {
641
+ onClick: () => w("directory"),
642
+ className: `flex-1 rounded-lg border px-4 py-2 text-sm font-medium ${C === "directory" ? "border-primary-500 bg-primary-50 text-primary-700 dark:bg-primary-900/30 dark:text-primary-300" : "border-border-subtle bg-bg-canvas text-text-secondary hover:bg-bg-sunken"}`,
643
+ children: l("notifications.userDirectory", "User directory")
615
644
  })]
616
645
  }),
617
- w === "manual" || !_t ? /* @__PURE__ */ f(ae, {
618
- recipients: C,
619
- onChange: Je,
620
- channel: b,
621
- disabled: m || J
622
- }) : /* @__PURE__ */ p("div", {
646
+ C === "manual" || !bt ? /* @__PURE__ */ d(ae, {
647
+ recipients: S,
648
+ onChange: Qe,
649
+ channel: y,
650
+ disabled: p || J
651
+ }) : /* @__PURE__ */ f("div", {
623
652
  className: "space-y-4",
624
653
  children: [
625
- /* @__PURE__ */ p("div", {
654
+ /* @__PURE__ */ f("div", {
626
655
  className: "grid gap-3 md:grid-cols-[minmax(0,1fr),180px,180px]",
627
656
  children: [
628
- /* @__PURE__ */ p("div", {
657
+ /* @__PURE__ */ f("div", {
629
658
  className: "relative",
630
- children: [/* @__PURE__ */ f("input", {
659
+ children: [/* @__PURE__ */ d("input", {
631
660
  type: "text",
632
661
  value: B,
633
662
  onChange: (e) => {
634
- V(e.target.value), g(e.target.value, {
663
+ V(e.target.value), h(e.target.value, {
635
664
  role: k || void 0,
636
665
  status: A || void 0
637
666
  });
638
667
  },
639
- placeholder: u("notifications.searchUsersPlaceholder", "Search users by email or name..."),
668
+ placeholder: l("notifications.searchUsersPlaceholder", "Search users by email or name..."),
640
669
  className: "w-full px-4 py-3 text-sm bg-bg-canvas border border-border-subtle rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500"
641
- }), He && /* @__PURE__ */ f("div", {
670
+ }), Ke && /* @__PURE__ */ d("div", {
642
671
  className: "absolute right-3 top-1/2 -translate-y-1/2",
643
- children: /* @__PURE__ */ f(c, {
672
+ children: /* @__PURE__ */ d(c, {
644
673
  size: 16,
645
674
  className: "animate-spin text-text-tertiary"
646
675
  })
647
676
  })]
648
677
  }),
649
- /* @__PURE__ */ f("select", {
678
+ /* @__PURE__ */ d("select", {
650
679
  value: k,
651
680
  onChange: (e) => {
652
- Xe(e.target.value), g(B, {
681
+ $e(e.target.value), h(B, {
653
682
  role: e.target.value || void 0,
654
683
  status: A || void 0
655
684
  });
656
685
  },
657
686
  className: "rounded-lg border border-border-subtle bg-bg-canvas px-4 py-3 text-sm text-text-primary",
658
- children: De.map((e) => /* @__PURE__ */ f("option", {
687
+ children: je.map((e) => /* @__PURE__ */ d("option", {
659
688
  value: e.value,
660
689
  children: e.label
661
690
  }, e.value))
662
691
  }),
663
- /* @__PURE__ */ f("select", {
692
+ /* @__PURE__ */ d("select", {
664
693
  value: A,
665
694
  onChange: (e) => {
666
- Ze(e.target.value), g(B, {
695
+ et(e.target.value), h(B, {
667
696
  role: k || void 0,
668
697
  status: e.target.value || void 0
669
698
  });
670
699
  },
671
700
  className: "rounded-lg border border-border-subtle bg-bg-canvas px-4 py-3 text-sm text-text-primary",
672
- children: Oe.map((e) => /* @__PURE__ */ f("option", {
701
+ children: Me.map((e) => /* @__PURE__ */ d("option", {
673
702
  value: e.value,
674
703
  children: e.label
675
704
  }, e.value))
676
705
  })
677
706
  ]
678
707
  }),
679
- /* @__PURE__ */ p("label", {
708
+ /* @__PURE__ */ f("label", {
680
709
  className: "flex items-center gap-3 text-sm text-text-secondary",
681
- children: [/* @__PURE__ */ f("input", {
710
+ children: [/* @__PURE__ */ d("input", {
682
711
  type: "checkbox",
683
- checked: O,
684
- onChange: (e) => Ye(e.target.checked),
712
+ checked: D,
713
+ onChange: (e) => O(e.target.checked),
685
714
  className: "h-4 w-4 rounded border-border-default text-primary-600 focus:ring-primary-500"
686
- }), /* @__PURE__ */ f("span", { children: u("notifications.sendToAllMatchingUsers", "Send to all users matching the current search and filters") })]
715
+ }), /* @__PURE__ */ d("span", { children: l("notifications.sendToAllMatchingUsers", "Send to all users matching the current search and filters") })]
687
716
  }),
688
- B && /* @__PURE__ */ f("div", {
717
+ B && /* @__PURE__ */ d("div", {
689
718
  className: "max-h-56 overflow-y-auto rounded-lg border border-border-subtle",
690
- children: _.length > 0 ? _.map((e) => {
691
- let t = E.some((t) => t.id === e.id), n = b === "EMAIL" ? !!e.email : b === "SMS" || b === "WHATSAPP" ? !!e.phoneNumber : !0;
692
- return /* @__PURE__ */ p("button", {
719
+ children: g.length > 0 ? g.map((e) => {
720
+ let t = T.some((t) => t.id === e.id), n = y === "EMAIL" ? !!e.email : y === "SMS" || y === "WHATSAPP" ? !!e.phoneNumber : !0;
721
+ return /* @__PURE__ */ f("button", {
693
722
  type: "button",
694
723
  disabled: !n,
695
724
  onClick: () => {
696
- D(t ? (t) => t.filter((t) => t.id !== e.id) : (t) => [...t, e]);
725
+ E(t ? (t) => t.filter((t) => t.id !== e.id) : (t) => [...t, e]);
697
726
  },
698
727
  className: `flex w-full items-center gap-3 p-3 text-left transition-colors ${t ? "bg-primary-50 dark:bg-primary-900/30" : "hover:bg-bg-canvas"} ${n ? "" : "cursor-not-allowed opacity-50"}`,
699
728
  children: [
700
- /* @__PURE__ */ f(d, {
729
+ /* @__PURE__ */ d(u, {
701
730
  size: 16,
702
731
  className: t ? "text-primary-500" : "text-text-tertiary"
703
732
  }),
704
- /* @__PURE__ */ p("div", {
733
+ /* @__PURE__ */ f("div", {
705
734
  className: "flex-1",
706
735
  children: [
707
- /* @__PURE__ */ f("div", {
736
+ /* @__PURE__ */ d("div", {
708
737
  className: "text-sm font-medium text-text-primary",
709
738
  children: e.name
710
739
  }),
711
- /* @__PURE__ */ f("div", {
740
+ /* @__PURE__ */ d("div", {
712
741
  className: "text-xs text-text-secondary",
713
742
  children: e.email
714
743
  }),
715
- e.phoneNumber && /* @__PURE__ */ f("div", {
744
+ e.phoneNumber && /* @__PURE__ */ d("div", {
716
745
  className: "text-xs text-text-tertiary",
717
746
  children: e.phoneNumber
718
747
  })
719
748
  ]
720
749
  }),
721
- !n && /* @__PURE__ */ f("span", {
750
+ !n && /* @__PURE__ */ d("span", {
722
751
  className: "text-xs text-status-error-text",
723
- children: u("notifications.missingChannelTarget", "Missing channel target")
752
+ children: l("notifications.missingChannelTarget", "Missing channel target")
724
753
  }),
725
- t && /* @__PURE__ */ f(s, {
754
+ t && /* @__PURE__ */ d(s, {
726
755
  size: 16,
727
756
  className: "text-primary-500"
728
757
  })
729
758
  ]
730
759
  }, e.id);
731
- }) : /* @__PURE__ */ f("div", {
760
+ }) : /* @__PURE__ */ d("div", {
732
761
  className: "p-4 text-center text-sm text-text-secondary",
733
- children: v ? `${u("notifications.error", "Error")}: ${v}` : u("notifications.noUsersFound", "No users found")
762
+ children: _ ? `${l("notifications.error", "Error")}: ${_}` : l("notifications.noUsersFound", "No users found")
734
763
  })
735
764
  }),
736
- E.length > 0 && /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ p("h3", {
765
+ T.length > 0 && /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ f("h3", {
737
766
  className: "mb-2 text-sm font-medium text-text-secondary",
738
767
  children: [
739
- u("notifications.selectedUsers", "Selected Users"),
768
+ l("notifications.selectedUsers", "Selected Users"),
740
769
  " (",
741
- E.length,
770
+ T.length,
742
771
  ")"
743
772
  ]
744
- }), /* @__PURE__ */ f("div", {
773
+ }), /* @__PURE__ */ d("div", {
745
774
  className: "flex flex-wrap gap-2",
746
- children: E.map((e) => /* @__PURE__ */ p("div", {
775
+ children: T.map((e) => /* @__PURE__ */ f("div", {
747
776
  className: "flex items-center gap-2 rounded-full border border-primary-200 bg-primary-50 px-3 py-1.5 text-sm dark:border-primary-800 dark:bg-primary-900/30",
748
777
  children: [
749
- /* @__PURE__ */ f(d, {
778
+ /* @__PURE__ */ d(u, {
750
779
  size: 12,
751
780
  className: "text-primary-500"
752
781
  }),
753
- /* @__PURE__ */ f("span", {
782
+ /* @__PURE__ */ d("span", {
754
783
  className: "text-primary-700 dark:text-primary-300",
755
784
  children: e.name
756
785
  }),
757
- /* @__PURE__ */ f("button", {
786
+ /* @__PURE__ */ d("button", {
758
787
  type: "button",
759
- onClick: () => D((t) => t.filter((t) => t.id !== e.id)),
788
+ onClick: () => E((t) => t.filter((t) => t.id !== e.id)),
760
789
  className: "rounded-full p-0.5 hover:bg-primary-100 dark:hover:bg-primary-800",
761
- children: /* @__PURE__ */ f(ye, {
790
+ children: /* @__PURE__ */ d(be, {
762
791
  size: 12,
763
792
  className: "text-primary-500"
764
793
  })
@@ -770,112 +799,112 @@ function ke() {
770
799
  })
771
800
  ]
772
801
  }),
773
- L && /* @__PURE__ */ p("div", {
802
+ L && /* @__PURE__ */ f("div", {
774
803
  className: "bg-bg-surface rounded-lg border border-border-seam p-4",
775
804
  children: [
776
- /* @__PURE__ */ p("div", {
805
+ /* @__PURE__ */ f("div", {
777
806
  className: "flex items-center gap-2 mb-4",
778
- children: [/* @__PURE__ */ f(ue, {
807
+ children: [/* @__PURE__ */ d(ue, {
779
808
  size: 18,
780
809
  className: "text-primary-500"
781
- }), /* @__PURE__ */ p("h2", {
810
+ }), /* @__PURE__ */ f("h2", {
782
811
  className: "text-sm font-medium text-text-primary",
783
812
  children: [
784
- u("notifications.inAppUsers", "In-App Notification Users"),
813
+ l("notifications.inAppUsers", "In-App Notification Users"),
785
814
  " ",
786
- /* @__PURE__ */ f("span", {
815
+ /* @__PURE__ */ d("span", {
787
816
  className: "text-status-error-text",
788
817
  children: "*"
789
818
  })
790
819
  ]
791
820
  })]
792
821
  }),
793
- /* @__PURE__ */ p("div", {
822
+ /* @__PURE__ */ f("div", {
794
823
  className: "relative mb-4",
795
- children: [/* @__PURE__ */ f("input", {
824
+ children: [/* @__PURE__ */ d("input", {
796
825
  type: "text",
797
826
  value: B,
798
827
  onChange: (e) => {
799
- V(e.target.value), g(e.target.value, {
828
+ V(e.target.value), h(e.target.value, {
800
829
  role: k || void 0,
801
830
  status: A || void 0
802
831
  });
803
832
  },
804
- placeholder: u("notifications.searchUsersPlaceholder", "Search users by email or name..."),
833
+ placeholder: l("notifications.searchUsersPlaceholder", "Search users by email or name..."),
805
834
  className: "w-full px-4 py-3 text-sm bg-bg-canvas border border-border-subtle rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500"
806
- }), He && /* @__PURE__ */ f("div", {
835
+ }), Ke && /* @__PURE__ */ d("div", {
807
836
  className: "absolute right-3 top-1/2 transform -translate-y-1/2",
808
- children: /* @__PURE__ */ f(c, {
837
+ children: /* @__PURE__ */ d(c, {
809
838
  size: 16,
810
839
  className: "animate-spin text-text-tertiary"
811
840
  })
812
841
  })]
813
842
  }),
814
- B && /* @__PURE__ */ f("div", {
843
+ B && /* @__PURE__ */ d("div", {
815
844
  className: "mb-4",
816
- children: _.length > 0 ? /* @__PURE__ */ f("div", {
845
+ children: g.length > 0 ? /* @__PURE__ */ d("div", {
817
846
  className: "max-h-48 overflow-y-auto border border-border-subtle rounded-lg",
818
- children: _.map((e) => {
847
+ children: g.map((e) => {
819
848
  let t = R.some((t) => t.id === e.id);
820
- return /* @__PURE__ */ p("button", {
849
+ return /* @__PURE__ */ f("button", {
821
850
  type: "button",
822
851
  onClick: () => {
823
852
  z(t ? (t) => t.filter((t) => t.id !== e.id) : (t) => [...t, e]);
824
853
  },
825
854
  className: `w-full flex items-center gap-3 p-3 text-left hover:bg-bg-canvas transition-colors ${t ? "bg-primary-50 dark:bg-primary-900/30" : ""}`,
826
855
  children: [
827
- /* @__PURE__ */ f(d, {
856
+ /* @__PURE__ */ d(u, {
828
857
  size: 16,
829
858
  className: t ? "text-primary-500" : "text-text-tertiary"
830
859
  }),
831
- /* @__PURE__ */ p("div", {
860
+ /* @__PURE__ */ f("div", {
832
861
  className: "flex-1",
833
- children: [/* @__PURE__ */ f("div", {
862
+ children: [/* @__PURE__ */ d("div", {
834
863
  className: "text-sm font-medium text-text-primary",
835
864
  children: e.name
836
- }), /* @__PURE__ */ f("div", {
865
+ }), /* @__PURE__ */ d("div", {
837
866
  className: "text-xs text-text-secondary",
838
867
  children: e.email
839
868
  })]
840
869
  }),
841
- t && /* @__PURE__ */ f(s, {
870
+ t && /* @__PURE__ */ d(s, {
842
871
  size: 16,
843
872
  className: "text-primary-500"
844
873
  })
845
874
  ]
846
875
  }, e.id);
847
876
  })
848
- }) : /* @__PURE__ */ f("div", {
877
+ }) : /* @__PURE__ */ d("div", {
849
878
  className: "text-center py-4 text-sm text-text-secondary",
850
- children: v ? `${u("notifications.error", "Error")}: ${v}` : u("notifications.noUsersFound", "No users found")
879
+ children: _ ? `${l("notifications.error", "Error")}: ${_}` : l("notifications.noUsersFound", "No users found")
851
880
  })
852
881
  }),
853
- R.length > 0 && /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ p("h3", {
882
+ R.length > 0 && /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ f("h3", {
854
883
  className: "text-sm font-medium text-text-secondary mb-2",
855
884
  children: [
856
- u("notifications.selectedUsers", "Selected Users"),
885
+ l("notifications.selectedUsers", "Selected Users"),
857
886
  " (",
858
887
  R.length,
859
888
  ")"
860
889
  ]
861
- }), /* @__PURE__ */ f("div", {
890
+ }), /* @__PURE__ */ d("div", {
862
891
  className: "flex flex-wrap gap-2",
863
- children: R.map((e) => /* @__PURE__ */ p("div", {
892
+ children: R.map((e) => /* @__PURE__ */ f("div", {
864
893
  className: "flex items-center gap-2 px-3 py-1.5 bg-primary-50 dark:bg-primary-900/30 border border-primary-200 dark:border-primary-800 rounded-full text-sm",
865
894
  children: [
866
- /* @__PURE__ */ f(d, {
895
+ /* @__PURE__ */ d(u, {
867
896
  size: 12,
868
897
  className: "text-primary-500"
869
898
  }),
870
- /* @__PURE__ */ f("span", {
899
+ /* @__PURE__ */ d("span", {
871
900
  className: "text-primary-700 dark:text-primary-300",
872
901
  children: e.name
873
902
  }),
874
- /* @__PURE__ */ f("button", {
903
+ /* @__PURE__ */ d("button", {
875
904
  type: "button",
876
905
  onClick: () => z((t) => t.filter((t) => t.id !== e.id)),
877
906
  className: "p-0.5 hover:bg-primary-100 dark:hover:bg-primary-800 rounded-full transition-colors",
878
- children: /* @__PURE__ */ f(ye, {
907
+ children: /* @__PURE__ */ d(be, {
879
908
  size: 12,
880
909
  className: "text-primary-500"
881
910
  })
@@ -885,77 +914,69 @@ function ke() {
885
914
  })] })
886
915
  ]
887
916
  }),
888
- y === "template" && /* @__PURE__ */ p("div", {
917
+ v === "template" && /* @__PURE__ */ f("div", {
889
918
  className: "bg-bg-surface rounded-lg border border-border-seam p-4",
890
919
  children: [
891
- /* @__PURE__ */ p("h2", {
920
+ /* @__PURE__ */ f("h2", {
892
921
  className: "text-sm font-medium text-text-primary mb-4",
893
922
  children: [
894
- u("notifications.selectTemplate", "Select Template"),
923
+ l("notifications.selectTemplate", "Select Template"),
895
924
  " ",
896
- /* @__PURE__ */ f("span", {
925
+ /* @__PURE__ */ d("span", {
897
926
  className: "text-status-error-text",
898
927
  children: "*"
899
928
  })
900
929
  ]
901
930
  }),
902
- ze ? /* @__PURE__ */ f("div", {
931
+ Ue ? /* @__PURE__ */ d("div", {
903
932
  className: "flex items-center justify-center py-8",
904
- children: /* @__PURE__ */ f(c, {
933
+ children: /* @__PURE__ */ d(c, {
905
934
  size: 24,
906
935
  className: "animate-spin text-text-tertiary"
907
936
  })
908
- }) : h.length === 0 ? /* @__PURE__ */ p("div", {
909
- className: "text-center py-8",
910
- children: [
911
- /* @__PURE__ */ f(pe, {
912
- size: 32,
913
- className: "mx-auto text-text-tertiary mb-2"
914
- }),
915
- /* @__PURE__ */ f("p", {
916
- className: "text-sm text-text-secondary",
917
- children: u("notifications.noTemplatesAvailable", "No templates available")
918
- }),
919
- /* @__PURE__ */ f("button", {
920
- onClick: () => l("/notifications/templates/new"),
921
- className: "mt-2 text-sm text-primary-600 hover:text-primary-700",
922
- children: u("notifications.createATemplate", "Create a template")
923
- })
924
- ]
925
- }) : /* @__PURE__ */ p("select", {
937
+ }) : m.length === 0 ? /* @__PURE__ */ d(Te, {
938
+ illustration: "empty-files",
939
+ title: l("notifications.noTemplatesAvailable", "No templates available"),
940
+ description: l("notifications.noTemplatesAvailableDesc", "Create a reusable template once and pick it here every time you send."),
941
+ action: /* @__PURE__ */ d("button", {
942
+ onClick: () => ge("/notifications/templates/new"),
943
+ className: "text-sm text-primary-600 hover:text-primary-700",
944
+ children: l("notifications.createATemplate", "Create a template")
945
+ })
946
+ }) : /* @__PURE__ */ f("select", {
926
947
  value: H,
927
948
  onChange: (e) => {
928
- st(e.target.value), ct({});
949
+ ut(e.target.value), dt({});
929
950
  },
930
951
  className: "w-full px-4 py-3 text-sm bg-bg-canvas border border-border-subtle rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500",
931
- children: [/* @__PURE__ */ f("option", {
952
+ children: [/* @__PURE__ */ d("option", {
932
953
  value: "",
933
- children: u("notifications.selectATemplate", "Select a template...")
934
- }), h.filter((e) => e.enabled).map((e) => /* @__PURE__ */ p("option", {
954
+ children: l("notifications.selectATemplate", "Select a template...")
955
+ }), m.filter((e) => e.enabled).map((e) => /* @__PURE__ */ f("option", {
935
956
  value: e.slug,
936
957
  children: [
937
958
  e.name,
938
959
  " (",
939
- u(`notifications.type.${e.type}`, e.type),
960
+ l(`notifications.type.${e.type}`, e.type),
940
961
  ")"
941
962
  ]
942
963
  }, e.id))]
943
964
  }),
944
- X && pt.length > 0 && /* @__PURE__ */ p("div", {
965
+ X && gt.length > 0 && /* @__PURE__ */ f("div", {
945
966
  className: "mt-4 space-y-3",
946
- children: [/* @__PURE__ */ f("h3", {
967
+ children: [/* @__PURE__ */ d("h3", {
947
968
  className: "text-sm font-medium text-text-secondary",
948
- children: u("notifications.templateVariables", "Template Variables")
949
- }), pt.map((e) => /* @__PURE__ */ p("div", { children: [
950
- /* @__PURE__ */ p("label", {
969
+ children: l("notifications.templateVariables", "Template Variables")
970
+ }), gt.map((e) => /* @__PURE__ */ f("div", { children: [
971
+ /* @__PURE__ */ f("label", {
951
972
  className: "block text-xs text-text-secondary mb-1",
952
973
  children: [
953
974
  e.key,
954
- e.required && /* @__PURE__ */ f("span", {
975
+ e.required && /* @__PURE__ */ d("span", {
955
976
  className: "text-status-error-text ml-0.5",
956
977
  children: "*"
957
978
  }),
958
- /* @__PURE__ */ p("span", {
979
+ /* @__PURE__ */ f("span", {
959
980
  className: "text-text-tertiary ml-1",
960
981
  children: [
961
982
  "(",
@@ -965,159 +986,159 @@ function ke() {
965
986
  })
966
987
  ]
967
988
  }),
968
- e.description && /* @__PURE__ */ f("p", {
989
+ e.description && /* @__PURE__ */ d("p", {
969
990
  className: "text-xs text-text-tertiary mb-1",
970
991
  children: e.description
971
992
  }),
972
- /* @__PURE__ */ f("input", {
993
+ /* @__PURE__ */ d("input", {
973
994
  type: "text",
974
995
  value: U[e.key] || "",
975
- onChange: (t) => ct((n) => ({
996
+ onChange: (t) => dt((n) => ({
976
997
  ...n,
977
998
  [e.key]: t.target.value
978
999
  })),
979
- placeholder: e.defaultValue || `${u("notifications.enterVariablePrefix", "Enter")} ${e.key}...`,
1000
+ placeholder: e.defaultValue || `${l("notifications.enterVariablePrefix", "Enter")} ${e.key}...`,
980
1001
  className: "w-full px-3 py-2 text-sm bg-bg-canvas border border-border-subtle rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500"
981
1002
  })
982
1003
  ] }, e.key))]
983
1004
  })
984
1005
  ]
985
1006
  }),
986
- y === "compose" && /* @__PURE__ */ p(xe, { children: [
987
- /* @__PURE__ */ f("div", {
1007
+ v === "compose" && /* @__PURE__ */ f(Se, { children: [
1008
+ /* @__PURE__ */ d("div", {
988
1009
  className: "bg-bg-surface rounded-lg border border-border-seam p-4",
989
- children: /* @__PURE__ */ p("div", {
1010
+ children: /* @__PURE__ */ f("div", {
990
1011
  className: "grid grid-cols-2 gap-4",
991
- children: [/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
1012
+ children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("label", {
992
1013
  className: "block text-sm font-medium text-text-primary mb-2",
993
- children: u("notifications.typeLabel", "Type")
994
- }), /* @__PURE__ */ f("select", {
995
- value: x,
996
- onChange: (e) => Ke(e.target.value),
1014
+ children: l("notifications.typeLabel", "Type")
1015
+ }), /* @__PURE__ */ d("select", {
1016
+ value: b,
1017
+ onChange: (e) => Xe(e.target.value),
997
1018
  className: "w-full px-4 py-3 text-sm bg-bg-canvas border border-border-subtle rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500",
998
- children: Te.map((e) => /* @__PURE__ */ f("option", {
1019
+ children: ke.map((e) => /* @__PURE__ */ d("option", {
999
1020
  value: e.value,
1000
- children: u(`notifications.type.${e.value}`, e.label)
1021
+ children: l(`notifications.type.${e.value}`, e.label)
1001
1022
  }, e.value))
1002
- })] }), /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
1023
+ })] }), /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("label", {
1003
1024
  className: "block text-sm font-medium text-text-primary mb-2",
1004
- children: u("notifications.priorityLabel", "Priority")
1005
- }), /* @__PURE__ */ f("select", {
1006
- value: S,
1007
- onChange: (e) => qe(e.target.value),
1025
+ children: l("notifications.priorityLabel", "Priority")
1026
+ }), /* @__PURE__ */ d("select", {
1027
+ value: x,
1028
+ onChange: (e) => Ze(e.target.value),
1008
1029
  className: "w-full px-4 py-3 text-sm bg-bg-canvas border border-border-subtle rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500",
1009
- children: Ee.map((e) => /* @__PURE__ */ f("option", {
1030
+ children: Ae.map((e) => /* @__PURE__ */ d("option", {
1010
1031
  value: e.value,
1011
- children: u(`notifications.priority.${e.value}`, e.label)
1032
+ children: l(`notifications.priority.${e.value}`, e.label)
1012
1033
  }, e.value))
1013
1034
  })] })]
1014
1035
  })
1015
1036
  }),
1016
- b === "EMAIL" && /* @__PURE__ */ p("div", {
1037
+ y === "EMAIL" && /* @__PURE__ */ f("div", {
1017
1038
  className: "bg-bg-surface rounded-lg border border-border-seam p-4",
1018
- children: [/* @__PURE__ */ p("label", {
1039
+ children: [/* @__PURE__ */ f("label", {
1019
1040
  className: "block text-sm font-medium text-text-primary mb-2",
1020
1041
  children: [
1021
- u("notifications.subjectLabel", "Subject"),
1042
+ l("notifications.subjectLabel", "Subject"),
1022
1043
  " ",
1023
- /* @__PURE__ */ f("span", {
1044
+ /* @__PURE__ */ d("span", {
1024
1045
  className: "text-status-error-text",
1025
1046
  children: "*"
1026
1047
  })
1027
1048
  ]
1028
- }), /* @__PURE__ */ f("input", {
1049
+ }), /* @__PURE__ */ d("input", {
1029
1050
  type: "text",
1030
1051
  value: j,
1031
- onChange: (e) => Qe(e.target.value),
1032
- placeholder: u("notifications.enterSubjectPlaceholder", "Enter email subject..."),
1052
+ onChange: (e) => tt(e.target.value),
1053
+ placeholder: l("notifications.enterSubjectPlaceholder", "Enter email subject..."),
1033
1054
  className: "w-full px-4 py-3 text-sm bg-bg-canvas border border-border-subtle rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500"
1034
1055
  })]
1035
1056
  }),
1036
- /* @__PURE__ */ p("div", {
1057
+ /* @__PURE__ */ f("div", {
1037
1058
  className: "bg-bg-surface rounded-lg border border-border-seam p-4",
1038
1059
  children: [
1039
- /* @__PURE__ */ p("div", {
1060
+ /* @__PURE__ */ f("div", {
1040
1061
  className: "flex items-center justify-between mb-2",
1041
- children: [/* @__PURE__ */ p("label", {
1062
+ children: [/* @__PURE__ */ f("label", {
1042
1063
  className: "block text-sm font-medium text-text-primary",
1043
1064
  children: [
1044
- u("notifications.messageLabel", "Message"),
1065
+ l("notifications.messageLabel", "Message"),
1045
1066
  " ",
1046
- /* @__PURE__ */ f("span", {
1067
+ /* @__PURE__ */ d("span", {
1047
1068
  className: "text-status-error-text",
1048
1069
  children: "*"
1049
1070
  })
1050
1071
  ]
1051
- }), b === "EMAIL" && /* @__PURE__ */ p("label", {
1072
+ }), y === "EMAIL" && /* @__PURE__ */ f("label", {
1052
1073
  className: "flex items-center gap-2 text-sm text-text-secondary cursor-pointer",
1053
- children: [/* @__PURE__ */ f("input", {
1074
+ children: [/* @__PURE__ */ d("input", {
1054
1075
  type: "checkbox",
1055
- checked: nt,
1056
- onChange: (e) => rt(e.target.checked),
1076
+ checked: it,
1077
+ onChange: (e) => at(e.target.checked),
1057
1078
  className: "w-4 h-4 rounded border-border-default text-primary-600 focus:ring-primary-500"
1058
- }), u("notifications.includeHtmlVersion", "Include HTML version")]
1079
+ }), l("notifications.includeHtmlVersion", "Include HTML version")]
1059
1080
  })]
1060
1081
  }),
1061
- /* @__PURE__ */ f("textarea", {
1082
+ /* @__PURE__ */ d("textarea", {
1062
1083
  rows: 6,
1063
1084
  value: M,
1064
- onChange: (e) => $e(e.target.value),
1065
- placeholder: u("notifications.enterMessagePlaceholder", "Enter your message..."),
1085
+ onChange: (e) => nt(e.target.value),
1086
+ placeholder: l("notifications.enterMessagePlaceholder", "Enter your message..."),
1066
1087
  className: "w-full px-4 py-3 text-sm bg-bg-canvas border border-border-subtle rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500 resize-none"
1067
1088
  }),
1068
- b === "EMAIL" && nt && /* @__PURE__ */ p("div", {
1089
+ y === "EMAIL" && it && /* @__PURE__ */ f("div", {
1069
1090
  className: "mt-4",
1070
- children: [/* @__PURE__ */ f("label", {
1091
+ children: [/* @__PURE__ */ d("label", {
1071
1092
  className: "block text-sm font-medium text-text-secondary mb-2",
1072
- children: u("notifications.htmlContent", "HTML Content")
1073
- }), /* @__PURE__ */ f("textarea", {
1093
+ children: l("notifications.htmlContent", "HTML Content")
1094
+ }), /* @__PURE__ */ d("textarea", {
1074
1095
  rows: 8,
1075
- value: et,
1076
- onChange: (e) => tt(e.target.value),
1077
- placeholder: u("notifications.htmlPlaceholder", "<html>...</html>"),
1096
+ value: N,
1097
+ onChange: (e) => rt(e.target.value),
1098
+ placeholder: l("notifications.htmlPlaceholder", "<html>...</html>"),
1078
1099
  className: "w-full px-4 py-3 text-sm bg-bg-canvas border border-border-subtle rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500 resize-none font-mono"
1079
1100
  })]
1080
1101
  })
1081
1102
  ]
1082
1103
  })
1083
1104
  ] }),
1084
- /* @__PURE__ */ p("div", {
1105
+ /* @__PURE__ */ f("div", {
1085
1106
  className: "bg-bg-surface rounded-lg border border-border-seam p-4",
1086
- children: [/* @__PURE__ */ p("div", {
1107
+ children: [/* @__PURE__ */ f("div", {
1087
1108
  className: "mb-4 flex items-center gap-2",
1088
- children: [/* @__PURE__ */ f(he, {
1109
+ children: [/* @__PURE__ */ d(he, {
1089
1110
  size: 18,
1090
1111
  className: "text-text-secondary"
1091
- }), /* @__PURE__ */ f("h2", {
1112
+ }), /* @__PURE__ */ d("h2", {
1092
1113
  className: "text-sm font-medium text-text-primary",
1093
- children: u("notifications.actions", "Actions")
1114
+ children: l("notifications.actions", "Actions")
1094
1115
  })]
1095
- }), /* @__PURE__ */ p("div", {
1116
+ }), /* @__PURE__ */ f("div", {
1096
1117
  className: "space-y-3",
1097
- children: [F.map((e, t) => /* @__PURE__ */ p("div", {
1118
+ children: [ct.map((e, t) => /* @__PURE__ */ f("div", {
1098
1119
  className: "grid gap-3 rounded-lg border border-border-subtle bg-bg-canvas p-3 md:grid-cols-[1fr,1fr,160px,auto]",
1099
1120
  children: [
1100
- /* @__PURE__ */ f("input", {
1121
+ /* @__PURE__ */ d("input", {
1101
1122
  type: "text",
1102
1123
  value: e.label,
1103
1124
  onChange: (e) => I((n) => n.map((n, r) => r === t ? {
1104
1125
  ...n,
1105
1126
  label: e.target.value
1106
1127
  } : n)),
1107
- placeholder: u("notifications.actionLabel", "Action label"),
1128
+ placeholder: l("notifications.actionLabel", "Action label"),
1108
1129
  className: "rounded-md border border-border-subtle bg-surface px-3 py-2 text-sm text-text-primary"
1109
1130
  }),
1110
- /* @__PURE__ */ f("input", {
1131
+ /* @__PURE__ */ d("input", {
1111
1132
  type: "url",
1112
1133
  value: e.url,
1113
1134
  onChange: (e) => I((n) => n.map((n, r) => r === t ? {
1114
1135
  ...n,
1115
1136
  url: e.target.value
1116
1137
  } : n)),
1117
- placeholder: u("notifications.actionUrl", "https://..."),
1138
+ placeholder: l("notifications.actionUrl", "https://..."),
1118
1139
  className: "rounded-md border border-border-subtle bg-surface px-3 py-2 text-sm text-text-primary"
1119
1140
  }),
1120
- /* @__PURE__ */ p("select", {
1141
+ /* @__PURE__ */ f("select", {
1121
1142
  value: e.style,
1122
1143
  onChange: (e) => I((n) => n.map((n, r) => r === t ? {
1123
1144
  ...n,
@@ -1125,21 +1146,21 @@ function ke() {
1125
1146
  } : n)),
1126
1147
  className: "rounded-md border border-border-subtle bg-surface px-3 py-2 text-sm text-text-primary",
1127
1148
  children: [
1128
- /* @__PURE__ */ f("option", {
1149
+ /* @__PURE__ */ d("option", {
1129
1150
  value: "primary",
1130
1151
  children: "Primary"
1131
1152
  }),
1132
- /* @__PURE__ */ f("option", {
1153
+ /* @__PURE__ */ d("option", {
1133
1154
  value: "secondary",
1134
1155
  children: "Secondary"
1135
1156
  }),
1136
- /* @__PURE__ */ f("option", {
1157
+ /* @__PURE__ */ d("option", {
1137
1158
  value: "danger",
1138
1159
  children: "Danger"
1139
1160
  })
1140
1161
  ]
1141
1162
  }),
1142
- /* @__PURE__ */ f("button", {
1163
+ /* @__PURE__ */ d("button", {
1143
1164
  type: "button",
1144
1165
  onClick: () => I((e) => e.length === 1 ? [{
1145
1166
  id: "primary-action",
@@ -1148,10 +1169,10 @@ function ke() {
1148
1169
  style: "primary"
1149
1170
  }] : e.filter((e, n) => n !== t)),
1150
1171
  className: "rounded-md border border-border-subtle px-3 py-2 text-sm text-text-secondary hover:bg-bg-sunken",
1151
- children: u("notifications.remove", "Remove")
1172
+ children: l("notifications.remove", "Remove")
1152
1173
  })
1153
1174
  ]
1154
- }, e.id)), /* @__PURE__ */ f("button", {
1175
+ }, e.id)), /* @__PURE__ */ d("button", {
1155
1176
  type: "button",
1156
1177
  onClick: () => I((e) => [...e, {
1157
1178
  id: `action-${e.length + 1}`,
@@ -1160,213 +1181,213 @@ function ke() {
1160
1181
  style: "secondary"
1161
1182
  }]),
1162
1183
  className: "rounded-md border border-border-subtle px-3 py-2 text-sm text-text-secondary hover:bg-bg-sunken",
1163
- children: u("notifications.addAction", "Add action")
1184
+ children: l("notifications.addAction", "Add action")
1164
1185
  })]
1165
1186
  })]
1166
1187
  }),
1167
- /* @__PURE__ */ p("div", {
1188
+ /* @__PURE__ */ f("div", {
1168
1189
  className: "bg-bg-surface rounded-lg border border-border-seam p-4",
1169
- children: [/* @__PURE__ */ p("div", {
1190
+ children: [/* @__PURE__ */ f("div", {
1170
1191
  className: "mb-4 flex items-center gap-2",
1171
- children: [/* @__PURE__ */ f(me, {
1192
+ children: [/* @__PURE__ */ d(me, {
1172
1193
  size: 18,
1173
1194
  className: "text-text-secondary"
1174
- }), /* @__PURE__ */ f("h2", {
1195
+ }), /* @__PURE__ */ d("h2", {
1175
1196
  className: "text-sm font-medium text-text-primary",
1176
- children: u("notifications.media", "Media")
1197
+ children: l("notifications.media", "Media")
1177
1198
  })]
1178
- }), /* @__PURE__ */ p("div", {
1199
+ }), /* @__PURE__ */ f("div", {
1179
1200
  className: "space-y-3",
1180
- children: [at.map((e, t) => /* @__PURE__ */ p("div", {
1201
+ children: [st.map((e, t) => /* @__PURE__ */ f("div", {
1181
1202
  className: "grid gap-3 rounded-lg border border-border-subtle bg-bg-canvas p-3 md:grid-cols-[1fr,220px,140px,auto]",
1182
1203
  children: [
1183
- /* @__PURE__ */ f("input", {
1204
+ /* @__PURE__ */ d("input", {
1184
1205
  type: "url",
1185
1206
  value: e.url,
1186
- onChange: (e) => P((n) => n.map((n, r) => r === t ? {
1207
+ onChange: (e) => F((n) => n.map((n, r) => r === t ? {
1187
1208
  ...n,
1188
1209
  url: e.target.value
1189
1210
  } : n)),
1190
- placeholder: u("notifications.mediaUrl", "Media URL"),
1211
+ placeholder: l("notifications.mediaUrl", "Media URL"),
1191
1212
  className: "rounded-md border border-border-subtle bg-surface px-3 py-2 text-sm text-text-primary"
1192
1213
  }),
1193
- /* @__PURE__ */ f("input", {
1214
+ /* @__PURE__ */ d("input", {
1194
1215
  type: "text",
1195
1216
  value: e.label,
1196
- onChange: (e) => P((n) => n.map((n, r) => r === t ? {
1217
+ onChange: (e) => F((n) => n.map((n, r) => r === t ? {
1197
1218
  ...n,
1198
1219
  label: e.target.value
1199
1220
  } : n)),
1200
- placeholder: u("notifications.mediaLabel", "Caption / label"),
1221
+ placeholder: l("notifications.mediaLabel", "Caption / label"),
1201
1222
  className: "rounded-md border border-border-subtle bg-surface px-3 py-2 text-sm text-text-primary"
1202
1223
  }),
1203
- /* @__PURE__ */ p("select", {
1224
+ /* @__PURE__ */ f("select", {
1204
1225
  value: e.kind,
1205
- onChange: (e) => P((n) => n.map((n, r) => r === t ? {
1226
+ onChange: (e) => F((n) => n.map((n, r) => r === t ? {
1206
1227
  ...n,
1207
1228
  kind: e.target.value
1208
1229
  } : n)),
1209
1230
  className: "rounded-md border border-border-subtle bg-surface px-3 py-2 text-sm text-text-primary",
1210
1231
  children: [
1211
- /* @__PURE__ */ f("option", {
1232
+ /* @__PURE__ */ d("option", {
1212
1233
  value: "image",
1213
1234
  children: "Image"
1214
1235
  }),
1215
- /* @__PURE__ */ f("option", {
1236
+ /* @__PURE__ */ d("option", {
1216
1237
  value: "video",
1217
1238
  children: "Video"
1218
1239
  }),
1219
- /* @__PURE__ */ f("option", {
1240
+ /* @__PURE__ */ d("option", {
1220
1241
  value: "file",
1221
1242
  children: "File"
1222
1243
  })
1223
1244
  ]
1224
1245
  }),
1225
- /* @__PURE__ */ f("button", {
1246
+ /* @__PURE__ */ d("button", {
1226
1247
  type: "button",
1227
- onClick: () => P((e) => e.length === 1 ? [{
1248
+ onClick: () => F((e) => e.length === 1 ? [{
1228
1249
  url: "",
1229
1250
  label: "",
1230
1251
  kind: "image"
1231
1252
  }] : e.filter((e, n) => n !== t)),
1232
1253
  className: "rounded-md border border-border-subtle px-3 py-2 text-sm text-text-secondary hover:bg-bg-sunken",
1233
- children: u("notifications.remove", "Remove")
1254
+ children: l("notifications.remove", "Remove")
1234
1255
  })
1235
1256
  ]
1236
- }, `${e.kind}-${t}`)), /* @__PURE__ */ f("button", {
1257
+ }, `${e.kind}-${t}`)), /* @__PURE__ */ d("button", {
1237
1258
  type: "button",
1238
- onClick: () => P((e) => [...e, {
1259
+ onClick: () => F((e) => [...e, {
1239
1260
  url: "",
1240
1261
  label: "",
1241
1262
  kind: "image"
1242
1263
  }]),
1243
1264
  className: "rounded-md border border-border-subtle px-3 py-2 text-sm text-text-secondary hover:bg-bg-sunken",
1244
- children: u("notifications.addMedia", "Add media")
1265
+ children: l("notifications.addMedia", "Add media")
1245
1266
  })]
1246
1267
  })]
1247
1268
  })
1248
1269
  ]
1249
- }), K && /* @__PURE__ */ f("div", {
1270
+ }), K && /* @__PURE__ */ d("div", {
1250
1271
  className: "w-96 flex-shrink-0",
1251
- children: /* @__PURE__ */ p(Ce, {
1272
+ children: /* @__PURE__ */ f(we, {
1252
1273
  treatment: "glass",
1253
1274
  glow: !0,
1254
1275
  className: "sticky top-24 border-border-seam p-0 overflow-hidden",
1255
- children: [/* @__PURE__ */ f("div", {
1276
+ children: [/* @__PURE__ */ d("div", {
1256
1277
  className: "px-4 py-3 bg-accent-wash border-b border-border-seam",
1257
- children: /* @__PURE__ */ f("h3", {
1278
+ children: /* @__PURE__ */ d("h3", {
1258
1279
  className: "text-sm font-medium text-text-primary",
1259
- children: u("notifications.preview", "Preview")
1280
+ children: l("notifications.preview", "Preview")
1260
1281
  })
1261
- }), /* @__PURE__ */ p("div", {
1282
+ }), /* @__PURE__ */ f("div", {
1262
1283
  className: "p-4",
1263
1284
  children: [
1264
- /* @__PURE__ */ p("div", {
1285
+ /* @__PURE__ */ f("div", {
1265
1286
  className: "flex items-center gap-2 mb-4",
1266
1287
  children: [
1267
- /* @__PURE__ */ f("span", {
1288
+ /* @__PURE__ */ d("span", {
1268
1289
  className: "px-2 py-1 text-xs font-medium bg-primary-100 dark:bg-primary-900/30 text-primary-700 dark:text-primary-300 rounded",
1269
- children: u(`notifications.channel.${b}`, b)
1290
+ children: l(`notifications.channel.${y}`, y)
1270
1291
  }),
1271
- /* @__PURE__ */ f("span", {
1292
+ /* @__PURE__ */ d("span", {
1272
1293
  className: "px-2 py-1 text-xs font-medium bg-bg-sunken text-text-secondary rounded",
1273
- children: u(`notifications.type.${x}`, x)
1294
+ children: l(`notifications.type.${b}`, b)
1274
1295
  }),
1275
- /* @__PURE__ */ f("span", {
1276
- className: `px-2 py-1 text-xs font-medium rounded ${Ee.find((e) => e.value === S)?.color || ""}`,
1277
- children: u(`notifications.priority.${S}`, S)
1296
+ /* @__PURE__ */ d("span", {
1297
+ className: `px-2 py-1 text-xs font-medium rounded ${Ae.find((e) => e.value === x)?.color || ""}`,
1298
+ children: l(`notifications.priority.${x}`, x)
1278
1299
  })
1279
1300
  ]
1280
1301
  }),
1281
- /* @__PURE__ */ p("div", {
1302
+ /* @__PURE__ */ f("div", {
1282
1303
  className: "mb-4",
1283
- children: [/* @__PURE__ */ f("p", {
1304
+ children: [/* @__PURE__ */ d("p", {
1284
1305
  className: "text-xs text-text-secondary mb-1",
1285
- children: u("notifications.recipients", "Recipients")
1286
- }), C.length === 0 ? w === "directory" ? /* @__PURE__ */ f("p", {
1306
+ children: l("notifications.recipients", "Recipients")
1307
+ }), S.length === 0 ? C === "directory" ? /* @__PURE__ */ d("p", {
1287
1308
  className: "text-sm text-text-primary",
1288
- children: O ? u("notifications.allMatchingUsers", "All matching directory users") : `${E.length} ${u("notifications.recipientCount", "recipient")}${E.length === 1 ? "" : "s"}`
1289
- }) : /* @__PURE__ */ f("p", {
1309
+ children: D ? l("notifications.allMatchingUsers", "All matching directory users") : `${T.length} ${l("notifications.recipientCount", "recipient")}${T.length === 1 ? "" : "s"}`
1310
+ }) : /* @__PURE__ */ d("p", {
1290
1311
  className: "text-sm text-text-tertiary italic",
1291
- children: u("notifications.noRecipientsSelected", "No recipients selected")
1292
- }) : /* @__PURE__ */ p("p", {
1312
+ children: l("notifications.noRecipientsSelected", "No recipients selected")
1313
+ }) : /* @__PURE__ */ f("p", {
1293
1314
  className: "text-sm text-text-primary",
1294
1315
  children: [
1295
- C.length,
1316
+ S.length,
1296
1317
  " ",
1297
- u("notifications.recipientCount", "recipient"),
1298
- C.length === 1 ? "" : "s"
1318
+ l("notifications.recipientCount", "recipient"),
1319
+ S.length === 1 ? "" : "s"
1299
1320
  ]
1300
1321
  })]
1301
1322
  }),
1302
- b === "EMAIL" && gt && /* @__PURE__ */ p("div", {
1323
+ y === "EMAIL" && yt && /* @__PURE__ */ f("div", {
1303
1324
  className: "mb-4",
1304
- children: [/* @__PURE__ */ f("p", {
1325
+ children: [/* @__PURE__ */ d("p", {
1305
1326
  className: "text-xs text-text-secondary mb-1",
1306
- children: u("notifications.subjectLabel", "Subject")
1307
- }), /* @__PURE__ */ f("p", {
1327
+ children: l("notifications.subjectLabel", "Subject")
1328
+ }), /* @__PURE__ */ d("p", {
1308
1329
  className: "text-sm font-medium text-text-primary",
1309
- children: gt
1330
+ children: yt
1310
1331
  })]
1311
1332
  }),
1312
- /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("p", {
1333
+ /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("p", {
1313
1334
  className: "text-xs text-text-secondary mb-1",
1314
- children: u("notifications.messageLabel", "Message")
1315
- }), ht ? /* @__PURE__ */ f("div", {
1335
+ children: l("notifications.messageLabel", "Message")
1336
+ }), vt ? /* @__PURE__ */ d("div", {
1316
1337
  className: "p-3 bg-bg-canvas rounded-lg",
1317
- children: /* @__PURE__ */ f("p", {
1338
+ children: /* @__PURE__ */ d("p", {
1318
1339
  className: "text-sm text-text-secondary whitespace-pre-wrap",
1319
- children: ht
1340
+ children: vt
1320
1341
  })
1321
- }) : /* @__PURE__ */ f("p", {
1342
+ }) : /* @__PURE__ */ d("p", {
1322
1343
  className: "text-sm text-text-tertiary italic",
1323
- children: u("notifications.noMessageContent", "No message content")
1344
+ children: l("notifications.noMessageContent", "No message content")
1324
1345
  })] }),
1325
- N && /* @__PURE__ */ p("div", {
1346
+ P && /* @__PURE__ */ f("div", {
1326
1347
  className: "mt-4",
1327
- children: [/* @__PURE__ */ f("p", {
1348
+ children: [/* @__PURE__ */ d("p", {
1328
1349
  className: "text-xs text-text-secondary mb-1",
1329
- children: u("notifications.topic", "Topic")
1330
- }), /* @__PURE__ */ f("p", {
1350
+ children: l("notifications.topic", "Topic")
1351
+ }), /* @__PURE__ */ d("p", {
1331
1352
  className: "text-sm text-text-primary",
1332
- children: Ue.find((e) => e.id === N)?.name || N
1353
+ children: qe.find((e) => e.id === P)?.name || P
1333
1354
  })]
1334
1355
  }),
1335
- Q.length > 0 && /* @__PURE__ */ p("div", {
1356
+ Q.length > 0 && /* @__PURE__ */ f("div", {
1336
1357
  className: "mt-4",
1337
- children: [/* @__PURE__ */ f("p", {
1358
+ children: [/* @__PURE__ */ d("p", {
1338
1359
  className: "text-xs text-text-secondary mb-1",
1339
- children: u("notifications.actions", "Actions")
1340
- }), /* @__PURE__ */ f("div", {
1360
+ children: l("notifications.actions", "Actions")
1361
+ }), /* @__PURE__ */ d("div", {
1341
1362
  className: "flex flex-wrap gap-2",
1342
- children: Q.map((e) => /* @__PURE__ */ f("span", {
1363
+ children: Q.map((e) => /* @__PURE__ */ d("span", {
1343
1364
  className: "rounded-full bg-bg-sunken px-2 py-1 text-xs text-secondary",
1344
1365
  children: e.label
1345
1366
  }, e.id))
1346
1367
  })]
1347
1368
  }),
1348
- $.length > 0 && /* @__PURE__ */ p("div", {
1369
+ $.length > 0 && /* @__PURE__ */ f("div", {
1349
1370
  className: "mt-4 space-y-2",
1350
- children: [/* @__PURE__ */ f("p", {
1371
+ children: [/* @__PURE__ */ d("p", {
1351
1372
  className: "text-xs text-text-secondary",
1352
- children: u("notifications.media", "Media")
1353
- }), $.map((e) => /* @__PURE__ */ f("div", {
1373
+ children: l("notifications.media", "Media")
1374
+ }), $.map((e) => /* @__PURE__ */ d("div", {
1354
1375
  className: "rounded-lg border border-border-subtle bg-bg-canvas p-2 text-xs text-text-secondary",
1355
1376
  children: e.label || e.url
1356
1377
  }, e.url))]
1357
1378
  }),
1358
- y === "template" && X && /* @__PURE__ */ p("div", {
1379
+ v === "template" && X && /* @__PURE__ */ f("div", {
1359
1380
  className: "mt-4 pt-4 border-t border-border-subtle",
1360
1381
  children: [
1361
- /* @__PURE__ */ f("p", {
1382
+ /* @__PURE__ */ d("p", {
1362
1383
  className: "text-xs text-text-secondary mb-1",
1363
- children: u("notifications.usingTemplate", "Using Template")
1384
+ children: l("notifications.usingTemplate", "Using Template")
1364
1385
  }),
1365
- /* @__PURE__ */ f("p", {
1386
+ /* @__PURE__ */ d("p", {
1366
1387
  className: "text-sm font-medium text-text-primary",
1367
1388
  children: X.name
1368
1389
  }),
1369
- /* @__PURE__ */ f("p", {
1390
+ /* @__PURE__ */ d("p", {
1370
1391
  className: "text-xs text-text-secondary font-mono",
1371
1392
  children: X.slug
1372
1393
  })
@@ -1381,6 +1402,6 @@ function ke() {
1381
1402
  });
1382
1403
  }
1383
1404
  //#endregion
1384
- export { ke as CreateNotificationPage };
1405
+ export { Ne as CreateNotificationPage };
1385
1406
 
1386
1407
  //# sourceMappingURL=CreateNotificationPage.js.map