@wandelbots/wandelbots-js-react-components 5.6.1 → 5.7.0-pr.fix-buttons-dissapear.617.9e953cc

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.
@@ -1,26 +1,26 @@
1
- import { jsx as r, jsxs as b, Fragment as U } from "react/jsx-runtime";
1
+ import { jsx as r, jsxs as b, Fragment as B } from "react/jsx-runtime";
2
2
  import * as g from "three";
3
- import { Matrix4 as R, Vector3 as k, Quaternion as W } from "three";
4
- import { ConvexGeometry as se, RoundedBoxGeometry as ke } from "three-stdlib";
5
- import Ge, { useMemo as I, useRef as M, useEffect as T, useState as G, useCallback as L, Suspense as ae } from "react";
6
- import { d as Le, v as Ae, o as Ie, e as J } from "./externalizeComponent-EDymnaGR.js";
7
- import { Environment as Pe, Lightformer as A, Line as $, useGLTF as Fe, Bounds as Z } from "@react-three/drei";
3
+ import { Matrix4 as v, Vector3 as G, Quaternion as W } from "three";
4
+ import { ConvexGeometry as ae, RoundedBoxGeometry as ke } from "three-stdlib";
5
+ import Ge, { useMemo as P, useRef as R, useCallback as S, useEffect as T, useState as L, Suspense as ce } from "react";
6
+ import { d as Le, v as Ie, o as Pe, e as C } from "./externalizeComponent-EDymnaGR.js";
7
+ import { Environment as Ae, Lightformer as I, Line as $, useGLTF as Fe, Bounds as Q } from "@react-three/drei";
8
8
  import { useTheme as De } from "@mui/material/styles";
9
- import v from "@mui/material/Box";
10
- import Q from "@mui/material/Button";
9
+ import M from "@mui/material/Box";
10
+ import z from "@mui/material/Button";
11
11
  import Oe from "@mui/material/Card";
12
- import z from "@mui/material/Divider";
13
- import ee from "@mui/material/Typography";
14
- import { useThree as le, useFrame as ce, Canvas as te } from "@react-three/fiber";
12
+ import ee from "@mui/material/Divider";
13
+ import te from "@mui/material/Typography";
14
+ import { useThree as N, useFrame as le, Canvas as re } from "@react-three/fiber";
15
15
  import { observer as Ve } from "mobx-react-lite";
16
16
  import { useTranslation as Ee } from "react-i18next";
17
- import { V as ue, c as fe, b as re } from "./interpolation-DG8VTxzS.js";
18
- import { NovaClient as Ce, Manufacturer as _, JointTypeEnum as C } from "@wandelbots/nova-js/v2";
17
+ import { V as ue, c as fe, b as ne } from "./interpolation-DG8VTxzS.js";
18
+ import { Nova as Ue, Manufacturer as _, JointTypeEnum as U } from "@wandelbots/nova-js/v2";
19
19
  import { ErrorBoundary as pe } from "react-error-boundary";
20
- function Ue(e) {
20
+ function Be(e) {
21
21
  switch (e.shape_type) {
22
22
  case "convex_hull":
23
- return new se(
23
+ return new ae(
24
24
  e.vertices.map(
25
25
  (t) => new g.Vector3(
26
26
  t[0] / 1e3,
@@ -54,65 +54,65 @@ function Ue(e) {
54
54
  return console.warn(`${e.shape_type} is not supported`), new g.BufferGeometry();
55
55
  }
56
56
  }
57
- function Je({
57
+ function Ce({
58
58
  name: e,
59
59
  collider: n,
60
60
  children: t
61
61
  }) {
62
- var f, c;
63
- const l = ((f = n.pose) == null ? void 0 : f.position) ?? [0, 0, 0], i = ((c = n.pose) == null ? void 0 : c.orientation) ?? [0, 0, 0];
62
+ var u, c;
63
+ const s = ((u = n.pose) == null ? void 0 : u.position) ?? [0, 0, 0], o = ((c = n.pose) == null ? void 0 : c.orientation) ?? [0, 0, 0];
64
64
  return n.margin && console.warn(`${e} margin is not supported`), /* @__PURE__ */ r(
65
65
  "mesh",
66
66
  {
67
67
  name: e,
68
68
  position: new g.Vector3(
69
- l[0],
70
- l[1],
71
- l[2]
69
+ s[0],
70
+ s[1],
71
+ s[2]
72
72
  ).divideScalar(1e3),
73
- rotation: new g.Euler(i[0], i[1], i[2], "XYZ"),
74
- geometry: Ue(n.shape),
73
+ rotation: new g.Euler(o[0], o[1], o[2], "XYZ"),
74
+ geometry: Be(n.shape),
75
75
  children: t
76
76
  }
77
77
  );
78
78
  }
79
- function je({
79
+ function Je({
80
80
  name: e,
81
81
  colliders: n,
82
82
  meshChildrenProvider: t,
83
- ...l
83
+ ...s
84
84
  }) {
85
- return /* @__PURE__ */ r("group", { name: e, ...l, children: Object.entries(n).map(([i, f]) => /* @__PURE__ */ r(
86
- Je,
85
+ return /* @__PURE__ */ r("group", { name: e, ...s, children: Object.entries(n).map(([o, u]) => /* @__PURE__ */ r(
86
+ Ce,
87
87
  {
88
- name: i,
89
- collider: f,
90
- children: t(i, f)
88
+ name: o,
89
+ collider: u,
90
+ children: t(o, u)
91
91
  },
92
- i
92
+ o
93
93
  )) });
94
94
  }
95
- function wt({
95
+ function bt({
96
96
  scene: e,
97
97
  meshChildrenProvider: n
98
98
  }) {
99
99
  const t = e.colliders;
100
100
  return /* @__PURE__ */ r("group", { children: t && /* @__PURE__ */ r(
101
- je,
101
+ Je,
102
102
  {
103
103
  meshChildrenProvider: n,
104
104
  colliders: t
105
105
  }
106
106
  ) });
107
107
  }
108
- function ne() {
109
- return /* @__PURE__ */ r(Pe, { frames: 1, children: /* @__PURE__ */ r(We, {}) });
108
+ function oe() {
109
+ return /* @__PURE__ */ r(Ae, { frames: 1, children: /* @__PURE__ */ r(We, {}) });
110
110
  }
111
- const Be = [2, 0, 2, 0, 2, 0, 2, 0];
112
- function We({ positions: e = Be }) {
113
- return /* @__PURE__ */ b(U, { children: [
111
+ const je = [2, 0, 2, 0, 2, 0, 2, 0];
112
+ function We({ positions: e = je }) {
113
+ return /* @__PURE__ */ b(B, { children: [
114
114
  /* @__PURE__ */ r(
115
- A,
115
+ I,
116
116
  {
117
117
  intensity: 5,
118
118
  "rotation-x": Math.PI / 2,
@@ -121,7 +121,7 @@ function We({ positions: e = Be }) {
121
121
  }
122
122
  ),
123
123
  /* @__PURE__ */ r("group", { rotation: [0, 0.5, 0], children: /* @__PURE__ */ r("group", { children: e.map((n, t) => /* @__PURE__ */ r(
124
- A,
124
+ I,
125
125
  {
126
126
  form: "circle",
127
127
  intensity: 5,
@@ -132,7 +132,7 @@ function We({ positions: e = Be }) {
132
132
  t
133
133
  )) }) }),
134
134
  /* @__PURE__ */ r(
135
- A,
135
+ I,
136
136
  {
137
137
  intensity: 40,
138
138
  "rotation-y": Math.PI / 2,
@@ -141,7 +141,7 @@ function We({ positions: e = Be }) {
141
141
  }
142
142
  ),
143
143
  /* @__PURE__ */ r(
144
- A,
144
+ I,
145
145
  {
146
146
  intensity: 20,
147
147
  "rotation-y": -Math.PI,
@@ -150,7 +150,7 @@ function We({ positions: e = Be }) {
150
150
  }
151
151
  ),
152
152
  /* @__PURE__ */ r(
153
- A,
153
+ I,
154
154
  {
155
155
  "rotation-y": Math.PI / 2,
156
156
  position: [-5, -1, -1],
@@ -159,7 +159,7 @@ function We({ positions: e = Be }) {
159
159
  }
160
160
  ),
161
161
  /* @__PURE__ */ r(
162
- A,
162
+ I,
163
163
  {
164
164
  "rotation-y": -Math.PI / 2,
165
165
  position: [10, 1, 0],
@@ -168,7 +168,7 @@ function We({ positions: e = Be }) {
168
168
  }
169
169
  ),
170
170
  /* @__PURE__ */ r(
171
- A,
171
+ I,
172
172
  {
173
173
  form: "ring",
174
174
  color: "white",
@@ -180,7 +180,7 @@ function We({ positions: e = Be }) {
180
180
  )
181
181
  ] });
182
182
  }
183
- const oe = {
183
+ const ie = {
184
184
  attach: "material",
185
185
  color: "#009f4d",
186
186
  opacity: 0.2,
@@ -189,41 +189,41 @@ const oe = {
189
189
  transparent: !0,
190
190
  polygonOffset: !0
191
191
  };
192
- function bt({
192
+ function xt({
193
193
  safetyZones: e,
194
194
  dhParameters: n,
195
195
  ...t
196
196
  }) {
197
- const l = I(
197
+ const s = P(
198
198
  () => Le(n ?? []),
199
199
  [n]
200
- ), i = (c, o) => {
201
- var u, d;
202
- if (!((u = o == null ? void 0 : o.pose) != null && u.position) || !((d = o == null ? void 0 : o.pose) != null && d.orientation))
200
+ ), o = (c, i) => {
201
+ var f, d;
202
+ if (!((f = i == null ? void 0 : i.pose) != null && f.position) || !((d = i == null ? void 0 : i.pose) != null && d.orientation))
203
203
  return null;
204
204
  const y = new g.Vector3(
205
- o.pose.position[0] / 1e3,
206
- o.pose.position[1] / 1e3,
207
- o.pose.position[2] / 1e3
208
- ), s = new g.Vector3(
209
- o.pose.orientation[0],
210
- o.pose.orientation[1],
211
- o.pose.orientation[2]
205
+ i.pose.position[0] / 1e3,
206
+ i.pose.position[1] / 1e3,
207
+ i.pose.position[2] / 1e3
208
+ ), a = new g.Vector3(
209
+ i.pose.orientation[0],
210
+ i.pose.orientation[1],
211
+ i.pose.orientation[2]
212
212
  );
213
213
  let h;
214
- const a = o.shape.shape_type === "plane" ? { ...oe, side: g.DoubleSide } : { ...oe, side: g.FrontSide };
215
- switch (o.shape.shape_type) {
214
+ const l = i.shape.shape_type === "plane" ? { ...ie, side: g.DoubleSide } : { ...ie, side: g.FrontSide };
215
+ switch (i.shape.shape_type) {
216
216
  /**
217
217
  * Plane shape, uses DH parameters to calculate the size of the plane (reach distance of a robot)
218
218
  */
219
219
  case "plane":
220
- h = /* @__PURE__ */ r("planeGeometry", { args: [l, l] });
220
+ h = /* @__PURE__ */ r("planeGeometry", { args: [s, s] });
221
221
  break;
222
222
  /**
223
223
  * Sphere shape
224
224
  */
225
225
  case "sphere": {
226
- const p = (o == null ? void 0 : o.shape).radius / 1e3;
226
+ const p = (i == null ? void 0 : i.shape).radius / 1e3;
227
227
  h = /* @__PURE__ */ r("sphereGeometry", { args: [p] });
228
228
  break;
229
229
  }
@@ -231,7 +231,7 @@ function bt({
231
231
  * Capsule shape
232
232
  */
233
233
  case "capsule": {
234
- const p = (o == null ? void 0 : o.shape).radius / 1e3, m = (o == null ? void 0 : o.shape).cylinder_height / 1e3;
234
+ const p = (i == null ? void 0 : i.shape).radius / 1e3, m = (i == null ? void 0 : i.shape).cylinder_height / 1e3;
235
235
  h = /* @__PURE__ */ r("capsuleGeometry", { args: [p, m] });
236
236
  break;
237
237
  }
@@ -240,9 +240,9 @@ function bt({
240
240
  * renderer to be able to visualize the convex hull.
241
241
  */
242
242
  case "convex_hull": {
243
- const p = (o == null ? void 0 : o.shape).vertices.map(
243
+ const p = (i == null ? void 0 : i.shape).vertices.map(
244
244
  (w) => new g.Vector3(w[0] / 1e3, w[1] / 1e3, w[2] / 1e3)
245
- ), m = Ae(p);
245
+ ), m = Ie(p);
246
246
  if (m.isCoplanar && m.normal) {
247
247
  const x = new g.Vector3().addVectors(
248
248
  p[0],
@@ -254,7 +254,7 @@ function bt({
254
254
  h = /* @__PURE__ */ r(
255
255
  "primitive",
256
256
  {
257
- object: new se(p),
257
+ object: new ae(p),
258
258
  attach: "geometry"
259
259
  }
260
260
  );
@@ -271,11 +271,11 @@ function bt({
271
271
  * Basically a rounded box with a rectangular cross-section.
272
272
  */
273
273
  case "rectangular_capsule": {
274
- const p = o.shape, m = p.radius / 1e3, w = p.sphere_center_distance_x / 1e3, x = p.sphere_center_distance_y / 1e3, P = m * 2;
274
+ const p = i.shape, m = p.radius / 1e3, w = p.sphere_center_distance_x / 1e3, x = p.sphere_center_distance_y / 1e3, A = m * 2;
275
275
  h = /* @__PURE__ */ r(
276
276
  "primitive",
277
277
  {
278
- object: new ke(w, x, P, 2, m),
278
+ object: new ke(w, x, A, 2, m),
279
279
  attach: "geometry"
280
280
  }
281
281
  );
@@ -284,7 +284,7 @@ function bt({
284
284
  default:
285
285
  console.warn(
286
286
  "Unsupported safety zone shape type:",
287
- o.shape.shape_type
287
+ i.shape.shape_type
288
288
  ), h = null;
289
289
  }
290
290
  return /* @__PURE__ */ b(
@@ -292,31 +292,31 @@ function bt({
292
292
  {
293
293
  renderOrder: c,
294
294
  position: y,
295
- quaternion: Ie(s),
295
+ quaternion: Pe(a),
296
296
  children: [
297
297
  h,
298
- /* @__PURE__ */ r("meshStandardMaterial", { ...a, polygonOffsetFactor: -c })
298
+ /* @__PURE__ */ r("meshStandardMaterial", { ...l, polygonOffsetFactor: -c })
299
299
  ]
300
300
  },
301
- `safety-zone-${o.shape.shape_type}-${c}`
301
+ `safety-zone-${i.shape.shape_type}-${c}`
302
302
  );
303
- }, f = I(() => Object.values(e ?? {}).map(
304
- (c, o) => i(o, c)
305
- ), [e, l]);
306
- return /* @__PURE__ */ r("group", { ...t, children: f });
303
+ }, u = P(() => Object.values(e ?? {}).map(
304
+ (c, i) => o(i, c)
305
+ ), [e, s]);
306
+ return /* @__PURE__ */ r("group", { ...t, children: u });
307
307
  }
308
- function xt({
308
+ function Rt({
309
309
  trajectory: e,
310
310
  ...n
311
311
  }) {
312
- const t = (e == null ? void 0 : e.map((l) => {
313
- if (l.position && l.position.length >= 3) {
314
- const [i, f, c] = l.position;
315
- if (Number.isFinite(i) && Number.isFinite(f) && Number.isFinite(c))
316
- return new g.Vector3(i / 1e3, c / 1e3, -f / 1e3);
312
+ const t = (e == null ? void 0 : e.map((s) => {
313
+ if (s.position && s.position.length >= 3) {
314
+ const [o, u, c] = s.position;
315
+ if (Number.isFinite(o) && Number.isFinite(u) && Number.isFinite(c))
316
+ return new g.Vector3(o / 1e3, c / 1e3, -u / 1e3);
317
317
  }
318
318
  return null;
319
- }).filter((l) => l !== null)) || [];
319
+ }).filter((s) => s !== null)) || [];
320
320
  return /* @__PURE__ */ r("group", { ...n, children: t.length > 0 && /* @__PURE__ */ r(
321
321
  $,
322
322
  {
@@ -328,31 +328,31 @@ function xt({
328
328
  }
329
329
  ) });
330
330
  }
331
- const B = /* @__PURE__ */ new Map();
332
- async function j(e, n) {
333
- if (B.has(e))
334
- return B.get(e);
331
+ const j = /* @__PURE__ */ new Map();
332
+ async function J(e, n) {
333
+ if (j.has(e))
334
+ return j.get(e);
335
335
  const t = (async () => {
336
336
  var c;
337
- const l = n || "", i = new Ce({ instanceUrl: l }), f = i.api.motionGroupModels;
338
- (c = f.axios) != null && c.interceptors && f.axios.interceptors.request.use((o) => {
337
+ const s = n || "", o = new Ue({ instanceUrl: s }), u = o.api.motionGroupModels;
338
+ (c = u.axios) != null && c.interceptors && u.axios.interceptors.request.use((i) => {
339
339
  var y;
340
- return (y = o.url) != null && y.includes("/glb") && (o.responseType = "blob"), o;
340
+ return (y = i.url) != null && y.includes("/glb") && (i.responseType = "blob"), i;
341
341
  });
342
342
  try {
343
- const o = await i.api.motionGroupModels.getMotionGroupGlbModel(
343
+ const i = await o.api.motionGroupModels.getMotionGroupGlbModel(
344
344
  e
345
345
  );
346
- return URL.createObjectURL(o);
347
- } catch (o) {
348
- throw console.error("Failed to fetch model:", o), o;
346
+ return URL.createObjectURL(i);
347
+ } catch (i) {
348
+ throw console.error("Failed to fetch model:", i), i;
349
349
  }
350
350
  })();
351
- return B.set(e, t), t;
351
+ return j.set(e, t), t;
352
352
  }
353
353
  function de(e) {
354
354
  function n(t) {
355
- return t.children.length === 0 ? [t] : [t, ...t.children.flatMap((l) => n(l))];
355
+ return t.children.length === 0 ? [t] : [t, ...t.children.flatMap((s) => n(s))];
356
356
  }
357
357
  return n(e).filter((t) => me(t));
358
358
  }
@@ -364,108 +364,122 @@ function me(e) {
364
364
  }
365
365
  function $e(e, n) {
366
366
  let t;
367
- function l(i) {
368
- if (he(i)) {
367
+ function s(o) {
368
+ if (he(o)) {
369
369
  if (t)
370
370
  throw Error(
371
- `Found multiple flange groups in robot model ${n}; first ${t.name} then ${i.name}. Only one _FLG group is allowed.`
371
+ `Found multiple flange groups in robot model ${n}; first ${t.name} then ${o.name}. Only one _FLG group is allowed.`
372
372
  );
373
- t = i;
373
+ t = o;
374
374
  }
375
- me(i), i.children.map(l);
375
+ me(o), o.children.map(s);
376
376
  }
377
- if (l(e.scene), !t)
377
+ if (s(e.scene), !t)
378
378
  throw Error(
379
379
  `No flange group found in robot model ${n}. Flange must be identified with a name ending in _FLG.`
380
380
  );
381
381
  return { gltf: e };
382
382
  }
383
+ function Ne(e, n = 2e3, t = 200) {
384
+ const { invalidate: s } = N(), o = R(null), u = R(null), c = S(() => {
385
+ o.current && (clearInterval(o.current), o.current = null), u.current && (clearTimeout(u.current), u.current = null);
386
+ }, []), i = S(() => {
387
+ c(), o.current = setInterval(() => {
388
+ s();
389
+ }, t), u.current = setTimeout(() => {
390
+ c(), s();
391
+ }, n);
392
+ }, [n, t, s, c]);
393
+ return T(() => (e !== null && i(), () => {
394
+ c();
395
+ }), [e, i, c]), { startBoost: i, stopBoost: c };
396
+ }
383
397
  function ye({
384
398
  rapidlyChangingMotionState: e,
385
399
  dhParameters: n,
386
400
  onRotationChanged: t,
387
- children: l
401
+ children: s
388
402
  }) {
389
- const i = M([]), f = M(null), { invalidate: c } = le(), o = M(e);
390
- o.current = e, T(() => {
391
- const a = e.joint_position.filter(
392
- (u) => u !== void 0
403
+ const o = R([]), u = R(null), { invalidate: c } = N(), i = R(e);
404
+ i.current = e, Ne(e.motion_group, 2e3, 200), T(() => {
405
+ const l = e.joint_position.filter(
406
+ (f) => f !== void 0
393
407
  );
394
- return f.current = new ue(a, {
408
+ return u.current = new ue(l, {
395
409
  tension: 120,
396
410
  // Controls spring stiffness - higher values create faster, more responsive motion
397
411
  friction: 20,
398
412
  // Controls damping - higher values reduce oscillation and create smoother settling
399
413
  threshold: 1e-3
400
414
  }), () => {
401
- var u;
402
- (u = f.current) == null || u.destroy();
415
+ var f;
416
+ (f = u.current) == null || f.destroy();
403
417
  };
404
- }, []), ce((a, u) => {
405
- if (f.current) {
406
- const d = f.current.update(u);
407
- s(), d || c();
418
+ }, []), le((l, f) => {
419
+ if (u.current) {
420
+ const d = u.current.update(f);
421
+ a(), d || c();
408
422
  }
409
423
  });
410
- function y(a) {
411
- a && (i.current = de(a), s(), c());
424
+ function y(l) {
425
+ l && (o.current = de(l), a(), c());
412
426
  }
413
- function s() {
414
- var u;
415
- const a = ((u = f.current) == null ? void 0 : u.getCurrentValues()) || [];
427
+ function a() {
428
+ var f;
429
+ const l = ((f = u.current) == null ? void 0 : f.getCurrentValues()) || [];
416
430
  if (t)
417
- t(i.current, a);
431
+ t(o.current, l);
418
432
  else
419
- for (const [d, p] of i.current.entries()) {
433
+ for (const [d, p] of o.current.entries()) {
420
434
  const m = n[d], w = m.theta || 0, x = m.reverse_rotation_direction ? -1 : 1;
421
- p.rotation.y = x * (a[d] || 0) + w;
435
+ p.rotation.y = x * (l[d] || 0) + w;
422
436
  }
423
437
  }
424
- function h(a) {
438
+ function h(l) {
425
439
  var d;
426
- const u = a.joint_position.filter(
440
+ const f = l.joint_position.filter(
427
441
  (p) => p !== void 0
428
442
  );
429
- (d = f.current) == null || d.setTarget(u), c();
443
+ (d = u.current) == null || d.setTarget(f), c();
430
444
  }
431
445
  return fe(() => {
432
- h(o.current);
446
+ h(i.current);
433
447
  }), T(() => {
434
448
  h(e);
435
- }, [e]), /* @__PURE__ */ r("group", { ref: y, children: l });
449
+ }, [e]), /* @__PURE__ */ r("group", { ref: y, children: s });
436
450
  }
437
- const Ne = "line", He = "mesh";
438
- function Ye({
451
+ const He = "line", Ye = "mesh";
452
+ function qe({
439
453
  rapidlyChangingMotionState: e,
440
454
  dhParameters: n,
441
455
  ...t
442
456
  }) {
443
- const l = new R(), i = M([]), f = M([]);
457
+ const s = new v(), o = R([]), u = R([]);
444
458
  Ge.useEffect(() => {
445
- i.current = new Array(n.length).fill(null), f.current = new Array(n.length).fill(null);
459
+ o.current = new Array(n.length).fill(null), u.current = new Array(n.length).fill(null);
446
460
  }, [n.length]);
447
- function c(s, h) {
448
- const a = new k(), u = new W(), d = new k();
449
- l.decompose(a, u, d);
450
- const p = a.clone(), m = new R().makeRotationY(
451
- s.theta + h * (s.reverse_rotation_direction ? -1 : 1)
452
- ).multiply(new R().makeTranslation(0, s.d / 1e3, 0)).multiply(new R().makeTranslation(s.a / 1e3, 0, 0)).multiply(new R().makeRotationX(s.alpha));
453
- return l.multiply(m), l.decompose(a, u, d), { a: p, b: a };
461
+ function c(a, h) {
462
+ const l = new G(), f = new W(), d = new G();
463
+ s.decompose(l, f, d);
464
+ const p = l.clone(), m = new v().makeRotationY(
465
+ a.theta + h * (a.reverse_rotation_direction ? -1 : 1)
466
+ ).multiply(new v().makeTranslation(0, a.d / 1e3, 0)).multiply(new v().makeTranslation(a.a / 1e3, 0, 0)).multiply(new v().makeRotationX(a.alpha));
467
+ return s.multiply(m), s.decompose(l, f, d), { a: p, b: l };
454
468
  }
455
- function o(s, h, a, u) {
469
+ function i(a, h, l, f) {
456
470
  if (!n)
457
471
  return;
458
- const d = n[s];
472
+ const d = n[a];
459
473
  if (!d)
460
474
  return;
461
- const { a: p, b: m } = c(d, u);
462
- h.geometry.setPositions([p.toArray(), m.toArray()].flat()), a.position.set(m.x, m.y, m.z);
475
+ const { a: p, b: m } = c(d, f);
476
+ h.geometry.setPositions([p.toArray(), m.toArray()].flat()), l.position.set(m.x, m.y, m.z);
463
477
  }
464
- function y(s, h) {
465
- l.identity();
466
- for (let a = 0; a < Math.min(s.length, h.length); a++) {
467
- const u = i.current[a], d = f.current[a];
468
- u && d && o(a, u, d, h[a]);
478
+ function y(a, h) {
479
+ s.identity();
480
+ for (let l = 0; l < Math.min(a.length, h.length); l++) {
481
+ const f = o.current[l], d = u.current[l];
482
+ f && d && i(l, f, d, h[l]);
469
483
  }
470
484
  }
471
485
  return /* @__PURE__ */ r(
@@ -479,9 +493,9 @@ function Ye({
479
493
  /* @__PURE__ */ r("sphereGeometry", { args: [0.01, 32, 32] }),
480
494
  /* @__PURE__ */ r("meshStandardMaterial", { color: "black", depthTest: !0 })
481
495
  ] }),
482
- n == null ? void 0 : n.map((s, h) => {
483
- const { a, b: u } = c(
484
- s,
496
+ n == null ? void 0 : n.map((a, h) => {
497
+ const { a: l, b: f } = c(
498
+ a,
485
499
  e.joint_position[h] ?? 0
486
500
  ), d = `dhrobot_J0${h}`;
487
501
  return /* @__PURE__ */ b("group", { name: d, children: [
@@ -489,10 +503,10 @@ function Ye({
489
503
  $,
490
504
  {
491
505
  ref: (p) => {
492
- i.current[h] = p;
506
+ o.current[h] = p;
493
507
  },
494
- name: Ne,
495
- points: [a, u],
508
+ name: He,
509
+ points: [l, f],
496
510
  color: "white",
497
511
  lineWidth: 5
498
512
  }
@@ -501,10 +515,10 @@ function Ye({
501
515
  "mesh",
502
516
  {
503
517
  ref: (p) => {
504
- f.current[h] = p;
518
+ u.current[h] = p;
505
519
  },
506
- name: He,
507
- position: u,
520
+ name: Ye,
521
+ position: f,
508
522
  children: [
509
523
  /* @__PURE__ */ r("sphereGeometry", { args: [0.01, 32, 32] }),
510
524
  /* @__PURE__ */ r("meshStandardMaterial", { color: "black", depthTest: !0 })
@@ -518,92 +532,92 @@ function Ye({
518
532
  }
519
533
  );
520
534
  }
521
- const qe = console.warn;
535
+ const Xe = console.warn;
522
536
  function ge() {
523
537
  return T(() => {
524
538
  console.warn = (e) => {
525
- e !== "Cannot call the manual advancement of rafz whilst frameLoop is not set as demand" && qe(e);
539
+ e !== "Cannot call the manual advancement of rafz whilst frameLoop is not set as demand" && Xe(e);
526
540
  };
527
541
  }, []), null;
528
542
  }
529
- function Xe(e) {
543
+ function Ke(e) {
530
544
  return e.type === "Mesh";
531
545
  }
532
- function Ke({
546
+ function Ze({
533
547
  url: e,
534
548
  flangeRef: n,
535
549
  postModelRender: t,
536
- ...l
550
+ ...s
537
551
  }) {
538
- const i = Fe(e), c = $e(i, "robot.glb").gltf, o = L(
539
- (s) => {
540
- s && t && t();
552
+ const o = Fe(e), c = $e(o, "robot.glb").gltf, i = S(
553
+ (a) => {
554
+ a && t && t();
541
555
  },
542
556
  [t]
543
557
  );
544
- function y(s) {
558
+ function y(a) {
545
559
  try {
546
- return Xe(s) ? s.geometry ? /* @__PURE__ */ r(
560
+ return Ke(a) ? a.geometry ? /* @__PURE__ */ r(
547
561
  "mesh",
548
562
  {
549
- name: s.name,
550
- geometry: s.geometry,
551
- material: s.material,
552
- position: s.position,
553
- rotation: s.rotation
563
+ name: a.name,
564
+ geometry: a.geometry,
565
+ material: a.material,
566
+ position: a.position,
567
+ rotation: a.rotation
554
568
  },
555
- s.uuid
569
+ a.uuid
556
570
  ) : /* @__PURE__ */ r(
557
571
  "group",
558
572
  {
559
- name: s.name,
560
- position: s.position,
561
- rotation: s.rotation
573
+ name: a.name,
574
+ position: a.position,
575
+ rotation: a.rotation
562
576
  },
563
- s.uuid
577
+ a.uuid
564
578
  ) : /* @__PURE__ */ r(
565
579
  "group",
566
580
  {
567
- name: s.name,
568
- position: s.position,
569
- rotation: s.rotation,
570
- ref: he(s) ? n : void 0,
571
- children: s.children.map(y)
581
+ name: a.name,
582
+ position: a.position,
583
+ rotation: a.rotation,
584
+ ref: he(a) ? n : void 0,
585
+ children: a.children.map(y)
572
586
  },
573
- s.uuid
587
+ a.uuid
574
588
  );
575
589
  } catch (h) {
576
- return console.warn("Error rendering node", s.name, h), null;
590
+ return console.warn("Error rendering node", a.name, h), null;
577
591
  }
578
592
  }
579
- return /* @__PURE__ */ r("group", { ...l, dispose: null, ref: o, children: y(c.scene) });
593
+ return /* @__PURE__ */ r("group", { ...s, dispose: null, ref: i, children: y(c.scene) });
580
594
  }
581
595
  function we({
582
596
  modelURL: e,
583
597
  flangeRef: n,
584
598
  postModelRender: t,
585
- ...l
599
+ ...s
586
600
  }) {
587
- const [i, f] = G(null);
601
+ const [o, u] = L(null);
588
602
  return T(() => {
589
603
  let c = !1;
590
604
  return (async () => {
591
605
  try {
592
606
  const y = typeof e == "string" ? e : await e;
593
- c || f((s) => s === y ? s : y);
607
+ c || u((a) => a === y ? a : y);
594
608
  } catch (y) {
595
609
  console.error("Failed to resolve model URL:", y);
596
610
  }
597
611
  })(), () => {
598
612
  c = !0;
599
613
  };
600
- }, [e]), i ? /* @__PURE__ */ r(
601
- Ke,
614
+ }, [e]), o ? /* @__PURE__ */ r(
615
+ Ze,
602
616
  {
603
- url: i,
617
+ url: o,
604
618
  flangeRef: n,
605
619
  postModelRender: t,
606
- ...l
620
+ ...s
607
621
  }
608
622
  ) : null;
609
623
  }
@@ -611,15 +625,15 @@ const be = (e, n) => {
611
625
  e.userData.isGhost || (e.traverse((t) => {
612
626
  if (t instanceof g.Mesh) {
613
627
  t.material instanceof g.Material && (t.material.colorWrite = !1);
614
- const l = t.clone(), i = t.clone();
615
- l.material = new g.MeshStandardMaterial({
628
+ const s = t.clone(), o = t.clone();
629
+ s.material = new g.MeshStandardMaterial({
616
630
  depthTest: !0,
617
631
  depthWrite: !0,
618
632
  colorWrite: !1,
619
633
  polygonOffset: !0,
620
634
  polygonOffsetFactor: -1,
621
635
  side: g.DoubleSide
622
- }), l.userData.isGhost = !0, i.material = new g.MeshStandardMaterial({
636
+ }), s.userData.isGhost = !0, o.material = new g.MeshStandardMaterial({
623
637
  color: n,
624
638
  opacity: 0.3,
625
639
  depthTest: !0,
@@ -628,45 +642,45 @@ const be = (e, n) => {
628
642
  polygonOffset: !0,
629
643
  polygonOffsetFactor: -2,
630
644
  side: g.DoubleSide
631
- }), i.userData.isGhost = !0, t.parent && (t.parent.add(l), t.parent.add(i));
645
+ }), o.userData.isGhost = !0, t.parent && (t.parent.add(s), t.parent.add(o));
632
646
  }
633
647
  }), e.userData.isGhost = !0);
634
648
  }, xe = (e) => {
635
649
  if (!e.userData.isGhost) return;
636
650
  const n = [];
637
651
  e.traverse((t) => {
638
- var l;
639
- t instanceof g.Mesh && ((l = t.userData) != null && l.isGhost ? n.push(t) : t.material instanceof g.Material && (t.material.colorWrite = !0));
652
+ var s;
653
+ t instanceof g.Mesh && ((s = t.userData) != null && s.isGhost ? n.push(t) : t.material instanceof g.Material && (t.material.colorWrite = !0));
640
654
  }), n.forEach((t) => {
641
655
  t.parent && t.parent.remove(t);
642
656
  }), e.userData.isGhost = !1;
643
- }, Re = J(
657
+ }, Re = C(
644
658
  ({
645
659
  rapidlyChangingMotionState: e,
646
660
  modelFromController: n,
647
661
  dhParameters: t,
648
- getModel: l = j,
649
- flangeRef: i,
650
- postModelRender: f,
662
+ getModel: s = J,
663
+ flangeRef: o,
664
+ postModelRender: u,
651
665
  transparentColor: c,
652
- instanceUrl: o,
666
+ instanceUrl: i,
653
667
  ...y
654
668
  }) => {
655
- const [s, h] = G(null), a = L((p) => {
669
+ const [a, h] = L(null), l = S((p) => {
656
670
  h(p);
657
671
  }, []);
658
672
  T(() => {
659
- s && (c ? be(s, c) : xe(s));
660
- }, [s, c]);
661
- const u = I(() => {
662
- const p = l(n, o);
673
+ a && (c ? be(a, c) : xe(a));
674
+ }, [a, c]);
675
+ const f = P(() => {
676
+ const p = s(n, i);
663
677
  if (!p)
664
678
  throw new Error(
665
679
  `No model found for robot "${n}". Ensure the model is available or provide a custom getModel function.`
666
680
  );
667
681
  return p;
668
- }, [n, o, l]), d = /* @__PURE__ */ r(
669
- Ye,
682
+ }, [n, i, s]), d = /* @__PURE__ */ r(
683
+ qe,
670
684
  {
671
685
  rapidlyChangingMotionState: e,
672
686
  dhParameters: t,
@@ -681,7 +695,7 @@ const be = (e, n) => {
681
695
  console.warn(p);
682
696
  },
683
697
  children: [
684
- /* @__PURE__ */ r(ae, { fallback: d, children: /* @__PURE__ */ r("group", { ref: a, children: /* @__PURE__ */ r(
698
+ /* @__PURE__ */ r(ce, { fallback: d, children: /* @__PURE__ */ r("group", { ref: l, children: /* @__PURE__ */ r(
685
699
  ye,
686
700
  {
687
701
  rapidlyChangingMotionState: e,
@@ -689,9 +703,9 @@ const be = (e, n) => {
689
703
  children: /* @__PURE__ */ r(
690
704
  we,
691
705
  {
692
- modelURL: u,
693
- postModelRender: f,
694
- flangeRef: i,
706
+ modelURL: f,
707
+ postModelRender: u,
708
+ flangeRef: o,
695
709
  ...y
696
710
  }
697
711
  )
@@ -703,13 +717,13 @@ const be = (e, n) => {
703
717
  );
704
718
  }
705
719
  );
706
- function Ze({
720
+ function Qe({
707
721
  connectedMotionGroup: e,
708
- getModel: n = j,
722
+ getModel: n = J,
709
723
  flangeRef: t,
710
- transparentColor: l,
711
- postModelRender: i,
712
- ...f
724
+ transparentColor: s,
725
+ postModelRender: o,
726
+ ...u
713
727
  }) {
714
728
  return e.dhParameters ? /* @__PURE__ */ r(
715
729
  Re,
@@ -719,51 +733,51 @@ function Ze({
719
733
  dhParameters: e.dhParameters,
720
734
  getModel: n,
721
735
  flangeRef: t,
722
- transparentColor: l,
723
- postModelRender: i,
724
- ...f
736
+ transparentColor: s,
737
+ postModelRender: o,
738
+ ...u
725
739
  }
726
740
  ) : null;
727
741
  }
728
- const Rt = J(
742
+ const vt = C(
729
743
  Ve(
730
744
  ({
731
745
  robotName: e,
732
746
  programState: n,
733
747
  safetyState: t,
734
- operationMode: l,
735
- driveToHomeEnabled: i = !1,
736
- onDriveToHomePress: f,
748
+ operationMode: s,
749
+ driveToHomeEnabled: o = !1,
750
+ onDriveToHomePress: u,
737
751
  onDriveToHomeRelease: c,
738
- connectedMotionGroup: o,
739
- robotComponent: y = Ze,
740
- customContentComponent: s,
752
+ connectedMotionGroup: i,
753
+ robotComponent: y = Qe,
754
+ customContentComponent: a,
741
755
  className: h
742
756
  }) => {
743
- var Y;
744
- const a = De(), { t: u } = Ee(), [d, p] = G(!1), m = M(null), w = M(null), [x, P] = G(!1), [F, Te] = G({ width: 400, height: 600 }), [ze, Se] = G(0);
757
+ var q;
758
+ const l = De(), { t: f } = Ee(), [d, p] = L(!1), m = R(null), w = R(null), [x, A] = L(!1), [F, Te] = L({ width: 400, height: 600 }), [et, Se] = L(0);
745
759
  T(() => {
746
760
  const E = () => {
747
761
  if (w.current) {
748
- const { offsetWidth: X, offsetHeight: K } = w.current;
749
- P(X > K), Te({ width: X, height: K });
762
+ const { offsetWidth: K, offsetHeight: Z } = w.current;
763
+ A(K > Z), Te({ width: K, height: Z });
750
764
  }
751
765
  };
752
766
  E();
753
- const q = new ResizeObserver(E);
754
- return w.current && q.observe(w.current), () => {
755
- q.disconnect();
767
+ const X = new ResizeObserver(E);
768
+ return w.current && X.observe(w.current), () => {
769
+ X.disconnect();
756
770
  };
757
771
  }, []);
758
- const N = L(() => {
772
+ const H = S(() => {
759
773
  Se((E) => E + 1);
760
- }, []), D = L(() => {
761
- !i || !f || (p(!0), f());
762
- }, [i, f]), O = L(() => {
763
- !i || !c || (p(!1), c());
764
- }, [i, c]), H = L(() => {
774
+ }, []), D = S(() => {
775
+ !o || !u || (p(!0), u());
776
+ }, [o, u]), O = S(() => {
777
+ !o || !c || (p(!1), c());
778
+ }, [o, c]), Y = S(() => {
765
779
  d && c && (p(!1), c());
766
- }, [d, c]), S = x ? F.width < 350 : F.height < 200, V = x ? F.height < 310 : F.height < 450;
780
+ }, [d, c]), k = x ? F.width < 350 : F.height < 200, V = x ? F.height < 310 : F.height < 450;
767
781
  return /* @__PURE__ */ r(
768
782
  Oe,
769
783
  {
@@ -779,16 +793,16 @@ const Rt = J(
779
793
  minWidth: { xs: 180, sm: 220, md: 250 },
780
794
  minHeight: x ? { xs: 200, sm: 240, md: 260 } : { xs: 150, sm: 180, md: 220 },
781
795
  // Allow progressive hiding in portrait mode
782
- border: `1px solid ${a.palette.divider}`,
796
+ border: `1px solid ${l.palette.divider}`,
783
797
  borderRadius: "18px",
784
798
  boxShadow: "none",
785
- backgroundColor: ((Y = a.palette.backgroundPaperElevation) == null ? void 0 : Y[8]) || "#2A2A3F",
799
+ backgroundColor: ((q = l.palette.backgroundPaperElevation) == null ? void 0 : q[8]) || "#2A2A3F",
786
800
  backgroundImage: "none"
787
801
  // Override any gradient from elevation
788
802
  },
789
- children: x ? /* @__PURE__ */ b(U, { children: [
803
+ children: x ? /* @__PURE__ */ b(B, { children: [
790
804
  /* @__PURE__ */ r(
791
- v,
805
+ M,
792
806
  {
793
807
  sx: {
794
808
  flex: "0 0 50%",
@@ -801,10 +815,10 @@ const Rt = J(
801
815
  mr: { xs: 0.75, sm: 1, md: 1.5 },
802
816
  overflow: "hidden",
803
817
  // Prevent content from affecting container size
804
- display: S ? "none" : "block"
818
+ display: k ? "none" : "block"
805
819
  },
806
- children: !S && /* @__PURE__ */ b(
807
- te,
820
+ children: !k && /* @__PURE__ */ b(
821
+ re,
808
822
  {
809
823
  orthographic: !0,
810
824
  camera: {
@@ -814,7 +828,7 @@ const Rt = J(
814
828
  shadows: !0,
815
829
  frameloop: "demand",
816
830
  style: {
817
- borderRadius: a.shape.borderRadius,
831
+ borderRadius: l.shape.borderRadius,
818
832
  width: "100%",
819
833
  height: "100%",
820
834
  background: "transparent",
@@ -825,12 +839,12 @@ const Rt = J(
825
839
  dpr: [1, 2],
826
840
  gl: { alpha: !0, antialias: !0 },
827
841
  children: [
828
- /* @__PURE__ */ r(ne, {}),
829
- /* @__PURE__ */ r(Z, { fit: !0, observe: !0, margin: 1, maxDuration: 1, children: /* @__PURE__ */ r(
842
+ /* @__PURE__ */ r(oe, {}),
843
+ /* @__PURE__ */ r(Q, { fit: !0, observe: !0, margin: 1, maxDuration: 1, children: /* @__PURE__ */ r(
830
844
  y,
831
845
  {
832
- connectedMotionGroup: o,
833
- postModelRender: N
846
+ connectedMotionGroup: i,
847
+ postModelRender: H
834
848
  }
835
849
  ) })
836
850
  ]
@@ -839,18 +853,18 @@ const Rt = J(
839
853
  }
840
854
  ),
841
855
  /* @__PURE__ */ b(
842
- v,
856
+ M,
843
857
  {
844
858
  sx: {
845
859
  flex: "1",
846
860
  display: "flex",
847
861
  flexDirection: "column",
848
862
  justifyContent: "flex-start",
849
- width: S ? "100%" : "50%"
863
+ width: k ? "100%" : "50%"
850
864
  },
851
865
  children: [
852
866
  /* @__PURE__ */ b(
853
- v,
867
+ M,
854
868
  {
855
869
  sx: {
856
870
  p: { xs: 1.5, sm: 2, md: 3 },
@@ -858,20 +872,20 @@ const Rt = J(
858
872
  textAlign: "left"
859
873
  },
860
874
  children: [
861
- /* @__PURE__ */ r(ee, { variant: "h6", component: "h2", sx: { mb: 1 }, children: e }),
875
+ /* @__PURE__ */ r(te, { variant: "h6", component: "h2", sx: { mb: 1 }, children: e }),
862
876
  /* @__PURE__ */ r(
863
- re,
877
+ ne,
864
878
  {
865
879
  programState: n,
866
880
  safetyState: t,
867
- operationMode: l
881
+ operationMode: s
868
882
  }
869
883
  )
870
884
  ]
871
885
  }
872
886
  ),
873
887
  /* @__PURE__ */ b(
874
- v,
888
+ M,
875
889
  {
876
890
  sx: {
877
891
  p: { xs: 1.5, sm: 2, md: 3 },
@@ -882,28 +896,28 @@ const Rt = J(
882
896
  justifyContent: "space-between"
883
897
  },
884
898
  children: [
885
- !V && s && /* @__PURE__ */ b(v, { children: [
886
- /* @__PURE__ */ r(s, {}),
899
+ !V && a && /* @__PURE__ */ b(M, { children: [
900
+ /* @__PURE__ */ r(a, {}),
887
901
  /* @__PURE__ */ r(
888
- z,
902
+ ee,
889
903
  {
890
904
  sx: {
891
905
  mt: 1,
892
906
  mb: 0,
893
- borderColor: a.palette.divider,
907
+ borderColor: l.palette.divider,
894
908
  opacity: 0.5
895
909
  }
896
910
  }
897
911
  )
898
912
  ] }),
899
913
  /* @__PURE__ */ r(
900
- v,
914
+ M,
901
915
  {
902
916
  sx: {
903
- mt: !V && s ? "auto" : 0
917
+ mt: !V && a ? "auto" : 0
904
918
  },
905
919
  children: /* @__PURE__ */ r(
906
- v,
920
+ M,
907
921
  {
908
922
  sx: {
909
923
  display: "flex",
@@ -912,16 +926,16 @@ const Rt = J(
912
926
  mb: { xs: 0.5, sm: 0.75, md: 1 }
913
927
  },
914
928
  children: /* @__PURE__ */ r(
915
- Q,
929
+ z,
916
930
  {
917
931
  ref: m,
918
932
  variant: "contained",
919
933
  color: "secondary",
920
934
  size: "small",
921
- disabled: !i,
935
+ disabled: !o,
922
936
  onMouseDown: D,
923
937
  onMouseUp: O,
924
- onMouseLeave: H,
938
+ onMouseLeave: Y,
925
939
  onTouchStart: D,
926
940
  onTouchEnd: O,
927
941
  sx: {
@@ -929,7 +943,7 @@ const Rt = J(
929
943
  px: 1.5,
930
944
  py: 0.5
931
945
  },
932
- children: u("RobotCard.DriveToHome.bt")
946
+ children: f("RobotCard.DriveToHome.bt")
933
947
  }
934
948
  )
935
949
  }
@@ -942,8 +956,8 @@ const Rt = J(
942
956
  ]
943
957
  }
944
958
  )
945
- ] }) : /* @__PURE__ */ r(U, { children: /* @__PURE__ */ b(
946
- v,
959
+ ] }) : /* @__PURE__ */ r(B, { children: /* @__PURE__ */ b(
960
+ M,
947
961
  {
948
962
  sx: {
949
963
  p: 3,
@@ -952,31 +966,31 @@ const Rt = J(
952
966
  flexDirection: "column"
953
967
  },
954
968
  children: [
955
- /* @__PURE__ */ b(v, { children: [
956
- /* @__PURE__ */ r(ee, { variant: "h6", component: "h2", sx: { mb: 1 }, children: e }),
969
+ /* @__PURE__ */ b(M, { children: [
970
+ /* @__PURE__ */ r(te, { variant: "h6", component: "h2", sx: { mb: 1 }, children: e }),
957
971
  /* @__PURE__ */ r(
958
- re,
972
+ ne,
959
973
  {
960
974
  programState: n,
961
975
  safetyState: t,
962
- operationMode: l
976
+ operationMode: s
963
977
  }
964
978
  )
965
979
  ] }),
966
980
  /* @__PURE__ */ r(
967
- v,
981
+ M,
968
982
  {
969
983
  sx: {
970
- flex: S ? 0 : 1,
984
+ flex: k ? 0 : 1,
971
985
  position: "relative",
972
- minHeight: S ? 0 : { xs: 120, sm: 150, md: 200 },
973
- height: S ? 0 : "auto",
986
+ minHeight: k ? 0 : { xs: 120, sm: 150, md: 200 },
987
+ height: k ? 0 : "auto",
974
988
  borderRadius: 1,
975
989
  overflow: "hidden",
976
- display: S ? "none" : "block"
990
+ display: k ? "none" : "block"
977
991
  },
978
- children: !S && /* @__PURE__ */ b(
979
- te,
992
+ children: !k && /* @__PURE__ */ b(
993
+ re,
980
994
  {
981
995
  orthographic: !0,
982
996
  camera: {
@@ -986,7 +1000,7 @@ const Rt = J(
986
1000
  shadows: !0,
987
1001
  frameloop: "demand",
988
1002
  style: {
989
- borderRadius: a.shape.borderRadius,
1003
+ borderRadius: l.shape.borderRadius,
990
1004
  width: "100%",
991
1005
  height: "100%",
992
1006
  background: "transparent",
@@ -995,12 +1009,12 @@ const Rt = J(
995
1009
  dpr: [1, 2],
996
1010
  gl: { alpha: !0, antialias: !0 },
997
1011
  children: [
998
- /* @__PURE__ */ r(ne, {}),
999
- /* @__PURE__ */ r(Z, { fit: !0, clip: !0, observe: !0, margin: 1, maxDuration: 1, children: /* @__PURE__ */ r(
1012
+ /* @__PURE__ */ r(oe, {}),
1013
+ /* @__PURE__ */ r(Q, { fit: !0, clip: !0, observe: !0, margin: 1, maxDuration: 1, children: /* @__PURE__ */ r(
1000
1014
  y,
1001
1015
  {
1002
- connectedMotionGroup: o,
1003
- postModelRender: N
1016
+ connectedMotionGroup: i,
1017
+ postModelRender: H
1004
1018
  }
1005
1019
  ) })
1006
1020
  ]
@@ -1008,41 +1022,41 @@ const Rt = J(
1008
1022
  )
1009
1023
  }
1010
1024
  ),
1011
- /* @__PURE__ */ b(v, { children: [
1012
- !V && s && /* @__PURE__ */ b(U, { children: [
1013
- /* @__PURE__ */ r(s, {}),
1025
+ /* @__PURE__ */ b(M, { children: [
1026
+ !V && a && /* @__PURE__ */ b(B, { children: [
1027
+ /* @__PURE__ */ r(a, {}),
1014
1028
  /* @__PURE__ */ r(
1015
- z,
1029
+ ee,
1016
1030
  {
1017
1031
  sx: {
1018
1032
  mt: 1,
1019
1033
  mb: 0,
1020
- borderColor: a.palette.divider,
1034
+ borderColor: l.palette.divider,
1021
1035
  opacity: 0.5
1022
1036
  }
1023
1037
  }
1024
1038
  )
1025
1039
  ] }),
1026
1040
  /* @__PURE__ */ r(
1027
- v,
1041
+ M,
1028
1042
  {
1029
1043
  sx: {
1030
1044
  display: "flex",
1031
1045
  justifyContent: "flex-start",
1032
- mt: !V && s ? { xs: 1, sm: 2, md: 5 } : { xs: 0.5, sm: 1, md: 2 },
1046
+ mt: !V && a ? { xs: 1, sm: 2, md: 5 } : { xs: 0.5, sm: 1, md: 2 },
1033
1047
  mb: { xs: 0.5, sm: 0.75, md: 1 }
1034
1048
  },
1035
1049
  children: /* @__PURE__ */ r(
1036
- Q,
1050
+ z,
1037
1051
  {
1038
1052
  ref: m,
1039
1053
  variant: "contained",
1040
1054
  color: "secondary",
1041
1055
  size: "small",
1042
- disabled: !i,
1056
+ disabled: !o,
1043
1057
  onMouseDown: D,
1044
1058
  onMouseUp: O,
1045
- onMouseLeave: H,
1059
+ onMouseLeave: Y,
1046
1060
  onTouchStart: D,
1047
1061
  onTouchEnd: O,
1048
1062
  sx: {
@@ -1050,7 +1064,7 @@ const Rt = J(
1050
1064
  px: 1.5,
1051
1065
  py: 0.5
1052
1066
  },
1053
- children: u("RobotCard.DriveToHome.bt")
1067
+ children: f("RobotCard.DriveToHome.bt")
1054
1068
  }
1055
1069
  )
1056
1070
  }
@@ -1063,114 +1077,114 @@ const Rt = J(
1063
1077
  );
1064
1078
  }
1065
1079
  )
1066
- ), vt = Array(6).fill(2 * Math.PI);
1080
+ ), Mt = Array(6).fill(2 * Math.PI);
1067
1081
  function ve({
1068
1082
  rapidlyChangingMotionState: e,
1069
1083
  dhParameters: n,
1070
1084
  onTranslationChanged: t,
1071
- children: l
1085
+ children: s
1072
1086
  }) {
1073
- const i = M([]), f = M([]), c = M(null), { invalidate: o } = le();
1087
+ const o = R([]), u = R([]), c = R(null), { invalidate: i } = N();
1074
1088
  T(() => {
1075
- const a = e.joint_position.filter(
1076
- (u) => u !== void 0
1089
+ const l = e.joint_position.filter(
1090
+ (f) => f !== void 0
1077
1091
  );
1078
- return c.current = new ue(a, {
1092
+ return c.current = new ue(l, {
1079
1093
  tension: 120,
1080
1094
  // Controls spring stiffness - higher values create faster, more responsive motion
1081
1095
  friction: 20,
1082
1096
  // Controls damping - higher values reduce oscillation and create smoother settling
1083
1097
  threshold: 1e-3
1084
1098
  }), () => {
1085
- var u;
1086
- (u = c.current) == null || u.destroy();
1099
+ var f;
1100
+ (f = c.current) == null || f.destroy();
1087
1101
  };
1088
- }, []), ce((a, u) => {
1102
+ }, []), le((l, f) => {
1089
1103
  if (c.current) {
1090
- const d = c.current.update(u);
1091
- s(), d || o();
1104
+ const d = c.current.update(f);
1105
+ a(), d || i();
1092
1106
  }
1093
1107
  });
1094
- function y(a) {
1095
- a && (f.current = de(a), s(), o());
1108
+ function y(l) {
1109
+ l && (u.current = de(l), a(), i());
1096
1110
  }
1097
- function s() {
1098
- var u;
1099
- const a = ((u = c.current) == null ? void 0 : u.getCurrentValues()) || [];
1111
+ function a() {
1112
+ var f;
1113
+ const l = ((f = c.current) == null ? void 0 : f.getCurrentValues()) || [];
1100
1114
  if (t)
1101
- t(f.current, a);
1115
+ t(u.current, l);
1102
1116
  else
1103
- for (const [d, p] of f.current.entries()) {
1117
+ for (const [d, p] of u.current.entries()) {
1104
1118
  const w = n[d].reverse_rotation_direction ? -1 : 1;
1105
- p.position.y = w * (a[d] || 0) / 1e3;
1119
+ p.position.y = w * (l[d] || 0) / 1e3;
1106
1120
  }
1107
1121
  }
1108
- const h = L(() => {
1109
- const a = e.joint_position.filter(
1110
- (u) => u !== void 0
1122
+ const h = S(() => {
1123
+ const l = e.joint_position.filter(
1124
+ (f) => f !== void 0
1111
1125
  );
1112
1126
  requestAnimationFrame(() => {
1113
- var u;
1114
- i.current = a, (u = c.current) == null || u.setTarget(a);
1127
+ var f;
1128
+ o.current = l, (f = c.current) == null || f.setTarget(l);
1115
1129
  });
1116
1130
  }, [e]);
1117
1131
  return T(() => {
1118
1132
  h();
1119
1133
  }, [e, h]), fe(() => {
1120
1134
  h();
1121
- }), /* @__PURE__ */ r("group", { ref: y, children: l });
1135
+ }), /* @__PURE__ */ r("group", { ref: y, children: s });
1122
1136
  }
1123
1137
  function Me({
1124
1138
  rapidlyChangingMotionState: e,
1125
1139
  dhParameters: n,
1126
1140
  ...t
1127
1141
  }) {
1128
- const l = new R(), i = M(null), f = M(null);
1129
- function c(s) {
1130
- const h = new R();
1142
+ const s = new v(), o = R(null), u = R(null);
1143
+ function c(a) {
1144
+ const h = new v();
1131
1145
  for (let p = 0; p < n.length; p++) {
1132
- const m = n[p], w = s[p] ?? 0, x = new R().makeRotationY(m.theta).multiply(
1133
- new R().makeTranslation(
1146
+ const m = n[p], w = a[p] ?? 0, x = new v().makeRotationY(m.theta).multiply(
1147
+ new v().makeTranslation(
1134
1148
  m.a / 1e3,
1135
1149
  (m.d + w * (m.reverse_rotation_direction ? -1 : 1)) / 1e3,
1136
1150
  0
1137
1151
  )
1138
- ).multiply(new R().makeRotationX(m.alpha));
1152
+ ).multiply(new v().makeRotationX(m.alpha));
1139
1153
  h.multiply(x);
1140
1154
  }
1141
- const a = new k(), u = new W(), d = new k();
1142
- return h.decompose(a, u, d), a;
1155
+ const l = new G(), f = new W(), d = new G();
1156
+ return h.decompose(l, f, d), l;
1143
1157
  }
1144
- const o = c(
1158
+ const i = c(
1145
1159
  e.joint_position
1146
1160
  );
1147
- function y(s, h) {
1148
- l.identity();
1149
- let a = new k();
1161
+ function y(a, h) {
1162
+ s.identity();
1163
+ let l = new G();
1150
1164
  for (let m = 0; m < n.length; m++) {
1151
- const w = h[m] ?? 0, x = n[m], P = new R().makeRotationY(x.theta).multiply(
1152
- new R().makeTranslation(
1165
+ const w = h[m] ?? 0, x = n[m], A = new v().makeRotationY(x.theta).multiply(
1166
+ new v().makeTranslation(
1153
1167
  x.a / 1e3,
1154
1168
  (x.d + w * (x.reverse_rotation_direction ? -1 : 1)) / 1e3,
1155
1169
  0
1156
1170
  )
1157
- ).multiply(new R().makeRotationX(x.alpha));
1158
- l.multiply(P);
1171
+ ).multiply(new v().makeRotationX(x.alpha));
1172
+ s.multiply(A);
1159
1173
  }
1160
- const u = new k(), d = new W(), p = new k();
1161
- if (l.decompose(u, d, p), a = u, i.current && i.current.position.set(
1162
- a.x,
1163
- a.y,
1164
- a.z
1165
- ), f.current) {
1166
- const m = f.current.geometry;
1174
+ const f = new G(), d = new W(), p = new G();
1175
+ if (s.decompose(f, d, p), l = f, o.current && o.current.position.set(
1176
+ l.x,
1177
+ l.y,
1178
+ l.z
1179
+ ), u.current) {
1180
+ const m = u.current.geometry;
1167
1181
  m != null && m.setPositions && m.setPositions([
1168
1182
  0,
1169
1183
  0,
1170
1184
  0,
1171
- a.x,
1172
- a.y,
1173
- a.z
1185
+ l.x,
1186
+ l.y,
1187
+ l.z
1174
1188
  ]);
1175
1189
  }
1176
1190
  }
@@ -1188,13 +1202,13 @@ function Me({
1188
1202
  /* @__PURE__ */ r(
1189
1203
  $,
1190
1204
  {
1191
- ref: f,
1192
- points: [new k(0, 0, 0), o],
1205
+ ref: u,
1206
+ points: [new G(0, 0, 0), i],
1193
1207
  color: "White",
1194
1208
  lineWidth: 5
1195
1209
  }
1196
1210
  ),
1197
- /* @__PURE__ */ b("mesh", { ref: i, name: "TCP", position: o, children: [
1211
+ /* @__PURE__ */ b("mesh", { ref: o, name: "TCP", position: i, children: [
1198
1212
  /* @__PURE__ */ r("sphereGeometry", { args: [0.025, 32, 32] }),
1199
1213
  /* @__PURE__ */ r("meshStandardMaterial", { color: "red", depthTest: !0 })
1200
1214
  ] })
@@ -1202,25 +1216,25 @@ function Me({
1202
1216
  }
1203
1217
  );
1204
1218
  }
1205
- const _e = J(
1219
+ const _e = C(
1206
1220
  ({
1207
1221
  rapidlyChangingMotionState: e,
1208
1222
  modelFromController: n,
1209
1223
  dhParameters: t,
1210
- getModel: l = j,
1211
- flangeRef: i,
1212
- postModelRender: f,
1224
+ getModel: s = J,
1225
+ flangeRef: o,
1226
+ postModelRender: u,
1213
1227
  transparentColor: c,
1214
- instanceUrl: o,
1228
+ instanceUrl: i,
1215
1229
  ...y
1216
1230
  }) => {
1217
- const [s, h] = G(null), a = L((d) => {
1231
+ const [a, h] = L(null), l = S((d) => {
1218
1232
  h(d);
1219
1233
  }, []);
1220
1234
  T(() => {
1221
- s && (c ? be(s, c) : xe(s));
1222
- }, [s, c]);
1223
- const u = /* @__PURE__ */ r(
1235
+ a && (c ? be(a, c) : xe(a));
1236
+ }, [a, c]);
1237
+ const f = /* @__PURE__ */ r(
1224
1238
  Me,
1225
1239
  {
1226
1240
  rapidlyChangingMotionState: e,
@@ -1231,12 +1245,12 @@ const _e = J(
1231
1245
  return /* @__PURE__ */ b(
1232
1246
  pe,
1233
1247
  {
1234
- fallback: u,
1248
+ fallback: f,
1235
1249
  onError: (d) => {
1236
1250
  console.warn(d);
1237
1251
  },
1238
1252
  children: [
1239
- /* @__PURE__ */ r(ae, { fallback: u, children: /* @__PURE__ */ r("group", { ref: a, children: /* @__PURE__ */ r(
1253
+ /* @__PURE__ */ r(ce, { fallback: f, children: /* @__PURE__ */ r("group", { ref: l, children: /* @__PURE__ */ r(
1240
1254
  ve,
1241
1255
  {
1242
1256
  rapidlyChangingMotionState: e,
@@ -1245,7 +1259,7 @@ const _e = J(
1245
1259
  we,
1246
1260
  {
1247
1261
  modelURL: (() => {
1248
- const d = l(n, o);
1262
+ const d = s(n, i);
1249
1263
  if (!d) {
1250
1264
  const p = new Blob([], { type: "model/gltf-binary" }), m = new File(
1251
1265
  [p],
@@ -1256,8 +1270,8 @@ const _e = J(
1256
1270
  }
1257
1271
  return d;
1258
1272
  })(),
1259
- postModelRender: f,
1260
- flangeRef: i,
1273
+ postModelRender: u,
1274
+ flangeRef: o,
1261
1275
  ...y
1262
1276
  }
1263
1277
  )
@@ -1269,13 +1283,13 @@ const _e = J(
1269
1283
  );
1270
1284
  }
1271
1285
  );
1272
- function Mt({
1286
+ function _t({
1273
1287
  connectedMotionGroup: e,
1274
- getModel: n = j,
1288
+ getModel: n = J,
1275
1289
  flangeRef: t,
1276
- transparentColor: l,
1277
- postModelRender: i,
1278
- ...f
1290
+ transparentColor: s,
1291
+ postModelRender: o,
1292
+ ...u
1279
1293
  }) {
1280
1294
  if (!e.dhParameters)
1281
1295
  return null;
@@ -1288,20 +1302,20 @@ function Mt({
1288
1302
  dhParameters: e.dhParameters,
1289
1303
  getModel: n,
1290
1304
  flangeRef: t,
1291
- transparentColor: l,
1292
- postModelRender: i,
1293
- ...f
1305
+ transparentColor: s,
1306
+ postModelRender: o,
1307
+ ...u
1294
1308
  }
1295
1309
  ) : /* @__PURE__ */ r(
1296
1310
  Me,
1297
1311
  {
1298
1312
  rapidlyChangingMotionState: e.rapidlyChangingMotionState,
1299
1313
  dhParameters: e.dhParameters,
1300
- ...f
1314
+ ...u
1301
1315
  }
1302
1316
  );
1303
1317
  }
1304
- const ie = {
1318
+ const se = {
1305
1319
  [_.Abb]: [0, 0, 0, 0, Math.PI / 2, 0, 0],
1306
1320
  [_.Fanuc]: [0, 0, 0, 0, -Math.PI / 2, 0, 0],
1307
1321
  [_.Yaskawa]: [0, 0, 0, 0, -Math.PI / 2, 0, 0],
@@ -1322,9 +1336,10 @@ const ie = {
1322
1336
  Math.PI / 2,
1323
1337
  -Math.PI / 2,
1324
1338
  0
1325
- ]
1339
+ ],
1340
+ [_.Staubli]: [0, -Math.PI / 2, Math.PI / 2, 0, 0, 0, 0]
1326
1341
  };
1327
- function Qe(e) {
1342
+ function ze(e) {
1328
1343
  const [n] = e.split("_");
1329
1344
  switch (n) {
1330
1345
  case "ABB":
@@ -1337,38 +1352,40 @@ function Qe(e) {
1337
1352
  return _.Kuka;
1338
1353
  case "UniversalRobots":
1339
1354
  return _.Universalrobots;
1355
+ case "STAUBLI":
1356
+ return _.Staubli;
1340
1357
  default:
1341
1358
  return null;
1342
1359
  }
1343
1360
  }
1344
- function _t(e, n) {
1345
- const t = Qe(e);
1346
- return t && t in ie ? ie[t] : n || null;
1361
+ function Tt(e, n) {
1362
+ const t = ze(e);
1363
+ return t && t in se ? se[t] : n || null;
1347
1364
  }
1348
- const Tt = J((e) => {
1349
- const { inverseSolver: n, dhParameters: t, ...l } = e, [i, f] = G(
1350
- C.RevoluteJoint
1365
+ const St = C((e) => {
1366
+ const { inverseSolver: n, dhParameters: t, ...s } = e, [o, u] = L(
1367
+ U.RevoluteJoint
1351
1368
  );
1352
1369
  T(() => {
1353
- t.length && f(t[0].type ?? C.RevoluteJoint);
1370
+ t.length && u(t[0].type ?? U.RevoluteJoint);
1354
1371
  }, [t]);
1355
- const c = I(() => n === null && i === C.RevoluteJoint, [n, i]), o = I(() => n === null && i === C.PrismaticJoint, [n, i]);
1356
- return I(() => !!n, [n]) || c ? /* @__PURE__ */ r(Re, { dhParameters: t, ...l }) : o ? /* @__PURE__ */ r(_e, { dhParameters: t, ...l }) : null;
1372
+ const c = P(() => n === null && o === U.RevoluteJoint, [n, o]), i = P(() => n === null && o === U.PrismaticJoint, [n, o]);
1373
+ return P(() => !!n, [n]) || c ? /* @__PURE__ */ r(Re, { dhParameters: t, ...s }) : i ? /* @__PURE__ */ r(_e, { dhParameters: t, ...s }) : null;
1357
1374
  });
1358
1375
  export {
1359
- wt as C,
1360
- Mt as L,
1361
- ie as M,
1362
- ne as P,
1363
- Rt as R,
1364
- bt as S,
1365
- xt as T,
1366
- vt as a,
1367
- Ze as b,
1376
+ bt as C,
1377
+ _t as L,
1378
+ se as M,
1379
+ oe as P,
1380
+ vt as R,
1381
+ xt as S,
1382
+ Rt as T,
1383
+ Mt as a,
1384
+ Qe as b,
1368
1385
  _e as c,
1369
- j as d,
1370
- Qe as e,
1386
+ J as d,
1387
+ ze as e,
1371
1388
  Re as f,
1372
- _t as g,
1373
- Tt as h
1389
+ Tt as g,
1390
+ St as h
1374
1391
  };