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