quantum-component-library 1.4.53-dev.1 → 1.4.53-dev.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist/components.cjs +1 -1
  2. package/dist/components.js +965 -965
  3. package/dist/{dnd-core-vendor-CxLn_KVZ.js → dnd-core-vendor-Dl2_2nro.js} +2 -2
  4. package/dist/{dnd-core-vendor-BpIne3vw.cjs → dnd-core-vendor-JZjD_Td8.cjs} +1 -1
  5. package/dist/{graphql-vendor-D1Yd8wq_.cjs → graphql-vendor-B7q7Yz13.cjs} +1 -1
  6. package/dist/{graphql-vendor-Cx8Mc6Yz.js → graphql-vendor-e0-pkqHq.js} +1 -1
  7. package/dist/hooks.cjs +1 -1
  8. package/dist/hooks.js +3 -3
  9. package/dist/index.cjs +1 -1
  10. package/dist/index.js +3 -3
  11. package/dist/lib/services/reports.d.ts +5 -0
  12. package/dist/{lodash-vendor-3vLqZYsK.js → lodash-vendor-CNINpQjK.js} +1 -1
  13. package/dist/{lodash-vendor-BXoJ3fY7.cjs → lodash-vendor-DUcUuCwh.cjs} +1 -1
  14. package/dist/{other-V9jzzJwZ.js → other-Bc-jVnzY.js} +2 -2
  15. package/dist/{other-DNeraOC1.cjs → other-CIQ4hL6N.cjs} +1 -1
  16. package/dist/{react-dnd-vendor-GZ764FSN.cjs → react-dnd-vendor-D97_L5Fj.cjs} +1 -1
  17. package/dist/{react-dnd-vendor-DpRaxBS3.js → react-dnd-vendor-cqCcPDYo.js} +2 -2
  18. package/dist/{react-select-vendor-DAt1SKof.js → react-select-vendor-Dm7JCXQl.js} +1 -1
  19. package/dist/{react-select-vendor-2_u9DhYj.cjs → react-select-vendor-DpstHMZN.cjs} +1 -1
  20. package/dist/{services-human-CoaB5w4L.js → services-human-BFuIf4vd.js} +138 -103
  21. package/dist/{services-human-BelpNNkM.cjs → services-human-BTPVJl80.cjs} +1 -1
  22. package/dist/services.cjs +1 -1
  23. package/dist/services.js +61 -70
  24. package/dist/types.cjs +1 -1
  25. package/dist/types.js +3 -3
  26. package/dist/{utils-conversion-CuA6asju.cjs → utils-conversion-DP8LonZS.cjs} +1 -1
  27. package/dist/{utils-conversion-C9aq8_At.js → utils-conversion-DSzF0R3j.js} +1 -1
  28. package/dist/utils.cjs +1 -1
  29. package/dist/utils.js +1 -1
  30. package/dist/{vendor-Bap2-34A.js → vendor-2NwaL0dE.js} +1 -1
  31. package/dist/{vendor-BUPEP1f9.cjs → vendor-vQ2gqPbn.cjs} +1 -1
  32. package/package.json +1 -1
@@ -1,31 +1,31 @@
1
1
  import { j as e } from "./react-jsx-runtime-vendor-OVHDjVDe.js";
2
2
  import "./moment-vendor-DMLRxgRE.js";
3
- import { Flex as Ie, InputGroup as it, InputLeftElement as Pt, Icon as yt, Input as ve, FormLabel as Xe, ButtonGroup as Ae, Tooltip as st, Button as se, Box as te, RangeSlider as Gt, RangeSliderMark as nt, Text as S, RangeSliderTrack as Et, RangeSliderFilledTrack as _t, RangeSliderThumb as lt, Select as ct, NumberInput as dt, NumberInputField as ut, HStack as re, Tag as $e, FormControl as Y, TableContainer as zt, Table as Bt, Thead as Wt, Tr as mt, Th as Re, Tbody as Ut, Td as _e, Image as Qt, useToast as vt, VStack as de, RadioGroup as Ct, Radio as Ye, Alert as He, AlertIcon as Je, Spinner as wt, useDisclosure as qt, Modal as Kt, ModalOverlay as Yt, ModalContent as Ht, ModalHeader as Jt, ModalCloseButton as Xt, ModalBody as Zt, ModalFooter as Vt, Badge as St, IconButton as en, Tabs as tn, TabList as nn, Tab as ht, TabPanels as sn, TabPanel as pt, Textarea as ze } from "@chakra-ui/react";
3
+ import { Flex as Ie, InputGroup as it, InputLeftElement as Pt, Icon as yt, Input as ve, FormLabel as Xe, ButtonGroup as Ae, Tooltip as st, Button as se, Box as te, RangeSlider as Gt, RangeSliderMark as nt, Text as S, RangeSliderTrack as Et, RangeSliderFilledTrack as _t, RangeSliderThumb as lt, Select as ct, NumberInput as dt, NumberInputField as ut, HStack as re, Tag as $e, FormControl as Y, TableContainer as zt, Table as Bt, Thead as Wt, Tr as mt, Th as Re, Tbody as Ut, Td as _e, Image as Qt, useToast as vt, VStack as ue, RadioGroup as Ct, Radio as Ye, Alert as He, AlertIcon as Je, Spinner as wt, useDisclosure as qt, Modal as Kt, ModalOverlay as Yt, ModalContent as Ht, ModalHeader as Jt, ModalCloseButton as Xt, ModalBody as Zt, ModalFooter as Vt, Badge as St, IconButton as en, Tabs as tn, TabList as nn, Tab as ht, TabPanels as sn, TabPanel as pt, Textarea as ze } from "@chakra-ui/react";
4
4
  import { useMemo as k, useState as _, useEffect as le, useCallback as G, createContext as rn, useContext as on, memo as Me, useRef as an } from "react";
5
5
  import { getFragmentData as I } from "./generated.js";
6
6
  import { G as rt, M as je, a as be, b as Lt, c as ln, C as ot, d as It, e as Mt, R as Ze, f as De, T as Oe, A as Ce, g as cn, h as Ot, U as At, i as Qe, j as kt, k as dn, l as un, m as mn, n as hn, o as pn, p as gn } from "./graphql-CN-pqRpK.js";
7
7
  import { c as qe } from "./utils-cn-CgdSr4hO.js";
8
- import "./lodash-vendor-3vLqZYsK.js";
8
+ import "./lodash-vendor-CNINpQjK.js";
9
9
  import { useClient as at, useQuery as we, useMutation as fe } from "urql";
10
10
  import { useUiLabelContext as xe, useAllPartParameters as xn } from "./hooks.js";
11
11
  import { u as fn } from "./ufuzzy-vendor-Dl0ZI6Av.js";
12
- import { s as me } from "./react-select-vendor-DAt1SKof.js";
12
+ import { s as he } from "./react-select-vendor-Dm7JCXQl.js";
13
13
  import { F as jn, a as bn, b as yn, c as vn } from "./react-icons-vendor-CMsTQrA0.js";
14
14
  import { reportKindName as Le } from "./services.js";
15
- import { D as Cn, H as wn, u as Sn, a as Ln } from "./react-dnd-vendor-DpRaxBS3.js";
16
- import { g as Tt, a as Nt, b as In, c as Mn, d as On, e as gt, f as xt } from "./services-human-CoaB5w4L.js";
17
- import { ThresholdKind as Ke, ReportKind as ae, ActionLaterality as An, SensorLocation as ue } from "./generated-graphql.js";
15
+ import { D as Cn, H as wn, u as Sn, a as Ln } from "./react-dnd-vendor-cqCcPDYo.js";
16
+ import { g as Tt, a as Nt, b as In, c as Mn, d as On, e as gt, f as xt } from "./services-human-BFuIf4vd.js";
17
+ import { ThresholdKind as Ke, ReportKind as ae, ActionLaterality as An, SensorLocation as me } from "./generated-graphql.js";
18
18
  import { availablePlanes as ft, getAnalysisPartIdNoSide as Be } from "./types.js";
19
19
  const kn = ({
20
20
  setSearch: r,
21
21
  actions: n,
22
- updateUseCases: a,
23
- hideUseCaseFilter: h = !1
22
+ updateUseCases: i,
23
+ hideUseCaseFilter: m = !1
24
24
  }) => {
25
- const x = k(
26
- () => n?.flatMap((m) => m.useCases).filter((m, u, p) => p.findIndex((s) => s.id === m.id) === u).map((m) => ({
27
- label: m.name,
28
- value: m.id
25
+ const g = k(
26
+ () => n?.flatMap((u) => u.useCases).filter((u, d, h) => h.findIndex((s) => s.id === u.id) === d).map((u) => ({
27
+ label: u.name,
28
+ value: u.id
29
29
  })) || [],
30
30
  [n]
31
31
  );
@@ -37,26 +37,26 @@ const kn = ({
37
37
  {
38
38
  placeholder: "Search by name...",
39
39
  width: "100%",
40
- maxW: h ? void 0 : "30rem",
41
- onChange: (m) => r(m.target.value)
40
+ maxW: m ? void 0 : "30rem",
41
+ onChange: (u) => r(u.target.value)
42
42
  }
43
43
  )
44
44
  ] }),
45
- !h && /* @__PURE__ */ e.jsx(it, { size: "md", children: /* @__PURE__ */ e.jsx(
46
- me,
45
+ !m && /* @__PURE__ */ e.jsx(it, { size: "md", children: /* @__PURE__ */ e.jsx(
46
+ he,
47
47
  {
48
48
  size: "md",
49
49
  chakraStyles: {
50
- container: (m) => ({
51
- ...m,
50
+ container: (u) => ({
51
+ ...u,
52
52
  width: "100%"
53
53
  })
54
54
  },
55
55
  menuPortalTarget: document.body,
56
56
  placeholder: "Filter use case",
57
57
  isMulti: !0,
58
- options: x,
59
- onChange: (m) => a(m.map((u) => u.value))
58
+ options: g,
59
+ onChange: (u) => i(u.map((d) => d.value))
60
60
  }
61
61
  ) })
62
62
  ] });
@@ -65,13 +65,13 @@ const kn = ({
65
65
  }) => /* @__PURE__ */ e.jsx(Xe, { fontWeight: "bold", fontFamily: "sans-serif", fontSize: "large", children: r }), Tn = ({
66
66
  items: r,
67
67
  onChange: n,
68
- selectedItem: a,
69
- isDisabled: h,
70
- selectedProps: x,
71
- buttonProps: m
68
+ selectedItem: i,
69
+ isDisabled: m,
70
+ selectedProps: g,
71
+ buttonProps: u
72
72
  }) => {
73
- const u = (s) => s === a || s.value === a, p = (s) => u(s) ? { ...m, ...x } : m;
74
- return /* @__PURE__ */ e.jsx(Ae, { isAttached: !0, isDisabled: h, children: r.map((s, i) => /* @__PURE__ */ e.jsx(
73
+ const d = (s) => s === i || s.value === i, h = (s) => d(s) ? { ...u, ...g } : u;
74
+ return /* @__PURE__ */ e.jsx(Ae, { isAttached: !0, isDisabled: m, children: r.map((s, l) => /* @__PURE__ */ e.jsx(
75
75
  st,
76
76
  {
77
77
  label: s.tooltip,
@@ -83,73 +83,73 @@ const kn = ({
83
83
  children: /* @__PURE__ */ e.jsx(
84
84
  se,
85
85
  {
86
- onClick: () => u(s) ? null : n(s, i),
86
+ onClick: () => d(s) ? null : n(s, l),
87
87
  isDisabled: s.disabled,
88
- ...p(s),
88
+ ...h(s),
89
89
  children: s.label
90
90
  }
91
91
  )
92
92
  },
93
- i
93
+ l
94
94
  )) });
95
95
  }, We = (r, n) => n < 0 ? -1 * Math.abs(r) : Math.abs(r), Nn = ({
96
96
  isReversed: r,
97
97
  min: n,
98
- max: a,
99
- value: h,
100
- onChange: x,
101
- inputProps: m,
102
- size: u,
103
- zeroMarker: p,
98
+ max: i,
99
+ value: m,
100
+ onChange: g,
101
+ inputProps: u,
102
+ size: d,
103
+ zeroMarker: h,
104
104
  formatValue: s,
105
- valueLabel: i,
106
- positiveNegativeLabels: g,
107
- isDisabled: C,
105
+ valueLabel: l,
106
+ positiveNegativeLabels: p,
107
+ isDisabled: v,
108
108
  ...L
109
109
  }) => {
110
- const [M, w] = _([void 0, void 0]), v = M[0], c = M[1], d = p && n < -5 && a > 5, b = Number(h?.[0] ?? c ?? n) > 0 ? 1 : -1, j = Number(h?.[1] ?? c ?? a) < 0 ? -1 : 1, A = g?.[0] === g?.[1], $ = h?.[0], D = h?.[1];
110
+ const [M, w] = _([void 0, void 0]), y = M[0], x = M[1], a = h && n < -5 && i > 5, C = Number(m?.[0] ?? x ?? n) > 0 ? 1 : -1, j = Number(m?.[1] ?? x ?? i) < 0 ? -1 : 1, O = p?.[0] === p?.[1], R = m?.[0], $ = m?.[1];
111
111
  le(() => {
112
- $ !== void 0 && D !== void 0 && w([$.toFixed(0), D.toFixed(0)]);
113
- }, [$, D, w]);
114
- const O = G(
115
- ([T, z]) => {
116
- T < z && w([T.toFixed(0), z.toFixed(0)]);
112
+ R !== void 0 && $ !== void 0 && w([R.toFixed(0), $.toFixed(0)]);
113
+ }, [R, $, w]);
114
+ const A = G(
115
+ ([N, z]) => {
116
+ N < z && w([N.toFixed(0), z.toFixed(0)]);
117
117
  },
118
118
  [w]
119
- ), R = G(
120
- ([T, z]) => {
121
- T < z && x([T, z]);
119
+ ), T = G(
120
+ ([N, z]) => {
121
+ N < z && g([N, z]);
122
122
  },
123
- [x]
123
+ [g]
124
124
  ), J = G(() => {
125
- w(([T, z]) => {
126
- const X = isNaN(Number(T)) ? n : Number(T), W = isNaN(Number(z)) ? a : Number(z), H = We(Number(X), b), l = We(Number(W), j), t = b < 0 ? Math.max(H, n) : Math.min(H, a), o = j < 0 ? Math.max(l, n) : Math.min(l, a);
127
- return t > o ? (x([o, t]), [o.toFixed(0), t.toFixed(0)]) : (x([t, o]), [t.toFixed(0), o.toFixed(0)]);
125
+ w(([N, z]) => {
126
+ const X = isNaN(Number(N)) ? n : Number(N), W = isNaN(Number(z)) ? i : Number(z), H = We(Number(X), C), c = We(Number(W), j), t = C < 0 ? Math.max(H, n) : Math.min(H, i), o = j < 0 ? Math.max(c, n) : Math.min(c, i);
127
+ return t > o ? (g([o, t]), [o.toFixed(0), t.toFixed(0)]) : (g([t, o]), [t.toFixed(0), o.toFixed(0)]);
128
128
  });
129
- }, [x, w, b, j, n, a]), oe = G(
130
- (T) => {
131
- const z = T === "" || isNaN(Number(T)) ? T : We(Number(T), b);
129
+ }, [g, w, C, j, n, i]), oe = G(
130
+ (N) => {
131
+ const z = N === "" || isNaN(Number(N)) ? N : We(Number(N), C);
132
132
  w(([X, W]) => [z.toString(), W]);
133
133
  },
134
- [w, b]
135
- ), N = G(
136
- (T) => {
137
- const z = T === "" || isNaN(Number(T)) ? T : We(Number(T), j);
134
+ [w, C]
135
+ ), D = G(
136
+ (N) => {
137
+ const z = N === "" || isNaN(Number(N)) ? N : We(Number(N), j);
138
138
  w(([X, W]) => [X, z.toString()]);
139
139
  },
140
140
  [w, j]
141
- ), V = k(
142
- () => u === "xs" ? "0.75rem" : void 0,
143
- [u]
144
- ), ee = G(
145
- (T, z) => {
141
+ ), Z = k(
142
+ () => d === "xs" ? "0.75rem" : void 0,
143
+ [d]
144
+ ), V = G(
145
+ (N, z) => {
146
146
  const X = Number(z.target.value);
147
- if (!v || !c || ![-1, 1].includes(X))
147
+ if (!y || !x || ![-1, 1].includes(X))
148
148
  return;
149
- const W = (t) => X < 0 ? -1 * Math.abs(t) : Math.abs(t), H = T ? W(Number(v)) : Number(v), l = T ? Number(c) : W(Number(c));
150
- H > l ? x([l, H]) : x([H, l]);
149
+ const W = (t) => X < 0 ? -1 * Math.abs(t) : Math.abs(t), H = N ? W(Number(y)) : Number(y), c = N ? Number(x) : W(Number(x));
150
+ H > c ? g([c, H]) : g([H, c]);
151
151
  },
152
- [v, c, x]
152
+ [y, x, g]
153
153
  );
154
154
  return /* @__PURE__ */ e.jsxs(Ie, { direction: "column", ...L, children: [
155
155
  /* @__PURE__ */ e.jsx(te, { pt: "1em", mb: "-0.5em", children: /* @__PURE__ */ e.jsxs(
@@ -157,36 +157,36 @@ const kn = ({
157
157
  {
158
158
  "aria-label": ["min", "max"],
159
159
  isReversed: r,
160
- value: [Number(v ?? n), Number(c ?? a)],
161
- max: a,
160
+ value: [Number(y ?? n), Number(x ?? i)],
161
+ max: i,
162
162
  min: n,
163
163
  minStepsBetweenThumbs: 3,
164
164
  step: 1,
165
- onChange: O,
166
- onChangeEnd: R,
167
- isDisabled: C,
165
+ onChange: A,
166
+ onChangeEnd: T,
167
+ isDisabled: v,
168
168
  children: [
169
169
  /* @__PURE__ */ e.jsx(nt, { value: n, top: "-1em", children: /* @__PURE__ */ e.jsx(
170
170
  S,
171
171
  {
172
- fontSize: u ?? "sm",
172
+ fontSize: d ?? "sm",
173
173
  fontWeight: "semibold",
174
174
  whiteSpace: "nowrap",
175
175
  children: s ? s?.(n) : n
176
176
  }
177
177
  ) }),
178
- /* @__PURE__ */ e.jsx(nt, { value: a, top: "-1em", children: /* @__PURE__ */ e.jsx(
178
+ /* @__PURE__ */ e.jsx(nt, { value: i, top: "-1em", children: /* @__PURE__ */ e.jsx(
179
179
  S,
180
180
  {
181
- fontSize: u ?? "sm",
181
+ fontSize: d ?? "sm",
182
182
  fontWeight: "semibold",
183
183
  style: { transform: "translateX(-100%)" },
184
184
  whiteSpace: "nowrap",
185
- children: s ? s(a) : a
185
+ children: s ? s(i) : i
186
186
  }
187
187
  ) }),
188
- d && /* @__PURE__ */ e.jsxs(nt, { value: 0, top: "-1em", pos: "relative", children: [
189
- /* @__PURE__ */ e.jsx(S, { fontSize: u, fontWeight: "semibold", children: s?.(0) ?? "0" }),
188
+ a && /* @__PURE__ */ e.jsxs(nt, { value: 0, top: "-1em", pos: "relative", children: [
189
+ /* @__PURE__ */ e.jsx(S, { fontSize: d, fontWeight: "semibold", children: s?.(0) ?? "0" }),
190
190
  /* @__PURE__ */ e.jsx(
191
191
  te,
192
192
  {
@@ -200,12 +200,12 @@ const kn = ({
200
200
  )
201
201
  ] }),
202
202
  /* @__PURE__ */ e.jsx(Et, { children: /* @__PURE__ */ e.jsx(_t, {}) }),
203
- /* @__PURE__ */ e.jsx(lt, { index: 0, w: V, h: V }),
204
- /* @__PURE__ */ e.jsx(lt, { index: 1, w: V, h: V })
203
+ /* @__PURE__ */ e.jsx(lt, { index: 0, w: Z, h: Z }),
204
+ /* @__PURE__ */ e.jsx(lt, { index: 1, w: Z, h: Z })
205
205
  ]
206
206
  }
207
207
  ) }),
208
- i && /* @__PURE__ */ e.jsxs(
208
+ l && /* @__PURE__ */ e.jsxs(
209
209
  Ie,
210
210
  {
211
211
  direction: r ? "row-reverse" : "row",
@@ -214,19 +214,19 @@ const kn = ({
214
214
  /* @__PURE__ */ e.jsx(
215
215
  S,
216
216
  {
217
- fontSize: u ?? "sm",
217
+ fontSize: d ?? "sm",
218
218
  fontWeight: "semibold",
219
219
  whiteSpace: "nowrap",
220
- children: i(n)
220
+ children: l(n)
221
221
  }
222
222
  ),
223
223
  /* @__PURE__ */ e.jsx(
224
224
  S,
225
225
  {
226
- fontSize: u ?? "sm",
226
+ fontSize: d ?? "sm",
227
227
  fontWeight: "semibold",
228
228
  whiteSpace: "nowrap",
229
- children: i(a)
229
+ children: l(i)
230
230
  }
231
231
  )
232
232
  ]
@@ -240,18 +240,18 @@ const kn = ({
240
240
  alignItems: "center",
241
241
  gap: "0.125em",
242
242
  children: [
243
- g && /* @__PURE__ */ e.jsxs(
243
+ p && /* @__PURE__ */ e.jsxs(
244
244
  ct,
245
245
  {
246
246
  width: "auto",
247
- size: u,
247
+ size: d,
248
248
  fontWeight: "bold",
249
- value: b,
250
- onChange: (T) => ee(!0, T),
251
- isDisabled: A || C,
249
+ value: C,
250
+ onChange: (N) => V(!0, N),
251
+ isDisabled: O || v,
252
252
  children: [
253
- /* @__PURE__ */ e.jsx("option", { value: -1, children: g[0] }),
254
- /* @__PURE__ */ e.jsx("option", { value: 1, children: g[1] })
253
+ /* @__PURE__ */ e.jsx("option", { value: -1, children: p[0] }),
254
+ /* @__PURE__ */ e.jsx("option", { value: 1, children: p[1] })
255
255
  ]
256
256
  }
257
257
  ),
@@ -259,17 +259,17 @@ const kn = ({
259
259
  dt,
260
260
  {
261
261
  precision: 0,
262
- size: u ?? "sm",
262
+ size: d ?? "sm",
263
263
  min: 0,
264
- max: b < 0 ? Math.abs(n) : D ?? a,
265
- value: v === "" ? "" : Math.abs(Number(v ?? n)),
264
+ max: C < 0 ? Math.abs(n) : $ ?? i,
265
+ value: y === "" ? "" : Math.abs(Number(y ?? n)),
266
266
  onChange: oe,
267
267
  onBlur: J,
268
268
  borderWidth: 1,
269
269
  borderRadius: 3,
270
270
  borderColor: "#ccc",
271
- isDisabled: C,
272
- ...m,
271
+ isDisabled: v,
272
+ ...u,
273
273
  children: /* @__PURE__ */ e.jsx(
274
274
  ut,
275
275
  {
@@ -283,18 +283,18 @@ const kn = ({
283
283
  /* @__PURE__ */ e.jsx(
284
284
  dt,
285
285
  {
286
- size: u ?? "sm",
286
+ size: d ?? "sm",
287
287
  min: 0,
288
- max: j < 0 ? Math.abs($ ?? n) : a,
288
+ max: j < 0 ? Math.abs(R ?? n) : i,
289
289
  precision: 0,
290
- value: c === "" ? "" : Math.abs(Number(c ?? a)),
291
- onChange: N,
290
+ value: x === "" ? "" : Math.abs(Number(x ?? i)),
291
+ onChange: D,
292
292
  onBlur: J,
293
293
  borderWidth: 1,
294
294
  borderRadius: 3,
295
295
  borderColor: "#ccc",
296
- isDisabled: C,
297
- ...m,
296
+ isDisabled: v,
297
+ ...u,
298
298
  children: /* @__PURE__ */ e.jsx(
299
299
  ut,
300
300
  {
@@ -305,18 +305,18 @@ const kn = ({
305
305
  )
306
306
  }
307
307
  ),
308
- g && /* @__PURE__ */ e.jsxs(
308
+ p && /* @__PURE__ */ e.jsxs(
309
309
  ct,
310
310
  {
311
311
  width: "auto",
312
- size: u,
312
+ size: d,
313
313
  fontWeight: "bold",
314
314
  value: j,
315
- onChange: (T) => ee(!1, T),
316
- isDisabled: A || C,
315
+ onChange: (N) => V(!1, N),
316
+ isDisabled: O || v,
317
317
  children: [
318
- /* @__PURE__ */ e.jsx("option", { value: -1, children: g[0] }),
319
- /* @__PURE__ */ e.jsx("option", { value: 1, children: g[1] })
318
+ /* @__PURE__ */ e.jsx("option", { value: -1, children: p[0] }),
319
+ /* @__PURE__ */ e.jsx("option", { value: 1, children: p[1] })
320
320
  ]
321
321
  }
322
322
  )
@@ -324,17 +324,17 @@ const kn = ({
324
324
  }
325
325
  )
326
326
  ] });
327
- }, Rn = ({ tags: r, containerProps: n, ...a }) => /* @__PURE__ */ e.jsx(re, { ...n, children: r.map((h, x) => /* @__PURE__ */ e.jsx($e, { ...a, children: h }, x)) }), $n = new fn({}), Dn = ({
327
+ }, Rn = ({ tags: r, containerProps: n, ...i }) => /* @__PURE__ */ e.jsx(re, { ...n, children: r.map((m, g) => /* @__PURE__ */ e.jsx($e, { ...i, children: m }, g)) }), $n = new fn({}), Dn = ({
328
328
  action: r,
329
329
  quantumIconSrc: n
330
330
  }) => {
331
- const { getLabel: a } = xe(), h = k(() => ({
332
- actionLowerCase: a("action").toLocaleLowerCase()
333
- }), [a]);
331
+ const { getLabel: i } = xe(), m = k(() => ({
332
+ actionLowerCase: i("action").toLocaleLowerCase()
333
+ }), [i]);
334
334
  return r.quantumOwned ? /* @__PURE__ */ e.jsx(
335
335
  st,
336
336
  {
337
- label: `This ${h.actionLowerCase} is owned by Quantum`,
337
+ label: `This ${m.actionLowerCase} is owned by Quantum`,
338
338
  "aria-label": "Quantum owned",
339
339
  children: /* @__PURE__ */ e.jsx(
340
340
  te,
@@ -350,7 +350,7 @@ const kn = ({
350
350
  {
351
351
  src: n,
352
352
  boxSize: "1em",
353
- alt: `Quantum-owned ${h.actionLowerCase}`
353
+ alt: `Quantum-owned ${m.actionLowerCase}`
354
354
  }
355
355
  )
356
356
  }
@@ -360,79 +360,79 @@ const kn = ({
360
360
  }, Fn = (r, n) => {
361
361
  if (!n || !n.trim().length)
362
362
  return r;
363
- const a = r.map((x) => x.name ?? "");
364
- return $n.filter(a, n)?.map((x) => r[x]) ?? [];
363
+ const i = r.map((g) => g.name ?? "");
364
+ return $n.filter(i, n)?.map((g) => r[g]) ?? [];
365
365
  }, Pn = (r) => !r || r.length === 0 ? "None" : r.map(
366
366
  (n) => (
367
367
  // Convert camelCase to separate words (e.g., 'LeftFoot' -> 'Left Foot')
368
368
  n.replace(/([A-Z])/g, " $1").trim()
369
369
  )
370
370
  ).join(", "), Gn = (r, n) => !n || n.length == 0 ? r : r.filter(
371
- (a) => a.useCases?.some((h) => n.includes(h.id)) ?? !1
372
- ), En = (r, n, a) => !n || n.length === 0 ? r : r.filter((h) => {
373
- const x = {};
374
- return n.forEach((m) => {
375
- for (const [u, p] of Object.entries(a || {}))
376
- if (p.some((s) => s.id === m)) {
377
- x[u] || (x[u] = []), x[u].push(m);
371
+ (i) => i.useCases?.some((m) => n.includes(m.id)) ?? !1
372
+ ), En = (r, n, i) => !n || n.length === 0 ? r : r.filter((m) => {
373
+ const g = {};
374
+ return n.forEach((u) => {
375
+ for (const [d, h] of Object.entries(i || {}))
376
+ if (h.some((s) => s.id === u)) {
377
+ g[d] || (g[d] = []), g[d].push(u);
378
378
  break;
379
379
  }
380
- }), Object.entries(x).every(
381
- ([m, u]) => {
382
- const p = h.metadataGroups?.find((C) => I(je, C).key === m);
383
- if (!p)
380
+ }), Object.entries(g).every(
381
+ ([u, d]) => {
382
+ const h = m.metadataGroups?.find((v) => I(je, v).key === u);
383
+ if (!h)
384
384
  return !1;
385
385
  const s = I(
386
386
  je,
387
- p
388
- ), g = I(
387
+ h
388
+ ), p = I(
389
389
  be,
390
390
  s.data
391
- ).map((C) => C.id);
392
- return u.some(
393
- (C) => g.includes(C)
391
+ ).map((v) => v.id);
392
+ return d.some(
393
+ (v) => p.includes(v)
394
394
  );
395
395
  }
396
396
  );
397
397
  }), _n = ({
398
398
  actions: r,
399
399
  totalActions: n,
400
- onCreate: a,
401
- onDelete: h,
402
- onEdit: x,
403
- onView: m,
404
- onSelected: u,
405
- onDuplicate: p,
400
+ onCreate: i,
401
+ onDelete: m,
402
+ onEdit: g,
403
+ onView: u,
404
+ onSelected: d,
405
+ onDuplicate: h,
406
406
  disableMultiSelect: s,
407
- disableDelete: i,
408
- disableEdit: g,
409
- disableCreate: C,
407
+ disableDelete: l,
408
+ disableEdit: p,
409
+ disableCreate: v,
410
410
  hideUseCase: L = !0,
411
411
  showMetadataFilters: M = !0,
412
412
  tableProps: w,
413
- containerProps: v,
414
- quantumIconSrc: c = "/favicon.ico"
413
+ containerProps: y,
414
+ quantumIconSrc: x = "/favicon.ico"
415
415
  }) => {
416
- const [d, b] = _(""), [j, A] = _(), [$, D] = _([]), [O, R] = _({}), { getLabel: J } = xe(), oe = at(), N = k(() => ({
416
+ const [a, C] = _(""), [j, O] = _(), [R, $] = _([]), [A, T] = _({}), { getLabel: J } = xe(), oe = at(), D = k(() => ({
417
417
  action: J("action"),
418
418
  actionPlural: J("action_plural"),
419
419
  actionLowerCase: J("action").toLocaleLowerCase(),
420
420
  actionPluralLowerCase: J("action_plural").toLocaleLowerCase()
421
- }), [J]), V = k(() => [
421
+ }), [J]), Z = k(() => [
422
422
  { key: "module_category", label: "Link Category", multi: !0 },
423
- { key: "activity_type", label: `${N.action} Type`, multi: !0 },
423
+ { key: "activity_type", label: `${D.action} Type`, multi: !0 },
424
424
  { key: "session_type", label: "Session Type", multi: !0 },
425
425
  { key: "body_region", label: "Body Region", multi: !0 },
426
426
  { key: "sport", label: "Sport", multi: !0 }
427
- ], [N.action]);
427
+ ], [D.action]);
428
428
  le(() => {
429
429
  if (!M)
430
430
  return;
431
- const t = V.map(
431
+ const t = Z.map(
432
432
  (o) => oe.query(rt, { key: o.key })
433
433
  );
434
434
  Promise.all(t).then((o) => {
435
- const y = {};
435
+ const b = {};
436
436
  o.forEach((U) => {
437
437
  if (U.error || !U.data) return;
438
438
  const q = I(
@@ -442,89 +442,89 @@ const kn = ({
442
442
  be,
443
443
  q.data
444
444
  );
445
- y[q.key] = Q.map((E) => ({
445
+ b[q.key] = Q.map((E) => ({
446
446
  label: E.label || E.value,
447
447
  value: E.value,
448
448
  id: E.id
449
449
  }));
450
- }), R(y);
450
+ }), T(b);
451
451
  });
452
- }, [oe, V, M]);
453
- const ee = k(() => {
452
+ }, [oe, Z, M]);
453
+ const V = k(() => {
454
454
  if (!r)
455
455
  return;
456
- const t = Fn(r, d), o = L ? t : Gn(t, j);
456
+ const t = Fn(r, a), o = L ? t : Gn(t, j);
457
457
  return M ? En(
458
458
  o,
459
- $,
460
- O
459
+ R,
460
+ A
461
461
  ) : o;
462
462
  }, [
463
463
  r,
464
- d,
464
+ a,
465
465
  j,
466
466
  L,
467
467
  M,
468
- $,
469
- O
470
- ]), T = G(() => {
471
- if (!h)
468
+ R,
469
+ A
470
+ ]), N = G(() => {
471
+ if (!m)
472
472
  return;
473
473
  const o = r.filter(
474
- (y) => y.selected && !y.quantumOwned
475
- ).map((y) => y.id);
476
- h(o);
477
- }, [r, h]), z = G(() => {
478
- if (!p)
474
+ (b) => b.selected && !b.quantumOwned
475
+ ).map((b) => b.id);
476
+ m(o);
477
+ }, [r, m]), z = G(() => {
478
+ if (!h)
479
479
  return;
480
480
  const t = r.filter((o) => o.selected);
481
- p(t.map((o) => o.id)), u && t.forEach((o) => u(o, !1));
482
- }, [r, p, u]), X = k(() => r.some((t) => t.selected && !t.quantumOwned), [r]), W = k(() => r.some((t) => t.selected), [r]), H = k(() => r.some((t) => t.selected && t.quantumOwned), [r]), l = G(
481
+ h(t.map((o) => o.id)), d && t.forEach((o) => d(o, !1));
482
+ }, [r, h, d]), X = k(() => r.some((t) => t.selected && !t.quantumOwned), [r]), W = k(() => r.some((t) => t.selected), [r]), H = k(() => r.some((t) => t.selected && t.quantumOwned), [r]), c = G(
483
483
  (t, o) => {
484
- const y = V.find((q) => q.key === t);
485
- if (!y) return;
486
- const U = y.multi ? (o ?? []).map((q) => q.id) : o ? [o.id] : [];
487
- D((q) => [...q.filter((E) => Object.values(O).flat().find((ce) => ce.id === E) && !Object.keys(O).find(
488
- (ce) => O[ce]?.some(
484
+ const b = Z.find((q) => q.key === t);
485
+ if (!b) return;
486
+ const U = b.multi ? (o ?? []).map((q) => q.id) : o ? [o.id] : [];
487
+ $((q) => [...q.filter((E) => Object.values(A).flat().find((ce) => ce.id === E) && !Object.keys(A).find(
488
+ (ce) => A[ce]?.some(
489
489
  (ye) => ye.id === E && ce === t
490
490
  )
491
491
  )), ...U]);
492
492
  },
493
- [V, O]
493
+ [Z, A]
494
494
  );
495
- return /* @__PURE__ */ e.jsxs(te, { ...v, children: [
495
+ return /* @__PURE__ */ e.jsxs(te, { ...y, children: [
496
496
  /* @__PURE__ */ e.jsxs(Ie, { alignContent: "space-between", gap: 4, children: [
497
- (a || h || p) && /* @__PURE__ */ e.jsxs(Ae, { mb: "1rem", gap: 4, children: [
498
- a && /* @__PURE__ */ e.jsxs(
497
+ (i || m || h) && /* @__PURE__ */ e.jsxs(Ae, { mb: "1rem", gap: 4, children: [
498
+ i && /* @__PURE__ */ e.jsxs(
499
499
  se,
500
500
  {
501
- isDisabled: !a || C,
501
+ isDisabled: !i || v,
502
502
  colorScheme: "blackAlpha",
503
503
  backgroundColor: "gray.700",
504
- onClick: a,
504
+ onClick: i,
505
505
  children: [
506
506
  "Create New ",
507
- N.action
507
+ D.action
508
508
  ]
509
509
  }
510
510
  ),
511
- h && !s && /* @__PURE__ */ e.jsx(
511
+ m && !s && /* @__PURE__ */ e.jsx(
512
512
  st,
513
513
  {
514
- label: H ? X ? `Quantum-owned ${N.actionPluralLowerCase} are selected and will be skipped` : `Selected ${N.actionPluralLowerCase} are quantum-owned and cannot be deleted` : void 0,
514
+ label: H ? X ? `Quantum-owned ${D.actionPluralLowerCase} are selected and will be skipped` : `Selected ${D.actionPluralLowerCase} are quantum-owned and cannot be deleted` : void 0,
515
515
  shouldWrapChildren: !0,
516
516
  children: /* @__PURE__ */ e.jsx(
517
517
  se,
518
518
  {
519
519
  colorScheme: "gray",
520
- isDisabled: !X || !h || i,
521
- onClick: T,
520
+ isDisabled: !X || !m || l,
521
+ onClick: N,
522
522
  children: "Delete Selected"
523
523
  }
524
524
  )
525
525
  }
526
526
  ),
527
- p && !s && /* @__PURE__ */ e.jsx(
527
+ h && !s && /* @__PURE__ */ e.jsx(
528
528
  se,
529
529
  {
530
530
  colorScheme: "gray",
@@ -537,17 +537,17 @@ const kn = ({
537
537
  /* @__PURE__ */ e.jsx(
538
538
  kn,
539
539
  {
540
- setSearch: b,
540
+ setSearch: C,
541
541
  actions: r,
542
- updateUseCases: A,
542
+ updateUseCases: O,
543
543
  hideUseCaseFilter: L
544
544
  }
545
545
  )
546
546
  ] }),
547
- M && O && /* @__PURE__ */ e.jsx(te, { my: 4, children: /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4", children: V.map((t) => /* @__PURE__ */ e.jsxs(Y, { children: [
547
+ M && A && /* @__PURE__ */ e.jsx(te, { my: 4, children: /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4", children: Z.map((t) => /* @__PURE__ */ e.jsxs(Y, { children: [
548
548
  /* @__PURE__ */ e.jsx(Xe, { fontSize: "sm", children: t.label }),
549
549
  /* @__PURE__ */ e.jsx(
550
- me,
550
+ he,
551
551
  {
552
552
  chakraStyles: {
553
553
  menu: (o) => ({
@@ -556,16 +556,16 @@ const kn = ({
556
556
  })
557
557
  },
558
558
  isMulti: t.multi,
559
- value: O[t.key]?.filter(
560
- (o) => $.includes(o.id)
559
+ value: A[t.key]?.filter(
560
+ (o) => R.includes(o.id)
561
561
  ),
562
562
  onChange: (o) => {
563
- l(
563
+ c(
564
564
  t.key,
565
565
  o
566
566
  );
567
567
  },
568
- options: O[t.key],
568
+ options: A[t.key],
569
569
  placeholder: `Select ${t.multi ? "one or more" : "one"} ${t.label.toLowerCase()}`,
570
570
  isClearable: t.multi
571
571
  }
@@ -575,7 +575,7 @@ const kn = ({
575
575
  /* @__PURE__ */ e.jsx(Wt, { position: "sticky", top: 0, bg: "white", zIndex: 1, children: /* @__PURE__ */ e.jsxs(mt, { children: [
576
576
  /* @__PURE__ */ e.jsxs(Re, { fontWeight: "normal", children: [
577
577
  "(showing ",
578
- ee?.length ?? 0,
578
+ V?.length ?? 0,
579
579
  " of",
580
580
  " ",
581
581
  n ?? r.length,
@@ -586,7 +586,7 @@ const kn = ({
586
586
  !L && /* @__PURE__ */ e.jsx(Re, { children: "Use Case" }),
587
587
  /* @__PURE__ */ e.jsx(Re, {})
588
588
  ] }) }),
589
- /* @__PURE__ */ e.jsx(Ut, { children: ee?.map((t) => /* @__PURE__ */ e.jsxs(
589
+ /* @__PURE__ */ e.jsx(Ut, { children: V?.map((t) => /* @__PURE__ */ e.jsxs(
590
590
  mt,
591
591
  {
592
592
  className: qe(
@@ -595,12 +595,12 @@ const kn = ({
595
595
  t.selected && "bg-gray-200"
596
596
  ),
597
597
  onClick: () => {
598
- s || u?.(t, !t.selected);
598
+ s || d?.(t, !t.selected);
599
599
  },
600
600
  children: [
601
601
  /* @__PURE__ */ e.jsx(_e, { children: /* @__PURE__ */ e.jsxs(Ie, { children: [
602
602
  !s && /* @__PURE__ */ e.jsx(e.Fragment, { children: t.selected ? /* @__PURE__ */ e.jsx(bn, { className: "text-blue-500" }) : /* @__PURE__ */ e.jsx(yn, { className: "text-gray-400" }) }),
603
- (t.quantumOwned || !x) && m && /* @__PURE__ */ e.jsx(
603
+ (t.quantumOwned || !g) && u && /* @__PURE__ */ e.jsx(
604
604
  se,
605
605
  {
606
606
  ml: "1em",
@@ -608,21 +608,21 @@ const kn = ({
608
608
  variant: "link",
609
609
  colorScheme: "blue",
610
610
  onClick: (o) => {
611
- o.stopPropagation(), m(t.id);
611
+ o.stopPropagation(), u(t.id);
612
612
  },
613
613
  children: "View"
614
614
  }
615
615
  ),
616
- !t.quantumOwned && x && /* @__PURE__ */ e.jsx(
616
+ !t.quantumOwned && g && /* @__PURE__ */ e.jsx(
617
617
  se,
618
618
  {
619
- isDisabled: g,
619
+ isDisabled: p,
620
620
  ml: "1em",
621
621
  size: "sm",
622
622
  variant: "link",
623
623
  colorScheme: "blue",
624
624
  onClick: (o) => {
625
- o.stopPropagation(), x(t.id);
625
+ o.stopPropagation(), g(t.id);
626
626
  },
627
627
  children: "Edit"
628
628
  }
@@ -633,7 +633,7 @@ const kn = ({
633
633
  Dn,
634
634
  {
635
635
  action: t,
636
- quantumIconSrc: c
636
+ quantumIconSrc: x
637
637
  }
638
638
  ),
639
639
  t.name
@@ -655,30 +655,30 @@ const kn = ({
655
655
  }, xs = ({
656
656
  onSave: r,
657
657
  onCancel: n,
658
- onError: a,
659
- hideButtons: h = !1,
660
- setButtonDisabled: x,
661
- setButtonOnClick: m,
662
- quantumOwned: u
658
+ onError: i,
659
+ hideButtons: m = !1,
660
+ setButtonDisabled: g,
661
+ setButtonOnClick: u,
662
+ quantumOwned: d
663
663
  }) => {
664
- const p = vt(), { getLabel: s } = xe(), i = k(() => ({
664
+ const h = vt(), { getLabel: s } = xe(), l = k(() => ({
665
665
  singular: s("action"),
666
666
  plural: s("action_plural"),
667
667
  pluralLowerCase: s("action_plural").toLowerCase(),
668
668
  singularLowerCase: s("action").toLowerCase()
669
- }), [s]), [g, C] = _("copy"), [L, M] = _(""), [w, v] = _([]), [c, d] = _(!1), [b] = we({
669
+ }), [s]), [p, v] = _("copy"), [L, M] = _(""), [w, y] = _([]), [x, a] = _(!1), [C] = we({
670
670
  query: Lt
671
671
  }), [j] = we({
672
672
  query: ln,
673
673
  variables: { groupId: L },
674
674
  pause: !L
675
675
  // Only run when group is selected
676
- }), [, A] = fe(ot), [, $] = fe(
676
+ }), [, O] = fe(ot), [, R] = fe(
677
677
  It
678
- ), D = k(() => b.data?.groups ? b.data.groups.map(
679
- (l) => I(Mt, l)
680
- ) : [], [b.data]), O = k(() => j.data ? j.data.actions.map((t) => {
681
- const o = I(Ce, t), y = I(
678
+ ), $ = k(() => C.data?.groups ? C.data.groups.map(
679
+ (c) => I(Mt, c)
680
+ ) : [], [C.data]), A = k(() => j.data ? j.data.actions.map((t) => {
681
+ const o = I(Ce, t), b = I(
682
682
  Ze,
683
683
  o.reports
684
684
  ), U = I(
@@ -694,65 +694,65 @@ const kn = ({
694
694
  return {
695
695
  ...o,
696
696
  thresholds: I(Oe, o.thresholds),
697
- reports: y.map((E) => ({
697
+ reports: b.map((E) => ({
698
698
  ...E,
699
699
  thresholds: I(Oe, E.thresholds)
700
700
  })),
701
701
  categories: U,
702
702
  metadataGroups: Q
703
703
  };
704
- }) : [], [j.data]), R = k(() => O.filter(
705
- (l) => w.includes(l.id)
706
- ), [O, w]), J = G(
707
- (l) => {
708
- const t = l?.value || "";
709
- M(t), v([]);
704
+ }) : [], [j.data]), T = k(() => A.filter(
705
+ (c) => w.includes(c.id)
706
+ ), [A, w]), J = G(
707
+ (c) => {
708
+ const t = c?.value || "";
709
+ M(t), y([]);
710
710
  },
711
711
  []
712
712
  ), oe = G(
713
- (l) => {
714
- const t = l.map((o) => o.value);
715
- v(t);
713
+ (c) => {
714
+ const t = c.map((o) => o.value);
715
+ y(t);
716
716
  },
717
717
  []
718
- ), N = G(
719
- async (l) => {
718
+ ), D = G(
719
+ async (c) => {
720
720
  const t = {
721
- ...l,
722
- name: `${l.name} (Copy)`,
721
+ ...c,
722
+ name: `${c.name} (Copy)`,
723
723
  // Add "(Copy)" suffix to distinguish
724
- description: l.description || void 0,
725
- instructionsPointOfInterest: l.instructionsPointOfInterest || void 0,
726
- instructionsMovementReport: l.instructionsMovementReport || void 0,
727
- laterality: l.laterality,
728
- activityKind: l.activityKind,
729
- sensorLocations: l.sensorLocations,
730
- thresholds: l.thresholds.map((y) => ({
731
- ...y,
724
+ description: c.description || void 0,
725
+ instructionsPointOfInterest: c.instructionsPointOfInterest || void 0,
726
+ instructionsMovementReport: c.instructionsMovementReport || void 0,
727
+ laterality: c.laterality,
728
+ activityKind: c.activityKind,
729
+ sensorLocations: c.sensorLocations,
730
+ thresholds: c.thresholds.map((b) => ({
731
+ ...b,
732
732
  id: void 0
733
733
  })),
734
- categories: l.categories.map((y) => y.id),
735
- quantumOwned: u,
736
- metadataItemIds: l.metadataGroups.flatMap((y) => y.data.map((U) => U.id)).filter((y) => y !== void 0),
737
- reports: l.reports.map((y) => ({
738
- ...y,
734
+ categories: c.categories.map((b) => b.id),
735
+ quantumOwned: d,
736
+ metadataItemIds: c.metadataGroups.flatMap((b) => b.data.map((U) => U.id)).filter((b) => b !== void 0),
737
+ reports: c.reports.map((b) => ({
738
+ ...b,
739
739
  id: void 0,
740
- thresholds: y.thresholds.map((U) => ({
740
+ thresholds: b.thresholds.map((U) => ({
741
741
  ...U,
742
742
  id: void 0
743
743
  }))
744
744
  })),
745
745
  id: void 0
746
- }, o = await A({ fields: t });
746
+ }, o = await O({ fields: t });
747
747
  if (o.error) throw new Error(o.error.message);
748
748
  if (o.data?.createAction)
749
749
  return I(Ce, o.data.createAction);
750
750
  throw new Error("No action data returned");
751
751
  },
752
- [A, u]
753
- ), V = G(
754
- async (l) => {
755
- const t = await $({ id: l.id });
752
+ [O, d]
753
+ ), Z = G(
754
+ async (c) => {
755
+ const t = await R({ id: c.id });
756
756
  if (t.error)
757
757
  throw new Error(t.error.message);
758
758
  if (t.data?.convertActionToQuantumOwned)
@@ -762,118 +762,118 @@ const kn = ({
762
762
  );
763
763
  throw new Error("No action data returned");
764
764
  },
765
- [$]
766
- ), ee = G(async () => {
767
- if (d(!0), !R.length) {
768
- const l = new Error(
769
- `No ${i.pluralLowerCase} selected for ${g === "copy" ? "copying" : "converting"}`
765
+ [R]
766
+ ), V = G(async () => {
767
+ if (a(!0), !T.length) {
768
+ const c = new Error(
769
+ `No ${l.pluralLowerCase} selected for ${p === "copy" ? "copying" : "converting"}`
770
770
  );
771
- a?.(l), d(!1);
771
+ i?.(c), a(!1);
772
772
  return;
773
773
  }
774
774
  try {
775
- const l = [];
775
+ const c = [];
776
776
  let t = 0;
777
- const o = g === "copy" ? N : V, y = g === "copy" ? "copy" : "convert";
778
- for (const U of R)
777
+ const o = p === "copy" ? D : Z, b = p === "copy" ? "copy" : "convert";
778
+ for (const U of T)
779
779
  try {
780
780
  const q = await o(U);
781
- l.push(q);
781
+ c.push(q);
782
782
  } catch (q) {
783
783
  console.error(
784
- `Failed to ${y} ${i.singularLowerCase} "${U.name}":`,
784
+ `Failed to ${b} ${l.singularLowerCase} "${U.name}":`,
785
785
  q
786
786
  ), t++;
787
787
  }
788
- if (l.length > 0) {
789
- const U = l.length, q = R.length, Q = g === "copy" ? "copied" : "converted", E = g === "copy" ? "copy" : "convert";
790
- p({
791
- title: t > 0 ? `Partial ${E} completed` : `${i.plural} ${Q} successfully`,
792
- description: t > 0 ? `${U} of ${q} ${i.pluralLowerCase} ${Q} successfully` : `${U} ${U > 1 ? i.pluralLowerCase : i.singularLowerCase} ${Q} successfully`,
788
+ if (c.length > 0) {
789
+ const U = c.length, q = T.length, Q = p === "copy" ? "copied" : "converted", E = p === "copy" ? "copy" : "convert";
790
+ h({
791
+ title: t > 0 ? `Partial ${E} completed` : `${l.plural} ${Q} successfully`,
792
+ description: t > 0 ? `${U} of ${q} ${l.pluralLowerCase} ${Q} successfully` : `${U} ${U > 1 ? l.pluralLowerCase : l.singularLowerCase} ${Q} successfully`,
793
793
  status: t > 0 ? "warning" : "success",
794
794
  duration: 3e3,
795
795
  isClosable: !0
796
- }), r?.(), M(""), v([]);
796
+ }), r?.(), M(""), y([]);
797
797
  } else
798
798
  throw new Error(
799
- `Failed to ${y} any ${i.pluralLowerCase}`
799
+ `Failed to ${b} any ${l.pluralLowerCase}`
800
800
  );
801
- } catch (l) {
802
- const t = g === "copy" ? "copy" : "convert", o = l instanceof Error ? l.message : `Failed to ${t} ${i.pluralLowerCase}`;
803
- p({
804
- title: `${g === "copy" ? "Copy" : "Convert"} failed`,
801
+ } catch (c) {
802
+ const t = p === "copy" ? "copy" : "convert", o = c instanceof Error ? c.message : `Failed to ${t} ${l.pluralLowerCase}`;
803
+ h({
804
+ title: `${p === "copy" ? "Copy" : "Convert"} failed`,
805
805
  description: o,
806
806
  status: "error",
807
807
  duration: 5e3,
808
808
  isClosable: !0
809
- }), a?.(l instanceof Error ? l : new Error(o));
809
+ }), i?.(c instanceof Error ? c : new Error(o));
810
810
  } finally {
811
- d(!1);
811
+ a(!1);
812
812
  }
813
813
  }, [
814
- R,
815
- g,
816
- N,
817
- V,
814
+ T,
818
815
  p,
816
+ D,
817
+ Z,
818
+ h,
819
819
  r,
820
- a,
821
- i
822
- ]), T = G(() => {
823
- M(""), v([]), C("copy"), n?.();
820
+ i,
821
+ l
822
+ ]), N = G(() => {
823
+ M(""), y([]), v("copy"), n?.();
824
824
  }, [n]);
825
825
  le(() => {
826
- x && x({
826
+ g && g({
827
827
  cancelButton: !1,
828
- saveButton: R.length === 0 || c
828
+ saveButton: T.length === 0 || x
829
829
  });
830
- }, [R.length, c, x]), le(() => {
831
- m && m({
832
- cancelButton: T,
833
- saveButton: ee
830
+ }, [T.length, x, g]), le(() => {
831
+ u && u({
832
+ cancelButton: N,
833
+ saveButton: V
834
834
  });
835
- }, [m, T, ee]);
836
- const z = k(() => D.map((l) => ({
837
- value: l.id,
838
- label: l.name
839
- })), [D]), X = k(() => O.filter((l) => g === "copy" ? !0 : !l.quantumOwned).map((l) => ({
840
- value: l.id,
841
- label: l.name,
835
+ }, [u, N, V]);
836
+ const z = k(() => $.map((c) => ({
837
+ value: c.id,
838
+ label: c.name
839
+ })), [$]), X = k(() => A.filter((c) => p === "copy" ? !0 : !c.quantumOwned).map((c) => ({
840
+ value: c.id,
841
+ label: c.name,
842
842
  // Add custom data to identify quantum-owned actions for UI display
843
- isQuantumOwned: l.quantumOwned
844
- })), [O, g]), W = b.fetching, H = j.fetching;
845
- return /* @__PURE__ */ e.jsx(te, { children: /* @__PURE__ */ e.jsxs(de, { spacing: 6, align: "stretch", children: [
846
- u && /* @__PURE__ */ e.jsxs(Y, { children: [
843
+ isQuantumOwned: c.quantumOwned
844
+ })), [A, p]), W = C.fetching, H = j.fetching;
845
+ return /* @__PURE__ */ e.jsx(te, { children: /* @__PURE__ */ e.jsxs(ue, { spacing: 6, align: "stretch", children: [
846
+ d && /* @__PURE__ */ e.jsxs(Y, { children: [
847
847
  /* @__PURE__ */ e.jsx(ge, { children: "Operation Mode" }),
848
848
  /* @__PURE__ */ e.jsx(
849
849
  Ct,
850
850
  {
851
- value: g,
852
- onChange: (l) => {
853
- C(l), v([]);
851
+ value: p,
852
+ onChange: (c) => {
853
+ v(c), y([]);
854
854
  },
855
855
  children: /* @__PURE__ */ e.jsxs(re, { spacing: 6, children: [
856
- /* @__PURE__ */ e.jsx(Ye, { value: "copy", colorScheme: "blue", children: /* @__PURE__ */ e.jsxs(de, { align: "start", spacing: 1, children: [
856
+ /* @__PURE__ */ e.jsx(Ye, { value: "copy", colorScheme: "blue", children: /* @__PURE__ */ e.jsxs(ue, { align: "start", spacing: 1, children: [
857
857
  /* @__PURE__ */ e.jsxs(S, { fontWeight: "medium", children: [
858
858
  "Copy ",
859
- i.plural
859
+ l.plural
860
860
  ] }),
861
861
  /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", color: "gray.600", children: [
862
862
  "Create new ",
863
- i.plural.toLocaleLowerCase(),
863
+ l.plural.toLocaleLowerCase(),
864
864
  " ",
865
865
  "based on selected ones"
866
866
  ] })
867
867
  ] }) }),
868
- /* @__PURE__ */ e.jsx(Ye, { value: "convert", colorScheme: "green", children: /* @__PURE__ */ e.jsxs(de, { align: "start", spacing: 1, children: [
868
+ /* @__PURE__ */ e.jsx(Ye, { value: "convert", colorScheme: "green", children: /* @__PURE__ */ e.jsxs(ue, { align: "start", spacing: 1, children: [
869
869
  /* @__PURE__ */ e.jsxs(S, { fontWeight: "medium", children: [
870
870
  "Convert to Quantum Owned ",
871
- i.singular
871
+ l.singular
872
872
  ] }),
873
873
  /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", color: "gray.600", children: [
874
874
  "Convert existing",
875
875
  " ",
876
- i.plural.toLocaleLowerCase(),
876
+ l.plural.toLocaleLowerCase(),
877
877
  " to quantum-owned"
878
878
  ] })
879
879
  ] }) })
@@ -884,66 +884,66 @@ const kn = ({
884
884
  /* @__PURE__ */ e.jsxs(Y, { children: [
885
885
  /* @__PURE__ */ e.jsx(ge, { children: "Select Source Group" }),
886
886
  /* @__PURE__ */ e.jsx(
887
- me,
887
+ he,
888
888
  {
889
889
  placeholder: "Choose a group...",
890
890
  options: z,
891
- value: z.find((l) => l.value === L) || null,
891
+ value: z.find((c) => c.value === L) || null,
892
892
  onChange: J,
893
893
  isLoading: W,
894
894
  isDisabled: W,
895
895
  isClearable: !0
896
896
  }
897
897
  ),
898
- b.error && /* @__PURE__ */ e.jsxs(He, { status: "error", mt: 2, children: [
898
+ C.error && /* @__PURE__ */ e.jsxs(He, { status: "error", mt: 2, children: [
899
899
  /* @__PURE__ */ e.jsx(Je, {}),
900
900
  /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", children: [
901
901
  "Failed to load groups: ",
902
- b.error.message
902
+ C.error.message
903
903
  ] })
904
904
  ] })
905
905
  ] }),
906
906
  L && /* @__PURE__ */ e.jsxs(Y, { children: [
907
907
  /* @__PURE__ */ e.jsxs(ge, { children: [
908
908
  "Select ",
909
- i.plural,
909
+ l.plural,
910
910
  " to",
911
911
  " ",
912
- g === "copy" ? "Copy" : "Convert"
912
+ p === "copy" ? "Copy" : "Convert"
913
913
  ] }),
914
914
  H ? /* @__PURE__ */ e.jsxs(re, { children: [
915
915
  /* @__PURE__ */ e.jsx(wt, { size: "sm" }),
916
916
  /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", color: "gray.600", children: [
917
917
  "Loading ",
918
- i.pluralLowerCase,
918
+ l.pluralLowerCase,
919
919
  "..."
920
920
  ] })
921
921
  ] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
922
922
  /* @__PURE__ */ e.jsx(
923
- me,
923
+ he,
924
924
  {
925
- placeholder: `Choose ${i.pluralLowerCase} to ${g}...`,
925
+ placeholder: `Choose ${l.pluralLowerCase} to ${p}...`,
926
926
  options: X,
927
927
  value: X.filter(
928
- (l) => w.includes(l.value)
928
+ (c) => w.includes(c.value)
929
929
  ),
930
930
  onChange: oe,
931
931
  isDisabled: X.length === 0,
932
932
  isClearable: !0,
933
933
  isMulti: !0,
934
934
  closeMenuOnSelect: !1,
935
- formatOptionLabel: (l, { context: t }) => /* @__PURE__ */ e.jsxs(re, { justify: "space-between", w: "100%", children: [
935
+ formatOptionLabel: (c, { context: t }) => /* @__PURE__ */ e.jsxs(re, { justify: "space-between", w: "100%", children: [
936
936
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
937
- /* @__PURE__ */ e.jsx(S, { children: l.label }),
938
- t === "value" && l.isQuantumOwned && /* @__PURE__ */ e.jsx(S, { color: "blue", fontSize: "xs", children: "(Quantum Owned)" })
937
+ /* @__PURE__ */ e.jsx(S, { children: c.label }),
938
+ t === "value" && c.isQuantumOwned && /* @__PURE__ */ e.jsx(S, { color: "blue", fontSize: "xs", children: "(Quantum Owned)" })
939
939
  ] }),
940
- l.isQuantumOwned && t === "menu" && /* @__PURE__ */ e.jsx($e, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
940
+ c.isQuantumOwned && t === "menu" && /* @__PURE__ */ e.jsx($e, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
941
941
  ] })
942
942
  }
943
943
  ),
944
944
  X.length === 0 && /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", color: "gray.500", mt: 2, children: [
945
945
  "No ",
946
- i.pluralLowerCase,
946
+ l.pluralLowerCase,
947
947
  " found"
948
948
  ] })
949
949
  ] }),
@@ -951,17 +951,17 @@ const kn = ({
951
951
  /* @__PURE__ */ e.jsx(Je, {}),
952
952
  /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", children: [
953
953
  "Failed to load ",
954
- i.pluralLowerCase,
954
+ l.pluralLowerCase,
955
955
  ":",
956
956
  " ",
957
957
  j.error.message
958
958
  ] })
959
959
  ] })
960
960
  ] }),
961
- R.length > 0 && /* @__PURE__ */ e.jsxs(te, { p: 4, bg: "gray.50", borderRadius: "md", children: [
962
- /* @__PURE__ */ e.jsx(S, { fontWeight: "semibold", mb: 3, children: R.length === 1 ? `${i.singular} to ${g === "copy" ? "Copy" : "Convert"}:` : `${R.length} ${i.plural} to ${g === "copy" ? "Copy" : "Convert"}:` }),
963
- /* @__PURE__ */ e.jsxs(de, { align: "start", spacing: 3, children: [
964
- R.map((l, t) => /* @__PURE__ */ e.jsxs(
961
+ T.length > 0 && /* @__PURE__ */ e.jsxs(te, { p: 4, bg: "gray.50", borderRadius: "md", children: [
962
+ /* @__PURE__ */ e.jsx(S, { fontWeight: "semibold", mb: 3, children: T.length === 1 ? `${l.singular} to ${p === "copy" ? "Copy" : "Convert"}:` : `${T.length} ${l.plural} to ${p === "copy" ? "Copy" : "Convert"}:` }),
963
+ /* @__PURE__ */ e.jsxs(ue, { align: "start", spacing: 3, children: [
964
+ T.map((c, t) => /* @__PURE__ */ e.jsxs(
965
965
  te,
966
966
  {
967
967
  w: "100%",
@@ -975,56 +975,56 @@ const kn = ({
975
975
  /* @__PURE__ */ e.jsxs(S, { fontWeight: "medium", fontSize: "sm", children: [
976
976
  t + 1,
977
977
  ". ",
978
- l.name
978
+ c.name
979
979
  ] }),
980
- l.quantumOwned && /* @__PURE__ */ e.jsx($e, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
980
+ c.quantumOwned && /* @__PURE__ */ e.jsx($e, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
981
981
  ] }),
982
982
  /* @__PURE__ */ e.jsxs(
983
- de,
983
+ ue,
984
984
  {
985
985
  align: "start",
986
986
  spacing: 1,
987
987
  fontSize: "sm",
988
988
  color: "gray.600",
989
989
  children: [
990
- l.description && /* @__PURE__ */ e.jsxs(S, { children: [
990
+ c.description && /* @__PURE__ */ e.jsxs(S, { children: [
991
991
  /* @__PURE__ */ e.jsx("strong", { children: "Description:" }),
992
992
  " ",
993
- l.description
993
+ c.description
994
994
  ] }),
995
995
  /* @__PURE__ */ e.jsxs(S, { children: [
996
996
  /* @__PURE__ */ e.jsx("strong", { children: "Type:" }),
997
997
  " ",
998
- l.activityKind
998
+ c.activityKind
999
999
  ] }),
1000
1000
  /* @__PURE__ */ e.jsxs(S, { children: [
1001
1001
  /* @__PURE__ */ e.jsx("strong", { children: "Laterality:" }),
1002
1002
  " ",
1003
- l.laterality
1003
+ c.laterality
1004
1004
  ] }),
1005
1005
  /* @__PURE__ */ e.jsxs(S, { children: [
1006
1006
  /* @__PURE__ */ e.jsx("strong", { children: "Sensor Locations:" }),
1007
1007
  " ",
1008
- l.sensorLocations.length
1008
+ c.sensorLocations.length
1009
1009
  ] }),
1010
1010
  /* @__PURE__ */ e.jsxs(S, { children: [
1011
1011
  /* @__PURE__ */ e.jsx("strong", { children: "Thresholds:" }),
1012
1012
  " ",
1013
- l.thresholds.length
1013
+ c.thresholds.length
1014
1014
  ] }),
1015
1015
  /* @__PURE__ */ e.jsxs(S, { children: [
1016
1016
  /* @__PURE__ */ e.jsx("strong", { children: "Use Cases:" }),
1017
1017
  " ",
1018
- l.useCases.map((o) => o.name).join(", ") || "None"
1018
+ c.useCases.map((o) => o.name).join(", ") || "None"
1019
1019
  ] })
1020
1020
  ]
1021
1021
  }
1022
1022
  )
1023
1023
  ]
1024
1024
  },
1025
- l.id
1025
+ c.id
1026
1026
  )),
1027
- R.length > 1 && /* @__PURE__ */ e.jsx(
1027
+ T.length > 1 && /* @__PURE__ */ e.jsx(
1028
1028
  te,
1029
1029
  {
1030
1030
  w: "100%",
@@ -1035,39 +1035,39 @@ const kn = ({
1035
1035
  borderColor: "blue.200",
1036
1036
  children: /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", fontWeight: "medium", color: "blue.800", children: [
1037
1037
  "Total: ",
1038
- R.length,
1038
+ T.length,
1039
1039
  " ",
1040
- i.pluralLowerCase,
1040
+ l.pluralLowerCase,
1041
1041
  " will be",
1042
1042
  " ",
1043
- g === "copy" ? "copied" : "converted"
1043
+ p === "copy" ? "copied" : "converted"
1044
1044
  ] })
1045
1045
  }
1046
1046
  )
1047
1047
  ] })
1048
1048
  ] }),
1049
- !h && /* @__PURE__ */ e.jsxs(Ae, { spacing: 4, justifyContent: "flex-end", children: [
1049
+ !m && /* @__PURE__ */ e.jsxs(Ae, { spacing: 4, justifyContent: "flex-end", children: [
1050
1050
  /* @__PURE__ */ e.jsx(
1051
1051
  se,
1052
1052
  {
1053
1053
  variant: "outline",
1054
- onClick: T,
1055
- isDisabled: c,
1054
+ onClick: N,
1055
+ isDisabled: x,
1056
1056
  children: "Cancel"
1057
1057
  }
1058
1058
  ),
1059
1059
  /* @__PURE__ */ e.jsxs(
1060
1060
  se,
1061
1061
  {
1062
- colorScheme: g === "copy" ? "blue" : "green",
1063
- onClick: ee,
1064
- isDisabled: R.length === 0 || c,
1065
- isLoading: c,
1066
- loadingText: `${g === "copy" ? "Copying" : "Converting"}...`,
1062
+ colorScheme: p === "copy" ? "blue" : "green",
1063
+ onClick: V,
1064
+ isDisabled: T.length === 0 || x,
1065
+ isLoading: x,
1066
+ loadingText: `${p === "copy" ? "Copying" : "Converting"}...`,
1067
1067
  children: [
1068
- g === "copy" ? "Copy" : "Convert",
1068
+ p === "copy" ? "Copy" : "Convert",
1069
1069
  " ",
1070
- R.length === 1 ? i.singular : `${R.length} ${i.plural}`
1070
+ T.length === 1 ? l.singular : `${T.length} ${l.plural}`
1071
1071
  ]
1072
1072
  }
1073
1073
  )
@@ -1076,38 +1076,38 @@ const kn = ({
1076
1076
  }, fs = ({
1077
1077
  onSave: r,
1078
1078
  onCancel: n,
1079
- onError: a,
1080
- hideButtons: h = !1,
1081
- setButtonDisabled: x,
1082
- setButtonOnClick: m,
1083
- quantumOwned: u
1079
+ onError: i,
1080
+ hideButtons: m = !1,
1081
+ setButtonDisabled: g,
1082
+ setButtonOnClick: u,
1083
+ quantumOwned: d
1084
1084
  }) => {
1085
- const p = vt(), { getLabel: s } = xe(), i = k(() => ({
1085
+ const h = vt(), { getLabel: s } = xe(), l = k(() => ({
1086
1086
  singular: s("module"),
1087
1087
  plural: s("module_plural"),
1088
1088
  pluralLowerCase: s("module_plural").toLowerCase(),
1089
1089
  singularLowerCase: s("module").toLowerCase()
1090
- }), [s]), g = k(() => ({
1090
+ }), [s]), p = k(() => ({
1091
1091
  singular: s("action"),
1092
1092
  plural: s("action_plural"),
1093
1093
  pluralLowerCase: s("action_plural").toLowerCase(),
1094
1094
  singularLowerCase: s("action").toLowerCase()
1095
- }), [s]), [C, L] = _(""), [M, w] = _([]), [v, c] = _(!1), [d, b] = _("copy"), [j] = we({
1095
+ }), [s]), [v, L] = _(""), [M, w] = _([]), [y, x] = _(!1), [a, C] = _("copy"), [j] = we({
1096
1096
  query: Lt
1097
- }), [A] = we({
1097
+ }), [O] = we({
1098
1098
  query: cn,
1099
- variables: { groupId: C },
1100
- pause: !C
1099
+ variables: { groupId: v },
1100
+ pause: !v
1101
1101
  // Only run when group is selected
1102
- }), [, $] = fe(Ot), [, D] = fe(At), [, O] = fe(ot), [, R] = fe(
1102
+ }), [, R] = fe(Ot), [, $] = fe(At), [, A] = fe(ot), [, T] = fe(
1103
1103
  It
1104
1104
  ), J = k(() => j.data?.groups ? j.data.groups.map(
1105
1105
  (t) => I(Mt, t)
1106
- ) : [], [j.data]), oe = k(() => A.data?.modules ? I(
1106
+ ) : [], [j.data]), oe = k(() => O.data?.modules ? I(
1107
1107
  Qe,
1108
- A.data?.modules
1108
+ O.data?.modules
1109
1109
  ).map((o) => {
1110
- const y = I(
1110
+ const b = I(
1111
1111
  kt,
1112
1112
  o.moduleActions
1113
1113
  ), q = I(
@@ -1116,7 +1116,7 @@ const kn = ({
1116
1116
  ).map((Q) => I(be, Q.data)).flat();
1117
1117
  return {
1118
1118
  ...o,
1119
- moduleActions: y.map((Q) => ({
1119
+ moduleActions: b.map((Q) => ({
1120
1120
  ...Q,
1121
1121
  action: I(Ce, Q.action)
1122
1122
  })),
@@ -1126,38 +1126,38 @@ const kn = ({
1126
1126
  ),
1127
1127
  metadataItems: q
1128
1128
  };
1129
- }) : [], [A.data]), N = k(() => oe.filter(
1129
+ }) : [], [O.data]), D = k(() => oe.filter(
1130
1130
  (t) => M.includes(t.id)
1131
- ), [oe, M]), V = G(
1131
+ ), [oe, M]), Z = G(
1132
1132
  (t) => {
1133
1133
  const o = t?.value || "";
1134
1134
  L(o), w([]);
1135
1135
  },
1136
1136
  []
1137
- ), ee = G(
1137
+ ), V = G(
1138
1138
  (t) => {
1139
- const o = t.map((y) => y.value);
1139
+ const o = t.map((b) => b.value);
1140
1140
  w(o);
1141
1141
  },
1142
1142
  []
1143
- ), T = G(async () => {
1144
- if (c(!0), !N.length) {
1145
- c(!1);
1143
+ ), N = G(async () => {
1144
+ if (x(!0), !D.length) {
1145
+ x(!1);
1146
1146
  const t = new Error(
1147
- `No modules selected for ${d === "convert" ? "converting" : "copying"}`
1147
+ `No modules selected for ${a === "convert" ? "converting" : "copying"}`
1148
1148
  );
1149
- a?.(t);
1149
+ i?.(t);
1150
1150
  return;
1151
1151
  }
1152
1152
  try {
1153
1153
  const t = [];
1154
1154
  let o = 0;
1155
- for (const y of N)
1155
+ for (const b of D)
1156
1156
  try {
1157
- let U = y.moduleActions.map((q) => q.actionId);
1158
- if (u) {
1159
- const q = y.moduleActions.map((K) => K.action), Q = async (K) => {
1160
- if (d === "copy") {
1157
+ let U = b.moduleActions.map((q) => q.actionId);
1158
+ if (d) {
1159
+ const q = b.moduleActions.map((K) => K.action), Q = async (K) => {
1160
+ if (a === "copy") {
1161
1161
  if (K.quantumOwned) return K;
1162
1162
  const ye = I(
1163
1163
  De,
@@ -1165,18 +1165,18 @@ const kn = ({
1165
1165
  ), ke = I(
1166
1166
  je,
1167
1167
  K.metadataGroups
1168
- ).map((he) => I(
1168
+ ).map((pe) => I(
1169
1169
  be,
1170
- he.data
1170
+ pe.data
1171
1171
  ).map((Ne) => Ne.id)).flat(), Ge = I(
1172
1172
  Ze,
1173
1173
  K.reports
1174
- ).map((he) => ({
1175
- ...he,
1174
+ ).map((pe) => ({
1175
+ ...pe,
1176
1176
  id: void 0,
1177
1177
  thresholds: I(
1178
1178
  Oe,
1179
- he.thresholds
1179
+ pe.thresholds
1180
1180
  ).map((Ne) => ({
1181
1181
  ...Ne,
1182
1182
  id: void 0
@@ -1184,25 +1184,25 @@ const kn = ({
1184
1184
  })), et = I(
1185
1185
  Oe,
1186
1186
  K.thresholds
1187
- ).map((he) => ({
1188
- ...he,
1187
+ ).map((pe) => ({
1188
+ ...pe,
1189
1189
  id: void 0
1190
1190
  })), Te = {
1191
1191
  ...K,
1192
1192
  quantumOwned: !0,
1193
1193
  thresholds: et,
1194
- categories: ye?.map((he) => he.id),
1194
+ categories: ye?.map((pe) => pe.id),
1195
1195
  reports: Ge,
1196
1196
  metadataIds: ke,
1197
1197
  id: void 0
1198
- }, Se = await O({ fields: Te });
1198
+ }, Se = await A({ fields: Te });
1199
1199
  return Se.error || !Se.data?.createAction ? null : I(
1200
1200
  Ce,
1201
1201
  Se.data.createAction
1202
1202
  );
1203
1203
  }
1204
1204
  if (K.quantumOwned) return K;
1205
- const ce = await R({
1205
+ const ce = await T({
1206
1206
  id: K.id
1207
1207
  });
1208
1208
  return ce.error || !ce.data?.convertActionToQuantumOwned ? null : I(
@@ -1214,15 +1214,15 @@ const kn = ({
1214
1214
  q.map(Q)
1215
1215
  )).filter((K) => !!K?.id).map((K) => K.id);
1216
1216
  }
1217
- if (d === "convert") {
1217
+ if (a === "convert") {
1218
1218
  const q = {
1219
- name: y.name,
1220
- description: y.description || void 0,
1219
+ name: b.name,
1220
+ description: b.description || void 0,
1221
1221
  actions: U,
1222
- categories: y.categories.map((E) => E.id),
1222
+ categories: b.categories.map((E) => E.id),
1223
1223
  quantumOwned: !0
1224
- }, Q = await D({
1225
- id: y.id,
1224
+ }, Q = await $({
1225
+ id: b.id,
1226
1226
  input: q
1227
1227
  });
1228
1228
  if (Q.error) throw new Error(Q.error.message);
@@ -1235,17 +1235,17 @@ const kn = ({
1235
1235
  }
1236
1236
  } else {
1237
1237
  const q = {
1238
- name: `${y.name} (Copy)`,
1239
- description: y.description || void 0,
1238
+ name: `${b.name} (Copy)`,
1239
+ description: b.description || void 0,
1240
1240
  actions: U,
1241
- categories: y.categories.map((E) => E.id),
1242
- quantumOwned: u,
1243
- metadataItemIds: y.metadataItems.map((E) => E.id),
1244
- actionReports: y.moduleActions.filter((E) => !!E.reportId).map((E) => ({
1241
+ categories: b.categories.map((E) => E.id),
1242
+ quantumOwned: d,
1243
+ metadataItemIds: b.metadataItems.map((E) => E.id),
1244
+ actionReports: b.moduleActions.filter((E) => !!E.reportId).map((E) => ({
1245
1245
  actionId: E.actionId,
1246
1246
  reportId: E.reportId
1247
1247
  }))
1248
- }, Q = await $({ input: q });
1248
+ }, Q = await R({ input: q });
1249
1249
  if (Q.error) throw new Error(Q.error.message);
1250
1250
  if (Q.data?.createModule) {
1251
1251
  const E = I(
@@ -1257,97 +1257,97 @@ const kn = ({
1257
1257
  }
1258
1258
  } catch (U) {
1259
1259
  console.error(
1260
- `Failed to ${d === "convert" ? "convert" : "copy"} module "${y.name}":`,
1260
+ `Failed to ${a === "convert" ? "convert" : "copy"} module "${b.name}":`,
1261
1261
  U
1262
1262
  ), o++;
1263
1263
  }
1264
1264
  if (t.length > 0) {
1265
- const y = t.length, U = N.length;
1266
- p({
1267
- title: o > 0 ? `Partial ${d === "convert" ? "convert" : "copy"} completed` : `${i.plural} ${d === "convert" ? "converted" : "copied"} successfully`,
1268
- description: o > 0 ? `${y} of ${U} ${i.plural} ${d === "convert" ? "converted" : "copied"} successfully` : `${y} ${y > 1 ? i.plural : i.singular} ${d === "convert" ? "converted" : "copied"} successfully`,
1265
+ const b = t.length, U = D.length;
1266
+ h({
1267
+ title: o > 0 ? `Partial ${a === "convert" ? "convert" : "copy"} completed` : `${l.plural} ${a === "convert" ? "converted" : "copied"} successfully`,
1268
+ description: o > 0 ? `${b} of ${U} ${l.plural} ${a === "convert" ? "converted" : "copied"} successfully` : `${b} ${b > 1 ? l.plural : l.singular} ${a === "convert" ? "converted" : "copied"} successfully`,
1269
1269
  status: o > 0 ? "warning" : "success",
1270
1270
  duration: 3e3,
1271
1271
  isClosable: !0
1272
1272
  }), t.length > 0 && r?.(), L(""), w([]);
1273
1273
  } else
1274
1274
  throw new Error(
1275
- `Failed to ${d === "convert" ? "convert" : "copy"} any modules`
1275
+ `Failed to ${a === "convert" ? "convert" : "copy"} any modules`
1276
1276
  );
1277
1277
  } catch (t) {
1278
- const o = t instanceof Error ? t.message : `Failed to ${d === "convert" ? "convert" : "copy"} modules`;
1279
- p({
1280
- title: d === "convert" ? "Convert failed" : "Copy failed",
1278
+ const o = t instanceof Error ? t.message : `Failed to ${a === "convert" ? "convert" : "copy"} modules`;
1279
+ h({
1280
+ title: a === "convert" ? "Convert failed" : "Copy failed",
1281
1281
  description: o,
1282
1282
  status: "error",
1283
1283
  duration: 5e3,
1284
1284
  isClosable: !0
1285
- }), a?.(t instanceof Error ? t : new Error(o));
1285
+ }), i?.(t instanceof Error ? t : new Error(o));
1286
1286
  } finally {
1287
- c(!1);
1287
+ x(!1);
1288
1288
  }
1289
1289
  }, [
1290
- N,
1291
- $,
1292
1290
  D,
1293
- p,
1294
- r,
1295
- a,
1296
- u,
1297
- O,
1298
1291
  R,
1292
+ $,
1293
+ h,
1294
+ r,
1295
+ i,
1299
1296
  d,
1300
- i
1297
+ A,
1298
+ T,
1299
+ a,
1300
+ l
1301
1301
  ]), z = G(() => {
1302
- L(""), w([]), b("copy"), n?.();
1302
+ L(""), w([]), C("copy"), n?.();
1303
1303
  }, [n]);
1304
1304
  le(() => {
1305
- x && x({
1305
+ g && g({
1306
1306
  cancelButton: !1,
1307
- saveButton: N.length === 0 || v
1307
+ saveButton: D.length === 0 || y
1308
1308
  });
1309
- }, [N.length, v, x]), le(() => {
1310
- m && m({
1309
+ }, [D.length, y, g]), le(() => {
1310
+ u && u({
1311
1311
  cancelButton: z,
1312
- saveButton: T
1312
+ saveButton: N
1313
1313
  });
1314
- }, [m, z, T]);
1314
+ }, [u, z, N]);
1315
1315
  const X = k(() => J.map((t) => ({
1316
1316
  value: t.id,
1317
1317
  label: t.name
1318
- })), [J]), W = k(() => oe.filter((t) => d === "copy" ? !0 : !t.quantumOwned).map((t) => ({
1318
+ })), [J]), W = k(() => oe.filter((t) => a === "copy" ? !0 : !t.quantumOwned).map((t) => ({
1319
1319
  value: t.id,
1320
1320
  label: t.name,
1321
1321
  // Add custom data to identify quantum-owned modules
1322
1322
  isQuantumOwned: t.quantumOwned
1323
- })), [oe, d]), H = j.fetching, l = A.fetching;
1324
- return /* @__PURE__ */ e.jsx(te, { children: /* @__PURE__ */ e.jsxs(de, { spacing: 6, align: "stretch", children: [
1325
- u && /* @__PURE__ */ e.jsxs(Y, { children: [
1323
+ })), [oe, a]), H = j.fetching, c = O.fetching;
1324
+ return /* @__PURE__ */ e.jsx(te, { children: /* @__PURE__ */ e.jsxs(ue, { spacing: 6, align: "stretch", children: [
1325
+ d && /* @__PURE__ */ e.jsxs(Y, { children: [
1326
1326
  /* @__PURE__ */ e.jsx(ge, { children: "Operation Mode" }),
1327
1327
  /* @__PURE__ */ e.jsx(
1328
1328
  Ct,
1329
1329
  {
1330
- value: d,
1330
+ value: a,
1331
1331
  onChange: (t) => {
1332
- b(t), w([]);
1332
+ C(t), w([]);
1333
1333
  },
1334
1334
  children: /* @__PURE__ */ e.jsxs(re, { spacing: 6, children: [
1335
- /* @__PURE__ */ e.jsx(Ye, { value: "copy", colorScheme: "blue", children: /* @__PURE__ */ e.jsxs(de, { align: "start", spacing: 1, children: [
1335
+ /* @__PURE__ */ e.jsx(Ye, { value: "copy", colorScheme: "blue", children: /* @__PURE__ */ e.jsxs(ue, { align: "start", spacing: 1, children: [
1336
1336
  /* @__PURE__ */ e.jsxs(S, { fontWeight: "medium", children: [
1337
1337
  "Copy ",
1338
- i.plural
1338
+ l.plural
1339
1339
  ] }),
1340
1340
  /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", color: "gray.600", children: [
1341
1341
  "Create new ",
1342
- i.pluralLowerCase,
1342
+ l.pluralLowerCase,
1343
1343
  " based on selected ones"
1344
1344
  ] })
1345
1345
  ] }) }),
1346
- /* @__PURE__ */ e.jsx(Ye, { value: "convert", colorScheme: "green", children: /* @__PURE__ */ e.jsxs(de, { align: "start", spacing: 1, children: [
1346
+ /* @__PURE__ */ e.jsx(Ye, { value: "convert", colorScheme: "green", children: /* @__PURE__ */ e.jsxs(ue, { align: "start", spacing: 1, children: [
1347
1347
  /* @__PURE__ */ e.jsx(S, { fontWeight: "medium", children: "Convert to Quantum Owned" }),
1348
1348
  /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", color: "gray.600", children: [
1349
1349
  "Convert existing ",
1350
- i.pluralLowerCase,
1350
+ l.pluralLowerCase,
1351
1351
  " to quantum-owned"
1352
1352
  ] })
1353
1353
  ] }) })
@@ -1358,12 +1358,12 @@ const kn = ({
1358
1358
  /* @__PURE__ */ e.jsxs(Y, { children: [
1359
1359
  /* @__PURE__ */ e.jsx(ge, { children: "Select Source Group" }),
1360
1360
  /* @__PURE__ */ e.jsx(
1361
- me,
1361
+ he,
1362
1362
  {
1363
1363
  placeholder: "Choose a group...",
1364
1364
  options: X,
1365
- value: X.find((t) => t.value === C) || null,
1366
- onChange: V,
1365
+ value: X.find((t) => t.value === v) || null,
1366
+ onChange: Z,
1367
1367
  isLoading: H,
1368
1368
  isDisabled: H,
1369
1369
  isClearable: !0
@@ -1377,25 +1377,25 @@ const kn = ({
1377
1377
  ] })
1378
1378
  ] })
1379
1379
  ] }),
1380
- C && /* @__PURE__ */ e.jsxs(Y, { children: [
1381
- /* @__PURE__ */ e.jsx(ge, { children: d === "convert" ? `Select ${i.plural} to Convert` : `Select ${i.plural} to Copy` }),
1382
- l ? /* @__PURE__ */ e.jsxs(re, { children: [
1380
+ v && /* @__PURE__ */ e.jsxs(Y, { children: [
1381
+ /* @__PURE__ */ e.jsx(ge, { children: a === "convert" ? `Select ${l.plural} to Convert` : `Select ${l.plural} to Copy` }),
1382
+ c ? /* @__PURE__ */ e.jsxs(re, { children: [
1383
1383
  /* @__PURE__ */ e.jsx(wt, { size: "sm" }),
1384
1384
  /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", color: "gray.600", children: [
1385
1385
  "Loading ",
1386
- i.pluralLowerCase,
1386
+ l.pluralLowerCase,
1387
1387
  "..."
1388
1388
  ] })
1389
1389
  ] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1390
1390
  /* @__PURE__ */ e.jsx(
1391
- me,
1391
+ he,
1392
1392
  {
1393
- placeholder: d === "convert" ? `Choose ${i.pluralLowerCase} to convert...` : `Choose ${i.pluralLowerCase} to copy...`,
1393
+ placeholder: a === "convert" ? `Choose ${l.pluralLowerCase} to convert...` : `Choose ${l.pluralLowerCase} to copy...`,
1394
1394
  options: W,
1395
1395
  value: W.filter(
1396
1396
  (t) => M.includes(t.value)
1397
1397
  ),
1398
- onChange: ee,
1398
+ onChange: V,
1399
1399
  isDisabled: W.length === 0,
1400
1400
  isClearable: !0,
1401
1401
  isMulti: !0,
@@ -1411,25 +1411,25 @@ const kn = ({
1411
1411
  ),
1412
1412
  W.length === 0 && /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", color: "gray.500", mt: 2, children: [
1413
1413
  "No ",
1414
- i.pluralLowerCase,
1414
+ l.pluralLowerCase,
1415
1415
  " found in this group"
1416
1416
  ] })
1417
1417
  ] }),
1418
- A.error && /* @__PURE__ */ e.jsxs(He, { status: "error", mt: 2, children: [
1418
+ O.error && /* @__PURE__ */ e.jsxs(He, { status: "error", mt: 2, children: [
1419
1419
  /* @__PURE__ */ e.jsx(Je, {}),
1420
1420
  /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", children: [
1421
1421
  "Failed to load ",
1422
- i.pluralLowerCase,
1422
+ l.pluralLowerCase,
1423
1423
  ":",
1424
1424
  " ",
1425
- A.error.message
1425
+ O.error.message
1426
1426
  ] })
1427
1427
  ] })
1428
1428
  ] }),
1429
- N.length > 0 && /* @__PURE__ */ e.jsxs(te, { p: 4, bg: "gray.50", borderRadius: "md", children: [
1430
- /* @__PURE__ */ e.jsx(S, { fontWeight: "semibold", mb: 3, children: N.length === 1 ? `${i.singular} to ${d === "copy" ? "Copy" : "Convert"}` : `${N.length} ${i.plural} to ${d === "copy" ? "Copy" : "Convert"}` }),
1431
- /* @__PURE__ */ e.jsxs(de, { align: "start", spacing: 3, children: [
1432
- N.map((t, o) => /* @__PURE__ */ e.jsxs(
1429
+ D.length > 0 && /* @__PURE__ */ e.jsxs(te, { p: 4, bg: "gray.50", borderRadius: "md", children: [
1430
+ /* @__PURE__ */ e.jsx(S, { fontWeight: "semibold", mb: 3, children: D.length === 1 ? `${l.singular} to ${a === "copy" ? "Copy" : "Convert"}` : `${D.length} ${l.plural} to ${a === "copy" ? "Copy" : "Convert"}` }),
1431
+ /* @__PURE__ */ e.jsxs(ue, { align: "start", spacing: 3, children: [
1432
+ D.map((t, o) => /* @__PURE__ */ e.jsxs(
1433
1433
  te,
1434
1434
  {
1435
1435
  w: "100%",
@@ -1448,7 +1448,7 @@ const kn = ({
1448
1448
  t.quantumOwned && /* @__PURE__ */ e.jsx($e, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
1449
1449
  ] }),
1450
1450
  /* @__PURE__ */ e.jsxs(
1451
- de,
1451
+ ue,
1452
1452
  {
1453
1453
  align: "start",
1454
1454
  spacing: 1,
@@ -1468,7 +1468,7 @@ const kn = ({
1468
1468
  /* @__PURE__ */ e.jsxs(S, { children: [
1469
1469
  /* @__PURE__ */ e.jsx("strong", { children: "Categories:" }),
1470
1470
  " ",
1471
- t.categories.map((y) => y.name).join(", ") || "None"
1471
+ t.categories.map((b) => b.name).join(", ") || "None"
1472
1472
  ] })
1473
1473
  ]
1474
1474
  }
@@ -1477,7 +1477,7 @@ const kn = ({
1477
1477
  },
1478
1478
  t.id
1479
1479
  )),
1480
- N.length > 1 && /* @__PURE__ */ e.jsx(
1480
+ D.length > 1 && /* @__PURE__ */ e.jsx(
1481
1481
  te,
1482
1482
  {
1483
1483
  w: "100%",
@@ -1488,16 +1488,16 @@ const kn = ({
1488
1488
  borderColor: "blue.200",
1489
1489
  children: /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", fontWeight: "medium", color: "blue.800", children: [
1490
1490
  "Total: ",
1491
- N.length,
1491
+ D.length,
1492
1492
  " ",
1493
- i.pluralLowerCase,
1493
+ l.pluralLowerCase,
1494
1494
  " will be",
1495
1495
  " ",
1496
- d === "copy" ? "copied" : "converted"
1496
+ a === "copy" ? "copied" : "converted"
1497
1497
  ] })
1498
1498
  }
1499
1499
  ),
1500
- u && N.filter((t) => t.moduleActions.some((o) => !o.action.quantumOwned)).length > 0 && /* @__PURE__ */ e.jsx(
1500
+ d && D.filter((t) => t.moduleActions.some((o) => !o.action.quantumOwned)).length > 0 && /* @__PURE__ */ e.jsx(
1501
1501
  te,
1502
1502
  {
1503
1503
  p: 2,
@@ -1505,33 +1505,33 @@ const kn = ({
1505
1505
  borderRadius: "md",
1506
1506
  border: "1px solid",
1507
1507
  borderColor: "yellow.200",
1508
- children: /* @__PURE__ */ e.jsx(S, { fontSize: "sm", fontWeight: "medium", color: "yellow.800", children: d === "convert" ? `Converting ${i.plural} will convert non QM-Owned ${g.plural} to QM-Owned ${g.plural}` : `Copying ${i.plural} with Non QM-Owned ${g.plural} will create corresponding QM-Owned ${g.plural}` })
1508
+ children: /* @__PURE__ */ e.jsx(S, { fontSize: "sm", fontWeight: "medium", color: "yellow.800", children: a === "convert" ? `Converting ${l.plural} will convert non QM-Owned ${p.plural} to QM-Owned ${p.plural}` : `Copying ${l.plural} with Non QM-Owned ${p.plural} will create corresponding QM-Owned ${p.plural}` })
1509
1509
  }
1510
1510
  )
1511
1511
  ] })
1512
1512
  ] }),
1513
- !h && /* @__PURE__ */ e.jsxs(Ae, { spacing: 4, justifyContent: "flex-end", children: [
1513
+ !m && /* @__PURE__ */ e.jsxs(Ae, { spacing: 4, justifyContent: "flex-end", children: [
1514
1514
  /* @__PURE__ */ e.jsx(
1515
1515
  se,
1516
1516
  {
1517
1517
  variant: "outline",
1518
1518
  onClick: z,
1519
- isDisabled: v,
1519
+ isDisabled: y,
1520
1520
  children: "Cancel"
1521
1521
  }
1522
1522
  ),
1523
1523
  /* @__PURE__ */ e.jsxs(
1524
1524
  se,
1525
1525
  {
1526
- colorScheme: d === "copy" ? "blue" : "green",
1527
- onClick: T,
1528
- isDisabled: N.length === 0 || v,
1529
- isLoading: v,
1530
- loadingText: `${d === "copy" ? "Copying" : "Converting"}...`,
1526
+ colorScheme: a === "copy" ? "blue" : "green",
1527
+ onClick: N,
1528
+ isDisabled: D.length === 0 || y,
1529
+ isLoading: y,
1530
+ loadingText: `${a === "copy" ? "Copying" : "Converting"}...`,
1531
1531
  children: [
1532
- d === "copy" ? "Copy" : "Convert",
1532
+ a === "copy" ? "Copy" : "Convert",
1533
1533
  " ",
1534
- N.length === 1 ? i.singular : `${N.length} ${i.plural}`
1534
+ D.length === 1 ? l.singular : `${D.length} ${l.plural}`
1535
1535
  ]
1536
1536
  }
1537
1537
  )
@@ -1547,51 +1547,51 @@ const kn = ({
1547
1547
  }, zn = ({
1548
1548
  name: r,
1549
1549
  setName: n,
1550
- actions: a,
1551
- selectedActionIds: h,
1552
- setSelectedActionIds: x,
1553
- availableCategories: m,
1554
- selectedCategoryIds: u,
1555
- setSelectedCategoryIds: p,
1550
+ actions: i,
1551
+ selectedActionIds: m,
1552
+ setSelectedActionIds: g,
1553
+ availableCategories: u,
1554
+ selectedCategoryIds: d,
1555
+ setSelectedCategoryIds: h,
1556
1556
  description: s,
1557
- setDescription: i,
1558
- selectedMetadataIds: g,
1559
- setSelectedMetadataIds: C,
1557
+ setDescription: l,
1558
+ selectedMetadataIds: p,
1559
+ setSelectedMetadataIds: v,
1560
1560
  actionReportIds: L,
1561
1561
  setActionReportIds: M,
1562
1562
  ...w
1563
1563
  }) => {
1564
- const v = qt(), c = k(() => a.map((D) => ({
1565
- ...D,
1566
- selected: h.includes(D.id)
1567
- })), [a, h]), d = k(() => a.reduce((D, O) => (D[O.id] = O, D), {}), [a]), b = k(
1568
- () => h.map((D) => d[D]),
1569
- [h, d]
1564
+ const y = qt(), x = k(() => i.map(($) => ({
1565
+ ...$,
1566
+ selected: m.includes($.id)
1567
+ })), [i, m]), a = k(() => i.reduce(($, A) => ($[A.id] = A, $), {}), [i]), C = k(
1568
+ () => m.map(($) => a[$]),
1569
+ [m, a]
1570
1570
  ), j = G(
1571
- (D, O) => {
1572
- x(O ? [...h, D.id] : h.filter((R) => R !== D.id));
1571
+ ($, A) => {
1572
+ g(A ? [...m, $.id] : m.filter((T) => T !== $.id));
1573
1573
  },
1574
- [h, x]
1575
- ), A = G(
1576
- (D) => {
1577
- n(D.target.value);
1574
+ [m, g]
1575
+ ), O = G(
1576
+ ($) => {
1577
+ n($.target.value);
1578
1578
  },
1579
1579
  [n]
1580
- ), $ = G(
1581
- (D) => {
1582
- i?.(D.target.value);
1580
+ ), R = G(
1581
+ ($) => {
1582
+ l?.($.target.value);
1583
1583
  },
1584
- [i]
1584
+ [l]
1585
1585
  );
1586
1586
  return /* @__PURE__ */ e.jsxs(te, { ...w, children: [
1587
1587
  /* @__PURE__ */ e.jsxs(re, { gap: "2rem", children: [
1588
- /* @__PURE__ */ e.jsx(Bn, { name: r ?? "", onInputChange: A }),
1588
+ /* @__PURE__ */ e.jsx(Bn, { name: r ?? "", onInputChange: O }),
1589
1589
  /* @__PURE__ */ e.jsx(
1590
1590
  Wn,
1591
1591
  {
1592
- availableCategories: m,
1593
- value: u,
1594
- onChange: p
1592
+ availableCategories: u,
1593
+ value: d,
1594
+ onChange: h
1595
1595
  }
1596
1596
  )
1597
1597
  ] }),
@@ -1599,22 +1599,22 @@ const kn = ({
1599
1599
  Un,
1600
1600
  {
1601
1601
  description: s ?? "",
1602
- onInputChange: $
1602
+ onInputChange: R
1603
1603
  }
1604
1604
  ),
1605
1605
  /* @__PURE__ */ e.jsx(
1606
1606
  Yn,
1607
1607
  {
1608
- selectedMetadataIds: g,
1609
- setSelectedMetadataIds: C
1608
+ selectedMetadataIds: p,
1609
+ setSelectedMetadataIds: v
1610
1610
  }
1611
1611
  ),
1612
1612
  /* @__PURE__ */ e.jsx(
1613
1613
  Qn,
1614
1614
  {
1615
- value: b,
1616
- onChange: x,
1617
- onAdjustActivities: () => v.onOpen(),
1615
+ value: C,
1616
+ onChange: g,
1617
+ onAdjustActivities: () => y.onOpen(),
1618
1618
  actionReportIds: L,
1619
1619
  setActionReportIds: M
1620
1620
  }
@@ -1622,8 +1622,8 @@ const kn = ({
1622
1622
  /* @__PURE__ */ e.jsxs(
1623
1623
  Kt,
1624
1624
  {
1625
- isOpen: v.isOpen,
1626
- onClose: v.onClose,
1625
+ isOpen: y.isOpen,
1626
+ onClose: y.onClose,
1627
1627
  size: "6xl",
1628
1628
  children: [
1629
1629
  /* @__PURE__ */ e.jsx(Yt, {}),
@@ -1633,7 +1633,7 @@ const kn = ({
1633
1633
  /* @__PURE__ */ e.jsx(Zt, { children: /* @__PURE__ */ e.jsx(
1634
1634
  _n,
1635
1635
  {
1636
- actions: c,
1636
+ actions: x,
1637
1637
  onSelected: j,
1638
1638
  disableCreate: !0,
1639
1639
  disableDelete: !0,
@@ -1647,8 +1647,8 @@ const kn = ({
1647
1647
  se,
1648
1648
  {
1649
1649
  colorScheme: "blue",
1650
- onClick: v.onClose,
1651
- isDisabled: h.length === 0,
1650
+ onClick: y.onClose,
1651
+ isDisabled: m.length === 0,
1652
1652
  children: "Done"
1653
1653
  }
1654
1654
  ) })
@@ -1662,10 +1662,10 @@ const kn = ({
1662
1662
  name: r,
1663
1663
  onInputChange: n
1664
1664
  }) => {
1665
- const { getLabel: a } = xe(), h = a("module"), { isView: x } = Fe();
1665
+ const { getLabel: i } = xe(), m = i("module"), { isView: g } = Fe();
1666
1666
  return /* @__PURE__ */ e.jsxs(Y, { mb: 4, children: [
1667
1667
  /* @__PURE__ */ e.jsxs(ge, { children: [
1668
- h,
1668
+ m,
1669
1669
  " Name"
1670
1670
  ] }),
1671
1671
  /* @__PURE__ */ e.jsx(
@@ -1675,7 +1675,7 @@ const kn = ({
1675
1675
  value: r,
1676
1676
  onChange: n,
1677
1677
  isRequired: !0,
1678
- isDisabled: x
1678
+ isDisabled: g
1679
1679
  }
1680
1680
  )
1681
1681
  ] });
@@ -1684,33 +1684,33 @@ const kn = ({
1684
1684
  ({
1685
1685
  availableCategories: r,
1686
1686
  value: n,
1687
- onChange: a
1687
+ onChange: i
1688
1688
  }) => {
1689
- const { getLabel: h } = xe(), x = h("module"), { isView: m } = Fe(), u = k(() => [
1689
+ const { getLabel: m } = xe(), g = m("module"), { isView: u } = Fe(), d = k(() => [
1690
1690
  ...r,
1691
1691
  {
1692
1692
  id: "other",
1693
1693
  name: "Other"
1694
1694
  }
1695
- ], [r]), p = k(() => u.map((s) => ({
1695
+ ], [r]), h = k(() => d.map((s) => ({
1696
1696
  value: s.id,
1697
1697
  label: s.name
1698
- })), [u]);
1698
+ })), [d]);
1699
1699
  return /* @__PURE__ */ e.jsxs(Y, { mb: 4, children: [
1700
1700
  /* @__PURE__ */ e.jsxs(ge, { children: [
1701
- x,
1701
+ g,
1702
1702
  " Category"
1703
1703
  ] }),
1704
1704
  /* @__PURE__ */ e.jsx(
1705
- me,
1705
+ he,
1706
1706
  {
1707
- isDisabled: r.length === 0 || m,
1708
- options: p,
1709
- value: n.length === 0 ? { value: "other", label: "Other" } : u.filter((s) => n.includes(s.id)).map((s) => ({
1707
+ isDisabled: r.length === 0 || u,
1708
+ options: h,
1709
+ value: n.length === 0 ? { value: "other", label: "Other" } : d.filter((s) => n.includes(s.id)).map((s) => ({
1710
1710
  value: s.id,
1711
1711
  label: s.name
1712
1712
  }))[0],
1713
- onChange: (s) => a(s ? [s.value] : []),
1713
+ onChange: (s) => i(s ? [s.value] : []),
1714
1714
  placeholder: "Select category"
1715
1715
  }
1716
1716
  )
@@ -1721,14 +1721,14 @@ const kn = ({
1721
1721
  description: r,
1722
1722
  onInputChange: n
1723
1723
  }) => {
1724
- const { getLabel: a } = xe(), h = a("module"), { isView: x } = Fe();
1724
+ const { getLabel: i } = xe(), m = i("module"), { isView: g } = Fe();
1725
1725
  return /* @__PURE__ */ e.jsxs(Y, { mb: 4, children: [
1726
1726
  /* @__PURE__ */ e.jsx(ge, { children: /* @__PURE__ */ e.jsxs("span", { children: [
1727
1727
  "Description",
1728
1728
  /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", color: "gray.500", children: [
1729
1729
  "Briefly describe the objective of this",
1730
1730
  " ",
1731
- h.toLocaleLowerCase(),
1731
+ m.toLocaleLowerCase(),
1732
1732
  ". Max 40 words."
1733
1733
  ] })
1734
1734
  ] }) }),
@@ -1738,7 +1738,7 @@ const kn = ({
1738
1738
  placeholder: "i.e. Assess readiness to return to play post-ACL reconstruction",
1739
1739
  value: r,
1740
1740
  onChange: n,
1741
- isDisabled: x
1741
+ isDisabled: g
1742
1742
  }
1743
1743
  )
1744
1744
  ] });
@@ -1747,70 +1747,70 @@ const kn = ({
1747
1747
  ({
1748
1748
  value: r,
1749
1749
  onChange: n,
1750
- onAdjustActivities: a,
1751
- actionReportIds: h,
1752
- setActionReportIds: x
1750
+ onAdjustActivities: i,
1751
+ actionReportIds: m,
1752
+ setActionReportIds: g
1753
1753
  }) => {
1754
- const { getLabel: m } = xe(), { isView: u } = Fe(), p = k(() => ({
1755
- module: m("module"),
1756
- moduleLowerCase: m("module").toLocaleLowerCase(),
1757
- action: m("action"),
1758
- actionPlural: m("action_plural"),
1759
- actionPluralLowerCase: m("action_plural").toLocaleLowerCase()
1760
- }), [m]), s = k(
1761
- () => r.filter((i) => !!i?.id).map((i) => ({
1762
- id: i.id,
1763
- name: i.name,
1764
- reports: I(Ze, i.reports) || [],
1765
- selectedReportId: h[i.id] || null
1754
+ const { getLabel: u } = xe(), { isView: d } = Fe(), h = k(() => ({
1755
+ module: u("module"),
1756
+ moduleLowerCase: u("module").toLocaleLowerCase(),
1757
+ action: u("action"),
1758
+ actionPlural: u("action_plural"),
1759
+ actionPluralLowerCase: u("action_plural").toLocaleLowerCase()
1760
+ }), [u]), s = k(
1761
+ () => r.filter((l) => !!l?.id).map((l) => ({
1762
+ id: l.id,
1763
+ name: l.name,
1764
+ reports: I(Ze, l.reports) || [],
1765
+ selectedReportId: m[l.id] || null
1766
1766
  })),
1767
- [r, h]
1767
+ [r, m]
1768
1768
  );
1769
1769
  return /* @__PURE__ */ e.jsxs(Y, { mb: 4, children: [
1770
1770
  /* @__PURE__ */ e.jsxs(re, { justifyContent: "space-between", children: [
1771
1771
  /* @__PURE__ */ e.jsx(ge, { children: /* @__PURE__ */ e.jsxs("span", { children: [
1772
- p.actionPlural,
1773
- !u && /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", color: "gray.500", children: [
1772
+ h.actionPlural,
1773
+ !d && /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", color: "gray.500", children: [
1774
1774
  "Drag and drop to reorder the ",
1775
- p.actionPluralLowerCase,
1775
+ h.actionPluralLowerCase,
1776
1776
  " ",
1777
1777
  "in this ",
1778
- p.moduleLowerCase,
1778
+ h.moduleLowerCase,
1779
1779
  "."
1780
1780
  ] })
1781
1781
  ] }) }),
1782
- !u && /* @__PURE__ */ e.jsxs(
1782
+ !d && /* @__PURE__ */ e.jsxs(
1783
1783
  se,
1784
1784
  {
1785
1785
  size: "sm",
1786
1786
  variant: "solid",
1787
1787
  colorScheme: "blue",
1788
- onClick: a,
1788
+ onClick: i,
1789
1789
  children: [
1790
1790
  "Add / Remove ",
1791
- p.actionPlural
1791
+ h.actionPlural
1792
1792
  ]
1793
1793
  }
1794
1794
  )
1795
1795
  ] }),
1796
- s.length === 0 ? /* @__PURE__ */ e.jsx(de, { children: /* @__PURE__ */ e.jsxs(S, { color: "gray.500", fontSize: "lg", mb: "4rem", mt: "4rem", children: [
1796
+ s.length === 0 ? /* @__PURE__ */ e.jsx(ue, { children: /* @__PURE__ */ e.jsxs(S, { color: "gray.500", fontSize: "lg", mb: "4rem", mt: "4rem", children: [
1797
1797
  "No ",
1798
- p.actionPluralLowerCase,
1798
+ h.actionPluralLowerCase,
1799
1799
  " selected for this",
1800
1800
  " ",
1801
- p.moduleLowerCase,
1801
+ h.moduleLowerCase,
1802
1802
  ".",
1803
- !u && /* @__PURE__ */ e.jsxs(
1803
+ !d && /* @__PURE__ */ e.jsxs(
1804
1804
  se,
1805
1805
  {
1806
1806
  ml: "0.5em",
1807
1807
  size: "sm",
1808
1808
  variant: "link",
1809
1809
  colorScheme: "blue",
1810
- onClick: a,
1810
+ onClick: i,
1811
1811
  children: [
1812
1812
  "Add ",
1813
- p.actionPluralLowerCase,
1813
+ h.actionPluralLowerCase,
1814
1814
  "."
1815
1815
  ]
1816
1816
  }
@@ -1819,13 +1819,13 @@ const kn = ({
1819
1819
  qn,
1820
1820
  {
1821
1821
  value: s,
1822
- onChange: (i) => {
1823
- const g = i(s);
1824
- n(g.map((C) => C.id));
1822
+ onChange: (l) => {
1823
+ const p = l(s);
1824
+ n(p.map((v) => v.id));
1825
1825
  },
1826
- disabled: u,
1827
- actionReportIds: h,
1828
- setActionReportIds: x
1826
+ disabled: d,
1827
+ actionReportIds: m,
1828
+ setActionReportIds: g
1829
1829
  }
1830
1830
  )
1831
1831
  ] });
@@ -1834,115 +1834,116 @@ const kn = ({
1834
1834
  ({
1835
1835
  value: r,
1836
1836
  onChange: n,
1837
- disabled: a,
1838
- actionReportIds: h,
1839
- setActionReportIds: x
1837
+ disabled: i,
1838
+ actionReportIds: m,
1839
+ setActionReportIds: g
1840
1840
  }) => {
1841
- const [m] = _(
1841
+ const [u] = _(
1842
1842
  () => Math.random().toString(36).substring(2, 15)
1843
- ), u = G(
1844
- (p, s) => {
1845
- a || n((i) => {
1846
- const g = [...i], [C] = g.splice(p, 1);
1847
- return g.splice(s, 0, C), g;
1843
+ ), d = G(
1844
+ (h, s) => {
1845
+ i || n((l) => {
1846
+ const p = [...l], [v] = p.splice(h, 1);
1847
+ return p.splice(s, 0, v), p;
1848
1848
  });
1849
1849
  },
1850
- [n, a]
1850
+ [n, i]
1851
1851
  );
1852
- return /* @__PURE__ */ e.jsx(te, { children: /* @__PURE__ */ e.jsx(Cn, { backend: wn, children: /* @__PURE__ */ e.jsx(de, { spacing: 3, align: "stretch", children: r.map((p, s) => /* @__PURE__ */ e.jsx(
1852
+ return /* @__PURE__ */ e.jsx(te, { children: /* @__PURE__ */ e.jsx(Cn, { backend: wn, children: /* @__PURE__ */ e.jsx(ue, { spacing: 3, align: "stretch", children: r.map((h, s) => /* @__PURE__ */ e.jsx(
1853
1853
  Kn,
1854
1854
  {
1855
- listKey: m,
1856
- item: p,
1855
+ listKey: u,
1856
+ item: h,
1857
1857
  index: s,
1858
- disabled: !!a,
1859
- move: u,
1860
- onReportChange: (i) => {
1861
- x({
1862
- ...h,
1863
- [p.id]: i
1858
+ disabled: !!i,
1859
+ move: d,
1860
+ onReportChange: (l) => {
1861
+ g({
1862
+ ...m,
1863
+ [h.id]: l
1864
1864
  });
1865
1865
  }
1866
1866
  },
1867
- p.id
1867
+ h.id
1868
1868
  )) }) }) });
1869
1869
  }
1870
1870
  ), Kn = Me(
1871
1871
  ({
1872
1872
  listKey: r,
1873
1873
  item: n,
1874
- index: a,
1875
- disabled: h,
1876
- move: x,
1877
- onReportChange: m
1874
+ index: i,
1875
+ disabled: m,
1876
+ move: g,
1877
+ onReportChange: u
1878
1878
  }) => {
1879
- const u = an(null), { getLabel: p } = xe(), s = p("action"), [{ handlerId: i }, g] = Sn({
1879
+ const d = an(null), { getLabel: h } = xe(), s = h("action"), [{ handlerId: l }, p] = Sn({
1880
1880
  accept: r,
1881
- collect: (c) => ({
1882
- handlerId: c.getHandlerId()?.toString() ?? ""
1881
+ collect: (a) => ({
1882
+ handlerId: a.getHandlerId()?.toString() ?? ""
1883
1883
  }),
1884
- hover: (c, d) => {
1885
- if (!u.current)
1884
+ hover: (a, C) => {
1885
+ if (!d.current)
1886
1886
  return;
1887
- const b = c.index, j = a;
1888
- if (b === j)
1887
+ const j = a.index, O = i;
1888
+ if (j === O)
1889
1889
  return;
1890
- const A = u.current?.getBoundingClientRect(), $ = (A.bottom - A.top) / 2, O = d.getClientOffset().y - A.top;
1891
- b < j && O < $ || b > j && O > $ || (x(b, j), c.index = j);
1890
+ const R = d.current?.getBoundingClientRect(), $ = (R.bottom - R.top) / 2, T = C.getClientOffset().y - R.top;
1891
+ j < O && T < $ || j > O && T > $ || (g(j, O), a.index = O);
1892
1892
  }
1893
- }), [{ isDragging: C }, L] = Ln({
1893
+ }), [{ isDragging: v }, L] = Ln({
1894
1894
  type: r,
1895
- item: () => ({ id: n.id, index: a }),
1896
- collect: (c) => ({
1897
- isDragging: c.isDragging()
1895
+ item: () => ({ id: n.id, index: i }),
1896
+ collect: (a) => ({
1897
+ isDragging: a.isDragging()
1898
1898
  }),
1899
- canDrag: !h
1900
- }), M = k(() => [
1899
+ canDrag: !m
1900
+ }), M = k(() => `action-report-label-${n.id}`, [n.id]), w = k(() => [
1901
1901
  { value: null, label: "No Report" },
1902
- ...n.reports.map((c) => {
1903
- const d = c.name && c.name.length > 0 ? c.name : "No Name", b = Le(c.reportKind);
1902
+ ...n.reports.map((a) => {
1903
+ const C = a.name && a.name.length > 0 ? a.name : "No Name", j = Le(a.reportKind);
1904
1904
  return {
1905
- value: c.id,
1906
- label: `${d} (${b})`
1905
+ value: a.id,
1906
+ label: `${C} (${j})`
1907
1907
  };
1908
1908
  })
1909
- ], [n.reports]), w = C ? 0.6 : 1, v = h ? "default" : C ? "grabbing" : "grab";
1910
- return L(g(u)), /* @__PURE__ */ e.jsx(
1909
+ ], [n.reports]), y = v ? 0.6 : 1, x = m ? "default" : v ? "grabbing" : "grab";
1910
+ return L(p(d)), /* @__PURE__ */ e.jsx(
1911
1911
  te,
1912
1912
  {
1913
- ref: u,
1913
+ ref: d,
1914
1914
  p: 3,
1915
1915
  border: "1px solid",
1916
1916
  borderColor: "gray.200",
1917
1917
  borderRadius: "md",
1918
1918
  bg: "gray.50",
1919
- style: { opacity: w, cursor: v },
1920
- "data-handler-id": i,
1919
+ style: { opacity: y, cursor: x },
1920
+ "data-handler-id": l,
1921
1921
  children: /* @__PURE__ */ e.jsxs(re, { justify: "space-between", align: "center", children: [
1922
1922
  /* @__PURE__ */ e.jsxs(re, { spacing: 3, children: [
1923
1923
  /* @__PURE__ */ e.jsxs(S, { fontWeight: "semibold", minW: "2rem", children: [
1924
- a + 1,
1924
+ i + 1,
1925
1925
  "."
1926
1926
  ] }),
1927
1927
  /* @__PURE__ */ e.jsx(S, { fontWeight: "medium", children: n.name })
1928
1928
  ] }),
1929
1929
  /* @__PURE__ */ e.jsxs(re, { spacing: 3, align: "center", children: [
1930
- /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", color: "gray.600", children: [
1930
+ /* @__PURE__ */ e.jsxs(S, { id: M, fontSize: "sm", color: "gray.600", children: [
1931
1931
  s,
1932
1932
  " Report:"
1933
1933
  ] }),
1934
1934
  /* @__PURE__ */ e.jsx(te, { width: "450px", children: /* @__PURE__ */ e.jsx(
1935
- me,
1935
+ he,
1936
1936
  {
1937
- value: M.find(
1938
- (c) => c.value === n.selectedReportId
1937
+ "aria-labelledby": M,
1938
+ value: w.find(
1939
+ (a) => a.value === n.selectedReportId
1939
1940
  ),
1940
- onChange: (c) => {
1941
- m(c?.value || null);
1941
+ onChange: (a) => {
1942
+ u(a?.value || null);
1942
1943
  },
1943
- options: M,
1944
+ options: w,
1944
1945
  placeholder: "Select report...",
1945
- isDisabled: h
1946
+ isDisabled: m
1946
1947
  }
1947
1948
  ) })
1948
1949
  ] })
@@ -1955,81 +1956,81 @@ const kn = ({
1955
1956
  selectedMetadataIds: r,
1956
1957
  setSelectedMetadataIds: n
1957
1958
  }) => {
1958
- const { getLabel: a } = xe(), { isView: h, metadataOptions: x } = Fe(), m = k(() => [
1959
+ const { getLabel: i } = xe(), { isView: m, metadataOptions: g } = Fe(), u = k(() => [
1959
1960
  {
1960
1961
  key: "activity_type",
1961
- label: `${a("action")} Type`,
1962
+ label: `${i("action")} Type`,
1962
1963
  multi: !0
1963
1964
  },
1964
1965
  { key: "session_type", label: "Session Type", multi: !0 },
1965
1966
  { key: "body_region", label: "Body Region", multi: !0 },
1966
1967
  { key: "sport", label: "Sport", multi: !0 }
1967
- ], [a]), u = G(
1968
- (p, s) => {
1969
- const i = m.find((C) => C.key === p);
1970
- if (!i) return;
1971
- const g = i.multi ? (s ?? []).map((C) => C.id) : s ? [s.id] : [];
1972
- n((C) => [...C.filter((M) => Object.values(x || {}).flat().find((v) => v.id === M) && !Object.keys(x || {}).find(
1973
- (v) => x?.[v]?.some(
1974
- (c) => c.id === M && v === p
1968
+ ], [i]), d = G(
1969
+ (h, s) => {
1970
+ const l = u.find((v) => v.key === h);
1971
+ if (!l) return;
1972
+ const p = l.multi ? (s ?? []).map((v) => v.id) : s ? [s.id] : [];
1973
+ n((v) => [...v.filter((M) => Object.values(g || {}).flat().find((y) => y.id === M) && !Object.keys(g || {}).find(
1974
+ (y) => g?.[y]?.some(
1975
+ (x) => x.id === M && y === h
1975
1976
  )
1976
- )), ...g]);
1977
+ )), ...p]);
1977
1978
  },
1978
- [m, x, n]
1979
+ [u, g, n]
1979
1980
  );
1980
- return x ? /* @__PURE__ */ e.jsxs(Y, { mb: 4, children: [
1981
+ return g ? /* @__PURE__ */ e.jsxs(Y, { mb: 4, children: [
1981
1982
  /* @__PURE__ */ e.jsx(ge, { children: "Metadata Tags" }),
1982
- /* @__PURE__ */ e.jsx(re, { gap: "1rem", align: "start", children: m.map((p) => /* @__PURE__ */ e.jsxs(Y, { flex: "1", children: [
1983
- /* @__PURE__ */ e.jsx(Xe, { fontSize: "sm", children: p.label }),
1983
+ /* @__PURE__ */ e.jsx(re, { gap: "1rem", align: "start", children: u.map((h) => /* @__PURE__ */ e.jsxs(Y, { flex: "1", children: [
1984
+ /* @__PURE__ */ e.jsx(Xe, { fontSize: "sm", children: h.label }),
1984
1985
  /* @__PURE__ */ e.jsx(
1985
- me,
1986
+ he,
1986
1987
  {
1987
- isMulti: p.multi,
1988
- value: x[p.key]?.filter(
1988
+ isMulti: h.multi,
1989
+ value: g[h.key]?.filter(
1989
1990
  (s) => r.includes(s.id)
1990
1991
  ),
1991
1992
  onChange: (s) => {
1992
- u(
1993
- p.key,
1993
+ d(
1994
+ h.key,
1994
1995
  s
1995
1996
  );
1996
1997
  },
1997
- options: x[p.key],
1998
- placeholder: `Select ${p.multi ? "one or more" : "one"} ${p.label.toLowerCase()}`,
1999
- isDisabled: h,
2000
- isClearable: p.multi
1998
+ options: g[h.key],
1999
+ placeholder: `Select ${h.multi ? "one or more" : "one"} ${h.label.toLowerCase()}`,
2000
+ isDisabled: m,
2001
+ isClearable: h.multi
2001
2002
  }
2002
2003
  )
2003
- ] }, p.key)) })
2004
+ ] }, h.key)) })
2004
2005
  ] }) : null;
2005
2006
  }
2006
2007
  ), Hn = ({
2007
2008
  value: r,
2008
2009
  onChange: n,
2009
- forceKind: a,
2010
- disableRemove: h,
2011
- disableKind: x,
2012
- isDisabled: m,
2013
- lockRanges: u,
2014
- ...p
2010
+ forceKind: i,
2011
+ disableRemove: m,
2012
+ disableKind: g,
2013
+ isDisabled: u,
2014
+ lockRanges: d,
2015
+ ...h
2015
2016
  }) => {
2016
2017
  const s = k(() => [...r].sort((L, M) => {
2017
- const w = ft.indexOf(L.plane), v = ft.indexOf(M.plane);
2018
- return w - v;
2019
- }), [r]), i = G((L) => "segment" in L.id ? Tt(L.id.segment, L.plane, !0) ?? "Unknown" : Nt(L.id.joint, L.plane, !0) ?? "Unknown", []), g = G(
2018
+ const w = ft.indexOf(L.plane), y = ft.indexOf(M.plane);
2019
+ return w - y;
2020
+ }), [r]), l = G((L) => "segment" in L.id ? Tt(L.id.segment, L.plane, !0) ?? "Unknown" : Nt(L.id.joint, L.plane, !0) ?? "Unknown", []), p = G(
2020
2021
  (L, M) => {
2021
2022
  const w = s.findIndex(
2022
- (c) => c.id === M.id && c.plane === M.plane
2023
+ (x) => x.id === M.id && x.plane === M.plane
2023
2024
  );
2024
- let v = [...s];
2025
- a && (M = { ...M, kind: a }), v[w] = M, u && (v = v.map((c) => ({
2026
- ...c,
2025
+ let y = [...s];
2026
+ i && (M = { ...M, kind: i }), y[w] = M, d && (y = y.map((x) => ({
2027
+ ...x,
2027
2028
  min: M.min,
2028
2029
  max: M.max
2029
- }))), n(v);
2030
+ }))), n(y);
2030
2031
  },
2031
- [n, s, a, u]
2032
- ), C = G(
2032
+ [n, s, i, d]
2033
+ ), v = G(
2033
2034
  (L) => {
2034
2035
  const M = s.filter(
2035
2036
  (w) => w.id !== L.id || w.plane !== L.plane
@@ -2038,42 +2039,42 @@ const kn = ({
2038
2039
  },
2039
2040
  [n, s]
2040
2041
  );
2041
- return /* @__PURE__ */ e.jsx(de, { alignItems: "flex-start", overflowY: "auto", ...p, children: s.map((L, M) => /* @__PURE__ */ e.jsx(
2042
+ return /* @__PURE__ */ e.jsx(ue, { alignItems: "flex-start", overflowY: "auto", ...h, children: s.map((L, M) => /* @__PURE__ */ e.jsx(
2042
2043
  Jn,
2043
2044
  {
2044
- label: i(L),
2045
+ label: l(L),
2045
2046
  parameter: L,
2046
- onChange: (w) => g(M, w),
2047
- onRemove: h || m ? void 0 : () => C(L),
2048
- forceKind: a,
2049
- disableKind: x || m,
2050
- isDisabled: m
2047
+ onChange: (w) => p(M, w),
2048
+ onRemove: m || u ? void 0 : () => v(L),
2049
+ forceKind: i,
2050
+ disableKind: g || u,
2051
+ isDisabled: u
2051
2052
  },
2052
2053
  `${JSON.stringify(L.id)}-${L.plane}`
2053
2054
  )) });
2054
2055
  }, Jn = ({
2055
2056
  label: r,
2056
2057
  parameter: n,
2057
- onChange: a,
2058
- onRemove: h,
2059
- forceKind: x,
2060
- disableKind: m,
2061
- isDisabled: u
2058
+ onChange: i,
2059
+ onRemove: m,
2060
+ forceKind: g,
2061
+ disableKind: u,
2062
+ isDisabled: d
2062
2063
  }) => {
2063
- const p = G(
2064
- (g) => "joint" in n.id ? In(
2064
+ const h = G(
2065
+ (p) => "joint" in n.id ? In(
2065
2066
  n.id.joint,
2066
2067
  n.plane,
2067
- g < 0 ? -1 : 1
2068
+ p < 0 ? -1 : 1
2068
2069
  ) : Mn(
2069
2070
  n.id.segment,
2070
2071
  n.plane,
2071
- g < 0 ? -1 : 1
2072
+ p < 0 ? -1 : 1
2072
2073
  ),
2073
2074
  [n]
2074
- ), { min: s, max: i } = "joint" in n.id ? On(n.id.joint, n.plane) : { min: -180, max: 180 };
2075
+ ), { min: s, max: l } = "joint" in n.id ? On(n.id.joint, n.plane) : { min: -180, max: 180 };
2075
2076
  return /* @__PURE__ */ e.jsxs(
2076
- de,
2077
+ ue,
2077
2078
  {
2078
2079
  borderRadius: "md",
2079
2080
  p: 2,
@@ -2095,22 +2096,22 @@ const kn = ({
2095
2096
  }
2096
2097
  ),
2097
2098
  n.sensorOnly && /* @__PURE__ */ e.jsx(St, { size: "sm", colorScheme: "orange", variant: "subtle", children: "Sensor Only" }),
2098
- h && !u && /* @__PURE__ */ e.jsx(
2099
+ m && !d && /* @__PURE__ */ e.jsx(
2099
2100
  en,
2100
2101
  {
2101
2102
  size: "xs",
2102
2103
  variant: "ghost",
2103
2104
  "aria-label": "delete",
2104
2105
  icon: /* @__PURE__ */ e.jsx(yt, { as: vn }),
2105
- onClick: h
2106
+ onClick: m
2106
2107
  }
2107
2108
  ),
2108
- !x && /* @__PURE__ */ e.jsx(
2109
+ !g && /* @__PURE__ */ e.jsx(
2109
2110
  Tn,
2110
2111
  {
2111
2112
  selectedItem: n?.kind ?? Ke.Limit,
2112
- onChange: ({ value: g }) => a({ ...n, kind: g }),
2113
- isDisabled: m || u,
2113
+ onChange: ({ value: p }) => i({ ...n, kind: p }),
2114
+ isDisabled: u || d,
2114
2115
  buttonProps: {
2115
2116
  size: "sm",
2116
2117
  variant: "outline",
@@ -2133,14 +2134,14 @@ const kn = ({
2133
2134
  w: "100%",
2134
2135
  size: "xs",
2135
2136
  min: s,
2136
- max: i,
2137
+ max: l,
2137
2138
  zeroMarker: !0,
2138
2139
  value: [n.min, n.max],
2139
- onChange: (g) => a({ ...n, min: g[0], max: g[1] }),
2140
- formatValue: (g) => `${Math.abs(g)}°`,
2141
- valueLabel: (g) => p(g) ?? "",
2142
- positiveNegativeLabels: p(0) ? [p(-1) ?? "", p(1) ?? ""] : void 0,
2143
- isDisabled: u
2140
+ onChange: (p) => i({ ...n, min: p[0], max: p[1] }),
2141
+ formatValue: (p) => `${Math.abs(p)}°`,
2142
+ valueLabel: (p) => h(p) ?? "",
2143
+ positiveNegativeLabels: h(0) ? [h(-1) ?? "", h(1) ?? ""] : void 0,
2144
+ isDisabled: d
2144
2145
  }
2145
2146
  )
2146
2147
  ]
@@ -2149,101 +2150,101 @@ const kn = ({
2149
2150
  }, Ue = (r, n) => "segment" in r && "segment" in n && r.segment === n.segment || "joint" in r && "joint" in n && r.joint === n.joint, jt = ({
2150
2151
  options: r,
2151
2152
  value: n,
2152
- onChange: a,
2153
- forceKind: h,
2154
- singleValue: x,
2155
- singleValueSideless: m,
2156
- editOnly: u,
2157
- disableKind: p,
2153
+ onChange: i,
2154
+ forceKind: m,
2155
+ singleValue: g,
2156
+ singleValueSideless: u,
2157
+ editOnly: d,
2158
+ disableKind: h,
2158
2159
  maxParameters: s,
2159
- ...i
2160
+ ...l
2160
2161
  }) => {
2161
- const g = m ? 2 : s, C = k(() => {
2162
- const c = /* @__PURE__ */ new Map();
2163
- return r.forEach((d) => {
2164
- const b = "joint" in d.id;
2165
- let j, A;
2166
- if (b ? (j = Nt(d.id.joint, d.plane, !0) ?? "Unknown", A = `joint:${d.id.joint}`) : (j = Tt(d.id.segment, d.plane, !0) ?? "Unknown", A = `segment:${d.id.segment}`), !c.has(A)) {
2167
- const O = b ? gt(d.id.joint) ?? "Unknown Joint" : gt(d.id.segment) ?? "Unknown Segment";
2168
- c.set(A, {
2169
- label: O,
2162
+ const p = u ? 2 : s, v = k(() => {
2163
+ const x = /* @__PURE__ */ new Map();
2164
+ return r.forEach((a) => {
2165
+ const C = "joint" in a.id;
2166
+ let j, O;
2167
+ if (C ? (j = Nt(a.id.joint, a.plane, !0) ?? "Unknown", O = `joint:${a.id.joint}`) : (j = Tt(a.id.segment, a.plane, !0) ?? "Unknown", O = `segment:${a.id.segment}`), !x.has(O)) {
2168
+ const A = C ? gt(a.id.joint) ?? "Unknown Joint" : gt(a.id.segment) ?? "Unknown Segment";
2169
+ x.set(O, {
2170
+ label: A,
2170
2171
  options: []
2171
2172
  });
2172
2173
  }
2173
- const $ = c.get(A), D = [
2174
+ const R = x.get(O), $ = [
2174
2175
  j,
2175
- b ? d.id.joint : d.id.segment,
2176
- d.plane
2177
- ].filter(Boolean).map((O) => String(O).toLowerCase().replace(/\s+|_/g, ""));
2178
- $.options.push({
2176
+ C ? a.id.joint : a.id.segment,
2177
+ a.plane
2178
+ ].filter(Boolean).map((A) => String(A).toLowerCase().replace(/\s+|_/g, ""));
2179
+ R.options.push({
2179
2180
  label: /* @__PURE__ */ e.jsxs(re, { spacing: 2, justify: "space-between", w: "100%", pl: 3, children: [
2180
2181
  /* @__PURE__ */ e.jsx(S, { children: j }),
2181
- d.sensorOnly && /* @__PURE__ */ e.jsx(St, { size: "sm", colorScheme: "orange", variant: "subtle", children: "Sensor Only" })
2182
+ a.sensorOnly && /* @__PURE__ */ e.jsx(St, { size: "sm", colorScheme: "orange", variant: "subtle", children: "Sensor Only" })
2182
2183
  ] }),
2183
- value: d.id,
2184
- plane: d.plane,
2185
- sensorOnly: d.sensorOnly,
2186
- searchTokens: D
2184
+ value: a.id,
2185
+ plane: a.plane,
2186
+ sensorOnly: a.sensorOnly,
2187
+ searchTokens: $
2187
2188
  });
2188
- }), Array.from(c.values());
2189
+ }), Array.from(x.values());
2189
2190
  }, [r]), L = k(() => {
2190
- if (!m || n.length === 0)
2191
- return C;
2192
- const c = n[0];
2193
- return C.map((d) => ({
2194
- ...d,
2195
- options: d.options.filter(
2196
- (b) => Be(b.value) === Be(c.id) && b.plane === c.plane
2191
+ if (!u || n.length === 0)
2192
+ return v;
2193
+ const x = n[0];
2194
+ return v.map((a) => ({
2195
+ ...a,
2196
+ options: a.options.filter(
2197
+ (C) => Be(C.value) === Be(x.id) && C.plane === x.plane
2197
2198
  )
2198
- })).filter((d) => d.options.length > 0);
2199
- }, [C, n, m]), M = k(() => C.flatMap((d) => d.options).filter(
2200
- (d) => n.some((b) => Ue(b.id, d.value) && b.plane === d.plane)
2201
- ), [C, n]), w = G((c, d) => {
2202
- if (!d) return !0;
2203
- const b = d.toLowerCase().replace(/\s+|_/g, ""), j = c.data;
2199
+ })).filter((a) => a.options.length > 0);
2200
+ }, [v, n, u]), M = k(() => v.flatMap((a) => a.options).filter(
2201
+ (a) => n.some((C) => Ue(C.id, a.value) && C.plane === a.plane)
2202
+ ), [v, n]), w = G((x, a) => {
2203
+ if (!a) return !0;
2204
+ const C = a.toLowerCase().replace(/\s+|_/g, ""), j = x.data;
2204
2205
  return !j || !j.searchTokens ? !1 : j.searchTokens.some(
2205
- (A) => A.includes(b)
2206
+ (O) => O.includes(C)
2206
2207
  );
2207
- }, []), v = G(
2208
- (c) => {
2209
- const d = c.map((b) => {
2208
+ }, []), y = G(
2209
+ (x) => {
2210
+ const a = x.map((C) => {
2210
2211
  const j = n.find(
2211
- (R) => Ue(R.id, b.value) && R.plane === b.plane
2212
- ), A = r.find(
2213
- (R) => Ue(R.id, b.value) && R.plane === b.plane
2214
- ), $ = m ? n.find(
2215
- (R) => Be(R.id) === Be(b.value) && R.plane === b.plane
2216
- ) : void 0, D = $ && !j ? $.min : A && A.min ? A.min : 0, O = $ && !j ? $.max : A && A.max ? A.max : 0;
2212
+ (T) => Ue(T.id, C.value) && T.plane === C.plane
2213
+ ), O = r.find(
2214
+ (T) => Ue(T.id, C.value) && T.plane === C.plane
2215
+ ), R = u ? n.find(
2216
+ (T) => Be(T.id) === Be(C.value) && T.plane === C.plane
2217
+ ) : void 0, $ = R && !j ? R.min : O && O.min ? O.min : 0, A = R && !j ? R.max : O && O.max ? O.max : 0;
2217
2218
  return j ?? {
2218
- id: b.value,
2219
- plane: b.plane,
2220
- min: D,
2221
- max: O,
2222
- sensorOnly: b.sensorOnly,
2223
- kind: h ?? Ke.Limit
2219
+ id: C.value,
2220
+ plane: C.plane,
2221
+ min: $,
2222
+ max: A,
2223
+ sensorOnly: C.sensorOnly,
2224
+ kind: m ?? Ke.Limit
2224
2225
  };
2225
2226
  });
2226
- a(d);
2227
+ i(a);
2227
2228
  },
2228
- [a, n, r, h, m]
2229
+ [i, n, r, m, u]
2229
2230
  );
2230
2231
  return le(() => {
2231
- const c = n.filter(
2232
- (d) => r.some((b) => Ue(b.id, d.id) && b.plane === d.plane)
2232
+ const x = n.filter(
2233
+ (a) => r.some((C) => Ue(C.id, a.id) && C.plane === a.plane)
2233
2234
  );
2234
- c.length !== n.length && a(c);
2235
- }, [r, a, n]), /* @__PURE__ */ e.jsxs(te, { ...i, children: [
2235
+ x.length !== n.length && i(x);
2236
+ }, [r, i, n]), /* @__PURE__ */ e.jsxs(te, { ...l, children: [
2236
2237
  /* @__PURE__ */ e.jsx(
2237
- me,
2238
+ he,
2238
2239
  {
2239
- isMulti: !x,
2240
+ isMulti: !g,
2240
2241
  placeholder: n.length ? `${n.length} selected` : "Search...",
2241
2242
  value: M,
2242
- isDisabled: u || M.length >= (g ?? 1 / 0),
2243
- onChange: (c) => Array.isArray(c) ? v([...c]) : v(c !== null ? [c] : []),
2243
+ isDisabled: d || M.length >= (p ?? 1 / 0),
2244
+ onChange: (x) => Array.isArray(x) ? y([...x]) : y(x !== null ? [x] : []),
2244
2245
  options: L,
2245
2246
  controlShouldRenderValue: !1,
2246
- formatOptionLabel: (c) => c.label,
2247
+ formatOptionLabel: (x) => x.label,
2247
2248
  filterOption: w,
2248
2249
  isSearchable: !0
2249
2250
  }
@@ -2254,61 +2255,61 @@ const kn = ({
2254
2255
  marginTop: 2,
2255
2256
  maxH: "28rem",
2256
2257
  value: n,
2257
- onChange: a,
2258
- forceKind: h,
2259
- disableKind: p,
2260
- isDisabled: u,
2261
- lockRanges: m
2258
+ onChange: i,
2259
+ forceKind: m,
2260
+ disableKind: h,
2261
+ isDisabled: d,
2262
+ lockRanges: u
2262
2263
  }
2263
2264
  )
2264
2265
  ] });
2265
2266
  }, bt = (r) => {
2266
2267
  switch (r) {
2267
- case ue.Thorax:
2268
+ case me.Thorax:
2268
2269
  return "Thorax";
2269
- case ue.CenterBack:
2270
+ case me.CenterBack:
2270
2271
  return "Center Back";
2271
- case ue.Pelvis:
2272
+ case me.Pelvis:
2272
2273
  return "Pelvis";
2273
- case ue.LeftThigh:
2274
+ case me.LeftThigh:
2274
2275
  return "Left Thigh";
2275
- case ue.RightThigh:
2276
+ case me.RightThigh:
2276
2277
  return "Right Thigh";
2277
- case ue.LeftShank:
2278
+ case me.LeftShank:
2278
2279
  return "Left Shank";
2279
- case ue.RightShank:
2280
+ case me.RightShank:
2280
2281
  return "Right Shank";
2281
- case ue.LeftFoot:
2282
+ case me.LeftFoot:
2282
2283
  return "Left Foot";
2283
- case ue.RightFoot:
2284
+ case me.RightFoot:
2284
2285
  return "Right Foot";
2285
- case ue.LeftUpperArm:
2286
+ case me.LeftUpperArm:
2286
2287
  return "Left Upper Arm";
2287
- case ue.RightUpperArm:
2288
+ case me.RightUpperArm:
2288
2289
  return "Right Upper Arm";
2289
- case ue.LeftForearm:
2290
+ case me.LeftForearm:
2290
2291
  return "Left Forearm";
2291
- case ue.RightForearm:
2292
+ case me.RightForearm:
2292
2293
  return "Right Forearm";
2293
- case ue.Head:
2294
+ case me.Head:
2294
2295
  return "Head";
2295
2296
  }
2296
2297
  }, js = ({
2297
2298
  id: r,
2298
2299
  onError: n,
2299
- onCancel: a,
2300
- onSave: h,
2301
- hideButtons: x,
2302
- setButtonOnClick: m,
2303
- setButtonDisabled: u,
2304
- quantumOwned: p,
2300
+ onCancel: i,
2301
+ onSave: m,
2302
+ hideButtons: g,
2303
+ setButtonOnClick: u,
2304
+ setButtonDisabled: d,
2305
+ quantumOwned: h,
2305
2306
  isView: s
2306
2307
  }) => {
2307
- const i = at(), [{ fetching: g }, C] = fe(ot), [{ fetching: L }, M] = fe(dn), [{ data: w }] = we({
2308
+ const l = at(), [{ fetching: p }, v] = fe(ot), [{ fetching: L }, M] = fe(dn), [{ data: w }] = we({
2308
2309
  query: un,
2309
2310
  variables: { id: r ?? "" },
2310
2311
  pause: !r
2311
- }), v = k(() => {
2312
+ }), y = k(() => {
2312
2313
  const f = I(
2313
2314
  Ce,
2314
2315
  w?.getActionById
@@ -2323,9 +2324,9 @@ const kn = ({
2323
2324
  thresholds: I(Oe, f.thresholds),
2324
2325
  reports: F
2325
2326
  };
2326
- }, [w]), c = g || L, d = !!v && !!r, { getLabel: b } = xe(), j = k(() => ({
2327
- action: b("action")
2328
- }), [b]), A = k(() => [
2327
+ }, [w]), x = p || L, a = !!y && !!r, { getLabel: C } = xe(), j = k(() => ({
2328
+ action: C("action")
2329
+ }), [C]), O = k(() => [
2329
2330
  { key: "module_category", label: "Link Category", multi: !0 },
2330
2331
  { key: "activity_type", label: `${j.action} Type`, multi: !1 },
2331
2332
  { key: "session_type", label: "Session Type", multi: !0 },
@@ -2336,7 +2337,7 @@ const kn = ({
2336
2337
  label: "Activity Motion Direction",
2337
2338
  multi: !0
2338
2339
  }
2339
- ], [j.action]), [$, D] = _(""), [O, R] = _(""), [J, oe] = _(""), [N, V] = _(""), [ee, T] = _([]), [z, X] = _({}), [W, H] = _(null), [l, t] = _(""), [o, y] = _([]), [U, q] = _([]), [Q, E] = _(""), [K, ce] = _([]), ye = xn(), Ve = k(() => ye.filter((f) => f.sensorOnly), [ye]), ke = [
2340
+ ], [j.action]), [R, $] = _(""), [A, T] = _(""), [J, oe] = _(""), [D, Z] = _(""), [V, N] = _([]), [z, X] = _({}), [W, H] = _(null), [c, t] = _(""), [o, b] = _([]), [U, q] = _([]), [Q, E] = _(""), [K, ce] = _([]), ye = xn(), Ve = k(() => ye.filter((f) => f.sensorOnly), [ye]), ke = [
2340
2341
  {
2341
2342
  label: Le(ae.GeneralActivity),
2342
2343
  value: ae.GeneralActivity
@@ -2354,95 +2355,95 @@ const kn = ({
2354
2355
  label: Le(ae.PointOfInterest),
2355
2356
  value: ae.PointOfInterest
2356
2357
  }
2357
- ], Pe = $.length > 0, [Ge, et] = _({});
2358
+ ], Pe = k(() => R.trim().length > 0, [R]), [Ge, et] = _({});
2358
2359
  le(() => {
2359
- const f = A.map(
2360
- (B) => i.query(rt, { key: B.key })
2360
+ const f = O.map(
2361
+ (B) => l.query(rt, { key: B.key })
2361
2362
  );
2362
2363
  Promise.all(f).then((B) => {
2363
2364
  const F = {};
2364
2365
  B.forEach((P) => {
2365
2366
  if (P.error || !P.data) return;
2366
- const Z = I(
2367
+ const ne = I(
2367
2368
  je,
2368
2369
  P.data.getMetadataByKey
2369
- ), ne = I(
2370
+ ), ee = I(
2370
2371
  be,
2371
- Z.data
2372
+ ne.data
2372
2373
  );
2373
- F[Z.key] = ne.map((pe) => ({
2374
- label: pe.label || pe.value,
2375
- value: pe.value,
2376
- id: pe.id
2374
+ F[ne.key] = ee.map((de) => ({
2375
+ label: de.label || de.value,
2376
+ value: de.value,
2377
+ id: de.id
2377
2378
  }));
2378
2379
  }), X(F);
2379
2380
  });
2380
- }, [i, A]), le(() => {
2381
- if (v) {
2381
+ }, [l, O]), le(() => {
2382
+ if (y) {
2382
2383
  const B = I(
2383
2384
  je,
2384
- v.metadataGroups
2385
+ y.metadataGroups
2385
2386
  ).map(
2386
- (Z) => Z.data.map((ne) => I(be, ne).id)
2387
- ), F = v.reports.map((Z) => ({
2388
- id: Z.id,
2389
- name: Z.name ?? "",
2390
- instructions: Z.instructions ?? "",
2391
- kind: Z.reportKind,
2392
- parameters: Z.thresholds.map((ne) => ({
2387
+ (ne) => ne.data.map((ee) => I(be, ee).id)
2388
+ ), F = y.reports.map((ne) => ({
2389
+ id: ne.id,
2390
+ name: ne.name ?? "",
2391
+ instructions: ne.instructions ?? "",
2392
+ kind: ne.reportKind,
2393
+ parameters: ne.thresholds.map((ee) => ({
2393
2394
  id: {
2394
- [ne.partKind]: ne.partId
2395
+ [ee.partKind]: ee.partId
2395
2396
  },
2396
- kind: ne.kind,
2397
- min: ne.min,
2398
- max: ne.max,
2399
- plane: ne.partDimension,
2400
- oldId: ne.id,
2401
- sensorOnly: Ve.some((pe) => {
2402
- const tt = pe.id[ne.partKind];
2403
- return tt ? tt === ne.partId && pe.plane === ne.partDimension : !1;
2397
+ kind: ee.kind,
2398
+ min: ee.min,
2399
+ max: ee.max,
2400
+ plane: ee.partDimension,
2401
+ oldId: ee.id,
2402
+ sensorOnly: Ve.some((de) => {
2403
+ const tt = de.id[ee.partKind];
2404
+ return tt ? tt === ee.partId && de.plane === ee.partDimension : !1;
2404
2405
  })
2405
2406
  })),
2406
- sensorLocations: Z.sensorLocations
2407
+ sensorLocations: ne.sensorLocations
2407
2408
  })), P = {
2408
- name: v.name,
2409
- description: v.description || "",
2410
- cameraPlacement: v.cameraPlacement || "",
2411
- videoLink: v.videoLink || "",
2409
+ name: y.name,
2410
+ description: y.description || "",
2411
+ cameraPlacement: y.cameraPlacement || "",
2412
+ videoLink: y.videoLink || "",
2412
2413
  metadataIds: B.flat(),
2413
2414
  reports: F
2414
2415
  };
2415
- D(P.name), R(P.description), oe(P.cameraPlacement), V(P.videoLink), T(P.metadataIds), ce(F), et(P);
2416
+ $(P.name), T(P.description), oe(P.cameraPlacement), Z(P.videoLink), N(P.metadataIds), ce(F), et(P);
2416
2417
  }
2417
- }, [v, Ve]);
2418
+ }, [y, Ve]);
2418
2419
  const Te = k(
2419
2420
  () => JSON.stringify(Ge) !== JSON.stringify({
2420
- name: $,
2421
- description: O,
2421
+ name: R,
2422
+ description: A,
2422
2423
  cameraPlacement: J,
2423
- videoLink: N,
2424
- metadataIds: ee,
2424
+ videoLink: D,
2425
+ metadataIds: V,
2425
2426
  reports: K
2426
2427
  }),
2427
2428
  [
2428
2429
  Ge,
2429
- $,
2430
- O,
2430
+ R,
2431
+ A,
2431
2432
  J,
2432
- N,
2433
- ee,
2433
+ D,
2434
+ V,
2434
2435
  K
2435
2436
  ]
2436
2437
  ), Se = G(() => {
2437
2438
  const f = {
2438
- name: $,
2439
- description: O,
2439
+ name: R,
2440
+ description: A,
2440
2441
  cameraPlacement: J,
2441
- videoLink: N,
2442
- metadataItemIds: ee,
2442
+ videoLink: D,
2443
+ metadataItemIds: V,
2443
2444
  // Backend requires laterality; keep existing default since UI no longer edits it
2444
2445
  laterality: An.Either,
2445
- quantumOwned: p,
2446
+ quantumOwned: h,
2446
2447
  //Backend requires session type; keep existing default since UI no longer edits it
2447
2448
  sessionType: [],
2448
2449
  // Backend requires thresholds; use empty array since reports handle parameters now
@@ -2466,42 +2467,42 @@ const kn = ({
2466
2467
  }))
2467
2468
  };
2468
2469
  let B;
2469
- d && r ? B = M({
2470
+ a && r ? B = M({
2470
2471
  id: r,
2471
2472
  fields: f
2472
- }) : B = C({
2473
+ }) : B = v({
2473
2474
  fields: f
2474
2475
  }), B.then(({ error: F }) => {
2475
- F ? n(F) : h();
2476
+ F ? n(F) : m();
2476
2477
  });
2477
2478
  }, [
2478
- p,
2479
- C,
2479
+ h,
2480
+ v,
2480
2481
  M,
2481
2482
  r,
2482
- $,
2483
- O,
2483
+ R,
2484
+ A,
2484
2485
  J,
2485
- N,
2486
- ee,
2486
+ D,
2487
+ V,
2487
2488
  K,
2488
- d,
2489
- h,
2489
+ a,
2490
+ m,
2490
2491
  n
2491
2492
  ]);
2492
2493
  le(() => {
2493
- u && u({
2494
- cancelButton: c,
2495
- saveButton: s ? !0 : c || !Pe || !Te
2494
+ d && d({
2495
+ cancelButton: x,
2496
+ saveButton: s ? !0 : x || !Pe || !Te
2496
2497
  });
2497
- }, [c, u, Pe, Te, s]), le(() => {
2498
- m && m({
2499
- cancelButton: a,
2498
+ }, [x, d, Pe, Te, s]), le(() => {
2499
+ u && u({
2500
+ cancelButton: i,
2500
2501
  saveButton: s ? () => {
2501
2502
  } : Se
2502
2503
  });
2503
- }, [m, a, Se, s]);
2504
- const he = G(
2504
+ }, [u, i, Se, s]);
2505
+ const pe = G(
2505
2506
  (f) => {
2506
2507
  const B = xt(
2507
2508
  f.map(
@@ -2513,43 +2514,43 @@ const kn = ({
2513
2514
  []
2514
2515
  );
2515
2516
  le(() => {
2516
- he(o);
2517
- }, [o, he]);
2517
+ pe(o);
2518
+ }, [o, pe]);
2518
2519
  const Ne = G(() => {
2519
- if (!W || !l.trim())
2520
+ if (!W || !c.trim())
2520
2521
  return;
2521
2522
  const f = W === ae.PointOfInterest, B = {
2522
2523
  id: Date.now().toString(),
2523
2524
  // Temporary ID
2524
- name: l.trim(),
2525
+ name: c.trim(),
2525
2526
  kind: W,
2526
2527
  parameters: f ? [] : o,
2527
2528
  sensorLocations: f ? [] : U,
2528
2529
  instructions: f ? Q : "",
2529
2530
  isNew: !0
2530
2531
  };
2531
- ce((F) => [...F, B]), H(null), t(""), y([]), q([]), E("");
2532
+ ce((F) => [...F, B]), H(null), t(""), b([]), q([]), E("");
2532
2533
  }, [
2533
2534
  W,
2534
- l,
2535
+ c,
2535
2536
  o,
2536
2537
  U,
2537
2538
  Q
2538
2539
  ]), $t = G((f) => {
2539
2540
  ce((B) => B.filter((F) => F.id !== f));
2540
2541
  }, []), Dt = (f, B) => {
2541
- const F = A.find((Z) => Z.key === f);
2542
+ const F = O.find((ne) => ne.key === f);
2542
2543
  if (!F) return;
2543
2544
  const P = F.multi ? (B ?? []).map(
2544
- (Z) => Z.id
2545
+ (ne) => ne.id
2545
2546
  ) : B ? [B.id] : [];
2546
- T((Z) => [...Z.filter((pe) => Object.values(z).flat().find((Ee) => Ee.id === pe) && !Object.keys(z).find(
2547
+ N((ne) => [...ne.filter((de) => Object.values(z).flat().find((Ee) => Ee.id === de) && !Object.keys(z).find(
2547
2548
  (Ee) => z[Ee]?.some(
2548
- (Ft) => Ft.id === pe && Ee === f
2549
+ (Ft) => Ft.id === de && Ee === f
2549
2550
  )
2550
2551
  )), ...P]);
2551
2552
  };
2552
- return /* @__PURE__ */ e.jsxs(de, { spacing: 4, w: "full", align: "stretch", children: [
2553
+ return /* @__PURE__ */ e.jsxs(ue, { spacing: 4, w: "full", align: "stretch", children: [
2553
2554
  /* @__PURE__ */ e.jsxs(tn, { children: [
2554
2555
  /* @__PURE__ */ e.jsxs(nn, { children: [
2555
2556
  /* @__PURE__ */ e.jsx(ht, { children: "Activity Configuration" }),
@@ -2563,8 +2564,8 @@ const kn = ({
2563
2564
  /* @__PURE__ */ e.jsx(
2564
2565
  ve,
2565
2566
  {
2566
- value: $,
2567
- onChange: (f) => D(f.target.value),
2567
+ value: R,
2568
+ onChange: (f) => $(f.target.value),
2568
2569
  type: "text",
2569
2570
  placeholder: "i.e. Lunge & Return",
2570
2571
  isDisabled: s
@@ -2589,8 +2590,8 @@ const kn = ({
2589
2590
  /* @__PURE__ */ e.jsx(
2590
2591
  ve,
2591
2592
  {
2592
- value: N,
2593
- onChange: (f) => V(f.target.value),
2593
+ value: D,
2594
+ onChange: (f) => Z(f.target.value),
2594
2595
  type: "url",
2595
2596
  placeholder: "(optional) https://...",
2596
2597
  isDisabled: s
@@ -2602,8 +2603,8 @@ const kn = ({
2602
2603
  /* @__PURE__ */ e.jsx(
2603
2604
  ze,
2604
2605
  {
2605
- value: O,
2606
- onChange: (f) => R(f.target.value),
2606
+ value: A,
2607
+ onChange: (f) => T(f.target.value),
2607
2608
  rows: 2,
2608
2609
  placeholder: "(optional) Describe how to perform the test or exercise",
2609
2610
  isDisabled: s
@@ -2613,14 +2614,14 @@ const kn = ({
2613
2614
  ] }),
2614
2615
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
2615
2616
  /* @__PURE__ */ e.jsx(ie, { children: "Metadata Tags" }),
2616
- A.map((f) => /* @__PURE__ */ e.jsxs(Y, { children: [
2617
+ O.map((f) => /* @__PURE__ */ e.jsxs(Y, { children: [
2617
2618
  /* @__PURE__ */ e.jsx(ie, { children: f.label }),
2618
2619
  /* @__PURE__ */ e.jsx(
2619
- me,
2620
+ he,
2620
2621
  {
2621
2622
  isMulti: f.multi,
2622
2623
  value: z[f.key]?.filter(
2623
- (B) => ee.includes(B.id)
2624
+ (B) => V.includes(B.id)
2624
2625
  ),
2625
2626
  onChange: (B) => {
2626
2627
  Dt(f.key, B);
@@ -2649,8 +2650,9 @@ const kn = ({
2649
2650
  /* @__PURE__ */ e.jsx(
2650
2651
  ve,
2651
2652
  {
2652
- value: l,
2653
+ value: c,
2653
2654
  onChange: (f) => t(f.target.value),
2655
+ maxLength: 120,
2654
2656
  type: "text",
2655
2657
  placeholder: "Enter report name...",
2656
2658
  isDisabled: s
@@ -2660,7 +2662,7 @@ const kn = ({
2660
2662
  /* @__PURE__ */ e.jsxs(Y, { children: [
2661
2663
  /* @__PURE__ */ e.jsx(ie, { children: "Report Type" }),
2662
2664
  /* @__PURE__ */ e.jsx(
2663
- me,
2665
+ he,
2664
2666
  {
2665
2667
  value: W ? ke.find(
2666
2668
  (f) => f.value === W
@@ -2681,7 +2683,7 @@ const kn = ({
2681
2683
  {
2682
2684
  options: ye,
2683
2685
  value: o,
2684
- onChange: y,
2686
+ onChange: b,
2685
2687
  editOnly: s
2686
2688
  }
2687
2689
  )
@@ -2718,7 +2720,7 @@ const kn = ({
2718
2720
  {
2719
2721
  colorScheme: "blue",
2720
2722
  onClick: Ne,
2721
- isDisabled: !W || !l.trim() || s || ke.length === 0 || W !== ae.PointOfInterest && o.length === 0,
2723
+ isDisabled: !W || !c.trim() || s || ke.length === 0 || W !== ae.PointOfInterest && o.length === 0,
2722
2724
  children: "Add Report"
2723
2725
  }
2724
2726
  ) })
@@ -2784,12 +2786,10 @@ const kn = ({
2784
2786
  options: ye,
2785
2787
  value: f.parameters,
2786
2788
  onChange: (B) => {
2787
- const F = B.map(
2788
- (Z) => Z.id.joint ?? Z.id.segment
2789
- ), P = xt(F);
2789
+ const F = (ee) => "joint" in ee.id ? ee.id.joint : ee.id.segment, P = B.map(F), ne = xt(P);
2790
2790
  ce(
2791
- (Z) => Z.map(
2792
- (ne) => ne.id === f.id ? { ...ne, parameters: B, sensorLocations: P } : ne
2791
+ (ee) => ee.map(
2792
+ (de) => de.id === f.id ? { ...de, parameters: B, sensorLocations: ne } : de
2793
2793
  )
2794
2794
  );
2795
2795
  },
@@ -2818,15 +2818,15 @@ const kn = ({
2818
2818
  re,
2819
2819
  {
2820
2820
  justify: "end",
2821
- className: qe((x || s) && "!hidden"),
2821
+ className: qe((g || s) && "!hidden"),
2822
2822
  children: /* @__PURE__ */ e.jsxs(Ae, { gap: 4, children: [
2823
- /* @__PURE__ */ e.jsx(se, { colorScheme: "gray", isDisabled: c, onClick: a, children: "Cancel" }),
2823
+ /* @__PURE__ */ e.jsx(se, { colorScheme: "gray", isDisabled: x, onClick: i, children: "Cancel" }),
2824
2824
  /* @__PURE__ */ e.jsx(
2825
2825
  se,
2826
2826
  {
2827
2827
  colorScheme: "blue",
2828
- isDisabled: c || !Pe || !Te,
2829
- isLoading: c,
2828
+ isDisabled: x || !Pe || !Te,
2829
+ isLoading: x,
2830
2830
  onClick: Se,
2831
2831
  children: "Save changes"
2832
2832
  }
@@ -2838,48 +2838,48 @@ const kn = ({
2838
2838
  }, ie = ({ children: r }) => /* @__PURE__ */ e.jsx(Xe, { fontWeight: "bold", fontFamily: "sans-serif", fontSize: "large", children: r }), Xn = ({
2839
2839
  children: r,
2840
2840
  isView: n,
2841
- metadataKeys: a
2841
+ metadataKeys: i
2842
2842
  }) => {
2843
- const [h, x] = _({}), m = at();
2843
+ const [m, g] = _({}), u = at();
2844
2844
  return le(() => {
2845
- let u = !1;
2845
+ let d = !1;
2846
2846
  return (async () => {
2847
- const s = (a ?? []).map(
2848
- (C) => m.query(rt, { key: C }).toPromise()
2849
- ), i = await Promise.all(s), g = {};
2850
- for (const C of i) {
2851
- if (C.error || !C.data?.getMetadataByKey) continue;
2847
+ const s = (i ?? []).map(
2848
+ (v) => u.query(rt, { key: v }).toPromise()
2849
+ ), l = await Promise.all(s), p = {};
2850
+ for (const v of l) {
2851
+ if (v.error || !v.data?.getMetadataByKey) continue;
2852
2852
  const L = I(
2853
2853
  je,
2854
- C.data.getMetadataByKey
2854
+ v.data.getMetadataByKey
2855
2855
  );
2856
2856
  if (!L) continue;
2857
2857
  const M = I(be, L.data) ?? [];
2858
- g[L.key] = M.map((w) => ({
2858
+ p[L.key] = M.map((w) => ({
2859
2859
  label: w.label || w.value,
2860
2860
  value: w.value,
2861
2861
  id: w.id
2862
2862
  }));
2863
2863
  }
2864
- u || x(g);
2864
+ d || g(p);
2865
2865
  })(), () => {
2866
- u = !0;
2866
+ d = !0;
2867
2867
  };
2868
- }, [m, a]), /* @__PURE__ */ e.jsx(Rt.Provider, { value: { isView: n, metadataOptions: h }, children: r });
2868
+ }, [u, i]), /* @__PURE__ */ e.jsx(Rt.Provider, { value: { isView: n, metadataOptions: m }, children: r });
2869
2869
  }, bs = ({
2870
2870
  id: r,
2871
2871
  onCancel: n,
2872
- onSave: a,
2873
- onError: h,
2874
- hideButtons: x,
2875
- quantumOwned: m,
2876
- setButtonOnClick: u,
2877
- setButtonDisabled: p,
2872
+ onSave: i,
2873
+ onError: m,
2874
+ hideButtons: g,
2875
+ quantumOwned: u,
2876
+ setButtonOnClick: d,
2877
+ setButtonDisabled: h,
2878
2878
  isView: s
2879
2879
  }) => {
2880
- const [{ data: i, fetching: g }] = we({
2881
- query: m ? mn : hn
2882
- }), [{ data: C }] = we({
2880
+ const [{ data: l, fetching: p }] = we({
2881
+ query: u ? mn : hn
2882
+ }), [{ data: v }] = we({
2883
2883
  query: pn,
2884
2884
  variables: { id: r },
2885
2885
  pause: !r
@@ -2888,79 +2888,79 @@ const kn = ({
2888
2888
  }), M = I(
2889
2889
  De,
2890
2890
  L?.moduleCategories
2891
- ), [{ fetching: w }, v] = fe(At), [{ fetching: c }, d] = fe(Ot), b = k(() => !i || g ? [] : I(
2891
+ ), [{ fetching: w }, y] = fe(At), [{ fetching: x }, a] = fe(Ot), C = k(() => !l || p ? [] : I(
2892
2892
  Ce,
2893
- m ? i?.quantumOwnedActions ?? [] : i?.actions ?? []
2894
- ).filter((l) => !!l?.id), [i, m, g]), j = I(Qe, C?.module), A = k(() => I(kt, j?.moduleActions) ?? [], [j?.moduleActions]), [$, D] = _([
2895
- ...A.map((H) => H.actionId) ?? []
2896
- ]), [O, R] = _(j?.name ?? ""), [J, oe] = _([]), [N, V] = _(j?.description ?? ""), [ee, T] = _([]), [z, X] = _({});
2893
+ u ? l?.quantumOwnedActions ?? [] : l?.actions ?? []
2894
+ ).filter((c) => !!c?.id), [l, u, p]), j = I(Qe, v?.module), O = k(() => I(kt, j?.moduleActions) ?? [], [j?.moduleActions]), [R, $] = _([
2895
+ ...O.map((H) => H.actionId) ?? []
2896
+ ]), [A, T] = _(j?.name ?? ""), [J, oe] = _([]), [D, Z] = _(j?.description ?? ""), [V, N] = _([]), [z, X] = _({});
2897
2897
  le(() => {
2898
2898
  if (j) {
2899
- D(A.map((o) => o.actionId)), R(j.name), V(j.description ?? ""), oe(
2899
+ $(O.map((o) => o.actionId)), T(j.name), Z(j.description ?? ""), oe(
2900
2900
  j.categories.map(
2901
2901
  (o) => I(De, o).id
2902
2902
  ) ?? []
2903
2903
  );
2904
- const l = I(
2904
+ const c = I(
2905
2905
  je,
2906
2906
  j.metadataGroups
2907
2907
  ).map(
2908
- (o) => o.data.map((y) => I(be, y).id)
2908
+ (o) => o.data.map((b) => I(be, b).id)
2909
2909
  );
2910
- T(l.flat());
2910
+ N(c.flat());
2911
2911
  const t = {};
2912
- A.forEach((o) => {
2912
+ O.forEach((o) => {
2913
2913
  t[o.actionId] = o.reportId || null;
2914
2914
  }), X(t);
2915
2915
  }
2916
- }, [j, A]);
2916
+ }, [j, O]);
2917
2917
  const W = G(() => {
2918
2918
  let H;
2919
- const l = Object.entries(z).filter(([, o]) => o !== null).map(([o, y]) => ({
2919
+ const c = Object.entries(z).filter(([, o]) => o !== null).map(([o, b]) => ({
2920
2920
  actionId: o,
2921
- reportId: y
2921
+ reportId: b
2922
2922
  })), t = {
2923
- actions: $,
2924
- name: O,
2923
+ actions: R,
2924
+ name: A,
2925
2925
  categories: J.filter((o) => o !== "other"),
2926
- description: N,
2927
- quantumOwned: m,
2928
- metadataItemIds: ee,
2929
- actionReports: l
2926
+ description: D,
2927
+ quantumOwned: u,
2928
+ metadataItemIds: V,
2929
+ actionReports: c
2930
2930
  };
2931
- j ? H = v({
2931
+ j ? H = y({
2932
2932
  id: j.id,
2933
2933
  input: t
2934
- }) : H = d({
2934
+ }) : H = a({
2935
2935
  input: t
2936
2936
  }), H.then(({ error: o }) => {
2937
- o ? h(o instanceof Error ? o : new Error(String(o))) : a();
2937
+ o ? m(o instanceof Error ? o : new Error(String(o))) : i();
2938
2938
  });
2939
2939
  }, [
2940
- d,
2941
- v,
2942
- $,
2943
- O,
2944
- N,
2940
+ a,
2941
+ y,
2942
+ R,
2943
+ A,
2944
+ D,
2945
2945
  J,
2946
- ee,
2946
+ V,
2947
2947
  z,
2948
2948
  j,
2949
- a,
2950
- h,
2951
- m
2949
+ i,
2950
+ m,
2951
+ u
2952
2952
  ]);
2953
2953
  return le(() => {
2954
- p && p({
2955
- cancelButton: w || c,
2956
- saveButton: w || c || !O || N.trim().split(/\s+/).filter(Boolean).length > 40
2954
+ h && h({
2955
+ cancelButton: w || x,
2956
+ saveButton: w || x || !A || D.trim().split(/\s+/).filter(Boolean).length > 40
2957
2957
  });
2958
- }, [p, w, c, $, O, N]), le(() => {
2959
- u && u({
2958
+ }, [h, w, x, R, A, D]), le(() => {
2959
+ d && d({
2960
2960
  cancelButton: n,
2961
2961
  saveButton: W
2962
2962
  });
2963
- }, [u, n, W]), /* @__PURE__ */ e.jsx(te, { width: "100%", children: /* @__PURE__ */ e.jsxs(
2963
+ }, [d, n, W]), /* @__PURE__ */ e.jsx(te, { width: "100%", children: /* @__PURE__ */ e.jsxs(
2964
2964
  Xn,
2965
2965
  {
2966
2966
  isView: s,
@@ -2969,28 +2969,28 @@ const kn = ({
2969
2969
  /* @__PURE__ */ e.jsx(
2970
2970
  zn,
2971
2971
  {
2972
- name: O,
2973
- setName: R,
2974
- actions: b,
2975
- selectedActionIds: $,
2976
- setSelectedActionIds: D,
2972
+ name: A,
2973
+ setName: T,
2974
+ actions: C,
2975
+ selectedActionIds: R,
2976
+ setSelectedActionIds: $,
2977
2977
  availableCategories: M ?? [],
2978
2978
  selectedCategoryIds: J,
2979
2979
  setSelectedCategoryIds: oe,
2980
- description: N,
2981
- setDescription: V,
2982
- selectedMetadataIds: ee,
2983
- setSelectedMetadataIds: T,
2980
+ description: D,
2981
+ setDescription: Z,
2982
+ selectedMetadataIds: V,
2983
+ setSelectedMetadataIds: N,
2984
2984
  actionReportIds: z,
2985
2985
  setActionReportIds: X
2986
2986
  }
2987
2987
  ),
2988
- !x && !s && /* @__PURE__ */ e.jsx(re, { justifyContent: "flex-start", children: /* @__PURE__ */ e.jsxs(Ae, { mt: 16, gap: 4, children: [
2988
+ !g && !s && /* @__PURE__ */ e.jsx(re, { justifyContent: "flex-start", children: /* @__PURE__ */ e.jsxs(Ae, { mt: 16, gap: 4, children: [
2989
2989
  /* @__PURE__ */ e.jsx(
2990
2990
  se,
2991
2991
  {
2992
2992
  colorScheme: "gray",
2993
- isDisabled: w || c,
2993
+ isDisabled: w || x,
2994
2994
  onClick: n,
2995
2995
  children: "Cancel"
2996
2996
  }
@@ -2999,8 +2999,8 @@ const kn = ({
2999
2999
  se,
3000
3000
  {
3001
3001
  colorScheme: "blue",
3002
- isDisabled: w || c || !O || N.trim().split(/\s+/).filter(Boolean).length > 40,
3003
- isLoading: w || c,
3002
+ isDisabled: w || x || !A || D.trim().split(/\s+/).filter(Boolean).length > 40,
3003
+ isLoading: w || x,
3004
3004
  onClick: W,
3005
3005
  children: "Save"
3006
3006
  }