@reall3d/reall3dviewer 0.0.8 → 0.1.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.
Files changed (3) hide show
  1. package/dist/pkg.js +598 -595
  2. package/dist/pkg.umd.cjs +13 -13
  3. package/package.json +1 -1
package/dist/pkg.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Vector3 as M, InstancedBufferGeometry as rn, BufferAttribute as He, InstancedBufferAttribute as ca, DynamicDrawUsage as la, ShaderMaterial as _n, DoubleSide as we, NormalBlending as da, DataTexture as Ee, RGBAIntegerFormat as _e, UnsignedIntType as Ie, Mesh as te, Vector4 as ve, Vector2 as j, WebGLRenderer as ts, PerspectiveCamera as ns, Object3D as In, CylinderGeometry as ti, MeshBasicMaterial as xe, PlaneGeometry as ua, Quaternion as _t, Controls as ha, MOUSE as Ae, TOUCH as Se, Spherical as ni, Ray as pa, Plane as fa, MathUtils as be, Float32BufferAttribute as ii, InstancedInterleavedBuffer as cn, InterleavedBufferAttribute as We, WireframeGeometry as ga, Box3 as Dn, Sphere as tt, ShaderLib as bt, UniformsUtils as is, UniformsLib as xt, Line3 as ma, Matrix4 as $e, CircleGeometry as De, Group as Qt, BufferGeometry as ya, Raycaster as Aa, SphereGeometry as wa, Color as Pn, FrontSide as va, CatmullRomCurve3 as si, Scene as ss, AmbientLight as as, FogExp2 as ai, DirectionalLight as Sa, EventDispatcher as ba, Clock as xa } from "three";
1
+ import { Vector3 as C, InstancedBufferGeometry as rn, BufferAttribute as He, InstancedBufferAttribute as ca, DynamicDrawUsage as la, ShaderMaterial as _n, DoubleSide as we, NormalBlending as da, DataTexture as Ee, RGBAIntegerFormat as _e, UnsignedIntType as Ie, Mesh as te, Vector4 as ve, Vector2 as j, WebGLRenderer as ts, PerspectiveCamera as ns, Object3D as In, CylinderGeometry as ti, MeshBasicMaterial as xe, PlaneGeometry as ua, Quaternion as _t, Controls as ha, MOUSE as Ae, TOUCH as Se, Spherical as ni, Ray as pa, Plane as fa, MathUtils as be, Float32BufferAttribute as ii, InstancedInterleavedBuffer as cn, InterleavedBufferAttribute as We, WireframeGeometry as ga, Box3 as Dn, Sphere as tt, ShaderLib as bt, UniformsUtils as is, UniformsLib as xt, Line3 as ma, Matrix4 as $e, CircleGeometry as De, Group as Qt, BufferGeometry as ya, Raycaster as Aa, SphereGeometry as wa, Color as Pn, FrontSide as va, CatmullRomCurve3 as si, Scene as ss, AmbientLight as as, FogExp2 as ai, DirectionalLight as Sa, EventDispatcher as ba, Clock as xa } from "three";
2
2
  import * as oi from "@gotoeasy/three-tile";
3
3
  let A = 1;
4
4
  const at = A++, Ln = A++, Pe = A++, os = A++, ln = A++, dn = A++, rs = A++, Gt = A++, cs = A++, Ke = A++, V = A++, Y = A++, ls = A++, un = A++, Ce = A++, Ne = A++, Be = A++, ft = A++, ds = A++, us = A++, hs = A++, Ca = A++, ps = A++, fs = A++, Fn = A++, Ma = A++, Ta = A++, ri = A++, q = A++;
@@ -80,8 +80,8 @@ async function so(i) {
80
80
  return new Uint8Array(r.buffer).set(i, 0), u(0) && (n.HashCheck = !1), n;
81
81
  }
82
82
  async function fe(i) {
83
- const e = new Uint32Array(i.slice(0, 8).buffer), t = e[0], n = e[1], a = $n == n, o = ut == n, s = Kn == n, r = a || o || s, c = !r, u = n == 20 || r ? jn : Zn, d = t * (r ? qa : R), l = WebAssembly.compile(Uint8Array.from(atob(u), (C) => C.charCodeAt(0)).buffer), h = Math.floor((d + i.byteLength) / js) + 2, f = new WebAssembly.Memory({ initial: h, maximum: h }), y = (await WebAssembly.instantiate(await l, { env: { memory: f, expf: Vt } })).exports.D, g = new Uint8Array(f.buffer);
84
- return g.set(i, d), y(0, d) ? { splatCount: t, blockFormat: n, success: !1 } : { splatCount: t, blockFormat: n, success: !0, datas: g.slice(0, d), isSplat: c, isSh: r, isSh1: a, isSh2: o, isSh3: s };
83
+ const e = new Uint32Array(i.slice(0, 8).buffer), t = e[0], n = e[1], a = $n == n, o = ut == n, s = Kn == n, r = a || o || s, c = !r, u = n == 20 || r ? jn : Zn, l = t * (r ? qa : R), d = WebAssembly.compile(Uint8Array.from(atob(u), (M) => M.charCodeAt(0)).buffer), h = Math.floor((l + i.byteLength) / js) + 2, f = new WebAssembly.Memory({ initial: h, maximum: h }), m = (await WebAssembly.instantiate(await d, { env: { memory: f, expf: Vt } })).exports.D, g = new Uint8Array(f.buffer);
84
+ return g.set(i, l), m(0, l) ? { splatCount: t, blockFormat: n, success: !1 } : { splatCount: t, blockFormat: n, success: !0, datas: g.slice(0, l), isSplat: c, isSh: r, isSh1: a, isSh2: o, isSh3: s };
85
85
  }
86
86
  async function bn(i, e) {
87
87
  const t = WebAssembly.compile(Uint8Array.from(atob(jn), (u) => u.charCodeAt(0)).buffer), n = Math.floor(e * R / js) + 2, a = new WebAssembly.Memory({ initial: n, maximum: n }), s = (await WebAssembly.instantiate(await t, { env: { memory: a, expf: Vt } })).exports.s, r = new Uint8Array(a.buffer);
@@ -90,8 +90,8 @@ async function bn(i, e) {
90
90
  return c ? (console.error("splat data parser failed:", c), new Uint8Array(0)) : r.slice(0, e * R);
91
91
  }
92
92
  async function ao(i, e, t = !0, n = !0) {
93
- const a = WebAssembly.compile(Uint8Array.from(atob(Zn), (l) => l.charCodeAt(0)).buffer), o = new WebAssembly.Memory({ initial: 1, maximum: 1 }), r = (await WebAssembly.instantiate(await a, { env: { memory: o, expf: Vt } })).exports.w, c = new Uint8Array(o.buffer), u = new Float32Array(c.buffer), d = n ? -1 : 1;
94
- return u[0] = i, t ? u[1] = d * e : u[2] = d * e, r(0, t ? 1 : 0), c.slice(0, R);
93
+ const a = WebAssembly.compile(Uint8Array.from(atob(Zn), (d) => d.charCodeAt(0)).buffer), o = new WebAssembly.Memory({ initial: 1, maximum: 1 }), r = (await WebAssembly.instantiate(await a, { env: { memory: o, expf: Vt } })).exports.w, c = new Uint8Array(o.buffer), u = new Float32Array(c.buffer), l = n ? -1 : 1;
94
+ return u[0] = i, t ? u[1] = l * e : u[2] = l * e, r(0, t ? 1 : 0), c.slice(0, R);
95
95
  }
96
96
  function Vt(i) {
97
97
  return Math.exp(i);
@@ -114,11 +114,11 @@ async function oo(i) {
114
114
  return;
115
115
  }
116
116
  i.modelSplatCount = c, i.downloadSplatCount = 0, i.splatData = new Uint8Array(Math.min(i.modelSplatCount, i.fetchLimit) * 32), i.watermarkData = new Uint8Array(0);
117
- let u = new Uint8Array(32), d = 0;
117
+ let u = new Uint8Array(32), l = 0;
118
118
  for (; ; ) {
119
- let { done: l, value: h } = await s.read();
120
- if (l) break;
121
- d + h.byteLength < i.rowLength ? (u.set(h, d), d += h.byteLength, e += h.length, i.downloadSize = e) : (d = await t(i, d, u, h), d && u.set(h.slice(h.byteLength - d), 0)), i.downloadSplatCount >= i.fetchLimit && i.abortController.abort();
119
+ let { done: d, value: h } = await s.read();
120
+ if (d) break;
121
+ l + h.byteLength < i.rowLength ? (u.set(h, l), l += h.byteLength, e += h.length, i.downloadSize = e) : (l = await t(i, l, u, h), l && u.set(h.slice(h.byteLength - l), 0)), i.downloadSplatCount >= i.fetchLimit && i.abortController.abort();
122
122
  }
123
123
  } catch (n) {
124
124
  n.name === "AbortError" ? (console.log("Fetch Abort", i.opts.url), i.status === L.Fetching && (i.status = L.FetchAborted)) : (console.error(n), i.status === L.Fetching && (i.status = L.FetchFailed));
@@ -127,18 +127,18 @@ async function oo(i) {
127
127
  }
128
128
  async function t(n, a, o, s) {
129
129
  return new Promise(async (r) => {
130
- let c = (a + s.byteLength) / n.rowLength | 0, u = (a + s.byteLength) % n.rowLength, d;
131
- a ? (d = new Uint8Array(c * n.rowLength), d.set(o.slice(0, a), 0), d.set(s.slice(0, s.byteLength - u), a)) : d = s.slice(0, c * n.rowLength), n.downloadSplatCount + c > n.fetchLimit && (c = n.fetchLimit - n.downloadSplatCount, u = 0);
132
- const l = async () => {
130
+ let c = (a + s.byteLength) / n.rowLength | 0, u = (a + s.byteLength) % n.rowLength, l;
131
+ a ? (l = new Uint8Array(c * n.rowLength), l.set(o.slice(0, a), 0), l.set(s.slice(0, s.byteLength - u), a)) : l = s.slice(0, c * n.rowLength), n.downloadSplatCount + c > n.fetchLimit && (c = n.fetchLimit - n.downloadSplatCount, u = 0);
132
+ const d = async () => {
133
133
  if (c > Qe) {
134
- const h = await bn(d, Qe);
135
- Ti(n, h), n.downloadSplatCount += Qe, e += Qe * n.rowLength, n.downloadSize = e, c -= Qe, d = d.slice(Qe * n.rowLength), setTimeout(l);
134
+ const h = await bn(l, Qe);
135
+ Ti(n, h), n.downloadSplatCount += Qe, e += Qe * n.rowLength, n.downloadSize = e, c -= Qe, l = l.slice(Qe * n.rowLength), setTimeout(d);
136
136
  } else {
137
- const h = await bn(d, c);
137
+ const h = await bn(l, c);
138
138
  Ti(n, h), n.downloadSplatCount += c, e += c * n.rowLength, n.downloadSize = e, r(u);
139
139
  }
140
140
  };
141
- await l();
141
+ await d();
142
142
  });
143
143
  }
144
144
  }
@@ -151,25 +151,25 @@ function Ti(i, e) {
151
151
  r = a[s * 8], c = a[s * 8 + 1], u = a[s * 8 + 2], i.minX = Math.min(i.minX, r), i.maxX = Math.max(i.maxX, r), i.minY = Math.min(i.minY, c), i.maxY = Math.max(i.maxY, c), i.minZ = Math.min(i.minZ, u), i.maxZ = Math.max(i.maxZ, u);
152
152
  i.dataSplatCount += t;
153
153
  const o = i.header?.MinTopY || 0;
154
- i.currentRadius = Math.sqrt(i.maxX * i.maxX + o * o + i.maxZ * i.maxZ), i.aabbCenter = new M((i.minX + i.maxX) / 2, (i.minY + i.maxY) / 2, (i.minZ + i.maxZ) / 2);
154
+ i.currentRadius = Math.sqrt(i.maxX * i.maxX + o * o + i.maxZ * i.maxZ), i.aabbCenter = new C((i.minX + i.maxX) / 2, (i.minY + i.maxY) / 2, (i.minZ + i.maxZ) / 2);
155
155
  }
156
156
  function qn(i) {
157
157
  let e = !1;
158
- const t = (p, y, g) => i.on(p, y, g), n = (p, ...y) => i.fire(p, ...y), a = !n(I).renderer;
158
+ const t = (p, m, g) => i.on(p, m, g), n = (p, ...m) => i.fire(p, ...m), a = !n(I).renderer;
159
159
  t(re, () => n(I).debugMode), t(Bn, () => e = !0);
160
160
  let o = 0;
161
161
  (function p() {
162
162
  o++, !e && requestAnimationFrame(p);
163
- })(), t(at, (p, y = null, g = 0) => {
164
- const m = () => {
165
- e || (g > 0 ? !(o % g) && p(o) : p(o), y && y() && requestAnimationFrame(m));
163
+ })(), t(at, (p, m = null, g = 0) => {
164
+ const y = () => {
165
+ e || (g > 0 ? !(o % g) && p(o) : p(o), m && m() && requestAnimationFrame(y));
166
166
  };
167
- m();
168
- }), t(Ln, (p, y = null, g = 20) => {
169
- const m = () => {
170
- e || (p(), y && y() && setTimeout(m, g));
167
+ y();
168
+ }), t(Ln, (p, m = null, g = 20) => {
169
+ const y = () => {
170
+ e || (p(), m && m() && setTimeout(y, g));
171
171
  };
172
- m();
172
+ y();
173
173
  });
174
174
  let s = !1, r = 0, c = 0;
175
175
  t(Ms, () => {
@@ -177,48 +177,48 @@ function qn(i) {
177
177
  const p = document.querySelector("#gsviewer #progressBarWrap");
178
178
  if (p) {
179
179
  p.style.display = "block";
180
- const y = document.querySelector("#gsviewer #progressBar");
181
- y && (y.style.width = "0%");
180
+ const m = document.querySelector("#gsviewer #progressBar");
181
+ m && (m.style.width = "0%");
182
182
  }
183
183
  })(), (async () => document.querySelector("#gsviewer .logo")?.classList.add("loading"))()) : parent?.onProgress && parent.onProgress(1e-3, "0.001%");
184
184
  }), t(Mt, (p) => {
185
185
  p && (r = p), s = !1, p !== void 0 && ((async () => {
186
- const y = document.querySelector("#gsviewer #progressBarWrap");
187
- y && (y.style.display = "none");
186
+ const m = document.querySelector("#gsviewer #progressBarWrap");
187
+ m && (m.style.display = "none");
188
188
  })(), (async () => document.querySelector("#gsviewer .logo")?.classList.remove("loading"))(), parent?.onProgress && parent.onProgress(0, "100%", 9));
189
189
  }), t(Ts, (p) => {
190
190
  s = !0, n(I).debugMode ? (async () => {
191
- const y = document.querySelector("#gsviewer #progressBar");
192
- y && (y.style.width = `${p}%`);
191
+ const m = document.querySelector("#gsviewer #progressBar");
192
+ m && (m.style.width = `${p}%`);
193
193
  })() : parent?.onProgress && parent.onProgress(p, `${p}%`);
194
194
  }), t(Ia, () => s), t(ks, (p) => {
195
195
  c = p;
196
196
  }), t(Es, () => !s && r && c >= r), t(Ue, () => {
197
- const y = n(Ke).parentElement.getBoundingClientRect();
198
- return { width: y.width, height: y.height, left: y.left, top: y.top };
197
+ const m = n(Ke).parentElement.getBoundingClientRect();
198
+ return { width: m.width, height: m.height, left: m.left, top: m.top };
199
199
  }), t(Le, (p) => {
200
- let y = p.x.toFixed(3).split("."), g = p.y.toFixed(3).split("."), m = p.z.toFixed(3).split(".");
201
- return (y[1] === "000" || y[1] === "00000") && (y[1] = "0"), (g[1] === "000" || g[1] === "00000") && (g[1] = "0"), (m[1] === "000" || m[1] === "00000") && (m[1] = "0"), `${y.join(".")}, ${g.join(".")}, ${m.join(".")}`;
200
+ let m = p.x.toFixed(3).split("."), g = p.y.toFixed(3).split("."), y = p.z.toFixed(3).split(".");
201
+ return (m[1] === "000" || m[1] === "00000") && (m[1] = "0"), (g[1] === "000" || g[1] === "00000") && (g[1] = "0"), (y[1] === "000" || y[1] === "00000") && (y[1] = "0"), `${m.join(".")}, ${g.join(".")}, ${y.join(".")}`;
202
202
  }), t(Ma, (p) => btoa(p)), t(Ta, (p) => atob(p));
203
203
  const u = 1e-3;
204
- let d = new M(), l = new M(), h = 0;
204
+ let l = new C(), d = new C(), h = 0;
205
205
  t(_a, () => {
206
- const p = n(V), y = p.fov, g = p.position.clone(), m = p.getWorldDirection(new M());
207
- return Math.abs(h - y) < u && Math.abs(g.x - d.x) < u && Math.abs(g.y - d.y) < u && Math.abs(g.z - d.z) < u && Math.abs(m.x - l.x) < u && Math.abs(m.y - l.y) < u && Math.abs(m.z - l.z) < u ? !1 : (h = y, d = g, l = m, !0);
206
+ const p = n(V), m = p.fov, g = p.position.clone(), y = p.getWorldDirection(new C());
207
+ return Math.abs(h - m) < u && Math.abs(g.x - l.x) < u && Math.abs(g.y - l.y) < u && Math.abs(g.z - l.z) < u && Math.abs(y.x - d.x) < u && Math.abs(y.y - d.y) < u && Math.abs(y.z - d.z) < u ? !1 : (h = m, l = g, d = y, !0);
208
208
  }), t(ke, (p) => {
209
209
  if (!p) return;
210
- const y = [];
211
- p.traverse((g) => y.push(g)), y.forEach((g) => {
212
- g.dispose ? g.dispose() : (g.geometry?.dispose?.(), g.material && g.material instanceof Array ? g.material.forEach((m) => m?.dispose?.()) : g.material?.dispose?.());
210
+ const m = [];
211
+ p.traverse((g) => m.push(g)), m.forEach((g) => {
212
+ g.dispose ? g.dispose() : (g.geometry?.dispose?.(), g.material && g.material instanceof Array ? g.material.forEach((y) => y?.dispose?.()) : g.material?.dispose?.());
213
213
  }), p.clear();
214
214
  }), t(
215
215
  oe,
216
216
  async ({
217
217
  renderSplatCount: p,
218
- visibleSplatCount: y,
218
+ visibleSplatCount: m,
219
219
  modelSplatCount: g,
220
- fps: m,
221
- realFps: C,
220
+ fps: y,
221
+ realFps: M,
222
222
  sortTime: S,
223
223
  fov: v,
224
224
  position: k,
@@ -232,7 +232,7 @@ function qn(i) {
232
232
  shDegree: F
233
233
  } = {}) => {
234
234
  if (!n(re)) return;
235
- F !== void 0 && f("shDegree", `${F}`), p !== void 0 && f("renderSplatCount", `${p}`), y !== void 0 && f("visibleSplatCount", `${y}`), g !== void 0 && f("modelSplatCount", `${g}`), m !== void 0 && f("fps", m), C !== void 0 && f("realFps", `raw ${C}`), S !== void 0 && f("sort", `${S} ms`), !a && n(ee) ? T !== void 0 && f("cuts", `(${T} cuts)`) : f("cuts", ""), w && f("worker", `${w}`), D && f("scene", D), v && f("fov", v), k && f("position", k), b && f("lookUp", b), x && f("lookAt", x), x && f("viewer-version", Yt);
235
+ F !== void 0 && f("shDegree", `${F}`), p !== void 0 && f("renderSplatCount", `${p}`), m !== void 0 && f("visibleSplatCount", `${m}`), g !== void 0 && f("modelSplatCount", `${g}`), y !== void 0 && f("fps", y), M !== void 0 && f("realFps", `raw ${M}`), S !== void 0 && f("sort", `${S} ms`), !a && n(ee) ? T !== void 0 && f("cuts", `(${T} cuts)`) : f("cuts", ""), w && f("worker", `${w}`), D && f("scene", D), v && f("fov", v), k && f("position", k), b && f("lookUp", b), x && f("lookAt", x), x && f("viewer-version", Yt);
236
236
  let E = performance.memory || { usedJSHeapSize: 0, totalJSHeapSize: 0, jsHeapSizeLimit: 0 }, P = "", U = E.usedJSHeapSize / 1024 / 1024;
237
237
  U > 1e3 ? P += (U / 1024).toFixed(2) + " G" : P += U.toFixed(0) + " M", P += " / ";
238
238
  let O = E.totalJSHeapSize / 1024 / 1024;
@@ -241,9 +241,9 @@ function qn(i) {
241
241
  P += " / ", W > 1e3 ? P += (W / 1024).toFixed(2) + " G" : P += W.toFixed(0) + " M", f("memory", P), _ && f("scale", _);
242
242
  }
243
243
  );
244
- async function f(p, y) {
244
+ async function f(p, m) {
245
245
  let g = document.querySelector(`#gsviewer .debug .${p}`);
246
- g && (g.innerText = y);
246
+ g && (g.innerText = m);
247
247
  }
248
248
  }
249
249
  function ro(i = 0) {
@@ -284,12 +284,12 @@ async function lo(i) {
284
284
  return;
285
285
  }
286
286
  i.fileSize = o;
287
- let r = [], c = new Uint8Array(ze), u = new Uint8Array(R), d = 0, l = !1, h = 0, f = 0, p, y = !1;
287
+ let r = [], c = new Uint8Array(ze), u = new Uint8Array(R), l = 0, d = !1, h = 0, f = 0, p, m = !1;
288
288
  for (; ; ) {
289
- let { done: g, value: m } = await a.read();
289
+ let { done: g, value: y } = await a.read();
290
290
  if (g) break;
291
- if (i.downloadSize += m.byteLength, r) {
292
- r.push(m);
291
+ if (i.downloadSize += y.byteLength, r) {
292
+ r.push(y);
293
293
  let v = 0;
294
294
  for (let x = 0; x < r.length; x++)
295
295
  v += r[x].byteLength;
@@ -297,37 +297,37 @@ async function lo(i) {
297
297
  continue;
298
298
  let k = 0;
299
299
  for (let x = 0; x < r.length; x++)
300
- k + r[x].byteLength < ze ? (c.set(r[x], k), k += r[x].byteLength) : (c.set(r[x].slice(0, ze - k), k), m = new Uint8Array(r[x].slice(ze - k)));
300
+ k + r[x].byteLength < ze ? (c.set(r[x], k), k += r[x].byteLength) : (c.set(r[x].slice(0, ze - k), k), y = new Uint8Array(r[x].slice(ze - k)));
301
301
  const b = await so(c);
302
302
  if (!b) {
303
303
  i.abortController.abort(), i.status === L.Fetching && (i.status = L.Invalid), console.error("invalid spx format");
304
304
  continue;
305
305
  }
306
- if (i.header = b, i.modelSplatCount = b.SplatCount, i.dataShDegree = b.ShDegree, i.aabbCenter = new M((b.MaxX + b.MaxX) / 2, (b.MinY + b.MaxY) / 2, (b.MinZ + b.MaxZ) / 2), r = null, c = null, !co.includes(b.ExclusiveId)) {
306
+ if (i.header = b, i.modelSplatCount = b.SplatCount, i.dataShDegree = b.ShDegree, i.aabbCenter = new C((b.MaxX + b.MaxX) / 2, (b.MinY + b.MaxY) / 2, (b.MinZ + b.MaxZ) / 2), r = null, c = null, !co.includes(b.ExclusiveId)) {
307
307
  i.abortController.abort(), i.status = L.Invalid, console.error("Unrecognized format, creater id =", b.CreaterId, ", exclusive id =", b.ExclusiveId, b.Comment);
308
308
  continue;
309
309
  }
310
310
  }
311
- if (!l) {
312
- if (d + m.byteLength < 4) {
313
- u.set(m, d), d += m.byteLength;
311
+ if (!d) {
312
+ if (l + y.byteLength < 4) {
313
+ u.set(y, l), l += y.byteLength;
314
314
  continue;
315
315
  }
316
- const v = new Uint8Array(d + m.byteLength);
317
- v.set(u.slice(0, d), 0), v.set(m, d), m = v.slice(4), d = 0, l = !0, p = [], f = 0;
316
+ const v = new Uint8Array(l + y.byteLength);
317
+ v.set(u.slice(0, l), 0), v.set(y, l), y = v.slice(4), l = 0, d = !0, p = [], f = 0;
318
318
  const k = new Int32Array(v.slice(0, 4).buffer);
319
- y = k[0] < 0, h = Math.abs(k[0]);
319
+ m = k[0] < 0, h = Math.abs(k[0]);
320
320
  }
321
- let C = f + m.byteLength;
322
- if (p.push(m), C < h) {
323
- f += m.byteLength;
321
+ let M = f + y.byteLength;
322
+ if (p.push(y), M < h) {
323
+ f += y.byteLength;
324
324
  continue;
325
325
  }
326
- for (; C >= h; ) {
326
+ for (; M >= h; ) {
327
327
  let v = new Uint8Array(h), k = 0;
328
328
  for (let x = 0; x < p.length; x++)
329
- k + p[x].byteLength < h ? (v.set(p[x], k), k += p[x].byteLength) : (v.set(p[x].slice(0, h - k), k), m = new Uint8Array(p[x].slice(h - k)));
330
- y && (v = await qs(v));
329
+ k + p[x].byteLength < h ? (v.set(p[x], k), k += p[x].byteLength) : (v.set(p[x].slice(0, h - k), k), y = new Uint8Array(p[x].slice(h - k)));
330
+ m && (v = await qs(v));
331
331
  const b = await fe(v);
332
332
  if (!b.success) {
333
333
  console.error("spx block data parser failed. block format:", b.blockFormat), i.abortController.abort(), i.status = L.Invalid;
@@ -349,12 +349,12 @@ async function lo(i) {
349
349
  } else
350
350
  i.sh12Data.push(b.datas), i.sh12Count += b.splatCount;
351
351
  }
352
- if (m.byteLength < 4) {
353
- u.set(m, 0), d = m.byteLength, l = !1;
352
+ if (y.byteLength < 4) {
353
+ u.set(y, 0), l = y.byteLength, d = !1;
354
354
  break;
355
355
  } else {
356
- const x = new Int32Array(m.slice(0, 4).buffer);
357
- h = Math.abs(x[0]), y = x[0] < 0, m = m.slice(4), C = m.byteLength, p = [m], f = m.byteLength;
356
+ const x = new Int32Array(y.slice(0, 4).buffer);
357
+ h = Math.abs(x[0]), m = x[0] < 0, y = y.slice(4), M = y.byteLength, p = [y], f = y.byteLength;
358
358
  }
359
359
  }
360
360
  const S = i.fetchLimit;
@@ -373,9 +373,9 @@ function uo(i, e) {
373
373
  const c = Math.min(i.fetchLimit, i.modelSplatCount);
374
374
  if (!i.splatData && (i.splatData = new Uint8Array(c * R)), !i.watermarkData && (i.watermarkData = new Uint8Array(0)), i.dataSplatCount + n > c && (n = c - i.dataSplatCount, !n))
375
375
  return;
376
- const u = new Float32Array(e.buffer), d = new Uint32Array(e.buffer);
377
- for (let h = 0, f = 0, p = 0, y = 0; h < n; h++)
378
- if (f = u[h * 8], p = u[h * 8 + 1], y = u[h * 8 + 2], i.minX = Math.min(i.minX, f), i.maxX = Math.max(i.maxX, f), i.minY = Math.min(i.minY, p), i.maxY = Math.max(i.maxY, p), i.minZ = Math.min(i.minZ, y), i.maxZ = Math.max(i.maxZ, y), d[h * 8 + 3] >> 16) {
376
+ const u = new Float32Array(e.buffer), l = new Uint32Array(e.buffer);
377
+ for (let h = 0, f = 0, p = 0, m = 0; h < n; h++)
378
+ if (f = u[h * 8], p = u[h * 8 + 1], m = u[h * 8 + 2], i.minX = Math.min(i.minX, f), i.maxX = Math.max(i.maxX, f), i.minY = Math.min(i.minY, p), i.maxY = Math.max(i.maxY, p), i.minZ = Math.min(i.minZ, m), i.maxZ = Math.max(i.maxZ, m), l[h * 8 + 3] >> 16) {
379
379
  if (i.watermarkCount * R === i.watermarkData.byteLength) {
380
380
  const g = new Uint8Array((i.watermarkCount + a) * R);
381
381
  g.set(i.watermarkData, 0), i.watermarkData = g;
@@ -383,36 +383,36 @@ function uo(i, e) {
383
383
  i.watermarkData.set(e.slice(h * 32, h * 32 + 32), i.watermarkCount++ * R);
384
384
  } else
385
385
  i.splatData.set(e.slice(h * 32, h * 32 + 32), i.dataSplatCount++ * R);
386
- const l = i.header.MinTopY || 0;
387
- i.currentRadius = Math.sqrt(i.maxX * i.maxX + l * l + i.maxZ * i.maxZ);
386
+ const d = i.header.MinTopY || 0;
387
+ i.currentRadius = Math.sqrt(i.maxX * i.maxX + d * d + i.maxZ * i.maxZ);
388
388
  return;
389
389
  }
390
390
  let o = Math.min(Math.max(i.meta.autoCut, 2), 50);
391
391
  !i.watermarkData && (i.watermarkData = new Uint8Array(0));
392
392
  const s = new Float32Array(e.buffer), r = new Uint32Array(e.buffer);
393
- for (let c = 0, u = Math.floor(e.byteLength / R), d = 0, l = 0, h = 0, f = ""; c < u; c++) {
393
+ for (let c = 0, u = Math.floor(e.byteLength / R), l = 0, d = 0, h = 0, f = ""; c < u; c++) {
394
394
  if (r[c * 8 + 3] >> 16) {
395
395
  if (i.watermarkCount * R === i.watermarkData.byteLength) {
396
- const m = new Uint8Array((i.watermarkCount + a) * R);
397
- m.set(i.watermarkData, 0), i.watermarkData = m;
396
+ const y = new Uint8Array((i.watermarkCount + a) * R);
397
+ y.set(i.watermarkData, 0), i.watermarkData = y;
398
398
  }
399
399
  i.watermarkData.set(e.slice(c * 32, c * 32 + 32), i.watermarkCount++ * R);
400
400
  continue;
401
401
  }
402
- d = s[c * 8], l = s[c * 8 + 1], h = s[c * 8 + 2];
403
- let p = Math.min(o - 1, Math.floor(Math.max(0, d - i.header.MinX) / (i.header.MaxX - i.header.MinX) * o)), y = Math.min(o - 1, Math.floor(Math.max(0, h - i.header.MinZ) / (i.header.MaxZ - i.header.MinZ) * o));
404
- f = `${p}-${y}`;
402
+ l = s[c * 8], d = s[c * 8 + 1], h = s[c * 8 + 2];
403
+ let p = Math.min(o - 1, Math.floor(Math.max(0, l - i.header.MinX) / (i.header.MaxX - i.header.MinX) * o)), m = Math.min(o - 1, Math.floor(Math.max(0, h - i.header.MinZ) / (i.header.MaxZ - i.header.MinZ) * o));
404
+ f = `${p}-${m}`;
405
405
  let g = i.map.get(f);
406
406
  if (!g)
407
- g = {}, g.minX = d, g.maxX = d, g.minY = l, g.maxY = l, g.minZ = h, g.maxZ = h, g.centerX = d, g.centerY = l, g.centerZ = h, g.radius = 0, g.splatData = new Uint8Array(a * R), g.splatData.set(e.slice(c * R, c * R + R), 0), g.splatCount = 1, i.map.set(f, g);
407
+ g = {}, g.minX = l, g.maxX = l, g.minY = d, g.maxY = d, g.minZ = h, g.maxZ = h, g.centerX = l, g.centerY = d, g.centerZ = h, g.radius = 0, g.splatData = new Uint8Array(a * R), g.splatData.set(e.slice(c * R, c * R + R), 0), g.splatCount = 1, i.map.set(f, g);
408
408
  else {
409
409
  if (g.splatData.byteLength / R == g.splatCount) {
410
410
  const v = new Uint8Array(g.splatData.byteLength + a * R);
411
411
  v.set(g.splatData, 0), g.splatData = v;
412
412
  }
413
- g.minX = Math.min(g.minX, d), g.maxX = Math.max(g.maxX, d), g.minY = Math.min(g.minY, l), g.maxY = Math.max(g.maxY, l), g.minZ = Math.min(g.minZ, h), g.maxZ = Math.max(g.maxZ, h), g.centerX = (g.maxX + g.minX) / 2, g.centerY = (g.maxY + g.minY) / 2, g.centerZ = (g.maxZ + g.minZ) / 2;
414
- const m = g.maxX - g.minX, C = g.maxY - g.minY, S = g.maxZ - g.minZ;
415
- g.radius = Math.sqrt(m * m + C * C + S * S) / 2, g.splatData.set(e.slice(c * R, c * R + R), g.splatCount++ * R);
413
+ g.minX = Math.min(g.minX, l), g.maxX = Math.max(g.maxX, l), g.minY = Math.min(g.minY, d), g.maxY = Math.max(g.maxY, d), g.minZ = Math.min(g.minZ, h), g.maxZ = Math.max(g.maxZ, h), g.centerX = (g.maxX + g.minX) / 2, g.centerY = (g.maxY + g.minY) / 2, g.centerZ = (g.maxZ + g.minZ) / 2;
414
+ const y = g.maxX - g.minX, M = g.maxY - g.minY, S = g.maxZ - g.minZ;
415
+ g.radius = Math.sqrt(y * y + M * M + S * S) / 2, g.splatData.set(e.slice(c * R, c * R + R), g.splatCount++ * R);
416
416
  }
417
417
  i.dataSplatCount++;
418
418
  }
@@ -428,23 +428,23 @@ async function ho(i) {
428
428
  }
429
429
  const r = s.body.getReader(), c = parseInt(s.headers.get("content-length") || "0");
430
430
  i.fileSize = c, i.downloadSize = 0, i.downloadSplatCount = 0, i.watermarkData = new Uint8Array(0);
431
- let u = new Uint8Array(256), d = 0, l = [], h;
431
+ let u = new Uint8Array(256), l = 0, d = [], h;
432
432
  for (; ; ) {
433
433
  let { done: f, value: p } = await r.read();
434
434
  if (f) break;
435
- if (i.downloadSize += p.byteLength, l) {
436
- if (l.push(p), i.downloadSize < 200)
435
+ if (i.downloadSize += p.byteLength, d) {
436
+ if (d.push(p), i.downloadSize < 200)
437
437
  continue;
438
- const y = new Uint8Array(i.downloadSize);
439
- for (let g = 0, m = 0; g < l.length; g++)
440
- y.set(l[g], m), m += l[g].byteLength;
441
- if (h = n(y), !h) {
442
- l = [y];
438
+ const m = new Uint8Array(i.downloadSize);
439
+ for (let g = 0, y = 0; g < d.length; g++)
440
+ m.set(d[g], y), y += d[g].byteLength;
441
+ if (h = n(m), !h) {
442
+ d = [m];
443
443
  continue;
444
444
  }
445
- l = null, p = y.slice(h.headerLength), i.rowLength = h.rowLength, i.dataShDegree = h.shDegree, i.modelSplatCount = h.vertexCount, i.splatData = new Uint8Array(Math.min(i.modelSplatCount, i.fetchLimit) * 32);
445
+ d = null, p = m.slice(h.headerLength), i.rowLength = h.rowLength, i.dataShDegree = h.shDegree, i.modelSplatCount = h.vertexCount, i.splatData = new Uint8Array(Math.min(i.modelSplatCount, i.fetchLimit) * 32);
446
446
  }
447
- d + p.byteLength < i.rowLength ? (u.set(p, d), d += p.byteLength) : (d = await e(h, i, d, u, p), d && u.set(p.slice(p.byteLength - d), 0)), i.downloadSplatCount >= i.fetchLimit && i.abortController.abort();
447
+ l + p.byteLength < i.rowLength ? (u.set(p, l), l += p.byteLength) : (l = await e(h, i, l, u, p), l && u.set(p.slice(p.byteLength - l), 0)), i.downloadSplatCount >= i.fetchLimit && i.abortController.abort();
448
448
  }
449
449
  } catch (a) {
450
450
  a.name === "AbortError" ? (console.log("Fetch Abort", i.opts.url), i.status === L.Fetching && (i.status = L.FetchAborted)) : (console.error(a), i.status === L.Fetching && (i.status = L.FetchFailed));
@@ -453,15 +453,15 @@ async function ho(i) {
453
453
  }
454
454
  async function e(a, o, s, r, c) {
455
455
  return new Promise(async (u) => {
456
- let d = (s + c.byteLength) / o.rowLength | 0, l = (s + c.byteLength) % o.rowLength, h;
457
- s ? (h = new Uint8Array(d * o.rowLength), h.set(r.slice(0, s), 0), h.set(c.slice(0, c.byteLength - l), s)) : h = c.slice(0, d * o.rowLength), o.downloadSplatCount + d > o.fetchLimit && (d = o.fetchLimit - o.downloadSplatCount, l = 0);
456
+ let l = (s + c.byteLength) / o.rowLength | 0, d = (s + c.byteLength) % o.rowLength, h;
457
+ s ? (h = new Uint8Array(l * o.rowLength), h.set(r.slice(0, s), 0), h.set(c.slice(0, c.byteLength - d), s)) : h = c.slice(0, l * o.rowLength), o.downloadSplatCount + l > o.fetchLimit && (l = o.fetchLimit - o.downloadSplatCount, d = 0);
458
458
  const f = async () => {
459
- if (d > je) {
459
+ if (l > je) {
460
460
  const p = await t(a, h, je);
461
- ki(o, p), o.downloadSplatCount += je, d -= je, h = h.slice(je * o.rowLength), setTimeout(f);
461
+ ki(o, p), o.downloadSplatCount += je, l -= je, h = h.slice(je * o.rowLength), setTimeout(f);
462
462
  } else {
463
- const p = await t(a, h, d);
464
- ki(o, p), o.downloadSplatCount += d, u(l);
463
+ const p = await t(a, h, l);
464
+ ki(o, p), o.downloadSplatCount += l, u(d);
465
465
  }
466
466
  };
467
467
  await f();
@@ -469,42 +469,42 @@ async function ho(i) {
469
469
  }
470
470
  async function t(a, o, s) {
471
471
  const r = new Uint8Array(s * Za), c = new Float32Array(o.buffer), u = new Float32Array(r.buffer);
472
- for (let d = 0; d < s; d++)
473
- u[d * 8 + 0] = c[(d * i.rowLength + a.offsets.x) / 4], u[d * 8 + 1] = c[(d * i.rowLength + a.offsets.y) / 4], u[d * 8 + 2] = c[(d * i.rowLength + a.offsets.z) / 4], u[d * 8 + 3] = Math.exp(c[(d * i.rowLength + a.offsets.scale_0) / 4]), u[d * 8 + 4] = Math.exp(c[(d * i.rowLength + a.offsets.scale_1) / 4]), u[d * 8 + 5] = Math.exp(c[(d * i.rowLength + a.offsets.scale_2) / 4]), r[d * 32 + 24] = ne((0.5 + Et * c[(d * i.rowLength + a.offsets.f_dc_0) / 4]) * 255), r[d * 32 + 25] = ne((0.5 + Et * c[(d * i.rowLength + a.offsets.f_dc_1) / 4]) * 255), r[d * 32 + 26] = ne((0.5 + Et * c[(d * i.rowLength + a.offsets.f_dc_2) / 4]) * 255), r[d * 32 + 27] = ne(1 / (1 + Math.exp(-c[(d * i.rowLength + a.offsets.opacity) / 4])) * 255), r[d * 32 + 28] = ne(c[(d * i.rowLength + a.offsets.rot_0) / 4] * 128 + 128), r[d * 32 + 29] = ne(c[(d * i.rowLength + a.offsets.rot_1) / 4] * 128 + 128), r[d * 32 + 30] = ne(c[(d * i.rowLength + a.offsets.rot_2) / 4] * 128 + 128), r[d * 32 + 31] = ne(c[(d * i.rowLength + a.offsets.rot_3) / 4] * 128 + 128);
472
+ for (let l = 0; l < s; l++)
473
+ u[l * 8 + 0] = c[(l * i.rowLength + a.offsets.x) / 4], u[l * 8 + 1] = c[(l * i.rowLength + a.offsets.y) / 4], u[l * 8 + 2] = c[(l * i.rowLength + a.offsets.z) / 4], u[l * 8 + 3] = Math.exp(c[(l * i.rowLength + a.offsets.scale_0) / 4]), u[l * 8 + 4] = Math.exp(c[(l * i.rowLength + a.offsets.scale_1) / 4]), u[l * 8 + 5] = Math.exp(c[(l * i.rowLength + a.offsets.scale_2) / 4]), r[l * 32 + 24] = ne((0.5 + Et * c[(l * i.rowLength + a.offsets.f_dc_0) / 4]) * 255), r[l * 32 + 25] = ne((0.5 + Et * c[(l * i.rowLength + a.offsets.f_dc_1) / 4]) * 255), r[l * 32 + 26] = ne((0.5 + Et * c[(l * i.rowLength + a.offsets.f_dc_2) / 4]) * 255), r[l * 32 + 27] = ne(1 / (1 + Math.exp(-c[(l * i.rowLength + a.offsets.opacity) / 4])) * 255), r[l * 32 + 28] = ne(c[(l * i.rowLength + a.offsets.rot_0) / 4] * 128 + 128), r[l * 32 + 29] = ne(c[(l * i.rowLength + a.offsets.rot_1) / 4] * 128 + 128), r[l * 32 + 30] = ne(c[(l * i.rowLength + a.offsets.rot_2) / 4] * 128 + 128), r[l * 32 + 31] = ne(c[(l * i.rowLength + a.offsets.rot_3) / 4] * 128 + 128);
474
474
  if (a.shDegree == 3) {
475
- const l = new Uint8Array(s * 24 + 8), h = new Uint8Array(s * 21 + 8), f = new Uint32Array(2);
476
- f[0] = s, f[1] = ut, l.set(new Uint8Array(f.buffer), 0);
475
+ const d = new Uint8Array(s * 24 + 8), h = new Uint8Array(s * 21 + 8), f = new Uint32Array(2);
476
+ f[0] = s, f[1] = ut, d.set(new Uint8Array(f.buffer), 0);
477
477
  const p = new Uint32Array(2);
478
478
  p[0] = s, p[1] = Kn, h.set(new Uint8Array(p.buffer), 0);
479
- for (let m = 0, C = 0; m < s; m++)
479
+ for (let y = 0, M = 0; y < s; y++)
480
480
  for (let S = 0; S < 8; S++)
481
481
  for (let v = 0; v < 3; v++)
482
- l[8 + C++] = yt(c[(m * i.rowLength + a.offsets["f_rest_" + (S + v * 15)]) / 4]);
483
- for (let m = 0, C = 0; m < s; m++)
482
+ d[8 + M++] = yt(c[(y * i.rowLength + a.offsets["f_rest_" + (S + v * 15)]) / 4]);
483
+ for (let y = 0, M = 0; y < s; y++)
484
484
  for (let S = 8; S < 15; S++)
485
485
  for (let v = 0; v < 3; v++)
486
- h[8 + C++] = yt(c[(m * i.rowLength + a.offsets["f_rest_" + (S + v * 15)]) / 4]);
487
- const y = await fe(l);
488
- i.sh12Data.push(y.datas);
486
+ h[8 + M++] = yt(c[(y * i.rowLength + a.offsets["f_rest_" + (S + v * 15)]) / 4]);
487
+ const m = await fe(d);
488
+ i.sh12Data.push(m.datas);
489
489
  const g = await fe(h);
490
490
  i.sh3Data.push(g.datas);
491
491
  } else if (a.shDegree == 2) {
492
- const l = new Uint8Array(s * 24 + 8), h = new Uint32Array(2);
493
- h[0] = s, h[1] = ut, l.set(new Uint8Array(h.buffer), 0);
494
- for (let p = 0, y = 0; p < s; p++)
492
+ const d = new Uint8Array(s * 24 + 8), h = new Uint32Array(2);
493
+ h[0] = s, h[1] = ut, d.set(new Uint8Array(h.buffer), 0);
494
+ for (let p = 0, m = 0; p < s; p++)
495
495
  for (let g = 0; g < 8; g++)
496
- for (let m = 0; m < 3; m++)
497
- l[8 + y++] = yt(c[(p * i.rowLength + a.offsets["f_rest_" + (g + m * 8)]) / 4]);
498
- const f = await fe(l);
496
+ for (let y = 0; y < 3; y++)
497
+ d[8 + m++] = yt(c[(p * i.rowLength + a.offsets["f_rest_" + (g + y * 8)]) / 4]);
498
+ const f = await fe(d);
499
499
  i.sh12Data.push(f.datas);
500
500
  } else if (a.shDegree == 1) {
501
- const l = new Uint8Array(s * 9 + 8), h = new Uint32Array(2);
502
- h[0] = s, h[1] = $n, l.set(new Uint8Array(h.buffer), 0);
503
- for (let p = 0, y = 0; p < s; p++)
501
+ const d = new Uint8Array(s * 9 + 8), h = new Uint32Array(2);
502
+ h[0] = s, h[1] = $n, d.set(new Uint8Array(h.buffer), 0);
503
+ for (let p = 0, m = 0; p < s; p++)
504
504
  for (let g = 0; g < 3; g++)
505
- for (let m = 0; m < 3; m++)
506
- l[8 + y++] = yt(c[(p * i.rowLength + a.offsets["f_rest_" + (g + m * 3)]) / 4]);
507
- const f = await fe(l);
505
+ for (let y = 0; y < 3; y++)
506
+ d[8 + m++] = yt(c[(p * i.rowLength + a.offsets["f_rest_" + (g + y * 3)]) / 4]);
507
+ const f = await fe(d);
508
508
  i.sh12Data.push(f.datas);
509
509
  }
510
510
  return await bn(r, s);
@@ -520,7 +520,7 @@ async function ho(i) {
520
520
  if (!o.startsWith("ply") || o.indexOf("format binary_little_endian 1.0") < 0)
521
521
  throw new Error("Unknow .ply file header");
522
522
  const c = parseInt(/element vertex (\d+)\n/.exec(o)[1]);
523
- let u = 0, d = {}, l = {};
523
+ let u = 0, l = {}, d = {};
524
524
  const h = {
525
525
  double: "getFloat64",
526
526
  int: "getInt32",
@@ -530,20 +530,20 @@ async function ho(i) {
530
530
  ushort: "getUint16",
531
531
  uchar: "getUint8"
532
532
  };
533
- for (let y of o.slice(0, r).split(`
533
+ for (let m of o.slice(0, r).split(`
534
534
  `).filter((g) => g.startsWith("property "))) {
535
- const [g, m, C] = y.split(" "), S = h[m] || "getInt8";
536
- l[C] = S, d[C] = u, u += parseInt(S.replace(/[^\d]/g, "")) / 8;
535
+ const [g, y, M] = m.split(" "), S = h[y] || "getInt8";
536
+ d[M] = S, l[M] = u, u += parseInt(S.replace(/[^\d]/g, "")) / 8;
537
537
  }
538
538
  let f = 0;
539
- l.f_rest_44 ? f = 3 : l.f_rest_23 ? f = 2 : l.f_rest_8 && (f = 1);
539
+ d.f_rest_44 ? f = 3 : d.f_rest_23 ? f = 2 : d.f_rest_8 && (f = 1);
540
540
  const p = ["x", "y", "z", "scale_0", "scale_1", "scale_2", "f_dc_0", "f_dc_1", "f_dc_2", "opacity", "rot_0", "rot_1", "rot_2", "rot_3"];
541
- for (let y = 0; y < p.length; y++) {
542
- const g = p[y];
543
- if (!l[g])
541
+ for (let m = 0; m < p.length; m++) {
542
+ const g = p[m];
543
+ if (!d[g])
544
544
  throw new Error(`Property not found: ${g}`);
545
545
  }
546
- return { headerLength: r + s.length, offsets: d, rowLength: u, vertexCount: c, shDegree: f };
546
+ return { headerLength: r + s.length, offsets: l, rowLength: u, vertexCount: c, shDegree: f };
547
547
  }
548
548
  }
549
549
  function ki(i, e) {
@@ -555,7 +555,7 @@ function ki(i, e) {
555
555
  r = a[s * 8], c = a[s * 8 + 1], u = a[s * 8 + 2], i.minX = Math.min(i.minX, r), i.maxX = Math.max(i.maxX, r), i.minY = Math.min(i.minY, c), i.maxY = Math.max(i.maxY, c), i.minZ = Math.min(i.minZ, u), i.maxZ = Math.max(i.maxZ, u);
556
556
  i.dataSplatCount += t;
557
557
  const o = 0;
558
- i.currentRadius = Math.sqrt(i.maxX * i.maxX + o * o + i.maxZ * i.maxZ), i.aabbCenter = new M((i.minX + i.maxX) / 2, (i.minY + i.maxY) / 2, (i.minZ + i.maxZ) / 2);
558
+ i.currentRadius = Math.sqrt(i.maxX * i.maxX + o * o + i.maxZ * i.maxZ), i.aabbCenter = new C((i.minX + i.maxX) / 2, (i.minY + i.maxY) / 2, (i.minZ + i.maxZ) / 2);
559
559
  }
560
560
  const z = le ? 20480 : 51200, Zt = 16;
561
561
  async function po(i) {
@@ -574,22 +574,22 @@ async function po(i) {
574
574
  if (h) break;
575
575
  u.set(f, i.downloadSize), i.downloadSize += f.length;
576
576
  }
577
- const d = await qs(u);
578
- if (!d || d.length < 16) {
577
+ const l = await qs(u);
578
+ if (!l || l.length < 16) {
579
579
  console.error("Invalid spz format"), i.status = L.Invalid;
580
580
  return;
581
581
  }
582
- const l = n(d);
583
- i.modelSplatCount = l.numPoints, i.dataShDegree = l.shDegree, i.splatData = new Uint8Array(Math.min(i.modelSplatCount, i.fetchLimit) * 32), await e(l, i, d);
582
+ const d = n(l);
583
+ i.modelSplatCount = d.numPoints, i.dataShDegree = d.shDegree, i.splatData = new Uint8Array(Math.min(i.modelSplatCount, i.fetchLimit) * 32), await e(d, i, l);
584
584
  } catch (a) {
585
585
  a.name === "AbortError" ? (console.log("Fetch Abort", i.opts.url), i.status === L.Fetching && (i.status = L.FetchAborted)) : (console.error(a), i.status === L.Fetching && (i.status = L.FetchFailed));
586
586
  } finally {
587
587
  i.status === L.Fetching && (i.status = L.FetchDone);
588
588
  }
589
589
  async function e(a, o, s) {
590
- const r = a.numPoints * 9, c = a.numPoints, u = a.numPoints * 3, d = a.numPoints * 3, l = a.numPoints * 3, h = Zt, f = h + r, p = f + c, y = p + u, g = y + d, m = g + l, C = Math.min(a.numPoints, o.fetchLimit), S = Math.ceil(C / z);
590
+ const r = a.numPoints * 9, c = a.numPoints, u = a.numPoints * 3, l = a.numPoints * 3, d = a.numPoints * 3, h = Zt, f = h + r, p = f + c, m = p + u, g = m + l, y = g + d, M = Math.min(a.numPoints, o.fetchLimit), S = Math.ceil(M / z);
591
591
  for (let v = 0; v < S; v++) {
592
- let k = v < S - 1 ? z : C - v * z;
592
+ let k = v < S - 1 ? z : M - v * z;
593
593
  o.dataSplatCount + k > o.fetchLimit && (k = o.fetchLimit - o.dataSplatCount);
594
594
  const b = new Uint8Array(k * 20 + 8), x = new Uint32Array(2);
595
595
  x[0] = k, x[1] = no, b.set(new Uint8Array(x.buffer), 0);
@@ -601,11 +601,11 @@ async function po(i) {
601
601
  for (let T = 0; T < k; T++)
602
602
  b[w++] = s[h + (v * z + T) * 9 + 6], b[w++] = s[h + (v * z + T) * 9 + 7], b[w++] = s[h + (v * z + T) * 9 + 8];
603
603
  for (let T = 0; T < k; T++)
604
- b[w++] = s[y + (v * z + T) * 3];
604
+ b[w++] = s[m + (v * z + T) * 3];
605
605
  for (let T = 0; T < k; T++)
606
- b[w++] = s[y + (v * z + T) * 3 + 1];
606
+ b[w++] = s[m + (v * z + T) * 3 + 1];
607
607
  for (let T = 0; T < k; T++)
608
- b[w++] = s[y + (v * z + T) * 3 + 2];
608
+ b[w++] = s[m + (v * z + T) * 3 + 2];
609
609
  for (let T = 0; T < k; T++)
610
610
  b[w++] = jt(s[p + (v * z + T) * 3]);
611
611
  for (let T = 0; T < k; T++)
@@ -628,27 +628,27 @@ async function po(i) {
628
628
  const T = new Uint8Array(k * 9 + 8), F = new Uint32Array(2);
629
629
  F[0] = k, F[1] = $n, T.set(new Uint8Array(F.buffer), 0);
630
630
  for (let P = 0, U = 8; P < k; P++)
631
- T.set(s.slice(m + (v * z + P) * 9, m + (v * z + P) * 9 + 9), U), U += 9;
631
+ T.set(s.slice(y + (v * z + P) * 9, y + (v * z + P) * 9 + 9), U), U += 9;
632
632
  const E = await fe(T);
633
633
  o.sh12Data.push(E.datas);
634
634
  } else if (a.shDegree === 2) {
635
635
  const T = new Uint8Array(k * 24 + 8), F = new Uint32Array(2);
636
636
  F[0] = k, F[1] = ut, T.set(new Uint8Array(F.buffer), 0);
637
637
  for (let P = 0, U = 8; P < k; P++)
638
- T.set(s.slice(m + (v * z + P) * 24, m + (v * z + P) * 24 + 24), U), U += 24;
638
+ T.set(s.slice(y + (v * z + P) * 24, y + (v * z + P) * 24 + 24), U), U += 24;
639
639
  const E = await fe(T);
640
640
  o.sh12Data.push(E.datas);
641
641
  } else if (a.shDegree === 3) {
642
642
  const T = new Uint8Array(k * 24 + 8), F = new Uint32Array(2);
643
643
  F[0] = k, F[1] = ut, T.set(new Uint8Array(F.buffer), 0);
644
644
  for (let W = 0, se = 8; W < k; W++)
645
- T.set(s.slice(m + (v * z + W) * 45, m + (v * z + W) * 45 + 24), se), se += 24;
645
+ T.set(s.slice(y + (v * z + W) * 45, y + (v * z + W) * 45 + 24), se), se += 24;
646
646
  const E = await fe(T);
647
647
  o.sh12Data.push(E.datas);
648
648
  const P = new Uint8Array(k * 21 + 8), U = new Uint32Array(2);
649
649
  U[0] = k, U[1] = Kn, P.set(new Uint8Array(U.buffer), 0);
650
650
  for (let W = 0, se = 8; W < k; W++)
651
- P.set(s.slice(m + (v * z + W) * 45 + 24, m + (v * z + W) * 45 + 45), se), se += 21;
651
+ P.set(s.slice(y + (v * z + W) * 45 + 24, y + (v * z + W) * 45 + 45), se), se += 21;
652
652
  const O = await fe(P);
653
653
  o.sh3Data.push(O.datas);
654
654
  }
@@ -661,11 +661,11 @@ async function po(i) {
661
661
  const c = Math.min(o.fetchLimit, a.numPoints);
662
662
  o.dataSplatCount + r > c ? (r = c - o.dataSplatCount, o.splatData.set(s.slice(0, r * R), o.dataSplatCount * R)) : o.splatData.set(s, o.dataSplatCount * R);
663
663
  const u = new Float32Array(s.buffer);
664
- for (let l = 0, h = 0, f = 0, p = 0; l < r; l++)
665
- h = u[l * 8], f = u[l * 8 + 1], p = u[l * 8 + 2], o.minX = Math.min(o.minX, h), o.maxX = Math.max(o.maxX, h), o.minY = Math.min(o.minY, f), o.maxY = Math.max(o.maxY, f), o.minZ = Math.min(o.minZ, p), o.maxZ = Math.max(o.maxZ, p);
664
+ for (let d = 0, h = 0, f = 0, p = 0; d < r; d++)
665
+ h = u[d * 8], f = u[d * 8 + 1], p = u[d * 8 + 2], o.minX = Math.min(o.minX, h), o.maxX = Math.max(o.maxX, h), o.minY = Math.min(o.minY, f), o.maxY = Math.max(o.maxY, f), o.minZ = Math.min(o.minZ, p), o.maxZ = Math.max(o.maxZ, p);
666
666
  o.dataSplatCount += r, o.downloadSplatCount += r;
667
- const d = 0;
668
- o.currentRadius = Math.sqrt(o.maxX * o.maxX + d * d + o.maxZ * o.maxZ), o.aabbCenter = new M((o.minX + o.maxX) / 2, (o.minY + o.maxY) / 2, (o.minZ + o.maxZ) / 2);
667
+ const l = 0;
668
+ o.currentRadius = Math.sqrt(o.maxX * o.maxX + l * l + o.maxZ * o.maxZ), o.aabbCenter = new C((o.minX + o.maxX) / 2, (o.minY + o.maxY) / 2, (o.minZ + o.maxZ) / 2);
669
669
  }
670
670
  function n(a) {
671
671
  const o = a.slice(0, Zt), s = new Uint32Array(o.buffer), r = {};
@@ -687,53 +687,53 @@ function fo(i, e, t) {
687
687
  return [ne(s * 128 + 128), ne(n * 128 + 128), ne(a * 128 + 128), ne(o * 128 + 128)];
688
688
  }
689
689
  function go(i) {
690
- const e = (C, S, v) => i.on(C, S, v), t = (C, ...S) => i.fire(C, ...S);
690
+ const e = (M, S, v) => i.on(M, S, v), t = (M, ...S) => i.fire(M, ...S);
691
691
  let n, a = Date.now() + 36e5, o = null, s, r = { index: 0, version: 0 }, c = { version: 0 }, u = !1;
692
- const d = t(ee);
693
- e(Ys, () => s?.aabbCenter || new M());
694
- let l;
695
- const h = new Promise((C) => l = C);
692
+ const l = t(ee);
693
+ e(Ys, () => s?.aabbCenter || new C());
694
+ let d;
695
+ const h = new Promise((M) => d = M);
696
696
  e(ot, async () => {
697
- const C = t(I);
698
- let S = le ? C.maxRenderCountOfMobile : C.maxRenderCountOfPc;
699
- if (!C.bigSceneMode) {
697
+ const M = t(I);
698
+ let S = le ? M.maxRenderCountOfMobile : M.maxRenderCountOfPc;
699
+ if (!M.bigSceneMode) {
700
700
  let v = await h;
701
701
  S = Math.min(v, S) + 10240;
702
702
  }
703
703
  return S;
704
- }), e(Je, async (C) => {
704
+ }), e(Je, async (M) => {
705
705
  const S = t(I);
706
706
  if (S.bigSceneMode) return 1;
707
707
  let v = le ? S.maxRenderCountOfMobile : S.maxRenderCountOfPc, k = await h;
708
708
  if (v = Math.min(k, v), !s.dataShDegree) return 1;
709
- if (C >= 3) {
709
+ if (M >= 3) {
710
710
  if (s.dataShDegree < 3) return 1;
711
- } else if (C >= 1) {
711
+ } else if (M >= 1) {
712
712
  if (s.dataShDegree < 1) return 1;
713
713
  } else
714
714
  return 1;
715
715
  const b = 1024 * 2;
716
716
  return Math.ceil(v / b);
717
- }), e(Nn, async () => t(I).bigSceneMode ? 0 : (await h, s.dataShDegree)), e(Hn, async (C, S = !0) => {
717
+ }), e(Nn, async () => t(I).bigSceneMode ? 0 : (await h, s.dataShDegree)), e(Hn, async (M, S = !0) => {
718
718
  try {
719
719
  await h;
720
720
  const v = !!s.header?.Flag2;
721
- o = await t(Rs, C, S, v), s && (s.textWatermarkVersion = Date.now());
721
+ o = await t(Rs, M, S, v), s && (s.textWatermarkVersion = Date.now());
722
722
  } catch {
723
723
  console.info("failed to generate watermark");
724
724
  }
725
725
  }), e(gn, () => {
726
- if (d) return r.version <= c.version ? r.xyz : c.xyz;
726
+ if (l) return r.version <= c.version ? r.xyz : c.xyz;
727
727
  if (s?.status === L.FetchDone || s?.status === L.FetchAborted) {
728
728
  if (s.activePoints && s.activePoints.length === void 0) return s.activePoints;
729
- const C = {}, S = r.xyz;
729
+ const M = {}, S = r.xyz;
730
730
  for (let v = 0, k = S.length / 3, b = 0, x = 0, w = 0, D = ""; v < k; v++)
731
- b = S[v * 3], x = S[v * 3 + 1], w = S[v * 3 + 2], D = `${Math.floor(b / 2) * 2 + 1},${Math.floor(x / 2) * 2 + 1},${Math.floor(w / 2) * 2 + 1}`, (C[D] = C[D] || []).push(b, x, w);
732
- return s.activePoints = C;
731
+ b = S[v * 3], x = S[v * 3 + 1], w = S[v * 3 + 2], D = `${Math.floor(b / 2) * 2 + 1},${Math.floor(x / 2) * 2 + 1},${Math.floor(w / 2) * 2 + 1}`, (M[D] = M[D] || []).push(b, x, w);
732
+ return s.activePoints = M;
733
733
  }
734
734
  return r.xyz;
735
735
  });
736
- async function f(C) {
736
+ async function f(M) {
737
737
  if (n) return;
738
738
  if (s && (s.status === L.Invalid || s.status === L.FetchFailed))
739
739
  return t(I).viewerEvents?.fire(q), t(Mt, 0) || t(oe, { renderSplatCount: 0, visibleSplatCount: 0, modelSplatCount: 0 });
@@ -748,10 +748,10 @@ function go(i) {
748
748
  await p(S), u = !1;
749
749
  })));
750
750
  }
751
- async function p(C) {
751
+ async function p(M) {
752
752
  if (n) return;
753
753
  const S = r, v = await t(ot), k = o;
754
- let b = s.dataSplatCount, x = C ? s.watermarkCount : 0, w = s.meta.showWatermark && C ? (k?.byteLength || 0) / 32 : 0;
754
+ let b = s.dataSplatCount, x = M ? s.watermarkCount : 0, w = s.meta.showWatermark && M ? (k?.byteLength || 0) / 32 : 0;
755
755
  if (s.renderSplatCount = b + x + w, s.renderSplatCount >= v && (s.renderSplatCount = v, x = 0, w = 0, b > v && (b = v)), t(oe, { visibleSplatCount: s.renderSplatCount, modelSplatCount: s.modelSplatCount + w }), Date.now() - S.textureReadyTime < (le ? 600 : 300) || s.smallSceneUploadDone && s.lastTextWatermarkVersion == s.textWatermarkVersion) return;
756
756
  if (!S.version) {
757
757
  t(ms, (s.header?.Flag2 ? s.header.MaxTopY : s.header?.MinTopY) || 0);
@@ -765,55 +765,55 @@ function go(i) {
765
765
  for (let O = 0, W = 0; O < s.renderSplatCount; O++)
766
766
  P[O * 3] = F[O * 8], P[O * 3 + 1] = F[O * 8 + 1], P[O * 3 + 2] = F[O * 8 + 2];
767
767
  const U = Date.now();
768
- if (S.version = U, S.txdata = T, S.xyz = P, S.renderSplatCount = s.renderSplatCount, S.visibleSplatCount = s.downloadSplatCount + w, S.modelSplatCount = s.downloadSplatCount + w, S.watermarkCount = x + w, S.minX = s.minX, S.maxX = s.maxX, S.minY = s.minY, S.maxY = s.maxY, S.minZ = s.minZ, S.maxZ = s.maxZ, t(zs, S, s.currentRadius, s.currentRadius), a = U, C && !s.smallSceneUploadDone) {
768
+ if (S.version = U, S.txdata = T, S.xyz = P, S.renderSplatCount = s.renderSplatCount, S.visibleSplatCount = s.downloadSplatCount + w, S.modelSplatCount = s.downloadSplatCount + w, S.watermarkCount = x + w, S.minX = s.minX, S.maxX = s.maxX, S.minY = s.minY, S.maxY = s.maxY, S.minZ = s.minZ, S.maxZ = s.maxZ, t(zs, S, s.currentRadius, s.currentRadius), a = U, M && !s.smallSceneUploadDone) {
769
769
  s.smallSceneUploadDone = !0, t(Qs, s.sh12Data), t(Hs, s.sh3Data), s.sh12Data = null, s.sh3Data = null;
770
770
  const O = t(I);
771
771
  t(Rn, O.shDegree === void 0 ? 3 : O.shDegree), t(gn);
772
772
  }
773
773
  t(oe, { renderSplatCount: s.renderSplatCount });
774
774
  }
775
- function y() {
775
+ function m() {
776
776
  n || (n = !0, s?.abortController?.abort(), s?.map?.clear(), s = null, o = null, r = null, c = null);
777
777
  }
778
- function g(C) {
779
- if (C.opts.format === "spx")
780
- lo(C);
781
- else if (C.opts.format === "splat")
782
- oo(C);
783
- else if (C.opts.format === "ply")
784
- ho(C);
785
- else if (C.opts.format === "spz")
786
- po(C);
778
+ function g(M) {
779
+ if (M.opts.format === "spx")
780
+ lo(M);
781
+ else if (M.opts.format === "splat")
782
+ oo(M);
783
+ else if (M.opts.format === "ply")
784
+ ho(M);
785
+ else if (M.opts.format === "spz")
786
+ po(M);
787
787
  else
788
788
  return !1;
789
789
  return !0;
790
790
  }
791
- async function m(C, S) {
791
+ async function y(M, S) {
792
792
  if (n) return;
793
793
  const v = t(I), k = le ? v.maxRenderCountOfMobile : v.maxRenderCountOfPc, b = t(ee);
794
- if (C.fetchReload = ro(S.updateDate || 0), s = new $a(C, S), b && S.autoCut) {
794
+ if (M.fetchReload = ro(S.updateDate || 0), s = new $a(M, S), b && S.autoCut) {
795
795
  const D = S.pcDownloadLimitSplatCount || eo, _ = S.mobileDownloadLimitSplatCount || Ja, T = le ? _ : D;
796
796
  s.fetchLimit = Math.min(S.autoCut * S.autoCut * k + k, T);
797
797
  } else
798
798
  s.fetchLimit = k;
799
799
  const x = Date.now(), w = () => {
800
800
  if (!s || s.status == L.Invalid || s.status == L.FetchFailed)
801
- return l(0);
801
+ return d(0);
802
802
  if (s.modelSplatCount >= 0)
803
- l(s.modelSplatCount), setTimeout(() => t(Cs), 5);
803
+ d(s.modelSplatCount), setTimeout(() => t(Cs), 5);
804
804
  else {
805
805
  if (Date.now() - x >= 3e3)
806
- return l(0);
806
+ return d(0);
807
807
  setTimeout(w, 10);
808
808
  }
809
809
  };
810
810
  if (w(), !g(s)) {
811
- console.error("Unsupported format:", C.format), t(Mt, 0);
811
+ console.error("Unsupported format:", M.format), t(Mt, 0);
812
812
  return;
813
813
  }
814
814
  t(Ms);
815
815
  }
816
- e(vs, async (C, S) => await m(C, S)), e(Ss, (C = 1e4) => Date.now() - a < C), e(bs, () => y()), t(
816
+ e(vs, async (M, S) => await y(M, S)), e(Ss, (M = 1e4) => Date.now() - a < M), e(bs, () => m()), t(
817
817
  at,
818
818
  async () => await f(),
819
819
  () => !n
@@ -1185,28 +1185,28 @@ const Lo = `$${Q++}`, Fo = `$${Q++}`, Ro = `$${Q++}`, Bo = `$${Q++}`, Uo = `$${Q
1185
1185
  Q++;
1186
1186
  function Ho(i) {
1187
1187
  let e = !1;
1188
- const t = (l, h, f) => i.on(l, h, f), n = (l, ...h) => i.fire(l, ...h);
1188
+ const t = (d, h, f) => i.on(d, h, f), n = (d, ...h) => i.fire(d, ...h);
1189
1189
  let a = 0, o = 0;
1190
1190
  const s = [];
1191
1191
  let r = 0;
1192
1192
  t(Ws, () => r), t(li, async () => {
1193
- const l = new rn();
1194
- l.setIndex([0, 1, 2, 0, 2, 3]);
1193
+ const d = new rn();
1194
+ d.setIndex([0, 1, 2, 0, 2, 3]);
1195
1195
  const h = new Float32Array(4 * 3), f = new He(h, 3);
1196
- l.setAttribute("position", f), f.setXYZ(0, -2, -2, 0), f.setXYZ(1, -2, 2, 0), f.setXYZ(2, 2, 2, 0), f.setXYZ(3, 2, -2, 0), f.needsUpdate = !0;
1197
- let p = new rn().copy(l);
1198
- const y = await n(ot);
1196
+ d.setAttribute("position", f), f.setXYZ(0, -2, -2, 0), f.setXYZ(1, -2, 2, 0), f.setXYZ(2, 2, 2, 0), f.setXYZ(3, 2, -2, 0), f.needsUpdate = !0;
1197
+ let p = new rn().copy(d);
1198
+ const m = await n(ot);
1199
1199
  if (e) return;
1200
- const g = new Uint32Array(y), m = new ca(g, 1, !1);
1201
- return m.setUsage(la), m.needsUpdate = !0, p.setAttribute(bo, m), p.instanceCount = 0, t(hi, (C, S, v, k) => {
1202
- n(fi, S), g.set(C, 0), m.clearUpdateRanges(), m.addUpdateRange(0, C.length), m.needsUpdate = !0, p.instanceCount = C.length, n(N), n(oe, { sortTime: `${v} / ${Date.now() - k}` });
1200
+ const g = new Uint32Array(m), y = new ca(g, 1, !1);
1201
+ return y.setUsage(la), y.needsUpdate = !0, p.setAttribute(bo, y), p.instanceCount = 0, t(hi, (M, S, v, k) => {
1202
+ n(fi, S), g.set(M, 0), y.clearUpdateRanges(), y.addUpdateRange(0, M.length), y.needsUpdate = !0, p.instanceCount = M.length, n(N), n(oe, { sortTime: `${v} / ${Date.now() - k}` });
1203
1203
  }), t(ka, () => p), t(mi, () => {
1204
- m.array = null, p.dispose();
1204
+ y.array = null, p.dispose();
1205
1205
  }), p;
1206
1206
  }), t(di, async () => {
1207
- const l = await n(ot);
1207
+ const d = await n(ot);
1208
1208
  if (e) return;
1209
- const h = 1024 * 2, f = Math.ceil(2 * l / h), p = n(I), y = new _n({
1209
+ const h = 1024 * 2, f = Math.ceil(2 * d / h), p = n(I), m = new _n({
1210
1210
  uniforms: n(ci),
1211
1211
  vertexShader: mo(),
1212
1212
  fragmentShader: yo(),
@@ -1219,17 +1219,17 @@ function Ho(i) {
1219
1219
  // 是否将深度值写入深度缓冲区
1220
1220
  side: we
1221
1221
  }), g = new Uint32Array(h * f * 4);
1222
- let m = new Ee(g, h, f, _e, Ie);
1223
- m.internalFormat = "RGBA32UI", m.needsUpdate = !0, y.uniforms[en].value = m;
1224
- const C = n(ee) ? f : 1, S = new Uint32Array(h * C * 4);
1225
- let v = new Ee(S, h, C, _e, Ie);
1226
- v.internalFormat = "RGBA32UI", v.needsUpdate = !0, y.uniforms[tn].value = v;
1222
+ let y = new Ee(g, h, f, _e, Ie);
1223
+ y.internalFormat = "RGBA32UI", y.needsUpdate = !0, m.uniforms[en].value = y;
1224
+ const M = n(ee) ? f : 1, S = new Uint32Array(h * M * 4);
1225
+ let v = new Ee(S, h, M, _e, Ie);
1226
+ v.internalFormat = "RGBA32UI", v.needsUpdate = !0, m.uniforms[tn].value = v;
1227
1227
  const k = await n(Je, 1), b = new Uint32Array(h * k * 4);
1228
1228
  let x = new Ee(b, h, k, _e, Ie);
1229
- x.internalFormat = "RGBA32UI", x.needsUpdate = !0, y.uniforms[qt].value = x;
1229
+ x.internalFormat = "RGBA32UI", x.needsUpdate = !0, m.uniforms[qt].value = x;
1230
1230
  const w = await n(Je, 3), D = new Uint32Array(h * w * 4);
1231
1231
  let _ = new Ee(D, h, w, _e, Ie);
1232
- _.internalFormat = "RGBA32UI", _.needsUpdate = !0, y.uniforms[Jt].value = _, y.needsUpdate = !0;
1232
+ _.internalFormat = "RGBA32UI", _.needsUpdate = !0, m.uniforms[Jt].value = _, m.needsUpdate = !0;
1233
1233
  let T = !1;
1234
1234
  t(pi, (E) => {
1235
1235
  if (!n(ee)) {
@@ -1240,67 +1240,67 @@ function Ho(i) {
1240
1240
  E.txdata = null;
1241
1241
  const U = new Ee(P, h, f, _e, Ie);
1242
1242
  U.onUpdate = () => {
1243
- E.textureReady = !0, E.textureReadyTime = Date.now(), d(E), n(ks, E.renderSplatCount);
1244
- }, U.internalFormat = "RGBA32UI", U.needsUpdate = !0, E.index ? (y.uniforms[tn].value = U, v = U) : (y.uniforms[en].value = U, m = U), y.needsUpdate = !0, n(N);
1243
+ E.textureReady = !0, E.textureReadyTime = Date.now(), l(E), n(ks, E.renderSplatCount);
1244
+ }, U.internalFormat = "RGBA32UI", U.needsUpdate = !0, E.index ? (m.uniforms[tn].value = U, v = U) : (m.uniforms[en].value = U, y = U), m.needsUpdate = !0, n(N);
1245
1245
  }), t(Qs, async (E) => {
1246
1246
  if (n(ee) || !E || !E.length) return;
1247
1247
  const P = new Uint32Array(h * await n(Je, 1) * 4), U = new Uint8Array(P.buffer);
1248
1248
  for (let W = 0, se = 0; W < E.length; W++)
1249
1249
  U.set(E[W], se), se += E[W].byteLength;
1250
1250
  const O = new Ee(P, h, k, _e, Ie);
1251
- O.internalFormat = "RGBA32UI", O.needsUpdate = !0, y.uniforms[qt].value = O, y.needsUpdate = !0, n(N);
1251
+ O.internalFormat = "RGBA32UI", O.needsUpdate = !0, m.uniforms[qt].value = O, m.needsUpdate = !0, n(N);
1252
1252
  }), t(Hs, async (E) => {
1253
1253
  if (n(ee) || !E || !E.length) return;
1254
1254
  const P = new Uint32Array(h * await n(Je, 3) * 4), U = new Uint8Array(P.buffer);
1255
1255
  for (let W = 0, se = 0; W < E.length; W++)
1256
1256
  U.set(E[W], se), se += E[W].byteLength;
1257
1257
  const O = new Ee(P, h, k, _e, Ie);
1258
- O.internalFormat = "RGBA32UI", O.needsUpdate = !0, y.uniforms[Jt].value = O, y.needsUpdate = !0, n(N);
1259
- }), t(ui, () => y), t(Nt, () => {
1258
+ O.internalFormat = "RGBA32UI", O.needsUpdate = !0, m.uniforms[Jt].value = O, m.needsUpdate = !0, n(N);
1259
+ }), t(ui, () => m), t(Nt, () => {
1260
1260
  const E = n(V), { width: P, height: U } = n(Ue), O = Math.abs(E.projectionMatrix.elements[0]) * 0.5 * P, W = Math.abs(E.projectionMatrix.elements[5]) * 0.5 * U, se = n(ui);
1261
1261
  se.uniforms[zi].value.set(O, W), se.uniformsNeedUpdate = !0, n(N);
1262
1262
  }), t(Xt, () => {
1263
1263
  const { width: E, height: P } = n(Ue);
1264
- y.uniforms[ht].value.set(E, P), y.uniformsNeedUpdate = !0, n(N);
1264
+ m.uniforms[ht].value.set(E, P), m.uniformsNeedUpdate = !0, n(N);
1265
1265
  }), t(fi, (E) => {
1266
- y.uniforms[Ri].value = E, y.uniformsNeedUpdate = !0, n(N);
1266
+ m.uniforms[Ri].value = E, m.uniformsNeedUpdate = !0, n(N);
1267
1267
  }), t(nt, (E) => {
1268
1268
  const P = n(I);
1269
- E === void 0 && (E = !P.pointcloudMode), y.uniforms[Bi].value = E ? 1 : 0, y.uniformsNeedUpdate = !0, P.pointcloudMode = E, n(N), P.viewerEvents && (P.viewerEvents.fire(I).pointcloudMode = E);
1269
+ E === void 0 && (E = !P.pointcloudMode), m.uniforms[Bi].value = E ? 1 : 0, m.uniformsNeedUpdate = !0, P.pointcloudMode = E, n(N), P.viewerEvents && (P.viewerEvents.fire(I).pointcloudMode = E);
1270
1270
  }), t(gi, (E) => {
1271
- y.uniforms[Pi].value = E ? 1 : 0, y.uniformsNeedUpdate = !0;
1271
+ m.uniforms[Pi].value = E ? 1 : 0, m.uniformsNeedUpdate = !0;
1272
1272
  const P = n(I);
1273
1273
  P.bigSceneMode = E, n(N);
1274
1274
  }), t(rt, (E) => {
1275
- y.uniforms[Li].value = E, y.uniformsNeedUpdate = !0;
1275
+ m.uniforms[Li].value = E, m.uniformsNeedUpdate = !0;
1276
1276
  const P = n(I);
1277
1277
  P.lightFactor = E, n(N);
1278
1278
  });
1279
1279
  let F = !1;
1280
1280
  return t(ms, (E) => {
1281
- n(ee) || F || (F = !0, y.uniforms[Qi].value = E, y.uniformsNeedUpdate = !0, n(N));
1281
+ n(ee) || F || (F = !0, m.uniforms[Qi].value = E, m.uniformsNeedUpdate = !0, n(N));
1282
1282
  }), t(gt, (E) => {
1283
- y.uniforms[Ei].value = E, y.uniformsNeedUpdate = !0, n(N);
1283
+ m.uniforms[Ei].value = E, m.uniformsNeedUpdate = !0, n(N);
1284
1284
  }), t($t, (E) => {
1285
- y.uniforms[_i].value = E, y.uniformsNeedUpdate = !0, n(N);
1285
+ m.uniforms[_i].value = E, m.uniformsNeedUpdate = !0, n(N);
1286
1286
  }), t(Ct, (E, P, U, O) => {
1287
- y.uniforms[Ui].value = [E, P, U, O ? 1 : -1], y.uniformsNeedUpdate = !0, n(N);
1287
+ m.uniforms[Ui].value = [E, P, U, O ? 1 : -1], m.uniformsNeedUpdate = !0, n(N);
1288
1288
  }), t(hn, (E = !0) => {
1289
- y.uniforms[Di].value = E ? 1 : 0, y.uniformsNeedUpdate = !0, n(N);
1289
+ m.uniforms[Di].value = E ? 1 : 0, m.uniformsNeedUpdate = !0, n(N);
1290
1290
  }), t(ys, (E) => {
1291
- y.uniforms[Ii].value = E, y.uniformsNeedUpdate = !0;
1291
+ m.uniforms[Ii].value = E, m.uniformsNeedUpdate = !0;
1292
1292
  }), t(Ea, (E) => {
1293
- y.uniforms[Fi].value = E, y.uniformsNeedUpdate = !0;
1293
+ m.uniforms[Fi].value = E, m.uniformsNeedUpdate = !0;
1294
1294
  }), t(Rn, async (E) => {
1295
1295
  if (n(ee)) return;
1296
1296
  const P = await n(Nn);
1297
- E < 0 && (E = 0), E > P && (E = P), r = E, y.uniforms[Oi].value = E, y.uniformsNeedUpdate = !0, n(oe, { shDegree: `${E} / max ${P}` }), n(N);
1297
+ E < 0 && (E = 0), E > P && (E = P), r = E, m.uniforms[Oi].value = E, m.uniformsNeedUpdate = !0, n(oe, { shDegree: `${E} / max ${P}` }), n(N);
1298
1298
  }), t(yi, () => {
1299
- y.dispose(), m && m.dispose(), v && v.dispose(), x && x.dispose(), _ && _.dispose();
1300
- }), y;
1299
+ m.dispose(), y && y.dispose(), v && v.dispose(), x && x.dispose(), _ && _.dispose();
1300
+ }), m;
1301
1301
  }), t(gs, async () => {
1302
- const l = new te(await n(li), await n(di));
1303
- return n(Nt), n(Xt), n(gi, n(ee)), n(nt, n(pn)), l;
1302
+ const d = new te(await n(li), await n(di));
1303
+ return n(Nt), n(Xt), n(gi, n(ee)), n(nt, n(pn)), d;
1304
1304
  });
1305
1305
  function c() {
1306
1306
  n(Nt), n(Xt);
@@ -1309,21 +1309,21 @@ function Ho(i) {
1309
1309
  e = !0, window.removeEventListener("resize", c), n(mi), n(yi);
1310
1310
  }), t(Cs, async () => {
1311
1311
  if (n(ee)) return;
1312
- let l = 0.01, h = 0.01, f = !1, p = 0;
1312
+ let d = 0.01, h = 0.01, f = !1, p = 0;
1313
1313
  n(gt, h), n(
1314
1314
  at,
1315
1315
  () => {
1316
1316
  if (e || o <= h) return;
1317
- h += (o - h) * l, n(gt, h);
1318
- let y = n(Es);
1319
- y && !p && (p = Date.now());
1317
+ h += (o - h) * d, n(gt, h);
1318
+ let m = n(Es);
1319
+ m && !p && (p = Date.now());
1320
1320
  let g = h / a;
1321
- y && (g > 0.9 || Date.now() - p > 2500) ? (n(pn) && n(fn, !0), n(gt, 0), f = !0) : y && g > 0.7 ? l = Math.min(l * 1.2, 0.3) : y && g > 0.5 ? l = Math.min(l * 1.2, 0.2) : g > 0.4 && (l = Math.min(l * 1.05, 0.1));
1321
+ m && (g > 0.9 || Date.now() - p > 2500) ? (n(pn) && n(fn, !0), n(gt, 0), f = !0) : m && g > 0.7 ? d = Math.min(d * 1.2, 0.3) : m && g > 0.5 ? d = Math.min(d * 1.2, 0.2) : g > 0.4 && (d = Math.min(d * 1.05, 0.1));
1322
1322
  },
1323
1323
  () => !e && !f,
1324
1324
  3
1325
1325
  );
1326
- }), t(fn, (l = !1) => {
1326
+ }), t(fn, (d = !1) => {
1327
1327
  if (n(ee)) return;
1328
1328
  for (; s.length; ) s.pop().stop = !0;
1329
1329
  const h = n(I), f = a * 1e-3;
@@ -1331,7 +1331,7 @@ function Ho(i) {
1331
1331
  s.push(p), n(
1332
1332
  at,
1333
1333
  () => {
1334
- e || (p.currentLightRadius += a * p.stepRate, n($t, p.currentLightRadius), p.currentLightRadius > a ? (n(nt, !p.currentPointMode), n($t, 0), p.stop = !0, s.length === 1 && s[0] === p && s.pop(), l && n(I)?.viewerEvents?.fire(dt), n(I)?.viewerEvents?.fire(Us)) : p.currentLightRadius / a < 0.4 ? p.stepRate = Math.min(p.stepRate * 1.02, 0.03) : p.stepRate *= 1.04);
1334
+ e || (p.currentLightRadius += a * p.stepRate, n($t, p.currentLightRadius), p.currentLightRadius > a ? (n(nt, !p.currentPointMode), n($t, 0), p.stop = !0, s.length === 1 && s[0] === p && s.pop(), d && n(I)?.viewerEvents?.fire(dt), n(I)?.viewerEvents?.fire(Us)) : p.currentLightRadius / a < 0.4 ? p.stepRate = Math.min(p.stepRate * 1.02, 0.03) : p.stepRate *= 1.04);
1335
1335
  },
1336
1336
  () => !e && !p.stop
1337
1337
  );
@@ -1357,30 +1357,30 @@ function Ho(i) {
1357
1357
  [Di]: { type: "int", value: 1 }
1358
1358
  }));
1359
1359
  const u = n(cs);
1360
- u.onmessage = (l) => {
1361
- const h = l.data;
1360
+ u.onmessage = (d) => {
1361
+ const h = d.data;
1362
1362
  h[Hi] && n(hi, h[Hi], h[Wi], h[ko], h[To], h[Yi]);
1363
- }, t(zs, (l, h, f) => {
1364
- n(ee) || (o = h, a = f), n(pi, l);
1363
+ }, t(zs, (d, h, f) => {
1364
+ n(ee) || (o = h, a = f), n(pi, d);
1365
1365
  });
1366
- function d(l) {
1367
- const h = l.xyz.slice(0);
1366
+ function l(d) {
1367
+ const h = d.xyz.slice(0);
1368
1368
  u.postMessage(
1369
1369
  {
1370
1370
  [Eo]: !0,
1371
1371
  [Po]: h,
1372
- [Qo]: l.watermarkCount,
1373
- [Wi]: l.index,
1374
- [xo]: l.version,
1375
- [Yi]: l.renderSplatCount,
1376
- [Co]: l.visibleSplatCount,
1377
- [Mo]: l.modelSplatCount,
1378
- [Lo]: l.minX,
1379
- [Fo]: l.maxX,
1380
- [Ro]: l.minY,
1381
- [Bo]: l.maxY,
1382
- [Uo]: l.minZ,
1383
- [Oo]: l.maxZ
1372
+ [Qo]: d.watermarkCount,
1373
+ [Wi]: d.index,
1374
+ [xo]: d.version,
1375
+ [Yi]: d.renderSplatCount,
1376
+ [Co]: d.visibleSplatCount,
1377
+ [Mo]: d.modelSplatCount,
1378
+ [Lo]: d.minX,
1379
+ [Fo]: d.maxX,
1380
+ [Ro]: d.minY,
1381
+ [Bo]: d.maxY,
1382
+ [Uo]: d.minZ,
1383
+ [Oo]: d.maxZ
1384
1384
  },
1385
1385
  [h.buffer]
1386
1386
  );
@@ -1397,30 +1397,30 @@ function Wo(i) {
1397
1397
  v.push([(k[b] % 20 - 10) * 0.02, ((k[b] / 20 | 0) - 10) * 0.02]);
1398
1398
  u.push(v);
1399
1399
  }
1400
- let d = [], l = r.split("");
1401
- for (let S = 0; S < l.length; S++)
1402
- d[S] = n.has(l[S]) ? 0.22 : 0.4;
1403
- let h = l.length / 2 | 0, f = d[h] / 2, p = !(l.length % 2), y = p ? 0 : -f;
1400
+ let l = [], d = r.split("");
1401
+ for (let S = 0; S < d.length; S++)
1402
+ l[S] = n.has(d[S]) ? 0.22 : 0.4;
1403
+ let h = d.length / 2 | 0, f = l[h] / 2, p = !(d.length % 2), m = p ? 0 : -f;
1404
1404
  for (let S = h - 1; S >= 0; S--) {
1405
- y -= d[S] / 2;
1406
- for (let v of u[S]) v[0] += y;
1407
- y -= d[S] / 2;
1405
+ m -= l[S] / 2;
1406
+ for (let v of u[S]) v[0] += m;
1407
+ m -= l[S] / 2;
1408
1408
  }
1409
- f = d[h] / 2, y = p ? 0 : f;
1409
+ f = l[h] / 2, m = p ? 0 : f;
1410
1410
  for (let S = u.length - h; S < u.length; S++) {
1411
- y += d[S] / 2;
1412
- for (let v of u[S]) v[0] += y;
1413
- y += d[S] / 2;
1411
+ m += l[S] / 2;
1412
+ for (let v of u[S]) v[0] += m;
1413
+ m += l[S] / 2;
1414
1414
  }
1415
1415
  let g = 0;
1416
1416
  for (let S of u)
1417
1417
  g += S.length;
1418
- const m = new Uint8Array(g * R);
1419
- let C = 0;
1418
+ const y = new Uint8Array(g * R);
1419
+ let M = 0;
1420
1420
  for (let S of u)
1421
1421
  for (let v of S)
1422
- m.set(await ao(v[0], v[1], o, s), R * C++);
1423
- return m;
1422
+ y.set(await ao(v[0], v[1], o, s), R * M++);
1423
+ return y;
1424
1424
  });
1425
1425
  }
1426
1426
  function Jn(i) {
@@ -1463,10 +1463,10 @@ function Yo(i) {
1463
1463
  },
1464
1464
  !0
1465
1465
  ), t(Ye, (r) => {
1466
- let c = [], u = Date.now(), d = 0;
1467
- for (const l of r.keys())
1468
- u - l <= 1e3 ? d++ : c.push(l);
1469
- return c.forEach((l) => r.delete(l)), Math.min(d, 30);
1466
+ let c = [], u = Date.now(), l = 0;
1467
+ for (const d of r.keys())
1468
+ u - d <= 1e3 ? l++ : c.push(d);
1469
+ return c.forEach((d) => r.delete(d)), Math.min(l, 30);
1470
1470
  }), window.addEventListener("beforeunload", () => n(Ht));
1471
1471
  }
1472
1472
  function Vo(i) {
@@ -1487,7 +1487,7 @@ function No(i) {
1487
1487
  let e = i.camera;
1488
1488
  if (!e) {
1489
1489
  const t = i.renderer.domElement, n = t.width / t.height;
1490
- let a = new M().fromArray(i.lookUp), o = new M().fromArray(i.lookAt), s = new M().fromArray(i.position);
1490
+ let a = new C().fromArray(i.lookUp), o = new C().fromArray(i.lookAt), s = new C().fromArray(i.position);
1491
1491
  e = new ns(i.fov, n, i.near, i.far), e.position.copy(s), e.up.copy(a).normalize(), e.lookAt(o), i.camera = e;
1492
1492
  }
1493
1493
  return i.camera;
@@ -1508,7 +1508,7 @@ class pe extends te {
1508
1508
  constructor(e) {
1509
1509
  super(), this.isSplatMesh = !0, this.disposed = !1;
1510
1510
  const t = new Xn(), n = (r, c, u) => t.on(r, c, u), a = (r, ...c) => t.fire(r, ...c), o = Vo(e), s = o.controls.object;
1511
- n(I, () => o), n(Ke, () => o.renderer.domElement), n(V, () => s), n(ft, () => s.fov), n(Be, (r = !1) => r ? s.position.clone() : s.position), n(Ce, (r = !1) => r ? o.controls.target.clone() : o.controls.target), n(hs, () => s.projectionMatrix.clone().multiply(s.matrixWorldInverse).multiply(this.matrix).toArray()), n(Ca, () => s.projectionMatrix.clone().multiply(s.matrixWorldInverse)), n(Qa, () => s.getWorldDirection(new M()).toArray()), n(ct, () => o.renderer), n(B, () => o.scene), n(ee, () => o.bigSceneMode), n(pn, () => o.pointcloudMode), n(ye, () => this), n(N, () => o.viewerEvents?.fire(J)), qn(t), Jn(t), go(t), $o(t), Ho(t), Wo(t), this.name = `${o.name || this.id}`, this.events = t, this.opts = o, (async () => (this.copy(await t.fire(gs)), o.matrix && this.applyMatrix4(o.matrix), this.frustumCulled = !1, this.onBeforeRender = () => {
1511
+ n(I, () => o), n(Ke, () => o.renderer.domElement), n(V, () => s), n(ft, () => s.fov), n(Be, (r = !1) => r ? s.position.clone() : s.position), n(Ce, (r = !1) => r ? o.controls.target.clone() : o.controls.target), n(hs, () => s.projectionMatrix.clone().multiply(s.matrixWorldInverse).multiply(this.matrix).toArray()), n(Ca, () => s.projectionMatrix.clone().multiply(s.matrixWorldInverse)), n(Qa, () => s.getWorldDirection(new C()).toArray()), n(ct, () => o.renderer), n(B, () => o.scene), n(ee, () => o.bigSceneMode), n(pn, () => o.pointcloudMode), n(ye, () => this), n(N, () => o.viewerEvents?.fire(J)), qn(t), Jn(t), go(t), $o(t), Ho(t), Wo(t), this.name = `${o.name || this.id}`, this.events = t, this.opts = o, (async () => (this.copy(await t.fire(gs)), o.matrix && this.applyMatrix4(o.matrix), this.frustumCulled = !1, this.onBeforeRender = () => {
1512
1512
  a(ps), a(ys, performance.now());
1513
1513
  }, this.onAfterRender = () => {
1514
1514
  a(Ss, 1e4) && a(N);
@@ -1547,16 +1547,16 @@ class pe extends te {
1547
1547
  }
1548
1548
  }
1549
1549
  class Ko extends In {
1550
- constructor(e = new M(0, 0, 1), t = new M(0, 0, 0), n = 1, a = 0.1, o = 16776960, s = n * 0.2, r = s * 0.2) {
1551
- super(), this._axis = new M(), this.type = "ArrowHelper";
1550
+ constructor(e = new C(0, 0, 1), t = new C(0, 0, 0), n = 1, a = 0.1, o = 16776960, s = n * 0.2, r = s * 0.2) {
1551
+ super(), this._axis = new C(), this.type = "ArrowHelper";
1552
1552
  const c = new ti(a, a, n, 32);
1553
1553
  c.translate(0, n / 2, 0);
1554
1554
  const u = new ti(0, r, s, 32);
1555
1555
  u.translate(0, n, 0), this.position.copy(t);
1556
- const d = new xe({ color: o, toneMapped: !1 });
1557
- d.side = we, this.line = new te(c, d), this.line.matrixAutoUpdate = !1, this.line.ignoreIntersect = !0, this.add(this.line);
1558
1556
  const l = new xe({ color: o, toneMapped: !1 });
1559
- l.side = we, this.cone = new te(u, l), this.cone.matrixAutoUpdate = !1, this.cone.ignoreIntersect = !0, this.add(this.cone), this.setDirection(e), this.renderOrder = 99999;
1557
+ l.side = we, this.line = new te(c, l), this.line.matrixAutoUpdate = !1, this.line.ignoreIntersect = !0, this.add(this.line);
1558
+ const d = new xe({ color: o, toneMapped: !1 });
1559
+ d.side = we, this.cone = new te(u, d), this.cone.matrixAutoUpdate = !1, this.cone.ignoreIntersect = !0, this.add(this.cone), this.setDirection(e), this.renderOrder = 99999;
1560
1560
  }
1561
1561
  setDirection(e) {
1562
1562
  if (e.y > 0.99999)
@@ -1580,25 +1580,25 @@ class Ko extends In {
1580
1580
  }
1581
1581
  }
1582
1582
  function Zo(i) {
1583
- const e = (y, g, m) => i.on(y, g, m), t = (y, ...g) => i.fire(y, ...g), n = new ua(1, 1);
1583
+ const e = (m, g, y) => i.on(m, g, y), t = (m, ...g) => i.fire(m, ...g), n = new ua(1, 1);
1584
1584
  n.rotateX(-Math.PI / 2);
1585
1585
  const a = new xe({ color: 16777215 });
1586
1586
  a.transparent = !0, a.opacity = 0.6, a.depthTest = !1, a.depthWrite = !1, a.side = we;
1587
1587
  const o = new te(n, a);
1588
1588
  o.ignoreIntersect = !0;
1589
- const s = new M(0, -1, 0);
1589
+ const s = new C(0, -1, 0);
1590
1590
  s.normalize();
1591
- const r = new M(0, 0, 0), c = 0.5, u = 0.01, d = 16777062, l = 0.1, h = 0.03, f = new Ko(s, r, c, u, d, l, h), p = new In();
1592
- p.add(o), p.add(f), p.renderOrder = 99999, o.renderOrder = 99999, p.visible = !1, t(B).add(p), e(La, () => p), e(Tt, (y) => {
1593
- t(Rt, !0), p.visible = y === void 0 ? !p.visible : y, t(J);
1594
- }), e(On, () => p.visible), e(Rt, (y = !1) => {
1595
- if (y || p.visible) {
1596
- const g = new _t(), m = new M(0, -1, 0);
1597
- g.setFromUnitVectors(m, t(Ne)), p.position.copy(t(Ce)), p.quaternion.copy(g);
1591
+ const r = new C(0, 0, 0), c = 0.5, u = 0.01, l = 16777062, d = 0.1, h = 0.03, f = new Ko(s, r, c, u, l, d, h), p = new In();
1592
+ p.add(o), p.add(f), p.renderOrder = 99999, o.renderOrder = 99999, p.visible = !1, t(B).add(p), e(La, () => p), e(Tt, (m) => {
1593
+ t(Rt, !0), p.visible = m === void 0 ? !p.visible : m, t(J);
1594
+ }), e(On, () => p.visible), e(Rt, (m = !1) => {
1595
+ if (m || p.visible) {
1596
+ const g = new _t(), y = new C(0, -1, 0);
1597
+ g.setFromUnitVectors(y, t(Ne)), p.position.copy(t(Ce)), p.quaternion.copy(g);
1598
1598
  }
1599
1599
  });
1600
1600
  }
1601
- const Gi = { type: "change" }, ei = { type: "start" }, ea = { type: "end" }, At = new pa(), Ni = new fa(), jo = Math.cos(70 * be.DEG2RAD), G = new M(), ae = 2 * Math.PI, H = {
1601
+ const Gi = { type: "change" }, ei = { type: "start" }, ea = { type: "end" }, At = new pa(), Ni = new fa(), jo = Math.cos(70 * be.DEG2RAD), G = new C(), ae = 2 * Math.PI, H = {
1602
1602
  NONE: -1,
1603
1603
  ROTATE: 0,
1604
1604
  DOLLY: 1,
@@ -1610,7 +1610,7 @@ const Gi = { type: "change" }, ei = { type: "start" }, ea = { type: "end" }, At
1610
1610
  }, nn = 1e-6;
1611
1611
  class ta extends ha {
1612
1612
  constructor(e, t = null) {
1613
- super(e, t), this.state = H.NONE, this.enabled = !0, 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.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: Ae.ROTATE, MIDDLE: Ae.DOLLY, RIGHT: Ae.PAN }, this.touches = { ONE: Se.ROTATE, TWO: Se.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this._lastPosition = new M(), this._lastQuaternion = new _t(), this._lastTargetPosition = new M(), this._quat = new _t().setFromUnitVectors(e.up, new M(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new ni(), this._sphericalDelta = new ni(), this._scale = 1, this._panOffset = new M(), this._rotateStart = new j(), this._rotateEnd = new j(), this._rotateDelta = new j(), this._panStart = new j(), this._panEnd = new j(), this._panDelta = new j(), this._dollyStart = new j(), this._dollyEnd = new j(), this._dollyDelta = new j(), this._dollyDirection = new M(), this._mouse = new j(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = Jo.bind(this), this._onPointerDown = qo.bind(this), this._onPointerUp = er.bind(this), this._onContextMenu = rr.bind(this), this._onMouseWheel = ir.bind(this), this._onKeyDown = sr.bind(this), this._onTouchStart = ar.bind(this), this._onTouchMove = or.bind(this), this._onMouseDown = tr.bind(this), this._onMouseMove = nr.bind(this), this._interceptControlDown = cr.bind(this), this._interceptControlUp = lr.bind(this), this.domElement !== null && this.connect(), this.update();
1613
+ super(e, t), this.state = H.NONE, this.enabled = !0, this.target = new C(), this.cursor = new C(), 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.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: Ae.ROTATE, MIDDLE: Ae.DOLLY, RIGHT: Ae.PAN }, this.touches = { ONE: Se.ROTATE, TWO: Se.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this._lastPosition = new C(), this._lastQuaternion = new _t(), this._lastTargetPosition = new C(), this._quat = new _t().setFromUnitVectors(e.up, new C(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new ni(), this._sphericalDelta = new ni(), this._scale = 1, this._panOffset = new C(), this._rotateStart = new j(), this._rotateEnd = new j(), this._rotateDelta = new j(), this._panStart = new j(), this._panEnd = new j(), this._panDelta = new j(), this._dollyStart = new j(), this._dollyEnd = new j(), this._dollyDelta = new j(), this._dollyDirection = new C(), this._mouse = new j(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = Jo.bind(this), this._onPointerDown = qo.bind(this), this._onPointerUp = er.bind(this), this._onContextMenu = rr.bind(this), this._onMouseWheel = ir.bind(this), this._onKeyDown = sr.bind(this), this._onTouchStart = ar.bind(this), this._onTouchMove = or.bind(this), this._onMouseDown = tr.bind(this), this._onMouseMove = nr.bind(this), this._interceptControlDown = cr.bind(this), this._interceptControlUp = lr.bind(this), this.domElement !== null && this.connect(), this.update();
1614
1614
  }
1615
1615
  connect() {
1616
1616
  this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointercancel", this._onPointerUp), this.domElement.addEventListener("contextmenu", this._onContextMenu), this.domElement.addEventListener("wheel", this._onMouseWheel, { passive: !1 }), this.domElement.getRootNode().addEventListener("keydown", this._interceptControlDown, { passive: !0, capture: !0 }), this.domElement.style.touchAction = "none";
@@ -1662,11 +1662,11 @@ class ta extends ha {
1662
1662
  const c = r - s;
1663
1663
  this.object.position.addScaledVector(this._dollyDirection, c), this.object.updateMatrixWorld(), o = !!c;
1664
1664
  } else if (this.object.isOrthographicCamera) {
1665
- const r = new M(this._mouse.x, this._mouse.y, 0);
1665
+ const r = new C(this._mouse.x, this._mouse.y, 0);
1666
1666
  r.unproject(this.object);
1667
1667
  const c = this.object.zoom;
1668
1668
  this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), this.object.updateProjectionMatrix(), o = c !== this.object.zoom;
1669
- const u = new M(this._mouse.x, this._mouse.y, 0);
1669
+ const u = new C(this._mouse.x, this._mouse.y, 0);
1670
1670
  u.unproject(this.object), this.object.position.sub(u).add(r), this.object.updateMatrixWorld(), s = G.length();
1671
1671
  } else
1672
1672
  console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
@@ -2030,7 +2030,7 @@ class dr extends ta {
2030
2030
  * 更新旋转轴
2031
2031
  */
2032
2032
  updateRotateAxis() {
2033
- this._quat?.setFromUnitVectors?.(this.object.up, new M(0, 1, 0)), this._quatInverse = this._quat?.clone?.()?.invert?.();
2033
+ this._quat?.setFromUnitVectors?.(this.object.up, new C(0, 1, 0)), this._quatInverse = this._quat?.clone?.()?.invert?.();
2034
2034
  }
2035
2035
  }
2036
2036
  class ur extends ta {
@@ -2038,7 +2038,7 @@ class ur extends ta {
2038
2038
  super(e, t), this.screenSpacePanning = !1, this.mouseButtons = { LEFT: Ae.PAN, MIDDLE: Ae.DOLLY, RIGHT: Ae.ROTATE }, this.touches = { ONE: Se.PAN, TWO: Se.DOLLY_ROTATE };
2039
2039
  }
2040
2040
  }
2041
- const Xi = new Dn(), wt = new M();
2041
+ const Xi = new Dn(), wt = new C();
2042
2042
  class na extends rn {
2043
2043
  constructor() {
2044
2044
  super(), this.isLineSegmentsGeometry = !0, this.type = "LineSegmentsGeometry";
@@ -2570,7 +2570,7 @@ class Xe extends _n {
2570
2570
  this.defines && (e === !0 !== this.alphaToCoverage && (this.needsUpdate = !0), e === !0 ? this.defines.USE_ALPHA_TO_COVERAGE = "" : delete this.defines.USE_ALPHA_TO_COVERAGE);
2571
2571
  }
2572
2572
  }
2573
- const sn = new ve(), $i = new M(), Ki = new M(), $ = new ve(), K = new ve(), de = new ve(), an = new M(), on = new $e(), Z = new ma(), Zi = new M(), vt = new Dn(), St = new tt(), ue = new ve();
2573
+ const sn = new ve(), $i = new C(), Ki = new C(), $ = new ve(), K = new ve(), de = new ve(), an = new C(), on = new $e(), Z = new ma(), Zi = new C(), vt = new Dn(), St = new tt(), ue = new ve();
2574
2574
  let ge, Fe;
2575
2575
  function ji(i, e, t) {
2576
2576
  return ue.set(0, 0, -e, 1).applyMatrix4(i.projectionMatrix), ue.multiplyScalar(1 / ue.w), ue.x = Fe / t.width, ue.y = Fe / t.height, ue.applyMatrix4(i.projectionMatrixInverse), ue.multiplyScalar(1 / ue.w), Math.abs(Math.max(ue.x, ue.y));
@@ -2579,11 +2579,11 @@ function hr(i, e) {
2579
2579
  const t = i.matrixWorld, n = i.geometry, a = n.attributes.instanceStart, o = n.attributes.instanceEnd, s = Math.min(n.instanceCount, a.count);
2580
2580
  for (let r = 0, c = s; r < c; r++) {
2581
2581
  Z.start.fromBufferAttribute(a, r), Z.end.fromBufferAttribute(o, r), Z.applyMatrix4(t);
2582
- const u = new M(), d = new M();
2583
- ge.distanceSqToSegment(Z.start, Z.end, d, u), d.distanceTo(u) < Fe * 0.5 && e.push({
2584
- point: d,
2582
+ const u = new C(), l = new C();
2583
+ ge.distanceSqToSegment(Z.start, Z.end, l, u), l.distanceTo(u) < Fe * 0.5 && e.push({
2584
+ point: l,
2585
2585
  pointOnLine: u,
2586
- distance: ge.origin.distanceTo(d),
2586
+ distance: ge.origin.distanceTo(l),
2587
2587
  object: i,
2588
2588
  face: null,
2589
2589
  faceIndex: r,
@@ -2593,25 +2593,25 @@ function hr(i, e) {
2593
2593
  }
2594
2594
  }
2595
2595
  function pr(i, e, t) {
2596
- const n = e.projectionMatrix, o = i.material.resolution, s = i.matrixWorld, r = i.geometry, c = r.attributes.instanceStart, u = r.attributes.instanceEnd, d = Math.min(r.instanceCount, c.count), l = -e.near;
2596
+ const n = e.projectionMatrix, o = i.material.resolution, s = i.matrixWorld, r = i.geometry, c = r.attributes.instanceStart, u = r.attributes.instanceEnd, l = Math.min(r.instanceCount, c.count), d = -e.near;
2597
2597
  ge.at(1, de), de.w = 1, de.applyMatrix4(e.matrixWorldInverse), de.applyMatrix4(n), de.multiplyScalar(1 / de.w), de.x *= o.x / 2, de.y *= o.y / 2, de.z = 0, an.copy(de), on.multiplyMatrices(e.matrixWorldInverse, s);
2598
- for (let h = 0, f = d; h < f; h++) {
2599
- if ($.fromBufferAttribute(c, h), K.fromBufferAttribute(u, h), $.w = 1, K.w = 1, $.applyMatrix4(on), K.applyMatrix4(on), $.z > l && K.z > l)
2598
+ for (let h = 0, f = l; h < f; h++) {
2599
+ if ($.fromBufferAttribute(c, h), K.fromBufferAttribute(u, h), $.w = 1, K.w = 1, $.applyMatrix4(on), K.applyMatrix4(on), $.z > d && K.z > d)
2600
2600
  continue;
2601
- if ($.z > l) {
2602
- const S = $.z - K.z, v = ($.z - l) / S;
2601
+ if ($.z > d) {
2602
+ const S = $.z - K.z, v = ($.z - d) / S;
2603
2603
  $.lerp(K, v);
2604
- } else if (K.z > l) {
2605
- const S = K.z - $.z, v = (K.z - l) / S;
2604
+ } else if (K.z > d) {
2605
+ const S = K.z - $.z, v = (K.z - d) / S;
2606
2606
  K.lerp($, v);
2607
2607
  }
2608
2608
  $.applyMatrix4(n), K.applyMatrix4(n), $.multiplyScalar(1 / $.w), K.multiplyScalar(1 / K.w), $.x *= o.x / 2, $.y *= o.y / 2, K.x *= o.x / 2, K.y *= o.y / 2, Z.start.copy($), Z.start.z = 0, Z.end.copy(K), Z.end.z = 0;
2609
- const y = Z.closestPointToPointParameter(an, !0);
2610
- Z.at(y, Zi);
2611
- const g = be.lerp($.z, K.z, y), m = g >= -1 && g <= 1, C = an.distanceTo(Zi) < Fe * 0.5;
2612
- if (m && C) {
2609
+ const m = Z.closestPointToPointParameter(an, !0);
2610
+ Z.at(m, Zi);
2611
+ const g = be.lerp($.z, K.z, m), y = g >= -1 && g <= 1, M = an.distanceTo(Zi) < Fe * 0.5;
2612
+ if (y && M) {
2613
2613
  Z.start.fromBufferAttribute(c, h), Z.end.fromBufferAttribute(u, h), Z.start.applyMatrix4(s), Z.end.applyMatrix4(s);
2614
- const S = new M(), v = new M();
2614
+ const S = new C(), v = new C();
2615
2615
  ge.distanceSqToSegment(Z.start, Z.end, v, S), t.push({
2616
2616
  point: v,
2617
2617
  pointOnLine: S,
@@ -2648,20 +2648,20 @@ class fr extends te {
2648
2648
  if (n)
2649
2649
  u = Fe * 0.5;
2650
2650
  else {
2651
- const l = Math.max(a.near, St.distanceToPoint(ge.origin));
2652
- u = ji(a, l, c.resolution);
2651
+ const d = Math.max(a.near, St.distanceToPoint(ge.origin));
2652
+ u = ji(a, d, c.resolution);
2653
2653
  }
2654
2654
  if (St.radius += u, ge.intersectsSphere(St) === !1)
2655
2655
  return;
2656
2656
  r.boundingBox === null && r.computeBoundingBox(), vt.copy(r.boundingBox).applyMatrix4(s);
2657
- let d;
2657
+ let l;
2658
2658
  if (n)
2659
- d = Fe * 0.5;
2659
+ l = Fe * 0.5;
2660
2660
  else {
2661
- const l = Math.max(a.near, vt.distanceToPoint(ge.origin));
2662
- d = ji(a, l, c.resolution);
2661
+ const d = Math.max(a.near, vt.distanceToPoint(ge.origin));
2662
+ l = ji(a, d, c.resolution);
2663
2663
  }
2664
- vt.expandByScalar(d), ge.intersectsBox(vt) !== !1 && (n ? hr(this, t) : pr(this, a, t));
2664
+ vt.expandByScalar(l), ge.intersectsBox(vt) !== !1 && (n ? hr(this, t) : pr(this, a, t));
2665
2665
  }
2666
2666
  onBeforeRender(e) {
2667
2667
  const t = this.material.uniforms;
@@ -2700,7 +2700,7 @@ class Re extends fr {
2700
2700
  super(e, t), this.isLine2 = !0, this.type = "Line2";
2701
2701
  }
2702
2702
  }
2703
- const qi = new M(), gr = new _t(), Ji = new M();
2703
+ const qi = new C(), gr = new _t(), Ji = new C();
2704
2704
  class mr extends In {
2705
2705
  constructor(e = document.createElement("div")) {
2706
2706
  super(), this.isCSS3DObject = !0, this.element = e, this.element.style.position = "absolute", this.element.style.pointerEvents = "auto", this.element.style.userSelect = "none", this.element.setAttribute("draggable", !1), this.addEventListener("removed", function() {
@@ -2733,60 +2733,60 @@ class Ar {
2733
2733
  c.style.overflow = "hidden", this.domElement = c;
2734
2734
  const u = document.createElement("div");
2735
2735
  u.style.transformOrigin = "0 0", u.style.pointerEvents = "none", c.appendChild(u);
2736
- const d = document.createElement("div");
2737
- d.style.transformStyle = "preserve-3d", u.appendChild(d), this.getSize = function() {
2736
+ const l = document.createElement("div");
2737
+ l.style.transformStyle = "preserve-3d", u.appendChild(l), this.getSize = function() {
2738
2738
  return {
2739
2739
  width: n,
2740
2740
  height: a
2741
2741
  };
2742
- }, this.render = function(g, m) {
2743
- const C = m.projectionMatrix.elements[5] * s;
2744
- m.view && m.view.enabled ? (u.style.transform = `translate( ${-m.view.offsetX * (n / m.view.width)}px, ${-m.view.offsetY * (a / m.view.height)}px )`, u.style.transform += `scale( ${m.view.fullWidth / m.view.width}, ${m.view.fullHeight / m.view.height} )`) : u.style.transform = "", g.matrixWorldAutoUpdate === !0 && g.updateMatrixWorld(), m.parent === null && m.matrixWorldAutoUpdate === !0 && m.updateMatrixWorld();
2742
+ }, this.render = function(g, y) {
2743
+ const M = y.projectionMatrix.elements[5] * s;
2744
+ y.view && y.view.enabled ? (u.style.transform = `translate( ${-y.view.offsetX * (n / y.view.width)}px, ${-y.view.offsetY * (a / y.view.height)}px )`, u.style.transform += `scale( ${y.view.fullWidth / y.view.width}, ${y.view.fullHeight / y.view.height} )`) : u.style.transform = "", g.matrixWorldAutoUpdate === !0 && g.updateMatrixWorld(), y.parent === null && y.matrixWorldAutoUpdate === !0 && y.updateMatrixWorld();
2745
2745
  let S, v;
2746
- m.isOrthographicCamera && (S = -(m.right + m.left) / 2, v = (m.top + m.bottom) / 2);
2747
- const k = m.view && m.view.enabled ? m.view.height / m.view.fullHeight : 1, b = m.isOrthographicCamera ? `scale( ${k} )scale(` + C + ")translate(" + l(S) + "px," + l(v) + "px)" + h(m.matrixWorldInverse) : `scale( ${k} )translateZ(` + C + "px)" + h(m.matrixWorldInverse), w = (m.isPerspectiveCamera ? "perspective(" + C + "px) " : "") + b + "translate(" + o + "px," + s + "px)";
2748
- r.camera.style !== w && (d.style.transform = w, r.camera.style = w), y(g, g, m);
2749
- }, this.setSize = function(g, m) {
2750
- n = g, a = m, o = n / 2, s = a / 2, c.style.width = g + "px", c.style.height = m + "px", u.style.width = g + "px", u.style.height = m + "px", d.style.width = g + "px", d.style.height = m + "px";
2746
+ y.isOrthographicCamera && (S = -(y.right + y.left) / 2, v = (y.top + y.bottom) / 2);
2747
+ const k = y.view && y.view.enabled ? y.view.height / y.view.fullHeight : 1, b = y.isOrthographicCamera ? `scale( ${k} )scale(` + M + ")translate(" + d(S) + "px," + d(v) + "px)" + h(y.matrixWorldInverse) : `scale( ${k} )translateZ(` + M + "px)" + h(y.matrixWorldInverse), w = (y.isPerspectiveCamera ? "perspective(" + M + "px) " : "") + b + "translate(" + o + "px," + s + "px)";
2748
+ r.camera.style !== w && (l.style.transform = w, r.camera.style = w), m(g, g, y);
2749
+ }, this.setSize = function(g, y) {
2750
+ n = g, a = y, o = n / 2, s = a / 2, c.style.width = g + "px", c.style.height = y + "px", u.style.width = g + "px", u.style.height = y + "px", l.style.width = g + "px", l.style.height = y + "px";
2751
2751
  };
2752
- function l(g) {
2752
+ function d(g) {
2753
2753
  return Math.abs(g) < 1e-10 ? 0 : g;
2754
2754
  }
2755
2755
  function h(g) {
2756
- const m = g.elements;
2757
- return "matrix3d(" + l(m[0]) + "," + l(-m[1]) + "," + l(m[2]) + "," + l(m[3]) + "," + l(m[4]) + "," + l(-m[5]) + "," + l(m[6]) + "," + l(m[7]) + "," + l(m[8]) + "," + l(-m[9]) + "," + l(m[10]) + "," + l(m[11]) + "," + l(m[12]) + "," + l(-m[13]) + "," + l(m[14]) + "," + l(m[15]) + ")";
2756
+ const y = g.elements;
2757
+ return "matrix3d(" + d(y[0]) + "," + d(-y[1]) + "," + d(y[2]) + "," + d(y[3]) + "," + d(y[4]) + "," + d(-y[5]) + "," + d(y[6]) + "," + d(y[7]) + "," + d(y[8]) + "," + d(-y[9]) + "," + d(y[10]) + "," + d(y[11]) + "," + d(y[12]) + "," + d(-y[13]) + "," + d(y[14]) + "," + d(y[15]) + ")";
2758
2758
  }
2759
2759
  function f(g) {
2760
- const m = g.elements;
2761
- return "translate(-50%,-50%)" + ("matrix3d(" + l(m[0]) + "," + l(m[1]) + "," + l(m[2]) + "," + l(m[3]) + "," + l(-m[4]) + "," + l(-m[5]) + "," + l(-m[6]) + "," + l(-m[7]) + "," + l(m[8]) + "," + l(m[9]) + "," + l(m[10]) + "," + l(m[11]) + "," + l(m[12]) + "," + l(m[13]) + "," + l(m[14]) + "," + l(m[15]) + ")");
2760
+ const y = g.elements;
2761
+ return "translate(-50%,-50%)" + ("matrix3d(" + d(y[0]) + "," + d(y[1]) + "," + d(y[2]) + "," + d(y[3]) + "," + d(-y[4]) + "," + d(-y[5]) + "," + d(-y[6]) + "," + d(-y[7]) + "," + d(y[8]) + "," + d(y[9]) + "," + d(y[10]) + "," + d(y[11]) + "," + d(y[12]) + "," + d(y[13]) + "," + d(y[14]) + "," + d(y[15]) + ")");
2762
2762
  }
2763
2763
  function p(g) {
2764
2764
  g.isCSS3DObject && (g.element.style.display = "none");
2765
- for (let m = 0, C = g.children.length; m < C; m++)
2766
- p(g.children[m]);
2765
+ for (let y = 0, M = g.children.length; y < M; y++)
2766
+ p(g.children[y]);
2767
2767
  }
2768
- function y(g, m, C, S) {
2768
+ function m(g, y, M, S) {
2769
2769
  if (g.visible === !1) {
2770
2770
  p(g);
2771
2771
  return;
2772
2772
  }
2773
2773
  if (g.isCSS3DObject) {
2774
- const v = g.layers.test(C.layers) === !0, k = g.element;
2774
+ const v = g.layers.test(M.layers) === !0, k = g.element;
2775
2775
  if (k.style.display = v === !0 ? "" : "none", v === !0) {
2776
- g.onBeforeRender(t, m, C);
2776
+ g.onBeforeRender(t, y, M);
2777
2777
  let b;
2778
- g.isCSS3DSprite ? (he.copy(C.matrixWorldInverse), he.transpose(), g.rotation2D !== 0 && he.multiply(yr.makeRotationZ(g.rotation2D)), g.matrixWorld.decompose(qi, gr, Ji), he.setPosition(qi), he.scale(Ji), he.elements[3] = 0, he.elements[7] = 0, he.elements[11] = 0, he.elements[15] = 1, b = f(he)) : b = f(g.matrixWorld);
2778
+ g.isCSS3DSprite ? (he.copy(M.matrixWorldInverse), he.transpose(), g.rotation2D !== 0 && he.multiply(yr.makeRotationZ(g.rotation2D)), g.matrixWorld.decompose(qi, gr, Ji), he.setPosition(qi), he.scale(Ji), he.elements[3] = 0, he.elements[7] = 0, he.elements[11] = 0, he.elements[15] = 1, b = f(he)) : b = f(g.matrixWorld);
2779
2779
  const x = r.objects.get(g);
2780
2780
  if (x === void 0 || x.style !== b) {
2781
2781
  k.style.transform = b;
2782
2782
  const w = { style: b };
2783
2783
  r.objects.set(g, w);
2784
2784
  }
2785
- k.parentNode !== d && d.appendChild(k), g.onAfterRender(t, m, C);
2785
+ k.parentNode !== l && l.appendChild(k), g.onAfterRender(t, y, M);
2786
2786
  }
2787
2787
  }
2788
2788
  for (let v = 0, k = g.children.length; v < k; v++)
2789
- y(g.children[v], m, C);
2789
+ m(g.children[v], y, M);
2790
2790
  }
2791
2791
  }
2792
2792
  }
@@ -2821,10 +2821,10 @@ class Cn extends Re {
2821
2821
  r.resolution.set(innerWidth, innerHeight), n.copy(new Re(s, r));
2822
2822
  const c = new De(0.05, 32), u = new xe({ color: 16777215, side: we });
2823
2823
  u.transparent = !0, u.opacity = 0.6;
2824
- const d = new te(c, u);
2825
- d.position.copy(e), d.isMark = !0;
2826
2824
  const l = new te(c, u);
2827
2825
  l.position.copy(e), l.isMark = !0;
2826
+ const d = new te(c, u);
2827
+ d.position.copy(e), d.isMark = !0;
2828
2828
  const h = document.createElement("div");
2829
2829
  h.innerHTML = `<div style='flex-direction: column;align-items: center;display: flex;pointer-events: none;margin-bottom: 40px;'>
2830
2830
  <span class="${o.name}-main-tag" style="color:${o.mainTagColor};background:${o.mainTagBackground};opacity:${o.mainTagOpacity};padding:1px 5px 2px 5px;border-radius: 4px;user-select: none;font-size: 12px;pointer-events: auto;">${o.title}</span>
@@ -2837,8 +2837,8 @@ class Cn extends Re {
2837
2837
  f.position.copy(e), f.element.style.pointerEvents = "none", f.scale.set(0.01, 0.01, 0.01), f.visible = o.mainTagVisible;
2838
2838
  const p = document.createElement("div");
2839
2839
  p.innerHTML = `<span class="${t}-distance-tag ${t}-distance-tag0" style="color:${o.distanceTagColor};background:${o.distanceTagBackground};opacity:${o.distanceTagOpacity};padding: 1px 5px;border-radius: 4px;margin-bottom: 5px;user-select: none;font-size: 12px;pointer-events: none;"></span>`, p.classList.add("mark-wrap-line", `${t}`, "distance-warp"), p.style.position = "absolute", p.style.borderRadius = "4px", p.style.pointerEvents = "none";
2840
- const y = new ie(p);
2841
- y.position.set(e.x, e.y, e.z), y.element.style.pointerEvents = "none", y.scale.set(8e-3, 8e-3, 8e-3), y.visible = !1, n.add(d, l, f, y), n.data = o, n.circleStart = d, n.circleEnd = l, n.css3dTag = y, n.css3dMainTag = f, n.events.fire(Me, n);
2840
+ const m = new ie(p);
2841
+ m.position.set(e.x, e.y, e.z), m.element.style.pointerEvents = "none", m.scale.set(8e-3, 8e-3, 8e-3), m.visible = !1, n.add(l, d, f, m), n.data = o, n.circleStart = l, n.circleEnd = d, n.css3dTag = m, n.css3dMainTag = f, n.events.fire(Me, n);
2842
2842
  }
2843
2843
  /**
2844
2844
  * 绘制更新
@@ -2848,9 +2848,9 @@ class Cn extends Re {
2848
2848
  const n = this;
2849
2849
  if (e?.endPoint) {
2850
2850
  t && (n.data.endPoint = [...e.endPoint]);
2851
- const a = new M().fromArray(n.data.startPoint), o = new M().fromArray(e.endPoint);
2851
+ const a = new C().fromArray(n.data.startPoint), o = new C().fromArray(e.endPoint);
2852
2852
  n.geometry.setPositions([...n.data.startPoint, ...e.endPoint]);
2853
- const s = new M((a.x + o.x) / 2, (a.y + o.y) / 2, (a.z + o.z) / 2);
2853
+ const s = new C((a.x + o.x) / 2, (a.y + o.y) / 2, (a.z + o.z) / 2);
2854
2854
  n.css3dTag.position.set(s.x, s.y, s.z);
2855
2855
  const r = o.clone().sub(a).normalize();
2856
2856
  n.circleStart.lookAt(n.circleStart.position.clone().add(r)), n.circleEnd.lookAt(n.circleEnd.position.clone().add(r));
@@ -2865,7 +2865,7 @@ class Cn extends Re {
2865
2865
  * 按米标比例尺重新计算更新渲染
2866
2866
  */
2867
2867
  updateByMeterScale(e) {
2868
- const t = this, n = new M().fromArray(t.data.startPoint), a = new M().fromArray(t.data.endPoint), o = (n.distanceTo(a) * e).toFixed(2) + " m";
2868
+ const t = this, n = new C().fromArray(t.data.startPoint), a = new C().fromArray(t.data.endPoint), o = (n.distanceTo(a) * e).toFixed(2) + " m";
2869
2869
  t.css3dTag.element.childNodes[0].innerText = o;
2870
2870
  }
2871
2871
  /**
@@ -2875,7 +2875,7 @@ class Cn extends Re {
2875
2875
  if (this.disposed) return;
2876
2876
  const t = this;
2877
2877
  t.data.endPoint = [...e.toArray()];
2878
- const n = new M().fromArray(t.data.startPoint), a = new M().fromArray(t.data.endPoint), o = new M((n.x + a.x) / 2, (n.y + a.y) / 2, (n.z + a.z) / 2);
2878
+ const n = new C().fromArray(t.data.startPoint), a = new C().fromArray(t.data.endPoint), o = new C((n.x + a.x) / 2, (n.y + a.y) / 2, (n.z + a.z) / 2);
2879
2879
  t.geometry.setPositions([...t.data.startPoint, ...t.data.endPoint]), t.css3dTag.position.set(o.x, o.y, o.z);
2880
2880
  const s = a.clone().sub(n).normalize();
2881
2881
  t.circleStart.lookAt(t.circleStart.position.clone().add(s)), t.circleEnd.lookAt(t.circleEnd.position.clone().add(s)), t.circleEnd.position.copy(a);
@@ -2883,8 +2883,8 @@ class Cn extends Re {
2883
2883
  t.css3dTag.visible = !0;
2884
2884
  const c = (r * t.events.fire(I).meterScale).toFixed(2) + " m";
2885
2885
  t.css3dTag.element.childNodes[0].innerText = c, t.events.fire(Te);
2886
- const u = parent?.onActiveMark, d = t.getMarkData(!0);
2887
- d.isNew = !0, d.meterScale = t.events.fire(I).meterScale, u?.(d);
2886
+ const u = parent?.onActiveMark, l = t.getMarkData(!0);
2887
+ l.isNew = !0, l.meterScale = t.events.fire(I).meterScale, u?.(l);
2888
2888
  }
2889
2889
  /**
2890
2890
  * 根据数据直接绘制
@@ -2907,32 +2907,32 @@ class Cn extends Re {
2907
2907
  distanceTagOpacity: e.distanceTagOpacity || 0.9,
2908
2908
  distanceTagVisible: e.distanceTagVisible === void 0 ? !0 : e.distanceTagVisible,
2909
2909
  title: e.title || "标记距离"
2910
- }, a = new M().fromArray(n.startPoint), o = new M().fromArray(n.endPoint), s = new M((a.x + o.x) / 2, (a.y + o.y) / 2, (a.z + o.z) / 2), r = new pt();
2910
+ }, a = new C().fromArray(n.startPoint), o = new C().fromArray(n.endPoint), s = new C((a.x + o.x) / 2, (a.y + o.y) / 2, (a.z + o.z) / 2), r = new pt();
2911
2911
  r.setPositions([...n.startPoint, ...n.endPoint]);
2912
2912
  const c = new Xe({ color: n.lineColor, linewidth: n.lineWidth });
2913
2913
  c.resolution.set(innerWidth, innerHeight), t.copy(new Re(r, c));
2914
- const u = new De(0.05, 32), d = new xe({ color: 16777215, side: we });
2915
- d.transparent = !0, d.opacity = 0.6;
2916
- const l = new te(u, d);
2917
- l.position.copy(a), l.isMark = !0;
2918
- const h = new te(u, d);
2914
+ const u = new De(0.05, 32), l = new xe({ color: 16777215, side: we });
2915
+ l.transparent = !0, l.opacity = 0.6;
2916
+ const d = new te(u, l);
2917
+ d.position.copy(a), d.isMark = !0;
2918
+ const h = new te(u, l);
2919
2919
  h.position.copy(o), h.isMark = !0;
2920
2920
  const f = o.clone().sub(a).normalize();
2921
- l.lookAt(l.position.clone().add(f)), h.lookAt(h.position.clone().add(f));
2922
- const p = n.name, y = document.createElement("div");
2923
- y.innerHTML = `<div style='flex-direction: column;align-items: center;display: flex;pointer-events: none;margin-bottom: 40px;'>
2921
+ d.lookAt(d.position.clone().add(f)), h.lookAt(h.position.clone().add(f));
2922
+ const p = n.name, m = document.createElement("div");
2923
+ m.innerHTML = `<div style='flex-direction: column;align-items: center;display: flex;pointer-events: none;margin-bottom: 40px;'>
2924
2924
  <span class="${p}-main-tag" style="color:${n.mainTagColor};background:${n.mainTagBackground};opacity:${n.mainTagOpacity};padding:1px 5px 2px 5px;border-radius: 4px;margin-bottom: 5px;user-select: none;font-size: 12px;pointer-events: auto;">${n.title}</span>
2925
- </div>`, y.classList.add("mark-wrap-line", `${n.name}`, "main-warp"), y.style.position = "absolute", y.style.borderRadius = "4px", y.style.cursor = "pointer", y.onclick = () => {
2925
+ </div>`, m.classList.add("mark-wrap-line", `${n.name}`, "main-warp"), m.style.position = "absolute", m.style.borderRadius = "4px", m.style.cursor = "pointer", m.onclick = () => {
2926
2926
  if (t.events.fire(I).markMode) return;
2927
2927
  const k = parent?.onActiveMark;
2928
2928
  k?.(t.getMarkData(!0)), t.events.fire(q);
2929
- }, y.oncontextmenu = (k) => k.preventDefault();
2930
- const g = new ie(y);
2929
+ }, m.oncontextmenu = (k) => k.preventDefault();
2930
+ const g = new ie(m);
2931
2931
  g.position.copy(a), g.element.style.pointerEvents = "none", g.scale.set(0.01, 0.01, 0.01), g.visible = n.mainTagVisible;
2932
- const C = (a.distanceTo(o) * t.events.fire(I).meterScale).toFixed(2) + " m", S = document.createElement("div");
2933
- S.innerHTML = `<span class="${p}-distance-tag ${p}-distance-tag0" style="color:${n.distanceTagColor};background:${n.distanceTagBackground};opacity:${n.distanceTagOpacity};padding: 1px 5px;border-radius: 4px;margin-bottom: 5px;user-select: none;font-size: 12px;pointer-events: none;">${C}</span>`, S.classList.add("mark-wrap-line", `${p}`, "distance-warp"), S.style.position = "absolute", S.style.borderRadius = "4px", S.style.pointerEvents = "none";
2932
+ const M = (a.distanceTo(o) * t.events.fire(I).meterScale).toFixed(2) + " m", S = document.createElement("div");
2933
+ S.innerHTML = `<span class="${p}-distance-tag ${p}-distance-tag0" style="color:${n.distanceTagColor};background:${n.distanceTagBackground};opacity:${n.distanceTagOpacity};padding: 1px 5px;border-radius: 4px;margin-bottom: 5px;user-select: none;font-size: 12px;pointer-events: none;">${M}</span>`, S.classList.add("mark-wrap-line", `${p}`, "distance-warp"), S.style.position = "absolute", S.style.borderRadius = "4px", S.style.pointerEvents = "none";
2934
2934
  const v = new ie(S);
2935
- v.position.copy(s), v.element.style.pointerEvents = "none", v.scale.set(8e-3, 8e-3, 8e-3), v.visible = n.distanceTagVisible, t.add(l, h, g, v), t.data = n, t.circleStart = l, t.circleEnd = h, t.css3dTag = v, t.css3dMainTag = g, t.events.fire(Me, t);
2935
+ v.position.copy(s), v.element.style.pointerEvents = "none", v.scale.set(8e-3, 8e-3, 8e-3), v.visible = n.distanceTagVisible, t.add(d, h, g, v), t.data = n, t.circleStart = d, t.circleEnd = h, t.css3dTag = v, t.css3dMainTag = g, t.events.fire(Me, t);
2936
2936
  }
2937
2937
  getMarkData(e = !1) {
2938
2938
  const t = { ...this.data };
@@ -2980,13 +2980,13 @@ class Mn extends Re {
2980
2980
  const o = this;
2981
2981
  if (n)
2982
2982
  if (a) {
2983
- const s = o.data.points.length, r = o.css3dTags.length - 1, c = new M().fromArray(o.data.points.slice(s - 6, s - 3)), u = n, d = new M((c.x + u.x) / 2, (c.y + u.y) / 2, (c.z + u.z) / 2), h = (c.distanceTo(u) * o.events.fire(I).meterScale).toFixed(2) + " m";
2984
- o.css3dTags[r].element.childNodes[0].innerText = h, o.css3dTags[r].position.set(d.x, d.y, d.z), o.css3dTags[r].visible = !0, o.data.points.pop(), o.data.points.pop(), o.data.points.pop(), o.data.points = [...o.data.points, ...n.toArray(), ...n.toArray()], o.css3dTags[o.css3dTags.length - 1].visible = !0, this.draw(this.data);
2983
+ const s = o.data.points.length, r = o.css3dTags.length - 1, c = new C().fromArray(o.data.points.slice(s - 6, s - 3)), u = n, l = new C((c.x + u.x) / 2, (c.y + u.y) / 2, (c.z + u.z) / 2), h = (c.distanceTo(u) * o.events.fire(I).meterScale).toFixed(2) + " m";
2984
+ o.css3dTags[r].element.childNodes[0].innerText = h, o.css3dTags[r].position.set(l.x, l.y, l.z), o.css3dTags[r].visible = !0, o.data.points.pop(), o.data.points.pop(), o.data.points.pop(), o.data.points = [...o.data.points, ...n.toArray(), ...n.toArray()], o.css3dTags[o.css3dTags.length - 1].visible = !0, this.draw(this.data);
2985
2985
  } else {
2986
2986
  const s = o.data.points.length;
2987
2987
  o.data.points[s - 3] = n.x, o.data.points[s - 2] = n.y, o.data.points[s - 1] = n.z;
2988
- const r = o.css3dTags.length - 1, c = new M().fromArray(o.data.points.slice(s - 6, s - 3)), u = new M().fromArray(o.data.points.slice(s - 3)), d = new M((c.x + u.x) / 2, (c.y + u.y) / 2, (c.z + u.z) / 2), l = c.distanceTo(u), h = (l * o.events.fire(I).meterScale).toFixed(2) + " m";
2989
- o.css3dTags[r].element.childNodes[0].innerText = h, o.geometry.setPositions([...o.data.points]), o.css3dTags[r].position.set(d.x, d.y, d.z), o.css3dTags[r].visible = a ? !0 : l > 0.5;
2988
+ const r = o.css3dTags.length - 1, c = new C().fromArray(o.data.points.slice(s - 6, s - 3)), u = new C().fromArray(o.data.points.slice(s - 3)), l = new C((c.x + u.x) / 2, (c.y + u.y) / 2, (c.z + u.z) / 2), d = c.distanceTo(u), h = (d * o.events.fire(I).meterScale).toFixed(2) + " m";
2989
+ o.css3dTags[r].element.childNodes[0].innerText = h, o.geometry.setPositions([...o.data.points]), o.css3dTags[r].position.set(l.x, l.y, l.z), o.css3dTags[r].visible = a ? !0 : d > 0.5;
2990
2990
  }
2991
2991
  e?.lineColor && (t && (o.data.lineColor = e.lineColor), o.material.color.set(e.lineColor)), e?.lineWidth && (t && (o.data.lineWidth = e.lineWidth), o.material.linewidth = e.lineWidth), e?.mainTagColor && (t && (o.data.mainTagColor = e.mainTagColor), document.querySelector(`.${o.data.name}-main-tag`).style.color = e.mainTagColor), e?.mainTagBackground && (t && (o.data.mainTagBackground = e.mainTagBackground), document.querySelector(`.${o.data.name}-main-tag`).style.background = e.mainTagBackground), e?.mainTagOpacity && (t && (o.data.mainTagOpacity = e.mainTagOpacity), document.querySelector(`.${o.data.name}-main-tag`).style.opacity = e.mainTagOpacity.toString()), e?.mainTagVisible !== void 0 && (t && (o.data.mainTagVisible = e.mainTagVisible), o.css3dMainTag.visible = e.mainTagVisible), e?.distanceTagColor && (t && (o.data.distanceTagColor = e.distanceTagColor), document.querySelectorAll(`.${o.data.name}-distance-tag`)?.forEach((r) => r.style.color = e.distanceTagColor)), e?.distanceTagBackground && (t && (o.data.distanceTagBackground = e.distanceTagBackground), document.querySelectorAll(`.${o.data.name}-distance-tag`)?.forEach((r) => r.style.background = e.distanceTagBackground)), e?.distanceTagOpacity && (t && (o.data.distanceTagOpacity = e.distanceTagOpacity), document.querySelectorAll(`.${o.data.name}-distance-tag`)?.forEach((r) => r.style.opacity = e.distanceTagOpacity.toString())), e?.distanceTagVisible !== void 0 && (t && (o.data.distanceTagVisible = e.distanceTagVisible), o.css3dTags.forEach((s) => s.visible = e.distanceTagVisible)), e?.title !== void 0 && (t && (o.data.title = e.title), this.css3dMainTag.element.querySelector(`.${o.data.name}-main-tag`).innerText = e.title), e?.note !== void 0 && t && (o.data.note = e.note), o.events.fire(J);
2992
2992
  }
@@ -2996,7 +2996,7 @@ class Mn extends Re {
2996
2996
  updateByMeterScale(e) {
2997
2997
  const t = this, n = [];
2998
2998
  for (let s = 0, r = t.data.points.length / 3; s < r; s++)
2999
- n.push(new M(t.data.points[s * 3], t.data.points[s * 3 + 1], t.data.points[s * 3 + 2]));
2999
+ n.push(new C(t.data.points[s * 3], t.data.points[s * 3 + 1], t.data.points[s * 3 + 2]));
3000
3000
  let a, o;
3001
3001
  for (let s = 1; s < n.length; s++)
3002
3002
  a = n[s - 1], o = n[s], t.css3dTags[s - 1].element.childNodes[0].innerText = (a.distanceTo(o) * e).toFixed(2) + " m";
@@ -3006,7 +3006,7 @@ class Mn extends Re {
3006
3006
  */
3007
3007
  drawFinish(e) {
3008
3008
  if (this.disposed) return;
3009
- const t = this, n = t.data.points.length, a = new M().fromArray(t.data.points.slice(n - 6, n - 3)), o = new M().fromArray(t.data.points.slice(n - 3));
3009
+ const t = this, n = t.data.points.length, a = new C().fromArray(t.data.points.slice(n - 6, n - 3)), o = new C().fromArray(t.data.points.slice(n - 3));
3010
3010
  if ((!e || a.distanceTo(o) < 1e-3) && (t.data.points.pop(), t.data.points.pop(), t.data.points.pop(), t.draw(t.data)), t.events.fire(Te), t.data.points.length < 6) {
3011
3011
  t.dispose();
3012
3012
  return;
@@ -3047,24 +3047,24 @@ class Mn extends Re {
3047
3047
  r.setPositions([...a.points]);
3048
3048
  const c = new Xe({ color: a.lineColor, linewidth: a.lineWidth });
3049
3049
  c.resolution.set(innerWidth, innerHeight), n.copy(new Re(r, c)), o?.dispose(), s?.dispose();
3050
- const u = a.name, d = a.points.length / 3 - 1;
3050
+ const u = a.name, l = a.points.length / 3 - 1;
3051
3051
  if (!n.css3dMainTag) {
3052
- const l = document.createElement("div");
3053
- l.innerHTML = `<div style='flex-direction: column;align-items: center;display: flex;pointer-events: none;margin-bottom: 40px;'>
3052
+ const d = document.createElement("div");
3053
+ d.innerHTML = `<div style='flex-direction: column;align-items: center;display: flex;pointer-events: none;margin-bottom: 40px;'>
3054
3054
  <span class="${u}-main-tag" style="color:${a.mainTagColor};background:${a.mainTagBackground};opacity:${a.mainTagOpacity};padding:1px 5px 2px 5px;border-radius: 4px;user-select: none;font-size: 12px;pointer-events: auto;">${a.title}</span>
3055
- </div>`, l.classList.add("mark-wrap-lines", `${a.name}`, "main-warp"), l.style.position = "absolute", l.style.borderRadius = "4px", l.style.cursor = "pointer", l.onclick = () => {
3055
+ </div>`, d.classList.add("mark-wrap-lines", `${a.name}`, "main-warp"), d.style.position = "absolute", d.style.borderRadius = "4px", d.style.cursor = "pointer", d.onclick = () => {
3056
3056
  if (n.events.fire(I).markMode) return;
3057
3057
  const f = parent?.onActiveMark, p = n.getMarkData(!0);
3058
3058
  p.meterScale = n.events.fire(I).meterScale, f?.(p), n.events.fire(q);
3059
- }, l.oncontextmenu = (f) => f.preventDefault();
3060
- const h = new ie(l);
3059
+ }, d.oncontextmenu = (f) => f.preventDefault();
3060
+ const h = new ie(d);
3061
3061
  h.position.set(a.points[0], a.points[1], a.points[2]), h.element.style.pointerEvents = "none", h.scale.set(0.01, 0.01, 0.01), h.visible = a.mainTagVisible, n.group.add(h), n.css3dMainTag = h;
3062
3062
  }
3063
- for (let l = n.css3dTags.length; l < d; l++) {
3064
- const h = new M().fromArray(a.points.slice(l * 3, l * 3 + 3)), f = new M().fromArray(a.points.slice(l * 3 + 3, l * 3 + 6)), p = new M((h.x + f.x) / 2, (h.y + f.y) / 2, (h.z + f.z) / 2), g = (h.distanceTo(f) * n.events.fire(I).meterScale).toFixed(2) + " m", m = document.createElement("div");
3065
- m.innerHTML = `<span class="${u}-distance-tag ${u}-distance-tag${l}" style="color:${a.distanceTagColor};background:${a.distanceTagBackground};opacity:${a.distanceTagOpacity};padding: 1px 5px;border-radius: 4px;margin-bottom: 5px;user-select: none;font-size: 12px;pointer-events: none;">${g}</span>`, m.classList.add("mark-wrap-lines", `${u}`, "distance-warp"), m.style.position = "absolute", m.style.borderRadius = "4px", m.style.display = "none";
3066
- const C = new ie(m);
3067
- C.position.copy(p), C.element.style.pointerEvents = "none", C.scale.set(8e-3, 8e-3, 8e-3), C.visible = a.distanceTagVisible, n.css3dTags.push(C), n.group.add(C);
3063
+ for (let d = n.css3dTags.length; d < l; d++) {
3064
+ const h = new C().fromArray(a.points.slice(d * 3, d * 3 + 3)), f = new C().fromArray(a.points.slice(d * 3 + 3, d * 3 + 6)), p = new C((h.x + f.x) / 2, (h.y + f.y) / 2, (h.z + f.z) / 2), g = (h.distanceTo(f) * n.events.fire(I).meterScale).toFixed(2) + " m", y = document.createElement("div");
3065
+ y.innerHTML = `<span class="${u}-distance-tag ${u}-distance-tag${d}" style="color:${a.distanceTagColor};background:${a.distanceTagBackground};opacity:${a.distanceTagOpacity};padding: 1px 5px;border-radius: 4px;margin-bottom: 5px;user-select: none;font-size: 12px;pointer-events: none;">${g}</span>`, y.classList.add("mark-wrap-lines", `${u}`, "distance-warp"), y.style.position = "absolute", y.style.borderRadius = "4px", y.style.display = "none";
3066
+ const M = new ie(y);
3067
+ M.position.copy(p), M.element.style.pointerEvents = "none", M.scale.set(8e-3, 8e-3, 8e-3), M.visible = a.distanceTagVisible, n.css3dTags.push(M), n.group.add(M);
3068
3068
  }
3069
3069
  t || (n.css3dTags[n.css3dTags.length - 1].visible = !1), n.data = a, n.events.fire(Me, n);
3070
3070
  }
@@ -3083,7 +3083,7 @@ class ia extends Qt {
3083
3083
  super(), this.isMark = !0, this.disposed = !1, this.events = e;
3084
3084
  const a = this;
3085
3085
  let o;
3086
- if (t instanceof M) {
3086
+ if (t instanceof C) {
3087
3087
  const c = document.querySelectorAll(".mark-wrap-point").length + 1;
3088
3088
  o = {
3089
3089
  type: "MarkSinglePoint",
@@ -3210,13 +3210,13 @@ class Tn extends Re {
3210
3210
  const o = this;
3211
3211
  if (n)
3212
3212
  if (a) {
3213
- const s = o.data.points.length, r = o.css3dTags.length - 1, c = new M().fromArray(o.data.points.slice(s - 6, s - 3)), u = n, d = new M((c.x + u.x) / 2, (c.y + u.y) / 2, (c.z + u.z) / 2), h = (c.distanceTo(u) * o.events.fire(I).meterScale).toFixed(2) + " m";
3214
- o.css3dTags[r].element.innerText = h, o.css3dTags[r].position.set(d.x, d.y, d.z), o.css3dTags[r].visible = !0, o.data.points.pop(), o.data.points.pop(), o.data.points.pop(), o.data.points = [...o.data.points, ...n.toArray(), ...n.toArray()], this.draw(this.data);
3213
+ const s = o.data.points.length, r = o.css3dTags.length - 1, c = new C().fromArray(o.data.points.slice(s - 6, s - 3)), u = n, l = new C((c.x + u.x) / 2, (c.y + u.y) / 2, (c.z + u.z) / 2), h = (c.distanceTo(u) * o.events.fire(I).meterScale).toFixed(2) + " m";
3214
+ o.css3dTags[r].element.innerText = h, o.css3dTags[r].position.set(l.x, l.y, l.z), o.css3dTags[r].visible = !0, o.data.points.pop(), o.data.points.pop(), o.data.points.pop(), o.data.points = [...o.data.points, ...n.toArray(), ...n.toArray()], this.draw(this.data);
3215
3215
  } else {
3216
3216
  const s = o.data.points.length;
3217
3217
  o.data.points[s - 3] = n.x, o.data.points[s - 2] = n.y, o.data.points[s - 1] = n.z;
3218
- const r = o.css3dTags.length - 1, c = new M().fromArray(o.data.points.slice(s - 6, s - 3)), u = new M().fromArray(o.data.points.slice(s - 3)), d = new M((c.x + u.x) / 2, (c.y + u.y) / 2, (c.z + u.z) / 2), l = c.distanceTo(u), h = (l * o.events.fire(I).meterScale).toFixed(2) + " m";
3219
- o.css3dTags[r].element.innerText = h, o.geometry.setPositions([...o.data.points]), o.css3dTags[r].position.set(d.x, d.y, d.z), o.css3dTags[r].visible = a ? !0 : l > 0.5, o.meshPlans.geometry.setAttribute("position", new He(new Float32Array(o.data.points), 3)), o.meshPlans.geometry.attributes.position.needsUpdate = !0;
3218
+ const r = o.css3dTags.length - 1, c = new C().fromArray(o.data.points.slice(s - 6, s - 3)), u = new C().fromArray(o.data.points.slice(s - 3)), l = new C((c.x + u.x) / 2, (c.y + u.y) / 2, (c.z + u.z) / 2), d = c.distanceTo(u), h = (d * o.events.fire(I).meterScale).toFixed(2) + " m";
3219
+ o.css3dTags[r].element.innerText = h, o.geometry.setPositions([...o.data.points]), o.css3dTags[r].position.set(l.x, l.y, l.z), o.css3dTags[r].visible = a ? !0 : d > 0.5, o.meshPlans.geometry.setAttribute("position", new He(new Float32Array(o.data.points), 3)), o.meshPlans.geometry.attributes.position.needsUpdate = !0;
3220
3220
  const f = o.events.fire(ln, o.data.points);
3221
3221
  o.css3dAreaTag.position.copy(f);
3222
3222
  const p = o.events.fire(dn, o.data.points);
@@ -3245,7 +3245,7 @@ class Tn extends Re {
3245
3245
  updateByMeterScale(e) {
3246
3246
  const t = this, n = [];
3247
3247
  for (let r = 0, c = t.data.points.length / 3; r < c; r++)
3248
- n.push(new M(t.data.points[r * 3], t.data.points[r * 3 + 1], t.data.points[r * 3 + 2]));
3248
+ n.push(new C(t.data.points[r * 3], t.data.points[r * 3 + 1], t.data.points[r * 3 + 2]));
3249
3249
  let a, o;
3250
3250
  for (let r = 1; r < n.length; r++)
3251
3251
  a = n[r - 1], o = n[r], t.css3dTags[r - 1].element.innerText = (a.distanceTo(o) * e).toFixed(2) + " m";
@@ -3257,7 +3257,7 @@ class Tn extends Re {
3257
3257
  */
3258
3258
  drawFinish(e) {
3259
3259
  if (this.disposed) return;
3260
- const t = this, n = t.data.points.length, a = new M().fromArray(t.data.points.slice(n - 6, n - 3)), o = new M().fromArray(t.data.points.slice(n - 3));
3260
+ const t = this, n = t.data.points.length, a = new C().fromArray(t.data.points.slice(n - 6, n - 3)), o = new C().fromArray(t.data.points.slice(n - 3));
3261
3261
  if ((!e || a.distanceTo(o) < 1e-4) && (t.data.points.pop(), t.data.points.pop(), t.data.points.pop()), t.events.fire(Te), t.data.points.length < 9) {
3262
3262
  t.dispose();
3263
3263
  return;
@@ -3299,32 +3299,32 @@ class Tn extends Re {
3299
3299
  r.setPositions([...a.points]);
3300
3300
  const c = new Xe({ color: a.lineColor, linewidth: a.lineWidth });
3301
3301
  c.resolution.set(innerWidth, innerHeight), n.copy(new Re(r, c)), o?.dispose(), s?.dispose();
3302
- const u = a.name, d = a.points.length / 3 - 1;
3302
+ const u = a.name, l = a.points.length / 3 - 1;
3303
3303
  if (!n.css3dMainTag) {
3304
3304
  const f = document.createElement("div");
3305
3305
  f.innerHTML = `<div style='flex-direction: column;align-items: center;display: flex;pointer-events: none;margin-bottom: 40px;'>
3306
3306
  <span class="${u}-main-tag" style="color:${a.mainTagColor};background:${a.mainTagBackground};opacity:${a.mainTagOpacity};padding:1px 5px 2px 5px;border-radius: 4px;user-select: none;font-size: 12px;pointer-events: auto;">${a.title}</span>
3307
3307
  </div>`, f.classList.add("mark-wrap-plans", `${a.name}`, "main-warp"), f.style.position = "absolute", f.style.borderRadius = "4px", f.style.cursor = "pointer", f.onclick = () => {
3308
3308
  if (n.events.fire(I).markMode) return;
3309
- const y = parent?.onActiveMark, g = n.getMarkData(!0);
3310
- g.meterScale = n.events.fire(I).meterScale, y?.(g), n.events.fire(q);
3311
- }, f.oncontextmenu = (y) => y.preventDefault();
3309
+ const m = parent?.onActiveMark, g = n.getMarkData(!0);
3310
+ g.meterScale = n.events.fire(I).meterScale, m?.(g), n.events.fire(q);
3311
+ }, f.oncontextmenu = (m) => m.preventDefault();
3312
3312
  const p = new ie(f);
3313
3313
  p.position.set(a.points[0], a.points[1], a.points[2]), p.element.style.pointerEvents = "none", p.scale.set(0.01, 0.01, 0.01), p.visible = a.mainTagVisible, n.group.add(p), n.css3dMainTag = p;
3314
3314
  }
3315
- const l = n.events.fire(dn, a.points).toFixed(2) + " m²", h = n.events.fire(ln, a.points);
3315
+ const d = n.events.fire(dn, a.points).toFixed(2) + " m²", h = n.events.fire(ln, a.points);
3316
3316
  if (n.css3dAreaTag)
3317
- n.css3dAreaTag.position.copy(h), n.css3dAreaTag.element.childNodes[0].innerText = l;
3317
+ n.css3dAreaTag.position.copy(h), n.css3dAreaTag.element.childNodes[0].innerText = d;
3318
3318
  else {
3319
3319
  const f = document.createElement("div");
3320
- f.innerHTML = `<span class="${u}-area-tag" style="color:${a.areaTagColor};background:${a.areaTagBackground};opacity:${a.areaTagOpacity};padding:1px 5px 2px 5px;border-radius: 4px;user-select: none;font-size: 12px;pointer-events: none;">${l}</span>`, f.classList.add("mark-wrap-plans", `${a.name}`, "area-warp"), f.style.position = "absolute", f.style.borderRadius = "4px";
3320
+ f.innerHTML = `<span class="${u}-area-tag" style="color:${a.areaTagColor};background:${a.areaTagBackground};opacity:${a.areaTagOpacity};padding:1px 5px 2px 5px;border-radius: 4px;user-select: none;font-size: 12px;pointer-events: none;">${d}</span>`, f.classList.add("mark-wrap-plans", `${a.name}`, "area-warp"), f.style.position = "absolute", f.style.borderRadius = "4px";
3321
3321
  const p = new ie(f);
3322
3322
  p.position.copy(h), p.element.style.pointerEvents = "none", p.scale.set(0.01, 0.01, 0.01), n.group.add(p), n.css3dAreaTag = p;
3323
3323
  }
3324
3324
  n.css3dAreaTag.visible = a.points.length > 6 && a.areaTagVisible;
3325
- for (let f = n.css3dTags.length; f < d; f++) {
3326
- const p = new M().fromArray(a.points.slice(f * 3, f * 3 + 3)), y = new M().fromArray(a.points.slice(f * 3 + 3, f * 3 + 6)), g = new M((p.x + y.x) / 2, (p.y + y.y) / 2, (p.z + y.z) / 2), C = (p.distanceTo(y) * n.events.fire(I).meterScale).toFixed(2) + " m", S = document.createElement("div");
3327
- S.innerText = C, S.style.color = "white", S.classList.add("mark-wrap-plans", `${u}`, "distance-warp"), S.style.position = "absolute", S.style.borderRadius = "4px", S.style.display = "none";
3325
+ for (let f = n.css3dTags.length; f < l; f++) {
3326
+ const p = new C().fromArray(a.points.slice(f * 3, f * 3 + 3)), m = new C().fromArray(a.points.slice(f * 3 + 3, f * 3 + 6)), g = new C((p.x + m.x) / 2, (p.y + m.y) / 2, (p.z + m.z) / 2), M = (p.distanceTo(m) * n.events.fire(I).meterScale).toFixed(2) + " m", S = document.createElement("div");
3327
+ S.innerText = M, S.style.color = "white", S.classList.add("mark-wrap-plans", `${u}`, "distance-warp"), S.style.position = "absolute", S.style.borderRadius = "4px", S.style.display = "none";
3328
3328
  const v = new ie(S);
3329
3329
  v.position.copy(g), v.element.style.pointerEvents = "none", v.scale.set(8e-3, 8e-3, 8e-3), v.visible = a.distanceTagVisible, n.css3dTags.push(v), n.group.add(v);
3330
3330
  }
@@ -3348,7 +3348,7 @@ class Tn extends Re {
3348
3348
  if (e.points.length > 6) {
3349
3349
  t.meshPlans.geometry.setAttribute("position", new He(new Float32Array(e.points), 3)), t.meshPlans.geometry.attributes.position.needsUpdate = !0;
3350
3350
  let n = e.points.length / 3 - 2;
3351
- const a = new M().fromArray(e.points.slice(0, 3)), o = new M().fromArray(e.points.slice(-3));
3351
+ const a = new C().fromArray(e.points.slice(0, 3)), o = new C().fromArray(e.points.slice(-3));
3352
3352
  a.distanceTo(o) < 1e-4 && n--;
3353
3353
  const s = new Uint16Array(n * 3);
3354
3354
  for (let r = 0; r < n; r++)
@@ -3395,22 +3395,22 @@ class sa extends Qt {
3395
3395
  r.opacity = o.circleOpacity;
3396
3396
  const c = new te(s, r);
3397
3397
  c.position.copy(e), c.isMark = !0, c.renderOrder = 1;
3398
- const u = new M(0, 1, 0).normalize();
3398
+ const u = new C(0, 1, 0).normalize();
3399
3399
  c.lookAt(c.position.clone().add(u));
3400
- const d = document.createElement("div");
3401
- d.innerHTML = `<div style='flex-direction: column;align-items: center;display: flex;pointer-events: none;margin-bottom: 40px;'>
3400
+ const l = document.createElement("div");
3401
+ l.innerHTML = `<div style='flex-direction: column;align-items: center;display: flex;pointer-events: none;margin-bottom: 40px;'>
3402
3402
  <span class="${o.name}-main-tag" style="color:${o.mainTagColor};background:${o.mainTagBackground};opacity:${o.mainTagOpacity};padding:1px 5px 2px 5px;border-radius: 4px;user-select: none;font-size: 12px;pointer-events: auto;">${o.title}</span>
3403
- </div>`, d.classList.add("mark-wrap-circle", `${o.name}`, "main-warp"), d.style.position = "absolute", d.style.borderRadius = "4px", d.style.cursor = "pointer", d.onclick = () => {
3403
+ </div>`, l.classList.add("mark-wrap-circle", `${o.name}`, "main-warp"), l.style.position = "absolute", l.style.borderRadius = "4px", l.style.cursor = "pointer", l.onclick = () => {
3404
3404
  if (n.events.fire(I).markMode) return;
3405
3405
  const p = parent?.onActiveMark;
3406
3406
  p?.(n.getMarkData(!0)), n.events.fire(q);
3407
- }, d.oncontextmenu = (p) => p.preventDefault();
3408
- const l = new ie(d);
3409
- l.position.copy(e), l.element.style.pointerEvents = "none", l.scale.set(0.01, 0.01, 0.01), l.visible = o.mainTagVisible;
3407
+ }, l.oncontextmenu = (p) => p.preventDefault();
3408
+ const d = new ie(l);
3409
+ d.position.copy(e), d.element.style.pointerEvents = "none", d.scale.set(0.01, 0.01, 0.01), d.visible = o.mainTagVisible;
3410
3410
  const h = document.createElement("div");
3411
3411
  h.innerHTML = `<span class="${t}-circle-tag" style="color:${o.circleTagColor};background:${o.circleTagBackground};opacity:${o.circleTagOpacity};padding: 1px 5px;border-radius: 4px;margin-bottom: 5px;user-select: none;font-size: 12px;pointer-events: none;"></span>`, h.classList.add("mark-wrap-circle", `${t}`, "circle-warp"), h.style.position = "absolute", h.style.borderRadius = "4px", h.style.pointerEvents = "none";
3412
3412
  const f = new ie(h);
3413
- f.position.set(e.x + Math.min(o.radius / 2, 0.5), e.y, e.z), f.element.style.pointerEvents = "none", f.scale.set(8e-3, 8e-3, 8e-3), f.visible = !1, n.add(c, l, f), n.data = o, n.circleMesh = c, n.css3dTag = f, n.css3dMainTag = l, n.events.fire(Me, n);
3413
+ f.position.set(e.x + Math.min(o.radius / 2, 0.5), e.y, e.z), f.element.style.pointerEvents = "none", f.scale.set(8e-3, 8e-3, 8e-3), f.visible = !1, n.add(c, d, f), n.data = o, n.circleMesh = c, n.css3dTag = f, n.css3dMainTag = d, n.events.fire(Me, n);
3414
3414
  }
3415
3415
  /**
3416
3416
  * 绘制更新
@@ -3419,13 +3419,13 @@ class sa extends Qt {
3419
3419
  if (this.disposed) return;
3420
3420
  const a = this;
3421
3421
  if (n) {
3422
- const o = new M().fromArray(a.data.startPoint), s = o.distanceTo(new M(n.x, o.y, n.z));
3422
+ const o = new C().fromArray(a.data.startPoint), s = o.distanceTo(new C(n.x, o.y, n.z));
3423
3423
  t && (a.data.radius = s), a.circleMesh.geometry.copy(new De(s, 128)), a.css3dTag.visible = s > 0.3;
3424
3424
  const r = s * a.events.fire(I).meterScale, c = (Math.PI * r * r).toFixed(2) + " m²";
3425
3425
  a.css3dTag.element.childNodes[0].innerText = c, a.css3dTag.position.set(o.x + Math.min(a.data.radius / 2, 0.5), o.y, o.z);
3426
3426
  }
3427
3427
  if (e?.radius) {
3428
- const o = new M().fromArray(a.data.startPoint), s = e?.radius;
3428
+ const o = new C().fromArray(a.data.startPoint), s = e?.radius;
3429
3429
  t && (a.data.radius = s), a.circleMesh.geometry.copy(new De(s, 128)), a.css3dTag.visible = s > 0.3;
3430
3430
  const r = s * a.events.fire(I).meterScale, c = (Math.PI * r * r).toFixed(2) + " m²";
3431
3431
  a.css3dTag.element.childNodes[0].innerText = c, a.css3dTag.position.set(o.x + Math.min(s / 2, 0.5), o.y, o.z);
@@ -3444,7 +3444,7 @@ class sa extends Qt {
3444
3444
  */
3445
3445
  drawFinish(e) {
3446
3446
  if (this.disposed) return;
3447
- const t = this, n = new M().fromArray(t.data.startPoint), a = n.distanceTo(new M(e.x, n.y, e.z));
3447
+ const t = this, n = new C().fromArray(t.data.startPoint), a = n.distanceTo(new C(e.x, n.y, e.z));
3448
3448
  t.data.radius = a, t.circleMesh.geometry.copy(new De(a, 128));
3449
3449
  const o = t.data.radius * t.events.fire(I).meterScale, s = (Math.PI * o * o).toFixed(2) + " m²";
3450
3450
  t.css3dTag.element.childNodes[0].innerText = s, t.events.fire(Te);
@@ -3476,7 +3476,7 @@ class sa extends Qt {
3476
3476
  o.opacity = n.circleOpacity;
3477
3477
  const s = new te(a, o);
3478
3478
  s.position.fromArray(n.startPoint), s.isMark = !0, s.renderOrder = 1;
3479
- const r = new M(0, 1, 0).normalize();
3479
+ const r = new C(0, 1, 0).normalize();
3480
3480
  s.lookAt(s.position.clone().add(r));
3481
3481
  const c = n.name, u = document.createElement("div");
3482
3482
  u.innerHTML = `<div style='flex-direction: column;align-items: center;display: flex;pointer-events: none;margin-bottom: 40px;'>
@@ -3486,12 +3486,12 @@ class sa extends Qt {
3486
3486
  const g = parent?.onActiveMark;
3487
3487
  g?.(t.getMarkData(!0)), t.events.fire(q);
3488
3488
  }, u.oncontextmenu = (g) => g.preventDefault();
3489
- const d = new M().fromArray(n.startPoint), l = n.radius * t.events.fire(I).meterScale, h = (Math.PI * l * l).toFixed(2) + " m²", f = new ie(u);
3490
- f.position.copy(d), f.element.style.pointerEvents = "none", f.scale.set(0.01, 0.01, 0.01), f.visible = n.mainTagVisible;
3489
+ const l = new C().fromArray(n.startPoint), d = n.radius * t.events.fire(I).meterScale, h = (Math.PI * d * d).toFixed(2) + " m²", f = new ie(u);
3490
+ f.position.copy(l), f.element.style.pointerEvents = "none", f.scale.set(0.01, 0.01, 0.01), f.visible = n.mainTagVisible;
3491
3491
  const p = document.createElement("div");
3492
3492
  p.innerHTML = `<span class="${c}-distance-tag ${c}-circle-tag" style="color:${n.circleTagColor};background:${n.circleTagBackground};opacity:${n.circleTagOpacity};padding: 1px 5px;border-radius: 4px;margin-bottom: 5px;user-select: none;font-size: 12px;pointer-events: none;">${h}</span>`, p.classList.add("mark-wrap-circle", `${c}`, "circle-warp"), p.style.position = "absolute", p.style.borderRadius = "4px", p.style.pointerEvents = "none";
3493
- const y = new ie(p);
3494
- y.position.set(d.x + Math.min(n.radius / 2, 0.5), d.y, d.z), y.element.style.pointerEvents = "none", y.scale.set(8e-3, 8e-3, 8e-3), y.visible = n.circleTagVisible, t.add(s, f, y), t.data = n, t.circleMesh = s, t.css3dTag = y, t.css3dMainTag = f, t.events.fire(Me, t);
3493
+ const m = new ie(p);
3494
+ m.position.set(l.x + Math.min(n.radius / 2, 0.5), l.y, l.z), m.element.style.pointerEvents = "none", m.scale.set(8e-3, 8e-3, 8e-3), m.visible = n.circleTagVisible, t.add(s, f, m), t.data = n, t.circleMesh = s, t.css3dTag = m, t.css3dMainTag = f, t.events.fire(Me, t);
3495
3495
  }
3496
3496
  getMarkData(e = !1) {
3497
3497
  const t = { ...this.data };
@@ -3517,7 +3517,7 @@ function vr(i) {
3517
3517
  t(Y).autoRotate = t(I).autoRotate = !1, w && t(zt);
3518
3518
  }), e(Kt, (w = !0) => {
3519
3519
  if (o) return;
3520
- const D = t(Y), _ = w ? Math.PI / 128 : -(Math.PI / 128), T = new $e().makeRotationAxis(new M(0, 0, -1).transformDirection(D.object.matrixWorld), _);
3520
+ const D = t(Y), _ = w ? Math.PI / 128 : -(Math.PI / 128), T = new $e().makeRotationAxis(new C(0, 0, -1).transformDirection(D.object.matrixWorld), _);
3521
3521
  D.object.up.transformDirection(T), t(J);
3522
3522
  }), e(Ai, () => {
3523
3523
  o || i.fire(Kt, !0);
@@ -3551,7 +3551,7 @@ function vr(i) {
3551
3551
  const _ = t(B), T = [];
3552
3552
  _.traverse((E) => E instanceof pe && T.push(E));
3553
3553
  const F = await t(Ft, w, D);
3554
- return F.length ? (T.length && T[0].fire(Ct, F[0].x, F[0].y, F[0].z, !0), new M(F[0].x, F[0].y, F[0].z)) : (T.length && T[0].fire(Ct, 0, 0, 0, !1), null);
3554
+ return F.length ? (T.length && T[0].fire(Ct, F[0].x, F[0].y, F[0].z, !0), new C(F[0].x, F[0].y, F[0].z)) : (T.length && T[0].fire(Ct, 0, 0, 0, !1), null);
3555
3555
  }), e(Un, async () => {
3556
3556
  const w = t(B), D = [];
3557
3557
  w.traverse((_) => _ instanceof pe && D.push(_));
@@ -3570,31 +3570,31 @@ function vr(i) {
3570
3570
  },
3571
3571
  !0
3572
3572
  );
3573
- const d = () => {
3573
+ const l = () => {
3574
3574
  a.clear();
3575
- }, l = (w) => {
3575
+ }, d = (w) => {
3576
3576
  parent && setTimeout(() => window.focus()), w.preventDefault(), !o && (t(q), r = Date.now());
3577
3577
  }, h = (w) => {
3578
3578
  w.preventDefault(), !o && (t(q), r = Date.now());
3579
3579
  };
3580
- let f, p, y, g;
3580
+ let f, p, m, g;
3581
3581
  e(qe, () => {
3582
- f?.dispose(), p?.dispose(), y?.dispose(), g?.dispose(), f = null, p = null, y = null, g = null, s.lastMovePoint = null, t(Te);
3582
+ f?.dispose(), p?.dispose(), m?.dispose(), g?.dispose(), f = null, p = null, m = null, g = null, s.lastMovePoint = null, t(Te);
3583
3583
  });
3584
- const m = async (w) => {
3584
+ const y = async (w) => {
3585
3585
  parent && setTimeout(() => window.focus()), w.preventDefault(), !o && (t(q), s.down = w.button === 2 ? 2 : 1, s.move = !1, s.isDbClick = Date.now() - s.downTime < 300, r = Date.now(), s.downTime = Date.now());
3586
- }, C = async (w) => {
3586
+ }, M = async (w) => {
3587
3587
  if (w.preventDefault(), o) return;
3588
3588
  s.down && (s.move = !0, r = Date.now());
3589
3589
  const D = t(I);
3590
3590
  if (D.markMode) {
3591
3591
  const _ = await t(ce, w.clientX, w.clientY);
3592
- _ && !s.down && D.markType === "distance" && f ? f.drawUpdate({ endPoint: _.toArray() }) : !s.down && D.markType === "circle" && g ? _ ? (g.drawUpdate(null, !0, _), s.lastMovePoint = _, s.lastMovePointTime = Date.now()) : (s.lastMovePoint = null, s.lastMovePointTime = 0) : !s.down && D.markType === "lines" && p ? _ ? (p.drawUpdate(null, !0, _), s.lastMovePoint = _, s.lastMovePointTime = Date.now()) : (s.lastMovePoint = null, s.lastMovePointTime = 0) : !s.down && D.markType === "plans" && y && (_ ? (y.drawUpdate(null, !0, _), s.lastMovePoint = _, s.lastMovePointTime = Date.now()) : (s.lastMovePoint = null, s.lastMovePointTime = 0));
3592
+ _ && !s.down && D.markType === "distance" && f ? f.drawUpdate({ endPoint: _.toArray() }) : !s.down && D.markType === "circle" && g ? _ ? (g.drawUpdate(null, !0, _), s.lastMovePoint = _, s.lastMovePointTime = Date.now()) : (s.lastMovePoint = null, s.lastMovePointTime = 0) : !s.down && D.markType === "lines" && p ? _ ? (p.drawUpdate(null, !0, _), s.lastMovePoint = _, s.lastMovePointTime = Date.now()) : (s.lastMovePoint = null, s.lastMovePointTime = 0) : !s.down && D.markType === "plans" && m && (_ ? (m.drawUpdate(null, !0, _), s.lastMovePoint = _, s.lastMovePointTime = Date.now()) : (s.lastMovePoint = null, s.lastMovePointTime = 0));
3593
3593
  }
3594
3594
  }, S = async (w) => {
3595
3595
  if (w.preventDefault(), o) return;
3596
3596
  const D = t(I);
3597
- if (s.isDbClick && (p ? Math.abs(w.clientX - s.lastClickX) < 2 && Math.abs(w.clientY - s.lastClickY) < 2 && (p.drawFinish(s.lastClickPointTime > 0), p = null, s.lastMovePoint = null) : y && Math.abs(w.clientX - s.lastClickX) < 2 && Math.abs(w.clientY - s.lastClickY) < 2 && (y.drawFinish(s.lastClickPointTime > 0), y = null, s.lastMovePoint = null)), D.markMode && s.down === 1 && !s.move && Date.now() - s.downTime < 500) {
3597
+ if (s.isDbClick && (p ? Math.abs(w.clientX - s.lastClickX) < 2 && Math.abs(w.clientY - s.lastClickY) < 2 && (p.drawFinish(s.lastClickPointTime > 0), p = null, s.lastMovePoint = null) : m && Math.abs(w.clientX - s.lastClickX) < 2 && Math.abs(w.clientY - s.lastClickY) < 2 && (m.drawFinish(s.lastClickPointTime > 0), m = null, s.lastMovePoint = null)), D.markMode && s.down === 1 && !s.move && Date.now() - s.downTime < 500) {
3598
3598
  if (D.markType === "point") {
3599
3599
  if (await t(ce, w.clientX, w.clientY)) {
3600
3600
  const T = new ia(i, await t(ce, w.clientX, w.clientY));
@@ -3621,16 +3621,16 @@ function vr(i) {
3621
3621
  _ && (p = new Mn(i), p.drawStart(_), t(B).add(p));
3622
3622
  }
3623
3623
  else if (D.markType === "plans")
3624
- if (y)
3624
+ if (m)
3625
3625
  if (s.lastMovePoint && t(mn, w.clientX, w.clientY, s.lastMovePoint) < 0.03)
3626
- y.drawUpdate(null, !0, s.lastMovePoint, !0), s.lastClickPointTime = Date.now();
3626
+ m.drawUpdate(null, !0, s.lastMovePoint, !0), s.lastClickPointTime = Date.now();
3627
3627
  else {
3628
3628
  const _ = await t(ce, w.clientX, w.clientY);
3629
- _ ? (y.drawUpdate(null, !0, _, !0), s.lastClickPointTime = Date.now()) : s.lastClickPointTime = 0;
3629
+ _ ? (m.drawUpdate(null, !0, _, !0), s.lastClickPointTime = Date.now()) : s.lastClickPointTime = 0;
3630
3630
  }
3631
3631
  else {
3632
3632
  const _ = await t(ce, w.clientX, w.clientY);
3633
- _ && (y = new Tn(i), y.drawStart(_), t(B).add(y));
3633
+ _ && (m = new Tn(i), m.drawStart(_), t(B).add(m));
3634
3634
  }
3635
3635
  else if (D.markType === "circle")
3636
3636
  if (g) {
@@ -3653,7 +3653,7 @@ function vr(i) {
3653
3653
  function b(w) {
3654
3654
  s.down === 1 && !s.move && t(it, s.x, s.y);
3655
3655
  }
3656
- window.addEventListener("keydown", c), window.addEventListener("keyup", u), window.addEventListener("blur", d), window.addEventListener("wheel", l, { passive: !1 }), n.addEventListener("contextmenu", h), n.addEventListener("mousedown", m), n.addEventListener("mousemove", C), n.addEventListener("mouseup", S), n.addEventListener("touchstart", v, { passive: !1 }), n.addEventListener("touchmove", k, { passive: !1 }), n.addEventListener("touchend", b, { passive: !1 }), window.addEventListener("resize", x), x();
3656
+ window.addEventListener("keydown", c), window.addEventListener("keyup", u), window.addEventListener("blur", l), window.addEventListener("wheel", d, { passive: !1 }), n.addEventListener("contextmenu", h), n.addEventListener("mousedown", y), n.addEventListener("mousemove", M), n.addEventListener("mouseup", S), n.addEventListener("touchstart", v, { passive: !1 }), n.addEventListener("touchmove", k, { passive: !1 }), n.addEventListener("touchend", b, { passive: !1 }), window.addEventListener("resize", x), x();
3657
3657
  function x() {
3658
3658
  const { width: w, height: D, top: _, left: T } = t(Ue), F = t(V);
3659
3659
  F.aspect = w / D, F.updateProjectionMatrix();
@@ -3663,41 +3663,41 @@ function vr(i) {
3663
3663
  P.setPixelRatio(Math.min(devicePixelRatio, 2)), P.setSize(w, D);
3664
3664
  }
3665
3665
  e(Fn, () => {
3666
- o = !0, window.removeEventListener("keydown", c), window.removeEventListener("keyup", u), window.removeEventListener("blur", d), window.removeEventListener("wheel", l), n.removeEventListener("contextmenu", h), n.removeEventListener("mousedown", m), n.removeEventListener("mousemove", C), n.removeEventListener("mouseup", S), n.removeEventListener("touchstart", v), n.removeEventListener("touchmove", k), n.removeEventListener("touchend", b), window.removeEventListener("resize", x);
3666
+ o = !0, window.removeEventListener("keydown", c), window.removeEventListener("keyup", u), window.removeEventListener("blur", l), window.removeEventListener("wheel", d), n.removeEventListener("contextmenu", h), n.removeEventListener("mousedown", y), n.removeEventListener("mousemove", M), n.removeEventListener("mouseup", S), n.removeEventListener("touchstart", v), n.removeEventListener("touchmove", k), n.removeEventListener("touchend", b), window.removeEventListener("resize", x);
3667
3667
  });
3668
3668
  }
3669
3669
  function aa(i) {
3670
3670
  const e = new Aa(), t = 0.02, n = (o, s, r) => i.on(o, s, r), a = (o, ...s) => i.fire(o, ...s);
3671
3671
  n(Ft, async (o, s) => {
3672
- const { width: r, height: c, left: u, top: d } = a(Ue), l = new j();
3673
- l.x = (o - u) / r * 2 - 1, l.y = (d - s) / c * 2 + 1;
3672
+ const { width: r, height: c, left: u, top: l } = a(Ue), d = new j();
3673
+ d.x = (o - u) / r * 2 - 1, d.y = (l - s) / c * 2 + 1;
3674
3674
  const h = a(V);
3675
- e.setFromCamera(l, h);
3676
- const f = [], p = a(B), y = [], g = [];
3675
+ e.setFromCamera(d, h);
3676
+ const f = [], p = a(B), m = [], g = [];
3677
3677
  p.traverse(function(v) {
3678
- v instanceof pe ? g.push(v) : v.isMesh && !v.ignoreIntersect && !v.isMark && y.push(v);
3678
+ v instanceof pe ? g.push(v) : v.isMesh && !v.ignoreIntersect && !v.isMark && m.push(v);
3679
3679
  });
3680
- const m = e.intersectObjects(y, !0);
3681
- for (let v = 0; v < m.length; v++)
3682
- f.push(new tt(m[v].point, e.ray.distanceToPoint(m[v].point)));
3683
- const C = h.projectionMatrix.clone().multiply(h.matrixWorldInverse);
3680
+ const y = e.intersectObjects(m, !0);
3681
+ for (let v = 0; v < y.length; v++)
3682
+ f.push(new tt(y[v].point, e.ray.distanceToPoint(y[v].point)));
3683
+ const M = h.projectionMatrix.clone().multiply(h.matrixWorldInverse);
3684
3684
  for (let v = 0; v < g.length; v++) {
3685
3685
  const k = g[v].fire(gn);
3686
3686
  if (k)
3687
3687
  if (k.length !== void 0) {
3688
3688
  const b = k, x = b.length / 3;
3689
3689
  for (let w = 0; w < x; w++) {
3690
- const D = new M(b[3 * w + 0], b[3 * w + 1], b[3 * w + 2]), _ = new ve(D.x, D.y, D.z, 1).applyMatrix4(C), T = _.x / _.w, F = _.y / _.w;
3691
- Math.sqrt((T - l.x) ** 2 + (F - l.y) ** 2) <= t && f.push(new tt(D, e.ray.distanceToPoint(D)));
3690
+ const D = new C(b[3 * w + 0], b[3 * w + 1], b[3 * w + 2]), _ = new ve(D.x, D.y, D.z, 1).applyMatrix4(M), T = _.x / _.w, F = _.y / _.w;
3691
+ Math.sqrt((T - d.x) ** 2 + (F - d.y) ** 2) <= t && f.push(new tt(D, e.ray.distanceToPoint(D)));
3692
3692
  }
3693
3693
  } else
3694
3694
  for (let b of Object.keys(k)) {
3695
- const x = b.split(","), w = new M(Number(x[0]), Number(x[1]), Number(x[2]));
3695
+ const x = b.split(","), w = new C(Number(x[0]), Number(x[1]), Number(x[2]));
3696
3696
  if (e.ray.distanceToPoint(w) <= 1.4143) {
3697
3697
  const D = k[b];
3698
3698
  for (let _ = 0, T = D.length / 3; _ < T; _++) {
3699
- const F = new M(D[3 * _ + 0], D[3 * _ + 1], D[3 * _ + 2]), E = new ve(F.x, F.y, F.z, 1).applyMatrix4(C), P = E.x / E.w, U = E.y / E.w;
3700
- Math.sqrt((P - l.x) ** 2 + (U - l.y) ** 2) <= t && f.push(new tt(F, e.ray.distanceToPoint(F)));
3699
+ const F = new C(D[3 * _ + 0], D[3 * _ + 1], D[3 * _ + 2]), E = new ve(F.x, F.y, F.z, 1).applyMatrix4(M), P = E.x / E.w, U = E.y / E.w;
3700
+ Math.sqrt((P - d.x) ** 2 + (U - d.y) ** 2) <= t && f.push(new tt(F, e.ray.distanceToPoint(F)));
3701
3701
  }
3702
3702
  }
3703
3703
  }
@@ -3708,8 +3708,8 @@ function aa(i) {
3708
3708
  S.push(f[v].center);
3709
3709
  return S;
3710
3710
  }), n(mn, (o, s, r) => {
3711
- const { width: c, height: u, left: d, top: l } = a(Ue), h = new j();
3712
- h.x = (o - d) / c * 2 - 1, h.y = (l - s) / u * 2 + 1;
3711
+ const { width: c, height: u, left: l, top: d } = a(Ue), h = new j();
3712
+ h.x = (o - l) / c * 2 - 1, h.y = (d - s) / u * 2 + 1;
3713
3713
  const f = a(V);
3714
3714
  return e.setFromCamera(h, f), e.ray.distanceToPoint(r);
3715
3715
  });
@@ -3722,23 +3722,23 @@ function Sr(i) {
3722
3722
  return;
3723
3723
  }
3724
3724
  const u = t(Y).target.clone();
3725
- let d = 0;
3725
+ let l = 0;
3726
3726
  t(
3727
3727
  at,
3728
3728
  () => {
3729
- d += 0.03, t(Y).target.copy(u.clone().lerp(r, d)), t(Rt);
3729
+ l += 0.03, t(Y).target.copy(u.clone().lerp(r, l)), t(Rt);
3730
3730
  },
3731
- () => d < 1
3731
+ () => l < 1
3732
3732
  );
3733
3733
  }), e(ls, () => {
3734
3734
  let r = t(Be).toArray(), c = t(Ne).toArray(), u = t(Ce).toArray();
3735
3735
  return { position: r, lookUp: c, lookAt: u };
3736
3736
  }), e(ds, () => t(Y).update()), e(us, () => t(Y).updateRotateAxis());
3737
3737
  const n = 0.01;
3738
- let a = new M(), o = new M(), s = 0;
3738
+ let a = new C(), o = new C(), s = 0;
3739
3739
  e(ws, () => {
3740
- const r = t(Y).object, c = r.fov, u = r.position.clone(), d = r.getWorldDirection(new M());
3741
- return Math.abs(s - c) < n && Math.abs(u.x - a.x) < n && Math.abs(u.y - a.y) < n && Math.abs(u.z - a.z) < n && Math.abs(d.x - o.x) < n && Math.abs(d.y - o.y) < n && Math.abs(d.z - o.z) < n ? !1 : (s = c, a = u, o = d, !0);
3740
+ const r = t(Y).object, c = r.fov, u = r.position.clone(), l = r.getWorldDirection(new C());
3741
+ return Math.abs(s - c) < n && Math.abs(u.x - a.x) < n && Math.abs(u.y - a.y) < n && Math.abs(u.z - a.z) < n && Math.abs(l.x - o.x) < n && Math.abs(l.y - o.y) < n && Math.abs(l.z - o.z) < n ? !1 : (s = c, a = u, o = l, !0);
3742
3742
  });
3743
3743
  }
3744
3744
  class br extends te {
@@ -3748,19 +3748,19 @@ class br extends te {
3748
3748
  }
3749
3749
  function xr(i) {
3750
3750
  let e = !1;
3751
- const t = (r, c, u) => i.on(r, c, u), n = (r, ...c) => i.fire(r, ...c), a = [], o = new M(), s = new $e();
3751
+ const t = (r, c, u) => i.on(r, c, u), n = (r, ...c) => i.fire(r, ...c), a = [], o = new C(), s = new $e();
3752
3752
  t(_s, () => {
3753
3753
  const r = new wa(0.5, 32, 32), c = Cr();
3754
3754
  c.depthTest = !1, c.depthWrite = !1, c.transparent = !0;
3755
3755
  const u = new br();
3756
- return u.copy(new te(r, c)), t(Da, () => c), t(vi, (d) => {
3757
- e || (c.uniforms[xn].value = d, d <= 0.01 ? u.visible = !1 : u.visible = !0, c.uniformsNeedUpdate = !0, n(J));
3758
- }), t(Is, (d) => {
3756
+ return u.copy(new te(r, c)), t(Da, () => c), t(vi, (l) => {
3757
+ e || (c.uniforms[xn].value = l, l <= 0.01 ? u.visible = !1 : u.visible = !0, c.uniformsNeedUpdate = !0, n(J));
3758
+ }), t(Is, (l) => {
3759
3759
  if (e) return;
3760
- const l = n(V);
3761
- s.copy(l.matrixWorld).invert(), o.copy(d).applyMatrix4(s), o.normalize().multiplyScalar(10), o.applyMatrix4(l.matrixWorld);
3760
+ const d = n(V);
3761
+ s.copy(d.matrixWorld).invert(), o.copy(l).applyMatrix4(s), o.normalize().multiplyScalar(10), o.applyMatrix4(d.matrixWorld);
3762
3762
  const { width: h, height: f } = n(Ue);
3763
- c.uniforms[ht].value.set(h, f), u.position.copy(o), c.uniforms[Js].value.copy(d), c.uniforms[ht].value.set(h, f), c.uniforms[xn].value = 1, c.uniformsNeedUpdate = !0, n(Si), n(J);
3763
+ c.uniforms[ht].value.set(h, f), u.position.copy(o), c.uniforms[Js].value.copy(l), c.uniforms[ht].value.set(h, f), c.uniforms[xn].value = 1, c.uniformsNeedUpdate = !0, n(Si), n(J);
3764
3764
  }), t(Pa, () => {
3765
3765
  e || (e = !0, c.dispose(), r.dispose());
3766
3766
  }), u.renderOrder = 99999, u;
@@ -3779,7 +3779,7 @@ function xr(i) {
3779
3779
  function Cr() {
3780
3780
  const i = {
3781
3781
  [So]: { type: "v3", value: new Pn() },
3782
- [Js]: { type: "v3", value: new M() },
3782
+ [Js]: { type: "v3", value: new C() },
3783
3783
  [ht]: { type: "v2", value: new j() },
3784
3784
  [xn]: { value: 0 }
3785
3785
  };
@@ -3873,33 +3873,33 @@ function oa(i) {
3873
3873
  }
3874
3874
  r && (t(I).meterScale = s.meterScale), t(oe, { scale: `1 : ${c} m` });
3875
3875
  for (const u of n.values()) {
3876
- const d = u.deref();
3877
- d && (d instanceof Cn || d instanceof Mn || d instanceof Tn) && d.updateByMeterScale(c);
3876
+ const l = u.deref();
3877
+ l && (l instanceof Cn || l instanceof Mn || l instanceof Tn) && l.updateByMeterScale(c);
3878
3878
  }
3879
3879
  }
3880
3880
  }), e(ln, (s) => {
3881
- const r = new M().fromArray(s.slice(0, 3)), c = new M().fromArray(s.slice(-6, -3)), u = new M().fromArray(s.slice(-3)), d = r.distanceTo(u) < 1e-4, l = c.distanceTo(u) < 1e-4, h = new M(), f = d || l ? s.length / 3 - 1 : s.length / 3;
3881
+ const r = new C().fromArray(s.slice(0, 3)), c = new C().fromArray(s.slice(-6, -3)), u = new C().fromArray(s.slice(-3)), l = r.distanceTo(u) < 1e-4, d = c.distanceTo(u) < 1e-4, h = new C(), f = l || d ? s.length / 3 - 1 : s.length / 3;
3882
3882
  for (let p = 0; p < f; p++)
3883
- h.add(new M(s[p * 3], s[p * 3 + 1], s[p * 3 + 2]));
3883
+ h.add(new C(s[p * 3], s[p * 3 + 1], s[p * 3 + 2]));
3884
3884
  return h.divideScalar(f), h;
3885
3885
  }), e(dn, (s) => {
3886
3886
  const r = [];
3887
- for (let l = 0, h = s.length / 3; l < h; l++)
3888
- r.push(new M(s[l * 3], s[l * 3 + 1], s[l * 3 + 2]));
3887
+ for (let d = 0, h = s.length / 3; d < h; d++)
3888
+ r.push(new C(s[d * 3], s[d * 3 + 1], s[d * 3 + 2]));
3889
3889
  const c = r[0].distanceTo(r[r.length - 1]) < 1e-4, u = r[r.length - 2].distanceTo(r[r.length - 1]) < 1e-4;
3890
3890
  if ((c || u) && r.pop(), r.length < 3) return 0;
3891
- let d = 0;
3892
- for (let l = 0, h = r.length - 2; l < h; l++)
3893
- d += t(Gt, r[0], r[l + 1], r[l + 2], t(I).meterScale);
3894
- return d;
3891
+ let l = 0;
3892
+ for (let d = 0, h = r.length - 2; d < h; d++)
3893
+ l += t(Gt, r[0], r[d + 1], r[d + 2], t(I).meterScale);
3894
+ return l;
3895
3895
  }), e(rs, (s, r) => {
3896
3896
  let c = 0;
3897
- for (let u = 0, d = s.length - 2; u < d; u++)
3897
+ for (let u = 0, l = s.length - 2; u < l; u++)
3898
3898
  c += t(Gt, s[0], s[u + 1], s[u + 2], r);
3899
3899
  return c;
3900
3900
  }), e(Gt, (s, r, c, u) => {
3901
- const d = s.distanceTo(r) * u, l = r.distanceTo(c) * u, h = c.distanceTo(s) * u, f = (d + l + h) / 2;
3902
- return Math.sqrt(f * (f - d) * (f - l) * (f - h));
3901
+ const l = s.distanceTo(r) * u, d = r.distanceTo(c) * u, h = c.distanceTo(s) * u, f = (l + d + h) / 2;
3902
+ return Math.sqrt(f * (f - l) * (f - d) * (f - h));
3903
3903
  });
3904
3904
  }
3905
3905
  function Mr(i) {
@@ -3917,10 +3917,10 @@ function Mr(i) {
3917
3917
  return h;
3918
3918
  }), t(Vn, (h) => {
3919
3919
  for (let f = 0, p = h.length / 3 | 0; f < p; f++)
3920
- n[f] = new M(h[f * 3 + 0], h[f * 3 + 1], h[f * 3 + 2]);
3920
+ n[f] = new C(h[f * 3 + 0], h[f * 3 + 1], h[f * 3 + 2]);
3921
3921
  }), t(Gn, (h) => {
3922
3922
  for (let f = 0, p = h.length / 3 | 0; f < p; f++)
3923
- a[f] = new M(h[f * 3 + 0], h[f * 3 + 1], h[f * 3 + 2]);
3923
+ a[f] = new C(h[f * 3 + 0], h[f * 3 + 1], h[f * 3 + 2]);
3924
3924
  }), t(Wn, () => {
3925
3925
  const h = e(Y);
3926
3926
  n.push(h.object.position.clone()), a.push(h.target.clone());
@@ -3930,8 +3930,8 @@ function Mr(i) {
3930
3930
  const h = e(ye).meta || {};
3931
3931
  if (n.length) {
3932
3932
  const f = [], p = [];
3933
- for (let y = 0, g = n.length; y < g; y++)
3934
- f.push(...n[y].toArray()), p.push(...a[y].toArray());
3933
+ for (let m = 0, g = n.length; m < g; m++)
3934
+ f.push(...n[m].toArray()), p.push(...a[m].toArray());
3935
3935
  h.flyPositions = f, h.flyTargets = p;
3936
3936
  } else
3937
3937
  delete h.flyPositions, delete h.flyTargets;
@@ -3941,20 +3941,20 @@ function Mr(i) {
3941
3941
  });
3942
3942
  let r = 0;
3943
3943
  const c = 120 * 1e3;
3944
- let u = 0, d, l;
3944
+ let u = 0, l, d;
3945
3945
  t(Ot, (h) => {
3946
- if (r = 0, u = Date.now(), d = null, l = null, !n.length || !h && !e(Y).autoRotate) return;
3947
- const f = e(Y), p = [f.object.position.clone()], y = [f.target.clone()], g = e(xi) || [];
3948
- for (let m = 0, C = Math.min(g.length, 100); m < C; m++)
3949
- g[m] && p.push(g[m]), a[m] && y.push(a[m]);
3950
- d = new si(p), d.closed = !0, l = new si(y), l.closed = !0, e(Ci), e(q, !1);
3946
+ if (r = 0, u = Date.now(), l = null, d = null, !n.length || !h && !e(Y).autoRotate) return;
3947
+ const f = e(Y), p = [f.object.position.clone()], m = [f.target.clone()], g = e(xi) || [];
3948
+ for (let y = 0, M = Math.min(g.length, 100); y < M; y++)
3949
+ g[y] && p.push(g[y]), a[y] && m.push(a[y]);
3950
+ l = new si(p), l.closed = !0, d = new si(m), d.closed = !0, e(Ci), e(q, !1);
3951
3951
  }), t(
3952
3952
  lt,
3953
3953
  () => {
3954
- if (Date.now() - u > c && e(zt), !o || !d || !l) return;
3954
+ if (Date.now() - u > c && e(zt), !o || !l || !d) return;
3955
3955
  const h = e(Y);
3956
3956
  r = (Date.now() - u) / c;
3957
- const f = d.getPoint(r), p = l.getPoint(r);
3957
+ const f = l.getPoint(r), p = d.getPoint(r);
3958
3958
  h.object.position.set(f.x, f.y, f.z), h.target.set(p.x, p.y, p.z);
3959
3959
  },
3960
3960
  !0
@@ -3973,18 +3973,18 @@ class Br {
3973
3973
  o.updateByOptions(e);
3974
3974
  const s = new Xn();
3975
3975
  e.viewerEvents = s, t.events = s;
3976
- const r = (l, h, f) => s.on(l, h, f), c = (l, ...h) => s.fire(l, ...h);
3977
- r(I, () => e), r(Ke, () => n.domElement), r(ct, () => n), r(B, () => a), r(Y, () => o), r(V, () => o.object), r(ee, () => e.bigSceneMode), r(Fa, (l) => e.pointcloudMode = l);
3976
+ const r = (d, h, f) => s.on(d, h, f), c = (d, ...h) => s.fire(d, ...h);
3977
+ r(I, () => e), r(Ke, () => n.domElement), r(ct, () => n), r(B, () => a), r(Y, () => o), r(V, () => o.object), r(ee, () => e.bigSceneMode), r(Fa, (d) => e.pointcloudMode = d);
3978
3978
  const u = [];
3979
3979
  r(J, () => {
3980
3980
  for (t.needUpdate = !0; u.length; ) u.pop().stop = !0;
3981
- let l = { count: 0, stop: !1 };
3982
- u.push(l), c(
3981
+ let d = { count: 0, stop: !1 };
3982
+ u.push(d), c(
3983
3983
  Ln,
3984
3984
  () => {
3985
- !t.disposed && (t.needUpdate = !0), l.count++ >= 600 && (l.stop = !0);
3985
+ !t.disposed && (t.needUpdate = !0), d.count++ >= 600 && (d.stop = !0);
3986
3986
  },
3987
- () => !t.disposed && (c(On) || !l.stop),
3987
+ () => !t.disposed && (c(On) || !d.stop),
3988
3988
  10
3989
3989
  );
3990
3990
  }), qn(s), Yo(s), Jn(s), Sr(s), oa(s), vr(s), aa(s), xr(s), Mr(s), t.splatMesh = new pe(Xo(e)), r(ye, () => t.splatMesh), a.add(t.splatMesh), Zo(s), a.add(new as("#ffffff", 2)), a.add(c(_s)), n.setAnimationLoop(t.update.bind(t)), r(bi, () => {
@@ -3994,17 +3994,17 @@ class Br {
3994
3994
  () => {
3995
3995
  try {
3996
3996
  !(t.needUpdate = !1) && n.render(a, c(V));
3997
- } catch (l) {
3998
- console.warn(l.message);
3997
+ } catch (d) {
3998
+ console.warn(d.message);
3999
3999
  }
4000
4000
  },
4001
4001
  !0
4002
4002
  ), r(lt, () => {
4003
4003
  }, !0), r(Ht, () => t.dispose()), r(Os, () => console.info(JSON.stringify(c(ye).meta || {}, null, 2)));
4004
- let d = "";
4005
- r(mt, (l = "") => {
4006
- d = l, t.splatMesh.fire(Hn, d, !0);
4007
- }), r(Ds, () => d), c(oe, { scale: `1 : ${c(I).meterScale} m` }), t.initGsApi();
4004
+ let l = "";
4005
+ r(mt, (d = "") => {
4006
+ l = d, t.splatMesh.fire(Hn, l, !0);
4007
+ }), r(Ds, () => l), c(oe, { scale: `1 : ${c(I).meterScale} m` }), t.initGsApi();
4008
4008
  }
4009
4009
  /**
4010
4010
  * 允许拖拽本地文件进行渲染
@@ -4142,33 +4142,33 @@ class Br {
4142
4142
  * 根据需要暴露的接口
4143
4143
  */
4144
4144
  initGsApi() {
4145
- const e = (d, ...l) => this.events.fire(d, ...l), t = () => {
4145
+ const e = (l, ...d) => this.events.fire(l, ...d), t = () => {
4146
4146
  setTimeout(() => window.focus()), e(zt), e(Y).autoRotate = e(I).autoRotate = !e(I).autoRotate;
4147
- }, n = (d = !0) => {
4148
- setTimeout(() => window.focus()), d = !!d;
4149
- const l = e(I);
4150
- l.pointcloudMode !== d && (l.bigSceneMode ? e(Bt, d) : e(Ut));
4151
- }, a = (d = !0) => {
4152
- setTimeout(() => window.focus()), e(dt, !!d);
4153
- }, o = (d) => {
4147
+ }, n = (l = !0) => {
4148
+ setTimeout(() => window.focus()), l = !!l;
4149
+ const d = e(I);
4150
+ d.pointcloudMode !== l && (d.bigSceneMode ? e(Bt, l) : e(Ut));
4151
+ }, a = (l = !0) => {
4152
+ setTimeout(() => window.focus()), e(dt, !!l);
4153
+ }, o = (l) => {
4154
4154
  setTimeout(() => window.focus());
4155
- const l = e(I);
4156
- if (l.markMode) return !1;
4157
- if (d === 1)
4158
- l.markType = "point";
4159
- else if (d === 2)
4160
- l.markType = "lines";
4161
- else if (d === 3)
4162
- l.markType = "plans";
4163
- else if (d === 4)
4164
- l.markType = "distance";
4155
+ const d = e(I);
4156
+ if (d.markMode) return !1;
4157
+ if (l === 1)
4158
+ d.markType = "point";
4159
+ else if (l === 2)
4160
+ d.markType = "lines";
4161
+ else if (l === 3)
4162
+ d.markType = "plans";
4163
+ else if (l === 4)
4164
+ d.markType = "distance";
4165
4165
  else
4166
4166
  return !1;
4167
- return l.markMode = !0, e(q), !0;
4168
- }, s = async (d) => (setTimeout(() => window.focus()), d ? (e(st, d)?.dispose(), e(J), await e(kt)) : !1), r = async (d, l = !0) => (e(Ps, d, l), e(st, d?.name)?.drawUpdate?.(d, l), e(J), l ? (setTimeout(() => window.focus()), await e(kt)) : !0), c = (d = !0) => {
4169
- setTimeout(() => window.focus()), e(hn, !!d);
4170
- }, u = (d, l = !0) => {
4171
- e(mt, d), l && e(Fs, d);
4167
+ return d.markMode = !0, e(q), !0;
4168
+ }, s = async (l) => (setTimeout(() => window.focus()), l ? (e(st, l)?.dispose(), e(J), await e(kt)) : !1), r = async (l, d = !0) => (e(Ps, l, d), e(st, l?.name)?.drawUpdate?.(l, d), e(J), d ? (setTimeout(() => window.focus()), await e(kt)) : !0), c = (l = !0) => {
4169
+ setTimeout(() => window.focus()), e(hn, !!l);
4170
+ }, u = (l, d = !0) => {
4171
+ e(mt, l), d && e(Fs, l);
4172
4172
  };
4173
4173
  window.$api = { switchAutoRotate: t, changePointCloudMode: n, showMark: a, startMark: o, deleteMark: s, updateMark: r, showWaterMark: c, setWaterMark: u };
4174
4174
  }
@@ -4187,19 +4187,19 @@ function Tr(i) {
4187
4187
  const e = (s, r, c) => i.on(s, r, c), t = (s, ...r) => i.fire(s, ...r), n = le ? 1 : 20, a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
4188
4188
  e(It, () => t(re) && a.set(Date.now(), 1)), e(Dt, () => t(re) && t(Ye, a)), e(Pt, () => t(re) && o.set(Date.now(), 1)), e(Lt, () => t(re) && t(Ye, o)), e(Ye, (s) => {
4189
4189
  let r = [], c = Date.now(), u = 0;
4190
- for (const d of s.keys())
4191
- c - d <= 1e3 ? u++ : r.push(d);
4192
- return r.forEach((d) => s.delete(d)), Math.min(u, 30);
4190
+ for (const l of s.keys())
4191
+ c - l <= 1e3 ? u++ : r.push(l);
4192
+ return r.forEach((l) => s.delete(l)), Math.min(u, 30);
4193
4193
  }), e(X, () => {
4194
4194
  const s = t(B), r = t(V), c = [];
4195
4195
  return s?.traverse(function(u) {
4196
4196
  u.isWarpSplatMesh && u.splatMesh?.visible && c.push(u);
4197
- }), c.sort((u, d) => r.position.distanceTo(u.position) - r.position.distanceTo(d.position)), window.splat = c[0]?.splatMesh, c[0]?.splatMesh;
4197
+ }), c.sort((u, l) => r.position.distanceTo(u.position) - r.position.distanceTo(l.position)), window.splat = c[0]?.splatMesh, c[0]?.splatMesh;
4198
4198
  }), e(Ks, () => {
4199
4199
  const s = t(B), r = t(V), c = [];
4200
4200
  s?.traverse(function(u) {
4201
4201
  u.isWarpSplatMesh && c.push(u);
4202
- }), c.sort((u, d) => r.position.distanceTo(u.position) - r.position.distanceTo(d.position));
4202
+ }), c.sort((u, l) => r.position.distanceTo(u.position) - r.position.distanceTo(l.position));
4203
4203
  for (let u = 0; u < c.length; u++)
4204
4204
  c[u].active = u < n, c[u].splatMesh && (c[u].splatMesh.renderOrder = 1e3 - u);
4205
4205
  }), e(Zs, () => {
@@ -4209,13 +4209,13 @@ function Tr(i) {
4209
4209
  }), s?.clear();
4210
4210
  }), e(wn, (s = 0.1) => {
4211
4211
  const r = t(X);
4212
- r && r.visible && r.rotateOnAxis(new M(1, 0, 0), be.degToRad(s));
4212
+ r && r.visible && r.rotateOnAxis(new C(1, 0, 0), be.degToRad(s));
4213
4213
  }), e(vn, (s = 0.1) => {
4214
4214
  const r = t(X);
4215
- r && r.visible && r.rotateOnAxis(new M(0, 1, 0), be.degToRad(s));
4215
+ r && r.visible && r.rotateOnAxis(new C(0, 1, 0), be.degToRad(s));
4216
4216
  }), e(Sn, (s = 0.1) => {
4217
4217
  const r = t(X);
4218
- r && r.visible && r.rotateOnAxis(new M(0, 0, 1), be.degToRad(s));
4218
+ r && r.visible && r.rotateOnAxis(new C(0, 0, 1), be.degToRad(s));
4219
4219
  }), e(Ha, (s = 0.01) => {
4220
4220
  const r = t(X);
4221
4221
  r && r.visible && (r.position.x += s);
@@ -4245,11 +4245,13 @@ function Tr(i) {
4245
4245
  const s = new ss(), r = 14414079;
4246
4246
  return s.background = new Pn(r), s.fog = new ai(r, 0), e(B, () => s), s;
4247
4247
  }), e(Ns, () => {
4248
- const r = t(V), c = t(B), u = t(I), d = new ur(t(V), u.root);
4249
- return d.screenSpacePanning = !1, d.minDistance = 0.1, d.maxDistance = 1e5, d.maxPolarAngle = 1.2, d.enableDamping = !0, d.dampingFactor = 0.07, d.zoomToCursor = !0, d.addEventListener("change", () => {
4250
- const l = Math.max(d.getPolarAngle(), 0.1), h = Math.max(d.getDistance(), 0.1);
4251
- d.zoomSpeed = Math.max(Math.log(h), 0) + 0.5, r.far = be.clamp(h / l * 8, 100, 2e5), r.near = r.far / 1e3, r.updateProjectionMatrix(), c.fog instanceof ai && (c.fog.density = l / (h + 5) * 1 * 0.25), d.maxPolarAngle = Math.min(Math.pow(1e4 / h, 4), 1.2);
4252
- }), e(Y, () => d), e(ft, () => r.fov), e(Be, (l = !1) => l ? r.position.clone() : r.position), e(Ce, (l = !1) => l ? d.target.clone() : d.target), e(Ne, (l = !1) => l ? r.up.clone() : r.up), d;
4248
+ const r = t(V), c = t(B), u = t(I), l = new ur(t(V), u.root);
4249
+ l.screenSpacePanning = !1, l.minDistance = 0.1, l.maxDistance = 6e4, l.maxPolarAngle = 1.2, l.enableDamping = !0, l.dampingFactor = 0.07, l.zoomToCursor = !0;
4250
+ const d = new C(-2e4, 0.3, -6e4), h = new C(5e4, 6e4, 0), f = new C();
4251
+ return l.addEventListener("change", () => {
4252
+ const p = Math.max(l.getPolarAngle(), 0.1), m = Math.max(l.getDistance(), 0.1);
4253
+ l.zoomSpeed = Math.max(Math.log(m), 0) + 0.5, r.far = be.clamp(m / p * 8, 100, 1e5), r.near = r.far / 1e3, r.updateProjectionMatrix(), c.fog instanceof ai && (c.fog.density = p / (m + 5) * 1 * 0.25), l.maxPolarAngle = Math.min(Math.pow(1e4 / m, 4), 1.2), f.copy(l.target), l.target.clamp(d, h), f.sub(l.target), r.position.sub(f);
4254
+ }), e(Y, () => l), e(ft, () => r.fov), e(Be, (p = !1) => p ? r.position.clone() : r.position), e(Ce, (p = !1) => p ? l.target.clone() : l.target), e(Ne, (p = !1) => p ? r.up.clone() : r.up), l;
4253
4255
  }), e(Xs, () => {
4254
4256
  const s = new Sa(16777215, 1);
4255
4257
  return s.position.set(0, 2e3, 1e3), s;
@@ -4288,7 +4290,7 @@ function Ir(i) {
4288
4290
  if (!x || !x.visible) return a.clear();
4289
4291
  if (a.has("KeyX")) {
4290
4292
  const w = be.degToRad(0.1);
4291
- x.rotateOnAxis(new M(1, 0, 0), w);
4293
+ x.rotateOnAxis(new C(1, 0, 0), w);
4292
4294
  } else
4293
4295
  x.scale.set(x.scale.x + 0.01, x.scale.y + 0.01, x.scale.z + 0.01);
4294
4296
  } else if (a.has("Minus")) {
@@ -4296,7 +4298,7 @@ function Ir(i) {
4296
4298
  if (!x || !x.visible) return a.clear();
4297
4299
  if (a.has("KeyX")) {
4298
4300
  const w = be.degToRad(-0.1);
4299
- x.rotateOnAxis(new M(1, 0, 0), w);
4301
+ x.rotateOnAxis(new C(1, 0, 0), w);
4300
4302
  } else
4301
4303
  x.scale.set(x.scale.x - 0.01, x.scale.y - 0.01, x.scale.z - 0.01);
4302
4304
  } else if (a.has("ArrowUp")) {
@@ -4325,20 +4327,20 @@ function Ir(i) {
4325
4327
  b.target.type !== "text" && (o || a.clear());
4326
4328
  }, u = () => {
4327
4329
  a.clear();
4328
- }, d = (b) => {
4330
+ }, l = (b) => {
4329
4331
  parent && setTimeout(() => window.focus()), b.preventDefault();
4330
- }, l = async (b) => {
4332
+ }, d = async (b) => {
4331
4333
  b.preventDefault();
4332
4334
  };
4333
- let h, f, p, y;
4335
+ let h, f, p, m;
4334
4336
  e(qe, () => {
4335
- h?.dispose(), f?.dispose(), p?.dispose(), y?.dispose(), h = null, f = null, p = null, y = null, s.lastMovePoint = null, t(Te);
4337
+ h?.dispose(), f?.dispose(), p?.dispose(), m?.dispose(), h = null, f = null, p = null, m = null, s.lastMovePoint = null, t(Te);
4336
4338
  });
4337
4339
  const g = async (b) => {
4338
4340
  parent && setTimeout(() => window.focus()), b.preventDefault(), !o && (s.down = b.button === 2 ? 2 : 1, s.move = !1, s.isDbClick = Date.now() - s.downTime < 300, s.downTime = Date.now());
4339
- }, m = async (b) => {
4341
+ }, y = async (b) => {
4340
4342
  b.preventDefault(), !o && s.down && (s.move = !0);
4341
- }, C = async (b) => {
4343
+ }, M = async (b) => {
4342
4344
  b.preventDefault(), !o && (s.down = 0, s.move = !1);
4343
4345
  };
4344
4346
  function S(b) {
@@ -4350,8 +4352,8 @@ function Ir(i) {
4350
4352
  function k(b) {
4351
4353
  s.down === 1 && !s.move && t(it, s.x, s.y);
4352
4354
  }
4353
- window.addEventListener("keydown", r), window.addEventListener("keyup", c), window.addEventListener("blur", u), window.addEventListener("wheel", d, { passive: !1 }), n.addEventListener("contextmenu", l), n.addEventListener("mousedown", g), n.addEventListener("mousemove", m), n.addEventListener("mouseup", C), n.addEventListener("touchstart", S, { passive: !1 }), n.addEventListener("touchmove", v, { passive: !1 }), n.addEventListener("touchend", k, { passive: !1 }), e(Fn, () => {
4354
- o = !0, window.removeEventListener("keydown", r), window.removeEventListener("keyup", c), window.removeEventListener("blur", u), window.removeEventListener("wheel", d), n.removeEventListener("contextmenu", l), n.removeEventListener("mousedown", g), n.removeEventListener("mousemove", m), n.removeEventListener("mouseup", C), n.removeEventListener("touchstart", S), n.removeEventListener("touchmove", v), n.removeEventListener("touchend", k);
4355
+ window.addEventListener("keydown", r), window.addEventListener("keyup", c), window.addEventListener("blur", u), window.addEventListener("wheel", l, { passive: !1 }), n.addEventListener("contextmenu", d), n.addEventListener("mousedown", g), n.addEventListener("mousemove", y), n.addEventListener("mouseup", M), n.addEventListener("touchstart", S, { passive: !1 }), n.addEventListener("touchmove", v, { passive: !1 }), n.addEventListener("touchend", k, { passive: !1 }), e(Fn, () => {
4356
+ o = !0, window.removeEventListener("keydown", r), window.removeEventListener("keyup", c), window.removeEventListener("blur", u), window.removeEventListener("wheel", l), n.removeEventListener("contextmenu", d), n.removeEventListener("mousedown", g), n.removeEventListener("mousemove", y), n.removeEventListener("mouseup", M), n.removeEventListener("touchstart", S), n.removeEventListener("touchmove", v), n.removeEventListener("touchend", k);
4355
4357
  }), e(it, async (b, x) => await t(Ft, b, x));
4356
4358
  }
4357
4359
  var Ge = Object.freeze({
@@ -4607,38 +4609,38 @@ var Ge = Object.freeze({
4607
4609
  return this.start(e, !0);
4608
4610
  }, i.prototype._setupProperties = function(e, t, n, a, o) {
4609
4611
  for (var s in n) {
4610
- var r = e[s], c = Array.isArray(r), u = c ? "array" : typeof r, d = !c && Array.isArray(n[s]);
4612
+ var r = e[s], c = Array.isArray(r), u = c ? "array" : typeof r, l = !c && Array.isArray(n[s]);
4611
4613
  if (!(u === "undefined" || u === "function")) {
4612
- if (d) {
4613
- var l = n[s];
4614
- if (l.length === 0)
4614
+ if (l) {
4615
+ var d = n[s];
4616
+ if (d.length === 0)
4615
4617
  continue;
4616
- for (var h = [r], f = 0, p = l.length; f < p; f += 1) {
4617
- var y = this._handleRelativeValue(r, l[f]);
4618
- if (isNaN(y)) {
4619
- d = !1, console.warn("Found invalid interpolation list. Skipping.");
4618
+ for (var h = [r], f = 0, p = d.length; f < p; f += 1) {
4619
+ var m = this._handleRelativeValue(r, d[f]);
4620
+ if (isNaN(m)) {
4621
+ l = !1, console.warn("Found invalid interpolation list. Skipping.");
4620
4622
  break;
4621
4623
  }
4622
- h.push(y);
4624
+ h.push(m);
4623
4625
  }
4624
- d && (n[s] = h);
4626
+ l && (n[s] = h);
4625
4627
  }
4626
- if ((u === "object" || c) && r && !d) {
4628
+ if ((u === "object" || c) && r && !l) {
4627
4629
  t[s] = c ? [] : {};
4628
4630
  var g = r;
4629
- for (var m in g)
4630
- t[s][m] = g[m];
4631
+ for (var y in g)
4632
+ t[s][y] = g[y];
4631
4633
  a[s] = c ? [] : {};
4632
- var l = n[s];
4634
+ var d = n[s];
4633
4635
  if (!this._isDynamic) {
4634
- var C = {};
4635
- for (var m in l)
4636
- C[m] = l[m];
4637
- n[s] = l = C;
4636
+ var M = {};
4637
+ for (var y in d)
4638
+ M[y] = d[y];
4639
+ n[s] = d = M;
4638
4640
  }
4639
- this._setupProperties(g, t[s], l, a[s], o);
4641
+ this._setupProperties(g, t[s], d, a[s], o);
4640
4642
  } else
4641
- (typeof t[s] > "u" || o) && (t[s] = r), c || (t[s] *= 1), d ? a[s] = n[s].slice().reverse() : a[s] = t[s] || 0;
4643
+ (typeof t[s] > "u" || o) && (t[s] = r), c || (t[s] *= 1), l ? a[s] = n[s].slice().reverse() : a[s] = t[s] || 0;
4642
4644
  }
4643
4645
  }
4644
4646
  }, i.prototype.stop = function() {
@@ -4702,10 +4704,10 @@ var Ge = Object.freeze({
4702
4704
  var s = e - this._startTime, r = this._duration + ((a = this._repeatDelayTime) !== null && a !== void 0 ? a : this._delayTime), c = this._duration + this._repeat * r, u = function() {
4703
4705
  if (n._duration === 0 || s > c)
4704
4706
  return 1;
4705
- var y = Math.trunc(s / r), g = s - y * r, m = Math.min(g / n._duration, 1);
4706
- return m === 0 && s === n._duration ? 1 : m;
4707
- }, d = u(), l = this._easingFunction(d);
4708
- if (this._updateProperties(this._object, this._valuesStart, this._valuesEnd, l), this._onUpdateCallback && this._onUpdateCallback(this._object, d), this._duration === 0 || s >= this._duration)
4707
+ var m = Math.trunc(s / r), g = s - m * r, y = Math.min(g / n._duration, 1);
4708
+ return y === 0 && s === n._duration ? 1 : y;
4709
+ }, l = u(), d = this._easingFunction(l);
4710
+ if (this._updateProperties(this._object, this._valuesStart, this._valuesEnd, d), this._onUpdateCallback && this._onUpdateCallback(this._object, l), this._duration === 0 || s >= this._duration)
4709
4711
  if (this._repeat > 0) {
4710
4712
  var h = Math.min(Math.trunc((s - this._duration) / r) + 1, this._repeat);
4711
4713
  isFinite(this._repeat) && (this._repeat -= h);
@@ -4724,8 +4726,8 @@ var Ge = Object.freeze({
4724
4726
  }, i.prototype._updateProperties = function(e, t, n, a) {
4725
4727
  for (var o in n)
4726
4728
  if (t[o] !== void 0) {
4727
- var s = t[o] || 0, r = n[o], c = Array.isArray(e[o]), u = Array.isArray(r), d = !c && u;
4728
- d ? e[o] = this._interpolationFunction(r, a) : typeof r == "object" && r ? this._updateProperties(e[o], s, r, a) : (r = this._handleRelativeValue(s, r), typeof r == "number" && (e[o] = s + (r - s) * a));
4729
+ var s = t[o] || 0, r = n[o], c = Array.isArray(e[o]), u = Array.isArray(r), l = !c && u;
4730
+ l ? e[o] = this._interpolationFunction(r, a) : typeof r == "object" && r ? this._updateProperties(e[o], s, r, a) : (r = this._handleRelativeValue(s, r), typeof r == "number" && (e[o] = s + (r - s) * a));
4729
4731
  }
4730
4732
  }, i.prototype._handleRelativeValue = function(e, t) {
4731
4733
  return typeof t != "string" ? t : t.charAt(0) === "+" || t.charAt(0) === "-" ? e + parseFloat(t) : parseFloat(t);
@@ -4754,11 +4756,11 @@ class Lr extends te {
4754
4756
  if (r.transform)
4755
4757
  c.fromArray(r.transform);
4756
4758
  else if (r.WGS84) {
4757
- const p = s.geo2world(new M().fromArray(r.WGS84));
4759
+ const p = s.geo2world(new C().fromArray(r.WGS84));
4758
4760
  c.makeTranslation(p.x, p.y, p.z);
4759
4761
  }
4760
4762
  r.autoCut && (r.autoCut = Math.min(Math.max(r.autoCut, 1), 50));
4761
- const u = r.autoCut && r.autoCut > 1, d = !1, l = !1, h = r.showWatermark !== !1, f = { renderer: n, scene: a, controls: o, pointcloudMode: d, bigSceneMode: u, matrix: c, showWatermark: h, depthTest: l };
4763
+ const u = r.autoCut && r.autoCut > 1, l = !1, d = !1, h = r.showWatermark !== !1, f = { renderer: n, scene: a, controls: o, pointcloudMode: l, bigSceneMode: u, matrix: c, showWatermark: h, depthTest: d };
4762
4764
  f.maxRenderCountOfMobile ?? (f.maxRenderCountOfMobile = f.bigSceneMode ? 128 * 10240 : 400 * 1e4), f.maxRenderCountOfPc ?? (f.maxRenderCountOfPc = f.bigSceneMode ? 320 * 1e4 : 400 * 1e4), f.debugMode = this.mapViewer.events.fire(I).debugMode, t.opts = f, t.meta = r, a.add(t), t.initCSS3DSprite(f), t.applyMatrix4(c);
4763
4765
  }).catch((r) => {
4764
4766
  console.error(r.message);
@@ -4772,38 +4774,39 @@ class Lr extends te {
4772
4774
  let a = null;
4773
4775
  n.onclick = () => {
4774
4776
  if (a) return;
4775
- const s = t.position, r = e.controls, c = r.object.position.clone(), u = es ? 6 : 2, d = s.clone().sub(c).normalize(), l = s.clone().sub(d.multiplyScalar(u)), h = { x: c.x, y: c.y, z: c.z, tx: r.target.x, ty: r.target.y, tz: r.target.z }, f = { x: l.x, y: l.y, z: l.z, tx: s.x, ty: s.y, tz: s.z };
4776
- a = new Pr(h).to(f, 3e3), a.easing(Ge.Sinusoidal.InOut).start().onUpdate(() => {
4777
- const p = h.y < 0.1 ? 0.1 : h.y;
4778
- r.object.position.set(h.x, p, h.z), r.target.set(h.tx, h.ty, h.tz);
4777
+ const r = e.controls, c = r.target.clone(), u = r.object.position.clone(), l = t.position.clone(), d = es ? 6 : 2, f = c.clone().sub(u).normalize().clone(), p = l.clone().sub(f.multiplyScalar(d)), m = { x: u.x, y: u.y, z: u.z, tx: c.x, ty: c.y, tz: c.z }, g = { x: p.x, y: p.y, z: p.z, tx: l.x, ty: l.y, tz: l.z };
4778
+ a = new Pr(m).to(g, 3e3), a.easing(Ge.Sinusoidal.InOut).start().onUpdate(() => {
4779
+ r.object.position.set(m.x, m.y, m.z), r.target.set(m.tx, m.ty, m.tz);
4779
4780
  }).onComplete(() => {
4780
4781
  a = null;
4781
4782
  });
4782
- }, n.oncontextmenu = (s) => s.preventDefault();
4783
+ }, n.oncontextmenu = (r) => r.preventDefault();
4783
4784
  const o = new ie(n);
4784
- o.element.style.pointerEvents = "none", o.visible = !1, o.applyMatrix4(e.matrix), t.css3dTag = o, e.scene.add(o), t.onBeforeRender = () => {
4785
+ o.element.style.pointerEvents = "none", o.visible = !1, o.applyMatrix4(e.matrix), t.css3dTag = o, e.scene.add(o);
4786
+ const s = (r) => this.mapViewer.controls._onMouseWheel(r);
4787
+ n.addEventListener("wheel", s, { passive: !1 }), o.dispose = () => n.removeEventListener("wheel", s), t.onBeforeRender = () => {
4785
4788
  a?.update();
4786
- const s = es ? 50 : 30, r = t.position.distanceTo(t.mapViewer.controls.object.position);
4787
- if (r > s) {
4789
+ const r = es ? 50 : 30, c = t.position.distanceTo(t.mapViewer.controls.object.position);
4790
+ if (c > r) {
4788
4791
  t.css3dTag.visible = t.opts.controls.object.position.y > 2;
4789
- let c = 2e-3 * r;
4790
- o.scale.set(c, c, c), t.css3dTag.visible = !0, t.splatMesh && (t.splatMesh.visible = !1);
4792
+ let u = 2e-3 * c;
4793
+ o.scale.set(u, u, u), t.css3dTag.visible = !0, t.splatMesh && (t.splatMesh.visible = !1);
4791
4794
  } else {
4792
4795
  if (!t.active) {
4793
4796
  t.splatMesh && (t.splatMesh.visible = !1);
4794
- let c = 2e-3 * r;
4795
- o.scale.set(c, c, c), t.css3dTag.visible = !0;
4797
+ let u = 2e-3 * c;
4798
+ o.scale.set(u, u, u), t.css3dTag.visible = !0;
4796
4799
  return;
4797
4800
  }
4798
4801
  if (t.lastActiveTime = Date.now(), t.css3dTag.visible = !1, t.splatMesh)
4799
4802
  t.splatMesh.visible = !0;
4800
4803
  else {
4801
- const c = t.meta, u = { ...t.opts };
4802
- c.autoCut && (u.bigSceneMode = !0);
4803
- const d = new pe(u);
4804
- t.splatMesh = d, t.opts.scene.add(d), d.applyMatrix4(t.opts.matrix), d.meta = c;
4805
- const l = c.watermark || c.name || "";
4806
- c.showWatermark = c.showWatermark !== !1, d.fire(Hn, l, !0, !1), d.addModel({ url: t.meta.url }, t.meta);
4804
+ const u = t.meta, l = { ...t.opts };
4805
+ u.autoCut && (l.bigSceneMode = !0);
4806
+ const d = new pe(l);
4807
+ t.splatMesh = d, t.opts.scene.add(d), d.applyMatrix4(t.opts.matrix), d.meta = u;
4808
+ const h = u.watermark || u.name || "";
4809
+ u.showWatermark = u.showWatermark !== !1, d.fire(Hn, h, !0, !1), d.addModel({ url: t.meta.url }, t.meta);
4807
4810
  }
4808
4811
  }
4809
4812
  }, t.onAfterRender = () => {
@@ -4867,7 +4870,7 @@ class Ur extends ba {
4867
4870
  addScenes(e) {
4868
4871
  const t = this;
4869
4872
  fetch(e, { mode: "cors", credentials: "omit", cache: "reload" }).then((n) => n.ok ? n.json() : {}).then((n) => {
4870
- const a = new M().fromArray(n.position || [17e3, 3e4, -35e3]), o = new M().fromArray(n.lookAt || [17e3, 0, -35e3]);
4873
+ const a = new C().fromArray(n.position || [17e3, 3e4, -35e3]), o = new C().fromArray(n.lookAt || [17e3, 0, -35e3]);
4871
4874
  t.controls.object.position.copy(a), t.controls.target.copy(o), t.dirLight.target.position.copy(o);
4872
4875
  const s = /* @__PURE__ */ new Set();
4873
4876
  for (let r of n.scenes)