@wandelbots/wandelbots-js-react-components 5.5.1-pr.fix-standardize-output.591.c5418f1 → 5.5.2-pr.fix-performance-issues.594.c24b644

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