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