@burdenoff/microfe-atheletebridge 2026.1110.1 → 2026.1110.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 (27) hide show
  1. package/dist/atheletebridge/AthleteBridgeRoutes.js +22 -6
  2. package/dist/atheletebridge/AthleteBridgeRoutes.js.map +1 -1
  3. package/dist/atheletebridge/components/StatusBadge.js +8 -0
  4. package/dist/atheletebridge/components/StatusBadge.js.map +1 -1
  5. package/dist/atheletebridge/hooks/useAuditApi.d.ts +14 -0
  6. package/dist/atheletebridge/hooks/useAuditApi.js +38 -0
  7. package/dist/atheletebridge/hooks/useAuditApi.js.map +1 -0
  8. package/dist/atheletebridge/hooks/useRegistrationApi.d.ts +15 -0
  9. package/dist/atheletebridge/hooks/useRegistrationApi.js +38 -19
  10. package/dist/atheletebridge/hooks/useRegistrationApi.js.map +1 -1
  11. package/dist/atheletebridge/pages/audit/AuditLogPage.d.ts +11 -0
  12. package/dist/atheletebridge/pages/audit/AuditLogPage.js +277 -0
  13. package/dist/atheletebridge/pages/audit/AuditLogPage.js.map +1 -0
  14. package/dist/atheletebridge/pages/control/ClubControlPage.d.ts +11 -0
  15. package/dist/atheletebridge/pages/control/ClubControlPage.js +208 -0
  16. package/dist/atheletebridge/pages/control/ClubControlPage.js.map +1 -0
  17. package/dist/atheletebridge/pages/fixtures/FixtureDetailPage.js +126 -65
  18. package/dist/atheletebridge/pages/fixtures/FixtureDetailPage.js.map +1 -1
  19. package/dist/atheletebridge/pages/registrations/RegistrationFormBuilderPage.js +243 -217
  20. package/dist/atheletebridge/pages/registrations/RegistrationFormBuilderPage.js.map +1 -1
  21. package/dist/atheletebridge/pages/registrations/RegistrationFormDetailPage.js +136 -83
  22. package/dist/atheletebridge/pages/registrations/RegistrationFormDetailPage.js.map +1 -1
  23. package/dist/atheletebridge/pages/registrations/RegistrationSubmissionPage.js +173 -146
  24. package/dist/atheletebridge/pages/registrations/RegistrationSubmissionPage.js.map +1 -1
  25. package/dist/atheletebridge/types/audit.d.ts +47 -0
  26. package/dist/atheletebridge/types/registration.d.ts +22 -1
  27. package/package.json +1 -1
@@ -2,16 +2,16 @@ import { PageLayout as e } from "../../components/PageLayout.js";
2
2
  import { ErrorState as t, LoadingState as n } from "../../components/LoadingState.js";
3
3
  import { FormField as r, fieldInputClass as i } from "../../components/form.js";
4
4
  import { useAthleteBridge as a } from "../../context/AthleteBridgeContext.js";
5
- import { useTeams as o } from "../../hooks/useAthleteBridgeApi.js";
6
- import { useCreateRegistrationForm as s, useRegistrationForm as c, useUpdateRegistrationForm as l } from "../../hooks/useRegistrationApi.js";
7
- import { minorToInput as u, parseMoney as d } from "../../utils/money.js";
8
- import { keyFromLabel as f } from "../../utils/registration.js";
9
- import { useEffect as p, useRef as m, useState as h } from "react";
10
- import { ArrowDown as g, ArrowLeft as _, ArrowUp as v, Loader2 as y, Plus as b, Save as x, Trash2 as S } from "lucide-react";
11
- import { useParams as C } from "react-router";
12
- import { jsx as w, jsxs as T } from "react/jsx-runtime";
5
+ import { useFixtures as o, useTeams as s } from "../../hooks/useAthleteBridgeApi.js";
6
+ import { useCreateRegistrationForm as c, useRegistrationForm as l, useUpdateRegistrationForm as u } from "../../hooks/useRegistrationApi.js";
7
+ import { minorToInput as d, parseMoney as f } from "../../utils/money.js";
8
+ import { keyFromLabel as p } from "../../utils/registration.js";
9
+ import { useEffect as m, useRef as h, useState as g } from "react";
10
+ import { ArrowDown as _, ArrowLeft as v, ArrowUp as y, Loader2 as b, Plus as x, Save as S, Trash2 as C } from "lucide-react";
11
+ import { useParams as w } from "react-router";
12
+ import { jsx as T, jsxs as E } from "react/jsx-runtime";
13
13
  // src/atheletebridge/pages/registrations/RegistrationFormBuilderPage.tsx
14
- var E = {
14
+ var D = {
15
15
  SHORT_TEXT: "Short text",
16
16
  LONG_TEXT: "Paragraph",
17
17
  EMAIL: "Email",
@@ -20,7 +20,7 @@ var E = {
20
20
  DATE: "Date",
21
21
  SELECT: "Dropdown",
22
22
  CHECKBOX: "Checkbox (yes / consent)"
23
- }, D = [
23
+ }, O = [
24
24
  "USD",
25
25
  "INR",
26
26
  "GBP",
@@ -29,11 +29,12 @@ var E = {
29
29
  "CAD",
30
30
  "SGD",
31
31
  "AED"
32
- ], O = () => `draft-${crypto.randomUUID()}`, k = {
32
+ ], k = () => `draft-${crypto.randomUUID()}`, A = {
33
33
  title: "",
34
34
  description: "",
35
35
  season: "",
36
36
  teamId: "",
37
+ fixtureId: "",
37
38
  slug: "",
38
39
  currency: "USD",
39
40
  opensAt: "",
@@ -43,28 +44,29 @@ var E = {
43
44
  questions: [],
44
45
  fees: []
45
46
  };
46
- function A(e) {
47
+ function j(e) {
47
48
  if (!e) return "";
48
49
  let t = new Date(e), n = t.getTimezoneOffset() * 6e4;
49
50
  return new Date(t.getTime() - n).toISOString().slice(0, 16);
50
51
  }
51
- function j(e) {
52
+ function M(e) {
52
53
  return e ? new Date(e).toISOString() : void 0;
53
54
  }
54
- function M(e) {
55
+ function N(e) {
55
56
  return {
56
57
  title: e.title,
57
58
  description: e.description ?? "",
58
59
  season: e.season ?? "",
59
60
  teamId: e.teamId ?? "",
61
+ fixtureId: e.fixtureId ?? "",
60
62
  slug: e.slug,
61
63
  currency: e.currency,
62
- opensAt: A(e.opensAt),
63
- closesAt: A(e.closesAt),
64
+ opensAt: j(e.opensAt),
65
+ closesAt: j(e.closesAt),
64
66
  maxSubmissions: e.maxSubmissions == null ? "" : String(e.maxSubmissions),
65
67
  waiverText: e.waiverText ?? "",
66
68
  questions: e.fields.map((e) => ({
67
- uid: O(),
69
+ uid: k(),
68
70
  key: e.key,
69
71
  label: e.label,
70
72
  fieldType: e.fieldType,
@@ -73,41 +75,41 @@ function M(e) {
73
75
  helpText: e.helpText ?? ""
74
76
  })),
75
77
  fees: e.fees.map((t) => ({
76
- uid: O(),
78
+ uid: k(),
77
79
  name: t.name,
78
- amountText: u(t.amount, e.currency),
80
+ amountText: d(t.amount, e.currency),
79
81
  feeType: t.feeType,
80
82
  description: t.description ?? ""
81
83
  }))
82
84
  };
83
85
  }
84
- function N(e, t, n) {
86
+ function P(e, t, n) {
85
87
  let r = t + n;
86
88
  if (r < 0 || r >= e.length) return e;
87
89
  let i = [...e], [a] = i.splice(t, 1);
88
90
  return a !== void 0 && i.splice(r, 0, a), i;
89
91
  }
90
- var P = "inline-flex h-8 w-8 items-center justify-center rounded-md border border-border-seam text-text-secondary transition-colors hover:bg-bg-sunken disabled:opacity-40";
91
- function F() {
92
- let { id: u } = C(), A = !!u, { navigateTo: F } = a(), I = c(u), L = o({ pagination: { limit: 100 } }), R = s(), z = l(), [B, V] = h(k), [H, U] = h(null), W = m(null);
93
- p(() => {
94
- A && I.data && W.current !== I.data.id && (W.current = I.data.id, V(M(I.data)));
95
- }, [A, I.data]);
96
- let G = A && (I.data?.submissionCount ?? 0) > 0, K = (e, t) => V((n) => ({
92
+ var F = "inline-flex h-8 w-8 items-center justify-center rounded-md border border-border-seam text-text-secondary transition-colors hover:bg-bg-sunken disabled:opacity-40";
93
+ function I() {
94
+ let { id: d } = w(), j = !!d, { navigateTo: I } = a(), L = l(d), R = s({ pagination: { limit: 100 } }), z = o({ pagination: { limit: 100 } }), B = c(), V = u(), [H, U] = g(A), [W, G] = g(null), K = h(null);
95
+ m(() => {
96
+ j && L.data && K.current !== L.data.id && (K.current = L.data.id, U(N(L.data)));
97
+ }, [j, L.data]);
98
+ let q = j && (L.data?.submissionCount ?? 0) > 0, J = (e, t) => U((n) => ({
97
99
  ...n,
98
100
  [e]: t
99
- })), q = (e, t) => K("questions", B.questions.map((n) => n.uid === e ? {
101
+ })), Y = (e, t) => J("questions", H.questions.map((n) => n.uid === e ? {
100
102
  ...n,
101
103
  ...t
102
- } : n)), J = (e, t) => K("fees", B.fees.map((n) => n.uid === e ? {
104
+ } : n)), X = (e, t) => J("fees", H.fees.map((n) => n.uid === e ? {
103
105
  ...n,
104
106
  ...t
105
- } : n)), Y = () => {
106
- let e = new Set(B.questions.map((e) => e.key).filter(Boolean)), t = [];
107
- for (let n of B.questions) {
107
+ } : n)), Z = () => {
108
+ let e = new Set(H.questions.map((e) => e.key).filter(Boolean)), t = [];
109
+ for (let n of H.questions) {
108
110
  let r = n.label.trim();
109
111
  if (!r) return "Every question needs a label.";
110
- let i = n.key || f(r, e);
112
+ let i = n.key || p(r, e);
111
113
  e.add(i);
112
114
  let a = n.optionsText.split(",").map((e) => e.trim()).filter(Boolean);
113
115
  if (n.fieldType === "SELECT" && a.length === 0) return `Add at least one option to the dropdown "${r}".`;
@@ -121,10 +123,10 @@ function F() {
121
123
  });
122
124
  }
123
125
  let n = [];
124
- for (let e of B.fees) {
126
+ for (let e of H.fees) {
125
127
  let t = e.name.trim();
126
128
  if (!t) return "Every fee needs a name.";
127
- let r = d(e.amountText, B.currency);
129
+ let r = f(e.amountText, H.currency);
128
130
  if (r === null) return `Enter a valid amount for "${t}".`;
129
131
  n.push({
130
132
  name: t,
@@ -137,151 +139,175 @@ function F() {
137
139
  fields: t,
138
140
  fees: n
139
141
  };
140
- }, X = async (e) => {
141
- if (e.preventDefault(), U(null), !B.title.trim()) {
142
- U("Give the form a title.");
142
+ }, ee = async (e) => {
143
+ if (e.preventDefault(), G(null), !H.title.trim()) {
144
+ G("Give the form a title.");
143
145
  return;
144
146
  }
145
- let t = B.maxSubmissions.trim() ? Number.parseInt(B.maxSubmissions, 10) : void 0;
147
+ let t = H.maxSubmissions.trim() ? Number.parseInt(H.maxSubmissions, 10) : void 0;
146
148
  if (t !== void 0 && (Number.isNaN(t) || t < 1)) {
147
- U("Capacity must be a positive number.");
149
+ G("Capacity must be a positive number.");
148
150
  return;
149
151
  }
150
- let n = G ? null : Y();
151
- if (typeof n == "string") U(n);
152
+ let n = q ? null : Z();
153
+ if (typeof n == "string") G(n);
152
154
  else try {
153
- if (A && u) await z.mutateAsync({
154
- id: u,
155
+ if (j && d) await V.mutateAsync({
156
+ id: d,
155
157
  input: {
156
- title: B.title.trim(),
157
- description: B.description.trim() || null,
158
- season: B.season.trim() || null,
159
- teamId: B.teamId || null,
160
- opensAt: j(B.opensAt) ?? null,
161
- closesAt: j(B.closesAt) ?? null,
158
+ title: H.title.trim(),
159
+ description: H.description.trim() || null,
160
+ season: H.season.trim() || null,
161
+ teamId: H.teamId || null,
162
+ fixtureId: H.fixtureId || null,
163
+ opensAt: M(H.opensAt) ?? null,
164
+ closesAt: M(H.closesAt) ?? null,
162
165
  maxSubmissions: t ?? null,
163
- waiverText: B.waiverText.trim() || null,
166
+ waiverText: H.waiverText.trim() || null,
164
167
  ...n ? {
165
- currency: B.currency,
168
+ currency: H.currency,
166
169
  fields: n.fields,
167
170
  fees: n.fees
168
171
  } : {}
169
172
  }
170
- }), F(`/registrations/${u}`);
173
+ }), I(`/registrations/${d}`);
171
174
  else if (n) {
172
- let e = await R.mutateAsync({
173
- title: B.title.trim(),
174
- description: B.description.trim() || void 0,
175
- season: B.season.trim() || void 0,
176
- teamId: B.teamId || void 0,
177
- slug: B.slug.trim() || void 0,
178
- currency: B.currency,
179
- opensAt: j(B.opensAt),
180
- closesAt: j(B.closesAt),
175
+ let e = await B.mutateAsync({
176
+ title: H.title.trim(),
177
+ description: H.description.trim() || void 0,
178
+ season: H.season.trim() || void 0,
179
+ teamId: H.teamId || void 0,
180
+ fixtureId: H.fixtureId || void 0,
181
+ slug: H.slug.trim() || void 0,
182
+ currency: H.currency,
183
+ opensAt: M(H.opensAt),
184
+ closesAt: M(H.closesAt),
181
185
  maxSubmissions: t,
182
- waiverText: B.waiverText.trim() || void 0,
186
+ waiverText: H.waiverText.trim() || void 0,
183
187
  fields: n.fields,
184
188
  fees: n.fees
185
189
  });
186
- F(`/registrations/${e.id}`);
190
+ I(`/registrations/${e.id}`);
187
191
  }
188
192
  } catch (e) {
189
- U(e instanceof Error ? e.message : "Failed to save the registration form.");
193
+ G(e instanceof Error ? e.message : "Failed to save the registration form.");
190
194
  }
191
- }, Z = R.isPending || z.isPending, Q = A ? "Edit registration form" : "New registration form";
192
- return A && I.isLoading ? /* @__PURE__ */ w(e, {
193
- title: Q,
194
- children: /* @__PURE__ */ w(n, { label: "Loading registration form…" })
195
- }) : A && (I.isError || !I.data) ? /* @__PURE__ */ w(e, {
196
- title: Q,
197
- children: /* @__PURE__ */ w(t, {
195
+ }, Q = B.isPending || V.isPending, $ = j ? "Edit registration form" : "New registration form";
196
+ return j && L.isLoading ? /* @__PURE__ */ T(e, {
197
+ title: $,
198
+ children: /* @__PURE__ */ T(n, { label: "Loading registration form…" })
199
+ }) : j && (L.isError || !L.data) ? /* @__PURE__ */ T(e, {
200
+ title: $,
201
+ children: /* @__PURE__ */ T(t, {
198
202
  title: "Registration form not found",
199
203
  message: "This form does not exist or you do not have access to it.",
200
- onRetry: () => F("/registrations")
204
+ onRetry: () => I("/registrations")
201
205
  })
202
- }) : /* @__PURE__ */ w(e, {
203
- title: Q,
206
+ }) : /* @__PURE__ */ T(e, {
207
+ title: $,
204
208
  description: "Set the details, the questions families answer and the fees they pay.",
205
- actions: /* @__PURE__ */ T("button", {
209
+ actions: /* @__PURE__ */ E("button", {
206
210
  type: "button",
207
- onClick: () => F(A && u ? `/registrations/${u}` : "/registrations"),
211
+ onClick: () => I(j && d ? `/registrations/${d}` : "/registrations"),
208
212
  className: "inline-flex items-center gap-1.5 rounded-lg border border-border-seam px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken",
209
- children: [/* @__PURE__ */ w(_, { className: "h-4 w-4" }), " Cancel"]
213
+ children: [/* @__PURE__ */ T(v, { className: "h-4 w-4" }), " Cancel"]
210
214
  }),
211
- children: /* @__PURE__ */ T("form", {
212
- onSubmit: X,
215
+ children: /* @__PURE__ */ E("form", {
216
+ onSubmit: ee,
213
217
  className: "max-w-3xl space-y-8",
214
218
  children: [
215
- /* @__PURE__ */ T("section", {
219
+ /* @__PURE__ */ E("section", {
216
220
  className: "space-y-5",
217
221
  children: [
218
- /* @__PURE__ */ w(r, {
222
+ /* @__PURE__ */ T(r, {
219
223
  label: "Form title",
220
224
  htmlFor: "title",
221
225
  required: !0,
222
- children: /* @__PURE__ */ w("input", {
226
+ children: /* @__PURE__ */ T("input", {
223
227
  id: "title",
224
228
  className: i,
225
- value: B.title,
226
- onChange: (e) => K("title", e.target.value),
229
+ value: H.title,
230
+ onChange: (e) => J("title", e.target.value),
227
231
  placeholder: "e.g. U12 Boys — 2026/27 season registration"
228
232
  })
229
233
  }),
230
- /* @__PURE__ */ w(r, {
234
+ /* @__PURE__ */ T(r, {
231
235
  label: "Description",
232
236
  htmlFor: "description",
233
- children: /* @__PURE__ */ w("textarea", {
237
+ children: /* @__PURE__ */ T("textarea", {
234
238
  id: "description",
235
239
  rows: 3,
236
240
  className: i,
237
- value: B.description,
238
- onChange: (e) => K("description", e.target.value),
241
+ value: H.description,
242
+ onChange: (e) => J("description", e.target.value),
239
243
  placeholder: "Who this is for, training days, what is included."
240
244
  })
241
245
  }),
242
- /* @__PURE__ */ T("div", {
246
+ /* @__PURE__ */ E("div", {
243
247
  className: "grid grid-cols-1 gap-5 sm:grid-cols-3",
244
248
  children: [
245
- /* @__PURE__ */ w(r, {
249
+ /* @__PURE__ */ T(r, {
246
250
  label: "Season",
247
251
  htmlFor: "season",
248
- children: /* @__PURE__ */ w("input", {
252
+ children: /* @__PURE__ */ T("input", {
249
253
  id: "season",
250
254
  className: i,
251
- value: B.season,
252
- onChange: (e) => K("season", e.target.value),
255
+ value: H.season,
256
+ onChange: (e) => J("season", e.target.value),
253
257
  placeholder: "2026/27"
254
258
  })
255
259
  }),
256
- /* @__PURE__ */ w(r, {
260
+ /* @__PURE__ */ T(r, {
257
261
  label: "Team",
258
262
  htmlFor: "teamId",
259
263
  hint: "Optional squad this registers for.",
260
- children: /* @__PURE__ */ T("select", {
264
+ children: /* @__PURE__ */ E("select", {
261
265
  id: "teamId",
262
266
  className: i,
263
- value: B.teamId,
264
- onChange: (e) => K("teamId", e.target.value),
265
- children: [/* @__PURE__ */ w("option", {
267
+ value: H.teamId,
268
+ onChange: (e) => J("teamId", e.target.value),
269
+ children: [/* @__PURE__ */ T("option", {
266
270
  value: "",
267
271
  children: "No specific team"
268
- }), (L.data?.items ?? []).map((e) => /* @__PURE__ */ w("option", {
272
+ }), (R.data?.items ?? []).map((e) => /* @__PURE__ */ T("option", {
269
273
  value: e.id,
270
274
  children: e.name
271
275
  }, e.id))]
272
276
  })
273
277
  }),
274
- /* @__PURE__ */ w(r, {
278
+ /* @__PURE__ */ T(r, {
279
+ label: "Fixture",
280
+ htmlFor: "fixtureId",
281
+ hint: "Optional tournament or match this form takes sign-ups for. Families use the same share link.",
282
+ children: /* @__PURE__ */ E("select", {
283
+ id: "fixtureId",
284
+ className: i,
285
+ value: H.fixtureId,
286
+ onChange: (e) => J("fixtureId", e.target.value),
287
+ children: [/* @__PURE__ */ T("option", {
288
+ value: "",
289
+ children: "Not tied to a fixture"
290
+ }), (z.data?.items ?? []).map((e) => /* @__PURE__ */ T("option", {
291
+ value: e.id,
292
+ children: [
293
+ e.competition ?? "Fixture",
294
+ e.homeTeam?.name ?? null,
295
+ e.awayTeam?.name ? `vs ${e.awayTeam.name}` : null
296
+ ].filter(Boolean).join(" — ")
297
+ }, e.id))]
298
+ })
299
+ }),
300
+ /* @__PURE__ */ T(r, {
275
301
  label: "Currency",
276
302
  htmlFor: "currency",
277
- hint: G ? "Locked after the first registration." : void 0,
278
- children: /* @__PURE__ */ w("select", {
303
+ hint: q ? "Locked after the first registration." : void 0,
304
+ children: /* @__PURE__ */ T("select", {
279
305
  id: "currency",
280
306
  className: i,
281
- value: B.currency,
282
- disabled: G,
283
- onChange: (e) => K("currency", e.target.value),
284
- children: [.../* @__PURE__ */ new Set([B.currency, ...D])].map((e) => /* @__PURE__ */ w("option", {
307
+ value: H.currency,
308
+ disabled: q,
309
+ onChange: (e) => J("currency", e.target.value),
310
+ children: [.../* @__PURE__ */ new Set([H.currency, ...O])].map((e) => /* @__PURE__ */ T("option", {
285
311
  value: e,
286
312
  children: e
287
313
  }, e))
@@ -289,77 +315,77 @@ function F() {
289
315
  })
290
316
  ]
291
317
  }),
292
- /* @__PURE__ */ T("div", {
318
+ /* @__PURE__ */ E("div", {
293
319
  className: "grid grid-cols-1 gap-5 sm:grid-cols-3",
294
320
  children: [
295
- /* @__PURE__ */ w(r, {
321
+ /* @__PURE__ */ T(r, {
296
322
  label: "Opens",
297
323
  htmlFor: "opensAt",
298
324
  hint: "Leave empty to open on publish.",
299
- children: /* @__PURE__ */ w("input", {
325
+ children: /* @__PURE__ */ T("input", {
300
326
  id: "opensAt",
301
327
  type: "datetime-local",
302
328
  className: i,
303
- value: B.opensAt,
304
- onChange: (e) => K("opensAt", e.target.value)
329
+ value: H.opensAt,
330
+ onChange: (e) => J("opensAt", e.target.value)
305
331
  })
306
332
  }),
307
- /* @__PURE__ */ w(r, {
333
+ /* @__PURE__ */ T(r, {
308
334
  label: "Closes",
309
335
  htmlFor: "closesAt",
310
336
  hint: "Leave empty to close manually.",
311
- children: /* @__PURE__ */ w("input", {
337
+ children: /* @__PURE__ */ T("input", {
312
338
  id: "closesAt",
313
339
  type: "datetime-local",
314
340
  className: i,
315
- value: B.closesAt,
316
- onChange: (e) => K("closesAt", e.target.value)
341
+ value: H.closesAt,
342
+ onChange: (e) => J("closesAt", e.target.value)
317
343
  })
318
344
  }),
319
- /* @__PURE__ */ w(r, {
345
+ /* @__PURE__ */ T(r, {
320
346
  label: "Capacity",
321
347
  htmlFor: "maxSubmissions",
322
348
  hint: "Maximum registrations.",
323
- children: /* @__PURE__ */ w("input", {
349
+ children: /* @__PURE__ */ T("input", {
324
350
  id: "maxSubmissions",
325
351
  inputMode: "numeric",
326
352
  className: i,
327
- value: B.maxSubmissions,
328
- onChange: (e) => K("maxSubmissions", e.target.value),
353
+ value: H.maxSubmissions,
354
+ onChange: (e) => J("maxSubmissions", e.target.value),
329
355
  placeholder: "Unlimited"
330
356
  })
331
357
  })
332
358
  ]
333
359
  }),
334
- !A && /* @__PURE__ */ w(r, {
360
+ !j && /* @__PURE__ */ T(r, {
335
361
  label: "Share-link name",
336
362
  htmlFor: "slug",
337
363
  hint: "Optional. Lowercase letters, digits and dashes. Generated from the title when empty.",
338
- children: /* @__PURE__ */ w("input", {
364
+ children: /* @__PURE__ */ T("input", {
339
365
  id: "slug",
340
366
  className: i,
341
- value: B.slug,
342
- onChange: (e) => K("slug", e.target.value),
367
+ value: H.slug,
368
+ onChange: (e) => J("slug", e.target.value),
343
369
  placeholder: "u12-boys-2026"
344
370
  })
345
371
  })
346
372
  ]
347
373
  }),
348
- /* @__PURE__ */ T("section", {
374
+ /* @__PURE__ */ E("section", {
349
375
  className: "space-y-3",
350
376
  "aria-labelledby": "builder-questions",
351
377
  children: [
352
- /* @__PURE__ */ T("div", {
378
+ /* @__PURE__ */ E("div", {
353
379
  className: "flex items-center justify-between",
354
- children: [/* @__PURE__ */ w("h2", {
380
+ children: [/* @__PURE__ */ T("h2", {
355
381
  id: "builder-questions",
356
382
  className: "text-base font-semibold text-text-primary",
357
383
  children: "Questions"
358
- }), /* @__PURE__ */ T("button", {
384
+ }), /* @__PURE__ */ E("button", {
359
385
  type: "button",
360
- disabled: G,
361
- onClick: () => K("questions", [...B.questions, {
362
- uid: O(),
386
+ disabled: q,
387
+ onClick: () => J("questions", [...H.questions, {
388
+ uid: k(),
363
389
  key: "",
364
390
  label: "",
365
391
  fieldType: "SHORT_TEXT",
@@ -368,107 +394,107 @@ function F() {
368
394
  helpText: ""
369
395
  }]),
370
396
  className: "inline-flex items-center gap-1.5 rounded-lg border border-border-seam px-3 py-1.5 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken disabled:opacity-50",
371
- children: [/* @__PURE__ */ w(b, { className: "h-4 w-4" }), " Add question"]
397
+ children: [/* @__PURE__ */ T(x, { className: "h-4 w-4" }), " Add question"]
372
398
  })]
373
399
  }),
374
- /* @__PURE__ */ T("p", {
400
+ /* @__PURE__ */ E("p", {
375
401
  className: "text-xs text-text-secondary",
376
- children: ["Participant name and contact details are always collected.", G && " Questions are locked because this form already has registrations."]
402
+ children: ["Participant name and contact details are always collected.", q && " Questions are locked because this form already has registrations."]
377
403
  }),
378
- B.questions.map((e, t) => /* @__PURE__ */ T("div", {
404
+ H.questions.map((e, t) => /* @__PURE__ */ E("div", {
379
405
  className: "space-y-3 rounded-lg border border-border-seam bg-bg-surface p-4",
380
406
  "data-testid": "builder-question",
381
407
  children: [
382
- /* @__PURE__ */ T("div", {
408
+ /* @__PURE__ */ E("div", {
383
409
  className: "grid grid-cols-1 gap-3 sm:grid-cols-[1fr_12rem]",
384
- children: [/* @__PURE__ */ w(r, {
410
+ children: [/* @__PURE__ */ T(r, {
385
411
  label: `Question ${t + 1}`,
386
412
  htmlFor: `q-label-${e.uid}`,
387
- children: /* @__PURE__ */ w("input", {
413
+ children: /* @__PURE__ */ T("input", {
388
414
  id: `q-label-${e.uid}`,
389
415
  className: i,
390
416
  value: e.label,
391
- disabled: G,
392
- onChange: (t) => q(e.uid, { label: t.target.value }),
417
+ disabled: q,
418
+ onChange: (t) => Y(e.uid, { label: t.target.value }),
393
419
  placeholder: "e.g. Date of birth"
394
420
  })
395
- }), /* @__PURE__ */ w(r, {
421
+ }), /* @__PURE__ */ T(r, {
396
422
  label: "Answer type",
397
423
  htmlFor: `q-type-${e.uid}`,
398
- children: /* @__PURE__ */ w("select", {
424
+ children: /* @__PURE__ */ T("select", {
399
425
  id: `q-type-${e.uid}`,
400
426
  className: i,
401
427
  value: e.fieldType,
402
- disabled: G,
403
- onChange: (t) => q(e.uid, { fieldType: t.target.value }),
404
- children: Object.keys(E).map((e) => /* @__PURE__ */ w("option", {
428
+ disabled: q,
429
+ onChange: (t) => Y(e.uid, { fieldType: t.target.value }),
430
+ children: Object.keys(D).map((e) => /* @__PURE__ */ T("option", {
405
431
  value: e,
406
- children: E[e]
432
+ children: D[e]
407
433
  }, e))
408
434
  })
409
435
  })]
410
436
  }),
411
- e.fieldType === "SELECT" && /* @__PURE__ */ w(r, {
437
+ e.fieldType === "SELECT" && /* @__PURE__ */ T(r, {
412
438
  label: "Options",
413
439
  htmlFor: `q-options-${e.uid}`,
414
440
  hint: "Comma-separated.",
415
- children: /* @__PURE__ */ w("input", {
441
+ children: /* @__PURE__ */ T("input", {
416
442
  id: `q-options-${e.uid}`,
417
443
  className: i,
418
444
  value: e.optionsText,
419
- disabled: G,
420
- onChange: (t) => q(e.uid, { optionsText: t.target.value }),
445
+ disabled: q,
446
+ onChange: (t) => Y(e.uid, { optionsText: t.target.value }),
421
447
  placeholder: "XS, S, M, L"
422
448
  })
423
449
  }),
424
- /* @__PURE__ */ w(r, {
450
+ /* @__PURE__ */ T(r, {
425
451
  label: "Help text",
426
452
  htmlFor: `q-help-${e.uid}`,
427
- children: /* @__PURE__ */ w("input", {
453
+ children: /* @__PURE__ */ T("input", {
428
454
  id: `q-help-${e.uid}`,
429
455
  className: i,
430
456
  value: e.helpText,
431
- disabled: G,
432
- onChange: (t) => q(e.uid, { helpText: t.target.value })
457
+ disabled: q,
458
+ onChange: (t) => Y(e.uid, { helpText: t.target.value })
433
459
  })
434
460
  }),
435
- /* @__PURE__ */ T("div", {
461
+ /* @__PURE__ */ E("div", {
436
462
  className: "flex flex-wrap items-center justify-between gap-3",
437
- children: [/* @__PURE__ */ T("label", {
463
+ children: [/* @__PURE__ */ E("label", {
438
464
  className: "flex items-center gap-2 text-sm text-text-primary",
439
- children: [/* @__PURE__ */ w("input", {
465
+ children: [/* @__PURE__ */ T("input", {
440
466
  type: "checkbox",
441
467
  checked: e.required,
442
- disabled: G,
443
- onChange: (t) => q(e.uid, { required: t.target.checked }),
468
+ disabled: q,
469
+ onChange: (t) => Y(e.uid, { required: t.target.checked }),
444
470
  className: "h-4 w-4 rounded border-border-seam text-action-primary-bg focus:ring-[var(--color-focus-ring)]"
445
471
  }), "Required"]
446
- }), /* @__PURE__ */ T("span", {
472
+ }), /* @__PURE__ */ E("span", {
447
473
  className: "flex gap-2",
448
474
  children: [
449
- /* @__PURE__ */ w("button", {
475
+ /* @__PURE__ */ T("button", {
450
476
  type: "button",
451
477
  "aria-label": "Move question up",
452
- className: P,
453
- disabled: G || t === 0,
454
- onClick: () => K("questions", N(B.questions, t, -1)),
455
- children: /* @__PURE__ */ w(v, { className: "h-4 w-4" })
478
+ className: F,
479
+ disabled: q || t === 0,
480
+ onClick: () => J("questions", P(H.questions, t, -1)),
481
+ children: /* @__PURE__ */ T(y, { className: "h-4 w-4" })
456
482
  }),
457
- /* @__PURE__ */ w("button", {
483
+ /* @__PURE__ */ T("button", {
458
484
  type: "button",
459
485
  "aria-label": "Move question down",
460
- className: P,
461
- disabled: G || t === B.questions.length - 1,
462
- onClick: () => K("questions", N(B.questions, t, 1)),
463
- children: /* @__PURE__ */ w(g, { className: "h-4 w-4" })
486
+ className: F,
487
+ disabled: q || t === H.questions.length - 1,
488
+ onClick: () => J("questions", P(H.questions, t, 1)),
489
+ children: /* @__PURE__ */ T(_, { className: "h-4 w-4" })
464
490
  }),
465
- /* @__PURE__ */ w("button", {
491
+ /* @__PURE__ */ T("button", {
466
492
  type: "button",
467
493
  "aria-label": "Remove question",
468
- className: P,
469
- disabled: G,
470
- onClick: () => K("questions", B.questions.filter((t) => t.uid !== e.uid)),
471
- children: /* @__PURE__ */ w(S, { className: "h-4 w-4" })
494
+ className: F,
495
+ disabled: q,
496
+ onClick: () => J("questions", H.questions.filter((t) => t.uid !== e.uid)),
497
+ children: /* @__PURE__ */ T(C, { className: "h-4 w-4" })
472
498
  })
473
499
  ]
474
500
  })]
@@ -477,126 +503,126 @@ function F() {
477
503
  }, e.uid))
478
504
  ]
479
505
  }),
480
- /* @__PURE__ */ T("section", {
506
+ /* @__PURE__ */ E("section", {
481
507
  className: "space-y-3",
482
508
  "aria-labelledby": "builder-fees",
483
509
  children: [
484
- /* @__PURE__ */ T("div", {
510
+ /* @__PURE__ */ E("div", {
485
511
  className: "flex items-center justify-between",
486
- children: [/* @__PURE__ */ w("h2", {
512
+ children: [/* @__PURE__ */ T("h2", {
487
513
  id: "builder-fees",
488
514
  className: "text-base font-semibold text-text-primary",
489
515
  children: "Fees"
490
- }), /* @__PURE__ */ T("button", {
516
+ }), /* @__PURE__ */ E("button", {
491
517
  type: "button",
492
- disabled: G,
493
- onClick: () => K("fees", [...B.fees, {
494
- uid: O(),
518
+ disabled: q,
519
+ onClick: () => J("fees", [...H.fees, {
520
+ uid: k(),
495
521
  name: "",
496
522
  amountText: "",
497
523
  feeType: "REQUIRED",
498
524
  description: ""
499
525
  }]),
500
526
  className: "inline-flex items-center gap-1.5 rounded-lg border border-border-seam px-3 py-1.5 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken disabled:opacity-50",
501
- children: [/* @__PURE__ */ w(b, { className: "h-4 w-4" }), " Add fee"]
527
+ children: [/* @__PURE__ */ T(x, { className: "h-4 w-4" }), " Add fee"]
502
528
  })]
503
529
  }),
504
- /* @__PURE__ */ w("p", {
530
+ /* @__PURE__ */ T("p", {
505
531
  className: "text-xs text-text-secondary",
506
532
  children: "Required fees are charged on every registration; optional ones (kit, tournament entry) are opt-in. Payments are recorded by the club office as they arrive."
507
533
  }),
508
- B.fees.map((e) => /* @__PURE__ */ T("div", {
534
+ H.fees.map((e) => /* @__PURE__ */ E("div", {
509
535
  className: "grid grid-cols-1 gap-3 rounded-lg border border-border-seam bg-bg-surface p-4 sm:grid-cols-[1fr_9rem_9rem_auto]",
510
536
  "data-testid": "builder-fee",
511
537
  children: [
512
- /* @__PURE__ */ w(r, {
538
+ /* @__PURE__ */ T(r, {
513
539
  label: "Fee name",
514
540
  htmlFor: `f-name-${e.uid}`,
515
- children: /* @__PURE__ */ w("input", {
541
+ children: /* @__PURE__ */ T("input", {
516
542
  id: `f-name-${e.uid}`,
517
543
  className: i,
518
544
  value: e.name,
519
- disabled: G,
520
- onChange: (t) => J(e.uid, { name: t.target.value }),
545
+ disabled: q,
546
+ onChange: (t) => X(e.uid, { name: t.target.value }),
521
547
  placeholder: "Membership"
522
548
  })
523
549
  }),
524
- /* @__PURE__ */ w(r, {
525
- label: `Amount (${B.currency})`,
550
+ /* @__PURE__ */ T(r, {
551
+ label: `Amount (${H.currency})`,
526
552
  htmlFor: `f-amount-${e.uid}`,
527
- children: /* @__PURE__ */ w("input", {
553
+ children: /* @__PURE__ */ T("input", {
528
554
  id: `f-amount-${e.uid}`,
529
555
  inputMode: "decimal",
530
556
  className: i,
531
557
  value: e.amountText,
532
- disabled: G,
533
- onChange: (t) => J(e.uid, { amountText: t.target.value }),
558
+ disabled: q,
559
+ onChange: (t) => X(e.uid, { amountText: t.target.value }),
534
560
  placeholder: "150.00"
535
561
  })
536
562
  }),
537
- /* @__PURE__ */ w(r, {
563
+ /* @__PURE__ */ T(r, {
538
564
  label: "Type",
539
565
  htmlFor: `f-type-${e.uid}`,
540
- children: /* @__PURE__ */ T("select", {
566
+ children: /* @__PURE__ */ E("select", {
541
567
  id: `f-type-${e.uid}`,
542
568
  className: i,
543
569
  value: e.feeType,
544
- disabled: G,
545
- onChange: (t) => J(e.uid, { feeType: t.target.value }),
546
- children: [/* @__PURE__ */ w("option", {
570
+ disabled: q,
571
+ onChange: (t) => X(e.uid, { feeType: t.target.value }),
572
+ children: [/* @__PURE__ */ T("option", {
547
573
  value: "REQUIRED",
548
574
  children: "Required"
549
- }), /* @__PURE__ */ w("option", {
575
+ }), /* @__PURE__ */ T("option", {
550
576
  value: "OPTIONAL",
551
577
  children: "Optional"
552
578
  })]
553
579
  })
554
580
  }),
555
- /* @__PURE__ */ w("div", {
581
+ /* @__PURE__ */ T("div", {
556
582
  className: "flex items-end",
557
- children: /* @__PURE__ */ w("button", {
583
+ children: /* @__PURE__ */ T("button", {
558
584
  type: "button",
559
585
  "aria-label": "Remove fee",
560
- className: P,
561
- disabled: G,
562
- onClick: () => K("fees", B.fees.filter((t) => t.uid !== e.uid)),
563
- children: /* @__PURE__ */ w(S, { className: "h-4 w-4" })
586
+ className: F,
587
+ disabled: q,
588
+ onClick: () => J("fees", H.fees.filter((t) => t.uid !== e.uid)),
589
+ children: /* @__PURE__ */ T(C, { className: "h-4 w-4" })
564
590
  })
565
591
  })
566
592
  ]
567
593
  }, e.uid))
568
594
  ]
569
595
  }),
570
- /* @__PURE__ */ w("section", { children: /* @__PURE__ */ w(r, {
596
+ /* @__PURE__ */ T("section", { children: /* @__PURE__ */ T(r, {
571
597
  label: "Waiver / consent",
572
598
  htmlFor: "waiverText",
573
599
  hint: "Optional. When set, registrants must accept it to submit.",
574
- children: /* @__PURE__ */ w("textarea", {
600
+ children: /* @__PURE__ */ T("textarea", {
575
601
  id: "waiverText",
576
602
  rows: 4,
577
603
  className: i,
578
- value: B.waiverText,
579
- onChange: (e) => K("waiverText", e.target.value)
604
+ value: H.waiverText,
605
+ onChange: (e) => J("waiverText", e.target.value)
580
606
  })
581
607
  }) }),
582
- H && /* @__PURE__ */ w("p", {
608
+ W && /* @__PURE__ */ T("p", {
583
609
  role: "alert",
584
610
  className: "text-sm text-status-error-text",
585
- children: H
611
+ children: W
586
612
  }),
587
- /* @__PURE__ */ w("div", {
613
+ /* @__PURE__ */ T("div", {
588
614
  className: "pt-2",
589
- children: /* @__PURE__ */ T("button", {
615
+ children: /* @__PURE__ */ E("button", {
590
616
  type: "submit",
591
- disabled: Z,
617
+ disabled: Q,
592
618
  className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90 disabled:opacity-60",
593
- children: [Z ? /* @__PURE__ */ w(y, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ w(x, { className: "h-4 w-4" }), A ? "Save changes" : "Create form"]
619
+ children: [Q ? /* @__PURE__ */ T(b, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ T(S, { className: "h-4 w-4" }), j ? "Save changes" : "Create form"]
594
620
  })
595
621
  })
596
622
  ]
597
623
  })
598
624
  });
599
625
  }
600
- export { F as RegistrationFormBuilderPage };
626
+ export { I as RegistrationFormBuilderPage };
601
627
 
602
628
  //# sourceMappingURL=RegistrationFormBuilderPage.js.map