@wandelbots/wandelbots-js-react-components 5.10.0 → 6.0.0-pr.motion-smoothing-config.624.f0bfa13

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