quantum-component-library 1.4.48-dev.0 → 1.4.48-dev.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,14 +1,14 @@
1
1
  import { j as e } from "./react-jsx-runtime-vendor-OVHDjVDe.js";
2
- import { Flex as me, InputGroup as Ee, InputLeftElement as ut, Icon as qe, Input as fe, FormLabel as Ye, Box as X, TableContainer as He, Table as Je, Thead as Xe, Tr as Me, Th as he, Tbody as Ze, Td as pe, ButtonGroup as ge, Tooltip as De, Button as Z, RangeSlider as ht, RangeSliderMark as Le, Text as v, RangeSliderTrack as mt, RangeSliderFilledTrack as pt, RangeSliderThumb as ze, Select as _e, NumberInput as Pe, NumberInputField as $e, HStack as ne, Tag as je, Checkbox as gt, Image as xt, useToast as Ke, VStack as te, FormControl as J, RadioGroup as Ve, Radio as Te, Alert as Ie, AlertIcon as Oe, Spinner as et, useDisclosure as ft, Modal as jt, ModalOverlay as vt, ModalContent as bt, ModalHeader as yt, ModalCloseButton as Ct, ModalBody as wt, ModalFooter as St, IconButton as At, Textarea as Ge } from "@chakra-ui/react";
3
- import { useMemo as D, useState as $, useCallback as R, useRef as Mt, useEffect as se, memo as Ne } from "react";
2
+ import { Flex as me, InputGroup as _e, InputLeftElement as ut, Icon as qe, Input as fe, FormLabel as Ye, Box as Z, TableContainer as He, Table as Je, Thead as Xe, Tr as Me, Th as he, Tbody as Ze, Td as ge, ButtonGroup as xe, Tooltip as Ee, Button as K, RangeSlider as ht, RangeSliderMark as Le, Text as v, RangeSliderTrack as mt, RangeSliderFilledTrack as pt, RangeSliderThumb as Ge, Select as Pe, NumberInput as $e, NumberInputField as We, HStack as ne, Tag as je, Checkbox as gt, Image as xt, useToast as Ke, VStack as te, FormControl as X, RadioGroup as Ve, Radio as Te, Alert as Ie, AlertIcon as Oe, Spinner as et, useDisclosure as ft, Modal as jt, ModalOverlay as vt, ModalContent as bt, ModalHeader as yt, ModalCloseButton as Ct, ModalBody as wt, ModalFooter as St, IconButton as At, Textarea as Ue } from "@chakra-ui/react";
3
+ import { useMemo as D, useState as P, useCallback as L, useRef as Mt, useEffect as se, memo as Ne } from "react";
4
4
  import { u as Tt } from "./ufuzzy-vendor-Dl0ZI6Av.js";
5
5
  import { s as ae } from "./react-select-vendor-BlY9Il4Q.js";
6
6
  import { F as It, a as Ot } from "./react-icons-vendor-TETORdU9.js";
7
7
  import { u as ce, a as re, b as Nt } from "./graphql-vendor-BWnD0b-j.js";
8
- import { getFragmentData as P } from "./generated.js";
9
- import { M as ve, A as de, G as tt, a as kt, C as Fe, b as nt, c as st, d as Se, e as ot, f as Lt, U as rt, g as it, h as Rt, i as We, j as Ue, k as Dt, l as Ft, m as Et, n as zt, o as _t, p as Pt } from "./graphql-Cm5gV92N.js";
10
- import { D as $t, H as Gt, u as Wt, a as Ut } from "./react-dnd-vendor-D4nn9Mqx.js";
11
- import { ThresholdKind as Ae, SensorLocation as G, ActionLaterality as Bt } from "./generated-graphql.js";
8
+ import { getFragmentData as z } from "./generated.js";
9
+ import { M as ve, a as De, A as de, G as tt, b as kt, c as Fe, C as ze, d as nt, e as st, f as Se, g as ot, h as Lt, U as rt, i as it, j as Rt, k as Dt, l as Ft, m as Et, n as zt, o as _t, p as Gt } from "./graphql-Cts9cAoH.js";
10
+ import { D as Pt, H as $t, u as Wt, a as Ut } from "./react-dnd-vendor-D4nn9Mqx.js";
11
+ import { ThresholdKind as Ae, SensorLocation as W, ActionLaterality as Bt } from "./generated-graphql.js";
12
12
  import { getSegmentNameWithPlane as at, getJointNameWithPlane as lt, getJointAngleDirectionName as Qt, getSegmentAngleDirectionName as qt, getNormativeJointRange as Yt } from "./services.js";
13
13
  import { availablePlanes as Be, getAnalysisPartIdNoSide as ye } from "./types.js";
14
14
  import { thresholdsToParameters as Ht, parametersToThresholds as Qe, cn as Jt } from "./utils.js";
@@ -27,7 +27,7 @@ const Zt = ({
27
27
  [n]
28
28
  );
29
29
  return /* @__PURE__ */ e.jsxs(me, { width: "100%", alignContent: "space-evenly", gap: 4, children: [
30
- /* @__PURE__ */ e.jsxs(Ee, { size: "md", flex: 1, children: [
30
+ /* @__PURE__ */ e.jsxs(_e, { size: "md", flex: 1, children: [
31
31
  /* @__PURE__ */ e.jsx(ut, { children: /* @__PURE__ */ e.jsx(qe, { as: It, color: "gray.300" }) }),
32
32
  /* @__PURE__ */ e.jsx(
33
33
  fe,
@@ -39,7 +39,7 @@ const Zt = ({
39
39
  }
40
40
  )
41
41
  ] }),
42
- !c && /* @__PURE__ */ e.jsx(Ee, { size: "md", children: /* @__PURE__ */ e.jsx(
42
+ !c && /* @__PURE__ */ e.jsx(_e, { size: "md", children: /* @__PURE__ */ e.jsx(
43
43
  ae,
44
44
  {
45
45
  size: "md",
@@ -60,9 +60,9 @@ const Zt = ({
60
60
  }, ie = ({
61
61
  children: s
62
62
  }) => /* @__PURE__ */ e.jsx(Ye, { fontWeight: "bold", fontFamily: "sans-serif", fontSize: "large", children: s }), Kt = ({ value: s, onChange: n }) => {
63
- const i = $(
63
+ const i = P(
64
64
  () => Math.random().toString(36).substring(2, 15)
65
- )[0], c = R(
65
+ )[0], c = L(
66
66
  (u, r) => {
67
67
  n((d) => {
68
68
  const b = [...d], [o] = b.splice(u, 1);
@@ -71,7 +71,7 @@ const Zt = ({
71
71
  },
72
72
  [n]
73
73
  );
74
- return /* @__PURE__ */ e.jsx(X, { children: /* @__PURE__ */ e.jsx($t, { backend: Gt, children: /* @__PURE__ */ e.jsx(He, { children: /* @__PURE__ */ e.jsxs(Je, { variant: "simple", size: "md", children: [
74
+ return /* @__PURE__ */ e.jsx(Z, { children: /* @__PURE__ */ e.jsx(Pt, { backend: $t, children: /* @__PURE__ */ e.jsx(He, { children: /* @__PURE__ */ e.jsxs(Je, { variant: "simple", size: "md", children: [
75
75
  /* @__PURE__ */ e.jsx(Xe, { children: /* @__PURE__ */ e.jsxs(Me, { children: [
76
76
  /* @__PURE__ */ e.jsx(he, { children: "Order" }),
77
77
  /* @__PURE__ */ e.jsx(he, { children: "Name" })
@@ -111,8 +111,8 @@ const Zt = ({
111
111
  })
112
112
  }), y = o ? 0.6 : 1, A = o ? "grabbing" : "grab";
113
113
  return O(b(r)), /* @__PURE__ */ e.jsxs(Me, { ref: r, style: { opacity: y, cursor: A }, "data-handler-id": d, children: [
114
- /* @__PURE__ */ e.jsx(pe, { children: n + 1 }),
115
- /* @__PURE__ */ e.jsx(pe, { children: c })
114
+ /* @__PURE__ */ e.jsx(ge, { children: n + 1 }),
115
+ /* @__PURE__ */ e.jsx(ge, { children: c })
116
116
  ] });
117
117
  }, en = ({
118
118
  items: s,
@@ -123,8 +123,8 @@ const Zt = ({
123
123
  buttonProps: r
124
124
  }) => {
125
125
  const d = (o) => o === i || o.value === i, b = (o) => d(o) ? { ...r, ...u } : r;
126
- return /* @__PURE__ */ e.jsx(ge, { isAttached: !0, isDisabled: c, children: s.map((o, O) => /* @__PURE__ */ e.jsx(
127
- De,
126
+ return /* @__PURE__ */ e.jsx(xe, { isAttached: !0, isDisabled: c, children: s.map((o, O) => /* @__PURE__ */ e.jsx(
127
+ Ee,
128
128
  {
129
129
  label: o.tooltip,
130
130
  openDelay: 50,
@@ -133,7 +133,7 @@ const Zt = ({
133
133
  visibility: o.tooltip ? "visible" : "hidden",
134
134
  hasArrow: !0,
135
135
  children: /* @__PURE__ */ e.jsx(
136
- Z,
136
+ K,
137
137
  {
138
138
  onClick: () => d(o) ? null : n(o, O),
139
139
  isDisabled: o.disabled,
@@ -159,52 +159,52 @@ const Zt = ({
159
159
  isDisabled: A,
160
160
  ...p
161
161
  }) => {
162
- const [C, a] = $([void 0, void 0]), l = C[0], m = C[1], g = b && n < -5 && i > 5, x = Number(c?.[0] ?? m ?? n) > 0 ? 1 : -1, S = Number(c?.[1] ?? m ?? i) < 0 ? -1 : 1, F = y?.[0] === y?.[1], _ = c?.[0], M = c?.[1];
162
+ const [C, a] = P([void 0, void 0]), l = C[0], m = C[1], g = b && n < -5 && i > 5, x = Number(c?.[0] ?? m ?? n) > 0 ? 1 : -1, S = Number(c?.[1] ?? m ?? i) < 0 ? -1 : 1, F = y?.[0] === y?.[1], _ = c?.[0], M = c?.[1];
163
163
  se(() => {
164
164
  _ !== void 0 && M !== void 0 && a([_.toFixed(0), M.toFixed(0)]);
165
165
  }, [_, M, a]);
166
- const E = R(
167
- ([j, W]) => {
168
- j < W && a([j.toFixed(0), W.toFixed(0)]);
166
+ const E = L(
167
+ ([j, U]) => {
168
+ j < U && a([j.toFixed(0), U.toFixed(0)]);
169
169
  },
170
170
  [a]
171
- ), N = R(
172
- ([j, W]) => {
173
- j < W && u([j, W]);
171
+ ), N = L(
172
+ ([j, U]) => {
173
+ j < U && u([j, U]);
174
174
  },
175
175
  [u]
176
- ), Q = R(() => {
177
- a(([j, W]) => {
178
- const H = isNaN(Number(j)) ? n : Number(j), t = isNaN(Number(W)) ? i : Number(W), h = Ce(Number(H), x), w = Ce(Number(t), S), k = x < 0 ? Math.max(h, n) : Math.min(h, i), z = S < 0 ? Math.max(w, n) : Math.min(w, i);
179
- return k > z ? (u([z, k]), [z.toFixed(0), k.toFixed(0)]) : (u([k, z]), [k.toFixed(0), z.toFixed(0)]);
176
+ ), Y = L(() => {
177
+ a(([j, U]) => {
178
+ const J = isNaN(Number(j)) ? n : Number(j), t = isNaN(Number(U)) ? i : Number(U), h = Ce(Number(J), x), w = Ce(Number(t), S), R = x < 0 ? Math.max(h, n) : Math.min(h, i), G = S < 0 ? Math.max(w, n) : Math.min(w, i);
179
+ return R > G ? (u([G, R]), [G.toFixed(0), R.toFixed(0)]) : (u([R, G]), [R.toFixed(0), G.toFixed(0)]);
180
180
  });
181
- }, [u, a, x, S, n, i]), f = R(
181
+ }, [u, a, x, S, n, i]), f = L(
182
182
  (j) => {
183
- const W = j === "" || isNaN(Number(j)) ? j : Ce(Number(j), x);
184
- a(([H, t]) => [W.toString(), t]);
183
+ const U = j === "" || isNaN(Number(j)) ? j : Ce(Number(j), x);
184
+ a(([J, t]) => [U.toString(), t]);
185
185
  },
186
186
  [a, x]
187
- ), L = R(
187
+ ), k = L(
188
188
  (j) => {
189
- const W = j === "" || isNaN(Number(j)) ? j : Ce(Number(j), S);
190
- a(([H, t]) => [H, W.toString()]);
189
+ const U = j === "" || isNaN(Number(j)) ? j : Ce(Number(j), S);
190
+ a(([J, t]) => [J, U.toString()]);
191
191
  },
192
192
  [a, S]
193
193
  ), T = D(
194
194
  () => d === "xs" ? "0.75rem" : void 0,
195
195
  [d]
196
- ), V = R(
197
- (j, W) => {
198
- const H = Number(W.target.value);
199
- if (!l || !m || ![-1, 1].includes(H))
196
+ ), V = L(
197
+ (j, U) => {
198
+ const J = Number(U.target.value);
199
+ if (!l || !m || ![-1, 1].includes(J))
200
200
  return;
201
- const t = (k) => H < 0 ? -1 * Math.abs(k) : Math.abs(k), h = j ? t(Number(l)) : Number(l), w = j ? Number(m) : t(Number(m));
201
+ const t = (R) => J < 0 ? -1 * Math.abs(R) : Math.abs(R), h = j ? t(Number(l)) : Number(l), w = j ? Number(m) : t(Number(m));
202
202
  h > w ? u([w, h]) : u([h, w]);
203
203
  },
204
204
  [l, m, u]
205
205
  );
206
206
  return /* @__PURE__ */ e.jsxs(me, { direction: "column", ...p, children: [
207
- /* @__PURE__ */ e.jsx(X, { pt: "1em", mb: "-0.5em", children: /* @__PURE__ */ e.jsxs(
207
+ /* @__PURE__ */ e.jsx(Z, { pt: "1em", mb: "-0.5em", children: /* @__PURE__ */ e.jsxs(
208
208
  ht,
209
209
  {
210
210
  "aria-label": ["min", "max"],
@@ -240,7 +240,7 @@ const Zt = ({
240
240
  g && /* @__PURE__ */ e.jsxs(Le, { value: 0, top: "-1em", pos: "relative", children: [
241
241
  /* @__PURE__ */ e.jsx(v, { fontSize: d, fontWeight: "semibold", children: o?.(0) ?? "0" }),
242
242
  /* @__PURE__ */ e.jsx(
243
- X,
243
+ Z,
244
244
  {
245
245
  position: "absolute",
246
246
  width: "2px",
@@ -252,8 +252,8 @@ const Zt = ({
252
252
  )
253
253
  ] }),
254
254
  /* @__PURE__ */ e.jsx(mt, { children: /* @__PURE__ */ e.jsx(pt, {}) }),
255
- /* @__PURE__ */ e.jsx(ze, { index: 0, w: T, h: T }),
256
- /* @__PURE__ */ e.jsx(ze, { index: 1, w: T, h: T })
255
+ /* @__PURE__ */ e.jsx(Ge, { index: 0, w: T, h: T }),
256
+ /* @__PURE__ */ e.jsx(Ge, { index: 1, w: T, h: T })
257
257
  ]
258
258
  }
259
259
  ) }),
@@ -293,7 +293,7 @@ const Zt = ({
293
293
  gap: "0.125em",
294
294
  children: [
295
295
  y && /* @__PURE__ */ e.jsxs(
296
- _e,
296
+ Pe,
297
297
  {
298
298
  width: "auto",
299
299
  size: d,
@@ -308,7 +308,7 @@ const Zt = ({
308
308
  }
309
309
  ),
310
310
  /* @__PURE__ */ e.jsx(
311
- Pe,
311
+ $e,
312
312
  {
313
313
  precision: 0,
314
314
  size: d ?? "sm",
@@ -316,14 +316,14 @@ const Zt = ({
316
316
  max: x < 0 ? Math.abs(n) : M ?? i,
317
317
  value: l === "" ? "" : Math.abs(Number(l ?? n)),
318
318
  onChange: f,
319
- onBlur: Q,
319
+ onBlur: Y,
320
320
  borderWidth: 1,
321
321
  borderRadius: 3,
322
322
  borderColor: "#ccc",
323
323
  isDisabled: A,
324
324
  ...r,
325
325
  children: /* @__PURE__ */ e.jsx(
326
- $e,
326
+ We,
327
327
  {
328
328
  backgroundColor: "#fff",
329
329
  paddingRight: 0,
@@ -333,22 +333,22 @@ const Zt = ({
333
333
  }
334
334
  ),
335
335
  /* @__PURE__ */ e.jsx(
336
- Pe,
336
+ $e,
337
337
  {
338
338
  size: d ?? "sm",
339
339
  min: 0,
340
340
  max: S < 0 ? Math.abs(_ ?? n) : i,
341
341
  precision: 0,
342
342
  value: m === "" ? "" : Math.abs(Number(m ?? i)),
343
- onChange: L,
344
- onBlur: Q,
343
+ onChange: k,
344
+ onBlur: Y,
345
345
  borderWidth: 1,
346
346
  borderRadius: 3,
347
347
  borderColor: "#ccc",
348
348
  isDisabled: A,
349
349
  ...r,
350
350
  children: /* @__PURE__ */ e.jsx(
351
- $e,
351
+ We,
352
352
  {
353
353
  backgroundColor: "#fff",
354
354
  paddingRight: 0,
@@ -358,7 +358,7 @@ const Zt = ({
358
358
  }
359
359
  ),
360
360
  y && /* @__PURE__ */ e.jsxs(
361
- _e,
361
+ Pe,
362
362
  {
363
363
  width: "auto",
364
364
  size: d,
@@ -380,12 +380,12 @@ const Zt = ({
380
380
  action: s,
381
381
  quantumIconSrc: n
382
382
  }) => s.quantumOwned ? /* @__PURE__ */ e.jsx(
383
- De,
383
+ Ee,
384
384
  {
385
385
  label: "This activity is owned by Quantum",
386
386
  "aria-label": "Quantum owned",
387
387
  children: /* @__PURE__ */ e.jsx(
388
- X,
388
+ Z,
389
389
  {
390
390
  boxSize: "1.5em",
391
391
  borderRadius: "full",
@@ -434,29 +434,29 @@ const Zt = ({
434
434
  containerProps: a,
435
435
  quantumIconSrc: l = "/favicon.ico"
436
436
  }) => {
437
- const [m, g] = $(""), [x, S] = $(), F = D(() => {
437
+ const [m, g] = P(""), [x, S] = P(), F = D(() => {
438
438
  if (!s)
439
439
  return;
440
440
  const f = rn(s, m);
441
441
  return p ? f : ln(f, x);
442
- }, [s, m, x, p]), _ = R(() => {
442
+ }, [s, m, x, p]), _ = L(() => {
443
443
  if (!c)
444
444
  return;
445
- const L = s.filter(
445
+ const k = s.filter(
446
446
  (T) => T.selected && !T.quantumOwned
447
447
  ).map((T) => T.id);
448
- c(L);
449
- }, [s, c]), M = R(() => {
448
+ c(k);
449
+ }, [s, c]), M = L(() => {
450
450
  if (!b)
451
451
  return;
452
- const f = s.filter((L) => L.selected);
453
- b(f.map((L) => L.id)), d && f.forEach((L) => d(L, !1));
454
- }, [s, b, d]), E = D(() => s.some((f) => f.selected && !f.quantumOwned), [s]), N = D(() => s.some((f) => f.selected), [s]), Q = D(() => s.some((f) => f.selected && f.quantumOwned), [s]);
455
- return /* @__PURE__ */ e.jsxs(X, { ...a, children: [
452
+ const f = s.filter((k) => k.selected);
453
+ b(f.map((k) => k.id)), d && f.forEach((k) => d(k, !1));
454
+ }, [s, b, d]), E = D(() => s.some((f) => f.selected && !f.quantumOwned), [s]), N = D(() => s.some((f) => f.selected), [s]), Y = D(() => s.some((f) => f.selected && f.quantumOwned), [s]);
455
+ return /* @__PURE__ */ e.jsxs(Z, { ...a, children: [
456
456
  /* @__PURE__ */ e.jsxs(me, { alignContent: "space-between", gap: 4, children: [
457
- (i || c || b) && /* @__PURE__ */ e.jsxs(ge, { mb: "1rem", gap: 4, children: [
457
+ (i || c || b) && /* @__PURE__ */ e.jsxs(xe, { mb: "1rem", gap: 4, children: [
458
458
  i && /* @__PURE__ */ e.jsx(
459
- Z,
459
+ K,
460
460
  {
461
461
  isDisabled: !i || A,
462
462
  colorScheme: "blackAlpha",
@@ -466,12 +466,12 @@ const Zt = ({
466
466
  }
467
467
  ),
468
468
  c && !o && /* @__PURE__ */ e.jsx(
469
- De,
469
+ Ee,
470
470
  {
471
- label: Q ? E ? "Quantum-owned activities are selected and will be skipped" : "Selected activities are quantum-owned and cannot be deleted" : void 0,
471
+ label: Y ? E ? "Quantum-owned activities are selected and will be skipped" : "Selected activities are quantum-owned and cannot be deleted" : void 0,
472
472
  shouldWrapChildren: !0,
473
473
  children: /* @__PURE__ */ e.jsx(
474
- Z,
474
+ K,
475
475
  {
476
476
  colorScheme: "gray",
477
477
  isDisabled: !E || !c || O,
@@ -482,7 +482,7 @@ const Zt = ({
482
482
  }
483
483
  ),
484
484
  b && !o && /* @__PURE__ */ e.jsx(
485
- Z,
485
+ K,
486
486
  {
487
487
  colorScheme: "gray",
488
488
  isDisabled: !N,
@@ -527,17 +527,17 @@ const Zt = ({
527
527
  cursor: o ? "pointer" : "default",
528
528
  onClick: () => o ? d?.(f, !f.selected) : void 0,
529
529
  children: [
530
- /* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(me, { children: [
530
+ /* @__PURE__ */ e.jsx(ge, { children: /* @__PURE__ */ e.jsxs(me, { children: [
531
531
  d && !o && /* @__PURE__ */ e.jsx(
532
532
  gt,
533
533
  {
534
534
  isChecked: f.selected,
535
535
  "aria-label": "Select activity",
536
- onChange: (L) => d(f, L.target.checked)
536
+ onChange: (k) => d(f, k.target.checked)
537
537
  }
538
538
  ),
539
539
  (f.quantumOwned || !u) && r && /* @__PURE__ */ e.jsx(
540
- Z,
540
+ K,
541
541
  {
542
542
  ml: "1em",
543
543
  size: "sm",
@@ -548,7 +548,7 @@ const Zt = ({
548
548
  }
549
549
  ),
550
550
  !f.quantumOwned && u && /* @__PURE__ */ e.jsx(
551
- Z,
551
+ K,
552
552
  {
553
553
  isDisabled: y,
554
554
  ml: "1em",
@@ -560,7 +560,7 @@ const Zt = ({
560
560
  }
561
561
  )
562
562
  ] }) }),
563
- /* @__PURE__ */ e.jsx(pe, { whiteSpace: "break-spaces", children: /* @__PURE__ */ e.jsxs(me, { align: "center", gap: 2, children: [
563
+ /* @__PURE__ */ e.jsx(ge, { whiteSpace: "break-spaces", children: /* @__PURE__ */ e.jsxs(me, { align: "center", gap: 2, children: [
564
564
  /* @__PURE__ */ e.jsx(
565
565
  on,
566
566
  {
@@ -570,12 +570,12 @@ const Zt = ({
570
570
  ),
571
571
  f.name
572
572
  ] }) }),
573
- /* @__PURE__ */ e.jsx(pe, { maxW: "20rem", whiteSpace: "break-spaces", children: an(f.sensorLocations) }),
574
- !p && /* @__PURE__ */ e.jsx(pe, { maxW: "20rem", children: /* @__PURE__ */ e.jsx(
573
+ /* @__PURE__ */ e.jsx(ge, { maxW: "20rem", whiteSpace: "break-spaces", children: an(f.sensorLocations) }),
574
+ !p && /* @__PURE__ */ e.jsx(ge, { maxW: "20rem", children: /* @__PURE__ */ e.jsx(
575
575
  nn,
576
576
  {
577
577
  containerProps: { flexWrap: "wrap" },
578
- tags: f.useCases?.map((L) => L.name) ?? []
578
+ tags: f.useCases?.map((k) => k.name) ?? []
579
579
  }
580
580
  ) })
581
581
  ]
@@ -593,39 +593,44 @@ const Zt = ({
593
593
  setButtonOnClick: r,
594
594
  quantumOwned: d
595
595
  }) => {
596
- const b = Ke(), [o, O] = $("copy"), [y, A] = $(""), [p, C] = $([]), [a, l] = $(!1), [m] = ce({
596
+ const b = Ke(), [o, O] = P("copy"), [y, A] = P(""), [p, C] = P([]), [a, l] = P(!1), [m] = ce({
597
597
  query: tt
598
598
  }), [g] = ce({
599
599
  query: kt,
600
600
  variables: { groupId: y },
601
601
  pause: !y
602
602
  // Only run when group is selected
603
- }), [, x] = re(Fe), [, S] = re(
603
+ }), [, x] = re(ze), [, S] = re(
604
604
  nt
605
605
  ), F = D(() => m.data?.groups ? m.data.groups.map(
606
- (t) => P(st, t)
606
+ (t) => z(st, t)
607
607
  ) : [], [m.data]), _ = D(() => g.data ? g.data.actions.map(
608
- (h) => P(de, h)
608
+ (h) => z(de, h)
609
609
  ) : [], [g.data]), M = D(() => _.filter(
610
610
  (t) => p.includes(t.id)
611
- ), [_, p]), E = R(
611
+ ), [_, p]), E = L(
612
612
  (t) => {
613
613
  const h = t?.value || "";
614
614
  A(h), C([]);
615
615
  },
616
616
  []
617
- ), N = R(
617
+ ), N = L(
618
618
  (t) => {
619
619
  const h = t.map((w) => w.value);
620
620
  C(h);
621
621
  },
622
622
  []
623
- ), Q = R(
623
+ ), Y = L(
624
624
  async (t) => {
625
- const h = P(
625
+ const h = z(
626
626
  ve,
627
627
  t.categories
628
- ), w = {
628
+ ), R = z(
629
+ De,
630
+ t.metadataGroups
631
+ ).flatMap(
632
+ (B) => B.data.map((Q) => z(Fe, Q).id)
633
+ ), G = {
629
634
  ...t,
630
635
  name: `${t.name} (Copy)`,
631
636
  // Add "(Copy)" suffix to distinguish
@@ -635,35 +640,36 @@ const Zt = ({
635
640
  laterality: t.laterality,
636
641
  activityKind: t.activityKind,
637
642
  sensorLocations: t.sensorLocations,
638
- thresholds: t.thresholds.map((z) => ({
639
- ...z,
643
+ thresholds: t.thresholds.map((B) => ({
644
+ ...B,
640
645
  id: void 0
641
646
  })),
642
- categories: h?.map((z) => z.id),
647
+ categories: h?.map((B) => B.id),
643
648
  quantumOwned: d,
649
+ metadataItemIds: R,
644
650
  id: void 0
645
- }, k = await x({ fields: w });
646
- if (k.error)
647
- throw new Error(k.error.message);
648
- if (k.data?.createAction)
649
- return P(de, k.data.createAction);
651
+ }, $ = await x({ fields: G });
652
+ if ($.error)
653
+ throw new Error($.error.message);
654
+ if ($.data?.createAction)
655
+ return z(de, $.data.createAction);
650
656
  throw new Error("No action data returned");
651
657
  },
652
658
  [x, d]
653
- ), f = R(
659
+ ), f = L(
654
660
  async (t) => {
655
661
  const h = await S({ id: t.id });
656
662
  if (h.error)
657
663
  throw new Error(h.error.message);
658
664
  if (h.data?.convertActionToQuantumOwned)
659
- return P(
665
+ return z(
660
666
  de,
661
667
  h.data.convertActionToQuantumOwned
662
668
  );
663
669
  throw new Error("No action data returned");
664
670
  },
665
671
  [S]
666
- ), L = R(async () => {
672
+ ), k = L(async () => {
667
673
  if (l(!0), !M.length) {
668
674
  const t = new Error(
669
675
  `No activities selected for ${o === "copy" ? "copying" : "converting"}`
@@ -674,28 +680,28 @@ const Zt = ({
674
680
  try {
675
681
  const t = [];
676
682
  let h = 0;
677
- const w = o === "copy" ? Q : f, k = o === "copy" ? "copy" : "convert";
678
- for (const z of M)
683
+ const w = o === "copy" ? Y : f, R = o === "copy" ? "copy" : "convert";
684
+ for (const G of M)
679
685
  try {
680
- const q = await w(z);
681
- t.push(q);
682
- } catch (q) {
686
+ const $ = await w(G);
687
+ t.push($);
688
+ } catch ($) {
683
689
  console.error(
684
- `Failed to ${k} activity "${z.name}":`,
685
- q
690
+ `Failed to ${R} activity "${G.name}":`,
691
+ $
686
692
  ), h++;
687
693
  }
688
694
  if (t.length > 0) {
689
- const z = t.length, q = M.length, K = o === "copy" ? "copied" : "converted", B = o === "copy" ? "copy" : "convert";
695
+ const G = t.length, $ = M.length, B = o === "copy" ? "copied" : "converted", Q = o === "copy" ? "copy" : "convert";
690
696
  b({
691
- title: h > 0 ? `Partial ${B} completed` : `Activities ${K} successfully`,
692
- description: h > 0 ? `${z} of ${q} activities ${K} successfully` : `${z} activit${z > 1 ? "ies" : "y"} ${K} successfully`,
697
+ title: h > 0 ? `Partial ${Q} completed` : `Activities ${B} successfully`,
698
+ description: h > 0 ? `${G} of ${$} activities ${B} successfully` : `${G} activit${G > 1 ? "ies" : "y"} ${B} successfully`,
693
699
  status: h > 0 ? "warning" : "success",
694
700
  duration: 3e3,
695
701
  isClosable: !0
696
702
  }), s?.(), A(""), C([]);
697
703
  } else
698
- throw new Error(`Failed to ${k} any activities`);
704
+ throw new Error(`Failed to ${R} any activities`);
699
705
  } catch (t) {
700
706
  const h = o === "copy" ? "copy" : "convert", w = t instanceof Error ? t.message : `Failed to ${h} activities`;
701
707
  b({
@@ -711,12 +717,12 @@ const Zt = ({
711
717
  }, [
712
718
  M,
713
719
  o,
714
- Q,
720
+ Y,
715
721
  f,
716
722
  b,
717
723
  s,
718
724
  i
719
- ]), T = R(() => {
725
+ ]), T = L(() => {
720
726
  A(""), C([]), O("copy"), n?.();
721
727
  }, [n]);
722
728
  se(() => {
@@ -727,9 +733,9 @@ const Zt = ({
727
733
  }, [M.length, a, u]), se(() => {
728
734
  r && r({
729
735
  cancelButton: T,
730
- saveButton: L
736
+ saveButton: k
731
737
  });
732
- }, [r, T, L]);
738
+ }, [r, T, k]);
733
739
  const V = D(() => F.map((t) => ({
734
740
  value: t.id,
735
741
  label: t.name
@@ -738,9 +744,9 @@ const Zt = ({
738
744
  label: t.name,
739
745
  // Add custom data to identify quantum-owned actions for UI display
740
746
  isQuantumOwned: t.quantumOwned
741
- })), [_, o]), W = m.fetching, H = g.fetching;
742
- return /* @__PURE__ */ e.jsx(X, { children: /* @__PURE__ */ e.jsxs(te, { spacing: 6, align: "stretch", children: [
743
- d && /* @__PURE__ */ e.jsxs(J, { children: [
747
+ })), [_, o]), U = m.fetching, J = g.fetching;
748
+ return /* @__PURE__ */ e.jsx(Z, { children: /* @__PURE__ */ e.jsxs(te, { spacing: 6, align: "stretch", children: [
749
+ d && /* @__PURE__ */ e.jsxs(X, { children: [
744
750
  /* @__PURE__ */ e.jsx(ie, { children: "Operation Mode" }),
745
751
  /* @__PURE__ */ e.jsx(
746
752
  Ve,
@@ -762,7 +768,7 @@ const Zt = ({
762
768
  }
763
769
  )
764
770
  ] }),
765
- /* @__PURE__ */ e.jsxs(J, { children: [
771
+ /* @__PURE__ */ e.jsxs(X, { children: [
766
772
  /* @__PURE__ */ e.jsx(ie, { children: "Select Source Group" }),
767
773
  /* @__PURE__ */ e.jsx(
768
774
  ae,
@@ -771,8 +777,8 @@ const Zt = ({
771
777
  options: V,
772
778
  value: V.find((t) => t.value === y) || null,
773
779
  onChange: E,
774
- isLoading: W,
775
- isDisabled: W,
780
+ isLoading: U,
781
+ isDisabled: U,
776
782
  isClearable: !0
777
783
  }
778
784
  ),
@@ -784,13 +790,13 @@ const Zt = ({
784
790
  ] })
785
791
  ] })
786
792
  ] }),
787
- y && /* @__PURE__ */ e.jsxs(J, { children: [
793
+ y && /* @__PURE__ */ e.jsxs(X, { children: [
788
794
  /* @__PURE__ */ e.jsxs(ie, { children: [
789
795
  "Select Activities to",
790
796
  " ",
791
797
  o === "copy" ? "Copy" : "Convert"
792
798
  ] }),
793
- H ? /* @__PURE__ */ e.jsxs(ne, { children: [
799
+ J ? /* @__PURE__ */ e.jsxs(ne, { children: [
794
800
  /* @__PURE__ */ e.jsx(et, { size: "sm" }),
795
801
  /* @__PURE__ */ e.jsx(v, { fontSize: "sm", color: "gray.600", children: "Loading activities..." })
796
802
  ] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
@@ -826,11 +832,11 @@ const Zt = ({
826
832
  ] })
827
833
  ] })
828
834
  ] }),
829
- M.length > 0 && /* @__PURE__ */ e.jsxs(X, { p: 4, bg: "gray.50", borderRadius: "md", children: [
835
+ M.length > 0 && /* @__PURE__ */ e.jsxs(Z, { p: 4, bg: "gray.50", borderRadius: "md", children: [
830
836
  /* @__PURE__ */ e.jsx(v, { fontWeight: "semibold", mb: 3, children: M.length === 1 ? `Activity to ${o === "copy" ? "Copy" : "Convert"}:` : `${M.length} Activities to ${o === "copy" ? "Copy" : "Convert"}:` }),
831
837
  /* @__PURE__ */ e.jsxs(te, { align: "start", spacing: 3, children: [
832
838
  M.map((t, h) => /* @__PURE__ */ e.jsxs(
833
- X,
839
+ Z,
834
840
  {
835
841
  w: "100%",
836
842
  p: 3,
@@ -893,7 +899,7 @@ const Zt = ({
893
899
  t.id
894
900
  )),
895
901
  M.length > 1 && /* @__PURE__ */ e.jsx(
896
- X,
902
+ Z,
897
903
  {
898
904
  w: "100%",
899
905
  p: 2,
@@ -912,9 +918,9 @@ const Zt = ({
912
918
  )
913
919
  ] })
914
920
  ] }),
915
- !c && /* @__PURE__ */ e.jsxs(ge, { spacing: 4, justifyContent: "flex-end", children: [
921
+ !c && /* @__PURE__ */ e.jsxs(xe, { spacing: 4, justifyContent: "flex-end", children: [
916
922
  /* @__PURE__ */ e.jsx(
917
- Z,
923
+ K,
918
924
  {
919
925
  variant: "outline",
920
926
  onClick: T,
@@ -923,10 +929,10 @@ const Zt = ({
923
929
  }
924
930
  ),
925
931
  /* @__PURE__ */ e.jsxs(
926
- Z,
932
+ K,
927
933
  {
928
934
  colorScheme: o === "copy" ? "blue" : "green",
929
- onClick: L,
935
+ onClick: k,
930
936
  isDisabled: M.length === 0 || a,
931
937
  isLoading: a,
932
938
  loadingText: `${o === "copy" ? "Copying" : "Converting"}...`,
@@ -948,51 +954,51 @@ const Zt = ({
948
954
  setButtonOnClick: r,
949
955
  quantumOwned: d
950
956
  }) => {
951
- const b = Ke(), [o, O] = $(""), [y, A] = $([]), [p, C] = $(!1), [a, l] = $("copy"), [m] = ce({
957
+ const b = Ke(), [o, O] = P(""), [y, A] = P([]), [p, C] = P(!1), [a, l] = P("copy"), [m] = ce({
952
958
  query: tt
953
959
  }), [g] = ce({
954
960
  query: Lt,
955
961
  variables: { groupId: o },
956
962
  pause: !o
957
963
  // Only run when group is selected
958
- }), [, x] = re(it), [, S] = re(rt), [, F] = re(Fe), [, _] = re(
964
+ }), [, x] = re(it), [, S] = re(rt), [, F] = re(ze), [, _] = re(
959
965
  nt
960
966
  ), M = D(() => m.data?.groups ? m.data.groups.map(
961
- (t) => P(st, t)
962
- ) : [], [m.data]), E = D(() => g.data?.modules ? P(
967
+ (t) => z(st, t)
968
+ ) : [], [m.data]), E = D(() => g.data?.modules ? z(
963
969
  Se,
964
970
  g.data?.modules
965
971
  ).map((h) => {
966
- const w = P(
972
+ const w = z(
967
973
  ot,
968
974
  h.moduleActions
969
975
  );
970
976
  return {
971
977
  ...h,
972
- moduleActions: w.map((k) => ({
973
- ...k,
974
- action: P(de, k.action)
978
+ moduleActions: w.map((R) => ({
979
+ ...R,
980
+ action: z(de, R.action)
975
981
  })),
976
- categories: P(
982
+ categories: z(
977
983
  ve,
978
984
  h.categories
979
985
  )
980
986
  };
981
987
  }) : [], [g.data]), N = D(() => E.filter(
982
988
  (t) => y.includes(t.id)
983
- ), [E, y]), Q = R(
989
+ ), [E, y]), Y = L(
984
990
  (t) => {
985
991
  const h = t?.value || "";
986
992
  O(h), A([]);
987
993
  },
988
994
  []
989
- ), f = R(
995
+ ), f = L(
990
996
  (t) => {
991
997
  const h = t.map((w) => w.value);
992
998
  A(h);
993
999
  },
994
1000
  []
995
- ), L = R(async () => {
1001
+ ), k = L(async () => {
996
1002
  if (C(!0), !N.length) {
997
1003
  C(!1);
998
1004
  const t = new Error(
@@ -1006,89 +1012,89 @@ const Zt = ({
1006
1012
  let h = 0;
1007
1013
  for (const w of N)
1008
1014
  try {
1009
- let k = w.moduleActions.map((z) => z.actionId);
1015
+ let R = w.moduleActions.map((G) => G.actionId);
1010
1016
  if (d) {
1011
- const z = w.moduleActions.map((B) => B.action), q = async (B) => {
1017
+ const G = w.moduleActions.map((Q) => Q.action), $ = async (Q) => {
1012
1018
  if (a === "copy") {
1013
- if (B.quantumOwned) return B;
1014
- const I = P(
1019
+ if (Q.quantumOwned) return Q;
1020
+ const I = z(
1015
1021
  ve,
1016
- B.categories
1017
- ), Y = {
1018
- ...B,
1022
+ Q.categories
1023
+ ), H = {
1024
+ ...Q,
1019
1025
  quantumOwned: !0,
1020
- thresholds: B.thresholds.map((ee) => ({
1026
+ thresholds: Q.thresholds.map((ee) => ({
1021
1027
  ...ee,
1022
1028
  id: void 0
1023
1029
  })),
1024
1030
  categories: I?.map((ee) => ee.id),
1025
1031
  id: void 0
1026
- }, U = await F({ fields: Y });
1027
- return U.error || !U.data?.createAction ? null : P(
1032
+ }, q = await F({ fields: H });
1033
+ return q.error || !q.data?.createAction ? null : z(
1028
1034
  de,
1029
- U.data.createAction
1035
+ q.data.createAction
1030
1036
  );
1031
1037
  }
1032
- if (B.quantumOwned) return B;
1033
- const xe = await _({
1034
- id: B.id
1038
+ if (Q.quantumOwned) return Q;
1039
+ const pe = await _({
1040
+ id: Q.id
1035
1041
  });
1036
- return xe.error || !xe.data?.convertActionToQuantumOwned ? null : P(
1042
+ return pe.error || !pe.data?.convertActionToQuantumOwned ? null : z(
1037
1043
  de,
1038
- xe.data.convertActionToQuantumOwned
1044
+ pe.data.convertActionToQuantumOwned
1039
1045
  );
1040
1046
  };
1041
- k = (await Promise.all(
1042
- z.map(q)
1043
- )).filter((B) => !!B).map((B) => B.id);
1047
+ R = (await Promise.all(
1048
+ G.map($)
1049
+ )).filter((Q) => !!Q).map((Q) => Q.id);
1044
1050
  }
1045
1051
  if (a === "convert") {
1046
- const z = {
1052
+ const G = {
1047
1053
  name: w.name,
1048
1054
  description: w.description || void 0,
1049
- actions: k,
1050
- categories: w.categories.map((K) => K.id),
1055
+ actions: R,
1056
+ categories: w.categories.map((B) => B.id),
1051
1057
  quantumOwned: !0
1052
- }, q = await S({
1058
+ }, $ = await S({
1053
1059
  id: w.id,
1054
- input: z
1060
+ input: G
1055
1061
  });
1056
- if (q.error) throw new Error(q.error.message);
1057
- if (q.data?.updateModule) {
1058
- const K = P(
1062
+ if ($.error) throw new Error($.error.message);
1063
+ if ($.data?.updateModule) {
1064
+ const B = z(
1059
1065
  Se,
1060
- q.data.updateModule
1066
+ $.data.updateModule
1061
1067
  );
1062
- t.push(K);
1068
+ t.push(B);
1063
1069
  }
1064
1070
  } else {
1065
- const z = {
1071
+ const G = {
1066
1072
  name: `${w.name} (Copy)`,
1067
1073
  description: w.description || void 0,
1068
- actions: k,
1069
- categories: w.categories.map((K) => K.id),
1074
+ actions: R,
1075
+ categories: w.categories.map((B) => B.id),
1070
1076
  quantumOwned: d
1071
- }, q = await x({ input: z });
1072
- if (q.error) throw new Error(q.error.message);
1073
- if (q.data?.createModule) {
1074
- const K = P(
1077
+ }, $ = await x({ input: G });
1078
+ if ($.error) throw new Error($.error.message);
1079
+ if ($.data?.createModule) {
1080
+ const B = z(
1075
1081
  Se,
1076
- q.data.createModule
1082
+ $.data.createModule
1077
1083
  );
1078
- t.push(K);
1084
+ t.push(B);
1079
1085
  }
1080
1086
  }
1081
- } catch (k) {
1087
+ } catch (R) {
1082
1088
  console.error(
1083
1089
  `Failed to ${a === "convert" ? "convert" : "copy"} module "${w.name}":`,
1084
- k
1090
+ R
1085
1091
  ), h++;
1086
1092
  }
1087
1093
  if (t.length > 0) {
1088
- const w = t.length, k = N.length;
1094
+ const w = t.length, R = N.length;
1089
1095
  b({
1090
1096
  title: h > 0 ? `Partial ${a === "convert" ? "convert" : "copy"} completed` : `Modules ${a === "convert" ? "converted" : "copied"} successfully`,
1091
- description: h > 0 ? `${w} of ${k} modules ${a === "convert" ? "converted" : "copied"} successfully` : `${w} module${w > 1 ? "s" : ""} ${a === "convert" ? "converted" : "copied"} successfully`,
1097
+ description: h > 0 ? `${w} of ${R} modules ${a === "convert" ? "converted" : "copied"} successfully` : `${w} module${w > 1 ? "s" : ""} ${a === "convert" ? "converted" : "copied"} successfully`,
1092
1098
  status: h > 0 ? "warning" : "success",
1093
1099
  duration: 3e3,
1094
1100
  isClosable: !0
@@ -1120,7 +1126,7 @@ const Zt = ({
1120
1126
  F,
1121
1127
  _,
1122
1128
  a
1123
- ]), T = R(() => {
1129
+ ]), T = L(() => {
1124
1130
  O(""), A([]), l("copy"), n?.();
1125
1131
  }, [n]);
1126
1132
  se(() => {
@@ -1131,9 +1137,9 @@ const Zt = ({
1131
1137
  }, [N.length, p, u]), se(() => {
1132
1138
  r && r({
1133
1139
  cancelButton: T,
1134
- saveButton: L
1140
+ saveButton: k
1135
1141
  });
1136
- }, [r, T, L]);
1142
+ }, [r, T, k]);
1137
1143
  const V = D(() => M.map((t) => ({
1138
1144
  value: t.id,
1139
1145
  label: t.name
@@ -1142,9 +1148,9 @@ const Zt = ({
1142
1148
  label: t.name,
1143
1149
  // Add custom data to identify quantum-owned modules
1144
1150
  isQuantumOwned: t.quantumOwned
1145
- })), [E, a]), W = m.fetching, H = g.fetching;
1146
- return /* @__PURE__ */ e.jsx(X, { children: /* @__PURE__ */ e.jsxs(te, { spacing: 6, align: "stretch", children: [
1147
- d && /* @__PURE__ */ e.jsxs(J, { children: [
1151
+ })), [E, a]), U = m.fetching, J = g.fetching;
1152
+ return /* @__PURE__ */ e.jsx(Z, { children: /* @__PURE__ */ e.jsxs(te, { spacing: 6, align: "stretch", children: [
1153
+ d && /* @__PURE__ */ e.jsxs(X, { children: [
1148
1154
  /* @__PURE__ */ e.jsx(ie, { children: "Operation Mode" }),
1149
1155
  /* @__PURE__ */ e.jsx(
1150
1156
  Ve,
@@ -1166,7 +1172,7 @@ const Zt = ({
1166
1172
  }
1167
1173
  )
1168
1174
  ] }),
1169
- /* @__PURE__ */ e.jsxs(J, { children: [
1175
+ /* @__PURE__ */ e.jsxs(X, { children: [
1170
1176
  /* @__PURE__ */ e.jsx(ie, { children: "Select Source Group" }),
1171
1177
  /* @__PURE__ */ e.jsx(
1172
1178
  ae,
@@ -1174,9 +1180,9 @@ const Zt = ({
1174
1180
  placeholder: "Choose a group...",
1175
1181
  options: V,
1176
1182
  value: V.find((t) => t.value === o) || null,
1177
- onChange: Q,
1178
- isLoading: W,
1179
- isDisabled: W,
1183
+ onChange: Y,
1184
+ isLoading: U,
1185
+ isDisabled: U,
1180
1186
  isClearable: !0
1181
1187
  }
1182
1188
  ),
@@ -1188,9 +1194,9 @@ const Zt = ({
1188
1194
  ] })
1189
1195
  ] })
1190
1196
  ] }),
1191
- o && /* @__PURE__ */ e.jsxs(J, { children: [
1197
+ o && /* @__PURE__ */ e.jsxs(X, { children: [
1192
1198
  /* @__PURE__ */ e.jsx(ie, { children: a === "convert" ? "Select Module to Convert" : "Select Module to Copy" }),
1193
- H ? /* @__PURE__ */ e.jsxs(ne, { children: [
1199
+ J ? /* @__PURE__ */ e.jsxs(ne, { children: [
1194
1200
  /* @__PURE__ */ e.jsx(et, { size: "sm" }),
1195
1201
  /* @__PURE__ */ e.jsx(v, { fontSize: "sm", color: "gray.600", children: "Loading modules..." })
1196
1202
  ] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
@@ -1226,11 +1232,11 @@ const Zt = ({
1226
1232
  ] })
1227
1233
  ] })
1228
1234
  ] }),
1229
- N.length > 0 && /* @__PURE__ */ e.jsxs(X, { p: 4, bg: "gray.50", borderRadius: "md", children: [
1235
+ N.length > 0 && /* @__PURE__ */ e.jsxs(Z, { p: 4, bg: "gray.50", borderRadius: "md", children: [
1230
1236
  /* @__PURE__ */ e.jsx(v, { fontWeight: "semibold", mb: 3, children: N.length === 1 ? `Module to ${a === "copy" ? "Copy" : "Convert"}` : `${N.length} Modules to ${a === "copy" ? "Copy" : "Convert"}` }),
1231
1237
  /* @__PURE__ */ e.jsxs(te, { align: "start", spacing: 3, children: [
1232
1238
  N.map((t, h) => /* @__PURE__ */ e.jsxs(
1233
- X,
1239
+ Z,
1234
1240
  {
1235
1241
  w: "100%",
1236
1242
  p: 3,
@@ -1278,7 +1284,7 @@ const Zt = ({
1278
1284
  t.id
1279
1285
  )),
1280
1286
  N.length > 1 && /* @__PURE__ */ e.jsx(
1281
- X,
1287
+ Z,
1282
1288
  {
1283
1289
  w: "100%",
1284
1290
  p: 2,
@@ -1296,7 +1302,7 @@ const Zt = ({
1296
1302
  }
1297
1303
  ),
1298
1304
  d && N.filter((t) => t.moduleActions.some((h) => !h.action.quantumOwned)).length > 0 && /* @__PURE__ */ e.jsx(
1299
- X,
1305
+ Z,
1300
1306
  {
1301
1307
  p: 2,
1302
1308
  bg: "yellow.50",
@@ -1308,9 +1314,9 @@ const Zt = ({
1308
1314
  )
1309
1315
  ] })
1310
1316
  ] }),
1311
- !c && /* @__PURE__ */ e.jsxs(ge, { spacing: 4, justifyContent: "flex-end", children: [
1317
+ !c && /* @__PURE__ */ e.jsxs(xe, { spacing: 4, justifyContent: "flex-end", children: [
1312
1318
  /* @__PURE__ */ e.jsx(
1313
- Z,
1319
+ K,
1314
1320
  {
1315
1321
  variant: "outline",
1316
1322
  onClick: T,
@@ -1319,10 +1325,10 @@ const Zt = ({
1319
1325
  }
1320
1326
  ),
1321
1327
  /* @__PURE__ */ e.jsxs(
1322
- Z,
1328
+ K,
1323
1329
  {
1324
1330
  colorScheme: a === "copy" ? "blue" : "green",
1325
- onClick: L,
1331
+ onClick: k,
1326
1332
  isDisabled: N.length === 0 || p,
1327
1333
  isLoading: p,
1328
1334
  loadingText: `${a === "copy" ? "Copying" : "Converting"}...`,
@@ -1354,23 +1360,23 @@ const Zt = ({
1354
1360
  })), [i, c]), C = D(() => i.reduce((x, S) => (x[S.id] = S, x), {}), [i]), a = D(
1355
1361
  () => c.map((x) => C[x]),
1356
1362
  [c, C]
1357
- ), l = R(
1363
+ ), l = L(
1358
1364
  (x, S) => {
1359
1365
  u(S ? [...c, x.id] : c.filter((F) => F !== x.id));
1360
1366
  },
1361
1367
  [c, u]
1362
- ), m = R(
1368
+ ), m = L(
1363
1369
  (x) => {
1364
1370
  n(x.target.value);
1365
1371
  },
1366
1372
  [n]
1367
- ), g = R(
1373
+ ), g = L(
1368
1374
  (x) => {
1369
1375
  O?.(x.target.value);
1370
1376
  },
1371
1377
  [O]
1372
1378
  );
1373
- return /* @__PURE__ */ e.jsxs(X, { ...y, children: [
1379
+ return /* @__PURE__ */ e.jsxs(Z, { ...y, children: [
1374
1380
  /* @__PURE__ */ e.jsxs(ne, { gap: "2rem", children: [
1375
1381
  /* @__PURE__ */ e.jsx(un, { name: s ?? "", onInputChange: m }),
1376
1382
  /* @__PURE__ */ e.jsx(
@@ -1422,7 +1428,7 @@ const Zt = ({
1422
1428
  }
1423
1429
  ) }),
1424
1430
  /* @__PURE__ */ e.jsx(St, { children: /* @__PURE__ */ e.jsx(
1425
- Z,
1431
+ K,
1426
1432
  {
1427
1433
  colorScheme: "blue",
1428
1434
  onClick: A.onClose,
@@ -1439,7 +1445,7 @@ const Zt = ({
1439
1445
  ({
1440
1446
  name: s,
1441
1447
  onInputChange: n
1442
- }) => /* @__PURE__ */ e.jsxs(J, { mb: 4, children: [
1448
+ }) => /* @__PURE__ */ e.jsxs(X, { mb: 4, children: [
1443
1449
  /* @__PURE__ */ e.jsx(ie, { children: "Module Name" }),
1444
1450
  /* @__PURE__ */ e.jsx(
1445
1451
  fe,
@@ -1467,7 +1473,7 @@ const Zt = ({
1467
1473
  value: r.id,
1468
1474
  label: r.name
1469
1475
  })), [c]);
1470
- return /* @__PURE__ */ e.jsxs(J, { mb: 4, children: [
1476
+ return /* @__PURE__ */ e.jsxs(X, { mb: 4, children: [
1471
1477
  /* @__PURE__ */ e.jsx(ie, { children: "Module Category" }),
1472
1478
  /* @__PURE__ */ e.jsx(
1473
1479
  ae,
@@ -1488,7 +1494,7 @@ const Zt = ({
1488
1494
  ({
1489
1495
  description: s,
1490
1496
  onInputChange: n
1491
- }) => /* @__PURE__ */ e.jsxs(J, { mb: 4, children: [
1497
+ }) => /* @__PURE__ */ e.jsxs(X, { mb: 4, children: [
1492
1498
  /* @__PURE__ */ e.jsx(ie, { children: /* @__PURE__ */ e.jsxs("span", { children: [
1493
1499
  "Description",
1494
1500
  /* @__PURE__ */ e.jsx(v, { fontSize: "sm", color: "gray.500", children: "Briefly describe the objective of this module. Max 40 words." })
@@ -1515,14 +1521,14 @@ const Zt = ({
1515
1521
  })),
1516
1522
  [s]
1517
1523
  );
1518
- return /* @__PURE__ */ e.jsxs(J, { mb: 4, children: [
1524
+ return /* @__PURE__ */ e.jsxs(X, { mb: 4, children: [
1519
1525
  /* @__PURE__ */ e.jsxs(ne, { justifyContent: "space-between", children: [
1520
1526
  /* @__PURE__ */ e.jsx(ie, { children: /* @__PURE__ */ e.jsxs("span", { children: [
1521
1527
  "Activities",
1522
1528
  /* @__PURE__ */ e.jsx(v, { fontSize: "sm", color: "gray.500", children: "Drag and drop to reorder the activities in this module." })
1523
1529
  ] }) }),
1524
1530
  /* @__PURE__ */ e.jsx(
1525
- Z,
1531
+ K,
1526
1532
  {
1527
1533
  size: "sm",
1528
1534
  variant: "solid",
@@ -1535,7 +1541,7 @@ const Zt = ({
1535
1541
  c.length === 0 ? /* @__PURE__ */ e.jsx(te, { children: /* @__PURE__ */ e.jsxs(v, { color: "gray.500", fontSize: "lg", mb: "4rem", mt: "4rem", children: [
1536
1542
  "No activities selected for this module.",
1537
1543
  /* @__PURE__ */ e.jsx(
1538
- Z,
1544
+ K,
1539
1545
  {
1540
1546
  ml: "0.5em",
1541
1547
  size: "sm",
@@ -1570,7 +1576,7 @@ const Zt = ({
1570
1576
  const o = D(() => [...s].sort((p, C) => {
1571
1577
  const a = Be.indexOf(p.plane), l = Be.indexOf(C.plane);
1572
1578
  return a - l;
1573
- }), [s]), O = R((p) => "segment" in p.id ? at(p.id.segment, p.plane, !0) ?? "Unknown" : lt(p.id.joint, p.plane, !0) ?? "Unknown", []), y = R(
1579
+ }), [s]), O = L((p) => "segment" in p.id ? at(p.id.segment, p.plane, !0) ?? "Unknown" : lt(p.id.joint, p.plane, !0) ?? "Unknown", []), y = L(
1574
1580
  (p, C) => {
1575
1581
  const a = o.findIndex(
1576
1582
  (m) => m.id === C.id && m.plane === C.plane
@@ -1583,7 +1589,7 @@ const Zt = ({
1583
1589
  }))), n(l);
1584
1590
  },
1585
1591
  [n, o, i, d]
1586
- ), A = R(
1592
+ ), A = L(
1587
1593
  (p) => {
1588
1594
  const C = o.filter(
1589
1595
  (a) => a.id !== p.id || a.plane !== p.plane
@@ -1614,7 +1620,7 @@ const Zt = ({
1614
1620
  disableKind: r,
1615
1621
  isDisabled: d
1616
1622
  }) => {
1617
- const b = R(
1623
+ const b = L(
1618
1624
  (y) => "joint" in n.id ? Qt(
1619
1625
  n.id.joint,
1620
1626
  n.plane,
@@ -1730,7 +1736,7 @@ const Zt = ({
1730
1736
  (l) => n.some((m) => we(m.id, l.value) && m.plane === l.plane)
1731
1737
  ),
1732
1738
  [A, n]
1733
- ), a = R(
1739
+ ), a = L(
1734
1740
  (l) => {
1735
1741
  const m = l.map((g) => {
1736
1742
  const x = n.find(
@@ -1757,7 +1763,7 @@ const Zt = ({
1757
1763
  (m) => s.some((g) => we(g.id, m.id) && g.plane === m.plane)
1758
1764
  );
1759
1765
  l.length !== n.length && i(l);
1760
- }, [s, i]), /* @__PURE__ */ e.jsxs(X, { ...O, children: [
1766
+ }, [s, i]), /* @__PURE__ */ e.jsxs(Z, { ...O, children: [
1761
1767
  /* @__PURE__ */ e.jsx(
1762
1768
  ae,
1763
1769
  {
@@ -1786,47 +1792,47 @@ const Zt = ({
1786
1792
  ] });
1787
1793
  }, ct = (s) => {
1788
1794
  switch (s) {
1789
- case G.Thorax:
1795
+ case W.Thorax:
1790
1796
  return "Thorax";
1791
- case G.CenterBack:
1797
+ case W.CenterBack:
1792
1798
  return "Center Back";
1793
- case G.Pelvis:
1799
+ case W.Pelvis:
1794
1800
  return "Pelvis";
1795
- case G.LeftThigh:
1801
+ case W.LeftThigh:
1796
1802
  return "Left Thigh";
1797
- case G.RightThigh:
1803
+ case W.RightThigh:
1798
1804
  return "Right Thigh";
1799
- case G.LeftShank:
1805
+ case W.LeftShank:
1800
1806
  return "Left Shank";
1801
- case G.RightShank:
1807
+ case W.RightShank:
1802
1808
  return "Right Shank";
1803
- case G.LeftFoot:
1809
+ case W.LeftFoot:
1804
1810
  return "Left Foot";
1805
- case G.RightFoot:
1811
+ case W.RightFoot:
1806
1812
  return "Right Foot";
1807
- case G.LeftUpperArm:
1813
+ case W.LeftUpperArm:
1808
1814
  return "Left Upper Arm";
1809
- case G.RightUpperArm:
1815
+ case W.RightUpperArm:
1810
1816
  return "Right Upper Arm";
1811
- case G.LeftForearm:
1817
+ case W.LeftForearm:
1812
1818
  return "Left Forearm";
1813
- case G.RightForearm:
1819
+ case W.RightForearm:
1814
1820
  return "Right Forearm";
1815
- case G.Head:
1821
+ case W.Head:
1816
1822
  return "Head";
1817
1823
  }
1818
1824
  return console.warn(`Unknown sensor location: ${s}`), "Unknown";
1819
1825
  }, jn = 6, vn = [
1820
- G.LeftFoot,
1821
- G.LeftShank,
1822
- G.LeftThigh,
1823
- G.Pelvis,
1824
- G.RightFoot,
1825
- G.RightShank,
1826
- G.RightThigh,
1827
- G.Thorax,
1828
- G.CenterBack,
1829
- G.Head
1826
+ W.LeftFoot,
1827
+ W.LeftShank,
1828
+ W.LeftThigh,
1829
+ W.Pelvis,
1830
+ W.RightFoot,
1831
+ W.RightShank,
1832
+ W.RightThigh,
1833
+ W.Thorax,
1834
+ W.CenterBack,
1835
+ W.Head
1830
1836
  ], bn = vn.map((s) => ({
1831
1837
  label: ct(s),
1832
1838
  value: s
@@ -1836,7 +1842,7 @@ const Zt = ({
1836
1842
  { key: "session_type", label: "Session Type", multi: !0 },
1837
1843
  { key: "body_region", label: "Body Region", multi: !0 },
1838
1844
  { key: "sport", label: "Sport", multi: !0 }
1839
- ], Pn = ({
1845
+ ], Gn = ({
1840
1846
  id: s,
1841
1847
  onError: n,
1842
1848
  onCancel: i,
@@ -1847,47 +1853,47 @@ const Zt = ({
1847
1853
  quantumOwned: b,
1848
1854
  isView: o
1849
1855
  }) => {
1850
- const O = Nt(), [{ fetching: y }, A] = re(Fe), [{ fetching: p }, C] = re(Dt), [{ data: a }] = ce({
1856
+ const O = Nt(), [{ fetching: y }, A] = re(ze), [{ fetching: p }, C] = re(Dt), [{ data: a }] = ce({
1851
1857
  query: Ft,
1852
1858
  variables: { id: s ?? "" },
1853
1859
  pause: !s
1854
- }), l = P(
1860
+ }), l = z(
1855
1861
  de,
1856
1862
  a?.getActionById
1857
- ), m = y || p, g = !!l && !!s, [x, S] = $(""), [F, _] = $(""), [M, E] = $(""), [N, Q] = $(""), [f, L] = $([]), [T, V] = $([]), [j, W] = $({}), H = D(
1863
+ ), m = y || p, g = !!l && !!s, [x, S] = P(""), [F, _] = P(""), [M, E] = P(""), [N, Y] = P(""), [f, k] = P([]), [T, V] = P([]), [j, U] = P({}), J = D(
1858
1864
  () => f.map((I) => I.value),
1859
1865
  [f]
1860
- ), t = Xt(H), [h, w] = $([]), k = x.length > 0, [z, q] = $({});
1866
+ ), t = Xt(J), [h, w] = P([]), R = x.length > 0, [G, $] = P({});
1861
1867
  se(() => {
1862
1868
  const I = Re.map(
1863
- (Y) => O.query(Rt, { key: Y.key })
1869
+ (H) => O.query(Rt, { key: H.key })
1864
1870
  );
1865
- Promise.all(I).then((Y) => {
1866
- const U = {};
1867
- Y.forEach((ee) => {
1871
+ Promise.all(I).then((H) => {
1872
+ const q = {};
1873
+ H.forEach((ee) => {
1868
1874
  if (ee.error || !ee.data) return;
1869
- const oe = P(
1870
- We,
1875
+ const oe = z(
1876
+ De,
1871
1877
  ee.data.getMetadataByKey
1872
- ), ke = P(
1873
- Ue,
1878
+ ), ke = z(
1879
+ Fe,
1874
1880
  oe.data
1875
1881
  );
1876
- U[oe.key] = ke.map((ue) => ({
1882
+ q[oe.key] = ke.map((ue) => ({
1877
1883
  label: ue.label || ue.value,
1878
1884
  value: ue.value,
1879
1885
  id: ue.id
1880
1886
  }));
1881
- }), W(U);
1887
+ }), U(q);
1882
1888
  });
1883
1889
  }, [O]), se(() => {
1884
1890
  if (l) {
1885
- const Y = P(
1886
- We,
1891
+ const H = z(
1892
+ De,
1887
1893
  l.metadataGroups
1888
1894
  ).map(
1889
- (ee) => ee.data.map((oe) => P(Ue, oe).id)
1890
- ), U = {
1895
+ (ee) => ee.data.map((oe) => z(Fe, oe).id)
1896
+ ), q = {
1891
1897
  name: l.name,
1892
1898
  description: l.description || "",
1893
1899
  cameraPlacement: l.cameraPlacement || "",
@@ -1897,38 +1903,38 @@ const Zt = ({
1897
1903
  value: ee
1898
1904
  })),
1899
1905
  thresholds: Ht(l.thresholds),
1900
- metadataIds: Y.flat()
1906
+ metadataIds: H.flat()
1901
1907
  };
1902
- S(U.name), _(U.description), E(U.cameraPlacement), Q(U.videoLink), L(U.sensorLocations), w(U.thresholds), V(U.metadataIds), q(U);
1908
+ S(q.name), _(q.description), E(q.cameraPlacement), Y(q.videoLink), k(q.sensorLocations), w(q.thresholds), V(q.metadataIds), $(q);
1903
1909
  }
1904
1910
  }, [l]);
1905
- const K = D(
1906
- () => JSON.stringify(z) !== JSON.stringify({
1911
+ const B = D(
1912
+ () => JSON.stringify(G) !== JSON.stringify({
1907
1913
  name: x,
1908
1914
  description: F,
1909
1915
  cameraPlacement: M,
1910
1916
  videoLink: N,
1911
- sensorLocations: H,
1917
+ sensorLocations: J,
1912
1918
  thresholds: Qe(h),
1913
1919
  metadataIds: T
1914
1920
  }),
1915
1921
  [
1916
- z,
1922
+ G,
1917
1923
  x,
1918
- H,
1924
+ J,
1919
1925
  F,
1920
1926
  M,
1921
1927
  N,
1922
1928
  T,
1923
1929
  h
1924
1930
  ]
1925
- ), B = R(() => {
1931
+ ), Q = L(() => {
1926
1932
  const I = {
1927
1933
  name: x,
1928
1934
  description: F,
1929
1935
  cameraPlacement: M,
1930
1936
  videoLink: N,
1931
- sensorLocations: H,
1937
+ sensorLocations: J,
1932
1938
  thresholds: Qe(h),
1933
1939
  metadataItemIds: T,
1934
1940
  // Backend requires laterality; keep existing default since UI no longer edits it
@@ -1937,14 +1943,14 @@ const Zt = ({
1937
1943
  //Backend requires session type; keep existing default since UI no longer edits it
1938
1944
  sessionType: []
1939
1945
  };
1940
- let Y;
1941
- g && s ? Y = C({
1946
+ let H;
1947
+ g && s ? H = C({
1942
1948
  id: s,
1943
1949
  fields: I
1944
- }) : Y = A({
1950
+ }) : H = A({
1945
1951
  fields: I
1946
- }), Y.then(({ error: U }) => {
1947
- U ? n(U) : c();
1952
+ }), H.then(({ error: q }) => {
1953
+ q ? n(q) : c();
1948
1954
  });
1949
1955
  }, [
1950
1956
  b,
@@ -1952,7 +1958,7 @@ const Zt = ({
1952
1958
  C,
1953
1959
  s,
1954
1960
  x,
1955
- H,
1961
+ J,
1956
1962
  F,
1957
1963
  M,
1958
1964
  N,
@@ -1965,21 +1971,21 @@ const Zt = ({
1965
1971
  se(() => {
1966
1972
  d && d({
1967
1973
  cancelButton: m,
1968
- saveButton: o ? !0 : m || !k || !K
1974
+ saveButton: o ? !0 : m || !R || !B
1969
1975
  });
1970
- }, [m, d, k, K, o]), se(() => {
1976
+ }, [m, d, R, B, o]), se(() => {
1971
1977
  r && r({
1972
1978
  cancelButton: i,
1973
1979
  saveButton: o ? () => {
1974
- } : B
1980
+ } : Q
1975
1981
  });
1976
- }, [r, i, B, o]);
1977
- const xe = (I, Y) => {
1978
- const U = Re.find((oe) => oe.key === I);
1979
- if (!U) return;
1980
- const ee = U.multi ? (Y ?? []).map(
1982
+ }, [r, i, Q, o]);
1983
+ const pe = (I, H) => {
1984
+ const q = Re.find((oe) => oe.key === I);
1985
+ if (!q) return;
1986
+ const ee = q.multi ? (H ?? []).map(
1981
1987
  (oe) => oe.id
1982
- ) : Y ? [Y.id] : [];
1988
+ ) : H ? [H.id] : [];
1983
1989
  V((oe) => [...oe.filter((ue) => Object.values(j).flat().find((be) => be.id === ue) && !Object.keys(j).find(
1984
1990
  (be) => j[be]?.some(
1985
1991
  (dt) => dt.id === ue && be === I
@@ -1988,7 +1994,7 @@ const Zt = ({
1988
1994
  };
1989
1995
  return /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-2 gap-4 w-full", children: [
1990
1996
  /* @__PURE__ */ e.jsxs("div", { className: "col-span-2 lg:col-span-1 flex flex-col gap-4", children: [
1991
- /* @__PURE__ */ e.jsxs(J, { children: [
1997
+ /* @__PURE__ */ e.jsxs(X, { children: [
1992
1998
  /* @__PURE__ */ e.jsx(le, { children: "Name" }),
1993
1999
  /* @__PURE__ */ e.jsx(
1994
2000
  fe,
@@ -2001,10 +2007,10 @@ const Zt = ({
2001
2007
  }
2002
2008
  )
2003
2009
  ] }),
2004
- /* @__PURE__ */ e.jsxs(J, { children: [
2010
+ /* @__PURE__ */ e.jsxs(X, { children: [
2005
2011
  /* @__PURE__ */ e.jsx(le, { children: "Camera Placement" }),
2006
2012
  /* @__PURE__ */ e.jsx(
2007
- Ge,
2013
+ Ue,
2008
2014
  {
2009
2015
  value: M,
2010
2016
  onChange: (I) => E(I.target.value),
@@ -2014,23 +2020,23 @@ const Zt = ({
2014
2020
  }
2015
2021
  )
2016
2022
  ] }),
2017
- /* @__PURE__ */ e.jsxs(J, { children: [
2023
+ /* @__PURE__ */ e.jsxs(X, { children: [
2018
2024
  /* @__PURE__ */ e.jsx(le, { children: "Video Link" }),
2019
2025
  /* @__PURE__ */ e.jsx(
2020
2026
  fe,
2021
2027
  {
2022
2028
  value: N,
2023
- onChange: (I) => Q(I.target.value),
2029
+ onChange: (I) => Y(I.target.value),
2024
2030
  type: "url",
2025
2031
  placeholder: "(optional) https://...",
2026
2032
  isDisabled: o
2027
2033
  }
2028
2034
  )
2029
2035
  ] }),
2030
- /* @__PURE__ */ e.jsxs(J, { children: [
2036
+ /* @__PURE__ */ e.jsxs(X, { children: [
2031
2037
  /* @__PURE__ */ e.jsx(le, { children: "Description" }),
2032
2038
  /* @__PURE__ */ e.jsx(
2033
- Ge,
2039
+ Ue,
2034
2040
  {
2035
2041
  value: F,
2036
2042
  onChange: (I) => _(I.target.value),
@@ -2042,17 +2048,17 @@ const Zt = ({
2042
2048
  ] }),
2043
2049
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
2044
2050
  /* @__PURE__ */ e.jsx(le, { children: "Metadata Tags" }),
2045
- Re.map((I) => /* @__PURE__ */ e.jsxs(J, { children: [
2051
+ Re.map((I) => /* @__PURE__ */ e.jsxs(X, { children: [
2046
2052
  /* @__PURE__ */ e.jsx(le, { children: I.label }),
2047
2053
  /* @__PURE__ */ e.jsx(
2048
2054
  ae,
2049
2055
  {
2050
2056
  isMulti: I.multi,
2051
2057
  value: j[I.key]?.filter(
2052
- (Y) => T.includes(Y.id)
2058
+ (H) => T.includes(H.id)
2053
2059
  ),
2054
- onChange: (Y) => {
2055
- xe(I.key, Y);
2060
+ onChange: (H) => {
2061
+ pe(I.key, H);
2056
2062
  },
2057
2063
  options: j[I.key],
2058
2064
  placeholder: `Select ${I.multi ? "one or more" : "one"} ${I.label.toLowerCase()}`,
@@ -2064,21 +2070,21 @@ const Zt = ({
2064
2070
  ] })
2065
2071
  ] }),
2066
2072
  /* @__PURE__ */ e.jsxs("div", { className: "col-span-2 lg:col-span-1 flex flex-col gap-4", children: [
2067
- /* @__PURE__ */ e.jsxs(J, { children: [
2073
+ /* @__PURE__ */ e.jsxs(X, { children: [
2068
2074
  /* @__PURE__ */ e.jsx(le, { children: "Sensor Locations" }),
2069
2075
  /* @__PURE__ */ e.jsx(
2070
2076
  ae,
2071
2077
  {
2072
2078
  isMulti: !0,
2073
2079
  value: f,
2074
- onChange: (I) => L([...I]),
2080
+ onChange: (I) => k([...I]),
2075
2081
  options: bn,
2076
2082
  isOptionDisabled: () => f.length >= jn,
2077
2083
  isDisabled: o
2078
2084
  }
2079
2085
  )
2080
2086
  ] }),
2081
- /* @__PURE__ */ e.jsxs(J, { children: [
2087
+ /* @__PURE__ */ e.jsxs(X, { children: [
2082
2088
  /* @__PURE__ */ e.jsx(le, { children: "Default Parameters" }),
2083
2089
  /* @__PURE__ */ e.jsx(
2084
2090
  fn,
@@ -2098,15 +2104,15 @@ const Zt = ({
2098
2104
  "col-span-2 flex justify-end",
2099
2105
  (u || o) && "hidden"
2100
2106
  ),
2101
- children: /* @__PURE__ */ e.jsxs(ge, { mt: 16, gap: 4, children: [
2102
- /* @__PURE__ */ e.jsx(Z, { colorScheme: "gray", isDisabled: m, onClick: i, children: "Cancel" }),
2107
+ children: /* @__PURE__ */ e.jsxs(xe, { mt: 16, gap: 4, children: [
2108
+ /* @__PURE__ */ e.jsx(K, { colorScheme: "gray", isDisabled: m, onClick: i, children: "Cancel" }),
2103
2109
  /* @__PURE__ */ e.jsx(
2104
- Z,
2110
+ K,
2105
2111
  {
2106
2112
  colorScheme: "blue",
2107
- isDisabled: m || !k || !K,
2113
+ isDisabled: m || !R || !B,
2108
2114
  isLoading: m,
2109
- onClick: B,
2115
+ onClick: Q,
2110
2116
  children: "Save changes"
2111
2117
  }
2112
2118
  )
@@ -2114,7 +2120,7 @@ const Zt = ({
2114
2120
  }
2115
2121
  )
2116
2122
  ] });
2117
- }, le = ({ children: s }) => /* @__PURE__ */ e.jsx(Ye, { fontWeight: "bold", fontFamily: "sans-serif", fontSize: "large", children: s }), $n = ({
2123
+ }, le = ({ children: s }) => /* @__PURE__ */ e.jsx(Ye, { fontWeight: "bold", fontFamily: "sans-serif", fontSize: "large", children: s }), Pn = ({
2118
2124
  id: s,
2119
2125
  onCancel: n,
2120
2126
  onSave: i,
@@ -2131,30 +2137,30 @@ const Zt = ({
2131
2137
  variables: { id: s },
2132
2138
  pause: !s
2133
2139
  }), [{ data: y }] = ce({
2134
- query: Pt
2135
- }), A = P(
2140
+ query: Gt
2141
+ }), A = z(
2136
2142
  ve,
2137
2143
  y?.moduleCategories
2138
- ), [{ fetching: p }, C] = re(rt), [{ fetching: a }, l] = re(it), m = P(
2144
+ ), [{ fetching: p }, C] = re(rt), [{ fetching: a }, l] = re(it), m = z(
2139
2145
  de,
2140
2146
  r ? o?.quantumOwnedActions : o?.actions
2141
- ) ?? [], g = P(Se, O?.module), x = P(ot, g?.moduleActions) ?? [], [S, F] = $([
2147
+ ) ?? [], g = z(Se, O?.module), x = z(ot, g?.moduleActions) ?? [], [S, F] = P([
2142
2148
  ...x.map((T) => T.actionId) ?? []
2143
- ]), [_, M] = $(g?.name ?? ""), [E, N] = $([]), [Q, f] = $(g?.description ?? "");
2149
+ ]), [_, M] = P(g?.name ?? ""), [E, N] = P([]), [Y, f] = P(g?.description ?? "");
2144
2150
  se(() => {
2145
2151
  g && (F(x.map((T) => T.actionId)), M(g.name), f(g.description ?? ""), N(
2146
2152
  g.categories.map(
2147
- (T) => P(ve, T).id
2153
+ (T) => z(ve, T).id
2148
2154
  ) ?? []
2149
2155
  ));
2150
2156
  }, [g, x]);
2151
- const L = R(() => {
2157
+ const k = L(() => {
2152
2158
  let T;
2153
2159
  const V = {
2154
2160
  actions: S,
2155
2161
  name: _,
2156
2162
  categories: E.filter((j) => j !== "other"),
2157
- description: Q,
2163
+ description: Y,
2158
2164
  quantumOwned: r
2159
2165
  };
2160
2166
  g ? T = C({
@@ -2170,7 +2176,7 @@ const Zt = ({
2170
2176
  C,
2171
2177
  S,
2172
2178
  _,
2173
- Q,
2179
+ Y,
2174
2180
  E,
2175
2181
  g,
2176
2182
  i,
@@ -2180,14 +2186,14 @@ const Zt = ({
2180
2186
  return se(() => {
2181
2187
  b && b({
2182
2188
  cancelButton: p || a,
2183
- saveButton: p || a || !_ || Q.trim().split(/\s+/).filter(Boolean).length > 40
2189
+ saveButton: p || a || !_ || Y.trim().split(/\s+/).filter(Boolean).length > 40
2184
2190
  });
2185
- }, [b, p, a, S, _, Q]), se(() => {
2191
+ }, [b, p, a, S, _, Y]), se(() => {
2186
2192
  d && d({
2187
2193
  cancelButton: n,
2188
- saveButton: L
2194
+ saveButton: k
2189
2195
  });
2190
- }, [d, n, L]), /* @__PURE__ */ e.jsxs(X, { width: "100%", children: [
2196
+ }, [d, n, k]), /* @__PURE__ */ e.jsxs(Z, { width: "100%", children: [
2191
2197
  /* @__PURE__ */ e.jsx(
2192
2198
  dn,
2193
2199
  {
@@ -2199,13 +2205,13 @@ const Zt = ({
2199
2205
  availableCategories: A ?? [],
2200
2206
  selectedCategoryIds: E,
2201
2207
  setSelectedCategoryIds: N,
2202
- description: Q,
2208
+ description: Y,
2203
2209
  setDescription: f
2204
2210
  }
2205
2211
  ),
2206
- !u && /* @__PURE__ */ e.jsx(ne, { justifyContent: "flex-start", children: /* @__PURE__ */ e.jsxs(ge, { mt: 16, gap: 4, children: [
2212
+ !u && /* @__PURE__ */ e.jsx(ne, { justifyContent: "flex-start", children: /* @__PURE__ */ e.jsxs(xe, { mt: 16, gap: 4, children: [
2207
2213
  /* @__PURE__ */ e.jsx(
2208
- Z,
2214
+ K,
2209
2215
  {
2210
2216
  colorScheme: "gray",
2211
2217
  isDisabled: p || a,
@@ -2214,12 +2220,12 @@ const Zt = ({
2214
2220
  }
2215
2221
  ),
2216
2222
  /* @__PURE__ */ e.jsx(
2217
- Z,
2223
+ K,
2218
2224
  {
2219
2225
  colorScheme: "blue",
2220
- isDisabled: p || a || !_ || Q.trim().split(/\s+/).filter(Boolean).length > 40,
2226
+ isDisabled: p || a || !_ || Y.trim().split(/\s+/).filter(Boolean).length > 40,
2221
2227
  isLoading: p || a,
2222
- onClick: L,
2228
+ onClick: k,
2223
2229
  children: "Save"
2224
2230
  }
2225
2231
  )
@@ -2233,6 +2239,6 @@ export {
2233
2239
  dn as ModuleForm,
2234
2240
  gn as ParameterEditList,
2235
2241
  fn as ParameterEditSelect,
2236
- Pn as UpsertActivityForm,
2237
- $n as UpsertModuleForm
2242
+ Gn as UpsertActivityForm,
2243
+ Pn as UpsertModuleForm
2238
2244
  };