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