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