@tomorrowevening/hermes 0.1.36 → 0.1.37

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.
package/dist/hermes.es.js CHANGED
@@ -2,16 +2,16 @@ import { types as P, getProject as Es } from "@tomorrowevening/theatre-core";
2
2
  import { useState as L, useEffect as pe, useRef as z, useMemo as Ze, Component as Qe, createRef as ue, forwardRef as Bi } from "react";
3
3
  import { BufferGeometry as Vi, Float32BufferAttribute as ke, OrthographicCamera as Gi, Texture as Gt, Scene as Ss, MeshBasicMaterial as Os, Mesh as $i, LinearSRGBColorSpace as Ke, ObjectLoader as ws, AnimationMixer as xs, AnimationClip as Ts, Matrix4 as Wi, AlwaysStencilFunc as si, ReplaceStencilOp as Ee, NotEqualStencilFunc as ni, EqualStencilFunc as ri, KeepStencilOp as Se, NormalBlending as Yi, AddEquation as Je, SrcAlphaFactor as gt, OneMinusSrcAlphaFactor as vt, CustomBlending as _t, OneFactor as yt, DstColorFactor as Xt, OneMinusDstColorFactor as Qt, WebGLRenderTarget as Ms, RGBAFormat as As, EventDispatcher as Zi, RepeatWrapping as ai, Color as et, FrontSide as Rs, BackSide as Ps, DoubleSide as qi, ZeroFactor as ji, SrcColorFactor as Ki, OneMinusSrcColorFactor as Xi, DstAlphaFactor as Qi, OneMinusDstAlphaFactor as Ji, SrcAlphaSaturateFactor as Ds, ConstantColorFactor as es, OneMinusConstantColorFactor as ts, ConstantAlphaFactor as is, OneMinusConstantAlphaFactor as ss, SubtractEquation as Is, ReverseSubtractEquation as Us, MinEquation as Ls, MaxEquation as ks, NoBlending as Ns, AdditiveBlending as Fs, SubtractiveBlending as zs, MultiplyBlending as Hs, ShaderMaterial as ns, GLSL3 as Bs, PlaneGeometry as Vs, Object3D as Gs, Vector3 as Le, Raycaster as $s, Vector2 as Ws, WebGLRenderer as qe, Euler as Ys, SkeletonHelper as Zs, SRGBColorSpace as oi, NoToneMapping as li, ColorManagement as tt, NoColorSpace as qs, LinearToneMapping as js, ReinhardToneMapping as Ks, CineonToneMapping as Xs, ACESFilmicToneMapping as Qs, AgXToneMapping as Js, NeutralToneMapping as en, CustomToneMapping as tn } from "three";
4
4
  import { Color as dt, ColorManagement as St, WebGPURenderer as Ge, RenderTarget as sn, WebGLRenderTarget as nn, ComputeNode as rn, NodeMaterial as an, DoubleSide as on, Mesh as ut, PlaneGeometry as ln, BoxGeometry as cn, Vector2 as $e, Object3D as ci, CatmullRomCurve3 as hi, MeshBasicMaterial as $t, LineBasicMaterial as hn, Line as dn, BufferGeometry as di, SphereGeometry as un, Raycaster as Wt, Vector3 as ee, Group as pn, AxesHelper as mn, Scene as fn, Sphere as gn, Box3 as vn, Spherical as _n, Matrix4 as yn, Quaternion as Cn, Vector4 as bn, MeshNormalNodeMaterial as En, PerspectiveCamera as ui, OrthographicCamera as pi, CameraHelper as Sn, SkinnedMesh as On, SpotLightHelper as wn, PointLightHelper as xn, HemisphereLightHelper as Tn, DirectionalLightHelper as Mn } from "three/webgpu";
5
- import { jsx as f, jsxs as M, Fragment as q } from "react/jsx-runtime";
5
+ import { jsx as f, jsxs as M, Fragment as Y } from "react/jsx-runtime";
6
6
  import { radToDeg as An, degToRad as Yt, lerp as Ot, mapLinear as Oe } from "three/src/math/MathUtils.js";
7
7
  import { RectAreaLightHelper as Rn } from "three/examples/jsm/helpers/RectAreaLightHelper.js";
8
8
  import { OrbitControls as Pn } from "three/examples/jsm/controls/OrbitControls.js";
9
- import { uniform as we, varyingProperty as Dn, Fn as wt, positionLocal as In, vec3 as Un, cameraPosition as it, float as Y, fwidth as Ln, abs as mi, fract as kn, min as xt, max as fi, distance as Nn, log as gi, pow as vi, floor as Fn, mix as _i, If as zn, lessThanEqual as Hn, Discard as Bn, vec4 as Vn } from "three/tsl";
9
+ import { uniform as we, varyingProperty as Dn, Fn as wt, positionLocal as In, vec3 as Un, cameraPosition as it, float as Z, fwidth as Ln, abs as mi, fract as kn, min as xt, max as fi, distance as Nn, log as gi, pow as vi, floor as Fn, mix as _i, If as zn, lessThanEqual as Hn, Discard as Bn, vec4 as Vn } from "three/tsl";
10
10
  import rs from "three/src/materials/nodes/MeshBasicNodeMaterial.js";
11
11
  import { remapClamp as Gn, linearDepth as $n, vec4 as as, uv as Wn } from "three/src/nodes/TSL.js";
12
12
  import { TransformControls as Yn } from "three/examples/jsm/controls/TransformControls.js";
13
13
  const pt = () => {
14
- }, Na = () => {
14
+ }, ka = () => {
15
15
  };
16
16
  function mt(i) {
17
17
  return i.substring(0, 1).toUpperCase() + i.substring(1);
@@ -254,7 +254,7 @@ self.onmessage = async ({ data }) => {
254
254
  };
255
255
  `
256
256
  );
257
- class Fa {
257
+ class Na {
258
258
  worker;
259
259
  source;
260
260
  /** Intermediate 2D canvas used for GPU→CPU readback. Works with WebGPU and WebGL. */
@@ -392,20 +392,20 @@ function Zt(i, e, t) {
392
392
  function Xe(i, e, t) {
393
393
  return i * (1 - t) + e * t;
394
394
  }
395
- function za(i, e, t, s, n) {
395
+ function Fa(i, e, t, s, n) {
396
396
  return Xe(t, s, Zt(i, e, n));
397
397
  }
398
- function Ha(i, e) {
398
+ function za(i, e) {
399
399
  const t = i - e;
400
400
  return Math.sqrt(t * t);
401
401
  }
402
- function Ba(i, e, t, s) {
402
+ function Ha(i, e, t, s) {
403
403
  return Xe(i, e, 1 - Math.exp(-t * s));
404
404
  }
405
405
  function te(i, e = 1) {
406
406
  return Number(i.toFixed(e));
407
407
  }
408
- function Va(i, e, t, s) {
408
+ function Ba(i, e, t, s) {
409
409
  return Math.atan2(s - e, t - i);
410
410
  }
411
411
  function sr(i, e, t, s) {
@@ -421,7 +421,7 @@ function ar(i, e, t, s, n) {
421
421
  const r = i * i;
422
422
  return e * (r * i) + t * r + s * i + n;
423
423
  }
424
- function Ga(i, e, t, s, n) {
424
+ function Va(i, e, t, s, n) {
425
425
  if (i <= 0) return 0;
426
426
  if (i >= 1) return 1;
427
427
  if (sr(e, t, s, n)) return i;
@@ -435,12 +435,12 @@ function Ga(i, e, t, s, n) {
435
435
  return ar(b, g, _, E, S);
436
436
  }
437
437
  const st = (i) => Math.round(Math.min(1, Math.max(0, i)) * 255).toString(16).padStart(2, "0");
438
- function $a({ r: i, g: e, b: t, a: s = 1 }) {
438
+ function Ga({ r: i, g: e, b: t, a: s = 1 }) {
439
439
  const n = `#${st(i)}${st(e)}${st(t)}`;
440
440
  return s < 1 ? `${n}${st(s)}` : n;
441
441
  }
442
442
  let xe;
443
- function Wa() {
443
+ function $a() {
444
444
  const [i, e] = L(xe);
445
445
  return pe(() => {
446
446
  xe || import("@tomorrowevening/theatre-studio").then((t) => {
@@ -448,7 +448,7 @@ function Wa() {
448
448
  });
449
449
  }, []), i;
450
450
  }
451
- async function Ya() {
451
+ async function Wa() {
452
452
  for (; !document.getElementById("theatrejs-studio-root"); )
453
453
  await new Promise((s) => setTimeout(s, 100));
454
454
  const i = document.getElementById("theatrejs-studio-root");
@@ -469,7 +469,7 @@ async function Ya() {
469
469
  }
470
470
  }
471
471
  }
472
- function Za(i, e, t, s) {
472
+ function Ya(i, e, t, s) {
473
473
  s.sheetObject(i, e, {
474
474
  transform: {
475
475
  position: {
@@ -735,7 +735,7 @@ function hr(i, e, t) {
735
735
  }
736
736
  });
737
737
  }
738
- function qa(i, e, t, s) {
738
+ function Za(i, e, t, s) {
739
739
  if (!t.isMaterial) return;
740
740
  const n = lr(t), r = cr(n);
741
741
  s.sheetObject(i, e, {
@@ -748,7 +748,7 @@ const Jt = new Vi();
748
748
  Jt.setAttribute("position", new ke([-0.5, -0.5, 0, 1.5, -0.5, 0, -0.5, 1.5, 0], 3));
749
749
  Jt.setAttribute("normal", new ke([0, 0, 1, 0, 0, 1], 3));
750
750
  Jt.setAttribute("uv", new ke([0, 0, 2, 0, 0, 2], 2));
751
- const ja = new Gi(-0.5, 0.5, 0.5, -0.5, 0, 100), Oi = (i) => {
751
+ const qa = new Gi(-0.5, 0.5, 0.5, -0.5, 0, 100), Oi = (i) => {
752
752
  i?.dispose();
753
753
  }, ls = (i) => {
754
754
  if (i)
@@ -844,7 +844,7 @@ class ce {
844
844
  return this.renderer.domElement;
845
845
  }
846
846
  }
847
- function Ka(i) {
847
+ function ja(i) {
848
848
  return new Promise((e) => {
849
849
  const t = new ws();
850
850
  t.parseAsync(i.scene).then((s) => {
@@ -866,26 +866,26 @@ function Ka(i) {
866
866
  });
867
867
  });
868
868
  }
869
- const Xa = (i, e, t, s) => {
869
+ const Ka = (i, e, t, s) => {
870
870
  i.setRenderTarget(s), i.clear(), i.render(e, t);
871
871
  };
872
872
  function dr(i, e, t, s) {
873
873
  i.applyMatrix4(new Wi().makeTranslation(e, -t, -s));
874
874
  }
875
- function Qa(i) {
875
+ function Xa(i) {
876
876
  i.computeBoundingBox();
877
877
  const e = i.boundingBox, t = (e.max.x - e.min.x) / 2, s = (e.max.y - e.min.y) / 2;
878
878
  dr(i, t, s, 0);
879
879
  }
880
- function Ja(i, e, t) {
880
+ function Qa(i, e, t) {
881
881
  i.left = e / -2, i.right = e / 2, i.top = t / 2, i.bottom = t / -2, i.position.x = e / 2, i.position.y = t / -2, i.updateProjectionMatrix();
882
882
  }
883
- function eo(i, e, t) {
883
+ function Ja(i, e, t) {
884
884
  const s = 1.7777777777777777, n = e / t;
885
885
  let r = e, a = t;
886
886
  n > s ? r = t * s : a = e / s, i.left = r / -2, i.right = r / 2, i.top = a / 2, i.bottom = a / -2, i.updateProjectionMatrix();
887
887
  }
888
- function to() {
888
+ function eo() {
889
889
  let e = "transferControlToOffscreen" in document.createElement("canvas");
890
890
  if (/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {
891
891
  const s = navigator.userAgent.match(/version\/(\d+)/i);
@@ -893,29 +893,29 @@ function to() {
893
893
  }
894
894
  return e;
895
895
  }
896
- function io(i, e, t = !0, s = !1) {
896
+ function to(i, e, t = !0, s = !1) {
897
897
  i.renderOrder = -e;
898
898
  const n = i.material;
899
899
  Array.isArray(n) ? n.forEach((r) => {
900
900
  r.colorWrite = t, r.depthWrite = s, r.stencilWrite = !0, r.stencilRef = e, r.stencilFunc = si, r.stencilFail = Ee, r.stencilZFail = Ee, r.stencilZPass = Ee;
901
901
  }) : (n.colorWrite = t, n.depthWrite = s, n.stencilWrite = !0, n.stencilRef = e, n.stencilFunc = si, n.stencilFail = Ee, n.stencilZFail = Ee, n.stencilZPass = Ee);
902
902
  }
903
- function so(i, e, t = !1) {
903
+ function io(i, e, t = !1) {
904
904
  const s = i.material;
905
905
  Array.isArray(s) ? s.forEach((n) => {
906
906
  n.stencilWrite = !0, n.stencilRef = e, n.stencilFunc = t ? ni : ri, n.stencilFail = Se, n.stencilZFail = Se, n.stencilZPass = Se;
907
907
  }) : (s.stencilWrite = !0, s.stencilRef = e, s.stencilFunc = t ? ni : ri, s.stencilFail = Se, s.stencilZFail = Se, s.stencilZPass = Se);
908
908
  }
909
- function no(i) {
909
+ function so(i) {
910
910
  i.blending = Yi, i.blendEquation = Je, i.blendSrc = gt, i.blendDst = vt, i.needsUpdate = !0;
911
911
  }
912
- function ro(i) {
912
+ function no(i) {
913
913
  i.blending = _t, i.blendEquation = Je, i.blendSrc = gt, i.blendDst = yt, i.needsUpdate = !0;
914
914
  }
915
- function ao(i) {
915
+ function ro(i) {
916
916
  i.blending = _t, i.blendEquation = Je, i.blendSrc = Xt, i.blendDst = vt, i.needsUpdate = !0;
917
917
  }
918
- function oo(i) {
918
+ function ao(i) {
919
919
  i.blending = _t, i.blendEquation = Je, i.blendSrc = Qt, i.blendDst = yt, i.needsUpdate = !0;
920
920
  }
921
921
  let jt = [];
@@ -1044,17 +1044,17 @@ function ur(i, e, t = !0) {
1044
1044
  }
1045
1045
  }), jt.push(r);
1046
1046
  }
1047
- function lo(i, e) {
1047
+ function oo(i, e) {
1048
1048
  i.passes.forEach((t) => {
1049
1049
  ur(t, e);
1050
1050
  });
1051
1051
  }
1052
- function co(i) {
1052
+ function lo(i) {
1053
1053
  jt.forEach((e) => {
1054
1054
  i.removeGroup(e);
1055
1055
  }), jt = [];
1056
1056
  }
1057
- function ho(i, e, t, s = 1024) {
1057
+ function co(i, e, t, s = 1024) {
1058
1058
  return new Promise((n) => {
1059
1059
  const r = e.aspect, a = e.fov, o = e.rotation.clone(), c = t.outputBuffer;
1060
1060
  e.aspect = 1, e.fov = 90, e.updateProjectionMatrix();
@@ -1180,7 +1180,7 @@ function yr(i, e) {
1180
1180
  const { keyCode: t } = i;
1181
1181
  _r[t] && (i.preventDefault(), mr(i, e));
1182
1182
  }
1183
- const uo = {
1183
+ const ho = {
1184
1184
  contextmenu: gr,
1185
1185
  mousedown: Me,
1186
1186
  mousemove: Me,
@@ -1195,7 +1195,7 @@ const uo = {
1195
1195
  keydown: yr
1196
1196
  };
1197
1197
  let Cr = 0;
1198
- class po {
1198
+ class uo {
1199
1199
  id;
1200
1200
  worker;
1201
1201
  constructor(e, t, s) {
@@ -1281,7 +1281,7 @@ class br extends Zi {
1281
1281
  return this;
1282
1282
  }
1283
1283
  }
1284
- class mo {
1284
+ class po {
1285
1285
  targets = {};
1286
1286
  constructor() {
1287
1287
  this.handleEvent = this.handleEvent.bind(this);
@@ -1297,7 +1297,7 @@ class mo {
1297
1297
  this.targets[e.id]?.handleEvent(e.data);
1298
1298
  }
1299
1299
  }
1300
- class fo {
1300
+ class mo {
1301
1301
  assets = {
1302
1302
  audio: /* @__PURE__ */ new Map(),
1303
1303
  image: /* @__PURE__ */ new Map(),
@@ -1416,7 +1416,7 @@ function Sr(i, e, t) {
1416
1416
  e.value
1417
1417
  );
1418
1418
  }
1419
- class go extends cs {
1419
+ class fo extends cs {
1420
1420
  project;
1421
1421
  sheets = /* @__PURE__ */ new Map();
1422
1422
  sheetObjects = /* @__PURE__ */ new Map();
@@ -1896,7 +1896,7 @@ function hs(i) {
1896
1896
  });
1897
1897
  }
1898
1898
  var R = /* @__PURE__ */ ((i) => (i.CUSTOM = "ToolEvents::custom", i.SELECT_DROPDOWN = "ToolEvents::selectDropdown", i.DRAG_UPDATE = "ToolEvents::dragUpdate", i.ADD_SCENE = "ToolEvents::addScene", i.REFRESH_SCENE = "ToolEvents::refreshScene", i.REMOVE_SCENE = "ToolEvents::removeScene", i.SET_SCENE = "ToolEvents::setScene", i.SET_OBJECT = "ToolEvents::setObject", i.CLEAR_OBJECT = "ToolEvents::clearObject", i.ADD_CAMERA = "ToolEvents::addCamera", i.REMOVE_CAMERA = "ToolEvents::removeCamera", i.ADD_GROUP = "ToolEvents::addGroup", i.REMOVE_GROUP = "ToolEvents::removeGroup", i.ADD_SPLINE = "ToolEvents::addSpline", i.ADD_RENDERER = "ToolEvents::addRenderer", i.UPDATE_RENDERER = "ToolEvents::updateRenderer", i))(R || {});
1899
- class vo extends cs {
1899
+ class go extends cs {
1900
1900
  name;
1901
1901
  canvas = null;
1902
1902
  // Canvas or OffscreenCanvas
@@ -2495,7 +2495,7 @@ function je(i) {
2495
2495
  ]
2496
2496
  }
2497
2497
  ),
2498
- i.onRefresh ? /* @__PURE__ */ M(q, { children: [
2498
+ i.onRefresh ? /* @__PURE__ */ M(Y, { children: [
2499
2499
  /* @__PURE__ */ f(
2500
2500
  "button",
2501
2501
  {
@@ -2633,7 +2633,7 @@ function Ce(i) {
2633
2633
  onChange: (r) => {
2634
2634
  n(r), i.onChange !== void 0 && i.onChange(i.prop, r);
2635
2635
  }
2636
- }), /* @__PURE__ */ M(q, { children: [
2636
+ }), /* @__PURE__ */ M(Y, { children: [
2637
2637
  i.type === "number" && /* @__PURE__ */ f(
2638
2638
  "input",
2639
2639
  {
@@ -2654,7 +2654,7 @@ function Ce(i) {
2654
2654
  }
2655
2655
  }
2656
2656
  ),
2657
- i.type === "range" && /* @__PURE__ */ M(q, { children: [
2657
+ i.type === "range" && /* @__PURE__ */ M(Y, { children: [
2658
2658
  /* @__PURE__ */ f(
2659
2659
  "input",
2660
2660
  {
@@ -3793,7 +3793,7 @@ function Xr(i, e) {
3793
3793
  `Material ${l}`
3794
3794
  )
3795
3795
  );
3796
- return /* @__PURE__ */ f(q, { children: o });
3796
+ return /* @__PURE__ */ f(Y, { children: o });
3797
3797
  } else
3798
3798
  return /* @__PURE__ */ f(
3799
3799
  X,
@@ -3982,7 +3982,7 @@ function ht(i) {
3982
3982
  onChange: i.onChange
3983
3983
  }
3984
3984
  ),
3985
- i.type === "color" && /* @__PURE__ */ M(q, { children: [
3985
+ i.type === "color" && /* @__PURE__ */ M(Y, { children: [
3986
3986
  /* @__PURE__ */ f("input", { type: "text", value: t.toString(), onChange: r, disabled: i.disabled, className: "color", name: W() }),
3987
3987
  /* @__PURE__ */ f("input", { type: "color", value: t, onChange: r, disabled: i.disabled, name: W() })
3988
3988
  ] }),
@@ -3997,7 +3997,7 @@ function ht(i) {
3997
3997
  }
3998
3998
  ),
3999
3999
  i.type === "image" && /* @__PURE__ */ f(Qr, { title: i.title, prop: i.prop, value: i.value, onChange: i.onChange }),
4000
- i.type === "option" && /* @__PURE__ */ f(q, { children: /* @__PURE__ */ f(
4000
+ i.type === "option" && /* @__PURE__ */ f(Y, { children: /* @__PURE__ */ f(
4001
4001
  "select",
4002
4002
  {
4003
4003
  onChange: r,
@@ -4226,19 +4226,19 @@ class I extends Qe {
4226
4226
  e.title
4227
4227
  );
4228
4228
  return I.groups.push(r), I.groupsRefs.push(n), I.groupTitles.push(e.title), setTimeout(() => {
4229
- I.instance.setState({ lastUpdate: Date.now() });
4229
+ I.instance?.setState({ lastUpdate: Date.now() });
4230
4230
  }, 0), n;
4231
4231
  }
4232
4232
  static removeEditorGroup(e) {
4233
4233
  const t = I.groupTitles.length;
4234
4234
  for (let s = 0; s < t; s++)
4235
4235
  if (e === I.groupTitles[s]) {
4236
- I.groups.splice(s, 1), I.groupTitles.splice(s, 1), I.instance.setState({ lastUpdate: Date.now() });
4236
+ I.groups.splice(s, 1), I.groupTitles.splice(s, 1), I.instance?.setState({ lastUpdate: Date.now() });
4237
4237
  return;
4238
4238
  }
4239
4239
  }
4240
4240
  static removeAllGroups() {
4241
- I.groups = [], I.groupTitles = [], I.groupsRefs = [], I.instance.setState({ lastUpdate: Date.now() });
4241
+ I.groups = [], I.groupTitles = [], I.groupsRefs = [], I.instance?.setState({ lastUpdate: Date.now() });
4242
4242
  }
4243
4243
  }
4244
4244
  function Ri(i) {
@@ -4488,7 +4488,7 @@ class ta {
4488
4488
  }
4489
4489
  var Ut;
4490
4490
  const ia = "2.10.1", at = 1 / 8, sa = /Mac/.test((Ut = globalThis?.navigator) === null || Ut === void 0 ? void 0 : Ut.platform);
4491
- let T, Ui, ot, Lt, Z, A, U, De, Be, se, ne, ve, Li, ki, K, Ve, Ie, Ni, kt, Fi, Nt, Ft, lt;
4491
+ let T, Ui, ot, Lt, q, A, U, De, Be, se, ne, ve, Li, ki, K, Ve, Ie, Ni, kt, Fi, Nt, Ft, lt;
4492
4492
  class ae extends ta {
4493
4493
  /**
4494
4494
  * Injects THREE as the dependency. You can then proceed to use CameraControls.
@@ -4531,7 +4531,7 @@ class ae extends ta {
4531
4531
  * @category Statics
4532
4532
  */
4533
4533
  static install(e) {
4534
- T = e.THREE, Ui = Object.freeze(new T.Vector3(0, 0, 0)), ot = Object.freeze(new T.Vector3(0, 1, 0)), Lt = Object.freeze(new T.Vector3(0, 0, 1)), Z = new T.Vector2(), A = new T.Vector3(), U = new T.Vector3(), De = new T.Vector3(), Be = new T.Vector3(), se = new T.Vector3(), ne = new T.Vector3(), ve = new T.Vector3(), Li = new T.Vector3(), ki = new T.Vector3(), K = new T.Spherical(), Ve = new T.Spherical(), Ie = new T.Box3(), Ni = new T.Box3(), kt = new T.Sphere(), Fi = new T.Quaternion(), Nt = new T.Quaternion(), Ft = new T.Matrix4(), lt = new T.Raycaster();
4534
+ T = e.THREE, Ui = Object.freeze(new T.Vector3(0, 0, 0)), ot = Object.freeze(new T.Vector3(0, 1, 0)), Lt = Object.freeze(new T.Vector3(0, 0, 1)), q = new T.Vector2(), A = new T.Vector3(), U = new T.Vector3(), De = new T.Vector3(), Be = new T.Vector3(), se = new T.Vector3(), ne = new T.Vector3(), ve = new T.Vector3(), Li = new T.Vector3(), ki = new T.Vector3(), K = new T.Spherical(), Ve = new T.Spherical(), Ie = new T.Box3(), Ni = new T.Box3(), kt = new T.Sphere(), Fi = new T.Quaternion(), Nt = new T.Quaternion(), Ft = new T.Matrix4(), lt = new T.Raycaster();
4535
4535
  }
4536
4536
  /**
4537
4537
  * list all ACTIONs
@@ -4720,8 +4720,8 @@ class ae extends ta {
4720
4720
  }, u = (g) => {
4721
4721
  if (!this._enabled)
4722
4722
  return;
4723
- if (Dt(this._activePointers, Z), this._getClientRect(this._elementRect), s.copy(Z), n.copy(Z), this._activePointers.length >= 2) {
4724
- const E = Z.x - this._activePointers[1].clientX, S = Z.y - this._activePointers[1].clientY, b = Math.sqrt(E * E + S * S);
4723
+ if (Dt(this._activePointers, q), this._getClientRect(this._elementRect), s.copy(q), n.copy(q), this._activePointers.length >= 2) {
4724
+ const E = q.x - this._activePointers[1].clientX, S = q.y - this._activePointers[1].clientY, b = Math.sqrt(E * E + S * S);
4725
4725
  r.set(0, b);
4726
4726
  const O = (this._activePointers[0].clientX + this._activePointers[1].clientX) * 0.5, w = (this._activePointers[0].clientY + this._activePointers[1].clientY) * 0.5;
4727
4727
  n.set(O, w);
@@ -4746,21 +4746,21 @@ class ae extends ta {
4746
4746
  }, m = () => {
4747
4747
  if (!this._enabled || !this._dragNeedsUpdate)
4748
4748
  return;
4749
- this._dragNeedsUpdate = !1, Dt(this._activePointers, Z);
4750
- const _ = this._domElement && this._domElement.ownerDocument.pointerLockElement === this._domElement ? this._lockedPointer || this._activePointers[0] : null, E = _ ? -_.deltaX : n.x - Z.x, S = _ ? -_.deltaY : n.y - Z.y;
4751
- if (n.copy(Z), ((this._state & p.ROTATE) === p.ROTATE || (this._state & p.TOUCH_ROTATE) === p.TOUCH_ROTATE || (this._state & p.TOUCH_DOLLY_ROTATE) === p.TOUCH_DOLLY_ROTATE || (this._state & p.TOUCH_ZOOM_ROTATE) === p.TOUCH_ZOOM_ROTATE) && (this._rotateInternal(E, S), this._isUserControllingRotate = !0), (this._state & p.DOLLY) === p.DOLLY || (this._state & p.ZOOM) === p.ZOOM) {
4749
+ this._dragNeedsUpdate = !1, Dt(this._activePointers, q);
4750
+ const _ = this._domElement && this._domElement.ownerDocument.pointerLockElement === this._domElement ? this._lockedPointer || this._activePointers[0] : null, E = _ ? -_.deltaX : n.x - q.x, S = _ ? -_.deltaY : n.y - q.y;
4751
+ if (n.copy(q), ((this._state & p.ROTATE) === p.ROTATE || (this._state & p.TOUCH_ROTATE) === p.TOUCH_ROTATE || (this._state & p.TOUCH_DOLLY_ROTATE) === p.TOUCH_DOLLY_ROTATE || (this._state & p.TOUCH_ZOOM_ROTATE) === p.TOUCH_ZOOM_ROTATE) && (this._rotateInternal(E, S), this._isUserControllingRotate = !0), (this._state & p.DOLLY) === p.DOLLY || (this._state & p.ZOOM) === p.ZOOM) {
4752
4752
  const b = this.dollyToCursor ? (s.x - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, O = this.dollyToCursor ? (s.y - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0, w = this.dollyDragInverted ? -1 : 1;
4753
4753
  (this._state & p.DOLLY) === p.DOLLY ? (this._dollyInternal(w * S * at, b, O), this._isUserControllingDolly = !0) : (this._zoomInternal(w * S * at, b, O), this._isUserControllingZoom = !0);
4754
4754
  }
4755
4755
  if ((this._state & p.TOUCH_DOLLY) === p.TOUCH_DOLLY || (this._state & p.TOUCH_ZOOM) === p.TOUCH_ZOOM || (this._state & p.TOUCH_DOLLY_TRUCK) === p.TOUCH_DOLLY_TRUCK || (this._state & p.TOUCH_ZOOM_TRUCK) === p.TOUCH_ZOOM_TRUCK || (this._state & p.TOUCH_DOLLY_SCREEN_PAN) === p.TOUCH_DOLLY_SCREEN_PAN || (this._state & p.TOUCH_ZOOM_SCREEN_PAN) === p.TOUCH_ZOOM_SCREEN_PAN || (this._state & p.TOUCH_DOLLY_OFFSET) === p.TOUCH_DOLLY_OFFSET || (this._state & p.TOUCH_ZOOM_OFFSET) === p.TOUCH_ZOOM_OFFSET || (this._state & p.TOUCH_DOLLY_ROTATE) === p.TOUCH_DOLLY_ROTATE || (this._state & p.TOUCH_ZOOM_ROTATE) === p.TOUCH_ZOOM_ROTATE) {
4756
- const b = Z.x - this._activePointers[1].clientX, O = Z.y - this._activePointers[1].clientY, w = Math.sqrt(b * b + O * O), D = r.y - w;
4756
+ const b = q.x - this._activePointers[1].clientX, O = q.y - this._activePointers[1].clientY, w = Math.sqrt(b * b + O * O), D = r.y - w;
4757
4757
  r.set(0, w);
4758
4758
  const x = this.dollyToCursor ? (n.x - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, N = this.dollyToCursor ? (n.y - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
4759
4759
  (this._state & p.TOUCH_DOLLY) === p.TOUCH_DOLLY || (this._state & p.TOUCH_DOLLY_ROTATE) === p.TOUCH_DOLLY_ROTATE || (this._state & p.TOUCH_DOLLY_TRUCK) === p.TOUCH_DOLLY_TRUCK || (this._state & p.TOUCH_DOLLY_SCREEN_PAN) === p.TOUCH_DOLLY_SCREEN_PAN || (this._state & p.TOUCH_DOLLY_OFFSET) === p.TOUCH_DOLLY_OFFSET ? (this._dollyInternal(D * at, x, N), this._isUserControllingDolly = !0) : (this._zoomInternal(D * at, x, N), this._isUserControllingZoom = !0);
4760
4760
  }
4761
4761
  ((this._state & p.TRUCK) === p.TRUCK || (this._state & p.TOUCH_TRUCK) === p.TOUCH_TRUCK || (this._state & p.TOUCH_DOLLY_TRUCK) === p.TOUCH_DOLLY_TRUCK || (this._state & p.TOUCH_ZOOM_TRUCK) === p.TOUCH_ZOOM_TRUCK) && (this._truckInternal(E, S, !1, !1), this._isUserControllingTruck = !0), ((this._state & p.SCREEN_PAN) === p.SCREEN_PAN || (this._state & p.TOUCH_SCREEN_PAN) === p.TOUCH_SCREEN_PAN || (this._state & p.TOUCH_DOLLY_SCREEN_PAN) === p.TOUCH_DOLLY_SCREEN_PAN || (this._state & p.TOUCH_ZOOM_SCREEN_PAN) === p.TOUCH_ZOOM_SCREEN_PAN) && (this._truckInternal(E, S, !1, !0), this._isUserControllingTruck = !0), ((this._state & p.OFFSET) === p.OFFSET || (this._state & p.TOUCH_OFFSET) === p.TOUCH_OFFSET || (this._state & p.TOUCH_DOLLY_OFFSET) === p.TOUCH_DOLLY_OFFSET || (this._state & p.TOUCH_ZOOM_OFFSET) === p.TOUCH_ZOOM_OFFSET) && (this._truckInternal(E, S, !0, !1), this._isUserControllingOffset = !0), this.dispatchEvent({ type: "control" });
4762
4762
  }, y = () => {
4763
- Dt(this._activePointers, Z), n.copy(Z), this._dragNeedsUpdate = !1, (this._activePointers.length === 0 || this._activePointers.length === 1 && this._activePointers[0] === this._lockedPointer) && (this._isDragging = !1), this._activePointers.length === 0 && this._domElement && (this._domElement.ownerDocument.removeEventListener("pointermove", o, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("pointerup", c), this.dispatchEvent({ type: "controlend" }));
4763
+ Dt(this._activePointers, q), n.copy(q), this._dragNeedsUpdate = !1, (this._activePointers.length === 0 || this._activePointers.length === 1 && this._activePointers[0] === this._lockedPointer) && (this._isDragging = !1), this._activePointers.length === 0 && this._domElement && (this._domElement.ownerDocument.removeEventListener("pointermove", o, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("pointerup", c), this.dispatchEvent({ type: "controlend" }));
4764
4764
  };
4765
4765
  this.lockPointer = () => {
4766
4766
  !this._enabled || !this._domElement || (this.cancel(), this._lockedPointer = {
@@ -5924,28 +5924,28 @@ class la extends an {
5924
5924
  const { uScale: t, uDivisions: s, uColor: n, uDistance: r, uSubgridOpacity: a, uGridOpacity: o } = this, c = Dn("vec3", "vWorldPosition");
5925
5925
  this.positionNode = wt(() => {
5926
5926
  const h = In.xzy.mul(r).add(
5927
- Un(it.x, Y(0), it.z)
5927
+ Un(it.x, Z(0), it.z)
5928
5928
  );
5929
5929
  return c.assign(h), h;
5930
5930
  })();
5931
5931
  const l = wt(([h]) => {
5932
5932
  const d = c.xz.div(h), u = Ln(d), m = mi(kn(d.sub(0.5)).sub(0.5)).div(u).div(2), y = xt(m.x, m.y);
5933
- return Y(1).sub(xt(y, Y(1)));
5933
+ return Z(1).sub(xt(y, Z(1)));
5934
5934
  });
5935
5935
  this.outputNode = wt(() => {
5936
- const h = c, d = fi(Y(200), mi(it.y.sub(h.y))), u = Y(Nn(it, h)), m = gi(d).div(gi(s)), y = vi(s, Fn(m)), v = y.mul(s), C = v.mul(s), g = l(y.mul(t)), _ = l(v.mul(t)), E = l(C.mul(t)), S = d.sub(y).div(v.sub(y)), b = Y(0.3), O = fi(
5937
- S.sub(Y(1)).add(b),
5938
- Y(0)
5936
+ const h = c, d = fi(Z(200), mi(it.y.sub(h.y))), u = Z(Nn(it, h)), m = gi(d).div(gi(s)), y = vi(s, Fn(m)), v = y.mul(s), C = v.mul(s), g = l(y.mul(t)), _ = l(v.mul(t)), E = l(C.mul(t)), S = d.sub(y).div(v.sub(y)), b = Z(0.3), O = fi(
5937
+ S.sub(Z(1)).add(b),
5938
+ Z(0)
5939
5939
  ).div(b), w = g.mul(
5940
- vi(Y(1).sub(xt(u.div(r), Y(1))), Y(3))
5941
- ), D = Y(0.5), x = w.sub(O).mul(a), N = _i(
5940
+ vi(Z(1).sub(xt(u.div(r), Z(1))), Z(3))
5941
+ ), D = Z(0.5), x = w.sub(O).mul(a), N = _i(
5942
5942
  x,
5943
5943
  w.mul(o).sub(
5944
5944
  O.mul(o.sub(a)).mul(D)
5945
5945
  ),
5946
5946
  _
5947
- ), Q = Y(_i(N, w.mul(o), E));
5948
- return zn(Hn(Q, Y(1 / 127)), () => {
5947
+ ), Q = Z(_i(N, w.mul(o), E));
5948
+ return zn(Hn(Q, Z(1 / 127)), () => {
5949
5949
  Bn();
5950
5950
  }), Vn(n, Q);
5951
5951
  })();
@@ -6745,7 +6745,7 @@ class G extends Qe {
6745
6745
  }), /* @__PURE__ */ M("div", { className: "multiview", children: [
6746
6746
  /* @__PURE__ */ f("canvas", { ref: this.canvasRef }),
6747
6747
  /* @__PURE__ */ M("div", { className: `cameras ${this.state.mode === "Single" || this.state.mode === "Stacked" ? "single" : ""}`, ref: this.containerRef, children: [
6748
- this.state.mode === "Single" && /* @__PURE__ */ f(q, { children: /* @__PURE__ */ f(
6748
+ this.state.mode === "Single" && /* @__PURE__ */ f(Y, { children: /* @__PURE__ */ f(
6749
6749
  _e,
6750
6750
  {
6751
6751
  name: "tl",
@@ -6762,7 +6762,7 @@ class G extends Qe {
6762
6762
  }
6763
6763
  }
6764
6764
  ) }),
6765
- (this.state.mode === "Side by Side" || this.state.mode === "Stacked") && /* @__PURE__ */ M(q, { children: [
6765
+ (this.state.mode === "Side by Side" || this.state.mode === "Stacked") && /* @__PURE__ */ M(Y, { children: [
6766
6766
  /* @__PURE__ */ f(
6767
6767
  _e,
6768
6768
  {
@@ -6798,7 +6798,7 @@ class G extends Qe {
6798
6798
  }
6799
6799
  )
6800
6800
  ] }),
6801
- this.state.mode === "Quad" && /* @__PURE__ */ M(q, { children: [
6801
+ this.state.mode === "Quad" && /* @__PURE__ */ M(Y, { children: [
6802
6802
  /* @__PURE__ */ f(
6803
6803
  _e,
6804
6804
  {
@@ -7767,8 +7767,8 @@ function ya(i) {
7767
7767
  button: e.uuid.length > 0 ? /* @__PURE__ */ f("button", { className: "remove", onClick: () => {
7768
7768
  $.instance.remove(e.name), t(Vt);
7769
7769
  } }) : void 0,
7770
- children: /* @__PURE__ */ f("div", { id: "Inspector", className: i.class, children: e.uuid.length > 0 && /* @__PURE__ */ M(q, { children: [
7771
- /* @__PURE__ */ M(q, { children: [
7770
+ children: /* @__PURE__ */ f("div", { id: "Inspector", className: i.class, children: e.uuid.length > 0 && /* @__PURE__ */ M(Y, { children: [
7771
+ /* @__PURE__ */ M(Y, { children: [
7772
7772
  /* @__PURE__ */ f(
7773
7773
  ht,
7774
7774
  {
@@ -7800,7 +7800,7 @@ function ya(i) {
7800
7800
  }
7801
7801
  )
7802
7802
  ] }),
7803
- /* @__PURE__ */ M(q, { children: [
7803
+ /* @__PURE__ */ M(Y, { children: [
7804
7804
  /* @__PURE__ */ f(bt, { object: e, three: i.three }),
7805
7805
  n ? /* @__PURE__ */ f(_a, { object: e, three: i.three }) : null,
7806
7806
  s.search("camera") > -1 ? ea(e, i.three) : null,
@@ -8131,7 +8131,7 @@ const fs = Bi((i, e) => /* @__PURE__ */ M("div", { className: "editor", ref: e,
8131
8131
  i.footer && /* @__PURE__ */ f("div", { className: "footer", children: i.footer })
8132
8132
  ] }));
8133
8133
  fs.displayName = "Editor";
8134
- function Ea(i) {
8134
+ function vo(i) {
8135
8135
  return /* @__PURE__ */ M(fs, { children: [
8136
8136
  /* @__PURE__ */ f(
8137
8137
  G,
@@ -8149,32 +8149,23 @@ function Ea(i) {
8149
8149
  function _o(i) {
8150
8150
  const {
8151
8151
  app: e,
8152
- scenes: t,
8153
- onSceneAdd: s,
8154
- onSceneUpdate: n,
8155
- onSceneResize: r,
8156
- onLoad: a,
8157
- renderLoading: o = null,
8158
- children: c
8159
- } = i, [l, h] = L(!1);
8152
+ renderEditor: t,
8153
+ onLoad: s,
8154
+ renderLoading: n = null,
8155
+ children: r
8156
+ } = i, [a, o] = L(!1);
8160
8157
  if (pe(() => {
8161
8158
  e.detectSettings().then(() => {
8162
- a ? a(e).then(() => h(!0)) : h(!0);
8159
+ s ? s(e).then(() => o(!0)) : o(!0);
8163
8160
  });
8164
- }, []), !l) return /* @__PURE__ */ f(q, { children: o });
8165
- const d = e.components.get("three");
8166
- return e.editor ? /* @__PURE__ */ f(
8167
- Ea,
8168
- {
8169
- three: d,
8170
- scenes: t,
8171
- onSceneAdd: s,
8172
- onSceneUpdate: n,
8173
- onSceneResize: r
8174
- }
8175
- ) : /* @__PURE__ */ f(q, { children: c?.(e) });
8161
+ }, []), !a) return /* @__PURE__ */ f(Y, { children: n });
8162
+ if (e.editor && t) {
8163
+ const c = e.components.get("three");
8164
+ return /* @__PURE__ */ f(Y, { children: t(c) });
8165
+ }
8166
+ return /* @__PURE__ */ f(Y, { children: r?.(e) });
8176
8167
  }
8177
- const Sa = `#include <common>
8168
+ const Ea = `#include <common>
8178
8169
  #include <batching_pars_vertex>
8179
8170
  #include <uv_pars_vertex>
8180
8171
  #include <color_pars_vertex>
@@ -8204,7 +8195,7 @@ void main() {
8204
8195
  #include <logdepthbuf_vertex>
8205
8196
  #include <clipping_planes_vertex>
8206
8197
  #include <worldpos_vertex>
8207
- }`, Oa = `
8198
+ }`, Sa = `
8208
8199
  uniform float opacity;
8209
8200
  #include <common>
8210
8201
  #include <uv_pars_fragment>
@@ -8224,15 +8215,15 @@ class yo extends ns {
8224
8215
  uniforms: {
8225
8216
  opacity: { value: 1 }
8226
8217
  },
8227
- vertexShader: Sa,
8228
- fragmentShader: Oa,
8218
+ vertexShader: Ea,
8219
+ fragmentShader: Sa,
8229
8220
  transparent: !0
8230
8221
  });
8231
8222
  }
8232
8223
  }
8233
8224
  export {
8234
8225
  je as Accordion,
8235
- fo as Application,
8226
+ mo as Application,
8236
8227
  cs as BaseRemote,
8237
8228
  us as ChildObject,
8238
8229
  Pt as ContainerObject,
@@ -8242,11 +8233,11 @@ export {
8242
8233
  Ir as Dropdown,
8243
8234
  Ur as DropdownItem,
8244
8235
  fs as Editor,
8245
- po as ElementProxy,
8236
+ uo as ElementProxy,
8246
8237
  br as ElementProxyReceiver,
8247
8238
  ce as ExportTexture,
8248
8239
  _o as HermesApp,
8249
- Fa as ImageSequenceCapturer,
8240
+ Na as ImageSequenceCapturer,
8250
8241
  oa as InfiniteGridHelper,
8251
8242
  ca as InfiniteGridHelperGPU,
8252
8243
  aa as InfiniteGridMaterial,
@@ -8254,66 +8245,66 @@ export {
8254
8245
  ya as Inspector,
8255
8246
  G as MultiView,
8256
8247
  ds as NavButton,
8257
- mo as ProxyManager,
8258
- go as RemoteTheatre,
8259
- vo as RemoteThree,
8248
+ po as ProxyManager,
8249
+ fo as RemoteTheatre,
8250
+ go as RemoteThree,
8260
8251
  ba as SidePanel,
8261
8252
  Bt as Spline,
8262
8253
  pa as SplineEditor,
8263
- Ea as ThreeEditor,
8254
+ vo as ThreeEditor,
8264
8255
  $ as Transform,
8265
8256
  yo as UVMaterial,
8266
8257
  da as UVNodeMaterial,
8267
- uo as WebworkerEventHandlers,
8258
+ ho as WebworkerEventHandlers,
8268
8259
  dr as anchorGeometry,
8269
- Qa as anchorGeometryTL,
8270
- qa as animateObjectMaterial,
8271
- Za as animateObjectTransform,
8260
+ Xa as anchorGeometryTL,
8261
+ Za as animateObjectMaterial,
8262
+ Ya as animateObjectTransform,
8272
8263
  hr as applyObjectMaterial,
8273
8264
  mt as capitalize,
8274
8265
  ye as clamp,
8275
- co as clearComposerGroups,
8266
+ lo as clearComposerGroups,
8276
8267
  yi as colorToHex,
8277
8268
  Zn as copyToClipboard,
8278
- io as createMask,
8279
- Ga as cubicBezier,
8280
- Ya as customizeTheatreElements,
8281
- Ba as damp,
8282
- Na as defaultTheatreCallback,
8269
+ to as createMask,
8270
+ Va as cubicBezier,
8271
+ Wa as customizeTheatreElements,
8272
+ Ha as damp,
8273
+ ka as defaultTheatreCallback,
8283
8274
  er as detectMaxFrameRate,
8284
8275
  tr as detectSettings,
8285
8276
  ie as dispose,
8286
8277
  ls as disposeMaterial,
8287
8278
  Oi as disposeTexture,
8288
- Ha as distance,
8289
- ho as generateCubemap,
8290
- Va as getAngle,
8279
+ za as distance,
8280
+ co as generateCubemap,
8281
+ Ba as getAngle,
8291
8282
  cr as getObjectMaterialObject,
8292
8283
  lr as getObjectMaterialProps,
8293
8284
  We as hierarchyUUID,
8294
- lo as inspectComposer,
8285
+ oo as inspectComposer,
8295
8286
  ur as inspectComposerPass,
8296
8287
  qn as isColor,
8297
- za as map,
8288
+ Fa as map,
8298
8289
  Xe as mix,
8299
8290
  pt as noop,
8300
8291
  Zt as normalize,
8301
- ja as orthoCamera,
8302
- Ka as parseModelLite,
8292
+ qa as orthoCamera,
8293
+ ja as parseModelLite,
8303
8294
  W as randomID,
8304
- Xa as renderToTexture,
8295
+ Ka as renderToTexture,
8305
8296
  nt as resetThreeObjects,
8306
- $a as rgbaToHex,
8297
+ Ga as rgbaToHex,
8307
8298
  te as roundTo,
8308
- ro as setMaterialBlendAdd,
8309
- ao as setMaterialBlendMultiply,
8310
- no as setMaterialBlendNormal,
8311
- oo as setMaterialBlendScreen,
8312
- to as supportsOffscreenCanvas,
8299
+ no as setMaterialBlendAdd,
8300
+ ro as setMaterialBlendMultiply,
8301
+ so as setMaterialBlendNormal,
8302
+ ao as setMaterialBlendScreen,
8303
+ eo as supportsOffscreenCanvas,
8313
8304
  qt as totalThreeObjects,
8314
8305
  Jt as triangle,
8315
- Ja as updateCameraOrtho,
8316
- eo as updateCameraOrtho16x9,
8317
- so as useMask,
8318
- Wa as useStudio
8306
+ Qa as updateCameraOrtho,
8307
+ Ja as updateCameraOrtho16x9,
8308
+ io as useMask,
8309
+ $a as useStudio
8319
8310
  };