@burdenoff/microfe-billing 2026.1113.2 → 2026.1113.4

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 (118) hide show
  1. package/dist/billing/BillingRoot.js +83 -77
  2. package/dist/billing/BillingRoot.js.map +1 -1
  3. package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js +78 -78
  4. package/dist/billing/modules/addons/pages/AddonCreatePage.js +70 -70
  5. package/dist/billing/modules/addons/pages/AddonDetailPage.js +72 -72
  6. package/dist/billing/modules/addons/pages/AddonEditPage.js +79 -79
  7. package/dist/billing/modules/addons/pages/AddonsBrowsePage.js +224 -224
  8. package/dist/billing/modules/addons/pages/AddonsListPage.js +186 -186
  9. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js +168 -168
  10. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js.map +1 -1
  11. package/dist/billing/modules/analytics/pages/AnalyticsPage.js +88 -88
  12. package/dist/billing/modules/billing/hooks/index.js +5 -5
  13. package/dist/billing/modules/billing/hooks/useInvoices.js +39 -20
  14. package/dist/billing/modules/billing/hooks/useInvoices.js.map +1 -1
  15. package/dist/billing/modules/billing/index.js +14 -14
  16. package/dist/billing/modules/billing/pages/BillingWebhookLogsPage.js +92 -92
  17. package/dist/billing/modules/billing/pages/InvoiceDetailPage.js +160 -160
  18. package/dist/billing/modules/billing/pages/InvoiceDetailPage.js.map +1 -1
  19. package/dist/billing/modules/billing/pages/InvoicesListPage.js +100 -100
  20. package/dist/billing/modules/billing/pages/OrderCallbackLogsPage.js +105 -105
  21. package/dist/billing/modules/billing/pages/PaymentMethodsPage.js +37 -37
  22. package/dist/billing/modules/billing/pages/RefundIssueLogsPage.js +41 -41
  23. package/dist/billing/modules/billing/pages/RefundsPage.js +334 -334
  24. package/dist/billing/modules/billing/pages/RefundsPage.js.map +1 -1
  25. package/dist/billing/modules/billing/pages/TransactionsPage.js +174 -174
  26. package/dist/billing/modules/billing/pages/TransactionsPage.js.map +1 -1
  27. package/dist/billing/modules/billing/pages/UserRefundsPage.js +24 -24
  28. package/dist/billing/modules/billing/pages/UserRefundsPage.js.map +1 -1
  29. package/dist/billing/modules/checkout/components/OrderSummary.js +71 -71
  30. package/dist/billing/modules/checkout/pages/CheckoutPage.js +646 -625
  31. package/dist/billing/modules/checkout/pages/CheckoutPage.js.map +1 -1
  32. package/dist/billing/modules/checkout/utils/checkoutOptions.d.ts +23 -0
  33. package/dist/billing/modules/checkout/utils/checkoutOptions.js +8 -0
  34. package/dist/billing/modules/checkout/utils/checkoutOptions.js.map +1 -0
  35. package/dist/billing/modules/coupons/pages/CouponDetailPage.js +112 -112
  36. package/dist/billing/modules/coupons/pages/CouponsListPage.js +118 -118
  37. package/dist/billing/modules/coupons/pages/CouponsListPage.js.map +1 -1
  38. package/dist/billing/modules/coupons/pages/CreateCouponPage.js +119 -119
  39. package/dist/billing/modules/coupons/pages/EditCouponPage.js +82 -82
  40. package/dist/billing/modules/credits/pages/AdminCreditsPage.js +30 -30
  41. package/dist/billing/modules/credits/pages/CreditTransactionsPage.js +77 -77
  42. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +187 -164
  43. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js.map +1 -1
  44. package/dist/billing/modules/credits/pages/CreditsPage.js +67 -67
  45. package/dist/billing/modules/dashboard/pages/OverviewPage.js +594 -442
  46. package/dist/billing/modules/dashboard/pages/OverviewPage.js.map +1 -1
  47. package/dist/billing/modules/dashboard/utils/overviewSummary.d.ts +46 -0
  48. package/dist/billing/modules/dashboard/utils/overviewSummary.js +37 -0
  49. package/dist/billing/modules/dashboard/utils/overviewSummary.js.map +1 -0
  50. package/dist/billing/modules/discounts/pages/DiscountsListPage.js +199 -199
  51. package/dist/billing/modules/discounts/pages/DiscountsListPage.js.map +1 -1
  52. package/dist/billing/modules/earnings/components/PayoutDestinationList.d.ts +15 -0
  53. package/dist/billing/modules/earnings/components/PayoutDestinationList.js +66 -0
  54. package/dist/billing/modules/earnings/components/PayoutDestinationList.js.map +1 -0
  55. package/dist/billing/modules/earnings/components/PayoutErrorNotice.d.ts +7 -0
  56. package/dist/billing/modules/earnings/components/PayoutErrorNotice.js +19 -0
  57. package/dist/billing/modules/earnings/components/PayoutErrorNotice.js.map +1 -0
  58. package/dist/billing/modules/earnings/pages/DeveloperRevenueAdminPage.js +64 -64
  59. package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js +122 -122
  60. package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js.map +1 -1
  61. package/dist/billing/modules/earnings/pages/EarningsPage.js +123 -110
  62. package/dist/billing/modules/earnings/pages/EarningsPage.js.map +1 -1
  63. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js +178 -178
  64. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js.map +1 -1
  65. package/dist/billing/modules/earnings/pages/PayoutsPage.js +215 -157
  66. package/dist/billing/modules/earnings/pages/PayoutsPage.js.map +1 -1
  67. package/dist/billing/modules/earnings/utils/payoutDestination.d.ts +20 -0
  68. package/dist/billing/modules/earnings/utils/payoutDestination.js +27 -0
  69. package/dist/billing/modules/earnings/utils/payoutDestination.js.map +1 -0
  70. package/dist/billing/modules/earnings/utils/plainPayoutError.d.ts +10 -0
  71. package/dist/billing/modules/earnings/utils/plainPayoutError.js +50 -0
  72. package/dist/billing/modules/earnings/utils/plainPayoutError.js.map +1 -0
  73. package/dist/billing/modules/plans/pages/PlanAssignFreePage.js +54 -54
  74. package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js +94 -94
  75. package/dist/billing/modules/plans/pages/PlanCreatePage.js +73 -73
  76. package/dist/billing/modules/plans/pages/PlanDetailPage.js +96 -96
  77. package/dist/billing/modules/plans/pages/PlanEditPage.js +16 -16
  78. package/dist/billing/modules/plans/pages/PlanEditPage.js.map +1 -1
  79. package/dist/billing/modules/plans/pages/PlansBrowsePage.js +100 -100
  80. package/dist/billing/modules/plans/pages/PlansListPage.js +88 -88
  81. package/dist/billing/modules/promotions/pages/CreatePromotionPage.js +60 -60
  82. package/dist/billing/modules/promotions/pages/PromotionsListPage.js +37 -37
  83. package/dist/billing/modules/quota/pages/QuotaAssignFreePage.js +62 -62
  84. package/dist/billing/modules/quota/pages/QuotaPage.js +1 -1
  85. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js +69 -69
  86. package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js +76 -76
  87. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js +80 -80
  88. package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js +95 -95
  89. package/dist/billing/modules/settings/pages/SettingsPage.js +134 -134
  90. package/dist/billing/modules/settings/pages/SettingsPage.js.map +1 -1
  91. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js +62 -62
  92. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js.map +1 -1
  93. package/dist/billing/modules/subscriptions/components/ManageSeatsModal.js +36 -36
  94. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js +534 -410
  95. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js.map +1 -1
  96. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js +111 -111
  97. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js +166 -160
  98. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js.map +1 -1
  99. package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.d.ts +30 -0
  100. package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.js +20 -0
  101. package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.js.map +1 -0
  102. package/dist/billing/modules/subscriptions/utils/upgradeAccess.d.ts +10 -0
  103. package/dist/billing/modules/subscriptions/utils/upgradeAccess.js +7 -0
  104. package/dist/billing/modules/subscriptions/utils/upgradeAccess.js.map +1 -0
  105. package/dist/billing/modules/usage/pages/UsagePage.js +722 -591
  106. package/dist/billing/modules/usage/pages/UsagePage.js.map +1 -1
  107. package/dist/billing/modules/usage/utils/usageHealth.d.ts +63 -0
  108. package/dist/billing/modules/usage/utils/usageHealth.js +43 -0
  109. package/dist/billing/modules/usage/utils/usageHealth.js.map +1 -0
  110. package/dist/billing/shared/components/EmptyState.js +3 -3
  111. package/dist/billing/shared/components/MoneyActionDialog.js +12 -12
  112. package/dist/billing/shared/ui/MetricCard.js +13 -13
  113. package/dist/billing/shared/utils/format.js +16 -4
  114. package/dist/billing/shared/utils/format.js.map +1 -1
  115. package/dist/billing/shared/utils/index.js +8 -8
  116. package/dist/generated/global-operations.js +294 -286
  117. package/dist/generated/global-operations.js.map +1 -1
  118. package/package.json +2 -2
@@ -1,10 +1,10 @@
1
1
  import { useBilling as e } from "../../../providers/BillingProvider.js";
2
2
  import { AccessDenied as t } from "../../../shared/components/AccessDenied.js";
3
3
  import { PageHeader as n } from "../../../shared/components/PageHeader.js";
4
- import { StatCard as ee } from "../../../shared/components/StatCard.js";
5
- import { ServerError as r } from "../../../shared/components/ServerError.js";
6
- import { MoneyActionDialog as i } from "../../../shared/components/MoneyActionDialog.js";
7
- import { useBillingEventEmitter as a } from "../../../hooks/useBillingEventEmitter.js";
4
+ import { StatCard as r } from "../../../shared/components/StatCard.js";
5
+ import { ServerError as i } from "../../../shared/components/ServerError.js";
6
+ import { MoneyActionDialog as a } from "../../../shared/components/MoneyActionDialog.js";
7
+ import { useBillingEventEmitter as ee } from "../../../hooks/useBillingEventEmitter.js";
8
8
  import { useBillingPermissions as te } from "../../../hooks/useBillingPermissions.js";
9
9
  import { formatCurrency as o, formatDateTime as s } from "../../../shared/utils/format.js";
10
10
  import { isServerError as c } from "../../../shared/utils/error.js";
@@ -13,11 +13,11 @@ import "../../../shared/components/index.js";
13
13
  import "../../../shared/utils/index.js";
14
14
  import { addAffiliateCodeNote as u, createAffiliateCode as d, deactivateAffiliateCode as f, fetchMyAffiliateAnalytics as p, fetchMyAffiliateCodes as m, fetchMyAffiliateJourneys as h, updateAffiliateCode as g } from "../api.js";
15
15
  import { useCallback as _, useEffect as v, useMemo as y, useState as b } from "react";
16
- import { Link2 as ne, Plus as re, RefreshCw as ie, StickyNote as ae, Ticket as oe, TrendingUp as se, Users as ce } from "lucide-react";
17
- import { jsx as x, jsxs as S } from "react/jsx-runtime";
18
- import { CTAOverflowMenu as le, EmphasisPanel as ue, IllustratedEmptyState as C, PagePurpose as w, ResponsiveTable as T } from "@burdenoff/fe-libs/ui";
16
+ import { CTAOverflowMenu as ne, EmphasisPanel as re, IllustratedEmptyState as x, PagePurpose as ie, ResponsiveTable as ae } from "@burdenoff/fe-libs/ui";
17
+ import { Link2 as oe, Plus as se, RefreshCw as ce, StickyNote as le, Ticket as ue, TrendingUp as de, Users as S } from "lucide-react";
18
+ import { jsx as C, jsxs as w } from "react/jsx-runtime";
19
19
  // src/billing/modules/affiliate/pages/AffiliateDashboardPage.tsx
20
- var E = [
20
+ var T = [
21
21
  {
22
22
  key: "code",
23
23
  header: "Code",
@@ -49,88 +49,88 @@ var E = [
49
49
  header: "Visited",
50
50
  cell: (e) => s(e.lastVisitedAt)
51
51
  }
52
- ], D = () => {
53
- let s = te(), D = l(), [O, k] = b(null), [A, j] = b(!1), [M, N] = b(null), { emit: P } = a(), { apiGatewayUrl: F, authToken: I, orgId: L } = e(), [R, de] = b([]), [z, B] = b([]), [V, H] = b(null), [U, W] = b(!0), [G, K] = b(null), [fe, q] = b(null), [J, Y] = b({
52
+ ], E = () => {
53
+ let s = te(), E = l(), [D, O] = b(null), [k, A] = b(!1), [j, M] = b(null), { emit: N } = ee(), { apiGatewayUrl: P, authToken: F, orgId: I } = e(), [L, fe] = b([]), [R, z] = b([]), [B, V] = b(null), [H, U] = b(!0), [W, G] = b(null), [pe, K] = b(null), [q, J] = b({
54
54
  label: "",
55
55
  description: "",
56
56
  notes: "",
57
57
  productSlug: "",
58
58
  destinationPath: "",
59
59
  destinationUrl: ""
60
- }), X = y(() => ({
61
- apiGatewayUrl: F,
62
- authToken: I,
63
- orgId: L
60
+ }), Y = y(() => ({
61
+ apiGatewayUrl: P,
62
+ authToken: F,
63
+ orgId: I
64
64
  }), [
65
+ P,
65
66
  F,
66
- I,
67
- L
68
- ]), Z = _(async () => {
69
- W(!0), K(null);
67
+ I
68
+ ]), X = _(async () => {
69
+ U(!0), G(null);
70
70
  try {
71
71
  let [e, t, n] = await Promise.all([
72
- m(X),
73
- p(X),
74
- h(X)
72
+ m(Y),
73
+ p(Y),
74
+ h(Y)
75
75
  ]);
76
- de(e), H(t), B(n);
76
+ fe(e), V(t), z(n);
77
77
  } catch (e) {
78
- K(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load affiliate dashboard"));
78
+ G(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load affiliate dashboard"));
79
79
  } finally {
80
- W(!1);
80
+ U(!1);
81
81
  }
82
- }, [X]);
82
+ }, [Y]);
83
83
  if (v(() => {
84
- Z();
85
- }, [Z]), !s.canViewBillingAccount) return /* @__PURE__ */ x(t, { message: "You don't have permission to view affiliate analytics." });
86
- if (G && c(G)) return /* @__PURE__ */ x(r, {
84
+ X();
85
+ }, [X]), !s.canViewBillingAccount) return /* @__PURE__ */ C(t, { message: "You don't have permission to view affiliate analytics." });
86
+ if (W && c(W)) return /* @__PURE__ */ C(i, {
87
87
  title: "Affiliate service unavailable",
88
- message: G.message,
89
- onRetry: () => void Z(),
88
+ message: W.message,
89
+ onRetry: () => void X(),
90
90
  showRetry: !0
91
91
  });
92
- let Q = R.find((e) => e.id === fe) ?? null, pe = async () => {
93
- if (!J.productSlug.trim()) K(/* @__PURE__ */ Error("Product slug is required"));
92
+ let Z = L.find((e) => e.id === pe) ?? null, me = async () => {
93
+ if (!q.productSlug.trim()) G(/* @__PURE__ */ Error("Product slug is required"));
94
94
  else try {
95
- if (Q) await g(Q.id, {
96
- label: J.label,
97
- description: J.description,
98
- notes: J.notes,
99
- destinationPath: J.destinationPath,
100
- destinationUrl: J.destinationUrl
101
- }, X), P("billing.affiliate_code.updated", {
95
+ if (Z) await g(Z.id, {
96
+ label: q.label,
97
+ description: q.description,
98
+ notes: q.notes,
99
+ destinationPath: q.destinationPath,
100
+ destinationUrl: q.destinationUrl
101
+ }, Y), N("billing.affiliate_code.updated", {
102
102
  route: "/billing/affiliate",
103
- entityId: Q.id,
103
+ entityId: Z.id,
104
104
  source: "affiliate-dashboard"
105
105
  });
106
106
  else {
107
107
  let e = await d({
108
- label: J.label,
109
- description: J.description,
110
- notes: J.notes,
111
- productSlug: J.productSlug,
112
- destinationPath: J.destinationPath,
113
- destinationUrl: J.destinationUrl
114
- }, X);
115
- P("billing.affiliate_code.created", {
108
+ label: q.label,
109
+ description: q.description,
110
+ notes: q.notes,
111
+ productSlug: q.productSlug,
112
+ destinationPath: q.destinationPath,
113
+ destinationUrl: q.destinationUrl
114
+ }, Y);
115
+ N("billing.affiliate_code.created", {
116
116
  route: "/billing/affiliate",
117
117
  entityId: e.id,
118
118
  source: "affiliate-dashboard"
119
119
  });
120
120
  }
121
- q(null), Y({
121
+ K(null), J({
122
122
  label: "",
123
123
  description: "",
124
124
  notes: "",
125
125
  productSlug: "",
126
126
  destinationPath: "",
127
127
  destinationUrl: ""
128
- }), await Z();
128
+ }), await X();
129
129
  } catch (e) {
130
- K(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to save affiliate code"));
130
+ G(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to save affiliate code"));
131
131
  }
132
- }, me = (e) => {
133
- q(e.id), Y({
132
+ }, he = (e) => {
133
+ K(e.id), J({
134
134
  label: e.label ?? "",
135
135
  description: e.description ?? "",
136
136
  notes: e.notes ?? "",
@@ -138,168 +138,168 @@ var E = [
138
138
  destinationPath: e.destinationPath ?? "",
139
139
  destinationUrl: e.destinationUrl ?? ""
140
140
  });
141
- }, he = async () => {
142
- if (O) {
143
- j(!0), N(null);
141
+ }, ge = async () => {
142
+ if (D) {
143
+ A(!0), M(null);
144
144
  try {
145
- await $(O.id), k(null);
145
+ await Q(D.id), O(null);
146
146
  } catch (e) {
147
- N(e instanceof Error ? e.message : "Could not deactivate this code.");
147
+ M(e instanceof Error ? e.message : "Could not deactivate this code.");
148
148
  } finally {
149
- j(!1);
149
+ A(!1);
150
150
  }
151
151
  }
152
- }, $ = async (e) => {
153
- await f(e, X), P("billing.affiliate_code.deactivated", {
152
+ }, Q = async (e) => {
153
+ await f(e, Y), N("billing.affiliate_code.deactivated", {
154
154
  route: "/billing/affiliate",
155
155
  entityId: e,
156
156
  source: "affiliate-dashboard"
157
- }), await Z();
158
- }, ge = async (e) => {
157
+ }), await X();
158
+ }, $ = async (e) => {
159
159
  let t = window.prompt("Add an internal note for this affiliate code");
160
- t && (await u(e, t, X), P("billing.affiliate_code.note_added", {
160
+ t && (await u(e, t, Y), N("billing.affiliate_code.note_added", {
161
161
  route: "/billing/affiliate",
162
162
  entityId: e,
163
163
  source: "affiliate-dashboard"
164
- }), await Z());
165
- }, _e = V ? [
164
+ }), await X());
165
+ }, _e = B ? [
166
166
  {
167
167
  title: "Codes",
168
- value: V.totalCodes,
169
- icon: /* @__PURE__ */ x(oe, { className: "size-5" })
168
+ value: B.totalCodes,
169
+ icon: /* @__PURE__ */ C(ue, { className: "size-5" })
170
170
  },
171
171
  {
172
172
  title: "Visits",
173
- value: V.totalVisits,
174
- icon: /* @__PURE__ */ x(ce, { className: "size-5" })
173
+ value: B.totalVisits,
174
+ icon: /* @__PURE__ */ C(S, { className: "size-5" })
175
175
  },
176
176
  {
177
177
  title: "Journeys",
178
- value: V.totalJourneys,
179
- icon: /* @__PURE__ */ x(ne, { className: "size-5" })
178
+ value: B.totalJourneys,
179
+ icon: /* @__PURE__ */ C(oe, { className: "size-5" })
180
180
  },
181
181
  {
182
182
  title: "Revenue influenced",
183
- value: o(V.totalRevenueAmount, "USD"),
184
- icon: /* @__PURE__ */ x(se, { className: "size-5" })
183
+ value: o(B.totalRevenueAmount, "USD"),
184
+ icon: /* @__PURE__ */ C(de, { className: "size-5" })
185
185
  }
186
186
  ] : [];
187
- return /* @__PURE__ */ S("div", {
187
+ return /* @__PURE__ */ w("div", {
188
188
  className: "space-y-6 p-6",
189
189
  children: [
190
- D && /* @__PURE__ */ x(i, {
191
- open: O !== null,
190
+ E && /* @__PURE__ */ C(a, {
191
+ open: D !== null,
192
192
  tone: "danger",
193
193
  title: "Deactivate this affiliate code?",
194
194
  description: "The code stops tracking new visits straight away. Visits and journeys already recorded are kept.",
195
195
  details: [{
196
196
  label: "Code",
197
- value: O?.label ?? ""
197
+ value: D?.label ?? ""
198
198
  }],
199
199
  confirmLabel: "Deactivate code",
200
200
  busyLabel: "Deactivating…",
201
- isBusy: A,
202
- error: M,
203
- onConfirm: () => void he(),
204
- onCancel: () => k(null)
201
+ isBusy: k,
202
+ error: j,
203
+ onConfirm: () => void ge(),
204
+ onCancel: () => O(null)
205
205
  }),
206
- /* @__PURE__ */ x(n, {
206
+ /* @__PURE__ */ C(n, {
207
207
  title: "Affiliate codes",
208
208
  description: "Create referral codes, add internal notes, and monitor attributed journeys.",
209
- actions: /* @__PURE__ */ x(le, { actions: [{
209
+ actions: /* @__PURE__ */ C(ne, { actions: [{
210
210
  label: "Refresh",
211
- onSelect: () => void Z(),
212
- icon: /* @__PURE__ */ x(ie, { className: "size-4" })
211
+ onSelect: () => void X(),
212
+ icon: /* @__PURE__ */ C(ce, { className: "size-4" })
213
213
  }] })
214
214
  }),
215
- /* @__PURE__ */ x(w, { children: "Generate referral links for any product, share them, and see exactly what they drive — visits, signups, paid conversions and the rewards you have earned. Create and manage your codes on the left and watch attributed visitor journeys on the right." }),
216
- U ? /* @__PURE__ */ x("div", {
215
+ /* @__PURE__ */ C(ie, { children: "Generate referral links for any product, share them, and see exactly what they drive — visits, signups, paid conversions and the rewards you have earned. Create and manage your codes on the left and watch attributed visitor journeys on the right." }),
216
+ H ? /* @__PURE__ */ C("div", {
217
217
  className: "grid gap-4 md:grid-cols-2 xl:grid-cols-4",
218
218
  children: [
219
219
  1,
220
220
  2,
221
221
  3,
222
222
  4
223
- ].map((e) => /* @__PURE__ */ x("div", { className: "h-28 animate-pulse rounded-lg border border-border-subtle bg-bg-surface" }, e))
224
- }) : V ? /* @__PURE__ */ x(ue, {
223
+ ].map((e) => /* @__PURE__ */ C("div", { className: "h-28 animate-pulse rounded-lg border border-border-subtle bg-bg-surface" }, e))
224
+ }) : B ? /* @__PURE__ */ C(re, {
225
225
  className: "p-4 sm:p-5",
226
- children: /* @__PURE__ */ x("div", {
226
+ children: /* @__PURE__ */ C("div", {
227
227
  className: "grid gap-4 md:grid-cols-2 xl:grid-cols-4",
228
- children: _e.map((e) => /* @__PURE__ */ x(ee, {
228
+ children: _e.map((e) => /* @__PURE__ */ C(r, {
229
229
  label: e.title,
230
230
  value: e.value,
231
231
  icon: e.icon
232
232
  }, e.title))
233
233
  })
234
234
  }) : null,
235
- G && !c(G) ? /* @__PURE__ */ x("div", {
235
+ W && !c(W) ? /* @__PURE__ */ C("div", {
236
236
  className: "rounded-lg border border-border-subtle bg-bg-surface p-4 text-sm text-status-error-text",
237
- children: G.message
237
+ children: W.message
238
238
  }) : null,
239
- /* @__PURE__ */ S("div", {
239
+ /* @__PURE__ */ w("div", {
240
240
  className: "grid gap-6 xl:grid-cols-[1.1fr,1.9fr]",
241
- children: [/* @__PURE__ */ S("section", {
241
+ children: [/* @__PURE__ */ w("section", {
242
242
  className: "rounded-lg border border-border-seam bg-bg-surface p-4 xl:sticky xl:top-6 xl:self-start",
243
243
  children: [
244
- /* @__PURE__ */ S("div", {
244
+ /* @__PURE__ */ w("div", {
245
245
  className: "mb-4 flex items-center justify-between",
246
- children: [/* @__PURE__ */ x("h2", {
246
+ children: [/* @__PURE__ */ C("h2", {
247
247
  className: "text-lg font-semibold text-text-primary",
248
- children: Q ? "Update affiliate code" : "Create affiliate code"
249
- }), Q ? null : /* @__PURE__ */ x(re, { className: "size-4 text-text-secondary" })]
248
+ children: Z ? "Update affiliate code" : "Create affiliate code"
249
+ }), Z ? null : /* @__PURE__ */ C(se, { className: "size-4 text-text-secondary" })]
250
250
  }),
251
- /* @__PURE__ */ S("div", {
251
+ /* @__PURE__ */ w("div", {
252
252
  className: "space-y-3",
253
253
  children: [
254
- /* @__PURE__ */ x("input", {
255
- value: J.label,
256
- onChange: (e) => Y((t) => ({
254
+ /* @__PURE__ */ C("input", {
255
+ value: q.label,
256
+ onChange: (e) => J((t) => ({
257
257
  ...t,
258
258
  label: e.target.value
259
259
  })),
260
260
  placeholder: "Label",
261
261
  className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary"
262
262
  }),
263
- /* @__PURE__ */ x("input", {
264
- value: J.productSlug,
265
- onChange: (e) => Y((t) => ({
263
+ /* @__PURE__ */ C("input", {
264
+ value: q.productSlug,
265
+ onChange: (e) => J((t) => ({
266
266
  ...t,
267
267
  productSlug: e.target.value
268
268
  })),
269
269
  placeholder: "Product slug (eg. bigconsole)",
270
270
  className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary",
271
- disabled: !!Q
271
+ disabled: !!Z
272
272
  }),
273
- /* @__PURE__ */ x("input", {
274
- value: J.destinationPath,
275
- onChange: (e) => Y((t) => ({
273
+ /* @__PURE__ */ C("input", {
274
+ value: q.destinationPath,
275
+ onChange: (e) => J((t) => ({
276
276
  ...t,
277
277
  destinationPath: e.target.value
278
278
  })),
279
279
  placeholder: "Destination path (eg. /pricing)",
280
280
  className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary"
281
281
  }),
282
- /* @__PURE__ */ x("input", {
283
- value: J.destinationUrl,
284
- onChange: (e) => Y((t) => ({
282
+ /* @__PURE__ */ C("input", {
283
+ value: q.destinationUrl,
284
+ onChange: (e) => J((t) => ({
285
285
  ...t,
286
286
  destinationUrl: e.target.value
287
287
  })),
288
288
  placeholder: "Absolute destination URL (optional)",
289
289
  className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary"
290
290
  }),
291
- /* @__PURE__ */ x("textarea", {
292
- value: J.description,
293
- onChange: (e) => Y((t) => ({
291
+ /* @__PURE__ */ C("textarea", {
292
+ value: q.description,
293
+ onChange: (e) => J((t) => ({
294
294
  ...t,
295
295
  description: e.target.value
296
296
  })),
297
297
  placeholder: "Description",
298
298
  className: "min-h-24 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary"
299
299
  }),
300
- /* @__PURE__ */ x("textarea", {
301
- value: J.notes,
302
- onChange: (e) => Y((t) => ({
300
+ /* @__PURE__ */ C("textarea", {
301
+ value: q.notes,
302
+ onChange: (e) => J((t) => ({
303
303
  ...t,
304
304
  notes: e.target.value
305
305
  })),
@@ -308,17 +308,17 @@ var E = [
308
308
  })
309
309
  ]
310
310
  }),
311
- /* @__PURE__ */ S("div", {
311
+ /* @__PURE__ */ w("div", {
312
312
  className: "mt-4 flex flex-wrap gap-3",
313
- children: [/* @__PURE__ */ x("button", {
313
+ children: [/* @__PURE__ */ C("button", {
314
314
  type: "button",
315
- onClick: () => void pe(),
315
+ onClick: () => void me(),
316
316
  className: "rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text",
317
- children: Q ? "Save changes" : "Create code"
318
- }), Q ? /* @__PURE__ */ x("button", {
317
+ children: Z ? "Save changes" : "Create code"
318
+ }), Z ? /* @__PURE__ */ C("button", {
319
319
  type: "button",
320
320
  onClick: () => {
321
- q(null), Y({
321
+ K(null), J({
322
322
  label: "",
323
323
  description: "",
324
324
  notes: "",
@@ -332,32 +332,32 @@ var E = [
332
332
  }) : null]
333
333
  })
334
334
  ]
335
- }), /* @__PURE__ */ S("section", {
335
+ }), /* @__PURE__ */ w("section", {
336
336
  className: "space-y-4",
337
- children: [/* @__PURE__ */ S("div", {
337
+ children: [/* @__PURE__ */ w("div", {
338
338
  className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
339
- children: [/* @__PURE__ */ x("h2", {
339
+ children: [/* @__PURE__ */ C("h2", {
340
340
  className: "mb-4 text-lg font-semibold text-text-primary",
341
341
  children: "My codes"
342
- }), R.length === 0 && !U ? /* @__PURE__ */ x(C, {
342
+ }), L.length === 0 && !H ? /* @__PURE__ */ C(x, {
343
343
  illustration: "empty-data",
344
344
  title: "No affiliate codes yet",
345
345
  description: "Create your first code to start tracking attributable journeys."
346
- }) : /* @__PURE__ */ x("div", {
346
+ }) : /* @__PURE__ */ C("div", {
347
347
  className: "space-y-4",
348
- children: R.map((e) => {
348
+ children: L.map((e) => {
349
349
  let t = e.destinationUrl || `https://${e.productSlug}.com${e.destinationPath || ""}?ref=${e.code}`;
350
- return /* @__PURE__ */ S("div", {
350
+ return /* @__PURE__ */ w("div", {
351
351
  className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
352
352
  children: [
353
- /* @__PURE__ */ S("div", {
353
+ /* @__PURE__ */ w("div", {
354
354
  className: "flex flex-wrap items-start justify-between gap-4",
355
- children: [/* @__PURE__ */ S("div", { children: [
356
- /* @__PURE__ */ x("p", {
355
+ children: [/* @__PURE__ */ w("div", { children: [
356
+ /* @__PURE__ */ C("p", {
357
357
  className: "text-sm font-semibold text-text-primary",
358
358
  children: e.label || e.code
359
359
  }),
360
- /* @__PURE__ */ S("p", {
360
+ /* @__PURE__ */ w("p", {
361
361
  className: "text-xs text-text-secondary",
362
362
  children: [
363
363
  e.code,
@@ -365,83 +365,83 @@ var E = [
365
365
  e.productSlug
366
366
  ]
367
367
  }),
368
- /* @__PURE__ */ x("p", {
368
+ /* @__PURE__ */ C("p", {
369
369
  className: "mt-1 break-all text-xs text-text-secondary",
370
370
  children: t
371
371
  })
372
- ] }), /* @__PURE__ */ S("div", {
372
+ ] }), /* @__PURE__ */ w("div", {
373
373
  className: "flex flex-wrap gap-2",
374
374
  children: [
375
- /* @__PURE__ */ x("button", {
375
+ /* @__PURE__ */ C("button", {
376
376
  type: "button",
377
- onClick: () => me(e),
377
+ onClick: () => he(e),
378
378
  className: "rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary",
379
379
  children: "Edit"
380
380
  }),
381
- /* @__PURE__ */ S("button", {
381
+ /* @__PURE__ */ w("button", {
382
382
  type: "button",
383
- onClick: () => void ge(e.id),
383
+ onClick: () => void $(e.id),
384
384
  className: "inline-flex items-center gap-1 rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary",
385
- children: [/* @__PURE__ */ x(ae, { className: "size-3.5" }), "Note"]
385
+ children: [/* @__PURE__ */ C(le, { className: "size-3.5" }), "Note"]
386
386
  }),
387
- e.status === "ACTIVE" ? /* @__PURE__ */ x("button", {
387
+ e.status === "ACTIVE" ? /* @__PURE__ */ C("button", {
388
388
  type: "button",
389
- onClick: () => D ? (N(null), k({
389
+ onClick: () => E ? (M(null), O({
390
390
  id: e.id,
391
391
  label: e.label || e.code
392
- })) : void $(e.id),
392
+ })) : void Q(e.id),
393
393
  className: "rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-status-error-text",
394
394
  children: "Deactivate"
395
395
  }) : null
396
396
  ]
397
397
  })]
398
398
  }),
399
- /* @__PURE__ */ S("div", {
399
+ /* @__PURE__ */ w("div", {
400
400
  className: "mt-4 grid gap-3 sm:grid-cols-2 xl:grid-cols-4",
401
401
  children: [
402
- /* @__PURE__ */ S("div", {
402
+ /* @__PURE__ */ w("div", {
403
403
  className: "rounded-md border border-border-subtle bg-bg-surface p-3",
404
- children: [/* @__PURE__ */ x("p", {
404
+ children: [/* @__PURE__ */ C("p", {
405
405
  className: "text-xs text-text-secondary",
406
406
  children: "Visits"
407
- }), /* @__PURE__ */ x("p", {
407
+ }), /* @__PURE__ */ C("p", {
408
408
  className: "text-lg font-semibold text-text-primary",
409
409
  children: e.totalVisits
410
410
  })]
411
411
  }),
412
- /* @__PURE__ */ S("div", {
412
+ /* @__PURE__ */ w("div", {
413
413
  className: "rounded-md border border-border-subtle bg-bg-surface p-3",
414
- children: [/* @__PURE__ */ x("p", {
414
+ children: [/* @__PURE__ */ C("p", {
415
415
  className: "text-xs text-text-secondary",
416
416
  children: "Signups"
417
- }), /* @__PURE__ */ x("p", {
417
+ }), /* @__PURE__ */ C("p", {
418
418
  className: "text-lg font-semibold text-text-primary",
419
419
  children: e.totalSignups
420
420
  })]
421
421
  }),
422
- /* @__PURE__ */ S("div", {
422
+ /* @__PURE__ */ w("div", {
423
423
  className: "rounded-md border border-border-subtle bg-bg-surface p-3",
424
- children: [/* @__PURE__ */ x("p", {
424
+ children: [/* @__PURE__ */ C("p", {
425
425
  className: "text-xs text-text-secondary",
426
426
  children: "Paid conversions"
427
- }), /* @__PURE__ */ x("p", {
427
+ }), /* @__PURE__ */ C("p", {
428
428
  className: "text-lg font-semibold text-text-primary",
429
429
  children: e.totalPaidConversions + e.totalStorePurchases
430
430
  })]
431
431
  }),
432
- /* @__PURE__ */ S("div", {
432
+ /* @__PURE__ */ w("div", {
433
433
  className: "rounded-md border border-border-subtle bg-bg-surface p-3",
434
- children: [/* @__PURE__ */ x("p", {
434
+ children: [/* @__PURE__ */ C("p", {
435
435
  className: "text-xs text-text-secondary",
436
436
  children: "Rewards earned"
437
- }), /* @__PURE__ */ x("p", {
437
+ }), /* @__PURE__ */ C("p", {
438
438
  className: "text-lg font-semibold text-text-primary",
439
439
  children: o(e.totalRewardAmount, "USD")
440
440
  })]
441
441
  })
442
442
  ]
443
443
  }),
444
- e.notes ? /* @__PURE__ */ x("p", {
444
+ e.notes ? /* @__PURE__ */ C("p", {
445
445
  className: "mt-3 text-sm text-text-secondary",
446
446
  children: e.notes
447
447
  }) : null
@@ -449,19 +449,19 @@ var E = [
449
449
  }, e.id);
450
450
  })
451
451
  })]
452
- }), /* @__PURE__ */ S("div", {
452
+ }), /* @__PURE__ */ w("div", {
453
453
  className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
454
- children: [/* @__PURE__ */ x("h2", {
454
+ children: [/* @__PURE__ */ C("h2", {
455
455
  className: "mb-4 text-lg font-semibold text-text-primary",
456
456
  children: "Recent attributed journeys"
457
- }), z.length === 0 ? /* @__PURE__ */ x(C, {
457
+ }), R.length === 0 ? /* @__PURE__ */ C(x, {
458
458
  illustration: "empty-people",
459
459
  title: "No journeys yet",
460
460
  description: "Journeys will appear as visitors land on your affiliate links."
461
- }) : /* @__PURE__ */ x(T, {
462
- data: z,
461
+ }) : /* @__PURE__ */ C(ae, {
462
+ data: R,
463
463
  rowKey: (e) => e.id,
464
- columns: E
464
+ columns: T
465
465
  })]
466
466
  })]
467
467
  })]
@@ -469,6 +469,6 @@ var E = [
469
469
  ]
470
470
  });
471
471
  };
472
- export { D as AffiliateDashboardPage };
472
+ export { E as AffiliateDashboardPage };
473
473
 
474
474
  //# sourceMappingURL=AffiliateDashboardPage.js.map