@burdenoff/microfe-billing 2026.1113.1 → 2026.1113.3

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 (109) 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 +144 -144
  43. package/dist/billing/modules/credits/pages/CreditsPage.js +67 -67
  44. package/dist/billing/modules/dashboard/pages/OverviewPage.js +594 -442
  45. package/dist/billing/modules/dashboard/pages/OverviewPage.js.map +1 -1
  46. package/dist/billing/modules/dashboard/utils/overviewSummary.d.ts +46 -0
  47. package/dist/billing/modules/dashboard/utils/overviewSummary.js +37 -0
  48. package/dist/billing/modules/dashboard/utils/overviewSummary.js.map +1 -0
  49. package/dist/billing/modules/discounts/pages/DiscountsListPage.js +199 -199
  50. package/dist/billing/modules/discounts/pages/DiscountsListPage.js.map +1 -1
  51. package/dist/billing/modules/earnings/pages/DeveloperRevenueAdminPage.js +64 -64
  52. package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js +122 -122
  53. package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js.map +1 -1
  54. package/dist/billing/modules/earnings/pages/EarningsPage.js +102 -102
  55. package/dist/billing/modules/earnings/pages/EarningsPage.js.map +1 -1
  56. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js +178 -178
  57. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js.map +1 -1
  58. package/dist/billing/modules/earnings/pages/PayoutsPage.js +107 -107
  59. package/dist/billing/modules/earnings/pages/PayoutsPage.js.map +1 -1
  60. package/dist/billing/modules/plans/pages/PlanAssignFreePage.js +54 -54
  61. package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js +94 -94
  62. package/dist/billing/modules/plans/pages/PlanCreatePage.js +73 -73
  63. package/dist/billing/modules/plans/pages/PlanDetailPage.js +96 -96
  64. package/dist/billing/modules/plans/pages/PlanEditPage.js +16 -16
  65. package/dist/billing/modules/plans/pages/PlanEditPage.js.map +1 -1
  66. package/dist/billing/modules/plans/pages/PlansBrowsePage.js +143 -143
  67. package/dist/billing/modules/plans/pages/PlansBrowsePage.js.map +1 -1
  68. package/dist/billing/modules/plans/pages/PlansListPage.js +88 -88
  69. package/dist/billing/modules/plans/utils/planAction.d.ts +9 -0
  70. package/dist/billing/modules/plans/utils/planAction.js +4 -1
  71. package/dist/billing/modules/plans/utils/planAction.js.map +1 -1
  72. package/dist/billing/modules/promotions/pages/CreatePromotionPage.js +60 -60
  73. package/dist/billing/modules/promotions/pages/PromotionsListPage.js +37 -37
  74. package/dist/billing/modules/quota/pages/QuotaAssignFreePage.js +62 -62
  75. package/dist/billing/modules/quota/pages/QuotaPage.js +1 -1
  76. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js +69 -69
  77. package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js +76 -76
  78. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js +80 -80
  79. package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js +95 -95
  80. package/dist/billing/modules/settings/pages/SettingsPage.js +134 -134
  81. package/dist/billing/modules/settings/pages/SettingsPage.js.map +1 -1
  82. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js +62 -62
  83. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js.map +1 -1
  84. package/dist/billing/modules/subscriptions/components/ManageSeatsModal.js +36 -36
  85. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js +534 -410
  86. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js.map +1 -1
  87. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js +111 -111
  88. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js +166 -160
  89. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js.map +1 -1
  90. package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.d.ts +30 -0
  91. package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.js +20 -0
  92. package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.js.map +1 -0
  93. package/dist/billing/modules/subscriptions/utils/upgradeAccess.d.ts +10 -0
  94. package/dist/billing/modules/subscriptions/utils/upgradeAccess.js +7 -0
  95. package/dist/billing/modules/subscriptions/utils/upgradeAccess.js.map +1 -0
  96. package/dist/billing/modules/usage/pages/UsagePage.js +722 -591
  97. package/dist/billing/modules/usage/pages/UsagePage.js.map +1 -1
  98. package/dist/billing/modules/usage/utils/usageHealth.d.ts +63 -0
  99. package/dist/billing/modules/usage/utils/usageHealth.js +43 -0
  100. package/dist/billing/modules/usage/utils/usageHealth.js.map +1 -0
  101. package/dist/billing/shared/components/EmptyState.js +3 -3
  102. package/dist/billing/shared/components/MoneyActionDialog.js +12 -12
  103. package/dist/billing/shared/ui/MetricCard.js +13 -13
  104. package/dist/billing/shared/utils/format.js +16 -4
  105. package/dist/billing/shared/utils/format.js.map +1 -1
  106. package/dist/billing/shared/utils/index.js +8 -8
  107. package/dist/generated/global-operations.js +294 -286
  108. package/dist/generated/global-operations.js.map +1 -1
  109. package/package.json +2 -2
@@ -5,9 +5,9 @@ import "../../../shared/components/index.js";
5
5
  import { formatCurrency as o, formatDate as s } from "../../../shared/utils/format.js";
6
6
  import { nativeImpact as c, nativeNotify as l } from "../../../../utils/nativeBridge.js";
7
7
  import { useMemo as ee, useState as u } from "react";
8
- import { jsx as d, jsxs as f } from "react/jsx-runtime";
9
- import { useI18n as p } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
10
- import { IllustratedEmptyState as m, PagePurpose as te } from "@burdenoff/fe-libs/ui";
8
+ import { IllustratedEmptyState as d, PagePurpose as f } from "@burdenoff/fe-libs/ui";
9
+ import { jsx as p, jsxs as m } from "react/jsx-runtime";
10
+ import { useI18n as te } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
11
11
  // src/billing/modules/discounts/pages/DiscountsListPage.tsx
12
12
  function h(e) {
13
13
  return e.validUntil ? new Date(e.validUntil) < /* @__PURE__ */ new Date() : !1;
@@ -24,14 +24,14 @@ var _ = {
24
24
  validFrom: "",
25
25
  validUntil: ""
26
26
  }, v = () => {
27
- let { t: o } = p(), s = (e, t) => {
27
+ let { t: o } = te(), s = (e, t) => {
28
28
  let n = o(e);
29
29
  return n === e ? t : n;
30
30
  }, v = a(), { data: ne, loading: re, error: x, refetch: S } = r(), [C, { loading: w }] = t(), [T, { loading: E }] = i(), [D, { loading: O }] = n(), [k, A] = u(""), [j, M] = u({ kind: "closed" }), [N, P] = u(_), [F, I] = u({
31
31
  maxUses: "",
32
32
  validUntil: ""
33
33
  }), [L, R] = u(null), [z, B] = u(/* @__PURE__ */ new Set()), [V, H] = u(!1), U = ne?.getDiscounts ?? [], W = U.filter((e) => !k || e.code.toLowerCase().includes(k.toLowerCase())), G = ee(() => W.filter((e) => z.has(e.id)), [W, z]), K = W.length > 0 && W.every((e) => z.has(e.id)), q = W.some((e) => z.has(e.id)) && !K;
34
- if (!v.canManageDiscounts) return /* @__PURE__ */ d(e, { message: "You don't have permission to manage discount codes." });
34
+ if (!v.canManageDiscounts) return /* @__PURE__ */ p(e, { message: "You don't have permission to manage discount codes." });
35
35
  let J = U.length, Y = U.filter((e) => !h(e)).length, ie = U.filter((e) => h(e)).length, X = () => {
36
36
  P(_), R(null), M({ kind: "create" });
37
37
  }, ae = (e) => {
@@ -107,22 +107,22 @@ var _ = {
107
107
  }), n;
108
108
  }), H(!1);
109
109
  };
110
- return re && U.length === 0 ? /* @__PURE__ */ f("div", {
110
+ return re && U.length === 0 ? /* @__PURE__ */ m("div", {
111
111
  className: "space-y-6 p-6",
112
112
  children: [
113
- /* @__PURE__ */ d("div", { className: "h-8 w-48 bg-bg-sunken animate-pulse rounded" }),
114
- /* @__PURE__ */ d("div", {
113
+ /* @__PURE__ */ p("div", { className: "h-8 w-48 bg-bg-sunken animate-pulse rounded" }),
114
+ /* @__PURE__ */ p("div", {
115
115
  className: "grid grid-cols-1 sm:grid-cols-3 gap-4",
116
116
  children: [
117
117
  1,
118
118
  2,
119
119
  3
120
- ].map((e) => /* @__PURE__ */ f("div", {
120
+ ].map((e) => /* @__PURE__ */ m("div", {
121
121
  className: "border border-border-subtle rounded-lg p-4 space-y-2",
122
- children: [/* @__PURE__ */ d("div", { className: "h-4 w-24 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ d("div", { className: "h-6 w-16 bg-bg-sunken animate-pulse rounded" })]
122
+ children: [/* @__PURE__ */ p("div", { className: "h-4 w-24 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ p("div", { className: "h-6 w-16 bg-bg-sunken animate-pulse rounded" })]
123
123
  }, e))
124
124
  }),
125
- /* @__PURE__ */ d("div", {
125
+ /* @__PURE__ */ p("div", {
126
126
  className: "space-y-3",
127
127
  children: [
128
128
  1,
@@ -130,31 +130,31 @@ var _ = {
130
130
  3,
131
131
  4,
132
132
  5
133
- ].map((e) => /* @__PURE__ */ d("div", {
133
+ ].map((e) => /* @__PURE__ */ p("div", {
134
134
  className: "border border-border-subtle rounded-lg p-4",
135
- children: /* @__PURE__ */ f("div", {
135
+ children: /* @__PURE__ */ m("div", {
136
136
  className: "flex items-center gap-4",
137
- children: [/* @__PURE__ */ d("div", { className: "size-10 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ f("div", {
137
+ children: [/* @__PURE__ */ p("div", { className: "size-10 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ m("div", {
138
138
  className: "flex-1 space-y-2",
139
- children: [/* @__PURE__ */ d("div", { className: "h-4 w-32 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ d("div", { className: "h-3 w-48 bg-bg-sunken animate-pulse rounded" })]
139
+ children: [/* @__PURE__ */ p("div", { className: "h-4 w-32 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ p("div", { className: "h-3 w-48 bg-bg-sunken animate-pulse rounded" })]
140
140
  })]
141
141
  })
142
142
  }, e))
143
143
  })
144
144
  ]
145
- }) : x ? /* @__PURE__ */ d("div", {
145
+ }) : x ? /* @__PURE__ */ p("div", {
146
146
  className: "flex items-center justify-center h-full min-h-[400px]",
147
- children: /* @__PURE__ */ f("div", {
147
+ children: /* @__PURE__ */ m("div", {
148
148
  className: "text-center space-y-4",
149
149
  children: [
150
- /* @__PURE__ */ d("div", {
150
+ /* @__PURE__ */ p("div", {
151
151
  className: "size-12 mx-auto rounded-full bg-status-error-bg-subtle flex items-center justify-center",
152
- children: /* @__PURE__ */ d("svg", {
152
+ children: /* @__PURE__ */ p("svg", {
153
153
  className: "size-6 text-status-error-text",
154
154
  fill: "none",
155
155
  viewBox: "0 0 24 24",
156
156
  stroke: "currentColor",
157
- children: /* @__PURE__ */ d("path", {
157
+ children: /* @__PURE__ */ p("path", {
158
158
  strokeLinecap: "round",
159
159
  strokeLinejoin: "round",
160
160
  strokeWidth: 2,
@@ -162,15 +162,15 @@ var _ = {
162
162
  })
163
163
  })
164
164
  }),
165
- /* @__PURE__ */ d("h2", {
165
+ /* @__PURE__ */ p("h2", {
166
166
  className: "text-lg font-semibold text-text-primary",
167
167
  children: "Failed to load discounts"
168
168
  }),
169
- /* @__PURE__ */ d("p", {
169
+ /* @__PURE__ */ p("p", {
170
170
  className: "text-sm text-text-muted",
171
171
  children: x.message
172
172
  }),
173
- /* @__PURE__ */ d("button", {
173
+ /* @__PURE__ */ p("button", {
174
174
  type: "button",
175
175
  onClick: () => S(),
176
176
  className: "px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-colors",
@@ -178,34 +178,34 @@ var _ = {
178
178
  })
179
179
  ]
180
180
  })
181
- }) : /* @__PURE__ */ f("div", {
181
+ }) : /* @__PURE__ */ m("div", {
182
182
  className: "space-y-6 p-6",
183
183
  children: [
184
- /* @__PURE__ */ f("div", {
184
+ /* @__PURE__ */ m("div", {
185
185
  className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
186
- children: [/* @__PURE__ */ f("div", { children: [
187
- /* @__PURE__ */ d("h1", {
186
+ children: [/* @__PURE__ */ m("div", { children: [
187
+ /* @__PURE__ */ p("h1", {
188
188
  className: "text-2xl md:text-3xl font-semibold tracking-tight text-text-primary",
189
189
  children: "Discount Codes"
190
190
  }),
191
- /* @__PURE__ */ d("p", {
191
+ /* @__PURE__ */ p("p", {
192
192
  className: "text-sm text-text-secondary mt-1",
193
193
  children: "Create, view, and manage discount codes for billing"
194
194
  }),
195
- /* @__PURE__ */ d(te, {
195
+ /* @__PURE__ */ p(f, {
196
196
  className: "mt-3",
197
197
  children: "Discount codes reduce the price of a purchase at checkout. Create codes here, set how much they take off and any limits, and manage which ones are active — separate from time-bounded promotions and customer-facing coupons."
198
198
  })
199
- ] }), /* @__PURE__ */ f("button", {
199
+ ] }), /* @__PURE__ */ m("button", {
200
200
  type: "button",
201
201
  onClick: X,
202
202
  className: "inline-flex items-center gap-2 px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-colors duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
203
- children: [/* @__PURE__ */ d("svg", {
203
+ children: [/* @__PURE__ */ p("svg", {
204
204
  className: "size-4",
205
205
  fill: "none",
206
206
  viewBox: "0 0 24 24",
207
207
  stroke: "currentColor",
208
- children: /* @__PURE__ */ d("path", {
208
+ children: /* @__PURE__ */ p("path", {
209
209
  strokeLinecap: "round",
210
210
  strokeLinejoin: "round",
211
211
  strokeWidth: 2,
@@ -214,57 +214,57 @@ var _ = {
214
214
  }), "Create Discount"]
215
215
  })]
216
216
  }),
217
- /* @__PURE__ */ f("div", {
217
+ /* @__PURE__ */ m("div", {
218
218
  className: "grid grid-cols-1 sm:grid-cols-3 gap-4",
219
219
  children: [
220
- /* @__PURE__ */ f("div", {
220
+ /* @__PURE__ */ m("div", {
221
221
  className: "rounded-card border border-border-seam bg-bg-surface p-5 shadow-[var(--shadow-elevation-1)]",
222
- children: [/* @__PURE__ */ d("p", {
222
+ children: [/* @__PURE__ */ p("p", {
223
223
  className: "text-sm text-text-secondary",
224
224
  children: "Total Discounts"
225
- }), /* @__PURE__ */ d("p", {
225
+ }), /* @__PURE__ */ p("p", {
226
226
  className: "text-2xl font-semibold text-text-primary tabular-nums mt-1",
227
227
  children: J
228
228
  })]
229
229
  }),
230
- /* @__PURE__ */ f("div", {
230
+ /* @__PURE__ */ m("div", {
231
231
  className: "rounded-card border border-border-seam bg-bg-surface p-5 shadow-[var(--shadow-elevation-1)]",
232
- children: [/* @__PURE__ */ d("p", {
232
+ children: [/* @__PURE__ */ p("p", {
233
233
  className: "text-sm text-text-secondary",
234
234
  children: "Active"
235
- }), /* @__PURE__ */ d("p", {
235
+ }), /* @__PURE__ */ p("p", {
236
236
  className: "text-2xl font-semibold text-status-success-text tabular-nums mt-1",
237
237
  children: Y
238
238
  })]
239
239
  }),
240
- /* @__PURE__ */ f("div", {
240
+ /* @__PURE__ */ m("div", {
241
241
  className: "rounded-card border border-border-seam bg-bg-surface p-5 shadow-[var(--shadow-elevation-1)]",
242
- children: [/* @__PURE__ */ d("p", {
242
+ children: [/* @__PURE__ */ p("p", {
243
243
  className: "text-sm text-text-secondary",
244
244
  children: "Expired"
245
- }), /* @__PURE__ */ d("p", {
245
+ }), /* @__PURE__ */ p("p", {
246
246
  className: "text-2xl font-semibold text-status-warning-text tabular-nums mt-1",
247
247
  children: ie
248
248
  })]
249
249
  })
250
250
  ]
251
251
  }),
252
- /* @__PURE__ */ d("div", {
252
+ /* @__PURE__ */ p("div", {
253
253
  className: "flex flex-col sm:flex-row flex-wrap items-stretch sm:items-center gap-3 sm:gap-4 pb-4 border-b border-border-subtle",
254
- children: /* @__PURE__ */ f("div", {
254
+ children: /* @__PURE__ */ m("div", {
255
255
  className: "relative flex-1 min-w-0 w-full sm:max-w-md",
256
- children: [/* @__PURE__ */ d("svg", {
256
+ children: [/* @__PURE__ */ p("svg", {
257
257
  className: "absolute left-3 top-1/2 -translate-y-1/2 size-4 text-text-muted",
258
258
  fill: "none",
259
259
  viewBox: "0 0 24 24",
260
260
  stroke: "currentColor",
261
- children: /* @__PURE__ */ d("path", {
261
+ children: /* @__PURE__ */ p("path", {
262
262
  strokeLinecap: "round",
263
263
  strokeLinejoin: "round",
264
264
  strokeWidth: 2,
265
265
  d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"
266
266
  })
267
- }), /* @__PURE__ */ d("input", {
267
+ }), /* @__PURE__ */ p("input", {
268
268
  type: "text",
269
269
  placeholder: "Search by discount code...",
270
270
  value: k,
@@ -273,11 +273,11 @@ var _ = {
273
273
  })]
274
274
  })
275
275
  }),
276
- W.length > 0 && /* @__PURE__ */ f("div", {
276
+ W.length > 0 && /* @__PURE__ */ m("div", {
277
277
  className: "flex flex-col gap-3 rounded-lg border border-border-subtle bg-bg-surface p-4 sm:flex-row sm:items-center sm:justify-between",
278
- children: [/* @__PURE__ */ f("label", {
278
+ children: [/* @__PURE__ */ m("label", {
279
279
  className: "flex items-center gap-2 text-sm text-text-primary",
280
- children: [/* @__PURE__ */ d("input", {
280
+ children: [/* @__PURE__ */ p("input", {
281
281
  type: "checkbox",
282
282
  checked: K,
283
283
  ref: (e) => {
@@ -286,15 +286,15 @@ var _ = {
286
286
  onChange: (e) => $(e.target.checked),
287
287
  "aria-label": "Select all discounts",
288
288
  className: "size-4 rounded border-border-subtle text-text-link"
289
- }), /* @__PURE__ */ d("span", { children: "Select all visible" })]
290
- }), /* @__PURE__ */ f("div", {
289
+ }), /* @__PURE__ */ p("span", { children: "Select all visible" })]
290
+ }), /* @__PURE__ */ m("div", {
291
291
  className: "flex items-center gap-2",
292
292
  children: [
293
- /* @__PURE__ */ f("span", {
293
+ /* @__PURE__ */ m("span", {
294
294
  className: "text-sm text-text-muted",
295
295
  children: [z.size, " selected"]
296
296
  }),
297
- z.size > 0 && /* @__PURE__ */ d("button", {
297
+ z.size > 0 && /* @__PURE__ */ p("button", {
298
298
  type: "button",
299
299
  onClick: () => {
300
300
  B(/* @__PURE__ */ new Set()), H(!1);
@@ -302,7 +302,7 @@ var _ = {
302
302
  className: "text-sm text-text-muted hover:text-text-primary",
303
303
  children: "Clear selection"
304
304
  }),
305
- /* @__PURE__ */ f("button", {
305
+ /* @__PURE__ */ m("button", {
306
306
  type: "button",
307
307
  onClick: () => H(!0),
308
308
  disabled: G.length === 0 || O,
@@ -312,11 +312,11 @@ var _ = {
312
312
  ]
313
313
  })]
314
314
  }),
315
- V && G.length > 0 && /* @__PURE__ */ d("div", {
315
+ V && G.length > 0 && /* @__PURE__ */ p("div", {
316
316
  className: "rounded-lg border border-status-error-border bg-status-error-bg-subtle p-4",
317
- children: /* @__PURE__ */ f("div", {
317
+ children: /* @__PURE__ */ m("div", {
318
318
  className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",
319
- children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ f("p", {
319
+ children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ m("p", {
320
320
  className: "text-sm font-medium text-text-primary",
321
321
  children: [
322
322
  "Delete ",
@@ -325,17 +325,17 @@ var _ = {
325
325
  G.length === 1 ? "" : "s",
326
326
  "?"
327
327
  ]
328
- }), /* @__PURE__ */ d("p", {
328
+ }), /* @__PURE__ */ p("p", {
329
329
  className: "text-sm text-text-muted",
330
330
  children: "This action cannot be undone."
331
- })] }), /* @__PURE__ */ f("div", {
331
+ })] }), /* @__PURE__ */ m("div", {
332
332
  className: "flex items-center gap-2",
333
- children: [/* @__PURE__ */ d("button", {
333
+ children: [/* @__PURE__ */ p("button", {
334
334
  type: "button",
335
335
  onClick: () => H(!1),
336
336
  className: "px-3 py-2 text-sm font-medium text-text-muted hover:text-text-primary",
337
337
  children: "Cancel"
338
- }), /* @__PURE__ */ d("button", {
338
+ }), /* @__PURE__ */ p("button", {
339
339
  type: "button",
340
340
  onClick: le,
341
341
  disabled: O,
@@ -345,28 +345,28 @@ var _ = {
345
345
  })]
346
346
  })
347
347
  }),
348
- W.length === 0 ? /* @__PURE__ */ d(m, {
348
+ W.length === 0 ? /* @__PURE__ */ p(d, {
349
349
  illustration: k ? "empty-search" : "empty-data",
350
350
  title: "No discount codes found",
351
351
  description: k ? "No discount codes match your search." : "Create your first discount code to get started.",
352
- action: k ? void 0 : /* @__PURE__ */ d("button", {
352
+ action: k ? void 0 : /* @__PURE__ */ p("button", {
353
353
  type: "button",
354
354
  onClick: X,
355
355
  className: "px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-colors",
356
356
  children: "Create your first discount"
357
357
  })
358
- }) : /* @__PURE__ */ d("div", {
358
+ }) : /* @__PURE__ */ p("div", {
359
359
  className: "border border-border-seam rounded-card overflow-hidden shadow-[var(--shadow-elevation-1)]",
360
- children: /* @__PURE__ */ d("div", {
360
+ children: /* @__PURE__ */ p("div", {
361
361
  className: "overflow-x-auto",
362
- children: /* @__PURE__ */ f("table", {
362
+ children: /* @__PURE__ */ m("table", {
363
363
  className: "w-full",
364
- children: [/* @__PURE__ */ d("thead", {
364
+ children: [/* @__PURE__ */ p("thead", {
365
365
  className: "sticky top-0 z-10 bg-bg-sunken border-b border-border-subtle",
366
- children: /* @__PURE__ */ f("tr", { children: [
367
- /* @__PURE__ */ d("th", {
366
+ children: /* @__PURE__ */ m("tr", { children: [
367
+ /* @__PURE__ */ p("th", {
368
368
  className: "text-left px-4 py-3 text-xs font-medium uppercase tracking-wide text-text-muted w-12",
369
- children: /* @__PURE__ */ d("input", {
369
+ children: /* @__PURE__ */ p("input", {
370
370
  type: "checkbox",
371
371
  checked: K,
372
372
  ref: (e) => {
@@ -377,42 +377,42 @@ var _ = {
377
377
  className: "size-4 rounded border-border-subtle text-action-primary-bg focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
378
378
  })
379
379
  }),
380
- /* @__PURE__ */ d("th", {
380
+ /* @__PURE__ */ p("th", {
381
381
  className: "text-left px-4 py-3 text-xs font-medium uppercase tracking-wide text-text-muted",
382
382
  children: "Code"
383
383
  }),
384
- /* @__PURE__ */ d("th", {
384
+ /* @__PURE__ */ p("th", {
385
385
  className: "text-left px-4 py-3 text-xs font-medium uppercase tracking-wide text-text-muted",
386
386
  children: "Type"
387
387
  }),
388
- /* @__PURE__ */ d("th", {
388
+ /* @__PURE__ */ p("th", {
389
389
  className: "text-left px-4 py-3 text-xs font-medium uppercase tracking-wide text-text-muted",
390
390
  children: "Value"
391
391
  }),
392
- /* @__PURE__ */ d("th", {
392
+ /* @__PURE__ */ p("th", {
393
393
  className: "text-left px-4 py-3 text-xs font-medium uppercase tracking-wide text-text-muted hidden md:table-cell",
394
394
  children: "Uses"
395
395
  }),
396
- /* @__PURE__ */ d("th", {
396
+ /* @__PURE__ */ p("th", {
397
397
  className: "text-left px-4 py-3 text-xs font-medium uppercase tracking-wide text-text-muted hidden lg:table-cell",
398
398
  children: "Valid From"
399
399
  }),
400
- /* @__PURE__ */ d("th", {
400
+ /* @__PURE__ */ p("th", {
401
401
  className: "text-left px-4 py-3 text-xs font-medium uppercase tracking-wide text-text-muted hidden sm:table-cell",
402
402
  children: "Valid Until"
403
403
  }),
404
- /* @__PURE__ */ d("th", {
404
+ /* @__PURE__ */ p("th", {
405
405
  className: "text-left px-4 py-3 text-xs font-medium uppercase tracking-wide text-text-muted",
406
406
  children: "Status"
407
407
  }),
408
- /* @__PURE__ */ d("th", {
408
+ /* @__PURE__ */ p("th", {
409
409
  className: "text-right px-4 py-3 text-xs font-medium uppercase tracking-wide text-text-muted",
410
410
  children: "Actions"
411
411
  })
412
412
  ] })
413
- }), /* @__PURE__ */ d("tbody", {
413
+ }), /* @__PURE__ */ p("tbody", {
414
414
  className: "divide-y divide-border-subtle",
415
- children: W.map((e) => /* @__PURE__ */ d(y, {
415
+ children: W.map((e) => /* @__PURE__ */ p(y, {
416
416
  discount: e,
417
417
  selected: z.has(e.id),
418
418
  onToggleSelect: ue,
@@ -423,27 +423,27 @@ var _ = {
423
423
  })
424
424
  })
425
425
  }),
426
- j.kind === "create" && /* @__PURE__ */ d(b, {
426
+ j.kind === "create" && /* @__PURE__ */ p(b, {
427
427
  onClose: Z,
428
- children: /* @__PURE__ */ f("form", {
428
+ children: /* @__PURE__ */ m("form", {
429
429
  onSubmit: Q,
430
430
  className: "space-y-4",
431
431
  children: [
432
- /* @__PURE__ */ f("div", {
432
+ /* @__PURE__ */ m("div", {
433
433
  className: "flex items-center justify-between mb-2",
434
- children: [/* @__PURE__ */ d("h2", {
434
+ children: [/* @__PURE__ */ p("h2", {
435
435
  className: "text-lg font-semibold text-text-primary",
436
436
  children: s("billing.discounts.createDiscountCode", "Create Discount Code")
437
- }), /* @__PURE__ */ d("button", {
437
+ }), /* @__PURE__ */ p("button", {
438
438
  type: "button",
439
439
  onClick: Z,
440
440
  className: "p-1.5 rounded hover:bg-bg-sunken transition-colors",
441
- children: /* @__PURE__ */ d("svg", {
441
+ children: /* @__PURE__ */ p("svg", {
442
442
  className: "size-5 text-text-muted",
443
443
  fill: "none",
444
444
  viewBox: "0 0 24 24",
445
445
  stroke: "currentColor",
446
- children: /* @__PURE__ */ d("path", {
446
+ children: /* @__PURE__ */ p("path", {
447
447
  strokeLinecap: "round",
448
448
  strokeLinejoin: "round",
449
449
  strokeWidth: 2,
@@ -452,22 +452,22 @@ var _ = {
452
452
  })
453
453
  })]
454
454
  }),
455
- L && /* @__PURE__ */ d("div", {
455
+ L && /* @__PURE__ */ p("div", {
456
456
  className: "p-3 text-sm text-status-error-text bg-status-error-bg-subtle border border-status-error-border rounded-md",
457
457
  children: L
458
458
  }),
459
- /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ f("label", {
459
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ m("label", {
460
460
  htmlFor: "create-code",
461
461
  className: "block text-sm font-medium text-text-primary mb-1",
462
462
  children: [
463
463
  s("billing.discounts.code", "Code"),
464
464
  " ",
465
- /* @__PURE__ */ d("span", {
465
+ /* @__PURE__ */ p("span", {
466
466
  className: "text-status-error-text",
467
467
  children: "*"
468
468
  })
469
469
  ]
470
- }), /* @__PURE__ */ d("input", {
470
+ }), /* @__PURE__ */ p("input", {
471
471
  id: "create-code",
472
472
  type: "text",
473
473
  required: !0,
@@ -479,20 +479,20 @@ var _ = {
479
479
  placeholder: s("billing.discounts.codePlaceholder", "e.g. SUMMER25"),
480
480
  className: "w-full px-3 py-2 text-sm border border-border-subtle rounded-input bg-bg-surface text-text-primary placeholder:text-text-muted focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] focus:border-transparent uppercase"
481
481
  })] }),
482
- /* @__PURE__ */ f("div", {
482
+ /* @__PURE__ */ m("div", {
483
483
  className: "grid grid-cols-2 gap-4",
484
- children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ f("label", {
484
+ children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ m("label", {
485
485
  htmlFor: "create-type",
486
486
  className: "block text-sm font-medium text-text-primary mb-1",
487
487
  children: [
488
488
  s("billing.discounts.type", "Type"),
489
489
  " ",
490
- /* @__PURE__ */ d("span", {
490
+ /* @__PURE__ */ p("span", {
491
491
  className: "text-status-error-text",
492
492
  children: "*"
493
493
  })
494
494
  ]
495
- }), /* @__PURE__ */ f("select", {
495
+ }), /* @__PURE__ */ m("select", {
496
496
  id: "create-type",
497
497
  value: N.type,
498
498
  onChange: (e) => P((t) => ({
@@ -500,27 +500,27 @@ var _ = {
500
500
  type: e.target.value
501
501
  })),
502
502
  className: "w-full px-3 py-2 text-sm border border-border-subtle rounded-input bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] focus:border-transparent scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
503
- children: [/* @__PURE__ */ d("option", {
503
+ children: [/* @__PURE__ */ p("option", {
504
504
  value: "PERCENTAGE",
505
505
  children: s("billing.discounts.typePercentage", "Percentage")
506
- }), /* @__PURE__ */ d("option", {
506
+ }), /* @__PURE__ */ p("option", {
507
507
  value: "FIXED",
508
508
  children: s("billing.discounts.typeFixedAmount", "Fixed Amount")
509
509
  })]
510
- })] }), /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ f("label", {
510
+ })] }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ m("label", {
511
511
  htmlFor: "create-value",
512
512
  className: "block text-sm font-medium text-text-primary mb-1",
513
513
  children: [
514
514
  s("billing.discounts.value", "Value"),
515
515
  " ",
516
- /* @__PURE__ */ d("span", {
516
+ /* @__PURE__ */ p("span", {
517
517
  className: "text-status-error-text",
518
518
  children: "*"
519
519
  })
520
520
  ]
521
- }), /* @__PURE__ */ f("div", {
521
+ }), /* @__PURE__ */ m("div", {
522
522
  className: "relative",
523
- children: [/* @__PURE__ */ d("input", {
523
+ children: [/* @__PURE__ */ p("input", {
524
524
  id: "create-value",
525
525
  type: "number",
526
526
  required: !0,
@@ -534,17 +534,17 @@ var _ = {
534
534
  })),
535
535
  placeholder: N.type === "PERCENTAGE" ? "10" : "25.00",
536
536
  className: "w-full px-3 py-2 pr-8 text-sm border border-border-subtle rounded-input bg-bg-surface text-text-primary placeholder:text-text-muted focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] focus:border-transparent"
537
- }), /* @__PURE__ */ d("span", {
537
+ }), /* @__PURE__ */ p("span", {
538
538
  className: "absolute right-3 top-1/2 -translate-y-1/2 text-sm text-text-muted",
539
539
  children: N.type === "PERCENTAGE" ? "%" : N.currency
540
540
  })]
541
541
  })] })]
542
542
  }),
543
- N.type === "FIXED" && /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("label", {
543
+ N.type === "FIXED" && /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
544
544
  htmlFor: "create-currency",
545
545
  className: "block text-sm font-medium text-text-primary mb-1",
546
546
  children: s("billing.discounts.currency", "Currency")
547
- }), /* @__PURE__ */ f("select", {
547
+ }), /* @__PURE__ */ m("select", {
548
548
  id: "create-currency",
549
549
  value: N.currency,
550
550
  onChange: (e) => P((t) => ({
@@ -553,39 +553,39 @@ var _ = {
553
553
  })),
554
554
  className: "w-full px-3 py-2 text-sm border border-border-subtle rounded-input bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] focus:border-transparent scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
555
555
  children: [
556
- /* @__PURE__ */ d("option", {
556
+ /* @__PURE__ */ p("option", {
557
557
  value: "USD",
558
558
  children: "USD"
559
559
  }),
560
- /* @__PURE__ */ d("option", {
560
+ /* @__PURE__ */ p("option", {
561
561
  value: "EUR",
562
562
  children: "EUR"
563
563
  }),
564
- /* @__PURE__ */ d("option", {
564
+ /* @__PURE__ */ p("option", {
565
565
  value: "GBP",
566
566
  children: "GBP"
567
567
  }),
568
- /* @__PURE__ */ d("option", {
568
+ /* @__PURE__ */ p("option", {
569
569
  value: "INR",
570
570
  children: "INR"
571
571
  }),
572
- /* @__PURE__ */ d("option", {
572
+ /* @__PURE__ */ p("option", {
573
573
  value: "CAD",
574
574
  children: "CAD"
575
575
  }),
576
- /* @__PURE__ */ d("option", {
576
+ /* @__PURE__ */ p("option", {
577
577
  value: "AUD",
578
578
  children: "AUD"
579
579
  })
580
580
  ]
581
581
  })] }),
582
- /* @__PURE__ */ f("div", { children: [
583
- /* @__PURE__ */ d("label", {
582
+ /* @__PURE__ */ m("div", { children: [
583
+ /* @__PURE__ */ p("label", {
584
584
  htmlFor: "create-max-uses",
585
585
  className: "block text-sm font-medium text-text-primary mb-1",
586
586
  children: s("billing.discounts.maxUses", "Max Uses")
587
587
  }),
588
- /* @__PURE__ */ d("input", {
588
+ /* @__PURE__ */ p("input", {
589
589
  id: "create-max-uses",
590
590
  type: "number",
591
591
  min: "1",
@@ -598,18 +598,18 @@ var _ = {
598
598
  placeholder: s("billing.discounts.unlimited", "Unlimited"),
599
599
  className: "w-full px-3 py-2 text-sm border border-border-subtle rounded-input bg-bg-surface text-text-primary placeholder:text-text-muted focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] focus:border-transparent"
600
600
  }),
601
- /* @__PURE__ */ d("p", {
601
+ /* @__PURE__ */ p("p", {
602
602
  className: "text-xs text-text-muted mt-1",
603
603
  children: s("billing.discounts.unlimitedHelp", "Leave empty for unlimited uses.")
604
604
  })
605
605
  ] }),
606
- /* @__PURE__ */ f("div", {
606
+ /* @__PURE__ */ m("div", {
607
607
  className: "grid grid-cols-2 gap-4",
608
- children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("label", {
608
+ children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
609
609
  htmlFor: "create-valid-from",
610
610
  className: "block text-sm font-medium text-text-primary mb-1",
611
611
  children: s("billing.discounts.validFrom", "Valid From")
612
- }), /* @__PURE__ */ d("input", {
612
+ }), /* @__PURE__ */ p("input", {
613
613
  id: "create-valid-from",
614
614
  type: "datetime-local",
615
615
  value: N.validFrom,
@@ -618,11 +618,11 @@ var _ = {
618
618
  validFrom: e.target.value
619
619
  })),
620
620
  className: "w-full px-3 py-2 text-sm border border-border-subtle rounded-input bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] focus:border-transparent"
621
- })] }), /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("label", {
621
+ })] }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
622
622
  htmlFor: "create-valid-until",
623
623
  className: "block text-sm font-medium text-text-primary mb-1",
624
624
  children: s("billing.discounts.validUntil", "Valid Until")
625
- }), /* @__PURE__ */ d("input", {
625
+ }), /* @__PURE__ */ p("input", {
626
626
  id: "create-valid-until",
627
627
  type: "datetime-local",
628
628
  value: N.validUntil,
@@ -633,14 +633,14 @@ var _ = {
633
633
  className: "w-full px-3 py-2 text-sm border border-border-subtle rounded-input bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] focus:border-transparent"
634
634
  })] })]
635
635
  }),
636
- /* @__PURE__ */ f("div", {
636
+ /* @__PURE__ */ m("div", {
637
637
  className: "flex items-center justify-end gap-3 pt-2 border-t border-border-subtle",
638
- children: [/* @__PURE__ */ d("button", {
638
+ children: [/* @__PURE__ */ p("button", {
639
639
  type: "button",
640
640
  onClick: Z,
641
641
  className: "px-4 py-2 text-sm font-medium border border-border-subtle text-text-primary rounded-button hover:bg-bg-sunken transition-colors",
642
642
  children: s("billing.discounts.cancel", "Cancel")
643
- }), /* @__PURE__ */ d("button", {
643
+ }), /* @__PURE__ */ p("button", {
644
644
  type: "submit",
645
645
  disabled: w,
646
646
  className: "px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
@@ -650,27 +650,27 @@ var _ = {
650
650
  ]
651
651
  })
652
652
  }),
653
- j.kind === "edit" && /* @__PURE__ */ d(b, {
653
+ j.kind === "edit" && /* @__PURE__ */ p(b, {
654
654
  onClose: Z,
655
- children: /* @__PURE__ */ f("form", {
655
+ children: /* @__PURE__ */ m("form", {
656
656
  onSubmit: se,
657
657
  className: "space-y-4",
658
658
  children: [
659
- /* @__PURE__ */ f("div", {
659
+ /* @__PURE__ */ m("div", {
660
660
  className: "flex items-center justify-between mb-2",
661
- children: [/* @__PURE__ */ d("h2", {
661
+ children: [/* @__PURE__ */ p("h2", {
662
662
  className: "text-lg font-semibold text-text-primary",
663
663
  children: "Edit Discount"
664
- }), /* @__PURE__ */ d("button", {
664
+ }), /* @__PURE__ */ p("button", {
665
665
  type: "button",
666
666
  onClick: Z,
667
667
  className: "p-1.5 rounded hover:bg-bg-sunken transition-colors",
668
- children: /* @__PURE__ */ d("svg", {
668
+ children: /* @__PURE__ */ p("svg", {
669
669
  className: "size-5 text-text-muted",
670
670
  fill: "none",
671
671
  viewBox: "0 0 24 24",
672
672
  stroke: "currentColor",
673
- children: /* @__PURE__ */ d("path", {
673
+ children: /* @__PURE__ */ p("path", {
674
674
  strokeLinecap: "round",
675
675
  strokeLinejoin: "round",
676
676
  strokeWidth: 2,
@@ -679,62 +679,62 @@ var _ = {
679
679
  })
680
680
  })]
681
681
  }),
682
- L && /* @__PURE__ */ d("div", {
682
+ L && /* @__PURE__ */ p("div", {
683
683
  className: "p-3 text-sm text-status-error-text bg-status-error-bg-subtle border border-status-error-border rounded-md",
684
684
  children: L
685
685
  }),
686
- /* @__PURE__ */ f("div", {
686
+ /* @__PURE__ */ m("div", {
687
687
  className: "p-3 bg-bg-sunken/50 border border-border-subtle rounded-md space-y-1",
688
688
  children: [
689
- /* @__PURE__ */ f("div", {
689
+ /* @__PURE__ */ m("div", {
690
690
  className: "flex items-center justify-between text-sm",
691
- children: [/* @__PURE__ */ d("span", {
691
+ children: [/* @__PURE__ */ p("span", {
692
692
  className: "text-text-muted",
693
693
  children: "Code"
694
- }), /* @__PURE__ */ d("span", {
694
+ }), /* @__PURE__ */ p("span", {
695
695
  className: "font-mono font-medium text-text-primary",
696
696
  children: j.discount.code
697
697
  })]
698
698
  }),
699
- /* @__PURE__ */ f("div", {
699
+ /* @__PURE__ */ m("div", {
700
700
  className: "flex items-center justify-between text-sm",
701
- children: [/* @__PURE__ */ d("span", {
701
+ children: [/* @__PURE__ */ p("span", {
702
702
  className: "text-text-muted",
703
703
  children: "Type"
704
- }), /* @__PURE__ */ d("span", {
704
+ }), /* @__PURE__ */ p("span", {
705
705
  className: "text-text-primary",
706
706
  children: j.discount.type === "PERCENTAGE" ? "Percentage" : "Fixed Amount"
707
707
  })]
708
708
  }),
709
- /* @__PURE__ */ f("div", {
709
+ /* @__PURE__ */ m("div", {
710
710
  className: "flex items-center justify-between text-sm",
711
- children: [/* @__PURE__ */ d("span", {
711
+ children: [/* @__PURE__ */ p("span", {
712
712
  className: "text-text-muted",
713
713
  children: "Value"
714
- }), /* @__PURE__ */ d("span", {
714
+ }), /* @__PURE__ */ p("span", {
715
715
  className: "text-text-primary",
716
716
  children: g(j.discount)
717
717
  })]
718
718
  }),
719
- /* @__PURE__ */ f("div", {
719
+ /* @__PURE__ */ m("div", {
720
720
  className: "flex items-center justify-between text-sm",
721
- children: [/* @__PURE__ */ d("span", {
721
+ children: [/* @__PURE__ */ p("span", {
722
722
  className: "text-text-muted",
723
723
  children: "Used"
724
- }), /* @__PURE__ */ f("span", {
724
+ }), /* @__PURE__ */ m("span", {
725
725
  className: "text-text-primary",
726
726
  children: [j.discount.usedCount, " times"]
727
727
  })]
728
728
  })
729
729
  ]
730
730
  }),
731
- /* @__PURE__ */ f("div", { children: [
732
- /* @__PURE__ */ d("label", {
731
+ /* @__PURE__ */ m("div", { children: [
732
+ /* @__PURE__ */ p("label", {
733
733
  htmlFor: "edit-max-uses",
734
734
  className: "block text-sm font-medium text-text-primary mb-1",
735
735
  children: "Max Uses"
736
736
  }),
737
- /* @__PURE__ */ d("input", {
737
+ /* @__PURE__ */ p("input", {
738
738
  id: "edit-max-uses",
739
739
  type: "number",
740
740
  min: "1",
@@ -747,16 +747,16 @@ var _ = {
747
747
  placeholder: "Unlimited",
748
748
  className: "w-full px-3 py-2 text-sm border border-border-subtle rounded-input bg-bg-surface text-text-primary placeholder:text-text-muted focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] focus:border-transparent"
749
749
  }),
750
- /* @__PURE__ */ d("p", {
750
+ /* @__PURE__ */ p("p", {
751
751
  className: "text-xs text-text-muted mt-1",
752
752
  children: "Leave empty for unlimited uses."
753
753
  })
754
754
  ] }),
755
- /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("label", {
755
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
756
756
  htmlFor: "edit-valid-until",
757
757
  className: "block text-sm font-medium text-text-primary mb-1",
758
758
  children: "Valid Until"
759
- }), /* @__PURE__ */ d("input", {
759
+ }), /* @__PURE__ */ p("input", {
760
760
  id: "edit-valid-until",
761
761
  type: "datetime-local",
762
762
  value: F.validUntil,
@@ -766,14 +766,14 @@ var _ = {
766
766
  })),
767
767
  className: "w-full px-3 py-2 text-sm border border-border-subtle rounded-input bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] focus:border-transparent"
768
768
  })] }),
769
- /* @__PURE__ */ f("div", {
769
+ /* @__PURE__ */ m("div", {
770
770
  className: "flex items-center justify-end gap-3 pt-2 border-t border-border-subtle",
771
- children: [/* @__PURE__ */ d("button", {
771
+ children: [/* @__PURE__ */ p("button", {
772
772
  type: "button",
773
773
  onClick: Z,
774
774
  className: "px-4 py-2 text-sm font-medium border border-border-subtle text-text-primary rounded-button hover:bg-bg-sunken transition-colors",
775
775
  children: "Cancel"
776
- }), /* @__PURE__ */ d("button", {
776
+ }), /* @__PURE__ */ p("button", {
777
777
  type: "submit",
778
778
  disabled: E,
779
779
  className: "px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
@@ -783,26 +783,26 @@ var _ = {
783
783
  ]
784
784
  })
785
785
  }),
786
- j.kind === "delete" && /* @__PURE__ */ d(b, {
786
+ j.kind === "delete" && /* @__PURE__ */ p(b, {
787
787
  onClose: Z,
788
- children: /* @__PURE__ */ f("div", {
788
+ children: /* @__PURE__ */ m("div", {
789
789
  className: "space-y-4",
790
790
  children: [
791
- /* @__PURE__ */ f("div", {
791
+ /* @__PURE__ */ m("div", {
792
792
  className: "flex items-center justify-between mb-2",
793
- children: [/* @__PURE__ */ d("h2", {
793
+ children: [/* @__PURE__ */ p("h2", {
794
794
  className: "text-lg font-semibold text-text-primary",
795
795
  children: "Delete Discount"
796
- }), /* @__PURE__ */ d("button", {
796
+ }), /* @__PURE__ */ p("button", {
797
797
  type: "button",
798
798
  onClick: Z,
799
799
  className: "p-1.5 rounded hover:bg-bg-sunken transition-colors",
800
- children: /* @__PURE__ */ d("svg", {
800
+ children: /* @__PURE__ */ p("svg", {
801
801
  className: "size-5 text-text-muted",
802
802
  fill: "none",
803
803
  viewBox: "0 0 24 24",
804
804
  stroke: "currentColor",
805
- children: /* @__PURE__ */ d("path", {
805
+ children: /* @__PURE__ */ p("path", {
806
806
  strokeLinecap: "round",
807
807
  strokeLinejoin: "round",
808
808
  strokeWidth: 2,
@@ -811,43 +811,43 @@ var _ = {
811
811
  })
812
812
  })]
813
813
  }),
814
- L && /* @__PURE__ */ d("div", {
814
+ L && /* @__PURE__ */ p("div", {
815
815
  className: "p-3 text-sm text-status-error-text bg-status-error-bg-subtle border border-status-error-border rounded-md",
816
816
  children: L
817
817
  }),
818
- /* @__PURE__ */ f("div", {
818
+ /* @__PURE__ */ m("div", {
819
819
  className: "flex items-start gap-3",
820
- children: [/* @__PURE__ */ d("div", {
820
+ children: [/* @__PURE__ */ p("div", {
821
821
  className: "size-10 rounded-full bg-status-error-bg-subtle flex items-center justify-center shrink-0",
822
- children: /* @__PURE__ */ d("svg", {
822
+ children: /* @__PURE__ */ p("svg", {
823
823
  className: "size-5 text-status-error-text",
824
824
  fill: "none",
825
825
  viewBox: "0 0 24 24",
826
826
  stroke: "currentColor",
827
- children: /* @__PURE__ */ d("path", {
827
+ children: /* @__PURE__ */ p("path", {
828
828
  strokeLinecap: "round",
829
829
  strokeLinejoin: "round",
830
830
  strokeWidth: 2,
831
831
  d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"
832
832
  })
833
833
  })
834
- }), /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ f("p", {
834
+ }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ m("p", {
835
835
  className: "text-sm text-text-primary",
836
836
  children: [
837
837
  "Are you sure you want to delete the discount code",
838
838
  " ",
839
- /* @__PURE__ */ d("span", {
839
+ /* @__PURE__ */ p("span", {
840
840
  className: "font-mono font-semibold",
841
841
  children: j.discount.code
842
842
  }),
843
843
  "?"
844
844
  ]
845
- }), /* @__PURE__ */ f("p", {
845
+ }), /* @__PURE__ */ m("p", {
846
846
  className: "text-sm text-text-muted mt-1",
847
847
  children: [
848
848
  "This action cannot be undone. The discount has been used",
849
849
  " ",
850
- /* @__PURE__ */ d("span", {
850
+ /* @__PURE__ */ p("span", {
851
851
  className: "font-medium",
852
852
  children: j.discount.usedCount
853
853
  }),
@@ -857,14 +857,14 @@ var _ = {
857
857
  ]
858
858
  })] })]
859
859
  }),
860
- /* @__PURE__ */ f("div", {
860
+ /* @__PURE__ */ m("div", {
861
861
  className: "flex items-center justify-end gap-3 pt-2 border-t border-border-subtle",
862
- children: [/* @__PURE__ */ d("button", {
862
+ children: [/* @__PURE__ */ p("button", {
863
863
  type: "button",
864
864
  onClick: Z,
865
865
  className: "px-4 py-2 text-sm font-medium border border-border-subtle text-text-primary rounded-button hover:bg-bg-sunken transition-colors",
866
866
  children: "Cancel"
867
- }), /* @__PURE__ */ d("button", {
867
+ }), /* @__PURE__ */ p("button", {
868
868
  type: "button",
869
869
  onClick: ce,
870
870
  disabled: O,
@@ -879,12 +879,12 @@ var _ = {
879
879
  });
880
880
  }, y = ({ discount: e, selected: t, onToggleSelect: n, onEdit: r, onDelete: i }) => {
881
881
  let a = h(e);
882
- return /* @__PURE__ */ f("tr", {
882
+ return /* @__PURE__ */ m("tr", {
883
883
  className: `hover:bg-bg-sunken/30 transition-colors ${t ? "bg-bg-sunken/20" : ""}`,
884
884
  children: [
885
- /* @__PURE__ */ d("td", {
885
+ /* @__PURE__ */ p("td", {
886
886
  className: "p-4",
887
- children: /* @__PURE__ */ d("input", {
887
+ children: /* @__PURE__ */ p("input", {
888
888
  type: "checkbox",
889
889
  checked: t,
890
890
  onChange: (t) => n(e.id, t.target.checked),
@@ -892,84 +892,84 @@ var _ = {
892
892
  className: "size-4 rounded border-border-subtle text-text-link"
893
893
  })
894
894
  }),
895
- /* @__PURE__ */ d("td", {
895
+ /* @__PURE__ */ p("td", {
896
896
  className: "p-4",
897
- children: /* @__PURE__ */ d("span", {
897
+ children: /* @__PURE__ */ p("span", {
898
898
  className: "font-mono font-medium text-text-primary",
899
899
  children: e.code
900
900
  })
901
901
  }),
902
- /* @__PURE__ */ d("td", {
902
+ /* @__PURE__ */ p("td", {
903
903
  className: "p-4",
904
- children: /* @__PURE__ */ d("span", {
904
+ children: /* @__PURE__ */ p("span", {
905
905
  className: "text-sm text-text-muted",
906
906
  children: e.type === "PERCENTAGE" ? "Percentage" : "Fixed"
907
907
  })
908
908
  }),
909
- /* @__PURE__ */ d("td", {
909
+ /* @__PURE__ */ p("td", {
910
910
  className: "p-4",
911
- children: /* @__PURE__ */ d("span", {
911
+ children: /* @__PURE__ */ p("span", {
912
912
  className: "text-sm font-medium text-text-primary",
913
913
  children: g(e)
914
914
  })
915
915
  }),
916
- /* @__PURE__ */ d("td", {
916
+ /* @__PURE__ */ p("td", {
917
917
  className: "p-4 hidden md:table-cell",
918
- children: /* @__PURE__ */ f("span", {
918
+ children: /* @__PURE__ */ m("span", {
919
919
  className: "text-sm text-text-muted",
920
920
  children: [e.usedCount, e.maxUses == null ? " / ∞" : ` / ${e.maxUses}`]
921
921
  })
922
922
  }),
923
- /* @__PURE__ */ d("td", {
923
+ /* @__PURE__ */ p("td", {
924
924
  className: "p-4 text-sm text-text-muted hidden lg:table-cell",
925
925
  children: e.validFrom ? s(e.validFrom, "short") : "—"
926
926
  }),
927
- /* @__PURE__ */ d("td", {
927
+ /* @__PURE__ */ p("td", {
928
928
  className: "p-4 text-sm text-text-muted hidden sm:table-cell",
929
929
  children: e.validUntil ? s(e.validUntil, "short") : "—"
930
930
  }),
931
- /* @__PURE__ */ d("td", {
931
+ /* @__PURE__ */ p("td", {
932
932
  className: "p-4",
933
- children: a ? /* @__PURE__ */ d("span", {
933
+ children: a ? /* @__PURE__ */ p("span", {
934
934
  className: "inline-flex px-2 py-1 text-xs font-medium rounded bg-status-warning-bg-subtle text-status-warning-text",
935
935
  children: "Expired"
936
- }) : /* @__PURE__ */ d("span", {
936
+ }) : /* @__PURE__ */ p("span", {
937
937
  className: "inline-flex px-2 py-1 text-xs font-medium rounded bg-status-success-bg-subtle text-status-success-text",
938
938
  children: "Active"
939
939
  })
940
940
  }),
941
- /* @__PURE__ */ d("td", {
941
+ /* @__PURE__ */ p("td", {
942
942
  className: "p-4 text-right",
943
- children: /* @__PURE__ */ f("div", {
943
+ children: /* @__PURE__ */ m("div", {
944
944
  className: "flex items-center justify-end gap-2",
945
- children: [/* @__PURE__ */ d("button", {
945
+ children: [/* @__PURE__ */ p("button", {
946
946
  type: "button",
947
947
  onClick: () => r(e),
948
948
  className: "px-3 py-1.5 text-sm font-medium text-text-primary hover:bg-bg-sunken rounded-button transition-colors",
949
949
  title: "Edit discount",
950
- children: /* @__PURE__ */ d("svg", {
950
+ children: /* @__PURE__ */ p("svg", {
951
951
  className: "size-4",
952
952
  fill: "none",
953
953
  viewBox: "0 0 24 24",
954
954
  stroke: "currentColor",
955
- children: /* @__PURE__ */ d("path", {
955
+ children: /* @__PURE__ */ p("path", {
956
956
  strokeLinecap: "round",
957
957
  strokeLinejoin: "round",
958
958
  strokeWidth: 2,
959
959
  d: "M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"
960
960
  })
961
961
  })
962
- }), /* @__PURE__ */ d("button", {
962
+ }), /* @__PURE__ */ p("button", {
963
963
  type: "button",
964
964
  onClick: () => i(e),
965
965
  className: "px-3 py-1.5 text-sm font-medium text-status-error-text hover:bg-status-error-bg-subtle rounded-md transition-colors",
966
966
  title: "Delete discount",
967
- children: /* @__PURE__ */ d("svg", {
967
+ children: /* @__PURE__ */ p("svg", {
968
968
  className: "size-4",
969
969
  fill: "none",
970
970
  viewBox: "0 0 24 24",
971
971
  stroke: "currentColor",
972
- children: /* @__PURE__ */ d("path", {
972
+ children: /* @__PURE__ */ p("path", {
973
973
  strokeLinecap: "round",
974
974
  strokeLinejoin: "round",
975
975
  strokeWidth: 2,
@@ -981,12 +981,12 @@ var _ = {
981
981
  })
982
982
  ]
983
983
  });
984
- }, b = ({ onClose: e, children: t }) => /* @__PURE__ */ f("div", {
984
+ }, b = ({ onClose: e, children: t }) => /* @__PURE__ */ m("div", {
985
985
  className: "fixed inset-0 z-50 flex items-center justify-center",
986
- children: [/* @__PURE__ */ d("div", {
986
+ children: [/* @__PURE__ */ p("div", {
987
987
  className: "absolute inset-0 bg-bg-overlay",
988
988
  onClick: e
989
- }), /* @__PURE__ */ d("div", {
989
+ }), /* @__PURE__ */ p("div", {
990
990
  className: "relative w-full max-w-lg max-h-[85vh] overflow-y-auto bg-bg-elevated border border-border-seam rounded-card shadow-[var(--shadow-elevation-4)] p-6 mx-4",
991
991
  children: t
992
992
  })]