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