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