@burdenoff/microfe-newsletter 2026.830.1 → 2026.830.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.
- package/dist/newsletter/AdminNewsletterRoot.js +4 -4
- package/dist/newsletter/UserNewsletterRoot.js +4 -4
- package/dist/newsletter/pages/ABTestingPage.js +23 -23
- package/dist/newsletter/pages/ABTestingPage.js.map +1 -1
- package/dist/newsletter/pages/AnalyticsDashboardPage.js +95 -97
- package/dist/newsletter/pages/AnalyticsDashboardPage.js.map +1 -1
- package/dist/newsletter/pages/CampaignAnalyticsPage.js +3 -3
- package/dist/newsletter/pages/CampaignEditorPage.js +297 -300
- package/dist/newsletter/pages/CampaignEditorPage.js.map +1 -1
- package/dist/newsletter/pages/CampaignsListPage.js +14 -14
- package/dist/newsletter/pages/CompliancePage.js +175 -184
- package/dist/newsletter/pages/CompliancePage.js.map +1 -1
- package/dist/newsletter/pages/SchedulerPage.js +3 -3
- package/dist/newsletter/pages/SubscriberDetailPage.js +222 -222
- package/dist/newsletter/pages/SubscriberDetailPage.js.map +1 -1
- package/dist/newsletter/pages/SubscribersListPage.js +279 -282
- package/dist/newsletter/pages/SubscribersListPage.js.map +1 -1
- package/dist/newsletter/pages/TemplateEditorPage.js +3 -3
- package/dist/newsletter/pages/TemplateLibraryPage.js +109 -112
- package/dist/newsletter/pages/TemplateLibraryPage.js.map +1 -1
- package/dist/newsletter/pages/WaitlistDetailPage.js +3 -3
- package/dist/newsletter/pages/WaitlistListPage.js +139 -139
- package/dist/newsletter/pages/WaitlistListPage.js.map +1 -1
- package/dist/newsletter/providers/NewsletterProvider.js +47 -46
- package/dist/newsletter/providers/NewsletterProvider.js.map +1 -1
- package/dist/newsletter/shared/hooks/useTr.js +3 -3
- package/dist/newsletter/shared/hooks/useTr.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,534 +1,531 @@
|
|
|
1
1
|
import { useNewsletterStore as e } from "../store/newsletterStore.js";
|
|
2
2
|
import { useExportSubscribers as t, usePlatformProducts as n, useSubscriberMutations as r, useSubscribers as i } from "../hooks/useNewsletterOperations.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { useTr as a } from "../shared/hooks/useTr.js";
|
|
4
|
+
import { useNewsletter as o } from "../providers/NewsletterProvider.js";
|
|
5
|
+
import { NEWSLETTER_PERMISSIONS as s } from "../constants/permissions.js";
|
|
6
6
|
import { nativeConfirm as c, nativeNotify as l } from "../../utils/nativeBridge.js";
|
|
7
|
-
import {
|
|
7
|
+
import { useRef as u, useState as d } from "react";
|
|
8
8
|
import { AccessDenied as ee } from "@burdenoff/fe-libs/shared/components";
|
|
9
9
|
import { useNavigate as te } from "react-router";
|
|
10
|
-
import { AlertCircle as ne, CheckCircle as re, Download as ie, Filter as ae, Loader2 as
|
|
10
|
+
import { AlertCircle as ne, CheckCircle as re, Download as ie, Filter as ae, Loader2 as f, Mail as p, MailX as m, Plus as h, RefreshCw as oe, Search as se, Trash2 as g, Upload as _, Users as ce, X as v } from "lucide-react";
|
|
11
11
|
import { usePermissions as le } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
12
|
+
import { useI18n as ue } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
13
|
+
import { jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
14
|
+
import { AuroraBackground as de, Button as x, CTAOverflowMenu as fe, EmphasisPanel as pe, GradientText as me, IllustratedEmptyState as S, PagePurpose as he } from "@burdenoff/fe-libs/ui";
|
|
15
15
|
//#region src/newsletter/pages/SubscribersListPage.tsx
|
|
16
|
-
function
|
|
16
|
+
function C(e, t, n) {
|
|
17
17
|
return e ? n.find((t) => t.id === e)?.name ?? e.slice(0, 8) : t;
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
let {
|
|
21
|
-
let n = s(e);
|
|
22
|
-
return n === e ? t : n;
|
|
23
|
-
}, [s]), _e = te(), { productId: E } = a(), { hasPermission: D, isLoading: O, permissions: k } = le(), { subscriberFilter: A, updateSubscriberFilter: j } = e(), M = (Array.isArray(k) ? k : k?.permissionStrings)?.some?.((e) => e.startsWith("tenantmodule-newsletter:subscribers:")), ve = M ? D(o.SUBSCRIBER_LIST) : !0, ye = M ? D(o.SUBSCRIBER_CREATE) : !0, be = M ? D(o.SUBSCRIBER_DELETE) : !0, xe = M ? D(o.SUBSCRIBER_IMPORT) : !0, Se = M ? D(o.SUBSCRIBER_EXPORT) : !0, [Ce, N] = f(!1), [we, P] = f(!1), [F, I] = f(""), [L, R] = f(""), [z, B] = f(/* @__PURE__ */ new Set()), [V, H] = f(null), Te = d(null), { subscribers: U, totalCount: W, loading: G, error: K, refetch: q } = i({
|
|
19
|
+
function w() {
|
|
20
|
+
let { locale: g } = ue(), w = a(), _e = te(), { productId: T } = o(), { hasPermission: E, isLoading: D, permissions: O } = le(), { subscriberFilter: k, updateSubscriberFilter: A } = e(), j = (Array.isArray(O) ? O : O?.permissionStrings)?.some?.((e) => e.startsWith("tenantmodule-newsletter:subscribers:")), ve = j ? E(s.SUBSCRIBER_LIST) : !0, ye = j ? E(s.SUBSCRIBER_CREATE) : !0, be = j ? E(s.SUBSCRIBER_DELETE) : !0, xe = j ? E(s.SUBSCRIBER_IMPORT) : !0, Se = j ? E(s.SUBSCRIBER_EXPORT) : !0, [Ce, M] = d(!1), [we, N] = d(!1), [P, F] = d(""), [I, L] = d(""), [R, z] = d(/* @__PURE__ */ new Set()), [B, V] = d(null), H = u(null), { subscribers: U, totalCount: W, loading: G, error: K, refetch: q } = i({
|
|
24
21
|
subscribed: (() => {
|
|
25
|
-
if (
|
|
26
|
-
if (
|
|
22
|
+
if (k.status === "ACTIVE") return !0;
|
|
23
|
+
if (k.status === "UNSUBSCRIBED") return !1;
|
|
27
24
|
})(),
|
|
28
|
-
platformProductId:
|
|
29
|
-
}), { subscribe:
|
|
30
|
-
if (!
|
|
31
|
-
let t =
|
|
25
|
+
platformProductId: T
|
|
26
|
+
}), { subscribe: Te, unsubscribeFromProduct: Ee, resubscribeToProduct: De, deleteSubscriber: Oe, importSubscribers: ke, subscribing: J, unsubscribing: Ae, deletingSubscriber: je, importing: Y } = r(), { exportSubscribers: Me } = t(void 0, T), { products: X } = n(), Z = U.filter((e) => {
|
|
27
|
+
if (!k.search) return !0;
|
|
28
|
+
let t = k.search.toLowerCase();
|
|
32
29
|
return e.email.toLowerCase().includes(t);
|
|
33
|
-
}),
|
|
34
|
-
|
|
30
|
+
}), Ne = U.filter((e) => e.subscribed && e.status !== "UNSUBSCRIBED").length, Pe = U.filter((e) => !e.subscribed || e.status === "UNSUBSCRIBED").length, Q = (e, t) => {
|
|
31
|
+
V({
|
|
35
32
|
type: e,
|
|
36
33
|
message: t
|
|
37
|
-
}), setTimeout(() =>
|
|
34
|
+
}), setTimeout(() => V(null), 5e3);
|
|
35
|
+
}, Fe = (e) => {
|
|
36
|
+
A({ search: e });
|
|
38
37
|
}, Ie = (e) => {
|
|
39
|
-
|
|
40
|
-
}, Le = (
|
|
41
|
-
j({ status: e });
|
|
42
|
-
}, Re = async () => {
|
|
38
|
+
A({ status: e });
|
|
39
|
+
}, Le = async () => {
|
|
43
40
|
try {
|
|
44
|
-
let e = await
|
|
41
|
+
let e = await Me();
|
|
45
42
|
if (e.data?.exportSubscribers) {
|
|
46
43
|
let t = [[
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
44
|
+
w("newsletter.email", "Email"),
|
|
45
|
+
w("newsletterCommon.status", "Status"),
|
|
46
|
+
w("subscribers.subscribedAt", "Subscribed At"),
|
|
47
|
+
w("subscribers.unsubscribedAt", "Unsubscribed At")
|
|
51
48
|
].join(","), ...e.data.exportSubscribers.map((e) => `${e.email},${e.status},${e.subscribedAt},${e.unsubscribedAt || ""}`)].join("\n"), n = new Blob([t], { type: "text/csv" }), r = window.URL.createObjectURL(n), i = document.createElement("a");
|
|
52
|
-
i.href = r, i.download = `${
|
|
49
|
+
i.href = r, i.download = `${w("subscribers.exportFilenamePrefix", "subscribers")}-${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]}.csv`, i.click(), window.URL.revokeObjectURL(r), Q("success", w("subscribers.exportedSuccessfully", "Subscribers exported successfully"));
|
|
53
50
|
}
|
|
54
51
|
} catch (e) {
|
|
55
|
-
Q("error", `${
|
|
52
|
+
Q("error", `${w("subscribers.failedToExport", "Failed to export")}: ${e instanceof Error ? e.message : w("newsletter.unknownError", "Unknown error")}`);
|
|
56
53
|
}
|
|
57
54
|
}, $ = async () => {
|
|
58
|
-
if (!
|
|
59
|
-
Q("error",
|
|
55
|
+
if (!P.trim()) {
|
|
56
|
+
Q("error", w("subscribers.pleaseEnterEmail", "Please enter an email address"));
|
|
60
57
|
return;
|
|
61
58
|
}
|
|
62
59
|
try {
|
|
63
|
-
Q("success", (await
|
|
64
|
-
email:
|
|
65
|
-
platformProductId:
|
|
66
|
-
}))?.alreadySubscribed ? `${
|
|
60
|
+
Q("success", (await Te({
|
|
61
|
+
email: P.trim(),
|
|
62
|
+
platformProductId: T
|
|
63
|
+
}))?.alreadySubscribed ? `${P} ${w("subscribers.alreadySubscribedSuffix", "is already part of this newsletter")}` : `${P} ${w("subscribers.addedSuccessfully", "added successfully")}`), F(""), M(!1);
|
|
67
64
|
} catch (e) {
|
|
68
|
-
Q("error", `${
|
|
65
|
+
Q("error", `${w("subscribers.failedToAddSubscriber", "Failed to add subscriber")}: ${e instanceof Error ? e.message : w("newsletter.unknownError", "Unknown error")}`);
|
|
69
66
|
}
|
|
70
|
-
},
|
|
71
|
-
if (!
|
|
72
|
-
Q("error",
|
|
67
|
+
}, Re = async () => {
|
|
68
|
+
if (!I.trim()) {
|
|
69
|
+
Q("error", w("subscribers.pleaseEnterEmails", "Please enter email addresses"));
|
|
73
70
|
return;
|
|
74
71
|
}
|
|
75
72
|
try {
|
|
76
|
-
let e =
|
|
73
|
+
let e = I.split(/[\n,]/).map((e) => e.trim()).filter((e) => e && e.includes("@"));
|
|
77
74
|
if (e.length === 0) {
|
|
78
|
-
Q("error",
|
|
75
|
+
Q("error", w("subscribers.noValidEmails", "No valid email addresses found"));
|
|
79
76
|
return;
|
|
80
77
|
}
|
|
81
|
-
let t = await
|
|
78
|
+
let t = await ke(e.map((e) => ({
|
|
82
79
|
email: e,
|
|
83
|
-
platformProductId:
|
|
80
|
+
platformProductId: T
|
|
84
81
|
})));
|
|
85
|
-
t && (Q("success", `${
|
|
82
|
+
t && (Q("success", `${w("subscribers.importedPrefix", "Imported")} ${t.imported} ${w("subscribers.subscribersLower", "subscribers")}. ${w("subscribers.skipped", "Skipped")}: ${t.skipped}, ${w("subscribers.failed", "Failed")}: ${t.failed}`), L(""), N(!1));
|
|
86
83
|
} catch (e) {
|
|
87
|
-
Q("error", `${
|
|
84
|
+
Q("error", `${w("subscribers.failedToImport", "Failed to import")}: ${e instanceof Error ? e.message : w("newsletter.unknownError", "Unknown error")}`);
|
|
88
85
|
}
|
|
89
|
-
},
|
|
86
|
+
}, ze = (e) => {
|
|
90
87
|
let t = e.target.files?.[0];
|
|
91
88
|
if (!t) return;
|
|
92
89
|
let n = new FileReader();
|
|
93
90
|
n.onload = (e) => {
|
|
94
|
-
|
|
91
|
+
L(e.target?.result);
|
|
95
92
|
}, n.readAsText(t);
|
|
96
|
-
},
|
|
97
|
-
if (confirm(`${
|
|
98
|
-
await
|
|
93
|
+
}, Be = async (e) => {
|
|
94
|
+
if (confirm(`${w("subscribers.confirmUnsubscribePrefix", "Are you sure you want to unsubscribe")} ${e}?`)) try {
|
|
95
|
+
await Ee(e, T), Q("success", `${e} ${w("subscribers.unsubscribedSuffix", "unsubscribed")}`);
|
|
99
96
|
} catch (e) {
|
|
100
|
-
Q("error", `${
|
|
97
|
+
Q("error", `${w("subscribers.failedToUnsubscribe", "Failed to unsubscribe")}: ${e instanceof Error ? e.message : w("newsletter.unknownError", "Unknown error")}`);
|
|
101
98
|
}
|
|
102
|
-
},
|
|
99
|
+
}, Ve = async (e) => {
|
|
103
100
|
try {
|
|
104
|
-
await
|
|
101
|
+
await De(e, T), Q("success", `${e} ${w("subscribers.resubscribedSuffix", "resubscribed")}`);
|
|
105
102
|
} catch (e) {
|
|
106
|
-
Q("error", `${
|
|
103
|
+
Q("error", `${w("subscribers.failedToResubscribe", "Failed to resubscribe")}: ${e instanceof Error ? e.message : w("newsletter.unknownError", "Unknown error")}`);
|
|
107
104
|
}
|
|
108
|
-
},
|
|
105
|
+
}, He = async (e, t) => {
|
|
109
106
|
if (await c({
|
|
110
|
-
title:
|
|
111
|
-
message: `${
|
|
107
|
+
title: w("subscribers.deleteSubscriber", "Delete Subscriber"),
|
|
108
|
+
message: `${w("subscribers.confirmDeletePrefix", "Are you sure you want to delete")} ${t}? ${w("newsletter.actionCannotBeUndone", "This action cannot be undone.")}`
|
|
112
109
|
}) !== !1) try {
|
|
113
|
-
await
|
|
110
|
+
await Oe(e), l("success"), Q("success", `${t} ${w("newsletter.deletedSuffix", "deleted")}`);
|
|
114
111
|
} catch (e) {
|
|
115
|
-
l("error"), Q("error", `${
|
|
112
|
+
l("error"), Q("error", `${w("templates.failedToDelete", "Failed to delete")}: ${e instanceof Error ? e.message : w("newsletter.unknownError", "Unknown error")}`);
|
|
116
113
|
}
|
|
117
|
-
},
|
|
118
|
-
|
|
114
|
+
}, Ue = () => {
|
|
115
|
+
R.size === Z.length ? z(/* @__PURE__ */ new Set()) : z(new Set(Z.map((e) => e.id)));
|
|
116
|
+
}, We = (e) => {
|
|
117
|
+
let t = new Set(R);
|
|
118
|
+
t.has(e) ? t.delete(e) : t.add(e), z(t);
|
|
119
119
|
}, Ge = (e) => {
|
|
120
|
-
let t = new Set(z);
|
|
121
|
-
t.has(e) ? t.delete(e) : t.add(e), B(t);
|
|
122
|
-
}, Ke = (e) => {
|
|
123
120
|
_e(e);
|
|
124
|
-
},
|
|
121
|
+
}, Ke = (e) => new Date(e).toLocaleDateString(g || "en-US", {
|
|
125
122
|
month: "short",
|
|
126
123
|
day: "numeric",
|
|
127
124
|
year: "numeric"
|
|
128
125
|
});
|
|
129
|
-
return
|
|
126
|
+
return D ? /* @__PURE__ */ y("div", {
|
|
130
127
|
className: "flex items-center justify-center h-full",
|
|
131
|
-
children: /* @__PURE__ */
|
|
128
|
+
children: /* @__PURE__ */ b("div", {
|
|
132
129
|
className: "flex items-center gap-2 text-text-secondary",
|
|
133
|
-
children: [/* @__PURE__ */
|
|
130
|
+
children: [/* @__PURE__ */ y(f, {
|
|
134
131
|
className: "animate-spin",
|
|
135
132
|
size: 24
|
|
136
|
-
}), /* @__PURE__ */
|
|
133
|
+
}), /* @__PURE__ */ y("span", { children: w("newsletterCommon.loading", "Loading...") })]
|
|
137
134
|
})
|
|
138
|
-
}) : !
|
|
135
|
+
}) : !D && O && O.permissionStrings?.length > 0 && !ve ? /* @__PURE__ */ y(ee, {}) : /* @__PURE__ */ b("div", {
|
|
139
136
|
className: "flex flex-col h-full",
|
|
140
137
|
children: [
|
|
141
|
-
|
|
142
|
-
className: `fixed top-4 right-4 z-50 flex items-center gap-2 px-4 py-3 rounded-lg shadow-[var(--shadow-pop)] ${
|
|
143
|
-
children: [
|
|
138
|
+
B && /* @__PURE__ */ b("div", {
|
|
139
|
+
className: `fixed top-4 right-4 z-50 flex items-center gap-2 px-4 py-3 rounded-lg shadow-[var(--shadow-pop)] ${B.type === "success" ? "bg-status-success-bg-subtle text-status-success-text border border-status-success-border/20" : "bg-status-error-bg-subtle text-status-error-text border border-status-error-border/20"}`,
|
|
140
|
+
children: [B.type === "success" ? /* @__PURE__ */ y(re, { size: 20 }) : /* @__PURE__ */ y(ne, { size: 20 }), /* @__PURE__ */ y("span", { children: B.message })]
|
|
144
141
|
}),
|
|
145
|
-
/* @__PURE__ */
|
|
142
|
+
/* @__PURE__ */ b("div", {
|
|
146
143
|
className: "relative overflow-hidden flex items-center justify-between p-6 border-b border-border-seam",
|
|
147
144
|
children: [
|
|
148
|
-
/* @__PURE__ */
|
|
149
|
-
/* @__PURE__ */
|
|
145
|
+
/* @__PURE__ */ y(de, { intensity: "subtle" }),
|
|
146
|
+
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("h1", {
|
|
150
147
|
className: "text-2xl font-semibold text-text-primary",
|
|
151
|
-
children: /* @__PURE__ */
|
|
152
|
-
}), /* @__PURE__ */
|
|
148
|
+
children: /* @__PURE__ */ y(me, { children: w("subscribers.subscribers", "Subscribers") })
|
|
149
|
+
}), /* @__PURE__ */ b("p", {
|
|
153
150
|
className: "mt-1 text-sm text-text-secondary tabular-nums",
|
|
154
151
|
children: [
|
|
155
152
|
W,
|
|
156
153
|
" ",
|
|
157
|
-
|
|
154
|
+
w("subscribers.totalSubscribers", "total subscribers")
|
|
158
155
|
]
|
|
159
156
|
})] }),
|
|
160
|
-
/* @__PURE__ */
|
|
157
|
+
/* @__PURE__ */ b("div", {
|
|
161
158
|
className: "flex items-center gap-2",
|
|
162
|
-
children: [/* @__PURE__ */
|
|
159
|
+
children: [/* @__PURE__ */ y(x, {
|
|
163
160
|
type: "button",
|
|
164
161
|
variant: "outline",
|
|
165
162
|
size: "icon",
|
|
166
163
|
onClick: () => q(),
|
|
167
|
-
title:
|
|
168
|
-
"aria-label":
|
|
169
|
-
children: /* @__PURE__ */
|
|
164
|
+
title: w("newsletter.refresh", "Refresh"),
|
|
165
|
+
"aria-label": w("newsletter.refresh", "Refresh"),
|
|
166
|
+
children: /* @__PURE__ */ y(oe, {
|
|
170
167
|
size: 18,
|
|
171
168
|
className: G ? "animate-spin" : ""
|
|
172
169
|
})
|
|
173
|
-
}), /* @__PURE__ */
|
|
170
|
+
}), /* @__PURE__ */ y(fe, {
|
|
174
171
|
primary: ye ? {
|
|
175
|
-
label:
|
|
176
|
-
icon: /* @__PURE__ */
|
|
177
|
-
onSelect: () =>
|
|
172
|
+
label: w("subscribers.addSubscriber", "Add Subscriber"),
|
|
173
|
+
icon: /* @__PURE__ */ y(h, { size: 18 }),
|
|
174
|
+
onSelect: () => M(!0)
|
|
178
175
|
} : void 0,
|
|
179
176
|
actions: [...xe ? [{
|
|
180
|
-
label:
|
|
181
|
-
icon: /* @__PURE__ */
|
|
182
|
-
onSelect: () =>
|
|
177
|
+
label: w("subscribers.import", "Import"),
|
|
178
|
+
icon: /* @__PURE__ */ y(_, { size: 16 }),
|
|
179
|
+
onSelect: () => N(!0)
|
|
183
180
|
}] : [], ...Se ? [{
|
|
184
|
-
label:
|
|
185
|
-
icon: /* @__PURE__ */
|
|
186
|
-
onSelect: () =>
|
|
181
|
+
label: w("subscribers.export", "Export"),
|
|
182
|
+
icon: /* @__PURE__ */ y(ie, { size: 16 }),
|
|
183
|
+
onSelect: () => Le()
|
|
187
184
|
}] : []]
|
|
188
185
|
})]
|
|
189
186
|
})
|
|
190
187
|
]
|
|
191
188
|
}),
|
|
192
|
-
/* @__PURE__ */
|
|
189
|
+
/* @__PURE__ */ y("div", {
|
|
193
190
|
className: "px-6 pt-6",
|
|
194
|
-
children: /* @__PURE__ */
|
|
191
|
+
children: /* @__PURE__ */ y(he, { children: w("subscribers.pagePurpose", "Your audience lives here — every person who can receive a newsletter for this product. Add people one at a time, bulk-import a CSV, or export the list, and keep it healthy by tracking who is active, paused, or has unsubscribed. A clean, consented list is what keeps your emails landing in inboxes.") })
|
|
195
192
|
}),
|
|
196
|
-
/* @__PURE__ */
|
|
193
|
+
/* @__PURE__ */ y("div", {
|
|
197
194
|
className: "px-6 pt-6",
|
|
198
|
-
children: /* @__PURE__ */
|
|
195
|
+
children: /* @__PURE__ */ b(pe, {
|
|
199
196
|
className: "flex flex-wrap items-center gap-8 p-4",
|
|
200
197
|
children: [
|
|
201
|
-
/* @__PURE__ */
|
|
198
|
+
/* @__PURE__ */ b("div", {
|
|
202
199
|
className: "flex items-center gap-3",
|
|
203
|
-
children: [/* @__PURE__ */
|
|
200
|
+
children: [/* @__PURE__ */ y("div", {
|
|
204
201
|
className: "p-2 bg-action-primary-bg/10 rounded-lg",
|
|
205
|
-
children: /* @__PURE__ */
|
|
202
|
+
children: /* @__PURE__ */ y(ce, {
|
|
206
203
|
size: 20,
|
|
207
204
|
className: "text-primary"
|
|
208
205
|
})
|
|
209
|
-
}), /* @__PURE__ */
|
|
206
|
+
}), /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
210
207
|
className: "text-2xl font-bold text-text-primary tabular-nums",
|
|
211
208
|
children: W
|
|
212
|
-
}), /* @__PURE__ */
|
|
209
|
+
}), /* @__PURE__ */ y("p", {
|
|
213
210
|
className: "text-sm text-text-secondary",
|
|
214
|
-
children:
|
|
211
|
+
children: w("subscribers.totalSubscribers", "total subscribers")
|
|
215
212
|
})] })]
|
|
216
213
|
}),
|
|
217
|
-
/* @__PURE__ */
|
|
214
|
+
/* @__PURE__ */ b("div", {
|
|
218
215
|
className: "flex items-center gap-3",
|
|
219
|
-
children: [/* @__PURE__ */
|
|
216
|
+
children: [/* @__PURE__ */ y("div", {
|
|
220
217
|
className: "p-2 bg-status-success-bg-subtle rounded-lg",
|
|
221
|
-
children: /* @__PURE__ */
|
|
218
|
+
children: /* @__PURE__ */ y(p, {
|
|
222
219
|
size: 20,
|
|
223
220
|
className: "text-status-success-text"
|
|
224
221
|
})
|
|
225
|
-
}), /* @__PURE__ */
|
|
222
|
+
}), /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
226
223
|
className: "text-2xl font-bold text-text-primary tabular-nums",
|
|
227
|
-
children:
|
|
228
|
-
}), /* @__PURE__ */
|
|
224
|
+
children: Ne
|
|
225
|
+
}), /* @__PURE__ */ y("p", {
|
|
229
226
|
className: "text-sm text-text-secondary",
|
|
230
|
-
children:
|
|
227
|
+
children: w("subscribers.active", "Active")
|
|
231
228
|
})] })]
|
|
232
229
|
}),
|
|
233
|
-
/* @__PURE__ */
|
|
230
|
+
/* @__PURE__ */ b("div", {
|
|
234
231
|
className: "flex items-center gap-3",
|
|
235
|
-
children: [/* @__PURE__ */
|
|
232
|
+
children: [/* @__PURE__ */ y("div", {
|
|
236
233
|
className: "p-2 bg-bg-sunken rounded-lg",
|
|
237
|
-
children: /* @__PURE__ */
|
|
234
|
+
children: /* @__PURE__ */ y(m, {
|
|
238
235
|
size: 20,
|
|
239
236
|
className: "text-text-secondary"
|
|
240
237
|
})
|
|
241
|
-
}), /* @__PURE__ */
|
|
238
|
+
}), /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
242
239
|
className: "text-2xl font-bold text-text-primary tabular-nums",
|
|
243
|
-
children:
|
|
244
|
-
}), /* @__PURE__ */
|
|
240
|
+
children: Pe
|
|
241
|
+
}), /* @__PURE__ */ y("p", {
|
|
245
242
|
className: "text-sm text-text-secondary",
|
|
246
|
-
children:
|
|
243
|
+
children: w("subscribers.unsubscribed", "Unsubscribed")
|
|
247
244
|
})] })]
|
|
248
245
|
})
|
|
249
246
|
]
|
|
250
247
|
})
|
|
251
248
|
}),
|
|
252
|
-
/* @__PURE__ */
|
|
249
|
+
/* @__PURE__ */ b("div", {
|
|
253
250
|
className: "flex items-center gap-4 p-6 border-b border-border-seam",
|
|
254
251
|
children: [
|
|
255
|
-
/* @__PURE__ */
|
|
252
|
+
/* @__PURE__ */ b("div", {
|
|
256
253
|
className: "flex-1 relative",
|
|
257
|
-
children: [/* @__PURE__ */
|
|
254
|
+
children: [/* @__PURE__ */ y(se, {
|
|
258
255
|
className: "absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary",
|
|
259
256
|
size: 20
|
|
260
|
-
}), /* @__PURE__ */
|
|
257
|
+
}), /* @__PURE__ */ y("input", {
|
|
261
258
|
type: "text",
|
|
262
|
-
"aria-label":
|
|
263
|
-
placeholder:
|
|
264
|
-
value:
|
|
265
|
-
onChange: (e) =>
|
|
259
|
+
"aria-label": w("subscribers.searchByEmail", "Search by email..."),
|
|
260
|
+
placeholder: w("subscribers.searchByEmail", "Search by email..."),
|
|
261
|
+
value: k.search,
|
|
262
|
+
onChange: (e) => Fe(e.target.value),
|
|
266
263
|
className: "w-full pl-10 pr-4 py-2 border border-border-subtle rounded-lg focus:ring-2 focus:ring-primary/50 focus:border-transparent"
|
|
267
264
|
})]
|
|
268
265
|
}),
|
|
269
|
-
/* @__PURE__ */
|
|
270
|
-
value:
|
|
271
|
-
onChange: (e) =>
|
|
266
|
+
/* @__PURE__ */ b("select", {
|
|
267
|
+
value: k.status,
|
|
268
|
+
onChange: (e) => Ie(e.target.value),
|
|
272
269
|
className: "px-4 py-2 border border-border-subtle rounded-lg focus:ring-2 focus:ring-primary/50 focus:border-transparent",
|
|
273
270
|
children: [
|
|
274
|
-
/* @__PURE__ */
|
|
271
|
+
/* @__PURE__ */ y("option", {
|
|
275
272
|
value: "ALL",
|
|
276
|
-
children:
|
|
273
|
+
children: w("newsletterCommon.allStatuses", "All Statuses")
|
|
277
274
|
}),
|
|
278
|
-
/* @__PURE__ */
|
|
275
|
+
/* @__PURE__ */ y("option", {
|
|
279
276
|
value: "ACTIVE",
|
|
280
|
-
children:
|
|
277
|
+
children: w("subscribers.active", "Active")
|
|
281
278
|
}),
|
|
282
|
-
/* @__PURE__ */
|
|
279
|
+
/* @__PURE__ */ y("option", {
|
|
283
280
|
value: "PAUSED",
|
|
284
|
-
children:
|
|
281
|
+
children: w("subscribers.paused", "Paused")
|
|
285
282
|
}),
|
|
286
|
-
/* @__PURE__ */
|
|
283
|
+
/* @__PURE__ */ y("option", {
|
|
287
284
|
value: "UNSUBSCRIBED",
|
|
288
|
-
children:
|
|
285
|
+
children: w("subscribers.unsubscribedStatus", "Unsubscribed")
|
|
289
286
|
})
|
|
290
287
|
]
|
|
291
288
|
}),
|
|
292
|
-
/* @__PURE__ */
|
|
289
|
+
/* @__PURE__ */ b("div", {
|
|
293
290
|
className: "rounded-lg border border-border-subtle bg-bg-sunken px-4 py-2 text-sm text-text-secondary",
|
|
294
291
|
children: [
|
|
295
|
-
|
|
292
|
+
w("newsletter.product", "Product"),
|
|
296
293
|
":",
|
|
297
294
|
" ",
|
|
298
|
-
|
|
295
|
+
C(T, w("newsletter.notAvailable", "N/A"), X)
|
|
299
296
|
]
|
|
300
297
|
}),
|
|
301
|
-
/* @__PURE__ */
|
|
298
|
+
/* @__PURE__ */ b("button", {
|
|
302
299
|
type: "button",
|
|
303
300
|
className: "flex items-center gap-2 px-4 py-2 border border-border-subtle rounded-lg hover:bg-accent transition-colors",
|
|
304
|
-
children: [/* @__PURE__ */
|
|
301
|
+
children: [/* @__PURE__ */ y(ae, { size: 20 }), w("newsletter.moreFilters", "More Filters")]
|
|
305
302
|
})
|
|
306
303
|
]
|
|
307
304
|
}),
|
|
308
|
-
/* @__PURE__ */
|
|
305
|
+
/* @__PURE__ */ y("div", {
|
|
309
306
|
className: "flex-1 overflow-auto",
|
|
310
|
-
children: K ? /* @__PURE__ */
|
|
307
|
+
children: K ? /* @__PURE__ */ y("div", {
|
|
311
308
|
className: "flex items-center justify-center h-full p-6",
|
|
312
|
-
children: /* @__PURE__ */
|
|
309
|
+
children: /* @__PURE__ */ y(S, {
|
|
313
310
|
illustration: "empty-generic",
|
|
314
|
-
title:
|
|
311
|
+
title: w("subscribers.failedLoadSubscribers", "Failed to load subscribers"),
|
|
315
312
|
description: K.message,
|
|
316
|
-
action: /* @__PURE__ */
|
|
313
|
+
action: /* @__PURE__ */ y(x, {
|
|
317
314
|
type: "button",
|
|
318
315
|
onClick: () => q(),
|
|
319
|
-
children:
|
|
316
|
+
children: w("newsletterCommon.tryAgain", "Try Again")
|
|
320
317
|
})
|
|
321
318
|
})
|
|
322
|
-
}) : G && U.length === 0 ? /* @__PURE__ */
|
|
319
|
+
}) : G && U.length === 0 ? /* @__PURE__ */ y("div", {
|
|
323
320
|
className: "flex items-center justify-center h-full",
|
|
324
|
-
children: /* @__PURE__ */
|
|
321
|
+
children: /* @__PURE__ */ b("div", {
|
|
325
322
|
className: "flex items-center gap-2 text-text-secondary",
|
|
326
|
-
children: [/* @__PURE__ */
|
|
323
|
+
children: [/* @__PURE__ */ y(f, {
|
|
327
324
|
className: "animate-spin",
|
|
328
325
|
size: 24
|
|
329
|
-
}), /* @__PURE__ */
|
|
326
|
+
}), /* @__PURE__ */ y("span", { children: w("subscribers.loadingSubscribers", "Loading subscribers...") })]
|
|
330
327
|
})
|
|
331
|
-
}) : Z.length === 0 ? /* @__PURE__ */
|
|
328
|
+
}) : Z.length === 0 ? /* @__PURE__ */ y("div", {
|
|
332
329
|
className: "flex items-center justify-center h-full p-6",
|
|
333
|
-
children: /* @__PURE__ */
|
|
334
|
-
illustration:
|
|
335
|
-
title:
|
|
336
|
-
description:
|
|
337
|
-
action:
|
|
330
|
+
children: /* @__PURE__ */ y(S, {
|
|
331
|
+
illustration: k.search ? "empty-search" : "empty-people",
|
|
332
|
+
title: k.search ? w("subscribers.noSubscribersFound", "No subscribers found") : w("subscribers.noSubscribersYet", "No subscribers yet"),
|
|
333
|
+
description: k.search ? w("newsletterCommon.tryDifferentSearch", "Try a different search term") : w("subscribers.noSubscribersDescription", "Start building your subscriber list by adding subscribers manually or importing them from a CSV file."),
|
|
334
|
+
action: k.search ? void 0 : /* @__PURE__ */ b("div", {
|
|
338
335
|
className: "flex items-center gap-2",
|
|
339
|
-
children: [/* @__PURE__ */
|
|
336
|
+
children: [/* @__PURE__ */ y(x, {
|
|
340
337
|
type: "button",
|
|
341
338
|
variant: "outline",
|
|
342
|
-
onClick: () => P(!0),
|
|
343
|
-
children: T("subscribers.importFromCsv", "Import from CSV")
|
|
344
|
-
}), /* @__PURE__ */ b(S, {
|
|
345
|
-
type: "button",
|
|
346
339
|
onClick: () => N(!0),
|
|
347
|
-
children:
|
|
340
|
+
children: w("subscribers.importFromCsv", "Import from CSV")
|
|
341
|
+
}), /* @__PURE__ */ y(x, {
|
|
342
|
+
type: "button",
|
|
343
|
+
onClick: () => M(!0),
|
|
344
|
+
children: w("subscribers.addManually", "Add Manually")
|
|
348
345
|
})]
|
|
349
346
|
})
|
|
350
347
|
})
|
|
351
|
-
}) : /* @__PURE__ */
|
|
348
|
+
}) : /* @__PURE__ */ b("table", {
|
|
352
349
|
className: "w-full",
|
|
353
|
-
children: [/* @__PURE__ */
|
|
350
|
+
children: [/* @__PURE__ */ y("thead", {
|
|
354
351
|
className: "bg-bg-sunken border-b border-border-seam sticky top-0",
|
|
355
|
-
children: /* @__PURE__ */
|
|
356
|
-
/* @__PURE__ */
|
|
352
|
+
children: /* @__PURE__ */ b("tr", { children: [
|
|
353
|
+
/* @__PURE__ */ y("th", {
|
|
357
354
|
className: "px-6 py-3 text-left text-xs font-medium text-text-secondary uppercase tracking-wider",
|
|
358
|
-
children: /* @__PURE__ */
|
|
355
|
+
children: /* @__PURE__ */ y("input", {
|
|
359
356
|
type: "checkbox",
|
|
360
|
-
"aria-label":
|
|
361
|
-
checked:
|
|
362
|
-
onChange:
|
|
357
|
+
"aria-label": w("subscribers.selectAll", "Select all subscribers"),
|
|
358
|
+
checked: R.size === Z.length,
|
|
359
|
+
onChange: Ue,
|
|
363
360
|
className: "rounded"
|
|
364
361
|
})
|
|
365
362
|
}),
|
|
366
|
-
/* @__PURE__ */
|
|
363
|
+
/* @__PURE__ */ y("th", {
|
|
367
364
|
className: "px-6 py-3 text-left text-xs font-medium text-text-secondary uppercase tracking-wider",
|
|
368
|
-
children:
|
|
365
|
+
children: w("newsletter.email", "Email")
|
|
369
366
|
}),
|
|
370
|
-
/* @__PURE__ */
|
|
367
|
+
/* @__PURE__ */ y("th", {
|
|
371
368
|
className: "px-6 py-3 text-left text-xs font-medium text-text-secondary uppercase tracking-wider",
|
|
372
|
-
children:
|
|
369
|
+
children: w("subscribers.product", "Product")
|
|
373
370
|
}),
|
|
374
|
-
/* @__PURE__ */
|
|
371
|
+
/* @__PURE__ */ y("th", {
|
|
375
372
|
className: "px-6 py-3 text-left text-xs font-medium text-text-secondary uppercase tracking-wider",
|
|
376
|
-
children:
|
|
373
|
+
children: w("newsletterCommon.status", "Status")
|
|
377
374
|
}),
|
|
378
|
-
/* @__PURE__ */
|
|
375
|
+
/* @__PURE__ */ y("th", {
|
|
379
376
|
className: "px-6 py-3 text-left text-xs font-medium text-text-secondary uppercase tracking-wider",
|
|
380
|
-
children:
|
|
377
|
+
children: w("subscribers.subscribed", "Subscribed")
|
|
381
378
|
}),
|
|
382
|
-
/* @__PURE__ */
|
|
379
|
+
/* @__PURE__ */ y("th", {
|
|
383
380
|
className: "px-6 py-3 text-left text-xs font-medium text-text-secondary uppercase tracking-wider",
|
|
384
|
-
children:
|
|
381
|
+
children: w("newsletter.actions", "Actions")
|
|
385
382
|
})
|
|
386
383
|
] })
|
|
387
|
-
}), /* @__PURE__ */
|
|
384
|
+
}), /* @__PURE__ */ y("tbody", {
|
|
388
385
|
className: "bg-bg-surface divide-y divide-border",
|
|
389
|
-
children: Z.map((e) => /* @__PURE__ */
|
|
386
|
+
children: Z.map((e) => /* @__PURE__ */ y(ge, {
|
|
390
387
|
subscriber: e,
|
|
391
|
-
selected:
|
|
392
|
-
onSelect: () =>
|
|
393
|
-
onView: () =>
|
|
394
|
-
onUnsubscribe: () =>
|
|
395
|
-
onResubscribe: () =>
|
|
396
|
-
onDelete: be ? () =>
|
|
397
|
-
formatDate:
|
|
398
|
-
emptyProductLabel:
|
|
388
|
+
selected: R.has(e.id),
|
|
389
|
+
onSelect: () => We(e.id),
|
|
390
|
+
onView: () => Ge(e.id),
|
|
391
|
+
onUnsubscribe: () => Be(e.email),
|
|
392
|
+
onResubscribe: () => Ve(e.email),
|
|
393
|
+
onDelete: be ? () => He(e.id, e.email) : void 0,
|
|
394
|
+
formatDate: Ke,
|
|
395
|
+
emptyProductLabel: w("newsletterCommon.notAvailable", "N/A"),
|
|
399
396
|
products: X,
|
|
400
|
-
isDeleting:
|
|
401
|
-
isUnsubscribing:
|
|
397
|
+
isDeleting: je,
|
|
398
|
+
isUnsubscribing: Ae
|
|
402
399
|
}, e.id))
|
|
403
400
|
})]
|
|
404
401
|
})
|
|
405
402
|
}),
|
|
406
|
-
Ce && /* @__PURE__ */
|
|
403
|
+
Ce && /* @__PURE__ */ y("div", {
|
|
407
404
|
className: "fixed inset-0 bg-black/50 flex items-center justify-center z-50",
|
|
408
|
-
children: /* @__PURE__ */
|
|
405
|
+
children: /* @__PURE__ */ b("div", {
|
|
409
406
|
className: "bg-bg-surface rounded-lg shadow-xl w-full max-w-md p-6",
|
|
410
407
|
children: [
|
|
411
|
-
/* @__PURE__ */
|
|
408
|
+
/* @__PURE__ */ b("div", {
|
|
412
409
|
className: "flex items-center justify-between mb-4",
|
|
413
|
-
children: [/* @__PURE__ */
|
|
410
|
+
children: [/* @__PURE__ */ y("h2", {
|
|
414
411
|
className: "text-lg font-semibold text-text-primary",
|
|
415
|
-
children:
|
|
416
|
-
}), /* @__PURE__ */
|
|
412
|
+
children: w("subscribers.addSubscriber", "Add Subscriber")
|
|
413
|
+
}), /* @__PURE__ */ y("button", {
|
|
417
414
|
type: "button",
|
|
418
|
-
onClick: () =>
|
|
415
|
+
onClick: () => M(!1),
|
|
419
416
|
className: "p-1 hover:bg-accent rounded",
|
|
420
|
-
children: /* @__PURE__ */
|
|
417
|
+
children: /* @__PURE__ */ y(v, { size: 20 })
|
|
421
418
|
})]
|
|
422
419
|
}),
|
|
423
|
-
/* @__PURE__ */
|
|
420
|
+
/* @__PURE__ */ b("div", {
|
|
424
421
|
className: "mb-4",
|
|
425
|
-
children: [/* @__PURE__ */
|
|
422
|
+
children: [/* @__PURE__ */ y("label", {
|
|
426
423
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
427
|
-
children:
|
|
428
|
-
}), /* @__PURE__ */
|
|
424
|
+
children: w("subscribers.emailAddress", "Email Address")
|
|
425
|
+
}), /* @__PURE__ */ y("input", {
|
|
429
426
|
type: "email",
|
|
430
|
-
"aria-label":
|
|
431
|
-
value:
|
|
432
|
-
onChange: (e) =>
|
|
433
|
-
placeholder:
|
|
427
|
+
"aria-label": w("subscribers.emailAddress", "Email address"),
|
|
428
|
+
value: P,
|
|
429
|
+
onChange: (e) => F(e.target.value),
|
|
430
|
+
placeholder: w("subscribers.emailPlaceholder", "subscriber@example.com"),
|
|
434
431
|
className: "w-full px-3 py-2 border border-border-subtle rounded-lg focus:ring-2 focus:ring-primary/50 focus:border-transparent",
|
|
435
432
|
onKeyDown: (e) => e.key === "Enter" && $()
|
|
436
433
|
})]
|
|
437
434
|
}),
|
|
438
|
-
/* @__PURE__ */
|
|
435
|
+
/* @__PURE__ */ b("div", {
|
|
439
436
|
className: "flex justify-end gap-2",
|
|
440
|
-
children: [/* @__PURE__ */
|
|
437
|
+
children: [/* @__PURE__ */ y("button", {
|
|
441
438
|
type: "button",
|
|
442
|
-
onClick: () =>
|
|
439
|
+
onClick: () => M(!1),
|
|
443
440
|
className: "px-4 py-2 border border-border-subtle rounded-lg hover:bg-accent transition-colors",
|
|
444
|
-
children:
|
|
445
|
-
}), /* @__PURE__ */
|
|
441
|
+
children: w("newsletterCommon.cancel", "Cancel")
|
|
442
|
+
}), /* @__PURE__ */ b("button", {
|
|
446
443
|
type: "button",
|
|
447
444
|
onClick: $,
|
|
448
445
|
disabled: J,
|
|
449
446
|
className: "flex items-center gap-2 px-4 py-2 bg-action-primary-bg text-action-primary-text rounded-lg hover:bg-action-primary-bg/90 transition-colors disabled:opacity-50",
|
|
450
|
-
children: [J ? /* @__PURE__ */
|
|
447
|
+
children: [J ? /* @__PURE__ */ y(f, {
|
|
451
448
|
size: 16,
|
|
452
449
|
className: "animate-spin"
|
|
453
|
-
}) : /* @__PURE__ */
|
|
450
|
+
}) : /* @__PURE__ */ y(h, { size: 16 }), w("subscribers.addSubscriber", "Add Subscriber")]
|
|
454
451
|
})]
|
|
455
452
|
})
|
|
456
453
|
]
|
|
457
454
|
})
|
|
458
455
|
}),
|
|
459
|
-
we && /* @__PURE__ */
|
|
456
|
+
we && /* @__PURE__ */ y("div", {
|
|
460
457
|
className: "fixed inset-0 bg-black/50 flex items-center justify-center z-50",
|
|
461
|
-
children: /* @__PURE__ */
|
|
458
|
+
children: /* @__PURE__ */ b("div", {
|
|
462
459
|
className: "bg-bg-surface rounded-lg shadow-xl w-full max-w-lg p-6",
|
|
463
460
|
children: [
|
|
464
|
-
/* @__PURE__ */
|
|
461
|
+
/* @__PURE__ */ b("div", {
|
|
465
462
|
className: "flex items-center justify-between mb-4",
|
|
466
|
-
children: [/* @__PURE__ */
|
|
463
|
+
children: [/* @__PURE__ */ y("h2", {
|
|
467
464
|
className: "text-lg font-semibold text-text-primary",
|
|
468
|
-
children:
|
|
469
|
-
}), /* @__PURE__ */
|
|
465
|
+
children: w("subscribers.importSubscribers", "Import Subscribers")
|
|
466
|
+
}), /* @__PURE__ */ y("button", {
|
|
470
467
|
type: "button",
|
|
471
|
-
onClick: () =>
|
|
468
|
+
onClick: () => N(!1),
|
|
472
469
|
className: "p-1 hover:bg-accent rounded",
|
|
473
|
-
children: /* @__PURE__ */
|
|
470
|
+
children: /* @__PURE__ */ y(v, { size: 20 })
|
|
474
471
|
})]
|
|
475
472
|
}),
|
|
476
|
-
/* @__PURE__ */
|
|
473
|
+
/* @__PURE__ */ b("div", {
|
|
477
474
|
className: "mb-4",
|
|
478
475
|
children: [
|
|
479
|
-
/* @__PURE__ */
|
|
476
|
+
/* @__PURE__ */ b("div", {
|
|
480
477
|
className: "flex items-center justify-between mb-2",
|
|
481
478
|
children: [
|
|
482
|
-
/* @__PURE__ */
|
|
479
|
+
/* @__PURE__ */ y("label", {
|
|
483
480
|
className: "block text-sm font-medium text-text-primary",
|
|
484
|
-
children:
|
|
481
|
+
children: w("subscribers.emailAddresses", "Email Addresses")
|
|
485
482
|
}),
|
|
486
|
-
/* @__PURE__ */
|
|
483
|
+
/* @__PURE__ */ y("button", {
|
|
487
484
|
type: "button",
|
|
488
|
-
onClick: () =>
|
|
485
|
+
onClick: () => H.current?.click(),
|
|
489
486
|
className: "text-sm text-primary hover:text-primary/80",
|
|
490
|
-
children:
|
|
487
|
+
children: w("subscribers.uploadCsv", "Upload CSV")
|
|
491
488
|
}),
|
|
492
|
-
/* @__PURE__ */
|
|
493
|
-
ref:
|
|
489
|
+
/* @__PURE__ */ y("input", {
|
|
490
|
+
ref: H,
|
|
494
491
|
type: "file",
|
|
495
|
-
"aria-label":
|
|
492
|
+
"aria-label": w("subscribers.uploadCsvFile", "Upload CSV file"),
|
|
496
493
|
accept: ".csv,.txt",
|
|
497
|
-
onChange:
|
|
494
|
+
onChange: ze,
|
|
498
495
|
className: "hidden"
|
|
499
496
|
})
|
|
500
497
|
]
|
|
501
498
|
}),
|
|
502
|
-
/* @__PURE__ */
|
|
503
|
-
"aria-label":
|
|
504
|
-
value:
|
|
505
|
-
onChange: (e) =>
|
|
506
|
-
placeholder:
|
|
499
|
+
/* @__PURE__ */ y("textarea", {
|
|
500
|
+
"aria-label": w("subscribers.csvData", "CSV data"),
|
|
501
|
+
value: I,
|
|
502
|
+
onChange: (e) => L(e.target.value),
|
|
503
|
+
placeholder: w("subscribers.csvPlaceholder", "Enter email addresses (one per line or comma-separated)\n\nemail1@example.com\nemail2@example.com\nemail3@example.com"),
|
|
507
504
|
rows: 8,
|
|
508
505
|
className: "w-full px-3 py-2 border border-border-subtle rounded-lg focus:ring-2 focus:ring-primary/50 focus:border-transparent font-mono text-sm"
|
|
509
506
|
}),
|
|
510
|
-
/* @__PURE__ */
|
|
507
|
+
/* @__PURE__ */ y("p", {
|
|
511
508
|
className: "mt-1 text-xs text-text-secondary",
|
|
512
|
-
children:
|
|
509
|
+
children: w("subscribers.supportedFormats", "Supported formats: one email per line, comma-separated, or CSV file")
|
|
513
510
|
})
|
|
514
511
|
]
|
|
515
512
|
}),
|
|
516
|
-
/* @__PURE__ */
|
|
513
|
+
/* @__PURE__ */ b("div", {
|
|
517
514
|
className: "flex justify-end gap-2",
|
|
518
|
-
children: [/* @__PURE__ */
|
|
515
|
+
children: [/* @__PURE__ */ y("button", {
|
|
519
516
|
type: "button",
|
|
520
|
-
onClick: () =>
|
|
517
|
+
onClick: () => N(!1),
|
|
521
518
|
className: "px-4 py-2 border border-border-subtle rounded-lg hover:bg-accent transition-colors",
|
|
522
|
-
children:
|
|
523
|
-
}), /* @__PURE__ */
|
|
519
|
+
children: w("newsletterCommon.cancel", "Cancel")
|
|
520
|
+
}), /* @__PURE__ */ b("button", {
|
|
524
521
|
type: "button",
|
|
525
|
-
onClick:
|
|
522
|
+
onClick: Re,
|
|
526
523
|
disabled: Y,
|
|
527
524
|
className: "flex items-center gap-2 px-4 py-2 bg-action-primary-bg text-action-primary-text rounded-lg hover:bg-action-primary-bg/90 transition-colors disabled:opacity-50",
|
|
528
|
-
children: [Y ? /* @__PURE__ */
|
|
525
|
+
children: [Y ? /* @__PURE__ */ y(f, {
|
|
529
526
|
size: 16,
|
|
530
527
|
className: "animate-spin"
|
|
531
|
-
}) : /* @__PURE__ */
|
|
528
|
+
}) : /* @__PURE__ */ y(_, { size: 16 }), w("subscribers.import", "Import")]
|
|
532
529
|
})]
|
|
533
530
|
})
|
|
534
531
|
]
|
|
@@ -537,14 +534,14 @@ function T() {
|
|
|
537
534
|
]
|
|
538
535
|
});
|
|
539
536
|
}
|
|
540
|
-
function ge({ subscriber: e, selected: t, onSelect: n, onView: r, onUnsubscribe: i, onResubscribe:
|
|
541
|
-
let d =
|
|
542
|
-
return /* @__PURE__ */
|
|
537
|
+
function ge({ subscriber: e, selected: t, onSelect: n, onView: r, onUnsubscribe: i, onResubscribe: o, onDelete: s, formatDate: c, emptyProductLabel: l, products: u }) {
|
|
538
|
+
let d = a();
|
|
539
|
+
return /* @__PURE__ */ b("tr", {
|
|
543
540
|
className: "hover:bg-accent",
|
|
544
541
|
children: [
|
|
545
|
-
/* @__PURE__ */
|
|
542
|
+
/* @__PURE__ */ y("td", {
|
|
546
543
|
className: "px-6 py-4",
|
|
547
|
-
children: /* @__PURE__ */
|
|
544
|
+
children: /* @__PURE__ */ y("input", {
|
|
548
545
|
type: "checkbox",
|
|
549
546
|
"aria-label": `Select ${e.email}`,
|
|
550
547
|
checked: t,
|
|
@@ -552,62 +549,62 @@ function ge({ subscriber: e, selected: t, onSelect: n, onView: r, onUnsubscribe:
|
|
|
552
549
|
className: "rounded"
|
|
553
550
|
})
|
|
554
551
|
}),
|
|
555
|
-
/* @__PURE__ */
|
|
552
|
+
/* @__PURE__ */ y("td", {
|
|
556
553
|
className: "px-6 py-4",
|
|
557
|
-
children: /* @__PURE__ */
|
|
554
|
+
children: /* @__PURE__ */ y("button", {
|
|
558
555
|
type: "button",
|
|
559
556
|
onClick: r,
|
|
560
557
|
className: "text-text-primary hover:text-primary font-medium",
|
|
561
558
|
children: e.email
|
|
562
559
|
})
|
|
563
560
|
}),
|
|
564
|
-
/* @__PURE__ */
|
|
561
|
+
/* @__PURE__ */ y("td", {
|
|
565
562
|
className: "px-6 py-4 text-sm text-text-secondary",
|
|
566
|
-
children:
|
|
563
|
+
children: C(e.platformProductId, l, u)
|
|
567
564
|
}),
|
|
568
|
-
/* @__PURE__ */
|
|
565
|
+
/* @__PURE__ */ y("td", {
|
|
569
566
|
className: "px-6 py-4",
|
|
570
|
-
children: ((e, t) => !t || e === "UNSUBSCRIBED" ? /* @__PURE__ */
|
|
567
|
+
children: ((e, t) => !t || e === "UNSUBSCRIBED" ? /* @__PURE__ */ b("span", {
|
|
571
568
|
className: "inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium bg-bg-sunken text-text-secondary",
|
|
572
|
-
children: [/* @__PURE__ */
|
|
573
|
-
}) : e === "PAUSED" ? /* @__PURE__ */
|
|
569
|
+
children: [/* @__PURE__ */ y(m, { size: 12 }), d("subscribers.unsubscribed", "Unsubscribed")]
|
|
570
|
+
}) : e === "PAUSED" ? /* @__PURE__ */ y("span", {
|
|
574
571
|
className: "inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium bg-status-warning-bg-subtle text-status-warning-text",
|
|
575
572
|
children: d("subscribers.paused", "Paused")
|
|
576
|
-
}) : /* @__PURE__ */
|
|
573
|
+
}) : /* @__PURE__ */ b("span", {
|
|
577
574
|
className: "inline-flex items-center gap-1.5 px-2 py-1 rounded-full text-xs font-medium bg-status-success-bg-subtle text-status-success-text",
|
|
578
575
|
children: [
|
|
579
|
-
/* @__PURE__ */
|
|
580
|
-
/* @__PURE__ */
|
|
576
|
+
/* @__PURE__ */ y("span", { className: "size-1.5 rounded-full bg-status-success-text motion-safe:animate-vc-glow-pulse" }),
|
|
577
|
+
/* @__PURE__ */ y(p, { size: 12 }),
|
|
581
578
|
d("subscribers.active", "Active")
|
|
582
579
|
]
|
|
583
580
|
}))(e.status, e.subscribed)
|
|
584
581
|
}),
|
|
585
|
-
/* @__PURE__ */
|
|
582
|
+
/* @__PURE__ */ y("td", {
|
|
586
583
|
className: "px-6 py-4 text-sm text-text-secondary",
|
|
587
584
|
children: c(e.subscribedAt)
|
|
588
585
|
}),
|
|
589
|
-
/* @__PURE__ */
|
|
586
|
+
/* @__PURE__ */ y("td", {
|
|
590
587
|
className: "px-6 py-4",
|
|
591
|
-
children: /* @__PURE__ */
|
|
588
|
+
children: /* @__PURE__ */ b("div", {
|
|
592
589
|
className: "flex items-center gap-2",
|
|
593
|
-
children: [e.subscribed ? /* @__PURE__ */
|
|
590
|
+
children: [e.subscribed ? /* @__PURE__ */ y("button", {
|
|
594
591
|
type: "button",
|
|
595
592
|
onClick: i,
|
|
596
593
|
className: "text-xs text-status-warning-text hover:opacity-80",
|
|
597
594
|
title: d("subscribers.unsubscribe", "Unsubscribe"),
|
|
598
595
|
children: d("subscribers.unsubscribe", "Unsubscribe")
|
|
599
|
-
}) : /* @__PURE__ */
|
|
596
|
+
}) : /* @__PURE__ */ y("button", {
|
|
600
597
|
type: "button",
|
|
601
|
-
onClick:
|
|
598
|
+
onClick: o,
|
|
602
599
|
className: "text-xs text-status-success-text hover:opacity-80",
|
|
603
600
|
title: d("subscribers.resubscribe", "Resubscribe"),
|
|
604
601
|
children: d("subscribers.resubscribe", "Resubscribe")
|
|
605
|
-
}),
|
|
602
|
+
}), s && /* @__PURE__ */ y("button", {
|
|
606
603
|
type: "button",
|
|
607
|
-
onClick:
|
|
604
|
+
onClick: s,
|
|
608
605
|
className: "p-1 text-status-error-text hover:text-status-error-text/80 hover:bg-status-error-bg/10 rounded",
|
|
609
606
|
title: d("newsletter.delete", "Delete"),
|
|
610
|
-
children: /* @__PURE__ */
|
|
607
|
+
children: /* @__PURE__ */ y(g, { size: 14 })
|
|
611
608
|
})]
|
|
612
609
|
})
|
|
613
610
|
})
|
|
@@ -615,6 +612,6 @@ function ge({ subscriber: e, selected: t, onSelect: n, onView: r, onUnsubscribe:
|
|
|
615
612
|
});
|
|
616
613
|
}
|
|
617
614
|
//#endregion
|
|
618
|
-
export {
|
|
615
|
+
export { w as SubscribersListPage };
|
|
619
616
|
|
|
620
617
|
//# sourceMappingURL=SubscribersListPage.js.map
|