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