@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.
- package/dist/generated/wspace-operations.d.ts +2 -0
- package/dist/generated/wspace-operations.d.ts.map +1 -1
- package/dist/generated/wspace-operations.js +2 -0
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/headshotmarketing/pages/ads/AdCampaignsPage.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/ads/AdCampaignsPage.js +474 -386
- package/dist/headshotmarketing/pages/ads/AdCampaignsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/ads/AdPlatformConnectionsSection.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/ads/AdPlatformConnectionsSection.js +94 -94
- package/dist/headshotmarketing/pages/ads/AdPlatformConnectionsSection.js.map +1 -1
- package/dist/headshotmarketing/pages/ads/AudiencesPage.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/ads/AudiencesPage.js +448 -339
- package/dist/headshotmarketing/pages/ads/AudiencesPage.js.map +1 -1
- package/dist/headshotmarketing/pages/ads/CreateAdCampaignPage.d.ts +7 -0
- package/dist/headshotmarketing/pages/ads/CreateAdCampaignPage.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/ads/CreateAdCampaignPage.js +463 -446
- package/dist/headshotmarketing/pages/ads/CreateAdCampaignPage.js.map +1 -1
- package/dist/headshotmarketing/pages/ads/adCampaignStepper.d.ts +53 -0
- package/dist/headshotmarketing/pages/ads/adCampaignStepper.d.ts.map +1 -0
- package/dist/headshotmarketing/pages/ads/adCampaignStepper.js +151 -0
- package/dist/headshotmarketing/pages/ads/adCampaignStepper.js.map +1 -0
- package/dist/headshotmarketing/pages/ads/audienceDetails.d.ts +31 -0
- package/dist/headshotmarketing/pages/ads/audienceDetails.d.ts.map +1 -0
- package/dist/headshotmarketing/pages/ads/audienceDetails.js +64 -0
- package/dist/headshotmarketing/pages/ads/audienceDetails.js.map +1 -0
- package/dist/headshotmarketing/types/index.d.ts +14 -1
- package/dist/headshotmarketing/types/index.d.ts.map +1 -1
- package/dist/headshotmarketing/utils/adsMapper.d.ts +6 -1
- package/dist/headshotmarketing/utils/adsMapper.d.ts.map +1 -1
- package/dist/headshotmarketing/utils/adsMapper.js +27 -11
- package/dist/headshotmarketing/utils/adsMapper.js.map +1 -1
- package/dist/utils/pageContext.d.ts +60 -15
- package/dist/utils/pageContext.d.ts.map +1 -1
- package/dist/utils/pageContext.js +77 -57
- package/dist/utils/pageContext.js.map +1 -1
- 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 {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
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
|
|
13
|
-
import { usePagination as
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { Fragment as
|
|
18
|
-
import {
|
|
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
|
|
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
|
-
|
|
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
|
-
],
|
|
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
|
|
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
|
|
59
|
-
let { navigate: a, basePath:
|
|
60
|
-
|
|
61
|
-
let e = setTimeout(() =>
|
|
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
|
-
}, [
|
|
64
|
-
|
|
65
|
-
}, [
|
|
66
|
-
let { data:
|
|
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:
|
|
77
|
+
search: u || null
|
|
71
78
|
},
|
|
72
79
|
errorPolicy: "all",
|
|
73
80
|
notifyOnNetworkStatusChange: !0
|
|
74
|
-
}),
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}, [
|
|
78
|
-
let
|
|
79
|
-
|
|
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 (!
|
|
90
|
-
|
|
88
|
+
if (!T.name.trim()) {
|
|
89
|
+
R("Audience name is required.");
|
|
91
90
|
return;
|
|
92
91
|
}
|
|
93
|
-
|
|
92
|
+
R(null);
|
|
94
93
|
try {
|
|
95
94
|
await de({ variables: { input: {
|
|
96
|
-
name:
|
|
97
|
-
description:
|
|
98
|
-
estimatedSize:
|
|
99
|
-
isActive:
|
|
100
|
-
targetingCriteria:
|
|
101
|
-
} } }),
|
|
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
|
-
|
|
112
|
+
R(e instanceof Error ? e.message : "Failed to update audience.");
|
|
113
|
+
} finally {
|
|
114
|
+
y(null);
|
|
104
115
|
}
|
|
105
116
|
}, me = (e) => {
|
|
106
|
-
|
|
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 (
|
|
123
|
-
if (!
|
|
124
|
-
|
|
133
|
+
if (A) {
|
|
134
|
+
if (!A.form.name.trim()) {
|
|
135
|
+
R("Audience name is required.");
|
|
125
136
|
return;
|
|
126
137
|
}
|
|
127
|
-
|
|
138
|
+
R(null);
|
|
128
139
|
try {
|
|
129
|
-
await
|
|
130
|
-
id:
|
|
140
|
+
await Y({ variables: {
|
|
141
|
+
id: A.id,
|
|
131
142
|
input: {
|
|
132
|
-
name:
|
|
133
|
-
description:
|
|
134
|
-
estimatedSize:
|
|
135
|
-
isActive:
|
|
136
|
-
targetingCriteria:
|
|
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
|
-
} }),
|
|
149
|
+
} }), j(null), await Q();
|
|
139
150
|
} catch (e) {
|
|
140
|
-
|
|
151
|
+
R(e instanceof Error ? e.message : "Failed to save audience.");
|
|
141
152
|
}
|
|
142
153
|
}
|
|
143
154
|
}, ge = async () => {
|
|
144
|
-
if (
|
|
145
|
-
|
|
155
|
+
if (M) {
|
|
156
|
+
R(null);
|
|
146
157
|
try {
|
|
147
|
-
await fe({ variables: { id:
|
|
158
|
+
await fe({ variables: { id: M.id } }), f === M.id && _(null), F(null), await Q();
|
|
148
159
|
} catch (e) {
|
|
149
|
-
|
|
160
|
+
R(e instanceof Error ? e.message : "Failed to delete audience.");
|
|
150
161
|
}
|
|
151
162
|
}
|
|
152
163
|
}, _e = (e) => {
|
|
153
|
-
|
|
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__ */
|
|
169
|
+
return /* @__PURE__ */ k(m, {
|
|
159
170
|
title: "Audiences",
|
|
160
171
|
description: "Create and manage your target audiences",
|
|
161
|
-
actions: /* @__PURE__ */
|
|
172
|
+
actions: /* @__PURE__ */ k("button", {
|
|
162
173
|
onClick: () => {
|
|
163
|
-
|
|
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__ */
|
|
177
|
+
children: [/* @__PURE__ */ O(w, { className: "h-4 w-4" }), "New Audience"]
|
|
167
178
|
}),
|
|
168
179
|
children: [
|
|
169
|
-
/* @__PURE__ */
|
|
170
|
-
/* @__PURE__ */
|
|
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__ */
|
|
183
|
+
children: /* @__PURE__ */ O("input", {
|
|
206
184
|
type: "text",
|
|
207
|
-
value:
|
|
208
|
-
onChange: (e) =>
|
|
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
|
-
|
|
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:
|
|
194
|
+
children: L
|
|
217
195
|
}),
|
|
218
|
-
/* @__PURE__ */
|
|
219
|
-
loading:
|
|
196
|
+
/* @__PURE__ */ O(ee, {
|
|
197
|
+
loading: U,
|
|
220
198
|
error: ue,
|
|
221
|
-
onRetry:
|
|
222
|
-
hasData: !!
|
|
223
|
-
children:
|
|
224
|
-
illustration:
|
|
225
|
-
title:
|
|
226
|
-
description:
|
|
227
|
-
action:
|
|
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
|
-
|
|
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__ */
|
|
210
|
+
children: [/* @__PURE__ */ O(w, { className: "h-4 w-4" }), "Create Audience"]
|
|
233
211
|
}) : void 0
|
|
234
|
-
}) : /* @__PURE__ */
|
|
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:
|
|
214
|
+
children: K.map((e) => /* @__PURE__ */ O(oe, {
|
|
237
215
|
audience: e,
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
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__ */
|
|
248
|
-
page:
|
|
249
|
-
pageSize:
|
|
250
|
-
total:
|
|
251
|
-
onPageChange:
|
|
252
|
-
onPageSizeChange:
|
|
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:
|
|
232
|
+
disabled: U,
|
|
259
233
|
hideWhenSinglePage: !0
|
|
260
234
|
})] })
|
|
261
235
|
}),
|
|
262
|
-
/* @__PURE__ */
|
|
263
|
-
|
|
264
|
-
|
|
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__ */
|
|
269
|
-
onClick: () =>
|
|
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__ */
|
|
255
|
+
}), /* @__PURE__ */ O("button", {
|
|
273
256
|
onClick: pe,
|
|
274
|
-
disabled:
|
|
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:
|
|
259
|
+
children: J ? "Creating..." : "Create Audience"
|
|
277
260
|
})] }),
|
|
278
|
-
children: /* @__PURE__ */
|
|
279
|
-
form:
|
|
280
|
-
onChange:
|
|
281
|
-
error:
|
|
261
|
+
children: /* @__PURE__ */ O(I, {
|
|
262
|
+
form: T,
|
|
263
|
+
onChange: E,
|
|
264
|
+
error: L
|
|
282
265
|
})
|
|
283
266
|
}),
|
|
284
|
-
/* @__PURE__ */
|
|
285
|
-
open:
|
|
286
|
-
onClose: () =>
|
|
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__ */
|
|
291
|
-
onClick: () =>
|
|
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__ */
|
|
277
|
+
}), /* @__PURE__ */ O("button", {
|
|
295
278
|
onClick: he,
|
|
296
|
-
disabled:
|
|
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:
|
|
281
|
+
children: X ? "Saving..." : "Save Changes"
|
|
299
282
|
})] }),
|
|
300
|
-
children:
|
|
301
|
-
form:
|
|
302
|
-
onChange: (e) =>
|
|
303
|
-
...
|
|
283
|
+
children: A && /* @__PURE__ */ O(I, {
|
|
284
|
+
form: A.form,
|
|
285
|
+
onChange: (e) => j({
|
|
286
|
+
...A,
|
|
304
287
|
form: e
|
|
305
288
|
}),
|
|
306
|
-
error:
|
|
289
|
+
error: L
|
|
307
290
|
})
|
|
308
291
|
}),
|
|
309
|
-
/* @__PURE__ */
|
|
310
|
-
open:
|
|
311
|
-
onClose: () =>
|
|
292
|
+
/* @__PURE__ */ O(g, {
|
|
293
|
+
open: M !== null,
|
|
294
|
+
onClose: () => F(null),
|
|
312
295
|
title: "Delete Audience",
|
|
313
296
|
size: "sm",
|
|
314
|
-
footer: /* @__PURE__ */
|
|
315
|
-
onClick: () =>
|
|
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__ */
|
|
301
|
+
}), /* @__PURE__ */ O("button", {
|
|
319
302
|
onClick: ge,
|
|
320
|
-
disabled:
|
|
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:
|
|
305
|
+
children: Z ? "Deleting..." : "Delete"
|
|
323
306
|
})] }),
|
|
324
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
312
|
+
/* @__PURE__ */ O("span", {
|
|
330
313
|
className: "font-semibold text-text-primary",
|
|
331
|
-
children:
|
|
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
|
-
},
|
|
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__ */
|
|
330
|
+
return /* @__PURE__ */ k("div", {
|
|
348
331
|
className: "space-y-4",
|
|
349
332
|
children: [
|
|
350
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
358
|
+
/* @__PURE__ */ k("div", {
|
|
376
359
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
|
|
377
360
|
children: [
|
|
378
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
402
|
+
}), /* @__PURE__ */ O("div", {
|
|
420
403
|
className: "flex flex-wrap gap-2",
|
|
421
|
-
children:
|
|
404
|
+
children: M.map((t) => /* @__PURE__ */ O("button", {
|
|
422
405
|
type: "button",
|
|
423
406
|
onClick: () => r(t),
|
|
424
|
-
className:
|
|
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__ */
|
|
411
|
+
/* @__PURE__ */ k("div", {
|
|
429
412
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
430
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
436
|
+
/* @__PURE__ */ O("option", {
|
|
454
437
|
value: "google_ads",
|
|
455
438
|
children: "Google Ads"
|
|
456
439
|
}),
|
|
457
|
-
/* @__PURE__ */
|
|
440
|
+
/* @__PURE__ */ O("option", {
|
|
458
441
|
value: "facebook",
|
|
459
442
|
children: "Facebook"
|
|
460
443
|
}),
|
|
461
|
-
/* @__PURE__ */
|
|
444
|
+
/* @__PURE__ */ O("option", {
|
|
462
445
|
value: "instagram",
|
|
463
446
|
children: "Instagram"
|
|
464
447
|
}),
|
|
465
|
-
/* @__PURE__ */
|
|
448
|
+
/* @__PURE__ */ O("option", {
|
|
466
449
|
value: "linkedin",
|
|
467
450
|
children: "LinkedIn"
|
|
468
451
|
}),
|
|
469
|
-
/* @__PURE__ */
|
|
452
|
+
/* @__PURE__ */ O("option", {
|
|
470
453
|
value: "twitter",
|
|
471
454
|
children: "Twitter"
|
|
472
455
|
})
|
|
473
456
|
]
|
|
474
457
|
})] })]
|
|
475
458
|
}),
|
|
476
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
472
|
+
/* @__PURE__ */ k("label", {
|
|
490
473
|
className: "flex items-center gap-2 text-sm text-text-primary",
|
|
491
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
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
|
-
},
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
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
|
-
}),
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
"
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
className: "
|
|
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
|
-
|
|
535
|
-
|
|
536
|
-
|
|
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
|
-
|
|
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__ */
|
|
560
|
-
className:
|
|
561
|
-
children:
|
|
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__ */
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
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__ */
|
|
579
|
-
|
|
580
|
-
children: "
|
|
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
|
-
|
|
583
|
-
className: "
|
|
584
|
-
children: [
|
|
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
|
-
|
|
589
|
-
|
|
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 {
|
|
749
|
+
export { F as AudiencesPage };
|
|
641
750
|
|
|
642
751
|
//# sourceMappingURL=AudiencesPage.js.map
|