@wandelbots/wandelbots-js-react-components 6.4.0-pr.revamp.667.d7cab79 → 6.4.0-pr.revamp.667.df588e4

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 (154) hide show
  1. package/README.md +23 -5
  2. package/dist/3d.cjs +1 -1
  3. package/dist/3d.d.ts +11 -1
  4. package/dist/3d.js +43 -25
  5. package/dist/CurrentPose/index.cjs +1 -0
  6. package/dist/CurrentPose/index.d.ts +3 -0
  7. package/dist/CurrentPose/index.js +9 -0
  8. package/dist/CurrentPoseBar/index.cjs +1 -1
  9. package/dist/CurrentPoseBar/index.js +1 -1
  10. package/dist/JoggingButtons/index.cjs +1 -1
  11. package/dist/JoggingButtons/index.js +1 -1
  12. package/dist/JoggingGizmo/index.cjs +1 -1
  13. package/dist/JoggingGizmo/index.d.ts +1 -0
  14. package/dist/JoggingGizmo/index.js +2 -2
  15. package/dist/JoggingJointSlider/index.cjs +1 -1
  16. package/dist/JoggingJointSlider/index.js +1 -1
  17. package/dist/RobotControl/index.cjs +1 -0
  18. package/dist/RobotControl/index.d.ts +3 -0
  19. package/dist/RobotControl/index.js +9 -0
  20. package/dist/RobotControlPanel/index.cjs +1 -1
  21. package/dist/RobotControlPanel/index.js +1 -1
  22. package/dist/RobotHeader/index.cjs +1 -1
  23. package/dist/RobotHeader/index.d.ts +4 -0
  24. package/dist/RobotHeader/index.js +8 -3
  25. package/dist/RobotScene/index.cjs +1 -0
  26. package/dist/RobotScene/index.d.ts +5 -0
  27. package/dist/RobotScene/index.js +11 -0
  28. package/dist/RobotView/index.cjs +1 -0
  29. package/dist/RobotView/index.d.ts +4 -0
  30. package/dist/RobotView/index.js +9 -0
  31. package/dist/SafetyBar/index.cjs +1 -1
  32. package/dist/SafetyBar/index.d.ts +1 -0
  33. package/dist/SafetyBar/index.js +4 -3
  34. package/dist/chunks/ConnectedMotionGroup-BB2TrzPw.js +1824 -0
  35. package/dist/chunks/ConnectedMotionGroup-CJGbzAzI.cjs +3 -0
  36. package/dist/chunks/CurrentPose-B2k1YoBx.cjs +1 -0
  37. package/dist/chunks/CurrentPose-CMkPnaXN.js +52 -0
  38. package/dist/chunks/CurrentPoseBar-C4wB482_.cjs +1 -0
  39. package/dist/chunks/{CurrentPoseBar-DENCilvf.js → CurrentPoseBar-GhVif6kH.js} +9 -8
  40. package/dist/chunks/{JoggingButtons-CXaozFVz.js → JoggingButtons-D4S2oJGt.js} +1 -1
  41. package/dist/chunks/{JoggingButtons-CbL-5LMK.cjs → JoggingButtons-nXLqJLIr.cjs} +1 -1
  42. package/dist/chunks/{JoggingGizmo-SuS9MmL7.js → JoggingGizmo-9wEBSe1P.js} +301 -280
  43. package/dist/chunks/JoggingGizmo-BJ3wDpAJ.cjs +1 -0
  44. package/dist/chunks/{JoggingGizmoOrientation-dzned4f4.cjs → JoggingGizmoOrientation-D9VS6nag.cjs} +1 -1
  45. package/dist/chunks/{JoggingGizmoOrientation-x_crT_64.js → JoggingGizmoOrientation-DYeHwowd.js} +1 -1
  46. package/dist/chunks/{JoggingJointSlider-R3_A9Ppj.cjs → JoggingJointSlider-D7AsxkrT.cjs} +1 -1
  47. package/dist/chunks/{JoggingJointSlider-CZ-k6XCa.js → JoggingJointSlider-DQneQhXH.js} +1 -1
  48. package/dist/chunks/JoggingRefusedError-2q4x_fDF.cjs +1 -0
  49. package/dist/chunks/JoggingRefusedError-M954yLQO.js +23 -0
  50. package/dist/chunks/Pose3-B_fLR-Wv.js +80 -0
  51. package/dist/chunks/Pose3-Ch4xVeXV.cjs +1 -0
  52. package/dist/chunks/PoseTransformer-C_EfofnJ.cjs +1 -0
  53. package/dist/chunks/PoseTransformer-MLAm4_Ad.js +364 -0
  54. package/dist/chunks/Robot-B1j3VKwk.js +428 -0
  55. package/dist/chunks/Robot-v8trFpVT.cjs +1 -0
  56. package/dist/chunks/RobotActivation-Bb0oNSBN.cjs +1 -0
  57. package/dist/chunks/RobotActivation-C0rrwpQZ.js +115 -0
  58. package/dist/chunks/RobotControl-4ma8Yxer.cjs +1 -0
  59. package/dist/chunks/RobotControl-pDmJH_ah.js +282 -0
  60. package/dist/chunks/{RobotControlPanel-E-hUzMIL.js → RobotControlPanel-BE-C6lYj.js} +252 -249
  61. package/dist/chunks/RobotControlPanel-CIaClXfc.cjs +1 -0
  62. package/dist/chunks/RobotScene-CldpfxRT.js +1255 -0
  63. package/dist/chunks/RobotScene-ztJZ4EKT.cjs +1 -0
  64. package/dist/chunks/RobotSessionProvider--AekyPqD.cjs +1 -0
  65. package/dist/chunks/RobotSessionProvider-TVaKGzqa.js +25 -0
  66. package/dist/chunks/RobotView-BTL3FAIE.js +158 -0
  67. package/dist/chunks/RobotView-wketM8bf.cjs +1 -0
  68. package/dist/chunks/coordSystemLabel-BThpFG9n.cjs +1 -0
  69. package/dist/chunks/coordSystemLabel-Bfy9MUsV.js +6 -0
  70. package/dist/chunks/externalizeComponent-BW1UV6Gh.cjs +2 -0
  71. package/dist/chunks/{externalizeComponent-_w2d1_pz.js → externalizeComponent-TgclPxwg.js} +34 -10
  72. package/dist/chunks/json-3cqBD7UQ.js +18 -0
  73. package/dist/chunks/json-Bd6uGfgP.cjs +1 -0
  74. package/dist/chunks/loadRobotSession-Br55rLAm.cjs +1 -0
  75. package/dist/chunks/loadRobotSession-CbIAb7KE.js +2721 -0
  76. package/dist/chunks/poseText-BXUaQWnK.cjs +1 -0
  77. package/dist/chunks/poseText-pg4cxE8R.js +41 -0
  78. package/dist/chunks/robotActivationOf-BKoP11GA.js +368 -0
  79. package/dist/chunks/robotActivationOf-vhmAEc3e.cjs +1 -0
  80. package/dist/chunks/{SafetyBar-eYzCHOFD.js → robotSafetyOf-BmZMcgc_.js} +45 -35
  81. package/dist/chunks/robotSafetyOf-CZBuhHgO.cjs +1 -0
  82. package/dist/chunks/useEveryFrame-D04ygIe7.js +116 -0
  83. package/dist/chunks/useEveryFrame-NeKiPXY-.cjs +1 -0
  84. package/dist/chunks/useSmoothedMotionState-B9WO73k0.cjs +1 -0
  85. package/dist/chunks/useSmoothedMotionState-BSSV8aZN.js +202 -0
  86. package/dist/chunks/useWebGLRenderer-BozrbZz-.js +45 -0
  87. package/dist/chunks/useWebGLRenderer-CtddVDDb.cjs +1 -0
  88. package/dist/components/connectionWarning/ConnectionWarning.d.ts +21 -0
  89. package/dist/components/connectionWarning/connectionWarningOf.d.ts +11 -0
  90. package/dist/components/connectionWarning/timeAgo.d.ts +5 -0
  91. package/dist/components/currentPoseBar/CurrentPose.d.ts +23 -0
  92. package/dist/components/currentPoseBar/useCurrentPoseProps.d.ts +16 -0
  93. package/dist/components/jogging/JoggingRefusedError.d.ts +19 -0
  94. package/dist/components/jogging/JoggingStore.d.ts +98 -3
  95. package/dist/components/jogging/coordSystemLabel.d.ts +7 -0
  96. package/dist/components/jogging/gizmo/JoggingGizmo.d.ts +8 -1
  97. package/dist/components/robotControl/JogArea.d.ts +5 -2
  98. package/dist/components/robotControl/RobotControl.d.ts +23 -0
  99. package/dist/components/robotControl/useRobotControlProps.d.ts +34 -0
  100. package/dist/components/robotHeader/robotActivationOf.d.ts +8 -0
  101. package/dist/components/robotHeader/robotSafetyOf.d.ts +11 -0
  102. package/dist/components/robotScene/JoggingAxes.d.ts +38 -0
  103. package/dist/components/robotScene/RobotScene.d.ts +28 -0
  104. package/dist/components/robotScene/RobotSceneView.d.ts +53 -0
  105. package/dist/components/robotScene/useRobotSceneProps.d.ts +18 -0
  106. package/dist/components/robotSession/RobotSessionProvider.d.ts +13 -0
  107. package/dist/components/robotView/RobotCanvas.d.ts +42 -0
  108. package/dist/components/robotView/RobotView.d.ts +23 -0
  109. package/dist/components/robotView/WebGLUnavailable.d.ts +5 -0
  110. package/dist/components/robots/DHRobot.d.ts +1 -1
  111. package/dist/components/robots/GenericRobot.d.ts +16 -1
  112. package/dist/components/robots/LinearAxisAnimator.d.ts +1 -1
  113. package/dist/components/robots/SupportedLinearAxis.d.ts +16 -3
  114. package/dist/components/robots/SupportedRobot.d.ts +21 -3
  115. package/dist/components/robots/ghostStyle.d.ts +21 -0
  116. package/dist/components/robots/modelRotation.d.ts +14 -0
  117. package/dist/components/robots/robotModelLogic.d.ts +138 -6
  118. package/dist/components/robots/robotModelSource.d.ts +14 -1
  119. package/dist/components/utils/converters.d.ts +0 -2
  120. package/dist/components/utils/json.d.ts +4 -0
  121. package/dist/components/utils/useWebGLRenderer.d.ts +32 -0
  122. package/dist/components/utils/webglSupport.d.ts +11 -0
  123. package/dist/core.cjs +1 -1
  124. package/dist/core.d.ts +8 -0
  125. package/dist/core.js +79 -64
  126. package/dist/index.cjs +1 -1
  127. package/dist/index.js +121 -88
  128. package/dist/lib/incrementalCartesianMotion.d.ts +2 -2
  129. package/dist/lib/poseMath.d.ts +51 -0
  130. package/dist/lib/robotSession/RobotActivation.d.ts +13 -2
  131. package/dist/lib/robotSession/RobotSession.d.ts +19 -1
  132. package/dist/nats.cjs +1 -1
  133. package/dist/nats.js +1 -1
  134. package/dist/session.cjs +1 -0
  135. package/dist/session.d.ts +22 -0
  136. package/dist/session.js +44 -0
  137. package/package.json +6 -1
  138. package/dist/chunks/CurrentPoseBar-DrXTcV-I.cjs +0 -1
  139. package/dist/chunks/JoggingGizmo-DGbFLWgT.cjs +0 -1
  140. package/dist/chunks/Pose3-DIyg-aZA.cjs +0 -1
  141. package/dist/chunks/Pose3-pocKPrHN.js +0 -292
  142. package/dist/chunks/RobotControlPanel-DTE8-v2j.cjs +0 -1
  143. package/dist/chunks/RobotHeader-BvIzk8Fw.js +0 -244
  144. package/dist/chunks/RobotHeader-Daft80jq.cjs +0 -1
  145. package/dist/chunks/SafetyBar-BVk-SH_0.cjs +0 -1
  146. package/dist/chunks/converters-BsXgcxCW.cjs +0 -1
  147. package/dist/chunks/converters-D9KpJ2HD.js +0 -47
  148. package/dist/chunks/externalizeComponent-BdxGBLIv.cjs +0 -2
  149. package/dist/chunks/loadRobotSession-DlRzFjYE.cjs +0 -3
  150. package/dist/chunks/loadRobotSession-kKQ96rWu.js +0 -4721
  151. package/dist/chunks/robotModelSource-Bv1Z_miZ.cjs +0 -1
  152. package/dist/chunks/robotModelSource-CKuBOeQ-.js +0 -1295
  153. package/dist/chunks/useEveryFrame-B8t_yz-G.js +0 -155
  154. package/dist/chunks/useEveryFrame-CHxg25f4.cjs +0 -1
@@ -0,0 +1,1824 @@
1
+ import { jsxs as p, Fragment as Z, jsx as o } from "react/jsx-runtime";
2
+ import St from "@mui/material/AppBar";
3
+ import ut from "@mui/material/Backdrop";
4
+ import O from "@mui/material/Box";
5
+ import wt from "@mui/material/Menu";
6
+ import V from "@mui/material/MenuItem";
7
+ import Mt from "@mui/material/Toolbar";
8
+ import C from "@mui/material/Typography";
9
+ import { ZeroGravityComponentsBackdropFill as jt } from "@wandelbots/design-tokens";
10
+ import { ExpandMoreFilled as Tt } from "@wandelbots/icons/ExpandMoreFilled";
11
+ import { RoundedIconButton as Et } from "@wandelbots/mui";
12
+ import { observer as M, useLocalObservable as pt } from "mobx-react-lite";
13
+ import * as b from "react";
14
+ import { useState as G, forwardRef as L, useEffect as K, useRef as q, useId as kt } from "react";
15
+ import { e as H } from "./externalizeComponent-TgclPxwg.js";
16
+ import It from "@mui/icons-material/OpenWith";
17
+ import Jt from "@mui/icons-material/Share";
18
+ import v from "@mui/material/Stack";
19
+ import Rt from "@mui/material/Tab";
20
+ import _t from "@mui/material/Tabs";
21
+ import { runInAction as w, makeAutoObservable as Pt } from "mobx";
22
+ import { useTranslation as _ } from "react-i18next";
23
+ import { O as Ot, J as At, a as Vt, n as Dt, t as Lt } from "./loadRobotSession-CbIAb7KE.js";
24
+ import mt from "@mui/material/CircularProgress";
25
+ import { capitalize as $t } from "@mui/material/utils";
26
+ import { lowerFirst as Bt } from "lodash-es";
27
+ import { m as zt } from "./robotSafetyOf-BmZMcgc_.js";
28
+ import Ft from "@mui/material/Alert";
29
+ import Nt from "@mui/material/AlertTitle";
30
+ import et from "@mui/material/Button";
31
+ import { useTheme as $, styled as ht } from "@mui/material/styles";
32
+ import D from "@mui/material/Divider";
33
+ import rt from "@mui/material/ToggleButton";
34
+ import { radiansToDegrees as ft, XYZ_TO_VECTOR as at, degreesToRadians as Gt, tryParseJson as W } from "@wandelbots/nova-js";
35
+ import X from "@mui/material/IconButton";
36
+ import { c as nt } from "./useSmoothedMotionState-BSSV8aZN.js";
37
+ import { e as lt, v as Ht, c as Q } from "./joggingColors-CuT5u0H8.js";
38
+ import Wt from "lodash-es/isEqual.js";
39
+ import Ut from "@mui/material/InputAdornment";
40
+ import Yt from "@mui/material/FormControl";
41
+ import Zt from "@mui/material/InputLabel";
42
+ import Kt from "@mui/material/Select";
43
+ import Xt from "@mui/material/ToggleButtonGroup";
44
+ import xt from "@mui/material/Slider";
45
+ import qt from "lodash-es/isNumber.js";
46
+ import { JointTypeEnum as U } from "@wandelbots/nova-js/v2";
47
+ import Qt from "@mui/icons-material/ChevronLeft";
48
+ import te from "@mui/icons-material/ChevronRight";
49
+ import ee from "lodash-es/throttle.js";
50
+ import oe from "@mui/material/Dialog";
51
+ import ne from "@mui/material/DialogActions";
52
+ import ie from "@mui/material/DialogContent";
53
+ import re from "@mui/material/DialogTitle";
54
+ import * as ct from "three";
55
+ import { g as tt, h as st } from "./PoseTransformer-MLAm4_Ad.js";
56
+ const Ro = H(
57
+ M((t) => {
58
+ const {
59
+ appIcon: e,
60
+ appName: n,
61
+ apps: r = [],
62
+ onAppSelect: a,
63
+ disabled: c = !1,
64
+ sx: d
65
+ } = t, [i, g] = G(null), m = !!i, y = (l) => {
66
+ g(l.currentTarget);
67
+ }, u = () => {
68
+ g(null);
69
+ }, s = (l) => {
70
+ u(), l.onClick ? l.onClick() : l.href && (window.location.href = l.href), a == null || a(l);
71
+ };
72
+ return /* @__PURE__ */ p(Z, { children: [
73
+ /* @__PURE__ */ o(
74
+ St,
75
+ {
76
+ position: "static",
77
+ sx: {
78
+ boxShadow: "none",
79
+ backgroundImage: "none",
80
+ "& .MuiAppBar-root": {
81
+ backgroundImage: "none",
82
+ backgroundColor: "transparent"
83
+ },
84
+ ...d
85
+ },
86
+ children: /* @__PURE__ */ p(Mt, { sx: { minHeight: "62px !important" }, children: [
87
+ /* @__PURE__ */ o(O, { sx: { mr: 1, display: "flex", alignItems: "center" }, children: e }),
88
+ /* @__PURE__ */ p(O, { sx: { display: "flex", alignItems: "center", flexGrow: 1 }, children: [
89
+ /* @__PURE__ */ o(C, { component: "h1", variant: "subtitle1", children: n }),
90
+ r.length > 0 && /* @__PURE__ */ o(
91
+ Et,
92
+ {
93
+ icon: /* @__PURE__ */ o(Tt, { size: 20 }),
94
+ ariaLabel: "switch app",
95
+ "aria-controls": "app-menu",
96
+ "aria-haspopup": "true",
97
+ onClick: y,
98
+ disabled: c,
99
+ sx: { ml: 1 }
100
+ }
101
+ )
102
+ ] })
103
+ ] })
104
+ }
105
+ ),
106
+ /* @__PURE__ */ o(
107
+ ut,
108
+ {
109
+ open: m,
110
+ onClick: u,
111
+ sx: {
112
+ backdropFilter: "blur(4px)",
113
+ backgroundColor: jt,
114
+ zIndex: (l) => l.zIndex.modal - 1
115
+ }
116
+ }
117
+ ),
118
+ /* @__PURE__ */ o(
119
+ wt,
120
+ {
121
+ id: "app-menu",
122
+ anchorEl: i,
123
+ open: m,
124
+ onClose: u,
125
+ anchorOrigin: {
126
+ vertical: "bottom",
127
+ horizontal: "left"
128
+ },
129
+ transformOrigin: {
130
+ vertical: "top",
131
+ horizontal: "left"
132
+ },
133
+ sx: {
134
+ zIndex: (l) => l.zIndex.modal,
135
+ "& .MuiPaper-root": {
136
+ minWidth: 200,
137
+ mt: 1
138
+ }
139
+ },
140
+ children: r.map((l) => /* @__PURE__ */ p(V, { onClick: () => s(l), children: [
141
+ /* @__PURE__ */ o(O, { sx: { display: "flex", alignItems: "center" }, children: l.icon }),
142
+ /* @__PURE__ */ o(C, { variant: "body1", sx: { ml: 2 }, children: l.name })
143
+ ] }, l.id))
144
+ }
145
+ )
146
+ ] });
147
+ })
148
+ ), ae = ({
149
+ title: t,
150
+ titleId: e,
151
+ ...n
152
+ }, r) => /* @__PURE__ */ b.createElement("svg", { width: 21, height: 21, viewBox: "0 0 21 21", fill: "none", xmlns: "http://www.w3.org/2000/svg", ref: r, "aria-labelledby": e, ...n }, t ? /* @__PURE__ */ b.createElement("title", { id: e }, t) : null, /* @__PURE__ */ b.createElement("g", { id: "JogMinus" }, /* @__PURE__ */ b.createElement("path", { id: "Minus", d: "M0 13V8H21V13H0Z", fill: "white" }))), le = L(ae), ce = ({
153
+ title: t,
154
+ titleId: e,
155
+ ...n
156
+ }, r) => /* @__PURE__ */ b.createElement("svg", { width: 21, height: 21, viewBox: "0 0 21 21", fill: "none", xmlns: "http://www.w3.org/2000/svg", ref: r, "aria-labelledby": e, ...n }, t ? /* @__PURE__ */ b.createElement("title", { id: e }, t) : null, /* @__PURE__ */ b.createElement("g", { id: "JogPlus" }, /* @__PURE__ */ b.createElement("g", { id: "Plus" }, /* @__PURE__ */ b.createElement("path", { d: "M0 13V8H8V13H0Z", fill: "white" }), /* @__PURE__ */ b.createElement("path", { d: "M8 0L13 2.18557e-07L13 21H8L8 0Z", fill: "white" }), /* @__PURE__ */ b.createElement("path", { d: "M13 13V8H21V13H13Z", fill: "white" })))), se = L(ce), dt = H(
157
+ M(
158
+ ({
159
+ colors: t,
160
+ label: e,
161
+ getDisplayedValue: n,
162
+ startJogging: r,
163
+ stopJogging: a,
164
+ disabled: c,
165
+ activeJoggingDirection: d,
166
+ ...i
167
+ }) => {
168
+ var E, k, I, J, R, B, z;
169
+ nt(() => {
170
+ const T = n(), P = s.current;
171
+ P && (P.textContent = T);
172
+ });
173
+ const g = $(), [m, y] = G(null);
174
+ K(() => {
175
+ c && j();
176
+ }, [c]);
177
+ const u = d || m, s = q(null);
178
+ t || (t = {
179
+ color: "#fff",
180
+ backgroundColor: "#000",
181
+ borderColor: "#000",
182
+ buttonBackgroundColor: {
183
+ disabled: "#000",
184
+ default: "#000",
185
+ hovered: "#000",
186
+ pressed: "#000"
187
+ },
188
+ labelColor: "#000"
189
+ });
190
+ const l = u ? (E = t.buttonBackgroundColor) == null ? void 0 : E.pressed : t.borderColor, x = {
191
+ width: "55px",
192
+ color: t.color,
193
+ path: { fill: t.color },
194
+ alignContent: "center",
195
+ fontSize: "37px",
196
+ svg: {
197
+ pointerEvents: "none"
198
+ }
199
+ }, h = {
200
+ ...x,
201
+ backgroundColor: (k = t.buttonBackgroundColor) == null ? void 0 : k.default,
202
+ ":hover": {
203
+ backgroundColor: (I = t.buttonBackgroundColor) == null ? void 0 : I.hovered
204
+ },
205
+ ":active": {
206
+ backgroundColor: (J = t.buttonBackgroundColor) == null ? void 0 : J.pressed,
207
+ color: t.backgroundColor,
208
+ path: { fill: t.backgroundColor }
209
+ },
210
+ ":disabled": {
211
+ backgroundColor: (R = t.buttonBackgroundColor) == null ? void 0 : R.disabled,
212
+ "svg path": { fill: g.palette.action.disabled }
213
+ }
214
+ }, S = {
215
+ ...x,
216
+ backgroundColor: (B = t.buttonBackgroundColor) == null ? void 0 : B.pressed,
217
+ color: t.backgroundColor,
218
+ path: { fill: t.backgroundColor },
219
+ ":disabled": {
220
+ backgroundColor: (z = t.buttonBackgroundColor) == null ? void 0 : z.pressed,
221
+ "svg path": { fill: g.palette.action.disabled }
222
+ }
223
+ };
224
+ function A(T, P) {
225
+ c || T.button === 0 && (y(P), r(P));
226
+ }
227
+ function j() {
228
+ y(null), a();
229
+ }
230
+ return /* @__PURE__ */ p(v, { height: "64px", direction: "row", justifyContent: "center", ...i, children: [
231
+ /* @__PURE__ */ o(
232
+ X,
233
+ {
234
+ disabled: c,
235
+ disableRipple: !0,
236
+ onPointerDown: (T) => A(T, "-"),
237
+ onPointerUp: j,
238
+ onPointerOut: j,
239
+ size: "large",
240
+ sx: {
241
+ ...u === "-" ? S : h,
242
+ borderRadius: "16px 0px 0px 16px",
243
+ borderLeft: `2px solid ${l ?? "#fff"}`,
244
+ borderBottom: `2px solid ${l ?? "#fff"}`,
245
+ borderTop: `2px solid ${l ?? "#fff"}`
246
+ },
247
+ children: /* @__PURE__ */ o(le, {})
248
+ }
249
+ ),
250
+ /* @__PURE__ */ p(
251
+ v,
252
+ {
253
+ spacing: "6px",
254
+ sx: {
255
+ width: "150px",
256
+ backgroundColor: t.backgroundColor,
257
+ alignItems: "center",
258
+ justifyContent: "center",
259
+ opacity: "0.9",
260
+ borderBottom: `2px solid ${l ?? "#fff"}`,
261
+ borderTop: `2px solid ${l ?? "#fff"}`
262
+ },
263
+ children: [
264
+ /* @__PURE__ */ o(
265
+ v,
266
+ {
267
+ height: "22px",
268
+ direction: "row",
269
+ alignItems: "center",
270
+ justifyItems: "center",
271
+ spacing: 1,
272
+ sx: {
273
+ userSelect: "none",
274
+ color: t.color,
275
+ ".MuiTypography-root": {
276
+ fontWeight: 700,
277
+ ...c ? { color: g.palette.action.disabled } : {}
278
+ },
279
+ ...c ? { "svg path": { fill: g.palette.action.disabled } } : {}
280
+ },
281
+ children: e
282
+ }
283
+ ),
284
+ /* @__PURE__ */ o(
285
+ C,
286
+ {
287
+ height: "22px",
288
+ sx: {
289
+ fontSize: "15px",
290
+ color: c ? g.palette.action.disabled : t.color,
291
+ fontWeight: 700,
292
+ fontVariantNumeric: "tabular-nums",
293
+ minWidth: "80px",
294
+ textAlign: "center"
295
+ },
296
+ ref: s,
297
+ children: n()
298
+ }
299
+ )
300
+ ]
301
+ }
302
+ ),
303
+ /* @__PURE__ */ o(
304
+ X,
305
+ {
306
+ disableRipple: !0,
307
+ disabled: c,
308
+ onPointerDown: (T) => A(T, "+"),
309
+ onPointerUp: j,
310
+ onPointerOut: j,
311
+ size: "large",
312
+ sx: {
313
+ ...u === "+" ? S : h,
314
+ borderRadius: "0px 16px 16px 0px",
315
+ borderRight: `2px solid ${l ?? "#fff"}`,
316
+ borderBottom: `2px solid ${l ?? "#fff"}`,
317
+ borderTop: `2px solid ${l ?? "#fff"}`
318
+ },
319
+ children: /* @__PURE__ */ o(se, {})
320
+ }
321
+ )
322
+ ] });
323
+ }
324
+ )
325
+ ), de = H(
326
+ M(
327
+ ({
328
+ startJogging: t,
329
+ stopJogging: e,
330
+ lowerLimit: n,
331
+ upperLimit: r,
332
+ useDegree: a,
333
+ getValue: c,
334
+ disabled: d,
335
+ ...i
336
+ }) => {
337
+ var J, R, B, z, T, P, it;
338
+ const { t: g } = _(), [m, y] = G(), u = $(), s = {
339
+ background: (J = u.palette.backgroundPaperElevation) == null ? void 0 : J[4],
340
+ color: (R = u.palette.backgroundPaperElevation) == null ? void 0 : R[11]
341
+ }, l = pt(() => ({
342
+ activeJoggingDir: null,
343
+ startJogging(f) {
344
+ this.activeJoggingDir = f, t(f);
345
+ },
346
+ stopJogging() {
347
+ this.activeJoggingDir = null, e();
348
+ }
349
+ })), x = ee(() => {
350
+ const f = a ? h(c()) : c();
351
+ (f === void 0 || m === void 0 || Math.abs(m - f) > 1e-9) && y(f);
352
+ }, 50);
353
+ nt(x);
354
+ function h(f) {
355
+ if (f !== void 0)
356
+ return ft(f);
357
+ }
358
+ function S(f) {
359
+ f.button === 0 && l.startJogging("-");
360
+ }
361
+ function A(f) {
362
+ f.button === 0 && l.startJogging("+");
363
+ }
364
+ function j(f) {
365
+ l.stopJogging();
366
+ }
367
+ function E(f) {
368
+ l.stopJogging();
369
+ }
370
+ function k(f, F = 1) {
371
+ if (f === void 0 || Number.isNaN(f)) return "";
372
+ const N = g("General.degree.variable", {
373
+ amount: f.toFixed(F)
374
+ });
375
+ return f > 0 && F === 0 ? `+${N}` : N;
376
+ }
377
+ function I(f, F = 1) {
378
+ if (f === void 0 || Number.isNaN(f)) return "";
379
+ const N = g("General.mm.variable", {
380
+ amount: f.toFixed(F)
381
+ });
382
+ return f > 0 && F === 0 ? `+${N}` : N;
383
+ }
384
+ return /* @__PURE__ */ p(
385
+ v,
386
+ {
387
+ height: "64px",
388
+ width: "100%",
389
+ maxWidth: "260px",
390
+ direction: "row",
391
+ ...i,
392
+ sx: {
393
+ "& .MuiIconButton-root": {
394
+ width: "52px",
395
+ color: u.palette.text.primary,
396
+ alignContent: "center",
397
+ backgroundColor: (B = u.palette.backgroundPaperElevation) == null ? void 0 : B[11],
398
+ "& svg": {
399
+ width: "42px",
400
+ height: "42px"
401
+ },
402
+ "&.Mui-disabled": {
403
+ backgroundColor: (z = u.palette.backgroundPaperElevation) == null ? void 0 : z[11],
404
+ color: u.palette.action.disabled,
405
+ opacity: 1
406
+ },
407
+ "&:hover": {
408
+ backgroundColor: (T = u.palette.backgroundPaperElevation) == null ? void 0 : T[9]
409
+ },
410
+ "&:active": {
411
+ ...s
412
+ }
413
+ }
414
+ },
415
+ children: [
416
+ /* @__PURE__ */ o(
417
+ X,
418
+ {
419
+ onPointerDown: S,
420
+ onPointerUp: j,
421
+ onPointerOut: E,
422
+ disabled: d,
423
+ disableRipple: !0,
424
+ sx: {
425
+ borderRadius: "16px 0px 0px 16px",
426
+ ...l.activeJoggingDir === "-" ? s : {}
427
+ },
428
+ children: /* @__PURE__ */ o(
429
+ Qt,
430
+ {
431
+ sx: {
432
+ pointerEvents: "none",
433
+ color: lt
434
+ }
435
+ }
436
+ )
437
+ }
438
+ ),
439
+ /* @__PURE__ */ p(
440
+ v,
441
+ {
442
+ flexGrow: 1,
443
+ alignItems: "center",
444
+ justifyContent: "center",
445
+ sx: {
446
+ borderStyle: "solid",
447
+ borderLeftWidth: 0,
448
+ borderRightWidth: 0,
449
+ border: "none",
450
+ backgroundColor: (P = u.palette.backgroundPaperElevation) == null ? void 0 : P[11],
451
+ paddingLeft: "20px",
452
+ paddingRight: "20px",
453
+ zIndex: 1
454
+ },
455
+ children: [
456
+ /* @__PURE__ */ o(
457
+ C,
458
+ {
459
+ sx: {
460
+ fontSize: "15px",
461
+ fontWeight: 700,
462
+ position: "relative",
463
+ top: "5px",
464
+ fontVariantNumeric: "tabular-nums",
465
+ minWidth: "80px",
466
+ textAlign: "center",
467
+ color: d ? u.palette.action.disabled : u.palette.text.primary
468
+ },
469
+ children: a ? k(m) : I(m)
470
+ }
471
+ ),
472
+ /* @__PURE__ */ o(
473
+ xt,
474
+ {
475
+ disabled: !0,
476
+ "aria-label": "Joint position",
477
+ min: a ? h(n) : n,
478
+ max: a ? h(r) : r,
479
+ value: m || 0,
480
+ track: !1,
481
+ sx: {
482
+ "& .MuiSlider-mark": {
483
+ display: "none"
484
+ },
485
+ "& .MuiSlider-thumb": {
486
+ width: "5px",
487
+ height: "12px",
488
+ borderRadius: "2px",
489
+ color: d ? u.palette.action.disabled : u.palette.text.primary
490
+ },
491
+ "& .MuiSlider-markLabel": {
492
+ top: "20px",
493
+ fontSize: "12px",
494
+ color: d ? u.palette.action.disabled : u.palette.text.secondary
495
+ },
496
+ "& .MuiSlider-rail": {
497
+ backgroundColor: (it = u.palette.backgroundPaperElevation) == null ? void 0 : it[5],
498
+ opacity: 1
499
+ }
500
+ },
501
+ marks: n !== void 0 && r !== void 0 && [
502
+ {
503
+ value: a ? h(n) : n,
504
+ label: a ? k(h(n), 0) : I(n)
505
+ },
506
+ {
507
+ value: a ? h(r) : r,
508
+ label: a ? k(h(r), 0) : I(r)
509
+ }
510
+ ]
511
+ }
512
+ )
513
+ ]
514
+ }
515
+ ),
516
+ /* @__PURE__ */ o(
517
+ X,
518
+ {
519
+ onPointerDown: A,
520
+ onPointerUp: j,
521
+ onPointerOut: E,
522
+ disabled: d,
523
+ disableRipple: !0,
524
+ sx: {
525
+ borderRadius: "0px 16px 16px 0px",
526
+ ...l.activeJoggingDir === "+" ? s : {}
527
+ },
528
+ children: /* @__PURE__ */ o(
529
+ te,
530
+ {
531
+ sx: {
532
+ pointerEvents: "none",
533
+ color: lt
534
+ }
535
+ }
536
+ )
537
+ }
538
+ )
539
+ ]
540
+ }
541
+ );
542
+ }
543
+ )
544
+ ), ge = (t) => {
545
+ const e = t.softTimeout || 3e3, [n, r] = G(!1);
546
+ return K(() => {
547
+ const a = setTimeout(() => {
548
+ r(!0);
549
+ }, e);
550
+ return () => clearTimeout(a);
551
+ }), /* @__PURE__ */ o(
552
+ v,
553
+ {
554
+ width: "100%",
555
+ height: "100%",
556
+ alignItems: "center",
557
+ justifyContent: "center",
558
+ sx: { color: "text.primary" },
559
+ children: t.error ? /* @__PURE__ */ o(
560
+ ue,
561
+ {
562
+ loadingMessage: t.message,
563
+ error: t.error
564
+ }
565
+ ) : /* @__PURE__ */ p(Z, { children: [
566
+ /* @__PURE__ */ o(mt, { sx: { mb: 3 } }),
567
+ !!t.message && /* @__PURE__ */ o(C, { variant: "body1", children: t.message }),
568
+ /* @__PURE__ */ o(
569
+ C,
570
+ {
571
+ variant: "body2",
572
+ sx: {
573
+ visibility: n ? "visible" : "hidden",
574
+ mt: 2,
575
+ color: "text.secondary"
576
+ },
577
+ children: "This is taking longer than expected..."
578
+ }
579
+ )
580
+ ] })
581
+ }
582
+ );
583
+ }, ue = (t) => {
584
+ const e = zt(t.error), n = t.error instanceof Error ? t.error.stack : null;
585
+ return /* @__PURE__ */ p(
586
+ v,
587
+ {
588
+ sx: {
589
+ maxHeight: "100%",
590
+ maxWidth: "min(100%, 800px)",
591
+ p: 2,
592
+ overflow: "auto",
593
+ color: "error.main"
594
+ },
595
+ children: [
596
+ /* @__PURE__ */ o(C, { variant: "body1", children: (t.loadingMessage ? `Error while ${Bt($t(t.loadingMessage))} - ` : "") + e }),
597
+ n && /* @__PURE__ */ o(
598
+ O,
599
+ {
600
+ component: "pre",
601
+ sx: {
602
+ typography: "body2",
603
+ fontFamily: "monospace",
604
+ whiteSpace: "pre-wrap",
605
+ wordBreak: "break-word",
606
+ mt: 2,
607
+ pb: 6
608
+ },
609
+ children: n
610
+ }
611
+ )
612
+ ]
613
+ }
614
+ );
615
+ }, pe = M(({ store: t }) => {
616
+ const { t: e } = _();
617
+ return /* @__PURE__ */ o(
618
+ ut,
619
+ {
620
+ "data-testid": "jogging-blocked",
621
+ "aria-label": "jogging-blocked",
622
+ open: !0,
623
+ sx: {
624
+ position: "absolute",
625
+ zIndex: (n) => n.zIndex.drawer + 1,
626
+ color: "#fff",
627
+ background: "rgba(15, 15, 15, 0.88)",
628
+ justifyContent: "flex-start",
629
+ alignItems: "flex-start"
630
+ },
631
+ children: /* @__PURE__ */ p(v, { sx: { m: 2, width: "100%" }, children: [
632
+ /* @__PURE__ */ p(Ft, { severity: "error", sx: { mb: 2 }, children: [
633
+ /* @__PURE__ */ o(Nt, { children: e("Jogging.Blocked.ti") }),
634
+ e("Jogging.Blocked.lb")
635
+ ] }),
636
+ /* @__PURE__ */ o(
637
+ et,
638
+ {
639
+ variant: "contained",
640
+ color: "secondary",
641
+ onClick: () => t.unblock(),
642
+ children: e("Jogging.Blocked.Reenable.bt")
643
+ }
644
+ )
645
+ ] })
646
+ }
647
+ );
648
+ }), me = ({
649
+ title: t,
650
+ titleId: e,
651
+ ...n
652
+ }, r) => /* @__PURE__ */ b.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 19, height: 10, fill: "none", ref: r, "aria-labelledby": e, ...n }, t ? /* @__PURE__ */ b.createElement("title", { id: e }, t) : null, /* @__PURE__ */ b.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" })), he = L(me), fe = ({
653
+ title: t,
654
+ titleId: e,
655
+ ...n
656
+ }, r) => /* @__PURE__ */ b.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 19, height: 10, fill: "none", ref: r, "aria-labelledby": e, ...n }, t ? /* @__PURE__ */ b.createElement("title", { id: e }, t) : null, /* @__PURE__ */ b.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 = L(fe), be = ({
657
+ title: t,
658
+ titleId: e,
659
+ ...n
660
+ }, r) => /* @__PURE__ */ b.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 10, height: 19, fill: "none", ref: r, "aria-labelledby": e, ...n }, t ? /* @__PURE__ */ b.createElement("title", { id: e }, t) : null, /* @__PURE__ */ b.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" })), ve = L(be), ye = ({
661
+ title: t,
662
+ titleId: e,
663
+ ...n
664
+ }, r) => /* @__PURE__ */ b.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ref: r, "aria-labelledby": e, ...n }, t ? /* @__PURE__ */ b.createElement("title", { id: e }, t) : null, /* @__PURE__ */ b.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" })), Ce = L(ye), bt = M(
665
+ ({ store: t }) => {
666
+ const { t: e } = _(), [n, r] = G(
667
+ t.jogger.motionStream.rapidlyChangingMotionState.joint_limit_reached.limit_reached
668
+ ), a = q(n);
669
+ nt(() => {
670
+ const d = t.jogger.motionStream.rapidlyChangingMotionState.joint_limit_reached.limit_reached;
671
+ Wt(a.current, d) || (a.current = d, r(d));
672
+ });
673
+ const c = [];
674
+ for (const [d, i] of n.entries())
675
+ i && c.push(d);
676
+ return /* @__PURE__ */ o(
677
+ O,
678
+ {
679
+ sx: {
680
+ display: "flex",
681
+ flexDirection: "row",
682
+ justifyContent: "center"
683
+ },
684
+ children: /* @__PURE__ */ o(
685
+ C,
686
+ {
687
+ "data-testid": "jogging-joint-limit-detector",
688
+ "aria-label": "jogging-joint-limit-detector",
689
+ color: "error",
690
+ variant: "body2",
691
+ sx: {
692
+ fontSize: "0.75rem",
693
+ lineHeight: 1.2,
694
+ visibility: c.length ? "visible" : "hidden"
695
+ },
696
+ children: e("Jogging.JointLimitsReached.lb", {
697
+ jointNumbers: c.map((d) => d + 1).join(", ")
698
+ })
699
+ }
700
+ )
701
+ }
702
+ );
703
+ }
704
+ ), Se = ht(Yt)(({ theme: t }) => ({
705
+ "&.MuiFormControl-root": {
706
+ ".MuiSelect-select": {
707
+ paddingTop: "20px",
708
+ paddingLeft: "12px"
709
+ },
710
+ label: {
711
+ pointerEvents: "none",
712
+ fontSize: "16px"
713
+ },
714
+ ".MuiInputLabel-root": {
715
+ "&.Mui-focused": {
716
+ color: t.palette.text.primary
717
+ }
718
+ }
719
+ }
720
+ }));
721
+ function Y({
722
+ labelValue: t,
723
+ ...e
724
+ }) {
725
+ return /* @__PURE__ */ p(Se, { fullWidth: !0, variant: "filled", children: [
726
+ /* @__PURE__ */ o(Zt, { id: e.labelId, children: t }),
727
+ /* @__PURE__ */ o(Kt, { ...e })
728
+ ] });
729
+ }
730
+ const we = M(
731
+ ({ store: t, useDegree: e }) => {
732
+ var d;
733
+ const { t: n } = _(), r = kt(), a = [];
734
+ function c(i) {
735
+ switch (i) {
736
+ case "coordsys":
737
+ return n("Jogging.Orientation.coordsys");
738
+ case "tool":
739
+ return n("Jogging.Orientation.tool");
740
+ default:
741
+ return i;
742
+ }
743
+ }
744
+ return t.showCoordSystemSelect && a.push(
745
+ /* @__PURE__ */ o(
746
+ Y,
747
+ {
748
+ labelId: `jogging-coord-select-${r}`,
749
+ labelValue: n("Jogging.CoordinateSystem.hlb"),
750
+ value: t.selectedCoordSystemId,
751
+ size: "small",
752
+ variant: "filled",
753
+ displayEmpty: !0,
754
+ onChange: (i) => t.setSelectedCoordSystemId(i.target.value),
755
+ children: t.coordSystems.map((i) => /* @__PURE__ */ o(V, { value: i.coordinate_system, children: i.name && t.coordSystemCountByName[i.name] > 1 ? `${i.name} / ${i.coordinate_system}` : i.name || i.coordinate_system }, i.coordinate_system))
756
+ },
757
+ "coord"
758
+ )
759
+ ), t.showTcpSelect && a.push(
760
+ /* @__PURE__ */ o(
761
+ Y,
762
+ {
763
+ labelId: `jogging-tcp-select-${r}`,
764
+ labelValue: "TCP",
765
+ value: t.selectedTcpId,
766
+ size: "small",
767
+ variant: "filled",
768
+ displayEmpty: t.tcpChangeInProgress,
769
+ onChange: (i) => {
770
+ t.requestTcpChange(i.target.value).catch((g) => {
771
+ console.error("Failed to change TCP:", g);
772
+ });
773
+ },
774
+ disabled: t.tcpChangeInProgress,
775
+ endAdornment: t.tcpChangeInProgress ? /* @__PURE__ */ o(Ut, { position: "end", children: /* @__PURE__ */ o(mt, { size: 16 }) }) : void 0,
776
+ children: t.tcps.map((i) => /* @__PURE__ */ o(V, { value: i.id, children: i.id }, i.id))
777
+ },
778
+ "tcp"
779
+ )
780
+ ), t.showOrientationSelect && a.push(
781
+ /* @__PURE__ */ o(
782
+ Y,
783
+ {
784
+ labelValue: n("Jogging.Cartesian.Orientation.lb"),
785
+ labelId: `orientation-select-${r}`,
786
+ value: t.selectedOrientation,
787
+ onChange: (i) => t.setSelectedOrientation(i.target.value),
788
+ children: Ot.map((i) => /* @__PURE__ */ o(V, { value: i, children: c(i) }, i))
789
+ },
790
+ "orientation"
791
+ )
792
+ ), t.showIncrementSelect && a.push(
793
+ /* @__PURE__ */ p(
794
+ Y,
795
+ {
796
+ labelValue: n("Jogging.Increment.hlb"),
797
+ labelId: `jogging-increment-select-${r}`,
798
+ size: "small",
799
+ variant: "filled",
800
+ value: ((d = t.activeDiscreteIncrement) == null ? void 0 : d.id) || "continuous",
801
+ onChange: (i) => t.setSelectedIncrementId(
802
+ i.target.value
803
+ ),
804
+ children: [
805
+ /* @__PURE__ */ o(V, { value: "continuous", children: n("Jogging.Increment.Continuous.dd") }, "continuous"),
806
+ t.discreteIncrementOptions.map((i) => /* @__PURE__ */ o(V, { value: i.id, children: e ? `${i.degrees}°` : `${i.mm}mm` }, i.id))
807
+ ]
808
+ },
809
+ "increment"
810
+ )
811
+ ), /* @__PURE__ */ o(
812
+ O,
813
+ {
814
+ component: "div",
815
+ "data-testid": "jogging-options",
816
+ "aria-label": "jogging-options",
817
+ sx: {
818
+ display: "grid",
819
+ gap: "16px",
820
+ gridTemplateColumns: "1fr 1fr",
821
+ gridAutoRows: "min-content",
822
+ "& label": { opacity: 0.7, fontSize: "12px", marginBottom: "4px" }
823
+ },
824
+ children: a.map((i, g) => /* @__PURE__ */ o(
825
+ O,
826
+ {
827
+ sx: {
828
+ gridColumn: a.length % 2 === 1 && g === a.length - 1 ? "span 2" : "auto"
829
+ },
830
+ children: i
831
+ },
832
+ g
833
+ ))
834
+ }
835
+ );
836
+ }
837
+ ), Me = ht(Xt)(({ theme: t }) => {
838
+ var e;
839
+ return {
840
+ "&.MuiToggleButtonGroup-root": {
841
+ background: (e = t.palette.backgroundPaperElevation) == null ? void 0 : e[8],
842
+ borderRadius: "8px",
843
+ padding: "4px",
844
+ gap: "4px",
845
+ button: {
846
+ border: "none",
847
+ borderRadius: "4px",
848
+ flex: "1 1 0px",
849
+ minWidth: 0,
850
+ "&.MuiToggleButtonGroup-firstButton": {
851
+ borderRadius: "8px 4px 4px 8px"
852
+ },
853
+ "&.MuiToggleButtonGroup-lastButton": {
854
+ borderRadius: "4px 8px 8px 4px"
855
+ }
856
+ }
857
+ }
858
+ };
859
+ }), je = H(
860
+ M((t) => {
861
+ const { store: e } = t, { t: n } = _();
862
+ function r(a, c) {
863
+ c === t.velocity || !qt(c) || t.onVelocityChange(c, t.useDegree);
864
+ }
865
+ return /* @__PURE__ */ p(
866
+ v,
867
+ {
868
+ direction: "row",
869
+ gap: 2,
870
+ alignItems: "center",
871
+ "data-testid": "velocity-slider",
872
+ "aria-label": "velocity-slider",
873
+ children: [
874
+ e.showVelocityLegend && /* @__PURE__ */ o(
875
+ C,
876
+ {
877
+ sx: {
878
+ color: Ht,
879
+ fontSize: "14px"
880
+ },
881
+ children: n("Jogging.Velocity.bt")
882
+ }
883
+ ),
884
+ /* @__PURE__ */ o(
885
+ xt,
886
+ {
887
+ value: t.velocity,
888
+ color: "secondary",
889
+ onChange: r,
890
+ min: t.min,
891
+ max: t.max,
892
+ "aria-labelledby": "input-slider",
893
+ disabled: t.disabled,
894
+ sx: {
895
+ "& .MuiSlider-valueLabelOpen": {
896
+ zIndex: 100,
897
+ backgroundColor: "transparent",
898
+ top: "0px"
899
+ }
900
+ }
901
+ }
902
+ ),
903
+ e.showVelocitySliderLabel && (t.renderValue ? t.renderValue(t.velocity) : /* @__PURE__ */ o(vt, { value: t.velocity.toString() }))
904
+ ]
905
+ }
906
+ );
907
+ })
908
+ );
909
+ function vt({ value: t, sx: e }) {
910
+ var r;
911
+ const n = $();
912
+ return /* @__PURE__ */ o(
913
+ v,
914
+ {
915
+ direction: "row",
916
+ justifyContent: "center",
917
+ alignItems: "center",
918
+ gap: "5px",
919
+ sx: {
920
+ padding: "6px 12px",
921
+ background: (r = n.palette.backgroundPaperElevation) == null ? void 0 : r[8],
922
+ borderRadius: "10px",
923
+ minWidth: "111px",
924
+ ...e
925
+ },
926
+ children: /* @__PURE__ */ o(
927
+ C,
928
+ {
929
+ component: "span",
930
+ sx: {
931
+ textAlign: "right",
932
+ fontSize: "14px",
933
+ opacity: 0.8,
934
+ color: n.palette.text.primary,
935
+ whiteSpace: "nowrap"
936
+ },
937
+ children: t
938
+ }
939
+ )
940
+ }
941
+ );
942
+ }
943
+ const yt = M(
944
+ ({ store: t, useDegree: e }) => {
945
+ const { t: n } = _();
946
+ function r(a, c) {
947
+ return c ? `ω = ${n("Jogging.Cartesian.Rotation.velocityDegPerSec.lb", { amount: a })}` : `v = ${n("Jogging.Cartesian.Translation.velocityMmPerSec.lb", { amount: a })}`;
948
+ }
949
+ return /* @__PURE__ */ o(
950
+ je,
951
+ {
952
+ store: t,
953
+ velocity: t.velocityInDisplayUnits(e),
954
+ min: t.minVelocityInDisplayUnits(e),
955
+ max: t.maxVelocityInDisplayUnits(e),
956
+ onVelocityChange: t.setVelocityFromSlider,
957
+ useDegree: e,
958
+ disabled: t.isLocked,
959
+ renderValue: (a) => /* @__PURE__ */ o(
960
+ vt,
961
+ {
962
+ value: r(a, e),
963
+ sx: {
964
+ minWidth: "111px",
965
+ span: {
966
+ transform: "translateY(-1.5px)"
967
+ }
968
+ }
969
+ }
970
+ )
971
+ }
972
+ );
973
+ }
974
+ ), Ct = M(({ store: t }) => {
975
+ var d, i, g;
976
+ const { t: e } = _(), n = $(), r = ((g = (i = (d = t.jogger.motionStream.rapidlyChangingMotionState.execute) == null ? void 0 : d.details) == null ? void 0 : i.state) == null ? void 0 : g.kind) ?? "KIND_UNKNOWN", a = t.lastJogError, c = t.lastJogErrorTranslationKey;
977
+ return /* @__PURE__ */ p(
978
+ O,
979
+ {
980
+ sx: {
981
+ display: "flex",
982
+ flexDirection: "row",
983
+ justifyContent: "space-between",
984
+ color: n.palette.text.primary
985
+ },
986
+ children: [
987
+ /* @__PURE__ */ o(
988
+ C,
989
+ {
990
+ variant: "body2",
991
+ sx: {
992
+ fontSize: "0.75rem",
993
+ // Smaller than body2
994
+ lineHeight: 1.2
995
+ },
996
+ children: e("Jogging.StreamStateSection.lb")
997
+ }
998
+ ),
999
+ /* @__PURE__ */ o(
1000
+ C,
1001
+ {
1002
+ variant: "body2",
1003
+ color: a ? "error" : void 0,
1004
+ sx: {
1005
+ fontSize: "0.75rem",
1006
+ // Smaller than body2
1007
+ lineHeight: 1.2,
1008
+ textAlign: "right"
1009
+ },
1010
+ "data-testid": a ? "JOG_ERROR" : r,
1011
+ children: a ? c ? e(c) : a : e(`Jogging.StreamStateSection.${r}.lb`)
1012
+ }
1013
+ )
1014
+ ]
1015
+ }
1016
+ );
1017
+ }), Te = M(
1018
+ ({
1019
+ store: t,
1020
+ children: e
1021
+ }) => {
1022
+ const { t: n } = _(), r = $(), a = q(0);
1023
+ function c(s, l) {
1024
+ (l === "translate" || l === "rotate") && t.setSelectedCartesianMotionType(l);
1025
+ }
1026
+ async function d(s, l) {
1027
+ const x = await t.activate(), h = x.motionStream.rapidlyChangingMotionState.tcp_pose, S = x.motionStream.rapidlyChangingMotionState.joint_position;
1028
+ h && await t.withMotionLock(async () => {
1029
+ try {
1030
+ t.setCurrentIncrementJog({
1031
+ axis: s.axis,
1032
+ direction: s.direction
1033
+ }), await t.jogger.runIncrementalCartesianMotion({
1034
+ currentTcpPose: h,
1035
+ currentJoints: S,
1036
+ coordSystemId: t.activeCoordSystemId,
1037
+ velocityInRelevantUnits: t.selectedCartesianMotionType === "translate" ? t.translationVelocityMmPerSec : t.rotationVelocityRadsPerSec,
1038
+ axis: s.axis,
1039
+ direction: s.direction,
1040
+ motion: t.selectedCartesianMotionType === "translate" ? {
1041
+ type: "translate",
1042
+ distanceMm: l.mm
1043
+ } : {
1044
+ type: "rotate",
1045
+ distanceRads: Gt(l.degrees)
1046
+ }
1047
+ });
1048
+ } finally {
1049
+ t.setCurrentIncrementJog(null), await t.deactivate();
1050
+ }
1051
+ });
1052
+ }
1053
+ async function i(s) {
1054
+ if (t.isLocked) return;
1055
+ const l = ++a.current;
1056
+ try {
1057
+ if (await t.activate(), l !== a.current) return;
1058
+ if (t.activeDiscreteIncrement)
1059
+ return await d(
1060
+ s,
1061
+ t.activeDiscreteIncrement
1062
+ );
1063
+ s.motionType === "translate" ? await t.jogger.translateTCP({
1064
+ axis: s.axis,
1065
+ direction: s.direction,
1066
+ velocityMmPerSec: t.translationVelocityMmPerSec
1067
+ }) : await t.jogger.rotateTCP({
1068
+ axis: s.axis,
1069
+ direction: s.direction,
1070
+ velocityRadsPerSec: t.rotationVelocityRadsPerSec
1071
+ });
1072
+ } catch (x) {
1073
+ console.error("Jogging failed:", x);
1074
+ }
1075
+ }
1076
+ async function g() {
1077
+ t.activeDiscreteIncrement || (a.current++, await t.deactivate());
1078
+ }
1079
+ const m = [
1080
+ {
1081
+ id: "x",
1082
+ icon: /* @__PURE__ */ o(he, {}),
1083
+ colors: Q.X
1084
+ },
1085
+ {
1086
+ id: "y",
1087
+ icon: /* @__PURE__ */ o(xe, {}),
1088
+ colors: Q.Y
1089
+ },
1090
+ {
1091
+ id: "z",
1092
+ icon: /* @__PURE__ */ o(ve, {}),
1093
+ colors: Q.Z
1094
+ }
1095
+ ];
1096
+ function y(s) {
1097
+ return n("General.mm.variable", { amount: s.toFixed(1) });
1098
+ }
1099
+ function u(s) {
1100
+ return n("General.degree.variable", {
1101
+ amount: ft(s).toFixed(1)
1102
+ });
1103
+ }
1104
+ return /* @__PURE__ */ p(
1105
+ v,
1106
+ {
1107
+ "data-testid": "jogging-cartesian-tab",
1108
+ "aria-label": "jogging-cartesian-tab",
1109
+ flexGrow: 1,
1110
+ gap: 2,
1111
+ sx: { padding: "18px 24px" },
1112
+ children: [
1113
+ /* @__PURE__ */ p(v, { gap: 2, children: [
1114
+ /* @__PURE__ */ o(
1115
+ we,
1116
+ {
1117
+ store: t,
1118
+ useDegree: t.selectedCartesianMotionType === "rotate"
1119
+ }
1120
+ ),
1121
+ /* @__PURE__ */ o(
1122
+ yt,
1123
+ {
1124
+ store: t,
1125
+ useDegree: t.selectedCartesianMotionType === "rotate"
1126
+ }
1127
+ ),
1128
+ /* @__PURE__ */ o(D, {})
1129
+ ] }),
1130
+ /* @__PURE__ */ o(
1131
+ v,
1132
+ {
1133
+ marginLeft: "auto",
1134
+ marginRight: "auto",
1135
+ gap: "24px",
1136
+ justifyContent: "center",
1137
+ sx: { flexGrow: "1" },
1138
+ children: /* @__PURE__ */ p(
1139
+ v,
1140
+ {
1141
+ alignItems: "center",
1142
+ justifyContent: "center",
1143
+ gap: "24px",
1144
+ sx: { flexGrow: 1 },
1145
+ children: [
1146
+ /* @__PURE__ */ p(
1147
+ Me,
1148
+ {
1149
+ value: t.selectedCartesianMotionType,
1150
+ onChange: c,
1151
+ exclusive: !0,
1152
+ "aria-label": n("Jogging.Cartesian.MotionType.lb"),
1153
+ sx: { justifyContent: "center" },
1154
+ children: [
1155
+ /* @__PURE__ */ o(rt, { value: "translate", children: n("Jogging.Cartesian.Translation.bt") }),
1156
+ /* @__PURE__ */ o(rt, { value: "rotate", children: n("Jogging.Cartesian.Rotation.bt") })
1157
+ ]
1158
+ }
1159
+ ),
1160
+ t.selectedCartesianMotionType === "translate" && m.map((s) => {
1161
+ var l, x;
1162
+ return /* @__PURE__ */ o(
1163
+ dt,
1164
+ {
1165
+ "data-testid": `jogging-cartesian-axis-control-${s.id}`,
1166
+ "aria-label": `jogging-cartesian-axis-control-${s.id}`,
1167
+ colors: s.colors,
1168
+ disabled: t.isLocked,
1169
+ activeJoggingDirection: ((l = t.incrementJogInProgress) == null ? void 0 : l.axis) === s.id ? t.incrementJogInProgress.direction : void 0,
1170
+ label: /* @__PURE__ */ p(Z, { children: [
1171
+ s.icon,
1172
+ /* @__PURE__ */ o(
1173
+ C,
1174
+ {
1175
+ sx: {
1176
+ fontSize: "24px",
1177
+ color: ((x = s.colors) == null ? void 0 : x.labelColor) ?? r.palette.text.primary
1178
+ },
1179
+ children: s.id.toUpperCase()
1180
+ }
1181
+ )
1182
+ ] }),
1183
+ getDisplayedValue: () => {
1184
+ var h, S;
1185
+ return y(
1186
+ ((S = (h = t.jogger.motionStream.rapidlyChangingMotionState.tcp_pose) == null ? void 0 : h.position) == null ? void 0 : S[at[s.id]]) || 0
1187
+ );
1188
+ },
1189
+ startJogging: (h) => i({
1190
+ axis: s.id,
1191
+ motionType: "translate",
1192
+ direction: h
1193
+ }),
1194
+ stopJogging: g
1195
+ },
1196
+ s.id
1197
+ );
1198
+ }),
1199
+ t.selectedCartesianMotionType === "rotate" && m.map((s) => {
1200
+ var l, x;
1201
+ return /* @__PURE__ */ o(
1202
+ dt,
1203
+ {
1204
+ "data-testid": `jogging-cartesian-axis-control-${s.id}`,
1205
+ "aria-label": `jogging-cartesian-axis-control-${s.id}`,
1206
+ colors: s.colors,
1207
+ disabled: t.isLocked,
1208
+ activeJoggingDirection: ((l = t.incrementJogInProgress) == null ? void 0 : l.axis) === s.id ? t.incrementJogInProgress.direction : void 0,
1209
+ label: /* @__PURE__ */ p(Z, { children: [
1210
+ /* @__PURE__ */ o(Ce, {}),
1211
+ /* @__PURE__ */ o(
1212
+ C,
1213
+ {
1214
+ sx: {
1215
+ fontSize: "24px",
1216
+ color: ((x = s.colors) == null ? void 0 : x.labelColor) ?? r.palette.text.primary
1217
+ },
1218
+ children: s.id.toUpperCase()
1219
+ }
1220
+ )
1221
+ ] }),
1222
+ getDisplayedValue: () => {
1223
+ var h, S;
1224
+ return u(
1225
+ ((S = (h = t.jogger.motionStream.rapidlyChangingMotionState.tcp_pose) == null ? void 0 : h.orientation) == null ? void 0 : S[at[s.id]]) || 0
1226
+ );
1227
+ },
1228
+ startJogging: (h) => i({
1229
+ axis: s.id,
1230
+ motionType: "rotate",
1231
+ direction: h
1232
+ }),
1233
+ stopJogging: g
1234
+ },
1235
+ s.id
1236
+ );
1237
+ })
1238
+ ]
1239
+ }
1240
+ )
1241
+ }
1242
+ ),
1243
+ /* @__PURE__ */ o(bt, { store: t }),
1244
+ /* @__PURE__ */ o(D, {}),
1245
+ /* @__PURE__ */ o(Ct, { store: t }),
1246
+ e && /* @__PURE__ */ o(D, {}),
1247
+ e
1248
+ ]
1249
+ }
1250
+ );
1251
+ }
1252
+ ), Ee = M(
1253
+ ({ store: t, children: e }) => {
1254
+ const n = $(), r = q(0);
1255
+ async function a(d) {
1256
+ const i = ++r.current;
1257
+ try {
1258
+ if (await t.activate(), i !== r.current) return;
1259
+ await t.jogger.rotateJoints({
1260
+ joint: d.joint,
1261
+ direction: d.direction,
1262
+ velocityUnit: t.jointType === U.PrismaticJoint ? "mm/s" : "rad/s",
1263
+ velocityValue: t.jointType === U.PrismaticJoint ? t.translationVelocityMmPerSec : t.rotationVelocityRadsPerSec
1264
+ });
1265
+ } catch (g) {
1266
+ console.error("Jogging failed:", g);
1267
+ }
1268
+ }
1269
+ async function c() {
1270
+ r.current++, await t.jogger.stop(), await t.deactivate();
1271
+ }
1272
+ return /* @__PURE__ */ p(
1273
+ v,
1274
+ {
1275
+ "data-testid": "jogging-joint-tab",
1276
+ "aria-label": "jogging-joint-tab",
1277
+ flexGrow: 1,
1278
+ gap: 2,
1279
+ sx: { padding: "18px 24px" },
1280
+ children: [
1281
+ /* @__PURE__ */ o(
1282
+ yt,
1283
+ {
1284
+ store: t,
1285
+ useDegree: t.jointType === U.RevoluteJoint
1286
+ }
1287
+ ),
1288
+ /* @__PURE__ */ o(D, {}),
1289
+ /* @__PURE__ */ o(
1290
+ v,
1291
+ {
1292
+ justifyContent: "center",
1293
+ alignItems: "stretch",
1294
+ sx: { flexGrow: "1" },
1295
+ children: /* @__PURE__ */ o(
1296
+ v,
1297
+ {
1298
+ "data-testid": "jogging-joint-value-controls-wrapper",
1299
+ "aria-label": "jogging-joint-value-controls-wrapper",
1300
+ alignItems: "center",
1301
+ gap: "24px",
1302
+ children: t.jogger.motionStream.joints.map((d) => {
1303
+ var g, m, y;
1304
+ const i = (y = (m = (g = t.motionGroupDescription.operation_limits.auto_limits) == null ? void 0 : g.joints) == null ? void 0 : m[d.index]) == null ? void 0 : y.position;
1305
+ return /* @__PURE__ */ p(
1306
+ v,
1307
+ {
1308
+ "data-testid": `jogging-joint-value-control-${d.index}`,
1309
+ "aria-label": `jogging-joint-value-control-${d.index}`,
1310
+ direction: "row",
1311
+ alignItems: "center",
1312
+ justifyContent: "center",
1313
+ spacing: 1.5,
1314
+ width: "100%",
1315
+ children: [
1316
+ t.showJointsLegend && /* @__PURE__ */ o(
1317
+ C,
1318
+ {
1319
+ color: t.isLocked ? n.palette.text.disabled : n.palette.text.secondary,
1320
+ children: `G${d.index + 1}`
1321
+ }
1322
+ ),
1323
+ /* @__PURE__ */ o(
1324
+ de,
1325
+ {
1326
+ disabled: t.isLocked,
1327
+ lowerLimit: i == null ? void 0 : i.lower_limit,
1328
+ upperLimit: i == null ? void 0 : i.upper_limit,
1329
+ useDegree: t.jointType === U.RevoluteJoint,
1330
+ getValue: () => {
1331
+ const u = t.jogger.motionStream.rapidlyChangingMotionState.joint_position[d.index];
1332
+ return u !== void 0 ? u : void 0;
1333
+ },
1334
+ startJogging: (u) => a({
1335
+ joint: d.index,
1336
+ direction: u
1337
+ }),
1338
+ stopJogging: c
1339
+ }
1340
+ )
1341
+ ]
1342
+ },
1343
+ `joint-${d.index}`
1344
+ );
1345
+ })
1346
+ }
1347
+ )
1348
+ }
1349
+ ),
1350
+ /* @__PURE__ */ o(bt, { store: t }),
1351
+ /* @__PURE__ */ o(D, {}),
1352
+ /* @__PURE__ */ o(Ct, { store: t }),
1353
+ e && /* @__PURE__ */ o(D, {}),
1354
+ e
1355
+ ]
1356
+ }
1357
+ );
1358
+ }
1359
+ ), _o = H(
1360
+ M((t) => {
1361
+ const e = pt(() => ({
1362
+ joggingStore: null,
1363
+ loadingError: null
1364
+ }));
1365
+ return K(() => {
1366
+ let n = !1, r;
1367
+ async function a() {
1368
+ w(() => {
1369
+ e.loadingError = null, e.joggingStore = null;
1370
+ });
1371
+ try {
1372
+ let c = t.store;
1373
+ if (!c) {
1374
+ const d = await At.open(
1375
+ t.nova,
1376
+ t.motionGroupId,
1377
+ {
1378
+ cellId: t.cellId
1379
+ }
1380
+ );
1381
+ if (n) {
1382
+ d.dispose();
1383
+ return;
1384
+ }
1385
+ try {
1386
+ c = await Vt.loadFor(d);
1387
+ } catch (i) {
1388
+ throw d.dispose(), i;
1389
+ }
1390
+ if (r = c, n) {
1391
+ c.dispose();
1392
+ return;
1393
+ }
1394
+ }
1395
+ w(() => {
1396
+ e.joggingStore = c;
1397
+ }), t.onSetup && t.onSetup(c);
1398
+ } catch (c) {
1399
+ if (n) return;
1400
+ w(() => {
1401
+ e.loadingError = c;
1402
+ });
1403
+ }
1404
+ }
1405
+ return a(), () => {
1406
+ n = !0, r == null || r.dispose();
1407
+ };
1408
+ }, [t.store, t.nova, t.motionGroupId, t.cellId]), K(() => {
1409
+ const n = e.joggingStore;
1410
+ n && (t.locked ? n.lock("external") : n.unlock("external"));
1411
+ }, [e.joggingStore, t.locked]), /* @__PURE__ */ o(
1412
+ v,
1413
+ {
1414
+ "data-testid": "jogging-panel",
1415
+ "aria-label": "jogging-panel",
1416
+ sx: {
1417
+ maxWidth: "460px",
1418
+ minWidth: "320px",
1419
+ position: "relative",
1420
+ ...t.sx
1421
+ },
1422
+ children: e.joggingStore ? /* @__PURE__ */ o(ke, { store: e.joggingStore, children: t.children }) : /* @__PURE__ */ o(ge, { message: "Loading jogging", error: e.loadingError })
1423
+ }
1424
+ );
1425
+ })
1426
+ ), ke = M(
1427
+ ({
1428
+ store: t,
1429
+ children: e
1430
+ }) => {
1431
+ const { t: n } = _();
1432
+ function r() {
1433
+ if (t.currentTab.id === "cartesian")
1434
+ return /* @__PURE__ */ o(Te, { store: t, children: e });
1435
+ if (t.currentTab.id === "joint")
1436
+ return /* @__PURE__ */ o(Ee, { store: t, children: e });
1437
+ }
1438
+ return /* @__PURE__ */ p(v, { flexGrow: 1, sx: { overflow: "hidden" }, children: [
1439
+ /* @__PURE__ */ o(
1440
+ _t,
1441
+ {
1442
+ "data-testid": "jogging-tabs",
1443
+ "aria-label": "jogging-tabs",
1444
+ value: t.tabIndex,
1445
+ onChange: t.onTabChange,
1446
+ variant: "fullWidth",
1447
+ children: t.tabs.map((a) => {
1448
+ const c = a.label === "Cartesian" ? n("Jogging.Cartesian.bt") : n("Jogging.Joints.bt"), d = a.label === "cartesian" ? /* @__PURE__ */ o(It, { fontSize: "small", sx: { mr: 1 } }) : /* @__PURE__ */ o(Jt, { fontSize: "small", sx: { mr: 1 } });
1449
+ return /* @__PURE__ */ o(
1450
+ Rt,
1451
+ {
1452
+ "data-testid": `jogging-tab-${a.id}`,
1453
+ "aria-label": `jogging-tab-${a.id}`,
1454
+ label: t.showTabIcons ? /* @__PURE__ */ p(v, { direction: "row", alignItems: "center", children: [
1455
+ d,
1456
+ c
1457
+ ] }) : c,
1458
+ id: `jogging-tab-${a.id}`,
1459
+ "aria-controls": `jogging-tab-${a.id}`
1460
+ },
1461
+ a.id
1462
+ );
1463
+ })
1464
+ }
1465
+ ),
1466
+ /* @__PURE__ */ o(
1467
+ v,
1468
+ {
1469
+ flexGrow: 1,
1470
+ position: "relative",
1471
+ sx: { overflowY: "auto", overflowX: "hidden" },
1472
+ children: r()
1473
+ }
1474
+ ),
1475
+ t.blocked && /* @__PURE__ */ o(pe, { store: t })
1476
+ ] });
1477
+ }
1478
+ );
1479
+ function Ie() {
1480
+ const t = window.location.href;
1481
+ return t.substring(
1482
+ 0,
1483
+ t.indexOf("/", t.indexOf("//") + 2)
1484
+ );
1485
+ }
1486
+ function Po({
1487
+ baseUrl: t = Ie(),
1488
+ ...e
1489
+ }) {
1490
+ return /* @__PURE__ */ p(
1491
+ oe,
1492
+ {
1493
+ "aria-labelledby": "no-motion-group-modal-title",
1494
+ open: !0,
1495
+ fullWidth: !0,
1496
+ sx: {
1497
+ "& .MuiModal-backdrop": {
1498
+ backdropFilter: "blur(10px)"
1499
+ },
1500
+ "& .MuiDialog-paper": {
1501
+ "::before": {
1502
+ content: '""',
1503
+ height: "8px",
1504
+ width: "100%",
1505
+ background: "linear-gradient(90deg, #FF0E65 0%, #47D3FF 100%)"
1506
+ },
1507
+ background: "#101629"
1508
+ }
1509
+ },
1510
+ children: [
1511
+ /* @__PURE__ */ o(re, { id: "no-motion-group-modal-title", children: "No motion group found" }),
1512
+ /* @__PURE__ */ p(
1513
+ ie,
1514
+ {
1515
+ sx: {
1516
+ marginTop: "3rem",
1517
+ marginBottom: "1.5rem",
1518
+ textAlign: "center"
1519
+ },
1520
+ children: [
1521
+ /* @__PURE__ */ o(C, { color: "#fff", children: "Found no devices to connect to." }),
1522
+ /* @__PURE__ */ o(C, { color: "#fff", children: "Please ensure a motion group has been created." })
1523
+ ]
1524
+ }
1525
+ ),
1526
+ /* @__PURE__ */ o(ne, { children: /* @__PURE__ */ p(v, { width: "100%", maxWidth: "300px", margin: "auto", marginBottom: "2rem", children: [
1527
+ /* @__PURE__ */ o(
1528
+ et,
1529
+ {
1530
+ href: `${t}/settings`,
1531
+ variant: "contained",
1532
+ sx: {
1533
+ borderRadius: "8px",
1534
+ width: "100%"
1535
+ },
1536
+ children: "Go to settings app"
1537
+ }
1538
+ ),
1539
+ /* @__PURE__ */ o(
1540
+ et,
1541
+ {
1542
+ href: `${t}`,
1543
+ variant: "text",
1544
+ sx: {
1545
+ marginTop: "1rem",
1546
+ color: "#fff",
1547
+ textDecoration: "underline",
1548
+ fontSize: "0.75rem"
1549
+ },
1550
+ children: "Back to Homescreen"
1551
+ }
1552
+ )
1553
+ ] }) })
1554
+ ]
1555
+ }
1556
+ );
1557
+ }
1558
+ const gt = 1e-4, Je = {
1559
+ a: 0,
1560
+ d: 0,
1561
+ alpha: 0,
1562
+ theta: 0,
1563
+ reverse_rotation_direction: !1
1564
+ };
1565
+ class ot {
1566
+ constructor(e, n, r, a, c, d, i, g, m, y, u = "cell") {
1567
+ this.controller = n, this.motionGroup = r, this.initialMotionState = a, this.motionStateSocket = c, this.isVirtual = d, this.tcps = i, this.description = g, this.initialControllerState = m, this.controllerStateSocket = y, this.cellId = u, this.connectedJoggingSocket = null, this.joggingVelocity = 10, this.activationState = "inactive", this.nova = tt(e), this.rapidlyChangingMotionState = a, this.controllerState = m, y.addEventListener("message", (s) => {
1568
+ var x;
1569
+ const l = (x = W(s.data)) == null ? void 0 : x.result;
1570
+ l && w(() => {
1571
+ this.controllerState = l;
1572
+ });
1573
+ }), c.addEventListener("message", (s) => {
1574
+ var x;
1575
+ const l = (x = W(s.data)) == null ? void 0 : x.result;
1576
+ if (!l)
1577
+ throw new Error(
1578
+ `Failed to get motion state for ${this.motionGroupId}: ${s.data}`
1579
+ );
1580
+ Dt(
1581
+ this.rapidlyChangingMotionState.joint_position,
1582
+ l.joint_position,
1583
+ gt
1584
+ ) || w(() => {
1585
+ this.rapidlyChangingMotionState.joint_position = l.joint_position;
1586
+ }), Lt(
1587
+ this.rapidlyChangingMotionState,
1588
+ l,
1589
+ gt
1590
+ ) || w(() => {
1591
+ this.rapidlyChangingMotionState.tcp_pose = l.tcp_pose;
1592
+ }), l.tcp !== void 0 && this.rapidlyChangingMotionState.tcp !== l.tcp && w(() => {
1593
+ this.rapidlyChangingMotionState.tcp = l.tcp;
1594
+ }), this.rapidlyChangingMotionState.standstill !== l.standstill && w(() => {
1595
+ this.rapidlyChangingMotionState.standstill = l.standstill;
1596
+ });
1597
+ }), Pt(this);
1598
+ }
1599
+ static async connectMultiple(e, n, r = {}) {
1600
+ const a = tt(e), c = r.cellId ?? st(e);
1601
+ return Promise.all(
1602
+ n.map(
1603
+ (d) => ot.connect(a, d, {
1604
+ ...r,
1605
+ cellId: c
1606
+ })
1607
+ )
1608
+ );
1609
+ }
1610
+ static async connect(e, n, r = {}) {
1611
+ var k, I;
1612
+ const a = tt(e), c = r.cellId ?? st(e) ?? "cell", [d, i] = n.split("@"), g = await a.api.controller.getCurrentRobotControllerState(
1613
+ c,
1614
+ i
1615
+ ), m = g == null ? void 0 : g.motion_groups.find(
1616
+ (J) => J.motion_group === n
1617
+ );
1618
+ if (!g || !m)
1619
+ throw new Error(
1620
+ `Controller ${i} or motion group ${n} not found`
1621
+ );
1622
+ const y = a.openReconnectingWebsocket(
1623
+ `/cells/${c}/controllers/${i}/motion-groups/${n}/state-stream`
1624
+ ), u = await y.firstMessage(), s = (k = W(u.data)) == null ? void 0 : k.result;
1625
+ if (!s)
1626
+ throw new Error(
1627
+ `Unable to parse initial motion state message ${u.data}`
1628
+ );
1629
+ console.log(
1630
+ `Connected motion state websocket to motion group ${m.motion_group}. Initial state:
1631
+ `,
1632
+ s
1633
+ );
1634
+ const x = (await a.api.controller.getRobotController(
1635
+ c,
1636
+ g.controller
1637
+ )).configuration.kind === "VirtualController", h = await a.api.motionGroup.getMotionGroupDescription(
1638
+ c,
1639
+ i,
1640
+ m.motion_group
1641
+ ), S = Object.entries(h.tcps || {}).map(
1642
+ ([J, R]) => ({
1643
+ id: J,
1644
+ readable_name: R.name,
1645
+ position: R.pose.position,
1646
+ orientation: R.pose.orientation
1647
+ })
1648
+ ), A = a.openReconnectingWebsocket(
1649
+ `/cells/${c}/controllers/${g.controller}/state-stream?response_rate=1000`
1650
+ ), j = await A.firstMessage(), E = (I = W(j.data)) == null ? void 0 : I.result;
1651
+ if (!E)
1652
+ throw new Error(
1653
+ `Unable to parse initial controller state message ${j.data}`
1654
+ );
1655
+ return console.log(
1656
+ `Connected controller state websocket to controller ${g.controller}. Initial state:
1657
+ `,
1658
+ E
1659
+ ), new ot(
1660
+ a,
1661
+ g,
1662
+ m,
1663
+ s,
1664
+ y,
1665
+ x,
1666
+ S,
1667
+ h,
1668
+ E,
1669
+ A,
1670
+ c
1671
+ );
1672
+ }
1673
+ get motionGroupId() {
1674
+ return this.motionGroup.motion_group;
1675
+ }
1676
+ get controllerId() {
1677
+ return this.controller.controller;
1678
+ }
1679
+ get modelFromController() {
1680
+ return this.description.motion_group_model;
1681
+ }
1682
+ /** Jogging velocity in radians for rotation and joint movement */
1683
+ get joggingVelocityRads() {
1684
+ return this.joggingVelocity * Math.PI / 180;
1685
+ }
1686
+ get joints() {
1687
+ return this.initialMotionState.joint_position.map((e, n) => ({
1688
+ index: n
1689
+ }));
1690
+ }
1691
+ // Please note that API v2 omits 0 values
1692
+ get dhParameters() {
1693
+ if (this.description.dh_parameters !== void 0)
1694
+ return this.description.dh_parameters.map((e) => ({
1695
+ ...Je,
1696
+ ...e
1697
+ }));
1698
+ }
1699
+ get safetyZones() {
1700
+ return this.description.safety_zones;
1701
+ }
1702
+ /** Gets the robot mounting position offset in 3D viz coordinates */
1703
+ get mountingPosition() {
1704
+ var e, n, r;
1705
+ return this.description.mounting ? [
1706
+ (((e = this.description.mounting.position) == null ? void 0 : e[0]) || 0) / 1e3,
1707
+ (((n = this.description.mounting.position) == null ? void 0 : n[1]) || 0) / 1e3,
1708
+ (((r = this.description.mounting.position) == null ? void 0 : r[2]) || 0) / 1e3
1709
+ ] : [0, 0, 0];
1710
+ }
1711
+ /** Gets the robot mounting position rotation in 3D viz coordinates */
1712
+ get mountingQuaternion() {
1713
+ var a, c, d, i, g, m;
1714
+ const e = new ct.Vector3(
1715
+ ((c = (a = this.description.mounting) == null ? void 0 : a.orientation) == null ? void 0 : c[0]) || 0,
1716
+ ((i = (d = this.description.mounting) == null ? void 0 : d.orientation) == null ? void 0 : i[1]) || 0,
1717
+ ((m = (g = this.description.mounting) == null ? void 0 : g.orientation) == null ? void 0 : m[2]) || 0
1718
+ ), n = e.length(), r = e.normalize();
1719
+ return new ct.Quaternion().setFromAxisAngle(r, n);
1720
+ }
1721
+ /**
1722
+ * Whether the controller is currently in a safety state
1723
+ * corresponding to an emergency stop
1724
+ */
1725
+ get isEstopActive() {
1726
+ return [
1727
+ "SAFETY_STATE_ROBOT_EMERGENCY_STOP",
1728
+ "SAFETY_STATE_DEVICE_EMERGENCY_STOP"
1729
+ ].includes(this.controllerState.safety_state);
1730
+ }
1731
+ /**
1732
+ * Whether the controller is in a safety state
1733
+ * that may be non-functional for robot pad purposes
1734
+ */
1735
+ get isMoveableSafetyState() {
1736
+ return [
1737
+ "SAFETY_STATE_NORMAL",
1738
+ "SAFETY_STATE_REDUCED"
1739
+ ].includes(this.controllerState.safety_state);
1740
+ }
1741
+ /**
1742
+ * Whether the controller is in an operation mode that allows movement
1743
+ */
1744
+ get isMoveableOperationMode() {
1745
+ return [
1746
+ "OPERATION_MODE_AUTO",
1747
+ "OPERATION_MODE_MANUAL",
1748
+ "OPERATION_MODE_MANUAL_T1",
1749
+ "OPERATION_MODE_MANUAL_T2"
1750
+ ].includes(this.controllerState.operation_mode);
1751
+ }
1752
+ /**
1753
+ * Whether the robot is currently active and can be moved, based on the
1754
+ * safety state, operation mode and servo toggle activation state.
1755
+ */
1756
+ get canBeMoved() {
1757
+ return this.isMoveableSafetyState && this.isMoveableOperationMode && this.activationState === "active";
1758
+ }
1759
+ async deactivate() {
1760
+ if (this.activationState !== "active") {
1761
+ console.error("Tried to deactivate while already deactivating");
1762
+ return;
1763
+ }
1764
+ w(() => {
1765
+ this.activationState = "deactivating";
1766
+ });
1767
+ try {
1768
+ await this.nova.api.controller.setDefaultMode(
1769
+ this.cellId,
1770
+ this.controllerId,
1771
+ "ROBOT_SYSTEM_MODE_MONITOR"
1772
+ ), w(() => {
1773
+ this.activationState = "inactive";
1774
+ });
1775
+ } catch (e) {
1776
+ throw w(() => {
1777
+ this.activationState = "active";
1778
+ }), e;
1779
+ }
1780
+ }
1781
+ async activate() {
1782
+ if (this.activationState !== "inactive") {
1783
+ console.error("Tried to activate while already activating");
1784
+ return;
1785
+ }
1786
+ w(() => {
1787
+ this.activationState = "activating";
1788
+ });
1789
+ try {
1790
+ await this.nova.api.controller.setDefaultMode(
1791
+ this.cellId,
1792
+ this.controllerId,
1793
+ "ROBOT_SYSTEM_MODE_CONTROL"
1794
+ ), w(() => {
1795
+ this.activationState = "active";
1796
+ });
1797
+ } catch (e) {
1798
+ throw w(() => {
1799
+ this.activationState = "inactive";
1800
+ }), e;
1801
+ }
1802
+ }
1803
+ toggleActivation() {
1804
+ this.activationState === "inactive" ? this.activate() : this.activationState === "active" && this.deactivate();
1805
+ }
1806
+ dispose() {
1807
+ this.motionStateSocket.close(), this.controllerStateSocket.close(), this.connectedJoggingSocket && this.connectedJoggingSocket.close();
1808
+ }
1809
+ setJoggingVelocity(e) {
1810
+ this.joggingVelocity = e;
1811
+ }
1812
+ }
1813
+ export {
1814
+ Ro as A,
1815
+ ot as C,
1816
+ dt as J,
1817
+ ge as L,
1818
+ Po as N,
1819
+ je as V,
1820
+ de as a,
1821
+ _o as b,
1822
+ ue as c,
1823
+ vt as d
1824
+ };