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