endset_three_editor 0.2.6 → 0.3.0

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.
@@ -1,8 +1,8 @@
1
- import { defineComponent as Xe, ref as G, inject as xn, computed as Qe, watchEffect as En, resolveComponent as Mn, openBlock as C, createElementBlock as U, createElementVNode as g, normalizeClass as Ue, withModifiers as Lt, unref as vn, toDisplayString as Ee, Fragment as nn, renderList as sn, createBlock as ke, createCommentVNode as ae, watch as on, toRef as Sn, provide as An, reactive as rn, withDirectives as N, vModelText as Q, vShow as ue, shallowRef as Rn, onMounted as Pn } from "vue";
2
- import * as F from "three";
3
- import { Controls as an, Vector3 as M, MOUSE as Me, TOUCH as xe, Quaternion as K, Spherical as It, Vector2 as V, Ray as Ln, Plane as In, MathUtils as ln, Raycaster as On, Object3D as ze, MeshBasicMaterial as _e, LineBasicMaterial as je, CylinderGeometry as Y, BoxGeometry as z, BufferGeometry as Ge, Float32BufferAttribute as de, Mesh as T, OctahedronGeometry as qe, Line as re, TorusGeometry as Pe, SphereGeometry as Cn, Euler as Dn, Matrix4 as Se, PlaneGeometry as Nn, DoubleSide as cn, Loader as hn, FileLoader as Et, Color as pe, SRGBColorSpace as Ae, Group as nt, Material as Fe, PointsMaterial as Ce, MeshPhongMaterial as kn, LineSegments as gt, Points as st, TrianglesDrawMode as jn, TriangleFanDrawMode as yt, TriangleStripDrawMode as un, LoaderUtils as He, MeshPhysicalMaterial as se, LinearSRGBColorSpace as le, SpotLight as Fn, PointLight as Hn, DirectionalLight as Un, InstancedMesh as zn, InstancedBufferAttribute as Gn, TextureLoader as Xn, ImageBitmapLoader as Yn, BufferAttribute as rt, InterleavedBuffer as Bn, InterleavedBufferAttribute as Kn, LinearMipmapLinearFilter as dn, NearestMipmapLinearFilter as Vn, LinearMipmapNearestFilter as Zn, NearestMipmapNearestFilter as Qn, LinearFilter as _t, NearestFilter as pn, RepeatWrapping as bt, MirroredRepeatWrapping as qn, ClampToEdgeWrapping as Wn, MeshStandardMaterial as fn, PropertyBinding as $n, SkinnedMesh as Jn, LineLoop as es, PerspectiveCamera as ts, OrthographicCamera as ns, Skeleton as ss, AnimationClip as is, Bone as os, InterpolateDiscrete as rs, InterpolateLinear as mn, Texture as Ot, VectorKeyframeTrack as Ct, NumberKeyframeTrack as Dt, QuaternionKeyframeTrack as Nt, ColorManagement as kt, FrontSide as as, Interpolant as ls, Box3 as cs, Sphere as hs } from "three";
4
- import us from "@tweenjs/tween.js";
5
- const jt = { type: "change" }, Mt = { type: "start" }, gn = { type: "end" }, We = new Ln(), Ft = new In(), ds = Math.cos(70 * ln.DEG2RAD), k = new M(), B = 2 * Math.PI, P = {
1
+ import { defineComponent as Ze, ref as U, inject as Pn, computed as et, watchEffect as Ln, resolveComponent as In, openBlock as k, createElementBlock as z, createElementVNode as g, normalizeClass as Be, withModifiers as Nt, unref as Cn, toDisplayString as ve, Fragment as ln, renderList as cn, createBlock as je, createCommentVNode as le, watch as hn, toRef as Dn, provide as On, reactive as un, withDirectives as O, vModelText as $, vShow as re, shallowRef as kn, onMounted as Nn, onBeforeUnmount as jn } from "vue";
2
+ import * as H from "three";
3
+ import { Controls as dn, Vector3 as S, MOUSE as Se, TOUCH as Me, Quaternion as K, Spherical as jt, Vector2 as Z, Ray as Hn, Plane as Fn, MathUtils as pn, Raycaster as Un, Object3D as Ye, MeshBasicMaterial as we, LineBasicMaterial as He, CylinderGeometry as B, BoxGeometry as G, BufferGeometry as Re, Float32BufferAttribute as pe, Mesh as E, OctahedronGeometry as tt, Line as ae, TorusGeometry as Le, SphereGeometry as zn, Euler as Gn, Matrix4 as Pe, PlaneGeometry as Xn, DoubleSide as fn, Loader as It, FileLoader as Ke, Color as he, SRGBColorSpace as ce, Group as at, Material as Fe, PointsMaterial as Oe, MeshPhongMaterial as Bn, LineSegments as Et, Points as lt, TrianglesDrawMode as Yn, TriangleFanDrawMode as Mt, TriangleStripDrawMode as mn, LoaderUtils as Ue, MeshPhysicalMaterial as oe, LinearSRGBColorSpace as ie, SpotLight as Kn, PointLight as Vn, DirectionalLight as Zn, InstancedMesh as Wn, InstancedBufferAttribute as Qn, TextureLoader as qn, ImageBitmapLoader as $n, BufferAttribute as ze, InterleavedBuffer as gn, InterleavedBufferAttribute as yn, LinearMipmapLinearFilter as _n, NearestMipmapLinearFilter as Jn, LinearMipmapNearestFilter as es, NearestMipmapNearestFilter as ts, LinearFilter as vt, NearestFilter as bn, RepeatWrapping as St, MirroredRepeatWrapping as ns, ClampToEdgeWrapping as ss, MeshStandardMaterial as wn, PropertyBinding as is, SkinnedMesh as os, LineLoop as rs, PerspectiveCamera as as, OrthographicCamera as ls, Skeleton as cs, AnimationClip as hs, Bone as us, InterpolateDiscrete as ds, InterpolateLinear as Tn, Texture as Ht, VectorKeyframeTrack as Ft, NumberKeyframeTrack as Ut, QuaternionKeyframeTrack as zt, ColorManagement as At, FrontSide as ps, Interpolant as fs, Box3 as ms, Sphere as gs } from "three";
4
+ import ys from "@tweenjs/tween.js";
5
+ const Gt = { type: "change" }, Ct = { type: "start" }, xn = { type: "end" }, nt = new Hn(), Xt = new Fn(), _s = Math.cos(70 * pn.DEG2RAD), j = new S(), Y = 2 * Math.PI, L = {
6
6
  NONE: -1,
7
7
  ROTATE: 0,
8
8
  DOLLY: 1,
@@ -11,8 +11,8 @@ const jt = { type: "change" }, Mt = { type: "start" }, gn = { type: "end" }, We
11
11
  TOUCH_PAN: 4,
12
12
  TOUCH_DOLLY_PAN: 5,
13
13
  TOUCH_DOLLY_ROTATE: 6
14
- }, at = 1e-6;
15
- class ps extends an {
14
+ }, ft = 1e-6;
15
+ class bs extends dn {
16
16
  /**
17
17
  * Constructs a new controls instance.
18
18
  *
@@ -20,7 +20,7 @@ class ps extends an {
20
20
  * @param {?HTMLElement} domElement - The HTML element used for event listeners.
21
21
  */
22
22
  constructor(e, t = null) {
23
- super(e, t), this.state = P.NONE, this.target = new M(), this.cursor = new M(), 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: Me.ROTATE, MIDDLE: Me.DOLLY, RIGHT: Me.PAN }, this.touches = { ONE: xe.ROTATE, TWO: xe.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 M(), this._lastQuaternion = new K(), this._lastTargetPosition = new M(), this._quat = new K().setFromUnitVectors(e.up, new M(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new It(), this._sphericalDelta = new It(), this._scale = 1, this._panOffset = new M(), 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 M(), this._mouse = new V(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = ms.bind(this), this._onPointerDown = fs.bind(this), this._onPointerUp = gs.bind(this), this._onContextMenu = Es.bind(this), this._onMouseWheel = bs.bind(this), this._onKeyDown = ws.bind(this), this._onTouchStart = Ts.bind(this), this._onTouchMove = xs.bind(this), this._onMouseDown = ys.bind(this), this._onMouseMove = _s.bind(this), this._interceptControlDown = Ms.bind(this), this._interceptControlUp = vs.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
23
+ super(e, t), this.state = L.NONE, this.target = new S(), this.cursor = new S(), 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: Se.ROTATE, MIDDLE: Se.DOLLY, RIGHT: Se.PAN }, this.touches = { ONE: Me.ROTATE, TWO: Me.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 S(), this._lastQuaternion = new K(), this._lastTargetPosition = new S(), this._quat = new K().setFromUnitVectors(e.up, new S(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new jt(), this._sphericalDelta = new jt(), this._scale = 1, this._panOffset = new S(), this._rotateStart = new Z(), this._rotateEnd = new Z(), this._rotateDelta = new Z(), this._panStart = new Z(), this._panEnd = new Z(), this._panDelta = new Z(), this._dollyStart = new Z(), this._dollyEnd = new Z(), this._dollyDelta = new Z(), this._dollyDirection = new S(), this._mouse = new Z(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = Ts.bind(this), this._onPointerDown = ws.bind(this), this._onPointerUp = xs.bind(this), this._onContextMenu = Ps.bind(this), this._onMouseWheel = vs.bind(this), this._onKeyDown = Ss.bind(this), this._onTouchStart = As.bind(this), this._onTouchMove = Rs.bind(this), this._onMouseDown = Es.bind(this), this._onMouseMove = Ms.bind(this), this._interceptControlDown = Ls.bind(this), this._interceptControlUp = Is.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
24
24
  }
25
25
  /**
26
26
  * Defines the visual representation of the cursor.
@@ -93,7 +93,7 @@ class ps extends an {
93
93
  * was called, or the initial state.
94
94
  */
95
95
  reset() {
96
- this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(jt), this.update(), this.state = P.NONE;
96
+ this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(Gt), this.update(), this.state = L.NONE;
97
97
  }
98
98
  /**
99
99
  * Programmatically pan the camera.
@@ -138,9 +138,9 @@ class ps extends an {
138
138
  }
139
139
  update(e = null) {
140
140
  const t = this.object.position;
141
- k.copy(t).sub(this.target), k.applyQuaternion(this._quat), this._spherical.setFromVector3(k), 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);
141
+ j.copy(t).sub(this.target), j.applyQuaternion(this._quat), this._spherical.setFromVector3(j), this.autoRotate && this.state === L.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);
142
142
  let s = this.minAzimuthAngle, n = this.maxAzimuthAngle;
143
- isFinite(s) && isFinite(n) && (s < -Math.PI ? s += B : s > Math.PI && (s -= B), n < -Math.PI ? n += B : n > Math.PI && (n -= B), s <= n ? this._spherical.theta = Math.max(s, Math.min(n, this._spherical.theta)) : this._spherical.theta = this._spherical.theta > (s + n) / 2 ? Math.max(s, this._spherical.theta) : Math.min(n, 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);
143
+ isFinite(s) && isFinite(n) && (s < -Math.PI ? s += Y : s > Math.PI && (s -= Y), n < -Math.PI ? n += Y : n > Math.PI && (n -= Y), s <= n ? this._spherical.theta = Math.max(s, Math.min(n, this._spherical.theta)) : this._spherical.theta = this._spherical.theta > (s + n) / 2 ? Math.max(s, this._spherical.theta) : Math.min(n, 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);
144
144
  let i = !1;
145
145
  if (this.zoomToCursor && this._performCursorZoom || this.object.isOrthographicCamera)
146
146
  this._spherical.radius = this._clampDistance(this._spherical.radius);
@@ -148,31 +148,31 @@ class ps extends an {
148
148
  const o = this._spherical.radius;
149
149
  this._spherical.radius = this._clampDistance(this._spherical.radius * this._scale), i = o != this._spherical.radius;
150
150
  }
151
- if (k.setFromSpherical(this._spherical), k.applyQuaternion(this._quatInverse), t.copy(this.target).add(k), 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) {
151
+ if (j.setFromSpherical(this._spherical), j.applyQuaternion(this._quatInverse), t.copy(this.target).add(j), 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) {
152
152
  let o = null;
153
153
  if (this.object.isPerspectiveCamera) {
154
- const a = k.length();
154
+ const a = j.length();
155
155
  o = this._clampDistance(a * this._scale);
156
156
  const l = a - o;
157
157
  this.object.position.addScaledVector(this._dollyDirection, l), this.object.updateMatrixWorld(), i = !!l;
158
158
  } else if (this.object.isOrthographicCamera) {
159
- const a = new M(this._mouse.x, this._mouse.y, 0);
159
+ const a = new S(this._mouse.x, this._mouse.y, 0);
160
160
  a.unproject(this.object);
161
161
  const l = this.object.zoom;
162
162
  this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), this.object.updateProjectionMatrix(), i = l !== this.object.zoom;
163
- const h = new M(this._mouse.x, this._mouse.y, 0);
164
- h.unproject(this.object), this.object.position.sub(h).add(a), this.object.updateMatrixWorld(), o = k.length();
163
+ const c = new S(this._mouse.x, this._mouse.y, 0);
164
+ c.unproject(this.object), this.object.position.sub(c).add(a), this.object.updateMatrixWorld(), o = j.length();
165
165
  } else
166
166
  console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
167
- o !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(o).add(this.object.position) : (We.origin.copy(this.object.position), We.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(We.direction)) < ds ? this.object.lookAt(this.target) : (Ft.setFromNormalAndCoplanarPoint(this.object.up, this.target), We.intersectPlane(Ft, this.target))));
167
+ o !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(o).add(this.object.position) : (nt.origin.copy(this.object.position), nt.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(nt.direction)) < _s ? this.object.lookAt(this.target) : (Xt.setFromNormalAndCoplanarPoint(this.object.up, this.target), nt.intersectPlane(Xt, this.target))));
168
168
  } else if (this.object.isOrthographicCamera) {
169
169
  const o = this.object.zoom;
170
170
  this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), o !== this.object.zoom && (this.object.updateProjectionMatrix(), i = !0);
171
171
  }
172
- return this._scale = 1, this._performCursorZoom = !1, i || this._lastPosition.distanceToSquared(this.object.position) > at || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > at || this._lastTargetPosition.distanceToSquared(this.target) > at ? (this.dispatchEvent(jt), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;
172
+ return this._scale = 1, this._performCursorZoom = !1, i || this._lastPosition.distanceToSquared(this.object.position) > ft || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > ft || this._lastTargetPosition.distanceToSquared(this.target) > ft ? (this.dispatchEvent(Gt), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;
173
173
  }
174
174
  _getAutoRotationAngle(e) {
175
- return e !== null ? B / 60 * this.autoRotateSpeed * e : B / 60 / 60 * this.autoRotateSpeed;
175
+ return e !== null ? Y / 60 * this.autoRotateSpeed * e : Y / 60 / 60 * this.autoRotateSpeed;
176
176
  }
177
177
  _getZoomScale(e) {
178
178
  const t = Math.abs(e * 0.01);
@@ -185,18 +185,18 @@ class ps extends an {
185
185
  this._sphericalDelta.phi -= e;
186
186
  }
187
187
  _panLeft(e, t) {
188
- k.setFromMatrixColumn(t, 0), k.multiplyScalar(-e), this._panOffset.add(k);
188
+ j.setFromMatrixColumn(t, 0), j.multiplyScalar(-e), this._panOffset.add(j);
189
189
  }
190
190
  _panUp(e, t) {
191
- this.screenSpacePanning === !0 ? k.setFromMatrixColumn(t, 1) : (k.setFromMatrixColumn(t, 0), k.crossVectors(this.object.up, k)), k.multiplyScalar(e), this._panOffset.add(k);
191
+ this.screenSpacePanning === !0 ? j.setFromMatrixColumn(t, 1) : (j.setFromMatrixColumn(t, 0), j.crossVectors(this.object.up, j)), j.multiplyScalar(e), this._panOffset.add(j);
192
192
  }
193
193
  // deltaX and deltaY are in pixels; right and down are positive
194
194
  _pan(e, t) {
195
195
  const s = this.domElement;
196
196
  if (this.object.isPerspectiveCamera) {
197
197
  const n = this.object.position;
198
- k.copy(n).sub(this.target);
199
- let i = k.length();
198
+ j.copy(n).sub(this.target);
199
+ let i = j.length();
200
200
  i *= Math.tan(this.object.fov / 2 * Math.PI / 180), this._panLeft(2 * e * i / s.clientHeight, this.object.matrix), this._panUp(2 * t * i / s.clientHeight, this.object.matrix);
201
201
  } else this.object.isOrthographicCamera ? (this._panLeft(e * (this.object.right - this.object.left) / this.object.zoom / s.clientWidth, this.object.matrix), this._panUp(t * (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);
202
202
  }
@@ -231,7 +231,7 @@ class ps extends an {
231
231
  _handleMouseMoveRotate(e) {
232
232
  this._rotateEnd.set(e.clientX, e.clientY), this._rotateDelta.subVectors(this._rotateEnd, this._rotateStart).multiplyScalar(this.rotateSpeed);
233
233
  const t = this.domElement;
234
- this._rotateLeft(B * this._rotateDelta.x / t.clientHeight), this._rotateUp(B * this._rotateDelta.y / t.clientHeight), this._rotateStart.copy(this._rotateEnd), this.update();
234
+ this._rotateLeft(Y * this._rotateDelta.x / t.clientHeight), this._rotateUp(Y * this._rotateDelta.y / t.clientHeight), this._rotateStart.copy(this._rotateEnd), this.update();
235
235
  }
236
236
  _handleMouseMoveDolly(e) {
237
237
  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();
@@ -246,16 +246,16 @@ class ps extends an {
246
246
  let t = !1;
247
247
  switch (e.code) {
248
248
  case this.keys.UP:
249
- e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateUp(B * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(0, this.keyPanSpeed), t = !0;
249
+ e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateUp(Y * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(0, this.keyPanSpeed), t = !0;
250
250
  break;
251
251
  case this.keys.BOTTOM:
252
- e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateUp(-B * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(0, -this.keyPanSpeed), t = !0;
252
+ e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateUp(-Y * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(0, -this.keyPanSpeed), t = !0;
253
253
  break;
254
254
  case this.keys.LEFT:
255
- e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateLeft(B * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(this.keyPanSpeed, 0), t = !0;
255
+ e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateLeft(Y * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(this.keyPanSpeed, 0), t = !0;
256
256
  break;
257
257
  case this.keys.RIGHT:
258
- e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateLeft(-B * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(-this.keyPanSpeed, 0), t = !0;
258
+ e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateLeft(-Y * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(-this.keyPanSpeed, 0), t = !0;
259
259
  break;
260
260
  }
261
261
  t && (e.preventDefault(), this.update());
@@ -295,7 +295,7 @@ class ps extends an {
295
295
  }
296
296
  this._rotateDelta.subVectors(this._rotateEnd, this._rotateStart).multiplyScalar(this.rotateSpeed);
297
297
  const t = this.domElement;
298
- this._rotateLeft(B * this._rotateDelta.x / t.clientHeight), this._rotateUp(B * this._rotateDelta.y / t.clientHeight), this._rotateStart.copy(this._rotateEnd);
298
+ this._rotateLeft(Y * this._rotateDelta.x / t.clientHeight), this._rotateUp(Y * this._rotateDelta.y / t.clientHeight), this._rotateStart.copy(this._rotateEnd);
299
299
  }
300
300
  _handleTouchMovePan(e) {
301
301
  if (this._pointers.length === 1)
@@ -337,7 +337,7 @@ class ps extends an {
337
337
  }
338
338
  _trackPointer(e) {
339
339
  let t = this._pointerPositions[e.pointerId];
340
- t === void 0 && (t = new V(), this._pointerPositions[e.pointerId] = t), t.set(e.pageX, e.pageY);
340
+ t === void 0 && (t = new Z(), this._pointerPositions[e.pointerId] = t), t.set(e.pageX, e.pageY);
341
341
  }
342
342
  _getSecondPointerPosition(e) {
343
343
  const t = e.pointerId === this._pointers[0] ? this._pointers[1] : this._pointers[0];
@@ -361,16 +361,16 @@ class ps extends an {
361
361
  return e.ctrlKey && !this._controlActive && (s.deltaY *= 10), s;
362
362
  }
363
363
  }
364
- function fs(r) {
364
+ function ws(r) {
365
365
  this.enabled !== !1 && (this._pointers.length === 0 && (this.domElement.setPointerCapture(r.pointerId), this.domElement.ownerDocument.addEventListener("pointermove", this._onPointerMove), this.domElement.ownerDocument.addEventListener("pointerup", this._onPointerUp)), !this._isTrackingPointer(r) && (this._addPointer(r), r.pointerType === "touch" ? this._onTouchStart(r) : this._onMouseDown(r), this._cursorStyle === "grab" && (this.domElement.style.cursor = "grabbing")));
366
366
  }
367
- function ms(r) {
367
+ function Ts(r) {
368
368
  this.enabled !== !1 && (r.pointerType === "touch" ? this._onTouchMove(r) : this._onMouseMove(r));
369
369
  }
370
- function gs(r) {
370
+ function xs(r) {
371
371
  switch (this._removePointer(r), this._pointers.length) {
372
372
  case 0:
373
- this.domElement.releasePointerCapture(r.pointerId), this.domElement.ownerDocument.removeEventListener("pointermove", this._onPointerMove), this.domElement.ownerDocument.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(gn), this.state = P.NONE, this._cursorStyle === "grab" && (this.domElement.style.cursor = "grab");
373
+ this.domElement.releasePointerCapture(r.pointerId), this.domElement.ownerDocument.removeEventListener("pointermove", this._onPointerMove), this.domElement.ownerDocument.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(xn), this.state = L.NONE, this._cursorStyle === "grab" && (this.domElement.style.cursor = "grab");
374
374
  break;
375
375
  case 1:
376
376
  const e = this._pointers[0], t = this._pointerPositions[e];
@@ -378,7 +378,7 @@ function gs(r) {
378
378
  break;
379
379
  }
380
380
  }
381
- function ys(r) {
381
+ function Es(r) {
382
382
  let e;
383
383
  switch (r.button) {
384
384
  case 0:
@@ -394,127 +394,127 @@ function ys(r) {
394
394
  e = -1;
395
395
  }
396
396
  switch (e) {
397
- case Me.DOLLY:
397
+ case Se.DOLLY:
398
398
  if (this.enableZoom === !1) return;
399
- this._handleMouseDownDolly(r), this.state = P.DOLLY;
399
+ this._handleMouseDownDolly(r), this.state = L.DOLLY;
400
400
  break;
401
- case Me.ROTATE:
401
+ case Se.ROTATE:
402
402
  if (r.ctrlKey || r.metaKey || r.shiftKey) {
403
403
  if (this.enablePan === !1) return;
404
- this._handleMouseDownPan(r), this.state = P.PAN;
404
+ this._handleMouseDownPan(r), this.state = L.PAN;
405
405
  } else {
406
406
  if (this.enableRotate === !1) return;
407
- this._handleMouseDownRotate(r), this.state = P.ROTATE;
407
+ this._handleMouseDownRotate(r), this.state = L.ROTATE;
408
408
  }
409
409
  break;
410
- case Me.PAN:
410
+ case Se.PAN:
411
411
  if (r.ctrlKey || r.metaKey || r.shiftKey) {
412
412
  if (this.enableRotate === !1) return;
413
- this._handleMouseDownRotate(r), this.state = P.ROTATE;
413
+ this._handleMouseDownRotate(r), this.state = L.ROTATE;
414
414
  } else {
415
415
  if (this.enablePan === !1) return;
416
- this._handleMouseDownPan(r), this.state = P.PAN;
416
+ this._handleMouseDownPan(r), this.state = L.PAN;
417
417
  }
418
418
  break;
419
419
  default:
420
- this.state = P.NONE;
420
+ this.state = L.NONE;
421
421
  }
422
- this.state !== P.NONE && this.dispatchEvent(Mt);
422
+ this.state !== L.NONE && this.dispatchEvent(Ct);
423
423
  }
424
- function _s(r) {
424
+ function Ms(r) {
425
425
  switch (this.state) {
426
- case P.ROTATE:
426
+ case L.ROTATE:
427
427
  if (this.enableRotate === !1) return;
428
428
  this._handleMouseMoveRotate(r);
429
429
  break;
430
- case P.DOLLY:
430
+ case L.DOLLY:
431
431
  if (this.enableZoom === !1) return;
432
432
  this._handleMouseMoveDolly(r);
433
433
  break;
434
- case P.PAN:
434
+ case L.PAN:
435
435
  if (this.enablePan === !1) return;
436
436
  this._handleMouseMovePan(r);
437
437
  break;
438
438
  }
439
439
  }
440
- function bs(r) {
441
- this.enabled === !1 || this.enableZoom === !1 || this.state !== P.NONE || (r.preventDefault(), this.dispatchEvent(Mt), this._handleMouseWheel(this._customWheelEvent(r)), this.dispatchEvent(gn));
440
+ function vs(r) {
441
+ this.enabled === !1 || this.enableZoom === !1 || this.state !== L.NONE || (r.preventDefault(), this.dispatchEvent(Ct), this._handleMouseWheel(this._customWheelEvent(r)), this.dispatchEvent(xn));
442
442
  }
443
- function ws(r) {
443
+ function Ss(r) {
444
444
  this.enabled !== !1 && this._handleKeyDown(r);
445
445
  }
446
- function Ts(r) {
446
+ function As(r) {
447
447
  switch (this._trackPointer(r), this._pointers.length) {
448
448
  case 1:
449
449
  switch (this.touches.ONE) {
450
- case xe.ROTATE:
450
+ case Me.ROTATE:
451
451
  if (this.enableRotate === !1) return;
452
- this._handleTouchStartRotate(r), this.state = P.TOUCH_ROTATE;
452
+ this._handleTouchStartRotate(r), this.state = L.TOUCH_ROTATE;
453
453
  break;
454
- case xe.PAN:
454
+ case Me.PAN:
455
455
  if (this.enablePan === !1) return;
456
- this._handleTouchStartPan(r), this.state = P.TOUCH_PAN;
456
+ this._handleTouchStartPan(r), this.state = L.TOUCH_PAN;
457
457
  break;
458
458
  default:
459
- this.state = P.NONE;
459
+ this.state = L.NONE;
460
460
  }
461
461
  break;
462
462
  case 2:
463
463
  switch (this.touches.TWO) {
464
- case xe.DOLLY_PAN:
464
+ case Me.DOLLY_PAN:
465
465
  if (this.enableZoom === !1 && this.enablePan === !1) return;
466
- this._handleTouchStartDollyPan(r), this.state = P.TOUCH_DOLLY_PAN;
466
+ this._handleTouchStartDollyPan(r), this.state = L.TOUCH_DOLLY_PAN;
467
467
  break;
468
- case xe.DOLLY_ROTATE:
468
+ case Me.DOLLY_ROTATE:
469
469
  if (this.enableZoom === !1 && this.enableRotate === !1) return;
470
- this._handleTouchStartDollyRotate(r), this.state = P.TOUCH_DOLLY_ROTATE;
470
+ this._handleTouchStartDollyRotate(r), this.state = L.TOUCH_DOLLY_ROTATE;
471
471
  break;
472
472
  default:
473
- this.state = P.NONE;
473
+ this.state = L.NONE;
474
474
  }
475
475
  break;
476
476
  default:
477
- this.state = P.NONE;
477
+ this.state = L.NONE;
478
478
  }
479
- this.state !== P.NONE && this.dispatchEvent(Mt);
479
+ this.state !== L.NONE && this.dispatchEvent(Ct);
480
480
  }
481
- function xs(r) {
481
+ function Rs(r) {
482
482
  switch (this._trackPointer(r), this.state) {
483
- case P.TOUCH_ROTATE:
483
+ case L.TOUCH_ROTATE:
484
484
  if (this.enableRotate === !1) return;
485
485
  this._handleTouchMoveRotate(r), this.update();
486
486
  break;
487
- case P.TOUCH_PAN:
487
+ case L.TOUCH_PAN:
488
488
  if (this.enablePan === !1) return;
489
489
  this._handleTouchMovePan(r), this.update();
490
490
  break;
491
- case P.TOUCH_DOLLY_PAN:
491
+ case L.TOUCH_DOLLY_PAN:
492
492
  if (this.enableZoom === !1 && this.enablePan === !1) return;
493
493
  this._handleTouchMoveDollyPan(r), this.update();
494
494
  break;
495
- case P.TOUCH_DOLLY_ROTATE:
495
+ case L.TOUCH_DOLLY_ROTATE:
496
496
  if (this.enableZoom === !1 && this.enableRotate === !1) return;
497
497
  this._handleTouchMoveDollyRotate(r), this.update();
498
498
  break;
499
499
  default:
500
- this.state = P.NONE;
500
+ this.state = L.NONE;
501
501
  }
502
502
  }
503
- function Es(r) {
503
+ function Ps(r) {
504
504
  this.enabled !== !1 && r.preventDefault();
505
505
  }
506
- function Ms(r) {
506
+ function Ls(r) {
507
507
  r.key === "Control" && (this._controlActive = !0, this.domElement.getRootNode().addEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
508
508
  }
509
- function vs(r) {
509
+ function Is(r) {
510
510
  r.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
511
511
  }
512
- const me = new On(), H = new M(), ce = new M(), O = new K(), Ht = {
513
- X: new M(1, 0, 0),
514
- Y: new M(0, 1, 0),
515
- Z: new M(0, 0, 1)
516
- }, lt = { type: "change" }, Ut = { type: "mouseDown", mode: null }, zt = { type: "mouseUp", mode: null }, Gt = { type: "objectChange" };
517
- class Ss extends an {
512
+ const ye = new Un(), F = new S(), ue = new S(), D = new K(), Bt = {
513
+ X: new S(1, 0, 0),
514
+ Y: new S(0, 1, 0),
515
+ Z: new S(0, 0, 1)
516
+ }, mt = { type: "change" }, Yt = { type: "mouseDown", mode: null }, Kt = { type: "mouseUp", mode: null }, Vt = { type: "objectChange" };
517
+ class Cs extends dn {
518
518
  /**
519
519
  * Constructs a new controls instance.
520
520
  *
@@ -523,27 +523,27 @@ class Ss extends an {
523
523
  */
524
524
  constructor(e, t = null) {
525
525
  super(void 0, t);
526
- const s = new Os(this);
526
+ const s = new Hs(this);
527
527
  this._root = s;
528
- const n = new Cs();
528
+ const n = new Fs();
529
529
  this._gizmo = n, s.add(n);
530
- const i = new Ds();
530
+ const i = new Us();
531
531
  this._plane = i, s.add(i);
532
532
  const o = this;
533
- function a(x, S) {
534
- let R = S;
535
- Object.defineProperty(o, x, {
533
+ function a(T, M) {
534
+ let R = M;
535
+ Object.defineProperty(o, T, {
536
536
  get: function() {
537
- return R !== void 0 ? R : S;
537
+ return R !== void 0 ? R : M;
538
538
  },
539
539
  set: function(v) {
540
- R !== v && (R = v, i[x] = v, n[x] = v, o.dispatchEvent({ type: x + "-changed", value: v }), o.dispatchEvent(lt));
540
+ R !== v && (R = v, i[T] = v, n[T] = v, o.dispatchEvent({ type: T + "-changed", value: v }), o.dispatchEvent(mt));
541
541
  }
542
- }), o[x] = S, i[x] = S, n[x] = S;
542
+ }), o[T] = M, i[T] = M, n[T] = M;
543
543
  }
544
544
  a("camera", e), a("object", void 0), a("enabled", !0), a("axis", null), a("mode", "translate"), a("translationSnap", null), a("rotationSnap", null), a("scaleSnap", null), a("space", "world"), a("size", 1), a("dragging", !1), a("showX", !0), a("showY", !0), a("showZ", !0), a("showXY", !0), a("showYZ", !0), a("showXZ", !0), a("minX", -1 / 0), a("maxX", 1 / 0), a("minY", -1 / 0), a("maxY", 1 / 0), a("minZ", -1 / 0), a("maxZ", 1 / 0);
545
- const l = new M(), h = new M(), u = new K(), c = new K(), p = new M(), m = new K(), b = new M(), f = new M(), y = new M(), d = 0, _ = new M();
546
- a("worldPosition", l), a("worldPositionStart", h), a("worldQuaternion", u), a("worldQuaternionStart", c), a("cameraPosition", p), a("cameraQuaternion", m), a("pointStart", b), a("pointEnd", f), a("rotationAxis", y), a("rotationAngle", d), a("eye", _), this._offset = new M(), this._startNorm = new M(), this._endNorm = new M(), this._cameraScale = new M(), this._parentPosition = new M(), this._parentQuaternion = new K(), this._parentQuaternionInv = new K(), this._parentScale = new M(), this._worldScaleStart = new M(), this._worldQuaternionInv = new K(), this._worldScale = new M(), this._positionStart = new M(), this._quaternionStart = new K(), this._scaleStart = new M(), this._getPointer = As.bind(this), this._onPointerDown = Ps.bind(this), this._onPointerHover = Rs.bind(this), this._onPointerMove = Ls.bind(this), this._onPointerUp = Is.bind(this), t !== null && this.connect(t);
545
+ const l = new S(), c = new S(), u = new K(), h = new K(), d = new S(), m = new K(), w = new S(), f = new S(), y = new S(), p = 0, b = new S();
546
+ a("worldPosition", l), a("worldPositionStart", c), a("worldQuaternion", u), a("worldQuaternionStart", h), a("cameraPosition", d), a("cameraQuaternion", m), a("pointStart", w), a("pointEnd", f), a("rotationAxis", y), a("rotationAngle", p), a("eye", b), this._offset = new S(), this._startNorm = new S(), this._endNorm = new S(), this._cameraScale = new S(), this._parentPosition = new S(), this._parentQuaternion = new K(), this._parentQuaternionInv = new K(), this._parentScale = new S(), this._worldScaleStart = new S(), this._worldQuaternionInv = new K(), this._worldScale = new S(), this._positionStart = new S(), this._quaternionStart = new K(), this._scaleStart = new S(), this._getPointer = Ds.bind(this), this._onPointerDown = ks.bind(this), this._onPointerHover = Os.bind(this), this._onPointerMove = Ns.bind(this), this._onPointerUp = js.bind(this), t !== null && this.connect(t);
547
547
  }
548
548
  connect(e) {
549
549
  super.connect(e), this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointermove", this._onPointerHover), this.domElement.addEventListener("pointerup", this._onPointerUp), this.domElement.style.touchAction = "none";
@@ -562,44 +562,44 @@ class Ss extends an {
562
562
  }
563
563
  pointerHover(e) {
564
564
  if (this.object === void 0 || this.dragging === !0) return;
565
- e !== null && me.setFromCamera(e, this.camera);
566
- const t = ct(this._gizmo.picker[this.mode], me);
565
+ e !== null && ye.setFromCamera(e, this.camera);
566
+ const t = gt(this._gizmo.picker[this.mode], ye);
567
567
  t ? this.axis = t.object.name : this.axis = null;
568
568
  }
569
569
  pointerDown(e) {
570
570
  if (!(this.object === void 0 || this.dragging === !0 || e != null && e.button !== 0) && this.axis !== null) {
571
- e !== null && me.setFromCamera(e, this.camera);
572
- const t = ct(this._plane, me, !0);
573
- t && (this.object.updateMatrixWorld(), this.object.parent.updateMatrixWorld(), this._positionStart.copy(this.object.position), this._quaternionStart.copy(this.object.quaternion), this._scaleStart.copy(this.object.scale), this.object.matrixWorld.decompose(this.worldPositionStart, this.worldQuaternionStart, this._worldScaleStart), this.pointStart.copy(t.point).sub(this.worldPositionStart)), this.dragging = !0, Ut.mode = this.mode, this.dispatchEvent(Ut);
571
+ e !== null && ye.setFromCamera(e, this.camera);
572
+ const t = gt(this._plane, ye, !0);
573
+ t && (this.object.updateMatrixWorld(), this.object.parent.updateMatrixWorld(), this._positionStart.copy(this.object.position), this._quaternionStart.copy(this.object.quaternion), this._scaleStart.copy(this.object.scale), this.object.matrixWorld.decompose(this.worldPositionStart, this.worldQuaternionStart, this._worldScaleStart), this.pointStart.copy(t.point).sub(this.worldPositionStart)), this.dragging = !0, Yt.mode = this.mode, this.dispatchEvent(Yt);
574
574
  }
575
575
  }
576
576
  pointerMove(e) {
577
577
  const t = this.axis, s = this.mode, n = this.object;
578
578
  let i = this.space;
579
579
  if (s === "scale" ? i = "local" : (t === "E" || t === "XYZE" || t === "XYZ") && (i = "world"), n === void 0 || t === null || this.dragging === !1 || e !== null && e.button !== -1) return;
580
- e !== null && me.setFromCamera(e, this.camera);
581
- const o = ct(this._plane, me, !0);
580
+ e !== null && ye.setFromCamera(e, this.camera);
581
+ const o = gt(this._plane, ye, !0);
582
582
  if (o) {
583
583
  if (this.pointEnd.copy(o.point).sub(this.worldPositionStart), s === "translate")
584
- this._offset.copy(this.pointEnd).sub(this.pointStart), i === "local" && t !== "XYZ" && this._offset.applyQuaternion(this._worldQuaternionInv), t.indexOf("X") === -1 && (this._offset.x = 0), t.indexOf("Y") === -1 && (this._offset.y = 0), t.indexOf("Z") === -1 && (this._offset.z = 0), i === "local" && t !== "XYZ" ? this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale) : this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale), n.position.copy(this._offset).add(this._positionStart), this.translationSnap && (i === "local" && (n.position.applyQuaternion(O.copy(this._quaternionStart).invert()), t.search("X") !== -1 && (n.position.x = Math.round(n.position.x / this.translationSnap) * this.translationSnap), t.search("Y") !== -1 && (n.position.y = Math.round(n.position.y / this.translationSnap) * this.translationSnap), t.search("Z") !== -1 && (n.position.z = Math.round(n.position.z / this.translationSnap) * this.translationSnap), n.position.applyQuaternion(this._quaternionStart)), i === "world" && (n.parent && n.position.add(H.setFromMatrixPosition(n.parent.matrixWorld)), t.search("X") !== -1 && (n.position.x = Math.round(n.position.x / this.translationSnap) * this.translationSnap), t.search("Y") !== -1 && (n.position.y = Math.round(n.position.y / this.translationSnap) * this.translationSnap), t.search("Z") !== -1 && (n.position.z = Math.round(n.position.z / this.translationSnap) * this.translationSnap), n.parent && n.position.sub(H.setFromMatrixPosition(n.parent.matrixWorld)))), n.position.x = Math.max(this.minX, Math.min(this.maxX, n.position.x)), n.position.y = Math.max(this.minY, Math.min(this.maxY, n.position.y)), n.position.z = Math.max(this.minZ, Math.min(this.maxZ, n.position.z));
584
+ this._offset.copy(this.pointEnd).sub(this.pointStart), i === "local" && t !== "XYZ" && this._offset.applyQuaternion(this._worldQuaternionInv), t.indexOf("X") === -1 && (this._offset.x = 0), t.indexOf("Y") === -1 && (this._offset.y = 0), t.indexOf("Z") === -1 && (this._offset.z = 0), i === "local" && t !== "XYZ" ? this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale) : this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale), n.position.copy(this._offset).add(this._positionStart), this.translationSnap && (i === "local" && (n.position.applyQuaternion(D.copy(this._quaternionStart).invert()), t.search("X") !== -1 && (n.position.x = Math.round(n.position.x / this.translationSnap) * this.translationSnap), t.search("Y") !== -1 && (n.position.y = Math.round(n.position.y / this.translationSnap) * this.translationSnap), t.search("Z") !== -1 && (n.position.z = Math.round(n.position.z / this.translationSnap) * this.translationSnap), n.position.applyQuaternion(this._quaternionStart)), i === "world" && (n.parent && n.position.add(F.setFromMatrixPosition(n.parent.matrixWorld)), t.search("X") !== -1 && (n.position.x = Math.round(n.position.x / this.translationSnap) * this.translationSnap), t.search("Y") !== -1 && (n.position.y = Math.round(n.position.y / this.translationSnap) * this.translationSnap), t.search("Z") !== -1 && (n.position.z = Math.round(n.position.z / this.translationSnap) * this.translationSnap), n.parent && n.position.sub(F.setFromMatrixPosition(n.parent.matrixWorld)))), n.position.x = Math.max(this.minX, Math.min(this.maxX, n.position.x)), n.position.y = Math.max(this.minY, Math.min(this.maxY, n.position.y)), n.position.z = Math.max(this.minZ, Math.min(this.maxZ, n.position.z));
585
585
  else if (s === "scale") {
586
586
  if (t.search("XYZ") !== -1) {
587
587
  let a = this.pointEnd.length() / this.pointStart.length();
588
- this.pointEnd.dot(this.pointStart) < 0 && (a *= -1), ce.set(a, a, a);
588
+ this.pointEnd.dot(this.pointStart) < 0 && (a *= -1), ue.set(a, a, a);
589
589
  } else
590
- H.copy(this.pointStart), ce.copy(this.pointEnd), H.applyQuaternion(this._worldQuaternionInv), ce.applyQuaternion(this._worldQuaternionInv), ce.divide(H), t.search("X") === -1 && (ce.x = 1), t.search("Y") === -1 && (ce.y = 1), t.search("Z") === -1 && (ce.z = 1);
591
- n.scale.copy(this._scaleStart).multiply(ce), this.scaleSnap && (t.search("X") !== -1 && (n.scale.x = Math.round(n.scale.x / this.scaleSnap) * this.scaleSnap || this.scaleSnap), t.search("Y") !== -1 && (n.scale.y = Math.round(n.scale.y / this.scaleSnap) * this.scaleSnap || this.scaleSnap), t.search("Z") !== -1 && (n.scale.z = Math.round(n.scale.z / this.scaleSnap) * this.scaleSnap || this.scaleSnap));
590
+ F.copy(this.pointStart), ue.copy(this.pointEnd), F.applyQuaternion(this._worldQuaternionInv), ue.applyQuaternion(this._worldQuaternionInv), ue.divide(F), t.search("X") === -1 && (ue.x = 1), t.search("Y") === -1 && (ue.y = 1), t.search("Z") === -1 && (ue.z = 1);
591
+ n.scale.copy(this._scaleStart).multiply(ue), this.scaleSnap && (t.search("X") !== -1 && (n.scale.x = Math.round(n.scale.x / this.scaleSnap) * this.scaleSnap || this.scaleSnap), t.search("Y") !== -1 && (n.scale.y = Math.round(n.scale.y / this.scaleSnap) * this.scaleSnap || this.scaleSnap), t.search("Z") !== -1 && (n.scale.z = Math.round(n.scale.z / this.scaleSnap) * this.scaleSnap || this.scaleSnap));
592
592
  } else if (s === "rotate") {
593
593
  this._offset.copy(this.pointEnd).sub(this.pointStart);
594
- const a = 20 / this.worldPosition.distanceTo(H.setFromMatrixPosition(this.camera.matrixWorld));
594
+ const a = 20 / this.worldPosition.distanceTo(F.setFromMatrixPosition(this.camera.matrixWorld));
595
595
  let l = !1;
596
- t === "XYZE" ? (this.rotationAxis.copy(this._offset).cross(this.eye).normalize(), this.rotationAngle = this._offset.dot(H.copy(this.rotationAxis).cross(this.eye)) * a) : (t === "X" || t === "Y" || t === "Z") && (this.rotationAxis.copy(Ht[t]), H.copy(Ht[t]), i === "local" && H.applyQuaternion(this.worldQuaternion), H.cross(this.eye), H.length() === 0 ? l = !0 : this.rotationAngle = this._offset.dot(H.normalize()) * a), (t === "E" || l) && (this.rotationAxis.copy(this.eye), this.rotationAngle = this.pointEnd.angleTo(this.pointStart), this._startNorm.copy(this.pointStart).normalize(), this._endNorm.copy(this.pointEnd).normalize(), this.rotationAngle *= this._endNorm.cross(this._startNorm).dot(this.eye) < 0 ? 1 : -1), this.rotationSnap && (this.rotationAngle = Math.round(this.rotationAngle / this.rotationSnap) * this.rotationSnap), i === "local" && t !== "E" && t !== "XYZE" ? (n.quaternion.copy(this._quaternionStart), n.quaternion.multiply(O.setFromAxisAngle(this.rotationAxis, this.rotationAngle)).normalize()) : (this.rotationAxis.applyQuaternion(this._parentQuaternionInv), n.quaternion.copy(O.setFromAxisAngle(this.rotationAxis, this.rotationAngle)), n.quaternion.multiply(this._quaternionStart).normalize());
596
+ t === "XYZE" ? (this.rotationAxis.copy(this._offset).cross(this.eye).normalize(), this.rotationAngle = this._offset.dot(F.copy(this.rotationAxis).cross(this.eye)) * a) : (t === "X" || t === "Y" || t === "Z") && (this.rotationAxis.copy(Bt[t]), F.copy(Bt[t]), i === "local" && F.applyQuaternion(this.worldQuaternion), F.cross(this.eye), F.length() === 0 ? l = !0 : this.rotationAngle = this._offset.dot(F.normalize()) * a), (t === "E" || l) && (this.rotationAxis.copy(this.eye), this.rotationAngle = this.pointEnd.angleTo(this.pointStart), this._startNorm.copy(this.pointStart).normalize(), this._endNorm.copy(this.pointEnd).normalize(), this.rotationAngle *= this._endNorm.cross(this._startNorm).dot(this.eye) < 0 ? 1 : -1), this.rotationSnap && (this.rotationAngle = Math.round(this.rotationAngle / this.rotationSnap) * this.rotationSnap), i === "local" && t !== "E" && t !== "XYZE" ? (n.quaternion.copy(this._quaternionStart), n.quaternion.multiply(D.setFromAxisAngle(this.rotationAxis, this.rotationAngle)).normalize()) : (this.rotationAxis.applyQuaternion(this._parentQuaternionInv), n.quaternion.copy(D.setFromAxisAngle(this.rotationAxis, this.rotationAngle)), n.quaternion.multiply(this._quaternionStart).normalize());
597
597
  }
598
- this.dispatchEvent(lt), this.dispatchEvent(Gt);
598
+ this.dispatchEvent(mt), this.dispatchEvent(Vt);
599
599
  }
600
600
  }
601
601
  pointerUp(e) {
602
- e !== null && e.button !== 0 || (this.dragging && this.axis !== null && (zt.mode = this.mode, this.dispatchEvent(zt)), this.dragging = !1, this.axis = null);
602
+ e !== null && e.button !== 0 || (this.dragging && this.axis !== null && (Kt.mode = this.mode, this.dispatchEvent(Kt)), this.dragging = !1, this.axis = null);
603
603
  }
604
604
  dispose() {
605
605
  this.disconnect(), this._root.dispose();
@@ -625,7 +625,7 @@ class Ss extends an {
625
625
  * Resets the object's position, rotation and scale to when the current transform began.
626
626
  */
627
627
  reset() {
628
- this.enabled && this.dragging && (this.object.position.copy(this._positionStart), this.object.quaternion.copy(this._quaternionStart), this.object.scale.copy(this._scaleStart), this.dispatchEvent(lt), this.dispatchEvent(Gt), this.pointStart.copy(this.pointEnd));
628
+ this.enabled && this.dragging && (this.object.position.copy(this._positionStart), this.object.quaternion.copy(this._quaternionStart), this.object.scale.copy(this._scaleStart), this.dispatchEvent(mt), this.dispatchEvent(Vt), this.pointStart.copy(this.pointEnd));
629
629
  }
630
630
  /**
631
631
  * Returns the raycaster that is used for user interaction. This object is shared between all
@@ -634,7 +634,7 @@ class Ss extends an {
634
634
  * @returns {Raycaster} The internal raycaster.
635
635
  */
636
636
  getRaycaster() {
637
- return me;
637
+ return ye;
638
638
  }
639
639
  /**
640
640
  * Returns the transformation mode.
@@ -705,7 +705,7 @@ class Ss extends an {
705
705
  i.xAxis.color.set(e), i.yAxis.color.set(t), i.zAxis.color.set(s), i.active.color.set(n), i.xAxisTransparent.color.set(e), i.yAxisTransparent.color.set(t), i.zAxisTransparent.color.set(s), i.activeTransparent.color.set(n), i.xAxis._color && i.xAxis._color.set(e), i.yAxis._color && i.yAxis._color.set(t), i.zAxis._color && i.zAxis._color.set(s), i.active._color && i.active._color.set(n), i.xAxisTransparent._color && i.xAxisTransparent._color.set(e), i.yAxisTransparent._color && i.yAxisTransparent._color.set(t), i.zAxisTransparent._color && i.zAxisTransparent._color.set(s), i.activeTransparent._color && i.activeTransparent._color.set(n);
706
706
  }
707
707
  }
708
- function As(r) {
708
+ function Ds(r) {
709
709
  if (this.domElement.ownerDocument.pointerLockElement)
710
710
  return {
711
711
  x: 0,
@@ -721,7 +721,7 @@ function As(r) {
721
721
  };
722
722
  }
723
723
  }
724
- function Rs(r) {
724
+ function Os(r) {
725
725
  if (this.enabled)
726
726
  switch (r.pointerType) {
727
727
  case "mouse":
@@ -730,24 +730,24 @@ function Rs(r) {
730
730
  break;
731
731
  }
732
732
  }
733
- function Ps(r) {
733
+ function ks(r) {
734
734
  this.enabled && (document.pointerLockElement || this.domElement.setPointerCapture(r.pointerId), this.domElement.addEventListener("pointermove", this._onPointerMove), this.pointerHover(this._getPointer(r)), this.pointerDown(this._getPointer(r)));
735
735
  }
736
- function Ls(r) {
736
+ function Ns(r) {
737
737
  this.enabled && this.pointerMove(this._getPointer(r));
738
738
  }
739
- function Is(r) {
739
+ function js(r) {
740
740
  this.enabled && (this.domElement.releasePointerCapture(r.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.pointerUp(this._getPointer(r)));
741
741
  }
742
- function ct(r, e, t) {
742
+ function gt(r, e, t) {
743
743
  const s = e.intersectObject(r, !0);
744
744
  for (let n = 0; n < s.length; n++)
745
745
  if (s[n].object.visible || t)
746
746
  return s[n];
747
747
  return !1;
748
748
  }
749
- const $e = new Dn(), L = new M(0, 1, 0), Xt = new M(0, 0, 0), Yt = new Se(), Je = new K(), it = new K(), te = new M(), Bt = new Se(), De = new M(1, 0, 0), ye = new M(0, 1, 0), Ne = new M(0, 0, 1), et = new M(), Le = new M(), Ie = new M();
750
- class Os extends ze {
749
+ const st = new Gn(), C = new S(0, 1, 0), Zt = new S(0, 0, 0), Wt = new Pe(), it = new K(), ct = new K(), ne = new S(), Qt = new Pe(), ke = new S(1, 0, 0), be = new S(0, 1, 0), Ne = new S(0, 0, 1), ot = new S(), Ie = new S(), Ce = new S();
750
+ class Hs extends Ye {
751
751
  constructor(e) {
752
752
  super(), this.isTransformControlsRoot = !0, this.controls = e, this.visible = !1;
753
753
  }
@@ -762,16 +762,16 @@ class Os extends ze {
762
762
  });
763
763
  }
764
764
  }
765
- class Cs extends ze {
765
+ class Fs extends Ye {
766
766
  constructor() {
767
767
  super(), this.isTransformControlsGizmo = !0, this.type = "TransformControlsGizmo";
768
- const e = new _e({
768
+ const e = new we({
769
769
  depthTest: !1,
770
770
  depthWrite: !1,
771
771
  fog: !1,
772
772
  toneMapped: !1,
773
773
  transparent: !0
774
- }), t = new je({
774
+ }), t = new He({
775
775
  depthTest: !1,
776
776
  depthWrite: !1,
777
777
  fog: !1,
@@ -789,231 +789,231 @@ class Cs extends ze {
789
789
  a.color.setHex(255);
790
790
  const l = e.clone();
791
791
  l.color.setHex(16711680), l.opacity = 0.5;
792
- const h = e.clone();
793
- h.color.setHex(65280), h.opacity = 0.5;
792
+ const c = e.clone();
793
+ c.color.setHex(65280), c.opacity = 0.5;
794
794
  const u = e.clone();
795
795
  u.color.setHex(255), u.opacity = 0.5;
796
- const c = e.clone();
797
- c.opacity = 0.25;
798
- const p = e.clone();
799
- p.color.setHex(16776960), p.opacity = 0.25;
796
+ const h = e.clone();
797
+ h.opacity = 0.25;
798
+ const d = e.clone();
799
+ d.color.setHex(16776960), d.opacity = 0.25;
800
800
  const m = e.clone();
801
801
  m.color.setHex(16776960);
802
- const b = e.clone();
803
- b.color.setHex(7895160), this.materialLib = {
802
+ const w = e.clone();
803
+ w.color.setHex(7895160), this.materialLib = {
804
804
  xAxis: i,
805
805
  yAxis: o,
806
806
  zAxis: a,
807
807
  active: m,
808
808
  xAxisTransparent: l,
809
- yAxisTransparent: h,
809
+ yAxisTransparent: c,
810
810
  zAxisTransparent: u,
811
- activeTransparent: p
811
+ activeTransparent: d
812
812
  };
813
- const f = new Y(0, 0.04, 0.1, 12);
813
+ const f = new B(0, 0.04, 0.1, 12);
814
814
  f.translate(0, 0.05, 0);
815
- const y = new z(0.08, 0.08, 0.08);
815
+ const y = new G(0.08, 0.08, 0.08);
816
816
  y.translate(0, 0.04, 0);
817
- const d = new Ge();
818
- d.setAttribute("position", new de([0, 0, 0, 1, 0, 0], 3));
819
- const _ = new Y(75e-4, 75e-4, 0.5, 3);
820
- _.translate(0, 0.25, 0);
821
- function x(Z, Be) {
822
- const J = new Pe(Z, 75e-4, 3, 64, Be * Math.PI * 2);
823
- return J.rotateY(Math.PI / 2), J.rotateX(Math.PI / 2), J;
817
+ const p = new Re();
818
+ p.setAttribute("position", new pe([0, 0, 0, 1, 0, 0], 3));
819
+ const b = new B(75e-4, 75e-4, 0.5, 3);
820
+ b.translate(0, 0.25, 0);
821
+ function T(q, Qe) {
822
+ const te = new Le(q, 75e-4, 3, 64, Qe * Math.PI * 2);
823
+ return te.rotateY(Math.PI / 2), te.rotateX(Math.PI / 2), te;
824
824
  }
825
- function S() {
826
- const Z = new Ge();
827
- return Z.setAttribute("position", new de([0, 0, 0, 1, 1, 1], 3)), Z;
825
+ function M() {
826
+ const q = new Re();
827
+ return q.setAttribute("position", new pe([0, 0, 0, 1, 1, 1], 3)), q;
828
828
  }
829
829
  const R = {
830
830
  X: [
831
- [new T(f, i), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
832
- [new T(f, i), [-0.5, 0, 0], [0, 0, Math.PI / 2]],
833
- [new T(_, i), [0, 0, 0], [0, 0, -Math.PI / 2]]
831
+ [new E(f, i), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
832
+ [new E(f, i), [-0.5, 0, 0], [0, 0, Math.PI / 2]],
833
+ [new E(b, i), [0, 0, 0], [0, 0, -Math.PI / 2]]
834
834
  ],
835
835
  Y: [
836
- [new T(f, o), [0, 0.5, 0]],
837
- [new T(f, o), [0, -0.5, 0], [Math.PI, 0, 0]],
838
- [new T(_, o)]
836
+ [new E(f, o), [0, 0.5, 0]],
837
+ [new E(f, o), [0, -0.5, 0], [Math.PI, 0, 0]],
838
+ [new E(b, o)]
839
839
  ],
840
840
  Z: [
841
- [new T(f, a), [0, 0, 0.5], [Math.PI / 2, 0, 0]],
842
- [new T(f, a), [0, 0, -0.5], [-Math.PI / 2, 0, 0]],
843
- [new T(_, a), null, [Math.PI / 2, 0, 0]]
841
+ [new E(f, a), [0, 0, 0.5], [Math.PI / 2, 0, 0]],
842
+ [new E(f, a), [0, 0, -0.5], [-Math.PI / 2, 0, 0]],
843
+ [new E(b, a), null, [Math.PI / 2, 0, 0]]
844
844
  ],
845
845
  XYZ: [
846
- [new T(new qe(0.1, 0), c), [0, 0, 0]]
846
+ [new E(new tt(0.1, 0), h), [0, 0, 0]]
847
847
  ],
848
848
  XY: [
849
- [new T(new z(0.15, 0.15, 0.01), u), [0.15, 0.15, 0]]
849
+ [new E(new G(0.15, 0.15, 0.01), u), [0.15, 0.15, 0]]
850
850
  ],
851
851
  YZ: [
852
- [new T(new z(0.15, 0.15, 0.01), l), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
852
+ [new E(new G(0.15, 0.15, 0.01), l), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
853
853
  ],
854
854
  XZ: [
855
- [new T(new z(0.15, 0.15, 0.01), h), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
855
+ [new E(new G(0.15, 0.15, 0.01), c), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
856
856
  ]
857
857
  }, v = {
858
858
  X: [
859
- [new T(new Y(0.2, 0, 0.6, 4), s), [0.3, 0, 0], [0, 0, -Math.PI / 2]],
860
- [new T(new Y(0.2, 0, 0.6, 4), s), [-0.3, 0, 0], [0, 0, Math.PI / 2]]
859
+ [new E(new B(0.2, 0, 0.6, 4), s), [0.3, 0, 0], [0, 0, -Math.PI / 2]],
860
+ [new E(new B(0.2, 0, 0.6, 4), s), [-0.3, 0, 0], [0, 0, Math.PI / 2]]
861
861
  ],
862
862
  Y: [
863
- [new T(new Y(0.2, 0, 0.6, 4), s), [0, 0.3, 0]],
864
- [new T(new Y(0.2, 0, 0.6, 4), s), [0, -0.3, 0], [0, 0, Math.PI]]
863
+ [new E(new B(0.2, 0, 0.6, 4), s), [0, 0.3, 0]],
864
+ [new E(new B(0.2, 0, 0.6, 4), s), [0, -0.3, 0], [0, 0, Math.PI]]
865
865
  ],
866
866
  Z: [
867
- [new T(new Y(0.2, 0, 0.6, 4), s), [0, 0, 0.3], [Math.PI / 2, 0, 0]],
868
- [new T(new Y(0.2, 0, 0.6, 4), s), [0, 0, -0.3], [-Math.PI / 2, 0, 0]]
867
+ [new E(new B(0.2, 0, 0.6, 4), s), [0, 0, 0.3], [Math.PI / 2, 0, 0]],
868
+ [new E(new B(0.2, 0, 0.6, 4), s), [0, 0, -0.3], [-Math.PI / 2, 0, 0]]
869
869
  ],
870
870
  XYZ: [
871
- [new T(new qe(0.2, 0), s)]
871
+ [new E(new tt(0.2, 0), s)]
872
872
  ],
873
873
  XY: [
874
- [new T(new z(0.2, 0.2, 0.01), s), [0.15, 0.15, 0]]
874
+ [new E(new G(0.2, 0.2, 0.01), s), [0.15, 0.15, 0]]
875
875
  ],
876
876
  YZ: [
877
- [new T(new z(0.2, 0.2, 0.01), s), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
877
+ [new E(new G(0.2, 0.2, 0.01), s), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
878
878
  ],
879
879
  XZ: [
880
- [new T(new z(0.2, 0.2, 0.01), s), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
880
+ [new E(new G(0.2, 0.2, 0.01), s), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
881
881
  ]
882
882
  }, I = {
883
883
  START: [
884
- [new T(new qe(0.01, 2), n), null, null, null, "helper"]
884
+ [new E(new tt(0.01, 2), n), null, null, null, "helper"]
885
885
  ],
886
886
  END: [
887
- [new T(new qe(0.01, 2), n), null, null, null, "helper"]
887
+ [new E(new tt(0.01, 2), n), null, null, null, "helper"]
888
888
  ],
889
889
  DELTA: [
890
- [new re(S(), n), null, null, null, "helper"]
890
+ [new ae(M(), n), null, null, null, "helper"]
891
891
  ],
892
892
  X: [
893
- [new re(d, n), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
893
+ [new ae(p, n), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
894
894
  ],
895
895
  Y: [
896
- [new re(d, n), [0, -1e3, 0], [0, 0, Math.PI / 2], [1e6, 1, 1], "helper"]
896
+ [new ae(p, n), [0, -1e3, 0], [0, 0, Math.PI / 2], [1e6, 1, 1], "helper"]
897
897
  ],
898
898
  Z: [
899
- [new re(d, n), [0, 0, -1e3], [0, -Math.PI / 2, 0], [1e6, 1, 1], "helper"]
899
+ [new ae(p, n), [0, 0, -1e3], [0, -Math.PI / 2, 0], [1e6, 1, 1], "helper"]
900
900
  ]
901
- }, ie = {
901
+ }, V = {
902
902
  XYZE: [
903
- [new T(x(0.5, 1), b), null, [0, Math.PI / 2, 0]]
903
+ [new E(T(0.5, 1), w), null, [0, Math.PI / 2, 0]]
904
904
  ],
905
905
  X: [
906
- [new T(x(0.5, 0.5), i)]
906
+ [new E(T(0.5, 0.5), i)]
907
907
  ],
908
908
  Y: [
909
- [new T(x(0.5, 0.5), o), null, [0, 0, -Math.PI / 2]]
909
+ [new E(T(0.5, 0.5), o), null, [0, 0, -Math.PI / 2]]
910
910
  ],
911
911
  Z: [
912
- [new T(x(0.5, 0.5), a), null, [0, Math.PI / 2, 0]]
912
+ [new E(T(0.5, 0.5), a), null, [0, Math.PI / 2, 0]]
913
913
  ],
914
914
  E: [
915
- [new T(x(0.75, 1), p), null, [0, Math.PI / 2, 0]]
915
+ [new E(T(0.75, 1), d), null, [0, Math.PI / 2, 0]]
916
916
  ]
917
- }, ee = {
917
+ }, W = {
918
918
  AXIS: [
919
- [new re(d, n), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
919
+ [new ae(p, n), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
920
920
  ]
921
- }, fe = {
921
+ }, Q = {
922
922
  XYZE: [
923
- [new T(new Cn(0.25, 10, 8), s)]
923
+ [new E(new zn(0.25, 10, 8), s)]
924
924
  ],
925
925
  X: [
926
- [new T(new Pe(0.5, 0.1, 4, 24), s), [0, 0, 0], [0, -Math.PI / 2, -Math.PI / 2]]
926
+ [new E(new Le(0.5, 0.1, 4, 24), s), [0, 0, 0], [0, -Math.PI / 2, -Math.PI / 2]]
927
927
  ],
928
928
  Y: [
929
- [new T(new Pe(0.5, 0.1, 4, 24), s), [0, 0, 0], [Math.PI / 2, 0, 0]]
929
+ [new E(new Le(0.5, 0.1, 4, 24), s), [0, 0, 0], [Math.PI / 2, 0, 0]]
930
930
  ],
931
931
  Z: [
932
- [new T(new Pe(0.5, 0.1, 4, 24), s), [0, 0, 0], [0, 0, -Math.PI / 2]]
932
+ [new E(new Le(0.5, 0.1, 4, 24), s), [0, 0, 0], [0, 0, -Math.PI / 2]]
933
933
  ],
934
934
  E: [
935
- [new T(new Pe(0.75, 0.1, 2, 24), s)]
935
+ [new E(new Le(0.75, 0.1, 2, 24), s)]
936
936
  ]
937
- }, $ = {
937
+ }, me = {
938
938
  X: [
939
- [new T(y, i), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
940
- [new T(_, i), [0, 0, 0], [0, 0, -Math.PI / 2]],
941
- [new T(y, i), [-0.5, 0, 0], [0, 0, Math.PI / 2]]
939
+ [new E(y, i), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
940
+ [new E(b, i), [0, 0, 0], [0, 0, -Math.PI / 2]],
941
+ [new E(y, i), [-0.5, 0, 0], [0, 0, Math.PI / 2]]
942
942
  ],
943
943
  Y: [
944
- [new T(y, o), [0, 0.5, 0]],
945
- [new T(_, o)],
946
- [new T(y, o), [0, -0.5, 0], [0, 0, Math.PI]]
944
+ [new E(y, o), [0, 0.5, 0]],
945
+ [new E(b, o)],
946
+ [new E(y, o), [0, -0.5, 0], [0, 0, Math.PI]]
947
947
  ],
948
948
  Z: [
949
- [new T(y, a), [0, 0, 0.5], [Math.PI / 2, 0, 0]],
950
- [new T(_, a), [0, 0, 0], [Math.PI / 2, 0, 0]],
951
- [new T(y, a), [0, 0, -0.5], [-Math.PI / 2, 0, 0]]
949
+ [new E(y, a), [0, 0, 0.5], [Math.PI / 2, 0, 0]],
950
+ [new E(b, a), [0, 0, 0], [Math.PI / 2, 0, 0]],
951
+ [new E(y, a), [0, 0, -0.5], [-Math.PI / 2, 0, 0]]
952
952
  ],
953
953
  XY: [
954
- [new T(new z(0.15, 0.15, 0.01), u), [0.15, 0.15, 0]]
954
+ [new E(new G(0.15, 0.15, 0.01), u), [0.15, 0.15, 0]]
955
955
  ],
956
956
  YZ: [
957
- [new T(new z(0.15, 0.15, 0.01), l), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
957
+ [new E(new G(0.15, 0.15, 0.01), l), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
958
958
  ],
959
959
  XZ: [
960
- [new T(new z(0.15, 0.15, 0.01), h), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
960
+ [new E(new G(0.15, 0.15, 0.01), c), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
961
961
  ],
962
962
  XYZ: [
963
- [new T(new z(0.1, 0.1, 0.1), c)]
963
+ [new E(new G(0.1, 0.1, 0.1), h)]
964
964
  ]
965
- }, E = {
965
+ }, ge = {
966
966
  X: [
967
- [new T(new Y(0.2, 0, 0.6, 4), s), [0.3, 0, 0], [0, 0, -Math.PI / 2]],
968
- [new T(new Y(0.2, 0, 0.6, 4), s), [-0.3, 0, 0], [0, 0, Math.PI / 2]]
967
+ [new E(new B(0.2, 0, 0.6, 4), s), [0.3, 0, 0], [0, 0, -Math.PI / 2]],
968
+ [new E(new B(0.2, 0, 0.6, 4), s), [-0.3, 0, 0], [0, 0, Math.PI / 2]]
969
969
  ],
970
970
  Y: [
971
- [new T(new Y(0.2, 0, 0.6, 4), s), [0, 0.3, 0]],
972
- [new T(new Y(0.2, 0, 0.6, 4), s), [0, -0.3, 0], [0, 0, Math.PI]]
971
+ [new E(new B(0.2, 0, 0.6, 4), s), [0, 0.3, 0]],
972
+ [new E(new B(0.2, 0, 0.6, 4), s), [0, -0.3, 0], [0, 0, Math.PI]]
973
973
  ],
974
974
  Z: [
975
- [new T(new Y(0.2, 0, 0.6, 4), s), [0, 0, 0.3], [Math.PI / 2, 0, 0]],
976
- [new T(new Y(0.2, 0, 0.6, 4), s), [0, 0, -0.3], [-Math.PI / 2, 0, 0]]
975
+ [new E(new B(0.2, 0, 0.6, 4), s), [0, 0, 0.3], [Math.PI / 2, 0, 0]],
976
+ [new E(new B(0.2, 0, 0.6, 4), s), [0, 0, -0.3], [-Math.PI / 2, 0, 0]]
977
977
  ],
978
978
  XY: [
979
- [new T(new z(0.2, 0.2, 0.01), s), [0.15, 0.15, 0]]
979
+ [new E(new G(0.2, 0.2, 0.01), s), [0.15, 0.15, 0]]
980
980
  ],
981
981
  YZ: [
982
- [new T(new z(0.2, 0.2, 0.01), s), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
982
+ [new E(new G(0.2, 0.2, 0.01), s), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
983
983
  ],
984
984
  XZ: [
985
- [new T(new z(0.2, 0.2, 0.01), s), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
985
+ [new E(new G(0.2, 0.2, 0.01), s), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
986
986
  ],
987
987
  XYZ: [
988
- [new T(new z(0.2, 0.2, 0.2), s), [0, 0, 0]]
988
+ [new E(new G(0.2, 0.2, 0.2), s), [0, 0, 0]]
989
989
  ]
990
- }, j = {
990
+ }, x = {
991
991
  X: [
992
- [new re(d, n), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
992
+ [new ae(p, n), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
993
993
  ],
994
994
  Y: [
995
- [new re(d, n), [0, -1e3, 0], [0, 0, Math.PI / 2], [1e6, 1, 1], "helper"]
995
+ [new ae(p, n), [0, -1e3, 0], [0, 0, Math.PI / 2], [1e6, 1, 1], "helper"]
996
996
  ],
997
997
  Z: [
998
- [new re(d, n), [0, 0, -1e3], [0, -Math.PI / 2, 0], [1e6, 1, 1], "helper"]
998
+ [new ae(p, n), [0, 0, -1e3], [0, -Math.PI / 2, 0], [1e6, 1, 1], "helper"]
999
999
  ]
1000
1000
  };
1001
- function oe(Z) {
1002
- const Be = new ze();
1003
- for (const J in Z)
1004
- for (let Te = Z[J].length; Te--; ) {
1005
- const X = Z[J][Te][0].clone(), Ke = Z[J][Te][1], Ve = Z[J][Te][2], Ze = Z[J][Te][3], Tn = Z[J][Te][4];
1006
- X.name = J, X.tag = Tn, Ke && X.position.set(Ke[0], Ke[1], Ke[2]), Ve && X.rotation.set(Ve[0], Ve[1], Ve[2]), Ze && X.scale.set(Ze[0], Ze[1], Ze[2]), X.updateMatrix();
1007
- const Pt = X.geometry.clone();
1008
- Pt.applyMatrix4(X.matrix), X.geometry = Pt, X.renderOrder = 1 / 0, X.position.set(0, 0, 0), X.rotation.set(0, 0, 0), X.scale.set(1, 1, 1), Be.add(X);
1001
+ function P(q) {
1002
+ const Qe = new Ye();
1003
+ for (const te in q)
1004
+ for (let Ee = q[te].length; Ee--; ) {
1005
+ const X = q[te][Ee][0].clone(), qe = q[te][Ee][1], $e = q[te][Ee][2], Je = q[te][Ee][3], Rn = q[te][Ee][4];
1006
+ X.name = te, X.tag = Rn, qe && X.position.set(qe[0], qe[1], qe[2]), $e && X.rotation.set($e[0], $e[1], $e[2]), Je && X.scale.set(Je[0], Je[1], Je[2]), X.updateMatrix();
1007
+ const kt = X.geometry.clone();
1008
+ kt.applyMatrix4(X.matrix), X.geometry = kt, X.renderOrder = 1 / 0, X.position.set(0, 0, 0), X.rotation.set(0, 0, 0), X.scale.set(1, 1, 1), Qe.add(X);
1009
1009
  }
1010
- return Be;
1010
+ return Qe;
1011
1011
  }
1012
- this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = oe(R)), this.add(this.gizmo.rotate = oe(ie)), this.add(this.gizmo.scale = oe($)), this.add(this.picker.translate = oe(v)), this.add(this.picker.rotate = oe(fe)), this.add(this.picker.scale = oe(E)), this.add(this.helper.translate = oe(I)), this.add(this.helper.rotate = oe(ee)), this.add(this.helper.scale = oe(j)), this.picker.translate.visible = !1, this.picker.rotate.visible = !1, this.picker.scale.visible = !1;
1012
+ this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = P(R)), this.add(this.gizmo.rotate = P(V)), this.add(this.gizmo.scale = P(me)), this.add(this.picker.translate = P(v)), this.add(this.picker.rotate = P(Q)), this.add(this.picker.scale = P(ge)), this.add(this.helper.translate = P(I)), this.add(this.helper.rotate = P(W)), this.add(this.helper.scale = P(x)), this.picker.translate.visible = !1, this.picker.rotate.visible = !1, this.picker.scale.visible = !1;
1013
1013
  }
1014
1014
  // updateMatrixWorld will update transformations and appearance of individual handles
1015
1015
  updateMatrixWorld(e) {
1016
- const s = (this.mode === "scale" ? "local" : this.space) === "local" ? this.worldQuaternion : it;
1016
+ const s = (this.mode === "scale" ? "local" : this.space) === "local" ? this.worldQuaternion : ct;
1017
1017
  this.gizmo.translate.visible = this.mode === "translate", this.gizmo.rotate.visible = this.mode === "rotate", this.gizmo.scale.visible = this.mode === "scale", this.helper.translate.visible = this.mode === "translate", this.helper.rotate.visible = this.mode === "rotate", this.helper.scale.visible = this.mode === "scale";
1018
1018
  let n = [];
1019
1019
  n = n.concat(this.picker[this.mode].children), n = n.concat(this.gizmo[this.mode].children), n = n.concat(this.helper[this.mode].children);
@@ -1022,61 +1022,61 @@ class Cs extends ze {
1022
1022
  o.visible = !0, o.rotation.set(0, 0, 0), o.position.copy(this.worldPosition);
1023
1023
  let a;
1024
1024
  if (this.camera.isOrthographicCamera ? a = (this.camera.top - this.camera.bottom) / this.camera.zoom : a = this.worldPosition.distanceTo(this.cameraPosition) * Math.min(1.9 * Math.tan(Math.PI * this.camera.fov / 360) / this.camera.zoom, 7), o.scale.set(1, 1, 1).multiplyScalar(a * this.size / 4), o.tag === "helper") {
1025
- o.visible = !1, o.name === "AXIS" ? (o.visible = !!this.axis, this.axis === "X" && (O.setFromEuler($e.set(0, 0, 0)), o.quaternion.copy(s).multiply(O), Math.abs(L.copy(De).applyQuaternion(s).dot(this.eye)) > 0.9 && (o.visible = !1)), this.axis === "Y" && (O.setFromEuler($e.set(0, 0, Math.PI / 2)), o.quaternion.copy(s).multiply(O), Math.abs(L.copy(ye).applyQuaternion(s).dot(this.eye)) > 0.9 && (o.visible = !1)), this.axis === "Z" && (O.setFromEuler($e.set(0, Math.PI / 2, 0)), o.quaternion.copy(s).multiply(O), Math.abs(L.copy(Ne).applyQuaternion(s).dot(this.eye)) > 0.9 && (o.visible = !1)), this.axis === "XYZE" && (O.setFromEuler($e.set(0, Math.PI / 2, 0)), L.copy(this.rotationAxis), o.quaternion.setFromRotationMatrix(Yt.lookAt(Xt, L, ye)), o.quaternion.multiply(O), o.visible = this.dragging), this.axis === "E" && (o.visible = !1)) : o.name === "START" ? (o.position.copy(this.worldPositionStart), o.visible = this.dragging) : o.name === "END" ? (o.position.copy(this.worldPosition), o.visible = this.dragging) : o.name === "DELTA" ? (o.position.copy(this.worldPositionStart), o.quaternion.copy(this.worldQuaternionStart), H.set(1e-10, 1e-10, 1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1), H.applyQuaternion(this.worldQuaternionStart.clone().invert()), o.scale.copy(H), o.visible = this.dragging) : (o.quaternion.copy(s), this.dragging ? o.position.copy(this.worldPositionStart) : o.position.copy(this.worldPosition), this.axis && (o.visible = this.axis.search(o.name) !== -1));
1025
+ o.visible = !1, o.name === "AXIS" ? (o.visible = !!this.axis, this.axis === "X" && (D.setFromEuler(st.set(0, 0, 0)), o.quaternion.copy(s).multiply(D), Math.abs(C.copy(ke).applyQuaternion(s).dot(this.eye)) > 0.9 && (o.visible = !1)), this.axis === "Y" && (D.setFromEuler(st.set(0, 0, Math.PI / 2)), o.quaternion.copy(s).multiply(D), Math.abs(C.copy(be).applyQuaternion(s).dot(this.eye)) > 0.9 && (o.visible = !1)), this.axis === "Z" && (D.setFromEuler(st.set(0, Math.PI / 2, 0)), o.quaternion.copy(s).multiply(D), Math.abs(C.copy(Ne).applyQuaternion(s).dot(this.eye)) > 0.9 && (o.visible = !1)), this.axis === "XYZE" && (D.setFromEuler(st.set(0, Math.PI / 2, 0)), C.copy(this.rotationAxis), o.quaternion.setFromRotationMatrix(Wt.lookAt(Zt, C, be)), o.quaternion.multiply(D), o.visible = this.dragging), this.axis === "E" && (o.visible = !1)) : o.name === "START" ? (o.position.copy(this.worldPositionStart), o.visible = this.dragging) : o.name === "END" ? (o.position.copy(this.worldPosition), o.visible = this.dragging) : o.name === "DELTA" ? (o.position.copy(this.worldPositionStart), o.quaternion.copy(this.worldQuaternionStart), F.set(1e-10, 1e-10, 1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1), F.applyQuaternion(this.worldQuaternionStart.clone().invert()), o.scale.copy(F), o.visible = this.dragging) : (o.quaternion.copy(s), this.dragging ? o.position.copy(this.worldPositionStart) : o.position.copy(this.worldPosition), this.axis && (o.visible = this.axis.search(o.name) !== -1));
1026
1026
  continue;
1027
1027
  }
1028
- o.quaternion.copy(s), this.mode === "translate" || this.mode === "scale" ? (o.name === "X" && Math.abs(L.copy(De).applyQuaternion(s).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "Y" && Math.abs(L.copy(ye).applyQuaternion(s).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "Z" && Math.abs(L.copy(Ne).applyQuaternion(s).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "XY" && Math.abs(L.copy(Ne).applyQuaternion(s).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "YZ" && Math.abs(L.copy(De).applyQuaternion(s).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "XZ" && Math.abs(L.copy(ye).applyQuaternion(s).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1)) : this.mode === "rotate" && (Je.copy(s), L.copy(this.eye).applyQuaternion(O.copy(s).invert()), o.name.search("E") !== -1 && o.quaternion.setFromRotationMatrix(Yt.lookAt(this.eye, Xt, ye)), o.name === "X" && (O.setFromAxisAngle(De, Math.atan2(-L.y, L.z)), O.multiplyQuaternions(Je, O), o.quaternion.copy(O)), o.name === "Y" && (O.setFromAxisAngle(ye, Math.atan2(L.x, L.z)), O.multiplyQuaternions(Je, O), o.quaternion.copy(O)), o.name === "Z" && (O.setFromAxisAngle(Ne, Math.atan2(L.y, L.x)), O.multiplyQuaternions(Je, O), o.quaternion.copy(O))), o.visible = o.visible && (o.name.indexOf("X") === -1 || this.showX), o.visible = o.visible && (o.name.indexOf("Y") === -1 || this.showY), o.visible = o.visible && (o.name.indexOf("Z") === -1 || this.showZ), o.visible = o.visible && (o.name.indexOf("E") === -1 || this.showX && this.showY && this.showZ), o.visible = o.visible && (o.name.indexOf("XY") === -1 || this.showXY), o.visible = o.visible && (o.name.indexOf("YZ") === -1 || this.showYZ), o.visible = o.visible && (o.name.indexOf("XZ") === -1 || this.showXZ), o.material._color = o.material._color || o.material.color.clone(), o.material._opacity = o.material._opacity || o.material.opacity, o.material.color.copy(o.material._color), o.material.opacity = o.material._opacity, this.enabled && this.axis && (o.name === this.axis ? (o.material.color.copy(this.materialLib.active.color), o.material.opacity = 1) : this.axis.split("").some(function(l) {
1028
+ o.quaternion.copy(s), this.mode === "translate" || this.mode === "scale" ? (o.name === "X" && Math.abs(C.copy(ke).applyQuaternion(s).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "Y" && Math.abs(C.copy(be).applyQuaternion(s).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "Z" && Math.abs(C.copy(Ne).applyQuaternion(s).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "XY" && Math.abs(C.copy(Ne).applyQuaternion(s).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "YZ" && Math.abs(C.copy(ke).applyQuaternion(s).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "XZ" && Math.abs(C.copy(be).applyQuaternion(s).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1)) : this.mode === "rotate" && (it.copy(s), C.copy(this.eye).applyQuaternion(D.copy(s).invert()), o.name.search("E") !== -1 && o.quaternion.setFromRotationMatrix(Wt.lookAt(this.eye, Zt, be)), o.name === "X" && (D.setFromAxisAngle(ke, Math.atan2(-C.y, C.z)), D.multiplyQuaternions(it, D), o.quaternion.copy(D)), o.name === "Y" && (D.setFromAxisAngle(be, Math.atan2(C.x, C.z)), D.multiplyQuaternions(it, D), o.quaternion.copy(D)), o.name === "Z" && (D.setFromAxisAngle(Ne, Math.atan2(C.y, C.x)), D.multiplyQuaternions(it, D), o.quaternion.copy(D))), o.visible = o.visible && (o.name.indexOf("X") === -1 || this.showX), o.visible = o.visible && (o.name.indexOf("Y") === -1 || this.showY), o.visible = o.visible && (o.name.indexOf("Z") === -1 || this.showZ), o.visible = o.visible && (o.name.indexOf("E") === -1 || this.showX && this.showY && this.showZ), o.visible = o.visible && (o.name.indexOf("XY") === -1 || this.showXY), o.visible = o.visible && (o.name.indexOf("YZ") === -1 || this.showYZ), o.visible = o.visible && (o.name.indexOf("XZ") === -1 || this.showXZ), o.material._color = o.material._color || o.material.color.clone(), o.material._opacity = o.material._opacity || o.material.opacity, o.material.color.copy(o.material._color), o.material.opacity = o.material._opacity, this.enabled && this.axis && (o.name === this.axis ? (o.material.color.copy(this.materialLib.active.color), o.material.opacity = 1) : this.axis.split("").some(function(l) {
1029
1029
  return o.name === l;
1030
1030
  }) && (o.material.color.copy(this.materialLib.active.color), o.material.opacity = 1));
1031
1031
  }
1032
1032
  super.updateMatrixWorld(e);
1033
1033
  }
1034
1034
  }
1035
- class Ds extends T {
1035
+ class Us extends E {
1036
1036
  constructor() {
1037
1037
  super(
1038
- new Nn(1e5, 1e5, 2, 2),
1039
- new _e({ visible: !1, wireframe: !0, side: cn, transparent: !0, opacity: 0.1, toneMapped: !1 })
1038
+ new Xn(1e5, 1e5, 2, 2),
1039
+ new we({ visible: !1, wireframe: !0, side: fn, transparent: !0, opacity: 0.1, toneMapped: !1 })
1040
1040
  ), this.isTransformControlsPlane = !0, this.type = "TransformControlsPlane";
1041
1041
  }
1042
1042
  updateMatrixWorld(e) {
1043
1043
  let t = this.space;
1044
- switch (this.position.copy(this.worldPosition), this.mode === "scale" && (t = "local"), et.copy(De).applyQuaternion(t === "local" ? this.worldQuaternion : it), Le.copy(ye).applyQuaternion(t === "local" ? this.worldQuaternion : it), Ie.copy(Ne).applyQuaternion(t === "local" ? this.worldQuaternion : it), L.copy(Le), this.mode) {
1044
+ switch (this.position.copy(this.worldPosition), this.mode === "scale" && (t = "local"), ot.copy(ke).applyQuaternion(t === "local" ? this.worldQuaternion : ct), Ie.copy(be).applyQuaternion(t === "local" ? this.worldQuaternion : ct), Ce.copy(Ne).applyQuaternion(t === "local" ? this.worldQuaternion : ct), C.copy(Ie), this.mode) {
1045
1045
  case "translate":
1046
1046
  case "scale":
1047
1047
  switch (this.axis) {
1048
1048
  case "X":
1049
- L.copy(this.eye).cross(et), te.copy(et).cross(L);
1049
+ C.copy(this.eye).cross(ot), ne.copy(ot).cross(C);
1050
1050
  break;
1051
1051
  case "Y":
1052
- L.copy(this.eye).cross(Le), te.copy(Le).cross(L);
1052
+ C.copy(this.eye).cross(Ie), ne.copy(Ie).cross(C);
1053
1053
  break;
1054
1054
  case "Z":
1055
- L.copy(this.eye).cross(Ie), te.copy(Ie).cross(L);
1055
+ C.copy(this.eye).cross(Ce), ne.copy(Ce).cross(C);
1056
1056
  break;
1057
1057
  case "XY":
1058
- te.copy(Ie);
1058
+ ne.copy(Ce);
1059
1059
  break;
1060
1060
  case "YZ":
1061
- te.copy(et);
1061
+ ne.copy(ot);
1062
1062
  break;
1063
1063
  case "XZ":
1064
- L.copy(Ie), te.copy(Le);
1064
+ C.copy(Ce), ne.copy(Ie);
1065
1065
  break;
1066
1066
  case "XYZ":
1067
1067
  case "E":
1068
- te.set(0, 0, 0);
1068
+ ne.set(0, 0, 0);
1069
1069
  break;
1070
1070
  }
1071
1071
  break;
1072
1072
  case "rotate":
1073
1073
  default:
1074
- te.set(0, 0, 0);
1074
+ ne.set(0, 0, 0);
1075
1075
  }
1076
- te.length() === 0 ? this.quaternion.copy(this.cameraQuaternion) : (Bt.lookAt(H.set(0, 0, 0), te, L), this.quaternion.setFromRotationMatrix(Bt)), super.updateMatrixWorld(e);
1076
+ ne.length() === 0 ? this.quaternion.copy(this.cameraQuaternion) : (Qt.lookAt(F.set(0, 0, 0), ne, C), this.quaternion.setFromRotationMatrix(Qt)), super.updateMatrixWorld(e);
1077
1077
  }
1078
1078
  }
1079
- const w = {
1079
+ const _ = {
1080
1080
  mode: "",
1081
1081
  /** Three.js 场景 */
1082
1082
  scene: null,
@@ -1095,170 +1095,223 @@ const w = {
1095
1095
  /** 当前选中的物体 */
1096
1096
  selectedObject: null
1097
1097
  };
1098
- let ht = !1, Re = !1, be = null, wt = null, ot = null, we = [], ut;
1099
- function Ns(r, e = "edit", t) {
1100
- if (w.container = r, w.mode = e, ks(), js(), Hs(), t && (ei(t.scene, e), t != null && t.camera)) {
1098
+ let ht = !1, xe = !1, Te = null, Rt = null, ut = null, fe = [], yt, dt = null, Ge = null, Xe = null;
1099
+ function zs(r, e = "edit", t) {
1100
+ if (_.container = r, _.mode = e, Gs(), Xs(), Ys(), t && (ai(t.scene, e), t != null && t.camera)) {
1101
1101
  const s = t.camera;
1102
- w.camera.position.set(
1102
+ _.camera.position.set(
1103
1103
  s.position[0],
1104
1104
  s.position[1],
1105
1105
  s.position[2]
1106
- ), w.camera.rotation.set(
1106
+ ), _.camera.rotation.set(
1107
1107
  s.rotation[0],
1108
1108
  s.rotation[1],
1109
1109
  s.rotation[2]
1110
- ), w.camera.updateProjectionMatrix(), ut = s.target;
1110
+ ), _.camera.updateProjectionMatrix(), yt = s.target;
1111
1111
  }
1112
- zs(), Us(), ut && w.orbitControls && (w.orbitControls.target.fromArray(ut), w.orbitControls.update()), Qs(), yn(), e === "edit" && r.addEventListener("click", Ys), window.addEventListener("resize", Xs), t || Gs(), e === "edit" && Fs();
1112
+ Vs(), Ks(), yt && _.orbitControls && (_.orbitControls.target.fromArray(yt), _.orbitControls.update()), ni(), En(), Ge = (s) => Qs(s), Xe = () => Ws(), e === "edit" && r.addEventListener("click", Ge), window.addEventListener("resize", Xe), t || Zs(), e === "edit" && Bs();
1113
1113
  }
1114
- function ks() {
1115
- const r = new F.WebGLRenderer({ antialias: !0, alpha: !0 });
1116
- r.setSize(w.container.clientWidth, w.container.clientHeight), r.setPixelRatio(Math.min(window.devicePixelRatio, 2)), w.container.appendChild(r.domElement), w.renderer = r;
1114
+ function Gs() {
1115
+ const r = new H.WebGLRenderer({ antialias: !0, alpha: !0 });
1116
+ r.setSize(_.container.clientWidth, _.container.clientHeight), r.setPixelRatio(Math.min(window.devicePixelRatio, 2)), _.container.appendChild(r.domElement), _.renderer = r;
1117
1117
  }
1118
- function js() {
1119
- w.scene = new F.Scene(), w.scene.name = "sl_scene";
1118
+ function Xs() {
1119
+ _.scene = new H.Scene(), _.scene.name = "sl_scene";
1120
1120
  }
1121
- function Fs() {
1122
- const r = new F.GridHelper(30, 30, 8956671, 3364232);
1123
- r.name = "地板", r.userData.type = "initFloor", w.scene.add(r), w.gridHelper = r;
1121
+ function Bs() {
1122
+ const r = new H.GridHelper(30, 30, 8956671, 3364232);
1123
+ r.name = "地板", r.userData.type = "initFloor", _.scene.add(r), _.gridHelper = r;
1124
1124
  }
1125
- function Hs() {
1126
- const r = w.container, e = r.clientWidth / r.clientHeight, t = new F.PerspectiveCamera(45, e, 0.1, 1e3);
1127
- t.position.set(0, 6, 15), t.lookAt(0, 0, 0), w.camera = t;
1125
+ function Ys() {
1126
+ const r = _.container, e = r.clientWidth / r.clientHeight, t = new H.PerspectiveCamera(45, e, 0.1, 1e3);
1127
+ t.position.set(0, 6, 15), t.lookAt(0, 0, 0), _.camera = t;
1128
1128
  }
1129
- function Us() {
1130
- const r = new ps(w.camera, w.renderer.domElement);
1129
+ function Ks() {
1130
+ const r = new bs(_.camera, _.renderer.domElement);
1131
1131
  r.minDistance = 0, r.maxDistance = 1 / 0, r.addEventListener("start", () => {
1132
1132
  ht = !1;
1133
1133
  }), r.addEventListener("change", () => {
1134
1134
  ht = !0;
1135
1135
  }), r.addEventListener("end", () => {
1136
- ht && (Re = !0, setTimeout(() => {
1137
- Re = !1;
1136
+ ht && (xe = !0, setTimeout(() => {
1137
+ xe = !1;
1138
1138
  }, 200));
1139
- }), w.orbitControls = r;
1139
+ }), _.orbitControls = r;
1140
1140
  }
1141
- function zs() {
1142
- const r = new Ss(
1143
- w.camera,
1144
- w.renderer.domElement
1141
+ function Vs() {
1142
+ const r = new Cs(
1143
+ _.camera,
1144
+ _.renderer.domElement
1145
1145
  );
1146
1146
  r.addEventListener("dragging-changed", (e) => {
1147
- w.orbitControls.enabled = !e.value, e.value || (Re = !0, setTimeout(() => {
1148
- Re = !1;
1147
+ _.orbitControls.enabled = !e.value, e.value || (xe = !0, setTimeout(() => {
1148
+ xe = !1;
1149
1149
  }, 200));
1150
1150
  }), r.addEventListener("objectChange", () => {
1151
- wt && w.selectedObject && wt(w.selectedObject);
1152
- }), w.scene.add(r.getHelper()), w.transformControls = r;
1151
+ const e = _.selectedObject;
1152
+ if (Rt && e && Rt(e), e && e.type === "DirectionalLight") {
1153
+ const t = e.userData.helper;
1154
+ t && t.update && t.update();
1155
+ }
1156
+ }), _.scene.add(r.getHelper()), _.transformControls = r;
1153
1157
  }
1154
- function Gs() {
1155
- const r = new F.AmbientLight(16777215, 2);
1156
- w.scene.add(r);
1157
- const e = new F.DirectionalLight(16777215, 3);
1158
- e.position.set(48, 104, 138), w.scene.add(e);
1158
+ function Zs() {
1159
+ const r = new H.AmbientLight(16777215, 1);
1160
+ _.scene.add(r);
1159
1161
  }
1160
- function yn() {
1162
+ function En() {
1161
1163
  var r, e;
1162
- requestAnimationFrame(yn), us.update(), (r = w.orbitControls) == null || r.update(), (e = w.renderer) == null || e.render(w.scene, w.camera);
1164
+ dt = requestAnimationFrame(En), ys.update(), (r = _.orbitControls) == null || r.update(), (e = _.renderer) == null || e.render(_.scene, _.camera);
1163
1165
  }
1164
- function Xs() {
1165
- if (!w.container || !w.camera || !w.renderer) return;
1166
- const r = w.container.clientWidth, e = w.container.clientHeight;
1167
- r === 0 || e === 0 || (w.camera.aspect = r / e, w.camera.updateProjectionMatrix(), w.renderer.setSize(r, e));
1166
+ function Ws() {
1167
+ if (!_.container || !_.camera || !_.renderer) return;
1168
+ const r = _.container.clientWidth, e = _.container.clientHeight;
1169
+ r === 0 || e === 0 || (_.camera.aspect = r / e, _.camera.updateProjectionMatrix(), _.renderer.setSize(r, e));
1168
1170
  }
1169
- function vt(r) {
1170
- w.selectedObject !== r && (w.selectedObject && w.transformControls.detach(), w.selectedObject = r, w.transformControls.attach(r), w.transformControls.setMode("translate"), w.transformControls.showX = !0, w.transformControls.showY = !0, w.transformControls.showZ = !0, be == null || be(r));
1171
+ function Dt(r) {
1172
+ _.selectedObject !== r && (_.selectedObject && _.transformControls.detach(), _.selectedObject = r, _.transformControls.attach(r), _.transformControls.setMode("translate"), _.transformControls.showX = !0, _.transformControls.showY = !0, _.transformControls.showZ = !0, Te == null || Te(r));
1171
1173
  }
1172
- function St() {
1173
- w.selectedObject && (w.transformControls.detach(), w.selectedObject = null, be == null || be(null));
1174
+ function Ot() {
1175
+ _.selectedObject && (_.transformControls.detach(), _.selectedObject = null, Te == null || Te(null));
1174
1176
  }
1175
- function Ys(r) {
1176
- if (Re) {
1177
- Re = !1;
1177
+ function Qs(r) {
1178
+ if (xe) {
1179
+ xe = !1;
1178
1180
  return;
1179
1181
  }
1180
- const e = w.renderer.domElement.getBoundingClientRect(), t = new F.Vector2(
1182
+ const e = _.renderer.domElement.getBoundingClientRect(), t = new H.Vector2(
1181
1183
  (r.clientX - e.left) / e.width * 2 - 1,
1182
1184
  -((r.clientY - e.top) / e.height) * 2 + 1
1183
- ), s = new F.Raycaster();
1184
- s.setFromCamera(t, w.camera);
1185
+ ), s = new H.Raycaster();
1186
+ s.setFromCamera(t, _.camera);
1185
1187
  const n = [];
1186
- w.scene.traverse((o) => {
1187
- o.type === "Mesh" && o.userData.isMovable && n.push(o);
1188
+ _.scene.traverse((o) => {
1189
+ (o.userData.isMovable || o.userData.type === "lightHelper") && n.push(o);
1188
1190
  });
1189
1191
  const i = s.intersectObjects(n);
1190
- i.length > 0 ? vt(i[0].object) : St();
1192
+ if (i.length > 0) {
1193
+ let o = qs(i[0].object);
1194
+ Dt(o);
1195
+ } else
1196
+ Ot();
1191
1197
  }
1192
- function At(r, e = !1) {
1193
- w.scene.add(r), r.userData.isMovable && (Vs(r), Rt()), e && w.mode === "edit" && vt(r);
1198
+ function qs(r) {
1199
+ if (r.type === "Line") {
1200
+ console.log("firstObject", r);
1201
+ const e = r.parent;
1202
+ switch (e.type) {
1203
+ case "DirectionalLightHelper":
1204
+ return e.light;
1205
+ }
1206
+ } else
1207
+ return r;
1208
+ }
1209
+ function Ve(r, e = !1) {
1210
+ _.scene.add(r), r.userData.isMovable && (ei(r), pt()), e && _.mode === "edit" && Dt(r);
1194
1211
  }
1195
- function Bs(r) {
1196
- w.selectedObject === r && St(), r.parent ? r.parent.remove(r) : w.scene.remove(r), Zs(r), Rt();
1212
+ function $s(r) {
1213
+ _.selectedObject === r && Ot(), r.parent ? r.parent.remove(r) : _.scene.remove(r), ti(r), pt();
1197
1214
  }
1198
- function Ks(r) {
1199
- const e = w.scene.getObjectByProperty("uuid", r);
1200
- e && Bs(e);
1215
+ function Js(r) {
1216
+ const e = _.scene.getObjectByProperty("uuid", r);
1217
+ e && $s(e);
1201
1218
  }
1202
- function Vs(r) {
1203
- r.userData.isMovable && r.parent === w.scene && (we.includes(r) || we.push(r));
1219
+ function ei(r) {
1220
+ r.userData.isMovable && r.parent === _.scene && (fe.includes(r) || fe.push(r));
1204
1221
  }
1205
- function Zs(r) {
1206
- const e = we.indexOf(r);
1207
- e !== -1 && we.splice(e, 1);
1222
+ function ti(r) {
1223
+ const e = fe.indexOf(r);
1224
+ e !== -1 && fe.splice(e, 1);
1208
1225
  }
1209
- function Qs() {
1226
+ function ni() {
1210
1227
  const r = [];
1211
- w.scene.children.forEach((e) => {
1228
+ _.scene.children.forEach((e) => {
1212
1229
  e.userData.isMovable && r.push(e);
1213
- }), we = r, Rt();
1230
+ }), fe = r, pt();
1214
1231
  }
1215
- function Rt() {
1216
- ot == null || ot([...we]);
1232
+ function pt() {
1233
+ ut == null || ut([...fe]);
1217
1234
  }
1218
- function qs(r) {
1219
- be = r;
1235
+ function si(r) {
1236
+ Te = r;
1220
1237
  }
1221
- function Ws(r) {
1222
- wt = r;
1238
+ function ii(r) {
1239
+ Rt = r;
1223
1240
  }
1224
- function $s(r) {
1225
- ot = r;
1241
+ function oi(r) {
1242
+ ut = r;
1226
1243
  }
1227
- function Js() {
1228
- return we;
1244
+ function ri() {
1245
+ return fe;
1229
1246
  }
1230
- function Go() {
1231
- return w.scene;
1247
+ function er() {
1248
+ return _.scene;
1232
1249
  }
1233
- function Xo() {
1234
- return w.camera;
1250
+ function tr() {
1251
+ return _.camera;
1235
1252
  }
1236
- function Yo() {
1237
- return w.renderer;
1253
+ function nr() {
1254
+ return _.renderer;
1238
1255
  }
1239
- function Bo() {
1240
- var n, i, o;
1241
- St();
1242
- const r = w.scene;
1256
+ function sr() {
1257
+ var o, a, l;
1258
+ Ot();
1259
+ const r = _.scene;
1243
1260
  if (!r) return "{}";
1244
- let e = r;
1245
- e = r.clone(), e.children = e.children.filter(
1246
- (a) => a.userData.type !== "initFloor"
1261
+ const e = [], t = /* @__PURE__ */ new Map();
1262
+ r.children.forEach((c) => {
1263
+ c.userData.type === "lightHelper" && e.push(c), c.type === "DirectionalLight" && c.userData.helper && (t.set(c, c.userData.helper), c.userData.helper = void 0);
1264
+ }), e.forEach((c) => r.remove(c));
1265
+ const s = r.clone();
1266
+ s.children = s.children.filter(
1267
+ (c) => c.userData.type !== "initFloor"
1247
1268
  );
1248
- const t = e.toJSON(), s = {
1249
- position: (n = w.camera) == null ? void 0 : n.position.toArray(),
1250
- rotation: (i = w.camera) == null ? void 0 : i.rotation.toArray(),
1251
- target: ((o = w.orbitControls) == null ? void 0 : o.target.toArray()) || [0, 0, 0]
1269
+ const n = s.toJSON();
1270
+ e.forEach((c) => r.add(c)), t.forEach((c, u) => {
1271
+ u.userData.helper = c;
1272
+ });
1273
+ const i = {
1274
+ position: (o = _.camera) == null ? void 0 : o.position.toArray(),
1275
+ rotation: (a = _.camera) == null ? void 0 : a.rotation.toArray(),
1276
+ target: ((l = _.orbitControls) == null ? void 0 : l.target.toArray()) || [0, 0, 0]
1252
1277
  };
1253
- return JSON.stringify({ scene: t, camera: s });
1278
+ return JSON.stringify({
1279
+ scene: n,
1280
+ camera: i
1281
+ // lightHelpers: lightHelpers,
1282
+ });
1254
1283
  }
1255
- function ei(r, e = "edit") {
1256
- var i;
1257
- const t = typeof r == "string" ? JSON.parse(r) : r, n = new F.ObjectLoader().parse(t);
1258
- n.type === "Scene" ? w.scene = n : (i = w.scene) == null || i.add(n);
1284
+ function ai(r, e = "edit") {
1285
+ var i, o;
1286
+ const t = typeof r == "string" ? JSON.parse(r) : r, n = new H.ObjectLoader().parse(t);
1287
+ n.type === "Scene" ? _.scene = n : (i = _.scene) == null || i.add(n), e === "edit" && ((o = _.scene) == null || o.traverse((a) => {
1288
+ var l;
1289
+ if (a.type === "DirectionalLight") {
1290
+ const c = a;
1291
+ if (!c.userData.helper) {
1292
+ const u = new H.DirectionalLightHelper(c, 1);
1293
+ u.userData.type = "lightHelper", c.userData.helper = u, (l = _.scene) == null || l.add(u);
1294
+ }
1295
+ }
1296
+ }));
1297
+ }
1298
+ function Mn(r) {
1299
+ if (!r) return;
1300
+ if (r.type === "Mesh") {
1301
+ const t = r;
1302
+ t.geometry && t.geometry.dispose(), t.material && (Array.isArray(t.material) ? t.material : [t.material]).forEach((n) => {
1303
+ n.map && (n.map = null), n.lightMap && (n.lightMap = null), n.aoMap && (n.aoMap = null), n.emissiveMap && (n.emissiveMap = null), n.bumpMap && (n.bumpMap = null), n.normalMap && (n.normalMap = null), n.displacementMap && (n.displacementMap = null), n.roughnessMap && (n.roughnessMap = null), n.metalnessMap && (n.metalnessMap = null), n.alphaMap && (n.alphaMap = null), n.envMap && (n.envMap = null), n.dispose();
1304
+ });
1305
+ }
1306
+ const e = r.children.slice();
1307
+ for (const t of e)
1308
+ Mn(t);
1259
1309
  }
1260
- const ti = /^[og]\s*(.+)?/, ni = /^mtllib /, si = /^usemtl /, ii = /^usemap /, Kt = /\s+/, Vt = new M(), dt = new M(), Zt = new M(), Qt = new M(), q = new M(), tt = new pe();
1261
- function oi() {
1310
+ function li() {
1311
+ dt !== null && (cancelAnimationFrame(dt), dt = null), Ge && _.container && (_.container.removeEventListener("click", Ge), Ge = null), Xe && (window.removeEventListener("resize", Xe), Xe = null), _.orbitControls && (_.orbitControls.dispose(), _.orbitControls = null), _.transformControls && (_.transformControls.dispose(), _.transformControls = null), _.scene && (Mn(_.scene), _.scene = null), _.renderer && (_.renderer.dispose(), _.renderer.domElement && _.container && _.container.removeChild(_.renderer.domElement), _.renderer = null), _.camera = null, _.gridHelper = null, _.selectedObject = null, _.container = null, _.mode = "", fe = [], pt(), ht = !1, xe = !1;
1312
+ }
1313
+ const ci = /^[og]\s*(.+)?/, hi = /^mtllib /, ui = /^usemtl /, di = /^usemap /, qt = /\s+/, $t = new S(), _t = new S(), Jt = new S(), en = new S(), J = new S(), rt = new he();
1314
+ function pi() {
1262
1315
  const r = {
1263
1316
  objects: [],
1264
1317
  object: {},
@@ -1299,7 +1352,7 @@ function oi() {
1299
1352
  groupCount: -1,
1300
1353
  inherited: !1,
1301
1354
  clone: function(l) {
1302
- const h = {
1355
+ const c = {
1303
1356
  index: typeof l == "number" ? l : this.index,
1304
1357
  name: this.name,
1305
1358
  mtllib: this.mtllib,
@@ -1309,7 +1362,7 @@ function oi() {
1309
1362
  groupCount: -1,
1310
1363
  inherited: !1
1311
1364
  };
1312
- return h.clone = this.clone.bind(h), h;
1365
+ return c.clone = this.clone.bind(c), c;
1313
1366
  }
1314
1367
  };
1315
1368
  return this.materials.push(a), a;
@@ -1367,7 +1420,7 @@ function oi() {
1367
1420
  },
1368
1421
  addFaceNormal: function(e, t, s) {
1369
1422
  const n = this.vertices, i = this.object.geometry.normals;
1370
- Vt.fromArray(n, e), dt.fromArray(n, t), Zt.fromArray(n, s), q.subVectors(Zt, dt), Qt.subVectors(Vt, dt), q.cross(Qt), q.normalize(), i.push(q.x, q.y, q.z), i.push(q.x, q.y, q.z), i.push(q.x, q.y, q.z);
1423
+ $t.fromArray(n, e), _t.fromArray(n, t), Jt.fromArray(n, s), J.subVectors(Jt, _t), en.subVectors($t, _t), J.cross(en), J.normalize(), i.push(J.x, J.y, J.z), i.push(J.x, J.y, J.z), i.push(J.x, J.y, J.z);
1371
1424
  },
1372
1425
  addColor: function(e, t, s) {
1373
1426
  const n = this.colors, i = this.object.geometry.colors;
@@ -1385,17 +1438,17 @@ function oi() {
1385
1438
  const t = this.uvs;
1386
1439
  this.object.geometry.uvs.push(t[e + 0], t[e + 1]);
1387
1440
  },
1388
- addFace: function(e, t, s, n, i, o, a, l, h) {
1441
+ addFace: function(e, t, s, n, i, o, a, l, c) {
1389
1442
  const u = this.vertices.length;
1390
- let c = this.parseVertexIndex(e, u), p = this.parseVertexIndex(t, u), m = this.parseVertexIndex(s, u);
1391
- if (this.addVertex(c, p, m), this.addColor(c, p, m), a !== void 0 && a !== "") {
1392
- const b = this.normals.length;
1393
- c = this.parseNormalIndex(a, b), p = this.parseNormalIndex(l, b), m = this.parseNormalIndex(h, b), this.addNormal(c, p, m);
1443
+ let h = this.parseVertexIndex(e, u), d = this.parseVertexIndex(t, u), m = this.parseVertexIndex(s, u);
1444
+ if (this.addVertex(h, d, m), this.addColor(h, d, m), a !== void 0 && a !== "") {
1445
+ const w = this.normals.length;
1446
+ h = this.parseNormalIndex(a, w), d = this.parseNormalIndex(l, w), m = this.parseNormalIndex(c, w), this.addNormal(h, d, m);
1394
1447
  } else
1395
- this.addFaceNormal(c, p, m);
1448
+ this.addFaceNormal(h, d, m);
1396
1449
  if (n !== void 0 && n !== "") {
1397
- const b = this.uvs.length;
1398
- c = this.parseUVIndex(n, b), p = this.parseUVIndex(i, b), m = this.parseUVIndex(o, b), this.addUV(c, p, m), this.object.geometry.hasUVIndices = !0;
1450
+ const w = this.uvs.length;
1451
+ h = this.parseUVIndex(n, w), d = this.parseUVIndex(i, w), m = this.parseUVIndex(o, w), this.addUV(h, d, m), this.object.geometry.hasUVIndices = !0;
1399
1452
  } else
1400
1453
  this.addDefaultUV();
1401
1454
  },
@@ -1418,7 +1471,7 @@ function oi() {
1418
1471
  };
1419
1472
  return r.startObject("", !1), r;
1420
1473
  }
1421
- class ri extends hn {
1474
+ class fi extends It {
1422
1475
  /**
1423
1476
  * Constructs a new OBJ loader.
1424
1477
  *
@@ -1437,7 +1490,7 @@ class ri extends hn {
1437
1490
  * @param {onErrorCallback} onError - Executed when errors occur.
1438
1491
  */
1439
1492
  load(e, t, s, n) {
1440
- const i = this, o = new Et(this.manager);
1493
+ const i = this, o = new Ke(this.manager);
1441
1494
  o.setPath(this.path), o.setRequestHeader(this.requestHeader), o.setWithCredentials(this.withCredentials), o.load(e, function(a) {
1442
1495
  try {
1443
1496
  t(i.parse(a));
@@ -1462,7 +1515,7 @@ class ri extends hn {
1462
1515
  * @return {Group} The parsed OBJ.
1463
1516
  */
1464
1517
  parse(e) {
1465
- const t = new oi();
1518
+ const t = new pi();
1466
1519
  e.indexOf(`\r
1467
1520
  `) !== -1 && (e = e.replace(/\r\n/g, `
1468
1521
  `)), e.indexOf(`\\
@@ -1471,148 +1524,148 @@ class ri extends hn {
1471
1524
  `);
1472
1525
  let n = [];
1473
1526
  for (let a = 0, l = s.length; a < l; a++) {
1474
- const h = s[a].trimStart();
1475
- if (h.length === 0) continue;
1476
- const u = h.charAt(0);
1527
+ const c = s[a].trimStart();
1528
+ if (c.length === 0) continue;
1529
+ const u = c.charAt(0);
1477
1530
  if (u !== "#")
1478
1531
  if (u === "v") {
1479
- const c = h.split(Kt);
1480
- switch (c[0]) {
1532
+ const h = c.split(qt);
1533
+ switch (h[0]) {
1481
1534
  case "v":
1482
1535
  t.vertices.push(
1483
- parseFloat(c[1]),
1484
- parseFloat(c[2]),
1485
- parseFloat(c[3])
1486
- ), c.length >= 7 ? (tt.setRGB(
1487
- parseFloat(c[4]),
1488
- parseFloat(c[5]),
1489
- parseFloat(c[6]),
1490
- Ae
1491
- ), t.colors.push(tt.r, tt.g, tt.b)) : t.colors.push(void 0, void 0, void 0);
1536
+ parseFloat(h[1]),
1537
+ parseFloat(h[2]),
1538
+ parseFloat(h[3])
1539
+ ), h.length >= 7 ? (rt.setRGB(
1540
+ parseFloat(h[4]),
1541
+ parseFloat(h[5]),
1542
+ parseFloat(h[6]),
1543
+ ce
1544
+ ), t.colors.push(rt.r, rt.g, rt.b)) : t.colors.push(void 0, void 0, void 0);
1492
1545
  break;
1493
1546
  case "vn":
1494
1547
  t.normals.push(
1495
- parseFloat(c[1]),
1496
- parseFloat(c[2]),
1497
- parseFloat(c[3])
1548
+ parseFloat(h[1]),
1549
+ parseFloat(h[2]),
1550
+ parseFloat(h[3])
1498
1551
  );
1499
1552
  break;
1500
1553
  case "vt":
1501
1554
  t.uvs.push(
1502
- parseFloat(c[1]),
1503
- parseFloat(c[2])
1555
+ parseFloat(h[1]),
1556
+ parseFloat(h[2])
1504
1557
  );
1505
1558
  break;
1506
1559
  }
1507
1560
  } else if (u === "f") {
1508
- const p = h.slice(1).trim().split(Kt), m = [];
1509
- for (let f = 0, y = p.length; f < y; f++) {
1510
- const d = p[f];
1511
- if (d.length > 0) {
1512
- const _ = d.split("/");
1513
- m.push(_);
1561
+ const d = c.slice(1).trim().split(qt), m = [];
1562
+ for (let f = 0, y = d.length; f < y; f++) {
1563
+ const p = d[f];
1564
+ if (p.length > 0) {
1565
+ const b = p.split("/");
1566
+ m.push(b);
1514
1567
  }
1515
1568
  }
1516
- const b = m[0];
1569
+ const w = m[0];
1517
1570
  for (let f = 1, y = m.length - 1; f < y; f++) {
1518
- const d = m[f], _ = m[f + 1];
1571
+ const p = m[f], b = m[f + 1];
1519
1572
  t.addFace(
1573
+ w[0],
1574
+ p[0],
1520
1575
  b[0],
1521
- d[0],
1522
- _[0],
1576
+ w[1],
1577
+ p[1],
1523
1578
  b[1],
1524
- d[1],
1525
- _[1],
1526
- b[2],
1527
- d[2],
1528
- _[2]
1579
+ w[2],
1580
+ p[2],
1581
+ b[2]
1529
1582
  );
1530
1583
  }
1531
1584
  } else if (u === "l") {
1532
- const c = h.substring(1).trim().split(" ");
1533
- let p = [];
1585
+ const h = c.substring(1).trim().split(" ");
1586
+ let d = [];
1534
1587
  const m = [];
1535
- if (h.indexOf("/") === -1)
1536
- p = c;
1588
+ if (c.indexOf("/") === -1)
1589
+ d = h;
1537
1590
  else
1538
- for (let b = 0, f = c.length; b < f; b++) {
1539
- const y = c[b].split("/");
1540
- y[0] !== "" && p.push(y[0]), y[1] !== "" && m.push(y[1]);
1591
+ for (let w = 0, f = h.length; w < f; w++) {
1592
+ const y = h[w].split("/");
1593
+ y[0] !== "" && d.push(y[0]), y[1] !== "" && m.push(y[1]);
1541
1594
  }
1542
- t.addLineGeometry(p, m);
1595
+ t.addLineGeometry(d, m);
1543
1596
  } else if (u === "p") {
1544
- const p = h.slice(1).trim().split(" ");
1545
- t.addPointGeometry(p);
1546
- } else if ((n = ti.exec(h)) !== null) {
1547
- const c = (" " + n[0].slice(1).trim()).slice(1);
1548
- t.startObject(c);
1549
- } else if (si.test(h))
1550
- t.object.startMaterial(h.substring(7).trim(), t.materialLibraries);
1551
- else if (ni.test(h))
1552
- t.materialLibraries.push(h.substring(7).trim());
1553
- else if (ii.test(h))
1597
+ const d = c.slice(1).trim().split(" ");
1598
+ t.addPointGeometry(d);
1599
+ } else if ((n = ci.exec(c)) !== null) {
1600
+ const h = (" " + n[0].slice(1).trim()).slice(1);
1601
+ t.startObject(h);
1602
+ } else if (ui.test(c))
1603
+ t.object.startMaterial(c.substring(7).trim(), t.materialLibraries);
1604
+ else if (hi.test(c))
1605
+ t.materialLibraries.push(c.substring(7).trim());
1606
+ else if (di.test(c))
1554
1607
  console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');
1555
1608
  else if (u === "s") {
1556
- if (n = h.split(" "), n.length > 1) {
1557
- const p = n[1].trim().toLowerCase();
1558
- t.object.smooth = p !== "0" && p !== "off";
1609
+ if (n = c.split(" "), n.length > 1) {
1610
+ const d = n[1].trim().toLowerCase();
1611
+ t.object.smooth = d !== "0" && d !== "off";
1559
1612
  } else
1560
1613
  t.object.smooth = !0;
1561
- const c = t.object.currentMaterial();
1562
- c && (c.smooth = t.object.smooth);
1614
+ const h = t.object.currentMaterial();
1615
+ h && (h.smooth = t.object.smooth);
1563
1616
  } else {
1564
- if (h === "\0") continue;
1565
- console.warn('THREE.OBJLoader: Unexpected line: "' + h + '"');
1617
+ if (c === "\0") continue;
1618
+ console.warn('THREE.OBJLoader: Unexpected line: "' + c + '"');
1566
1619
  }
1567
1620
  }
1568
1621
  t.finalize();
1569
- const i = new nt();
1622
+ const i = new at();
1570
1623
  if (i.materialLibraries = [].concat(t.materialLibraries), !(t.objects.length === 1 && t.objects[0].geometry.vertices.length === 0) === !0)
1571
1624
  for (let a = 0, l = t.objects.length; a < l; a++) {
1572
- const h = t.objects[a], u = h.geometry, c = h.materials, p = u.type === "Line", m = u.type === "Points";
1573
- let b = !1;
1625
+ const c = t.objects[a], u = c.geometry, h = c.materials, d = u.type === "Line", m = u.type === "Points";
1626
+ let w = !1;
1574
1627
  if (u.vertices.length === 0) continue;
1575
- const f = new Ge();
1576
- f.setAttribute("position", new de(u.vertices, 3)), u.normals.length > 0 && f.setAttribute("normal", new de(u.normals, 3)), u.colors.length > 0 && (b = !0, f.setAttribute("color", new de(u.colors, 3))), u.hasUVIndices === !0 && f.setAttribute("uv", new de(u.uvs, 2));
1628
+ const f = new Re();
1629
+ f.setAttribute("position", new pe(u.vertices, 3)), u.normals.length > 0 && f.setAttribute("normal", new pe(u.normals, 3)), u.colors.length > 0 && (w = !0, f.setAttribute("color", new pe(u.colors, 3))), u.hasUVIndices === !0 && f.setAttribute("uv", new pe(u.uvs, 2));
1577
1630
  const y = [];
1578
- for (let _ = 0, x = c.length; _ < x; _++) {
1579
- const S = c[_], R = S.name + "_" + S.smooth + "_" + b;
1631
+ for (let b = 0, T = h.length; b < T; b++) {
1632
+ const M = h[b], R = M.name + "_" + M.smooth + "_" + w;
1580
1633
  let v = t.materials[R];
1581
1634
  if (this.materials !== null) {
1582
- if (v = this.materials.create(S.name), p && v && !(v instanceof je)) {
1583
- const I = new je();
1635
+ if (v = this.materials.create(M.name), d && v && !(v instanceof He)) {
1636
+ const I = new He();
1584
1637
  Fe.prototype.copy.call(I, v), I.color.copy(v.color), v = I;
1585
- } else if (m && v && !(v instanceof Ce)) {
1586
- const I = new Ce({ size: 10, sizeAttenuation: !1 });
1638
+ } else if (m && v && !(v instanceof Oe)) {
1639
+ const I = new Oe({ size: 10, sizeAttenuation: !1 });
1587
1640
  Fe.prototype.copy.call(I, v), I.color.copy(v.color), I.map = v.map, v = I;
1588
1641
  }
1589
1642
  }
1590
- v === void 0 && (p ? v = new je() : m ? v = new Ce({ size: 1, sizeAttenuation: !1 }) : v = new kn(), v.name = S.name, v.flatShading = !S.smooth, v.vertexColors = b, t.materials[R] = v), y.push(v);
1643
+ v === void 0 && (d ? v = new He() : m ? v = new Oe({ size: 1, sizeAttenuation: !1 }) : v = new Bn(), v.name = M.name, v.flatShading = !M.smooth, v.vertexColors = w, t.materials[R] = v), y.push(v);
1591
1644
  }
1592
- let d;
1645
+ let p;
1593
1646
  if (y.length > 1) {
1594
- for (let _ = 0, x = c.length; _ < x; _++) {
1595
- const S = c[_];
1596
- f.addGroup(S.groupStart, S.groupCount, _);
1647
+ for (let b = 0, T = h.length; b < T; b++) {
1648
+ const M = h[b];
1649
+ f.addGroup(M.groupStart, M.groupCount, b);
1597
1650
  }
1598
- p ? d = new gt(f, y) : m ? d = new st(f, y) : d = new T(f, y);
1651
+ d ? p = new Et(f, y) : m ? p = new lt(f, y) : p = new E(f, y);
1599
1652
  } else
1600
- p ? d = new gt(f, y[0]) : m ? d = new st(f, y[0]) : d = new T(f, y[0]);
1601
- d.name = h.name, i.add(d);
1653
+ d ? p = new Et(f, y[0]) : m ? p = new lt(f, y[0]) : p = new E(f, y[0]);
1654
+ p.name = c.name, i.add(p);
1602
1655
  }
1603
1656
  else if (t.vertices.length > 0) {
1604
- const a = new Ce({ size: 1, sizeAttenuation: !1 }), l = new Ge();
1605
- l.setAttribute("position", new de(t.vertices, 3)), t.colors.length > 0 && t.colors[0] !== void 0 && (l.setAttribute("color", new de(t.colors, 3)), a.vertexColors = !0);
1606
- const h = new st(l, a);
1607
- i.add(h);
1657
+ const a = new Oe({ size: 1, sizeAttenuation: !1 }), l = new Re();
1658
+ l.setAttribute("position", new pe(t.vertices, 3)), t.colors.length > 0 && t.colors[0] !== void 0 && (l.setAttribute("color", new pe(t.colors, 3)), a.vertexColors = !0);
1659
+ const c = new lt(l, a);
1660
+ i.add(c);
1608
1661
  }
1609
1662
  return i;
1610
1663
  }
1611
1664
  }
1612
- function qt(r, e) {
1613
- if (e === jn)
1665
+ function tn(r, e) {
1666
+ if (e === Yn)
1614
1667
  return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."), r;
1615
- if (e === yt || e === un) {
1668
+ if (e === Mt || e === mn) {
1616
1669
  let t = r.getIndex();
1617
1670
  if (t === null) {
1618
1671
  const o = [], a = r.getAttribute("position");
@@ -1624,7 +1677,7 @@ function qt(r, e) {
1624
1677
  return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."), r;
1625
1678
  }
1626
1679
  const s = t.count - 2, n = [];
1627
- if (e === yt)
1680
+ if (e === Mt)
1628
1681
  for (let o = 1; o <= s; o++)
1629
1682
  n.push(t.getX(0)), n.push(t.getX(o)), n.push(t.getX(o + 1));
1630
1683
  else
@@ -1636,9 +1689,9 @@ function qt(r, e) {
1636
1689
  } else
1637
1690
  return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:", e), r;
1638
1691
  }
1639
- function ai(r) {
1692
+ function mi(r) {
1640
1693
  const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), s = r.clone();
1641
- return _n(r, s, function(n, i) {
1694
+ return vn(r, s, function(n, i) {
1642
1695
  e.set(i, n), t.set(n, i);
1643
1696
  }), s.traverse(function(n) {
1644
1697
  if (!n.isSkinnedMesh) return;
@@ -1648,12 +1701,12 @@ function ai(r) {
1648
1701
  }), i.bind(i.skeleton, i.bindMatrix);
1649
1702
  }), s;
1650
1703
  }
1651
- function _n(r, e, t) {
1704
+ function vn(r, e, t) {
1652
1705
  t(r, e);
1653
1706
  for (let s = 0; s < r.children.length; s++)
1654
- _n(r.children[s], e.children[s], t);
1707
+ vn(r.children[s], e.children[s], t);
1655
1708
  }
1656
- class li extends hn {
1709
+ class gi extends It {
1657
1710
  /**
1658
1711
  * Constructs a new glTF loader.
1659
1712
  *
@@ -1661,41 +1714,41 @@ class li extends hn {
1661
1714
  */
1662
1715
  constructor(e) {
1663
1716
  super(e), this.dracoLoader = null, this.ktx2Loader = null, this.meshoptDecoder = null, this.pluginCallbacks = [], this.register(function(t) {
1664
- return new pi(t);
1665
- }), this.register(function(t) {
1666
- return new fi(t);
1717
+ return new Ti(t);
1667
1718
  }), this.register(function(t) {
1668
- return new Ei(t);
1719
+ return new xi(t);
1669
1720
  }), this.register(function(t) {
1670
- return new Mi(t);
1721
+ return new Ii(t);
1671
1722
  }), this.register(function(t) {
1672
- return new vi(t);
1723
+ return new Ci(t);
1673
1724
  }), this.register(function(t) {
1674
- return new gi(t);
1725
+ return new Di(t);
1675
1726
  }), this.register(function(t) {
1676
- return new yi(t);
1727
+ return new Mi(t);
1677
1728
  }), this.register(function(t) {
1678
- return new _i(t);
1729
+ return new vi(t);
1679
1730
  }), this.register(function(t) {
1680
- return new bi(t);
1731
+ return new Si(t);
1681
1732
  }), this.register(function(t) {
1682
- return new di(t);
1733
+ return new Ai(t);
1683
1734
  }), this.register(function(t) {
1684
1735
  return new wi(t);
1685
1736
  }), this.register(function(t) {
1686
- return new mi(t);
1737
+ return new Ri(t);
1687
1738
  }), this.register(function(t) {
1688
- return new xi(t);
1739
+ return new Ei(t);
1689
1740
  }), this.register(function(t) {
1690
- return new Ti(t);
1741
+ return new Li(t);
1691
1742
  }), this.register(function(t) {
1692
- return new hi(t);
1743
+ return new Pi(t);
1693
1744
  }), this.register(function(t) {
1694
- return new Wt(t, A.EXT_MESHOPT_COMPRESSION);
1745
+ return new _i(t);
1695
1746
  }), this.register(function(t) {
1696
- return new Wt(t, A.KHR_MESHOPT_COMPRESSION);
1747
+ return new nn(t, A.EXT_MESHOPT_COMPRESSION);
1697
1748
  }), this.register(function(t) {
1698
- return new Si(t);
1749
+ return new nn(t, A.KHR_MESHOPT_COMPRESSION);
1750
+ }), this.register(function(t) {
1751
+ return new Oi(t);
1699
1752
  });
1700
1753
  }
1701
1754
  /**
@@ -1713,17 +1766,17 @@ class li extends hn {
1713
1766
  if (this.resourcePath !== "")
1714
1767
  o = this.resourcePath;
1715
1768
  else if (this.path !== "") {
1716
- const h = He.extractUrlBase(e);
1717
- o = He.resolveURL(h, this.path);
1769
+ const c = Ue.extractUrlBase(e);
1770
+ o = Ue.resolveURL(c, this.path);
1718
1771
  } else
1719
- o = He.extractUrlBase(e);
1772
+ o = Ue.extractUrlBase(e);
1720
1773
  this.manager.itemStart(e);
1721
- const a = function(h) {
1722
- n ? n(h) : console.error(h), i.manager.itemError(e), i.manager.itemEnd(e);
1723
- }, l = new Et(this.manager);
1724
- l.setPath(this.path), l.setResponseType("arraybuffer"), l.setRequestHeader(this.requestHeader), l.setWithCredentials(this.withCredentials), l.load(e, function(h) {
1774
+ const a = function(c) {
1775
+ n ? n(c) : console.error(c), i.manager.itemError(e), i.manager.itemEnd(e);
1776
+ }, l = new Ke(this.manager);
1777
+ l.setPath(this.path), l.setResponseType("arraybuffer"), l.setRequestHeader(this.requestHeader), l.setWithCredentials(this.withCredentials), l.load(e, function(c) {
1725
1778
  try {
1726
- i.parse(h, o, function(u) {
1779
+ i.parse(c, o, function(u) {
1727
1780
  t(u), i.manager.itemEnd(e);
1728
1781
  }, a);
1729
1782
  } catch (u) {
@@ -1795,11 +1848,11 @@ class li extends hn {
1795
1848
  if (typeof e == "string")
1796
1849
  i = JSON.parse(e);
1797
1850
  else if (e instanceof ArrayBuffer)
1798
- if (l.decode(new Uint8Array(e, 0, 4)) === bn) {
1851
+ if (l.decode(new Uint8Array(e, 0, 4)) === Sn) {
1799
1852
  try {
1800
- o[A.KHR_BINARY_GLTF] = new Ai(e);
1801
- } catch (c) {
1802
- n && n(c);
1853
+ o[A.KHR_BINARY_GLTF] = new ki(e);
1854
+ } catch (h) {
1855
+ n && n(h);
1803
1856
  return;
1804
1857
  }
1805
1858
  i = JSON.parse(o[A.KHR_BINARY_GLTF].content);
@@ -1811,7 +1864,7 @@ class li extends hn {
1811
1864
  n && n(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));
1812
1865
  return;
1813
1866
  }
1814
- const h = new Ui(i, {
1867
+ const c = new Zi(i, {
1815
1868
  path: t || this.resourcePath || "",
1816
1869
  crossOrigin: this.crossOrigin,
1817
1870
  requestHeader: this.requestHeader,
@@ -1819,32 +1872,32 @@ class li extends hn {
1819
1872
  ktx2Loader: this.ktx2Loader,
1820
1873
  meshoptDecoder: this.meshoptDecoder
1821
1874
  });
1822
- h.fileLoader.setRequestHeader(this.requestHeader);
1875
+ c.fileLoader.setRequestHeader(this.requestHeader);
1823
1876
  for (let u = 0; u < this.pluginCallbacks.length; u++) {
1824
- const c = this.pluginCallbacks[u](h);
1825
- c.name || console.error("THREE.GLTFLoader: Invalid plugin found: missing name"), a[c.name] = c, o[c.name] = !0;
1877
+ const h = this.pluginCallbacks[u](c);
1878
+ h.name || console.error("THREE.GLTFLoader: Invalid plugin found: missing name"), a[h.name] = h, o[h.name] = !0;
1826
1879
  }
1827
1880
  if (i.extensionsUsed)
1828
1881
  for (let u = 0; u < i.extensionsUsed.length; ++u) {
1829
- const c = i.extensionsUsed[u], p = i.extensionsRequired || [];
1830
- switch (c) {
1882
+ const h = i.extensionsUsed[u], d = i.extensionsRequired || [];
1883
+ switch (h) {
1831
1884
  case A.KHR_MATERIALS_UNLIT:
1832
- o[c] = new ui();
1885
+ o[h] = new bi();
1833
1886
  break;
1834
1887
  case A.KHR_DRACO_MESH_COMPRESSION:
1835
- o[c] = new Ri(i, this.dracoLoader);
1888
+ o[h] = new Ni(i, this.dracoLoader);
1836
1889
  break;
1837
1890
  case A.KHR_TEXTURE_TRANSFORM:
1838
- o[c] = new Pi();
1891
+ o[h] = new ji();
1839
1892
  break;
1840
1893
  case A.KHR_MESH_QUANTIZATION:
1841
- o[c] = new Li();
1894
+ o[h] = new Hi();
1842
1895
  break;
1843
1896
  default:
1844
- p.indexOf(c) >= 0 && a[c] === void 0 && console.warn('THREE.GLTFLoader: Unknown extension "' + c + '".');
1897
+ d.indexOf(h) >= 0 && a[h] === void 0 && console.warn('THREE.GLTFLoader: Unknown extension "' + h + '".');
1845
1898
  }
1846
1899
  }
1847
- h.setExtensions(o), h.setPlugins(a), h.parse(s, n);
1900
+ c.setExtensions(o), c.setPlugins(a), c.parse(s, n);
1848
1901
  }
1849
1902
  /**
1850
1903
  * Async version of {@link GLTFLoader#parse}.
@@ -1861,7 +1914,7 @@ class li extends hn {
1861
1914
  });
1862
1915
  }
1863
1916
  }
1864
- function ci() {
1917
+ function yi() {
1865
1918
  let r = {};
1866
1919
  return {
1867
1920
  get: function(e) {
@@ -1878,7 +1931,7 @@ function ci() {
1878
1931
  }
1879
1932
  };
1880
1933
  }
1881
- function D(r, e, t) {
1934
+ function N(r, e, t) {
1882
1935
  const s = r.json.materials[e];
1883
1936
  return s.extensions && s.extensions[t] ? s.extensions[t] : null;
1884
1937
  }
@@ -1907,7 +1960,7 @@ const A = {
1907
1960
  KHR_MESHOPT_COMPRESSION: "KHR_meshopt_compression",
1908
1961
  EXT_MESH_GPU_INSTANCING: "EXT_mesh_gpu_instancing"
1909
1962
  };
1910
- class hi {
1963
+ class _i {
1911
1964
  constructor(e) {
1912
1965
  this.parser = e, this.name = A.KHR_LIGHTS_PUNCTUAL, this.cache = { refs: {}, uses: {} };
1913
1966
  }
@@ -1923,24 +1976,24 @@ class hi {
1923
1976
  let n = t.cache.get(s);
1924
1977
  if (n) return n;
1925
1978
  const i = t.json, l = ((i.extensions && i.extensions[this.name] || {}).lights || [])[e];
1926
- let h;
1927
- const u = new pe(16777215);
1928
- l.color !== void 0 && u.setRGB(l.color[0], l.color[1], l.color[2], le);
1929
- const c = l.range !== void 0 ? l.range : 0;
1979
+ let c;
1980
+ const u = new he(16777215);
1981
+ l.color !== void 0 && u.setRGB(l.color[0], l.color[1], l.color[2], ie);
1982
+ const h = l.range !== void 0 ? l.range : 0;
1930
1983
  switch (l.type) {
1931
1984
  case "directional":
1932
- h = new Un(u), h.target.position.set(0, 0, -1), h.add(h.target);
1985
+ c = new Zn(u), c.target.position.set(0, 0, -1), c.add(c.target);
1933
1986
  break;
1934
1987
  case "point":
1935
- h = new Hn(u), h.distance = c;
1988
+ c = new Vn(u), c.distance = h;
1936
1989
  break;
1937
1990
  case "spot":
1938
- h = new Fn(u), h.distance = c, l.spot = l.spot || {}, l.spot.innerConeAngle = l.spot.innerConeAngle !== void 0 ? l.spot.innerConeAngle : 0, l.spot.outerConeAngle = l.spot.outerConeAngle !== void 0 ? l.spot.outerConeAngle : Math.PI / 4, h.angle = l.spot.outerConeAngle, h.penumbra = 1 - l.spot.innerConeAngle / l.spot.outerConeAngle, h.target.position.set(0, 0, -1), h.add(h.target);
1991
+ c = new Kn(u), c.distance = h, l.spot = l.spot || {}, l.spot.innerConeAngle = l.spot.innerConeAngle !== void 0 ? l.spot.innerConeAngle : 0, l.spot.outerConeAngle = l.spot.outerConeAngle !== void 0 ? l.spot.outerConeAngle : Math.PI / 4, c.angle = l.spot.outerConeAngle, c.penumbra = 1 - l.spot.innerConeAngle / l.spot.outerConeAngle, c.target.position.set(0, 0, -1), c.add(c.target);
1939
1992
  break;
1940
1993
  default:
1941
1994
  throw new Error("THREE.GLTFLoader: Unexpected light type: " + l.type);
1942
1995
  }
1943
- return h.position.set(0, 0, 0), ne(h, l), l.intensity !== void 0 && (h.intensity = l.intensity), h.name = t.createUniqueName(l.name || "light_" + e), n = Promise.resolve(h), t.cache.add(s, n), n;
1996
+ return c.position.set(0, 0, 0), se(c, l), l.intensity !== void 0 && (c.intensity = l.intensity), c.name = t.createUniqueName(l.name || "light_" + e), n = Promise.resolve(c), t.cache.add(s, n), n;
1944
1997
  }
1945
1998
  getDependency(e, t) {
1946
1999
  if (e === "light")
@@ -1953,185 +2006,185 @@ class hi {
1953
2006
  });
1954
2007
  }
1955
2008
  }
1956
- class ui {
2009
+ class bi {
1957
2010
  constructor() {
1958
2011
  this.name = A.KHR_MATERIALS_UNLIT;
1959
2012
  }
1960
2013
  getMaterialType() {
1961
- return _e;
2014
+ return we;
1962
2015
  }
1963
2016
  extendParams(e, t, s) {
1964
2017
  const n = [];
1965
- e.color = new pe(1, 1, 1), e.opacity = 1;
2018
+ e.color = new he(1, 1, 1), e.opacity = 1;
1966
2019
  const i = t.pbrMetallicRoughness;
1967
2020
  if (i) {
1968
2021
  if (Array.isArray(i.baseColorFactor)) {
1969
2022
  const o = i.baseColorFactor;
1970
- e.color.setRGB(o[0], o[1], o[2], le), e.opacity = o[3];
2023
+ e.color.setRGB(o[0], o[1], o[2], ie), e.opacity = o[3];
1971
2024
  }
1972
- i.baseColorTexture !== void 0 && n.push(s.assignTexture(e, "map", i.baseColorTexture, Ae));
2025
+ i.baseColorTexture !== void 0 && n.push(s.assignTexture(e, "map", i.baseColorTexture, ce));
1973
2026
  }
1974
2027
  return Promise.all(n);
1975
2028
  }
1976
2029
  }
1977
- class di {
2030
+ class wi {
1978
2031
  constructor(e) {
1979
2032
  this.parser = e, this.name = A.KHR_MATERIALS_EMISSIVE_STRENGTH;
1980
2033
  }
1981
2034
  extendMaterialParams(e, t) {
1982
- const s = D(this.parser, e, this.name);
2035
+ const s = N(this.parser, e, this.name);
1983
2036
  return s === null || s.emissiveStrength !== void 0 && (t.emissiveIntensity = s.emissiveStrength), Promise.resolve();
1984
2037
  }
1985
2038
  }
1986
- class pi {
2039
+ class Ti {
1987
2040
  constructor(e) {
1988
2041
  this.parser = e, this.name = A.KHR_MATERIALS_CLEARCOAT;
1989
2042
  }
1990
2043
  getMaterialType(e) {
1991
- return D(this.parser, e, this.name) !== null ? se : null;
2044
+ return N(this.parser, e, this.name) !== null ? oe : null;
1992
2045
  }
1993
2046
  extendMaterialParams(e, t) {
1994
- const s = D(this.parser, e, this.name);
2047
+ const s = N(this.parser, e, this.name);
1995
2048
  if (s === null) return Promise.resolve();
1996
2049
  const n = [];
1997
2050
  if (s.clearcoatFactor !== void 0 && (t.clearcoat = s.clearcoatFactor), s.clearcoatTexture !== void 0 && n.push(this.parser.assignTexture(t, "clearcoatMap", s.clearcoatTexture)), s.clearcoatRoughnessFactor !== void 0 && (t.clearcoatRoughness = s.clearcoatRoughnessFactor), s.clearcoatRoughnessTexture !== void 0 && n.push(this.parser.assignTexture(t, "clearcoatRoughnessMap", s.clearcoatRoughnessTexture)), s.clearcoatNormalTexture !== void 0 && (n.push(this.parser.assignTexture(t, "clearcoatNormalMap", s.clearcoatNormalTexture)), s.clearcoatNormalTexture.scale !== void 0)) {
1998
2051
  const i = s.clearcoatNormalTexture.scale;
1999
- t.clearcoatNormalScale = new V(i, i);
2052
+ t.clearcoatNormalScale = new Z(i, i);
2000
2053
  }
2001
2054
  return Promise.all(n);
2002
2055
  }
2003
2056
  }
2004
- class fi {
2057
+ class xi {
2005
2058
  constructor(e) {
2006
2059
  this.parser = e, this.name = A.KHR_MATERIALS_DISPERSION;
2007
2060
  }
2008
2061
  getMaterialType(e) {
2009
- return D(this.parser, e, this.name) !== null ? se : null;
2062
+ return N(this.parser, e, this.name) !== null ? oe : null;
2010
2063
  }
2011
2064
  extendMaterialParams(e, t) {
2012
- const s = D(this.parser, e, this.name);
2065
+ const s = N(this.parser, e, this.name);
2013
2066
  return s === null || (t.dispersion = s.dispersion !== void 0 ? s.dispersion : 0), Promise.resolve();
2014
2067
  }
2015
2068
  }
2016
- class mi {
2069
+ class Ei {
2017
2070
  constructor(e) {
2018
2071
  this.parser = e, this.name = A.KHR_MATERIALS_IRIDESCENCE;
2019
2072
  }
2020
2073
  getMaterialType(e) {
2021
- return D(this.parser, e, this.name) !== null ? se : null;
2074
+ return N(this.parser, e, this.name) !== null ? oe : null;
2022
2075
  }
2023
2076
  extendMaterialParams(e, t) {
2024
- const s = D(this.parser, e, this.name);
2077
+ const s = N(this.parser, e, this.name);
2025
2078
  if (s === null) return Promise.resolve();
2026
2079
  const n = [];
2027
2080
  return s.iridescenceFactor !== void 0 && (t.iridescence = s.iridescenceFactor), s.iridescenceTexture !== void 0 && n.push(this.parser.assignTexture(t, "iridescenceMap", s.iridescenceTexture)), s.iridescenceIor !== void 0 && (t.iridescenceIOR = s.iridescenceIor), t.iridescenceThicknessRange === void 0 && (t.iridescenceThicknessRange = [100, 400]), s.iridescenceThicknessMinimum !== void 0 && (t.iridescenceThicknessRange[0] = s.iridescenceThicknessMinimum), s.iridescenceThicknessMaximum !== void 0 && (t.iridescenceThicknessRange[1] = s.iridescenceThicknessMaximum), s.iridescenceThicknessTexture !== void 0 && n.push(this.parser.assignTexture(t, "iridescenceThicknessMap", s.iridescenceThicknessTexture)), Promise.all(n);
2028
2081
  }
2029
2082
  }
2030
- class gi {
2083
+ class Mi {
2031
2084
  constructor(e) {
2032
2085
  this.parser = e, this.name = A.KHR_MATERIALS_SHEEN;
2033
2086
  }
2034
2087
  getMaterialType(e) {
2035
- return D(this.parser, e, this.name) !== null ? se : null;
2088
+ return N(this.parser, e, this.name) !== null ? oe : null;
2036
2089
  }
2037
2090
  extendMaterialParams(e, t) {
2038
- const s = D(this.parser, e, this.name);
2091
+ const s = N(this.parser, e, this.name);
2039
2092
  if (s === null) return Promise.resolve();
2040
2093
  const n = [];
2041
- if (t.sheenColor = new pe(0, 0, 0), t.sheenRoughness = 0, t.sheen = 1, s.sheenColorFactor !== void 0) {
2094
+ if (t.sheenColor = new he(0, 0, 0), t.sheenRoughness = 0, t.sheen = 1, s.sheenColorFactor !== void 0) {
2042
2095
  const i = s.sheenColorFactor;
2043
- t.sheenColor.setRGB(i[0], i[1], i[2], le);
2096
+ t.sheenColor.setRGB(i[0], i[1], i[2], ie);
2044
2097
  }
2045
- return s.sheenRoughnessFactor !== void 0 && (t.sheenRoughness = s.sheenRoughnessFactor), s.sheenColorTexture !== void 0 && n.push(this.parser.assignTexture(t, "sheenColorMap", s.sheenColorTexture, Ae)), s.sheenRoughnessTexture !== void 0 && n.push(this.parser.assignTexture(t, "sheenRoughnessMap", s.sheenRoughnessTexture)), Promise.all(n);
2098
+ return s.sheenRoughnessFactor !== void 0 && (t.sheenRoughness = s.sheenRoughnessFactor), s.sheenColorTexture !== void 0 && n.push(this.parser.assignTexture(t, "sheenColorMap", s.sheenColorTexture, ce)), s.sheenRoughnessTexture !== void 0 && n.push(this.parser.assignTexture(t, "sheenRoughnessMap", s.sheenRoughnessTexture)), Promise.all(n);
2046
2099
  }
2047
2100
  }
2048
- class yi {
2101
+ class vi {
2049
2102
  constructor(e) {
2050
2103
  this.parser = e, this.name = A.KHR_MATERIALS_TRANSMISSION;
2051
2104
  }
2052
2105
  getMaterialType(e) {
2053
- return D(this.parser, e, this.name) !== null ? se : null;
2106
+ return N(this.parser, e, this.name) !== null ? oe : null;
2054
2107
  }
2055
2108
  extendMaterialParams(e, t) {
2056
- const s = D(this.parser, e, this.name);
2109
+ const s = N(this.parser, e, this.name);
2057
2110
  if (s === null) return Promise.resolve();
2058
2111
  const n = [];
2059
2112
  return s.transmissionFactor !== void 0 && (t.transmission = s.transmissionFactor), s.transmissionTexture !== void 0 && n.push(this.parser.assignTexture(t, "transmissionMap", s.transmissionTexture)), Promise.all(n);
2060
2113
  }
2061
2114
  }
2062
- class _i {
2115
+ class Si {
2063
2116
  constructor(e) {
2064
2117
  this.parser = e, this.name = A.KHR_MATERIALS_VOLUME;
2065
2118
  }
2066
2119
  getMaterialType(e) {
2067
- return D(this.parser, e, this.name) !== null ? se : null;
2120
+ return N(this.parser, e, this.name) !== null ? oe : null;
2068
2121
  }
2069
2122
  extendMaterialParams(e, t) {
2070
- const s = D(this.parser, e, this.name);
2123
+ const s = N(this.parser, e, this.name);
2071
2124
  if (s === null) return Promise.resolve();
2072
2125
  const n = [];
2073
2126
  t.thickness = s.thicknessFactor !== void 0 ? s.thicknessFactor : 0, s.thicknessTexture !== void 0 && n.push(this.parser.assignTexture(t, "thicknessMap", s.thicknessTexture)), t.attenuationDistance = s.attenuationDistance || 1 / 0;
2074
2127
  const i = s.attenuationColor || [1, 1, 1];
2075
- return t.attenuationColor = new pe().setRGB(i[0], i[1], i[2], le), Promise.all(n);
2128
+ return t.attenuationColor = new he().setRGB(i[0], i[1], i[2], ie), Promise.all(n);
2076
2129
  }
2077
2130
  }
2078
- class bi {
2131
+ class Ai {
2079
2132
  constructor(e) {
2080
2133
  this.parser = e, this.name = A.KHR_MATERIALS_IOR;
2081
2134
  }
2082
2135
  getMaterialType(e) {
2083
- return D(this.parser, e, this.name) !== null ? se : null;
2136
+ return N(this.parser, e, this.name) !== null ? oe : null;
2084
2137
  }
2085
2138
  extendMaterialParams(e, t) {
2086
- const s = D(this.parser, e, this.name);
2139
+ const s = N(this.parser, e, this.name);
2087
2140
  return s === null || (t.ior = s.ior !== void 0 ? s.ior : 1.5, t.ior === 0 && (t.ior = 1e3)), Promise.resolve();
2088
2141
  }
2089
2142
  }
2090
- class wi {
2143
+ class Ri {
2091
2144
  constructor(e) {
2092
2145
  this.parser = e, this.name = A.KHR_MATERIALS_SPECULAR;
2093
2146
  }
2094
2147
  getMaterialType(e) {
2095
- return D(this.parser, e, this.name) !== null ? se : null;
2148
+ return N(this.parser, e, this.name) !== null ? oe : null;
2096
2149
  }
2097
2150
  extendMaterialParams(e, t) {
2098
- const s = D(this.parser, e, this.name);
2151
+ const s = N(this.parser, e, this.name);
2099
2152
  if (s === null) return Promise.resolve();
2100
2153
  const n = [];
2101
2154
  t.specularIntensity = s.specularFactor !== void 0 ? s.specularFactor : 1, s.specularTexture !== void 0 && n.push(this.parser.assignTexture(t, "specularIntensityMap", s.specularTexture));
2102
2155
  const i = s.specularColorFactor || [1, 1, 1];
2103
- return t.specularColor = new pe().setRGB(i[0], i[1], i[2], le), s.specularColorTexture !== void 0 && n.push(this.parser.assignTexture(t, "specularColorMap", s.specularColorTexture, Ae)), Promise.all(n);
2156
+ return t.specularColor = new he().setRGB(i[0], i[1], i[2], ie), s.specularColorTexture !== void 0 && n.push(this.parser.assignTexture(t, "specularColorMap", s.specularColorTexture, ce)), Promise.all(n);
2104
2157
  }
2105
2158
  }
2106
- class Ti {
2159
+ class Pi {
2107
2160
  constructor(e) {
2108
2161
  this.parser = e, this.name = A.EXT_MATERIALS_BUMP;
2109
2162
  }
2110
2163
  getMaterialType(e) {
2111
- return D(this.parser, e, this.name) !== null ? se : null;
2164
+ return N(this.parser, e, this.name) !== null ? oe : null;
2112
2165
  }
2113
2166
  extendMaterialParams(e, t) {
2114
- const s = D(this.parser, e, this.name);
2167
+ const s = N(this.parser, e, this.name);
2115
2168
  if (s === null) return Promise.resolve();
2116
2169
  const n = [];
2117
2170
  return t.bumpScale = s.bumpFactor !== void 0 ? s.bumpFactor : 1, s.bumpTexture !== void 0 && n.push(this.parser.assignTexture(t, "bumpMap", s.bumpTexture)), Promise.all(n);
2118
2171
  }
2119
2172
  }
2120
- class xi {
2173
+ class Li {
2121
2174
  constructor(e) {
2122
2175
  this.parser = e, this.name = A.KHR_MATERIALS_ANISOTROPY;
2123
2176
  }
2124
2177
  getMaterialType(e) {
2125
- return D(this.parser, e, this.name) !== null ? se : null;
2178
+ return N(this.parser, e, this.name) !== null ? oe : null;
2126
2179
  }
2127
2180
  extendMaterialParams(e, t) {
2128
- const s = D(this.parser, e, this.name);
2181
+ const s = N(this.parser, e, this.name);
2129
2182
  if (s === null) return Promise.resolve();
2130
2183
  const n = [];
2131
2184
  return s.anisotropyStrength !== void 0 && (t.anisotropy = s.anisotropyStrength), s.anisotropyRotation !== void 0 && (t.anisotropyRotation = s.anisotropyRotation), s.anisotropyTexture !== void 0 && n.push(this.parser.assignTexture(t, "anisotropyMap", s.anisotropyTexture)), Promise.all(n);
2132
2185
  }
2133
2186
  }
2134
- class Ei {
2187
+ class Ii {
2135
2188
  constructor(e) {
2136
2189
  this.parser = e, this.name = A.KHR_TEXTURE_BASISU;
2137
2190
  }
@@ -2148,7 +2201,7 @@ class Ei {
2148
2201
  return t.loadTextureImage(e, i.source, o);
2149
2202
  }
2150
2203
  }
2151
- class Mi {
2204
+ class Ci {
2152
2205
  constructor(e) {
2153
2206
  this.parser = e, this.name = A.EXT_TEXTURE_WEBP;
2154
2207
  }
@@ -2159,13 +2212,13 @@ class Mi {
2159
2212
  const o = i.extensions[t], a = n.images[o.source];
2160
2213
  let l = s.textureLoader;
2161
2214
  if (a.uri) {
2162
- const h = s.options.manager.getHandler(a.uri);
2163
- h !== null && (l = h);
2215
+ const c = s.options.manager.getHandler(a.uri);
2216
+ c !== null && (l = c);
2164
2217
  }
2165
2218
  return s.loadTextureImage(e, o.source, l);
2166
2219
  }
2167
2220
  }
2168
- class vi {
2221
+ class Di {
2169
2222
  constructor(e) {
2170
2223
  this.parser = e, this.name = A.EXT_TEXTURE_AVIF;
2171
2224
  }
@@ -2176,13 +2229,13 @@ class vi {
2176
2229
  const o = i.extensions[t], a = n.images[o.source];
2177
2230
  let l = s.textureLoader;
2178
2231
  if (a.uri) {
2179
- const h = s.options.manager.getHandler(a.uri);
2180
- h !== null && (l = h);
2232
+ const c = s.options.manager.getHandler(a.uri);
2233
+ c !== null && (l = c);
2181
2234
  }
2182
2235
  return s.loadTextureImage(e, o.source, l);
2183
2236
  }
2184
2237
  }
2185
- class Wt {
2238
+ class nn {
2186
2239
  constructor(e, t) {
2187
2240
  this.name = t, this.parser = e;
2188
2241
  }
@@ -2196,19 +2249,19 @@ class Wt {
2196
2249
  return null;
2197
2250
  }
2198
2251
  return i.then(function(a) {
2199
- const l = n.byteOffset || 0, h = n.byteLength || 0, u = n.count, c = n.byteStride, p = new Uint8Array(a, l, h);
2200
- return o.decodeGltfBufferAsync ? o.decodeGltfBufferAsync(u, c, p, n.mode, n.filter).then(function(m) {
2252
+ const l = n.byteOffset || 0, c = n.byteLength || 0, u = n.count, h = n.byteStride, d = new Uint8Array(a, l, c);
2253
+ return o.decodeGltfBufferAsync ? o.decodeGltfBufferAsync(u, h, d, n.mode, n.filter).then(function(m) {
2201
2254
  return m.buffer;
2202
2255
  }) : o.ready.then(function() {
2203
- const m = new ArrayBuffer(u * c);
2204
- return o.decodeGltfBuffer(new Uint8Array(m), u, c, p, n.mode, n.filter), m;
2256
+ const m = new ArrayBuffer(u * h);
2257
+ return o.decodeGltfBuffer(new Uint8Array(m), u, h, d, n.mode, n.filter), m;
2205
2258
  });
2206
2259
  });
2207
2260
  } else
2208
2261
  return null;
2209
2262
  }
2210
2263
  }
2211
- class Si {
2264
+ class Oi {
2212
2265
  constructor(e) {
2213
2266
  this.name = A.EXT_MESH_GPU_INSTANCING, this.parser = e;
2214
2267
  }
@@ -2217,54 +2270,54 @@ class Si {
2217
2270
  if (!s.extensions || !s.extensions[this.name] || s.mesh === void 0)
2218
2271
  return null;
2219
2272
  const n = t.meshes[s.mesh];
2220
- for (const h of n.primitives)
2221
- if (h.mode !== W.TRIANGLES && h.mode !== W.TRIANGLE_STRIP && h.mode !== W.TRIANGLE_FAN && h.mode !== void 0)
2273
+ for (const c of n.primitives)
2274
+ if (c.mode !== ee.TRIANGLES && c.mode !== ee.TRIANGLE_STRIP && c.mode !== ee.TRIANGLE_FAN && c.mode !== void 0)
2222
2275
  return null;
2223
2276
  const o = s.extensions[this.name].attributes, a = [], l = {};
2224
- for (const h in o)
2225
- a.push(this.parser.getDependency("accessor", o[h]).then((u) => (l[h] = u, l[h])));
2226
- return a.length < 1 ? null : (a.push(this.parser.createNodeMesh(e)), Promise.all(a).then((h) => {
2227
- const u = h.pop(), c = u.isGroup ? u.children : [u], p = h[0].count, m = [];
2228
- for (const b of c) {
2229
- const f = new Se(), y = new M(), d = new K(), _ = new M(1, 1, 1), x = new zn(b.geometry, b.material, p);
2230
- for (let S = 0; S < p; S++)
2231
- l.TRANSLATION && y.fromBufferAttribute(l.TRANSLATION, S), l.ROTATION && d.fromBufferAttribute(l.ROTATION, S), l.SCALE && _.fromBufferAttribute(l.SCALE, S), x.setMatrixAt(S, f.compose(y, d, _));
2232
- for (const S in l)
2233
- if (S === "_COLOR_0") {
2234
- const R = l[S];
2235
- x.instanceColor = new Gn(R.array, R.itemSize, R.normalized);
2236
- } else S !== "TRANSLATION" && S !== "ROTATION" && S !== "SCALE" && b.geometry.setAttribute(S, l[S]);
2237
- ze.prototype.copy.call(x, b), this.parser.assignFinalMaterial(x), m.push(x);
2277
+ for (const c in o)
2278
+ a.push(this.parser.getDependency("accessor", o[c]).then((u) => (l[c] = u, l[c])));
2279
+ return a.length < 1 ? null : (a.push(this.parser.createNodeMesh(e)), Promise.all(a).then((c) => {
2280
+ const u = c.pop(), h = u.isGroup ? u.children : [u], d = c[0].count, m = [];
2281
+ for (const w of h) {
2282
+ const f = new Pe(), y = new S(), p = new K(), b = new S(1, 1, 1), T = new Wn(w.geometry, w.material, d);
2283
+ for (let M = 0; M < d; M++)
2284
+ l.TRANSLATION && y.fromBufferAttribute(l.TRANSLATION, M), l.ROTATION && p.fromBufferAttribute(l.ROTATION, M), l.SCALE && b.fromBufferAttribute(l.SCALE, M), T.setMatrixAt(M, f.compose(y, p, b));
2285
+ for (const M in l)
2286
+ if (M === "_COLOR_0") {
2287
+ const R = l[M];
2288
+ T.instanceColor = new Qn(R.array, R.itemSize, R.normalized);
2289
+ } else M !== "TRANSLATION" && M !== "ROTATION" && M !== "SCALE" && w.geometry.setAttribute(M, l[M]);
2290
+ Ye.prototype.copy.call(T, w), this.parser.assignFinalMaterial(T), m.push(T);
2238
2291
  }
2239
2292
  return u.isGroup ? (u.clear(), u.add(...m), u) : m[0];
2240
2293
  }));
2241
2294
  }
2242
2295
  }
2243
- const bn = "glTF", Oe = 12, $t = { JSON: 1313821514, BIN: 5130562 };
2244
- class Ai {
2296
+ const Sn = "glTF", De = 12, sn = { JSON: 1313821514, BIN: 5130562 };
2297
+ class ki {
2245
2298
  constructor(e) {
2246
2299
  this.name = A.KHR_BINARY_GLTF, this.content = null, this.body = null;
2247
- const t = new DataView(e, 0, Oe), s = new TextDecoder();
2300
+ const t = new DataView(e, 0, De), s = new TextDecoder();
2248
2301
  if (this.header = {
2249
2302
  magic: s.decode(new Uint8Array(e.slice(0, 4))),
2250
2303
  version: t.getUint32(4, !0),
2251
2304
  length: t.getUint32(8, !0)
2252
- }, this.header.magic !== bn)
2305
+ }, this.header.magic !== Sn)
2253
2306
  throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");
2254
2307
  if (this.header.version < 2)
2255
2308
  throw new Error("THREE.GLTFLoader: Legacy binary file detected.");
2256
- const n = this.header.length - Oe, i = new DataView(e, Oe);
2309
+ const n = this.header.length - De, i = new DataView(e, De);
2257
2310
  let o = 0;
2258
2311
  for (; o < n; ) {
2259
2312
  const a = i.getUint32(o, !0);
2260
2313
  o += 4;
2261
2314
  const l = i.getUint32(o, !0);
2262
- if (o += 4, l === $t.JSON) {
2263
- const h = new Uint8Array(e, Oe + o, a);
2264
- this.content = s.decode(h);
2265
- } else if (l === $t.BIN) {
2266
- const h = Oe + o;
2267
- this.body = e.slice(h, h + a);
2315
+ if (o += 4, l === sn.JSON) {
2316
+ const c = new Uint8Array(e, De + o, a);
2317
+ this.content = s.decode(c);
2318
+ } else if (l === sn.BIN) {
2319
+ const c = De + o;
2320
+ this.body = e.slice(c, c + a);
2268
2321
  }
2269
2322
  o += a;
2270
2323
  }
@@ -2272,39 +2325,39 @@ class Ai {
2272
2325
  throw new Error("THREE.GLTFLoader: JSON content not found.");
2273
2326
  }
2274
2327
  }
2275
- class Ri {
2328
+ class Ni {
2276
2329
  constructor(e, t) {
2277
2330
  if (!t)
2278
2331
  throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");
2279
2332
  this.name = A.KHR_DRACO_MESH_COMPRESSION, this.json = e, this.dracoLoader = t, this.dracoLoader.preload();
2280
2333
  }
2281
2334
  decodePrimitive(e, t) {
2282
- const s = this.json, n = this.dracoLoader, i = e.extensions[this.name].bufferView, o = e.extensions[this.name].attributes, a = {}, l = {}, h = {};
2335
+ const s = this.json, n = this.dracoLoader, i = e.extensions[this.name].bufferView, o = e.extensions[this.name].attributes, a = {}, l = {}, c = {};
2283
2336
  for (const u in o) {
2284
- const c = Tt[u] || u.toLowerCase();
2285
- a[c] = o[u];
2337
+ const h = Pt[u] || u.toLowerCase();
2338
+ a[h] = o[u];
2286
2339
  }
2287
2340
  for (const u in e.attributes) {
2288
- const c = Tt[u] || u.toLowerCase();
2341
+ const h = Pt[u] || u.toLowerCase();
2289
2342
  if (o[u] !== void 0) {
2290
- const p = s.accessors[e.attributes[u]], m = ve[p.componentType];
2291
- h[c] = m.name, l[c] = p.normalized === !0;
2343
+ const d = s.accessors[e.attributes[u]], m = Ae[d.componentType];
2344
+ c[h] = m.name, l[h] = d.normalized === !0;
2292
2345
  }
2293
2346
  }
2294
2347
  return t.getDependency("bufferView", i).then(function(u) {
2295
- return new Promise(function(c, p) {
2348
+ return new Promise(function(h, d) {
2296
2349
  n.decodeDracoFile(u, function(m) {
2297
- for (const b in m.attributes) {
2298
- const f = m.attributes[b], y = l[b];
2350
+ for (const w in m.attributes) {
2351
+ const f = m.attributes[w], y = l[w];
2299
2352
  y !== void 0 && (f.normalized = y);
2300
2353
  }
2301
- c(m);
2302
- }, a, h, le, p);
2354
+ h(m);
2355
+ }, a, c, ie, d);
2303
2356
  });
2304
2357
  });
2305
2358
  }
2306
2359
  }
2307
- class Pi {
2360
+ class ji {
2308
2361
  constructor() {
2309
2362
  this.name = A.KHR_TEXTURE_TRANSFORM;
2310
2363
  }
@@ -2312,12 +2365,12 @@ class Pi {
2312
2365
  return (t.texCoord === void 0 || t.texCoord === e.channel) && t.offset === void 0 && t.rotation === void 0 && t.scale === void 0 || (e = e.clone(), t.texCoord !== void 0 && (e.channel = t.texCoord), t.offset !== void 0 && e.offset.fromArray(t.offset), t.rotation !== void 0 && (e.rotation = t.rotation), t.scale !== void 0 && e.repeat.fromArray(t.scale), e.needsUpdate = !0), e;
2313
2366
  }
2314
2367
  }
2315
- class Li {
2368
+ class Hi {
2316
2369
  constructor() {
2317
2370
  this.name = A.KHR_MESH_QUANTIZATION;
2318
2371
  }
2319
2372
  }
2320
- class wn extends ls {
2373
+ class An extends fs {
2321
2374
  constructor(e, t, s, n) {
2322
2375
  super(e, t, s, n);
2323
2376
  }
@@ -2328,22 +2381,22 @@ class wn extends ls {
2328
2381
  return t;
2329
2382
  }
2330
2383
  interpolate_(e, t, s, n) {
2331
- const i = this.resultBuffer, o = this.sampleValues, a = this.valueSize, l = a * 2, h = a * 3, u = n - t, c = (s - t) / u, p = c * c, m = p * c, b = e * h, f = b - h, y = -2 * m + 3 * p, d = m - p, _ = 1 - y, x = d - p + c;
2332
- for (let S = 0; S !== a; S++) {
2333
- const R = o[f + S + a], v = o[f + S + l] * u, I = o[b + S + a], ie = o[b + S] * u;
2334
- i[S] = _ * R + x * v + y * I + d * ie;
2384
+ const i = this.resultBuffer, o = this.sampleValues, a = this.valueSize, l = a * 2, c = a * 3, u = n - t, h = (s - t) / u, d = h * h, m = d * h, w = e * c, f = w - c, y = -2 * m + 3 * d, p = m - d, b = 1 - y, T = p - d + h;
2385
+ for (let M = 0; M !== a; M++) {
2386
+ const R = o[f + M + a], v = o[f + M + l] * u, I = o[w + M + a], V = o[w + M] * u;
2387
+ i[M] = b * R + T * v + y * I + p * V;
2335
2388
  }
2336
2389
  return i;
2337
2390
  }
2338
2391
  }
2339
- const Ii = new K();
2340
- class Oi extends wn {
2392
+ const Fi = new K();
2393
+ class Ui extends An {
2341
2394
  interpolate_(e, t, s, n) {
2342
2395
  const i = super.interpolate_(e, t, s, n);
2343
- return Ii.fromArray(i).normalize().toArray(i), i;
2396
+ return Fi.fromArray(i).normalize().toArray(i), i;
2344
2397
  }
2345
2398
  }
2346
- const W = {
2399
+ const ee = {
2347
2400
  POINTS: 0,
2348
2401
  LINES: 1,
2349
2402
  LINE_LOOP: 2,
@@ -2351,25 +2404,25 @@ const W = {
2351
2404
  TRIANGLES: 4,
2352
2405
  TRIANGLE_STRIP: 5,
2353
2406
  TRIANGLE_FAN: 6
2354
- }, ve = {
2407
+ }, Ae = {
2355
2408
  5120: Int8Array,
2356
2409
  5121: Uint8Array,
2357
2410
  5122: Int16Array,
2358
2411
  5123: Uint16Array,
2359
2412
  5125: Uint32Array,
2360
2413
  5126: Float32Array
2361
- }, Jt = {
2362
- 9728: pn,
2363
- 9729: _t,
2364
- 9984: Qn,
2365
- 9985: Zn,
2366
- 9986: Vn,
2367
- 9987: dn
2368
- }, en = {
2369
- 33071: Wn,
2370
- 33648: qn,
2371
- 10497: bt
2372
- }, pt = {
2414
+ }, on = {
2415
+ 9728: bn,
2416
+ 9729: vt,
2417
+ 9984: ts,
2418
+ 9985: es,
2419
+ 9986: Jn,
2420
+ 9987: _n
2421
+ }, rn = {
2422
+ 33071: ss,
2423
+ 33648: ns,
2424
+ 10497: St
2425
+ }, bt = {
2373
2426
  SCALAR: 1,
2374
2427
  VEC2: 2,
2375
2428
  VEC3: 3,
@@ -2377,7 +2430,7 @@ const W = {
2377
2430
  MAT2: 4,
2378
2431
  MAT3: 9,
2379
2432
  MAT4: 16
2380
- }, Tt = {
2433
+ }, Pt = {
2381
2434
  POSITION: "position",
2382
2435
  NORMAL: "normal",
2383
2436
  TANGENT: "tangent",
@@ -2388,73 +2441,73 @@ const W = {
2388
2441
  COLOR_0: "color",
2389
2442
  WEIGHTS_0: "skinWeight",
2390
2443
  JOINTS_0: "skinIndex"
2391
- }, he = {
2444
+ }, de = {
2392
2445
  scale: "scale",
2393
2446
  translation: "position",
2394
2447
  rotation: "quaternion",
2395
2448
  weights: "morphTargetInfluences"
2396
- }, Ci = {
2449
+ }, zi = {
2397
2450
  CUBICSPLINE: void 0,
2398
2451
  // We use a custom interpolant (GLTFCubicSplineInterpolation) for CUBICSPLINE tracks. Each
2399
2452
  // keyframe track will be initialized with a default interpolation type, then modified.
2400
- LINEAR: mn,
2401
- STEP: rs
2402
- }, ft = {
2453
+ LINEAR: Tn,
2454
+ STEP: ds
2455
+ }, wt = {
2403
2456
  OPAQUE: "OPAQUE",
2404
2457
  MASK: "MASK",
2405
2458
  BLEND: "BLEND"
2406
2459
  };
2407
- function Di(r) {
2408
- return r.DefaultMaterial === void 0 && (r.DefaultMaterial = new fn({
2460
+ function Gi(r) {
2461
+ return r.DefaultMaterial === void 0 && (r.DefaultMaterial = new wn({
2409
2462
  color: 16777215,
2410
2463
  emissive: 0,
2411
2464
  metalness: 1,
2412
2465
  roughness: 1,
2413
2466
  transparent: !1,
2414
2467
  depthTest: !0,
2415
- side: as
2468
+ side: ps
2416
2469
  })), r.DefaultMaterial;
2417
2470
  }
2418
- function ge(r, e, t) {
2471
+ function _e(r, e, t) {
2419
2472
  for (const s in t.extensions)
2420
2473
  r[s] === void 0 && (e.userData.gltfExtensions = e.userData.gltfExtensions || {}, e.userData.gltfExtensions[s] = t.extensions[s]);
2421
2474
  }
2422
- function ne(r, e) {
2475
+ function se(r, e) {
2423
2476
  e.extras !== void 0 && (typeof e.extras == "object" ? Object.assign(r.userData, e.extras) : console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, " + e.extras));
2424
2477
  }
2425
- function Ni(r, e, t) {
2478
+ function Xi(r, e, t) {
2426
2479
  let s = !1, n = !1, i = !1;
2427
- for (let h = 0, u = e.length; h < u; h++) {
2428
- const c = e[h];
2429
- if (c.POSITION !== void 0 && (s = !0), c.NORMAL !== void 0 && (n = !0), c.COLOR_0 !== void 0 && (i = !0), s && n && i) break;
2480
+ for (let c = 0, u = e.length; c < u; c++) {
2481
+ const h = e[c];
2482
+ if (h.POSITION !== void 0 && (s = !0), h.NORMAL !== void 0 && (n = !0), h.COLOR_0 !== void 0 && (i = !0), s && n && i) break;
2430
2483
  }
2431
2484
  if (!s && !n && !i) return Promise.resolve(r);
2432
2485
  const o = [], a = [], l = [];
2433
- for (let h = 0, u = e.length; h < u; h++) {
2434
- const c = e[h];
2486
+ for (let c = 0, u = e.length; c < u; c++) {
2487
+ const h = e[c];
2435
2488
  if (s) {
2436
- const p = c.POSITION !== void 0 ? t.getDependency("accessor", c.POSITION) : r.attributes.position;
2437
- o.push(p);
2489
+ const d = h.POSITION !== void 0 ? t.getDependency("accessor", h.POSITION) : r.attributes.position;
2490
+ o.push(d);
2438
2491
  }
2439
2492
  if (n) {
2440
- const p = c.NORMAL !== void 0 ? t.getDependency("accessor", c.NORMAL) : r.attributes.normal;
2441
- a.push(p);
2493
+ const d = h.NORMAL !== void 0 ? t.getDependency("accessor", h.NORMAL) : r.attributes.normal;
2494
+ a.push(d);
2442
2495
  }
2443
2496
  if (i) {
2444
- const p = c.COLOR_0 !== void 0 ? t.getDependency("accessor", c.COLOR_0) : r.attributes.color;
2445
- l.push(p);
2497
+ const d = h.COLOR_0 !== void 0 ? t.getDependency("accessor", h.COLOR_0) : r.attributes.color;
2498
+ l.push(d);
2446
2499
  }
2447
2500
  }
2448
2501
  return Promise.all([
2449
2502
  Promise.all(o),
2450
2503
  Promise.all(a),
2451
2504
  Promise.all(l)
2452
- ]).then(function(h) {
2453
- const u = h[0], c = h[1], p = h[2];
2454
- return s && (r.morphAttributes.position = u), n && (r.morphAttributes.normal = c), i && (r.morphAttributes.color = p), r.morphTargetsRelative = !0, r;
2505
+ ]).then(function(c) {
2506
+ const u = c[0], h = c[1], d = c[2];
2507
+ return s && (r.morphAttributes.position = u), n && (r.morphAttributes.normal = h), i && (r.morphAttributes.color = d), r.morphTargetsRelative = !0, r;
2455
2508
  });
2456
2509
  }
2457
- function ki(r, e) {
2510
+ function Bi(r, e) {
2458
2511
  if (r.updateMorphTargets(), e.weights !== void 0)
2459
2512
  for (let t = 0, s = e.weights.length; t < s; t++)
2460
2513
  r.morphTargetInfluences[t] = e.weights[t];
@@ -2468,22 +2521,22 @@ function ki(r, e) {
2468
2521
  console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.");
2469
2522
  }
2470
2523
  }
2471
- function ji(r) {
2524
+ function Yi(r) {
2472
2525
  let e;
2473
2526
  const t = r.extensions && r.extensions[A.KHR_DRACO_MESH_COMPRESSION];
2474
- if (t ? e = "draco:" + t.bufferView + ":" + t.indices + ":" + mt(t.attributes) : e = r.indices + ":" + mt(r.attributes) + ":" + r.mode, r.targets !== void 0)
2527
+ if (t ? e = "draco:" + t.bufferView + ":" + t.indices + ":" + Tt(t.attributes) : e = r.indices + ":" + Tt(r.attributes) + ":" + r.mode, r.targets !== void 0)
2475
2528
  for (let s = 0, n = r.targets.length; s < n; s++)
2476
- e += ":" + mt(r.targets[s]);
2529
+ e += ":" + Tt(r.targets[s]);
2477
2530
  return e;
2478
2531
  }
2479
- function mt(r) {
2532
+ function Tt(r) {
2480
2533
  let e = "";
2481
2534
  const t = Object.keys(r).sort();
2482
2535
  for (let s = 0, n = t.length; s < n; s++)
2483
2536
  e += t[s] + ":" + r[t[s]] + ";";
2484
2537
  return e;
2485
2538
  }
2486
- function xt(r) {
2539
+ function Lt(r) {
2487
2540
  switch (r) {
2488
2541
  case Int8Array:
2489
2542
  return 1 / 127;
@@ -2497,13 +2550,13 @@ function xt(r) {
2497
2550
  throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.");
2498
2551
  }
2499
2552
  }
2500
- function Fi(r) {
2553
+ function Ki(r) {
2501
2554
  return r.search(/\.jpe?g($|\?)/i) > 0 || r.search(/^data\:image\/jpeg/) === 0 ? "image/jpeg" : r.search(/\.webp($|\?)/i) > 0 || r.search(/^data\:image\/webp/) === 0 ? "image/webp" : r.search(/\.ktx2($|\?)/i) > 0 || r.search(/^data\:image\/ktx2/) === 0 ? "image/ktx2" : "image/png";
2502
2555
  }
2503
- const Hi = new Se();
2504
- class Ui {
2556
+ const Vi = new Pe();
2557
+ class Zi {
2505
2558
  constructor(e = {}, t = {}) {
2506
- this.json = e, this.extensions = {}, this.plugins = {}, this.options = t, this.cache = new ci(), this.associations = /* @__PURE__ */ new Map(), this.primitiveCache = {}, this.nodeCache = {}, this.meshCache = { refs: {}, uses: {} }, this.cameraCache = { refs: {}, uses: {} }, this.lightCache = { refs: {}, uses: {} }, this.sourceCache = {}, this.textureCache = {}, this.nodeNamesUsed = {};
2559
+ this.json = e, this.extensions = {}, this.plugins = {}, this.options = t, this.cache = new yi(), this.associations = /* @__PURE__ */ new Map(), this.primitiveCache = {}, this.nodeCache = {}, this.meshCache = { refs: {}, uses: {} }, this.cameraCache = { refs: {}, uses: {} }, this.lightCache = { refs: {}, uses: {} }, this.sourceCache = {}, this.textureCache = {}, this.nodeNamesUsed = {};
2507
2560
  let s = !1, n = -1, i = !1, o = -1;
2508
2561
  if (typeof navigator < "u" && typeof navigator.userAgent < "u") {
2509
2562
  const a = navigator.userAgent;
@@ -2511,7 +2564,7 @@ class Ui {
2511
2564
  const l = a.match(/Version\/(\d+)/);
2512
2565
  n = s && l ? parseInt(l[1], 10) : -1, i = a.indexOf("Firefox") > -1, o = i ? a.match(/Firefox\/([0-9]+)\./)[1] : -1;
2513
2566
  }
2514
- typeof createImageBitmap > "u" || s && n < 17 || i && o < 98 ? this.textureLoader = new Xn(this.options.manager) : this.textureLoader = new Yn(this.options.manager), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.textureLoader.setRequestHeader(this.options.requestHeader), this.fileLoader = new Et(this.options.manager), this.fileLoader.setResponseType("arraybuffer"), this.options.crossOrigin === "use-credentials" && this.fileLoader.setWithCredentials(!0);
2567
+ typeof createImageBitmap > "u" || s && n < 17 || i && o < 98 ? this.textureLoader = new qn(this.options.manager) : this.textureLoader = new $n(this.options.manager), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.textureLoader.setRequestHeader(this.options.requestHeader), this.fileLoader = new Ke(this.options.manager), this.fileLoader.setResponseType("arraybuffer"), this.options.crossOrigin === "use-credentials" && this.fileLoader.setWithCredentials(!0);
2515
2568
  }
2516
2569
  setExtensions(e) {
2517
2570
  this.extensions = e;
@@ -2541,7 +2594,7 @@ class Ui {
2541
2594
  parser: s,
2542
2595
  userData: {}
2543
2596
  };
2544
- return ge(i, a, n), ne(a, n), Promise.all(s._invokeAll(function(l) {
2597
+ return _e(i, a, n), se(a, n), Promise.all(s._invokeAll(function(l) {
2545
2598
  return l.afterRoot && l.afterRoot(a);
2546
2599
  })).then(function() {
2547
2600
  for (const l of a.scenes)
@@ -2597,8 +2650,8 @@ class Ui {
2597
2650
  const n = s.clone(), i = (o, a) => {
2598
2651
  const l = this.associations.get(o);
2599
2652
  l != null && this.associations.set(a, l);
2600
- for (const [h, u] of o.children.entries())
2601
- i(u, a.children[h]);
2653
+ for (const [c, u] of o.children.entries())
2654
+ i(u, a.children[c]);
2602
2655
  };
2603
2656
  return i(s, n), n.name += "_instance_" + e.uses[t]++, n;
2604
2657
  }
@@ -2722,7 +2775,7 @@ class Ui {
2722
2775
  return Promise.resolve(this.extensions[A.KHR_BINARY_GLTF].body);
2723
2776
  const n = this.options;
2724
2777
  return new Promise(function(i, o) {
2725
- s.load(He.resolveURL(t.uri, n.path), i, void 0, function() {
2778
+ s.load(Ue.resolveURL(t.uri, n.path), i, void 0, function() {
2726
2779
  o(new Error('THREE.GLTFLoader: Failed to load buffer "' + t.uri + '".'));
2727
2780
  });
2728
2781
  });
@@ -2751,27 +2804,27 @@ class Ui {
2751
2804
  loadAccessor(e) {
2752
2805
  const t = this, s = this.json, n = this.json.accessors[e];
2753
2806
  if (n.bufferView === void 0 && n.sparse === void 0) {
2754
- const o = pt[n.type], a = ve[n.componentType], l = n.normalized === !0, h = new a(n.count * o);
2755
- return Promise.resolve(new rt(h, o, l));
2807
+ const o = bt[n.type], a = Ae[n.componentType], l = n.normalized === !0, c = new a(n.count * o);
2808
+ return Promise.resolve(new ze(c, o, l));
2756
2809
  }
2757
2810
  const i = [];
2758
2811
  return n.bufferView !== void 0 ? i.push(this.getDependency("bufferView", n.bufferView)) : i.push(null), n.sparse !== void 0 && (i.push(this.getDependency("bufferView", n.sparse.indices.bufferView)), i.push(this.getDependency("bufferView", n.sparse.values.bufferView))), Promise.all(i).then(function(o) {
2759
- const a = o[0], l = pt[n.type], h = ve[n.componentType], u = h.BYTES_PER_ELEMENT, c = u * l, p = n.byteOffset || 0, m = n.bufferView !== void 0 ? s.bufferViews[n.bufferView].byteStride : void 0, b = n.normalized === !0;
2812
+ const a = o[0], l = bt[n.type], c = Ae[n.componentType], u = c.BYTES_PER_ELEMENT, h = u * l, d = n.byteOffset || 0, m = n.bufferView !== void 0 ? s.bufferViews[n.bufferView].byteStride : void 0, w = n.normalized === !0;
2760
2813
  let f, y;
2761
- if (m && m !== c) {
2762
- const d = Math.floor(p / m), _ = "InterleavedBuffer:" + n.bufferView + ":" + n.componentType + ":" + d + ":" + n.count;
2763
- let x = t.cache.get(_);
2764
- x || (f = new h(a, d * m, n.count * m / u), x = new Bn(f, m / u), t.cache.add(_, x)), y = new Kn(x, l, p % m / u, b);
2814
+ if (m && m !== h) {
2815
+ const p = Math.floor(d / m), b = "InterleavedBuffer:" + n.bufferView + ":" + n.componentType + ":" + p + ":" + n.count;
2816
+ let T = t.cache.get(b);
2817
+ T || (f = new c(a, p * m, n.count * m / u), T = new gn(f, m / u), t.cache.add(b, T)), y = new yn(T, l, d % m / u, w);
2765
2818
  } else
2766
- a === null ? f = new h(n.count * l) : f = new h(a, p, n.count * l), y = new rt(f, l, b);
2819
+ a === null ? f = new c(n.count * l) : f = new c(a, d, n.count * l), y = new ze(f, l, w);
2767
2820
  if (n.sparse !== void 0) {
2768
- const d = pt.SCALAR, _ = ve[n.sparse.indices.componentType], x = n.sparse.indices.byteOffset || 0, S = n.sparse.values.byteOffset || 0, R = new _(o[1], x, n.sparse.count * d), v = new h(o[2], S, n.sparse.count * l);
2769
- a !== null && (y = new rt(y.array.slice(), y.itemSize, y.normalized)), y.normalized = !1;
2770
- for (let I = 0, ie = R.length; I < ie; I++) {
2771
- const ee = R[I];
2772
- if (y.setX(ee, v[I * l]), l >= 2 && y.setY(ee, v[I * l + 1]), l >= 3 && y.setZ(ee, v[I * l + 2]), l >= 4 && y.setW(ee, v[I * l + 3]), l >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
2821
+ const p = bt.SCALAR, b = Ae[n.sparse.indices.componentType], T = n.sparse.indices.byteOffset || 0, M = n.sparse.values.byteOffset || 0, R = new b(o[1], T, n.sparse.count * p), v = new c(o[2], M, n.sparse.count * l);
2822
+ a !== null && (y = new ze(y.array.slice(), y.itemSize, y.normalized)), y.normalized = !1;
2823
+ for (let I = 0, V = R.length; I < V; I++) {
2824
+ const W = R[I];
2825
+ if (y.setX(W, v[I * l]), l >= 2 && y.setY(W, v[I * l + 1]), l >= 3 && y.setZ(W, v[I * l + 2]), l >= 4 && y.setW(W, v[I * l + 3]), l >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
2773
2826
  }
2774
- y.normalized = b;
2827
+ y.normalized = w;
2775
2828
  }
2776
2829
  return y;
2777
2830
  });
@@ -2796,41 +2849,41 @@ class Ui {
2796
2849
  const n = this, i = this.json, o = i.textures[e], a = i.images[t], l = (a.uri || a.bufferView) + ":" + o.sampler;
2797
2850
  if (this.textureCache[l])
2798
2851
  return this.textureCache[l];
2799
- const h = this.loadImageSource(t, s).then(function(u) {
2852
+ const c = this.loadImageSource(t, s).then(function(u) {
2800
2853
  u.flipY = !1, u.name = o.name || a.name || "", u.name === "" && typeof a.uri == "string" && a.uri.startsWith("data:image/") === !1 && (u.name = a.uri);
2801
- const p = (i.samplers || {})[o.sampler] || {};
2802
- return u.magFilter = Jt[p.magFilter] || _t, u.minFilter = Jt[p.minFilter] || dn, u.wrapS = en[p.wrapS] || bt, u.wrapT = en[p.wrapT] || bt, u.generateMipmaps = !u.isCompressedTexture && u.minFilter !== pn && u.minFilter !== _t, n.associations.set(u, { textures: e }), u;
2854
+ const d = (i.samplers || {})[o.sampler] || {};
2855
+ return u.magFilter = on[d.magFilter] || vt, u.minFilter = on[d.minFilter] || _n, u.wrapS = rn[d.wrapS] || St, u.wrapT = rn[d.wrapT] || St, u.generateMipmaps = !u.isCompressedTexture && u.minFilter !== bn && u.minFilter !== vt, n.associations.set(u, { textures: e }), u;
2803
2856
  }).catch(function() {
2804
2857
  return null;
2805
2858
  });
2806
- return this.textureCache[l] = h, h;
2859
+ return this.textureCache[l] = c, c;
2807
2860
  }
2808
2861
  loadImageSource(e, t) {
2809
2862
  const s = this, n = this.json, i = this.options;
2810
2863
  if (this.sourceCache[e] !== void 0)
2811
- return this.sourceCache[e].then((c) => c.clone());
2864
+ return this.sourceCache[e].then((h) => h.clone());
2812
2865
  const o = n.images[e], a = self.URL || self.webkitURL;
2813
- let l = o.uri || "", h = !1;
2866
+ let l = o.uri || "", c = !1;
2814
2867
  if (o.bufferView !== void 0)
2815
- l = s.getDependency("bufferView", o.bufferView).then(function(c) {
2816
- h = !0;
2817
- const p = new Blob([c], { type: o.mimeType });
2818
- return l = a.createObjectURL(p), l;
2868
+ l = s.getDependency("bufferView", o.bufferView).then(function(h) {
2869
+ c = !0;
2870
+ const d = new Blob([h], { type: o.mimeType });
2871
+ return l = a.createObjectURL(d), l;
2819
2872
  });
2820
2873
  else if (o.uri === void 0)
2821
2874
  throw new Error("THREE.GLTFLoader: Image " + e + " is missing URI and bufferView");
2822
- const u = Promise.resolve(l).then(function(c) {
2823
- return new Promise(function(p, m) {
2824
- let b = p;
2825
- t.isImageBitmapLoader === !0 && (b = function(f) {
2826
- const y = new Ot(f);
2827
- y.needsUpdate = !0, p(y);
2828
- }), t.load(He.resolveURL(c, i.path), b, void 0, m);
2875
+ const u = Promise.resolve(l).then(function(h) {
2876
+ return new Promise(function(d, m) {
2877
+ let w = d;
2878
+ t.isImageBitmapLoader === !0 && (w = function(f) {
2879
+ const y = new Ht(f);
2880
+ y.needsUpdate = !0, d(y);
2881
+ }), t.load(Ue.resolveURL(h, i.path), w, void 0, m);
2829
2882
  });
2830
- }).then(function(c) {
2831
- return h === !0 && a.revokeObjectURL(l), ne(c, o), c.userData.mimeType = o.mimeType || Fi(o.uri), c;
2832
- }).catch(function(c) {
2833
- throw console.error("THREE.GLTFLoader: Couldn't load texture", l), c;
2883
+ }).then(function(h) {
2884
+ return c === !0 && a.revokeObjectURL(l), se(h, o), h.userData.mimeType = o.mimeType || Ki(o.uri), h;
2885
+ }).catch(function(h) {
2886
+ throw console.error("THREE.GLTFLoader: Couldn't load texture", l), h;
2834
2887
  });
2835
2888
  return this.sourceCache[e] = u, u;
2836
2889
  }
@@ -2875,11 +2928,11 @@ class Ui {
2875
2928
  if (e.isPoints) {
2876
2929
  const a = "PointsMaterial:" + s.uuid;
2877
2930
  let l = this.cache.get(a);
2878
- l || (l = new Ce(), Fe.prototype.copy.call(l, s), l.color.copy(s.color), l.map = s.map, l.sizeAttenuation = !1, this.cache.add(a, l)), s = l;
2931
+ l || (l = new Oe(), Fe.prototype.copy.call(l, s), l.color.copy(s.color), l.map = s.map, l.sizeAttenuation = !1, this.cache.add(a, l)), s = l;
2879
2932
  } else if (e.isLine) {
2880
2933
  const a = "LineBasicMaterial:" + s.uuid;
2881
2934
  let l = this.cache.get(a);
2882
- l || (l = new je(), Fe.prototype.copy.call(l, s), l.color.copy(s.color), l.map = s.map, this.cache.add(a, l)), s = l;
2935
+ l || (l = new He(), Fe.prototype.copy.call(l, s), l.color.copy(s.color), l.map = s.map, this.cache.add(a, l)), s = l;
2883
2936
  }
2884
2937
  if (n || i || o) {
2885
2938
  let a = "ClonedMaterial:" + s.uuid + ":";
@@ -2890,7 +2943,7 @@ class Ui {
2890
2943
  e.material = s;
2891
2944
  }
2892
2945
  getMaterialType() {
2893
- return fn;
2946
+ return wn;
2894
2947
  }
2895
2948
  /**
2896
2949
  * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#materials
@@ -2902,35 +2955,35 @@ class Ui {
2902
2955
  loadMaterial(e) {
2903
2956
  const t = this, s = this.json, n = this.extensions, i = s.materials[e];
2904
2957
  let o;
2905
- const a = {}, l = i.extensions || {}, h = [];
2958
+ const a = {}, l = i.extensions || {}, c = [];
2906
2959
  if (l[A.KHR_MATERIALS_UNLIT]) {
2907
- const c = n[A.KHR_MATERIALS_UNLIT];
2908
- o = c.getMaterialType(), h.push(c.extendParams(a, i, t));
2960
+ const h = n[A.KHR_MATERIALS_UNLIT];
2961
+ o = h.getMaterialType(), c.push(h.extendParams(a, i, t));
2909
2962
  } else {
2910
- const c = i.pbrMetallicRoughness || {};
2911
- if (a.color = new pe(1, 1, 1), a.opacity = 1, Array.isArray(c.baseColorFactor)) {
2912
- const p = c.baseColorFactor;
2913
- a.color.setRGB(p[0], p[1], p[2], le), a.opacity = p[3];
2963
+ const h = i.pbrMetallicRoughness || {};
2964
+ if (a.color = new he(1, 1, 1), a.opacity = 1, Array.isArray(h.baseColorFactor)) {
2965
+ const d = h.baseColorFactor;
2966
+ a.color.setRGB(d[0], d[1], d[2], ie), a.opacity = d[3];
2914
2967
  }
2915
- c.baseColorTexture !== void 0 && h.push(t.assignTexture(a, "map", c.baseColorTexture, Ae)), a.metalness = c.metallicFactor !== void 0 ? c.metallicFactor : 1, a.roughness = c.roughnessFactor !== void 0 ? c.roughnessFactor : 1, c.metallicRoughnessTexture !== void 0 && (h.push(t.assignTexture(a, "metalnessMap", c.metallicRoughnessTexture)), h.push(t.assignTexture(a, "roughnessMap", c.metallicRoughnessTexture))), o = this._invokeOne(function(p) {
2916
- return p.getMaterialType && p.getMaterialType(e);
2917
- }), h.push(Promise.all(this._invokeAll(function(p) {
2918
- return p.extendMaterialParams && p.extendMaterialParams(e, a);
2968
+ h.baseColorTexture !== void 0 && c.push(t.assignTexture(a, "map", h.baseColorTexture, ce)), a.metalness = h.metallicFactor !== void 0 ? h.metallicFactor : 1, a.roughness = h.roughnessFactor !== void 0 ? h.roughnessFactor : 1, h.metallicRoughnessTexture !== void 0 && (c.push(t.assignTexture(a, "metalnessMap", h.metallicRoughnessTexture)), c.push(t.assignTexture(a, "roughnessMap", h.metallicRoughnessTexture))), o = this._invokeOne(function(d) {
2969
+ return d.getMaterialType && d.getMaterialType(e);
2970
+ }), c.push(Promise.all(this._invokeAll(function(d) {
2971
+ return d.extendMaterialParams && d.extendMaterialParams(e, a);
2919
2972
  })));
2920
2973
  }
2921
- i.doubleSided === !0 && (a.side = cn);
2922
- const u = i.alphaMode || ft.OPAQUE;
2923
- if (u === ft.BLEND ? (a.transparent = !0, a.depthWrite = !1) : (a.transparent = !1, u === ft.MASK && (a.alphaTest = i.alphaCutoff !== void 0 ? i.alphaCutoff : 0.5)), i.normalTexture !== void 0 && o !== _e && (h.push(t.assignTexture(a, "normalMap", i.normalTexture)), a.normalScale = new V(1, 1), i.normalTexture.scale !== void 0)) {
2924
- const c = i.normalTexture.scale;
2925
- a.normalScale.set(c, c);
2974
+ i.doubleSided === !0 && (a.side = fn);
2975
+ const u = i.alphaMode || wt.OPAQUE;
2976
+ if (u === wt.BLEND ? (a.transparent = !0, a.depthWrite = !1) : (a.transparent = !1, u === wt.MASK && (a.alphaTest = i.alphaCutoff !== void 0 ? i.alphaCutoff : 0.5)), i.normalTexture !== void 0 && o !== we && (c.push(t.assignTexture(a, "normalMap", i.normalTexture)), a.normalScale = new Z(1, 1), i.normalTexture.scale !== void 0)) {
2977
+ const h = i.normalTexture.scale;
2978
+ a.normalScale.set(h, h);
2926
2979
  }
2927
- if (i.occlusionTexture !== void 0 && o !== _e && (h.push(t.assignTexture(a, "aoMap", i.occlusionTexture)), i.occlusionTexture.strength !== void 0 && (a.aoMapIntensity = i.occlusionTexture.strength)), i.emissiveFactor !== void 0 && o !== _e) {
2928
- const c = i.emissiveFactor;
2929
- a.emissive = new pe().setRGB(c[0], c[1], c[2], le);
2980
+ if (i.occlusionTexture !== void 0 && o !== we && (c.push(t.assignTexture(a, "aoMap", i.occlusionTexture)), i.occlusionTexture.strength !== void 0 && (a.aoMapIntensity = i.occlusionTexture.strength)), i.emissiveFactor !== void 0 && o !== we) {
2981
+ const h = i.emissiveFactor;
2982
+ a.emissive = new he().setRGB(h[0], h[1], h[2], ie);
2930
2983
  }
2931
- return i.emissiveTexture !== void 0 && o !== _e && h.push(t.assignTexture(a, "emissiveMap", i.emissiveTexture, Ae)), Promise.all(h).then(function() {
2932
- const c = new o(a);
2933
- return i.name && (c.name = i.name), ne(c, i), t.associations.set(c, { materials: e }), i.extensions && ge(n, c, i), c;
2984
+ return i.emissiveTexture !== void 0 && o !== we && c.push(t.assignTexture(a, "emissiveMap", i.emissiveTexture, ce)), Promise.all(c).then(function() {
2985
+ const h = new o(a);
2986
+ return i.name && (h.name = i.name), se(h, i), t.associations.set(h, { materials: e }), i.extensions && _e(n, h, i), h;
2934
2987
  });
2935
2988
  }
2936
2989
  /**
@@ -2941,7 +2994,7 @@ class Ui {
2941
2994
  * @return {string}
2942
2995
  */
2943
2996
  createUniqueName(e) {
2944
- const t = $n.sanitizeNodeName(e || "");
2997
+ const t = is.sanitizeNodeName(e || "");
2945
2998
  return t in this.nodeNamesUsed ? t + "_" + ++this.nodeNamesUsed[t] : (this.nodeNamesUsed[t] = 0, t);
2946
2999
  }
2947
3000
  /**
@@ -2957,17 +3010,17 @@ class Ui {
2957
3010
  const t = this, s = this.extensions, n = this.primitiveCache;
2958
3011
  function i(a) {
2959
3012
  return s[A.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a, t).then(function(l) {
2960
- return tn(l, a, t);
3013
+ return an(l, a, t);
2961
3014
  });
2962
3015
  }
2963
3016
  const o = [];
2964
3017
  for (let a = 0, l = e.length; a < l; a++) {
2965
- const h = e[a], u = ji(h), c = n[u];
2966
- if (c)
2967
- o.push(c.promise);
3018
+ const c = e[a], u = Yi(c), h = n[u];
3019
+ if (h)
3020
+ o.push(h.promise);
2968
3021
  else {
2969
- let p;
2970
- h.extensions && h.extensions[A.KHR_DRACO_MESH_COMPRESSION] ? p = i(h) : p = tn(new Ge(), h, t), n[u] = { primitive: h, promise: p }, o.push(p);
3022
+ let d;
3023
+ c.extensions && c.extensions[A.KHR_DRACO_MESH_COMPRESSION] ? d = i(c) : d = an(new Re(), c, t), n[u] = { primitive: c, promise: d }, o.push(d);
2971
3024
  }
2972
3025
  }
2973
3026
  return Promise.all(o);
@@ -2981,42 +3034,42 @@ class Ui {
2981
3034
  */
2982
3035
  loadMesh(e) {
2983
3036
  const t = this, s = this.json, n = this.extensions, i = s.meshes[e], o = i.primitives, a = [];
2984
- for (let l = 0, h = o.length; l < h; l++) {
2985
- const u = o[l].material === void 0 ? Di(this.cache) : this.getDependency("material", o[l].material);
3037
+ for (let l = 0, c = o.length; l < c; l++) {
3038
+ const u = o[l].material === void 0 ? Gi(this.cache) : this.getDependency("material", o[l].material);
2986
3039
  a.push(u);
2987
3040
  }
2988
3041
  return a.push(t.loadGeometries(o)), Promise.all(a).then(function(l) {
2989
- const h = l.slice(0, l.length - 1), u = l[l.length - 1], c = [];
2990
- for (let m = 0, b = u.length; m < b; m++) {
3042
+ const c = l.slice(0, l.length - 1), u = l[l.length - 1], h = [];
3043
+ for (let m = 0, w = u.length; m < w; m++) {
2991
3044
  const f = u[m], y = o[m];
2992
- let d;
2993
- const _ = h[m];
2994
- if (y.mode === W.TRIANGLES || y.mode === W.TRIANGLE_STRIP || y.mode === W.TRIANGLE_FAN || y.mode === void 0)
2995
- d = i.isSkinnedMesh === !0 ? new Jn(f, _) : new T(f, _), d.isSkinnedMesh === !0 && d.normalizeSkinWeights(), y.mode === W.TRIANGLE_STRIP ? d.geometry = qt(d.geometry, un) : y.mode === W.TRIANGLE_FAN && (d.geometry = qt(d.geometry, yt));
2996
- else if (y.mode === W.LINES)
2997
- d = new gt(f, _);
2998
- else if (y.mode === W.LINE_STRIP)
2999
- d = new re(f, _);
3000
- else if (y.mode === W.LINE_LOOP)
3001
- d = new es(f, _);
3002
- else if (y.mode === W.POINTS)
3003
- d = new st(f, _);
3045
+ let p;
3046
+ const b = c[m];
3047
+ if (y.mode === ee.TRIANGLES || y.mode === ee.TRIANGLE_STRIP || y.mode === ee.TRIANGLE_FAN || y.mode === void 0)
3048
+ p = i.isSkinnedMesh === !0 ? new os(f, b) : new E(f, b), p.isSkinnedMesh === !0 && p.normalizeSkinWeights(), y.mode === ee.TRIANGLE_STRIP ? p.geometry = tn(p.geometry, mn) : y.mode === ee.TRIANGLE_FAN && (p.geometry = tn(p.geometry, Mt));
3049
+ else if (y.mode === ee.LINES)
3050
+ p = new Et(f, b);
3051
+ else if (y.mode === ee.LINE_STRIP)
3052
+ p = new ae(f, b);
3053
+ else if (y.mode === ee.LINE_LOOP)
3054
+ p = new rs(f, b);
3055
+ else if (y.mode === ee.POINTS)
3056
+ p = new lt(f, b);
3004
3057
  else
3005
3058
  throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + y.mode);
3006
- Object.keys(d.geometry.morphAttributes).length > 0 && ki(d, i), d.name = t.createUniqueName(i.name || "mesh_" + e), ne(d, i), y.extensions && ge(n, d, y), t.assignFinalMaterial(d), c.push(d);
3059
+ Object.keys(p.geometry.morphAttributes).length > 0 && Bi(p, i), p.name = t.createUniqueName(i.name || "mesh_" + e), se(p, i), y.extensions && _e(n, p, y), t.assignFinalMaterial(p), h.push(p);
3007
3060
  }
3008
- for (let m = 0, b = c.length; m < b; m++)
3009
- t.associations.set(c[m], {
3061
+ for (let m = 0, w = h.length; m < w; m++)
3062
+ t.associations.set(h[m], {
3010
3063
  meshes: e,
3011
3064
  primitives: m
3012
3065
  });
3013
- if (c.length === 1)
3014
- return i.extensions && ge(n, c[0], i), c[0];
3015
- const p = new nt();
3016
- i.extensions && ge(n, p, i), t.associations.set(p, { meshes: e });
3017
- for (let m = 0, b = c.length; m < b; m++)
3018
- p.add(c[m]);
3019
- return p;
3066
+ if (h.length === 1)
3067
+ return i.extensions && _e(n, h[0], i), h[0];
3068
+ const d = new at();
3069
+ i.extensions && _e(n, d, i), t.associations.set(d, { meshes: e });
3070
+ for (let m = 0, w = h.length; m < w; m++)
3071
+ d.add(h[m]);
3072
+ return d;
3020
3073
  });
3021
3074
  }
3022
3075
  /**
@@ -3033,7 +3086,7 @@ class Ui {
3033
3086
  console.warn("THREE.GLTFLoader: Missing camera parameters.");
3034
3087
  return;
3035
3088
  }
3036
- return s.type === "perspective" ? t = new ts(ln.radToDeg(n.yfov), n.aspectRatio || 1, n.znear || 1, n.zfar || 2e6) : s.type === "orthographic" && (t = new ns(-n.xmag, n.xmag, n.ymag, -n.ymag, n.znear, n.zfar)), s.name && (t.name = this.createUniqueName(s.name)), ne(t, s), Promise.resolve(t);
3089
+ return s.type === "perspective" ? t = new as(pn.radToDeg(n.yfov), n.aspectRatio || 1, n.znear || 1, n.zfar || 2e6) : s.type === "orthographic" && (t = new ls(-n.xmag, n.xmag, n.ymag, -n.ymag, n.znear, n.zfar)), s.name && (t.name = this.createUniqueName(s.name)), se(t, s), Promise.resolve(t);
3037
3090
  }
3038
3091
  /**
3039
3092
  * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins
@@ -3048,16 +3101,16 @@ class Ui {
3048
3101
  s.push(this._loadNodeShallow(t.joints[n]));
3049
3102
  return t.inverseBindMatrices !== void 0 ? s.push(this.getDependency("accessor", t.inverseBindMatrices)) : s.push(null), Promise.all(s).then(function(n) {
3050
3103
  const i = n.pop(), o = n, a = [], l = [];
3051
- for (let h = 0, u = o.length; h < u; h++) {
3052
- const c = o[h];
3053
- if (c) {
3054
- a.push(c);
3055
- const p = new Se();
3056
- i !== null && p.fromArray(i.array, h * 16), l.push(p);
3104
+ for (let c = 0, u = o.length; c < u; c++) {
3105
+ const h = o[c];
3106
+ if (h) {
3107
+ a.push(h);
3108
+ const d = new Pe();
3109
+ i !== null && d.fromArray(i.array, c * 16), l.push(d);
3057
3110
  } else
3058
- console.warn('THREE.GLTFLoader: Joint "%s" could not be found.', t.joints[h]);
3111
+ console.warn('THREE.GLTFLoader: Joint "%s" could not be found.', t.joints[c]);
3059
3112
  }
3060
- return new ss(a, l);
3113
+ return new cs(a, l);
3061
3114
  });
3062
3115
  }
3063
3116
  /**
@@ -3068,30 +3121,30 @@ class Ui {
3068
3121
  * @return {Promise<AnimationClip>}
3069
3122
  */
3070
3123
  loadAnimation(e) {
3071
- const t = this.json, s = this, n = t.animations[e], i = n.name ? n.name : "animation_" + e, o = [], a = [], l = [], h = [], u = [];
3072
- for (let c = 0, p = n.channels.length; c < p; c++) {
3073
- const m = n.channels[c], b = n.samplers[m.sampler], f = m.target, y = f.node, d = n.parameters !== void 0 ? n.parameters[b.input] : b.input, _ = n.parameters !== void 0 ? n.parameters[b.output] : b.output;
3074
- f.node !== void 0 && (o.push(this.getDependency("node", y)), a.push(this.getDependency("accessor", d)), l.push(this.getDependency("accessor", _)), h.push(b), u.push(f));
3124
+ const t = this.json, s = this, n = t.animations[e], i = n.name ? n.name : "animation_" + e, o = [], a = [], l = [], c = [], u = [];
3125
+ for (let h = 0, d = n.channels.length; h < d; h++) {
3126
+ const m = n.channels[h], w = n.samplers[m.sampler], f = m.target, y = f.node, p = n.parameters !== void 0 ? n.parameters[w.input] : w.input, b = n.parameters !== void 0 ? n.parameters[w.output] : w.output;
3127
+ f.node !== void 0 && (o.push(this.getDependency("node", y)), a.push(this.getDependency("accessor", p)), l.push(this.getDependency("accessor", b)), c.push(w), u.push(f));
3075
3128
  }
3076
3129
  return Promise.all([
3077
3130
  Promise.all(o),
3078
3131
  Promise.all(a),
3079
3132
  Promise.all(l),
3080
- Promise.all(h),
3133
+ Promise.all(c),
3081
3134
  Promise.all(u)
3082
- ]).then(function(c) {
3083
- const p = c[0], m = c[1], b = c[2], f = c[3], y = c[4], d = [];
3084
- for (let x = 0, S = p.length; x < S; x++) {
3085
- const R = p[x], v = m[x], I = b[x], ie = f[x], ee = y[x];
3135
+ ]).then(function(h) {
3136
+ const d = h[0], m = h[1], w = h[2], f = h[3], y = h[4], p = [];
3137
+ for (let T = 0, M = d.length; T < M; T++) {
3138
+ const R = d[T], v = m[T], I = w[T], V = f[T], W = y[T];
3086
3139
  if (R === void 0) continue;
3087
3140
  R.updateMatrix && R.updateMatrix();
3088
- const fe = s._createAnimationTracks(R, v, I, ie, ee);
3089
- if (fe)
3090
- for (let $ = 0; $ < fe.length; $++)
3091
- d.push(fe[$]);
3141
+ const Q = s._createAnimationTracks(R, v, I, V, W);
3142
+ if (Q)
3143
+ for (let me = 0; me < Q.length; me++)
3144
+ p.push(Q[me]);
3092
3145
  }
3093
- const _ = new is(i, void 0, d);
3094
- return ne(_, n), _;
3146
+ const b = new hs(i, void 0, p);
3147
+ return se(b, n), b;
3095
3148
  });
3096
3149
  }
3097
3150
  createNodeMesh(e) {
@@ -3100,7 +3153,7 @@ class Ui {
3100
3153
  const o = s._getNodeRef(s.meshCache, n.mesh, i);
3101
3154
  return n.weights !== void 0 && o.traverse(function(a) {
3102
3155
  if (a.isMesh)
3103
- for (let l = 0, h = n.weights.length; l < h; l++)
3156
+ for (let l = 0, c = n.weights.length; l < c; l++)
3104
3157
  a.morphTargetInfluences[l] = n.weights[l];
3105
3158
  }), o;
3106
3159
  });
@@ -3114,23 +3167,23 @@ class Ui {
3114
3167
  */
3115
3168
  loadNode(e) {
3116
3169
  const t = this.json, s = this, n = t.nodes[e], i = s._loadNodeShallow(e), o = [], a = n.children || [];
3117
- for (let h = 0, u = a.length; h < u; h++)
3118
- o.push(s.getDependency("node", a[h]));
3170
+ for (let c = 0, u = a.length; c < u; c++)
3171
+ o.push(s.getDependency("node", a[c]));
3119
3172
  const l = n.skin === void 0 ? Promise.resolve(null) : s.getDependency("skin", n.skin);
3120
3173
  return Promise.all([
3121
3174
  i,
3122
3175
  Promise.all(o),
3123
3176
  l
3124
- ]).then(function(h) {
3125
- const u = h[0], c = h[1], p = h[2];
3126
- p !== null && u.traverse(function(m) {
3127
- m.isSkinnedMesh && m.bind(p, Hi);
3177
+ ]).then(function(c) {
3178
+ const u = c[0], h = c[1], d = c[2];
3179
+ d !== null && u.traverse(function(m) {
3180
+ m.isSkinnedMesh && m.bind(d, Vi);
3128
3181
  });
3129
- for (let m = 0, b = c.length; m < b; m++)
3130
- u.add(c[m]);
3131
- if (u.userData.pivot !== void 0 && c.length > 0) {
3132
- const m = u.userData.pivot, b = c[0];
3133
- u.pivot = new M().fromArray(m), u.position.x -= m[0], u.position.y -= m[1], u.position.z -= m[2], b.position.set(0, 0, 0), delete u.userData.pivot;
3182
+ for (let m = 0, w = h.length; m < w; m++)
3183
+ u.add(h[m]);
3184
+ if (u.userData.pivot !== void 0 && h.length > 0) {
3185
+ const m = u.userData.pivot, w = h[0];
3186
+ u.pivot = new S().fromArray(m), u.position.x -= m[0], u.position.y -= m[1], u.position.z -= m[2], w.position.set(0, 0, 0), delete u.userData.pivot;
3134
3187
  }
3135
3188
  return u;
3136
3189
  });
@@ -3141,30 +3194,30 @@ class Ui {
3141
3194
  const t = this.json, s = this.extensions, n = this;
3142
3195
  if (this.nodeCache[e] !== void 0)
3143
3196
  return this.nodeCache[e];
3144
- const i = t.nodes[e], o = i.name ? n.createUniqueName(i.name) : "", a = [], l = n._invokeOne(function(h) {
3145
- return h.createNodeMesh && h.createNodeMesh(e);
3197
+ const i = t.nodes[e], o = i.name ? n.createUniqueName(i.name) : "", a = [], l = n._invokeOne(function(c) {
3198
+ return c.createNodeMesh && c.createNodeMesh(e);
3146
3199
  });
3147
- return l && a.push(l), i.camera !== void 0 && a.push(n.getDependency("camera", i.camera).then(function(h) {
3148
- return n._getNodeRef(n.cameraCache, i.camera, h);
3149
- })), n._invokeAll(function(h) {
3150
- return h.createNodeAttachment && h.createNodeAttachment(e);
3151
- }).forEach(function(h) {
3152
- a.push(h);
3153
- }), this.nodeCache[e] = Promise.all(a).then(function(h) {
3200
+ return l && a.push(l), i.camera !== void 0 && a.push(n.getDependency("camera", i.camera).then(function(c) {
3201
+ return n._getNodeRef(n.cameraCache, i.camera, c);
3202
+ })), n._invokeAll(function(c) {
3203
+ return c.createNodeAttachment && c.createNodeAttachment(e);
3204
+ }).forEach(function(c) {
3205
+ a.push(c);
3206
+ }), this.nodeCache[e] = Promise.all(a).then(function(c) {
3154
3207
  let u;
3155
- if (i.isBone === !0 ? u = new os() : h.length > 1 ? u = new nt() : h.length === 1 ? u = h[0] : u = new ze(), u !== h[0])
3156
- for (let c = 0, p = h.length; c < p; c++)
3157
- u.add(h[c]);
3158
- if (i.name && (u.userData.name = i.name, u.name = o), ne(u, i), i.extensions && ge(s, u, i), i.matrix !== void 0) {
3159
- const c = new Se();
3160
- c.fromArray(i.matrix), u.applyMatrix4(c);
3208
+ if (i.isBone === !0 ? u = new us() : c.length > 1 ? u = new at() : c.length === 1 ? u = c[0] : u = new Ye(), u !== c[0])
3209
+ for (let h = 0, d = c.length; h < d; h++)
3210
+ u.add(c[h]);
3211
+ if (i.name && (u.userData.name = i.name, u.name = o), se(u, i), i.extensions && _e(s, u, i), i.matrix !== void 0) {
3212
+ const h = new Pe();
3213
+ h.fromArray(i.matrix), u.applyMatrix4(h);
3161
3214
  } else
3162
3215
  i.translation !== void 0 && u.position.fromArray(i.translation), i.rotation !== void 0 && u.quaternion.fromArray(i.rotation), i.scale !== void 0 && u.scale.fromArray(i.scale);
3163
3216
  if (!n.associations.has(u))
3164
3217
  n.associations.set(u, {});
3165
3218
  else if (i.mesh !== void 0 && n.meshCache.refs[i.mesh] > 1) {
3166
- const c = n.associations.get(u);
3167
- n.associations.set(u, { ...c });
3219
+ const h = n.associations.get(u);
3220
+ n.associations.set(u, { ...h });
3168
3221
  }
3169
3222
  return n.associations.get(u).nodes = e, u;
3170
3223
  }), this.nodeCache[e];
@@ -3177,66 +3230,66 @@ class Ui {
3177
3230
  * @return {Promise<Group>}
3178
3231
  */
3179
3232
  loadScene(e) {
3180
- const t = this.extensions, s = this.json.scenes[e], n = this, i = new nt();
3181
- s.name && (i.name = n.createUniqueName(s.name)), ne(i, s), s.extensions && ge(t, i, s);
3233
+ const t = this.extensions, s = this.json.scenes[e], n = this, i = new at();
3234
+ s.name && (i.name = n.createUniqueName(s.name)), se(i, s), s.extensions && _e(t, i, s);
3182
3235
  const o = s.nodes || [], a = [];
3183
- for (let l = 0, h = o.length; l < h; l++)
3236
+ for (let l = 0, c = o.length; l < c; l++)
3184
3237
  a.push(n.getDependency("node", o[l]));
3185
3238
  return Promise.all(a).then(function(l) {
3186
- for (let u = 0, c = l.length; u < c; u++) {
3187
- const p = l[u];
3188
- p.parent !== null ? i.add(ai(p)) : i.add(p);
3239
+ for (let u = 0, h = l.length; u < h; u++) {
3240
+ const d = l[u];
3241
+ d.parent !== null ? i.add(mi(d)) : i.add(d);
3189
3242
  }
3190
- const h = (u) => {
3191
- const c = /* @__PURE__ */ new Map();
3192
- for (const [p, m] of n.associations)
3193
- (p instanceof Fe || p instanceof Ot) && c.set(p, m);
3194
- return u.traverse((p) => {
3195
- const m = n.associations.get(p);
3196
- m != null && c.set(p, m);
3197
- }), c;
3243
+ const c = (u) => {
3244
+ const h = /* @__PURE__ */ new Map();
3245
+ for (const [d, m] of n.associations)
3246
+ (d instanceof Fe || d instanceof Ht) && h.set(d, m);
3247
+ return u.traverse((d) => {
3248
+ const m = n.associations.get(d);
3249
+ m != null && h.set(d, m);
3250
+ }), h;
3198
3251
  };
3199
- return n.associations = h(i), i;
3252
+ return n.associations = c(i), i;
3200
3253
  });
3201
3254
  }
3202
3255
  _createAnimationTracks(e, t, s, n, i) {
3203
3256
  const o = [], a = e.name ? e.name : e.uuid, l = [];
3204
- function h(m) {
3257
+ function c(m) {
3205
3258
  m.morphTargetInfluences && l.push(m.name ? m.name : m.uuid);
3206
3259
  }
3207
- he[i.path] === he.weights ? (h(e), e.isGroup && e.children.forEach(h)) : l.push(a);
3260
+ de[i.path] === de.weights ? (c(e), e.isGroup && e.children.forEach(c)) : l.push(a);
3208
3261
  let u;
3209
- switch (he[i.path]) {
3210
- case he.weights:
3211
- u = Dt;
3262
+ switch (de[i.path]) {
3263
+ case de.weights:
3264
+ u = Ut;
3212
3265
  break;
3213
- case he.rotation:
3214
- u = Nt;
3266
+ case de.rotation:
3267
+ u = zt;
3215
3268
  break;
3216
- case he.translation:
3217
- case he.scale:
3218
- u = Ct;
3269
+ case de.translation:
3270
+ case de.scale:
3271
+ u = Ft;
3219
3272
  break;
3220
3273
  default:
3221
3274
  switch (s.itemSize) {
3222
3275
  case 1:
3223
- u = Dt;
3276
+ u = Ut;
3224
3277
  break;
3225
3278
  case 2:
3226
3279
  case 3:
3227
3280
  default:
3228
- u = Ct;
3281
+ u = Ft;
3229
3282
  break;
3230
3283
  }
3231
3284
  break;
3232
3285
  }
3233
- const c = n.interpolation !== void 0 ? Ci[n.interpolation] : mn, p = this._getArrayFromAccessor(s);
3234
- for (let m = 0, b = l.length; m < b; m++) {
3286
+ const h = n.interpolation !== void 0 ? zi[n.interpolation] : Tn, d = this._getArrayFromAccessor(s);
3287
+ for (let m = 0, w = l.length; m < w; m++) {
3235
3288
  const f = new u(
3236
- l[m] + "." + he[i.path],
3289
+ l[m] + "." + de[i.path],
3237
3290
  t.array,
3238
- p,
3239
- c
3291
+ d,
3292
+ h
3240
3293
  );
3241
3294
  n.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(f), o.push(f);
3242
3295
  }
@@ -3245,7 +3298,7 @@ class Ui {
3245
3298
  _getArrayFromAccessor(e) {
3246
3299
  let t = e.array;
3247
3300
  if (e.normalized) {
3248
- const s = xt(t.constructor), n = new Float32Array(t.length);
3301
+ const s = Lt(t.constructor), n = new Float32Array(t.length);
3249
3302
  for (let i = 0, o = t.length; i < o; i++)
3250
3303
  n[i] = t[i] * s;
3251
3304
  t = n;
@@ -3254,21 +3307,21 @@ class Ui {
3254
3307
  }
3255
3308
  _createCubicSplineTrackInterpolant(e) {
3256
3309
  e.createInterpolant = function(s) {
3257
- const n = this instanceof Nt ? Oi : wn;
3310
+ const n = this instanceof zt ? Ui : An;
3258
3311
  return new n(this.times, this.values, this.getValueSize() / 3, s);
3259
3312
  }, e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = !0;
3260
3313
  }
3261
3314
  }
3262
- function zi(r, e, t) {
3263
- const s = e.attributes, n = new cs();
3315
+ function Wi(r, e, t) {
3316
+ const s = e.attributes, n = new ms();
3264
3317
  if (s.POSITION !== void 0) {
3265
- const a = t.json.accessors[s.POSITION], l = a.min, h = a.max;
3266
- if (l !== void 0 && h !== void 0) {
3318
+ const a = t.json.accessors[s.POSITION], l = a.min, c = a.max;
3319
+ if (l !== void 0 && c !== void 0) {
3267
3320
  if (n.set(
3268
- new M(l[0], l[1], l[2]),
3269
- new M(h[0], h[1], h[2])
3321
+ new S(l[0], l[1], l[2]),
3322
+ new S(c[0], c[1], c[2])
3270
3323
  ), a.normalized) {
3271
- const u = xt(ve[a.componentType]);
3324
+ const u = Lt(Ae[a.componentType]);
3272
3325
  n.min.multiplyScalar(u), n.max.multiplyScalar(u);
3273
3326
  }
3274
3327
  } else {
@@ -3279,14 +3332,14 @@ function zi(r, e, t) {
3279
3332
  return;
3280
3333
  const i = e.targets;
3281
3334
  if (i !== void 0) {
3282
- const a = new M(), l = new M();
3283
- for (let h = 0, u = i.length; h < u; h++) {
3284
- const c = i[h];
3285
- if (c.POSITION !== void 0) {
3286
- const p = t.json.accessors[c.POSITION], m = p.min, b = p.max;
3287
- if (m !== void 0 && b !== void 0) {
3288
- if (l.setX(Math.max(Math.abs(m[0]), Math.abs(b[0]))), l.setY(Math.max(Math.abs(m[1]), Math.abs(b[1]))), l.setZ(Math.max(Math.abs(m[2]), Math.abs(b[2]))), p.normalized) {
3289
- const f = xt(ve[p.componentType]);
3335
+ const a = new S(), l = new S();
3336
+ for (let c = 0, u = i.length; c < u; c++) {
3337
+ const h = i[c];
3338
+ if (h.POSITION !== void 0) {
3339
+ const d = t.json.accessors[h.POSITION], m = d.min, w = d.max;
3340
+ if (m !== void 0 && w !== void 0) {
3341
+ if (l.setX(Math.max(Math.abs(m[0]), Math.abs(w[0]))), l.setY(Math.max(Math.abs(m[1]), Math.abs(w[1]))), l.setZ(Math.max(Math.abs(m[2]), Math.abs(w[2]))), d.normalized) {
3342
+ const f = Lt(Ae[d.componentType]);
3290
3343
  l.multiplyScalar(f);
3291
3344
  }
3292
3345
  a.max(l);
@@ -3297,10 +3350,10 @@ function zi(r, e, t) {
3297
3350
  n.expandByVector(a);
3298
3351
  }
3299
3352
  r.boundingBox = n;
3300
- const o = new hs();
3353
+ const o = new gs();
3301
3354
  n.getCenter(o.center), o.radius = n.min.distanceTo(n.max) / 2, r.boundingSphere = o;
3302
3355
  }
3303
- function tn(r, e, t) {
3356
+ function an(r, e, t) {
3304
3357
  const s = e.attributes, n = [];
3305
3358
  function i(o, a) {
3306
3359
  return t.getDependency("accessor", o).then(function(l) {
@@ -3308,7 +3361,7 @@ function tn(r, e, t) {
3308
3361
  });
3309
3362
  }
3310
3363
  for (const o in s) {
3311
- const a = Tt[o] || o.toLowerCase();
3364
+ const a = Pt[o] || o.toLowerCase();
3312
3365
  a in r.attributes || n.push(i(s[o], a));
3313
3366
  }
3314
3367
  if (e.indices !== void 0 && !r.index) {
@@ -3317,26 +3370,335 @@ function tn(r, e, t) {
3317
3370
  });
3318
3371
  n.push(o);
3319
3372
  }
3320
- return kt.workingColorSpace !== le && "COLOR_0" in s && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${kt.workingColorSpace}" not supported.`), ne(r, e), zi(r, e, t), Promise.all(n).then(function() {
3321
- return e.targets !== void 0 ? Ni(r, e.targets, t) : r;
3373
+ return At.workingColorSpace !== ie && "COLOR_0" in s && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${At.workingColorSpace}" not supported.`), se(r, e), Wi(r, e, t), Promise.all(n).then(function() {
3374
+ return e.targets !== void 0 ? Xi(r, e.targets, t) : r;
3322
3375
  });
3323
3376
  }
3324
- function Gi() {
3325
- const r = new F.BoxGeometry(1, 1, 1), e = new F.MeshStandardMaterial({ color: 43775 }), t = new F.Mesh(r, e);
3326
- return t.position.y = 0.5, t.userData.isMovable = !0, t.name = "正方体", At(t, !0), t;
3377
+ const xt = /* @__PURE__ */ new WeakMap();
3378
+ class Qi extends It {
3379
+ /**
3380
+ * Constructs a new Draco loader.
3381
+ *
3382
+ * @param {LoadingManager} [manager] - The loading manager.
3383
+ */
3384
+ constructor(e) {
3385
+ super(e), this.decoderPath = "", this.decoderConfig = {}, this.decoderBinary = null, this.decoderPending = null, this.workerLimit = 4, this.workerPool = [], this.workerNextTaskID = 1, this.workerSourceURL = "", this.defaultAttributeIDs = {
3386
+ position: "POSITION",
3387
+ normal: "NORMAL",
3388
+ color: "COLOR",
3389
+ uv: "TEX_COORD"
3390
+ }, this.defaultAttributeTypes = {
3391
+ position: "Float32Array",
3392
+ normal: "Float32Array",
3393
+ color: "Float32Array",
3394
+ uv: "Float32Array"
3395
+ };
3396
+ }
3397
+ /**
3398
+ * Provides configuration for the decoder libraries. Configuration cannot be changed after decoding begins.
3399
+ *
3400
+ * @param {string} path - The decoder path.
3401
+ * @return {DRACOLoader} A reference to this loader.
3402
+ */
3403
+ setDecoderPath(e) {
3404
+ return this.decoderPath = e, this;
3405
+ }
3406
+ /**
3407
+ * Provides configuration for the decoder libraries. Configuration cannot be changed after decoding begins.
3408
+ *
3409
+ * @param {{type:('js'|'wasm')}} config - The decoder config.
3410
+ * @return {DRACOLoader} A reference to this loader.
3411
+ */
3412
+ setDecoderConfig(e) {
3413
+ return this.decoderConfig = e, this;
3414
+ }
3415
+ /**
3416
+ * Sets the maximum number of Web Workers to be used during decoding.
3417
+ * A lower limit may be preferable if workers are also for other tasks in the application.
3418
+ *
3419
+ * @param {number} workerLimit - The worker limit.
3420
+ * @return {DRACOLoader} A reference to this loader.
3421
+ */
3422
+ setWorkerLimit(e) {
3423
+ return this.workerLimit = e, this;
3424
+ }
3425
+ /**
3426
+ * Starts loading from the given URL and passes the loaded Draco asset
3427
+ * to the `onLoad()` callback.
3428
+ *
3429
+ * @param {string} url - The path/URL of the file to be loaded. This can also be a data URI.
3430
+ * @param {function(BufferGeometry)} onLoad - Executed when the loading process has been finished.
3431
+ * @param {onProgressCallback} onProgress - Executed while the loading is in progress.
3432
+ * @param {onErrorCallback} onError - Executed when errors occur.
3433
+ */
3434
+ load(e, t, s, n) {
3435
+ const i = new Ke(this.manager);
3436
+ i.setPath(this.path), i.setResponseType("arraybuffer"), i.setRequestHeader(this.requestHeader), i.setWithCredentials(this.withCredentials), i.load(e, (o) => {
3437
+ this.parse(o, t, n);
3438
+ }, s, n);
3439
+ }
3440
+ /**
3441
+ * Parses the given Draco data.
3442
+ *
3443
+ * @param {ArrayBuffer} buffer - The raw Draco data as an array buffer.
3444
+ * @param {function(BufferGeometry)} onLoad - Executed when the loading/parsing process has been finished.
3445
+ * @param {onErrorCallback} onError - Executed when errors occur.
3446
+ */
3447
+ parse(e, t, s = () => {
3448
+ }) {
3449
+ this.decodeDracoFile(e, t, null, null, ce, s).catch(s);
3450
+ }
3451
+ //
3452
+ decodeDracoFile(e, t, s, n, i = ie, o = () => {
3453
+ }) {
3454
+ const a = {
3455
+ attributeIDs: s || this.defaultAttributeIDs,
3456
+ attributeTypes: n || this.defaultAttributeTypes,
3457
+ useUniqueIDs: !!s,
3458
+ vertexColorSpace: i
3459
+ };
3460
+ return this.decodeGeometry(e, a).then(t).catch(o);
3461
+ }
3462
+ decodeGeometry(e, t) {
3463
+ const s = JSON.stringify(t);
3464
+ if (xt.has(e)) {
3465
+ const l = xt.get(e);
3466
+ if (l.key === s)
3467
+ return l.promise;
3468
+ if (e.byteLength === 0)
3469
+ throw new Error(
3470
+ "THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred."
3471
+ );
3472
+ }
3473
+ let n;
3474
+ const i = this.workerNextTaskID++, o = e.byteLength, a = this._getWorker(i, o).then((l) => (n = l, new Promise((c, u) => {
3475
+ n._callbacks[i] = { resolve: c, reject: u }, n.postMessage({ type: "decode", id: i, taskConfig: t, buffer: e }, [e]);
3476
+ }))).then((l) => this._createGeometry(l.geometry));
3477
+ return a.catch(() => !0).then(() => {
3478
+ n && i && this._releaseTask(n, i);
3479
+ }), xt.set(e, {
3480
+ key: s,
3481
+ promise: a
3482
+ }), a;
3483
+ }
3484
+ _createGeometry(e) {
3485
+ const t = new Re();
3486
+ e.index && t.setIndex(new ze(e.index.array, 1));
3487
+ for (let s = 0; s < e.attributes.length; s++) {
3488
+ const { name: n, array: i, itemSize: o, stride: a, vertexColorSpace: l } = e.attributes[s];
3489
+ let c;
3490
+ if (o === a)
3491
+ c = new ze(i, o);
3492
+ else {
3493
+ const u = new gn(i, a);
3494
+ c = new yn(u, o, 0);
3495
+ }
3496
+ n === "color" && (this._assignVertexColorSpace(c, l), c.normalized = !(i instanceof Float32Array)), t.setAttribute(n, c);
3497
+ }
3498
+ return t;
3499
+ }
3500
+ _assignVertexColorSpace(e, t) {
3501
+ if (t !== ce) return;
3502
+ const s = new he();
3503
+ for (let n = 0, i = e.count; n < i; n++)
3504
+ s.fromBufferAttribute(e, n), At.colorSpaceToWorking(s, ce), e.setXYZ(n, s.r, s.g, s.b);
3505
+ }
3506
+ _loadLibrary(e, t) {
3507
+ const s = new Ke(this.manager);
3508
+ return s.setPath(this.decoderPath), s.setResponseType(t), s.setWithCredentials(this.withCredentials), new Promise((n, i) => {
3509
+ s.load(e, n, void 0, i);
3510
+ });
3511
+ }
3512
+ preload() {
3513
+ return this._initDecoder(), this;
3514
+ }
3515
+ _initDecoder() {
3516
+ if (this.decoderPending) return this.decoderPending;
3517
+ const e = typeof WebAssembly != "object" || this.decoderConfig.type === "js", t = [];
3518
+ return e ? t.push(this._loadLibrary("draco_decoder.js", "text")) : (t.push(this._loadLibrary("draco_wasm_wrapper.js", "text")), t.push(this._loadLibrary("draco_decoder.wasm", "arraybuffer"))), this.decoderPending = Promise.all(t).then((s) => {
3519
+ const n = s[0];
3520
+ e || (this.decoderConfig.wasmBinary = s[1]);
3521
+ const i = qi.toString(), o = [
3522
+ "/* draco decoder */",
3523
+ n,
3524
+ "",
3525
+ "/* worker */",
3526
+ i.substring(i.indexOf("{") + 1, i.lastIndexOf("}"))
3527
+ ].join(`
3528
+ `);
3529
+ this.workerSourceURL = URL.createObjectURL(new Blob([o]));
3530
+ }), this.decoderPending;
3531
+ }
3532
+ _getWorker(e, t) {
3533
+ return this._initDecoder().then(() => {
3534
+ if (this.workerPool.length < this.workerLimit) {
3535
+ const n = new Worker(this.workerSourceURL);
3536
+ n._callbacks = {}, n._taskCosts = {}, n._taskLoad = 0, n.postMessage({ type: "init", decoderConfig: this.decoderConfig }), n.onmessage = function(i) {
3537
+ const o = i.data;
3538
+ switch (o.type) {
3539
+ case "decode":
3540
+ n._callbacks[o.id].resolve(o);
3541
+ break;
3542
+ case "error":
3543
+ n._callbacks[o.id].reject(o);
3544
+ break;
3545
+ default:
3546
+ console.error('THREE.DRACOLoader: Unexpected message, "' + o.type + '"');
3547
+ }
3548
+ }, this.workerPool.push(n);
3549
+ } else
3550
+ this.workerPool.sort(function(n, i) {
3551
+ return n._taskLoad > i._taskLoad ? -1 : 1;
3552
+ });
3553
+ const s = this.workerPool[this.workerPool.length - 1];
3554
+ return s._taskCosts[e] = t, s._taskLoad += t, s;
3555
+ });
3556
+ }
3557
+ _releaseTask(e, t) {
3558
+ e._taskLoad -= e._taskCosts[t], delete e._callbacks[t], delete e._taskCosts[t];
3559
+ }
3560
+ debug() {
3561
+ console.log("Task load: ", this.workerPool.map((e) => e._taskLoad));
3562
+ }
3563
+ dispose() {
3564
+ for (let e = 0; e < this.workerPool.length; ++e)
3565
+ this.workerPool[e].terminate();
3566
+ return this.workerPool.length = 0, this.workerSourceURL !== "" && URL.revokeObjectURL(this.workerSourceURL), this;
3567
+ }
3568
+ }
3569
+ function qi() {
3570
+ let r, e;
3571
+ onmessage = function(o) {
3572
+ const a = o.data;
3573
+ switch (a.type) {
3574
+ case "init":
3575
+ r = a.decoderConfig, e = new Promise(function(u) {
3576
+ r.onModuleLoaded = function(h) {
3577
+ u({ draco: h });
3578
+ }, DracoDecoderModule(r);
3579
+ });
3580
+ break;
3581
+ case "decode":
3582
+ const l = a.buffer, c = a.taskConfig;
3583
+ e.then((u) => {
3584
+ const h = u.draco, d = new h.Decoder();
3585
+ try {
3586
+ const m = t(h, d, new Int8Array(l), c), w = m.attributes.map((f) => f.array.buffer);
3587
+ m.index && w.push(m.index.array.buffer), self.postMessage({ type: "decode", id: a.id, geometry: m }, w);
3588
+ } catch (m) {
3589
+ console.error(m), self.postMessage({ type: "error", id: a.id, error: m.message });
3590
+ } finally {
3591
+ h.destroy(d);
3592
+ }
3593
+ });
3594
+ break;
3595
+ }
3596
+ };
3597
+ function t(o, a, l, c) {
3598
+ const u = c.attributeIDs, h = c.attributeTypes;
3599
+ let d, m;
3600
+ const w = a.GetEncodedGeometryType(l);
3601
+ if (w === o.TRIANGULAR_MESH)
3602
+ d = new o.Mesh(), m = a.DecodeArrayToMesh(l, l.byteLength, d);
3603
+ else if (w === o.POINT_CLOUD)
3604
+ d = new o.PointCloud(), m = a.DecodeArrayToPointCloud(l, l.byteLength, d);
3605
+ else
3606
+ throw new Error("THREE.DRACOLoader: Unexpected geometry type.");
3607
+ if (!m.ok() || d.ptr === 0)
3608
+ throw new Error("THREE.DRACOLoader: Decoding failed: " + m.error_msg());
3609
+ const f = { index: null, attributes: [] };
3610
+ for (const y in u) {
3611
+ const p = self[h[y]];
3612
+ let b, T;
3613
+ if (c.useUniqueIDs)
3614
+ T = u[y], b = a.GetAttributeByUniqueId(d, T);
3615
+ else {
3616
+ if (T = a.GetAttributeId(d, o[u[y]]), T === -1) continue;
3617
+ b = a.GetAttribute(d, T);
3618
+ }
3619
+ const M = n(o, a, d, y, p, b);
3620
+ y === "color" && (M.vertexColorSpace = c.vertexColorSpace), f.attributes.push(M);
3621
+ }
3622
+ return w === o.TRIANGULAR_MESH && (f.index = s(o, a, d)), o.destroy(d), f;
3623
+ }
3624
+ function s(o, a, l) {
3625
+ const u = l.num_faces() * 3, h = u * 4, d = o._malloc(h);
3626
+ a.GetTrianglesUInt32Array(l, h, d);
3627
+ const m = new Uint32Array(o.HEAPF32.buffer, d, u).slice();
3628
+ return o._free(d), { array: m, itemSize: 1 };
3629
+ }
3630
+ function n(o, a, l, c, u, h) {
3631
+ const d = l.num_points(), m = h.num_components(), w = i(o, u), f = m * u.BYTES_PER_ELEMENT, y = Math.ceil(f / 4) * 4, p = y / u.BYTES_PER_ELEMENT, b = d * f, T = d * y, M = o._malloc(b);
3632
+ a.GetAttributeDataArrayForAllPoints(l, h, w, b, M);
3633
+ const R = new u(o.HEAPF32.buffer, M, b / u.BYTES_PER_ELEMENT);
3634
+ let v;
3635
+ if (f === y)
3636
+ v = R.slice();
3637
+ else {
3638
+ v = new u(T / u.BYTES_PER_ELEMENT);
3639
+ let I = 0;
3640
+ for (let V = 0, W = R.length; V < W; V++) {
3641
+ for (let Q = 0; Q < m; Q++)
3642
+ v[I + Q] = R[V * m + Q];
3643
+ I += p;
3644
+ }
3645
+ }
3646
+ return o._free(M), {
3647
+ name: c,
3648
+ count: d,
3649
+ itemSize: m,
3650
+ array: v,
3651
+ stride: p
3652
+ };
3653
+ }
3654
+ function i(o, a) {
3655
+ switch (a) {
3656
+ case Float32Array:
3657
+ return o.DT_FLOAT32;
3658
+ case Int8Array:
3659
+ return o.DT_INT8;
3660
+ case Int16Array:
3661
+ return o.DT_INT16;
3662
+ case Int32Array:
3663
+ return o.DT_INT32;
3664
+ case Uint8Array:
3665
+ return o.DT_UINT8;
3666
+ case Uint16Array:
3667
+ return o.DT_UINT16;
3668
+ case Uint32Array:
3669
+ return o.DT_UINT32;
3670
+ }
3671
+ }
3672
+ }
3673
+ function $i() {
3674
+ const r = new H.BoxGeometry(1, 1, 1), e = new H.MeshStandardMaterial({ color: 43775 }), t = new H.Mesh(r, e);
3675
+ return t.position.y = 0.5, t.userData.isMovable = !0, t.name = "正方体", Ve(t, !0), t;
3327
3676
  }
3328
- function Xi() {
3329
- const r = new F.SphereGeometry(0.6, 32, 32), e = new F.MeshStandardMaterial({ color: 16746496 }), t = new F.Mesh(r, e);
3330
- return t.position.y = 0.6, t.userData.isMovable = !0, t.name = "球体", At(t, !0), t;
3677
+ function Ji() {
3678
+ const r = new H.SphereGeometry(0.6, 32, 32), e = new H.MeshStandardMaterial({ color: 16746496 }), t = new H.Mesh(r, e);
3679
+ return t.position.y = 0.6, t.userData.isMovable = !0, t.name = "球体", Ve(t, !0), t;
3331
3680
  }
3332
- function Yi(r) {
3681
+ function eo() {
3682
+ const r = new H.DirectionalLight(16777215);
3683
+ r.position.set(5, 5, 5), r.name = "平行光", r.userData.isMovable = !0, r.target.position.set(0, 0, 0);
3684
+ const e = new H.DirectionalLightHelper(r, 1);
3685
+ e.lightPlane.userData.name = "平行光辅助", e.userData.type = "lightHelper", r.userData.helper = e, Ve(e), Ve(r, !0);
3686
+ }
3687
+ function to(r) {
3333
3688
  return new Promise((e, t) => {
3334
3689
  var o;
3335
3690
  const s = (o = r.name.split(".").pop()) == null ? void 0 : o.toLowerCase(), n = URL.createObjectURL(r);
3336
3691
  let i;
3337
- if (s === "obj") i = new ri();
3338
- else if (s === "gltf" || s === "glb") i = new li();
3339
- else {
3692
+ if (s === "obj")
3693
+ i = new fi();
3694
+ else if (s === "gltf" || s === "glb") {
3695
+ const a = new Qi();
3696
+ a.setDecoderPath(
3697
+ "https://www.gstatic.com/draco/versioned/decoders/1.5.7/"
3698
+ );
3699
+ const l = new gi();
3700
+ l.setDRACOLoader(a), i = l;
3701
+ } else {
3340
3702
  t(new Error("不支持的文件格式,请使用 .obj, .gltf, .glb"));
3341
3703
  return;
3342
3704
  }
@@ -3344,35 +3706,38 @@ function Yi(r) {
3344
3706
  n,
3345
3707
  (a) => {
3346
3708
  const l = s === "gltf" || s === "glb" ? a.scene : a;
3347
- l.traverse((c) => {
3348
- var p;
3349
- c.userData.isMovable = !0, c.name || (c.name = c.type), c.type === "Mesh" && (c.frustumCulled = !0, (p = c.geometry) == null || p.computeVertexNormals());
3709
+ l.traverse((h) => {
3710
+ var d;
3711
+ h.userData.isMovable = !0, h.name || (h.name = h.type), h.type === "Mesh" && (h.frustumCulled = !0, (d = h.geometry) == null || d.computeVertexNormals());
3350
3712
  });
3351
- const u = new F.Box3().setFromObject(l).getCenter(new F.Vector3());
3352
- l.position.sub(u), At(l, !0), e(l);
3713
+ const u = new H.Box3().setFromObject(l).getCenter(new H.Vector3());
3714
+ l.position.sub(u), Ve(l, !0), e(l);
3353
3715
  },
3354
3716
  void 0,
3355
3717
  (a) => t(a)
3356
3718
  );
3357
3719
  });
3358
3720
  }
3359
- function Bi(r) {
3721
+ function no(r) {
3360
3722
  switch (r) {
3361
3723
  case "box":
3362
- Gi();
3724
+ $i();
3363
3725
  break;
3364
3726
  case "sphere":
3365
- Xi();
3727
+ Ji();
3728
+ break;
3729
+ case "directionalLight":
3730
+ eo();
3366
3731
  break;
3367
3732
  }
3368
3733
  }
3369
- const Ki = {
3734
+ const so = {
3370
3735
  key: 1,
3371
3736
  class: "toggle-placeholder"
3372
- }, Vi = { class: "tree-icon" }, Zi = { class: "tree-name" }, Qi = {
3737
+ }, io = { class: "tree-icon" }, oo = { class: "tree-name" }, ro = {
3373
3738
  key: 0,
3374
3739
  class: "tree-children"
3375
- }, qi = /* @__PURE__ */ Xe({
3740
+ }, ao = /* @__PURE__ */ Ze({
3376
3741
  __name: "TreeItem",
3377
3742
  props: {
3378
3743
  node: {},
@@ -3381,15 +3746,15 @@ const Ki = {
3381
3746
  },
3382
3747
  emits: ["select", "delete"],
3383
3748
  setup(r, { emit: e }) {
3384
- const t = r, s = e, n = G(null), { expandedSet: i, toggleExpand: o } = xn("treeExpand"), a = Qe(() => i.value.has(t.node.uuid)), l = Qe(() => (t.version, t.node.children.some((f) => f.userData.isMovable === !0))), h = Qe(() => (t.version, t.node.children.filter(
3749
+ const t = r, s = e, n = U(null), { expandedSet: i, toggleExpand: o } = Pn("treeExpand"), a = et(() => i.value.has(t.node.uuid)), l = et(() => (t.version, t.node.children.some((f) => f.userData.isMovable === !0))), c = et(() => (t.version, t.node.children.filter(
3385
3750
  (f) => f.userData.isMovable === !0
3386
- ))), u = Qe(
3751
+ ))), u = et(
3387
3752
  () => {
3388
3753
  var f;
3389
3754
  return ((f = t.selectedObject) == null ? void 0 : f.uuid) === t.node.uuid;
3390
3755
  }
3391
3756
  );
3392
- En(
3757
+ Ln(
3393
3758
  () => {
3394
3759
  u.value && n.value && n.value.scrollIntoView({
3395
3760
  block: "nearest",
@@ -3400,55 +3765,55 @@ const Ki = {
3400
3765
  },
3401
3766
  { flush: "post" }
3402
3767
  );
3403
- const c = (f) => {
3768
+ const h = (f) => {
3404
3769
  f.stopPropagation(), s("select", t.node);
3405
- }, p = (f) => {
3770
+ }, d = (f) => {
3406
3771
  f.stopPropagation(), s("delete", t.node);
3407
- }, m = (f) => f.type === "Mesh" || f.type === "Sprite" ? "🟦" : f.type === "Light" ? "💡" : "📦", b = (f) => f.name || `${f.type} (${f.id})`;
3772
+ }, m = (f) => f.type === "Mesh" || f.type === "Sprite" ? "🟦" : f.type === "Light" ? "💡" : "📦", w = (f) => f.name || `${f.type} (${f.id})`;
3408
3773
  return (f, y) => {
3409
- const d = Mn("TreeItem", !0);
3410
- return C(), U("div", {
3774
+ const p = In("TreeItem", !0);
3775
+ return k(), z("div", {
3411
3776
  class: "tree-node",
3412
3777
  ref_key: "nodeRef",
3413
3778
  ref: n
3414
3779
  }, [
3415
3780
  g("div", {
3416
- class: Ue(["tree-item", { selected: u.value }]),
3417
- onClick: c
3781
+ class: Be(["tree-item", { selected: u.value }]),
3782
+ onClick: h
3418
3783
  }, [
3419
- l.value ? (C(), U("span", {
3784
+ l.value ? (k(), z("span", {
3420
3785
  key: 0,
3421
3786
  class: "toggle-icon",
3422
- onClick: y[0] || (y[0] = Lt((_) => vn(o)(r.node.uuid), ["stop"]))
3423
- }, Ee(a.value ? "▼" : "▶"), 1)) : (C(), U("span", Ki)),
3424
- g("span", Vi, Ee(m(r.node)), 1),
3425
- g("span", Zi, Ee(b(r.node)), 1),
3787
+ onClick: y[0] || (y[0] = Nt((b) => Cn(o)(r.node.uuid), ["stop"]))
3788
+ }, ve(a.value ? "▼" : "▶"), 1)) : (k(), z("span", so)),
3789
+ g("span", io, ve(m(r.node)), 1),
3790
+ g("span", oo, ve(w(r.node)), 1),
3426
3791
  g("button", {
3427
3792
  class: "tree-delete",
3428
- onClick: Lt(p, ["stop"])
3793
+ onClick: Nt(d, ["stop"])
3429
3794
  }, "×")
3430
3795
  ], 2),
3431
- a.value && l.value ? (C(), U("div", Qi, [
3432
- (C(!0), U(nn, null, sn(h.value, (_) => (C(), ke(d, {
3433
- key: _.uuid,
3434
- node: _,
3796
+ a.value && l.value ? (k(), z("div", ro, [
3797
+ (k(!0), z(ln, null, cn(c.value, (b) => (k(), je(p, {
3798
+ key: b.uuid,
3799
+ node: b,
3435
3800
  "selected-object": r.selectedObject,
3436
3801
  version: r.version,
3437
- onSelect: y[1] || (y[1] = (x) => s("select", x)),
3438
- onDelete: y[2] || (y[2] = (x) => s("delete", x))
3802
+ onSelect: y[1] || (y[1] = (T) => s("select", T)),
3803
+ onDelete: y[2] || (y[2] = (T) => s("delete", T))
3439
3804
  }, null, 8, ["node", "selected-object", "version"]))), 128))
3440
- ])) : ae("", !0)
3805
+ ])) : le("", !0)
3441
3806
  ], 512);
3442
3807
  };
3443
3808
  }
3444
- }), Ye = (r, e) => {
3809
+ }), We = (r, e) => {
3445
3810
  const t = r.__vccOpts || r;
3446
3811
  for (const [s, n] of e)
3447
3812
  t[s] = n;
3448
3813
  return t;
3449
- }, Wi = /* @__PURE__ */ Ye(qi, [["__scopeId", "data-v-5ad9c842"]]);
3450
- function $i(r) {
3451
- const e = G(/* @__PURE__ */ new Set()), t = (n) => {
3814
+ }, lo = /* @__PURE__ */ We(ao, [["__scopeId", "data-v-5ad9c842"]]);
3815
+ function co(r) {
3816
+ const e = U(/* @__PURE__ */ new Set()), t = (n) => {
3452
3817
  const i = new Set(e.value);
3453
3818
  i.has(n) ? i.delete(n) : i.add(n), e.value = i;
3454
3819
  }, s = (n) => {
@@ -3459,7 +3824,7 @@ function $i(r) {
3459
3824
  i.add(o.uuid), o = o.parent;
3460
3825
  e.value = i;
3461
3826
  };
3462
- return on(
3827
+ return hn(
3463
3828
  r,
3464
3829
  (n) => {
3465
3830
  n && s(n);
@@ -3467,28 +3832,28 @@ function $i(r) {
3467
3832
  { immediate: !0 }
3468
3833
  ), { expandedSet: e, toggleExpand: t };
3469
3834
  }
3470
- const Ji = {
3835
+ const ho = {
3471
3836
  key: 0,
3472
3837
  class: "property-panel"
3473
- }, eo = { class: "property-group tree-group" }, to = { class: "tree-container" }, no = {
3838
+ }, uo = { class: "property-group tree-group" }, po = { class: "tree-container" }, fo = {
3474
3839
  key: 0,
3475
3840
  class: "tree-empty"
3476
- }, so = {
3841
+ }, mo = {
3477
3842
  key: 0,
3478
3843
  class: "tabs"
3479
- }, io = {
3844
+ }, go = {
3480
3845
  key: 1,
3481
3846
  class: "tab-content"
3482
- }, oo = { class: "property-group" }, ro = { class: "row" }, ao = { class: "property-group" }, lo = { class: "row" }, co = { class: "property-group" }, ho = { class: "row" }, uo = {
3847
+ }, yo = { class: "property-group" }, _o = { class: "row" }, bo = { class: "property-group" }, wo = { class: "row" }, To = { class: "property-group" }, xo = { class: "row" }, Eo = {
3483
3848
  key: 0,
3484
3849
  class: "property-group material-group"
3485
- }, po = { class: "slider-row" }, fo = { class: "slider-value" }, mo = { class: "slider-row" }, go = { class: "slider-value" }, yo = { class: "slider-row" }, _o = { class: "slider-value" }, bo = {
3850
+ }, Mo = { class: "slider-row" }, vo = { class: "slider-value" }, So = { class: "slider-row" }, Ao = { class: "slider-value" }, Ro = { class: "slider-row" }, Po = { class: "slider-value" }, Lo = {
3486
3851
  key: 0,
3487
3852
  class: "material-hint"
3488
- }, wo = {
3853
+ }, Io = {
3489
3854
  key: 1,
3490
3855
  class: "property-panel empty"
3491
- }, To = /* @__PURE__ */ Xe({
3856
+ }, Co = /* @__PURE__ */ Ze({
3492
3857
  __name: "PropertyPanel",
3493
3858
  props: {
3494
3859
  transform: {},
@@ -3497,24 +3862,24 @@ const Ji = {
3497
3862
  },
3498
3863
  emits: ["propertyChange", "treeSelect", "treeDelete"],
3499
3864
  setup(r, { emit: e }) {
3500
- const t = r, s = e, n = () => s("propertyChange"), i = G("transform"), o = G(0), a = Sn(t, "selectedObject"), { expandedSet: l, toggleExpand: h } = $i(a);
3501
- An("treeExpand", { expandedSet: l, toggleExpand: h });
3865
+ const t = r, s = e, n = () => s("propertyChange"), i = U("transform"), o = U(0), a = Dn(t, "selectedObject"), { expandedSet: l, toggleExpand: c } = co(a);
3866
+ On("treeExpand", { expandedSet: l, toggleExpand: c });
3502
3867
  const u = (y) => {
3503
3868
  o.value++, s("treeDelete", y);
3504
- }, c = rn({
3869
+ }, h = un({
3505
3870
  metalness: 0,
3506
3871
  roughness: 0.5,
3507
3872
  opacity: 1
3508
- }), p = G(!1);
3873
+ }), d = U(!1);
3509
3874
  function m(y) {
3510
- let d = null;
3511
- return y.traverse((_) => {
3512
- if (_.type === "Mesh" && !d) {
3513
- const x = _, S = Array.isArray(x.material) ? x.material : [x.material];
3514
- for (const R of S)
3875
+ let p = null;
3876
+ return y.traverse((b) => {
3877
+ if (b.type === "Mesh" && !p) {
3878
+ const T = b, M = Array.isArray(T.material) ? T.material : [T.material];
3879
+ for (const R of M)
3515
3880
  if (R && (R.type === "MeshStandardMaterial" || R.type === "MeshPhongMaterial")) {
3516
3881
  const v = R;
3517
- d = {
3882
+ p = {
3518
3883
  metalness: v.metalness ?? 0,
3519
3884
  roughness: v.roughness ?? 0.5,
3520
3885
  opacity: R.opacity ?? 1
@@ -3522,110 +3887,110 @@ const Ji = {
3522
3887
  break;
3523
3888
  }
3524
3889
  }
3525
- }), d;
3890
+ }), p;
3526
3891
  }
3527
- function b(y, d) {
3528
- let _ = !1;
3529
- return y.traverse((x) => {
3530
- if (x.type === "Mesh") {
3531
- const S = x, R = Array.isArray(S.material) ? S.material : [S.material];
3892
+ function w(y, p) {
3893
+ let b = !1;
3894
+ return y.traverse((T) => {
3895
+ if (T.type === "Mesh") {
3896
+ const M = T, R = Array.isArray(M.material) ? M.material : [M.material];
3532
3897
  for (const v of R)
3533
- v && (v.type === "MeshStandardMaterial" || v.type === "MeshPhongMaterial") && (d.metalness !== void 0 && (v.metalness = d.metalness), d.roughness !== void 0 && (v.roughness = d.roughness), d.opacity !== void 0 && (v.opacity = d.opacity, v.transparent = d.opacity < 1), v.needsUpdate = !0, _ = !0);
3898
+ v && (v.type === "MeshStandardMaterial" || v.type === "MeshPhongMaterial") && (p.metalness !== void 0 && (v.metalness = p.metalness), p.roughness !== void 0 && (v.roughness = p.roughness), p.opacity !== void 0 && (v.opacity = p.opacity, v.transparent = p.opacity < 1), v.needsUpdate = !0, b = !0);
3534
3899
  }
3535
- }), _;
3900
+ }), b;
3536
3901
  }
3537
3902
  function f() {
3538
3903
  if (t.selectedObject) {
3539
- const y = b(t.selectedObject, {
3540
- metalness: c.metalness,
3541
- roughness: c.roughness,
3542
- opacity: c.opacity
3904
+ const y = w(t.selectedObject, {
3905
+ metalness: h.metalness,
3906
+ roughness: h.roughness,
3907
+ opacity: h.opacity
3543
3908
  });
3544
- p.value = y;
3909
+ d.value = y;
3545
3910
  }
3546
3911
  }
3547
- return on(
3912
+ return hn(
3548
3913
  () => t.selectedObject,
3549
3914
  (y) => {
3550
3915
  if (y) {
3551
- const d = m(y);
3552
- d ? (c.metalness = d.metalness, c.roughness = d.roughness, c.opacity = d.opacity, p.value = !0) : (c.metalness = 0, c.roughness = 0.5, c.opacity = 1, p.value = !1);
3916
+ const p = m(y);
3917
+ p ? (h.metalness = p.metalness, h.roughness = p.roughness, h.opacity = p.opacity, d.value = !0) : (h.metalness = 0, h.roughness = 0.5, h.opacity = 1, d.value = !1);
3553
3918
  } else
3554
- c.metalness = 0, c.roughness = 0.5, c.opacity = 1, p.value = !1;
3919
+ h.metalness = 0, h.roughness = 0.5, h.opacity = 1, d.value = !1;
3555
3920
  },
3556
3921
  { immediate: !0 }
3557
- ), (y, d) => r.transform ? (C(), U("div", Ji, [
3558
- d[32] || (d[32] = g("h3", null, "属性面板", -1)),
3559
- g("div", eo, [
3560
- d[15] || (d[15] = g("label", null, "场景物体", -1)),
3561
- g("div", to, [
3562
- (C(!0), U(nn, null, sn(r.treeData, (_) => (C(), ke(Wi, {
3563
- key: _.uuid,
3564
- node: _,
3922
+ ), (y, p) => r.transform ? (k(), z("div", ho, [
3923
+ p[32] || (p[32] = g("h3", null, "属性面板", -1)),
3924
+ g("div", uo, [
3925
+ p[15] || (p[15] = g("label", null, "场景物体", -1)),
3926
+ g("div", po, [
3927
+ (k(!0), z(ln, null, cn(r.treeData, (b) => (k(), je(lo, {
3928
+ key: b.uuid,
3929
+ node: b,
3565
3930
  "selected-object": r.selectedObject,
3566
3931
  version: o.value,
3567
- onSelect: d[0] || (d[0] = (x) => s("treeSelect", x)),
3932
+ onSelect: p[0] || (p[0] = (T) => s("treeSelect", T)),
3568
3933
  onDelete: u
3569
3934
  }, null, 8, ["node", "selected-object", "version"]))), 128)),
3570
- r.treeData.length === 0 ? (C(), U("div", no, "暂无物体")) : ae("", !0)
3935
+ r.treeData.length === 0 ? (k(), z("div", fo, "暂无物体")) : le("", !0)
3571
3936
  ])
3572
3937
  ]),
3573
- d[33] || (d[33] = g("div", { class: "property-group" }, [
3938
+ p[33] || (p[33] = g("div", { class: "property-group" }, [
3574
3939
  g("label", null, "全局属性"),
3575
3940
  g("div", { class: "row" })
3576
3941
  ], -1)),
3577
- r.selectedObject ? (C(), U("div", so, [
3942
+ r.selectedObject ? (k(), z("div", mo, [
3578
3943
  g("button", {
3579
- class: Ue(["tab-btn", { active: i.value === "transform" }]),
3580
- onClick: d[1] || (d[1] = (_) => i.value = "transform")
3944
+ class: Be(["tab-btn", { active: i.value === "transform" }]),
3945
+ onClick: p[1] || (p[1] = (b) => i.value = "transform")
3581
3946
  }, " 🔄 变换 ", 2),
3582
3947
  g("button", {
3583
- class: Ue(["tab-btn", { active: i.value === "info" }]),
3584
- onClick: d[2] || (d[2] = (_) => i.value = "info")
3948
+ class: Be(["tab-btn", { active: i.value === "info" }]),
3949
+ onClick: p[2] || (p[2] = (b) => i.value = "info")
3585
3950
  }, " ℹ️ 信息 ", 2)
3586
- ])) : ae("", !0),
3587
- r.selectedObject ? (C(), U("div", io, [
3588
- N(g("div", null, [
3589
- g("div", oo, [
3590
- d[19] || (d[19] = g("label", null, "位置", -1)),
3591
- g("div", ro, [
3592
- d[16] || (d[16] = g("span", null, "X:", -1)),
3593
- N(g("input", {
3951
+ ])) : le("", !0),
3952
+ r.selectedObject ? (k(), z("div", go, [
3953
+ O(g("div", null, [
3954
+ g("div", yo, [
3955
+ p[19] || (p[19] = g("label", null, "位置", -1)),
3956
+ g("div", _o, [
3957
+ p[16] || (p[16] = g("span", null, "X:", -1)),
3958
+ O(g("input", {
3594
3959
  type: "number",
3595
- "onUpdate:modelValue": d[3] || (d[3] = (_) => r.transform.position.x = _),
3960
+ "onUpdate:modelValue": p[3] || (p[3] = (b) => r.transform.position.x = b),
3596
3961
  step: "0.01",
3597
3962
  onInput: n
3598
3963
  }, null, 544), [
3599
3964
  [
3600
- Q,
3965
+ $,
3601
3966
  r.transform.position.x,
3602
3967
  void 0,
3603
3968
  { number: !0 }
3604
3969
  ]
3605
3970
  ]),
3606
- d[17] || (d[17] = g("span", null, "Y:", -1)),
3607
- N(g("input", {
3971
+ p[17] || (p[17] = g("span", null, "Y:", -1)),
3972
+ O(g("input", {
3608
3973
  type: "number",
3609
- "onUpdate:modelValue": d[4] || (d[4] = (_) => r.transform.position.y = _),
3974
+ "onUpdate:modelValue": p[4] || (p[4] = (b) => r.transform.position.y = b),
3610
3975
  step: "0.01",
3611
3976
  onInput: n
3612
3977
  }, null, 544), [
3613
3978
  [
3614
- Q,
3979
+ $,
3615
3980
  r.transform.position.y,
3616
3981
  void 0,
3617
3982
  { number: !0 }
3618
3983
  ]
3619
3984
  ]),
3620
- d[18] || (d[18] = g("span", null, "Z:", -1)),
3621
- N(g("input", {
3985
+ p[18] || (p[18] = g("span", null, "Z:", -1)),
3986
+ O(g("input", {
3622
3987
  type: "number",
3623
- "onUpdate:modelValue": d[5] || (d[5] = (_) => r.transform.position.z = _),
3988
+ "onUpdate:modelValue": p[5] || (p[5] = (b) => r.transform.position.z = b),
3624
3989
  step: "0.01",
3625
3990
  onInput: n
3626
3991
  }, null, 544), [
3627
3992
  [
3628
- Q,
3993
+ $,
3629
3994
  r.transform.position.z,
3630
3995
  void 0,
3631
3996
  { number: !0 }
@@ -3633,46 +3998,46 @@ const Ji = {
3633
3998
  ])
3634
3999
  ])
3635
4000
  ]),
3636
- g("div", ao, [
3637
- d[23] || (d[23] = g("label", null, "旋转 (弧度)", -1)),
3638
- g("div", lo, [
3639
- d[20] || (d[20] = g("span", null, "X:", -1)),
3640
- N(g("input", {
4001
+ g("div", bo, [
4002
+ p[23] || (p[23] = g("label", null, "旋转 (弧度)", -1)),
4003
+ g("div", wo, [
4004
+ p[20] || (p[20] = g("span", null, "X:", -1)),
4005
+ O(g("input", {
3641
4006
  type: "number",
3642
- "onUpdate:modelValue": d[6] || (d[6] = (_) => r.transform.rotation.x = _),
4007
+ "onUpdate:modelValue": p[6] || (p[6] = (b) => r.transform.rotation.x = b),
3643
4008
  step: "0.01",
3644
4009
  onInput: n
3645
4010
  }, null, 544), [
3646
4011
  [
3647
- Q,
4012
+ $,
3648
4013
  r.transform.rotation.x,
3649
4014
  void 0,
3650
4015
  { number: !0 }
3651
4016
  ]
3652
4017
  ]),
3653
- d[21] || (d[21] = g("span", null, "Y:", -1)),
3654
- N(g("input", {
4018
+ p[21] || (p[21] = g("span", null, "Y:", -1)),
4019
+ O(g("input", {
3655
4020
  type: "number",
3656
- "onUpdate:modelValue": d[7] || (d[7] = (_) => r.transform.rotation.y = _),
4021
+ "onUpdate:modelValue": p[7] || (p[7] = (b) => r.transform.rotation.y = b),
3657
4022
  step: "0.01",
3658
4023
  onInput: n
3659
4024
  }, null, 544), [
3660
4025
  [
3661
- Q,
4026
+ $,
3662
4027
  r.transform.rotation.y,
3663
4028
  void 0,
3664
4029
  { number: !0 }
3665
4030
  ]
3666
4031
  ]),
3667
- d[22] || (d[22] = g("span", null, "Z:", -1)),
3668
- N(g("input", {
4032
+ p[22] || (p[22] = g("span", null, "Z:", -1)),
4033
+ O(g("input", {
3669
4034
  type: "number",
3670
- "onUpdate:modelValue": d[8] || (d[8] = (_) => r.transform.rotation.z = _),
4035
+ "onUpdate:modelValue": p[8] || (p[8] = (b) => r.transform.rotation.z = b),
3671
4036
  step: "0.01",
3672
4037
  onInput: n
3673
4038
  }, null, 544), [
3674
4039
  [
3675
- Q,
4040
+ $,
3676
4041
  r.transform.rotation.z,
3677
4042
  void 0,
3678
4043
  { number: !0 }
@@ -3680,46 +4045,46 @@ const Ji = {
3680
4045
  ])
3681
4046
  ])
3682
4047
  ]),
3683
- g("div", co, [
3684
- d[27] || (d[27] = g("label", null, "缩放", -1)),
3685
- g("div", ho, [
3686
- d[24] || (d[24] = g("span", null, "X:", -1)),
3687
- N(g("input", {
4048
+ g("div", To, [
4049
+ p[27] || (p[27] = g("label", null, "缩放", -1)),
4050
+ g("div", xo, [
4051
+ p[24] || (p[24] = g("span", null, "X:", -1)),
4052
+ O(g("input", {
3688
4053
  type: "number",
3689
- "onUpdate:modelValue": d[9] || (d[9] = (_) => r.transform.scale.x = _),
4054
+ "onUpdate:modelValue": p[9] || (p[9] = (b) => r.transform.scale.x = b),
3690
4055
  step: "0.01",
3691
4056
  onInput: n
3692
4057
  }, null, 544), [
3693
4058
  [
3694
- Q,
4059
+ $,
3695
4060
  r.transform.scale.x,
3696
4061
  void 0,
3697
4062
  { number: !0 }
3698
4063
  ]
3699
4064
  ]),
3700
- d[25] || (d[25] = g("span", null, "Y:", -1)),
3701
- N(g("input", {
4065
+ p[25] || (p[25] = g("span", null, "Y:", -1)),
4066
+ O(g("input", {
3702
4067
  type: "number",
3703
- "onUpdate:modelValue": d[10] || (d[10] = (_) => r.transform.scale.y = _),
4068
+ "onUpdate:modelValue": p[10] || (p[10] = (b) => r.transform.scale.y = b),
3704
4069
  step: "0.01",
3705
4070
  onInput: n
3706
4071
  }, null, 544), [
3707
4072
  [
3708
- Q,
4073
+ $,
3709
4074
  r.transform.scale.y,
3710
4075
  void 0,
3711
4076
  { number: !0 }
3712
4077
  ]
3713
4078
  ]),
3714
- d[26] || (d[26] = g("span", null, "Z:", -1)),
3715
- N(g("input", {
4079
+ p[26] || (p[26] = g("span", null, "Z:", -1)),
4080
+ O(g("input", {
3716
4081
  type: "number",
3717
- "onUpdate:modelValue": d[11] || (d[11] = (_) => r.transform.scale.z = _),
4082
+ "onUpdate:modelValue": p[11] || (p[11] = (b) => r.transform.scale.z = b),
3718
4083
  step: "0.01",
3719
4084
  onInput: n
3720
4085
  }, null, 544), [
3721
4086
  [
3722
- Q,
4087
+ $,
3723
4088
  r.transform.scale.z,
3724
4089
  void 0,
3725
4090
  { number: !0 }
@@ -3727,263 +4092,274 @@ const Ji = {
3727
4092
  ])
3728
4093
  ])
3729
4094
  ]),
3730
- r.selectedObject ? (C(), U("div", uo, [
3731
- d[31] || (d[31] = g("label", null, "材质", -1)),
3732
- g("div", po, [
3733
- d[28] || (d[28] = g("span", { class: "slider-label" }, "金属度", -1)),
3734
- N(g("input", {
4095
+ r.selectedObject ? (k(), z("div", Eo, [
4096
+ p[31] || (p[31] = g("label", null, "材质", -1)),
4097
+ g("div", Mo, [
4098
+ p[28] || (p[28] = g("span", { class: "slider-label" }, "金属度", -1)),
4099
+ O(g("input", {
3735
4100
  type: "range",
3736
4101
  min: "0",
3737
4102
  max: "1",
3738
4103
  step: "0.01",
3739
- "onUpdate:modelValue": d[12] || (d[12] = (_) => c.metalness = _),
4104
+ "onUpdate:modelValue": p[12] || (p[12] = (b) => h.metalness = b),
3740
4105
  onInput: f
3741
4106
  }, null, 544), [
3742
4107
  [
3743
- Q,
3744
- c.metalness,
4108
+ $,
4109
+ h.metalness,
3745
4110
  void 0,
3746
4111
  { number: !0 }
3747
4112
  ]
3748
4113
  ]),
3749
- g("span", fo, Ee(c.metalness.toFixed(2)), 1)
4114
+ g("span", vo, ve(h.metalness.toFixed(2)), 1)
3750
4115
  ]),
3751
- g("div", mo, [
3752
- d[29] || (d[29] = g("span", { class: "slider-label" }, "粗糙度", -1)),
3753
- N(g("input", {
4116
+ g("div", So, [
4117
+ p[29] || (p[29] = g("span", { class: "slider-label" }, "粗糙度", -1)),
4118
+ O(g("input", {
3754
4119
  type: "range",
3755
4120
  min: "0",
3756
4121
  max: "1",
3757
4122
  step: "0.01",
3758
- "onUpdate:modelValue": d[13] || (d[13] = (_) => c.roughness = _),
4123
+ "onUpdate:modelValue": p[13] || (p[13] = (b) => h.roughness = b),
3759
4124
  onInput: f
3760
4125
  }, null, 544), [
3761
4126
  [
3762
- Q,
3763
- c.roughness,
4127
+ $,
4128
+ h.roughness,
3764
4129
  void 0,
3765
4130
  { number: !0 }
3766
4131
  ]
3767
4132
  ]),
3768
- g("span", go, Ee(c.roughness.toFixed(2)), 1)
4133
+ g("span", Ao, ve(h.roughness.toFixed(2)), 1)
3769
4134
  ]),
3770
- g("div", yo, [
3771
- d[30] || (d[30] = g("span", { class: "slider-label" }, "透明度", -1)),
3772
- N(g("input", {
4135
+ g("div", Ro, [
4136
+ p[30] || (p[30] = g("span", { class: "slider-label" }, "透明度", -1)),
4137
+ O(g("input", {
3773
4138
  type: "range",
3774
4139
  min: "0",
3775
4140
  max: "1",
3776
4141
  step: "0.01",
3777
- "onUpdate:modelValue": d[14] || (d[14] = (_) => c.opacity = _),
4142
+ "onUpdate:modelValue": p[14] || (p[14] = (b) => h.opacity = b),
3778
4143
  onInput: f
3779
4144
  }, null, 544), [
3780
4145
  [
3781
- Q,
3782
- c.opacity,
4146
+ $,
4147
+ h.opacity,
3783
4148
  void 0,
3784
4149
  { number: !0 }
3785
4150
  ]
3786
4151
  ]),
3787
- g("span", _o, Ee(c.opacity.toFixed(2)), 1)
4152
+ g("span", Po, ve(h.opacity.toFixed(2)), 1)
3788
4153
  ]),
3789
- p.value ? ae("", !0) : (C(), U("div", bo, " ⚠️ 当前材质不支持金属度/粗糙度(仅支持 Standard/Phong) "))
3790
- ])) : ae("", !0)
4154
+ d.value ? le("", !0) : (k(), z("div", Lo, " ⚠️ 当前材质不支持金属度/粗糙度(仅支持 Standard/Phong) "))
4155
+ ])) : le("", !0)
3791
4156
  ], 512), [
3792
- [ue, i.value === "transform"]
4157
+ [re, i.value === "transform"]
3793
4158
  ])
3794
- ])) : ae("", !0)
3795
- ])) : (C(), U("div", wo, [...d[34] || (d[34] = [
4159
+ ])) : le("", !0)
4160
+ ])) : (k(), z("div", Io, [...p[34] || (p[34] = [
3796
4161
  g("p", null, "未选中任何模型", -1)
3797
4162
  ])]));
3798
4163
  }
3799
- }), xo = /* @__PURE__ */ Ye(To, [["__scopeId", "data-v-d75c643f"]]), Eo = { class: "top-bar" }, Mo = { class: "left-section" }, vo = { class: "dropdown-menu" }, So = { class: "dropdown-menu sub-menu" }, Ao = { class: "dropdown-menu" }, Ro = { class: "dropdown-menu sub-menu" }, Po = { class: "dropdown-menu" }, Lo = { class: "dropdown-menu" }, Io = { class: "dropdown-menu" }, Oo = /* @__PURE__ */ Xe({
4164
+ }), Do = /* @__PURE__ */ We(Co, [["__scopeId", "data-v-d75c643f"]]), Oo = { class: "top-bar" }, ko = { class: "left-section" }, No = { class: "dropdown-menu" }, jo = { class: "dropdown-menu sub-menu" }, Ho = { class: "dropdown-menu" }, Fo = { class: "dropdown-menu sub-menu" }, Uo = { class: "dropdown-menu sub-menu" }, zo = { class: "dropdown-menu" }, Go = { class: "dropdown-menu" }, Xo = { class: "dropdown-menu" }, Bo = /* @__PURE__ */ Ze({
3800
4165
  __name: "TopBar",
3801
4166
  emits: ["addModel", "importModel"],
3802
4167
  setup(r, { emit: e }) {
3803
- const t = G(!1), s = G(!1), n = G(!1), i = G(!1), o = G(!1), a = G(!1), l = G(!1), h = e, u = G(null), c = () => {
3804
- var $;
3805
- return ($ = u.value) == null ? void 0 : $.click();
3806
- }, p = ($) => {
3807
- const E = $.target;
3808
- E.files && E.files.length > 0 && (h("importModel", E.files[0]), E.value = "");
3809
- }, m = () => console.log("新建项目"), b = () => console.log("保存场景"), f = () => console.log("导出模型"), y = () => console.log("撤销"), d = () => console.log("重做"), _ = () => console.log("复制物体"), x = () => console.log("删除物体"), S = () => console.log("重置相机"), R = () => console.log("切换网格"), v = () => console.log("打开帮助"), I = () => console.log("关于编辑器"), ie = () => console.log("打开项目"), ee = () => console.log("打开模型"), fe = () => console.log("打开场景");
3810
- return ($, E) => (C(), U("div", Eo, [
3811
- g("div", Mo, [
4168
+ const t = U(!1), s = U(!1), n = U(!1), i = U(!1), o = U(!1), a = U(!1), l = U(!1), c = U(!1), u = e, h = U(null), d = () => {
4169
+ var ge;
4170
+ return (ge = h.value) == null ? void 0 : ge.click();
4171
+ }, m = (ge) => {
4172
+ const x = ge.target;
4173
+ x.files && x.files.length > 0 && (u("importModel", x.files[0]), x.value = "");
4174
+ }, w = () => console.log("新建项目"), f = () => console.log("保存场景"), y = () => console.log("导出模型"), p = () => console.log("撤销"), b = () => console.log("重做"), T = () => console.log("复制物体"), M = () => console.log("删除物体"), R = () => console.log("重置相机"), v = () => console.log("切换网格"), I = () => console.log("打开帮助"), V = () => console.log("关于编辑器"), W = () => console.log("打开项目"), Q = () => console.log("打开模型"), me = () => console.log("打开场景");
4175
+ return (ge, x) => (k(), z("div", Oo, [
4176
+ g("div", ko, [
3812
4177
  g("div", {
3813
4178
  class: "dropdown-wrapper",
3814
- onMouseenter: E[2] || (E[2] = (j) => t.value = !0),
3815
- onMouseleave: E[3] || (E[3] = (j) => t.value = !1)
4179
+ onMouseenter: x[2] || (x[2] = (P) => t.value = !0),
4180
+ onMouseleave: x[3] || (x[3] = (P) => t.value = !1)
3816
4181
  }, [
3817
- E[17] || (E[17] = g("button", { class: "menu-btn" }, "文件", -1)),
3818
- N(g("div", vo, [
4182
+ x[20] || (x[20] = g("button", { class: "menu-btn" }, "文件", -1)),
4183
+ O(g("div", No, [
3819
4184
  g("div", {
3820
4185
  class: "menu-item",
3821
- onClick: m
4186
+ onClick: w
3822
4187
  }, "新建"),
3823
4188
  g("div", {
3824
4189
  class: "menu-item dropdown-wrapper sub-trigger",
3825
- onMouseenter: E[0] || (E[0] = (j) => a.value = !0),
3826
- onMouseleave: E[1] || (E[1] = (j) => a.value = !1)
4190
+ onMouseenter: x[0] || (x[0] = (P) => a.value = !0),
4191
+ onMouseleave: x[1] || (x[1] = (P) => a.value = !1)
3827
4192
  }, [
3828
- E[16] || (E[16] = g("span", null, "打开", -1)),
3829
- N(g("div", So, [
4193
+ x[19] || (x[19] = g("span", null, "打开", -1)),
4194
+ O(g("div", jo, [
3830
4195
  g("div", {
3831
4196
  class: "menu-item",
3832
- onClick: ie
4197
+ onClick: W
3833
4198
  }, "打开项目"),
3834
4199
  g("div", {
3835
4200
  class: "menu-item",
3836
- onClick: ee
4201
+ onClick: Q
3837
4202
  }, "打开模型"),
3838
4203
  g("div", {
3839
4204
  class: "menu-item",
3840
- onClick: fe
4205
+ onClick: me
3841
4206
  }, "打开场景")
3842
4207
  ], 512), [
3843
- [ue, a.value]
4208
+ [re, a.value]
3844
4209
  ])
3845
4210
  ], 32),
3846
4211
  g("div", {
3847
4212
  class: "menu-item",
3848
- onClick: b
4213
+ onClick: f
3849
4214
  }, "保存"),
3850
4215
  g("div", {
3851
4216
  class: "menu-item",
3852
- onClick: f
4217
+ onClick: y
3853
4218
  }, "导出")
3854
4219
  ], 512), [
3855
- [ue, t.value]
4220
+ [re, t.value]
3856
4221
  ])
3857
4222
  ], 32),
3858
4223
  g("div", {
3859
4224
  class: "dropdown-wrapper",
3860
- onMouseenter: E[8] || (E[8] = (j) => o.value = !0),
3861
- onMouseleave: E[9] || (E[9] = (j) => o.value = !1)
4225
+ onMouseenter: x[11] || (x[11] = (P) => o.value = !0),
4226
+ onMouseleave: x[12] || (x[12] = (P) => o.value = !1)
3862
4227
  }, [
3863
- E[19] || (E[19] = g("button", { class: "menu-btn" }, "添加", -1)),
3864
- N(g("div", Ao, [
4228
+ x[23] || (x[23] = g("button", { class: "menu-btn" }, "添加", -1)),
4229
+ O(g("div", Ho, [
3865
4230
  g("div", {
3866
4231
  class: "menu-item",
3867
- onClick: y
4232
+ onClick: p
3868
4233
  }, "组"),
3869
4234
  g("div", {
3870
4235
  class: "menu-item dropdown-wrapper sub-trigger",
3871
- onMouseenter: E[6] || (E[6] = (j) => l.value = !0),
3872
- onMouseleave: E[7] || (E[7] = (j) => l.value = !1)
4236
+ onMouseenter: x[6] || (x[6] = (P) => l.value = !0),
4237
+ onMouseleave: x[7] || (x[7] = (P) => l.value = !1)
3873
4238
  }, [
3874
- E[18] || (E[18] = g("span", null, "网格", -1)),
3875
- N(g("div", Ro, [
4239
+ x[21] || (x[21] = g("span", null, "网格", -1)),
4240
+ O(g("div", Fo, [
3876
4241
  g("div", {
3877
4242
  class: "menu-item",
3878
- onClick: E[4] || (E[4] = (j) => h("addModel", "box"))
4243
+ onClick: x[4] || (x[4] = (P) => u("addModel", "box"))
3879
4244
  }, " 正方体 "),
3880
4245
  g("div", {
3881
4246
  class: "menu-item",
3882
- onClick: E[5] || (E[5] = (j) => h("addModel", "sphere"))
4247
+ onClick: x[5] || (x[5] = (P) => u("addModel", "sphere"))
3883
4248
  }, " 球体 "),
3884
4249
  g("div", {
3885
4250
  class: "menu-item",
3886
- onClick: c
4251
+ onClick: d
3887
4252
  }, "导入")
3888
4253
  ], 512), [
3889
- [ue, l.value]
4254
+ [re, l.value]
3890
4255
  ])
3891
4256
  ], 32),
3892
4257
  g("div", {
3893
- class: "menu-item",
3894
- onClick: _
3895
- }, "光源"),
4258
+ class: "menu-item dropdown-wrapper sub-trigger",
4259
+ onMouseenter: x[9] || (x[9] = (P) => c.value = !0),
4260
+ onMouseleave: x[10] || (x[10] = (P) => c.value = !1)
4261
+ }, [
4262
+ x[22] || (x[22] = g("span", null, "光源", -1)),
4263
+ O(g("div", Uo, [
4264
+ g("div", {
4265
+ class: "menu-item",
4266
+ onClick: x[8] || (x[8] = (P) => u("addModel", "directionalLight"))
4267
+ }, " 平行光 ")
4268
+ ], 512), [
4269
+ [re, c.value]
4270
+ ])
4271
+ ], 32),
3896
4272
  g("div", {
3897
4273
  class: "menu-item",
3898
- onClick: x
4274
+ onClick: M
3899
4275
  }, "摄像机")
3900
4276
  ], 512), [
3901
- [ue, o.value]
4277
+ [re, o.value]
3902
4278
  ])
3903
4279
  ], 32),
3904
4280
  g("div", {
3905
4281
  class: "dropdown-wrapper",
3906
- onMouseenter: E[10] || (E[10] = (j) => s.value = !0),
3907
- onMouseleave: E[11] || (E[11] = (j) => s.value = !1)
4282
+ onMouseenter: x[13] || (x[13] = (P) => s.value = !0),
4283
+ onMouseleave: x[14] || (x[14] = (P) => s.value = !1)
3908
4284
  }, [
3909
- E[20] || (E[20] = g("button", { class: "menu-btn" }, "编辑", -1)),
3910
- N(g("div", Po, [
4285
+ x[24] || (x[24] = g("button", { class: "menu-btn" }, "编辑", -1)),
4286
+ O(g("div", zo, [
3911
4287
  g("div", {
3912
4288
  class: "menu-item",
3913
- onClick: y
4289
+ onClick: p
3914
4290
  }, "撤销"),
3915
4291
  g("div", {
3916
4292
  class: "menu-item",
3917
- onClick: d
4293
+ onClick: b
3918
4294
  }, "重做"),
3919
4295
  g("div", {
3920
4296
  class: "menu-item",
3921
- onClick: _
4297
+ onClick: T
3922
4298
  }, "复制"),
3923
4299
  g("div", {
3924
4300
  class: "menu-item",
3925
- onClick: x
4301
+ onClick: M
3926
4302
  }, "删除")
3927
4303
  ], 512), [
3928
- [ue, s.value]
4304
+ [re, s.value]
3929
4305
  ])
3930
4306
  ], 32),
3931
4307
  g("div", {
3932
4308
  class: "dropdown-wrapper",
3933
- onMouseenter: E[12] || (E[12] = (j) => n.value = !0),
3934
- onMouseleave: E[13] || (E[13] = (j) => n.value = !1)
4309
+ onMouseenter: x[15] || (x[15] = (P) => n.value = !0),
4310
+ onMouseleave: x[16] || (x[16] = (P) => n.value = !1)
3935
4311
  }, [
3936
- E[21] || (E[21] = g("button", { class: "menu-btn" }, "视图", -1)),
3937
- N(g("div", Lo, [
4312
+ x[25] || (x[25] = g("button", { class: "menu-btn" }, "视图", -1)),
4313
+ O(g("div", Go, [
3938
4314
  g("div", {
3939
4315
  class: "menu-item",
3940
- onClick: S
4316
+ onClick: R
3941
4317
  }, "重置相机"),
3942
4318
  g("div", {
3943
4319
  class: "menu-item",
3944
- onClick: R
4320
+ onClick: v
3945
4321
  }, "显示网格")
3946
4322
  ], 512), [
3947
- [ue, n.value]
4323
+ [re, n.value]
3948
4324
  ])
3949
4325
  ], 32),
3950
4326
  g("div", {
3951
4327
  class: "dropdown-wrapper",
3952
- onMouseenter: E[14] || (E[14] = (j) => i.value = !0),
3953
- onMouseleave: E[15] || (E[15] = (j) => i.value = !1)
4328
+ onMouseenter: x[17] || (x[17] = (P) => i.value = !0),
4329
+ onMouseleave: x[18] || (x[18] = (P) => i.value = !1)
3954
4330
  }, [
3955
- E[22] || (E[22] = g("button", { class: "menu-btn" }, "帮助", -1)),
3956
- N(g("div", Io, [
4331
+ x[26] || (x[26] = g("button", { class: "menu-btn" }, "帮助", -1)),
4332
+ O(g("div", Xo, [
3957
4333
  g("div", {
3958
4334
  class: "menu-item",
3959
- onClick: v
4335
+ onClick: I
3960
4336
  }, "使用帮助"),
3961
4337
  g("div", {
3962
4338
  class: "menu-item",
3963
- onClick: I
4339
+ onClick: V
3964
4340
  }, "关于")
3965
4341
  ], 512), [
3966
- [ue, i.value]
4342
+ [re, i.value]
3967
4343
  ])
3968
4344
  ], 32)
3969
4345
  ]),
3970
- E[23] || (E[23] = g("div", { class: "right-section" }, [
4346
+ x[27] || (x[27] = g("div", { class: "right-section" }, [
3971
4347
  g("span", { class: "app-title" }, "3D 模型编辑器")
3972
4348
  ], -1)),
3973
4349
  g("input", {
3974
4350
  type: "file",
3975
4351
  ref_key: "fileInput",
3976
- ref: u,
4352
+ ref: h,
3977
4353
  accept: ".obj,.gltf,.glb",
3978
4354
  style: { display: "none" },
3979
- onChange: p
4355
+ onChange: m
3980
4356
  }, null, 544)
3981
4357
  ]));
3982
4358
  }
3983
- }), Co = /* @__PURE__ */ Ye(Oo, [["__scopeId", "data-v-6bb4762f"]]), Do = { class: "bottom-bar" }, No = /* @__PURE__ */ Xe({
4359
+ }), Yo = /* @__PURE__ */ We(Bo, [["__scopeId", "data-v-5b71862f"]]), Ko = { class: "bottom-bar" }, Vo = /* @__PURE__ */ Ze({
3984
4360
  __name: "BottomBar",
3985
4361
  setup(r) {
3986
- return (e, t) => (C(), U("div", Do, [...t[0] || (t[0] = [
4362
+ return (e, t) => (k(), z("div", Ko, [...t[0] || (t[0] = [
3987
4363
  g("div", { class: "status-left" }, [
3988
4364
  g("span", null, "就绪")
3989
4365
  ], -1),
@@ -3992,14 +4368,14 @@ const Ji = {
3992
4368
  ], -1)
3993
4369
  ])]));
3994
4370
  }
3995
- }), ko = /* @__PURE__ */ Ye(No, [["__scopeId", "data-v-3427bb27"]]), jo = { class: "app-layout" }, Fo = /* @__PURE__ */ Xe({
4371
+ }), Zo = /* @__PURE__ */ We(Vo, [["__scopeId", "data-v-3427bb27"]]), Wo = { class: "app-layout" }, Qo = /* @__PURE__ */ Ze({
3996
4372
  __name: "DrawingBoard",
3997
4373
  props: {
3998
4374
  mode: { default: "edit" },
3999
4375
  sceneData: { default: null }
4000
4376
  },
4001
4377
  setup(r) {
4002
- const e = r, t = G(null), s = rn({
4378
+ const e = r, t = U(null), s = un({
4003
4379
  position: { x: 0, y: 0, z: 0 },
4004
4380
  rotation: { x: 0, y: 0, z: 0 },
4005
4381
  scale: { x: 1, y: 1, z: 1 }
@@ -4016,81 +4392,88 @@ const Ji = {
4016
4392
  s.rotation.z
4017
4393
  ), f.scale.set(s.scale.x, s.scale.y, s.scale.z);
4018
4394
  };
4019
- qs((f) => {
4395
+ si((f) => {
4020
4396
  t.value = f, f && n(f);
4021
- }), Ws((f) => {
4397
+ }), ii((f) => {
4022
4398
  n(f);
4023
4399
  });
4024
4400
  const o = () => {
4025
- t.value && i(t.value);
4026
- }, a = (f) => Bi(f), l = async (f) => {
4401
+ if (t.value && (i(t.value), t.value.type === "DirectionalLight")) {
4402
+ const f = t.value.userData.helper;
4403
+ f && f.update && f.update();
4404
+ }
4405
+ }, a = (f) => no(f), l = async (f) => {
4027
4406
  try {
4028
- await Yi(f);
4407
+ await to(f);
4029
4408
  } catch (y) {
4030
4409
  console.error("导入失败:", y), alert("导入失败:" + y.message);
4031
4410
  }
4032
- }, h = Rn([]);
4033
- $s((f) => {
4034
- h.value = f;
4411
+ }, c = kn([]);
4412
+ oi((f) => {
4413
+ c.value = f;
4035
4414
  });
4036
4415
  const u = () => {
4037
- const f = Js();
4038
- f && (h.value = f);
4039
- }, c = (f) => vt(f), p = (f) => Ks(f.uuid), m = G(null);
4040
- return Pn(() => {
4041
- m.value && Ns(m.value, e.mode, e.sceneData), u();
4042
- }), (f, y) => (C(), U("div", jo, [
4043
- r.mode === "edit" ? (C(), ke(Co, {
4416
+ const f = ri();
4417
+ f && (c.value = f);
4418
+ }, h = (f) => Dt(f), d = (f) => Js(f.uuid), m = U(null);
4419
+ return Nn(() => {
4420
+ m.value && zs(m.value, e.mode, e.sceneData), u();
4421
+ }), jn(() => {
4422
+ console.log("endset_three_editor destroy"), li();
4423
+ }), (f, y) => (k(), z("div", Wo, [
4424
+ r.mode === "edit" ? (k(), je(Yo, {
4044
4425
  key: 0,
4045
4426
  onAddModel: a,
4046
4427
  onImportModel: l
4047
- })) : ae("", !0),
4428
+ })) : le("", !0),
4048
4429
  g("div", {
4049
- class: Ue(`editor-container editor-container-mode-${r.mode}`)
4430
+ class: Be(`editor-container editor-container-mode-${r.mode}`)
4050
4431
  }, [
4051
4432
  g("div", {
4052
- class: Ue(`canvas canvas-mode-${r.mode}`),
4433
+ class: Be(`canvas canvas-mode-${r.mode}`),
4053
4434
  ref_key: "containerRef",
4054
4435
  ref: m
4055
4436
  }, null, 2),
4056
- r.mode === "edit" ? (C(), ke(xo, {
4437
+ r.mode === "edit" ? (k(), je(Do, {
4057
4438
  key: 0,
4058
4439
  transform: s,
4059
- "tree-data": h.value,
4440
+ "tree-data": c.value,
4060
4441
  "selected-object": t.value,
4061
4442
  onPropertyChange: o,
4062
- onTreeSelect: c,
4063
- onTreeDelete: p
4064
- }, null, 8, ["transform", "tree-data", "selected-object"])) : ae("", !0)
4443
+ onTreeSelect: h,
4444
+ onTreeDelete: d
4445
+ }, null, 8, ["transform", "tree-data", "selected-object"])) : le("", !0)
4065
4446
  ], 2),
4066
- r.mode === "edit" ? (C(), ke(ko, { key: 1 })) : ae("", !0)
4447
+ r.mode === "edit" ? (k(), je(Zo, { key: 1 })) : le("", !0)
4067
4448
  ]));
4068
4449
  }
4069
- }), Ko = /* @__PURE__ */ Ye(Fo, [["__scopeId", "data-v-a75eff69"]]);
4450
+ }), ir = /* @__PURE__ */ We(Qo, [["__scopeId", "data-v-9bbe42aa"]]);
4070
4451
  export {
4071
- ko as BottomBar,
4072
- Ko as DrawingBoard,
4073
- xo as PropertyPanel,
4074
- Co as TopBar,
4075
- Wi as TreeItem,
4076
- Gi as addBox,
4077
- At as addModel,
4078
- Bi as addModelByType,
4079
- Xi as addSphere,
4080
- Bo as exportSceneToJSON,
4081
- Xo as getCamera,
4082
- Yo as getRenderer,
4083
- Go as getScene,
4084
- Js as getSceneObjects,
4085
- Yi as importModelFromFile,
4086
- Ns as initEditor,
4087
- ei as loadSceneFromJSON,
4088
- $s as onSceneObjectsChangeCallback,
4089
- Bs as removeModel,
4090
- Ks as removeModelById,
4091
- vt as selectObject,
4092
- qs as setSelectedObjectCallback,
4093
- Ws as setTransformChangeCallback,
4094
- $i as useTreeExpand
4452
+ Zo as BottomBar,
4453
+ ir as DrawingBoard,
4454
+ Do as PropertyPanel,
4455
+ Yo as TopBar,
4456
+ lo as TreeItem,
4457
+ $i as addBox,
4458
+ eo as addDirectionalLight,
4459
+ Ve as addModel,
4460
+ no as addModelByType,
4461
+ Ji as addSphere,
4462
+ li as destroyEditor,
4463
+ sr as exportSceneToJSON,
4464
+ tr as getCamera,
4465
+ nr as getRenderer,
4466
+ er as getScene,
4467
+ ri as getSceneObjects,
4468
+ to as importModelFromFile,
4469
+ zs as initEditor,
4470
+ ai as loadSceneFromJSON,
4471
+ oi as onSceneObjectsChangeCallback,
4472
+ $s as removeModel,
4473
+ Js as removeModelById,
4474
+ Dt as selectObject,
4475
+ si as setSelectedObjectCallback,
4476
+ ii as setTransformChangeCallback,
4477
+ co as useTreeExpand
4095
4478
  };
4096
4479
  //# sourceMappingURL=three-editor.es.js.map