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