@quick-threejs/reactive 0.1.46 → 0.1.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/worker.mjs CHANGED
@@ -1,88 +1,88 @@
1
- var Ke = Object.defineProperty;
2
- var We = (t, e, i) => e in t ? Ke(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i;
1
+ var Ne = Object.defineProperty;
2
+ var We = (t, e, i) => e in t ? Ne(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i;
3
3
  var a = (t, e, i) => We(t, typeof e != "symbol" ? e + "" : e, i);
4
- import { v as Xe, _ as ve, w as be, O as qe, x as Ne, y as He, B as Be, G as Ve, s as p, L as d, H as Ge, i as h, P as Qe, j as ce, S as N, l as S, m as q, n as x, U as Pe, D as ge, k as Je, p as ke, I as Se, J as et, E as tt, A as it, d as st, f as rt, h as we, C as ot } from "./FontLoader-ejhD_xZ1.mjs";
5
- import { Ray as nt, Plane as at, MathUtils as ht, Vector3 as b, Controls as ct, MOUSE as $, TOUCH as D, Quaternion as ye, Spherical as Ce, Vector2 as v, Timer as lt, PerspectiveCamera as E, OrthographicCamera as I, Camera as j, Scene as Fe, WebGLRenderer as Oe, PCFSoftShadowMap as _t, SRGBColorSpace as pt, CineonToneMapping as dt, AxesHelper as ut, GridHelper as mt, AnimationClip as ft } from "three";
6
- var vt = {
4
+ import { w as Ue, _ as de, x as ue, O as Ye, y as xe, z as ze, B as Fe, G as Ze, s as _, L as d, H as Ke, i as h, P as Ve, j as ce, S as I, l as P, m as X, n as j, J as fe, q as me, k as Xe, p as qe, I as be, M as Be, U as Ge, A as Qe, d as Je, f as ke, h as ve, C as et } from "./FontLoader-YhZm0TOQ.mjs";
5
+ import { Ray as tt, Plane as it, MathUtils as st, Vector3 as v, Controls as rt, MOUSE as E, TOUCH as D, Quaternion as ge, Spherical as we, Vector2 as b, Timer as nt, PerspectiveCamera as O, OrthographicCamera as L, Camera as M, Scene as Le, WebGLRenderer as F, PCFSoftShadowMap as ot, SRGBColorSpace as at, CineonToneMapping as ht, AxesHelper as ct, GridHelper as lt, AnimationClip as pt } from "three";
6
+ var _t = {
7
7
  now: function() {
8
8
  return performance.now();
9
9
  },
10
10
  delegate: void 0
11
- }, B = {
11
+ }, q = {
12
12
  schedule: function(t) {
13
- var e = requestAnimationFrame, i = cancelAnimationFrame, s = B.delegate;
13
+ var e = requestAnimationFrame, i = cancelAnimationFrame, s = q.delegate;
14
14
  s && (e = s.requestAnimationFrame, i = s.cancelAnimationFrame);
15
- var r = e(function(o) {
16
- i = void 0, t(o);
15
+ var r = e(function(n) {
16
+ i = void 0, t(n);
17
17
  });
18
- return new Xe(function() {
18
+ return new Ue(function() {
19
19
  return i == null ? void 0 : i(r);
20
20
  });
21
21
  },
22
22
  requestAnimationFrame: function() {
23
23
  for (var t = [], e = 0; e < arguments.length; e++)
24
24
  t[e] = arguments[e];
25
- return requestAnimationFrame.apply(void 0, ve([], be(t)));
25
+ return requestAnimationFrame.apply(void 0, de([], ue(t)));
26
26
  },
27
27
  cancelAnimationFrame: function() {
28
28
  for (var t = [], e = 0; e < arguments.length; e++)
29
29
  t[e] = arguments[e];
30
- return cancelAnimationFrame.apply(void 0, ve([], be(t)));
30
+ return cancelAnimationFrame.apply(void 0, de([], ue(t)));
31
31
  },
32
32
  delegate: void 0
33
33
  };
34
- function bt(t) {
35
- return t ? Ye(t) : Pt;
34
+ function dt(t) {
35
+ return t ? He(t) : ut;
36
36
  }
37
- function Ye(t) {
38
- return new qe(function(e) {
39
- var i = t || vt, s = i.now(), r = 0, o = function() {
40
- e.closed || (r = B.requestAnimationFrame(function(n) {
37
+ function He(t) {
38
+ return new Ye(function(e) {
39
+ var i = t || _t, s = i.now(), r = 0, n = function() {
40
+ e.closed || (r = q.requestAnimationFrame(function(o) {
41
41
  r = 0;
42
42
  var c = i.now();
43
43
  e.next({
44
- timestamp: t ? c : n,
44
+ timestamp: t ? c : o,
45
45
  elapsed: c - s
46
- }), o();
46
+ }), n();
47
47
  }));
48
48
  };
49
- return o(), function() {
50
- r && B.cancelAnimationFrame(r);
49
+ return n(), function() {
50
+ r && q.cancelAnimationFrame(r);
51
51
  };
52
52
  });
53
53
  }
54
- var Pt = Ye();
55
- function gt(t, e) {
56
- return e === void 0 && (e = !1), Ne(function(i, s) {
54
+ var ut = He();
55
+ function ft(t, e) {
56
+ return e === void 0 && (e = !1), xe(function(i, s) {
57
57
  var r = 0;
58
- i.subscribe(He(s, function(o) {
59
- var n = t(o, r++);
60
- (n || e) && s.next(o), !n && s.complete();
58
+ i.subscribe(ze(s, function(n) {
59
+ var o = t(n, r++);
60
+ (o || e) && s.next(n), !o && s.complete();
61
61
  }));
62
62
  });
63
63
  }
64
- function St(t, e, i) {
65
- var s = Ve(t) || e || i ? { next: t, error: e, complete: i } : t;
66
- return s ? Ne(function(r, o) {
67
- var n;
68
- (n = s.subscribe) === null || n === void 0 || n.call(s);
64
+ function mt(t, e, i) {
65
+ var s = Ze(t) || e || i ? { next: t, error: e, complete: i } : t;
66
+ return s ? xe(function(r, n) {
67
+ var o;
68
+ (o = s.subscribe) === null || o === void 0 || o.call(s);
69
69
  var c = !0;
70
- r.subscribe(He(o, function(l) {
70
+ r.subscribe(ze(n, function(l) {
71
71
  var u;
72
- (u = s.next) === null || u === void 0 || u.call(s, l), o.next(l);
72
+ (u = s.next) === null || u === void 0 || u.call(s, l), n.next(l);
73
73
  }, function() {
74
74
  var l;
75
- c = !1, (l = s.complete) === null || l === void 0 || l.call(s), o.complete();
75
+ c = !1, (l = s.complete) === null || l === void 0 || l.call(s), n.complete();
76
76
  }, function(l) {
77
77
  var u;
78
- c = !1, (u = s.error) === null || u === void 0 || u.call(s, l), o.error(l);
78
+ c = !1, (u = s.error) === null || u === void 0 || u.call(s, l), n.error(l);
79
79
  }, function() {
80
80
  var l, u;
81
81
  c && ((l = s.unsubscribe) === null || l === void 0 || l.call(s)), (u = s.finalize) === null || u === void 0 || u.call(s);
82
82
  }));
83
- }) : Be;
83
+ }) : Fe;
84
84
  }
85
- const De = { type: "change" }, le = { type: "start" }, Ue = { type: "end" }, z = new nt(), Ee = new at(), wt = Math.cos(70 * ht.DEG2RAD), m = new b(), f = 2 * Math.PI, _ = {
85
+ const Pe = { type: "change" }, le = { type: "start" }, Ie = { type: "end" }, H = new tt(), ye = new it(), bt = Math.cos(70 * st.DEG2RAD), f = new v(), m = 2 * Math.PI, p = {
86
86
  NONE: -1,
87
87
  ROTATE: 0,
88
88
  DOLLY: 1,
@@ -92,7 +92,7 @@ const De = { type: "change" }, le = { type: "start" }, Ue = { type: "end" }, z =
92
92
  TOUCH_DOLLY_PAN: 5,
93
93
  TOUCH_DOLLY_ROTATE: 6
94
94
  }, Z = 1e-6;
95
- class $e extends ct {
95
+ class Ce extends rt {
96
96
  /**
97
97
  * Constructs a new controls instance.
98
98
  *
@@ -100,7 +100,7 @@ class $e extends ct {
100
100
  * @param {?HTMLElement} domElement - The HTML element used for event listeners.
101
101
  */
102
102
  constructor(e, i = null) {
103
- super(e, i), this.state = _.NONE, this.target = new b(), this.cursor = new b(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minTargetRadius = 0, this.maxTargetRadius = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.keyRotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }, this.mouseButtons = { LEFT: $.ROTATE, MIDDLE: $.DOLLY, RIGHT: $.PAN }, this.touches = { ONE: D.ROTATE, TWO: D.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._cursorStyle = "auto", this._domElementKeyEvents = null, this._lastPosition = new b(), this._lastQuaternion = new ye(), this._lastTargetPosition = new b(), this._quat = new ye().setFromUnitVectors(e.up, new b(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new Ce(), this._sphericalDelta = new Ce(), this._scale = 1, this._panOffset = new b(), this._rotateStart = new v(), this._rotateEnd = new v(), this._rotateDelta = new v(), this._panStart = new v(), this._panEnd = new v(), this._panDelta = new v(), this._dollyStart = new v(), this._dollyEnd = new v(), this._dollyDelta = new v(), this._dollyDirection = new b(), this._mouse = new v(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = Ct.bind(this), this._onPointerDown = yt.bind(this), this._onPointerUp = Ot.bind(this), this._onContextMenu = jt.bind(this), this._onMouseWheel = $t.bind(this), this._onKeyDown = Rt.bind(this), this._onTouchStart = Tt.bind(this), this._onTouchMove = Mt.bind(this), this._onMouseDown = Dt.bind(this), this._onMouseMove = Et.bind(this), this._interceptControlDown = xt.bind(this), this._interceptControlUp = At.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
103
+ super(e, i), this.state = p.NONE, this.target = new v(), this.cursor = new v(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minTargetRadius = 0, this.maxTargetRadius = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.keyRotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }, this.mouseButtons = { LEFT: E.ROTATE, MIDDLE: E.DOLLY, RIGHT: E.PAN }, this.touches = { ONE: D.ROTATE, TWO: D.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._cursorStyle = "auto", this._domElementKeyEvents = null, this._lastPosition = new v(), this._lastQuaternion = new ge(), this._lastTargetPosition = new v(), this._quat = new ge().setFromUnitVectors(e.up, new v(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new we(), this._sphericalDelta = new we(), this._scale = 1, this._panOffset = new v(), this._rotateStart = new b(), this._rotateEnd = new b(), this._rotateDelta = new b(), this._panStart = new b(), this._panEnd = new b(), this._panDelta = new b(), this._dollyStart = new b(), this._dollyEnd = new b(), this._dollyDelta = new b(), this._dollyDirection = new v(), this._mouse = new b(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = gt.bind(this), this._onPointerDown = vt.bind(this), this._onPointerUp = wt.bind(this), this._onContextMenu = Et.bind(this), this._onMouseWheel = Ct.bind(this), this._onKeyDown = St.bind(this), this._onTouchStart = Ot.bind(this), this._onTouchMove = Dt.bind(this), this._onMouseDown = Pt.bind(this), this._onMouseMove = yt.bind(this), this._interceptControlDown = $t.bind(this), this._interceptControlUp = Rt.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
104
104
  }
105
105
  /**
106
106
  * Defines the visual representation of the cursor.
@@ -173,7 +173,7 @@ class $e extends ct {
173
173
  * was called, or the initial state.
174
174
  */
175
175
  reset() {
176
- this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(De), this.update(), this.state = _.NONE;
176
+ this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(Pe), this.update(), this.state = p.NONE;
177
177
  }
178
178
  /**
179
179
  * Programmatically pan the camera.
@@ -218,41 +218,41 @@ class $e extends ct {
218
218
  }
219
219
  update(e = null) {
220
220
  const i = this.object.position;
221
- m.copy(i).sub(this.target), m.applyQuaternion(this._quat), this._spherical.setFromVector3(m), this.autoRotate && this.state === _.NONE && this._rotateLeft(this._getAutoRotationAngle(e)), this.enableDamping ? (this._spherical.theta += this._sphericalDelta.theta * this.dampingFactor, this._spherical.phi += this._sphericalDelta.phi * this.dampingFactor) : (this._spherical.theta += this._sphericalDelta.theta, this._spherical.phi += this._sphericalDelta.phi);
221
+ f.copy(i).sub(this.target), f.applyQuaternion(this._quat), this._spherical.setFromVector3(f), this.autoRotate && this.state === p.NONE && this._rotateLeft(this._getAutoRotationAngle(e)), this.enableDamping ? (this._spherical.theta += this._sphericalDelta.theta * this.dampingFactor, this._spherical.phi += this._sphericalDelta.phi * this.dampingFactor) : (this._spherical.theta += this._sphericalDelta.theta, this._spherical.phi += this._sphericalDelta.phi);
222
222
  let s = this.minAzimuthAngle, r = this.maxAzimuthAngle;
223
- isFinite(s) && isFinite(r) && (s < -Math.PI ? s += f : s > Math.PI && (s -= f), r < -Math.PI ? r += f : r > Math.PI && (r -= f), s <= r ? this._spherical.theta = Math.max(s, Math.min(r, this._spherical.theta)) : this._spherical.theta = this._spherical.theta > (s + r) / 2 ? Math.max(s, this._spherical.theta) : Math.min(r, this._spherical.theta)), this._spherical.phi = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, this._spherical.phi)), this._spherical.makeSafe(), this.enableDamping === !0 ? this.target.addScaledVector(this._panOffset, this.dampingFactor) : this.target.add(this._panOffset), this.target.sub(this.cursor), this.target.clampLength(this.minTargetRadius, this.maxTargetRadius), this.target.add(this.cursor);
224
- let o = !1;
223
+ isFinite(s) && isFinite(r) && (s < -Math.PI ? s += m : s > Math.PI && (s -= m), r < -Math.PI ? r += m : r > Math.PI && (r -= m), s <= r ? this._spherical.theta = Math.max(s, Math.min(r, this._spherical.theta)) : this._spherical.theta = this._spherical.theta > (s + r) / 2 ? Math.max(s, this._spherical.theta) : Math.min(r, this._spherical.theta)), this._spherical.phi = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, this._spherical.phi)), this._spherical.makeSafe(), this.enableDamping === !0 ? this.target.addScaledVector(this._panOffset, this.dampingFactor) : this.target.add(this._panOffset), this.target.sub(this.cursor), this.target.clampLength(this.minTargetRadius, this.maxTargetRadius), this.target.add(this.cursor);
224
+ let n = !1;
225
225
  if (this.zoomToCursor && this._performCursorZoom || this.object.isOrthographicCamera)
226
226
  this._spherical.radius = this._clampDistance(this._spherical.radius);
227
227
  else {
228
- const n = this._spherical.radius;
229
- this._spherical.radius = this._clampDistance(this._spherical.radius * this._scale), o = n != this._spherical.radius;
228
+ const o = this._spherical.radius;
229
+ this._spherical.radius = this._clampDistance(this._spherical.radius * this._scale), n = o != this._spherical.radius;
230
230
  }
231
- if (m.setFromSpherical(this._spherical), m.applyQuaternion(this._quatInverse), i.copy(this.target).add(m), this.object.lookAt(this.target), this.enableDamping === !0 ? (this._sphericalDelta.theta *= 1 - this.dampingFactor, this._sphericalDelta.phi *= 1 - this.dampingFactor, this._panOffset.multiplyScalar(1 - this.dampingFactor)) : (this._sphericalDelta.set(0, 0, 0), this._panOffset.set(0, 0, 0)), this.zoomToCursor && this._performCursorZoom) {
232
- let n = null;
231
+ if (f.setFromSpherical(this._spherical), f.applyQuaternion(this._quatInverse), i.copy(this.target).add(f), this.object.lookAt(this.target), this.enableDamping === !0 ? (this._sphericalDelta.theta *= 1 - this.dampingFactor, this._sphericalDelta.phi *= 1 - this.dampingFactor, this._panOffset.multiplyScalar(1 - this.dampingFactor)) : (this._sphericalDelta.set(0, 0, 0), this._panOffset.set(0, 0, 0)), this.zoomToCursor && this._performCursorZoom) {
232
+ let o = null;
233
233
  if (this.object.isPerspectiveCamera) {
234
- const c = m.length();
235
- n = this._clampDistance(c * this._scale);
236
- const l = c - n;
237
- this.object.position.addScaledVector(this._dollyDirection, l), this.object.updateMatrixWorld(), o = !!l;
234
+ const c = f.length();
235
+ o = this._clampDistance(c * this._scale);
236
+ const l = c - o;
237
+ this.object.position.addScaledVector(this._dollyDirection, l), this.object.updateMatrixWorld(), n = !!l;
238
238
  } else if (this.object.isOrthographicCamera) {
239
- const c = new b(this._mouse.x, this._mouse.y, 0);
239
+ const c = new v(this._mouse.x, this._mouse.y, 0);
240
240
  c.unproject(this.object);
241
241
  const l = this.object.zoom;
242
- this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), this.object.updateProjectionMatrix(), o = l !== this.object.zoom;
243
- const u = new b(this._mouse.x, this._mouse.y, 0);
244
- u.unproject(this.object), this.object.position.sub(u).add(c), this.object.updateMatrixWorld(), n = m.length();
242
+ this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), this.object.updateProjectionMatrix(), n = l !== this.object.zoom;
243
+ const u = new v(this._mouse.x, this._mouse.y, 0);
244
+ u.unproject(this.object), this.object.position.sub(u).add(c), this.object.updateMatrixWorld(), o = f.length();
245
245
  } else
246
246
  console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
247
- n !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(n).add(this.object.position) : (z.origin.copy(this.object.position), z.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(z.direction)) < wt ? this.object.lookAt(this.target) : (Ee.setFromNormalAndCoplanarPoint(this.object.up, this.target), z.intersectPlane(Ee, this.target))));
247
+ o !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(o).add(this.object.position) : (H.origin.copy(this.object.position), H.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(H.direction)) < bt ? this.object.lookAt(this.target) : (ye.setFromNormalAndCoplanarPoint(this.object.up, this.target), H.intersectPlane(ye, this.target))));
248
248
  } else if (this.object.isOrthographicCamera) {
249
- const n = this.object.zoom;
250
- this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), n !== this.object.zoom && (this.object.updateProjectionMatrix(), o = !0);
249
+ const o = this.object.zoom;
250
+ this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), o !== this.object.zoom && (this.object.updateProjectionMatrix(), n = !0);
251
251
  }
252
- return this._scale = 1, this._performCursorZoom = !1, o || this._lastPosition.distanceToSquared(this.object.position) > Z || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > Z || this._lastTargetPosition.distanceToSquared(this.target) > Z ? (this.dispatchEvent(De), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;
252
+ return this._scale = 1, this._performCursorZoom = !1, n || this._lastPosition.distanceToSquared(this.object.position) > Z || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > Z || this._lastTargetPosition.distanceToSquared(this.target) > Z ? (this.dispatchEvent(Pe), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;
253
253
  }
254
254
  _getAutoRotationAngle(e) {
255
- return e !== null ? f / 60 * this.autoRotateSpeed * e : f / 60 / 60 * this.autoRotateSpeed;
255
+ return e !== null ? m / 60 * this.autoRotateSpeed * e : m / 60 / 60 * this.autoRotateSpeed;
256
256
  }
257
257
  _getZoomScale(e) {
258
258
  const i = Math.abs(e * 0.01);
@@ -265,19 +265,19 @@ class $e extends ct {
265
265
  this._sphericalDelta.phi -= e;
266
266
  }
267
267
  _panLeft(e, i) {
268
- m.setFromMatrixColumn(i, 0), m.multiplyScalar(-e), this._panOffset.add(m);
268
+ f.setFromMatrixColumn(i, 0), f.multiplyScalar(-e), this._panOffset.add(f);
269
269
  }
270
270
  _panUp(e, i) {
271
- this.screenSpacePanning === !0 ? m.setFromMatrixColumn(i, 1) : (m.setFromMatrixColumn(i, 0), m.crossVectors(this.object.up, m)), m.multiplyScalar(e), this._panOffset.add(m);
271
+ this.screenSpacePanning === !0 ? f.setFromMatrixColumn(i, 1) : (f.setFromMatrixColumn(i, 0), f.crossVectors(this.object.up, f)), f.multiplyScalar(e), this._panOffset.add(f);
272
272
  }
273
273
  // deltaX and deltaY are in pixels; right and down are positive
274
274
  _pan(e, i) {
275
275
  const s = this.domElement;
276
276
  if (this.object.isPerspectiveCamera) {
277
277
  const r = this.object.position;
278
- m.copy(r).sub(this.target);
279
- let o = m.length();
280
- o *= Math.tan(this.object.fov / 2 * Math.PI / 180), this._panLeft(2 * e * o / s.clientHeight, this.object.matrix), this._panUp(2 * i * o / s.clientHeight, this.object.matrix);
278
+ f.copy(r).sub(this.target);
279
+ let n = f.length();
280
+ n *= Math.tan(this.object.fov / 2 * Math.PI / 180), this._panLeft(2 * e * n / s.clientHeight, this.object.matrix), this._panUp(2 * i * n / s.clientHeight, this.object.matrix);
281
281
  } else this.object.isOrthographicCamera ? (this._panLeft(e * (this.object.right - this.object.left) / this.object.zoom / s.clientWidth, this.object.matrix), this._panUp(i * (this.object.top - this.object.bottom) / this.object.zoom / s.clientHeight, this.object.matrix)) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."), this.enablePan = !1);
282
282
  }
283
283
  _dollyOut(e) {
@@ -290,8 +290,8 @@ class $e extends ct {
290
290
  if (!this.zoomToCursor)
291
291
  return;
292
292
  this._performCursorZoom = !0;
293
- const s = this.domElement.getBoundingClientRect(), r = e - s.left, o = i - s.top, n = s.width, c = s.height;
294
- this._mouse.x = r / n * 2 - 1, this._mouse.y = -(o / c) * 2 + 1, this._dollyDirection.set(this._mouse.x, this._mouse.y, 1).unproject(this.object).sub(this.object.position).normalize();
293
+ const s = this.domElement.getBoundingClientRect(), r = e - s.left, n = i - s.top, o = s.width, c = s.height;
294
+ this._mouse.x = r / o * 2 - 1, this._mouse.y = -(n / c) * 2 + 1, this._dollyDirection.set(this._mouse.x, this._mouse.y, 1).unproject(this.object).sub(this.object.position).normalize();
295
295
  }
296
296
  _clampDistance(e) {
297
297
  return Math.max(this.minDistance, Math.min(this.maxDistance, e));
@@ -311,7 +311,7 @@ class $e extends ct {
311
311
  _handleMouseMoveRotate(e) {
312
312
  this._rotateEnd.set(e.clientX, e.clientY), this._rotateDelta.subVectors(this._rotateEnd, this._rotateStart).multiplyScalar(this.rotateSpeed);
313
313
  const i = this.domElement;
314
- this._rotateLeft(f * this._rotateDelta.x / i.clientHeight), this._rotateUp(f * this._rotateDelta.y / i.clientHeight), this._rotateStart.copy(this._rotateEnd), this.update();
314
+ this._rotateLeft(m * this._rotateDelta.x / i.clientHeight), this._rotateUp(m * this._rotateDelta.y / i.clientHeight), this._rotateStart.copy(this._rotateEnd), this.update();
315
315
  }
316
316
  _handleMouseMoveDolly(e) {
317
317
  this._dollyEnd.set(e.clientX, e.clientY), this._dollyDelta.subVectors(this._dollyEnd, this._dollyStart), this._dollyDelta.y > 0 ? this._dollyOut(this._getZoomScale(this._dollyDelta.y)) : this._dollyDelta.y < 0 && this._dollyIn(this._getZoomScale(this._dollyDelta.y)), this._dollyStart.copy(this._dollyEnd), this.update();
@@ -326,16 +326,16 @@ class $e extends ct {
326
326
  let i = !1;
327
327
  switch (e.code) {
328
328
  case this.keys.UP:
329
- e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateUp(f * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(0, this.keyPanSpeed), i = !0;
329
+ e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateUp(m * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(0, this.keyPanSpeed), i = !0;
330
330
  break;
331
331
  case this.keys.BOTTOM:
332
- e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateUp(-f * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(0, -this.keyPanSpeed), i = !0;
332
+ e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateUp(-m * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(0, -this.keyPanSpeed), i = !0;
333
333
  break;
334
334
  case this.keys.LEFT:
335
- e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateLeft(f * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(this.keyPanSpeed, 0), i = !0;
335
+ e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateLeft(m * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(this.keyPanSpeed, 0), i = !0;
336
336
  break;
337
337
  case this.keys.RIGHT:
338
- e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateLeft(-f * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(-this.keyPanSpeed, 0), i = !0;
338
+ e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateLeft(-m * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(-this.keyPanSpeed, 0), i = !0;
339
339
  break;
340
340
  }
341
341
  i && (e.preventDefault(), this.update());
@@ -357,8 +357,8 @@ class $e extends ct {
357
357
  }
358
358
  }
359
359
  _handleTouchStartDolly(e) {
360
- const i = this._getSecondPointerPosition(e), s = e.pageX - i.x, r = e.pageY - i.y, o = Math.sqrt(s * s + r * r);
361
- this._dollyStart.set(0, o);
360
+ const i = this._getSecondPointerPosition(e), s = e.pageX - i.x, r = e.pageY - i.y, n = Math.sqrt(s * s + r * r);
361
+ this._dollyStart.set(0, n);
362
362
  }
363
363
  _handleTouchStartDollyPan(e) {
364
364
  this.enableZoom && this._handleTouchStartDolly(e), this.enablePan && this._handleTouchStartPan(e);
@@ -370,12 +370,12 @@ class $e extends ct {
370
370
  if (this._pointers.length == 1)
371
371
  this._rotateEnd.set(e.pageX, e.pageY);
372
372
  else {
373
- const s = this._getSecondPointerPosition(e), r = 0.5 * (e.pageX + s.x), o = 0.5 * (e.pageY + s.y);
374
- this._rotateEnd.set(r, o);
373
+ const s = this._getSecondPointerPosition(e), r = 0.5 * (e.pageX + s.x), n = 0.5 * (e.pageY + s.y);
374
+ this._rotateEnd.set(r, n);
375
375
  }
376
376
  this._rotateDelta.subVectors(this._rotateEnd, this._rotateStart).multiplyScalar(this.rotateSpeed);
377
377
  const i = this.domElement;
378
- this._rotateLeft(f * this._rotateDelta.x / i.clientHeight), this._rotateUp(f * this._rotateDelta.y / i.clientHeight), this._rotateStart.copy(this._rotateEnd);
378
+ this._rotateLeft(m * this._rotateDelta.x / i.clientHeight), this._rotateUp(m * this._rotateDelta.y / i.clientHeight), this._rotateStart.copy(this._rotateEnd);
379
379
  }
380
380
  _handleTouchMovePan(e) {
381
381
  if (this._pointers.length === 1)
@@ -387,10 +387,10 @@ class $e extends ct {
387
387
  this._panDelta.subVectors(this._panEnd, this._panStart).multiplyScalar(this.panSpeed), this._pan(this._panDelta.x, this._panDelta.y), this._panStart.copy(this._panEnd);
388
388
  }
389
389
  _handleTouchMoveDolly(e) {
390
- const i = this._getSecondPointerPosition(e), s = e.pageX - i.x, r = e.pageY - i.y, o = Math.sqrt(s * s + r * r);
391
- this._dollyEnd.set(0, o), this._dollyDelta.set(0, Math.pow(this._dollyEnd.y / this._dollyStart.y, this.zoomSpeed)), this._dollyOut(this._dollyDelta.y), this._dollyStart.copy(this._dollyEnd);
392
- const n = (e.pageX + i.x) * 0.5, c = (e.pageY + i.y) * 0.5;
393
- this._updateZoomParameters(n, c);
390
+ const i = this._getSecondPointerPosition(e), s = e.pageX - i.x, r = e.pageY - i.y, n = Math.sqrt(s * s + r * r);
391
+ this._dollyEnd.set(0, n), this._dollyDelta.set(0, Math.pow(this._dollyEnd.y / this._dollyStart.y, this.zoomSpeed)), this._dollyOut(this._dollyDelta.y), this._dollyStart.copy(this._dollyEnd);
392
+ const o = (e.pageX + i.x) * 0.5, c = (e.pageY + i.y) * 0.5;
393
+ this._updateZoomParameters(o, c);
394
394
  }
395
395
  _handleTouchMoveDollyPan(e) {
396
396
  this.enableZoom && this._handleTouchMoveDolly(e), this.enablePan && this._handleTouchMovePan(e);
@@ -417,7 +417,7 @@ class $e extends ct {
417
417
  }
418
418
  _trackPointer(e) {
419
419
  let i = this._pointerPositions[e.pointerId];
420
- i === void 0 && (i = new v(), this._pointerPositions[e.pointerId] = i), i.set(e.pageX, e.pageY);
420
+ i === void 0 && (i = new b(), this._pointerPositions[e.pointerId] = i), i.set(e.pageX, e.pageY);
421
421
  }
422
422
  _getSecondPointerPosition(e) {
423
423
  const i = e.pointerId === this._pointers[0] ? this._pointers[1] : this._pointers[0];
@@ -441,16 +441,16 @@ class $e extends ct {
441
441
  return e.ctrlKey && !this._controlActive && (s.deltaY *= 10), s;
442
442
  }
443
443
  }
444
- function yt(t) {
444
+ function vt(t) {
445
445
  this.enabled !== !1 && (this._pointers.length === 0 && (this.domElement.setPointerCapture(t.pointerId), this.domElement.ownerDocument.addEventListener("pointermove", this._onPointerMove), this.domElement.ownerDocument.addEventListener("pointerup", this._onPointerUp)), !this._isTrackingPointer(t) && (this._addPointer(t), t.pointerType === "touch" ? this._onTouchStart(t) : this._onMouseDown(t), this._cursorStyle === "grab" && (this.domElement.style.cursor = "grabbing")));
446
446
  }
447
- function Ct(t) {
447
+ function gt(t) {
448
448
  this.enabled !== !1 && (t.pointerType === "touch" ? this._onTouchMove(t) : this._onMouseMove(t));
449
449
  }
450
- function Ot(t) {
450
+ function wt(t) {
451
451
  switch (this._removePointer(t), this._pointers.length) {
452
452
  case 0:
453
- this.domElement.releasePointerCapture(t.pointerId), this.domElement.ownerDocument.removeEventListener("pointermove", this._onPointerMove), this.domElement.ownerDocument.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(Ue), this.state = _.NONE, this._cursorStyle === "grab" && (this.domElement.style.cursor = "grab");
453
+ this.domElement.releasePointerCapture(t.pointerId), this.domElement.ownerDocument.removeEventListener("pointermove", this._onPointerMove), this.domElement.ownerDocument.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(Ie), this.state = p.NONE, this._cursorStyle === "grab" && (this.domElement.style.cursor = "grab");
454
454
  break;
455
455
  case 1:
456
456
  const e = this._pointers[0], i = this._pointerPositions[e];
@@ -458,7 +458,7 @@ function Ot(t) {
458
458
  break;
459
459
  }
460
460
  }
461
- function Dt(t) {
461
+ function Pt(t) {
462
462
  let e;
463
463
  switch (t.button) {
464
464
  case 0:
@@ -474,132 +474,136 @@ function Dt(t) {
474
474
  e = -1;
475
475
  }
476
476
  switch (e) {
477
- case $.DOLLY:
477
+ case E.DOLLY:
478
478
  if (this.enableZoom === !1) return;
479
- this._handleMouseDownDolly(t), this.state = _.DOLLY;
479
+ this._handleMouseDownDolly(t), this.state = p.DOLLY;
480
480
  break;
481
- case $.ROTATE:
481
+ case E.ROTATE:
482
482
  if (t.ctrlKey || t.metaKey || t.shiftKey) {
483
483
  if (this.enablePan === !1) return;
484
- this._handleMouseDownPan(t), this.state = _.PAN;
484
+ this._handleMouseDownPan(t), this.state = p.PAN;
485
485
  } else {
486
486
  if (this.enableRotate === !1) return;
487
- this._handleMouseDownRotate(t), this.state = _.ROTATE;
487
+ this._handleMouseDownRotate(t), this.state = p.ROTATE;
488
488
  }
489
489
  break;
490
- case $.PAN:
490
+ case E.PAN:
491
491
  if (t.ctrlKey || t.metaKey || t.shiftKey) {
492
492
  if (this.enableRotate === !1) return;
493
- this._handleMouseDownRotate(t), this.state = _.ROTATE;
493
+ this._handleMouseDownRotate(t), this.state = p.ROTATE;
494
494
  } else {
495
495
  if (this.enablePan === !1) return;
496
- this._handleMouseDownPan(t), this.state = _.PAN;
496
+ this._handleMouseDownPan(t), this.state = p.PAN;
497
497
  }
498
498
  break;
499
499
  default:
500
- this.state = _.NONE;
500
+ this.state = p.NONE;
501
501
  }
502
- this.state !== _.NONE && this.dispatchEvent(le);
502
+ this.state !== p.NONE && this.dispatchEvent(le);
503
503
  }
504
- function Et(t) {
504
+ function yt(t) {
505
505
  switch (this.state) {
506
- case _.ROTATE:
506
+ case p.ROTATE:
507
507
  if (this.enableRotate === !1) return;
508
508
  this._handleMouseMoveRotate(t);
509
509
  break;
510
- case _.DOLLY:
510
+ case p.DOLLY:
511
511
  if (this.enableZoom === !1) return;
512
512
  this._handleMouseMoveDolly(t);
513
513
  break;
514
- case _.PAN:
514
+ case p.PAN:
515
515
  if (this.enablePan === !1) return;
516
516
  this._handleMouseMovePan(t);
517
517
  break;
518
518
  }
519
519
  }
520
- function $t(t) {
521
- this.enabled === !1 || this.enableZoom === !1 || this.state !== _.NONE || (t.preventDefault(), this.dispatchEvent(le), this._handleMouseWheel(this._customWheelEvent(t)), this.dispatchEvent(Ue));
520
+ function Ct(t) {
521
+ this.enabled === !1 || this.enableZoom === !1 || this.state !== p.NONE || (t.preventDefault(), this.dispatchEvent(le), this._handleMouseWheel(this._customWheelEvent(t)), this.dispatchEvent(Ie));
522
522
  }
523
- function Rt(t) {
523
+ function St(t) {
524
524
  this.enabled !== !1 && this._handleKeyDown(t);
525
525
  }
526
- function Tt(t) {
526
+ function Ot(t) {
527
527
  switch (this._trackPointer(t), this._pointers.length) {
528
528
  case 1:
529
529
  switch (this.touches.ONE) {
530
530
  case D.ROTATE:
531
531
  if (this.enableRotate === !1) return;
532
- this._handleTouchStartRotate(t), this.state = _.TOUCH_ROTATE;
532
+ this._handleTouchStartRotate(t), this.state = p.TOUCH_ROTATE;
533
533
  break;
534
534
  case D.PAN:
535
535
  if (this.enablePan === !1) return;
536
- this._handleTouchStartPan(t), this.state = _.TOUCH_PAN;
536
+ this._handleTouchStartPan(t), this.state = p.TOUCH_PAN;
537
537
  break;
538
538
  default:
539
- this.state = _.NONE;
539
+ this.state = p.NONE;
540
540
  }
541
541
  break;
542
542
  case 2:
543
543
  switch (this.touches.TWO) {
544
544
  case D.DOLLY_PAN:
545
545
  if (this.enableZoom === !1 && this.enablePan === !1) return;
546
- this._handleTouchStartDollyPan(t), this.state = _.TOUCH_DOLLY_PAN;
546
+ this._handleTouchStartDollyPan(t), this.state = p.TOUCH_DOLLY_PAN;
547
547
  break;
548
548
  case D.DOLLY_ROTATE:
549
549
  if (this.enableZoom === !1 && this.enableRotate === !1) return;
550
- this._handleTouchStartDollyRotate(t), this.state = _.TOUCH_DOLLY_ROTATE;
550
+ this._handleTouchStartDollyRotate(t), this.state = p.TOUCH_DOLLY_ROTATE;
551
551
  break;
552
552
  default:
553
- this.state = _.NONE;
553
+ this.state = p.NONE;
554
554
  }
555
555
  break;
556
556
  default:
557
- this.state = _.NONE;
557
+ this.state = p.NONE;
558
558
  }
559
- this.state !== _.NONE && this.dispatchEvent(le);
559
+ this.state !== p.NONE && this.dispatchEvent(le);
560
560
  }
561
- function Mt(t) {
561
+ function Dt(t) {
562
562
  switch (this._trackPointer(t), this.state) {
563
- case _.TOUCH_ROTATE:
563
+ case p.TOUCH_ROTATE:
564
564
  if (this.enableRotate === !1) return;
565
565
  this._handleTouchMoveRotate(t), this.update();
566
566
  break;
567
- case _.TOUCH_PAN:
567
+ case p.TOUCH_PAN:
568
568
  if (this.enablePan === !1) return;
569
569
  this._handleTouchMovePan(t), this.update();
570
570
  break;
571
- case _.TOUCH_DOLLY_PAN:
571
+ case p.TOUCH_DOLLY_PAN:
572
572
  if (this.enableZoom === !1 && this.enablePan === !1) return;
573
573
  this._handleTouchMoveDollyPan(t), this.update();
574
574
  break;
575
- case _.TOUCH_DOLLY_ROTATE:
575
+ case p.TOUCH_DOLLY_ROTATE:
576
576
  if (this.enableZoom === !1 && this.enableRotate === !1) return;
577
577
  this._handleTouchMoveDollyRotate(t), this.update();
578
578
  break;
579
579
  default:
580
- this.state = _.NONE;
580
+ this.state = p.NONE;
581
581
  }
582
582
  }
583
- function jt(t) {
583
+ function Et(t) {
584
584
  this.enabled !== !1 && t.preventDefault();
585
585
  }
586
- function xt(t) {
586
+ function $t(t) {
587
587
  t.key === "Control" && (this._controlActive = !0, this.domElement.getRootNode().addEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
588
588
  }
589
- function At(t) {
589
+ function Rt(t) {
590
590
  t.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
591
591
  }
592
- var Lt = Object.defineProperty, zt = Object.getOwnPropertyDescriptor, It = (t, e, i, s) => {
593
- for (var r = s > 1 ? void 0 : s ? zt(e, i) : e, o = t.length - 1, n; o >= 0; o--)
594
- (n = t[o]) && (r = (s ? n(e, i, r) : n(r)) || r);
595
- return s && r && Lt(e, i, r), r;
592
+ var Tt = Object.defineProperty, Mt = Object.getOwnPropertyDescriptor, jt = (t, e, i, s) => {
593
+ for (var r = s > 1 ? void 0 : s ? Mt(e, i) : e, n = t.length - 1, o; n >= 0; n--)
594
+ (o = t[n]) && (r = (s ? o(e, i, r) : o(r)) || r);
595
+ return s && r && Tt(e, i, r), r;
596
596
  };
597
597
  let A = class {
598
598
  constructor() {
599
599
  a(this, "_canvas");
600
- a(this, "proxyReceiver", new Ge());
600
+ a(this, "proxyReceiver", new Ke());
601
601
  a(this, "isInitialized", !1);
602
602
  }
603
+ init(t) {
604
+ if (!t) throw new Error("Core App Canvas is not initialized.");
605
+ this.canvas = t, this.isInitialized = !0;
606
+ }
603
607
  get canvas() {
604
608
  return this._canvas;
605
609
  }
@@ -610,19 +614,19 @@ let A = class {
610
614
  }, this._canvas = t;
611
615
  }
612
616
  };
613
- A = It([
614
- p(d.ContainerScoped)
617
+ A = jt([
618
+ _(d.ContainerScoped)
615
619
  ], A);
616
- var Nt = Object.defineProperty, Ht = Object.getOwnPropertyDescriptor, Ft = (t, e, i, s) => {
617
- for (var r = s > 1 ? void 0 : s ? Ht(e, i) : e, o = t.length - 1, n; o >= 0; o--)
618
- (n = t[o]) && (r = (s ? n(e, i, r) : n(r)) || r);
619
- return s && r && Nt(e, i, r), r;
620
- }, Yt = (t, e) => (i, s) => e(i, s, t);
621
- let H = class extends Qe {
620
+ var At = Object.defineProperty, xt = Object.getOwnPropertyDescriptor, zt = (t, e, i, s) => {
621
+ for (var r = s > 1 ? void 0 : s ? xt(e, i) : e, n = t.length - 1, o; n >= 0; n--)
622
+ (o = t[n]) && (r = (s ? o(e, i, r) : o(r)) || r);
623
+ return s && r && At(e, i, r), r;
624
+ }, Lt = (t, e) => (i, s) => e(i, s, t);
625
+ let N = class extends Ve {
622
626
  constructor(t) {
623
627
  super(), this._service = t;
624
628
  for (const e of ce)
625
- this[`${e}$$`] = new N(), this[`${e}$`] = this[`${e}$$`].pipe(), this[e] = (i) => {
629
+ this[`${e}$$`] = new I(), this[`${e}$`] = this[`${e}$$`].pipe(), this[e] = (i) => {
626
630
  const s = {
627
631
  ...i,
628
632
  type: i.type || e
@@ -631,20 +635,20 @@ let H = class extends Qe {
631
635
  };
632
636
  }
633
637
  };
634
- H = Ft([
635
- p(d.ContainerScoped),
636
- Yt(0, h(A))
637
- ], H);
638
- var Ut = Object.defineProperty, Zt = Object.getOwnPropertyDescriptor, Kt = (t, e, i, s) => {
639
- for (var r = s > 1 ? void 0 : s ? Zt(e, i) : e, o = t.length - 1, n; o >= 0; o--)
640
- (n = t[o]) && (r = (s ? n(e, i, r) : n(r)) || r);
641
- return s && r && Ut(e, i, r), r;
638
+ N = zt([
639
+ _(d.ContainerScoped),
640
+ Lt(0, h(A))
641
+ ], N);
642
+ var Ht = Object.defineProperty, It = Object.getOwnPropertyDescriptor, Nt = (t, e, i, s) => {
643
+ for (var r = s > 1 ? void 0 : s ? It(e, i) : e, n = t.length - 1, o; n >= 0; n--)
644
+ (o = t[n]) && (r = (s ? o(e, i, r) : o(r)) || r);
645
+ return s && r && Ht(e, i, r), r;
642
646
  };
643
- let F = class {
647
+ let W = class {
644
648
  constructor() {
645
649
  a(this, "fps", 60);
646
650
  a(this, "frame", 1e3 / this.fps);
647
- a(this, "timer", new lt());
651
+ a(this, "timer", new nt());
648
652
  a(this, "initialTime", Date.now());
649
653
  a(this, "elapsed", 0);
650
654
  a(this, "previousDelta", 0);
@@ -659,42 +663,42 @@ let F = class {
659
663
  this.timer.update(), this.elapsed = this.timer.getElapsed(), this.delta = this.elapsed - this.previousDelta, this.previousDelta = this.elapsed, this.deltaRatio = this.delta / this.frame;
660
664
  }
661
665
  };
662
- F = Kt([
663
- p(d.ContainerScoped)
664
- ], F);
665
- var Wt = Object.defineProperty, Xt = Object.getOwnPropertyDescriptor, qt = (t, e, i, s) => {
666
- for (var r = s > 1 ? void 0 : s ? Xt(e, i) : e, o = t.length - 1, n; o >= 0; o--)
667
- (n = t[o]) && (r = (s ? n(e, i, r) : n(r)) || r);
666
+ W = Nt([
667
+ _(d.ContainerScoped)
668
+ ], W);
669
+ var Wt = Object.defineProperty, Ut = Object.getOwnPropertyDescriptor, Yt = (t, e, i, s) => {
670
+ for (var r = s > 1 ? void 0 : s ? Ut(e, i) : e, n = t.length - 1, o; n >= 0; n--)
671
+ (o = t[n]) && (r = (s ? o(e, i, r) : o(r)) || r);
668
672
  return s && r && Wt(e, i, r), r;
669
- }, Bt = (t, e) => (i, s) => e(i, s, t);
670
- let R = class {
673
+ }, Ft = (t, e) => (i, s) => e(i, s, t);
674
+ let $ = class {
671
675
  constructor(t) {
672
- a(this, "_beforeStep$$", new N());
676
+ a(this, "_beforeStep$$", new I());
673
677
  a(this, "_oldElapsed", 0);
674
678
  a(this, "beforeStep$", this._beforeStep$$.asObservable());
675
- a(this, "step$", bt().pipe(
676
- St(({ elapsed: t }) => {
679
+ a(this, "step$", dt().pipe(
680
+ mt(({ elapsed: t }) => {
677
681
  var e;
678
- this._oldElapsed !== t && ((e = this._beforeStep$$) == null || e.next(Pe(this._service, [])), this._oldElapsed = t);
682
+ this._oldElapsed !== t && ((e = this._beforeStep$$) == null || e.next(fe(this._service, [])), this._oldElapsed = t);
679
683
  }),
680
- S(() => this._service.enabled),
681
- gt(() => this._service.enabled),
682
- q(() => Pe(this._service, [])),
683
- x()
684
+ P(() => this._service.enabled),
685
+ ft(() => this._service.enabled),
686
+ X(() => fe(this._service, [])),
687
+ j()
684
688
  ));
685
689
  this._service = t;
686
690
  }
687
691
  };
688
- R = qt([
689
- p(d.ContainerScoped),
690
- Bt(0, h(F))
691
- ], R);
692
- var Vt = Object.defineProperty, Gt = Object.getOwnPropertyDescriptor, Qt = (t, e, i, s) => {
693
- for (var r = s > 1 ? void 0 : s ? Gt(e, i) : e, o = t.length - 1, n; o >= 0; o--)
694
- (n = t[o]) && (r = (s ? n(e, i, r) : n(r)) || r);
695
- return s && r && Vt(e, i, r), r;
696
- }, Re = (t, e) => (i, s) => e(i, s, t);
697
- let V = class {
692
+ $ = Yt([
693
+ _(d.ContainerScoped),
694
+ Ft(0, h(W))
695
+ ], $);
696
+ var Zt = Object.defineProperty, Kt = Object.getOwnPropertyDescriptor, Vt = (t, e, i, s) => {
697
+ for (var r = s > 1 ? void 0 : s ? Kt(e, i) : e, n = t.length - 1, o; n >= 0; n--)
698
+ (o = t[n]) && (r = (s ? o(e, i, r) : o(r)) || r);
699
+ return s && r && Zt(e, i, r), r;
700
+ }, Se = (t, e) => (i, s) => e(i, s, t);
701
+ let B = class {
698
702
  constructor(t, e) {
699
703
  a(this, "_initialAnimationFrameId");
700
704
  a(this, "_subscriptions", []);
@@ -718,7 +722,7 @@ let V = class {
718
722
  return typeof t == "boolean" && (this._service.enabled = t), this._service.enabled;
719
723
  }
720
724
  dispose() {
721
- this._initialAnimationFrameId !== void 0 && cancelAnimationFrame(this._initialAnimationFrameId), this._service.enabled = !1;
725
+ this._initialAnimationFrameId !== void 0 && cancelAnimationFrame(this._initialAnimationFrameId), this._service.enabled = !1, this._subscriptions.forEach((t) => t.unsubscribe()), this._subscriptions = [];
722
726
  }
723
727
  beforeStep$() {
724
728
  return this._controller.beforeStep$;
@@ -727,46 +731,61 @@ let V = class {
727
731
  return this._controller.step$;
728
732
  }
729
733
  };
730
- V = Qt([
731
- p(d.ContainerScoped),
732
- Re(0, h(R)),
733
- Re(1, h(F))
734
- ], V);
735
- var Jt = Object.defineProperty, kt = Object.getOwnPropertyDescriptor, ei = (t, e, i, s) => {
736
- for (var r = s > 1 ? void 0 : s ? kt(e, i) : e, o = t.length - 1, n; o >= 0; o--)
737
- (n = t[o]) && (r = (s ? n(e, i, r) : n(r)) || r);
738
- return s && r && Jt(e, i, r), r;
734
+ B = Vt([
735
+ _(d.ContainerScoped),
736
+ Se(0, h($)),
737
+ Se(1, h(W))
738
+ ], B);
739
+ var Xt = Object.defineProperty, qt = Object.getOwnPropertyDescriptor, Bt = (t, e, i, s) => {
740
+ for (var r = s > 1 ? void 0 : s ? qt(e, i) : e, n = t.length - 1, o; n >= 0; n--)
741
+ (o = t[n]) && (r = (s ? o(e, i, r) : o(r)) || r);
742
+ return s && r && Xt(e, i, r), r;
739
743
  };
740
- let w = class {
744
+ let C = class {
741
745
  constructor() {
742
746
  a(this, "width", 0);
743
747
  a(this, "height", 0);
748
+ a(this, "wrapperWidth", 0);
749
+ a(this, "wrapperHeight", 0);
750
+ a(this, "windowWidth", 0);
751
+ a(this, "windowHeight", 0);
744
752
  a(this, "aspect", 0);
745
- a(this, "pixelRatio", 0);
753
+ a(this, "pixelRatio", 1);
746
754
  a(this, "frustrum", 5);
747
755
  a(this, "enabled", !0);
756
+ a(this, "fullscreen", !1);
757
+ a(this, "hasCanvasWrapper", !1);
758
+ }
759
+ init(t, e = 1, i = !0, s = !1, r = !0) {
760
+ this.height = Number(t.height ?? this.height), this.width = Number(t.width ?? this.width), this.aspect = this.width / this.height, this.pixelRatio = typeof e == "number" ? e : 1, this.fullscreen = i, this.hasCanvasWrapper = s, this.enabled = r;
748
761
  }
749
- init(t, e) {
750
- this.height = Number(t.height ?? this.height), this.width = Number(t.width ?? this.width), this.aspect = this.width / this.height, this.enabled = e === void 0 ? !0 : !!e;
762
+ handleResize(t) {
763
+ this.width = t.width, this.height = t.height, this.wrapperWidth = t.wrapperWidth, this.wrapperHeight = t.wrapperHeight, this.windowWidth = t.windowWidth, this.windowHeight = t.windowHeight, this.aspect = this.fullscreen ? t.windowWidth / t.windowHeight : this.hasCanvasWrapper ? t.wrapperWidth / t.wrapperHeight : t.width / t.height, console.log("size", this);
764
+ }
765
+ getViewPortSizes() {
766
+ return {
767
+ width: this.fullscreen ? this.windowWidth : this.hasCanvasWrapper ? this.wrapperWidth : this.width,
768
+ height: this.fullscreen ? this.windowHeight : this.hasCanvasWrapper ? this.wrapperHeight : this.height
769
+ };
751
770
  }
752
771
  };
753
- w = ei([
754
- p(d.ContainerScoped)
755
- ], w);
756
- var ti = Object.defineProperty, ii = Object.getOwnPropertyDescriptor, si = (t, e, i, s) => {
757
- for (var r = s > 1 ? void 0 : s ? ii(e, i) : e, o = t.length - 1, n; o >= 0; o--)
758
- (n = t[o]) && (r = (s ? n(e, i, r) : n(r)) || r);
759
- return s && r && ti(e, i, r), r;
760
- }, ri = (t, e) => (i, s) => e(i, s, t);
761
- let y = class {
772
+ C = Bt([
773
+ _(d.ContainerScoped)
774
+ ], C);
775
+ var Gt = Object.defineProperty, Qt = Object.getOwnPropertyDescriptor, Jt = (t, e, i, s) => {
776
+ for (var r = s > 1 ? void 0 : s ? Qt(e, i) : e, n = t.length - 1, o; n >= 0; n--)
777
+ (o = t[n]) && (r = (s ? o(e, i, r) : o(r)) || r);
778
+ return s && r && Gt(e, i, r), r;
779
+ }, kt = (t, e) => (i, s) => e(i, s, t);
780
+ let S = class {
762
781
  constructor(t) {
763
782
  a(this, "instance");
764
783
  a(this, "enabled", !0);
765
- this._sizesService = t;
784
+ this._sizes = t;
766
785
  }
767
786
  set aspectRatio(t) {
768
787
  var e;
769
- this.instance instanceof E && (this.instance.aspect = t), (this.instance instanceof E || this.instance instanceof I) && ((e = this.instance) == null || e.updateProjectionMatrix());
788
+ this.instance instanceof O && (this.instance.aspect = t), (this.instance instanceof O || this.instance instanceof L) && ((e = this.instance) == null || e.updateProjectionMatrix());
770
789
  }
771
790
  set quaternion(t) {
772
791
  var e;
@@ -781,66 +800,64 @@ let y = class {
781
800
  (e = this.instance) == null || e.rotation.copy(t);
782
801
  }
783
802
  init(t) {
784
- if (this.dispose(), t === ge.PERSPECTIVE || t === void 0) {
785
- this.instance = new E(
786
- 70,
787
- this._sizesService.width / this._sizesService.height,
788
- 0.1,
789
- 100
790
- ), this.instance.position.z = 8;
803
+ if (this.dispose(), t === me.PERSPECTIVE || t === void 0) {
804
+ this.instance = new O(70, this._sizes.aspect, 0.1, 100), this.instance.position.z = 8;
791
805
  return;
792
806
  }
793
- t === ge.ORTHOGRAPHIC && (this.instance = new I(
794
- -this._sizesService.aspect * this._sizesService.frustrum / 2,
795
- this._sizesService.aspect * this._sizesService.frustrum / 2,
796
- this._sizesService.frustrum / 2,
797
- -this._sizesService.frustrum / 2,
807
+ t === me.ORTHOGRAPHIC && (this.instance = new L(
808
+ -this._sizes.aspect * this._sizes.frustrum / 2,
809
+ this._sizes.aspect * this._sizes.frustrum / 2,
810
+ this._sizes.frustrum / 2,
811
+ -this._sizes.frustrum / 2,
798
812
  -50,
799
813
  50
800
814
  ));
801
815
  }
816
+ handleStep() {
817
+ var t;
818
+ this.aspectRatio = this._sizes.aspect, (this.instance instanceof O || this.instance instanceof L) && ((t = this.instance) == null || t.updateProjectionMatrix());
819
+ }
802
820
  dispose() {
803
- this.instance instanceof j && ((this.instance instanceof E || this.instance instanceof I) && this.instance.clearViewOffset(), this.instance.clear(), this.instance = void 0);
821
+ this.instance instanceof M && ((this.instance instanceof O || this.instance instanceof L) && this.instance.clearViewOffset(), this.instance.clear(), this.instance = void 0);
804
822
  }
805
823
  };
806
- y = si([
807
- p(d.ContainerScoped),
808
- ri(0, h(w))
809
- ], y);
810
- var oi = Object.defineProperty, ni = Object.getOwnPropertyDescriptor, ai = (t, e, i, s) => {
811
- for (var r = s > 1 ? void 0 : s ? ni(e, i) : e, o = t.length - 1, n; o >= 0; o--)
812
- (n = t[o]) && (r = (s ? n(e, i, r) : n(r)) || r);
813
- return s && r && oi(e, i, r), r;
814
- }, Te = (t, e) => (i, s) => e(i, s, t);
824
+ S = Jt([
825
+ _(d.ContainerScoped),
826
+ kt(0, h(C))
827
+ ], S);
828
+ var ei = Object.defineProperty, ti = Object.getOwnPropertyDescriptor, ii = (t, e, i, s) => {
829
+ for (var r = s > 1 ? void 0 : s ? ti(e, i) : e, n = t.length - 1, o; n >= 0; n--)
830
+ (o = t[n]) && (r = (s ? o(e, i, r) : o(r)) || r);
831
+ return s && r && ei(e, i, r), r;
832
+ }, Oe = (t, e) => (i, s) => e(i, s, t);
815
833
  let G = class {
816
834
  constructor(t, e) {
817
835
  a(this, "step$");
818
836
  this.timerController = t, this._service = e, this.step$ = this.timerController.step$.pipe(
819
- S(() => this._service.enabled)
837
+ P(() => this._service.enabled)
820
838
  );
821
839
  }
822
840
  };
823
- G = ai([
824
- p(d.ContainerScoped),
825
- Te(0, h(R)),
826
- Te(1, h(y))
841
+ G = ii([
842
+ _(d.ContainerScoped),
843
+ Oe(0, h($)),
844
+ Oe(1, h(S))
827
845
  ], G);
828
- var hi = Object.defineProperty, ci = Object.getOwnPropertyDescriptor, li = (t, e, i, s) => {
829
- for (var r = s > 1 ? void 0 : s ? ci(e, i) : e, o = t.length - 1, n; o >= 0; o--)
830
- (n = t[o]) && (r = (s ? n(e, i, r) : n(r)) || r);
831
- return s && r && hi(e, i, r), r;
832
- }, K = (t, e) => (i, s) => e(i, s, t);
846
+ var si = Object.defineProperty, ri = Object.getOwnPropertyDescriptor, ni = (t, e, i, s) => {
847
+ for (var r = s > 1 ? void 0 : s ? ri(e, i) : e, n = t.length - 1, o; n >= 0; n--)
848
+ (o = t[n]) && (r = (s ? o(e, i, r) : o(r)) || r);
849
+ return s && r && si(e, i, r), r;
850
+ }, De = (t, e) => (i, s) => e(i, s, t);
833
851
  let Q = class {
834
- constructor(t, e, i) {
852
+ constructor(t, e) {
835
853
  a(this, "_subscriptions", []);
836
- this._sizesService = t, this._controller = e, this._service = i;
854
+ this._controller = t, this._service = e;
837
855
  }
838
856
  init() {
839
857
  this._service.init(), this._subscriptions.push(
840
- this._controller.step$.subscribe(() => {
841
- var t;
842
- this._service.enabled && (this._service.aspectRatio = this._sizesService.aspect, (this._service.instance instanceof E || this._service.instance instanceof I) && ((t = this._service.instance) == null || t.updateProjectionMatrix()));
843
- })
858
+ this._controller.step$.subscribe(
859
+ this._service.handleStep.bind(this._service)
860
+ )
844
861
  );
845
862
  }
846
863
  enabled(t) {
@@ -859,42 +876,42 @@ let Q = class {
859
876
  return t && (this._service.quaternion = t), this._service.quaternion;
860
877
  }
861
878
  dispose() {
862
- this._subscriptions.forEach((t) => t.unsubscribe()), this._service.dispose();
879
+ this._subscriptions.forEach((t) => t.unsubscribe()), this._subscriptions = [], this._service.dispose();
863
880
  }
864
881
  };
865
- Q = li([
866
- p(d.ContainerScoped),
867
- K(0, h(w)),
868
- K(1, h(G)),
869
- K(2, h(y))
882
+ Q = ni([
883
+ _(d.ContainerScoped),
884
+ De(0, h(G)),
885
+ De(1, h(S))
870
886
  ], Q);
871
- var _i = Object.defineProperty, pi = Object.getOwnPropertyDescriptor, di = (t, e, i, s) => {
872
- for (var r = s > 1 ? void 0 : s ? pi(e, i) : e, o = t.length - 1, n; o >= 0; o--)
873
- (n = t[o]) && (r = (s ? n(e, i, r) : n(r)) || r);
874
- return s && r && _i(e, i, r), r;
887
+ var oi = Object.defineProperty, ai = Object.getOwnPropertyDescriptor, hi = (t, e, i, s) => {
888
+ for (var r = s > 1 ? void 0 : s ? ai(e, i) : e, n = t.length - 1, o; n >= 0; n--)
889
+ (o = t[n]) && (r = (s ? o(e, i, r) : o(r)) || r);
890
+ return s && r && oi(e, i, r), r;
875
891
  };
876
- let T = class {
892
+ let R = class {
877
893
  constructor() {
878
- a(this, "scene", new Fe());
894
+ a(this, "scene", new Le());
879
895
  a(this, "enabled", !0);
880
896
  }
881
897
  };
882
- T = di([
883
- p(d.ContainerScoped)
884
- ], T);
885
- var Ze = Object.defineProperty, ui = Object.getOwnPropertyDescriptor, mi = (t, e, i) => e in t ? Ze(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i, fi = (t, e, i, s) => {
886
- for (var r = s > 1 ? void 0 : s ? ui(e, i) : e, o = t.length - 1, n; o >= 0; o--)
887
- (n = t[o]) && (r = (s ? n(e, i, r) : n(r)) || r);
888
- return s && r && Ze(e, i, r), r;
889
- }, W = (t, e) => (i, s) => e(i, s, t), vi = (t, e, i) => mi(t, e + "", i);
890
- let C = class {
898
+ R = hi([
899
+ _(d.ContainerScoped)
900
+ ], R);
901
+ var ci = Object.defineProperty, li = Object.getOwnPropertyDescriptor, pi = (t, e, i, s) => {
902
+ for (var r = s > 1 ? void 0 : s ? li(e, i) : e, n = t.length - 1, o; n >= 0; n--)
903
+ (o = t[n]) && (r = (s ? o(e, i, r) : o(r)) || r);
904
+ return s && r && ci(e, i, r), r;
905
+ }, K = (t, e) => (i, s) => e(i, s, t);
906
+ let x = class {
891
907
  constructor(t, e, i) {
892
908
  a(this, "enabled", !0);
909
+ a(this, "enabledAutoResize", !0);
893
910
  a(this, "instance");
894
- this._worldService = t, this._cameraService = e, this._sizesService = i;
911
+ this._worldService = t, this._cameraService = e, this._sizes = i;
895
912
  }
896
- setWebGLRenderer(t) {
897
- this.instance = new Oe({
913
+ init(t) {
914
+ this.instance = new F({
898
915
  canvas: t,
899
916
  context: t.getContext("webgl2", {
900
917
  stencil: !0,
@@ -903,125 +920,137 @@ let C = class {
903
920
  powerPreference: "high-performance",
904
921
  depth: !0,
905
922
  antialias: !0
906
- }), this.instance.autoClear = !1, this.instance.setPixelRatio(C.RENDERER_PIXEL_RATIO), this.instance.setClearColor(0, 0), this.instance.shadowMap.enabled = !0, this.instance.shadowMap.type = _t, this.instance.outputColorSpace = pt, this.instance.toneMapping = dt, this.instance.toneMappingExposure = 1.75;
923
+ }), this.instance.autoClear = !1, this.instance.setPixelRatio(this._sizes.pixelRatio), this.instance.setClearColor(0, 0), this.instance.shadowMap.enabled = !0, this.instance.shadowMap.type = ot, this.instance.outputColorSpace = at, this.instance.toneMapping = ht, this.instance.toneMappingExposure = 1.75;
907
924
  }
908
- setSize(t, e) {
925
+ handleAutoResize() {
909
926
  var i;
927
+ if (!this.enabledAutoResize || !(this.instance instanceof F))
928
+ return;
929
+ const { width: t, height: e } = this._sizes.getViewPortSizes();
910
930
  (i = this.instance) == null || i.setSize(t, e);
911
931
  }
912
932
  render() {
913
- this.enabled && this._cameraService.instance instanceof j && this.instance instanceof Oe && (this.instance.setViewport(
914
- 0,
915
- 0,
916
- this._sizesService.width,
917
- this._sizesService.height
918
- ), this.instance.render(
933
+ if (!(this._cameraService.instance instanceof M) || !(this.instance instanceof F))
934
+ return;
935
+ const t = this._sizes.fullscreen ? this._sizes.windowWidth : this._sizes.hasCanvasWrapper ? this._sizes.wrapperWidth : this._sizes.width, e = this._sizes.fullscreen ? this._sizes.windowHeight : this._sizes.hasCanvasWrapper ? this._sizes.wrapperHeight : this._sizes.height;
936
+ this.instance.setViewport(0, 0, t, e), this.instance.render(
919
937
  this._worldService.scene,
920
938
  this._cameraService.instance
921
- ));
939
+ );
922
940
  }
923
941
  };
924
- vi(C, "RENDERER_PIXEL_RATIO", 1);
925
- C = fi([
926
- p(d.ContainerScoped),
927
- W(0, h(T)),
928
- W(1, h(y)),
929
- W(2, h(w))
930
- ], C);
931
- var bi = Object.defineProperty, Pi = Object.getOwnPropertyDescriptor, gi = (t, e, i, s) => {
932
- for (var r = s > 1 ? void 0 : s ? Pi(e, i) : e, o = t.length - 1, n; o >= 0; o--)
933
- (n = t[o]) && (r = (s ? n(e, i, r) : n(r)) || r);
934
- return s && r && bi(e, i, r), r;
935
- }, Me = (t, e) => (i, s) => e(i, s, t);
936
- let Y = class {
942
+ x = pi([
943
+ _(d.ContainerScoped),
944
+ K(0, h(R)),
945
+ K(1, h(S)),
946
+ K(2, h(C))
947
+ ], x);
948
+ var _i = Object.defineProperty, di = Object.getOwnPropertyDescriptor, ui = (t, e, i, s) => {
949
+ for (var r = s > 1 ? void 0 : s ? di(e, i) : e, n = t.length - 1, o; n >= 0; n--)
950
+ (o = t[n]) && (r = (s ? o(e, i, r) : o(r)) || r);
951
+ return s && r && _i(e, i, r), r;
952
+ }, Ee = (t, e) => (i, s) => e(i, s, t);
953
+ let U = class {
937
954
  constructor(t, e) {
938
955
  a(this, "resize$");
939
956
  this._appController = t, this._service = e, this.resize$ = this._appController.resize$$.pipe(
940
- S(() => this._service.enabled)
957
+ P(() => this._service.enabled)
941
958
  );
942
959
  }
943
960
  };
944
- Y = gi([
945
- p(d.ContainerScoped),
946
- Me(0, h(H)),
947
- Me(1, h(w))
948
- ], Y);
949
- var Si = Object.defineProperty, wi = Object.getOwnPropertyDescriptor, yi = (t, e, i, s) => {
950
- for (var r = s > 1 ? void 0 : s ? wi(e, i) : e, o = t.length - 1, n; o >= 0; o--)
951
- (n = t[o]) && (r = (s ? n(e, i, r) : n(r)) || r);
952
- return s && r && Si(e, i, r), r;
953
- }, X = (t, e) => (i, s) => e(i, s, t);
961
+ U = ui([
962
+ _(d.ContainerScoped),
963
+ Ee(0, h(N)),
964
+ Ee(1, h(C))
965
+ ], U);
966
+ var fi = Object.defineProperty, mi = Object.getOwnPropertyDescriptor, bi = (t, e, i, s) => {
967
+ for (var r = s > 1 ? void 0 : s ? mi(e, i) : e, n = t.length - 1, o; n >= 0; n--)
968
+ (o = t[n]) && (r = (s ? o(e, i, r) : o(r)) || r);
969
+ return s && r && fi(e, i, r), r;
970
+ }, V = (t, e) => (i, s) => e(i, s, t);
954
971
  let J = class {
955
972
  constructor(t, e, i) {
956
973
  a(this, "step$");
957
974
  a(this, "resize$");
958
975
  this._service = t, this._timerController = e, this._sizesController = i, this.step$ = this._timerController.step$.pipe(
959
- S(() => this._service.enabled)
976
+ P(() => this._service.enabled)
960
977
  ), this.resize$ = this._sizesController.resize$.pipe(
961
- S(() => this._service.enabled)
978
+ P(() => this._service.enabled)
962
979
  );
963
980
  }
964
981
  };
965
- J = yi([
966
- p(d.ContainerScoped),
967
- X(0, h(C)),
968
- X(1, h(R)),
969
- X(2, h(Y))
982
+ J = bi([
983
+ _(d.ContainerScoped),
984
+ V(0, h(x)),
985
+ V(1, h($)),
986
+ V(2, h(U))
970
987
  ], J);
971
- var Ci = Object.defineProperty, Oi = Object.getOwnPropertyDescriptor, Di = (t, e, i, s) => {
972
- for (var r = s > 1 ? void 0 : s ? Oi(e, i) : e, o = t.length - 1, n; o >= 0; o--)
973
- (n = t[o]) && (r = (s ? n(e, i, r) : n(r)) || r);
974
- return s && r && Ci(e, i, r), r;
975
- }, je = (t, e) => (i, s) => e(i, s, t);
988
+ var vi = Object.defineProperty, gi = Object.getOwnPropertyDescriptor, wi = (t, e, i, s) => {
989
+ for (var r = s > 1 ? void 0 : s ? gi(e, i) : e, n = t.length - 1, o; n >= 0; n--)
990
+ (o = t[n]) && (r = (s ? o(e, i, r) : o(r)) || r);
991
+ return s && r && vi(e, i, r), r;
992
+ }, $e = (t, e) => (i, s) => e(i, s, t);
976
993
  let k = class {
977
994
  constructor(t, e) {
995
+ a(this, "_subscriptions", []);
978
996
  this._controller = t, this._service = e;
979
997
  }
980
- init(t) {
981
- this._controller.step$.subscribe(() => this._service.render()), this._controller.resize$.subscribe(
982
- (e) => this._service.setSize(e.windowWidth, e.windowHeight)
983
- ), this._service.setWebGLRenderer(t);
998
+ init({ canvas: t }) {
999
+ this._subscriptions.push(
1000
+ this._controller.step$.subscribe(
1001
+ this._service.render.bind(this._service)
1002
+ ),
1003
+ this._controller.resize$.subscribe(
1004
+ this._service.handleAutoResize.bind(this._service)
1005
+ )
1006
+ ), this._service.init(t);
984
1007
  }
985
1008
  enabled(t) {
986
1009
  return typeof t == "boolean" && (this._service.enabled = t), this._service.enabled;
987
1010
  }
1011
+ enabledAutoResize(t) {
1012
+ return typeof t == "boolean" && (this._service.enabledAutoResize = t), this._service.enabledAutoResize;
1013
+ }
988
1014
  instance() {
989
1015
  return this._service.instance;
990
1016
  }
991
- setSize(t) {
992
- return this._service.setSize(t.x, t.y);
993
- }
994
1017
  render() {
995
1018
  return this._service.render();
996
1019
  }
997
1020
  dispose() {
998
1021
  var t;
999
- (t = this._service.instance) == null || t.dispose(), this._service.instance = void 0;
1022
+ this._subscriptions.forEach((e) => e.unsubscribe()), this._subscriptions = [], (t = this._service.instance) == null || t.dispose(), this._service.instance = void 0;
1000
1023
  }
1001
1024
  };
1002
- k = Di([
1003
- p(d.ContainerScoped),
1004
- je(0, h(J)),
1005
- je(1, h(C))
1025
+ k = wi([
1026
+ _(d.ContainerScoped),
1027
+ $e(0, h(J)),
1028
+ $e(1, h(x))
1006
1029
  ], k);
1007
- var Ei = Object.defineProperty, $i = Object.getOwnPropertyDescriptor, Ri = (t, e, i, s) => {
1008
- for (var r = s > 1 ? void 0 : s ? $i(e, i) : e, o = t.length - 1, n; o >= 0; o--)
1009
- (n = t[o]) && (r = (s ? n(e, i, r) : n(r)) || r);
1010
- return s && r && Ei(e, i, r), r;
1011
- }, xe = (t, e) => (i, s) => e(i, s, t);
1030
+ var Pi = Object.defineProperty, yi = Object.getOwnPropertyDescriptor, Ci = (t, e, i, s) => {
1031
+ for (var r = s > 1 ? void 0 : s ? yi(e, i) : e, n = t.length - 1, o; n >= 0; n--)
1032
+ (o = t[n]) && (r = (s ? o(e, i, r) : o(r)) || r);
1033
+ return s && r && Pi(e, i, r), r;
1034
+ }, Re = (t, e) => (i, s) => e(i, s, t);
1012
1035
  let ee = class {
1013
1036
  constructor(t, e) {
1037
+ a(this, "_subscriptions", []);
1014
1038
  this._controller = t, this._service = e;
1015
1039
  }
1016
- init(t) {
1017
- this._controller.resize$.subscribe((e) => {
1018
- this._service.width = e.windowWidth, this._service.height = e.windowHeight, this._service.aspect = e.windowWidth / e.windowHeight;
1019
- }), this._service.init(t);
1040
+ init({
1041
+ canvas: t,
1042
+ pixelRatio: e,
1043
+ fullScreen: i,
1044
+ hasCanvasWrapper: s
1045
+ }) {
1046
+ this._subscriptions.push(
1047
+ this._controller.resize$.subscribe(
1048
+ this._service.handleResize.bind(this._service)
1049
+ )
1050
+ ), this._service.init(t, e, i, s);
1020
1051
  }
1021
1052
  dispose() {
1022
- }
1023
- aspect(t) {
1024
- return typeof t == "number" && (this._service.aspect = t), this._service.aspect;
1053
+ this._subscriptions.forEach((t) => t.unsubscribe()), this._subscriptions = [];
1025
1054
  }
1026
1055
  enabled(t) {
1027
1056
  return typeof t == "boolean" && (this._service.enabled = t), this._service.enabled;
@@ -1032,44 +1061,62 @@ let ee = class {
1032
1061
  height(t) {
1033
1062
  return typeof t == "number" && (this._service.height = t), this._service.height;
1034
1063
  }
1064
+ width(t) {
1065
+ return typeof t == "number" && (this._service.width = t), this._service.width;
1066
+ }
1067
+ wrapperHeight(t) {
1068
+ return typeof t == "number" && (this._service.wrapperHeight = t), this._service.wrapperHeight;
1069
+ }
1070
+ wrapperWidth(t) {
1071
+ return typeof t == "number" && (this._service.wrapperWidth = t), this._service.wrapperWidth;
1072
+ }
1073
+ windowHeight(t) {
1074
+ return typeof t == "number" && (this._service.windowHeight = t), this._service.windowHeight;
1075
+ }
1076
+ windowWidth(t) {
1077
+ return typeof t == "number" && (this._service.windowWidth = t), this._service.windowWidth;
1078
+ }
1079
+ aspect(t) {
1080
+ return typeof t == "number" && (this._service.aspect = t), this._service.aspect;
1081
+ }
1035
1082
  pixelRatio(t) {
1036
1083
  return typeof t == "number" && (this._service.pixelRatio = t), this._service.pixelRatio;
1037
1084
  }
1038
- width(t) {
1039
- return typeof t == "number" && (this._service.width = t), this._service.width;
1085
+ getViewPortSizes() {
1086
+ return this._service.getViewPortSizes();
1040
1087
  }
1041
1088
  resize$() {
1042
1089
  return this._controller.resize$;
1043
1090
  }
1044
1091
  };
1045
- ee = Ri([
1046
- p(d.ContainerScoped),
1047
- xe(0, h(Y)),
1048
- xe(1, h(w))
1092
+ ee = Ci([
1093
+ _(d.ContainerScoped),
1094
+ Re(0, h(U)),
1095
+ Re(1, h(C))
1049
1096
  ], ee);
1050
- var Ti = Object.defineProperty, Mi = Object.getOwnPropertyDescriptor, ji = (t, e, i, s) => {
1051
- for (var r = s > 1 ? void 0 : s ? Mi(e, i) : e, o = t.length - 1, n; o >= 0; o--)
1052
- (n = t[o]) && (r = (s ? n(e, i, r) : n(r)) || r);
1053
- return s && r && Ti(e, i, r), r;
1054
- }, xi = (t, e) => (i, s) => e(i, s, t);
1097
+ var Si = Object.defineProperty, Oi = Object.getOwnPropertyDescriptor, Di = (t, e, i, s) => {
1098
+ for (var r = s > 1 ? void 0 : s ? Oi(e, i) : e, n = t.length - 1, o; n >= 0; n--)
1099
+ (o = t[n]) && (r = (s ? o(e, i, r) : o(r)) || r);
1100
+ return s && r && Si(e, i, r), r;
1101
+ }, Ei = (t, e) => (i, s) => e(i, s, t);
1055
1102
  let te = class {
1056
1103
  constructor(t) {
1057
- a(this, "_beforeRender$$", new N());
1058
- a(this, "_afterRender$$", new N());
1059
- a(this, "beforeRender$", this._beforeRender$$.pipe(x()));
1060
- a(this, "afterRender$", this._afterRender$$.pipe(x()));
1104
+ a(this, "_beforeRender$$", new I());
1105
+ a(this, "_afterRender$$", new I());
1106
+ a(this, "beforeRender$", this._beforeRender$$.pipe(j()));
1107
+ a(this, "afterRender$", this._afterRender$$.pipe(j()));
1061
1108
  this._worldService = t, this._worldService.scene.onBeforeRender = () => this._beforeRender$$.next({}), this._worldService.scene.onAfterRender = () => this._afterRender$$.next({});
1062
1109
  }
1063
1110
  };
1064
- te = ji([
1065
- p(d.ContainerScoped),
1066
- xi(0, h(T))
1111
+ te = Di([
1112
+ _(d.ContainerScoped),
1113
+ Ei(0, h(R))
1067
1114
  ], te);
1068
- var Ai = Object.defineProperty, Li = Object.getOwnPropertyDescriptor, zi = (t, e, i, s) => {
1069
- for (var r = s > 1 ? void 0 : s ? Li(e, i) : e, o = t.length - 1, n; o >= 0; o--)
1070
- (n = t[o]) && (r = (s ? n(e, i, r) : n(r)) || r);
1071
- return s && r && Ai(e, i, r), r;
1072
- }, Ae = (t, e) => (i, s) => e(i, s, t);
1115
+ var $i = Object.defineProperty, Ri = Object.getOwnPropertyDescriptor, Ti = (t, e, i, s) => {
1116
+ for (var r = s > 1 ? void 0 : s ? Ri(e, i) : e, n = t.length - 1, o; n >= 0; n--)
1117
+ (o = t[n]) && (r = (s ? o(e, i, r) : o(r)) || r);
1118
+ return s && r && $i(e, i, r), r;
1119
+ }, Te = (t, e) => (i, s) => e(i, s, t);
1073
1120
  let ie = class {
1074
1121
  constructor(t, e) {
1075
1122
  this._service = t, this._controller = e;
@@ -1079,7 +1126,7 @@ let ie = class {
1079
1126
  dispose() {
1080
1127
  }
1081
1128
  scene(t) {
1082
- return t instanceof Fe && (this._service.scene = t), this._service.scene;
1129
+ return t instanceof Le && (this._service.scene = t), this._service.scene;
1083
1130
  }
1084
1131
  enabled(t) {
1085
1132
  return typeof t == "boolean" && (this._service.enabled = t), this._service.enabled;
@@ -1091,16 +1138,16 @@ let ie = class {
1091
1138
  return this._controller.afterRender$;
1092
1139
  }
1093
1140
  };
1094
- ie = zi([
1095
- p(d.ContainerScoped),
1096
- Ae(0, h(T)),
1097
- Ae(1, h(te))
1141
+ ie = Ti([
1142
+ _(d.ContainerScoped),
1143
+ Te(0, h(R)),
1144
+ Te(1, h(te))
1098
1145
  ], ie);
1099
- var Ii = Object.defineProperty, Ni = Object.getOwnPropertyDescriptor, Hi = (t, e, i, s) => {
1100
- for (var r = s > 1 ? void 0 : s ? Ni(e, i) : e, o = t.length - 1, n; o >= 0; o--)
1101
- (n = t[o]) && (r = (s ? n(e, i, r) : n(r)) || r);
1102
- return s && r && Ii(e, i, r), r;
1103
- }, M = (t, e) => (i, s) => e(i, s, t);
1146
+ var Mi = Object.defineProperty, ji = Object.getOwnPropertyDescriptor, Ai = (t, e, i, s) => {
1147
+ for (var r = s > 1 ? void 0 : s ? ji(e, i) : e, n = t.length - 1, o; n >= 0; n--)
1148
+ (o = t[n]) && (r = (s ? o(e, i, r) : o(r)) || r);
1149
+ return s && r && Mi(e, i, r), r;
1150
+ }, T = (t, e) => (i, s) => e(i, s, t);
1104
1151
  let se = class {
1105
1152
  constructor(t, e, i, s, r) {
1106
1153
  a(this, "enabled", !1);
@@ -1109,54 +1156,51 @@ let se = class {
1109
1156
  a(this, "miniCameraControls");
1110
1157
  a(this, "axesHelper");
1111
1158
  a(this, "gridHelper");
1112
- this._appService = t, this._sizesService = e, this._rendererService = i, this._cameraService = s, this._worldService = r;
1159
+ this._appService = t, this._sizes = e, this._rendererService = i, this._cameraService = s, this._worldService = r;
1113
1160
  }
1114
1161
  _renderMiniCamera() {
1115
- var t, e, i, s, r;
1116
- !this.enabled || !this.miniCamera || ((t = this._rendererService.instance) == null || t.setScissorTest(!0), (e = this._rendererService.instance) == null || e.setViewport(
1117
- this._sizesService.width - this._sizesService.width / 3,
1118
- this._sizesService.height - this._sizesService.height / 3,
1119
- this._sizesService.width / 3,
1120
- this._sizesService.height / 3
1121
- ), (i = this._rendererService.instance) == null || i.setScissor(
1122
- this._sizesService.width - this._sizesService.width / 3,
1123
- this._sizesService.height - this._sizesService.height / 3,
1124
- this._sizesService.width / 3,
1125
- this._sizesService.height / 3
1126
- ), (s = this._rendererService.instance) == null || s.render(
1162
+ var i, s, r, n, o;
1163
+ if (!this.enabled || !this.miniCamera) return;
1164
+ const { width: t, height: e } = this._sizes.getViewPortSizes();
1165
+ (i = this._rendererService.instance) == null || i.setScissorTest(!0), (s = this._rendererService.instance) == null || s.setViewport(
1166
+ t - t / 3,
1167
+ e - e / 3,
1168
+ t / 3,
1169
+ e / 3
1170
+ ), (r = this._rendererService.instance) == null || r.setScissor(
1171
+ t - t / 3,
1172
+ e - e / 3,
1173
+ t / 3,
1174
+ e / 3
1175
+ ), (n = this._rendererService.instance) == null || n.render(
1127
1176
  this._worldService.scene,
1128
1177
  this.miniCamera
1129
- ), (r = this._rendererService.instance) == null || r.setScissorTest(!1));
1178
+ ), (o = this._rendererService.instance) == null || o.setScissorTest(!1);
1130
1179
  }
1131
1180
  initMiniCamera() {
1132
- this.disposeMiniCamera(), this.enabled && (this.miniCamera = new E(
1133
- 75,
1134
- this._sizesService.width / this._sizesService.height,
1135
- 0.1,
1136
- 500
1137
- ), this.miniCamera.position.z = 10, this.miniCamera.position.x = -5);
1181
+ this.disposeMiniCamera(), this.enabled && (this.miniCamera = new O(75, this._sizes.aspect, 0.1, 500), this.miniCamera.position.z = 10, this.miniCamera.position.x = -5);
1138
1182
  }
1139
1183
  initOrbitControl() {
1140
1184
  var t;
1141
- this.cameraControls && ((t = this.cameraControls) == null || t.dispose()), !(!this.enabled || !(this._cameraService.instance instanceof j)) && this._cameraService.instance instanceof j && (this.cameraControls = new $e(
1185
+ this.cameraControls && ((t = this.cameraControls) == null || t.dispose()), !(!this.enabled || !(this._cameraService.instance instanceof M)) && this._cameraService.instance instanceof M && (this.cameraControls = new Ce(
1142
1186
  this._cameraService.instance,
1143
1187
  this._appService.proxyReceiver
1144
1188
  ), this.cameraControls.rotateSpeed = 0.1, this.cameraControls.enableDamping = !0);
1145
1189
  }
1146
1190
  initMiniCameraOrbitControls() {
1147
- this.miniCameraControls && this.miniCameraControls.dispose(), !(!this.enabled || !this.miniCamera) && (this.miniCameraControls = new $e(
1191
+ this.miniCameraControls && this.miniCameraControls.dispose(), !(!this.enabled || !this.miniCamera) && (this.miniCameraControls = new Ce(
1148
1192
  this.miniCamera,
1149
1193
  this._appService.proxyReceiver
1150
1194
  ), this.miniCameraControls.rotateSpeed = 0.15, this.miniCameraControls.enableDamping = !0);
1151
1195
  }
1152
1196
  initAxesHelper(t) {
1153
- this.enabled && (this.axesHelper = new ut(t), this._worldService.scene.add(this.axesHelper));
1197
+ this.enabled && (this.axesHelper = new ct(t), this._worldService.scene.add(this.axesHelper));
1154
1198
  }
1155
1199
  initGridHelper(t) {
1156
- this.gridHelper && this._worldService.scene.remove(this.gridHelper), this.enabled && (this.gridHelper = new mt(t, t), this._worldService.scene.add(this.gridHelper));
1200
+ this.gridHelper && this._worldService.scene.remove(this.gridHelper), this.enabled && (this.gridHelper = new lt(t, t), this._worldService.scene.add(this.gridHelper));
1157
1201
  }
1158
1202
  disposeMiniCamera() {
1159
- this.miniCamera instanceof j && (this.miniCamera.clearViewOffset(), this.miniCamera.clear(), this.miniCamera = void 0);
1203
+ this.miniCamera instanceof M && (this.miniCamera.clearViewOffset(), this.miniCamera.clear(), this.miniCamera = void 0);
1160
1204
  }
1161
1205
  update() {
1162
1206
  var t, e;
@@ -1167,47 +1211,46 @@ let se = class {
1167
1211
  this.disposeMiniCamera(), (t = this.cameraControls) == null || t.dispose(), this.cameraControls = void 0, (e = this.miniCameraControls) == null || e.dispose(), this.miniCameraControls = void 0, this.axesHelper && this._worldService.scene.remove(this.axesHelper), (i = this.axesHelper) == null || i.dispose(), this.axesHelper = void 0, this.gridHelper && this._worldService.scene.remove(this.gridHelper), (s = this.gridHelper) == null || s.dispose(), this.gridHelper = void 0;
1168
1212
  }
1169
1213
  };
1170
- se = Hi([
1171
- p(d.ContainerScoped),
1172
- M(0, h(A)),
1173
- M(1, h(w)),
1174
- M(2, h(C)),
1175
- M(3, h(y)),
1176
- M(4, h(T))
1214
+ se = Ai([
1215
+ _(d.ContainerScoped),
1216
+ T(0, h(A)),
1217
+ T(1, h(C)),
1218
+ T(2, h(x)),
1219
+ T(3, h(S)),
1220
+ T(4, h(R))
1177
1221
  ], se);
1178
- var Fi = Object.defineProperty, Yi = Object.getOwnPropertyDescriptor, Ui = (t, e, i, s) => {
1179
- for (var r = s > 1 ? void 0 : s ? Yi(e, i) : e, o = t.length - 1, n; o >= 0; o--)
1180
- (n = t[o]) && (r = (s ? n(e, i, r) : n(r)) || r);
1181
- return s && r && Fi(e, i, r), r;
1182
- }, Le = (t, e) => (i, s) => e(i, s, t);
1222
+ var xi = Object.defineProperty, zi = Object.getOwnPropertyDescriptor, Li = (t, e, i, s) => {
1223
+ for (var r = s > 1 ? void 0 : s ? zi(e, i) : e, n = t.length - 1, o; n >= 0; n--)
1224
+ (o = t[n]) && (r = (s ? o(e, i, r) : o(r)) || r);
1225
+ return s && r && xi(e, i, r), r;
1226
+ }, Me = (t, e) => (i, s) => e(i, s, t);
1183
1227
  let re = class {
1184
1228
  constructor(t, e) {
1185
1229
  a(this, "step$");
1186
1230
  this.timerController = t, this._service = e, this.step$ = this.timerController.step$.pipe(
1187
- S(() => this._service.enabled)
1231
+ P(() => this._service.enabled)
1188
1232
  );
1189
1233
  }
1190
1234
  };
1191
- re = Ui([
1192
- p(d.ContainerScoped),
1193
- Le(0, h(R)),
1194
- Le(1, h(y))
1235
+ re = Li([
1236
+ _(d.ContainerScoped),
1237
+ Me(0, h($)),
1238
+ Me(1, h(S))
1195
1239
  ], re);
1196
- var Zi = Object.defineProperty, Ki = Object.getOwnPropertyDescriptor, Wi = (t, e, i, s) => {
1197
- for (var r = s > 1 ? void 0 : s ? Ki(e, i) : e, o = t.length - 1, n; o >= 0; o--)
1198
- (n = t[o]) && (r = (s ? n(e, i, r) : n(r)) || r);
1199
- return s && r && Zi(e, i, r), r;
1200
- }, ze = (t, e) => (i, s) => e(i, s, t);
1201
- let oe = class {
1240
+ var Hi = Object.defineProperty, Ii = Object.getOwnPropertyDescriptor, Ni = (t, e, i, s) => {
1241
+ for (var r = s > 1 ? void 0 : s ? Ii(e, i) : e, n = t.length - 1, o; n >= 0; n--)
1242
+ (o = t[n]) && (r = (s ? o(e, i, r) : o(r)) || r);
1243
+ return s && r && Hi(e, i, r), r;
1244
+ }, je = (t, e) => (i, s) => e(i, s, t);
1245
+ let ne = class {
1202
1246
  constructor(t, e) {
1203
1247
  a(this, "_subscriptions", []);
1204
1248
  this._service = t, this._controller = e;
1205
1249
  }
1206
1250
  init(t) {
1207
- this._service.enabled = !!t.enableDebug, this._service.enabled && (t.withMiniCamera && this._service.initMiniCamera(), t.enableControls && (this._service.initOrbitControl(), this._service.initMiniCameraOrbitControls()), typeof (t == null ? void 0 : t.axesSizes) == "number" && this._service.initAxesHelper(t.axesSizes), typeof (t == null ? void 0 : t.gridSizes) == "number" && this._service.initGridHelper(t.gridSizes), this._subscriptions.push(
1208
- this._controller.step$.subscribe(() => {
1209
- this._service.update();
1210
- })
1251
+ var e, i, s, r, n;
1252
+ this._service.enabled = !!((e = t.debug) != null && e.enabled), this._service.enabled && ((i = t.debug) != null && i.withMiniCamera && this._service.initMiniCamera(), (s = t.debug) != null && s.enableControls && (this._service.initOrbitControl(), this._service.initMiniCameraOrbitControls()), typeof ((r = t.debug) == null ? void 0 : r.axesSizes) == "number" && this._service.initAxesHelper(t.debug.axesSizes), typeof ((n = t.debug) == null ? void 0 : n.gridSizes) == "number" && this._service.initGridHelper(t.debug.gridSizes), this._subscriptions.push(
1253
+ this._controller.step$.subscribe(this._service.update.bind(this._service))
1211
1254
  ));
1212
1255
  }
1213
1256
  enabled(t) {
@@ -1232,20 +1275,20 @@ let oe = class {
1232
1275
  return this._controller.step$;
1233
1276
  }
1234
1277
  dispose() {
1235
- this._service.dispose(), this._subscriptions.forEach((t) => t.unsubscribe());
1278
+ this._service.dispose(), this._subscriptions.forEach((t) => t.unsubscribe()), this._subscriptions = [];
1236
1279
  }
1237
1280
  };
1238
- oe = Wi([
1239
- p(d.ContainerScoped),
1240
- ze(0, h(se)),
1241
- ze(1, h(re))
1242
- ], oe);
1243
- var Xi = Object.defineProperty, qi = Object.getOwnPropertyDescriptor, Bi = (t, e, i, s) => {
1244
- for (var r = s > 1 ? void 0 : s ? qi(e, i) : e, o = t.length - 1, n; o >= 0; o--)
1245
- (n = t[o]) && (r = (s ? n(e, i, r) : n(r)) || r);
1246
- return s && r && Xi(e, i, r), r;
1281
+ ne = Ni([
1282
+ _(d.ContainerScoped),
1283
+ je(0, h(se)),
1284
+ je(1, h(re))
1285
+ ], ne);
1286
+ var Wi = Object.defineProperty, Ui = Object.getOwnPropertyDescriptor, Yi = (t, e, i, s) => {
1287
+ for (var r = s > 1 ? void 0 : s ? Ui(e, i) : e, n = t.length - 1, o; n >= 0; n--)
1288
+ (o = t[n]) && (r = (s ? o(e, i, r) : o(r)) || r);
1289
+ return s && r && Wi(e, i, r), r;
1247
1290
  };
1248
- let U = class {
1291
+ let Y = class {
1249
1292
  constructor() {
1250
1293
  a(this, "loadedResources", {});
1251
1294
  a(this, "toLoadCount", 0);
@@ -1256,71 +1299,71 @@ let U = class {
1256
1299
  i && (this.loadedResources[e.name] = i, this.toLoadCount = s, this.loadedCount = r);
1257
1300
  }
1258
1301
  };
1259
- U = Bi([
1260
- p(d.ResolutionScoped)
1261
- ], U);
1262
- var Vi = Object.defineProperty, Gi = Object.getOwnPropertyDescriptor, Qi = (t, e, i, s) => {
1263
- for (var r = s > 1 ? void 0 : s ? Gi(e, i) : e, o = t.length - 1, n; o >= 0; o--)
1264
- (n = t[o]) && (r = (s ? n(e, i, r) : n(r)) || r);
1265
- return s && r && Vi(e, i, r), r;
1266
- }, Ji = (t, e) => (i, s) => e(i, s, t);
1267
- let ne = class {
1302
+ Y = Yi([
1303
+ _(d.ResolutionScoped)
1304
+ ], Y);
1305
+ var Fi = Object.defineProperty, Zi = Object.getOwnPropertyDescriptor, Ki = (t, e, i, s) => {
1306
+ for (var r = s > 1 ? void 0 : s ? Zi(e, i) : e, n = t.length - 1, o; n >= 0; n--)
1307
+ (o = t[n]) && (r = (s ? o(e, i, r) : o(r)) || r);
1308
+ return s && r && Fi(e, i, r), r;
1309
+ }, Vi = (t, e) => (i, s) => e(i, s, t);
1310
+ let oe = class {
1268
1311
  constructor(t) {
1269
- a(this, "load$", Je(self, "message").pipe(
1270
- S(
1312
+ a(this, "load$", Xe(self, "message").pipe(
1313
+ P(
1271
1314
  (t) => {
1272
1315
  var e, i, s;
1273
- return ((e = t.data) == null ? void 0 : e.token) === ke && !!((s = (i = t.data) == null ? void 0 : i.payload) != null && s.resource);
1316
+ return ((e = t.data) == null ? void 0 : e.token) === qe && !!((s = (i = t.data) == null ? void 0 : i.payload) != null && s.resource);
1274
1317
  }
1275
1318
  ),
1276
- q((t) => {
1277
- var i, s, r, o, n;
1319
+ X((t) => {
1320
+ var i, s, r, n, o;
1278
1321
  const { payload: e } = t.data || {};
1279
1322
  if (((i = e == null ? void 0 : e.source) == null ? void 0 : i.type) === "gltf") {
1280
1323
  const c = e.resource, l = (s = c.animations) == null ? void 0 : s.map(
1281
- (g) => ft.parse(g)
1324
+ (w) => pt.parse(w)
1282
1325
  ), u = (r = c.cameras) == null ? void 0 : r.map(
1283
- (g) => Se(g)
1284
- ), O = (o = c.scenes) == null ? void 0 : o.map(
1285
- (g) => Se(g)
1286
- ), L = O == null ? void 0 : O[0];
1326
+ (w) => be(w)
1327
+ ), y = (n = c.scenes) == null ? void 0 : n.map(
1328
+ (w) => be(w)
1329
+ ), z = y == null ? void 0 : y[0];
1287
1330
  return {
1288
1331
  ...e,
1289
- resource: { ...c, animations: l, cameras: u, scene: L, scenes: O }
1332
+ resource: { ...c, animations: l, cameras: u, scene: z, scenes: y }
1290
1333
  };
1291
1334
  }
1292
- return ((n = e == null ? void 0 : e.source) == null ? void 0 : n.type) === "font" ? {
1335
+ return ((o = e == null ? void 0 : e.source) == null ? void 0 : o.type) === "font" ? {
1293
1336
  ...e,
1294
- resource: new et(e.resource.data)
1337
+ resource: new Be(e.resource.data)
1295
1338
  } : e;
1296
1339
  }),
1297
- x()
1340
+ j()
1298
1341
  ));
1299
1342
  a(this, "loadCompleted$", this.load$.pipe(
1300
- S(
1343
+ P(
1301
1344
  (t) => !!t && t.toLoadCount === t.loadedCount
1302
1345
  ),
1303
- q(
1304
- () => tt(this._service, [
1346
+ X(
1347
+ () => Ge(this._service, [
1305
1348
  "loadedCount",
1306
1349
  "loadedResources",
1307
1350
  "toLoadCount"
1308
1351
  ])
1309
1352
  ),
1310
- x()
1353
+ j()
1311
1354
  ));
1312
1355
  this._service = t;
1313
1356
  }
1314
1357
  };
1315
- ne = Qi([
1316
- p(d.ContainerScoped),
1317
- Ji(0, h(U))
1318
- ], ne);
1319
- var ki = Object.defineProperty, es = Object.getOwnPropertyDescriptor, ts = (t, e, i, s) => {
1320
- for (var r = s > 1 ? void 0 : s ? es(e, i) : e, o = t.length - 1, n; o >= 0; o--)
1321
- (n = t[o]) && (r = (s ? n(e, i, r) : n(r)) || r);
1322
- return s && r && ki(e, i, r), r;
1323
- }, Ie = (t, e) => (i, s) => e(i, s, t);
1358
+ oe = Ki([
1359
+ _(d.ContainerScoped),
1360
+ Vi(0, h(Y))
1361
+ ], oe);
1362
+ var Xi = Object.defineProperty, qi = Object.getOwnPropertyDescriptor, Bi = (t, e, i, s) => {
1363
+ for (var r = s > 1 ? void 0 : s ? qi(e, i) : e, n = t.length - 1, o; n >= 0; n--)
1364
+ (o = t[n]) && (r = (s ? o(e, i, r) : o(r)) || r);
1365
+ return s && r && Xi(e, i, r), r;
1366
+ }, Ae = (t, e) => (i, s) => e(i, s, t);
1324
1367
  let ae = class {
1325
1368
  constructor(t, e) {
1326
1369
  a(this, "_subscriptions", []);
@@ -1349,22 +1392,22 @@ let ae = class {
1349
1392
  return this._controller.loadCompleted$;
1350
1393
  }
1351
1394
  dispose() {
1352
- this._subscriptions.forEach((t) => t.unsubscribe());
1395
+ this._subscriptions.forEach((t) => t.unsubscribe()), this._subscriptions = [];
1353
1396
  }
1354
1397
  };
1355
- ae = ts([
1356
- p(d.ContainerScoped),
1357
- Ie(0, h(ne)),
1358
- Ie(1, h(U))
1398
+ ae = Bi([
1399
+ _(d.ContainerScoped),
1400
+ Ae(0, h(oe)),
1401
+ Ae(1, h(Y))
1359
1402
  ], ae);
1360
- var is = Object.defineProperty, ss = Object.getOwnPropertyDescriptor, rs = (t, e, i, s) => {
1361
- for (var r = s > 1 ? void 0 : s ? ss(e, i) : e, o = t.length - 1, n; o >= 0; o--)
1362
- (n = t[o]) && (r = (s ? n(e, i, r) : n(r)) || r);
1363
- return s && r && is(e, i, r), r;
1364
- }, P = (t, e) => (i, s) => e(i, s, t);
1365
- let he = class extends it {
1366
- constructor(t, e, i, s, r, o, n, c, l) {
1367
- super(), this._controller = t, this._service = e, this.timer = i, this.sizes = s, this.camera = r, this.world = o, this.renderer = n, this.loader = c, this.debug = l, this._initProxyEvents();
1403
+ var Gi = Object.defineProperty, Qi = Object.getOwnPropertyDescriptor, Ji = (t, e, i, s) => {
1404
+ for (var r = s > 1 ? void 0 : s ? Qi(e, i) : e, n = t.length - 1, o; n >= 0; n--)
1405
+ (o = t[n]) && (r = (s ? o(e, i, r) : o(r)) || r);
1406
+ return s && r && Gi(e, i, r), r;
1407
+ }, g = (t, e) => (i, s) => e(i, s, t);
1408
+ let he = class extends Qe {
1409
+ constructor(t, e, i, s, r, n, o, c, l) {
1410
+ super(), this._controller = t, this._service = e, this.timer = i, this.sizes = s, this.camera = r, this.world = n, this.renderer = o, this.loader = c, this.debug = l, this._initProxyEvents();
1368
1411
  }
1369
1412
  _initProxyEvents() {
1370
1413
  ce.forEach((t) => {
@@ -1399,49 +1442,46 @@ let he = class extends it {
1399
1442
  return this.world.getAfterRender$();
1400
1443
  }
1401
1444
  init(t) {
1402
- this._service.canvas = t.canvas, !(this._service.isInitialized || !this._service.canvas) && (this._service.isInitialized = !0, this.sizes.init(this._service.canvas), this.camera.init(), this.world.init(), this.renderer.init(this._service.canvas), this.timer.init(t.startTimer), this.loader.init(), this.debug.init(t));
1445
+ this._service.init(t.canvas), this.sizes.init(t), this.camera.init(), this.world.init(), this.renderer.init(t), this.timer.init(t.startTimer), this.loader.init(), this.debug.init(t);
1403
1446
  }
1404
1447
  dispose() {
1405
1448
  this.sizes.dispose(), this.camera.dispose(), this.world.dispose(), this.renderer.dispose(), this.timer.dispose(), this.loader.dispose(), this.debug.dispose();
1406
1449
  }
1407
1450
  };
1408
- he = rs([
1409
- p(d.ContainerScoped),
1410
- P(0, h(H)),
1411
- P(1, h(A)),
1412
- P(2, h(V)),
1413
- P(3, h(ee)),
1414
- P(4, h(Q)),
1415
- P(5, h(ie)),
1416
- P(6, h(k)),
1417
- P(7, h(ae)),
1418
- P(8, h(oe))
1451
+ he = Ji([
1452
+ _(d.ContainerScoped),
1453
+ g(0, h(N)),
1454
+ g(1, h(A)),
1455
+ g(2, h(B)),
1456
+ g(3, h(ee)),
1457
+ g(4, h(Q)),
1458
+ g(5, h(ie)),
1459
+ g(6, h(k)),
1460
+ g(7, h(ae)),
1461
+ g(8, h(ne))
1419
1462
  ], he);
1420
- var os = st();
1421
- const _e = /* @__PURE__ */ rt(os), ns = _e.expose;
1422
- _e.registerSerializer;
1423
- _e.Transfer;
1424
- const ls = (t) => {
1425
- const e = we.createChildContainer(), i = e.resolve(he), s = { container: e, module: i }, r = {}, o = (c) => {
1426
- var L, g, pe, de, ue, me, fe;
1427
- if (!((L = c.data) != null && L.canvas) && !((g = c.data) != null && g.mainThread) || i.getIsInitialized())
1463
+ var ki = Je();
1464
+ const pe = /* @__PURE__ */ ke(ki), es = pe.expose;
1465
+ pe.registerSerializer;
1466
+ pe.Transfer;
1467
+ const rs = async (t) => {
1468
+ const e = ve.createChildContainer(), i = e.resolve(he), s = { container: e, module: i }, r = {}, n = (c) => {
1469
+ var u, y, z, w, _e;
1470
+ if (!((u = c.data) != null && u.initApp) || !((y = c.data) != null && y.canvas) && !((z = c.data) != null && z.mainThread) || i.getIsInitialized())
1428
1471
  return;
1429
- const l = !!((pe = c.data) != null && pe.startTimer), u = !!((de = c.data) != null && de.withMiniCamera), O = !!((ue = c.data) != null && ue.fullScreen);
1472
+ const l = c.data.canvas || (t == null ? void 0 : t.canvas) || (c.data.mainThread ? (w = self == null ? void 0 : self.document) == null ? void 0 : w.getElementsByTagName(
1473
+ "canvas"
1474
+ )[0] : void 0);
1430
1475
  i.init({
1431
1476
  ...c.data,
1432
- canvas: (t == null ? void 0 : t.canvas) || c.data.canvas || (c.data.mainThread ? (me = self == null ? void 0 : self.document) == null ? void 0 : me.getElementsByTagName(
1433
- "canvas"
1434
- )[0] : void 0),
1435
- startTimer: l,
1436
- withMiniCamera: u,
1437
- fullScreen: O
1438
- }), (fe = t == null ? void 0 : t.onReady) == null || fe.call(t, s), self == null || self.removeEventListener("message", o);
1477
+ canvas: l
1478
+ }), (_e = t == null ? void 0 : t.onReady) == null || _e.call(t, s), self == null || self.removeEventListener("message", n);
1439
1479
  };
1440
- e.register(ot, { useValue: e }), ce.forEach((c) => {
1480
+ e.register(et, { useValue: e }), ce.forEach((c) => {
1441
1481
  var l, u;
1442
1482
  r[c] = (u = (l = i[c]) == null ? void 0 : l.bind) == null ? void 0 : u.call(l, i);
1443
- }), self == null || self.addEventListener("message", o);
1444
- const n = {
1483
+ }), self == null || self.addEventListener("message", n);
1484
+ const o = {
1445
1485
  ...r,
1446
1486
  getProxyReceiver: i.getProxyReceiver.bind(i),
1447
1487
  getIsInitialized: i.getIsInitialized.bind(i),
@@ -1451,15 +1491,16 @@ const ls = (t) => {
1451
1491
  getAfterRender$: i.getAfterRender$.bind(i),
1452
1492
  dispose: i.dispose.bind(i)
1453
1493
  };
1454
- we.register("MAIN_THREAD_APP", { useValue: n });
1494
+ ve.register("MAIN_THREAD_APP", { useValue: o });
1455
1495
  try {
1456
- ns(n);
1496
+ es(o);
1457
1497
  } catch (c) {
1458
- console.warn("Failed to expose the app module.", c.message);
1498
+ const l = c instanceof Error ? c.message : "Unknown error";
1499
+ console.warn("Unable to expose the App Module.", l);
1459
1500
  }
1460
1501
  return s;
1461
1502
  };
1462
1503
  export {
1463
1504
  he as AppModule,
1464
- ls as launchApp
1505
+ rs as launchApp
1465
1506
  };