@burdenoff/microfe-eventfullymanaged 2026.722.1 → 2026.728.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.
@@ -1,21 +1,23 @@
1
1
  import { notify as e } from "../../lib/toast.js";
2
- import { useAttendeesQuery as t, useCheckInRecordsQuery as n, useCheckInStationsQuery as r, useCreateCheckInRecordMutation as i, useCreateCheckInStationMutation as a, useDeleteCheckInRecordMutation as o, useDeleteCheckInStationMutation as s, useEventSessionsQuery as c, useEventsQuery as l, useUpdateCheckInRecordMutation as u, useUpdateCheckInStationMutation as d } from "../../api/eventApi.js";
3
- import { ActionMenu as f } from "../../components/ActionMenu.js";
4
- import { Pagination as p, usePagination as m } from "../../components/Pagination.js";
5
- import { describeError as h, mutationSucceeded as g } from "../../lib/mutationResult.js";
2
+ import { useAttendeesQuery as t, useCheckInRecordsQuery as n, useCheckInStationsQuery as r, useCreateCheckInRecordMutation as i, useCreateCheckInStationMutation as a, useDeleteCheckInRecordMutation as o, useDeleteCheckInStationMutation as s, useEventSessionsQuery as c, useEventsQuery as l, useScanCheckInMutation as u, useUpdateCheckInRecordMutation as d, useUpdateCheckInStationMutation as f } from "../../api/eventApi.js";
3
+ import { ActionMenu as p } from "../../components/ActionMenu.js";
4
+ import { Pagination as m, usePagination as h } from "../../components/Pagination.js";
5
+ import { describeError as g, mutationSucceeded as _ } from "../../lib/mutationResult.js";
6
6
  import "../../components/index.js";
7
- import { useCallback as _, useEffect as v, useMemo as y, useRef as b, useState as x } from "react";
8
- import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
9
- import { ArrowLeftFromLine as T, ArrowRightToLine as E, Camera as D, CameraOff as O, Keyboard as k, LogIn as A, Plus as j, QrCode as M, ScanLine as N } from "lucide-react";
10
- import { Badge as ee, Button as P, EmphasisPanel as te, GlassCard as F, GradientText as ne, IllustratedEmptyState as re, Input as I, Label as ie, PagePurpose as ae, ResponsiveDialog as L, ResponsiveDialogContent as R, ResponsiveDialogDescription as z, ResponsiveDialogFooter as B, ResponsiveDialogHeader as V, ResponsiveDialogTitle as H, ScrollArea as oe, Select as U, SelectContent as W, SelectItem as G, SelectTrigger as K, SelectValue as q, Switch as se } from "@burdenoff/fe-libs/ui";
7
+ import { enqueuePendingScan as v } from "../../lib/offlineCheckInQueue.js";
8
+ import { useOfflineCheckInSync as y } from "../../lib/useOfflineCheckInSync.js";
9
+ import { useCallback as b, useEffect as x, useMemo as S, useRef as C, useState as w } from "react";
10
+ import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
11
+ import { ArrowLeftFromLine as O, ArrowRightToLine as k, Camera as A, CameraOff as j, CloudOff as M, Keyboard as N, LogIn as ee, Plus as P, QrCode as te, RefreshCw as F, ScanLine as ne } from "lucide-react";
12
+ import { Badge as re, Button as I, EmphasisPanel as ie, GlassCard as L, GradientText as R, IllustratedEmptyState as z, Input as B, Label as V, PagePurpose as ae, ResponsiveDialog as H, ResponsiveDialogContent as U, ResponsiveDialogDescription as W, ResponsiveDialogFooter as G, ResponsiveDialogHeader as K, ResponsiveDialogTitle as q, ScrollArea as oe, Select as J, SelectContent as Y, SelectItem as X, SelectTrigger as Z, SelectValue as Q, Switch as se } from "@burdenoff/fe-libs/ui";
11
13
  //#region src/eventfullymanaged/pages/modules/KioskPage.tsx
12
- var ce = [
14
+ var ce = /^[^.\s]+\.[0-9a-f]{64}$/i, le = [
13
15
  "DESK",
14
16
  "GATE",
15
17
  "SELF_SERVICE",
16
18
  "MOBILE"
17
- ], J = ["QR", "MANUAL"], le = ["IN", "OUT"];
18
- function Y(e) {
19
+ ], ue = ["QR", "MANUAL"], de = ["IN", "OUT"];
20
+ function fe(e) {
19
21
  if (!e || typeof e != "object") return {};
20
22
  let t = e;
21
23
  return {
@@ -25,30 +27,30 @@ function Y(e) {
25
27
  isActive: typeof t.isActive == "boolean" ? t.isActive : void 0
26
28
  };
27
29
  }
28
- function X(e) {
30
+ function pe(e) {
29
31
  return e.trim().toUpperCase().replace(/[^A-Z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 24) || "STATION";
30
32
  }
31
- function ue(e) {
33
+ function me(e) {
32
34
  let t = e.trim().split(/\s+/).filter(Boolean);
33
35
  return t.length === 0 ? "?" : t.length === 1 ? t[0].slice(0, 2).toUpperCase() : (t[0][0] + t[t.length - 1][0]).toUpperCase();
34
36
  }
35
- function de(e) {
37
+ function he(e) {
36
38
  let t = new Date(e);
37
39
  return Number.isNaN(t.getTime()) ? "" : t.toLocaleTimeString([], {
38
40
  hour: "numeric",
39
41
  minute: "2-digit"
40
42
  });
41
43
  }
42
- function Z({ onDetected: e }) {
43
- let t = typeof window < "u" && !!window.BarcodeDetector, n = b(null), r = b(null), i = b(null), [a, o] = x(!1), [s, c] = x(null), l = _(() => {
44
+ function ge({ onDetected: e }) {
45
+ let t = typeof window < "u" && !!window.BarcodeDetector, n = C(null), r = C(null), i = C(null), [a, o] = w(!1), [s, c] = w(null), l = b(() => {
44
46
  if (i.current &&= (clearInterval(i.current), null), r.current) {
45
47
  for (let e of r.current.getTracks()) e.stop();
46
48
  r.current = null;
47
49
  }
48
50
  n.current && (n.current.srcObject = null), o(!1);
49
51
  }, []);
50
- v(() => l, [l]);
51
- let u = _(async () => {
52
+ x(() => l, [l]);
53
+ let u = b(async () => {
52
54
  if (!(!t || !window.BarcodeDetector)) {
53
55
  c(null);
54
56
  try {
@@ -76,63 +78,63 @@ function Z({ onDetected: e }) {
76
78
  l,
77
79
  t
78
80
  ]);
79
- return /* @__PURE__ */ w("div", {
81
+ return /* @__PURE__ */ D("div", {
80
82
  className: "relative aspect-square w-full overflow-hidden rounded-card border-2 border-accent-primary/70 bg-bg-sunken",
81
83
  children: [
82
- /* @__PURE__ */ C("video", {
84
+ /* @__PURE__ */ E("video", {
83
85
  ref: n,
84
86
  className: `h-full w-full object-cover transition-opacity duration-300 ${a ? "opacity-100" : "opacity-0"}`,
85
87
  muted: !0,
86
88
  playsInline: !0,
87
89
  "aria-label": "Attendee QR camera preview"
88
90
  }),
89
- /* @__PURE__ */ C("div", {
91
+ /* @__PURE__ */ E("div", {
90
92
  className: "pointer-events-none absolute inset-0 p-5",
91
- children: /* @__PURE__ */ w("div", {
93
+ children: /* @__PURE__ */ D("div", {
92
94
  className: "relative h-full w-full",
93
95
  children: [
94
- /* @__PURE__ */ C("span", { className: "absolute left-0 top-0 h-10 w-10 rounded-tl-lg border-l-4 border-t-4 border-accent-primary" }),
95
- /* @__PURE__ */ C("span", { className: "absolute right-0 top-0 h-10 w-10 rounded-tr-lg border-r-4 border-t-4 border-accent-primary" }),
96
- /* @__PURE__ */ C("span", { className: "absolute bottom-0 left-0 h-10 w-10 rounded-bl-lg border-b-4 border-l-4 border-accent-primary" }),
97
- /* @__PURE__ */ C("span", { className: "absolute bottom-0 right-0 h-10 w-10 rounded-br-lg border-b-4 border-r-4 border-accent-primary" }),
98
- a ? /* @__PURE__ */ C("span", { className: "absolute inset-x-6 top-1/2 h-0.5 animate-pulse bg-accent-primary/80" }) : null
96
+ /* @__PURE__ */ E("span", { className: "absolute left-0 top-0 h-10 w-10 rounded-tl-lg border-l-4 border-t-4 border-accent-primary" }),
97
+ /* @__PURE__ */ E("span", { className: "absolute right-0 top-0 h-10 w-10 rounded-tr-lg border-r-4 border-t-4 border-accent-primary" }),
98
+ /* @__PURE__ */ E("span", { className: "absolute bottom-0 left-0 h-10 w-10 rounded-bl-lg border-b-4 border-l-4 border-accent-primary" }),
99
+ /* @__PURE__ */ E("span", { className: "absolute bottom-0 right-0 h-10 w-10 rounded-br-lg border-b-4 border-r-4 border-accent-primary" }),
100
+ a ? /* @__PURE__ */ E("span", { className: "absolute inset-x-6 top-1/2 h-0.5 animate-pulse bg-accent-primary/80" }) : null
99
101
  ]
100
102
  })
101
103
  }),
102
- a ? /* @__PURE__ */ w("div", {
104
+ a ? /* @__PURE__ */ D("div", {
103
105
  className: "absolute inset-x-0 bottom-0 flex items-center justify-between gap-2 bg-bg-canvas/70 p-3 backdrop-blur",
104
- children: [/* @__PURE__ */ w("span", {
106
+ children: [/* @__PURE__ */ D("span", {
105
107
  className: "flex items-center gap-1.5 text-xs font-medium text-text-primary",
106
- children: [/* @__PURE__ */ C("span", { className: "h-2 w-2 animate-pulse rounded-full bg-status-success-text" }), "Scanning…"]
107
- }), /* @__PURE__ */ w(P, {
108
+ children: [/* @__PURE__ */ E("span", { className: "h-2 w-2 animate-pulse rounded-full bg-status-success-text" }), "Scanning…"]
109
+ }), /* @__PURE__ */ D(I, {
108
110
  type: "button",
109
111
  size: "sm",
110
112
  variant: "outline",
111
113
  onClick: l,
112
- children: [/* @__PURE__ */ C(O, { className: "h-4 w-4" }), "Stop"]
114
+ children: [/* @__PURE__ */ E(j, { className: "h-4 w-4" }), "Stop"]
113
115
  })]
114
- }) : /* @__PURE__ */ w("div", {
116
+ }) : /* @__PURE__ */ D("div", {
115
117
  className: "absolute inset-0 flex flex-col items-center justify-center gap-3 text-center",
116
118
  children: [
117
- /* @__PURE__ */ C(M, {
119
+ /* @__PURE__ */ E(te, {
118
120
  className: "h-16 w-16 text-text-muted",
119
121
  "aria-hidden": "true"
120
122
  }),
121
- /* @__PURE__ */ C("p", {
123
+ /* @__PURE__ */ E("p", {
122
124
  className: "text-lg font-semibold text-text-primary",
123
125
  children: "Scan attendee QR"
124
126
  }),
125
- t ? /* @__PURE__ */ w(P, {
127
+ t ? /* @__PURE__ */ D(I, {
126
128
  type: "button",
127
129
  size: "sm",
128
130
  variant: "secondary",
129
131
  onClick: () => void u(),
130
- children: [/* @__PURE__ */ C(D, { className: "h-4 w-4" }), "Start camera"]
131
- }) : /* @__PURE__ */ C("p", {
132
+ children: [/* @__PURE__ */ E(A, { className: "h-4 w-4" }), "Start camera"]
133
+ }) : /* @__PURE__ */ E("p", {
132
134
  className: "max-w-56 text-xs text-text-secondary",
133
135
  children: "Camera scanning isn't available in this browser — use manual lookup below."
134
136
  }),
135
- s ? /* @__PURE__ */ C("p", {
137
+ s ? /* @__PURE__ */ E("p", {
136
138
  className: "max-w-56 text-xs text-status-danger-text",
137
139
  children: s
138
140
  }) : null
@@ -141,31 +143,31 @@ function Z({ onDetected: e }) {
141
143
  ]
142
144
  });
143
145
  }
144
- function Q({ label: e, value: t, options: n, onChange: r }) {
145
- return /* @__PURE__ */ w("div", {
146
+ function $({ label: e, value: t, options: n, onChange: r }) {
147
+ return /* @__PURE__ */ D("div", {
146
148
  className: "space-y-1.5",
147
- children: [/* @__PURE__ */ C("span", {
149
+ children: [/* @__PURE__ */ E("span", {
148
150
  className: "text-xs font-medium uppercase tracking-wide text-text-secondary",
149
151
  children: e
150
- }), /* @__PURE__ */ C("div", {
152
+ }), /* @__PURE__ */ E("div", {
151
153
  role: "group",
152
154
  "aria-label": e,
153
155
  className: "inline-flex rounded-input border border-border-default bg-bg-sunken p-0.5",
154
156
  children: n.map((e) => {
155
157
  let n = e.icon, i = e.value === t;
156
- return /* @__PURE__ */ w("button", {
158
+ return /* @__PURE__ */ D("button", {
157
159
  type: "button",
158
160
  "aria-pressed": i,
159
161
  onClick: () => r(e.value),
160
162
  className: `inline-flex items-center gap-1.5 rounded-[calc(var(--radius-input)-2px)] px-3 py-1.5 text-sm font-medium transition-colors ${i ? "bg-action-primary-bg text-action-primary-text shadow-elevation-1" : "text-text-secondary hover:text-text-primary"}`,
161
- children: [n ? /* @__PURE__ */ C(n, { className: "h-4 w-4" }) : null, e.label]
163
+ children: [n ? /* @__PURE__ */ E(n, { className: "h-4 w-4" }) : null, e.label]
162
164
  }, e.value);
163
165
  })
164
166
  })]
165
167
  });
166
168
  }
167
- function fe({ open: t, onOpenChange: n, eventId: r, eventName: i, station: o }) {
168
- let s = !!o, [c, { loading: l }] = a(), [u, { loading: f }] = d(), p = y(() => {
169
+ function _e({ open: t, onOpenChange: n, eventId: r, eventName: i, station: o }) {
170
+ let s = !!o, [c, { loading: l }] = a(), [u, { loading: d }] = f(), p = S(() => {
169
171
  if (!o) return {
170
172
  name: "",
171
173
  code: "",
@@ -173,38 +175,38 @@ function fe({ open: t, onOpenChange: n, eventId: r, eventName: i, station: o })
173
175
  type: "DESK",
174
176
  isActive: !0
175
177
  };
176
- let e = Y(o.metadata);
178
+ let e = fe(o.metadata);
177
179
  return {
178
180
  name: o.name ?? "",
179
- code: e.code ?? X(o.name ?? ""),
181
+ code: e.code ?? pe(o.name ?? ""),
180
182
  location: e.location ?? "",
181
183
  type: e.type ?? "DESK",
182
184
  isActive: e.isActive ?? !0
183
185
  };
184
- }, [o]), [m, _] = x(p), [v, b] = x(null), S = `${t ? "open" : "closed"}:${o?.id ?? "new"}`;
185
- t && v !== S && (b(S), _(p)), !t && v !== null && b(null);
186
- let T = (e, t) => {
187
- _((n) => ({
186
+ }, [o]), [m, h] = w(p), [v, y] = w(null), b = `${t ? "open" : "closed"}:${o?.id ?? "new"}`;
187
+ t && v !== b && (y(b), h(p)), !t && v !== null && y(null);
188
+ let x = (e, t) => {
189
+ h((n) => ({
188
190
  ...n,
189
191
  [e]: t
190
192
  }));
191
- }, E = l || f;
192
- return /* @__PURE__ */ C(L, {
193
+ }, C = l || d;
194
+ return /* @__PURE__ */ E(H, {
193
195
  open: t,
194
196
  onOpenChange: n,
195
- children: /* @__PURE__ */ w(R, {
197
+ children: /* @__PURE__ */ D(U, {
196
198
  className: "max-w-lg",
197
199
  children: [
198
- /* @__PURE__ */ w(V, { children: [/* @__PURE__ */ C(H, { children: s ? "Edit check-in station" : "New check-in station" }), /* @__PURE__ */ w(z, { children: [
200
+ /* @__PURE__ */ D(K, { children: [/* @__PURE__ */ E(q, { children: s ? "Edit check-in station" : "New check-in station" }), /* @__PURE__ */ D(W, { children: [
199
201
  "A station is a desk, gate or device where attendees scan in at ",
200
202
  i,
201
203
  "."
202
204
  ] })] }),
203
- /* @__PURE__ */ w("form", {
205
+ /* @__PURE__ */ D("form", {
204
206
  id: "station-form",
205
207
  onSubmit: async (t) => {
206
208
  t.preventDefault();
207
- let a = m.code.trim() || X(m.name), l = {
209
+ let a = m.code.trim() || pe(m.name), l = {
208
210
  eventId: r,
209
211
  name: m.name.trim(),
210
212
  code: a,
@@ -224,132 +226,132 @@ function fe({ open: t, onOpenChange: n, eventId: r, eventName: i, station: o })
224
226
  id: o.id,
225
227
  input: l
226
228
  } });
227
- if (!g(t, t.data?.updateCheckInStation?.id, "Could not update station")) return;
229
+ if (!_(t, t.data?.updateCheckInStation?.id, "Could not update station")) return;
228
230
  e.success("Station updated", `“${l.name}” is now ${m.isActive ? "active" : "disabled"}.`);
229
231
  } else {
230
232
  let t = await c({ variables: { input: l } });
231
- if (!g(t, t.data?.createCheckInStation?.id, "Could not create station")) return;
233
+ if (!_(t, t.data?.createCheckInStation?.id, "Could not create station")) return;
232
234
  e.success("Station created", `“${l.name}” is ready at ${i}.`);
233
235
  }
234
236
  n(!1);
235
237
  } catch (t) {
236
- e.error("Could not save station", h(t));
238
+ e.error("Could not save station", g(t));
237
239
  }
238
240
  },
239
241
  className: "space-y-4",
240
242
  children: [
241
- /* @__PURE__ */ w("div", {
243
+ /* @__PURE__ */ D("div", {
242
244
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
243
- children: [/* @__PURE__ */ w("label", {
245
+ children: [/* @__PURE__ */ D("label", {
244
246
  className: "space-y-1 text-sm",
245
- children: [/* @__PURE__ */ C("span", {
247
+ children: [/* @__PURE__ */ E("span", {
246
248
  className: "font-medium text-text-primary",
247
249
  children: "Name"
248
- }), /* @__PURE__ */ C(I, {
250
+ }), /* @__PURE__ */ E(B, {
249
251
  value: m.name,
250
- onChange: (e) => T("name", e.target.value),
252
+ onChange: (e) => x("name", e.target.value),
251
253
  placeholder: "Main entrance",
252
254
  required: !0
253
255
  })]
254
- }), /* @__PURE__ */ w("label", {
256
+ }), /* @__PURE__ */ D("label", {
255
257
  className: "space-y-1 text-sm",
256
- children: [/* @__PURE__ */ C("span", {
258
+ children: [/* @__PURE__ */ E("span", {
257
259
  className: "font-medium text-text-primary",
258
260
  children: "Code"
259
- }), /* @__PURE__ */ C(I, {
261
+ }), /* @__PURE__ */ E(B, {
260
262
  value: m.code,
261
- onChange: (e) => T("code", e.target.value),
263
+ onChange: (e) => x("code", e.target.value),
262
264
  placeholder: "Auto from name"
263
265
  })]
264
266
  })]
265
267
  }),
266
- /* @__PURE__ */ w("div", {
268
+ /* @__PURE__ */ D("div", {
267
269
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
268
- children: [/* @__PURE__ */ w("label", {
270
+ children: [/* @__PURE__ */ D("label", {
269
271
  className: "space-y-1 text-sm",
270
- children: [/* @__PURE__ */ C("span", {
272
+ children: [/* @__PURE__ */ E("span", {
271
273
  className: "font-medium text-text-primary",
272
274
  children: "Location"
273
- }), /* @__PURE__ */ C(I, {
275
+ }), /* @__PURE__ */ E(B, {
274
276
  value: m.location,
275
- onChange: (e) => T("location", e.target.value),
277
+ onChange: (e) => x("location", e.target.value),
276
278
  placeholder: "North lobby"
277
279
  })]
278
- }), /* @__PURE__ */ w("label", {
280
+ }), /* @__PURE__ */ D("label", {
279
281
  className: "space-y-1 text-sm",
280
- children: [/* @__PURE__ */ C("span", {
282
+ children: [/* @__PURE__ */ E("span", {
281
283
  className: "font-medium text-text-primary",
282
284
  children: "Type"
283
- }), /* @__PURE__ */ w(U, {
285
+ }), /* @__PURE__ */ D(J, {
284
286
  value: m.type,
285
- onValueChange: (e) => T("type", e),
286
- children: [/* @__PURE__ */ C(K, {
287
+ onValueChange: (e) => x("type", e),
288
+ children: [/* @__PURE__ */ E(Z, {
287
289
  "aria-label": "Station type",
288
- children: /* @__PURE__ */ C(q, {})
289
- }), /* @__PURE__ */ C(W, { children: ce.map((e) => /* @__PURE__ */ C(G, {
290
+ children: /* @__PURE__ */ E(Q, {})
291
+ }), /* @__PURE__ */ E(Y, { children: le.map((e) => /* @__PURE__ */ E(X, {
290
292
  value: e,
291
293
  children: e.replace("_", " ")
292
294
  }, e)) })]
293
295
  })]
294
296
  })]
295
297
  }),
296
- /* @__PURE__ */ w("div", {
298
+ /* @__PURE__ */ D("div", {
297
299
  className: "flex items-center justify-between rounded-card border border-border-seam bg-bg-surface p-3",
298
- children: [/* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C(ie, {
300
+ children: [/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E(V, {
299
301
  htmlFor: "station-active",
300
302
  className: "text-text-primary",
301
303
  children: "Active"
302
- }), /* @__PURE__ */ C("p", {
304
+ }), /* @__PURE__ */ E("p", {
303
305
  className: "text-xs text-text-secondary",
304
306
  children: "Disabled stations stay configured but cannot accept scans."
305
- })] }), /* @__PURE__ */ C(se, {
307
+ })] }), /* @__PURE__ */ E(se, {
306
308
  id: "station-active",
307
309
  checked: m.isActive,
308
- onCheckedChange: (e) => T("isActive", e),
310
+ onCheckedChange: (e) => x("isActive", e),
309
311
  "aria-label": "Station active"
310
312
  })]
311
313
  })
312
314
  ]
313
315
  }),
314
- /* @__PURE__ */ w(B, { children: [/* @__PURE__ */ C(P, {
316
+ /* @__PURE__ */ D(G, { children: [/* @__PURE__ */ E(I, {
315
317
  type: "button",
316
318
  variant: "outline",
317
319
  onClick: () => n(!1),
318
- disabled: E,
320
+ disabled: C,
319
321
  children: "Cancel"
320
- }), /* @__PURE__ */ C(P, {
322
+ }), /* @__PURE__ */ E(I, {
321
323
  type: "submit",
322
324
  form: "station-form",
323
- disabled: E,
324
- children: E ? "Saving…" : s ? "Save station" : "Create station"
325
+ disabled: C,
326
+ children: C ? "Saving…" : s ? "Save station" : "Create station"
325
327
  })] })
326
328
  ]
327
329
  })
328
330
  });
329
331
  }
330
- function pe({ open: t, onOpenChange: n, record: r, stations: i }) {
331
- let [a, { loading: o }] = u(), s = y(() => ({
332
+ function ve({ open: t, onOpenChange: n, record: r, stations: i }) {
333
+ let [a, { loading: o }] = d(), s = S(() => ({
332
334
  method: r?.method ?? "MANUAL",
333
335
  direction: r?.direction ?? "IN",
334
336
  status: r?.status ?? "checked_in",
335
337
  stationId: r?.stationId ?? "",
336
338
  attendeeId: r?.attendeeId ?? ""
337
- }), [r]), [c, l] = x(s), [d, f] = x(null), p = `${t ? "open" : "closed"}:${r?.id ?? "none"}`;
338
- t && d !== p && (f(p), l(s)), !t && d !== null && f(null);
339
+ }), [r]), [c, l] = w(s), [u, f] = w(null), p = `${t ? "open" : "closed"}:${r?.id ?? "none"}`;
340
+ t && u !== p && (f(p), l(s)), !t && u !== null && f(null);
339
341
  let m = (e, t) => {
340
342
  l((n) => ({
341
343
  ...n,
342
344
  [e]: t
343
345
  }));
344
346
  };
345
- return /* @__PURE__ */ C(L, {
347
+ return /* @__PURE__ */ E(H, {
346
348
  open: t,
347
349
  onOpenChange: n,
348
- children: /* @__PURE__ */ w(R, {
350
+ children: /* @__PURE__ */ D(U, {
349
351
  className: "max-w-lg",
350
352
  children: [
351
- /* @__PURE__ */ w(V, { children: [/* @__PURE__ */ C(H, { children: "Edit check-in record" }), /* @__PURE__ */ C(z, { children: "Correct the direction, method or station for this scan." })] }),
352
- /* @__PURE__ */ w("form", {
353
+ /* @__PURE__ */ D(K, { children: [/* @__PURE__ */ E(q, { children: "Edit check-in record" }), /* @__PURE__ */ E(W, { children: "Correct the direction, method or station for this scan." })] }),
354
+ /* @__PURE__ */ D("form", {
353
355
  id: "record-form",
354
356
  onSubmit: async (t) => {
355
357
  if (t.preventDefault(), !r) return;
@@ -368,86 +370,86 @@ function pe({ open: t, onOpenChange: n, record: r, stations: i }) {
368
370
  id: r.id,
369
371
  input: i
370
372
  } });
371
- if (!g(t, t.data?.updateCheckInRecord?.id, "Could not update record")) return;
373
+ if (!_(t, t.data?.updateCheckInRecord?.id, "Could not update record")) return;
372
374
  e.success("Check-in updated"), n(!1);
373
375
  } catch (t) {
374
- e.error("Could not update record", h(t));
376
+ e.error("Could not update record", g(t));
375
377
  }
376
378
  },
377
379
  className: "space-y-4",
378
380
  children: [
379
- /* @__PURE__ */ w("label", {
381
+ /* @__PURE__ */ D("label", {
380
382
  className: "block space-y-1 text-sm",
381
- children: [/* @__PURE__ */ C("span", {
383
+ children: [/* @__PURE__ */ E("span", {
382
384
  className: "font-medium text-text-primary",
383
385
  children: "Attendee ID"
384
- }), /* @__PURE__ */ C(I, {
386
+ }), /* @__PURE__ */ E(B, {
385
387
  value: c.attendeeId,
386
388
  onChange: (e) => m("attendeeId", e.target.value)
387
389
  })]
388
390
  }),
389
- /* @__PURE__ */ w("div", {
391
+ /* @__PURE__ */ D("div", {
390
392
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
391
- children: [/* @__PURE__ */ w("label", {
393
+ children: [/* @__PURE__ */ D("label", {
392
394
  className: "space-y-1 text-sm",
393
- children: [/* @__PURE__ */ C("span", {
395
+ children: [/* @__PURE__ */ E("span", {
394
396
  className: "font-medium text-text-primary",
395
397
  children: "Method"
396
- }), /* @__PURE__ */ w(U, {
398
+ }), /* @__PURE__ */ D(J, {
397
399
  value: c.method,
398
400
  onValueChange: (e) => m("method", e),
399
- children: [/* @__PURE__ */ C(K, {
401
+ children: [/* @__PURE__ */ E(Z, {
400
402
  "aria-label": "Method",
401
- children: /* @__PURE__ */ C(q, {})
402
- }), /* @__PURE__ */ C(W, { children: J.map((e) => /* @__PURE__ */ C(G, {
403
+ children: /* @__PURE__ */ E(Q, {})
404
+ }), /* @__PURE__ */ E(Y, { children: ue.map((e) => /* @__PURE__ */ E(X, {
403
405
  value: e,
404
406
  children: e
405
407
  }, e)) })]
406
408
  })]
407
- }), /* @__PURE__ */ w("label", {
409
+ }), /* @__PURE__ */ D("label", {
408
410
  className: "space-y-1 text-sm",
409
- children: [/* @__PURE__ */ C("span", {
411
+ children: [/* @__PURE__ */ E("span", {
410
412
  className: "font-medium text-text-primary",
411
413
  children: "Direction"
412
- }), /* @__PURE__ */ w(U, {
414
+ }), /* @__PURE__ */ D(J, {
413
415
  value: c.direction,
414
416
  onValueChange: (e) => m("direction", e),
415
- children: [/* @__PURE__ */ C(K, {
417
+ children: [/* @__PURE__ */ E(Z, {
416
418
  "aria-label": "Direction",
417
- children: /* @__PURE__ */ C(q, {})
418
- }), /* @__PURE__ */ C(W, { children: le.map((e) => /* @__PURE__ */ C(G, {
419
+ children: /* @__PURE__ */ E(Q, {})
420
+ }), /* @__PURE__ */ E(Y, { children: de.map((e) => /* @__PURE__ */ E(X, {
419
421
  value: e,
420
422
  children: e
421
423
  }, e)) })]
422
424
  })]
423
425
  })]
424
426
  }),
425
- /* @__PURE__ */ w("div", {
427
+ /* @__PURE__ */ D("div", {
426
428
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
427
- children: [/* @__PURE__ */ w("label", {
429
+ children: [/* @__PURE__ */ D("label", {
428
430
  className: "space-y-1 text-sm",
429
- children: [/* @__PURE__ */ C("span", {
431
+ children: [/* @__PURE__ */ E("span", {
430
432
  className: "font-medium text-text-primary",
431
433
  children: "Status"
432
- }), /* @__PURE__ */ C(I, {
434
+ }), /* @__PURE__ */ E(B, {
433
435
  value: c.status,
434
436
  onChange: (e) => m("status", e.target.value)
435
437
  })]
436
- }), /* @__PURE__ */ w("label", {
438
+ }), /* @__PURE__ */ D("label", {
437
439
  className: "space-y-1 text-sm",
438
- children: [/* @__PURE__ */ C("span", {
440
+ children: [/* @__PURE__ */ E("span", {
439
441
  className: "font-medium text-text-primary",
440
442
  children: "Station"
441
- }), /* @__PURE__ */ w(U, {
443
+ }), /* @__PURE__ */ D(J, {
442
444
  value: c.stationId || "none",
443
445
  onValueChange: (e) => m("stationId", e === "none" ? "" : e),
444
- children: [/* @__PURE__ */ C(K, {
446
+ children: [/* @__PURE__ */ E(Z, {
445
447
  "aria-label": "Station",
446
- children: /* @__PURE__ */ C(q, {})
447
- }), /* @__PURE__ */ w(W, { children: [/* @__PURE__ */ C(G, {
448
+ children: /* @__PURE__ */ E(Q, {})
449
+ }), /* @__PURE__ */ D(Y, { children: [/* @__PURE__ */ E(X, {
448
450
  value: "none",
449
451
  children: "No station"
450
- }), i.map((e) => /* @__PURE__ */ C(G, {
452
+ }), i.map((e) => /* @__PURE__ */ E(X, {
451
453
  value: e.id,
452
454
  children: e.name ?? e.id
453
455
  }, e.id))] })]
@@ -456,13 +458,13 @@ function pe({ open: t, onOpenChange: n, record: r, stations: i }) {
456
458
  })
457
459
  ]
458
460
  }),
459
- /* @__PURE__ */ w(B, { children: [/* @__PURE__ */ C(P, {
461
+ /* @__PURE__ */ D(G, { children: [/* @__PURE__ */ E(I, {
460
462
  type: "button",
461
463
  variant: "outline",
462
464
  onClick: () => n(!1),
463
465
  disabled: o,
464
466
  children: "Cancel"
465
- }), /* @__PURE__ */ C(P, {
467
+ }), /* @__PURE__ */ E(I, {
466
468
  type: "submit",
467
469
  form: "record-form",
468
470
  disabled: o,
@@ -472,12 +474,12 @@ function pe({ open: t, onOpenChange: n, record: r, stations: i }) {
472
474
  })
473
475
  });
474
476
  }
475
- function me({ eventId: t, eventName: n, stations: r, attendees: a, activeStationId: o, onStationChange: s, onCheckedIn: l }) {
476
- let [u, d] = x(""), [f, p] = x("QR"), [m, _] = x("IN"), [v, y] = x(""), S = b(null), [D, { loading: O }] = i(), j = c({
477
+ function ye({ eventId: t, eventName: n, stations: r, attendees: a, activeStationId: o, onStationChange: s, onCheckedIn: l }) {
478
+ let [d, f] = w(""), [p, m] = w("QR"), [h, b] = w("IN"), [x, S] = w(""), T = C(null), [A, { loading: j }] = i(), [P] = u(), ie = c({
477
479
  eventId: t,
478
480
  limit: 100,
479
481
  offset: 0
480
- }).data?.eventSessions.items ?? [], ee = (e) => {
482
+ }).data?.eventSessions.items ?? [], { isOnline: R, pendingCount: z, syncNow: V } = y(P, l), ae = (e) => {
481
483
  let t = e.trim();
482
484
  if (!t) return {
483
485
  attendeeId: null,
@@ -498,147 +500,215 @@ function me({ eventId: t, eventName: n, stations: r, attendees: a, activeStation
498
500
  label: n?.fullName ?? `attendee ${t}`,
499
501
  matched: !!n
500
502
  };
503
+ }, H = (t) => {
504
+ f(t), m("QR"), e.info("QR captured", "Confirm the details and tap Check in."), T.current?.focus();
505
+ }, U = async (t) => {
506
+ let n = crypto.randomUUID(), i = (/* @__PURE__ */ new Date()).toISOString(), a = {
507
+ clientScanId: n,
508
+ token: t,
509
+ stationId: o || null,
510
+ sessionId: x || null,
511
+ method: "QR",
512
+ direction: h,
513
+ scannedAt: i
514
+ }, s = async (t) => {
515
+ await v(a), e.success("Saved on this device", t), f(""), T.current?.focus();
516
+ };
517
+ if (typeof navigator < "u" && !navigator.onLine) {
518
+ await s("No connection right now — this check-in will sync automatically once you're back online.");
519
+ return;
520
+ }
521
+ try {
522
+ let a = await P({ variables: { input: {
523
+ token: t,
524
+ stationId: o || null,
525
+ sessionId: x || null,
526
+ method: "QR",
527
+ direction: h,
528
+ recordedAt: i,
529
+ clientScanId: n
530
+ } } });
531
+ if (a.error) {
532
+ e.error("Could not record check-in", a.error.message);
533
+ return;
534
+ }
535
+ if (!a.data?.scanCheckIn?.id) {
536
+ e.error("Could not record check-in", "The server did not confirm the change.");
537
+ return;
538
+ }
539
+ let s = r.find((e) => e.id === o);
540
+ e.success(`Checked ${h === "OUT" ? "out" : "in"}`, `Recorded via QR${s?.name ? ` • ${s.name}` : ""}.`), f(""), T.current?.focus(), l();
541
+ } catch {
542
+ await s("Connection dropped — this check-in will sync automatically once you're back online.");
543
+ }
501
544
  };
502
- return /* @__PURE__ */ w(F, {
545
+ return /* @__PURE__ */ D(L, {
503
546
  treatment: "glass",
504
547
  glow: !0,
505
548
  className: "border-border-seam p-5 sm:p-6",
506
549
  children: [
507
- /* @__PURE__ */ w("div", {
508
- className: "flex items-center gap-2",
509
- children: [/* @__PURE__ */ C(N, {
510
- className: "h-5 w-5 text-accent-primary",
511
- "aria-hidden": "true"
512
- }), /* @__PURE__ */ C("h2", {
513
- className: "text-lg font-semibold text-text-primary",
514
- children: "Kiosk mode"
515
- })]
550
+ /* @__PURE__ */ D("div", {
551
+ className: "flex items-center justify-between gap-2",
552
+ children: [/* @__PURE__ */ D("div", {
553
+ className: "flex items-center gap-2",
554
+ children: [/* @__PURE__ */ E(ne, {
555
+ className: "h-5 w-5 text-accent-primary",
556
+ "aria-hidden": "true"
557
+ }), /* @__PURE__ */ E("h2", {
558
+ className: "text-lg font-semibold text-text-primary",
559
+ children: "Kiosk mode"
560
+ })]
561
+ }), !R || z > 0 ? /* @__PURE__ */ D("div", {
562
+ className: "flex items-center gap-2",
563
+ children: [/* @__PURE__ */ D(re, {
564
+ variant: R ? "secondary" : "destructive",
565
+ className: "flex items-center gap-1",
566
+ children: [
567
+ /* @__PURE__ */ E(M, {
568
+ className: "h-3 w-3",
569
+ "aria-hidden": "true"
570
+ }),
571
+ R ? "Syncing…" : "Offline",
572
+ z > 0 ? ` · ${z} queued` : ""
573
+ ]
574
+ }), R && z > 0 ? /* @__PURE__ */ D(I, {
575
+ type: "button",
576
+ size: "sm",
577
+ variant: "outline",
578
+ onClick: V,
579
+ children: [/* @__PURE__ */ E(F, { className: "h-3.5 w-3.5" }), "Sync now"]
580
+ }) : null]
581
+ }) : null]
516
582
  }),
517
- /* @__PURE__ */ w("p", {
583
+ /* @__PURE__ */ D("p", {
518
584
  className: "mt-1 text-sm text-text-secondary",
519
585
  children: [
520
586
  "Scan an attendee badge or look them up, set the direction, and check them into ",
521
587
  n,
522
- "."
588
+ ".",
589
+ z > 0 ? " Scans queue on this device and sync automatically once you have a connection." : ""
523
590
  ]
524
591
  }),
525
- /* @__PURE__ */ C("div", {
592
+ /* @__PURE__ */ E("div", {
526
593
  className: "mt-5",
527
- children: /* @__PURE__ */ C(Z, { onDetected: (t) => {
528
- d(t), p("QR"), e.info("QR captured", "Confirm the details and tap Check in."), S.current?.focus();
529
- } })
594
+ children: /* @__PURE__ */ E(ge, { onDetected: H })
530
595
  }),
531
- /* @__PURE__ */ w("form", {
596
+ /* @__PURE__ */ D("form", {
532
597
  onSubmit: async (n) => {
533
598
  n.preventDefault();
534
- let { attendeeId: i, label: a } = ee(u);
535
- if (u.trim().includes("@") && !i) {
536
- e.error("Attendee not found", `No attendee at this event matches “${u.trim()}”.`);
599
+ let i = d.trim();
600
+ if (p === "QR" && ce.test(i)) {
601
+ await U(i);
537
602
  return;
538
603
  }
539
- let s = {
604
+ let { attendeeId: a, label: s } = ae(d);
605
+ if (d.trim().includes("@") && !a) {
606
+ e.error("Attendee not found", `No attendee at this event matches “${d.trim()}”.`);
607
+ return;
608
+ }
609
+ let c = {
540
610
  eventId: t,
541
- attendeeId: i,
611
+ attendeeId: a,
542
612
  stationId: o || null,
543
- method: f,
544
- direction: m,
545
- status: m === "OUT" ? "checked_out" : "checked_in",
613
+ method: p,
614
+ direction: h,
615
+ status: h === "OUT" ? "checked_out" : "checked_in",
546
616
  recordedAt: (/* @__PURE__ */ new Date()).toISOString(),
547
- metadata: v ? { sessionId: v } : {}
617
+ metadata: x ? { sessionId: x } : {}
548
618
  };
549
619
  try {
550
- let t = await D({ variables: { input: s } });
551
- if (!g(t, t.data?.createCheckInRecord?.id, "Could not record check-in")) return;
620
+ let t = await A({ variables: { input: c } });
621
+ if (!_(t, t.data?.createCheckInRecord?.id, "Could not record check-in")) return;
552
622
  let n = r.find((e) => e.id === o);
553
- e.success(`${a} checked ${m === "OUT" ? "out" : "in"}`, `Recorded via ${f}${n?.name ? ` • ${n.name}` : ""}.`), d(""), S.current?.focus(), l();
623
+ e.success(`${s} checked ${h === "OUT" ? "out" : "in"}`, `Recorded via ${p}${n?.name ? ` • ${n.name}` : ""}.`), f(""), T.current?.focus(), l();
554
624
  } catch (t) {
555
- e.error("Could not record check-in", h(t));
625
+ e.error("Could not record check-in", g(t));
556
626
  }
557
627
  },
558
628
  className: "mt-5 space-y-5",
559
629
  children: [
560
- /* @__PURE__ */ w("label", {
630
+ /* @__PURE__ */ D("label", {
561
631
  className: "block space-y-1.5",
562
- children: [/* @__PURE__ */ w("span", {
632
+ children: [/* @__PURE__ */ D("span", {
563
633
  className: "flex items-center gap-1.5 text-xs font-medium uppercase tracking-wide text-text-secondary",
564
- children: [/* @__PURE__ */ C(k, { className: "h-3.5 w-3.5" }), "Manual lookup"]
565
- }), /* @__PURE__ */ C(I, {
566
- ref: S,
567
- value: u,
568
- onChange: (e) => d(e.target.value),
634
+ children: [/* @__PURE__ */ E(N, { className: "h-3.5 w-3.5" }), "Manual lookup"]
635
+ }), /* @__PURE__ */ E(B, {
636
+ ref: T,
637
+ value: d,
638
+ onChange: (e) => f(e.target.value),
569
639
  placeholder: "Enter name, email or attendee ID",
570
640
  autoComplete: "off",
571
641
  className: "h-12 text-base"
572
642
  })]
573
643
  }),
574
- /* @__PURE__ */ w("div", {
644
+ /* @__PURE__ */ D("div", {
575
645
  className: "flex flex-wrap gap-5",
576
646
  children: [
577
- /* @__PURE__ */ C(Q, {
647
+ /* @__PURE__ */ E($, {
578
648
  label: "Method",
579
- value: f,
580
- onChange: p,
649
+ value: p,
650
+ onChange: m,
581
651
  options: [{
582
652
  value: "QR",
583
653
  label: "QR",
584
- icon: M
654
+ icon: te
585
655
  }, {
586
656
  value: "MANUAL",
587
657
  label: "Manual",
588
- icon: k
658
+ icon: N
589
659
  }]
590
660
  }),
591
- /* @__PURE__ */ C(Q, {
661
+ /* @__PURE__ */ E($, {
592
662
  label: "Direction",
593
- value: m,
594
- onChange: _,
663
+ value: h,
664
+ onChange: b,
595
665
  options: [{
596
666
  value: "IN",
597
667
  label: "In",
598
- icon: E
668
+ icon: k
599
669
  }, {
600
670
  value: "OUT",
601
671
  label: "Out",
602
- icon: T
672
+ icon: O
603
673
  }]
604
674
  }),
605
- /* @__PURE__ */ w("label", {
675
+ /* @__PURE__ */ D("label", {
606
676
  className: "space-y-1.5",
607
- children: [/* @__PURE__ */ C("span", {
677
+ children: [/* @__PURE__ */ E("span", {
608
678
  className: "text-xs font-medium uppercase tracking-wide text-text-secondary",
609
679
  children: "Station"
610
- }), /* @__PURE__ */ w(U, {
680
+ }), /* @__PURE__ */ D(J, {
611
681
  value: o || "none",
612
682
  onValueChange: (e) => s(e === "none" ? "" : e),
613
- children: [/* @__PURE__ */ C(K, {
683
+ children: [/* @__PURE__ */ E(Z, {
614
684
  "aria-label": "Station",
615
685
  className: "min-w-40",
616
- children: /* @__PURE__ */ C(q, { placeholder: "No station" })
617
- }), /* @__PURE__ */ w(W, { children: [/* @__PURE__ */ C(G, {
686
+ children: /* @__PURE__ */ E(Q, { placeholder: "No station" })
687
+ }), /* @__PURE__ */ D(Y, { children: [/* @__PURE__ */ E(X, {
618
688
  value: "none",
619
689
  children: "No station"
620
- }), r.map((e) => /* @__PURE__ */ C(G, {
690
+ }), r.map((e) => /* @__PURE__ */ E(X, {
621
691
  value: e.id,
622
692
  children: e.name ?? e.id
623
693
  }, e.id))] })]
624
694
  })]
625
695
  }),
626
- /* @__PURE__ */ w("label", {
696
+ /* @__PURE__ */ D("label", {
627
697
  className: "space-y-1.5",
628
- children: [/* @__PURE__ */ C("span", {
698
+ children: [/* @__PURE__ */ E("span", {
629
699
  className: "text-xs font-medium uppercase tracking-wide text-text-secondary",
630
700
  children: "Session"
631
- }), /* @__PURE__ */ w(U, {
632
- value: v || "none",
633
- onValueChange: (e) => y(e === "none" ? "" : e),
634
- children: [/* @__PURE__ */ C(K, {
701
+ }), /* @__PURE__ */ D(J, {
702
+ value: x || "none",
703
+ onValueChange: (e) => S(e === "none" ? "" : e),
704
+ children: [/* @__PURE__ */ E(Z, {
635
705
  "aria-label": "Session",
636
706
  className: "min-w-40",
637
- children: /* @__PURE__ */ C(q, { placeholder: "Whole event" })
638
- }), /* @__PURE__ */ w(W, { children: [/* @__PURE__ */ C(G, {
707
+ children: /* @__PURE__ */ E(Q, { placeholder: "Whole event" })
708
+ }), /* @__PURE__ */ D(Y, { children: [/* @__PURE__ */ E(X, {
639
709
  value: "none",
640
710
  children: "Whole event"
641
- }), j.map((e) => /* @__PURE__ */ C(G, {
711
+ }), ie.map((e) => /* @__PURE__ */ E(X, {
642
712
  value: e.id,
643
713
  children: e.title
644
714
  }, e.id))] })]
@@ -646,52 +716,52 @@ function me({ eventId: t, eventName: n, stations: r, attendees: a, activeStation
646
716
  })
647
717
  ]
648
718
  }),
649
- /* @__PURE__ */ w(P, {
719
+ /* @__PURE__ */ D(I, {
650
720
  type: "submit",
651
721
  size: "lg",
652
- disabled: O || !u.trim(),
722
+ disabled: j || !d.trim(),
653
723
  className: "h-12 w-full text-base",
654
- children: [/* @__PURE__ */ C(A, { className: "h-5 w-5" }), O ? "Recording…" : `Check ${m === "OUT" ? "out" : "in"}`]
724
+ children: [/* @__PURE__ */ E(ee, { className: "h-5 w-5" }), j ? "Recording…" : `Check ${h === "OUT" ? "out" : "in"}`]
655
725
  })
656
726
  ]
657
727
  })
658
728
  ]
659
729
  });
660
730
  }
661
- var he = 10, ge = 500;
662
- function _e() {
731
+ var be = 10, xe = 500;
732
+ function Se() {
663
733
  let i = l({
664
734
  limit: 100,
665
735
  offset: 0
666
- }).data?.events.items ?? [], [a, c] = x(""), u = a || void 0, d = i.find((e) => e.id === a), [h, _] = x(""), v = m({
667
- pageSize: he,
736
+ }).data?.events.items ?? [], [a, c] = w(""), u = a || void 0, d = i.find((e) => e.id === a), [f, g] = w(""), v = h({
737
+ pageSize: be,
668
738
  resetKey: a
669
- }), b = r({
739
+ }), y = r({
670
740
  eventId: u,
671
741
  limit: 100,
672
742
  offset: 0
673
- }), T = n({
743
+ }), b = n({
674
744
  eventId: u,
675
745
  limit: v.limit,
676
746
  offset: v.offset
677
- }), E = n({
747
+ }), x = n({
678
748
  eventId: u,
679
- limit: ge,
749
+ limit: xe,
680
750
  offset: 0
681
- }), D = t({
751
+ }), C = t({
682
752
  eventId: u,
683
753
  limit: 200,
684
754
  offset: 0
685
- }), O = y(() => b.data?.checkInStations.items ?? [], [b.data]), k = T.data?.checkInRecords.items ?? [], A = T.data?.checkInRecords.total ?? 0, M = y(() => E.data?.checkInRecords.items ?? [], [E.data]), N = y(() => D.data?.attendees.items ?? [], [D.data]), I = D.data?.attendees.total ?? 0, ie = y(() => {
755
+ }), O = S(() => y.data?.checkInStations.items ?? [], [y.data]), k = b.data?.checkInRecords.items ?? [], A = b.data?.checkInRecords.total ?? 0, j = S(() => x.data?.checkInRecords.items ?? [], [x.data]), M = S(() => C.data?.attendees.items ?? [], [C.data]), N = C.data?.attendees.total ?? 0, ee = S(() => {
686
756
  let e = /* @__PURE__ */ new Map();
687
- for (let t of N) e.set(t.id, t.fullName);
757
+ for (let t of M) e.set(t.id, t.fullName);
688
758
  return e;
689
- }, [N]), L = y(() => {
759
+ }, [M]), te = S(() => {
690
760
  let e = /* @__PURE__ */ new Map();
691
761
  for (let t of O) e.set(t.id, t.name ?? t.id);
692
762
  return e;
693
- }, [O]), { checkedInCount: R, stationCounts: z } = y(() => {
694
- let e = /* @__PURE__ */ new Set(), t = { count: 0 }, n = /* @__PURE__ */ new Map(), r = [...M].sort((e, t) => new Date(e.recordedAt).getTime() - new Date(t.recordedAt).getTime());
763
+ }, [O]), { checkedInCount: F, stationCounts: ne } = S(() => {
764
+ let e = /* @__PURE__ */ new Set(), t = { count: 0 }, n = /* @__PURE__ */ new Map(), r = [...j].sort((e, t) => new Date(e.recordedAt).getTime() - new Date(t.recordedAt).getTime());
695
765
  for (let i of r) {
696
766
  let r = i.attendeeId ?? "";
697
767
  if (i.direction === "OUT" ? r ? e.delete(r) : t.count > 0 && --t.count : r ? e.add(r) : t.count += 1, i.stationId && i.direction !== "OUT") {
@@ -705,138 +775,138 @@ function _e() {
705
775
  checkedInCount: e.size + t.count,
706
776
  stationCounts: i
707
777
  };
708
- }, [M]), B = I, V = B > 0 ? Math.min(100, Math.round(R / B * 100)) : 0, [H] = s(), [se] = o(), [ce, J] = x(!1), [le, Y] = x(void 0), [X, Z] = x(!1), [Q, _e] = x(null), $ = () => {
709
- Y(void 0), J(!0);
710
- }, ve = (e) => {
711
- Y(e), J(!0);
712
- }, ye = (e) => {
713
- _e(e), Z(!0);
714
- }, be = async (t) => {
778
+ }, [j]), B = N, V = B > 0 ? Math.min(100, Math.round(F / B * 100)) : 0, [H] = s(), [U] = o(), [W, G] = w(!1), [K, q] = w(void 0), [se, ce] = w(!1), [le, ue] = w(null), de = () => {
779
+ q(void 0), G(!0);
780
+ }, fe = (e) => {
781
+ q(e), G(!0);
782
+ }, pe = (e) => {
783
+ ue(e), ce(!0);
784
+ }, ge = async (t) => {
715
785
  let n = await H({ variables: { id: t.id } });
716
- g(n, n.data?.deleteCheckInStation ? t.id : null, "Could not delete station") && (h === t.id && _(""), e.success("Station deleted", `“${t.name ?? t.id}” was removed.`));
717
- }, xe = async (t) => {
718
- let n = await se({ variables: { id: t.id } });
719
- g(n, n.data?.deleteCheckInRecord ? t.id : null, "Could not delete record") && e.success("Check-in record deleted");
786
+ _(n, n.data?.deleteCheckInStation ? t.id : null, "Could not delete station") && (f === t.id && g(""), e.success("Station deleted", `“${t.name ?? t.id}” was removed.`));
787
+ }, $ = async (t) => {
788
+ let n = await U({ variables: { id: t.id } });
789
+ _(n, n.data?.deleteCheckInRecord ? t.id : null, "Could not delete record") && e.success("Check-in record deleted");
720
790
  }, Se = () => {
721
- T.refetch(), E.refetch();
722
- }, Ce = (e) => e.attendeeId ? ie.get(e.attendeeId) ?? `Attendee ${e.attendeeId.slice(0, 8)}` : "Walk-in guest", we = !!a;
723
- return /* @__PURE__ */ w("div", {
791
+ b.refetch(), x.refetch();
792
+ }, Ce = (e) => e.attendeeId ? ee.get(e.attendeeId) ?? `Attendee ${e.attendeeId.slice(0, 8)}` : "Walk-in guest", we = !!a;
793
+ return /* @__PURE__ */ D("div", {
724
794
  className: "space-y-6 p-6",
725
795
  children: [
726
- /* @__PURE__ */ C(ae, { children: "Kiosks are the front desk of your event. Each check-in station is a device or counter where attendees scan in, and check-in records are the live log of who arrived and when. Configure your stations before doors open, then check attendees in from this page and watch arrivals flow in on the day." }),
727
- /* @__PURE__ */ C(te, { children: /* @__PURE__ */ w("div", {
796
+ /* @__PURE__ */ E(ae, { children: "Kiosks are the front desk of your event. Each check-in station is a device or counter where attendees scan in, and check-in records are the live log of who arrived and when. Configure your stations before doors open, then check attendees in from this page and watch arrivals flow in on the day." }),
797
+ /* @__PURE__ */ E(ie, { children: /* @__PURE__ */ D("div", {
728
798
  className: "flex flex-wrap items-start justify-between gap-4",
729
- children: [/* @__PURE__ */ w("div", { children: [/* @__PURE__ */ w("h1", {
799
+ children: [/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ D("h1", {
730
800
  className: "text-2xl font-bold text-text-primary",
731
- children: [/* @__PURE__ */ C(ne, { children: "Kiosk" }), " & Check-In"]
732
- }), /* @__PURE__ */ C("p", {
801
+ children: [/* @__PURE__ */ E(R, { children: "Kiosk" }), " & Check-In"]
802
+ }), /* @__PURE__ */ E("p", {
733
803
  className: "mt-1 text-sm text-text-secondary",
734
804
  children: "Manage check-in stations and record attendee arrivals against a live backend."
735
- })] }), /* @__PURE__ */ w("div", {
805
+ })] }), /* @__PURE__ */ D("div", {
736
806
  className: "flex flex-wrap items-end gap-3",
737
- children: [/* @__PURE__ */ w("label", {
807
+ children: [/* @__PURE__ */ D("label", {
738
808
  className: "space-y-1 text-sm",
739
- children: [/* @__PURE__ */ C("span", {
809
+ children: [/* @__PURE__ */ E("span", {
740
810
  className: "font-medium text-text-primary",
741
811
  children: "Event"
742
- }), /* @__PURE__ */ w(U, {
812
+ }), /* @__PURE__ */ D(J, {
743
813
  value: a || "all",
744
814
  onValueChange: (e) => c(e === "all" ? "" : e),
745
- children: [/* @__PURE__ */ C(K, {
815
+ children: [/* @__PURE__ */ E(Z, {
746
816
  "aria-label": "Event",
747
817
  className: "min-w-52",
748
- children: /* @__PURE__ */ C(q, { placeholder: "All events" })
749
- }), /* @__PURE__ */ w(W, { children: [/* @__PURE__ */ C(G, {
818
+ children: /* @__PURE__ */ E(Q, { placeholder: "All events" })
819
+ }), /* @__PURE__ */ D(Y, { children: [/* @__PURE__ */ E(X, {
750
820
  value: "all",
751
821
  children: "All events"
752
- }), i.map((e) => /* @__PURE__ */ C(G, {
822
+ }), i.map((e) => /* @__PURE__ */ E(X, {
753
823
  value: e.id,
754
824
  children: e.name
755
825
  }, e.id))] })]
756
826
  })]
757
- }), /* @__PURE__ */ w(P, {
827
+ }), /* @__PURE__ */ D(I, {
758
828
  type: "button",
759
- onClick: $,
829
+ onClick: de,
760
830
  disabled: !we,
761
- children: [/* @__PURE__ */ C(j, { className: "h-4 w-4" }), "New station"]
831
+ children: [/* @__PURE__ */ E(P, { className: "h-4 w-4" }), "New station"]
762
832
  })]
763
833
  })]
764
834
  }) }),
765
- we ? /* @__PURE__ */ w("div", {
835
+ we ? /* @__PURE__ */ D("div", {
766
836
  className: "grid grid-cols-1 gap-6 lg:grid-cols-12",
767
- children: [/* @__PURE__ */ C("div", {
837
+ children: [/* @__PURE__ */ E("div", {
768
838
  className: "lg:col-span-5",
769
- children: /* @__PURE__ */ C(me, {
839
+ children: /* @__PURE__ */ E(ye, {
770
840
  eventId: a,
771
841
  eventName: d?.name ?? "this event",
772
842
  stations: O,
773
- attendees: N,
774
- activeStationId: h,
775
- onStationChange: _,
843
+ attendees: M,
844
+ activeStationId: f,
845
+ onStationChange: g,
776
846
  onCheckedIn: Se
777
847
  })
778
- }), /* @__PURE__ */ w("div", {
848
+ }), /* @__PURE__ */ D("div", {
779
849
  className: "space-y-6 lg:col-span-7",
780
- children: [/* @__PURE__ */ w("section", { children: [
781
- /* @__PURE__ */ C("h2", {
850
+ children: [/* @__PURE__ */ D("section", { children: [
851
+ /* @__PURE__ */ E("h2", {
782
852
  className: "text-sm font-semibold uppercase tracking-wide text-text-secondary",
783
853
  children: "Stations"
784
854
  }),
785
- /* @__PURE__ */ w("div", {
855
+ /* @__PURE__ */ D("div", {
786
856
  className: "mt-3 flex flex-wrap gap-2",
787
857
  children: [O.map((e) => {
788
- let t = h === e.id, n = z.get(e.id) ?? 0;
789
- return /* @__PURE__ */ w("div", {
858
+ let t = f === e.id, n = ne.get(e.id) ?? 0;
859
+ return /* @__PURE__ */ D("div", {
790
860
  className: `group inline-flex items-center gap-1.5 rounded-full border px-3 py-1.5 text-sm transition-colors ${t ? "border-accent-primary bg-accent-primary/10 text-accent-primary" : "border-border-default bg-bg-surface text-text-secondary hover:border-border-strong"}`,
791
- children: [/* @__PURE__ */ w("button", {
861
+ children: [/* @__PURE__ */ D("button", {
792
862
  type: "button",
793
863
  "aria-pressed": t,
794
- onClick: () => _(t ? "" : e.id),
864
+ onClick: () => g(t ? "" : e.id),
795
865
  className: "inline-flex items-center gap-1.5 font-medium outline-none",
796
- children: [e.name ?? e.id, n > 0 ? /* @__PURE__ */ C("span", {
866
+ children: [e.name ?? e.id, n > 0 ? /* @__PURE__ */ E("span", {
797
867
  className: "rounded-full bg-bg-sunken px-1.5 py-0.5 text-xs tabular-nums text-text-secondary",
798
868
  children: n
799
869
  }) : null]
800
- }), /* @__PURE__ */ C(f, {
870
+ }), /* @__PURE__ */ E(p, {
801
871
  ariaLabel: `Station ${e.name ?? e.id} actions`,
802
872
  entityName: e.name ?? void 0,
803
- onEdit: () => ve(e),
804
- onDelete: () => be(e)
873
+ onEdit: () => fe(e),
874
+ onDelete: () => ge(e)
805
875
  })]
806
876
  }, e.id);
807
- }), /* @__PURE__ */ w("button", {
877
+ }), /* @__PURE__ */ D("button", {
808
878
  type: "button",
809
- onClick: $,
879
+ onClick: de,
810
880
  className: "inline-flex items-center gap-1.5 rounded-full border border-dashed border-border-strong px-3 py-1.5 text-sm font-medium text-text-secondary transition-colors hover:border-accent-primary hover:text-accent-primary",
811
- children: [/* @__PURE__ */ C(j, { className: "h-3.5 w-3.5" }), "New station"]
881
+ children: [/* @__PURE__ */ E(P, { className: "h-3.5 w-3.5" }), "New station"]
812
882
  })]
813
883
  }),
814
- b.loading && O.length === 0 ? /* @__PURE__ */ C("p", {
884
+ y.loading && O.length === 0 ? /* @__PURE__ */ E("p", {
815
885
  className: "mt-2 text-sm text-text-secondary",
816
886
  children: "Loading stations…"
817
887
  }) : null
818
- ] }), /* @__PURE__ */ w(F, {
888
+ ] }), /* @__PURE__ */ D(L, {
819
889
  treatment: "plain",
820
890
  className: "border-border-seam p-5",
821
891
  children: [
822
- /* @__PURE__ */ w("div", {
892
+ /* @__PURE__ */ D("div", {
823
893
  className: "flex flex-wrap items-center justify-between gap-2",
824
- children: [/* @__PURE__ */ C("h2", {
894
+ children: [/* @__PURE__ */ E("h2", {
825
895
  className: "text-lg font-semibold text-text-primary",
826
896
  children: "Check-In Records"
827
- }), /* @__PURE__ */ w("p", {
897
+ }), /* @__PURE__ */ D("p", {
828
898
  className: "text-sm text-text-secondary",
829
899
  children: [
830
900
  "Checked in",
831
901
  " ",
832
- /* @__PURE__ */ C("span", {
902
+ /* @__PURE__ */ E("span", {
833
903
  className: "text-lg font-bold tabular-nums text-text-primary",
834
- children: R.toLocaleString()
904
+ children: F.toLocaleString()
835
905
  }),
836
- B > 0 ? /* @__PURE__ */ w(S, { children: [
906
+ B > 0 ? /* @__PURE__ */ D(T, { children: [
837
907
  " ",
838
908
  "/ ",
839
- /* @__PURE__ */ C("span", {
909
+ /* @__PURE__ */ E("span", {
840
910
  className: "tabular-nums",
841
911
  children: B.toLocaleString()
842
912
  })
@@ -844,69 +914,69 @@ function _e() {
844
914
  ]
845
915
  })]
846
916
  }),
847
- B > 0 ? /* @__PURE__ */ C("div", {
917
+ B > 0 ? /* @__PURE__ */ E("div", {
848
918
  className: "mt-3 h-2 w-full overflow-hidden rounded-full bg-bg-sunken",
849
919
  role: "progressbar",
850
- "aria-valuenow": R,
920
+ "aria-valuenow": F,
851
921
  "aria-valuemin": 0,
852
922
  "aria-valuemax": B,
853
923
  "aria-label": "Attendees checked in",
854
- children: /* @__PURE__ */ C("div", {
924
+ children: /* @__PURE__ */ E("div", {
855
925
  className: "h-full rounded-full bg-action-primary-bg transition-[width] duration-500",
856
926
  style: { width: `${V}%` }
857
927
  })
858
928
  }) : null,
859
- /* @__PURE__ */ C("div", {
929
+ /* @__PURE__ */ E("div", {
860
930
  className: "mt-4",
861
- children: k.length === 0 ? /* @__PURE__ */ C(re, {
931
+ children: k.length === 0 ? /* @__PURE__ */ E(z, {
862
932
  illustration: "empty-data",
863
- title: T.loading ? "Loading check-in records…" : "No check-in records yet",
933
+ title: b.loading ? "Loading check-in records…" : "No check-in records yet",
864
934
  description: "Arrivals recorded from this kiosk show up here, newest first.",
865
935
  className: "py-8"
866
- }) : /* @__PURE__ */ C(oe, {
936
+ }) : /* @__PURE__ */ E(oe, {
867
937
  className: "max-h-[28rem] pr-3",
868
- children: /* @__PURE__ */ C("ul", {
938
+ children: /* @__PURE__ */ E("ul", {
869
939
  className: "space-y-2.5",
870
940
  children: k.map((e) => {
871
- let t = Ce(e), n = e.direction === "OUT", r = e.stationId ? L.get(e.stationId) : null;
872
- return /* @__PURE__ */ w("li", {
941
+ let t = Ce(e), n = e.direction === "OUT", r = e.stationId ? te.get(e.stationId) : null;
942
+ return /* @__PURE__ */ D("li", {
873
943
  className: "flex items-center gap-3 rounded-card border border-border-seam bg-bg-surface p-3 transition-[box-shadow,border-color] duration-200 hover:border-border-strong hover:shadow-elevation-1",
874
944
  children: [
875
- /* @__PURE__ */ C("span", {
945
+ /* @__PURE__ */ E("span", {
876
946
  className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-accent-primary/10 text-sm font-semibold text-accent-primary",
877
947
  "aria-hidden": "true",
878
- children: ue(t)
948
+ children: me(t)
879
949
  }),
880
- /* @__PURE__ */ w("div", {
950
+ /* @__PURE__ */ D("div", {
881
951
  className: "min-w-0 flex-1",
882
- children: [/* @__PURE__ */ C("p", {
952
+ children: [/* @__PURE__ */ E("p", {
883
953
  className: "truncate font-medium text-text-primary",
884
954
  children: t
885
- }), /* @__PURE__ */ w("p", {
955
+ }), /* @__PURE__ */ D("p", {
886
956
  className: "mt-0.5 truncate text-sm text-text-secondary",
887
957
  children: [
888
- de(e.recordedAt),
958
+ he(e.recordedAt),
889
959
  " • ",
890
960
  e.method
891
961
  ]
892
962
  })]
893
963
  }),
894
- /* @__PURE__ */ w("div", {
964
+ /* @__PURE__ */ D("div", {
895
965
  className: "flex shrink-0 items-center gap-2",
896
966
  children: [
897
- /* @__PURE__ */ C(ee, {
967
+ /* @__PURE__ */ E(re, {
898
968
  variant: n ? "secondary" : "success",
899
969
  className: "uppercase",
900
970
  children: n ? "Checked out" : "Checked in"
901
971
  }),
902
- r ? /* @__PURE__ */ C("span", {
972
+ r ? /* @__PURE__ */ E("span", {
903
973
  className: "hidden text-sm text-text-secondary sm:inline",
904
974
  children: r
905
975
  }) : null,
906
- /* @__PURE__ */ C(f, {
976
+ /* @__PURE__ */ E(p, {
907
977
  ariaLabel: `Check-in record ${e.id} actions`,
908
- onEdit: () => ye(e),
909
- onDelete: () => xe(e)
978
+ onEdit: () => pe(e),
979
+ onDelete: () => $(e)
910
980
  })
911
981
  ]
912
982
  })
@@ -916,7 +986,7 @@ function _e() {
916
986
  })
917
987
  })
918
988
  }),
919
- /* @__PURE__ */ C(p, {
989
+ /* @__PURE__ */ E(m, {
920
990
  offset: v.offset,
921
991
  limit: v.limit,
922
992
  loadedCount: k.length,
@@ -924,38 +994,38 @@ function _e() {
924
994
  onPrev: v.prevPage,
925
995
  onNext: v.nextPage,
926
996
  itemLabel: "records",
927
- loading: T.loading
997
+ loading: b.loading
928
998
  })
929
999
  ]
930
1000
  })]
931
1001
  })]
932
- }) : /* @__PURE__ */ C(F, {
1002
+ }) : /* @__PURE__ */ E(L, {
933
1003
  treatment: "plain",
934
1004
  className: "border-border-seam p-5",
935
- children: /* @__PURE__ */ C(re, {
1005
+ children: /* @__PURE__ */ E(z, {
936
1006
  illustration: "empty-data",
937
1007
  title: "Select an event to open the kiosk",
938
1008
  description: "Check-in stations and records belong to a specific event. Pick one above to start scanning attendees in.",
939
1009
  className: "py-8"
940
1010
  })
941
1011
  }),
942
- a ? /* @__PURE__ */ C(fe, {
943
- open: ce,
944
- onOpenChange: J,
1012
+ a ? /* @__PURE__ */ E(_e, {
1013
+ open: W,
1014
+ onOpenChange: G,
945
1015
  eventId: a,
946
1016
  eventName: d?.name ?? "this event",
947
- station: le
1017
+ station: K
948
1018
  }) : null,
949
- /* @__PURE__ */ C(pe, {
950
- open: X,
951
- onOpenChange: Z,
952
- record: Q,
1019
+ /* @__PURE__ */ E(ve, {
1020
+ open: se,
1021
+ onOpenChange: ce,
1022
+ record: le,
953
1023
  stations: O
954
1024
  })
955
1025
  ]
956
1026
  });
957
1027
  }
958
1028
  //#endregion
959
- export { _e as default };
1029
+ export { Se as default };
960
1030
 
961
1031
  //# sourceMappingURL=KioskPage.js.map