@wandelbots/wandelbots-js-react-components 6.3.0 → 6.4.0-pr.chore-public-names.673.cb7ee37

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