@wandelbots/wandelbots-js-react-components 6.4.0-pr.revamp.667.e1da7d4 → 6.4.0-pr.revamp.667.fa67ce5

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.
Files changed (31) hide show
  1. package/README.md +2 -0
  2. package/dist/3d.cjs +1 -1
  3. package/dist/3d.js +1 -1
  4. package/dist/RobotHeader/index.cjs +1 -1
  5. package/dist/RobotHeader/index.js +1 -1
  6. package/dist/SafetyBar/index.cjs +1 -1
  7. package/dist/SafetyBar/index.js +1 -1
  8. package/dist/chunks/{Robot-BeTWgowU.cjs → Robot-B3vKEVXP.cjs} +1 -1
  9. package/dist/chunks/{Robot-D4XbngYI.js → Robot-DDD382dk.js} +1 -1
  10. package/dist/chunks/{RobotHeader-BZci9ahT.js → RobotHeader-BvIzk8Fw.js} +1 -1
  11. package/dist/chunks/{RobotHeader-CqK0700U.cjs → RobotHeader-Daft80jq.cjs} +1 -1
  12. package/dist/chunks/{SafetyBar-Bbg-o8h9.cjs → SafetyBar-BVk-SH_0.cjs} +1 -1
  13. package/dist/chunks/{SafetyBar-Cuak4ffd.js → SafetyBar-eYzCHOFD.js} +1 -1
  14. package/dist/chunks/TrajectoryExecutionStore-8yxebRg1.cjs +3 -0
  15. package/dist/chunks/{TrajectoryExecutionStore-BNZzZ1Gx.js → TrajectoryExecutionStore-tZgq2ivg.js} +898 -671
  16. package/dist/chunks/converters-BsXgcxCW.cjs +1 -0
  17. package/dist/chunks/{converters-DpNB_WNQ.js → converters-D9KpJ2HD.js} +16 -8
  18. package/dist/core.cjs +1 -1
  19. package/dist/core.d.ts +2 -0
  20. package/dist/core.js +41 -38
  21. package/dist/index.cjs +1 -1
  22. package/dist/index.js +49 -46
  23. package/dist/lib/ControllerStateStream.d.ts +125 -0
  24. package/dist/lib/controllerStateSource.d.ts +37 -0
  25. package/dist/lib/nats/natsControllerStateSource.d.ts +27 -0
  26. package/dist/nats.cjs +1 -0
  27. package/dist/nats.d.ts +4 -0
  28. package/dist/nats.js +131 -0
  29. package/package.json +11 -1
  30. package/dist/chunks/TrajectoryExecutionStore-CYrVePlx.cjs +0 -3
  31. package/dist/chunks/converters-C8I_A_tA.cjs +0 -1
@@ -1,61 +1,62 @@
1
- import { jsxs as y, Fragment as X, jsx as c } from "react/jsx-runtime";
2
- import qt from "@mui/material/AppBar";
3
- import kt from "@mui/material/Backdrop";
4
- import L from "@mui/material/Box";
5
- import Ht from "@mui/material/Menu";
6
- import F from "@mui/material/MenuItem";
7
- import Kt from "@mui/material/Toolbar";
8
- import j from "@mui/material/Typography";
9
- import { ZeroGravityComponentsBackdropFill as Yt } from "@wandelbots/design-tokens";
10
- import { ExpandMoreFilled as Zt } from "@wandelbots/icons/ExpandMoreFilled";
11
- import { RoundedIconButton as Qt } from "@wandelbots/mui";
12
- import { observer as E, useLocalObservable as Rt } from "mobx-react-lite";
13
- import * as v from "react";
14
- import { useState as Y, forwardRef as $, useEffect as tt, useRef as rt, useId as Xt } from "react";
15
- import { e as Z } from "./externalizeComponent-_w2d1_pz.js";
16
- import te from "@mui/icons-material/OpenWith";
17
- import ee from "@mui/icons-material/Share";
18
- import x from "@mui/material/Stack";
19
- import oe from "@mui/material/Tab";
20
- import ie from "@mui/material/Tabs";
21
- import { runInAction as S, makeAutoObservable as at, computed as ne, when as et, autorun as yt, reaction as re } from "mobx";
22
- import { useTranslation as A } from "react-i18next";
23
- import { radiansToDegrees as Ot, tryParseJson as O, XYZ_TO_VECTOR as St, degreesToRadians as ae } from "@wandelbots/nova-js";
24
- import { JointTypeEnum as V } from "@wandelbots/nova-js/v2";
1
+ import { jsxs as y, Fragment as tt, jsx as c } from "react/jsx-runtime";
2
+ import te from "@mui/material/AppBar";
3
+ import Ot from "@mui/material/Backdrop";
4
+ import V from "@mui/material/Box";
5
+ import ee from "@mui/material/Menu";
6
+ import $ from "@mui/material/MenuItem";
7
+ import oe from "@mui/material/Toolbar";
8
+ import I from "@mui/material/Typography";
9
+ import { ZeroGravityComponentsBackdropFill as ie } from "@wandelbots/design-tokens";
10
+ import { ExpandMoreFilled as ne } from "@wandelbots/icons/ExpandMoreFilled";
11
+ import { RoundedIconButton as re } from "@wandelbots/mui";
12
+ import { observer as M, useLocalObservable as Rt } from "mobx-react-lite";
13
+ import * as C from "react";
14
+ import { useState as Y, forwardRef as B, useEffect as et, useRef as st, useId as ae } from "react";
15
+ import { e as Q } from "./externalizeComponent-_w2d1_pz.js";
16
+ import se from "@mui/icons-material/OpenWith";
17
+ import le from "@mui/icons-material/Share";
18
+ import _ from "@mui/material/Stack";
19
+ import ce from "@mui/material/Tab";
20
+ import de from "@mui/material/Tabs";
21
+ import { runInAction as S, makeAutoObservable as Z, computed as Jt, when as ot, autorun as yt, reaction as ge } from "mobx";
22
+ import { useTranslation as P } from "react-i18next";
23
+ import { radiansToDegrees as At, tryParseJson as R, XYZ_TO_VECTOR as St, degreesToRadians as he, makeErrorMessage as ue } from "@wandelbots/nova-js";
24
+ import { JointTypeEnum as D } from "@wandelbots/nova-js/v2";
25
25
  import * as bt from "three";
26
- import { Vector3 as K, Quaternion as se } from "three";
27
- import { d as mt, p as Ct, q as le, c as H, e as lt, P } from "./Pose3-pocKPrHN.js";
28
- import Jt from "@mui/material/CircularProgress";
29
- import { capitalize as ce } from "@mui/material/utils";
30
- import { lowerFirst as de, countBy as ge } from "lodash-es";
31
- import { m as he } from "./SafetyBar-Cuak4ffd.js";
32
- import me from "@mui/material/Alert";
33
- import ue from "@mui/material/AlertTitle";
26
+ import { Vector3 as K, Quaternion as me } from "three";
27
+ import { d as ut, p as vt, q as pe, c as N, e as it, P as A } from "./Pose3-pocKPrHN.js";
28
+ import Pt from "@mui/material/CircularProgress";
29
+ import { capitalize as fe } from "@mui/material/utils";
30
+ import { lowerFirst as ye, countBy as Se } from "lodash-es";
31
+ import { m as be } from "./SafetyBar-eYzCHOFD.js";
32
+ import ve from "@mui/material/Alert";
33
+ import Ce from "@mui/material/AlertTitle";
34
34
  import ct from "@mui/material/Button";
35
- import { useTheme as B, styled as Pt } from "@mui/material/styles";
36
- import N from "@mui/material/Divider";
37
- import vt from "@mui/material/ToggleButton";
38
- import ot from "@mui/material/IconButton";
39
- import { e as xt, v as pe, c as st } from "./joggingColors-CuT5u0H8.js";
40
- import fe from "lodash-es/isEqual.js";
41
- import ye from "@mui/material/InputAdornment";
42
- import Se from "@mui/material/FormControl";
43
- import be from "@mui/material/InputLabel";
44
- import Ce from "@mui/material/Select";
45
- import q from "lodash-es/keyBy.js";
46
- import ve from "lodash-es/uniqueId.js";
47
- import xe from "@mui/material/ToggleButtonGroup";
48
- import At from "@mui/material/Slider";
49
- import _e from "lodash-es/isNumber.js";
50
- import je from "@mui/icons-material/ChevronLeft";
51
- import Ie from "@mui/icons-material/ChevronRight";
52
- import we from "lodash-es/throttle.js";
53
- import Ee from "@mui/material/Dialog";
54
- import Me from "@mui/material/DialogActions";
55
- import Te from "@mui/material/DialogContent";
56
- import ke from "@mui/material/DialogTitle";
57
- const ji = Z(
58
- E((e) => {
35
+ import { useTheme as z, styled as Lt } from "@mui/material/styles";
36
+ import F from "@mui/material/Divider";
37
+ import Ct from "@mui/material/ToggleButton";
38
+ import nt from "@mui/material/IconButton";
39
+ import { e as _t, v as _e, c as lt } from "./joggingColors-CuT5u0H8.js";
40
+ import Dt from "lodash-es/isEqual.js";
41
+ import xe from "@mui/material/InputAdornment";
42
+ import Ie from "@mui/material/FormControl";
43
+ import we from "@mui/material/InputLabel";
44
+ import je from "@mui/material/Select";
45
+ import H from "lodash-es/keyBy.js";
46
+ import Me from "lodash-es/uniqueId.js";
47
+ import Ee from "@mui/material/ToggleButtonGroup";
48
+ import Vt from "@mui/material/Slider";
49
+ import Te from "lodash-es/isNumber.js";
50
+ import ke from "@mui/icons-material/ChevronLeft";
51
+ import Oe from "@mui/icons-material/ChevronRight";
52
+ import Re from "lodash-es/throttle.js";
53
+ import Je from "@mui/material/Dialog";
54
+ import Ae from "@mui/material/DialogActions";
55
+ import Pe from "@mui/material/DialogContent";
56
+ import Le from "@mui/material/DialogTitle";
57
+ import { t as De } from "./converters-D9KpJ2HD.js";
58
+ const Ri = Q(
59
+ M((e) => {
59
60
  const {
60
61
  appIcon: t,
61
62
  appName: o,
@@ -63,16 +64,16 @@ const ji = Z(
63
64
  onAppSelect: n,
64
65
  disabled: r = !1,
65
66
  sx: a
66
- } = e, [s, g] = Y(null), m = !!s, h = (l) => {
67
- g(l.currentTarget);
68
- }, u = () => {
69
- g(null);
70
- }, d = (l) => {
71
- u(), l.onClick ? l.onClick() : l.href && (window.location.href = l.href), n == null || n(l);
67
+ } = e, [s, d] = Y(null), u = !!s, h = (l) => {
68
+ d(l.currentTarget);
69
+ }, m = () => {
70
+ d(null);
71
+ }, g = (l) => {
72
+ m(), l.onClick ? l.onClick() : l.href && (window.location.href = l.href), n == null || n(l);
72
73
  };
73
- return /* @__PURE__ */ y(X, { children: [
74
+ return /* @__PURE__ */ y(tt, { children: [
74
75
  /* @__PURE__ */ c(
75
- qt,
76
+ te,
76
77
  {
77
78
  position: "static",
78
79
  sx: {
@@ -84,14 +85,14 @@ const ji = Z(
84
85
  },
85
86
  ...a
86
87
  },
87
- children: /* @__PURE__ */ y(Kt, { sx: { minHeight: "62px !important" }, children: [
88
- /* @__PURE__ */ c(L, { sx: { mr: 1, display: "flex", alignItems: "center" }, children: t }),
89
- /* @__PURE__ */ y(L, { sx: { display: "flex", alignItems: "center", flexGrow: 1 }, children: [
90
- /* @__PURE__ */ c(j, { component: "h1", variant: "subtitle1", children: o }),
88
+ children: /* @__PURE__ */ y(oe, { sx: { minHeight: "62px !important" }, children: [
89
+ /* @__PURE__ */ c(V, { sx: { mr: 1, display: "flex", alignItems: "center" }, children: t }),
90
+ /* @__PURE__ */ y(V, { sx: { display: "flex", alignItems: "center", flexGrow: 1 }, children: [
91
+ /* @__PURE__ */ c(I, { component: "h1", variant: "subtitle1", children: o }),
91
92
  i.length > 0 && /* @__PURE__ */ c(
92
- Qt,
93
+ re,
93
94
  {
94
- icon: /* @__PURE__ */ c(Zt, { size: 20 }),
95
+ icon: /* @__PURE__ */ c(ne, { size: 20 }),
95
96
  ariaLabel: "switch app",
96
97
  "aria-controls": "app-menu",
97
98
  "aria-haspopup": "true",
@@ -105,24 +106,24 @@ const ji = Z(
105
106
  }
106
107
  ),
107
108
  /* @__PURE__ */ c(
108
- kt,
109
+ Ot,
109
110
  {
110
- open: m,
111
- onClick: u,
111
+ open: u,
112
+ onClick: m,
112
113
  sx: {
113
114
  backdropFilter: "blur(4px)",
114
- backgroundColor: Yt,
115
+ backgroundColor: ie,
115
116
  zIndex: (l) => l.zIndex.modal - 1
116
117
  }
117
118
  }
118
119
  ),
119
120
  /* @__PURE__ */ c(
120
- Ht,
121
+ ee,
121
122
  {
122
123
  id: "app-menu",
123
124
  anchorEl: s,
124
- open: m,
125
- onClose: u,
125
+ open: u,
126
+ onClose: m,
126
127
  anchorOrigin: {
127
128
  vertical: "bottom",
128
129
  horizontal: "left"
@@ -138,24 +139,24 @@ const ji = Z(
138
139
  mt: 1
139
140
  }
140
141
  },
141
- children: i.map((l) => /* @__PURE__ */ y(F, { onClick: () => d(l), children: [
142
- /* @__PURE__ */ c(L, { sx: { display: "flex", alignItems: "center" }, children: l.icon }),
143
- /* @__PURE__ */ c(j, { variant: "body1", sx: { ml: 2 }, children: l.name })
142
+ children: i.map((l) => /* @__PURE__ */ y($, { onClick: () => g(l), children: [
143
+ /* @__PURE__ */ c(V, { sx: { display: "flex", alignItems: "center" }, children: l.icon }),
144
+ /* @__PURE__ */ c(I, { variant: "body1", sx: { ml: 2 }, children: l.name })
144
145
  ] }, l.id))
145
146
  }
146
147
  )
147
148
  ] });
148
149
  })
149
- ), Re = ({
150
+ ), Ve = ({
150
151
  title: e,
151
152
  titleId: t,
152
153
  ...o
153
- }, i) => /* @__PURE__ */ v.createElement("svg", { width: 21, height: 21, viewBox: "0 0 21 21", fill: "none", xmlns: "http://www.w3.org/2000/svg", ref: i, "aria-labelledby": t, ...o }, e ? /* @__PURE__ */ v.createElement("title", { id: t }, e) : null, /* @__PURE__ */ v.createElement("g", { id: "JogMinus" }, /* @__PURE__ */ v.createElement("path", { id: "Minus", d: "M0 13V8H21V13H0Z", fill: "white" }))), Oe = $(Re), Je = ({
154
+ }, i) => /* @__PURE__ */ C.createElement("svg", { width: 21, height: 21, viewBox: "0 0 21 21", fill: "none", xmlns: "http://www.w3.org/2000/svg", ref: i, "aria-labelledby": t, ...o }, e ? /* @__PURE__ */ C.createElement("title", { id: t }, e) : null, /* @__PURE__ */ C.createElement("g", { id: "JogMinus" }, /* @__PURE__ */ C.createElement("path", { id: "Minus", d: "M0 13V8H21V13H0Z", fill: "white" }))), $e = B(Ve), Ne = ({
154
155
  title: e,
155
156
  titleId: t,
156
157
  ...o
157
- }, i) => /* @__PURE__ */ v.createElement("svg", { width: 21, height: 21, viewBox: "0 0 21 21", fill: "none", xmlns: "http://www.w3.org/2000/svg", ref: i, "aria-labelledby": t, ...o }, e ? /* @__PURE__ */ v.createElement("title", { id: t }, e) : null, /* @__PURE__ */ v.createElement("g", { id: "JogPlus" }, /* @__PURE__ */ v.createElement("g", { id: "Plus" }, /* @__PURE__ */ v.createElement("path", { d: "M0 13V8H8V13H0Z", fill: "white" }), /* @__PURE__ */ v.createElement("path", { d: "M8 0L13 2.18557e-07L13 21H8L8 0Z", fill: "white" }), /* @__PURE__ */ v.createElement("path", { d: "M13 13V8H21V13H13Z", fill: "white" })))), Pe = $(Je), _t = Z(
158
- E(
158
+ }, i) => /* @__PURE__ */ C.createElement("svg", { width: 21, height: 21, viewBox: "0 0 21 21", fill: "none", xmlns: "http://www.w3.org/2000/svg", ref: i, "aria-labelledby": t, ...o }, e ? /* @__PURE__ */ C.createElement("title", { id: t }, e) : null, /* @__PURE__ */ C.createElement("g", { id: "JogPlus" }, /* @__PURE__ */ C.createElement("g", { id: "Plus" }, /* @__PURE__ */ C.createElement("path", { d: "M0 13V8H8V13H0Z", fill: "white" }), /* @__PURE__ */ C.createElement("path", { d: "M8 0L13 2.18557e-07L13 21H8L8 0Z", fill: "white" }), /* @__PURE__ */ C.createElement("path", { d: "M13 13V8H21V13H13Z", fill: "white" })))), Fe = B(Ne), xt = Q(
159
+ M(
159
160
  ({
160
161
  colors: e,
161
162
  label: t,
@@ -166,16 +167,16 @@ const ji = Z(
166
167
  activeJoggingDirection: a,
167
168
  ...s
168
169
  }) => {
169
- var M, T, k, _, R, z, U;
170
- mt(() => {
171
- const J = o(), D = d.current;
172
- D && (D.textContent = J);
170
+ var E, T, k, x, O, U, G;
171
+ ut(() => {
172
+ const J = o(), L = g.current;
173
+ L && (L.textContent = J);
173
174
  });
174
- const g = B(), [m, h] = Y(null);
175
- tt(() => {
176
- r && I();
175
+ const d = z(), [u, h] = Y(null);
176
+ et(() => {
177
+ r && w();
177
178
  }, [r]);
178
- const u = a || m, d = rt(null);
179
+ const m = a || u, g = st(null);
179
180
  e || (e = {
180
181
  color: "#fff",
181
182
  backgroundColor: "#000",
@@ -188,7 +189,7 @@ const ji = Z(
188
189
  },
189
190
  labelColor: "#000"
190
191
  });
191
- const l = u ? (M = e.buttonBackgroundColor) == null ? void 0 : M.pressed : e.borderColor, f = {
192
+ const l = m ? (E = e.buttonBackgroundColor) == null ? void 0 : E.pressed : e.borderColor, f = {
192
193
  width: "55px",
193
194
  color: e.color,
194
195
  path: { fill: e.color },
@@ -204,52 +205,52 @@ const ji = Z(
204
205
  backgroundColor: (k = e.buttonBackgroundColor) == null ? void 0 : k.hovered
205
206
  },
206
207
  ":active": {
207
- backgroundColor: (_ = e.buttonBackgroundColor) == null ? void 0 : _.pressed,
208
+ backgroundColor: (x = e.buttonBackgroundColor) == null ? void 0 : x.pressed,
208
209
  color: e.backgroundColor,
209
210
  path: { fill: e.backgroundColor }
210
211
  },
211
212
  ":disabled": {
212
- backgroundColor: (R = e.buttonBackgroundColor) == null ? void 0 : R.disabled,
213
- "svg path": { fill: g.palette.action.disabled }
213
+ backgroundColor: (O = e.buttonBackgroundColor) == null ? void 0 : O.disabled,
214
+ "svg path": { fill: d.palette.action.disabled }
214
215
  }
215
- }, C = {
216
+ }, v = {
216
217
  ...f,
217
- backgroundColor: (z = e.buttonBackgroundColor) == null ? void 0 : z.pressed,
218
+ backgroundColor: (U = e.buttonBackgroundColor) == null ? void 0 : U.pressed,
218
219
  color: e.backgroundColor,
219
220
  path: { fill: e.backgroundColor },
220
221
  ":disabled": {
221
- backgroundColor: (U = e.buttonBackgroundColor) == null ? void 0 : U.pressed,
222
- "svg path": { fill: g.palette.action.disabled }
222
+ backgroundColor: (G = e.buttonBackgroundColor) == null ? void 0 : G.pressed,
223
+ "svg path": { fill: d.palette.action.disabled }
223
224
  }
224
225
  };
225
- function w(J, D) {
226
- r || J.button === 0 && (h(D), i(D));
226
+ function j(J, L) {
227
+ r || J.button === 0 && (h(L), i(L));
227
228
  }
228
- function I() {
229
+ function w() {
229
230
  h(null), n();
230
231
  }
231
- return /* @__PURE__ */ y(x, { height: "64px", direction: "row", justifyContent: "center", ...s, children: [
232
+ return /* @__PURE__ */ y(_, { height: "64px", direction: "row", justifyContent: "center", ...s, children: [
232
233
  /* @__PURE__ */ c(
233
- ot,
234
+ nt,
234
235
  {
235
236
  disabled: r,
236
237
  disableRipple: !0,
237
- onPointerDown: (J) => w(J, "-"),
238
- onPointerUp: I,
239
- onPointerOut: I,
238
+ onPointerDown: (J) => j(J, "-"),
239
+ onPointerUp: w,
240
+ onPointerOut: w,
240
241
  size: "large",
241
242
  sx: {
242
- ...u === "-" ? C : p,
243
+ ...m === "-" ? v : p,
243
244
  borderRadius: "16px 0px 0px 16px",
244
245
  borderLeft: `2px solid ${l ?? "#fff"}`,
245
246
  borderBottom: `2px solid ${l ?? "#fff"}`,
246
247
  borderTop: `2px solid ${l ?? "#fff"}`
247
248
  },
248
- children: /* @__PURE__ */ c(Oe, {})
249
+ children: /* @__PURE__ */ c($e, {})
249
250
  }
250
251
  ),
251
252
  /* @__PURE__ */ y(
252
- x,
253
+ _,
253
254
  {
254
255
  spacing: "6px",
255
256
  sx: {
@@ -263,7 +264,7 @@ const ji = Z(
263
264
  },
264
265
  children: [
265
266
  /* @__PURE__ */ c(
266
- x,
267
+ _,
267
268
  {
268
269
  height: "22px",
269
270
  direction: "row",
@@ -275,26 +276,26 @@ const ji = Z(
275
276
  color: e.color,
276
277
  ".MuiTypography-root": {
277
278
  fontWeight: 700,
278
- ...r ? { color: g.palette.action.disabled } : {}
279
+ ...r ? { color: d.palette.action.disabled } : {}
279
280
  },
280
- ...r ? { "svg path": { fill: g.palette.action.disabled } } : {}
281
+ ...r ? { "svg path": { fill: d.palette.action.disabled } } : {}
281
282
  },
282
283
  children: t
283
284
  }
284
285
  ),
285
286
  /* @__PURE__ */ c(
286
- j,
287
+ I,
287
288
  {
288
289
  height: "22px",
289
290
  sx: {
290
291
  fontSize: "15px",
291
- color: r ? g.palette.action.disabled : e.color,
292
+ color: r ? d.palette.action.disabled : e.color,
292
293
  fontWeight: 700,
293
294
  fontVariantNumeric: "tabular-nums",
294
295
  minWidth: "80px",
295
296
  textAlign: "center"
296
297
  },
297
- ref: d,
298
+ ref: g,
298
299
  children: o()
299
300
  }
300
301
  )
@@ -302,29 +303,29 @@ const ji = Z(
302
303
  }
303
304
  ),
304
305
  /* @__PURE__ */ c(
305
- ot,
306
+ nt,
306
307
  {
307
308
  disableRipple: !0,
308
309
  disabled: r,
309
- onPointerDown: (J) => w(J, "+"),
310
- onPointerUp: I,
311
- onPointerOut: I,
310
+ onPointerDown: (J) => j(J, "+"),
311
+ onPointerUp: w,
312
+ onPointerOut: w,
312
313
  size: "large",
313
314
  sx: {
314
- ...u === "+" ? C : p,
315
+ ...m === "+" ? v : p,
315
316
  borderRadius: "0px 16px 16px 0px",
316
317
  borderRight: `2px solid ${l ?? "#fff"}`,
317
318
  borderBottom: `2px solid ${l ?? "#fff"}`,
318
319
  borderTop: `2px solid ${l ?? "#fff"}`
319
320
  },
320
- children: /* @__PURE__ */ c(Pe, {})
321
+ children: /* @__PURE__ */ c(Fe, {})
321
322
  }
322
323
  )
323
324
  ] });
324
325
  }
325
326
  )
326
- ), Ae = Z(
327
- E(
327
+ ), Be = Q(
328
+ M(
328
329
  ({
329
330
  startJogging: e,
330
331
  stopJogging: t,
@@ -335,10 +336,10 @@ const ji = Z(
335
336
  disabled: a,
336
337
  ...s
337
338
  }) => {
338
- var _, R, z, U, J, D, ft;
339
- const { t: g } = A(), [m, h] = Y(), u = B(), d = {
340
- background: (_ = u.palette.backgroundPaperElevation) == null ? void 0 : _[4],
341
- color: (R = u.palette.backgroundPaperElevation) == null ? void 0 : R[11]
339
+ var x, O, U, G, J, L, ft;
340
+ const { t: d } = P(), [u, h] = Y(), m = z(), g = {
341
+ background: (x = m.palette.backgroundPaperElevation) == null ? void 0 : x[4],
342
+ color: (O = m.palette.backgroundPaperElevation) == null ? void 0 : O[11]
342
343
  }, l = Rt(() => ({
343
344
  activeJoggingDir: null,
344
345
  startJogging(b) {
@@ -347,43 +348,43 @@ const ji = Z(
347
348
  stopJogging() {
348
349
  this.activeJoggingDir = null, t();
349
350
  }
350
- })), f = we(() => {
351
+ })), f = Re(() => {
351
352
  const b = n ? p(r()) : r();
352
- (b === void 0 || m === void 0 || Math.abs(m - b) > 1e-9) && h(b);
353
+ (b === void 0 || u === void 0 || Math.abs(u - b) > 1e-9) && h(b);
353
354
  }, 50);
354
- mt(f);
355
+ ut(f);
355
356
  function p(b) {
356
357
  if (b !== void 0)
357
- return Ot(b);
358
+ return At(b);
358
359
  }
359
- function C(b) {
360
+ function v(b) {
360
361
  b.button === 0 && l.startJogging("-");
361
362
  }
362
- function w(b) {
363
+ function j(b) {
363
364
  b.button === 0 && l.startJogging("+");
364
365
  }
365
- function I(b) {
366
+ function w(b) {
366
367
  l.stopJogging();
367
368
  }
368
- function M(b) {
369
+ function E(b) {
369
370
  l.stopJogging();
370
371
  }
371
- function T(b, G = 1) {
372
+ function T(b, W = 1) {
372
373
  if (b === void 0 || Number.isNaN(b)) return "";
373
- const W = g("General.degree.variable", {
374
- amount: b.toFixed(G)
374
+ const q = d("General.degree.variable", {
375
+ amount: b.toFixed(W)
375
376
  });
376
- return b > 0 && G === 0 ? `+${W}` : W;
377
+ return b > 0 && W === 0 ? `+${q}` : q;
377
378
  }
378
- function k(b, G = 1) {
379
+ function k(b, W = 1) {
379
380
  if (b === void 0 || Number.isNaN(b)) return "";
380
- const W = g("General.mm.variable", {
381
- amount: b.toFixed(G)
381
+ const q = d("General.mm.variable", {
382
+ amount: b.toFixed(W)
382
383
  });
383
- return b > 0 && G === 0 ? `+${W}` : W;
384
+ return b > 0 && W === 0 ? `+${q}` : q;
384
385
  }
385
386
  return /* @__PURE__ */ y(
386
- x,
387
+ _,
387
388
  {
388
389
  height: "64px",
389
390
  width: "100%",
@@ -393,52 +394,52 @@ const ji = Z(
393
394
  sx: {
394
395
  "& .MuiIconButton-root": {
395
396
  width: "52px",
396
- color: u.palette.text.primary,
397
+ color: m.palette.text.primary,
397
398
  alignContent: "center",
398
- backgroundColor: (z = u.palette.backgroundPaperElevation) == null ? void 0 : z[11],
399
+ backgroundColor: (U = m.palette.backgroundPaperElevation) == null ? void 0 : U[11],
399
400
  "& svg": {
400
401
  width: "42px",
401
402
  height: "42px"
402
403
  },
403
404
  "&.Mui-disabled": {
404
- backgroundColor: (U = u.palette.backgroundPaperElevation) == null ? void 0 : U[11],
405
- color: u.palette.action.disabled,
405
+ backgroundColor: (G = m.palette.backgroundPaperElevation) == null ? void 0 : G[11],
406
+ color: m.palette.action.disabled,
406
407
  opacity: 1
407
408
  },
408
409
  "&:hover": {
409
- backgroundColor: (J = u.palette.backgroundPaperElevation) == null ? void 0 : J[9]
410
+ backgroundColor: (J = m.palette.backgroundPaperElevation) == null ? void 0 : J[9]
410
411
  },
411
412
  "&:active": {
412
- ...d
413
+ ...g
413
414
  }
414
415
  }
415
416
  },
416
417
  children: [
417
418
  /* @__PURE__ */ c(
418
- ot,
419
+ nt,
419
420
  {
420
- onPointerDown: C,
421
- onPointerUp: I,
422
- onPointerOut: M,
421
+ onPointerDown: v,
422
+ onPointerUp: w,
423
+ onPointerOut: E,
423
424
  disabled: a,
424
425
  disableRipple: !0,
425
426
  sx: {
426
427
  borderRadius: "16px 0px 0px 16px",
427
- ...l.activeJoggingDir === "-" ? d : {}
428
+ ...l.activeJoggingDir === "-" ? g : {}
428
429
  },
429
430
  children: /* @__PURE__ */ c(
430
- je,
431
+ ke,
431
432
  {
432
433
  sx: {
433
434
  pointerEvents: "none",
434
- color: xt
435
+ color: _t
435
436
  }
436
437
  }
437
438
  )
438
439
  }
439
440
  ),
440
441
  /* @__PURE__ */ y(
441
- x,
442
+ _,
442
443
  {
443
444
  flexGrow: 1,
444
445
  alignItems: "center",
@@ -448,14 +449,14 @@ const ji = Z(
448
449
  borderLeftWidth: 0,
449
450
  borderRightWidth: 0,
450
451
  border: "none",
451
- backgroundColor: (D = u.palette.backgroundPaperElevation) == null ? void 0 : D[11],
452
+ backgroundColor: (L = m.palette.backgroundPaperElevation) == null ? void 0 : L[11],
452
453
  paddingLeft: "20px",
453
454
  paddingRight: "20px",
454
455
  zIndex: 1
455
456
  },
456
457
  children: [
457
458
  /* @__PURE__ */ c(
458
- j,
459
+ I,
459
460
  {
460
461
  sx: {
461
462
  fontSize: "15px",
@@ -465,19 +466,19 @@ const ji = Z(
465
466
  fontVariantNumeric: "tabular-nums",
466
467
  minWidth: "80px",
467
468
  textAlign: "center",
468
- color: a ? u.palette.action.disabled : u.palette.text.primary
469
+ color: a ? m.palette.action.disabled : m.palette.text.primary
469
470
  },
470
- children: n ? T(m) : k(m)
471
+ children: n ? T(u) : k(u)
471
472
  }
472
473
  ),
473
474
  /* @__PURE__ */ c(
474
- At,
475
+ Vt,
475
476
  {
476
477
  disabled: !0,
477
478
  "aria-label": "Joint position",
478
479
  min: n ? p(o) : o,
479
480
  max: n ? p(i) : i,
480
- value: m || 0,
481
+ value: u || 0,
481
482
  track: !1,
482
483
  sx: {
483
484
  "& .MuiSlider-mark": {
@@ -487,15 +488,15 @@ const ji = Z(
487
488
  width: "5px",
488
489
  height: "12px",
489
490
  borderRadius: "2px",
490
- color: a ? u.palette.action.disabled : u.palette.text.primary
491
+ color: a ? m.palette.action.disabled : m.palette.text.primary
491
492
  },
492
493
  "& .MuiSlider-markLabel": {
493
494
  top: "20px",
494
495
  fontSize: "12px",
495
- color: a ? u.palette.action.disabled : u.palette.text.secondary
496
+ color: a ? m.palette.action.disabled : m.palette.text.secondary
496
497
  },
497
498
  "& .MuiSlider-rail": {
498
- backgroundColor: (ft = u.palette.backgroundPaperElevation) == null ? void 0 : ft[5],
499
+ backgroundColor: (ft = m.palette.backgroundPaperElevation) == null ? void 0 : ft[5],
499
500
  opacity: 1
500
501
  }
501
502
  },
@@ -515,23 +516,23 @@ const ji = Z(
515
516
  }
516
517
  ),
517
518
  /* @__PURE__ */ c(
518
- ot,
519
+ nt,
519
520
  {
520
- onPointerDown: w,
521
- onPointerUp: I,
522
- onPointerOut: M,
521
+ onPointerDown: j,
522
+ onPointerUp: w,
523
+ onPointerOut: E,
523
524
  disabled: a,
524
525
  disableRipple: !0,
525
526
  sx: {
526
527
  borderRadius: "0px 16px 16px 0px",
527
- ...l.activeJoggingDir === "+" ? d : {}
528
+ ...l.activeJoggingDir === "+" ? g : {}
528
529
  },
529
530
  children: /* @__PURE__ */ c(
530
- Ie,
531
+ Oe,
531
532
  {
532
533
  sx: {
533
534
  pointerEvents: "none",
534
- color: xt
535
+ color: _t
535
536
  }
536
537
  }
537
538
  )
@@ -543,7 +544,7 @@ const ji = Z(
543
544
  }
544
545
  )
545
546
  );
546
- function De({
547
+ function ze({
547
548
  currentTcpPose: e,
548
549
  axis: t,
549
550
  direction: o,
@@ -557,48 +558,48 @@ function De({
557
558
  throw new Error(
558
559
  "Current pose has no position, cannot perform translation"
559
560
  );
560
- const u = i.distanceMm * a, d = new K();
561
- if (d[t] = u, n) {
561
+ const m = i.distanceMm * a, g = new K();
562
+ if (g[t] = m, n) {
562
563
  if (!e.orientation)
563
564
  throw new Error(
564
565
  "Current pose has no orientation, cannot translate relative to tool"
565
566
  );
566
- d.applyQuaternion(
567
- Ct(
567
+ g.applyQuaternion(
568
+ vt(
568
569
  e.orientation,
569
570
  "ROTATION_VECTOR"
570
571
  )
571
572
  );
572
- } else r && d.applyQuaternion(r);
573
+ } else r && g.applyQuaternion(r);
573
574
  const l = [...e.position];
574
- return l[0] = (l[0] ?? 0) + d.x, l[1] = (l[1] ?? 0) + d.y, l[2] = (l[2] ?? 0) + d.z, {
575
+ return l[0] = (l[0] ?? 0) + g.x, l[1] = (l[1] ?? 0) + g.y, l[2] = (l[2] ?? 0) + g.z, {
575
576
  position: l,
576
577
  orientation: e.orientation
577
578
  };
578
579
  }
579
580
  if (!e.orientation)
580
581
  throw new Error("Current pose has no orientation, cannot perform rotation");
581
- const s = Ct(
582
+ const s = vt(
582
583
  e.orientation,
583
584
  "ROTATION_VECTOR"
584
- ), g = new K();
585
- g[t] = 1, !n && r && g.applyQuaternion(r);
586
- const m = new se().setFromAxisAngle(
587
- g,
585
+ ), d = new K();
586
+ d[t] = 1, !n && r && d.applyQuaternion(r);
587
+ const u = new me().setFromAxisAngle(
588
+ d,
588
589
  i.distanceRads * a
589
- ), h = n ? s.multiply(m) : m.multiply(s);
590
+ ), h = n ? s.multiply(u) : u.multiply(s);
590
591
  return {
591
592
  position: e.position,
592
- orientation: [...le(h)]
593
+ orientation: [...pe(h)]
593
594
  };
594
595
  }
595
- function Ve(e, t, o) {
596
- return t.length !== e.length ? !1 : Vt(e, t, o);
596
+ function $t(e, t, o) {
597
+ return t.length !== e.length ? !1 : Ft(e, t, o);
597
598
  }
598
- function Dt(e, t, o) {
599
- return t.length !== e.length ? !0 : Vt(e, t, o);
599
+ function Nt(e, t, o) {
600
+ return t.length !== e.length ? !0 : Ft(e, t, o);
600
601
  }
601
- function Vt(e, t, o) {
602
+ function Ft(e, t, o) {
602
603
  for (let i = 0; i < t.length; i++)
603
604
  if (Math.abs(
604
605
  (t[i] ?? 0) - (e[i] ?? 0)
@@ -606,7 +607,7 @@ function Vt(e, t, o) {
606
607
  return !1;
607
608
  return !0;
608
609
  }
609
- function Le(e, t, o) {
610
+ function Ue(e, t, o) {
610
611
  if (e === void 0 && t || e && t === void 0 || (e == null ? void 0 : e.orientation) === void 0 || (t == null ? void 0 : t.orientation) === void 0 || (e == null ? void 0 : e.position) === void 0 || (t == null ? void 0 : t.position) === void 0)
611
612
  return !1;
612
613
  if (e === void 0 || t === void 0)
@@ -614,14 +615,14 @@ function Le(e, t, o) {
614
615
  let i = 0;
615
616
  return i += Math.abs(e.orientation[0] - t.orientation[0]), i += Math.abs(e.orientation[1] - t.orientation[1]), i += Math.abs(e.orientation[2] - t.orientation[2]), i += Math.abs(e.position[0] - t.position[0]), i += Math.abs(e.position[1] - t.position[1]), i += Math.abs(e.position[2] - t.position[2]), i <= o;
616
617
  }
617
- function Lt(e, t, o) {
618
- return e.coordinate_system === t.coordinate_system && e.tcp === t.tcp && Le(
618
+ function Bt(e, t, o) {
619
+ return e.coordinate_system === t.coordinate_system && e.tcp === t.tcp && Ue(
619
620
  e.tcp_pose,
620
621
  t.tcp_pose,
621
622
  o
622
623
  );
623
624
  }
624
- function Fe(e, t) {
625
+ function zt(e, t) {
625
626
  const o = new K(
626
627
  t[0],
627
628
  t[1],
@@ -633,50 +634,50 @@ function Fe(e, t) {
633
634
  ), n = o.length(), r = o.normalize();
634
635
  let a = i.length(), s = i.normalize();
635
636
  s.dot(r) < 0 && (a = -a, s = s.multiplyScalar(-1));
636
- let g = a - n;
637
- return g -= 2 * Math.PI * Math.floor((g + Math.PI) / (2 * Math.PI)), a = n + g, [...s.multiplyScalar(a)];
637
+ let d = a - n;
638
+ return d -= 2 * Math.PI * Math.floor((d + Math.PI) / (2 * Math.PI)), a = n + d, [...s.multiplyScalar(a)];
638
639
  }
639
- const Ne = 2e-4;
640
- function $e(e) {
640
+ const Ge = 2e-4;
641
+ function Ut(e) {
641
642
  const { joint_position: t, tcp_pose: o, tcp: i, coordinate_system: n } = e;
642
643
  return { joint_position: t, tcp_pose: o, tcp: i, coordinate_system: n };
643
644
  }
644
- function Be(e, t) {
645
- return e.tcp === t.tcp && e.coordinate_system === t.coordinate_system && e.tcp_pose === void 0 == (t.tcp_pose === void 0) && Ve(
645
+ function Gt(e, t) {
646
+ return e.tcp === t.tcp && e.coordinate_system === t.coordinate_system && e.tcp_pose === void 0 == (t.tcp_pose === void 0) && $t(
646
647
  e.joint_position,
647
648
  t.joint_position,
648
- Ne
649
+ Ge
649
650
  );
650
651
  }
651
- const jt = 1e-4;
652
- class ut {
653
- constructor(t, o, i, n, r, a, s = "cell", g = {}) {
654
- this.controller = o, this.motionGroup = i, this.description = n, this.initialMotionState = r, this.motionStateSocket = a, this.cellId = s, this.nova = H(t), this.logger = g.logger ?? console, this.rapidlyChangingMotionState = r, a.addEventListener("message", (m) => {
652
+ const It = 1e-4;
653
+ class mt {
654
+ constructor(t, o, i, n, r, a, s = "cell", d = {}) {
655
+ this.controller = o, this.motionGroup = i, this.description = n, this.initialMotionState = r, this.motionStateSocket = a, this.cellId = s, this.nova = N(t), this.logger = d.logger ?? console, this.rapidlyChangingMotionState = r, a.addEventListener("message", (u) => {
655
656
  var l;
656
- const h = (l = O(m.data)) == null ? void 0 : l.result;
657
+ const h = (l = R(u.data)) == null ? void 0 : l.result;
657
658
  if (!h)
658
659
  throw new Error(
659
- `Failed to get motion state for ${this.motionGroupId}: ${m.data}`
660
+ `Failed to get motion state for ${this.motionGroupId}: ${u.data}`
660
661
  );
661
- Lt(
662
+ Bt(
662
663
  this.rapidlyChangingMotionState,
663
664
  h,
664
- jt
665
+ It
665
666
  ) || S(() => {
666
- var f, p, C;
667
- this.rapidlyChangingMotionState.tcp_pose == null ? this.rapidlyChangingMotionState.tcp_pose = h.tcp_pose : (f = h.tcp_pose) != null && f.orientation && ((p = h.tcp_pose) != null && p.position) && ((C = this.rapidlyChangingMotionState.tcp_pose) != null && C.orientation) ? this.rapidlyChangingMotionState.tcp_pose = {
667
+ var f, p, v;
668
+ this.rapidlyChangingMotionState.tcp_pose == null ? this.rapidlyChangingMotionState.tcp_pose = h.tcp_pose : (f = h.tcp_pose) != null && f.orientation && ((p = h.tcp_pose) != null && p.position) && ((v = this.rapidlyChangingMotionState.tcp_pose) != null && v.orientation) ? this.rapidlyChangingMotionState.tcp_pose = {
668
669
  position: h.tcp_pose.position,
669
- orientation: Fe(
670
+ orientation: zt(
670
671
  h.tcp_pose.orientation,
671
672
  this.rapidlyChangingMotionState.tcp_pose.orientation
672
673
  )
673
674
  } : this.logger.debug("Received incomplete tcp_pose, ignoring", {
674
675
  tcpPose: h.tcp_pose
675
676
  });
676
- }), Dt(
677
+ }), Nt(
677
678
  this.rapidlyChangingMotionState.joint_position,
678
679
  h.joint_position,
679
- jt
680
+ It
680
681
  ) || S(() => {
681
682
  this.rapidlyChangingMotionState.joint_position = h.joint_position;
682
683
  }), h.tcp !== void 0 && this.rapidlyChangingMotionState.tcp !== h.tcp && S(() => {
@@ -684,55 +685,55 @@ class ut {
684
685
  }), this.rapidlyChangingMotionState.standstill !== h.standstill && S(() => {
685
686
  this.rapidlyChangingMotionState.standstill = h.standstill;
686
687
  });
687
- const u = this.rapidlyChangingMotionState.joint_limit_reached.limit_reached, d = h.joint_limit_reached.limit_reached;
688
- u.some((f, p) => f !== d[p]) && S(() => {
688
+ const m = this.rapidlyChangingMotionState.joint_limit_reached.limit_reached, g = h.joint_limit_reached.limit_reached;
689
+ m.some((f, p) => f !== g[p]) && S(() => {
689
690
  this.rapidlyChangingMotionState.joint_limit_reached = h.joint_limit_reached;
690
691
  }), this.rapidlyChangingMotionState.execute !== h.execute && S(() => {
691
692
  this.rapidlyChangingMotionState.execute = h.execute;
692
693
  });
693
- }), at(this, {
694
+ }), Z(this, {
694
695
  logger: !1,
695
696
  // keepAlive: pose readouts poll it from requestAnimationFrame, which
696
697
  // MobX does not track, and a computed nobody observes is recomputed on
697
698
  // every read without consulting `equals`
698
- readoutState: ne({ equals: Be, keepAlive: !0 })
699
+ readoutState: Jt({ equals: Gt, keepAlive: !0 })
699
700
  });
700
701
  }
701
702
  static async open(t, o, i = {}) {
702
703
  var p;
703
- const n = H(t), r = i.cellId ?? lt(t) ?? "cell", [a, s] = o.split("@"), g = await n.api.controller.getCurrentRobotControllerState(
704
+ const n = N(t), r = i.cellId ?? it(t) ?? "cell", [a, s] = o.split("@"), d = await n.api.controller.getCurrentRobotControllerState(
704
705
  r,
705
706
  s
706
- ), m = g == null ? void 0 : g.motion_groups.find(
707
- (C) => C.motion_group === o
707
+ ), u = d == null ? void 0 : d.motion_groups.find(
708
+ (v) => v.motion_group === o
708
709
  );
709
- if (!g || !m)
710
+ if (!d || !u)
710
711
  throw new Error(
711
712
  `Controller ${s} or motion group ${o} not found`
712
713
  );
713
714
  const h = n.openReconnectingWebsocket(
714
715
  `/cells/${r}/controllers/${s}/motion-groups/${o}/state-stream`
715
- ), u = await h.firstMessage(), d = (p = O(u.data)) == null ? void 0 : p.result;
716
- if (!d)
716
+ ), m = await h.firstMessage(), g = (p = R(m.data)) == null ? void 0 : p.result;
717
+ if (!g)
717
718
  throw new Error(
718
- `Unable to parse initial motion state message ${u.data}`
719
+ `Unable to parse initial motion state message ${m.data}`
719
720
  );
720
721
  const l = i.logger ?? console;
721
722
  l.info("Connected motion state websocket to motion group", {
722
- motionGroup: m.motion_group,
723
- initialMotionState: d
723
+ motionGroup: u.motion_group,
724
+ initialMotionState: g
724
725
  });
725
726
  const f = await n.api.motionGroup.getMotionGroupDescription(
726
727
  r,
727
728
  s,
728
- m.motion_group
729
+ u.motion_group
729
730
  );
730
- return new ut(
731
+ return new mt(
731
732
  n,
732
- g,
733
- m,
734
- f,
735
733
  d,
734
+ u,
735
+ f,
736
+ g,
736
737
  h,
737
738
  r,
738
739
  { logger: l }
@@ -744,7 +745,7 @@ class ut {
744
745
  * also holds for untracked reads, e.g. from requestAnimationFrame.
745
746
  */
746
747
  get readoutState() {
747
- return $e(this.rapidlyChangingMotionState);
748
+ return Ut(this.rapidlyChangingMotionState);
748
749
  }
749
750
  get motionGroupId() {
750
751
  return this.motionGroup.motion_group;
@@ -761,10 +762,10 @@ class ut {
761
762
  this.motionStateSocket.close();
762
763
  }
763
764
  }
764
- const It = "Movement request rejected. Another client is currently executing a 'Jogging' motion!", ze = 500, Ue = 5e3;
765
- function Ge(e) {
765
+ const wt = "Movement request rejected. Another client is currently executing a 'Jogging' motion!", We = 500, qe = 5e3;
766
+ function He(e) {
766
767
  var o;
767
- return (((o = e.times) == null ? void 0 : o[e.times.length - 1]) ?? 0) * 2e3 + Ue;
768
+ return (((o = e.times) == null ? void 0 : o[e.times.length - 1]) ?? 0) * 2e3 + qe;
768
769
  }
769
770
  class pt {
770
771
  constructor(t, o = {}) {
@@ -791,7 +792,7 @@ class pt {
791
792
  * `dispose()` also closes the motion stream that this function opens.
792
793
  */
793
794
  static async open(t, o, i = {}) {
794
- const n = await ut.open(
795
+ const n = await mt.open(
795
796
  t,
796
797
  o,
797
798
  {
@@ -810,7 +811,7 @@ class pt {
810
811
  getDefaultTcp(t) {
811
812
  var i, n;
812
813
  const o = (n = (i = t.description.dh_parameters) == null ? void 0 : i[0]) == null ? void 0 : n.type;
813
- return t.joints.length < 6 && (o === V.RevoluteJoint || o === V.PrismaticJoint) ? this.NO_TCP : this.DEFAULT_TCP;
814
+ return t.joints.length < 6 && (o === D.RevoluteJoint || o === D.PrismaticJoint) ? this.NO_TCP : this.DEFAULT_TCP;
814
815
  }
815
816
  // Set a new tcp or other options. If current mode is jogging, will reinitialize the jogging websocket
816
817
  async setOptions(t) {
@@ -898,23 +899,23 @@ class pt {
898
899
  a(
899
900
  new Error(`Jogging initialization timeout after ${this.timeout} ms`)
900
901
  );
901
- }, this.timeout), a = (m) => {
902
- n || (n = !0, clearTimeout(r), i.removeEventListener("close", g), this.endJoggingInit === s && (this.endJoggingInit = void 0), m ? o(m) : t());
903
- }, s = () => a(), g = () => {
902
+ }, this.timeout), a = (u) => {
903
+ n || (n = !0, clearTimeout(r), i.removeEventListener("close", d), this.endJoggingInit === s && (this.endJoggingInit = void 0), u ? o(u) : t());
904
+ }, s = () => a(), d = () => {
904
905
  i.disposed && a();
905
906
  };
906
- this.endJoggingInit = s, i.addEventListener("close", g), i.addEventListener("message", (m) => {
907
- var u, d, l;
908
- const h = O(m.data);
909
- if (((u = h == null ? void 0 : h.result) == null ? void 0 : u.kind) === "INITIALIZE_RECEIVED") {
907
+ this.endJoggingInit = s, i.addEventListener("close", d), i.addEventListener("message", (u) => {
908
+ var m, g, l;
909
+ const h = R(u.data);
910
+ if (((m = h == null ? void 0 : h.result) == null ? void 0 : m.kind) === "INITIALIZE_RECEIVED") {
910
911
  a();
911
912
  return;
912
913
  }
913
- if (((d = h == null ? void 0 : h.result) == null ? void 0 : d.kind) === "MOTION_ERROR")
914
- if (this.onBlocked && ((l = h == null ? void 0 : h.result) != null && l.message.includes(It))) {
914
+ if (((g = h == null ? void 0 : h.result) == null ? void 0 : g.kind) === "MOTION_ERROR")
915
+ if (this.onBlocked && ((l = h == null ? void 0 : h.result) != null && l.message.includes(wt))) {
915
916
  a(), i.dispose(), this.onBlocked();
916
917
  return;
917
- } else this.onError ? (a(), this.onError(m.data)) : a(new Error(m.data));
918
+ } else this.onError ? (a(), this.onError(u.data)) : a(new Error(u.data));
918
919
  }), i.sendJson({
919
920
  message_type: "InitializeJoggingRequest",
920
921
  motion_group: this.motionGroupId,
@@ -992,7 +993,7 @@ class pt {
992
993
  */
993
994
  get coordinateSystemRotation() {
994
995
  if (!(this.orientation === "tool" || !this.coordinateSystem))
995
- return P.fromCoordinateSystem(this.coordinateSystem).quaternion;
996
+ return A.fromCoordinateSystem(this.coordinateSystem).quaternion;
996
997
  }
997
998
  /**
998
999
  * Velocity vector along one axis of the jogging frame. The API takes TCP
@@ -1049,8 +1050,8 @@ class pt {
1049
1050
  direction: r,
1050
1051
  motion: a
1051
1052
  }) {
1052
- var p, C, w;
1053
- const s = [], g = De({
1053
+ var p, v, j;
1054
+ const s = [], d = ze({
1054
1055
  currentTcpPose: t,
1055
1056
  axis: n,
1056
1057
  direction: r,
@@ -1063,29 +1064,29 @@ class pt {
1063
1064
  path: {
1064
1065
  path_definition_name: "PathLine",
1065
1066
  target_pose: {
1066
- position: g.position,
1067
- orientation: g.orientation
1067
+ position: d.position,
1068
+ orientation: d.orientation
1068
1069
  }
1069
1070
  }
1070
1071
  });
1071
- const m = this.motionStream.description;
1072
- if (m.cycle_time === void 0) {
1072
+ const u = this.motionStream.description;
1073
+ if (u.cycle_time === void 0) {
1073
1074
  this.logger.warn(
1074
1075
  "Current motion group has no cycle time, cannot plan jogging motion"
1075
1076
  );
1076
1077
  return;
1077
1078
  }
1078
- const h = this.motionStream.rapidlyChangingMotionState.tcp, u = h ? (C = (p = m.tcps) == null ? void 0 : p[h]) == null ? void 0 : C.pose : void 0, d = {
1079
- motion_group_model: ((w = this.options) == null ? void 0 : w.motionGroupModel) ?? m.motion_group_model,
1080
- cycle_time: m.cycle_time,
1081
- mounting: m.mounting,
1082
- tcp_offset: u,
1079
+ const h = this.motionStream.rapidlyChangingMotionState.tcp, m = h ? (v = (p = u.tcps) == null ? void 0 : p[h]) == null ? void 0 : v.pose : void 0, g = {
1080
+ motion_group_model: ((j = this.options) == null ? void 0 : j.motionGroupModel) ?? u.motion_group_model,
1081
+ cycle_time: u.cycle_time,
1082
+ mounting: u.mounting,
1083
+ tcp_offset: m,
1083
1084
  // FIXME use proper mode's limits if set
1084
- global: m.operation_limits.auto_limits
1085
+ global: u.operation_limits.auto_limits
1085
1086
  }, l = await this.nova.api.trajectoryPlanning.planTrajectory(
1086
1087
  this.cellId,
1087
1088
  {
1088
- motion_group_setup: d,
1089
+ motion_group_setup: g,
1089
1090
  start_joint_position: o,
1090
1091
  motion_commands: s
1091
1092
  }
@@ -1125,41 +1126,41 @@ class pt {
1125
1126
  let n, r;
1126
1127
  try {
1127
1128
  await new Promise((a, s) => {
1128
- let g = !1;
1129
- const m = () => {
1130
- g || (g = !0, a());
1131
- }, h = (d) => {
1132
- if (!g) {
1133
- if (g = !0, this.onError) {
1134
- this.onError(d), a();
1129
+ let d = !1;
1130
+ const u = () => {
1131
+ d || (d = !0, a());
1132
+ }, h = (g) => {
1133
+ if (!d) {
1134
+ if (d = !0, this.onError) {
1135
+ this.onError(g), a();
1135
1136
  return;
1136
1137
  }
1137
1138
  s(
1138
- d instanceof Error ? d : new Error(
1139
- `Failed to execute trajectory: ${JSON.stringify(d)}`
1139
+ g instanceof Error ? g : new Error(
1140
+ `Failed to execute trajectory: ${JSON.stringify(g)}`
1140
1141
  )
1141
1142
  );
1142
1143
  }
1143
1144
  };
1144
- r = m, this.endIncrementalMotion = m;
1145
- const u = Ge(t);
1145
+ r = u, this.endIncrementalMotion = u;
1146
+ const m = He(t);
1146
1147
  n = setTimeout(() => {
1147
1148
  h(
1148
- new Error(`Jogging motion did not complete within ${u}ms`)
1149
+ new Error(`Jogging motion did not complete within ${m}ms`)
1149
1150
  );
1150
- }, u), o.addEventListener("message", (d) => {
1151
+ }, m), o.addEventListener("message", (g) => {
1151
1152
  var f, p;
1152
- const l = (f = O(d.data)) == null ? void 0 : f.result;
1153
+ const l = (f = R(g.data)) == null ? void 0 : f.result;
1153
1154
  if (!(l != null && l.kind)) {
1154
1155
  h(
1155
1156
  new Error(
1156
- `Failed to execute trajectory: Received invalid message ${d.data}`
1157
+ `Failed to execute trajectory: Received invalid message ${g.data}`
1157
1158
  )
1158
1159
  );
1159
1160
  return;
1160
1161
  }
1161
- if (this.onBlocked && ((p = l.message) != null && p.includes(It))) {
1162
- this.onBlocked(), m();
1162
+ if (this.onBlocked && ((p = l.message) != null && p.includes(wt))) {
1163
+ this.onBlocked(), u();
1163
1164
  return;
1164
1165
  }
1165
1166
  if (l.kind === "INITIALIZE_RECEIVED") {
@@ -1176,7 +1177,7 @@ class pt {
1176
1177
  h(l);
1177
1178
  return;
1178
1179
  }
1179
- this.waitForMotionToFinish(i.signal).then(m, h);
1180
+ this.waitForMotionToFinish(i.signal).then(u, h);
1180
1181
  } else l.kind === "PAUSE_RECEIVED" || (l.kind === "MOTION_ERROR" && l.message ? h(l) : h(
1181
1182
  new Error(
1182
1183
  `Failed to execute trajectory, cannot handle message type "${l.kind}"`
@@ -1207,22 +1208,22 @@ class pt {
1207
1208
  */
1208
1209
  async waitForMotionToFinish(t) {
1209
1210
  const o = () => this.motionStream.rapidlyChangingMotionState.standstill;
1210
- await et(() => !o(), {
1211
- timeout: ze,
1211
+ await ot(() => !o(), {
1212
+ timeout: We,
1212
1213
  signal: t
1213
1214
  }).catch(() => {
1214
- }), await et(o, { signal: t });
1215
+ }), await ot(o, { signal: t });
1215
1216
  }
1216
1217
  }
1217
- const We = (e) => {
1218
+ const Ke = (e) => {
1218
1219
  const t = e.softTimeout || 3e3, [o, i] = Y(!1);
1219
- return tt(() => {
1220
+ return et(() => {
1220
1221
  const n = setTimeout(() => {
1221
1222
  i(!0);
1222
1223
  }, t);
1223
1224
  return () => clearTimeout(n);
1224
1225
  }), /* @__PURE__ */ c(
1225
- x,
1226
+ _,
1226
1227
  {
1227
1228
  width: "100%",
1228
1229
  height: "100%",
@@ -1230,16 +1231,16 @@ const We = (e) => {
1230
1231
  justifyContent: "center",
1231
1232
  sx: { color: "text.primary" },
1232
1233
  children: e.error ? /* @__PURE__ */ c(
1233
- qe,
1234
+ Ye,
1234
1235
  {
1235
1236
  loadingMessage: e.message,
1236
1237
  error: e.error
1237
1238
  }
1238
- ) : /* @__PURE__ */ y(X, { children: [
1239
- /* @__PURE__ */ c(Jt, { sx: { mb: 3 } }),
1240
- !!e.message && /* @__PURE__ */ c(j, { variant: "body1", children: e.message }),
1239
+ ) : /* @__PURE__ */ y(tt, { children: [
1240
+ /* @__PURE__ */ c(Pt, { sx: { mb: 3 } }),
1241
+ !!e.message && /* @__PURE__ */ c(I, { variant: "body1", children: e.message }),
1241
1242
  /* @__PURE__ */ c(
1242
- j,
1243
+ I,
1243
1244
  {
1244
1245
  variant: "body2",
1245
1246
  sx: {
@@ -1253,10 +1254,10 @@ const We = (e) => {
1253
1254
  ] })
1254
1255
  }
1255
1256
  );
1256
- }, qe = (e) => {
1257
- const t = he(e.error), o = e.error instanceof Error ? e.error.stack : null;
1257
+ }, Ye = (e) => {
1258
+ const t = be(e.error), o = e.error instanceof Error ? e.error.stack : null;
1258
1259
  return /* @__PURE__ */ y(
1259
- x,
1260
+ _,
1260
1261
  {
1261
1262
  sx: {
1262
1263
  maxHeight: "100%",
@@ -1266,9 +1267,9 @@ const We = (e) => {
1266
1267
  color: "error.main"
1267
1268
  },
1268
1269
  children: [
1269
- /* @__PURE__ */ c(j, { variant: "body1", children: (e.loadingMessage ? `Error while ${de(ce(e.loadingMessage))} - ` : "") + t }),
1270
+ /* @__PURE__ */ c(I, { variant: "body1", children: (e.loadingMessage ? `Error while ${ye(fe(e.loadingMessage))} - ` : "") + t }),
1270
1271
  o && /* @__PURE__ */ c(
1271
- L,
1272
+ V,
1272
1273
  {
1273
1274
  component: "pre",
1274
1275
  sx: {
@@ -1285,10 +1286,10 @@ const We = (e) => {
1285
1286
  ]
1286
1287
  }
1287
1288
  );
1288
- }, He = E(({ store: e }) => {
1289
- const { t } = A();
1289
+ }, Qe = M(({ store: e }) => {
1290
+ const { t } = P();
1290
1291
  return /* @__PURE__ */ c(
1291
- kt,
1292
+ Ot,
1292
1293
  {
1293
1294
  "data-testid": "jogging-blocked",
1294
1295
  "aria-label": "jogging-blocked",
@@ -1301,9 +1302,9 @@ const We = (e) => {
1301
1302
  justifyContent: "flex-start",
1302
1303
  alignItems: "flex-start"
1303
1304
  },
1304
- children: /* @__PURE__ */ y(x, { sx: { m: 2, width: "100%" }, children: [
1305
- /* @__PURE__ */ y(me, { severity: "error", sx: { mb: 2 }, children: [
1306
- /* @__PURE__ */ c(ue, { children: t("Jogging.Blocked.ti") }),
1305
+ children: /* @__PURE__ */ y(_, { sx: { m: 2, width: "100%" }, children: [
1306
+ /* @__PURE__ */ y(ve, { severity: "error", sx: { mb: 2 }, children: [
1307
+ /* @__PURE__ */ c(Ce, { children: t("Jogging.Blocked.ti") }),
1307
1308
  t("Jogging.Blocked.lb")
1308
1309
  ] }),
1309
1310
  /* @__PURE__ */ c(
@@ -1318,36 +1319,36 @@ const We = (e) => {
1318
1319
  ] })
1319
1320
  }
1320
1321
  );
1321
- }), Ke = ({
1322
+ }), Ze = ({
1322
1323
  title: e,
1323
1324
  titleId: t,
1324
1325
  ...o
1325
- }, i) => /* @__PURE__ */ v.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 19, height: 10, fill: "none", ref: i, "aria-labelledby": t, ...o }, e ? /* @__PURE__ */ v.createElement("title", { id: t }, e) : null, /* @__PURE__ */ v.createElement("path", { fill: "#fff", fillRule: "evenodd", d: "M5.131.312a.9.9 0 0 1 0 1.272L3.07 3.645h12.44l-2.06-2.061A.9.9 0 0 1 14.72.313l3.596 3.596a.9.9 0 0 1 0 1.271l-3.596 3.597a.9.9 0 0 1-1.271-1.272l2.061-2.062H3.07L5.13 7.505A.9.9 0 0 1 3.86 8.777L.263 5.18a.9.9 0 0 1 0-1.271L3.86.312a.9.9 0 0 1 1.271 0", clipRule: "evenodd" })), Ye = $(Ke), Ze = ({
1326
+ }, i) => /* @__PURE__ */ C.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 19, height: 10, fill: "none", ref: i, "aria-labelledby": t, ...o }, e ? /* @__PURE__ */ C.createElement("title", { id: t }, e) : null, /* @__PURE__ */ C.createElement("path", { fill: "#fff", fillRule: "evenodd", d: "M5.131.312a.9.9 0 0 1 0 1.272L3.07 3.645h12.44l-2.06-2.061A.9.9 0 0 1 14.72.313l3.596 3.596a.9.9 0 0 1 0 1.271l-3.596 3.597a.9.9 0 0 1-1.271-1.272l2.061-2.062H3.07L5.13 7.505A.9.9 0 0 1 3.86 8.777L.263 5.18a.9.9 0 0 1 0-1.271L3.86.312a.9.9 0 0 1 1.271 0", clipRule: "evenodd" })), Xe = B(Ze), to = ({
1326
1327
  title: e,
1327
1328
  titleId: t,
1328
1329
  ...o
1329
- }, i) => /* @__PURE__ */ v.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 19, height: 10, fill: "none", ref: i, "aria-labelledby": t, ...o }, e ? /* @__PURE__ */ v.createElement("title", { id: t }, e) : null, /* @__PURE__ */ v.createElement("path", { fill: "#fff", fillRule: "evenodd", d: "M5.131.312a.9.9 0 0 1 0 1.272L3.07 3.645h12.44l-2.06-2.061A.9.9 0 0 1 14.72.313l3.596 3.596a.9.9 0 0 1 0 1.271l-3.596 3.597a.9.9 0 0 1-1.271-1.272l2.061-2.062H3.07L5.13 7.505A.9.9 0 0 1 3.86 8.777L.263 5.18a.9.9 0 0 1 0-1.271L3.86.312a.9.9 0 0 1 1.271 0", clipRule: "evenodd" })), Qe = $(Ze), Xe = ({
1330
+ }, i) => /* @__PURE__ */ C.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 19, height: 10, fill: "none", ref: i, "aria-labelledby": t, ...o }, e ? /* @__PURE__ */ C.createElement("title", { id: t }, e) : null, /* @__PURE__ */ C.createElement("path", { fill: "#fff", fillRule: "evenodd", d: "M5.131.312a.9.9 0 0 1 0 1.272L3.07 3.645h12.44l-2.06-2.061A.9.9 0 0 1 14.72.313l3.596 3.596a.9.9 0 0 1 0 1.271l-3.596 3.597a.9.9 0 0 1-1.271-1.272l2.061-2.062H3.07L5.13 7.505A.9.9 0 0 1 3.86 8.777L.263 5.18a.9.9 0 0 1 0-1.271L3.86.312a.9.9 0 0 1 1.271 0", clipRule: "evenodd" })), eo = B(to), oo = ({
1330
1331
  title: e,
1331
1332
  titleId: t,
1332
1333
  ...o
1333
- }, i) => /* @__PURE__ */ v.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 10, height: 19, fill: "none", ref: i, "aria-labelledby": t, ...o }, e ? /* @__PURE__ */ v.createElement("title", { id: t }, e) : null, /* @__PURE__ */ v.createElement("path", { fill: "#fff", fillRule: "evenodd", d: "M9.522 14.811A.899.899 0 1 0 8.25 13.54L6.19 15.601V3.16L8.25 5.221A.9.9 0 0 0 9.522 3.95L5.926.354a.9.9 0 0 0-1.272 0L1.058 3.95a.9.9 0 1 0 1.271 1.271L4.391 3.16v12.442L2.329 13.54a.899.899 0 1 0-1.271 1.271l3.596 3.597a.9.9 0 0 0 1.272 0z", clipRule: "evenodd" })), to = $(Xe), eo = ({
1334
+ }, i) => /* @__PURE__ */ C.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 10, height: 19, fill: "none", ref: i, "aria-labelledby": t, ...o }, e ? /* @__PURE__ */ C.createElement("title", { id: t }, e) : null, /* @__PURE__ */ C.createElement("path", { fill: "#fff", fillRule: "evenodd", d: "M9.522 14.811A.899.899 0 1 0 8.25 13.54L6.19 15.601V3.16L8.25 5.221A.9.9 0 0 0 9.522 3.95L5.926.354a.9.9 0 0 0-1.272 0L1.058 3.95a.9.9 0 1 0 1.271 1.271L4.391 3.16v12.442L2.329 13.54a.899.899 0 1 0-1.271 1.271l3.596 3.597a.9.9 0 0 0 1.272 0z", clipRule: "evenodd" })), io = B(oo), no = ({
1334
1335
  title: e,
1335
1336
  titleId: t,
1336
1337
  ...o
1337
- }, i) => /* @__PURE__ */ v.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ref: i, "aria-labelledby": t, ...o }, e ? /* @__PURE__ */ v.createElement("title", { id: t }, e) : null, /* @__PURE__ */ v.createElement("path", { d: "M8 16C5.76667 16 3.875 15.225 2.325 13.675C0.775 12.125 0 10.2333 0 8C0 5.76667 0.775 3.875 2.325 2.325C3.875 0.775 5.76667 0 8 0C9.15 0 10.25 0.2375 11.3 0.7125C12.35 1.1875 13.25 1.86667 14 2.75V0H16V7H9V5H13.2C12.6667 4.06667 11.9375 3.33333 11.0125 2.8C10.0875 2.26667 9.08333 2 8 2C6.33333 2 4.91667 2.58333 3.75 3.75C2.58333 4.91667 2 6.33333 2 8C2 9.66667 2.58333 11.0833 3.75 12.25C4.91667 13.4167 6.33333 14 8 14C9.28333 14 10.4417 13.6333 11.475 12.9C11.0583 14.1 12.5083 12.1667 11.475 12.9L12.9 14.325C11.4667 15.4417 9.83333 16 8 16Z", fill: "white" })), oo = $(eo), Ft = E(
1338
+ }, i) => /* @__PURE__ */ C.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ref: i, "aria-labelledby": t, ...o }, e ? /* @__PURE__ */ C.createElement("title", { id: t }, e) : null, /* @__PURE__ */ C.createElement("path", { d: "M8 16C5.76667 16 3.875 15.225 2.325 13.675C0.775 12.125 0 10.2333 0 8C0 5.76667 0.775 3.875 2.325 2.325C3.875 0.775 5.76667 0 8 0C9.15 0 10.25 0.2375 11.3 0.7125C12.35 1.1875 13.25 1.86667 14 2.75V0H16V7H9V5H13.2C12.6667 4.06667 11.9375 3.33333 11.0125 2.8C10.0875 2.26667 9.08333 2 8 2C6.33333 2 4.91667 2.58333 3.75 3.75C2.58333 4.91667 2 6.33333 2 8C2 9.66667 2.58333 11.0833 3.75 12.25C4.91667 13.4167 6.33333 14 8 14C9.28333 14 10.4417 13.6333 11.475 12.9C11.0583 14.1 12.5083 12.1667 11.475 12.9L12.9 14.325C11.4667 15.4417 9.83333 16 8 16Z", fill: "white" })), ro = B(no), Wt = M(
1338
1339
  ({ store: e }) => {
1339
- const { t } = A(), [o, i] = Y(
1340
+ const { t } = P(), [o, i] = Y(
1340
1341
  e.jogger.motionStream.rapidlyChangingMotionState.joint_limit_reached.limit_reached
1341
- ), n = rt(o);
1342
- mt(() => {
1342
+ ), n = st(o);
1343
+ ut(() => {
1343
1344
  const a = e.jogger.motionStream.rapidlyChangingMotionState.joint_limit_reached.limit_reached;
1344
- fe(n.current, a) || (n.current = a, i(a));
1345
+ Dt(n.current, a) || (n.current = a, i(a));
1345
1346
  });
1346
1347
  const r = [];
1347
1348
  for (const [a, s] of o.entries())
1348
1349
  s && r.push(a);
1349
1350
  return /* @__PURE__ */ c(
1350
- L,
1351
+ V,
1351
1352
  {
1352
1353
  sx: {
1353
1354
  display: "flex",
@@ -1355,7 +1356,7 @@ const We = (e) => {
1355
1356
  justifyContent: "center"
1356
1357
  },
1357
1358
  children: /* @__PURE__ */ c(
1358
- j,
1359
+ I,
1359
1360
  {
1360
1361
  "data-testid": "jogging-joint-limit-detector",
1361
1362
  "aria-label": "jogging-joint-limit-detector",
@@ -1374,7 +1375,7 @@ const We = (e) => {
1374
1375
  }
1375
1376
  );
1376
1377
  }
1377
- ), io = Pt(Se)(({ theme: e }) => ({
1378
+ ), ao = Lt(Ie)(({ theme: e }) => ({
1378
1379
  "&.MuiFormControl-root": {
1379
1380
  ".MuiSelect-select": {
1380
1381
  paddingTop: "20px",
@@ -1391,35 +1392,35 @@ const We = (e) => {
1391
1392
  }
1392
1393
  }
1393
1394
  }));
1394
- function Q({
1395
+ function X({
1395
1396
  labelValue: e,
1396
1397
  ...t
1397
1398
  }) {
1398
- return /* @__PURE__ */ y(io, { fullWidth: !0, variant: "filled", children: [
1399
- /* @__PURE__ */ c(be, { id: t.labelId, children: e }),
1400
- /* @__PURE__ */ c(Ce, { ...t })
1399
+ return /* @__PURE__ */ y(ao, { fullWidth: !0, variant: "filled", children: [
1400
+ /* @__PURE__ */ c(we, { id: t.labelId, children: e }),
1401
+ /* @__PURE__ */ c(je, { ...t })
1401
1402
  ] });
1402
1403
  }
1403
- function wt(e) {
1404
+ function jt(e) {
1404
1405
  const t = e.lastIndexOf("On");
1405
1406
  return t > 0 ? e.slice(0, t) : e;
1406
1407
  }
1407
- function Nt(e, t) {
1408
+ function qt(e, t) {
1408
1409
  const o = e[t];
1409
1410
  if (o)
1410
1411
  return o;
1411
- const i = wt(t), n = e[i];
1412
+ const i = jt(t), n = e[i];
1412
1413
  if (n)
1413
1414
  return n;
1414
1415
  const r = Object.keys(e).filter(
1415
- (s) => wt(s) === i
1416
+ (s) => jt(s) === i
1416
1417
  );
1417
1418
  if (r.length !== 1)
1418
1419
  return;
1419
1420
  const a = r[0];
1420
1421
  return a ? e[a] : void 0;
1421
1422
  }
1422
- const no = {
1423
+ const so = {
1423
1424
  coordinate_system: "world",
1424
1425
  name: "world",
1425
1426
  reference_coordinate_system: "",
@@ -1427,33 +1428,33 @@ const no = {
1427
1428
  orientation: [0, 0, 0],
1428
1429
  orientation_type: "ROTATION_VECTOR"
1429
1430
  };
1430
- function $t(e) {
1431
- const t = q(
1431
+ function Ht(e) {
1432
+ const t = H(
1432
1433
  e.map((n) => ({
1433
1434
  ...n,
1434
1435
  coordinate_system: n.coordinate_system || "world"
1435
1436
  })),
1436
1437
  "coordinate_system"
1437
1438
  );
1438
- t.world ?? (t.world = no);
1439
+ t.world ?? (t.world = so);
1439
1440
  const o = {}, i = (n) => {
1440
1441
  const r = o[n];
1441
1442
  if (r)
1442
1443
  return r;
1443
- const a = Nt(t, n);
1444
+ const a = qt(t, n);
1444
1445
  if (!a)
1445
1446
  throw new Error(
1446
1447
  `Unknown coordinate system ${n}. Known coordinate systems are: ${Object.keys(t).join(", ")}`
1447
1448
  );
1448
1449
  const s = a.reference_coordinate_system || "world";
1449
- let g;
1450
+ let d;
1450
1451
  if (s === "world")
1451
- g = a;
1452
+ d = a;
1452
1453
  else {
1453
- const m = i(s), h = P.fromCoordinateSystem(m).multiply(
1454
- P.fromCoordinateSystem(a)
1454
+ const u = i(s), h = A.fromCoordinateSystem(u).multiply(
1455
+ A.fromCoordinateSystem(a)
1455
1456
  );
1456
- g = {
1457
+ d = {
1457
1458
  ...a,
1458
1459
  position: [
1459
1460
  h.position.x,
@@ -1466,10 +1467,10 @@ function $t(e) {
1466
1467
  h.orientation.z
1467
1468
  ],
1468
1469
  orientation_type: "ROTATION_VECTOR",
1469
- reference_coordinate_system: m.reference_coordinate_system
1470
+ reference_coordinate_system: u.reference_coordinate_system
1470
1471
  };
1471
1472
  }
1472
- return o[n] = g, g;
1473
+ return o[n] = d, d;
1473
1474
  };
1474
1475
  return Object.fromEntries(
1475
1476
  Object.keys(t).map((n) => [
@@ -1479,7 +1480,7 @@ function $t(e) {
1479
1480
  );
1480
1481
  }
1481
1482
  function dt(e, t) {
1482
- const o = Nt(
1483
+ const o = qt(
1483
1484
  e,
1484
1485
  t || "world"
1485
1486
  );
@@ -1489,16 +1490,16 @@ function dt(e, t) {
1489
1490
  );
1490
1491
  return o;
1491
1492
  }
1492
- function ro(e, t) {
1493
+ function lo(e, t) {
1493
1494
  return dt(
1494
- $t(t),
1495
+ Ht(t),
1495
1496
  e
1496
1497
  );
1497
1498
  }
1498
- function it(e, t, o) {
1499
+ function rt(e, t, o) {
1499
1500
  if (e.coordinateSystemId === t)
1500
1501
  return e;
1501
- const i = $t(o), n = dt(
1502
+ const i = Ht(o), n = dt(
1502
1503
  i,
1503
1504
  e.coordinateSystemId || "world"
1504
1505
  ), r = dt(
@@ -1510,9 +1511,9 @@ function it(e, t, o) {
1510
1511
  ...e,
1511
1512
  coordinateSystemId: r.coordinate_system
1512
1513
  };
1513
- const a = P.fromCoordinateSystem(r).inverse().multiply(
1514
- P.fromCoordinateSystem(n).multiply(
1515
- P.fromPose(e.pose)
1514
+ const a = A.fromCoordinateSystem(r).inverse().multiply(
1515
+ A.fromCoordinateSystem(n).multiply(
1516
+ A.fromPose(e.pose)
1516
1517
  )
1517
1518
  );
1518
1519
  return {
@@ -1532,14 +1533,14 @@ function it(e, t, o) {
1532
1533
  coordinateSystemId: r.coordinate_system
1533
1534
  };
1534
1535
  }
1535
- function Bt(e, t, o) {
1536
- const i = P.fromPose(e).multiply(P.fromRobotTcp(t).inverse()).multiply(P.fromRobotTcp(o)), { position: n, orientation: r } = i;
1536
+ function Kt(e, t, o) {
1537
+ const i = A.fromPose(e).multiply(A.fromRobotTcp(t).inverse()).multiply(A.fromRobotTcp(o)), { position: n, orientation: r } = i;
1537
1538
  return {
1538
1539
  position: [n.x, n.y, n.z],
1539
1540
  orientation: [r.x, r.y, r.z]
1540
1541
  };
1541
1542
  }
1542
- function Et(e, t) {
1543
+ function Mt(e, t) {
1543
1544
  const o = e == null ? void 0 : e[t];
1544
1545
  if (!o)
1545
1546
  throw new Error(
@@ -1551,7 +1552,7 @@ function Et(e, t) {
1551
1552
  orientation_type: "ROTATION_VECTOR"
1552
1553
  };
1553
1554
  }
1554
- function Ii({
1555
+ function Ji({
1555
1556
  inputPose: e,
1556
1557
  selectedTcpId: t,
1557
1558
  selectedCoordinateSystemId: o,
@@ -1560,24 +1561,24 @@ function Ii({
1560
1561
  }) {
1561
1562
  const r = t && t !== e.tcpId ? {
1562
1563
  ...e,
1563
- pose: Bt(
1564
+ pose: Kt(
1564
1565
  e.pose,
1565
- Et(i, e.tcpId),
1566
- Et(i, t)
1566
+ Mt(i, e.tcpId),
1567
+ Mt(i, t)
1567
1568
  ),
1568
1569
  tcpId: t
1569
1570
  } : e;
1570
- return o ? it(
1571
+ return o ? rt(
1571
1572
  r,
1572
1573
  o,
1573
1574
  n
1574
1575
  ) : r;
1575
1576
  }
1576
- function zt(e) {
1577
+ function Yt(e) {
1577
1578
  var t, o, i, n, r;
1578
1579
  if (typeof e == "string") {
1579
- const a = O(e);
1580
- return a ? zt(a) : e;
1580
+ const a = R(e);
1581
+ return a ? Yt(a) : e;
1581
1582
  }
1582
1583
  if (e && typeof e == "object") {
1583
1584
  const a = e;
@@ -1590,7 +1591,7 @@ function zt(e) {
1590
1591
  }
1591
1592
  return "Jogging motion failed";
1592
1593
  }
1593
- const ao = [
1594
+ const co = [
1594
1595
  // Trajectory-planning failure causes, identified by the error_feedback_name
1595
1596
  // of a PlanTrajectoryFailedResponse (see extractJogErrorMessage)
1596
1597
  {
@@ -1620,12 +1621,12 @@ const ao = [
1620
1621
  translationKey: "Jogging.StreamStateSection.Error.PlanningFailed.lb"
1621
1622
  }
1622
1623
  ];
1623
- function so(e) {
1624
+ function go(e) {
1624
1625
  var t;
1625
- return ((t = ao.find(({ pattern: o }) => o.test(e))) == null ? void 0 : t.translationKey) ?? null;
1626
+ return ((t = co.find(({ pattern: o }) => o.test(e))) == null ? void 0 : t.translationKey) ?? null;
1626
1627
  }
1627
- const lo = 5, co = 250;
1628
- function go(e) {
1628
+ const ho = 5, uo = 250;
1629
+ function mo(e) {
1629
1630
  var i, n, r, a;
1630
1631
  const t = [
1631
1632
  (n = (i = e == null ? void 0 : e.manual_t1_limits) == null ? void 0 : i.tcp) == null ? void 0 : n.velocity,
@@ -1633,29 +1634,29 @@ function go(e) {
1633
1634
  ].filter(
1634
1635
  (s) => typeof s == "number" && Number.isFinite(s) && s > 0
1635
1636
  );
1636
- return Math.min(co, ...t) / 10;
1637
+ return Math.min(uo, ...t) / 10;
1637
1638
  }
1638
1639
  const gt = [
1639
1640
  { id: "0.1", mm: 0.1, degrees: 0.05 },
1640
1641
  { id: "1", mm: 1, degrees: 0.5 },
1641
1642
  { id: "5", mm: 5, degrees: 2.5 },
1642
1643
  { id: "10", mm: 10, degrees: 5 }
1643
- ], ho = [
1644
+ ], po = [
1644
1645
  { id: "continuous" },
1645
1646
  ...gt
1646
- ], mo = ["coordsys", "tool"], Mt = "joggingToolStore", uo = () => typeof localStorage > "u" ? void 0 : localStorage;
1647
- class nt {
1647
+ ], fo = ["coordsys", "tool"], Et = "joggingToolStore", yo = () => typeof localStorage > "u" ? void 0 : localStorage;
1648
+ class at {
1648
1649
  constructor(t, o, i, n, r, a = {}) {
1649
- var g, m, h;
1650
- this.jogger = t, this.coordSystems = o, this.motionGroupDescription = i, this.tcps = n, this.inverseSolverValue = r, this.selectedTabId = "cartesian", this.locks = /* @__PURE__ */ new Set(), this.blocked = !1, this.selectedCoordSystemId = "world", this.jogCoordSystemId = "world", this.selectedTcpId = "", this.tcpChangeInProgress = !1, this.selectedOrientation = "coordsys", this.selectedIncrementId = "continuous", this.selectedCartesianMotionType = "translate", this.incrementJogInProgress = null, this.lastJogError = null, this.onBeforeActivate = null, this.rotationVelocityDegPerSec = lo, this.minTranslationVelocityMmPerSec = 1, this.maxTranslationVelocityMmPerSec = 250, this.minRotationVelocityDegPerSec = 1, this.maxRotationVelocityDegPerSec = 60, this.showCoordSystemSelect = !1, this.showTcpSelect = !0, this.showOrientationSelect = !0, this.showIncrementSelect = !0, this.showTabIcons = !1, this.showVelocitySliderLabel = !0, this.showVelocityLegend = !1, this.showJointsLegend = !1, this.disposers = [], this.inverseSolver = void 0, this.jointType = V.RevoluteJoint, this.storage = a.storage ?? uo();
1651
- for (const u of o)
1652
- if (u.coordinate_system === "") {
1653
- u.coordinate_system = "world";
1650
+ var d, u, h;
1651
+ this.jogger = t, this.coordSystems = o, this.motionGroupDescription = i, this.tcps = n, this.inverseSolverValue = r, this.selectedTabId = "cartesian", this.locks = /* @__PURE__ */ new Set(), this.blocked = !1, this.selectedCoordSystemId = "world", this.jogCoordSystemId = "world", this.selectedTcpId = "", this.tcpChangeInProgress = !1, this.selectedOrientation = "coordsys", this.selectedIncrementId = "continuous", this.selectedCartesianMotionType = "translate", this.incrementJogInProgress = null, this.lastJogError = null, this.onBeforeActivate = null, this.rotationVelocityDegPerSec = ho, this.minTranslationVelocityMmPerSec = 1, this.maxTranslationVelocityMmPerSec = 250, this.minRotationVelocityDegPerSec = 1, this.maxRotationVelocityDegPerSec = 60, this.showCoordSystemSelect = !1, this.showTcpSelect = !0, this.showOrientationSelect = !0, this.showIncrementSelect = !0, this.showTabIcons = !1, this.showVelocitySliderLabel = !0, this.showVelocityLegend = !1, this.showJointsLegend = !1, this.disposers = [], this.inverseSolver = void 0, this.jointType = D.RevoluteJoint, this.storage = a.storage ?? yo();
1652
+ for (const m of o)
1653
+ if (m.coordinate_system === "") {
1654
+ m.coordinate_system = "world";
1654
1655
  break;
1655
1656
  }
1656
- this.selectedCoordSystemId = ((g = o[0]) == null ? void 0 : g.coordinate_system) || "world", this.jogCoordSystemId = this.selectedCoordSystemId, this.selectedTcpId = t.motionStream.rapidlyChangingMotionState.tcp ?? "", this.tcpChangeInProgress = this.tcps.length > 0 && !this.selectedTcpId, this.inverseSolver = r, this.translationVelocityMmPerSec = go(
1657
+ this.selectedCoordSystemId = ((d = o[0]) == null ? void 0 : d.coordinate_system) || "world", this.jogCoordSystemId = this.selectedCoordSystemId, this.selectedTcpId = t.motionStream.rapidlyChangingMotionState.tcp ?? "", this.tcpChangeInProgress = this.tcps.length > 0 && !this.selectedTcpId, this.inverseSolver = r, this.translationVelocityMmPerSec = mo(
1657
1658
  i == null ? void 0 : i.operation_limits
1658
- ), this.jointType = ((h = (m = i == null ? void 0 : i.dh_parameters) == null ? void 0 : m[0]) == null ? void 0 : h.type) ?? V.RevoluteJoint, at(
1659
+ ), this.jointType = ((h = (u = i == null ? void 0 : i.dh_parameters) == null ? void 0 : u[0]) == null ? void 0 : h.type) ?? D.RevoluteJoint, Z(
1659
1660
  this,
1660
1661
  { storage: !1 },
1661
1662
  { autoBind: !0 }
@@ -1663,13 +1664,13 @@ class nt {
1663
1664
  this.block();
1664
1665
  };
1665
1666
  const s = this.jogger.onError;
1666
- this.jogger.onError = (u) => {
1667
- this.setLastJogError(zt(u)), s == null || s(u);
1667
+ this.jogger.onError = (m) => {
1668
+ this.setLastJogError(Yt(m)), s == null || s(m);
1668
1669
  }, this.loadFromLocalStorage(), this.disposers.push(yt(() => this.saveToLocalStorage())), this.disposers.push(
1669
1670
  yt(() => {
1670
- const u = this.jogger.motionStream.rapidlyChangingMotionState.tcp;
1671
- u && u !== this.selectedTcpId && S(() => {
1672
- this.selectedTcpId = u, this.tcpChangeInProgress = !1;
1671
+ const m = this.jogger.motionStream.rapidlyChangingMotionState.tcp;
1672
+ m && m !== this.selectedTcpId && S(() => {
1673
+ this.selectedTcpId = m, this.tcpChangeInProgress = !1;
1673
1674
  });
1674
1675
  })
1675
1676
  );
@@ -1695,7 +1696,7 @@ class nt {
1695
1696
  ]), s = await i.api.motionGroupModels.getMotionGroupKinematicModel(
1696
1697
  a.motion_group_model
1697
1698
  );
1698
- return nt.create(
1699
+ return at.create(
1699
1700
  t,
1700
1701
  {
1701
1702
  coordinateSystems: r || [],
@@ -1712,13 +1713,13 @@ class nt {
1712
1713
  * instead of {@link JoggingStore.loadFor}.
1713
1714
  */
1714
1715
  static create(t, o, i = {}) {
1715
- const { coordinateSystems: n, description: r, kinematicModel: a } = o, s = Object.entries(r.tcps || {}).map(([g, m]) => ({
1716
- id: g,
1717
- readable_name: m.name,
1718
- position: m.pose.position,
1719
- orientation: m.pose.orientation
1716
+ const { coordinateSystems: n, description: r, kinematicModel: a } = o, s = Object.entries(r.tcps || {}).map(([d, u]) => ({
1717
+ id: d,
1718
+ readable_name: u.name,
1719
+ position: u.pose.position,
1720
+ orientation: u.pose.orientation
1720
1721
  }));
1721
- return new nt(
1722
+ return new at(
1722
1723
  t,
1723
1724
  n,
1724
1725
  r,
@@ -1733,7 +1734,7 @@ class nt {
1733
1734
  this.jogger.dispose();
1734
1735
  }
1735
1736
  get coordSystemCountByName() {
1736
- return ge(this.coordSystems, (t) => t.name);
1737
+ return Se(this.coordSystems, (t) => t.name);
1737
1738
  }
1738
1739
  async deactivate() {
1739
1740
  this.jogger.mode === "jogging" && await this.jogger.setJoggingMode("off");
@@ -1756,7 +1757,7 @@ class nt {
1756
1757
  */
1757
1758
  loadFromLocalStorage() {
1758
1759
  var i;
1759
- const t = (i = this.storage) == null ? void 0 : i.getItem(Mt), o = t ? O(t) : void 0;
1760
+ const t = (i = this.storage) == null ? void 0 : i.getItem(Et), o = t ? R(t) : void 0;
1760
1761
  o && (this.tabsById[o.selectedTabId] && (this.selectedTabId = o.selectedTabId), this.coordSystemsById[o.selectedCoordSystemId] && (this.selectedCoordSystemId = o.selectedCoordSystemId), this.coordSystemsById[o.jogCoordSystemId] && (this.jogCoordSystemId = o.jogCoordSystemId), this.incrementOptionsById[o.selectedIncrementId] && (this.selectedIncrementId = o.selectedIncrementId), ["translate", "rotate"].includes(o.selectedCartesianMotionType) && (this.selectedCartesianMotionType = o.selectedCartesianMotionType), ["coordsys", "tool"].includes(o.selectedOrientation) && (this.selectedOrientation = o.selectedOrientation));
1761
1762
  }
1762
1763
  /**
@@ -1765,7 +1766,7 @@ class nt {
1765
1766
  */
1766
1767
  saveToLocalStorage() {
1767
1768
  var t;
1768
- (t = this.storage) == null || t.setItem(Mt, JSON.stringify(this.localStorageSave));
1769
+ (t = this.storage) == null || t.setItem(Et, JSON.stringify(this.localStorageSave));
1769
1770
  }
1770
1771
  get isLocked() {
1771
1772
  return this.locks.size > 0;
@@ -1778,7 +1779,7 @@ class nt {
1778
1779
  * shown as-is).
1779
1780
  */
1780
1781
  get lastJogErrorTranslationKey() {
1781
- return this.lastJogError ? so(this.lastJogError) : null;
1782
+ return this.lastJogError ? go(this.lastJogError) : null;
1782
1783
  }
1783
1784
  get localStorageSave() {
1784
1785
  return {
@@ -1812,16 +1813,16 @@ class nt {
1812
1813
  }), t;
1813
1814
  }
1814
1815
  get incrementOptions() {
1815
- return ho;
1816
+ return po;
1816
1817
  }
1817
1818
  get discreteIncrementOptions() {
1818
1819
  return gt;
1819
1820
  }
1820
1821
  get incrementOptionsById() {
1821
- return q(this.incrementOptions, (t) => t.id);
1822
+ return H(this.incrementOptions, (t) => t.id);
1822
1823
  }
1823
1824
  get tabsById() {
1824
- return q(this.tabs, (t) => t.id);
1825
+ return H(this.tabs, (t) => t.id);
1825
1826
  }
1826
1827
  get currentTab() {
1827
1828
  return this.tabsById[this.selectedTabId] || this.tabs[0];
@@ -1830,7 +1831,7 @@ class nt {
1830
1831
  return this.tabs.indexOf(this.currentTab);
1831
1832
  }
1832
1833
  get coordSystemsById() {
1833
- return q(this.coordSystems, (t) => t.coordinate_system);
1834
+ return H(this.coordSystems, (t) => t.coordinate_system);
1834
1835
  }
1835
1836
  /**
1836
1837
  * The id of the coordinate system to use for jogging.
@@ -1842,7 +1843,7 @@ class nt {
1842
1843
  }
1843
1844
  /** The coordinate system to jog along, resolved relative to world */
1844
1845
  get jogCoordSystem() {
1845
- return ro(
1846
+ return lo(
1846
1847
  this.jogCoordSystemId,
1847
1848
  this.coordSystems
1848
1849
  );
@@ -1855,7 +1856,7 @@ class nt {
1855
1856
  */
1856
1857
  get tcpPoseInSelectedCoordSystem() {
1857
1858
  const { tcp_pose: t, coordinate_system: o } = this.jogger.motionStream.readoutState;
1858
- return !(t != null && t.position) || !t.orientation ? t : it(
1859
+ return !(t != null && t.position) || !t.orientation ? t : rt(
1859
1860
  {
1860
1861
  pose: {
1861
1862
  position: t.position,
@@ -1868,7 +1869,7 @@ class nt {
1868
1869
  ).pose;
1869
1870
  }
1870
1871
  get tcpsById() {
1871
- return q(this.tcps, (t) => t.id);
1872
+ return H(this.tcps, (t) => t.id);
1872
1873
  }
1873
1874
  /**
1874
1875
  * The streamed TCP pose (its readout) as the pose of a TCP, relative to a
@@ -1880,9 +1881,9 @@ class nt {
1880
1881
  const { tcp_pose: i, tcp: n, coordinate_system: r } = this.jogger.motionStream.readoutState, a = this.tcpsById[n || this.selectedTcpId], s = this.tcpsById[t];
1881
1882
  if (!(!(i != null && i.position) || !i.orientation) && !(!a || !s))
1882
1883
  try {
1883
- return it(
1884
+ return rt(
1884
1885
  {
1885
- pose: Bt(i, a, s),
1886
+ pose: Kt(i, a, s),
1886
1887
  coordinateSystemId: r || "world"
1887
1888
  },
1888
1889
  o,
@@ -1967,7 +1968,7 @@ class nt {
1967
1968
  return new Promise((i) => {
1968
1969
  const n = setTimeout(() => {
1969
1970
  r(), i(!1);
1970
- }, o), r = et(
1971
+ }, o), r = ot(
1971
1972
  () => this.jogger.motionStream.rapidlyChangingMotionState.tcp === t,
1972
1973
  () => {
1973
1974
  clearTimeout(n), i(!0);
@@ -2023,7 +2024,7 @@ class nt {
2023
2024
  }
2024
2025
  /** Lock the UI until the given async callback resolves */
2025
2026
  async withMotionLock(t) {
2026
- const o = ve();
2027
+ const o = Me();
2027
2028
  this.lock(o);
2028
2029
  try {
2029
2030
  return await t();
@@ -2032,10 +2033,10 @@ class nt {
2032
2033
  }
2033
2034
  }
2034
2035
  }
2035
- const po = E(
2036
+ const So = M(
2036
2037
  ({ store: e, useDegree: t }) => {
2037
2038
  var a;
2038
- const { t: o } = A(), i = Xt(), n = [];
2039
+ const { t: o } = P(), i = ae(), n = [];
2039
2040
  function r(s) {
2040
2041
  switch (s) {
2041
2042
  case "coordsys":
@@ -2048,7 +2049,7 @@ const po = E(
2048
2049
  }
2049
2050
  return e.showCoordSystemSelect && n.push(
2050
2051
  /* @__PURE__ */ c(
2051
- Q,
2052
+ X,
2052
2053
  {
2053
2054
  labelId: `jogging-coord-select-${i}`,
2054
2055
  labelValue: o("Jogging.CoordinateSystem.hlb"),
@@ -2057,13 +2058,13 @@ const po = E(
2057
2058
  variant: "filled",
2058
2059
  displayEmpty: !0,
2059
2060
  onChange: (s) => e.setSelectedCoordSystemId(s.target.value),
2060
- children: e.coordSystems.map((s) => /* @__PURE__ */ c(F, { value: s.coordinate_system, children: s.name && e.coordSystemCountByName[s.name] > 1 ? `${s.name} / ${s.coordinate_system}` : s.name || s.coordinate_system }, s.coordinate_system))
2061
+ children: e.coordSystems.map((s) => /* @__PURE__ */ c($, { value: s.coordinate_system, children: s.name && e.coordSystemCountByName[s.name] > 1 ? `${s.name} / ${s.coordinate_system}` : s.name || s.coordinate_system }, s.coordinate_system))
2061
2062
  },
2062
2063
  "coord"
2063
2064
  )
2064
2065
  ), e.showTcpSelect && n.push(
2065
2066
  /* @__PURE__ */ c(
2066
- Q,
2067
+ X,
2067
2068
  {
2068
2069
  labelId: `jogging-tcp-select-${i}`,
2069
2070
  labelValue: "TCP",
@@ -2072,31 +2073,31 @@ const po = E(
2072
2073
  variant: "filled",
2073
2074
  displayEmpty: e.tcpChangeInProgress,
2074
2075
  onChange: (s) => {
2075
- e.requestTcpChange(s.target.value).catch((g) => {
2076
- console.error("Failed to change TCP:", g);
2076
+ e.requestTcpChange(s.target.value).catch((d) => {
2077
+ console.error("Failed to change TCP:", d);
2077
2078
  });
2078
2079
  },
2079
2080
  disabled: e.tcpChangeInProgress,
2080
- endAdornment: e.tcpChangeInProgress ? /* @__PURE__ */ c(ye, { position: "end", children: /* @__PURE__ */ c(Jt, { size: 16 }) }) : void 0,
2081
- children: e.tcps.map((s) => /* @__PURE__ */ c(F, { value: s.id, children: s.id }, s.id))
2081
+ endAdornment: e.tcpChangeInProgress ? /* @__PURE__ */ c(xe, { position: "end", children: /* @__PURE__ */ c(Pt, { size: 16 }) }) : void 0,
2082
+ children: e.tcps.map((s) => /* @__PURE__ */ c($, { value: s.id, children: s.id }, s.id))
2082
2083
  },
2083
2084
  "tcp"
2084
2085
  )
2085
2086
  ), e.showOrientationSelect && n.push(
2086
2087
  /* @__PURE__ */ c(
2087
- Q,
2088
+ X,
2088
2089
  {
2089
2090
  labelValue: o("Jogging.Cartesian.Orientation.lb"),
2090
2091
  labelId: `orientation-select-${i}`,
2091
2092
  value: e.selectedOrientation,
2092
2093
  onChange: (s) => e.setSelectedOrientation(s.target.value),
2093
- children: mo.map((s) => /* @__PURE__ */ c(F, { value: s, children: r(s) }, s))
2094
+ children: fo.map((s) => /* @__PURE__ */ c($, { value: s, children: r(s) }, s))
2094
2095
  },
2095
2096
  "orientation"
2096
2097
  )
2097
2098
  ), e.showIncrementSelect && n.push(
2098
2099
  /* @__PURE__ */ y(
2099
- Q,
2100
+ X,
2100
2101
  {
2101
2102
  labelValue: o("Jogging.Increment.hlb"),
2102
2103
  labelId: `jogging-increment-select-${i}`,
@@ -2107,14 +2108,14 @@ const po = E(
2107
2108
  s.target.value
2108
2109
  ),
2109
2110
  children: [
2110
- /* @__PURE__ */ c(F, { value: "continuous", children: o("Jogging.Increment.Continuous.dd") }, "continuous"),
2111
- e.discreteIncrementOptions.map((s) => /* @__PURE__ */ c(F, { value: s.id, children: t ? `${s.degrees}°` : `${s.mm}mm` }, s.id))
2111
+ /* @__PURE__ */ c($, { value: "continuous", children: o("Jogging.Increment.Continuous.dd") }, "continuous"),
2112
+ e.discreteIncrementOptions.map((s) => /* @__PURE__ */ c($, { value: s.id, children: t ? `${s.degrees}°` : `${s.mm}mm` }, s.id))
2112
2113
  ]
2113
2114
  },
2114
2115
  "increment"
2115
2116
  )
2116
2117
  ), /* @__PURE__ */ c(
2117
- L,
2118
+ V,
2118
2119
  {
2119
2120
  component: "div",
2120
2121
  "data-testid": "jogging-options",
@@ -2126,20 +2127,20 @@ const po = E(
2126
2127
  gridAutoRows: "min-content",
2127
2128
  "& label": { opacity: 0.7, fontSize: "12px", marginBottom: "4px" }
2128
2129
  },
2129
- children: n.map((s, g) => /* @__PURE__ */ c(
2130
- L,
2130
+ children: n.map((s, d) => /* @__PURE__ */ c(
2131
+ V,
2131
2132
  {
2132
2133
  sx: {
2133
- gridColumn: n.length % 2 === 1 && g === n.length - 1 ? "span 2" : "auto"
2134
+ gridColumn: n.length % 2 === 1 && d === n.length - 1 ? "span 2" : "auto"
2134
2135
  },
2135
2136
  children: s
2136
2137
  },
2137
- g
2138
+ d
2138
2139
  ))
2139
2140
  }
2140
2141
  );
2141
2142
  }
2142
- ), fo = Pt(xe)(({ theme: e }) => {
2143
+ ), bo = Lt(Ee)(({ theme: e }) => {
2143
2144
  var t;
2144
2145
  return {
2145
2146
  "&.MuiToggleButtonGroup-root": {
@@ -2161,14 +2162,14 @@ const po = E(
2161
2162
  }
2162
2163
  }
2163
2164
  };
2164
- }), yo = Z(
2165
- E((e) => {
2166
- const { store: t } = e, { t: o } = A();
2165
+ }), vo = Q(
2166
+ M((e) => {
2167
+ const { store: t } = e, { t: o } = P();
2167
2168
  function i(n, r) {
2168
- r === e.velocity || !_e(r) || e.onVelocityChange(r, e.useDegree);
2169
+ r === e.velocity || !Te(r) || e.onVelocityChange(r, e.useDegree);
2169
2170
  }
2170
2171
  return /* @__PURE__ */ y(
2171
- x,
2172
+ _,
2172
2173
  {
2173
2174
  direction: "row",
2174
2175
  gap: 2,
@@ -2177,17 +2178,17 @@ const po = E(
2177
2178
  "aria-label": "velocity-slider",
2178
2179
  children: [
2179
2180
  t.showVelocityLegend && /* @__PURE__ */ c(
2180
- j,
2181
+ I,
2181
2182
  {
2182
2183
  sx: {
2183
- color: pe,
2184
+ color: _e,
2184
2185
  fontSize: "14px"
2185
2186
  },
2186
2187
  children: o("Jogging.Velocity.bt")
2187
2188
  }
2188
2189
  ),
2189
2190
  /* @__PURE__ */ c(
2190
- At,
2191
+ Vt,
2191
2192
  {
2192
2193
  value: e.velocity,
2193
2194
  color: "secondary",
@@ -2205,17 +2206,17 @@ const po = E(
2205
2206
  }
2206
2207
  }
2207
2208
  ),
2208
- t.showVelocitySliderLabel && (e.renderValue ? e.renderValue(e.velocity) : /* @__PURE__ */ c(Ut, { value: e.velocity.toString() }))
2209
+ t.showVelocitySliderLabel && (e.renderValue ? e.renderValue(e.velocity) : /* @__PURE__ */ c(Qt, { value: e.velocity.toString() }))
2209
2210
  ]
2210
2211
  }
2211
2212
  );
2212
2213
  })
2213
2214
  );
2214
- function Ut({ value: e, sx: t }) {
2215
+ function Qt({ value: e, sx: t }) {
2215
2216
  var i;
2216
- const o = B();
2217
+ const o = z();
2217
2218
  return /* @__PURE__ */ c(
2218
- x,
2219
+ _,
2219
2220
  {
2220
2221
  direction: "row",
2221
2222
  justifyContent: "center",
@@ -2229,7 +2230,7 @@ function Ut({ value: e, sx: t }) {
2229
2230
  ...t
2230
2231
  },
2231
2232
  children: /* @__PURE__ */ c(
2232
- j,
2233
+ I,
2233
2234
  {
2234
2235
  component: "span",
2235
2236
  sx: {
@@ -2245,14 +2246,14 @@ function Ut({ value: e, sx: t }) {
2245
2246
  }
2246
2247
  );
2247
2248
  }
2248
- const Gt = E(
2249
+ const Zt = M(
2249
2250
  ({ store: e, useDegree: t }) => {
2250
- const { t: o } = A();
2251
+ const { t: o } = P();
2251
2252
  function i(n, r) {
2252
2253
  return r ? `ω = ${o("Jogging.Cartesian.Rotation.velocityDegPerSec.lb", { amount: n })}` : `v = ${o("Jogging.Cartesian.Translation.velocityMmPerSec.lb", { amount: n })}`;
2253
2254
  }
2254
2255
  return /* @__PURE__ */ c(
2255
- yo,
2256
+ vo,
2256
2257
  {
2257
2258
  store: e,
2258
2259
  velocity: e.velocityInDisplayUnits(t),
@@ -2262,7 +2263,7 @@ const Gt = E(
2262
2263
  useDegree: t,
2263
2264
  disabled: e.isLocked,
2264
2265
  renderValue: (n) => /* @__PURE__ */ c(
2265
- Ut,
2266
+ Qt,
2266
2267
  {
2267
2268
  value: i(n, t),
2268
2269
  sx: {
@@ -2276,11 +2277,11 @@ const Gt = E(
2276
2277
  }
2277
2278
  );
2278
2279
  }
2279
- ), Wt = E(({ store: e }) => {
2280
- var a, s, g;
2281
- const { t } = A(), o = B(), i = ((g = (s = (a = e.jogger.motionStream.rapidlyChangingMotionState.execute) == null ? void 0 : a.details) == null ? void 0 : s.state) == null ? void 0 : g.kind) ?? "KIND_UNKNOWN", n = e.lastJogError, r = e.lastJogErrorTranslationKey;
2280
+ ), Xt = M(({ store: e }) => {
2281
+ var a, s, d;
2282
+ const { t } = P(), o = z(), i = ((d = (s = (a = e.jogger.motionStream.rapidlyChangingMotionState.execute) == null ? void 0 : a.details) == null ? void 0 : s.state) == null ? void 0 : d.kind) ?? "KIND_UNKNOWN", n = e.lastJogError, r = e.lastJogErrorTranslationKey;
2282
2283
  return /* @__PURE__ */ y(
2283
- L,
2284
+ V,
2284
2285
  {
2285
2286
  sx: {
2286
2287
  display: "flex",
@@ -2290,7 +2291,7 @@ const Gt = E(
2290
2291
  },
2291
2292
  children: [
2292
2293
  /* @__PURE__ */ c(
2293
- j,
2294
+ I,
2294
2295
  {
2295
2296
  variant: "body2",
2296
2297
  sx: {
@@ -2302,7 +2303,7 @@ const Gt = E(
2302
2303
  }
2303
2304
  ),
2304
2305
  /* @__PURE__ */ c(
2305
- j,
2306
+ I,
2306
2307
  {
2307
2308
  variant: "body2",
2308
2309
  color: n ? "error" : void 0,
@@ -2319,35 +2320,35 @@ const Gt = E(
2319
2320
  ]
2320
2321
  }
2321
2322
  );
2322
- }), So = E(
2323
+ }), Co = M(
2323
2324
  ({
2324
2325
  store: e,
2325
2326
  children: t
2326
2327
  }) => {
2327
- const { t: o } = A(), i = B(), n = rt(0);
2328
- function r(d, l) {
2328
+ const { t: o } = P(), i = z(), n = st(0);
2329
+ function r(g, l) {
2329
2330
  (l === "translate" || l === "rotate") && e.setSelectedCartesianMotionType(l);
2330
2331
  }
2331
- async function a(d, l) {
2332
- const f = await e.activate(), p = f.motionStream.rapidlyChangingMotionState.tcp_pose, C = f.motionStream.rapidlyChangingMotionState.joint_position;
2332
+ async function a(g, l) {
2333
+ const f = await e.activate(), p = f.motionStream.rapidlyChangingMotionState.tcp_pose, v = f.motionStream.rapidlyChangingMotionState.joint_position;
2333
2334
  p && await e.withMotionLock(async () => {
2334
2335
  try {
2335
2336
  e.setCurrentIncrementJog({
2336
- axis: d.axis,
2337
- direction: d.direction
2337
+ axis: g.axis,
2338
+ direction: g.direction
2338
2339
  }), await e.jogger.runIncrementalCartesianMotion({
2339
2340
  currentTcpPose: p,
2340
- currentJoints: C,
2341
+ currentJoints: v,
2341
2342
  coordSystemId: e.activeCoordSystemId,
2342
2343
  velocityInRelevantUnits: e.selectedCartesianMotionType === "translate" ? e.translationVelocityMmPerSec : e.rotationVelocityRadsPerSec,
2343
- axis: d.axis,
2344
- direction: d.direction,
2344
+ axis: g.axis,
2345
+ direction: g.direction,
2345
2346
  motion: e.selectedCartesianMotionType === "translate" ? {
2346
2347
  type: "translate",
2347
2348
  distanceMm: l.mm
2348
2349
  } : {
2349
2350
  type: "rotate",
2350
- distanceRads: ae(l.degrees)
2351
+ distanceRads: he(l.degrees)
2351
2352
  }
2352
2353
  });
2353
2354
  } finally {
@@ -2355,59 +2356,59 @@ const Gt = E(
2355
2356
  }
2356
2357
  });
2357
2358
  }
2358
- async function s(d) {
2359
+ async function s(g) {
2359
2360
  if (e.isLocked) return;
2360
2361
  const l = ++n.current;
2361
2362
  try {
2362
2363
  if (await e.activate(), l !== n.current) return;
2363
2364
  if (e.activeDiscreteIncrement)
2364
2365
  return await a(
2365
- d,
2366
+ g,
2366
2367
  e.activeDiscreteIncrement
2367
2368
  );
2368
- d.motionType === "translate" ? await e.jogger.translateTCP({
2369
- axis: d.axis,
2370
- direction: d.direction,
2369
+ g.motionType === "translate" ? await e.jogger.translateTCP({
2370
+ axis: g.axis,
2371
+ direction: g.direction,
2371
2372
  velocityMmPerSec: e.translationVelocityMmPerSec
2372
2373
  }) : await e.jogger.rotateTCP({
2373
- axis: d.axis,
2374
- direction: d.direction,
2374
+ axis: g.axis,
2375
+ direction: g.direction,
2375
2376
  velocityRadsPerSec: e.rotationVelocityRadsPerSec
2376
2377
  });
2377
2378
  } catch (f) {
2378
2379
  console.error("Jogging failed:", f);
2379
2380
  }
2380
2381
  }
2381
- async function g() {
2382
+ async function d() {
2382
2383
  e.isLocked || e.activeDiscreteIncrement || (n.current++, await e.deactivate());
2383
2384
  }
2384
- const m = [
2385
+ const u = [
2385
2386
  {
2386
2387
  id: "x",
2387
- icon: /* @__PURE__ */ c(Ye, {}),
2388
- colors: st.X
2388
+ icon: /* @__PURE__ */ c(Xe, {}),
2389
+ colors: lt.X
2389
2390
  },
2390
2391
  {
2391
2392
  id: "y",
2392
- icon: /* @__PURE__ */ c(Qe, {}),
2393
- colors: st.Y
2393
+ icon: /* @__PURE__ */ c(eo, {}),
2394
+ colors: lt.Y
2394
2395
  },
2395
2396
  {
2396
2397
  id: "z",
2397
- icon: /* @__PURE__ */ c(to, {}),
2398
- colors: st.Z
2398
+ icon: /* @__PURE__ */ c(io, {}),
2399
+ colors: lt.Z
2399
2400
  }
2400
2401
  ];
2401
- function h(d) {
2402
- return o("General.mm.variable", { amount: d.toFixed(1) });
2402
+ function h(g) {
2403
+ return o("General.mm.variable", { amount: g.toFixed(1) });
2403
2404
  }
2404
- function u(d) {
2405
+ function m(g) {
2405
2406
  return o("General.degree.variable", {
2406
- amount: Ot(d).toFixed(1)
2407
+ amount: At(g).toFixed(1)
2407
2408
  });
2408
2409
  }
2409
2410
  return /* @__PURE__ */ y(
2410
- x,
2411
+ _,
2411
2412
  {
2412
2413
  "data-testid": "jogging-cartesian-tab",
2413
2414
  "aria-label": "jogging-cartesian-tab",
@@ -2415,25 +2416,25 @@ const Gt = E(
2415
2416
  gap: 2,
2416
2417
  sx: { padding: "18px 24px" },
2417
2418
  children: [
2418
- /* @__PURE__ */ y(x, { gap: 2, children: [
2419
+ /* @__PURE__ */ y(_, { gap: 2, children: [
2419
2420
  /* @__PURE__ */ c(
2420
- po,
2421
+ So,
2421
2422
  {
2422
2423
  store: e,
2423
2424
  useDegree: e.selectedCartesianMotionType === "rotate"
2424
2425
  }
2425
2426
  ),
2426
2427
  /* @__PURE__ */ c(
2427
- Gt,
2428
+ Zt,
2428
2429
  {
2429
2430
  store: e,
2430
2431
  useDegree: e.selectedCartesianMotionType === "rotate"
2431
2432
  }
2432
2433
  ),
2433
- /* @__PURE__ */ c(N, {})
2434
+ /* @__PURE__ */ c(F, {})
2434
2435
  ] }),
2435
2436
  /* @__PURE__ */ c(
2436
- x,
2437
+ _,
2437
2438
  {
2438
2439
  marginLeft: "auto",
2439
2440
  marginRight: "auto",
@@ -2441,7 +2442,7 @@ const Gt = E(
2441
2442
  justifyContent: "center",
2442
2443
  sx: { flexGrow: "1" },
2443
2444
  children: /* @__PURE__ */ y(
2444
- x,
2445
+ _,
2445
2446
  {
2446
2447
  alignItems: "center",
2447
2448
  justifyContent: "center",
@@ -2449,7 +2450,7 @@ const Gt = E(
2449
2450
  sx: { flexGrow: 1 },
2450
2451
  children: [
2451
2452
  /* @__PURE__ */ y(
2452
- fo,
2453
+ bo,
2453
2454
  {
2454
2455
  value: e.selectedCartesianMotionType,
2455
2456
  onChange: r,
@@ -2457,87 +2458,87 @@ const Gt = E(
2457
2458
  "aria-label": o("Jogging.Cartesian.MotionType.lb"),
2458
2459
  sx: { justifyContent: "center" },
2459
2460
  children: [
2460
- /* @__PURE__ */ c(vt, { value: "translate", children: o("Jogging.Cartesian.Translation.bt") }),
2461
- /* @__PURE__ */ c(vt, { value: "rotate", children: o("Jogging.Cartesian.Rotation.bt") })
2461
+ /* @__PURE__ */ c(Ct, { value: "translate", children: o("Jogging.Cartesian.Translation.bt") }),
2462
+ /* @__PURE__ */ c(Ct, { value: "rotate", children: o("Jogging.Cartesian.Rotation.bt") })
2462
2463
  ]
2463
2464
  }
2464
2465
  ),
2465
- e.selectedCartesianMotionType === "translate" && m.map((d) => {
2466
+ e.selectedCartesianMotionType === "translate" && u.map((g) => {
2466
2467
  var l, f;
2467
2468
  return /* @__PURE__ */ c(
2468
- _t,
2469
+ xt,
2469
2470
  {
2470
- "data-testid": `jogging-cartesian-axis-control-${d.id}`,
2471
- "aria-label": `jogging-cartesian-axis-control-${d.id}`,
2472
- colors: d.colors,
2471
+ "data-testid": `jogging-cartesian-axis-control-${g.id}`,
2472
+ "aria-label": `jogging-cartesian-axis-control-${g.id}`,
2473
+ colors: g.colors,
2473
2474
  disabled: e.isLocked,
2474
- activeJoggingDirection: ((l = e.incrementJogInProgress) == null ? void 0 : l.axis) === d.id ? e.incrementJogInProgress.direction : void 0,
2475
- label: /* @__PURE__ */ y(X, { children: [
2476
- d.icon,
2475
+ activeJoggingDirection: ((l = e.incrementJogInProgress) == null ? void 0 : l.axis) === g.id ? e.incrementJogInProgress.direction : void 0,
2476
+ label: /* @__PURE__ */ y(tt, { children: [
2477
+ g.icon,
2477
2478
  /* @__PURE__ */ c(
2478
- j,
2479
+ I,
2479
2480
  {
2480
2481
  sx: {
2481
2482
  fontSize: "24px",
2482
- color: ((f = d.colors) == null ? void 0 : f.labelColor) ?? i.palette.text.primary
2483
+ color: ((f = g.colors) == null ? void 0 : f.labelColor) ?? i.palette.text.primary
2483
2484
  },
2484
- children: d.id.toUpperCase()
2485
+ children: g.id.toUpperCase()
2485
2486
  }
2486
2487
  )
2487
2488
  ] }),
2488
2489
  getDisplayedValue: () => {
2489
- var p, C;
2490
+ var p, v;
2490
2491
  return h(
2491
- ((C = (p = e.jogger.motionStream.rapidlyChangingMotionState.tcp_pose) == null ? void 0 : p.position) == null ? void 0 : C[St[d.id]]) || 0
2492
+ ((v = (p = e.jogger.motionStream.rapidlyChangingMotionState.tcp_pose) == null ? void 0 : p.position) == null ? void 0 : v[St[g.id]]) || 0
2492
2493
  );
2493
2494
  },
2494
2495
  startJogging: (p) => s({
2495
- axis: d.id,
2496
+ axis: g.id,
2496
2497
  motionType: "translate",
2497
2498
  direction: p
2498
2499
  }),
2499
- stopJogging: g
2500
+ stopJogging: d
2500
2501
  },
2501
- d.id
2502
+ g.id
2502
2503
  );
2503
2504
  }),
2504
- e.selectedCartesianMotionType === "rotate" && m.map((d) => {
2505
+ e.selectedCartesianMotionType === "rotate" && u.map((g) => {
2505
2506
  var l, f;
2506
2507
  return /* @__PURE__ */ c(
2507
- _t,
2508
+ xt,
2508
2509
  {
2509
- "data-testid": `jogging-cartesian-axis-control-${d.id}`,
2510
- "aria-label": `jogging-cartesian-axis-control-${d.id}`,
2511
- colors: d.colors,
2510
+ "data-testid": `jogging-cartesian-axis-control-${g.id}`,
2511
+ "aria-label": `jogging-cartesian-axis-control-${g.id}`,
2512
+ colors: g.colors,
2512
2513
  disabled: e.isLocked,
2513
- activeJoggingDirection: ((l = e.incrementJogInProgress) == null ? void 0 : l.axis) === d.id ? e.incrementJogInProgress.direction : void 0,
2514
- label: /* @__PURE__ */ y(X, { children: [
2515
- /* @__PURE__ */ c(oo, {}),
2514
+ activeJoggingDirection: ((l = e.incrementJogInProgress) == null ? void 0 : l.axis) === g.id ? e.incrementJogInProgress.direction : void 0,
2515
+ label: /* @__PURE__ */ y(tt, { children: [
2516
+ /* @__PURE__ */ c(ro, {}),
2516
2517
  /* @__PURE__ */ c(
2517
- j,
2518
+ I,
2518
2519
  {
2519
2520
  sx: {
2520
2521
  fontSize: "24px",
2521
- color: ((f = d.colors) == null ? void 0 : f.labelColor) ?? i.palette.text.primary
2522
+ color: ((f = g.colors) == null ? void 0 : f.labelColor) ?? i.palette.text.primary
2522
2523
  },
2523
- children: d.id.toUpperCase()
2524
+ children: g.id.toUpperCase()
2524
2525
  }
2525
2526
  )
2526
2527
  ] }),
2527
2528
  getDisplayedValue: () => {
2528
- var p, C;
2529
- return u(
2530
- ((C = (p = e.jogger.motionStream.rapidlyChangingMotionState.tcp_pose) == null ? void 0 : p.orientation) == null ? void 0 : C[St[d.id]]) || 0
2529
+ var p, v;
2530
+ return m(
2531
+ ((v = (p = e.jogger.motionStream.rapidlyChangingMotionState.tcp_pose) == null ? void 0 : p.orientation) == null ? void 0 : v[St[g.id]]) || 0
2531
2532
  );
2532
2533
  },
2533
2534
  startJogging: (p) => s({
2534
- axis: d.id,
2535
+ axis: g.id,
2535
2536
  motionType: "rotate",
2536
2537
  direction: p
2537
2538
  }),
2538
- stopJogging: g
2539
+ stopJogging: d
2539
2540
  },
2540
- d.id
2541
+ g.id
2541
2542
  );
2542
2543
  })
2543
2544
  ]
@@ -2545,18 +2546,18 @@ const Gt = E(
2545
2546
  )
2546
2547
  }
2547
2548
  ),
2548
- /* @__PURE__ */ c(Ft, { store: e }),
2549
- /* @__PURE__ */ c(N, {}),
2550
2549
  /* @__PURE__ */ c(Wt, { store: e }),
2551
- t && /* @__PURE__ */ c(N, {}),
2550
+ /* @__PURE__ */ c(F, {}),
2551
+ /* @__PURE__ */ c(Xt, { store: e }),
2552
+ t && /* @__PURE__ */ c(F, {}),
2552
2553
  t
2553
2554
  ]
2554
2555
  }
2555
2556
  );
2556
2557
  }
2557
- ), bo = E(
2558
+ ), _o = M(
2558
2559
  ({ store: e, children: t }) => {
2559
- const o = B(), i = rt(0);
2560
+ const o = z(), i = st(0);
2560
2561
  async function n(a) {
2561
2562
  const s = ++i.current;
2562
2563
  try {
@@ -2564,18 +2565,18 @@ const Gt = E(
2564
2565
  await e.jogger.rotateJoints({
2565
2566
  joint: a.joint,
2566
2567
  direction: a.direction,
2567
- velocityUnit: e.jointType === V.PrismaticJoint ? "mm/s" : "rad/s",
2568
- velocityValue: e.jointType === V.PrismaticJoint ? e.translationVelocityMmPerSec : e.rotationVelocityRadsPerSec
2568
+ velocityUnit: e.jointType === D.PrismaticJoint ? "mm/s" : "rad/s",
2569
+ velocityValue: e.jointType === D.PrismaticJoint ? e.translationVelocityMmPerSec : e.rotationVelocityRadsPerSec
2569
2570
  });
2570
- } catch (g) {
2571
- console.error("Jogging failed:", g);
2571
+ } catch (d) {
2572
+ console.error("Jogging failed:", d);
2572
2573
  }
2573
2574
  }
2574
2575
  async function r() {
2575
2576
  i.current++, await e.jogger.stop(), await e.deactivate();
2576
2577
  }
2577
2578
  return /* @__PURE__ */ y(
2578
- x,
2579
+ _,
2579
2580
  {
2580
2581
  "data-testid": "jogging-joint-tab",
2581
2582
  "aria-label": "jogging-joint-tab",
@@ -2584,31 +2585,31 @@ const Gt = E(
2584
2585
  sx: { padding: "18px 24px" },
2585
2586
  children: [
2586
2587
  /* @__PURE__ */ c(
2587
- Gt,
2588
+ Zt,
2588
2589
  {
2589
2590
  store: e,
2590
- useDegree: e.jointType === V.RevoluteJoint
2591
+ useDegree: e.jointType === D.RevoluteJoint
2591
2592
  }
2592
2593
  ),
2593
- /* @__PURE__ */ c(N, {}),
2594
+ /* @__PURE__ */ c(F, {}),
2594
2595
  /* @__PURE__ */ c(
2595
- x,
2596
+ _,
2596
2597
  {
2597
2598
  justifyContent: "center",
2598
2599
  alignItems: "stretch",
2599
2600
  sx: { flexGrow: "1" },
2600
2601
  children: /* @__PURE__ */ c(
2601
- x,
2602
+ _,
2602
2603
  {
2603
2604
  "data-testid": "jogging-joint-value-controls-wrapper",
2604
2605
  "aria-label": "jogging-joint-value-controls-wrapper",
2605
2606
  alignItems: "center",
2606
2607
  gap: "24px",
2607
2608
  children: e.jogger.motionStream.joints.map((a) => {
2608
- var g, m, h;
2609
- const s = (h = (m = (g = e.motionGroupDescription.operation_limits.auto_limits) == null ? void 0 : g.joints) == null ? void 0 : m[a.index]) == null ? void 0 : h.position;
2609
+ var d, u, h;
2610
+ const s = (h = (u = (d = e.motionGroupDescription.operation_limits.auto_limits) == null ? void 0 : d.joints) == null ? void 0 : u[a.index]) == null ? void 0 : h.position;
2610
2611
  return /* @__PURE__ */ y(
2611
- x,
2612
+ _,
2612
2613
  {
2613
2614
  "data-testid": `jogging-joint-value-control-${a.index}`,
2614
2615
  "aria-label": `jogging-joint-value-control-${a.index}`,
@@ -2619,26 +2620,26 @@ const Gt = E(
2619
2620
  width: "100%",
2620
2621
  children: [
2621
2622
  e.showJointsLegend && /* @__PURE__ */ c(
2622
- j,
2623
+ I,
2623
2624
  {
2624
2625
  color: e.isLocked ? o.palette.text.disabled : o.palette.text.secondary,
2625
2626
  children: `G${a.index + 1}`
2626
2627
  }
2627
2628
  ),
2628
2629
  /* @__PURE__ */ c(
2629
- Ae,
2630
+ Be,
2630
2631
  {
2631
2632
  disabled: e.isLocked,
2632
2633
  lowerLimit: s == null ? void 0 : s.lower_limit,
2633
2634
  upperLimit: s == null ? void 0 : s.upper_limit,
2634
- useDegree: e.jointType === V.RevoluteJoint,
2635
+ useDegree: e.jointType === D.RevoluteJoint,
2635
2636
  getValue: () => {
2636
- const u = e.jogger.motionStream.rapidlyChangingMotionState.joint_position[a.index];
2637
- return u !== void 0 ? u : void 0;
2637
+ const m = e.jogger.motionStream.rapidlyChangingMotionState.joint_position[a.index];
2638
+ return m !== void 0 ? m : void 0;
2638
2639
  },
2639
- startJogging: (u) => n({
2640
+ startJogging: (m) => n({
2640
2641
  joint: a.index,
2641
- direction: u
2642
+ direction: m
2642
2643
  }),
2643
2644
  stopJogging: r
2644
2645
  }
@@ -2652,22 +2653,22 @@ const Gt = E(
2652
2653
  )
2653
2654
  }
2654
2655
  ),
2655
- /* @__PURE__ */ c(Ft, { store: e }),
2656
- /* @__PURE__ */ c(N, {}),
2657
2656
  /* @__PURE__ */ c(Wt, { store: e }),
2658
- t && /* @__PURE__ */ c(N, {}),
2657
+ /* @__PURE__ */ c(F, {}),
2658
+ /* @__PURE__ */ c(Xt, { store: e }),
2659
+ t && /* @__PURE__ */ c(F, {}),
2659
2660
  t
2660
2661
  ]
2661
2662
  }
2662
2663
  );
2663
2664
  }
2664
- ), wi = Z(
2665
- E((e) => {
2665
+ ), Ai = Q(
2666
+ M((e) => {
2666
2667
  const t = Rt(() => ({
2667
2668
  joggingStore: null,
2668
2669
  loadingError: null
2669
2670
  }));
2670
- return tt(() => {
2671
+ return et(() => {
2671
2672
  let o = !1, i;
2672
2673
  async function n() {
2673
2674
  S(() => {
@@ -2688,7 +2689,7 @@ const Gt = E(
2688
2689
  return;
2689
2690
  }
2690
2691
  try {
2691
- r = await nt.loadFor(a);
2692
+ r = await at.loadFor(a);
2692
2693
  } catch (s) {
2693
2694
  throw a.dispose(), s;
2694
2695
  }
@@ -2710,11 +2711,11 @@ const Gt = E(
2710
2711
  return n(), () => {
2711
2712
  o = !0, i == null || i.dispose();
2712
2713
  };
2713
- }, [e.store, e.nova, e.motionGroupId, e.cellId]), tt(() => {
2714
+ }, [e.store, e.nova, e.motionGroupId, e.cellId]), et(() => {
2714
2715
  const o = t.joggingStore;
2715
2716
  o && (e.locked ? o.lock("external") : o.unlock("external"));
2716
2717
  }, [t.joggingStore, e.locked]), /* @__PURE__ */ c(
2717
- x,
2718
+ _,
2718
2719
  {
2719
2720
  "data-testid": "jogging-panel",
2720
2721
  "aria-label": "jogging-panel",
@@ -2724,25 +2725,25 @@ const Gt = E(
2724
2725
  position: "relative",
2725
2726
  ...e.sx
2726
2727
  },
2727
- children: t.joggingStore ? /* @__PURE__ */ c(Co, { store: t.joggingStore, children: e.children }) : /* @__PURE__ */ c(We, { message: "Loading jogging", error: t.loadingError })
2728
+ children: t.joggingStore ? /* @__PURE__ */ c(xo, { store: t.joggingStore, children: e.children }) : /* @__PURE__ */ c(Ke, { message: "Loading jogging", error: t.loadingError })
2728
2729
  }
2729
2730
  );
2730
2731
  })
2731
- ), Co = E(
2732
+ ), xo = M(
2732
2733
  ({
2733
2734
  store: e,
2734
2735
  children: t
2735
2736
  }) => {
2736
- const { t: o } = A();
2737
+ const { t: o } = P();
2737
2738
  function i() {
2738
2739
  if (e.currentTab.id === "cartesian")
2739
- return /* @__PURE__ */ c(So, { store: e, children: t });
2740
+ return /* @__PURE__ */ c(Co, { store: e, children: t });
2740
2741
  if (e.currentTab.id === "joint")
2741
- return /* @__PURE__ */ c(bo, { store: e, children: t });
2742
+ return /* @__PURE__ */ c(_o, { store: e, children: t });
2742
2743
  }
2743
- return /* @__PURE__ */ y(x, { flexGrow: 1, sx: { overflow: "hidden" }, children: [
2744
+ return /* @__PURE__ */ y(_, { flexGrow: 1, sx: { overflow: "hidden" }, children: [
2744
2745
  /* @__PURE__ */ c(
2745
- ie,
2746
+ de,
2746
2747
  {
2747
2748
  "data-testid": "jogging-tabs",
2748
2749
  "aria-label": "jogging-tabs",
@@ -2750,13 +2751,13 @@ const Gt = E(
2750
2751
  onChange: e.onTabChange,
2751
2752
  variant: "fullWidth",
2752
2753
  children: e.tabs.map((n) => {
2753
- const r = n.label === "Cartesian" ? o("Jogging.Cartesian.bt") : o("Jogging.Joints.bt"), a = n.label === "cartesian" ? /* @__PURE__ */ c(te, { fontSize: "small", sx: { mr: 1 } }) : /* @__PURE__ */ c(ee, { fontSize: "small", sx: { mr: 1 } });
2754
+ const r = n.label === "Cartesian" ? o("Jogging.Cartesian.bt") : o("Jogging.Joints.bt"), a = n.label === "cartesian" ? /* @__PURE__ */ c(se, { fontSize: "small", sx: { mr: 1 } }) : /* @__PURE__ */ c(le, { fontSize: "small", sx: { mr: 1 } });
2754
2755
  return /* @__PURE__ */ c(
2755
- oe,
2756
+ ce,
2756
2757
  {
2757
2758
  "data-testid": `jogging-tab-${n.id}`,
2758
2759
  "aria-label": `jogging-tab-${n.id}`,
2759
- label: e.showTabIcons ? /* @__PURE__ */ y(x, { direction: "row", alignItems: "center", children: [
2760
+ label: e.showTabIcons ? /* @__PURE__ */ y(_, { direction: "row", alignItems: "center", children: [
2760
2761
  a,
2761
2762
  r
2762
2763
  ] }) : r,
@@ -2769,7 +2770,7 @@ const Gt = E(
2769
2770
  }
2770
2771
  ),
2771
2772
  /* @__PURE__ */ c(
2772
- x,
2773
+ _,
2773
2774
  {
2774
2775
  flexGrow: 1,
2775
2776
  position: "relative",
@@ -2777,23 +2778,23 @@ const Gt = E(
2777
2778
  children: i()
2778
2779
  }
2779
2780
  ),
2780
- e.blocked && /* @__PURE__ */ c(He, { store: e })
2781
+ e.blocked && /* @__PURE__ */ c(Qe, { store: e })
2781
2782
  ] });
2782
2783
  }
2783
2784
  );
2784
- function vo() {
2785
+ function Io() {
2785
2786
  const e = window.location.href;
2786
2787
  return e.substring(
2787
2788
  0,
2788
2789
  e.indexOf("/", e.indexOf("//") + 2)
2789
2790
  );
2790
2791
  }
2791
- function Ei({
2792
- baseUrl: e = vo(),
2792
+ function Pi({
2793
+ baseUrl: e = Io(),
2793
2794
  ...t
2794
2795
  }) {
2795
2796
  return /* @__PURE__ */ y(
2796
- Ee,
2797
+ Je,
2797
2798
  {
2798
2799
  "aria-labelledby": "no-motion-group-modal-title",
2799
2800
  open: !0,
@@ -2813,9 +2814,9 @@ function Ei({
2813
2814
  }
2814
2815
  },
2815
2816
  children: [
2816
- /* @__PURE__ */ c(ke, { id: "no-motion-group-modal-title", children: "No motion group found" }),
2817
+ /* @__PURE__ */ c(Le, { id: "no-motion-group-modal-title", children: "No motion group found" }),
2817
2818
  /* @__PURE__ */ y(
2818
- Te,
2819
+ Pe,
2819
2820
  {
2820
2821
  sx: {
2821
2822
  marginTop: "3rem",
@@ -2823,12 +2824,12 @@ function Ei({
2823
2824
  textAlign: "center"
2824
2825
  },
2825
2826
  children: [
2826
- /* @__PURE__ */ c(j, { color: "#fff", children: "Found no devices to connect to." }),
2827
- /* @__PURE__ */ c(j, { color: "#fff", children: "Please ensure a motion group has been created." })
2827
+ /* @__PURE__ */ c(I, { color: "#fff", children: "Found no devices to connect to." }),
2828
+ /* @__PURE__ */ c(I, { color: "#fff", children: "Please ensure a motion group has been created." })
2828
2829
  ]
2829
2830
  }
2830
2831
  ),
2831
- /* @__PURE__ */ c(Me, { children: /* @__PURE__ */ y(x, { width: "100%", maxWidth: "300px", margin: "auto", marginBottom: "2rem", children: [
2832
+ /* @__PURE__ */ c(Ae, { children: /* @__PURE__ */ y(_, { width: "100%", maxWidth: "300px", margin: "auto", marginBottom: "2rem", children: [
2832
2833
  /* @__PURE__ */ c(
2833
2834
  ct,
2834
2835
  {
@@ -2860,7 +2861,7 @@ function Ei({
2860
2861
  }
2861
2862
  );
2862
2863
  }
2863
- const Tt = 1e-4, xo = {
2864
+ const Tt = 1e-4, wo = {
2864
2865
  a: 0,
2865
2866
  d: 0,
2866
2867
  alpha: 0,
@@ -2868,27 +2869,27 @@ const Tt = 1e-4, xo = {
2868
2869
  reverse_rotation_direction: !1
2869
2870
  };
2870
2871
  class ht {
2871
- constructor(t, o, i, n, r, a, s, g, m, h, u = "cell") {
2872
- this.controller = o, this.motionGroup = i, this.initialMotionState = n, this.motionStateSocket = r, this.isVirtual = a, this.tcps = s, this.description = g, this.initialControllerState = m, this.controllerStateSocket = h, this.cellId = u, this.connectedJoggingSocket = null, this.joggingVelocity = 10, this.activationState = "inactive", this.nova = H(t), this.rapidlyChangingMotionState = n, this.controllerState = m, h.addEventListener("message", (d) => {
2872
+ constructor(t, o, i, n, r, a, s, d, u, h, m = "cell") {
2873
+ this.controller = o, this.motionGroup = i, this.initialMotionState = n, this.motionStateSocket = r, this.isVirtual = a, this.tcps = s, this.description = d, this.initialControllerState = u, this.controllerStateSocket = h, this.cellId = m, this.connectedJoggingSocket = null, this.joggingVelocity = 10, this.activationState = "inactive", this.nova = N(t), this.rapidlyChangingMotionState = n, this.controllerState = u, h.addEventListener("message", (g) => {
2873
2874
  var f;
2874
- const l = (f = O(d.data)) == null ? void 0 : f.result;
2875
+ const l = (f = R(g.data)) == null ? void 0 : f.result;
2875
2876
  l && S(() => {
2876
2877
  this.controllerState = l;
2877
2878
  });
2878
- }), r.addEventListener("message", (d) => {
2879
+ }), r.addEventListener("message", (g) => {
2879
2880
  var f;
2880
- const l = (f = O(d.data)) == null ? void 0 : f.result;
2881
+ const l = (f = R(g.data)) == null ? void 0 : f.result;
2881
2882
  if (!l)
2882
2883
  throw new Error(
2883
- `Failed to get motion state for ${this.motionGroupId}: ${d.data}`
2884
+ `Failed to get motion state for ${this.motionGroupId}: ${g.data}`
2884
2885
  );
2885
- Dt(
2886
+ Nt(
2886
2887
  this.rapidlyChangingMotionState.joint_position,
2887
2888
  l.joint_position,
2888
2889
  Tt
2889
2890
  ) || S(() => {
2890
2891
  this.rapidlyChangingMotionState.joint_position = l.joint_position;
2891
- }), Lt(
2892
+ }), Bt(
2892
2893
  this.rapidlyChangingMotionState,
2893
2894
  l,
2894
2895
  Tt
@@ -2899,10 +2900,10 @@ class ht {
2899
2900
  }), this.rapidlyChangingMotionState.standstill !== l.standstill && S(() => {
2900
2901
  this.rapidlyChangingMotionState.standstill = l.standstill;
2901
2902
  });
2902
- }), at(this);
2903
+ }), Z(this);
2903
2904
  }
2904
2905
  static async connectMultiple(t, o, i = {}) {
2905
- const n = H(t), r = i.cellId ?? lt(t);
2906
+ const n = N(t), r = i.cellId ?? it(t);
2906
2907
  return Promise.all(
2907
2908
  o.map(
2908
2909
  (a) => ht.connect(n, a, {
@@ -2914,64 +2915,64 @@ class ht {
2914
2915
  }
2915
2916
  static async connect(t, o, i = {}) {
2916
2917
  var T, k;
2917
- const n = H(t), r = i.cellId ?? lt(t) ?? "cell", [a, s] = o.split("@"), g = await n.api.controller.getCurrentRobotControllerState(
2918
+ const n = N(t), r = i.cellId ?? it(t) ?? "cell", [a, s] = o.split("@"), d = await n.api.controller.getCurrentRobotControllerState(
2918
2919
  r,
2919
2920
  s
2920
- ), m = g == null ? void 0 : g.motion_groups.find(
2921
- (_) => _.motion_group === o
2921
+ ), u = d == null ? void 0 : d.motion_groups.find(
2922
+ (x) => x.motion_group === o
2922
2923
  );
2923
- if (!g || !m)
2924
+ if (!d || !u)
2924
2925
  throw new Error(
2925
2926
  `Controller ${s} or motion group ${o} not found`
2926
2927
  );
2927
2928
  const h = n.openReconnectingWebsocket(
2928
2929
  `/cells/${r}/controllers/${s}/motion-groups/${o}/state-stream`
2929
- ), u = await h.firstMessage(), d = (T = O(u.data)) == null ? void 0 : T.result;
2930
- if (!d)
2930
+ ), m = await h.firstMessage(), g = (T = R(m.data)) == null ? void 0 : T.result;
2931
+ if (!g)
2931
2932
  throw new Error(
2932
- `Unable to parse initial motion state message ${u.data}`
2933
+ `Unable to parse initial motion state message ${m.data}`
2933
2934
  );
2934
2935
  console.log(
2935
- `Connected motion state websocket to motion group ${m.motion_group}. Initial state:
2936
+ `Connected motion state websocket to motion group ${u.motion_group}. Initial state:
2936
2937
  `,
2937
- d
2938
+ g
2938
2939
  );
2939
2940
  const f = (await n.api.controller.getRobotController(
2940
2941
  r,
2941
- g.controller
2942
+ d.controller
2942
2943
  )).configuration.kind === "VirtualController", p = await n.api.motionGroup.getMotionGroupDescription(
2943
2944
  r,
2944
2945
  s,
2945
- m.motion_group
2946
- ), C = Object.entries(p.tcps || {}).map(
2947
- ([_, R]) => ({
2948
- id: _,
2949
- readable_name: R.name,
2950
- position: R.pose.position,
2951
- orientation: R.pose.orientation
2946
+ u.motion_group
2947
+ ), v = Object.entries(p.tcps || {}).map(
2948
+ ([x, O]) => ({
2949
+ id: x,
2950
+ readable_name: O.name,
2951
+ position: O.pose.position,
2952
+ orientation: O.pose.orientation
2952
2953
  })
2953
- ), w = n.openReconnectingWebsocket(
2954
- `/cells/${r}/controllers/${g.controller}/state-stream?response_rate=1000`
2955
- ), I = await w.firstMessage(), M = (k = O(I.data)) == null ? void 0 : k.result;
2956
- if (!M)
2954
+ ), j = n.openReconnectingWebsocket(
2955
+ `/cells/${r}/controllers/${d.controller}/state-stream?response_rate=1000`
2956
+ ), w = await j.firstMessage(), E = (k = R(w.data)) == null ? void 0 : k.result;
2957
+ if (!E)
2957
2958
  throw new Error(
2958
- `Unable to parse initial controller state message ${I.data}`
2959
+ `Unable to parse initial controller state message ${w.data}`
2959
2960
  );
2960
2961
  return console.log(
2961
- `Connected controller state websocket to controller ${g.controller}. Initial state:
2962
+ `Connected controller state websocket to controller ${d.controller}. Initial state:
2962
2963
  `,
2963
- M
2964
+ E
2964
2965
  ), new ht(
2965
2966
  n,
2966
- g,
2967
- m,
2968
2967
  d,
2968
+ u,
2969
+ g,
2969
2970
  h,
2970
2971
  f,
2971
- C,
2972
+ v,
2972
2973
  p,
2973
- M,
2974
- w,
2974
+ E,
2975
+ j,
2975
2976
  r
2976
2977
  );
2977
2978
  }
@@ -2997,7 +2998,7 @@ class ht {
2997
2998
  get dhParameters() {
2998
2999
  if (this.description.dh_parameters !== void 0)
2999
3000
  return this.description.dh_parameters.map((t) => ({
3000
- ...xo,
3001
+ ...wo,
3001
3002
  ...t
3002
3003
  }));
3003
3004
  }
@@ -3015,11 +3016,11 @@ class ht {
3015
3016
  }
3016
3017
  /** Gets the robot mounting position rotation in 3D viz coordinates */
3017
3018
  get mountingQuaternion() {
3018
- var n, r, a, s, g, m;
3019
+ var n, r, a, s, d, u;
3019
3020
  const t = new bt.Vector3(
3020
3021
  ((r = (n = this.description.mounting) == null ? void 0 : n.orientation) == null ? void 0 : r[0]) || 0,
3021
3022
  ((s = (a = this.description.mounting) == null ? void 0 : a.orientation) == null ? void 0 : s[1]) || 0,
3022
- ((m = (g = this.description.mounting) == null ? void 0 : g.orientation) == null ? void 0 : m[2]) || 0
3023
+ ((u = (d = this.description.mounting) == null ? void 0 : d.orientation) == null ? void 0 : u[2]) || 0
3023
3024
  ), o = t.length(), i = t.normalize();
3024
3025
  return new bt.Quaternion().setFromAxisAngle(i, o);
3025
3026
  }
@@ -3115,23 +3116,246 @@ class ht {
3115
3116
  this.joggingVelocity = t;
3116
3117
  }
3117
3118
  }
3118
- const _o = [
3119
+ const jo = 1e-4, Mo = /* @__PURE__ */ new Set([
3120
+ "timestamp",
3121
+ "sequence_number",
3122
+ "joint_position",
3123
+ "joint_torque",
3124
+ "joint_current",
3125
+ "flange_pose",
3126
+ "tcp_pose",
3127
+ "flange_velocity",
3128
+ "tcp_velocity"
3129
+ ]), Eo = 1, kt = (e) => Array.isArray(e) && e.length === 3 && e.every((t) => typeof t == "number");
3130
+ class Li {
3131
+ constructor(t, o, i, n = {}) {
3132
+ this.source = t, this.motionGroupId = o, this.lastMessageReceivedAt = Date.now(), this.lastInvalidStateMessage = null, this.connectionQuality = "good";
3133
+ const r = i.motion_groups.find(
3134
+ (a) => a.motion_group === o
3135
+ );
3136
+ if (!r)
3137
+ throw new Error(
3138
+ `Motion group ${o} not found in initial controller state`
3139
+ );
3140
+ this.isVirtual = n.isVirtual ?? !1, this.onError = n.onError, this.reconnectsOnFocus = (n.reconnectOnFocus ?? !0) && typeof window < "u", this.rapidlyChangingMotionState = r, this.lastValidStateMessage = {
3141
+ receivedAt: Date.now(),
3142
+ data: i
3143
+ }, Z(
3144
+ this,
3145
+ {
3146
+ source: !1,
3147
+ lastMessageReceivedAt: !1,
3148
+ connectionQualityInterval: !1,
3149
+ isVirtual: !1,
3150
+ onError: !1,
3151
+ reconnectsOnFocus: !1,
3152
+ // keepAlive: a computed nobody observes is recomputed on every read
3153
+ // without consulting `equals`, so the hold would depend on a component
3154
+ // happening to observe the readout at the time.
3155
+ readoutState: Jt({ equals: Gt, keepAlive: !0 })
3156
+ },
3157
+ { autoBind: !0 }
3158
+ ), this.source.addEventListener("message", this.handleMessage), this.connectionQualityInterval = setInterval(
3159
+ this.updateConnectionQuality,
3160
+ 500
3161
+ ), this.reconnectsOnFocus && window.addEventListener("focus", this.handleWindowFocus);
3162
+ }
3163
+ /** The controller's state as of the last message that changed it */
3164
+ get controllerState() {
3165
+ return this.lastValidStateMessage.data;
3166
+ }
3167
+ /**
3168
+ * What pose and joint readouts show. Holds the previous reading while the
3169
+ * joints only jitter, see {@link readoutsEqual}; kept alive so it also holds
3170
+ * for untracked reads.
3171
+ */
3172
+ get readoutState() {
3173
+ return Ut(this.rapidlyChangingMotionState);
3174
+ }
3175
+ /** The motion group's state in the next message of the source */
3176
+ async nextMotionState() {
3177
+ var i, n;
3178
+ const t = await this.source.nextMessage(), o = (n = (i = this.source.parse(t.data)) == null ? void 0 : i.motion_groups) == null ? void 0 : n.find((r) => r.motion_group === this.motionGroupId);
3179
+ if (!o)
3180
+ throw new Error(
3181
+ `Failed to get motion state for ${this.motionGroupId}: ${t.data}`
3182
+ );
3183
+ return o;
3184
+ }
3185
+ setLastInvalidStateMessage(t) {
3186
+ this.lastInvalidStateMessage = {
3187
+ receivedAt: Date.now(),
3188
+ data: t
3189
+ };
3190
+ }
3191
+ setLastValidStateMessage(t) {
3192
+ this.lastValidStateMessage = {
3193
+ receivedAt: Date.now(),
3194
+ data: t
3195
+ };
3196
+ }
3197
+ /**
3198
+ * Merge the latest motion state onto the existing object instead of replacing
3199
+ * it, so this stream owns exactly one live motion state object for the whole
3200
+ * time it is connected.
3201
+ *
3202
+ * Consumers subscribe to *properties* of the object they are holding — the 3D
3203
+ * animators keep it in a ref and read `joint_position` inside a MobX
3204
+ * reaction. Replacing the object leaves those reactions subscribed to an
3205
+ * orphan that never changes again, so the robot model stopped getting joint
3206
+ * targets from the stream and only moved when React happened to re-render it
3207
+ * (~5 updates/s against a ~134/s stream).
3208
+ *
3209
+ * Only fields whose value actually changed are written. A blanket
3210
+ * `Object.assign` puts a fresh object into every nested field, and MobX
3211
+ * compares with `===`, so each of `flange_pose`, `tcp_pose` and
3212
+ * `joint_limit_reached` would notify its observers on every message of a
3213
+ * ~134/s stream even while standing still. This mirrors how
3214
+ * MotionStreamConnection guards each of its own field writes.
3215
+ *
3216
+ * Fields the message does not carry are removed rather than left behind: a
3217
+ * merge must not make a stale pose read as the current one, which replacing
3218
+ * the whole object never did.
3219
+ *
3220
+ * Runs as a MobX action (see `makeAutoObservable` with `autoBind` above), so
3221
+ * the per-field writes notify observers once, as a single batch.
3222
+ *
3223
+ * `skipFields` leaves the named fields exactly as they are — neither updated
3224
+ * nor removed — which is how a standstill message updates the discrete state
3225
+ * without churning the jittery pose readings.
3226
+ */
3227
+ updateRapidlyChangingMotionState(t, o) {
3228
+ const i = this.rapidlyChangingMotionState, n = t;
3229
+ for (const r of Object.keys(n))
3230
+ o != null && o.has(r) || Dt(i[r], n[r]) || (i[r] = n[r]);
3231
+ for (const r of Object.keys(i))
3232
+ o != null && o.has(r) || r in n || delete i[r];
3233
+ }
3234
+ setConnectionQuality(t) {
3235
+ this.connectionQuality = t;
3236
+ }
3237
+ handleWindowFocus() {
3238
+ this.source.reconnect();
3239
+ }
3240
+ updateConnectionQuality() {
3241
+ const t = Date.now() - this.lastMessageReceivedAt, o = this.isVirtual ? 3e3 : 1e3, i = this.isVirtual ? 6e3 : 3e3;
3242
+ if (t > i) {
3243
+ this.source.readyState === Eo && this.source.reconnect(), this.setConnectionQuality("critical");
3244
+ return;
3245
+ }
3246
+ if (t > o) {
3247
+ this.setConnectionQuality("struggling");
3248
+ return;
3249
+ }
3250
+ this.setConnectionQuality("good");
3251
+ }
3252
+ /** Stops listening to the source; the source's owner closes it */
3253
+ dispose() {
3254
+ this.source.removeEventListener("message", this.handleMessage), clearInterval(this.connectionQualityInterval), this.reconnectsOnFocus && window.removeEventListener("focus", this.handleWindowFocus);
3255
+ }
3256
+ handleMessage(t) {
3257
+ var u, h;
3258
+ const o = this.source.parse(t.data);
3259
+ if (!(o != null && o.motion_groups)) {
3260
+ (u = this.onError) == null || u.call(this, {
3261
+ message: ue(t.data),
3262
+ url: this.source.url
3263
+ }), this.setLastInvalidStateMessage(t.data);
3264
+ return;
3265
+ }
3266
+ this.lastMessageReceivedAt = Date.now();
3267
+ const i = this.lastValidStateMessage.data;
3268
+ (i.safety_state !== o.safety_state || i.operation_mode !== o.operation_mode || i.mode !== o.mode) && this.setLastValidStateMessage(o);
3269
+ const n = o.motion_groups.find(
3270
+ (m) => m.motion_group === this.motionGroupId
3271
+ );
3272
+ if (!n) {
3273
+ (h = this.onError) == null || h.call(this, {
3274
+ message: `Motion group ${this.motionGroupId} not found in controller state: ${JSON.stringify(t.data)}`,
3275
+ url: this.source.url
3276
+ }), this.setLastInvalidStateMessage(t.data);
3277
+ return;
3278
+ }
3279
+ const r = !$t(
3280
+ this.rapidlyChangingMotionState.joint_position,
3281
+ n.joint_position,
3282
+ jo
3283
+ ), a = this.rapidlyChangingMotionState.tcp !== n.tcp;
3284
+ if (!r && !a) {
3285
+ this.updateRapidlyChangingMotionState(
3286
+ n,
3287
+ Mo
3288
+ );
3289
+ return;
3290
+ }
3291
+ const s = this.rapidlyChangingMotionState.flange_pose, d = n.flange_pose;
3292
+ if ((d == null ? void 0 : d.orientation) == null || !kt(d.orientation)) {
3293
+ const m = d == null ? void 0 : d.orientation;
3294
+ throw new Error(
3295
+ `Invalid newFlangePose.orientation: expected [number, number, number] (got ${m == null ? "null" : m.length})`
3296
+ );
3297
+ }
3298
+ if ((s == null ? void 0 : s.orientation) == null || !kt(s.orientation)) {
3299
+ const m = s == null ? void 0 : s.orientation;
3300
+ throw new Error(
3301
+ `Invalid oldFlangePose.orientation: expected [number, number, number] (got ${m == null ? "null" : m.length})`
3302
+ );
3303
+ }
3304
+ d.orientation = zt(
3305
+ d.orientation,
3306
+ s.orientation
3307
+ ), this.updateRapidlyChangingMotionState(n);
3308
+ }
3309
+ }
3310
+ function To(e) {
3311
+ return {
3312
+ get url() {
3313
+ return e.url;
3314
+ },
3315
+ get readyState() {
3316
+ return e.readyState;
3317
+ },
3318
+ addEventListener: (t, o) => e.addEventListener(t, o),
3319
+ removeEventListener: (t, o) => e.removeEventListener(t, o),
3320
+ firstMessage: () => e.firstMessage(),
3321
+ nextMessage: () => e.nextMessage(),
3322
+ reconnect: () => e.reconnect(),
3323
+ close: () => e.close(),
3324
+ parse: (t) => {
3325
+ var o;
3326
+ return (o = De(t)) == null ? void 0 : o.result;
3327
+ }
3328
+ };
3329
+ }
3330
+ function Di(e, {
3331
+ controllerId: t,
3332
+ cellId: o,
3333
+ responseRateMs: i
3334
+ }) {
3335
+ const n = N(e), r = o ?? it(e) ?? "cell", a = i === void 0 ? "" : `?response_rate=${i}`;
3336
+ return To(
3337
+ n.openReconnectingWebsocket(
3338
+ `/cells/${r}/controllers/${t}/state-stream${a}`
3339
+ )
3340
+ );
3341
+ }
3342
+ const ko = [
3119
3343
  "FeedbackOutOfWorkspace",
3120
3344
  "FeedbackJointLimitExceeded",
3121
3345
  "FeedbackAxisRangeExceeded",
3122
3346
  "FeedbackNoSolutionInCurrentConfiguration"
3123
3347
  ];
3124
- function Mi(e) {
3125
- return e === "FeedbackSingularity" ? "Jogging.TargetPose.Error.Singularity.lb" : e === "FeedbackCollision" ? "Jogging.TargetPose.Error.Collision.lb" : _o.includes(e) ? "Jogging.TargetPose.Error.NotReachable.lb" : "Jogging.TargetPose.Error.PlanningFailed.lb";
3348
+ function Vi(e) {
3349
+ return e === "FeedbackSingularity" ? "Jogging.TargetPose.Error.Singularity.lb" : e === "FeedbackCollision" ? "Jogging.TargetPose.Error.Collision.lb" : ko.includes(e) ? "Jogging.TargetPose.Error.NotReachable.lb" : "Jogging.TargetPose.Error.PlanningFailed.lb";
3126
3350
  }
3127
- class Ti {
3351
+ class $i {
3128
3352
  constructor(t) {
3129
- this.options = t, this.plannedTrajectory = null, this.trajectoryState = "idle", this.lastError = null, this.disposers = [], this.logger = t.logger ?? console, at(
3353
+ this.options = t, this.plannedTrajectory = null, this.trajectoryState = "idle", this.lastError = null, this.disposers = [], this.logger = t.logger ?? console, Z(
3130
3354
  this,
3131
3355
  { socket: !1, disposers: !1, logger: !1, options: !1 },
3132
3356
  { autoBind: !0 }
3133
3357
  ), this.socket = this.openSocket(), this.disposers.push(
3134
- re(
3358
+ ge(
3135
3359
  () => this.executionState,
3136
3360
  (o) => {
3137
3361
  o === "END_OF_TRAJECTORY" && this.reset();
@@ -3160,31 +3384,31 @@ class Ti {
3160
3384
  * the robot and when the planner cannot be reached.
3161
3385
  */
3162
3386
  async planTrajectory(t) {
3163
- var w, I, M, T, k;
3164
- if ((I = (w = this.options).isLocked) != null && I.call(w))
3387
+ var j, w, E, T, k;
3388
+ if ((w = (j = this.options).isLocked) != null && w.call(j))
3165
3389
  throw this.reset(), new Error("Cannot plan trajectory: the robot is locked");
3166
3390
  await this.ensureMovementOwnership();
3167
- const o = this.motionStream.rapidlyChangingMotionState.joint_position ?? [], { cycle_time: i, mounting: n, motion_group_model: r, tcps: a } = this.motionStream.description, s = this.joggingStore.selectedTcpId, g = s ? (M = a == null ? void 0 : a[s]) == null ? void 0 : M.pose : void 0, m = {
3391
+ const o = this.motionStream.rapidlyChangingMotionState.joint_position ?? [], { cycle_time: i, mounting: n, motion_group_model: r, tcps: a } = this.motionStream.description, s = this.joggingStore.selectedTcpId, d = s ? (E = a == null ? void 0 : a[s]) == null ? void 0 : E.pose : void 0, u = {
3168
3392
  // The model the jogger plans step jogs with: the custom copy that holds
3169
3393
  // this robot's data, if the app gave one
3170
3394
  motion_group_model: ((T = this.jogger.options) == null ? void 0 : T.motionGroupModel) ?? r,
3171
3395
  cycle_time: i ?? 0,
3172
3396
  mounting: n,
3173
- ...g && { tcp_offset: g }
3397
+ ...d && { tcp_offset: d }
3174
3398
  };
3175
3399
  let h;
3176
3400
  if (t.type === "cartesian") {
3177
- let _ = t.pose;
3178
- const R = t.coordinateSystemId || "world";
3179
- if (R !== "world")
3401
+ let x = t.pose;
3402
+ const O = t.coordinateSystemId || "world";
3403
+ if (O !== "world")
3180
3404
  try {
3181
- _ = it(
3405
+ x = rt(
3182
3406
  {
3183
3407
  pose: {
3184
- position: _.position ?? [0, 0, 0],
3185
- orientation: _.orientation ?? [0, 0, 0]
3408
+ position: x.position ?? [0, 0, 0],
3409
+ orientation: x.orientation ?? [0, 0, 0]
3186
3410
  },
3187
- coordinateSystemId: R
3411
+ coordinateSystemId: O
3188
3412
  },
3189
3413
  "world",
3190
3414
  this.joggingStore.coordSystems
@@ -3197,7 +3421,7 @@ class Ti {
3197
3421
  tcp_velocity_limit: this.joggingStore.translationVelocityMmPerSec
3198
3422
  },
3199
3423
  path: {
3200
- target_pose: _,
3424
+ target_pose: x,
3201
3425
  path_definition_name: "PathCartesianPTP"
3202
3426
  }
3203
3427
  };
@@ -3216,37 +3440,37 @@ class Ti {
3216
3440
  S(() => {
3217
3441
  this.lastError = null, this.trajectoryState = "planning";
3218
3442
  });
3219
- let u;
3443
+ let m;
3220
3444
  try {
3221
- u = await this.jogger.nova.api.trajectoryPlanning.planTrajectory(
3445
+ m = await this.jogger.nova.api.trajectoryPlanning.planTrajectory(
3222
3446
  this.jogger.cellId,
3223
3447
  {
3224
- motion_group_setup: m,
3448
+ motion_group_setup: u,
3225
3449
  start_joint_position: o,
3226
3450
  motion_commands: [h]
3227
3451
  }
3228
3452
  );
3229
- } catch (_) {
3230
- throw this.reset(), _;
3453
+ } catch (x) {
3454
+ throw this.reset(), x;
3231
3455
  }
3232
- const d = u.response;
3233
- if ("error_feedback" in d) {
3234
- const _ = ((k = d.error_feedback) == null ? void 0 : k.error_feedback_name) ?? "FeedbackUnknown";
3235
- return this.reset(), { ok: !1, errorFeedbackName: _ };
3456
+ const g = m.response;
3457
+ if ("error_feedback" in g) {
3458
+ const x = ((k = g.error_feedback) == null ? void 0 : k.error_feedback_name) ?? "FeedbackUnknown";
3459
+ return this.reset(), { ok: !1, errorFeedbackName: x };
3236
3460
  }
3237
- const l = d.joint_positions, f = l[0], p = l[l.length - 1];
3461
+ const l = g.joint_positions, f = l[0], p = l[l.length - 1];
3238
3462
  if (!f || !p)
3239
3463
  throw this.reset(), new Error("Trajectory returned invalid joint positions");
3240
- const C = {
3464
+ const v = {
3241
3465
  message_type: "InitializeMovementRequest",
3242
3466
  trajectory: {
3243
3467
  message_type: "TrajectoryData",
3244
3468
  motion_group: this.jogger.motionGroupId,
3245
3469
  tcp: s || void 0,
3246
- data: d
3470
+ data: g
3247
3471
  }
3248
3472
  };
3249
- return this.socket.sendJson(C), S(() => {
3473
+ return this.socket.sendJson(v), S(() => {
3250
3474
  this.plannedTrajectory = { startJoints: f, endJoints: p };
3251
3475
  }), { ok: !0 };
3252
3476
  }
@@ -3327,11 +3551,11 @@ class Ti {
3327
3551
  }
3328
3552
  /** Resolves once the motion stream reports that the robot stands still */
3329
3553
  async waitUntilStopped() {
3330
- await et(() => this.motionStream.rapidlyChangingMotionState.standstill);
3554
+ await ot(() => this.motionStream.rapidlyChangingMotionState.standstill);
3331
3555
  }
3332
3556
  handleMessage(t) {
3333
3557
  var i, n;
3334
- const o = (i = O(t.data)) == null ? void 0 : i.result;
3558
+ const o = (i = R(t.data)) == null ? void 0 : i.result;
3335
3559
  if (o)
3336
3560
  switch (o.kind) {
3337
3561
  case "INITIALIZE_RECEIVED":
@@ -3359,29 +3583,32 @@ class Ti {
3359
3583
  }
3360
3584
  }
3361
3585
  export {
3362
- ji as A,
3586
+ Ri as A,
3363
3587
  ht as C,
3364
3588
  pt as J,
3365
- We as L,
3366
- ut as M,
3367
- Ei as N,
3368
- Ti as T,
3369
- yo as V,
3370
- _t as a,
3371
- Ae as b,
3372
- wi as c,
3373
- nt as d,
3374
- qe as e,
3375
- Ut as f,
3376
- Ii as g,
3377
- Dt as h,
3378
- Le as i,
3379
- Ve as j,
3380
- Be as k,
3381
- ro as l,
3382
- it as m,
3383
- Mi as p,
3384
- $e as r,
3385
- Lt as t,
3386
- Fe as u
3589
+ Ke as L,
3590
+ jo as M,
3591
+ Pi as N,
3592
+ $i as T,
3593
+ vo as V,
3594
+ Li as a,
3595
+ xt as b,
3596
+ Be as c,
3597
+ Ai as d,
3598
+ at as e,
3599
+ Ye as f,
3600
+ mt as g,
3601
+ Qt as h,
3602
+ Di as i,
3603
+ Ji as j,
3604
+ $t as k,
3605
+ Nt as l,
3606
+ Ue as m,
3607
+ Gt as n,
3608
+ lo as o,
3609
+ Vi as p,
3610
+ rt as q,
3611
+ Ut as r,
3612
+ Bt as t,
3613
+ zt as u
3387
3614
  };