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