@wandelbots/wandelbots-js-react-components
Version:
React UI toolkit for building applications on top of the Wandelbots platform
1,492 lines (1,490 loc) • 1.09 MB
JavaScript
var Kd = Object.defineProperty;
var Yd = (e, t, r) => t in e ? Kd(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
var ua = (e, t, r) => Yd(e, typeof t != "symbol" ? t + "" : t, r);
import * as J from "react";
import Gl, { forwardRef as Le, useEffect as Yt, useState as gr, useRef as Wr, useCallback as Jl, Suspense as Hl, lazy as Xd } from "react";
import { Environment as Zd, Lightformer as sr, Line as ql, useGLTF as eu } from "@react-three/drei";
import { useThree as tu } from "@react-three/fiber";
import * as Ee from "three";
import { Vector3 as Cn, Matrix4 as pa, Quaternion as ru } from "three";
import { ConvexGeometry as au } from "three-stdlib";
import { useTheme as nt, IconButton as Pn, Typography as He, Slider as nu, Stack as Ve, CircularProgress as ou, capitalize as su, styled as ms, InputLabel as iu, Select as lu, FormControl as cu, MenuItem as ha, Box as Us, ToggleButtonGroup as du, Divider as Qr, ToggleButton as Ls, Tabs as uu, Tab as pu, Tooltip as hu, Dialog as mu, DialogTitle as fu, DialogContent as gu, DialogActions as yu, Button as ks, SvgIcon as bu, Popover as Su, Fab as vu, createTheme as xu, rgbToHex as Ou } from "@mui/material";
import { observer as De, useLocalObservable as Nn } from "mobx-react-lite";
import { I18nextProvider as wu, useTranslation as Rt, Trans as xt } from "react-i18next";
import Cu from "i18next-browser-languagedetector";
import { autorun as Wl, reaction as Pu, runInAction as tt, makeAutoObservable as fs } from "mobx";
import S from "prop-types";
import Vu from "@emotion/styled";
import { ThemeContext as Ru } from "@emotion/react";
import { lowerFirst as _u, countBy as Au, isString as Tu } from "lodash-es";
import { tryParseJson as Eu, radiansToDegrees as gn, degreesToRadians as Iu, poseToWandelscriptString as Mu } from "@wandelbots/nova-js";
import { Globals as ju, useSpring as $u, animated as Uu } from "@react-spring/three";
import { ErrorBoundary as Lu } from "react-error-boundary";
var Ka = { exports: {} }, ma = {};
/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var Bs;
function ku() {
if (Bs) return ma;
Bs = 1;
var e = Gl, t = Symbol.for("react.element"), r = Symbol.for("react.fragment"), a = Object.prototype.hasOwnProperty, n = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, o = { key: !0, ref: !0, __self: !0, __source: !0 };
function s(i, l, c) {
var d, u = {}, p = null, f = null;
c !== void 0 && (p = "" + c), l.key !== void 0 && (p = "" + l.key), l.ref !== void 0 && (f = l.ref);
for (d in l) a.call(l, d) && !o.hasOwnProperty(d) && (u[d] = l[d]);
if (i && i.defaultProps) for (d in l = i.defaultProps, l) u[d] === void 0 && (u[d] = l[d]);
return { $$typeof: t, type: i, key: p, ref: f, props: u, _owner: n.current };
}
return ma.Fragment = r, ma.jsx = s, ma.jsxs = s, ma;
}
var fa = {};
/**
* @license React
* react-jsx-runtime.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var Fs;
function Bu() {
return Fs || (Fs = 1, process.env.NODE_ENV !== "production" && function() {
var e = Gl, t = Symbol.for("react.element"), r = Symbol.for("react.portal"), a = Symbol.for("react.fragment"), n = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), s = Symbol.for("react.provider"), i = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), c = Symbol.for("react.suspense"), d = Symbol.for("react.suspense_list"), u = Symbol.for("react.memo"), p = Symbol.for("react.lazy"), f = Symbol.for("react.offscreen"), g = Symbol.iterator, h = "@@iterator";
function x(v) {
if (v === null || typeof v != "object")
return null;
var H = g && v[g] || v[h];
return typeof H == "function" ? H : null;
}
var E = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
function U(v) {
{
for (var H = arguments.length, K = new Array(H > 1 ? H - 1 : 0), re = 1; re < H; re++)
K[re - 1] = arguments[re];
F("error", v, K);
}
}
function F(v, H, K) {
{
var re = E.ReactDebugCurrentFrame, pe = re.getStackAddendum();
pe !== "" && (H += "%s", K = K.concat([pe]));
var ge = K.map(function(de) {
return String(de);
});
ge.unshift("Warning: " + H), Function.prototype.apply.call(console[v], console, ge);
}
}
var N = !1, G = !1, W = !1, j = !1, L = !1, k;
k = Symbol.for("react.module.reference");
function y(v) {
return !!(typeof v == "string" || typeof v == "function" || v === a || v === o || L || v === n || v === c || v === d || j || v === f || N || G || W || typeof v == "object" && v !== null && (v.$$typeof === p || v.$$typeof === u || v.$$typeof === s || v.$$typeof === i || v.$$typeof === l || // This needs to include all possible module reference object
// types supported by any Flight configuration anywhere since
// we don't know which Flight build this will end up being used
// with.
v.$$typeof === k || v.getModuleId !== void 0));
}
function M(v, H, K) {
var re = v.displayName;
if (re)
return re;
var pe = H.displayName || H.name || "";
return pe !== "" ? K + "(" + pe + ")" : K;
}
function B(v) {
return v.displayName || "Context";
}
function z(v) {
if (v == null)
return null;
if (typeof v.tag == "number" && U("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof v == "function")
return v.displayName || v.name || null;
if (typeof v == "string")
return v;
switch (v) {
case a:
return "Fragment";
case r:
return "Portal";
case o:
return "Profiler";
case n:
return "StrictMode";
case c:
return "Suspense";
case d:
return "SuspenseList";
}
if (typeof v == "object")
switch (v.$$typeof) {
case i:
var H = v;
return B(H) + ".Consumer";
case s:
var K = v;
return B(K._context) + ".Provider";
case l:
return M(v, v.render, "ForwardRef");
case u:
var re = v.displayName || null;
return re !== null ? re : z(v.type) || "Memo";
case p: {
var pe = v, ge = pe._payload, de = pe._init;
try {
return z(de(ge));
} catch {
return null;
}
}
}
return null;
}
var D = Object.assign, te = 0, X, Se, Y, ie, he, se, Ge;
function At() {
}
At.__reactDisabledLog = !0;
function sa() {
{
if (te === 0) {
X = console.log, Se = console.info, Y = console.warn, ie = console.error, he = console.group, se = console.groupCollapsed, Ge = console.groupEnd;
var v = {
configurable: !0,
enumerable: !0,
value: At,
writable: !0
};
Object.defineProperties(console, {
info: v,
log: v,
warn: v,
error: v,
group: v,
groupCollapsed: v,
groupEnd: v
});
}
te++;
}
}
function Or() {
{
if (te--, te === 0) {
var v = {
configurable: !0,
enumerable: !0,
writable: !0
};
Object.defineProperties(console, {
log: D({}, v, {
value: X
}),
info: D({}, v, {
value: Se
}),
warn: D({}, v, {
value: Y
}),
error: D({}, v, {
value: ie
}),
group: D({}, v, {
value: he
}),
groupCollapsed: D({}, v, {
value: se
}),
groupEnd: D({}, v, {
value: Ge
})
});
}
te < 0 && U("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
}
}
var rr = E.ReactCurrentDispatcher, Ft;
function ot(v, H, K) {
{
if (Ft === void 0)
try {
throw Error();
} catch (pe) {
var re = pe.stack.trim().match(/\n( *(at )?)/);
Ft = re && re[1] || "";
}
return `
` + Ft + v;
}
}
var ut = !1, st;
{
var Tt = typeof WeakMap == "function" ? WeakMap : Map;
st = new Tt();
}
function Ze(v, H) {
if (!v || ut)
return "";
{
var K = st.get(v);
if (K !== void 0)
return K;
}
var re;
ut = !0;
var pe = Error.prepareStackTrace;
Error.prepareStackTrace = void 0;
var ge;
ge = rr.current, rr.current = null, sa();
try {
if (H) {
var de = function() {
throw Error();
};
if (Object.defineProperty(de.prototype, "props", {
set: function() {
throw Error();
}
}), typeof Reflect == "object" && Reflect.construct) {
try {
Reflect.construct(de, []);
} catch (Ke) {
re = Ke;
}
Reflect.construct(v, [], de);
} else {
try {
de.call();
} catch (Ke) {
re = Ke;
}
v.call(de.prototype);
}
} else {
try {
throw Error();
} catch (Ke) {
re = Ke;
}
v();
}
} catch (Ke) {
if (Ke && re && typeof Ke.stack == "string") {
for (var ce = Ke.stack.split(`
`), Je = re.stack.split(`
`), Te = ce.length - 1, $e = Je.length - 1; Te >= 1 && $e >= 0 && ce[Te] !== Je[$e]; )
$e--;
for (; Te >= 1 && $e >= 0; Te--, $e--)
if (ce[Te] !== Je[$e]) {
if (Te !== 1 || $e !== 1)
do
if (Te--, $e--, $e < 0 || ce[Te] !== Je[$e]) {
var it = `
` + ce[Te].replace(" at new ", " at ");
return v.displayName && it.includes("<anonymous>") && (it = it.replace("<anonymous>", v.displayName)), typeof v == "function" && st.set(v, it), it;
}
while (Te >= 1 && $e >= 0);
break;
}
}
} finally {
ut = !1, rr.current = ge, Or(), Error.prepareStackTrace = pe;
}
var Rr = v ? v.displayName || v.name : "", or = Rr ? ot(Rr) : "";
return typeof v == "function" && st.set(v, or), or;
}
function ke(v, H, K) {
return Ze(v, !1);
}
function Et(v) {
var H = v.prototype;
return !!(H && H.isReactComponent);
}
function Nt(v, H, K) {
if (v == null)
return "";
if (typeof v == "function")
return Ze(v, Et(v));
if (typeof v == "string")
return ot(v);
switch (v) {
case c:
return ot("Suspense");
case d:
return ot("SuspenseList");
}
if (typeof v == "object")
switch (v.$$typeof) {
case l:
return ke(v.render);
case u:
return Nt(v.type, H, K);
case p: {
var re = v, pe = re._payload, ge = re._init;
try {
return Nt(ge(pe), H, K);
} catch {
}
}
}
return "";
}
var gt = Object.prototype.hasOwnProperty, Ue = {}, Dt = E.ReactDebugCurrentFrame;
function It(v) {
if (v) {
var H = v._owner, K = Nt(v.type, v._source, H ? H.type : null);
Dt.setExtraStackFrame(K);
} else
Dt.setExtraStackFrame(null);
}
function wr(v, H, K, re, pe) {
{
var ge = Function.call.bind(gt);
for (var de in v)
if (ge(v, de)) {
var ce = void 0;
try {
if (typeof v[de] != "function") {
var Je = Error((re || "React class") + ": " + K + " type `" + de + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof v[de] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
throw Je.name = "Invariant Violation", Je;
}
ce = v[de](H, de, re, K, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
} catch (Te) {
ce = Te;
}
ce && !(ce instanceof Error) && (It(pe), U("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", re || "React class", K, de, typeof ce), It(null)), ce instanceof Error && !(ce.message in Ue) && (Ue[ce.message] = !0, It(pe), U("Failed %s type: %s", K, ce.message), It(null));
}
}
}
var Cr = Array.isArray;
function zt(v) {
return Cr(v);
}
function Gt(v) {
{
var H = typeof Symbol == "function" && Symbol.toStringTag, K = H && v[Symbol.toStringTag] || v.constructor.name || "Object";
return K;
}
}
function Pr(v) {
try {
return q(v), !1;
} catch {
return !0;
}
}
function q(v) {
return "" + v;
}
function Q(v) {
if (Pr(v))
return U("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Gt(v)), q(v);
}
var Z = E.ReactCurrentOwner, le = {
key: !0,
ref: !0,
__self: !0,
__source: !0
}, ue, ee;
function Me(v) {
if (gt.call(v, "ref")) {
var H = Object.getOwnPropertyDescriptor(v, "ref").get;
if (H && H.isReactWarning)
return !1;
}
return v.ref !== void 0;
}
function Be(v) {
if (gt.call(v, "key")) {
var H = Object.getOwnPropertyDescriptor(v, "key").get;
if (H && H.isReactWarning)
return !1;
}
return v.key !== void 0;
}
function Ae(v, H) {
typeof v.ref == "string" && Z.current;
}
function Qe(v, H) {
{
var K = function() {
ue || (ue = !0, U("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", H));
};
K.isReactWarning = !0, Object.defineProperty(v, "key", {
get: K,
configurable: !0
});
}
}
function ar(v, H) {
{
var K = function() {
ee || (ee = !0, U("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", H));
};
K.isReactWarning = !0, Object.defineProperty(v, "ref", {
get: K,
configurable: !0
});
}
}
var yo = function(v, H, K, re, pe, ge, de) {
var ce = {
// This tag allows us to uniquely identify this as a React Element
$$typeof: t,
// Built-in properties that belong on the element
type: v,
key: H,
ref: K,
props: de,
// Record the component responsible for creating this element.
_owner: ge
};
return ce._store = {}, Object.defineProperty(ce._store, "validated", {
configurable: !1,
enumerable: !1,
writable: !0,
value: !1
}), Object.defineProperty(ce, "_self", {
configurable: !1,
enumerable: !1,
writable: !1,
value: re
}), Object.defineProperty(ce, "_source", {
configurable: !1,
enumerable: !1,
writable: !1,
value: pe
}), Object.freeze && (Object.freeze(ce.props), Object.freeze(ce)), ce;
};
function ia(v, H, K, re, pe) {
{
var ge, de = {}, ce = null, Je = null;
K !== void 0 && (Q(K), ce = "" + K), Be(H) && (Q(H.key), ce = "" + H.key), Me(H) && (Je = H.ref, Ae(H, pe));
for (ge in H)
gt.call(H, ge) && !le.hasOwnProperty(ge) && (de[ge] = H[ge]);
if (v && v.defaultProps) {
var Te = v.defaultProps;
for (ge in Te)
de[ge] === void 0 && (de[ge] = Te[ge]);
}
if (ce || Je) {
var $e = typeof v == "function" ? v.displayName || v.name || "Unknown" : v;
ce && Qe(de, $e), Je && ar(de, $e);
}
return yo(v, ce, Je, pe, re, Z.current, de);
}
}
var la = E.ReactCurrentOwner, Vr = E.ReactDebugCurrentFrame;
function yt(v) {
if (v) {
var H = v._owner, K = Nt(v.type, v._source, H ? H.type : null);
Vr.setExtraStackFrame(K);
} else
Vr.setExtraStackFrame(null);
}
var ca;
ca = !1;
function Ce(v) {
return typeof v == "object" && v !== null && v.$$typeof === t;
}
function je() {
{
if (la.current) {
var v = z(la.current.type);
if (v)
return `
Check the render method of \`` + v + "`.";
}
return "";
}
}
function da(v) {
return "";
}
var nr = {};
function pt(v) {
{
var H = je();
if (!H) {
var K = typeof v == "string" ? v : v.displayName || v.name;
K && (H = `
Check the top-level render call using <` + K + ">.");
}
return H;
}
}
function Is(v, H) {
{
if (!v._store || v._store.validated || v.key != null)
return;
v._store.validated = !0;
var K = pt(H);
if (nr[K])
return;
nr[K] = !0;
var re = "";
v && v._owner && v._owner !== la.current && (re = " It was passed a child from " + z(v._owner.type) + "."), yt(v), U('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', K, re), yt(null);
}
}
function Ms(v, H) {
{
if (typeof v != "object")
return;
if (zt(v))
for (var K = 0; K < v.length; K++) {
var re = v[K];
Ce(re) && Is(re, H);
}
else if (Ce(v))
v._store && (v._store.validated = !0);
else if (v) {
var pe = x(v);
if (typeof pe == "function" && pe !== v.entries)
for (var ge = pe.call(v), de; !(de = ge.next()).done; )
Ce(de.value) && Is(de.value, H);
}
}
}
function Dd(v) {
{
var H = v.type;
if (H == null || typeof H == "string")
return;
var K;
if (typeof H == "function")
K = H.propTypes;
else if (typeof H == "object" && (H.$$typeof === l || // Note: Memo only checks outer props here.
// Inner props are checked in the reconciler.
H.$$typeof === u))
K = H.propTypes;
else
return;
if (K) {
var re = z(H);
wr(K, v.props, "prop", re, v);
} else if (H.PropTypes !== void 0 && !ca) {
ca = !0;
var pe = z(H);
U("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", pe || "Unknown");
}
typeof H.getDefaultProps == "function" && !H.getDefaultProps.isReactClassApproved && U("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
}
}
function zd(v) {
{
for (var H = Object.keys(v.props), K = 0; K < H.length; K++) {
var re = H[K];
if (re !== "children" && re !== "key") {
yt(v), U("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", re), yt(null);
break;
}
}
v.ref !== null && (yt(v), U("Invalid attribute `ref` supplied to `React.Fragment`."), yt(null));
}
}
var js = {};
function $s(v, H, K, re, pe, ge) {
{
var de = y(v);
if (!de) {
var ce = "";
(v === void 0 || typeof v == "object" && v !== null && Object.keys(v).length === 0) && (ce += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
var Je = da();
Je ? ce += Je : ce += je();
var Te;
v === null ? Te = "null" : zt(v) ? Te = "array" : v !== void 0 && v.$$typeof === t ? (Te = "<" + (z(v.type) || "Unknown") + " />", ce = " Did you accidentally export a JSX literal instead of a component?") : Te = typeof v, U("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", Te, ce);
}
var $e = ia(v, H, K, pe, ge);
if ($e == null)
return $e;
if (de) {
var it = H.children;
if (it !== void 0)
if (re)
if (zt(it)) {
for (var Rr = 0; Rr < it.length; Rr++)
Ms(it[Rr], v);
Object.freeze && Object.freeze(it);
} else
U("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
else
Ms(it, v);
}
if (gt.call(H, "key")) {
var or = z(v), Ke = Object.keys(H).filter(function(Qd) {
return Qd !== "key";
}), bo = Ke.length > 0 ? "{key: someKey, " + Ke.join(": ..., ") + ": ...}" : "{key: someKey}";
if (!js[or + bo]) {
var Wd = Ke.length > 0 ? "{" + Ke.join(": ..., ") + ": ...}" : "{}";
U(`A props object containing a "key" prop is being spread into JSX:
let props = %s;
<%s {...props} />
React keys must be passed directly to JSX without using spread:
let props = %s;
<%s key={someKey} {...props} />`, bo, or, Wd, or), js[or + bo] = !0;
}
}
return v === a ? zd($e) : Dd($e), $e;
}
}
function Gd(v, H, K) {
return $s(v, H, K, !0);
}
function Jd(v, H, K) {
return $s(v, H, K, !1);
}
var Hd = Jd, qd = Gd;
fa.Fragment = a, fa.jsx = Hd, fa.jsxs = qd;
}()), fa;
}
var Ns;
function Fu() {
return Ns || (Ns = 1, process.env.NODE_ENV === "production" ? Ka.exports = ku() : Ka.exports = Bu()), Ka.exports;
}
var b = Fu();
function nV() {
return /* @__PURE__ */ b.jsx(Zd, { children: /* @__PURE__ */ b.jsx(Nu, {}) });
}
function Nu({ positions: e = [2, 0, 2, 0, 2, 0, 2, 0] }) {
return /* @__PURE__ */ b.jsxs(b.Fragment, { children: [
/* @__PURE__ */ b.jsx(
sr,
{
intensity: 5,
"rotation-x": Math.PI / 2,
position: [0, 5, -9],
scale: [10, 10, 1]
}
),
/* @__PURE__ */ b.jsx("group", { rotation: [0, 0.5, 0], children: /* @__PURE__ */ b.jsx("group", { children: e.map((t, r) => /* @__PURE__ */ b.jsx(
sr,
{
form: "circle",
intensity: 5,
rotation: [Math.PI / 2, 0, 0],
position: [t, 4, r * 4],
scale: [3, 1, 1]
},
r
)) }) }),
/* @__PURE__ */ b.jsx(
sr,
{
intensity: 40,
"rotation-y": Math.PI / 2,
position: [-5, 1, -1],
scale: [20, 0.1, 1]
}
),
/* @__PURE__ */ b.jsx(
sr,
{
intensity: 20,
"rotation-y": -Math.PI,
position: [-5, -2, -1],
scale: [20, 0.1, 1]
}
),
/* @__PURE__ */ b.jsx(
sr,
{
"rotation-y": Math.PI / 2,
position: [-5, -1, -1],
scale: [20, 0.5, 1],
intensity: 5
}
),
/* @__PURE__ */ b.jsx(
sr,
{
"rotation-y": -Math.PI / 2,
position: [10, 1, 0],
scale: [20, 1, 1],
intensity: 10
}
),
/* @__PURE__ */ b.jsx(
sr,
{
form: "ring",
color: "white",
intensity: 5,
scale: 10,
position: [-15, 4, -18],
target: [0, 0, 0]
}
)
] });
}
function Du(e) {
if (e.length < 3)
return console.log("Not enough vertices to define a plane"), { isCoplanar: !1 };
const t = new Ee.Vector3(e[0].x, e[0].y, e[0].z), r = new Ee.Vector3(e[1].x, e[1].y, e[1].z), a = new Ee.Vector3(e[2].x, e[2].y, e[2].z), n = new Ee.Vector3().subVectors(r, t), o = new Ee.Vector3().subVectors(a, t), s = new Ee.Vector3().crossVectors(n, o).normalize();
for (let i = 3; i < e.length; i++) {
const l = new Ee.Vector3(e[i].x, e[i].y, e[i].z), c = new Ee.Vector3().subVectors(l, t), d = s.dot(c);
if (Math.abs(d) > 1e-6)
return console.log("Vertices are not on the same plane"), { isCoplanar: !1 };
}
return { isCoplanar: !0, normal: s };
}
function oV({
safetyZones: e,
...t
}) {
return /* @__PURE__ */ b.jsx("group", { ...t, children: e.map((r, a) => {
let n = [];
return r.geometry && (r.geometry.compound ? n = r.geometry.compound.child_geometries : r.geometry.convex_hull && (n = [r.geometry])), n.map((o, s) => {
if (!o.convex_hull) return null;
const i = o.convex_hull.vertices.map(
(d) => new Ee.Vector3(d.x / 1e3, d.y / 1e3, d.z / 1e3)
), l = Du(i);
if (l.isCoplanar && l.normal) {
const u = new Ee.Vector3().addVectors(
i[0],
l.normal.multiplyScalar(1e-4)
);
i.push(u);
}
let c;
try {
c = new au(i);
} catch (d) {
return console.log("Error creating ConvexGeometry:", d), null;
}
return /* @__PURE__ */ b.jsx("mesh", { geometry: c, children: /* @__PURE__ */ b.jsx(
"meshStandardMaterial",
{
attach: "material",
color: "#009f4d",
opacity: 0.2,
depthTest: !1,
depthWrite: !1,
transparent: !0,
polygonOffset: !0,
polygonOffsetFactor: -s
},
a
) }, `${a}-${s}`);
});
}) });
}
function sV({
trajectory: e,
...t
}) {
var a;
const r = ((a = e.trajectory) == null ? void 0 : a.map((n) => n.tcp_pose ? new Ee.Vector3(
n.tcp_pose.position.x / 1e3,
n.tcp_pose.position.z / 1e3,
-n.tcp_pose.position.y / 1e3
) : null).filter((n) => n !== null)) || [];
return /* @__PURE__ */ b.jsx("group", { ...t, children: r.length > 0 && /* @__PURE__ */ b.jsx(
ql,
{
points: r,
lineWidth: 3,
polygonOffset: !0,
polygonOffsetFactor: 10,
polygonOffsetUnits: 10
}
) });
}
function Xt(e, ...t) {
const r = new URL(`https://mui.com/production-error/?code=${e}`);
return t.forEach((a) => r.searchParams.append("args[]", a)), `Minified MUI error #${e}; visit ${r} for the full message.`;
}
function zu(e) {
for (var t = 0, r, a = 0, n = e.length; n >= 4; ++a, n -= 4)
r = e.charCodeAt(a) & 255 | (e.charCodeAt(++a) & 255) << 8 | (e.charCodeAt(++a) & 255) << 16 | (e.charCodeAt(++a) & 255) << 24, r = /* Math.imul(k, m): */
(r & 65535) * 1540483477 + ((r >>> 16) * 59797 << 16), r ^= /* k >>> r: */
r >>> 24, t = /* Math.imul(k, m): */
(r & 65535) * 1540483477 + ((r >>> 16) * 59797 << 16) ^ /* Math.imul(h, m): */
(t & 65535) * 1540483477 + ((t >>> 16) * 59797 << 16);
switch (n) {
case 3:
t ^= (e.charCodeAt(a + 2) & 255) << 16;
case 2:
t ^= (e.charCodeAt(a + 1) & 255) << 8;
case 1:
t ^= e.charCodeAt(a) & 255, t = /* Math.imul(h, m): */
(t & 65535) * 1540483477 + ((t >>> 16) * 59797 << 16);
}
return t ^= t >>> 13, t = /* Math.imul(h, m): */
(t & 65535) * 1540483477 + ((t >>> 16) * 59797 << 16), ((t ^ t >>> 15) >>> 0).toString(36);
}
var Gu = {
animationIterationCount: 1,
aspectRatio: 1,
borderImageOutset: 1,
borderImageSlice: 1,
borderImageWidth: 1,
boxFlex: 1,
boxFlexGroup: 1,
boxOrdinalGroup: 1,
columnCount: 1,
columns: 1,
flex: 1,
flexGrow: 1,
flexPositive: 1,
flexShrink: 1,
flexNegative: 1,
flexOrder: 1,
gridRow: 1,
gridRowEnd: 1,
gridRowSpan: 1,
gridRowStart: 1,
gridColumn: 1,
gridColumnEnd: 1,
gridColumnSpan: 1,
gridColumnStart: 1,
msGridRow: 1,
msGridRowSpan: 1,
msGridColumn: 1,
msGridColumnSpan: 1,
fontWeight: 1,
lineHeight: 1,
opacity: 1,
order: 1,
orphans: 1,
scale: 1,
tabSize: 1,
widows: 1,
zIndex: 1,
zoom: 1,
WebkitLineClamp: 1,
// SVG-related properties
fillOpacity: 1,
floodOpacity: 1,
stopOpacity: 1,
strokeDasharray: 1,
strokeDashoffset: 1,
strokeMiterlimit: 1,
strokeOpacity: 1,
strokeWidth: 1
};
function Ju(e) {
var t = /* @__PURE__ */ Object.create(null);
return function(r) {
return t[r] === void 0 && (t[r] = e(r)), t[r];
};
}
var Hu = /[A-Z]|^ms/g, qu = /_EMO_([^_]+?)_([^]*?)_EMO_/g, Ql = function(t) {
return t.charCodeAt(1) === 45;
}, Ds = function(t) {
return t != null && typeof t != "boolean";
}, So = /* @__PURE__ */ Ju(function(e) {
return Ql(e) ? e : e.replace(Hu, "-$&").toLowerCase();
}), zs = function(t, r) {
switch (t) {
case "animation":
case "animationName":
if (typeof r == "string")
return r.replace(qu, function(a, n, o) {
return Qt = {
name: n,
styles: o,
next: Qt
}, n;
});
}
return Gu[t] !== 1 && !Ql(t) && typeof r == "number" && r !== 0 ? r + "px" : r;
};
function Vn(e, t, r) {
if (r == null)
return "";
var a = r;
if (a.__emotion_styles !== void 0)
return a;
switch (typeof r) {
case "boolean":
return "";
case "object": {
var n = r;
if (n.anim === 1)
return Qt = {
name: n.name,
styles: n.styles,
next: Qt
}, n.name;
var o = r;
if (o.styles !== void 0) {
var s = o.next;
if (s !== void 0)
for (; s !== void 0; )
Qt = {
name: s.name,
styles: s.styles,
next: Qt
}, s = s.next;
var i = o.styles + ";";
return i;
}
return Wu(e, t, r);
}
}
var l = r;
return l;
}
function Wu(e, t, r) {
var a = "";
if (Array.isArray(r))
for (var n = 0; n < r.length; n++)
a += Vn(e, t, r[n]) + ";";
else
for (var o in r) {
var s = r[o];
if (typeof s != "object") {
var i = s;
Ds(i) && (a += So(o) + ":" + zs(o, i) + ";");
} else if (Array.isArray(s) && typeof s[0] == "string" && t == null)
for (var l = 0; l < s.length; l++)
Ds(s[l]) && (a += So(o) + ":" + zs(o, s[l]) + ";");
else {
var c = Vn(e, t, s);
switch (o) {
case "animation":
case "animationName": {
a += So(o) + ":" + c + ";";
break;
}
default:
a += o + "{" + c + "}";
}
}
}
return a;
}
var Gs = /label:\s*([^\s;{]+)\s*(;|$)/g, Qt;
function Qu(e, t, r) {
if (e.length === 1 && typeof e[0] == "object" && e[0] !== null && e[0].styles !== void 0)
return e[0];
var a = !0, n = "";
Qt = void 0;
var o = e[0];
if (o == null || o.raw === void 0)
a = !1, n += Vn(r, t, o);
else {
var s = o;
n += s[0];
}
for (var i = 1; i < e.length; i++)
if (n += Vn(r, t, e[i]), a) {
var l = o;
n += l[i];
}
Gs.lastIndex = 0;
for (var c = "", d; (d = Gs.exec(n)) !== null; )
c += "-" + d[1];
var u = zu(n) + c;
return {
name: u,
styles: n,
next: Qt
};
}
/**
* @mui/styled-engine v6.4.6
*
* @license MIT
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
function Ku(e, t) {
const r = Vu(e, t);
return process.env.NODE_ENV !== "production" ? (...a) => {
const n = typeof e == "string" ? `"${e}"` : "component";
return a.length === 0 ? console.error([`MUI: Seems like you called \`styled(${n})()\` without a \`style\` argument.`, 'You must provide a `styles` argument: `styled("div")(styleYouForgotToPass)`.'].join(`
`)) : a.some((o) => o === void 0) && console.error(`MUI: the styled(${n})(...args) API requires all its args to be defined.`), r(...a);
} : r;
}
function Yu(e, t) {
Array.isArray(e.__emotion_styles) && (e.__emotion_styles = t(e.__emotion_styles));
}
const Js = [];
function Hs(e) {
return Js[0] = e, Qu(Js);
}
var Ya = { exports: {} }, me = {};
/**
* @license React
* react-is.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var qs;
function Xu() {
if (qs) return me;
qs = 1;
var e = Symbol.for("react.transitional.element"), t = Symbol.for("react.portal"), r = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), n = Symbol.for("react.profiler"), o = Symbol.for("react.consumer"), s = Symbol.for("react.context"), i = Symbol.for("react.forward_ref"), l = Symbol.for("react.suspense"), c = Symbol.for("react.suspense_list"), d = Symbol.for("react.memo"), u = Symbol.for("react.lazy"), p = Symbol.for("react.offscreen"), f = Symbol.for("react.client.reference");
function g(h) {
if (typeof h == "object" && h !== null) {
var x = h.$$typeof;
switch (x) {
case e:
switch (h = h.type, h) {
case r:
case n:
case a:
case l:
case c:
return h;
default:
switch (h = h && h.$$typeof, h) {
case s:
case i:
case u:
case d:
return h;
case o:
return h;
default:
return x;
}
}
case t:
return x;
}
}
}
return me.ContextConsumer = o, me.ContextProvider = s, me.Element = e, me.ForwardRef = i, me.Fragment = r, me.Lazy = u, me.Memo = d, me.Portal = t, me.Profiler = n, me.StrictMode = a, me.Suspense = l, me.SuspenseList = c, me.isContextConsumer = function(h) {
return g(h) === o;
}, me.isContextProvider = function(h) {
return g(h) === s;
}, me.isElement = function(h) {
return typeof h == "object" && h !== null && h.$$typeof === e;
}, me.isForwardRef = function(h) {
return g(h) === i;
}, me.isFragment = function(h) {
return g(h) === r;
}, me.isLazy = function(h) {
return g(h) === u;
}, me.isMemo = function(h) {
return g(h) === d;
}, me.isPortal = function(h) {
return g(h) === t;
}, me.isProfiler = function(h) {
return g(h) === n;
}, me.isStrictMode = function(h) {
return g(h) === a;
}, me.isSuspense = function(h) {
return g(h) === l;
}, me.isSuspenseList = function(h) {
return g(h) === c;
}, me.isValidElementType = function(h) {
return typeof h == "string" || typeof h == "function" || h === r || h === n || h === a || h === l || h === c || h === p || typeof h == "object" && h !== null && (h.$$typeof === u || h.$$typeof === d || h.$$typeof === s || h.$$typeof === o || h.$$typeof === i || h.$$typeof === f || h.getModuleId !== void 0);
}, me.typeOf = g, me;
}
var fe = {};
/**
* @license React
* react-is.development.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var Ws;
function Zu() {
return Ws || (Ws = 1, process.env.NODE_ENV !== "production" && function() {
function e(h) {
if (typeof h == "object" && h !== null) {
var x = h.$$typeof;
switch (x) {
case t:
switch (h = h.type, h) {
case a:
case o:
case n:
case c:
case d:
return h;
default:
switch (h = h && h.$$typeof, h) {
case i:
case l:
case p:
case u:
return h;
case s:
return h;
default:
return x;
}
}
case r:
return x;
}
}
}
var t = Symbol.for("react.transitional.element"), r = Symbol.for("react.portal"), a = Symbol.for("react.fragment"), n = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), s = Symbol.for("react.consumer"), i = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), c = Symbol.for("react.suspense"), d = Symbol.for("react.suspense_list"), u = Symbol.for("react.memo"), p = Symbol.for("react.lazy"), f = Symbol.for("react.offscreen"), g = Symbol.for("react.client.reference");
fe.ContextConsumer = s, fe.ContextProvider = i, fe.Element = t, fe.ForwardRef = l, fe.Fragment = a, fe.Lazy = p, fe.Memo = u, fe.Portal = r, fe.Profiler = o, fe.StrictMode = n, fe.Suspense = c, fe.SuspenseList = d, fe.isContextConsumer = function(h) {
return e(h) === s;
}, fe.isContextProvider = function(h) {
return e(h) === i;
}, fe.isElement = function(h) {
return typeof h == "object" && h !== null && h.$$typeof === t;
}, fe.isForwardRef = function(h) {
return e(h) === l;
}, fe.isFragment = function(h) {
return e(h) === a;
}, fe.isLazy = function(h) {
return e(h) === p;
}, fe.isMemo = function(h) {
return e(h) === u;
}, fe.isPortal = function(h) {
return e(h) === r;
}, fe.isProfiler = function(h) {
return e(h) === o;
}, fe.isStrictMode = function(h) {
return e(h) === n;
}, fe.isSuspense = function(h) {
return e(h) === c;
}, fe.isSuspenseList = function(h) {
return e(h) === d;
}, fe.isValidElementType = function(h) {
return typeof h == "string" || typeof h == "function" || h === a || h === o || h === n || h === c || h === d || h === f || typeof h == "object" && h !== null && (h.$$typeof === p || h.$$typeof === u || h.$$typeof === i || h.$$typeof === s || h.$$typeof === l || h.$$typeof === g || h.getModuleId !== void 0);
}, fe.typeOf = e;
}()), fe;
}
var Qs;
function ep() {
return Qs || (Qs = 1, process.env.NODE_ENV === "production" ? Ya.exports = /* @__PURE__ */ Xu() : Ya.exports = /* @__PURE__ */ Zu()), Ya.exports;
}
var Rn = /* @__PURE__ */ ep();
function Ot(e) {
if (typeof e != "object" || e === null)
return !1;
const t = Object.getPrototypeOf(e);
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Symbol.toStringTag in e) && !(Symbol.iterator in e);
}
function Kl(e) {
if (/* @__PURE__ */ J.isValidElement(e) || Rn.isValidElementType(e) || !Ot(e))
return e;
const t = {};
return Object.keys(e).forEach((r) => {
t[r] = Kl(e[r]);
}), t;
}
function We(e, t, r = {
clone: !0
}) {
const a = r.clone ? {
...e
} : e;
return Ot(e) && Ot(t) && Object.keys(t).forEach((n) => {
/* @__PURE__ */ J.isValidElement(t[n]) || Rn.isValidElementType(t[n]) ? a[n] = t[n] : Ot(t[n]) && // Avoid prototype pollution
Object.prototype.hasOwnProperty.call(e, n) && Ot(e[n]) ? a[n] = We(e[n], t[n], r) : r.clone ? a[n] = Ot(t[n]) ? Kl(t[n]) : t[n] : a[n] = t[n];
}), a;
}
const tp = (e) => {
const t = Object.keys(e).map((r) => ({
key: r,
val: e[r]
})) || [];
return t.sort((r, a) => r.val - a.val), t.reduce((r, a) => ({
...r,
[a.key]: a.val
}), {});
};
function rp(e) {
const {
// The breakpoint **start** at this value.
// For instance with the first breakpoint xs: [xs, sm).
values: t = {
xs: 0,
// phone
sm: 600,
// tablet
md: 900,
// small laptop
lg: 1200,
// desktop
xl: 1536
// large screen
},
unit: r = "px",
step: a = 5,
...n
} = e, o = tp(t), s = Object.keys(o);
function i(p) {
return `@media (min-width:${typeof t[p] == "number" ? t[p] : p}${r})`;
}
function l(p) {
return `@media (max-width:${(typeof t[p] == "number" ? t[p] : p) - a / 100}${r})`;
}
function c(p, f) {
const g = s.indexOf(f);
return `@media (min-width:${typeof t[p] == "number" ? t[p] : p}${r}) and (max-width:${(g !== -1 && typeof t[s[g]] == "number" ? t[s[g]] : f) - a / 100}${r})`;
}
function d(p) {
return s.indexOf(p) + 1 < s.length ? c(p, s[s.indexOf(p) + 1]) : i(p);
}
function u(p) {
const f = s.indexOf(p);
return f === 0 ? i(s[1]) : f === s.length - 1 ? l(s[f]) : c(p, s[s.indexOf(p) + 1]).replace("@media", "@media not all and");
}
return {
keys: s,
values: o,
up: i,
down: l,
between: c,
only: d,
not: u,
unit: r,
...n
};
}
function ap(e, t) {
if (!e.containerQueries)
return t;
const r = Object.keys(t).filter((a) => a.startsWith("@container")).sort((a, n) => {
var s, i;
const o = /min-width:\s*([0-9.]+)/;
return +(((s = a.match(o)) == null ? void 0 : s[1]) || 0) - +(((i = n.match(o)) == null ? void 0 : i[1]) || 0);
});
return r.length ? r.reduce((a, n) => {
const o = t[n];
return delete a[n], a[n] = o, a;
}, {
...t
}) : t;
}
function np(e, t) {
return t === "@" || t.startsWith("@") && (e.some((r) => t.startsWith(`@${r}`)) || !!t.match(/^@\d/));
}
function op(e, t) {
const r = t.match(/^@([^/]+)?\/?(.+)?$/);
if (!r) {
if (process.env.NODE_ENV !== "production")
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: The provided shorthand ${`(${t})`} is invalid. The format should be \`@<breakpoint | number>\` or \`@<breakpoint | number>/<container>\`.
For example, \`@sm\` or \`@600\` or \`@40rem/sidebar\`.` : Xt(18, `(${t})`));
return null;
}
const [, a, n] = r, o = Number.isNaN(+a) ? a || 0 : +a;
return e.containerQueries(n).up(o);
}
function sp(e) {
const t = (o, s) => o.replace("@media", s ? `@container ${s}` : "@container");
function r(o, s) {
o.up = (...i) => t(e.breakpoints.up(...i), s), o.down = (...i) => t(e.breakpoints.down(...i), s), o.between = (...i) => t(e.breakpoints.between(...i), s), o.only = (...i) => t(e.breakpoints.only(...i), s), o.not = (...i) => {
const l = t(e.breakpoints.not(...i), s);
return l.includes("not all and") ? l.replace("not all and ", "").replace("min-width:", "width<").replace("max-width:", "width>").replace("and", "or") : l;
};
}
const a = {}, n = (o) => (r(a, o), a);
return r(n), {
...e,
containerQueries: n
};
}
const ip = {
borderRadius: 4
}, tr = process.env.NODE_ENV !== "production" ? S.oneOfType([S.number, S.string, S.object, S.array]) : {};
function Aa(e, t) {
return t ? We(e, t, {
clone: !1
// No need to clone deep, it's way faster.
}) : e;
}
const Dn = {
xs: 0,
// phone
sm: 600,
// tablet
md: 900,
// small laptop
lg: 1200,
// desktop
xl: 1536
// large screen
}, Ks = {
// Sorted ASC by size. That's important.
// It can't be configured as it's used statically for propTypes.
keys: ["xs", "sm", "md", "lg", "xl"],
up: (e) => `@media (min-width:${Dn[e]}px)`
}, lp = {
containerQueries: (e) => ({
up: (t) => {
let r = typeof t == "number" ? t : Dn[t] || t;
return typeof r == "number" && (r = `${r}px`), e ? `@container ${e} (min-width:${r})` : `@container (min-width:${r})`;
}
})
};
function mt(e, t, r) {
const a = e.theme || {};
if (Array.isArray(t)) {
const o = a.breakpoints || Ks;
return t.reduce((s, i, l) => (s[o.up(o.keys[l])] = r(t[l]), s), {});
}
if (typeof t == "object") {
const o = a.breakpoints || Ks;
return Object.keys(t).reduce((s, i) => {
if (np(o.keys, i)) {
const l = op(a.containerQueries ? a : lp, i);
l && (s[l] = r(t[i], i));
} else if (Object.keys(o.values || Dn).includes(i)) {
const l = o.up(i);
s[l] = r(t[i], i);
} else {
const l = i;
s[l] = t[l];
}
return s;
}, {});
}
return r(t);
}
function Yl(e = {}) {
var r;
return ((r = e.keys) == null ? void 0 : r.reduce((a, n) => {
const o = e.up(n);
return a[o] = {}, a;
}, {})) || {};
}
function Xl(e, t) {
return e.reduce((r, a) => {
const n = r[a];
return (!n || Object.keys(n).length === 0) && delete r[a], r;
}, t);
}
function cp(e, ...t) {
const r = Yl(e), a = [r, ...t].reduce((n, o) => We(n, o), {});
return Xl(Object.keys(r), a);
}
function dp(e, t) {
if (typeof e != "object")
return {};
const r = {}, a = Object.keys(t);
return Array.isArray(e) ? a.forEach((n, o) => {
o < e.length && (r[n] = !0);
}) : a.forEach((n) => {
e[n] != null && (r[n] = !0);
}), r;
}
function vo({
values: e,
breakpoints: t,
base: r
}) {
const a = r || dp(e, t), n = Object.keys(a);
if (n.length === 0)
return e;
let o;
return n.reduce((s, i, l) => (Array.isArray(e) ? (s[i] = e[l] != null ? e[l] : e[o], o = l) : typeof e == "object" ? (s[i] = e[i] != null ? e[i] : e[o], o = i) : s[i] = e, s), {});
}
function qe(e) {
if (typeof e != "string")
throw new Error(process.env.NODE_ENV !== "production" ? "MUI: `capitalize(string)` expects a string argument." : Xt(7));
return e.charAt(0).toUpperCase() + e.slice(1);
}
function zn(e, t, r = !0) {
if (!t || typeof t != "string")
return null;
if (e && e.vars && r) {
const a = `vars.${t}`.split(".").reduce((n, o) => n && n[o] ? n[o] : null, e);
if (a != null)
return a;
}
return t.split(".").reduce((a, n) => a && a[n] != null ? a[n] : null, e);
}
function _n(e, t, r, a = r) {
let n;
return typeof e == "function" ? n = e(r) : Array.isArray(e) ? n = e[r] || a : n = zn(e, r) || a, t && (n = t(n, a, e)), n;
}
function Ie(e) {
const {
prop: t,
cssProperty: r = e.prop,
themeKey: a,
transform: n
} = e, o = (s) => {
if (s[t] == null)
return null;
const i = s[t], l = s.theme, c = zn(l, a) || {};
return mt(s, i, (u) => {
let p = _n(c, n, u);
return u === p && typeof u == "string" && (p = _n(c, n, `${t}${u === "default" ? "" : qe(u)}`, u)), r === !1 ? p : {
[r]: p
};
});
};
return o.propTypes = process.env.NODE_ENV !== "production" ? {
[t]: tr
} : {}, o.filterProps = [t], o;
}
function up(e) {
const t = {};
return (r) => (t[r] === void 0 && (t[r] = e(r)), t[r]);
}
const pp = {
m: "margin",
p: "padding"
}, hp = {
t: "Top",
r: "Right",
b: "Bottom",
l: "Left",
x: ["Left", "Right"],
y: ["Top", "Bottom"]
}, Ys = {
marginX: "mx",
marginY: "my",
paddingX: "px",
paddingY: "py"
}, mp = up((e) => {
if (e.length > 2)
if (Ys[e])
e = Ys[e];
else
return [e];
const [t, r] = e.split(""), a = pp[t], n = hp[r] || "";
return Array.isArray(n) ? n.map((o) => a + o) : [a + n];
}), Gn = ["m", "mt", "mr", "mb", "ml", "mx", "my", "margin", "marginTop", "marginRight", "marginBottom", "marginLeft", "marginX", "marginY", "marginInline", "marginInlineStart", "marginInlineEnd", "marginBlock", "marginBlockStart", "marginBlockEnd"], Jn = ["p", "pt", "pr", "pb", "pl", "px", "py", "padding", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft", "paddingX", "paddingY", "paddingInline", "paddingInlineStart", "paddingInlineEnd", "paddingBlock", "paddingBlockStart", "paddingBlockEnd"], fp = [...Gn, ...Jn];
function za(e, t, r, a) {
const n = zn(e, t, !0) ?? r;
return typeof n == "number" || typeof n == "string" ? (o) => typeof o == "string" ? o : (process.env.NODE_ENV !== "production" && typeof o != "number" && console.error(`MUI: Expected ${a} argument to be a number or a string, got ${o}.`), typeof n == "string" ? `calc(${o} * ${n})` : n * o) : Array.isArray(n) ? (o) => {
if (typeof o == "string")
return o;
const s = Math.abs(o);
process.env.NODE_ENV !== "production" && (Number.isInteger(s) ? s > n.length - 1 && console.error([`MUI: The value provided (${s}) overflows.`, `The supported values are: ${JSON.stringify(n)}.`, `${s} > ${n.length - 1}, you need to add the missing values.`].join(`
`)) : console.error([`MUI: The \`theme.${t}\` array type cannot be combined with non integer values.You should either use an integer value that can be used as index, or define the \`theme.${t}\` as a number.`].join(`
`)));
const i = n[s];
return o >= 0 ? i : typeof i == "number" ? -i : `-${i}`;
} : typeof n == "function" ? n : (process.env.NODE_ENV !== "production" && console.error([`MUI: The \`theme.${t}\` value (${n}) is invalid.`, "It should be a number, an array or a function."].join(`
`)), () => {
});
}
function Hn(e) {
return za(e, "spacing", 8, "spacing");
}
function ur(e, t) {
return typeof t == "string" || t == null ? t : e(t);
}
function gp(e, t) {
return (r) => e.reduce((a, n) => (a[n] = ur(t, r), a), {});
}
function yp(e, t, r, a) {
if (!t.includes(r))
return null;
const n = mp(r), o = gp(n, a), s = e[r];
return mt(e, s, o);
}
function Zl(e, t) {
const r = Hn(e.theme);
return Object.keys(e).map((a) => yp(e, t, a, r)).reduce(Aa, {});
}
function Re(e) {
return Zl(e, Gn);
}
Re.propTypes = process.env.NODE_ENV !== "production" ? Gn.reduce((e, t