@shopware-ag/dive 2.2.16 → 2.2.17

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 (31) hide show
  1. package/build/chunks/{AssetCache-BkU-YbyI.mjs → AssetCache-Ba-m-7zA.mjs} +1 -1
  2. package/build/chunks/{AssetCache-PycNkZlv.cjs → AssetCache-CpKF1NzV.cjs} +1 -1
  3. package/build/chunks/AssetLoader-B03j7xvX.cjs +4 -0
  4. package/build/chunks/{AssetLoader-2zJQGAPS.mjs → AssetLoader-C2NGPDLw.mjs} +705 -677
  5. package/build/chunks/FileTypes-D5A0_pG_.cjs +29 -0
  6. package/build/chunks/{FileTypes-Qg_Zc7TF.mjs → FileTypes-Djlx9wth.mjs} +101 -99
  7. package/build/chunks/{SelectTool-CwFPCf-b.cjs → SelectTool-ClSKQ893.cjs} +1 -1
  8. package/build/chunks/{SelectTool-DujSa1r0.mjs → SelectTool-D-StWurg.mjs} +1 -1
  9. package/build/dive.cjs +1 -1
  10. package/build/dive.mjs +1 -1
  11. package/build/engine/scene/Scene.d.ts +1 -0
  12. package/build/plugins/ar/index.cjs +1 -1
  13. package/build/plugins/ar/index.mjs +1 -1
  14. package/build/plugins/assetcache/index.cjs +1 -1
  15. package/build/plugins/assetcache/index.mjs +1 -1
  16. package/build/plugins/assetloader/index.cjs +1 -1
  17. package/build/plugins/assetloader/index.mjs +1 -1
  18. package/build/plugins/assetloader/src/loader/AssetLoader.d.ts +8 -1
  19. package/build/plugins/orbitcontroller/index.cjs +1 -1
  20. package/build/plugins/orbitcontroller/index.mjs +1 -1
  21. package/build/plugins/orientationdisplay/index.cjs +1 -1
  22. package/build/plugins/orientationdisplay/index.mjs +1 -1
  23. package/build/plugins/quickview/index.cjs +1 -1
  24. package/build/plugins/quickview/index.mjs +1 -1
  25. package/build/plugins/state/index.cjs +1 -1
  26. package/build/plugins/state/index.mjs +2 -2
  27. package/build/plugins/toolbox/index.cjs +1 -1
  28. package/build/plugins/toolbox/index.mjs +2 -2
  29. package/package.json +1 -1
  30. package/build/chunks/AssetLoader-CgeC94PN.cjs +0 -4
  31. package/build/chunks/FileTypes-Bf3Ffk3D.cjs +0 -29
@@ -1,8 +1,8 @@
1
1
  var q = Object.defineProperty;
2
2
  var K = (o, s, t) => s in o ? q(o, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[s] = t;
3
3
  var i = (o, s, t) => K(o, typeof s != "symbol" ? s + "" : s, t);
4
- import { WebGLRenderer as Q, PCFSoftShadowMap as J, PCFShadowMap as $, BasicShadowMap as j, MathUtils as k, Object3D as _, AmbientLight as tt, PointLight as et, SphereGeometry as x, MeshBasicMaterial as F, FrontSide as U, Mesh as v, HemisphereLight as it, DirectionalLight as st, Vector3 as h, Box3 as g, Quaternion as I, Box3Helper as at, Sphere as nt, MeshStandardMaterial as R, Raycaster as rt, CylinderGeometry as ot, BufferGeometry as Y, BufferAttribute as C, BoxGeometry as L, ConeGeometry as ht, LineDashedMaterial as lt, Line as dt, PlaneGeometry as ct, Color as P, GridHelper as ut, Scene as pt, TOUCH as m, MOUSE as p, EventDispatcher as mt, Spherical as O, Vector2 as c } from "three";
5
- import { P as f, U as ft, H as gt, a as _t, D as z } from "./PerspectiveCamera-BFzE2TQU.mjs";
4
+ import { WebGLRenderer as Q, PCFSoftShadowMap as J, PCFShadowMap as $, BasicShadowMap as j, MathUtils as I, Object3D as g, AmbientLight as tt, PointLight as et, SphereGeometry as T, MeshBasicMaterial as F, FrontSide as U, Mesh as S, HemisphereLight as it, DirectionalLight as st, Vector3 as h, Box3 as f, Box3Helper as at, Sphere as nt, MeshStandardMaterial as k, Raycaster as rt, CylinderGeometry as ot, BufferGeometry as Y, BufferAttribute as A, BoxGeometry as M, ConeGeometry as ht, LineDashedMaterial as lt, Line as dt, PlaneGeometry as ct, Color as E, GridHelper as ut, Scene as pt, TOUCH as p, MOUSE as u, EventDispatcher as mt, Spherical as C, Vector2 as c, Quaternion as O } from "three";
5
+ import { P as m, U as ft, H as gt, a as _t, D as z } from "./PerspectiveCamera-BFzE2TQU.mjs";
6
6
  class wt {
7
7
  constructor() {
8
8
  i(this, "isDIVEClock", !0);
@@ -113,7 +113,7 @@ class yt {
113
113
  class B {
114
114
  constructor(s, t, e) {
115
115
  i(this, "isDIVEView", !0);
116
- i(this, "uuid", k.generateUUID());
116
+ i(this, "uuid", I.generateUUID());
117
117
  i(this, "_paused", !1);
118
118
  i(this, "_renderer");
119
119
  i(this, "_resizeManager");
@@ -158,14 +158,14 @@ class B {
158
158
  this._paused = !1;
159
159
  }
160
160
  }
161
- class bt extends _ {
161
+ class bt extends g {
162
162
  constructor() {
163
163
  super();
164
164
  i(this, "isDIVELight", !0);
165
165
  i(this, "isDIVEAmbientLight", !0);
166
166
  i(this, "isSelectable", !0);
167
167
  i(this, "_light");
168
- this.name = "DIVEAmbientLight", this._light = new tt(16777215, 1), this._light.layers.mask = f, this.add(this._light);
168
+ this.name = "DIVEAmbientLight", this._light = new tt(16777215, 1), this._light.layers.mask = m, this.add(this._light);
169
169
  }
170
170
  setColor(t) {
171
171
  this._light.color = t;
@@ -177,7 +177,7 @@ class bt extends _ {
177
177
  this._light.visible = t;
178
178
  }
179
179
  }
180
- class Dt extends _ {
180
+ class Dt extends g {
181
181
  constructor() {
182
182
  super();
183
183
  i(this, "isDIVELight", !0);
@@ -187,8 +187,8 @@ class Dt extends _ {
187
187
  i(this, "gizmo", null);
188
188
  i(this, "light");
189
189
  i(this, "mesh");
190
- this.name = "DIVEPointLight", this.light = new et(16777215, 1), this.light.layers.mask = f, this.light.castShadow = !0, this.light.shadow.mapSize.width = 512, this.light.shadow.mapSize.height = 512, this.add(this.light);
191
- const t = 0.1, e = new x(
190
+ this.name = "DIVEPointLight", this.light = new et(16777215, 1), this.light.layers.mask = m, this.light.castShadow = !0, this.light.shadow.mapSize.width = 512, this.light.shadow.mapSize.height = 512, this.add(this.light);
191
+ const t = 0.1, e = new T(
192
192
  t,
193
193
  t * 320,
194
194
  t * 320
@@ -198,7 +198,7 @@ class Dt extends _ {
198
198
  opacity: 0.8,
199
199
  side: U
200
200
  });
201
- this.mesh = new v(e, a), this.mesh.layers.mask = ft, this.add(this.mesh);
201
+ this.mesh = new S(e, a), this.mesh.layers.mask = ft, this.add(this.mesh);
202
202
  }
203
203
  setColor(t) {
204
204
  this.light.color = t, this.mesh.material.color = t;
@@ -235,7 +235,7 @@ class Dt extends _ {
235
235
  });
236
236
  }
237
237
  }
238
- class Et extends _ {
238
+ class Et extends g {
239
239
  constructor() {
240
240
  super();
241
241
  i(this, "isDIVELight", !0);
@@ -243,7 +243,7 @@ class Et extends _ {
243
243
  i(this, "isSelectable", !0);
244
244
  i(this, "_hemiLight");
245
245
  i(this, "_dirLight");
246
- this.name = "DIVESceneLight", this._hemiLight = new it(16777215, 16777215, 2), this._hemiLight.layers.mask = f, this._hemiLight.position.set(0, 50, 0), this._hemiLight.visible = !0, this.add(this._hemiLight), this._dirLight = new st(16777215, 3), this._dirLight.layers.mask = f, this._dirLight.position.set(1, 1.75, 1), this._dirLight.position.multiplyScalar(30), this._dirLight.castShadow = !0, this._dirLight.visible = !0, this._dirLight.shadow.mapSize.width = 2048, this._dirLight.shadow.mapSize.height = 2048;
246
+ this.name = "DIVESceneLight", this._hemiLight = new it(16777215, 16777215, 2), this._hemiLight.layers.mask = m, this._hemiLight.position.set(0, 50, 0), this._hemiLight.visible = !0, this.add(this._hemiLight), this._dirLight = new st(16777215, 3), this._dirLight.layers.mask = m, this._dirLight.position.set(1, 1.75, 1), this._dirLight.position.multiplyScalar(30), this._dirLight.castShadow = !0, this._dirLight.visible = !0, this._dirLight.shadow.mapSize.width = 2048, this._dirLight.shadow.mapSize.height = 2048;
247
247
  const t = 5;
248
248
  this._dirLight.shadow.camera.left = -5, this._dirLight.shadow.camera.right = t, this._dirLight.shadow.camera.top = t, this._dirLight.shadow.camera.bottom = -5, this._dirLight.shadow.camera.far = 3500, this.add(this._dirLight);
249
249
  }
@@ -258,7 +258,7 @@ class Et extends _ {
258
258
  }
259
259
  }
260
260
  const Z = (o) => o.parent ? Z(o.parent) : o;
261
- class V extends _ {
261
+ class x extends g {
262
262
  constructor() {
263
263
  super();
264
264
  i(this, "isSelectable", !0);
@@ -267,7 +267,7 @@ class V extends _ {
267
267
  i(this, "gizmo", null);
268
268
  i(this, "_positionWorldBuffer");
269
269
  i(this, "_boundingBox");
270
- this.layers.mask = f, this._positionWorldBuffer = new h(), this._boundingBox = new g();
270
+ this.layers.mask = m, this._positionWorldBuffer = new h(), this._boundingBox = new f();
271
271
  }
272
272
  setPosition(t) {
273
273
  if (!this.parent) {
@@ -328,7 +328,7 @@ class V extends _ {
328
328
  });
329
329
  }
330
330
  }
331
- class T extends V {
331
+ class L extends x {
332
332
  /**
333
333
  * Creates a new BoundingBox instance for the specified 3D object.
334
334
  *
@@ -367,17 +367,16 @@ class T extends V {
367
367
  i(this, "_sphereHelper");
368
368
  /** The dimensions (width, height, depth) of the bounding box */
369
369
  i(this, "_size");
370
- const n = new g();
370
+ const n = new f();
371
371
  e ? n.setFromObject(t) : (t.updateWorldMatrix(!0, !0), t.traverse((l) => {
372
- if (l.isMesh) {
373
- const d = l, u = d.geometry.clone();
374
- u.applyMatrix4(d.matrixWorld);
375
- const y = d.getWorldQuaternion(new I()).invert();
376
- u.applyQuaternion(y), u.computeBoundingBox(), u.boundingBox && n.union(u.boundingBox);
377
- }
372
+ if (!("isMesh" in l) || !l.isMesh) return;
373
+ const d = l;
374
+ d.geometry.computeBoundingBox(), d.geometry.boundingBox && n.union(
375
+ d.geometry.boundingBox.clone().applyMatrix4(d.matrixWorld)
376
+ );
378
377
  })), this.rotation.copy(t.rotation), this._box = n, this._size = n.getSize(new h()), this._center = n.getCenter(new h()), this._boxHelper = new at(this._box, a), this._boxHelper.visible = !1, this.add(this._boxHelper), this._sphere = n.getBoundingSphere(new nt()), this._radius = this._sphere.radius;
379
- const r = new x(this._radius, 32, 32);
380
- r.translate(this._center.x, this._center.y, this._center.z), this._sphereHelper = new v(
378
+ const r = new T(this._radius, 32, 32);
379
+ r.translate(this._center.x, this._center.y, this._center.z), this._sphereHelper = new S(
381
380
  r,
382
381
  new F({ color: a, wireframe: !0 })
383
382
  ), this._sphereHelper.visible = !1, this.add(this._sphereHelper);
@@ -456,7 +455,7 @@ class T extends V {
456
455
  this._sphereHelper.visible = t;
457
456
  }
458
457
  }
459
- class N extends V {
458
+ class N extends x {
460
459
  constructor() {
461
460
  super();
462
461
  i(this, "isDIVEModel", !0);
@@ -484,13 +483,13 @@ class N extends V {
484
483
  }), this.add(this._gltf), this;
485
484
  }
486
485
  setMaterial(t) {
487
- this._material || (this._material = new R()), t.vertexColors !== void 0 && (this._material.vertexColors = t.vertexColors), t.color !== void 0 && this._material.color.set(t.color), t.map !== void 0 && (this._material.map = t.map), t.normalMap !== void 0 && (this._material.normalMap = t.normalMap), t.roughness !== void 0 && (this._material.roughness = t.roughness), t.roughnessMap !== void 0 && (this._material.roughnessMap = t.roughnessMap, this._material.roughnessMap && (this._material.roughness = 1)), t.metalness !== void 0 && (this._material.metalness = t.metalness), t.metalnessMap !== void 0 && (this._material.metalnessMap = t.metalnessMap, this._material.metalnessMap && (this._material.metalness = 1)), this._mesh && (this._mesh.material = this._material);
486
+ this._material || (this._material = new k()), t.vertexColors !== void 0 && (this._material.vertexColors = t.vertexColors), t.color !== void 0 && this._material.color.set(t.color), t.map !== void 0 && (this._material.map = t.map), t.normalMap !== void 0 && (this._material.normalMap = t.normalMap), t.roughness !== void 0 && (this._material.roughness = t.roughness), t.roughnessMap !== void 0 && (this._material.roughnessMap = t.roughnessMap, this._material.roughnessMap && (this._material.roughness = 1)), t.metalness !== void 0 && (this._material.metalness = t.metalness), t.metalnessMap !== void 0 && (this._material.metalnessMap = t.metalnessMap, this._material.metalnessMap && (this._material.metalness = 1)), this._mesh && (this._mesh.material = this._material);
488
487
  }
489
488
  placeOnFloor() {
490
489
  this.updateWorldMatrix(!0, !0);
491
- const t = this.getWorldPosition(this._positionWorldBuffer), e = t.clone(), a = new g();
490
+ const t = this.getWorldPosition(this._positionWorldBuffer), e = t.clone(), a = new f();
492
491
  this.children.forEach((r) => {
493
- r instanceof T || a.expandByObject(r, !0);
492
+ r instanceof L || a.expandByObject(r, !0);
494
493
  });
495
494
  const n = -a.min.y;
496
495
  Math.abs(n) < 1e-9 || (t.y += n, t.y !== e.y && (this.setPosition(t), import("../plugins/state/index.mjs").then(({ State: r }) => {
@@ -511,24 +510,24 @@ class N extends V {
511
510
  );
512
511
  return;
513
512
  }
514
- const t = this.getWorldPosition(this._positionWorldBuffer), e = t.clone(), a = new g();
513
+ const t = this.getWorldPosition(this._positionWorldBuffer), e = t.clone(), a = new f();
515
514
  this.children.forEach((d) => {
516
- d instanceof T || a.expandByObject(d, !0);
515
+ d instanceof L || a.expandByObject(d, !0);
517
516
  });
518
517
  const n = a.getCenter(new h());
519
518
  n.y = a.min.y;
520
519
  const r = new rt(n, new h(0, -1, 0));
521
- r.layers.mask = f;
520
+ r.layers.mask = m;
522
521
  const l = r.intersectObjects(
523
522
  Z(this).root.children,
524
523
  !0
525
524
  );
526
525
  if (l.length > 0) {
527
- const d = l[0].object, b = new g().setFromObject(d).max.y - a.min.y;
528
- if (Math.abs(b) < 1e-9 || (t.y += b, t.y === e.y)) return;
529
- this.setPosition(t), import("../plugins/state/index.mjs").then(({ State: M }) => {
530
- var D;
531
- (D = M.get(this.userData.id)) == null || D.performAction("UPDATE_OBJECT", {
526
+ const d = l[0].object, w = new f().setFromObject(d).max.y - a.min.y;
527
+ if (Math.abs(w) < 1e-9 || (t.y += w, t.y === e.y)) return;
528
+ this.setPosition(t), import("../plugins/state/index.mjs").then(({ State: v }) => {
529
+ var y;
530
+ (y = v.get(this.userData.id)) == null || y.performAction("UPDATE_OBJECT", {
532
531
  id: this.userData.id,
533
532
  position: t,
534
533
  rotation: this.rotation,
@@ -545,7 +544,7 @@ class St extends N {
545
544
  i(this, "isDIVEPrimitive", !0);
546
545
  i(this, "_mesh");
547
546
  i(this, "_material");
548
- this._mesh = new v(), this._mesh.name = "PrimitiveMesh", this._mesh.layers.mask = f, this._mesh.castShadow = !0, this._mesh.receiveShadow = !0, this.add(this._mesh), this._material = new R(), this._mesh.material = this._material;
547
+ this._mesh = new S(), this._mesh.name = "PrimitiveMesh", this._mesh.layers.mask = m, this._mesh.castShadow = !0, this._mesh.receiveShadow = !0, this.add(this._mesh), this._material = new k(), this._mesh.material = this._material;
549
548
  }
550
549
  setGeometry(t) {
551
550
  const e = this.assembleGeometry(t);
@@ -585,7 +584,7 @@ class St extends N {
585
584
  return e.translate(0, t.height / 2, 0), e;
586
585
  }
587
586
  createSphereGeometry(t) {
588
- return new x(t.width / 2, 256, 256);
587
+ return new T(t.width / 2, 256, 256);
589
588
  }
590
589
  createPyramidGeometry(t) {
591
590
  const e = new Float32Array([
@@ -630,11 +629,11 @@ class St extends N {
630
629
  ]), n = new Y();
631
630
  return n.setAttribute(
632
631
  "position",
633
- new C(e, 3)
634
- ), n.setIndex(new C(a, 1)), n;
632
+ new A(e, 3)
633
+ ), n.setIndex(new A(a, 1)), n;
635
634
  }
636
635
  createBoxGeometry(t) {
637
- const e = new L(
636
+ const e = new M(
638
637
  t.width,
639
638
  t.height,
640
639
  t.depth
@@ -646,7 +645,7 @@ class St extends N {
646
645
  return e.translate(0, t.height / 2, 0), e;
647
646
  }
648
647
  createWallGeometry(t) {
649
- const e = new L(
648
+ const e = new M(
650
649
  t.width,
651
650
  t.height,
652
651
  t.depth || 0.05,
@@ -655,7 +654,7 @@ class St extends N {
655
654
  return e.translate(0, t.height / 2, 0), e;
656
655
  }
657
656
  createPlaneGeometry(t) {
658
- const e = new L(
657
+ const e = new M(
659
658
  t.width,
660
659
  t.height,
661
660
  t.depth
@@ -663,7 +662,7 @@ class St extends N {
663
662
  return e.translate(0, t.height / 2, 0), e;
664
663
  }
665
664
  }
666
- class Pt extends V {
665
+ class Pt extends x {
667
666
  // lines to children
668
667
  constructor() {
669
668
  super();
@@ -782,26 +781,26 @@ class Pt extends V {
782
781
  // this._boxMesh.visible = true;
783
782
  // }
784
783
  }
785
- class vt extends v {
784
+ class vt extends S {
786
785
  constructor() {
787
786
  const t = new ct(1, 1);
788
787
  t.scale(1e3, 1e3, 1), t.rotateX(-Math.PI / 2);
789
- const e = new R({
790
- color: new P(16777215),
788
+ const e = new k({
789
+ color: new E(16777215),
791
790
  side: U
792
791
  });
793
792
  super(t, e);
794
793
  i(this, "isDIVEFloor", !0);
795
- this.name = "Floor", this.layers.mask = f, this.receiveShadow = !0;
794
+ this.name = "Floor", this.layers.mask = m, this.receiveShadow = !0;
796
795
  }
797
796
  setVisibility(t) {
798
797
  this.visible = t;
799
798
  }
800
799
  setColor(t) {
801
- this.material.color = new P(t);
800
+ this.material.color = new E(t);
802
801
  }
803
802
  }
804
- class Mt extends _ {
803
+ class Mt extends g {
805
804
  constructor() {
806
805
  super();
807
806
  i(this, "isDIVERoot", !0);
@@ -812,7 +811,7 @@ class Mt extends _ {
812
811
  return this._floor;
813
812
  }
814
813
  computeSceneBB() {
815
- const t = new g();
814
+ const t = new f();
816
815
  return this.children.forEach((e) => {
817
816
  "isDIVEFloor" in e || e.traverse((a) => {
818
817
  "isObject3D" in a && t.expandByObject(a);
@@ -946,7 +945,7 @@ class Mt extends _ {
946
945
  e.position.x,
947
946
  e.position.y,
948
947
  e.position.z
949
- ), e.intensity !== void 0 && e.intensity !== null && t.setIntensity(e.intensity), e.enabled !== void 0 && e.enabled !== null && t.setEnabled(e.enabled), e.color !== void 0 && e.color !== null && t.setColor(new P(e.color)), e.visible !== void 0 && e.visible !== null && (t.visible = e.visible), e.parentId !== void 0 && this._setParent({ ...e, parentId: e.parentId });
948
+ ), e.intensity !== void 0 && e.intensity !== null && t.setIntensity(e.intensity), e.enabled !== void 0 && e.enabled !== null && t.setEnabled(e.enabled), e.color !== void 0 && e.color !== null && t.setColor(new E(e.color)), e.visible !== void 0 && e.visible !== null && (t.visible = e.visible), e.parentId !== void 0 && this._setParent({ ...e, parentId: e.parentId });
950
949
  }
951
950
  _updateModel(t, e) {
952
951
  e.uri !== void 0 && t.setFromURL(e.uri), e.name !== void 0 && (t.name = e.name), e.position !== void 0 && t.setPosition(e.position), e.rotation !== void 0 && t.setRotation(e.rotation), e.scale !== void 0 && t.setScale(e.scale), e.visible !== void 0 && t.setVisibility(e.visible), e.material !== void 0 && t.setMaterial(e.material), e.parentId !== void 0 && this._setParent({ ...e, parentId: e.parentId });
@@ -994,7 +993,7 @@ class Mt extends _ {
994
993
  }
995
994
  }
996
995
  const Lt = "#888888", It = "#dddddd";
997
- class Tt extends _ {
996
+ class Tt extends g {
998
997
  constructor() {
999
998
  super(), this.name = "Grid";
1000
999
  const s = new ut(
@@ -1009,7 +1008,7 @@ class Tt extends _ {
1009
1008
  this.visible = s;
1010
1009
  }
1011
1010
  }
1012
- const S = {
1011
+ const D = {
1013
1012
  displayFloor: !1,
1014
1013
  displayGrid: !1,
1015
1014
  backgroundColor: "#ffffff"
@@ -1021,11 +1020,11 @@ class kt extends pt {
1021
1020
  i(this, "_root");
1022
1021
  i(this, "_grid");
1023
1022
  this.setBackground(
1024
- (t == null ? void 0 : t.backgroundColor) ?? S.backgroundColor
1023
+ (t == null ? void 0 : t.backgroundColor) ?? D.backgroundColor
1025
1024
  ), this._root = new Mt(), this._root.floor.setVisibility(
1026
- (t == null ? void 0 : t.displayFloor) ?? S.displayFloor
1025
+ (t == null ? void 0 : t.displayFloor) ?? D.displayFloor
1027
1026
  ), this.add(this._root), this._grid = new Tt(), this._grid.setVisibility(
1028
- (t == null ? void 0 : t.displayGrid) ?? S.displayGrid
1027
+ (t == null ? void 0 : t.displayGrid) ?? D.displayGrid
1029
1028
  ), this.add(this._grid);
1030
1029
  }
1031
1030
  get root() {
@@ -1035,11 +1034,14 @@ class kt extends pt {
1035
1034
  return this._grid;
1036
1035
  }
1037
1036
  setBackground(t) {
1038
- this.background = new P(t);
1037
+ this.background = new E(t);
1039
1038
  }
1040
1039
  computeSceneBB() {
1041
1040
  return this._root.computeSceneBB();
1042
1041
  }
1042
+ dispose() {
1043
+ this.remove(this._root), this.remove(this._grid);
1044
+ }
1043
1045
  }
1044
1046
  const xt = {
1045
1047
  enableDamping: !0,
@@ -1071,15 +1073,15 @@ const xt = {
1071
1073
  BOTTOM: "ArrowDown"
1072
1074
  },
1073
1075
  mouseButtons: {
1074
- LEFT: p.ROTATE,
1075
- MIDDLE: p.DOLLY,
1076
- RIGHT: p.PAN
1076
+ LEFT: u.ROTATE,
1077
+ MIDDLE: u.DOLLY,
1078
+ RIGHT: u.PAN
1077
1079
  },
1078
1080
  touches: {
1079
- ONE: m.ROTATE,
1080
- TWO: m.DOLLY_PAN
1081
+ ONE: p.ROTATE,
1082
+ TWO: p.DOLLY_PAN
1081
1083
  }
1082
- }, w = class w extends mt {
1084
+ }, _ = class _ extends mt {
1083
1085
  constructor(t, e, a) {
1084
1086
  super();
1085
1087
  // public API
@@ -1118,20 +1120,20 @@ const xt = {
1118
1120
  BOTTOM: "ArrowDown"
1119
1121
  });
1120
1122
  i(this, "mouseButtons", {
1121
- LEFT: p.ROTATE,
1122
- MIDDLE: p.DOLLY,
1123
- RIGHT: p.PAN
1123
+ LEFT: u.ROTATE,
1124
+ MIDDLE: u.DOLLY,
1125
+ RIGHT: u.PAN
1124
1126
  });
1125
- i(this, "touches", { ONE: m.ROTATE, TWO: m.DOLLY_PAN });
1127
+ i(this, "touches", { ONE: p.ROTATE, TWO: p.DOLLY_PAN });
1126
1128
  i(this, "target0");
1127
1129
  i(this, "position0");
1128
1130
  i(this, "zoom0");
1129
- i(this, "uuid", k.generateUUID());
1131
+ i(this, "uuid", I.generateUUID());
1130
1132
  // private state
1131
1133
  i(this, "state", -1);
1132
1134
  i(this, "EPS", 1e-6);
1133
- i(this, "spherical", new O());
1134
- i(this, "sphericalDelta", new O());
1135
+ i(this, "spherical", new C());
1136
+ i(this, "sphericalDelta", new C());
1135
1137
  i(this, "scale", 1);
1136
1138
  i(this, "panOffset", new h());
1137
1139
  i(this, "zoomChanged", !1);
@@ -1151,7 +1153,7 @@ const xt = {
1151
1153
  i(this, "quat");
1152
1154
  i(this, "quatInverse");
1153
1155
  i(this, "lastPosition", new h());
1154
- i(this, "lastQuaternion", new I());
1156
+ i(this, "lastQuaternion", new O());
1155
1157
  i(this, "lastTarget", new h());
1156
1158
  i(this, "panLeft", (() => {
1157
1159
  const t = new h();
@@ -1181,11 +1183,11 @@ const xt = {
1181
1183
  e = -1;
1182
1184
  }
1183
1185
  switch (e) {
1184
- case p.DOLLY:
1186
+ case u.DOLLY:
1185
1187
  if (this.enableZoom === !1) return;
1186
1188
  this.handleMouseDownDolly(t), this.state = 1;
1187
1189
  break;
1188
- case p.ROTATE:
1190
+ case u.ROTATE:
1189
1191
  if (t.ctrlKey || t.metaKey || t.shiftKey) {
1190
1192
  if (this.enablePan === !1) return;
1191
1193
  this.handleMouseDownPan(t), this.state = 2;
@@ -1194,7 +1196,7 @@ const xt = {
1194
1196
  this.handleMouseDownRotate(t), this.state = 0;
1195
1197
  }
1196
1198
  break;
1197
- case p.PAN:
1199
+ case u.PAN:
1198
1200
  if (t.ctrlKey || t.metaKey || t.shiftKey) {
1199
1201
  if (this.enableRotate === !1) return;
1200
1202
  this.handleMouseDownRotate(t), this.state = 0;
@@ -1235,11 +1237,11 @@ const xt = {
1235
1237
  switch (this.trackPointer(t), this.pointers.length) {
1236
1238
  case 1:
1237
1239
  switch (this.touches.ONE) {
1238
- case m.ROTATE:
1240
+ case p.ROTATE:
1239
1241
  if (this.enableRotate === !1) return;
1240
1242
  this.handleTouchStartRotate(t), this.state = 3;
1241
1243
  break;
1242
- case m.PAN:
1244
+ case p.PAN:
1243
1245
  if (this.enablePan === !1) return;
1244
1246
  this.handleTouchStartPan(t), this.state = 4;
1245
1247
  break;
@@ -1249,12 +1251,12 @@ const xt = {
1249
1251
  break;
1250
1252
  case 2:
1251
1253
  switch (this.touches.TWO) {
1252
- case m.DOLLY_PAN:
1254
+ case p.DOLLY_PAN:
1253
1255
  if (this.enableZoom === !1 && this.enablePan === !1)
1254
1256
  return;
1255
1257
  this.handleTouchStartDollyPan(t), this.state = 5;
1256
1258
  break;
1257
- case m.DOLLY_ROTATE:
1259
+ case p.DOLLY_ROTATE:
1258
1260
  if (this.enableZoom === !1 && this.enableRotate === !1)
1259
1261
  return;
1260
1262
  this.handleTouchStartDollyRotate(t), this.state = 6;
@@ -1316,7 +1318,7 @@ const xt = {
1316
1318
  i(this, "onContextMenu", (t) => {
1317
1319
  this.enabled !== !1 && t.preventDefault();
1318
1320
  });
1319
- this.object = t, this.domElements = Array.isArray(e) ? e : [e], Object.assign(this, a), this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this.quat = new I().setFromUnitVectors(
1321
+ this.object = t, this.domElements = Array.isArray(e) ? e : [e], Object.assign(this, a), this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this.quat = new O().setFromUnitVectors(
1320
1322
  t.up,
1321
1323
  new h(0, 1, 0)
1322
1324
  ), this.quatInverse = this.quat.clone().invert(), this.domElements.forEach((n) => this.addEventListeners(n)), this.update();
@@ -1374,22 +1376,22 @@ const xt = {
1374
1376
  this.removeDomElements(...this.domElements), this.domElements = [], this.addDomElements(...t);
1375
1377
  }
1376
1378
  computeEncompassingView(t, e = 0) {
1377
- const a = t.center, r = t.sphere.radius, l = this.object.fov * (Math.PI / 180), d = this.object.aspect, u = l / 2, y = Math.atan(Math.tan(u) * d), b = r / Math.sin(u), M = r / Math.sin(y), D = Math.max(b, M) * (1 + e), A = this.object.position.clone().sub(this.target).normalize(), X = A.length() > 1e-3 ? A : new h(0, 0, 1);
1379
+ const a = t.center, r = t.sphere.radius, l = this.object.fov * (Math.PI / 180), d = this.object.aspect, P = l / 2, R = Math.atan(Math.tan(P) * d), w = r / Math.sin(P), v = r / Math.sin(R), y = Math.max(w, v) * (1 + e), V = this.object.position.clone().sub(this.target).normalize(), X = V.length() > 1e-3 ? V : new h(0, 0, 1);
1378
1380
  return {
1379
- position: a.clone().add(X.multiplyScalar(D)),
1381
+ position: a.clone().add(X.multiplyScalar(y)),
1380
1382
  target: a
1381
1383
  };
1382
1384
  }
1383
1385
  focusObject(t, e = 0) {
1384
- const a = new T(t), n = this.computeEncompassingView(a, e);
1386
+ const a = new L(t), n = this.computeEncompassingView(a, e);
1385
1387
  this.object.position.copy(n.position), this.target.copy(n.target), this.update();
1386
1388
  }
1387
1389
  zoomIn(t) {
1388
- this.dollyIn(Math.pow(0.95, t ?? w.DEFAULT_ZOOM_FACTOR)), this.update();
1390
+ this.dollyIn(Math.pow(0.95, t ?? _.DEFAULT_ZOOM_FACTOR)), this.update();
1389
1391
  }
1390
1392
  zoomOut(t) {
1391
1393
  this.dollyOut(
1392
- Math.pow(0.95, t ?? w.DEFAULT_ZOOM_FACTOR)
1394
+ Math.pow(0.95, t ?? _.DEFAULT_ZOOM_FACTOR)
1393
1395
  ), this.update();
1394
1396
  }
1395
1397
  getState() {
@@ -1598,8 +1600,8 @@ const xt = {
1598
1600
  );
1599
1601
  }
1600
1602
  };
1601
- i(w, "DEFAULT_ZOOM_FACTOR", 1);
1602
- let G = w;
1603
+ i(_, "DEFAULT_ZOOM_FACTOR", 1);
1604
+ let G = _;
1603
1605
  const Rt = `
1604
1606
  @@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@
1605
1607
  @@@@+-:::::::---------------------==------------------------------=#@@@@
@@ -1635,10 +1637,10 @@ window.DIVE = {
1635
1637
  return window.DIVE.instances[0];
1636
1638
  }
1637
1639
  };
1638
- const E = {
1640
+ const b = {
1639
1641
  autoStart: !0,
1640
1642
  displayAxes: !1,
1641
- ...S,
1643
+ ...D,
1642
1644
  ..._t,
1643
1645
  ...W,
1644
1646
  ...xt
@@ -1646,7 +1648,7 @@ const E = {
1646
1648
  class Vt {
1647
1649
  constructor(s) {
1648
1650
  // descriptive members
1649
- i(this, "_instanceId", k.generateUUID());
1651
+ i(this, "_instanceId", I.generateUUID());
1650
1652
  i(this, "_settings");
1651
1653
  i(this, "_views");
1652
1654
  i(this, "_mainView");
@@ -1654,12 +1656,12 @@ class Vt {
1654
1656
  i(this, "_clock");
1655
1657
  i(this, "_orientationDisplay", null);
1656
1658
  this._settings = {
1657
- ...E,
1659
+ ...b,
1658
1660
  ...s ?? {}
1659
1661
  }, this._clock = new wt(), this._scene = new kt({
1660
- backgroundColor: (s == null ? void 0 : s.backgroundColor) ?? E.backgroundColor,
1661
- displayGrid: (s == null ? void 0 : s.displayGrid) ?? E.displayGrid,
1662
- displayFloor: (s == null ? void 0 : s.displayFloor) ?? E.displayFloor
1662
+ backgroundColor: (s == null ? void 0 : s.backgroundColor) ?? b.backgroundColor,
1663
+ displayGrid: (s == null ? void 0 : s.displayGrid) ?? b.displayGrid,
1664
+ displayFloor: (s == null ? void 0 : s.displayFloor) ?? b.displayFloor
1663
1665
  });
1664
1666
  const t = new B(
1665
1667
  this._scene,
@@ -1674,7 +1676,7 @@ class Vt {
1674
1676
  this.mainView.camera
1675
1677
  ), this._clock.addTicker(this._orientationDisplay);
1676
1678
  }
1677
- ), this._settings.autoStart && this.start(), console.log("DIVE 2.2.16 initialized successfully!"), console.log(Rt), window.DIVE.instances.push(this);
1679
+ ), this._settings.autoStart && this.start(), console.log("DIVE 2.2.17 initialized successfully!"), console.log(Rt), window.DIVE.instances.push(this);
1678
1680
  }
1679
1681
  /**
1680
1682
  * @deprecated This static method will be removed in a future version. Please use `import { QuickView, QuickViewSettings, QuickViewDefaultSettings } from '@shopware-ag/dive/quickview'` instead.
@@ -1732,7 +1734,7 @@ class Vt {
1732
1734
  return new Promise((s) => {
1733
1735
  this._views.forEach((t) => {
1734
1736
  t.dispose();
1735
- }), this._views = [], this._orientationDisplay && (this._clock.removeTicker(this._orientationDisplay), this._orientationDisplay.dispose()), window.DIVE.instances = window.DIVE.instances.filter(
1737
+ }), this._views = [], this._orientationDisplay && (this._clock.removeTicker(this._orientationDisplay), this._orientationDisplay.dispose()), this.scene.dispose(), window.DIVE.instances = window.DIVE.instances.filter(
1736
1738
  (t) => t._instanceId !== this._instanceId
1737
1739
  ), s();
1738
1740
  });
@@ -1770,8 +1772,8 @@ const Ft = Vt, At = {
1770
1772
  (o) => o.extension
1771
1773
  );
1772
1774
  export {
1773
- T as B,
1774
- E as D,
1775
+ L as B,
1776
+ b as D,
1775
1777
  At as F,
1776
1778
  Lt as G,
1777
1779
  xt as O,
@@ -1786,7 +1788,7 @@ export {
1786
1788
  H as h,
1787
1789
  Gt as i,
1788
1790
  yt as j,
1789
- S as k,
1791
+ D as k,
1790
1792
  kt as l,
1791
1793
  B as m,
1792
1794
  It as n,
@@ -1795,7 +1797,7 @@ export {
1795
1797
  Pt as q,
1796
1798
  bt as r,
1797
1799
  Dt as s,
1798
- V as t,
1800
+ x as t,
1799
1801
  St as u,
1800
1802
  Mt as v,
1801
1803
  Z as w