quantum-component-library 1.4.48 → 1.4.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,28 +1,28 @@
1
1
  import { j as e } from "./react-jsx-runtime-vendor-OVHDjVDe.js";
2
- import { Flex as fe, InputGroup as Ge, InputLeftElement as gt, Icon as Je, Input as ye, FormLabel as Xe, Box as V, TableContainer as Ze, Table as Ke, Thead as Ve, Tr as Oe, Th as xe, Tbody as et, Td as je, ButtonGroup as be, Tooltip as _e, Button as ee, RangeSlider as xt, RangeSliderMark as De, Text as v, RangeSliderTrack as ft, RangeSliderFilledTrack as jt, RangeSliderThumb as We, Select as Ue, NumberInput as Be, NumberInputField as Qe, HStack as re, Tag as ve, Image as bt, useToast as tt, VStack as oe, FormControl as K, RadioGroup as nt, Radio as Ne, Alert as ke, AlertIcon as $e, Spinner as st, useDisclosure as Ct, Modal as yt, ModalOverlay as vt, ModalContent as wt, ModalHeader as Lt, ModalCloseButton as St, ModalBody as Mt, ModalFooter as At, IconButton as Tt, Textarea as qe } from "@chakra-ui/react";
3
- import { useMemo as A, useState as z, useCallback as R, useRef as It, useEffect as ae, memo as Fe } from "react";
4
- import { useQuery as he, useMutation as ie, useClient as Ot } from "urql";
2
+ import { Flex as fe, InputGroup as Ge, InputLeftElement as gt, Icon as Je, Input as ye, FormLabel as Xe, Box as K, TableContainer as Ze, Table as Ke, Thead as Ve, Tr as Oe, Th as xe, Tbody as et, Td as je, ButtonGroup as be, Tooltip as _e, Button as V, RangeSlider as xt, RangeSliderMark as De, Text as w, RangeSliderTrack as ft, RangeSliderFilledTrack as jt, RangeSliderThumb as We, Select as Ue, NumberInput as Be, NumberInputField as Qe, HStack as re, Tag as ve, Image as bt, useToast as tt, VStack as oe, FormControl as Z, RadioGroup as nt, Radio as Ne, Alert as $e, AlertIcon as ke, Spinner as st, useDisclosure as Ct, Modal as yt, ModalOverlay as vt, ModalContent as wt, ModalHeader as Lt, ModalCloseButton as St, ModalBody as Mt, ModalFooter as At, IconButton as Tt, Textarea as qe } from "@chakra-ui/react";
3
+ import { useMemo as M, useState as _, useCallback as F, useRef as It, useEffect as ae, memo as Fe } from "react";
4
+ import { useQuery as me, useMutation as ie, useClient as Ot } from "urql";
5
5
  import { c as ot } from "./utils-cn-CgdSr4hO.js";
6
6
  import "./moment-vendor-DMLRxgRE.js";
7
- import { useUiLabelContext as pe, usePartOptionsForSensorLocations as Nt } from "./hooks.js";
8
- import { u as kt } from "./ufuzzy-vendor-Dl0ZI6Av.js";
9
- import { F as $t, a as Ft, b as Rt, c as Dt } from "./react-icons-vendor-CMsTQrA0.js";
7
+ import { useUiLabelContext as ue, usePartOptionsForSensorLocations as Nt } from "./hooks.js";
8
+ import { u as $t } from "./ufuzzy-vendor-Dl0ZI6Av.js";
9
+ import { F as kt, a as Ft, b as Rt, c as Dt } from "./react-icons-vendor-CMsTQrA0.js";
10
10
  import { s as de } from "./react-select-vendor-BxbsY5Z-.js";
11
- import { getFragmentData as _ } from "./generated.js";
12
- import { G as rt, a as Et, C as ze, b as at, M as we, c as Ee, A as me, d as Pe, e as lt, f as Pt, g as it, U as ct, h as Te, i as dt, j as _t, k as zt, l as Gt, m as Wt, n as Ut, o as Bt, p as Qt } from "./graphql-_vGi4u4K.js";
11
+ import { getFragmentData as P } from "./generated.js";
12
+ import { G as rt, a as Et, C as ze, b as at, M as we, c as Ee, A as pe, d as Pe, e as lt, f as Pt, g as it, U as ct, h as Te, i as dt, j as _t, k as zt, l as Gt, m as Wt, n as Ut, o as Bt, p as Qt } from "./graphql-_vGi4u4K.js";
13
13
  import { D as qt, H as Yt, u as Ht, a as Jt } from "./react-dnd-vendor-BCrg2QCX.js";
14
- import { ThresholdKind as Ie, SensorLocation as G, ActionLaterality as Xt } from "./generated-graphql.js";
14
+ import { ThresholdKind as Ie, SensorLocation as z, ActionLaterality as Xt } from "./generated-graphql.js";
15
15
  import { g as ut, a as ht, b as Zt, c as Kt, d as Vt } from "./services-human-B98qxeuS.js";
16
16
  import { availablePlanes as Ye, getAnalysisPartIdNoSide as Se } from "./types.js";
17
17
  import { t as en, p as He } from "./utils-parameters-BBFuBK2B.js";
18
18
  const tn = ({
19
19
  setSearch: n,
20
20
  actions: t,
21
- updateUseCases: a,
22
- hideUseCaseFilter: c = !1
21
+ updateUseCases: o,
22
+ hideUseCaseFilter: d = !1
23
23
  }) => {
24
- const u = A(
25
- () => t?.flatMap((i) => i.useCases).filter((i, d, m) => m.findIndex((l) => l.id === i.id) === d).map((i) => ({
24
+ const m = M(
25
+ () => t?.flatMap((i) => i.useCases).filter((i, u, g) => g.findIndex((r) => r.id === i.id) === u).map((i) => ({
26
26
  label: i.name,
27
27
  value: i.id
28
28
  })) || [],
@@ -30,18 +30,18 @@ const tn = ({
30
30
  );
31
31
  return /* @__PURE__ */ e.jsxs(fe, { width: "100%", alignContent: "space-evenly", gap: 4, children: [
32
32
  /* @__PURE__ */ e.jsxs(Ge, { size: "md", flex: 1, children: [
33
- /* @__PURE__ */ e.jsx(gt, { children: /* @__PURE__ */ e.jsx(Je, { as: $t, color: "gray.300" }) }),
33
+ /* @__PURE__ */ e.jsx(gt, { children: /* @__PURE__ */ e.jsx(Je, { as: kt, color: "gray.300" }) }),
34
34
  /* @__PURE__ */ e.jsx(
35
35
  ye,
36
36
  {
37
37
  placeholder: "Search by name...",
38
38
  width: "100%",
39
- maxW: c ? void 0 : "30rem",
39
+ maxW: d ? void 0 : "30rem",
40
40
  onChange: (i) => n(i.target.value)
41
41
  }
42
42
  )
43
43
  ] }),
44
- !c && /* @__PURE__ */ e.jsx(Ge, { size: "md", children: /* @__PURE__ */ e.jsx(
44
+ !d && /* @__PURE__ */ e.jsx(Ge, { size: "md", children: /* @__PURE__ */ e.jsx(
45
45
  de,
46
46
  {
47
47
  size: "md",
@@ -54,195 +54,195 @@ const tn = ({
54
54
  menuPortalTarget: document.body,
55
55
  placeholder: "Filter use case",
56
56
  isMulti: !0,
57
- options: u,
58
- onChange: (i) => a(i.map((d) => d.value))
57
+ options: m,
58
+ onChange: (i) => o(i.map((u) => u.value))
59
59
  }
60
60
  ) })
61
61
  ] });
62
62
  }, ce = ({
63
63
  children: n
64
64
  }) => /* @__PURE__ */ e.jsx(Xe, { fontWeight: "bold", fontFamily: "sans-serif", fontSize: "large", children: n }), nn = ({ value: n, onChange: t }) => {
65
- const a = z(
65
+ const o = _(
66
66
  () => Math.random().toString(36).substring(2, 15)
67
- )[0], c = R(
68
- (u, i) => {
69
- t((d) => {
70
- const m = [...d], [l] = m.splice(u, 1);
71
- return m.splice(i, 0, l), m;
67
+ )[0], d = F(
68
+ (m, i) => {
69
+ t((u) => {
70
+ const g = [...u], [r] = g.splice(m, 1);
71
+ return g.splice(i, 0, r), g;
72
72
  });
73
73
  },
74
74
  [t]
75
75
  );
76
- return /* @__PURE__ */ e.jsx(V, { children: /* @__PURE__ */ e.jsx(qt, { backend: Yt, children: /* @__PURE__ */ e.jsx(Ze, { children: /* @__PURE__ */ e.jsxs(Ke, { variant: "simple", size: "md", children: [
76
+ return /* @__PURE__ */ e.jsx(K, { children: /* @__PURE__ */ e.jsx(qt, { backend: Yt, children: /* @__PURE__ */ e.jsx(Ze, { children: /* @__PURE__ */ e.jsxs(Ke, { variant: "simple", size: "md", children: [
77
77
  /* @__PURE__ */ e.jsx(Ve, { children: /* @__PURE__ */ e.jsxs(Oe, { children: [
78
78
  /* @__PURE__ */ e.jsx(xe, { children: "Order" }),
79
79
  /* @__PURE__ */ e.jsx(xe, { children: "Name" })
80
80
  ] }) }),
81
- /* @__PURE__ */ e.jsx(et, { children: n.map((u, i) => /* @__PURE__ */ e.jsx(
81
+ /* @__PURE__ */ e.jsx(et, { children: n.map((m, i) => /* @__PURE__ */ e.jsx(
82
82
  sn,
83
83
  {
84
- listKey: a,
84
+ listKey: o,
85
85
  index: i,
86
- id: u.id,
87
- name: u.name,
88
- move: c
86
+ id: m.id,
87
+ name: m.name,
88
+ move: d
89
89
  },
90
- u.id
90
+ m.id
91
91
  )) })
92
92
  ] }) }) }) });
93
- }, sn = ({ listKey: n, index: t, id: a, name: c, move: u }) => {
94
- const i = It(null), [{ handlerId: d }, m] = Ht({
93
+ }, sn = ({ listKey: n, index: t, id: o, name: d, move: m }) => {
94
+ const i = It(null), [{ handlerId: u }, g] = Ht({
95
95
  accept: n,
96
- collect: (p) => ({
97
- handlerId: p.getHandlerId()?.toString() ?? ""
96
+ collect: (x) => ({
97
+ handlerId: x.getHandlerId()?.toString() ?? ""
98
98
  }),
99
- hover: (p, L) => {
99
+ hover: (x, S) => {
100
100
  if (!i.current)
101
101
  return;
102
- const b = p.index, s = t;
103
- if (b === s)
102
+ const b = x.index, l = t;
103
+ if (b === l)
104
104
  return;
105
- const f = i.current?.getBoundingClientRect(), C = (f.bottom - f.top) / 2, S = L.getClientOffset().y - f.top;
106
- b < s && S < C || b > s && S > C || (u(b, s), p.index = s);
105
+ const f = i.current?.getBoundingClientRect(), h = (f.bottom - f.top) / 2, y = S.getClientOffset().y - f.top;
106
+ b < l && y < h || b > l && y > h || (m(b, l), x.index = l);
107
107
  }
108
- }), [{ isDragging: l }, x] = Jt({
108
+ }), [{ isDragging: r }, c] = Jt({
109
109
  type: n,
110
- item: () => ({ id: a, index: t }),
111
- collect: (p) => ({
112
- isDragging: p.isDragging()
110
+ item: () => ({ id: o, index: t }),
111
+ collect: (x) => ({
112
+ isDragging: x.isDragging()
113
113
  })
114
- }), h = l ? 0.6 : 1, T = l ? "grabbing" : "grab";
115
- return x(m(i)), /* @__PURE__ */ e.jsxs(Oe, { ref: i, style: { opacity: h, cursor: T }, "data-handler-id": d, children: [
114
+ }), p = r ? 0.6 : 1, A = r ? "grabbing" : "grab";
115
+ return c(g(i)), /* @__PURE__ */ e.jsxs(Oe, { ref: i, style: { opacity: p, cursor: A }, "data-handler-id": u, children: [
116
116
  /* @__PURE__ */ e.jsx(je, { children: t + 1 }),
117
- /* @__PURE__ */ e.jsx(je, { children: c })
117
+ /* @__PURE__ */ e.jsx(je, { children: d })
118
118
  ] });
119
119
  }, on = ({
120
120
  items: n,
121
121
  onChange: t,
122
- selectedItem: a,
123
- isDisabled: c,
124
- selectedProps: u,
122
+ selectedItem: o,
123
+ isDisabled: d,
124
+ selectedProps: m,
125
125
  buttonProps: i
126
126
  }) => {
127
- const d = (l) => l === a || l.value === a, m = (l) => d(l) ? { ...i, ...u } : i;
128
- return /* @__PURE__ */ e.jsx(be, { isAttached: !0, isDisabled: c, children: n.map((l, x) => /* @__PURE__ */ e.jsx(
127
+ const u = (r) => r === o || r.value === o, g = (r) => u(r) ? { ...i, ...m } : i;
128
+ return /* @__PURE__ */ e.jsx(be, { isAttached: !0, isDisabled: d, children: n.map((r, c) => /* @__PURE__ */ e.jsx(
129
129
  _e,
130
130
  {
131
- label: l.tooltip,
131
+ label: r.tooltip,
132
132
  openDelay: 50,
133
133
  closeDelay: 200,
134
134
  placement: "top",
135
- visibility: l.tooltip ? "visible" : "hidden",
135
+ visibility: r.tooltip ? "visible" : "hidden",
136
136
  hasArrow: !0,
137
137
  children: /* @__PURE__ */ e.jsx(
138
- ee,
138
+ V,
139
139
  {
140
- onClick: () => d(l) ? null : t(l, x),
141
- isDisabled: l.disabled,
142
- ...m(l),
143
- children: l.label
140
+ onClick: () => u(r) ? null : t(r, c),
141
+ isDisabled: r.disabled,
142
+ ...g(r),
143
+ children: r.label
144
144
  }
145
145
  )
146
146
  },
147
- x
147
+ c
148
148
  )) });
149
149
  }, Me = (n, t) => t < 0 ? -1 * Math.abs(n) : Math.abs(n), rn = ({
150
150
  isReversed: n,
151
151
  min: t,
152
- max: a,
153
- value: c,
154
- onChange: u,
152
+ max: o,
153
+ value: d,
154
+ onChange: m,
155
155
  inputProps: i,
156
- size: d,
157
- zeroMarker: m,
158
- formatValue: l,
159
- valueLabel: x,
160
- positiveNegativeLabels: h,
161
- isDisabled: T,
162
- ...p
156
+ size: u,
157
+ zeroMarker: g,
158
+ formatValue: r,
159
+ valueLabel: c,
160
+ positiveNegativeLabels: p,
161
+ isDisabled: A,
162
+ ...x
163
163
  }) => {
164
- const [L, b] = z([void 0, void 0]), s = L[0], f = L[1], C = m && t < -5 && a > 5, j = Number(c?.[0] ?? f ?? t) > 0 ? 1 : -1, S = Number(c?.[1] ?? f ?? a) < 0 ? -1 : 1, F = h?.[0] === h?.[1], N = c?.[0], B = c?.[1];
164
+ const [S, b] = _([void 0, void 0]), l = S[0], f = S[1], h = g && t < -5 && o > 5, C = Number(d?.[0] ?? f ?? t) > 0 ? 1 : -1, y = Number(d?.[1] ?? f ?? o) < 0 ? -1 : 1, T = p?.[0] === p?.[1], $ = d?.[0], B = d?.[1];
165
165
  ae(() => {
166
- N !== void 0 && B !== void 0 && b([N.toFixed(0), B.toFixed(0)]);
167
- }, [N, B, b]);
168
- const k = R(
169
- ([y, D]) => {
170
- y < D && b([y.toFixed(0), D.toFixed(0)]);
166
+ $ !== void 0 && B !== void 0 && b([$.toFixed(0), B.toFixed(0)]);
167
+ }, [$, B, b]);
168
+ const k = F(
169
+ ([v, E]) => {
170
+ v < E && b([v.toFixed(0), E.toFixed(0)]);
171
171
  },
172
172
  [b]
173
- ), $ = R(
174
- ([y, D]) => {
175
- y < D && u([y, D]);
173
+ ), R = F(
174
+ ([v, E]) => {
175
+ v < E && m([v, E]);
176
176
  },
177
- [u]
178
- ), M = R(() => {
179
- b(([y, D]) => {
180
- const X = isNaN(Number(y)) ? t : Number(y), Z = isNaN(Number(D)) ? a : Number(D), E = Me(Number(X), j), r = Me(Number(Z), S), o = j < 0 ? Math.max(E, t) : Math.min(E, a), w = S < 0 ? Math.max(r, t) : Math.min(r, a);
181
- return o > w ? (u([w, o]), [w.toFixed(0), o.toFixed(0)]) : (u([o, w]), [o.toFixed(0), w.toFixed(0)]);
177
+ [m]
178
+ ), G = F(() => {
179
+ b(([v, E]) => {
180
+ const X = isNaN(Number(v)) ? t : Number(v), Q = isNaN(Number(E)) ? o : Number(E), se = Me(Number(X), C), a = Me(Number(Q), y), s = C < 0 ? Math.max(se, t) : Math.min(se, o), L = y < 0 ? Math.max(a, t) : Math.min(a, o);
181
+ return s > L ? (m([L, s]), [L.toFixed(0), s.toFixed(0)]) : (m([s, L]), [s.toFixed(0), L.toFixed(0)]);
182
182
  });
183
- }, [u, b, j, S, t, a]), se = R(
184
- (y) => {
185
- const D = y === "" || isNaN(Number(y)) ? y : Me(Number(y), j);
186
- b(([X, Z]) => [D.toString(), Z]);
183
+ }, [m, b, C, y, t, o]), ee = F(
184
+ (v) => {
185
+ const E = v === "" || isNaN(Number(v)) ? v : Me(Number(v), C);
186
+ b(([X, Q]) => [E.toString(), Q]);
187
187
  },
188
- [b, j]
189
- ), J = R(
190
- (y) => {
191
- const D = y === "" || isNaN(Number(y)) ? y : Me(Number(y), S);
192
- b(([X, Z]) => [X, D.toString()]);
188
+ [b, C]
189
+ ), I = F(
190
+ (v) => {
191
+ const E = v === "" || isNaN(Number(v)) ? v : Me(Number(v), y);
192
+ b(([X, Q]) => [X, E.toString()]);
193
193
  },
194
- [b, S]
195
- ), g = A(
196
- () => d === "xs" ? "0.75rem" : void 0,
197
- [d]
198
- ), I = R(
199
- (y, D) => {
200
- const X = Number(D.target.value);
201
- if (!s || !f || ![-1, 1].includes(X))
194
+ [b, y]
195
+ ), j = M(
196
+ () => u === "xs" ? "0.75rem" : void 0,
197
+ [u]
198
+ ), N = F(
199
+ (v, E) => {
200
+ const X = Number(E.target.value);
201
+ if (!l || !f || ![-1, 1].includes(X))
202
202
  return;
203
- const Z = (o) => X < 0 ? -1 * Math.abs(o) : Math.abs(o), E = y ? Z(Number(s)) : Number(s), r = y ? Number(f) : Z(Number(f));
204
- E > r ? u([r, E]) : u([E, r]);
203
+ const Q = (s) => X < 0 ? -1 * Math.abs(s) : Math.abs(s), se = v ? Q(Number(l)) : Number(l), a = v ? Number(f) : Q(Number(f));
204
+ se > a ? m([a, se]) : m([se, a]);
205
205
  },
206
- [s, f, u]
206
+ [l, f, m]
207
207
  );
208
- return /* @__PURE__ */ e.jsxs(fe, { direction: "column", ...p, children: [
209
- /* @__PURE__ */ e.jsx(V, { pt: "1em", mb: "-0.5em", children: /* @__PURE__ */ e.jsxs(
208
+ return /* @__PURE__ */ e.jsxs(fe, { direction: "column", ...x, children: [
209
+ /* @__PURE__ */ e.jsx(K, { pt: "1em", mb: "-0.5em", children: /* @__PURE__ */ e.jsxs(
210
210
  xt,
211
211
  {
212
212
  "aria-label": ["min", "max"],
213
213
  isReversed: n,
214
- value: [Number(s ?? t), Number(f ?? a)],
215
- max: a,
214
+ value: [Number(l ?? t), Number(f ?? o)],
215
+ max: o,
216
216
  min: t,
217
217
  minStepsBetweenThumbs: 3,
218
218
  step: 1,
219
219
  onChange: k,
220
- onChangeEnd: $,
221
- isDisabled: T,
220
+ onChangeEnd: R,
221
+ isDisabled: A,
222
222
  children: [
223
223
  /* @__PURE__ */ e.jsx(De, { value: t, top: "-1em", children: /* @__PURE__ */ e.jsx(
224
- v,
224
+ w,
225
225
  {
226
- fontSize: d ?? "sm",
226
+ fontSize: u ?? "sm",
227
227
  fontWeight: "semibold",
228
228
  whiteSpace: "nowrap",
229
- children: l ? l?.(t) : t
229
+ children: r ? r?.(t) : t
230
230
  }
231
231
  ) }),
232
- /* @__PURE__ */ e.jsx(De, { value: a, top: "-1em", children: /* @__PURE__ */ e.jsx(
233
- v,
232
+ /* @__PURE__ */ e.jsx(De, { value: o, top: "-1em", children: /* @__PURE__ */ e.jsx(
233
+ w,
234
234
  {
235
- fontSize: d ?? "sm",
235
+ fontSize: u ?? "sm",
236
236
  fontWeight: "semibold",
237
237
  style: { transform: "translateX(-100%)" },
238
238
  whiteSpace: "nowrap",
239
- children: l ? l(a) : a
239
+ children: r ? r(o) : o
240
240
  }
241
241
  ) }),
242
- C && /* @__PURE__ */ e.jsxs(De, { value: 0, top: "-1em", pos: "relative", children: [
243
- /* @__PURE__ */ e.jsx(v, { fontSize: d, fontWeight: "semibold", children: l?.(0) ?? "0" }),
242
+ h && /* @__PURE__ */ e.jsxs(De, { value: 0, top: "-1em", pos: "relative", children: [
243
+ /* @__PURE__ */ e.jsx(w, { fontSize: u, fontWeight: "semibold", children: r?.(0) ?? "0" }),
244
244
  /* @__PURE__ */ e.jsx(
245
- V,
245
+ K,
246
246
  {
247
247
  position: "absolute",
248
248
  width: "2px",
@@ -254,33 +254,33 @@ const tn = ({
254
254
  )
255
255
  ] }),
256
256
  /* @__PURE__ */ e.jsx(ft, { children: /* @__PURE__ */ e.jsx(jt, {}) }),
257
- /* @__PURE__ */ e.jsx(We, { index: 0, w: g, h: g }),
258
- /* @__PURE__ */ e.jsx(We, { index: 1, w: g, h: g })
257
+ /* @__PURE__ */ e.jsx(We, { index: 0, w: j, h: j }),
258
+ /* @__PURE__ */ e.jsx(We, { index: 1, w: j, h: j })
259
259
  ]
260
260
  }
261
261
  ) }),
262
- x && /* @__PURE__ */ e.jsxs(
262
+ c && /* @__PURE__ */ e.jsxs(
263
263
  fe,
264
264
  {
265
265
  direction: n ? "row-reverse" : "row",
266
266
  justifyContent: "space-between",
267
267
  children: [
268
268
  /* @__PURE__ */ e.jsx(
269
- v,
269
+ w,
270
270
  {
271
- fontSize: d ?? "sm",
271
+ fontSize: u ?? "sm",
272
272
  fontWeight: "semibold",
273
273
  whiteSpace: "nowrap",
274
- children: x(t)
274
+ children: c(t)
275
275
  }
276
276
  ),
277
277
  /* @__PURE__ */ e.jsx(
278
- v,
278
+ w,
279
279
  {
280
- fontSize: d ?? "sm",
280
+ fontSize: u ?? "sm",
281
281
  fontWeight: "semibold",
282
282
  whiteSpace: "nowrap",
283
- children: x(a)
283
+ children: c(o)
284
284
  }
285
285
  )
286
286
  ]
@@ -294,18 +294,18 @@ const tn = ({
294
294
  alignItems: "center",
295
295
  gap: "0.125em",
296
296
  children: [
297
- h && /* @__PURE__ */ e.jsxs(
297
+ p && /* @__PURE__ */ e.jsxs(
298
298
  Ue,
299
299
  {
300
300
  width: "auto",
301
- size: d,
301
+ size: u,
302
302
  fontWeight: "bold",
303
- value: j,
304
- onChange: (y) => I(!0, y),
305
- isDisabled: F || T,
303
+ value: C,
304
+ onChange: (v) => N(!0, v),
305
+ isDisabled: T || A,
306
306
  children: [
307
- /* @__PURE__ */ e.jsx("option", { value: -1, children: h[0] }),
308
- /* @__PURE__ */ e.jsx("option", { value: 1, children: h[1] })
307
+ /* @__PURE__ */ e.jsx("option", { value: -1, children: p[0] }),
308
+ /* @__PURE__ */ e.jsx("option", { value: 1, children: p[1] })
309
309
  ]
310
310
  }
311
311
  ),
@@ -313,16 +313,16 @@ const tn = ({
313
313
  Be,
314
314
  {
315
315
  precision: 0,
316
- size: d ?? "sm",
316
+ size: u ?? "sm",
317
317
  min: 0,
318
- max: j < 0 ? Math.abs(t) : B ?? a,
319
- value: s === "" ? "" : Math.abs(Number(s ?? t)),
320
- onChange: se,
321
- onBlur: M,
318
+ max: C < 0 ? Math.abs(t) : B ?? o,
319
+ value: l === "" ? "" : Math.abs(Number(l ?? t)),
320
+ onChange: ee,
321
+ onBlur: G,
322
322
  borderWidth: 1,
323
323
  borderRadius: 3,
324
324
  borderColor: "#ccc",
325
- isDisabled: T,
325
+ isDisabled: A,
326
326
  ...i,
327
327
  children: /* @__PURE__ */ e.jsx(
328
328
  Qe,
@@ -337,17 +337,17 @@ const tn = ({
337
337
  /* @__PURE__ */ e.jsx(
338
338
  Be,
339
339
  {
340
- size: d ?? "sm",
340
+ size: u ?? "sm",
341
341
  min: 0,
342
- max: S < 0 ? Math.abs(N ?? t) : a,
342
+ max: y < 0 ? Math.abs($ ?? t) : o,
343
343
  precision: 0,
344
- value: f === "" ? "" : Math.abs(Number(f ?? a)),
345
- onChange: J,
346
- onBlur: M,
344
+ value: f === "" ? "" : Math.abs(Number(f ?? o)),
345
+ onChange: I,
346
+ onBlur: G,
347
347
  borderWidth: 1,
348
348
  borderRadius: 3,
349
349
  borderColor: "#ccc",
350
- isDisabled: T,
350
+ isDisabled: A,
351
351
  ...i,
352
352
  children: /* @__PURE__ */ e.jsx(
353
353
  Qe,
@@ -359,18 +359,18 @@ const tn = ({
359
359
  )
360
360
  }
361
361
  ),
362
- h && /* @__PURE__ */ e.jsxs(
362
+ p && /* @__PURE__ */ e.jsxs(
363
363
  Ue,
364
364
  {
365
365
  width: "auto",
366
- size: d,
366
+ size: u,
367
367
  fontWeight: "bold",
368
- value: S,
369
- onChange: (y) => I(!1, y),
370
- isDisabled: F || T,
368
+ value: y,
369
+ onChange: (v) => N(!1, v),
370
+ isDisabled: T || A,
371
371
  children: [
372
- /* @__PURE__ */ e.jsx("option", { value: -1, children: h[0] }),
373
- /* @__PURE__ */ e.jsx("option", { value: 1, children: h[1] })
372
+ /* @__PURE__ */ e.jsx("option", { value: -1, children: p[0] }),
373
+ /* @__PURE__ */ e.jsx("option", { value: 1, children: p[1] })
374
374
  ]
375
375
  }
376
376
  )
@@ -378,20 +378,20 @@ const tn = ({
378
378
  }
379
379
  )
380
380
  ] });
381
- }, an = ({ tags: n, containerProps: t, ...a }) => /* @__PURE__ */ e.jsx(re, { ...t, children: n.map((c, u) => /* @__PURE__ */ e.jsx(ve, { ...a, children: c }, u)) }), ln = new kt({}), cn = ({
381
+ }, an = ({ tags: n, containerProps: t, ...o }) => /* @__PURE__ */ e.jsx(re, { ...t, children: n.map((d, m) => /* @__PURE__ */ e.jsx(ve, { ...o, children: d }, m)) }), ln = new $t({}), cn = ({
382
382
  action: n,
383
383
  quantumIconSrc: t
384
384
  }) => {
385
- const { getLabel: a } = pe(), c = A(() => ({
386
- actionLowerCase: a("action").toLocaleLowerCase()
387
- }), [a]);
385
+ const { getLabel: o } = ue(), d = M(() => ({
386
+ actionLowerCase: o("action").toLocaleLowerCase()
387
+ }), [o]);
388
388
  return n.quantumOwned ? /* @__PURE__ */ e.jsx(
389
389
  _e,
390
390
  {
391
- label: `This ${c.actionLowerCase} is owned by Quantum`,
391
+ label: `This ${d.actionLowerCase} is owned by Quantum`,
392
392
  "aria-label": "Quantum owned",
393
393
  children: /* @__PURE__ */ e.jsx(
394
- V,
394
+ K,
395
395
  {
396
396
  boxSize: "1.5em",
397
397
  borderRadius: "full",
@@ -404,7 +404,7 @@ const tn = ({
404
404
  {
405
405
  src: t,
406
406
  boxSize: "1em",
407
- alt: `Quantum-owned ${c.actionLowerCase}`
407
+ alt: `Quantum-owned ${d.actionLowerCase}`
408
408
  }
409
409
  )
410
410
  }
@@ -414,94 +414,94 @@ const tn = ({
414
414
  }, dn = (n, t) => {
415
415
  if (!t || !t.trim().length)
416
416
  return n;
417
- const a = n.map((u) => u.name ?? "");
418
- return ln.filter(a, t)?.map((u) => n[u]) ?? [];
417
+ const o = n.map((m) => m.name ?? "");
418
+ return ln.filter(o, t)?.map((m) => n[m]) ?? [];
419
419
  }, un = (n) => !n || n.length === 0 ? "None" : n.map(
420
420
  (t) => (
421
421
  // Convert camelCase to separate words (e.g., 'LeftFoot' -> 'Left Foot')
422
422
  t.replace(/([A-Z])/g, " $1").trim()
423
423
  )
424
424
  ).join(", "), hn = (n, t) => !t || t.length == 0 ? n : n.filter(
425
- (a) => a.useCases?.some((c) => t.includes(c.id)) ?? !1
425
+ (o) => o.useCases?.some((d) => t.includes(d.id)) ?? !1
426
426
  ), mn = ({
427
427
  actions: n,
428
428
  totalActions: t,
429
- onCreate: a,
430
- onDelete: c,
431
- onEdit: u,
429
+ onCreate: o,
430
+ onDelete: d,
431
+ onEdit: m,
432
432
  onView: i,
433
- onSelected: d,
434
- onDuplicate: m,
435
- disableMultiSelect: l,
436
- disableDelete: x,
437
- disableEdit: h,
438
- disableCreate: T,
439
- hideUseCase: p = !0,
440
- tableProps: L,
433
+ onSelected: u,
434
+ onDuplicate: g,
435
+ disableMultiSelect: r,
436
+ disableDelete: c,
437
+ disableEdit: p,
438
+ disableCreate: A,
439
+ hideUseCase: x = !0,
440
+ tableProps: S,
441
441
  containerProps: b,
442
- quantumIconSrc: s = "/favicon.ico"
442
+ quantumIconSrc: l = "/favicon.ico"
443
443
  }) => {
444
- const [f, C] = z(""), [j, S] = z(), { getLabel: F } = pe(), N = A(() => ({
445
- action: F("action"),
446
- actionPlural: F("action_plural"),
447
- actionLowerCase: F("action").toLocaleLowerCase(),
448
- actionPluralLowerCase: F("action_plural").toLocaleLowerCase()
449
- }), [F]), B = A(() => {
444
+ const [f, h] = _(""), [C, y] = _(), { getLabel: T } = ue(), $ = M(() => ({
445
+ action: T("action"),
446
+ actionPlural: T("action_plural"),
447
+ actionLowerCase: T("action").toLocaleLowerCase(),
448
+ actionPluralLowerCase: T("action_plural").toLocaleLowerCase()
449
+ }), [T]), B = M(() => {
450
450
  if (!n)
451
451
  return;
452
- const g = dn(n, f);
453
- return p ? g : hn(g, j);
454
- }, [n, f, j, p]), k = R(() => {
455
- if (!c)
452
+ const j = dn(n, f);
453
+ return x ? j : hn(j, C);
454
+ }, [n, f, C, x]), k = F(() => {
455
+ if (!d)
456
456
  return;
457
- const I = n.filter(
458
- (y) => y.selected && !y.quantumOwned
459
- ).map((y) => y.id);
460
- c(I);
461
- }, [n, c]), $ = R(() => {
462
- if (!m)
457
+ const N = n.filter(
458
+ (v) => v.selected && !v.quantumOwned
459
+ ).map((v) => v.id);
460
+ d(N);
461
+ }, [n, d]), R = F(() => {
462
+ if (!g)
463
463
  return;
464
- const g = n.filter((I) => I.selected);
465
- m(g.map((I) => I.id)), d && g.forEach((I) => d(I, !1));
466
- }, [n, m, d]), M = A(() => n.some((g) => g.selected && !g.quantumOwned), [n]), se = A(() => n.some((g) => g.selected), [n]), J = A(() => n.some((g) => g.selected && g.quantumOwned), [n]);
467
- return /* @__PURE__ */ e.jsxs(V, { ...b, children: [
464
+ const j = n.filter((N) => N.selected);
465
+ g(j.map((N) => N.id)), u && j.forEach((N) => u(N, !1));
466
+ }, [n, g, u]), G = M(() => n.some((j) => j.selected && !j.quantumOwned), [n]), ee = M(() => n.some((j) => j.selected), [n]), I = M(() => n.some((j) => j.selected && j.quantumOwned), [n]);
467
+ return /* @__PURE__ */ e.jsxs(K, { ...b, children: [
468
468
  /* @__PURE__ */ e.jsxs(fe, { alignContent: "space-between", gap: 4, children: [
469
- (a || c || m) && /* @__PURE__ */ e.jsxs(be, { mb: "1rem", gap: 4, children: [
470
- a && /* @__PURE__ */ e.jsxs(
471
- ee,
469
+ (o || d || g) && /* @__PURE__ */ e.jsxs(be, { mb: "1rem", gap: 4, children: [
470
+ o && /* @__PURE__ */ e.jsxs(
471
+ V,
472
472
  {
473
- isDisabled: !a || T,
473
+ isDisabled: !o || A,
474
474
  colorScheme: "blackAlpha",
475
475
  backgroundColor: "gray.700",
476
- onClick: a,
476
+ onClick: o,
477
477
  children: [
478
478
  "Create New ",
479
- N.action
479
+ $.action
480
480
  ]
481
481
  }
482
482
  ),
483
- c && !l && /* @__PURE__ */ e.jsx(
483
+ d && !r && /* @__PURE__ */ e.jsx(
484
484
  _e,
485
485
  {
486
- label: J ? M ? `Quantum-owned ${N.actionPluralLowerCase} are selected and will be skipped` : `Selected ${N.actionPluralLowerCase} are quantum-owned and cannot be deleted` : void 0,
486
+ label: I ? G ? `Quantum-owned ${$.actionPluralLowerCase} are selected and will be skipped` : `Selected ${$.actionPluralLowerCase} are quantum-owned and cannot be deleted` : void 0,
487
487
  shouldWrapChildren: !0,
488
488
  children: /* @__PURE__ */ e.jsx(
489
- ee,
489
+ V,
490
490
  {
491
491
  colorScheme: "gray",
492
- isDisabled: !M || !c || x,
492
+ isDisabled: !G || !d || c,
493
493
  onClick: k,
494
494
  children: "Delete Selected"
495
495
  }
496
496
  )
497
497
  }
498
498
  ),
499
- m && !l && /* @__PURE__ */ e.jsx(
500
- ee,
499
+ g && !r && /* @__PURE__ */ e.jsx(
500
+ V,
501
501
  {
502
502
  colorScheme: "gray",
503
- isDisabled: !se,
504
- onClick: $,
503
+ isDisabled: !ee,
504
+ onClick: R,
505
505
  children: "Duplicate Selected"
506
506
  }
507
507
  )
@@ -509,14 +509,14 @@ const tn = ({
509
509
  /* @__PURE__ */ e.jsx(
510
510
  tn,
511
511
  {
512
- setSearch: C,
512
+ setSearch: h,
513
513
  actions: n,
514
- updateUseCases: S,
515
- hideUseCaseFilter: p
514
+ updateUseCases: y,
515
+ hideUseCaseFilter: x
516
516
  }
517
517
  )
518
518
  ] }),
519
- /* @__PURE__ */ e.jsx(Ze, { mr: "2rem", overflowX: "hidden", ...L, children: /* @__PURE__ */ e.jsxs(Ke, { size: "md", variant: "simple", children: [
519
+ /* @__PURE__ */ e.jsx(Ze, { mr: "2rem", overflowX: "hidden", ...S, children: /* @__PURE__ */ e.jsxs(Ke, { size: "md", variant: "simple", children: [
520
520
  /* @__PURE__ */ e.jsx(Ve, { position: "sticky", top: 0, bg: "white", zIndex: 1, children: /* @__PURE__ */ e.jsxs(Oe, { children: [
521
521
  /* @__PURE__ */ e.jsxs(xe, { fontWeight: "normal", children: [
522
522
  "(showing ",
@@ -528,46 +528,46 @@ const tn = ({
528
528
  ] }),
529
529
  /* @__PURE__ */ e.jsx(xe, { children: "Name" }),
530
530
  /* @__PURE__ */ e.jsx(xe, { children: "Sensor Locations" }),
531
- !p && /* @__PURE__ */ e.jsx(xe, { children: "Use Case" }),
531
+ !x && /* @__PURE__ */ e.jsx(xe, { children: "Use Case" }),
532
532
  /* @__PURE__ */ e.jsx(xe, {})
533
533
  ] }) }),
534
- /* @__PURE__ */ e.jsx(et, { children: B?.map((g) => /* @__PURE__ */ e.jsxs(
534
+ /* @__PURE__ */ e.jsx(et, { children: B?.map((j) => /* @__PURE__ */ e.jsxs(
535
535
  Oe,
536
536
  {
537
537
  className: ot(
538
538
  "hover:bg-[#f7f7f7]",
539
- !l && "cursor-pointer",
540
- g.selected && "bg-gray-200"
539
+ !r && "cursor-pointer",
540
+ j.selected && "bg-gray-200"
541
541
  ),
542
542
  onClick: () => {
543
- l || d?.(g, !g.selected);
543
+ r || u?.(j, !j.selected);
544
544
  },
545
545
  children: [
546
546
  /* @__PURE__ */ e.jsx(je, { children: /* @__PURE__ */ e.jsxs(fe, { children: [
547
- !l && /* @__PURE__ */ e.jsx(e.Fragment, { children: g.selected ? /* @__PURE__ */ e.jsx(Ft, { className: "text-blue-500" }) : /* @__PURE__ */ e.jsx(Rt, { className: "text-gray-400" }) }),
548
- (g.quantumOwned || !u) && i && /* @__PURE__ */ e.jsx(
549
- ee,
547
+ !r && /* @__PURE__ */ e.jsx(e.Fragment, { children: j.selected ? /* @__PURE__ */ e.jsx(Ft, { className: "text-blue-500" }) : /* @__PURE__ */ e.jsx(Rt, { className: "text-gray-400" }) }),
548
+ (j.quantumOwned || !m) && i && /* @__PURE__ */ e.jsx(
549
+ V,
550
550
  {
551
551
  ml: "1em",
552
552
  size: "sm",
553
553
  variant: "link",
554
554
  colorScheme: "blue",
555
- onClick: (I) => {
556
- I.stopPropagation(), i(g.id);
555
+ onClick: (N) => {
556
+ N.stopPropagation(), i(j.id);
557
557
  },
558
558
  children: "View"
559
559
  }
560
560
  ),
561
- !g.quantumOwned && u && /* @__PURE__ */ e.jsx(
562
- ee,
561
+ !j.quantumOwned && m && /* @__PURE__ */ e.jsx(
562
+ V,
563
563
  {
564
- isDisabled: h,
564
+ isDisabled: p,
565
565
  ml: "1em",
566
566
  size: "sm",
567
567
  variant: "link",
568
568
  colorScheme: "blue",
569
- onClick: (I) => {
570
- I.stopPropagation(), u(g.id);
569
+ onClick: (N) => {
570
+ N.stopPropagation(), m(j.id);
571
571
  },
572
572
  children: "Edit"
573
573
  }
@@ -577,226 +577,226 @@ const tn = ({
577
577
  /* @__PURE__ */ e.jsx(
578
578
  cn,
579
579
  {
580
- action: g,
581
- quantumIconSrc: s
580
+ action: j,
581
+ quantumIconSrc: l
582
582
  }
583
583
  ),
584
- g.name
584
+ j.name
585
585
  ] }) }),
586
- /* @__PURE__ */ e.jsx(je, { maxW: "20rem", whiteSpace: "break-spaces", children: un(g.sensorLocations) }),
587
- !p && /* @__PURE__ */ e.jsx(je, { maxW: "20rem", children: /* @__PURE__ */ e.jsx(
586
+ /* @__PURE__ */ e.jsx(je, { maxW: "20rem", whiteSpace: "break-spaces", children: un(j.sensorLocations) }),
587
+ !x && /* @__PURE__ */ e.jsx(je, { maxW: "20rem", children: /* @__PURE__ */ e.jsx(
588
588
  an,
589
589
  {
590
590
  containerProps: { flexWrap: "wrap" },
591
- tags: g.useCases?.map((I) => I.name) ?? []
591
+ tags: j.useCases?.map((N) => N.name) ?? []
592
592
  }
593
593
  ) })
594
594
  ]
595
595
  },
596
- g.id
596
+ j.id
597
597
  )) })
598
598
  ] }) })
599
599
  ] });
600
600
  }, Un = ({
601
601
  onSave: n,
602
602
  onCancel: t,
603
- onError: a,
604
- hideButtons: c = !1,
605
- setButtonDisabled: u,
603
+ onError: o,
604
+ hideButtons: d = !1,
605
+ setButtonDisabled: m,
606
606
  setButtonOnClick: i,
607
- quantumOwned: d
607
+ quantumOwned: u
608
608
  }) => {
609
- const m = tt(), { getLabel: l } = pe(), x = A(() => ({
610
- singular: l("action"),
611
- plural: l("action_plural"),
612
- pluralLowerCase: l("action_plural").toLowerCase(),
613
- singularLowerCase: l("action").toLowerCase()
614
- }), [l]), [h, T] = z("copy"), [p, L] = z(""), [b, s] = z([]), [f, C] = z(!1), [j] = he({
609
+ const g = tt(), { getLabel: r } = ue(), c = M(() => ({
610
+ singular: r("action"),
611
+ plural: r("action_plural"),
612
+ pluralLowerCase: r("action_plural").toLowerCase(),
613
+ singularLowerCase: r("action").toLowerCase()
614
+ }), [r]), [p, A] = _("copy"), [x, S] = _(""), [b, l] = _([]), [f, h] = _(!1), [C] = me({
615
615
  query: rt
616
- }), [S] = he({
616
+ }), [y] = me({
617
617
  query: Et,
618
- variables: { groupId: p },
619
- pause: !p
618
+ variables: { groupId: x },
619
+ pause: !x
620
620
  // Only run when group is selected
621
- }), [, F] = ie(ze), [, N] = ie(
621
+ }), [, T] = ie(ze), [, $] = ie(
622
622
  at
623
- ), B = A(() => j.data?.groups ? j.data.groups.map(
624
- (r) => _(lt, r)
625
- ) : [], [j.data]), k = A(() => S.data ? S.data.actions.map(
626
- (o) => _(me, o)
627
- ) : [], [S.data]), $ = A(() => k.filter(
628
- (r) => b.includes(r.id)
629
- ), [k, b]), M = R(
630
- (r) => {
631
- const o = r?.value || "";
632
- L(o), s([]);
623
+ ), B = M(() => C.data?.groups ? C.data.groups.map(
624
+ (a) => P(lt, a)
625
+ ) : [], [C.data]), k = M(() => y.data ? y.data.actions.map(
626
+ (s) => P(pe, s)
627
+ ) : [], [y.data]), R = M(() => k.filter(
628
+ (a) => b.includes(a.id)
629
+ ), [k, b]), G = F(
630
+ (a) => {
631
+ const s = a?.value || "";
632
+ S(s), l([]);
633
633
  },
634
634
  []
635
- ), se = R(
636
- (r) => {
637
- const o = r.map((w) => w.value);
638
- s(o);
635
+ ), ee = F(
636
+ (a) => {
637
+ const s = a.map((L) => L.value);
638
+ l(s);
639
639
  },
640
640
  []
641
- ), J = R(
642
- async (r) => {
643
- const o = _(
641
+ ), I = F(
642
+ async (a) => {
643
+ const s = P(
644
644
  we,
645
- r.categories
646
- ), P = _(
645
+ a.categories
646
+ ), D = P(
647
647
  Ee,
648
- r.metadataGroups
648
+ a.metadataGroups
649
649
  ).flatMap(
650
- (U) => U.data.map((te) => _(Pe, te).id)
650
+ (U) => U.data.map((te) => P(Pe, te).id)
651
651
  ), W = {
652
- ...r,
653
- name: `${r.name} (Copy)`,
652
+ ...a,
653
+ name: `${a.name} (Copy)`,
654
654
  // Add "(Copy)" suffix to distinguish
655
- description: r.description || void 0,
656
- instructionsPointOfInterest: r.instructionsPointOfInterest || void 0,
657
- instructionsMovementReport: r.instructionsMovementReport || void 0,
658
- laterality: r.laterality,
659
- activityKind: r.activityKind,
660
- sensorLocations: r.sensorLocations,
661
- thresholds: r.thresholds.map((U) => ({
655
+ description: a.description || void 0,
656
+ instructionsPointOfInterest: a.instructionsPointOfInterest || void 0,
657
+ instructionsMovementReport: a.instructionsMovementReport || void 0,
658
+ laterality: a.laterality,
659
+ activityKind: a.activityKind,
660
+ sensorLocations: a.sensorLocations,
661
+ thresholds: a.thresholds.map((U) => ({
662
662
  ...U,
663
663
  id: void 0
664
664
  })),
665
- categories: o?.map((U) => U.id),
666
- quantumOwned: d,
667
- metadataItemIds: P,
665
+ categories: s?.map((U) => U.id),
666
+ quantumOwned: u,
667
+ metadataItemIds: D,
668
668
  id: void 0
669
- }, Q = await F({ fields: W });
670
- if (Q.error)
671
- throw new Error(Q.error.message);
672
- if (Q.data?.createAction)
673
- return _(me, Q.data.createAction);
669
+ }, q = await T({ fields: W });
670
+ if (q.error)
671
+ throw new Error(q.error.message);
672
+ if (q.data?.createAction)
673
+ return P(pe, q.data.createAction);
674
674
  throw new Error("No action data returned");
675
675
  },
676
- [F, d]
677
- ), g = R(
678
- async (r) => {
679
- const o = await N({ id: r.id });
680
- if (o.error)
681
- throw new Error(o.error.message);
682
- if (o.data?.convertActionToQuantumOwned)
683
- return _(
684
- me,
685
- o.data.convertActionToQuantumOwned
676
+ [T, u]
677
+ ), j = F(
678
+ async (a) => {
679
+ const s = await $({ id: a.id });
680
+ if (s.error)
681
+ throw new Error(s.error.message);
682
+ if (s.data?.convertActionToQuantumOwned)
683
+ return P(
684
+ pe,
685
+ s.data.convertActionToQuantumOwned
686
686
  );
687
687
  throw new Error("No action data returned");
688
688
  },
689
- [N]
690
- ), I = R(async () => {
691
- if (C(!0), !$.length) {
692
- const r = new Error(
693
- `No ${x.pluralLowerCase} selected for ${h === "copy" ? "copying" : "converting"}`
689
+ [$]
690
+ ), N = F(async () => {
691
+ if (h(!0), !R.length) {
692
+ const a = new Error(
693
+ `No ${c.pluralLowerCase} selected for ${p === "copy" ? "copying" : "converting"}`
694
694
  );
695
- a?.(r), C(!1);
695
+ o?.(a), h(!1);
696
696
  return;
697
697
  }
698
698
  try {
699
- const r = [];
700
- let o = 0;
701
- const w = h === "copy" ? J : g, P = h === "copy" ? "copy" : "convert";
702
- for (const W of $)
699
+ const a = [];
700
+ let s = 0;
701
+ const L = p === "copy" ? I : j, D = p === "copy" ? "copy" : "convert";
702
+ for (const W of R)
703
703
  try {
704
- const Q = await w(W);
705
- r.push(Q);
706
- } catch (Q) {
704
+ const q = await L(W);
705
+ a.push(q);
706
+ } catch (q) {
707
707
  console.error(
708
- `Failed to ${P} ${x.singularLowerCase} "${W.name}":`,
709
- Q
710
- ), o++;
708
+ `Failed to ${D} ${c.singularLowerCase} "${W.name}":`,
709
+ q
710
+ ), s++;
711
711
  }
712
- if (r.length > 0) {
713
- const W = r.length, Q = $.length, U = h === "copy" ? "copied" : "converted", te = h === "copy" ? "copy" : "convert";
714
- m({
715
- title: o > 0 ? `Partial ${te} completed` : `${x.plural} ${U} successfully`,
716
- description: o > 0 ? `${W} of ${Q} ${x.pluralLowerCase} ${U} successfully` : `${W} ${W > 1 ? x.pluralLowerCase : x.singularLowerCase} ${U} successfully`,
717
- status: o > 0 ? "warning" : "success",
712
+ if (a.length > 0) {
713
+ const W = a.length, q = R.length, U = p === "copy" ? "copied" : "converted", te = p === "copy" ? "copy" : "convert";
714
+ g({
715
+ title: s > 0 ? `Partial ${te} completed` : `${c.plural} ${U} successfully`,
716
+ description: s > 0 ? `${W} of ${q} ${c.pluralLowerCase} ${U} successfully` : `${W} ${W > 1 ? c.pluralLowerCase : c.singularLowerCase} ${U} successfully`,
717
+ status: s > 0 ? "warning" : "success",
718
718
  duration: 3e3,
719
719
  isClosable: !0
720
- }), n?.(), L(""), s([]);
720
+ }), n?.(), S(""), l([]);
721
721
  } else
722
722
  throw new Error(
723
- `Failed to ${P} any ${x.pluralLowerCase}`
723
+ `Failed to ${D} any ${c.pluralLowerCase}`
724
724
  );
725
- } catch (r) {
726
- const o = h === "copy" ? "copy" : "convert", w = r instanceof Error ? r.message : `Failed to ${o} ${x.pluralLowerCase}`;
727
- m({
728
- title: `${h === "copy" ? "Copy" : "Convert"} failed`,
729
- description: w,
725
+ } catch (a) {
726
+ const s = p === "copy" ? "copy" : "convert", L = a instanceof Error ? a.message : `Failed to ${s} ${c.pluralLowerCase}`;
727
+ g({
728
+ title: `${p === "copy" ? "Copy" : "Convert"} failed`,
729
+ description: L,
730
730
  status: "error",
731
731
  duration: 5e3,
732
732
  isClosable: !0
733
- }), a?.(r instanceof Error ? r : new Error(w));
733
+ }), o?.(a instanceof Error ? a : new Error(L));
734
734
  } finally {
735
- C(!1);
735
+ h(!1);
736
736
  }
737
737
  }, [
738
- $,
739
- h,
740
- J,
738
+ R,
739
+ p,
740
+ I,
741
+ j,
741
742
  g,
742
- m,
743
743
  n,
744
- a
745
- ]), y = R(() => {
746
- L(""), s([]), T("copy"), t?.();
744
+ o
745
+ ]), v = F(() => {
746
+ S(""), l([]), A("copy"), t?.();
747
747
  }, [t]);
748
748
  ae(() => {
749
- u && u({
749
+ m && m({
750
750
  cancelButton: !1,
751
- saveButton: $.length === 0 || f
751
+ saveButton: R.length === 0 || f
752
752
  });
753
- }, [$.length, f, u]), ae(() => {
753
+ }, [R.length, f, m]), ae(() => {
754
754
  i && i({
755
- cancelButton: y,
756
- saveButton: I
755
+ cancelButton: v,
756
+ saveButton: N
757
757
  });
758
- }, [i, y, I]);
759
- const D = A(() => B.map((r) => ({
760
- value: r.id,
761
- label: r.name
762
- })), [B]), X = A(() => k.filter((r) => h === "copy" ? !0 : !r.quantumOwned).map((r) => ({
763
- value: r.id,
764
- label: r.name,
758
+ }, [i, v, N]);
759
+ const E = M(() => B.map((a) => ({
760
+ value: a.id,
761
+ label: a.name
762
+ })), [B]), X = M(() => k.filter((a) => p === "copy" ? !0 : !a.quantumOwned).map((a) => ({
763
+ value: a.id,
764
+ label: a.name,
765
765
  // Add custom data to identify quantum-owned actions for UI display
766
- isQuantumOwned: r.quantumOwned
767
- })), [k, h]), Z = j.fetching, E = S.fetching;
768
- return /* @__PURE__ */ e.jsx(V, { children: /* @__PURE__ */ e.jsxs(oe, { spacing: 6, align: "stretch", children: [
769
- d && /* @__PURE__ */ e.jsxs(K, { children: [
766
+ isQuantumOwned: a.quantumOwned
767
+ })), [k, p]), Q = C.fetching, se = y.fetching;
768
+ return /* @__PURE__ */ e.jsx(K, { children: /* @__PURE__ */ e.jsxs(oe, { spacing: 6, align: "stretch", children: [
769
+ u && /* @__PURE__ */ e.jsxs(Z, { children: [
770
770
  /* @__PURE__ */ e.jsx(ce, { children: "Operation Mode" }),
771
771
  /* @__PURE__ */ e.jsx(
772
772
  nt,
773
773
  {
774
- value: h,
775
- onChange: (r) => {
776
- T(r), s([]);
774
+ value: p,
775
+ onChange: (a) => {
776
+ A(a), l([]);
777
777
  },
778
778
  children: /* @__PURE__ */ e.jsxs(re, { spacing: 6, children: [
779
779
  /* @__PURE__ */ e.jsx(Ne, { value: "copy", colorScheme: "blue", children: /* @__PURE__ */ e.jsxs(oe, { align: "start", spacing: 1, children: [
780
- /* @__PURE__ */ e.jsxs(v, { fontWeight: "medium", children: [
780
+ /* @__PURE__ */ e.jsxs(w, { fontWeight: "medium", children: [
781
781
  "Copy ",
782
- x.plural
782
+ c.plural
783
783
  ] }),
784
- /* @__PURE__ */ e.jsxs(v, { fontSize: "sm", color: "gray.600", children: [
784
+ /* @__PURE__ */ e.jsxs(w, { fontSize: "sm", color: "gray.600", children: [
785
785
  "Create new ",
786
- x.plural.toLocaleLowerCase(),
786
+ c.plural.toLocaleLowerCase(),
787
787
  " ",
788
788
  "based on selected ones"
789
789
  ] })
790
790
  ] }) }),
791
791
  /* @__PURE__ */ e.jsx(Ne, { value: "convert", colorScheme: "green", children: /* @__PURE__ */ e.jsxs(oe, { align: "start", spacing: 1, children: [
792
- /* @__PURE__ */ e.jsxs(v, { fontWeight: "medium", children: [
792
+ /* @__PURE__ */ e.jsxs(w, { fontWeight: "medium", children: [
793
793
  "Convert to Quantum Owned ",
794
- x.singular
794
+ c.singular
795
795
  ] }),
796
- /* @__PURE__ */ e.jsxs(v, { fontSize: "sm", color: "gray.600", children: [
796
+ /* @__PURE__ */ e.jsxs(w, { fontSize: "sm", color: "gray.600", children: [
797
797
  "Convert existing",
798
798
  " ",
799
- x.plural.toLocaleLowerCase(),
799
+ c.plural.toLocaleLowerCase(),
800
800
  " to quantum-owned"
801
801
  ] })
802
802
  ] }) })
@@ -804,88 +804,88 @@ const tn = ({
804
804
  }
805
805
  )
806
806
  ] }),
807
- /* @__PURE__ */ e.jsxs(K, { children: [
807
+ /* @__PURE__ */ e.jsxs(Z, { children: [
808
808
  /* @__PURE__ */ e.jsx(ce, { children: "Select Source Group" }),
809
809
  /* @__PURE__ */ e.jsx(
810
810
  de,
811
811
  {
812
812
  placeholder: "Choose a group...",
813
- options: D,
814
- value: D.find((r) => r.value === p) || null,
815
- onChange: M,
816
- isLoading: Z,
817
- isDisabled: Z,
813
+ options: E,
814
+ value: E.find((a) => a.value === x) || null,
815
+ onChange: G,
816
+ isLoading: Q,
817
+ isDisabled: Q,
818
818
  isClearable: !0
819
819
  }
820
820
  ),
821
- j.error && /* @__PURE__ */ e.jsxs(ke, { status: "error", mt: 2, children: [
822
- /* @__PURE__ */ e.jsx($e, {}),
823
- /* @__PURE__ */ e.jsxs(v, { fontSize: "sm", children: [
821
+ C.error && /* @__PURE__ */ e.jsxs($e, { status: "error", mt: 2, children: [
822
+ /* @__PURE__ */ e.jsx(ke, {}),
823
+ /* @__PURE__ */ e.jsxs(w, { fontSize: "sm", children: [
824
824
  "Failed to load groups: ",
825
- j.error.message
825
+ C.error.message
826
826
  ] })
827
827
  ] })
828
828
  ] }),
829
- p && /* @__PURE__ */ e.jsxs(K, { children: [
829
+ x && /* @__PURE__ */ e.jsxs(Z, { children: [
830
830
  /* @__PURE__ */ e.jsxs(ce, { children: [
831
831
  "Select ",
832
- x.plural,
832
+ c.plural,
833
833
  " to",
834
834
  " ",
835
- h === "copy" ? "Copy" : "Convert"
835
+ p === "copy" ? "Copy" : "Convert"
836
836
  ] }),
837
- E ? /* @__PURE__ */ e.jsxs(re, { children: [
837
+ se ? /* @__PURE__ */ e.jsxs(re, { children: [
838
838
  /* @__PURE__ */ e.jsx(st, { size: "sm" }),
839
- /* @__PURE__ */ e.jsxs(v, { fontSize: "sm", color: "gray.600", children: [
839
+ /* @__PURE__ */ e.jsxs(w, { fontSize: "sm", color: "gray.600", children: [
840
840
  "Loading ",
841
- x.pluralLowerCase,
841
+ c.pluralLowerCase,
842
842
  "..."
843
843
  ] })
844
844
  ] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
845
845
  /* @__PURE__ */ e.jsx(
846
846
  de,
847
847
  {
848
- placeholder: `Choose ${x.pluralLowerCase} to ${h}...`,
848
+ placeholder: `Choose ${c.pluralLowerCase} to ${p}...`,
849
849
  options: X,
850
850
  value: X.filter(
851
- (r) => b.includes(r.value)
851
+ (a) => b.includes(a.value)
852
852
  ),
853
- onChange: se,
853
+ onChange: ee,
854
854
  isDisabled: X.length === 0,
855
855
  isClearable: !0,
856
856
  isMulti: !0,
857
857
  closeMenuOnSelect: !1,
858
- formatOptionLabel: (r, { context: o }) => /* @__PURE__ */ e.jsxs(re, { justify: "space-between", w: "100%", children: [
858
+ formatOptionLabel: (a, { context: s }) => /* @__PURE__ */ e.jsxs(re, { justify: "space-between", w: "100%", children: [
859
859
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
860
- /* @__PURE__ */ e.jsx(v, { children: r.label }),
861
- o === "value" && r.isQuantumOwned && /* @__PURE__ */ e.jsx(v, { color: "blue", fontSize: "xs", children: "(Quantum Owned)" })
860
+ /* @__PURE__ */ e.jsx(w, { children: a.label }),
861
+ s === "value" && a.isQuantumOwned && /* @__PURE__ */ e.jsx(w, { color: "blue", fontSize: "xs", children: "(Quantum Owned)" })
862
862
  ] }),
863
- r.isQuantumOwned && o === "menu" && /* @__PURE__ */ e.jsx(ve, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
863
+ a.isQuantumOwned && s === "menu" && /* @__PURE__ */ e.jsx(ve, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
864
864
  ] })
865
865
  }
866
866
  ),
867
- X.length === 0 && /* @__PURE__ */ e.jsxs(v, { fontSize: "sm", color: "gray.500", mt: 2, children: [
867
+ X.length === 0 && /* @__PURE__ */ e.jsxs(w, { fontSize: "sm", color: "gray.500", mt: 2, children: [
868
868
  "No ",
869
- x.pluralLowerCase,
869
+ c.pluralLowerCase,
870
870
  " found"
871
871
  ] })
872
872
  ] }),
873
- S.error && /* @__PURE__ */ e.jsxs(ke, { status: "error", mt: 2, children: [
874
- /* @__PURE__ */ e.jsx($e, {}),
875
- /* @__PURE__ */ e.jsxs(v, { fontSize: "sm", children: [
873
+ y.error && /* @__PURE__ */ e.jsxs($e, { status: "error", mt: 2, children: [
874
+ /* @__PURE__ */ e.jsx(ke, {}),
875
+ /* @__PURE__ */ e.jsxs(w, { fontSize: "sm", children: [
876
876
  "Failed to load ",
877
- x.pluralLowerCase,
877
+ c.pluralLowerCase,
878
878
  ":",
879
879
  " ",
880
- S.error.message
880
+ y.error.message
881
881
  ] })
882
882
  ] })
883
883
  ] }),
884
- $.length > 0 && /* @__PURE__ */ e.jsxs(V, { p: 4, bg: "gray.50", borderRadius: "md", children: [
885
- /* @__PURE__ */ e.jsx(v, { fontWeight: "semibold", mb: 3, children: $.length === 1 ? `${x.singular} to ${h === "copy" ? "Copy" : "Convert"}:` : `${$.length} ${x.plural} to ${h === "copy" ? "Copy" : "Convert"}:` }),
884
+ R.length > 0 && /* @__PURE__ */ e.jsxs(K, { p: 4, bg: "gray.50", borderRadius: "md", children: [
885
+ /* @__PURE__ */ e.jsx(w, { fontWeight: "semibold", mb: 3, children: R.length === 1 ? `${c.singular} to ${p === "copy" ? "Copy" : "Convert"}:` : `${R.length} ${c.plural} to ${p === "copy" ? "Copy" : "Convert"}:` }),
886
886
  /* @__PURE__ */ e.jsxs(oe, { align: "start", spacing: 3, children: [
887
- $.map((r, o) => /* @__PURE__ */ e.jsxs(
888
- V,
887
+ R.map((a, s) => /* @__PURE__ */ e.jsxs(
888
+ K,
889
889
  {
890
890
  w: "100%",
891
891
  p: 3,
@@ -895,12 +895,12 @@ const tn = ({
895
895
  borderColor: "gray.200",
896
896
  children: [
897
897
  /* @__PURE__ */ e.jsxs(re, { justify: "space-between", align: "start", mb: 2, children: [
898
- /* @__PURE__ */ e.jsxs(v, { fontWeight: "medium", fontSize: "sm", children: [
899
- o + 1,
898
+ /* @__PURE__ */ e.jsxs(w, { fontWeight: "medium", fontSize: "sm", children: [
899
+ s + 1,
900
900
  ". ",
901
- r.name
901
+ a.name
902
902
  ] }),
903
- r.quantumOwned && /* @__PURE__ */ e.jsx(ve, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
903
+ a.quantumOwned && /* @__PURE__ */ e.jsx(ve, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
904
904
  ] }),
905
905
  /* @__PURE__ */ e.jsxs(
906
906
  oe,
@@ -910,45 +910,45 @@ const tn = ({
910
910
  fontSize: "sm",
911
911
  color: "gray.600",
912
912
  children: [
913
- r.description && /* @__PURE__ */ e.jsxs(v, { children: [
913
+ a.description && /* @__PURE__ */ e.jsxs(w, { children: [
914
914
  /* @__PURE__ */ e.jsx("strong", { children: "Description:" }),
915
915
  " ",
916
- r.description
916
+ a.description
917
917
  ] }),
918
- /* @__PURE__ */ e.jsxs(v, { children: [
918
+ /* @__PURE__ */ e.jsxs(w, { children: [
919
919
  /* @__PURE__ */ e.jsx("strong", { children: "Type:" }),
920
920
  " ",
921
- r.activityKind
921
+ a.activityKind
922
922
  ] }),
923
- /* @__PURE__ */ e.jsxs(v, { children: [
923
+ /* @__PURE__ */ e.jsxs(w, { children: [
924
924
  /* @__PURE__ */ e.jsx("strong", { children: "Laterality:" }),
925
925
  " ",
926
- r.laterality
926
+ a.laterality
927
927
  ] }),
928
- /* @__PURE__ */ e.jsxs(v, { children: [
928
+ /* @__PURE__ */ e.jsxs(w, { children: [
929
929
  /* @__PURE__ */ e.jsx("strong", { children: "Sensor Locations:" }),
930
930
  " ",
931
- r.sensorLocations.length
931
+ a.sensorLocations.length
932
932
  ] }),
933
- /* @__PURE__ */ e.jsxs(v, { children: [
933
+ /* @__PURE__ */ e.jsxs(w, { children: [
934
934
  /* @__PURE__ */ e.jsx("strong", { children: "Thresholds:" }),
935
935
  " ",
936
- r.thresholds.length
936
+ a.thresholds.length
937
937
  ] }),
938
- /* @__PURE__ */ e.jsxs(v, { children: [
938
+ /* @__PURE__ */ e.jsxs(w, { children: [
939
939
  /* @__PURE__ */ e.jsx("strong", { children: "Use Cases:" }),
940
940
  " ",
941
- r.useCases.map((w) => w.name).join(", ") || "None"
941
+ a.useCases.map((L) => L.name).join(", ") || "None"
942
942
  ] })
943
943
  ]
944
944
  }
945
945
  )
946
946
  ]
947
947
  },
948
- r.id
948
+ a.id
949
949
  )),
950
- $.length > 1 && /* @__PURE__ */ e.jsx(
951
- V,
950
+ R.length > 1 && /* @__PURE__ */ e.jsx(
951
+ K,
952
952
  {
953
953
  w: "100%",
954
954
  p: 2,
@@ -956,41 +956,41 @@ const tn = ({
956
956
  borderRadius: "md",
957
957
  border: "1px solid",
958
958
  borderColor: "blue.200",
959
- children: /* @__PURE__ */ e.jsxs(v, { fontSize: "sm", fontWeight: "medium", color: "blue.800", children: [
959
+ children: /* @__PURE__ */ e.jsxs(w, { fontSize: "sm", fontWeight: "medium", color: "blue.800", children: [
960
960
  "Total: ",
961
- $.length,
961
+ R.length,
962
962
  " ",
963
- x.pluralLowerCase,
963
+ c.pluralLowerCase,
964
964
  " will be",
965
965
  " ",
966
- h === "copy" ? "copied" : "converted"
966
+ p === "copy" ? "copied" : "converted"
967
967
  ] })
968
968
  }
969
969
  )
970
970
  ] })
971
971
  ] }),
972
- !c && /* @__PURE__ */ e.jsxs(be, { spacing: 4, justifyContent: "flex-end", children: [
972
+ !d && /* @__PURE__ */ e.jsxs(be, { spacing: 4, justifyContent: "flex-end", children: [
973
973
  /* @__PURE__ */ e.jsx(
974
- ee,
974
+ V,
975
975
  {
976
976
  variant: "outline",
977
- onClick: y,
977
+ onClick: v,
978
978
  isDisabled: f,
979
979
  children: "Cancel"
980
980
  }
981
981
  ),
982
982
  /* @__PURE__ */ e.jsxs(
983
- ee,
983
+ V,
984
984
  {
985
- colorScheme: h === "copy" ? "blue" : "green",
986
- onClick: I,
987
- isDisabled: $.length === 0 || f,
985
+ colorScheme: p === "copy" ? "blue" : "green",
986
+ onClick: N,
987
+ isDisabled: R.length === 0 || f,
988
988
  isLoading: f,
989
- loadingText: `${h === "copy" ? "Copying" : "Converting"}...`,
989
+ loadingText: `${p === "copy" ? "Copying" : "Converting"}...`,
990
990
  children: [
991
- h === "copy" ? "Copy" : "Convert",
991
+ p === "copy" ? "Copy" : "Convert",
992
992
  " ",
993
- $.length === 1 ? x.singular : `${$.length} ${x.plural}`
993
+ R.length === 1 ? c.singular : `${R.length} ${c.plural}`
994
994
  ]
995
995
  }
996
996
  )
@@ -999,244 +999,245 @@ const tn = ({
999
999
  }, Bn = ({
1000
1000
  onSave: n,
1001
1001
  onCancel: t,
1002
- onError: a,
1003
- hideButtons: c = !1,
1004
- setButtonDisabled: u,
1002
+ onError: o,
1003
+ hideButtons: d = !1,
1004
+ setButtonDisabled: m,
1005
1005
  setButtonOnClick: i,
1006
- quantumOwned: d
1006
+ quantumOwned: u
1007
1007
  }) => {
1008
- const m = tt(), { getLabel: l } = pe(), [x, h] = z(""), [T, p] = z([]), [L, b] = z(!1), [s, f] = z("copy"), [C] = he({
1008
+ const g = tt(), { getLabel: r } = ue(), c = M(() => ({
1009
+ singular: r("module"),
1010
+ plural: r("module_plural"),
1011
+ pluralLowerCase: r("module_plural").toLowerCase(),
1012
+ singularLowerCase: r("module").toLowerCase()
1013
+ }), [r]), p = M(() => ({
1014
+ singular: r("action"),
1015
+ plural: r("action_plural"),
1016
+ pluralLowerCase: r("action_plural").toLowerCase(),
1017
+ singularLowerCase: r("action").toLowerCase()
1018
+ }), [r]), [A, x] = _(""), [S, b] = _([]), [l, f] = _(!1), [h, C] = _("copy"), [y] = me({
1009
1019
  query: rt
1010
- }), [j] = he({
1020
+ }), [T] = me({
1011
1021
  query: Pt,
1012
- variables: { groupId: x },
1013
- pause: !x
1022
+ variables: { groupId: A },
1023
+ pause: !A
1014
1024
  // Only run when group is selected
1015
- }), [, S] = ie(it), [, F] = ie(ct), [, N] = ie(ze), [, B] = ie(
1025
+ }), [, $] = ie(it), [, B] = ie(ct), [, k] = ie(ze), [, R] = ie(
1016
1026
  at
1017
- ), k = A(() => C.data?.groups ? C.data.groups.map(
1018
- (o) => _(lt, o)
1019
- ) : [], [C.data]), $ = A(() => j.data?.modules ? _(
1027
+ ), G = M(() => y.data?.groups ? y.data.groups.map(
1028
+ (s) => P(lt, s)
1029
+ ) : [], [y.data]), ee = M(() => T.data?.modules ? P(
1020
1030
  Te,
1021
- j.data?.modules
1022
- ).map((w) => {
1023
- const P = _(
1031
+ T.data?.modules
1032
+ ).map((L) => {
1033
+ const D = P(
1024
1034
  dt,
1025
- w.moduleActions
1035
+ L.moduleActions
1026
1036
  );
1027
1037
  return {
1028
- ...w,
1029
- moduleActions: P.map((W) => ({
1038
+ ...L,
1039
+ moduleActions: D.map((W) => ({
1030
1040
  ...W,
1031
- action: _(me, W.action)
1041
+ action: P(pe, W.action)
1032
1042
  })),
1033
- categories: _(
1043
+ categories: P(
1034
1044
  we,
1035
- w.categories
1045
+ L.categories
1036
1046
  )
1037
1047
  };
1038
- }) : [], [j.data]), M = A(() => $.filter(
1039
- (o) => T.includes(o.id)
1040
- ), [$, T]), se = R(
1041
- (o) => {
1042
- const w = o?.value || "";
1043
- h(w), p([]);
1048
+ }) : [], [T.data]), I = M(() => ee.filter(
1049
+ (s) => S.includes(s.id)
1050
+ ), [ee, S]), j = F(
1051
+ (s) => {
1052
+ const L = s?.value || "";
1053
+ x(L), b([]);
1044
1054
  },
1045
1055
  []
1046
- ), J = R(
1047
- (o) => {
1048
- const w = o.map((P) => P.value);
1049
- p(w);
1056
+ ), N = F(
1057
+ (s) => {
1058
+ const L = s.map((D) => D.value);
1059
+ b(L);
1050
1060
  },
1051
1061
  []
1052
- ), g = R(async () => {
1053
- if (b(!0), !M.length) {
1054
- b(!1);
1055
- const o = new Error(
1056
- `No modules selected for ${s === "convert" ? "converting" : "copying"}`
1062
+ ), v = F(async () => {
1063
+ if (f(!0), !I.length) {
1064
+ f(!1);
1065
+ const s = new Error(
1066
+ `No modules selected for ${h === "convert" ? "converting" : "copying"}`
1057
1067
  );
1058
- a?.(o);
1068
+ o?.(s);
1059
1069
  return;
1060
1070
  }
1061
1071
  try {
1062
- const o = [];
1063
- let w = 0;
1064
- for (const P of M)
1072
+ const s = [];
1073
+ let L = 0;
1074
+ for (const D of I)
1065
1075
  try {
1066
- let W = P.moduleActions.map((Q) => Q.actionId);
1067
- if (d) {
1068
- const Q = P.moduleActions.map((Y) => Y.action), U = async (Y) => {
1069
- if (s === "copy") {
1070
- if (Y.quantumOwned) return Y;
1071
- const O = _(
1076
+ let W = D.moduleActions.map((q) => q.actionId);
1077
+ if (u) {
1078
+ const q = D.moduleActions.map((H) => H.action), U = async (H) => {
1079
+ if (h === "copy") {
1080
+ if (H.quantumOwned) return H;
1081
+ const O = P(
1072
1082
  we,
1073
- Y.categories
1074
- ), H = {
1075
- ...Y,
1083
+ H.categories
1084
+ ), J = {
1085
+ ...H,
1076
1086
  quantumOwned: !0,
1077
- thresholds: Y.thresholds.map((ne) => ({
1087
+ thresholds: H.thresholds.map((ne) => ({
1078
1088
  ...ne,
1079
1089
  id: void 0
1080
1090
  })),
1081
1091
  categories: O?.map((ne) => ne.id),
1082
1092
  id: void 0
1083
- }, q = await N({ fields: H });
1084
- return q.error || !q.data?.createAction ? null : _(
1085
- me,
1086
- q.data.createAction
1093
+ }, Y = await k({ fields: J });
1094
+ return Y.error || !Y.data?.createAction ? null : P(
1095
+ pe,
1096
+ Y.data.createAction
1087
1097
  );
1088
1098
  }
1089
- if (Y.quantumOwned) return Y;
1090
- const Ce = await B({
1091
- id: Y.id
1099
+ if (H.quantumOwned) return H;
1100
+ const Ce = await R({
1101
+ id: H.id
1092
1102
  });
1093
- return Ce.error || !Ce.data?.convertActionToQuantumOwned ? null : _(
1094
- me,
1103
+ return Ce.error || !Ce.data?.convertActionToQuantumOwned ? null : P(
1104
+ pe,
1095
1105
  Ce.data.convertActionToQuantumOwned
1096
1106
  );
1097
1107
  };
1098
1108
  W = (await Promise.all(
1099
- Q.map(U)
1100
- )).filter((Y) => !!Y).map((Y) => Y.id);
1109
+ q.map(U)
1110
+ )).filter((H) => !!H).map((H) => H.id);
1101
1111
  }
1102
- if (s === "convert") {
1103
- const Q = {
1104
- name: P.name,
1105
- description: P.description || void 0,
1112
+ if (h === "convert") {
1113
+ const q = {
1114
+ name: D.name,
1115
+ description: D.description || void 0,
1106
1116
  actions: W,
1107
- categories: P.categories.map((te) => te.id),
1117
+ categories: D.categories.map((te) => te.id),
1108
1118
  quantumOwned: !0
1109
- }, U = await F({
1110
- id: P.id,
1111
- input: Q
1119
+ }, U = await B({
1120
+ id: D.id,
1121
+ input: q
1112
1122
  });
1113
1123
  if (U.error) throw new Error(U.error.message);
1114
1124
  if (U.data?.updateModule) {
1115
- const te = _(
1125
+ const te = P(
1116
1126
  Te,
1117
1127
  U.data.updateModule
1118
1128
  );
1119
- o.push(te);
1129
+ s.push(te);
1120
1130
  }
1121
1131
  } else {
1122
- const Q = {
1123
- name: `${P.name} (Copy)`,
1124
- description: P.description || void 0,
1132
+ const q = {
1133
+ name: `${D.name} (Copy)`,
1134
+ description: D.description || void 0,
1125
1135
  actions: W,
1126
- categories: P.categories.map((te) => te.id),
1127
- quantumOwned: d
1128
- }, U = await S({ input: Q });
1136
+ categories: D.categories.map((te) => te.id),
1137
+ quantumOwned: u
1138
+ }, U = await $({ input: q });
1129
1139
  if (U.error) throw new Error(U.error.message);
1130
1140
  if (U.data?.createModule) {
1131
- const te = _(
1141
+ const te = P(
1132
1142
  Te,
1133
1143
  U.data.createModule
1134
1144
  );
1135
- o.push(te);
1145
+ s.push(te);
1136
1146
  }
1137
1147
  }
1138
1148
  } catch (W) {
1139
1149
  console.error(
1140
- `Failed to ${s === "convert" ? "convert" : "copy"} module "${P.name}":`,
1150
+ `Failed to ${h === "convert" ? "convert" : "copy"} module "${D.name}":`,
1141
1151
  W
1142
- ), w++;
1152
+ ), L++;
1143
1153
  }
1144
- if (o.length > 0) {
1145
- const P = o.length, W = M.length;
1146
- m({
1147
- title: w > 0 ? `Partial ${s === "convert" ? "convert" : "copy"} completed` : `Modules ${s === "convert" ? "converted" : "copied"} successfully`,
1148
- description: w > 0 ? `${P} of ${W} modules ${s === "convert" ? "converted" : "copied"} successfully` : `${P} module${P > 1 ? "s" : ""} ${s === "convert" ? "converted" : "copied"} successfully`,
1149
- status: w > 0 ? "warning" : "success",
1154
+ if (s.length > 0) {
1155
+ const D = s.length, W = I.length;
1156
+ g({
1157
+ title: L > 0 ? `Partial ${h === "convert" ? "convert" : "copy"} completed` : `${c.plural} ${h === "convert" ? "converted" : "copied"} successfully`,
1158
+ description: L > 0 ? `${D} of ${W} ${c.plural} ${h === "convert" ? "converted" : "copied"} successfully` : `${D} ${D > 1 ? c.plural : c.singular} ${h === "convert" ? "converted" : "copied"} successfully`,
1159
+ status: L > 0 ? "warning" : "success",
1150
1160
  duration: 3e3,
1151
1161
  isClosable: !0
1152
- }), o.length > 0 && n?.(), h(""), p([]);
1162
+ }), s.length > 0 && n?.(), x(""), b([]);
1153
1163
  } else
1154
1164
  throw new Error(
1155
- `Failed to ${s === "convert" ? "convert" : "copy"} any modules`
1165
+ `Failed to ${h === "convert" ? "convert" : "copy"} any modules`
1156
1166
  );
1157
- } catch (o) {
1158
- const w = o instanceof Error ? o.message : `Failed to ${s === "convert" ? "convert" : "copy"} modules`;
1159
- m({
1160
- title: s === "convert" ? "Convert failed" : "Copy failed",
1161
- description: w,
1167
+ } catch (s) {
1168
+ const L = s instanceof Error ? s.message : `Failed to ${h === "convert" ? "convert" : "copy"} modules`;
1169
+ g({
1170
+ title: h === "convert" ? "Convert failed" : "Copy failed",
1171
+ description: L,
1162
1172
  status: "error",
1163
1173
  duration: 5e3,
1164
1174
  isClosable: !0
1165
- }), a?.(o instanceof Error ? o : new Error(w));
1175
+ }), o?.(s instanceof Error ? s : new Error(L));
1166
1176
  } finally {
1167
- b(!1);
1177
+ f(!1);
1168
1178
  }
1169
1179
  }, [
1170
- M,
1171
- S,
1172
- F,
1173
- m,
1174
- n,
1175
- a,
1176
- d,
1177
- N,
1180
+ I,
1181
+ $,
1178
1182
  B,
1179
- s
1180
- ]), I = R(() => {
1181
- h(""), p([]), f("copy"), t?.();
1183
+ g,
1184
+ n,
1185
+ o,
1186
+ u,
1187
+ k,
1188
+ R,
1189
+ h,
1190
+ c
1191
+ ]), E = F(() => {
1192
+ x(""), b([]), C("copy"), t?.();
1182
1193
  }, [t]);
1183
1194
  ae(() => {
1184
- u && u({
1195
+ m && m({
1185
1196
  cancelButton: !1,
1186
- saveButton: M.length === 0 || L
1197
+ saveButton: I.length === 0 || l
1187
1198
  });
1188
- }, [M.length, L, u]), ae(() => {
1199
+ }, [I.length, l, m]), ae(() => {
1189
1200
  i && i({
1190
- cancelButton: I,
1191
- saveButton: g
1201
+ cancelButton: E,
1202
+ saveButton: v
1192
1203
  });
1193
- }, [i, I, g]);
1194
- const y = A(() => k.map((o) => ({
1195
- value: o.id,
1196
- label: o.name
1197
- })), [k]), D = A(() => $.filter((o) => s === "copy" ? !0 : !o.quantumOwned).map((o) => ({
1198
- value: o.id,
1199
- label: o.name,
1204
+ }, [i, E, v]);
1205
+ const X = M(() => G.map((s) => ({
1206
+ value: s.id,
1207
+ label: s.name
1208
+ })), [G]), Q = M(() => ee.filter((s) => h === "copy" ? !0 : !s.quantumOwned).map((s) => ({
1209
+ value: s.id,
1210
+ label: s.name,
1200
1211
  // Add custom data to identify quantum-owned modules
1201
- isQuantumOwned: o.quantumOwned
1202
- })), [$, s]), X = C.fetching, Z = j.fetching, E = A(() => ({
1203
- singular: l("module"),
1204
- plural: l("module_plural"),
1205
- pluralLowerCase: l("module_plural").toLowerCase(),
1206
- singularLowerCase: l("module").toLowerCase()
1207
- }), [l]), r = A(() => ({
1208
- singular: l("action"),
1209
- plural: l("action_plural"),
1210
- pluralLowerCase: l("action_plural").toLowerCase(),
1211
- singularLowerCase: l("action").toLowerCase()
1212
- }), [l]);
1213
- return /* @__PURE__ */ e.jsx(V, { children: /* @__PURE__ */ e.jsxs(oe, { spacing: 6, align: "stretch", children: [
1214
- d && /* @__PURE__ */ e.jsxs(K, { children: [
1212
+ isQuantumOwned: s.quantumOwned
1213
+ })), [ee, h]), se = y.fetching, a = T.fetching;
1214
+ return /* @__PURE__ */ e.jsx(K, { children: /* @__PURE__ */ e.jsxs(oe, { spacing: 6, align: "stretch", children: [
1215
+ u && /* @__PURE__ */ e.jsxs(Z, { children: [
1215
1216
  /* @__PURE__ */ e.jsx(ce, { children: "Operation Mode" }),
1216
1217
  /* @__PURE__ */ e.jsx(
1217
1218
  nt,
1218
1219
  {
1219
- value: s,
1220
- onChange: (o) => {
1221
- f(o), p([]);
1220
+ value: h,
1221
+ onChange: (s) => {
1222
+ C(s), b([]);
1222
1223
  },
1223
1224
  children: /* @__PURE__ */ e.jsxs(re, { spacing: 6, children: [
1224
1225
  /* @__PURE__ */ e.jsx(Ne, { value: "copy", colorScheme: "blue", children: /* @__PURE__ */ e.jsxs(oe, { align: "start", spacing: 1, children: [
1225
- /* @__PURE__ */ e.jsxs(v, { fontWeight: "medium", children: [
1226
+ /* @__PURE__ */ e.jsxs(w, { fontWeight: "medium", children: [
1226
1227
  "Copy ",
1227
- E.plural
1228
+ c.plural
1228
1229
  ] }),
1229
- /* @__PURE__ */ e.jsxs(v, { fontSize: "sm", color: "gray.600", children: [
1230
+ /* @__PURE__ */ e.jsxs(w, { fontSize: "sm", color: "gray.600", children: [
1230
1231
  "Create new ",
1231
- E.pluralLowerCase,
1232
+ c.pluralLowerCase,
1232
1233
  " based on selected ones"
1233
1234
  ] })
1234
1235
  ] }) }),
1235
1236
  /* @__PURE__ */ e.jsx(Ne, { value: "convert", colorScheme: "green", children: /* @__PURE__ */ e.jsxs(oe, { align: "start", spacing: 1, children: [
1236
- /* @__PURE__ */ e.jsx(v, { fontWeight: "medium", children: "Convert to Quantum Owned" }),
1237
- /* @__PURE__ */ e.jsxs(v, { fontSize: "sm", color: "gray.600", children: [
1237
+ /* @__PURE__ */ e.jsx(w, { fontWeight: "medium", children: "Convert to Quantum Owned" }),
1238
+ /* @__PURE__ */ e.jsxs(w, { fontSize: "sm", color: "gray.600", children: [
1238
1239
  "Convert existing ",
1239
- E.pluralLowerCase,
1240
+ c.pluralLowerCase,
1240
1241
  " to quantum-owned"
1241
1242
  ] })
1242
1243
  ] }) })
@@ -1244,82 +1245,82 @@ const tn = ({
1244
1245
  }
1245
1246
  )
1246
1247
  ] }),
1247
- /* @__PURE__ */ e.jsxs(K, { children: [
1248
+ /* @__PURE__ */ e.jsxs(Z, { children: [
1248
1249
  /* @__PURE__ */ e.jsx(ce, { children: "Select Source Group" }),
1249
1250
  /* @__PURE__ */ e.jsx(
1250
1251
  de,
1251
1252
  {
1252
1253
  placeholder: "Choose a group...",
1253
- options: y,
1254
- value: y.find((o) => o.value === x) || null,
1255
- onChange: se,
1256
- isLoading: X,
1257
- isDisabled: X,
1254
+ options: X,
1255
+ value: X.find((s) => s.value === A) || null,
1256
+ onChange: j,
1257
+ isLoading: se,
1258
+ isDisabled: se,
1258
1259
  isClearable: !0
1259
1260
  }
1260
1261
  ),
1261
- C.error && /* @__PURE__ */ e.jsxs(ke, { status: "error", mt: 2, children: [
1262
- /* @__PURE__ */ e.jsx($e, {}),
1263
- /* @__PURE__ */ e.jsxs(v, { fontSize: "sm", children: [
1262
+ y.error && /* @__PURE__ */ e.jsxs($e, { status: "error", mt: 2, children: [
1263
+ /* @__PURE__ */ e.jsx(ke, {}),
1264
+ /* @__PURE__ */ e.jsxs(w, { fontSize: "sm", children: [
1264
1265
  "Failed to load groups: ",
1265
- C.error.message
1266
+ y.error.message
1266
1267
  ] })
1267
1268
  ] })
1268
1269
  ] }),
1269
- x && /* @__PURE__ */ e.jsxs(K, { children: [
1270
- /* @__PURE__ */ e.jsx(ce, { children: s === "convert" ? `Select ${E.plural} to Convert` : `Select ${E.plural} to Copy` }),
1271
- Z ? /* @__PURE__ */ e.jsxs(re, { children: [
1270
+ A && /* @__PURE__ */ e.jsxs(Z, { children: [
1271
+ /* @__PURE__ */ e.jsx(ce, { children: h === "convert" ? `Select ${c.plural} to Convert` : `Select ${c.plural} to Copy` }),
1272
+ a ? /* @__PURE__ */ e.jsxs(re, { children: [
1272
1273
  /* @__PURE__ */ e.jsx(st, { size: "sm" }),
1273
- /* @__PURE__ */ e.jsxs(v, { fontSize: "sm", color: "gray.600", children: [
1274
+ /* @__PURE__ */ e.jsxs(w, { fontSize: "sm", color: "gray.600", children: [
1274
1275
  "Loading ",
1275
- E.pluralLowerCase,
1276
+ c.pluralLowerCase,
1276
1277
  "..."
1277
1278
  ] })
1278
1279
  ] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1279
1280
  /* @__PURE__ */ e.jsx(
1280
1281
  de,
1281
1282
  {
1282
- placeholder: s === "convert" ? `Choose ${E.pluralLowerCase} to convert...` : `Choose ${E.pluralLowerCase} to copy...`,
1283
- options: D,
1284
- value: D.filter(
1285
- (o) => T.includes(o.value)
1283
+ placeholder: h === "convert" ? `Choose ${c.pluralLowerCase} to convert...` : `Choose ${c.pluralLowerCase} to copy...`,
1284
+ options: Q,
1285
+ value: Q.filter(
1286
+ (s) => S.includes(s.value)
1286
1287
  ),
1287
- onChange: J,
1288
- isDisabled: D.length === 0,
1288
+ onChange: N,
1289
+ isDisabled: Q.length === 0,
1289
1290
  isClearable: !0,
1290
1291
  isMulti: !0,
1291
1292
  closeMenuOnSelect: !1,
1292
- formatOptionLabel: (o, { context: w }) => /* @__PURE__ */ e.jsxs(re, { justify: "space-between", w: "100%", children: [
1293
+ formatOptionLabel: (s, { context: L }) => /* @__PURE__ */ e.jsxs(re, { justify: "space-between", w: "100%", children: [
1293
1294
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
1294
- /* @__PURE__ */ e.jsx(v, { children: o.label }),
1295
- w === "value" && o.isQuantumOwned && /* @__PURE__ */ e.jsx(v, { color: "blue", fontSize: "xs", children: "(Quantum Owned)" })
1295
+ /* @__PURE__ */ e.jsx(w, { children: s.label }),
1296
+ L === "value" && s.isQuantumOwned && /* @__PURE__ */ e.jsx(w, { color: "blue", fontSize: "xs", children: "(Quantum Owned)" })
1296
1297
  ] }),
1297
- o.isQuantumOwned && w === "menu" && /* @__PURE__ */ e.jsx(ve, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
1298
+ s.isQuantumOwned && L === "menu" && /* @__PURE__ */ e.jsx(ve, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
1298
1299
  ] })
1299
1300
  }
1300
1301
  ),
1301
- D.length === 0 && /* @__PURE__ */ e.jsxs(v, { fontSize: "sm", color: "gray.500", mt: 2, children: [
1302
+ Q.length === 0 && /* @__PURE__ */ e.jsxs(w, { fontSize: "sm", color: "gray.500", mt: 2, children: [
1302
1303
  "No ",
1303
- E.pluralLowerCase,
1304
+ c.pluralLowerCase,
1304
1305
  " found in this group"
1305
1306
  ] })
1306
1307
  ] }),
1307
- j.error && /* @__PURE__ */ e.jsxs(ke, { status: "error", mt: 2, children: [
1308
- /* @__PURE__ */ e.jsx($e, {}),
1309
- /* @__PURE__ */ e.jsxs(v, { fontSize: "sm", children: [
1308
+ T.error && /* @__PURE__ */ e.jsxs($e, { status: "error", mt: 2, children: [
1309
+ /* @__PURE__ */ e.jsx(ke, {}),
1310
+ /* @__PURE__ */ e.jsxs(w, { fontSize: "sm", children: [
1310
1311
  "Failed to load ",
1311
- E.pluralLowerCase,
1312
+ c.pluralLowerCase,
1312
1313
  ":",
1313
1314
  " ",
1314
- j.error.message
1315
+ T.error.message
1315
1316
  ] })
1316
1317
  ] })
1317
1318
  ] }),
1318
- M.length > 0 && /* @__PURE__ */ e.jsxs(V, { p: 4, bg: "gray.50", borderRadius: "md", children: [
1319
- /* @__PURE__ */ e.jsx(v, { fontWeight: "semibold", mb: 3, children: M.length === 1 ? `${E.singular} to ${s === "copy" ? "Copy" : "Convert"}` : `${M.length} ${E.plural} to ${s === "copy" ? "Copy" : "Convert"}` }),
1319
+ I.length > 0 && /* @__PURE__ */ e.jsxs(K, { p: 4, bg: "gray.50", borderRadius: "md", children: [
1320
+ /* @__PURE__ */ e.jsx(w, { fontWeight: "semibold", mb: 3, children: I.length === 1 ? `${c.singular} to ${h === "copy" ? "Copy" : "Convert"}` : `${I.length} ${c.plural} to ${h === "copy" ? "Copy" : "Convert"}` }),
1320
1321
  /* @__PURE__ */ e.jsxs(oe, { align: "start", spacing: 3, children: [
1321
- M.map((o, w) => /* @__PURE__ */ e.jsxs(
1322
- V,
1322
+ I.map((s, L) => /* @__PURE__ */ e.jsxs(
1323
+ K,
1323
1324
  {
1324
1325
  w: "100%",
1325
1326
  p: 3,
@@ -1329,12 +1330,12 @@ const tn = ({
1329
1330
  borderColor: "gray.200",
1330
1331
  children: [
1331
1332
  /* @__PURE__ */ e.jsxs(re, { justify: "space-between", align: "start", mb: 2, children: [
1332
- /* @__PURE__ */ e.jsxs(v, { fontWeight: "medium", fontSize: "sm", children: [
1333
- w + 1,
1333
+ /* @__PURE__ */ e.jsxs(w, { fontWeight: "medium", fontSize: "sm", children: [
1334
+ L + 1,
1334
1335
  ". ",
1335
- o.name
1336
+ s.name
1336
1337
  ] }),
1337
- o.quantumOwned && /* @__PURE__ */ e.jsx(ve, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
1338
+ s.quantumOwned && /* @__PURE__ */ e.jsx(ve, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
1338
1339
  ] }),
1339
1340
  /* @__PURE__ */ e.jsxs(
1340
1341
  oe,
@@ -1344,30 +1345,30 @@ const tn = ({
1344
1345
  fontSize: "sm",
1345
1346
  color: "gray.600",
1346
1347
  children: [
1347
- o.description && /* @__PURE__ */ e.jsxs(v, { children: [
1348
+ s.description && /* @__PURE__ */ e.jsxs(w, { children: [
1348
1349
  /* @__PURE__ */ e.jsx("strong", { children: "Description:" }),
1349
1350
  " ",
1350
- o.description
1351
+ s.description
1351
1352
  ] }),
1352
- /* @__PURE__ */ e.jsxs(v, { children: [
1353
+ /* @__PURE__ */ e.jsxs(w, { children: [
1353
1354
  /* @__PURE__ */ e.jsx("strong", { children: "Activities:" }),
1354
1355
  " ",
1355
- o.moduleActions.length
1356
+ s.moduleActions.length
1356
1357
  ] }),
1357
- /* @__PURE__ */ e.jsxs(v, { children: [
1358
+ /* @__PURE__ */ e.jsxs(w, { children: [
1358
1359
  /* @__PURE__ */ e.jsx("strong", { children: "Categories:" }),
1359
1360
  " ",
1360
- o.categories.map((P) => P.name).join(", ") || "None"
1361
+ s.categories.map((D) => D.name).join(", ") || "None"
1361
1362
  ] })
1362
1363
  ]
1363
1364
  }
1364
1365
  )
1365
1366
  ]
1366
1367
  },
1367
- o.id
1368
+ s.id
1368
1369
  )),
1369
- M.length > 1 && /* @__PURE__ */ e.jsx(
1370
- V,
1370
+ I.length > 1 && /* @__PURE__ */ e.jsx(
1371
+ K,
1371
1372
  {
1372
1373
  w: "100%",
1373
1374
  p: 2,
@@ -1375,52 +1376,52 @@ const tn = ({
1375
1376
  borderRadius: "md",
1376
1377
  border: "1px solid",
1377
1378
  borderColor: "blue.200",
1378
- children: /* @__PURE__ */ e.jsxs(v, { fontSize: "sm", fontWeight: "medium", color: "blue.800", children: [
1379
+ children: /* @__PURE__ */ e.jsxs(w, { fontSize: "sm", fontWeight: "medium", color: "blue.800", children: [
1379
1380
  "Total: ",
1380
- M.length,
1381
+ I.length,
1381
1382
  " ",
1382
- E.pluralLowerCase,
1383
+ c.pluralLowerCase,
1383
1384
  " will be",
1384
1385
  " ",
1385
- s === "copy" ? "copied" : "converted"
1386
+ h === "copy" ? "copied" : "converted"
1386
1387
  ] })
1387
1388
  }
1388
1389
  ),
1389
- d && M.filter((o) => o.moduleActions.some((w) => !w.action.quantumOwned)).length > 0 && /* @__PURE__ */ e.jsx(
1390
- V,
1390
+ u && I.filter((s) => s.moduleActions.some((L) => !L.action.quantumOwned)).length > 0 && /* @__PURE__ */ e.jsx(
1391
+ K,
1391
1392
  {
1392
1393
  p: 2,
1393
1394
  bg: "yellow.50",
1394
1395
  borderRadius: "md",
1395
1396
  border: "1px solid",
1396
1397
  borderColor: "yellow.200",
1397
- children: /* @__PURE__ */ e.jsx(v, { fontSize: "sm", fontWeight: "medium", color: "yellow.800", children: s === "convert" ? `Converting ${E.plural} will convert non QM-Owned ${r.plural} to QM-Owned ${r.plural}` : `Copying ${E.plural} with Non QM-Owned ${r.plural} will create corresponding QM-Owned ${r.plural}` })
1398
+ children: /* @__PURE__ */ e.jsx(w, { fontSize: "sm", fontWeight: "medium", color: "yellow.800", children: h === "convert" ? `Converting ${c.plural} will convert non QM-Owned ${p.plural} to QM-Owned ${p.plural}` : `Copying ${c.plural} with Non QM-Owned ${p.plural} will create corresponding QM-Owned ${p.plural}` })
1398
1399
  }
1399
1400
  )
1400
1401
  ] })
1401
1402
  ] }),
1402
- !c && /* @__PURE__ */ e.jsxs(be, { spacing: 4, justifyContent: "flex-end", children: [
1403
+ !d && /* @__PURE__ */ e.jsxs(be, { spacing: 4, justifyContent: "flex-end", children: [
1403
1404
  /* @__PURE__ */ e.jsx(
1404
- ee,
1405
+ V,
1405
1406
  {
1406
1407
  variant: "outline",
1407
- onClick: I,
1408
- isDisabled: L,
1408
+ onClick: E,
1409
+ isDisabled: l,
1409
1410
  children: "Cancel"
1410
1411
  }
1411
1412
  ),
1412
1413
  /* @__PURE__ */ e.jsxs(
1413
- ee,
1414
+ V,
1414
1415
  {
1415
- colorScheme: s === "copy" ? "blue" : "green",
1416
- onClick: g,
1417
- isDisabled: M.length === 0 || L,
1418
- isLoading: L,
1419
- loadingText: `${s === "copy" ? "Copying" : "Converting"}...`,
1416
+ colorScheme: h === "copy" ? "blue" : "green",
1417
+ onClick: v,
1418
+ isDisabled: I.length === 0 || l,
1419
+ isLoading: l,
1420
+ loadingText: `${h === "copy" ? "Copying" : "Converting"}...`,
1420
1421
  children: [
1421
- s === "copy" ? "Copy" : "Convert",
1422
+ h === "copy" ? "Copy" : "Convert",
1422
1423
  " ",
1423
- M.length === 1 ? E.singular : `${M.length} ${E.plural}`
1424
+ I.length === 1 ? c.singular : `${I.length} ${c.plural}`
1424
1425
  ]
1425
1426
  }
1426
1427
  )
@@ -1429,70 +1430,70 @@ const tn = ({
1429
1430
  }, pn = ({
1430
1431
  name: n,
1431
1432
  setName: t,
1432
- actions: a,
1433
- selectedActionIds: c,
1434
- setSelectedActionIds: u,
1433
+ actions: o,
1434
+ selectedActionIds: d,
1435
+ setSelectedActionIds: m,
1435
1436
  availableCategories: i,
1436
- selectedCategoryIds: d,
1437
- setSelectedCategoryIds: m,
1438
- description: l,
1439
- setDescription: x,
1440
- ...h
1437
+ selectedCategoryIds: u,
1438
+ setSelectedCategoryIds: g,
1439
+ description: r,
1440
+ setDescription: c,
1441
+ ...p
1441
1442
  }) => {
1442
- const T = Ct(), p = A(() => a.map((j) => ({
1443
- ...j,
1444
- selected: c.includes(j.id)
1445
- })), [a, c]), L = A(() => a.reduce((j, S) => (j[S.id] = S, j), {}), [a]), b = A(
1446
- () => c.map((j) => L[j]),
1447
- [c, L]
1448
- ), s = R(
1449
- (j, S) => {
1450
- u(S ? [...c, j.id] : c.filter((F) => F !== j.id));
1443
+ const A = Ct(), x = M(() => o.map((C) => ({
1444
+ ...C,
1445
+ selected: d.includes(C.id)
1446
+ })), [o, d]), S = M(() => o.reduce((C, y) => (C[y.id] = y, C), {}), [o]), b = M(
1447
+ () => d.map((C) => S[C]),
1448
+ [d, S]
1449
+ ), l = F(
1450
+ (C, y) => {
1451
+ m(y ? [...d, C.id] : d.filter((T) => T !== C.id));
1451
1452
  },
1452
- [c, u]
1453
- ), f = R(
1454
- (j) => {
1455
- t(j.target.value);
1453
+ [d, m]
1454
+ ), f = F(
1455
+ (C) => {
1456
+ t(C.target.value);
1456
1457
  },
1457
1458
  [t]
1458
- ), C = R(
1459
- (j) => {
1460
- x?.(j.target.value);
1459
+ ), h = F(
1460
+ (C) => {
1461
+ c?.(C.target.value);
1461
1462
  },
1462
- [x]
1463
+ [c]
1463
1464
  );
1464
- return /* @__PURE__ */ e.jsxs(V, { ...h, children: [
1465
+ return /* @__PURE__ */ e.jsxs(K, { ...p, children: [
1465
1466
  /* @__PURE__ */ e.jsxs(re, { gap: "2rem", children: [
1466
1467
  /* @__PURE__ */ e.jsx(gn, { name: n ?? "", onInputChange: f }),
1467
1468
  /* @__PURE__ */ e.jsx(
1468
1469
  xn,
1469
1470
  {
1470
1471
  availableCategories: i,
1471
- value: d,
1472
- onChange: m
1472
+ value: u,
1473
+ onChange: g
1473
1474
  }
1474
1475
  )
1475
1476
  ] }),
1476
1477
  /* @__PURE__ */ e.jsx(
1477
1478
  fn,
1478
1479
  {
1479
- description: l ?? "",
1480
- onInputChange: C
1480
+ description: r ?? "",
1481
+ onInputChange: h
1481
1482
  }
1482
1483
  ),
1483
1484
  /* @__PURE__ */ e.jsx(
1484
1485
  jn,
1485
1486
  {
1486
1487
  value: b,
1487
- onChange: u,
1488
- onAdjustActivities: () => T.onOpen()
1488
+ onChange: m,
1489
+ onAdjustActivities: () => A.onOpen()
1489
1490
  }
1490
1491
  ),
1491
1492
  /* @__PURE__ */ e.jsxs(
1492
1493
  yt,
1493
1494
  {
1494
- isOpen: T.isOpen,
1495
- onClose: T.onClose,
1495
+ isOpen: A.isOpen,
1496
+ onClose: A.onClose,
1496
1497
  size: "6xl",
1497
1498
  children: [
1498
1499
  /* @__PURE__ */ e.jsx(vt, {}),
@@ -1502,8 +1503,8 @@ const tn = ({
1502
1503
  /* @__PURE__ */ e.jsx(Mt, { children: /* @__PURE__ */ e.jsx(
1503
1504
  mn,
1504
1505
  {
1505
- actions: p,
1506
- onSelected: s,
1506
+ actions: x,
1507
+ onSelected: l,
1507
1508
  disableCreate: !0,
1508
1509
  disableDelete: !0,
1509
1510
  tableProps: {
@@ -1513,11 +1514,11 @@ const tn = ({
1513
1514
  }
1514
1515
  ) }),
1515
1516
  /* @__PURE__ */ e.jsx(At, { children: /* @__PURE__ */ e.jsx(
1516
- ee,
1517
+ V,
1517
1518
  {
1518
1519
  colorScheme: "blue",
1519
- onClick: T.onClose,
1520
- isDisabled: c.length === 0,
1520
+ onClick: A.onClose,
1521
+ isDisabled: d.length === 0,
1521
1522
  children: "Done"
1522
1523
  }
1523
1524
  ) })
@@ -1531,10 +1532,10 @@ const tn = ({
1531
1532
  name: n,
1532
1533
  onInputChange: t
1533
1534
  }) => {
1534
- const { getLabel: a } = pe(), c = a("module");
1535
- return /* @__PURE__ */ e.jsxs(K, { mb: 4, children: [
1535
+ const { getLabel: o } = ue(), d = o("module");
1536
+ return /* @__PURE__ */ e.jsxs(Z, { mb: 4, children: [
1536
1537
  /* @__PURE__ */ e.jsxs(ce, { children: [
1537
- c,
1538
+ d,
1538
1539
  " Name"
1539
1540
  ] }),
1540
1541
  /* @__PURE__ */ e.jsx(
@@ -1552,33 +1553,33 @@ const tn = ({
1552
1553
  ({
1553
1554
  availableCategories: n,
1554
1555
  value: t,
1555
- onChange: a
1556
+ onChange: o
1556
1557
  }) => {
1557
- const { getLabel: c } = pe(), u = c("module"), i = A(() => [
1558
+ const { getLabel: d } = ue(), m = d("module"), i = M(() => [
1558
1559
  ...n,
1559
1560
  {
1560
1561
  id: "other",
1561
1562
  name: "Other"
1562
1563
  }
1563
- ], [n]), d = A(() => i.map((m) => ({
1564
- value: m.id,
1565
- label: m.name
1564
+ ], [n]), u = M(() => i.map((g) => ({
1565
+ value: g.id,
1566
+ label: g.name
1566
1567
  })), [i]);
1567
- return /* @__PURE__ */ e.jsxs(K, { mb: 4, children: [
1568
+ return /* @__PURE__ */ e.jsxs(Z, { mb: 4, children: [
1568
1569
  /* @__PURE__ */ e.jsxs(ce, { children: [
1569
- u,
1570
+ m,
1570
1571
  " Category"
1571
1572
  ] }),
1572
1573
  /* @__PURE__ */ e.jsx(
1573
1574
  de,
1574
1575
  {
1575
1576
  isDisabled: n.length === 0,
1576
- options: d,
1577
- value: t.length === 0 ? { value: "other", label: "Other" } : i.filter((m) => t.includes(m.id)).map((m) => ({
1578
- value: m.id,
1579
- label: m.name
1577
+ options: u,
1578
+ value: t.length === 0 ? { value: "other", label: "Other" } : i.filter((g) => t.includes(g.id)).map((g) => ({
1579
+ value: g.id,
1580
+ label: g.name
1580
1581
  }))[0],
1581
- onChange: (m) => a(m ? [m.value] : []),
1582
+ onChange: (g) => o(g ? [g.value] : []),
1582
1583
  placeholder: "Select category"
1583
1584
  }
1584
1585
  )
@@ -1588,83 +1589,91 @@ const tn = ({
1588
1589
  ({
1589
1590
  description: n,
1590
1591
  onInputChange: t
1591
- }) => /* @__PURE__ */ e.jsxs(K, { mb: 4, children: [
1592
- /* @__PURE__ */ e.jsx(ce, { children: /* @__PURE__ */ e.jsxs("span", { children: [
1593
- "Description",
1594
- /* @__PURE__ */ e.jsx(v, { fontSize: "sm", color: "gray.500", children: "Briefly describe the objective of this module. Max 40 words." })
1595
- ] }) }),
1596
- /* @__PURE__ */ e.jsx(
1597
- ye,
1598
- {
1599
- placeholder: "i.e. Assess readiness to return to play post-ACL reconstruction",
1600
- value: n,
1601
- onChange: t
1602
- }
1603
- )
1604
- ] })
1592
+ }) => {
1593
+ const { getLabel: o } = ue(), d = o("module");
1594
+ return /* @__PURE__ */ e.jsxs(Z, { mb: 4, children: [
1595
+ /* @__PURE__ */ e.jsx(ce, { children: /* @__PURE__ */ e.jsxs("span", { children: [
1596
+ "Description",
1597
+ /* @__PURE__ */ e.jsxs(w, { fontSize: "sm", color: "gray.500", children: [
1598
+ "Briefly describe the objective of this",
1599
+ " ",
1600
+ d.toLocaleLowerCase(),
1601
+ ". Max 40 words."
1602
+ ] })
1603
+ ] }) }),
1604
+ /* @__PURE__ */ e.jsx(
1605
+ ye,
1606
+ {
1607
+ placeholder: "i.e. Assess readiness to return to play post-ACL reconstruction",
1608
+ value: n,
1609
+ onChange: t
1610
+ }
1611
+ )
1612
+ ] });
1613
+ }
1605
1614
  ), jn = Fe(
1606
1615
  ({
1607
1616
  value: n,
1608
1617
  onChange: t,
1609
- onAdjustActivities: a
1618
+ onAdjustActivities: o
1610
1619
  }) => {
1611
- const { getLabel: c } = pe(), u = A(() => ({
1612
- module: c("module"),
1613
- moduleLowerCase: c("module").toLocaleLowerCase(),
1614
- action: c("action"),
1615
- actionPlural: c("action_plural"),
1616
- actionPluralLowerCase: c("action_plural").toLocaleLowerCase()
1617
- }), [c]), i = A(
1618
- () => n.map((d) => ({
1619
- id: d.id,
1620
- name: d.name
1620
+ const { getLabel: d } = ue(), m = M(() => ({
1621
+ module: d("module"),
1622
+ moduleLowerCase: d("module").toLocaleLowerCase(),
1623
+ action: d("action"),
1624
+ actionPlural: d("action_plural"),
1625
+ actionPluralLowerCase: d("action_plural").toLocaleLowerCase()
1626
+ }), [d]), i = M(
1627
+ () => n.map((u) => ({
1628
+ id: u.id,
1629
+ name: u.name
1621
1630
  })),
1622
1631
  [n]
1623
1632
  );
1624
- return /* @__PURE__ */ e.jsxs(K, { mb: 4, children: [
1633
+ return /* @__PURE__ */ e.jsxs(Z, { mb: 4, children: [
1625
1634
  /* @__PURE__ */ e.jsxs(re, { justifyContent: "space-between", children: [
1626
1635
  /* @__PURE__ */ e.jsx(ce, { children: /* @__PURE__ */ e.jsxs("span", { children: [
1627
- u.actionPlural,
1628
- /* @__PURE__ */ e.jsxs(v, { fontSize: "sm", color: "gray.500", children: [
1636
+ m.actionPlural,
1637
+ /* @__PURE__ */ e.jsxs(w, { fontSize: "sm", color: "gray.500", children: [
1629
1638
  "Drag and drop to reorder the ",
1630
- u.actionPluralLowerCase,
1639
+ m.actionPluralLowerCase,
1631
1640
  " in this ",
1632
- u.moduleLowerCase,
1641
+ m.moduleLowerCase,
1633
1642
  "."
1634
1643
  ] })
1635
1644
  ] }) }),
1636
1645
  /* @__PURE__ */ e.jsxs(
1637
- ee,
1646
+ V,
1638
1647
  {
1639
1648
  size: "sm",
1640
1649
  variant: "solid",
1641
1650
  colorScheme: "blue",
1642
- onClick: a,
1651
+ onClick: o,
1643
1652
  children: [
1644
1653
  "Add / Remove ",
1645
- u.actionPlural
1654
+ m.actionPlural
1646
1655
  ]
1647
1656
  }
1648
1657
  )
1649
1658
  ] }),
1650
- i.length === 0 ? /* @__PURE__ */ e.jsx(oe, { children: /* @__PURE__ */ e.jsxs(v, { color: "gray.500", fontSize: "lg", mb: "4rem", mt: "4rem", children: [
1659
+ i.length === 0 ? /* @__PURE__ */ e.jsx(oe, { children: /* @__PURE__ */ e.jsxs(w, { color: "gray.500", fontSize: "lg", mb: "4rem", mt: "4rem", children: [
1651
1660
  "No ",
1652
- u.actionPluralLowerCase,
1661
+ m.actionPluralLowerCase,
1653
1662
  " selected for this",
1654
1663
  " ",
1655
- u.moduleLowerCase,
1664
+ m.moduleLowerCase,
1656
1665
  ".",
1657
1666
  /* @__PURE__ */ e.jsxs(
1658
- ee,
1667
+ V,
1659
1668
  {
1660
1669
  ml: "0.5em",
1661
1670
  size: "sm",
1662
1671
  variant: "link",
1663
1672
  colorScheme: "blue",
1664
- onClick: a,
1673
+ onClick: o,
1665
1674
  children: [
1666
1675
  "Add ",
1667
- u.actionPluralLowerCase,
1676
+ m.actionPluralLowerCase,
1668
1677
  "."
1669
1678
  ]
1670
1679
  }
@@ -1673,9 +1682,9 @@ const tn = ({
1673
1682
  nn,
1674
1683
  {
1675
1684
  value: i,
1676
- onChange: (d) => {
1677
- const m = d(i);
1678
- t(m.map((l) => l.id));
1685
+ onChange: (u) => {
1686
+ const g = u(i);
1687
+ t(g.map((r) => r.id));
1679
1688
  }
1680
1689
  }
1681
1690
  )
@@ -1684,72 +1693,72 @@ const tn = ({
1684
1693
  ), bn = ({
1685
1694
  value: n,
1686
1695
  onChange: t,
1687
- forceKind: a,
1688
- disableRemove: c,
1689
- disableKind: u,
1696
+ forceKind: o,
1697
+ disableRemove: d,
1698
+ disableKind: m,
1690
1699
  isDisabled: i,
1691
- lockRanges: d,
1692
- ...m
1700
+ lockRanges: u,
1701
+ ...g
1693
1702
  }) => {
1694
- const l = A(() => [...n].sort((p, L) => {
1695
- const b = Ye.indexOf(p.plane), s = Ye.indexOf(L.plane);
1696
- return b - s;
1697
- }), [n]), x = R((p) => "segment" in p.id ? ut(p.id.segment, p.plane, !0) ?? "Unknown" : ht(p.id.joint, p.plane, !0) ?? "Unknown", []), h = R(
1698
- (p, L) => {
1699
- const b = l.findIndex(
1700
- (f) => f.id === L.id && f.plane === L.plane
1703
+ const r = M(() => [...n].sort((x, S) => {
1704
+ const b = Ye.indexOf(x.plane), l = Ye.indexOf(S.plane);
1705
+ return b - l;
1706
+ }), [n]), c = F((x) => "segment" in x.id ? ut(x.id.segment, x.plane, !0) ?? "Unknown" : ht(x.id.joint, x.plane, !0) ?? "Unknown", []), p = F(
1707
+ (x, S) => {
1708
+ const b = r.findIndex(
1709
+ (f) => f.id === S.id && f.plane === S.plane
1701
1710
  );
1702
- let s = [...l];
1703
- a && (L = { ...L, kind: a }), s[b] = L, d && (s = s.map((f) => ({
1711
+ let l = [...r];
1712
+ o && (S = { ...S, kind: o }), l[b] = S, u && (l = l.map((f) => ({
1704
1713
  ...f,
1705
- min: L.min,
1706
- max: L.max
1707
- }))), t(s);
1714
+ min: S.min,
1715
+ max: S.max
1716
+ }))), t(l);
1708
1717
  },
1709
- [t, l, a, d]
1710
- ), T = R(
1711
- (p) => {
1712
- const L = l.filter(
1713
- (b) => b.id !== p.id || b.plane !== p.plane
1718
+ [t, r, o, u]
1719
+ ), A = F(
1720
+ (x) => {
1721
+ const S = r.filter(
1722
+ (b) => b.id !== x.id || b.plane !== x.plane
1714
1723
  );
1715
- t(L);
1724
+ t(S);
1716
1725
  },
1717
- [t, l]
1726
+ [t, r]
1718
1727
  );
1719
- return /* @__PURE__ */ e.jsx(oe, { alignItems: "flex-start", overflowY: "auto", ...m, children: l.map((p, L) => /* @__PURE__ */ e.jsx(
1728
+ return /* @__PURE__ */ e.jsx(oe, { alignItems: "flex-start", overflowY: "auto", ...g, children: r.map((x, S) => /* @__PURE__ */ e.jsx(
1720
1729
  Cn,
1721
1730
  {
1722
- label: x(p),
1723
- parameter: p,
1724
- onChange: (b) => h(L, b),
1725
- onRemove: c || i ? void 0 : () => T(p),
1726
- forceKind: a,
1727
- disableKind: u || i,
1731
+ label: c(x),
1732
+ parameter: x,
1733
+ onChange: (b) => p(S, b),
1734
+ onRemove: d || i ? void 0 : () => A(x),
1735
+ forceKind: o,
1736
+ disableKind: m || i,
1728
1737
  isDisabled: i
1729
1738
  },
1730
- `${JSON.stringify(p.id)}-${p.plane}`
1739
+ `${JSON.stringify(x.id)}-${x.plane}`
1731
1740
  )) });
1732
1741
  }, Cn = ({
1733
1742
  label: n,
1734
1743
  parameter: t,
1735
- onChange: a,
1736
- onRemove: c,
1737
- forceKind: u,
1744
+ onChange: o,
1745
+ onRemove: d,
1746
+ forceKind: m,
1738
1747
  disableKind: i,
1739
- isDisabled: d
1748
+ isDisabled: u
1740
1749
  }) => {
1741
- const m = R(
1742
- (h) => "joint" in t.id ? Zt(
1750
+ const g = F(
1751
+ (p) => "joint" in t.id ? Zt(
1743
1752
  t.id.joint,
1744
1753
  t.plane,
1745
- h < 0 ? -1 : 1
1754
+ p < 0 ? -1 : 1
1746
1755
  ) : Kt(
1747
1756
  t.id.segment,
1748
1757
  t.plane,
1749
- h < 0 ? -1 : 1
1758
+ p < 0 ? -1 : 1
1750
1759
  ),
1751
1760
  [t]
1752
- ), { min: l, max: x } = "joint" in t.id ? Vt(t.id.joint, t.plane) : { min: -180, max: 180 };
1761
+ ), { min: r, max: c } = "joint" in t.id ? Vt(t.id.joint, t.plane) : { min: -180, max: 180 };
1753
1762
  return /* @__PURE__ */ e.jsxs(
1754
1763
  oe,
1755
1764
  {
@@ -1763,7 +1772,7 @@ const tn = ({
1763
1772
  children: [
1764
1773
  /* @__PURE__ */ e.jsxs(re, { w: "100%", children: [
1765
1774
  /* @__PURE__ */ e.jsx(
1766
- v,
1775
+ w,
1767
1776
  {
1768
1777
  fontSize: "sm",
1769
1778
  flex: 1,
@@ -1772,22 +1781,22 @@ const tn = ({
1772
1781
  children: n
1773
1782
  }
1774
1783
  ),
1775
- c && !d && /* @__PURE__ */ e.jsx(
1784
+ d && !u && /* @__PURE__ */ e.jsx(
1776
1785
  Tt,
1777
1786
  {
1778
1787
  size: "xs",
1779
1788
  variant: "ghost",
1780
1789
  "aria-label": "delete",
1781
1790
  icon: /* @__PURE__ */ e.jsx(Je, { as: Dt }),
1782
- onClick: c
1791
+ onClick: d
1783
1792
  }
1784
1793
  ),
1785
- !u && /* @__PURE__ */ e.jsx(
1794
+ !m && /* @__PURE__ */ e.jsx(
1786
1795
  on,
1787
1796
  {
1788
1797
  selectedItem: t?.kind ?? Ie.Limit,
1789
- onChange: ({ value: h }) => a({ ...t, kind: h }),
1790
- isDisabled: i || d,
1798
+ onChange: ({ value: p }) => o({ ...t, kind: p }),
1799
+ isDisabled: i || u,
1791
1800
  buttonProps: {
1792
1801
  size: "sm",
1793
1802
  variant: "outline",
@@ -1809,15 +1818,15 @@ const tn = ({
1809
1818
  {
1810
1819
  w: "100%",
1811
1820
  size: "xs",
1812
- min: l,
1813
- max: x,
1821
+ min: r,
1822
+ max: c,
1814
1823
  zeroMarker: !0,
1815
1824
  value: [t.min, t.max],
1816
- onChange: (h) => a({ ...t, min: h[0], max: h[1] }),
1817
- formatValue: (h) => `${Math.abs(h)}°`,
1818
- valueLabel: (h) => m(h) ?? "",
1819
- positiveNegativeLabels: m(0) ? [m(-1) ?? "", m(1) ?? ""] : void 0,
1820
- isDisabled: d
1825
+ onChange: (p) => o({ ...t, min: p[0], max: p[1] }),
1826
+ formatValue: (p) => `${Math.abs(p)}°`,
1827
+ valueLabel: (p) => g(p) ?? "",
1828
+ positiveNegativeLabels: g(0) ? [g(-1) ?? "", g(1) ?? ""] : void 0,
1829
+ isDisabled: u
1821
1830
  }
1822
1831
  )
1823
1832
  ]
@@ -1826,71 +1835,71 @@ const tn = ({
1826
1835
  }, Ae = (n, t) => "segment" in n && "segment" in t && n.segment === t.segment || "joint" in n && "joint" in t && n.joint === t.joint, yn = ({
1827
1836
  options: n,
1828
1837
  value: t,
1829
- onChange: a,
1830
- forceKind: c,
1831
- singleValue: u,
1838
+ onChange: o,
1839
+ forceKind: d,
1840
+ singleValue: m,
1832
1841
  singleValueSideless: i,
1833
- editOnly: d,
1834
- disableKind: m,
1835
- maxParameters: l,
1836
- ...x
1842
+ editOnly: u,
1843
+ disableKind: g,
1844
+ maxParameters: r,
1845
+ ...c
1837
1846
  }) => {
1838
- const h = i ? 2 : l, T = A(
1839
- () => n.map((s) => ({
1840
- label: "segment" in s.id ? ut(s.id.segment, s.plane, !0) ?? "Unknown" : ht(s.id.joint, s.plane, !0) ?? "Unknown",
1841
- value: s.id,
1842
- plane: s.plane
1847
+ const p = i ? 2 : r, A = M(
1848
+ () => n.map((l) => ({
1849
+ label: "segment" in l.id ? ut(l.id.segment, l.plane, !0) ?? "Unknown" : ht(l.id.joint, l.plane, !0) ?? "Unknown",
1850
+ value: l.id,
1851
+ plane: l.plane
1843
1852
  })),
1844
1853
  [n]
1845
- ), p = A(() => {
1854
+ ), x = M(() => {
1846
1855
  if (!i || t.length === 0)
1847
- return T;
1848
- const s = t[0];
1849
- return T.filter(
1850
- (f) => Se(f.value) === Se(s.id) && f.plane === s.plane
1856
+ return A;
1857
+ const l = t[0];
1858
+ return A.filter(
1859
+ (f) => Se(f.value) === Se(l.id) && f.plane === l.plane
1851
1860
  );
1852
- }, [T, t, i]), L = A(
1853
- () => T.filter(
1854
- (s) => t.some((f) => Ae(f.id, s.value) && f.plane === s.plane)
1861
+ }, [A, t, i]), S = M(
1862
+ () => A.filter(
1863
+ (l) => t.some((f) => Ae(f.id, l.value) && f.plane === l.plane)
1855
1864
  ),
1856
- [T, t]
1857
- ), b = R(
1858
- (s) => {
1859
- const f = s.map((C) => {
1860
- const j = t.find(
1861
- (k) => Ae(k.id, C.value) && k.plane === C.plane
1862
- ), S = n.find(
1863
- (k) => Ae(k.id, C.value) && k.plane === C.plane
1864
- ), F = i ? t.find(
1865
- (k) => Se(k.id) === Se(C.value) && k.plane === C.plane
1866
- ) : void 0, N = F && !j ? F.min : S && S.min ? S.min : 0, B = F && !j ? F.max : S && S.max ? S.max : 0;
1867
- return j ?? {
1868
- id: C.value,
1869
- plane: C.plane,
1870
- min: N,
1865
+ [A, t]
1866
+ ), b = F(
1867
+ (l) => {
1868
+ const f = l.map((h) => {
1869
+ const C = t.find(
1870
+ (k) => Ae(k.id, h.value) && k.plane === h.plane
1871
+ ), y = n.find(
1872
+ (k) => Ae(k.id, h.value) && k.plane === h.plane
1873
+ ), T = i ? t.find(
1874
+ (k) => Se(k.id) === Se(h.value) && k.plane === h.plane
1875
+ ) : void 0, $ = T && !C ? T.min : y && y.min ? y.min : 0, B = T && !C ? T.max : y && y.max ? y.max : 0;
1876
+ return C ?? {
1877
+ id: h.value,
1878
+ plane: h.plane,
1879
+ min: $,
1871
1880
  max: B,
1872
- kind: c ?? Ie.Limit
1881
+ kind: d ?? Ie.Limit
1873
1882
  };
1874
1883
  });
1875
- a(f);
1884
+ o(f);
1876
1885
  },
1877
- [a, t, n, c, i]
1886
+ [o, t, n, d, i]
1878
1887
  );
1879
1888
  return ae(() => {
1880
- const s = t.filter(
1881
- (f) => n.some((C) => Ae(C.id, f.id) && C.plane === f.plane)
1889
+ const l = t.filter(
1890
+ (f) => n.some((h) => Ae(h.id, f.id) && h.plane === f.plane)
1882
1891
  );
1883
- s.length !== t.length && a(s);
1884
- }, [n, a]), /* @__PURE__ */ e.jsxs(V, { ...x, children: [
1892
+ l.length !== t.length && o(l);
1893
+ }, [n, o]), /* @__PURE__ */ e.jsxs(K, { ...c, children: [
1885
1894
  /* @__PURE__ */ e.jsx(
1886
1895
  de,
1887
1896
  {
1888
- isMulti: !u,
1897
+ isMulti: !m,
1889
1898
  placeholder: t.length ? `${t.length} selected` : "Search...",
1890
- value: L,
1891
- isDisabled: d || L.length >= (h ?? 1 / 0),
1892
- onChange: (s) => Array.isArray(s) ? b([...s]) : b(s !== null ? [s] : []),
1893
- options: p,
1899
+ value: S,
1900
+ isDisabled: u || S.length >= (p ?? 1 / 0),
1901
+ onChange: (l) => Array.isArray(l) ? b([...l]) : b(l !== null ? [l] : []),
1902
+ options: x,
1894
1903
  controlShouldRenderValue: !1
1895
1904
  }
1896
1905
  ),
@@ -1900,289 +1909,289 @@ const tn = ({
1900
1909
  marginTop: 2,
1901
1910
  maxH: "28rem",
1902
1911
  value: t,
1903
- onChange: a,
1904
- forceKind: c,
1905
- disableKind: m,
1906
- isDisabled: d,
1912
+ onChange: o,
1913
+ forceKind: d,
1914
+ disableKind: g,
1915
+ isDisabled: u,
1907
1916
  lockRanges: i
1908
1917
  }
1909
1918
  )
1910
1919
  ] });
1911
1920
  }, mt = (n) => {
1912
1921
  switch (n) {
1913
- case G.Thorax:
1922
+ case z.Thorax:
1914
1923
  return "Thorax";
1915
- case G.CenterBack:
1924
+ case z.CenterBack:
1916
1925
  return "Center Back";
1917
- case G.Pelvis:
1926
+ case z.Pelvis:
1918
1927
  return "Pelvis";
1919
- case G.LeftThigh:
1928
+ case z.LeftThigh:
1920
1929
  return "Left Thigh";
1921
- case G.RightThigh:
1930
+ case z.RightThigh:
1922
1931
  return "Right Thigh";
1923
- case G.LeftShank:
1932
+ case z.LeftShank:
1924
1933
  return "Left Shank";
1925
- case G.RightShank:
1934
+ case z.RightShank:
1926
1935
  return "Right Shank";
1927
- case G.LeftFoot:
1936
+ case z.LeftFoot:
1928
1937
  return "Left Foot";
1929
- case G.RightFoot:
1938
+ case z.RightFoot:
1930
1939
  return "Right Foot";
1931
- case G.LeftUpperArm:
1940
+ case z.LeftUpperArm:
1932
1941
  return "Left Upper Arm";
1933
- case G.RightUpperArm:
1942
+ case z.RightUpperArm:
1934
1943
  return "Right Upper Arm";
1935
- case G.LeftForearm:
1944
+ case z.LeftForearm:
1936
1945
  return "Left Forearm";
1937
- case G.RightForearm:
1946
+ case z.RightForearm:
1938
1947
  return "Right Forearm";
1939
- case G.Head:
1948
+ case z.Head:
1940
1949
  return "Head";
1941
1950
  }
1942
1951
  return console.warn(`Unknown sensor location: ${n}`), "Unknown";
1943
1952
  }, vn = 6, wn = [
1944
- G.LeftFoot,
1945
- G.LeftShank,
1946
- G.LeftThigh,
1947
- G.Pelvis,
1948
- G.RightFoot,
1949
- G.RightShank,
1950
- G.RightThigh,
1951
- G.Thorax,
1952
- G.CenterBack,
1953
- G.Head
1953
+ z.LeftFoot,
1954
+ z.LeftShank,
1955
+ z.LeftThigh,
1956
+ z.Pelvis,
1957
+ z.RightFoot,
1958
+ z.RightShank,
1959
+ z.RightThigh,
1960
+ z.Thorax,
1961
+ z.CenterBack,
1962
+ z.Head
1954
1963
  ], Ln = wn.map((n) => ({
1955
1964
  label: mt(n),
1956
1965
  value: n
1957
1966
  })), Qn = ({
1958
1967
  id: n,
1959
1968
  onError: t,
1960
- onCancel: a,
1961
- onSave: c,
1962
- hideButtons: u,
1969
+ onCancel: o,
1970
+ onSave: d,
1971
+ hideButtons: m,
1963
1972
  setButtonOnClick: i,
1964
- setButtonDisabled: d,
1965
- quantumOwned: m,
1966
- isView: l
1973
+ setButtonDisabled: u,
1974
+ quantumOwned: g,
1975
+ isView: r
1967
1976
  }) => {
1968
- const x = Ot(), [{ fetching: h }, T] = ie(ze), [{ fetching: p }, L] = ie(_t), [{ data: b }] = he({
1977
+ const c = Ot(), [{ fetching: p }, A] = ie(ze), [{ fetching: x }, S] = ie(_t), [{ data: b }] = me({
1969
1978
  query: zt,
1970
1979
  variables: { id: n ?? "" },
1971
1980
  pause: !n
1972
- }), s = _(
1973
- me,
1981
+ }), l = P(
1982
+ pe,
1974
1983
  b?.getActionById
1975
- ), f = h || p, C = !!s && !!n, { getLabel: j } = pe(), S = A(() => ({
1976
- action: j("action")
1977
- }), [j]), F = A(() => [
1984
+ ), f = p || x, h = !!l && !!n, { getLabel: C } = ue(), y = M(() => ({
1985
+ action: C("action")
1986
+ }), [C]), T = M(() => [
1978
1987
  { key: "module_category", label: "Link Category", multi: !0 },
1979
- { key: "activity_type", label: `${S.action} Type`, multi: !1 },
1988
+ { key: "activity_type", label: `${y.action} Type`, multi: !1 },
1980
1989
  { key: "session_type", label: "Session Type", multi: !0 },
1981
1990
  { key: "body_region", label: "Body Region", multi: !0 },
1982
1991
  { key: "sport", label: "Sport", multi: !0 }
1983
- ], [S.action]), [N, B] = z(""), [k, $] = z(""), [M, se] = z(""), [J, g] = z(""), [I, y] = z([]), [D, X] = z([]), [Z, E] = z({}), r = A(
1984
- () => I.map((O) => O.value),
1985
- [I]
1986
- ), o = Nt(r), [w, P] = z([]), W = N.length > 0, [Q, U] = z({});
1992
+ ], [y.action]), [$, B] = _(""), [k, R] = _(""), [G, ee] = _(""), [I, j] = _(""), [N, v] = _([]), [E, X] = _([]), [Q, se] = _({}), a = M(
1993
+ () => N.map((O) => O.value),
1994
+ [N]
1995
+ ), s = Nt(a), [L, D] = _([]), W = $.length > 0, [q, U] = _({});
1987
1996
  ae(() => {
1988
- const O = F.map(
1989
- (H) => x.query(Gt, { key: H.key })
1997
+ const O = T.map(
1998
+ (J) => c.query(Gt, { key: J.key })
1990
1999
  );
1991
- Promise.all(O).then((H) => {
1992
- const q = {};
1993
- H.forEach((ne) => {
2000
+ Promise.all(O).then((J) => {
2001
+ const Y = {};
2002
+ J.forEach((ne) => {
1994
2003
  if (ne.error || !ne.data) return;
1995
- const le = _(
2004
+ const le = P(
1996
2005
  Ee,
1997
2006
  ne.data.getMetadataByKey
1998
- ), Re = _(
2007
+ ), Re = P(
1999
2008
  Pe,
2000
2009
  le.data
2001
2010
  );
2002
- q[le.key] = Re.map((ge) => ({
2011
+ Y[le.key] = Re.map((ge) => ({
2003
2012
  label: ge.label || ge.value,
2004
2013
  value: ge.value,
2005
2014
  id: ge.id
2006
2015
  }));
2007
- }), E(q);
2016
+ }), se(Y);
2008
2017
  });
2009
- }, [x, F]), ae(() => {
2010
- if (s) {
2011
- const H = _(
2018
+ }, [c, T]), ae(() => {
2019
+ if (l) {
2020
+ const J = P(
2012
2021
  Ee,
2013
- s.metadataGroups
2022
+ l.metadataGroups
2014
2023
  ).map(
2015
- (ne) => ne.data.map((le) => _(Pe, le).id)
2016
- ), q = {
2017
- name: s.name,
2018
- description: s.description || "",
2019
- cameraPlacement: s.cameraPlacement || "",
2020
- videoLink: s.videoLink || "",
2021
- sensorLocations: s.sensorLocations.map((ne) => ({
2024
+ (ne) => ne.data.map((le) => P(Pe, le).id)
2025
+ ), Y = {
2026
+ name: l.name,
2027
+ description: l.description || "",
2028
+ cameraPlacement: l.cameraPlacement || "",
2029
+ videoLink: l.videoLink || "",
2030
+ sensorLocations: l.sensorLocations.map((ne) => ({
2022
2031
  label: mt(ne),
2023
2032
  value: ne
2024
2033
  })),
2025
- thresholds: en(s.thresholds),
2026
- metadataIds: H.flat()
2034
+ thresholds: en(l.thresholds),
2035
+ metadataIds: J.flat()
2027
2036
  };
2028
- B(q.name), $(q.description), se(q.cameraPlacement), g(q.videoLink), y(q.sensorLocations), P(q.thresholds), X(q.metadataIds), U(q);
2037
+ B(Y.name), R(Y.description), ee(Y.cameraPlacement), j(Y.videoLink), v(Y.sensorLocations), D(Y.thresholds), X(Y.metadataIds), U(Y);
2029
2038
  }
2030
- }, [s]);
2031
- const te = A(
2032
- () => JSON.stringify(Q) !== JSON.stringify({
2033
- name: N,
2039
+ }, [l]);
2040
+ const te = M(
2041
+ () => JSON.stringify(q) !== JSON.stringify({
2042
+ name: $,
2034
2043
  description: k,
2035
- cameraPlacement: M,
2036
- videoLink: J,
2037
- sensorLocations: r,
2038
- thresholds: He(w),
2039
- metadataIds: D
2044
+ cameraPlacement: G,
2045
+ videoLink: I,
2046
+ sensorLocations: a,
2047
+ thresholds: He(L),
2048
+ metadataIds: E
2040
2049
  }),
2041
2050
  [
2042
- Q,
2043
- N,
2044
- r,
2051
+ q,
2052
+ $,
2053
+ a,
2045
2054
  k,
2046
- M,
2047
- J,
2048
- D,
2049
- w
2055
+ G,
2056
+ I,
2057
+ E,
2058
+ L
2050
2059
  ]
2051
- ), Y = R(() => {
2060
+ ), H = F(() => {
2052
2061
  const O = {
2053
- name: N,
2062
+ name: $,
2054
2063
  description: k,
2055
- cameraPlacement: M,
2056
- videoLink: J,
2057
- sensorLocations: r,
2058
- thresholds: He(w),
2059
- metadataItemIds: D,
2064
+ cameraPlacement: G,
2065
+ videoLink: I,
2066
+ sensorLocations: a,
2067
+ thresholds: He(L),
2068
+ metadataItemIds: E,
2060
2069
  // Backend requires laterality; keep existing default since UI no longer edits it
2061
2070
  laterality: Xt.Either,
2062
- quantumOwned: m,
2071
+ quantumOwned: g,
2063
2072
  //Backend requires session type; keep existing default since UI no longer edits it
2064
2073
  sessionType: []
2065
2074
  };
2066
- let H;
2067
- C && n ? H = L({
2075
+ let J;
2076
+ h && n ? J = S({
2068
2077
  id: n,
2069
2078
  fields: O
2070
- }) : H = T({
2079
+ }) : J = A({
2071
2080
  fields: O
2072
- }), H.then(({ error: q }) => {
2073
- q ? t(q) : c();
2081
+ }), J.then(({ error: Y }) => {
2082
+ Y ? t(Y) : d();
2074
2083
  });
2075
2084
  }, [
2076
- m,
2077
- T,
2078
- L,
2085
+ g,
2086
+ A,
2087
+ S,
2079
2088
  n,
2080
- N,
2081
- r,
2089
+ $,
2090
+ a,
2082
2091
  k,
2083
- M,
2084
- J,
2085
- D,
2086
- C,
2087
- w,
2088
- c,
2092
+ G,
2093
+ I,
2094
+ E,
2095
+ h,
2096
+ L,
2097
+ d,
2089
2098
  t
2090
2099
  ]);
2091
2100
  ae(() => {
2092
- d && d({
2101
+ u && u({
2093
2102
  cancelButton: f,
2094
- saveButton: l ? !0 : f || !W || !te
2103
+ saveButton: r ? !0 : f || !W || !te
2095
2104
  });
2096
- }, [f, d, W, te, l]), ae(() => {
2105
+ }, [f, u, W, te, r]), ae(() => {
2097
2106
  i && i({
2098
- cancelButton: a,
2099
- saveButton: l ? () => {
2100
- } : Y
2107
+ cancelButton: o,
2108
+ saveButton: r ? () => {
2109
+ } : H
2101
2110
  });
2102
- }, [i, a, Y, l]);
2103
- const Ce = (O, H) => {
2104
- const q = F.find((le) => le.key === O);
2105
- if (!q) return;
2106
- const ne = q.multi ? (H ?? []).map(
2111
+ }, [i, o, H, r]);
2112
+ const Ce = (O, J) => {
2113
+ const Y = T.find((le) => le.key === O);
2114
+ if (!Y) return;
2115
+ const ne = Y.multi ? (J ?? []).map(
2107
2116
  (le) => le.id
2108
- ) : H ? [H.id] : [];
2109
- X((le) => [...le.filter((ge) => Object.values(Z).flat().find((Le) => Le.id === ge) && !Object.keys(Z).find(
2110
- (Le) => Z[Le]?.some(
2117
+ ) : J ? [J.id] : [];
2118
+ X((le) => [...le.filter((ge) => Object.values(Q).flat().find((Le) => Le.id === ge) && !Object.keys(Q).find(
2119
+ (Le) => Q[Le]?.some(
2111
2120
  (pt) => pt.id === ge && Le === O
2112
2121
  )
2113
2122
  )), ...ne]);
2114
2123
  };
2115
2124
  return /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-2 gap-4 w-full", children: [
2116
2125
  /* @__PURE__ */ e.jsxs("div", { className: "col-span-2 lg:col-span-1 flex flex-col gap-4", children: [
2117
- /* @__PURE__ */ e.jsxs(K, { children: [
2118
- /* @__PURE__ */ e.jsx(ue, { children: "Name" }),
2126
+ /* @__PURE__ */ e.jsxs(Z, { children: [
2127
+ /* @__PURE__ */ e.jsx(he, { children: "Name" }),
2119
2128
  /* @__PURE__ */ e.jsx(
2120
2129
  ye,
2121
2130
  {
2122
- value: N,
2131
+ value: $,
2123
2132
  onChange: (O) => B(O.target.value),
2124
2133
  type: "text",
2125
2134
  placeholder: "i.e. Lunge & Return",
2126
- isDisabled: l
2135
+ isDisabled: r
2127
2136
  }
2128
2137
  )
2129
2138
  ] }),
2130
- /* @__PURE__ */ e.jsxs(K, { children: [
2131
- /* @__PURE__ */ e.jsx(ue, { children: "Camera Placement" }),
2139
+ /* @__PURE__ */ e.jsxs(Z, { children: [
2140
+ /* @__PURE__ */ e.jsx(he, { children: "Camera Placement" }),
2132
2141
  /* @__PURE__ */ e.jsx(
2133
2142
  qe,
2134
2143
  {
2135
- value: M,
2136
- onChange: (O) => se(O.target.value),
2144
+ value: G,
2145
+ onChange: (O) => ee(O.target.value),
2137
2146
  rows: 2,
2138
2147
  placeholder: "(optional) Describe camera setup, placement, angles",
2139
- isDisabled: l
2148
+ isDisabled: r
2140
2149
  }
2141
2150
  )
2142
2151
  ] }),
2143
- /* @__PURE__ */ e.jsxs(K, { children: [
2144
- /* @__PURE__ */ e.jsx(ue, { children: "Video Link" }),
2152
+ /* @__PURE__ */ e.jsxs(Z, { children: [
2153
+ /* @__PURE__ */ e.jsx(he, { children: "Video Link" }),
2145
2154
  /* @__PURE__ */ e.jsx(
2146
2155
  ye,
2147
2156
  {
2148
- value: J,
2149
- onChange: (O) => g(O.target.value),
2157
+ value: I,
2158
+ onChange: (O) => j(O.target.value),
2150
2159
  type: "url",
2151
2160
  placeholder: "(optional) https://...",
2152
- isDisabled: l
2161
+ isDisabled: r
2153
2162
  }
2154
2163
  )
2155
2164
  ] }),
2156
- /* @__PURE__ */ e.jsxs(K, { children: [
2157
- /* @__PURE__ */ e.jsx(ue, { children: "Description" }),
2165
+ /* @__PURE__ */ e.jsxs(Z, { children: [
2166
+ /* @__PURE__ */ e.jsx(he, { children: "Description" }),
2158
2167
  /* @__PURE__ */ e.jsx(
2159
2168
  qe,
2160
2169
  {
2161
2170
  value: k,
2162
- onChange: (O) => $(O.target.value),
2171
+ onChange: (O) => R(O.target.value),
2163
2172
  rows: 2,
2164
2173
  placeholder: "(optional) Describe how to perform the test or exercise",
2165
- isDisabled: l
2174
+ isDisabled: r
2166
2175
  }
2167
2176
  )
2168
2177
  ] }),
2169
2178
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
2170
- /* @__PURE__ */ e.jsx(ue, { children: "Metadata Tags" }),
2171
- F.map((O) => /* @__PURE__ */ e.jsxs(K, { children: [
2172
- /* @__PURE__ */ e.jsx(ue, { children: O.label }),
2179
+ /* @__PURE__ */ e.jsx(he, { children: "Metadata Tags" }),
2180
+ T.map((O) => /* @__PURE__ */ e.jsxs(Z, { children: [
2181
+ /* @__PURE__ */ e.jsx(he, { children: O.label }),
2173
2182
  /* @__PURE__ */ e.jsx(
2174
2183
  de,
2175
2184
  {
2176
2185
  isMulti: O.multi,
2177
- value: Z[O.key]?.filter(
2178
- (H) => D.includes(H.id)
2186
+ value: Q[O.key]?.filter(
2187
+ (J) => E.includes(J.id)
2179
2188
  ),
2180
- onChange: (H) => {
2181
- Ce(O.key, H);
2189
+ onChange: (J) => {
2190
+ Ce(O.key, J);
2182
2191
  },
2183
- options: Z[O.key],
2192
+ options: Q[O.key],
2184
2193
  placeholder: `Select ${O.multi ? "one or more" : "one"} ${O.label.toLowerCase()}`,
2185
- isDisabled: l,
2194
+ isDisabled: r,
2186
2195
  isClearable: O.multi
2187
2196
  }
2188
2197
  )
@@ -2190,29 +2199,29 @@ const tn = ({
2190
2199
  ] })
2191
2200
  ] }),
2192
2201
  /* @__PURE__ */ e.jsxs("div", { className: "col-span-2 lg:col-span-1 flex flex-col gap-4", children: [
2193
- /* @__PURE__ */ e.jsxs(K, { children: [
2194
- /* @__PURE__ */ e.jsx(ue, { children: "Sensor Locations" }),
2202
+ /* @__PURE__ */ e.jsxs(Z, { children: [
2203
+ /* @__PURE__ */ e.jsx(he, { children: "Sensor Locations" }),
2195
2204
  /* @__PURE__ */ e.jsx(
2196
2205
  de,
2197
2206
  {
2198
2207
  isMulti: !0,
2199
- value: I,
2200
- onChange: (O) => y([...O]),
2208
+ value: N,
2209
+ onChange: (O) => v([...O]),
2201
2210
  options: Ln,
2202
- isOptionDisabled: () => I.length >= vn,
2203
- isDisabled: l
2211
+ isOptionDisabled: () => N.length >= vn,
2212
+ isDisabled: r
2204
2213
  }
2205
2214
  )
2206
2215
  ] }),
2207
- /* @__PURE__ */ e.jsxs(K, { children: [
2208
- /* @__PURE__ */ e.jsx(ue, { children: "Default Parameters" }),
2216
+ /* @__PURE__ */ e.jsxs(Z, { children: [
2217
+ /* @__PURE__ */ e.jsx(he, { children: "Default Parameters" }),
2209
2218
  /* @__PURE__ */ e.jsx(
2210
2219
  yn,
2211
2220
  {
2212
- options: o,
2213
- value: w,
2214
- onChange: P,
2215
- editOnly: l
2221
+ options: s,
2222
+ value: L,
2223
+ onChange: D,
2224
+ editOnly: r
2216
2225
  }
2217
2226
  )
2218
2227
  ] })
@@ -2222,17 +2231,17 @@ const tn = ({
2222
2231
  {
2223
2232
  className: ot(
2224
2233
  "col-span-2 flex justify-end",
2225
- (u || l) && "hidden"
2234
+ (m || r) && "hidden"
2226
2235
  ),
2227
2236
  children: /* @__PURE__ */ e.jsxs(be, { mt: 16, gap: 4, children: [
2228
- /* @__PURE__ */ e.jsx(ee, { colorScheme: "gray", isDisabled: f, onClick: a, children: "Cancel" }),
2237
+ /* @__PURE__ */ e.jsx(V, { colorScheme: "gray", isDisabled: f, onClick: o, children: "Cancel" }),
2229
2238
  /* @__PURE__ */ e.jsx(
2230
- ee,
2239
+ V,
2231
2240
  {
2232
2241
  colorScheme: "blue",
2233
2242
  isDisabled: f || !W || !te,
2234
2243
  isLoading: f,
2235
- onClick: Y,
2244
+ onClick: H,
2236
2245
  children: "Save changes"
2237
2246
  }
2238
2247
  )
@@ -2240,112 +2249,112 @@ const tn = ({
2240
2249
  }
2241
2250
  )
2242
2251
  ] });
2243
- }, ue = ({ children: n }) => /* @__PURE__ */ e.jsx(Xe, { fontWeight: "bold", fontFamily: "sans-serif", fontSize: "large", children: n }), qn = ({
2252
+ }, he = ({ children: n }) => /* @__PURE__ */ e.jsx(Xe, { fontWeight: "bold", fontFamily: "sans-serif", fontSize: "large", children: n }), qn = ({
2244
2253
  id: n,
2245
2254
  onCancel: t,
2246
- onSave: a,
2247
- onError: c,
2248
- hideButtons: u,
2255
+ onSave: o,
2256
+ onError: d,
2257
+ hideButtons: m,
2249
2258
  quantumOwned: i,
2250
- setButtonOnClick: d,
2251
- setButtonDisabled: m
2259
+ setButtonOnClick: u,
2260
+ setButtonDisabled: g
2252
2261
  }) => {
2253
- const [{ data: l }] = he({
2262
+ const [{ data: r }] = me({
2254
2263
  query: i ? Wt : Ut
2255
- }), [{ data: x }] = he({
2264
+ }), [{ data: c }] = me({
2256
2265
  query: Bt,
2257
2266
  variables: { id: n },
2258
2267
  pause: !n
2259
- }), [{ data: h }] = he({
2268
+ }), [{ data: p }] = me({
2260
2269
  query: Qt
2261
- }), T = _(
2270
+ }), A = P(
2262
2271
  we,
2263
- h?.moduleCategories
2264
- ), [{ fetching: p }, L] = ie(ct), [{ fetching: b }, s] = ie(it), f = _(
2265
- me,
2266
- i ? l?.quantumOwnedActions : l?.actions
2267
- ) ?? [], C = _(Te, x?.module), j = _(dt, C?.moduleActions) ?? [], [S, F] = z([
2268
- ...j.map((g) => g.actionId) ?? []
2269
- ]), [N, B] = z(C?.name ?? ""), [k, $] = z([]), [M, se] = z(C?.description ?? "");
2272
+ p?.moduleCategories
2273
+ ), [{ fetching: x }, S] = ie(ct), [{ fetching: b }, l] = ie(it), f = P(
2274
+ pe,
2275
+ i ? r?.quantumOwnedActions : r?.actions
2276
+ ) ?? [], h = P(Te, c?.module), C = P(dt, h?.moduleActions) ?? [], [y, T] = _([
2277
+ ...C.map((j) => j.actionId) ?? []
2278
+ ]), [$, B] = _(h?.name ?? ""), [k, R] = _([]), [G, ee] = _(h?.description ?? "");
2270
2279
  ae(() => {
2271
- C && (F(j.map((g) => g.actionId)), B(C.name), se(C.description ?? ""), $(
2272
- C.categories.map(
2273
- (g) => _(we, g).id
2280
+ h && (T(C.map((j) => j.actionId)), B(h.name), ee(h.description ?? ""), R(
2281
+ h.categories.map(
2282
+ (j) => P(we, j).id
2274
2283
  ) ?? []
2275
2284
  ));
2276
- }, [C, j]);
2277
- const J = R(() => {
2278
- let g;
2279
- const I = {
2280
- actions: S,
2281
- name: N,
2282
- categories: k.filter((y) => y !== "other"),
2283
- description: M,
2285
+ }, [h, C]);
2286
+ const I = F(() => {
2287
+ let j;
2288
+ const N = {
2289
+ actions: y,
2290
+ name: $,
2291
+ categories: k.filter((v) => v !== "other"),
2292
+ description: G,
2284
2293
  quantumOwned: i
2285
2294
  };
2286
- C ? g = L({
2287
- id: C.id,
2288
- input: I
2289
- }) : g = s({
2290
- input: I
2291
- }), g.then(({ error: y }) => {
2292
- y ? c(y) : a();
2295
+ h ? j = S({
2296
+ id: h.id,
2297
+ input: N
2298
+ }) : j = l({
2299
+ input: N
2300
+ }), j.then(({ error: v }) => {
2301
+ v ? d(v) : o();
2293
2302
  });
2294
2303
  }, [
2295
- s,
2296
- L,
2304
+ l,
2297
2305
  S,
2298
- N,
2299
- M,
2306
+ y,
2307
+ $,
2308
+ G,
2300
2309
  k,
2301
- C,
2302
- a,
2303
- c,
2310
+ h,
2311
+ o,
2312
+ d,
2304
2313
  i
2305
2314
  ]);
2306
2315
  return ae(() => {
2307
- m && m({
2308
- cancelButton: p || b,
2309
- saveButton: p || b || !N || M.trim().split(/\s+/).filter(Boolean).length > 40
2316
+ g && g({
2317
+ cancelButton: x || b,
2318
+ saveButton: x || b || !$ || G.trim().split(/\s+/).filter(Boolean).length > 40
2310
2319
  });
2311
- }, [m, p, b, S, N, M]), ae(() => {
2312
- d && d({
2320
+ }, [g, x, b, y, $, G]), ae(() => {
2321
+ u && u({
2313
2322
  cancelButton: t,
2314
- saveButton: J
2323
+ saveButton: I
2315
2324
  });
2316
- }, [d, t, J]), /* @__PURE__ */ e.jsxs(V, { width: "100%", children: [
2325
+ }, [u, t, I]), /* @__PURE__ */ e.jsxs(K, { width: "100%", children: [
2317
2326
  /* @__PURE__ */ e.jsx(
2318
2327
  pn,
2319
2328
  {
2320
- name: N,
2329
+ name: $,
2321
2330
  setName: B,
2322
2331
  actions: f,
2323
- selectedActionIds: S,
2324
- setSelectedActionIds: F,
2325
- availableCategories: T ?? [],
2332
+ selectedActionIds: y,
2333
+ setSelectedActionIds: T,
2334
+ availableCategories: A ?? [],
2326
2335
  selectedCategoryIds: k,
2327
- setSelectedCategoryIds: $,
2328
- description: M,
2329
- setDescription: se
2336
+ setSelectedCategoryIds: R,
2337
+ description: G,
2338
+ setDescription: ee
2330
2339
  }
2331
2340
  ),
2332
- !u && /* @__PURE__ */ e.jsx(re, { justifyContent: "flex-start", children: /* @__PURE__ */ e.jsxs(be, { mt: 16, gap: 4, children: [
2341
+ !m && /* @__PURE__ */ e.jsx(re, { justifyContent: "flex-start", children: /* @__PURE__ */ e.jsxs(be, { mt: 16, gap: 4, children: [
2333
2342
  /* @__PURE__ */ e.jsx(
2334
- ee,
2343
+ V,
2335
2344
  {
2336
2345
  colorScheme: "gray",
2337
- isDisabled: p || b,
2346
+ isDisabled: x || b,
2338
2347
  onClick: t,
2339
2348
  children: "Cancel"
2340
2349
  }
2341
2350
  ),
2342
2351
  /* @__PURE__ */ e.jsx(
2343
- ee,
2352
+ V,
2344
2353
  {
2345
2354
  colorScheme: "blue",
2346
- isDisabled: p || b || !N || M.trim().split(/\s+/).filter(Boolean).length > 40,
2347
- isLoading: p || b,
2348
- onClick: J,
2355
+ isDisabled: x || b || !$ || G.trim().split(/\s+/).filter(Boolean).length > 40,
2356
+ isLoading: x || b,
2357
+ onClick: I,
2349
2358
  children: "Save"
2350
2359
  }
2351
2360
  )