quantum-component-library 1.4.52-prod.0 → 1.4.53-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components.cjs +1 -1
- package/dist/components.js +1008 -972
- package/dist/{dnd-core-vendor-CewhYmpg.cjs → dnd-core-vendor-BpIne3vw.cjs} +1 -1
- package/dist/{dnd-core-vendor-MevRgDB0.js → dnd-core-vendor-CxLn_KVZ.js} +2 -2
- package/dist/generated/gql.d.ts +2 -2
- package/dist/generated/graphql.d.ts +3 -0
- package/dist/generated-graphql.cjs +1 -1
- package/dist/generated-graphql.js +1 -1
- package/dist/generated.cjs +1 -1
- package/dist/generated.js +1 -1
- package/dist/{graphql-BOkP_KIq.js → graphql-CN-pqRpK.js} +5 -4
- package/dist/{graphql-DxJeiMzl.cjs → graphql-Dm6zPwG7.cjs} +1 -0
- package/dist/{graphql-vendor-uvLTmCiR.js → graphql-vendor-Cx8Mc6Yz.js} +1 -1
- package/dist/{graphql-vendor-BppBsUpc.cjs → graphql-vendor-D1Yd8wq_.cjs} +1 -1
- package/dist/hooks.cjs +1 -1
- package/dist/hooks.js +4 -4
- package/dist/index.cjs +1 -1
- package/dist/index.js +73 -71
- package/dist/lib/services/index.d.ts +1 -0
- package/dist/lib/services/reports.d.ts +2 -0
- package/dist/{lodash-vendor-B-xpwrnm.js → lodash-vendor-3vLqZYsK.js} +1 -1
- package/dist/{lodash-vendor-CWf2psR2.cjs → lodash-vendor-BXoJ3fY7.cjs} +1 -1
- package/dist/other-DNeraOC1.cjs +1 -0
- package/dist/{other-OzryMihZ.js → other-V9jzzJwZ.js} +7 -6
- package/dist/providers.cjs +1 -1
- package/dist/providers.js +1 -1
- package/dist/quantum-component-library.css +1 -1
- package/dist/{react-dnd-vendor-BYAS_HOo.js → react-dnd-vendor-DpRaxBS3.js} +2 -2
- package/dist/{react-dnd-vendor-BqsnzPKT.cjs → react-dnd-vendor-GZ764FSN.cjs} +1 -1
- package/dist/{react-select-vendor-sW1B_api.cjs → react-select-vendor-2_u9DhYj.cjs} +1 -1
- package/dist/{react-select-vendor-_26lPW2Z.js → react-select-vendor-DAt1SKof.js} +1 -1
- package/dist/{services-human-B4_65njx.cjs → services-human-BelpNNkM.cjs} +1 -1
- package/dist/{services-human-BIz3wOu_.js → services-human-CoaB5w4L.js} +8 -8
- package/dist/services.cjs +1 -1
- package/dist/services.js +69 -51
- package/dist/types.cjs +1 -1
- package/dist/types.js +3 -3
- package/dist/{utils-conversion-pcEG40AR.js → utils-conversion-C9aq8_At.js} +1 -1
- package/dist/{utils-conversion-BYVStK4S.cjs → utils-conversion-CuA6asju.cjs} +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.js +1 -1
- package/dist/{vendor-Dj-hzYUa.cjs → vendor-BUPEP1f9.cjs} +1 -1
- package/dist/{vendor-BHWxqW4x.js → vendor-Bap2-34A.js} +1 -1
- package/package.json +1 -1
- package/dist/other-Cad4iUZr.cjs +0 -1
package/dist/components.js
CHANGED
|
@@ -1,53 +1,54 @@
|
|
|
1
1
|
import { j as e } from "./react-jsx-runtime-vendor-OVHDjVDe.js";
|
|
2
2
|
import "./moment-vendor-DMLRxgRE.js";
|
|
3
|
-
import { Flex as
|
|
4
|
-
import { useMemo as k, useState as
|
|
3
|
+
import { Flex as Ie, InputGroup as it, InputLeftElement as Pt, Icon as yt, Input as ve, FormLabel as Xe, ButtonGroup as Ae, Tooltip as st, Button as se, Box as te, RangeSlider as Gt, RangeSliderMark as nt, Text as S, RangeSliderTrack as Et, RangeSliderFilledTrack as _t, RangeSliderThumb as lt, Select as ct, NumberInput as dt, NumberInputField as ut, HStack as re, Tag as $e, FormControl as Y, TableContainer as zt, Table as Bt, Thead as Wt, Tr as mt, Th as Re, Tbody as Ut, Td as _e, Image as Qt, useToast as vt, VStack as de, RadioGroup as Ct, Radio as Ye, Alert as He, AlertIcon as Je, Spinner as wt, useDisclosure as qt, Modal as Kt, ModalOverlay as Yt, ModalContent as Ht, ModalHeader as Jt, ModalCloseButton as Xt, ModalBody as Zt, ModalFooter as Vt, Badge as St, IconButton as en, Tabs as tn, TabList as nn, Tab as ht, TabPanels as sn, TabPanel as pt, Textarea as ze } from "@chakra-ui/react";
|
|
4
|
+
import { useMemo as k, useState as _, useEffect as le, useCallback as G, createContext as rn, useContext as on, memo as Me, useRef as an } from "react";
|
|
5
5
|
import { getFragmentData as I } from "./generated.js";
|
|
6
|
-
import { G as
|
|
6
|
+
import { G as rt, M as je, a as be, b as Lt, c as ln, C as ot, d as It, e as Mt, R as Ze, f as De, T as Oe, A as Ce, g as cn, h as Ot, U as At, i as Qe, j as kt, k as dn, l as un, m as mn, n as hn, o as pn, p as gn } from "./graphql-CN-pqRpK.js";
|
|
7
7
|
import { c as qe } from "./utils-cn-CgdSr4hO.js";
|
|
8
|
-
import "./lodash-vendor-
|
|
9
|
-
import { useClient as
|
|
10
|
-
import { useUiLabelContext as
|
|
11
|
-
import { u as
|
|
12
|
-
import { s as
|
|
13
|
-
import { F as
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
|
|
8
|
+
import "./lodash-vendor-3vLqZYsK.js";
|
|
9
|
+
import { useClient as at, useQuery as we, useMutation as fe } from "urql";
|
|
10
|
+
import { useUiLabelContext as xe, useAllPartParameters as xn } from "./hooks.js";
|
|
11
|
+
import { u as fn } from "./ufuzzy-vendor-Dl0ZI6Av.js";
|
|
12
|
+
import { s as me } from "./react-select-vendor-DAt1SKof.js";
|
|
13
|
+
import { F as jn, a as bn, b as yn, c as vn } from "./react-icons-vendor-CMsTQrA0.js";
|
|
14
|
+
import { reportKindName as Le } from "./services.js";
|
|
15
|
+
import { D as Cn, H as wn, u as Sn, a as Ln } from "./react-dnd-vendor-DpRaxBS3.js";
|
|
16
|
+
import { g as Tt, a as Nt, b as In, c as Mn, d as On, e as gt, f as xt } from "./services-human-CoaB5w4L.js";
|
|
17
|
+
import { ThresholdKind as Ke, ReportKind as ae, ActionLaterality as An, SensorLocation as ue } from "./generated-graphql.js";
|
|
18
|
+
import { availablePlanes as ft, getAnalysisPartIdNoSide as Be } from "./types.js";
|
|
19
|
+
const kn = ({
|
|
19
20
|
setSearch: r,
|
|
20
21
|
actions: n,
|
|
21
22
|
updateUseCases: a,
|
|
22
23
|
hideUseCaseFilter: h = !1
|
|
23
24
|
}) => {
|
|
24
25
|
const x = k(
|
|
25
|
-
() => n?.flatMap((
|
|
26
|
-
label:
|
|
27
|
-
value:
|
|
26
|
+
() => n?.flatMap((m) => m.useCases).filter((m, u, p) => p.findIndex((s) => s.id === m.id) === u).map((m) => ({
|
|
27
|
+
label: m.name,
|
|
28
|
+
value: m.id
|
|
28
29
|
})) || [],
|
|
29
30
|
[n]
|
|
30
31
|
);
|
|
31
|
-
return /* @__PURE__ */ e.jsxs(
|
|
32
|
-
/* @__PURE__ */ e.jsxs(
|
|
33
|
-
/* @__PURE__ */ e.jsx(
|
|
32
|
+
return /* @__PURE__ */ e.jsxs(Ie, { width: "100%", alignContent: "space-evenly", gap: 4, children: [
|
|
33
|
+
/* @__PURE__ */ e.jsxs(it, { size: "md", flex: 1, children: [
|
|
34
|
+
/* @__PURE__ */ e.jsx(Pt, { children: /* @__PURE__ */ e.jsx(yt, { as: jn, color: "gray.300" }) }),
|
|
34
35
|
/* @__PURE__ */ e.jsx(
|
|
35
|
-
|
|
36
|
+
ve,
|
|
36
37
|
{
|
|
37
38
|
placeholder: "Search by name...",
|
|
38
39
|
width: "100%",
|
|
39
40
|
maxW: h ? void 0 : "30rem",
|
|
40
|
-
onChange: (
|
|
41
|
+
onChange: (m) => r(m.target.value)
|
|
41
42
|
}
|
|
42
43
|
)
|
|
43
44
|
] }),
|
|
44
|
-
!h && /* @__PURE__ */ e.jsx(
|
|
45
|
-
|
|
45
|
+
!h && /* @__PURE__ */ e.jsx(it, { size: "md", children: /* @__PURE__ */ e.jsx(
|
|
46
|
+
me,
|
|
46
47
|
{
|
|
47
48
|
size: "md",
|
|
48
49
|
chakraStyles: {
|
|
49
|
-
container: (
|
|
50
|
-
...
|
|
50
|
+
container: (m) => ({
|
|
51
|
+
...m,
|
|
51
52
|
width: "100%"
|
|
52
53
|
})
|
|
53
54
|
},
|
|
@@ -55,23 +56,23 @@ const Mn = ({
|
|
|
55
56
|
placeholder: "Filter use case",
|
|
56
57
|
isMulti: !0,
|
|
57
58
|
options: x,
|
|
58
|
-
onChange: (
|
|
59
|
+
onChange: (m) => a(m.map((u) => u.value))
|
|
59
60
|
}
|
|
60
61
|
) })
|
|
61
62
|
] });
|
|
62
|
-
},
|
|
63
|
+
}, ge = ({
|
|
63
64
|
children: r
|
|
64
|
-
}) => /* @__PURE__ */ e.jsx(Xe, { fontWeight: "bold", fontFamily: "sans-serif", fontSize: "large", children: r }),
|
|
65
|
+
}) => /* @__PURE__ */ e.jsx(Xe, { fontWeight: "bold", fontFamily: "sans-serif", fontSize: "large", children: r }), Tn = ({
|
|
65
66
|
items: r,
|
|
66
67
|
onChange: n,
|
|
67
68
|
selectedItem: a,
|
|
68
69
|
isDisabled: h,
|
|
69
70
|
selectedProps: x,
|
|
70
|
-
buttonProps:
|
|
71
|
+
buttonProps: m
|
|
71
72
|
}) => {
|
|
72
|
-
const
|
|
73
|
-
return /* @__PURE__ */ e.jsx(
|
|
74
|
-
|
|
73
|
+
const u = (s) => s === a || s.value === a, p = (s) => u(s) ? { ...m, ...x } : m;
|
|
74
|
+
return /* @__PURE__ */ e.jsx(Ae, { isAttached: !0, isDisabled: h, children: r.map((s, i) => /* @__PURE__ */ e.jsx(
|
|
75
|
+
st,
|
|
75
76
|
{
|
|
76
77
|
label: s.tooltip,
|
|
77
78
|
openDelay: 50,
|
|
@@ -82,7 +83,7 @@ const Mn = ({
|
|
|
82
83
|
children: /* @__PURE__ */ e.jsx(
|
|
83
84
|
se,
|
|
84
85
|
{
|
|
85
|
-
onClick: () =>
|
|
86
|
+
onClick: () => u(s) ? null : n(s, i),
|
|
86
87
|
isDisabled: s.disabled,
|
|
87
88
|
...p(s),
|
|
88
89
|
children: s.label
|
|
@@ -91,14 +92,14 @@ const Mn = ({
|
|
|
91
92
|
},
|
|
92
93
|
i
|
|
93
94
|
)) });
|
|
94
|
-
}, We = (r, n) => n < 0 ? -1 * Math.abs(r) : Math.abs(r),
|
|
95
|
+
}, We = (r, n) => n < 0 ? -1 * Math.abs(r) : Math.abs(r), Nn = ({
|
|
95
96
|
isReversed: r,
|
|
96
97
|
min: n,
|
|
97
98
|
max: a,
|
|
98
99
|
value: h,
|
|
99
100
|
onChange: x,
|
|
100
|
-
inputProps:
|
|
101
|
-
size:
|
|
101
|
+
inputProps: m,
|
|
102
|
+
size: u,
|
|
102
103
|
zeroMarker: p,
|
|
103
104
|
formatValue: s,
|
|
104
105
|
valueLabel: i,
|
|
@@ -106,86 +107,86 @@ const Mn = ({
|
|
|
106
107
|
isDisabled: C,
|
|
107
108
|
...L
|
|
108
109
|
}) => {
|
|
109
|
-
const [M, w] =
|
|
110
|
-
|
|
111
|
-
$ !== void 0 &&
|
|
112
|
-
}, [$,
|
|
110
|
+
const [M, w] = _([void 0, void 0]), v = M[0], c = M[1], d = p && n < -5 && a > 5, b = Number(h?.[0] ?? c ?? n) > 0 ? 1 : -1, j = Number(h?.[1] ?? c ?? a) < 0 ? -1 : 1, A = g?.[0] === g?.[1], $ = h?.[0], D = h?.[1];
|
|
111
|
+
le(() => {
|
|
112
|
+
$ !== void 0 && D !== void 0 && w([$.toFixed(0), D.toFixed(0)]);
|
|
113
|
+
}, [$, D, w]);
|
|
113
114
|
const O = G(
|
|
114
|
-
([T,
|
|
115
|
-
T <
|
|
115
|
+
([T, z]) => {
|
|
116
|
+
T < z && w([T.toFixed(0), z.toFixed(0)]);
|
|
116
117
|
},
|
|
117
118
|
[w]
|
|
118
|
-
),
|
|
119
|
-
([T,
|
|
120
|
-
T <
|
|
119
|
+
), R = G(
|
|
120
|
+
([T, z]) => {
|
|
121
|
+
T < z && x([T, z]);
|
|
121
122
|
},
|
|
122
123
|
[x]
|
|
123
|
-
),
|
|
124
|
-
w(([T,
|
|
125
|
-
const
|
|
124
|
+
), J = G(() => {
|
|
125
|
+
w(([T, z]) => {
|
|
126
|
+
const X = isNaN(Number(T)) ? n : Number(T), W = isNaN(Number(z)) ? a : Number(z), H = We(Number(X), b), l = We(Number(W), j), t = b < 0 ? Math.max(H, n) : Math.min(H, a), o = j < 0 ? Math.max(l, n) : Math.min(l, a);
|
|
126
127
|
return t > o ? (x([o, t]), [o.toFixed(0), t.toFixed(0)]) : (x([t, o]), [t.toFixed(0), o.toFixed(0)]);
|
|
127
128
|
});
|
|
128
|
-
}, [x, w,
|
|
129
|
+
}, [x, w, b, j, n, a]), oe = G(
|
|
129
130
|
(T) => {
|
|
130
|
-
const
|
|
131
|
-
w(([
|
|
131
|
+
const z = T === "" || isNaN(Number(T)) ? T : We(Number(T), b);
|
|
132
|
+
w(([X, W]) => [z.toString(), W]);
|
|
132
133
|
},
|
|
133
|
-
[w,
|
|
134
|
-
),
|
|
134
|
+
[w, b]
|
|
135
|
+
), N = G(
|
|
135
136
|
(T) => {
|
|
136
|
-
const
|
|
137
|
-
w(([
|
|
137
|
+
const z = T === "" || isNaN(Number(T)) ? T : We(Number(T), j);
|
|
138
|
+
w(([X, W]) => [X, z.toString()]);
|
|
138
139
|
},
|
|
139
140
|
[w, j]
|
|
140
|
-
),
|
|
141
|
-
() =>
|
|
142
|
-
[
|
|
143
|
-
),
|
|
144
|
-
(T,
|
|
145
|
-
const
|
|
146
|
-
if (!
|
|
141
|
+
), V = k(
|
|
142
|
+
() => u === "xs" ? "0.75rem" : void 0,
|
|
143
|
+
[u]
|
|
144
|
+
), ee = G(
|
|
145
|
+
(T, z) => {
|
|
146
|
+
const X = Number(z.target.value);
|
|
147
|
+
if (!v || !c || ![-1, 1].includes(X))
|
|
147
148
|
return;
|
|
148
|
-
const W = (t) =>
|
|
149
|
-
|
|
149
|
+
const W = (t) => X < 0 ? -1 * Math.abs(t) : Math.abs(t), H = T ? W(Number(v)) : Number(v), l = T ? Number(c) : W(Number(c));
|
|
150
|
+
H > l ? x([l, H]) : x([H, l]);
|
|
150
151
|
},
|
|
151
|
-
[
|
|
152
|
+
[v, c, x]
|
|
152
153
|
);
|
|
153
|
-
return /* @__PURE__ */ e.jsxs(
|
|
154
|
+
return /* @__PURE__ */ e.jsxs(Ie, { direction: "column", ...L, children: [
|
|
154
155
|
/* @__PURE__ */ e.jsx(te, { pt: "1em", mb: "-0.5em", children: /* @__PURE__ */ e.jsxs(
|
|
155
|
-
|
|
156
|
+
Gt,
|
|
156
157
|
{
|
|
157
158
|
"aria-label": ["min", "max"],
|
|
158
159
|
isReversed: r,
|
|
159
|
-
value: [Number(
|
|
160
|
+
value: [Number(v ?? n), Number(c ?? a)],
|
|
160
161
|
max: a,
|
|
161
162
|
min: n,
|
|
162
163
|
minStepsBetweenThumbs: 3,
|
|
163
164
|
step: 1,
|
|
164
165
|
onChange: O,
|
|
165
|
-
onChangeEnd:
|
|
166
|
+
onChangeEnd: R,
|
|
166
167
|
isDisabled: C,
|
|
167
168
|
children: [
|
|
168
|
-
/* @__PURE__ */ e.jsx(
|
|
169
|
+
/* @__PURE__ */ e.jsx(nt, { value: n, top: "-1em", children: /* @__PURE__ */ e.jsx(
|
|
169
170
|
S,
|
|
170
171
|
{
|
|
171
|
-
fontSize:
|
|
172
|
+
fontSize: u ?? "sm",
|
|
172
173
|
fontWeight: "semibold",
|
|
173
174
|
whiteSpace: "nowrap",
|
|
174
175
|
children: s ? s?.(n) : n
|
|
175
176
|
}
|
|
176
177
|
) }),
|
|
177
|
-
/* @__PURE__ */ e.jsx(
|
|
178
|
+
/* @__PURE__ */ e.jsx(nt, { value: a, top: "-1em", children: /* @__PURE__ */ e.jsx(
|
|
178
179
|
S,
|
|
179
180
|
{
|
|
180
|
-
fontSize:
|
|
181
|
+
fontSize: u ?? "sm",
|
|
181
182
|
fontWeight: "semibold",
|
|
182
183
|
style: { transform: "translateX(-100%)" },
|
|
183
184
|
whiteSpace: "nowrap",
|
|
184
185
|
children: s ? s(a) : a
|
|
185
186
|
}
|
|
186
187
|
) }),
|
|
187
|
-
|
|
188
|
-
/* @__PURE__ */ e.jsx(S, { fontSize:
|
|
188
|
+
d && /* @__PURE__ */ e.jsxs(nt, { value: 0, top: "-1em", pos: "relative", children: [
|
|
189
|
+
/* @__PURE__ */ e.jsx(S, { fontSize: u, fontWeight: "semibold", children: s?.(0) ?? "0" }),
|
|
189
190
|
/* @__PURE__ */ e.jsx(
|
|
190
191
|
te,
|
|
191
192
|
{
|
|
@@ -198,14 +199,14 @@ const Mn = ({
|
|
|
198
199
|
}
|
|
199
200
|
)
|
|
200
201
|
] }),
|
|
201
|
-
/* @__PURE__ */ e.jsx(
|
|
202
|
-
/* @__PURE__ */ e.jsx(
|
|
203
|
-
/* @__PURE__ */ e.jsx(
|
|
202
|
+
/* @__PURE__ */ e.jsx(Et, { children: /* @__PURE__ */ e.jsx(_t, {}) }),
|
|
203
|
+
/* @__PURE__ */ e.jsx(lt, { index: 0, w: V, h: V }),
|
|
204
|
+
/* @__PURE__ */ e.jsx(lt, { index: 1, w: V, h: V })
|
|
204
205
|
]
|
|
205
206
|
}
|
|
206
207
|
) }),
|
|
207
208
|
i && /* @__PURE__ */ e.jsxs(
|
|
208
|
-
|
|
209
|
+
Ie,
|
|
209
210
|
{
|
|
210
211
|
direction: r ? "row-reverse" : "row",
|
|
211
212
|
justifyContent: "space-between",
|
|
@@ -213,7 +214,7 @@ const Mn = ({
|
|
|
213
214
|
/* @__PURE__ */ e.jsx(
|
|
214
215
|
S,
|
|
215
216
|
{
|
|
216
|
-
fontSize:
|
|
217
|
+
fontSize: u ?? "sm",
|
|
217
218
|
fontWeight: "semibold",
|
|
218
219
|
whiteSpace: "nowrap",
|
|
219
220
|
children: i(n)
|
|
@@ -222,7 +223,7 @@ const Mn = ({
|
|
|
222
223
|
/* @__PURE__ */ e.jsx(
|
|
223
224
|
S,
|
|
224
225
|
{
|
|
225
|
-
fontSize:
|
|
226
|
+
fontSize: u ?? "sm",
|
|
226
227
|
fontWeight: "semibold",
|
|
227
228
|
whiteSpace: "nowrap",
|
|
228
229
|
children: i(a)
|
|
@@ -232,7 +233,7 @@ const Mn = ({
|
|
|
232
233
|
}
|
|
233
234
|
),
|
|
234
235
|
/* @__PURE__ */ e.jsxs(
|
|
235
|
-
|
|
236
|
+
Ie,
|
|
236
237
|
{
|
|
237
238
|
direction: r ? "row-reverse" : "row",
|
|
238
239
|
justifyContent: "center",
|
|
@@ -240,13 +241,13 @@ const Mn = ({
|
|
|
240
241
|
gap: "0.125em",
|
|
241
242
|
children: [
|
|
242
243
|
g && /* @__PURE__ */ e.jsxs(
|
|
243
|
-
|
|
244
|
+
ct,
|
|
244
245
|
{
|
|
245
246
|
width: "auto",
|
|
246
|
-
size:
|
|
247
|
+
size: u,
|
|
247
248
|
fontWeight: "bold",
|
|
248
|
-
value:
|
|
249
|
-
onChange: (T) =>
|
|
249
|
+
value: b,
|
|
250
|
+
onChange: (T) => ee(!0, T),
|
|
250
251
|
isDisabled: A || C,
|
|
251
252
|
children: [
|
|
252
253
|
/* @__PURE__ */ e.jsx("option", { value: -1, children: g[0] }),
|
|
@@ -255,22 +256,22 @@ const Mn = ({
|
|
|
255
256
|
}
|
|
256
257
|
),
|
|
257
258
|
/* @__PURE__ */ e.jsx(
|
|
258
|
-
|
|
259
|
+
dt,
|
|
259
260
|
{
|
|
260
261
|
precision: 0,
|
|
261
|
-
size:
|
|
262
|
+
size: u ?? "sm",
|
|
262
263
|
min: 0,
|
|
263
|
-
max:
|
|
264
|
-
value:
|
|
264
|
+
max: b < 0 ? Math.abs(n) : D ?? a,
|
|
265
|
+
value: v === "" ? "" : Math.abs(Number(v ?? n)),
|
|
265
266
|
onChange: oe,
|
|
266
|
-
onBlur:
|
|
267
|
+
onBlur: J,
|
|
267
268
|
borderWidth: 1,
|
|
268
269
|
borderRadius: 3,
|
|
269
270
|
borderColor: "#ccc",
|
|
270
271
|
isDisabled: C,
|
|
271
|
-
...
|
|
272
|
+
...m,
|
|
272
273
|
children: /* @__PURE__ */ e.jsx(
|
|
273
|
-
|
|
274
|
+
ut,
|
|
274
275
|
{
|
|
275
276
|
backgroundColor: "#fff",
|
|
276
277
|
paddingRight: 0,
|
|
@@ -280,22 +281,22 @@ const Mn = ({
|
|
|
280
281
|
}
|
|
281
282
|
),
|
|
282
283
|
/* @__PURE__ */ e.jsx(
|
|
283
|
-
|
|
284
|
+
dt,
|
|
284
285
|
{
|
|
285
|
-
size:
|
|
286
|
+
size: u ?? "sm",
|
|
286
287
|
min: 0,
|
|
287
288
|
max: j < 0 ? Math.abs($ ?? n) : a,
|
|
288
289
|
precision: 0,
|
|
289
290
|
value: c === "" ? "" : Math.abs(Number(c ?? a)),
|
|
290
|
-
onChange:
|
|
291
|
-
onBlur:
|
|
291
|
+
onChange: N,
|
|
292
|
+
onBlur: J,
|
|
292
293
|
borderWidth: 1,
|
|
293
294
|
borderRadius: 3,
|
|
294
295
|
borderColor: "#ccc",
|
|
295
296
|
isDisabled: C,
|
|
296
|
-
...
|
|
297
|
+
...m,
|
|
297
298
|
children: /* @__PURE__ */ e.jsx(
|
|
298
|
-
|
|
299
|
+
ut,
|
|
299
300
|
{
|
|
300
301
|
backgroundColor: "#fff",
|
|
301
302
|
paddingRight: 0,
|
|
@@ -305,13 +306,13 @@ const Mn = ({
|
|
|
305
306
|
}
|
|
306
307
|
),
|
|
307
308
|
g && /* @__PURE__ */ e.jsxs(
|
|
308
|
-
|
|
309
|
+
ct,
|
|
309
310
|
{
|
|
310
311
|
width: "auto",
|
|
311
|
-
size:
|
|
312
|
+
size: u,
|
|
312
313
|
fontWeight: "bold",
|
|
313
314
|
value: j,
|
|
314
|
-
onChange: (T) =>
|
|
315
|
+
onChange: (T) => ee(!1, T),
|
|
315
316
|
isDisabled: A || C,
|
|
316
317
|
children: [
|
|
317
318
|
/* @__PURE__ */ e.jsx("option", { value: -1, children: g[0] }),
|
|
@@ -323,15 +324,15 @@ const Mn = ({
|
|
|
323
324
|
}
|
|
324
325
|
)
|
|
325
326
|
] });
|
|
326
|
-
},
|
|
327
|
+
}, Rn = ({ tags: r, containerProps: n, ...a }) => /* @__PURE__ */ e.jsx(re, { ...n, children: r.map((h, x) => /* @__PURE__ */ e.jsx($e, { ...a, children: h }, x)) }), $n = new fn({}), Dn = ({
|
|
327
328
|
action: r,
|
|
328
329
|
quantumIconSrc: n
|
|
329
330
|
}) => {
|
|
330
|
-
const { getLabel: a } =
|
|
331
|
+
const { getLabel: a } = xe(), h = k(() => ({
|
|
331
332
|
actionLowerCase: a("action").toLocaleLowerCase()
|
|
332
333
|
}), [a]);
|
|
333
334
|
return r.quantumOwned ? /* @__PURE__ */ e.jsx(
|
|
334
|
-
|
|
335
|
+
st,
|
|
335
336
|
{
|
|
336
337
|
label: `This ${h.actionLowerCase} is owned by Quantum`,
|
|
337
338
|
"aria-label": "Quantum owned",
|
|
@@ -345,7 +346,7 @@ const Mn = ({
|
|
|
345
346
|
alignItems: "center",
|
|
346
347
|
justifyContent: "center",
|
|
347
348
|
children: /* @__PURE__ */ e.jsx(
|
|
348
|
-
|
|
349
|
+
Qt,
|
|
349
350
|
{
|
|
350
351
|
src: n,
|
|
351
352
|
boxSize: "1em",
|
|
@@ -356,29 +357,29 @@ const Mn = ({
|
|
|
356
357
|
)
|
|
357
358
|
}
|
|
358
359
|
) : null;
|
|
359
|
-
},
|
|
360
|
+
}, Fn = (r, n) => {
|
|
360
361
|
if (!n || !n.trim().length)
|
|
361
362
|
return r;
|
|
362
363
|
const a = r.map((x) => x.name ?? "");
|
|
363
|
-
return
|
|
364
|
-
},
|
|
364
|
+
return $n.filter(a, n)?.map((x) => r[x]) ?? [];
|
|
365
|
+
}, Pn = (r) => !r || r.length === 0 ? "None" : r.map(
|
|
365
366
|
(n) => (
|
|
366
367
|
// Convert camelCase to separate words (e.g., 'LeftFoot' -> 'Left Foot')
|
|
367
368
|
n.replace(/([A-Z])/g, " $1").trim()
|
|
368
369
|
)
|
|
369
|
-
).join(", "),
|
|
370
|
+
).join(", "), Gn = (r, n) => !n || n.length == 0 ? r : r.filter(
|
|
370
371
|
(a) => a.useCases?.some((h) => n.includes(h.id)) ?? !1
|
|
371
|
-
),
|
|
372
|
+
), En = (r, n, a) => !n || n.length === 0 ? r : r.filter((h) => {
|
|
372
373
|
const x = {};
|
|
373
|
-
return n.forEach((
|
|
374
|
-
for (const [
|
|
375
|
-
if (p.some((s) => s.id ===
|
|
376
|
-
x[
|
|
374
|
+
return n.forEach((m) => {
|
|
375
|
+
for (const [u, p] of Object.entries(a || {}))
|
|
376
|
+
if (p.some((s) => s.id === m)) {
|
|
377
|
+
x[u] || (x[u] = []), x[u].push(m);
|
|
377
378
|
break;
|
|
378
379
|
}
|
|
379
380
|
}), Object.entries(x).every(
|
|
380
|
-
([
|
|
381
|
-
const p = h.metadataGroups?.find((C) => I(je, C).key ===
|
|
381
|
+
([m, u]) => {
|
|
382
|
+
const p = h.metadataGroups?.find((C) => I(je, C).key === m);
|
|
382
383
|
if (!p)
|
|
383
384
|
return !1;
|
|
384
385
|
const s = I(
|
|
@@ -388,19 +389,19 @@ const Mn = ({
|
|
|
388
389
|
be,
|
|
389
390
|
s.data
|
|
390
391
|
).map((C) => C.id);
|
|
391
|
-
return
|
|
392
|
+
return u.some(
|
|
392
393
|
(C) => g.includes(C)
|
|
393
394
|
);
|
|
394
395
|
}
|
|
395
396
|
);
|
|
396
|
-
}),
|
|
397
|
+
}), _n = ({
|
|
397
398
|
actions: r,
|
|
398
399
|
totalActions: n,
|
|
399
400
|
onCreate: a,
|
|
400
401
|
onDelete: h,
|
|
401
402
|
onEdit: x,
|
|
402
|
-
onView:
|
|
403
|
-
onSelected:
|
|
403
|
+
onView: m,
|
|
404
|
+
onSelected: u,
|
|
404
405
|
onDuplicate: p,
|
|
405
406
|
disableMultiSelect: s,
|
|
406
407
|
disableDelete: i,
|
|
@@ -409,58 +410,58 @@ const Mn = ({
|
|
|
409
410
|
hideUseCase: L = !0,
|
|
410
411
|
showMetadataFilters: M = !0,
|
|
411
412
|
tableProps: w,
|
|
412
|
-
containerProps:
|
|
413
|
+
containerProps: v,
|
|
413
414
|
quantumIconSrc: c = "/favicon.ico"
|
|
414
415
|
}) => {
|
|
415
|
-
const [
|
|
416
|
-
action:
|
|
417
|
-
actionPlural:
|
|
418
|
-
actionLowerCase:
|
|
419
|
-
actionPluralLowerCase:
|
|
420
|
-
}), [
|
|
416
|
+
const [d, b] = _(""), [j, A] = _(), [$, D] = _([]), [O, R] = _({}), { getLabel: J } = xe(), oe = at(), N = k(() => ({
|
|
417
|
+
action: J("action"),
|
|
418
|
+
actionPlural: J("action_plural"),
|
|
419
|
+
actionLowerCase: J("action").toLocaleLowerCase(),
|
|
420
|
+
actionPluralLowerCase: J("action_plural").toLocaleLowerCase()
|
|
421
|
+
}), [J]), V = k(() => [
|
|
421
422
|
{ key: "module_category", label: "Link Category", multi: !0 },
|
|
422
|
-
{ key: "activity_type", label: `${
|
|
423
|
+
{ key: "activity_type", label: `${N.action} Type`, multi: !0 },
|
|
423
424
|
{ key: "session_type", label: "Session Type", multi: !0 },
|
|
424
425
|
{ key: "body_region", label: "Body Region", multi: !0 },
|
|
425
426
|
{ key: "sport", label: "Sport", multi: !0 }
|
|
426
|
-
], [
|
|
427
|
-
|
|
427
|
+
], [N.action]);
|
|
428
|
+
le(() => {
|
|
428
429
|
if (!M)
|
|
429
430
|
return;
|
|
430
|
-
const t =
|
|
431
|
-
(o) => oe.query(
|
|
431
|
+
const t = V.map(
|
|
432
|
+
(o) => oe.query(rt, { key: o.key })
|
|
432
433
|
);
|
|
433
434
|
Promise.all(t).then((o) => {
|
|
434
|
-
const
|
|
435
|
+
const y = {};
|
|
435
436
|
o.forEach((U) => {
|
|
436
437
|
if (U.error || !U.data) return;
|
|
437
438
|
const q = I(
|
|
438
439
|
je,
|
|
439
440
|
U.data.getMetadataByKey
|
|
440
|
-
),
|
|
441
|
+
), Q = I(
|
|
441
442
|
be,
|
|
442
443
|
q.data
|
|
443
444
|
);
|
|
444
|
-
|
|
445
|
-
label:
|
|
446
|
-
value:
|
|
447
|
-
id:
|
|
445
|
+
y[q.key] = Q.map((E) => ({
|
|
446
|
+
label: E.label || E.value,
|
|
447
|
+
value: E.value,
|
|
448
|
+
id: E.id
|
|
448
449
|
}));
|
|
449
|
-
}),
|
|
450
|
+
}), R(y);
|
|
450
451
|
});
|
|
451
|
-
}, [oe,
|
|
452
|
-
const
|
|
452
|
+
}, [oe, V, M]);
|
|
453
|
+
const ee = k(() => {
|
|
453
454
|
if (!r)
|
|
454
455
|
return;
|
|
455
|
-
const t =
|
|
456
|
-
return M ?
|
|
456
|
+
const t = Fn(r, d), o = L ? t : Gn(t, j);
|
|
457
|
+
return M ? En(
|
|
457
458
|
o,
|
|
458
459
|
$,
|
|
459
460
|
O
|
|
460
461
|
) : o;
|
|
461
462
|
}, [
|
|
462
463
|
r,
|
|
463
|
-
|
|
464
|
+
d,
|
|
464
465
|
j,
|
|
465
466
|
L,
|
|
466
467
|
M,
|
|
@@ -470,30 +471,30 @@ const Mn = ({
|
|
|
470
471
|
if (!h)
|
|
471
472
|
return;
|
|
472
473
|
const o = r.filter(
|
|
473
|
-
(
|
|
474
|
-
).map((
|
|
474
|
+
(y) => y.selected && !y.quantumOwned
|
|
475
|
+
).map((y) => y.id);
|
|
475
476
|
h(o);
|
|
476
|
-
}, [r, h]),
|
|
477
|
+
}, [r, h]), z = G(() => {
|
|
477
478
|
if (!p)
|
|
478
479
|
return;
|
|
479
480
|
const t = r.filter((o) => o.selected);
|
|
480
|
-
p(t.map((o) => o.id)),
|
|
481
|
-
}, [r, p,
|
|
481
|
+
p(t.map((o) => o.id)), u && t.forEach((o) => u(o, !1));
|
|
482
|
+
}, [r, p, u]), X = k(() => r.some((t) => t.selected && !t.quantumOwned), [r]), W = k(() => r.some((t) => t.selected), [r]), H = k(() => r.some((t) => t.selected && t.quantumOwned), [r]), l = G(
|
|
482
483
|
(t, o) => {
|
|
483
|
-
const
|
|
484
|
-
if (!
|
|
485
|
-
const U =
|
|
486
|
-
|
|
487
|
-
(
|
|
488
|
-
(ye) => ye.id ===
|
|
484
|
+
const y = V.find((q) => q.key === t);
|
|
485
|
+
if (!y) return;
|
|
486
|
+
const U = y.multi ? (o ?? []).map((q) => q.id) : o ? [o.id] : [];
|
|
487
|
+
D((q) => [...q.filter((E) => Object.values(O).flat().find((ce) => ce.id === E) && !Object.keys(O).find(
|
|
488
|
+
(ce) => O[ce]?.some(
|
|
489
|
+
(ye) => ye.id === E && ce === t
|
|
489
490
|
)
|
|
490
491
|
)), ...U]);
|
|
491
492
|
},
|
|
492
|
-
[
|
|
493
|
+
[V, O]
|
|
493
494
|
);
|
|
494
|
-
return /* @__PURE__ */ e.jsxs(te, { ...
|
|
495
|
-
/* @__PURE__ */ e.jsxs(
|
|
496
|
-
(a || h || p) && /* @__PURE__ */ e.jsxs(
|
|
495
|
+
return /* @__PURE__ */ e.jsxs(te, { ...v, children: [
|
|
496
|
+
/* @__PURE__ */ e.jsxs(Ie, { alignContent: "space-between", gap: 4, children: [
|
|
497
|
+
(a || h || p) && /* @__PURE__ */ e.jsxs(Ae, { mb: "1rem", gap: 4, children: [
|
|
497
498
|
a && /* @__PURE__ */ e.jsxs(
|
|
498
499
|
se,
|
|
499
500
|
{
|
|
@@ -503,20 +504,20 @@ const Mn = ({
|
|
|
503
504
|
onClick: a,
|
|
504
505
|
children: [
|
|
505
506
|
"Create New ",
|
|
506
|
-
|
|
507
|
+
N.action
|
|
507
508
|
]
|
|
508
509
|
}
|
|
509
510
|
),
|
|
510
511
|
h && !s && /* @__PURE__ */ e.jsx(
|
|
511
|
-
|
|
512
|
+
st,
|
|
512
513
|
{
|
|
513
|
-
label:
|
|
514
|
+
label: H ? X ? `Quantum-owned ${N.actionPluralLowerCase} are selected and will be skipped` : `Selected ${N.actionPluralLowerCase} are quantum-owned and cannot be deleted` : void 0,
|
|
514
515
|
shouldWrapChildren: !0,
|
|
515
516
|
children: /* @__PURE__ */ e.jsx(
|
|
516
517
|
se,
|
|
517
518
|
{
|
|
518
519
|
colorScheme: "gray",
|
|
519
|
-
isDisabled: !
|
|
520
|
+
isDisabled: !X || !h || i,
|
|
520
521
|
onClick: T,
|
|
521
522
|
children: "Delete Selected"
|
|
522
523
|
}
|
|
@@ -528,25 +529,25 @@ const Mn = ({
|
|
|
528
529
|
{
|
|
529
530
|
colorScheme: "gray",
|
|
530
531
|
isDisabled: !W,
|
|
531
|
-
onClick:
|
|
532
|
+
onClick: z,
|
|
532
533
|
children: "Duplicate Selected"
|
|
533
534
|
}
|
|
534
535
|
)
|
|
535
536
|
] }),
|
|
536
537
|
/* @__PURE__ */ e.jsx(
|
|
537
|
-
|
|
538
|
+
kn,
|
|
538
539
|
{
|
|
539
|
-
setSearch:
|
|
540
|
+
setSearch: b,
|
|
540
541
|
actions: r,
|
|
541
542
|
updateUseCases: A,
|
|
542
543
|
hideUseCaseFilter: L
|
|
543
544
|
}
|
|
544
545
|
)
|
|
545
546
|
] }),
|
|
546
|
-
M && O && /* @__PURE__ */ e.jsx(te, { my: 4, children: /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4", children:
|
|
547
|
+
M && O && /* @__PURE__ */ e.jsx(te, { my: 4, children: /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4", children: V.map((t) => /* @__PURE__ */ e.jsxs(Y, { children: [
|
|
547
548
|
/* @__PURE__ */ e.jsx(Xe, { fontSize: "sm", children: t.label }),
|
|
548
549
|
/* @__PURE__ */ e.jsx(
|
|
549
|
-
|
|
550
|
+
me,
|
|
550
551
|
{
|
|
551
552
|
chakraStyles: {
|
|
552
553
|
menu: (o) => ({
|
|
@@ -570,11 +571,11 @@ const Mn = ({
|
|
|
570
571
|
}
|
|
571
572
|
)
|
|
572
573
|
] }, t.key)) }) }),
|
|
573
|
-
/* @__PURE__ */ e.jsx(
|
|
574
|
-
/* @__PURE__ */ e.jsx(
|
|
574
|
+
/* @__PURE__ */ e.jsx(zt, { mr: "2rem", overflowX: "hidden", ...w, children: /* @__PURE__ */ e.jsxs(Bt, { size: "md", variant: "simple", children: [
|
|
575
|
+
/* @__PURE__ */ e.jsx(Wt, { position: "sticky", top: 0, bg: "white", zIndex: 1, children: /* @__PURE__ */ e.jsxs(mt, { children: [
|
|
575
576
|
/* @__PURE__ */ e.jsxs(Re, { fontWeight: "normal", children: [
|
|
576
577
|
"(showing ",
|
|
577
|
-
|
|
578
|
+
ee?.length ?? 0,
|
|
578
579
|
" of",
|
|
579
580
|
" ",
|
|
580
581
|
n ?? r.length,
|
|
@@ -585,8 +586,8 @@ const Mn = ({
|
|
|
585
586
|
!L && /* @__PURE__ */ e.jsx(Re, { children: "Use Case" }),
|
|
586
587
|
/* @__PURE__ */ e.jsx(Re, {})
|
|
587
588
|
] }) }),
|
|
588
|
-
/* @__PURE__ */ e.jsx(
|
|
589
|
-
|
|
589
|
+
/* @__PURE__ */ e.jsx(Ut, { children: ee?.map((t) => /* @__PURE__ */ e.jsxs(
|
|
590
|
+
mt,
|
|
590
591
|
{
|
|
591
592
|
className: qe(
|
|
592
593
|
"hover:bg-[#f7f7f7]",
|
|
@@ -594,12 +595,12 @@ const Mn = ({
|
|
|
594
595
|
t.selected && "bg-gray-200"
|
|
595
596
|
),
|
|
596
597
|
onClick: () => {
|
|
597
|
-
s ||
|
|
598
|
+
s || u?.(t, !t.selected);
|
|
598
599
|
},
|
|
599
600
|
children: [
|
|
600
|
-
/* @__PURE__ */ e.jsx(_e, { children: /* @__PURE__ */ e.jsxs(
|
|
601
|
-
!s && /* @__PURE__ */ e.jsx(e.Fragment, { children: t.selected ? /* @__PURE__ */ e.jsx(
|
|
602
|
-
(t.quantumOwned || !x) &&
|
|
601
|
+
/* @__PURE__ */ e.jsx(_e, { children: /* @__PURE__ */ e.jsxs(Ie, { children: [
|
|
602
|
+
!s && /* @__PURE__ */ e.jsx(e.Fragment, { children: t.selected ? /* @__PURE__ */ e.jsx(bn, { className: "text-blue-500" }) : /* @__PURE__ */ e.jsx(yn, { className: "text-gray-400" }) }),
|
|
603
|
+
(t.quantumOwned || !x) && m && /* @__PURE__ */ e.jsx(
|
|
603
604
|
se,
|
|
604
605
|
{
|
|
605
606
|
ml: "1em",
|
|
@@ -607,7 +608,7 @@ const Mn = ({
|
|
|
607
608
|
variant: "link",
|
|
608
609
|
colorScheme: "blue",
|
|
609
610
|
onClick: (o) => {
|
|
610
|
-
o.stopPropagation(),
|
|
611
|
+
o.stopPropagation(), m(t.id);
|
|
611
612
|
},
|
|
612
613
|
children: "View"
|
|
613
614
|
}
|
|
@@ -627,9 +628,9 @@ const Mn = ({
|
|
|
627
628
|
}
|
|
628
629
|
)
|
|
629
630
|
] }) }),
|
|
630
|
-
/* @__PURE__ */ e.jsx(_e, { whiteSpace: "break-spaces", children: /* @__PURE__ */ e.jsxs(
|
|
631
|
+
/* @__PURE__ */ e.jsx(_e, { whiteSpace: "break-spaces", children: /* @__PURE__ */ e.jsxs(Ie, { align: "center", gap: 2, children: [
|
|
631
632
|
/* @__PURE__ */ e.jsx(
|
|
632
|
-
|
|
633
|
+
Dn,
|
|
633
634
|
{
|
|
634
635
|
action: t,
|
|
635
636
|
quantumIconSrc: c
|
|
@@ -637,9 +638,9 @@ const Mn = ({
|
|
|
637
638
|
),
|
|
638
639
|
t.name
|
|
639
640
|
] }) }),
|
|
640
|
-
/* @__PURE__ */ e.jsx(_e, { maxW: "20rem", whiteSpace: "break-spaces", children:
|
|
641
|
+
/* @__PURE__ */ e.jsx(_e, { maxW: "20rem", whiteSpace: "break-spaces", children: Pn(t.sensorLocations) }),
|
|
641
642
|
!L && /* @__PURE__ */ e.jsx(_e, { maxW: "20rem", children: /* @__PURE__ */ e.jsx(
|
|
642
|
-
|
|
643
|
+
Rn,
|
|
643
644
|
{
|
|
644
645
|
containerProps: { flexWrap: "wrap" },
|
|
645
646
|
tags: t.useCases?.map((o) => o.name) ?? []
|
|
@@ -651,70 +652,70 @@ const Mn = ({
|
|
|
651
652
|
)) })
|
|
652
653
|
] }) })
|
|
653
654
|
] });
|
|
654
|
-
},
|
|
655
|
+
}, xs = ({
|
|
655
656
|
onSave: r,
|
|
656
657
|
onCancel: n,
|
|
657
658
|
onError: a,
|
|
658
659
|
hideButtons: h = !1,
|
|
659
660
|
setButtonDisabled: x,
|
|
660
|
-
setButtonOnClick:
|
|
661
|
-
quantumOwned:
|
|
661
|
+
setButtonOnClick: m,
|
|
662
|
+
quantumOwned: u
|
|
662
663
|
}) => {
|
|
663
|
-
const p =
|
|
664
|
+
const p = vt(), { getLabel: s } = xe(), i = k(() => ({
|
|
664
665
|
singular: s("action"),
|
|
665
666
|
plural: s("action_plural"),
|
|
666
667
|
pluralLowerCase: s("action_plural").toLowerCase(),
|
|
667
668
|
singularLowerCase: s("action").toLowerCase()
|
|
668
|
-
}), [s]), [g, C] =
|
|
669
|
-
query:
|
|
670
|
-
}), [j] =
|
|
671
|
-
query:
|
|
669
|
+
}), [s]), [g, C] = _("copy"), [L, M] = _(""), [w, v] = _([]), [c, d] = _(!1), [b] = we({
|
|
670
|
+
query: Lt
|
|
671
|
+
}), [j] = we({
|
|
672
|
+
query: ln,
|
|
672
673
|
variables: { groupId: L },
|
|
673
674
|
pause: !L
|
|
674
675
|
// Only run when group is selected
|
|
675
|
-
}), [, A] = fe(
|
|
676
|
-
|
|
677
|
-
),
|
|
678
|
-
(l) => I(
|
|
679
|
-
) : [], [
|
|
680
|
-
const o = I(
|
|
676
|
+
}), [, A] = fe(ot), [, $] = fe(
|
|
677
|
+
It
|
|
678
|
+
), D = k(() => b.data?.groups ? b.data.groups.map(
|
|
679
|
+
(l) => I(Mt, l)
|
|
680
|
+
) : [], [b.data]), O = k(() => j.data ? j.data.actions.map((t) => {
|
|
681
|
+
const o = I(Ce, t), y = I(
|
|
681
682
|
Ze,
|
|
682
683
|
o.reports
|
|
683
684
|
), U = I(
|
|
684
|
-
|
|
685
|
+
De,
|
|
685
686
|
o.categories
|
|
686
|
-
),
|
|
687
|
+
), Q = I(
|
|
687
688
|
je,
|
|
688
689
|
o.metadataGroups
|
|
689
|
-
).map((
|
|
690
|
-
...
|
|
691
|
-
data:
|
|
690
|
+
).map((E) => ({
|
|
691
|
+
...E,
|
|
692
|
+
data: E.data.map((K) => I(be, K))
|
|
692
693
|
}));
|
|
693
694
|
return {
|
|
694
695
|
...o,
|
|
695
|
-
thresholds: I(
|
|
696
|
-
reports:
|
|
697
|
-
...
|
|
698
|
-
thresholds: I(
|
|
696
|
+
thresholds: I(Oe, o.thresholds),
|
|
697
|
+
reports: y.map((E) => ({
|
|
698
|
+
...E,
|
|
699
|
+
thresholds: I(Oe, E.thresholds)
|
|
699
700
|
})),
|
|
700
701
|
categories: U,
|
|
701
|
-
metadataGroups:
|
|
702
|
+
metadataGroups: Q
|
|
702
703
|
};
|
|
703
|
-
}) : [], [j.data]),
|
|
704
|
+
}) : [], [j.data]), R = k(() => O.filter(
|
|
704
705
|
(l) => w.includes(l.id)
|
|
705
|
-
), [O, w]),
|
|
706
|
+
), [O, w]), J = G(
|
|
706
707
|
(l) => {
|
|
707
708
|
const t = l?.value || "";
|
|
708
|
-
M(t),
|
|
709
|
+
M(t), v([]);
|
|
709
710
|
},
|
|
710
711
|
[]
|
|
711
712
|
), oe = G(
|
|
712
713
|
(l) => {
|
|
713
714
|
const t = l.map((o) => o.value);
|
|
714
|
-
|
|
715
|
+
v(t);
|
|
715
716
|
},
|
|
716
717
|
[]
|
|
717
|
-
),
|
|
718
|
+
), N = G(
|
|
718
719
|
async (l) => {
|
|
719
720
|
const t = {
|
|
720
721
|
...l,
|
|
@@ -726,17 +727,17 @@ const Mn = ({
|
|
|
726
727
|
laterality: l.laterality,
|
|
727
728
|
activityKind: l.activityKind,
|
|
728
729
|
sensorLocations: l.sensorLocations,
|
|
729
|
-
thresholds: l.thresholds.map((
|
|
730
|
-
...
|
|
730
|
+
thresholds: l.thresholds.map((y) => ({
|
|
731
|
+
...y,
|
|
731
732
|
id: void 0
|
|
732
733
|
})),
|
|
733
|
-
categories: l.categories.map((
|
|
734
|
-
quantumOwned:
|
|
735
|
-
metadataItemIds: l.metadataGroups.flatMap((
|
|
736
|
-
reports: l.reports.map((
|
|
737
|
-
...
|
|
734
|
+
categories: l.categories.map((y) => y.id),
|
|
735
|
+
quantumOwned: u,
|
|
736
|
+
metadataItemIds: l.metadataGroups.flatMap((y) => y.data.map((U) => U.id)).filter((y) => y !== void 0),
|
|
737
|
+
reports: l.reports.map((y) => ({
|
|
738
|
+
...y,
|
|
738
739
|
id: void 0,
|
|
739
|
-
thresholds:
|
|
740
|
+
thresholds: y.thresholds.map((U) => ({
|
|
740
741
|
...U,
|
|
741
742
|
id: void 0
|
|
742
743
|
}))
|
|
@@ -745,57 +746,57 @@ const Mn = ({
|
|
|
745
746
|
}, o = await A({ fields: t });
|
|
746
747
|
if (o.error) throw new Error(o.error.message);
|
|
747
748
|
if (o.data?.createAction)
|
|
748
|
-
return I(
|
|
749
|
+
return I(Ce, o.data.createAction);
|
|
749
750
|
throw new Error("No action data returned");
|
|
750
751
|
},
|
|
751
|
-
[A,
|
|
752
|
-
),
|
|
752
|
+
[A, u]
|
|
753
|
+
), V = G(
|
|
753
754
|
async (l) => {
|
|
754
755
|
const t = await $({ id: l.id });
|
|
755
756
|
if (t.error)
|
|
756
757
|
throw new Error(t.error.message);
|
|
757
758
|
if (t.data?.convertActionToQuantumOwned)
|
|
758
759
|
return I(
|
|
759
|
-
|
|
760
|
+
Ce,
|
|
760
761
|
t.data.convertActionToQuantumOwned
|
|
761
762
|
);
|
|
762
763
|
throw new Error("No action data returned");
|
|
763
764
|
},
|
|
764
765
|
[$]
|
|
765
|
-
),
|
|
766
|
-
if (
|
|
766
|
+
), ee = G(async () => {
|
|
767
|
+
if (d(!0), !R.length) {
|
|
767
768
|
const l = new Error(
|
|
768
769
|
`No ${i.pluralLowerCase} selected for ${g === "copy" ? "copying" : "converting"}`
|
|
769
770
|
);
|
|
770
|
-
a?.(l),
|
|
771
|
+
a?.(l), d(!1);
|
|
771
772
|
return;
|
|
772
773
|
}
|
|
773
774
|
try {
|
|
774
775
|
const l = [];
|
|
775
776
|
let t = 0;
|
|
776
|
-
const o = g === "copy" ?
|
|
777
|
-
for (const U of
|
|
777
|
+
const o = g === "copy" ? N : V, y = g === "copy" ? "copy" : "convert";
|
|
778
|
+
for (const U of R)
|
|
778
779
|
try {
|
|
779
780
|
const q = await o(U);
|
|
780
781
|
l.push(q);
|
|
781
782
|
} catch (q) {
|
|
782
783
|
console.error(
|
|
783
|
-
`Failed to ${
|
|
784
|
+
`Failed to ${y} ${i.singularLowerCase} "${U.name}":`,
|
|
784
785
|
q
|
|
785
786
|
), t++;
|
|
786
787
|
}
|
|
787
788
|
if (l.length > 0) {
|
|
788
|
-
const U = l.length, q =
|
|
789
|
+
const U = l.length, q = R.length, Q = g === "copy" ? "copied" : "converted", E = g === "copy" ? "copy" : "convert";
|
|
789
790
|
p({
|
|
790
|
-
title: t > 0 ? `Partial ${
|
|
791
|
-
description: t > 0 ? `${U} of ${q} ${i.pluralLowerCase} ${
|
|
791
|
+
title: t > 0 ? `Partial ${E} completed` : `${i.plural} ${Q} successfully`,
|
|
792
|
+
description: t > 0 ? `${U} of ${q} ${i.pluralLowerCase} ${Q} successfully` : `${U} ${U > 1 ? i.pluralLowerCase : i.singularLowerCase} ${Q} successfully`,
|
|
792
793
|
status: t > 0 ? "warning" : "success",
|
|
793
794
|
duration: 3e3,
|
|
794
795
|
isClosable: !0
|
|
795
|
-
}), r?.(), M(""),
|
|
796
|
+
}), r?.(), M(""), v([]);
|
|
796
797
|
} else
|
|
797
798
|
throw new Error(
|
|
798
|
-
`Failed to ${
|
|
799
|
+
`Failed to ${y} any ${i.pluralLowerCase}`
|
|
799
800
|
);
|
|
800
801
|
} catch (l) {
|
|
801
802
|
const t = g === "copy" ? "copy" : "convert", o = l instanceof Error ? l.message : `Failed to ${t} ${i.pluralLowerCase}`;
|
|
@@ -807,52 +808,52 @@ const Mn = ({
|
|
|
807
808
|
isClosable: !0
|
|
808
809
|
}), a?.(l instanceof Error ? l : new Error(o));
|
|
809
810
|
} finally {
|
|
810
|
-
|
|
811
|
+
d(!1);
|
|
811
812
|
}
|
|
812
813
|
}, [
|
|
813
|
-
N,
|
|
814
|
-
g,
|
|
815
814
|
R,
|
|
816
|
-
|
|
815
|
+
g,
|
|
816
|
+
N,
|
|
817
|
+
V,
|
|
817
818
|
p,
|
|
818
819
|
r,
|
|
819
820
|
a,
|
|
820
821
|
i
|
|
821
822
|
]), T = G(() => {
|
|
822
|
-
M(""),
|
|
823
|
+
M(""), v([]), C("copy"), n?.();
|
|
823
824
|
}, [n]);
|
|
824
|
-
|
|
825
|
+
le(() => {
|
|
825
826
|
x && x({
|
|
826
827
|
cancelButton: !1,
|
|
827
|
-
saveButton:
|
|
828
|
+
saveButton: R.length === 0 || c
|
|
828
829
|
});
|
|
829
|
-
}, [
|
|
830
|
-
|
|
830
|
+
}, [R.length, c, x]), le(() => {
|
|
831
|
+
m && m({
|
|
831
832
|
cancelButton: T,
|
|
832
|
-
saveButton:
|
|
833
|
+
saveButton: ee
|
|
833
834
|
});
|
|
834
|
-
}, [
|
|
835
|
-
const
|
|
835
|
+
}, [m, T, ee]);
|
|
836
|
+
const z = k(() => D.map((l) => ({
|
|
836
837
|
value: l.id,
|
|
837
838
|
label: l.name
|
|
838
|
-
})), [
|
|
839
|
+
})), [D]), X = k(() => O.filter((l) => g === "copy" ? !0 : !l.quantumOwned).map((l) => ({
|
|
839
840
|
value: l.id,
|
|
840
841
|
label: l.name,
|
|
841
842
|
// Add custom data to identify quantum-owned actions for UI display
|
|
842
843
|
isQuantumOwned: l.quantumOwned
|
|
843
|
-
})), [O, g]), W =
|
|
844
|
-
return /* @__PURE__ */ e.jsx(te, { children: /* @__PURE__ */ e.jsxs(
|
|
845
|
-
|
|
846
|
-
/* @__PURE__ */ e.jsx(
|
|
844
|
+
})), [O, g]), W = b.fetching, H = j.fetching;
|
|
845
|
+
return /* @__PURE__ */ e.jsx(te, { children: /* @__PURE__ */ e.jsxs(de, { spacing: 6, align: "stretch", children: [
|
|
846
|
+
u && /* @__PURE__ */ e.jsxs(Y, { children: [
|
|
847
|
+
/* @__PURE__ */ e.jsx(ge, { children: "Operation Mode" }),
|
|
847
848
|
/* @__PURE__ */ e.jsx(
|
|
848
|
-
|
|
849
|
+
Ct,
|
|
849
850
|
{
|
|
850
851
|
value: g,
|
|
851
852
|
onChange: (l) => {
|
|
852
|
-
C(l),
|
|
853
|
+
C(l), v([]);
|
|
853
854
|
},
|
|
854
855
|
children: /* @__PURE__ */ e.jsxs(re, { spacing: 6, children: [
|
|
855
|
-
/* @__PURE__ */ e.jsx(Ye, { value: "copy", colorScheme: "blue", children: /* @__PURE__ */ e.jsxs(
|
|
856
|
+
/* @__PURE__ */ e.jsx(Ye, { value: "copy", colorScheme: "blue", children: /* @__PURE__ */ e.jsxs(de, { align: "start", spacing: 1, children: [
|
|
856
857
|
/* @__PURE__ */ e.jsxs(S, { fontWeight: "medium", children: [
|
|
857
858
|
"Copy ",
|
|
858
859
|
i.plural
|
|
@@ -864,7 +865,7 @@ const Mn = ({
|
|
|
864
865
|
"based on selected ones"
|
|
865
866
|
] })
|
|
866
867
|
] }) }),
|
|
867
|
-
/* @__PURE__ */ e.jsx(Ye, { value: "convert", colorScheme: "green", children: /* @__PURE__ */ e.jsxs(
|
|
868
|
+
/* @__PURE__ */ e.jsx(Ye, { value: "convert", colorScheme: "green", children: /* @__PURE__ */ e.jsxs(de, { align: "start", spacing: 1, children: [
|
|
868
869
|
/* @__PURE__ */ e.jsxs(S, { fontWeight: "medium", children: [
|
|
869
870
|
"Convert to Quantum Owned ",
|
|
870
871
|
i.singular
|
|
@@ -880,38 +881,38 @@ const Mn = ({
|
|
|
880
881
|
}
|
|
881
882
|
)
|
|
882
883
|
] }),
|
|
883
|
-
/* @__PURE__ */ e.jsxs(
|
|
884
|
-
/* @__PURE__ */ e.jsx(
|
|
884
|
+
/* @__PURE__ */ e.jsxs(Y, { children: [
|
|
885
|
+
/* @__PURE__ */ e.jsx(ge, { children: "Select Source Group" }),
|
|
885
886
|
/* @__PURE__ */ e.jsx(
|
|
886
|
-
|
|
887
|
+
me,
|
|
887
888
|
{
|
|
888
889
|
placeholder: "Choose a group...",
|
|
889
|
-
options:
|
|
890
|
-
value:
|
|
891
|
-
onChange:
|
|
890
|
+
options: z,
|
|
891
|
+
value: z.find((l) => l.value === L) || null,
|
|
892
|
+
onChange: J,
|
|
892
893
|
isLoading: W,
|
|
893
894
|
isDisabled: W,
|
|
894
895
|
isClearable: !0
|
|
895
896
|
}
|
|
896
897
|
),
|
|
897
|
-
|
|
898
|
+
b.error && /* @__PURE__ */ e.jsxs(He, { status: "error", mt: 2, children: [
|
|
898
899
|
/* @__PURE__ */ e.jsx(Je, {}),
|
|
899
900
|
/* @__PURE__ */ e.jsxs(S, { fontSize: "sm", children: [
|
|
900
901
|
"Failed to load groups: ",
|
|
901
|
-
|
|
902
|
+
b.error.message
|
|
902
903
|
] })
|
|
903
904
|
] })
|
|
904
905
|
] }),
|
|
905
|
-
L && /* @__PURE__ */ e.jsxs(
|
|
906
|
-
/* @__PURE__ */ e.jsxs(
|
|
906
|
+
L && /* @__PURE__ */ e.jsxs(Y, { children: [
|
|
907
|
+
/* @__PURE__ */ e.jsxs(ge, { children: [
|
|
907
908
|
"Select ",
|
|
908
909
|
i.plural,
|
|
909
910
|
" to",
|
|
910
911
|
" ",
|
|
911
912
|
g === "copy" ? "Copy" : "Convert"
|
|
912
913
|
] }),
|
|
913
|
-
|
|
914
|
-
/* @__PURE__ */ e.jsx(
|
|
914
|
+
H ? /* @__PURE__ */ e.jsxs(re, { children: [
|
|
915
|
+
/* @__PURE__ */ e.jsx(wt, { size: "sm" }),
|
|
915
916
|
/* @__PURE__ */ e.jsxs(S, { fontSize: "sm", color: "gray.600", children: [
|
|
916
917
|
"Loading ",
|
|
917
918
|
i.pluralLowerCase,
|
|
@@ -919,15 +920,15 @@ const Mn = ({
|
|
|
919
920
|
] })
|
|
920
921
|
] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
921
922
|
/* @__PURE__ */ e.jsx(
|
|
922
|
-
|
|
923
|
+
me,
|
|
923
924
|
{
|
|
924
925
|
placeholder: `Choose ${i.pluralLowerCase} to ${g}...`,
|
|
925
|
-
options:
|
|
926
|
-
value:
|
|
926
|
+
options: X,
|
|
927
|
+
value: X.filter(
|
|
927
928
|
(l) => w.includes(l.value)
|
|
928
929
|
),
|
|
929
930
|
onChange: oe,
|
|
930
|
-
isDisabled:
|
|
931
|
+
isDisabled: X.length === 0,
|
|
931
932
|
isClearable: !0,
|
|
932
933
|
isMulti: !0,
|
|
933
934
|
closeMenuOnSelect: !1,
|
|
@@ -936,11 +937,11 @@ const Mn = ({
|
|
|
936
937
|
/* @__PURE__ */ e.jsx(S, { children: l.label }),
|
|
937
938
|
t === "value" && l.isQuantumOwned && /* @__PURE__ */ e.jsx(S, { color: "blue", fontSize: "xs", children: "(Quantum Owned)" })
|
|
938
939
|
] }),
|
|
939
|
-
l.isQuantumOwned && t === "menu" && /* @__PURE__ */ e.jsx(
|
|
940
|
+
l.isQuantumOwned && t === "menu" && /* @__PURE__ */ e.jsx($e, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
|
|
940
941
|
] })
|
|
941
942
|
}
|
|
942
943
|
),
|
|
943
|
-
|
|
944
|
+
X.length === 0 && /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", color: "gray.500", mt: 2, children: [
|
|
944
945
|
"No ",
|
|
945
946
|
i.pluralLowerCase,
|
|
946
947
|
" found"
|
|
@@ -957,10 +958,10 @@ const Mn = ({
|
|
|
957
958
|
] })
|
|
958
959
|
] })
|
|
959
960
|
] }),
|
|
960
|
-
|
|
961
|
-
/* @__PURE__ */ e.jsx(S, { fontWeight: "semibold", mb: 3, children:
|
|
962
|
-
/* @__PURE__ */ e.jsxs(
|
|
963
|
-
|
|
961
|
+
R.length > 0 && /* @__PURE__ */ e.jsxs(te, { p: 4, bg: "gray.50", borderRadius: "md", children: [
|
|
962
|
+
/* @__PURE__ */ e.jsx(S, { fontWeight: "semibold", mb: 3, children: R.length === 1 ? `${i.singular} to ${g === "copy" ? "Copy" : "Convert"}:` : `${R.length} ${i.plural} to ${g === "copy" ? "Copy" : "Convert"}:` }),
|
|
963
|
+
/* @__PURE__ */ e.jsxs(de, { align: "start", spacing: 3, children: [
|
|
964
|
+
R.map((l, t) => /* @__PURE__ */ e.jsxs(
|
|
964
965
|
te,
|
|
965
966
|
{
|
|
966
967
|
w: "100%",
|
|
@@ -976,10 +977,10 @@ const Mn = ({
|
|
|
976
977
|
". ",
|
|
977
978
|
l.name
|
|
978
979
|
] }),
|
|
979
|
-
l.quantumOwned && /* @__PURE__ */ e.jsx(
|
|
980
|
+
l.quantumOwned && /* @__PURE__ */ e.jsx($e, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
|
|
980
981
|
] }),
|
|
981
982
|
/* @__PURE__ */ e.jsxs(
|
|
982
|
-
|
|
983
|
+
de,
|
|
983
984
|
{
|
|
984
985
|
align: "start",
|
|
985
986
|
spacing: 1,
|
|
@@ -1023,7 +1024,7 @@ const Mn = ({
|
|
|
1023
1024
|
},
|
|
1024
1025
|
l.id
|
|
1025
1026
|
)),
|
|
1026
|
-
|
|
1027
|
+
R.length > 1 && /* @__PURE__ */ e.jsx(
|
|
1027
1028
|
te,
|
|
1028
1029
|
{
|
|
1029
1030
|
w: "100%",
|
|
@@ -1034,7 +1035,7 @@ const Mn = ({
|
|
|
1034
1035
|
borderColor: "blue.200",
|
|
1035
1036
|
children: /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", fontWeight: "medium", color: "blue.800", children: [
|
|
1036
1037
|
"Total: ",
|
|
1037
|
-
|
|
1038
|
+
R.length,
|
|
1038
1039
|
" ",
|
|
1039
1040
|
i.pluralLowerCase,
|
|
1040
1041
|
" will be",
|
|
@@ -1045,7 +1046,7 @@ const Mn = ({
|
|
|
1045
1046
|
)
|
|
1046
1047
|
] })
|
|
1047
1048
|
] }),
|
|
1048
|
-
!h && /* @__PURE__ */ e.jsxs(
|
|
1049
|
+
!h && /* @__PURE__ */ e.jsxs(Ae, { spacing: 4, justifyContent: "flex-end", children: [
|
|
1049
1050
|
/* @__PURE__ */ e.jsx(
|
|
1050
1051
|
se,
|
|
1051
1052
|
{
|
|
@@ -1059,29 +1060,29 @@ const Mn = ({
|
|
|
1059
1060
|
se,
|
|
1060
1061
|
{
|
|
1061
1062
|
colorScheme: g === "copy" ? "blue" : "green",
|
|
1062
|
-
onClick:
|
|
1063
|
-
isDisabled:
|
|
1063
|
+
onClick: ee,
|
|
1064
|
+
isDisabled: R.length === 0 || c,
|
|
1064
1065
|
isLoading: c,
|
|
1065
1066
|
loadingText: `${g === "copy" ? "Copying" : "Converting"}...`,
|
|
1066
1067
|
children: [
|
|
1067
1068
|
g === "copy" ? "Copy" : "Convert",
|
|
1068
1069
|
" ",
|
|
1069
|
-
|
|
1070
|
+
R.length === 1 ? i.singular : `${R.length} ${i.plural}`
|
|
1070
1071
|
]
|
|
1071
1072
|
}
|
|
1072
1073
|
)
|
|
1073
1074
|
] })
|
|
1074
1075
|
] }) });
|
|
1075
|
-
},
|
|
1076
|
+
}, fs = ({
|
|
1076
1077
|
onSave: r,
|
|
1077
1078
|
onCancel: n,
|
|
1078
1079
|
onError: a,
|
|
1079
1080
|
hideButtons: h = !1,
|
|
1080
1081
|
setButtonDisabled: x,
|
|
1081
|
-
setButtonOnClick:
|
|
1082
|
-
quantumOwned:
|
|
1082
|
+
setButtonOnClick: m,
|
|
1083
|
+
quantumOwned: u
|
|
1083
1084
|
}) => {
|
|
1084
|
-
const p =
|
|
1085
|
+
const p = vt(), { getLabel: s } = xe(), i = k(() => ({
|
|
1085
1086
|
singular: s("module"),
|
|
1086
1087
|
plural: s("module_plural"),
|
|
1087
1088
|
pluralLowerCase: s("module_plural").toLowerCase(),
|
|
@@ -1091,59 +1092,59 @@ const Mn = ({
|
|
|
1091
1092
|
plural: s("action_plural"),
|
|
1092
1093
|
pluralLowerCase: s("action_plural").toLowerCase(),
|
|
1093
1094
|
singularLowerCase: s("action").toLowerCase()
|
|
1094
|
-
}), [s]), [C, L] =
|
|
1095
|
-
query:
|
|
1096
|
-
}), [A] =
|
|
1097
|
-
query:
|
|
1095
|
+
}), [s]), [C, L] = _(""), [M, w] = _([]), [v, c] = _(!1), [d, b] = _("copy"), [j] = we({
|
|
1096
|
+
query: Lt
|
|
1097
|
+
}), [A] = we({
|
|
1098
|
+
query: cn,
|
|
1098
1099
|
variables: { groupId: C },
|
|
1099
1100
|
pause: !C
|
|
1100
1101
|
// Only run when group is selected
|
|
1101
|
-
}), [, $] = fe(
|
|
1102
|
-
|
|
1103
|
-
),
|
|
1104
|
-
(t) => I(
|
|
1102
|
+
}), [, $] = fe(Ot), [, D] = fe(At), [, O] = fe(ot), [, R] = fe(
|
|
1103
|
+
It
|
|
1104
|
+
), J = k(() => j.data?.groups ? j.data.groups.map(
|
|
1105
|
+
(t) => I(Mt, t)
|
|
1105
1106
|
) : [], [j.data]), oe = k(() => A.data?.modules ? I(
|
|
1106
1107
|
Qe,
|
|
1107
1108
|
A.data?.modules
|
|
1108
1109
|
).map((o) => {
|
|
1109
|
-
const
|
|
1110
|
-
|
|
1110
|
+
const y = I(
|
|
1111
|
+
kt,
|
|
1111
1112
|
o.moduleActions
|
|
1112
1113
|
), q = I(
|
|
1113
1114
|
je,
|
|
1114
1115
|
o.metadataGroups
|
|
1115
|
-
).map((
|
|
1116
|
+
).map((Q) => I(be, Q.data)).flat();
|
|
1116
1117
|
return {
|
|
1117
1118
|
...o,
|
|
1118
|
-
moduleActions:
|
|
1119
|
-
...
|
|
1120
|
-
action: I(
|
|
1119
|
+
moduleActions: y.map((Q) => ({
|
|
1120
|
+
...Q,
|
|
1121
|
+
action: I(Ce, Q.action)
|
|
1121
1122
|
})),
|
|
1122
1123
|
categories: I(
|
|
1123
|
-
|
|
1124
|
+
De,
|
|
1124
1125
|
o.categories
|
|
1125
1126
|
),
|
|
1126
1127
|
metadataItems: q
|
|
1127
1128
|
};
|
|
1128
|
-
}) : [], [A.data]),
|
|
1129
|
+
}) : [], [A.data]), N = k(() => oe.filter(
|
|
1129
1130
|
(t) => M.includes(t.id)
|
|
1130
|
-
), [oe, M]),
|
|
1131
|
+
), [oe, M]), V = G(
|
|
1131
1132
|
(t) => {
|
|
1132
1133
|
const o = t?.value || "";
|
|
1133
1134
|
L(o), w([]);
|
|
1134
1135
|
},
|
|
1135
1136
|
[]
|
|
1136
|
-
),
|
|
1137
|
+
), ee = G(
|
|
1137
1138
|
(t) => {
|
|
1138
|
-
const o = t.map((
|
|
1139
|
+
const o = t.map((y) => y.value);
|
|
1139
1140
|
w(o);
|
|
1140
1141
|
},
|
|
1141
1142
|
[]
|
|
1142
1143
|
), T = G(async () => {
|
|
1143
|
-
if (c(!0), !
|
|
1144
|
+
if (c(!0), !N.length) {
|
|
1144
1145
|
c(!1);
|
|
1145
1146
|
const t = new Error(
|
|
1146
|
-
`No modules selected for ${
|
|
1147
|
+
`No modules selected for ${d === "convert" ? "converting" : "copying"}`
|
|
1147
1148
|
);
|
|
1148
1149
|
a?.(t);
|
|
1149
1150
|
return;
|
|
@@ -1151,132 +1152,132 @@ const Mn = ({
|
|
|
1151
1152
|
try {
|
|
1152
1153
|
const t = [];
|
|
1153
1154
|
let o = 0;
|
|
1154
|
-
for (const
|
|
1155
|
+
for (const y of N)
|
|
1155
1156
|
try {
|
|
1156
|
-
let U =
|
|
1157
|
-
if (
|
|
1158
|
-
const q =
|
|
1159
|
-
if (
|
|
1160
|
-
if (
|
|
1157
|
+
let U = y.moduleActions.map((q) => q.actionId);
|
|
1158
|
+
if (u) {
|
|
1159
|
+
const q = y.moduleActions.map((K) => K.action), Q = async (K) => {
|
|
1160
|
+
if (d === "copy") {
|
|
1161
|
+
if (K.quantumOwned) return K;
|
|
1161
1162
|
const ye = I(
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
),
|
|
1163
|
+
De,
|
|
1164
|
+
K.categories
|
|
1165
|
+
), ke = I(
|
|
1165
1166
|
je,
|
|
1166
|
-
|
|
1167
|
-
).map((
|
|
1167
|
+
K.metadataGroups
|
|
1168
|
+
).map((he) => I(
|
|
1168
1169
|
be,
|
|
1169
|
-
|
|
1170
|
-
).map((
|
|
1170
|
+
he.data
|
|
1171
|
+
).map((Ne) => Ne.id)).flat(), Ge = I(
|
|
1171
1172
|
Ze,
|
|
1172
|
-
|
|
1173
|
-
).map((
|
|
1174
|
-
...
|
|
1173
|
+
K.reports
|
|
1174
|
+
).map((he) => ({
|
|
1175
|
+
...he,
|
|
1175
1176
|
id: void 0,
|
|
1176
1177
|
thresholds: I(
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
).map((
|
|
1180
|
-
...
|
|
1178
|
+
Oe,
|
|
1179
|
+
he.thresholds
|
|
1180
|
+
).map((Ne) => ({
|
|
1181
|
+
...Ne,
|
|
1181
1182
|
id: void 0
|
|
1182
1183
|
}))
|
|
1183
|
-
})),
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
).map((
|
|
1187
|
-
...
|
|
1184
|
+
})), et = I(
|
|
1185
|
+
Oe,
|
|
1186
|
+
K.thresholds
|
|
1187
|
+
).map((he) => ({
|
|
1188
|
+
...he,
|
|
1188
1189
|
id: void 0
|
|
1189
|
-
})),
|
|
1190
|
-
...
|
|
1190
|
+
})), Te = {
|
|
1191
|
+
...K,
|
|
1191
1192
|
quantumOwned: !0,
|
|
1192
|
-
thresholds:
|
|
1193
|
-
categories: ye?.map((
|
|
1194
|
-
reports:
|
|
1195
|
-
metadataIds:
|
|
1193
|
+
thresholds: et,
|
|
1194
|
+
categories: ye?.map((he) => he.id),
|
|
1195
|
+
reports: Ge,
|
|
1196
|
+
metadataIds: ke,
|
|
1196
1197
|
id: void 0
|
|
1197
|
-
},
|
|
1198
|
-
return
|
|
1199
|
-
|
|
1200
|
-
|
|
1198
|
+
}, Se = await O({ fields: Te });
|
|
1199
|
+
return Se.error || !Se.data?.createAction ? null : I(
|
|
1200
|
+
Ce,
|
|
1201
|
+
Se.data.createAction
|
|
1201
1202
|
);
|
|
1202
1203
|
}
|
|
1203
|
-
if (
|
|
1204
|
-
const
|
|
1205
|
-
id:
|
|
1204
|
+
if (K.quantumOwned) return K;
|
|
1205
|
+
const ce = await R({
|
|
1206
|
+
id: K.id
|
|
1206
1207
|
});
|
|
1207
|
-
return
|
|
1208
|
-
|
|
1209
|
-
|
|
1208
|
+
return ce.error || !ce.data?.convertActionToQuantumOwned ? null : I(
|
|
1209
|
+
Ce,
|
|
1210
|
+
ce.data.convertActionToQuantumOwned
|
|
1210
1211
|
);
|
|
1211
1212
|
};
|
|
1212
1213
|
U = (await Promise.all(
|
|
1213
|
-
q.map(
|
|
1214
|
-
)).filter((
|
|
1214
|
+
q.map(Q)
|
|
1215
|
+
)).filter((K) => !!K?.id).map((K) => K.id);
|
|
1215
1216
|
}
|
|
1216
|
-
if (
|
|
1217
|
+
if (d === "convert") {
|
|
1217
1218
|
const q = {
|
|
1218
|
-
name:
|
|
1219
|
-
description:
|
|
1219
|
+
name: y.name,
|
|
1220
|
+
description: y.description || void 0,
|
|
1220
1221
|
actions: U,
|
|
1221
|
-
categories:
|
|
1222
|
+
categories: y.categories.map((E) => E.id),
|
|
1222
1223
|
quantumOwned: !0
|
|
1223
|
-
},
|
|
1224
|
-
id:
|
|
1224
|
+
}, Q = await D({
|
|
1225
|
+
id: y.id,
|
|
1225
1226
|
input: q
|
|
1226
1227
|
});
|
|
1227
|
-
if (
|
|
1228
|
-
if (
|
|
1229
|
-
const
|
|
1228
|
+
if (Q.error) throw new Error(Q.error.message);
|
|
1229
|
+
if (Q.data?.updateModule) {
|
|
1230
|
+
const E = I(
|
|
1230
1231
|
Qe,
|
|
1231
|
-
|
|
1232
|
+
Q.data.updateModule
|
|
1232
1233
|
);
|
|
1233
|
-
t.push(
|
|
1234
|
+
t.push(E);
|
|
1234
1235
|
}
|
|
1235
1236
|
} else {
|
|
1236
1237
|
const q = {
|
|
1237
|
-
name: `${
|
|
1238
|
-
description:
|
|
1238
|
+
name: `${y.name} (Copy)`,
|
|
1239
|
+
description: y.description || void 0,
|
|
1239
1240
|
actions: U,
|
|
1240
|
-
categories:
|
|
1241
|
-
quantumOwned:
|
|
1242
|
-
metadataItemIds:
|
|
1243
|
-
actionReports:
|
|
1244
|
-
actionId:
|
|
1245
|
-
reportId:
|
|
1241
|
+
categories: y.categories.map((E) => E.id),
|
|
1242
|
+
quantumOwned: u,
|
|
1243
|
+
metadataItemIds: y.metadataItems.map((E) => E.id),
|
|
1244
|
+
actionReports: y.moduleActions.filter((E) => !!E.reportId).map((E) => ({
|
|
1245
|
+
actionId: E.actionId,
|
|
1246
|
+
reportId: E.reportId
|
|
1246
1247
|
}))
|
|
1247
|
-
},
|
|
1248
|
-
if (
|
|
1249
|
-
if (
|
|
1250
|
-
const
|
|
1248
|
+
}, Q = await $({ input: q });
|
|
1249
|
+
if (Q.error) throw new Error(Q.error.message);
|
|
1250
|
+
if (Q.data?.createModule) {
|
|
1251
|
+
const E = I(
|
|
1251
1252
|
Qe,
|
|
1252
|
-
|
|
1253
|
+
Q.data.createModule
|
|
1253
1254
|
);
|
|
1254
|
-
t.push(
|
|
1255
|
+
t.push(E);
|
|
1255
1256
|
}
|
|
1256
1257
|
}
|
|
1257
1258
|
} catch (U) {
|
|
1258
1259
|
console.error(
|
|
1259
|
-
`Failed to ${
|
|
1260
|
+
`Failed to ${d === "convert" ? "convert" : "copy"} module "${y.name}":`,
|
|
1260
1261
|
U
|
|
1261
1262
|
), o++;
|
|
1262
1263
|
}
|
|
1263
1264
|
if (t.length > 0) {
|
|
1264
|
-
const
|
|
1265
|
+
const y = t.length, U = N.length;
|
|
1265
1266
|
p({
|
|
1266
|
-
title: o > 0 ? `Partial ${
|
|
1267
|
-
description: o > 0 ? `${
|
|
1267
|
+
title: o > 0 ? `Partial ${d === "convert" ? "convert" : "copy"} completed` : `${i.plural} ${d === "convert" ? "converted" : "copied"} successfully`,
|
|
1268
|
+
description: o > 0 ? `${y} of ${U} ${i.plural} ${d === "convert" ? "converted" : "copied"} successfully` : `${y} ${y > 1 ? i.plural : i.singular} ${d === "convert" ? "converted" : "copied"} successfully`,
|
|
1268
1269
|
status: o > 0 ? "warning" : "success",
|
|
1269
1270
|
duration: 3e3,
|
|
1270
1271
|
isClosable: !0
|
|
1271
1272
|
}), t.length > 0 && r?.(), L(""), w([]);
|
|
1272
1273
|
} else
|
|
1273
1274
|
throw new Error(
|
|
1274
|
-
`Failed to ${
|
|
1275
|
+
`Failed to ${d === "convert" ? "convert" : "copy"} any modules`
|
|
1275
1276
|
);
|
|
1276
1277
|
} catch (t) {
|
|
1277
|
-
const o = t instanceof Error ? t.message : `Failed to ${
|
|
1278
|
+
const o = t instanceof Error ? t.message : `Failed to ${d === "convert" ? "convert" : "copy"} modules`;
|
|
1278
1279
|
p({
|
|
1279
|
-
title:
|
|
1280
|
+
title: d === "convert" ? "Convert failed" : "Copy failed",
|
|
1280
1281
|
description: o,
|
|
1281
1282
|
status: "error",
|
|
1282
1283
|
duration: 5e3,
|
|
@@ -1286,52 +1287,52 @@ const Mn = ({
|
|
|
1286
1287
|
c(!1);
|
|
1287
1288
|
}
|
|
1288
1289
|
}, [
|
|
1289
|
-
|
|
1290
|
+
N,
|
|
1290
1291
|
$,
|
|
1291
|
-
|
|
1292
|
+
D,
|
|
1292
1293
|
p,
|
|
1293
1294
|
r,
|
|
1294
1295
|
a,
|
|
1295
|
-
|
|
1296
|
+
u,
|
|
1296
1297
|
O,
|
|
1297
|
-
|
|
1298
|
-
|
|
1298
|
+
R,
|
|
1299
|
+
d,
|
|
1299
1300
|
i
|
|
1300
|
-
]),
|
|
1301
|
-
L(""), w([]),
|
|
1301
|
+
]), z = G(() => {
|
|
1302
|
+
L(""), w([]), b("copy"), n?.();
|
|
1302
1303
|
}, [n]);
|
|
1303
|
-
|
|
1304
|
+
le(() => {
|
|
1304
1305
|
x && x({
|
|
1305
1306
|
cancelButton: !1,
|
|
1306
|
-
saveButton:
|
|
1307
|
+
saveButton: N.length === 0 || v
|
|
1307
1308
|
});
|
|
1308
|
-
}, [
|
|
1309
|
-
|
|
1310
|
-
cancelButton:
|
|
1309
|
+
}, [N.length, v, x]), le(() => {
|
|
1310
|
+
m && m({
|
|
1311
|
+
cancelButton: z,
|
|
1311
1312
|
saveButton: T
|
|
1312
1313
|
});
|
|
1313
|
-
}, [
|
|
1314
|
-
const
|
|
1314
|
+
}, [m, z, T]);
|
|
1315
|
+
const X = k(() => J.map((t) => ({
|
|
1315
1316
|
value: t.id,
|
|
1316
1317
|
label: t.name
|
|
1317
|
-
})), [
|
|
1318
|
+
})), [J]), W = k(() => oe.filter((t) => d === "copy" ? !0 : !t.quantumOwned).map((t) => ({
|
|
1318
1319
|
value: t.id,
|
|
1319
1320
|
label: t.name,
|
|
1320
1321
|
// Add custom data to identify quantum-owned modules
|
|
1321
1322
|
isQuantumOwned: t.quantumOwned
|
|
1322
|
-
})), [oe,
|
|
1323
|
-
return /* @__PURE__ */ e.jsx(te, { children: /* @__PURE__ */ e.jsxs(
|
|
1324
|
-
|
|
1325
|
-
/* @__PURE__ */ e.jsx(
|
|
1323
|
+
})), [oe, d]), H = j.fetching, l = A.fetching;
|
|
1324
|
+
return /* @__PURE__ */ e.jsx(te, { children: /* @__PURE__ */ e.jsxs(de, { spacing: 6, align: "stretch", children: [
|
|
1325
|
+
u && /* @__PURE__ */ e.jsxs(Y, { children: [
|
|
1326
|
+
/* @__PURE__ */ e.jsx(ge, { children: "Operation Mode" }),
|
|
1326
1327
|
/* @__PURE__ */ e.jsx(
|
|
1327
|
-
|
|
1328
|
+
Ct,
|
|
1328
1329
|
{
|
|
1329
|
-
value:
|
|
1330
|
+
value: d,
|
|
1330
1331
|
onChange: (t) => {
|
|
1331
|
-
|
|
1332
|
+
b(t), w([]);
|
|
1332
1333
|
},
|
|
1333
1334
|
children: /* @__PURE__ */ e.jsxs(re, { spacing: 6, children: [
|
|
1334
|
-
/* @__PURE__ */ e.jsx(Ye, { value: "copy", colorScheme: "blue", children: /* @__PURE__ */ e.jsxs(
|
|
1335
|
+
/* @__PURE__ */ e.jsx(Ye, { value: "copy", colorScheme: "blue", children: /* @__PURE__ */ e.jsxs(de, { align: "start", spacing: 1, children: [
|
|
1335
1336
|
/* @__PURE__ */ e.jsxs(S, { fontWeight: "medium", children: [
|
|
1336
1337
|
"Copy ",
|
|
1337
1338
|
i.plural
|
|
@@ -1342,7 +1343,7 @@ const Mn = ({
|
|
|
1342
1343
|
" based on selected ones"
|
|
1343
1344
|
] })
|
|
1344
1345
|
] }) }),
|
|
1345
|
-
/* @__PURE__ */ e.jsx(Ye, { value: "convert", colorScheme: "green", children: /* @__PURE__ */ e.jsxs(
|
|
1346
|
+
/* @__PURE__ */ e.jsx(Ye, { value: "convert", colorScheme: "green", children: /* @__PURE__ */ e.jsxs(de, { align: "start", spacing: 1, children: [
|
|
1346
1347
|
/* @__PURE__ */ e.jsx(S, { fontWeight: "medium", children: "Convert to Quantum Owned" }),
|
|
1347
1348
|
/* @__PURE__ */ e.jsxs(S, { fontSize: "sm", color: "gray.600", children: [
|
|
1348
1349
|
"Convert existing ",
|
|
@@ -1354,17 +1355,17 @@ const Mn = ({
|
|
|
1354
1355
|
}
|
|
1355
1356
|
)
|
|
1356
1357
|
] }),
|
|
1357
|
-
/* @__PURE__ */ e.jsxs(
|
|
1358
|
-
/* @__PURE__ */ e.jsx(
|
|
1358
|
+
/* @__PURE__ */ e.jsxs(Y, { children: [
|
|
1359
|
+
/* @__PURE__ */ e.jsx(ge, { children: "Select Source Group" }),
|
|
1359
1360
|
/* @__PURE__ */ e.jsx(
|
|
1360
|
-
|
|
1361
|
+
me,
|
|
1361
1362
|
{
|
|
1362
1363
|
placeholder: "Choose a group...",
|
|
1363
|
-
options:
|
|
1364
|
-
value:
|
|
1365
|
-
onChange:
|
|
1366
|
-
isLoading:
|
|
1367
|
-
isDisabled:
|
|
1364
|
+
options: X,
|
|
1365
|
+
value: X.find((t) => t.value === C) || null,
|
|
1366
|
+
onChange: V,
|
|
1367
|
+
isLoading: H,
|
|
1368
|
+
isDisabled: H,
|
|
1368
1369
|
isClearable: !0
|
|
1369
1370
|
}
|
|
1370
1371
|
),
|
|
@@ -1376,10 +1377,10 @@ const Mn = ({
|
|
|
1376
1377
|
] })
|
|
1377
1378
|
] })
|
|
1378
1379
|
] }),
|
|
1379
|
-
C && /* @__PURE__ */ e.jsxs(
|
|
1380
|
-
/* @__PURE__ */ e.jsx(
|
|
1380
|
+
C && /* @__PURE__ */ e.jsxs(Y, { children: [
|
|
1381
|
+
/* @__PURE__ */ e.jsx(ge, { children: d === "convert" ? `Select ${i.plural} to Convert` : `Select ${i.plural} to Copy` }),
|
|
1381
1382
|
l ? /* @__PURE__ */ e.jsxs(re, { children: [
|
|
1382
|
-
/* @__PURE__ */ e.jsx(
|
|
1383
|
+
/* @__PURE__ */ e.jsx(wt, { size: "sm" }),
|
|
1383
1384
|
/* @__PURE__ */ e.jsxs(S, { fontSize: "sm", color: "gray.600", children: [
|
|
1384
1385
|
"Loading ",
|
|
1385
1386
|
i.pluralLowerCase,
|
|
@@ -1387,14 +1388,14 @@ const Mn = ({
|
|
|
1387
1388
|
] })
|
|
1388
1389
|
] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1389
1390
|
/* @__PURE__ */ e.jsx(
|
|
1390
|
-
|
|
1391
|
+
me,
|
|
1391
1392
|
{
|
|
1392
|
-
placeholder:
|
|
1393
|
+
placeholder: d === "convert" ? `Choose ${i.pluralLowerCase} to convert...` : `Choose ${i.pluralLowerCase} to copy...`,
|
|
1393
1394
|
options: W,
|
|
1394
1395
|
value: W.filter(
|
|
1395
1396
|
(t) => M.includes(t.value)
|
|
1396
1397
|
),
|
|
1397
|
-
onChange:
|
|
1398
|
+
onChange: ee,
|
|
1398
1399
|
isDisabled: W.length === 0,
|
|
1399
1400
|
isClearable: !0,
|
|
1400
1401
|
isMulti: !0,
|
|
@@ -1404,7 +1405,7 @@ const Mn = ({
|
|
|
1404
1405
|
/* @__PURE__ */ e.jsx(S, { children: t.label }),
|
|
1405
1406
|
o === "value" && t.isQuantumOwned && /* @__PURE__ */ e.jsx(S, { color: "blue", fontSize: "xs", children: "(Quantum Owned)" })
|
|
1406
1407
|
] }),
|
|
1407
|
-
t.isQuantumOwned && o === "menu" && /* @__PURE__ */ e.jsx(
|
|
1408
|
+
t.isQuantumOwned && o === "menu" && /* @__PURE__ */ e.jsx($e, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
|
|
1408
1409
|
] })
|
|
1409
1410
|
}
|
|
1410
1411
|
),
|
|
@@ -1425,10 +1426,10 @@ const Mn = ({
|
|
|
1425
1426
|
] })
|
|
1426
1427
|
] })
|
|
1427
1428
|
] }),
|
|
1428
|
-
|
|
1429
|
-
/* @__PURE__ */ e.jsx(S, { fontWeight: "semibold", mb: 3, children:
|
|
1430
|
-
/* @__PURE__ */ e.jsxs(
|
|
1431
|
-
|
|
1429
|
+
N.length > 0 && /* @__PURE__ */ e.jsxs(te, { p: 4, bg: "gray.50", borderRadius: "md", children: [
|
|
1430
|
+
/* @__PURE__ */ e.jsx(S, { fontWeight: "semibold", mb: 3, children: N.length === 1 ? `${i.singular} to ${d === "copy" ? "Copy" : "Convert"}` : `${N.length} ${i.plural} to ${d === "copy" ? "Copy" : "Convert"}` }),
|
|
1431
|
+
/* @__PURE__ */ e.jsxs(de, { align: "start", spacing: 3, children: [
|
|
1432
|
+
N.map((t, o) => /* @__PURE__ */ e.jsxs(
|
|
1432
1433
|
te,
|
|
1433
1434
|
{
|
|
1434
1435
|
w: "100%",
|
|
@@ -1444,10 +1445,10 @@ const Mn = ({
|
|
|
1444
1445
|
". ",
|
|
1445
1446
|
t.name
|
|
1446
1447
|
] }),
|
|
1447
|
-
t.quantumOwned && /* @__PURE__ */ e.jsx(
|
|
1448
|
+
t.quantumOwned && /* @__PURE__ */ e.jsx($e, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
|
|
1448
1449
|
] }),
|
|
1449
1450
|
/* @__PURE__ */ e.jsxs(
|
|
1450
|
-
|
|
1451
|
+
de,
|
|
1451
1452
|
{
|
|
1452
1453
|
align: "start",
|
|
1453
1454
|
spacing: 1,
|
|
@@ -1467,7 +1468,7 @@ const Mn = ({
|
|
|
1467
1468
|
/* @__PURE__ */ e.jsxs(S, { children: [
|
|
1468
1469
|
/* @__PURE__ */ e.jsx("strong", { children: "Categories:" }),
|
|
1469
1470
|
" ",
|
|
1470
|
-
t.categories.map((
|
|
1471
|
+
t.categories.map((y) => y.name).join(", ") || "None"
|
|
1471
1472
|
] })
|
|
1472
1473
|
]
|
|
1473
1474
|
}
|
|
@@ -1476,7 +1477,7 @@ const Mn = ({
|
|
|
1476
1477
|
},
|
|
1477
1478
|
t.id
|
|
1478
1479
|
)),
|
|
1479
|
-
|
|
1480
|
+
N.length > 1 && /* @__PURE__ */ e.jsx(
|
|
1480
1481
|
te,
|
|
1481
1482
|
{
|
|
1482
1483
|
w: "100%",
|
|
@@ -1487,16 +1488,16 @@ const Mn = ({
|
|
|
1487
1488
|
borderColor: "blue.200",
|
|
1488
1489
|
children: /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", fontWeight: "medium", color: "blue.800", children: [
|
|
1489
1490
|
"Total: ",
|
|
1490
|
-
|
|
1491
|
+
N.length,
|
|
1491
1492
|
" ",
|
|
1492
1493
|
i.pluralLowerCase,
|
|
1493
1494
|
" will be",
|
|
1494
1495
|
" ",
|
|
1495
|
-
|
|
1496
|
+
d === "copy" ? "copied" : "converted"
|
|
1496
1497
|
] })
|
|
1497
1498
|
}
|
|
1498
1499
|
),
|
|
1499
|
-
|
|
1500
|
+
u && N.filter((t) => t.moduleActions.some((o) => !o.action.quantumOwned)).length > 0 && /* @__PURE__ */ e.jsx(
|
|
1500
1501
|
te,
|
|
1501
1502
|
{
|
|
1502
1503
|
p: 2,
|
|
@@ -1504,53 +1505,53 @@ const Mn = ({
|
|
|
1504
1505
|
borderRadius: "md",
|
|
1505
1506
|
border: "1px solid",
|
|
1506
1507
|
borderColor: "yellow.200",
|
|
1507
|
-
children: /* @__PURE__ */ e.jsx(S, { fontSize: "sm", fontWeight: "medium", color: "yellow.800", children:
|
|
1508
|
+
children: /* @__PURE__ */ e.jsx(S, { fontSize: "sm", fontWeight: "medium", color: "yellow.800", children: d === "convert" ? `Converting ${i.plural} will convert non QM-Owned ${g.plural} to QM-Owned ${g.plural}` : `Copying ${i.plural} with Non QM-Owned ${g.plural} will create corresponding QM-Owned ${g.plural}` })
|
|
1508
1509
|
}
|
|
1509
1510
|
)
|
|
1510
1511
|
] })
|
|
1511
1512
|
] }),
|
|
1512
|
-
!h && /* @__PURE__ */ e.jsxs(
|
|
1513
|
+
!h && /* @__PURE__ */ e.jsxs(Ae, { spacing: 4, justifyContent: "flex-end", children: [
|
|
1513
1514
|
/* @__PURE__ */ e.jsx(
|
|
1514
1515
|
se,
|
|
1515
1516
|
{
|
|
1516
1517
|
variant: "outline",
|
|
1517
|
-
onClick:
|
|
1518
|
-
isDisabled:
|
|
1518
|
+
onClick: z,
|
|
1519
|
+
isDisabled: v,
|
|
1519
1520
|
children: "Cancel"
|
|
1520
1521
|
}
|
|
1521
1522
|
),
|
|
1522
1523
|
/* @__PURE__ */ e.jsxs(
|
|
1523
1524
|
se,
|
|
1524
1525
|
{
|
|
1525
|
-
colorScheme:
|
|
1526
|
+
colorScheme: d === "copy" ? "blue" : "green",
|
|
1526
1527
|
onClick: T,
|
|
1527
|
-
isDisabled:
|
|
1528
|
-
isLoading:
|
|
1529
|
-
loadingText: `${
|
|
1528
|
+
isDisabled: N.length === 0 || v,
|
|
1529
|
+
isLoading: v,
|
|
1530
|
+
loadingText: `${d === "copy" ? "Copying" : "Converting"}...`,
|
|
1530
1531
|
children: [
|
|
1531
|
-
|
|
1532
|
+
d === "copy" ? "Copy" : "Convert",
|
|
1532
1533
|
" ",
|
|
1533
|
-
|
|
1534
|
+
N.length === 1 ? i.singular : `${N.length} ${i.plural}`
|
|
1534
1535
|
]
|
|
1535
1536
|
}
|
|
1536
1537
|
)
|
|
1537
1538
|
] })
|
|
1538
1539
|
] }) });
|
|
1539
|
-
}, Rt =
|
|
1540
|
-
const r =
|
|
1540
|
+
}, Rt = rn(void 0), Fe = () => {
|
|
1541
|
+
const r = on(Rt);
|
|
1541
1542
|
if (!r)
|
|
1542
1543
|
throw new Error(
|
|
1543
1544
|
"useUpsertModuleFormContext must be used within a UpsertModuleFormProvider"
|
|
1544
1545
|
);
|
|
1545
1546
|
return r;
|
|
1546
|
-
},
|
|
1547
|
+
}, zn = ({
|
|
1547
1548
|
name: r,
|
|
1548
1549
|
setName: n,
|
|
1549
1550
|
actions: a,
|
|
1550
1551
|
selectedActionIds: h,
|
|
1551
1552
|
setSelectedActionIds: x,
|
|
1552
|
-
availableCategories:
|
|
1553
|
-
selectedCategoryIds:
|
|
1553
|
+
availableCategories: m,
|
|
1554
|
+
selectedCategoryIds: u,
|
|
1554
1555
|
setSelectedCategoryIds: p,
|
|
1555
1556
|
description: s,
|
|
1556
1557
|
setDescription: i,
|
|
@@ -1560,77 +1561,77 @@ const Mn = ({
|
|
|
1560
1561
|
setActionReportIds: M,
|
|
1561
1562
|
...w
|
|
1562
1563
|
}) => {
|
|
1563
|
-
const
|
|
1564
|
-
...
|
|
1565
|
-
selected: h.includes(
|
|
1566
|
-
})), [a, h]),
|
|
1567
|
-
() => h.map((
|
|
1568
|
-
[h,
|
|
1564
|
+
const v = qt(), c = k(() => a.map((D) => ({
|
|
1565
|
+
...D,
|
|
1566
|
+
selected: h.includes(D.id)
|
|
1567
|
+
})), [a, h]), d = k(() => a.reduce((D, O) => (D[O.id] = O, D), {}), [a]), b = k(
|
|
1568
|
+
() => h.map((D) => d[D]),
|
|
1569
|
+
[h, d]
|
|
1569
1570
|
), j = G(
|
|
1570
|
-
(
|
|
1571
|
-
x(O ? [...h,
|
|
1571
|
+
(D, O) => {
|
|
1572
|
+
x(O ? [...h, D.id] : h.filter((R) => R !== D.id));
|
|
1572
1573
|
},
|
|
1573
1574
|
[h, x]
|
|
1574
1575
|
), A = G(
|
|
1575
|
-
(
|
|
1576
|
-
n(
|
|
1576
|
+
(D) => {
|
|
1577
|
+
n(D.target.value);
|
|
1577
1578
|
},
|
|
1578
1579
|
[n]
|
|
1579
1580
|
), $ = G(
|
|
1580
|
-
(
|
|
1581
|
-
i?.(
|
|
1581
|
+
(D) => {
|
|
1582
|
+
i?.(D.target.value);
|
|
1582
1583
|
},
|
|
1583
1584
|
[i]
|
|
1584
1585
|
);
|
|
1585
1586
|
return /* @__PURE__ */ e.jsxs(te, { ...w, children: [
|
|
1586
1587
|
/* @__PURE__ */ e.jsxs(re, { gap: "2rem", children: [
|
|
1587
|
-
/* @__PURE__ */ e.jsx(
|
|
1588
|
+
/* @__PURE__ */ e.jsx(Bn, { name: r ?? "", onInputChange: A }),
|
|
1588
1589
|
/* @__PURE__ */ e.jsx(
|
|
1589
|
-
|
|
1590
|
+
Wn,
|
|
1590
1591
|
{
|
|
1591
|
-
availableCategories:
|
|
1592
|
-
value:
|
|
1592
|
+
availableCategories: m,
|
|
1593
|
+
value: u,
|
|
1593
1594
|
onChange: p
|
|
1594
1595
|
}
|
|
1595
1596
|
)
|
|
1596
1597
|
] }),
|
|
1597
1598
|
/* @__PURE__ */ e.jsx(
|
|
1598
|
-
|
|
1599
|
+
Un,
|
|
1599
1600
|
{
|
|
1600
1601
|
description: s ?? "",
|
|
1601
1602
|
onInputChange: $
|
|
1602
1603
|
}
|
|
1603
1604
|
),
|
|
1604
1605
|
/* @__PURE__ */ e.jsx(
|
|
1605
|
-
|
|
1606
|
+
Yn,
|
|
1606
1607
|
{
|
|
1607
1608
|
selectedMetadataIds: g,
|
|
1608
1609
|
setSelectedMetadataIds: C
|
|
1609
1610
|
}
|
|
1610
1611
|
),
|
|
1611
1612
|
/* @__PURE__ */ e.jsx(
|
|
1612
|
-
|
|
1613
|
+
Qn,
|
|
1613
1614
|
{
|
|
1614
|
-
value:
|
|
1615
|
+
value: b,
|
|
1615
1616
|
onChange: x,
|
|
1616
|
-
onAdjustActivities: () =>
|
|
1617
|
+
onAdjustActivities: () => v.onOpen(),
|
|
1617
1618
|
actionReportIds: L,
|
|
1618
1619
|
setActionReportIds: M
|
|
1619
1620
|
}
|
|
1620
1621
|
),
|
|
1621
1622
|
/* @__PURE__ */ e.jsxs(
|
|
1622
|
-
|
|
1623
|
+
Kt,
|
|
1623
1624
|
{
|
|
1624
|
-
isOpen:
|
|
1625
|
-
onClose:
|
|
1625
|
+
isOpen: v.isOpen,
|
|
1626
|
+
onClose: v.onClose,
|
|
1626
1627
|
size: "6xl",
|
|
1627
1628
|
children: [
|
|
1628
|
-
/* @__PURE__ */ e.jsx(
|
|
1629
|
-
/* @__PURE__ */ e.jsxs(
|
|
1630
|
-
/* @__PURE__ */ e.jsx(
|
|
1631
|
-
/* @__PURE__ */ e.jsx(
|
|
1632
|
-
/* @__PURE__ */ e.jsx(
|
|
1633
|
-
|
|
1629
|
+
/* @__PURE__ */ e.jsx(Yt, {}),
|
|
1630
|
+
/* @__PURE__ */ e.jsxs(Ht, { children: [
|
|
1631
|
+
/* @__PURE__ */ e.jsx(Jt, { children: "Select Activities" }),
|
|
1632
|
+
/* @__PURE__ */ e.jsx(Xt, {}),
|
|
1633
|
+
/* @__PURE__ */ e.jsx(Zt, { children: /* @__PURE__ */ e.jsx(
|
|
1634
|
+
_n,
|
|
1634
1635
|
{
|
|
1635
1636
|
actions: c,
|
|
1636
1637
|
onSelected: j,
|
|
@@ -1642,11 +1643,11 @@ const Mn = ({
|
|
|
1642
1643
|
}
|
|
1643
1644
|
}
|
|
1644
1645
|
) }),
|
|
1645
|
-
/* @__PURE__ */ e.jsx(
|
|
1646
|
+
/* @__PURE__ */ e.jsx(Vt, { children: /* @__PURE__ */ e.jsx(
|
|
1646
1647
|
se,
|
|
1647
1648
|
{
|
|
1648
1649
|
colorScheme: "blue",
|
|
1649
|
-
onClick:
|
|
1650
|
+
onClick: v.onClose,
|
|
1650
1651
|
isDisabled: h.length === 0,
|
|
1651
1652
|
children: "Done"
|
|
1652
1653
|
}
|
|
@@ -1656,19 +1657,19 @@ const Mn = ({
|
|
|
1656
1657
|
}
|
|
1657
1658
|
)
|
|
1658
1659
|
] });
|
|
1659
|
-
},
|
|
1660
|
+
}, Bn = Me(
|
|
1660
1661
|
({
|
|
1661
1662
|
name: r,
|
|
1662
1663
|
onInputChange: n
|
|
1663
1664
|
}) => {
|
|
1664
|
-
const { getLabel: a } =
|
|
1665
|
-
return /* @__PURE__ */ e.jsxs(
|
|
1666
|
-
/* @__PURE__ */ e.jsxs(
|
|
1665
|
+
const { getLabel: a } = xe(), h = a("module"), { isView: x } = Fe();
|
|
1666
|
+
return /* @__PURE__ */ e.jsxs(Y, { mb: 4, children: [
|
|
1667
|
+
/* @__PURE__ */ e.jsxs(ge, { children: [
|
|
1667
1668
|
h,
|
|
1668
1669
|
" Name"
|
|
1669
1670
|
] }),
|
|
1670
1671
|
/* @__PURE__ */ e.jsx(
|
|
1671
|
-
|
|
1672
|
+
ve,
|
|
1672
1673
|
{
|
|
1673
1674
|
placeholder: "i.e. ACL RTP Test Battery",
|
|
1674
1675
|
value: r,
|
|
@@ -1679,33 +1680,33 @@ const Mn = ({
|
|
|
1679
1680
|
)
|
|
1680
1681
|
] });
|
|
1681
1682
|
}
|
|
1682
|
-
),
|
|
1683
|
+
), Wn = Me(
|
|
1683
1684
|
({
|
|
1684
1685
|
availableCategories: r,
|
|
1685
1686
|
value: n,
|
|
1686
1687
|
onChange: a
|
|
1687
1688
|
}) => {
|
|
1688
|
-
const { getLabel: h } =
|
|
1689
|
+
const { getLabel: h } = xe(), x = h("module"), { isView: m } = Fe(), u = k(() => [
|
|
1689
1690
|
...r,
|
|
1690
1691
|
{
|
|
1691
1692
|
id: "other",
|
|
1692
1693
|
name: "Other"
|
|
1693
1694
|
}
|
|
1694
|
-
], [r]), p = k(() =>
|
|
1695
|
+
], [r]), p = k(() => u.map((s) => ({
|
|
1695
1696
|
value: s.id,
|
|
1696
1697
|
label: s.name
|
|
1697
|
-
})), [
|
|
1698
|
-
return /* @__PURE__ */ e.jsxs(
|
|
1699
|
-
/* @__PURE__ */ e.jsxs(
|
|
1698
|
+
})), [u]);
|
|
1699
|
+
return /* @__PURE__ */ e.jsxs(Y, { mb: 4, children: [
|
|
1700
|
+
/* @__PURE__ */ e.jsxs(ge, { children: [
|
|
1700
1701
|
x,
|
|
1701
1702
|
" Category"
|
|
1702
1703
|
] }),
|
|
1703
1704
|
/* @__PURE__ */ e.jsx(
|
|
1704
|
-
|
|
1705
|
+
me,
|
|
1705
1706
|
{
|
|
1706
|
-
isDisabled: r.length === 0 ||
|
|
1707
|
+
isDisabled: r.length === 0 || m,
|
|
1707
1708
|
options: p,
|
|
1708
|
-
value: n.length === 0 ? { value: "other", label: "Other" } :
|
|
1709
|
+
value: n.length === 0 ? { value: "other", label: "Other" } : u.filter((s) => n.includes(s.id)).map((s) => ({
|
|
1709
1710
|
value: s.id,
|
|
1710
1711
|
label: s.name
|
|
1711
1712
|
}))[0],
|
|
@@ -1715,14 +1716,14 @@ const Mn = ({
|
|
|
1715
1716
|
)
|
|
1716
1717
|
] });
|
|
1717
1718
|
}
|
|
1718
|
-
),
|
|
1719
|
+
), Un = Me(
|
|
1719
1720
|
({
|
|
1720
1721
|
description: r,
|
|
1721
1722
|
onInputChange: n
|
|
1722
1723
|
}) => {
|
|
1723
|
-
const { getLabel: a } =
|
|
1724
|
-
return /* @__PURE__ */ e.jsxs(
|
|
1725
|
-
/* @__PURE__ */ e.jsx(
|
|
1724
|
+
const { getLabel: a } = xe(), h = a("module"), { isView: x } = Fe();
|
|
1725
|
+
return /* @__PURE__ */ e.jsxs(Y, { mb: 4, children: [
|
|
1726
|
+
/* @__PURE__ */ e.jsx(ge, { children: /* @__PURE__ */ e.jsxs("span", { children: [
|
|
1726
1727
|
"Description",
|
|
1727
1728
|
/* @__PURE__ */ e.jsxs(S, { fontSize: "sm", color: "gray.500", children: [
|
|
1728
1729
|
"Briefly describe the objective of this",
|
|
@@ -1732,7 +1733,7 @@ const Mn = ({
|
|
|
1732
1733
|
] })
|
|
1733
1734
|
] }) }),
|
|
1734
1735
|
/* @__PURE__ */ e.jsx(
|
|
1735
|
-
|
|
1736
|
+
ve,
|
|
1736
1737
|
{
|
|
1737
1738
|
placeholder: "i.e. Assess readiness to return to play post-ACL reconstruction",
|
|
1738
1739
|
value: r,
|
|
@@ -1742,7 +1743,7 @@ const Mn = ({
|
|
|
1742
1743
|
)
|
|
1743
1744
|
] });
|
|
1744
1745
|
}
|
|
1745
|
-
),
|
|
1746
|
+
), Qn = Me(
|
|
1746
1747
|
({
|
|
1747
1748
|
value: r,
|
|
1748
1749
|
onChange: n,
|
|
@@ -1750,13 +1751,13 @@ const Mn = ({
|
|
|
1750
1751
|
actionReportIds: h,
|
|
1751
1752
|
setActionReportIds: x
|
|
1752
1753
|
}) => {
|
|
1753
|
-
const { getLabel:
|
|
1754
|
-
module:
|
|
1755
|
-
moduleLowerCase:
|
|
1756
|
-
action:
|
|
1757
|
-
actionPlural:
|
|
1758
|
-
actionPluralLowerCase:
|
|
1759
|
-
}), [
|
|
1754
|
+
const { getLabel: m } = xe(), { isView: u } = Fe(), p = k(() => ({
|
|
1755
|
+
module: m("module"),
|
|
1756
|
+
moduleLowerCase: m("module").toLocaleLowerCase(),
|
|
1757
|
+
action: m("action"),
|
|
1758
|
+
actionPlural: m("action_plural"),
|
|
1759
|
+
actionPluralLowerCase: m("action_plural").toLocaleLowerCase()
|
|
1760
|
+
}), [m]), s = k(
|
|
1760
1761
|
() => r.filter((i) => !!i?.id).map((i) => ({
|
|
1761
1762
|
id: i.id,
|
|
1762
1763
|
name: i.name,
|
|
@@ -1765,11 +1766,11 @@ const Mn = ({
|
|
|
1765
1766
|
})),
|
|
1766
1767
|
[r, h]
|
|
1767
1768
|
);
|
|
1768
|
-
return /* @__PURE__ */ e.jsxs(
|
|
1769
|
+
return /* @__PURE__ */ e.jsxs(Y, { mb: 4, children: [
|
|
1769
1770
|
/* @__PURE__ */ e.jsxs(re, { justifyContent: "space-between", children: [
|
|
1770
|
-
/* @__PURE__ */ e.jsx(
|
|
1771
|
+
/* @__PURE__ */ e.jsx(ge, { children: /* @__PURE__ */ e.jsxs("span", { children: [
|
|
1771
1772
|
p.actionPlural,
|
|
1772
|
-
!
|
|
1773
|
+
!u && /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", color: "gray.500", children: [
|
|
1773
1774
|
"Drag and drop to reorder the ",
|
|
1774
1775
|
p.actionPluralLowerCase,
|
|
1775
1776
|
" ",
|
|
@@ -1778,7 +1779,7 @@ const Mn = ({
|
|
|
1778
1779
|
"."
|
|
1779
1780
|
] })
|
|
1780
1781
|
] }) }),
|
|
1781
|
-
!
|
|
1782
|
+
!u && /* @__PURE__ */ e.jsxs(
|
|
1782
1783
|
se,
|
|
1783
1784
|
{
|
|
1784
1785
|
size: "sm",
|
|
@@ -1792,14 +1793,14 @@ const Mn = ({
|
|
|
1792
1793
|
}
|
|
1793
1794
|
)
|
|
1794
1795
|
] }),
|
|
1795
|
-
s.length === 0 ? /* @__PURE__ */ e.jsx(
|
|
1796
|
+
s.length === 0 ? /* @__PURE__ */ e.jsx(de, { children: /* @__PURE__ */ e.jsxs(S, { color: "gray.500", fontSize: "lg", mb: "4rem", mt: "4rem", children: [
|
|
1796
1797
|
"No ",
|
|
1797
1798
|
p.actionPluralLowerCase,
|
|
1798
1799
|
" selected for this",
|
|
1799
1800
|
" ",
|
|
1800
1801
|
p.moduleLowerCase,
|
|
1801
1802
|
".",
|
|
1802
|
-
!
|
|
1803
|
+
!u && /* @__PURE__ */ e.jsxs(
|
|
1803
1804
|
se,
|
|
1804
1805
|
{
|
|
1805
1806
|
ml: "0.5em",
|
|
@@ -1815,21 +1816,21 @@ const Mn = ({
|
|
|
1815
1816
|
}
|
|
1816
1817
|
)
|
|
1817
1818
|
] }) }) : /* @__PURE__ */ e.jsx(
|
|
1818
|
-
|
|
1819
|
+
qn,
|
|
1819
1820
|
{
|
|
1820
1821
|
value: s,
|
|
1821
1822
|
onChange: (i) => {
|
|
1822
1823
|
const g = i(s);
|
|
1823
1824
|
n(g.map((C) => C.id));
|
|
1824
1825
|
},
|
|
1825
|
-
disabled:
|
|
1826
|
+
disabled: u,
|
|
1826
1827
|
actionReportIds: h,
|
|
1827
1828
|
setActionReportIds: x
|
|
1828
1829
|
}
|
|
1829
1830
|
)
|
|
1830
1831
|
] });
|
|
1831
1832
|
}
|
|
1832
|
-
),
|
|
1833
|
+
), qn = Me(
|
|
1833
1834
|
({
|
|
1834
1835
|
value: r,
|
|
1835
1836
|
onChange: n,
|
|
@@ -1837,9 +1838,9 @@ const Mn = ({
|
|
|
1837
1838
|
actionReportIds: h,
|
|
1838
1839
|
setActionReportIds: x
|
|
1839
1840
|
}) => {
|
|
1840
|
-
const [
|
|
1841
|
+
const [m] = _(
|
|
1841
1842
|
() => Math.random().toString(36).substring(2, 15)
|
|
1842
|
-
),
|
|
1843
|
+
), u = G(
|
|
1843
1844
|
(p, s) => {
|
|
1844
1845
|
a || n((i) => {
|
|
1845
1846
|
const g = [...i], [C] = g.splice(p, 1);
|
|
@@ -1848,14 +1849,14 @@ const Mn = ({
|
|
|
1848
1849
|
},
|
|
1849
1850
|
[n, a]
|
|
1850
1851
|
);
|
|
1851
|
-
return /* @__PURE__ */ e.jsx(te, { children: /* @__PURE__ */ e.jsx(
|
|
1852
|
-
|
|
1852
|
+
return /* @__PURE__ */ e.jsx(te, { children: /* @__PURE__ */ e.jsx(Cn, { backend: wn, children: /* @__PURE__ */ e.jsx(de, { spacing: 3, align: "stretch", children: r.map((p, s) => /* @__PURE__ */ e.jsx(
|
|
1853
|
+
Kn,
|
|
1853
1854
|
{
|
|
1854
|
-
listKey:
|
|
1855
|
+
listKey: m,
|
|
1855
1856
|
item: p,
|
|
1856
1857
|
index: s,
|
|
1857
1858
|
disabled: !!a,
|
|
1858
|
-
move:
|
|
1859
|
+
move: u,
|
|
1859
1860
|
onReportChange: (i) => {
|
|
1860
1861
|
x({
|
|
1861
1862
|
...h,
|
|
@@ -1866,30 +1867,30 @@ const Mn = ({
|
|
|
1866
1867
|
p.id
|
|
1867
1868
|
)) }) }) });
|
|
1868
1869
|
}
|
|
1869
|
-
),
|
|
1870
|
+
), Kn = Me(
|
|
1870
1871
|
({
|
|
1871
1872
|
listKey: r,
|
|
1872
1873
|
item: n,
|
|
1873
1874
|
index: a,
|
|
1874
1875
|
disabled: h,
|
|
1875
1876
|
move: x,
|
|
1876
|
-
onReportChange:
|
|
1877
|
+
onReportChange: m
|
|
1877
1878
|
}) => {
|
|
1878
|
-
const
|
|
1879
|
+
const u = an(null), { getLabel: p } = xe(), s = p("action"), [{ handlerId: i }, g] = Sn({
|
|
1879
1880
|
accept: r,
|
|
1880
1881
|
collect: (c) => ({
|
|
1881
1882
|
handlerId: c.getHandlerId()?.toString() ?? ""
|
|
1882
1883
|
}),
|
|
1883
|
-
hover: (c,
|
|
1884
|
-
if (!
|
|
1884
|
+
hover: (c, d) => {
|
|
1885
|
+
if (!u.current)
|
|
1885
1886
|
return;
|
|
1886
|
-
const
|
|
1887
|
-
if (
|
|
1887
|
+
const b = c.index, j = a;
|
|
1888
|
+
if (b === j)
|
|
1888
1889
|
return;
|
|
1889
|
-
const A =
|
|
1890
|
-
|
|
1890
|
+
const A = u.current?.getBoundingClientRect(), $ = (A.bottom - A.top) / 2, O = d.getClientOffset().y - A.top;
|
|
1891
|
+
b < j && O < $ || b > j && O > $ || (x(b, j), c.index = j);
|
|
1891
1892
|
}
|
|
1892
|
-
}), [{ isDragging: C }, L] =
|
|
1893
|
+
}), [{ isDragging: C }, L] = Ln({
|
|
1893
1894
|
type: r,
|
|
1894
1895
|
item: () => ({ id: n.id, index: a }),
|
|
1895
1896
|
collect: (c) => ({
|
|
@@ -1898,21 +1899,24 @@ const Mn = ({
|
|
|
1898
1899
|
canDrag: !h
|
|
1899
1900
|
}), M = k(() => [
|
|
1900
1901
|
{ value: null, label: "No Report" },
|
|
1901
|
-
...n.reports.map((c) =>
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1902
|
+
...n.reports.map((c) => {
|
|
1903
|
+
const d = c.name && c.name.length > 0 ? c.name : "No Name", b = Le(c.reportKind);
|
|
1904
|
+
return {
|
|
1905
|
+
value: c.id,
|
|
1906
|
+
label: `${d} (${b})`
|
|
1907
|
+
};
|
|
1908
|
+
})
|
|
1909
|
+
], [n.reports]), w = C ? 0.6 : 1, v = h ? "default" : C ? "grabbing" : "grab";
|
|
1910
|
+
return L(g(u)), /* @__PURE__ */ e.jsx(
|
|
1907
1911
|
te,
|
|
1908
1912
|
{
|
|
1909
|
-
ref:
|
|
1913
|
+
ref: u,
|
|
1910
1914
|
p: 3,
|
|
1911
1915
|
border: "1px solid",
|
|
1912
1916
|
borderColor: "gray.200",
|
|
1913
1917
|
borderRadius: "md",
|
|
1914
1918
|
bg: "gray.50",
|
|
1915
|
-
style: { opacity: w, cursor:
|
|
1919
|
+
style: { opacity: w, cursor: v },
|
|
1916
1920
|
"data-handler-id": i,
|
|
1917
1921
|
children: /* @__PURE__ */ e.jsxs(re, { justify: "space-between", align: "center", children: [
|
|
1918
1922
|
/* @__PURE__ */ e.jsxs(re, { spacing: 3, children: [
|
|
@@ -1927,14 +1931,14 @@ const Mn = ({
|
|
|
1927
1931
|
s,
|
|
1928
1932
|
" Report:"
|
|
1929
1933
|
] }),
|
|
1930
|
-
/* @__PURE__ */ e.jsx(te, { width: "
|
|
1931
|
-
|
|
1934
|
+
/* @__PURE__ */ e.jsx(te, { width: "450px", children: /* @__PURE__ */ e.jsx(
|
|
1935
|
+
me,
|
|
1932
1936
|
{
|
|
1933
1937
|
value: M.find(
|
|
1934
1938
|
(c) => c.value === n.selectedReportId
|
|
1935
1939
|
),
|
|
1936
1940
|
onChange: (c) => {
|
|
1937
|
-
|
|
1941
|
+
m(c?.value || null);
|
|
1938
1942
|
},
|
|
1939
1943
|
options: M,
|
|
1940
1944
|
placeholder: "Select report...",
|
|
@@ -1946,12 +1950,12 @@ const Mn = ({
|
|
|
1946
1950
|
}
|
|
1947
1951
|
);
|
|
1948
1952
|
}
|
|
1949
|
-
),
|
|
1953
|
+
), Yn = Me(
|
|
1950
1954
|
({
|
|
1951
1955
|
selectedMetadataIds: r,
|
|
1952
1956
|
setSelectedMetadataIds: n
|
|
1953
1957
|
}) => {
|
|
1954
|
-
const { getLabel: a } =
|
|
1958
|
+
const { getLabel: a } = xe(), { isView: h, metadataOptions: x } = Fe(), m = k(() => [
|
|
1955
1959
|
{
|
|
1956
1960
|
key: "activity_type",
|
|
1957
1961
|
label: `${a("action")} Type`,
|
|
@@ -1960,32 +1964,32 @@ const Mn = ({
|
|
|
1960
1964
|
{ key: "session_type", label: "Session Type", multi: !0 },
|
|
1961
1965
|
{ key: "body_region", label: "Body Region", multi: !0 },
|
|
1962
1966
|
{ key: "sport", label: "Sport", multi: !0 }
|
|
1963
|
-
], [a]),
|
|
1967
|
+
], [a]), u = G(
|
|
1964
1968
|
(p, s) => {
|
|
1965
|
-
const i =
|
|
1969
|
+
const i = m.find((C) => C.key === p);
|
|
1966
1970
|
if (!i) return;
|
|
1967
1971
|
const g = i.multi ? (s ?? []).map((C) => C.id) : s ? [s.id] : [];
|
|
1968
|
-
n((C) => [...C.filter((M) => Object.values(x || {}).flat().find((
|
|
1969
|
-
(
|
|
1970
|
-
(c) => c.id === M &&
|
|
1972
|
+
n((C) => [...C.filter((M) => Object.values(x || {}).flat().find((v) => v.id === M) && !Object.keys(x || {}).find(
|
|
1973
|
+
(v) => x?.[v]?.some(
|
|
1974
|
+
(c) => c.id === M && v === p
|
|
1971
1975
|
)
|
|
1972
1976
|
)), ...g]);
|
|
1973
1977
|
},
|
|
1974
|
-
[
|
|
1978
|
+
[m, x, n]
|
|
1975
1979
|
);
|
|
1976
|
-
return x ? /* @__PURE__ */ e.jsxs(
|
|
1977
|
-
/* @__PURE__ */ e.jsx(
|
|
1978
|
-
/* @__PURE__ */ e.jsx(re, { gap: "1rem", align: "start", children:
|
|
1980
|
+
return x ? /* @__PURE__ */ e.jsxs(Y, { mb: 4, children: [
|
|
1981
|
+
/* @__PURE__ */ e.jsx(ge, { children: "Metadata Tags" }),
|
|
1982
|
+
/* @__PURE__ */ e.jsx(re, { gap: "1rem", align: "start", children: m.map((p) => /* @__PURE__ */ e.jsxs(Y, { flex: "1", children: [
|
|
1979
1983
|
/* @__PURE__ */ e.jsx(Xe, { fontSize: "sm", children: p.label }),
|
|
1980
1984
|
/* @__PURE__ */ e.jsx(
|
|
1981
|
-
|
|
1985
|
+
me,
|
|
1982
1986
|
{
|
|
1983
1987
|
isMulti: p.multi,
|
|
1984
1988
|
value: x[p.key]?.filter(
|
|
1985
1989
|
(s) => r.includes(s.id)
|
|
1986
1990
|
),
|
|
1987
1991
|
onChange: (s) => {
|
|
1988
|
-
|
|
1992
|
+
u(
|
|
1989
1993
|
p.key,
|
|
1990
1994
|
s
|
|
1991
1995
|
);
|
|
@@ -1999,32 +2003,32 @@ const Mn = ({
|
|
|
1999
2003
|
] }, p.key)) })
|
|
2000
2004
|
] }) : null;
|
|
2001
2005
|
}
|
|
2002
|
-
),
|
|
2006
|
+
), Hn = ({
|
|
2003
2007
|
value: r,
|
|
2004
2008
|
onChange: n,
|
|
2005
2009
|
forceKind: a,
|
|
2006
2010
|
disableRemove: h,
|
|
2007
2011
|
disableKind: x,
|
|
2008
|
-
isDisabled:
|
|
2009
|
-
lockRanges:
|
|
2012
|
+
isDisabled: m,
|
|
2013
|
+
lockRanges: u,
|
|
2010
2014
|
...p
|
|
2011
2015
|
}) => {
|
|
2012
2016
|
const s = k(() => [...r].sort((L, M) => {
|
|
2013
|
-
const w =
|
|
2014
|
-
return w -
|
|
2015
|
-
}), [r]), i = G((L) => "segment" in L.id ?
|
|
2017
|
+
const w = ft.indexOf(L.plane), v = ft.indexOf(M.plane);
|
|
2018
|
+
return w - v;
|
|
2019
|
+
}), [r]), i = G((L) => "segment" in L.id ? Tt(L.id.segment, L.plane, !0) ?? "Unknown" : Nt(L.id.joint, L.plane, !0) ?? "Unknown", []), g = G(
|
|
2016
2020
|
(L, M) => {
|
|
2017
2021
|
const w = s.findIndex(
|
|
2018
2022
|
(c) => c.id === M.id && c.plane === M.plane
|
|
2019
2023
|
);
|
|
2020
|
-
let
|
|
2021
|
-
a && (M = { ...M, kind: a }),
|
|
2024
|
+
let v = [...s];
|
|
2025
|
+
a && (M = { ...M, kind: a }), v[w] = M, u && (v = v.map((c) => ({
|
|
2022
2026
|
...c,
|
|
2023
2027
|
min: M.min,
|
|
2024
2028
|
max: M.max
|
|
2025
|
-
}))), n(
|
|
2029
|
+
}))), n(v);
|
|
2026
2030
|
},
|
|
2027
|
-
[n, s, a,
|
|
2031
|
+
[n, s, a, u]
|
|
2028
2032
|
), C = G(
|
|
2029
2033
|
(L) => {
|
|
2030
2034
|
const M = s.filter(
|
|
@@ -2034,42 +2038,42 @@ const Mn = ({
|
|
|
2034
2038
|
},
|
|
2035
2039
|
[n, s]
|
|
2036
2040
|
);
|
|
2037
|
-
return /* @__PURE__ */ e.jsx(
|
|
2038
|
-
|
|
2041
|
+
return /* @__PURE__ */ e.jsx(de, { alignItems: "flex-start", overflowY: "auto", ...p, children: s.map((L, M) => /* @__PURE__ */ e.jsx(
|
|
2042
|
+
Jn,
|
|
2039
2043
|
{
|
|
2040
2044
|
label: i(L),
|
|
2041
2045
|
parameter: L,
|
|
2042
2046
|
onChange: (w) => g(M, w),
|
|
2043
|
-
onRemove: h ||
|
|
2047
|
+
onRemove: h || m ? void 0 : () => C(L),
|
|
2044
2048
|
forceKind: a,
|
|
2045
|
-
disableKind: x ||
|
|
2046
|
-
isDisabled:
|
|
2049
|
+
disableKind: x || m,
|
|
2050
|
+
isDisabled: m
|
|
2047
2051
|
},
|
|
2048
2052
|
`${JSON.stringify(L.id)}-${L.plane}`
|
|
2049
2053
|
)) });
|
|
2050
|
-
},
|
|
2054
|
+
}, Jn = ({
|
|
2051
2055
|
label: r,
|
|
2052
2056
|
parameter: n,
|
|
2053
2057
|
onChange: a,
|
|
2054
2058
|
onRemove: h,
|
|
2055
2059
|
forceKind: x,
|
|
2056
|
-
disableKind:
|
|
2057
|
-
isDisabled:
|
|
2060
|
+
disableKind: m,
|
|
2061
|
+
isDisabled: u
|
|
2058
2062
|
}) => {
|
|
2059
2063
|
const p = G(
|
|
2060
|
-
(g) => "joint" in n.id ?
|
|
2064
|
+
(g) => "joint" in n.id ? In(
|
|
2061
2065
|
n.id.joint,
|
|
2062
2066
|
n.plane,
|
|
2063
2067
|
g < 0 ? -1 : 1
|
|
2064
|
-
) :
|
|
2068
|
+
) : Mn(
|
|
2065
2069
|
n.id.segment,
|
|
2066
2070
|
n.plane,
|
|
2067
2071
|
g < 0 ? -1 : 1
|
|
2068
2072
|
),
|
|
2069
2073
|
[n]
|
|
2070
|
-
), { min: s, max: i } = "joint" in n.id ?
|
|
2074
|
+
), { min: s, max: i } = "joint" in n.id ? On(n.id.joint, n.plane) : { min: -180, max: 180 };
|
|
2071
2075
|
return /* @__PURE__ */ e.jsxs(
|
|
2072
|
-
|
|
2076
|
+
de,
|
|
2073
2077
|
{
|
|
2074
2078
|
borderRadius: "md",
|
|
2075
2079
|
p: 2,
|
|
@@ -2090,23 +2094,23 @@ const Mn = ({
|
|
|
2090
2094
|
children: r
|
|
2091
2095
|
}
|
|
2092
2096
|
),
|
|
2093
|
-
n.sensorOnly && /* @__PURE__ */ e.jsx(
|
|
2094
|
-
h && !
|
|
2095
|
-
|
|
2097
|
+
n.sensorOnly && /* @__PURE__ */ e.jsx(St, { size: "sm", colorScheme: "orange", variant: "subtle", children: "Sensor Only" }),
|
|
2098
|
+
h && !u && /* @__PURE__ */ e.jsx(
|
|
2099
|
+
en,
|
|
2096
2100
|
{
|
|
2097
2101
|
size: "xs",
|
|
2098
2102
|
variant: "ghost",
|
|
2099
2103
|
"aria-label": "delete",
|
|
2100
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2104
|
+
icon: /* @__PURE__ */ e.jsx(yt, { as: vn }),
|
|
2101
2105
|
onClick: h
|
|
2102
2106
|
}
|
|
2103
2107
|
),
|
|
2104
2108
|
!x && /* @__PURE__ */ e.jsx(
|
|
2105
|
-
|
|
2109
|
+
Tn,
|
|
2106
2110
|
{
|
|
2107
2111
|
selectedItem: n?.kind ?? Ke.Limit,
|
|
2108
2112
|
onChange: ({ value: g }) => a({ ...n, kind: g }),
|
|
2109
|
-
isDisabled:
|
|
2113
|
+
isDisabled: m || u,
|
|
2110
2114
|
buttonProps: {
|
|
2111
2115
|
size: "sm",
|
|
2112
2116
|
variant: "outline",
|
|
@@ -2124,7 +2128,7 @@ const Mn = ({
|
|
|
2124
2128
|
)
|
|
2125
2129
|
] }),
|
|
2126
2130
|
/* @__PURE__ */ e.jsx(
|
|
2127
|
-
|
|
2131
|
+
Nn,
|
|
2128
2132
|
{
|
|
2129
2133
|
w: "100%",
|
|
2130
2134
|
size: "xs",
|
|
@@ -2136,107 +2140,107 @@ const Mn = ({
|
|
|
2136
2140
|
formatValue: (g) => `${Math.abs(g)}°`,
|
|
2137
2141
|
valueLabel: (g) => p(g) ?? "",
|
|
2138
2142
|
positiveNegativeLabels: p(0) ? [p(-1) ?? "", p(1) ?? ""] : void 0,
|
|
2139
|
-
isDisabled:
|
|
2143
|
+
isDisabled: u
|
|
2140
2144
|
}
|
|
2141
2145
|
)
|
|
2142
2146
|
]
|
|
2143
2147
|
}
|
|
2144
2148
|
);
|
|
2145
|
-
}, Ue = (r, n) => "segment" in r && "segment" in n && r.segment === n.segment || "joint" in r && "joint" in n && r.joint === n.joint,
|
|
2149
|
+
}, Ue = (r, n) => "segment" in r && "segment" in n && r.segment === n.segment || "joint" in r && "joint" in n && r.joint === n.joint, jt = ({
|
|
2146
2150
|
options: r,
|
|
2147
2151
|
value: n,
|
|
2148
2152
|
onChange: a,
|
|
2149
2153
|
forceKind: h,
|
|
2150
2154
|
singleValue: x,
|
|
2151
|
-
singleValueSideless:
|
|
2152
|
-
editOnly:
|
|
2155
|
+
singleValueSideless: m,
|
|
2156
|
+
editOnly: u,
|
|
2153
2157
|
disableKind: p,
|
|
2154
2158
|
maxParameters: s,
|
|
2155
2159
|
...i
|
|
2156
2160
|
}) => {
|
|
2157
|
-
const g =
|
|
2161
|
+
const g = m ? 2 : s, C = k(() => {
|
|
2158
2162
|
const c = /* @__PURE__ */ new Map();
|
|
2159
|
-
return r.forEach((
|
|
2160
|
-
const
|
|
2163
|
+
return r.forEach((d) => {
|
|
2164
|
+
const b = "joint" in d.id;
|
|
2161
2165
|
let j, A;
|
|
2162
|
-
if (
|
|
2163
|
-
const O =
|
|
2166
|
+
if (b ? (j = Nt(d.id.joint, d.plane, !0) ?? "Unknown", A = `joint:${d.id.joint}`) : (j = Tt(d.id.segment, d.plane, !0) ?? "Unknown", A = `segment:${d.id.segment}`), !c.has(A)) {
|
|
2167
|
+
const O = b ? gt(d.id.joint) ?? "Unknown Joint" : gt(d.id.segment) ?? "Unknown Segment";
|
|
2164
2168
|
c.set(A, {
|
|
2165
2169
|
label: O,
|
|
2166
2170
|
options: []
|
|
2167
2171
|
});
|
|
2168
2172
|
}
|
|
2169
|
-
const $ = c.get(A),
|
|
2173
|
+
const $ = c.get(A), D = [
|
|
2170
2174
|
j,
|
|
2171
|
-
|
|
2172
|
-
|
|
2175
|
+
b ? d.id.joint : d.id.segment,
|
|
2176
|
+
d.plane
|
|
2173
2177
|
].filter(Boolean).map((O) => String(O).toLowerCase().replace(/\s+|_/g, ""));
|
|
2174
2178
|
$.options.push({
|
|
2175
2179
|
label: /* @__PURE__ */ e.jsxs(re, { spacing: 2, justify: "space-between", w: "100%", pl: 3, children: [
|
|
2176
2180
|
/* @__PURE__ */ e.jsx(S, { children: j }),
|
|
2177
|
-
|
|
2181
|
+
d.sensorOnly && /* @__PURE__ */ e.jsx(St, { size: "sm", colorScheme: "orange", variant: "subtle", children: "Sensor Only" })
|
|
2178
2182
|
] }),
|
|
2179
|
-
value:
|
|
2180
|
-
plane:
|
|
2181
|
-
sensorOnly:
|
|
2182
|
-
searchTokens:
|
|
2183
|
+
value: d.id,
|
|
2184
|
+
plane: d.plane,
|
|
2185
|
+
sensorOnly: d.sensorOnly,
|
|
2186
|
+
searchTokens: D
|
|
2183
2187
|
});
|
|
2184
2188
|
}), Array.from(c.values());
|
|
2185
2189
|
}, [r]), L = k(() => {
|
|
2186
|
-
if (!
|
|
2190
|
+
if (!m || n.length === 0)
|
|
2187
2191
|
return C;
|
|
2188
2192
|
const c = n[0];
|
|
2189
|
-
return C.map((
|
|
2190
|
-
...
|
|
2191
|
-
options:
|
|
2192
|
-
(
|
|
2193
|
+
return C.map((d) => ({
|
|
2194
|
+
...d,
|
|
2195
|
+
options: d.options.filter(
|
|
2196
|
+
(b) => Be(b.value) === Be(c.id) && b.plane === c.plane
|
|
2193
2197
|
)
|
|
2194
|
-
})).filter((
|
|
2195
|
-
}, [C, n,
|
|
2196
|
-
(
|
|
2197
|
-
), [C, n]), w = G((c,
|
|
2198
|
-
if (!
|
|
2199
|
-
const
|
|
2198
|
+
})).filter((d) => d.options.length > 0);
|
|
2199
|
+
}, [C, n, m]), M = k(() => C.flatMap((d) => d.options).filter(
|
|
2200
|
+
(d) => n.some((b) => Ue(b.id, d.value) && b.plane === d.plane)
|
|
2201
|
+
), [C, n]), w = G((c, d) => {
|
|
2202
|
+
if (!d) return !0;
|
|
2203
|
+
const b = d.toLowerCase().replace(/\s+|_/g, ""), j = c.data;
|
|
2200
2204
|
return !j || !j.searchTokens ? !1 : j.searchTokens.some(
|
|
2201
|
-
(A) => A.includes(
|
|
2205
|
+
(A) => A.includes(b)
|
|
2202
2206
|
);
|
|
2203
|
-
}, []),
|
|
2207
|
+
}, []), v = G(
|
|
2204
2208
|
(c) => {
|
|
2205
|
-
const
|
|
2209
|
+
const d = c.map((b) => {
|
|
2206
2210
|
const j = n.find(
|
|
2207
|
-
(
|
|
2211
|
+
(R) => Ue(R.id, b.value) && R.plane === b.plane
|
|
2208
2212
|
), A = r.find(
|
|
2209
|
-
(
|
|
2210
|
-
), $ =
|
|
2211
|
-
(
|
|
2212
|
-
) : void 0,
|
|
2213
|
+
(R) => Ue(R.id, b.value) && R.plane === b.plane
|
|
2214
|
+
), $ = m ? n.find(
|
|
2215
|
+
(R) => Be(R.id) === Be(b.value) && R.plane === b.plane
|
|
2216
|
+
) : void 0, D = $ && !j ? $.min : A && A.min ? A.min : 0, O = $ && !j ? $.max : A && A.max ? A.max : 0;
|
|
2213
2217
|
return j ?? {
|
|
2214
|
-
id:
|
|
2215
|
-
plane:
|
|
2216
|
-
min:
|
|
2218
|
+
id: b.value,
|
|
2219
|
+
plane: b.plane,
|
|
2220
|
+
min: D,
|
|
2217
2221
|
max: O,
|
|
2218
|
-
sensorOnly:
|
|
2222
|
+
sensorOnly: b.sensorOnly,
|
|
2219
2223
|
kind: h ?? Ke.Limit
|
|
2220
2224
|
};
|
|
2221
2225
|
});
|
|
2222
|
-
a(
|
|
2226
|
+
a(d);
|
|
2223
2227
|
},
|
|
2224
|
-
[a, n, r, h,
|
|
2228
|
+
[a, n, r, h, m]
|
|
2225
2229
|
);
|
|
2226
|
-
return
|
|
2230
|
+
return le(() => {
|
|
2227
2231
|
const c = n.filter(
|
|
2228
|
-
(
|
|
2232
|
+
(d) => r.some((b) => Ue(b.id, d.id) && b.plane === d.plane)
|
|
2229
2233
|
);
|
|
2230
2234
|
c.length !== n.length && a(c);
|
|
2231
2235
|
}, [r, a, n]), /* @__PURE__ */ e.jsxs(te, { ...i, children: [
|
|
2232
2236
|
/* @__PURE__ */ e.jsx(
|
|
2233
|
-
|
|
2237
|
+
me,
|
|
2234
2238
|
{
|
|
2235
2239
|
isMulti: !x,
|
|
2236
2240
|
placeholder: n.length ? `${n.length} selected` : "Search...",
|
|
2237
2241
|
value: M,
|
|
2238
|
-
isDisabled:
|
|
2239
|
-
onChange: (c) => Array.isArray(c) ?
|
|
2242
|
+
isDisabled: u || M.length >= (g ?? 1 / 0),
|
|
2243
|
+
onChange: (c) => Array.isArray(c) ? v([...c]) : v(c !== null ? [c] : []),
|
|
2240
2244
|
options: L,
|
|
2241
2245
|
controlShouldRenderValue: !1,
|
|
2242
2246
|
formatOptionLabel: (c) => c.label,
|
|
@@ -2245,7 +2249,7 @@ const Mn = ({
|
|
|
2245
2249
|
}
|
|
2246
2250
|
),
|
|
2247
2251
|
/* @__PURE__ */ e.jsx(
|
|
2248
|
-
|
|
2252
|
+
Hn,
|
|
2249
2253
|
{
|
|
2250
2254
|
marginTop: 2,
|
|
2251
2255
|
maxH: "28rem",
|
|
@@ -2253,142 +2257,139 @@ const Mn = ({
|
|
|
2253
2257
|
onChange: a,
|
|
2254
2258
|
forceKind: h,
|
|
2255
2259
|
disableKind: p,
|
|
2256
|
-
isDisabled:
|
|
2257
|
-
lockRanges:
|
|
2260
|
+
isDisabled: u,
|
|
2261
|
+
lockRanges: m
|
|
2258
2262
|
}
|
|
2259
2263
|
)
|
|
2260
2264
|
] });
|
|
2261
|
-
},
|
|
2265
|
+
}, bt = (r) => {
|
|
2262
2266
|
switch (r) {
|
|
2263
|
-
case
|
|
2267
|
+
case ue.Thorax:
|
|
2264
2268
|
return "Thorax";
|
|
2265
|
-
case
|
|
2269
|
+
case ue.CenterBack:
|
|
2266
2270
|
return "Center Back";
|
|
2267
|
-
case
|
|
2271
|
+
case ue.Pelvis:
|
|
2268
2272
|
return "Pelvis";
|
|
2269
|
-
case
|
|
2273
|
+
case ue.LeftThigh:
|
|
2270
2274
|
return "Left Thigh";
|
|
2271
|
-
case
|
|
2275
|
+
case ue.RightThigh:
|
|
2272
2276
|
return "Right Thigh";
|
|
2273
|
-
case
|
|
2277
|
+
case ue.LeftShank:
|
|
2274
2278
|
return "Left Shank";
|
|
2275
|
-
case
|
|
2279
|
+
case ue.RightShank:
|
|
2276
2280
|
return "Right Shank";
|
|
2277
|
-
case
|
|
2281
|
+
case ue.LeftFoot:
|
|
2278
2282
|
return "Left Foot";
|
|
2279
|
-
case
|
|
2283
|
+
case ue.RightFoot:
|
|
2280
2284
|
return "Right Foot";
|
|
2281
|
-
case
|
|
2285
|
+
case ue.LeftUpperArm:
|
|
2282
2286
|
return "Left Upper Arm";
|
|
2283
|
-
case
|
|
2287
|
+
case ue.RightUpperArm:
|
|
2284
2288
|
return "Right Upper Arm";
|
|
2285
|
-
case
|
|
2289
|
+
case ue.LeftForearm:
|
|
2286
2290
|
return "Left Forearm";
|
|
2287
|
-
case
|
|
2291
|
+
case ue.RightForearm:
|
|
2288
2292
|
return "Right Forearm";
|
|
2289
|
-
case
|
|
2293
|
+
case ue.Head:
|
|
2290
2294
|
return "Head";
|
|
2291
2295
|
}
|
|
2292
|
-
},
|
|
2293
|
-
switch (r) {
|
|
2294
|
-
case ae.GeneralActivity:
|
|
2295
|
-
return "General Activity";
|
|
2296
|
-
case ae.MovementCoordination:
|
|
2297
|
-
return "Movement Coordination";
|
|
2298
|
-
case ae.PointOfInterest:
|
|
2299
|
-
return "Point of Interest";
|
|
2300
|
-
case ae.Range:
|
|
2301
|
-
return "Range";
|
|
2302
|
-
case ae.StabilityBalance:
|
|
2303
|
-
return "Stability Balance";
|
|
2304
|
-
}
|
|
2305
|
-
}, gs = ({
|
|
2296
|
+
}, js = ({
|
|
2306
2297
|
id: r,
|
|
2307
2298
|
onError: n,
|
|
2308
2299
|
onCancel: a,
|
|
2309
2300
|
onSave: h,
|
|
2310
2301
|
hideButtons: x,
|
|
2311
|
-
setButtonOnClick:
|
|
2312
|
-
setButtonDisabled:
|
|
2302
|
+
setButtonOnClick: m,
|
|
2303
|
+
setButtonDisabled: u,
|
|
2313
2304
|
quantumOwned: p,
|
|
2314
2305
|
isView: s
|
|
2315
2306
|
}) => {
|
|
2316
|
-
const i =
|
|
2317
|
-
query:
|
|
2307
|
+
const i = at(), [{ fetching: g }, C] = fe(ot), [{ fetching: L }, M] = fe(dn), [{ data: w }] = we({
|
|
2308
|
+
query: un,
|
|
2318
2309
|
variables: { id: r ?? "" },
|
|
2319
2310
|
pause: !r
|
|
2320
|
-
}),
|
|
2311
|
+
}), v = k(() => {
|
|
2321
2312
|
const f = I(
|
|
2322
|
-
|
|
2313
|
+
Ce,
|
|
2323
2314
|
w?.getActionById
|
|
2324
2315
|
);
|
|
2325
2316
|
if (!f) return null;
|
|
2326
|
-
const
|
|
2327
|
-
...
|
|
2328
|
-
thresholds: I(
|
|
2317
|
+
const F = (I(Ze, f.reports) || []).map((P) => ({
|
|
2318
|
+
...P,
|
|
2319
|
+
thresholds: I(Oe, P.thresholds)
|
|
2329
2320
|
}));
|
|
2330
2321
|
return {
|
|
2331
2322
|
...f,
|
|
2332
|
-
thresholds: I(
|
|
2333
|
-
reports:
|
|
2323
|
+
thresholds: I(Oe, f.thresholds),
|
|
2324
|
+
reports: F
|
|
2334
2325
|
};
|
|
2335
|
-
}, [w]), c = g || L,
|
|
2336
|
-
action:
|
|
2337
|
-
}), [
|
|
2326
|
+
}, [w]), c = g || L, d = !!v && !!r, { getLabel: b } = xe(), j = k(() => ({
|
|
2327
|
+
action: b("action")
|
|
2328
|
+
}), [b]), A = k(() => [
|
|
2338
2329
|
{ key: "module_category", label: "Link Category", multi: !0 },
|
|
2339
2330
|
{ key: "activity_type", label: `${j.action} Type`, multi: !1 },
|
|
2340
2331
|
{ key: "session_type", label: "Session Type", multi: !0 },
|
|
2341
2332
|
{ key: "body_region", label: "Body Region", multi: !0 },
|
|
2342
|
-
{ key: "sport", label: "Sport", multi: !0 }
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2333
|
+
{ key: "sport", label: "Sport", multi: !0 },
|
|
2334
|
+
{
|
|
2335
|
+
key: "activity_motion_direction",
|
|
2336
|
+
label: "Activity Motion Direction",
|
|
2337
|
+
multi: !0
|
|
2338
|
+
}
|
|
2339
|
+
], [j.action]), [$, D] = _(""), [O, R] = _(""), [J, oe] = _(""), [N, V] = _(""), [ee, T] = _([]), [z, X] = _({}), [W, H] = _(null), [l, t] = _(""), [o, y] = _([]), [U, q] = _([]), [Q, E] = _(""), [K, ce] = _([]), ye = xn(), Ve = k(() => ye.filter((f) => f.sensorOnly), [ye]), ke = [
|
|
2340
|
+
{
|
|
2341
|
+
label: Le(ae.GeneralActivity),
|
|
2342
|
+
value: ae.GeneralActivity
|
|
2343
|
+
},
|
|
2344
|
+
{
|
|
2345
|
+
label: Le(ae.MovementCoordination),
|
|
2346
|
+
value: ae.MovementCoordination
|
|
2347
|
+
},
|
|
2348
|
+
{ label: Le(ae.Range), value: ae.Range },
|
|
2349
|
+
{
|
|
2350
|
+
label: Le(ae.StabilityBalance),
|
|
2351
|
+
value: ae.StabilityBalance
|
|
2352
|
+
},
|
|
2353
|
+
{
|
|
2354
|
+
label: Le(ae.PointOfInterest),
|
|
2355
|
+
value: ae.PointOfInterest
|
|
2356
|
+
}
|
|
2357
|
+
], Pe = $.length > 0, [Ge, et] = _({});
|
|
2358
|
+
le(() => {
|
|
2359
2359
|
const f = A.map(
|
|
2360
|
-
(
|
|
2360
|
+
(B) => i.query(rt, { key: B.key })
|
|
2361
2361
|
);
|
|
2362
|
-
Promise.all(f).then((
|
|
2363
|
-
const
|
|
2364
|
-
|
|
2365
|
-
if (
|
|
2366
|
-
const
|
|
2362
|
+
Promise.all(f).then((B) => {
|
|
2363
|
+
const F = {};
|
|
2364
|
+
B.forEach((P) => {
|
|
2365
|
+
if (P.error || !P.data) return;
|
|
2366
|
+
const Z = I(
|
|
2367
2367
|
je,
|
|
2368
|
-
|
|
2368
|
+
P.data.getMetadataByKey
|
|
2369
2369
|
), ne = I(
|
|
2370
2370
|
be,
|
|
2371
|
-
|
|
2371
|
+
Z.data
|
|
2372
2372
|
);
|
|
2373
|
-
|
|
2374
|
-
label:
|
|
2375
|
-
value:
|
|
2376
|
-
id:
|
|
2373
|
+
F[Z.key] = ne.map((pe) => ({
|
|
2374
|
+
label: pe.label || pe.value,
|
|
2375
|
+
value: pe.value,
|
|
2376
|
+
id: pe.id
|
|
2377
2377
|
}));
|
|
2378
|
-
}),
|
|
2378
|
+
}), X(F);
|
|
2379
2379
|
});
|
|
2380
|
-
}, [i, A]),
|
|
2381
|
-
if (
|
|
2382
|
-
const
|
|
2380
|
+
}, [i, A]), le(() => {
|
|
2381
|
+
if (v) {
|
|
2382
|
+
const B = I(
|
|
2383
2383
|
je,
|
|
2384
|
-
|
|
2384
|
+
v.metadataGroups
|
|
2385
2385
|
).map(
|
|
2386
|
-
(
|
|
2387
|
-
),
|
|
2388
|
-
id:
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2386
|
+
(Z) => Z.data.map((ne) => I(be, ne).id)
|
|
2387
|
+
), F = v.reports.map((Z) => ({
|
|
2388
|
+
id: Z.id,
|
|
2389
|
+
name: Z.name ?? "",
|
|
2390
|
+
instructions: Z.instructions ?? "",
|
|
2391
|
+
kind: Z.reportKind,
|
|
2392
|
+
parameters: Z.thresholds.map((ne) => ({
|
|
2392
2393
|
id: {
|
|
2393
2394
|
[ne.partKind]: ne.partId
|
|
2394
2395
|
},
|
|
@@ -2397,80 +2398,81 @@ const Mn = ({
|
|
|
2397
2398
|
max: ne.max,
|
|
2398
2399
|
plane: ne.partDimension,
|
|
2399
2400
|
oldId: ne.id,
|
|
2400
|
-
sensorOnly:
|
|
2401
|
-
const
|
|
2402
|
-
return
|
|
2401
|
+
sensorOnly: Ve.some((pe) => {
|
|
2402
|
+
const tt = pe.id[ne.partKind];
|
|
2403
|
+
return tt ? tt === ne.partId && pe.plane === ne.partDimension : !1;
|
|
2403
2404
|
})
|
|
2404
2405
|
})),
|
|
2405
|
-
sensorLocations:
|
|
2406
|
-
})),
|
|
2407
|
-
name:
|
|
2408
|
-
description:
|
|
2409
|
-
cameraPlacement:
|
|
2410
|
-
videoLink:
|
|
2411
|
-
metadataIds:
|
|
2412
|
-
reports:
|
|
2406
|
+
sensorLocations: Z.sensorLocations
|
|
2407
|
+
})), P = {
|
|
2408
|
+
name: v.name,
|
|
2409
|
+
description: v.description || "",
|
|
2410
|
+
cameraPlacement: v.cameraPlacement || "",
|
|
2411
|
+
videoLink: v.videoLink || "",
|
|
2412
|
+
metadataIds: B.flat(),
|
|
2413
|
+
reports: F
|
|
2413
2414
|
};
|
|
2414
|
-
|
|
2415
|
+
D(P.name), R(P.description), oe(P.cameraPlacement), V(P.videoLink), T(P.metadataIds), ce(F), et(P);
|
|
2415
2416
|
}
|
|
2416
|
-
}, [
|
|
2417
|
-
const
|
|
2418
|
-
() => JSON.stringify(
|
|
2417
|
+
}, [v, Ve]);
|
|
2418
|
+
const Te = k(
|
|
2419
|
+
() => JSON.stringify(Ge) !== JSON.stringify({
|
|
2419
2420
|
name: $,
|
|
2420
2421
|
description: O,
|
|
2421
|
-
cameraPlacement:
|
|
2422
|
-
videoLink:
|
|
2423
|
-
metadataIds:
|
|
2424
|
-
reports:
|
|
2422
|
+
cameraPlacement: J,
|
|
2423
|
+
videoLink: N,
|
|
2424
|
+
metadataIds: ee,
|
|
2425
|
+
reports: K
|
|
2425
2426
|
}),
|
|
2426
2427
|
[
|
|
2427
|
-
|
|
2428
|
+
Ge,
|
|
2428
2429
|
$,
|
|
2429
2430
|
O,
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2431
|
+
J,
|
|
2432
|
+
N,
|
|
2433
|
+
ee,
|
|
2434
|
+
K
|
|
2434
2435
|
]
|
|
2435
|
-
),
|
|
2436
|
+
), Se = G(() => {
|
|
2436
2437
|
const f = {
|
|
2437
2438
|
name: $,
|
|
2438
2439
|
description: O,
|
|
2439
|
-
cameraPlacement:
|
|
2440
|
-
videoLink:
|
|
2441
|
-
metadataItemIds:
|
|
2440
|
+
cameraPlacement: J,
|
|
2441
|
+
videoLink: N,
|
|
2442
|
+
metadataItemIds: ee,
|
|
2442
2443
|
// Backend requires laterality; keep existing default since UI no longer edits it
|
|
2443
|
-
laterality:
|
|
2444
|
+
laterality: An.Either,
|
|
2444
2445
|
quantumOwned: p,
|
|
2445
2446
|
//Backend requires session type; keep existing default since UI no longer edits it
|
|
2446
2447
|
sessionType: [],
|
|
2447
2448
|
// Backend requires thresholds; use empty array since reports handle parameters now
|
|
2448
2449
|
thresholds: [],
|
|
2449
2450
|
// Include reports data
|
|
2450
|
-
reports:
|
|
2451
|
-
id:
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2451
|
+
reports: K.map((F) => ({
|
|
2452
|
+
id: F.isNew ? void 0 : F.id,
|
|
2453
|
+
name: F.name,
|
|
2454
|
+
reportKind: F.kind,
|
|
2455
|
+
sensorLocations: F.sensorLocations,
|
|
2456
|
+
instructions: F.instructions,
|
|
2457
|
+
thresholds: F.parameters.map((P) => ({
|
|
2458
|
+
id: P.oldId,
|
|
2459
|
+
kind: P.kind,
|
|
2460
|
+
min: P.min,
|
|
2461
|
+
max: P.max,
|
|
2462
|
+
partKind: "joint" in P.id ? "joint" : "segment",
|
|
2463
|
+
partId: "joint" in P.id ? P.id.joint : P.id.segment,
|
|
2464
|
+
partDimension: P.plane
|
|
2463
2465
|
}))
|
|
2464
2466
|
}))
|
|
2465
2467
|
};
|
|
2466
|
-
let
|
|
2467
|
-
|
|
2468
|
+
let B;
|
|
2469
|
+
d && r ? B = M({
|
|
2468
2470
|
id: r,
|
|
2469
2471
|
fields: f
|
|
2470
|
-
}) :
|
|
2472
|
+
}) : B = C({
|
|
2471
2473
|
fields: f
|
|
2472
|
-
}),
|
|
2473
|
-
|
|
2474
|
+
}), B.then(({ error: F }) => {
|
|
2475
|
+
F ? n(F) : h();
|
|
2474
2476
|
});
|
|
2475
2477
|
}, [
|
|
2476
2478
|
p,
|
|
@@ -2479,100 +2481,102 @@ const Mn = ({
|
|
|
2479
2481
|
r,
|
|
2480
2482
|
$,
|
|
2481
2483
|
O,
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2484
|
+
J,
|
|
2485
|
+
N,
|
|
2486
|
+
ee,
|
|
2487
|
+
K,
|
|
2488
|
+
d,
|
|
2487
2489
|
h,
|
|
2488
2490
|
n
|
|
2489
2491
|
]);
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
+
le(() => {
|
|
2493
|
+
u && u({
|
|
2492
2494
|
cancelButton: c,
|
|
2493
|
-
saveButton: s ? !0 : c || !
|
|
2495
|
+
saveButton: s ? !0 : c || !Pe || !Te
|
|
2494
2496
|
});
|
|
2495
|
-
}, [c,
|
|
2496
|
-
|
|
2497
|
+
}, [c, u, Pe, Te, s]), le(() => {
|
|
2498
|
+
m && m({
|
|
2497
2499
|
cancelButton: a,
|
|
2498
2500
|
saveButton: s ? () => {
|
|
2499
|
-
} :
|
|
2501
|
+
} : Se
|
|
2500
2502
|
});
|
|
2501
|
-
}, [
|
|
2502
|
-
const
|
|
2503
|
+
}, [m, a, Se, s]);
|
|
2504
|
+
const he = G(
|
|
2503
2505
|
(f) => {
|
|
2504
|
-
const
|
|
2506
|
+
const B = xt(
|
|
2505
2507
|
f.map(
|
|
2506
|
-
(
|
|
2508
|
+
(F) => "joint" in F.id ? F.id.joint : F.id.segment
|
|
2507
2509
|
)
|
|
2508
2510
|
);
|
|
2509
|
-
|
|
2511
|
+
q(B);
|
|
2510
2512
|
},
|
|
2511
2513
|
[]
|
|
2512
2514
|
);
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
}, [
|
|
2516
|
-
const
|
|
2517
|
-
if (!W)
|
|
2515
|
+
le(() => {
|
|
2516
|
+
he(o);
|
|
2517
|
+
}, [o, he]);
|
|
2518
|
+
const Ne = G(() => {
|
|
2519
|
+
if (!W || !l.trim())
|
|
2518
2520
|
return;
|
|
2519
|
-
const f = W === ae.PointOfInterest,
|
|
2521
|
+
const f = W === ae.PointOfInterest, B = {
|
|
2520
2522
|
id: Date.now().toString(),
|
|
2521
2523
|
// Temporary ID
|
|
2524
|
+
name: l.trim(),
|
|
2522
2525
|
kind: W,
|
|
2523
|
-
parameters: f ? [] :
|
|
2524
|
-
sensorLocations: f ? [] :
|
|
2525
|
-
instructions: f ?
|
|
2526
|
+
parameters: f ? [] : o,
|
|
2527
|
+
sensorLocations: f ? [] : U,
|
|
2528
|
+
instructions: f ? Q : "",
|
|
2526
2529
|
isNew: !0
|
|
2527
2530
|
};
|
|
2528
|
-
|
|
2531
|
+
ce((F) => [...F, B]), H(null), t(""), y([]), q([]), E("");
|
|
2529
2532
|
}, [
|
|
2530
2533
|
W,
|
|
2531
2534
|
l,
|
|
2532
2535
|
o,
|
|
2533
|
-
U
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2536
|
+
U,
|
|
2537
|
+
Q
|
|
2538
|
+
]), $t = G((f) => {
|
|
2539
|
+
ce((B) => B.filter((F) => F.id !== f));
|
|
2540
|
+
}, []), Dt = (f, B) => {
|
|
2541
|
+
const F = A.find((Z) => Z.key === f);
|
|
2542
|
+
if (!F) return;
|
|
2543
|
+
const P = F.multi ? (B ?? []).map(
|
|
2544
|
+
(Z) => Z.id
|
|
2545
|
+
) : B ? [B.id] : [];
|
|
2546
|
+
T((Z) => [...Z.filter((pe) => Object.values(z).flat().find((Ee) => Ee.id === pe) && !Object.keys(z).find(
|
|
2547
|
+
(Ee) => z[Ee]?.some(
|
|
2548
|
+
(Ft) => Ft.id === pe && Ee === f
|
|
2545
2549
|
)
|
|
2546
|
-
)), ...
|
|
2550
|
+
)), ...P]);
|
|
2547
2551
|
};
|
|
2548
|
-
return /* @__PURE__ */ e.jsxs(
|
|
2549
|
-
/* @__PURE__ */ e.jsxs(
|
|
2550
|
-
/* @__PURE__ */ e.jsxs(
|
|
2551
|
-
/* @__PURE__ */ e.jsx(
|
|
2552
|
-
/* @__PURE__ */ e.jsx(
|
|
2552
|
+
return /* @__PURE__ */ e.jsxs(de, { spacing: 4, w: "full", align: "stretch", children: [
|
|
2553
|
+
/* @__PURE__ */ e.jsxs(tn, { children: [
|
|
2554
|
+
/* @__PURE__ */ e.jsxs(nn, { children: [
|
|
2555
|
+
/* @__PURE__ */ e.jsx(ht, { children: "Activity Configuration" }),
|
|
2556
|
+
/* @__PURE__ */ e.jsx(ht, { children: "Reports Configuration" })
|
|
2553
2557
|
] }),
|
|
2554
|
-
/* @__PURE__ */ e.jsxs(
|
|
2555
|
-
/* @__PURE__ */ e.jsx(
|
|
2558
|
+
/* @__PURE__ */ e.jsxs(sn, { children: [
|
|
2559
|
+
/* @__PURE__ */ e.jsx(pt, { px: 0, children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
|
|
2556
2560
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
2557
|
-
/* @__PURE__ */ e.jsxs(
|
|
2558
|
-
/* @__PURE__ */ e.jsx(
|
|
2561
|
+
/* @__PURE__ */ e.jsxs(Y, { children: [
|
|
2562
|
+
/* @__PURE__ */ e.jsx(ie, { children: "Name" }),
|
|
2559
2563
|
/* @__PURE__ */ e.jsx(
|
|
2560
|
-
|
|
2564
|
+
ve,
|
|
2561
2565
|
{
|
|
2562
2566
|
value: $,
|
|
2563
|
-
onChange: (f) =>
|
|
2567
|
+
onChange: (f) => D(f.target.value),
|
|
2564
2568
|
type: "text",
|
|
2565
2569
|
placeholder: "i.e. Lunge & Return",
|
|
2566
2570
|
isDisabled: s
|
|
2567
2571
|
}
|
|
2568
2572
|
)
|
|
2569
2573
|
] }),
|
|
2570
|
-
/* @__PURE__ */ e.jsxs(
|
|
2571
|
-
/* @__PURE__ */ e.jsx(
|
|
2574
|
+
/* @__PURE__ */ e.jsxs(Y, { children: [
|
|
2575
|
+
/* @__PURE__ */ e.jsx(ie, { children: "Camera Placement" }),
|
|
2572
2576
|
/* @__PURE__ */ e.jsx(
|
|
2573
2577
|
ze,
|
|
2574
2578
|
{
|
|
2575
|
-
value:
|
|
2579
|
+
value: J,
|
|
2576
2580
|
onChange: (f) => oe(f.target.value),
|
|
2577
2581
|
rows: 2,
|
|
2578
2582
|
placeholder: "(optional) Describe camera setup, placement, angles",
|
|
@@ -2580,26 +2584,26 @@ const Mn = ({
|
|
|
2580
2584
|
}
|
|
2581
2585
|
)
|
|
2582
2586
|
] }),
|
|
2583
|
-
/* @__PURE__ */ e.jsxs(
|
|
2584
|
-
/* @__PURE__ */ e.jsx(
|
|
2587
|
+
/* @__PURE__ */ e.jsxs(Y, { children: [
|
|
2588
|
+
/* @__PURE__ */ e.jsx(ie, { children: "Video Link" }),
|
|
2585
2589
|
/* @__PURE__ */ e.jsx(
|
|
2586
|
-
|
|
2590
|
+
ve,
|
|
2587
2591
|
{
|
|
2588
|
-
value:
|
|
2589
|
-
onChange: (f) =>
|
|
2592
|
+
value: N,
|
|
2593
|
+
onChange: (f) => V(f.target.value),
|
|
2590
2594
|
type: "url",
|
|
2591
2595
|
placeholder: "(optional) https://...",
|
|
2592
2596
|
isDisabled: s
|
|
2593
2597
|
}
|
|
2594
2598
|
)
|
|
2595
2599
|
] }),
|
|
2596
|
-
/* @__PURE__ */ e.jsxs(
|
|
2597
|
-
/* @__PURE__ */ e.jsx(
|
|
2600
|
+
/* @__PURE__ */ e.jsxs(Y, { children: [
|
|
2601
|
+
/* @__PURE__ */ e.jsx(ie, { children: "Description" }),
|
|
2598
2602
|
/* @__PURE__ */ e.jsx(
|
|
2599
2603
|
ze,
|
|
2600
2604
|
{
|
|
2601
2605
|
value: O,
|
|
2602
|
-
onChange: (f) =>
|
|
2606
|
+
onChange: (f) => R(f.target.value),
|
|
2603
2607
|
rows: 2,
|
|
2604
2608
|
placeholder: "(optional) Describe how to perform the test or exercise",
|
|
2605
2609
|
isDisabled: s
|
|
@@ -2608,20 +2612,20 @@ const Mn = ({
|
|
|
2608
2612
|
] })
|
|
2609
2613
|
] }),
|
|
2610
2614
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
2611
|
-
/* @__PURE__ */ e.jsx(
|
|
2612
|
-
A.map((f) => /* @__PURE__ */ e.jsxs(
|
|
2613
|
-
/* @__PURE__ */ e.jsx(
|
|
2615
|
+
/* @__PURE__ */ e.jsx(ie, { children: "Metadata Tags" }),
|
|
2616
|
+
A.map((f) => /* @__PURE__ */ e.jsxs(Y, { children: [
|
|
2617
|
+
/* @__PURE__ */ e.jsx(ie, { children: f.label }),
|
|
2614
2618
|
/* @__PURE__ */ e.jsx(
|
|
2615
|
-
|
|
2619
|
+
me,
|
|
2616
2620
|
{
|
|
2617
2621
|
isMulti: f.multi,
|
|
2618
|
-
value:
|
|
2619
|
-
(
|
|
2622
|
+
value: z[f.key]?.filter(
|
|
2623
|
+
(B) => ee.includes(B.id)
|
|
2620
2624
|
),
|
|
2621
|
-
onChange: (
|
|
2622
|
-
|
|
2625
|
+
onChange: (B) => {
|
|
2626
|
+
Dt(f.key, B);
|
|
2623
2627
|
},
|
|
2624
|
-
options:
|
|
2628
|
+
options: z[f.key],
|
|
2625
2629
|
placeholder: `Select ${f.multi ? "one or more" : "one"} ${f.label.toLowerCase()}`,
|
|
2626
2630
|
isDisabled: s,
|
|
2627
2631
|
isClearable: f.multi
|
|
@@ -2630,7 +2634,7 @@ const Mn = ({
|
|
|
2630
2634
|
] }, f.key))
|
|
2631
2635
|
] })
|
|
2632
2636
|
] }) }),
|
|
2633
|
-
/* @__PURE__ */ e.jsx(
|
|
2637
|
+
/* @__PURE__ */ e.jsx(pt, { px: 0, children: /* @__PURE__ */ e.jsxs(
|
|
2634
2638
|
"div",
|
|
2635
2639
|
{
|
|
2636
2640
|
className: qe(
|
|
@@ -2639,43 +2643,56 @@ const Mn = ({
|
|
|
2639
2643
|
),
|
|
2640
2644
|
children: [
|
|
2641
2645
|
/* @__PURE__ */ e.jsxs("div", { className: qe("space-y-4", s && "hidden"), children: [
|
|
2642
|
-
/* @__PURE__ */ e.jsx(
|
|
2643
|
-
/* @__PURE__ */ e.jsxs(
|
|
2644
|
-
/* @__PURE__ */ e.jsx(
|
|
2645
|
-
|
|
2646
|
-
|
|
2646
|
+
/* @__PURE__ */ e.jsx(ie, { children: "Add New Report" }),
|
|
2647
|
+
/* @__PURE__ */ e.jsxs(Y, { children: [
|
|
2648
|
+
/* @__PURE__ */ e.jsx(ie, { children: "Report Name" }),
|
|
2649
|
+
/* @__PURE__ */ e.jsx(
|
|
2650
|
+
ve,
|
|
2651
|
+
{
|
|
2652
|
+
value: l,
|
|
2653
|
+
onChange: (f) => t(f.target.value),
|
|
2654
|
+
type: "text",
|
|
2655
|
+
placeholder: "Enter report name...",
|
|
2656
|
+
isDisabled: s
|
|
2657
|
+
}
|
|
2658
|
+
)
|
|
2659
|
+
] }),
|
|
2660
|
+
/* @__PURE__ */ e.jsxs(Y, { children: [
|
|
2661
|
+
/* @__PURE__ */ e.jsx(ie, { children: "Report Type" }),
|
|
2662
|
+
/* @__PURE__ */ e.jsx(
|
|
2663
|
+
me,
|
|
2647
2664
|
{
|
|
2648
|
-
value: W ?
|
|
2665
|
+
value: W ? ke.find(
|
|
2649
2666
|
(f) => f.value === W
|
|
2650
2667
|
) : null,
|
|
2651
|
-
onChange: (f) =>
|
|
2652
|
-
options:
|
|
2653
|
-
placeholder: "Select report
|
|
2668
|
+
onChange: (f) => H(f?.value || null),
|
|
2669
|
+
options: ke,
|
|
2670
|
+
placeholder: "Select report type...",
|
|
2654
2671
|
isDisabled: s,
|
|
2655
2672
|
isClearable: !0
|
|
2656
2673
|
}
|
|
2657
2674
|
)
|
|
2658
2675
|
] }),
|
|
2659
2676
|
W !== ae.PointOfInterest && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2660
|
-
/* @__PURE__ */ e.jsxs(
|
|
2661
|
-
/* @__PURE__ */ e.jsx(
|
|
2677
|
+
/* @__PURE__ */ e.jsxs(Y, { children: [
|
|
2678
|
+
/* @__PURE__ */ e.jsx(ie, { children: "Default Parameters" }),
|
|
2662
2679
|
/* @__PURE__ */ e.jsx(
|
|
2663
|
-
|
|
2680
|
+
jt,
|
|
2664
2681
|
{
|
|
2665
|
-
options:
|
|
2666
|
-
value:
|
|
2667
|
-
onChange:
|
|
2682
|
+
options: ye,
|
|
2683
|
+
value: o,
|
|
2684
|
+
onChange: y,
|
|
2668
2685
|
editOnly: s
|
|
2669
2686
|
}
|
|
2670
2687
|
)
|
|
2671
2688
|
] }),
|
|
2672
|
-
/* @__PURE__ */ e.jsxs(
|
|
2673
|
-
/* @__PURE__ */ e.jsx(
|
|
2689
|
+
/* @__PURE__ */ e.jsxs(Y, { children: [
|
|
2690
|
+
/* @__PURE__ */ e.jsx(ie, { children: "Suggested Sensor Locations" }),
|
|
2674
2691
|
/* @__PURE__ */ e.jsx(
|
|
2675
|
-
|
|
2692
|
+
ve,
|
|
2676
2693
|
{
|
|
2677
|
-
value:
|
|
2678
|
-
(f) =>
|
|
2694
|
+
value: U.map(
|
|
2695
|
+
(f) => bt(f)
|
|
2679
2696
|
).join(", "),
|
|
2680
2697
|
placeholder: "Auto-filled based on parameters...",
|
|
2681
2698
|
isDisabled: !0
|
|
@@ -2683,13 +2700,13 @@ const Mn = ({
|
|
|
2683
2700
|
)
|
|
2684
2701
|
] })
|
|
2685
2702
|
] }),
|
|
2686
|
-
W === ae.PointOfInterest && /* @__PURE__ */ e.jsxs(
|
|
2687
|
-
/* @__PURE__ */ e.jsx(
|
|
2703
|
+
W === ae.PointOfInterest && /* @__PURE__ */ e.jsxs(Y, { children: [
|
|
2704
|
+
/* @__PURE__ */ e.jsx(ie, { children: "Instructions" }),
|
|
2688
2705
|
/* @__PURE__ */ e.jsx(
|
|
2689
2706
|
ze,
|
|
2690
2707
|
{
|
|
2691
|
-
value:
|
|
2692
|
-
onChange: (f) =>
|
|
2708
|
+
value: Q,
|
|
2709
|
+
onChange: (f) => E(f.target.value),
|
|
2693
2710
|
rows: 3,
|
|
2694
2711
|
placeholder: "Enter specific instructions for this report...",
|
|
2695
2712
|
isDisabled: s
|
|
@@ -2700,41 +2717,57 @@ const Mn = ({
|
|
|
2700
2717
|
se,
|
|
2701
2718
|
{
|
|
2702
2719
|
colorScheme: "blue",
|
|
2703
|
-
onClick:
|
|
2704
|
-
isDisabled: !W || s ||
|
|
2720
|
+
onClick: Ne,
|
|
2721
|
+
isDisabled: !W || !l.trim() || s || ke.length === 0 || W !== ae.PointOfInterest && o.length === 0,
|
|
2705
2722
|
children: "Add Report"
|
|
2706
2723
|
}
|
|
2707
2724
|
) })
|
|
2708
2725
|
] }),
|
|
2709
2726
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
2710
|
-
/* @__PURE__ */ e.jsx(
|
|
2711
|
-
|
|
2727
|
+
/* @__PURE__ */ e.jsx(ie, { children: "Configured Reports" }),
|
|
2728
|
+
K.length === 0 ? /* @__PURE__ */ e.jsx(S, { fontSize: "sm", color: "gray.500", children: "No reports created yet" }) : /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: K.map((f) => /* @__PURE__ */ e.jsxs(
|
|
2712
2729
|
"div",
|
|
2713
2730
|
{
|
|
2714
|
-
className: "p-3 border border-gray-200 rounded-md bg-gray-50",
|
|
2731
|
+
className: "p-3 border border-gray-200 rounded-md bg-gray-50 flex flex-col gap-2",
|
|
2715
2732
|
children: [
|
|
2716
|
-
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-between items-start
|
|
2717
|
-
/* @__PURE__ */ e.jsx(S, {
|
|
2733
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-between items-start", children: [
|
|
2734
|
+
/* @__PURE__ */ e.jsx(S, { fontSize: "sm", color: "gray.600", children: Le(f.kind) }),
|
|
2718
2735
|
!s && /* @__PURE__ */ e.jsx(
|
|
2719
2736
|
se,
|
|
2720
2737
|
{
|
|
2721
2738
|
size: "xs",
|
|
2722
2739
|
colorScheme: "red",
|
|
2723
2740
|
variant: "ghost",
|
|
2724
|
-
onClick: () =>
|
|
2741
|
+
onClick: () => $t(f.id),
|
|
2725
2742
|
children: "Remove"
|
|
2726
2743
|
}
|
|
2727
2744
|
)
|
|
2728
2745
|
] }),
|
|
2729
|
-
|
|
2730
|
-
/* @__PURE__ */ e.jsx(
|
|
2746
|
+
/* @__PURE__ */ e.jsxs(Y, { children: [
|
|
2747
|
+
/* @__PURE__ */ e.jsx(ie, { children: "Report Name" }),
|
|
2748
|
+
/* @__PURE__ */ e.jsx(
|
|
2749
|
+
ve,
|
|
2750
|
+
{
|
|
2751
|
+
value: f.name,
|
|
2752
|
+
onChange: (B) => ce(
|
|
2753
|
+
(F) => F.map(
|
|
2754
|
+
(P) => P.id === f.id ? { ...P, name: B.target.value } : P
|
|
2755
|
+
)
|
|
2756
|
+
),
|
|
2757
|
+
placeholder: "Enter report name...",
|
|
2758
|
+
isDisabled: s
|
|
2759
|
+
}
|
|
2760
|
+
)
|
|
2761
|
+
] }),
|
|
2762
|
+
f.kind === ae.PointOfInterest && /* @__PURE__ */ e.jsxs(Y, { children: [
|
|
2763
|
+
/* @__PURE__ */ e.jsx(ie, { children: "Instructions" }),
|
|
2731
2764
|
/* @__PURE__ */ e.jsx(
|
|
2732
2765
|
ze,
|
|
2733
2766
|
{
|
|
2734
2767
|
value: f.instructions,
|
|
2735
|
-
onChange: (
|
|
2736
|
-
(
|
|
2737
|
-
(
|
|
2768
|
+
onChange: (B) => ce(
|
|
2769
|
+
(F) => F.map(
|
|
2770
|
+
(P) => P.id === f.id ? { ...P, instructions: B.target.value } : P
|
|
2738
2771
|
)
|
|
2739
2772
|
),
|
|
2740
2773
|
rows: 3,
|
|
@@ -2743,29 +2776,32 @@ const Mn = ({
|
|
|
2743
2776
|
}
|
|
2744
2777
|
)
|
|
2745
2778
|
] }),
|
|
2746
|
-
f.kind !== ae.PointOfInterest && /* @__PURE__ */ e.
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2779
|
+
f.kind !== ae.PointOfInterest && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col", children: [
|
|
2780
|
+
/* @__PURE__ */ e.jsx(ie, { children: "Default Parameters" }),
|
|
2781
|
+
/* @__PURE__ */ e.jsx(
|
|
2782
|
+
jt,
|
|
2783
|
+
{
|
|
2784
|
+
options: ye,
|
|
2785
|
+
value: f.parameters,
|
|
2786
|
+
onChange: (B) => {
|
|
2787
|
+
const F = B.map(
|
|
2788
|
+
(Z) => Z.id.joint ?? Z.id.segment
|
|
2789
|
+
), P = xt(F);
|
|
2790
|
+
ce(
|
|
2791
|
+
(Z) => Z.map(
|
|
2792
|
+
(ne) => ne.id === f.id ? { ...ne, parameters: B, sensorLocations: P } : ne
|
|
2793
|
+
)
|
|
2794
|
+
);
|
|
2795
|
+
},
|
|
2796
|
+
editOnly: s
|
|
2797
|
+
}
|
|
2798
|
+
)
|
|
2799
|
+
] }),
|
|
2800
|
+
f.kind !== ae.PointOfInterest && /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", color: "gray.600", children: [
|
|
2765
2801
|
"Sensors:",
|
|
2766
2802
|
" ",
|
|
2767
2803
|
f.sensorLocations.map(
|
|
2768
|
-
(
|
|
2804
|
+
(B) => bt(B)
|
|
2769
2805
|
).join(", ")
|
|
2770
2806
|
] })
|
|
2771
2807
|
]
|
|
@@ -2783,15 +2819,15 @@ const Mn = ({
|
|
|
2783
2819
|
{
|
|
2784
2820
|
justify: "end",
|
|
2785
2821
|
className: qe((x || s) && "!hidden"),
|
|
2786
|
-
children: /* @__PURE__ */ e.jsxs(
|
|
2822
|
+
children: /* @__PURE__ */ e.jsxs(Ae, { gap: 4, children: [
|
|
2787
2823
|
/* @__PURE__ */ e.jsx(se, { colorScheme: "gray", isDisabled: c, onClick: a, children: "Cancel" }),
|
|
2788
2824
|
/* @__PURE__ */ e.jsx(
|
|
2789
2825
|
se,
|
|
2790
2826
|
{
|
|
2791
2827
|
colorScheme: "blue",
|
|
2792
|
-
isDisabled: c || !
|
|
2828
|
+
isDisabled: c || !Pe || !Te,
|
|
2793
2829
|
isLoading: c,
|
|
2794
|
-
onClick:
|
|
2830
|
+
onClick: Se,
|
|
2795
2831
|
children: "Save changes"
|
|
2796
2832
|
}
|
|
2797
2833
|
)
|
|
@@ -2799,17 +2835,17 @@ const Mn = ({
|
|
|
2799
2835
|
}
|
|
2800
2836
|
)
|
|
2801
2837
|
] });
|
|
2802
|
-
},
|
|
2838
|
+
}, ie = ({ children: r }) => /* @__PURE__ */ e.jsx(Xe, { fontWeight: "bold", fontFamily: "sans-serif", fontSize: "large", children: r }), Xn = ({
|
|
2803
2839
|
children: r,
|
|
2804
2840
|
isView: n,
|
|
2805
2841
|
metadataKeys: a
|
|
2806
2842
|
}) => {
|
|
2807
|
-
const [h, x] =
|
|
2808
|
-
return
|
|
2809
|
-
let
|
|
2843
|
+
const [h, x] = _({}), m = at();
|
|
2844
|
+
return le(() => {
|
|
2845
|
+
let u = !1;
|
|
2810
2846
|
return (async () => {
|
|
2811
2847
|
const s = (a ?? []).map(
|
|
2812
|
-
(C) =>
|
|
2848
|
+
(C) => m.query(rt, { key: C }).toPromise()
|
|
2813
2849
|
), i = await Promise.all(s), g = {};
|
|
2814
2850
|
for (const C of i) {
|
|
2815
2851
|
if (C.error || !C.data?.getMetadataByKey) continue;
|
|
@@ -2825,131 +2861,131 @@ const Mn = ({
|
|
|
2825
2861
|
id: w.id
|
|
2826
2862
|
}));
|
|
2827
2863
|
}
|
|
2828
|
-
|
|
2864
|
+
u || x(g);
|
|
2829
2865
|
})(), () => {
|
|
2830
|
-
|
|
2866
|
+
u = !0;
|
|
2831
2867
|
};
|
|
2832
|
-
}, [
|
|
2833
|
-
},
|
|
2868
|
+
}, [m, a]), /* @__PURE__ */ e.jsx(Rt.Provider, { value: { isView: n, metadataOptions: h }, children: r });
|
|
2869
|
+
}, bs = ({
|
|
2834
2870
|
id: r,
|
|
2835
2871
|
onCancel: n,
|
|
2836
2872
|
onSave: a,
|
|
2837
2873
|
onError: h,
|
|
2838
2874
|
hideButtons: x,
|
|
2839
|
-
quantumOwned:
|
|
2840
|
-
setButtonOnClick:
|
|
2875
|
+
quantumOwned: m,
|
|
2876
|
+
setButtonOnClick: u,
|
|
2841
2877
|
setButtonDisabled: p,
|
|
2842
2878
|
isView: s
|
|
2843
2879
|
}) => {
|
|
2844
|
-
const [{ data: i, fetching: g }] =
|
|
2845
|
-
query:
|
|
2846
|
-
}), [{ data: C }] =
|
|
2847
|
-
query:
|
|
2880
|
+
const [{ data: i, fetching: g }] = we({
|
|
2881
|
+
query: m ? mn : hn
|
|
2882
|
+
}), [{ data: C }] = we({
|
|
2883
|
+
query: pn,
|
|
2848
2884
|
variables: { id: r },
|
|
2849
2885
|
pause: !r
|
|
2850
|
-
}), [{ data: L }] =
|
|
2851
|
-
query:
|
|
2886
|
+
}), [{ data: L }] = we({
|
|
2887
|
+
query: gn
|
|
2852
2888
|
}), M = I(
|
|
2853
|
-
|
|
2889
|
+
De,
|
|
2854
2890
|
L?.moduleCategories
|
|
2855
|
-
), [{ fetching: w },
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
).filter((l) => !!l?.id), [i,
|
|
2859
|
-
...A.map((
|
|
2860
|
-
]), [O,
|
|
2861
|
-
|
|
2891
|
+
), [{ fetching: w }, v] = fe(At), [{ fetching: c }, d] = fe(Ot), b = k(() => !i || g ? [] : I(
|
|
2892
|
+
Ce,
|
|
2893
|
+
m ? i?.quantumOwnedActions ?? [] : i?.actions ?? []
|
|
2894
|
+
).filter((l) => !!l?.id), [i, m, g]), j = I(Qe, C?.module), A = k(() => I(kt, j?.moduleActions) ?? [], [j?.moduleActions]), [$, D] = _([
|
|
2895
|
+
...A.map((H) => H.actionId) ?? []
|
|
2896
|
+
]), [O, R] = _(j?.name ?? ""), [J, oe] = _([]), [N, V] = _(j?.description ?? ""), [ee, T] = _([]), [z, X] = _({});
|
|
2897
|
+
le(() => {
|
|
2862
2898
|
if (j) {
|
|
2863
|
-
|
|
2899
|
+
D(A.map((o) => o.actionId)), R(j.name), V(j.description ?? ""), oe(
|
|
2864
2900
|
j.categories.map(
|
|
2865
|
-
(o) => I(
|
|
2901
|
+
(o) => I(De, o).id
|
|
2866
2902
|
) ?? []
|
|
2867
2903
|
);
|
|
2868
2904
|
const l = I(
|
|
2869
2905
|
je,
|
|
2870
2906
|
j.metadataGroups
|
|
2871
2907
|
).map(
|
|
2872
|
-
(o) => o.data.map((
|
|
2908
|
+
(o) => o.data.map((y) => I(be, y).id)
|
|
2873
2909
|
);
|
|
2874
2910
|
T(l.flat());
|
|
2875
2911
|
const t = {};
|
|
2876
2912
|
A.forEach((o) => {
|
|
2877
2913
|
t[o.actionId] = o.reportId || null;
|
|
2878
|
-
}),
|
|
2914
|
+
}), X(t);
|
|
2879
2915
|
}
|
|
2880
2916
|
}, [j, A]);
|
|
2881
2917
|
const W = G(() => {
|
|
2882
|
-
let
|
|
2883
|
-
const l = Object.entries(
|
|
2918
|
+
let H;
|
|
2919
|
+
const l = Object.entries(z).filter(([, o]) => o !== null).map(([o, y]) => ({
|
|
2884
2920
|
actionId: o,
|
|
2885
|
-
reportId:
|
|
2921
|
+
reportId: y
|
|
2886
2922
|
})), t = {
|
|
2887
2923
|
actions: $,
|
|
2888
2924
|
name: O,
|
|
2889
|
-
categories:
|
|
2890
|
-
description:
|
|
2891
|
-
quantumOwned:
|
|
2892
|
-
metadataItemIds:
|
|
2925
|
+
categories: J.filter((o) => o !== "other"),
|
|
2926
|
+
description: N,
|
|
2927
|
+
quantumOwned: m,
|
|
2928
|
+
metadataItemIds: ee,
|
|
2893
2929
|
actionReports: l
|
|
2894
2930
|
};
|
|
2895
|
-
j ?
|
|
2931
|
+
j ? H = v({
|
|
2896
2932
|
id: j.id,
|
|
2897
2933
|
input: t
|
|
2898
|
-
}) :
|
|
2934
|
+
}) : H = d({
|
|
2899
2935
|
input: t
|
|
2900
|
-
}),
|
|
2936
|
+
}), H.then(({ error: o }) => {
|
|
2901
2937
|
o ? h(o instanceof Error ? o : new Error(String(o))) : a();
|
|
2902
2938
|
});
|
|
2903
2939
|
}, [
|
|
2904
|
-
|
|
2905
|
-
|
|
2940
|
+
d,
|
|
2941
|
+
v,
|
|
2906
2942
|
$,
|
|
2907
2943
|
O,
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2944
|
+
N,
|
|
2945
|
+
J,
|
|
2946
|
+
ee,
|
|
2947
|
+
z,
|
|
2912
2948
|
j,
|
|
2913
2949
|
a,
|
|
2914
2950
|
h,
|
|
2915
|
-
|
|
2951
|
+
m
|
|
2916
2952
|
]);
|
|
2917
|
-
return
|
|
2953
|
+
return le(() => {
|
|
2918
2954
|
p && p({
|
|
2919
2955
|
cancelButton: w || c,
|
|
2920
|
-
saveButton: w || c || !O ||
|
|
2956
|
+
saveButton: w || c || !O || N.trim().split(/\s+/).filter(Boolean).length > 40
|
|
2921
2957
|
});
|
|
2922
|
-
}, [p, w, c, $, O,
|
|
2923
|
-
|
|
2958
|
+
}, [p, w, c, $, O, N]), le(() => {
|
|
2959
|
+
u && u({
|
|
2924
2960
|
cancelButton: n,
|
|
2925
2961
|
saveButton: W
|
|
2926
2962
|
});
|
|
2927
|
-
}, [
|
|
2928
|
-
|
|
2963
|
+
}, [u, n, W]), /* @__PURE__ */ e.jsx(te, { width: "100%", children: /* @__PURE__ */ e.jsxs(
|
|
2964
|
+
Xn,
|
|
2929
2965
|
{
|
|
2930
2966
|
isView: s,
|
|
2931
2967
|
metadataKeys: ["activity_type", "session_type", "body_region", "sport"],
|
|
2932
2968
|
children: [
|
|
2933
2969
|
/* @__PURE__ */ e.jsx(
|
|
2934
|
-
|
|
2970
|
+
zn,
|
|
2935
2971
|
{
|
|
2936
2972
|
name: O,
|
|
2937
|
-
setName:
|
|
2938
|
-
actions:
|
|
2973
|
+
setName: R,
|
|
2974
|
+
actions: b,
|
|
2939
2975
|
selectedActionIds: $,
|
|
2940
|
-
setSelectedActionIds:
|
|
2976
|
+
setSelectedActionIds: D,
|
|
2941
2977
|
availableCategories: M ?? [],
|
|
2942
|
-
selectedCategoryIds:
|
|
2978
|
+
selectedCategoryIds: J,
|
|
2943
2979
|
setSelectedCategoryIds: oe,
|
|
2944
|
-
description:
|
|
2945
|
-
setDescription:
|
|
2946
|
-
selectedMetadataIds:
|
|
2980
|
+
description: N,
|
|
2981
|
+
setDescription: V,
|
|
2982
|
+
selectedMetadataIds: ee,
|
|
2947
2983
|
setSelectedMetadataIds: T,
|
|
2948
|
-
actionReportIds:
|
|
2949
|
-
setActionReportIds:
|
|
2984
|
+
actionReportIds: z,
|
|
2985
|
+
setActionReportIds: X
|
|
2950
2986
|
}
|
|
2951
2987
|
),
|
|
2952
|
-
!x && !s && /* @__PURE__ */ e.jsx(re, { justifyContent: "flex-start", children: /* @__PURE__ */ e.jsxs(
|
|
2988
|
+
!x && !s && /* @__PURE__ */ e.jsx(re, { justifyContent: "flex-start", children: /* @__PURE__ */ e.jsxs(Ae, { mt: 16, gap: 4, children: [
|
|
2953
2989
|
/* @__PURE__ */ e.jsx(
|
|
2954
2990
|
se,
|
|
2955
2991
|
{
|
|
@@ -2963,7 +2999,7 @@ const Mn = ({
|
|
|
2963
2999
|
se,
|
|
2964
3000
|
{
|
|
2965
3001
|
colorScheme: "blue",
|
|
2966
|
-
isDisabled: w || c || !O ||
|
|
3002
|
+
isDisabled: w || c || !O || N.trim().split(/\s+/).filter(Boolean).length > 40,
|
|
2967
3003
|
isLoading: w || c,
|
|
2968
3004
|
onClick: W,
|
|
2969
3005
|
children: "Save"
|
|
@@ -2975,12 +3011,12 @@ const Mn = ({
|
|
|
2975
3011
|
) });
|
|
2976
3012
|
};
|
|
2977
3013
|
export {
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
3014
|
+
_n as ActivityList,
|
|
3015
|
+
xs as CopyActivityForm,
|
|
3016
|
+
fs as CopyModuleForm,
|
|
3017
|
+
zn as ModuleForm,
|
|
3018
|
+
Hn as ParameterEditList,
|
|
3019
|
+
jt as ParameterEditSelect,
|
|
3020
|
+
js as UpsertActivityForm,
|
|
3021
|
+
bs as UpsertModuleForm
|
|
2986
3022
|
};
|