@burdenoff/microfe-headshotmarketing 2026.1102.1 → 2026.1107.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/dist/generated/wspace-operations.d.ts +575 -0
  2. package/dist/generated/wspace-operations.d.ts.map +1 -1
  3. package/dist/generated/wspace-operations.js +606 -345
  4. package/dist/generated/wspace-operations.js.map +1 -1
  5. package/dist/generated/wspace-types.d.ts +10195 -158
  6. package/dist/generated/wspace-types.d.ts.map +1 -1
  7. package/dist/generated/wspace-types.js +10 -6
  8. package/dist/generated/wspace-types.js.map +1 -1
  9. package/dist/headshotmarketing/hooks/useToast.js +25 -0
  10. package/dist/headshotmarketing/hooks/useToast.js.map +1 -0
  11. package/dist/headshotmarketing/pages/HomeMonthlyGoals.d.ts +9 -0
  12. package/dist/headshotmarketing/pages/HomeMonthlyGoals.d.ts.map +1 -0
  13. package/dist/headshotmarketing/pages/HomeMonthlyGoals.js +266 -0
  14. package/dist/headshotmarketing/pages/HomeMonthlyGoals.js.map +1 -0
  15. package/dist/headshotmarketing/pages/HomePage.d.ts.map +1 -1
  16. package/dist/headshotmarketing/pages/HomePage.js +299 -298
  17. package/dist/headshotmarketing/pages/HomePage.js.map +1 -1
  18. package/dist/headshotmarketing/pages/analytics/AnalyticsPage.d.ts.map +1 -1
  19. package/dist/headshotmarketing/pages/analytics/AnalyticsPage.js +171 -465
  20. package/dist/headshotmarketing/pages/analytics/AnalyticsPage.js.map +1 -1
  21. package/dist/headshotmarketing/pages/analytics/ReportsPage.d.ts.map +1 -1
  22. package/dist/headshotmarketing/pages/analytics/ReportsPage.js +541 -550
  23. package/dist/headshotmarketing/pages/analytics/ReportsPage.js.map +1 -1
  24. package/dist/headshotmarketing/pages/analytics/analyticsView.d.ts +153 -0
  25. package/dist/headshotmarketing/pages/analytics/analyticsView.d.ts.map +1 -0
  26. package/dist/headshotmarketing/pages/analytics/analyticsView.js +371 -0
  27. package/dist/headshotmarketing/pages/analytics/analyticsView.js.map +1 -0
  28. package/dist/headshotmarketing/pages/analytics/analyticsWidgets.d.ts +83 -0
  29. package/dist/headshotmarketing/pages/analytics/analyticsWidgets.d.ts.map +1 -0
  30. package/dist/headshotmarketing/pages/analytics/analyticsWidgets.js +592 -0
  31. package/dist/headshotmarketing/pages/analytics/analyticsWidgets.js.map +1 -0
  32. package/dist/headshotmarketing/pages/analytics/reportDraft.d.ts +40 -0
  33. package/dist/headshotmarketing/pages/analytics/reportDraft.d.ts.map +1 -0
  34. package/dist/headshotmarketing/pages/analytics/reportDraft.js +66 -0
  35. package/dist/headshotmarketing/pages/analytics/reportDraft.js.map +1 -0
  36. package/dist/headshotmarketing/pages/analytics/useAnalyticsData.d.ts +23 -0
  37. package/dist/headshotmarketing/pages/analytics/useAnalyticsData.d.ts.map +1 -0
  38. package/dist/headshotmarketing/pages/analytics/useAnalyticsData.js +68 -0
  39. package/dist/headshotmarketing/pages/analytics/useAnalyticsData.js.map +1 -0
  40. package/dist/headshotmarketing/utils/analyticsMapper.js +3 -42
  41. package/dist/headshotmarketing/utils/analyticsMapper.js.map +1 -1
  42. package/dist/headshotmarketing/utils/dashboardHome.d.ts +91 -0
  43. package/dist/headshotmarketing/utils/dashboardHome.d.ts.map +1 -0
  44. package/dist/headshotmarketing/utils/dashboardHome.js +94 -0
  45. package/dist/headshotmarketing/utils/dashboardHome.js.map +1 -0
  46. package/dist/node_modules/recharts/es6/util/ActiveShapeUtils.js +1 -1
  47. package/package.json +1 -1
  48. package/dist/node_modules/lodash/_arrayEach.js +0 -14
  49. package/dist/node_modules/lodash/_arrayEach.js.map +0 -1
  50. package/dist/node_modules/lodash/_assignValue.js +0 -17
  51. package/dist/node_modules/lodash/_assignValue.js.map +0 -1
  52. package/dist/node_modules/lodash/_baseAssign.js +0 -16
  53. package/dist/node_modules/lodash/_baseAssign.js.map +0 -1
  54. package/dist/node_modules/lodash/_baseAssignIn.js +0 -16
  55. package/dist/node_modules/lodash/_baseAssignIn.js.map +0 -1
  56. package/dist/node_modules/lodash/_baseClone.js +0 -64
  57. package/dist/node_modules/lodash/_baseClone.js.map +0 -1
  58. package/dist/node_modules/lodash/_baseCreate.js +0 -21
  59. package/dist/node_modules/lodash/_baseCreate.js.map +0 -1
  60. package/dist/node_modules/lodash/_baseIsMap.js +0 -16
  61. package/dist/node_modules/lodash/_baseIsMap.js.map +0 -1
  62. package/dist/node_modules/lodash/_baseIsSet.js +0 -16
  63. package/dist/node_modules/lodash/_baseIsSet.js.map +0 -1
  64. package/dist/node_modules/lodash/_baseKeysIn.js +0 -20
  65. package/dist/node_modules/lodash/_baseKeysIn.js.map +0 -1
  66. package/dist/node_modules/lodash/_baseUnset.js +0 -26
  67. package/dist/node_modules/lodash/_baseUnset.js.map +0 -1
  68. package/dist/node_modules/lodash/_cloneArrayBuffer.js +0 -16
  69. package/dist/node_modules/lodash/_cloneArrayBuffer.js.map +0 -1
  70. package/dist/node_modules/lodash/_cloneBuffer.js +0 -17
  71. package/dist/node_modules/lodash/_cloneBuffer.js.map +0 -1
  72. package/dist/node_modules/lodash/_cloneDataView.js +0 -16
  73. package/dist/node_modules/lodash/_cloneDataView.js.map +0 -1
  74. package/dist/node_modules/lodash/_cloneRegExp.js +0 -15
  75. package/dist/node_modules/lodash/_cloneRegExp.js.map +0 -1
  76. package/dist/node_modules/lodash/_cloneSymbol.js +0 -15
  77. package/dist/node_modules/lodash/_cloneSymbol.js.map +0 -1
  78. package/dist/node_modules/lodash/_cloneTypedArray.js +0 -16
  79. package/dist/node_modules/lodash/_cloneTypedArray.js.map +0 -1
  80. package/dist/node_modules/lodash/_copyArray.js +0 -15
  81. package/dist/node_modules/lodash/_copyArray.js.map +0 -1
  82. package/dist/node_modules/lodash/_copyObject.js +0 -22
  83. package/dist/node_modules/lodash/_copyObject.js.map +0 -1
  84. package/dist/node_modules/lodash/_copySymbols.js +0 -16
  85. package/dist/node_modules/lodash/_copySymbols.js.map +0 -1
  86. package/dist/node_modules/lodash/_copySymbolsIn.js +0 -16
  87. package/dist/node_modules/lodash/_copySymbolsIn.js.map +0 -1
  88. package/dist/node_modules/lodash/_customOmitClone.js +0 -15
  89. package/dist/node_modules/lodash/_customOmitClone.js.map +0 -1
  90. package/dist/node_modules/lodash/_flatRest.js +0 -17
  91. package/dist/node_modules/lodash/_flatRest.js.map +0 -1
  92. package/dist/node_modules/lodash/_getAllKeysIn.js +0 -17
  93. package/dist/node_modules/lodash/_getAllKeysIn.js.map +0 -1
  94. package/dist/node_modules/lodash/_getSymbolsIn.js +0 -18
  95. package/dist/node_modules/lodash/_getSymbolsIn.js.map +0 -1
  96. package/dist/node_modules/lodash/_initCloneArray.js +0 -15
  97. package/dist/node_modules/lodash/_initCloneArray.js.map +0 -1
  98. package/dist/node_modules/lodash/_initCloneByTag.js +0 -40
  99. package/dist/node_modules/lodash/_initCloneByTag.js.map +0 -1
  100. package/dist/node_modules/lodash/_initCloneObject.js +0 -17
  101. package/dist/node_modules/lodash/_initCloneObject.js.map +0 -1
  102. package/dist/node_modules/lodash/_nativeKeysIn.js +0 -15
  103. package/dist/node_modules/lodash/_nativeKeysIn.js.map +0 -1
  104. package/dist/node_modules/lodash/_parent.js +0 -16
  105. package/dist/node_modules/lodash/_parent.js.map +0 -1
  106. package/dist/node_modules/lodash/flatten.js +0 -15
  107. package/dist/node_modules/lodash/flatten.js.map +0 -1
  108. package/dist/node_modules/lodash/isMap.js +0 -14
  109. package/dist/node_modules/lodash/isMap.js.map +0 -1
  110. package/dist/node_modules/lodash/isSet.js +0 -14
  111. package/dist/node_modules/lodash/isSet.js.map +0 -1
  112. package/dist/node_modules/lodash/keysIn.js +0 -17
  113. package/dist/node_modules/lodash/keysIn.js.map +0 -1
  114. package/dist/node_modules/lodash/omit.js +0 -28
  115. package/dist/node_modules/lodash/omit.js.map +0 -1
  116. package/dist/node_modules/recharts/es6/chart/FunnelChart.js +0 -15
  117. package/dist/node_modules/recharts/es6/chart/FunnelChart.js.map +0 -1
  118. package/dist/node_modules/recharts/es6/numberAxis/Funnel.js +0 -370
  119. package/dist/node_modules/recharts/es6/numberAxis/Funnel.js.map +0 -1
  120. package/dist/node_modules/recharts/es6/util/FunnelUtils.js +0 -81
  121. package/dist/node_modules/recharts/es6/util/FunnelUtils.js.map +0 -1
@@ -1,51 +1,29 @@
1
1
  import { useHeadshotMarketing as e } from "../../context/HeadshotMarketingContext.js";
2
- import { Legend as t } from "../../../node_modules/recharts/es6/component/Legend.js";
3
- import { Tooltip as n } from "../../../node_modules/recharts/es6/component/Tooltip.js";
4
- import { ResponsiveContainer as r } from "../../../node_modules/recharts/es6/component/ResponsiveContainer.js";
5
- import { Bar as i } from "../../../node_modules/recharts/es6/cartesian/Bar.js";
6
- import { CartesianGrid as a } from "../../../node_modules/recharts/es6/cartesian/CartesianGrid.js";
7
- import { Area as o } from "../../../node_modules/recharts/es6/cartesian/Area.js";
8
- import { XAxis as s } from "../../../node_modules/recharts/es6/cartesian/XAxis.js";
9
- import { YAxis as c } from "../../../node_modules/recharts/es6/cartesian/YAxis.js";
10
- import { BarChart as l } from "../../../node_modules/recharts/es6/chart/BarChart.js";
11
- import { AreaChart as ee } from "../../../node_modules/recharts/es6/chart/AreaChart.js";
12
- import { cn as te, formatCurrency as u, formatNumber as d, formatPercentage as f } from "../../utils/helpers.js";
13
- import { toCampaignModel as ne } from "../../utils/campaignMapper.js";
14
- import { toAdCampaignModel as p } from "../../utils/adsMapper.js";
15
- import { toCampaignTimeSeries as m, toChannelPerformance as h, toDeviceData as g, toFunnelStages as _, toGeographicData as v } from "../../utils/analyticsMapper.js";
16
- import { PageLayout as y } from "../../components/PageLayout.js";
17
- import { StatCard as re } from "../../components/StatCard.js";
18
- import { DataTable as b } from "../../components/DataTable.js";
19
- import { ChartCard as x } from "../../components/ChartCard.js";
20
- import { QueryStateBoundary as ie } from "../../components/QueryStateBoundary.js";
2
+ import { cn as t, exportRowsToCsv as n, formatCurrency as r, formatNumber as i, formatPercentage as a } from "../../utils/helpers.js";
3
+ import { HeadshotmarketingReportDateRange as o } from "../../../generated/wspace-types.js";
4
+ import { toAdCampaignModel as s } from "../../utils/adsMapper.js";
5
+ import { toChannelPerformance as c, toDeviceData as l, toGeographicData as u } from "../../utils/analyticsMapper.js";
6
+ import { PageLayout as ee } from "../../components/PageLayout.js";
7
+ import { StatCard as te } from "../../components/StatCard.js";
8
+ import { DataTable as ne } from "../../components/DataTable.js";
9
+ import { QueryStateBoundary as re } from "../../components/QueryStateBoundary.js";
21
10
  import "../../components/index.js";
22
- import { useHeadshotmarketingBootstrap as ae } from "../../hooks/useHeadshotmarketingBootstrap.js";
23
- import { toSocialAccountModel as oe } from "../../utils/socialMapper.js";
24
- import { useState as se } from "react";
25
- import { ArrowRightLeft as ce, CreditCard as le, DollarSign as S, Eye as ue, Gauge as de, GitBranch as fe, Globe as C, Monitor as w, MousePointerClick as T, Percent as E, Smartphone as D, Tablet as O, Target as k, TrendingUp as A, Trophy as j, Wallet as M } from "lucide-react";
26
- import { jsx as N, jsxs as P } from "react/jsx-runtime";
27
- import { EmphasisPanel as F, NextSteps as I, PagePurpose as L } from "@burdenoff/fe-libs/ui";
11
+ import { useHeadshotmarketingBootstrap as ie } from "../../hooks/useHeadshotmarketingBootstrap.js";
12
+ import { toSocialAccountModel as ae } from "../../utils/socialMapper.js";
13
+ import { analyticsCsvRows as d, formatWindow as f, resolveDateWindow as p, toIsoDay as m } from "./analyticsView.js";
14
+ import { AnalyticsSourceNotice as oe, AttributionWidget as se, ChannelTableWidget as ce, ConversionFunnelWidget as le, DateRangeControl as ue, KpiSummaryWidget as h, RevenueByChannelWidget as g, RoasByChannelWidget as _, TopCampaignsWidget as v } from "./analyticsWidgets.js";
15
+ import { useAnalyticsData as y } from "./useAnalyticsData.js";
16
+ import { useMemo as b, useState as x } from "react";
17
+ import { ArrowRightLeft as S, CreditCard as C, DollarSign as w, Download as T, Eye as E, GitBranch as D, Globe as O, Monitor as k, MousePointerClick as A, Percent as j, Smartphone as M, Tablet as N, Target as P, TrendingUp as F } from "lucide-react";
18
+ import { jsx as I, jsxs as L } from "react/jsx-runtime";
19
+ import { EmphasisPanel as de, NextSteps as R, PagePurpose as z } from "@burdenoff/fe-libs/ui";
28
20
  //#region src/headshotmarketing/pages/analytics/AnalyticsPage.tsx
29
- var R = [
30
- "var(--color-chart-1)",
31
- "var(--color-chart-2)",
32
- "var(--color-chart-3)",
33
- "var(--color-chart-4)",
34
- "var(--color-chart-5)",
35
- "var(--color-chart-6)"
36
- ], z = (e) => e.replace(/\b\w/g, (e) => e.toUpperCase()), B = 5, V = () => {
37
- let { navigate: V, basePath: H } = e(), { data: U, loading: pe, error: me, refetch: he } = ae(), [W, ge] = se("overview"), G = (U?.headshotmarketingCampaigns.items ?? []).map((e) => ne(e)), _e = (U?.headshotmarketingAdCampaigns.items ?? []).map((e) => p(e)), ve = (U?.headshotmarketingSocialAccounts.items ?? []).map((e) => oe(e)), ye = m(G), K = h(G, _e), q = v(K), J = g(ve), Y = G.reduce((e, t) => (e.impressions += t.metrics.impressions, e.clicks += t.metrics.clicks, e.conversions += t.metrics.conversions, e.revenue += t.metrics.revenue, e.cost += t.metrics.cost, e), {
38
- impressions: 0,
39
- clicks: 0,
40
- conversions: 0,
41
- revenue: 0,
42
- cost: 0
43
- }), be = Y.impressions > 0 ? Y.clicks / Y.impressions * 100 : 0, xe = Y.clicks > 0 ? Y.cost / Y.clicks : 0, Se = Y.cost > 0 ? Y.revenue / Y.cost : 0, Ce = Y.conversions > 0 ? Y.cost / Y.conversions : 0, X = Y.clicks > 0 ? Y.conversions / Y.clicks * 100 : 0, Z = _(Y.impressions, Y.clicks, Y.conversions), Q = K.map((e) => ({
44
- channel: z(e.channel),
45
- revenue: e.revenue,
46
- cost: e.cost,
47
- roas: e.roas
48
- })), $ = [...G].sort((e, t) => t.metrics.revenue - e.metrics.revenue).slice(0, B), we = [
21
+ var B = () => {
22
+ let { navigate: B, basePath: V } = e(), H = ie(), [U, fe] = x("overview"), [W] = x(() => /* @__PURE__ */ new Date()), [G, pe] = x(() => ({
23
+ preset: o.Last_30Days,
24
+ customStart: m(/* @__PURE__ */ new Date(W.getTime() - 696 * 60 * 60 * 1e3)),
25
+ customEnd: m(W)
26
+ })), K = b(() => p(G.preset, W, G.customStart, G.customEnd), [G, W]), q = K ? f(K) : "the selected dates", { view: J, attribution: Y, campaigns: me, loading: he, error: ge, attributionLoading: _e, attributionError: ve, hasData: X, refetch: ye } = y(K), be = (H.data?.headshotmarketingAdCampaigns.items ?? []).map((e) => s(e)), xe = (H.data?.headshotmarketingSocialAccounts.items ?? []).map((e) => ae(e)), Z = u(c(me, be)), Q = l(xe), Se = [
49
27
  {
50
28
  key: "overview",
51
29
  label: "Overview"
@@ -58,115 +36,51 @@ var R = [
58
36
  key: "audience",
59
37
  label: "Audience"
60
38
  }
61
- ], Te = [
39
+ ], $ = () => {
40
+ let { headers: e, rows: t } = d({
41
+ title: "Analytics",
42
+ windowLabel: q,
43
+ view: J,
44
+ attribution: Y
45
+ });
46
+ n("headshotmarketing-analytics", e, t);
47
+ }, Ce = [
62
48
  {
63
49
  title: "Impressions",
64
- value: d(Y.impressions),
65
- icon: /* @__PURE__ */ N(ue, { className: "h-4 w-4" })
50
+ value: i(J.totals.impressions),
51
+ icon: /* @__PURE__ */ I(E, { className: "h-4 w-4" })
66
52
  },
67
53
  {
68
54
  title: "Clicks",
69
- value: d(Y.clicks),
70
- icon: /* @__PURE__ */ N(T, { className: "h-4 w-4" })
55
+ value: i(J.totals.clicks),
56
+ icon: /* @__PURE__ */ I(A, { className: "h-4 w-4" })
71
57
  },
72
58
  {
73
59
  title: "Conversions",
74
- value: d(Y.conversions),
75
- icon: /* @__PURE__ */ N(ce, { className: "h-4 w-4" })
76
- },
77
- {
78
- title: "Revenue",
79
- value: u(Y.revenue),
80
- icon: /* @__PURE__ */ N(S, { className: "h-4 w-4" })
60
+ value: i(J.totals.conversions),
61
+ icon: /* @__PURE__ */ I(S, { className: "h-4 w-4" })
81
62
  },
82
63
  {
83
64
  title: "Cost",
84
- value: u(Y.cost),
85
- icon: /* @__PURE__ */ N(le, { className: "h-4 w-4" })
65
+ value: r(J.totals.cost),
66
+ icon: /* @__PURE__ */ I(C, { className: "h-4 w-4" })
86
67
  },
87
68
  {
88
69
  title: "CTR",
89
- value: f(be),
90
- icon: /* @__PURE__ */ N(E, { className: "h-4 w-4" })
70
+ value: a(J.totals.ctr),
71
+ icon: /* @__PURE__ */ I(j, { className: "h-4 w-4" })
91
72
  },
92
73
  {
93
74
  title: "CPC",
94
- value: `$${xe.toFixed(2)}`,
95
- icon: /* @__PURE__ */ N(k, { className: "h-4 w-4" })
96
- },
97
- {
98
- title: "CPA",
99
- value: `$${Ce.toFixed(2)}`,
100
- icon: /* @__PURE__ */ N(M, { className: "h-4 w-4" })
101
- },
102
- {
103
- title: "Conv. Rate",
104
- value: f(X),
105
- icon: /* @__PURE__ */ N(de, { className: "h-4 w-4" })
106
- },
107
- {
108
- title: "ROAS",
109
- value: `${Se.toFixed(2)}x`,
110
- icon: /* @__PURE__ */ N(A, { className: "h-4 w-4" })
111
- }
112
- ], Ee = [
113
- {
114
- key: "channel",
115
- header: "Channel",
116
- sortable: !0,
117
- render: (e) => /* @__PURE__ */ P("div", {
118
- className: "flex items-center gap-2",
119
- children: [/* @__PURE__ */ N("div", {
120
- className: "h-3 w-3 rounded-full",
121
- style: { backgroundColor: e.color }
122
- }), /* @__PURE__ */ N("span", {
123
- className: "font-medium text-text-primary",
124
- children: e.channel
125
- })]
126
- })
127
- },
128
- {
129
- key: "revenue",
130
- header: "Revenue",
131
- sortable: !0,
132
- render: (e) => u(e.revenue)
133
- },
134
- {
135
- key: "cost",
136
- header: "Cost",
137
- sortable: !0,
138
- render: (e) => u(e.cost)
139
- },
140
- {
141
- key: "conversions",
142
- header: "Conversions",
143
- sortable: !0,
144
- render: (e) => d(e.conversions)
145
- },
146
- {
147
- key: "roas",
148
- header: "ROAS",
149
- sortable: !0,
150
- render: (e) => `${e.roas.toFixed(1)}x`
151
- },
152
- {
153
- key: "impressions",
154
- header: "Impressions",
155
- sortable: !0,
156
- render: (e) => d(e.impressions)
157
- },
158
- {
159
- key: "ctr",
160
- header: "CTR",
161
- sortable: !0,
162
- render: (e) => f(e.ctr)
75
+ value: r(J.totals.cpc),
76
+ icon: /* @__PURE__ */ I(P, { className: "h-4 w-4" })
163
77
  }
164
- ], De = [
78
+ ], we = [
165
79
  {
166
80
  key: "country",
167
81
  header: "Country",
168
82
  sortable: !0,
169
- render: (e) => /* @__PURE__ */ N("span", {
83
+ render: (e) => /* @__PURE__ */ I("span", {
170
84
  className: "font-medium",
171
85
  children: e.country
172
86
  })
@@ -175,425 +89,217 @@ var R = [
175
89
  key: "revenue",
176
90
  header: "Revenue",
177
91
  sortable: !0,
178
- render: (e) => u(e.revenue)
92
+ render: (e) => r(e.revenue)
179
93
  },
180
94
  {
181
95
  key: "users",
182
96
  header: "Users",
183
97
  sortable: !0,
184
- render: (e) => d(e.users)
98
+ render: (e) => i(e.users)
185
99
  },
186
100
  {
187
101
  key: "conversions",
188
102
  header: "Conversions",
189
103
  sortable: !0,
190
- render: (e) => d(e.conversions)
104
+ render: (e) => i(e.conversions)
191
105
  },
192
106
  {
193
107
  key: "conversionRate",
194
108
  header: "Conv. Rate",
195
109
  sortable: !0,
196
- render: (e) => f(e.conversionRate)
110
+ render: (e) => a(e.conversionRate)
197
111
  }
198
- ], Oe = {
199
- Desktop: w,
200
- Mobile: D,
201
- Tablet: O
112
+ ], Te = {
113
+ Desktop: k,
114
+ Mobile: M,
115
+ Tablet: N
202
116
  };
203
- return /* @__PURE__ */ P(y, {
117
+ return /* @__PURE__ */ L(ee, {
204
118
  title: "Analytics",
205
- description: "Comprehensive marketing performance analytics",
119
+ description: "Marketing performance for the period you choose",
120
+ actions: /* @__PURE__ */ L("div", {
121
+ className: "flex flex-wrap items-center gap-2",
122
+ children: [/* @__PURE__ */ I(ue, {
123
+ idPrefix: "hm-analytics",
124
+ value: G,
125
+ onChange: pe,
126
+ invalid: K === null
127
+ }), /* @__PURE__ */ L("button", {
128
+ type: "button",
129
+ onClick: $,
130
+ disabled: !X || K === null,
131
+ title: "Download this period's analytics as a CSV file",
132
+ className: "inline-flex min-h-[44px] items-center gap-2 rounded-md border border-border-seam bg-bg-surface px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken disabled:cursor-not-allowed disabled:opacity-60",
133
+ children: [/* @__PURE__ */ I(T, { className: "h-4 w-4" }), "Export"]
134
+ })]
135
+ }),
206
136
  children: [
207
- /* @__PURE__ */ N(L, { children: "The single source of truth for how your marketing is performing. Track reach, clicks, conversions, revenue and ROAS across every channel, then drill into channel and audience breakdowns to understand what's driving results and where to focus next." }),
208
- /* @__PURE__ */ N(I, {
137
+ /* @__PURE__ */ I(z, { children: "The single source of truth for how your marketing is performing. Pick a period to see revenue, ROAS, cost per acquisition and conversion rate, how each channel earned its revenue, which touches won the deals and which campaigns lead — then export it or drill into the channel and audience breakdowns." }),
138
+ /* @__PURE__ */ I(R, {
209
139
  storageKey: "headshotmarketing-analytics",
210
140
  steps: [
211
141
  {
212
142
  id: "campaigns",
213
143
  label: "Campaign analytics",
214
144
  description: "See which campaigns drive the most return.",
215
- icon: /* @__PURE__ */ N(k, { className: "h-4 w-4" }),
216
- onClick: () => V(H + "/analytics/campaigns")
145
+ icon: /* @__PURE__ */ I(P, { className: "h-4 w-4" }),
146
+ onClick: () => B(V + "/analytics/campaigns")
217
147
  },
218
148
  {
219
149
  id: "attribution",
220
150
  label: "Attribution",
221
151
  description: "See which channels and campaigns earned your won revenue.",
222
- icon: /* @__PURE__ */ N(fe, { className: "h-4 w-4" }),
223
- onClick: () => V(H + "/analytics/attribution")
152
+ icon: /* @__PURE__ */ I(D, { className: "h-4 w-4" }),
153
+ onClick: () => B(V + "/analytics/attribution")
224
154
  },
225
155
  {
226
156
  id: "ads",
227
157
  label: "Ad analytics",
228
158
  description: "Break down paid spend, clicks and ROAS by platform.",
229
- icon: /* @__PURE__ */ N(A, { className: "h-4 w-4" }),
230
- onClick: () => V(H + "/analytics/ads")
159
+ icon: /* @__PURE__ */ I(F, { className: "h-4 w-4" }),
160
+ onClick: () => B(V + "/analytics/ads")
231
161
  },
232
162
  {
233
163
  id: "reports",
234
164
  label: "Build a report",
235
- description: "Assemble and export a shareable report.",
236
- icon: /* @__PURE__ */ N(S, { className: "h-4 w-4" }),
237
- onClick: () => V(H + "/analytics/reports")
165
+ description: "Save, share and export a report of your own.",
166
+ icon: /* @__PURE__ */ I(w, { className: "h-4 w-4" }),
167
+ onClick: () => B(V + "/analytics/reports")
238
168
  }
239
169
  ]
240
170
  }),
241
- /* @__PURE__ */ P(ie, {
242
- loading: pe,
243
- error: me,
244
- onRetry: he,
245
- hasData: !!U,
171
+ K === null && /* @__PURE__ */ I("p", {
172
+ role: "alert",
173
+ className: "rounded-lg border border-status-error-border px-4 py-3 text-sm text-status-error-text",
174
+ children: "Choose a start date on or before the end date, at most two years apart."
175
+ }),
176
+ /* @__PURE__ */ L(re, {
177
+ loading: he,
178
+ error: ge,
179
+ onRetry: ye,
180
+ hasData: X,
246
181
  children: [
247
- /* @__PURE__ */ N(F, { children: /* @__PURE__ */ N("div", {
248
- className: "grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-4",
249
- children: Te.map((e) => /* @__PURE__ */ N(re, {
250
- title: e.title,
251
- value: e.value,
252
- icon: e.icon
253
- }, e.title))
254
- }) }),
255
- /* @__PURE__ */ N("div", {
182
+ /* @__PURE__ */ I(oe, {
183
+ source: J.source,
184
+ windowLabel: q
185
+ }),
186
+ /* @__PURE__ */ I(de, { children: /* @__PURE__ */ I(h, { view: J }) }),
187
+ /* @__PURE__ */ I("div", {
256
188
  className: "border-b border-border-subtle",
257
- children: /* @__PURE__ */ N("div", {
189
+ children: /* @__PURE__ */ I("div", {
258
190
  className: "flex flex-nowrap gap-6 overflow-x-auto",
259
- children: we.map((e) => /* @__PURE__ */ N("button", {
260
- onClick: () => ge(e.key),
261
- className: te("shrink-0 whitespace-nowrap pb-3 text-sm font-medium transition-colors border-b-2", W === e.key ? "border-primary text-text-primary" : "border-transparent text-text-secondary hover:text-text-primary"),
191
+ children: Se.map((e) => /* @__PURE__ */ I("button", {
192
+ onClick: () => fe(e.key),
193
+ className: t("shrink-0 whitespace-nowrap pb-3 text-sm font-medium transition-colors border-b-2", U === e.key ? "border-primary text-text-primary" : "border-transparent text-text-secondary hover:text-text-primary"),
262
194
  children: e.label
263
195
  }, e.key))
264
196
  })
265
197
  }),
266
- W === "overview" && /* @__PURE__ */ P("div", {
198
+ U === "overview" && /* @__PURE__ */ L("div", {
267
199
  className: "space-y-6",
268
200
  children: [
269
- /* @__PURE__ */ P("div", {
270
- className: "grid grid-cols-1 lg:grid-cols-2 gap-6",
271
- children: [/* @__PURE__ */ N(x, {
272
- title: "Revenue Over Time",
273
- subtitle: "Last 30 days",
274
- children: /* @__PURE__ */ N(r, {
275
- width: "100%",
276
- height: 300,
277
- children: /* @__PURE__ */ P(ee, {
278
- data: ye,
279
- children: [
280
- /* @__PURE__ */ N(a, {
281
- strokeDasharray: "3 3",
282
- className: "stroke-border"
283
- }),
284
- /* @__PURE__ */ N(s, {
285
- dataKey: "date",
286
- tick: { fontSize: 12 },
287
- className: "text-text-secondary"
288
- }),
289
- /* @__PURE__ */ N(c, {
290
- tick: { fontSize: 12 },
291
- className: "text-text-secondary"
292
- }),
293
- /* @__PURE__ */ N(n, {}),
294
- /* @__PURE__ */ N(o, {
295
- type: "monotone",
296
- dataKey: "revenue",
297
- stroke: R[0],
298
- fill: R[0],
299
- fillOpacity: .1
300
- }),
301
- /* @__PURE__ */ N(o, {
302
- type: "monotone",
303
- dataKey: "cost",
304
- stroke: R[3],
305
- fill: R[3],
306
- fillOpacity: .1
307
- }),
308
- /* @__PURE__ */ N(t, {})
309
- ]
310
- })
311
- })
312
- }), /* @__PURE__ */ N(x, {
313
- title: "Conversion Funnel",
314
- subtitle: "Current period",
315
- children: /* @__PURE__ */ N(r, {
316
- width: "100%",
317
- height: 300,
318
- children: /* @__PURE__ */ P(l, {
319
- data: Z,
320
- layout: "vertical",
321
- children: [
322
- /* @__PURE__ */ N(a, {
323
- strokeDasharray: "3 3",
324
- className: "stroke-border"
325
- }),
326
- /* @__PURE__ */ N(s, {
327
- type: "number",
328
- tick: { fontSize: 12 },
329
- className: "text-text-secondary"
330
- }),
331
- /* @__PURE__ */ N(c, {
332
- dataKey: "stage",
333
- type: "category",
334
- tick: { fontSize: 12 },
335
- width: 100,
336
- className: "text-text-secondary"
337
- }),
338
- /* @__PURE__ */ N(n, { formatter: (e) => d(e) }),
339
- /* @__PURE__ */ N(i, {
340
- dataKey: "value",
341
- radius: [
342
- 0,
343
- 4,
344
- 4,
345
- 0
346
- ],
347
- children: Z.map((e, t) => /* @__PURE__ */ N(i, {
348
- dataKey: "value",
349
- fill: e.color
350
- }, t))
351
- })
352
- ]
353
- })
354
- })
201
+ /* @__PURE__ */ L("div", {
202
+ className: "grid grid-cols-1 gap-6 lg:grid-cols-5",
203
+ children: [/* @__PURE__ */ I(g, {
204
+ view: J,
205
+ className: "lg:col-span-3"
206
+ }), /* @__PURE__ */ I(_, {
207
+ view: J,
208
+ className: "lg:col-span-2"
355
209
  })]
356
210
  }),
357
- /* @__PURE__ */ P("div", {
358
- className: "grid grid-cols-1 lg:grid-cols-2 gap-6",
359
- children: [/* @__PURE__ */ N(x, {
360
- title: "Revenue by Channel",
361
- subtitle: "Revenue against spend, per channel",
362
- children: Q.length === 0 ? /* @__PURE__ */ N("p", {
363
- className: "py-12 text-center text-sm text-text-secondary",
364
- children: "No channel performance recorded yet."
365
- }) : /* @__PURE__ */ N(r, {
366
- width: "100%",
367
- height: 300,
368
- children: /* @__PURE__ */ P(l, {
369
- data: Q,
370
- children: [
371
- /* @__PURE__ */ N(a, {
372
- strokeDasharray: "3 3",
373
- className: "stroke-border"
374
- }),
375
- /* @__PURE__ */ N(s, {
376
- dataKey: "channel",
377
- tick: { fontSize: 12 },
378
- className: "text-text-secondary"
379
- }),
380
- /* @__PURE__ */ N(c, {
381
- tick: { fontSize: 12 },
382
- className: "text-text-secondary"
383
- }),
384
- /* @__PURE__ */ N(n, { formatter: (e) => u(e) }),
385
- /* @__PURE__ */ N(t, {}),
386
- /* @__PURE__ */ N(i, {
387
- dataKey: "revenue",
388
- name: "Revenue",
389
- fill: R[0],
390
- radius: [
391
- 4,
392
- 4,
393
- 0,
394
- 0
395
- ]
396
- }),
397
- /* @__PURE__ */ N(i, {
398
- dataKey: "cost",
399
- name: "Cost",
400
- fill: R[3],
401
- radius: [
402
- 4,
403
- 4,
404
- 0,
405
- 0
406
- ]
407
- })
408
- ]
409
- })
410
- })
411
- }), /* @__PURE__ */ N(x, {
412
- title: "ROAS by Channel",
413
- subtitle: "Return on ad spend, per channel",
414
- children: Q.length === 0 ? /* @__PURE__ */ N("p", {
415
- className: "py-12 text-center text-sm text-text-secondary",
416
- children: "No channel performance recorded yet."
417
- }) : /* @__PURE__ */ N(r, {
418
- width: "100%",
419
- height: 300,
420
- children: /* @__PURE__ */ P(l, {
421
- data: Q,
422
- layout: "vertical",
423
- children: [
424
- /* @__PURE__ */ N(a, {
425
- strokeDasharray: "3 3",
426
- className: "stroke-border"
427
- }),
428
- /* @__PURE__ */ N(s, {
429
- type: "number",
430
- tick: { fontSize: 12 },
431
- className: "text-text-secondary"
432
- }),
433
- /* @__PURE__ */ N(c, {
434
- dataKey: "channel",
435
- type: "category",
436
- width: 100,
437
- tick: { fontSize: 12 },
438
- className: "text-text-secondary"
439
- }),
440
- /* @__PURE__ */ N(n, { formatter: (e) => `${e.toFixed(2)}x` }),
441
- /* @__PURE__ */ N(i, {
442
- dataKey: "roas",
443
- name: "ROAS",
444
- fill: R[1],
445
- radius: [
446
- 0,
447
- 4,
448
- 4,
449
- 0
450
- ]
451
- })
452
- ]
453
- })
454
- })
211
+ /* @__PURE__ */ L("div", {
212
+ className: "grid grid-cols-1 gap-6 lg:grid-cols-5",
213
+ children: [/* @__PURE__ */ I(se, {
214
+ className: "lg:col-span-3",
215
+ attribution: Y,
216
+ loading: _e,
217
+ error: ve
218
+ }), /* @__PURE__ */ I(v, {
219
+ className: "lg:col-span-2",
220
+ view: J,
221
+ onOpenCampaign: (e) => B(V + "/campaigns/" + e)
455
222
  })]
456
223
  }),
457
- /* @__PURE__ */ P("div", {
458
- className: "rounded-lg border border-border-seam bg-gloss-card shadow-pop p-6",
459
- children: [/* @__PURE__ */ P("div", {
460
- className: "mb-4 flex items-center gap-2",
461
- children: [/* @__PURE__ */ N(j, { className: "h-5 w-5 text-text-secondary" }), /* @__PURE__ */ N("h3", {
462
- className: "text-sm font-semibold text-text-primary",
463
- children: "Top Campaigns"
464
- })]
465
- }), $.length === 0 ? /* @__PURE__ */ N("p", {
466
- className: "text-sm text-text-secondary",
467
- children: "No campaigns yet — create one to start tracking revenue."
468
- }) : /* @__PURE__ */ N("div", {
469
- className: "overflow-x-auto",
470
- children: /* @__PURE__ */ P("table", {
471
- className: "w-full min-w-[420px] text-left text-sm",
472
- children: [/* @__PURE__ */ N("thead", { children: /* @__PURE__ */ P("tr", {
473
- className: "border-b border-border-subtle",
474
- children: [
475
- /* @__PURE__ */ N("th", {
476
- className: "w-8 pb-2 text-xs font-medium text-text-secondary",
477
- children: "#"
478
- }),
479
- /* @__PURE__ */ N("th", {
480
- className: "pb-2 pr-3 text-xs font-medium text-text-secondary",
481
- children: "Campaign"
482
- }),
483
- /* @__PURE__ */ N("th", {
484
- className: "pb-2 pr-3 text-right text-xs font-medium text-text-secondary",
485
- children: "Revenue"
486
- }),
487
- /* @__PURE__ */ N("th", {
488
- className: "pb-2 pr-3 text-right text-xs font-medium text-text-secondary",
489
- children: "Conversions"
490
- }),
491
- /* @__PURE__ */ N("th", {
492
- className: "pb-2 text-right text-xs font-medium text-text-secondary",
493
- children: "ROAS"
494
- })
495
- ]
496
- }) }), /* @__PURE__ */ N("tbody", { children: $.map((e, t) => /* @__PURE__ */ P("tr", {
497
- className: "border-b border-border-subtle/60 last:border-0",
498
- children: [
499
- /* @__PURE__ */ N("td", {
500
- className: "py-2.5 text-xs tabular-nums text-text-secondary",
501
- children: t + 1
502
- }),
503
- /* @__PURE__ */ N("td", {
504
- className: "py-2.5 pr-3 font-medium text-text-primary",
505
- children: e.name
506
- }),
507
- /* @__PURE__ */ N("td", {
508
- className: "py-2.5 pr-3 text-right tabular-nums text-text-primary",
509
- children: u(e.metrics.revenue)
510
- }),
511
- /* @__PURE__ */ N("td", {
512
- className: "py-2.5 pr-3 text-right tabular-nums text-text-secondary",
513
- children: d(e.metrics.conversions)
514
- }),
515
- /* @__PURE__ */ P("td", {
516
- className: "py-2.5 text-right tabular-nums text-text-secondary",
517
- children: [e.metrics.roas.toFixed(2), "x"]
518
- })
519
- ]
520
- }, e.id)) })]
521
- })
224
+ /* @__PURE__ */ L("div", {
225
+ className: "grid grid-cols-1 gap-6 lg:grid-cols-3",
226
+ children: [/* @__PURE__ */ I(le, { view: J }), /* @__PURE__ */ I("div", {
227
+ className: "grid grid-cols-2 gap-4 lg:col-span-2 md:grid-cols-3",
228
+ children: Ce.map((e) => /* @__PURE__ */ I(te, {
229
+ title: e.title,
230
+ value: e.value,
231
+ icon: e.icon
232
+ }, e.title))
522
233
  })]
523
234
  })
524
235
  ]
525
236
  }),
526
- W === "channels" && /* @__PURE__ */ N(b, {
527
- data: K,
528
- columns: Ee,
529
- searchable: !0,
530
- searchPlaceholder: "Search channels..."
531
- }),
532
- W === "audience" && /* @__PURE__ */ P("div", {
237
+ U === "channels" && /* @__PURE__ */ I(ce, { view: J }),
238
+ U === "audience" && /* @__PURE__ */ L("div", {
533
239
  className: "space-y-6",
534
- children: [/* @__PURE__ */ P("div", {
240
+ children: [/* @__PURE__ */ L("div", {
535
241
  className: "grid grid-cols-1 lg:grid-cols-2 gap-6",
536
- children: [/* @__PURE__ */ P("div", {
242
+ children: [/* @__PURE__ */ L("div", {
537
243
  className: "rounded-lg border border-border-seam bg-gloss-card shadow-pop p-6",
538
- children: [/* @__PURE__ */ P("div", {
244
+ children: [/* @__PURE__ */ L("div", {
539
245
  className: "flex items-center gap-2 mb-4",
540
- children: [/* @__PURE__ */ N(C, { className: "h-5 w-5 text-text-secondary" }), /* @__PURE__ */ N("h3", {
246
+ children: [/* @__PURE__ */ I(O, { className: "h-5 w-5 text-text-secondary" }), /* @__PURE__ */ I("h3", {
541
247
  className: "text-sm font-semibold text-text-primary",
542
248
  children: "Top Countries"
543
249
  })]
544
- }), /* @__PURE__ */ N("div", {
250
+ }), /* @__PURE__ */ I("div", {
545
251
  className: "space-y-3",
546
- children: q.map((e) => /* @__PURE__ */ P("div", {
252
+ children: Z.map((e) => /* @__PURE__ */ L("div", {
547
253
  className: "flex items-center justify-between",
548
- children: [/* @__PURE__ */ P("div", {
254
+ children: [/* @__PURE__ */ L("div", {
549
255
  className: "flex items-center gap-2",
550
- children: [/* @__PURE__ */ N("span", {
256
+ children: [/* @__PURE__ */ I("span", {
551
257
  className: "text-xs font-mono text-text-secondary w-6",
552
258
  children: e.countryCode
553
- }), /* @__PURE__ */ N("span", {
259
+ }), /* @__PURE__ */ I("span", {
554
260
  className: "text-sm text-text-primary",
555
261
  children: e.country
556
262
  })]
557
- }), /* @__PURE__ */ P("div", {
263
+ }), /* @__PURE__ */ L("div", {
558
264
  className: "flex items-center gap-4",
559
- children: [/* @__PURE__ */ N("span", {
265
+ children: [/* @__PURE__ */ I("span", {
560
266
  className: "text-sm font-medium text-text-primary",
561
- children: u(e.revenue)
562
- }), /* @__PURE__ */ N("div", {
267
+ children: r(e.revenue)
268
+ }), /* @__PURE__ */ I("div", {
563
269
  className: "w-24 h-2 rounded-full bg-bg-sunken overflow-hidden",
564
- children: /* @__PURE__ */ N("div", {
270
+ children: /* @__PURE__ */ I("div", {
565
271
  className: "h-full rounded-full bg-action-primary-bg",
566
- style: { width: `${e.revenue / (q[0]?.revenue || 1) * 100}%` }
272
+ style: { width: `${e.revenue / (Z[0]?.revenue || 1) * 100}%` }
567
273
  })
568
274
  })]
569
275
  })]
570
276
  }, e.countryCode))
571
277
  })]
572
- }), /* @__PURE__ */ P("div", {
278
+ }), /* @__PURE__ */ L("div", {
573
279
  className: "rounded-lg border border-border-seam bg-gloss-card shadow-pop p-6",
574
280
  children: [
575
- /* @__PURE__ */ N("h3", {
281
+ /* @__PURE__ */ I("h3", {
576
282
  className: "text-sm font-semibold text-text-primary mb-4",
577
283
  children: "Device Breakdown"
578
284
  }),
579
- /* @__PURE__ */ N("div", {
285
+ /* @__PURE__ */ I("div", {
580
286
  className: "space-y-4",
581
- children: J.devices.map((e) => /* @__PURE__ */ P("div", {
287
+ children: Q.devices.map((e) => /* @__PURE__ */ L("div", {
582
288
  className: "flex items-center gap-3",
583
- children: [/* @__PURE__ */ N(Oe[e.device] || w, { className: "h-5 w-5 text-text-secondary" }), /* @__PURE__ */ P("div", {
289
+ children: [/* @__PURE__ */ I(Te[e.device] || k, { className: "h-5 w-5 text-text-secondary" }), /* @__PURE__ */ L("div", {
584
290
  className: "flex-1",
585
- children: [/* @__PURE__ */ P("div", {
291
+ children: [/* @__PURE__ */ L("div", {
586
292
  className: "flex items-center justify-between mb-1",
587
- children: [/* @__PURE__ */ N("span", {
293
+ children: [/* @__PURE__ */ I("span", {
588
294
  className: "text-sm text-text-primary",
589
295
  children: e.device
590
- }), /* @__PURE__ */ N("span", {
296
+ }), /* @__PURE__ */ I("span", {
591
297
  className: "text-sm font-medium text-text-primary",
592
- children: f(e.percentage)
298
+ children: a(e.percentage)
593
299
  })]
594
- }), /* @__PURE__ */ N("div", {
300
+ }), /* @__PURE__ */ I("div", {
595
301
  className: "w-full h-2 rounded-full bg-bg-sunken overflow-hidden",
596
- children: /* @__PURE__ */ N("div", {
302
+ children: /* @__PURE__ */ I("div", {
597
303
  className: "h-full rounded-full bg-action-primary-bg",
598
304
  style: { width: `${e.percentage}%` }
599
305
  })
@@ -601,30 +307,30 @@ var R = [
601
307
  })]
602
308
  }, e.device))
603
309
  }),
604
- /* @__PURE__ */ P("div", {
310
+ /* @__PURE__ */ L("div", {
605
311
  className: "mt-6 pt-4 border-t border-border-subtle",
606
- children: [/* @__PURE__ */ N("h4", {
312
+ children: [/* @__PURE__ */ I("h4", {
607
313
  className: "text-sm font-semibold text-text-primary mb-3",
608
314
  children: "Browser Usage"
609
- }), /* @__PURE__ */ N("div", {
315
+ }), /* @__PURE__ */ I("div", {
610
316
  className: "space-y-2",
611
- children: J.browsers.map((e) => /* @__PURE__ */ P("div", {
317
+ children: Q.browsers.map((e) => /* @__PURE__ */ L("div", {
612
318
  className: "flex items-center justify-between text-sm",
613
- children: [/* @__PURE__ */ N("span", {
319
+ children: [/* @__PURE__ */ I("span", {
614
320
  className: "text-text-secondary",
615
321
  children: e.browser
616
- }), /* @__PURE__ */ N("span", {
322
+ }), /* @__PURE__ */ I("span", {
617
323
  className: "font-medium text-text-primary",
618
- children: f(e.percentage)
324
+ children: a(e.percentage)
619
325
  })]
620
326
  }, e.browser))
621
327
  })]
622
328
  })
623
329
  ]
624
330
  })]
625
- }), /* @__PURE__ */ N(b, {
626
- data: q,
627
- columns: De,
331
+ }), /* @__PURE__ */ I(ne, {
332
+ data: Z,
333
+ columns: we,
628
334
  searchable: !0,
629
335
  searchPlaceholder: "Search countries..."
630
336
  })]
@@ -635,6 +341,6 @@ var R = [
635
341
  });
636
342
  };
637
343
  //#endregion
638
- export { V as AnalyticsPage };
344
+ export { B as AnalyticsPage };
639
345
 
640
346
  //# sourceMappingURL=AnalyticsPage.js.map