@burdenoff/microfe-billing 2026.1116.1 → 2026.1119.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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
@@ -5,12 +5,12 @@ import { useBillingPermissions as r } from "../../../hooks/useBillingPermissions
5
5
  import "../../../shared/components/index.js";
6
6
  import { useCreateCouponMutation as i } from "../../../../generated/global-operations.js";
7
7
  import { useRef as a, useState as o } from "react";
8
- import { PagePurpose as s } from "@burdenoff/fe-libs/ui";
9
- import { ArrowLeft as c, Package as l, Percent as u, Save as d, Tag as f, Users as p, X as m } from "lucide-react";
10
- import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
11
- import { useI18n as v } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
8
+ import { PagePurpose as s, ThemedSelect as c } from "@burdenoff/fe-libs/ui";
9
+ import { ArrowLeft as l, Package as u, Percent as d, Save as f, Tag as p, Users as m, X as h } from "lucide-react";
10
+ import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
11
+ import { useI18n as y } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
12
12
  // src/billing/modules/coupons/pages/CreateCouponPage.tsx
13
- var y = [
13
+ var b = [
14
14
  {
15
15
  code: "USD",
16
16
  symbol: "$",
@@ -86,7 +86,7 @@ var y = [
86
86
  symbol: "₩",
87
87
  name: "South Korean Won"
88
88
  }
89
- ], b = /* @__PURE__ */ "workspaces.bigconsole.botlit.fluidgrids.vibecontrols.healthybowl.adaptercloud.atheletebridge.coolandlovely.hookmovies.labsofscience.subscriberbot.artistrybase.assethandler.brainyrich.buildmyiq.collabkin.comradecircle.cosmicintersection.crewfoundry.ecoimpacthub.eventfullymanaged.ggnomad.govcitizenhub.headshotmarketing.housingvista.intelwatchtower.kadaikodi.manufacturedops.movethewheels.mybodyshield.planmagnet.proserviceworld.semanticfed.technospam.theculturepost.theglobalfuel.timecampus".split("."), x = [
89
+ ], x = /* @__PURE__ */ "workspaces.bigconsole.botlit.fluidgrids.vibecontrols.healthybowl.adaptercloud.atheletebridge.coolandlovely.hookmovies.labsofscience.subscriberbot.artistrybase.assethandler.brainyrich.buildmyiq.collabkin.comradecircle.cosmicintersection.crewfoundry.ecoimpacthub.eventfullymanaged.ggnomad.govcitizenhub.headshotmarketing.housingvista.intelwatchtower.kadaikodi.manufacturedops.movethewheels.mybodyshield.planmagnet.proserviceworld.semanticfed.technospam.theculturepost.theglobalfuel.timecampus".split("."), S = [
90
90
  {
91
91
  value: "PLAN",
92
92
  label: "Plan purchases"
@@ -99,11 +99,11 @@ var y = [
99
99
  value: "STORE",
100
100
  label: "Store purchases"
101
101
  }
102
- ], S = () => {
103
- let { t: S } = v(), C = (e, t) => {
104
- let n = S(e);
102
+ ], C = () => {
103
+ let { t: C } = y(), w = (e, t) => {
104
+ let n = C(e);
105
105
  return n === e ? t : n;
106
- }, w = n(), T = r(), [E, D] = o(""), O = a(null), [k, A] = o({
106
+ }, T = n(), E = r(), [D, O] = o(""), k = a(null), [A, j] = o({
107
107
  code: "",
108
108
  name: "",
109
109
  description: "",
@@ -123,161 +123,161 @@ var y = [
123
123
  applicableProductIds: [],
124
124
  applicableEntityTypes: [],
125
125
  campaignName: ""
126
- }), [j, M] = o({}), [N, P] = o(!1), F = y.find((e) => e.code === k.currency)?.symbol ?? k.currency, [I] = i({ refetchQueries: ["ListCoupons"] });
127
- if (!T.canManageDiscounts) return /* @__PURE__ */ g(e, { message: "You don't have permission to create coupons." });
128
- let L = (e, t) => {
129
- A((n) => ({
126
+ }), [M, N] = o({}), [P, F] = o(!1), I = b.find((e) => e.code === A.currency)?.symbol ?? A.currency, [L] = i({ refetchQueries: ["ListCoupons"] });
127
+ if (!E.canManageDiscounts) return /* @__PURE__ */ _(e, { message: "You don't have permission to create coupons." });
128
+ let R = (e, t) => {
129
+ j((n) => ({
130
130
  ...n,
131
131
  [e]: t
132
- })), j[e] && M((t) => {
132
+ })), M[e] && N((t) => {
133
133
  let n = { ...t };
134
134
  return delete n[e], n;
135
135
  });
136
- }, R = () => {
136
+ }, z = () => {
137
137
  let e = {};
138
- return k.code.trim() ? /^[A-Z0-9-_]+$/.test(k.code) ? k.code.length < 3 ? e.code = "Code must be at least 3 characters" : k.code.length > 50 && (e.code = "Code must be at most 50 characters") : e.code = "Code must contain only uppercase letters, numbers, hyphens, and underscores" : e.code = "Coupon code is required", k.name.trim() || (e.name = "Coupon name is required"), k.value <= 0 && (e.value = "Value must be greater than 0"), k.type === "PERCENTAGE" && k.value > 100 && (e.value = "Percentage cannot exceed 100%"), k.scope === "USER_SPECIFIC" && k.restrictedToUserIds.length === 0 && (e.restrictedToUserIds = "Add at least one user email or ID"), k.validFrom || (e.validFrom = "Start date is required"), k.validUntil && k.validUntil < k.validFrom && (e.validUntil = "End date must be after start date"), M(e), Object.keys(e).length === 0;
139
- }, z = (e) => {
140
- let t = e.trim();
141
- t && (k.restrictedToUserIds.includes(t) || L("restrictedToUserIds", [...k.restrictedToUserIds, t]), D(""));
138
+ return A.code.trim() ? /^[A-Z0-9-_]+$/.test(A.code) ? A.code.length < 3 ? e.code = "Code must be at least 3 characters" : A.code.length > 50 && (e.code = "Code must be at most 50 characters") : e.code = "Code must contain only uppercase letters, numbers, hyphens, and underscores" : e.code = "Coupon code is required", A.name.trim() || (e.name = "Coupon name is required"), A.value <= 0 && (e.value = "Value must be greater than 0"), A.type === "PERCENTAGE" && A.value > 100 && (e.value = "Percentage cannot exceed 100%"), A.scope === "USER_SPECIFIC" && A.restrictedToUserIds.length === 0 && (e.restrictedToUserIds = "Add at least one user email or ID"), A.validFrom || (e.validFrom = "Start date is required"), A.validUntil && A.validUntil < A.validFrom && (e.validUntil = "End date must be after start date"), N(e), Object.keys(e).length === 0;
142
139
  }, B = (e) => {
143
- L("restrictedToUserIds", k.restrictedToUserIds.filter((t) => t !== e));
140
+ let t = e.trim();
141
+ t && (A.restrictedToUserIds.includes(t) || R("restrictedToUserIds", [...A.restrictedToUserIds, t]), O(""));
144
142
  }, V = (e) => {
145
- L("applicableProductIds", k.applicableProductIds.includes(e) ? k.applicableProductIds.filter((t) => t !== e) : [...k.applicableProductIds, e]);
143
+ R("restrictedToUserIds", A.restrictedToUserIds.filter((t) => t !== e));
146
144
  }, H = (e) => {
147
- L("applicableEntityTypes", k.applicableEntityTypes.includes(e) ? k.applicableEntityTypes.filter((t) => t !== e) : [...k.applicableEntityTypes, e]);
145
+ R("applicableProductIds", A.applicableProductIds.includes(e) ? A.applicableProductIds.filter((t) => t !== e) : [...A.applicableProductIds, e]);
146
+ }, U = (e) => {
147
+ R("applicableEntityTypes", A.applicableEntityTypes.includes(e) ? A.applicableEntityTypes.filter((t) => t !== e) : [...A.applicableEntityTypes, e]);
148
148
  };
149
- return /* @__PURE__ */ _("div", {
149
+ return /* @__PURE__ */ v("div", {
150
150
  className: "max-w-4xl mx-auto p-4 sm:p-6 space-y-6",
151
151
  children: [
152
- /* @__PURE__ */ _("div", {
152
+ /* @__PURE__ */ v("div", {
153
153
  className: "flex items-center gap-4",
154
- children: [/* @__PURE__ */ g("button", {
154
+ children: [/* @__PURE__ */ _("button", {
155
155
  type: "button",
156
- onClick: () => w("/coupons"),
156
+ onClick: () => T("/coupons"),
157
157
  className: "p-2 rounded-lg hover:bg-bg-sunken text-text-muted hover:text-text-primary",
158
- children: /* @__PURE__ */ g(c, { className: "size-5" })
159
- }), /* @__PURE__ */ g(t, {
160
- title: C("billing.coupons.createTitle", "Create Coupon"),
158
+ children: /* @__PURE__ */ _(l, { className: "size-5" })
159
+ }), /* @__PURE__ */ _(t, {
160
+ title: w("billing.coupons.createTitle", "Create Coupon"),
161
161
  description: "Create a new discount code or promotional offer",
162
- icon: /* @__PURE__ */ g(f, { className: "size-6" })
162
+ icon: /* @__PURE__ */ _(p, { className: "size-6" })
163
163
  })]
164
164
  }),
165
- /* @__PURE__ */ g(s, { children: C("billing.coupons.createPurpose", "Define a new discount code customers can redeem at checkout. Choose whether it takes a percentage or fixed amount off, set any usage limit and expiry, and pick which products it applies to.") }),
166
- /* @__PURE__ */ _("form", {
165
+ /* @__PURE__ */ _(s, { children: w("billing.coupons.createPurpose", "Define a new discount code customers can redeem at checkout. Choose whether it takes a percentage or fixed amount off, set any usage limit and expiry, and pick which products it applies to.") }),
166
+ /* @__PURE__ */ v("form", {
167
167
  onSubmit: async (e) => {
168
- if (e.preventDefault(), R()) {
169
- P(!0);
168
+ if (e.preventDefault(), z()) {
169
+ F(!0);
170
170
  try {
171
171
  let e = {
172
- code: k.code,
173
- name: k.name,
174
- description: k.description,
175
- scope: k.scope,
176
- type: k.type,
177
- value: k.value,
178
- currency: k.currency,
179
- minPurchaseAmount: k.minPurchaseAmount,
180
- maxDiscountAmount: k.maxDiscountAmount,
181
- maxTotalUses: k.maxTotalUses,
182
- maxUsesPerUser: k.maxUsesPerUser,
183
- validFrom: new Date(k.validFrom).toISOString(),
184
- validUntil: k.validUntil ? new Date(k.validUntil).toISOString() : void 0,
185
- restrictedToUserIds: k.restrictedToUserIds,
186
- applicableProducts: k.applicableProducts,
187
- applicableServices: k.applicableServices,
188
- applicableProductIds: k.applicableProductIds,
189
- applicableEntityTypes: k.applicableEntityTypes,
172
+ code: A.code,
173
+ name: A.name,
174
+ description: A.description,
175
+ scope: A.scope,
176
+ type: A.type,
177
+ value: A.value,
178
+ currency: A.currency,
179
+ minPurchaseAmount: A.minPurchaseAmount,
180
+ maxDiscountAmount: A.maxDiscountAmount,
181
+ maxTotalUses: A.maxTotalUses,
182
+ maxUsesPerUser: A.maxUsesPerUser,
183
+ validFrom: new Date(A.validFrom).toISOString(),
184
+ validUntil: A.validUntil ? new Date(A.validUntil).toISOString() : void 0,
185
+ restrictedToUserIds: A.restrictedToUserIds,
186
+ applicableProducts: A.applicableProducts,
187
+ applicableServices: A.applicableServices,
188
+ applicableProductIds: A.applicableProductIds,
189
+ applicableEntityTypes: A.applicableEntityTypes,
190
190
  excludedProducts: [],
191
191
  excludedServices: [],
192
- campaignName: k.campaignName || void 0
192
+ campaignName: A.campaignName || void 0
193
193
  };
194
- if ((await I({ variables: { input: e } })).data?.createCoupon) w("/coupons");
194
+ if ((await L({ variables: { input: e } })).data?.createCoupon) T("/coupons");
195
195
  else throw Error("Failed to create coupon");
196
196
  } catch (e) {
197
197
  console.error("Error creating coupon:", e);
198
198
  let t = e instanceof Error ? e.message : "Failed to create coupon. Please try again.";
199
- M({ code: t });
199
+ N({ code: t });
200
200
  } finally {
201
- P(!1);
201
+ F(!1);
202
202
  }
203
203
  }
204
204
  },
205
205
  className: "space-y-6",
206
206
  children: [
207
- /* @__PURE__ */ _("div", {
207
+ /* @__PURE__ */ v("div", {
208
208
  className: "bg-bg-surface border border-border-subtle rounded-lg p-6 space-y-4",
209
209
  children: [
210
- /* @__PURE__ */ g("h3", {
210
+ /* @__PURE__ */ _("h3", {
211
211
  className: "text-lg font-semibold text-text-primary",
212
212
  children: "Basic Information"
213
213
  }),
214
- /* @__PURE__ */ _("div", { children: [
215
- /* @__PURE__ */ g("label", {
214
+ /* @__PURE__ */ v("div", { children: [
215
+ /* @__PURE__ */ _("label", {
216
216
  className: "block text-sm font-medium text-text-primary mb-1",
217
217
  children: "Coupon Code *"
218
218
  }),
219
- /* @__PURE__ */ g("input", {
219
+ /* @__PURE__ */ _("input", {
220
220
  type: "text",
221
- value: k.code,
222
- onChange: (e) => L("code", e.target.value.toUpperCase()),
221
+ value: A.code,
222
+ onChange: (e) => R("code", e.target.value.toUpperCase()),
223
223
  placeholder: "e.g., WELCOME20",
224
- className: `w-full px-4 py-2 rounded-input border ${j.code ? "border-status-error-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)]`
224
+ className: `w-full px-4 py-2 rounded-input border ${M.code ? "border-status-error-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)]`
225
225
  }),
226
- j.code && /* @__PURE__ */ g("p", {
226
+ M.code && /* @__PURE__ */ _("p", {
227
227
  className: "text-sm text-status-error-text mt-1",
228
- children: j.code
228
+ children: M.code
229
229
  }),
230
- /* @__PURE__ */ g("p", {
230
+ /* @__PURE__ */ _("p", {
231
231
  className: "text-xs text-text-muted mt-1",
232
232
  children: "Use uppercase letters, numbers, hyphens, and underscores"
233
233
  })
234
234
  ] }),
235
- /* @__PURE__ */ _("div", { children: [
236
- /* @__PURE__ */ g("label", {
235
+ /* @__PURE__ */ v("div", { children: [
236
+ /* @__PURE__ */ _("label", {
237
237
  className: "block text-sm font-medium text-text-primary mb-1",
238
238
  children: "Display Name *"
239
239
  }),
240
- /* @__PURE__ */ g("input", {
240
+ /* @__PURE__ */ _("input", {
241
241
  type: "text",
242
- value: k.name,
243
- onChange: (e) => L("name", e.target.value),
242
+ value: A.name,
243
+ onChange: (e) => R("name", e.target.value),
244
244
  placeholder: "e.g., Welcome 20% Off",
245
- className: `w-full px-4 py-2 rounded-input border ${j.name ? "border-status-error-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)]`
245
+ className: `w-full px-4 py-2 rounded-input border ${M.name ? "border-status-error-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)]`
246
246
  }),
247
- j.name && /* @__PURE__ */ g("p", {
247
+ M.name && /* @__PURE__ */ _("p", {
248
248
  className: "text-sm text-status-error-text mt-1",
249
- children: j.name
249
+ children: M.name
250
250
  })
251
251
  ] }),
252
- /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
252
+ /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
253
253
  className: "block text-sm font-medium text-text-primary mb-1",
254
254
  children: "Description"
255
- }), /* @__PURE__ */ g("textarea", {
256
- value: k.description,
257
- onChange: (e) => L("description", e.target.value),
255
+ }), /* @__PURE__ */ _("textarea", {
256
+ value: A.description,
257
+ onChange: (e) => R("description", e.target.value),
258
258
  placeholder: "Optional description for internal use",
259
259
  rows: 3,
260
260
  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)]"
261
261
  })] })
262
262
  ]
263
263
  }),
264
- /* @__PURE__ */ _("div", {
264
+ /* @__PURE__ */ v("div", {
265
265
  className: "bg-bg-surface border border-border-subtle rounded-lg p-6 space-y-4",
266
266
  children: [
267
- /* @__PURE__ */ g("h3", {
267
+ /* @__PURE__ */ _("h3", {
268
268
  className: "text-lg font-semibold text-text-primary",
269
269
  children: "Discount Configuration"
270
270
  }),
271
- /* @__PURE__ */ _("div", { children: [
272
- /* @__PURE__ */ g("label", {
271
+ /* @__PURE__ */ v("div", { children: [
272
+ /* @__PURE__ */ _("label", {
273
273
  className: "block text-sm font-medium text-text-primary mb-1",
274
274
  children: "Coupon Currency *"
275
275
  }),
276
- /* @__PURE__ */ g("select", {
277
- value: k.currency,
278
- onChange: (e) => L("currency", e.target.value),
276
+ /* @__PURE__ */ _(c, {
277
+ value: A.currency,
278
+ onChange: (e) => R("currency", e.target.value),
279
279
  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",
280
- children: y.map(({ code: e, symbol: t, name: n }) => /* @__PURE__ */ _("option", {
280
+ children: b.map(({ code: e, symbol: t, name: n }) => /* @__PURE__ */ v("option", {
281
281
  value: e,
282
282
  children: [
283
283
  t,
@@ -288,380 +288,380 @@ var y = [
288
288
  ]
289
289
  }, e))
290
290
  }),
291
- /* @__PURE__ */ g("p", {
291
+ /* @__PURE__ */ _("p", {
292
292
  className: "text-xs text-text-muted mt-1",
293
293
  children: "Amounts below are in this currency. Users paying in a different currency (e.g. INR) will have the amounts automatically converted using live exchange rates at validation time."
294
294
  })
295
295
  ] }),
296
- /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
296
+ /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
297
297
  className: "block text-sm font-medium text-text-primary mb-2",
298
298
  children: "Discount Type *"
299
- }), /* @__PURE__ */ g("div", {
299
+ }), /* @__PURE__ */ _("div", {
300
300
  className: "grid grid-cols-3 gap-3",
301
301
  children: [
302
302
  {
303
303
  value: "PERCENTAGE",
304
304
  label: "Percentage",
305
- icon: u
305
+ icon: d
306
306
  },
307
307
  {
308
308
  value: "FIXED_AMOUNT",
309
- label: `Fixed (${F})`,
309
+ label: `Fixed (${I})`,
310
310
  icon: null
311
311
  },
312
312
  {
313
313
  value: "FREE_SHIPPING",
314
314
  label: "Free Shipping",
315
- icon: l
315
+ icon: u
316
316
  }
317
- ].map(({ value: e, label: t, icon: n }) => /* @__PURE__ */ _("button", {
317
+ ].map(({ value: e, label: t, icon: n }) => /* @__PURE__ */ v("button", {
318
318
  type: "button",
319
- onClick: () => L("type", e),
320
- className: `p-4 rounded-lg border-2 transition-colors ${k.type === e ? "border-action-primary-bg bg-[var(--color-accent-soft)]" : "border-border-subtle hover:border-action-primary-bg/50"}`,
321
- children: [n ? /* @__PURE__ */ g(n, { className: "size-5 mx-auto mb-2" }) : /* @__PURE__ */ g("span", {
319
+ onClick: () => R("type", e),
320
+ className: `p-4 rounded-lg border-2 transition-colors ${A.type === e ? "border-action-primary-bg bg-[var(--color-accent-soft)]" : "border-border-subtle hover:border-action-primary-bg/50"}`,
321
+ children: [n ? /* @__PURE__ */ _(n, { className: "size-5 mx-auto mb-2" }) : /* @__PURE__ */ _("span", {
322
322
  className: "block text-lg font-bold mb-2",
323
- children: F
324
- }), /* @__PURE__ */ g("p", {
323
+ children: I
324
+ }), /* @__PURE__ */ _("p", {
325
325
  className: "text-sm font-medium",
326
326
  children: t
327
327
  })]
328
328
  }, e))
329
329
  })] }),
330
- /* @__PURE__ */ _("div", { children: [
331
- /* @__PURE__ */ g("label", {
330
+ /* @__PURE__ */ v("div", { children: [
331
+ /* @__PURE__ */ _("label", {
332
332
  className: "block text-sm font-medium text-text-primary mb-1",
333
333
  children: "Discount Value *"
334
334
  }),
335
- /* @__PURE__ */ g("div", {
335
+ /* @__PURE__ */ _("div", {
336
336
  className: "relative",
337
- children: k.type === "PERCENTAGE" ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(u, { className: "absolute left-3 top-1/2 -translate-y-1/2 size-4 text-text-muted" }), /* @__PURE__ */ g("input", {
337
+ children: A.type === "PERCENTAGE" ? /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(d, { className: "absolute left-3 top-1/2 -translate-y-1/2 size-4 text-text-muted" }), /* @__PURE__ */ _("input", {
338
338
  type: "number",
339
- value: k.value,
340
- onChange: (e) => L("value", parseFloat(e.target.value)),
339
+ value: A.value,
340
+ onChange: (e) => R("value", parseFloat(e.target.value)),
341
341
  min: "0",
342
342
  max: "100",
343
343
  step: "0.01",
344
- className: `w-full pl-10 pr-4 py-2 rounded-input border ${j.value ? "border-status-error-border" : "border-border-subtle"} bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]`
345
- })] }) : /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("span", {
344
+ className: `w-full pl-10 pr-4 py-2 rounded-input border ${M.value ? "border-status-error-border" : "border-border-subtle"} bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]`
345
+ })] }) : /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("span", {
346
346
  className: "absolute left-3 top-1/2 -translate-y-1/2 text-sm text-text-muted font-medium",
347
- children: F
348
- }), /* @__PURE__ */ g("input", {
347
+ children: I
348
+ }), /* @__PURE__ */ _("input", {
349
349
  type: "number",
350
- value: k.value,
351
- onChange: (e) => L("value", parseFloat(e.target.value)),
350
+ value: A.value,
351
+ onChange: (e) => R("value", parseFloat(e.target.value)),
352
352
  min: "0",
353
353
  step: "0.01",
354
- className: `w-full pl-10 pr-4 py-2 rounded-input border ${j.value ? "border-status-error-border" : "border-border-subtle"} bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]`
354
+ className: `w-full pl-10 pr-4 py-2 rounded-input border ${M.value ? "border-status-error-border" : "border-border-subtle"} bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]`
355
355
  })] })
356
356
  }),
357
- j.value && /* @__PURE__ */ g("p", {
357
+ M.value && /* @__PURE__ */ _("p", {
358
358
  className: "text-sm text-status-error-text mt-1",
359
- children: j.value
359
+ children: M.value
360
360
  })
361
361
  ] }),
362
- /* @__PURE__ */ _("div", { children: [
363
- /* @__PURE__ */ _("label", {
362
+ /* @__PURE__ */ v("div", { children: [
363
+ /* @__PURE__ */ v("label", {
364
364
  className: "block text-sm font-medium text-text-primary mb-1",
365
365
  children: [
366
366
  "Minimum Purchase Amount (",
367
- k.currency,
367
+ A.currency,
368
368
  ")"
369
369
  ]
370
370
  }),
371
- /* @__PURE__ */ _("div", {
371
+ /* @__PURE__ */ v("div", {
372
372
  className: "relative",
373
- children: [/* @__PURE__ */ g("span", {
373
+ children: [/* @__PURE__ */ _("span", {
374
374
  className: "absolute left-3 top-1/2 -translate-y-1/2 text-sm text-text-muted font-medium",
375
- children: F
376
- }), /* @__PURE__ */ g("input", {
375
+ children: I
376
+ }), /* @__PURE__ */ _("input", {
377
377
  type: "number",
378
- value: k.minPurchaseAmount || "",
379
- onChange: (e) => L("minPurchaseAmount", e.target.value ? parseFloat(e.target.value) : null),
378
+ value: A.minPurchaseAmount || "",
379
+ onChange: (e) => R("minPurchaseAmount", e.target.value ? parseFloat(e.target.value) : null),
380
380
  min: "0",
381
381
  step: "0.01",
382
382
  placeholder: "No minimum",
383
383
  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)]"
384
384
  })]
385
385
  }),
386
- /* @__PURE__ */ _("p", {
386
+ /* @__PURE__ */ v("p", {
387
387
  className: "text-xs text-text-muted mt-1",
388
388
  children: [
389
389
  "Order must be at least this amount in ",
390
- k.currency,
390
+ A.currency,
391
391
  " (auto-converted for other currencies)"
392
392
  ]
393
393
  })
394
394
  ] }),
395
- k.type === "PERCENTAGE" && /* @__PURE__ */ _("div", { children: [
396
- /* @__PURE__ */ _("label", {
395
+ A.type === "PERCENTAGE" && /* @__PURE__ */ v("div", { children: [
396
+ /* @__PURE__ */ v("label", {
397
397
  className: "block text-sm font-medium text-text-primary mb-1",
398
398
  children: [
399
399
  "Maximum Discount Amount (",
400
- k.currency,
400
+ A.currency,
401
401
  ")"
402
402
  ]
403
403
  }),
404
- /* @__PURE__ */ _("div", {
404
+ /* @__PURE__ */ v("div", {
405
405
  className: "relative",
406
- children: [/* @__PURE__ */ g("span", {
406
+ children: [/* @__PURE__ */ _("span", {
407
407
  className: "absolute left-3 top-1/2 -translate-y-1/2 text-sm text-text-muted font-medium",
408
- children: F
409
- }), /* @__PURE__ */ g("input", {
408
+ children: I
409
+ }), /* @__PURE__ */ _("input", {
410
410
  type: "number",
411
- value: k.maxDiscountAmount || "",
412
- onChange: (e) => L("maxDiscountAmount", e.target.value ? parseFloat(e.target.value) : null),
411
+ value: A.maxDiscountAmount || "",
412
+ onChange: (e) => R("maxDiscountAmount", e.target.value ? parseFloat(e.target.value) : null),
413
413
  min: "0",
414
414
  step: "0.01",
415
415
  placeholder: "No maximum",
416
416
  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)]"
417
417
  })]
418
418
  }),
419
- /* @__PURE__ */ _("p", {
419
+ /* @__PURE__ */ v("p", {
420
420
  className: "text-xs text-text-muted mt-1",
421
421
  children: [
422
422
  "Cap the discount in ",
423
- k.currency,
423
+ A.currency,
424
424
  " — auto-converted to the user's payment currency"
425
425
  ]
426
426
  })
427
427
  ] })
428
428
  ]
429
429
  }),
430
- /* @__PURE__ */ _("div", {
430
+ /* @__PURE__ */ v("div", {
431
431
  className: "bg-bg-surface border border-border-subtle rounded-lg p-6 space-y-4",
432
432
  children: [
433
- /* @__PURE__ */ g("h3", {
433
+ /* @__PURE__ */ _("h3", {
434
434
  className: "text-lg font-semibold text-text-primary",
435
435
  children: "Usage Limits"
436
436
  }),
437
- /* @__PURE__ */ _("div", { children: [
438
- /* @__PURE__ */ g("label", {
437
+ /* @__PURE__ */ v("div", { children: [
438
+ /* @__PURE__ */ _("label", {
439
439
  className: "block text-sm font-medium text-text-primary mb-1",
440
440
  children: "Total Usage Limit"
441
441
  }),
442
- /* @__PURE__ */ g("input", {
442
+ /* @__PURE__ */ _("input", {
443
443
  type: "number",
444
- value: k.maxTotalUses || "",
445
- onChange: (e) => L("maxTotalUses", e.target.value ? parseInt(e.target.value) : null),
444
+ value: A.maxTotalUses || "",
445
+ onChange: (e) => R("maxTotalUses", e.target.value ? parseInt(e.target.value) : null),
446
446
  min: "1",
447
447
  placeholder: "Unlimited",
448
448
  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)]"
449
449
  }),
450
- /* @__PURE__ */ g("p", {
450
+ /* @__PURE__ */ _("p", {
451
451
  className: "text-xs text-text-muted mt-1",
452
452
  children: "Maximum number of times this coupon can be used across all users"
453
453
  })
454
454
  ] }),
455
- /* @__PURE__ */ _("div", { children: [
456
- /* @__PURE__ */ g("label", {
455
+ /* @__PURE__ */ v("div", { children: [
456
+ /* @__PURE__ */ _("label", {
457
457
  className: "block text-sm font-medium text-text-primary mb-1",
458
458
  children: "Per-User Limit *"
459
459
  }),
460
- /* @__PURE__ */ g("input", {
460
+ /* @__PURE__ */ _("input", {
461
461
  type: "number",
462
- value: k.maxUsesPerUser,
463
- onChange: (e) => L("maxUsesPerUser", parseInt(e.target.value)),
462
+ value: A.maxUsesPerUser,
463
+ onChange: (e) => R("maxUsesPerUser", parseInt(e.target.value)),
464
464
  min: "1",
465
465
  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)]"
466
466
  }),
467
- /* @__PURE__ */ g("p", {
467
+ /* @__PURE__ */ _("p", {
468
468
  className: "text-xs text-text-muted mt-1",
469
469
  children: "Maximum times a single user can use this coupon"
470
470
  })
471
471
  ] })
472
472
  ]
473
473
  }),
474
- /* @__PURE__ */ _("div", {
474
+ /* @__PURE__ */ v("div", {
475
475
  className: "bg-bg-surface border border-border-subtle rounded-lg p-6 space-y-4",
476
- children: [/* @__PURE__ */ g("h3", {
476
+ children: [/* @__PURE__ */ _("h3", {
477
477
  className: "text-lg font-semibold text-text-primary",
478
478
  children: "Validity Period"
479
- }), /* @__PURE__ */ _("div", {
479
+ }), /* @__PURE__ */ v("div", {
480
480
  className: "grid grid-cols-1 md:grid-cols-2 gap-4",
481
- children: [/* @__PURE__ */ _("div", { children: [
482
- /* @__PURE__ */ g("label", {
481
+ children: [/* @__PURE__ */ v("div", { children: [
482
+ /* @__PURE__ */ _("label", {
483
483
  className: "block text-sm font-medium text-text-primary mb-1",
484
484
  children: "Start Date *"
485
485
  }),
486
- /* @__PURE__ */ g("input", {
486
+ /* @__PURE__ */ _("input", {
487
487
  type: "date",
488
- value: k.validFrom,
489
- onChange: (e) => L("validFrom", e.target.value),
490
- className: `w-full px-4 py-2 rounded-input border ${j.validFrom ? "border-status-error-border" : "border-border-subtle"} bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]`
488
+ value: A.validFrom,
489
+ onChange: (e) => R("validFrom", e.target.value),
490
+ className: `w-full px-4 py-2 rounded-input border ${M.validFrom ? "border-status-error-border" : "border-border-subtle"} bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]`
491
491
  }),
492
- j.validFrom && /* @__PURE__ */ g("p", {
492
+ M.validFrom && /* @__PURE__ */ _("p", {
493
493
  className: "text-sm text-status-error-text mt-1",
494
- children: j.validFrom
494
+ children: M.validFrom
495
495
  })
496
- ] }), /* @__PURE__ */ _("div", { children: [
497
- /* @__PURE__ */ g("label", {
496
+ ] }), /* @__PURE__ */ v("div", { children: [
497
+ /* @__PURE__ */ _("label", {
498
498
  className: "block text-sm font-medium text-text-primary mb-1",
499
499
  children: "End Date"
500
500
  }),
501
- /* @__PURE__ */ g("input", {
501
+ /* @__PURE__ */ _("input", {
502
502
  type: "date",
503
- value: k.validUntil,
504
- onChange: (e) => L("validUntil", e.target.value),
505
- className: `w-full px-4 py-2 rounded-input border ${j.validUntil ? "border-status-error-border" : "border-border-subtle"} bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]`
503
+ value: A.validUntil,
504
+ onChange: (e) => R("validUntil", e.target.value),
505
+ className: `w-full px-4 py-2 rounded-input border ${M.validUntil ? "border-status-error-border" : "border-border-subtle"} bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]`
506
506
  }),
507
- j.validUntil && /* @__PURE__ */ g("p", {
507
+ M.validUntil && /* @__PURE__ */ _("p", {
508
508
  className: "text-sm text-status-error-text mt-1",
509
- children: j.validUntil
509
+ children: M.validUntil
510
510
  }),
511
- /* @__PURE__ */ g("p", {
511
+ /* @__PURE__ */ _("p", {
512
512
  className: "text-xs text-text-muted mt-1",
513
513
  children: "Leave empty for no expiry"
514
514
  })
515
515
  ] })]
516
516
  })]
517
517
  }),
518
- /* @__PURE__ */ _("div", {
518
+ /* @__PURE__ */ v("div", {
519
519
  className: "bg-bg-surface border border-border-subtle rounded-lg p-6 space-y-4",
520
520
  children: [
521
- /* @__PURE__ */ g("h3", {
521
+ /* @__PURE__ */ _("h3", {
522
522
  className: "text-lg font-semibold text-text-primary",
523
523
  children: "Applicability"
524
524
  }),
525
- /* @__PURE__ */ _("div", { children: [
526
- /* @__PURE__ */ g("label", {
525
+ /* @__PURE__ */ v("div", { children: [
526
+ /* @__PURE__ */ _("label", {
527
527
  className: "block text-sm font-medium text-text-primary mb-2",
528
528
  children: "Applicable Products"
529
529
  }),
530
- /* @__PURE__ */ g("div", {
530
+ /* @__PURE__ */ _("div", {
531
531
  className: "flex flex-wrap gap-2",
532
- children: b.map((e) => /* @__PURE__ */ g("button", {
532
+ children: x.map((e) => /* @__PURE__ */ _("button", {
533
533
  type: "button",
534
- onClick: () => V(e),
535
- className: `px-3 py-1.5 rounded-lg border text-sm transition-colors ${k.applicableProductIds.includes(e) ? "border-action-primary-bg bg-[var(--color-accent-soft)] text-text-link font-medium" : "border-border-subtle hover:border-action-primary-bg/50"}`,
534
+ onClick: () => H(e),
535
+ className: `px-3 py-1.5 rounded-lg border text-sm transition-colors ${A.applicableProductIds.includes(e) ? "border-action-primary-bg bg-[var(--color-accent-soft)] text-text-link font-medium" : "border-border-subtle hover:border-action-primary-bg/50"}`,
536
536
  children: e
537
537
  }, e))
538
538
  }),
539
- /* @__PURE__ */ g("p", {
539
+ /* @__PURE__ */ _("p", {
540
540
  className: "text-xs text-text-muted mt-1",
541
- children: k.applicableProductIds.length === 0 ? "No selection = applies to all products" : `Applies to: ${k.applicableProductIds.join(", ")}`
541
+ children: A.applicableProductIds.length === 0 ? "No selection = applies to all products" : `Applies to: ${A.applicableProductIds.join(", ")}`
542
542
  })
543
543
  ] }),
544
- /* @__PURE__ */ _("div", { children: [
545
- /* @__PURE__ */ g("label", {
544
+ /* @__PURE__ */ v("div", { children: [
545
+ /* @__PURE__ */ _("label", {
546
546
  className: "block text-sm font-medium text-text-primary mb-2",
547
547
  children: "Applicable Purchase Types"
548
548
  }),
549
- /* @__PURE__ */ g("div", {
549
+ /* @__PURE__ */ _("div", {
550
550
  className: "flex flex-wrap gap-2",
551
- children: x.map(({ value: e, label: t }) => /* @__PURE__ */ g("button", {
551
+ children: S.map(({ value: e, label: t }) => /* @__PURE__ */ _("button", {
552
552
  type: "button",
553
- onClick: () => H(e),
554
- className: `px-3 py-1.5 rounded-lg border text-sm transition-colors ${k.applicableEntityTypes.includes(e) ? "border-action-primary-bg bg-[var(--color-accent-soft)] text-text-link font-medium" : "border-border-subtle hover:border-action-primary-bg/50"}`,
553
+ onClick: () => U(e),
554
+ className: `px-3 py-1.5 rounded-lg border text-sm transition-colors ${A.applicableEntityTypes.includes(e) ? "border-action-primary-bg bg-[var(--color-accent-soft)] text-text-link font-medium" : "border-border-subtle hover:border-action-primary-bg/50"}`,
555
555
  children: t
556
556
  }, e))
557
557
  }),
558
- /* @__PURE__ */ g("p", {
558
+ /* @__PURE__ */ _("p", {
559
559
  className: "text-xs text-text-muted mt-1",
560
- children: k.applicableEntityTypes.length === 0 ? "No selection = applies to plan, add-on, and store purchases" : `Applies to: ${k.applicableEntityTypes.join(", ")}`
560
+ children: A.applicableEntityTypes.length === 0 ? "No selection = applies to plan, add-on, and store purchases" : `Applies to: ${A.applicableEntityTypes.join(", ")}`
561
561
  })
562
562
  ] })
563
563
  ]
564
564
  }),
565
- /* @__PURE__ */ _("div", {
565
+ /* @__PURE__ */ v("div", {
566
566
  className: "bg-bg-surface border border-border-subtle rounded-lg p-6 space-y-4",
567
567
  children: [
568
- /* @__PURE__ */ g("h3", {
568
+ /* @__PURE__ */ _("h3", {
569
569
  className: "text-lg font-semibold text-text-primary",
570
570
  children: "Coupon Scope"
571
571
  }),
572
- /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
572
+ /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
573
573
  className: "block text-sm font-medium text-text-primary mb-2",
574
574
  children: "Who can use this coupon? *"
575
- }), /* @__PURE__ */ _("select", {
576
- value: k.scope,
577
- onChange: (e) => L("scope", e.target.value),
575
+ }), /* @__PURE__ */ v(c, {
576
+ value: A.scope,
577
+ onChange: (e) => R("scope", e.target.value),
578
578
  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",
579
579
  children: [
580
- /* @__PURE__ */ g("option", {
580
+ /* @__PURE__ */ _("option", {
581
581
  value: "GENERIC",
582
582
  children: "Anyone (Public)"
583
583
  }),
584
- /* @__PURE__ */ g("option", {
584
+ /* @__PURE__ */ _("option", {
585
585
  value: "USER_SPECIFIC",
586
586
  children: "Specific Users Only"
587
587
  }),
588
- /* @__PURE__ */ g("option", {
588
+ /* @__PURE__ */ _("option", {
589
589
  value: "REFERRAL",
590
590
  children: "Referral Code"
591
591
  }),
592
- /* @__PURE__ */ g("option", {
592
+ /* @__PURE__ */ _("option", {
593
593
  value: "CAMPAIGN",
594
594
  children: "Campaign-Specific"
595
595
  })
596
596
  ]
597
597
  })] }),
598
- k.scope === "CAMPAIGN" && /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
598
+ A.scope === "CAMPAIGN" && /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
599
599
  className: "block text-sm font-medium text-text-primary mb-1",
600
600
  children: "Campaign Name"
601
- }), /* @__PURE__ */ g("input", {
601
+ }), /* @__PURE__ */ _("input", {
602
602
  type: "text",
603
- value: k.campaignName,
604
- onChange: (e) => L("campaignName", e.target.value),
603
+ value: A.campaignName,
604
+ onChange: (e) => R("campaignName", e.target.value),
605
605
  placeholder: "e.g., Summer Sale 2024",
606
606
  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)]"
607
607
  })] }),
608
- k.scope === "USER_SPECIFIC" && /* @__PURE__ */ _("div", { children: [
609
- /* @__PURE__ */ g("label", {
608
+ A.scope === "USER_SPECIFIC" && /* @__PURE__ */ v("div", { children: [
609
+ /* @__PURE__ */ _("label", {
610
610
  className: "block text-sm font-medium text-text-primary mb-1",
611
- children: /* @__PURE__ */ _("span", {
611
+ children: /* @__PURE__ */ v("span", {
612
612
  className: "flex items-center gap-1.5",
613
- children: [/* @__PURE__ */ g(p, { className: "size-4" }), "Restricted Users *"]
613
+ children: [/* @__PURE__ */ _(m, { className: "size-4" }), "Restricted Users *"]
614
614
  })
615
615
  }),
616
- /* @__PURE__ */ _("div", {
617
- className: `min-h-[42px] flex flex-wrap gap-2 px-3 py-2 rounded-lg border ${j.restrictedToUserIds ? "border-status-error-border" : "border-border-subtle"} bg-bg-surface cursor-text`,
618
- onClick: () => O.current?.focus(),
619
- children: [k.restrictedToUserIds.map((e) => /* @__PURE__ */ _("span", {
616
+ /* @__PURE__ */ v("div", {
617
+ className: `min-h-[42px] flex flex-wrap gap-2 px-3 py-2 rounded-lg border ${M.restrictedToUserIds ? "border-status-error-border" : "border-border-subtle"} bg-bg-surface cursor-text`,
618
+ onClick: () => k.current?.focus(),
619
+ children: [A.restrictedToUserIds.map((e) => /* @__PURE__ */ v("span", {
620
620
  className: "inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-[var(--color-accent-soft)] text-text-link text-sm font-medium",
621
- children: [e, /* @__PURE__ */ g("button", {
621
+ children: [e, /* @__PURE__ */ _("button", {
622
622
  type: "button",
623
623
  onClick: (t) => {
624
- t.stopPropagation(), B(e);
624
+ t.stopPropagation(), V(e);
625
625
  },
626
626
  className: "hover:text-status-error-text",
627
- children: /* @__PURE__ */ g(m, { className: "size-3" })
627
+ children: /* @__PURE__ */ _(h, { className: "size-3" })
628
628
  })]
629
- }, e)), /* @__PURE__ */ g("input", {
630
- ref: O,
629
+ }, e)), /* @__PURE__ */ _("input", {
630
+ ref: k,
631
631
  type: "text",
632
- value: E,
633
- onChange: (e) => D(e.target.value),
632
+ value: D,
633
+ onChange: (e) => O(e.target.value),
634
634
  onKeyDown: (e) => {
635
- e.key === "Enter" || e.key === "," ? (e.preventDefault(), z(E)) : e.key === "Backspace" && !E && k.restrictedToUserIds.length > 0 && B(k.restrictedToUserIds[k.restrictedToUserIds.length - 1]);
635
+ e.key === "Enter" || e.key === "," ? (e.preventDefault(), B(D)) : e.key === "Backspace" && !D && A.restrictedToUserIds.length > 0 && V(A.restrictedToUserIds[A.restrictedToUserIds.length - 1]);
636
636
  },
637
- onBlur: () => z(E),
638
- placeholder: k.restrictedToUserIds.length === 0 ? "Enter user email or ID, press Enter to add" : "Add another…",
637
+ onBlur: () => B(D),
638
+ placeholder: A.restrictedToUserIds.length === 0 ? "Enter user email or ID, press Enter to add" : "Add another…",
639
639
  className: "flex-1 min-w-[200px] bg-transparent text-text-primary placeholder:text-text-muted text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
640
640
  })]
641
641
  }),
642
- j.restrictedToUserIds && /* @__PURE__ */ g("p", {
642
+ M.restrictedToUserIds && /* @__PURE__ */ _("p", {
643
643
  className: "text-sm text-status-error-text mt-1",
644
- children: j.restrictedToUserIds
644
+ children: M.restrictedToUserIds
645
645
  }),
646
- /* @__PURE__ */ g("p", {
646
+ /* @__PURE__ */ _("p", {
647
647
  className: "text-xs text-text-muted mt-1",
648
648
  children: "Type an email or user ID and press Enter or comma to add. Only these users can redeem this coupon."
649
649
  })
650
650
  ] })
651
651
  ]
652
652
  }),
653
- /* @__PURE__ */ _("div", {
653
+ /* @__PURE__ */ v("div", {
654
654
  className: "flex items-center justify-end gap-3",
655
- children: [/* @__PURE__ */ g("button", {
655
+ children: [/* @__PURE__ */ _("button", {
656
656
  type: "button",
657
- onClick: () => w("/coupons"),
657
+ onClick: () => T("/coupons"),
658
658
  className: "px-6 py-3 rounded-lg border border-border-subtle text-text-primary hover:bg-bg-sunken",
659
659
  children: "Cancel"
660
- }), /* @__PURE__ */ g("button", {
660
+ }), /* @__PURE__ */ _("button", {
661
661
  type: "submit",
662
- disabled: N,
662
+ disabled: P,
663
663
  className: "px-6 py-3 rounded-lg bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bgHover flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed",
664
- children: N ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("div", { className: "size-4 border-2 border-action-primary-text border-t-transparent rounded-full animate-spin" }), "Creating…"] }) : /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(d, { className: "size-4" }), "Create Coupon"] })
664
+ children: P ? /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("div", { className: "size-4 border-2 border-action-primary-text border-t-transparent rounded-full animate-spin" }), "Creating…"] }) : /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(f, { className: "size-4" }), "Create Coupon"] })
665
665
  })]
666
666
  })
667
667
  ]
@@ -669,6 +669,6 @@ var y = [
669
669
  ]
670
670
  });
671
671
  };
672
- export { S as CreateCouponPage };
672
+ export { C as CreateCouponPage };
673
673
 
674
674
  //# sourceMappingURL=CreateCouponPage.js.map