@burdenoff/microfe-billing 2026.625.4 → 2026.625.5

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 (96) hide show
  1. package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js +192 -187
  2. package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js.map +1 -1
  3. package/dist/billing/modules/addons/pages/AddonCreatePage.js +322 -317
  4. package/dist/billing/modules/addons/pages/AddonCreatePage.js.map +1 -1
  5. package/dist/billing/modules/addons/pages/AddonDetailPage.js +190 -185
  6. package/dist/billing/modules/addons/pages/AddonDetailPage.js.map +1 -1
  7. package/dist/billing/modules/addons/pages/AddonEditPage.js +297 -292
  8. package/dist/billing/modules/addons/pages/AddonEditPage.js.map +1 -1
  9. package/dist/billing/modules/addons/pages/AddonsBrowsePage.js +60 -75
  10. package/dist/billing/modules/addons/pages/AddonsBrowsePage.js.map +1 -1
  11. package/dist/billing/modules/addons/pages/AddonsListPage.js +86 -101
  12. package/dist/billing/modules/addons/pages/AddonsListPage.js.map +1 -1
  13. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js +124 -121
  14. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js.map +1 -1
  15. package/dist/billing/modules/analytics/pages/AnalyticsPage.js +103 -111
  16. package/dist/billing/modules/analytics/pages/AnalyticsPage.js.map +1 -1
  17. package/dist/billing/modules/billing/pages/InvoiceDetailPage.js +196 -160
  18. package/dist/billing/modules/billing/pages/InvoiceDetailPage.js.map +1 -1
  19. package/dist/billing/modules/billing/pages/InvoicesListPage.js +58 -73
  20. package/dist/billing/modules/billing/pages/InvoicesListPage.js.map +1 -1
  21. package/dist/billing/modules/billing/pages/PaymentMethodsPage.js +65 -75
  22. package/dist/billing/modules/billing/pages/PaymentMethodsPage.js.map +1 -1
  23. package/dist/billing/modules/billing/pages/RefundsPage.js +399 -399
  24. package/dist/billing/modules/billing/pages/RefundsPage.js.map +1 -1
  25. package/dist/billing/modules/billing/pages/TransactionsPage.js +49 -48
  26. package/dist/billing/modules/billing/pages/TransactionsPage.js.map +1 -1
  27. package/dist/billing/modules/billing/pages/UserRefundsPage.js +144 -151
  28. package/dist/billing/modules/billing/pages/UserRefundsPage.js.map +1 -1
  29. package/dist/billing/modules/checkout/pages/CheckoutPage.js +430 -425
  30. package/dist/billing/modules/checkout/pages/CheckoutPage.js.map +1 -1
  31. package/dist/billing/modules/coupons/pages/CouponDetailPage.js +121 -93
  32. package/dist/billing/modules/coupons/pages/CouponDetailPage.js.map +1 -1
  33. package/dist/billing/modules/coupons/pages/CouponsListPage.js +154 -152
  34. package/dist/billing/modules/coupons/pages/CouponsListPage.js.map +1 -1
  35. package/dist/billing/modules/coupons/pages/CreateCouponPage.js +467 -462
  36. package/dist/billing/modules/coupons/pages/CreateCouponPage.js.map +1 -1
  37. package/dist/billing/modules/coupons/pages/EditCouponPage.js +294 -286
  38. package/dist/billing/modules/coupons/pages/EditCouponPage.js.map +1 -1
  39. package/dist/billing/modules/credits/pages/AdminCreditsPage.js +123 -117
  40. package/dist/billing/modules/credits/pages/AdminCreditsPage.js.map +1 -1
  41. package/dist/billing/modules/credits/pages/CreditTransactionsPage.js +43 -42
  42. package/dist/billing/modules/credits/pages/CreditTransactionsPage.js.map +1 -1
  43. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +192 -207
  44. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js.map +1 -1
  45. package/dist/billing/modules/credits/pages/CreditsPage.js +40 -56
  46. package/dist/billing/modules/credits/pages/CreditsPage.js.map +1 -1
  47. package/dist/billing/modules/dashboard/pages/OverviewPage.js +128 -121
  48. package/dist/billing/modules/dashboard/pages/OverviewPage.js.map +1 -1
  49. package/dist/billing/modules/discounts/pages/DiscountsListPage.js +165 -180
  50. package/dist/billing/modules/discounts/pages/DiscountsListPage.js.map +1 -1
  51. package/dist/billing/modules/earnings/pages/EarningsPage.js +103 -100
  52. package/dist/billing/modules/earnings/pages/EarningsPage.js.map +1 -1
  53. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js +175 -175
  54. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js.map +1 -1
  55. package/dist/billing/modules/earnings/pages/PayoutsPage.js +96 -96
  56. package/dist/billing/modules/earnings/pages/PayoutsPage.js.map +1 -1
  57. package/dist/billing/modules/plans/pages/PlanAssignFreePage.js +42 -40
  58. package/dist/billing/modules/plans/pages/PlanAssignFreePage.js.map +1 -1
  59. package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js +45 -38
  60. package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js.map +1 -1
  61. package/dist/billing/modules/plans/pages/PlanCreatePage.js +339 -334
  62. package/dist/billing/modules/plans/pages/PlanCreatePage.js.map +1 -1
  63. package/dist/billing/modules/plans/pages/PlanDetailPage.js +80 -74
  64. package/dist/billing/modules/plans/pages/PlanDetailPage.js.map +1 -1
  65. package/dist/billing/modules/plans/pages/PlanEditPage.js +342 -337
  66. package/dist/billing/modules/plans/pages/PlanEditPage.js.map +1 -1
  67. package/dist/billing/modules/plans/pages/PlansBrowsePage.js +38 -53
  68. package/dist/billing/modules/plans/pages/PlansBrowsePage.js.map +1 -1
  69. package/dist/billing/modules/plans/pages/PlansListPage.js +60 -75
  70. package/dist/billing/modules/plans/pages/PlansListPage.js.map +1 -1
  71. package/dist/billing/modules/promotions/pages/CreatePromotionPage.js +242 -237
  72. package/dist/billing/modules/promotions/pages/CreatePromotionPage.js.map +1 -1
  73. package/dist/billing/modules/promotions/pages/PromotionsListPage.js +29 -39
  74. package/dist/billing/modules/promotions/pages/PromotionsListPage.js.map +1 -1
  75. package/dist/billing/modules/quota/pages/QuotaPage.js +1 -0
  76. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js +299 -294
  77. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js.map +1 -1
  78. package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js +191 -186
  79. package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js.map +1 -1
  80. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js +308 -303
  81. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js.map +1 -1
  82. package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js +57 -78
  83. package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js.map +1 -1
  84. package/dist/billing/modules/settings/pages/SettingsPage.js +79 -78
  85. package/dist/billing/modules/settings/pages/SettingsPage.js.map +1 -1
  86. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js +15 -13
  87. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js.map +1 -1
  88. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js +338 -299
  89. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js.map +1 -1
  90. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js +82 -103
  91. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js.map +1 -1
  92. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js +59 -54
  93. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js.map +1 -1
  94. package/dist/billing/modules/usage/pages/UsagePage.js +172 -215
  95. package/dist/billing/modules/usage/pages/UsagePage.js.map +1 -1
  96. package/package.json +2 -2
@@ -3,171 +3,172 @@ import { PageHeader as t } from "../../../shared/components/PageHeader.js";
3
3
  import "../../../shared/components/index.js";
4
4
  import { useBillingPermissions as n } from "../../../hooks/useBillingPermissions.js";
5
5
  import { useDeactivateCouponMutation as r, useListCouponsQuery as i, useUpdateCouponMutation as a } from "../../../../generated/global-operations.js";
6
- import { useBillingNavigate as o } from "../../../hooks/useBillingNavigate.js";
7
- import { CouponStatus as s } from "../../../../generated/global-types.js";
8
- import { useEffect as c, useMemo as l, useState as u } from "react";
9
- import { AlertCircle as d, CheckCircle as f, ChevronLeft as p, ChevronRight as m, DollarSign as h, Download as ee, Edit as te, Eye as g, Package as _, Percent as ne, Plus as v, Power as y, PowerOff as b, Search as re, Tag as x, Trash2 as S, TrendingUp as C } from "lucide-react";
10
- import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
11
- import { useI18n as D } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
12
- import { ResponsiveTable as O } from "@burdenoff/fe-libs/ui";
6
+ import { useBillingNavigate as ee } from "../../../hooks/useBillingNavigate.js";
7
+ import { CouponStatus as o } from "../../../../generated/global-types.js";
8
+ import { useEffect as s, useMemo as c, useState as l } from "react";
9
+ import { AlertCircle as te, CheckCircle as u, ChevronLeft as d, ChevronRight as f, DollarSign as p, Download as m, Edit as h, Eye as g, Package as _, Percent as v, Plus as y, Power as ne, PowerOff as re, Search as ie, Tag as b, Trash2 as ae, TrendingUp as oe } from "lucide-react";
10
+ import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
11
+ import { useI18n as w } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
12
+ import { IllustratedEmptyState as se, PagePurpose as T, ResponsiveTable as E } from "@burdenoff/fe-libs/ui";
13
13
  //#region src/billing/modules/coupons/pages/CouponsListPage.tsx
14
- var k = () => {
15
- let { t: k } = D(), ie = (e, t) => {
16
- let n = k(e);
14
+ var D = () => {
15
+ let { t: D } = w(), O = (e, t) => {
16
+ let n = D(e);
17
17
  return n === e ? t : n;
18
- }, A = o(), ae = n(), [j, oe] = u(""), [M, N] = u("ALL"), [P, F] = u("ALL"), [I] = u("ALL"), [L, R] = u(0), [z, B] = u(null), [V, H] = u(null), [U, W] = u(null), { data: G, loading: K, refetch: q } = i({ variables: {
18
+ }, k = ee(), ce = n(), [A, j] = l(""), [M, N] = l("ALL"), [P, F] = l("ALL"), [I] = l("ALL"), [L, R] = l(0), [z, B] = l(null), [V, H] = l(null), [U, W] = l(null), { data: G, loading: le, refetch: K } = i({ variables: {
19
19
  limit: 20,
20
20
  offset: L * 20,
21
21
  filter: {
22
22
  status: M === "ALL" ? void 0 : M,
23
23
  type: P === "ALL" ? void 0 : P,
24
24
  scope: I === "ALL" ? void 0 : I,
25
- search: j || void 0
25
+ search: A || void 0
26
26
  }
27
- } }), J = l(() => G?.listCoupons?.coupons ?? [], [G?.listCoupons?.coupons]), Y = G?.listCoupons?.total ?? 0, se = G?.listCoupons?.hasMore ?? !1, ce = Math.ceil(Y / 20), [le, { loading: X }] = r(), [ue] = a(), Z = J;
28
- c(() => {
27
+ } }), q = c(() => G?.listCoupons?.coupons ?? [], [G?.listCoupons?.coupons]), J = G?.listCoupons?.total ?? 0, ue = G?.listCoupons?.hasMore ?? !1, de = Math.ceil(J / 20), [Y, { loading: X }] = r(), [fe] = a(), Z = q;
28
+ s(() => {
29
29
  R(0);
30
30
  }, [
31
- j,
31
+ A,
32
32
  M,
33
33
  P,
34
34
  I
35
35
  ]);
36
- let Q = l(() => ({
37
- totalCoupons: Y,
38
- activeCoupons: J.filter((e) => e.status === "ACTIVE").length,
39
- totalUses: J.reduce((e, t) => e + t.currentUses, 0),
40
- totalDiscountValue: J.reduce((e, t) => t.type === "FIXED_AMOUNT" ? e + t.value * t.currentUses : e, 0)
41
- }), [J, Y]);
42
- if (!ae.canManageDiscounts) return /* @__PURE__ */ T(e, { message: "You don't have permission to manage coupons." });
36
+ let Q = c(() => ({
37
+ totalCoupons: J,
38
+ activeCoupons: q.filter((e) => e.status === "ACTIVE").length,
39
+ totalUses: q.reduce((e, t) => e + t.currentUses, 0),
40
+ totalDiscountValue: q.reduce((e, t) => t.type === "FIXED_AMOUNT" ? e + t.value * t.currentUses : e, 0)
41
+ }), [q, J]);
42
+ if (!ce.canManageDiscounts) return /* @__PURE__ */ S(e, { message: "You don't have permission to manage coupons." });
43
43
  let $ = (e) => new Intl.NumberFormat("en-US", {
44
44
  style: "currency",
45
45
  currency: "USD"
46
- }).format(e), de = (e) => new Date(e).toLocaleDateString("en-US", {
46
+ }).format(e), pe = (e) => new Date(e).toLocaleDateString("en-US", {
47
47
  year: "numeric",
48
48
  month: "short",
49
49
  day: "numeric"
50
- }), fe = (e) => {
50
+ }), me = (e) => {
51
51
  switch (e) {
52
52
  case "ACTIVE": return "text-status-success-text bg-status-success-bg-subtle";
53
53
  case "INACTIVE": return "text-text-secondary bg-bg-canvas";
54
54
  case "EXPIRED": return "text-status-error-text bg-status-error-bg-subtle";
55
55
  default: return "text-text-secondary bg-bg-canvas";
56
56
  }
57
- }, pe = (e) => {
57
+ }, he = (e) => {
58
58
  switch (e) {
59
- case "PERCENTAGE": return /* @__PURE__ */ T(ne, { className: "size-4" });
60
- case "FIXED_AMOUNT": return /* @__PURE__ */ T(h, { className: "size-4" });
61
- case "FREE_SHIPPING": return /* @__PURE__ */ T(_, { className: "size-4" });
62
- default: return /* @__PURE__ */ T(x, { className: "size-4" });
59
+ case "PERCENTAGE": return /* @__PURE__ */ S(v, { className: "size-4" });
60
+ case "FIXED_AMOUNT": return /* @__PURE__ */ S(p, { className: "size-4" });
61
+ case "FREE_SHIPPING": return /* @__PURE__ */ S(_, { className: "size-4" });
62
+ default: return /* @__PURE__ */ S(b, { className: "size-4" });
63
63
  }
64
64
  };
65
- return /* @__PURE__ */ E("div", {
65
+ return /* @__PURE__ */ C("div", {
66
66
  className: "max-w-7xl mx-auto p-4 sm:p-6 space-y-6",
67
67
  children: [
68
- /* @__PURE__ */ E("div", {
68
+ /* @__PURE__ */ C("div", {
69
69
  className: "flex items-center justify-between",
70
- children: [/* @__PURE__ */ T(t, {
71
- title: ie("billing.coupons.title", "Coupons"),
70
+ children: [/* @__PURE__ */ S(t, {
71
+ title: O("billing.coupons.title", "Coupons"),
72
72
  description: "Manage discount codes and promotional offers",
73
- icon: /* @__PURE__ */ T(x, { className: "size-6" })
74
- }), /* @__PURE__ */ E("button", {
73
+ icon: /* @__PURE__ */ S(b, { className: "size-6" })
74
+ }), /* @__PURE__ */ C("button", {
75
75
  type: "button",
76
- onClick: () => A("/coupons/create"),
76
+ onClick: () => k("/coupons/create"),
77
77
  className: "inline-flex items-center gap-2 rounded-button bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-colors duration-200 hover:bg-action-primary-bgHover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
78
- children: [/* @__PURE__ */ T(v, { className: "size-4" }), "Create Coupon"]
78
+ children: [/* @__PURE__ */ S(y, { className: "size-4" }), "Create Coupon"]
79
79
  })]
80
80
  }),
81
- /* @__PURE__ */ E("div", {
81
+ /* @__PURE__ */ S(T, { children: O("billing.coupons.purpose", "Create and manage discount codes that customers redeem at checkout — percentage or fixed-amount off, with optional usage limits and expiry. Track how often each coupon has been used and deactivate ones you no longer want to honour.") }),
82
+ /* @__PURE__ */ C("div", {
82
83
  className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",
83
84
  children: [
84
- /* @__PURE__ */ E("div", {
85
+ /* @__PURE__ */ C("div", {
85
86
  className: "rounded-card border border-border-seam bg-bg-surface p-5 shadow-[var(--shadow-elevation-1)]",
86
87
  children: [
87
- /* @__PURE__ */ E("div", {
88
+ /* @__PURE__ */ C("div", {
88
89
  className: "flex items-center justify-between mb-2",
89
- children: [/* @__PURE__ */ T("span", {
90
+ children: [/* @__PURE__ */ S("span", {
90
91
  className: "text-sm text-text-secondary",
91
92
  children: "Total Coupons"
92
- }), /* @__PURE__ */ T("span", {
93
+ }), /* @__PURE__ */ S("span", {
93
94
  className: "flex size-9 items-center justify-center rounded-lg bg-[var(--color-accent-soft)]",
94
- children: /* @__PURE__ */ T(x, { className: "size-4 text-accent-blue" })
95
+ children: /* @__PURE__ */ S(b, { className: "size-4 text-accent-blue" })
95
96
  })]
96
97
  }),
97
- /* @__PURE__ */ T("p", {
98
+ /* @__PURE__ */ S("p", {
98
99
  className: "text-2xl font-semibold text-text-primary tabular-nums",
99
100
  children: Q.totalCoupons
100
101
  }),
101
- /* @__PURE__ */ E("p", {
102
+ /* @__PURE__ */ C("p", {
102
103
  className: "text-xs text-text-muted mt-1",
103
104
  children: [Q.activeCoupons, " active"]
104
105
  })
105
106
  ]
106
107
  }),
107
- /* @__PURE__ */ E("div", {
108
+ /* @__PURE__ */ C("div", {
108
109
  className: "rounded-card border border-border-seam bg-bg-surface p-5 shadow-[var(--shadow-elevation-1)]",
109
110
  children: [
110
- /* @__PURE__ */ E("div", {
111
+ /* @__PURE__ */ C("div", {
111
112
  className: "flex items-center justify-between mb-2",
112
- children: [/* @__PURE__ */ T("span", {
113
+ children: [/* @__PURE__ */ S("span", {
113
114
  className: "text-sm text-text-secondary",
114
115
  children: "Total Uses"
115
- }), /* @__PURE__ */ T("span", {
116
+ }), /* @__PURE__ */ S("span", {
116
117
  className: "flex size-9 items-center justify-center rounded-lg bg-status-success-bg-subtle",
117
- children: /* @__PURE__ */ T(C, { className: "size-4 text-status-success-text" })
118
+ children: /* @__PURE__ */ S(oe, { className: "size-4 text-status-success-text" })
118
119
  })]
119
120
  }),
120
- /* @__PURE__ */ T("p", {
121
+ /* @__PURE__ */ S("p", {
121
122
  className: "text-2xl font-semibold text-text-primary tabular-nums",
122
123
  children: Q.totalUses
123
124
  }),
124
- /* @__PURE__ */ T("p", {
125
+ /* @__PURE__ */ S("p", {
125
126
  className: "text-xs text-text-muted mt-1",
126
127
  children: "All time"
127
128
  })
128
129
  ]
129
130
  }),
130
- /* @__PURE__ */ E("div", {
131
+ /* @__PURE__ */ C("div", {
131
132
  className: "rounded-card border border-border-seam bg-bg-surface p-5 shadow-[var(--shadow-elevation-1)]",
132
133
  children: [
133
- /* @__PURE__ */ E("div", {
134
+ /* @__PURE__ */ C("div", {
134
135
  className: "flex items-center justify-between mb-2",
135
- children: [/* @__PURE__ */ T("span", {
136
+ children: [/* @__PURE__ */ S("span", {
136
137
  className: "text-sm text-text-secondary",
137
138
  children: "Total Discount"
138
- }), /* @__PURE__ */ T("span", {
139
+ }), /* @__PURE__ */ S("span", {
139
140
  className: "flex size-9 items-center justify-center rounded-lg bg-[var(--color-accent-soft)]",
140
- children: /* @__PURE__ */ T(h, { className: "size-4 text-accent-purple" })
141
+ children: /* @__PURE__ */ S(p, { className: "size-4 text-accent-purple" })
141
142
  })]
142
143
  }),
143
- /* @__PURE__ */ T("p", {
144
+ /* @__PURE__ */ S("p", {
144
145
  className: "text-2xl font-semibold text-text-primary tabular-nums",
145
146
  children: $(Q.totalDiscountValue)
146
147
  }),
147
- /* @__PURE__ */ T("p", {
148
+ /* @__PURE__ */ S("p", {
148
149
  className: "text-xs text-text-muted mt-1",
149
150
  children: "Fixed amount only"
150
151
  })
151
152
  ]
152
153
  }),
153
- /* @__PURE__ */ E("div", {
154
+ /* @__PURE__ */ C("div", {
154
155
  className: "rounded-card border border-border-seam bg-bg-surface p-5 shadow-[var(--shadow-elevation-1)]",
155
156
  children: [
156
- /* @__PURE__ */ E("div", {
157
+ /* @__PURE__ */ C("div", {
157
158
  className: "flex items-center justify-between mb-2",
158
- children: [/* @__PURE__ */ T("span", {
159
+ children: [/* @__PURE__ */ S("span", {
159
160
  className: "text-sm text-text-secondary",
160
161
  children: "Active Rate"
161
- }), /* @__PURE__ */ T("span", {
162
+ }), /* @__PURE__ */ S("span", {
162
163
  className: "flex size-9 items-center justify-center rounded-lg bg-status-success-bg-subtle",
163
- children: /* @__PURE__ */ T(f, { className: "size-4 text-status-success-text" })
164
+ children: /* @__PURE__ */ S(u, { className: "size-4 text-status-success-text" })
164
165
  })]
165
166
  }),
166
- /* @__PURE__ */ E("p", {
167
+ /* @__PURE__ */ C("p", {
167
168
  className: "text-2xl font-semibold text-text-primary tabular-nums",
168
169
  children: [Q.totalCoupons > 0 ? Math.round(Q.activeCoupons / Q.totalCoupons * 100) : 0, "%"]
169
170
  }),
170
- /* @__PURE__ */ T("p", {
171
+ /* @__PURE__ */ S("p", {
171
172
  className: "text-xs text-text-muted mt-1",
172
173
  children: "Of all coupons"
173
174
  })
@@ -175,42 +176,42 @@ var k = () => {
175
176
  })
176
177
  ]
177
178
  }),
178
- U && /* @__PURE__ */ E("div", {
179
+ U && /* @__PURE__ */ C("div", {
179
180
  className: U.tone === "success" ? "flex items-start gap-3 rounded-lg border border-status-success-border bg-status-success-bg-subtle p-4 text-status-success-text" : "flex items-start gap-3 rounded-lg border border-status-error-border bg-status-error-bg-subtle p-4 text-status-error-text",
180
181
  role: "status",
181
182
  "aria-live": "polite",
182
- children: [U.tone === "success" ? /* @__PURE__ */ T(f, { className: "mt-0.5 size-4 shrink-0" }) : /* @__PURE__ */ T(d, { className: "mt-0.5 size-4 shrink-0" }), /* @__PURE__ */ T("p", {
183
+ children: [U.tone === "success" ? /* @__PURE__ */ S(u, { className: "mt-0.5 size-4 shrink-0" }) : /* @__PURE__ */ S(te, { className: "mt-0.5 size-4 shrink-0" }), /* @__PURE__ */ S("p", {
183
184
  className: "text-sm font-medium",
184
185
  children: U.message
185
186
  })]
186
187
  }),
187
- z && /* @__PURE__ */ T("div", {
188
+ z && /* @__PURE__ */ S("div", {
188
189
  className: "rounded-lg border border-status-error-border bg-status-error-bg-subtle p-4",
189
- children: /* @__PURE__ */ E("div", {
190
+ children: /* @__PURE__ */ C("div", {
190
191
  className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
191
- children: [/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ E("p", {
192
+ children: [/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ C("p", {
192
193
  className: "font-medium text-status-error-text",
193
194
  children: [
194
195
  "Deactivate coupon ",
195
- /* @__PURE__ */ T("span", {
196
+ /* @__PURE__ */ S("span", {
196
197
  className: "font-mono",
197
198
  children: z.code
198
199
  }),
199
200
  "?"
200
201
  ]
201
- }), /* @__PURE__ */ T("p", {
202
+ }), /* @__PURE__ */ S("p", {
202
203
  className: "mt-1 text-sm text-status-error-text",
203
204
  children: "This will prevent new checkouts from applying this coupon."
204
- })] }), /* @__PURE__ */ E("div", {
205
+ })] }), /* @__PURE__ */ C("div", {
205
206
  className: "flex gap-2 self-end sm:self-auto",
206
- children: [/* @__PURE__ */ T("button", {
207
+ children: [/* @__PURE__ */ S("button", {
207
208
  type: "button",
208
209
  onClick: () => B(null),
209
210
  className: "rounded-button border border-border-subtle bg-bg-surface px-3 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken",
210
211
  children: "Cancel"
211
- }), /* @__PURE__ */ T("button", {
212
+ }), /* @__PURE__ */ S("button", {
212
213
  type: "button",
213
- onClick: () => me(z.id),
214
+ onClick: () => ge(z.id),
214
215
  disabled: X,
215
216
  className: "rounded-button bg-action-danger-bg px-3 py-2 text-sm font-medium text-action-danger-text transition-colors hover:bg-action-danger-bgHover disabled:cursor-not-allowed disabled:opacity-50",
216
217
  children: X ? "Deactivating…" : "Deactivate"
@@ -218,69 +219,69 @@ var k = () => {
218
219
  })]
219
220
  })
220
221
  }),
221
- /* @__PURE__ */ T("div", {
222
+ /* @__PURE__ */ S("div", {
222
223
  className: "bg-bg-surface border border-border-subtle rounded-lg p-4",
223
- children: /* @__PURE__ */ E("div", {
224
+ children: /* @__PURE__ */ C("div", {
224
225
  className: "grid grid-cols-1 md:grid-cols-4 gap-4",
225
226
  children: [
226
- /* @__PURE__ */ T("div", {
227
+ /* @__PURE__ */ S("div", {
227
228
  className: "md:col-span-2",
228
- children: /* @__PURE__ */ E("div", {
229
+ children: /* @__PURE__ */ C("div", {
229
230
  className: "relative",
230
- children: [/* @__PURE__ */ T(re, { className: "absolute left-3 top-1/2 -translate-y-1/2 size-4 text-text-muted" }), /* @__PURE__ */ T("input", {
231
+ children: [/* @__PURE__ */ S(ie, { className: "absolute left-3 top-1/2 -translate-y-1/2 size-4 text-text-muted" }), /* @__PURE__ */ S("input", {
231
232
  type: "text",
232
233
  placeholder: "Search coupons...",
233
- value: j,
234
- onChange: (e) => oe(e.target.value),
234
+ value: A,
235
+ onChange: (e) => j(e.target.value),
235
236
  className: "w-full pl-10 pr-4 py-2 rounded-input border border-border-subtle bg-bg-surface text-text-primary placeholder:text-text-muted focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
236
237
  })]
237
238
  })
238
239
  }),
239
- /* @__PURE__ */ E("select", {
240
+ /* @__PURE__ */ C("select", {
240
241
  value: M,
241
242
  onChange: (e) => {
242
243
  N(e.target.value), R(0);
243
244
  },
244
245
  className: "px-4 py-2 rounded-input border border-border-subtle bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
245
246
  children: [
246
- /* @__PURE__ */ T("option", {
247
+ /* @__PURE__ */ S("option", {
247
248
  value: "ALL",
248
249
  children: "All Status"
249
250
  }),
250
- /* @__PURE__ */ T("option", {
251
+ /* @__PURE__ */ S("option", {
251
252
  value: "ACTIVE",
252
253
  children: "Active"
253
254
  }),
254
- /* @__PURE__ */ T("option", {
255
+ /* @__PURE__ */ S("option", {
255
256
  value: "INACTIVE",
256
257
  children: "Inactive"
257
258
  }),
258
- /* @__PURE__ */ T("option", {
259
+ /* @__PURE__ */ S("option", {
259
260
  value: "EXPIRED",
260
261
  children: "Expired"
261
262
  })
262
263
  ]
263
264
  }),
264
- /* @__PURE__ */ E("select", {
265
+ /* @__PURE__ */ C("select", {
265
266
  value: P,
266
267
  onChange: (e) => {
267
268
  F(e.target.value), R(0);
268
269
  },
269
270
  className: "px-4 py-2 rounded-input border border-border-subtle bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
270
271
  children: [
271
- /* @__PURE__ */ T("option", {
272
+ /* @__PURE__ */ S("option", {
272
273
  value: "ALL",
273
274
  children: "All Types"
274
275
  }),
275
- /* @__PURE__ */ T("option", {
276
+ /* @__PURE__ */ S("option", {
276
277
  value: "PERCENTAGE",
277
278
  children: "Percentage"
278
279
  }),
279
- /* @__PURE__ */ T("option", {
280
+ /* @__PURE__ */ S("option", {
280
281
  value: "FIXED_AMOUNT",
281
282
  children: "Fixed Amount"
282
283
  }),
283
- /* @__PURE__ */ T("option", {
284
+ /* @__PURE__ */ S("option", {
284
285
  value: "FREE_SHIPPING",
285
286
  children: "Free Shipping"
286
287
  })
@@ -289,21 +290,21 @@ var k = () => {
289
290
  ]
290
291
  })
291
292
  }),
292
- /* @__PURE__ */ T("div", {
293
+ /* @__PURE__ */ S("div", {
293
294
  className: "bg-bg-surface border border-border-seam rounded-card overflow-hidden shadow-[var(--shadow-elevation-1)]",
294
- children: K ? /* @__PURE__ */ T("div", {
295
+ children: le ? /* @__PURE__ */ S("div", {
295
296
  className: "p-8 text-center text-text-muted",
296
297
  children: "Loading coupons…"
297
- }) : /* @__PURE__ */ T(O, {
298
+ }) : /* @__PURE__ */ S(E, {
298
299
  columns: [
299
300
  {
300
301
  key: "code",
301
302
  header: "Code",
302
303
  priority: "primary",
303
- cell: (e) => /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("p", {
304
+ cell: (e) => /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", {
304
305
  className: "font-medium text-text-primary font-mono",
305
306
  children: e.code
306
- }), /* @__PURE__ */ T("p", {
307
+ }), /* @__PURE__ */ S("p", {
307
308
  className: "text-sm text-text-muted",
308
309
  children: e.name
309
310
  })] })
@@ -311,9 +312,9 @@ var k = () => {
311
312
  {
312
313
  key: "type",
313
314
  header: "Type",
314
- cell: (e) => /* @__PURE__ */ E("div", {
315
+ cell: (e) => /* @__PURE__ */ C("div", {
315
316
  className: "flex items-center gap-2",
316
- children: [pe(e.type), /* @__PURE__ */ T("span", {
317
+ children: [he(e.type), /* @__PURE__ */ S("span", {
317
318
  className: "text-sm text-text-primary capitalize",
318
319
  children: e.type.replace("_", " ").toLowerCase()
319
320
  })]
@@ -322,7 +323,7 @@ var k = () => {
322
323
  {
323
324
  key: "value",
324
325
  header: "Value",
325
- cell: (e) => /* @__PURE__ */ T("span", {
326
+ cell: (e) => /* @__PURE__ */ S("span", {
326
327
  className: "text-sm font-medium text-text-primary tabular-nums",
327
328
  children: e.type === "PERCENTAGE" ? `${e.value}%` : $(e.value)
328
329
  })
@@ -330,26 +331,26 @@ var k = () => {
330
331
  {
331
332
  key: "status",
332
333
  header: "Status",
333
- cell: (e) => /* @__PURE__ */ T("span", {
334
- className: `inline-flex px-2 py-1 rounded-full text-xs font-medium ${fe(e.status)}`,
334
+ cell: (e) => /* @__PURE__ */ S("span", {
335
+ className: `inline-flex px-2 py-1 rounded-full text-xs font-medium ${me(e.status)}`,
335
336
  children: e.status
336
337
  })
337
338
  },
338
339
  {
339
340
  key: "usage",
340
341
  header: "Usage",
341
- cell: (e) => /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ E("div", {
342
+ cell: (e) => /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ C("div", {
342
343
  className: "text-sm text-text-primary tabular-nums",
343
- children: [/* @__PURE__ */ T("span", {
344
+ children: [/* @__PURE__ */ S("span", {
344
345
  className: "font-medium",
345
346
  children: e.currentUses
346
- }), e.maxTotalUses && /* @__PURE__ */ E("span", {
347
+ }), e.maxTotalUses && /* @__PURE__ */ C("span", {
347
348
  className: "text-text-muted",
348
349
  children: [" / ", e.maxTotalUses]
349
350
  })]
350
- }), e.maxTotalUses && /* @__PURE__ */ T("div", {
351
+ }), e.maxTotalUses && /* @__PURE__ */ S("div", {
351
352
  className: "w-full bg-bg-sunken rounded-full h-1.5 mt-1",
352
- children: /* @__PURE__ */ T("div", {
353
+ children: /* @__PURE__ */ S("div", {
353
354
  className: "bg-action-primary-bg h-1.5 rounded-full",
354
355
  style: { width: `${Math.min(e.currentUses / e.maxTotalUses * 100, 100)}%` }
355
356
  })
@@ -359,113 +360,114 @@ var k = () => {
359
360
  key: "validUntil",
360
361
  header: "Valid Until",
361
362
  priority: "hidden-on-mobile",
362
- cell: (e) => /* @__PURE__ */ T("span", {
363
+ cell: (e) => /* @__PURE__ */ S("span", {
363
364
  className: "text-sm text-text-muted",
364
- children: e.validUntil ? de(e.validUntil) : "No expiry"
365
+ children: e.validUntil ? pe(e.validUntil) : "No expiry"
365
366
  })
366
367
  }
367
368
  ],
368
369
  data: Z,
369
370
  rowKey: (e) => e.id,
370
- rowActions: (e) => /* @__PURE__ */ E(w, { children: [
371
- /* @__PURE__ */ T("button", {
371
+ rowActions: (e) => /* @__PURE__ */ C(x, { children: [
372
+ /* @__PURE__ */ S("button", {
372
373
  type: "button",
373
- onClick: () => A(`/coupons/${e.id}`),
374
+ onClick: () => k(`/coupons/${e.id}`),
374
375
  className: "p-2 rounded-lg hover:bg-bg-sunken text-text-muted hover:text-text-primary",
375
376
  title: "View details",
376
- children: /* @__PURE__ */ T(g, { className: "size-4" })
377
+ children: /* @__PURE__ */ S(g, { className: "size-4" })
377
378
  }),
378
- /* @__PURE__ */ T("button", {
379
+ /* @__PURE__ */ S("button", {
379
380
  type: "button",
380
- onClick: () => A(`/coupons/${e.id}/edit`),
381
+ onClick: () => k(`/coupons/${e.id}/edit`),
381
382
  className: "p-2 rounded-lg hover:bg-bg-sunken text-text-muted hover:text-text-primary",
382
383
  title: "Edit coupon",
383
- children: /* @__PURE__ */ T(te, { className: "size-4" })
384
+ children: /* @__PURE__ */ S(h, { className: "size-4" })
384
385
  }),
385
- e.status === "ACTIVE" ? /* @__PURE__ */ T("button", {
386
+ e.status === "ACTIVE" ? /* @__PURE__ */ S("button", {
386
387
  type: "button",
387
388
  onClick: () => B(e),
388
389
  disabled: X || V === e.id,
389
390
  className: "p-2 rounded-lg hover:bg-status-error-bg-subtle text-text-muted hover:text-status-error-text disabled:opacity-50 disabled:cursor-not-allowed",
390
391
  title: "Deactivate coupon",
391
- children: /* @__PURE__ */ T(b, { className: "size-4" })
392
- }) : e.status === "INACTIVE" ? /* @__PURE__ */ T("button", {
392
+ children: /* @__PURE__ */ S(re, { className: "size-4" })
393
+ }) : e.status === "INACTIVE" ? /* @__PURE__ */ S("button", {
393
394
  type: "button",
394
- onClick: () => he(e.id, s.Active),
395
+ onClick: () => _e(e.id, o.Active),
395
396
  disabled: V === e.id,
396
397
  className: "p-2 rounded-lg hover:bg-status-success-bg-subtle text-text-muted hover:text-status-success-text disabled:opacity-50 disabled:cursor-not-allowed",
397
398
  title: "Activate coupon",
398
- children: /* @__PURE__ */ T(y, { className: "size-4" })
399
- }) : /* @__PURE__ */ T("button", {
399
+ children: /* @__PURE__ */ S(ne, { className: "size-4" })
400
+ }) : /* @__PURE__ */ S("button", {
400
401
  type: "button",
401
402
  disabled: !0,
402
403
  className: "p-2 rounded-lg text-text-muted/40 cursor-not-allowed",
403
404
  title: `Cannot change status (${e.status.toLowerCase()})`,
404
- children: /* @__PURE__ */ T(S, { className: "size-4" })
405
+ children: /* @__PURE__ */ S(ae, { className: "size-4" })
405
406
  })
406
407
  ] }),
407
- emptyState: /* @__PURE__ */ T("div", {
408
- className: "p-8 text-center text-text-muted",
409
- children: "No coupons found"
408
+ emptyState: /* @__PURE__ */ S(se, {
409
+ illustration: "empty-data",
410
+ title: "No coupons found",
411
+ description: "Create a coupon to start offering discounts at checkout."
410
412
  })
411
413
  })
412
414
  }),
413
- Y > 20 && /* @__PURE__ */ E("div", {
415
+ J > 20 && /* @__PURE__ */ C("div", {
414
416
  className: "flex items-center justify-between px-2",
415
- children: [/* @__PURE__ */ E("p", {
417
+ children: [/* @__PURE__ */ C("p", {
416
418
  className: "text-sm text-text-muted",
417
419
  children: [
418
420
  "Showing ",
419
421
  L * 20 + 1,
420
422
  "–",
421
- Math.min((L + 1) * 20, Y),
423
+ Math.min((L + 1) * 20, J),
422
424
  " of ",
423
- Y,
425
+ J,
424
426
  " ",
425
427
  "coupons"
426
428
  ]
427
- }), /* @__PURE__ */ E("div", {
429
+ }), /* @__PURE__ */ C("div", {
428
430
  className: "flex items-center gap-2",
429
431
  children: [
430
- /* @__PURE__ */ T("button", {
432
+ /* @__PURE__ */ S("button", {
431
433
  type: "button",
432
434
  onClick: () => R((e) => Math.max(0, e - 1)),
433
435
  disabled: L === 0,
434
436
  className: "p-2 rounded-lg border border-border-subtle hover:bg-bg-sunken disabled:opacity-40 disabled:cursor-not-allowed",
435
- children: /* @__PURE__ */ T(p, { className: "size-4" })
437
+ children: /* @__PURE__ */ S(d, { className: "size-4" })
436
438
  }),
437
- /* @__PURE__ */ E("span", {
439
+ /* @__PURE__ */ C("span", {
438
440
  className: "text-sm text-text-primary font-medium",
439
441
  children: [
440
442
  L + 1,
441
443
  " / ",
442
- ce
444
+ de
443
445
  ]
444
446
  }),
445
- /* @__PURE__ */ T("button", {
447
+ /* @__PURE__ */ S("button", {
446
448
  type: "button",
447
449
  onClick: () => R((e) => e + 1),
448
- disabled: !se,
450
+ disabled: !ue,
449
451
  className: "p-2 rounded-lg border border-border-subtle hover:bg-bg-sunken disabled:opacity-40 disabled:cursor-not-allowed",
450
- children: /* @__PURE__ */ T(m, { className: "size-4" })
452
+ children: /* @__PURE__ */ S(f, { className: "size-4" })
451
453
  })
452
454
  ]
453
455
  })]
454
456
  }),
455
- /* @__PURE__ */ T("div", {
457
+ /* @__PURE__ */ S("div", {
456
458
  className: "flex justify-end",
457
- children: /* @__PURE__ */ E("button", {
459
+ children: /* @__PURE__ */ C("button", {
458
460
  type: "button",
459
- onClick: ge,
461
+ onClick: ve,
460
462
  className: "px-4 py-2 rounded-lg border border-border-subtle text-text-primary hover:bg-bg-sunken flex items-center gap-2",
461
- children: [/* @__PURE__ */ T(ee, { className: "size-4" }), "Export Coupons"]
463
+ children: [/* @__PURE__ */ S(m, { className: "size-4" }), "Export Coupons"]
462
464
  })
463
465
  })
464
466
  ]
465
467
  });
466
- async function me(e) {
468
+ async function ge(e) {
467
469
  try {
468
- await le({ variables: { id: e } }), await q(), B(null), W({
470
+ await Y({ variables: { id: e } }), await K(), B(null), W({
469
471
  tone: "success",
470
472
  message: "Coupon deactivated successfully."
471
473
  });
@@ -476,15 +478,15 @@ var k = () => {
476
478
  });
477
479
  }
478
480
  }
479
- async function he(e, t) {
481
+ async function _e(e, t) {
480
482
  H(e);
481
483
  try {
482
- await ue({ variables: {
484
+ await fe({ variables: {
483
485
  id: e,
484
486
  input: { status: t }
485
- } }), await q(), W({
487
+ } }), await K(), W({
486
488
  tone: "success",
487
- message: `Coupon ${t === s.Active ? "activated" : "deactivated"} successfully.`
489
+ message: `Coupon ${t === o.Active ? "activated" : "deactivated"} successfully.`
488
490
  });
489
491
  } catch (e) {
490
492
  console.error("Failed to update coupon status:", e), W({
@@ -495,7 +497,7 @@ var k = () => {
495
497
  H(null);
496
498
  }
497
499
  }
498
- function ge() {
500
+ function ve() {
499
501
  let e = Z.map((e) => ({
500
502
  code: e.code,
501
503
  name: e.name,
@@ -522,6 +524,6 @@ var k = () => {
522
524
  }
523
525
  };
524
526
  //#endregion
525
- export { k as CouponsListPage };
527
+ export { D as CouponsListPage };
526
528
 
527
529
  //# sourceMappingURL=CouponsListPage.js.map