quantum-component-library 1.4.48-dev.8 → 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.
- package/dist/components.cjs +1 -1
- package/dist/components.js +1076 -1067
- package/dist/generated/graphql.d.ts +0 -1
- package/package.json +1 -1
package/dist/components.js
CHANGED
|
@@ -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
|
|
3
|
-
import { useMemo as
|
|
4
|
-
import { useQuery as
|
|
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
|
|
8
|
-
import { u as
|
|
9
|
-
import { F as
|
|
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
|
|
12
|
-
import { G as rt, a as Et, C as ze, b as at, M as we, c as Ee, A as
|
|
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
|
|
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:
|
|
22
|
-
hideUseCaseFilter:
|
|
21
|
+
updateUseCases: o,
|
|
22
|
+
hideUseCaseFilter: d = !1
|
|
23
23
|
}) => {
|
|
24
|
-
const
|
|
25
|
-
() => t?.flatMap((i) => i.useCases).filter((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:
|
|
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:
|
|
39
|
+
maxW: d ? void 0 : "30rem",
|
|
40
40
|
onChange: (i) => n(i.target.value)
|
|
41
41
|
}
|
|
42
42
|
)
|
|
43
43
|
] }),
|
|
44
|
-
!
|
|
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:
|
|
58
|
-
onChange: (i) =>
|
|
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
|
|
65
|
+
const o = _(
|
|
66
66
|
() => Math.random().toString(36).substring(2, 15)
|
|
67
|
-
)[0],
|
|
68
|
-
(
|
|
69
|
-
t((
|
|
70
|
-
const
|
|
71
|
-
return
|
|
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(
|
|
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((
|
|
81
|
+
/* @__PURE__ */ e.jsx(et, { children: n.map((m, i) => /* @__PURE__ */ e.jsx(
|
|
82
82
|
sn,
|
|
83
83
|
{
|
|
84
|
-
listKey:
|
|
84
|
+
listKey: o,
|
|
85
85
|
index: i,
|
|
86
|
-
id:
|
|
87
|
-
name:
|
|
88
|
-
move:
|
|
86
|
+
id: m.id,
|
|
87
|
+
name: m.name,
|
|
88
|
+
move: d
|
|
89
89
|
},
|
|
90
|
-
|
|
90
|
+
m.id
|
|
91
91
|
)) })
|
|
92
92
|
] }) }) }) });
|
|
93
|
-
}, sn = ({ listKey: n, index: t, id:
|
|
94
|
-
const i = It(null), [{ handlerId:
|
|
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: (
|
|
97
|
-
handlerId:
|
|
96
|
+
collect: (x) => ({
|
|
97
|
+
handlerId: x.getHandlerId()?.toString() ?? ""
|
|
98
98
|
}),
|
|
99
|
-
hover: (
|
|
99
|
+
hover: (x, S) => {
|
|
100
100
|
if (!i.current)
|
|
101
101
|
return;
|
|
102
|
-
const b =
|
|
103
|
-
if (b ===
|
|
102
|
+
const b = x.index, l = t;
|
|
103
|
+
if (b === l)
|
|
104
104
|
return;
|
|
105
|
-
const f = i.current?.getBoundingClientRect(),
|
|
106
|
-
b <
|
|
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:
|
|
108
|
+
}), [{ isDragging: r }, c] = Jt({
|
|
109
109
|
type: n,
|
|
110
|
-
item: () => ({ id:
|
|
111
|
-
collect: (
|
|
112
|
-
isDragging:
|
|
110
|
+
item: () => ({ id: o, index: t }),
|
|
111
|
+
collect: (x) => ({
|
|
112
|
+
isDragging: x.isDragging()
|
|
113
113
|
})
|
|
114
|
-
}),
|
|
115
|
-
return
|
|
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:
|
|
117
|
+
/* @__PURE__ */ e.jsx(je, { children: d })
|
|
118
118
|
] });
|
|
119
119
|
}, on = ({
|
|
120
120
|
items: n,
|
|
121
121
|
onChange: t,
|
|
122
|
-
selectedItem:
|
|
123
|
-
isDisabled:
|
|
124
|
-
selectedProps:
|
|
122
|
+
selectedItem: o,
|
|
123
|
+
isDisabled: d,
|
|
124
|
+
selectedProps: m,
|
|
125
125
|
buttonProps: i
|
|
126
126
|
}) => {
|
|
127
|
-
const
|
|
128
|
-
return /* @__PURE__ */ e.jsx(be, { isAttached: !0, isDisabled:
|
|
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:
|
|
131
|
+
label: r.tooltip,
|
|
132
132
|
openDelay: 50,
|
|
133
133
|
closeDelay: 200,
|
|
134
134
|
placement: "top",
|
|
135
|
-
visibility:
|
|
135
|
+
visibility: r.tooltip ? "visible" : "hidden",
|
|
136
136
|
hasArrow: !0,
|
|
137
137
|
children: /* @__PURE__ */ e.jsx(
|
|
138
|
-
|
|
138
|
+
V,
|
|
139
139
|
{
|
|
140
|
-
onClick: () =>
|
|
141
|
-
isDisabled:
|
|
142
|
-
...
|
|
143
|
-
children:
|
|
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
|
-
|
|
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:
|
|
153
|
-
value:
|
|
154
|
-
onChange:
|
|
152
|
+
max: o,
|
|
153
|
+
value: d,
|
|
154
|
+
onChange: m,
|
|
155
155
|
inputProps: i,
|
|
156
|
-
size:
|
|
157
|
-
zeroMarker:
|
|
158
|
-
formatValue:
|
|
159
|
-
valueLabel:
|
|
160
|
-
positiveNegativeLabels:
|
|
161
|
-
isDisabled:
|
|
162
|
-
...
|
|
156
|
+
size: u,
|
|
157
|
+
zeroMarker: g,
|
|
158
|
+
formatValue: r,
|
|
159
|
+
valueLabel: c,
|
|
160
|
+
positiveNegativeLabels: p,
|
|
161
|
+
isDisabled: A,
|
|
162
|
+
...x
|
|
163
163
|
}) => {
|
|
164
|
-
const [
|
|
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
|
-
|
|
167
|
-
}, [
|
|
168
|
-
const k =
|
|
169
|
-
([
|
|
170
|
-
|
|
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
|
-
),
|
|
174
|
-
([
|
|
175
|
-
|
|
173
|
+
), R = F(
|
|
174
|
+
([v, E]) => {
|
|
175
|
+
v < E && m([v, E]);
|
|
176
176
|
},
|
|
177
|
-
[
|
|
178
|
-
),
|
|
179
|
-
b(([
|
|
180
|
-
const X = isNaN(Number(
|
|
181
|
-
return
|
|
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
|
-
}, [
|
|
184
|
-
(
|
|
185
|
-
const
|
|
186
|
-
b(([X,
|
|
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,
|
|
189
|
-
),
|
|
190
|
-
(
|
|
191
|
-
const
|
|
192
|
-
b(([X,
|
|
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,
|
|
195
|
-
),
|
|
196
|
-
() =>
|
|
197
|
-
[
|
|
198
|
-
),
|
|
199
|
-
(
|
|
200
|
-
const X = Number(
|
|
201
|
-
if (!
|
|
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
|
|
204
|
-
|
|
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
|
-
[
|
|
206
|
+
[l, f, m]
|
|
207
207
|
);
|
|
208
|
-
return /* @__PURE__ */ e.jsxs(fe, { direction: "column", ...
|
|
209
|
-
/* @__PURE__ */ e.jsx(
|
|
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(
|
|
215
|
-
max:
|
|
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:
|
|
220
|
+
onChangeEnd: R,
|
|
221
|
+
isDisabled: A,
|
|
222
222
|
children: [
|
|
223
223
|
/* @__PURE__ */ e.jsx(De, { value: t, top: "-1em", children: /* @__PURE__ */ e.jsx(
|
|
224
|
-
|
|
224
|
+
w,
|
|
225
225
|
{
|
|
226
|
-
fontSize:
|
|
226
|
+
fontSize: u ?? "sm",
|
|
227
227
|
fontWeight: "semibold",
|
|
228
228
|
whiteSpace: "nowrap",
|
|
229
|
-
children:
|
|
229
|
+
children: r ? r?.(t) : t
|
|
230
230
|
}
|
|
231
231
|
) }),
|
|
232
|
-
/* @__PURE__ */ e.jsx(De, { value:
|
|
233
|
-
|
|
232
|
+
/* @__PURE__ */ e.jsx(De, { value: o, top: "-1em", children: /* @__PURE__ */ e.jsx(
|
|
233
|
+
w,
|
|
234
234
|
{
|
|
235
|
-
fontSize:
|
|
235
|
+
fontSize: u ?? "sm",
|
|
236
236
|
fontWeight: "semibold",
|
|
237
237
|
style: { transform: "translateX(-100%)" },
|
|
238
238
|
whiteSpace: "nowrap",
|
|
239
|
-
children:
|
|
239
|
+
children: r ? r(o) : o
|
|
240
240
|
}
|
|
241
241
|
) }),
|
|
242
|
-
|
|
243
|
-
/* @__PURE__ */ e.jsx(
|
|
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
|
-
|
|
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:
|
|
258
|
-
/* @__PURE__ */ e.jsx(We, { index: 1, w:
|
|
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
|
-
|
|
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
|
-
|
|
269
|
+
w,
|
|
270
270
|
{
|
|
271
|
-
fontSize:
|
|
271
|
+
fontSize: u ?? "sm",
|
|
272
272
|
fontWeight: "semibold",
|
|
273
273
|
whiteSpace: "nowrap",
|
|
274
|
-
children:
|
|
274
|
+
children: c(t)
|
|
275
275
|
}
|
|
276
276
|
),
|
|
277
277
|
/* @__PURE__ */ e.jsx(
|
|
278
|
-
|
|
278
|
+
w,
|
|
279
279
|
{
|
|
280
|
-
fontSize:
|
|
280
|
+
fontSize: u ?? "sm",
|
|
281
281
|
fontWeight: "semibold",
|
|
282
282
|
whiteSpace: "nowrap",
|
|
283
|
-
children:
|
|
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
|
-
|
|
297
|
+
p && /* @__PURE__ */ e.jsxs(
|
|
298
298
|
Ue,
|
|
299
299
|
{
|
|
300
300
|
width: "auto",
|
|
301
|
-
size:
|
|
301
|
+
size: u,
|
|
302
302
|
fontWeight: "bold",
|
|
303
|
-
value:
|
|
304
|
-
onChange: (
|
|
305
|
-
isDisabled:
|
|
303
|
+
value: C,
|
|
304
|
+
onChange: (v) => N(!0, v),
|
|
305
|
+
isDisabled: T || A,
|
|
306
306
|
children: [
|
|
307
|
-
/* @__PURE__ */ e.jsx("option", { value: -1, children:
|
|
308
|
-
/* @__PURE__ */ e.jsx("option", { value: 1, children:
|
|
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:
|
|
316
|
+
size: u ?? "sm",
|
|
317
317
|
min: 0,
|
|
318
|
-
max:
|
|
319
|
-
value:
|
|
320
|
-
onChange:
|
|
321
|
-
onBlur:
|
|
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:
|
|
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:
|
|
340
|
+
size: u ?? "sm",
|
|
341
341
|
min: 0,
|
|
342
|
-
max:
|
|
342
|
+
max: y < 0 ? Math.abs($ ?? t) : o,
|
|
343
343
|
precision: 0,
|
|
344
|
-
value: f === "" ? "" : Math.abs(Number(f ??
|
|
345
|
-
onChange:
|
|
346
|
-
onBlur:
|
|
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:
|
|
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
|
-
|
|
362
|
+
p && /* @__PURE__ */ e.jsxs(
|
|
363
363
|
Ue,
|
|
364
364
|
{
|
|
365
365
|
width: "auto",
|
|
366
|
-
size:
|
|
366
|
+
size: u,
|
|
367
367
|
fontWeight: "bold",
|
|
368
|
-
value:
|
|
369
|
-
onChange: (
|
|
370
|
-
isDisabled:
|
|
368
|
+
value: y,
|
|
369
|
+
onChange: (v) => N(!1, v),
|
|
370
|
+
isDisabled: T || A,
|
|
371
371
|
children: [
|
|
372
|
-
/* @__PURE__ */ e.jsx("option", { value: -1, children:
|
|
373
|
-
/* @__PURE__ */ e.jsx("option", { value: 1, children:
|
|
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, ...
|
|
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:
|
|
386
|
-
actionLowerCase:
|
|
387
|
-
}), [
|
|
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 ${
|
|
391
|
+
label: `This ${d.actionLowerCase} is owned by Quantum`,
|
|
392
392
|
"aria-label": "Quantum owned",
|
|
393
393
|
children: /* @__PURE__ */ e.jsx(
|
|
394
|
-
|
|
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 ${
|
|
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
|
|
418
|
-
return ln.filter(
|
|
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
|
-
(
|
|
425
|
+
(o) => o.useCases?.some((d) => t.includes(d.id)) ?? !1
|
|
426
426
|
), mn = ({
|
|
427
427
|
actions: n,
|
|
428
428
|
totalActions: t,
|
|
429
|
-
onCreate:
|
|
430
|
-
onDelete:
|
|
431
|
-
onEdit:
|
|
429
|
+
onCreate: o,
|
|
430
|
+
onDelete: d,
|
|
431
|
+
onEdit: m,
|
|
432
432
|
onView: i,
|
|
433
|
-
onSelected:
|
|
434
|
-
onDuplicate:
|
|
435
|
-
disableMultiSelect:
|
|
436
|
-
disableDelete:
|
|
437
|
-
disableEdit:
|
|
438
|
-
disableCreate:
|
|
439
|
-
hideUseCase:
|
|
440
|
-
tableProps:
|
|
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:
|
|
442
|
+
quantumIconSrc: l = "/favicon.ico"
|
|
443
443
|
}) => {
|
|
444
|
-
const [f,
|
|
445
|
-
action:
|
|
446
|
-
actionPlural:
|
|
447
|
-
actionLowerCase:
|
|
448
|
-
actionPluralLowerCase:
|
|
449
|
-
}), [
|
|
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
|
|
453
|
-
return
|
|
454
|
-
}, [n, f,
|
|
455
|
-
if (!
|
|
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
|
|
458
|
-
(
|
|
459
|
-
).map((
|
|
460
|
-
|
|
461
|
-
}, [n,
|
|
462
|
-
if (!
|
|
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
|
|
465
|
-
|
|
466
|
-
}, [n,
|
|
467
|
-
return /* @__PURE__ */ e.jsxs(
|
|
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
|
-
(
|
|
470
|
-
|
|
471
|
-
|
|
469
|
+
(o || d || g) && /* @__PURE__ */ e.jsxs(be, { mb: "1rem", gap: 4, children: [
|
|
470
|
+
o && /* @__PURE__ */ e.jsxs(
|
|
471
|
+
V,
|
|
472
472
|
{
|
|
473
|
-
isDisabled: !
|
|
473
|
+
isDisabled: !o || A,
|
|
474
474
|
colorScheme: "blackAlpha",
|
|
475
475
|
backgroundColor: "gray.700",
|
|
476
|
-
onClick:
|
|
476
|
+
onClick: o,
|
|
477
477
|
children: [
|
|
478
478
|
"Create New ",
|
|
479
|
-
|
|
479
|
+
$.action
|
|
480
480
|
]
|
|
481
481
|
}
|
|
482
482
|
),
|
|
483
|
-
|
|
483
|
+
d && !r && /* @__PURE__ */ e.jsx(
|
|
484
484
|
_e,
|
|
485
485
|
{
|
|
486
|
-
label:
|
|
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
|
-
|
|
489
|
+
V,
|
|
490
490
|
{
|
|
491
491
|
colorScheme: "gray",
|
|
492
|
-
isDisabled: !
|
|
492
|
+
isDisabled: !G || !d || c,
|
|
493
493
|
onClick: k,
|
|
494
494
|
children: "Delete Selected"
|
|
495
495
|
}
|
|
496
496
|
)
|
|
497
497
|
}
|
|
498
498
|
),
|
|
499
|
-
|
|
500
|
-
|
|
499
|
+
g && !r && /* @__PURE__ */ e.jsx(
|
|
500
|
+
V,
|
|
501
501
|
{
|
|
502
502
|
colorScheme: "gray",
|
|
503
|
-
isDisabled: !
|
|
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:
|
|
512
|
+
setSearch: h,
|
|
513
513
|
actions: n,
|
|
514
|
-
updateUseCases:
|
|
515
|
-
hideUseCaseFilter:
|
|
514
|
+
updateUseCases: y,
|
|
515
|
+
hideUseCaseFilter: x
|
|
516
516
|
}
|
|
517
517
|
)
|
|
518
518
|
] }),
|
|
519
|
-
/* @__PURE__ */ e.jsx(Ze, { mr: "2rem", overflowX: "hidden", ...
|
|
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
|
-
!
|
|
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((
|
|
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
|
-
!
|
|
540
|
-
|
|
539
|
+
!r && "cursor-pointer",
|
|
540
|
+
j.selected && "bg-gray-200"
|
|
541
541
|
),
|
|
542
542
|
onClick: () => {
|
|
543
|
-
|
|
543
|
+
r || u?.(j, !j.selected);
|
|
544
544
|
},
|
|
545
545
|
children: [
|
|
546
546
|
/* @__PURE__ */ e.jsx(je, { children: /* @__PURE__ */ e.jsxs(fe, { children: [
|
|
547
|
-
!
|
|
548
|
-
(
|
|
549
|
-
|
|
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: (
|
|
556
|
-
|
|
555
|
+
onClick: (N) => {
|
|
556
|
+
N.stopPropagation(), i(j.id);
|
|
557
557
|
},
|
|
558
558
|
children: "View"
|
|
559
559
|
}
|
|
560
560
|
),
|
|
561
|
-
!
|
|
562
|
-
|
|
561
|
+
!j.quantumOwned && m && /* @__PURE__ */ e.jsx(
|
|
562
|
+
V,
|
|
563
563
|
{
|
|
564
|
-
isDisabled:
|
|
564
|
+
isDisabled: p,
|
|
565
565
|
ml: "1em",
|
|
566
566
|
size: "sm",
|
|
567
567
|
variant: "link",
|
|
568
568
|
colorScheme: "blue",
|
|
569
|
-
onClick: (
|
|
570
|
-
|
|
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:
|
|
581
|
-
quantumIconSrc:
|
|
580
|
+
action: j,
|
|
581
|
+
quantumIconSrc: l
|
|
582
582
|
}
|
|
583
583
|
),
|
|
584
|
-
|
|
584
|
+
j.name
|
|
585
585
|
] }) }),
|
|
586
|
-
/* @__PURE__ */ e.jsx(je, { maxW: "20rem", whiteSpace: "break-spaces", children: un(
|
|
587
|
-
!
|
|
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:
|
|
591
|
+
tags: j.useCases?.map((N) => N.name) ?? []
|
|
592
592
|
}
|
|
593
593
|
) })
|
|
594
594
|
]
|
|
595
595
|
},
|
|
596
|
-
|
|
596
|
+
j.id
|
|
597
597
|
)) })
|
|
598
598
|
] }) })
|
|
599
599
|
] });
|
|
600
600
|
}, Un = ({
|
|
601
601
|
onSave: n,
|
|
602
602
|
onCancel: t,
|
|
603
|
-
onError:
|
|
604
|
-
hideButtons:
|
|
605
|
-
setButtonDisabled:
|
|
603
|
+
onError: o,
|
|
604
|
+
hideButtons: d = !1,
|
|
605
|
+
setButtonDisabled: m,
|
|
606
606
|
setButtonOnClick: i,
|
|
607
|
-
quantumOwned:
|
|
607
|
+
quantumOwned: u
|
|
608
608
|
}) => {
|
|
609
|
-
const
|
|
610
|
-
singular:
|
|
611
|
-
plural:
|
|
612
|
-
pluralLowerCase:
|
|
613
|
-
singularLowerCase:
|
|
614
|
-
}), [
|
|
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
|
-
}), [
|
|
616
|
+
}), [y] = me({
|
|
617
617
|
query: Et,
|
|
618
|
-
variables: { groupId:
|
|
619
|
-
pause: !
|
|
618
|
+
variables: { groupId: x },
|
|
619
|
+
pause: !x
|
|
620
620
|
// Only run when group is selected
|
|
621
|
-
}), [,
|
|
621
|
+
}), [, T] = ie(ze), [, $] = ie(
|
|
622
622
|
at
|
|
623
|
-
), B =
|
|
624
|
-
(
|
|
625
|
-
) : [], [
|
|
626
|
-
(
|
|
627
|
-
) : [], [
|
|
628
|
-
(
|
|
629
|
-
), [k, b]),
|
|
630
|
-
(
|
|
631
|
-
const
|
|
632
|
-
|
|
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
|
-
),
|
|
636
|
-
(
|
|
637
|
-
const
|
|
638
|
-
s
|
|
635
|
+
), ee = F(
|
|
636
|
+
(a) => {
|
|
637
|
+
const s = a.map((L) => L.value);
|
|
638
|
+
l(s);
|
|
639
639
|
},
|
|
640
640
|
[]
|
|
641
|
-
),
|
|
642
|
-
async (
|
|
643
|
-
const
|
|
641
|
+
), I = F(
|
|
642
|
+
async (a) => {
|
|
643
|
+
const s = P(
|
|
644
644
|
we,
|
|
645
|
-
|
|
646
|
-
),
|
|
645
|
+
a.categories
|
|
646
|
+
), D = P(
|
|
647
647
|
Ee,
|
|
648
|
-
|
|
648
|
+
a.metadataGroups
|
|
649
649
|
).flatMap(
|
|
650
|
-
(U) => U.data.map((te) =>
|
|
650
|
+
(U) => U.data.map((te) => P(Pe, te).id)
|
|
651
651
|
), W = {
|
|
652
|
-
...
|
|
653
|
-
name: `${
|
|
652
|
+
...a,
|
|
653
|
+
name: `${a.name} (Copy)`,
|
|
654
654
|
// Add "(Copy)" suffix to distinguish
|
|
655
|
-
description:
|
|
656
|
-
instructionsPointOfInterest:
|
|
657
|
-
instructionsMovementReport:
|
|
658
|
-
laterality:
|
|
659
|
-
activityKind:
|
|
660
|
-
sensorLocations:
|
|
661
|
-
thresholds:
|
|
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:
|
|
666
|
-
quantumOwned:
|
|
667
|
-
metadataItemIds:
|
|
665
|
+
categories: s?.map((U) => U.id),
|
|
666
|
+
quantumOwned: u,
|
|
667
|
+
metadataItemIds: D,
|
|
668
668
|
id: void 0
|
|
669
|
-
},
|
|
670
|
-
if (
|
|
671
|
-
throw new Error(
|
|
672
|
-
if (
|
|
673
|
-
return
|
|
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
|
-
[
|
|
677
|
-
),
|
|
678
|
-
async (
|
|
679
|
-
const
|
|
680
|
-
if (
|
|
681
|
-
throw new Error(
|
|
682
|
-
if (
|
|
683
|
-
return
|
|
684
|
-
|
|
685
|
-
|
|
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
|
-
[
|
|
690
|
-
),
|
|
691
|
-
if (
|
|
692
|
-
const
|
|
693
|
-
`No ${
|
|
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
|
-
|
|
695
|
+
o?.(a), h(!1);
|
|
696
696
|
return;
|
|
697
697
|
}
|
|
698
698
|
try {
|
|
699
|
-
const
|
|
700
|
-
let
|
|
701
|
-
const
|
|
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
|
|
705
|
-
|
|
706
|
-
} catch (
|
|
704
|
+
const q = await L(W);
|
|
705
|
+
a.push(q);
|
|
706
|
+
} catch (q) {
|
|
707
707
|
console.error(
|
|
708
|
-
`Failed to ${
|
|
709
|
-
|
|
710
|
-
),
|
|
708
|
+
`Failed to ${D} ${c.singularLowerCase} "${W.name}":`,
|
|
709
|
+
q
|
|
710
|
+
), s++;
|
|
711
711
|
}
|
|
712
|
-
if (
|
|
713
|
-
const W =
|
|
714
|
-
|
|
715
|
-
title:
|
|
716
|
-
description:
|
|
717
|
-
status:
|
|
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?.(),
|
|
720
|
+
}), n?.(), S(""), l([]);
|
|
721
721
|
} else
|
|
722
722
|
throw new Error(
|
|
723
|
-
`Failed to ${
|
|
723
|
+
`Failed to ${D} any ${c.pluralLowerCase}`
|
|
724
724
|
);
|
|
725
|
-
} catch (
|
|
726
|
-
const
|
|
727
|
-
|
|
728
|
-
title: `${
|
|
729
|
-
description:
|
|
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
|
-
}),
|
|
733
|
+
}), o?.(a instanceof Error ? a : new Error(L));
|
|
734
734
|
} finally {
|
|
735
|
-
|
|
735
|
+
h(!1);
|
|
736
736
|
}
|
|
737
737
|
}, [
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
738
|
+
R,
|
|
739
|
+
p,
|
|
740
|
+
I,
|
|
741
|
+
j,
|
|
741
742
|
g,
|
|
742
|
-
m,
|
|
743
743
|
n,
|
|
744
|
-
|
|
745
|
-
]),
|
|
746
|
-
|
|
744
|
+
o
|
|
745
|
+
]), v = F(() => {
|
|
746
|
+
S(""), l([]), A("copy"), t?.();
|
|
747
747
|
}, [t]);
|
|
748
748
|
ae(() => {
|
|
749
|
-
|
|
749
|
+
m && m({
|
|
750
750
|
cancelButton: !1,
|
|
751
|
-
saveButton:
|
|
751
|
+
saveButton: R.length === 0 || f
|
|
752
752
|
});
|
|
753
|
-
}, [
|
|
753
|
+
}, [R.length, f, m]), ae(() => {
|
|
754
754
|
i && i({
|
|
755
|
-
cancelButton:
|
|
756
|
-
saveButton:
|
|
755
|
+
cancelButton: v,
|
|
756
|
+
saveButton: N
|
|
757
757
|
});
|
|
758
|
-
}, [i,
|
|
759
|
-
const
|
|
760
|
-
value:
|
|
761
|
-
label:
|
|
762
|
-
})), [B]), X =
|
|
763
|
-
value:
|
|
764
|
-
label:
|
|
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:
|
|
767
|
-
})), [k,
|
|
768
|
-
return /* @__PURE__ */ e.jsx(
|
|
769
|
-
|
|
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:
|
|
775
|
-
onChange: (
|
|
776
|
-
|
|
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(
|
|
780
|
+
/* @__PURE__ */ e.jsxs(w, { fontWeight: "medium", children: [
|
|
781
781
|
"Copy ",
|
|
782
|
-
|
|
782
|
+
c.plural
|
|
783
783
|
] }),
|
|
784
|
-
/* @__PURE__ */ e.jsxs(
|
|
784
|
+
/* @__PURE__ */ e.jsxs(w, { fontSize: "sm", color: "gray.600", children: [
|
|
785
785
|
"Create new ",
|
|
786
|
-
|
|
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(
|
|
792
|
+
/* @__PURE__ */ e.jsxs(w, { fontWeight: "medium", children: [
|
|
793
793
|
"Convert to Quantum Owned ",
|
|
794
|
-
|
|
794
|
+
c.singular
|
|
795
795
|
] }),
|
|
796
|
-
/* @__PURE__ */ e.jsxs(
|
|
796
|
+
/* @__PURE__ */ e.jsxs(w, { fontSize: "sm", color: "gray.600", children: [
|
|
797
797
|
"Convert existing",
|
|
798
798
|
" ",
|
|
799
|
-
|
|
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(
|
|
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:
|
|
814
|
-
value:
|
|
815
|
-
onChange:
|
|
816
|
-
isLoading:
|
|
817
|
-
isDisabled:
|
|
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
|
-
|
|
822
|
-
/* @__PURE__ */ e.jsx(
|
|
823
|
-
/* @__PURE__ */ e.jsxs(
|
|
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
|
-
|
|
825
|
+
C.error.message
|
|
826
826
|
] })
|
|
827
827
|
] })
|
|
828
828
|
] }),
|
|
829
|
-
|
|
829
|
+
x && /* @__PURE__ */ e.jsxs(Z, { children: [
|
|
830
830
|
/* @__PURE__ */ e.jsxs(ce, { children: [
|
|
831
831
|
"Select ",
|
|
832
|
-
|
|
832
|
+
c.plural,
|
|
833
833
|
" to",
|
|
834
834
|
" ",
|
|
835
|
-
|
|
835
|
+
p === "copy" ? "Copy" : "Convert"
|
|
836
836
|
] }),
|
|
837
|
-
|
|
837
|
+
se ? /* @__PURE__ */ e.jsxs(re, { children: [
|
|
838
838
|
/* @__PURE__ */ e.jsx(st, { size: "sm" }),
|
|
839
|
-
/* @__PURE__ */ e.jsxs(
|
|
839
|
+
/* @__PURE__ */ e.jsxs(w, { fontSize: "sm", color: "gray.600", children: [
|
|
840
840
|
"Loading ",
|
|
841
|
-
|
|
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 ${
|
|
848
|
+
placeholder: `Choose ${c.pluralLowerCase} to ${p}...`,
|
|
849
849
|
options: X,
|
|
850
850
|
value: X.filter(
|
|
851
|
-
(
|
|
851
|
+
(a) => b.includes(a.value)
|
|
852
852
|
),
|
|
853
|
-
onChange:
|
|
853
|
+
onChange: ee,
|
|
854
854
|
isDisabled: X.length === 0,
|
|
855
855
|
isClearable: !0,
|
|
856
856
|
isMulti: !0,
|
|
857
857
|
closeMenuOnSelect: !1,
|
|
858
|
-
formatOptionLabel: (
|
|
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(
|
|
861
|
-
|
|
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
|
-
|
|
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(
|
|
867
|
+
X.length === 0 && /* @__PURE__ */ e.jsxs(w, { fontSize: "sm", color: "gray.500", mt: 2, children: [
|
|
868
868
|
"No ",
|
|
869
|
-
|
|
869
|
+
c.pluralLowerCase,
|
|
870
870
|
" found"
|
|
871
871
|
] })
|
|
872
872
|
] }),
|
|
873
|
-
|
|
874
|
-
/* @__PURE__ */ e.jsx(
|
|
875
|
-
/* @__PURE__ */ e.jsxs(
|
|
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
|
-
|
|
877
|
+
c.pluralLowerCase,
|
|
878
878
|
":",
|
|
879
879
|
" ",
|
|
880
|
-
|
|
880
|
+
y.error.message
|
|
881
881
|
] })
|
|
882
882
|
] })
|
|
883
883
|
] }),
|
|
884
|
-
|
|
885
|
-
/* @__PURE__ */ e.jsx(
|
|
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
|
-
|
|
888
|
-
|
|
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(
|
|
899
|
-
|
|
898
|
+
/* @__PURE__ */ e.jsxs(w, { fontWeight: "medium", fontSize: "sm", children: [
|
|
899
|
+
s + 1,
|
|
900
900
|
". ",
|
|
901
|
-
|
|
901
|
+
a.name
|
|
902
902
|
] }),
|
|
903
|
-
|
|
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
|
-
|
|
913
|
+
a.description && /* @__PURE__ */ e.jsxs(w, { children: [
|
|
914
914
|
/* @__PURE__ */ e.jsx("strong", { children: "Description:" }),
|
|
915
915
|
" ",
|
|
916
|
-
|
|
916
|
+
a.description
|
|
917
917
|
] }),
|
|
918
|
-
/* @__PURE__ */ e.jsxs(
|
|
918
|
+
/* @__PURE__ */ e.jsxs(w, { children: [
|
|
919
919
|
/* @__PURE__ */ e.jsx("strong", { children: "Type:" }),
|
|
920
920
|
" ",
|
|
921
|
-
|
|
921
|
+
a.activityKind
|
|
922
922
|
] }),
|
|
923
|
-
/* @__PURE__ */ e.jsxs(
|
|
923
|
+
/* @__PURE__ */ e.jsxs(w, { children: [
|
|
924
924
|
/* @__PURE__ */ e.jsx("strong", { children: "Laterality:" }),
|
|
925
925
|
" ",
|
|
926
|
-
|
|
926
|
+
a.laterality
|
|
927
927
|
] }),
|
|
928
|
-
/* @__PURE__ */ e.jsxs(
|
|
928
|
+
/* @__PURE__ */ e.jsxs(w, { children: [
|
|
929
929
|
/* @__PURE__ */ e.jsx("strong", { children: "Sensor Locations:" }),
|
|
930
930
|
" ",
|
|
931
|
-
|
|
931
|
+
a.sensorLocations.length
|
|
932
932
|
] }),
|
|
933
|
-
/* @__PURE__ */ e.jsxs(
|
|
933
|
+
/* @__PURE__ */ e.jsxs(w, { children: [
|
|
934
934
|
/* @__PURE__ */ e.jsx("strong", { children: "Thresholds:" }),
|
|
935
935
|
" ",
|
|
936
|
-
|
|
936
|
+
a.thresholds.length
|
|
937
937
|
] }),
|
|
938
|
-
/* @__PURE__ */ e.jsxs(
|
|
938
|
+
/* @__PURE__ */ e.jsxs(w, { children: [
|
|
939
939
|
/* @__PURE__ */ e.jsx("strong", { children: "Use Cases:" }),
|
|
940
940
|
" ",
|
|
941
|
-
|
|
941
|
+
a.useCases.map((L) => L.name).join(", ") || "None"
|
|
942
942
|
] })
|
|
943
943
|
]
|
|
944
944
|
}
|
|
945
945
|
)
|
|
946
946
|
]
|
|
947
947
|
},
|
|
948
|
-
|
|
948
|
+
a.id
|
|
949
949
|
)),
|
|
950
|
-
|
|
951
|
-
|
|
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(
|
|
959
|
+
children: /* @__PURE__ */ e.jsxs(w, { fontSize: "sm", fontWeight: "medium", color: "blue.800", children: [
|
|
960
960
|
"Total: ",
|
|
961
|
-
|
|
961
|
+
R.length,
|
|
962
962
|
" ",
|
|
963
|
-
|
|
963
|
+
c.pluralLowerCase,
|
|
964
964
|
" will be",
|
|
965
965
|
" ",
|
|
966
|
-
|
|
966
|
+
p === "copy" ? "copied" : "converted"
|
|
967
967
|
] })
|
|
968
968
|
}
|
|
969
969
|
)
|
|
970
970
|
] })
|
|
971
971
|
] }),
|
|
972
|
-
!
|
|
972
|
+
!d && /* @__PURE__ */ e.jsxs(be, { spacing: 4, justifyContent: "flex-end", children: [
|
|
973
973
|
/* @__PURE__ */ e.jsx(
|
|
974
|
-
|
|
974
|
+
V,
|
|
975
975
|
{
|
|
976
976
|
variant: "outline",
|
|
977
|
-
onClick:
|
|
977
|
+
onClick: v,
|
|
978
978
|
isDisabled: f,
|
|
979
979
|
children: "Cancel"
|
|
980
980
|
}
|
|
981
981
|
),
|
|
982
982
|
/* @__PURE__ */ e.jsxs(
|
|
983
|
-
|
|
983
|
+
V,
|
|
984
984
|
{
|
|
985
|
-
colorScheme:
|
|
986
|
-
onClick:
|
|
987
|
-
isDisabled:
|
|
985
|
+
colorScheme: p === "copy" ? "blue" : "green",
|
|
986
|
+
onClick: N,
|
|
987
|
+
isDisabled: R.length === 0 || f,
|
|
988
988
|
isLoading: f,
|
|
989
|
-
loadingText: `${
|
|
989
|
+
loadingText: `${p === "copy" ? "Copying" : "Converting"}...`,
|
|
990
990
|
children: [
|
|
991
|
-
|
|
991
|
+
p === "copy" ? "Copy" : "Convert",
|
|
992
992
|
" ",
|
|
993
|
-
|
|
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:
|
|
1003
|
-
hideButtons:
|
|
1004
|
-
setButtonDisabled:
|
|
1002
|
+
onError: o,
|
|
1003
|
+
hideButtons: d = !1,
|
|
1004
|
+
setButtonDisabled: m,
|
|
1005
1005
|
setButtonOnClick: i,
|
|
1006
|
-
quantumOwned:
|
|
1006
|
+
quantumOwned: u
|
|
1007
1007
|
}) => {
|
|
1008
|
-
const
|
|
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
|
-
}), [
|
|
1020
|
+
}), [T] = me({
|
|
1011
1021
|
query: Pt,
|
|
1012
|
-
variables: { groupId:
|
|
1013
|
-
pause: !
|
|
1022
|
+
variables: { groupId: A },
|
|
1023
|
+
pause: !A
|
|
1014
1024
|
// Only run when group is selected
|
|
1015
|
-
}), [,
|
|
1025
|
+
}), [, $] = ie(it), [, B] = ie(ct), [, k] = ie(ze), [, R] = ie(
|
|
1016
1026
|
at
|
|
1017
|
-
),
|
|
1018
|
-
(
|
|
1019
|
-
) : [], [
|
|
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
|
-
|
|
1022
|
-
).map((
|
|
1023
|
-
const
|
|
1031
|
+
T.data?.modules
|
|
1032
|
+
).map((L) => {
|
|
1033
|
+
const D = P(
|
|
1024
1034
|
dt,
|
|
1025
|
-
|
|
1035
|
+
L.moduleActions
|
|
1026
1036
|
);
|
|
1027
1037
|
return {
|
|
1028
|
-
...
|
|
1029
|
-
moduleActions:
|
|
1038
|
+
...L,
|
|
1039
|
+
moduleActions: D.map((W) => ({
|
|
1030
1040
|
...W,
|
|
1031
|
-
action:
|
|
1041
|
+
action: P(pe, W.action)
|
|
1032
1042
|
})),
|
|
1033
|
-
categories:
|
|
1043
|
+
categories: P(
|
|
1034
1044
|
we,
|
|
1035
|
-
|
|
1045
|
+
L.categories
|
|
1036
1046
|
)
|
|
1037
1047
|
};
|
|
1038
|
-
}) : [], [
|
|
1039
|
-
(
|
|
1040
|
-
), [
|
|
1041
|
-
(
|
|
1042
|
-
const
|
|
1043
|
-
|
|
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
|
-
),
|
|
1047
|
-
(
|
|
1048
|
-
const
|
|
1049
|
-
|
|
1056
|
+
), N = F(
|
|
1057
|
+
(s) => {
|
|
1058
|
+
const L = s.map((D) => D.value);
|
|
1059
|
+
b(L);
|
|
1050
1060
|
},
|
|
1051
1061
|
[]
|
|
1052
|
-
),
|
|
1053
|
-
if (
|
|
1054
|
-
|
|
1055
|
-
const
|
|
1056
|
-
`No modules selected for ${
|
|
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
|
-
|
|
1068
|
+
o?.(s);
|
|
1059
1069
|
return;
|
|
1060
1070
|
}
|
|
1061
1071
|
try {
|
|
1062
|
-
const
|
|
1063
|
-
let
|
|
1064
|
-
for (const
|
|
1072
|
+
const s = [];
|
|
1073
|
+
let L = 0;
|
|
1074
|
+
for (const D of I)
|
|
1065
1075
|
try {
|
|
1066
|
-
let W =
|
|
1067
|
-
if (
|
|
1068
|
-
const
|
|
1069
|
-
if (
|
|
1070
|
-
if (
|
|
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
|
-
|
|
1074
|
-
),
|
|
1075
|
-
...
|
|
1083
|
+
H.categories
|
|
1084
|
+
), J = {
|
|
1085
|
+
...H,
|
|
1076
1086
|
quantumOwned: !0,
|
|
1077
|
-
thresholds:
|
|
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
|
-
},
|
|
1084
|
-
return
|
|
1085
|
-
|
|
1086
|
-
|
|
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 (
|
|
1090
|
-
const Ce = await
|
|
1091
|
-
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
|
-
|
|
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
|
-
|
|
1100
|
-
)).filter((
|
|
1109
|
+
q.map(U)
|
|
1110
|
+
)).filter((H) => !!H).map((H) => H.id);
|
|
1101
1111
|
}
|
|
1102
|
-
if (
|
|
1103
|
-
const
|
|
1104
|
-
name:
|
|
1105
|
-
description:
|
|
1112
|
+
if (h === "convert") {
|
|
1113
|
+
const q = {
|
|
1114
|
+
name: D.name,
|
|
1115
|
+
description: D.description || void 0,
|
|
1106
1116
|
actions: W,
|
|
1107
|
-
categories:
|
|
1117
|
+
categories: D.categories.map((te) => te.id),
|
|
1108
1118
|
quantumOwned: !0
|
|
1109
|
-
}, U = await
|
|
1110
|
-
id:
|
|
1111
|
-
input:
|
|
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
|
-
|
|
1129
|
+
s.push(te);
|
|
1120
1130
|
}
|
|
1121
1131
|
} else {
|
|
1122
|
-
const
|
|
1123
|
-
name: `${
|
|
1124
|
-
description:
|
|
1132
|
+
const q = {
|
|
1133
|
+
name: `${D.name} (Copy)`,
|
|
1134
|
+
description: D.description || void 0,
|
|
1125
1135
|
actions: W,
|
|
1126
|
-
categories:
|
|
1127
|
-
quantumOwned:
|
|
1128
|
-
}, U = await
|
|
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
|
-
|
|
1145
|
+
s.push(te);
|
|
1136
1146
|
}
|
|
1137
1147
|
}
|
|
1138
1148
|
} catch (W) {
|
|
1139
1149
|
console.error(
|
|
1140
|
-
`Failed to ${
|
|
1150
|
+
`Failed to ${h === "convert" ? "convert" : "copy"} module "${D.name}":`,
|
|
1141
1151
|
W
|
|
1142
|
-
),
|
|
1152
|
+
), L++;
|
|
1143
1153
|
}
|
|
1144
|
-
if (
|
|
1145
|
-
const
|
|
1146
|
-
|
|
1147
|
-
title:
|
|
1148
|
-
description:
|
|
1149
|
-
status:
|
|
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
|
-
}),
|
|
1162
|
+
}), s.length > 0 && n?.(), x(""), b([]);
|
|
1153
1163
|
} else
|
|
1154
1164
|
throw new Error(
|
|
1155
|
-
`Failed to ${
|
|
1165
|
+
`Failed to ${h === "convert" ? "convert" : "copy"} any modules`
|
|
1156
1166
|
);
|
|
1157
|
-
} catch (
|
|
1158
|
-
const
|
|
1159
|
-
|
|
1160
|
-
title:
|
|
1161
|
-
description:
|
|
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
|
-
}),
|
|
1175
|
+
}), o?.(s instanceof Error ? s : new Error(L));
|
|
1166
1176
|
} finally {
|
|
1167
|
-
|
|
1177
|
+
f(!1);
|
|
1168
1178
|
}
|
|
1169
1179
|
}, [
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
F,
|
|
1173
|
-
m,
|
|
1174
|
-
n,
|
|
1175
|
-
a,
|
|
1176
|
-
d,
|
|
1177
|
-
N,
|
|
1180
|
+
I,
|
|
1181
|
+
$,
|
|
1178
1182
|
B,
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
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
|
-
|
|
1195
|
+
m && m({
|
|
1185
1196
|
cancelButton: !1,
|
|
1186
|
-
saveButton:
|
|
1197
|
+
saveButton: I.length === 0 || l
|
|
1187
1198
|
});
|
|
1188
|
-
}, [
|
|
1199
|
+
}, [I.length, l, m]), ae(() => {
|
|
1189
1200
|
i && i({
|
|
1190
|
-
cancelButton:
|
|
1191
|
-
saveButton:
|
|
1201
|
+
cancelButton: E,
|
|
1202
|
+
saveButton: v
|
|
1192
1203
|
});
|
|
1193
|
-
}, [i,
|
|
1194
|
-
const
|
|
1195
|
-
value:
|
|
1196
|
-
label:
|
|
1197
|
-
})), [
|
|
1198
|
-
value:
|
|
1199
|
-
label:
|
|
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:
|
|
1202
|
-
})), [
|
|
1203
|
-
|
|
1204
|
-
|
|
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:
|
|
1220
|
-
onChange: (
|
|
1221
|
-
|
|
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(
|
|
1226
|
+
/* @__PURE__ */ e.jsxs(w, { fontWeight: "medium", children: [
|
|
1226
1227
|
"Copy ",
|
|
1227
|
-
|
|
1228
|
+
c.plural
|
|
1228
1229
|
] }),
|
|
1229
|
-
/* @__PURE__ */ e.jsxs(
|
|
1230
|
+
/* @__PURE__ */ e.jsxs(w, { fontSize: "sm", color: "gray.600", children: [
|
|
1230
1231
|
"Create new ",
|
|
1231
|
-
|
|
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(
|
|
1237
|
-
/* @__PURE__ */ e.jsxs(
|
|
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
|
-
|
|
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(
|
|
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:
|
|
1254
|
-
value:
|
|
1255
|
-
onChange:
|
|
1256
|
-
isLoading:
|
|
1257
|
-
isDisabled:
|
|
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
|
-
|
|
1262
|
-
/* @__PURE__ */ e.jsx(
|
|
1263
|
-
/* @__PURE__ */ e.jsxs(
|
|
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
|
-
|
|
1266
|
+
y.error.message
|
|
1266
1267
|
] })
|
|
1267
1268
|
] })
|
|
1268
1269
|
] }),
|
|
1269
|
-
|
|
1270
|
-
/* @__PURE__ */ e.jsx(ce, { children:
|
|
1271
|
-
|
|
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(
|
|
1274
|
+
/* @__PURE__ */ e.jsxs(w, { fontSize: "sm", color: "gray.600", children: [
|
|
1274
1275
|
"Loading ",
|
|
1275
|
-
|
|
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:
|
|
1283
|
-
options:
|
|
1284
|
-
value:
|
|
1285
|
-
(
|
|
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:
|
|
1288
|
-
isDisabled:
|
|
1288
|
+
onChange: N,
|
|
1289
|
+
isDisabled: Q.length === 0,
|
|
1289
1290
|
isClearable: !0,
|
|
1290
1291
|
isMulti: !0,
|
|
1291
1292
|
closeMenuOnSelect: !1,
|
|
1292
|
-
formatOptionLabel: (
|
|
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(
|
|
1295
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1302
|
+
Q.length === 0 && /* @__PURE__ */ e.jsxs(w, { fontSize: "sm", color: "gray.500", mt: 2, children: [
|
|
1302
1303
|
"No ",
|
|
1303
|
-
|
|
1304
|
+
c.pluralLowerCase,
|
|
1304
1305
|
" found in this group"
|
|
1305
1306
|
] })
|
|
1306
1307
|
] }),
|
|
1307
|
-
|
|
1308
|
-
/* @__PURE__ */ e.jsx(
|
|
1309
|
-
/* @__PURE__ */ e.jsxs(
|
|
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
|
-
|
|
1312
|
+
c.pluralLowerCase,
|
|
1312
1313
|
":",
|
|
1313
1314
|
" ",
|
|
1314
|
-
|
|
1315
|
+
T.error.message
|
|
1315
1316
|
] })
|
|
1316
1317
|
] })
|
|
1317
1318
|
] }),
|
|
1318
|
-
|
|
1319
|
-
/* @__PURE__ */ e.jsx(
|
|
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
|
-
|
|
1322
|
-
|
|
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(
|
|
1333
|
-
|
|
1333
|
+
/* @__PURE__ */ e.jsxs(w, { fontWeight: "medium", fontSize: "sm", children: [
|
|
1334
|
+
L + 1,
|
|
1334
1335
|
". ",
|
|
1335
|
-
|
|
1336
|
+
s.name
|
|
1336
1337
|
] }),
|
|
1337
|
-
|
|
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
|
-
|
|
1348
|
+
s.description && /* @__PURE__ */ e.jsxs(w, { children: [
|
|
1348
1349
|
/* @__PURE__ */ e.jsx("strong", { children: "Description:" }),
|
|
1349
1350
|
" ",
|
|
1350
|
-
|
|
1351
|
+
s.description
|
|
1351
1352
|
] }),
|
|
1352
|
-
/* @__PURE__ */ e.jsxs(
|
|
1353
|
+
/* @__PURE__ */ e.jsxs(w, { children: [
|
|
1353
1354
|
/* @__PURE__ */ e.jsx("strong", { children: "Activities:" }),
|
|
1354
1355
|
" ",
|
|
1355
|
-
|
|
1356
|
+
s.moduleActions.length
|
|
1356
1357
|
] }),
|
|
1357
|
-
/* @__PURE__ */ e.jsxs(
|
|
1358
|
+
/* @__PURE__ */ e.jsxs(w, { children: [
|
|
1358
1359
|
/* @__PURE__ */ e.jsx("strong", { children: "Categories:" }),
|
|
1359
1360
|
" ",
|
|
1360
|
-
|
|
1361
|
+
s.categories.map((D) => D.name).join(", ") || "None"
|
|
1361
1362
|
] })
|
|
1362
1363
|
]
|
|
1363
1364
|
}
|
|
1364
1365
|
)
|
|
1365
1366
|
]
|
|
1366
1367
|
},
|
|
1367
|
-
|
|
1368
|
+
s.id
|
|
1368
1369
|
)),
|
|
1369
|
-
|
|
1370
|
-
|
|
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(
|
|
1379
|
+
children: /* @__PURE__ */ e.jsxs(w, { fontSize: "sm", fontWeight: "medium", color: "blue.800", children: [
|
|
1379
1380
|
"Total: ",
|
|
1380
|
-
|
|
1381
|
+
I.length,
|
|
1381
1382
|
" ",
|
|
1382
|
-
|
|
1383
|
+
c.pluralLowerCase,
|
|
1383
1384
|
" will be",
|
|
1384
1385
|
" ",
|
|
1385
|
-
|
|
1386
|
+
h === "copy" ? "copied" : "converted"
|
|
1386
1387
|
] })
|
|
1387
1388
|
}
|
|
1388
1389
|
),
|
|
1389
|
-
|
|
1390
|
-
|
|
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(
|
|
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
|
-
!
|
|
1403
|
+
!d && /* @__PURE__ */ e.jsxs(be, { spacing: 4, justifyContent: "flex-end", children: [
|
|
1403
1404
|
/* @__PURE__ */ e.jsx(
|
|
1404
|
-
|
|
1405
|
+
V,
|
|
1405
1406
|
{
|
|
1406
1407
|
variant: "outline",
|
|
1407
|
-
onClick:
|
|
1408
|
-
isDisabled:
|
|
1408
|
+
onClick: E,
|
|
1409
|
+
isDisabled: l,
|
|
1409
1410
|
children: "Cancel"
|
|
1410
1411
|
}
|
|
1411
1412
|
),
|
|
1412
1413
|
/* @__PURE__ */ e.jsxs(
|
|
1413
|
-
|
|
1414
|
+
V,
|
|
1414
1415
|
{
|
|
1415
|
-
colorScheme:
|
|
1416
|
-
onClick:
|
|
1417
|
-
isDisabled:
|
|
1418
|
-
isLoading:
|
|
1419
|
-
loadingText: `${
|
|
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
|
-
|
|
1422
|
+
h === "copy" ? "Copy" : "Convert",
|
|
1422
1423
|
" ",
|
|
1423
|
-
|
|
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:
|
|
1433
|
-
selectedActionIds:
|
|
1434
|
-
setSelectedActionIds:
|
|
1433
|
+
actions: o,
|
|
1434
|
+
selectedActionIds: d,
|
|
1435
|
+
setSelectedActionIds: m,
|
|
1435
1436
|
availableCategories: i,
|
|
1436
|
-
selectedCategoryIds:
|
|
1437
|
-
setSelectedCategoryIds:
|
|
1438
|
-
description:
|
|
1439
|
-
setDescription:
|
|
1440
|
-
...
|
|
1437
|
+
selectedCategoryIds: u,
|
|
1438
|
+
setSelectedCategoryIds: g,
|
|
1439
|
+
description: r,
|
|
1440
|
+
setDescription: c,
|
|
1441
|
+
...p
|
|
1441
1442
|
}) => {
|
|
1442
|
-
const
|
|
1443
|
-
...
|
|
1444
|
-
selected:
|
|
1445
|
-
})), [
|
|
1446
|
-
() =>
|
|
1447
|
-
[
|
|
1448
|
-
),
|
|
1449
|
-
(
|
|
1450
|
-
|
|
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
|
-
[
|
|
1453
|
-
), f =
|
|
1454
|
-
(
|
|
1455
|
-
t(
|
|
1453
|
+
[d, m]
|
|
1454
|
+
), f = F(
|
|
1455
|
+
(C) => {
|
|
1456
|
+
t(C.target.value);
|
|
1456
1457
|
},
|
|
1457
1458
|
[t]
|
|
1458
|
-
),
|
|
1459
|
-
(
|
|
1460
|
-
|
|
1459
|
+
), h = F(
|
|
1460
|
+
(C) => {
|
|
1461
|
+
c?.(C.target.value);
|
|
1461
1462
|
},
|
|
1462
|
-
[
|
|
1463
|
+
[c]
|
|
1463
1464
|
);
|
|
1464
|
-
return /* @__PURE__ */ e.jsxs(
|
|
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:
|
|
1472
|
-
onChange:
|
|
1472
|
+
value: u,
|
|
1473
|
+
onChange: g
|
|
1473
1474
|
}
|
|
1474
1475
|
)
|
|
1475
1476
|
] }),
|
|
1476
1477
|
/* @__PURE__ */ e.jsx(
|
|
1477
1478
|
fn,
|
|
1478
1479
|
{
|
|
1479
|
-
description:
|
|
1480
|
-
onInputChange:
|
|
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:
|
|
1488
|
-
onAdjustActivities: () =>
|
|
1488
|
+
onChange: m,
|
|
1489
|
+
onAdjustActivities: () => A.onOpen()
|
|
1489
1490
|
}
|
|
1490
1491
|
),
|
|
1491
1492
|
/* @__PURE__ */ e.jsxs(
|
|
1492
1493
|
yt,
|
|
1493
1494
|
{
|
|
1494
|
-
isOpen:
|
|
1495
|
-
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:
|
|
1506
|
-
onSelected:
|
|
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
|
-
|
|
1517
|
+
V,
|
|
1517
1518
|
{
|
|
1518
1519
|
colorScheme: "blue",
|
|
1519
|
-
onClick:
|
|
1520
|
-
isDisabled:
|
|
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:
|
|
1535
|
-
return /* @__PURE__ */ e.jsxs(
|
|
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
|
-
|
|
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:
|
|
1556
|
+
onChange: o
|
|
1556
1557
|
}) => {
|
|
1557
|
-
const { getLabel:
|
|
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]),
|
|
1564
|
-
value:
|
|
1565
|
-
label:
|
|
1564
|
+
], [n]), u = M(() => i.map((g) => ({
|
|
1565
|
+
value: g.id,
|
|
1566
|
+
label: g.name
|
|
1566
1567
|
})), [i]);
|
|
1567
|
-
return /* @__PURE__ */ e.jsxs(
|
|
1568
|
+
return /* @__PURE__ */ e.jsxs(Z, { mb: 4, children: [
|
|
1568
1569
|
/* @__PURE__ */ e.jsxs(ce, { children: [
|
|
1569
|
-
|
|
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:
|
|
1577
|
-
value: t.length === 0 ? { value: "other", label: "Other" } : i.filter((
|
|
1578
|
-
value:
|
|
1579
|
-
label:
|
|
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: (
|
|
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
|
-
}) =>
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
/* @__PURE__ */ e.jsx(
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
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:
|
|
1618
|
+
onAdjustActivities: o
|
|
1610
1619
|
}) => {
|
|
1611
|
-
const { getLabel:
|
|
1612
|
-
module:
|
|
1613
|
-
moduleLowerCase:
|
|
1614
|
-
action:
|
|
1615
|
-
actionPlural:
|
|
1616
|
-
actionPluralLowerCase:
|
|
1617
|
-
}), [
|
|
1618
|
-
() => n.map((
|
|
1619
|
-
id:
|
|
1620
|
-
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(
|
|
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
|
-
|
|
1628
|
-
/* @__PURE__ */ e.jsxs(
|
|
1636
|
+
m.actionPlural,
|
|
1637
|
+
/* @__PURE__ */ e.jsxs(w, { fontSize: "sm", color: "gray.500", children: [
|
|
1629
1638
|
"Drag and drop to reorder the ",
|
|
1630
|
-
|
|
1639
|
+
m.actionPluralLowerCase,
|
|
1631
1640
|
" in this ",
|
|
1632
|
-
|
|
1641
|
+
m.moduleLowerCase,
|
|
1633
1642
|
"."
|
|
1634
1643
|
] })
|
|
1635
1644
|
] }) }),
|
|
1636
1645
|
/* @__PURE__ */ e.jsxs(
|
|
1637
|
-
|
|
1646
|
+
V,
|
|
1638
1647
|
{
|
|
1639
1648
|
size: "sm",
|
|
1640
1649
|
variant: "solid",
|
|
1641
1650
|
colorScheme: "blue",
|
|
1642
|
-
onClick:
|
|
1651
|
+
onClick: o,
|
|
1643
1652
|
children: [
|
|
1644
1653
|
"Add / Remove ",
|
|
1645
|
-
|
|
1654
|
+
m.actionPlural
|
|
1646
1655
|
]
|
|
1647
1656
|
}
|
|
1648
1657
|
)
|
|
1649
1658
|
] }),
|
|
1650
|
-
i.length === 0 ? /* @__PURE__ */ e.jsx(oe, { children: /* @__PURE__ */ e.jsxs(
|
|
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
|
-
|
|
1661
|
+
m.actionPluralLowerCase,
|
|
1653
1662
|
" selected for this",
|
|
1654
1663
|
" ",
|
|
1655
|
-
|
|
1664
|
+
m.moduleLowerCase,
|
|
1656
1665
|
".",
|
|
1657
1666
|
/* @__PURE__ */ e.jsxs(
|
|
1658
|
-
|
|
1667
|
+
V,
|
|
1659
1668
|
{
|
|
1660
1669
|
ml: "0.5em",
|
|
1661
1670
|
size: "sm",
|
|
1662
1671
|
variant: "link",
|
|
1663
1672
|
colorScheme: "blue",
|
|
1664
|
-
onClick:
|
|
1673
|
+
onClick: o,
|
|
1665
1674
|
children: [
|
|
1666
1675
|
"Add ",
|
|
1667
|
-
|
|
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: (
|
|
1677
|
-
const
|
|
1678
|
-
t(
|
|
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:
|
|
1688
|
-
disableRemove:
|
|
1689
|
-
disableKind:
|
|
1696
|
+
forceKind: o,
|
|
1697
|
+
disableRemove: d,
|
|
1698
|
+
disableKind: m,
|
|
1690
1699
|
isDisabled: i,
|
|
1691
|
-
lockRanges:
|
|
1692
|
-
...
|
|
1700
|
+
lockRanges: u,
|
|
1701
|
+
...g
|
|
1693
1702
|
}) => {
|
|
1694
|
-
const
|
|
1695
|
-
const b = Ye.indexOf(
|
|
1696
|
-
return b -
|
|
1697
|
-
}), [n]),
|
|
1698
|
-
(
|
|
1699
|
-
const b =
|
|
1700
|
-
(f) => f.id ===
|
|
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
|
|
1703
|
-
|
|
1711
|
+
let l = [...r];
|
|
1712
|
+
o && (S = { ...S, kind: o }), l[b] = S, u && (l = l.map((f) => ({
|
|
1704
1713
|
...f,
|
|
1705
|
-
min:
|
|
1706
|
-
max:
|
|
1707
|
-
}))), t(
|
|
1714
|
+
min: S.min,
|
|
1715
|
+
max: S.max
|
|
1716
|
+
}))), t(l);
|
|
1708
1717
|
},
|
|
1709
|
-
[t,
|
|
1710
|
-
),
|
|
1711
|
-
(
|
|
1712
|
-
const
|
|
1713
|
-
(b) => b.id !==
|
|
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(
|
|
1724
|
+
t(S);
|
|
1716
1725
|
},
|
|
1717
|
-
[t,
|
|
1726
|
+
[t, r]
|
|
1718
1727
|
);
|
|
1719
|
-
return /* @__PURE__ */ e.jsx(oe, { alignItems: "flex-start", overflowY: "auto", ...
|
|
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
|
|
1723
|
-
parameter:
|
|
1724
|
-
onChange: (b) =>
|
|
1725
|
-
onRemove:
|
|
1726
|
-
forceKind:
|
|
1727
|
-
disableKind:
|
|
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(
|
|
1739
|
+
`${JSON.stringify(x.id)}-${x.plane}`
|
|
1731
1740
|
)) });
|
|
1732
1741
|
}, Cn = ({
|
|
1733
1742
|
label: n,
|
|
1734
1743
|
parameter: t,
|
|
1735
|
-
onChange:
|
|
1736
|
-
onRemove:
|
|
1737
|
-
forceKind:
|
|
1744
|
+
onChange: o,
|
|
1745
|
+
onRemove: d,
|
|
1746
|
+
forceKind: m,
|
|
1738
1747
|
disableKind: i,
|
|
1739
|
-
isDisabled:
|
|
1748
|
+
isDisabled: u
|
|
1740
1749
|
}) => {
|
|
1741
|
-
const
|
|
1742
|
-
(
|
|
1750
|
+
const g = F(
|
|
1751
|
+
(p) => "joint" in t.id ? Zt(
|
|
1743
1752
|
t.id.joint,
|
|
1744
1753
|
t.plane,
|
|
1745
|
-
|
|
1754
|
+
p < 0 ? -1 : 1
|
|
1746
1755
|
) : Kt(
|
|
1747
1756
|
t.id.segment,
|
|
1748
1757
|
t.plane,
|
|
1749
|
-
|
|
1758
|
+
p < 0 ? -1 : 1
|
|
1750
1759
|
),
|
|
1751
1760
|
[t]
|
|
1752
|
-
), { min:
|
|
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
|
-
|
|
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
|
-
|
|
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:
|
|
1791
|
+
onClick: d
|
|
1783
1792
|
}
|
|
1784
1793
|
),
|
|
1785
|
-
!
|
|
1794
|
+
!m && /* @__PURE__ */ e.jsx(
|
|
1786
1795
|
on,
|
|
1787
1796
|
{
|
|
1788
1797
|
selectedItem: t?.kind ?? Ie.Limit,
|
|
1789
|
-
onChange: ({ value:
|
|
1790
|
-
isDisabled: i ||
|
|
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:
|
|
1813
|
-
max:
|
|
1821
|
+
min: r,
|
|
1822
|
+
max: c,
|
|
1814
1823
|
zeroMarker: !0,
|
|
1815
1824
|
value: [t.min, t.max],
|
|
1816
|
-
onChange: (
|
|
1817
|
-
formatValue: (
|
|
1818
|
-
valueLabel: (
|
|
1819
|
-
positiveNegativeLabels:
|
|
1820
|
-
isDisabled:
|
|
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:
|
|
1830
|
-
forceKind:
|
|
1831
|
-
singleValue:
|
|
1838
|
+
onChange: o,
|
|
1839
|
+
forceKind: d,
|
|
1840
|
+
singleValue: m,
|
|
1832
1841
|
singleValueSideless: i,
|
|
1833
|
-
editOnly:
|
|
1834
|
-
disableKind:
|
|
1835
|
-
maxParameters:
|
|
1836
|
-
...
|
|
1842
|
+
editOnly: u,
|
|
1843
|
+
disableKind: g,
|
|
1844
|
+
maxParameters: r,
|
|
1845
|
+
...c
|
|
1837
1846
|
}) => {
|
|
1838
|
-
const
|
|
1839
|
-
() => n.map((
|
|
1840
|
-
label: "segment" in
|
|
1841
|
-
value:
|
|
1842
|
-
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
|
-
),
|
|
1854
|
+
), x = M(() => {
|
|
1846
1855
|
if (!i || t.length === 0)
|
|
1847
|
-
return
|
|
1848
|
-
const
|
|
1849
|
-
return
|
|
1850
|
-
(f) => Se(f.value) === Se(
|
|
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
|
-
}, [
|
|
1853
|
-
() =>
|
|
1854
|
-
(
|
|
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
|
-
[
|
|
1857
|
-
), b =
|
|
1858
|
-
(
|
|
1859
|
-
const f =
|
|
1860
|
-
const
|
|
1861
|
-
(k) => Ae(k.id,
|
|
1862
|
-
),
|
|
1863
|
-
(k) => Ae(k.id,
|
|
1864
|
-
),
|
|
1865
|
-
(k) => Se(k.id) === Se(
|
|
1866
|
-
) : void 0,
|
|
1867
|
-
return
|
|
1868
|
-
id:
|
|
1869
|
-
plane:
|
|
1870
|
-
min:
|
|
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:
|
|
1881
|
+
kind: d ?? Ie.Limit
|
|
1873
1882
|
};
|
|
1874
1883
|
});
|
|
1875
|
-
|
|
1884
|
+
o(f);
|
|
1876
1885
|
},
|
|
1877
|
-
[
|
|
1886
|
+
[o, t, n, d, i]
|
|
1878
1887
|
);
|
|
1879
1888
|
return ae(() => {
|
|
1880
|
-
const
|
|
1881
|
-
(f) => n.some((
|
|
1889
|
+
const l = t.filter(
|
|
1890
|
+
(f) => n.some((h) => Ae(h.id, f.id) && h.plane === f.plane)
|
|
1882
1891
|
);
|
|
1883
|
-
|
|
1884
|
-
}, [n,
|
|
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: !
|
|
1897
|
+
isMulti: !m,
|
|
1889
1898
|
placeholder: t.length ? `${t.length} selected` : "Search...",
|
|
1890
|
-
value:
|
|
1891
|
-
isDisabled:
|
|
1892
|
-
onChange: (
|
|
1893
|
-
options:
|
|
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:
|
|
1904
|
-
forceKind:
|
|
1905
|
-
disableKind:
|
|
1906
|
-
isDisabled:
|
|
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
|
|
1922
|
+
case z.Thorax:
|
|
1914
1923
|
return "Thorax";
|
|
1915
|
-
case
|
|
1924
|
+
case z.CenterBack:
|
|
1916
1925
|
return "Center Back";
|
|
1917
|
-
case
|
|
1926
|
+
case z.Pelvis:
|
|
1918
1927
|
return "Pelvis";
|
|
1919
|
-
case
|
|
1928
|
+
case z.LeftThigh:
|
|
1920
1929
|
return "Left Thigh";
|
|
1921
|
-
case
|
|
1930
|
+
case z.RightThigh:
|
|
1922
1931
|
return "Right Thigh";
|
|
1923
|
-
case
|
|
1932
|
+
case z.LeftShank:
|
|
1924
1933
|
return "Left Shank";
|
|
1925
|
-
case
|
|
1934
|
+
case z.RightShank:
|
|
1926
1935
|
return "Right Shank";
|
|
1927
|
-
case
|
|
1936
|
+
case z.LeftFoot:
|
|
1928
1937
|
return "Left Foot";
|
|
1929
|
-
case
|
|
1938
|
+
case z.RightFoot:
|
|
1930
1939
|
return "Right Foot";
|
|
1931
|
-
case
|
|
1940
|
+
case z.LeftUpperArm:
|
|
1932
1941
|
return "Left Upper Arm";
|
|
1933
|
-
case
|
|
1942
|
+
case z.RightUpperArm:
|
|
1934
1943
|
return "Right Upper Arm";
|
|
1935
|
-
case
|
|
1944
|
+
case z.LeftForearm:
|
|
1936
1945
|
return "Left Forearm";
|
|
1937
|
-
case
|
|
1946
|
+
case z.RightForearm:
|
|
1938
1947
|
return "Right Forearm";
|
|
1939
|
-
case
|
|
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
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
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:
|
|
1961
|
-
onSave:
|
|
1962
|
-
hideButtons:
|
|
1969
|
+
onCancel: o,
|
|
1970
|
+
onSave: d,
|
|
1971
|
+
hideButtons: m,
|
|
1963
1972
|
setButtonOnClick: i,
|
|
1964
|
-
setButtonDisabled:
|
|
1965
|
-
quantumOwned:
|
|
1966
|
-
isView:
|
|
1973
|
+
setButtonDisabled: u,
|
|
1974
|
+
quantumOwned: g,
|
|
1975
|
+
isView: r
|
|
1967
1976
|
}) => {
|
|
1968
|
-
const
|
|
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
|
-
}),
|
|
1973
|
-
|
|
1981
|
+
}), l = P(
|
|
1982
|
+
pe,
|
|
1974
1983
|
b?.getActionById
|
|
1975
|
-
), f =
|
|
1976
|
-
action:
|
|
1977
|
-
}), [
|
|
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: `${
|
|
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
|
-
], [
|
|
1984
|
-
() =>
|
|
1985
|
-
[
|
|
1986
|
-
),
|
|
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 =
|
|
1989
|
-
(
|
|
1997
|
+
const O = T.map(
|
|
1998
|
+
(J) => c.query(Gt, { key: J.key })
|
|
1990
1999
|
);
|
|
1991
|
-
Promise.all(O).then((
|
|
1992
|
-
const
|
|
1993
|
-
|
|
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
|
-
|
|
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
|
-
}),
|
|
2016
|
+
}), se(Y);
|
|
2008
2017
|
});
|
|
2009
|
-
}, [
|
|
2010
|
-
if (
|
|
2011
|
-
const
|
|
2018
|
+
}, [c, T]), ae(() => {
|
|
2019
|
+
if (l) {
|
|
2020
|
+
const J = P(
|
|
2012
2021
|
Ee,
|
|
2013
|
-
|
|
2022
|
+
l.metadataGroups
|
|
2014
2023
|
).map(
|
|
2015
|
-
(ne) => ne.data.map((le) =>
|
|
2016
|
-
),
|
|
2017
|
-
name:
|
|
2018
|
-
description:
|
|
2019
|
-
cameraPlacement:
|
|
2020
|
-
videoLink:
|
|
2021
|
-
sensorLocations:
|
|
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(
|
|
2026
|
-
metadataIds:
|
|
2034
|
+
thresholds: en(l.thresholds),
|
|
2035
|
+
metadataIds: J.flat()
|
|
2027
2036
|
};
|
|
2028
|
-
B(
|
|
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
|
-
}, [
|
|
2031
|
-
const te =
|
|
2032
|
-
() => JSON.stringify(
|
|
2033
|
-
name:
|
|
2039
|
+
}, [l]);
|
|
2040
|
+
const te = M(
|
|
2041
|
+
() => JSON.stringify(q) !== JSON.stringify({
|
|
2042
|
+
name: $,
|
|
2034
2043
|
description: k,
|
|
2035
|
-
cameraPlacement:
|
|
2036
|
-
videoLink:
|
|
2037
|
-
sensorLocations:
|
|
2038
|
-
thresholds: He(
|
|
2039
|
-
metadataIds:
|
|
2044
|
+
cameraPlacement: G,
|
|
2045
|
+
videoLink: I,
|
|
2046
|
+
sensorLocations: a,
|
|
2047
|
+
thresholds: He(L),
|
|
2048
|
+
metadataIds: E
|
|
2040
2049
|
}),
|
|
2041
2050
|
[
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2051
|
+
q,
|
|
2052
|
+
$,
|
|
2053
|
+
a,
|
|
2045
2054
|
k,
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2055
|
+
G,
|
|
2056
|
+
I,
|
|
2057
|
+
E,
|
|
2058
|
+
L
|
|
2050
2059
|
]
|
|
2051
|
-
),
|
|
2060
|
+
), H = F(() => {
|
|
2052
2061
|
const O = {
|
|
2053
|
-
name:
|
|
2062
|
+
name: $,
|
|
2054
2063
|
description: k,
|
|
2055
|
-
cameraPlacement:
|
|
2056
|
-
videoLink:
|
|
2057
|
-
sensorLocations:
|
|
2058
|
-
thresholds: He(
|
|
2059
|
-
metadataItemIds:
|
|
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:
|
|
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
|
|
2067
|
-
|
|
2075
|
+
let J;
|
|
2076
|
+
h && n ? J = S({
|
|
2068
2077
|
id: n,
|
|
2069
2078
|
fields: O
|
|
2070
|
-
}) :
|
|
2079
|
+
}) : J = A({
|
|
2071
2080
|
fields: O
|
|
2072
|
-
}),
|
|
2073
|
-
|
|
2081
|
+
}), J.then(({ error: Y }) => {
|
|
2082
|
+
Y ? t(Y) : d();
|
|
2074
2083
|
});
|
|
2075
2084
|
}, [
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2085
|
+
g,
|
|
2086
|
+
A,
|
|
2087
|
+
S,
|
|
2079
2088
|
n,
|
|
2080
|
-
|
|
2081
|
-
|
|
2089
|
+
$,
|
|
2090
|
+
a,
|
|
2082
2091
|
k,
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2092
|
+
G,
|
|
2093
|
+
I,
|
|
2094
|
+
E,
|
|
2095
|
+
h,
|
|
2096
|
+
L,
|
|
2097
|
+
d,
|
|
2089
2098
|
t
|
|
2090
2099
|
]);
|
|
2091
2100
|
ae(() => {
|
|
2092
|
-
|
|
2101
|
+
u && u({
|
|
2093
2102
|
cancelButton: f,
|
|
2094
|
-
saveButton:
|
|
2103
|
+
saveButton: r ? !0 : f || !W || !te
|
|
2095
2104
|
});
|
|
2096
|
-
}, [f,
|
|
2105
|
+
}, [f, u, W, te, r]), ae(() => {
|
|
2097
2106
|
i && i({
|
|
2098
|
-
cancelButton:
|
|
2099
|
-
saveButton:
|
|
2100
|
-
} :
|
|
2107
|
+
cancelButton: o,
|
|
2108
|
+
saveButton: r ? () => {
|
|
2109
|
+
} : H
|
|
2101
2110
|
});
|
|
2102
|
-
}, [i,
|
|
2103
|
-
const Ce = (O,
|
|
2104
|
-
const
|
|
2105
|
-
if (!
|
|
2106
|
-
const ne =
|
|
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
|
-
) :
|
|
2109
|
-
X((le) => [...le.filter((ge) => Object.values(
|
|
2110
|
-
(Le) =>
|
|
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(
|
|
2118
|
-
/* @__PURE__ */ e.jsx(
|
|
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:
|
|
2131
|
+
value: $,
|
|
2123
2132
|
onChange: (O) => B(O.target.value),
|
|
2124
2133
|
type: "text",
|
|
2125
2134
|
placeholder: "i.e. Lunge & Return",
|
|
2126
|
-
isDisabled:
|
|
2135
|
+
isDisabled: r
|
|
2127
2136
|
}
|
|
2128
2137
|
)
|
|
2129
2138
|
] }),
|
|
2130
|
-
/* @__PURE__ */ e.jsxs(
|
|
2131
|
-
/* @__PURE__ */ e.jsx(
|
|
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:
|
|
2136
|
-
onChange: (O) =>
|
|
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:
|
|
2148
|
+
isDisabled: r
|
|
2140
2149
|
}
|
|
2141
2150
|
)
|
|
2142
2151
|
] }),
|
|
2143
|
-
/* @__PURE__ */ e.jsxs(
|
|
2144
|
-
/* @__PURE__ */ e.jsx(
|
|
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:
|
|
2149
|
-
onChange: (O) =>
|
|
2157
|
+
value: I,
|
|
2158
|
+
onChange: (O) => j(O.target.value),
|
|
2150
2159
|
type: "url",
|
|
2151
2160
|
placeholder: "(optional) https://...",
|
|
2152
|
-
isDisabled:
|
|
2161
|
+
isDisabled: r
|
|
2153
2162
|
}
|
|
2154
2163
|
)
|
|
2155
2164
|
] }),
|
|
2156
|
-
/* @__PURE__ */ e.jsxs(
|
|
2157
|
-
/* @__PURE__ */ e.jsx(
|
|
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) =>
|
|
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:
|
|
2174
|
+
isDisabled: r
|
|
2166
2175
|
}
|
|
2167
2176
|
)
|
|
2168
2177
|
] }),
|
|
2169
2178
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
2170
|
-
/* @__PURE__ */ e.jsx(
|
|
2171
|
-
|
|
2172
|
-
/* @__PURE__ */ e.jsx(
|
|
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:
|
|
2178
|
-
(
|
|
2186
|
+
value: Q[O.key]?.filter(
|
|
2187
|
+
(J) => E.includes(J.id)
|
|
2179
2188
|
),
|
|
2180
|
-
onChange: (
|
|
2181
|
-
Ce(O.key,
|
|
2189
|
+
onChange: (J) => {
|
|
2190
|
+
Ce(O.key, J);
|
|
2182
2191
|
},
|
|
2183
|
-
options:
|
|
2192
|
+
options: Q[O.key],
|
|
2184
2193
|
placeholder: `Select ${O.multi ? "one or more" : "one"} ${O.label.toLowerCase()}`,
|
|
2185
|
-
isDisabled:
|
|
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(
|
|
2194
|
-
/* @__PURE__ */ e.jsx(
|
|
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:
|
|
2200
|
-
onChange: (O) =>
|
|
2208
|
+
value: N,
|
|
2209
|
+
onChange: (O) => v([...O]),
|
|
2201
2210
|
options: Ln,
|
|
2202
|
-
isOptionDisabled: () =>
|
|
2203
|
-
isDisabled:
|
|
2211
|
+
isOptionDisabled: () => N.length >= vn,
|
|
2212
|
+
isDisabled: r
|
|
2204
2213
|
}
|
|
2205
2214
|
)
|
|
2206
2215
|
] }),
|
|
2207
|
-
/* @__PURE__ */ e.jsxs(
|
|
2208
|
-
/* @__PURE__ */ e.jsx(
|
|
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:
|
|
2213
|
-
value:
|
|
2214
|
-
onChange:
|
|
2215
|
-
editOnly:
|
|
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
|
-
(
|
|
2234
|
+
(m || r) && "hidden"
|
|
2226
2235
|
),
|
|
2227
2236
|
children: /* @__PURE__ */ e.jsxs(be, { mt: 16, gap: 4, children: [
|
|
2228
|
-
/* @__PURE__ */ e.jsx(
|
|
2237
|
+
/* @__PURE__ */ e.jsx(V, { colorScheme: "gray", isDisabled: f, onClick: o, children: "Cancel" }),
|
|
2229
2238
|
/* @__PURE__ */ e.jsx(
|
|
2230
|
-
|
|
2239
|
+
V,
|
|
2231
2240
|
{
|
|
2232
2241
|
colorScheme: "blue",
|
|
2233
2242
|
isDisabled: f || !W || !te,
|
|
2234
2243
|
isLoading: f,
|
|
2235
|
-
onClick:
|
|
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
|
-
},
|
|
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:
|
|
2247
|
-
onError:
|
|
2248
|
-
hideButtons:
|
|
2255
|
+
onSave: o,
|
|
2256
|
+
onError: d,
|
|
2257
|
+
hideButtons: m,
|
|
2249
2258
|
quantumOwned: i,
|
|
2250
|
-
setButtonOnClick:
|
|
2251
|
-
setButtonDisabled:
|
|
2259
|
+
setButtonOnClick: u,
|
|
2260
|
+
setButtonDisabled: g
|
|
2252
2261
|
}) => {
|
|
2253
|
-
const [{ data:
|
|
2262
|
+
const [{ data: r }] = me({
|
|
2254
2263
|
query: i ? Wt : Ut
|
|
2255
|
-
}), [{ data:
|
|
2264
|
+
}), [{ data: c }] = me({
|
|
2256
2265
|
query: Bt,
|
|
2257
2266
|
variables: { id: n },
|
|
2258
2267
|
pause: !n
|
|
2259
|
-
}), [{ data:
|
|
2268
|
+
}), [{ data: p }] = me({
|
|
2260
2269
|
query: Qt
|
|
2261
|
-
}),
|
|
2270
|
+
}), A = P(
|
|
2262
2271
|
we,
|
|
2263
|
-
|
|
2264
|
-
), [{ fetching:
|
|
2265
|
-
|
|
2266
|
-
i ?
|
|
2267
|
-
) ?? [],
|
|
2268
|
-
...
|
|
2269
|
-
]), [
|
|
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
|
-
|
|
2272
|
-
|
|
2273
|
-
(
|
|
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
|
-
}, [
|
|
2277
|
-
const
|
|
2278
|
-
let
|
|
2279
|
-
const
|
|
2280
|
-
actions:
|
|
2281
|
-
name:
|
|
2282
|
-
categories: k.filter((
|
|
2283
|
-
description:
|
|
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
|
-
|
|
2287
|
-
id:
|
|
2288
|
-
input:
|
|
2289
|
-
}) :
|
|
2290
|
-
input:
|
|
2291
|
-
}),
|
|
2292
|
-
|
|
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
|
-
|
|
2296
|
-
L,
|
|
2304
|
+
l,
|
|
2297
2305
|
S,
|
|
2298
|
-
|
|
2299
|
-
|
|
2306
|
+
y,
|
|
2307
|
+
$,
|
|
2308
|
+
G,
|
|
2300
2309
|
k,
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2310
|
+
h,
|
|
2311
|
+
o,
|
|
2312
|
+
d,
|
|
2304
2313
|
i
|
|
2305
2314
|
]);
|
|
2306
2315
|
return ae(() => {
|
|
2307
|
-
|
|
2308
|
-
cancelButton:
|
|
2309
|
-
saveButton:
|
|
2316
|
+
g && g({
|
|
2317
|
+
cancelButton: x || b,
|
|
2318
|
+
saveButton: x || b || !$ || G.trim().split(/\s+/).filter(Boolean).length > 40
|
|
2310
2319
|
});
|
|
2311
|
-
}, [
|
|
2312
|
-
|
|
2320
|
+
}, [g, x, b, y, $, G]), ae(() => {
|
|
2321
|
+
u && u({
|
|
2313
2322
|
cancelButton: t,
|
|
2314
|
-
saveButton:
|
|
2323
|
+
saveButton: I
|
|
2315
2324
|
});
|
|
2316
|
-
}, [
|
|
2325
|
+
}, [u, t, I]), /* @__PURE__ */ e.jsxs(K, { width: "100%", children: [
|
|
2317
2326
|
/* @__PURE__ */ e.jsx(
|
|
2318
2327
|
pn,
|
|
2319
2328
|
{
|
|
2320
|
-
name:
|
|
2329
|
+
name: $,
|
|
2321
2330
|
setName: B,
|
|
2322
2331
|
actions: f,
|
|
2323
|
-
selectedActionIds:
|
|
2324
|
-
setSelectedActionIds:
|
|
2325
|
-
availableCategories:
|
|
2332
|
+
selectedActionIds: y,
|
|
2333
|
+
setSelectedActionIds: T,
|
|
2334
|
+
availableCategories: A ?? [],
|
|
2326
2335
|
selectedCategoryIds: k,
|
|
2327
|
-
setSelectedCategoryIds:
|
|
2328
|
-
description:
|
|
2329
|
-
setDescription:
|
|
2336
|
+
setSelectedCategoryIds: R,
|
|
2337
|
+
description: G,
|
|
2338
|
+
setDescription: ee
|
|
2330
2339
|
}
|
|
2331
2340
|
),
|
|
2332
|
-
!
|
|
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
|
-
|
|
2343
|
+
V,
|
|
2335
2344
|
{
|
|
2336
2345
|
colorScheme: "gray",
|
|
2337
|
-
isDisabled:
|
|
2346
|
+
isDisabled: x || b,
|
|
2338
2347
|
onClick: t,
|
|
2339
2348
|
children: "Cancel"
|
|
2340
2349
|
}
|
|
2341
2350
|
),
|
|
2342
2351
|
/* @__PURE__ */ e.jsx(
|
|
2343
|
-
|
|
2352
|
+
V,
|
|
2344
2353
|
{
|
|
2345
2354
|
colorScheme: "blue",
|
|
2346
|
-
isDisabled:
|
|
2347
|
-
isLoading:
|
|
2348
|
-
onClick:
|
|
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
|
)
|