@burdenoff/microfe-billing 2026.1116.1 → 2026.1119.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/dist/billing/modules/addons/pages/AddonCreatePage.js +143 -143
  2. package/dist/billing/modules/addons/pages/AddonCreatePage.js.map +1 -1
  3. package/dist/billing/modules/addons/pages/AddonEditPage.js +170 -170
  4. package/dist/billing/modules/addons/pages/AddonEditPage.js.map +1 -1
  5. package/dist/billing/modules/analytics/pages/AnalyticsPage.js +148 -148
  6. package/dist/billing/modules/analytics/pages/AnalyticsPage.js.map +1 -1
  7. package/dist/billing/modules/billing/pages/BillingWebhookLogsPage.js +115 -115
  8. package/dist/billing/modules/billing/pages/BillingWebhookLogsPage.js.map +1 -1
  9. package/dist/billing/modules/billing/pages/InvoicesListPage.js +136 -136
  10. package/dist/billing/modules/billing/pages/InvoicesListPage.js.map +1 -1
  11. package/dist/billing/modules/billing/pages/OrderCallbackLogsPage.js +129 -129
  12. package/dist/billing/modules/billing/pages/OrderCallbackLogsPage.js.map +1 -1
  13. package/dist/billing/modules/billing/pages/RefundsPage.js +325 -325
  14. package/dist/billing/modules/billing/pages/RefundsPage.js.map +1 -1
  15. package/dist/billing/modules/billing/pages/UserRefundsPage.js +149 -149
  16. package/dist/billing/modules/billing/pages/UserRefundsPage.js.map +1 -1
  17. package/dist/billing/modules/checkout/components/CompleteBillingAccountModal.js +99 -98
  18. package/dist/billing/modules/checkout/components/CompleteBillingAccountModal.js.map +1 -1
  19. package/dist/billing/modules/checkout/components/StoreShippingSection.js +125 -124
  20. package/dist/billing/modules/checkout/components/StoreShippingSection.js.map +1 -1
  21. package/dist/billing/modules/checkout/components/WorkspaceQuotaAssignmentModal.js +61 -60
  22. package/dist/billing/modules/checkout/components/WorkspaceQuotaAssignmentModal.js.map +1 -1
  23. package/dist/billing/modules/coupons/pages/CouponsListPage.js +177 -177
  24. package/dist/billing/modules/coupons/pages/CouponsListPage.js.map +1 -1
  25. package/dist/billing/modules/coupons/pages/CreateCouponPage.js +231 -231
  26. package/dist/billing/modules/coupons/pages/CreateCouponPage.js.map +1 -1
  27. package/dist/billing/modules/coupons/pages/EditCouponPage.js +139 -139
  28. package/dist/billing/modules/coupons/pages/EditCouponPage.js.map +1 -1
  29. package/dist/billing/modules/credits/pages/AdminCreditsPage.js +54 -54
  30. package/dist/billing/modules/credits/pages/AdminCreditsPage.js.map +1 -1
  31. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +65 -65
  32. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js.map +1 -1
  33. package/dist/billing/modules/credits/pages/CreditsPage.js +95 -95
  34. package/dist/billing/modules/credits/pages/CreditsPage.js.map +1 -1
  35. package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.js +232 -231
  36. package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.js.map +1 -1
  37. package/dist/billing/modules/discounts/pages/DiscountsListPage.js +328 -328
  38. package/dist/billing/modules/discounts/pages/DiscountsListPage.js.map +1 -1
  39. package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js +57 -57
  40. package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js.map +1 -1
  41. package/dist/billing/modules/earnings/pages/EarningsPage.js +53 -53
  42. package/dist/billing/modules/earnings/pages/EarningsPage.js.map +1 -1
  43. package/dist/billing/modules/earnings/pages/PayoutsPage.js +100 -100
  44. package/dist/billing/modules/earnings/pages/PayoutsPage.js.map +1 -1
  45. package/dist/billing/modules/plans/pages/PlanCreatePage.js +150 -150
  46. package/dist/billing/modules/plans/pages/PlanCreatePage.js.map +1 -1
  47. package/dist/billing/modules/plans/pages/PlanEditPage.js +125 -125
  48. package/dist/billing/modules/plans/pages/PlanEditPage.js.map +1 -1
  49. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js +113 -113
  50. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js.map +1 -1
  51. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js +132 -132
  52. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js.map +1 -1
  53. package/dist/billing/modules/settings/pages/SettingsPage.js +101 -101
  54. package/dist/billing/modules/settings/pages/SettingsPage.js.map +1 -1
  55. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js +125 -125
  56. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js.map +1 -1
  57. package/dist/billing/modules/usage/components/WorkspaceAiSpendPanel.js +51 -50
  58. package/dist/billing/modules/usage/components/WorkspaceAiSpendPanel.js.map +1 -1
  59. package/dist/billing/modules/usage/pages/UsagePage.js +107 -107
  60. package/dist/billing/modules/usage/pages/UsagePage.js.map +1 -1
  61. package/dist/billing/shared/components/GeoPricingOverridesEditor.js +1 -0
  62. package/package.json +2 -2
@@ -6,29 +6,29 @@ import "../../../shared/components/index.js";
6
6
  import { useGetCouponLazyQuery as i, useUpdateCouponMutation as a } from "../../../../generated/global-operations.js";
7
7
  import { CouponStatus as o } from "../../../../generated/global-types.js";
8
8
  import { useEffect as s, useState as c } from "react";
9
- import { PagePurpose as l } from "@burdenoff/fe-libs/ui";
10
- import { AlertCircle as u, ArrowLeft as d, CheckCircle as f, Save as p } from "lucide-react";
11
- import { jsx as m, jsxs as h } from "react/jsx-runtime";
12
- import { useI18n as g } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
9
+ import { PagePurpose as l, ThemedSelect as u } from "@burdenoff/fe-libs/ui";
10
+ import { AlertCircle as d, ArrowLeft as f, CheckCircle as p, Save as m } from "lucide-react";
11
+ import { jsx as h, jsxs as g } from "react/jsx-runtime";
12
+ import { useI18n as _ } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
13
13
  // src/billing/modules/coupons/pages/EditCouponPage.tsx
14
- var _ = () => {
15
- let { t: _ } = g(), v = (e, t) => {
16
- let n = _(e);
14
+ var v = () => {
15
+ let { t: v } = _(), y = (e, t) => {
16
+ let n = v(e);
17
17
  return n === e ? t : n;
18
- }, y = n(), b = r(), x = window.location.pathname.split("/").slice(-2)[0], [S, { data: C, loading: w, error: T }] = i(), [E, { loading: D }] = a(), [O, k] = c({
18
+ }, b = n(), x = r(), S = window.location.pathname.split("/").slice(-2)[0], [C, { data: w, loading: T, error: E }] = i(), [D, { loading: O }] = a(), [k, A] = c({
19
19
  name: "",
20
20
  description: "",
21
21
  status: o.Active,
22
22
  maxTotalUses: "",
23
23
  maxUsesPerUser: "",
24
24
  validUntil: ""
25
- }), [A, j] = c({}), [M, N] = c(""), [P, F] = c(!1);
25
+ }), [j, M] = c({}), [N, P] = c(""), [F, I] = c(!1);
26
26
  if (s(() => {
27
- x && S({ variables: { id: x } });
28
- }, [x, S]), s(() => {
29
- if (C?.getCoupon) {
30
- let e = C.getCoupon;
31
- k({
27
+ S && C({ variables: { id: S } });
28
+ }, [S, C]), s(() => {
29
+ if (w?.getCoupon) {
30
+ let e = w.getCoupon;
31
+ A({
32
32
  name: e.name,
33
33
  description: e.description || "",
34
34
  status: e.status,
@@ -37,297 +37,297 @@ var _ = () => {
37
37
  validUntil: e.validUntil ? new Date(e.validUntil).toISOString().split("T")[0] : ""
38
38
  });
39
39
  }
40
- }, [C]), !b.canManageDiscounts) return /* @__PURE__ */ m(e, { message: "You don't have permission to manage coupons." });
41
- let I = (e, t) => {
42
- k((n) => ({
40
+ }, [w]), !x.canManageDiscounts) return /* @__PURE__ */ h(e, { message: "You don't have permission to manage coupons." });
41
+ let L = (e, t) => {
42
+ A((n) => ({
43
43
  ...n,
44
44
  [e]: t
45
- })), A[e] && j((t) => ({
45
+ })), j[e] && M((t) => ({
46
46
  ...t,
47
47
  [e]: ""
48
48
  }));
49
- }, L = () => {
49
+ }, R = () => {
50
50
  let e = {};
51
- return O.name.trim() || (e.name = "Name is required"), O.maxTotalUses && parseInt(O.maxTotalUses) < 1 && (e.maxTotalUses = "Must be at least 1"), O.maxUsesPerUser && parseInt(O.maxUsesPerUser) < 1 && (e.maxUsesPerUser = "Must be at least 1"), j(e), Object.keys(e).length === 0;
52
- }, R = async (e) => {
53
- if (e.preventDefault(), N(""), F(!1), L()) {
54
- if (!x) N("Coupon ID is missing");
51
+ return k.name.trim() || (e.name = "Name is required"), k.maxTotalUses && parseInt(k.maxTotalUses) < 1 && (e.maxTotalUses = "Must be at least 1"), k.maxUsesPerUser && parseInt(k.maxUsesPerUser) < 1 && (e.maxUsesPerUser = "Must be at least 1"), M(e), Object.keys(e).length === 0;
52
+ }, z = async (e) => {
53
+ if (e.preventDefault(), P(""), I(!1), R()) {
54
+ if (!S) P("Coupon ID is missing");
55
55
  else try {
56
56
  let e = {};
57
- O.name.trim() && (e.name = O.name.trim()), O.description.trim() && (e.description = O.description.trim()), O.status && (e.status = O.status), O.maxTotalUses && (e.maxTotalUses = parseInt(O.maxTotalUses)), O.maxUsesPerUser && (e.maxUsesPerUser = parseInt(O.maxUsesPerUser)), O.validUntil && (e.validUntil = new Date(O.validUntil).toISOString()), await E({ variables: {
58
- id: x,
57
+ k.name.trim() && (e.name = k.name.trim()), k.description.trim() && (e.description = k.description.trim()), k.status && (e.status = k.status), k.maxTotalUses && (e.maxTotalUses = parseInt(k.maxTotalUses)), k.maxUsesPerUser && (e.maxUsesPerUser = parseInt(k.maxUsesPerUser)), k.validUntil && (e.validUntil = new Date(k.validUntil).toISOString()), await D({ variables: {
58
+ id: S,
59
59
  input: e
60
- } }), F(!0), setTimeout(() => {
61
- y("/coupons");
60
+ } }), I(!0), setTimeout(() => {
61
+ b("/coupons");
62
62
  }, 1500);
63
63
  } catch (e) {
64
- console.error("Failed to update coupon:", e), N(e instanceof Error ? e.message : "Failed to update coupon");
64
+ console.error("Failed to update coupon:", e), P(e instanceof Error ? e.message : "Failed to update coupon");
65
65
  }
66
66
  }
67
67
  };
68
- if (w) return /* @__PURE__ */ h("div", {
68
+ if (T) return /* @__PURE__ */ g("div", {
69
69
  className: "p-8",
70
- children: [/* @__PURE__ */ m(t, {
71
- title: v("billing.coupons.editTitle", "Edit Coupon"),
70
+ children: [/* @__PURE__ */ h(t, {
71
+ title: y("billing.coupons.editTitle", "Edit Coupon"),
72
72
  description: "Loading coupon data...",
73
- actions: /* @__PURE__ */ h("button", {
73
+ actions: /* @__PURE__ */ g("button", {
74
74
  type: "button",
75
- onClick: () => y("/coupons"),
75
+ onClick: () => b("/coupons"),
76
76
  className: "px-4 py-2 rounded-lg border border-border-subtle text-text-primary hover:bg-bg-sunken flex items-center gap-2",
77
- children: [/* @__PURE__ */ m(d, { className: "size-4" }), "Back"]
77
+ children: [/* @__PURE__ */ h(f, { className: "size-4" }), "Back"]
78
78
  })
79
- }), /* @__PURE__ */ m("div", {
79
+ }), /* @__PURE__ */ h("div", {
80
80
  className: "flex items-center justify-center h-64",
81
- children: /* @__PURE__ */ m("div", {
81
+ children: /* @__PURE__ */ h("div", {
82
82
  className: "text-text-muted",
83
83
  children: "Loading coupon…"
84
84
  })
85
85
  })]
86
86
  });
87
- if (T || !C?.getCoupon) return /* @__PURE__ */ h("div", {
87
+ if (E || !w?.getCoupon) return /* @__PURE__ */ g("div", {
88
88
  className: "p-8",
89
- children: [/* @__PURE__ */ m(t, {
89
+ children: [/* @__PURE__ */ h(t, {
90
90
  title: "Edit Coupon",
91
91
  description: "Coupon not found",
92
- actions: /* @__PURE__ */ h("button", {
92
+ actions: /* @__PURE__ */ g("button", {
93
93
  type: "button",
94
- onClick: () => y("/coupons"),
94
+ onClick: () => b("/coupons"),
95
95
  className: "px-4 py-2 rounded-lg border border-border-subtle text-text-primary hover:bg-bg-sunken flex items-center gap-2",
96
- children: [/* @__PURE__ */ m(d, { className: "size-4" }), "Back"]
96
+ children: [/* @__PURE__ */ h(f, { className: "size-4" }), "Back"]
97
97
  })
98
- }), /* @__PURE__ */ m("div", {
98
+ }), /* @__PURE__ */ h("div", {
99
99
  className: "flex items-center justify-center h-64",
100
- children: /* @__PURE__ */ m("div", {
100
+ children: /* @__PURE__ */ h("div", {
101
101
  className: "text-status-error-text",
102
- children: T ? `Error: ${T.message}` : "Coupon not found"
102
+ children: E ? `Error: ${E.message}` : "Coupon not found"
103
103
  })
104
104
  })]
105
105
  });
106
- let z = C.getCoupon;
107
- return /* @__PURE__ */ h("div", {
106
+ let B = w.getCoupon;
107
+ return /* @__PURE__ */ g("div", {
108
108
  className: "p-8",
109
109
  children: [
110
- /* @__PURE__ */ m(t, {
110
+ /* @__PURE__ */ h(t, {
111
111
  title: "Edit Coupon",
112
- description: `Editing: ${z.code}`,
113
- actions: /* @__PURE__ */ h("button", {
112
+ description: `Editing: ${B.code}`,
113
+ actions: /* @__PURE__ */ g("button", {
114
114
  type: "button",
115
- onClick: () => y("/coupons"),
115
+ onClick: () => b("/coupons"),
116
116
  className: "px-4 py-2 rounded-lg border border-border-subtle text-text-primary hover:bg-bg-sunken flex items-center gap-2",
117
- children: [/* @__PURE__ */ m(d, { className: "size-4" }), "Back to Coupons"]
117
+ children: [/* @__PURE__ */ h(f, { className: "size-4" }), "Back to Coupons"]
118
118
  })
119
119
  }),
120
- /* @__PURE__ */ m(l, {
120
+ /* @__PURE__ */ h(l, {
121
121
  className: "mt-2",
122
122
  children: "Update an existing coupon's discount, limits, expiry or applicable products. The code itself and its usage history are read-only; deactivate the coupon if you want to stop it being redeemed."
123
123
  }),
124
- /* @__PURE__ */ m("div", {
124
+ /* @__PURE__ */ h("div", {
125
125
  className: "max-w-3xl mx-auto mt-8",
126
- children: /* @__PURE__ */ h("form", {
127
- onSubmit: R,
126
+ children: /* @__PURE__ */ g("form", {
127
+ onSubmit: z,
128
128
  className: "space-y-6",
129
129
  children: [
130
- /* @__PURE__ */ h("div", {
130
+ /* @__PURE__ */ g("div", {
131
131
  className: "bg-bg-sunken/30 border border-border-subtle rounded-lg p-6",
132
- children: [/* @__PURE__ */ m("h3", {
132
+ children: [/* @__PURE__ */ h("h3", {
133
133
  className: "text-lg font-semibold text-text-primary mb-4",
134
134
  children: "Coupon Details (Read-Only)"
135
- }), /* @__PURE__ */ h("div", {
135
+ }), /* @__PURE__ */ g("div", {
136
136
  className: "grid grid-cols-2 gap-4 text-sm",
137
137
  children: [
138
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("span", {
138
+ /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("span", {
139
139
  className: "text-text-muted",
140
140
  children: "Code:"
141
- }), /* @__PURE__ */ m("span", {
141
+ }), /* @__PURE__ */ h("span", {
142
142
  className: "ml-2 font-mono font-medium text-text-primary",
143
- children: z.code
143
+ children: B.code
144
144
  })] }),
145
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("span", {
145
+ /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("span", {
146
146
  className: "text-text-muted",
147
147
  children: "Type:"
148
- }), /* @__PURE__ */ m("span", {
148
+ }), /* @__PURE__ */ h("span", {
149
149
  className: "ml-2 text-text-primary capitalize",
150
- children: z.type.replace("_", " ").toLowerCase()
150
+ children: B.type.replace("_", " ").toLowerCase()
151
151
  })] }),
152
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("span", {
152
+ /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("span", {
153
153
  className: "text-text-muted",
154
154
  children: "Value:"
155
- }), /* @__PURE__ */ m("span", {
155
+ }), /* @__PURE__ */ h("span", {
156
156
  className: "ml-2 text-text-primary",
157
- children: z.type === "PERCENTAGE" ? `${z.value}%` : `$${z.value}`
157
+ children: B.type === "PERCENTAGE" ? `${B.value}%` : `$${B.value}`
158
158
  })] }),
159
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("span", {
159
+ /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("span", {
160
160
  className: "text-text-muted",
161
161
  children: "Scope:"
162
- }), /* @__PURE__ */ m("span", {
162
+ }), /* @__PURE__ */ h("span", {
163
163
  className: "ml-2 text-text-primary",
164
- children: z.scope
164
+ children: B.scope
165
165
  })] }),
166
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("span", {
166
+ /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("span", {
167
167
  className: "text-text-muted",
168
168
  children: "Current Uses:"
169
- }), /* @__PURE__ */ h("span", {
169
+ }), /* @__PURE__ */ g("span", {
170
170
  className: "ml-2 text-text-primary",
171
- children: [z.currentUses, z.maxTotalUses ? ` / ${z.maxTotalUses}` : ""]
171
+ children: [B.currentUses, B.maxTotalUses ? ` / ${B.maxTotalUses}` : ""]
172
172
  })] }),
173
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("span", {
173
+ /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("span", {
174
174
  className: "text-text-muted",
175
175
  children: "Created:"
176
- }), /* @__PURE__ */ m("span", {
176
+ }), /* @__PURE__ */ h("span", {
177
177
  className: "ml-2 text-text-primary",
178
- children: new Date(z.createdAt).toLocaleDateString()
178
+ children: new Date(B.createdAt).toLocaleDateString()
179
179
  })] })
180
180
  ]
181
181
  })]
182
182
  }),
183
- /* @__PURE__ */ h("div", {
183
+ /* @__PURE__ */ g("div", {
184
184
  className: "bg-bg-surface border border-border-subtle rounded-lg p-6 space-y-6",
185
185
  children: [
186
- /* @__PURE__ */ m("h3", {
186
+ /* @__PURE__ */ h("h3", {
187
187
  className: "text-lg font-semibold text-text-primary",
188
188
  children: "Editable Fields"
189
189
  }),
190
- /* @__PURE__ */ h("div", {
190
+ /* @__PURE__ */ g("div", {
191
191
  className: "space-y-2",
192
192
  children: [
193
- /* @__PURE__ */ h("label", {
193
+ /* @__PURE__ */ g("label", {
194
194
  htmlFor: "name",
195
195
  className: "block text-sm font-medium text-text-primary",
196
- children: ["Name ", /* @__PURE__ */ m("span", {
196
+ children: ["Name ", /* @__PURE__ */ h("span", {
197
197
  className: "text-status-error-text",
198
198
  children: "*"
199
199
  })]
200
200
  }),
201
- /* @__PURE__ */ m("input", {
201
+ /* @__PURE__ */ h("input", {
202
202
  id: "name",
203
203
  type: "text",
204
- value: O.name,
205
- onChange: (e) => I("name", e.target.value),
204
+ value: k.name,
205
+ onChange: (e) => L("name", e.target.value),
206
206
  placeholder: "e.g., Welcome Discount",
207
207
  className: "w-full px-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)]"
208
208
  }),
209
- A.name && /* @__PURE__ */ m("p", {
209
+ j.name && /* @__PURE__ */ h("p", {
210
210
  className: "text-sm text-status-error-text",
211
- children: A.name
211
+ children: j.name
212
212
  })
213
213
  ]
214
214
  }),
215
- /* @__PURE__ */ h("div", {
215
+ /* @__PURE__ */ g("div", {
216
216
  className: "space-y-2",
217
- children: [/* @__PURE__ */ m("label", {
217
+ children: [/* @__PURE__ */ h("label", {
218
218
  htmlFor: "description",
219
219
  className: "block text-sm font-medium text-text-primary",
220
220
  children: "Description"
221
- }), /* @__PURE__ */ m("textarea", {
221
+ }), /* @__PURE__ */ h("textarea", {
222
222
  id: "description",
223
- value: O.description,
224
- onChange: (e) => I("description", e.target.value),
223
+ value: k.description,
224
+ onChange: (e) => L("description", e.target.value),
225
225
  placeholder: "Optional description",
226
226
  rows: 3,
227
227
  className: "w-full px-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)] resize-none"
228
228
  })]
229
229
  }),
230
- /* @__PURE__ */ h("div", {
230
+ /* @__PURE__ */ g("div", {
231
231
  className: "space-y-2",
232
- children: [/* @__PURE__ */ m("label", {
232
+ children: [/* @__PURE__ */ h("label", {
233
233
  htmlFor: "status",
234
234
  className: "block text-sm font-medium text-text-primary",
235
235
  children: "Status"
236
- }), /* @__PURE__ */ h("select", {
236
+ }), /* @__PURE__ */ g(u, {
237
237
  id: "status",
238
- value: O.status,
239
- onChange: (e) => I("status", e.target.value),
238
+ value: k.status,
239
+ onChange: (e) => L("status", e.target.value),
240
240
  className: "w-full 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)] scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
241
241
  children: [
242
- /* @__PURE__ */ m("option", {
242
+ /* @__PURE__ */ h("option", {
243
243
  value: "ACTIVE",
244
244
  children: "Active"
245
245
  }),
246
- /* @__PURE__ */ m("option", {
246
+ /* @__PURE__ */ h("option", {
247
247
  value: "INACTIVE",
248
248
  children: "Inactive"
249
249
  }),
250
- /* @__PURE__ */ m("option", {
250
+ /* @__PURE__ */ h("option", {
251
251
  value: "EXPIRED",
252
252
  children: "Expired"
253
253
  }),
254
- /* @__PURE__ */ m("option", {
254
+ /* @__PURE__ */ h("option", {
255
255
  value: "DEPLETED",
256
256
  children: "Depleted"
257
257
  })
258
258
  ]
259
259
  })]
260
260
  }),
261
- /* @__PURE__ */ h("div", {
261
+ /* @__PURE__ */ g("div", {
262
262
  className: "space-y-2",
263
263
  children: [
264
- /* @__PURE__ */ m("label", {
264
+ /* @__PURE__ */ h("label", {
265
265
  htmlFor: "maxTotalUses",
266
266
  className: "block text-sm font-medium text-text-primary",
267
267
  children: "Maximum Total Uses"
268
268
  }),
269
- /* @__PURE__ */ m("input", {
269
+ /* @__PURE__ */ h("input", {
270
270
  id: "maxTotalUses",
271
271
  type: "number",
272
272
  min: "1",
273
- value: O.maxTotalUses,
274
- onChange: (e) => I("maxTotalUses", e.target.value),
273
+ value: k.maxTotalUses,
274
+ onChange: (e) => L("maxTotalUses", e.target.value),
275
275
  placeholder: "Leave empty for unlimited",
276
276
  className: "w-full px-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)]"
277
277
  }),
278
- A.maxTotalUses && /* @__PURE__ */ m("p", {
278
+ j.maxTotalUses && /* @__PURE__ */ h("p", {
279
279
  className: "text-sm text-status-error-text",
280
- children: A.maxTotalUses
280
+ children: j.maxTotalUses
281
281
  }),
282
- /* @__PURE__ */ h("p", {
282
+ /* @__PURE__ */ g("p", {
283
283
  className: "text-sm text-text-muted",
284
284
  children: [
285
285
  "Current uses: ",
286
- z.currentUses,
287
- z.maxTotalUses ? ` / ${z.maxTotalUses}` : ""
286
+ B.currentUses,
287
+ B.maxTotalUses ? ` / ${B.maxTotalUses}` : ""
288
288
  ]
289
289
  })
290
290
  ]
291
291
  }),
292
- /* @__PURE__ */ h("div", {
292
+ /* @__PURE__ */ g("div", {
293
293
  className: "space-y-2",
294
294
  children: [
295
- /* @__PURE__ */ m("label", {
295
+ /* @__PURE__ */ h("label", {
296
296
  htmlFor: "maxUsesPerUser",
297
297
  className: "block text-sm font-medium text-text-primary",
298
298
  children: "Maximum Uses Per User"
299
299
  }),
300
- /* @__PURE__ */ m("input", {
300
+ /* @__PURE__ */ h("input", {
301
301
  id: "maxUsesPerUser",
302
302
  type: "number",
303
303
  min: "1",
304
- value: O.maxUsesPerUser,
305
- onChange: (e) => I("maxUsesPerUser", e.target.value),
304
+ value: k.maxUsesPerUser,
305
+ onChange: (e) => L("maxUsesPerUser", e.target.value),
306
306
  placeholder: "e.g., 1",
307
307
  className: "w-full px-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)]"
308
308
  }),
309
- A.maxUsesPerUser && /* @__PURE__ */ m("p", {
309
+ j.maxUsesPerUser && /* @__PURE__ */ h("p", {
310
310
  className: "text-sm text-status-error-text",
311
- children: A.maxUsesPerUser
311
+ children: j.maxUsesPerUser
312
312
  })
313
313
  ]
314
314
  }),
315
- /* @__PURE__ */ h("div", {
315
+ /* @__PURE__ */ g("div", {
316
316
  className: "space-y-2",
317
317
  children: [
318
- /* @__PURE__ */ m("label", {
318
+ /* @__PURE__ */ h("label", {
319
319
  htmlFor: "validUntil",
320
320
  className: "block text-sm font-medium text-text-primary",
321
321
  children: "Valid Until"
322
322
  }),
323
- /* @__PURE__ */ m("input", {
323
+ /* @__PURE__ */ h("input", {
324
324
  id: "validUntil",
325
325
  type: "date",
326
- value: O.validUntil,
327
- onChange: (e) => I("validUntil", e.target.value),
326
+ value: k.validUntil,
327
+ onChange: (e) => L("validUntil", e.target.value),
328
328
  className: "w-full 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)]"
329
329
  }),
330
- /* @__PURE__ */ m("p", {
330
+ /* @__PURE__ */ h("p", {
331
331
  className: "text-sm text-text-muted",
332
332
  children: "Leave empty for no expiration"
333
333
  })
@@ -335,42 +335,42 @@ var _ = () => {
335
335
  })
336
336
  ]
337
337
  }),
338
- M && /* @__PURE__ */ h("div", {
338
+ N && /* @__PURE__ */ g("div", {
339
339
  className: "flex items-start gap-3 p-4 rounded-lg bg-status-error-bg-subtle border border-status-error-border",
340
- children: [/* @__PURE__ */ m(u, { className: "size-5 text-status-error-text mt-0.5" }), /* @__PURE__ */ h("div", {
340
+ children: [/* @__PURE__ */ h(d, { className: "size-5 text-status-error-text mt-0.5" }), /* @__PURE__ */ g("div", {
341
341
  className: "flex-1",
342
- children: [/* @__PURE__ */ m("p", {
342
+ children: [/* @__PURE__ */ h("p", {
343
343
  className: "text-sm font-medium text-status-error-text",
344
344
  children: "Error"
345
- }), /* @__PURE__ */ m("p", {
345
+ }), /* @__PURE__ */ h("p", {
346
346
  className: "text-sm text-status-error-text/90 mt-1",
347
- children: M
347
+ children: N
348
348
  })]
349
349
  })]
350
350
  }),
351
- P && /* @__PURE__ */ h("div", {
351
+ F && /* @__PURE__ */ g("div", {
352
352
  className: "flex items-start gap-3 p-4 rounded-lg bg-status-success-bg-subtle border border-status-success-bg-subtle",
353
- children: [/* @__PURE__ */ m(f, { className: "size-5 text-status-success-text mt-0.5" }), /* @__PURE__ */ h("div", {
353
+ children: [/* @__PURE__ */ h(p, { className: "size-5 text-status-success-text mt-0.5" }), /* @__PURE__ */ g("div", {
354
354
  className: "flex-1",
355
- children: [/* @__PURE__ */ m("p", {
355
+ children: [/* @__PURE__ */ h("p", {
356
356
  className: "text-sm font-medium text-status-success-text",
357
357
  children: "Success"
358
- }), /* @__PURE__ */ m("p", {
358
+ }), /* @__PURE__ */ h("p", {
359
359
  className: "text-sm text-status-success-text/90 mt-1",
360
360
  children: "Coupon updated successfully! Redirecting…"
361
361
  })]
362
362
  })]
363
363
  }),
364
- /* @__PURE__ */ h("div", {
364
+ /* @__PURE__ */ g("div", {
365
365
  className: "flex gap-4 pt-4 border-t border-border-subtle",
366
- children: [/* @__PURE__ */ h("button", {
366
+ children: [/* @__PURE__ */ g("button", {
367
367
  type: "submit",
368
- disabled: D || P,
368
+ disabled: O || F,
369
369
  className: "px-6 py-2 rounded-lg bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bgHover disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2",
370
- children: [/* @__PURE__ */ m(p, { className: "size-4" }), D ? "Updating..." : "Update Coupon"]
371
- }), /* @__PURE__ */ m("button", {
370
+ children: [/* @__PURE__ */ h(m, { className: "size-4" }), O ? "Updating..." : "Update Coupon"]
371
+ }), /* @__PURE__ */ h("button", {
372
372
  type: "button",
373
- onClick: () => y("/coupons"),
373
+ onClick: () => b("/coupons"),
374
374
  className: "px-6 py-2 rounded-lg border border-border-subtle text-text-primary hover:bg-bg-sunken",
375
375
  children: "Cancel"
376
376
  })]
@@ -381,6 +381,6 @@ var _ = () => {
381
381
  ]
382
382
  });
383
383
  };
384
- export { _ as EditCouponPage };
384
+ export { v as EditCouponPage };
385
385
 
386
386
  //# sourceMappingURL=EditCouponPage.js.map