@burdenoff/microfe-eventfullymanaged 2026.1123.1 → 2026.1123.3

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.
@@ -1,20 +1,39 @@
1
- import { useAnnouncementsQuery as e, useCommunicationCampaignsQuery as t, useEventsQuery as n, usePublishAnnouncementMutation as r, useSendCommunicationCampaignMutation as ee, useUpsertAnnouncementMutation as te, useUpsertCommunicationCampaignMutation as ne } from "../../api/eventApi.js";
2
- import { Pagination as i, usePagination as a } from "../../components/Pagination.js";
3
- import { describeError as o, mutationSucceeded as s } from "../../lib/mutationResult.js";
4
- import { notify as c } from "../../lib/toast.js";
5
- import { useMemo as l, useState as u } from "react";
6
- import { useI18n as re } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
7
- import { jsx as d, jsxs as f } from "react/jsx-runtime";
8
- import { Mail as p, Megaphone as ie, Plus as m, Send as ae, Upload as h } from "lucide-react";
9
- import { Badge as g, Button as _, GlassCard as v, GradientText as oe, IllustratedEmptyState as y, Input as b, PagePurpose as se, Select as ce, SelectContent as le, SelectItem as ue, SelectTrigger as de, SelectValue as fe, Textarea as pe } from "@burdenoff/fe-libs/ui";
1
+ import { useAnnouncementsQuery as e, useCommunicationCampaignsQuery as t, useEventsQuery as n, usePublishAnnouncementMutation as r, useSendCommunicationCampaignMutation as i, useUpsertAnnouncementMutation as a, useUpsertCommunicationCampaignMutation as ee } from "../../api/eventApi.js";
2
+ import { CampaignAudiencePicker as o } from "../../components/CampaignAudiencePicker.js";
3
+ import { Pagination as s, usePagination as c } from "../../components/Pagination.js";
4
+ import { describeError as l, mutationSucceeded as u } from "../../lib/mutationResult.js";
5
+ import { notify as d } from "../../lib/toast.js";
6
+ import { useMemo as f, useState as p } from "react";
7
+ import { useI18n as te } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
8
+ import { jsx as m, jsxs as h } from "react/jsx-runtime";
9
+ import { Mail as g, Megaphone as ne, Plus as _, Send as re, Upload as ie } from "lucide-react";
10
+ import { Badge as v, Button as y, GlassCard as b, GradientText as ae, IllustratedEmptyState as x, Input as S, PagePurpose as oe, Select as se, SelectContent as ce, SelectItem as le, SelectTrigger as ue, SelectValue as de, Textarea as fe } from "@burdenoff/fe-libs/ui";
10
11
  // src/eventfullymanaged/pages/modules/CommunicationPage.tsx
11
- function me(e) {
12
+ function pe(e) {
12
13
  let t = e.metadata?.schedule;
13
14
  if (!t || typeof t != "object" || Array.isArray(t)) return null;
14
15
  let n = t.sendAt;
15
16
  return typeof n == "string" && n ? n : null;
16
17
  }
17
- function x(e) {
18
+ function me(e) {
19
+ let t = e.metadata?.targetAudience, n = e.metadata?.audienceTagLabels, r = n && typeof n == "object" ? n : {}, i = typeof t == "string" ? t.split(",") : t && typeof t == "object" && "segments" in t ? t.segments : t;
20
+ if (!Array.isArray(i)) return [];
21
+ let a = i.filter((e) => typeof e == "string" && !!e.trim());
22
+ return [...new Set(a.map((e) => e.trim()))].map((e) => {
23
+ let t = r[e];
24
+ return {
25
+ id: e,
26
+ label: typeof t == "string" ? t : e
27
+ };
28
+ });
29
+ }
30
+ function C(e) {
31
+ return {
32
+ targetAudience: { segments: e.map(({ id: e }) => e) },
33
+ audienceTagLabels: Object.fromEntries(e.map(({ id: e, label: t }) => [e, t]))
34
+ };
35
+ }
36
+ function w(e) {
18
37
  let t = e.toLowerCase();
19
38
  return [
20
39
  "published",
@@ -33,413 +52,485 @@ function x(e) {
33
52
  "scheduled"
34
53
  ].includes(t) ? "info" : "secondary";
35
54
  }
36
- var S = (e) => {
55
+ var T = (e) => {
37
56
  let t = (e ?? "").toLowerCase();
38
57
  return t === "" || t === "draft" || t === "created" || t === "scheduled";
39
- }, C = (e, t) => e.title ?? e.name ?? `${t} ${e.id}`;
40
- function w() {
41
- let { t: w } = re(), T = (e, t) => {
42
- let n = w(e);
58
+ }, E = (e, t) => e.title ?? e.name ?? `${t} ${e.id}`;
59
+ function D() {
60
+ let { t: D } = te(), O = (e, t) => {
61
+ let n = D(e);
43
62
  return n === e ? t : n;
44
- }, E = a({ pageSize: 8 }), D = a({ pageSize: 8 }), O = e({
45
- limit: E.limit,
46
- offset: E.offset
47
- }), k = t({
48
- limit: D.limit,
49
- offset: D.offset
50
- }), [he, { loading: ge }] = te(), [_e, { loading: A }] = r(), [j, { loading: M }] = ne(), [N, { loading: P }] = ee(), { data: F } = n({
63
+ }, k = c({ pageSize: 8 }), A = c({ pageSize: 8 }), j = e({
64
+ limit: k.limit,
65
+ offset: k.offset
66
+ }), M = t({
67
+ limit: A.limit,
68
+ offset: A.offset
69
+ }), [he, { loading: ge }] = a(), [_e, { loading: ve }] = r(), [N, { loading: P }] = ee(), [ye, { loading: F }] = i(), { data: be } = n({
51
70
  limit: 100,
52
71
  offset: 0
53
- }), ve = F?.events?.items ?? [], [I, L] = u("announcement"), [R, z] = u(""), [B, V] = u(""), [H, U] = u(""), [W, G] = u(""), [K, q] = u(""), J = l(() => O.data?.announcements.items ?? [], [O.data]), Y = O.data?.announcements.total ?? 0, X = l(() => k.data?.communicationCampaigns.items ?? [], [k.data]), Z = k.data?.communicationCampaigns.total ?? 0, Q = I === "announcement" ? ge : M, $ = () => {
54
- z(""), V(""), U(""), G(""), q("");
55
- }, ye = async () => {
56
- if (!B.trim()) {
57
- c.error(T("eventfullymanaged.communication.subjectRequired", "Subject required"), "");
72
+ }), xe = be?.events?.items ?? [], [I, L] = p("announcement"), [R, Se] = p(""), [z, B] = p(""), [V, H] = p(""), [U, W] = p([]), [G, K] = p(null), [q, J] = p(""), [Y, Ce] = p(""), X = f(() => j.data?.announcements.items ?? [], [j.data]), Z = j.data?.announcements.total ?? 0, Q = f(() => M.data?.communicationCampaigns.items ?? [], [M.data]), $ = M.data?.communicationCampaigns.total ?? 0, we = I === "announcement" ? ge : P, Te = () => {
73
+ Se(""), B(""), H(""), W([]), J(""), Ce("");
74
+ }, Ee = async () => {
75
+ if (!z.trim()) {
76
+ d.error(O("eventfullymanaged.communication.subjectRequired", "Subject required"), "");
58
77
  return;
59
78
  }
60
79
  if (I === "announcement") {
61
80
  let e = {};
62
- W.trim() && (e.body = W.trim()), H.trim() && (e.audience = H.trim());
63
- let t = T("eventfullymanaged.communication.errors.create", "Could not create announcement");
81
+ q.trim() && (e.body = q.trim()), V.trim() && (e.audience = V.trim());
82
+ let t = O("eventfullymanaged.communication.errors.create", "Could not create announcement");
64
83
  try {
65
84
  let n = await he({ variables: { input: {
66
- title: B,
67
- name: B,
85
+ title: z,
86
+ name: z,
68
87
  status: "draft",
69
88
  eventId: R || void 0,
70
89
  metadata: e
71
90
  } } });
72
- if (!s(n, n.data?.upsertAnnouncement?.id, t)) return;
73
- $(), c.success(T("eventfullymanaged.communication.created", "Announcement created")), await O.refetch();
91
+ if (!u(n, n.data?.upsertAnnouncement?.id, t)) return;
92
+ Te(), d.success(O("eventfullymanaged.communication.created", "Announcement created")), await j.refetch();
74
93
  } catch (e) {
75
- c.error(t, o(e));
94
+ d.error(t, l(e));
76
95
  }
77
96
  return;
78
97
  }
79
- let e = H.split(",").map((e) => e.trim()).filter(Boolean), t = {};
80
- W.trim() && (t.content = { body: W.trim() }), e.length > 0 && (t.targetAudience = { segments: e }), K && (t.schedule = { sendAt: new Date(K).toISOString() });
81
- let n = T("eventfullymanaged.communication.errors.createCampaign", "Could not create campaign");
98
+ let e = {};
99
+ q.trim() && (e.content = { body: q.trim() }), U.length > 0 && Object.assign(e, C(U)), Y && (e.schedule = { sendAt: new Date(Y).toISOString() });
100
+ let t = O("eventfullymanaged.communication.errors.createCampaign", "Could not create campaign");
82
101
  try {
83
- let e = await j({ variables: { input: {
84
- title: B,
85
- name: B,
102
+ let n = await N({ variables: { input: {
103
+ title: z,
104
+ name: z,
86
105
  status: "draft",
87
106
  eventId: R || void 0,
88
- metadata: t
107
+ metadata: e
89
108
  } } });
90
- if (!s(e, e.data?.upsertCommunicationCampaign?.id, n)) return;
91
- $(), c.success(T("eventfullymanaged.communication.campaignCreated", "Campaign created")), await k.refetch();
109
+ if (!u(n, n.data?.upsertCommunicationCampaign?.id, t)) return;
110
+ Te(), d.success(O("eventfullymanaged.communication.campaignCreated", "Campaign created")), await M.refetch();
111
+ } catch (e) {
112
+ d.error(t, l(e));
113
+ }
114
+ }, De = async () => {
115
+ if (!G?.changed) return;
116
+ let { row: e, tags: t } = G, n = O("eventfullymanaged.communication.errors.saveAudience", "Could not save campaign audience");
117
+ try {
118
+ let r = await N({ variables: {
119
+ id: e.id,
120
+ input: {
121
+ name: e.name ?? void 0,
122
+ title: e.title ?? void 0,
123
+ status: "draft",
124
+ eventId: e.eventId ?? void 0,
125
+ metadata: {
126
+ ...e.metadata,
127
+ ...C(t)
128
+ }
129
+ }
130
+ } });
131
+ if (!u(r, r.data?.upsertCommunicationCampaign?.id, n)) return;
132
+ K(null), d.success(O("eventfullymanaged.communication.audienceSaved", "Campaign audience saved")), await M.refetch();
92
133
  } catch (e) {
93
- c.error(n, o(e));
134
+ d.error(n, l(e));
94
135
  }
95
- }, be = async (e) => {
96
- let t = T("eventfullymanaged.communication.errors.publish", "Could not publish announcement");
136
+ }, Oe = async (e) => {
137
+ let t = O("eventfullymanaged.communication.errors.publish", "Could not publish announcement");
97
138
  try {
98
139
  let n = await _e({ variables: { id: e.id } });
99
- if (!s(n, n.data?.publishAnnouncement?.id, t)) return;
100
- c.success(T("eventfullymanaged.communication.published", "Announcement published")), await O.refetch();
140
+ if (!u(n, n.data?.publishAnnouncement?.id, t)) return;
141
+ d.success(O("eventfullymanaged.communication.published", "Announcement published")), await j.refetch();
101
142
  } catch (e) {
102
- c.error(t, o(e));
143
+ d.error(t, l(e));
103
144
  }
104
- }, xe = async (e) => {
105
- let t = T("eventfullymanaged.communication.errors.send", "Could not send campaign");
145
+ }, ke = async (e) => {
146
+ let t = O("eventfullymanaged.communication.errors.send", "Could not send campaign");
106
147
  try {
107
- let n = await N({ variables: { id: e.id } });
108
- if (!s(n, n.data?.sendCommunicationCampaign?.id, t)) return;
109
- n.data?.sendCommunicationCampaign?.status === "scheduled" ? c.success(T("eventfullymanaged.communication.scheduledAutoSend", "Campaign scheduled. It will be sent automatically at its send time; cancel the schedule to stop it.")) : c.success(T("eventfullymanaged.communication.sent", "Campaign delivery started")), await k.refetch();
148
+ let n = await ye({ variables: { id: e.id } });
149
+ if (!u(n, n.data?.sendCommunicationCampaign?.id, t)) return;
150
+ n.data?.sendCommunicationCampaign?.status === "scheduled" ? d.success(O("eventfullymanaged.communication.scheduledAutoSend", "Campaign scheduled. It will be sent automatically at its send time; cancel the schedule to stop it.")) : d.success(O("eventfullymanaged.communication.sent", "Campaign delivery started")), await M.refetch();
110
151
  } catch (e) {
111
- c.error(t, o(e));
152
+ d.error(t, l(e));
112
153
  }
113
- }, Se = async (e) => {
114
- let t = e.metadata ?? {}, n = Object.fromEntries(Object.entries(t).filter(([e]) => e !== "schedule")), r = T("eventfullymanaged.communication.errors.cancelSchedule", "Could not cancel schedule");
154
+ }, Ae = async (e) => {
155
+ let t = e.metadata ?? {}, n = Object.fromEntries(Object.entries(t).filter(([e]) => e !== "schedule")), r = O("eventfullymanaged.communication.errors.cancelSchedule", "Could not cancel schedule");
115
156
  try {
116
- let t = await j({ variables: {
157
+ let t = await N({ variables: {
117
158
  id: e.id,
118
159
  input: {
119
160
  status: "draft",
120
161
  metadata: n
121
162
  }
122
163
  } });
123
- if (!s(t, t.data?.upsertCommunicationCampaign?.id, r)) return;
124
- c.success(T("eventfullymanaged.communication.scheduleCancelled", "Schedule cancelled; back to draft")), await k.refetch();
164
+ if (!u(t, t.data?.upsertCommunicationCampaign?.id, r)) return;
165
+ d.success(O("eventfullymanaged.communication.scheduleCancelled", "Schedule cancelled; back to draft")), await M.refetch();
125
166
  } catch (e) {
126
- c.error(r, o(e));
167
+ d.error(r, l(e));
127
168
  }
128
169
  };
129
- return /* @__PURE__ */ f("div", {
170
+ return /* @__PURE__ */ h("div", {
130
171
  className: "space-y-6 p-6",
131
172
  children: [
132
- /* @__PURE__ */ d(se, { children: T("eventfullymanaged.communication.purpose", "Keep attendees informed. Announcements and campaigns are both single-message broadcasts to a resolved event or workspace audience — there is no multi-step sequence yet. Compose one here, then publish or send it: the message is handed to the platform notification worker for delivery.") }),
133
- /* @__PURE__ */ f("div", {
173
+ /* @__PURE__ */ m(oe, { children: O("eventfullymanaged.communication.audiencePurpose", "Publish announcements to an event or workspace. Campaigns can also target attendees by tag. A sent status confirms that the campaign was queued.") }),
174
+ /* @__PURE__ */ h("div", {
134
175
  className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
135
- children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("h1", {
176
+ children: [/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("h1", {
136
177
  className: "text-2xl font-bold text-text-primary",
137
- children: /* @__PURE__ */ d(oe, { children: T("eventfullymanaged.communication.title", "Communications") })
138
- }), /* @__PURE__ */ d("p", {
178
+ children: /* @__PURE__ */ m(ae, { children: O("eventfullymanaged.communication.title", "Communications") })
179
+ }), /* @__PURE__ */ m("p", {
139
180
  className: "mt-1 text-sm text-text-secondary",
140
- children: T("eventfullymanaged.communication.description", "Draft, publish and send from one place.")
141
- })] }), /* @__PURE__ */ f("div", {
181
+ children: O("eventfullymanaged.communication.description", "Draft, publish and send from one place.")
182
+ })] }), /* @__PURE__ */ h("div", {
142
183
  className: "flex flex-col gap-2 sm:flex-row",
143
- children: [/* @__PURE__ */ f(_, {
184
+ children: [/* @__PURE__ */ h(y, {
144
185
  type: "button",
145
186
  variant: I === "announcement" ? "default" : "outline",
146
187
  onClick: () => L("announcement"),
147
- children: [/* @__PURE__ */ d(m, { className: "h-4 w-4" }), T("eventfullymanaged.communication.actions.newAnnouncement", "New announcement")]
148
- }), /* @__PURE__ */ f(_, {
188
+ children: [/* @__PURE__ */ m(_, { className: "h-4 w-4" }), O("eventfullymanaged.communication.actions.newAnnouncement", "New announcement")]
189
+ }), /* @__PURE__ */ h(y, {
149
190
  type: "button",
150
191
  variant: I === "campaign" ? "default" : "outline",
151
192
  onClick: () => L("campaign"),
152
- children: [/* @__PURE__ */ d(m, { className: "h-4 w-4" }), T("eventfullymanaged.communication.actions.newCampaign", "New campaign")]
193
+ children: [/* @__PURE__ */ m(_, { className: "h-4 w-4" }), O("eventfullymanaged.communication.actions.newCampaign", "New campaign")]
153
194
  })]
154
195
  })]
155
196
  }),
156
- /* @__PURE__ */ d(v, {
197
+ /* @__PURE__ */ m(b, {
157
198
  treatment: "glass",
158
199
  glow: !0,
159
200
  className: "p-5",
160
- children: /* @__PURE__ */ f("div", {
201
+ children: /* @__PURE__ */ h("div", {
161
202
  className: "grid grid-cols-1 gap-6 lg:grid-cols-2",
162
- children: [/* @__PURE__ */ f("div", {
203
+ children: [/* @__PURE__ */ h("div", {
163
204
  className: "space-y-3",
164
205
  children: [
165
- /* @__PURE__ */ f("div", {
206
+ /* @__PURE__ */ h("div", {
166
207
  className: "flex items-center gap-2",
167
- children: [d(I === "announcement" ? ie : p, { className: "h-4 w-4 text-accent-primary" }), /* @__PURE__ */ d("h2", {
208
+ children: [m(I === "announcement" ? ne : g, { className: "h-4 w-4 text-accent-primary" }), /* @__PURE__ */ m("h2", {
168
209
  className: "text-base font-semibold text-text-primary",
169
- children: I === "announcement" ? T("eventfullymanaged.communication.compose.announcement", "Compose announcement") : T("eventfullymanaged.communication.compose.campaign", "Compose campaign")
210
+ children: I === "announcement" ? O("eventfullymanaged.communication.compose.announcement", "Compose announcement") : O("eventfullymanaged.communication.compose.campaign", "Compose campaign")
170
211
  })]
171
212
  }),
172
- /* @__PURE__ */ f("label", {
213
+ /* @__PURE__ */ h("label", {
173
214
  className: "block space-y-1 text-sm",
174
215
  children: [
175
- /* @__PURE__ */ d("span", {
216
+ /* @__PURE__ */ m("span", {
176
217
  className: "font-medium text-text-primary",
177
- children: T("eventfullymanaged.communication.fields.event", "Event (optional)")
218
+ children: O("eventfullymanaged.communication.fields.event", "Event (optional)")
178
219
  }),
179
- /* @__PURE__ */ f(ce, {
220
+ /* @__PURE__ */ h(se, {
180
221
  value: R,
181
- onValueChange: z,
182
- children: [/* @__PURE__ */ d(de, {
183
- "aria-label": T("eventfullymanaged.communication.fields.event", "Event (optional)"),
184
- children: /* @__PURE__ */ d(fe, { placeholder: T("eventfullymanaged.communication.fields.eventPlaceholder", "All events (workspace-wide)") })
185
- }), /* @__PURE__ */ d(le, { children: ve.map((e) => /* @__PURE__ */ d(ue, {
222
+ onValueChange: Se,
223
+ children: [/* @__PURE__ */ m(ue, {
224
+ "aria-label": O("eventfullymanaged.communication.fields.event", "Event (optional)"),
225
+ children: /* @__PURE__ */ m(de, { placeholder: O("eventfullymanaged.communication.fields.eventPlaceholder", "All events (workspace-wide)") })
226
+ }), /* @__PURE__ */ m(ce, { children: xe.map((e) => /* @__PURE__ */ m(le, {
186
227
  value: e.id,
187
228
  children: e.name
188
229
  }, e.id)) })]
189
230
  }),
190
- /* @__PURE__ */ d("span", {
231
+ /* @__PURE__ */ m("span", {
191
232
  className: "block text-xs text-text-muted",
192
- children: T("eventfullymanaged.communication.fields.eventHint", "Leave unset to notify every attendee across the workspace, or pick one event to notify only its attendees.")
233
+ children: O("eventfullymanaged.communication.fields.eventScopeHint", "Choose an event to limit the audience to its attendees. Leave it unset to use the workspace.")
193
234
  })
194
235
  ]
195
236
  }),
196
- /* @__PURE__ */ f("label", {
237
+ /* @__PURE__ */ h("label", {
197
238
  className: "block space-y-1 text-sm",
198
- children: [/* @__PURE__ */ d("span", {
239
+ children: [/* @__PURE__ */ m("span", {
199
240
  className: "font-medium text-text-primary",
200
- children: T("eventfullymanaged.communication.fields.subject", "Subject")
201
- }), /* @__PURE__ */ d(b, {
202
- value: B,
203
- onChange: (e) => V(e.target.value),
204
- placeholder: T("eventfullymanaged.communication.fields.subjectPlaceholder", "Q4 Product Roadmap Update"),
205
- "aria-label": T("eventfullymanaged.communication.fields.subject", "Subject")
241
+ children: O("eventfullymanaged.communication.fields.subject", "Subject")
242
+ }), /* @__PURE__ */ m(S, {
243
+ value: z,
244
+ onChange: (e) => B(e.target.value),
245
+ placeholder: O("eventfullymanaged.communication.fields.subjectPlaceholder", "Q4 Product Roadmap Update"),
246
+ "aria-label": O("eventfullymanaged.communication.fields.subject", "Subject")
206
247
  })]
207
248
  }),
208
- /* @__PURE__ */ f("label", {
249
+ I === "campaign" ? /* @__PURE__ */ m(o, {
250
+ selected: U,
251
+ onChange: W
252
+ }) : /* @__PURE__ */ h("label", {
209
253
  className: "block space-y-1 text-sm",
210
254
  children: [
211
- /* @__PURE__ */ d("span", {
255
+ /* @__PURE__ */ m("span", {
212
256
  className: "font-medium text-text-primary",
213
- children: T("eventfullymanaged.communication.fields.audience", "Audience segments (optional)")
257
+ children: O("eventfullymanaged.communication.fields.announcementAudience", "Audience labels (optional)")
214
258
  }),
215
- /* @__PURE__ */ d(b, {
216
- value: H,
217
- onChange: (e) => U(e.target.value),
218
- placeholder: T("eventfullymanaged.communication.fields.audienceSegmentsPlaceholder", "vip, early-bird, speakers (comma-separated segments)"),
219
- "aria-label": T("eventfullymanaged.communication.fields.audience", "Audience segments (optional)")
259
+ /* @__PURE__ */ m(S, {
260
+ value: V,
261
+ onChange: (e) => H(e.target.value),
262
+ placeholder: O("eventfullymanaged.communication.fields.audienceSegmentsPlaceholder", "vip, early-bird, speakers (comma-separated segments)"),
263
+ "aria-label": O("eventfullymanaged.communication.fields.announcementAudience", "Audience labels (optional)")
220
264
  }),
221
- /* @__PURE__ */ d("span", {
265
+ /* @__PURE__ */ m("span", {
222
266
  className: "block text-xs text-text-muted",
223
- children: T("eventfullymanaged.communication.fields.audienceHint", "Every resolved attendee is notified regardless; segments are passed along for the notification worker to filter by, if it supports them.")
267
+ children: O("eventfullymanaged.communication.fields.announcementAudienceHint", "Announcement labels do not change who receives the announcement.")
224
268
  })
225
269
  ]
226
270
  }),
227
- /* @__PURE__ */ f("label", {
271
+ /* @__PURE__ */ h("label", {
228
272
  className: "block space-y-1 text-sm",
229
- children: [/* @__PURE__ */ d("span", {
273
+ children: [/* @__PURE__ */ m("span", {
230
274
  className: "font-medium text-text-primary",
231
- children: T("eventfullymanaged.communication.fields.body", "Message")
232
- }), /* @__PURE__ */ d(pe, {
233
- value: W,
234
- onChange: (e) => G(e.target.value),
275
+ children: O("eventfullymanaged.communication.fields.body", "Message")
276
+ }), /* @__PURE__ */ m(fe, {
277
+ value: q,
278
+ onChange: (e) => J(e.target.value),
235
279
  rows: 5,
236
- placeholder: T("eventfullymanaged.communication.fields.bodyPlaceholder", "Hi there, here are the latest updates…"),
237
- "aria-label": T("eventfullymanaged.communication.fields.body", "Message")
280
+ placeholder: O("eventfullymanaged.communication.fields.bodyPlaceholder", "Hi there, here are the latest updates…"),
281
+ "aria-label": O("eventfullymanaged.communication.fields.body", "Message")
238
282
  })]
239
283
  }),
240
- I === "campaign" ? /* @__PURE__ */ f("label", {
284
+ I === "campaign" ? /* @__PURE__ */ h("label", {
241
285
  className: "block space-y-1 text-sm",
242
286
  children: [
243
- /* @__PURE__ */ d("span", {
287
+ /* @__PURE__ */ m("span", {
244
288
  className: "font-medium text-text-primary",
245
- children: T("eventfullymanaged.communication.fields.scheduleAt", "Schedule send (optional)")
289
+ children: O("eventfullymanaged.communication.fields.scheduleAt", "Schedule send (optional)")
246
290
  }),
247
- /* @__PURE__ */ d(b, {
291
+ /* @__PURE__ */ m(S, {
248
292
  type: "datetime-local",
249
- value: K,
250
- onChange: (e) => q(e.target.value),
251
- "aria-label": T("eventfullymanaged.communication.fields.scheduleAt", "Schedule send (optional)")
293
+ value: Y,
294
+ onChange: (e) => Ce(e.target.value),
295
+ "aria-label": O("eventfullymanaged.communication.fields.scheduleAt", "Schedule send (optional)")
252
296
  }),
253
- /* @__PURE__ */ d("span", {
297
+ /* @__PURE__ */ m("span", {
254
298
  className: "block text-xs text-text-muted",
255
- children: T("eventfullymanaged.communication.fields.scheduleHint", "Leave blank to send immediately when you click Send campaign. A future time is not sent automatically — you (or anyone with access) must click Send campaign again at or after that time. Times are in your browser’s local time zone.")
299
+ children: O("eventfullymanaged.communication.fields.scheduleHint", "Leave blank to send immediately when you click Send campaign. A future time is not sent automatically — you (or anyone with access) must click Send campaign again at or after that time. Times are in your browser’s local time zone.")
256
300
  })
257
301
  ]
258
302
  }) : null,
259
- /* @__PURE__ */ d("div", {
303
+ /* @__PURE__ */ m("div", {
260
304
  className: "flex justify-end",
261
- children: /* @__PURE__ */ d(_, {
305
+ children: /* @__PURE__ */ m(y, {
262
306
  type: "button",
263
- disabled: Q,
264
- onClick: ye,
265
- children: Q ? T("eventfullymanaged.communication.actions.saving", "Saving…") : T(I === "announcement" ? "eventfullymanaged.communication.actions.createAnnouncement" : "eventfullymanaged.communication.actions.createCampaign", "Create draft")
307
+ disabled: we,
308
+ onClick: Ee,
309
+ children: we ? O("eventfullymanaged.communication.actions.saving", "Saving…") : O(I === "announcement" ? "eventfullymanaged.communication.actions.createAnnouncement" : "eventfullymanaged.communication.actions.createCampaign", "Create draft")
266
310
  })
267
311
  })
268
312
  ]
269
- }), /* @__PURE__ */ f("div", {
313
+ }), /* @__PURE__ */ h("div", {
270
314
  className: "rounded-card border border-border-seam bg-bg-surface p-4",
271
- children: [/* @__PURE__ */ f("div", {
315
+ children: [/* @__PURE__ */ h("div", {
272
316
  className: "flex items-center justify-between border-b border-border-seam pb-2",
273
- children: [/* @__PURE__ */ f("span", {
317
+ children: [/* @__PURE__ */ h("span", {
274
318
  className: "flex items-center gap-2 text-xs font-medium uppercase tracking-wide text-text-muted",
275
- children: [/* @__PURE__ */ d(p, { className: "h-3.5 w-3.5" }), T("eventfullymanaged.communication.preview.label", "Preview")]
276
- }), /* @__PURE__ */ d(g, {
319
+ children: [/* @__PURE__ */ m(g, { className: "h-3.5 w-3.5" }), O("eventfullymanaged.communication.preview.label", "Preview")]
320
+ }), /* @__PURE__ */ m(v, {
277
321
  variant: "info",
278
322
  className: "uppercase",
279
- children: T("eventfullymanaged.communication.preview.draft", "Draft")
323
+ children: O("eventfullymanaged.communication.preview.draft", "Draft")
280
324
  })]
281
- }), /* @__PURE__ */ f("div", {
325
+ }), /* @__PURE__ */ h("div", {
282
326
  className: "mt-3 space-y-2",
283
327
  children: [
284
- /* @__PURE__ */ d("p", {
328
+ /* @__PURE__ */ m("p", {
285
329
  className: "text-base font-semibold text-text-primary",
286
- children: B.trim() || T("eventfullymanaged.communication.preview.noSubject", "Your subject line")
330
+ children: z.trim() || O("eventfullymanaged.communication.preview.noSubject", "Your subject line")
287
331
  }),
288
- H.trim() ? /* @__PURE__ */ f("p", {
332
+ (I === "campaign" ? U.length > 0 : V.trim()) ? /* @__PURE__ */ h("p", {
289
333
  className: "text-xs text-text-secondary",
290
334
  children: [
291
- T("eventfullymanaged.communication.preview.to", "To"),
292
- ": ",
293
- H.trim()
335
+ O("eventfullymanaged.communication.preview.to", "To"),
336
+ ":",
337
+ " ",
338
+ I === "campaign" ? U.map(({ label: e }) => e).join(", ") : V.trim()
294
339
  ]
295
340
  }) : null,
296
- /* @__PURE__ */ d("p", {
341
+ /* @__PURE__ */ m("p", {
297
342
  className: "whitespace-pre-wrap text-sm text-text-secondary",
298
- children: W.trim() || T("eventfullymanaged.communication.preview.noBody", "Start typing to see your message preview here.")
343
+ children: q.trim() || O("eventfullymanaged.communication.preview.noBody", "Start typing to see your message preview here.")
299
344
  })
300
345
  ]
301
346
  })]
302
347
  })]
303
348
  })
304
349
  }),
305
- /* @__PURE__ */ f("div", {
350
+ /* @__PURE__ */ h("div", {
306
351
  className: "grid grid-cols-1 gap-6 lg:grid-cols-2",
307
- children: [/* @__PURE__ */ f(v, {
352
+ children: [/* @__PURE__ */ h(b, {
308
353
  treatment: "plain",
309
354
  className: "border-border-seam p-5",
310
- children: [/* @__PURE__ */ f("div", {
355
+ children: [/* @__PURE__ */ h("div", {
311
356
  className: "flex items-center justify-between",
312
- children: [/* @__PURE__ */ d("h2", {
357
+ children: [/* @__PURE__ */ m("h2", {
313
358
  className: "text-lg font-semibold text-text-primary",
314
- children: T("eventfullymanaged.communication.announcements.heading", "Announcements")
315
- }), Y > 0 ? /* @__PURE__ */ d("span", {
359
+ children: O("eventfullymanaged.communication.announcements.heading", "Announcements")
360
+ }), Z > 0 ? /* @__PURE__ */ m("span", {
316
361
  className: "text-sm text-text-muted",
317
- children: Y
362
+ children: Z
318
363
  }) : null]
319
- }), /* @__PURE__ */ f("div", {
364
+ }), /* @__PURE__ */ h("div", {
320
365
  className: "mt-4",
321
- children: [O.loading && J.length === 0 ? /* @__PURE__ */ d("p", {
366
+ children: [j.loading && X.length === 0 ? /* @__PURE__ */ m("p", {
322
367
  className: "py-8 text-center text-sm text-text-secondary",
323
- children: T("eventfullymanaged.communication.announcements.loading", "Loading announcements…")
324
- }) : J.length === 0 ? /* @__PURE__ */ d(y, {
368
+ children: O("eventfullymanaged.communication.announcements.loading", "Loading announcements…")
369
+ }) : X.length === 0 ? /* @__PURE__ */ m(x, {
325
370
  illustration: "empty-data",
326
- title: T("eventfullymanaged.communication.announcements.empty", "No announcements yet."),
371
+ title: O("eventfullymanaged.communication.announcements.empty", "No announcements yet."),
327
372
  className: "py-8"
328
- }) : /* @__PURE__ */ d("ul", {
373
+ }) : /* @__PURE__ */ m("ul", {
329
374
  className: "space-y-2.5",
330
- children: J.map((e) => /* @__PURE__ */ f("li", {
375
+ children: X.map((e) => /* @__PURE__ */ h("li", {
331
376
  className: "flex items-center justify-between gap-3 rounded-card border border-border-seam bg-bg-surface p-3 transition-[box-shadow,border-color] duration-200 hover:border-border-strong hover:shadow-elevation-1",
332
- children: [/* @__PURE__ */ d("p", {
377
+ children: [/* @__PURE__ */ m("p", {
333
378
  className: "min-w-0 truncate font-medium text-text-primary",
334
- children: C(e, T("eventfullymanaged.communication.announcements.itemPrefix", "Announcement"))
335
- }), /* @__PURE__ */ f("div", {
379
+ children: E(e, O("eventfullymanaged.communication.announcements.itemPrefix", "Announcement"))
380
+ }), /* @__PURE__ */ h("div", {
336
381
  className: "flex shrink-0 items-center gap-2",
337
- children: [e.status ? /* @__PURE__ */ d(g, {
338
- variant: x(e.status),
382
+ children: [e.status ? /* @__PURE__ */ m(v, {
383
+ variant: w(e.status),
339
384
  className: "uppercase",
340
385
  children: e.status
341
- }) : null, S(e.status) ? /* @__PURE__ */ f(_, {
386
+ }) : null, T(e.status) ? /* @__PURE__ */ h(y, {
342
387
  type: "button",
343
388
  size: "sm",
344
- disabled: A,
345
- onClick: () => void be(e),
346
- children: [/* @__PURE__ */ d(h, { className: "h-3.5 w-3.5" }), T("eventfullymanaged.communication.actions.publish", "Publish")]
389
+ disabled: ve,
390
+ onClick: () => void Oe(e),
391
+ children: [/* @__PURE__ */ m(ie, { className: "h-3.5 w-3.5" }), O("eventfullymanaged.communication.actions.publish", "Publish")]
347
392
  }) : null]
348
393
  })]
349
394
  }, e.id))
350
- }), /* @__PURE__ */ d(i, {
351
- offset: E.offset,
352
- limit: E.limit,
353
- loadedCount: J.length,
354
- total: Y,
355
- onPrev: E.prevPage,
356
- onNext: E.nextPage,
357
- itemLabel: T("eventfullymanaged.communication.announcements.heading", "Announcements").toLowerCase(),
358
- loading: O.loading
395
+ }), /* @__PURE__ */ m(s, {
396
+ offset: k.offset,
397
+ limit: k.limit,
398
+ loadedCount: X.length,
399
+ total: Z,
400
+ onPrev: k.prevPage,
401
+ onNext: k.nextPage,
402
+ itemLabel: O("eventfullymanaged.communication.announcements.heading", "Announcements").toLowerCase(),
403
+ loading: j.loading
359
404
  })]
360
405
  })]
361
- }), /* @__PURE__ */ f(v, {
406
+ }), /* @__PURE__ */ h(b, {
362
407
  treatment: "plain",
363
408
  className: "border-border-seam p-5",
364
- children: [/* @__PURE__ */ f("div", {
409
+ children: [/* @__PURE__ */ h("div", {
365
410
  className: "flex items-center justify-between",
366
- children: [/* @__PURE__ */ d("h2", {
411
+ children: [/* @__PURE__ */ m("h2", {
367
412
  className: "text-lg font-semibold text-text-primary",
368
- children: T("eventfullymanaged.communication.campaigns.heading", "Campaigns")
369
- }), Z > 0 ? /* @__PURE__ */ d("span", {
413
+ children: O("eventfullymanaged.communication.campaigns.heading", "Campaigns")
414
+ }), $ > 0 ? /* @__PURE__ */ m("span", {
370
415
  className: "text-sm text-text-muted",
371
- children: Z
416
+ children: $
372
417
  }) : null]
373
- }), /* @__PURE__ */ f("div", {
418
+ }), /* @__PURE__ */ h("div", {
374
419
  className: "mt-4",
375
- children: [k.loading && X.length === 0 ? /* @__PURE__ */ d("p", {
376
- className: "py-8 text-center text-sm text-text-secondary",
377
- children: T("eventfullymanaged.communication.campaigns.loading", "Loading campaigns…")
378
- }) : X.length === 0 ? /* @__PURE__ */ d(y, {
379
- illustration: "empty-data",
380
- title: T("eventfullymanaged.communication.campaigns.empty", "No campaigns yet."),
381
- className: "py-8"
382
- }) : /* @__PURE__ */ d("ul", {
383
- className: "space-y-2.5",
384
- children: X.map((e) => {
385
- let t = me(e);
386
- return /* @__PURE__ */ f("li", {
387
- className: "flex items-center justify-between gap-3 rounded-card border border-border-seam bg-bg-surface p-3 transition-[box-shadow,border-color] duration-200 hover:border-border-strong hover:shadow-elevation-1",
388
- children: [/* @__PURE__ */ f("div", {
389
- className: "min-w-0",
390
- children: [/* @__PURE__ */ d("p", {
391
- className: "truncate font-medium text-text-primary",
392
- children: C(e, T("eventfullymanaged.communication.campaigns.itemPrefix", "Campaign"))
393
- }), t ? /* @__PURE__ */ f("p", {
394
- className: "truncate text-xs text-text-muted",
420
+ children: [
421
+ G ? /* @__PURE__ */ h("div", {
422
+ className: "mb-4 space-y-3 rounded-card border border-border-seam bg-bg-surface p-4",
423
+ children: [
424
+ /* @__PURE__ */ m("p", {
425
+ className: "font-medium text-text-primary",
426
+ children: E(G.row, "Campaign")
427
+ }),
428
+ /* @__PURE__ */ m(o, {
429
+ selected: G.tags,
430
+ onChange: (e) => K({
431
+ ...G,
432
+ tags: e,
433
+ changed: !0
434
+ })
435
+ }, G.row.id),
436
+ /* @__PURE__ */ h("div", {
437
+ className: "flex flex-wrap gap-2",
438
+ children: [/* @__PURE__ */ m(y, {
439
+ type: "button",
440
+ disabled: P || !G.changed,
441
+ onClick: () => void De(),
442
+ children: O("eventfullymanaged.communication.actions.saveAudience", "Save audience")
443
+ }), /* @__PURE__ */ m(y, {
444
+ type: "button",
445
+ variant: "outline",
446
+ onClick: () => K(null),
447
+ children: O("eventfullymanaged.communication.actions.dismissAudience", "Close audience editor")
448
+ })]
449
+ })
450
+ ]
451
+ }) : null,
452
+ M.loading && Q.length === 0 ? /* @__PURE__ */ m("p", {
453
+ className: "py-8 text-center text-sm text-text-secondary",
454
+ children: O("eventfullymanaged.communication.campaigns.loading", "Loading campaigns…")
455
+ }) : Q.length === 0 ? /* @__PURE__ */ m(x, {
456
+ illustration: "empty-data",
457
+ title: O("eventfullymanaged.communication.campaigns.empty", "No campaigns yet."),
458
+ className: "py-8"
459
+ }) : /* @__PURE__ */ m("ul", {
460
+ className: "space-y-2.5",
461
+ children: Q.map((e) => {
462
+ let t = pe(e);
463
+ return /* @__PURE__ */ h("li", {
464
+ className: "flex items-center justify-between gap-3 rounded-card border border-border-seam bg-bg-surface p-3 transition-[box-shadow,border-color] duration-200 hover:border-border-strong hover:shadow-elevation-1",
465
+ children: [/* @__PURE__ */ h("div", {
466
+ className: "min-w-0",
467
+ children: [/* @__PURE__ */ m("p", {
468
+ className: "truncate font-medium text-text-primary",
469
+ children: E(e, O("eventfullymanaged.communication.campaigns.itemPrefix", "Campaign"))
470
+ }), t ? /* @__PURE__ */ h("p", {
471
+ className: "truncate text-xs text-text-muted",
472
+ children: [
473
+ O("eventfullymanaged.communication.campaigns.scheduledFor", "Scheduled for"),
474
+ " ",
475
+ new Date(t).toLocaleString()
476
+ ]
477
+ }) : null]
478
+ }), /* @__PURE__ */ h("div", {
479
+ className: "flex shrink-0 items-center gap-2",
395
480
  children: [
396
- T("eventfullymanaged.communication.campaigns.scheduledFor", "Scheduled for"),
397
- " ",
398
- new Date(t).toLocaleString()
481
+ e.status ? /* @__PURE__ */ m(v, {
482
+ variant: w(e.status),
483
+ className: "uppercase",
484
+ children: e.status
485
+ }) : null,
486
+ e.status?.toLowerCase() === "draft" ? /* @__PURE__ */ m(y, {
487
+ type: "button",
488
+ size: "sm",
489
+ variant: "outline",
490
+ disabled: P || F,
491
+ onClick: () => K({
492
+ row: e,
493
+ tags: me(e),
494
+ changed: !1
495
+ }),
496
+ children: O("eventfullymanaged.communication.actions.editAudience", "Edit audience")
497
+ }) : null,
498
+ T(e.status) ? /* @__PURE__ */ h(y, {
499
+ type: "button",
500
+ size: "sm",
501
+ disabled: F || G?.row.id === e.id,
502
+ onClick: () => void ke(e),
503
+ children: [/* @__PURE__ */ m(re, { className: "h-3.5 w-3.5" }), O("eventfullymanaged.communication.actions.send", "Send campaign")]
504
+ }) : null,
505
+ (e.status ?? "").toLowerCase() === "scheduled" ? /* @__PURE__ */ m(y, {
506
+ type: "button",
507
+ size: "sm",
508
+ variant: "outline",
509
+ onClick: () => void Ae(e),
510
+ children: O("eventfullymanaged.communication.actions.cancelSchedule", "Cancel schedule")
511
+ }) : null
399
512
  ]
400
- }) : null]
401
- }), /* @__PURE__ */ f("div", {
402
- className: "flex shrink-0 items-center gap-2",
403
- children: [
404
- e.status ? /* @__PURE__ */ d(g, {
405
- variant: x(e.status),
406
- className: "uppercase",
407
- children: e.status
408
- }) : null,
409
- S(e.status) ? /* @__PURE__ */ f(_, {
410
- type: "button",
411
- size: "sm",
412
- disabled: P,
413
- onClick: () => void xe(e),
414
- children: [/* @__PURE__ */ d(ae, { className: "h-3.5 w-3.5" }), T("eventfullymanaged.communication.actions.send", "Send campaign")]
415
- }) : null,
416
- (e.status ?? "").toLowerCase() === "scheduled" ? /* @__PURE__ */ d(_, {
417
- type: "button",
418
- size: "sm",
419
- variant: "outline",
420
- onClick: () => void Se(e),
421
- children: T("eventfullymanaged.communication.actions.cancelSchedule", "Cancel schedule")
422
- }) : null
423
- ]
424
- })]
425
- }, e.id);
513
+ })]
514
+ }, e.id);
515
+ })
516
+ }),
517
+ /* @__PURE__ */ m(s, {
518
+ offset: A.offset,
519
+ limit: A.limit,
520
+ loadedCount: Q.length,
521
+ total: $,
522
+ onPrev: A.prevPage,
523
+ onNext: A.nextPage,
524
+ itemLabel: O("eventfullymanaged.communication.campaigns.heading", "Campaigns").toLowerCase(),
525
+ loading: M.loading
426
526
  })
427
- }), /* @__PURE__ */ d(i, {
428
- offset: D.offset,
429
- limit: D.limit,
430
- loadedCount: X.length,
431
- total: Z,
432
- onPrev: D.prevPage,
433
- onNext: D.nextPage,
434
- itemLabel: T("eventfullymanaged.communication.campaigns.heading", "Campaigns").toLowerCase(),
435
- loading: k.loading
436
- })]
527
+ ]
437
528
  })]
438
529
  })]
439
530
  })
440
531
  ]
441
532
  });
442
533
  }
443
- export { w as default };
534
+ export { D as default };
444
535
 
445
536
  //# sourceMappingURL=CommunicationPage.js.map