@reall3d/reall3dviewer 0.0.3 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/pkg.js CHANGED
@@ -1,35 +1,34 @@
1
- import { Vector3 as C, InstancedBufferGeometry as cn, BufferAttribute as He, InstancedBufferAttribute as ca, DynamicDrawUsage as la, ShaderMaterial as In, DoubleSide as we, NormalBlending as da, DataTexture as Ee, RGBAIntegerFormat as _e, UnsignedIntType as Ie, Mesh as te, Vector4 as Se, Vector2 as j, WebGLRenderer as es, PerspectiveCamera as ts, Object3D as Dn, CylinderGeometry as ti, MeshBasicMaterial as xe, PlaneGeometry as ua, Quaternion as It, Controls as ha, MOUSE as Ae, TOUCH as ve, Spherical as ni, Ray as pa, Plane as fa, MathUtils as be, Float32BufferAttribute as ii, InstancedInterleavedBuffer as ln, InterleavedBufferAttribute as We, WireframeGeometry as ga, Box3 as Pn, Sphere as tt, ShaderLib as xt, UniformsUtils as ns, UniformsLib as Ct, Line3 as ma, Matrix4 as Ke, CircleGeometry as De, Group as Ht, BufferGeometry as ya, Raycaster as Aa, SphereGeometry as wa, Color as is, FrontSide as Sa, CatmullRomCurve3 as si, Scene as ss, AmbientLight as as, FogExp2 as ai, DirectionalLight as va, EventDispatcher as ba, Clock as xa } from "three";
2
- import * as gt from "@gotoeasy/three-tile";
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 es, PerspectiveCamera as ts, Object3D as In, CylinderGeometry as ei, MeshBasicMaterial as xe, PlaneGeometry as ua, Quaternion as _t, Controls as ha, MOUSE as Ae, TOUCH as Se, Spherical as ti, Ray as pa, Plane as fa, MathUtils as be, Float32BufferAttribute as ni, InstancedInterleavedBuffer as cn, InterleavedBufferAttribute as We, WireframeGeometry as ga, Box3 as Dn, Sphere as tt, ShaderLib as bt, UniformsUtils as ns, 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 is, FrontSide as va, CatmullRomCurve3 as ii, Scene as ss, AmbientLight as as, FogExp2 as si, DirectionalLight as Sa, EventDispatcher as ba, Clock as xa } from "three";
2
+ import * as ai from "@gotoeasy/three-tile";
3
3
  let A = 1;
4
- const at = A++, Ln = A++, Pe = A++, os = A++, dn = A++, un = A++, rs = A++, Nt = A++, cs = A++, $e = A++, V = A++, Y = A++, ls = A++, hn = A++, Ce = A++, Ne = A++, Be = A++, ft = A++, ds = A++, us = A++, hs = A++, Ca = A++, ps = A++, fs = A++, Rn = A++, Ma = A++, Ta = A++, oi = A++, q = A++;
4
+ const at = A++, Pn = 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++, Ln = A++, Ma = A++, Ta = A++, oi = A++, q = A++;
5
5
  A++;
6
- const oe = A++, ot = A++, Ye = A++, ri = A++, ci = A++, li = A++, gs = A++, ka = A++, di = A++, Xt = A++, Kt = A++, ui = A++, hi = A++, pi = A++, nt = A++, fi = A++, rt = A++, ms = A++, mt = A++, $t = A++, Mt = A++, ys = A++, pn = A++, Ea = A++, Fn = A++, gi = A++, mi = A++, Dt = A++, Pt = A++, Lt = A++, Rt = A++, As = A++, Bn = A++, _ = A++, Ue = A++, ct = A++, B = A++, Wt = A++, ws = A++, _a = A++, ee = A++, fn = A++, re = A++, Ss = A++, vs = A++, bs = A++, xs = A++, gn = A++, Cs = A++, Le = A++, Ms = A++, Ts = A++, Tt = A++, Ia = A++, ks = A++, Es = A++;
6
+ const oe = A++, ot = A++, Ye = A++, ri = A++, ci = A++, li = A++, gs = A++, ka = A++, di = A++, Nt = A++, Xt = A++, ui = A++, hi = A++, pi = A++, nt = A++, fi = A++, rt = A++, ms = A++, gt = A++, $t = A++, Ct = A++, ys = A++, hn = A++, Ea = A++, Fn = A++, gi = A++, mi = A++, It = A++, Dt = A++, Pt = A++, Lt = A++, As = A++, Rn = A++, I = A++, Ue = A++, ct = A++, B = A++, Ht = A++, ws = A++, _a = A++, ee = A++, pn = A++, re = A++, vs = A++, Ss = A++, bs = A++, xs = A++, fn = A++, Cs = A++, Le = A++, Ms = A++, Ts = A++, Mt = A++, Ia = A++, ks = A++, Es = A++;
7
7
  A++;
8
- const Yt = A++, Zt = A++, yi = A++, Ai = A++, mn = A++, Ft = A++, yn = A++, it = A++, ce = A++, Un = A++, _s = A++, Da = A++, Is = A++, wi = A++, Si = A++, Pa = A++, La = A++, kt = A++, Bt = A++, On = A++, Ve = A++, Oe = A++, lt = A++, yt = A++, Ds = A++, N = A++, J = A++, Ra = A++, vi = A++, Ut = A++, Ot = A++, Fa = A++, zn = A++, Qn = A++, Me = A++, st = A++, Ze = A++, Ba = A++, Ps = A++, Ua = A++;
8
+ const Wt = A++, Kt = A++, yi = A++, Ai = A++, gn = A++, Ft = A++, mn = A++, it = A++, ce = A++, Bn = A++, _s = A++, Da = A++, Is = A++, wi = A++, vi = A++, Pa = A++, La = A++, Tt = A++, Rt = A++, Un = A++, Ve = A++, Oe = A++, lt = A++, mt = A++, Ds = A++, N = A++, J = A++, Fa = A++, Si = A++, Bt = A++, Ut = A++, Ra = A++, On = A++, zn = A++, Me = A++, st = A++, Ze = A++, Ba = A++, Ps = A++, Ua = A++;
9
9
  A++;
10
10
  A++;
11
11
  A++;
12
12
  A++;
13
13
  A++;
14
- const Te = A++, dt = A++, Et = A++, An = A++, Ls = A++, Rs = A++, wn = A++, ke = A++, qe = A++, Fs = A++, Hn = A++, bi = A++, Oa = A++, za = A++, Wn = A++, Bs = A++, Yn = A++, Vn = A++, Gn = A++, zt = A++, Us = A++, xi = A++, Qt = A++, ye = A++, Os = A++, zs = A++;
14
+ const Te = A++, dt = A++, kt = A++, yn = A++, Ls = A++, Fs = A++, An = A++, ke = A++, qe = A++, Rs = A++, Qn = A++, bi = A++, Oa = A++, za = A++, Hn = A++, Bs = A++, Wn = A++, Yn = A++, Vn = A++, Ot = A++, Us = A++, xi = A++, zt = A++, ye = A++, Os = A++, zs = A++;
15
15
  A++;
16
- const Je = A++, Qs = A++, Hs = A++, Nn = A++, Ws = A++, Qa = A++, Ys = A++, Ci = A++, Vs = A++, Gs = A++;
16
+ const Je = A++, Qs = A++, Hs = A++, Gn = A++, Ws = A++, Qa = A++, Ys = A++, Ci = A++, Vs = A++, Gs = A++;
17
17
  A++;
18
- const Ns = A++, Xs = A++, X = A++, Sn = A++, vn = A++, bn = A++, Ha = A++, Ks = A++, Wa = A++, Ya = A++, Va = A++, Ga = A++, Na = A++, $s = A++, Zs = A++;
18
+ const Ns = A++, Xs = A++, X = A++, wn = A++, vn = A++, Sn = A++, Ha = A++, $s = A++, Wa = A++, Ya = A++, Va = A++, Ga = A++, Na = A++, Ks = A++, Zs = A++;
19
19
  A++;
20
20
  A++;
21
21
  A++;
22
22
  A++;
23
23
  A++;
24
- class Xn {
24
+ class Nn {
25
25
  constructor() {
26
26
  this.map = /* @__PURE__ */ new Map();
27
27
  }
28
28
  on(e, t = null, n = !1) {
29
29
  if (!e)
30
30
  return console.error("Invalid event key", e), null;
31
- if (!t)
32
- return this.map.get(e);
31
+ if (!t) return this.map.get(e);
33
32
  if (n) {
34
33
  let a = this.map.get(e);
35
34
  a ? typeof a == "function" ? console.error("Invalid event type", "multiFn=true", e) : a.push(t) : (a = [], this.map.set(e, a), a.push(t));
@@ -62,13 +61,13 @@ class Xn {
62
61
  }
63
62
  class Xa {
64
63
  }
65
- class Ka {
64
+ class $a {
66
65
  constructor(e, t = {}) {
67
66
  this.fileSize = 0, this.downloadSize = 0, this.status = 0, this.splatData = null, this.watermarkData = null, this.dataSplatCount = 0, this.watermarkCount = 0, this.sh12Data = [], this.sh3Data = [], this.sh12Count = 0, this.sh3Count = 0, this.rowLength = 0, this.modelSplatCount = -1, this.downloadSplatCount = 0, this.renderSplatCount = 0, this.header = null, this.dataShDegree = 0, this.minX = 1 / 0, this.maxX = -1 / 0, this.minY = 1 / 0, this.maxY = -1 / 0, this.minZ = 1 / 0, this.maxZ = -1 / 0, this.topY = 0, this.currentRadius = 0, this.textWatermarkVersion = 0, this.lastTextWatermarkVersion = 0, this.fetchLimit = 0, this.opts = { ...e }, this.meta = t, t.autoCut && (this.map = /* @__PURE__ */ new Map()), e.format || (e.url?.endsWith(".spx") ? this.opts.format = "spx" : e.url?.endsWith(".splat") ? this.opts.format = "splat" : e.url?.endsWith(".ply") ? this.opts.format = "ply" : e.url?.endsWith(".spz") ? this.opts.format = "spz" : console.error("unknow format!")), this.abortController = new AbortController();
68
67
  }
69
68
  }
70
69
  var L = /* @__PURE__ */ ((i) => (i[i.FetchReady = 0] = "FetchReady", i[i.Fetching = 1] = "Fetching", i[i.FetchDone = 2] = "FetchDone", i[i.FetchAborted = 3] = "FetchAborted", i[i.FetchFailed = 4] = "FetchFailed", i[i.Invalid = 5] = "Invalid", i))(L || {});
71
- const Vt = "v1.5.0-dev-map", le = navigator.userAgent.includes("Mobi"), $a = "QWERTYUIOPLKJHGFDSAZXCVBNM1234567890qwertyuioplkjhgfdsazxcvbnm`~!@#$%^&*()-_=+\\|]}[{'\";::,<.>//? ", ze = 128, Za = 32, F = 32, ja = 20, qa = 16, js = 64 * 1024, Ja = 1024 * 1e4, eo = 10240 * 1e4, _t = 0.28209479177387814, to = 0, no = 20, Kn = 1, ut = 2, $n = 3, io = 3141592653, Zn = "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", jn = "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";
70
+ const Yt = "v1.5.0-dev-map", le = navigator.userAgent.includes("Mobi"), Ka = "QWERTYUIOPLKJHGFDSAZXCVBNM1234567890qwertyuioplkjhgfdsazxcvbnm`~!@#$%^&*()-_=+\\|]}[{'\";::,<.>//? ", ze = 128, Za = 32, R = 32, ja = 20, qa = 16, js = 64 * 1024, Ja = 1024 * 1e4, eo = 10240 * 1e4, Et = 0.28209479177387814, to = 0, no = 20, Xn = 1, ut = 2, $n = 3, io = 3141592653, Kn = "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", Zn = "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";
72
71
  async function so(i) {
73
72
  const e = new Uint32Array(i.buffer), t = new Float32Array(i.buffer), n = new Xa();
74
73
  n.Fixed = String.fromCharCode(i[0]) + String.fromCharCode(i[1]) + String.fromCharCode(i[2]), n.Version = i[3], n.SplatCount = e[1], n.MinX = t[2], n.MaxX = t[3], n.MinY = t[4], n.MaxY = t[5], n.MinZ = t[6], n.MaxZ = t[7], n.MinTopY = t[8], n.MaxTopY = t[9], n.CreateDate = e[10], n.CreaterId = e[11], n.ExclusiveId = e[12], n.ShDegree = i[52], n.Flag1 = i[53], n.Flag2 = i[54], n.Flag3 = i[55], n.Reserve1 = e[14], n.Reserve2 = e[15];
@@ -77,24 +76,24 @@ async function so(i) {
77
76
  a += String.fromCharCode(i[h]);
78
77
  if (n.Comment = a.trim(), n.HashCheck = !0, n.Fixed !== "spx" && n.Version !== 1)
79
78
  return null;
80
- const o = n.CreaterId == 1202056903 ? jn : Zn, s = WebAssembly.compile(Uint8Array.from(atob(o), (h) => h.charCodeAt(0)).buffer), r = new WebAssembly.Memory({ initial: 1, maximum: 1 }), u = (await WebAssembly.instantiate(await s, { env: { memory: r, expf: Gt } })).exports.H;
79
+ const o = n.CreaterId == 1202056903 ? Zn : Kn, s = WebAssembly.compile(Uint8Array.from(atob(o), (h) => h.charCodeAt(0)).buffer), r = new WebAssembly.Memory({ initial: 1, maximum: 1 }), u = (await WebAssembly.instantiate(await s, { env: { memory: r, expf: Vt } })).exports.H;
81
80
  return new Uint8Array(r.buffer).set(i, 0), u(0) && (n.HashCheck = !1), n;
82
81
  }
83
82
  async function fe(i) {
84
- const e = new Uint32Array(i.slice(0, 8).buffer), t = e[0], n = e[1], a = Kn == n, o = ut == n, s = $n == n, r = a || o || s, c = !r, u = n == 20 || r ? jn : Zn, l = t * (r ? qa : F), d = WebAssembly.compile(Uint8Array.from(atob(u), (x) => x.charCodeAt(0)).buffer), h = Math.floor((l + i.byteLength) / js) + 2, f = new WebAssembly.Memory({ initial: h, maximum: h }), y = (await WebAssembly.instantiate(await d, { env: { memory: f, expf: Gt } })).exports.D, g = new Uint8Array(f.buffer);
85
- return g.set(i, l), y(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 };
83
+ const e = new Uint32Array(i.slice(0, 8).buffer), t = e[0], n = e[1], a = Xn == n, o = ut == n, s = $n == n, r = a || o || s, c = !r, u = n == 20 || r ? Zn : Kn, 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 };
86
85
  }
87
- async function xn(i, e) {
88
- const t = WebAssembly.compile(Uint8Array.from(atob(jn), (u) => u.charCodeAt(0)).buffer), n = Math.floor(e * F / js) + 2, a = new WebAssembly.Memory({ initial: n, maximum: n }), s = (await WebAssembly.instantiate(await t, { env: { memory: a, expf: Gt } })).exports.s, r = new Uint8Array(a.buffer);
89
- r.set(i.slice(0, e * F), 0);
86
+ async function bn(i, e) {
87
+ const t = WebAssembly.compile(Uint8Array.from(atob(Zn), (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);
88
+ r.set(i.slice(0, e * R), 0);
90
89
  const c = s(0, e);
91
- return c ? (console.error("splat data parser failed:", c), new Uint8Array(0)) : r.slice(0, e * F);
90
+ return c ? (console.error("splat data parser failed:", c), new Uint8Array(0)) : r.slice(0, e * R);
92
91
  }
93
92
  async function ao(i, e, t = !0, n = !0) {
94
- 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: Gt } })).exports.w, c = new Uint8Array(o.buffer), u = new Float32Array(c.buffer), l = n ? -1 : 1;
95
- return u[0] = i, t ? u[1] = l * e : u[2] = l * e, r(0, t ? 1 : 0), c.slice(0, F);
93
+ const a = WebAssembly.compile(Uint8Array.from(atob(Kn), (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);
96
95
  }
97
- function Gt(i) {
96
+ function Vt(i) {
98
97
  return Math.exp(i);
99
98
  }
100
99
  const Qe = le ? 20480 : 51200;
@@ -115,12 +114,11 @@ async function oo(i) {
115
114
  return;
116
115
  }
117
116
  i.modelSplatCount = c, i.downloadSplatCount = 0, i.splatData = new Uint8Array(Math.min(i.modelSplatCount, i.fetchLimit) * 32), i.watermarkData = new Uint8Array(0);
118
- let u = new Uint8Array(32), l = 0;
117
+ let u = new Uint8Array(32), d = 0;
119
118
  for (; ; ) {
120
- let { done: d, value: h } = await s.read();
121
- if (d)
122
- break;
123
- 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();
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();
124
122
  }
125
123
  } catch (n) {
126
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));
@@ -129,36 +127,36 @@ async function oo(i) {
129
127
  }
130
128
  async function t(n, a, o, s) {
131
129
  return new Promise(async (r) => {
132
- let c = (a + s.byteLength) / n.rowLength | 0, u = (a + s.byteLength) % n.rowLength, l;
133
- 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);
134
- const d = async () => {
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 () => {
135
133
  if (c > Qe) {
136
- const h = await xn(l, Qe);
137
- Mi(n, h), n.downloadSplatCount += Qe, e += Qe * n.rowLength, n.downloadSize = e, c -= Qe, l = l.slice(Qe * n.rowLength), setTimeout(d);
134
+ const h = await bn(d, Qe);
135
+ Mi(n, h), n.downloadSplatCount += Qe, e += Qe * n.rowLength, n.downloadSize = e, c -= Qe, d = d.slice(Qe * n.rowLength), setTimeout(l);
138
136
  } else {
139
- const h = await xn(l, c);
137
+ const h = await bn(d, c);
140
138
  Mi(n, h), n.downloadSplatCount += c, e += c * n.rowLength, n.downloadSize = e, r(u);
141
139
  }
142
140
  };
143
- await d();
141
+ await l();
144
142
  });
145
143
  }
146
144
  }
147
145
  function Mi(i, e) {
148
- let t = e.byteLength / F;
146
+ let t = e.byteLength / R;
149
147
  const n = Math.min(i.fetchLimit, i.modelSplatCount);
150
- i.dataSplatCount + t > n ? (t = n - i.dataSplatCount, i.splatData.set(e.slice(0, t * F), i.dataSplatCount * F)) : i.splatData.set(e, i.dataSplatCount * F);
148
+ i.dataSplatCount + t > n ? (t = n - i.dataSplatCount, i.splatData.set(e.slice(0, t * R), i.dataSplatCount * R)) : i.splatData.set(e, i.dataSplatCount * R);
151
149
  const a = new Float32Array(e.buffer);
152
150
  for (let s = 0, r = 0, c = 0, u = 0; s < t; s++)
153
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);
154
152
  i.dataSplatCount += t;
155
153
  const o = i.header?.MinTopY || 0;
156
- 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);
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);
157
155
  }
158
- function qn(i) {
156
+ function jn(i) {
159
157
  let e = !1;
160
- const t = (p, y, g) => i.on(p, y, g), n = (p, ...y) => i.fire(p, ...y), a = !n(_).renderer;
161
- t(re, () => n(_).debugMode), t(Bn, () => e = !0);
158
+ const t = (p, y, g) => i.on(p, y, g), n = (p, ...y) => i.fire(p, ...y), a = !n(I).renderer;
159
+ t(re, () => n(I).debugMode), t(Rn, () => e = !0);
162
160
  let o = 0;
163
161
  (function p() {
164
162
  o++, !e && requestAnimationFrame(p);
@@ -167,7 +165,7 @@ function qn(i) {
167
165
  e || (g > 0 ? !(o % g) && p(o) : p(o), y && y() && requestAnimationFrame(m));
168
166
  };
169
167
  m();
170
- }), t(Ln, (p, y = null, g = 20) => {
168
+ }), t(Pn, (p, y = null, g = 20) => {
171
169
  const m = () => {
172
170
  e || (p(), y && y() && setTimeout(m, g));
173
171
  };
@@ -175,7 +173,7 @@ function qn(i) {
175
173
  });
176
174
  let s = !1, r = 0, c = 0;
177
175
  t(Ms, () => {
178
- s = !0, n(_).debugMode ? ((async () => {
176
+ s = !0, n(I).debugMode ? ((async () => {
179
177
  const p = document.querySelector("#gsviewer #progressBarWrap");
180
178
  if (p) {
181
179
  p.style.display = "block";
@@ -183,65 +181,66 @@ function qn(i) {
183
181
  y && (y.style.width = "0%");
184
182
  }
185
183
  })(), (async () => document.querySelector("#gsviewer .logo")?.classList.add("loading"))()) : parent?.onProgress && parent.onProgress(1e-3, "0.001%");
186
- }), t(Tt, (p) => {
184
+ }), t(Mt, (p) => {
187
185
  p && (r = p), s = !1, p !== void 0 && ((async () => {
188
186
  const y = document.querySelector("#gsviewer #progressBarWrap");
189
187
  y && (y.style.display = "none");
190
188
  })(), (async () => document.querySelector("#gsviewer .logo")?.classList.remove("loading"))(), parent?.onProgress && parent.onProgress(0, "100%", 9));
191
189
  }), t(Ts, (p) => {
192
- s = !0, n(_).debugMode ? (async () => {
190
+ s = !0, n(I).debugMode ? (async () => {
193
191
  const y = document.querySelector("#gsviewer #progressBar");
194
192
  y && (y.style.width = `${p}%`);
195
193
  })() : parent?.onProgress && parent.onProgress(p, `${p}%`);
196
194
  }), t(Ia, () => s), t(ks, (p) => {
197
195
  c = p;
198
196
  }), t(Es, () => !s && r && c >= r), t(Ue, () => {
199
- const y = n($e).parentElement.getBoundingClientRect();
197
+ const y = n(Ke).parentElement.getBoundingClientRect();
200
198
  return { width: y.width, height: y.height, left: y.left, top: y.top };
201
199
  }), t(Le, (p) => {
202
200
  let y = p.x.toFixed(3).split("."), g = p.y.toFixed(3).split("."), m = p.z.toFixed(3).split(".");
203
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(".")}`;
204
202
  }), t(Ma, (p) => btoa(p)), t(Ta, (p) => atob(p));
205
203
  const u = 1e-3;
206
- let l = new C(), d = new C(), h = 0;
204
+ let d = new M(), l = new M(), h = 0;
207
205
  t(_a, () => {
208
- const p = n(V), y = p.fov, g = p.position.clone(), m = p.getWorldDirection(new C());
209
- return Math.abs(h - y) < u && Math.abs(g.x - l.x) < u && Math.abs(g.y - l.y) < u && Math.abs(g.z - l.z) < u && Math.abs(m.x - d.x) < u && Math.abs(m.y - d.y) < u && Math.abs(m.z - d.z) < u ? !1 : (h = y, l = g, d = m, !0);
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);
210
208
  }), t(ke, (p) => {
211
- if (!p)
212
- return;
209
+ if (!p) return;
213
210
  const y = [];
214
211
  p.traverse((g) => y.push(g)), y.forEach((g) => {
215
212
  g.dispose ? g.dispose() : (g.geometry?.dispose?.(), g.material && g.material instanceof Array ? g.material.forEach((m) => m?.dispose?.()) : g.material?.dispose?.());
216
213
  }), p.clear();
217
- }), t(oe, async ({
218
- renderSplatCount: p,
219
- visibleSplatCount: y,
220
- modelSplatCount: g,
221
- fps: m,
222
- realFps: x,
223
- sortTime: b,
224
- fov: S,
225
- position: T,
226
- lookUp: w,
227
- lookAt: I,
228
- worker: v,
229
- scene: D,
230
- // updateSceneData,
231
- scale: k,
232
- cuts: M,
233
- shDegree: R
234
- } = {}) => {
235
- if (!n(re))
236
- return;
237
- R !== void 0 && f("shDegree", `${R}`), p !== void 0 && f("renderSplatCount", `${p}`), y !== void 0 && f("visibleSplatCount", `${y}`), g !== void 0 && f("modelSplatCount", `${g}`), m !== void 0 && f("fps", m), x !== void 0 && f("realFps", `raw ${x}`), b !== void 0 && f("sort", `${b} ms`), !a && n(ee) ? M !== void 0 && f("cuts", `(${M} cuts)`) : f("cuts", ""), v && f("worker", `${v}`), D && f("scene", D), S && f("fov", S), T && f("position", T), w && f("lookUp", w), I && f("lookAt", I), I && f("viewer-version", Vt);
238
- let E = performance.memory || { usedJSHeapSize: 0, totalJSHeapSize: 0, jsHeapSizeLimit: 0 }, P = "", U = E.usedJSHeapSize / 1024 / 1024;
239
- U > 1e3 ? P += (U / 1024).toFixed(2) + " G" : P += U.toFixed(0) + " M", P += " / ";
240
- let O = E.totalJSHeapSize / 1024 / 1024;
241
- O > 1e3 ? P += (O / 1024).toFixed(2) + " G" : P += O.toFixed(0) + " M";
242
- let W = E.jsHeapSizeLimit / 1024 / 1024;
243
- P += " / ", W > 1e3 ? P += (W / 1024).toFixed(2) + " G" : P += W.toFixed(0) + " M", f("memory", P), k && f("scale", k);
244
- });
214
+ }), t(
215
+ oe,
216
+ async ({
217
+ renderSplatCount: p,
218
+ visibleSplatCount: y,
219
+ modelSplatCount: g,
220
+ fps: m,
221
+ realFps: C,
222
+ sortTime: S,
223
+ fov: v,
224
+ position: k,
225
+ lookUp: b,
226
+ lookAt: x,
227
+ worker: w,
228
+ scene: D,
229
+ // updateSceneData,
230
+ scale: _,
231
+ cuts: T,
232
+ shDegree: F
233
+ } = {}) => {
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);
236
+ let E = performance.memory || { usedJSHeapSize: 0, totalJSHeapSize: 0, jsHeapSizeLimit: 0 }, P = "", U = E.usedJSHeapSize / 1024 / 1024;
237
+ U > 1e3 ? P += (U / 1024).toFixed(2) + " G" : P += U.toFixed(0) + " M", P += " / ";
238
+ let O = E.totalJSHeapSize / 1024 / 1024;
239
+ O > 1e3 ? P += (O / 1024).toFixed(2) + " G" : P += O.toFixed(0) + " M";
240
+ let W = E.jsHeapSizeLimit / 1024 / 1024;
241
+ P += " / ", W > 1e3 ? P += (W / 1024).toFixed(2) + " G" : P += W.toFixed(0) + " M", f("memory", P), _ && f("scale", _);
242
+ }
243
+ );
245
244
  async function f(p, y) {
246
245
  let g = document.querySelector(`#gsviewer .debug .${p}`);
247
246
  g && (g.innerText = y);
@@ -266,7 +265,7 @@ async function qs(i) {
266
265
  function ne(i) {
267
266
  return i < 0 ? 0 : i > 255 ? 255 : i | 0;
268
267
  }
269
- function At(i) {
268
+ function yt(i) {
270
269
  const e = ne(Math.round(i * 128) + 128);
271
270
  return ne(Math.floor((e + 4) / 8) * 8);
272
271
  }
@@ -285,82 +284,81 @@ async function lo(i) {
285
284
  return;
286
285
  }
287
286
  i.fileSize = o;
288
- let r = [], c = new Uint8Array(ze), u = new Uint8Array(F), l = 0, d = !1, h = 0, f = 0, p, y = !1;
287
+ let r = [], c = new Uint8Array(ze), u = new Uint8Array(R), d = 0, l = !1, h = 0, f = 0, p, y = !1;
289
288
  for (; ; ) {
290
289
  let { done: g, value: m } = await a.read();
291
- if (g)
292
- break;
290
+ if (g) break;
293
291
  if (i.downloadSize += m.byteLength, r) {
294
292
  r.push(m);
295
- let S = 0;
296
- for (let I = 0; I < r.length; I++)
297
- S += r[I].byteLength;
298
- if (S < ze)
293
+ let v = 0;
294
+ for (let x = 0; x < r.length; x++)
295
+ v += r[x].byteLength;
296
+ if (v < ze)
299
297
  continue;
300
- let T = 0;
301
- for (let I = 0; I < r.length; I++)
302
- T + r[I].byteLength < ze ? (c.set(r[I], T), T += r[I].byteLength) : (c.set(r[I].slice(0, ze - T), T), m = new Uint8Array(r[I].slice(ze - T)));
303
- const w = await so(c);
304
- if (!w) {
298
+ let k = 0;
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)));
301
+ const b = await so(c);
302
+ if (!b) {
305
303
  i.abortController.abort(), i.status === L.Fetching && (i.status = L.Invalid), console.error("invalid spx format");
306
304
  continue;
307
305
  }
308
- if (i.header = w, i.modelSplatCount = w.SplatCount, i.dataShDegree = w.ShDegree, i.aabbCenter = new C((w.MaxX + w.MaxX) / 2, (w.MinY + w.MaxY) / 2, (w.MinZ + w.MaxZ) / 2), r = null, c = null, !co.includes(w.ExclusiveId)) {
309
- i.abortController.abort(), i.status = L.Invalid, console.error("Unrecognized format, creater id =", w.CreaterId, ", exclusive id =", w.ExclusiveId, w.Comment);
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)) {
307
+ i.abortController.abort(), i.status = L.Invalid, console.error("Unrecognized format, creater id =", b.CreaterId, ", exclusive id =", b.ExclusiveId, b.Comment);
310
308
  continue;
311
309
  }
312
310
  }
313
- if (!d) {
314
- if (l + m.byteLength < 4) {
315
- u.set(m, l), l += m.byteLength;
311
+ if (!l) {
312
+ if (d + m.byteLength < 4) {
313
+ u.set(m, d), d += m.byteLength;
316
314
  continue;
317
315
  }
318
- const S = new Uint8Array(l + m.byteLength);
319
- S.set(u.slice(0, l), 0), S.set(m, l), m = S.slice(4), l = 0, d = !0, p = [], f = 0;
320
- const T = new Int32Array(S.slice(0, 4).buffer);
321
- y = T[0] < 0, h = Math.abs(T[0]);
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;
318
+ const k = new Int32Array(v.slice(0, 4).buffer);
319
+ y = k[0] < 0, h = Math.abs(k[0]);
322
320
  }
323
- let x = f + m.byteLength;
324
- if (p.push(m), x < h) {
321
+ let C = f + m.byteLength;
322
+ if (p.push(m), C < h) {
325
323
  f += m.byteLength;
326
324
  continue;
327
325
  }
328
- for (; x >= h; ) {
329
- let S = new Uint8Array(h), T = 0;
330
- for (let I = 0; I < p.length; I++)
331
- T + p[I].byteLength < h ? (S.set(p[I], T), T += p[I].byteLength) : (S.set(p[I].slice(0, h - T), T), m = new Uint8Array(p[I].slice(h - T)));
332
- y && (S = await qs(S));
333
- const w = await fe(S);
334
- if (!w.success) {
335
- console.error("spx block data parser failed. block format:", w.blockFormat), i.abortController.abort(), i.status = L.Invalid;
326
+ for (; C >= h; ) {
327
+ let v = new Uint8Array(h), k = 0;
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));
331
+ const b = await fe(v);
332
+ if (!b.success) {
333
+ console.error("spx block data parser failed. block format:", b.blockFormat), i.abortController.abort(), i.status = L.Invalid;
336
334
  break;
337
335
  }
338
- if (w.isSplat)
339
- i.downloadSplatCount += w.datas.byteLength / 32, uo(i, w.datas);
336
+ if (b.isSplat)
337
+ i.downloadSplatCount += b.datas.byteLength / 32, uo(i, b.datas);
340
338
  else {
341
- const I = Math.min(i.fetchLimit, i.modelSplatCount);
342
- if (w.isSh3)
343
- if (i.sh3Count + w.splatCount > I) {
344
- const v = I - i.sh3Count;
345
- i.sh3Data.push(w.datas.slice(0, v * 16)), i.sh3Count += v;
339
+ const x = Math.min(i.fetchLimit, i.modelSplatCount);
340
+ if (b.isSh3)
341
+ if (i.sh3Count + b.splatCount > x) {
342
+ const w = x - i.sh3Count;
343
+ i.sh3Data.push(b.datas.slice(0, w * 16)), i.sh3Count += w;
346
344
  } else
347
- i.sh3Data.push(w.datas), i.sh3Count += w.splatCount;
348
- else if (i.sh12Count + w.splatCount > I) {
349
- const v = I - i.sh12Count;
350
- i.sh12Data.push(w.datas.slice(0, v * 16)), i.sh12Count += v;
345
+ i.sh3Data.push(b.datas), i.sh3Count += b.splatCount;
346
+ else if (i.sh12Count + b.splatCount > x) {
347
+ const w = x - i.sh12Count;
348
+ i.sh12Data.push(b.datas.slice(0, w * 16)), i.sh12Count += w;
351
349
  } else
352
- i.sh12Data.push(w.datas), i.sh12Count += w.splatCount;
350
+ i.sh12Data.push(b.datas), i.sh12Count += b.splatCount;
353
351
  }
354
352
  if (m.byteLength < 4) {
355
- u.set(m, 0), l = m.byteLength, d = !1;
353
+ u.set(m, 0), d = m.byteLength, l = !1;
356
354
  break;
357
355
  } else {
358
- const I = new Int32Array(m.slice(0, 4).buffer);
359
- h = Math.abs(I[0]), y = I[0] < 0, m = m.slice(4), x = m.byteLength, p = [m], f = m.byteLength;
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;
360
358
  }
361
359
  }
362
- const b = i.fetchLimit;
363
- i.header.ShDegree === 3 ? i.downloadSplatCount >= b && i.sh12Count >= b && i.sh3Count >= b && i.abortController.abort() : i.header.ShDegree ? i.downloadSplatCount >= b && i.sh12Count >= b && i.abortController.abort() : i.downloadSplatCount >= b && i.abortController.abort();
360
+ const S = i.fetchLimit;
361
+ i.header.ShDegree === 3 ? i.downloadSplatCount >= S && i.sh12Count >= S && i.sh3Count >= S && i.abortController.abort() : i.header.ShDegree ? i.downloadSplatCount >= S && i.sh12Count >= S && i.abortController.abort() : i.downloadSplatCount >= S && i.abortController.abort();
364
362
  }
365
363
  } catch (e) {
366
364
  e.name === "AbortError" ? (console.log("Fetch Abort", i.opts.url), i.status === L.Fetching && (i.status = L.FetchAborted)) : (console.error(e), i.status === L.Fetching && (i.status = L.FetchFailed), i.abortController.abort());
@@ -373,48 +371,48 @@ function uo(i, e) {
373
371
  const a = 4096;
374
372
  if (!t) {
375
373
  const c = Math.min(i.fetchLimit, i.modelSplatCount);
376
- if (!i.splatData && (i.splatData = new Uint8Array(c * F)), !i.watermarkData && (i.watermarkData = new Uint8Array(0)), i.dataSplatCount + n > c && (n = c - i.dataSplatCount, !n))
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))
377
375
  return;
378
- const u = new Float32Array(e.buffer), l = new Uint32Array(e.buffer);
376
+ const u = new Float32Array(e.buffer), d = new Uint32Array(e.buffer);
379
377
  for (let h = 0, f = 0, p = 0, y = 0; h < n; h++)
380
- 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), l[h * 8 + 3] >> 16) {
381
- if (i.watermarkCount * F === i.watermarkData.byteLength) {
382
- const g = new Uint8Array((i.watermarkCount + a) * F);
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) {
379
+ if (i.watermarkCount * R === i.watermarkData.byteLength) {
380
+ const g = new Uint8Array((i.watermarkCount + a) * R);
383
381
  g.set(i.watermarkData, 0), i.watermarkData = g;
384
382
  }
385
- i.watermarkData.set(e.slice(h * 32, h * 32 + 32), i.watermarkCount++ * F);
383
+ i.watermarkData.set(e.slice(h * 32, h * 32 + 32), i.watermarkCount++ * R);
386
384
  } else
387
- i.splatData.set(e.slice(h * 32, h * 32 + 32), i.dataSplatCount++ * F);
388
- const d = i.header.MinTopY || 0;
389
- i.currentRadius = Math.sqrt(i.maxX * i.maxX + d * d + i.maxZ * i.maxZ);
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);
390
388
  return;
391
389
  }
392
390
  let o = Math.min(Math.max(i.meta.autoCut, 2), 50);
393
391
  !i.watermarkData && (i.watermarkData = new Uint8Array(0));
394
392
  const s = new Float32Array(e.buffer), r = new Uint32Array(e.buffer);
395
- for (let c = 0, u = Math.floor(e.byteLength / F), l = 0, d = 0, h = 0, f = ""; c < u; c++) {
393
+ for (let c = 0, u = Math.floor(e.byteLength / R), d = 0, l = 0, h = 0, f = ""; c < u; c++) {
396
394
  if (r[c * 8 + 3] >> 16) {
397
- if (i.watermarkCount * F === i.watermarkData.byteLength) {
398
- const m = new Uint8Array((i.watermarkCount + a) * F);
395
+ if (i.watermarkCount * R === i.watermarkData.byteLength) {
396
+ const m = new Uint8Array((i.watermarkCount + a) * R);
399
397
  m.set(i.watermarkData, 0), i.watermarkData = m;
400
398
  }
401
- i.watermarkData.set(e.slice(c * 32, c * 32 + 32), i.watermarkCount++ * F);
399
+ i.watermarkData.set(e.slice(c * 32, c * 32 + 32), i.watermarkCount++ * R);
402
400
  continue;
403
401
  }
404
- l = s[c * 8], d = s[c * 8 + 1], h = s[c * 8 + 2];
405
- let p = Math.min(o - 1, Math.floor(Math.max(0, l - 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));
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));
406
404
  f = `${p}-${y}`;
407
405
  let g = i.map.get(f);
408
406
  if (!g)
409
- 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 * F), g.splatData.set(e.slice(c * F, c * F + F), 0), g.splatCount = 1, i.map.set(f, 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);
410
408
  else {
411
- if (g.splatData.byteLength / F == g.splatCount) {
412
- const S = new Uint8Array(g.splatData.byteLength + a * F);
413
- S.set(g.splatData, 0), g.splatData = S;
409
+ if (g.splatData.byteLength / R == g.splatCount) {
410
+ const v = new Uint8Array(g.splatData.byteLength + a * R);
411
+ v.set(g.splatData, 0), g.splatData = v;
414
412
  }
415
- 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;
416
- const m = g.maxX - g.minX, x = g.maxY - g.minY, b = g.maxZ - g.minZ;
417
- g.radius = Math.sqrt(m * m + x * x + b * b) / 2, g.splatData.set(e.slice(c * F, c * F + F), g.splatCount++ * F);
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);
418
416
  }
419
417
  i.dataSplatCount++;
420
418
  }
@@ -430,24 +428,23 @@ async function ho(i) {
430
428
  }
431
429
  const r = s.body.getReader(), c = parseInt(s.headers.get("content-length") || "0");
432
430
  i.fileSize = c, i.downloadSize = 0, i.downloadSplatCount = 0, i.watermarkData = new Uint8Array(0);
433
- let u = new Uint8Array(256), l = 0, d = [], h;
431
+ let u = new Uint8Array(256), d = 0, l = [], h;
434
432
  for (; ; ) {
435
433
  let { done: f, value: p } = await r.read();
436
- if (f)
437
- break;
438
- if (i.downloadSize += p.byteLength, d) {
439
- if (d.push(p), i.downloadSize < 200)
434
+ if (f) break;
435
+ if (i.downloadSize += p.byteLength, l) {
436
+ if (l.push(p), i.downloadSize < 200)
440
437
  continue;
441
438
  const y = new Uint8Array(i.downloadSize);
442
- for (let g = 0, m = 0; g < d.length; g++)
443
- y.set(d[g], m), m += d[g].byteLength;
439
+ for (let g = 0, m = 0; g < l.length; g++)
440
+ y.set(l[g], m), m += l[g].byteLength;
444
441
  if (h = n(y), !h) {
445
- d = [y];
442
+ l = [y];
446
443
  continue;
447
444
  }
448
- d = 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
+ 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);
449
446
  }
450
- 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();
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();
451
448
  }
452
449
  } catch (a) {
453
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));
@@ -456,15 +453,15 @@ async function ho(i) {
456
453
  }
457
454
  async function e(a, o, s, r, c) {
458
455
  return new Promise(async (u) => {
459
- let l = (s + c.byteLength) / o.rowLength | 0, d = (s + c.byteLength) % o.rowLength, h;
460
- 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);
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);
461
458
  const f = async () => {
462
- if (l > je) {
459
+ if (d > je) {
463
460
  const p = await t(a, h, je);
464
- Ti(o, p), o.downloadSplatCount += je, l -= je, h = h.slice(je * o.rowLength), setTimeout(f);
461
+ Ti(o, p), o.downloadSplatCount += je, d -= je, h = h.slice(je * o.rowLength), setTimeout(f);
465
462
  } else {
466
- const p = await t(a, h, l);
467
- Ti(o, p), o.downloadSplatCount += l, u(d);
463
+ const p = await t(a, h, d);
464
+ Ti(o, p), o.downloadSplatCount += d, u(l);
468
465
  }
469
466
  };
470
467
  await f();
@@ -472,59 +469,58 @@ async function ho(i) {
472
469
  }
473
470
  async function t(a, o, s) {
474
471
  const r = new Uint8Array(s * Za), c = new Float32Array(o.buffer), u = new Float32Array(r.buffer);
475
- for (let l = 0; l < s; l++)
476
- 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 + _t * c[(l * i.rowLength + a.offsets.f_dc_0) / 4]) * 255), r[l * 32 + 25] = ne((0.5 + _t * c[(l * i.rowLength + a.offsets.f_dc_1) / 4]) * 255), r[l * 32 + 26] = ne((0.5 + _t * 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);
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);
477
474
  if (a.shDegree == 3) {
478
- const d = new Uint8Array(s * 24 + 8), h = new Uint8Array(s * 21 + 8), f = new Uint32Array(2);
479
- f[0] = s, f[1] = ut, d.set(new Uint8Array(f.buffer), 0);
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);
480
477
  const p = new Uint32Array(2);
481
478
  p[0] = s, p[1] = $n, h.set(new Uint8Array(p.buffer), 0);
482
- for (let m = 0, x = 0; m < s; m++)
483
- for (let b = 0; b < 8; b++)
484
- for (let S = 0; S < 3; S++)
485
- d[8 + x++] = At(c[(m * i.rowLength + a.offsets["f_rest_" + (b + S * 15)]) / 4]);
486
- for (let m = 0, x = 0; m < s; m++)
487
- for (let b = 8; b < 15; b++)
488
- for (let S = 0; S < 3; S++)
489
- h[8 + x++] = At(c[(m * i.rowLength + a.offsets["f_rest_" + (b + S * 15)]) / 4]);
490
- const y = await fe(d);
479
+ for (let m = 0, C = 0; m < s; m++)
480
+ for (let S = 0; S < 8; S++)
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++)
484
+ for (let S = 8; S < 15; S++)
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);
491
488
  i.sh12Data.push(y.datas);
492
489
  const g = await fe(h);
493
490
  i.sh3Data.push(g.datas);
494
491
  } else if (a.shDegree == 2) {
495
- const d = new Uint8Array(s * 24 + 8), h = new Uint32Array(2);
496
- h[0] = s, h[1] = ut, d.set(new Uint8Array(h.buffer), 0);
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);
497
494
  for (let p = 0, y = 0; p < s; p++)
498
495
  for (let g = 0; g < 8; g++)
499
496
  for (let m = 0; m < 3; m++)
500
- d[8 + y++] = At(c[(p * i.rowLength + a.offsets["f_rest_" + (g + m * 8)]) / 4]);
501
- const f = await fe(d);
497
+ l[8 + y++] = yt(c[(p * i.rowLength + a.offsets["f_rest_" + (g + m * 8)]) / 4]);
498
+ const f = await fe(l);
502
499
  i.sh12Data.push(f.datas);
503
500
  } else if (a.shDegree == 1) {
504
- const d = new Uint8Array(s * 9 + 8), h = new Uint32Array(2);
505
- h[0] = s, h[1] = Kn, d.set(new Uint8Array(h.buffer), 0);
501
+ const l = new Uint8Array(s * 9 + 8), h = new Uint32Array(2);
502
+ h[0] = s, h[1] = Xn, l.set(new Uint8Array(h.buffer), 0);
506
503
  for (let p = 0, y = 0; p < s; p++)
507
504
  for (let g = 0; g < 3; g++)
508
505
  for (let m = 0; m < 3; m++)
509
- d[8 + y++] = At(c[(p * i.rowLength + a.offsets["f_rest_" + (g + m * 3)]) / 4]);
510
- const f = await fe(d);
506
+ l[8 + y++] = yt(c[(p * i.rowLength + a.offsets["f_rest_" + (g + m * 3)]) / 4]);
507
+ const f = await fe(l);
511
508
  i.sh12Data.push(f.datas);
512
509
  }
513
- return await xn(r, s);
510
+ return await bn(r, s);
514
511
  }
515
512
  function n(a) {
516
513
  let o = new TextDecoder().decode(a.slice(0, 2048));
517
514
  const s = `end_header
518
515
  `, r = o.indexOf(s);
519
516
  if (r < 0) {
520
- if (a.byteLength > 1024 * 2)
521
- throw new Error("Unable to read .ply file header");
517
+ if (a.byteLength > 1024 * 2) throw new Error("Unable to read .ply file header");
522
518
  return null;
523
519
  }
524
520
  if (!o.startsWith("ply") || o.indexOf("format binary_little_endian 1.0") < 0)
525
521
  throw new Error("Unknow .ply file header");
526
522
  const c = parseInt(/element vertex (\d+)\n/.exec(o)[1]);
527
- let u = 0, l = {}, d = {};
523
+ let u = 0, d = {}, l = {};
528
524
  const h = {
529
525
  double: "getFloat64",
530
526
  int: "getInt32",
@@ -536,32 +532,32 @@ async function ho(i) {
536
532
  };
537
533
  for (let y of o.slice(0, r).split(`
538
534
  `).filter((g) => g.startsWith("property "))) {
539
- const [g, m, x] = y.split(" "), b = h[m] || "getInt8";
540
- d[x] = b, l[x] = u, u += parseInt(b.replace(/[^\d]/g, "")) / 8;
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;
541
537
  }
542
538
  let f = 0;
543
- d.f_rest_44 ? f = 3 : d.f_rest_23 ? f = 2 : d.f_rest_8 && (f = 1);
539
+ l.f_rest_44 ? f = 3 : l.f_rest_23 ? f = 2 : l.f_rest_8 && (f = 1);
544
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"];
545
541
  for (let y = 0; y < p.length; y++) {
546
542
  const g = p[y];
547
- if (!d[g])
543
+ if (!l[g])
548
544
  throw new Error(`Property not found: ${g}`);
549
545
  }
550
- return { headerLength: r + s.length, offsets: l, rowLength: u, vertexCount: c, shDegree: f };
546
+ return { headerLength: r + s.length, offsets: d, rowLength: u, vertexCount: c, shDegree: f };
551
547
  }
552
548
  }
553
549
  function Ti(i, e) {
554
- let t = e.byteLength / F;
550
+ let t = e.byteLength / R;
555
551
  const n = Math.min(i.fetchLimit, i.modelSplatCount);
556
- i.dataSplatCount + t > n ? (t = n - i.dataSplatCount, i.splatData.set(e.slice(0, t * F), i.dataSplatCount * F)) : i.splatData.set(e, i.dataSplatCount * F);
552
+ i.dataSplatCount + t > n ? (t = n - i.dataSplatCount, i.splatData.set(e.slice(0, t * R), i.dataSplatCount * R)) : i.splatData.set(e, i.dataSplatCount * R);
557
553
  const a = new Float32Array(e.buffer);
558
554
  for (let s = 0, r = 0, c = 0, u = 0; s < t; s++)
559
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);
560
556
  i.dataSplatCount += t;
561
557
  const o = 0;
562
- 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);
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);
563
559
  }
564
- const z = le ? 20480 : 51200, jt = 16;
560
+ const z = le ? 20480 : 51200, Zt = 16;
565
561
  async function po(i) {
566
562
  try {
567
563
  i.status = L.Fetching;
@@ -575,85 +571,84 @@ async function po(i) {
575
571
  const u = new Uint8Array(c);
576
572
  for (; ; ) {
577
573
  let { done: h, value: f } = await r.read();
578
- if (h)
579
- break;
574
+ if (h) break;
580
575
  u.set(f, i.downloadSize), i.downloadSize += f.length;
581
576
  }
582
- const l = await qs(u);
583
- if (!l || l.length < 16) {
577
+ const d = await qs(u);
578
+ if (!d || d.length < 16) {
584
579
  console.error("Invalid spz format"), i.status = L.Invalid;
585
580
  return;
586
581
  }
587
- const d = n(l);
588
- i.modelSplatCount = d.numPoints, i.dataShDegree = d.shDegree, i.splatData = new Uint8Array(Math.min(i.modelSplatCount, i.fetchLimit) * 32), await e(d, i, l);
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);
589
584
  } catch (a) {
590
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));
591
586
  } finally {
592
587
  i.status === L.Fetching && (i.status = L.FetchDone);
593
588
  }
594
589
  async function e(a, o, s) {
595
- const r = a.numPoints * 9, c = a.numPoints, u = a.numPoints * 3, l = a.numPoints * 3, d = a.numPoints * 3, h = jt, f = h + r, p = f + c, y = p + u, g = y + l, m = g + d, x = Math.min(a.numPoints, o.fetchLimit), b = Math.ceil(x / z);
596
- for (let S = 0; S < b; S++) {
597
- let T = S < b - 1 ? z : x - S * z;
598
- o.dataSplatCount + T > o.fetchLimit && (T = o.fetchLimit - o.dataSplatCount);
599
- const w = new Uint8Array(T * 20 + 8), I = new Uint32Array(2);
600
- I[0] = T, I[1] = no, w.set(new Uint8Array(I.buffer), 0);
601
- let v = 8;
602
- for (let M = 0; M < T; M++)
603
- w[v++] = s[h + (S * z + M) * 9 + 0], w[v++] = s[h + (S * z + M) * 9 + 1], w[v++] = s[h + (S * z + M) * 9 + 2];
604
- for (let M = 0; M < T; M++)
605
- w[v++] = s[h + (S * z + M) * 9 + 3], w[v++] = s[h + (S * z + M) * 9 + 4], w[v++] = s[h + (S * z + M) * 9 + 5];
606
- for (let M = 0; M < T; M++)
607
- w[v++] = s[h + (S * z + M) * 9 + 6], w[v++] = s[h + (S * z + M) * 9 + 7], w[v++] = s[h + (S * z + M) * 9 + 8];
608
- for (let M = 0; M < T; M++)
609
- w[v++] = s[y + (S * z + M) * 3];
610
- for (let M = 0; M < T; M++)
611
- w[v++] = s[y + (S * z + M) * 3 + 1];
612
- for (let M = 0; M < T; M++)
613
- w[v++] = s[y + (S * z + M) * 3 + 2];
614
- for (let M = 0; M < T; M++)
615
- w[v++] = qt(s[p + (S * z + M) * 3]);
616
- for (let M = 0; M < T; M++)
617
- w[v++] = qt(s[p + (S * z + M) * 3 + 1]);
618
- for (let M = 0; M < T; M++)
619
- w[v++] = qt(s[p + (S * z + M) * 3 + 2]);
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);
591
+ for (let v = 0; v < S; v++) {
592
+ let k = v < S - 1 ? z : C - v * z;
593
+ o.dataSplatCount + k > o.fetchLimit && (k = o.fetchLimit - o.dataSplatCount);
594
+ const b = new Uint8Array(k * 20 + 8), x = new Uint32Array(2);
595
+ x[0] = k, x[1] = no, b.set(new Uint8Array(x.buffer), 0);
596
+ let w = 8;
597
+ for (let T = 0; T < k; T++)
598
+ b[w++] = s[h + (v * z + T) * 9 + 0], b[w++] = s[h + (v * z + T) * 9 + 1], b[w++] = s[h + (v * z + T) * 9 + 2];
599
+ for (let T = 0; T < k; T++)
600
+ b[w++] = s[h + (v * z + T) * 9 + 3], b[w++] = s[h + (v * z + T) * 9 + 4], b[w++] = s[h + (v * z + T) * 9 + 5];
601
+ for (let T = 0; T < k; T++)
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
+ for (let T = 0; T < k; T++)
604
+ b[w++] = s[y + (v * z + T) * 3];
605
+ for (let T = 0; T < k; T++)
606
+ b[w++] = s[y + (v * z + T) * 3 + 1];
607
+ for (let T = 0; T < k; T++)
608
+ b[w++] = s[y + (v * z + T) * 3 + 2];
609
+ for (let T = 0; T < k; T++)
610
+ b[w++] = jt(s[p + (v * z + T) * 3]);
611
+ for (let T = 0; T < k; T++)
612
+ b[w++] = jt(s[p + (v * z + T) * 3 + 1]);
613
+ for (let T = 0; T < k; T++)
614
+ b[w++] = jt(s[p + (v * z + T) * 3 + 2]);
620
615
  const D = [];
621
- for (let M = 0, R = 0, E = 0, P = 0; M < T; M++)
622
- w[v++] = s[f + (S * z + M)], R = s[g + (S * z + M) * 3 + 0], E = s[g + (S * z + M) * 3 + 1], P = s[g + (S * z + M) * 3 + 2], D.push(fo(R, E, P));
623
- for (let M = 0; M < T; M++)
624
- w[v++] = D[M][0];
625
- for (let M = 0; M < T; M++)
626
- w[v++] = D[M][1];
627
- for (let M = 0; M < T; M++)
628
- w[v++] = D[M][2];
629
- for (let M = 0; M < T; M++)
630
- w[v++] = D[M][3];
631
- const k = await fe(w);
632
- if (t(a, o, k.datas), a.shDegree === 1) {
633
- const M = new Uint8Array(T * 9 + 8), R = new Uint32Array(2);
634
- R[0] = T, R[1] = Kn, M.set(new Uint8Array(R.buffer), 0);
635
- for (let P = 0, U = 8; P < T; P++)
636
- M.set(s.slice(m + (S * z + P) * 9, m + (S * z + P) * 9 + 9), U), U += 9;
637
- const E = await fe(M);
616
+ for (let T = 0, F = 0, E = 0, P = 0; T < k; T++)
617
+ b[w++] = s[f + (v * z + T)], F = s[g + (v * z + T) * 3 + 0], E = s[g + (v * z + T) * 3 + 1], P = s[g + (v * z + T) * 3 + 2], D.push(fo(F, E, P));
618
+ for (let T = 0; T < k; T++)
619
+ b[w++] = D[T][0];
620
+ for (let T = 0; T < k; T++)
621
+ b[w++] = D[T][1];
622
+ for (let T = 0; T < k; T++)
623
+ b[w++] = D[T][2];
624
+ for (let T = 0; T < k; T++)
625
+ b[w++] = D[T][3];
626
+ const _ = await fe(b);
627
+ if (t(a, o, _.datas), a.shDegree === 1) {
628
+ const T = new Uint8Array(k * 9 + 8), F = new Uint32Array(2);
629
+ F[0] = k, F[1] = Xn, T.set(new Uint8Array(F.buffer), 0);
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;
632
+ const E = await fe(T);
638
633
  o.sh12Data.push(E.datas);
639
634
  } else if (a.shDegree === 2) {
640
- const M = new Uint8Array(T * 24 + 8), R = new Uint32Array(2);
641
- R[0] = T, R[1] = ut, M.set(new Uint8Array(R.buffer), 0);
642
- for (let P = 0, U = 8; P < T; P++)
643
- M.set(s.slice(m + (S * z + P) * 24, m + (S * z + P) * 24 + 24), U), U += 24;
644
- const E = await fe(M);
635
+ const T = new Uint8Array(k * 24 + 8), F = new Uint32Array(2);
636
+ F[0] = k, F[1] = ut, T.set(new Uint8Array(F.buffer), 0);
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;
639
+ const E = await fe(T);
645
640
  o.sh12Data.push(E.datas);
646
641
  } else if (a.shDegree === 3) {
647
- const M = new Uint8Array(T * 24 + 8), R = new Uint32Array(2);
648
- R[0] = T, R[1] = ut, M.set(new Uint8Array(R.buffer), 0);
649
- for (let W = 0, se = 8; W < T; W++)
650
- M.set(s.slice(m + (S * z + W) * 45, m + (S * z + W) * 45 + 24), se), se += 24;
651
- const E = await fe(M);
642
+ const T = new Uint8Array(k * 24 + 8), F = new Uint32Array(2);
643
+ F[0] = k, F[1] = ut, T.set(new Uint8Array(F.buffer), 0);
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;
646
+ const E = await fe(T);
652
647
  o.sh12Data.push(E.datas);
653
- const P = new Uint8Array(T * 21 + 8), U = new Uint32Array(2);
654
- U[0] = T, U[1] = $n, P.set(new Uint8Array(U.buffer), 0);
655
- for (let W = 0, se = 8; W < T; W++)
656
- P.set(s.slice(m + (S * z + W) * 45 + 24, m + (S * z + W) * 45 + 45), se), se += 21;
648
+ const P = new Uint8Array(k * 21 + 8), U = new Uint32Array(2);
649
+ U[0] = k, U[1] = $n, P.set(new Uint8Array(U.buffer), 0);
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;
657
652
  const O = await fe(P);
658
653
  o.sh3Data.push(O.datas);
659
654
  }
@@ -662,168 +657,163 @@ async function po(i) {
662
657
  }
663
658
  }
664
659
  function t(a, o, s) {
665
- let r = s.byteLength / F;
660
+ let r = s.byteLength / R;
666
661
  const c = Math.min(o.fetchLimit, a.numPoints);
667
- o.dataSplatCount + r > c ? (r = c - o.dataSplatCount, o.splatData.set(s.slice(0, r * F), o.dataSplatCount * F)) : o.splatData.set(s, o.dataSplatCount * F);
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);
668
663
  const u = new Float32Array(s.buffer);
669
- for (let d = 0, h = 0, f = 0, p = 0; d < r; d++)
670
- 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);
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);
671
666
  o.dataSplatCount += r, o.downloadSplatCount += r;
672
- const l = 0;
673
- 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);
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);
674
669
  }
675
670
  function n(a) {
676
- const o = a.slice(0, jt), s = new Uint32Array(o.buffer), r = {};
677
- if (r.magic = s[0], r.version = s[1], r.numPoints = s[2], r.shDegree = o[12], r.fractionalBits = o[13], r.flags = o[14], r.reserved = o[15], r.magic !== 1347635022)
678
- throw new Error("[SPZ ERROR] header not found");
679
- if (r.version !== 2)
680
- throw new Error("[SPZ ERROR] ersion not supported:" + r.version);
681
- if (r.shDegree > 3)
682
- throw new Error("[SPZ ERROR] unsupported SH degree:" + r.shDegree);
683
- if (r.fractionalBits !== 12)
684
- throw new Error("[SPZ ERROR] unsupported FractionalBits:" + r.fractionalBits);
671
+ const o = a.slice(0, Zt), s = new Uint32Array(o.buffer), r = {};
672
+ if (r.magic = s[0], r.version = s[1], r.numPoints = s[2], r.shDegree = o[12], r.fractionalBits = o[13], r.flags = o[14], r.reserved = o[15], r.magic !== 1347635022) throw new Error("[SPZ ERROR] header not found");
673
+ if (r.version !== 2) throw new Error("[SPZ ERROR] ersion not supported:" + r.version);
674
+ if (r.shDegree > 3) throw new Error("[SPZ ERROR] unsupported SH degree:" + r.shDegree);
675
+ if (r.fractionalBits !== 12) throw new Error("[SPZ ERROR] unsupported FractionalBits:" + r.fractionalBits);
685
676
  let c = 0;
686
- if (r.shDegree === 1 ? c = 9 : r.shDegree === 2 ? c = 24 : r.shDegree === 3 && (c = 45), a.length !== jt + r.numPoints * (19 + c))
687
- throw new Error("[SPZ ERROR] invalid spz data");
677
+ if (r.shDegree === 1 ? c = 9 : r.shDegree === 2 ? c = 24 : r.shDegree === 3 && (c = 45), a.length !== Zt + r.numPoints * (19 + c)) throw new Error("[SPZ ERROR] invalid spz data");
688
678
  return r;
689
679
  }
690
680
  }
691
- function qt(i) {
681
+ function jt(i) {
692
682
  const e = (i - 127.5) / 38.25;
693
- return ne((0.5 + _t * e) * 255);
683
+ return ne((0.5 + Et * e) * 255);
694
684
  }
695
685
  function fo(i, e, t) {
696
686
  const n = i / 127.5 - 1, a = e / 127.5 - 1, o = t / 127.5 - 1, s = Math.sqrt(Math.max(0, 1 - (n * n + a * a + o * o)));
697
687
  return [ne(s * 128 + 128), ne(n * 128 + 128), ne(a * 128 + 128), ne(o * 128 + 128)];
698
688
  }
699
689
  function go(i) {
700
- const e = (x, b, S) => i.on(x, b, S), t = (x, ...b) => i.fire(x, ...b);
690
+ const e = (C, S, v) => i.on(C, S, v), t = (C, ...S) => i.fire(C, ...S);
701
691
  let n, a = Date.now() + 36e5, o = null, s, r = { index: 0, version: 0 }, c = { version: 0 }, u = !1;
702
- const l = t(ee);
703
- e(Ys, () => s?.aabbCenter || new C());
704
- let d;
705
- const h = new Promise((x) => d = x);
692
+ const d = t(ee);
693
+ e(Ys, () => s?.aabbCenter || new M());
694
+ let l;
695
+ const h = new Promise((C) => l = C);
706
696
  e(ot, async () => {
707
- const x = t(_);
708
- let b = le ? x.maxRenderCountOfMobile : x.maxRenderCountOfPc;
709
- if (!x.bigSceneMode) {
710
- let S = await h;
711
- b = Math.min(S, b) + 10240;
697
+ const C = t(I);
698
+ let S = le ? C.maxRenderCountOfMobile : C.maxRenderCountOfPc;
699
+ if (!C.bigSceneMode) {
700
+ let v = await h;
701
+ S = Math.min(v, S) + 10240;
712
702
  }
713
- return b;
714
- }), e(Je, async (x) => {
715
- const b = t(_);
716
- if (b.bigSceneMode) return 1;
717
- let S = le ? b.maxRenderCountOfMobile : b.maxRenderCountOfPc, T = await h;
718
- if (S = Math.min(T, S), !s.dataShDegree) return 1;
719
- if (x >= 3) {
703
+ return S;
704
+ }), e(Je, async (C) => {
705
+ const S = t(I);
706
+ if (S.bigSceneMode) return 1;
707
+ let v = le ? S.maxRenderCountOfMobile : S.maxRenderCountOfPc, k = await h;
708
+ if (v = Math.min(k, v), !s.dataShDegree) return 1;
709
+ if (C >= 3) {
720
710
  if (s.dataShDegree < 3) return 1;
721
- } else if (x >= 1) {
711
+ } else if (C >= 1) {
722
712
  if (s.dataShDegree < 1) return 1;
723
713
  } else
724
714
  return 1;
725
- const w = 1024 * 2;
726
- return Math.ceil(S / w);
727
- }), e(Nn, async () => t(_).bigSceneMode ? 0 : (await h, s.dataShDegree)), e(Hn, async (x, b = !0) => {
715
+ const b = 1024 * 2;
716
+ return Math.ceil(v / b);
717
+ }), e(Gn, async () => t(I).bigSceneMode ? 0 : (await h, s.dataShDegree)), e(Qn, async (C, S = !0) => {
728
718
  try {
729
719
  await h;
730
- const S = !!s.header?.Flag2;
731
- o = await t(Fs, x, b, S), s && (s.textWatermarkVersion = Date.now());
720
+ const v = !!s.header?.Flag2;
721
+ o = await t(Rs, C, S, v), s && (s.textWatermarkVersion = Date.now());
732
722
  } catch {
733
723
  console.info("failed to generate watermark");
734
724
  }
735
- }), e(mn, () => {
736
- if (l) return r.version <= c.version ? r.xyz : c.xyz;
725
+ }), e(gn, () => {
726
+ if (d) return r.version <= c.version ? r.xyz : c.xyz;
737
727
  if (s?.status === L.FetchDone || s?.status === L.FetchAborted) {
738
728
  if (s.activePoints && s.activePoints.length === void 0) return s.activePoints;
739
- const x = {}, b = r.xyz;
740
- for (let S = 0, T = b.length / 3, w = 0, I = 0, v = 0, D = ""; S < T; S++)
741
- w = b[S * 3], I = b[S * 3 + 1], v = b[S * 3 + 2], D = `${Math.floor(w / 2) * 2 + 1},${Math.floor(I / 2) * 2 + 1},${Math.floor(v / 2) * 2 + 1}`, (x[D] = x[D] || []).push(w, I, v);
742
- return s.activePoints = x;
729
+ const C = {}, S = r.xyz;
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;
743
733
  }
744
734
  return r.xyz;
745
735
  });
746
- async function f(x) {
736
+ async function f(C) {
747
737
  if (n) return;
748
738
  if (s && (s.status === L.Invalid || s.status === L.FetchFailed))
749
- return t(_).viewerEvents?.fire(q), t(Tt, 0) || t(oe, { renderSplatCount: 0, visibleSplatCount: 0, modelSplatCount: 0 });
739
+ return t(I).viewerEvents?.fire(q), t(Mt, 0) || t(oe, { renderSplatCount: 0, visibleSplatCount: 0, modelSplatCount: 0 });
750
740
  if (!s || !s.downloadSize) return;
751
- const b = s.status !== L.FetchReady && s.status !== L.Fetching;
752
- if (b) {
753
- const S = Math.min(s.fetchLimit, s.downloadSplatCount);
754
- !s.notifyFetchStopDone && (s.notifyFetchStopDone = !0) && t(Tt, S);
741
+ const S = s.status !== L.FetchReady && s.status !== L.Fetching;
742
+ if (S) {
743
+ const v = Math.min(s.fetchLimit, s.downloadSplatCount);
744
+ !s.notifyFetchStopDone && (s.notifyFetchStopDone = !0) && t(Mt, v);
755
745
  } else
756
746
  t(Ts, 100 * s.downloadSize / s.fileSize);
757
747
  s.downloadSplatCount && (u || (u = !0, setTimeout(async () => {
758
- await p(b), u = !1;
748
+ await p(S), u = !1;
759
749
  })));
760
750
  }
761
- async function p(x) {
751
+ async function p(C) {
762
752
  if (n) return;
763
- const b = r, S = await t(ot), T = o;
764
- let w = s.dataSplatCount, I = x ? s.watermarkCount : 0, v = s.meta.showWatermark && x ? (T?.byteLength || 0) / 32 : 0;
765
- if (s.renderSplatCount = w + I + v, s.renderSplatCount >= S && (s.renderSplatCount = S, I = 0, v = 0, w > S && (w = S)), t(oe, { visibleSplatCount: s.renderSplatCount, modelSplatCount: s.modelSplatCount + v }), Date.now() - b.textureReadyTime < (le ? 600 : 300) || s.smallSceneUploadDone && s.lastTextWatermarkVersion == s.textWatermarkVersion) return;
766
- if (!b.version) {
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;
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
+ if (!S.version) {
767
757
  t(ms, (s.header?.Flag2 ? s.header.MaxTopY : s.header?.MinTopY) || 0);
768
758
  let O = s.opts.format;
769
759
  s.opts.format == "spx" && (O = "spx" + (s.header.ExclusiveId ? (" " + s.header.ExclusiveId).substring(0, 6) : "")), t(oe, { scene: `small (${O})` });
770
760
  }
771
- s.lastTextWatermarkVersion = s.textWatermarkVersion, b.textureReady = !1;
772
- const D = 1024 * 2, k = Math.ceil(2 * S / D), M = new Uint32Array(D * k * 4), R = new Float32Array(M.buffer), E = new Uint8Array(M.buffer);
773
- E.set(s.splatData.slice(0, w * 32), 0), I && E.set(s.watermarkData.slice(0, I * 32), w * 32), v && E.set(T.slice(0, v * 32), (w + I) * 32);
761
+ s.lastTextWatermarkVersion = s.textWatermarkVersion, S.textureReady = !1;
762
+ const D = 1024 * 2, _ = Math.ceil(2 * v / D), T = new Uint32Array(D * _ * 4), F = new Float32Array(T.buffer), E = new Uint8Array(T.buffer);
763
+ E.set(s.splatData.slice(0, b * 32), 0), x && E.set(s.watermarkData.slice(0, x * 32), b * 32), w && E.set(k.slice(0, w * 32), (b + x) * 32);
774
764
  const P = new Float32Array(s.renderSplatCount * 3);
775
765
  for (let O = 0, W = 0; O < s.renderSplatCount; O++)
776
- P[O * 3] = R[O * 8], P[O * 3 + 1] = R[O * 8 + 1], P[O * 3 + 2] = R[O * 8 + 2];
766
+ P[O * 3] = F[O * 8], P[O * 3 + 1] = F[O * 8 + 1], P[O * 3 + 2] = F[O * 8 + 2];
777
767
  const U = Date.now();
778
- if (b.version = U, b.txdata = M, b.xyz = P, b.renderSplatCount = s.renderSplatCount, b.visibleSplatCount = s.downloadSplatCount + v, b.modelSplatCount = s.downloadSplatCount + v, b.watermarkCount = I + v, b.minX = s.minX, b.maxX = s.maxX, b.minY = s.minY, b.maxY = s.maxY, b.minZ = s.minZ, b.maxZ = s.maxZ, t(zs, b, s.currentRadius, s.currentRadius), a = U, x && !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, C && !s.smallSceneUploadDone) {
779
769
  s.smallSceneUploadDone = !0, t(Qs, s.sh12Data), t(Hs, s.sh3Data), s.sh12Data = null, s.sh3Data = null;
780
- const O = t(_);
781
- t(Fn, O.shDegree === void 0 ? 3 : O.shDegree), t(mn);
770
+ const O = t(I);
771
+ t(Fn, O.shDegree === void 0 ? 3 : O.shDegree), t(gn);
782
772
  }
783
773
  t(oe, { renderSplatCount: s.renderSplatCount });
784
774
  }
785
775
  function y() {
786
776
  n || (n = !0, s?.abortController?.abort(), s?.map?.clear(), s = null, o = null, r = null, c = null);
787
777
  }
788
- function g(x) {
789
- if (x.opts.format === "spx")
790
- lo(x);
791
- else if (x.opts.format === "splat")
792
- oo(x);
793
- else if (x.opts.format === "ply")
794
- ho(x);
795
- else if (x.opts.format === "spz")
796
- po(x);
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);
797
787
  else
798
788
  return !1;
799
789
  return !0;
800
790
  }
801
- async function m(x, b) {
791
+ async function m(C, S) {
802
792
  if (n) return;
803
- const S = t(_), T = le ? S.maxRenderCountOfMobile : S.maxRenderCountOfPc, w = t(ee);
804
- if (x.fetchReload = ro(b.updateDate || 0), s = new Ka(x, b), w && b.autoCut) {
805
- const D = b.pcDownloadLimitSplatCount || eo, k = b.mobileDownloadLimitSplatCount || Ja, M = le ? k : D;
806
- s.fetchLimit = Math.min(b.autoCut * b.autoCut * T + T, M);
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) {
795
+ const D = S.pcDownloadLimitSplatCount || eo, _ = S.mobileDownloadLimitSplatCount || Ja, T = le ? _ : D;
796
+ s.fetchLimit = Math.min(S.autoCut * S.autoCut * k + k, T);
807
797
  } else
808
- s.fetchLimit = T;
809
- const I = Date.now(), v = () => {
798
+ s.fetchLimit = k;
799
+ const x = Date.now(), w = () => {
810
800
  if (!s || s.status == L.Invalid || s.status == L.FetchFailed)
811
- return d(0);
801
+ return l(0);
812
802
  if (s.modelSplatCount >= 0)
813
- d(s.modelSplatCount), setTimeout(() => t(Cs), 5);
803
+ l(s.modelSplatCount), setTimeout(() => t(Cs), 5);
814
804
  else {
815
- if (Date.now() - I >= 3e3)
816
- return d(0);
817
- setTimeout(v, 10);
805
+ if (Date.now() - x >= 3e3)
806
+ return l(0);
807
+ setTimeout(w, 10);
818
808
  }
819
809
  };
820
- if (v(), !g(s)) {
821
- console.error("Unsupported format:", x.format), t(Tt, 0);
810
+ if (w(), !g(s)) {
811
+ console.error("Unsupported format:", C.format), t(Mt, 0);
822
812
  return;
823
813
  }
824
814
  t(Ms);
825
815
  }
826
- e(Ss, async (x, b) => await m(x, b)), e(vs, (x = 1e4) => Date.now() - a < x), e(bs, () => y()), t(
816
+ e(vs, async (C, S) => await m(C, S)), e(Ss, (C = 1e4) => Date.now() - a < C), e(bs, () => y()), t(
827
817
  at,
828
818
  async () => await f(),
829
819
  () => !n
@@ -1176,7 +1166,7 @@ function wo() {
1176
1166
  }
1177
1167
  `;
1178
1168
  }
1179
- const ki = "currentVisibleRadius", Ei = "currentLightRadius", Js = "realFocusPosition", Jt = "splatShTexture12", en = "splatShTexture3", _i = "performanceNow", So = "waterMarkColor", Ii = "showWaterMark", tn = "splatTexture0", nn = "splatTexture1", Di = "bigSceneMode", Pi = "lightFactor", Li = "debugEffect", Ri = "usingIndex", vo = "cycleColor", bo = "splatIndex", Fi = "pointMode", Bi = "markPoint", Ui = "shDegree", ht = "viewport", Cn = "opacity", Oi = "focal", zi = "topY";
1169
+ const ki = "currentVisibleRadius", Ei = "currentLightRadius", Js = "realFocusPosition", qt = "splatShTexture12", Jt = "splatShTexture3", _i = "performanceNow", vo = "waterMarkColor", Ii = "showWaterMark", en = "splatTexture0", tn = "splatTexture1", Di = "bigSceneMode", Pi = "lightFactor", Li = "debugEffect", Fi = "usingIndex", So = "cycleColor", bo = "splatIndex", Ri = "pointMode", Bi = "markPoint", Ui = "shDegree", ht = "viewport", xn = "opacity", Oi = "focal", zi = "topY";
1180
1170
  let Q = 0;
1181
1171
  Q++;
1182
1172
  const Qi = `$${Q++}`;
@@ -1191,34 +1181,32 @@ const Do = `$${Q++}`;
1191
1181
  Q++;
1192
1182
  const Po = `$${Q++}`;
1193
1183
  Q++;
1194
- const Lo = `$${Q++}`, Ro = `$${Q++}`, Fo = `$${Q++}`, Bo = `$${Q++}`, Uo = `$${Q++}`, Oo = `$${Q++}`, zo = `$${Q++}`, Qo = `$${Q++}`;
1184
+ const Lo = `$${Q++}`, Fo = `$${Q++}`, Ro = `$${Q++}`, Bo = `$${Q++}`, Uo = `$${Q++}`, Oo = `$${Q++}`, zo = `$${Q++}`, Qo = `$${Q++}`;
1195
1185
  Q++;
1196
1186
  function Ho(i) {
1197
1187
  let e = !1;
1198
- const t = (d, h, f) => i.on(d, h, f), n = (d, ...h) => i.fire(d, ...h);
1188
+ const t = (l, h, f) => i.on(l, h, f), n = (l, ...h) => i.fire(l, ...h);
1199
1189
  let a = 0, o = 0;
1200
1190
  const s = [];
1201
1191
  let r = 0;
1202
1192
  t(Ws, () => r), t(ci, async () => {
1203
- const d = new cn();
1204
- d.setIndex([0, 1, 2, 0, 2, 3]);
1193
+ const l = new rn();
1194
+ l.setIndex([0, 1, 2, 0, 2, 3]);
1205
1195
  const h = new Float32Array(4 * 3), f = new He(h, 3);
1206
- 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;
1207
- let p = new cn().copy(d);
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);
1208
1198
  const y = await n(ot);
1209
- if (e)
1210
- return;
1199
+ if (e) return;
1211
1200
  const g = new Uint32Array(y), m = new ca(g, 1, !1);
1212
- return m.setUsage(la), m.needsUpdate = !0, p.setAttribute(bo, m), p.instanceCount = 0, t(ui, (x, b, S, T) => {
1213
- n(pi, b), g.set(x, 0), m.clearUpdateRanges(), m.addUpdateRange(0, x.length), m.needsUpdate = !0, p.instanceCount = x.length, n(N), n(oe, { sortTime: `${S} / ${Date.now() - T}` });
1201
+ return m.setUsage(la), m.needsUpdate = !0, p.setAttribute(bo, m), p.instanceCount = 0, t(ui, (C, S, v, k) => {
1202
+ n(pi, 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}` });
1214
1203
  }), t(ka, () => p), t(gi, () => {
1215
1204
  m.array = null, p.dispose();
1216
1205
  }), p;
1217
1206
  }), t(li, async () => {
1218
- const d = await n(ot);
1219
- if (e)
1220
- return;
1221
- const h = 1024 * 2, f = Math.ceil(2 * d / h), p = n(_), y = new In({
1207
+ const l = await n(ot);
1208
+ if (e) return;
1209
+ const h = 1024 * 2, f = Math.ceil(2 * l / h), p = n(I), y = new _n({
1222
1210
  uniforms: n(ri),
1223
1211
  vertexShader: mo(),
1224
1212
  fragmentShader: yo(),
@@ -1232,129 +1220,130 @@ function Ho(i) {
1232
1220
  side: we
1233
1221
  }), g = new Uint32Array(h * f * 4);
1234
1222
  let m = new Ee(g, h, f, _e, Ie);
1235
- m.internalFormat = "RGBA32UI", m.needsUpdate = !0, y.uniforms[tn].value = m;
1236
- const x = n(ee) ? f : 1, b = new Uint32Array(h * x * 4);
1237
- let S = new Ee(b, h, x, _e, Ie);
1238
- S.internalFormat = "RGBA32UI", S.needsUpdate = !0, y.uniforms[nn].value = S;
1239
- const T = await n(Je, 1), w = new Uint32Array(h * T * 4);
1240
- let I = new Ee(w, h, T, _e, Ie);
1241
- I.internalFormat = "RGBA32UI", I.needsUpdate = !0, y.uniforms[Jt].value = I;
1242
- const v = await n(Je, 3), D = new Uint32Array(h * v * 4);
1243
- let k = new Ee(D, h, v, _e, Ie);
1244
- k.internalFormat = "RGBA32UI", k.needsUpdate = !0, y.uniforms[en].value = k, y.needsUpdate = !0;
1245
- let M = !1;
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;
1227
+ const k = await n(Je, 1), b = new Uint32Array(h * k * 4);
1228
+ let x = new Ee(b, h, k, _e, Ie);
1229
+ x.internalFormat = "RGBA32UI", x.needsUpdate = !0, y.uniforms[qt].value = x;
1230
+ const w = await n(Je, 3), D = new Uint32Array(h * w * 4);
1231
+ let _ = new Ee(D, h, w, _e, Ie);
1232
+ _.internalFormat = "RGBA32UI", _.needsUpdate = !0, y.uniforms[Jt].value = _, y.needsUpdate = !0;
1233
+ let T = !1;
1246
1234
  t(hi, (E) => {
1247
1235
  if (!n(ee)) {
1248
- if (M && !E.renderSplatCount)
1249
- return;
1250
- M = !E.renderSplatCount;
1236
+ if (T && !E.renderSplatCount) return;
1237
+ T = !E.renderSplatCount;
1251
1238
  }
1252
1239
  const P = E.txdata;
1253
1240
  E.txdata = null;
1254
1241
  const U = new Ee(P, h, f, _e, Ie);
1255
1242
  U.onUpdate = () => {
1256
- E.textureReady = !0, E.textureReadyTime = Date.now(), l(E), n(ks, E.renderSplatCount);
1257
- }, U.internalFormat = "RGBA32UI", U.needsUpdate = !0, E.index ? (y.uniforms[nn].value = U, S = U) : (y.uniforms[tn].value = U, m = U), y.needsUpdate = !0, n(N);
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);
1258
1245
  }), t(Qs, async (E) => {
1259
- if (n(ee) || !E || !E.length)
1260
- return;
1246
+ if (n(ee) || !E || !E.length) return;
1261
1247
  const P = new Uint32Array(h * await n(Je, 1) * 4), U = new Uint8Array(P.buffer);
1262
1248
  for (let W = 0, se = 0; W < E.length; W++)
1263
1249
  U.set(E[W], se), se += E[W].byteLength;
1264
- const O = new Ee(P, h, T, _e, Ie);
1265
- O.internalFormat = "RGBA32UI", O.needsUpdate = !0, y.uniforms[Jt].value = O, y.needsUpdate = !0, n(N);
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);
1266
1252
  }), t(Hs, async (E) => {
1267
- if (n(ee) || !E || !E.length)
1268
- return;
1253
+ if (n(ee) || !E || !E.length) return;
1269
1254
  const P = new Uint32Array(h * await n(Je, 3) * 4), U = new Uint8Array(P.buffer);
1270
1255
  for (let W = 0, se = 0; W < E.length; W++)
1271
1256
  U.set(E[W], se), se += E[W].byteLength;
1272
- const O = new Ee(P, h, T, _e, Ie);
1273
- O.internalFormat = "RGBA32UI", O.needsUpdate = !0, y.uniforms[en].value = O, y.needsUpdate = !0, n(N);
1274
- }), t(di, () => y), t(Xt, () => {
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(di, () => y), t(Nt, () => {
1275
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(di);
1276
1261
  se.uniforms[Oi].value.set(O, W), se.uniformsNeedUpdate = !0, n(N);
1277
- }), t(Kt, () => {
1262
+ }), t(Xt, () => {
1278
1263
  const { width: E, height: P } = n(Ue);
1279
1264
  y.uniforms[ht].value.set(E, P), y.uniformsNeedUpdate = !0, n(N);
1280
1265
  }), t(pi, (E) => {
1281
- y.uniforms[Ri].value = E, y.uniformsNeedUpdate = !0, n(N);
1266
+ y.uniforms[Fi].value = E, y.uniformsNeedUpdate = !0, n(N);
1282
1267
  }), t(nt, (E) => {
1283
- const P = n(_);
1284
- E === void 0 && (E = !P.pointcloudMode), y.uniforms[Fi].value = E ? 1 : 0, y.uniformsNeedUpdate = !0, P.pointcloudMode = E, n(N), P.viewerEvents && (P.viewerEvents.fire(_).pointcloudMode = E);
1268
+ const P = n(I);
1269
+ E === void 0 && (E = !P.pointcloudMode), y.uniforms[Ri].value = E ? 1 : 0, y.uniformsNeedUpdate = !0, P.pointcloudMode = E, n(N), P.viewerEvents && (P.viewerEvents.fire(I).pointcloudMode = E);
1285
1270
  }), t(fi, (E) => {
1286
1271
  y.uniforms[Di].value = E ? 1 : 0, y.uniformsNeedUpdate = !0;
1287
- const P = n(_);
1272
+ const P = n(I);
1288
1273
  P.bigSceneMode = E, n(N);
1289
1274
  }), t(rt, (E) => {
1290
1275
  y.uniforms[Pi].value = E, y.uniformsNeedUpdate = !0;
1291
- const P = n(_);
1276
+ const P = n(I);
1292
1277
  P.lightFactor = E, n(N);
1293
1278
  });
1294
- let R = !1;
1279
+ let F = !1;
1295
1280
  return t(ms, (E) => {
1296
- n(ee) || R || (R = !0, y.uniforms[zi].value = E, y.uniformsNeedUpdate = !0, n(N));
1297
- }), t(mt, (E) => {
1281
+ n(ee) || F || (F = !0, y.uniforms[zi].value = E, y.uniformsNeedUpdate = !0, n(N));
1282
+ }), t(gt, (E) => {
1298
1283
  y.uniforms[ki].value = E, y.uniformsNeedUpdate = !0, n(N);
1299
1284
  }), t($t, (E) => {
1300
1285
  y.uniforms[Ei].value = E, y.uniformsNeedUpdate = !0, n(N);
1301
- }), t(Mt, (E, P, U, O) => {
1286
+ }), t(Ct, (E, P, U, O) => {
1302
1287
  y.uniforms[Bi].value = [E, P, U, O ? 1 : -1], y.uniformsNeedUpdate = !0, n(N);
1303
- }), t(pn, (E = !0) => {
1288
+ }), t(hn, (E = !0) => {
1304
1289
  y.uniforms[Ii].value = E ? 1 : 0, y.uniformsNeedUpdate = !0, n(N);
1305
1290
  }), t(ys, (E) => {
1306
1291
  y.uniforms[_i].value = E, y.uniformsNeedUpdate = !0;
1307
1292
  }), t(Ea, (E) => {
1308
1293
  y.uniforms[Li].value = E, y.uniformsNeedUpdate = !0;
1309
1294
  }), t(Fn, async (E) => {
1310
- if (n(ee))
1311
- return;
1312
- const P = await n(Nn);
1295
+ if (n(ee)) return;
1296
+ const P = await n(Gn);
1313
1297
  E < 0 && (E = 0), E > P && (E = P), r = E, y.uniforms[Ui].value = E, y.uniformsNeedUpdate = !0, n(oe, { shDegree: `${E} / max ${P}` }), n(N);
1314
1298
  }), t(mi, () => {
1315
- y.dispose(), m && m.dispose(), S && S.dispose(), I && I.dispose(), k && k.dispose();
1299
+ y.dispose(), m && m.dispose(), v && v.dispose(), x && x.dispose(), _ && _.dispose();
1316
1300
  }), y;
1317
1301
  }), t(gs, async () => {
1318
- const d = new te(await n(ci), await n(li));
1319
- return n(Xt), n(Kt), n(fi, n(ee)), n(nt, n(fn)), d;
1302
+ const l = new te(await n(ci), await n(li));
1303
+ return n(Nt), n(Xt), n(fi, n(ee)), n(nt, n(pn)), l;
1320
1304
  });
1321
1305
  function c() {
1322
- n(Xt), n(Kt);
1306
+ n(Nt), n(Xt);
1323
1307
  }
1324
1308
  window.addEventListener("resize", c), t(xs, () => {
1325
1309
  e = !0, window.removeEventListener("resize", c), n(gi), n(mi);
1326
1310
  }), t(Cs, async () => {
1327
- if (n(ee))
1328
- return;
1329
- let d = 0.01, h = 0.01, f = !1, p = 0;
1330
- n(mt, h), n(at, () => {
1331
- if (e || o <= h)
1332
- return;
1333
- h += (o - h) * d, n(mt, h);
1334
- let y = n(Es);
1335
- y && !p && (p = Date.now());
1336
- let g = h / a;
1337
- y && (g > 0.9 || Date.now() - p > 2500) ? (n(fn) && n(gn, !0), n(mt, 0), f = !0) : y && g > 0.7 ? d = Math.min(d * 1.2, 0.3) : y && g > 0.5 ? d = Math.min(d * 1.2, 0.2) : g > 0.4 && (d = Math.min(d * 1.05, 0.1));
1338
- }, () => !e && !f, 3);
1339
- }), t(gn, (d = !1) => {
1340
- if (n(ee))
1341
- return;
1342
- for (; s.length; )
1343
- s.pop().stop = !0;
1344
- const h = n(_), f = a * 1e-3;
1311
+ if (n(ee)) return;
1312
+ let l = 0.01, h = 0.01, f = !1, p = 0;
1313
+ n(gt, h), n(
1314
+ at,
1315
+ () => {
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());
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));
1322
+ },
1323
+ () => !e && !f,
1324
+ 3
1325
+ );
1326
+ }), t(fn, (l = !1) => {
1327
+ if (n(ee)) return;
1328
+ for (; s.length; ) s.pop().stop = !0;
1329
+ const h = n(I), f = a * 1e-3;
1345
1330
  let p = { currentPointMode: h.pointcloudMode, stepRate: 15e-4, currentLightRadius: f, stop: !1 };
1346
- s.push(p), n(at, () => {
1347
- 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(_)?.viewerEvents?.fire(dt), n(_)?.viewerEvents?.fire(Us)) : p.currentLightRadius / a < 0.4 ? p.stepRate = Math.min(p.stepRate * 1.02, 0.03) : p.stepRate *= 1.04);
1348
- }, () => !e && !p.stop);
1331
+ s.push(p), n(
1332
+ at,
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);
1335
+ },
1336
+ () => !e && !p.stop
1337
+ );
1349
1338
  }), t(ri, () => ({
1339
+ [en]: { type: "t", value: null },
1350
1340
  [tn]: { type: "t", value: null },
1351
- [nn]: { type: "t", value: null },
1341
+ [qt]: { type: "t", value: null },
1352
1342
  [Jt]: { type: "t", value: null },
1353
- [en]: { type: "t", value: null },
1354
1343
  [Oi]: { type: "v2", value: new j() },
1355
1344
  [ht]: { type: "v2", value: new j() },
1356
- [Ri]: { type: "int", value: 0 },
1357
1345
  [Fi]: { type: "int", value: 0 },
1346
+ [Ri]: { type: "int", value: 0 },
1358
1347
  [Li]: { type: "int", value: 1 },
1359
1348
  [Di]: { type: "int", value: 0 },
1360
1349
  [Ui]: { type: "int", value: 0 },
@@ -1362,78 +1351,79 @@ function Ho(i) {
1362
1351
  [zi]: { type: "float", value: 0 },
1363
1352
  [ki]: { type: "float", value: 0 },
1364
1353
  [Ei]: { type: "float", value: 0 },
1365
- [Bi]: { type: "v4", value: new Se(0, 0, 0, -1) },
1354
+ [Bi]: { type: "v4", value: new ve(0, 0, 0, -1) },
1366
1355
  [_i]: { type: "float", value: performance.now() },
1367
- [So]: { type: "v4", value: new Se(1, 1, 0, 0.5) },
1356
+ [vo]: { type: "v4", value: new ve(1, 1, 0, 0.5) },
1368
1357
  [Ii]: { type: "int", value: 1 }
1369
1358
  }));
1370
1359
  const u = n(cs);
1371
- u.onmessage = (d) => {
1372
- const h = d.data;
1360
+ u.onmessage = (l) => {
1361
+ const h = l.data;
1373
1362
  h[Qi] && n(ui, h[Qi], h[Hi], h[ko], h[To], h[Wi]);
1374
- }, t(zs, (d, h, f) => {
1375
- n(ee) || (o = h, a = f), n(hi, d);
1363
+ }, t(zs, (l, h, f) => {
1364
+ n(ee) || (o = h, a = f), n(hi, l);
1376
1365
  });
1377
- function l(d) {
1378
- const h = d.xyz.slice(0);
1379
- u.postMessage({
1380
- [Eo]: !0,
1381
- [Po]: h,
1382
- [Qo]: d.watermarkCount,
1383
- [Hi]: d.index,
1384
- [xo]: d.version,
1385
- [Wi]: d.renderSplatCount,
1386
- [Co]: d.visibleSplatCount,
1387
- [Mo]: d.modelSplatCount,
1388
- [Lo]: d.minX,
1389
- [Ro]: d.maxX,
1390
- [Fo]: d.minY,
1391
- [Bo]: d.maxY,
1392
- [Uo]: d.minZ,
1393
- [Oo]: d.maxZ
1394
- }, [h.buffer]);
1366
+ function d(l) {
1367
+ const h = l.xyz.slice(0);
1368
+ u.postMessage(
1369
+ {
1370
+ [Eo]: !0,
1371
+ [Po]: h,
1372
+ [Qo]: l.watermarkCount,
1373
+ [Hi]: l.index,
1374
+ [xo]: l.version,
1375
+ [Wi]: 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
1384
+ },
1385
+ [h.buffer]
1386
+ );
1395
1387
  }
1396
1388
  }
1397
1389
  function Wo(i) {
1398
- const e = (a, ...o) => i.fire(a, ...o), t = (a, o, s) => i.on(a, o, s), n = new Set($a.split(""));
1399
- t(Fs, async (a = "", o = !0, s = !0) => {
1390
+ const e = (a, ...o) => i.fire(a, ...o), t = (a, o, s) => i.on(a, o, s), n = new Set(Ka.split(""));
1391
+ t(Rs, async (a = "", o = !0, s = !0) => {
1400
1392
  const r = a.trim().substring(0, 100);
1401
1393
  let c = await e(os, r), u = [];
1402
- for (let b = 0; b < c.length; b++) {
1403
- let S = [], T = c[b];
1404
- for (let w = 0; w < T.length; w++)
1405
- S.push([(T[w] % 20 - 10) * 0.02, ((T[w] / 20 | 0) - 10) * 0.02]);
1406
- u.push(S);
1394
+ for (let S = 0; S < c.length; S++) {
1395
+ let v = [], k = c[S];
1396
+ for (let b = 0; b < k.length; b++)
1397
+ v.push([(k[b] % 20 - 10) * 0.02, ((k[b] / 20 | 0) - 10) * 0.02]);
1398
+ u.push(v);
1407
1399
  }
1408
- let l = [], d = r.split("");
1409
- for (let b = 0; b < d.length; b++)
1410
- l[b] = n.has(d[b]) ? 0.22 : 0.4;
1411
- let h = d.length / 2 | 0, f = l[h] / 2, p = !(d.length % 2), y = p ? 0 : -f;
1412
- for (let b = h - 1; b >= 0; b--) {
1413
- y -= l[b] / 2;
1414
- for (let S of u[b])
1415
- S[0] += y;
1416
- y -= l[b] / 2;
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;
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;
1417
1408
  }
1418
- f = l[h] / 2, y = p ? 0 : f;
1419
- for (let b = u.length - h; b < u.length; b++) {
1420
- y += l[b] / 2;
1421
- for (let S of u[b])
1422
- S[0] += y;
1423
- y += l[b] / 2;
1409
+ f = d[h] / 2, y = p ? 0 : f;
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;
1424
1414
  }
1425
1415
  let g = 0;
1426
- for (let b of u)
1427
- g += b.length;
1428
- const m = new Uint8Array(g * F);
1429
- let x = 0;
1430
- for (let b of u)
1431
- for (let S of b)
1432
- m.set(await ao(S[0], S[1], o, s), F * x++);
1416
+ for (let S of u)
1417
+ g += S.length;
1418
+ const m = new Uint8Array(g * R);
1419
+ let C = 0;
1420
+ for (let S of u)
1421
+ for (let v of S)
1422
+ m.set(await ao(v[0], v[1], o, s), R * C++);
1433
1423
  return m;
1434
1424
  });
1435
1425
  }
1436
- function Jn(i) {
1426
+ function qn(i) {
1437
1427
  const e = (t, n, a) => i.on(t, n, a);
1438
1428
  e(Pe, (t) => {
1439
1429
  t.url;
@@ -1443,7 +1433,7 @@ function Jn(i) {
1443
1433
  console.info(a);
1444
1434
  }), e(os, (t = "") => {
1445
1435
  const n = "https://reall3d.com/gsfont/api/getGaussianText", a = new FormData();
1446
- return a.append("text", t.substring(0, 100)), a.append("ver", Vt), new Promise((o) => {
1436
+ return a.append("text", t.substring(0, 100)), a.append("ver", Yt), new Promise((o) => {
1447
1437
  fetch(n, { method: "POST", body: a }).then((s) => s.ok ? s.json() : {}).then((s) => s.success ? o(JSON.parse(s.data)) : o([])).catch((s) => o([]));
1448
1438
  });
1449
1439
  });
@@ -1453,23 +1443,31 @@ function Yo(i) {
1453
1443
  const t = (r, c, u) => i.on(r, c, u), n = (r, ...c) => i.fire(r, ...c);
1454
1444
  t(As, () => e = !0);
1455
1445
  const a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
1456
- t(Dt, () => n(re) && a.set(Date.now(), 1)), t(Pt, () => n(re) && n(Ye, a)), t(Lt, () => n(re) && o.set(Date.now(), 1)), t(Rt, () => n(re) && n(Ye, o)), t(Oe, () => {
1457
- e || (n(Lt), n(re) && n(oe, {
1458
- fov: n(ft),
1459
- position: n(Le, n(Be)),
1460
- lookAt: n(Le, n(Ce)),
1461
- lookUp: n(Le, n(Ne))
1462
- }));
1463
- }, !0);
1446
+ t(It, () => n(re) && a.set(Date.now(), 1)), t(Dt, () => n(re) && n(Ye, a)), t(Pt, () => n(re) && o.set(Date.now(), 1)), t(Lt, () => n(re) && n(Ye, o)), t(
1447
+ Oe,
1448
+ () => {
1449
+ e || (n(Pt), n(re) && n(oe, {
1450
+ fov: n(ft),
1451
+ position: n(Le, n(Be)),
1452
+ lookAt: n(Le, n(Ce)),
1453
+ lookUp: n(Le, n(Ne))
1454
+ }));
1455
+ },
1456
+ !0
1457
+ );
1464
1458
  let s = 0;
1465
- t(Ve, () => {
1466
- e || (n(ds), n(re) && (n(Dt), !(s++ % 5) && n(oe, { fps: n(Pt), realFps: n(Rt) })));
1467
- }, !0), t(Ye, (r) => {
1468
- let c = [], u = Date.now(), l = 0;
1469
- for (const d of r.keys())
1470
- u - d <= 1e3 ? l++ : c.push(d);
1471
- return c.forEach((d) => r.delete(d)), Math.min(l, 30);
1472
- }), window.addEventListener("beforeunload", () => n(Wt));
1459
+ t(
1460
+ Ve,
1461
+ () => {
1462
+ e || (n(ds), n(re) && (n(It), !(s++ % 5) && n(oe, { fps: n(Dt), realFps: n(Lt) })));
1463
+ },
1464
+ !0
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);
1470
+ }), window.addEventListener("beforeunload", () => n(Ht));
1473
1471
  }
1474
1472
  function Vo(i) {
1475
1473
  const e = { ...i };
@@ -1482,14 +1480,14 @@ function Yi(i) {
1482
1480
  function Go(i) {
1483
1481
  let e;
1484
1482
  i.root ? e = typeof i.root == "string" ? document.querySelector(i.root) || document.querySelector("#gsviewer") : i.root : e = document.querySelector("#gsviewer"), e || (e = document.createElement("div"), e.id = "gsviewer", document.body.appendChild(e));
1485
- let t = document.querySelector("#gsviewer-canvas") || void 0, n = null;
1486
- return i.renderer ? n = i.renderer : (n = new es({ canvas: t, antialias: !1, stencil: !0, logarithmicDepthBuffer: !0, precision: "highp" }), n.setSize(e.clientWidth, e.clientHeight), n.setPixelRatio(Math.min(devicePixelRatio, 2)), i.renderer = n), t = n.domElement, t.id = "gsviewer-canvas", e.appendChild(n.domElement), n;
1483
+ let t = null;
1484
+ return i.renderer ? t = i.renderer : (t = new es({ antialias: !1, stencil: !0, logarithmicDepthBuffer: !0, precision: "highp" }), t.setSize(e.clientWidth, e.clientHeight), t.setPixelRatio(Math.min(devicePixelRatio, 2)), i.renderer = t), t.domElement.classList.add("gsviewer-canvas"), e.appendChild(t.domElement), t;
1487
1485
  }
1488
1486
  function No(i) {
1489
1487
  let e = i.camera;
1490
1488
  if (!e) {
1491
1489
  const t = i.renderer.domElement, n = t.width / t.height;
1492
- let a = new C().fromArray(i.lookUp), o = new C().fromArray(i.lookAt), s = new C().fromArray(i.position);
1490
+ let a = new M().fromArray(i.lookUp), o = new M().fromArray(i.lookAt), s = new M().fromArray(i.position);
1493
1491
  e = new ts(i.fov, n, i.near, i.far), e.position.copy(s), e.up.copy(a).normalize(), e.lookAt(o), i.camera = e;
1494
1492
  }
1495
1493
  return i.camera;
@@ -1498,7 +1496,7 @@ function Xo(i) {
1498
1496
  const { renderer: e, scene: t } = i, n = { renderer: e, scene: t };
1499
1497
  return n.viewerEvents = i.viewerEvents, n.debugMode = i.debugMode, n.renderer = i.renderer, n.scene = i.scene, n.controls = i.controls, n.bigSceneMode = i.bigSceneMode, n.pointcloudMode = i.pointcloudMode, n.maxRenderCountOfMobile = i.maxRenderCountOfMobile, n.maxRenderCountOfPc = i.maxRenderCountOfPc, n.lightFactor = i.lightFactor, n.shDegree = i.shDegree, n;
1500
1498
  }
1501
- function Ko(i) {
1499
+ function $o(i) {
1502
1500
  const e = (s, r, c) => i.on(s, r, c), t = (s, ...r) => i.fire(s, ...r), n = "KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2xldCBpPTA7aSsrO2NvbnN0IEQ9YCQke2krK31gO2krKyxpKyssaSsrO2NvbnN0IFc9YCQke2krK31gLHA9YCQke2krK31gLFM9YCQke2krK31gLHk9YCQke2krK31gLEM9YCQke2krK31gLEE9YCQke2krK31gLFI9YCQke2krK31gLEc9YCQke2krK31gO2krKztjb25zdCBIPWAkJHtpKyt9YCxKPWAkJHtpKyt9YDtpKys7Y29uc3QgVD1gJCR7aSsrfWA7aSsrO2NvbnN0IEs9YCQke2krK31gO2krKztjb25zdCBMPWAkJHtpKyt9YCxOPWAkJHtpKyt9YCxPPWAkJHtpKyt9YCxRPWAkJHtpKyt9YCxfPWAkJHtpKyt9YCxWPWAkJHtpKyt9YCxqPWAkJHtpKyt9YCxQPWAkJHtpKyt9YDtpKys7Y29uc3Qgbm49bmF2aWdhdG9yLnVzZXJBZ2VudC5pbmNsdWRlcygiTW9iaSIpLGI9c2VsZjtsZXQgWD17aW5kZXg6MCx2ZXJzaW9uOjB9LFk9e2luZGV4OjEsdmVyc2lvbjowfSx3PSExLFo7Y29uc3QgdG49LjI7bGV0IGssZj1bXSxNLHo9MCxCO2Z1bmN0aW9uIGFuKG4pe2lmKCF3KXJldHVybjtsZXQgYT1YLnZlcnNpb24+WS52ZXJzaW9uP1g6WTtpZighYS52ZXJzaW9uKXJldHVybjtjb25zdHt4eXo6dCxyZW5kZXJTcGxhdENvdW50Om8sdmlzaWJsZVNwbGF0Q291bnQ6bSxtb2RlbFNwbGF0Q291bnQ6RSx3YXRlcm1hcmtDb3VudDp4LGluZGV4OkYsdmVyc2lvbjp1fT1hO2lmKHo9PT11JiZNYXRoLmFicyhmWzJdLW5bMl0pK01hdGguYWJzKGZbNl0tbls2XSkrTWF0aC5hYnMoZlsxMF0tblsxMF0pK01hdGguYWJzKGZbMTRdLW5bMTRdKTx0bilyZXR1cm47Zj1uLHo9dTtsZXQgST1EYXRlLm5vdygpLGw7aWYoIW8pe2w9bmV3IFVpbnQzMkFycmF5KDApLGIucG9zdE1lc3NhZ2Uoe1tEXTpsLFtTXTpvLFt5XTptLFtDXTpFLFtXXTpGLFtwXTp1LFtSXTowLFtBXTpJfSxbbC5idWZmZXJdKTtyZXR1cm59bGV0IHE9MDtjb25zdCByPW8teDtsPW5ldyBVaW50MzJBcnJheShvKTtjb25zdHttYXhEZXB0aDp2LG1pbkRlcHRoOmR9PWVuKGEsayk7aWYodi1kPD0xZS01KWZvcihsZXQgcz0wO3M8bztzKyspbFtzXT1zO2Vsc2V7bGV0IHM9TWF0aC5taW4ociw2NTUzNSksZz0ocy0xKS8odi1kKSxjPW5ldyBJbnQzMkFycmF5KHMpO2ZvcihsZXQgZT0wLGg9MDtlPHI7ZSsrKWg9KCQobix0WzMqZV0sdFszKmUrMV0sdFszKmUrMl0pLWQpKmd8MCxjW01bZV09aF0rKztmb3IobGV0IGU9MTtlPHM7ZSsrKWNbZV0rPWNbZS0xXTtmb3IobGV0IGU9MDtlPHI7ZSsrKWxbLS1jW01bZV1dXT1lO2lmKHgpe3M9TWF0aC5taW4oTWF0aC5tYXgoeC84fDAsNTEyKSw2NTUzNSksZz0ocy0xKS8odi1kKSxjPW5ldyBJbnQzMkFycmF5KHMpO2ZvcihsZXQgZT1yLGg9MDtlPG87ZSsrKWg9KCQobix0WzMqZV0sdFszKmUrMV0sdFszKmUrMl0pLWQpKmd8MCxjW01bZS1yXT1oXSsrO2ZvcihsZXQgZT0xO2U8cztlKyspY1tlXSs9Y1tlLTFdO2ZvcihsZXQgZT0wO2U8eDtlKyspbFtyKy0tY1tNW2VdXV09citlfX1xPURhdGUubm93KCktSSxiLnBvc3RNZXNzYWdlKHtbRF06bCxbU106byxbeV06bSxbQ106RSxbV106RixbcF06dSxbQV06SSxbUl06cX0sW2wuYnVmZmVyXSl9ZnVuY3Rpb24gJChuLGEsdCxvKXtyZXR1cm4tKG5bMl0qYStuWzZdKnQrblsxMF0qbyl9ZnVuY3Rpb24gZW4obixhKXtsZXQgdD0tMS8wLG89MS8wLG09MDtyZXR1cm4gbT0kKGEsbi5taW5YLG4ubWluWSxuLm1pblopLHQ9TWF0aC5tYXgodCxtKSxvPU1hdGgubWluKG8sbSksbT0kKGEsbi5taW5YLG4ubWluWSxuLm1heFopLHQ9TWF0aC5tYXgodCxtKSxvPU1hdGgubWluKG8sbSksbT0kKGEsbi5taW5YLG4ubWF4WSxuLm1pblopLHQ9TWF0aC5tYXgodCxtKSxvPU1hdGgubWluKG8sbSksbT0kKGEsbi5taW5YLG4ubWF4WSxuLm1heFopLHQ9TWF0aC5tYXgodCxtKSxvPU1hdGgubWluKG8sbSksbT0kKGEsbi5tYXhYLG4ubWluWSxuLm1pblopLHQ9TWF0aC5tYXgodCxtKSxvPU1hdGgubWluKG8sbSksbT0kKGEsbi5tYXhYLG4ubWluWSxuLm1heFopLHQ9TWF0aC5tYXgodCxtKSxvPU1hdGgubWluKG8sbSksbT0kKGEsbi5tYXhYLG4ubWF4WSxuLm1pblopLHQ9TWF0aC5tYXgodCxtKSxvPU1hdGgubWluKG8sbSksbT0kKGEsbi5tYXhYLG4ubWF4WSxuLm1heFopLHQ9TWF0aC5tYXgodCxtKSxvPU1hdGgubWluKG8sbSkse21heERlcHRoOnQsbWluRGVwdGg6b319Y29uc3QgVT0oKT0+e2lmKCFaKXtaPSEwO2NvbnN0IG49azthbihuKSxzZXRUaW1lb3V0KCgpPT4hKFo9ITEpJiZuIT09ayYmVSgpKX19O2Iub25tZXNzYWdlPW49Pntjb25zdCBhPW4uZGF0YTtpZihhW0ddKXtsZXQgdD0hQnx8YVtXXT09PTA/WDpZO3QubWluWD1hW0xdLHQubWF4WD1hW05dLHQubWluWT1hW09dLHQubWF4WT1hW1FdLHQubWluWj1hW19dLHQubWF4Wj1hW1ZdLHQueHl6PW5ldyBGbG9hdDMyQXJyYXkoYVtLXS5idWZmZXIpLHQud2F0ZXJtYXJrQ291bnQ9YVtQXSx0LnZlcnNpb249YVtwXSx0LnJlbmRlclNwbGF0Q291bnQ9YVtTXSx0LnZpc2libGVTcGxhdENvdW50PWFbeV0sdC5tb2RlbFNwbGF0Q291bnQ9YVtDXSx0LnRleHR1cmVSZWFkeT0hMCx0LnRleHR1cmVSZWFkeVRpbWU9RGF0ZS5ub3coKX1lbHNlIGFbVF0/KGs9YVtUXSxVKCkpOmFbal0mJihCPWFbSF0sTT1uZXcgSW50MzJBcnJheShhW0pdKSx3PSEwKX19KSgpOwo=", a = URL.createObjectURL(new Blob([atob(n)], { type: "text/javascript" })), o = new Worker(new URL(a, import.meta.url), { type: "module" });
1503
1501
  e(cs, () => o), e(ps, () => o.postMessage({ [Do]: t(hs) })), e(fs, () => o.terminate()), (async () => o.postMessage({ [zo]: !0, [Io]: await t(ot), [_o]: t(ee) }))();
1504
1502
  }
@@ -1509,11 +1507,11 @@ class pe extends te {
1509
1507
  */
1510
1508
  constructor(e) {
1511
1509
  super(), this.isSplatMesh = !0, this.disposed = !1;
1512
- 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;
1513
- n(_, () => o), n($e, () => 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(fn, () => o.pointcloudMode), n(ye, () => this), n(N, () => o.viewerEvents?.fire(J)), qn(t), Jn(t), go(t), Ko(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 = () => {
1510
+ const t = new Nn(), 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)), jn(t), qn(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 = () => {
1514
1512
  a(ps), a(ys, performance.now());
1515
1513
  }, this.onAfterRender = () => {
1516
- a(vs, 1e4) && a(N);
1514
+ a(Ss, 1e4) && a(N);
1517
1515
  }))();
1518
1516
  }
1519
1517
  /**
@@ -1522,8 +1520,7 @@ class pe extends te {
1522
1520
  * @returns 最新配置项
1523
1521
  */
1524
1522
  options(e) {
1525
- if (this.disposed)
1526
- return;
1523
+ if (this.disposed) return;
1527
1524
  const t = (a, ...o) => this.events.fire(a, ...o), n = this.opts;
1528
1525
  return e && (e.pointcloudMode !== void 0 && t(nt, e.pointcloudMode), e.lightFactor !== void 0 && t(rt, e.lightFactor), e.maxRenderCountOfMobile !== void 0 && (n.maxRenderCountOfMobile = e.maxRenderCountOfMobile), e.maxRenderCountOfPc !== void 0 && (n.maxRenderCountOfPc = e.maxRenderCountOfPc), t(N)), { ...n };
1529
1526
  }
@@ -1533,7 +1530,7 @@ class pe extends te {
1533
1530
  * @param meta 元数据
1534
1531
  */
1535
1532
  async addModel(e, t) {
1536
- this.disposed || (this.meta = t, await this.events.fire(Ss, e, t));
1533
+ this.disposed || (this.meta = t, await this.events.fire(vs, e, t));
1537
1534
  }
1538
1535
  fire(e, ...t) {
1539
1536
  if (!this.disposed)
@@ -1543,24 +1540,23 @@ class pe extends te {
1543
1540
  * 销毁
1544
1541
  */
1545
1542
  dispose() {
1546
- if (this.disposed)
1547
- return;
1543
+ if (this.disposed) return;
1548
1544
  this.disposed = !0;
1549
1545
  const e = (t, ...n) => this.events.fire(t, ...n);
1550
- e(ke, this), e(B).remove(this), e(Bn), e(bs), e(fs), e(xs), this.events.clear(), this.events = null, this.opts = null, this.onAfterRender = null;
1546
+ e(ke, this), e(B).remove(this), e(Rn), e(bs), e(fs), e(xs), this.events.clear(), this.events = null, this.opts = null, this.onAfterRender = null;
1551
1547
  }
1552
1548
  }
1553
- class $o extends Dn {
1554
- 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) {
1555
- super(), this._axis = new C(), this.type = "ArrowHelper";
1556
- const c = new ti(a, a, n, 32);
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";
1552
+ const c = new ei(a, a, n, 32);
1557
1553
  c.translate(0, n / 2, 0);
1558
- const u = new ti(0, r, s, 32);
1554
+ const u = new ei(0, r, s, 32);
1559
1555
  u.translate(0, n, 0), this.position.copy(t);
1560
- const l = new xe({ color: o, toneMapped: !1 });
1561
- l.side = we, this.line = new te(c, l), this.line.matrixAutoUpdate = !1, this.line.ignoreIntersect = !0, this.add(this.line);
1562
1556
  const d = new xe({ color: o, toneMapped: !1 });
1563
- 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;
1557
+ d.side = we, this.line = new te(c, d), this.line.matrixAutoUpdate = !1, this.line.ignoreIntersect = !0, this.add(this.line);
1558
+ 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;
1564
1560
  }
1565
1561
  setDirection(e) {
1566
1562
  if (e.y > 0.99999)
@@ -1590,19 +1586,19 @@ function Zo(i) {
1590
1586
  a.transparent = !0, a.opacity = 0.6, a.depthTest = !1, a.depthWrite = !1, a.side = we;
1591
1587
  const o = new te(n, a);
1592
1588
  o.ignoreIntersect = !0;
1593
- const s = new C(0, -1, 0);
1589
+ const s = new M(0, -1, 0);
1594
1590
  s.normalize();
1595
- const r = new C(0, 0, 0), c = 0.5, u = 0.01, l = 16777062, d = 0.1, h = 0.03, f = new $o(s, r, c, u, l, d, h), p = new Dn();
1596
- p.add(o), p.add(f), p.renderOrder = 99999, o.renderOrder = 99999, p.visible = !1, t(B).add(p), e(La, () => p), e(kt, (y) => {
1597
- t(Bt, !0), p.visible = y === void 0 ? !p.visible : y, t(J);
1598
- }), e(On, () => p.visible), e(Bt, (y = !1) => {
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(Un, () => p.visible), e(Rt, (y = !1) => {
1599
1595
  if (y || p.visible) {
1600
- const g = new It(), m = new C(0, -1, 0);
1596
+ const g = new _t(), m = new M(0, -1, 0);
1601
1597
  g.setFromUnitVectors(m, t(Ne)), p.position.copy(t(Ce)), p.quaternion.copy(g);
1602
1598
  }
1603
1599
  });
1604
1600
  }
1605
- const Vi = { type: "change" }, ei = { type: "start" }, ea = { type: "end" }, wt = new pa(), Gi = new fa(), jo = Math.cos(70 * be.DEG2RAD), G = new C(), ae = 2 * Math.PI, H = {
1601
+ const Vi = { type: "change" }, Jn = { type: "start" }, ea = { type: "end" }, At = new pa(), Gi = new fa(), jo = Math.cos(70 * be.DEG2RAD), G = new M(), ae = 2 * Math.PI, H = {
1606
1602
  NONE: -1,
1607
1603
  ROTATE: 0,
1608
1604
  DOLLY: 1,
@@ -1611,10 +1607,10 @@ const Vi = { type: "change" }, ei = { type: "start" }, ea = { type: "end" }, wt
1611
1607
  TOUCH_PAN: 4,
1612
1608
  TOUCH_DOLLY_PAN: 5,
1613
1609
  TOUCH_DOLLY_ROTATE: 6
1614
- }, sn = 1e-6;
1610
+ }, nn = 1e-6;
1615
1611
  class ta extends ha {
1616
1612
  constructor(e, t = null) {
1617
- 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: ve.ROTATE, TWO: ve.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 It(), this._lastTargetPosition = new C(), this._quat = new It().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();
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 ti(), this._sphericalDelta = new ti(), 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();
1618
1614
  }
1619
1615
  connect() {
1620
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";
@@ -1666,20 +1662,20 @@ class ta extends ha {
1666
1662
  const c = r - s;
1667
1663
  this.object.position.addScaledVector(this._dollyDirection, c), this.object.updateMatrixWorld(), o = !!c;
1668
1664
  } else if (this.object.isOrthographicCamera) {
1669
- const r = new C(this._mouse.x, this._mouse.y, 0);
1665
+ const r = new M(this._mouse.x, this._mouse.y, 0);
1670
1666
  r.unproject(this.object);
1671
1667
  const c = this.object.zoom;
1672
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;
1673
- const u = new C(this._mouse.x, this._mouse.y, 0);
1669
+ const u = new M(this._mouse.x, this._mouse.y, 0);
1674
1670
  u.unproject(this.object), this.object.position.sub(u).add(r), this.object.updateMatrixWorld(), s = G.length();
1675
1671
  } else
1676
1672
  console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
1677
- s !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(s).add(this.object.position) : (wt.origin.copy(this.object.position), wt.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(wt.direction)) < jo ? this.object.lookAt(this.target) : (Gi.setFromNormalAndCoplanarPoint(this.object.up, this.target), wt.intersectPlane(Gi, this.target))));
1673
+ s !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(s).add(this.object.position) : (At.origin.copy(this.object.position), At.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(At.direction)) < jo ? this.object.lookAt(this.target) : (Gi.setFromNormalAndCoplanarPoint(this.object.up, this.target), At.intersectPlane(Gi, this.target))));
1678
1674
  } else if (this.object.isOrthographicCamera) {
1679
1675
  const s = this.object.zoom;
1680
1676
  this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), s !== this.object.zoom && (this.object.updateProjectionMatrix(), o = !0);
1681
1677
  }
1682
- return this._scale = 1, this._performCursorZoom = !1, o || this._lastPosition.distanceToSquared(this.object.position) > sn || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > sn || this._lastTargetPosition.distanceToSquared(this.target) > sn ? (this.dispatchEvent(Vi), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;
1678
+ return this._scale = 1, this._performCursorZoom = !1, o || this._lastPosition.distanceToSquared(this.object.position) > nn || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > nn || this._lastTargetPosition.distanceToSquared(this.target) > nn ? (this.dispatchEvent(Vi), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;
1683
1679
  }
1684
1680
  _getAutoRotationAngle(e) {
1685
1681
  return e !== null ? ae / 60 * this.autoRotateSpeed * e : ae / 60 / 60 * this.autoRotateSpeed;
@@ -1929,7 +1925,7 @@ function tr(i) {
1929
1925
  default:
1930
1926
  this.state = H.NONE;
1931
1927
  }
1932
- this.state !== H.NONE && this.dispatchEvent(ei);
1928
+ this.state !== H.NONE && this.dispatchEvent(Jn);
1933
1929
  }
1934
1930
  function nr(i) {
1935
1931
  switch (this.state) {
@@ -1948,7 +1944,7 @@ function nr(i) {
1948
1944
  }
1949
1945
  }
1950
1946
  function ir(i) {
1951
- this.enabled === !1 || this.enableZoom === !1 || this.state !== H.NONE || (i.preventDefault(), this.dispatchEvent(ei), this._handleMouseWheel(this._customWheelEvent(i)), this.dispatchEvent(ea));
1947
+ this.enabled === !1 || this.enableZoom === !1 || this.state !== H.NONE || (i.preventDefault(), this.dispatchEvent(Jn), this._handleMouseWheel(this._customWheelEvent(i)), this.dispatchEvent(ea));
1952
1948
  }
1953
1949
  function sr(i) {
1954
1950
  this.enabled !== !1 && this._handleKeyDown(i);
@@ -1957,11 +1953,11 @@ function ar(i) {
1957
1953
  switch (this._trackPointer(i), this._pointers.length) {
1958
1954
  case 1:
1959
1955
  switch (this.touches.ONE) {
1960
- case ve.ROTATE:
1956
+ case Se.ROTATE:
1961
1957
  if (this.enableRotate === !1) return;
1962
1958
  this._handleTouchStartRotate(i), this.state = H.TOUCH_ROTATE;
1963
1959
  break;
1964
- case ve.PAN:
1960
+ case Se.PAN:
1965
1961
  if (this.enablePan === !1) return;
1966
1962
  this._handleTouchStartPan(i), this.state = H.TOUCH_PAN;
1967
1963
  break;
@@ -1971,11 +1967,11 @@ function ar(i) {
1971
1967
  break;
1972
1968
  case 2:
1973
1969
  switch (this.touches.TWO) {
1974
- case ve.DOLLY_PAN:
1970
+ case Se.DOLLY_PAN:
1975
1971
  if (this.enableZoom === !1 && this.enablePan === !1) return;
1976
1972
  this._handleTouchStartDollyPan(i), this.state = H.TOUCH_DOLLY_PAN;
1977
1973
  break;
1978
- case ve.DOLLY_ROTATE:
1974
+ case Se.DOLLY_ROTATE:
1979
1975
  if (this.enableZoom === !1 && this.enableRotate === !1) return;
1980
1976
  this._handleTouchStartDollyRotate(i), this.state = H.TOUCH_DOLLY_ROTATE;
1981
1977
  break;
@@ -1986,7 +1982,7 @@ function ar(i) {
1986
1982
  default:
1987
1983
  this.state = H.NONE;
1988
1984
  }
1989
- this.state !== H.NONE && this.dispatchEvent(ei);
1985
+ this.state !== H.NONE && this.dispatchEvent(Jn);
1990
1986
  }
1991
1987
  function or(i) {
1992
1988
  switch (this._trackPointer(i), this.state) {
@@ -2034,20 +2030,20 @@ class dr extends ta {
2034
2030
  * 更新旋转轴
2035
2031
  */
2036
2032
  updateRotateAxis() {
2037
- this._quat?.setFromUnitVectors?.(this.object.up, new C(0, 1, 0)), this._quatInverse = this._quat?.clone?.()?.invert?.();
2033
+ this._quat?.setFromUnitVectors?.(this.object.up, new M(0, 1, 0)), this._quatInverse = this._quat?.clone?.()?.invert?.();
2038
2034
  }
2039
2035
  }
2040
2036
  class ur extends ta {
2041
2037
  constructor(e, t) {
2042
- super(e, t), this.screenSpacePanning = !1, this.mouseButtons = { LEFT: Ae.PAN, MIDDLE: Ae.DOLLY, RIGHT: Ae.ROTATE }, this.touches = { ONE: ve.PAN, TWO: ve.DOLLY_ROTATE };
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 };
2043
2039
  }
2044
2040
  }
2045
- const Ni = new Pn(), St = new C();
2046
- class na extends cn {
2041
+ const Ni = new Dn(), wt = new M();
2042
+ class na extends rn {
2047
2043
  constructor() {
2048
2044
  super(), this.isLineSegmentsGeometry = !0, this.type = "LineSegmentsGeometry";
2049
2045
  const e = [-1, 2, 0, 1, 2, 0, -1, 1, 0, 1, 1, 0, -1, 0, 0, 1, 0, 0, -1, -1, 0, 1, -1, 0], t = [-1, 2, 1, 2, -1, 1, 1, 1, -1, -1, 1, -1, -1, -2, 1, -2], n = [0, 2, 1, 2, 3, 1, 2, 4, 3, 4, 5, 3, 4, 6, 5, 6, 7, 5];
2050
- this.setIndex(n), this.setAttribute("position", new ii(e, 3)), this.setAttribute("uv", new ii(t, 2));
2046
+ this.setIndex(n), this.setAttribute("position", new ni(e, 3)), this.setAttribute("uv", new ni(t, 2));
2051
2047
  }
2052
2048
  applyMatrix4(e) {
2053
2049
  const t = this.attributes.instanceStart, n = this.attributes.instanceEnd;
@@ -2056,13 +2052,13 @@ class na extends cn {
2056
2052
  setPositions(e) {
2057
2053
  let t;
2058
2054
  e instanceof Float32Array ? t = e : Array.isArray(e) && (t = new Float32Array(e));
2059
- const n = new ln(t, 6, 1);
2055
+ const n = new cn(t, 6, 1);
2060
2056
  return this.setAttribute("instanceStart", new We(n, 3, 0)), this.setAttribute("instanceEnd", new We(n, 3, 3)), this.instanceCount = this.attributes.instanceStart.count, this.computeBoundingBox(), this.computeBoundingSphere(), this;
2061
2057
  }
2062
2058
  setColors(e) {
2063
2059
  let t;
2064
2060
  e instanceof Float32Array ? t = e : Array.isArray(e) && (t = new Float32Array(e));
2065
- const n = new ln(t, 6, 1);
2061
+ const n = new cn(t, 6, 1);
2066
2062
  return this.setAttribute("instanceColorStart", new We(n, 3, 0)), this.setAttribute("instanceColorEnd", new We(n, 3, 3)), this;
2067
2063
  }
2068
2064
  fromWireframeGeometry(e) {
@@ -2079,7 +2075,7 @@ class na extends cn {
2079
2075
  return this.setPositions(t.attributes.position.array), this;
2080
2076
  }
2081
2077
  computeBoundingBox() {
2082
- this.boundingBox === null && (this.boundingBox = new Pn());
2078
+ this.boundingBox === null && (this.boundingBox = new Dn());
2083
2079
  const e = this.attributes.instanceStart, t = this.attributes.instanceEnd;
2084
2080
  e !== void 0 && t !== void 0 && (this.boundingBox.setFromBufferAttribute(e), Ni.setFromBufferAttribute(t), this.boundingBox.union(Ni));
2085
2081
  }
@@ -2091,7 +2087,7 @@ class na extends cn {
2091
2087
  this.boundingBox.getCenter(n);
2092
2088
  let a = 0;
2093
2089
  for (let o = 0, s = e.count; o < s; o++)
2094
- St.fromBufferAttribute(e, o), a = Math.max(a, n.distanceToSquared(St)), St.fromBufferAttribute(t, o), a = Math.max(a, n.distanceToSquared(St));
2090
+ wt.fromBufferAttribute(e, o), a = Math.max(a, n.distanceToSquared(wt)), wt.fromBufferAttribute(t, o), a = Math.max(a, n.distanceToSquared(wt));
2095
2091
  this.boundingSphere.radius = Math.sqrt(a), isNaN(this.boundingSphere.radius) && console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.", this);
2096
2092
  }
2097
2093
  }
@@ -2101,7 +2097,7 @@ class na extends cn {
2101
2097
  return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."), this.applyMatrix4(e);
2102
2098
  }
2103
2099
  }
2104
- Ct.line = {
2100
+ xt.line = {
2105
2101
  worldUnits: { value: 1 },
2106
2102
  linewidth: { value: 1 },
2107
2103
  resolution: { value: new j(1, 1) },
@@ -2111,11 +2107,11 @@ Ct.line = {
2111
2107
  gapSize: { value: 1 }
2112
2108
  // todo FIX - maybe change to totalSize
2113
2109
  };
2114
- xt.line = {
2110
+ bt.line = {
2115
2111
  uniforms: ns.merge([
2116
- Ct.common,
2117
- Ct.fog,
2118
- Ct.line
2112
+ xt.common,
2113
+ xt.fog,
2114
+ xt.line
2119
2115
  ]),
2120
2116
  vertexShader: (
2121
2117
  /* glsl */
@@ -2496,13 +2492,13 @@ xt.line = {
2496
2492
  `
2497
2493
  )
2498
2494
  };
2499
- class Xe extends In {
2495
+ class Xe extends _n {
2500
2496
  constructor(e) {
2501
2497
  super({
2502
2498
  type: "LineMaterial",
2503
- uniforms: ns.clone(xt.line.uniforms),
2504
- vertexShader: xt.line.vertexShader,
2505
- fragmentShader: xt.line.fragmentShader,
2499
+ uniforms: ns.clone(bt.line.uniforms),
2500
+ vertexShader: bt.line.vertexShader,
2501
+ fragmentShader: bt.line.fragmentShader,
2506
2502
  clipping: !0
2507
2503
  // required for clipping support
2508
2504
  }), this.isLineMaterial = !0, this.setValues(e);
@@ -2574,20 +2570,20 @@ class Xe extends In {
2574
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);
2575
2571
  }
2576
2572
  }
2577
- const an = new Se(), Xi = new C(), Ki = new C(), K = new Se(), $ = new Se(), de = new Se(), on = new C(), rn = new Ke(), Z = new ma(), $i = new C(), vt = new Pn(), bt = new tt(), ue = new Se();
2578
- let ge, Re;
2573
+ const sn = new ve(), Xi = new M(), $i = new M(), $ = new ve(), K = new ve(), de = new ve(), an = new M(), on = new $e(), Z = new ma(), Ki = new M(), vt = new Dn(), St = new tt(), ue = new ve();
2574
+ let ge, Fe;
2579
2575
  function Zi(i, e, t) {
2580
- return ue.set(0, 0, -e, 1).applyMatrix4(i.projectionMatrix), ue.multiplyScalar(1 / ue.w), ue.x = Re / t.width, ue.y = Re / t.height, ue.applyMatrix4(i.projectionMatrixInverse), ue.multiplyScalar(1 / ue.w), Math.abs(Math.max(ue.x, ue.y));
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));
2581
2577
  }
2582
2578
  function hr(i, e) {
2583
2579
  const t = i.matrixWorld, n = i.geometry, a = n.attributes.instanceStart, o = n.attributes.instanceEnd, s = Math.min(n.instanceCount, a.count);
2584
2580
  for (let r = 0, c = s; r < c; r++) {
2585
2581
  Z.start.fromBufferAttribute(a, r), Z.end.fromBufferAttribute(o, r), Z.applyMatrix4(t);
2586
- const u = new C(), l = new C();
2587
- ge.distanceSqToSegment(Z.start, Z.end, l, u), l.distanceTo(u) < Re * 0.5 && e.push({
2588
- point: l,
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,
2589
2585
  pointOnLine: u,
2590
- distance: ge.origin.distanceTo(l),
2586
+ distance: ge.origin.distanceTo(d),
2591
2587
  object: i,
2592
2588
  face: null,
2593
2589
  faceIndex: r,
@@ -2597,29 +2593,29 @@ function hr(i, e) {
2597
2593
  }
2598
2594
  }
2599
2595
  function pr(i, e, t) {
2600
- 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;
2601
- 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, on.copy(de), rn.multiplyMatrices(e.matrixWorldInverse, s);
2602
- for (let h = 0, f = l; h < f; h++) {
2603
- if (K.fromBufferAttribute(c, h), $.fromBufferAttribute(u, h), K.w = 1, $.w = 1, K.applyMatrix4(rn), $.applyMatrix4(rn), K.z > d && $.z > d)
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;
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)
2604
2600
  continue;
2605
- if (K.z > d) {
2606
- const b = K.z - $.z, S = (K.z - d) / b;
2607
- K.lerp($, S);
2608
- } else if ($.z > d) {
2609
- const b = $.z - K.z, S = ($.z - d) / b;
2610
- $.lerp(K, S);
2601
+ if ($.z > l) {
2602
+ const S = $.z - K.z, v = ($.z - l) / S;
2603
+ $.lerp(K, v);
2604
+ } else if (K.z > l) {
2605
+ const S = K.z - $.z, v = (K.z - l) / S;
2606
+ K.lerp($, v);
2611
2607
  }
2612
- K.applyMatrix4(n), $.applyMatrix4(n), K.multiplyScalar(1 / K.w), $.multiplyScalar(1 / $.w), K.x *= o.x / 2, K.y *= o.y / 2, $.x *= o.x / 2, $.y *= o.y / 2, Z.start.copy(K), Z.start.z = 0, Z.end.copy($), Z.end.z = 0;
2613
- const y = Z.closestPointToPointParameter(on, !0);
2614
- Z.at(y, $i);
2615
- const g = be.lerp(K.z, $.z, y), m = g >= -1 && g <= 1, x = on.distanceTo($i) < Re * 0.5;
2616
- if (m && x) {
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, Ki);
2611
+ const g = be.lerp($.z, K.z, y), m = g >= -1 && g <= 1, C = an.distanceTo(Ki) < Fe * 0.5;
2612
+ if (m && C) {
2617
2613
  Z.start.fromBufferAttribute(c, h), Z.end.fromBufferAttribute(u, h), Z.start.applyMatrix4(s), Z.end.applyMatrix4(s);
2618
- const b = new C(), S = new C();
2619
- ge.distanceSqToSegment(Z.start, Z.end, S, b), t.push({
2620
- point: S,
2621
- pointOnLine: b,
2622
- distance: ge.origin.distanceTo(S),
2614
+ const S = new M(), v = new M();
2615
+ ge.distanceSqToSegment(Z.start, Z.end, v, S), t.push({
2616
+ point: v,
2617
+ pointOnLine: S,
2618
+ distance: ge.origin.distanceTo(v),
2623
2619
  object: i,
2624
2620
  face: null,
2625
2621
  faceIndex: h,
@@ -2637,8 +2633,8 @@ class fr extends te {
2637
2633
  computeLineDistances() {
2638
2634
  const e = this.geometry, t = e.attributes.instanceStart, n = e.attributes.instanceEnd, a = new Float32Array(2 * t.count);
2639
2635
  for (let s = 0, r = 0, c = t.count; s < c; s++, r += 2)
2640
- Xi.fromBufferAttribute(t, s), Ki.fromBufferAttribute(n, s), a[r] = r === 0 ? 0 : a[r - 1], a[r + 1] = a[r] + Xi.distanceTo(Ki);
2641
- const o = new ln(a, 2, 1);
2636
+ Xi.fromBufferAttribute(t, s), $i.fromBufferAttribute(n, s), a[r] = r === 0 ? 0 : a[r - 1], a[r + 1] = a[r] + Xi.distanceTo($i);
2637
+ const o = new cn(a, 2, 1);
2642
2638
  return e.setAttribute("instanceDistanceStart", new We(o, 1, 0)), e.setAttribute("instanceDistanceEnd", new We(o, 1, 1)), this;
2643
2639
  }
2644
2640
  raycast(e, t) {
@@ -2647,29 +2643,29 @@ class fr extends te {
2647
2643
  const o = e.params.Line2 !== void 0 && e.params.Line2.threshold || 0;
2648
2644
  ge = e.ray;
2649
2645
  const s = this.matrixWorld, r = this.geometry, c = this.material;
2650
- Re = c.linewidth + o, r.boundingSphere === null && r.computeBoundingSphere(), bt.copy(r.boundingSphere).applyMatrix4(s);
2646
+ Fe = c.linewidth + o, r.boundingSphere === null && r.computeBoundingSphere(), St.copy(r.boundingSphere).applyMatrix4(s);
2651
2647
  let u;
2652
2648
  if (n)
2653
- u = Re * 0.5;
2649
+ u = Fe * 0.5;
2654
2650
  else {
2655
- const d = Math.max(a.near, bt.distanceToPoint(ge.origin));
2656
- u = Zi(a, d, c.resolution);
2651
+ const l = Math.max(a.near, St.distanceToPoint(ge.origin));
2652
+ u = Zi(a, l, c.resolution);
2657
2653
  }
2658
- if (bt.radius += u, ge.intersectsSphere(bt) === !1)
2654
+ if (St.radius += u, ge.intersectsSphere(St) === !1)
2659
2655
  return;
2660
2656
  r.boundingBox === null && r.computeBoundingBox(), vt.copy(r.boundingBox).applyMatrix4(s);
2661
- let l;
2657
+ let d;
2662
2658
  if (n)
2663
- l = Re * 0.5;
2659
+ d = Fe * 0.5;
2664
2660
  else {
2665
- const d = Math.max(a.near, vt.distanceToPoint(ge.origin));
2666
- l = Zi(a, d, c.resolution);
2661
+ const l = Math.max(a.near, vt.distanceToPoint(ge.origin));
2662
+ d = Zi(a, l, c.resolution);
2667
2663
  }
2668
- vt.expandByScalar(l), ge.intersectsBox(vt) !== !1 && (n ? hr(this, t) : pr(this, a, t));
2664
+ vt.expandByScalar(d), ge.intersectsBox(vt) !== !1 && (n ? hr(this, t) : pr(this, a, t));
2669
2665
  }
2670
2666
  onBeforeRender(e) {
2671
2667
  const t = this.material.uniforms;
2672
- t && t.resolution && (e.getViewport(an), this.material.uniforms.resolution.value.set(an.z, an.w));
2668
+ t && t.resolution && (e.getViewport(sn), this.material.uniforms.resolution.value.set(sn.z, sn.w));
2673
2669
  }
2674
2670
  }
2675
2671
  class pt extends na {
@@ -2699,13 +2695,13 @@ class pt extends na {
2699
2695
  return this.setPositions(t.attributes.position.array), this;
2700
2696
  }
2701
2697
  }
2702
- class Fe extends fr {
2698
+ class Re extends fr {
2703
2699
  constructor(e = new pt(), t = new Xe({ color: Math.random() * 16777215 })) {
2704
2700
  super(e, t), this.isLine2 = !0, this.type = "Line2";
2705
2701
  }
2706
2702
  }
2707
- const ji = new C(), gr = new It(), qi = new C();
2708
- class mr extends Dn {
2703
+ const ji = new M(), gr = new _t(), qi = new M();
2704
+ class mr extends In {
2709
2705
  constructor(e = document.createElement("div")) {
2710
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() {
2711
2707
  this.traverse(function(t) {
@@ -2725,7 +2721,7 @@ class ie extends mr {
2725
2721
  return super.copy(e, t), this.rotation2D = e.rotation2D, this;
2726
2722
  }
2727
2723
  }
2728
- const he = new Ke(), yr = new Ke();
2724
+ const he = new $e(), yr = new $e();
2729
2725
  class Ar {
2730
2726
  constructor(e = {}) {
2731
2727
  const t = this;
@@ -2737,64 +2733,64 @@ class Ar {
2737
2733
  c.style.overflow = "hidden", this.domElement = c;
2738
2734
  const u = document.createElement("div");
2739
2735
  u.style.transformOrigin = "0 0", u.style.pointerEvents = "none", c.appendChild(u);
2740
- const l = document.createElement("div");
2741
- l.style.transformStyle = "preserve-3d", u.appendChild(l), this.getSize = function() {
2736
+ const d = document.createElement("div");
2737
+ d.style.transformStyle = "preserve-3d", u.appendChild(d), this.getSize = function() {
2742
2738
  return {
2743
2739
  width: n,
2744
2740
  height: a
2745
2741
  };
2746
2742
  }, this.render = function(g, m) {
2747
- const x = m.projectionMatrix.elements[5] * s;
2743
+ const C = m.projectionMatrix.elements[5] * s;
2748
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();
2749
- let b, S;
2750
- m.isOrthographicCamera && (b = -(m.right + m.left) / 2, S = (m.top + m.bottom) / 2);
2751
- const T = m.view && m.view.enabled ? m.view.height / m.view.fullHeight : 1, w = m.isOrthographicCamera ? `scale( ${T} )scale(` + x + ")translate(" + d(b) + "px," + d(S) + "px)" + h(m.matrixWorldInverse) : `scale( ${T} )translateZ(` + x + "px)" + h(m.matrixWorldInverse), v = (m.isPerspectiveCamera ? "perspective(" + x + "px) " : "") + w + "translate(" + o + "px," + s + "px)";
2752
- r.camera.style !== v && (l.style.transform = v, r.camera.style = v), y(g, g, m);
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);
2753
2749
  }, this.setSize = function(g, m) {
2754
- 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", l.style.width = g + "px", l.style.height = m + "px";
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";
2755
2751
  };
2756
- function d(g) {
2752
+ function l(g) {
2757
2753
  return Math.abs(g) < 1e-10 ? 0 : g;
2758
2754
  }
2759
2755
  function h(g) {
2760
2756
  const m = g.elements;
2761
- return "matrix3d(" + d(m[0]) + "," + d(-m[1]) + "," + d(m[2]) + "," + d(m[3]) + "," + d(m[4]) + "," + d(-m[5]) + "," + d(m[6]) + "," + d(m[7]) + "," + d(m[8]) + "," + d(-m[9]) + "," + d(m[10]) + "," + d(m[11]) + "," + d(m[12]) + "," + d(-m[13]) + "," + d(m[14]) + "," + d(m[15]) + ")";
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]) + ")";
2762
2758
  }
2763
2759
  function f(g) {
2764
2760
  const m = g.elements;
2765
- return "translate(-50%,-50%)" + ("matrix3d(" + d(m[0]) + "," + d(m[1]) + "," + d(m[2]) + "," + d(m[3]) + "," + d(-m[4]) + "," + d(-m[5]) + "," + d(-m[6]) + "," + d(-m[7]) + "," + d(m[8]) + "," + d(m[9]) + "," + d(m[10]) + "," + d(m[11]) + "," + d(m[12]) + "," + d(m[13]) + "," + d(m[14]) + "," + d(m[15]) + ")");
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]) + ")");
2766
2762
  }
2767
2763
  function p(g) {
2768
2764
  g.isCSS3DObject && (g.element.style.display = "none");
2769
- for (let m = 0, x = g.children.length; m < x; m++)
2765
+ for (let m = 0, C = g.children.length; m < C; m++)
2770
2766
  p(g.children[m]);
2771
2767
  }
2772
- function y(g, m, x, b) {
2768
+ function y(g, m, C, S) {
2773
2769
  if (g.visible === !1) {
2774
2770
  p(g);
2775
2771
  return;
2776
2772
  }
2777
2773
  if (g.isCSS3DObject) {
2778
- const S = g.layers.test(x.layers) === !0, T = g.element;
2779
- if (T.style.display = S === !0 ? "" : "none", S === !0) {
2780
- g.onBeforeRender(t, m, x);
2781
- let w;
2782
- g.isCSS3DSprite ? (he.copy(x.matrixWorldInverse), he.transpose(), g.rotation2D !== 0 && he.multiply(yr.makeRotationZ(g.rotation2D)), g.matrixWorld.decompose(ji, gr, qi), he.setPosition(ji), he.scale(qi), he.elements[3] = 0, he.elements[7] = 0, he.elements[11] = 0, he.elements[15] = 1, w = f(he)) : w = f(g.matrixWorld);
2783
- const I = r.objects.get(g);
2784
- if (I === void 0 || I.style !== w) {
2785
- T.style.transform = w;
2786
- const v = { style: w };
2787
- r.objects.set(g, v);
2774
+ const v = g.layers.test(C.layers) === !0, k = g.element;
2775
+ if (k.style.display = v === !0 ? "" : "none", v === !0) {
2776
+ g.onBeforeRender(t, m, C);
2777
+ let b;
2778
+ g.isCSS3DSprite ? (he.copy(C.matrixWorldInverse), he.transpose(), g.rotation2D !== 0 && he.multiply(yr.makeRotationZ(g.rotation2D)), g.matrixWorld.decompose(ji, gr, qi), he.setPosition(ji), he.scale(qi), he.elements[3] = 0, he.elements[7] = 0, he.elements[11] = 0, he.elements[15] = 1, b = f(he)) : b = f(g.matrixWorld);
2779
+ const x = r.objects.get(g);
2780
+ if (x === void 0 || x.style !== b) {
2781
+ k.style.transform = b;
2782
+ const w = { style: b };
2783
+ r.objects.set(g, w);
2788
2784
  }
2789
- T.parentNode !== l && l.appendChild(T), g.onAfterRender(t, m, x);
2785
+ k.parentNode !== d && d.appendChild(k), g.onAfterRender(t, m, C);
2790
2786
  }
2791
2787
  }
2792
- for (let S = 0, T = g.children.length; S < T; S++)
2793
- y(g.children[S], m, x);
2788
+ for (let v = 0, k = g.children.length; v < k; v++)
2789
+ y(g.children[v], m, C);
2794
2790
  }
2795
2791
  }
2796
2792
  }
2797
- class Mn extends Fe {
2793
+ class Cn extends Re {
2798
2794
  constructor(e) {
2799
2795
  super(), this.isMark = !0, this.disposed = !1, this.events = e;
2800
2796
  }
@@ -2802,8 +2798,7 @@ class Mn extends Fe {
2802
2798
  * 绘制开始
2803
2799
  */
2804
2800
  drawStart(e, t) {
2805
- if (this.disposed)
2806
- return;
2801
+ if (this.disposed) return;
2807
2802
  const n = this, a = document.querySelectorAll(".mark-wrap-line.main-warp").length + 1, o = {
2808
2803
  type: "MarkDistanceLine",
2809
2804
  name: t || "line" + Date.now(),
@@ -2823,19 +2818,18 @@ class Mn extends Fe {
2823
2818
  }, s = new pt();
2824
2819
  s.setPositions([...o.startPoint, ...o.endPoint]);
2825
2820
  const r = new Xe({ color: o.lineColor, linewidth: o.lineWidth });
2826
- r.resolution.set(innerWidth, innerHeight), n.copy(new Fe(s, r));
2821
+ r.resolution.set(innerWidth, innerHeight), n.copy(new Re(s, r));
2827
2822
  const c = new De(0.05, 32), u = new xe({ color: 16777215, side: we });
2828
2823
  u.transparent = !0, u.opacity = 0.6;
2829
- const l = new te(c, u);
2830
- l.position.copy(e), l.isMark = !0;
2831
2824
  const d = new te(c, u);
2832
2825
  d.position.copy(e), d.isMark = !0;
2826
+ const l = new te(c, u);
2827
+ l.position.copy(e), l.isMark = !0;
2833
2828
  const h = document.createElement("div");
2834
2829
  h.innerHTML = `<div style='flex-direction: column;align-items: center;display: flex;pointer-events: none;margin-bottom: 40px;'>
2835
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>
2836
2831
  </div>`, h.classList.add("mark-wrap-line", `${o.name}`, "main-warp"), h.style.position = "absolute", h.style.borderRadius = "4px", h.style.cursor = "pointer", h.onclick = () => {
2837
- if (n.events.fire(_).markMode)
2838
- return;
2832
+ if (n.events.fire(I).markMode) return;
2839
2833
  const g = parent?.onActiveMark;
2840
2834
  g?.(n.getMarkData(!0)), n.events.fire(q);
2841
2835
  }, h.oncontextmenu = (g) => g.preventDefault();
@@ -2844,26 +2838,25 @@ class Mn extends Fe {
2844
2838
  const p = document.createElement("div");
2845
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";
2846
2840
  const y = new ie(p);
2847
- 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(l, d, f, y), n.data = o, n.circleStart = l, n.circleEnd = d, n.css3dTag = y, n.css3dMainTag = f, n.events.fire(Me, n);
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);
2848
2842
  }
2849
2843
  /**
2850
2844
  * 绘制更新
2851
2845
  */
2852
2846
  drawUpdate(e, t = !0) {
2853
- if (this.disposed)
2854
- return;
2847
+ if (this.disposed) return;
2855
2848
  const n = this;
2856
2849
  if (e?.endPoint) {
2857
2850
  t && (n.data.endPoint = [...e.endPoint]);
2858
- const a = new C().fromArray(n.data.startPoint), o = new C().fromArray(e.endPoint);
2851
+ const a = new M().fromArray(n.data.startPoint), o = new M().fromArray(e.endPoint);
2859
2852
  n.geometry.setPositions([...n.data.startPoint, ...e.endPoint]);
2860
- const s = new C((a.x + o.x) / 2, (a.y + o.y) / 2, (a.z + o.z) / 2);
2853
+ const s = new M((a.x + o.x) / 2, (a.y + o.y) / 2, (a.z + o.z) / 2);
2861
2854
  n.css3dTag.position.set(s.x, s.y, s.z);
2862
2855
  const r = o.clone().sub(a).normalize();
2863
2856
  n.circleStart.lookAt(n.circleStart.position.clone().add(r)), n.circleEnd.lookAt(n.circleEnd.position.clone().add(r));
2864
2857
  const c = a.distanceTo(o);
2865
2858
  n.css3dTag.visible = c > 0.5;
2866
- const u = (c * n.events.fire(_).meterScale).toFixed(2) + " m";
2859
+ const u = (c * n.events.fire(I).meterScale).toFixed(2) + " m";
2867
2860
  n.css3dTag.element.childNodes[0].innerText = u;
2868
2861
  }
2869
2862
  e?.lineColor && (t && (n.data.lineColor = e.lineColor), n.material.color.set(e.lineColor)), e?.lineWidth && (t && (n.data.lineWidth = e.lineWidth), n.material.linewidth = e.lineWidth), e?.mainTagColor && (t && (n.data.mainTagColor = e.mainTagColor), document.querySelector(`.${n.data.name}-main-tag`).style.color = e.mainTagColor), e?.mainTagBackground && (t && (n.data.mainTagBackground = e.mainTagBackground), document.querySelector(`.${n.data.name}-main-tag`).style.background = e.mainTagBackground), e?.mainTagOpacity && (t && (n.data.mainTagOpacity = e.mainTagOpacity), document.querySelector(`.${n.data.name}-main-tag`).style.opacity = e.mainTagOpacity.toString()), e?.mainTagVisible !== void 0 && (t && (n.data.mainTagVisible = e.mainTagVisible), n.css3dMainTag.visible = e.mainTagVisible), e?.distanceTagColor && (t && (n.data.distanceTagColor = e.distanceTagColor), document.querySelector(`.${n.data.name}-distance-tag0`).style.color = e.distanceTagColor), e?.distanceTagBackground && (t && (n.data.distanceTagBackground = e.distanceTagBackground), document.querySelector(`.${n.data.name}-distance-tag0`).style.background = e.distanceTagBackground), e?.distanceTagOpacity && (t && (n.data.distanceTagOpacity = e.distanceTagOpacity), document.querySelector(`.${n.data.name}-distance-tag0`).style.opacity = e.distanceTagOpacity.toString()), e?.distanceTagVisible !== void 0 && (t && (n.data.distanceTagVisible = e.distanceTagVisible), n.css3dTag.visible = e.distanceTagVisible), e?.title !== void 0 && (t && (n.data.title = e.title), this.css3dMainTag.element.querySelector(`.${n.data.name}-main-tag`).innerText = e.title), e?.note !== void 0 && t && (n.data.note = e.note), n.events.fire(J);
@@ -2872,34 +2865,32 @@ class Mn extends Fe {
2872
2865
  * 按米标比例尺重新计算更新渲染
2873
2866
  */
2874
2867
  updateByMeterScale(e) {
2875
- 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";
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";
2876
2869
  t.css3dTag.element.childNodes[0].innerText = o;
2877
2870
  }
2878
2871
  /**
2879
2872
  * 绘制结束
2880
2873
  */
2881
2874
  drawFinish(e) {
2882
- if (this.disposed)
2883
- return;
2875
+ if (this.disposed) return;
2884
2876
  const t = this;
2885
2877
  t.data.endPoint = [...e.toArray()];
2886
- 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);
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);
2887
2879
  t.geometry.setPositions([...t.data.startPoint, ...t.data.endPoint]), t.css3dTag.position.set(o.x, o.y, o.z);
2888
2880
  const s = a.clone().sub(n).normalize();
2889
2881
  t.circleStart.lookAt(t.circleStart.position.clone().add(s)), t.circleEnd.lookAt(t.circleEnd.position.clone().add(s)), t.circleEnd.position.copy(a);
2890
2882
  const r = n.distanceTo(a);
2891
2883
  t.css3dTag.visible = !0;
2892
- const c = (r * t.events.fire(_).meterScale).toFixed(2) + " m";
2884
+ const c = (r * t.events.fire(I).meterScale).toFixed(2) + " m";
2893
2885
  t.css3dTag.element.childNodes[0].innerText = c, t.events.fire(Te);
2894
- const u = parent?.onActiveMark, l = t.getMarkData(!0);
2895
- l.isNew = !0, l.meterScale = t.events.fire(_).meterScale, u?.(l);
2886
+ const u = parent?.onActiveMark, d = t.getMarkData(!0);
2887
+ d.isNew = !0, d.meterScale = t.events.fire(I).meterScale, u?.(d);
2896
2888
  }
2897
2889
  /**
2898
2890
  * 根据数据直接绘制
2899
2891
  */
2900
2892
  draw(e) {
2901
- if (this.disposed)
2902
- return;
2893
+ if (this.disposed) return;
2903
2894
  const t = this, n = {
2904
2895
  type: "MarkDistanceLine",
2905
2896
  name: e.name || "line" + Date.now(),
@@ -2916,55 +2907,52 @@ class Mn extends Fe {
2916
2907
  distanceTagOpacity: e.distanceTagOpacity || 0.9,
2917
2908
  distanceTagVisible: e.distanceTagVisible === void 0 ? !0 : e.distanceTagVisible,
2918
2909
  title: e.title || "标记距离"
2919
- }, 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();
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();
2920
2911
  r.setPositions([...n.startPoint, ...n.endPoint]);
2921
2912
  const c = new Xe({ color: n.lineColor, linewidth: n.lineWidth });
2922
- c.resolution.set(innerWidth, innerHeight), t.copy(new Fe(r, c));
2923
- const u = new De(0.05, 32), l = new xe({ color: 16777215, side: we });
2924
- l.transparent = !0, l.opacity = 0.6;
2925
- const d = new te(u, l);
2926
- d.position.copy(a), d.isMark = !0;
2927
- const h = new te(u, l);
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);
2928
2919
  h.position.copy(o), h.isMark = !0;
2929
2920
  const f = o.clone().sub(a).normalize();
2930
- d.lookAt(d.position.clone().add(f)), h.lookAt(h.position.clone().add(f));
2921
+ l.lookAt(l.position.clone().add(f)), h.lookAt(h.position.clone().add(f));
2931
2922
  const p = n.name, y = document.createElement("div");
2932
2923
  y.innerHTML = `<div style='flex-direction: column;align-items: center;display: flex;pointer-events: none;margin-bottom: 40px;'>
2933
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>
2934
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 = () => {
2935
- if (t.events.fire(_).markMode)
2936
- return;
2937
- const T = parent?.onActiveMark;
2938
- T?.(t.getMarkData(!0)), t.events.fire(q);
2939
- }, y.oncontextmenu = (T) => T.preventDefault();
2926
+ if (t.events.fire(I).markMode) return;
2927
+ const k = parent?.onActiveMark;
2928
+ k?.(t.getMarkData(!0)), t.events.fire(q);
2929
+ }, y.oncontextmenu = (k) => k.preventDefault();
2940
2930
  const g = new ie(y);
2941
2931
  g.position.copy(a), g.element.style.pointerEvents = "none", g.scale.set(0.01, 0.01, 0.01), g.visible = n.mainTagVisible;
2942
- const x = (a.distanceTo(o) * t.events.fire(_).meterScale).toFixed(2) + " m", b = document.createElement("div");
2943
- b.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;">${x}</span>`, b.classList.add("mark-wrap-line", `${p}`, "distance-warp"), b.style.position = "absolute", b.style.borderRadius = "4px", b.style.pointerEvents = "none";
2944
- const S = new ie(b);
2945
- S.position.copy(s), S.element.style.pointerEvents = "none", S.scale.set(8e-3, 8e-3, 8e-3), S.visible = n.distanceTagVisible, t.add(d, h, g, S), t.data = n, t.circleStart = d, t.circleEnd = h, t.css3dTag = S, t.css3dMainTag = g, t.events.fire(Me, t);
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";
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);
2946
2936
  }
2947
2937
  getMarkData(e = !1) {
2948
2938
  const t = { ...this.data };
2949
2939
  return e ? (delete t.startPoint, delete t.endPoint) : (t.startPoint = [...t.startPoint], t.endPoint = [...t.endPoint]), t;
2950
2940
  }
2951
2941
  dispose() {
2952
- if (this.disposed)
2953
- return;
2942
+ if (this.disposed) return;
2954
2943
  const e = this;
2955
2944
  e.disposed = !0, e.events.fire(ke, e), e.events.fire(B).remove(e), e.events.fire(Ze, e), document.querySelectorAll(`.${e.data.name}`).forEach((n) => n.parentElement?.removeChild(n)), e.events = null, e.data = null, e.circleStart = null, e.circleEnd = null, e.css3dTag = null, e.css3dMainTag = null;
2956
2945
  }
2957
2946
  }
2958
- class Tn extends Fe {
2947
+ class Mn extends Re {
2959
2948
  constructor(e) {
2960
- super(), this.isMark = !0, this.disposed = !1, this.css3dTags = [], this.group = new Ht(), this.add(this.group), this.events = e;
2949
+ super(), this.isMark = !0, this.disposed = !1, this.css3dTags = [], this.group = new Qt(), this.add(this.group), this.events = e;
2961
2950
  }
2962
2951
  /**
2963
2952
  * 绘制开始
2964
2953
  */
2965
2954
  drawStart(e, t) {
2966
- if (this.disposed)
2967
- return;
2955
+ if (this.disposed) return;
2968
2956
  const n = document.querySelectorAll(".mark-wrap-lines.main-warp").length + 1, a = {
2969
2957
  type: "MarkMultiLines",
2970
2958
  name: t || "lines" + Date.now(),
@@ -2988,18 +2976,17 @@ class Tn extends Fe {
2988
2976
  * 绘制更新
2989
2977
  */
2990
2978
  drawUpdate(e, t = !0, n, a = !1) {
2991
- if (this.disposed)
2992
- return;
2979
+ if (this.disposed) return;
2993
2980
  const o = this;
2994
2981
  if (n)
2995
2982
  if (a) {
2996
- 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(_).meterScale).toFixed(2) + " m";
2997
- 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);
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);
2998
2985
  } else {
2999
2986
  const s = o.data.points.length;
3000
2987
  o.data.points[s - 3] = n.x, o.data.points[s - 2] = n.y, o.data.points[s - 1] = n.z;
3001
- 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(_).meterScale).toFixed(2) + " m";
3002
- 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;
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;
3003
2990
  }
3004
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);
3005
2992
  }
@@ -3009,7 +2996,7 @@ class Tn extends Fe {
3009
2996
  updateByMeterScale(e) {
3010
2997
  const t = this, n = [];
3011
2998
  for (let s = 0, r = t.data.points.length / 3; s < r; s++)
3012
- n.push(new C(t.data.points[s * 3], t.data.points[s * 3 + 1], t.data.points[s * 3 + 2]));
2999
+ n.push(new M(t.data.points[s * 3], t.data.points[s * 3 + 1], t.data.points[s * 3 + 2]));
3013
3000
  let a, o;
3014
3001
  for (let s = 1; s < n.length; s++)
3015
3002
  a = n[s - 1], o = n[s], t.css3dTags[s - 1].element.childNodes[0].innerText = (a.distanceTo(o) * e).toFixed(2) + " m";
@@ -3018,9 +3005,8 @@ class Tn extends Fe {
3018
3005
  * 绘制结束
3019
3006
  */
3020
3007
  drawFinish(e) {
3021
- if (this.disposed)
3022
- return;
3023
- 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));
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));
3024
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) {
3025
3011
  t.dispose();
3026
3012
  return;
@@ -3032,14 +3018,13 @@ class Tn extends Fe {
3032
3018
  t.css3dTags[t.css3dTags.length - 1].visible = !0;
3033
3019
  }
3034
3020
  const s = parent?.onActiveMark, r = t.getMarkData(!0);
3035
- r.isNew = !0, r.meterScale = t.events.fire(_).meterScale, s?.(r);
3021
+ r.isNew = !0, r.meterScale = t.events.fire(I).meterScale, s?.(r);
3036
3022
  }
3037
3023
  /**
3038
3024
  * 根据数据直接绘制
3039
3025
  */
3040
3026
  draw(e, t = !1) {
3041
- if (this.disposed)
3042
- return;
3027
+ if (this.disposed) return;
3043
3028
  const n = this;
3044
3029
  this.css3dTags = this.css3dTags || [];
3045
3030
  const a = {
@@ -3061,26 +3046,25 @@ class Tn extends Fe {
3061
3046
  }, o = n.geometry, s = n.material, r = new pt();
3062
3047
  r.setPositions([...a.points]);
3063
3048
  const c = new Xe({ color: a.lineColor, linewidth: a.lineWidth });
3064
- c.resolution.set(innerWidth, innerHeight), n.copy(new Fe(r, c)), o?.dispose(), s?.dispose();
3065
- const u = a.name, l = a.points.length / 3 - 1;
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;
3066
3051
  if (!n.css3dMainTag) {
3067
- const d = document.createElement("div");
3068
- d.innerHTML = `<div style='flex-direction: column;align-items: center;display: flex;pointer-events: none;margin-bottom: 40px;'>
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;'>
3069
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>
3070
- </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 = () => {
3071
- if (n.events.fire(_).markMode)
3072
- return;
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 = () => {
3056
+ if (n.events.fire(I).markMode) return;
3073
3057
  const f = parent?.onActiveMark, p = n.getMarkData(!0);
3074
- p.meterScale = n.events.fire(_).meterScale, f?.(p), n.events.fire(q);
3075
- }, d.oncontextmenu = (f) => f.preventDefault();
3076
- const h = new ie(d);
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);
3077
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;
3078
3062
  }
3079
- for (let d = n.css3dTags.length; d < l; d++) {
3080
- 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(_).meterScale).toFixed(2) + " m", m = document.createElement("div");
3081
- m.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>`, m.classList.add("mark-wrap-lines", `${u}`, "distance-warp"), m.style.position = "absolute", m.style.borderRadius = "4px", m.style.display = "none";
3082
- const x = new ie(m);
3083
- x.position.copy(p), x.element.style.pointerEvents = "none", x.scale.set(8e-3, 8e-3, 8e-3), x.visible = a.distanceTagVisible, n.css3dTags.push(x), n.group.add(x);
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);
3084
3068
  }
3085
3069
  t || (n.css3dTags[n.css3dTags.length - 1].visible = !1), n.data = a, n.events.fire(Me, n);
3086
3070
  }
@@ -3089,18 +3073,17 @@ class Tn extends Fe {
3089
3073
  return e ? delete t.points : t.points = [...t.points], t;
3090
3074
  }
3091
3075
  dispose() {
3092
- if (this.disposed)
3093
- return;
3076
+ if (this.disposed) return;
3094
3077
  const e = this;
3095
3078
  e.disposed = !0, e.events.fire(ke, e), e.events.fire(B).remove(e), e.events.fire(Ze, e), e.geometry.dispose(), e.material.dispose(), document.querySelectorAll(`.${e.data.name}`).forEach((n) => n.parentElement?.removeChild(n)), e.events = null, e.data = null, e.css3dTags = null, e.group = null;
3096
3079
  }
3097
3080
  }
3098
- class ia extends Ht {
3081
+ class ia extends Qt {
3099
3082
  constructor(e, t, n) {
3100
3083
  super(), this.isMark = !0, this.disposed = !1, this.events = e;
3101
3084
  const a = this;
3102
3085
  let o;
3103
- if (t instanceof C) {
3086
+ if (t instanceof M) {
3104
3087
  const c = document.querySelectorAll(".mark-wrap-point").length + 1;
3105
3088
  o = {
3106
3089
  type: "MarkSinglePoint",
@@ -3134,8 +3117,7 @@ class ia extends Ht {
3134
3117
  <span class="${o.name}" style="color:${o.mainTagColor};background:${o.mainTagBackground};opacity:${o.mainTagOpacity};padding:1px 5px 2px 5px;border-radius: 4px;margin-bottom: 5px;user-select: none;font-size: 12px;pointer-events: auto;">${o.title}</span>
3135
3118
  <svg height="20" width="20" style="color:${o.iconColor};opacity:${o.iconOpacity};"><use href="${o.iconName}" fill="currentColor" /></svg>
3136
3119
  </div>`, s.classList.add("mark-wrap-point", `mark-wrap-${o.name}`), s.style.position = "absolute", s.style.borderRadius = "4px", s.style.cursor = "pointer", s.onclick = () => {
3137
- if (a.events.fire(_).markMode)
3138
- return;
3120
+ if (a.events.fire(I).markMode) return;
3139
3121
  const c = parent?.onActiveMark;
3140
3122
  c?.(a.getMarkData(!0)), a.events.fire(q);
3141
3123
  }, s.oncontextmenu = (c) => c.preventDefault();
@@ -3146,8 +3128,7 @@ class ia extends Ht {
3146
3128
  * 绘制更新
3147
3129
  */
3148
3130
  drawUpdate(e, t = !0) {
3149
- if (this.disposed)
3150
- return;
3131
+ if (this.disposed) return;
3151
3132
  const n = this;
3152
3133
  if (e?.iconName) {
3153
3134
  t && (n.data.iconName = e.iconName);
@@ -3167,42 +3148,39 @@ class ia extends Ht {
3167
3148
  e?.mainTagColor && (t && (n.data.mainTagColor = e.mainTagColor), this.css3dTag.element.querySelector(`.${n.data.name}`).style.color = e.mainTagColor), e?.mainTagBackground && (t && (n.data.mainTagBackground = e.mainTagBackground), this.css3dTag.element.querySelector(`.${n.data.name}`).style.background = e.mainTagBackground), e?.mainTagOpacity && (t && (n.data.mainTagOpacity = e.mainTagOpacity), this.css3dTag.element.querySelector(`.${n.data.name}`).style.opacity = e.mainTagOpacity.toString()), e?.title !== void 0 && (t && (n.data.title = e.title), this.css3dTag.element.querySelector(`.${n.data.name}`).innerText = e.title), e?.note !== void 0 && t && (n.data.note = e.note), n.events.fire(J);
3168
3149
  }
3169
3150
  resetMeterScale(e) {
3170
- e?.meterScale !== void 0 && (this.events.fire(_).meterScale = e.meterScale);
3151
+ e?.meterScale !== void 0 && (this.events.fire(I).meterScale = e.meterScale);
3171
3152
  }
3172
3153
  /**
3173
3154
  * 绘制结束
3174
3155
  */
3175
3156
  drawFinish() {
3176
- if (this.disposed)
3177
- return;
3157
+ if (this.disposed) return;
3178
3158
  const e = this;
3179
3159
  e.events.fire(Te);
3180
3160
  const t = parent?.onActiveMark, n = e.getMarkData(!0);
3181
- n.isNew = !0, n.meterScale = e.events.fire(_).meterScale, t?.(n);
3161
+ n.isNew = !0, n.meterScale = e.events.fire(I).meterScale, t?.(n);
3182
3162
  }
3183
3163
  getMarkData(e = !1) {
3184
3164
  const t = { ...this.data };
3185
3165
  return e ? delete t.point : t.point = [...t.point], t;
3186
3166
  }
3187
3167
  dispose() {
3188
- if (this.disposed)
3189
- return;
3168
+ if (this.disposed) return;
3190
3169
  const e = this;
3191
3170
  e.disposed = !0, e.events.fire(ke, e), e.events.fire(B).remove(e), e.events.fire(Ze, e);
3192
3171
  const t = document.querySelector(`.mark-wrap-${e.data.name}`);
3193
3172
  t?.parentElement?.removeChild?.(t), e.events = null, e.data = null, e.css3dTag = null;
3194
3173
  }
3195
3174
  }
3196
- class kn extends Fe {
3175
+ class Tn extends Re {
3197
3176
  constructor(e) {
3198
- super(), this.isMark = !0, this.disposed = !1, this.css3dTags = [], this.group = new Ht(), this.add(this.group), this.events = e;
3177
+ super(), this.isMark = !0, this.disposed = !1, this.css3dTags = [], this.group = new Qt(), this.add(this.group), this.events = e;
3199
3178
  }
3200
3179
  /**
3201
3180
  * 绘制开始
3202
3181
  */
3203
3182
  drawStart(e, t) {
3204
- if (this.disposed)
3205
- return;
3183
+ if (this.disposed) return;
3206
3184
  const n = document.querySelectorAll(".mark-wrap-plans.main-warp").length + 1, a = {
3207
3185
  type: "MarkMultiPlans",
3208
3186
  name: t || "plans" + Date.now(),
@@ -3228,21 +3206,20 @@ class kn extends Fe {
3228
3206
  * 绘制更新
3229
3207
  */
3230
3208
  drawUpdate(e, t = !0, n, a = !1) {
3231
- if (this.disposed)
3232
- return;
3209
+ if (this.disposed) return;
3233
3210
  const o = this;
3234
3211
  if (n)
3235
3212
  if (a) {
3236
- 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(_).meterScale).toFixed(2) + " m";
3237
- 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);
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);
3238
3215
  } else {
3239
3216
  const s = o.data.points.length;
3240
3217
  o.data.points[s - 3] = n.x, o.data.points[s - 2] = n.y, o.data.points[s - 1] = n.z;
3241
- 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(_).meterScale).toFixed(2) + " m";
3242
- 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;
3243
- const f = o.events.fire(dn, o.data.points);
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;
3220
+ const f = o.events.fire(ln, o.data.points);
3244
3221
  o.css3dAreaTag.position.copy(f);
3245
- const p = o.events.fire(un, o.data.points);
3222
+ const p = o.events.fire(dn, o.data.points);
3246
3223
  o.css3dAreaTag.element.childNodes[0].innerText = p.toFixed(2) + " m²";
3247
3224
  }
3248
3225
  if (e?.lineColor && (t && (o.data.lineColor = e.lineColor), o.material.color.set(e.lineColor), o.meshPlans.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?.areaTagVisible !== void 0 && (t && (o.data.areaTagVisible = e.areaTagVisible), o.css3dAreaTag.visible = e.areaTagVisible), e?.areaTagColor) {
@@ -3268,7 +3245,7 @@ class kn extends Fe {
3268
3245
  updateByMeterScale(e) {
3269
3246
  const t = this, n = [];
3270
3247
  for (let r = 0, c = t.data.points.length / 3; r < c; r++)
3271
- n.push(new C(t.data.points[r * 3], t.data.points[r * 3 + 1], t.data.points[r * 3 + 2]));
3248
+ n.push(new M(t.data.points[r * 3], t.data.points[r * 3 + 1], t.data.points[r * 3 + 2]));
3272
3249
  let a, o;
3273
3250
  for (let r = 1; r < n.length; r++)
3274
3251
  a = n[r - 1], o = n[r], t.css3dTags[r - 1].element.innerText = (a.distanceTo(o) * e).toFixed(2) + " m";
@@ -3279,9 +3256,8 @@ class kn extends Fe {
3279
3256
  * 绘制结束
3280
3257
  */
3281
3258
  drawFinish(e) {
3282
- if (this.disposed)
3283
- return;
3284
- 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));
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));
3285
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) {
3286
3262
  t.dispose();
3287
3263
  return;
@@ -3292,14 +3268,13 @@ class kn extends Fe {
3292
3268
  }
3293
3269
  t.data.points.push(t.data.points[0], t.data.points[1], t.data.points[2]), t.draw(t.data, !0), t.css3dTags[t.css3dTags.length - 1].visible = !0;
3294
3270
  const s = parent?.onActiveMark, r = t.getMarkData(!0);
3295
- r.isNew = !0, r.meterScale = t.events.fire(_).meterScale, s?.(r);
3271
+ r.isNew = !0, r.meterScale = t.events.fire(I).meterScale, s?.(r);
3296
3272
  }
3297
3273
  /**
3298
3274
  * 根据数据直接绘制
3299
3275
  */
3300
3276
  draw(e, t = !1) {
3301
- if (this.disposed)
3302
- return;
3277
+ if (this.disposed) return;
3303
3278
  const n = this;
3304
3279
  this.css3dTags = this.css3dTags || [];
3305
3280
  const a = {
@@ -3323,36 +3298,35 @@ class kn extends Fe {
3323
3298
  }, o = n.geometry, s = n.material, r = new pt();
3324
3299
  r.setPositions([...a.points]);
3325
3300
  const c = new Xe({ color: a.lineColor, linewidth: a.lineWidth });
3326
- c.resolution.set(innerWidth, innerHeight), n.copy(new Fe(r, c)), o?.dispose(), s?.dispose();
3327
- const u = a.name, l = a.points.length / 3 - 1;
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;
3328
3303
  if (!n.css3dMainTag) {
3329
3304
  const f = document.createElement("div");
3330
3305
  f.innerHTML = `<div style='flex-direction: column;align-items: center;display: flex;pointer-events: none;margin-bottom: 40px;'>
3331
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>
3332
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 = () => {
3333
- if (n.events.fire(_).markMode)
3334
- return;
3308
+ if (n.events.fire(I).markMode) return;
3335
3309
  const y = parent?.onActiveMark, g = n.getMarkData(!0);
3336
- g.meterScale = n.events.fire(_).meterScale, y?.(g), n.events.fire(q);
3310
+ g.meterScale = n.events.fire(I).meterScale, y?.(g), n.events.fire(q);
3337
3311
  }, f.oncontextmenu = (y) => y.preventDefault();
3338
3312
  const p = new ie(f);
3339
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;
3340
3314
  }
3341
- const d = n.events.fire(un, a.points).toFixed(2) + " m²", h = n.events.fire(dn, a.points);
3315
+ const l = n.events.fire(dn, a.points).toFixed(2) + " m²", h = n.events.fire(ln, a.points);
3342
3316
  if (n.css3dAreaTag)
3343
- n.css3dAreaTag.position.copy(h), n.css3dAreaTag.element.childNodes[0].innerText = d;
3317
+ n.css3dAreaTag.position.copy(h), n.css3dAreaTag.element.childNodes[0].innerText = l;
3344
3318
  else {
3345
3319
  const f = document.createElement("div");
3346
- 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";
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";
3347
3321
  const p = new ie(f);
3348
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;
3349
3323
  }
3350
3324
  n.css3dAreaTag.visible = a.points.length > 6 && a.areaTagVisible;
3351
- for (let f = n.css3dTags.length; f < l; f++) {
3352
- const p = new C().fromArray(a.points.slice(f * 3, f * 3 + 3)), y = new C().fromArray(a.points.slice(f * 3 + 3, f * 3 + 6)), g = new C((p.x + y.x) / 2, (p.y + y.y) / 2, (p.z + y.z) / 2), x = (p.distanceTo(y) * n.events.fire(_).meterScale).toFixed(2) + " m", b = document.createElement("div");
3353
- b.innerText = x, b.style.color = "white", b.classList.add("mark-wrap-plans", `${u}`, "distance-warp"), b.style.position = "absolute", b.style.borderRadius = "4px", b.style.display = "none";
3354
- const S = new ie(b);
3355
- S.position.copy(g), S.element.style.pointerEvents = "none", S.scale.set(8e-3, 8e-3, 8e-3), S.visible = a.distanceTagVisible, n.css3dTags.push(S), n.group.add(S);
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";
3328
+ const v = new ie(S);
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);
3356
3330
  }
3357
3331
  n.drawPlans(a), t || (n.css3dTags[n.css3dTags.length - 1].visible = !1), n.data = a, n.events.fire(Me, n);
3358
3332
  }
@@ -3374,7 +3348,7 @@ class kn extends Fe {
3374
3348
  if (e.points.length > 6) {
3375
3349
  t.meshPlans.geometry.setAttribute("position", new He(new Float32Array(e.points), 3)), t.meshPlans.geometry.attributes.position.needsUpdate = !0;
3376
3350
  let n = e.points.length / 3 - 2;
3377
- const a = new C().fromArray(e.points.slice(0, 3)), o = new C().fromArray(e.points.slice(-3));
3351
+ const a = new M().fromArray(e.points.slice(0, 3)), o = new M().fromArray(e.points.slice(-3));
3378
3352
  a.distanceTo(o) < 1e-4 && n--;
3379
3353
  const s = new Uint16Array(n * 3);
3380
3354
  for (let r = 0; r < n; r++)
@@ -3387,13 +3361,12 @@ class kn extends Fe {
3387
3361
  return e ? delete t.points : t.points = [...t.points], t;
3388
3362
  }
3389
3363
  dispose() {
3390
- if (this.disposed)
3391
- return;
3364
+ if (this.disposed) return;
3392
3365
  const e = this;
3393
3366
  e.disposed = !0, e.events.fire(ke, e), e.events.fire(B).remove(e), e.events.fire(Ze, e), e.geometry.dispose(), e.material.dispose(), document.querySelectorAll(`.${e.data.name}`).forEach((n) => n.parentElement?.removeChild(n)), e.events = null, e.data = null, e.css3dTags = null, e.group = null, e.meshPlans = null, e.css3dMainTag = null, e.css3dAreaTag = null;
3394
3367
  }
3395
3368
  }
3396
- class sa extends Ht {
3369
+ class sa extends Qt {
3397
3370
  constructor(e) {
3398
3371
  super(), this.isMark = !0, this.disposed = !1, this.events = e;
3399
3372
  }
@@ -3401,8 +3374,7 @@ class sa extends Ht {
3401
3374
  * 绘制开始
3402
3375
  */
3403
3376
  drawStart(e, t) {
3404
- if (this.disposed)
3405
- return;
3377
+ if (this.disposed) return;
3406
3378
  const n = this, a = document.querySelectorAll(".mark-wrap-circle.main-warp").length + 1, o = {
3407
3379
  type: "MarkCirclePlan",
3408
3380
  name: t || "circle" + Date.now(),
@@ -3423,41 +3395,39 @@ class sa extends Ht {
3423
3395
  r.opacity = o.circleOpacity;
3424
3396
  const c = new te(s, r);
3425
3397
  c.position.copy(e), c.isMark = !0, c.renderOrder = 1;
3426
- const u = new C(0, 1, 0).normalize();
3398
+ const u = new M(0, 1, 0).normalize();
3427
3399
  c.lookAt(c.position.clone().add(u));
3428
- const l = document.createElement("div");
3429
- l.innerHTML = `<div style='flex-direction: column;align-items: center;display: flex;pointer-events: none;margin-bottom: 40px;'>
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;'>
3430
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>
3431
- </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 = () => {
3432
- if (n.events.fire(_).markMode)
3433
- return;
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 = () => {
3404
+ if (n.events.fire(I).markMode) return;
3434
3405
  const p = parent?.onActiveMark;
3435
3406
  p?.(n.getMarkData(!0)), n.events.fire(q);
3436
- }, l.oncontextmenu = (p) => p.preventDefault();
3437
- const d = new ie(l);
3438
- d.position.copy(e), d.element.style.pointerEvents = "none", d.scale.set(0.01, 0.01, 0.01), d.visible = o.mainTagVisible;
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;
3439
3410
  const h = document.createElement("div");
3440
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";
3441
3412
  const f = new ie(h);
3442
- 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);
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);
3443
3414
  }
3444
3415
  /**
3445
3416
  * 绘制更新
3446
3417
  */
3447
3418
  drawUpdate(e, t = !0, n) {
3448
- if (this.disposed)
3449
- return;
3419
+ if (this.disposed) return;
3450
3420
  const a = this;
3451
3421
  if (n) {
3452
- const o = new C().fromArray(a.data.startPoint), s = o.distanceTo(new C(n.x, o.y, n.z));
3422
+ const o = new M().fromArray(a.data.startPoint), s = o.distanceTo(new M(n.x, o.y, n.z));
3453
3423
  t && (a.data.radius = s), a.circleMesh.geometry.copy(new De(s, 128)), a.css3dTag.visible = s > 0.3;
3454
- const r = s * a.events.fire(_).meterScale, c = (Math.PI * r * r).toFixed(2) + " m²";
3424
+ const r = s * a.events.fire(I).meterScale, c = (Math.PI * r * r).toFixed(2) + " m²";
3455
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);
3456
3426
  }
3457
3427
  if (e?.radius) {
3458
- const o = new C().fromArray(a.data.startPoint), s = e?.radius;
3428
+ const o = new M().fromArray(a.data.startPoint), s = e?.radius;
3459
3429
  t && (a.data.radius = s), a.circleMesh.geometry.copy(new De(s, 128)), a.css3dTag.visible = s > 0.3;
3460
- const r = s * a.events.fire(_).meterScale, c = (Math.PI * r * r).toFixed(2) + " m²";
3430
+ const r = s * a.events.fire(I).meterScale, c = (Math.PI * r * r).toFixed(2) + " m²";
3461
3431
  a.css3dTag.element.childNodes[0].innerText = c, a.css3dTag.position.set(o.x + Math.min(s / 2, 0.5), o.y, o.z);
3462
3432
  }
3463
3433
  e?.circleColor && (t && (a.data.circleColor = e.circleColor), a.circleMesh.material.color.set(e.circleColor)), e?.circleOpacity && (t && (a.data.circleOpacity = e.circleOpacity), a.circleMesh.material.opacity = e.circleOpacity), e?.mainTagColor && (t && (a.data.mainTagColor = e.mainTagColor), document.querySelector(`.${a.data.name}-main-tag`).style.color = e.mainTagColor), e?.mainTagBackground && (t && (a.data.mainTagBackground = e.mainTagBackground), document.querySelector(`.${a.data.name}-main-tag`).style.background = e.mainTagBackground), e?.mainTagOpacity && (t && (a.data.mainTagOpacity = e.mainTagOpacity), document.querySelector(`.${a.data.name}-main-tag`).style.opacity = e.mainTagOpacity.toString()), e?.mainTagVisible !== void 0 && (t && (a.data.mainTagVisible = e.mainTagVisible), a.css3dMainTag.visible = e.mainTagVisible), e?.circleTagColor && (t && (a.data.circleTagColor = e.circleTagColor), document.querySelector(`.${a.data.name}-circle-tag`).style.color = e.circleTagColor), e?.circleTagBackground && (t && (a.data.circleTagBackground = e.circleTagBackground), document.querySelector(`.${a.data.name}-circle-tag`).style.background = e.circleTagBackground), e?.circleTagOpacity && (t && (a.data.circleTagOpacity = e.circleTagOpacity), document.querySelector(`.${a.data.name}-circle-tag`).style.opacity = e.circleTagOpacity.toString()), e?.circleTagVisible !== void 0 && (t && (a.data.circleTagVisible = e.circleTagVisible), a.css3dTag.visible = e.circleTagVisible), e?.title !== void 0 && (t && (a.data.title = e.title), this.css3dMainTag.element.querySelector(`.${a.data.name}-main-tag`).innerText = e.title), e?.note !== void 0 && t && (a.data.note = e.note), a.events.fire(J);
@@ -3473,21 +3443,19 @@ class sa extends Ht {
3473
3443
  * 绘制结束
3474
3444
  */
3475
3445
  drawFinish(e) {
3476
- if (this.disposed)
3477
- return;
3478
- const t = this, n = new C().fromArray(t.data.startPoint), a = n.distanceTo(new C(e.x, n.y, e.z));
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));
3479
3448
  t.data.radius = a, t.circleMesh.geometry.copy(new De(a, 128));
3480
- const o = t.data.radius * t.events.fire(_).meterScale, s = (Math.PI * o * o).toFixed(2) + " m²";
3449
+ const o = t.data.radius * t.events.fire(I).meterScale, s = (Math.PI * o * o).toFixed(2) + " m²";
3481
3450
  t.css3dTag.element.childNodes[0].innerText = s, t.events.fire(Te);
3482
3451
  const r = parent?.onActiveMark, c = t.getMarkData(!0);
3483
- c.isNew = !0, c.meterScale = t.events.fire(_).meterScale, r?.(c);
3452
+ c.isNew = !0, c.meterScale = t.events.fire(I).meterScale, r?.(c);
3484
3453
  }
3485
3454
  /**
3486
3455
  * 根据数据直接绘制
3487
3456
  */
3488
3457
  draw(e) {
3489
- if (this.disposed)
3490
- return;
3458
+ if (this.disposed) return;
3491
3459
  const t = this, n = {
3492
3460
  type: "MarkCirclePlan",
3493
3461
  name: e.name || "circle" + Date.now(),
@@ -3508,31 +3476,29 @@ class sa extends Ht {
3508
3476
  o.opacity = n.circleOpacity;
3509
3477
  const s = new te(a, o);
3510
3478
  s.position.fromArray(n.startPoint), s.isMark = !0, s.renderOrder = 1;
3511
- const r = new C(0, 1, 0).normalize();
3479
+ const r = new M(0, 1, 0).normalize();
3512
3480
  s.lookAt(s.position.clone().add(r));
3513
3481
  const c = n.name, u = document.createElement("div");
3514
3482
  u.innerHTML = `<div style='flex-direction: column;align-items: center;display: flex;pointer-events: none;margin-bottom: 40px;'>
3515
3483
  <span class="${c}-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>
3516
3484
  </div>`, u.classList.add("mark-wrap-circle", `${n.name}`, "main-warp"), u.style.position = "absolute", u.style.borderRadius = "4px", u.style.cursor = "pointer", u.onclick = () => {
3517
- if (t.events.fire(_).markMode)
3518
- return;
3485
+ if (t.events.fire(I).markMode) return;
3519
3486
  const g = parent?.onActiveMark;
3520
3487
  g?.(t.getMarkData(!0)), t.events.fire(q);
3521
3488
  }, u.oncontextmenu = (g) => g.preventDefault();
3522
- const l = new C().fromArray(n.startPoint), d = n.radius * t.events.fire(_).meterScale, h = (Math.PI * d * d).toFixed(2) + " m²", f = new ie(u);
3523
- f.position.copy(l), f.element.style.pointerEvents = "none", f.scale.set(0.01, 0.01, 0.01), f.visible = n.mainTagVisible;
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;
3524
3491
  const p = document.createElement("div");
3525
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";
3526
3493
  const y = new ie(p);
3527
- y.position.set(l.x + Math.min(n.radius / 2, 0.5), l.y, l.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);
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);
3528
3495
  }
3529
3496
  getMarkData(e = !1) {
3530
3497
  const t = { ...this.data };
3531
3498
  return e ? (delete t.startPoint, delete t.radius) : t.startPoint = [...t.startPoint], t;
3532
3499
  }
3533
3500
  dispose() {
3534
- if (this.disposed)
3535
- return;
3501
+ if (this.disposed) return;
3536
3502
  const e = this;
3537
3503
  e.disposed = !0, e.events.fire(ke, e), e.events.fire(B).remove(e), e.events.fire(Ze, e), document.querySelectorAll(`.${e.data.name}`).forEach((n) => n.parentElement?.removeChild(n)), e.events = null, e.data = null, e.circleMesh = null, e.css3dTag = null, e.css3dMainTag = null;
3538
3504
  }
@@ -3542,233 +3508,237 @@ let wr = class {
3542
3508
  this.down = 0, this.move = !1, this.downTime = 0, this.isDbClick = !1, this.x = 0, this.y = 0, this.lastClickX = 0, this.lastClickY = 0, this.lastClickPointTime = 0, this.lastMovePoint = null, this.lastMovePointTime = 0;
3543
3509
  }
3544
3510
  };
3545
- function Sr(i) {
3546
- const e = (v, D, k) => i.on(v, D, k), t = (v, ...D) => i.fire(v, ...D), n = t($e);
3511
+ function vr(i) {
3512
+ const e = (w, D, _) => i.on(w, D, _), t = (w, ...D) => i.fire(w, ...D), n = t(Ke);
3547
3513
  let a = /* @__PURE__ */ new Set(), o, s = new wr(), r;
3548
3514
  e(oi, () => {
3549
- t(Y).autoRotate = t(_).autoRotate = !0;
3550
- }), e(q, (v = !0) => {
3551
- t(Y).autoRotate = t(_).autoRotate = !1, v && t(Qt);
3552
- }), e(Zt, (v = !0) => {
3553
- if (o)
3554
- return;
3555
- const D = t(Y), k = v ? Math.PI / 128 : -(Math.PI / 128), M = new Ke().makeRotationAxis(new C(0, 0, -1).transformDirection(D.object.matrixWorld), k);
3556
- D.object.up.transformDirection(M), t(J);
3515
+ t(Y).autoRotate = t(I).autoRotate = !0;
3516
+ }), e(q, (w = !0) => {
3517
+ t(Y).autoRotate = t(I).autoRotate = !1, w && t(zt);
3518
+ }), e(Kt, (w = !0) => {
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), _);
3521
+ D.object.up.transformDirection(T), t(J);
3557
3522
  }), e(yi, () => {
3558
- o || i.fire(Zt, !0);
3523
+ o || i.fire(Kt, !0);
3559
3524
  }), e(Ai, () => {
3560
- o || i.fire(Zt, !1);
3561
- }), e(Ut, (v) => {
3562
- const D = t(_);
3563
- v ?? (v = !D.pointcloudMode), D.pointcloudMode = v, t(B).traverse((M) => M instanceof pe && M.fire(nt, v));
3564
- }), e(Ot, () => {
3565
- t(B).traverse((D) => D instanceof pe && D.fire(gn));
3566
- }), e(rt, (v) => {
3567
- t(B).traverse((k) => k instanceof pe && k.fire(rt, v));
3525
+ o || i.fire(Kt, !1);
3526
+ }), e(Bt, (w) => {
3527
+ const D = t(I);
3528
+ w ?? (w = !D.pointcloudMode), D.pointcloudMode = w, t(B).traverse((T) => T instanceof pe && T.fire(nt, w));
3529
+ }), e(Ut, () => {
3530
+ t(B).traverse((D) => D instanceof pe && D.fire(fn));
3531
+ }), e(rt, (w) => {
3532
+ t(B).traverse((_) => _ instanceof pe && _.fire(rt, w));
3568
3533
  }), e(Ci, () => {
3569
- const v = t(B);
3534
+ const w = t(B);
3570
3535
  let D;
3571
- v.traverse((k) => k instanceof pe && (D = k)), D && t(hn, D.fire(Ys));
3572
- }), e(Yt, () => {
3573
- if (!a.size)
3574
- return;
3575
- const v = t(_);
3576
- if (!v.enableKeyboard)
3577
- return a.clear();
3578
- if (v.markMode && a.has("Escape")) {
3536
+ w.traverse((_) => _ instanceof pe && (D = _)), D && t(un, D.fire(Ys));
3537
+ }), e(Wt, () => {
3538
+ if (!a.size) return;
3539
+ const w = t(I);
3540
+ if (!w.enableKeyboard) return a.clear();
3541
+ if (w.markMode && a.has("Escape")) {
3579
3542
  t(qe), a.clear();
3580
3543
  return;
3581
3544
  }
3582
- a.has("Space") ? (v.bigSceneMode ? t(Ut) : t(Ot), a.clear()) : a.has("KeyR") ? (v.autoRotate ? t(q) : t(oi), a.clear()) : a.has("KeyM") ? (t(dt, !v.markVisible), a.clear()) : a.has("ArrowLeft") ? (t(yi), t(kt, !0), a.clear()) : a.has("ArrowRight") ? (t(Ai), t(kt, !0), a.clear()) : a.has("KeyP") ? (t(zt, !0), a.clear()) : a.has("Equal") ? (t(Wn), a.clear()) : a.has("Minus") ? (t(Yn), a.clear()) : a.has("KeyY") ? (t(An), a.clear()) : a.has("KeyI") ? (t(Os), a.clear()) : a.has("KeyF") ? (t(Ci), a.clear()) : a.has("F2") && (!v.bigSceneMode && window.open("/editor/index.html?url=" + encodeURIComponent(t(ye).meta.url)), a.clear());
3583
- }), e(it, async (v, D) => {
3584
- if (s.move)
3585
- return;
3586
- const k = await t(Ft, v, D);
3587
- k.length && t(hn, k[0], !0);
3588
- }), e(ce, async (v, D) => {
3589
- const k = t(B), M = [];
3590
- k.traverse((E) => E instanceof pe && M.push(E));
3591
- const R = await t(Ft, v, D);
3592
- return R.length ? (M.length && M[0].fire(Mt, R[0].x, R[0].y, R[0].z, !0), new C(R[0].x, R[0].y, R[0].z)) : (M.length && M[0].fire(Mt, 0, 0, 0, !1), null);
3593
- }), e(Un, async () => {
3594
- const v = t(B), D = [];
3595
- v.traverse((k) => k instanceof pe && D.push(k));
3596
- for (let k = 0; k < D.length; k++)
3597
- D[k].fire(Mt, 0, 0, 0, !1);
3545
+ a.has("Space") ? (w.bigSceneMode ? t(Bt) : t(Ut), a.clear()) : a.has("KeyR") ? (w.autoRotate ? t(q) : t(oi), a.clear()) : a.has("KeyM") ? (t(dt, !w.markVisible), a.clear()) : a.has("ArrowLeft") ? (t(yi), t(Tt, !0), a.clear()) : a.has("ArrowRight") ? (t(Ai), t(Tt, !0), a.clear()) : a.has("KeyP") ? (t(Ot, !0), a.clear()) : a.has("Equal") ? (t(Hn), a.clear()) : a.has("Minus") ? (t(Wn), a.clear()) : a.has("KeyY") ? (t(yn), a.clear()) : a.has("KeyI") ? (t(Os), a.clear()) : a.has("KeyF") ? (t(Ci), a.clear()) : a.has("F2") && (!w.bigSceneMode && window.open("/editor/index.html?url=" + encodeURIComponent(t(ye).meta.url)), a.clear());
3546
+ }), e(it, async (w, D) => {
3547
+ if (s.move) return;
3548
+ const _ = await t(Ft, w, D);
3549
+ _.length && t(un, _[0], !0);
3550
+ }), e(ce, async (w, D) => {
3551
+ const _ = t(B), T = [];
3552
+ _.traverse((E) => E instanceof pe && T.push(E));
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);
3555
+ }), e(Bn, async () => {
3556
+ const w = t(B), D = [];
3557
+ w.traverse((_) => _ instanceof pe && D.push(_));
3558
+ for (let _ = 0; _ < D.length; _++)
3559
+ D[_].fire(Ct, 0, 0, 0, !1);
3598
3560
  });
3599
- const c = (v) => {
3600
- v.target.type !== "text" && (o || v.code === "F5" || (v.preventDefault(), v.code !== "KeyR" && (a.add(v.code), t(q)), r = Date.now()));
3601
- }, u = (v) => {
3602
- v.target.type !== "text" && (o || (v.code === "KeyR" && a.add(v.code), (v.code === "ArrowLeft" || v.code === "ArrowRight") && t(us), r = Date.now()));
3561
+ const c = (w) => {
3562
+ w.target.type !== "text" && (o || w.code === "F5" || (w.preventDefault(), w.code !== "KeyR" && (a.add(w.code), t(q)), r = Date.now()));
3563
+ }, u = (w) => {
3564
+ w.target.type !== "text" && (o || (w.code === "KeyR" && a.add(w.code), (w.code === "ArrowLeft" || w.code === "ArrowRight") && t(us), r = Date.now()));
3603
3565
  };
3604
- e(Oe, () => {
3605
- t(On) && Date.now() - r > 2e3 && (t(kt, !1), t(An));
3606
- }, !0);
3607
- const l = () => {
3566
+ e(
3567
+ Oe,
3568
+ () => {
3569
+ t(Un) && Date.now() - r > 2e3 && (t(Tt, !1), t(yn));
3570
+ },
3571
+ !0
3572
+ );
3573
+ const d = () => {
3608
3574
  a.clear();
3609
- }, d = (v) => {
3610
- parent && setTimeout(() => window.focus()), v.preventDefault(), !o && (t(q), r = Date.now());
3611
- }, h = (v) => {
3612
- v.preventDefault(), !o && (t(q), r = Date.now());
3575
+ }, l = (w) => {
3576
+ parent && setTimeout(() => window.focus()), w.preventDefault(), !o && (t(q), r = Date.now());
3577
+ }, h = (w) => {
3578
+ w.preventDefault(), !o && (t(q), r = Date.now());
3613
3579
  };
3614
3580
  let f, p, y, g;
3615
3581
  e(qe, () => {
3616
3582
  f?.dispose(), p?.dispose(), y?.dispose(), g?.dispose(), f = null, p = null, y = null, g = null, s.lastMovePoint = null, t(Te);
3617
3583
  });
3618
- const m = async (v) => {
3619
- parent && setTimeout(() => window.focus()), v.preventDefault(), !o && (t(q), s.down = v.button === 2 ? 2 : 1, s.move = !1, s.isDbClick = Date.now() - s.downTime < 300, r = Date.now(), s.downTime = Date.now());
3620
- }, x = async (v) => {
3621
- if (v.preventDefault(), o)
3622
- return;
3584
+ const m = async (w) => {
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) => {
3587
+ if (w.preventDefault(), o) return;
3623
3588
  s.down && (s.move = !0, r = Date.now());
3624
- const D = t(_);
3589
+ const D = t(I);
3625
3590
  if (D.markMode) {
3626
- const k = await t(ce, v.clientX, v.clientY);
3627
- k && !s.down && D.markType === "distance" && f ? f.drawUpdate({ endPoint: k.toArray() }) : !s.down && D.markType === "circle" && g ? k ? (g.drawUpdate(null, !0, k), s.lastMovePoint = k, s.lastMovePointTime = Date.now()) : (s.lastMovePoint = null, s.lastMovePointTime = 0) : !s.down && D.markType === "lines" && p ? k ? (p.drawUpdate(null, !0, k), s.lastMovePoint = k, s.lastMovePointTime = Date.now()) : (s.lastMovePoint = null, s.lastMovePointTime = 0) : !s.down && D.markType === "plans" && y && (k ? (y.drawUpdate(null, !0, k), s.lastMovePoint = k, s.lastMovePointTime = Date.now()) : (s.lastMovePoint = null, s.lastMovePointTime = 0));
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));
3628
3593
  }
3629
- }, b = async (v) => {
3630
- if (v.preventDefault(), o)
3631
- return;
3632
- const D = t(_);
3633
- if (s.isDbClick && (p ? Math.abs(v.clientX - s.lastClickX) < 2 && Math.abs(v.clientY - s.lastClickY) < 2 && (p.drawFinish(s.lastClickPointTime > 0), p = null, s.lastMovePoint = null) : y && Math.abs(v.clientX - s.lastClickX) < 2 && Math.abs(v.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) {
3594
+ }, S = async (w) => {
3595
+ if (w.preventDefault(), o) return;
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) {
3634
3598
  if (D.markType === "point") {
3635
- if (await t(ce, v.clientX, v.clientY)) {
3636
- const M = new ia(i, await t(ce, v.clientX, v.clientY));
3637
- t(B).add(M), M.drawFinish();
3599
+ if (await t(ce, w.clientX, w.clientY)) {
3600
+ const T = new ia(i, await t(ce, w.clientX, w.clientY));
3601
+ t(B).add(T), T.drawFinish();
3638
3602
  }
3639
3603
  } else if (D.markType === "distance")
3640
3604
  if (f) {
3641
- const k = await t(ce, v.clientX, v.clientY);
3642
- k ? (f.drawFinish(k), f = null) : s.isDbClick && t(qe);
3605
+ const _ = await t(ce, w.clientX, w.clientY);
3606
+ _ ? (f.drawFinish(_), f = null) : s.isDbClick && t(qe);
3643
3607
  } else {
3644
- const k = await t(ce, v.clientX, v.clientY);
3645
- k && (f = new Mn(i), f.drawStart(k), t(B).add(f));
3608
+ const _ = await t(ce, w.clientX, w.clientY);
3609
+ _ && (f = new Cn(i), f.drawStart(_), t(B).add(f));
3646
3610
  }
3647
3611
  else if (D.markType === "lines")
3648
3612
  if (p)
3649
- if (s.lastMovePoint && t(yn, v.clientX, v.clientY, s.lastMovePoint) < 0.03)
3613
+ if (s.lastMovePoint && t(mn, w.clientX, w.clientY, s.lastMovePoint) < 0.03)
3650
3614
  p.drawUpdate(null, !0, s.lastMovePoint, !0), s.lastClickPointTime = Date.now();
3651
3615
  else {
3652
- const k = await t(ce, v.clientX, v.clientY);
3653
- k ? (p.drawUpdate(null, !0, k, !0), s.lastClickPointTime = Date.now()) : s.lastClickPointTime = 0;
3616
+ const _ = await t(ce, w.clientX, w.clientY);
3617
+ _ ? (p.drawUpdate(null, !0, _, !0), s.lastClickPointTime = Date.now()) : s.lastClickPointTime = 0;
3654
3618
  }
3655
3619
  else {
3656
- const k = await t(ce, v.clientX, v.clientY);
3657
- k && (p = new Tn(i), p.drawStart(k), t(B).add(p));
3620
+ const _ = await t(ce, w.clientX, w.clientY);
3621
+ _ && (p = new Mn(i), p.drawStart(_), t(B).add(p));
3658
3622
  }
3659
3623
  else if (D.markType === "plans")
3660
3624
  if (y)
3661
- if (s.lastMovePoint && t(yn, v.clientX, v.clientY, s.lastMovePoint) < 0.03)
3625
+ if (s.lastMovePoint && t(mn, w.clientX, w.clientY, s.lastMovePoint) < 0.03)
3662
3626
  y.drawUpdate(null, !0, s.lastMovePoint, !0), s.lastClickPointTime = Date.now();
3663
3627
  else {
3664
- const k = await t(ce, v.clientX, v.clientY);
3665
- k ? (y.drawUpdate(null, !0, k, !0), s.lastClickPointTime = Date.now()) : s.lastClickPointTime = 0;
3628
+ const _ = await t(ce, w.clientX, w.clientY);
3629
+ _ ? (y.drawUpdate(null, !0, _, !0), s.lastClickPointTime = Date.now()) : s.lastClickPointTime = 0;
3666
3630
  }
3667
3631
  else {
3668
- const k = await t(ce, v.clientX, v.clientY);
3669
- k && (y = new kn(i), y.drawStart(k), t(B).add(y));
3632
+ const _ = await t(ce, w.clientX, w.clientY);
3633
+ _ && (y = new Tn(i), y.drawStart(_), t(B).add(y));
3670
3634
  }
3671
3635
  else if (D.markType === "circle")
3672
3636
  if (g) {
3673
- const k = await t(ce, v.clientX, v.clientY);
3674
- k ? (g.drawFinish(k), g = null) : s.isDbClick && t(qe);
3637
+ const _ = await t(ce, w.clientX, w.clientY);
3638
+ _ ? (g.drawFinish(_), g = null) : s.isDbClick && t(qe);
3675
3639
  } else {
3676
- const k = await t(ce, v.clientX, v.clientY);
3677
- k && (g = new sa(i), g.drawStart(k), t(B).add(g));
3640
+ const _ = await t(ce, w.clientX, w.clientY);
3641
+ _ && (g = new sa(i), g.drawStart(_), t(B).add(g));
3678
3642
  }
3679
- s.lastClickX = v.clientX, s.lastClickY = v.clientY;
3643
+ s.lastClickX = w.clientX, s.lastClickY = w.clientY;
3680
3644
  }
3681
- s.down === 2 && !s.move && t(it, v.clientX, v.clientY), s.down = 0, s.move = !1, r = Date.now();
3645
+ s.down === 2 && !s.move && t(it, w.clientX, w.clientY), s.down = 0, s.move = !1, r = Date.now();
3682
3646
  };
3683
- function S(v) {
3684
- v.preventDefault(), !o && (t(q), s.down = v.touches.length, s.down === 1 && (s.move = !1, s.x = v.touches[0].clientX, s.y = v.touches[0].clientY));
3647
+ function v(w) {
3648
+ w.preventDefault(), !o && (t(q), s.down = w.touches.length, s.down === 1 && (s.move = !1, s.x = w.touches[0].clientX, s.y = w.touches[0].clientY));
3685
3649
  }
3686
- function T(v) {
3687
- v.touches.length === 1 && (s.move = !0);
3650
+ function k(w) {
3651
+ w.touches.length === 1 && (s.move = !0);
3688
3652
  }
3689
- function w(v) {
3653
+ function b(w) {
3690
3654
  s.down === 1 && !s.move && t(it, s.x, s.y);
3691
3655
  }
3692
- 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", m), n.addEventListener("mousemove", x), n.addEventListener("mouseup", b), n.addEventListener("touchstart", S, { passive: !1 }), n.addEventListener("touchmove", T, { passive: !1 }), n.addEventListener("touchend", w, { passive: !1 }), window.addEventListener("resize", I);
3693
- function I() {
3694
- const { width: v, height: D } = t(Ue), k = t(V);
3695
- k.aspect = v / D, k.updateProjectionMatrix(), t(zn).setSize(v, D);
3696
- const R = t(ct);
3697
- R.setPixelRatio(Math.min(devicePixelRatio, 2)), R.setSize(v, D);
3698
- }
3699
- e(Rn, () => {
3700
- 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", m), n.removeEventListener("mousemove", x), n.removeEventListener("mouseup", b), n.removeEventListener("touchstart", S), n.removeEventListener("touchmove", T), n.removeEventListener("touchend", w), window.removeEventListener("resize", I);
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();
3657
+ function x() {
3658
+ const { width: w, height: D, top: _, left: T } = t(Ue), F = t(V);
3659
+ F.aspect = w / D, F.updateProjectionMatrix();
3660
+ const E = t(On);
3661
+ E.setSize(w, D), E.domElement.style.position = "absolute", E.domElement.style.left = `${T}px`, E.domElement.style.top = `${_}px`;
3662
+ const P = t(ct);
3663
+ P.setPixelRatio(Math.min(devicePixelRatio, 2)), P.setSize(w, D);
3664
+ }
3665
+ e(Ln, () => {
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);
3701
3667
  });
3702
3668
  }
3703
3669
  function aa(i) {
3704
3670
  const e = new Aa(), t = 0.02, n = (o, s, r) => i.on(o, s, r), a = (o, ...s) => i.fire(o, ...s);
3705
3671
  n(Ft, async (o, s) => {
3706
- const { width: r, height: c, left: u, top: l } = a(Ue), d = new j();
3707
- d.x = (o - u) / r * 2 - 1, d.y = (l - s) / c * 2 + 1;
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;
3708
3674
  const h = a(V);
3709
- e.setFromCamera(d, h);
3675
+ e.setFromCamera(l, h);
3710
3676
  const f = [], p = a(B), y = [], g = [];
3711
- p.traverse(function(S) {
3712
- S instanceof pe ? g.push(S) : S.isMesh && !S.ignoreIntersect && !S.isMark && y.push(S);
3677
+ p.traverse(function(v) {
3678
+ v instanceof pe ? g.push(v) : v.isMesh && !v.ignoreIntersect && !v.isMark && y.push(v);
3713
3679
  });
3714
3680
  const m = e.intersectObjects(y, !0);
3715
- for (let S = 0; S < m.length; S++)
3716
- f.push(new tt(m[S].point, e.ray.distanceToPoint(m[S].point)));
3717
- const x = h.projectionMatrix.clone().multiply(h.matrixWorldInverse);
3718
- for (let S = 0; S < g.length; S++) {
3719
- const T = g[S].fire(mn);
3720
- if (T)
3721
- if (T.length !== void 0) {
3722
- const w = T, I = w.length / 3;
3723
- for (let v = 0; v < I; v++) {
3724
- const D = new C(w[3 * v + 0], w[3 * v + 1], w[3 * v + 2]), k = new Se(D.x, D.y, D.z, 1).applyMatrix4(x), M = k.x / k.w, R = k.y / k.w;
3725
- Math.sqrt((M - d.x) ** 2 + (R - d.y) ** 2) <= t && f.push(new tt(D, e.ray.distanceToPoint(D)));
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);
3684
+ for (let v = 0; v < g.length; v++) {
3685
+ const k = g[v].fire(gn);
3686
+ if (k)
3687
+ if (k.length !== void 0) {
3688
+ const b = k, x = b.length / 3;
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)));
3726
3692
  }
3727
3693
  } else
3728
- for (let w of Object.keys(T)) {
3729
- const I = w.split(","), v = new C(Number(I[0]), Number(I[1]), Number(I[2]));
3730
- if (e.ray.distanceToPoint(v) <= 1.4143) {
3731
- const D = T[w];
3732
- for (let k = 0, M = D.length / 3; k < M; k++) {
3733
- const R = new C(D[3 * k + 0], D[3 * k + 1], D[3 * k + 2]), E = new Se(R.x, R.y, R.z, 1).applyMatrix4(x), P = E.x / E.w, U = E.y / E.w;
3734
- Math.sqrt((P - d.x) ** 2 + (U - d.y) ** 2) <= t && f.push(new tt(R, e.ray.distanceToPoint(R)));
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]));
3696
+ if (e.ray.distanceToPoint(w) <= 1.4143) {
3697
+ const D = k[b];
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)));
3735
3701
  }
3736
3702
  }
3737
3703
  }
3738
3704
  }
3739
- f.sort((S, T) => S.radius - T.radius);
3740
- const b = [];
3741
- for (let S = 0; S < f.length; S++)
3742
- b.push(f[S].center);
3743
- return b;
3744
- }), n(yn, (o, s, r) => {
3745
- const { width: c, height: u, left: l, top: d } = a(Ue), h = new j();
3746
- h.x = (o - l) / c * 2 - 1, h.y = (d - s) / u * 2 + 1;
3705
+ f.sort((v, k) => v.radius - k.radius);
3706
+ const S = [];
3707
+ for (let v = 0; v < f.length; v++)
3708
+ S.push(f[v].center);
3709
+ return S;
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;
3747
3713
  const f = a(V);
3748
3714
  return e.setFromCamera(h, f), e.ray.distanceToPoint(r);
3749
3715
  });
3750
3716
  }
3751
- function vr(i) {
3717
+ function Sr(i) {
3752
3718
  const e = (r, c, u) => i.on(r, c, u), t = (r, ...c) => i.fire(r, ...c);
3753
- e(ft, () => t(V).fov), e(Be, (r = !1) => r ? t(V).position.clone() : t(V).position), e(Ce, (r = !1) => r ? t(Y).target.clone() : t(Y).target), e(Ne, (r = !1) => r ? t(V).up.clone() : t(V).up), e(hn, (r, c = !1) => {
3719
+ e(ft, () => t(V).fov), e(Be, (r = !1) => r ? t(V).position.clone() : t(V).position), e(Ce, (r = !1) => r ? t(Y).target.clone() : t(Y).target), e(Ne, (r = !1) => r ? t(V).up.clone() : t(V).up), e(un, (r, c = !1) => {
3754
3720
  if (t(Is, r), !c) {
3755
- t(Y).target.copy(r), t(Bt);
3721
+ t(Y).target.copy(r), t(Rt);
3756
3722
  return;
3757
3723
  }
3758
3724
  const u = t(Y).target.clone();
3759
- let l = 0;
3760
- t(at, () => {
3761
- l += 0.03, t(Y).target.copy(u.clone().lerp(r, l)), t(Bt);
3762
- }, () => l < 1);
3725
+ let d = 0;
3726
+ t(
3727
+ at,
3728
+ () => {
3729
+ d += 0.03, t(Y).target.copy(u.clone().lerp(r, d)), t(Rt);
3730
+ },
3731
+ () => d < 1
3732
+ );
3763
3733
  }), e(ls, () => {
3764
3734
  let r = t(Be).toArray(), c = t(Ne).toArray(), u = t(Ce).toArray();
3765
3735
  return { position: r, lookUp: c, lookAt: u };
3766
3736
  }), e(ds, () => t(Y).update()), e(us, () => t(Y).updateRotateAxis());
3767
3737
  const n = 0.01;
3768
- let a = new C(), o = new C(), s = 0;
3738
+ let a = new M(), o = new M(), s = 0;
3769
3739
  e(ws, () => {
3770
- const r = t(Y).object, c = r.fov, u = r.position.clone(), l = r.getWorldDirection(new C());
3771
- 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);
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);
3772
3742
  });
3773
3743
  }
3774
3744
  class br extends te {
@@ -3778,54 +3748,56 @@ class br extends te {
3778
3748
  }
3779
3749
  function xr(i) {
3780
3750
  let e = !1;
3781
- const t = (r, c, u) => i.on(r, c, u), n = (r, ...c) => i.fire(r, ...c), a = [], o = new C(), s = new Ke();
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();
3782
3752
  t(_s, () => {
3783
3753
  const r = new wa(0.5, 32, 32), c = Cr();
3784
3754
  c.depthTest = !1, c.depthWrite = !1, c.transparent = !0;
3785
3755
  const u = new br();
3786
- return u.copy(new te(r, c)), t(Da, () => c), t(wi, (l) => {
3787
- e || (c.uniforms[Cn].value = l, l <= 0.01 ? u.visible = !1 : u.visible = !0, c.uniformsNeedUpdate = !0, n(J));
3788
- }), t(Is, (l) => {
3789
- if (e)
3790
- return;
3791
- const d = n(V);
3792
- s.copy(d.matrixWorld).invert(), o.copy(l).applyMatrix4(s), o.normalize().multiplyScalar(10), o.applyMatrix4(d.matrixWorld);
3756
+ return u.copy(new te(r, c)), t(Da, () => c), t(wi, (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) => {
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);
3793
3762
  const { width: h, height: f } = n(Ue);
3794
- 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[Cn].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(d), c.uniforms[ht].value.set(h, f), c.uniforms[xn].value = 1, c.uniformsNeedUpdate = !0, n(vi), n(J);
3795
3764
  }), t(Pa, () => {
3796
3765
  e || (e = !0, c.dispose(), r.dispose());
3797
3766
  }), u.renderOrder = 99999, u;
3798
- }), t(Si, () => {
3799
- for (; a.length; )
3800
- a.pop().opacity = 0;
3767
+ }), t(vi, () => {
3768
+ for (; a.length; ) a.pop().opacity = 0;
3801
3769
  let r = { opacity: 1 };
3802
- a.push(r), n(Ln, () => {
3803
- !e && r.opacity > 0 && (r.opacity < 0.2 ? r.opacity = 0 : r.opacity > 0.6 ? r.opacity = Math.max(r.opacity -= 0.01, 0) : r.opacity = Math.max(r.opacity -= 0.03, 0), n(wi, r.opacity));
3804
- }, () => !e && r.opacity > 0);
3770
+ a.push(r), n(
3771
+ Pn,
3772
+ () => {
3773
+ !e && r.opacity > 0 && (r.opacity < 0.2 ? r.opacity = 0 : r.opacity > 0.6 ? r.opacity = Math.max(r.opacity -= 0.01, 0) : r.opacity = Math.max(r.opacity -= 0.03, 0), n(wi, r.opacity));
3774
+ },
3775
+ () => !e && r.opacity > 0
3776
+ );
3805
3777
  });
3806
3778
  }
3807
3779
  function Cr() {
3808
3780
  const i = {
3809
- [vo]: { type: "v3", value: new is() },
3810
- [Js]: { type: "v3", value: new C() },
3781
+ [So]: { type: "v3", value: new is() },
3782
+ [Js]: { type: "v3", value: new M() },
3811
3783
  [ht]: { type: "v2", value: new j() },
3812
- [Cn]: { value: 0 }
3784
+ [xn]: { value: 0 }
3813
3785
  };
3814
- return new In({
3786
+ return new _n({
3815
3787
  uniforms: i,
3816
3788
  vertexShader: Ao(),
3817
3789
  fragmentShader: wo(),
3818
3790
  transparent: !0,
3819
3791
  depthTest: !1,
3820
3792
  depthWrite: !1,
3821
- side: Sa
3793
+ side: va
3822
3794
  });
3823
3795
  }
3824
3796
  function oa(i) {
3825
3797
  const e = (s, r, c) => i.on(s, r, c), t = (s, ...r) => i.fire(s, ...r), n = /* @__PURE__ */ new Map(), a = document.createElement("div");
3826
3798
  a.classList.add("mark-warp"), document.body.appendChild(a);
3827
3799
  const o = new Ar();
3828
- o.setSize(innerWidth, innerHeight), o.domElement.style.position = "absolute", o.domElement.style.top = "0px", o.domElement.style.pointerEvents = "none", a.appendChild(o.domElement), e(Fa, () => a), e(zn, () => o), e(Qn, () => document.body.removeChild(a)), e(Oe, () => o.render(t(B), t(V)), !0), e(Me, (s) => {
3800
+ o.setSize(innerWidth, innerHeight), o.domElement.style.position = "absolute", o.domElement.style.top = "0px", o.domElement.style.pointerEvents = "none", a.appendChild(o.domElement), e(Ra, () => a), e(On, () => o), e(zn, () => document.body.removeChild(a)), e(Oe, () => o.render(t(B), t(V)), !0), e(Me, (s) => {
3829
3801
  const r = s?.getMarkData?.()?.name || s?.name;
3830
3802
  r && n.set(r, new WeakRef(s));
3831
3803
  }), e(Ze, (s) => {
@@ -3838,8 +3810,8 @@ function oa(i) {
3838
3810
  const r = t(st, s);
3839
3811
  return r ? r.getMarkData?.() : {};
3840
3812
  }), e(dt, (s) => {
3841
- s !== void 0 && (t(_).markVisible = s), t(B).traverse((r) => r.isMark && (r.visible = t(_).markVisible)), t(J);
3842
- }), e(An, async () => {
3813
+ s !== void 0 && (t(I).markVisible = s), t(B).traverse((r) => r.isMark && (r.visible = t(I).markVisible)), t(J);
3814
+ }), e(yn, async () => {
3843
3815
  const s = [];
3844
3816
  t(B).traverse((c) => {
3845
3817
  if (c.isMark) {
@@ -3849,7 +3821,7 @@ function oa(i) {
3849
3821
  });
3850
3822
  const r = t(ye).meta || {};
3851
3823
  return s.length ? r.marks = s : delete r.marks, r.cameraInfo = t(ls), await t(Pe, r);
3852
- }), e(Et, async () => {
3824
+ }), e(kt, async () => {
3853
3825
  const s = [];
3854
3826
  t(B).traverse((c) => {
3855
3827
  if (c.isMark) {
@@ -3864,34 +3836,34 @@ function oa(i) {
3864
3836
  delete s.marks;
3865
3837
  const r = await t(Pe, s), c = [];
3866
3838
  return n.forEach((u) => c.push(u)), c.forEach((u) => u.deref()?.dispose?.()), t(J), r;
3867
- }), e(Rs, async () => {
3839
+ }), e(Fs, async () => {
3868
3840
  t(B).traverse((r) => {
3869
3841
  r.isMark && r.getMarkData?.();
3870
3842
  });
3871
3843
  const s = t(ye).meta || {};
3872
3844
  return s.watermark = t(Ds) || "", await t(Pe, s);
3873
- }), e(wn, (s) => {
3874
- s.meterScale && (t(_).meterScale = s.meterScale, t(oe, { scale: `1 : ${t(_).meterScale} m` })), t(Y).updateByOptions({ ...s, ...s.cameraInfo || {} }), (s.marks || []).forEach((c) => {
3845
+ }), e(An, (s) => {
3846
+ s.meterScale && (t(I).meterScale = s.meterScale, t(oe, { scale: `1 : ${t(I).meterScale} m` })), t(Y).updateByOptions({ ...s, ...s.cameraInfo || {} }), (s.marks || []).forEach((c) => {
3875
3847
  if (c.type === "MarkSinglePoint") {
3876
3848
  const u = new ia(i, c);
3877
3849
  u.visible = !1, t(B).add(u);
3878
3850
  } else if (c.type === "MarkDistanceLine") {
3879
- const u = new Mn(i);
3851
+ const u = new Cn(i);
3880
3852
  u.draw(c), u.visible = !1, t(B).add(u);
3881
3853
  } else if (c.type === "MarkMultiLines") {
3882
- const u = new Tn(i);
3854
+ const u = new Mn(i);
3883
3855
  u.draw(c, !0), u.visible = !1, t(B).add(u);
3884
3856
  } else if (c.type === "MarkMultiPlans") {
3885
- const u = new kn(i);
3857
+ const u = new Tn(i);
3886
3858
  u.draw(c, !0), u.visible = !1, t(B).add(u);
3887
3859
  } else if (c.type === "MarkCirclePlan") {
3888
3860
  const u = new sa(i);
3889
3861
  u.draw(c), u.visible = !1, t(B).add(u);
3890
3862
  }
3891
- }), t(Vn, s.flyPositions || []), t(Gn, s.flyTargets || []);
3863
+ }), t(Yn, s.flyPositions || []), t(Vn, s.flyTargets || []);
3892
3864
  }), e(Te, () => {
3893
- const s = t(_);
3894
- s.markMode = !1, t(Un), t(J);
3865
+ const s = t(I);
3866
+ s.markMode = !1, t(Bn), t(J);
3895
3867
  }), e(Ps, (s, r = !0) => {
3896
3868
  const c = s?.meterScale;
3897
3869
  if (c) {
@@ -3899,42 +3871,41 @@ function oa(i) {
3899
3871
  console.warn("meterScale is not a number or <= 0", s);
3900
3872
  return;
3901
3873
  }
3902
- r && (t(_).meterScale = s.meterScale), t(oe, { scale: `1 : ${c} m` });
3874
+ r && (t(I).meterScale = s.meterScale), t(oe, { scale: `1 : ${c} m` });
3903
3875
  for (const u of n.values()) {
3904
- const l = u.deref();
3905
- l && (l instanceof Mn || l instanceof Tn || l instanceof kn) && l.updateByMeterScale(c);
3876
+ const d = u.deref();
3877
+ d && (d instanceof Cn || d instanceof Mn || d instanceof Tn) && d.updateByMeterScale(c);
3906
3878
  }
3907
3879
  }
3908
- }), e(dn, (s) => {
3909
- 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;
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;
3910
3882
  for (let p = 0; p < f; p++)
3911
- h.add(new C(s[p * 3], s[p * 3 + 1], s[p * 3 + 2]));
3883
+ h.add(new M(s[p * 3], s[p * 3 + 1], s[p * 3 + 2]));
3912
3884
  return h.divideScalar(f), h;
3913
- }), e(un, (s) => {
3885
+ }), e(dn, (s) => {
3914
3886
  const r = [];
3915
- for (let d = 0, h = s.length / 3; d < h; d++)
3916
- r.push(new C(s[d * 3], s[d * 3 + 1], s[d * 3 + 2]));
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]));
3917
3889
  const c = r[0].distanceTo(r[r.length - 1]) < 1e-4, u = r[r.length - 2].distanceTo(r[r.length - 1]) < 1e-4;
3918
- if ((c || u) && r.pop(), r.length < 3)
3919
- return 0;
3920
- let l = 0;
3921
- for (let d = 0, h = r.length - 2; d < h; d++)
3922
- l += t(Nt, r[0], r[d + 1], r[d + 2], t(_).meterScale);
3923
- return l;
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;
3924
3895
  }), e(rs, (s, r) => {
3925
3896
  let c = 0;
3926
- for (let u = 0, l = s.length - 2; u < l; u++)
3927
- c += t(Nt, s[0], s[u + 1], s[u + 2], r);
3897
+ for (let u = 0, d = s.length - 2; u < d; u++)
3898
+ c += t(Gt, s[0], s[u + 1], s[u + 2], r);
3928
3899
  return c;
3929
- }), e(Nt, (s, r, c, u) => {
3930
- const l = s.distanceTo(r) * u, d = r.distanceTo(c) * u, h = c.distanceTo(s) * u, f = (l + d + h) / 2;
3931
- return Math.sqrt(f * (f - l) * (f - d) * (f - h));
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));
3932
3903
  });
3933
3904
  }
3934
3905
  function Mr(i) {
3935
3906
  const e = (h, ...f) => i.fire(h, ...f), t = (h, f, p) => i.on(h, f, p), n = [], a = [];
3936
3907
  let o = !1, s = !1;
3937
- t(Qt, () => o = !1), t(xi, () => o = !0), t(bi, () => n), t(Oa, () => {
3908
+ t(zt, () => o = !1), t(xi, () => o = !0), t(bi, () => n), t(Oa, () => {
3938
3909
  const h = [];
3939
3910
  for (let f = 0, p = n.length; f < p; f++)
3940
3911
  h.push(...n[f].toArray());
@@ -3944,16 +3915,16 @@ function Mr(i) {
3944
3915
  for (let f = 0, p = a.length; f < p; f++)
3945
3916
  h.push(...a[f].toArray());
3946
3917
  return h;
3947
- }), t(Vn, (h) => {
3918
+ }), t(Yn, (h) => {
3948
3919
  for (let f = 0, p = h.length / 3 | 0; f < p; f++)
3949
- n[f] = new C(h[f * 3 + 0], h[f * 3 + 1], h[f * 3 + 2]);
3950
- }), t(Gn, (h) => {
3920
+ n[f] = new M(h[f * 3 + 0], h[f * 3 + 1], h[f * 3 + 2]);
3921
+ }), t(Vn, (h) => {
3951
3922
  for (let f = 0, p = h.length / 3 | 0; f < p; f++)
3952
- a[f] = new C(h[f * 3 + 0], h[f * 3 + 1], h[f * 3 + 2]);
3953
- }), t(Wn, () => {
3923
+ a[f] = new M(h[f * 3 + 0], h[f * 3 + 1], h[f * 3 + 2]);
3924
+ }), t(Hn, () => {
3954
3925
  const h = e(Y);
3955
3926
  n.push(h.object.position.clone()), a.push(h.target.clone());
3956
- }), t(Yn, () => {
3927
+ }), t(Wn, () => {
3957
3928
  n.length = 0, a.length = 0;
3958
3929
  }), t(Bs, async () => {
3959
3930
  const h = e(ye).meta || {};
@@ -3966,30 +3937,32 @@ function Mr(i) {
3966
3937
  delete h.flyPositions, delete h.flyTargets;
3967
3938
  return await e(Pe, h);
3968
3939
  }), t(Us, () => {
3969
- s || (s = !0) && e(zt);
3940
+ s || (s = !0) && e(Ot);
3970
3941
  });
3971
3942
  let r = 0;
3972
3943
  const c = 120 * 1e3;
3973
- let u = 0, l, d;
3974
- t(zt, (h) => {
3975
- if (r = 0, u = Date.now(), l = null, d = null, !n.length || !h && !e(Y).autoRotate)
3976
- return;
3944
+ let u = 0, d, l;
3945
+ t(Ot, (h) => {
3946
+ if (r = 0, u = Date.now(), d = null, l = null, !n.length || !h && !e(Y).autoRotate) return;
3977
3947
  const f = e(Y), p = [f.object.position.clone()], y = [f.target.clone()], g = e(bi) || [];
3978
- for (let m = 0, x = Math.min(g.length, 100); m < x; m++)
3948
+ for (let m = 0, C = Math.min(g.length, 100); m < C; m++)
3979
3949
  g[m] && p.push(g[m]), a[m] && y.push(a[m]);
3980
- l = new si(p), l.closed = !0, d = new si(y), d.closed = !0, e(xi), e(q, !1);
3981
- }), t(lt, () => {
3982
- if (Date.now() - u > c && e(Qt), !o || !l || !d)
3983
- return;
3984
- const h = e(Y);
3985
- r = (Date.now() - u) / c;
3986
- const f = l.getPoint(r), p = d.getPoint(r);
3987
- h.object.position.set(f.x, f.y, f.z), h.target.set(p.x, p.y, p.z);
3988
- }, !0);
3950
+ d = new ii(p), d.closed = !0, l = new ii(y), l.closed = !0, e(xi), e(q, !1);
3951
+ }), t(
3952
+ lt,
3953
+ () => {
3954
+ if (Date.now() - u > c && e(zt), !o || !d || !l) return;
3955
+ const h = e(Y);
3956
+ r = (Date.now() - u) / c;
3957
+ const f = d.getPoint(r), p = l.getPoint(r);
3958
+ h.object.position.set(f.x, f.y, f.z), h.target.set(p.x, p.y, p.z);
3959
+ },
3960
+ !0
3961
+ );
3989
3962
  }
3990
3963
  class Br {
3991
3964
  constructor(e = {}) {
3992
- this.disposed = !1, this.updateTime = 0, this.needUpdate = !0, console.info("Reall3dViewer", Vt), this.init(Yi(e)), !e.disableDropLocalFile && this.enableDropLocalFile();
3965
+ this.disposed = !1, this.updateTime = 0, this.needUpdate = !0, console.info("Reall3dViewer", Yt), this.init(Yi(e)), !e.disableDropLocalFile && this.enableDropLocalFile();
3993
3966
  }
3994
3967
  init(e) {
3995
3968
  const t = this;
@@ -3998,40 +3971,40 @@ class Br {
3998
3971
  No(e);
3999
3972
  const o = e.controls = new dr(e);
4000
3973
  o.updateByOptions(e);
4001
- const s = new Xn();
3974
+ const s = new Nn();
4002
3975
  e.viewerEvents = s, t.events = s;
4003
- const r = (d, h, f) => s.on(d, h, f), c = (d, ...h) => s.fire(d, ...h);
4004
- r(_, () => e), r($e, () => n.domElement), r(ct, () => n), r(B, () => a), r(Y, () => o), r(V, () => o.object), r(ee, () => e.bigSceneMode), r(Ra, (d) => e.pointcloudMode = d);
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);
4005
3978
  const u = [];
4006
3979
  r(J, () => {
4007
3980
  for (t.needUpdate = !0; u.length; ) u.pop().stop = !0;
4008
- let d = { count: 0, stop: !1 };
4009
- u.push(d), c(
4010
- Ln,
3981
+ let l = { count: 0, stop: !1 };
3982
+ u.push(l), c(
3983
+ Pn,
4011
3984
  () => {
4012
- !t.disposed && (t.needUpdate = !0), d.count++ >= 600 && (d.stop = !0);
3985
+ !t.disposed && (t.needUpdate = !0), l.count++ >= 600 && (l.stop = !0);
4013
3986
  },
4014
- () => !t.disposed && (c(On) || !d.stop),
3987
+ () => !t.disposed && (c(Un) || !l.stop),
4015
3988
  10
4016
3989
  );
4017
- }), qn(s), Yo(s), Jn(s), vr(s), oa(s), Sr(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(vi, () => {
3990
+ }), jn(s), Yo(s), qn(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(Si, () => {
4018
3991
  o.update(), !t.needUpdate && c(ws) && c(J);
4019
- }), r(Ve, () => c(Yt), !0), r(Ve, () => c(vi), !0), r(
3992
+ }), r(Ve, () => c(Wt), !0), r(Ve, () => c(Si), !0), r(
4020
3993
  Oe,
4021
3994
  () => {
4022
3995
  try {
4023
3996
  !(t.needUpdate = !1) && n.render(a, c(V));
4024
- } catch (d) {
4025
- console.warn(d.message);
3997
+ } catch (l) {
3998
+ console.warn(l.message);
4026
3999
  }
4027
4000
  },
4028
4001
  !0
4029
4002
  ), r(lt, () => {
4030
- }, !0), r(Wt, () => t.dispose()), r(Os, () => console.info(JSON.stringify(c(ye).meta || {}, null, 2)));
4031
- let l = "";
4032
- r(yt, (d = "") => {
4033
- l = d, t.splatMesh.fire(Hn, l, !0);
4034
- }), r(Ds, () => l), c(oe, { scale: `1 : ${c(_).meterScale} m` }), t.initGsApi();
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(Qn, d, !0);
4007
+ }), r(Ds, () => d), c(oe, { scale: `1 : ${c(I).meterScale} m` }), t.initGsApi();
4035
4008
  }
4036
4009
  /**
4037
4010
  * 允许拖拽本地文件进行渲染
@@ -4055,7 +4028,7 @@ class Br {
4055
4028
  a = "spz";
4056
4029
  else
4057
4030
  return console.error("unsupported format:", n.name);
4058
- const o = URL.createObjectURL(n), s = e.events.fire(_);
4031
+ const o = URL.createObjectURL(n), s = e.events.fire(I);
4059
4032
  s.bigSceneMode = !1, s.pointcloudMode = !0, s.autoRotate = !0, s.debugMode = !0, e.reset(s), setTimeout(async () => {
4060
4033
  await e.addModel({ url: o, format: a }), URL.revokeObjectURL(o);
4061
4034
  });
@@ -4073,8 +4046,8 @@ class Br {
4073
4046
  // 开发调试用临时接口
4074
4047
  fire(e, t, n) {
4075
4048
  const a = this;
4076
- e === 1 && a.splatMesh.fire(pn, t), e === 2 && a.events.fire(Wn), e === 3 && a.events.fire(zt, !0), e === 4 && a.events.fire(Yn), e === 5 && a.events.fire(Bs), e === 6 && a.events.fire(Et), e === 7 && a.events.fire(Ls), e === 8 && (async () => {
4077
- let o = await a.splatMesh.fire(Nn);
4049
+ e === 1 && a.splatMesh.fire(hn, t), e === 2 && a.events.fire(Hn), e === 3 && a.events.fire(Ot, !0), e === 4 && a.events.fire(Wn), e === 5 && a.events.fire(Bs), e === 6 && a.events.fire(kt), e === 7 && a.events.fire(Ls), e === 8 && (async () => {
4050
+ let o = await a.splatMesh.fire(Gn);
4078
4051
  t && (o = a.splatMesh.fire(Ws) + t), a.splatMesh.fire(Fn, o);
4079
4052
  })();
4080
4053
  }
@@ -4088,7 +4061,7 @@ class Br {
4088
4061
  if (t.disposed) return {};
4089
4062
  const n = (r, ...c) => t.events.fire(r, ...c);
4090
4063
  let a;
4091
- return n(B).traverse((r) => !a && r instanceof pe && (a = r.options())), e && (e.autoRotate !== void 0 && (n(Y).autoRotate = e.autoRotate, n(_).autoRotate = e.autoRotate), e.pointcloudMode !== void 0 && n(Ut, e.pointcloudMode), e.lightFactor !== void 0 && n(rt, e.lightFactor), e.maxRenderCountOfMobile && (n(_).maxRenderCountOfMobile = e.maxRenderCountOfMobile), e.maxRenderCountOfPc && (n(_).maxRenderCountOfPc = e.maxRenderCountOfPc), e.debugMode !== void 0 && (n(_).debugMode = e.debugMode), e.markType !== void 0 && (n(_).markType = e.markType), e.markVisible !== void 0 && n(dt, e.markVisible), e.meterScale !== void 0 && (n(_).meterScale = e.meterScale), e.markMode !== void 0 && (n(_).markMode = e.markMode, !e.markMode && n(Un), n(Y).autoRotate = n(_).autoRotate = !1)), n(Y).updateByOptions(e), n(oe, { scale: `1 : ${n(_).meterScale} m` }), Object.assign({ ...n(_) }, a);
4064
+ return n(B).traverse((r) => !a && r instanceof pe && (a = r.options())), e && (e.autoRotate !== void 0 && (n(Y).autoRotate = e.autoRotate, n(I).autoRotate = e.autoRotate), e.pointcloudMode !== void 0 && n(Bt, e.pointcloudMode), e.lightFactor !== void 0 && n(rt, e.lightFactor), e.maxRenderCountOfMobile && (n(I).maxRenderCountOfMobile = e.maxRenderCountOfMobile), e.maxRenderCountOfPc && (n(I).maxRenderCountOfPc = e.maxRenderCountOfPc), e.debugMode !== void 0 && (n(I).debugMode = e.debugMode), e.markType !== void 0 && (n(I).markType = e.markType), e.markVisible !== void 0 && n(dt, e.markVisible), e.meterScale !== void 0 && (n(I).meterScale = e.meterScale), e.markMode !== void 0 && (n(I).markMode = e.markMode, !e.markMode && n(Bn), n(Y).autoRotate = n(I).autoRotate = !1)), n(Y).updateByOptions(e), n(oe, { scale: `1 : ${n(I).meterScale} m` }), Object.assign({ ...n(I) }, a);
4092
4065
  }
4093
4066
  /**
4094
4067
  * 重置
@@ -4103,7 +4076,7 @@ class Br {
4103
4076
  */
4104
4077
  switchDeiplayMode() {
4105
4078
  const e = this;
4106
- e.disposed || e.events.fire(Ot);
4079
+ e.disposed || e.events.fire(Ut);
4107
4080
  }
4108
4081
  /**
4109
4082
  * 添加场景
@@ -4127,7 +4100,7 @@ class Br {
4127
4100
  if (!a.url.endsWith(".bin") && !a.url.endsWith(".spx"))
4128
4101
  return console.error("The format is unsupported in the large scene mode", a.url);
4129
4102
  const o = { ...a, ...a.cameraInfo || {} };
4130
- a.autoCut = Math.min(Math.max(a.autoCut || 0, 0), 50), o.bigSceneMode = a.autoCut > 1, t.reset({ ...o }), !o.bigSceneMode && delete a.autoCut, t.splatMesh.meta = a, le && (a.cameraInfo?.position || a.cameraInfo?.lookAt) && t.events.fire(Y)._dollyOut(0.75), o.bigSceneMode ? (n(Vn, a.flyPositions || []), n(Gn, a.flyTargets || [])) : n(wn, a), await t.splatMesh.addModel({ url: a.url }, a), await n(yt, a.watermark), n(Y).updateRotateAxis();
4103
+ a.autoCut = Math.min(Math.max(a.autoCut || 0, 0), 50), o.bigSceneMode = a.autoCut > 1, t.reset({ ...o }), !o.bigSceneMode && delete a.autoCut, t.splatMesh.meta = a, le && (a.cameraInfo?.position || a.cameraInfo?.lookAt) && t.events.fire(Y)._dollyOut(0.75), o.bigSceneMode ? (n(Yn, a.flyPositions || []), n(Vn, a.flyTargets || [])) : n(An, a), await t.splatMesh.addModel({ url: a.url }, a), await n(mt, a.watermark), n(Y).updateRotateAxis();
4131
4104
  }
4132
4105
  /**
4133
4106
  * 添加要渲染的高斯模型(小场景模式)
@@ -4139,7 +4112,7 @@ class Br {
4139
4112
  const n = (c, ...u) => t.events.fire(c, ...u);
4140
4113
  let a = "", o = { url: "" };
4141
4114
  if (Object.prototype.toString.call(e) === "[object String]" ? e.endsWith(".meta.json") ? a = e : o.url = e : o = e, !o.url && !a) return console.error("model url is empty");
4142
- const s = n(_);
4115
+ const s = n(I);
4143
4116
  s.bigSceneMode = !1;
4144
4117
  let r = {};
4145
4118
  if (!o.url.startsWith("blob:"))
@@ -4163,39 +4136,39 @@ class Br {
4163
4136
  console.error("unknow format!", o.url);
4164
4137
  return;
4165
4138
  }
4166
- n(wn, r), await t.splatMesh.addModel(o, r), await n(yt, r.watermark);
4139
+ n(An, r), await t.splatMesh.addModel(o, r), await n(mt, r.watermark);
4167
4140
  }
4168
4141
  /**
4169
4142
  * 根据需要暴露的接口
4170
4143
  */
4171
4144
  initGsApi() {
4172
- const e = (l, ...d) => this.events.fire(l, ...d), t = () => {
4173
- setTimeout(() => window.focus()), e(Qt), e(Y).autoRotate = e(_).autoRotate = !e(_).autoRotate;
4174
- }, n = (l = !0) => {
4175
- setTimeout(() => window.focus()), l = !!l;
4176
- const d = e(_);
4177
- d.pointcloudMode !== l && (d.bigSceneMode ? e(Ut, l) : e(Ot));
4178
- }, a = (l = !0) => {
4179
- setTimeout(() => window.focus()), e(dt, !!l);
4180
- }, o = (l) => {
4145
+ const e = (d, ...l) => this.events.fire(d, ...l), t = () => {
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) => {
4181
4154
  setTimeout(() => window.focus());
4182
- const d = e(_);
4183
- if (d.markMode) return !1;
4184
- if (l === 1)
4185
- d.markType = "point";
4186
- else if (l === 2)
4187
- d.markType = "lines";
4188
- else if (l === 3)
4189
- d.markType = "plans";
4190
- else if (l === 4)
4191
- d.markType = "distance";
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";
4192
4165
  else
4193
4166
  return !1;
4194
- return d.markMode = !0, e(q), !0;
4195
- }, s = async (l) => (setTimeout(() => window.focus()), l ? (e(st, l)?.dispose(), e(J), await e(Et)) : !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(Et)) : !0), c = (l = !0) => {
4196
- setTimeout(() => window.focus()), e(pn, !!l);
4197
- }, u = (l, d = !0) => {
4198
- e(yt, l), d && e(Rs, l);
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);
4199
4172
  };
4200
4173
  window.$api = { switchAutoRotate: t, changePointCloudMode: n, showMark: a, startMark: o, deleteMark: s, updateMark: r, showWaterMark: c, setWaterMark: u };
4201
4174
  }
@@ -4206,29 +4179,27 @@ class Br {
4206
4179
  const e = this;
4207
4180
  if (e.disposed) return;
4208
4181
  e.disposed = !0;
4209
- const t = (a, ...o) => e.events.fire(a, ...o);
4210
- t(Bn), t(As), t(Qn), t(Rn), t(Y).dispose(), t(ke, t(B));
4211
- const n = t(ct);
4212
- n.clear(), n.dispose(), e.splatMesh = null, e.events.clear(), e.events = null;
4182
+ const t = (o, ...s) => e.events.fire(o, ...s), n = t(ct), a = n.domElement;
4183
+ t(Rn), t(As), t(zn), t(Ln), t(Y).dispose(), t(ke, t(B)), n.clear(), n.dispose(), a.parentElement.removeChild(a), e.splatMesh = null, e.events.clear(), e.events = null;
4213
4184
  }
4214
4185
  }
4215
4186
  function Tr(i) {
4216
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();
4217
- e(Dt, () => t(re) && a.set(Date.now(), 1)), e(Pt, () => t(re) && t(Ye, a)), e(Lt, () => t(re) && o.set(Date.now(), 1)), e(Rt, () => t(re) && t(Ye, o)), e(Ye, (s) => {
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) => {
4218
4189
  let r = [], c = Date.now(), u = 0;
4219
- for (const l of s.keys())
4220
- c - l <= 1e3 ? u++ : r.push(l);
4221
- return r.forEach((l) => s.delete(l)), Math.min(u, 30);
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);
4222
4193
  }), e(X, () => {
4223
4194
  const s = t(B), r = t(V), c = [];
4224
4195
  return s?.traverse(function(u) {
4225
4196
  u.isWarpSplatMesh && u.splatMesh?.visible && c.push(u);
4226
- }), c.sort((u, l) => r.position.distanceTo(u.position) - r.position.distanceTo(l.position)), window.splat = c[0]?.splatMesh, c[0]?.splatMesh;
4227
- }), e($s, () => {
4197
+ }), c.sort((u, d) => r.position.distanceTo(u.position) - r.position.distanceTo(d.position)), window.splat = c[0]?.splatMesh, c[0]?.splatMesh;
4198
+ }), e(Ks, () => {
4228
4199
  const s = t(B), r = t(V), c = [];
4229
4200
  s?.traverse(function(u) {
4230
4201
  u.isWarpSplatMesh && c.push(u);
4231
- }), c.sort((u, l) => r.position.distanceTo(u.position) - r.position.distanceTo(l.position));
4202
+ }), c.sort((u, d) => r.position.distanceTo(u.position) - r.position.distanceTo(d.position));
4232
4203
  for (let u = 0; u < c.length; u++)
4233
4204
  c[u].active = u < n, c[u].splatMesh && (c[u].splatMesh.renderOrder = 1e3 - u);
4234
4205
  }), e(Zs, () => {
@@ -4236,19 +4207,19 @@ function Tr(i) {
4236
4207
  s?.traverse((c) => r.push(c)), r.forEach((c) => {
4237
4208
  c.dispose ? c.dispose() : (c.geometry?.dispose?.(), c.material && c.material instanceof Array ? c.material.forEach((u) => u?.dispose?.()) : c.material?.dispose?.());
4238
4209
  }), s?.clear();
4239
- }), e(Sn, (s = 0.1) => {
4210
+ }), e(wn, (s = 0.1) => {
4240
4211
  const r = t(X);
4241
- r && r.visible && r.rotateOnAxis(new C(1, 0, 0), be.degToRad(s));
4212
+ r && r.visible && r.rotateOnAxis(new M(1, 0, 0), be.degToRad(s));
4242
4213
  }), e(vn, (s = 0.1) => {
4243
4214
  const r = t(X);
4244
- r && r.visible && r.rotateOnAxis(new C(0, 1, 0), be.degToRad(s));
4245
- }), e(bn, (s = 0.1) => {
4215
+ r && r.visible && r.rotateOnAxis(new M(0, 1, 0), be.degToRad(s));
4216
+ }), e(Sn, (s = 0.1) => {
4246
4217
  const r = t(X);
4247
- r && r.visible && r.rotateOnAxis(new C(0, 0, 1), be.degToRad(s));
4218
+ r && r.visible && r.rotateOnAxis(new M(0, 0, 1), be.degToRad(s));
4248
4219
  }), e(Ha, (s = 0.01) => {
4249
4220
  const r = t(X);
4250
4221
  r && r.visible && (r.position.x += s);
4251
- }), e(Ks, (s = 0.01) => {
4222
+ }), e($s, (s = 0.01) => {
4252
4223
  const r = t(X);
4253
4224
  r && r.visible && (r.position.y += s);
4254
4225
  }), e(Wa, (s = 0.01) => {
@@ -4264,34 +4235,39 @@ function Tr(i) {
4264
4235
  const s = t(X);
4265
4236
  s && (s.visible = !s.visible);
4266
4237
  }), e(Na, async (s) => {
4267
- if (!s && (s = t(X)), !s)
4268
- return;
4238
+ if (!s && (s = t(X)), !s) return;
4269
4239
  const r = s.meta || {};
4270
4240
  return r.transform = s.matrix.toArray(), await t(Pe, JSON.stringify(r), s.meta.url);
4271
4241
  }), e(Vs, () => {
4272
- const s = t(_).root, r = new es({ antialias: !1, logarithmicDepthBuffer: !0, stencil: !0, alpha: !0, precision: "highp" });
4273
- return r.setSize(s.clientWidth, s.clientHeight), r.setPixelRatio(Math.min(devicePixelRatio, 2)), e(ct, () => r), e($e, () => r.domElement), r;
4242
+ const s = t(I).root, r = new es({ antialias: !1, logarithmicDepthBuffer: !0, stencil: !0, alpha: !0, precision: "highp" });
4243
+ return r.setSize(s.clientWidth, s.clientHeight), r.setPixelRatio(Math.min(devicePixelRatio, 2)), e(ct, () => r), e(Ke, () => r.domElement), r;
4274
4244
  }), e(Gs, () => {
4275
4245
  const s = new ss(), r = 14414079;
4276
- return s.background = new is(r), s.fog = new ai(r, 0), e(B, () => s), s;
4246
+ return s.background = new is(r), s.fog = new si(r, 0), e(B, () => s), s;
4277
4247
  }), e(Ns, () => {
4278
- const r = t(V), c = t(B), u = t(_), l = new ur(t(V), u.root);
4279
- return l.screenSpacePanning = !1, l.minDistance = 0.1, l.maxDistance = 1e5, l.maxPolarAngle = 1.2, l.enableDamping = !0, l.dampingFactor = 0.07, l.zoomToCursor = !0, l.minAzimuthAngle = 0, l.maxAzimuthAngle = 0, l.addEventListener("change", () => {
4280
- const d = Math.max(l.getPolarAngle(), 0.1), h = Math.max(l.getDistance(), 0.1);
4281
- l.zoomSpeed = Math.max(Math.log(h), 0) + 0.5, r.far = be.clamp(h / d * 8, 100, 2e5), r.near = r.far / 1e3, r.updateProjectionMatrix(), c.fog instanceof ai && (c.fog.density = d / (h + 5) * 1 * 0.25), l.maxPolarAngle = Math.min(Math.pow(1e4 / h, 4), 1.2);
4282
- }), e(Y, () => l), e(ft, () => r.fov), e(Be, (d = !1) => d ? r.position.clone() : r.position), e(Ce, (d = !1) => d ? l.target.clone() : l.target), e(Ne, (d = !1) => d ? r.up.clone() : r.up), l;
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 si && (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;
4283
4253
  }), e(Xs, () => {
4284
- const s = new va(16777215, 1);
4254
+ const s = new Sa(16777215, 1);
4285
4255
  return s.position.set(0, 2e3, 1e3), s;
4286
- }), window.addEventListener("beforeunload", () => t(Wt));
4256
+ }), window.addEventListener("beforeunload", () => t(Ht));
4287
4257
  }
4288
4258
  function kr(i) {
4289
4259
  let { root: e = "#map", debugMode: t } = i;
4290
- return e ? e = typeof e == "string" ? document.querySelector(e) || document.querySelector("#map") : e : e = document.querySelector("#map"), e || (e = document.createElement("div"), e.id = "map", document.querySelector("#gsviewer").appendChild(e)), { root: e, debugMode: t };
4260
+ e ? e = typeof e == "string" ? document.querySelector(e) || document.querySelector("#map") : e : e = document.querySelector("#map"), e || (e = document.createElement("div"), e.id = "map", (document.querySelector("#gsviewer") || document.querySelector("body")).appendChild(e));
4261
+ const n = { ...i };
4262
+ return n.root = e, n;
4291
4263
  }
4292
4264
  function Er() {
4293
- const i = "7f8f4f56f3ccda758f9a497e2b981018", e = new gt.plugin.TDTSource({ token: i, style: "img_w" }), t = new gt.plugin.TDTSource({ token: i, style: "cia_w" }), n = location.host.includes("reall3d.com") ? [e, t] : new gt.plugin.BingSource(), a = new gt.TileMap({ imgSource: n, lon0: 90, minLevel: 2, maxLevel: 16 });
4294
- return a.scale.set(10, 10, 10), a.rotateX(-Math.PI / 2), a.autoUpdate = !1, a;
4265
+ const i = ai.TileSource.create({
4266
+ dataType: "image",
4267
+ attribution: "ArcGIS",
4268
+ url: "https://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"
4269
+ }), e = new ai.TileMap({ imgSource: i, lon0: 90, minLevel: 2, maxLevel: 16 });
4270
+ return e.scale.set(10, 10, 10), e.rotateX(-Math.PI / 2), e.autoUpdate = !1, e;
4295
4271
  }
4296
4272
  class _r {
4297
4273
  constructor() {
@@ -4299,85 +4275,84 @@ class _r {
4299
4275
  }
4300
4276
  }
4301
4277
  function Ir(i) {
4302
- const e = (w, I, v) => i.on(w, I, v), t = (w, ...I) => i.fire(w, ...I), n = t($e);
4278
+ const e = (b, x, w) => i.on(b, x, w), t = (b, ...x) => i.fire(b, ...x), n = t(Ke);
4303
4279
  let a = /* @__PURE__ */ new Set(), o, s = new _r();
4304
- e(Yt, () => {
4305
- if (a.size)
4306
- if (a.has("KeyH")) {
4307
- const w = t(X);
4308
- w && (w.visible = !w.visible), a.clear();
4309
- } else if (a.has("Equal")) {
4310
- const w = t(X);
4311
- if (!w || !w.visible)
4312
- return a.clear();
4313
- if (a.has("KeyX")) {
4314
- const I = be.degToRad(0.1);
4315
- w.rotateOnAxis(new C(1, 0, 0), I);
4316
- } else
4317
- w.scale.set(w.scale.x + 0.01, w.scale.y + 0.01, w.scale.z + 0.01);
4318
- } else if (a.has("Minus")) {
4319
- const w = t(X);
4320
- if (!w || !w.visible)
4321
- return a.clear();
4322
- if (a.has("KeyX")) {
4323
- const I = be.degToRad(-0.1);
4324
- w.rotateOnAxis(new C(1, 0, 0), I);
4325
- } else
4326
- w.scale.set(w.scale.x - 0.01, w.scale.y - 0.01, w.scale.z - 0.01);
4327
- } else if (a.has("ArrowUp")) {
4328
- const w = t(X);
4329
- w && w.visible && (w.position.z += 0.1);
4330
- } else if (a.has("ArrowDown")) {
4331
- const w = t(X);
4332
- w && w.visible && (w.position.z -= 0.1);
4333
- } else if (a.has("ArrowRight")) {
4334
- const w = t(X);
4335
- w && w.visible && (w.position.x += 0.1);
4336
- } else if (a.has("ArrowLeft")) {
4337
- const w = t(X);
4338
- w && w.visible && (w.position.x -= 0.1);
4339
- } else if (a.has("KeyU")) {
4340
- const w = t(X);
4341
- if (w) {
4342
- const I = w.meta || {};
4343
- I.transform = w.matrix.toArray();
4344
- }
4345
- } else a.has("KeyQ") ? t(Sn, 0.1) : a.has("KeyW") ? t(vn, 0.1) : a.has("KeyE") ? t(bn, 0.1) : a.has("KeyA") ? t(Sn, -0.1) : a.has("KeyS") ? t(vn, -0.1) : a.has("KeyD") ? t(bn, -0.1) : a.has("KeyY") ? t(Ks, a.has("ShiftLeft") || a.has("ShiftRight") ? -0.1 : 0.1) : a.has("KeyC") && console.info("position=", t(Be).toArray(), "lookat=", t(Ce).toArray());
4280
+ e(Wt, () => {
4281
+ if (!a.size) return;
4282
+ if (!t(I).enableKeyboard) return a.clear();
4283
+ if (a.has("KeyH")) {
4284
+ const x = t(X);
4285
+ x && (x.visible = !x.visible), a.clear();
4286
+ } else if (a.has("Equal")) {
4287
+ const x = t(X);
4288
+ if (!x || !x.visible) return a.clear();
4289
+ if (a.has("KeyX")) {
4290
+ const w = be.degToRad(0.1);
4291
+ x.rotateOnAxis(new M(1, 0, 0), w);
4292
+ } else
4293
+ x.scale.set(x.scale.x + 0.01, x.scale.y + 0.01, x.scale.z + 0.01);
4294
+ } else if (a.has("Minus")) {
4295
+ const x = t(X);
4296
+ if (!x || !x.visible) return a.clear();
4297
+ if (a.has("KeyX")) {
4298
+ const w = be.degToRad(-0.1);
4299
+ x.rotateOnAxis(new M(1, 0, 0), w);
4300
+ } else
4301
+ x.scale.set(x.scale.x - 0.01, x.scale.y - 0.01, x.scale.z - 0.01);
4302
+ } else if (a.has("ArrowUp")) {
4303
+ const x = t(X);
4304
+ x && x.visible && (x.position.z += 0.1);
4305
+ } else if (a.has("ArrowDown")) {
4306
+ const x = t(X);
4307
+ x && x.visible && (x.position.z -= 0.1);
4308
+ } else if (a.has("ArrowRight")) {
4309
+ const x = t(X);
4310
+ x && x.visible && (x.position.x += 0.1);
4311
+ } else if (a.has("ArrowLeft")) {
4312
+ const x = t(X);
4313
+ x && x.visible && (x.position.x -= 0.1);
4314
+ } else if (a.has("KeyU")) {
4315
+ const x = t(X);
4316
+ if (x) {
4317
+ const w = x.meta || {};
4318
+ w.transform = x.matrix.toArray();
4319
+ }
4320
+ } else a.has("KeyQ") ? t(wn, 0.1) : a.has("KeyW") ? t(vn, 0.1) : a.has("KeyE") ? t(Sn, 0.1) : a.has("KeyA") ? t(wn, -0.1) : a.has("KeyS") ? t(vn, -0.1) : a.has("KeyD") ? t(Sn, -0.1) : a.has("KeyY") ? t($s, a.has("ShiftLeft") || a.has("ShiftRight") ? -0.1 : 0.1) : a.has("KeyC") && console.info("position=", t(Be).toArray(), "lookat=", t(Ce).toArray());
4346
4321
  });
4347
- const r = (w) => {
4348
- console.info(w.code), w.target.type !== "text" && (o || w.code === "F5" || (w.preventDefault(), a.add(w.code)));
4349
- }, c = (w) => {
4350
- w.target.type !== "text" && (o || a.clear());
4322
+ const r = (b) => {
4323
+ console.info(b.code), b.target.type !== "text" && (o || b.code === "F5" || (b.preventDefault(), a.add(b.code)));
4324
+ }, c = (b) => {
4325
+ b.target.type !== "text" && (o || a.clear());
4351
4326
  }, u = () => {
4352
4327
  a.clear();
4353
- }, l = (w) => {
4354
- parent && setTimeout(() => window.focus()), w.preventDefault();
4355
- }, d = async (w) => {
4356
- w.preventDefault();
4328
+ }, d = (b) => {
4329
+ parent && setTimeout(() => window.focus()), b.preventDefault();
4330
+ }, l = async (b) => {
4331
+ b.preventDefault();
4357
4332
  };
4358
4333
  let h, f, p, y;
4359
4334
  e(qe, () => {
4360
4335
  h?.dispose(), f?.dispose(), p?.dispose(), y?.dispose(), h = null, f = null, p = null, y = null, s.lastMovePoint = null, t(Te);
4361
4336
  });
4362
- const g = async (w) => {
4363
- parent && setTimeout(() => window.focus()), w.preventDefault(), !o && (s.down = w.button === 2 ? 2 : 1, s.move = !1, s.isDbClick = Date.now() - s.downTime < 300, s.downTime = Date.now());
4364
- }, m = async (w) => {
4365
- w.preventDefault(), !o && s.down && (s.move = !0);
4366
- }, x = async (w) => {
4367
- w.preventDefault(), !o && (s.down = 0, s.move = !1);
4337
+ const g = async (b) => {
4338
+ 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) => {
4340
+ b.preventDefault(), !o && s.down && (s.move = !0);
4341
+ }, C = async (b) => {
4342
+ b.preventDefault(), !o && (s.down = 0, s.move = !1);
4368
4343
  };
4369
- function b(w) {
4370
- w.preventDefault(), !o && (s.down = w.touches.length, s.down === 1 && (s.move = !1, s.x = w.touches[0].clientX, s.y = w.touches[0].clientY));
4344
+ function S(b) {
4345
+ b.preventDefault(), !o && (s.down = b.touches.length, s.down === 1 && (s.move = !1, s.x = b.touches[0].clientX, s.y = b.touches[0].clientY));
4371
4346
  }
4372
- function S(w) {
4373
- w.touches.length === 1 && (s.move = !0);
4347
+ function v(b) {
4348
+ b.touches.length === 1 && (s.move = !0);
4374
4349
  }
4375
- function T(w) {
4350
+ function k(b) {
4376
4351
  s.down === 1 && !s.move && t(it, s.x, s.y);
4377
4352
  }
4378
- 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", m), n.addEventListener("mouseup", x), n.addEventListener("touchstart", b, { passive: !1 }), n.addEventListener("touchmove", S, { passive: !1 }), n.addEventListener("touchend", T, { passive: !1 }), e(Rn, () => {
4379
- 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", m), n.removeEventListener("mouseup", x), n.removeEventListener("touchstart", b), n.removeEventListener("touchmove", S), n.removeEventListener("touchend", T);
4380
- }), e(it, async (w, I) => await t(Ft, w, I));
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(Ln, () => {
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
+ }), e(it, async (b, x) => await t(Ft, b, x));
4381
4356
  }
4382
4357
  var Ge = Object.freeze({
4383
4358
  Linear: Object.freeze({
@@ -4569,9 +4544,9 @@ var Ge = Object.freeze({
4569
4544
  }
4570
4545
  }, i;
4571
4546
  }()
4572
- ), En = {
4547
+ ), kn = {
4573
4548
  Linear: function(i, e) {
4574
- var t = i.length - 1, n = t * e, a = Math.floor(n), o = En.Utils.Linear;
4549
+ var t = i.length - 1, n = t * e, a = Math.floor(n), o = kn.Utils.Linear;
4575
4550
  return e < 0 ? o(i[0], i[1], n) : e > 1 ? o(i[t], i[t - 1], t - n) : o(i[a], i[a + 1 > t ? t : a + 1], n - a);
4576
4551
  },
4577
4552
  Utils: {
@@ -4588,11 +4563,11 @@ var Ge = Object.freeze({
4588
4563
  return i._nextId++;
4589
4564
  }, i._nextId = 0, i;
4590
4565
  }()
4591
- ), _n = new Dr(), Pr = (
4566
+ ), En = new Dr(), Pr = (
4592
4567
  /** @class */
4593
4568
  function() {
4594
4569
  function i(e, t) {
4595
- this._isPaused = !1, this._pauseStart = 0, this._valuesStart = {}, this._valuesEnd = {}, this._valuesStartRepeat = {}, this._duration = 1e3, this._isDynamic = !1, this._initialRepeat = 0, this._repeat = 0, this._yoyo = !1, this._isPlaying = !1, this._reversed = !1, this._delayTime = 0, this._startTime = 0, this._easingFunction = Ge.Linear.None, this._interpolationFunction = En.Linear, this._chainedTweens = [], this._onStartCallbackFired = !1, this._onEveryStartCallbackFired = !1, this._id = ra.nextId(), this._isChainStopped = !1, this._propertiesAreSetUp = !1, this._goToEnd = !1, this._object = e, typeof t == "object" ? (this._group = t, t.add(this)) : t === !0 && (this._group = _n, _n.add(this));
4570
+ this._isPaused = !1, this._pauseStart = 0, this._valuesStart = {}, this._valuesEnd = {}, this._valuesStartRepeat = {}, this._duration = 1e3, this._isDynamic = !1, this._initialRepeat = 0, this._repeat = 0, this._yoyo = !1, this._isPlaying = !1, this._reversed = !1, this._delayTime = 0, this._startTime = 0, this._easingFunction = Ge.Linear.None, this._interpolationFunction = kn.Linear, this._chainedTweens = [], this._onStartCallbackFired = !1, this._onEveryStartCallbackFired = !1, this._id = ra.nextId(), this._isChainStopped = !1, this._propertiesAreSetUp = !1, this._goToEnd = !1, this._object = e, typeof t == "object" ? (this._group = t, t.add(this)) : t === !0 && (this._group = En, En.add(this));
4596
4571
  }
4597
4572
  return i.prototype.getId = function() {
4598
4573
  return this._id;
@@ -4632,38 +4607,38 @@ var Ge = Object.freeze({
4632
4607
  return this.start(e, !0);
4633
4608
  }, i.prototype._setupProperties = function(e, t, n, a, o) {
4634
4609
  for (var s in n) {
4635
- var r = e[s], c = Array.isArray(r), u = c ? "array" : typeof r, l = !c && Array.isArray(n[s]);
4610
+ var r = e[s], c = Array.isArray(r), u = c ? "array" : typeof r, d = !c && Array.isArray(n[s]);
4636
4611
  if (!(u === "undefined" || u === "function")) {
4637
- if (l) {
4638
- var d = n[s];
4639
- if (d.length === 0)
4612
+ if (d) {
4613
+ var l = n[s];
4614
+ if (l.length === 0)
4640
4615
  continue;
4641
- for (var h = [r], f = 0, p = d.length; f < p; f += 1) {
4642
- var y = this._handleRelativeValue(r, d[f]);
4616
+ for (var h = [r], f = 0, p = l.length; f < p; f += 1) {
4617
+ var y = this._handleRelativeValue(r, l[f]);
4643
4618
  if (isNaN(y)) {
4644
- l = !1, console.warn("Found invalid interpolation list. Skipping.");
4619
+ d = !1, console.warn("Found invalid interpolation list. Skipping.");
4645
4620
  break;
4646
4621
  }
4647
4622
  h.push(y);
4648
4623
  }
4649
- l && (n[s] = h);
4624
+ d && (n[s] = h);
4650
4625
  }
4651
- if ((u === "object" || c) && r && !l) {
4626
+ if ((u === "object" || c) && r && !d) {
4652
4627
  t[s] = c ? [] : {};
4653
4628
  var g = r;
4654
4629
  for (var m in g)
4655
4630
  t[s][m] = g[m];
4656
4631
  a[s] = c ? [] : {};
4657
- var d = n[s];
4632
+ var l = n[s];
4658
4633
  if (!this._isDynamic) {
4659
- var x = {};
4660
- for (var m in d)
4661
- x[m] = d[m];
4662
- n[s] = d = x;
4634
+ var C = {};
4635
+ for (var m in l)
4636
+ C[m] = l[m];
4637
+ n[s] = l = C;
4663
4638
  }
4664
- this._setupProperties(g, t[s], d, a[s], o);
4639
+ this._setupProperties(g, t[s], l, a[s], o);
4665
4640
  } else
4666
- (typeof t[s] > "u" || o) && (t[s] = r), c || (t[s] *= 1), l ? a[s] = n[s].slice().reverse() : a[s] = t[s] || 0;
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;
4667
4642
  }
4668
4643
  }
4669
4644
  }, i.prototype.stop = function() {
@@ -4694,7 +4669,7 @@ var Ge = Object.freeze({
4694
4669
  }, i.prototype.easing = function(e) {
4695
4670
  return e === void 0 && (e = Ge.Linear.None), this._easingFunction = e, this;
4696
4671
  }, i.prototype.interpolation = function(e) {
4697
- return e === void 0 && (e = En.Linear), this._interpolationFunction = e, this;
4672
+ return e === void 0 && (e = kn.Linear), this._interpolationFunction = e, this;
4698
4673
  }, i.prototype.chain = function() {
4699
4674
  for (var e = [], t = 0; t < arguments.length; t++)
4700
4675
  e[t] = arguments[t];
@@ -4729,8 +4704,8 @@ var Ge = Object.freeze({
4729
4704
  return 1;
4730
4705
  var y = Math.trunc(s / r), g = s - y * r, m = Math.min(g / n._duration, 1);
4731
4706
  return m === 0 && s === n._duration ? 1 : m;
4732
- }, l = u(), d = this._easingFunction(l);
4733
- if (this._updateProperties(this._object, this._valuesStart, this._valuesEnd, d), this._onUpdateCallback && this._onUpdateCallback(this._object, l), this._duration === 0 || s >= this._duration)
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)
4734
4709
  if (this._repeat > 0) {
4735
4710
  var h = Math.min(Math.trunc((s - this._duration) / r) + 1, this._repeat);
4736
4711
  isFinite(this._repeat) && (this._repeat -= h);
@@ -4749,8 +4724,8 @@ var Ge = Object.freeze({
4749
4724
  }, i.prototype._updateProperties = function(e, t, n, a) {
4750
4725
  for (var o in n)
4751
4726
  if (t[o] !== void 0) {
4752
- var s = t[o] || 0, r = n[o], c = Array.isArray(e[o]), u = Array.isArray(r), l = !c && u;
4753
- 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));
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));
4754
4729
  }
4755
4730
  }, i.prototype._handleRelativeValue = function(e, t) {
4756
4731
  return typeof t != "string" ? t : t.charAt(0) === "+" || t.charAt(0) === "-" ? e + parseFloat(t) : parseFloat(t);
@@ -4761,7 +4736,7 @@ var Ge = Object.freeze({
4761
4736
  }()
4762
4737
  );
4763
4738
  ra.nextId;
4764
- var me = _n;
4739
+ var me = En;
4765
4740
  me.getAll.bind(me);
4766
4741
  me.removeAll.bind(me);
4767
4742
  me.add.bind(me);
@@ -4775,16 +4750,16 @@ class Lr extends te {
4775
4750
  async addScene(e) {
4776
4751
  const t = this, { renderer: n, scene: a, controls: o, tileMap: s } = t.mapViewer;
4777
4752
  fetch(e, { mode: "cors", credentials: "omit", cache: "reload" }).then((r) => r.ok ? r.json() : {}).then((r) => {
4778
- const c = new Ke();
4753
+ const c = new $e();
4779
4754
  if (r.transform)
4780
4755
  c.fromArray(r.transform);
4781
4756
  else if (r.WGS84) {
4782
- const p = s.geo2world(new C().fromArray(r.WGS84));
4757
+ const p = s.geo2world(new M().fromArray(r.WGS84));
4783
4758
  c.makeTranslation(p.x, p.y, p.z);
4784
4759
  }
4785
4760
  r.autoCut && (r.autoCut = Math.min(Math.max(r.autoCut, 1), 50));
4786
- 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 };
4787
- 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(_).debugMode, t.opts = f, t.meta = r, a.add(t), t.initCSS3DSprite(f), t.applyMatrix4(c);
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 };
4762
+ 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);
4788
4763
  }).catch((r) => {
4789
4764
  console.error(r.message);
4790
4765
  });
@@ -4796,9 +4771,8 @@ class Lr extends te {
4796
4771
  </div>`, n.classList.add("splatmesh-point"), n.style.position = "absolute", n.style.borderRadius = "4px", n.style.cursor = "pointer";
4797
4772
  let a = null;
4798
4773
  n.onclick = () => {
4799
- if (a)
4800
- return;
4801
- const s = t.position, r = e.controls, c = r.object.position.clone(), u = Ji ? 6 : 2, l = s.clone().sub(c).normalize(), d = s.clone().sub(l.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: d.x, y: d.y, z: d.z, tx: s.x, ty: s.y, tz: s.z };
4774
+ if (a) return;
4775
+ const s = t.position, r = e.controls, c = r.object.position.clone(), u = Ji ? 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 };
4802
4776
  a = new Pr(h).to(f, 3e3), a.easing(Ge.Sinusoidal.InOut).start().onUpdate(() => {
4803
4777
  const p = h.y < 0.1 ? 0.1 : h.y;
4804
4778
  r.object.position.set(h.x, p, h.z), r.target.set(h.tx, h.ty, h.tz);
@@ -4826,10 +4800,10 @@ class Lr extends te {
4826
4800
  else {
4827
4801
  const c = t.meta, u = { ...t.opts };
4828
4802
  c.autoCut && (u.bigSceneMode = !0);
4829
- const l = new pe(u);
4830
- t.splatMesh = l, t.opts.scene.add(l), l.applyMatrix4(t.opts.matrix), l.meta = c;
4831
- const d = c.watermark || c.name || "";
4832
- c.showWatermark = c.showWatermark !== !1, l.fire(Hn, d, !0, !1), l.addModel({ url: t.meta.url }, t.meta);
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(Qn, l, !0, !1), d.addModel({ url: t.meta.url }, t.meta);
4833
4807
  }
4834
4808
  }
4835
4809
  }, t.onAfterRender = () => {
@@ -4848,31 +4822,43 @@ class Lr extends te {
4848
4822
  }
4849
4823
  class Ur extends ba {
4850
4824
  constructor(e = {}) {
4851
- console.info("Reall3dMapViewer", Vt), super(), this.clock = new xa(), this.updateTime = 0, this.disposed = !1;
4852
- const t = this, n = new Xn();
4825
+ console.info("Reall3dMapViewer", Yt), super(), this.clock = new xa(), this.updateTime = 0, this.disposed = !1;
4826
+ const t = this, n = new Nn();
4853
4827
  t.events = n;
4854
4828
  const a = (r, c, u) => n.on(r, c, u), o = (r, ...c) => n.fire(r, ...c);
4855
4829
  t.tileMap = Er();
4856
4830
  const s = kr(e);
4857
- a(_, () => s), qn(n), Jn(n), Tr(n), aa(n), oa(n), t.camera = new ts(60, 1, 0.01, 1e4), a(V, () => t.camera), t.container = s.root, t.renderer = o(Vs), t.scene = o(Gs), t.controls = o(Ns), t.ambLight = new as(16777215, 1), t.scene.add(t.ambLight), t.dirLight = o(Xs), t.scene.add(t.dirLight), t.scene.add(t.tileMap), t.container.appendChild(t.renderer.domElement), window.addEventListener("resize", t.resize.bind(t)), t.resize(), t.renderer.setAnimationLoop(t.animate.bind(t)), Ir(n), a(Wt, () => t.dispose()), a(Ve, () => {
4858
- o(Lt), t.controls.update(), o($s), o(Yt);
4859
- }, !0), a(lt, () => {
4860
- t.dispatchEvent({ type: "update", delta: t.clock.getDelta() }), t.updateTime = Date.now(), o(re) && o(oe, {
4861
- fps: o(Pt),
4862
- realFps: o(Rt),
4863
- fov: o(ft),
4864
- position: o(Le, o(Be)),
4865
- lookAt: o(Le, o(Ce)),
4866
- lookUp: o(Le, o(Ne))
4867
- });
4868
- }, !0), a(Oe, () => {
4869
- t.tileMap.update(t.camera);
4870
- try {
4871
- t.renderer.render(t.scene, t.camera);
4872
- } catch (r) {
4873
- console.warn(r.message);
4874
- }
4875
- }, !0);
4831
+ a(I, () => s), jn(n), qn(n), Tr(n), aa(n), t.camera = new ts(60, 1, 0.01, 1e4), a(V, () => t.camera), t.container = s.root, t.renderer = o(Vs), t.scene = o(Gs), t.controls = o(Ns), t.ambLight = new as(16777215, 1), t.scene.add(t.ambLight), t.dirLight = o(Xs), t.scene.add(t.dirLight), t.scene.add(t.tileMap), t.container.appendChild(t.renderer.domElement), oa(n), Ir(n), window.addEventListener("resize", t.resize.bind(t)), t.resize(), t.renderer.setAnimationLoop(t.animate.bind(t)), a(Ht, () => t.dispose()), a(
4832
+ Ve,
4833
+ () => {
4834
+ o(Pt), t.controls.update(), o(Ks), o(Wt);
4835
+ },
4836
+ !0
4837
+ ), a(
4838
+ lt,
4839
+ () => {
4840
+ t.dispatchEvent({ type: "update", delta: t.clock.getDelta() }), t.updateTime = Date.now(), o(re) && o(oe, {
4841
+ fps: o(Dt),
4842
+ realFps: o(Lt),
4843
+ fov: o(ft),
4844
+ position: o(Le, o(Be)),
4845
+ lookAt: o(Le, o(Ce)),
4846
+ lookUp: o(Le, o(Ne))
4847
+ });
4848
+ },
4849
+ !0
4850
+ ), a(
4851
+ Oe,
4852
+ () => {
4853
+ t.tileMap.update(t.camera);
4854
+ try {
4855
+ t.renderer.render(t.scene, t.camera);
4856
+ } catch (r) {
4857
+ console.warn(r.message);
4858
+ }
4859
+ },
4860
+ !0
4861
+ );
4876
4862
  }
4877
4863
  /**
4878
4864
  * 打开地图场景
@@ -4881,7 +4867,7 @@ class Ur extends ba {
4881
4867
  addScenes(e) {
4882
4868
  const t = this;
4883
4869
  fetch(e, { mode: "cors", credentials: "omit", cache: "reload" }).then((n) => n.ok ? n.json() : {}).then((n) => {
4884
- const a = new C().fromArray(n.position || [17e3, 3e4, -35e3]), o = new C().fromArray(n.lookAt || [17e3, 0, -35e3]);
4870
+ const a = new M().fromArray(n.position || [17e3, 3e4, -35e3]), o = new M().fromArray(n.lookAt || [17e3, 0, -35e3]);
4885
4871
  t.controls.object.position.copy(a), t.controls.target.copy(o), t.dirLight.target.position.copy(o);
4886
4872
  const s = /* @__PURE__ */ new Set();
4887
4873
  for (let r of n.scenes)
@@ -4892,25 +4878,25 @@ class Ur extends ba {
4892
4878
  }
4893
4879
  resize() {
4894
4880
  const e = this;
4895
- if (e.disposed)
4896
- return;
4897
- const t = e.container.clientWidth, n = e.container.clientHeight;
4898
- e.renderer.setPixelRatio(Math.min(devicePixelRatio, 2)), e.renderer.setSize(t, n), e.camera.aspect = t / n, e.camera.updateProjectionMatrix(), e.events.fire(zn).setSize(t, n);
4881
+ if (e.disposed) return;
4882
+ const { width: t, height: n, top: a, left: o } = e.container.getBoundingClientRect();
4883
+ e.renderer.setPixelRatio(Math.min(devicePixelRatio, 2)), e.renderer.setSize(t, n), e.camera.aspect = t / n, e.camera.updateProjectionMatrix();
4884
+ const s = e.events.fire(On);
4885
+ s.setSize(t, n), s.domElement.style.position = "absolute", s.domElement.style.left = `${o}px`, s.domElement.style.top = `${a}px`;
4899
4886
  }
4900
4887
  animate() {
4901
4888
  const e = this, t = (n, ...a) => e.events.fire(n, ...a);
4902
- t(Dt), Date.now() - e.updateTime > 30 && (t(Ve), t(Oe), t(lt));
4889
+ t(It), Date.now() - e.updateTime > 30 && (t(Ve), t(Oe), t(lt));
4903
4890
  }
4904
4891
  /**
4905
4892
  * 销毁
4906
4893
  */
4907
4894
  dispose() {
4908
4895
  const e = this;
4909
- if (e.disposed)
4910
- return;
4896
+ if (e.disposed) return;
4911
4897
  e.disposed = !0;
4912
4898
  const t = e.renderer.domElement;
4913
- e.events.fire(Qn), e.events.fire(Zs), e.renderer.clear(), e.renderer.dispose(), e.events.clear(), e.scene = null, e.renderer = null, e.camera = null, e.controls = null, e.ambLight = null, e.dirLight = null, e.container.removeChild(t), e.container.classList.add("hidden"), e.container = null, e.clock = null, e.events = null, e.tileMap = null;
4899
+ e.events.fire(zn), e.events.fire(Zs), e.renderer.clear(), e.renderer.dispose(), e.events.clear(), e.scene = null, e.renderer = null, e.camera = null, e.controls = null, e.ambLight = null, e.dirLight = null, e.container.removeChild(t), e.container.classList.add("hidden"), e.container = null, e.clock = null, e.events = null, e.tileMap = null;
4914
4900
  }
4915
4901
  }
4916
4902
  export {