@burdenoff/microfe-headshotmarketing 2026.1029.6 → 2026.1030.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.
Files changed (36) hide show
  1. package/dist/generated/wspace-operations.d.ts +2 -0
  2. package/dist/generated/wspace-operations.d.ts.map +1 -1
  3. package/dist/generated/wspace-operations.js +2 -0
  4. package/dist/generated/wspace-operations.js.map +1 -1
  5. package/dist/headshotmarketing/pages/ads/AdCampaignsPage.d.ts.map +1 -1
  6. package/dist/headshotmarketing/pages/ads/AdCampaignsPage.js +474 -386
  7. package/dist/headshotmarketing/pages/ads/AdCampaignsPage.js.map +1 -1
  8. package/dist/headshotmarketing/pages/ads/AdPlatformConnectionsSection.d.ts.map +1 -1
  9. package/dist/headshotmarketing/pages/ads/AdPlatformConnectionsSection.js +94 -94
  10. package/dist/headshotmarketing/pages/ads/AdPlatformConnectionsSection.js.map +1 -1
  11. package/dist/headshotmarketing/pages/ads/AudiencesPage.d.ts.map +1 -1
  12. package/dist/headshotmarketing/pages/ads/AudiencesPage.js +448 -339
  13. package/dist/headshotmarketing/pages/ads/AudiencesPage.js.map +1 -1
  14. package/dist/headshotmarketing/pages/ads/CreateAdCampaignPage.d.ts +7 -0
  15. package/dist/headshotmarketing/pages/ads/CreateAdCampaignPage.d.ts.map +1 -1
  16. package/dist/headshotmarketing/pages/ads/CreateAdCampaignPage.js +463 -446
  17. package/dist/headshotmarketing/pages/ads/CreateAdCampaignPage.js.map +1 -1
  18. package/dist/headshotmarketing/pages/ads/adCampaignStepper.d.ts +53 -0
  19. package/dist/headshotmarketing/pages/ads/adCampaignStepper.d.ts.map +1 -0
  20. package/dist/headshotmarketing/pages/ads/adCampaignStepper.js +151 -0
  21. package/dist/headshotmarketing/pages/ads/adCampaignStepper.js.map +1 -0
  22. package/dist/headshotmarketing/pages/ads/audienceDetails.d.ts +31 -0
  23. package/dist/headshotmarketing/pages/ads/audienceDetails.d.ts.map +1 -0
  24. package/dist/headshotmarketing/pages/ads/audienceDetails.js +64 -0
  25. package/dist/headshotmarketing/pages/ads/audienceDetails.js.map +1 -0
  26. package/dist/headshotmarketing/types/index.d.ts +14 -1
  27. package/dist/headshotmarketing/types/index.d.ts.map +1 -1
  28. package/dist/headshotmarketing/utils/adsMapper.d.ts +6 -1
  29. package/dist/headshotmarketing/utils/adsMapper.d.ts.map +1 -1
  30. package/dist/headshotmarketing/utils/adsMapper.js +27 -11
  31. package/dist/headshotmarketing/utils/adsMapper.js.map +1 -1
  32. package/dist/utils/pageContext.d.ts +60 -15
  33. package/dist/utils/pageContext.d.ts.map +1 -1
  34. package/dist/utils/pageContext.js +77 -57
  35. package/dist/utils/pageContext.js.map +1 -1
  36. package/package.json +1 -1
@@ -1,38 +1,45 @@
1
1
  import { useCreateHeadshotmarketingAudienceMutation as e, useDeleteHeadshotmarketingAudienceMutation as t, useHeadshotmarketingAudiencesListQuery as n, useUpdateHeadshotmarketingAudienceMutation as r } from "../../../generated/wspace-operations.js";
2
2
  import { useHeadshotMarketing as i } from "../../context/HeadshotMarketingContext.js";
3
- import { cn as a, formatNumber as o, formatPercentage as s } from "../../utils/helpers.js";
4
- import { toAudienceModel as c } from "../../utils/adsMapper.js";
5
- import { PageLayout as l } from "../../components/PageLayout.js";
6
- import { StatusBadge as u } from "../../components/StatusBadge.js";
7
- import { EmptyState as ee } from "../../components/EmptyState.js";
8
- import { Modal as d } from "../../components/Modal.js";
9
- import { QueryStateBoundary as te } from "../../components/QueryStateBoundary.js";
10
- import { Pagination as ne } from "../../components/Pagination.js";
3
+ import { Tooltip as a } from "../../../node_modules/recharts/es6/component/Tooltip.js";
4
+ import { ResponsiveContainer as o } from "../../../node_modules/recharts/es6/component/ResponsiveContainer.js";
5
+ import { Cell as s } from "../../../node_modules/recharts/es6/component/Cell.js";
6
+ import { Pie as c } from "../../../node_modules/recharts/es6/polar/Pie.js";
7
+ import { PieChart as l } from "../../../node_modules/recharts/es6/chart/PieChart.js";
8
+ import { cn as u, formatNumber as d, formatPercentage as f } from "../../utils/helpers.js";
9
+ import { toAudienceModel as p } from "../../utils/adsMapper.js";
10
+ import { PageLayout as m } from "../../components/PageLayout.js";
11
+ import { EmptyState as h } from "../../components/EmptyState.js";
12
+ import { Modal as g } from "../../components/Modal.js";
13
+ import { QueryStateBoundary as ee } from "../../components/QueryStateBoundary.js";
14
+ import { Pagination as te } from "../../components/Pagination.js";
11
15
  import "../../components/index.js";
12
- import { useHeadshotmarketingBootstrap as re } from "../../hooks/useHeadshotmarketingBootstrap.js";
13
- import { usePagination as ie } from "../../hooks/usePagination.js";
14
- import { useEffect as f, useMemo as p, useState as m } from "react";
15
- import { Globe as h, Megaphone as g, MoreHorizontal as _, Pencil as v, Plus as y, Target as b, Trash2 as x, Users as S } from "lucide-react";
16
- import { useExclusiveMenu as C } from "@burdenoff/fe-libs/shared/hooks";
17
- import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
18
- import { EmphasisPanel as ae, PagePurpose as oe } from "@burdenoff/fe-libs/ui";
16
+ import { useHeadshotmarketingBootstrap as ne } from "../../hooks/useHeadshotmarketingBootstrap.js";
17
+ import { usePagination as re } from "../../hooks/usePagination.js";
18
+ import { audienceAgeBreakdown as _, audienceCriteriaChips as v, audienceUsageLabel as y } from "./audienceDetails.js";
19
+ import { useEffect as b, useMemo as ie, useState as x } from "react";
20
+ import { Megaphone as S, Pencil as C, Plus as w, Trash2 as T, X as E } from "lucide-react";
21
+ import { Fragment as D, jsx as O, jsxs as k } from "react/jsx-runtime";
22
+ import { PagePurpose as ae } from "@burdenoff/fe-libs/ui";
19
23
  //#region src/headshotmarketing/pages/ads/AudiencesPage.tsx
20
- var D = {
21
- custom: "bg-status-info-bg text-status-info-text",
22
- lookalike: "bg-[var(--color-accent-soft)] text-action-primary-bg",
23
- saved: "bg-status-success-bg text-status-success-text",
24
- retargeting: "bg-status-warning-bg text-status-warning-text"
25
- }, O = {
24
+ var A = {
26
25
  google_ads: "Google Ads",
27
26
  facebook: "Facebook",
28
27
  instagram: "Instagram",
29
28
  linkedin: "LinkedIn",
30
- twitter: "Twitter"
31
- }, k = [
29
+ twitter: "Twitter",
30
+ tiktok: "TikTok"
31
+ }, j = [
32
+ "var(--color-chart-1)",
33
+ "var(--color-chart-2)",
34
+ "var(--color-chart-3)",
35
+ "var(--color-chart-4)",
36
+ "var(--color-chart-5)",
37
+ "var(--color-chart-6)"
38
+ ], M = [
32
39
  "all",
33
40
  "male",
34
41
  "female"
35
- ], A = {
42
+ ], N = {
36
43
  name: "",
37
44
  description: "",
38
45
  estimatedSize: "",
@@ -44,7 +51,7 @@ var D = {
44
51
  interests: "",
45
52
  platform: "google_ads"
46
53
  };
47
- function j(e) {
54
+ function P(e) {
48
55
  let t = (e) => e.split(",").map((e) => e.trim()).filter(Boolean);
49
56
  return {
50
57
  ageMin: Number(e.ageMin) || 18,
@@ -55,55 +62,59 @@ function j(e) {
55
62
  platform: e.platform
56
63
  };
57
64
  }
58
- var M = () => {
59
- let { navigate: a, basePath: u } = i(), { data: h, refetch: g } = re(), [_, v] = m(""), [b, x] = m(""), [S, C] = m(null), [D, O] = m(!1), [k, M] = m(A), [P, F] = m(null), [I, L] = m(null), [R, z] = m(null), B = ie({ initialPageSize: 9 }), { limit: ce, offset: le, setPage: V, setTotal: H } = B;
60
- f(() => {
61
- let e = setTimeout(() => x(_), 300);
65
+ var F = () => {
66
+ let { navigate: a, basePath: o } = i(), { refetch: s } = ne(), [c, l] = x(""), [u, d] = x(""), [f, _] = x(null), [v, y] = x(null), [S, C] = x(!1), [T, E] = x(N), [A, j] = x(null), [M, F] = x(null), [L, R] = x(null), z = re({ initialPageSize: 9 }), { limit: ce, offset: le, setPage: B, setTotal: V } = z;
67
+ b(() => {
68
+ let e = setTimeout(() => d(c), 300);
62
69
  return () => clearTimeout(e);
63
- }, [_]), f(() => {
64
- V(1);
65
- }, [b, V]);
66
- let { data: U, loading: W, error: ue, refetch: G } = n({
70
+ }, [c]), b(() => {
71
+ B(1);
72
+ }, [u, B]);
73
+ let { data: H, loading: U, error: ue, refetch: W } = n({
67
74
  variables: {
68
75
  limit: ce,
69
76
  offset: le,
70
- search: b || null
77
+ search: u || null
71
78
  },
72
79
  errorPolicy: "all",
73
80
  notifyOnNetworkStatusChange: !0
74
- }), K = U?.headshotmarketingAudiences.total ?? 0;
75
- f(() => {
76
- H(K);
77
- }, [K, H]);
78
- let q = p(() => (U?.headshotmarketingAudiences.items ?? []).map((e) => c(e)), [U?.headshotmarketingAudiences.items]), J = p(() => {
79
- let e = (h?.headshotmarketingAudiences.items ?? []).map((e) => c(e)), t = e.filter((e) => e.status === "active").length, n = e.reduce((e, t) => e + t.size, 0), r = e.filter((e) => e.matchRate > 0), i = r.length > 0 ? r.reduce((e, t) => e + t.matchRate, 0) / r.length : 0;
80
- return {
81
- total: e.length,
82
- active: t,
83
- totalReach: n,
84
- avgMatch: i
85
- };
86
- }, [h?.headshotmarketingAudiences.items]), [de, { loading: Y }] = e(), [X, { loading: Z }] = r(), [fe, { loading: Q }] = t(), $ = async () => {
87
- await Promise.all([G(), g()]);
81
+ }), G = H?.headshotmarketingAudiences.total ?? 0;
82
+ b(() => {
83
+ V(G);
84
+ }, [G, V]);
85
+ let K = ie(() => (H?.headshotmarketingAudiences.items ?? []).map((e) => p(e)), [H?.headshotmarketingAudiences.items]), q = K.find((e) => e.id === f) ?? null, [de, { loading: J }] = e(), [Y, { loading: X }] = r(), [fe, { loading: Z }] = t(), Q = async () => {
86
+ await Promise.all([W(), s()]);
88
87
  }, pe = async () => {
89
- if (!k.name.trim()) {
90
- z("Audience name is required.");
88
+ if (!T.name.trim()) {
89
+ R("Audience name is required.");
91
90
  return;
92
91
  }
93
- z(null);
92
+ R(null);
94
93
  try {
95
94
  await de({ variables: { input: {
96
- name: k.name.trim(),
97
- description: k.description || null,
98
- estimatedSize: k.estimatedSize ? Number(k.estimatedSize) : null,
99
- isActive: k.isActive,
100
- targetingCriteria: j(k)
101
- } } }), O(!1), M(A), await $();
95
+ name: T.name.trim(),
96
+ description: T.description || null,
97
+ estimatedSize: T.estimatedSize ? Number(T.estimatedSize) : null,
98
+ isActive: T.isActive,
99
+ targetingCriteria: P(T)
100
+ } } }), C(!1), E(N), await Q();
101
+ } catch (e) {
102
+ R(e instanceof Error ? e.message : "Failed to create audience.");
103
+ }
104
+ }, $ = async (e) => {
105
+ R(null), y(e.id);
106
+ try {
107
+ await Y({ variables: {
108
+ id: e.id,
109
+ input: { isActive: e.status !== "active" }
110
+ } }), await Q();
102
111
  } catch (e) {
103
- z(e instanceof Error ? e.message : "Failed to create audience.");
112
+ R(e instanceof Error ? e.message : "Failed to update audience.");
113
+ } finally {
114
+ y(null);
104
115
  }
105
116
  }, me = (e) => {
106
- C(null), z(null), F({
117
+ R(null), j({
107
118
  id: e.id,
108
119
  form: {
109
120
  name: e.name,
@@ -119,216 +130,188 @@ var M = () => {
119
130
  }
120
131
  });
121
132
  }, he = async () => {
122
- if (P) {
123
- if (!P.form.name.trim()) {
124
- z("Audience name is required.");
133
+ if (A) {
134
+ if (!A.form.name.trim()) {
135
+ R("Audience name is required.");
125
136
  return;
126
137
  }
127
- z(null);
138
+ R(null);
128
139
  try {
129
- await X({ variables: {
130
- id: P.id,
140
+ await Y({ variables: {
141
+ id: A.id,
131
142
  input: {
132
- name: P.form.name.trim(),
133
- description: P.form.description || null,
134
- estimatedSize: P.form.estimatedSize ? Number(P.form.estimatedSize) : null,
135
- isActive: P.form.isActive,
136
- targetingCriteria: j(P.form)
143
+ name: A.form.name.trim(),
144
+ description: A.form.description || null,
145
+ estimatedSize: A.form.estimatedSize ? Number(A.form.estimatedSize) : null,
146
+ isActive: A.form.isActive,
147
+ targetingCriteria: P(A.form)
137
148
  }
138
- } }), F(null), await $();
149
+ } }), j(null), await Q();
139
150
  } catch (e) {
140
- z(e instanceof Error ? e.message : "Failed to save audience.");
151
+ R(e instanceof Error ? e.message : "Failed to save audience.");
141
152
  }
142
153
  }
143
154
  }, ge = async () => {
144
- if (I) {
145
- z(null);
155
+ if (M) {
156
+ R(null);
146
157
  try {
147
- await fe({ variables: { id: I.id } }), L(null), await $();
158
+ await fe({ variables: { id: M.id } }), f === M.id && _(null), F(null), await Q();
148
159
  } catch (e) {
149
- z(e instanceof Error ? e.message : "Failed to delete audience.");
160
+ R(e instanceof Error ? e.message : "Failed to delete audience.");
150
161
  }
151
162
  }
152
163
  }, _e = (e) => {
153
- C(null), a(`${u}/ads/campaigns/new?${new URLSearchParams({
164
+ a(`${o}/ads/campaigns/new?${new URLSearchParams({
154
165
  audienceId: e.id,
155
166
  audienceName: e.name
156
167
  }).toString()}`);
157
168
  };
158
- return /* @__PURE__ */ E(l, {
169
+ return /* @__PURE__ */ k(m, {
159
170
  title: "Audiences",
160
171
  description: "Create and manage your target audiences",
161
- actions: /* @__PURE__ */ E("button", {
172
+ actions: /* @__PURE__ */ k("button", {
162
173
  onClick: () => {
163
- z(null), M(A), O(!0);
174
+ R(null), E(N), C(!0);
164
175
  },
165
176
  className: "inline-flex items-center gap-2 rounded-md bg-foreground px-4 py-2 text-sm font-medium text-background hover:bg-foreground/90",
166
- children: [/* @__PURE__ */ T(y, { className: "h-4 w-4" }), "Create Audience"]
177
+ children: [/* @__PURE__ */ O(w, { className: "h-4 w-4" }), "New Audience"]
167
178
  }),
168
179
  children: [
169
- /* @__PURE__ */ T(oe, { children: "Define and reuse the groups of people your ads should reach — custom lists, lookalikes and retargeting audiences. Save an audience once, then target it across any campaign and track how well it matches." }),
170
- /* @__PURE__ */ T(ae, { children: /* @__PURE__ */ E("div", {
171
- className: "grid grid-cols-2 gap-4 sm:grid-cols-4",
172
- children: [
173
- /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("p", {
174
- className: "text-xs text-text-secondary",
175
- children: "Audiences"
176
- }), /* @__PURE__ */ T("p", {
177
- className: "text-2xl font-semibold text-text-primary",
178
- children: o(J.total)
179
- })] }),
180
- /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("p", {
181
- className: "text-xs text-text-secondary",
182
- children: "Active"
183
- }), /* @__PURE__ */ T("p", {
184
- className: "text-2xl font-semibold text-text-primary",
185
- children: o(J.active)
186
- })] }),
187
- /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("p", {
188
- className: "text-xs text-text-secondary",
189
- children: "Total Reach"
190
- }), /* @__PURE__ */ T("p", {
191
- className: "text-2xl font-semibold text-text-primary",
192
- children: o(J.totalReach)
193
- })] }),
194
- /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("p", {
195
- className: "text-xs text-text-secondary",
196
- children: "Avg Match Rate"
197
- }), /* @__PURE__ */ T("p", {
198
- className: "text-2xl font-semibold text-text-primary",
199
- children: s(J.avgMatch, 0)
200
- })] })
201
- ]
202
- }) }),
203
- /* @__PURE__ */ T("div", {
180
+ /* @__PURE__ */ O(ae, { children: "Define and reuse the groups of people your ads should reach — custom lists, lookalikes and retargeting audiences. Save an audience once, then target it across any campaign and track how well it matches." }),
181
+ /* @__PURE__ */ O("div", {
204
182
  className: "relative max-w-md",
205
- children: /* @__PURE__ */ T("input", {
183
+ children: /* @__PURE__ */ O("input", {
206
184
  type: "text",
207
- value: _,
208
- onChange: (e) => v(e.target.value),
185
+ value: c,
186
+ onChange: (e) => l(e.target.value),
209
187
  placeholder: "Search audiences...",
210
188
  className: "w-full rounded-md border border-border-subtle bg-bg-surface px-4 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
211
189
  })
212
190
  }),
213
- R && !D && !P && /* @__PURE__ */ T("div", {
191
+ L && !S && !A && /* @__PURE__ */ O("div", {
214
192
  role: "alert",
215
193
  className: "rounded-lg border border-status-error-border/30 bg-status-error-bg/10 px-4 py-3 text-sm text-status-error-text",
216
- children: R
194
+ children: L
217
195
  }),
218
- /* @__PURE__ */ T(te, {
219
- loading: W,
196
+ /* @__PURE__ */ O(ee, {
197
+ loading: U,
220
198
  error: ue,
221
- onRetry: G,
222
- hasData: !!U,
223
- children: q.length === 0 ? /* @__PURE__ */ T(ee, {
224
- illustration: K === 0 ? "empty-people" : "empty-search",
225
- title: K === 0 ? "No audiences yet" : "No audiences match your search",
226
- description: K === 0 ? "Create your first audience to target the right people in your campaigns." : "Try a different search term.",
227
- action: K === 0 ? /* @__PURE__ */ E("button", {
199
+ onRetry: W,
200
+ hasData: !!H,
201
+ children: K.length === 0 ? /* @__PURE__ */ O(h, {
202
+ illustration: G === 0 ? "empty-people" : "empty-search",
203
+ title: G === 0 ? "No audiences yet" : "No audiences match your search",
204
+ description: G === 0 ? "Create your first audience to target the right people in your campaigns." : "Try a different search term.",
205
+ action: G === 0 ? /* @__PURE__ */ k("button", {
228
206
  onClick: () => {
229
- z(null), M(A), O(!0);
207
+ R(null), E(N), C(!0);
230
208
  },
231
209
  className: "inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90",
232
- children: [/* @__PURE__ */ T(y, { className: "h-4 w-4" }), "Create Audience"]
210
+ children: [/* @__PURE__ */ O(w, { className: "h-4 w-4" }), "Create Audience"]
233
211
  }) : void 0
234
- }) : /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T("div", {
212
+ }) : /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O("div", {
235
213
  className: "grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",
236
- children: q.map((e) => /* @__PURE__ */ T(se, {
214
+ children: K.map((e) => /* @__PURE__ */ O(oe, {
237
215
  audience: e,
238
- menuOpen: S === e.id,
239
- onToggleMenu: () => C(S === e.id ? null : e.id),
240
- onCloseMenu: () => C(null),
241
- onEdit: () => me(e),
242
- onDelete: () => {
243
- C(null), L(e);
244
- },
245
- onUseInCampaign: () => _e(e)
216
+ selected: f === e.id,
217
+ toggling: v === e.id,
218
+ onOpen: () => _(e.id),
219
+ onToggleActive: () => $(e)
246
220
  }, e.id))
247
- }), /* @__PURE__ */ T(ne, {
248
- page: B.page,
249
- pageSize: B.pageSize,
250
- total: B.total,
251
- onPageChange: B.setPage,
252
- onPageSizeChange: B.setPageSize,
221
+ }), /* @__PURE__ */ O(te, {
222
+ page: z.page,
223
+ pageSize: z.pageSize,
224
+ total: z.total,
225
+ onPageChange: z.setPage,
226
+ onPageSizeChange: z.setPageSize,
253
227
  pageSizeOptions: [
254
228
  9,
255
229
  18,
256
230
  36
257
231
  ],
258
- disabled: W,
232
+ disabled: U,
259
233
  hideWhenSinglePage: !0
260
234
  })] })
261
235
  }),
262
- /* @__PURE__ */ T(d, {
263
- open: D,
264
- onClose: () => O(!1),
236
+ q && /* @__PURE__ */ O(se, {
237
+ audience: q,
238
+ toggling: v === q.id,
239
+ onClose: () => _(null),
240
+ onToggleActive: () => $(q),
241
+ onEdit: () => me(q),
242
+ onUseInCampaign: () => _e(q),
243
+ onDelete: () => F(q)
244
+ }),
245
+ /* @__PURE__ */ O(g, {
246
+ open: S,
247
+ onClose: () => C(!1),
265
248
  title: "Create Audience",
266
249
  description: "Define who your ads should reach",
267
250
  size: "lg",
268
- footer: /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T("button", {
269
- onClick: () => O(!1),
251
+ footer: /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O("button", {
252
+ onClick: () => C(!1),
270
253
  className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
271
254
  children: "Cancel"
272
- }), /* @__PURE__ */ T("button", {
255
+ }), /* @__PURE__ */ O("button", {
273
256
  onClick: pe,
274
- disabled: Y,
257
+ disabled: J,
275
258
  className: "rounded-md bg-foreground px-4 py-2 text-sm font-medium text-background hover:bg-foreground/90 disabled:opacity-60",
276
- children: Y ? "Creating..." : "Create Audience"
259
+ children: J ? "Creating..." : "Create Audience"
277
260
  })] }),
278
- children: /* @__PURE__ */ T(N, {
279
- form: k,
280
- onChange: M,
281
- error: R
261
+ children: /* @__PURE__ */ O(I, {
262
+ form: T,
263
+ onChange: E,
264
+ error: L
282
265
  })
283
266
  }),
284
- /* @__PURE__ */ T(d, {
285
- open: P !== null,
286
- onClose: () => F(null),
267
+ /* @__PURE__ */ O(g, {
268
+ open: A !== null,
269
+ onClose: () => j(null),
287
270
  title: "Edit Audience",
288
271
  description: "Update audience targeting",
289
272
  size: "lg",
290
- footer: /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T("button", {
291
- onClick: () => F(null),
273
+ footer: /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O("button", {
274
+ onClick: () => j(null),
292
275
  className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
293
276
  children: "Cancel"
294
- }), /* @__PURE__ */ T("button", {
277
+ }), /* @__PURE__ */ O("button", {
295
278
  onClick: he,
296
- disabled: Z,
279
+ disabled: X,
297
280
  className: "rounded-md bg-foreground px-4 py-2 text-sm font-medium text-background hover:bg-foreground/90 disabled:opacity-60",
298
- children: Z ? "Saving..." : "Save Changes"
281
+ children: X ? "Saving..." : "Save Changes"
299
282
  })] }),
300
- children: P && /* @__PURE__ */ T(N, {
301
- form: P.form,
302
- onChange: (e) => F({
303
- ...P,
283
+ children: A && /* @__PURE__ */ O(I, {
284
+ form: A.form,
285
+ onChange: (e) => j({
286
+ ...A,
304
287
  form: e
305
288
  }),
306
- error: R
289
+ error: L
307
290
  })
308
291
  }),
309
- /* @__PURE__ */ T(d, {
310
- open: I !== null,
311
- onClose: () => L(null),
292
+ /* @__PURE__ */ O(g, {
293
+ open: M !== null,
294
+ onClose: () => F(null),
312
295
  title: "Delete Audience",
313
296
  size: "sm",
314
- footer: /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T("button", {
315
- onClick: () => L(null),
297
+ footer: /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O("button", {
298
+ onClick: () => F(null),
316
299
  className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
317
300
  children: "Cancel"
318
- }), /* @__PURE__ */ T("button", {
301
+ }), /* @__PURE__ */ O("button", {
319
302
  onClick: ge,
320
- disabled: Q,
303
+ disabled: Z,
321
304
  className: "rounded-md bg-status-error-text px-4 py-2 text-sm font-medium text-background hover:opacity-90 disabled:opacity-60",
322
- children: Q ? "Deleting..." : "Delete"
305
+ children: Z ? "Deleting..." : "Delete"
323
306
  })] }),
324
- children: /* @__PURE__ */ E("p", {
307
+ children: /* @__PURE__ */ k("p", {
325
308
  className: "text-sm text-text-secondary",
326
309
  children: [
327
310
  "Are you sure you want to delete",
328
311
  " ",
329
- /* @__PURE__ */ T("span", {
312
+ /* @__PURE__ */ O("span", {
330
313
  className: "font-semibold text-text-primary",
331
- children: I?.name
314
+ children: M?.name
332
315
  }),
333
316
  "? This action cannot be undone."
334
317
  ]
@@ -336,7 +319,7 @@ var M = () => {
336
319
  })
337
320
  ]
338
321
  });
339
- }, N = ({ form: e, onChange: t, error: n }) => {
322
+ }, I = ({ form: e, onChange: t, error: n }) => {
340
323
  let r = (n) => {
341
324
  let r = e.genders.includes(n) ? e.genders.filter((e) => e !== n) : [...e.genders, n];
342
325
  t({
@@ -344,13 +327,13 @@ var M = () => {
344
327
  genders: r
345
328
  });
346
329
  };
347
- return /* @__PURE__ */ E("div", {
330
+ return /* @__PURE__ */ k("div", {
348
331
  className: "space-y-4",
349
332
  children: [
350
- /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
333
+ /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("label", {
351
334
  className: "mb-1.5 block text-sm font-medium text-text-primary",
352
335
  children: "Name"
353
- }), /* @__PURE__ */ T("input", {
336
+ }), /* @__PURE__ */ O("input", {
354
337
  type: "text",
355
338
  value: e.name,
356
339
  onChange: (n) => t({
@@ -360,10 +343,10 @@ var M = () => {
360
343
  placeholder: "e.g., Returning Visitors — US",
361
344
  className: "w-full rounded-md border border-border-subtle bg-bg-surface px-4 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
362
345
  })] }),
363
- /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
346
+ /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("label", {
364
347
  className: "mb-1.5 block text-sm font-medium text-text-primary",
365
348
  children: "Description"
366
- }), /* @__PURE__ */ T("textarea", {
349
+ }), /* @__PURE__ */ O("textarea", {
367
350
  value: e.description,
368
351
  onChange: (n) => t({
369
352
  ...e,
@@ -372,13 +355,13 @@ var M = () => {
372
355
  rows: 2,
373
356
  className: "w-full resize-none rounded-md border border-border-subtle bg-bg-surface px-4 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
374
357
  })] }),
375
- /* @__PURE__ */ E("div", {
358
+ /* @__PURE__ */ k("div", {
376
359
  className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
377
360
  children: [
378
- /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
361
+ /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("label", {
379
362
  className: "mb-1.5 block text-sm font-medium text-text-primary",
380
363
  children: "Estimated Size"
381
- }), /* @__PURE__ */ T("input", {
364
+ }), /* @__PURE__ */ O("input", {
382
365
  type: "number",
383
366
  value: e.estimatedSize,
384
367
  onChange: (n) => t({
@@ -387,10 +370,10 @@ var M = () => {
387
370
  }),
388
371
  className: "w-full rounded-md border border-border-subtle bg-bg-surface px-4 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
389
372
  })] }),
390
- /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
373
+ /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("label", {
391
374
  className: "mb-1.5 block text-sm font-medium text-text-primary",
392
375
  children: "Age Min"
393
- }), /* @__PURE__ */ T("input", {
376
+ }), /* @__PURE__ */ O("input", {
394
377
  type: "number",
395
378
  value: e.ageMin,
396
379
  onChange: (n) => t({
@@ -399,10 +382,10 @@ var M = () => {
399
382
  }),
400
383
  className: "w-full rounded-md border border-border-subtle bg-bg-surface px-4 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
401
384
  })] }),
402
- /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
385
+ /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("label", {
403
386
  className: "mb-1.5 block text-sm font-medium text-text-primary",
404
387
  children: "Age Max"
405
- }), /* @__PURE__ */ T("input", {
388
+ }), /* @__PURE__ */ O("input", {
406
389
  type: "number",
407
390
  value: e.ageMax,
408
391
  onChange: (n) => t({
@@ -413,24 +396,24 @@ var M = () => {
413
396
  })] })
414
397
  ]
415
398
  }),
416
- /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
399
+ /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("label", {
417
400
  className: "mb-1.5 block text-sm font-medium text-text-primary",
418
401
  children: "Gender"
419
- }), /* @__PURE__ */ T("div", {
402
+ }), /* @__PURE__ */ O("div", {
420
403
  className: "flex flex-wrap gap-2",
421
- children: k.map((t) => /* @__PURE__ */ T("button", {
404
+ children: M.map((t) => /* @__PURE__ */ O("button", {
422
405
  type: "button",
423
406
  onClick: () => r(t),
424
- className: a("rounded-full border px-4 py-1.5 text-sm capitalize transition-colors", e.genders.includes(t) ? "border-foreground bg-foreground text-background" : "border-border-subtle text-text-primary hover:bg-bg-sunken"),
407
+ className: u("rounded-full border px-4 py-1.5 text-sm capitalize transition-colors", e.genders.includes(t) ? "border-foreground bg-foreground text-background" : "border-border-subtle text-text-primary hover:bg-bg-sunken"),
425
408
  children: t
426
409
  }, t))
427
410
  })] }),
428
- /* @__PURE__ */ E("div", {
411
+ /* @__PURE__ */ k("div", {
429
412
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
430
- children: [/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
413
+ children: [/* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("label", {
431
414
  className: "mb-1.5 block text-sm font-medium text-text-primary",
432
415
  children: "Locations"
433
- }), /* @__PURE__ */ T("input", {
416
+ }), /* @__PURE__ */ O("input", {
434
417
  type: "text",
435
418
  value: e.locations,
436
419
  onChange: (n) => t({
@@ -439,10 +422,10 @@ var M = () => {
439
422
  }),
440
423
  placeholder: "Comma-separated",
441
424
  className: "w-full rounded-md border border-border-subtle bg-bg-surface px-4 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
442
- })] }), /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
425
+ })] }), /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("label", {
443
426
  className: "mb-1.5 block text-sm font-medium text-text-primary",
444
427
  children: "Platform"
445
- }), /* @__PURE__ */ E("select", {
428
+ }), /* @__PURE__ */ k("select", {
446
429
  value: e.platform,
447
430
  onChange: (n) => t({
448
431
  ...e,
@@ -450,33 +433,33 @@ var M = () => {
450
433
  }),
451
434
  className: "w-full rounded-md border border-border-subtle bg-bg-surface px-4 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
452
435
  children: [
453
- /* @__PURE__ */ T("option", {
436
+ /* @__PURE__ */ O("option", {
454
437
  value: "google_ads",
455
438
  children: "Google Ads"
456
439
  }),
457
- /* @__PURE__ */ T("option", {
440
+ /* @__PURE__ */ O("option", {
458
441
  value: "facebook",
459
442
  children: "Facebook"
460
443
  }),
461
- /* @__PURE__ */ T("option", {
444
+ /* @__PURE__ */ O("option", {
462
445
  value: "instagram",
463
446
  children: "Instagram"
464
447
  }),
465
- /* @__PURE__ */ T("option", {
448
+ /* @__PURE__ */ O("option", {
466
449
  value: "linkedin",
467
450
  children: "LinkedIn"
468
451
  }),
469
- /* @__PURE__ */ T("option", {
452
+ /* @__PURE__ */ O("option", {
470
453
  value: "twitter",
471
454
  children: "Twitter"
472
455
  })
473
456
  ]
474
457
  })] })]
475
458
  }),
476
- /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
459
+ /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("label", {
477
460
  className: "mb-1.5 block text-sm font-medium text-text-primary",
478
461
  children: "Interests"
479
- }), /* @__PURE__ */ T("input", {
462
+ }), /* @__PURE__ */ O("input", {
480
463
  type: "text",
481
464
  value: e.interests,
482
465
  onChange: (n) => t({
@@ -486,9 +469,9 @@ var M = () => {
486
469
  placeholder: "Comma-separated interests",
487
470
  className: "w-full rounded-md border border-border-subtle bg-bg-surface px-4 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
488
471
  })] }),
489
- /* @__PURE__ */ E("label", {
472
+ /* @__PURE__ */ k("label", {
490
473
  className: "flex items-center gap-2 text-sm text-text-primary",
491
- children: [/* @__PURE__ */ T("input", {
474
+ children: [/* @__PURE__ */ O("input", {
492
475
  type: "checkbox",
493
476
  checked: e.isActive,
494
477
  onChange: (n) => t({
@@ -498,145 +481,271 @@ var M = () => {
498
481
  className: "h-4 w-4 rounded border-border-subtle"
499
482
  }), "Active"]
500
483
  }),
501
- n && /* @__PURE__ */ T("p", {
484
+ n && /* @__PURE__ */ O("p", {
502
485
  className: "text-sm text-status-error-text",
503
486
  children: n
504
487
  })
505
488
  ]
506
489
  });
507
- }, se = ({ audience: e, menuOpen: t, onToggleMenu: n, onCloseMenu: r, onEdit: i, onDelete: c, onUseInCampaign: l }) => (C(`audience-${e.id}`, t, r), /* @__PURE__ */ E("div", {
508
- className: "space-y-4 rounded-lg border border-border-seam bg-gloss-card shadow-pop p-5 transition-colors hover:border-foreground/30",
509
- children: [
510
- /* @__PURE__ */ E("div", {
511
- className: "flex items-start justify-between gap-2",
512
- children: [/* @__PURE__ */ E("div", {
513
- className: "min-w-0",
514
- children: [/* @__PURE__ */ T("h3", {
515
- className: "text-sm font-semibold text-text-primary",
516
- children: e.name
517
- }), /* @__PURE__ */ T("p", {
518
- className: "mt-0.5 text-xs text-text-secondary",
519
- children: e.description
490
+ }, L = ({ audience: e, disabled: t, onToggle: n }) => {
491
+ let r = e.status === "active";
492
+ return /* @__PURE__ */ O("button", {
493
+ type: "button",
494
+ role: "switch",
495
+ "aria-checked": r,
496
+ "aria-label": `${e.name} active`,
497
+ disabled: t,
498
+ onClick: (e) => {
499
+ e.stopPropagation(), n();
500
+ },
501
+ className: u("relative inline-flex h-6 w-11 shrink-0 items-center rounded-full border transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] disabled:opacity-60", r ? "border-action-primary-bg bg-action-primary-bg" : "border-border-subtle bg-bg-sunken"),
502
+ children: /* @__PURE__ */ O("span", {
503
+ "aria-hidden": "true",
504
+ className: u("inline-block h-4 w-4 rounded-full bg-bg-surface shadow transition-transform", r ? "translate-x-6" : "translate-x-1")
505
+ })
506
+ });
507
+ }, oe = ({ audience: e, selected: t, toggling: n, onOpen: r, onToggleActive: i }) => {
508
+ let a = v(e), o = y(e.usedInCampaignCount);
509
+ return /* @__PURE__ */ k("div", {
510
+ role: "button",
511
+ tabIndex: 0,
512
+ "aria-label": `Open ${e.name} details`,
513
+ onClick: r,
514
+ onKeyDown: (e) => {
515
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), r());
516
+ },
517
+ className: u("cursor-pointer space-y-3 rounded-lg border bg-gloss-card p-5 shadow-pop transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]", t ? "border-action-primary-bg" : "border-border-seam hover:border-foreground/30"),
518
+ children: [
519
+ /* @__PURE__ */ k("div", {
520
+ className: "flex items-start justify-between gap-3",
521
+ children: [/* @__PURE__ */ k("div", {
522
+ className: "min-w-0",
523
+ children: [/* @__PURE__ */ O("h3", {
524
+ className: "truncate text-sm font-semibold text-text-primary",
525
+ children: e.name
526
+ }), /* @__PURE__ */ O("p", {
527
+ className: "mt-1 text-2xl font-semibold tabular-nums text-text-primary",
528
+ children: d(e.size)
529
+ })]
530
+ }), /* @__PURE__ */ k("div", {
531
+ className: "flex flex-col items-end gap-1",
532
+ children: [/* @__PURE__ */ O(L, {
533
+ audience: e,
534
+ disabled: n,
535
+ onToggle: i
536
+ }), /* @__PURE__ */ O("span", {
537
+ className: "text-xs text-text-secondary",
538
+ children: e.status === "active" ? "Active" : "Inactive"
539
+ })]
520
540
  })]
521
- }), /* @__PURE__ */ E("div", {
522
- className: "relative shrink-0",
523
- children: [/* @__PURE__ */ T("button", {
524
- onClick: n,
525
- "aria-haspopup": "menu",
526
- "aria-expanded": t,
527
- "aria-label": "Audience actions",
528
- className: "text-text-secondary hover:text-text-primary",
529
- children: /* @__PURE__ */ T(_, { className: "h-4 w-4" })
530
- }), t && /* @__PURE__ */ E("div", {
531
- role: "menu",
532
- className: "absolute right-0 top-6 z-20 w-44 rounded-md border border-border-seam bg-gloss-card py-1 shadow-lg",
541
+ }),
542
+ /* @__PURE__ */ k("div", {
543
+ className: "flex flex-wrap gap-1.5 border-t border-border-subtle pt-3",
544
+ children: [a.slice(0, 4).map((e) => /* @__PURE__ */ O("span", {
545
+ className: "rounded-full border border-border-subtle px-2 py-0.5 text-xs text-text-secondary",
546
+ children: e
547
+ }, e)), a.length > 4 && /* @__PURE__ */ k("span", {
548
+ className: "px-1 py-0.5 text-xs text-text-secondary",
533
549
  children: [
534
- /* @__PURE__ */ E("button", {
535
- role: "menuitem",
536
- onClick: i,
537
- className: "flex w-full items-center gap-2 px-4 py-2 text-left text-sm text-text-primary hover:bg-bg-sunken",
538
- children: [/* @__PURE__ */ T(v, { className: "h-3.5 w-3.5" }), "Edit"]
539
- }),
540
- /* @__PURE__ */ E("button", {
541
- role: "menuitem",
542
- onClick: l,
543
- className: "flex w-full items-center gap-2 px-4 py-2 text-left text-sm text-text-primary hover:bg-bg-sunken",
544
- children: [/* @__PURE__ */ T(g, { className: "h-3.5 w-3.5" }), "Use in Campaign"]
545
- }),
546
- /* @__PURE__ */ E("button", {
547
- role: "menuitem",
548
- onClick: c,
549
- className: "flex w-full items-center gap-2 px-4 py-2 text-left text-sm text-status-error-text hover:bg-bg-sunken",
550
- children: [/* @__PURE__ */ T(x, { className: "h-3.5 w-3.5" }), "Delete"]
551
- })
550
+ "+",
551
+ a.length - 4,
552
+ " more"
552
553
  ]
553
554
  })]
555
+ }),
556
+ o !== null && /* @__PURE__ */ O("p", {
557
+ className: "border-t border-border-subtle pt-3 text-xs text-text-secondary",
558
+ children: o
559
+ })
560
+ ]
561
+ });
562
+ }, se = ({ audience: e, toggling: t, onClose: n, onToggleActive: r, onEdit: i, onUseInCampaign: u, onDelete: p }) => {
563
+ let m = _(e), h = v(e), g = y(e.usedInCampaignCount);
564
+ return b(() => {
565
+ let e = (e) => {
566
+ e.key === "Escape" && n();
567
+ };
568
+ return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
569
+ }, [n]), /* @__PURE__ */ k("aside", {
570
+ role: "dialog",
571
+ "aria-modal": "false",
572
+ "aria-labelledby": "audience-drawer-title",
573
+ className: "fixed inset-y-0 right-0 z-40 flex w-full flex-col overflow-y-auto border-l border-border-seam bg-bg-surface shadow-2xl sm:w-[380px]",
574
+ children: [/* @__PURE__ */ k("div", {
575
+ className: "flex items-start justify-between gap-3 border-b border-border-seam p-5",
576
+ children: [/* @__PURE__ */ k("div", {
577
+ className: "min-w-0",
578
+ children: [
579
+ /* @__PURE__ */ O("p", {
580
+ className: "text-xs uppercase tracking-wide text-text-secondary",
581
+ children: "Audience"
582
+ }),
583
+ /* @__PURE__ */ O("h2", {
584
+ id: "audience-drawer-title",
585
+ className: "truncate text-lg font-semibold text-text-primary",
586
+ children: e.name
587
+ }),
588
+ e.description && /* @__PURE__ */ O("p", {
589
+ className: "mt-1 text-sm text-text-secondary",
590
+ children: e.description
591
+ })
592
+ ]
593
+ }), /* @__PURE__ */ O("button", {
594
+ type: "button",
595
+ onClick: n,
596
+ "aria-label": "Close audience details",
597
+ className: "rounded-md p-1.5 text-text-secondary hover:bg-bg-sunken hover:text-text-primary",
598
+ children: /* @__PURE__ */ O(E, { className: "h-5 w-5" })
554
599
  })]
555
- }),
556
- /* @__PURE__ */ E("div", {
557
- className: "flex flex-wrap items-center gap-2",
600
+ }), /* @__PURE__ */ k("div", {
601
+ className: "space-y-6 p-5",
558
602
  children: [
559
- /* @__PURE__ */ T("span", {
560
- className: a("rounded-full px-2.5 py-0.5 text-xs font-medium capitalize", D[e.type]),
561
- children: e.type
603
+ /* @__PURE__ */ k("dl", {
604
+ className: "grid grid-cols-2 gap-3 text-sm",
605
+ children: [
606
+ /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("dt", {
607
+ className: "text-xs text-text-secondary",
608
+ children: "Estimated size"
609
+ }), /* @__PURE__ */ O("dd", {
610
+ className: "font-semibold text-text-primary",
611
+ children: d(e.size)
612
+ })] }),
613
+ g !== null && /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("dt", {
614
+ className: "text-xs text-text-secondary",
615
+ children: "Usage"
616
+ }), /* @__PURE__ */ O("dd", {
617
+ className: "font-semibold text-text-primary",
618
+ children: g
619
+ })] }),
620
+ /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("dt", {
621
+ className: "text-xs text-text-secondary",
622
+ children: "Platform"
623
+ }), /* @__PURE__ */ O("dd", {
624
+ className: "text-text-primary",
625
+ children: A[e.platform] ?? e.platform
626
+ })] }),
627
+ /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("dt", {
628
+ className: "text-xs text-text-secondary",
629
+ children: "Match rate"
630
+ }), /* @__PURE__ */ O("dd", {
631
+ className: "text-text-primary",
632
+ children: e.matchRate > 0 ? f(e.matchRate, 0) : "—"
633
+ })] }),
634
+ /* @__PURE__ */ k("div", {
635
+ className: "col-span-2 flex items-center gap-3",
636
+ children: [/* @__PURE__ */ O(L, {
637
+ audience: e,
638
+ disabled: t,
639
+ onToggle: r
640
+ }), /* @__PURE__ */ O("span", {
641
+ className: "text-sm text-text-primary",
642
+ children: e.status === "active" ? "Active" : "Inactive"
643
+ })]
644
+ })
645
+ ]
562
646
  }),
563
- /* @__PURE__ */ T(u, { status: e.status }),
564
- /* @__PURE__ */ T("span", {
565
- className: "text-xs text-text-secondary",
566
- children: O[e.platform]
567
- })
568
- ]
569
- }),
570
- /* @__PURE__ */ E("div", {
571
- className: "flex items-center gap-2",
572
- children: [
573
- /* @__PURE__ */ T(S, { className: "h-4 w-4 text-text-secondary" }),
574
- /* @__PURE__ */ T("span", {
575
- className: "text-sm font-medium text-text-primary",
576
- children: o(e.size)
647
+ /* @__PURE__ */ k("section", {
648
+ "aria-labelledby": "audience-demographics-title",
649
+ children: [
650
+ /* @__PURE__ */ O("h3", {
651
+ id: "audience-demographics-title",
652
+ className: "text-sm font-semibold text-text-primary",
653
+ children: "Demographics"
654
+ }),
655
+ /* @__PURE__ */ O("p", {
656
+ className: "mt-0.5 text-xs text-text-secondary",
657
+ children: "Targeted age span by bracket"
658
+ }),
659
+ m.length > 0 ? /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O("div", {
660
+ className: "h-48",
661
+ children: /* @__PURE__ */ O(o, {
662
+ width: "100%",
663
+ height: "100%",
664
+ children: /* @__PURE__ */ k(l, { children: [/* @__PURE__ */ O(c, {
665
+ data: m,
666
+ dataKey: "percent",
667
+ nameKey: "label",
668
+ innerRadius: "58%",
669
+ outerRadius: "90%",
670
+ paddingAngle: 2,
671
+ stroke: "var(--color-card)",
672
+ children: m.map((e, t) => /* @__PURE__ */ O(s, { fill: j[t % j.length] }, e.label))
673
+ }), /* @__PURE__ */ O(a, {
674
+ formatter: (e) => `${e.toFixed(0)}%`,
675
+ contentStyle: {
676
+ backgroundColor: "var(--color-card)",
677
+ border: "1px solid var(--color-border)"
678
+ }
679
+ })] })
680
+ })
681
+ }), /* @__PURE__ */ O("ul", {
682
+ className: "grid grid-cols-2 gap-1.5 text-xs",
683
+ children: m.map((e, t) => /* @__PURE__ */ k("li", {
684
+ className: "flex items-center gap-2",
685
+ children: [
686
+ /* @__PURE__ */ O("span", {
687
+ "aria-hidden": "true",
688
+ className: "h-2.5 w-2.5 rounded-full",
689
+ style: { backgroundColor: j[t % j.length] }
690
+ }),
691
+ /* @__PURE__ */ O("span", {
692
+ className: "text-text-secondary",
693
+ children: e.label
694
+ }),
695
+ /* @__PURE__ */ k("span", {
696
+ className: "ml-auto tabular-nums text-text-primary",
697
+ children: [e.percent.toFixed(0), "%"]
698
+ })
699
+ ]
700
+ }, e.label))
701
+ })] }) : /* @__PURE__ */ O("p", {
702
+ className: "mt-2 text-sm text-text-secondary",
703
+ children: "No age targeting set."
704
+ })
705
+ ]
577
706
  }),
578
- /* @__PURE__ */ T("span", {
579
- className: "text-xs text-text-secondary",
580
- children: "people"
707
+ /* @__PURE__ */ k("section", {
708
+ "aria-labelledby": "audience-criteria-title",
709
+ children: [/* @__PURE__ */ O("h3", {
710
+ id: "audience-criteria-title",
711
+ className: "border-b border-border-subtle pb-2 text-sm font-semibold text-text-primary",
712
+ children: "Criteria"
713
+ }), /* @__PURE__ */ O("ul", {
714
+ className: "mt-3 flex flex-wrap gap-2",
715
+ children: h.map((e) => /* @__PURE__ */ O("li", {
716
+ className: "rounded-full border border-border-subtle bg-bg-sunken px-2.5 py-1 text-xs text-text-primary",
717
+ children: e
718
+ }, e))
719
+ })]
581
720
  }),
582
- e.matchRate > 0 && /* @__PURE__ */ E("span", {
583
- className: "ml-auto text-xs text-text-secondary",
584
- children: ["Match: ", s(e.matchRate, 0)]
721
+ /* @__PURE__ */ k("div", {
722
+ className: "flex flex-wrap gap-2 border-t border-border-subtle pt-4",
723
+ children: [
724
+ /* @__PURE__ */ k("button", {
725
+ type: "button",
726
+ onClick: i,
727
+ className: "inline-flex items-center gap-1.5 rounded-md border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
728
+ children: [/* @__PURE__ */ O(C, { className: "h-3.5 w-3.5" }), "Edit"]
729
+ }),
730
+ /* @__PURE__ */ k("button", {
731
+ type: "button",
732
+ onClick: u,
733
+ className: "inline-flex items-center gap-1.5 rounded-md bg-action-primary-bg px-3 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90",
734
+ children: [/* @__PURE__ */ O(S, { className: "h-3.5 w-3.5" }), "Use in Campaign"]
735
+ }),
736
+ /* @__PURE__ */ k("button", {
737
+ type: "button",
738
+ onClick: p,
739
+ className: "inline-flex items-center gap-1.5 rounded-md border border-border-subtle px-3 py-2 text-sm font-medium text-status-error-text hover:bg-bg-sunken",
740
+ children: [/* @__PURE__ */ O(T, { className: "h-3.5 w-3.5" }), "Delete"]
741
+ })
742
+ ]
585
743
  })
586
744
  ]
587
- }),
588
- /* @__PURE__ */ E("div", {
589
- className: "space-y-2",
590
- children: [/* @__PURE__ */ E("div", {
591
- className: "flex items-center gap-2 text-xs text-text-secondary",
592
- children: [
593
- /* @__PURE__ */ T(b, { className: "h-3.5 w-3.5" }),
594
- /* @__PURE__ */ E("span", { children: [
595
- "Ages ",
596
- e.demographics.ageRange.min,
597
- "-",
598
- e.demographics.ageRange.max
599
- ] }),
600
- /* @__PURE__ */ T("span", { children: "·" }),
601
- /* @__PURE__ */ T("span", {
602
- className: "capitalize",
603
- children: e.demographics.genders.join(", ")
604
- })
605
- ]
606
- }), /* @__PURE__ */ E("div", {
607
- className: "flex items-center gap-2 text-xs text-text-secondary",
608
- children: [/* @__PURE__ */ T(h, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ T("span", { children: e.demographics.locations.join(", ") })]
609
- })]
610
- }),
611
- /* @__PURE__ */ E("div", {
612
- className: "flex flex-wrap gap-1",
613
- children: [e.interests.slice(0, 4).map((e) => /* @__PURE__ */ T("span", {
614
- className: "rounded-full border border-border-subtle px-2 py-0.5 text-[10px] text-text-secondary",
615
- children: e
616
- }, e)), e.interests.length > 4 && /* @__PURE__ */ E("span", {
617
- className: "text-[10px] text-text-secondary",
618
- children: [
619
- "+",
620
- e.interests.length - 4,
621
- " more"
622
- ]
623
- })]
624
- }),
625
- /* @__PURE__ */ E("div", {
626
- className: "flex flex-wrap items-center gap-2 border-t border-border-subtle pt-2",
627
- children: [/* @__PURE__ */ T("button", {
628
- onClick: i,
629
- className: "flex-1 rounded-md border border-border-subtle py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken",
630
- children: "Edit"
631
- }), /* @__PURE__ */ T("button", {
632
- onClick: l,
633
- className: "flex-1 rounded-md border border-border-subtle py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken",
634
- children: "Use in Campaign"
635
- })]
636
- })
637
- ]
638
- }));
745
+ })]
746
+ });
747
+ };
639
748
  //#endregion
640
- export { M as AudiencesPage };
749
+ export { F as AudiencesPage };
641
750
 
642
751
  //# sourceMappingURL=AudiencesPage.js.map