@burdenoff/microfe-headshotmarketing 2026.703.1 → 2026.704.1

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 (137) hide show
  1. package/dist/generated/wspace-operations.js +970 -52
  2. package/dist/generated/wspace-operations.js.map +1 -1
  3. package/dist/generated/wspace-types.js +26 -10
  4. package/dist/generated/wspace-types.js.map +1 -1
  5. package/dist/headshotmarketing/HeadshotMarketingRoot.js +45 -44
  6. package/dist/headshotmarketing/HeadshotMarketingRoot.js.map +1 -1
  7. package/dist/headshotmarketing/HeadshotMarketingRoutes.js +20 -0
  8. package/dist/headshotmarketing/HeadshotMarketingRoutes.js.map +1 -1
  9. package/dist/headshotmarketing/components/ActionMenu.js +57 -0
  10. package/dist/headshotmarketing/components/ActionMenu.js.map +1 -0
  11. package/dist/headshotmarketing/components/AssetUploadButton.js +47 -0
  12. package/dist/headshotmarketing/components/AssetUploadButton.js.map +1 -0
  13. package/dist/headshotmarketing/components/FilterBar.js.map +1 -1
  14. package/dist/headshotmarketing/components/InfluencerModals.js +606 -0
  15. package/dist/headshotmarketing/components/InfluencerModals.js.map +1 -0
  16. package/dist/headshotmarketing/components/LoadingSkeleton.js +11 -1
  17. package/dist/headshotmarketing/components/LoadingSkeleton.js.map +1 -0
  18. package/dist/headshotmarketing/components/Modal.js +6 -3
  19. package/dist/headshotmarketing/components/Modal.js.map +1 -1
  20. package/dist/headshotmarketing/components/Pagination.js +117 -0
  21. package/dist/headshotmarketing/components/Pagination.js.map +1 -0
  22. package/dist/headshotmarketing/components/QueryStateBoundary.js +46 -0
  23. package/dist/headshotmarketing/components/QueryStateBoundary.js.map +1 -0
  24. package/dist/headshotmarketing/components/StatusBadge.js.map +1 -1
  25. package/dist/headshotmarketing/components/TagChipsInput.js +74 -0
  26. package/dist/headshotmarketing/components/TagChipsInput.js.map +1 -0
  27. package/dist/headshotmarketing/components/index.js +6 -0
  28. package/dist/headshotmarketing/context/HeadshotMarketingContext.js +26 -22
  29. package/dist/headshotmarketing/context/HeadshotMarketingContext.js.map +1 -1
  30. package/dist/headshotmarketing/context/HeadshotmarketingBootstrapContext.js +29 -0
  31. package/dist/headshotmarketing/context/HeadshotmarketingBootstrapContext.js.map +1 -0
  32. package/dist/headshotmarketing/hooks/index.js +4 -0
  33. package/dist/headshotmarketing/hooks/useAssetUpload.js +86 -0
  34. package/dist/headshotmarketing/hooks/useAssetUpload.js.map +1 -0
  35. package/dist/headshotmarketing/hooks/useHeadshotmarketingBootstrap.js +12 -0
  36. package/dist/headshotmarketing/hooks/useHeadshotmarketingBootstrap.js.map +1 -0
  37. package/dist/headshotmarketing/hooks/usePagination.js +53 -0
  38. package/dist/headshotmarketing/hooks/usePagination.js.map +1 -0
  39. package/dist/headshotmarketing/pages/HomePage.js +334 -301
  40. package/dist/headshotmarketing/pages/HomePage.js.map +1 -1
  41. package/dist/headshotmarketing/pages/ads/AdCampaignsPage.js +522 -225
  42. package/dist/headshotmarketing/pages/ads/AdCampaignsPage.js.map +1 -1
  43. package/dist/headshotmarketing/pages/ads/AdCreativesPage.js +749 -147
  44. package/dist/headshotmarketing/pages/ads/AdCreativesPage.js.map +1 -1
  45. package/dist/headshotmarketing/pages/ads/AdsPage.js +197 -188
  46. package/dist/headshotmarketing/pages/ads/AdsPage.js.map +1 -1
  47. package/dist/headshotmarketing/pages/ads/AudiencesPage.js +583 -147
  48. package/dist/headshotmarketing/pages/ads/AudiencesPage.js.map +1 -1
  49. package/dist/headshotmarketing/pages/ads/CreateAdCampaignPage.js +218 -206
  50. package/dist/headshotmarketing/pages/ads/CreateAdCampaignPage.js.map +1 -1
  51. package/dist/headshotmarketing/pages/analytics/AdAnalyticsPage.js +244 -237
  52. package/dist/headshotmarketing/pages/analytics/AdAnalyticsPage.js.map +1 -1
  53. package/dist/headshotmarketing/pages/analytics/AnalyticsPage.js +278 -272
  54. package/dist/headshotmarketing/pages/analytics/AnalyticsPage.js.map +1 -1
  55. package/dist/headshotmarketing/pages/analytics/CampaignAnalyticsPage.js +197 -193
  56. package/dist/headshotmarketing/pages/analytics/CampaignAnalyticsPage.js.map +1 -1
  57. package/dist/headshotmarketing/pages/analytics/ReportsPage.js +254 -295
  58. package/dist/headshotmarketing/pages/analytics/ReportsPage.js.map +1 -1
  59. package/dist/headshotmarketing/pages/analytics/SocialAnalyticsPage.js +221 -211
  60. package/dist/headshotmarketing/pages/analytics/SocialAnalyticsPage.js.map +1 -1
  61. package/dist/headshotmarketing/pages/automation/AutomationPage.js +239 -168
  62. package/dist/headshotmarketing/pages/automation/AutomationPage.js.map +1 -1
  63. package/dist/headshotmarketing/pages/automation/TriggersPage.js +150 -102
  64. package/dist/headshotmarketing/pages/automation/TriggersPage.js.map +1 -1
  65. package/dist/headshotmarketing/pages/automation/WorkflowActions.js +287 -0
  66. package/dist/headshotmarketing/pages/automation/WorkflowActions.js.map +1 -0
  67. package/dist/headshotmarketing/pages/automation/WorkflowBuilderPage.js +56 -58
  68. package/dist/headshotmarketing/pages/automation/WorkflowBuilderPage.js.map +1 -1
  69. package/dist/headshotmarketing/pages/automation/WorkflowsPage.js +211 -179
  70. package/dist/headshotmarketing/pages/automation/WorkflowsPage.js.map +1 -1
  71. package/dist/headshotmarketing/pages/builder/LandingPageBuilderPage.js +444 -306
  72. package/dist/headshotmarketing/pages/builder/LandingPageBuilderPage.js.map +1 -1
  73. package/dist/headshotmarketing/pages/campaigns/CampaignDetailsPage.js +290 -217
  74. package/dist/headshotmarketing/pages/campaigns/CampaignDetailsPage.js.map +1 -1
  75. package/dist/headshotmarketing/pages/campaigns/CampaignTemplatesPage.js +189 -151
  76. package/dist/headshotmarketing/pages/campaigns/CampaignTemplatesPage.js.map +1 -1
  77. package/dist/headshotmarketing/pages/campaigns/CampaignsPage.js +417 -274
  78. package/dist/headshotmarketing/pages/campaigns/CampaignsPage.js.map +1 -1
  79. package/dist/headshotmarketing/pages/campaigns/CreateCampaignPage.js +345 -260
  80. package/dist/headshotmarketing/pages/campaigns/CreateCampaignPage.js.map +1 -1
  81. package/dist/headshotmarketing/pages/content/AIToolsPage.js +261 -192
  82. package/dist/headshotmarketing/pages/content/AIToolsPage.js.map +1 -1
  83. package/dist/headshotmarketing/pages/content/AssetLibraryPage.js +213 -141
  84. package/dist/headshotmarketing/pages/content/AssetLibraryPage.js.map +1 -1
  85. package/dist/headshotmarketing/pages/content/ContentAnalyticsPage.js +242 -246
  86. package/dist/headshotmarketing/pages/content/ContentAnalyticsPage.js.map +1 -1
  87. package/dist/headshotmarketing/pages/content/ContentCreationPage.js +184 -136
  88. package/dist/headshotmarketing/pages/content/ContentCreationPage.js.map +1 -1
  89. package/dist/headshotmarketing/pages/content/ContentPage.js +208 -159
  90. package/dist/headshotmarketing/pages/content/ContentPage.js.map +1 -1
  91. package/dist/headshotmarketing/pages/crm/ContactsPage.js +336 -265
  92. package/dist/headshotmarketing/pages/crm/ContactsPage.js.map +1 -1
  93. package/dist/headshotmarketing/pages/crm/CreateContactPage.js +76 -87
  94. package/dist/headshotmarketing/pages/crm/CreateContactPage.js.map +1 -1
  95. package/dist/headshotmarketing/pages/crm/CreateDealPage.js +195 -196
  96. package/dist/headshotmarketing/pages/crm/CreateDealPage.js.map +1 -1
  97. package/dist/headshotmarketing/pages/crm/CrmActions.js +663 -0
  98. package/dist/headshotmarketing/pages/crm/CrmActions.js.map +1 -0
  99. package/dist/headshotmarketing/pages/crm/CrmPage.js +237 -207
  100. package/dist/headshotmarketing/pages/crm/CrmPage.js.map +1 -1
  101. package/dist/headshotmarketing/pages/crm/LeadsPage.js +168 -165
  102. package/dist/headshotmarketing/pages/crm/LeadsPage.js.map +1 -1
  103. package/dist/headshotmarketing/pages/crm/PipelinePage.js +189 -178
  104. package/dist/headshotmarketing/pages/crm/PipelinePage.js.map +1 -1
  105. package/dist/headshotmarketing/pages/events/CreateEventPage.js +188 -190
  106. package/dist/headshotmarketing/pages/events/CreateEventPage.js.map +1 -1
  107. package/dist/headshotmarketing/pages/events/EventsPage.js +256 -238
  108. package/dist/headshotmarketing/pages/events/EventsPage.js.map +1 -1
  109. package/dist/headshotmarketing/pages/influencers/InfluencerCampaignsPage.js +195 -167
  110. package/dist/headshotmarketing/pages/influencers/InfluencerCampaignsPage.js.map +1 -1
  111. package/dist/headshotmarketing/pages/influencers/InfluencerDiscoveryPage.js +280 -243
  112. package/dist/headshotmarketing/pages/influencers/InfluencerDiscoveryPage.js.map +1 -1
  113. package/dist/headshotmarketing/pages/influencers/InfluencersPage.js +186 -183
  114. package/dist/headshotmarketing/pages/influencers/InfluencersPage.js.map +1 -1
  115. package/dist/headshotmarketing/pages/influencers/RelationshipsPage.js +303 -231
  116. package/dist/headshotmarketing/pages/influencers/RelationshipsPage.js.map +1 -1
  117. package/dist/headshotmarketing/pages/seo/SeoToolsPage.js +460 -310
  118. package/dist/headshotmarketing/pages/seo/SeoToolsPage.js.map +1 -1
  119. package/dist/headshotmarketing/pages/social-media/AccountsPage.js +318 -104
  120. package/dist/headshotmarketing/pages/social-media/AccountsPage.js.map +1 -1
  121. package/dist/headshotmarketing/pages/social-media/ContentCalendarPage.js +266 -255
  122. package/dist/headshotmarketing/pages/social-media/ContentCalendarPage.js.map +1 -1
  123. package/dist/headshotmarketing/pages/social-media/PostsPage.js +365 -202
  124. package/dist/headshotmarketing/pages/social-media/PostsPage.js.map +1 -1
  125. package/dist/headshotmarketing/pages/social-media/SocialMediaComposePage.js +321 -233
  126. package/dist/headshotmarketing/pages/social-media/SocialMediaComposePage.js.map +1 -1
  127. package/dist/headshotmarketing/pages/social-media/SocialMediaPage.js +324 -308
  128. package/dist/headshotmarketing/pages/social-media/SocialMediaPage.js.map +1 -1
  129. package/dist/headshotmarketing/utils/adsMapper.js +74 -51
  130. package/dist/headshotmarketing/utils/adsMapper.js.map +1 -1
  131. package/dist/headshotmarketing/utils/helpers.js +11 -1
  132. package/dist/headshotmarketing/utils/helpers.js.map +1 -1
  133. package/dist/headshotmarketing/utils/influencerMapper.js +1 -0
  134. package/dist/headshotmarketing/utils/influencerMapper.js.map +1 -1
  135. package/package.json +1 -1
  136. package/dist/headshotmarketing/utils/reportMapper.js +0 -33
  137. package/dist/headshotmarketing/utils/reportMapper.js.map +0 -1
@@ -1,237 +1,839 @@
1
- import { useHeadshotMarketing as e } from "../../context/HeadshotMarketingContext.js";
2
- import { useHeadshotmarketingBootstrapDataQuery as t } from "../../../generated/wspace-operations.js";
3
- import { cn as n, formatNumber as r, formatPercentage as i } from "../../utils/helpers.js";
4
- import { toAdCreativeModel as a } from "../../utils/adsMapper.js";
5
- import { PageLayout as o } from "../../components/PageLayout.js";
6
- import { StatusBadge as s } from "../../components/StatusBadge.js";
7
- import { EmptyState as c } from "../../components/EmptyState.js";
8
- import { FilterBar as l } from "../../components/FilterBar.js";
1
+ import { useCreateHeadshotmarketingAdCreativeMutation as e, useDeleteHeadshotmarketingAdCreativeMutation as t, useHeadshotmarketingAdCreativesListQuery as n, useUpdateHeadshotmarketingAdCreativeMutation as r } from "../../../generated/wspace-operations.js";
2
+ import { cn as i, formatNumber as a, formatPercentage as o } from "../../utils/helpers.js";
3
+ import { HeadshotmarketingAdCreativeStatus as s, HeadshotmarketingAdCreativeType as c } from "../../../generated/wspace-types.js";
4
+ import { toAdCreativeModel as l } from "../../utils/adsMapper.js";
5
+ import { PageLayout as ee } from "../../components/PageLayout.js";
6
+ import { StatusBadge as te } from "../../components/StatusBadge.js";
7
+ import { EmptyState as ne } from "../../components/EmptyState.js";
8
+ import { FilterBar as re } from "../../components/FilterBar.js";
9
+ import { Modal as u } from "../../components/Modal.js";
10
+ import { QueryStateBoundary as ie } from "../../components/QueryStateBoundary.js";
11
+ import { Pagination as ae } from "../../components/Pagination.js";
9
12
  import "../../components/index.js";
10
- import { useMemo as u, useState as d } from "react";
11
- import { Eye as f, Image as p, Layers as m, MoreHorizontal as h, Plus as g, Smartphone as _, Type as v, Video as y } from "lucide-react";
12
- import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
13
- import { EmphasisPanel as C, PagePurpose as w } from "@burdenoff/fe-libs/ui";
13
+ import { useHeadshotmarketingBootstrap as oe } from "../../hooks/useHeadshotmarketingBootstrap.js";
14
+ import { usePagination as se } from "../../hooks/usePagination.js";
15
+ import { useEffect as d, useMemo as f, useRef as ce, useState as p } from "react";
16
+ import { ExternalLink as le, Eye as m, Image as h, Layers as g, MoreHorizontal as _, Pencil as v, Plus as ue, Smartphone as y, Trash2 as de, Type as b, UploadCloud as fe, Video as x } from "lucide-react";
17
+ import { useExclusiveMenu as S } from "@burdenoff/fe-libs/shared/hooks";
18
+ import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
19
+ import { EmphasisPanel as pe, PagePurpose as me } from "@burdenoff/fe-libs/ui";
20
+ import { useSaveToFiles as he } from "@burdenoff/fe-libs/storage";
14
21
  //#region src/headshotmarketing/pages/ads/AdCreativesPage.tsx
15
- var T = {
16
- image: p,
17
- video: y,
18
- carousel: m,
19
- text: v,
20
- responsive: _
21
- }, E = {
22
+ var ge = {
23
+ image: h,
24
+ video: x,
25
+ carousel: g,
26
+ text: b,
27
+ responsive: y
28
+ }, _e = {
22
29
  image: "bg-status-info-bg text-status-info-text",
23
30
  video: "bg-[var(--color-accent-soft)] text-action-primary-bg",
24
31
  carousel: "bg-status-warning-bg text-status-warning-text",
25
32
  text: "bg-bg-sunken text-text-secondary",
26
33
  responsive: "bg-status-success-bg text-status-success-text"
27
- }, D = () => {
28
- let { navigate: m } = e(), { data: _ } = t({ variables: {
29
- limit: 200,
30
- offset: 0
31
- } }), [v, y] = d(""), [D, O] = d("all"), [k, A] = d("all"), j = u(() => (_?.headshotmarketingAdCreatives.items ?? []).map((e) => a(e)), [_?.headshotmarketingAdCreatives.items]), M = u(() => {
32
- let e = [...j];
33
- if (v) {
34
- let t = v.toLowerCase();
35
- e = e.filter((e) => e.name.toLowerCase().includes(t) || e.headline.toLowerCase().includes(t));
36
- }
37
- return D !== "all" && (e = e.filter((e) => e.type === D)), k !== "all" && (e = e.filter((e) => e.status === k)), e;
34
+ }, E = {
35
+ image: c.Image,
36
+ video: c.Video,
37
+ carousel: c.Carousel,
38
+ text: c.Text,
39
+ responsive: c.Responsive
40
+ }, D = {
41
+ active: s.Active,
42
+ paused: s.Paused,
43
+ pending_review: s.PendingReview,
44
+ rejected: s.Rejected
45
+ };
46
+ function O(e) {
47
+ return E[e] ?? c.Image;
48
+ }
49
+ function ve(e) {
50
+ return D[e] ?? s.PendingReview;
51
+ }
52
+ function ye(e) {
53
+ return e.startsWith("image/") ? "image" : e.startsWith("video/") ? "video" : "text";
54
+ }
55
+ var k = {
56
+ name: "",
57
+ type: "image",
58
+ headline: "",
59
+ body: "",
60
+ callToAction: "Learn More",
61
+ destinationUrl: "",
62
+ status: "pending_review"
63
+ }, A = () => {
64
+ let { data: s, refetch: c } = oe(), [m, g] = p(""), [_, v] = p(""), [y, de] = p("all"), [b, x] = p("all"), [S, A] = p(null), [M, xe] = p(!1), [N, P] = p(k), [F, I] = p(null), [L, R] = p(null), [z, B] = p(null), [V, H] = p(null), [U, W] = p(null), [G, K] = p(null), q = ce(null), J = se({ initialPageSize: 12 }), { limit: Se, offset: Ce, setPage: we, setTotal: Te } = J;
65
+ d(() => {
66
+ let e = setTimeout(() => v(m), 300);
67
+ return () => clearTimeout(e);
68
+ }, [m]), d(() => {
69
+ we(1);
38
70
  }, [
39
- v,
40
- D,
41
- k,
42
- j
43
- ]), N = u(() => {
44
- let e = j.filter((e) => e.status === "active").length, t = j.reduce((e, t) => e + t.performance.impressions, 0), n = j.filter((e) => e.performance.impressions > 0), r = n.length > 0 ? n.reduce((e, t) => e + t.performance.ctr, 0) / n.length : 0;
71
+ _,
72
+ y,
73
+ b,
74
+ we
75
+ ]);
76
+ let { data: Y, loading: Ee, error: De, refetch: Oe } = n({
77
+ variables: {
78
+ limit: Se,
79
+ offset: Ce,
80
+ search: _ || null,
81
+ status: D[b] ?? null,
82
+ type: E[y] ?? null
83
+ },
84
+ errorPolicy: "all",
85
+ notifyOnNetworkStatusChange: !0
86
+ }), X = Y?.headshotmarketingAdCreatives.total ?? 0;
87
+ d(() => {
88
+ Te(X);
89
+ }, [X, Te]);
90
+ let ke = f(() => (Y?.headshotmarketingAdCreatives.items ?? []).map((e) => l(e)), [Y?.headshotmarketingAdCreatives.items]), Z = f(() => {
91
+ let e = (s?.headshotmarketingAdCreatives.items ?? []).map((e) => l(e)), t = e.filter((e) => e.status === "active").length, n = e.reduce((e, t) => e + t.performance.impressions, 0), r = e.filter((e) => e.performance.impressions > 0), i = r.length > 0 ? r.reduce((e, t) => e + t.performance.ctr, 0) / r.length : 0;
45
92
  return {
46
- total: j.length,
47
- active: e,
48
- totalImpressions: t,
49
- avgCtr: r
93
+ total: e.length,
94
+ active: t,
95
+ totalImpressions: n,
96
+ avgCtr: i
50
97
  };
51
- }, [j]);
52
- return /* @__PURE__ */ S(o, {
98
+ }, [s?.headshotmarketingAdCreatives.items]), { save: Ae, isPending: je } = he(), [Me, { loading: Ne }] = e(), [Pe, { loading: Fe }] = r(), [Ie, { loading: Le }] = t(), Q = async () => {
99
+ await Promise.all([Oe(), c()]);
100
+ }, $ = () => {
101
+ xe(!1), P(k), I(null), L && URL.revokeObjectURL(L), R(null), q.current && (q.current.value = "");
102
+ }, Re = () => {
103
+ K(null), P(k), I(null), R(null), xe(!0);
104
+ }, ze = (e) => {
105
+ if (L && URL.revokeObjectURL(L), !e) {
106
+ I(null), R(null);
107
+ return;
108
+ }
109
+ I(e), R(e.type.startsWith("image/") ? URL.createObjectURL(e) : null), P((t) => ({
110
+ ...t,
111
+ name: t.name || e.name.replace(/\.[^.]+$/, ""),
112
+ type: ye(e.type)
113
+ }));
114
+ }, Be = async () => {
115
+ if (!N.name.trim()) {
116
+ K("Creative name is required.");
117
+ return;
118
+ }
119
+ K(null);
120
+ try {
121
+ let e = [], t = {};
122
+ if (F) {
123
+ let e = F, n = await Ae({
124
+ source: {
125
+ kind: "blob",
126
+ getBlob: async () => ({
127
+ blob: e,
128
+ filename: e.name,
129
+ mimeType: e.type || "application/octet-stream"
130
+ }),
131
+ filename: e.name,
132
+ mimeType: e.type || "application/octet-stream"
133
+ },
134
+ folderPath: "/Headshotmarketing/Ad Creatives"
135
+ });
136
+ t.fileId = n.id, t.fileName = n.name;
137
+ }
138
+ await Me({ variables: { input: {
139
+ name: N.name.trim(),
140
+ type: O(N.type),
141
+ headline: N.headline || null,
142
+ body: N.body || null,
143
+ callToAction: N.callToAction || null,
144
+ destinationUrl: N.destinationUrl || null,
145
+ mediaUrls: e,
146
+ metadata: Object.keys(t).length > 0 ? t : null
147
+ } } }), $(), await Q();
148
+ } catch (e) {
149
+ K(e instanceof Error ? e.message : "Failed to upload creative.");
150
+ }
151
+ }, Ve = (e) => {
152
+ A(null), K(null), B({
153
+ id: e.id,
154
+ form: {
155
+ name: e.name,
156
+ type: e.type,
157
+ headline: e.headline,
158
+ body: e.description,
159
+ callToAction: e.callToAction,
160
+ destinationUrl: e.landingPageUrl,
161
+ status: e.status
162
+ }
163
+ });
164
+ }, He = async () => {
165
+ if (z) {
166
+ if (!z.form.name.trim()) {
167
+ K("Creative name is required.");
168
+ return;
169
+ }
170
+ K(null);
171
+ try {
172
+ await Pe({ variables: {
173
+ id: z.id,
174
+ input: {
175
+ name: z.form.name.trim(),
176
+ type: O(z.form.type),
177
+ headline: z.form.headline || null,
178
+ body: z.form.body || null,
179
+ callToAction: z.form.callToAction || null,
180
+ destinationUrl: z.form.destinationUrl || null,
181
+ status: ve(z.form.status)
182
+ }
183
+ } }), B(null), await Q();
184
+ } catch (e) {
185
+ K(e instanceof Error ? e.message : "Failed to save creative.");
186
+ }
187
+ }
188
+ }, Ue = async () => {
189
+ if (U) {
190
+ K(null);
191
+ try {
192
+ await Ie({ variables: { id: U.id } }), W(null), await Q();
193
+ } catch (e) {
194
+ K(e instanceof Error ? e.message : "Failed to delete creative.");
195
+ }
196
+ }
197
+ }, We = je || Ne;
198
+ return /* @__PURE__ */ T(ee, {
53
199
  title: "Ad Creatives",
54
200
  description: "Manage your advertising creative assets",
55
- actions: /* @__PURE__ */ S("button", {
201
+ actions: /* @__PURE__ */ T("button", {
202
+ onClick: Re,
56
203
  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",
57
- children: [/* @__PURE__ */ x(g, { className: "h-4 w-4" }), "Upload Creative"]
204
+ children: [/* @__PURE__ */ w(ue, { className: "h-4 w-4" }), "Upload Creative"]
58
205
  }),
59
206
  children: [
60
- /* @__PURE__ */ x(w, { children: "Your library of ad creatives — images, videos, carousels and copy. Keep every asset and its real performance (impressions, CTR) in one place so you can quickly see what's resonating and reuse your best creative across campaigns." }),
61
- /* @__PURE__ */ x(C, { children: /* @__PURE__ */ S("div", {
207
+ /* @__PURE__ */ w(me, { children: "Your library of ad creatives — images, videos, carousels and copy. Keep every asset and its real performance (impressions, CTR) in one place so you can quickly see what's resonating and reuse your best creative across campaigns." }),
208
+ /* @__PURE__ */ w(pe, { children: /* @__PURE__ */ T("div", {
62
209
  className: "grid grid-cols-2 gap-4 sm:grid-cols-4",
63
210
  children: [
64
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
211
+ /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
65
212
  className: "text-xs text-text-secondary",
66
213
  children: "Total Creatives"
67
- }), /* @__PURE__ */ x("p", {
214
+ }), /* @__PURE__ */ w("p", {
68
215
  className: "text-2xl font-semibold text-text-primary",
69
- children: r(N.total)
216
+ children: a(Z.total)
70
217
  })] }),
71
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
218
+ /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
72
219
  className: "text-xs text-text-secondary",
73
220
  children: "Active"
74
- }), /* @__PURE__ */ x("p", {
221
+ }), /* @__PURE__ */ w("p", {
75
222
  className: "text-2xl font-semibold text-text-primary",
76
- children: r(N.active)
223
+ children: a(Z.active)
77
224
  })] }),
78
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
225
+ /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
79
226
  className: "text-xs text-text-secondary",
80
227
  children: "Impressions"
81
- }), /* @__PURE__ */ x("p", {
228
+ }), /* @__PURE__ */ w("p", {
82
229
  className: "text-2xl font-semibold text-text-primary",
83
- children: r(N.totalImpressions)
230
+ children: a(Z.totalImpressions)
84
231
  })] }),
85
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
232
+ /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
86
233
  className: "text-xs text-text-secondary",
87
234
  children: "Avg CTR"
88
- }), /* @__PURE__ */ x("p", {
235
+ }), /* @__PURE__ */ w("p", {
89
236
  className: "text-2xl font-semibold text-text-primary",
90
- children: i(N.avgCtr)
237
+ children: o(Z.avgCtr)
91
238
  })] })
92
239
  ]
93
240
  }) }),
94
- /* @__PURE__ */ x(l, {
95
- searchValue: v,
96
- onSearchChange: y,
241
+ /* @__PURE__ */ w(re, {
242
+ searchValue: m,
243
+ onSearchChange: g,
97
244
  searchPlaceholder: "Search creatives...",
98
- filters: /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ S("select", {
99
- value: D,
100
- onChange: (e) => O(e.target.value),
245
+ filters: /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ T("select", {
246
+ value: y,
247
+ onChange: (e) => de(e.target.value),
101
248
  className: "rounded-md border border-border-seam bg-gloss-card shadow-pop px-3 py-2 text-sm text-text-primary",
102
249
  children: [
103
- /* @__PURE__ */ x("option", {
250
+ /* @__PURE__ */ w("option", {
104
251
  value: "all",
105
252
  children: "All Types"
106
253
  }),
107
- /* @__PURE__ */ x("option", {
254
+ /* @__PURE__ */ w("option", {
108
255
  value: "image",
109
256
  children: "Image"
110
257
  }),
111
- /* @__PURE__ */ x("option", {
258
+ /* @__PURE__ */ w("option", {
112
259
  value: "video",
113
260
  children: "Video"
114
261
  }),
115
- /* @__PURE__ */ x("option", {
262
+ /* @__PURE__ */ w("option", {
116
263
  value: "carousel",
117
264
  children: "Carousel"
118
265
  }),
119
- /* @__PURE__ */ x("option", {
266
+ /* @__PURE__ */ w("option", {
120
267
  value: "text",
121
268
  children: "Text"
122
269
  }),
123
- /* @__PURE__ */ x("option", {
270
+ /* @__PURE__ */ w("option", {
124
271
  value: "responsive",
125
272
  children: "Responsive"
126
273
  })
127
274
  ]
128
- }), /* @__PURE__ */ S("select", {
129
- value: k,
130
- onChange: (e) => A(e.target.value),
275
+ }), /* @__PURE__ */ T("select", {
276
+ value: b,
277
+ onChange: (e) => x(e.target.value),
131
278
  className: "rounded-md border border-border-seam bg-gloss-card shadow-pop px-3 py-2 text-sm text-text-primary",
132
279
  children: [
133
- /* @__PURE__ */ x("option", {
280
+ /* @__PURE__ */ w("option", {
134
281
  value: "all",
135
282
  children: "All Status"
136
283
  }),
137
- /* @__PURE__ */ x("option", {
284
+ /* @__PURE__ */ w("option", {
138
285
  value: "active",
139
286
  children: "Active"
140
287
  }),
141
- /* @__PURE__ */ x("option", {
288
+ /* @__PURE__ */ w("option", {
142
289
  value: "paused",
143
290
  children: "Paused"
144
291
  }),
145
- /* @__PURE__ */ x("option", {
292
+ /* @__PURE__ */ w("option", {
146
293
  value: "pending_review",
147
294
  children: "Pending Review"
148
295
  }),
149
- /* @__PURE__ */ x("option", {
296
+ /* @__PURE__ */ w("option", {
150
297
  value: "rejected",
151
298
  children: "Rejected"
152
299
  })
153
300
  ]
154
301
  })] })
155
302
  }),
156
- M.length === 0 && /* @__PURE__ */ x(c, {
157
- illustration: j.length === 0 ? "empty-files" : "empty-search",
158
- title: j.length === 0 ? "No creatives yet" : "No creatives match your filters",
159
- description: j.length === 0 ? "Upload images, videos or copy to build your ad creative library." : "Try a different search term, type or status.",
160
- action: j.length === 0 ? /* @__PURE__ */ S("button", {
161
- 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",
162
- children: [/* @__PURE__ */ x(g, { className: "h-4 w-4" }), "Upload Creative"]
163
- }) : void 0
303
+ G && !M && !z && /* @__PURE__ */ w("div", {
304
+ role: "alert",
305
+ className: "rounded-lg border border-status-error-border/30 bg-status-error-bg/10 px-4 py-3 text-sm text-status-error-text",
306
+ children: G
164
307
  }),
165
- /* @__PURE__ */ x("div", {
166
- className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",
167
- children: M.map((e) => /* @__PURE__ */ S("div", {
168
- className: "rounded-lg border border-border-seam bg-gloss-card shadow-pop overflow-hidden hover:border-foreground/30 transition-colors",
169
- children: [/* @__PURE__ */ S("div", {
170
- className: "relative h-40 bg-bg-sunken/50 flex items-center justify-center",
171
- children: [/* @__PURE__ */ x(T[e.type] || p, { className: "h-12 w-12 text-text-secondary/40" }), /* @__PURE__ */ x("div", {
172
- className: "absolute top-2 right-2",
173
- children: /* @__PURE__ */ x(s, { status: e.status })
174
- })]
175
- }), /* @__PURE__ */ S("div", {
176
- className: "p-4 space-y-3",
177
- children: [
178
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("h3", {
179
- className: "text-sm font-medium text-text-primary truncate",
180
- children: e.name
181
- }), /* @__PURE__ */ x("p", {
182
- className: "text-xs text-text-secondary truncate mt-0.5",
183
- children: e.headline
184
- })] }),
185
- /* @__PURE__ */ S("div", {
186
- className: "flex items-center gap-2",
187
- children: [/* @__PURE__ */ x("span", {
188
- className: n("rounded-full px-2 py-0.5 text-xs font-medium capitalize", E[e.type]),
189
- children: e.type
190
- }), /* @__PURE__ */ x("span", {
308
+ /* @__PURE__ */ w(ie, {
309
+ loading: Ee,
310
+ error: De,
311
+ onRetry: Oe,
312
+ hasData: !!Y,
313
+ children: ke.length === 0 ? /* @__PURE__ */ w(ne, {
314
+ illustration: X === 0 ? "empty-files" : "empty-search",
315
+ title: X === 0 ? "No creatives yet" : "No creatives match your filters",
316
+ description: X === 0 ? "Upload images, videos or copy to build your ad creative library." : "Try a different search term, type or status.",
317
+ action: X === 0 ? /* @__PURE__ */ T("button", {
318
+ onClick: Re,
319
+ 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",
320
+ children: [/* @__PURE__ */ w(ue, { className: "h-4 w-4" }), "Upload Creative"]
321
+ }) : void 0
322
+ }) : /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w("div", {
323
+ className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",
324
+ children: ke.map((e) => /* @__PURE__ */ w(be, {
325
+ creative: e,
326
+ menuOpen: S === e.id,
327
+ onToggleMenu: () => A(S === e.id ? null : e.id),
328
+ onCloseMenu: () => A(null),
329
+ onPreview: () => H(e),
330
+ onEdit: () => Ve(e),
331
+ onDelete: () => {
332
+ A(null), W(e);
333
+ }
334
+ }, e.id))
335
+ }), /* @__PURE__ */ w(ae, {
336
+ page: J.page,
337
+ pageSize: J.pageSize,
338
+ total: J.total,
339
+ onPageChange: J.setPage,
340
+ onPageSizeChange: J.setPageSize,
341
+ pageSizeOptions: [
342
+ 12,
343
+ 24,
344
+ 48
345
+ ],
346
+ disabled: Ee,
347
+ hideWhenSinglePage: !0
348
+ })] })
349
+ }),
350
+ /* @__PURE__ */ w(u, {
351
+ open: M,
352
+ onClose: $,
353
+ title: "Upload Creative",
354
+ description: "Add a new creative asset to your library",
355
+ size: "lg",
356
+ footer: /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w("button", {
357
+ onClick: $,
358
+ className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
359
+ children: "Cancel"
360
+ }), /* @__PURE__ */ w("button", {
361
+ onClick: Be,
362
+ disabled: We,
363
+ className: "rounded-md bg-foreground px-4 py-2 text-sm font-medium text-background hover:bg-foreground/90 disabled:opacity-60",
364
+ children: We ? "Uploading..." : "Upload Creative"
365
+ })] }),
366
+ children: /* @__PURE__ */ T("div", {
367
+ className: "space-y-4",
368
+ children: [
369
+ /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("input", {
370
+ ref: q,
371
+ type: "file",
372
+ accept: "image/*,video/*",
373
+ className: "sr-only",
374
+ onChange: (e) => ze(e.target.files?.[0] ?? null)
375
+ }), /* @__PURE__ */ T("button", {
376
+ type: "button",
377
+ onClick: () => q.current?.click(),
378
+ className: "flex w-full flex-col items-center justify-center gap-2 rounded-lg border border-dashed border-border-subtle bg-bg-sunken/40 px-4 py-6 text-center transition-colors hover:border-foreground/40",
379
+ children: [
380
+ L ? /* @__PURE__ */ w("img", {
381
+ src: L,
382
+ alt: "Selected creative preview",
383
+ className: "max-h-40 rounded-md object-contain"
384
+ }) : /* @__PURE__ */ w(fe, { className: "h-8 w-8 text-text-secondary" }),
385
+ /* @__PURE__ */ w("span", {
386
+ className: "text-sm font-medium text-text-primary",
387
+ children: F ? F.name : "Click to select a file"
388
+ }),
389
+ /* @__PURE__ */ w("span", {
191
390
  className: "text-xs text-text-secondary",
192
- children: e.callToAction
193
- })]
391
+ children: "Images or video — stored securely in Files"
392
+ })
393
+ ]
394
+ })] }),
395
+ /* @__PURE__ */ T("div", {
396
+ className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
397
+ children: [/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("label", {
398
+ className: "mb-1.5 block text-sm font-medium text-text-primary",
399
+ children: "Name"
400
+ }), /* @__PURE__ */ w("input", {
401
+ type: "text",
402
+ value: N.name,
403
+ onChange: (e) => P({
404
+ ...N,
405
+ name: e.target.value
406
+ }),
407
+ placeholder: "e.g., Spring Promo Hero",
408
+ 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)]"
409
+ })] }), /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("label", {
410
+ className: "mb-1.5 block text-sm font-medium text-text-primary",
411
+ children: "Type"
412
+ }), /* @__PURE__ */ T("select", {
413
+ value: N.type,
414
+ onChange: (e) => P({
415
+ ...N,
416
+ type: e.target.value
417
+ }),
418
+ 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)]",
419
+ children: [
420
+ /* @__PURE__ */ w("option", {
421
+ value: "image",
422
+ children: "Image"
423
+ }),
424
+ /* @__PURE__ */ w("option", {
425
+ value: "video",
426
+ children: "Video"
427
+ }),
428
+ /* @__PURE__ */ w("option", {
429
+ value: "carousel",
430
+ children: "Carousel"
431
+ }),
432
+ /* @__PURE__ */ w("option", {
433
+ value: "text",
434
+ children: "Text"
435
+ }),
436
+ /* @__PURE__ */ w("option", {
437
+ value: "responsive",
438
+ children: "Responsive"
439
+ })
440
+ ]
441
+ })] })]
442
+ }),
443
+ /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("label", {
444
+ className: "mb-1.5 block text-sm font-medium text-text-primary",
445
+ children: "Headline"
446
+ }), /* @__PURE__ */ w("input", {
447
+ type: "text",
448
+ value: N.headline,
449
+ onChange: (e) => P({
450
+ ...N,
451
+ headline: e.target.value
194
452
  }),
195
- e.performance.impressions > 0 && /* @__PURE__ */ S("div", {
196
- className: "grid grid-cols-2 gap-2 text-center",
197
- children: [/* @__PURE__ */ S("div", {
198
- className: "rounded-md bg-bg-sunken/50 py-1.5",
199
- children: [/* @__PURE__ */ x("p", {
200
- className: "text-xs font-bold text-text-primary",
201
- children: r(e.performance.impressions)
202
- }), /* @__PURE__ */ x("p", {
203
- className: "text-[10px] text-text-secondary",
204
- children: "Impressions"
205
- })]
206
- }), /* @__PURE__ */ S("div", {
207
- className: "rounded-md bg-bg-sunken/50 py-1.5",
208
- children: [/* @__PURE__ */ x("p", {
209
- className: "text-xs font-bold text-text-primary",
210
- children: i(e.performance.ctr)
211
- }), /* @__PURE__ */ x("p", {
212
- className: "text-[10px] text-text-secondary",
213
- children: "CTR"
214
- })]
215
- })]
453
+ 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)]"
454
+ })] }),
455
+ /* @__PURE__ */ T("div", {
456
+ className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
457
+ children: [/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("label", {
458
+ className: "mb-1.5 block text-sm font-medium text-text-primary",
459
+ children: "Call to Action"
460
+ }), /* @__PURE__ */ w("input", {
461
+ type: "text",
462
+ value: N.callToAction,
463
+ onChange: (e) => P({
464
+ ...N,
465
+ callToAction: e.target.value
466
+ }),
467
+ 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)]"
468
+ })] }), /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("label", {
469
+ className: "mb-1.5 block text-sm font-medium text-text-primary",
470
+ children: "Destination URL"
471
+ }), /* @__PURE__ */ w("input", {
472
+ type: "url",
473
+ value: N.destinationUrl,
474
+ onChange: (e) => P({
475
+ ...N,
476
+ destinationUrl: e.target.value
477
+ }),
478
+ placeholder: "https://",
479
+ 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)]"
480
+ })] })]
481
+ }),
482
+ G && /* @__PURE__ */ w("p", {
483
+ className: "text-sm text-status-error-text",
484
+ children: G
485
+ })
486
+ ]
487
+ })
488
+ }),
489
+ /* @__PURE__ */ w(u, {
490
+ open: z !== null,
491
+ onClose: () => B(null),
492
+ title: "Edit Creative",
493
+ size: "lg",
494
+ footer: /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w("button", {
495
+ onClick: () => B(null),
496
+ className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
497
+ children: "Cancel"
498
+ }), /* @__PURE__ */ w("button", {
499
+ onClick: He,
500
+ disabled: Fe,
501
+ className: "rounded-md bg-foreground px-4 py-2 text-sm font-medium text-background hover:bg-foreground/90 disabled:opacity-60",
502
+ children: Fe ? "Saving..." : "Save Changes"
503
+ })] }),
504
+ children: z && /* @__PURE__ */ T("div", {
505
+ className: "space-y-4",
506
+ children: [
507
+ /* @__PURE__ */ T("div", {
508
+ className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
509
+ children: [/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("label", {
510
+ className: "mb-1.5 block text-sm font-medium text-text-primary",
511
+ children: "Name"
512
+ }), /* @__PURE__ */ w("input", {
513
+ type: "text",
514
+ value: z.form.name,
515
+ onChange: (e) => B({
516
+ ...z,
517
+ form: {
518
+ ...z.form,
519
+ name: e.target.value
520
+ }
521
+ }),
522
+ 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)]"
523
+ })] }), /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("label", {
524
+ className: "mb-1.5 block text-sm font-medium text-text-primary",
525
+ children: "Status"
526
+ }), /* @__PURE__ */ T("select", {
527
+ value: z.form.status,
528
+ onChange: (e) => B({
529
+ ...z,
530
+ form: {
531
+ ...z.form,
532
+ status: e.target.value
533
+ }
534
+ }),
535
+ 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)]",
536
+ children: [
537
+ /* @__PURE__ */ w("option", {
538
+ value: "pending_review",
539
+ children: "Pending Review"
540
+ }),
541
+ /* @__PURE__ */ w("option", {
542
+ value: "active",
543
+ children: "Active"
544
+ }),
545
+ /* @__PURE__ */ w("option", {
546
+ value: "paused",
547
+ children: "Paused"
548
+ }),
549
+ /* @__PURE__ */ w("option", {
550
+ value: "rejected",
551
+ children: "Rejected"
552
+ })
553
+ ]
554
+ })] })]
555
+ }),
556
+ /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("label", {
557
+ className: "mb-1.5 block text-sm font-medium text-text-primary",
558
+ children: "Headline"
559
+ }), /* @__PURE__ */ w("input", {
560
+ type: "text",
561
+ value: z.form.headline,
562
+ onChange: (e) => B({
563
+ ...z,
564
+ form: {
565
+ ...z.form,
566
+ headline: e.target.value
567
+ }
568
+ }),
569
+ 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)]"
570
+ })] }),
571
+ /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("label", {
572
+ className: "mb-1.5 block text-sm font-medium text-text-primary",
573
+ children: "Body"
574
+ }), /* @__PURE__ */ w("textarea", {
575
+ value: z.form.body,
576
+ onChange: (e) => B({
577
+ ...z,
578
+ form: {
579
+ ...z.form,
580
+ body: e.target.value
581
+ }
216
582
  }),
217
- /* @__PURE__ */ S("div", {
218
- className: "flex items-center justify-between pt-2 border-t border-border-subtle",
219
- children: [/* @__PURE__ */ S("button", {
220
- className: "inline-flex items-center gap-1 text-xs text-text-secondary hover:text-text-primary",
221
- children: [/* @__PURE__ */ x(f, { className: "h-3 w-3" }), "Preview"]
222
- }), /* @__PURE__ */ x("button", {
223
- className: "text-text-secondary hover:text-text-primary",
224
- children: /* @__PURE__ */ x(h, { className: "h-4 w-4" })
583
+ rows: 3,
584
+ 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)]"
585
+ })] }),
586
+ /* @__PURE__ */ T("div", {
587
+ className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
588
+ children: [/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("label", {
589
+ className: "mb-1.5 block text-sm font-medium text-text-primary",
590
+ children: "Call to Action"
591
+ }), /* @__PURE__ */ w("input", {
592
+ type: "text",
593
+ value: z.form.callToAction,
594
+ onChange: (e) => B({
595
+ ...z,
596
+ form: {
597
+ ...z.form,
598
+ callToAction: e.target.value
599
+ }
600
+ }),
601
+ 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)]"
602
+ })] }), /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("label", {
603
+ className: "mb-1.5 block text-sm font-medium text-text-primary",
604
+ children: "Destination URL"
605
+ }), /* @__PURE__ */ w("input", {
606
+ type: "url",
607
+ value: z.form.destinationUrl,
608
+ onChange: (e) => B({
609
+ ...z,
610
+ form: {
611
+ ...z.form,
612
+ destinationUrl: e.target.value
613
+ }
614
+ }),
615
+ 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)]"
616
+ })] })]
617
+ }),
618
+ G && /* @__PURE__ */ w("p", {
619
+ className: "text-sm text-status-error-text",
620
+ children: G
621
+ })
622
+ ]
623
+ })
624
+ }),
625
+ /* @__PURE__ */ w(u, {
626
+ open: V !== null,
627
+ onClose: () => H(null),
628
+ title: V?.name ?? "Creative Preview",
629
+ description: V?.headline,
630
+ size: "lg",
631
+ children: V && /* @__PURE__ */ T("div", {
632
+ className: "space-y-4",
633
+ children: [
634
+ /* @__PURE__ */ w("div", {
635
+ className: "flex min-h-[12rem] items-center justify-center rounded-lg border border-border-subtle bg-bg-sunken/40 p-4",
636
+ children: V.mediaUrl ? V.type === "video" ? /* @__PURE__ */ w("video", {
637
+ src: V.mediaUrl,
638
+ controls: !0,
639
+ className: "max-h-80 rounded-md"
640
+ }) : /* @__PURE__ */ w("img", {
641
+ src: V.mediaUrl,
642
+ alt: V.name,
643
+ className: "max-h-80 rounded-md object-contain"
644
+ }) : /* @__PURE__ */ T("div", {
645
+ className: "flex flex-col items-center gap-2 text-text-secondary",
646
+ children: [/* @__PURE__ */ w(ge[V.type] ?? h, { className: "h-12 w-12" }), /* @__PURE__ */ w("span", {
647
+ className: "text-xs",
648
+ children: "No media preview available"
225
649
  })]
226
650
  })
227
- ]
228
- })]
229
- }, e.id))
651
+ }),
652
+ /* @__PURE__ */ T("div", {
653
+ className: "flex flex-wrap items-center gap-2",
654
+ children: [
655
+ /* @__PURE__ */ w("span", {
656
+ className: i("rounded-full px-2.5 py-0.5 text-xs font-medium capitalize", _e[V.type]),
657
+ children: V.type
658
+ }),
659
+ /* @__PURE__ */ w(te, { status: V.status }),
660
+ V.callToAction && /* @__PURE__ */ T("span", {
661
+ className: "text-xs text-text-secondary",
662
+ children: ["CTA: ", V.callToAction]
663
+ })
664
+ ]
665
+ }),
666
+ V.description && /* @__PURE__ */ w("p", {
667
+ className: "text-sm text-text-secondary",
668
+ children: V.description
669
+ }),
670
+ V.landingPageUrl && /* @__PURE__ */ T("a", {
671
+ href: V.landingPageUrl,
672
+ target: "_blank",
673
+ rel: "noreferrer",
674
+ className: "inline-flex items-center gap-1.5 text-sm text-action-primary-bg hover:underline",
675
+ children: [/* @__PURE__ */ w(le, { className: "h-3.5 w-3.5" }), V.landingPageUrl]
676
+ }),
677
+ V.performance.impressions > 0 && /* @__PURE__ */ T("div", {
678
+ className: "grid grid-cols-2 gap-3 sm:grid-cols-4",
679
+ children: [
680
+ /* @__PURE__ */ w(j, {
681
+ label: "Impressions",
682
+ value: a(V.performance.impressions)
683
+ }),
684
+ /* @__PURE__ */ w(j, {
685
+ label: "Clicks",
686
+ value: a(V.performance.clicks)
687
+ }),
688
+ /* @__PURE__ */ w(j, {
689
+ label: "CTR",
690
+ value: o(V.performance.ctr)
691
+ }),
692
+ /* @__PURE__ */ w(j, {
693
+ label: "Conversions",
694
+ value: a(V.performance.conversions)
695
+ })
696
+ ]
697
+ })
698
+ ]
699
+ })
700
+ }),
701
+ /* @__PURE__ */ w(u, {
702
+ open: U !== null,
703
+ onClose: () => W(null),
704
+ title: "Delete Creative",
705
+ size: "sm",
706
+ footer: /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w("button", {
707
+ onClick: () => W(null),
708
+ className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
709
+ children: "Cancel"
710
+ }), /* @__PURE__ */ w("button", {
711
+ onClick: Ue,
712
+ disabled: Le,
713
+ className: "rounded-md bg-status-error-text px-4 py-2 text-sm font-medium text-background hover:opacity-90 disabled:opacity-60",
714
+ children: Le ? "Deleting..." : "Delete"
715
+ })] }),
716
+ children: /* @__PURE__ */ T("p", {
717
+ className: "text-sm text-text-secondary",
718
+ children: [
719
+ "Are you sure you want to delete",
720
+ " ",
721
+ /* @__PURE__ */ w("span", {
722
+ className: "font-semibold text-text-primary",
723
+ children: U?.name
724
+ }),
725
+ "? This action cannot be undone."
726
+ ]
727
+ })
230
728
  })
231
729
  ]
232
730
  });
731
+ }, j = ({ label: e, value: t }) => /* @__PURE__ */ T("div", {
732
+ className: "rounded-md bg-bg-sunken/50 py-2 text-center",
733
+ children: [/* @__PURE__ */ w("p", {
734
+ className: "text-sm font-bold text-text-primary",
735
+ children: t
736
+ }), /* @__PURE__ */ w("p", {
737
+ className: "text-[10px] text-text-secondary",
738
+ children: e
739
+ })]
740
+ }), be = ({ creative: e, menuOpen: t, onToggleMenu: n, onCloseMenu: r, onPreview: s, onEdit: c, onDelete: l }) => {
741
+ S(`ad-creative-${e.id}`, t, r);
742
+ let ee = ge[e.type] || h;
743
+ return /* @__PURE__ */ T("div", {
744
+ className: "overflow-hidden rounded-lg border border-border-seam bg-gloss-card shadow-pop transition-colors hover:border-foreground/30",
745
+ children: [/* @__PURE__ */ T("button", {
746
+ type: "button",
747
+ onClick: s,
748
+ "aria-label": `Preview ${e.name}`,
749
+ className: "relative flex h-40 w-full items-center justify-center bg-bg-sunken/50",
750
+ children: [e.mediaUrl && e.type === "image" ? /* @__PURE__ */ w("img", {
751
+ src: e.mediaUrl,
752
+ alt: e.name,
753
+ className: "h-full w-full object-cover"
754
+ }) : /* @__PURE__ */ w(ee, { className: "h-12 w-12 text-text-secondary/40" }), /* @__PURE__ */ w("div", {
755
+ className: "absolute right-2 top-2",
756
+ children: /* @__PURE__ */ w(te, { status: e.status })
757
+ })]
758
+ }), /* @__PURE__ */ T("div", {
759
+ className: "space-y-3 p-4",
760
+ children: [
761
+ /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("h3", {
762
+ className: "truncate text-sm font-medium text-text-primary",
763
+ children: e.name
764
+ }), /* @__PURE__ */ w("p", {
765
+ className: "mt-0.5 truncate text-xs text-text-secondary",
766
+ children: e.headline
767
+ })] }),
768
+ /* @__PURE__ */ T("div", {
769
+ className: "flex items-center gap-2",
770
+ children: [/* @__PURE__ */ w("span", {
771
+ className: i("rounded-full px-2 py-0.5 text-xs font-medium capitalize", _e[e.type]),
772
+ children: e.type
773
+ }), /* @__PURE__ */ w("span", {
774
+ className: "text-xs text-text-secondary",
775
+ children: e.callToAction
776
+ })]
777
+ }),
778
+ e.performance.impressions > 0 && /* @__PURE__ */ T("div", {
779
+ className: "grid grid-cols-2 gap-2 text-center",
780
+ children: [/* @__PURE__ */ T("div", {
781
+ className: "rounded-md bg-bg-sunken/50 py-1.5",
782
+ children: [/* @__PURE__ */ w("p", {
783
+ className: "text-xs font-bold text-text-primary",
784
+ children: a(e.performance.impressions)
785
+ }), /* @__PURE__ */ w("p", {
786
+ className: "text-[10px] text-text-secondary",
787
+ children: "Impressions"
788
+ })]
789
+ }), /* @__PURE__ */ T("div", {
790
+ className: "rounded-md bg-bg-sunken/50 py-1.5",
791
+ children: [/* @__PURE__ */ w("p", {
792
+ className: "text-xs font-bold text-text-primary",
793
+ children: o(e.performance.ctr)
794
+ }), /* @__PURE__ */ w("p", {
795
+ className: "text-[10px] text-text-secondary",
796
+ children: "CTR"
797
+ })]
798
+ })]
799
+ }),
800
+ /* @__PURE__ */ T("div", {
801
+ className: "flex items-center justify-between border-t border-border-subtle pt-2",
802
+ children: [/* @__PURE__ */ T("button", {
803
+ onClick: s,
804
+ className: "inline-flex items-center gap-1 text-xs text-text-secondary hover:text-text-primary",
805
+ children: [/* @__PURE__ */ w(m, { className: "h-3 w-3" }), "Preview"]
806
+ }), /* @__PURE__ */ T("div", {
807
+ className: "relative",
808
+ children: [/* @__PURE__ */ w("button", {
809
+ onClick: n,
810
+ "aria-haspopup": "menu",
811
+ "aria-expanded": t,
812
+ "aria-label": "Creative actions",
813
+ className: "text-text-secondary hover:text-text-primary",
814
+ children: /* @__PURE__ */ w(_, { className: "h-4 w-4" })
815
+ }), t && /* @__PURE__ */ T("div", {
816
+ role: "menu",
817
+ className: "absolute bottom-6 right-0 z-20 w-36 rounded-md border border-border-seam bg-gloss-card py-1 shadow-lg",
818
+ children: [/* @__PURE__ */ T("button", {
819
+ role: "menuitem",
820
+ onClick: c,
821
+ className: "flex w-full items-center gap-2 px-4 py-2 text-left text-sm text-text-primary hover:bg-bg-sunken",
822
+ children: [/* @__PURE__ */ w(v, { className: "h-3.5 w-3.5" }), "Edit"]
823
+ }), /* @__PURE__ */ T("button", {
824
+ role: "menuitem",
825
+ onClick: l,
826
+ className: "flex w-full items-center gap-2 px-4 py-2 text-left text-sm text-status-error-text hover:bg-bg-sunken",
827
+ children: [/* @__PURE__ */ w(de, { className: "h-3.5 w-3.5" }), "Delete"]
828
+ })]
829
+ })]
830
+ })]
831
+ })
832
+ ]
833
+ })]
834
+ });
233
835
  };
234
836
  //#endregion
235
- export { D as AdCreativesPage };
837
+ export { A as AdCreativesPage };
236
838
 
237
839
  //# sourceMappingURL=AdCreativesPage.js.map