@burdenoff/microfe-headshotmarketing 2026.1030.2 → 2026.1030.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/dist/generated/wspace-operations.d.ts +0 -2
  2. package/dist/generated/wspace-operations.d.ts.map +1 -1
  3. package/dist/generated/wspace-operations.js +0 -2
  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 +386 -474
  7. package/dist/headshotmarketing/pages/ads/AdCampaignsPage.js.map +1 -1
  8. package/dist/headshotmarketing/pages/ads/AudiencesPage.d.ts.map +1 -1
  9. package/dist/headshotmarketing/pages/ads/AudiencesPage.js +339 -448
  10. package/dist/headshotmarketing/pages/ads/AudiencesPage.js.map +1 -1
  11. package/dist/headshotmarketing/pages/ads/CreateAdCampaignPage.d.ts +0 -7
  12. package/dist/headshotmarketing/pages/ads/CreateAdCampaignPage.d.ts.map +1 -1
  13. package/dist/headshotmarketing/pages/ads/CreateAdCampaignPage.js +446 -463
  14. package/dist/headshotmarketing/pages/ads/CreateAdCampaignPage.js.map +1 -1
  15. package/dist/headshotmarketing/types/index.d.ts +1 -14
  16. package/dist/headshotmarketing/types/index.d.ts.map +1 -1
  17. package/dist/headshotmarketing/utils/adsMapper.d.ts +1 -6
  18. package/dist/headshotmarketing/utils/adsMapper.d.ts.map +1 -1
  19. package/dist/headshotmarketing/utils/adsMapper.js +11 -27
  20. package/dist/headshotmarketing/utils/adsMapper.js.map +1 -1
  21. package/package.json +1 -1
  22. package/dist/headshotmarketing/pages/ads/adCampaignStepper.d.ts +0 -53
  23. package/dist/headshotmarketing/pages/ads/adCampaignStepper.d.ts.map +0 -1
  24. package/dist/headshotmarketing/pages/ads/adCampaignStepper.js +0 -151
  25. package/dist/headshotmarketing/pages/ads/adCampaignStepper.js.map +0 -1
  26. package/dist/headshotmarketing/pages/ads/audienceDetails.d.ts +0 -31
  27. package/dist/headshotmarketing/pages/ads/audienceDetails.d.ts.map +0 -1
  28. package/dist/headshotmarketing/pages/ads/audienceDetails.js +0 -64
  29. package/dist/headshotmarketing/pages/ads/audienceDetails.js.map +0 -1
@@ -1,125 +1,107 @@
1
1
  import { useCreateHeadshotmarketingAdCampaignMutation as e, useDeleteHeadshotmarketingAdCampaignMutation as t, useHeadshotmarketingAdCampaignsListQuery as n, useUpdateHeadshotmarketingAdCampaignMutation as r } from "../../../generated/wspace-operations.js";
2
2
  import { useHeadshotMarketing as i } from "../../context/HeadshotMarketingContext.js";
3
- import { cn as a, formatCurrency as o, formatNumber as s, formatPercentage as ee } from "../../utils/helpers.js";
4
- import { HeadshotmarketingAdCampaignStatus as c, HeadshotmarketingAdPlatform as l } from "../../../generated/wspace-types.js";
5
- import { toAdCampaignModel as u, toAdCampaignStatusEnum as d, toAdPlatformEnum as f } from "../../utils/adsMapper.js";
6
- import { PageLayout as p } from "../../components/PageLayout.js";
7
- import { StatCard as m } from "../../components/StatCard.js";
8
- import { StatusBadge as h } from "../../components/StatusBadge.js";
3
+ import { cn as a, formatCurrency as o, formatNumber as s, formatPercentage as c } from "../../utils/helpers.js";
4
+ import { HeadshotmarketingAdCampaignStatus as l, HeadshotmarketingAdPlatform as u } from "../../../generated/wspace-types.js";
5
+ import { toAdCampaignModel as d, toAdCampaignStatusEnum as f, toAdPlatformEnum as p } from "../../utils/adsMapper.js";
6
+ import { PageLayout as ee } from "../../components/PageLayout.js";
7
+ import { StatusBadge as m } from "../../components/StatusBadge.js";
9
8
  import { EmptyState as te } from "../../components/EmptyState.js";
10
9
  import { FilterBar as ne } from "../../components/FilterBar.js";
11
- import { Modal as g } from "../../components/Modal.js";
10
+ import { Modal as h } from "../../components/Modal.js";
12
11
  import { QueryStateBoundary as re } from "../../components/QueryStateBoundary.js";
13
12
  import { Pagination as ie } from "../../components/Pagination.js";
14
13
  import "../../components/index.js";
15
14
  import { useHeadshotmarketingBootstrap as ae } from "../../hooks/useHeadshotmarketingBootstrap.js";
16
15
  import { usePagination as oe } from "../../hooks/usePagination.js";
17
- import { platformLabel as _, renderPlatformIcon as v } from "./AdPlatformChips.js";
18
- import { useEffect as y, useMemo as b, useState as x } from "react";
19
- import { Copy as S, DollarSign as se, Eye as ce, Megaphone as le, MoreHorizontal as C, MousePointerClick as ue, Pause as de, Pencil as fe, Play as pe, Plus as w, Settings2 as T, Trash2 as E, TrendingUp as me } from "lucide-react";
20
- import { useExclusiveMenu as D } from "@burdenoff/fe-libs/shared/hooks";
21
- import { Fragment as O, jsx as k, jsxs as A } from "react/jsx-runtime";
22
- import { PagePurpose as he } from "@burdenoff/fe-libs/ui";
16
+ import { useEffect as g, useMemo as _, useState as v } from "react";
17
+ import { Copy as y, DollarSign as b, Eye as x, MoreHorizontal as S, MousePointerClick as C, Pause as w, Pencil as T, Play as E, Plus as D, Settings2 as O, Trash2 as k, TrendingUp as A } from "lucide-react";
18
+ import { useExclusiveMenu as j } from "@burdenoff/fe-libs/shared/hooks";
19
+ import { Fragment as M, jsx as N, jsxs as P } from "react/jsx-runtime";
20
+ import { EmphasisPanel as se, PagePurpose as ce } from "@burdenoff/fe-libs/ui";
23
21
  //#region src/headshotmarketing/pages/ads/AdCampaignsPage.tsx
24
- var ge = {
25
- active: c.Active,
26
- paused: c.Paused,
27
- completed: c.Completed,
28
- draft: c.Draft
29
- }, _e = {
30
- google_ads: l.GoogleAds,
31
- facebook: l.FacebookAds,
32
- instagram: l.InstagramAds,
33
- linkedin: l.LinkedinAds,
34
- twitter: l.TwitterAds,
35
- tiktok: l.TiktokAds
22
+ var F = {
23
+ google_ads: "Google Ads",
24
+ facebook: "Facebook",
25
+ instagram: "Instagram",
26
+ linkedin: "LinkedIn",
27
+ twitter: "Twitter"
28
+ }, I = {
29
+ google_ads: "bg-status-info-bg text-status-info-text",
30
+ facebook: "bg-status-info-bg text-status-info-text",
31
+ instagram: "bg-[var(--color-accent-soft)] text-action-primary-bg",
32
+ linkedin: "bg-status-info-bg text-status-info-text",
33
+ twitter: "bg-status-info-bg text-status-info-text"
34
+ }, le = {
35
+ active: l.Active,
36
+ paused: l.Paused,
37
+ completed: l.Completed,
38
+ draft: l.Draft
39
+ }, ue = {
40
+ google_ads: u.GoogleAds,
41
+ facebook: u.FacebookAds,
42
+ instagram: u.InstagramAds,
43
+ linkedin: u.LinkedinAds,
44
+ twitter: u.TwitterAds
36
45
  };
37
- function j(e) {
46
+ function L(e) {
38
47
  if (!e) return "";
39
48
  let t = new Date(e);
40
49
  return Number.isNaN(t.getTime()) ? "" : t.toISOString().slice(0, 10);
41
50
  }
42
- var M = () => {
43
- let { navigate: a, basePath: ee } = i(), l = (e) => a(ee + e), { data: h, refetch: _ } = ae(), [v, S] = x(""), [C, fe] = x(""), [T, E] = x("all"), [D, M] = x("all"), [N, P] = x(null), [F, I] = x(null), [L, R] = x(null), [z, B] = x(null), [V, H] = x(/* @__PURE__ */ new Set()), [ye, U] = x(!1), W = oe({ initialPageSize: 10 }), { limit: be, offset: xe, setPage: G, setTotal: K } = W;
44
- y(() => {
45
- let e = setTimeout(() => fe(v), 300);
51
+ var R = () => {
52
+ let { navigate: a, basePath: c } = i(), u = (e) => a(c + e), { data: m, refetch: y } = ae(), [b, x] = v(""), [S, C] = v(""), [w, T] = v("all"), [E, O] = v("all"), [k, A] = v(null), [j, F] = v(null), [I, R] = v(null), [z, B] = v(null), V = oe({ initialPageSize: 10 }), { limit: fe, offset: pe, setPage: H, setTotal: U } = V;
53
+ g(() => {
54
+ let e = setTimeout(() => C(b), 300);
46
55
  return () => clearTimeout(e);
47
- }, [v]), y(() => {
48
- G(1);
56
+ }, [b]), g(() => {
57
+ H(1);
49
58
  }, [
50
- C,
51
- T,
52
- D,
53
- G
59
+ S,
60
+ w,
61
+ E,
62
+ H
54
63
  ]);
55
- let { data: q, loading: Se, error: Ce, refetch: we } = n({
64
+ let { data: W, loading: G, error: me, refetch: K } = n({
56
65
  variables: {
57
- limit: be,
58
- offset: xe,
59
- search: C || null,
60
- status: ge[T] ?? null,
61
- platform: _e[D] ?? null
66
+ limit: fe,
67
+ offset: pe,
68
+ search: S || null,
69
+ status: le[w] ?? null,
70
+ platform: ue[E] ?? null
62
71
  },
63
72
  errorPolicy: "all",
64
73
  notifyOnNetworkStatusChange: !0
65
- }), J = q?.headshotmarketingAdCampaigns.total ?? 0;
66
- y(() => {
67
- K(J);
68
- }, [J, K]);
69
- let Y = b(() => (q?.headshotmarketingAdCampaigns.items ?? []).map((e) => u(e)), [q?.headshotmarketingAdCampaigns.items]), X = b(() => {
70
- let e = h?.headshotmarketingAdMetrics, t = (h?.headshotmarketingAdCampaigns.items ?? []).map((e) => u(e)), n = t.filter((e) => e.metrics.roas > 0), r = n.length > 0 ? n.reduce((e, t) => e + t.metrics.roas, 0) / n.length : 0;
74
+ }), q = W?.headshotmarketingAdCampaigns.total ?? 0;
75
+ g(() => {
76
+ U(q);
77
+ }, [q, U]);
78
+ let J = _(() => (W?.headshotmarketingAdCampaigns.items ?? []).map((e) => d(e)), [W?.headshotmarketingAdCampaigns.items]), Y = _(() => {
79
+ let e = (m?.headshotmarketingAdCampaigns.items ?? []).map((e) => d(e)), t = e.filter((e) => e.status === "active").length, n = e.reduce((e, t) => e + t.metrics.spend, 0), r = e.reduce((e, t) => e + t.metrics.impressions, 0), i = e.filter((e) => e.metrics.roas > 0);
71
80
  return {
72
- active: e?.activeAdCampaigns ?? t.filter((e) => e.status === "active").length,
73
- totalSpend: e?.totalSpent ?? t.reduce((e, t) => e + t.metrics.spend, 0),
74
- totalImpressions: e?.totalImpressions ?? 0,
75
- totalClicks: e?.totalClicks ?? 0,
76
- avgRoas: r
81
+ active: t,
82
+ totalSpend: n,
83
+ totalImpressions: r,
84
+ avgRoas: i.length > 0 ? i.reduce((e, t) => e + t.metrics.roas, 0) / i.length : 0
77
85
  };
78
- }, [h?.headshotmarketingAdCampaigns.items, h?.headshotmarketingAdMetrics]);
79
- y(() => {
80
- H((e) => {
81
- let t = new Set(Y.map((e) => e.id)), n = new Set([...e].filter((e) => t.has(e)));
82
- return n.size === e.size ? e : n;
83
- });
84
- }, [Y]);
85
- let Te = Y.length > 0 && Y.every((e) => V.has(e.id)), Ee = (e) => {
86
- H((t) => {
87
- let n = new Set(t);
88
- return n.has(e) ? n.delete(e) : n.add(e), n;
89
- });
90
- }, De = () => {
91
- H(Te ? /* @__PURE__ */ new Set() : new Set(Y.map((e) => e.id)));
92
- }, [Oe] = e(), [Z, { loading: Q }] = r(), [ke, { loading: Ae }] = t(), $ = async () => {
93
- await Promise.all([we(), _()]);
94
- }, je = async (e) => {
95
- P(null), B(null);
86
+ }, [m?.headshotmarketingAdCampaigns.items]), [he] = e(), [X, { loading: Z }] = r(), [ge, { loading: Q }] = t(), $ = async () => {
87
+ await Promise.all([K(), y()]);
88
+ }, _e = async (e) => {
89
+ A(null), B(null);
96
90
  try {
97
- await Z({ variables: {
91
+ await X({ variables: {
98
92
  id: e.id,
99
- input: { status: e.status === "active" ? c.Paused : c.Active }
93
+ input: { status: e.status === "active" ? l.Paused : l.Active }
100
94
  } }), await $();
101
95
  } catch (e) {
102
96
  B(e instanceof Error ? e.message : "Failed to update campaign.");
103
97
  }
104
- }, Me = async (e) => {
105
- B(null), U(!0);
106
- try {
107
- await Promise.all([...V].map((t) => Z({ variables: {
108
- id: t,
109
- input: { status: e }
110
- } }))), H(/* @__PURE__ */ new Set()), await $();
111
- } catch (e) {
112
- B(e instanceof Error ? e.message : "Failed to update campaigns.");
113
- } finally {
114
- U(!1);
115
- }
116
- }, Ne = async (e) => {
117
- P(null), B(null);
98
+ }, ve = async (e) => {
99
+ A(null), B(null);
118
100
  try {
119
- await Oe({ variables: { input: {
101
+ await he({ variables: { input: {
120
102
  name: `${e.name} (Copy)`,
121
- platform: f(e.platform),
122
- status: c.Draft,
103
+ platform: p(e.platform),
104
+ status: l.Draft,
123
105
  bidStrategy: e.bidStrategy,
124
106
  totalBudget: e.budget.total > 0 ? e.budget.total : null,
125
107
  startDate: e.startDate ? new Date(e.startDate).toISOString() : null,
@@ -129,447 +111,340 @@ var M = () => {
129
111
  } catch (e) {
130
112
  B(e instanceof Error ? e.message : "Failed to duplicate campaign.");
131
113
  }
132
- }, Pe = async () => {
133
- if (!F) return;
134
- if (!F.name.trim()) {
114
+ }, ye = async () => {
115
+ if (!j) return;
116
+ if (!j.name.trim()) {
135
117
  B("Campaign name is required.");
136
118
  return;
137
119
  }
138
120
  B(null);
139
- let e = Number(F.totalBudget);
121
+ let e = Number(j.totalBudget);
140
122
  try {
141
- await Z({ variables: {
142
- id: F.id,
123
+ await X({ variables: {
124
+ id: j.id,
143
125
  input: {
144
- name: F.name.trim(),
145
- status: d(F.status),
146
- bidStrategy: F.bidStrategy || null,
147
- totalBudget: F.totalBudget && Number.isFinite(e) ? e : null,
148
- startDate: F.startDate ? new Date(F.startDate).toISOString() : null,
149
- endDate: F.endDate ? new Date(F.endDate).toISOString() : null
126
+ name: j.name.trim(),
127
+ status: f(j.status),
128
+ bidStrategy: j.bidStrategy || null,
129
+ totalBudget: j.totalBudget && Number.isFinite(e) ? e : null,
130
+ startDate: j.startDate ? new Date(j.startDate).toISOString() : null,
131
+ endDate: j.endDate ? new Date(j.endDate).toISOString() : null
150
132
  }
151
- } }), I(null), await $();
133
+ } }), F(null), await $();
152
134
  } catch (e) {
153
135
  B(e instanceof Error ? e.message : "Failed to save campaign.");
154
136
  }
155
- }, Fe = async () => {
156
- if (L) {
137
+ }, be = async () => {
138
+ if (I) {
157
139
  B(null);
158
140
  try {
159
- await ke({ variables: { id: L.id } }), R(null), await $();
141
+ await ge({ variables: { id: I.id } }), R(null), await $();
160
142
  } catch (e) {
161
143
  B(e instanceof Error ? e.message : "Failed to delete campaign.");
162
144
  }
163
145
  }
164
- }, Ie = (e) => {
165
- P(null), B(null), I({
146
+ }, xe = (e) => {
147
+ A(null), B(null), F({
166
148
  id: e.id,
167
149
  name: e.name,
168
150
  status: e.status,
169
151
  totalBudget: e.budget.total > 0 ? String(e.budget.total) : "",
170
152
  bidStrategy: e.bidStrategy,
171
- startDate: j(e.startDate),
172
- endDate: j(e.endDate)
153
+ startDate: L(e.startDate),
154
+ endDate: L(e.endDate)
173
155
  });
174
156
  };
175
- return /* @__PURE__ */ A(p, {
157
+ return /* @__PURE__ */ P(ee, {
176
158
  title: "Ad Campaigns",
177
159
  description: "Create and manage your advertising campaigns",
178
- actions: /* @__PURE__ */ A("button", {
179
- onClick: () => l("/ads/campaigns/new"),
160
+ actions: /* @__PURE__ */ P("button", {
161
+ onClick: () => u("/ads/campaigns/new"),
180
162
  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",
181
- children: [/* @__PURE__ */ k(w, { className: "h-4 w-4" }), "New Ad Campaign"]
163
+ children: [/* @__PURE__ */ N(D, { className: "h-4 w-4" }), "Create Campaign"]
182
164
  }),
183
165
  children: [
184
- /* @__PURE__ */ k(he, { children: "A focused view of every ad campaign — filter by platform or status, watch budget pacing at a glance, and pause, edit or duplicate any campaign without leaving the list." }),
185
- /* @__PURE__ */ A("div", {
186
- className: "grid grid-cols-2 gap-4 md:grid-cols-3 xl:grid-cols-5",
166
+ /* @__PURE__ */ N(ce, { children: "A focused view of every ad campaign — filter by platform or status, watch budget pacing at a glance, and pause, edit or duplicate any campaign without leaving the list." }),
167
+ /* @__PURE__ */ N(se, { children: /* @__PURE__ */ P("div", {
168
+ className: "grid grid-cols-2 gap-4 sm:grid-cols-4",
187
169
  children: [
188
- /* @__PURE__ */ k(m, {
189
- featured: !0,
190
- title: "Total Ad Spend",
191
- value: o(X.totalSpend),
192
- icon: /* @__PURE__ */ k(se, { className: "h-4 w-4" })
193
- }),
194
- /* @__PURE__ */ k(m, {
195
- title: "Active Ad Campaigns",
196
- value: s(X.active),
197
- icon: /* @__PURE__ */ k(le, { className: "h-4 w-4" })
198
- }),
199
- /* @__PURE__ */ k(m, {
200
- title: "Impressions",
201
- value: s(X.totalImpressions),
202
- icon: /* @__PURE__ */ k(ce, { className: "h-4 w-4" })
203
- }),
204
- /* @__PURE__ */ k(m, {
205
- title: "Clicks",
206
- value: s(X.totalClicks),
207
- icon: /* @__PURE__ */ k(ue, { className: "h-4 w-4" })
208
- }),
209
- /* @__PURE__ */ k(m, {
210
- title: "Avg ROAS",
211
- value: `${X.avgRoas.toFixed(1)}x`,
212
- icon: /* @__PURE__ */ k(me, { className: "h-4 w-4" })
213
- })
170
+ /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
171
+ className: "text-xs text-text-secondary",
172
+ children: "Active Campaigns"
173
+ }), /* @__PURE__ */ N("p", {
174
+ className: "text-2xl font-semibold text-text-primary",
175
+ children: s(Y.active)
176
+ })] }),
177
+ /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
178
+ className: "text-xs text-text-secondary",
179
+ children: "Total Spend"
180
+ }), /* @__PURE__ */ N("p", {
181
+ className: "text-2xl font-semibold text-text-primary",
182
+ children: o(Y.totalSpend)
183
+ })] }),
184
+ /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
185
+ className: "text-xs text-text-secondary",
186
+ children: "Impressions"
187
+ }), /* @__PURE__ */ N("p", {
188
+ className: "text-2xl font-semibold text-text-primary",
189
+ children: s(Y.totalImpressions)
190
+ })] }),
191
+ /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
192
+ className: "text-xs text-text-secondary",
193
+ children: "Avg ROAS"
194
+ }), /* @__PURE__ */ P("p", {
195
+ className: "text-2xl font-semibold text-text-primary",
196
+ children: [Y.avgRoas.toFixed(1), "x"]
197
+ })] })
214
198
  ]
215
- }),
216
- /* @__PURE__ */ k(ne, {
217
- searchValue: v,
218
- onSearchChange: S,
199
+ }) }),
200
+ /* @__PURE__ */ N(ne, {
201
+ searchValue: b,
202
+ onSearchChange: x,
219
203
  searchPlaceholder: "Search campaigns...",
220
- filters: /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ A("select", {
221
- "aria-label": "Status",
222
- value: T,
223
- onChange: (e) => E(e.target.value),
204
+ filters: /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ P("select", {
205
+ value: w,
206
+ onChange: (e) => T(e.target.value),
224
207
  className: "rounded-md border border-border-seam bg-gloss-card shadow-pop px-3 py-2 text-sm text-text-primary",
225
208
  children: [
226
- /* @__PURE__ */ k("option", {
209
+ /* @__PURE__ */ N("option", {
227
210
  value: "all",
228
211
  children: "All Status"
229
212
  }),
230
- /* @__PURE__ */ k("option", {
213
+ /* @__PURE__ */ N("option", {
231
214
  value: "active",
232
215
  children: "Active"
233
216
  }),
234
- /* @__PURE__ */ k("option", {
217
+ /* @__PURE__ */ N("option", {
235
218
  value: "paused",
236
219
  children: "Paused"
237
220
  }),
238
- /* @__PURE__ */ k("option", {
221
+ /* @__PURE__ */ N("option", {
239
222
  value: "completed",
240
223
  children: "Completed"
241
224
  }),
242
- /* @__PURE__ */ k("option", {
225
+ /* @__PURE__ */ N("option", {
243
226
  value: "draft",
244
227
  children: "Draft"
245
228
  })
246
229
  ]
247
- }), /* @__PURE__ */ A("select", {
248
- "aria-label": "Platform",
249
- value: D,
250
- onChange: (e) => M(e.target.value),
230
+ }), /* @__PURE__ */ P("select", {
231
+ value: E,
232
+ onChange: (e) => O(e.target.value),
251
233
  className: "rounded-md border border-border-seam bg-gloss-card shadow-pop px-3 py-2 text-sm text-text-primary",
252
234
  children: [
253
- /* @__PURE__ */ k("option", {
235
+ /* @__PURE__ */ N("option", {
254
236
  value: "all",
255
237
  children: "All Platforms"
256
238
  }),
257
- /* @__PURE__ */ k("option", {
239
+ /* @__PURE__ */ N("option", {
258
240
  value: "google_ads",
259
241
  children: "Google Ads"
260
242
  }),
261
- /* @__PURE__ */ k("option", {
243
+ /* @__PURE__ */ N("option", {
262
244
  value: "facebook",
263
245
  children: "Facebook"
264
246
  }),
265
- /* @__PURE__ */ k("option", {
247
+ /* @__PURE__ */ N("option", {
266
248
  value: "instagram",
267
249
  children: "Instagram"
268
250
  }),
269
- /* @__PURE__ */ k("option", {
251
+ /* @__PURE__ */ N("option", {
270
252
  value: "linkedin",
271
253
  children: "LinkedIn"
272
254
  }),
273
- /* @__PURE__ */ k("option", {
255
+ /* @__PURE__ */ N("option", {
274
256
  value: "twitter",
275
257
  children: "Twitter"
276
- }),
277
- /* @__PURE__ */ k("option", {
278
- value: "tiktok",
279
- children: "TikTok"
280
258
  })
281
259
  ]
282
260
  })] })
283
261
  }),
284
- z && /* @__PURE__ */ k("div", {
262
+ z && /* @__PURE__ */ N("div", {
285
263
  role: "alert",
286
264
  className: "rounded-lg border border-status-error-border/30 bg-status-error-bg/10 px-4 py-3 text-sm text-status-error-text",
287
265
  children: z
288
266
  }),
289
- /* @__PURE__ */ k(re, {
290
- loading: Se,
291
- error: Ce,
292
- onRetry: we,
293
- hasData: !!q,
294
- children: Y.length === 0 ? /* @__PURE__ */ k(te, {
295
- illustration: J === 0 ? "empty-generic" : "empty-search",
296
- title: J === 0 ? "No ad campaigns yet" : "No campaigns match your filters",
297
- description: J === 0 ? "Create your first ad campaign to start running paid traffic." : "Try a different search term, platform or status.",
298
- action: J === 0 ? /* @__PURE__ */ A("button", {
299
- onClick: () => l("/ads/campaigns/new"),
267
+ /* @__PURE__ */ N(re, {
268
+ loading: G,
269
+ error: me,
270
+ onRetry: K,
271
+ hasData: !!W,
272
+ children: J.length === 0 ? /* @__PURE__ */ N(te, {
273
+ illustration: q === 0 ? "empty-generic" : "empty-search",
274
+ title: q === 0 ? "No ad campaigns yet" : "No campaigns match your filters",
275
+ description: q === 0 ? "Create your first ad campaign to start running paid traffic." : "Try a different search term, platform or status.",
276
+ action: q === 0 ? /* @__PURE__ */ P("button", {
277
+ onClick: () => u("/ads/campaigns/new"),
300
278
  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",
301
- children: [/* @__PURE__ */ k(w, { className: "h-4 w-4" }), "Create Campaign"]
279
+ children: [/* @__PURE__ */ N(D, { className: "h-4 w-4" }), "Create Campaign"]
302
280
  }) : void 0
303
- }) : /* @__PURE__ */ A(O, { children: [
304
- V.size > 0 && /* @__PURE__ */ A("div", {
305
- className: "flex flex-wrap items-center gap-2 rounded-lg border border-border-seam bg-bg-surface px-4 py-2 text-sm",
306
- children: [
307
- /* @__PURE__ */ A("span", {
308
- className: "font-medium text-text-primary",
309
- children: [V.size, " selected"]
310
- }),
311
- /* @__PURE__ */ A("button", {
312
- onClick: () => Me(c.Paused),
313
- disabled: ye,
314
- className: "inline-flex items-center gap-1.5 rounded-md border border-border-subtle px-3 py-1.5 text-text-primary hover:bg-bg-sunken disabled:opacity-60",
315
- children: [/* @__PURE__ */ k(de, { className: "h-3.5 w-3.5" }), "Pause"]
316
- }),
317
- /* @__PURE__ */ A("button", {
318
- onClick: () => Me(c.Active),
319
- disabled: ye,
320
- className: "inline-flex items-center gap-1.5 rounded-md border border-border-subtle px-3 py-1.5 text-text-primary hover:bg-bg-sunken disabled:opacity-60",
321
- children: [/* @__PURE__ */ k(pe, { className: "h-3.5 w-3.5" }), "Activate"]
322
- }),
323
- /* @__PURE__ */ k("button", {
324
- onClick: () => H(/* @__PURE__ */ new Set()),
325
- className: "ml-auto text-text-secondary hover:text-text-primary",
326
- children: "Clear"
327
- })
328
- ]
329
- }),
330
- /* @__PURE__ */ k("div", {
331
- className: "overflow-x-auto rounded-lg border border-border-seam bg-gloss-card shadow-pop",
332
- children: /* @__PURE__ */ A("table", {
333
- className: "w-full min-w-[960px] text-sm",
334
- "aria-label": "Ad campaigns",
335
- children: [/* @__PURE__ */ k("thead", {
336
- className: "border-b border-border-seam bg-bg-sunken/60 text-left text-xs font-medium text-text-secondary",
337
- children: /* @__PURE__ */ A("tr", { children: [
338
- /* @__PURE__ */ k("th", {
339
- scope: "col",
340
- className: "w-10 px-4 py-3",
341
- children: /* @__PURE__ */ k("input", {
342
- type: "checkbox",
343
- "aria-label": "Select all campaigns on this page",
344
- checked: Te,
345
- onChange: De,
346
- className: "h-4 w-4 rounded border-border-subtle"
347
- })
348
- }),
349
- /* @__PURE__ */ k("th", {
350
- scope: "col",
351
- className: "px-3 py-3",
352
- children: "Campaign"
353
- }),
354
- /* @__PURE__ */ k("th", {
355
- scope: "col",
356
- className: "px-3 py-3",
357
- children: "Platform"
358
- }),
359
- /* @__PURE__ */ k("th", {
360
- scope: "col",
361
- className: "px-3 py-3",
362
- children: "Status"
363
- }),
364
- /* @__PURE__ */ k("th", {
365
- scope: "col",
366
- className: "px-3 py-3 text-right",
367
- children: "Daily Budget"
368
- }),
369
- /* @__PURE__ */ k("th", {
370
- scope: "col",
371
- className: "px-3 py-3",
372
- children: "Spent"
373
- }),
374
- /* @__PURE__ */ k("th", {
375
- scope: "col",
376
- className: "px-3 py-3 text-right",
377
- children: "Impressions"
378
- }),
379
- /* @__PURE__ */ k("th", {
380
- scope: "col",
381
- className: "px-3 py-3 text-right",
382
- children: "Clicks"
383
- }),
384
- /* @__PURE__ */ k("th", {
385
- scope: "col",
386
- className: "px-3 py-3 text-right",
387
- children: "CTR"
388
- }),
389
- /* @__PURE__ */ k("th", {
390
- scope: "col",
391
- className: "px-3 py-3 text-right",
392
- children: "ROAS"
393
- }),
394
- /* @__PURE__ */ k("th", {
395
- scope: "col",
396
- className: "w-12 px-3 py-3",
397
- children: /* @__PURE__ */ k("span", {
398
- className: "sr-only",
399
- children: "Actions"
400
- })
401
- })
402
- ] })
403
- }), /* @__PURE__ */ k("tbody", { children: Y.map((e) => /* @__PURE__ */ k(ve, {
404
- campaign: e,
405
- selected: V.has(e.id),
406
- onToggleSelected: () => Ee(e.id),
407
- menuOpen: N === e.id,
408
- onToggleMenu: () => P(N === e.id ? null : e.id),
409
- onCloseMenu: () => P(null),
410
- onManage: () => l("/ads/campaigns/" + e.id),
411
- onEdit: () => Ie(e),
412
- onToggleStatus: () => je(e),
413
- onDuplicate: () => Ne(e),
414
- onDelete: () => {
415
- P(null), R(e);
416
- }
417
- }, e.id)) })]
418
- })
419
- }),
420
- /* @__PURE__ */ k(ie, {
421
- page: W.page,
422
- pageSize: W.pageSize,
423
- total: W.total,
424
- onPageChange: W.setPage,
425
- onPageSizeChange: W.setPageSize,
426
- disabled: Se,
427
- hideWhenSinglePage: !0
428
- })
429
- ] })
281
+ }) : /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N("div", {
282
+ className: "space-y-4",
283
+ children: J.map((e) => /* @__PURE__ */ N(de, {
284
+ campaign: e,
285
+ menuOpen: k === e.id,
286
+ onToggleMenu: () => A(k === e.id ? null : e.id),
287
+ onCloseMenu: () => A(null),
288
+ onManage: () => u("/ads/campaigns/" + e.id),
289
+ onEdit: () => xe(e),
290
+ onToggleStatus: () => _e(e),
291
+ onDuplicate: () => ve(e),
292
+ onDelete: () => {
293
+ A(null), R(e);
294
+ }
295
+ }, e.id))
296
+ }), /* @__PURE__ */ N(ie, {
297
+ page: V.page,
298
+ pageSize: V.pageSize,
299
+ total: V.total,
300
+ onPageChange: V.setPage,
301
+ onPageSizeChange: V.setPageSize,
302
+ disabled: G,
303
+ hideWhenSinglePage: !0
304
+ })] })
430
305
  }),
431
- /* @__PURE__ */ k(g, {
432
- open: F !== null,
433
- onClose: () => I(null),
306
+ /* @__PURE__ */ N(h, {
307
+ open: j !== null,
308
+ onClose: () => F(null),
434
309
  title: "Edit Campaign",
435
310
  description: "Update campaign details",
436
311
  size: "lg",
437
- footer: /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k("button", {
438
- onClick: () => I(null),
312
+ footer: /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N("button", {
313
+ onClick: () => F(null),
439
314
  className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
440
315
  children: "Cancel"
441
- }), /* @__PURE__ */ k("button", {
442
- onClick: Pe,
443
- disabled: Q,
316
+ }), /* @__PURE__ */ N("button", {
317
+ onClick: ye,
318
+ disabled: Z,
444
319
  className: "rounded-md bg-foreground px-4 py-2 text-sm font-medium text-background hover:bg-foreground/90 disabled:opacity-60",
445
- children: Q ? "Saving..." : "Save Changes"
320
+ children: Z ? "Saving..." : "Save Changes"
446
321
  })] }),
447
- children: F && /* @__PURE__ */ A("div", {
322
+ children: j && /* @__PURE__ */ P("div", {
448
323
  className: "space-y-4",
449
324
  children: [
450
- /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("label", {
325
+ /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("label", {
451
326
  className: "mb-1.5 block text-sm font-medium text-text-primary",
452
327
  children: "Campaign Name"
453
- }), /* @__PURE__ */ k("input", {
328
+ }), /* @__PURE__ */ N("input", {
454
329
  type: "text",
455
- value: F.name,
456
- onChange: (e) => I({
457
- ...F,
330
+ value: j.name,
331
+ onChange: (e) => F({
332
+ ...j,
458
333
  name: e.target.value
459
334
  }),
460
335
  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)]"
461
336
  })] }),
462
- /* @__PURE__ */ A("div", {
337
+ /* @__PURE__ */ P("div", {
463
338
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
464
- children: [/* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("label", {
339
+ children: [/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("label", {
465
340
  className: "mb-1.5 block text-sm font-medium text-text-primary",
466
341
  children: "Status"
467
- }), /* @__PURE__ */ A("select", {
468
- value: F.status,
469
- onChange: (e) => I({
470
- ...F,
342
+ }), /* @__PURE__ */ P("select", {
343
+ value: j.status,
344
+ onChange: (e) => F({
345
+ ...j,
471
346
  status: e.target.value
472
347
  }),
473
348
  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)]",
474
349
  children: [
475
- /* @__PURE__ */ k("option", {
350
+ /* @__PURE__ */ N("option", {
476
351
  value: "draft",
477
352
  children: "Draft"
478
353
  }),
479
- /* @__PURE__ */ k("option", {
354
+ /* @__PURE__ */ N("option", {
480
355
  value: "active",
481
356
  children: "Active"
482
357
  }),
483
- /* @__PURE__ */ k("option", {
358
+ /* @__PURE__ */ N("option", {
484
359
  value: "paused",
485
360
  children: "Paused"
486
361
  }),
487
- /* @__PURE__ */ k("option", {
362
+ /* @__PURE__ */ N("option", {
488
363
  value: "completed",
489
364
  children: "Completed"
490
365
  })
491
366
  ]
492
- })] }), /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("label", {
367
+ })] }), /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("label", {
493
368
  className: "mb-1.5 block text-sm font-medium text-text-primary",
494
369
  children: "Total Budget (USD)"
495
- }), /* @__PURE__ */ k("input", {
370
+ }), /* @__PURE__ */ N("input", {
496
371
  type: "number",
497
- value: F.totalBudget,
498
- onChange: (e) => I({
499
- ...F,
372
+ value: j.totalBudget,
373
+ onChange: (e) => F({
374
+ ...j,
500
375
  totalBudget: e.target.value
501
376
  }),
502
377
  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)]"
503
378
  })] })]
504
379
  }),
505
- /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("label", {
380
+ /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("label", {
506
381
  className: "mb-1.5 block text-sm font-medium text-text-primary",
507
382
  children: "Bid Strategy"
508
- }), /* @__PURE__ */ k("input", {
383
+ }), /* @__PURE__ */ N("input", {
509
384
  type: "text",
510
- value: F.bidStrategy,
511
- onChange: (e) => I({
512
- ...F,
385
+ value: j.bidStrategy,
386
+ onChange: (e) => F({
387
+ ...j,
513
388
  bidStrategy: e.target.value
514
389
  }),
515
390
  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)]"
516
391
  })] }),
517
- /* @__PURE__ */ A("div", {
392
+ /* @__PURE__ */ P("div", {
518
393
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
519
- children: [/* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("label", {
394
+ children: [/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("label", {
520
395
  className: "mb-1.5 block text-sm font-medium text-text-primary",
521
396
  children: "Start Date"
522
- }), /* @__PURE__ */ k("input", {
397
+ }), /* @__PURE__ */ N("input", {
523
398
  type: "date",
524
- value: F.startDate,
525
- onChange: (e) => I({
526
- ...F,
399
+ value: j.startDate,
400
+ onChange: (e) => F({
401
+ ...j,
527
402
  startDate: e.target.value
528
403
  }),
529
404
  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)]"
530
- })] }), /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("label", {
405
+ })] }), /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("label", {
531
406
  className: "mb-1.5 block text-sm font-medium text-text-primary",
532
407
  children: "End Date"
533
- }), /* @__PURE__ */ k("input", {
408
+ }), /* @__PURE__ */ N("input", {
534
409
  type: "date",
535
- value: F.endDate,
536
- onChange: (e) => I({
537
- ...F,
410
+ value: j.endDate,
411
+ onChange: (e) => F({
412
+ ...j,
538
413
  endDate: e.target.value
539
414
  }),
540
415
  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)]"
541
416
  })] })]
542
417
  }),
543
- z && /* @__PURE__ */ k("p", {
418
+ z && /* @__PURE__ */ N("p", {
544
419
  className: "text-sm text-status-error-text",
545
420
  children: z
546
421
  })
547
422
  ]
548
423
  })
549
424
  }),
550
- /* @__PURE__ */ k(g, {
551
- open: L !== null,
425
+ /* @__PURE__ */ N(h, {
426
+ open: I !== null,
552
427
  onClose: () => R(null),
553
428
  title: "Delete Campaign",
554
429
  size: "sm",
555
- footer: /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k("button", {
430
+ footer: /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N("button", {
556
431
  onClick: () => R(null),
557
432
  className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
558
433
  children: "Cancel"
559
- }), /* @__PURE__ */ k("button", {
560
- onClick: Fe,
561
- disabled: Ae,
434
+ }), /* @__PURE__ */ N("button", {
435
+ onClick: be,
436
+ disabled: Q,
562
437
  className: "rounded-md bg-status-error-text px-4 py-2 text-sm font-medium text-background hover:opacity-90 disabled:opacity-60",
563
- children: Ae ? "Deleting..." : "Delete"
438
+ children: Q ? "Deleting..." : "Delete"
564
439
  })] }),
565
- children: /* @__PURE__ */ A("p", {
440
+ children: /* @__PURE__ */ P("p", {
566
441
  className: "text-sm text-text-secondary",
567
442
  children: [
568
443
  "Are you sure you want to delete",
569
444
  " ",
570
- /* @__PURE__ */ k("span", {
445
+ /* @__PURE__ */ N("span", {
571
446
  className: "font-semibold text-text-primary",
572
- children: L?.name
447
+ children: I?.name
573
448
  }),
574
449
  "? This action cannot be undone."
575
450
  ]
@@ -577,141 +452,178 @@ var M = () => {
577
452
  })
578
453
  ]
579
454
  });
580
- }, ve = ({ campaign: e, selected: t, onToggleSelected: n, menuOpen: r, onToggleMenu: i, onCloseMenu: c, onManage: l, onEdit: u, onToggleStatus: d, onDuplicate: f, onDelete: p }) => {
581
- D(`ad-campaign-${e.id}`, r, c);
582
- let m = e.budget.total > 0 ? e.budget.spent / e.budget.total * 100 : 0;
583
- return /* @__PURE__ */ A("tr", {
584
- className: a("border-b border-border-subtle last:border-b-0 hover:bg-bg-sunken/40", t && "bg-bg-sunken/60"),
455
+ }, de = ({ campaign: e, menuOpen: t, onToggleMenu: n, onCloseMenu: r, onManage: i, onEdit: l, onToggleStatus: u, onDuplicate: d, onDelete: f }) => {
456
+ j(`ad-campaign-${e.id}`, t, r);
457
+ let p = e.budget.total > 0 ? e.budget.spent / e.budget.total * 100 : 0;
458
+ return /* @__PURE__ */ P("div", {
459
+ className: "rounded-lg border border-border-seam bg-gloss-card shadow-pop p-5",
585
460
  children: [
586
- /* @__PURE__ */ k("td", {
587
- className: "px-4 py-3",
588
- children: /* @__PURE__ */ k("input", {
589
- type: "checkbox",
590
- "aria-label": `Select ${e.name}`,
591
- checked: t,
592
- onChange: n,
593
- className: "h-4 w-4 rounded border-border-subtle"
594
- })
595
- }),
596
- /* @__PURE__ */ A("td", {
597
- className: "px-3 py-3",
598
- children: [/* @__PURE__ */ k("button", {
599
- onClick: l,
600
- className: "block max-w-[260px] truncate rounded text-left font-medium text-text-primary hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
601
- children: e.name
602
- }), /* @__PURE__ */ A("div", {
603
- className: "mt-1 flex items-center gap-1.5 text-xs text-text-secondary",
604
- children: [/* @__PURE__ */ k("span", { children: "Sync:" }), /* @__PURE__ */ k(h, {
605
- status: e.syncStatus,
606
- className: "px-1.5 py-0 text-[10px]"
607
- })]
608
- })]
609
- }),
610
- /* @__PURE__ */ k("td", {
611
- className: "px-3 py-3",
612
- children: /* @__PURE__ */ A("span", {
613
- className: "inline-flex items-center gap-2 whitespace-nowrap text-text-primary",
614
- children: [v(e.platform, "h-4 w-4 shrink-0"), _(e.platform)]
615
- })
616
- }),
617
- /* @__PURE__ */ k("td", {
618
- className: "px-3 py-3",
619
- children: /* @__PURE__ */ k(h, { status: e.status })
620
- }),
621
- /* @__PURE__ */ k("td", {
622
- className: "whitespace-nowrap px-3 py-3 text-right tabular-nums text-text-primary",
623
- children: e.dailyBudget > 0 ? o(e.dailyBudget) : "—"
624
- }),
625
- /* @__PURE__ */ k("td", {
626
- className: "px-3 py-3",
627
- children: /* @__PURE__ */ A("div", {
628
- className: "flex items-center gap-2",
629
- children: [/* @__PURE__ */ k("span", {
630
- className: "whitespace-nowrap tabular-nums text-text-primary",
631
- children: o(e.budget.spent)
632
- }), /* @__PURE__ */ k("div", {
633
- className: "h-1.5 w-16 overflow-hidden rounded-full bg-bg-sunken",
634
- role: "progressbar",
635
- "aria-label": `Budget used for ${e.name}`,
636
- "aria-valuemin": 0,
637
- "aria-valuemax": 100,
638
- "aria-valuenow": Math.round(Math.min(m, 100)),
639
- children: /* @__PURE__ */ k("div", {
640
- className: a("h-full rounded-full", m > 90 ? "bg-status-error-text" : m > 70 ? "bg-status-warning-text" : "bg-status-success-text"),
641
- style: { width: `${Math.min(m, 100)}%` }
642
- })
461
+ /* @__PURE__ */ P("div", {
462
+ className: "mb-4 flex items-start justify-between gap-3",
463
+ children: [/* @__PURE__ */ P("div", {
464
+ className: "min-w-0",
465
+ children: [/* @__PURE__ */ P("div", {
466
+ className: "mb-1 flex flex-wrap items-center gap-2",
467
+ children: [
468
+ /* @__PURE__ */ N("button", {
469
+ onClick: i,
470
+ className: "rounded text-left text-sm font-semibold text-text-primary hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
471
+ children: e.name
472
+ }),
473
+ /* @__PURE__ */ N("span", {
474
+ className: a("rounded-full px-2.5 py-0.5 text-xs font-medium", I[e.platform]),
475
+ children: F[e.platform]
476
+ }),
477
+ /* @__PURE__ */ N(m, { status: e.status })
478
+ ]
479
+ }), /* @__PURE__ */ P("p", {
480
+ className: "text-xs text-text-secondary",
481
+ children: [
482
+ e.adFormat,
483
+ " · ",
484
+ e.bidStrategy,
485
+ " ·",
486
+ " ",
487
+ e.startDate,
488
+ " to ",
489
+ e.endDate
490
+ ]
643
491
  })]
644
- })
645
- }),
646
- /* @__PURE__ */ k("td", {
647
- className: "px-3 py-3 text-right tabular-nums text-text-primary",
648
- children: s(e.metrics.impressions)
649
- }),
650
- /* @__PURE__ */ k("td", {
651
- className: "px-3 py-3 text-right tabular-nums text-text-primary",
652
- children: s(e.metrics.clicks)
653
- }),
654
- /* @__PURE__ */ k("td", {
655
- className: "px-3 py-3 text-right tabular-nums text-text-primary",
656
- children: ee(e.metrics.ctr, 2)
657
- }),
658
- /* @__PURE__ */ A("td", {
659
- className: "px-3 py-3 text-right tabular-nums text-text-primary",
660
- children: [e.metrics.roas.toFixed(1), "x"]
661
- }),
662
- /* @__PURE__ */ k("td", {
663
- className: "px-3 py-3",
664
- children: /* @__PURE__ */ A("div", {
665
- className: "relative flex justify-end",
666
- children: [/* @__PURE__ */ k("button", {
667
- onClick: i,
492
+ }), /* @__PURE__ */ P("div", {
493
+ className: "relative shrink-0",
494
+ children: [/* @__PURE__ */ N("button", {
495
+ onClick: n,
668
496
  "aria-haspopup": "menu",
669
- "aria-expanded": r,
670
- "aria-label": `Actions for ${e.name}`,
671
- className: "rounded-md p-1.5 text-text-secondary hover:bg-bg-sunken hover:text-text-primary",
672
- children: /* @__PURE__ */ k(C, { className: "h-4 w-4" })
673
- }), r && /* @__PURE__ */ A("div", {
497
+ "aria-expanded": t,
498
+ "aria-label": "Campaign actions",
499
+ className: "rounded-md p-1.5 text-text-secondary hover:text-text-primary hover:bg-bg-sunken",
500
+ children: /* @__PURE__ */ N(S, { className: "h-4 w-4" })
501
+ }), t && /* @__PURE__ */ P("div", {
674
502
  role: "menu",
675
503
  className: "absolute right-0 top-8 z-20 w-44 rounded-md border border-border-seam bg-gloss-card py-1 shadow-lg",
676
504
  children: [
677
- /* @__PURE__ */ A("button", {
505
+ /* @__PURE__ */ P("button", {
506
+ role: "menuitem",
507
+ onClick: i,
508
+ className: "flex w-full items-center gap-2 px-4 py-2 text-left text-sm text-text-primary hover:bg-bg-sunken",
509
+ children: [/* @__PURE__ */ N(O, { className: "h-3.5 w-3.5" }), "Manage"]
510
+ }),
511
+ /* @__PURE__ */ P("button", {
678
512
  role: "menuitem",
679
513
  onClick: l,
680
514
  className: "flex w-full items-center gap-2 px-4 py-2 text-left text-sm text-text-primary hover:bg-bg-sunken",
681
- children: [/* @__PURE__ */ k(T, { className: "h-3.5 w-3.5" }), "Manage"]
515
+ children: [/* @__PURE__ */ N(T, { className: "h-3.5 w-3.5" }), "Edit"]
682
516
  }),
683
- /* @__PURE__ */ A("button", {
517
+ /* @__PURE__ */ N("button", {
684
518
  role: "menuitem",
685
519
  onClick: u,
686
520
  className: "flex w-full items-center gap-2 px-4 py-2 text-left text-sm text-text-primary hover:bg-bg-sunken",
687
- children: [/* @__PURE__ */ k(fe, { className: "h-3.5 w-3.5" }), "Edit"]
521
+ children: e.status === "active" ? /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N(w, { className: "h-3.5 w-3.5" }), "Pause"] }) : /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N(E, { className: "h-3.5 w-3.5" }), "Resume"] })
688
522
  }),
689
- /* @__PURE__ */ k("button", {
523
+ /* @__PURE__ */ P("button", {
690
524
  role: "menuitem",
691
525
  onClick: d,
692
526
  className: "flex w-full items-center gap-2 px-4 py-2 text-left text-sm text-text-primary hover:bg-bg-sunken",
693
- children: e.status === "active" ? /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k(de, { className: "h-3.5 w-3.5" }), "Pause"] }) : /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k(pe, { className: "h-3.5 w-3.5" }), "Resume"] })
527
+ children: [/* @__PURE__ */ N(y, { className: "h-3.5 w-3.5" }), "Duplicate"]
694
528
  }),
695
- /* @__PURE__ */ A("button", {
529
+ /* @__PURE__ */ P("button", {
696
530
  role: "menuitem",
697
531
  onClick: f,
698
- className: "flex w-full items-center gap-2 px-4 py-2 text-left text-sm text-text-primary hover:bg-bg-sunken",
699
- children: [/* @__PURE__ */ k(S, { className: "h-3.5 w-3.5" }), "Duplicate"]
700
- }),
701
- /* @__PURE__ */ A("button", {
702
- role: "menuitem",
703
- onClick: p,
704
532
  className: "flex w-full items-center gap-2 px-4 py-2 text-left text-sm text-status-error-text hover:bg-bg-sunken",
705
- children: [/* @__PURE__ */ k(E, { className: "h-3.5 w-3.5" }), "Delete"]
533
+ children: [/* @__PURE__ */ N(k, { className: "h-3.5 w-3.5" }), "Delete"]
706
534
  })
707
535
  ]
708
536
  })]
709
- })
537
+ })]
538
+ }),
539
+ /* @__PURE__ */ P("div", {
540
+ className: "mb-4",
541
+ children: [/* @__PURE__ */ P("div", {
542
+ className: "mb-1 flex items-center justify-between text-xs",
543
+ children: [/* @__PURE__ */ P("span", {
544
+ className: "text-text-secondary",
545
+ children: [
546
+ "Budget: ",
547
+ o(e.budget.spent),
548
+ " /",
549
+ " ",
550
+ o(e.budget.total)
551
+ ]
552
+ }), /* @__PURE__ */ P("span", {
553
+ className: "text-text-secondary",
554
+ children: [p.toFixed(0), "%"]
555
+ })]
556
+ }), /* @__PURE__ */ N("div", {
557
+ className: "h-2 w-full overflow-hidden rounded-full bg-bg-sunken",
558
+ children: /* @__PURE__ */ N("div", {
559
+ className: a("h-full rounded-full", p > 90 ? "bg-status-error-text" : p > 70 ? "bg-status-warning-text" : "bg-status-success-text"),
560
+ style: { width: `${Math.min(p, 100)}%` }
561
+ })
562
+ })]
563
+ }),
564
+ /* @__PURE__ */ P("div", {
565
+ className: "grid grid-cols-2 gap-3 sm:grid-cols-4 lg:grid-cols-6",
566
+ children: [
567
+ /* @__PURE__ */ P("div", {
568
+ className: "flex items-center gap-2",
569
+ children: [/* @__PURE__ */ N(b, { className: "h-3.5 w-3.5 text-text-secondary" }), /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
570
+ className: "text-xs text-text-secondary",
571
+ children: "Spend"
572
+ }), /* @__PURE__ */ N("p", {
573
+ className: "text-sm font-medium text-text-primary",
574
+ children: o(e.metrics.spend)
575
+ })] })]
576
+ }),
577
+ /* @__PURE__ */ P("div", {
578
+ className: "flex items-center gap-2",
579
+ children: [/* @__PURE__ */ N(x, { className: "h-3.5 w-3.5 text-text-secondary" }), /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
580
+ className: "text-xs text-text-secondary",
581
+ children: "Impressions"
582
+ }), /* @__PURE__ */ N("p", {
583
+ className: "text-sm font-medium text-text-primary",
584
+ children: s(e.metrics.impressions)
585
+ })] })]
586
+ }),
587
+ /* @__PURE__ */ P("div", {
588
+ className: "flex items-center gap-2",
589
+ children: [/* @__PURE__ */ N(C, { className: "h-3.5 w-3.5 text-text-secondary" }), /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
590
+ className: "text-xs text-text-secondary",
591
+ children: "Clicks"
592
+ }), /* @__PURE__ */ N("p", {
593
+ className: "text-sm font-medium text-text-primary",
594
+ children: s(e.metrics.clicks)
595
+ })] })]
596
+ }),
597
+ /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
598
+ className: "text-xs text-text-secondary",
599
+ children: "CTR"
600
+ }), /* @__PURE__ */ N("p", {
601
+ className: "text-sm font-medium text-text-primary",
602
+ children: c(e.metrics.ctr)
603
+ })] }),
604
+ /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
605
+ className: "text-xs text-text-secondary",
606
+ children: "CPC"
607
+ }), /* @__PURE__ */ P("p", {
608
+ className: "text-sm font-medium text-text-primary",
609
+ children: ["$", e.metrics.cpc.toFixed(2)]
610
+ })] }),
611
+ /* @__PURE__ */ P("div", {
612
+ className: "flex items-center gap-2",
613
+ children: [/* @__PURE__ */ N(A, { className: "h-3.5 w-3.5 text-text-secondary" }), /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
614
+ className: "text-xs text-text-secondary",
615
+ children: "ROAS"
616
+ }), /* @__PURE__ */ P("p", {
617
+ className: "text-sm font-medium text-text-primary",
618
+ children: [e.metrics.roas.toFixed(1), "x"]
619
+ })] })]
620
+ })
621
+ ]
710
622
  })
711
623
  ]
712
624
  });
713
625
  };
714
626
  //#endregion
715
- export { M as AdCampaignsPage };
627
+ export { R as AdCampaignsPage };
716
628
 
717
629
  //# sourceMappingURL=AdCampaignsPage.js.map