u-space 0.0.25 → 0.0.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist/index.cjs +3 -3
  2. package/dist/index.js +594 -533
  3. package/dist/plugins/atmosphere/index.cjs +1 -1
  4. package/dist/plugins/atmosphere/index.js +3255 -129
  5. package/dist/plugins/atmosphere/threeR185Compat.d.ts +2 -0
  6. package/dist/plugins/fire/FireEffect.d.ts +90 -0
  7. package/dist/plugins/fire/index.cjs +1 -0
  8. package/dist/plugins/fire/index.d.ts +1 -0
  9. package/dist/plugins/fire/index.js +433 -0
  10. package/dist/plugins/u-manager/index.cjs +58 -58
  11. package/dist/plugins/u-manager/index.d.ts +1 -0
  12. package/dist/plugins/u-manager/index.js +9691 -9070
  13. package/dist/plugins/u-manager/loaders/SceneInstancedLayer.d.ts +29 -0
  14. package/dist/plugins/u-manager/loaders/SceneLoader.d.ts +5 -5
  15. package/dist/plugins/u-manager/semantics/objects/BuildingGroup.d.ts +3 -0
  16. package/dist/plugins/u-manager/semantics/objects/FacilityInstancedLayer.d.ts +24 -0
  17. package/dist/plugins/u-manager/semantics/objects/FloorMesh.d.ts +2 -1
  18. package/dist/plugins/u-manager/semantics/types.d.ts +2 -0
  19. package/dist/src/tools/AnnotationManager.d.ts +4 -1
  20. package/dist/src/viewers/RenderPipeline.d.ts +6 -5
  21. package/docs/api-effects.md +2 -0
  22. package/docs/api-interactions.md +1 -0
  23. package/docs/api-managers.md +1 -1
  24. package/docs/api-plugin-fire.md +174 -0
  25. package/docs/api-plugin-u-manager.md +178 -15
  26. package/docs/api-tools.md +1 -1
  27. package/docs/changelog.md +38 -0
  28. package/docs/examples-guide.md +13 -1
  29. package/docs/getting-started.md +1 -1
  30. package/docs/index.md +1 -0
  31. package/docs/mcp.md +27 -1
  32. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -1,26 +1,26 @@
1
- import { Raycaster as Le, Vector2 as C, EventDispatcher as Re, Box2 as st, Matrix4 as Ie, Vector3 as w, Box3 as q, Scene as ze, Color as M, AmbientLight as nt, DirectionalLight as me, PointLight as fe, SpotLight as ge, HemisphereLight as ye, DirectionalLightHelper as it, PointLightHelper as rt, SpotLightHelper as at, HemisphereLightHelper as ot, RenderPipeline as ct, PerspectiveCamera as V, Sphere as Ne, Spherical as S, Quaternion as ht, Vector4 as lt, MathUtils as dt, PMREMGenerator as pt, OrthographicCamera as Z, TimestampQuery as Y, Cache as ut, Timer as mt, WebGPURenderer as ft, PCFShadowMap as gt, AgXToneMapping as yt, Fog as wt, FogExp2 as vt, MeshStandardNodeMaterial as I, Loader as bt, LoaderUtils as L, FileLoader as je, TextureLoader as De, Group as R, SRGBColorSpace as ke, RepeatWrapping as we, BufferGeometry as K, BufferAttribute as ve, Mesh as D, FrontSide as xt, BackSide as Ct, DoubleSide as St, REVISION as be, CubeTextureLoader as Mt, EquirectangularReflectionMapping as Tt, Sprite as _t, AnimationMixer as Et, LoopRepeat as Pt, LoopOnce as Ot, SphereGeometry as At, TubeGeometry as Bt, LineCurve3 as Lt, CatmullRomCurve3 as Rt, SpriteNodeMaterial as It, CanvasTexture as zt, ShapeGeometry as Nt, Shape as Ue, ExtrudeGeometry as jt, PlaneGeometry as Dt, CircleGeometry as kt, ClippingGroup as Ut, Plane as Ht, PlaneHelper as Ft, LineBasicMaterial as ee, Line as te } from "three/webgpu";
2
- import { pass as pe, mrt as Gt, output as $t, add as xe, blendColor as Wt, emissive as Kt, normalView as Qt, velocity as qt, color as H, uv as Ce, time as se, pow as ne, sin as ue, mix as ie, mx_noise_float as Se, Fn as He, userData as B, materialColor as Me, select as re, materialOpacity as Xt, vec3 as Yt } from "three/tsl";
3
- import { bloom as Jt } from "three/addons/tsl/display/BloomNode.js";
4
- import { ssgi as Vt } from "three/addons/tsl/display/SSGINode.js";
5
- import { traa as Zt } from "three/addons/tsl/display/TRAANode.js";
6
- import Fe from "camera-controls";
7
- import { RoomEnvironment as es } from "three/addons/environments/RoomEnvironment.js";
8
- import { ViewHelper as ts } from "three/addons/helpers/ViewHelper.js";
9
- import { CSS2DRenderer as ss, CSS2DObject as ns } from "three/addons/renderers/CSS2DRenderer.js";
10
- import { CSS2DObject as jn } from "three/addons/renderers/CSS2DRenderer.js";
11
- import { CSS3DRenderer as is, CSS3DSprite as rs, CSS3DObject as as } from "three/addons/renderers/CSS3DRenderer.js";
12
- import { CSS3DObject as kn, CSS3DSprite as Un } from "three/addons/renderers/CSS3DRenderer.js";
13
- import { GLTFLoader as Ge } from "three/addons/loaders/GLTFLoader.js";
14
- import { FBXLoader as os } from "three/addons/loaders/FBXLoader.js";
15
- import { OBJLoader as cs } from "three/addons/loaders/OBJLoader.js";
16
- import { STLLoader as hs } from "three/addons/loaders/STLLoader.js";
17
- import { DRACOLoader as ls } from "three/addons/loaders/DRACOLoader.js";
18
- import { KTX2Loader as ds } from "three/addons/loaders/KTX2Loader.js";
19
- import { MeshoptDecoder as Te } from "three/addons/libs/meshopt_decoder.module.js";
20
- import { HDRLoader as ps } from "three/addons/loaders/HDRLoader.js";
21
- import { clone as us } from "three/addons/utils/SkeletonUtils.js";
22
- import { Easing as m, Tween as ms } from "three/addons/libs/tween.module.js";
23
- class fs {
1
+ import { Raycaster as ze, Vector2 as S, EventDispatcher as Ne, Box2 as rt, Matrix4 as De, Vector3 as v, Box3 as X, Scene as ke, Color as M, AmbientLight as ot, DirectionalLight as ye, PointLight as we, SpotLight as ve, HemisphereLight as be, DirectionalLightHelper as at, PointLightHelper as ct, SpotLightHelper as ht, HemisphereLightHelper as lt, RenderPipeline as dt, PerspectiveCamera as te, Sphere as je, Spherical as T, Quaternion as pt, Vector4 as ut, MathUtils as mt, PMREMGenerator as ft, OrthographicCamera as se, TimestampQuery as J, Cache as gt, Timer as yt, WebGPURenderer as wt, PCFShadowMap as vt, AgXToneMapping as bt, Fog as xt, FogExp2 as Ct, MeshStandardNodeMaterial as L, Loader as St, LoaderUtils as B, FileLoader as Ue, TextureLoader as He, Group as R, SRGBColorSpace as Fe, RepeatWrapping as xe, BufferGeometry as K, BufferAttribute as Ce, Mesh as k, FrontSide as Mt, BackSide as Tt, DoubleSide as _t, REVISION as Se, CubeTextureLoader as Et, EquirectangularReflectionMapping as Pt, Sprite as Ot, AnimationMixer as At, LoopRepeat as It, LoopOnce as Bt, SphereGeometry as Rt, TubeGeometry as Lt, LineCurve3 as zt, CatmullRomCurve3 as Nt, SpriteNodeMaterial as Dt, CanvasTexture as kt, ShapeGeometry as jt, Shape as Ge, ExtrudeGeometry as Ut, PlaneGeometry as Ht, CircleGeometry as Ft, ClippingGroup as Gt, Plane as $t, PlaneHelper as Wt, LineBasicMaterial as ne, Line as ie } from "three/webgpu";
2
+ import { pass as fe, mrt as Kt, output as Qt, add as Me, blendColor as qt, emissive as Xt, normalView as Yt, velocity as Vt, color as H, uv as Te, time as re, pow as oe, sin as ge, mix as ae, mx_noise_float as _e, Fn as $e, userData as I, materialColor as Ee, select as ce, materialOpacity as Jt, vec3 as Zt } from "three/tsl";
3
+ import { bloom as es } from "three/addons/tsl/display/BloomNode.js";
4
+ import { ssgi as ts } from "three/addons/tsl/display/SSGINode.js";
5
+ import { traa as ss } from "three/addons/tsl/display/TRAANode.js";
6
+ import We from "camera-controls";
7
+ import { RoomEnvironment as ns } from "three/addons/environments/RoomEnvironment.js";
8
+ import { ViewHelper as is } from "three/addons/helpers/ViewHelper.js";
9
+ import { CSS2DRenderer as rs, CSS2DObject as os } from "three/addons/renderers/CSS2DRenderer.js";
10
+ import { CSS2DObject as Fn } from "three/addons/renderers/CSS2DRenderer.js";
11
+ import { CSS3DRenderer as as, CSS3DSprite as cs, CSS3DObject as hs } from "three/addons/renderers/CSS3DRenderer.js";
12
+ import { CSS3DObject as $n, CSS3DSprite as Wn } from "three/addons/renderers/CSS3DRenderer.js";
13
+ import { GLTFLoader as Ke } from "three/addons/loaders/GLTFLoader.js";
14
+ import { FBXLoader as ls } from "three/addons/loaders/FBXLoader.js";
15
+ import { OBJLoader as ds } from "three/addons/loaders/OBJLoader.js";
16
+ import { STLLoader as ps } from "three/addons/loaders/STLLoader.js";
17
+ import { DRACOLoader as us } from "three/addons/loaders/DRACOLoader.js";
18
+ import { KTX2Loader as ms } from "three/addons/loaders/KTX2Loader.js";
19
+ import { MeshoptDecoder as Pe } from "three/addons/libs/meshopt_decoder.module.js";
20
+ import { HDRLoader as fs } from "three/addons/loaders/HDRLoader.js";
21
+ import { clone as gs } from "three/addons/utils/SkeletonUtils.js";
22
+ import { Easing as f, Tween as ys } from "three/addons/libs/tween.module.js";
23
+ class ws {
24
24
  /** The type of event (e.g., 'click', 'pointerdown'). */
25
25
  type;
26
26
  /** The original 3D object that triggered the event. */
@@ -48,15 +48,15 @@ class fs {
48
48
  return this._propagationStopped;
49
49
  }
50
50
  }
51
- class gs {
51
+ class vs {
52
52
  domElement;
53
53
  scene;
54
54
  camera;
55
- raycaster = new Le();
56
- pointer = new C();
55
+ raycaster = new ze();
56
+ pointer = new S();
57
57
  hoveredObject = null;
58
58
  pointerDownTime = 0;
59
- pointerDownPos = new C();
59
+ pointerDownPos = new S();
60
60
  clickTimer = null;
61
61
  longPressThreshold = 500;
62
62
  moveThreshold = 0.01;
@@ -143,7 +143,7 @@ class gs {
143
143
  * Dispatches an event to the target object and bubbles up the parent chain.
144
144
  */
145
145
  _dispatchToTarget(e, t, s, n) {
146
- const i = new fs({
146
+ const i = new ws({
147
147
  type: e,
148
148
  target: t,
149
149
  intersect: s,
@@ -205,7 +205,7 @@ class gs {
205
205
  this.domElement.removeEventListener("click", this._onClick), this.domElement.removeEventListener("dblclick", this._onDblClick), this.domElement.removeEventListener("contextmenu", this._onContextMenu), this.domElement.removeEventListener("pointerdown", this._onPointerDown), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.clickTimer && (clearTimeout(this.clickTimer), this.clickTimer = null), this.hoveredObject = null, this._excludeSet.clear();
206
206
  }
207
207
  }
208
- class bn extends Re {
208
+ class Tn extends Ne {
209
209
  scene;
210
210
  camera;
211
211
  domElement;
@@ -215,8 +215,8 @@ class bn extends Re {
215
215
  // Box selection state
216
216
  _boxSelectionEnabled = !1;
217
217
  _isSelecting = !1;
218
- _startPoint = new C();
219
- _endPoint = new C();
218
+ _startPoint = new S();
219
+ _endPoint = new S();
220
220
  _selectionBox = null;
221
221
  _deep = !0;
222
222
  /**
@@ -315,33 +315,45 @@ class bn extends Re {
315
315
  this._selectionBox.style.left = `${e}px`, this._selectionBox.style.top = `${t}px`, this._selectionBox.style.width = `${s}px`, this._selectionBox.style.height = `${n}px`;
316
316
  }
317
317
  _getObjectsInBox() {
318
- const e = this._container.getBoundingClientRect(), t = e.width, s = e.height, n = new C(
318
+ const e = this._container.getBoundingClientRect(), t = e.width, s = e.height, n = new S(
319
319
  this._startPoint.x / t * 2 - 1,
320
320
  -(this._startPoint.y / s) * 2 + 1
321
- ), i = new C(
321
+ ), i = new S(
322
322
  this._endPoint.x / t * 2 - 1,
323
323
  -(this._endPoint.y / s) * 2 + 1
324
- ), r = new st(
325
- new C(Math.min(n.x, i.x), Math.min(n.y, i.y)),
326
- new C(Math.max(n.x, i.x), Math.max(n.y, i.y))
327
- ), a = this.targetObjects || this.scene.children, o = [], c = new Ie();
324
+ ), r = new rt(
325
+ new S(Math.min(n.x, i.x), Math.min(n.y, i.y)),
326
+ new S(Math.max(n.x, i.x), Math.max(n.y, i.y))
327
+ ), o = this.targetObjects || this.scene.children, a = [], c = new De();
328
328
  c.multiplyMatrices(this.camera.projectionMatrix, this.camera.matrixWorldInverse);
329
329
  const l = (d) => {
330
330
  if (!d.visible) return;
331
- const p = new w();
332
- if (p.setFromMatrixPosition(d.matrixWorld), p.applyMatrix4(c), p.z > -1 && p.z < 1 && r.containsPoint(new C(p.x, p.y)) && o.push(d), this._deep)
331
+ const p = new v();
332
+ if (p.setFromMatrixPosition(d.matrixWorld), p.applyMatrix4(c), p.z > -1 && p.z < 1 && r.containsPoint(new S(p.x, p.y)) && a.push(d), this._deep)
333
333
  for (const u of d.children)
334
334
  l(u);
335
335
  };
336
- for (const d of a)
336
+ for (const d of o)
337
337
  l(d);
338
- return o;
338
+ return a;
339
339
  }
340
340
  dispose() {
341
341
  this.disableBoxSelection(), this._selected.clear();
342
342
  }
343
343
  }
344
- class ys {
344
+ function Z(h, e) {
345
+ const t = h;
346
+ if (t.setSceneInstanceVisible) {
347
+ t.setSceneInstanceVisible(e);
348
+ return;
349
+ }
350
+ if (t.setFacilityVisible) {
351
+ t.setFacilityVisible(e);
352
+ return;
353
+ }
354
+ h.visible = e, t.markSceneInstanceRenderDirty?.(), t.markFacilityRenderDirty?.();
355
+ }
356
+ class bs {
345
357
  idMap = /* @__PURE__ */ new Map();
346
358
  nameMap = /* @__PURE__ */ new Map();
347
359
  typeMap = /* @__PURE__ */ new Map();
@@ -448,34 +460,46 @@ class ys {
448
460
  */
449
461
  show(e) {
450
462
  const t = this.idMap.get(e);
451
- t && (t.visible = !0);
463
+ t && Z(t, !0);
452
464
  }
453
465
  /**
454
466
  * Hide an object by id.
455
467
  */
456
468
  hide(e) {
457
469
  const t = this.idMap.get(e);
458
- t && (t.visible = !1);
470
+ t && Z(t, !1);
459
471
  }
460
472
  /**
461
473
  * Show only the specified objects, hide all others.
462
474
  */
463
475
  isolate(e) {
464
476
  const t = new Set(e);
465
- for (const [s, n] of this.idMap)
466
- n.visible = t.has(s);
477
+ for (const s of this.allObjects) {
478
+ const n = this.objectIds.get(s) ?? /* @__PURE__ */ new Set();
479
+ Z(s, [...n].some((i) => t.has(i)));
480
+ }
467
481
  }
468
482
  /**
469
483
  * Set the opacity of an object's materials.
470
484
  */
471
485
  setOpacity(e, t) {
472
486
  const s = this.idMap.get(e);
473
- s && s.traverse((n) => {
474
- if (!n.isMesh) return;
475
- const i = n.material;
476
- if (!i) return;
477
- const r = Array.isArray(i) ? i : [i];
478
- for (const a of r)
487
+ if (!s) return;
488
+ const n = s;
489
+ if (n.setSceneInstanceOpacity) {
490
+ n.setSceneInstanceOpacity(t);
491
+ return;
492
+ }
493
+ if (n.setFacilityOpacity) {
494
+ n.setFacilityOpacity(t);
495
+ return;
496
+ }
497
+ s.traverse((i) => {
498
+ if (!i.isMesh) return;
499
+ const r = i.material;
500
+ if (!r) return;
501
+ const o = Array.isArray(r) ? r : [r];
502
+ for (const a of o)
479
503
  a.transparent = t < 1, a.opacity = t, a.needsUpdate = !0;
480
504
  });
481
505
  }
@@ -483,7 +507,7 @@ class ys {
483
507
  * Get the bounding box of an object by id, or all objects if no id provided.
484
508
  */
485
509
  getBoundingBox(e) {
486
- const t = new q();
510
+ const t = new X();
487
511
  if (e) {
488
512
  const s = this.idMap.get(e);
489
513
  s && t.setFromObject(s);
@@ -515,10 +539,10 @@ class ys {
515
539
  */
516
540
  showAll() {
517
541
  for (const e of this.allObjects)
518
- e.visible = !0;
542
+ Z(e, !0);
519
543
  }
520
544
  }
521
- class xn {
545
+ class _n {
522
546
  scenes = /* @__PURE__ */ new Map();
523
547
  _activeSceneKey = null;
524
548
  /**
@@ -531,7 +555,7 @@ class xn {
531
555
  * Create and register a new scene.
532
556
  */
533
557
  create(e, t = {}) {
534
- const s = new ze();
558
+ const s = new ke();
535
559
  return t.background !== void 0 && (s.background = new M(t.background)), this.scenes.set(e, s), s;
536
560
  }
537
561
  /**
@@ -592,7 +616,7 @@ class xn {
592
616
  return this.scenes.size;
593
617
  }
594
618
  }
595
- class Cn {
619
+ class En {
596
620
  scene;
597
621
  lights = /* @__PURE__ */ new Map();
598
622
  helpers = /* @__PURE__ */ new Map();
@@ -600,16 +624,16 @@ class Cn {
600
624
  this.scene = e;
601
625
  }
602
626
  addAmbient(e, t = {}) {
603
- const { color: s = 16777215, intensity: n = 0.5 } = t, i = new nt(s, n);
627
+ const { color: s = 16777215, intensity: n = 0.5 } = t, i = new ot(s, n);
604
628
  return i.name = e, this._register(e, i), i;
605
629
  }
606
630
  addDirectional(e, t = {}) {
607
- const { color: s = 16777215, intensity: n = 1, position: i = { x: 5, y: 10, z: 5 }, castShadow: r = !1, shadowMapSize: a = 1024 } = t, o = new me(s, n);
608
- return o.position.set(i.x, i.y, i.z), o.castShadow = r, r && o.shadow.mapSize.setScalar(a), o.name = e, this._register(e, o), o;
631
+ const { color: s = 16777215, intensity: n = 1, position: i = { x: 5, y: 10, z: 5 }, castShadow: r = !1, shadowMapSize: o = 1024 } = t, a = new ye(s, n);
632
+ return a.position.set(i.x, i.y, i.z), a.castShadow = r, r && a.shadow.mapSize.setScalar(o), a.name = e, this._register(e, a), a;
609
633
  }
610
634
  addPoint(e, t = {}) {
611
- const { color: s = 16777215, intensity: n = 1, distance: i = 0, decay: r = 2, position: a = { x: 0, y: 5, z: 0 }, castShadow: o = !1 } = t, c = new fe(s, n, i, r);
612
- return c.position.set(a.x, a.y, a.z), c.castShadow = o, c.name = e, this._register(e, c), c;
635
+ const { color: s = 16777215, intensity: n = 1, distance: i = 0, decay: r = 2, position: o = { x: 0, y: 5, z: 0 }, castShadow: a = !1 } = t, c = new we(s, n, i, r);
636
+ return c.position.set(o.x, o.y, o.z), c.castShadow = a, c.name = e, this._register(e, c), c;
613
637
  }
614
638
  addSpot(e, t = {}) {
615
639
  const {
@@ -617,16 +641,16 @@ class Cn {
617
641
  intensity: n = 1,
618
642
  distance: i = 0,
619
643
  angle: r = Math.PI / 6,
620
- penumbra: a = 0.1,
621
- decay: o = 2,
644
+ penumbra: o = 0.1,
645
+ decay: a = 2,
622
646
  position: c = { x: 0, y: 10, z: 0 },
623
647
  target: l,
624
648
  castShadow: d = !1
625
- } = t, p = new ge(s, n, i, r, a, o);
649
+ } = t, p = new ve(s, n, i, r, o, a);
626
650
  return p.position.set(c.x, c.y, c.z), l && p.target.position.set(l.x, l.y, l.z), p.castShadow = d, p.name = e, this._register(e, p), p;
627
651
  }
628
652
  addHemisphere(e, t = {}) {
629
- const { skyColor: s = 8900331, groundColor: n = 3549447, intensity: i = 0.6 } = t, r = new ye(s, n, i);
653
+ const { skyColor: s = 8900331, groundColor: n = 3549447, intensity: i = 0.6 } = t, r = new be(s, n, i);
630
654
  return r.name = e, this._register(e, r), r;
631
655
  }
632
656
  /**
@@ -677,7 +701,7 @@ class Cn {
677
701
  const t = this.lights.get(e);
678
702
  if (!t) return;
679
703
  let s = null;
680
- t instanceof me ? s = new it(t, 1) : t instanceof fe ? s = new rt(t, 0.5) : t instanceof ge ? s = new at(t) : t instanceof ye && (s = new ot(t, 1)), s && (this.scene.add(s), this.helpers.set(e, s));
704
+ t instanceof ye ? s = new at(t, 1) : t instanceof we ? s = new ct(t, 0.5) : t instanceof ve ? s = new ht(t) : t instanceof be && (s = new lt(t, 1)), s && (this.scene.add(s), this.helpers.set(e, s));
681
705
  }
682
706
  /**
683
707
  * Hide (remove) the helper for a light.
@@ -708,7 +732,7 @@ class Cn {
708
732
  this.removeAll(), this.hideAllHelpers();
709
733
  }
710
734
  }
711
- class ws extends ct {
735
+ class xs extends dt {
712
736
  scene;
713
737
  camera;
714
738
  scenePass;
@@ -718,8 +742,8 @@ class ws extends ct {
718
742
  #s = !1;
719
743
  #r = { strength: 1, radius: 0, threshold: 0 };
720
744
  #n = null;
721
- #a = !1;
722
- #o = {
745
+ #o = !1;
746
+ #a = {
723
747
  sliceCount: 1,
724
748
  stepCount: 12,
725
749
  aoIntensity: 1,
@@ -737,7 +761,7 @@ class ws extends ct {
737
761
  #f = !0;
738
762
  constructor(...e) {
739
763
  const [t, s, n] = e;
740
- super(t), this.scene = s, this.camera = n, this.scenePass = pe(s, n), this.needsUpdateOutputNode = !0, this.#t = /* @__PURE__ */ new Set(), this.#e = [], this.#d = /* @__PURE__ */ new Set(), this.#c = /* @__PURE__ */ new Map(), this.#g();
764
+ super(t), this.scene = s, this.camera = n, this.scenePass = fe(s, n), this.needsUpdateOutputNode = !0, this.#t = /* @__PURE__ */ new Set(), this.#e = [], this.#d = /* @__PURE__ */ new Set(), this.#c = /* @__PURE__ */ new Map(), this.#g();
741
765
  }
742
766
  /** @deprecated Use `scenePass` instead */
743
767
  get currentOutputNode() {
@@ -785,13 +809,13 @@ class ws extends ct {
785
809
  Object.assign(this.#r, e), this.#s && (this.needsUpdateOutputNode = !0);
786
810
  }
787
811
  enableSSGI(e) {
788
- e && Object.assign(this.#o, e), this.#a = !0, this.#i();
812
+ e && Object.assign(this.#a, e), this.#o = !0, this.#i();
789
813
  }
790
814
  disableSSGI() {
791
- this.#a = !1, this.#p = null, this.#i();
815
+ this.#o = !1, this.#p = null, this.#i();
792
816
  }
793
817
  updateSSGI(e) {
794
- if (Object.assign(this.#o, e), this.#p) {
818
+ if (Object.assign(this.#a, e), this.#p) {
795
819
  const t = this.#p;
796
820
  e.sliceCount !== void 0 && (t.sliceCount.value = e.sliceCount), e.stepCount !== void 0 && (t.stepCount.value = e.stepCount), e.aoIntensity !== void 0 && (t.aoIntensity.value = e.aoIntensity), e.giIntensity !== void 0 && (t.giIntensity.value = e.giIntensity), e.radius !== void 0 && (t.radius.value = e.radius), e.thickness !== void 0 && (t.thickness.value = e.thickness);
797
821
  }
@@ -804,14 +828,14 @@ class ws extends ct {
804
828
  }
805
829
  #i() {
806
830
  const e = this.scenePass;
807
- this.scenePass = pe(this.scene, this.camera), this.#g(), this.needsUpdateOutputNode = !0, e.dispose();
831
+ this.scenePass = fe(this.scene, this.camera), this.#g(), this.needsUpdateOutputNode = !0, e.dispose();
808
832
  }
809
833
  #g() {
810
- if (this.#s || this.#a || this.#h || this.#c.size > 0) {
811
- const t = { output: $t };
834
+ if (this.#s || this.#o || this.#h || this.#c.size > 0) {
835
+ const t = { output: Qt };
812
836
  this.#c.forEach((s, n) => {
813
837
  n !== "output" && (t[n] = s);
814
- }), this.#s && (t.emissive = Kt), this.#a && (t.normal = Qt), this.#h && (t.velocity = qt), this.scenePass.setMRT(Gt(t));
838
+ }), this.#s && (t.emissive = Xt), this.#o && (t.normal = Yt), this.#h && (t.velocity = Vt), this.scenePass.setMRT(Kt(t));
815
839
  }
816
840
  }
817
841
  #y() {
@@ -821,21 +845,21 @@ class ws extends ct {
821
845
  }
822
846
  #w() {
823
847
  let e = this.scenePass.getTextureNode();
824
- if (this.#a)
825
- if (!(this.camera instanceof V))
848
+ if (this.#o)
849
+ if (!(this.camera instanceof te))
826
850
  console.warn("RenderPipeline: SSGI requires a PerspectiveCamera, skipping.");
827
851
  else {
828
- const t = this.scenePass.getTextureNode(), s = this.scenePass.getTextureNode("depth"), n = this.scenePass.getTextureNode("normal"), i = Vt(t, s, n, this.camera);
829
- i.sliceCount.value = this.#o.sliceCount, i.stepCount.value = this.#o.stepCount, i.aoIntensity.value = this.#o.aoIntensity, i.giIntensity.value = this.#o.giIntensity, i.radius.value = this.#o.radius, i.thickness.value = this.#o.thickness, this.#p = i, e = xe(e, i), this.#e.push(i);
852
+ const t = this.scenePass.getTextureNode(), s = this.scenePass.getTextureNode("depth"), n = this.scenePass.getTextureNode("normal"), i = ts(t, s, n, this.camera);
853
+ i.sliceCount.value = this.#a.sliceCount, i.stepCount.value = this.#a.stepCount, i.aoIntensity.value = this.#a.aoIntensity, i.giIntensity.value = this.#a.giIntensity, i.radius.value = this.#a.radius, i.thickness.value = this.#a.thickness, this.#p = i, e = Me(e, i), this.#e.push(i);
830
854
  }
831
855
  if (this.#s) {
832
856
  const t = this.scenePass.getTextureNode("emissive");
833
- this.#n = Jt(
857
+ this.#n = es(
834
858
  t,
835
859
  this.#r.strength,
836
860
  this.#r.radius,
837
861
  this.#r.threshold
838
- ), e = xe(e, this.#n), this.#e.push(this.#n);
862
+ ), e = Me(e, this.#n), this.#e.push(this.#n);
839
863
  }
840
864
  return e;
841
865
  }
@@ -846,15 +870,15 @@ class ws extends ct {
846
870
  this.#y();
847
871
  let e, t = !1, s = !1;
848
872
  const n = this.#u !== null;
849
- if (n ? e = this.#u(this.scenePass) : this.#s || this.#a ? e = this.#w() : e = this.#d.size > 0 ? this.scenePass.getTextureNode() : this.scenePass, n || this.#d.forEach((i) => {
873
+ if (n ? e = this.#u(this.scenePass) : this.#s || this.#o ? e = this.#w() : e = this.#d.size > 0 ? this.scenePass.getTextureNode() : this.scenePass, n || this.#d.forEach((i) => {
850
874
  t ||= i.includesTemporalAntialias === !0, s ||= i.includesOutputTransform === !0, e = i(this.scenePass, e);
851
875
  }), this.#v(s), this.#h && !t) {
852
876
  const i = this.scenePass.getTextureNode("depth"), r = this.scenePass.getTextureNode("velocity");
853
- this.#l = Zt(e, i, r, this.camera), this.#e.push(this.#l), e = this.#l;
877
+ this.#l = ss(e, i, r, this.camera), this.#e.push(this.#l), e = this.#l;
854
878
  } else
855
879
  this.#l = null;
856
880
  this.#t.size > 0 && this.#t.forEach((i) => {
857
- const r = Wt(e, i);
881
+ const r = qt(e, i);
858
882
  this.#e.push(r), e = r;
859
883
  }), this.outputNode = e, this.needsUpdate = !0;
860
884
  }
@@ -865,19 +889,19 @@ class ws extends ct {
865
889
  this.#y(), this.scenePass.dispose(), super.dispose();
866
890
  }
867
891
  }
868
- const vs = {
869
- Vector2: C,
870
- Vector3: w,
871
- Vector4: lt,
872
- Quaternion: ht,
873
- Matrix4: Ie,
874
- Spherical: S,
875
- Box3: q,
876
- Sphere: Ne,
877
- Raycaster: Le
892
+ const Cs = {
893
+ Vector2: S,
894
+ Vector3: v,
895
+ Vector4: ut,
896
+ Quaternion: pt,
897
+ Matrix4: De,
898
+ Spherical: T,
899
+ Box3: X,
900
+ Sphere: je,
901
+ Raycaster: ze
878
902
  };
879
- Fe.install({ THREE: vs });
880
- class bs extends Fe {
903
+ We.install({ THREE: Cs });
904
+ class Ss extends We {
881
905
  constructor(...e) {
882
906
  super(...e), this.minDistance = 0.2, this.smoothTime = 0.2, this.dollySpeed = 0.2;
883
907
  }
@@ -885,16 +909,16 @@ class bs extends Fe {
885
909
  * Set absolute angle for azimuth to avoid spinning
886
910
  */
887
911
  absoluteRotations() {
888
- this.azimuthAngle = xs(this.azimuthAngle, 0);
912
+ this.azimuthAngle = Ms(this.azimuthAngle, 0);
889
913
  }
890
914
  async flyToBox(e, t = {}) {
891
915
  if (e.isEmpty())
892
916
  return console.warn("CameraControls.flyToBox: The provided Box3 is empty."), !1;
893
917
  this.absoluteRotations();
894
- const { viewpoint: s = "frontTop", enableTransition: n = !0, padding: i = 0.1, cover: r = !1 } = t, a = [];
918
+ const { viewpoint: s = "frontTop", enableTransition: n = !0, padding: i = 0.1, cover: r = !1 } = t, o = [];
895
919
  if (s !== "current") {
896
- const o = _e[s.toUpperCase()] ?? _e.FRONTTOP, c = o.theta, l = o.phi;
897
- a.push(
920
+ const a = Oe[s.toUpperCase()] ?? Oe.FRONTTOP, c = a.theta, l = a.phi;
921
+ o.push(
898
922
  this.fitToBox(e, n, {
899
923
  paddingLeft: i,
900
924
  paddingRight: i,
@@ -902,15 +926,15 @@ class bs extends Fe {
902
926
  paddingBottom: i,
903
927
  cover: r
904
928
  })
905
- ), a.push(this.rotateTo(c, l, n));
929
+ ), o.push(this.rotateTo(c, l, n));
906
930
  } else {
907
- const o = new Ne();
908
- e.getBoundingSphere(o), o.radius += i, a.push(this.fitToSphere(o, n));
931
+ const a = new je();
932
+ e.getBoundingSphere(a), a.radius += i, o.push(this.fitToSphere(a, n));
909
933
  }
910
- return await Promise.all(a), !0;
934
+ return await Promise.all(o), !0;
911
935
  }
912
936
  async flyToObject(e, t = {}) {
913
- const s = new q().setFromObject(e);
937
+ const s = new X().setFromObject(e);
914
938
  return this.flyToBox(s, t);
915
939
  }
916
940
  /**
@@ -924,7 +948,7 @@ class bs extends Fe {
924
948
  * Get the current camera viewpoint data (position, target, zoom).
925
949
  */
926
950
  getCameraViewpoint() {
927
- const e = new w(), t = new w();
951
+ const e = new v(), t = new v();
928
952
  return this.getPosition(e), this.getTarget(t), {
929
953
  position: { x: e.x, y: e.y, z: e.z },
930
954
  target: { x: t.x, y: t.y, z: t.z },
@@ -948,7 +972,7 @@ class bs extends Fe {
948
972
  */
949
973
  async setViewMode(e, t = !0) {
950
974
  if (e === "2d") {
951
- const s = new w();
975
+ const s = new v();
952
976
  this.getTarget(s), await this.rotateTo(0, 0, t), this.minPolarAngle = 0, this.maxPolarAngle = 0;
953
977
  } else
954
978
  this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, await this.rotateTo(0, Math.PI / 4, t);
@@ -961,33 +985,33 @@ class bs extends Fe {
961
985
  ]);
962
986
  }
963
987
  }
964
- const _e = {
965
- LEFT: new S(0, Math.PI / 2, -Math.PI / 2),
966
- RIGHT: new S(0, Math.PI / 2, Math.PI / 2),
967
- FRONT: new S(0, Math.PI / 2, 0),
968
- BACK: new S(0, Math.PI / 2, Math.PI),
969
- TOP: new S(0, 0, 0),
970
- BOTTOM: new S(0, Math.PI, 0),
971
- FRONTTOP: new S(0, Math.PI / 4, 0),
972
- BACKTOP: new S(0, Math.PI / 4, Math.PI),
973
- LEFTTOP: new S(0, Math.PI / 4, -Math.PI / 2),
974
- RIGHTTOP: new S(0, Math.PI / 4, Math.PI / 2),
975
- LEFTFRONTTOP: new S(0, Math.PI / 4, -Math.PI / 4),
976
- RIGHTFRONTTOP: new S(0, Math.PI / 4, Math.PI / 4),
977
- LEFTBACKTOP: new S(0, Math.PI / 4, -Math.PI / 4 * 3),
978
- RIGHTBACKTOP: new S(0, Math.PI / 4, Math.PI / 4 * 3)
988
+ const Oe = {
989
+ LEFT: new T(0, Math.PI / 2, -Math.PI / 2),
990
+ RIGHT: new T(0, Math.PI / 2, Math.PI / 2),
991
+ FRONT: new T(0, Math.PI / 2, 0),
992
+ BACK: new T(0, Math.PI / 2, Math.PI),
993
+ TOP: new T(0, 0, 0),
994
+ BOTTOM: new T(0, Math.PI, 0),
995
+ FRONTTOP: new T(0, Math.PI / 4, 0),
996
+ BACKTOP: new T(0, Math.PI / 4, Math.PI),
997
+ LEFTTOP: new T(0, Math.PI / 4, -Math.PI / 2),
998
+ RIGHTTOP: new T(0, Math.PI / 4, Math.PI / 2),
999
+ LEFTFRONTTOP: new T(0, Math.PI / 4, -Math.PI / 4),
1000
+ RIGHTFRONTTOP: new T(0, Math.PI / 4, Math.PI / 4),
1001
+ LEFTBACKTOP: new T(0, Math.PI / 4, -Math.PI / 4 * 3),
1002
+ RIGHTBACKTOP: new T(0, Math.PI / 4, Math.PI / 4 * 3)
979
1003
  };
980
- function xs(h, e) {
1004
+ function Ms(h, e) {
981
1005
  const t = h - e;
982
- return dt.euclideanModulo(t + Math.PI, Math.PI * 2) - Math.PI;
1006
+ return mt.euclideanModulo(t + Math.PI, Math.PI * 2) - Math.PI;
983
1007
  }
984
- class Cs {
985
- environment = new es();
1008
+ class Ts {
1009
+ environment = new ns();
986
1010
  renderer;
987
1011
  pmremGenerator;
988
1012
  envMap = null;
989
1013
  constructor(e) {
990
- this.renderer = e, this.pmremGenerator = new pt(e);
1014
+ this.renderer = e, this.pmremGenerator = new ft(e);
991
1015
  }
992
1016
  update() {
993
1017
  this.envMap || (this.envMap = this.pmremGenerator.fromScene(this.environment).texture);
@@ -996,20 +1020,20 @@ class Cs {
996
1020
  this.pmremGenerator.dispose(), this.envMap?.dispose();
997
1021
  }
998
1022
  }
999
- const J = 128;
1000
- class Ss extends ts {
1023
+ const ee = 128;
1024
+ class _s extends is {
1001
1025
  viewer;
1002
1026
  overlayPass;
1003
1027
  constructor(e) {
1004
1028
  super(e.camera, e.el), this.viewer = e;
1005
- const t = new Z(-2, 2, 2, -2, 0, 4);
1006
- t.position.set(0, 0, 2), this.overlayPass = pe(this, t), this.setLabels("x", "y", "z");
1029
+ const t = new se(-2, 2, 2, -2, 0, 4);
1030
+ t.position.set(0, 0, 2), this.overlayPass = fe(this, t), this.setLabels("x", "y", "z");
1007
1031
  }
1008
1032
  _update = () => {
1009
1033
  this.quaternion.copy(this.viewer.camera.quaternion).invert();
1010
1034
  const e = this.location;
1011
1035
  let t, s;
1012
- e.left !== null ? t = e.left : t = this.viewer.el.offsetWidth - J - e.right, e.top !== null ? s = e.top : s = this.viewer.el.offsetHeight - J - e.bottom, this.overlayPass.setViewport(t, s, J, J);
1036
+ e.left !== null ? t = e.left : t = this.viewer.el.offsetWidth - ee - e.right, e.top !== null ? s = e.top : s = this.viewer.el.offsetHeight - ee - e.bottom, this.overlayPass.setViewport(t, s, ee, ee);
1013
1037
  };
1014
1038
  enable() {
1015
1039
  return this.viewer.renderPipeline.addOverlayPass(this.overlayPass), this.viewer.addEventListener("beforeRender", this._update), this.viewer.render(), this;
@@ -1018,8 +1042,8 @@ class Ss extends ts {
1018
1042
  return this.viewer.renderPipeline.removeOverlayPass(this.overlayPass), this.viewer.removeEventListener("beforeRender", this._update), this.viewer.render(), this;
1019
1043
  }
1020
1044
  }
1021
- const $e = "position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;overflow:hidden;", Ms = $e + "z-index:0;", Ts = $e + "z-index:1;";
1022
- class _s {
1045
+ const Qe = "position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;overflow:hidden;", Es = Qe + "z-index:0;", Ps = Qe + "z-index:1;";
1046
+ class Os {
1023
1047
  el;
1024
1048
  css2dRenderer = null;
1025
1049
  css3dRenderer = null;
@@ -1027,21 +1051,21 @@ class _s {
1027
1051
  this.el = e, getComputedStyle(e).position === "static" && (e.style.position = "relative");
1028
1052
  }
1029
1053
  initCSS2DRenderer() {
1030
- const e = new ss();
1031
- return e.setSize(this.el.clientWidth, this.el.clientHeight), e.domElement.style.cssText = Ts, this.el.appendChild(e.domElement), this.css2dRenderer = e, e;
1054
+ const e = new rs();
1055
+ return e.setSize(this.el.clientWidth, this.el.clientHeight), e.domElement.style.cssText = Ps, this.el.appendChild(e.domElement), this.css2dRenderer = e, e;
1032
1056
  }
1033
1057
  initCSS3DRenderer() {
1034
- const e = new is();
1035
- return e.setSize(this.el.clientWidth, this.el.clientHeight), e.domElement.style.cssText = Ms, this.el.appendChild(e.domElement), this.css3dRenderer = e, e;
1058
+ const e = new as();
1059
+ return e.setSize(this.el.clientWidth, this.el.clientHeight), e.domElement.style.cssText = Es, this.el.appendChild(e.domElement), this.css3dRenderer = e, e;
1036
1060
  }
1037
1061
  createCSS2DObject(e) {
1038
- return this.css2dRenderer || this.initCSS2DRenderer(), new ns(e);
1062
+ return this.css2dRenderer || this.initCSS2DRenderer(), new os(e);
1039
1063
  }
1040
1064
  createCSS25DObject(e) {
1041
- return this.css3dRenderer || this.initCSS3DRenderer(), new rs(e);
1065
+ return this.css3dRenderer || this.initCSS3DRenderer(), new cs(e);
1042
1066
  }
1043
1067
  createCSS3DObject(e) {
1044
- return this.css3dRenderer || this.initCSS3DRenderer(), new as(e);
1068
+ return this.css3dRenderer || this.initCSS3DRenderer(), new hs(e);
1045
1069
  }
1046
1070
  render(e, t) {
1047
1071
  this.css2dRenderer && this.css2dRenderer.render(e, t), this.css3dRenderer && this.css3dRenderer.render(e, t);
@@ -1053,8 +1077,8 @@ class _s {
1053
1077
  this.css2dRenderer && (this.el.removeChild(this.css2dRenderer.domElement), this.css2dRenderer = null), this.css3dRenderer && (this.el.removeChild(this.css3dRenderer.domElement), this.css3dRenderer = null);
1054
1078
  }
1055
1079
  }
1056
- const Es = "timestamp-query";
1057
- class Ps {
1080
+ const As = "timestamp-query";
1081
+ class Is {
1058
1082
  el;
1059
1083
  renderer;
1060
1084
  container;
@@ -1070,9 +1094,9 @@ class Ps {
1070
1094
  this.el = e, this.renderer = t;
1071
1095
  const s = document.createElement("div");
1072
1096
  s.style.position = "absolute", s.style.left = "12px", s.style.bottom = "12px", s.style.fontSize = "12px", s.style.color = "#fff", s.style.pointerEvents = "none", this.container = s;
1073
- function n(r, a = !0) {
1074
- const o = document.createElement("span");
1075
- return a && (o.style.marginLeft = "6px"), o.innerText = r, o;
1097
+ function n(r, o = !0) {
1098
+ const a = document.createElement("span");
1099
+ return o && (a.style.marginLeft = "6px"), a.innerText = r, a;
1076
1100
  }
1077
1101
  function i() {
1078
1102
  return document.createElement("br");
@@ -1086,16 +1110,16 @@ class Ps {
1086
1110
  this.timestampText.innerText = "0";
1087
1111
  return;
1088
1112
  }
1089
- this.#n(Y.RENDER).then((t) => {
1113
+ this.#n(J.RENDER).then((t) => {
1090
1114
  this._enabled && (this.timestampText.innerText = t?.toFixed(2) ?? "0");
1091
- }), this.#n(Y.COMPUTE);
1115
+ }), this.#n(J.COMPUTE);
1092
1116
  }
1093
1117
  }
1094
1118
  enable() {
1095
1119
  this._enabled = !0, this.#r(!0), this.el.appendChild(this.container);
1096
1120
  }
1097
1121
  disable() {
1098
- this._enabled = !1, this.#r(!1), this.#a(), this.container.remove();
1122
+ this._enabled = !1, this.#r(!1), this.#o(), this.container.remove();
1099
1123
  }
1100
1124
  dispose() {
1101
1125
  this.disable();
@@ -1105,7 +1129,7 @@ class Ps {
1105
1129
  }
1106
1130
  #s() {
1107
1131
  try {
1108
- return this.renderer.hasFeature(Es);
1132
+ return this.renderer.hasFeature(As);
1109
1133
  } catch {
1110
1134
  return !0;
1111
1135
  }
@@ -1123,12 +1147,12 @@ class Ps {
1123
1147
  return t?.resolveQueriesAsync ? Promise.resolve(t.resolveQueriesAsync()).catch(() => {
1124
1148
  }) : Promise.resolve(void 0);
1125
1149
  }
1126
- #a() {
1127
- this.#n(Y.RENDER), this.#n(Y.COMPUTE);
1150
+ #o() {
1151
+ this.#n(J.RENDER), this.#n(J.COMPUTE);
1128
1152
  }
1129
1153
  }
1130
- ut.enabled = !0;
1131
- class Sn extends Re {
1154
+ gt.enabled = !0;
1155
+ class Pn extends Ne {
1132
1156
  el;
1133
1157
  renderer;
1134
1158
  scene;
@@ -1145,11 +1169,11 @@ class Sn extends Re {
1145
1169
  frameCount = 1;
1146
1170
  frameloop = "demand";
1147
1171
  constructor({ el: e, rendererOptions: t }) {
1148
- super(), this.el = e, this.renderer = this._initRenderer(t), this.scene = this.createScene(), this.camera = this.createPerspectiveCamera(), this.info = new Ps(this.el, this.renderer), this.controls = new bs(this.camera, this.renderer.domElement), this.renderPipeline = new ws(this.renderer, this.scene, this.camera), this.timer = new mt(), this.roomEnvironment = new Cs(this.renderer), this.interactionManager = new gs(this.renderer.domElement, this.scene, this.camera), this.objectManager = new ys(), this.viewerHelper = new Ss(this), this.cssRenderer = new _s(this.el), window.addEventListener("resize", this.onWindowResize);
1172
+ super(), this.el = e, this.renderer = this._initRenderer(t), this.scene = this.createScene(), this.camera = this.createPerspectiveCamera(), this.info = new Is(this.el, this.renderer), this.controls = new Ss(this.camera, this.renderer.domElement), this.renderPipeline = new xs(this.renderer, this.scene, this.camera), this.timer = new yt(), this.roomEnvironment = new Ts(this.renderer), this.interactionManager = new vs(this.renderer.domElement, this.scene, this.camera), this.objectManager = new bs(), this.viewerHelper = new _s(this), this.cssRenderer = new Os(this.el), window.addEventListener("resize", this.onWindowResize);
1149
1173
  }
1150
1174
  onWindowResize = () => {
1151
1175
  const e = this.el.clientWidth, t = this.el.clientHeight;
1152
- this.camera instanceof V ? (this.camera.aspect = e / t, this.camera.updateProjectionMatrix()) : this.camera instanceof Z && (this.camera.left = -e / 2, this.camera.right = e / 2, this.camera.top = t / 2, this.camera.bottom = -t / 2, this.camera.updateProjectionMatrix()), this.renderer.setSize(e, t), this.cssRenderer.resize(e, t), this.render();
1176
+ this.camera instanceof te ? (this.camera.aspect = e / t, this.camera.updateProjectionMatrix()) : this.camera instanceof se && (this.camera.left = -e / 2, this.camera.right = e / 2, this.camera.top = t / 2, this.camera.bottom = -t / 2, this.camera.updateProjectionMatrix()), this.renderer.setSize(e, t), this.cssRenderer.resize(e, t), this.render();
1153
1177
  };
1154
1178
  async init() {
1155
1179
  await this.renderer.init(), this.roomEnvironment.update(), this.scene.environment = this.roomEnvironment.envMap;
@@ -1158,7 +1182,7 @@ class Sn extends Re {
1158
1182
  this.camera = e, this.controls.camera = e, this.interactionManager.setCamera(e), this.renderPipeline.setCamera(e), this.onWindowResize(), this.dispatchEvent({ type: "cameraChange", camera: e });
1159
1183
  }
1160
1184
  setCameraByType(e) {
1161
- e === "perspective" && !(this.camera instanceof V) ? this.setCamera(this.createPerspectiveCamera()) : e === "orthographic" && !(this.camera instanceof Z) && this.setCamera(this.createOrthographicCamera());
1185
+ e === "perspective" && !(this.camera instanceof te) ? this.setCamera(this.createPerspectiveCamera()) : e === "orthographic" && !(this.camera instanceof se) && this.setCamera(this.createOrthographicCamera());
1162
1186
  }
1163
1187
  render(e = 1) {
1164
1188
  return this.frameCount += e, new Promise((t) => {
@@ -1176,25 +1200,25 @@ class Sn extends Re {
1176
1200
  this.dispatchEvent({ type: "afterControlsUpdate", time: e, delta: t }), this.frameCount > 0 && (this.frameCount--, s = !0), this.frameloop === "always" && (s = !0), s && (this.dispatchEvent({ type: "beforeRender", time: e, delta: t }), this.renderer.info.reset(), this.renderPipeline.render(), this.cssRenderer.render(this.scene, this.camera), this.info.update(), this.dispatchEvent({ type: "afterRender", time: e, delta: t }));
1177
1201
  };
1178
1202
  _initRenderer(e) {
1179
- const t = new ft({
1180
- logarithmicDepthBuffer: !0,
1203
+ const t = new wt({
1204
+ reversedDepthBuffer: !0,
1181
1205
  antialias: !1,
1182
1206
  depth: !1,
1183
1207
  trackTimestamp: !1,
1184
1208
  ...e
1185
1209
  });
1186
- return t.setSize(this.el.clientWidth, this.el.clientHeight), t.shadowMap.enabled = !0, t.shadowMap.type = gt, t.toneMapping = yt, t.toneMappingExposure = 1, t.info.autoReset = !1, t.setPixelRatio(Math.min(window.devicePixelRatio, 1.5)), t.setAnimationLoop(this.animate), this.el.appendChild(t.domElement), t;
1210
+ return t.setSize(this.el.clientWidth, this.el.clientHeight), t.shadowMap.enabled = !0, t.shadowMap.type = vt, t.toneMapping = bt, t.toneMappingExposure = 1, t.info.autoReset = !1, t.setPixelRatio(Math.min(window.devicePixelRatio, 1.5)), t.setAnimationLoop(this.animate), this.el.appendChild(t.domElement), t;
1187
1211
  }
1188
1212
  createScene() {
1189
- const e = new ze();
1213
+ const e = new ke();
1190
1214
  return e.background = new M(0), e;
1191
1215
  }
1192
1216
  createPerspectiveCamera() {
1193
- const e = new V(50, this.el.clientWidth / this.el.clientHeight, 0.1, 1e5);
1217
+ const e = new te(50, this.el.clientWidth / this.el.clientHeight, 0.1, 1e5);
1194
1218
  return e.position.setScalar(5), e;
1195
1219
  }
1196
1220
  createOrthographicCamera() {
1197
- const e = new Z(
1221
+ const e = new se(
1198
1222
  -this.el.clientWidth / 2,
1199
1223
  this.el.clientWidth / 2,
1200
1224
  this.el.clientHeight / 2,
@@ -1216,8 +1240,8 @@ class Sn extends Re {
1216
1240
  async screenshot(e = {}) {
1217
1241
  const { type: t = "image/png", quality: s = 1 } = e, n = this.el.clientWidth, i = this.el.clientHeight, r = e.width && e.height;
1218
1242
  r && this.renderer.setSize(e.width, e.height), await this.render();
1219
- const a = this.renderer.domElement.toDataURL(t, s);
1220
- return r && (this.renderer.setSize(n, i), this.onWindowResize()), a;
1243
+ const o = this.renderer.domElement.toDataURL(t, s);
1244
+ return r && (this.renderer.setSize(n, i), this.onWindowResize()), o;
1221
1245
  }
1222
1246
  /**
1223
1247
  * Set the scene background color, texture, or null.
@@ -1248,14 +1272,14 @@ class Sn extends Re {
1248
1272
  */
1249
1273
  enableFog(e = {}) {
1250
1274
  const { color: t = 13421772, near: s = 10, far: n = 100 } = e;
1251
- this.scene.fog = new wt(t, s, n), this.render();
1275
+ this.scene.fog = new xt(t, s, n), this.render();
1252
1276
  }
1253
1277
  /**
1254
1278
  * Enable exponential fog.
1255
1279
  */
1256
1280
  enableFogExp2(e = {}) {
1257
1281
  const { color: t = 13421772, density: s = 0.01 } = e;
1258
- this.scene.fog = new vt(t, s), this.render();
1282
+ this.scene.fog = new Ct(t, s), this.render();
1259
1283
  }
1260
1284
  /**
1261
1285
  * Disable fog.
@@ -1267,22 +1291,22 @@ class Sn extends Re {
1267
1291
  this.el.removeChild(this.renderer.domElement), window.removeEventListener("resize", this.onWindowResize), this.info.dispose(), this.interactionManager.dispose(), this.roomEnvironment.dispose(), this.cssRenderer.dispose(), this.renderPipeline.dispose(), this.renderer.dispose();
1268
1292
  }
1269
1293
  }
1270
- class Os extends Ge {
1294
+ class Bs extends Ke {
1271
1295
  constructor(e) {
1272
1296
  super(e);
1273
1297
  }
1274
1298
  parse(e, t, s, n) {
1275
- if (As(e.slice(0, 8)) === "SBMG----") {
1276
- const r = Bs(e.slice(8));
1299
+ if (Rs(e.slice(0, 8)) === "SBMG----") {
1300
+ const r = Ls(e.slice(8));
1277
1301
  return super.parse(r, t, s, n);
1278
1302
  } else
1279
1303
  return super.parse(e, t, s, n);
1280
1304
  }
1281
1305
  }
1282
- function As(h) {
1306
+ function Rs(h) {
1283
1307
  return new TextDecoder().decode(new Uint8Array(h));
1284
1308
  }
1285
- function Bs(h) {
1309
+ function Ls(h) {
1286
1310
  const e = new DataView(h);
1287
1311
  for (let t = 0; t < e.byteLength; t++) {
1288
1312
  const s = e.getUint8(t), n = (s >> 4 & 15) + (s << 4 & 240);
@@ -1290,72 +1314,72 @@ function Bs(h) {
1290
1314
  }
1291
1315
  return e.buffer;
1292
1316
  }
1293
- const Ls = 8, Rs = 130, Ee = 66, Is = "SBK-----", zs = "SBM-----", We = new TextDecoder(), Ns = new TextEncoder();
1294
- function js(h) {
1295
- let e = Ls;
1317
+ const zs = 8, Ns = 130, Ae = 66, Ds = "SBK-----", ks = "SBM-----", qe = new TextDecoder(), js = new TextEncoder();
1318
+ function Us(h) {
1319
+ let e = zs;
1296
1320
  const t = new Uint8Array(h, 0, e);
1297
- if (We.decode(t) !== Is)
1321
+ if (qe.decode(t) !== Ds)
1298
1322
  return h;
1299
- e += Rs;
1323
+ e += Ns;
1300
1324
  const n = new Uint8Array(h, 0, e);
1301
1325
  if (n[40] === 1) {
1302
- const r = Ns.encode(zs), a = new Uint8Array([n[41]]), o = Ds(n), c = ks(o);
1303
- let l = Ee % c.length;
1304
- const d = e + Ee, p = new Uint8Array(h, d), u = new Uint8Array(p.length);
1305
- for (let v = 0; v < p.length; v++)
1306
- u[v] = p[v] ^ c[l], l = (l + 1) % c.length;
1307
- const f = new Uint8Array(r.length + a.length + u.length);
1308
- return f.set(r), f.set(a, r.length), f.set(u, r.length + a.length), f.buffer;
1326
+ const r = js.encode(ks), o = new Uint8Array([n[41]]), a = Hs(n), c = Fs(a);
1327
+ let l = Ae % c.length;
1328
+ const d = e + Ae, p = new Uint8Array(h, d), u = new Uint8Array(p.length);
1329
+ for (let w = 0; w < p.length; w++)
1330
+ u[w] = p[w] ^ c[l], l = (l + 1) % c.length;
1331
+ const m = new Uint8Array(r.length + o.length + u.length);
1332
+ return m.set(r), m.set(o, r.length), m.set(u, r.length + o.length), m.buffer;
1309
1333
  }
1310
1334
  }
1311
- function Ds(h) {
1335
+ function Hs(h) {
1312
1336
  const e = new Uint8Array(128);
1313
1337
  return e.set(h.slice(42, 74), 0), e.set(h.slice(74, 138), 32), e.set(h.slice(8, 40), 96), e;
1314
1338
  }
1315
- function ks(h) {
1339
+ function Fs(h) {
1316
1340
  const e = new Uint8Array(64);
1317
1341
  return e.set(h.slice(0, 8), 0), e.set(h.slice(24, 32), 8), e.set(h.slice(40, 56), 16), e.set(h.slice(64, 88), 32), e.set(h.slice(96, 104), 56), e;
1318
1342
  }
1319
- const Us = (h, e, t) => {
1343
+ const Gs = (h, e, t) => {
1320
1344
  const s = h.buffer.slice(t, t + e);
1321
- let n = We.decode(s);
1345
+ let n = qe.decode(s);
1322
1346
  return n = n.replace("\\", "/"), n.startsWith("Maps/") || (n = `Maps/${n}`), n;
1323
- }, Hs = (h, e, t) => {
1324
- const [s, n, i, r, a] = e, o = t || r < 1;
1325
- return new I({
1347
+ }, $s = (h, e, t) => {
1348
+ const [s, n, i, r, o] = e, a = t || r < 1;
1349
+ return new L({
1326
1350
  name: h,
1327
1351
  color: new M(s, n, i),
1328
1352
  opacity: r,
1329
- transparent: o,
1353
+ transparent: a,
1330
1354
  alphaTest: 0.01,
1331
- side: a
1355
+ side: o
1332
1356
  });
1333
- }, Fs = (h) => h?.toLowerCase().endsWith(".png") ?? !1;
1334
- class Gs {
1357
+ }, Ws = (h) => h?.toLowerCase().endsWith(".png") ?? !1;
1358
+ class Ks {
1335
1359
  data;
1336
1360
  options;
1337
1361
  textureLoader;
1338
1362
  littleEndian = !0;
1339
1363
  materials = /* @__PURE__ */ new Map();
1340
1364
  constructor(e, t) {
1341
- this.data = e, this.options = t, this.textureLoader = new De(t.manager), this.textureLoader.setCrossOrigin(t.crossOrigin), this.textureLoader.setRequestHeader(t.requestHeader);
1365
+ this.data = e, this.options = t, this.textureLoader = new He(t.manager), this.textureLoader.setCrossOrigin(t.crossOrigin), this.textureLoader.setRequestHeader(t.requestHeader);
1342
1366
  }
1343
1367
  parse(e, t) {
1344
1368
  let s = this.data;
1345
- const n = js(this.data);
1369
+ const n = Us(this.data);
1346
1370
  n && (s = n);
1347
1371
  const i = new DataView(s);
1348
1372
  let r = 8;
1349
- const a = i.getUint8(r);
1350
- r += 1, a === 1 ? this._parseV2(i, r, e) : a === 2 ? this._parseV2(i, r, e) : a === 3 ? this._parseV3(i, r, e) : t?.(new Error(`SBMLoader: Unsupported SBM version: ${a}`));
1373
+ const o = i.getUint8(r);
1374
+ r += 1, o === 1 ? this._parseV2(i, r, e) : o === 2 ? this._parseV2(i, r, e) : o === 3 ? this._parseV3(i, r, e) : t?.(new Error(`SBMLoader: Unsupported SBM version: ${o}`));
1351
1375
  }
1352
1376
  _parseV2(e, t, s) {
1353
1377
  const n = new R(), i = e.getUint16(t, this.littleEndian);
1354
1378
  t += 2;
1355
1379
  const r = e.getUint16(t, this.littleEndian);
1356
1380
  t += 2;
1357
- for (let a = 0; a < i; ++a) {
1358
- const o = e.getUint16(t, this.littleEndian).toString();
1381
+ for (let o = 0; o < i; ++o) {
1382
+ const a = e.getUint16(t, this.littleEndian).toString();
1359
1383
  t += 2, t += 4, t += 4, t += 4, t += 4;
1360
1384
  const c = e.getFloat32(t, this.littleEndian);
1361
1385
  t += 4;
@@ -1366,36 +1390,36 @@ class Gs {
1366
1390
  const p = e.getFloat32(t, this.littleEndian);
1367
1391
  t += 4, t += 4, t += 4, t += 4, t += 4;
1368
1392
  let u = e.getUint8(t);
1369
- t += 1, u === 0 ? u = xt : u === 1 ? u = Ct : u === 2 && (u = St);
1370
- const f = e.getUint16(t, this.littleEndian);
1393
+ t += 1, u === 0 ? u = Mt : u === 1 ? u = Tt : u === 2 && (u = _t);
1394
+ const m = e.getUint16(t, this.littleEndian);
1371
1395
  t += 2;
1372
- const v = f > 0 ? Us(e, f, t) : "";
1373
- if (t += f, !this.materials.has(o)) {
1374
- const x = Hs(o, [c, l, d, p, u], Fs(v));
1375
- this.materials.set(o, x), v && this.options.path && this.textureLoader.load(L.resolveURL(v, this.options.path), (y) => {
1376
- y.colorSpace = ke, y.wrapS = we, y.wrapT = we, y.flipY = !1, y.anisotropy = 16, x.map = y;
1396
+ const w = m > 0 ? Gs(e, m, t) : "";
1397
+ if (t += m, !this.materials.has(a)) {
1398
+ const x = $s(a, [c, l, d, p, u], Ws(w));
1399
+ this.materials.set(a, x), w && this.options.path && this.textureLoader.load(B.resolveURL(w, this.options.path), (y) => {
1400
+ y.colorSpace = Fe, y.wrapS = xe, y.wrapT = xe, y.flipY = !1, y.anisotropy = 16, x.map = y;
1377
1401
  });
1378
1402
  }
1379
1403
  }
1380
- for (let a = 0; a < r; ++a) {
1381
- const o = e.getUint16(t, this.littleEndian).toString();
1404
+ for (let o = 0; o < r; ++o) {
1405
+ const a = e.getUint16(t, this.littleEndian).toString();
1382
1406
  t += 2;
1383
1407
  const c = e.getUint16(t, this.littleEndian).toString();
1384
1408
  t += 2;
1385
- const l = [], d = [], p = [], u = [], f = e.getUint16(t, this.littleEndian);
1386
- if (t += 2, f > 0)
1387
- for (let g = 0; g < f; g++) {
1388
- const b = new w();
1409
+ const l = [], d = [], p = [], u = [], m = e.getUint16(t, this.littleEndian);
1410
+ if (t += 2, m > 0)
1411
+ for (let g = 0; g < m; g++) {
1412
+ const b = new v();
1389
1413
  b.setX(e.getFloat32(t, this.littleEndian)), t += 4, b.setY(e.getFloat32(t, this.littleEndian)), t += 4, b.setZ(e.getFloat32(t, this.littleEndian)), t += 4, l.push(b);
1390
1414
  }
1391
- const v = e.getUint16(t, this.littleEndian);
1392
- if (t += 2, v > 0)
1393
- for (let g = 0; g < v; g++)
1415
+ const w = e.getUint16(t, this.littleEndian);
1416
+ if (t += 2, w > 0)
1417
+ for (let g = 0; g < w; g++)
1394
1418
  t += 4, t += 4, t += 4;
1395
- const T = e.getUint16(t, this.littleEndian);
1396
- if (t += 2, T > 0)
1397
- for (let g = 0; g < T; g++) {
1398
- const b = new C();
1419
+ const C = e.getUint16(t, this.littleEndian);
1420
+ if (t += 2, C > 0)
1421
+ for (let g = 0; g < C; g++) {
1422
+ const b = new S();
1399
1423
  b.setX(e.getFloat32(t, this.littleEndian)), t += 4, b.setY(e.getFloat32(t, this.littleEndian)), t += 4, d.push(b);
1400
1424
  }
1401
1425
  const x = e.getUint16(t, this.littleEndian);
@@ -1414,14 +1438,14 @@ class Gs {
1414
1438
  for (let g = 0; g < p.length; g++) {
1415
1439
  const b = p[g], z = l[b[0]], N = l[b[1]], P = l[b[2]];
1416
1440
  y.push(...z.toArray(), ...N.toArray(), ...P.toArray());
1417
- let X = new C(), $ = new C(), k = new C();
1441
+ let V = new S(), $ = new S(), j = new S();
1418
1442
  const U = u[g];
1419
- U !== void 0 && (X = U[0], $ = U[1], k = U[2]), _.push(...X.toArray(), ...$.toArray(), ...k.toArray());
1443
+ U !== void 0 && (V = U[0], $ = U[1], j = U[2]), _.push(...V.toArray(), ...$.toArray(), ...j.toArray());
1420
1444
  }
1421
1445
  const O = new Float32Array(y), A = new Float32Array(_), E = new K();
1422
- if (O.length > 0 && E.setAttribute("position", new ve(O, 3)), A.length > 0 && E.setAttribute("uv", new ve(A, 2)), E.computeVertexNormals(), this.materials.has(c)) {
1423
- const g = new D(E, this.materials.get(c));
1424
- g.name = o, g.castShadow = !0, g.receiveShadow = !0, n.add(g);
1446
+ if (O.length > 0 && E.setAttribute("position", new Ce(O, 3)), A.length > 0 && E.setAttribute("uv", new Ce(A, 2)), E.computeVertexNormals(), this.materials.has(c)) {
1447
+ const g = new k(E, this.materials.get(c));
1448
+ g.name = a, g.castShadow = !0, g.receiveShadow = !0, n.add(g);
1425
1449
  }
1426
1450
  }
1427
1451
  s(n);
@@ -1431,26 +1455,26 @@ class Gs {
1431
1455
  console.warn("SBMLoader: SBM version 3 is not supported yet."), s(n);
1432
1456
  }
1433
1457
  }
1434
- class $s extends bt {
1458
+ class Qs extends St {
1435
1459
  load(e, t, s, n) {
1436
1460
  let i;
1437
1461
  if (this.resourcePath !== "")
1438
1462
  i = this.resourcePath;
1439
1463
  else if (this.path !== "") {
1440
- const o = L.extractUrlBase(e);
1441
- i = L.resolveURL(o, this.path);
1464
+ const a = B.extractUrlBase(e);
1465
+ i = B.resolveURL(a, this.path);
1442
1466
  } else
1443
- i = L.extractUrlBase(e);
1467
+ i = B.extractUrlBase(e);
1444
1468
  this.manager.itemStart(e);
1445
- const r = (o) => {
1446
- n ? n(o) : console.error(o), this.manager.itemError(e), this.manager.itemEnd(e);
1447
- }, a = new je(this.manager);
1448
- a.setPath(this.path), a.setResponseType("arraybuffer"), a.setRequestHeader(this.requestHeader), a.setWithCredentials(this.withCredentials), a.load(
1469
+ const r = (a) => {
1470
+ n ? n(a) : console.error(a), this.manager.itemError(e), this.manager.itemEnd(e);
1471
+ }, o = new Ue(this.manager);
1472
+ o.setPath(this.path), o.setResponseType("arraybuffer"), o.setRequestHeader(this.requestHeader), o.setWithCredentials(this.withCredentials), o.load(
1449
1473
  e,
1450
- (o) => {
1474
+ (a) => {
1451
1475
  try {
1452
1476
  this.parse(
1453
- o,
1477
+ a,
1454
1478
  i,
1455
1479
  (c) => {
1456
1480
  t(c), this.manager.itemEnd(e);
@@ -1471,7 +1495,7 @@ class $s extends bt {
1471
1495
  n?.(new Error(`SBMLoader: Invalid SBM format: ${i}`));
1472
1496
  return;
1473
1497
  }
1474
- new Gs(e, {
1498
+ new Ks(e, {
1475
1499
  path: t,
1476
1500
  crossOrigin: this.crossOrigin,
1477
1501
  requestHeader: this.requestHeader,
@@ -1493,7 +1517,7 @@ class $s extends bt {
1493
1517
  });
1494
1518
  }
1495
1519
  }
1496
- const Ws = [
1520
+ const qs = [
1497
1521
  "map",
1498
1522
  "alphaMap",
1499
1523
  "aoMap",
@@ -1522,12 +1546,12 @@ const Ws = [
1522
1546
  ];
1523
1547
  function W(h) {
1524
1548
  return h.traverse((e) => {
1525
- if (!(e instanceof D)) return;
1549
+ if (!(e instanceof k)) return;
1526
1550
  const t = Array.isArray(e.material) ? e.material : [e.material];
1527
1551
  for (const s of t) {
1528
1552
  if (!s) continue;
1529
1553
  let n = !1;
1530
- for (const i of Ws) {
1554
+ for (const i of qs) {
1531
1555
  const r = s[i];
1532
1556
  r?.isTexture && r.image == null && (r.dispose(), s[i] = null, n = !0);
1533
1557
  }
@@ -1535,21 +1559,21 @@ function W(h) {
1535
1559
  }
1536
1560
  }), h;
1537
1561
  }
1538
- class j {
1562
+ class D {
1539
1563
  static CACHE_NAME = "u-space-model-loader-cache";
1540
- static fileLoader = new je().setResponseType("arraybuffer");
1541
- static dracoLoader = new ls().setDecoderPath(
1542
- `https://cdn.jsdelivr.net/npm/three@0.${be}.0/examples/jsm/libs/draco/`
1564
+ static fileLoader = new Ue().setResponseType("arraybuffer");
1565
+ static dracoLoader = new us().setDecoderPath(
1566
+ `https://cdn.jsdelivr.net/npm/three@0.${Se}.0/examples/jsm/libs/draco/`
1543
1567
  );
1544
- static ktx2Loader = new ds().setTranscoderPath(
1545
- `https://cdn.jsdelivr.net/npm/three@0.${be}.0/examples/jsm/libs/basis/`
1568
+ static ktx2Loader = new ms().setTranscoderPath(
1569
+ `https://cdn.jsdelivr.net/npm/three@0.${Se}.0/examples/jsm/libs/basis/`
1546
1570
  );
1547
- static gltfLoader = new Ge().setDRACOLoader(j.dracoLoader).setKTX2Loader(j.ktx2Loader).setMeshoptDecoder(Te);
1548
- static sbmxLoader = new Os().setDRACOLoader(j.dracoLoader).setKTX2Loader(j.ktx2Loader).setMeshoptDecoder(Te);
1549
- static sbmLoader = new $s();
1550
- static fbxLoader = new os();
1551
- static objLoader = new cs();
1552
- static stlLoader = new hs();
1571
+ static gltfLoader = new Ke().setDRACOLoader(D.dracoLoader).setKTX2Loader(D.ktx2Loader).setMeshoptDecoder(Pe);
1572
+ static sbmxLoader = new Bs().setDRACOLoader(D.dracoLoader).setKTX2Loader(D.ktx2Loader).setMeshoptDecoder(Pe);
1573
+ static sbmLoader = new Qs();
1574
+ static fbxLoader = new ls();
1575
+ static objLoader = new ds();
1576
+ static stlLoader = new ps();
1553
1577
  static setLoadingManager(e) {
1554
1578
  this.fileLoader.manager = e, this.dracoLoader.manager = e, this.ktx2Loader.manager = e, this.gltfLoader.manager = e, this.sbmxLoader.manager = e, this.sbmLoader.manager = e, this.fbxLoader.manager = e, this.objLoader.manager = e, this.stlLoader.manager = e;
1555
1579
  }
@@ -1577,23 +1601,23 @@ class j {
1577
1601
  switch (t.persistent && typeof caches < "u" ? n = await this.getPersistentData(e) : n = await this.fileLoader.loadAsync(e), s) {
1578
1602
  case "gltf":
1579
1603
  case "glb":
1580
- const i = await this.gltfLoader.parseAsync(n, L.extractUrlBase(e));
1604
+ const i = await this.gltfLoader.parseAsync(n, B.extractUrlBase(e));
1581
1605
  return i.scene.animations = i.animations, W(i.scene);
1582
1606
  case "sbmx":
1583
- const r = await this.sbmxLoader.parseAsync(n, L.extractUrlBase(e));
1607
+ const r = await this.sbmxLoader.parseAsync(n, B.extractUrlBase(e));
1584
1608
  return r.scene.animations = r.animations, W(r.scene);
1585
1609
  case "sbm":
1586
- const a = await this.sbmLoader.parseAsync(n, L.extractUrlBase(e));
1587
- return W(a);
1588
- case "fbx":
1589
- const o = this.fbxLoader.parse(n, L.extractUrlBase(e));
1610
+ const o = await this.sbmLoader.parseAsync(n, B.extractUrlBase(e));
1590
1611
  return W(o);
1612
+ case "fbx":
1613
+ const a = this.fbxLoader.parse(n, B.extractUrlBase(e));
1614
+ return W(a);
1591
1615
  case "obj":
1592
1616
  const c = new TextDecoder().decode(n), l = this.objLoader.parse(c);
1593
1617
  return W(l);
1594
1618
  case "stl":
1595
1619
  const d = this.stlLoader.parse(n);
1596
- return new D(d, new I());
1620
+ return new k(d, new L());
1597
1621
  default:
1598
1622
  throw new Error(`Unsupported model format: ${s}`);
1599
1623
  }
@@ -1610,10 +1634,10 @@ class j {
1610
1634
  }
1611
1635
  }
1612
1636
  }
1613
- class Mn {
1614
- static textureLoader = new De();
1615
- static hdrLoader = new ps();
1616
- static cubeTextureLoader = new Mt();
1637
+ class On {
1638
+ static textureLoader = new He();
1639
+ static hdrLoader = new fs();
1640
+ static cubeTextureLoader = new Et();
1617
1641
  static setLoadingManager(e) {
1618
1642
  this.textureLoader.manager = e, this.hdrLoader.manager = e, this.cubeTextureLoader.manager = e;
1619
1643
  }
@@ -1622,13 +1646,13 @@ class Mn {
1622
1646
  }
1623
1647
  static async loadAsyncHDR(e) {
1624
1648
  const t = await this.hdrLoader.loadAsync(e);
1625
- return t.mapping = Tt, t;
1649
+ return t.mapping = Pt, t;
1626
1650
  }
1627
1651
  static async loadAsyncCubeTexture(e, t) {
1628
1652
  return this.cubeTextureLoader.setPath(e), await this.cubeTextureLoader.loadAsync(t);
1629
1653
  }
1630
1654
  }
1631
- class G extends D {
1655
+ class G extends k {
1632
1656
  isBaseMesh = !0;
1633
1657
  type = "BaseMesh";
1634
1658
  castShadow = !0;
@@ -1641,7 +1665,7 @@ class G extends D {
1641
1665
  return this.visible === !1 && this.ignoreInvisibleWhenRaycast === !0 ? !1 : super.raycast(e, t);
1642
1666
  }
1643
1667
  }
1644
- class Ke extends R {
1668
+ class Xe extends R {
1645
1669
  isBaseGroup = !0;
1646
1670
  type = "BaseGroup";
1647
1671
  ignoreInvisibleWhenRaycast = !0;
@@ -1652,7 +1676,7 @@ class Ke extends R {
1652
1676
  return this.visible === !1 && this.ignoreInvisibleWhenRaycast === !0 ? !1 : super.raycast(e, t);
1653
1677
  }
1654
1678
  }
1655
- class Ks extends _t {
1679
+ class Xs extends Ot {
1656
1680
  isBaseSprite = !0;
1657
1681
  type = "BaseSprite";
1658
1682
  ignoreInvisibleWhenRaycast = !0;
@@ -1663,7 +1687,7 @@ class Ks extends _t {
1663
1687
  return this.visible === !1 && this.ignoreInvisibleWhenRaycast === !0 ? !1 : super.raycast(e, t);
1664
1688
  }
1665
1689
  }
1666
- class ae extends Ke {
1690
+ class he extends Xe {
1667
1691
  isModel = !0;
1668
1692
  type = "Model";
1669
1693
  static memoryCache = /* @__PURE__ */ new Map();
@@ -1677,9 +1701,9 @@ class ae extends Ke {
1677
1701
  const { url: t, cache: s = !0, persistent: n = !0 } = e;
1678
1702
  try {
1679
1703
  let i;
1680
- s ? ae.memoryCache.has(t) ? i = ae.memoryCache.get(t) : (i = j.loadAsync(t, { persistent: n }), ae.memoryCache.set(t, i)) : i = j.loadAsync(t, { persistent: n });
1681
- const r = await i, a = us(r);
1682
- return this.add(a), a.animations && a.animations.length > 0 && (this.animations = a.animations, this.mixer = new Et(a)), a;
1704
+ s ? he.memoryCache.has(t) ? i = he.memoryCache.get(t) : (i = D.loadAsync(t, { persistent: n }), he.memoryCache.set(t, i)) : i = D.loadAsync(t, { persistent: n });
1705
+ const r = await i, o = gs(r);
1706
+ return this.add(o), o.animations && o.animations.length > 0 && (this.animations = o.animations, this.mixer = new At(o)), o;
1683
1707
  } catch (i) {
1684
1708
  return console.error(`[Model] Failed to load model from ${t}:`, i), null;
1685
1709
  }
@@ -1687,11 +1711,11 @@ class ae extends Ke {
1687
1711
  playAnimation(e, t = {}) {
1688
1712
  if (!this.mixer || this.animations.length === 0) return null;
1689
1713
  const { loop: s = !0, repetitions: n = 1 / 0, timeScale: i = 1, clampWhenFinished: r = !1 } = t;
1690
- let a;
1691
- if (e === void 0 ? a = this.animations[0] : typeof e == "number" ? a = this.animations[e] : a = this.animations.find((c) => c.name === e), !a)
1714
+ let o;
1715
+ if (e === void 0 ? o = this.animations[0] : typeof e == "number" ? o = this.animations[e] : o = this.animations.find((c) => c.name === e), !o)
1692
1716
  return console.warn(`[Model] Animation not found: ${e}`), null;
1693
- let o = this.actions.get(a.name);
1694
- return o || (o = this.mixer.clipAction(a), this.actions.set(a.name, o)), o.setLoop(s ? Pt : Ot, n), o.clampWhenFinished = r, o.timeScale = i, o.reset().play(), o;
1717
+ let a = this.actions.get(o.name);
1718
+ return a || (a = this.mixer.clipAction(o), this.actions.set(o.name, a)), a.setLoop(s ? It : Bt, n), a.clampWhenFinished = r, a.timeScale = i, a.reset().play(), a;
1695
1719
  }
1696
1720
  playAllAnimations(e = {}) {
1697
1721
  return this.animations.map((t, s) => this.playAnimation(s, e)).filter((t) => t !== null);
@@ -1712,13 +1736,13 @@ class ae extends Ke {
1712
1736
  * Get the axis-aligned bounding box of this model.
1713
1737
  */
1714
1738
  getBoundingBox() {
1715
- return new q().setFromObject(this);
1739
+ return new X().setFromObject(this);
1716
1740
  }
1717
1741
  /**
1718
1742
  * Get the center point of this model's bounding box.
1719
1743
  */
1720
1744
  getCenter() {
1721
- const e = new w();
1745
+ const e = new v();
1722
1746
  return this.getBoundingBox().getCenter(e), e;
1723
1747
  }
1724
1748
  /**
@@ -1726,7 +1750,7 @@ class ae extends Ke {
1726
1750
  */
1727
1751
  setMaterial(e) {
1728
1752
  this.traverse((t) => {
1729
- t instanceof D && (t.material = e);
1753
+ t instanceof k && (t.material = e);
1730
1754
  });
1731
1755
  }
1732
1756
  static clearMemoryCache() {
@@ -1736,11 +1760,11 @@ class ae extends Ke {
1736
1760
  typeof caches < "u" && await caches.delete("u-space-loader-cache");
1737
1761
  }
1738
1762
  }
1739
- class Qs extends G {
1763
+ class Ys extends G {
1740
1764
  isSphereMesh = !0;
1741
1765
  type = "SphereMesh";
1742
1766
  constructor({ geometryParameters: e, materialParameters: t } = {}) {
1743
- super(), this.geometry = new At(
1767
+ super(), this.geometry = new Rt(
1744
1768
  e?.radius,
1745
1769
  e?.widthSegments,
1746
1770
  e?.heightSegments,
@@ -1748,23 +1772,23 @@ class Qs extends G {
1748
1772
  e?.phiLength,
1749
1773
  e?.thetaStart,
1750
1774
  e?.thetaLength
1751
- ), this.material = new I(t);
1775
+ ), this.material = new L(t);
1752
1776
  }
1753
1777
  }
1754
- class Pe extends G {
1778
+ class Ie extends G {
1755
1779
  isTubeMesh = !0;
1756
1780
  type = "TubeMesh";
1757
1781
  constructor({ geometryParameters: e, materialParameters: t } = {}) {
1758
- super(), this.geometry = new Bt(
1782
+ super(), this.geometry = new Lt(
1759
1783
  e?.path,
1760
1784
  e?.tubularSegments,
1761
1785
  e?.radius,
1762
1786
  e?.radialSegments,
1763
1787
  e?.closed
1764
- ), this.material = new I(t);
1788
+ ), this.material = new L(t);
1765
1789
  }
1766
1790
  }
1767
- class Tn extends Ke {
1791
+ class An extends Xe {
1768
1792
  isTopology = !0;
1769
1793
  type = "Topology";
1770
1794
  // Visuals
@@ -1815,8 +1839,8 @@ class Tn extends Ke {
1815
1839
  console.error(`[Topology] Cannot add edge. One or both nodes not found: ${e}, ${t}`);
1816
1840
  return;
1817
1841
  }
1818
- const a = s ?? i.distanceTo(r);
1819
- this.getNeighbors(e)?.set(t, a), n && this.getNeighbors(t)?.set(e, a);
1842
+ const o = s ?? i.distanceTo(r);
1843
+ this.getNeighbors(e)?.set(t, o), n && this.getNeighbors(t)?.set(e, o);
1820
1844
  }
1821
1845
  /**
1822
1846
  * Remove an edge between two nodes.
@@ -1834,32 +1858,32 @@ class Tn extends Ke {
1834
1858
  if (!this.nodes.has(e) || !this.nodes.has(t))
1835
1859
  return console.warn("[Topology] Start or End node not found."), [];
1836
1860
  const s = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set();
1837
- for (const [o] of this.nodes)
1838
- s.set(o, 1 / 0), n.set(o, null), i.add(o);
1861
+ for (const [a] of this.nodes)
1862
+ s.set(a, 1 / 0), n.set(a, null), i.add(a);
1839
1863
  for (s.set(e, 0); i.size > 0; ) {
1840
- let o = null, c = 1 / 0;
1864
+ let a = null, c = 1 / 0;
1841
1865
  for (const d of i) {
1842
1866
  const p = s.get(d);
1843
- p < c && (c = p, o = d);
1867
+ p < c && (c = p, a = d);
1844
1868
  }
1845
- if (o === null || o === t || c === 1 / 0)
1869
+ if (a === null || a === t || c === 1 / 0)
1846
1870
  break;
1847
- i.delete(o);
1848
- const l = this.adjacencyMap?.get(o);
1871
+ i.delete(a);
1872
+ const l = this.adjacencyMap?.get(a);
1849
1873
  if (l)
1850
1874
  for (const [d, p] of l) {
1851
1875
  if (!i.has(d)) continue;
1852
- const u = s.get(o) + p;
1853
- u < s.get(d) && (s.set(d, u), n.set(d, o));
1876
+ const u = s.get(a) + p;
1877
+ u < s.get(d) && (s.set(d, u), n.set(d, a));
1854
1878
  }
1855
1879
  }
1856
1880
  const r = [];
1857
- let a = t;
1881
+ let o = t;
1858
1882
  if (n.get(t) === null && e !== t)
1859
1883
  return [];
1860
- for (; a !== null; ) {
1861
- const o = this.nodes.get(a);
1862
- o && r.unshift(o), a = n.get(a) || null;
1884
+ for (; o !== null; ) {
1885
+ const a = this.nodes.get(o);
1886
+ a && r.unshift(a), o = n.get(o) || null;
1863
1887
  }
1864
1888
  return r;
1865
1889
  }
@@ -1868,7 +1892,7 @@ class Tn extends Ke {
1868
1892
  */
1869
1893
  renderGraph() {
1870
1894
  this.clearGraph(), this.graphGroup = new R();
1871
- const e = new Qs({
1895
+ const e = new Ys({
1872
1896
  geometryParameters: {
1873
1897
  radius: this.parameters.nodeRadius,
1874
1898
  widthSegments: 16,
@@ -1885,12 +1909,12 @@ class Tn extends Ke {
1885
1909
  const t = /* @__PURE__ */ new Set();
1886
1910
  this.adjacencyMap.forEach((s, n) => {
1887
1911
  s.forEach((i, r) => {
1888
- const a = [n, r].sort().join("-");
1889
- if (t.has(a)) return;
1890
- t.add(a);
1891
- const o = this.nodes.get(n), c = this.nodes.get(r);
1892
- if (o && c) {
1893
- const l = new Lt(o, c), d = new Pe({
1912
+ const o = [n, r].sort().join("-");
1913
+ if (t.has(o)) return;
1914
+ t.add(o);
1915
+ const a = this.nodes.get(n), c = this.nodes.get(r);
1916
+ if (a && c) {
1917
+ const l = new zt(a, c), d = new Ie({
1894
1918
  geometryParameters: {
1895
1919
  path: l,
1896
1920
  tubularSegments: 1,
@@ -1909,7 +1933,7 @@ class Tn extends Ke {
1909
1933
  }
1910
1934
  clearGraph() {
1911
1935
  this.graphGroup && (this.remove(this.graphGroup), this.graphGroup.traverse((e) => {
1912
- e instanceof D && (e.geometry.dispose(), e.material.dispose());
1936
+ e instanceof k && (e.geometry.dispose(), e.material.dispose());
1913
1937
  }), this.graphGroup = null);
1914
1938
  }
1915
1939
  /**
@@ -1917,7 +1941,7 @@ class Tn extends Ke {
1917
1941
  */
1918
1942
  renderPath(e, t = this.parameters.pathColor) {
1919
1943
  if (e.length < 2) return;
1920
- const s = new Rt(e, !1, "catmullrom", 0), n = new Pe({
1944
+ const s = new Nt(e, !1, "catmullrom", 0), n = new Ie({
1921
1945
  geometryParameters: {
1922
1946
  path: s,
1923
1947
  tubularSegments: e.length * 10,
@@ -1943,9 +1967,9 @@ class Tn extends Ke {
1943
1967
  });
1944
1968
  const t = [], s = /* @__PURE__ */ new Set();
1945
1969
  return this.adjacencyMap.forEach((n, i) => {
1946
- n.forEach((r, a) => {
1947
- const o = [i, a].sort().join("-");
1948
- s.has(o) || (s.add(o), t.push({ from: i, to: a, weight: r }));
1970
+ n.forEach((r, o) => {
1971
+ const a = [i, o].sort().join("-");
1972
+ s.has(a) || (s.add(a), t.push({ from: i, to: o, weight: r }));
1949
1973
  });
1950
1974
  }), { nodes: e, edges: t };
1951
1975
  }
@@ -1955,7 +1979,7 @@ class Tn extends Ke {
1955
1979
  */
1956
1980
  importData(e) {
1957
1981
  this.clearGraph(), this.clearPaths(), this.nodes.clear(), this.adjacencyMap.clear(), Object.entries(e.nodes).forEach(([t, s]) => {
1958
- this.addNode(t, new w(s.x, s.y, s.z));
1982
+ this.addNode(t, new v(s.x, s.y, s.z));
1959
1983
  }), e.edges.forEach(({ from: t, to: s, weight: n }) => {
1960
1984
  this.addEdge(t, s, n);
1961
1985
  }), this.renderGraph();
@@ -1967,7 +1991,7 @@ class Tn extends Ke {
1967
1991
  return this.adjacencyMap.get(e);
1968
1992
  }
1969
1993
  }
1970
- class _n extends Ks {
1994
+ class In extends Xs {
1971
1995
  isPoi = !0;
1972
1996
  type = "Poi";
1973
1997
  parameters = {
@@ -1986,7 +2010,7 @@ class _n extends Ks {
1986
2010
  _canvas = document.createElement("canvas");
1987
2011
  _lastParametersJSON = "";
1988
2012
  constructor(e = {}) {
1989
- super(new It()), Object.assign(this.parameters, e), this.updateAsync();
2013
+ super(new Dt()), Object.assign(this.parameters, e), this.updateAsync();
1990
2014
  }
1991
2015
  /**
1992
2016
  * Update the POI with new parameters
@@ -2002,33 +2026,33 @@ class _n extends Ks {
2002
2026
  n.font = `${this.parameters.fontSize}px ${this.parameters.fontFamily}`;
2003
2027
  let i = null;
2004
2028
  this.parameters.img && (i = await this._loadImage(this.parameters.img));
2005
- const { text: r, fontSize: a, color: o, iconSize: c, padding: l, backgroundColor: d, borderRadius: p, textPosition: u, scaleFactor: f } = this.parameters, v = n.measureText(r), T = r ? v.width : 0, x = r ? a : 0;
2029
+ const { text: r, fontSize: o, color: a, iconSize: c, padding: l, backgroundColor: d, borderRadius: p, textPosition: u, scaleFactor: m } = this.parameters, w = n.measureText(r), C = r ? w.width : 0, x = r ? o : 0;
2006
2030
  let y = 0, _ = 0, O = 0, A = 0, E = 0, g = 0;
2007
2031
  const b = !!i, z = !!r;
2008
2032
  if (b && z)
2009
2033
  switch (u) {
2010
2034
  case "top":
2011
- y = Math.max(c, T), _ = c + l + x, E = (y - T) / 2, g = x / 2, O = (y - c) / 2, A = x + l;
2035
+ y = Math.max(c, C), _ = c + l + x, E = (y - C) / 2, g = x / 2, O = (y - c) / 2, A = x + l;
2012
2036
  break;
2013
2037
  case "bottom":
2014
- y = Math.max(c, T), _ = c + l + x, O = (y - c) / 2, A = 0, E = (y - T) / 2, g = c + l + x / 2;
2038
+ y = Math.max(c, C), _ = c + l + x, O = (y - c) / 2, A = 0, E = (y - C) / 2, g = c + l + x / 2;
2015
2039
  break;
2016
2040
  case "left":
2017
- y = c + l + T, _ = Math.max(c, x), E = 0, g = _ / 2, O = T + l, A = (_ - c) / 2;
2041
+ y = c + l + C, _ = Math.max(c, x), E = 0, g = _ / 2, O = C + l, A = (_ - c) / 2;
2018
2042
  break;
2019
2043
  default:
2020
- y = c + l + T, _ = Math.max(c, x), O = 0, A = (_ - c) / 2, E = c + l, g = _ / 2;
2044
+ y = c + l + C, _ = Math.max(c, x), O = 0, A = (_ - c) / 2, E = c + l, g = _ / 2;
2021
2045
  break;
2022
2046
  }
2023
- else b ? (y = c, _ = c, O = 0, A = 0) : z && (y = T, _ = x, E = 0, g = x / 2);
2047
+ else b ? (y = c, _ = c, O = 0, A = 0) : z && (y = C, _ = x, E = 0, g = x / 2);
2024
2048
  const N = y + l * 2, P = _ + l * 2;
2025
- if (s.width = N, s.height = P, n.font = `${a}px ${this.parameters.fontFamily}`, d && (n.fillStyle = d, this._drawRoundedRect(n, 0, 0, N, P, p), n.fill()), b && n.drawImage(i, O + l, A + l, c, c), z) {
2026
- n.fillStyle = o;
2027
- const k = n.measureText(r), U = k.actualBoundingBoxAscent + k.actualBoundingBoxDescent, tt = k.actualBoundingBoxAscent - U / 2;
2028
- n.textBaseline = "alphabetic", n.fillText(r, E + l, g + l + tt);
2049
+ if (s.width = N, s.height = P, n.font = `${o}px ${this.parameters.fontFamily}`, d && (n.fillStyle = d, this._drawRoundedRect(n, 0, 0, N, P, p), n.fill()), b && n.drawImage(i, O + l, A + l, c, c), z) {
2050
+ n.fillStyle = a;
2051
+ const j = n.measureText(r), U = j.actualBoundingBoxAscent + j.actualBoundingBoxDescent, it = j.actualBoundingBoxAscent - U / 2;
2052
+ n.textBaseline = "alphabetic", n.fillText(r, E + l, g + l + it);
2029
2053
  }
2030
- const X = this.material.map, $ = new zt(s);
2031
- $.colorSpace = ke, this.material.map = $, X?.dispose(), this.scale.set(N * f, P * f, 1);
2054
+ const V = this.material.map, $ = new kt(s);
2055
+ $.colorSpace = Fe, this.material.map = $, V?.dispose(), this.scale.set(N * m, P * m, 1);
2032
2056
  }
2033
2057
  _loadImage(e) {
2034
2058
  return new Promise((t, s) => {
@@ -2046,80 +2070,80 @@ class _n extends Ks {
2046
2070
  this.material.map?.dispose(), this.material.dispose();
2047
2071
  }
2048
2072
  }
2049
- class Qe extends G {
2073
+ class Ye extends G {
2050
2074
  isShapeMesh = !0;
2051
2075
  type = "ShapeMesh";
2052
2076
  constructor({ geometryParameters: e, materialParameters: t } = {}) {
2053
- super(), this.geometry = new Nt(e?.shape, e?.curveSegments), this.material = new I(t), this.geometry.rotateX(-Math.PI / 2);
2077
+ super(), this.geometry = new jt(e?.shape, e?.curveSegments), this.material = new L(t), this.geometry.rotateX(-Math.PI / 2);
2054
2078
  }
2055
2079
  static createFromPoints(e, t = {}) {
2056
- return new Qe({
2080
+ return new Ye({
2057
2081
  ...t,
2058
2082
  geometryParameters: {
2059
2083
  ...t.geometryParameters,
2060
- shape: new Ue(e.map((s) => new C(s.x, -s.z)))
2084
+ shape: new Ge(e.map((s) => new S(s.x, -s.z)))
2061
2085
  }
2062
2086
  });
2063
2087
  }
2064
2088
  }
2065
- class qe extends G {
2089
+ class Ve extends G {
2066
2090
  isExtrudeMesh = !0;
2067
2091
  type = "ExtrudeMesh";
2068
2092
  constructor({ geometryParameters: e, materialParameters: t } = {}) {
2069
- super(), this.geometry = new jt(e?.shape, e?.options), this.material = new I(t), this.geometry.rotateX(-Math.PI / 2);
2093
+ super(), this.geometry = new Ut(e?.shape, e?.options), this.material = new L(t), this.geometry.rotateX(-Math.PI / 2);
2070
2094
  }
2071
2095
  static createFromPoints(e, t = {}) {
2072
- return e && e.length === 0 && (e = void 0), new qe({
2096
+ return e && e.length === 0 && (e = void 0), new Ve({
2073
2097
  ...t,
2074
2098
  geometryParameters: {
2075
2099
  ...t.geometryParameters,
2076
- shape: new Ue(e?.map((s) => new C(s.x, -s.z)))
2100
+ shape: new Ge(e?.map((s) => new S(s.x, -s.z)))
2077
2101
  }
2078
2102
  });
2079
2103
  }
2080
2104
  }
2081
- class En extends G {
2105
+ class Bn extends G {
2082
2106
  isPlaneMesh = !0;
2083
2107
  type = "PlaneMesh";
2084
2108
  constructor({ geometryParameters: e, materialParameters: t } = {}) {
2085
- super(), this.geometry = new Dt(
2109
+ super(), this.geometry = new Ht(
2086
2110
  e?.width,
2087
2111
  e?.height,
2088
2112
  e?.widthSegments,
2089
2113
  e?.heightSegments
2090
- ), this.material = new I(t);
2114
+ ), this.material = new L(t);
2091
2115
  }
2092
2116
  }
2093
- class Pn extends G {
2117
+ class Rn extends G {
2094
2118
  isCircleMesh = !0;
2095
2119
  type = "CircleMesh";
2096
2120
  constructor({ geometryParameters: e, materialParameters: t } = {}) {
2097
2121
  super(
2098
- new kt(
2122
+ new Ft(
2099
2123
  e?.radius,
2100
2124
  e?.segments,
2101
2125
  e?.thetaStart,
2102
2126
  e?.thetaLength
2103
2127
  ),
2104
- new I(t)
2128
+ new L(t)
2105
2129
  ), this.geometry.rotateX(-Math.PI / 2);
2106
2130
  }
2107
2131
  }
2108
2132
  class F {
2109
2133
  static traverseMeshes(e, t) {
2110
2134
  e.traverse((s) => {
2111
- s instanceof D && t(s);
2135
+ s instanceof k && t(s);
2112
2136
  });
2113
2137
  }
2114
2138
  }
2115
- class On {
2139
+ class Ln {
2116
2140
  static flow(e = {}) {
2117
- const { baseColor: t = 16777215, flowColor: s = 65280, speed: n = 1, scale: i = 3, intensity: r = 4 } = e, a = H(new M(t)), o = H(new M(s)), c = Ce().x.mul(i).sub(se.mul(n)), l = ne(ue(c).add(1).mul(0.5), r);
2118
- return ie(a, o, l);
2141
+ const { baseColor: t = 16777215, flowColor: s = 65280, speed: n = 1, scale: i = 3, intensity: r = 4 } = e, o = H(new M(t)), a = H(new M(s)), c = Te().x.mul(i).sub(re.mul(n)), l = oe(ge(c).add(1).mul(0.5), r);
2142
+ return ae(o, a, l);
2119
2143
  }
2120
2144
  static breathe(e = {}) {
2121
- const { baseColor: t = 16777215, breathColor: s = 65280, speed: n = 1, intensity: i = 2 } = e, r = H(new M(t)), a = H(new M(s)), o = ue(se.mul(n)).add(1).mul(0.5), c = ne(o, i);
2122
- return ie(r, a, c);
2145
+ const { baseColor: t = 16777215, breathColor: s = 65280, speed: n = 1, intensity: i = 2 } = e, r = H(new M(t)), o = H(new M(s)), a = ge(re.mul(n)).add(1).mul(0.5), c = oe(a, i);
2146
+ return ae(r, o, c);
2123
2147
  }
2124
2148
  static fluid(e = {}) {
2125
2149
  const {
@@ -2128,56 +2152,80 @@ class On {
2128
2152
  speed: n = 1,
2129
2153
  scale: i = 1,
2130
2154
  intensity: r = 1,
2131
- distortion: a = 0.5
2132
- } = e, o = H(new M(t)), c = H(new M(s)), l = Ce().mul(i), d = se.mul(n), p = Se(l.add(d), 1, 0), u = l.add(p.mul(a)), f = Se(u, 1, 0).add(1).mul(0.5), v = ne(f, r);
2133
- return ie(o, c, v);
2155
+ distortion: o = 0.5
2156
+ } = e, a = H(new M(t)), c = H(new M(s)), l = Te().mul(i), d = re.mul(n), p = _e(l.add(d), 1, 0), u = l.add(p.mul(o)), m = _e(u, 1, 0).add(1).mul(0.5), w = oe(m, r);
2157
+ return ae(a, c, w);
2134
2158
  }
2135
2159
  }
2136
- function An(h) {
2160
+ function zn(h) {
2137
2161
  }
2138
- const le = "uSpaceHighlight", Q = `${le}/enabled`, Xe = `${le}/opacity`, Ye = `${le}/color`, Je = `${le}/overwrite`, de = "uSpaceBreathe", ce = `${de}/enabled`, Ve = `${de}/color`, Ze = `${de}/speed`, et = `${de}/intensity`, he = /* @__PURE__ */ new WeakMap(), qs = He(() => {
2139
- const h = B(Q, "uint"), e = B(Ye, "uint"), t = B(Je, "uint"), s = Be(e), n = Me.mul(s), i = re(t.greaterThan(0), s, n), r = re(h.greaterThan(0), i, Me), a = B(ce, "uint"), o = B(Ve, "uint"), c = B(Ze, "float"), l = B(et, "float"), d = Be(o), p = ue(se.mul(c)).add(1).mul(0.5), u = ne(p, l), f = ie(r, d, u);
2140
- return re(a.greaterThan(0), f, r);
2141
- })(), Xs = He(() => {
2142
- const h = B(Q, "uint"), e = B(Xe, "float");
2143
- return re(h.greaterThan(0), e, Xt);
2162
+ const Y = "uSpaceHighlight", q = `${Y}/enabled`, Je = `${Y}/opacity`, Ze = `${Y}/color`, et = `${Y}/overwrite`, de = `${Y}/instancedOriginalOpacity`, me = "uSpaceBreathe", pe = `${me}/enabled`, tt = `${me}/color`, st = `${me}/speed`, nt = `${me}/intensity`, ue = /* @__PURE__ */ new WeakMap(), Vs = $e(() => {
2163
+ const h = I(q, "uint"), e = I(Ze, "uint"), t = I(et, "uint"), s = Le(e), n = Ee.mul(s), i = ce(t.greaterThan(0), s, n), r = ce(h.greaterThan(0), i, Ee), o = I(pe, "uint"), a = I(tt, "uint"), c = I(st, "float"), l = I(nt, "float"), d = Le(a), p = ge(re.mul(c)).add(1).mul(0.5), u = oe(p, l), m = ae(r, d, u);
2164
+ return ce(o.greaterThan(0), m, r);
2165
+ })(), Js = $e(() => {
2166
+ const h = I(q, "uint"), e = I(Je, "float");
2167
+ return ce(h.greaterThan(0), e, Jt);
2144
2168
  })();
2145
- function Oe(h) {
2146
- const e = h.material;
2147
- if (!e || Array.isArray(e)) return;
2148
- let t = he.get(e);
2149
- t || (t = {
2150
- colorNode: e.colorNode,
2151
- opacityNode: e.opacityNode,
2152
- transparent: e.transparent,
2153
- depthWrite: e.depthWrite,
2154
- activeMeshes: /* @__PURE__ */ new Set()
2155
- }, he.set(e, t)), t.activeMeshes.add(h), e.transparent = !0, e.colorNode = qs, e.opacityNode = Xs, e.needsUpdate = !0;
2169
+ function Q(h) {
2170
+ return Array.isArray(h.material) ? h.material : [h.material];
2156
2171
  }
2157
- function Ae(h) {
2158
- const e = h.userData[Q], t = h.userData[ce];
2172
+ function Be(h) {
2173
+ Q(h).forEach((t) => {
2174
+ if (!t) return;
2175
+ let s = ue.get(t);
2176
+ s || (s = {
2177
+ colorNode: t.colorNode,
2178
+ opacityNode: t.opacityNode,
2179
+ transparent: t.transparent,
2180
+ depthWrite: t.depthWrite,
2181
+ activeMeshes: /* @__PURE__ */ new Set()
2182
+ }, ue.set(t, s)), s.activeMeshes.add(h), t.transparent = !0, t.colorNode = Vs, t.opacityNode = Js, t.needsUpdate = !0;
2183
+ });
2184
+ }
2185
+ function Re(h) {
2186
+ const e = h.userData[q], t = h.userData[pe];
2159
2187
  if (e || t) return;
2160
- const s = h.material;
2161
- if (!s || Array.isArray(s)) return;
2162
- const n = he.get(s);
2163
- n && (n.activeMeshes.delete(h), !(n.activeMeshes.size > 0) && (s.colorNode = n.colorNode, s.opacityNode = n.opacityNode, s.transparent = n.transparent, s.depthWrite = n.depthWrite, s.needsUpdate = !0, he.delete(s)));
2188
+ Q(h).forEach((n) => {
2189
+ if (!n) return;
2190
+ const i = ue.get(n);
2191
+ i && (i.activeMeshes.delete(h), !(i.activeMeshes.size > 0) && (n.colorNode = i.colorNode, n.opacityNode = i.opacityNode, n.transparent = i.transparent, n.depthWrite = i.depthWrite, n.needsUpdate = !0, ue.delete(n)));
2192
+ });
2193
+ }
2194
+ function Zs(h, e, t, s) {
2195
+ const n = h, i = n.setSceneInstanceHighlight ?? n.setFacilityHighlight;
2196
+ if (i)
2197
+ return i.call(h, e, t, s), !0;
2198
+ const r = n.setSceneInstanceColor ?? n.setFacilityColor, o = n.setSceneInstanceOpacity ?? n.setFacilityOpacity, a = n.getSceneInstanceOpacity ?? n.getFacilityOpacity, c = n.getSceneInstanceColor ?? n.getFacilityColor, l = n.hasSceneInstanceColor ?? n.hasFacilityColor;
2199
+ return !r || !o ? !1 : (h.userData[de] === void 0 && (h.userData[de] = {
2200
+ hasColor: l?.call(h) ?? !1,
2201
+ color: c?.call(h, new M()).getHex() ?? 16777215,
2202
+ opacity: a?.call(h) ?? 1
2203
+ }), r.call(h, e), o.call(h, t), !0);
2204
+ }
2205
+ function en(h) {
2206
+ const e = h, t = e.clearSceneInstanceHighlight ?? e.clearFacilityHighlight;
2207
+ if (t)
2208
+ return t.call(h), !0;
2209
+ const s = e.resetSceneInstanceColor ?? e.resetFacilityColor, n = e.setSceneInstanceColor ?? e.setFacilityColor, i = e.setSceneInstanceOpacity ?? e.setFacilityOpacity;
2210
+ if (!s || !i) return !1;
2211
+ const r = h.userData[de];
2212
+ return r && (r.hasColor && n ? n.call(h, r.color) : s.call(h), i.call(h, r.opacity), Reflect.deleteProperty(h.userData, de)), !0;
2164
2213
  }
2165
- class oe {
2214
+ class le {
2166
2215
  static highlightColor(e, t = {}) {
2167
- const s = Array.isArray(e) ? e : [e], { opacity: n = 0.5, color: i = 16711680, overwrite: r = !1, depthWrite: a } = t, o = new M(i).getHex();
2216
+ const s = Array.isArray(e) ? e : [e], { opacity: n = 0.5, color: i = 16711680, overwrite: r = !1, depthWrite: o } = t, a = new M(i).getHex();
2168
2217
  for (const c of s)
2169
- F.traverseMeshes(c, (l) => {
2170
- if (l.userData[Q] = 1, l.userData[Xe] = n, l.userData[Ye] = o, l.userData[Je] = r ? 1 : 0, Oe(l), a !== void 0) {
2171
- const d = l.material;
2172
- d && !Array.isArray(d) && (d.depthWrite = a);
2173
- }
2218
+ Zs(c, i, n, r) || F.traverseMeshes(c, (l) => {
2219
+ l.userData[q] = 1, l.userData[Je] = n, l.userData[Ze] = a, l.userData[et] = r ? 1 : 0, Be(l), o !== void 0 && Q(l).forEach((p) => {
2220
+ p && (p.depthWrite = o);
2221
+ });
2174
2222
  });
2175
2223
  }
2176
2224
  static removeHighlightColor(e) {
2177
2225
  const t = Array.isArray(e) ? e : [e];
2178
2226
  for (const s of t)
2179
- F.traverseMeshes(s, (n) => {
2180
- n.userData[Q] = 0, Ae(n);
2227
+ en(s) || F.traverseMeshes(s, (n) => {
2228
+ n.userData[q] = 0, Re(n);
2181
2229
  });
2182
2230
  }
2183
2231
  static breatheColor(e, t = {}) {
@@ -2192,14 +2240,14 @@ class oe {
2192
2240
  n.color = new M(n.color).getHex();
2193
2241
  for (const i of s)
2194
2242
  F.traverseMeshes(i, (r) => {
2195
- r.userData[ce] = 1, r.userData[Ve] = n.color, r.userData[Ze] = n.speed, r.userData[et] = n.intensity, Oe(r);
2243
+ r.userData[pe] = 1, r.userData[tt] = n.color, r.userData[st] = n.speed, r.userData[nt] = n.intensity, Be(r);
2196
2244
  });
2197
2245
  }
2198
2246
  static removeBreatheColor(e) {
2199
2247
  const t = Array.isArray(e) ? e : [e];
2200
2248
  for (const s of t)
2201
2249
  F.traverseMeshes(s, (n) => {
2202
- n.userData[ce] = 0, Ae(n);
2250
+ n.userData[pe] = 0, Re(n);
2203
2251
  });
2204
2252
  }
2205
2253
  /**
@@ -2209,15 +2257,18 @@ class oe {
2209
2257
  const s = Array.isArray(e) ? e : [e];
2210
2258
  for (const n of s)
2211
2259
  F.traverseMeshes(n, (i) => {
2212
- const r = i.material;
2213
- !r || Array.isArray(r) || (r.wireframe = t, r.needsUpdate = !0);
2260
+ Q(i).forEach((r) => {
2261
+ if (!r) return;
2262
+ const o = r;
2263
+ o.wireframe = t, o.needsUpdate = !0;
2264
+ });
2214
2265
  });
2215
2266
  }
2216
2267
  /**
2217
2268
  * Remove wireframe mode.
2218
2269
  */
2219
2270
  static removeWireframe(e) {
2220
- oe.wireframe(e, !1);
2271
+ le.wireframe(e, !1);
2221
2272
  }
2222
2273
  /**
2223
2274
  * Fade in object(s) from fully transparent to original opacity.
@@ -2225,7 +2276,7 @@ class oe {
2225
2276
  */
2226
2277
  static fadeIn(e, t = {}) {
2227
2278
  const { duration: s = 500 } = t;
2228
- return oe._fade(e, 0, 1, s);
2279
+ return le._fade(e, 0, 1, s);
2229
2280
  }
2230
2281
  /**
2231
2282
  * Fade out object(s) to fully transparent.
@@ -2233,44 +2284,52 @@ class oe {
2233
2284
  */
2234
2285
  static fadeOut(e, t = {}) {
2235
2286
  const { duration: s = 500 } = t;
2236
- return oe._fade(e, 1, 0, s);
2287
+ return le._fade(e, 1, 0, s);
2237
2288
  }
2238
2289
  static _fade(e, t, s, n) {
2239
- const i = Array.isArray(e) ? e : [e], r = [];
2240
- for (const a of i)
2241
- F.traverseMeshes(a, (o) => {
2242
- const c = o.material;
2243
- !c || Array.isArray(c) || (c.transparent = !0, c.opacity = t, c.needsUpdate = !0, r.push({ material: c, targetOpacity: s }));
2290
+ const i = Array.isArray(e) ? e : [e], r = /* @__PURE__ */ new Map();
2291
+ for (const o of i)
2292
+ F.traverseMeshes(o, (a) => {
2293
+ Q(a).forEach((c) => {
2294
+ if (!c || r.has(c)) return;
2295
+ const l = c.opacity, d = c.transparent, p = s >= 1 ? l : s;
2296
+ r.set(c, {
2297
+ material: c,
2298
+ targetOpacity: p,
2299
+ originalOpacity: l,
2300
+ originalTransparent: d
2301
+ }), c.transparent = !0, c.opacity = t, c.needsUpdate = !0;
2302
+ });
2244
2303
  });
2245
- return r.length === 0 ? Promise.resolve() : new Promise((a) => {
2246
- const o = performance.now();
2304
+ return r.size === 0 ? Promise.resolve() : new Promise((o) => {
2305
+ const a = performance.now();
2247
2306
  let c = 0;
2248
2307
  const l = () => {
2249
- const d = performance.now() - o, p = Math.min(d / n, 1);
2308
+ const d = performance.now() - a, p = Math.min(d / n, 1);
2250
2309
  if (!i[0].parent) {
2251
- cancelAnimationFrame(c), a();
2310
+ cancelAnimationFrame(c), o();
2252
2311
  return;
2253
2312
  }
2254
- for (const { material: f, targetOpacity: v } of r)
2255
- f.opacity = t + (v - t) * p, f.needsUpdate = !0;
2313
+ for (const { material: m, targetOpacity: w } of r.values())
2314
+ m.opacity = t + (w - t) * p, m.needsUpdate = !0;
2256
2315
  if (p < 1)
2257
2316
  c = requestAnimationFrame(l);
2258
2317
  else {
2259
2318
  if (s >= 1)
2260
- for (const { material: f } of r)
2261
- f.transparent = !1;
2262
- a();
2319
+ for (const { material: m, originalOpacity: w, originalTransparent: C } of r.values())
2320
+ m.opacity = w, m.transparent = C, m.needsUpdate = !0;
2321
+ o();
2263
2322
  }
2264
2323
  };
2265
2324
  c = requestAnimationFrame(l);
2266
2325
  });
2267
2326
  }
2268
2327
  }
2269
- const Be = (h) => {
2328
+ const Le = (h) => {
2270
2329
  const e = h.shiftRight(16).bitAnd(255).toFloat().div(255), t = h.shiftRight(8).bitAnd(255).toFloat().div(255), s = h.bitAnd(255).toFloat().div(255);
2271
- return Yt(e, t, s);
2330
+ return Zt(e, t, s);
2272
2331
  };
2273
- class Ys extends ms {
2332
+ class tn extends ys {
2274
2333
  viewer;
2275
2334
  constructor(e, t) {
2276
2335
  super(t), this.viewer = e;
@@ -2279,7 +2338,7 @@ class Ys extends ms {
2279
2338
  this.update(e) && this.viewer.render();
2280
2339
  };
2281
2340
  easingByMode(e) {
2282
- const t = Js[e];
2341
+ const t = sn[e];
2283
2342
  return super.easing(t);
2284
2343
  }
2285
2344
  start(e, t) {
@@ -2289,54 +2348,54 @@ class Ys extends ms {
2289
2348
  return this.viewer.removeEventListener("afterControlsUpdate", this._update), super.stop();
2290
2349
  }
2291
2350
  }
2292
- function Bn(h, e, t, s = {}, n, i) {
2293
- return new Promise((r, a) => {
2294
- const { duration: o = 1e3, delay: c = 0, repeat: l = !1, mode: d = "Linear.None", yoyo: p = !1 } = s, u = new Ys(h, e).to(t, o).easingByMode(d).delay(c).onUpdate((f) => {
2295
- n?.(f, u);
2351
+ function Nn(h, e, t, s = {}, n, i) {
2352
+ return new Promise((r, o) => {
2353
+ const { duration: a = 1e3, delay: c = 0, repeat: l = !1, mode: d = "Linear.None", yoyo: p = !1 } = s, u = new tn(h, e).to(t, a).easingByMode(d).delay(c).onUpdate((m) => {
2354
+ n?.(m, u);
2296
2355
  }).onComplete(() => {
2297
2356
  r();
2298
2357
  }).onStop(() => {
2299
- a("animation stop");
2358
+ o("animation stop");
2300
2359
  }).onStart(() => {
2301
2360
  i?.(u);
2302
2361
  });
2303
2362
  typeof l == "number" ? u.repeat(l) : typeof l == "boolean" && l && u.repeat(1 / 0), p && u.repeatDelay(20), u.yoyo(p), u.start();
2304
2363
  });
2305
2364
  }
2306
- const Js = {
2307
- "Linear.None": m.Linear.None,
2308
- "Quadratic.In": m.Quadratic.In,
2309
- "Quadratic.Out": m.Quadratic.Out,
2310
- "Quadratic.InOut": m.Quadratic.InOut,
2311
- "Cubic.In": m.Cubic.In,
2312
- "Cubic.Out": m.Cubic.Out,
2313
- "Cubic.InOut": m.Cubic.InOut,
2314
- "Quartic.In": m.Quartic.In,
2315
- "Quartic.Out": m.Quartic.Out,
2316
- "Quartic.InOut": m.Quartic.InOut,
2317
- "Quintic.In": m.Quintic.In,
2318
- "Quintic.Out": m.Quintic.Out,
2319
- "Quintic.InOut": m.Quintic.InOut,
2320
- "Sinusoidal.In": m.Sinusoidal.In,
2321
- "Sinusoidal.Out": m.Sinusoidal.Out,
2322
- "Sinusoidal.InOut": m.Sinusoidal.InOut,
2323
- "Exponential.In": m.Exponential.In,
2324
- "Exponential.Out": m.Exponential.Out,
2325
- "Exponential.InOut": m.Exponential.InOut,
2326
- "Circular.In": m.Circular.In,
2327
- "Circular.Out": m.Circular.Out,
2328
- "Circular.InOut": m.Circular.InOut,
2329
- "Elastic.In": m.Elastic.In,
2330
- "Elastic.Out": m.Elastic.Out,
2331
- "Elastic.InOut": m.Elastic.InOut,
2332
- "Back.In": m.Back.In,
2333
- "Back.Out": m.Back.Out,
2334
- "Back.InOut": m.Back.InOut,
2335
- "Bounce.In": m.Bounce.In,
2336
- "Bounce.Out": m.Bounce.Out,
2337
- "Bounce.InOut": m.Bounce.InOut
2365
+ const sn = {
2366
+ "Linear.None": f.Linear.None,
2367
+ "Quadratic.In": f.Quadratic.In,
2368
+ "Quadratic.Out": f.Quadratic.Out,
2369
+ "Quadratic.InOut": f.Quadratic.InOut,
2370
+ "Cubic.In": f.Cubic.In,
2371
+ "Cubic.Out": f.Cubic.Out,
2372
+ "Cubic.InOut": f.Cubic.InOut,
2373
+ "Quartic.In": f.Quartic.In,
2374
+ "Quartic.Out": f.Quartic.Out,
2375
+ "Quartic.InOut": f.Quartic.InOut,
2376
+ "Quintic.In": f.Quintic.In,
2377
+ "Quintic.Out": f.Quintic.Out,
2378
+ "Quintic.InOut": f.Quintic.InOut,
2379
+ "Sinusoidal.In": f.Sinusoidal.In,
2380
+ "Sinusoidal.Out": f.Sinusoidal.Out,
2381
+ "Sinusoidal.InOut": f.Sinusoidal.InOut,
2382
+ "Exponential.In": f.Exponential.In,
2383
+ "Exponential.Out": f.Exponential.Out,
2384
+ "Exponential.InOut": f.Exponential.InOut,
2385
+ "Circular.In": f.Circular.In,
2386
+ "Circular.Out": f.Circular.Out,
2387
+ "Circular.InOut": f.Circular.InOut,
2388
+ "Elastic.In": f.Elastic.In,
2389
+ "Elastic.Out": f.Elastic.Out,
2390
+ "Elastic.InOut": f.Elastic.InOut,
2391
+ "Back.In": f.Back.In,
2392
+ "Back.Out": f.Back.Out,
2393
+ "Back.InOut": f.Back.InOut,
2394
+ "Bounce.In": f.Bounce.In,
2395
+ "Bounce.Out": f.Bounce.Out,
2396
+ "Bounce.InOut": f.Bounce.InOut
2338
2397
  };
2339
- class Ln {
2398
+ class Dn {
2340
2399
  scene;
2341
2400
  planes = /* @__PURE__ */ new Map();
2342
2401
  helpers = /* @__PURE__ */ new Map();
@@ -2345,7 +2404,7 @@ class Ln {
2345
2404
  */
2346
2405
  group;
2347
2406
  constructor(e) {
2348
- this.scene = e, this.group = new Ut(), this.group.name = "__clippingToolGroup", this.scene.add(this.group);
2407
+ this.scene = e, this.group = new Gt(), this.group.name = "__clippingToolGroup", this.scene.add(this.group);
2349
2408
  }
2350
2409
  /**
2351
2410
  * Move all current scene children (except the clipping group itself) into the ClippingGroup,
@@ -2385,24 +2444,24 @@ class Ln {
2385
2444
  constant: n = 0,
2386
2445
  showHelper: i = !1,
2387
2446
  helperSize: r = 5,
2388
- helperColor: a = 16711680
2389
- } = t, o = new Ht(new w(s.x, s.y, s.z), n);
2390
- return this.planes.set(e, o), this._syncPlanes(), i && this.showHelper(e, r, a), o;
2447
+ helperColor: o = 16711680
2448
+ } = t, a = new $t(new v(s.x, s.y, s.z), n);
2449
+ return this.planes.set(e, a), this._syncPlanes(), i && this.showHelper(e, r, o), a;
2391
2450
  }
2392
2451
  /**
2393
2452
  * Add six clipping planes that form a box around a Box3.
2394
2453
  * Returns the six plane ids: `${id}_+x`, `${id}_-x`, etc.
2395
2454
  */
2396
2455
  addBox(e, t, s = {}) {
2397
- const { showHelpers: n = !1, helperColor: i = 16711680 } = s, r = t.min, a = t.max, o = [
2398
- { suffix: "+x", normal: { x: -1, y: 0, z: 0 }, constant: a.x },
2456
+ const { showHelpers: n = !1, helperColor: i = 16711680 } = s, r = t.min, o = t.max, a = [
2457
+ { suffix: "+x", normal: { x: -1, y: 0, z: 0 }, constant: o.x },
2399
2458
  { suffix: "-x", normal: { x: 1, y: 0, z: 0 }, constant: -r.x },
2400
- { suffix: "+y", normal: { x: 0, y: -1, z: 0 }, constant: a.y },
2459
+ { suffix: "+y", normal: { x: 0, y: -1, z: 0 }, constant: o.y },
2401
2460
  { suffix: "-y", normal: { x: 0, y: 1, z: 0 }, constant: -r.y },
2402
- { suffix: "+z", normal: { x: 0, y: 0, z: -1 }, constant: a.z },
2461
+ { suffix: "+z", normal: { x: 0, y: 0, z: -1 }, constant: o.z },
2403
2462
  { suffix: "-z", normal: { x: 0, y: 0, z: 1 }, constant: -r.z }
2404
2463
  ], c = [];
2405
- for (const l of o) {
2464
+ for (const l of a) {
2406
2465
  const d = `${e}_${l.suffix}`;
2407
2466
  this.addPlane(d, { normal: l.normal, constant: l.constant, showHelper: n, helperColor: i }), c.push(d);
2408
2467
  }
@@ -2412,7 +2471,7 @@ class Ln {
2412
2471
  * Add a clipping box from an object's bounding box with optional padding.
2413
2472
  */
2414
2473
  addBoxFromObject(e, t, s = 0, n = {}) {
2415
- const i = new q().setFromObject(t);
2474
+ const i = new X().setFromObject(t);
2416
2475
  return i.expandByScalar(s), this.addBox(e, i, n);
2417
2476
  }
2418
2477
  /**
@@ -2452,7 +2511,7 @@ class Ln {
2452
2511
  this.hideHelper(e);
2453
2512
  const n = this.planes.get(e);
2454
2513
  if (!n) return;
2455
- const i = new Ft(n, t, new M(s).getHex());
2514
+ const i = new Wt(n, t, new M(s).getHex());
2456
2515
  i.name = e, this.helpers.set(e, i), this.scene.add(i);
2457
2516
  }
2458
2517
  /**
@@ -2478,7 +2537,7 @@ class Ln {
2478
2537
  this.detach(), this.removeAll(), this.scene.remove(this.group);
2479
2538
  }
2480
2539
  }
2481
- class Rn {
2540
+ class kn {
2482
2541
  scene;
2483
2542
  measurements = /* @__PURE__ */ new Map();
2484
2543
  _idCounter = 0;
@@ -2489,19 +2548,19 @@ class Rn {
2489
2548
  * Measure distance between two points.
2490
2549
  */
2491
2550
  measureDistance(e, t, s = {}) {
2492
- const { lineColor: n = 16776960 } = s, i = new w(e.x, e.y, e.z), r = new w(t.x, t.y, t.z), a = i.distanceTo(r), o = `measure_dist_${this._idCounter++}`, c = new R();
2493
- c.name = o;
2494
- const l = new K().setFromPoints([i, r]), d = new ee({ color: n }), p = new te(l, d);
2551
+ const { lineColor: n = 16776960 } = s, i = new v(e.x, e.y, e.z), r = new v(t.x, t.y, t.z), o = i.distanceTo(r), a = `measure_dist_${this._idCounter++}`, c = new R();
2552
+ c.name = a;
2553
+ const l = new K().setFromPoints([i, r]), d = new ne({ color: n }), p = new ie(l, d);
2495
2554
  c.add(p), this.scene.add(c);
2496
2555
  const u = {
2497
- id: o,
2556
+ id: a,
2498
2557
  type: "distance",
2499
- value: a,
2558
+ value: o,
2500
2559
  unit: "m",
2501
2560
  points: [i, r],
2502
2561
  object: c
2503
2562
  };
2504
- return this.measurements.set(o, u), u;
2563
+ return this.measurements.set(a, u), u;
2505
2564
  }
2506
2565
  /**
2507
2566
  * Measure the area of a polygon defined by 3+ coplanar points.
@@ -2510,17 +2569,17 @@ class Rn {
2510
2569
  const { lineColor: s = 65280 } = t;
2511
2570
  if (e.length < 3)
2512
2571
  throw new Error("MeasureTool.measureArea requires at least 3 points");
2513
- const n = e.map((u) => new w(u.x, u.y, u.z)), i = this._calculatePolygonArea(n), r = `measure_area_${this._idCounter++}`, a = new R();
2514
- a.name = r;
2515
- const o = [...n, n[0]], c = new K().setFromPoints(o), l = new ee({ color: s }), d = new te(c, l);
2516
- a.add(d), this.scene.add(a);
2572
+ const n = e.map((u) => new v(u.x, u.y, u.z)), i = this._calculatePolygonArea(n), r = `measure_area_${this._idCounter++}`, o = new R();
2573
+ o.name = r;
2574
+ const a = [...n, n[0]], c = new K().setFromPoints(a), l = new ne({ color: s }), d = new ie(c, l);
2575
+ o.add(d), this.scene.add(o);
2517
2576
  const p = {
2518
2577
  id: r,
2519
2578
  type: "area",
2520
2579
  value: i,
2521
2580
  unit: "m²",
2522
2581
  points: n,
2523
- object: a
2582
+ object: o
2524
2583
  };
2525
2584
  return this.measurements.set(r, p), p;
2526
2585
  }
@@ -2528,17 +2587,17 @@ class Rn {
2528
2587
  * Measure the angle between three points (vertex at the middle point).
2529
2588
  */
2530
2589
  measureAngle(e, t, s, n = {}) {
2531
- const { lineColor: i = 16746496 } = n, r = new w(e.x, e.y, e.z), a = new w(t.x, t.y, t.z), o = new w(s.x, s.y, s.z), c = r.clone().sub(a).normalize(), l = o.clone().sub(a).normalize(), p = Math.acos(Math.max(-1, Math.min(1, c.dot(l)))) * 180 / Math.PI, u = `measure_angle_${this._idCounter++}`, f = new R();
2532
- f.name = u;
2533
- const v = new K().setFromPoints([r, a, o]), T = new ee({ color: i }), x = new te(v, T);
2534
- f.add(x), this.scene.add(f);
2590
+ const { lineColor: i = 16746496 } = n, r = new v(e.x, e.y, e.z), o = new v(t.x, t.y, t.z), a = new v(s.x, s.y, s.z), c = r.clone().sub(o).normalize(), l = a.clone().sub(o).normalize(), p = Math.acos(Math.max(-1, Math.min(1, c.dot(l)))) * 180 / Math.PI, u = `measure_angle_${this._idCounter++}`, m = new R();
2591
+ m.name = u;
2592
+ const w = new K().setFromPoints([r, o, a]), C = new ne({ color: i }), x = new ie(w, C);
2593
+ m.add(x), this.scene.add(m);
2535
2594
  const y = {
2536
2595
  id: u,
2537
2596
  type: "angle",
2538
2597
  value: p,
2539
2598
  unit: "°",
2540
- points: [r, a, o],
2541
- object: f
2599
+ points: [r, o, a],
2600
+ object: m
2542
2601
  };
2543
2602
  return this.measurements.set(u, y), y;
2544
2603
  }
@@ -2575,12 +2634,12 @@ class Rn {
2575
2634
  * Calculate polygon area using cross product method (Newell's method).
2576
2635
  */
2577
2636
  _calculatePolygonArea(e) {
2578
- const t = e.length, s = new w();
2637
+ const t = e.length, s = new v();
2579
2638
  for (let i = 0; i < t; i++) {
2580
- const r = e[i], a = e[(i + 1) % t], o = new w().crossVectors(r, a);
2581
- s.add(o);
2639
+ const r = e[i], o = e[(i + 1) % t], a = new v().crossVectors(r, o);
2640
+ s.add(a);
2582
2641
  }
2583
- const n = new w();
2642
+ const n = new v();
2584
2643
  if (t >= 3) {
2585
2644
  const i = e[1].clone().sub(e[0]), r = e[2].clone().sub(e[0]);
2586
2645
  n.crossVectors(i, r).normalize();
@@ -2591,7 +2650,7 @@ class Rn {
2591
2650
  this.removeAll();
2592
2651
  }
2593
2652
  }
2594
- class In {
2653
+ class jn {
2595
2654
  scene;
2596
2655
  annotations = /* @__PURE__ */ new Map();
2597
2656
  _idCounter = 0;
@@ -2613,7 +2672,7 @@ class In {
2613
2672
  this.annotations.has(e) && this.remove(e);
2614
2673
  const s = new R();
2615
2674
  s.name = `annotation_${e}`;
2616
- const n = new w(t.position.x, t.position.y, t.position.z);
2675
+ const n = new v(t.position.x, t.position.y, t.position.z);
2617
2676
  s.position.copy(n);
2618
2677
  const i = document.createElement("div");
2619
2678
  if (i.innerHTML = t.content, i.style.cssText = `
@@ -2625,30 +2684,32 @@ class In {
2625
2684
  pointer-events: auto;
2626
2685
  white-space: nowrap;
2627
2686
  `, t.labelStyle)
2628
- for (const [c, l] of Object.entries(t.labelStyle))
2687
+ for (const c of Object.keys(t.labelStyle)) {
2688
+ const l = t.labelStyle[c];
2629
2689
  l !== void 0 && (i.style[c] = l);
2690
+ }
2630
2691
  let r = null;
2631
- const a = t.labelOffset || { x: 0, y: 2, z: 0 };
2692
+ const o = t.labelOffset || { x: 0, y: 2, z: 0 };
2632
2693
  if (t.showLeaderLine !== !1) {
2633
2694
  const { lineColor: c = 16777215 } = t, l = new K().setFromPoints([
2634
- new w(0, 0, 0),
2635
- new w(a.x, a.y, a.z)
2636
- ]), d = new ee({ color: c });
2637
- r = new te(l, d), s.add(r);
2695
+ new v(0, 0, 0),
2696
+ new v(o.x, o.y, o.z)
2697
+ ]), d = new ne({ color: c });
2698
+ r = new ie(l, d), s.add(r);
2638
2699
  }
2639
2700
  if (this._createCSSObject) {
2640
2701
  const c = this._createCSSObject(i);
2641
- c.position.set(a.x, a.y, a.z), s.add(c);
2702
+ c.position.set(o.x, o.y, o.z), s.add(c);
2642
2703
  }
2643
2704
  this.scene.add(s);
2644
- const o = {
2705
+ const a = {
2645
2706
  id: e,
2646
2707
  options: t,
2647
2708
  group: s,
2648
2709
  labelElement: i,
2649
2710
  line: r
2650
2711
  };
2651
- return this.annotations.set(e, o), o;
2712
+ return this.annotations.set(e, a), a;
2652
2713
  }
2653
2714
  /**
2654
2715
  * Quick-add a text annotation.
@@ -2742,47 +2803,47 @@ class In {
2742
2803
  this.removeAll();
2743
2804
  }
2744
2805
  }
2745
- const Vs = "0.0.25";
2746
- window.__USPACE__ = { version: Vs };
2806
+ const nn = "0.0.27";
2807
+ window.__USPACE__ = { version: nn };
2747
2808
  export {
2748
- In as AnnotationManager,
2749
- Ke as BaseGroup,
2809
+ jn as AnnotationManager,
2810
+ Xe as BaseGroup,
2750
2811
  G as BaseMesh,
2751
- Ks as BaseSprite,
2752
- jn as CSS2DObject,
2753
- kn as CSS3DObject,
2754
- Un as CSS3DSprite,
2755
- _s as CSSRenderer,
2756
- bs as CameraControls,
2757
- Pn as CircleMesh,
2758
- Ln as ClippingTool,
2759
- qe as ExtrudeMesh,
2760
- fs as InteractionEvent,
2761
- gs as InteractionManager,
2762
- Cn as LightManager,
2763
- oe as MaterialEffects,
2764
- Rn as MeasureTool,
2765
- ae as Model,
2766
- j as ModelLoaderManager,
2767
- ys as ObjectManager,
2812
+ Xs as BaseSprite,
2813
+ Fn as CSS2DObject,
2814
+ $n as CSS3DObject,
2815
+ Wn as CSS3DSprite,
2816
+ Os as CSSRenderer,
2817
+ Ss as CameraControls,
2818
+ Rn as CircleMesh,
2819
+ Dn as ClippingTool,
2820
+ Ve as ExtrudeMesh,
2821
+ ws as InteractionEvent,
2822
+ vs as InteractionManager,
2823
+ En as LightManager,
2824
+ le as MaterialEffects,
2825
+ kn as MeasureTool,
2826
+ he as Model,
2827
+ D as ModelLoaderManager,
2828
+ bs as ObjectManager,
2768
2829
  F as ObjectUtils,
2769
- En as PlaneMesh,
2770
- _n as Poi,
2771
- ws as RenderPipeline,
2772
- Cs as RoomEnvironment,
2773
- $s as SBMLoader,
2774
- Os as SBMXLoader,
2775
- xn as SceneManager,
2776
- bn as Selection,
2777
- Qe as ShapeMesh,
2778
- Qs as SphereMesh,
2779
- On as TSLEffects,
2780
- Mn as TextureLoaderManager,
2781
- Tn as Topology,
2782
- Pe as TubeMesh,
2783
- Ys as Tween,
2784
- Sn as Viewer,
2785
- An as reinterpretType,
2786
- Bn as tweenAnimation,
2787
- Vs as version
2830
+ Bn as PlaneMesh,
2831
+ In as Poi,
2832
+ xs as RenderPipeline,
2833
+ Ts as RoomEnvironment,
2834
+ Qs as SBMLoader,
2835
+ Bs as SBMXLoader,
2836
+ _n as SceneManager,
2837
+ Tn as Selection,
2838
+ Ye as ShapeMesh,
2839
+ Ys as SphereMesh,
2840
+ Ln as TSLEffects,
2841
+ On as TextureLoaderManager,
2842
+ An as Topology,
2843
+ Ie as TubeMesh,
2844
+ tn as Tween,
2845
+ Pn as Viewer,
2846
+ zn as reinterpretType,
2847
+ Nn as tweenAnimation,
2848
+ nn as version
2788
2849
  };