@burdenoff/microfe-billing 2026.1027.2 → 2026.1028.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,31 +11,31 @@ import { useBillingPermissions as s } from "../../../hooks/useBillingPermissions
11
11
  import { useBillingNavigate as c } from "../../../hooks/useBillingNavigate.js";
12
12
  import { useAddon as l, useAddonMutations as u } from "../hooks/useAddons.js";
13
13
  import "../hooks/index.js";
14
- import { useQuotas as d } from "../../plans/hooks/useQuotas.js";
14
+ import { useQuotas as ee } from "../../plans/hooks/useQuotas.js";
15
15
  import "../../plans/hooks/index.js";
16
- import { useEffect as f, useState as p } from "react";
17
- import { useParams as m } from "react-router";
18
- import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
19
- import { useI18n as v } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
20
- import { PagePurpose as y } from "@burdenoff/fe-libs/ui";
16
+ import { useEffect as d, useState as f } from "react";
17
+ import { useParams as p } from "react-router";
18
+ import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
19
+ import { useI18n as _ } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
20
+ import { PagePurpose as v } from "@burdenoff/fe-libs/ui";
21
21
  //#region src/billing/modules/addons/pages/AddonEditPage.tsx
22
- var b = () => {
23
- let { t: b } = v(), x = (e, t) => {
24
- let n = b(e);
22
+ var y = () => {
23
+ let { t: y } = _(), b = (e, t) => {
24
+ let n = y(e);
25
25
  return n === e ? t : n;
26
- }, { addonId: S } = m(), C = c(), w = s(), { addon: T, isLoading: E, error: D, refetch: O } = l(S), { quotas: k, isLoading: A } = d({ onlyActive: !0 }), { updateAddon: j, isUpdating: M } = u(), [N, P] = p(""), [F, I] = p(""), [L, R] = p("USD"), [z, B] = p(i.MONTHLY), [V, H] = p(!0), [U, W] = p([]), [G, K] = p([]), [q, J] = p(null), [Y, X] = p(!1);
27
- if (f(() => {
28
- if (T) {
29
- if (P(T.name ?? ""), I(String(T.price ?? "")), R(T.currency ?? "USD"), B(T.duration ?? i.MONTHLY), H(T.isActive ?? !0), T.currencyPrices && typeof T.currencyPrices == "object") {
30
- let e = T.currencyPrices;
31
- K(Object.entries(e).filter(([, e]) => typeof e == "number").map(([e, t]) => ({
26
+ }, { addonId: x } = p(), S = c(), C = s(), { addon: w, isLoading: T, error: E, refetch: D } = l(x), { quotas: O, isLoading: k } = ee({ onlyActive: !0 }), { updateAddon: A, isUpdating: j } = u(), [M, N] = f(""), [P, F] = f(""), [I, L] = f("USD"), [R, z] = f(i.MONTHLY), [B, V] = f(!0), [H, U] = f(!0), [W, G] = f([]), [K, q] = f([]), [J, Y] = f(null), [X, Z] = f(!1);
27
+ if (d(() => {
28
+ if (w) {
29
+ if (N(w.name ?? ""), F(String(w.price ?? "")), L(w.currency ?? "USD"), z(w.duration ?? i.MONTHLY), V(w.isActive ?? !0), U(w.requiresPaidSubscription ?? !0), w.currencyPrices && typeof w.currencyPrices == "object") {
30
+ let e = w.currencyPrices;
31
+ q(Object.entries(e).filter(([, e]) => typeof e == "number").map(([e, t]) => ({
32
32
  currency: e,
33
33
  amount: t
34
34
  })));
35
35
  }
36
- if (T.features && T.features.length > 0) {
36
+ if (w.features && w.features.length > 0) {
37
37
  let e = [], t = /* @__PURE__ */ new Map();
38
- for (let e of T.features) if (e.quota?.id) {
38
+ for (let e of w.features) if (e.quota?.id) {
39
39
  let n = e.quota.id, r = o(e);
40
40
  t.set(n, (t.get(n) ?? 0) + r);
41
41
  }
@@ -43,13 +43,13 @@ var b = () => {
43
43
  quotaId: n,
44
44
  quantity: r
45
45
  });
46
- W(e);
46
+ G(e);
47
47
  }
48
48
  }
49
- }, [T]), !w.canManageAddons) return /* @__PURE__ */ g(e, { message: x("billing.addons.noEditPermission", "You don't have permission to edit addons.") });
50
- if (E || A) return /* @__PURE__ */ _("div", {
49
+ }, [w]), !C.canManageAddons) return /* @__PURE__ */ h(e, { message: b("billing.addons.noEditPermission", "You don't have permission to edit addons.") });
50
+ if (T || k) return /* @__PURE__ */ g("div", {
51
51
  className: "space-y-6 p-6",
52
- children: [/* @__PURE__ */ g("div", { className: "h-8 w-48 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ g("div", {
52
+ children: [/* @__PURE__ */ h("div", { className: "h-8 w-48 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ h("div", {
53
53
  className: "max-w-2xl space-y-4",
54
54
  children: [
55
55
  1,
@@ -57,272 +57,293 @@ var b = () => {
57
57
  3,
58
58
  4,
59
59
  5
60
- ].map((e) => /* @__PURE__ */ g("div", { className: "h-16 bg-bg-sunken animate-pulse rounded" }, e))
60
+ ].map((e) => /* @__PURE__ */ h("div", { className: "h-16 bg-bg-sunken animate-pulse rounded" }, e))
61
61
  })]
62
62
  });
63
- if (D && a(D)) return /* @__PURE__ */ g("div", {
63
+ if (E && a(E)) return /* @__PURE__ */ h("div", {
64
64
  className: "p-6",
65
- children: /* @__PURE__ */ g(n, {
66
- title: x("billing.addons.serverUnavailable", "Server Unavailable"),
67
- message: x("billing.addons.serverUnavailableLoadAddon", "Unable to load addon. The server might be down or experiencing issues."),
68
- onRetry: () => O(),
65
+ children: /* @__PURE__ */ h(n, {
66
+ title: b("billing.addons.serverUnavailable", "Server Unavailable"),
67
+ message: b("billing.addons.serverUnavailableLoadAddon", "Unable to load addon. The server might be down or experiencing issues."),
68
+ onRetry: () => D(),
69
69
  showRetry: !0
70
70
  })
71
71
  });
72
- if (!T) return /* @__PURE__ */ g("div", {
72
+ if (!w) return /* @__PURE__ */ h("div", {
73
73
  className: "flex items-center justify-center h-full min-h-[400px]",
74
- children: /* @__PURE__ */ _("div", {
74
+ children: /* @__PURE__ */ g("div", {
75
75
  className: "text-center space-y-4",
76
- children: [/* @__PURE__ */ g("h2", {
76
+ children: [/* @__PURE__ */ h("h2", {
77
77
  className: "text-lg font-semibold text-text-primary",
78
- children: x("billing.addons.addonNotFound", "Addon not found")
79
- }), /* @__PURE__ */ g("button", {
78
+ children: b("billing.addons.addonNotFound", "Addon not found")
79
+ }), /* @__PURE__ */ h("button", {
80
80
  type: "button",
81
- onClick: () => C("/addons"),
81
+ onClick: () => S("/addons"),
82
82
  className: "px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover",
83
83
  children: "Back to Addons"
84
84
  })]
85
85
  })
86
86
  });
87
- let Z = () => {
88
- W([{
87
+ let Q = () => {
88
+ G([{
89
89
  quotaId: "",
90
90
  quantity: 1
91
- }, ...U]);
92
- }, Q = (e) => {
93
- W(U.filter((t, n) => n !== e));
91
+ }, ...W]);
92
+ }, te = (e) => {
93
+ G(W.filter((t, n) => n !== e));
94
94
  }, $ = (e, t, n) => {
95
- let r = [...U];
96
- t === "quotaId" ? r[e].quotaId = n : r[e].quantity = Number(n), W(r);
95
+ let r = [...W];
96
+ t === "quotaId" ? r[e].quotaId = n : r[e].quantity = Number(n), G(r);
97
97
  };
98
- return /* @__PURE__ */ _("div", {
98
+ return /* @__PURE__ */ g("div", {
99
99
  className: "space-y-6 p-6",
100
100
  children: [
101
- /* @__PURE__ */ g(t, {
102
- title: `Edit Addon: ${T.name}`,
103
- description: x("billing.addons.editAddonDesc", "Update the addon details and quota allocations")
101
+ /* @__PURE__ */ h(t, {
102
+ title: `Edit Addon: ${w.name}`,
103
+ description: b("billing.addons.editAddonDesc", "Update the addon details and quota allocations")
104
104
  }),
105
- /* @__PURE__ */ g(y, { children: x("billing.addons.editPurpose", "Update this add-on's price, currency overrides and the quotas it grants. Changes affect new purchases; existing add-on subscriptions keep what they already bought.") }),
106
- /* @__PURE__ */ _("form", {
105
+ /* @__PURE__ */ h(v, { children: b("billing.addons.editPurpose", "Update this add-on's price, currency overrides and the quotas it grants. Changes affect new purchases; existing add-on subscriptions keep what they already bought.") }),
106
+ /* @__PURE__ */ g("form", {
107
107
  onSubmit: async (e) => {
108
- if (e.preventDefault(), J(null), X(!1), !N.trim()) {
109
- J("Addon name is required");
108
+ if (e.preventDefault(), Y(null), Z(!1), !M.trim()) {
109
+ Y("Addon name is required");
110
110
  return;
111
111
  }
112
- if (!F || isNaN(Number(F)) || Number(F) < 0) {
113
- J("Valid price is required");
112
+ if (!P || isNaN(Number(P)) || Number(P) < 0) {
113
+ Y("Valid price is required");
114
114
  return;
115
115
  }
116
- if (U.length === 0) {
117
- J("At least one quota is required");
116
+ if (W.length === 0) {
117
+ Y("At least one quota is required");
118
118
  return;
119
119
  }
120
- if (U.filter((e) => e.quotaId === "").length > 0) {
121
- J("Please select a quota for all allocations");
120
+ if (W.filter((e) => e.quotaId === "").length > 0) {
121
+ Y("Please select a quota for all allocations");
122
122
  return;
123
123
  }
124
124
  let t = {
125
- id: S,
126
- name: N.trim(),
127
- price: Number(F),
128
- currency: L,
129
- duration: z,
130
- isActive: V,
131
- quotas: U.map((e) => ({
125
+ id: x,
126
+ name: M.trim(),
127
+ price: Number(P),
128
+ currency: I,
129
+ duration: R,
130
+ isActive: B,
131
+ requiresPaidSubscription: H,
132
+ quotas: W.map((e) => ({
132
133
  quotaId: e.quotaId,
133
134
  quantity: e.quantity
134
135
  })),
135
- ...G.length > 0 ? { currencyPriceOverrides: G } : {}
136
+ ...K.length > 0 ? { currencyPriceOverrides: K } : {}
136
137
  };
137
138
  try {
138
- await j(t), X(!0), setTimeout(() => C(`/addons/${S}`), 1500);
139
+ await A(t), Z(!0), setTimeout(() => S(`/addons/${x}`), 1500);
139
140
  } catch (e) {
140
- J(e instanceof Error ? e.message : "Failed to update addon");
141
+ Y(e instanceof Error ? e.message : "Failed to update addon");
141
142
  }
142
143
  },
143
144
  className: "space-y-6",
144
145
  children: [
145
- q && /* @__PURE__ */ g("div", {
146
+ J && /* @__PURE__ */ h("div", {
146
147
  className: "p-4 bg-status-error-bg-subtle border border-border-subtle rounded-lg",
147
- children: /* @__PURE__ */ g("p", {
148
+ children: /* @__PURE__ */ h("p", {
148
149
  className: "text-sm text-status-error-text",
149
- children: q
150
+ children: J
150
151
  })
151
152
  }),
152
- Y && /* @__PURE__ */ g("div", {
153
+ X && /* @__PURE__ */ h("div", {
153
154
  className: "p-4 bg-status-success-bg-subtle border border-border-subtle rounded-lg",
154
- children: /* @__PURE__ */ g("p", {
155
+ children: /* @__PURE__ */ h("p", {
155
156
  className: "text-sm text-status-success-text",
156
- children: x("billing.addons.updateSuccess", "Addon updated successfully! Redirecting...")
157
+ children: b("billing.addons.updateSuccess", "Addon updated successfully! Redirecting...")
157
158
  })
158
159
  }),
159
- /* @__PURE__ */ _("div", {
160
+ /* @__PURE__ */ g("div", {
160
161
  className: "grid grid-cols-1 lg:grid-cols-2 gap-6",
161
- children: [/* @__PURE__ */ _("div", {
162
+ children: [/* @__PURE__ */ g("div", {
162
163
  className: "border border-border-seam rounded-card bg-bg-surface overflow-hidden shadow-[var(--shadow-elevation-1)] h-fit",
163
- children: [/* @__PURE__ */ g("div", {
164
+ children: [/* @__PURE__ */ h("div", {
164
165
  className: "p-4 border-b border-border-subtle bg-bg-sunken/30",
165
- children: /* @__PURE__ */ g("h2", {
166
+ children: /* @__PURE__ */ h("h2", {
166
167
  className: "font-semibold text-text-primary",
167
- children: x("billing.addons.basicInfo", "Basic Information")
168
+ children: b("billing.addons.basicInfo", "Basic Information")
168
169
  })
169
- }), /* @__PURE__ */ _("div", {
170
+ }), /* @__PURE__ */ g("div", {
170
171
  className: "p-4 space-y-4",
171
172
  children: [
172
- /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
173
+ /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ g("label", {
173
174
  htmlFor: "name",
174
175
  className: "block text-sm font-medium text-text-primary mb-1",
175
- children: [x("billing.addons.addonNameLabel", "Addon Name"), " *"]
176
- }), /* @__PURE__ */ g("input", {
176
+ children: [b("billing.addons.addonNameLabel", "Addon Name"), " *"]
177
+ }), /* @__PURE__ */ h("input", {
177
178
  id: "name",
178
179
  type: "text",
179
- value: N,
180
- onChange: (e) => P(e.target.value),
180
+ value: M,
181
+ onChange: (e) => N(e.target.value),
181
182
  className: "w-full px-3 py-2 border border-border-subtle rounded-input bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
182
- placeholder: x("billing.addons.addonNamePlaceholder", "e.g., Extra Storage"),
183
+ placeholder: b("billing.addons.addonNamePlaceholder", "e.g., Extra Storage"),
183
184
  required: !0
184
185
  })] }),
185
- /* @__PURE__ */ _("div", {
186
+ /* @__PURE__ */ g("div", {
186
187
  className: "grid grid-cols-2 gap-4",
187
- children: [/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
188
+ children: [/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ g("label", {
188
189
  htmlFor: "price",
189
190
  className: "block text-sm font-medium text-text-primary mb-1",
190
- children: [x("billing.addons.priceLabel", "Price"), " *"]
191
- }), /* @__PURE__ */ g("input", {
191
+ children: [b("billing.addons.priceLabel", "Price"), " *"]
192
+ }), /* @__PURE__ */ h("input", {
192
193
  id: "price",
193
194
  type: "number",
194
195
  step: "0.01",
195
196
  min: "0",
196
- value: F,
197
- onChange: (e) => I(e.target.value),
197
+ value: P,
198
+ onChange: (e) => F(e.target.value),
198
199
  className: "w-full px-3 py-2 border border-border-subtle rounded-input bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
199
200
  placeholder: "9.99",
200
201
  required: !0
201
- })] }), /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
202
+ })] }), /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ g("label", {
202
203
  htmlFor: "currency",
203
204
  className: "block text-sm font-medium text-text-primary mb-1",
204
- children: [x("billing.addons.currencyLabel", "Currency"), " *"]
205
- }), /* @__PURE__ */ _("select", {
205
+ children: [b("billing.addons.currencyLabel", "Currency"), " *"]
206
+ }), /* @__PURE__ */ g("select", {
206
207
  id: "currency",
207
- value: L,
208
- onChange: (e) => R(e.target.value),
208
+ value: I,
209
+ onChange: (e) => L(e.target.value),
209
210
  className: "w-full px-3 py-2 border border-border-subtle rounded-input 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",
210
211
  children: [
211
- /* @__PURE__ */ g("option", {
212
+ /* @__PURE__ */ h("option", {
212
213
  value: "USD",
213
214
  children: "USD ($)"
214
215
  }),
215
- /* @__PURE__ */ g("option", {
216
+ /* @__PURE__ */ h("option", {
216
217
  value: "EUR",
217
218
  children: "EUR"
218
219
  }),
219
- /* @__PURE__ */ g("option", {
220
+ /* @__PURE__ */ h("option", {
220
221
  value: "GBP",
221
222
  children: "GBP"
222
223
  }),
223
- /* @__PURE__ */ g("option", {
224
+ /* @__PURE__ */ h("option", {
224
225
  value: "INR",
225
226
  children: "INR"
226
227
  }),
227
- /* @__PURE__ */ g("option", {
228
+ /* @__PURE__ */ h("option", {
228
229
  value: "AUD",
229
230
  children: "AUD"
230
231
  }),
231
- /* @__PURE__ */ g("option", {
232
+ /* @__PURE__ */ h("option", {
232
233
  value: "CAD",
233
234
  children: "CAD"
234
235
  }),
235
- /* @__PURE__ */ g("option", {
236
+ /* @__PURE__ */ h("option", {
236
237
  value: "JPY",
237
238
  children: "JPY"
238
239
  }),
239
- /* @__PURE__ */ g("option", {
240
+ /* @__PURE__ */ h("option", {
240
241
  value: "SGD",
241
242
  children: "SGD"
242
243
  })
243
244
  ]
244
245
  })] })]
245
246
  }),
246
- /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
247
+ /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ g("label", {
247
248
  htmlFor: "duration",
248
249
  className: "block text-sm font-medium text-text-primary mb-1",
249
- children: [x("billing.addons.billingPeriodLabel", "Billing Period"), " *"]
250
- }), /* @__PURE__ */ _("select", {
250
+ children: [b("billing.addons.billingPeriodLabel", "Billing Period"), " *"]
251
+ }), /* @__PURE__ */ g("select", {
251
252
  id: "duration",
252
- value: z,
253
- onChange: (e) => B(e.target.value),
253
+ value: R,
254
+ onChange: (e) => z(e.target.value),
254
255
  className: "w-full px-3 py-2 border border-border-subtle rounded-input 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",
255
- children: [/* @__PURE__ */ g("option", {
256
+ children: [/* @__PURE__ */ h("option", {
256
257
  value: i.MONTHLY,
257
258
  children: "Monthly"
258
- }), /* @__PURE__ */ g("option", {
259
+ }), /* @__PURE__ */ h("option", {
259
260
  value: i.YEARLY,
260
261
  children: "Yearly"
261
262
  })]
262
263
  })] }),
263
- /* @__PURE__ */ _("div", {
264
+ /* @__PURE__ */ g("div", {
264
265
  className: "flex items-center gap-3",
265
- children: [/* @__PURE__ */ g("input", {
266
+ children: [/* @__PURE__ */ h("input", {
266
267
  id: "isActive",
267
268
  type: "checkbox",
268
- checked: V,
269
- onChange: (e) => H(e.target.checked),
269
+ checked: B,
270
+ onChange: (e) => V(e.target.checked),
270
271
  className: "size-4 rounded border-border-subtle text-text-link focus:ring-[var(--color-focus-ring)]"
271
- }), /* @__PURE__ */ g("label", {
272
+ }), /* @__PURE__ */ h("label", {
272
273
  htmlFor: "isActive",
273
274
  className: "text-sm font-medium text-text-primary",
274
- children: x("billing.addons.addonIsActive", "Addon is active")
275
+ children: b("billing.addons.addonIsActive", "Addon is active")
276
+ })]
277
+ }),
278
+ /* @__PURE__ */ g("div", {
279
+ className: "flex items-start gap-3",
280
+ children: [/* @__PURE__ */ h("input", {
281
+ id: "requiresPaidSubscription",
282
+ type: "checkbox",
283
+ checked: H,
284
+ onChange: (e) => U(e.target.checked),
285
+ className: "mt-0.5 size-4 rounded border-border-subtle text-text-link focus:ring-[var(--color-focus-ring)]"
286
+ }), /* @__PURE__ */ g("label", {
287
+ htmlFor: "requiresPaidSubscription",
288
+ className: "text-sm text-text-primary",
289
+ children: [/* @__PURE__ */ h("span", {
290
+ className: "font-medium",
291
+ children: b("billing.addons.requiresPaidSubscription", "Requires a paid subscription")
292
+ }), /* @__PURE__ */ h("span", {
293
+ className: "block text-text-secondary",
294
+ children: b("billing.addons.requiresPaidSubscriptionDesc", "Free-plan workspaces cannot buy this add-on. Clear it only for items sold to Free users on purpose, such as credit packs or fees.")
295
+ })]
275
296
  })]
276
297
  })
277
298
  ]
278
299
  })]
279
- }), /* @__PURE__ */ _("div", {
300
+ }), /* @__PURE__ */ g("div", {
280
301
  className: "border border-border-seam rounded-card bg-bg-surface overflow-hidden shadow-[var(--shadow-elevation-1)] h-fit",
281
- children: [/* @__PURE__ */ _("div", {
302
+ children: [/* @__PURE__ */ g("div", {
282
303
  className: "p-4 border-b border-border-subtle bg-bg-sunken/30 flex items-center justify-between",
283
- children: [/* @__PURE__ */ g("h2", {
304
+ children: [/* @__PURE__ */ h("h2", {
284
305
  className: "font-semibold text-text-primary",
285
- children: x("billing.addons.quotaAllocations", "Quota Allocations")
286
- }), /* @__PURE__ */ g("button", {
306
+ children: b("billing.addons.quotaAllocations", "Quota Allocations")
307
+ }), /* @__PURE__ */ h("button", {
287
308
  type: "button",
288
- onClick: Z,
309
+ onClick: Q,
289
310
  className: "px-3 py-1 text-sm font-medium text-text-link hover:bg-[var(--color-accent-soft)] rounded-md transition-colors",
290
311
  children: "+ Add Quota"
291
312
  })]
292
- }), /* @__PURE__ */ g("div", {
313
+ }), /* @__PURE__ */ h("div", {
293
314
  className: "p-4 space-y-3",
294
- children: U.length === 0 ? /* @__PURE__ */ g("p", {
315
+ children: W.length === 0 ? /* @__PURE__ */ h("p", {
295
316
  className: "text-sm text-text-muted",
296
- children: x("billing.addons.noQuotasAllocated", "No quotas allocated. Click \"Add Quota\" to add one.")
297
- }) : U.map((e, t) => {
298
- let n = k.find((t) => t.id === e.quotaId), r = n?.limits?.type ?? "unknown";
299
- return /* @__PURE__ */ _("div", {
317
+ children: b("billing.addons.noQuotasAllocated", "No quotas allocated. Click \"Add Quota\" to add one.")
318
+ }) : W.map((e, t) => {
319
+ let n = O.find((t) => t.id === e.quotaId), r = n?.limits?.type ?? "unknown";
320
+ return /* @__PURE__ */ g("div", {
300
321
  className: "p-3 border border-border-subtle rounded-lg bg-bg-sunken/20 space-y-3",
301
- children: [/* @__PURE__ */ _("div", {
322
+ children: [/* @__PURE__ */ g("div", {
302
323
  className: "flex items-center gap-3",
303
- children: [/* @__PURE__ */ _("select", {
324
+ children: [/* @__PURE__ */ g("select", {
304
325
  value: e.quotaId,
305
326
  onChange: (e) => $(t, "quotaId", e.target.value),
306
327
  className: `flex-1 px-3 py-2 border border-border-subtle rounded-input bg-bg-surface scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] ${e.quotaId === "" ? "text-text-muted" : "text-text-primary"}`,
307
- children: [/* @__PURE__ */ g("option", {
328
+ children: [/* @__PURE__ */ h("option", {
308
329
  value: "",
309
330
  disabled: !0,
310
- children: x("billing.addons.selectQuota", "Select a quota...")
311
- }), k.map((e) => /* @__PURE__ */ g("option", {
331
+ children: b("billing.addons.selectQuota", "Select a quota...")
332
+ }), O.map((e) => /* @__PURE__ */ h("option", {
312
333
  value: e.id,
313
334
  children: e.name
314
335
  }, e.id))]
315
- }), /* @__PURE__ */ g("button", {
336
+ }), /* @__PURE__ */ h("button", {
316
337
  type: "button",
317
- onClick: () => Q(t),
338
+ onClick: () => te(t),
318
339
  className: "p-2 text-status-error-text hover:bg-status-error-bg-subtle rounded-md transition-colors",
319
340
  title: "Remove quota",
320
- children: /* @__PURE__ */ g("svg", {
341
+ children: /* @__PURE__ */ h("svg", {
321
342
  className: "size-5",
322
343
  fill: "none",
323
344
  viewBox: "0 0 24 24",
324
345
  stroke: "currentColor",
325
- children: /* @__PURE__ */ g("path", {
346
+ children: /* @__PURE__ */ h("path", {
326
347
  strokeLinecap: "round",
327
348
  strokeLinejoin: "round",
328
349
  strokeWidth: 2,
@@ -330,18 +351,18 @@ var b = () => {
330
351
  })
331
352
  })
332
353
  })]
333
- }), n && /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("div", {
354
+ }), n && /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("div", {
334
355
  className: "flex items-center justify-between text-sm",
335
- children: /* @__PURE__ */ _("span", {
356
+ children: /* @__PURE__ */ g("span", {
336
357
  className: "capitalize text-text-muted",
337
358
  children: ["Type: ", r]
338
359
  })
339
- }), /* @__PURE__ */ _("div", {
360
+ }), /* @__PURE__ */ g("div", {
340
361
  className: "flex items-center gap-2",
341
- children: [/* @__PURE__ */ _("label", {
362
+ children: [/* @__PURE__ */ g("label", {
342
363
  className: "text-sm text-text-muted",
343
- children: [x("billing.addons.limit", "Limit"), ":"]
344
- }), /* @__PURE__ */ g("input", {
364
+ children: [b("billing.addons.limit", "Limit"), ":"]
365
+ }), /* @__PURE__ */ h("input", {
345
366
  type: "number",
346
367
  min: "1",
347
368
  value: e.quantity,
@@ -354,20 +375,20 @@ var b = () => {
354
375
  })]
355
376
  })]
356
377
  }),
357
- /* @__PURE__ */ g(r, {
358
- overrides: G,
359
- onChange: K
378
+ /* @__PURE__ */ h(r, {
379
+ overrides: K,
380
+ onChange: q
360
381
  }),
361
- /* @__PURE__ */ _("div", {
382
+ /* @__PURE__ */ g("div", {
362
383
  className: "flex items-center gap-3 pt-4",
363
- children: [/* @__PURE__ */ g("button", {
384
+ children: [/* @__PURE__ */ h("button", {
364
385
  type: "submit",
365
- disabled: M,
386
+ disabled: j,
366
387
  className: "px-6 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",
367
- children: M ? x("billing.addons.saving", "Saving...") : x("billing.addons.saveChanges", "Save Changes")
368
- }), /* @__PURE__ */ g("button", {
388
+ children: j ? b("billing.addons.saving", "Saving...") : b("billing.addons.saveChanges", "Save Changes")
389
+ }), /* @__PURE__ */ h("button", {
369
390
  type: "button",
370
- onClick: () => C(`/addons/${S}`),
391
+ onClick: () => S(`/addons/${x}`),
371
392
  className: "px-6 py-2 text-sm font-medium border border-border-subtle text-text-primary rounded-button hover:bg-bg-sunken transition-colors",
372
393
  children: "Cancel"
373
394
  })]
@@ -378,6 +399,6 @@ var b = () => {
378
399
  });
379
400
  };
380
401
  //#endregion
381
- export { b as AddonEditPage };
402
+ export { y as AddonEditPage };
382
403
 
383
404
  //# sourceMappingURL=AddonEditPage.js.map