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