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