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