iflow-engine-base-3d 3.12.22 → 3.12.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- import { S as Ti, G as ue, P as qt, O as ke, M as O, V as d, e as $e, T as Rn, C as Ds, W as Ii, a as ks, b as je, N as _i, c as Ls, d as ot, f as G, Q as Se, E as On, R as pe, g as Ze, h as Fn, B as R, i as Di, A as Nn, j as H, k as z, I as V, l as ii, m as ni, n as Hn, o as Vn, L as Kt, p as Bs, q as zs, r as Rs, s as Gi, D as re, t as qi, u as Os, F as Fs, v as Me, w as Un, x as Wn, y as ki, z as Ns, H as Gn, J as he, K as Hs, U as bt, X as Vs, Y as Us, Z as qn, _ as Ws, $ as qe, a0 as jt, a1 as Li, a2 as Z, a3 as oe, a4 as Ct, a5 as Gs, a6 as Je, a7 as yi, a8 as He, a9 as It, aa as qs, ab as Ks, ac as Mi, ad as ht, ae as js, af as ct, ag as Ys, ah as Xs, ai as Kn, aj as Yt, ak as At, al as Xt, am as Qs, an as Ki, ao as dt, ap as Et, aq as St, ar as $s, as as Zs, at as ji, au as Js, av as eo, aw as to, ax as io, ay as no, az as so, aA as oo, aB as ro, aC as ao, aD as lo, aE as jn, aF as co, aG as ho, aH as uo, aI as vi, aJ as Ye, aK as po, aL as mo, aM as go, aN as fo, aO as yo, aP as Mo, aQ as vo } from "./three-vendor-Bm0q8_z9.js";
2
- import { W as ge, C as xo, L as ft, B as Yi, g as ze, a as wo, E as bo, r as Co } from "./sdk-runtime-Dh6NDrxA.js";
3
- import { r as ee, g as Ao } from "./sdk-assets-rr-2tUgO.js";
1
+ import { S as Ti, G as ue, P as qt, O as ke, M as O, V as d, e as $e, T as Rn, C as Ds, W as Ii, a as ks, b as je, N as _i, c as Ls, d as ot, f as W, Q as Se, E as On, R as pe, g as Ze, h as Fn, B as R, i as Di, A as Nn, j as H, k as z, I as V, l as ii, m as ni, n as Hn, o as Vn, L as Kt, p as Bs, q as zs, r as Rs, s as Gi, D as re, t as qi, u as Os, F as Fs, v as Me, w as Un, x as Wn, y as ki, z as Ns, H as Gn, J as he, K as Hs, U as Vs, X as bt, Y as Us, Z as qn, _ as Ws, $ as qe, a0 as jt, a1 as Li, a2 as Z, a3 as oe, a4 as Ct, a5 as Gs, a6 as Je, a7 as yi, a8 as He, a9 as It, aa as qs, ab as Ks, ac as Mi, ad as ht, ae as js, af as ct, ag as Ys, ah as Xs, ai as Kn, aj as Yt, ak as At, al as Xt, am as Qs, an as Ki, ao as dt, ap as Et, aq as St, ar as $s, as as Zs, at as ji, au as Js, av as eo, aw as to, ax as io, ay as no, az as so, aA as oo, aB as ro, aC as ao, aD as lo, aE as jn, aF as co, aG as ho, aH as uo, aI as vi, aJ as Ye, aK as po, aL as mo, aM as go, aN as fo, aO as yo, aP as Mo, aQ as vo } from "./three-vendor-Cy618JLY.js";
2
+ import { W as ge, C as xo, L as ft, B as Yi, g as ze, a as wo, E as bo, r as Co } from "./sdk-runtime-CY1F9tN3.js";
3
+ import { r as ee, g as Ao } from "./sdk-assets-Dl8936wx.js";
4
4
  import { a as Qt, J as xi, c as Eo, b as So, P as si, q as Po, k as To, n as Xi, E as Qi, S as Io } from "./sdk-vendor-DYgn7sFs.js";
5
5
  class _o {
6
6
  engine;
@@ -22,7 +22,7 @@ class ie {
22
22
  cameraAnimationFrame = null;
23
23
  constructor(e) {
24
24
  this.engine = e, this.perspectiveCamera = new qt(
25
- 60,
25
+ 45,
26
26
  this.engine.container.clientWidth / this.engine.container.clientHeight,
27
27
  0.1,
28
28
  1e3
@@ -500,7 +500,7 @@ class Yn extends Ls {
500
500
  LEFT: ot.ROTATE,
501
501
  MIDDLE: ot.DOLLY,
502
502
  RIGHT: ot.PAN
503
- }, this.state = de.NONE, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this.up0 = this.object.up.clone(), this.origin0 = this.origin.clone(), this._lastZoom = this.object.zoom, this._lastPosition = this.object.position.clone(), this._lastTarget = this.target.clone(), this._lastUp = this.object.up.clone(), this._lastQuaternion = this.object.quaternion.clone(), this._referenceUp = this.object.up.clone().normalize(), this._viewRight = new d(1, 0, 0).applyQuaternion(this.object.quaternion).normalize(), this._rotateVelocity = new G(), this._panVelocity = new G(), this._zoomVelocity = 0, this._mouseStart = new G(), this._touchCenter = new G(), this._touchDistance = 0, this._pointers = /* @__PURE__ */ new Map(), this._pressedKeys = /* @__PURE__ */ new Set(), this._keyboardAnimationId = null, this._lastKeyboardMoveTime = 0, this._isInteracting = !1, this._keyDomElement = null, this._touchAction = "", this._onContextMenu = this._handleContextMenu.bind(this), this._onPointerDown = this._handlePointerDown.bind(this), this._onPointerMove = this._handlePointerMove.bind(this), this._onPointerUp = this._handlePointerUp.bind(this), this._onPointerCancel = this._handlePointerUp.bind(this), this._onWheel = this._handleWheel.bind(this), this._onKeyDown = this._handleKeyDown.bind(this), this._onKeyUp = this._handleKeyUp.bind(this), this.domElement && this.connect(this.domElement), this.update(), this.saveState();
503
+ }, this.state = de.NONE, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this.up0 = this.object.up.clone(), this.origin0 = this.origin.clone(), this._lastZoom = this.object.zoom, this._lastPosition = this.object.position.clone(), this._lastTarget = this.target.clone(), this._lastUp = this.object.up.clone(), this._lastQuaternion = this.object.quaternion.clone(), this._referenceUp = this.object.up.clone().normalize(), this._viewRight = new d(1, 0, 0).applyQuaternion(this.object.quaternion).normalize(), this._rotateVelocity = new W(), this._panVelocity = new W(), this._zoomVelocity = 0, this._mouseStart = new W(), this._touchCenter = new W(), this._touchDistance = 0, this._pointers = /* @__PURE__ */ new Map(), this._pressedKeys = /* @__PURE__ */ new Set(), this._keyboardAnimationId = null, this._lastKeyboardMoveTime = 0, this._isInteracting = !1, this._keyDomElement = null, this._touchAction = "", this._onContextMenu = this._handleContextMenu.bind(this), this._onPointerDown = this._handlePointerDown.bind(this), this._onPointerMove = this._handlePointerMove.bind(this), this._onPointerUp = this._handlePointerUp.bind(this), this._onPointerCancel = this._handlePointerUp.bind(this), this._onWheel = this._handleWheel.bind(this), this._onKeyDown = this._handleKeyDown.bind(this), this._onKeyUp = this._handleKeyUp.bind(this), this.domElement && this.connect(this.domElement), this.update(), this.saveState();
504
504
  }
505
505
  connect(e) {
506
506
  e && (this.disconnect(), this.domElement = e, this._touchAction = e.style.touchAction, e.style.touchAction = "none", e.addEventListener("contextmenu", this._onContextMenu), e.addEventListener("pointerdown", this._onPointerDown), e.addEventListener("pointermove", this._onPointerMove), e.addEventListener("pointerup", this._onPointerUp), e.addEventListener("pointercancel", this._onPointerCancel), e.addEventListener("wheel", this._onWheel, { passive: !1 }), this.listenToKeyEvents(window));
@@ -1741,15 +1741,15 @@ class Go {
1741
1741
  r || (r = [0, 0, []]);
1742
1742
  const a = Pe(n, s), c = this.getModelSnapCache(s, o, r);
1743
1743
  n.camera.updateMatrixWorld(!0);
1744
- const h = new H().multiplyMatrices(n.camera.projectionMatrix, n.camera.matrixWorldInverse), u = n.renderer.domElement.clientWidth, p = n.renderer.domElement.clientHeight, g = new G(t.offsetX, t.offsetY), f = new ii(), v = new d(), w = new d(), m = new G(), b = new G(), A = new d();
1745
- let S = "face", I = null, T = null, B = 100;
1744
+ const h = new H().multiplyMatrices(n.camera.projectionMatrix, n.camera.matrixWorldInverse), u = n.renderer.domElement.clientWidth, p = n.renderer.domElement.clientHeight, g = new W(t.offsetX, t.offsetY), f = new ii(), v = new d(), x = new d(), m = new W(), b = new W(), A = new d();
1745
+ let S = "face", I = null, T = null, L = 100;
1746
1746
  if (i != null) {
1747
1747
  const k = e.point.clone(), N = e.normal || (e.face ? e.face.normal : null);
1748
1748
  if (N && e.object?.matrixWorld?.elements) {
1749
- const j = N.clone().transformDirection(e.object.matrixWorld).normalize(), Q = new d().subVectors(i, k).dot(j), ce = i.clone().sub(j.clone().multiplyScalar(Q)), ae = this.projectWorldPointToScreen(ce, h, u, p, m, f);
1749
+ const K = N.clone().transformDirection(e.object.matrixWorld).normalize(), Q = new d().subVectors(i, k).dot(K), ce = i.clone().sub(K.clone().multiplyScalar(Q)), ae = this.projectWorldPointToScreen(ce, h, u, p, m, f);
1750
1750
  if (ae != null) {
1751
1751
  const le = this.getDistanceSq(ae.x, ae.y, g.x, g.y);
1752
- le < B * 4 && (B = le, I = {
1752
+ le < L * 4 && (L = le, I = {
1753
1753
  point: ce,
1754
1754
  distanceSq: le,
1755
1755
  pointxy: ae.clone(),
@@ -1764,10 +1764,10 @@ class Go {
1764
1764
  const N = this.projectWorldPointToScreen(v, h, u, p, m, f);
1765
1765
  if (N == null)
1766
1766
  continue;
1767
- const j = this.getDistanceSq(N.x, N.y, g.x, g.y);
1768
- j < B && (B = j, I = {
1767
+ const K = this.getDistanceSq(N.x, N.y, g.x, g.y);
1768
+ K < L && (L = K, I = {
1769
1769
  point: v.clone(),
1770
- distanceSq: j,
1770
+ distanceSq: K,
1771
1771
  pointxy: N.clone(),
1772
1772
  style: "rect"
1773
1773
  });
@@ -1778,10 +1778,10 @@ class Go {
1778
1778
  const N = this.projectWorldPointToScreen(v, h, u, p, m, f);
1779
1779
  if (N == null)
1780
1780
  continue;
1781
- const j = this.getDistanceSq(N.x, N.y, g.x, g.y);
1782
- j < B && (B = j, I = {
1781
+ const K = this.getDistanceSq(N.x, N.y, g.x, g.y);
1782
+ K < L && (L = K, I = {
1783
1783
  point: v.clone(),
1784
- distanceSq: j,
1784
+ distanceSq: K,
1785
1785
  pointxy: N.clone(),
1786
1786
  style: "default"
1787
1787
  });
@@ -1790,13 +1790,13 @@ class Go {
1790
1790
  S = "point";
1791
1791
  else {
1792
1792
  for (let k = 0; k < c.localLines.length; k += 6) {
1793
- v.set(c.localLines[k], c.localLines[k + 1], c.localLines[k + 2]).applyMatrix4(a), w.set(c.localLines[k + 3], c.localLines[k + 4], c.localLines[k + 5]).applyMatrix4(a);
1794
- const N = this.projectWorldPointToScreen(v, h, u, p, m, f), j = this.projectWorldPointToScreen(w, h, u, p, b, f);
1795
- if (N == null || j == null)
1793
+ v.set(c.localLines[k], c.localLines[k + 1], c.localLines[k + 2]).applyMatrix4(a), x.set(c.localLines[k + 3], c.localLines[k + 4], c.localLines[k + 5]).applyMatrix4(a);
1794
+ const N = this.projectWorldPointToScreen(v, h, u, p, m, f), K = this.projectWorldPointToScreen(x, h, u, p, b, f);
1795
+ if (N == null || K == null)
1796
1796
  continue;
1797
- const te = this.pointToLineProjection(g, N, j), Q = this.pointToLineDistanceSq(g, N, j);
1798
- if (Q < B) {
1799
- const ce = this.pointToLineProjection3D(te, v, w, h, A);
1797
+ const te = this.pointToLineProjection(g, N, K), Q = this.pointToLineDistanceSq(g, N, K);
1798
+ if (Q < L) {
1799
+ const ce = this.pointToLineProjection3D(te, v, x, h, A);
1800
1800
  if (n.clipping && !n.clipping.isPointInClippingRange(ce))
1801
1801
  continue;
1802
1802
  T = {
@@ -1804,9 +1804,9 @@ class Go {
1804
1804
  point: ce.clone(),
1805
1805
  pointxy: this.projectWorldPointToScreen(ce, h, u, p, m, f)?.clone() ?? N.clone(),
1806
1806
  start: N.clone(),
1807
- end: j.clone(),
1807
+ end: K.clone(),
1808
1808
  style: "funnel"
1809
- }, B = Q;
1809
+ }, L = Q;
1810
1810
  }
1811
1811
  }
1812
1812
  T != null && (S = "line");
@@ -1825,8 +1825,8 @@ class Go {
1825
1825
  s.forEach((f) => {
1826
1826
  if (f?.[0] == null || f?.[1] == null)
1827
1827
  return;
1828
- const v = f[0], w = f[1];
1829
- r[h++] = v.X, r[h++] = v.Z, r[h++] = -v.Y, a[u++] = (v.X + w.X) * 0.5, a[u++] = (v.Z + w.Z) * 0.5, a[u++] = (-v.Y - w.Y) * 0.5, c[p++] = v.X, c[p++] = v.Z, c[p++] = -v.Y, c[p++] = w.X, c[p++] = w.Z, c[p++] = -w.Y;
1828
+ const v = f[0], x = f[1];
1829
+ r[h++] = v.X, r[h++] = v.Z, r[h++] = -v.Y, a[u++] = (v.X + x.X) * 0.5, a[u++] = (v.Z + x.Z) * 0.5, a[u++] = (-v.Y - x.Y) * 0.5, c[p++] = v.X, c[p++] = v.Z, c[p++] = -v.Y, c[p++] = x.X, c[p++] = x.Z, c[p++] = -x.Y;
1830
1830
  });
1831
1831
  const g = {
1832
1832
  source: s,
@@ -1860,10 +1860,10 @@ class Go {
1860
1860
  return this.getDistanceSq(e.x, e.y, s, o);
1861
1861
  }
1862
1862
  pointToLineProjection(e, t, i) {
1863
- const n = new G().subVectors(i, t), s = n.lengthSq();
1863
+ const n = new W().subVectors(i, t), s = n.lengthSq();
1864
1864
  if (s < 1e-10)
1865
1865
  return 0;
1866
- const o = new G().subVectors(e, t);
1866
+ const o = new W().subVectors(e, t);
1867
1867
  return O.clamp(o.dot(n) / s, 0, 1);
1868
1868
  }
1869
1869
  /**
@@ -1951,14 +1951,14 @@ function Hi(l) {
1951
1951
  mouseMoveFrame: null,
1952
1952
  latestMouseMoveEvent: null
1953
1953
  }, t = 800, i = 28, n = 132, s = 44, o = 168, r = new Go(l);
1954
- e.handle_catch = function(M, E, L = !0, U = !0) {
1954
+ e.handle_catch = function(M, E, B = !0, U = !0) {
1955
1955
  const Y = e.options;
1956
1956
  e.options = {
1957
1957
  ...Y ?? {},
1958
- showCatch: L
1958
+ showCatch: B
1959
1959
  };
1960
1960
  try {
1961
- return K(M, E, !0, U);
1961
+ return j(M, E, !0, U);
1962
1962
  } finally {
1963
1963
  e.options = Y;
1964
1964
  }
@@ -1973,9 +1973,9 @@ function Hi(l) {
1973
1973
  e.mouseMoveFrame != null && (cancelAnimationFrame(e.mouseMoveFrame), e.mouseMoveFrame = null), e.latestMouseMoveEvent = null;
1974
1974
  }
1975
1975
  e.active = function() {
1976
- l.renderer.domElement.addEventListener("mousedown", ce), l.renderer.domElement.addEventListener("mouseup", le), l.renderer.domElement.addEventListener("mousemove", ae), l.renderer.domElement.addEventListener("touchstart", _, { capture: !0, passive: !1 }), l.renderer.domElement.addEventListener("touchend", P, { capture: !0, passive: !1 }), l.renderer.domElement.addEventListener("touchcancel", P, { capture: !0, passive: !1 }), l.renderer.domElement.addEventListener("touchmove", D, { capture: !0, passive: !1 }), l.renderer.domElement.addEventListener("pointerdown", F, !0), l.renderer.domElement.addEventListener("pointermove", W, !0), l.renderer.domElement.addEventListener("pointerup", q, !0), l.renderer.domElement.addEventListener("pointercancel", q, !0), window.addEventListener("keydown", c), window.addEventListener("keyup", h);
1976
+ l.renderer.domElement.addEventListener("mousedown", ce), l.renderer.domElement.addEventListener("mouseup", le), l.renderer.domElement.addEventListener("mousemove", ae), l.renderer.domElement.addEventListener("touchstart", _, { capture: !0, passive: !1 }), l.renderer.domElement.addEventListener("touchend", P, { capture: !0, passive: !1 }), l.renderer.domElement.addEventListener("touchcancel", P, { capture: !0, passive: !1 }), l.renderer.domElement.addEventListener("touchmove", D, { capture: !0, passive: !1 }), l.renderer.domElement.addEventListener("pointerdown", F, !0), l.renderer.domElement.addEventListener("pointermove", G, !0), l.renderer.domElement.addEventListener("pointerup", q, !0), l.renderer.domElement.addEventListener("pointercancel", q, !0), window.addEventListener("keydown", c), window.addEventListener("keyup", h);
1977
1977
  }, e.disActive = function() {
1978
- m(), a(), N(), l.renderer.domElement.removeEventListener("mousedown", ce), l.renderer.domElement.removeEventListener("mouseup", le), l.renderer.domElement.removeEventListener("mousemove", ae), l.renderer.domElement.removeEventListener("touchstart", _, !0), l.renderer.domElement.removeEventListener("touchend", P, !0), l.renderer.domElement.removeEventListener("touchcancel", P, !0), l.renderer.domElement.removeEventListener("touchmove", D, !0), l.renderer.domElement.removeEventListener("pointerdown", F, !0), l.renderer.domElement.removeEventListener("pointermove", W, !0), l.renderer.domElement.removeEventListener("pointerup", q, !0), l.renderer.domElement.removeEventListener("pointercancel", q, !0), window.removeEventListener("keydown", c), window.removeEventListener("keyup", h);
1978
+ m(), a(), N(), l.renderer.domElement.removeEventListener("mousedown", ce), l.renderer.domElement.removeEventListener("mouseup", le), l.renderer.domElement.removeEventListener("mousemove", ae), l.renderer.domElement.removeEventListener("touchstart", _, !0), l.renderer.domElement.removeEventListener("touchend", P, !0), l.renderer.domElement.removeEventListener("touchcancel", P, !0), l.renderer.domElement.removeEventListener("touchmove", D, !0), l.renderer.domElement.removeEventListener("pointerdown", F, !0), l.renderer.domElement.removeEventListener("pointermove", G, !0), l.renderer.domElement.removeEventListener("pointerup", q, !0), l.renderer.domElement.removeEventListener("pointercancel", q, !0), window.removeEventListener("keydown", c), window.removeEventListener("keyup", h);
1979
1979
  };
1980
1980
  function c(M) {
1981
1981
  (M.keyCode === 8 || M.keyCode === 46) && e.self && e.self.handelKeyDeleteDown != null && e.self.handelKeyDeleteDown(), M.keyCode === 27 && e.self && e.self.handelKeyEscDown != null && e.self.handelKeyEscDown(), M.keyCode === 13 && e.self && e.self.handelKeyEnterDown != null && e.self.handelKeyEnterDown(), M.keyCode === 32 && e.self && e.self.handelKeySpaceDown != null && e.self.handelKeySpaceDown(M), M.key === "Tab" && e.self && e.self.handelKeyTabDown != null && e.self.handelKeyTabDown(M), M.key === "Control" && e.self && e.self.handelKeyCtrlDown != null && e.self.handelKeyCtrlDown(), M.key === "Delete" && e.self && e.self.handelKeyDeleteDown != null && e.self.handelKeyDeleteDown(), M.key === "Shift" && e.self && e.self.handelKeyShiftDown != null && e.self.handelKeyShiftDown(), M.key === "Meta" && e.self && e.self.handelKeyMetaDown != null && e.self.handelKeyMetaDown();
@@ -1984,12 +1984,12 @@ function Hi(l) {
1984
1984
  M.key === "Alt" && e.self && e.self.handelKeyAltUp != null && e.self.handelKeyAltUp(), M.key === "Tab" && e.self && e.self.handelKeyTabUp != null && e.self.handelKeyTabUp(), M.key === "Control" && e.self && e.self.handelKeyCtrlUp != null && e.self.handelKeyCtrlUp(), M.key === "Shift" && e.self && e.self.handelKeyShiftUp != null && e.self.handelKeyShiftUp(), M.key === "Meta" && e.self && e.self.handelKeyMetaUp != null && e.self.handelKeyMetaUp(), M.key === "Command" && e.self && e.self.handelKeyCommandUp != null && e.self.handelKeyCommandUp(), M.key === "Windows" && e.self && e.self.handelKeyWindowsUp != null && e.self.handelKeyWindowsUp();
1985
1985
  }
1986
1986
  function u(M) {
1987
- const E = new G(), L = l.renderer.domElement.clientWidth, U = l.renderer.domElement.clientHeight;
1988
- return E.x = M.offsetX / L * 2 - 1, E.y = -(M.offsetY / U) * 2 + 1, E;
1987
+ const E = new W(), B = l.renderer.domElement.clientWidth, U = l.renderer.domElement.clientHeight;
1988
+ return E.x = M.offsetX / B * 2 - 1, E.y = -(M.offsetY / U) * 2 + 1, E;
1989
1989
  }
1990
1990
  function p(M) {
1991
- const E = new pe(), L = u(M);
1992
- return E.setFromCamera(L, l.camera), E;
1991
+ const E = new pe(), B = u(M);
1992
+ return E.setFromCamera(B, l.camera), E;
1993
1993
  }
1994
1994
  function g() {
1995
1995
  return l?.deviceModule?.isMobile?.() === !0 || l?.deviceType === "mobile";
@@ -2001,11 +2001,11 @@ function Hi(l) {
2001
2001
  const E = typeof TouchEvent < "u" && M?.originalEvent instanceof TouchEvent;
2002
2002
  return f() && !E;
2003
2003
  }
2004
- function w() {
2004
+ function x() {
2005
2005
  e.touchLongPressTimer != null && (clearTimeout(e.touchLongPressTimer), e.touchLongPressTimer = null);
2006
2006
  }
2007
2007
  function m() {
2008
- w(), k(), S(), e.touchLongPressActive = !1, e.touchLatestEvent = null, e.touchStartPosition = null, e.touchInputMode = null, e.touchPointerId = null;
2008
+ x(), k(), S(), e.touchLongPressActive = !1, e.touchLatestEvent = null, e.touchStartPosition = null, e.touchInputMode = null, e.touchPointerId = null;
2009
2009
  }
2010
2010
  function b(M) {
2011
2011
  M?.preventDefault?.(), M?.stopPropagation?.(), M?.stopImmediatePropagation?.();
@@ -2026,9 +2026,9 @@ function Hi(l) {
2026
2026
  }
2027
2027
  function T(M) {
2028
2028
  const E = M.touches[0] || M.changedTouches[0];
2029
- return E ? new G(E.clientX, E.clientY) : null;
2029
+ return E ? new W(E.clientX, E.clientY) : null;
2030
2030
  }
2031
- function B() {
2031
+ function L() {
2032
2032
  if (e.touchMagnifierCanvas)
2033
2033
  return e.touchMagnifierCanvas;
2034
2034
  const M = document.createElement("canvas"), E = Math.max(1, window.devicePixelRatio || 1);
@@ -2041,12 +2041,12 @@ function Hi(l) {
2041
2041
  function N() {
2042
2042
  e.touchMagnifierCanvas?.remove?.(), e.touchMagnifierCanvas = null, e.touchMagnifierContext = null;
2043
2043
  }
2044
- function j(M, E, L, U, Y, we) {
2044
+ function K(M, E, B, U, Y, we) {
2045
2045
  const ve = l?.catchSvg;
2046
2046
  if (!ve?.childElementCount) return;
2047
2047
  const Le = l?.reactBoundingClientRect ?? E.getBoundingClientRect(), nt = (be) => {
2048
2048
  const [Re, Oe] = be.split(",").map(Number);
2049
- return Number.isFinite(Re) && Number.isFinite(Oe) ? [(Re - Le.left - L) / Y * n * we, (Oe - Le.top - U) / Y * n * we] : null;
2049
+ return Number.isFinite(Re) && Number.isFinite(Oe) ? [(Re - Le.left - B) / Y * n * we, (Oe - Le.top - U) / Y * n * we] : null;
2050
2050
  };
2051
2051
  Array.from(ve.children).forEach((be) => {
2052
2052
  const Re = be.tagName.toLowerCase(), xe = (Re === "line" ? [`${be.getAttribute("x1")},${be.getAttribute("y1")}`, `${be.getAttribute("x2")},${be.getAttribute("y2")}`].map(nt) : (be.getAttribute("points") || "").trim().split(/\s+/).map(nt)).filter(Boolean);
@@ -2054,36 +2054,36 @@ function Hi(l) {
2054
2054
  });
2055
2055
  }
2056
2056
  function te(M) {
2057
- const E = l?.renderer?.domElement, L = B(), U = e.touchMagnifierContext;
2058
- if (!E || !L || !U)
2057
+ const E = l?.renderer?.domElement, B = L(), U = e.touchMagnifierContext;
2058
+ if (!E || !B || !U)
2059
2059
  return;
2060
2060
  const Y = M?.catch?.point, we = Y && (l?.worldToScreen ?? new ge(l.camera, l.renderer, l.scene)), ve = we?.worldToScreenIfVisible?.(Y) ?? we?.worldToScreen?.(Y);
2061
2061
  if (!ve || !Number.isFinite(ve.x) || !Number.isFinite(ve.y) || ve.x < 0 || ve.y < 0 || ve.x > E.clientWidth || ve.y > E.clientHeight) {
2062
2062
  k();
2063
2063
  return;
2064
2064
  }
2065
- const Le = L.width / n, nt = Math.min(
2065
+ const Le = B.width / n, nt = Math.min(
2066
2066
  window.innerWidth - n / 2 - 8,
2067
2067
  Math.max(n / 2 + 8, M.clientX)
2068
2068
  ), be = Math.min(
2069
2069
  window.innerHeight - n - 8,
2070
2070
  Math.max(8, M.clientY - o)
2071
2071
  );
2072
- L.style.left = `${nt - n / 2}px`, L.style.top = `${be}px`, L.style.display = "block";
2072
+ B.style.left = `${nt - n / 2}px`, B.style.top = `${be}px`, B.style.display = "block";
2073
2073
  const Re = E.width / Math.max(1, E.clientWidth), Oe = E.height / Math.max(1, E.clientHeight), xe = s, st = Math.max(0, Math.min(E.clientWidth - xe, ve.x - xe / 2)), Fe = Math.max(0, Math.min(E.clientHeight - xe, ve.y - xe / 2));
2074
- U.save(), U.clearRect(0, 0, L.width, L.height), U.beginPath(), U.arc(L.width / 2, L.height / 2, L.width / 2, 0, Math.PI * 2), U.clip(), U.fillStyle = window.getComputedStyle(E.parentElement ?? document.body).backgroundColor || "#dfe8f2", U.fillRect(0, 0, L.width, L.height);
2074
+ U.save(), U.clearRect(0, 0, B.width, B.height), U.beginPath(), U.arc(B.width / 2, B.height / 2, B.width / 2, 0, Math.PI * 2), U.clip(), U.fillStyle = window.getComputedStyle(E.parentElement ?? document.body).backgroundColor || "#dfe8f2", U.fillRect(0, 0, B.width, B.height);
2075
2075
  try {
2076
- U.drawImage(E, st * Re, Fe * Oe, xe * Re, xe * Oe, 0, 0, L.width, L.height), j(U, E, st, Fe, xe, Le);
2076
+ U.drawImage(E, st * Re, Fe * Oe, xe * Re, xe * Oe, 0, 0, B.width, B.height), K(U, E, st, Fe, xe, Le);
2077
2077
  } catch {
2078
2078
  k(), U.restore();
2079
2079
  return;
2080
2080
  }
2081
- U.strokeStyle = "rgba(0, 255, 247, 0.9)", U.lineWidth = 1.5 * Le, U.beginPath(), U.moveTo(L.width / 2 - 10 * Le, L.height / 2), U.lineTo(L.width / 2 + 10 * Le, L.height / 2), U.moveTo(L.width / 2, L.height / 2 - 10 * Le), U.lineTo(L.width / 2, L.height / 2 + 10 * Le), U.stroke(), U.restore();
2081
+ U.strokeStyle = "rgba(0, 255, 247, 0.9)", U.lineWidth = 1.5 * Le, U.beginPath(), U.moveTo(B.width / 2 - 10 * Le, B.height / 2), U.lineTo(B.width / 2 + 10 * Le, B.height / 2), U.moveTo(B.width / 2, B.height / 2 - 10 * Le), U.lineTo(B.width / 2, B.height / 2 + 10 * Le), U.stroke(), U.restore();
2082
2082
  }
2083
- function Q(M, E = !1, L = !1, U = !0) {
2083
+ function Q(M, E = !1, B = !1, U = !0) {
2084
2084
  const Y = p(M);
2085
2085
  if (M.raycaster = Y, E) {
2086
- const we = K(Y, M, L, U);
2086
+ const we = j(Y, M, B, U);
2087
2087
  M.catch = we;
2088
2088
  }
2089
2089
  }
@@ -2099,10 +2099,10 @@ function Hi(l) {
2099
2099
  function le(M) {
2100
2100
  if (v(M))
2101
2101
  return;
2102
- const E = Date.now(), L = E - e.mouseDownTime, U = new d(M.offsetX, M.offsetY, 0);
2102
+ const E = Date.now(), B = E - e.mouseDownTime, U = new d(M.offsetX, M.offsetY, 0);
2103
2103
  e.self && e.self.handleMouseUp != null && M.button == 0 && (Q(M, !1, !1, !1), e.self.handleMouseUp(M));
2104
2104
  const Y = U.distanceTo(e.mouseDownPosition);
2105
- (L < 100 || Y == 0) && e.self && e.self.handleMouseClick != null && (Q(M, !0, !0, !1), E - e.lastClickTime < 200 ? e.self.handleMouseDoubleClick != null && M.button == 0 && e.self.handleMouseDoubleClick(M) : e.self.handleMouseClick != null && M.button == 0 ? e.self.handleMouseClick(M) : e.self.handleRightMouseClick != null && M.button == 2 && e.self.handleRightMouseClick(M), e.lastClickTime = Date.now());
2105
+ (B < 100 || Y == 0) && e.self && e.self.handleMouseClick != null && (Q(M, !0, !0, !1), E - e.lastClickTime < 200 ? e.self.handleMouseDoubleClick != null && M.button == 0 && e.self.handleMouseDoubleClick(M) : e.self.handleMouseClick != null && M.button == 0 ? e.self.handleMouseClick(M) : e.self.handleRightMouseClick != null && M.button == 2 && e.self.handleRightMouseClick(M), e.lastClickTime = Date.now());
2106
2106
  }
2107
2107
  function fe(M) {
2108
2108
  const E = M.touches[0] || M.changedTouches[0];
@@ -2123,10 +2123,10 @@ function Hi(l) {
2123
2123
  };
2124
2124
  }
2125
2125
  function Ae(M) {
2126
- const L = l.renderer.domElement.getBoundingClientRect();
2126
+ const B = l.renderer.domElement.getBoundingClientRect();
2127
2127
  return {
2128
- offsetX: M.clientX - L.left,
2129
- offsetY: M.clientY - L.top,
2128
+ offsetX: M.clientX - B.left,
2129
+ offsetY: M.clientY - B.top,
2130
2130
  button: M.button ?? 0,
2131
2131
  clientX: M.clientX,
2132
2132
  clientY: M.clientY,
@@ -2135,19 +2135,19 @@ function Hi(l) {
2135
2135
  originalEvent: M
2136
2136
  };
2137
2137
  }
2138
- function x(M, E, L, U = null) {
2139
- m(), e.touchInputMode = L, e.touchPointerId = U, e.touchLatestEvent = M, e.touchStartPosition = E, e.touchLongPressTimer = window.setTimeout(() => {
2138
+ function w(M, E, B, U = null) {
2139
+ m(), e.touchInputMode = B, e.touchPointerId = U, e.touchLatestEvent = M, e.touchStartPosition = E, e.touchLongPressTimer = window.setTimeout(() => {
2140
2140
  const Y = e.touchLatestEvent;
2141
2141
  Y && (e.touchLongPressActive = !0, A(), e.mouseDownTime = Date.now(), e.mouseDownPosition = new d(Y.offsetX, Y.offsetY, 0), e.self?.handleMouseMove != null && (Q(Y, !0, !0, e.isClickSimpleModel), e.self.handleMouseMove(Y)), te(Y));
2142
2142
  }, t);
2143
2143
  }
2144
2144
  function y(M, E) {
2145
2145
  e.touchLatestEvent = M;
2146
- const L = e.touchStartPosition;
2147
- !e.touchLongPressActive && L && E && L.distanceTo(E) > i && w(), e.touchLongPressActive && (e.self?.handleMouseMove != null && (Q(M, !0, !0, e.isClickSimpleModel), e.self.handleMouseMove(M)), te(M));
2146
+ const B = e.touchStartPosition;
2147
+ !e.touchLongPressActive && B && E && B.distanceTo(E) > i && x(), e.touchLongPressActive && (e.self?.handleMouseMove != null && (Q(M, !0, !0, e.isClickSimpleModel), e.self.handleMouseMove(M)), te(M));
2148
2148
  }
2149
2149
  function C(M) {
2150
- w(), e.touchLongPressActive && (Q(M, !0, !0, e.isClickSimpleModel), e.self?.handleMouseClick != null && e.self.handleMouseClick(M), e.self?.handleMouseUp != null && e.self.handleMouseUp(M)), m();
2150
+ x(), e.touchLongPressActive && (Q(M, !0, !0, e.isClickSimpleModel), e.self?.handleMouseClick != null && e.self.handleMouseClick(M), e.self?.handleMouseUp != null && e.self.handleMouseUp(M)), m();
2151
2151
  }
2152
2152
  function _(M) {
2153
2153
  if (M.preventDefault(), M.touches.length !== 1) {
@@ -2157,7 +2157,7 @@ function Hi(l) {
2157
2157
  const E = fe(M);
2158
2158
  if (E) {
2159
2159
  if (f()) {
2160
- x(E, T(M) ?? new G(E.clientX, E.clientY), "touch");
2160
+ w(E, T(M) ?? new W(E.clientX, E.clientY), "touch");
2161
2161
  return;
2162
2162
  }
2163
2163
  ce(E);
@@ -2192,23 +2192,23 @@ function Hi(l) {
2192
2192
  if (M.pointerType !== "touch" || !f() || M.isPrimary === !1)
2193
2193
  return;
2194
2194
  const E = Ae(M);
2195
- x(E, new G(M.clientX, M.clientY), "pointer", M.pointerId);
2195
+ w(E, new W(M.clientX, M.clientY), "pointer", M.pointerId);
2196
2196
  }
2197
- function W(M) {
2198
- M.pointerType !== "touch" || !f() || (e.touchLongPressActive && b(M), e.touchInputMode === "pointer" && (e.touchPointerId != null && M.pointerId !== e.touchPointerId || y(Ae(M), new G(M.clientX, M.clientY))));
2197
+ function G(M) {
2198
+ M.pointerType !== "touch" || !f() || (e.touchLongPressActive && b(M), e.touchInputMode === "pointer" && (e.touchPointerId != null && M.pointerId !== e.touchPointerId || y(Ae(M), new W(M.clientX, M.clientY))));
2199
2199
  }
2200
2200
  function q(M) {
2201
2201
  M.pointerType !== "touch" || !f() || (e.touchLongPressActive && b(M), e.touchInputMode === "pointer" && (e.touchPointerId != null && M.pointerId !== e.touchPointerId || C(Ae(M))));
2202
2202
  }
2203
- function K(M, E, L = !1, U = !0) {
2204
- if (!l.engineStatus.isFree && L == !1) {
2203
+ function j(M, E, B = !1, U = !0) {
2204
+ if (!l.engineStatus.isFree && B == !1) {
2205
2205
  l.hoverHighLight.clearHighlight();
2206
2206
  return;
2207
2207
  }
2208
2208
  if (l.engineStatus.editorMode == "simple")
2209
2209
  return;
2210
2210
  l.catchSvg.innerHTML = "";
2211
- let Y = l.octreeBox.rayInterationModel(M, L, U);
2211
+ let Y = l.octreeBox.rayInterationModel(M, B, U);
2212
2212
  if (Y = l.clipping?.filterIntersectionsByClipping(Y) ?? Y, Y.length !== 0)
2213
2213
  return e.options.showCatch ? r.applySnapPreview(Y[0], E, e.lastPoint) : Y[0];
2214
2214
  }
@@ -2475,8 +2475,8 @@ class qo {
2475
2475
  }
2476
2476
  bindMovePad(e) {
2477
2477
  const t = e.querySelector(".bim-mobile-roam-move-knob"), i = (s) => {
2478
- const o = e.getBoundingClientRect(), r = Math.min(o.width, o.height) * 0.5, a = r * 0.48, c = r * 0.22, h = s.clientX - o.left - r, u = s.clientY - o.top - r, p = Math.hypot(h, u), g = Math.min(p, a), f = p > a ? a / p : 1, v = h * f, w = u * f;
2479
- t && (t.style.transform = `translate(${v}px, ${w}px)`);
2478
+ const o = e.getBoundingClientRect(), r = Math.min(o.width, o.height) * 0.5, a = r * 0.48, c = r * 0.22, h = s.clientX - o.left - r, u = s.clientY - o.top - r, p = Math.hypot(h, u), g = Math.min(p, a), f = p > a ? a / p : 1, v = h * f, x = u * f;
2479
+ t && (t.style.transform = `translate(${v}px, ${x}px)`);
2480
2480
  const m = [];
2481
2481
  u < -c ? m.push("w") : u > c && m.push("s"), h < -c ? m.push("a") : h > c && m.push("d"), this.mobileMoveIntensity = m.length === 0 ? 0 : Math.max(0, Math.min(1, (g - c) / (a - c))), this.updateMobileMoveKeys(m);
2482
2482
  };
@@ -2708,22 +2708,22 @@ function Tt(l) {
2708
2708
  l.name = t, l.guid = i;
2709
2709
  }
2710
2710
  function Yo(l, e, t, i) {
2711
- const r = l.models.find((w) => w.url == t);
2711
+ const r = l.models.find((x) => x.url == t);
2712
2712
  if (r == null)
2713
2713
  return;
2714
- const a = it(l, t), c = [], h = e.circularMeps, u = e.rectMeps?.filter((w) => w.type === "风管"), p = e.rectMeps?.filter((w) => w.type === "桥架"), g = e.ellipseMeps, f = (w) => (w.color = w.color.split(",").map((m) => parseInt(m) / 255), w.color = new Me().setRGB(w.color[0], w.color[1], w.color[2], je), w.position = {
2715
- x: w.startPoint.X * 0.3048 + 0,
2716
- y: w.startPoint.Z * 0.3048 + 0,
2717
- z: -w.startPoint.Y * 0.3048 + 0
2718
- }, w.rotation = { x: 0, y: 0, z: 0 }, w), v = (w, m) => {
2714
+ const a = it(l, t), c = [], h = e.circularMeps, u = e.rectMeps?.filter((x) => x.type === "风管"), p = e.rectMeps?.filter((x) => x.type === "桥架"), g = e.ellipseMeps, f = (x) => (x.color = x.color.split(",").map((m) => parseInt(m) / 255), x.color = new Me().setRGB(x.color[0], x.color[1], x.color[2], je), x.position = {
2715
+ x: x.startPoint.X * 0.3048 + 0,
2716
+ y: x.startPoint.Z * 0.3048 + 0,
2717
+ z: -x.startPoint.Y * 0.3048 + 0
2718
+ }, x.rotation = { x: 0, y: 0, z: 0 }, x), v = (x, m) => {
2719
2719
  if (!Array.isArray(m) || m.length === 0)
2720
2720
  return;
2721
- const b = m.map((S) => f(S)), A = Qo(w, a, b, t, l);
2721
+ const b = m.map((S) => f(S)), A = Qo(x, a, b, t, l);
2722
2722
  A != null && b.forEach((S, I) => {
2723
2723
  const T = [[A, I, 0, 0]];
2724
2724
  S.indexes = T, S.id = Number(S.id);
2725
- const B = { ...S, instance: !0, info: S, infos: [S], indexes: T };
2726
- Tt(B), r.nodesMap.set(Number(S.id), B), c.push(Number(S.id));
2725
+ const L = { ...S, instance: !0, info: S, infos: [S], indexes: T };
2726
+ Tt(L), r.nodesMap.set(Number(S.id), L), c.push(Number(S.id));
2727
2727
  });
2728
2728
  };
2729
2729
  v("Circle", h), v("Rect", u), v("Ellipse", g), v("Bridge", p), Xo(r, c);
@@ -2773,19 +2773,19 @@ function Qo(l, e, t, i, n) {
2773
2773
  Ni(r, a), r.geometry.getAttribute("normal") == null && r.geometry.computeVertexNormals(), r.geometry.computeBoundingBox();
2774
2774
  const c = r.geometry.boundingBox?.clone() ?? null, h = [], u = [];
2775
2775
  for (let g = 0; g < t.length; g++) {
2776
- const f = t[g], v = new d(f.startPoint.X, 0, -f.startPoint.Y), w = new d(f.endPoint.X, 0, -f.endPoint.Y), m = new d(f.startPoint.X, f.startPoint.Z, -f.startPoint.Y), b = new d(f.endPoint.X, f.endPoint.Z, -f.endPoint.Y);
2776
+ const f = t[g], v = new d(f.startPoint.X, 0, -f.startPoint.Y), x = new d(f.endPoint.X, 0, -f.endPoint.Y), m = new d(f.startPoint.X, f.startPoint.Z, -f.startPoint.Y), b = new d(f.endPoint.X, f.endPoint.Z, -f.endPoint.Y);
2777
2777
  let A = 0, S = 0, I = 0;
2778
- if (Math.abs(w.clone().sub(v.clone()).z) < 0.01 && Math.abs(w.clone().sub(v.clone()).x) < 0.01) {
2778
+ if (Math.abs(x.clone().sub(v.clone()).z) < 0.01 && Math.abs(x.clone().sub(v.clone()).x) < 0.01) {
2779
2779
  if (A = (f.startPoint.Z > f.endPoint.Z ? 1 : -1) * Math.PI * 0.5, f.base_x != null) {
2780
- const x = new d(f.base_x.X, 0, -f.base_x.Y);
2781
- S = (x.clone().cross(new d(0, 0, 1)).y <= 0 ? 1 : -1) * x.angleTo(new d(0, 0, 1)) + Math.PI * 0.5;
2780
+ const w = new d(f.base_x.X, 0, -f.base_x.Y);
2781
+ S = (w.clone().cross(new d(0, 0, 1)).y <= 0 ? 1 : -1) * w.angleTo(new d(0, 0, 1)) + Math.PI * 0.5;
2782
2782
  }
2783
2783
  } else
2784
- S = (w.clone().sub(v.clone()).cross(new d(0, 0, 1)).y > 0 ? -1 : 1) * w.clone().sub(v.clone()).angleTo(new d(0, 0, 1)), A = (f.startPoint.Z > f.endPoint.Z ? 1 : -1) * w.clone().sub(v.clone()).angleTo(b.clone().sub(m.clone()));
2785
- const T = new H(), B = new Ze(A, S, I, "YXZ"), k = T.clone().makeRotationFromEuler(B);
2786
- let N, j;
2787
- l === "Circle" ? (N = f.diameter, j = f.diameter) : (N = f.width, j = f.height);
2788
- const te = T.clone().makeScale(N, j, f.length);
2784
+ S = (x.clone().sub(v.clone()).cross(new d(0, 0, 1)).y > 0 ? -1 : 1) * x.clone().sub(v.clone()).angleTo(new d(0, 0, 1)), A = (f.startPoint.Z > f.endPoint.Z ? 1 : -1) * x.clone().sub(v.clone()).angleTo(b.clone().sub(m.clone()));
2785
+ const T = new H(), L = new Ze(A, S, I, "YXZ"), k = T.clone().makeRotationFromEuler(L);
2786
+ let N, K;
2787
+ l === "Circle" ? (N = f.diameter, K = f.diameter) : (N = f.width, K = f.height);
2788
+ const te = T.clone().makeScale(N, K, f.length);
2789
2789
  T.multiplyMatrices(k, te), T.setPosition(f.position.x, f.position.y, f.position.z), r.setMatrixAt(g, T.clone()), r.setColorAt(g, f.color);
2790
2790
  const Q = c?.clone().applyMatrix4(T) ?? new R(), ce = Q.min.clone(), ae = Q.max.clone(), le = Q.getCenter(new d());
2791
2791
  f.box = Q.clone();
@@ -3059,28 +3059,28 @@ async function Sr(l, e, t, i) {
3059
3059
  return [];
3060
3060
  const s = l.filterLoaderModel?.getContinueIdSet?.(e.url) ?? /* @__PURE__ */ new Set(), o = await Er(l, t, i);
3061
3061
  console.log("[loadLightModel] pending mesh ids", t.path, o.length);
3062
- const r = [];
3063
- let a = performance.now(), c = 0;
3064
- for (const h of o) {
3065
- if (s.has(Number(h)) || !n.nodesMap.has(h))
3062
+ const r = [], a = l?.deviceModule?.isMobile?.() !== !0;
3063
+ let c = performance.now(), h = 0;
3064
+ for (const u of o) {
3065
+ if (s.has(Number(u)) || !n.nodesMap.has(u))
3066
3066
  continue;
3067
- const u = n.nodesMap.get(h), p = Array.isArray(u?.infos) ? u.infos : [];
3068
- for (const g of p) {
3069
- const f = t.glbs?.[g.glb]?.[g.mesh];
3070
- if (f?.geometry == null || f.material == null)
3067
+ const p = n.nodesMap.get(u), g = Array.isArray(p?.infos) ? p.infos : [];
3068
+ for (const f of g) {
3069
+ const v = t.glbs?.[f.glb]?.[f.mesh];
3070
+ if (v?.geometry == null || v.material == null)
3071
3071
  continue;
3072
- const v = new H();
3073
- v.elements = g.matrix;
3074
- const w = f.geometry.clone(), m = w.getAttribute("position");
3075
- if (m == null) {
3076
- w.dispose();
3072
+ const x = new H();
3073
+ x.elements = f.matrix;
3074
+ const m = v.geometry.clone(), b = m.getAttribute("position");
3075
+ if (b == null) {
3076
+ m.dispose();
3077
3077
  continue;
3078
3078
  }
3079
- w.applyMatrix4(v), w.computeBoundingBox(), m.count > 2e4 && or(w, {
3079
+ m.applyMatrix4(x), m.computeBoundingBox(), a && b.count > 2e4 && or(m, {
3080
3080
  setBoundingSphere: !0
3081
3081
  });
3082
- const b = new z(w, f.material);
3083
- g.box = w.boundingBox?.clone(), g.mesh = b, b.name = Number(h), b.glb = g.glb, b.url = e.url, r.push(b), c++, c % ss === 0 && (a = await Xe(l, i, a));
3082
+ const A = new z(m, v.material);
3083
+ f.box = m.boundingBox?.clone(), f.mesh = A, A.name = Number(u), A.glb = f.glb, A.url = e.url, r.push(A), h++, h % ss === 0 && (c = await Xe(l, i, c));
3084
3084
  }
3085
3085
  }
3086
3086
  return r;
@@ -3132,16 +3132,16 @@ async function kr(l, e, t, i) {
3132
3132
  const p = Wr(u[0].material, e);
3133
3133
  let g = _r(e, l, r, p), f = 0, v = 0;
3134
3134
  g = null, g != null ? (f = Array.isArray(g.geometrys) ? g.geometrys.length : 0, v = hn(g.geometry), Dr(g, u)) : g = Ir(l, e, r, u, p);
3135
- const w = /* @__PURE__ */ new Map();
3135
+ const x = /* @__PURE__ */ new Map();
3136
3136
  let m = v;
3137
3137
  u.forEach((b, A) => {
3138
- const S = Number(b.name), I = hn(b.geometry), T = w.get(S) ?? [];
3139
- if (T.push([m, m + I]), w.set(S, T), s?.nodesMap?.has(S)) {
3140
- const B = s.nodesMap.get(S);
3141
- B.indexes == null && (B.indexes = []), B.indexes.push([g.index, f + A, m, m + I]);
3138
+ const S = Number(b.name), I = hn(b.geometry), T = x.get(S) ?? [];
3139
+ if (T.push([m, m + I]), x.set(S, T), s?.nodesMap?.has(S)) {
3140
+ const L = s.nodesMap.get(S);
3141
+ L.indexes == null && (L.indexes = []), L.indexes.push([g.index, f + A, m, m + I]);
3142
3142
  }
3143
3143
  m += I;
3144
- }), g.indexes == null && (g.indexes = /* @__PURE__ */ new Map()), w.forEach((b, A) => {
3144
+ }), g.indexes == null && (g.indexes = /* @__PURE__ */ new Map()), x.forEach((b, A) => {
3145
3145
  const S = g.indexes.get(A) ?? [];
3146
3146
  S.push(...b), g.indexes.set(A, S);
3147
3147
  }), e.requestComposerRender?.(), o = await Xe(e, i, o);
@@ -3172,10 +3172,10 @@ async function Br(l, e, t, i, n, s) {
3172
3172
  for (let g = 0; g < n.length; g++) {
3173
3173
  const f = n[g], v = new H();
3174
3174
  v.elements = f.matrix;
3175
- const w = Lr(i, v);
3176
- if (w != null && (f.box = w.clone()), r.setMatrixAt(g, v), r.matrixs || (r.matrixs = []), r.matrixs.push(v.clone()), p.push(v.clone()), o.nodesMap.has(f.id)) {
3175
+ const x = Lr(i, v);
3176
+ if (x != null && (f.box = x.clone()), r.setMatrixAt(g, v), r.matrixs || (r.matrixs = []), r.matrixs.push(v.clone()), p.push(v.clone()), o.nodesMap.has(f.id)) {
3177
3177
  const m = o.nodesMap.get(f.id);
3178
- m.indexes == null && (m.indexes = []), m.indexes.push([c, g, 0, 0]), Tt(m), w != null && m?.info != null && (m.info.box instanceof R ? m.info.box.union(w) : m.info.box = w.clone());
3178
+ m.indexes == null && (m.indexes = []), m.indexes.push([c, g, 0, 0]), Tt(m), x != null && m?.info != null && (m.info.box instanceof R ? m.info.box.union(x) : m.info.box = x.clone());
3179
3179
  } else {
3180
3180
  const m = {
3181
3181
  instance: !0,
@@ -3218,7 +3218,7 @@ async function Rr(l, e, t, i) {
3218
3218
  t.meshPromise = (async () => {
3219
3219
  console.log(`[loadLightModel] start build lod meshes ${Date.now() - window.startTime}ms`);
3220
3220
  const n = await Sr(l, e, t, i);
3221
- await kr(e.url, l, n, i), await zr(e, t, l, i), t.instanceNodes = null, t.status = !0, console.log(`[loadLightModel] *****************************************************finish build lod meshes ${Date.now() - window.startTime}ms`);
3221
+ await zr(e, t, l, i), t.glbs = [], await kr(e.url, l, n, i), t.instanceNodes = null, t.status = !0, console.log(`[loadLightModel] *****************************************************finish build lod meshes ${Date.now() - window.startTime}ms`);
3222
3222
  })().finally(() => {
3223
3223
  t.meshPromise = null;
3224
3224
  }), await t.meshPromise;
@@ -3244,61 +3244,61 @@ async function Or(l, e, t, i) {
3244
3244
  a.nodesMap == null && (a.nodesMap = /* @__PURE__ */ new Map());
3245
3245
  let c = performance.now();
3246
3246
  const h = Object.keys(r);
3247
- for (const v of h) {
3248
- const w = r[v];
3249
- for (let m = 0; m < w.length; m++) {
3250
- const b = w[m];
3251
- if (b.glb = v, a.nodesMap.has(b.id) === !1) {
3252
- const A = { infos: [b] };
3253
- Tt(A), a.nodesMap.set(b.id, A);
3247
+ for (const x of h) {
3248
+ const m = r[x];
3249
+ for (let b = 0; b < m.length; b++) {
3250
+ const A = m[b];
3251
+ if (A.glb = x, a.nodesMap.has(A.id) === !1) {
3252
+ const S = { infos: [A] };
3253
+ Tt(S), a.nodesMap.set(A.id, S);
3254
3254
  } else {
3255
- const A = a.nodesMap.get(b.id);
3256
- if (!A.infos)
3255
+ const S = a.nodesMap.get(A.id);
3256
+ if (!S.infos)
3257
3257
  continue;
3258
- A.infos.push(b), Tt(A);
3258
+ S.infos.push(A), Tt(S);
3259
3259
  }
3260
- (m + 1) % ss === 0 && (c = await Xe(l, i, c));
3260
+ (b + 1) % ss === 0 && (c = await Xe(l, i, c));
3261
3261
  }
3262
3262
  }
3263
- const u = async (v) => {
3264
- let w = await wr(s, [`/${v}.glb`, `${v}.glb`, v + ".glb"]);
3265
- if (w == null) {
3263
+ const u = async (x) => {
3264
+ let m = await wr(s, [`/${x}.glb`, `${x}.glb`, x + ".glb"]);
3265
+ if (m == null) {
3266
3266
  console.error("[loadLightModel] glb not found in zip", {
3267
3267
  modelUrl: e.url,
3268
3268
  lodPath: t.path,
3269
- glbKey: `${v}.glb`,
3269
+ glbKey: `${x}.glb`,
3270
3270
  availableFiles: Object.keys(s.files)
3271
3271
  });
3272
3272
  return;
3273
3273
  }
3274
3274
  try {
3275
- const m = await br(l, w);
3276
- w = null, t.glbs[v] = m.scene.children, t.glbs[v].forEach((b) => {
3277
- b.matrixWorld;
3278
- }), await Ar(l, t.glbs[v], i);
3279
- } catch (m) {
3275
+ const b = await br(l, m);
3276
+ m = null, t.glbs[x] = b.scene.children, t.glbs[x].forEach((A) => {
3277
+ A.matrixWorld;
3278
+ }), await Ar(l, t.glbs[x], i);
3279
+ } catch (b) {
3280
3280
  console.error("[loadLightModel] failed to load glb", {
3281
3281
  modelUrl: e.url,
3282
3282
  lodPath: t.path,
3283
- glbKey: `${v}.glb`,
3283
+ glbKey: `${x}.glb`,
3284
3284
  dracoDecoderPath: os(),
3285
3285
  basisTranscoderPath: rs(),
3286
- error: m
3286
+ error: b
3287
3287
  });
3288
3288
  } finally {
3289
- w = null;
3289
+ m = null;
3290
3290
  }
3291
3291
  };
3292
3292
  let p = 0;
3293
- const g = Math.min(hr, h.length);
3294
- await Promise.all(Array.from({ length: g }, async () => {
3293
+ const g = l?.deviceModule?.isMobile?.() === !0 ? 1 : hr, f = Math.min(g, h.length);
3294
+ await Promise.all(Array.from({ length: f }, async () => {
3295
3295
  for (; p < h.length; ) {
3296
- const v = h[p++];
3297
- await u(v);
3296
+ const x = h[p++];
3297
+ await u(x);
3298
3298
  }
3299
3299
  })), console.log(`[loadLightModel] 所有 GLB 加载完成 ${Date.now() - window.startTime}ms`);
3300
- const f = await cn(s, ["/instances.json", "instances.json"]);
3301
- t.instanceNodes = f != null ? Zt(f) : null, t.loadSuccess = !0;
3300
+ const v = await cn(s, ["/instances.json", "instances.json"]);
3301
+ t.instanceNodes = v != null ? Zt(v) : null, t.loadSuccess = !0;
3302
3302
  })().finally(() => {
3303
3303
  t.preparePromise = null;
3304
3304
  }), await t.preparePromise;
@@ -3317,8 +3317,8 @@ function Fr(l, e, t) {
3317
3317
  const p = o.clone().sub(u).dot(h);
3318
3318
  if (p <= 0)
3319
3319
  return 0;
3320
- const g = u.clone().add(h.multiplyScalar(Math.max(p, r))), f = g.clone().add(a.setLength(t.maxSize)), v = new ge(e, l.renderer, l.scene).worldToScreen(g), w = new ge(e, l.renderer, l.scene).worldToScreen(f);
3321
- return v.distanceTo(w);
3320
+ const g = u.clone().add(h.multiplyScalar(Math.max(p, r))), f = g.clone().add(a.setLength(t.maxSize)), v = new ge(e, l.renderer, l.scene).worldToScreen(g), x = new ge(e, l.renderer, l.scene).worldToScreen(f);
3321
+ return v.distanceTo(x);
3322
3322
  }
3323
3323
  async function Nr(l, e, t, i) {
3324
3324
  t.maxSize < 1e6 && t.path != "/lod0" && (!(Fr(l, l.camera, t) >= dr) || t.status === !0) || (await Or(l, e, t, i), t.loadSuccess === !0 && await Rr(l, e, t, i));
@@ -3810,7 +3810,7 @@ class Ma {
3810
3810
  * 初始化场景基础光照,并把投影灯引用挂到 scene 上供后续更新使用。
3811
3811
  */
3812
3812
  init() {
3813
- const e = new qe(16774630, 5);
3813
+ const e = new qe(16774630, 2);
3814
3814
  e.name = "directionalShadowLight", e.castShadow = !0, e.shadow.mapSize.width = mn, e.shadow.mapSize.height = mn, e.shadow.camera.near = hi, e.shadow.camera.far = di, e.shadow.bias = -Mn, e.shadow.normalBias = yn;
3815
3815
  const t = ci;
3816
3816
  e.shadow.camera.left = -t, e.shadow.camera.right = t, e.shadow.camera.top = t, e.shadow.camera.bottom = -t, e.shadow.radius = 2, e.shadow.intensity = xt, e.target.name = "directionalShadowLightTarget";
@@ -3863,16 +3863,16 @@ class Ma {
3863
3863
  g,
3864
3864
  u,
3865
3865
  t.shadow.mapSize.width
3866
- ), w = f.clone().add(
3866
+ ), x = f.clone().add(
3867
3867
  g.clone().multiplyScalar(p)
3868
3868
  ), m = this.getShadowDepthRange(
3869
3869
  n,
3870
- w,
3870
+ x,
3871
3871
  f,
3872
3872
  o,
3873
3873
  u
3874
- ), b = Math.abs(u - this.lastShadowHalfSize) > 0.5, A = Math.abs(m.near - this.lastShadowNear) > 1, S = Math.abs(m.far - this.lastShadowFar) > 1, I = w.distanceToSquared(this.lastLightPosition) > 0.25, T = f.distanceToSquared(this.lastLightTarget) > 0.25, B = Math.abs(v - this.lastShadowIntensity) > 0.01;
3875
- !b && !A && !S && !I && !T && !B || (t.position.copy(w), t.target.position.copy(f), t.target.updateMatrixWorld(!0), t.updateMatrixWorld(!0), i.left = -u, i.right = u, i.top = u, i.bottom = -u, i.near = m.near, i.far = m.far, i.updateProjectionMatrix(), this.updateShadowBias(t, u, m), t.shadow.intensity = v, t.shadow.needsUpdate = !0, this.lastShadowHalfSize = u, this.lastShadowNear = m.near, this.lastShadowFar = m.far, this.lastLightPosition.copy(w), this.lastLightTarget.copy(f), this.lastShadowIntensity = v);
3874
+ ), b = Math.abs(u - this.lastShadowHalfSize) > 0.5, A = Math.abs(m.near - this.lastShadowNear) > 1, S = Math.abs(m.far - this.lastShadowFar) > 1, I = x.distanceToSquared(this.lastLightPosition) > 0.25, T = f.distanceToSquared(this.lastLightTarget) > 0.25, L = Math.abs(v - this.lastShadowIntensity) > 0.01;
3875
+ !b && !A && !S && !I && !T && !L || (t.position.copy(x), t.target.position.copy(f), t.target.updateMatrixWorld(!0), t.updateMatrixWorld(!0), i.left = -u, i.right = u, i.top = u, i.bottom = -u, i.near = m.near, i.far = m.far, i.updateProjectionMatrix(), this.updateShadowBias(t, u, m), t.shadow.intensity = v, t.shadow.needsUpdate = !0, this.lastShadowHalfSize = u, this.lastShadowNear = m.near, this.lastShadowFar = m.far, this.lastLightPosition.copy(x), this.lastLightTarget.copy(f), this.lastShadowIntensity = v);
3876
3876
  }
3877
3877
  /**
3878
3878
  * 计算场景范围对阴影相机半边长的贡献。
@@ -4169,8 +4169,8 @@ class va {
4169
4169
  timeOutEvent;
4170
4170
  selectionBox = null;
4171
4171
  isBoxSelecting = !1;
4172
- selectionStart = new G();
4173
- selectionEnd = new G();
4172
+ selectionStart = new W();
4173
+ selectionEnd = new W();
4174
4174
  suppressClickOnce = !1;
4175
4175
  selectionThreshold = 5;
4176
4176
  tempInstanceMatrix = new H();
@@ -4314,8 +4314,8 @@ class va {
4314
4314
  let g = h.clone().sub(c).normalize();
4315
4315
  h = h.clone().sub(g.clone().setLength(0.5));
4316
4316
  const f = () => {
4317
- const v = performance.now() - p, w = Math.min(v / u, 1), m = w < 0.5 ? 2 * w * w : 1 - Math.pow(-2 * w + 2, 2) / 2;
4318
- a.position.lerpVectors(c, h, m), w < 1 ? requestAnimationFrame(f) : this.engine.controlModule.firstPersonControls.setCameraHeight(a.position.y);
4317
+ const v = performance.now() - p, x = Math.min(v / u, 1), m = x < 0.5 ? 2 * x * x : 1 - Math.pow(-2 * x + 2, 2) / 2;
4318
+ a.position.lerpVectors(c, h, m), x < 1 ? requestAnimationFrame(f) : this.engine.controlModule.firstPersonControls.setCameraHeight(a.position.y);
4319
4319
  };
4320
4320
  this.clearModelHighlightBeforeCameraFlight(), requestAnimationFrame(f);
4321
4321
  return;
@@ -4665,13 +4665,13 @@ class xa {
4665
4665
  );
4666
4666
  const v = new Ct(f.x, f.y, f.z);
4667
4667
  v.translate(g.x, g.y, g.z), v.computeBoundingBox();
4668
- const w = new z(v, this.pickBoxMaterial);
4669
- w.name = c, w.url = o.url, w.castShadow = !1, w.receiveShadow = !1, w.userData.excludeFromAmbientOcclusion = !0, w.userData.__pickBox = !0, r.add(w), Array.isArray(a.infos) || (a.infos = a.info != null ? [a.info] : []), a.infos.push({
4668
+ const x = new z(v, this.pickBoxMaterial);
4669
+ x.name = c, x.url = o.url, x.castShadow = !1, x.receiveShadow = !1, x.userData.excludeFromAmbientOcclusion = !0, x.userData.__pickBox = !0, r.add(x), Array.isArray(a.infos) || (a.infos = a.info != null ? [a.info] : []), a.infos.push({
4670
4670
  id: c,
4671
4671
  name: h,
4672
- mesh: w,
4672
+ mesh: x,
4673
4673
  isPickBox: !0
4674
- }), a.pickBoxMesh = w, s += 1;
4674
+ }), a.pickBoxMesh = x, s += 1;
4675
4675
  });
4676
4676
  }), s;
4677
4677
  }
@@ -5779,22 +5779,22 @@ function Pa(l, e, t) {
5779
5779
  let n = null, s = 0, o, r, a = [];
5780
5780
  const c = 120;
5781
5781
  function h() {
5782
- const x = Math.max(1, o?.clientWidth || c), y = Math.max(1, o?.clientHeight || c);
5783
- return { width: x, height: y };
5782
+ const w = Math.max(1, o?.clientWidth || c), y = Math.max(1, o?.clientHeight || c);
5783
+ return { width: w, height: y };
5784
5784
  }
5785
5785
  function u() {
5786
- const x = i.sceneOrtho?.renderer;
5787
- if (!x || !i.camera)
5786
+ const w = i.sceneOrtho?.renderer;
5787
+ if (!w || !i.camera)
5788
5788
  return;
5789
- const { width: y, height: C } = h(), _ = x.getSize(new G());
5789
+ const { width: y, height: C } = h(), _ = w.getSize(new W());
5790
5790
  if (_.x !== y || _.y !== C) {
5791
- x.setSize(y, C);
5791
+ w.setSize(y, C);
5792
5792
  const D = y > C ? y / C : C / y, P = 300;
5793
5793
  i.camera.left = P * D / -2, i.camera.right = P * D / 2, i.camera.top = P / 2, i.camera.bottom = P / -2, i.camera.updateProjectionMatrix();
5794
5794
  }
5795
5795
  }
5796
5796
  i.init = function() {
5797
- o || (B(), k(), i.ready = le());
5797
+ o || (L(), k(), i.ready = le());
5798
5798
  }, i.Hide = function() {
5799
5799
  o.style.display = "none", i.visible = !1;
5800
5800
  }, i.Show = function() {
@@ -5809,68 +5809,68 @@ function Pa(l, e, t) {
5809
5809
  function f() {
5810
5810
  s <= 0 || (s -= 1, !(s > 0) && (l.renderer && (l.renderer.interactionActive = !1), l.setIdleFrameRateExempt?.("view-cube-animation", !1), l.events?.trigger?.("engine-free"), t?.style && (t.style.cursor = "default")));
5811
5811
  }
5812
- function v(x, y, C) {
5813
- !C || !x || (x.up.copy(C), y && (y._referenceUp?.copy && y._referenceUp.copy(C).normalize(), y.up0?.copy && y.up0.copy(C), y._lastUp?.copy && y._lastUp.copy(C)));
5812
+ function v(w, y, C) {
5813
+ !C || !w || (w.up.copy(C), y && (y._referenceUp?.copy && y._referenceUp.copy(C).normalize(), y.up0?.copy && y.up0.copy(C), y._lastUp?.copy && y._lastUp.copy(C)));
5814
5814
  }
5815
- function w(x) {
5816
- v(e.camera, l.controls, x);
5815
+ function x(w) {
5816
+ v(e.camera, l.controls, w);
5817
5817
  }
5818
- function m(x) {
5819
- v(i.camera, i.orbitControls, x);
5818
+ function m(w) {
5819
+ v(i.camera, i.orbitControls, w);
5820
5820
  }
5821
- function b(x, y) {
5822
- !x || !y || (x._referenceUp?.copy && y._referenceUp && x._referenceUp.copy(y._referenceUp).normalize(), x._viewRight?.copy && y._viewRight && x._viewRight.copy(y._viewRight).normalize());
5821
+ function b(w, y) {
5822
+ !w || !y || (w._referenceUp?.copy && y._referenceUp && w._referenceUp.copy(y._referenceUp).normalize(), w._viewRight?.copy && y._viewRight && w._viewRight.copy(y._viewRight).normalize());
5823
5823
  }
5824
5824
  function A() {
5825
5825
  if (!i.camera || !e.camera)
5826
5826
  return;
5827
5827
  i.camera.quaternion.copy(e.camera.quaternion), i.camera.up.copy(e.camera.up);
5828
- const x = new d(0, 0, 1).applyQuaternion(e.camera.quaternion);
5829
- i.camera.position.copy(x.multiplyScalar(100)), b(i.orbitControls, l.controls);
5828
+ const w = new d(0, 0, 1).applyQuaternion(e.camera.quaternion);
5829
+ i.camera.position.copy(w.multiplyScalar(100)), b(i.orbitControls, l.controls);
5830
5830
  }
5831
5831
  function S() {
5832
5832
  !i.camera || !e.camera || (e.camera.quaternion.copy(i.camera.quaternion), e.camera.up.copy(i.camera.up), b(l.controls, i.orbitControls));
5833
5833
  }
5834
- function I(x, y) {
5835
- if (!x || !y)
5834
+ function I(w, y) {
5835
+ if (!w || !y)
5836
5836
  return;
5837
- const C = y.target, _ = C?.clone?.().sub(x.position), D = x.up.clone().normalize();
5837
+ const C = y.target, _ = C?.clone?.().sub(w.position), D = w.up.clone().normalize();
5838
5838
  if (y._referenceUp?.copy && y._referenceUp.copy(D), _?.lengthSq?.() > 1e-6 && y._viewRight?.copy) {
5839
5839
  const P = new d().crossVectors(_.clone().normalize(), D);
5840
- P.lengthSq() > 1e-6 ? y._viewRight.copy(P.normalize()) : y._viewRight.set(1, 0, 0).applyQuaternion(x.quaternion).normalize();
5840
+ P.lengthSq() > 1e-6 ? y._viewRight.copy(P.normalize()) : y._viewRight.set(1, 0, 0).applyQuaternion(w.quaternion).normalize();
5841
5841
  }
5842
- y._rotateVelocity?.set?.(0, 0), y._panVelocity?.set?.(0, 0), typeof y._zoomVelocity == "number" && (y._zoomVelocity = 0), y._mouseStart?.set?.(0, 0), y._touchCenter?.set?.(0, 0), typeof y._touchDistance == "number" && (y._touchDistance = 0), y._pointers?.clear?.(), y._isInteracting = !1, y.state = -1, y._lastPosition?.copy?.(x.position), y._lastTarget?.copy?.(C), y._lastUp?.copy?.(x.up), y._lastQuaternion?.copy?.(x.quaternion), typeof y._lastZoom == "number" && (y._lastZoom = x.zoom), y.saveState?.();
5842
+ y._rotateVelocity?.set?.(0, 0), y._panVelocity?.set?.(0, 0), typeof y._zoomVelocity == "number" && (y._zoomVelocity = 0), y._mouseStart?.set?.(0, 0), y._touchCenter?.set?.(0, 0), typeof y._touchDistance == "number" && (y._touchDistance = 0), y._pointers?.clear?.(), y._isInteracting = !1, y.state = -1, y._lastPosition?.copy?.(w.position), y._lastTarget?.copy?.(C), y._lastUp?.copy?.(w.up), y._lastQuaternion?.copy?.(w.quaternion), typeof y._lastZoom == "number" && (y._lastZoom = w.zoom), y.saveState?.();
5843
5843
  }
5844
5844
  i.RenderScene = function() {
5845
5845
  if (u(), N)
5846
5846
  i.orbitControls && i.orbitControls.update();
5847
5847
  else {
5848
5848
  i.camera.quaternion.copy(e.camera.quaternion), A();
5849
- const x = new d(0, 0, 1).applyQuaternion(e.camera.quaternion);
5850
- i.camera.position.copy(x.multiplyScalar(100));
5849
+ const w = new d(0, 0, 1).applyQuaternion(e.camera.quaternion);
5850
+ i.camera.position.copy(w.multiplyScalar(100));
5851
5851
  }
5852
5852
  i.sceneOrtho.renderer.render(i.sceneOrtho, i.camera);
5853
- }, i.ToggleDirectionView = function(x) {
5853
+ }, i.ToggleDirectionView = function(w) {
5854
5854
  p();
5855
5855
  var y = new d(0, 0, 0), C = null;
5856
- x == "top" ? (y = new d(0, 1, 0), C = new d(0, 0, -1)) : x == "down" || x == "button" ? (y = new d(0, -1, 0), C = new d(0, 0, 1)) : x == "front" ? y = new d(0, 0, 1) : x == "left" ? y = new d(-1, 0, 0) : x == "back" ? y = new d(0, 0, -1) : x == "right" ? y = new d(1, 0, 0) : x == "top_front" ? y = new d(1, 1, 0) : x == "top_left" ? y = new d(0, 1, -1) : x == "top_back" ? y = new d(-1, 1, 0) : x == "top_right" ? y = new d(0, 1, 1) : x == "down_front" ? y = new d(1, -1, 0) : x == "down_left" ? y = new d(0, -1, -1) : x == "down_back" ? y = new d(-1, -1, 0) : x == "down_right" ? y = new d(0, -1, 1) : x == "front_right" ? y = new d(1, 0, 1) : x == "right_back" ? y = new d(-1, 0, 1) : x == "back_left" ? y = new d(-1, 0, -1) : x == "left_front" ? y = new d(1, 0, -1) : x == "top_left_front" ? y = new d(1, 1, -1) : x == "top_front_right" ? y = new d(1, 1, 1) : x == "top_right_back" ? y = new d(-1, 1, 1) : x == "top_back_left" ? y = new d(-1, 1, -1) : x == "button_left_front" ? y = new d(1, -1, -1) : x == "button_front_right" ? y = new d(1, -1, 1) : x == "button_right_back" ? y = new d(-1, 1, 1) : x == "button_back_left" && (y = new d(-1, -1, -1));
5857
- var _ = l.octreeBox.getBoundingBox(), D = _.min, P = _.max, F = D.clone().add(P.clone()).multiplyScalar(0.5), W = F.clone().add(y.multiplyScalar(1 * P.distanceTo(D)));
5858
- T(e.camera.position, W, l.controls.target.clone(), F, null, null, 1e3, null, C);
5856
+ w == "top" ? (y = new d(0, 1, 0), C = new d(0, 0, -1)) : w == "down" || w == "button" ? (y = new d(0, -1, 0), C = new d(0, 0, 1)) : w == "front" ? y = new d(0, 0, 1) : w == "left" ? y = new d(-1, 0, 0) : w == "back" ? y = new d(0, 0, -1) : w == "right" ? y = new d(1, 0, 0) : w == "top_front" ? y = new d(1, 1, 0) : w == "top_left" ? y = new d(0, 1, -1) : w == "top_back" ? y = new d(-1, 1, 0) : w == "top_right" ? y = new d(0, 1, 1) : w == "down_front" ? y = new d(1, -1, 0) : w == "down_left" ? y = new d(0, -1, -1) : w == "down_back" ? y = new d(-1, -1, 0) : w == "down_right" ? y = new d(0, -1, 1) : w == "front_right" ? y = new d(1, 0, 1) : w == "right_back" ? y = new d(-1, 0, 1) : w == "back_left" ? y = new d(-1, 0, -1) : w == "left_front" ? y = new d(1, 0, -1) : w == "top_left_front" ? y = new d(1, 1, -1) : w == "top_front_right" ? y = new d(1, 1, 1) : w == "top_right_back" ? y = new d(-1, 1, 1) : w == "top_back_left" ? y = new d(-1, 1, -1) : w == "button_left_front" ? y = new d(1, -1, -1) : w == "button_front_right" ? y = new d(1, -1, 1) : w == "button_right_back" ? y = new d(-1, 1, 1) : w == "button_back_left" && (y = new d(-1, -1, -1));
5857
+ var _ = l.octreeBox.getBoundingBox(), D = _.min, P = _.max, F = D.clone().add(P.clone()).multiplyScalar(0.5), G = F.clone().add(y.multiplyScalar(1 * P.distanceTo(D)));
5858
+ T(e.camera.position, G, l.controls.target.clone(), F, null, null, 1e3, null, C);
5859
5859
  }, i.GetCameraPose = function() {
5860
- var x = e.camera.quaternion, y = e.camera.position, C = l.controls.target, _ = {
5861
- quaternion: x,
5860
+ var w = e.camera.quaternion, y = e.camera.position, C = l.controls.target, _ = {
5861
+ quaternion: w,
5862
5862
  position: y,
5863
5863
  target: C
5864
5864
  };
5865
5865
  return _;
5866
- }, i.ReductionCameraPose = function(x, y = 1e3, C) {
5866
+ }, i.ReductionCameraPose = function(w, y = 1e3, C) {
5867
5867
  p();
5868
5868
  var _ = new Se(
5869
- x.quaternion._x,
5870
- x.quaternion._y,
5871
- x.quaternion._z,
5872
- x.quaternion._w
5873
- ), D = new d(x.position.x, x.position.y, x.position.z), P = new d(x.target.x, x.target.y, x.target.z);
5869
+ w.quaternion._x,
5870
+ w.quaternion._y,
5871
+ w.quaternion._z,
5872
+ w.quaternion._w
5873
+ ), D = new d(w.position.x, w.position.y, w.position.z), P = new d(w.target.x, w.target.y, w.target.z);
5874
5874
  let F = !1;
5875
5875
  T(
5876
5876
  e.camera.position,
@@ -5880,56 +5880,56 @@ function Pa(l, e, t) {
5880
5880
  e.camera.quaternion,
5881
5881
  _,
5882
5882
  y,
5883
- (W) => {
5884
- C && (F || (C(W), F = !0));
5883
+ (G) => {
5884
+ C && (F || (C(G), F = !0));
5885
5885
  }
5886
5886
  ), C && setTimeout(() => {
5887
5887
  F || (C(!0), F = !0);
5888
5888
  }, y + 10);
5889
- }, i.CameraGoHome = function(x = 1e3) {
5889
+ }, i.CameraGoHome = function(w = 1e3) {
5890
5890
  p();
5891
5891
  const y = new d(0, 1, 0);
5892
- w(y), m(y);
5892
+ x(y), m(y);
5893
5893
  var C = l.octreeBox.getBoundingBox(), _ = l.clipping?.getClippedBoundingBox?.(C), D = _ && !_.isEmpty() ? _ : C, P = D.min.clone().add(D.max.clone()).multiplyScalar(0.5);
5894
5894
  let F = new d(1, 1, 1);
5895
- var W = C.max.distanceTo(C.min), q = Math.max(W / 1e5, 0.01), K = D.max.distanceTo(D.min), M = P.clone().add(F.multiplyScalar(K * 0.8));
5895
+ var G = C.max.distanceTo(C.min), q = D.max.distanceTo(D.min), j = P.clone().add(F.multiplyScalar(q * 0.8));
5896
5896
  if (e.camera.isOrthographicCamera) {
5897
- var E = l.container.clientWidth / l.container.clientHeight, L = K * 0.5;
5898
- e.camera.left = -L * E, e.camera.right = L * E, e.camera.top = L, e.camera.bottom = -L, e.camera.zoom = 1, e.camera.near = q, e.camera.far = W * 3, e.camera.updateProjectionMatrix();
5897
+ var M = l.container.clientWidth / l.container.clientHeight, E = q * 0.5;
5898
+ e.camera.left = -E * M, e.camera.right = E * M, e.camera.top = E, e.camera.bottom = -E, e.camera.zoom = 1, e.camera.near = 0.1, e.camera.far = G * 3, e.camera.updateProjectionMatrix();
5899
5899
  } else
5900
- e.camera.near = q, e.camera.far = W * 10, e.camera.updateProjectionMatrix();
5900
+ e.camera.near = 0.1, e.camera.far = G * 10, e.camera.updateProjectionMatrix();
5901
5901
  l.controlModule.orbitControls.origin = P.clone(), T(
5902
5902
  e.camera.position,
5903
- M,
5903
+ j,
5904
5904
  l.controls.target.clone(),
5905
5905
  P,
5906
5906
  null,
5907
5907
  null,
5908
- x,
5908
+ w,
5909
5909
  () => {
5910
- w(y), m(y), e.camera.lookAt(P), e.camera.updateMatrix(), e.camera.updateMatrixWorld(!0), I(e.camera, l.controls), I(i.camera, i.orbitControls), i.RenderScene();
5910
+ x(y), m(y), e.camera.lookAt(P), e.camera.updateMatrix(), e.camera.updateMatrixWorld(!0), I(e.camera, l.controls), I(i.camera, i.orbitControls), i.RenderScene();
5911
5911
  }
5912
5912
  );
5913
- }, i.zoomToBox = function(x, y = 1e3) {
5913
+ }, i.zoomToBox = function(w, y = 1e3) {
5914
5914
  if (p(), e.camera.isOrthographicCamera) {
5915
5915
  let ti = function() {
5916
5916
  n = requestAnimationFrame(ti), Fe.update();
5917
5917
  };
5918
- var C = x.min.clone().add(x.max.clone()).multiplyScalar(0.5), _ = e.camera.position.clone().sub(l.controls.target.clone()).normalize(), D = e.camera.position.distanceTo(l.controls.target), P = C.clone().add(_.multiplyScalar(D)), F = e.camera.zoom, W = new d(1, 0, 0).applyQuaternion(e.camera.quaternion), q = new d(0, 1, 0).applyQuaternion(e.camera.quaternion), K = [
5919
- new d(x.min.x, x.min.y, x.min.z),
5920
- new d(x.max.x, x.min.y, x.min.z),
5921
- new d(x.min.x, x.max.y, x.min.z),
5922
- new d(x.max.x, x.max.y, x.min.z),
5923
- new d(x.min.x, x.min.y, x.max.z),
5924
- new d(x.max.x, x.min.y, x.max.z),
5925
- new d(x.min.x, x.max.y, x.max.z),
5926
- new d(x.max.x, x.max.y, x.max.z)
5927
- ], M = 1 / 0, E = -1 / 0, L = 1 / 0, U = -1 / 0;
5928
- for (var Y of K) {
5929
- var we = Y.dot(W), ve = Y.dot(q);
5930
- M = Math.min(M, we), E = Math.max(E, we), L = Math.min(L, ve), U = Math.max(U, ve);
5918
+ var C = w.min.clone().add(w.max.clone()).multiplyScalar(0.5), _ = e.camera.position.clone().sub(l.controls.target.clone()).normalize(), D = e.camera.position.distanceTo(l.controls.target), P = C.clone().add(_.multiplyScalar(D)), F = e.camera.zoom, G = new d(1, 0, 0).applyQuaternion(e.camera.quaternion), q = new d(0, 1, 0).applyQuaternion(e.camera.quaternion), j = [
5919
+ new d(w.min.x, w.min.y, w.min.z),
5920
+ new d(w.max.x, w.min.y, w.min.z),
5921
+ new d(w.min.x, w.max.y, w.min.z),
5922
+ new d(w.max.x, w.max.y, w.min.z),
5923
+ new d(w.min.x, w.min.y, w.max.z),
5924
+ new d(w.max.x, w.min.y, w.max.z),
5925
+ new d(w.min.x, w.max.y, w.max.z),
5926
+ new d(w.max.x, w.max.y, w.max.z)
5927
+ ], M = 1 / 0, E = -1 / 0, B = 1 / 0, U = -1 / 0;
5928
+ for (var Y of j) {
5929
+ var we = Y.dot(G), ve = Y.dot(q);
5930
+ M = Math.min(M, we), E = Math.max(E, we), B = Math.min(B, ve), U = Math.max(U, ve);
5931
5931
  }
5932
- var Le = (E - M) / 2, nt = (U - L) / 2, be = (e.camera.right - e.camera.left) / 2, Re = (e.camera.top - e.camera.bottom) / 2;
5932
+ var Le = (E - M) / 2, nt = (U - B) / 2, be = (e.camera.right - e.camera.left) / 2, Re = (e.camera.top - e.camera.bottom) / 2;
5933
5933
  F = Math.min(be / Le, Re / nt) * 0.75;
5934
5934
  var Oe = e.camera.position.clone(), xe = l.controls.target.clone(), st = e.camera.zoom, Fe = new $e.Tween({
5935
5935
  x1: Oe.x,
@@ -5958,20 +5958,20 @@ function Pa(l, e, t) {
5958
5958
  l.controls.auto = !1, i.RenderScene(), cancelAnimationFrame(n), n = null, f();
5959
5959
  }), Fe.easing($e.Easing.Cubic.InOut), g(), Fe.start(), ti();
5960
5960
  } else {
5961
- var C = x.min.clone().add(x.max.clone()).multiplyScalar(0.5);
5961
+ var C = w.min.clone().add(w.max.clone()).multiplyScalar(0.5);
5962
5962
  let _s = e.camera.position.clone().sub(l.controls.target.clone()).normalize();
5963
- var P = C.clone().add(_s.multiplyScalar(2 * x.max.distanceTo(x.min)));
5963
+ var P = C.clone().add(_s.multiplyScalar(2 * w.max.distanceTo(w.min)));
5964
5964
  T(e.camera.position, P, l.controls.target.clone(), C, null, null, y);
5965
5965
  }
5966
5966
  };
5967
- function T(x, y, C, _, D, P, F = 1e3, W, q) {
5968
- var K;
5969
- D && P ? (K = new $e.Tween({
5970
- x1: x.x,
5967
+ function T(w, y, C, _, D, P, F = 1e3, G, q) {
5968
+ var j;
5969
+ D && P ? (j = new $e.Tween({
5970
+ x1: w.x,
5971
5971
  // 相机当前位置x
5972
- y1: x.y,
5972
+ y1: w.y,
5973
5973
  // 相机当前位置y
5974
- z1: x.z,
5974
+ z1: w.z,
5975
5975
  // 相机当前位置z
5976
5976
  x2: C.x,
5977
5977
  // 控制当前的中心点x
@@ -5987,7 +5987,7 @@ function Pa(l, e, t) {
5987
5987
  // 相机当前quaternion
5988
5988
  _w: D._w
5989
5989
  // 相机当前quaternion
5990
- }), K.to(
5990
+ }), j.to(
5991
5991
  {
5992
5992
  x1: y.x,
5993
5993
  // 新的相机位置x
@@ -6011,12 +6011,12 @@ function Pa(l, e, t) {
6011
6011
  // 新的相机quaternion
6012
6012
  },
6013
6013
  F
6014
- )) : (K = new $e.Tween({
6015
- x1: x.x,
6014
+ )) : (j = new $e.Tween({
6015
+ x1: w.x,
6016
6016
  // 相机当前位置x
6017
- y1: x.y,
6017
+ y1: w.y,
6018
6018
  // 相机当前位置y
6019
- z1: x.z,
6019
+ z1: w.z,
6020
6020
  // 相机当前位置z
6021
6021
  x2: C.x,
6022
6022
  // 控制当前的中心点x
@@ -6024,7 +6024,7 @@ function Pa(l, e, t) {
6024
6024
  // 控制当前的中心点y
6025
6025
  z2: C.z
6026
6026
  // 控制当前的中心点z
6027
- }), K.to(
6027
+ }), j.to(
6028
6028
  {
6029
6029
  x1: y.x,
6030
6030
  // 新的相机位置x
@@ -6040,9 +6040,9 @@ function Pa(l, e, t) {
6040
6040
  // 新的控制中心点位置x
6041
6041
  },
6042
6042
  F
6043
- )), K.onUpdate(function(E) {
6043
+ )), j.onUpdate(function(E) {
6044
6044
  l.controls && (D && P ? (e.camera.quaternion._x = E._x, e.camera.quaternion._y = E._y, e.camera.quaternion._z = E._z, e.camera.quaternion._w = E._w) : l.controls.auto = !0, e.camera.position.x = E.x1, e.camera.position.y = E.y1, e.camera.position.z = E.z1, l.controls.target.x = E.x2, l.controls.target.y = E.y2, l.controls.target.z = E.z2, l.controls.update(), i.RenderScene());
6045
- }), K.onComplete(function(E) {
6045
+ }), j.onComplete(function(E) {
6046
6046
  if (!l.controls) {
6047
6047
  f();
6048
6048
  return;
@@ -6050,19 +6050,19 @@ function Pa(l, e, t) {
6050
6050
  l.controls.syncAvatarFromCameraTarget?.(
6051
6051
  new d(E.x2, E.y2, E.z2),
6052
6052
  { preserveCameraDistance: !0 }
6053
- ), l.controls.auto = !1, q && typeof l.controls.setScreenUp == "function" ? l.controls.setScreenUp(q) : l.controls.update(), i.RenderScene(), W && W(!0), cancelAnimationFrame(n), n = null, f();
6054
- }), K.easing($e.Easing.Cubic.InOut);
6053
+ ), l.controls.auto = !1, q && typeof l.controls.setScreenUp == "function" ? l.controls.setScreenUp(q) : l.controls.update(), i.RenderScene(), G && G(!0), cancelAnimationFrame(n), n = null, f();
6054
+ }), j.easing($e.Easing.Cubic.InOut);
6055
6055
  function M(E) {
6056
- n = requestAnimationFrame(M), K.update();
6056
+ n = requestAnimationFrame(M), j.update();
6057
6057
  }
6058
- g(), K.start(), M();
6058
+ g(), j.start(), M();
6059
6059
  }
6060
- function B() {
6060
+ function L() {
6061
6061
  o = document.createElement("div"), o.className = "ViewCube", t.appendChild(o), r = document.createElement("div"), r.className = "viewSettingWrapper", r.innerHTML = "...";
6062
- var x = document.createElement("div");
6063
- x.className = "homeViewWrapper", x.style.backgroundImage = `url(${Qe.home})`, x.addEventListener("mousedown", function() {
6062
+ var w = document.createElement("div");
6063
+ w.className = "homeViewWrapper", w.style.backgroundImage = `url(${Qe.home})`, w.addEventListener("mousedown", function() {
6064
6064
  l.viewCube.cameraGoHome(500);
6065
- }), o.appendChild(x), r.addEventListener("mousedown", function(_) {
6065
+ }), o.appendChild(w), r.addEventListener("mousedown", function(_) {
6066
6066
  _.stopPropagation(), cameraToggle.classList.contains("show") ? (y(), console.log("隐藏功能按钮")) : (C(), console.log("显示功能按钮"));
6067
6067
  });
6068
6068
  function y() {
@@ -6074,10 +6074,10 @@ function Pa(l, e, t) {
6074
6074
  }
6075
6075
  function k() {
6076
6076
  i.sceneOrtho = Ea();
6077
- var C = t.clientWidth, _ = t.clientWidth, x = C > _ ? C / _ : _ / C, y = 300;
6077
+ var C = t.clientWidth, _ = t.clientWidth, w = C > _ ? C / _ : _ / C, y = 300;
6078
6078
  i.camera = new ke(
6079
- y * x / -2,
6080
- y * x / 2,
6079
+ y * w / -2,
6080
+ y * w / 2,
6081
6081
  y / 2,
6082
6082
  y / -2,
6083
6083
  0.01,
@@ -6088,17 +6088,17 @@ function Pa(l, e, t) {
6088
6088
  });
6089
6089
  D.setSize(C, _), D.setClearAlpha(0), i.sceneOrtho.renderer = D;
6090
6090
  let P = new jt(16777215, 0.8);
6091
- i.sceneOrtho.add(P), Sa(o, D), i.orbitControls = new Yn(l, i.camera, o), i.orbitControls.enableZoom = !1, i.orbitControls.enablePan = !1, i.orbitControls.enableDamping = !0, i.orbitControls.dampingFactor = 0.1, i.orbitControls.rotateSpeed = 0.5, i.orbitControls.addEventListener("start", j), i.orbitControls.addEventListener("change", te), i.orbitControls.addEventListener("end", Q);
6091
+ i.sceneOrtho.add(P), Sa(o, D), i.orbitControls = new Yn(l, i.camera, o), i.orbitControls.enableZoom = !1, i.orbitControls.enablePan = !1, i.orbitControls.enableDamping = !0, i.orbitControls.dampingFactor = 0.1, i.orbitControls.rotateSpeed = 0.5, i.orbitControls.addEventListener("start", K), i.orbitControls.addEventListener("change", te), i.orbitControls.addEventListener("end", Q);
6092
6092
  }
6093
6093
  let N = !1;
6094
- function j() {
6094
+ function K() {
6095
6095
  p(), N = !0, g(), m(e.camera.up), b(i.orbitControls, l.controls), l.controls && (i._mainTarget = l.controls.target.clone(), i._mainDistance = e.camera.position.distanceTo(l.controls.target));
6096
6096
  }
6097
6097
  function te() {
6098
6098
  if (N) {
6099
6099
  if (e.camera.quaternion.copy(i.camera.quaternion), S(), l.controls && i._mainTarget && i._mainDistance) {
6100
- const x = new d(0, 0, 1).applyQuaternion(e.camera.quaternion);
6101
- e.camera.position.copy(i._mainTarget.clone().add(x.multiplyScalar(i._mainDistance))), l.controls.update();
6100
+ const w = new d(0, 0, 1).applyQuaternion(e.camera.quaternion);
6101
+ e.camera.position.copy(i._mainTarget.clone().add(w.multiplyScalar(i._mainDistance))), l.controls.update();
6102
6102
  }
6103
6103
  l.renderer && e.camera && l.renderer.render(e, e.camera);
6104
6104
  }
@@ -6106,15 +6106,15 @@ function Pa(l, e, t) {
6106
6106
  function Q() {
6107
6107
  N = !1, i._mainTarget = null, i._mainDistance = null, f();
6108
6108
  }
6109
- function ce(x) {
6110
- return x ? (x.colorSpace = je, x) : null;
6109
+ function ce(w) {
6110
+ return w ? (w.colorSpace = je, w) : null;
6111
6111
  }
6112
- async function ae(x, y) {
6113
- const C = await x.loadAsync(y);
6112
+ async function ae(w, y) {
6113
+ const C = await w.loadAsync(y);
6114
6114
  return ce(C);
6115
6115
  }
6116
6116
  async function le() {
6117
- let x = [
6117
+ let w = [
6118
6118
  {
6119
6119
  label: "右",
6120
6120
  icon: Qe.right
@@ -6141,7 +6141,7 @@ function Pa(l, e, t) {
6141
6141
  }
6142
6142
  ];
6143
6143
  const y = new Je(), _ = (await Promise.all(
6144
- x.map((F) => ae(y, F.icon))
6144
+ w.map((F) => ae(y, F.icon))
6145
6145
  )).map((F) => new oe({
6146
6146
  color: 16777215,
6147
6147
  map: F
@@ -6153,27 +6153,27 @@ function Pa(l, e, t) {
6153
6153
  P.x = F.clientX, P.y = F.clientY;
6154
6154
  }), o.addEventListener("mouseup", (F) => {
6155
6155
  if (N) return;
6156
- const W = F.clientX - P.x, q = F.clientY - P.y;
6157
- if (Math.sqrt(W * W + q * q) > 5) return;
6156
+ const G = F.clientX - P.x, q = F.clientY - P.y;
6157
+ if (Math.sqrt(G * G + q * q) > 5) return;
6158
6158
  var M = {};
6159
6159
  M.x = F.offsetX / o.clientWidth * 2 - 1, M.y = -(F.offsetY / o.clientHeight) * 2 + 1;
6160
6160
  var E = new pe();
6161
6161
  E.setFromCamera(M, i.camera);
6162
- const L = E.intersectObjects(a, !1);
6163
- L.length > 0 && i.ToggleDirectionView(L[0].object.name);
6162
+ const B = E.intersectObjects(a, !1);
6163
+ B.length > 0 && i.ToggleDirectionView(B[0].object.name);
6164
6164
  }), o.addEventListener("mousemove", (F) => {
6165
- var W = {};
6166
- W.x = F.offsetX / o.clientWidth * 2 - 1, W.y = -(F.offsetY / o.clientHeight) * 2 + 1;
6165
+ var G = {};
6166
+ G.x = F.offsetX / o.clientWidth * 2 - 1, G.y = -(F.offsetY / o.clientHeight) * 2 + 1;
6167
6167
  var q = new pe();
6168
- q.setFromCamera(W, i.camera);
6169
- const K = q.intersectObjects(a, !1);
6168
+ q.setFromCamera(G, i.camera);
6169
+ const j = q.intersectObjects(a, !1);
6170
6170
  for (var M of a)
6171
6171
  M.material.opacity = 0.01;
6172
- K.length > 0 && (K[0].object.material.opacity = 0.2);
6172
+ j.length > 0 && (j[0].object.material.opacity = 0.2);
6173
6173
  });
6174
6174
  }
6175
- function fe(x) {
6176
- for (var y = x * 0.5 - 20, C = [
6175
+ function fe(w) {
6176
+ for (var y = w * 0.5 - 20, C = [
6177
6177
  {
6178
6178
  name: "right",
6179
6179
  a: 30,
@@ -6365,14 +6365,14 @@ function Pa(l, e, t) {
6365
6365
  for (var P = 0; P < D.length; P++)
6366
6366
  a.push(Ae(D[P]));
6367
6367
  }
6368
- function Ae(x) {
6369
- const y = new Ct(x.a, x.b, x.c), C = new oe({
6368
+ function Ae(w) {
6369
+ const y = new Ct(w.a, w.b, w.c), C = new oe({
6370
6370
  color: "blue",
6371
6371
  transparent: !0,
6372
6372
  opacity: 0.01
6373
- }), _ = new H().makeTranslation(x.point.x, x.point.y, x.point.z);
6373
+ }), _ = new H().makeTranslation(w.point.x, w.point.y, w.point.z);
6374
6374
  let D = y.applyMatrix4(_), P = new z(D, C);
6375
- return P.name = x.name, i.sceneOrtho.add(P), P;
6375
+ return P.name = w.name, i.sceneOrtho.add(P), P;
6376
6376
  }
6377
6377
  return i.ToggleCameraType = function() {
6378
6378
  l.cameraModule.switchCurrentCamera();
@@ -6385,12 +6385,12 @@ function Pa(l, e, t) {
6385
6385
  l.renderer.render(e, e.camera);
6386
6386
  const y = l.renderer.domElement.toDataURL("image/png"), C = document.createElement("a"), _ = (/* @__PURE__ */ new Date()).toISOString().replaceAll(/[:.]/g, "-");
6387
6387
  C.download = `screenshot_${_}.png`, C.href = y, C.click(), console.log("截图已保存");
6388
- } catch (x) {
6389
- console.error("截图失败:", x);
6388
+ } catch (w) {
6389
+ console.error("截图失败:", w);
6390
6390
  }
6391
6391
  }, i.ToggleFullscreen = function() {
6392
- const x = t || document.documentElement;
6393
- !document.fullscreenElement && !document.webkitFullscreenElement && !document.mozFullScreenElement && !document.msFullscreenElement ? (x.requestFullscreen ? x.requestFullscreen() : x.webkitRequestFullscreen ? x.webkitRequestFullscreen() : x.mozRequestFullScreen ? x.mozRequestFullScreen() : x.msRequestFullscreen && x.msRequestFullscreen(), console.log("已进入全屏模式")) : (document.exitFullscreen ? document.exitFullscreen() : document.webkitExitFullscreen ? document.webkitExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.msExitFullscreen && document.msExitFullscreen(), console.log("已退出全屏模式"));
6392
+ const w = t || document.documentElement;
6393
+ !document.fullscreenElement && !document.webkitFullscreenElement && !document.mozFullScreenElement && !document.msFullscreenElement ? (w.requestFullscreen ? w.requestFullscreen() : w.webkitRequestFullscreen ? w.webkitRequestFullscreen() : w.mozRequestFullScreen ? w.mozRequestFullScreen() : w.msRequestFullscreen && w.msRequestFullscreen(), console.log("已进入全屏模式")) : (document.exitFullscreen ? document.exitFullscreen() : document.webkitExitFullscreen ? document.webkitExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.msExitFullscreen && document.msExitFullscreen(), console.log("已退出全屏模式"));
6394
6394
  }, i;
6395
6395
  }
6396
6396
  class Ta {
@@ -6567,7 +6567,7 @@ function Ia(l) {
6567
6567
  }, e.clearSelectableScope = function() {
6568
6568
  t = null;
6569
6569
  }, e.rayInterationModel = function(i, n, s = !0, o = !0) {
6570
- const a = [], c = /* @__PURE__ */ new Set(), h = new d(), u = l.clipping, p = Array.isArray(l.models) ? l.models : [], g = new Map(p.map((y) => [y.url, y])), f = Ae(l.engineStatus.hideModels), v = Ae(l.engineStatus.translucentModels), w = l.modelExplode?.raycast?.(i) ?? [];
6570
+ const a = [], c = /* @__PURE__ */ new Set(), h = new d(), u = l.clipping, p = Array.isArray(l.models) ? l.models : [], g = new Map(p.map((y) => [y.url, y])), f = Ae(l.engineStatus.hideModels), v = Ae(l.engineStatus.translucentModels), x = l.modelExplode?.raycast?.(i) ?? [];
6571
6571
  p.forEach((y) => {
6572
6572
  const C = g.get(y.url);
6573
6573
  if (C == null)
@@ -6581,7 +6581,7 @@ function Ia(l) {
6581
6581
  const m = a.map((y) => N(y)).filter((y) => y instanceof z);
6582
6582
  tr(i);
6583
6583
  const b = [
6584
- ...w,
6584
+ ...x,
6585
6585
  ...i.intersectObjects(m, !1).map(ce)
6586
6586
  ].sort((y, C) => y.distance - C.distance);
6587
6587
  return ir(i), b;
@@ -6589,11 +6589,11 @@ function Ia(l) {
6589
6589
  if (C == null)
6590
6590
  return;
6591
6591
  if (!C.threeBox) {
6592
- let q = new d(C.min.X * 0.3048, C.min.Z * 0.3048, -C.min.Y * 0.3048), K = new d(C.max.X * 0.3048, C.max.Z * 0.3048, -C.max.Y * 0.3048), M = new d(Math.min(q.x, K.x), Math.min(q.y, K.y), Math.min(q.z, K.z)), E = new d(Math.max(K.x, q.x), Math.max(K.y, q.y), Math.max(K.z, q.z));
6592
+ let q = new d(C.min.X * 0.3048, C.min.Z * 0.3048, -C.min.Y * 0.3048), j = new d(C.max.X * 0.3048, C.max.Z * 0.3048, -C.max.Y * 0.3048), M = new d(Math.min(q.x, j.x), Math.min(q.y, j.y), Math.min(q.z, j.z)), E = new d(Math.max(j.x, q.x), Math.max(j.y, q.y), Math.max(j.z, q.z));
6593
6593
  C.threeBox = new R(M, E).applyMatrix4(P);
6594
6594
  }
6595
- const F = C.threeBox, W = y.ray.intersectsBox(F);
6596
- if (!(W == null || W == !1) && !(o && u?.doesBoxIntersectClippingRange?.(F) === !1))
6595
+ const F = C.threeBox, G = y.ray.intersectsBox(F);
6596
+ if (!(G == null || G == !1) && !(o && u?.doesBoxIntersectClippingRange?.(F) === !1))
6597
6597
  if (C.children == null || C.children.length == 0) {
6598
6598
  if (C.elements != null)
6599
6599
  for (let q of C.elements)
@@ -6612,26 +6612,26 @@ function Ia(l) {
6612
6612
  const P = _.nodesMap.get(y);
6613
6613
  if (P == null)
6614
6614
  return;
6615
- const F = B(P.indexes);
6615
+ const F = L(P.indexes);
6616
6616
  if (F.length > 0) {
6617
- F.forEach((W) => {
6618
- const q = te(P, D, W);
6617
+ F.forEach((G) => {
6618
+ const q = te(P, D, G);
6619
6619
  if (q == null || o && u?.doesBoxIntersectClippingRange?.(q) === !1)
6620
6620
  return;
6621
- const K = i.ray.intersectBox(q, h);
6622
- if (K == null)
6621
+ const j = i.ray.intersectBox(q, h);
6622
+ if (j == null)
6623
6623
  return;
6624
- const M = i.ray.origin.distanceToSquared(K);
6625
- T(P, W, C.url, D, M);
6624
+ const M = i.ray.origin.distanceToSquared(j);
6625
+ T(P, G, C.url, D, M);
6626
6626
  });
6627
6627
  return;
6628
6628
  }
6629
- P.infos != null && P.infos.forEach((W) => {
6630
- I(W.mesh, D);
6629
+ P.infos != null && P.infos.forEach((G) => {
6630
+ I(G.mesh, D);
6631
6631
  });
6632
6632
  }
6633
6633
  function I(y, C) {
6634
- if (!(y instanceof z) || (y.parent == null && x(y, C), s && y.geometry.attributes.position.count >= 2e3))
6634
+ if (!(y instanceof z) || (y.parent == null && w(y, C), s && y.geometry.attributes.position.count >= 2e3))
6635
6635
  return;
6636
6636
  const _ = y.uuid ?? y.id;
6637
6637
  if (c.has(_))
@@ -6650,9 +6650,9 @@ function Ia(l) {
6650
6650
  function T(y, C, _, D, P) {
6651
6651
  if (!Array.isArray(C) || C.length < 2 || !(De(l, C[0]) instanceof V))
6652
6652
  return;
6653
- const W = `instance:${C[0]}:${C[1]}`;
6654
- c.has(W) || (c.add(W), a.push({
6655
- key: W,
6653
+ const G = `instance:${C[0]}:${C[1]}`;
6654
+ c.has(G) || (c.add(G), a.push({
6655
+ key: G,
6656
6656
  distanceSq: P,
6657
6657
  kind: "instance",
6658
6658
  node: y,
@@ -6661,7 +6661,7 @@ function Ia(l) {
6661
6661
  modelMatrix: D.clone()
6662
6662
  }), k());
6663
6663
  }
6664
- function B(y) {
6664
+ function L(y) {
6665
6665
  return Array.isArray(y) ? y.filter((C) => Array.isArray(C) && De(l, C[0]) instanceof V) : [];
6666
6666
  }
6667
6667
  function k() {
@@ -6671,26 +6671,26 @@ function Ia(l) {
6671
6671
  }
6672
6672
  }
6673
6673
  function N(y) {
6674
- return y.kind === "mesh" ? y.mesh : y.kind === "instance" ? j(y.node, y.indexInfo, y.url, y.modelMatrix) : null;
6674
+ return y.kind === "mesh" ? y.mesh : y.kind === "instance" ? K(y.node, y.indexInfo, y.url, y.modelMatrix) : null;
6675
6675
  }
6676
- function j(y, C, _, D) {
6676
+ function K(y, C, _, D) {
6677
6677
  if (!Array.isArray(C) || C.length < 2 || y == null)
6678
6678
  return null;
6679
6679
  const P = De(l, C[0]);
6680
6680
  if (!(P instanceof V) || P.geometry == null)
6681
6681
  return null;
6682
- const F = C[1], W = Q(P, F);
6683
- if (W == null)
6682
+ const F = C[1], G = Q(P, F);
6683
+ if (G == null)
6684
6684
  return null;
6685
- const q = D.clone().multiply(W), K = y.info ?? y;
6686
- K.__pickMeshes instanceof Map || (K.__pickMeshes = /* @__PURE__ */ new Map());
6685
+ const q = D.clone().multiply(G), j = y.info ?? y;
6686
+ j.__pickMeshes instanceof Map || (j.__pickMeshes = /* @__PURE__ */ new Map());
6687
6687
  const M = `${C[0]}:${F}`;
6688
- let E = K.__pickMeshes.get(M);
6689
- return E instanceof z || (E = new z(P.geometry, P.material), K.__pickMeshes.set(M, E)), x(E, q), E.userData.__instancePickMeta = {
6688
+ let E = j.__pickMeshes.get(M);
6689
+ return E instanceof z || (E = new z(P.geometry, P.material), j.__pickMeshes.set(M, E)), w(E, q), E.userData.__instancePickMeta = {
6690
6690
  url: _,
6691
6691
  id: y.info?.id ?? y.id ?? y.infos[0].id,
6692
6692
  instanceId: F,
6693
- matrix: W.clone()
6693
+ matrix: G.clone()
6694
6694
  }, E;
6695
6695
  }
6696
6696
  function te(y, C, _) {
@@ -6742,7 +6742,7 @@ function Ia(l) {
6742
6742
  Array.isArray(_.ids) && C.set(_.url, new Set(_.ids));
6743
6743
  }), C;
6744
6744
  }
6745
- function x(y, C) {
6745
+ function w(y, C) {
6746
6746
  y instanceof z && (y.matrixAutoUpdate = !1, y.matrix.copy(C), y.matrixWorld.copy(C), y.matrixWorldNeedsUpdate = !1, y.box instanceof R && (y.box.copy(y.geometry.boundingBox ?? new R().setFromBufferAttribute(y.geometry.attributes.position)), y.box.applyMatrix4(C)));
6747
6747
  }
6748
6748
  }, e;
@@ -6751,8 +6751,8 @@ class _a {
6751
6751
  engine;
6752
6752
  // 绘制状态
6753
6753
  isDrawing = !1;
6754
- startPoint = new G();
6755
- endPoint = new G();
6754
+ startPoint = new W();
6755
+ endPoint = new W();
6756
6756
  // UI绘制框元素
6757
6757
  selectionBox = null;
6758
6758
  // 坐标转换工具
@@ -6982,7 +6982,7 @@ class La {
6982
6982
  debugger;
6983
6983
  if (s.length === 0)
6984
6984
  return null;
6985
- const o = this.toVector3(n), r = new G(o.x, o.z), a = this.buildAxisFamilies(s).sort((p, g) => g.axes.length - p.axes.length).slice(0, 2).map((p, g) => ({ ...p, familyIndex: g }));
6985
+ const o = this.toVector3(n), r = new W(o.x, o.z), a = this.buildAxisFamilies(s).sort((p, g) => g.axes.length - p.axes.length).slice(0, 2).map((p, g) => ({ ...p, familyIndex: g }));
6986
6986
  if (a.length === 0)
6987
6987
  return null;
6988
6988
  const c = a.map((p) => this.resolveFamilyLocation(p, r)), h = this.sortFamiliesForDisplay(c), u = h.length === 2 && h.every((p) => p.isInside);
@@ -7087,7 +7087,7 @@ class La {
7087
7087
  t.push({
7088
7088
  familyIndex: t.length,
7089
7089
  direction: n.direction.clone(),
7090
- normal: new G(-n.direction.y, n.direction.x),
7090
+ normal: new W(-n.direction.y, n.direction.x),
7091
7091
  axes: [n]
7092
7092
  });
7093
7093
  }), t.forEach((i) => {
@@ -7095,10 +7095,10 @@ class La {
7095
7095
  }), t;
7096
7096
  }
7097
7097
  createProjection(e) {
7098
- const t = this.coordinateMapper(e.Points[0]), i = this.coordinateMapper(e.Points[1]), n = new G(t.x, t.z), s = new G(i.x, i.z), o = s.clone().sub(n);
7098
+ const t = this.coordinateMapper(e.Points[0]), i = this.coordinateMapper(e.Points[1]), n = new W(t.x, t.z), s = new W(i.x, i.z), o = s.clone().sub(n);
7099
7099
  if (o.lengthSq() <= Number.EPSILON)
7100
7100
  return null;
7101
- const r = this.normalizeDirection(o), a = new G(-r.y, r.x);
7101
+ const r = this.normalizeDirection(o), a = new W(-r.y, r.x);
7102
7102
  return {
7103
7103
  data: e,
7104
7104
  start: n,
@@ -8755,7 +8755,7 @@ class Ve {
8755
8755
  m.container != null && (m.container.style.display = b ? "block" : "none");
8756
8756
  }
8757
8757
  this.engine.measure.annotationData.normalAnnotation.forEach((m) => {
8758
- w(m);
8758
+ x(m);
8759
8759
  }), this.engine.measure.annotationData.elevationAnnotation.forEach((m) => {
8760
8760
  v(m);
8761
8761
  }), this.engine.measure.annotationData.coordinateAnnotation.forEach((m) => {
@@ -8797,8 +8797,8 @@ class Ve {
8797
8797
  n(m, !0);
8798
8798
  let I = m.container;
8799
8799
  I.getElementsByTagName("circle")[0].setAttribute("cx", b.x), I.getElementsByTagName("circle")[0].setAttribute("cy", b.y), I.getElementsByTagName("circle")[1].setAttribute("cx", A.x), I.getElementsByTagName("circle")[1].setAttribute("cy", A.y), I.getElementsByTagName("circle")[2].setAttribute("cx", S.x), I.getElementsByTagName("circle")[2].setAttribute("cy", S.y), I.getElementsByTagName("polyline")[0].setAttribute("points", b.x + "," + b.y + " " + A.x + "," + A.y), I.getElementsByTagName("polyline")[1].setAttribute("points", A.x + "," + A.y + " " + S.x + "," + S.y);
8800
- let T = A.x, B = A.y - 30;
8801
- I.getElementsByTagName("rect")[0].setAttribute("x", T - 40), I.getElementsByTagName("rect")[0].setAttribute("y", B - 12.5), I.getElementsByTagName("text")[0].setAttribute("x", T), I.getElementsByTagName("text")[0].setAttribute("y", B + 4), I.getElementsByTagName("text")[0].innerHTML = m.text, I.style.top = "0px", I.style.left = "0px";
8800
+ let T = A.x, L = A.y - 30;
8801
+ I.getElementsByTagName("rect")[0].setAttribute("x", T - 40), I.getElementsByTagName("rect")[0].setAttribute("y", L - 12.5), I.getElementsByTagName("text")[0].setAttribute("x", T), I.getElementsByTagName("text")[0].setAttribute("y", L + 4), I.getElementsByTagName("text")[0].innerHTML = m.text, I.style.top = "0px", I.style.left = "0px";
8802
8802
  }
8803
8803
  function p(m) {
8804
8804
  if (m.container == null) {
@@ -8830,14 +8830,14 @@ class Ve {
8830
8830
  n(m, !0), A = A / b.length, S = S / b.length;
8831
8831
  let I = b.map((te) => te.x + "," + te.y).join(" "), T = [...b];
8832
8832
  b.length >= 3 && T.push(b[0]);
8833
- let B = T.map((te) => te.x + "," + te.y).join(" "), k = m.container;
8834
- k.getElementsByTagName("polygon")[0].setAttribute("points", b.length >= 3 ? I : ""), k.getElementsByTagName("polyline")[0].setAttribute("points", B);
8835
- let N = A, j = S;
8836
- k.getElementsByTagName("rect")[0].setAttribute("x", N - 40), k.getElementsByTagName("rect")[0].setAttribute("y", j - 12.5), k.getElementsByTagName("text")[0].setAttribute("x", N + 10), k.getElementsByTagName("text")[0].setAttribute("y", j + 4), k.getElementsByTagName("text")[0].innerHTML = e.getMeasureText(m.text, 2), k.style.top = "0px", k.style.left = "0px";
8833
+ let L = T.map((te) => te.x + "," + te.y).join(" "), k = m.container;
8834
+ k.getElementsByTagName("polygon")[0].setAttribute("points", b.length >= 3 ? I : ""), k.getElementsByTagName("polyline")[0].setAttribute("points", L);
8835
+ let N = A, K = S;
8836
+ k.getElementsByTagName("rect")[0].setAttribute("x", N - 40), k.getElementsByTagName("rect")[0].setAttribute("y", K - 12.5), k.getElementsByTagName("text")[0].setAttribute("x", N + 10), k.getElementsByTagName("text")[0].setAttribute("y", K + 4), k.getElementsByTagName("text")[0].innerHTML = e.getMeasureText(m.text, 2), k.style.top = "0px", k.style.left = "0px";
8837
8837
  }
8838
8838
  function g(m) {
8839
8839
  if (m.container == null) {
8840
- let B = [
8840
+ let L = [
8841
8841
  '<svg class="measureSvg">',
8842
8842
  "<defs>",
8843
8843
  '<marker id="slope-arrow-' + m.id + '" markerWidth="10" markerHeight="10" refX="9" refY="3" orient="auto" markerUnits="strokeWidth">',
@@ -8851,7 +8851,7 @@ class Ve {
8851
8851
  '<text x="50" y="16" text-anchor="middle" class="measureLabel"> ' + m.text + "</text>",
8852
8852
  "</svg>"
8853
8853
  ].join("");
8854
- m.container = document.createElement("div"), m.container.className = "slope-annotation", m.container.id = m.id, m.container.innerHTML = B, e.engine.measure.annotationContainer.appendChild(m.container), m.container.getElementsByTagName("svg")[0].addEventListener("click", function() {
8854
+ m.container = document.createElement("div"), m.container.className = "slope-annotation", m.container.id = m.id, m.container.innerHTML = L, e.engine.measure.annotationContainer.appendChild(m.container), m.container.getElementsByTagName("svg")[0].addEventListener("click", function() {
8855
8855
  e.clearHighlight(), m.container.getElementsByTagName("svg")[0].classList.add("Hight"), m.highlight = !0, e.engine.events.trigger(se.MeasureClick, m);
8856
8856
  }), m.isSelect && (m.container.getElementsByTagName("svg")[0].classList.add("Hight"), m.highlight = !0);
8857
8857
  }
@@ -8891,8 +8891,8 @@ class Ve {
8891
8891
  n(m, !0), b.style.top = "0px", b.style.left = "0px";
8892
8892
  let S = b.getElementsByTagName("circle")[0];
8893
8893
  S && (S.setAttribute("cx", A.x), S.setAttribute("cy", A.y));
8894
- let I = b.getElementsByTagName("rect"), T = b.getElementsByTagName("text"), B = -55;
8895
- I[0] && (I[0].setAttribute("x", A.x + 10), I[0].setAttribute("y", A.y + 10 + B)), T[0] && (T[0].setAttribute("x", A.x + 10 + 50), T[0].setAttribute("y", A.y + 10 + 16 + B)), I[1] && (I[1].setAttribute("x", A.x + 10), I[1].setAttribute("y", A.y + 10 + 30 + B)), T[1] && (T[1].setAttribute("x", A.x + 10 + 50), T[1].setAttribute("y", A.y + 10 + 46 + B)), I[2] && (I[2].setAttribute("x", A.x + 10), I[2].setAttribute("y", A.y + 10 + 60 + B)), T[2] && (T[2].setAttribute("x", A.x + 10 + 50), T[2].setAttribute("y", A.y + 10 + 76 + B)), T[0] && (T[0].innerHTML = "X: " + e.getMeasureText(m.textX, 1)), T[1] && (T[1].innerHTML = "Y: " + e.getMeasureText(-m.textZ, 1)), T[2] && (T[2].innerHTML = "Z: " + e.getMeasureText(m.textY, 1));
8894
+ let I = b.getElementsByTagName("rect"), T = b.getElementsByTagName("text"), L = -55;
8895
+ I[0] && (I[0].setAttribute("x", A.x + 10), I[0].setAttribute("y", A.y + 10 + L)), T[0] && (T[0].setAttribute("x", A.x + 10 + 50), T[0].setAttribute("y", A.y + 10 + 16 + L)), I[1] && (I[1].setAttribute("x", A.x + 10), I[1].setAttribute("y", A.y + 10 + 30 + L)), T[1] && (T[1].setAttribute("x", A.x + 10 + 50), T[1].setAttribute("y", A.y + 10 + 46 + L)), I[2] && (I[2].setAttribute("x", A.x + 10), I[2].setAttribute("y", A.y + 10 + 60 + L)), T[2] && (T[2].setAttribute("x", A.x + 10 + 50), T[2].setAttribute("y", A.y + 10 + 76 + L)), T[0] && (T[0].innerHTML = "X: " + e.getMeasureText(m.textX, 1)), T[1] && (T[1].innerHTML = "Y: " + e.getMeasureText(-m.textZ, 1)), T[2] && (T[2].innerHTML = "Z: " + e.getMeasureText(m.textY, 1));
8896
8896
  }
8897
8897
  function v(m) {
8898
8898
  if (m.container == null) {
@@ -8914,7 +8914,7 @@ class Ve {
8914
8914
  }
8915
8915
  n(m, !0), b.style.top = A.y - 48 + "px", b.style.left = A.x - 16 + "px", b.getElementsByTagName("text")[0].innerHTML = e.getMeasureText(m.text, 1);
8916
8916
  }
8917
- function w(m) {
8917
+ function x(m) {
8918
8918
  if (m.container == null) {
8919
8919
  let I = [
8920
8920
  '<svg class="measureSvg">',
@@ -9463,17 +9463,17 @@ class wt {
9463
9463
  return n.lengthSq() < 1e-10 ? null : n.normalize();
9464
9464
  }
9465
9465
  pointToScreenLineDistance(e, t, i) {
9466
- const n = new G().subVectors(i, t), s = n.lengthSq();
9466
+ const n = new W().subVectors(i, t), s = n.lengthSq();
9467
9467
  if (s < 1e-10)
9468
9468
  return e.distanceTo(t);
9469
- const o = new G().subVectors(e, t).dot(n) / s, r = t.clone().add(n.multiplyScalar(o));
9469
+ const o = new W().subVectors(e, t).dot(n) / s, r = t.clone().add(n.multiplyScalar(o));
9470
9470
  return e.distanceTo(r);
9471
9471
  }
9472
9472
  isNearSlopeDirection(e, t, i, n, s) {
9473
9473
  const o = new ge(this.engine.camera, this.engine.renderer, this.engine.scene), r = o.worldToScreenIfVisible(e);
9474
9474
  if (r == null)
9475
9475
  return !1;
9476
- const a = Number.isFinite(s?.offsetX) && Number.isFinite(s?.offsetY) ? new G(s.offsetX, s.offsetY) : o.worldToScreenIfVisible(n);
9476
+ const a = Number.isFinite(s?.offsetX) && Number.isFinite(s?.offsetY) ? new W(s.offsetX, s.offsetY) : o.worldToScreenIfVisible(n);
9477
9477
  if (a == null)
9478
9478
  return !1;
9479
9479
  const c = Math.max(
@@ -9932,7 +9932,7 @@ class al {
9932
9932
  return this.meshs.filter((e) => e.type === "Mesh");
9933
9933
  }
9934
9934
  createRaycasterFromMouseEvent(e) {
9935
- const t = new pe(), i = new G(), n = this.engine.renderer.domElement.clientWidth, s = this.engine.renderer.domElement.clientHeight;
9935
+ const t = new pe(), i = new W(), n = this.engine.renderer.domElement.clientWidth, s = this.engine.renderer.domElement.clientHeight;
9936
9936
  return i.x = e.offsetX / n * 2 - 1, i.y = -(e.offsetY / s) * 2 + 1, t.setFromCamera(i, this.engine.camera), t;
9937
9937
  }
9938
9938
  isMobileDevice() {
@@ -9940,7 +9940,7 @@ class al {
9940
9940
  }
9941
9941
  getTouchPoint(e) {
9942
9942
  const t = e.touches[0] || e.changedTouches[0];
9943
- return t ? new G(t.clientX, t.clientY) : null;
9943
+ return t ? new W(t.clientX, t.clientY) : null;
9944
9944
  }
9945
9945
  createMouseEventFromTouch(e) {
9946
9946
  const t = e.touches[0] || e.changedTouches[0], i = this.engine.renderer?.domElement;
@@ -10221,8 +10221,8 @@ class al {
10221
10221
  f == null ? (f = new It(g, p), f.name = n + "Line", e.add(f), this.meshs.push(f)) : (f.geometry = g, f.material = p);
10222
10222
  const v = new d();
10223
10223
  t.forEach((m) => v.add(m)), v.multiplyScalar(1 / t.length), this.updateFaceTransformControl(n, i, v, s);
10224
- const w = this.engine.sectionPlane.find((m) => m.name == n);
10225
- w && w.setFromNormalAndCoplanarPoint(i.clone().setLength(-1), o);
10224
+ const x = this.engine.sectionPlane.find((m) => m.name == n);
10225
+ x && x.setFromNormalAndCoplanarPoint(i.clone().setLength(-1), o);
10226
10226
  }
10227
10227
  }
10228
10228
  class ll {
@@ -10443,12 +10443,12 @@ class ll {
10443
10443
  );
10444
10444
  this.center = o.clone();
10445
10445
  const r = t?.clone() ?? o.clone().add(n.clone().multiplyScalar(e)), { tangent: a, bitangent: c } = this.getPlaneBasis(n), h = this.getBoxCorners(this.box), u = this.box.min.distanceTo(this.box.max), p = Math.max(u * 0.02, 0.01);
10446
- let g = 1 / 0, f = -1 / 0, v = 1 / 0, w = -1 / 0;
10446
+ let g = 1 / 0, f = -1 / 0, v = 1 / 0, x = -1 / 0;
10447
10447
  h.forEach((I) => {
10448
- const T = I.clone().sub(r), B = T.dot(a), k = T.dot(c);
10449
- g = Math.min(g, B), f = Math.max(f, B), v = Math.min(v, k), w = Math.max(w, k);
10450
- }), g -= p, f += p, v -= p, w += p;
10451
- const m = r.clone().add(a.clone().multiplyScalar(g)).add(c.clone().multiplyScalar(v)), b = r.clone().add(a.clone().multiplyScalar(f)).add(c.clone().multiplyScalar(v)), A = r.clone().add(a.clone().multiplyScalar(f)).add(c.clone().multiplyScalar(w)), S = r.clone().add(a.clone().multiplyScalar(g)).add(c.clone().multiplyScalar(w));
10448
+ const T = I.clone().sub(r), L = T.dot(a), k = T.dot(c);
10449
+ g = Math.min(g, L), f = Math.max(f, L), v = Math.min(v, k), x = Math.max(x, k);
10450
+ }), g -= p, f += p, v -= p, x += p;
10451
+ const m = r.clone().add(a.clone().multiplyScalar(g)).add(c.clone().multiplyScalar(v)), b = r.clone().add(a.clone().multiplyScalar(f)).add(c.clone().multiplyScalar(v)), A = r.clone().add(a.clone().multiplyScalar(f)).add(c.clone().multiplyScalar(x)), S = r.clone().add(a.clone().multiplyScalar(g)).add(c.clone().multiplyScalar(x));
10452
10452
  this.current_center = r.clone(), this.createFace(i, [m, b, A, S], n, "face"), this.updateTransformControl(s), this.updateRotateControl(s);
10453
10453
  }
10454
10454
  createFace(e, t, i, n) {
@@ -10549,7 +10549,7 @@ class ll {
10549
10549
  const i = e._gizmo?.picker?.[e.mode];
10550
10550
  if (!i)
10551
10551
  return null;
10552
- const n = this.engine.renderer.domElement.getBoundingClientRect(), s = new G(
10552
+ const n = this.engine.renderer.domElement.getBoundingClientRect(), s = new W(
10553
10553
  (t.clientX - n.left) / n.width * 2 - 1,
10554
10554
  -((t.clientY - n.top) / n.height) * 2 + 1
10555
10555
  ), o = new pe();
@@ -10680,7 +10680,7 @@ class ll {
10680
10680
  this.ensureRotateControl(), !(!this.rotateControl || !this.rotateAnchor || !this.current_center) && (this.isSyncingRotateControl = !0, this.rotateAnchor.position.copy(this.current_center), this.rotateAnchor.quaternion.copy(this.getPlaneQuaternion(e)), this.rotateAnchor.visible = this.isActive, this.rotateControl.object !== this.rotateAnchor && this.rotateControl.attach(this.rotateAnchor), this.applyControlModeLock(), this.rotateHelper && (this.rotateHelper.visible = this.isActive), this.isSyncingRotateControl = !1);
10681
10681
  }
10682
10682
  createRaycasterFromMouseEvent(e) {
10683
- const t = new pe(), i = new G(), n = this.engine.renderer.domElement.clientWidth, s = this.engine.renderer.domElement.clientHeight;
10683
+ const t = new pe(), i = new W(), n = this.engine.renderer.domElement.clientWidth, s = this.engine.renderer.domElement.clientHeight;
10684
10684
  return i.x = e.offsetX / n * 2 - 1, i.y = -(e.offsetY / s) * 2 + 1, t.setFromCamera(i, this.engine.camera), t;
10685
10685
  }
10686
10686
  isMobileDevice() {
@@ -10688,7 +10688,7 @@ class ll {
10688
10688
  }
10689
10689
  getTouchPoint(e) {
10690
10690
  const t = e.touches[0] || e.changedTouches[0];
10691
- return t ? new G(t.clientX, t.clientY) : null;
10691
+ return t ? new W(t.clientX, t.clientY) : null;
10692
10692
  }
10693
10693
  createMouseEventFromTouch(e) {
10694
10694
  const t = e.touches[0] || e.changedTouches[0], i = this.engine.renderer?.domElement;
@@ -10896,17 +10896,17 @@ class hl {
10896
10896
  return;
10897
10897
  const o = i.min.distanceTo(i.max), r = o * 5, a = 0.1, c = this.createPlaneBrush(e, r, a), h = [];
10898
10898
  for (const v of s.slice(0, this.maxCandidates)) {
10899
- const w = this.createWorldBrushFromMesh(v);
10900
- if (w != null)
10899
+ const x = this.createWorldBrushFromMesh(v);
10900
+ if (x != null)
10901
10901
  try {
10902
- const b = this.evaluator.evaluate(w, c, Zs)?.geometry;
10902
+ const b = this.evaluator.evaluate(x, c, Zs)?.geometry;
10903
10903
  if (!b)
10904
10904
  continue;
10905
10905
  const A = this.extractPlaneCapGeometry(b, e, a);
10906
10906
  A && h.push(A), b.dispose();
10907
10907
  } catch {
10908
10908
  } finally {
10909
- w.geometry.dispose();
10909
+ x.geometry.dispose();
10910
10910
  }
10911
10911
  }
10912
10912
  if (c.geometry.dispose(), h.length === 0)
@@ -11088,15 +11088,15 @@ class hl {
11088
11088
  const n = e.index ? e.toNonIndexed() : e.clone(), s = n.getAttribute("position");
11089
11089
  if (!s || s.count < 3)
11090
11090
  return n.dispose(), null;
11091
- const o = t.normal.clone().normalize(), r = new d(), a = new d(), c = new d(), h = new d(), u = new d(), p = new d(), g = new d(), f = new d(), v = new d(), w = Math.max(i * 0.35, 1e-4), m = Math.max(i * 0.7, 1e-4), b = [];
11091
+ const o = t.normal.clone().normalize(), r = new d(), a = new d(), c = new d(), h = new d(), u = new d(), p = new d(), g = new d(), f = new d(), v = new d(), x = Math.max(i * 0.35, 1e-4), m = Math.max(i * 0.7, 1e-4), b = [];
11092
11092
  for (let S = 0; S < s.count; S += 3) {
11093
11093
  if (h.fromBufferAttribute(s, S), u.fromBufferAttribute(s, S + 1), p.fromBufferAttribute(s, S + 2), a.subVectors(u, h), c.subVectors(p, h), r.crossVectors(a, c), r.lengthSq() < 1e-14 || (r.normalize(), Math.abs(r.dot(o)) < 0.9))
11094
11094
  continue;
11095
- const I = t.distanceToPoint(h), T = t.distanceToPoint(u), B = t.distanceToPoint(p), k = Math.min(I, T, B);
11096
- if (Math.max(I, T, B) - k > w)
11095
+ const I = t.distanceToPoint(h), T = t.distanceToPoint(u), L = t.distanceToPoint(p), k = Math.min(I, T, L);
11096
+ if (Math.max(I, T, L) - k > x)
11097
11097
  continue;
11098
- const j = (I + T + B) / 3;
11099
- Math.abs(j) > m || j < 0 || (g.copy(h).addScaledVector(o, -I), f.copy(u).addScaledVector(o, -T), v.copy(p).addScaledVector(o, -B), r.dot(o) <= 0 ? (b.push(g.x, g.y, g.z), b.push(f.x, f.y, f.z), b.push(v.x, v.y, v.z)) : (b.push(g.x, g.y, g.z), b.push(v.x, v.y, v.z), b.push(f.x, f.y, f.z)));
11098
+ const K = (I + T + L) / 3;
11099
+ Math.abs(K) > m || K < 0 || (g.copy(h).addScaledVector(o, -I), f.copy(u).addScaledVector(o, -T), v.copy(p).addScaledVector(o, -L), r.dot(o) <= 0 ? (b.push(g.x, g.y, g.z), b.push(f.x, f.y, f.z), b.push(v.x, v.y, v.z)) : (b.push(g.x, g.y, g.z), b.push(v.x, v.y, v.z), b.push(f.x, f.y, f.z)));
11100
11100
  }
11101
11101
  if (n.dispose(), b.length < 9)
11102
11102
  return null;
@@ -11111,8 +11111,8 @@ class hl {
11111
11111
  let a = 1 / 0, c = -1 / 0, h = 1 / 0, u = -1 / 0;
11112
11112
  for (let f = 0; f < i.count; f++) {
11113
11113
  o.fromBufferAttribute(i, f);
11114
- const v = o.dot(n), w = o.dot(s), m = f * 2;
11115
- r[m] = v, r[m + 1] = w, a = Math.min(a, v), c = Math.max(c, v), h = Math.min(h, w), u = Math.max(u, w);
11114
+ const v = o.dot(n), x = o.dot(s), m = f * 2;
11115
+ r[m] = v, r[m + 1] = x, a = Math.min(a, v), c = Math.max(c, v), h = Math.min(h, x), u = Math.max(u, x);
11116
11116
  }
11117
11117
  const p = Math.max(c - a, 1e-6), g = Math.max(u - h, 1e-6);
11118
11118
  for (let f = 0; f < r.length; f += 2)
@@ -11519,10 +11519,10 @@ class ml {
11519
11519
  name: r.categorys[f],
11520
11520
  children: []
11521
11521
  };
11522
- h.push(v), u.filter((w) => w[0] === f).forEach((w) => {
11522
+ h.push(v), u.filter((x) => x[0] === f).forEach((x) => {
11523
11523
  v.children.push({
11524
- name: r.names[w[1]],
11525
- value: r.values[w[2]]
11524
+ name: r.names[x[1]],
11525
+ value: r.values[x[2]]
11526
11526
  });
11527
11527
  });
11528
11528
  }), n != null && n.has(a) && h.push(n.get(a));
@@ -11554,8 +11554,8 @@ class ml {
11554
11554
  分析性質: 10
11555
11555
  };
11556
11556
  return h.sort((f, v) => {
11557
- const w = g[f.name] ?? 99;
11558
- return (g[v.name] ?? 99) - w;
11557
+ const x = g[f.name] ?? 99;
11558
+ return (g[v.name] ?? 99) - x;
11559
11559
  }), c?.({
11560
11560
  properties: h,
11561
11561
  materials: h
@@ -12977,8 +12977,8 @@ class Sl {
12977
12977
  c > Math.PI && (c -= 2 * Math.PI), c < -Math.PI && (c += 2 * Math.PI);
12978
12978
  const h = n.target ? Math.max(i.position.distanceTo(n.target), 1e-3) : 10, u = this.engine.controlModule?.firstPersonControls, p = this.getThirdPersonControl();
12979
12979
  if (u?.enabled) {
12980
- const v = new d(0, 1, 0), w = new Se().setFromAxisAngle(v, -c);
12981
- i.quaternion.premultiply(w), i.up.copy(v), i.updateMatrixWorld(!0);
12980
+ const v = new d(0, 1, 0), x = new Se().setFromAxisAngle(v, -c);
12981
+ i.quaternion.premultiply(x), i.up.copy(v), i.updateMatrixWorld(!0);
12982
12982
  const m = i.position.clone().add(i.getWorldDirection(new d()).multiplyScalar(h));
12983
12983
  n.target?.copy(m), u.syncRotationStateFromCamera?.(), u.syncSharedTargetFromCamera?.();
12984
12984
  return;
@@ -14251,23 +14251,23 @@ class Ui {
14251
14251
  const p = o.ViewDirection || o.viewDirection;
14252
14252
  if (!r || !p)
14253
14253
  return;
14254
- const g = this.toEnginePointFromLike(r), f = o.CameraPosition || o.cameraPosition || null, v = o.CameraTarget || o.cameraTarget || r, w = f ? this.toEnginePointFromLike(f) : null, m = this.toEnginePointFromLike(v), b = new d(
14254
+ const g = this.toEnginePointFromLike(r), f = o.CameraPosition || o.cameraPosition || null, v = o.CameraTarget || o.cameraTarget || r, x = f ? this.toEnginePointFromLike(f) : null, m = this.toEnginePointFromLike(v), b = new d(
14255
14255
  p.X ?? p.x,
14256
14256
  p.Z ?? p.z,
14257
14257
  -(p.Y ?? p.y)
14258
- ).setLength(a), A = w ? w.distanceTo(m) : null, S = o.__dynamic === !0, I = Ui.OPEN_VIEW_ANIMATION_DURATION;
14258
+ ).setLength(a), A = x ? x.distanceTo(m) : null, S = o.__dynamic === !0, I = Ui.OPEN_VIEW_ANIMATION_DURATION;
14259
14259
  if (o.disableClipping === !0)
14260
14260
  this.engine.clipping?.disActive?.();
14261
14261
  else {
14262
- const T = o.ViewRange || o.viewRange, B = this.createViewRangePlanes(T, g);
14263
- B ? this.engine.clipping.setSectionPlanesByViewRange(B) : this.engine.clipping.setSectionByView(g, b), !S && this.engine.camera.type !== "OrthographicCamera" && this.engine.cameraModule.switchToOrthographicCamera(), this.engine.cameraModule.setViewFromOriginAndDirection(
14262
+ const T = o.ViewRange || o.viewRange, L = this.createViewRangePlanes(T, g);
14263
+ L ? this.engine.clipping.setSectionPlanesByViewRange(L) : this.engine.clipping.setSectionByView(g, b), !S && this.engine.camera.type !== "OrthographicCamera" && this.engine.cameraModule.switchToOrthographicCamera(), this.engine.cameraModule.setViewFromOriginAndDirection(
14264
14264
  m,
14265
14265
  b.clone().multiplyScalar(c),
14266
14266
  h,
14267
14267
  A,
14268
14268
  I,
14269
14269
  () => {
14270
- S || (o.focusBox instanceof R && !o.focusBox.isEmpty() ? this.engine.viewCube?.zoomToModel?.(o.focusBox, 0) : B && this.zoomToCurrentViewRange(0)), i?.();
14270
+ S || (o.focusBox instanceof R && !o.focusBox.isEmpty() ? this.engine.viewCube?.zoomToModel?.(o.focusBox, 0) : L && this.zoomToCurrentViewRange(0)), i?.();
14271
14271
  }
14272
14272
  );
14273
14273
  return;
@@ -14294,11 +14294,11 @@ class Ui {
14294
14294
  if (!i || !n || !o || !r || !a || !c)
14295
14295
  return null;
14296
14296
  const h = this.toEnginePoint(o), u = t.clone().sub(h), p = this.shouldCorrectViewRangeOrigin(u) ? u : new d(), g = (v) => {
14297
- const w = o.clone().add(r.clone().multiplyScalar(v.x)).add(a.clone().multiplyScalar(v.y)).add(c.clone().multiplyScalar(v.z));
14298
- return this.toEnginePoint(w).add(p);
14297
+ const x = o.clone().add(r.clone().multiplyScalar(v.x)).add(a.clone().multiplyScalar(v.y)).add(c.clone().multiplyScalar(v.z));
14298
+ return this.toEnginePoint(x).add(p);
14299
14299
  }, f = (v) => {
14300
- const w = r.clone().multiplyScalar(v.x).add(a.clone().multiplyScalar(v.y)).add(c.clone().multiplyScalar(v.z));
14301
- return this.toEngineDirection(w).normalize();
14300
+ const x = r.clone().multiplyScalar(v.x).add(a.clone().multiplyScalar(v.y)).add(c.clone().multiplyScalar(v.z));
14301
+ return this.toEngineDirection(x).normalize();
14302
14302
  };
14303
14303
  return [
14304
14304
  this.createPlane(f(new d(1, 0, 0)), g(new d(i.x, i.y, i.z))),
@@ -15036,26 +15036,26 @@ class oc {
15036
15036
  });
15037
15037
  return N.annotationType = "arrow", N;
15038
15038
  }
15039
- const a = s / r, c = o / r, h = -c, u = a, p = Math.max(10, i.strokeWidth * 6), g = p * 0.72, f = t.x - a * p, v = t.y - c * p, w = f + h * (g * 0.5), m = v + u * (g * 0.5), b = f - h * (g * 0.5), A = v - u * (g * 0.5), S = new si([e.x, e.y, t.x, t.y], {
15039
+ const a = s / r, c = o / r, h = -c, u = a, p = Math.max(10, i.strokeWidth * 6), g = p * 0.72, f = t.x - a * p, v = t.y - c * p, x = f + h * (g * 0.5), m = v + u * (g * 0.5), b = f - h * (g * 0.5), A = v - u * (g * 0.5), S = new si([e.x, e.y, t.x, t.y], {
15040
15040
  stroke: i.stroke,
15041
15041
  strokeWidth: i.strokeWidth,
15042
15042
  fill: "",
15043
15043
  strokeLineCap: "round",
15044
15044
  selectable: !1,
15045
15045
  evented: !1
15046
- }), I = `M ${t.x} ${t.y} L ${w} ${m} L ${b} ${A} Z`, T = new Qi(I, {
15046
+ }), I = `M ${t.x} ${t.y} L ${x} ${m} L ${b} ${A} Z`, T = new Qi(I, {
15047
15047
  fill: i.stroke,
15048
15048
  stroke: i.stroke,
15049
15049
  strokeWidth: 1,
15050
15050
  selectable: !1,
15051
15051
  evented: !1,
15052
15052
  objectCaching: !1
15053
- }), B = new Xi([S, T], {
15053
+ }), L = new Xi([S, T], {
15054
15054
  selectable: n,
15055
15055
  evented: n,
15056
15056
  objectCaching: !1
15057
15057
  });
15058
- return B.annotationType = "arrow", B;
15058
+ return L.annotationType = "arrow", L;
15059
15059
  }
15060
15060
  createCloudObject(e, t, i) {
15061
15061
  const n = this.buildCloudPath(e, t.cloudRadius);
@@ -15100,8 +15100,8 @@ class oc {
15100
15100
  if (p < 0.1)
15101
15101
  continue;
15102
15102
  const g = -u / p, f = h / p, v = Math.max(1, Math.round(p / n));
15103
- for (let w = 1; w <= v; w++) {
15104
- const m = w / v, b = a.x + h * m, A = a.y + u * m, S = o % 2 === 0 ? -1 : 1, I = b + g * i * S, T = A + f * i * S;
15103
+ for (let x = 1; x <= v; x++) {
15104
+ const m = x / v, b = a.x + h * m, A = a.y + u * m, S = o % 2 === 0 ? -1 : 1, I = b + g * i * S, T = A + f * i * S;
15105
15105
  s += ` Q ${I} ${T} ${b} ${A}`, o++;
15106
15106
  }
15107
15107
  }
@@ -15528,7 +15528,7 @@ class rc {
15528
15528
  return !e || !this.engine.camera ? Promise.resolve(null) : (e.style.cursor = "crosshair", new Promise((t) => {
15529
15529
  const i = (n) => {
15530
15530
  n.preventDefault(), n.stopImmediatePropagation(), e.removeEventListener("click", i, !0), e.style.cursor = "";
15531
- const s = e.getBoundingClientRect(), o = n.clientX - s.left, r = n.clientY - s.top, a = new G(
15531
+ const s = e.getBoundingClientRect(), o = n.clientX - s.left, r = n.clientY - s.top, a = new W(
15532
15532
  o / (e.clientWidth || 1) * 2 - 1,
15533
15533
  -(r / (e.clientHeight || 1)) * 2 + 1
15534
15534
  ), c = new pe();
@@ -16193,7 +16193,7 @@ class dc {
16193
16193
  const t = this.engine.renderer?.domElement, i = this.engine.camera;
16194
16194
  if (!t || !i)
16195
16195
  return null;
16196
- const n = t.getBoundingClientRect(), s = e.clientX - n.left, o = e.clientY - n.top, r = new G(s / n.width * 2 - 1, -(o / n.height) * 2 + 1);
16196
+ const n = t.getBoundingClientRect(), s = e.clientX - n.left, o = e.clientY - n.top, r = new W(s / n.width * 2 - 1, -(o / n.height) * 2 + 1);
16197
16197
  this.raycaster.setFromCamera(r, i);
16198
16198
  const a = this.raycaster.intersectObjects(this.rootGroup.children, !0);
16199
16199
  for (const c of a) {
@@ -16509,7 +16509,7 @@ function Ss(l) {
16509
16509
  n.lengthSq() < 1e-8 && (n = new d(0, 1, 0));
16510
16510
  const s = new d().crossVectors(n, i).normalize(), o = new d().crossVectors(s, n).normalize(), r = e.map((c) => {
16511
16511
  const h = c.clone().sub(t);
16512
- return new G(h.dot(o), h.dot(s));
16512
+ return new W(h.dot(o), h.dot(s));
16513
16513
  }), a = new H().makeBasis(o, s, n).setPosition(t);
16514
16514
  return { origin: t, normal: n, matrix: a, localPoints: r };
16515
16515
  }
@@ -16548,13 +16548,13 @@ function Mc(l) {
16548
16548
  }
16549
16549
  class vc {
16550
16550
  render(e) {
16551
- const t = e.instance.style.leaderPoint ?? {}, i = t.strokeColor || e.instance.style.color || "#7ffcff", n = t.backgroundColor || e.instance.style.fillColor || i, s = t.borderColor || i, o = t.anchorColor || n, r = t.anchorRingColor || i, a = t.iconBackgroundColor || n, c = t.side ?? "right", h = t.icon ? this.escapeXmlAttribute(t.icon) : "", u = Math.max(t.iconWidth ?? 22, 1), p = Math.max(t.iconHeight ?? 22, 1), g = (t.text ?? "").trim(), f = Math.max(t.fontSize ?? 14, 10), v = t.textColor || e.instance.style.color || "#ffffff", w = t.fontWeight ?? 500, m = Math.max(Math.round((t.height ?? 8) * 12), 48), b = Math.max(Math.round(Math.abs(t.offsetX ?? t.armLength ?? 4) * 18), 56), A = this.getBoardWidth(e, g, f), S = Math.max(Math.round((t.boardHeight ?? 1.8) * 22), f + 18, 34), I = Math.max(Math.round((t.stemWidth ?? e.instance.style.lineWidth ?? 0.12) * 20), 2), T = t.borderWidth ?? 2.5, B = t.variant ?? "elbow", k = c === "right" ? 22 + b - 8 : 22 - b - A + 8, N = 8, j = Math.min(22, k) - 16, te = Math.max(22, k + A) + 16, Q = Math.max(te - j, 140), ce = Math.max(m + S + 36, 120), ae = 22 - j, le = k - j, fe = ce - 18, Ae = Math.max(fe - m, 14), x = c === "right" ? le : le + A, y = N + Math.round(S * 0.5), C = B === "vertical" ? [`${ae},${fe}`, `${ae},${Ae}`] : [`${ae},${fe}`, `${ae},${y}`, `${x},${y}`], _ = e.instance.selectable !== !1, D = _ ? "visiblePainted" : "none", P = _ ? "pointer" : "default", F = le + (h || !g ? 38 : 12), W = t.showBoard === !1 ? "" : `
16551
+ const t = e.instance.style.leaderPoint ?? {}, i = t.strokeColor || e.instance.style.color || "#7ffcff", n = t.backgroundColor || e.instance.style.fillColor || i, s = t.borderColor || i, o = t.anchorColor || n, r = t.anchorRingColor || i, a = t.iconBackgroundColor || n, c = t.side ?? "right", h = t.icon ? this.escapeXmlAttribute(t.icon) : "", u = Math.max(t.iconWidth ?? 22, 1), p = Math.max(t.iconHeight ?? 22, 1), g = (t.text ?? "").trim(), f = Math.max(t.fontSize ?? 14, 10), v = t.textColor || e.instance.style.color || "#ffffff", x = t.fontWeight ?? 500, m = Math.max(Math.round((t.height ?? 8) * 12), 48), b = Math.max(Math.round(Math.abs(t.offsetX ?? t.armLength ?? 4) * 18), 56), A = this.getBoardWidth(e, g, f), S = Math.max(Math.round((t.boardHeight ?? 1.8) * 22), f + 18, 34), I = Math.max(Math.round((t.stemWidth ?? e.instance.style.lineWidth ?? 0.12) * 20), 2), T = t.borderWidth ?? 2.5, L = t.variant ?? "elbow", k = c === "right" ? 22 + b - 8 : 22 - b - A + 8, N = 8, K = Math.min(22, k) - 16, te = Math.max(22, k + A) + 16, Q = Math.max(te - K, 140), ce = Math.max(m + S + 36, 120), ae = 22 - K, le = k - K, fe = ce - 18, Ae = Math.max(fe - m, 14), w = c === "right" ? le : le + A, y = N + Math.round(S * 0.5), C = L === "vertical" ? [`${ae},${fe}`, `${ae},${Ae}`] : [`${ae},${fe}`, `${ae},${y}`, `${w},${y}`], _ = e.instance.selectable !== !1, D = _ ? "visiblePainted" : "none", P = _ ? "pointer" : "default", F = le + (h || !g ? 38 : 12), G = t.showBoard === !1 ? "" : `
16552
16552
  <rect x="${le}" y="${N}" width="${A}" height="${S}" rx="10"
16553
16553
  fill="${n}" fill-opacity="${t.backgroundOpacity ?? t.boardOpacity ?? 0.18}"
16554
16554
  stroke="${s}" stroke-width="${T}" />
16555
16555
  ${t.iconBackgroundOpacity && t.iconBackgroundOpacity > 0 ? `<circle cx="${le + 19}" cy="${N + 17}" r="11" fill="${a}" fill-opacity="${t.iconBackgroundOpacity}" />` : ""}
16556
16556
  ${h ? `<image href="${h}" x="${le + 8}" y="${N + 6}" width="${u}" height="${p}" preserveAspectRatio="xMidYMid meet" />` : g ? "" : `<circle cx="${le + 19}" cy="${N + 17}" r="8" fill="${i}" />`}
16557
- ${g ? `<text x="${F}" y="${y}" fill="${v}" font-size="${f}" font-weight="${this.escapeXmlAttribute(String(w))}" dominant-baseline="middle">${this.escapeXmlText(g)}</text>` : ""}
16557
+ ${g ? `<text x="${F}" y="${y}" fill="${v}" font-size="${f}" font-weight="${this.escapeXmlAttribute(String(x))}" dominant-baseline="middle">${this.escapeXmlText(g)}</text>` : ""}
16558
16558
  `, q = t.showAnchor === !1 ? "" : `
16559
16559
  <circle cx="${ae}" cy="${fe}" r="7" fill="${o}" fill-opacity="0.92" />
16560
16560
  <circle cx="${ae}" cy="${fe}" r="10" fill="none" stroke="${r}" stroke-width="2" stroke-opacity="0.9" />
@@ -16579,7 +16579,7 @@ class vc {
16579
16579
  stroke-linejoin="round"
16580
16580
  />
16581
16581
  ${q}
16582
- ${W}
16582
+ ${G}
16583
16583
  </g>
16584
16584
  </svg>
16585
16585
  `.trim();
@@ -17825,7 +17825,7 @@ class lt {
17825
17825
  if (t == null || !Number.isFinite(t.x) || !Number.isFinite(t.y))
17826
17826
  return null;
17827
17827
  const i = this.engine.reactBoundingClientRect;
17828
- return new G(
17828
+ return new W(
17829
17829
  t.x + (Number.isFinite(i?.left) ? i.left : 0),
17830
17830
  t.y + (Number.isFinite(i?.top) ? i.top : 0)
17831
17831
  );
@@ -18360,15 +18360,15 @@ class Xc {
18360
18360
  this.selectionPointerDown = null;
18361
18361
  return;
18362
18362
  }
18363
- this.selectionPointerDown = new G(e.clientX, e.clientY);
18363
+ this.selectionPointerDown = new W(e.clientX, e.clientY);
18364
18364
  }
18365
18365
  }
18366
18366
  /** 仅把未拖动的点击视为选中/取消选中,避免旋转视图时隐藏操作柄。 */
18367
18367
  handlePointerUp(e) {
18368
18368
  if (!this.editingEnabled || !this.engine.camera || !this.engine.renderer || !this.selectionPointerDown) return;
18369
18369
  const t = this.selectionPointerDown;
18370
- if (this.selectionPointerDown = null, t.distanceTo(new G(e.clientX, e.clientY)) > 4) return;
18371
- const i = this.engine.renderer.domElement.getBoundingClientRect(), n = new G((e.clientX - i.left) / i.width * 2 - 1, -((e.clientY - i.top) / i.height) * 2 + 1), s = new pe();
18370
+ if (this.selectionPointerDown = null, t.distanceTo(new W(e.clientX, e.clientY)) > 4) return;
18371
+ const i = this.engine.renderer.domElement.getBoundingClientRect(), n = new W((e.clientX - i.left) / i.width * 2 - 1, -((e.clientY - i.top) / i.height) * 2 + 1), s = new pe();
18372
18372
  s.setFromCamera(n, this.engine.camera);
18373
18373
  const o = s.intersectObjects(Array.from(this.modelList.values(), (a) => a.object), !0)[0];
18374
18374
  if (!o) {
@@ -18745,7 +18745,7 @@ class Qc {
18745
18745
  this.emit("progress", this.createProgress(i, "diff", r.processed, o, "正在计算新增构件…")), v = 0;
18746
18746
  for (const [m, b] of c)
18747
18747
  this.throwIfCancelled(i), a.has(m) || h.push(b), r.processed += 1, v += 1, v >= t.batchSize && (v = 0, this.emit("progress", this.createProgress(i, "diff", r.processed, o, "正在计算新增构件…")), await this.yieldToBrowser());
18748
- const w = {
18748
+ const x = {
18749
18749
  runId: i.id,
18750
18750
  addedIds: h.map((m) => this.toComparisonRef(m)),
18751
18751
  removedIds: u.map((m) => this.toComparisonRef(m)),
@@ -18766,7 +18766,7 @@ class Qc {
18766
18766
  boxUnavailable: g.size
18767
18767
  }
18768
18768
  };
18769
- return this.emit("progress", this.createProgress(i, "completed", o, o, "模型对比完成")), w;
18769
+ return this.emit("progress", this.createProgress(i, "completed", o, o, "模型对比完成")), x;
18770
18770
  }
18771
18771
  /** 按 GUID 建立数值包围盒快照;原始节点 ID 仅保留给后续改色和定位。 */
18772
18772
  async createSnapshot(e, t, i, n, s) {
@@ -18779,16 +18779,16 @@ class Qc {
18779
18779
  continue;
18780
18780
  const p = i.getModelKey(h, c, t);
18781
18781
  let g = 0, f = 0;
18782
- for (const [v, w] of u) {
18782
+ for (const [v, x] of u) {
18783
18783
  this.throwIfCancelled(n);
18784
- const m = typeof w?.guid == "string" ? w.guid : "", b = `${p}::${m}`;
18784
+ const m = typeof x?.guid == "string" ? x.guid : "", b = `${p}::${m}`;
18785
18785
  m ? o.has(b) ? f += 1 : o.set(b, {
18786
18786
  key: b,
18787
18787
  modelKey: p,
18788
18788
  modelUrl: String(h?.url ?? ""),
18789
18789
  nodeId: v,
18790
18790
  guid: m,
18791
- box: this.extractBox(w)
18791
+ box: this.extractBox(x)
18792
18792
  }) : g += 1, s.processed += 1, r += 1, r >= i.batchSize && (r = 0, this.emit("progress", this.createProgress(n, "snapshot", s.processed, s.total, `正在扫描${t === "baseline" ? "基准" : "目标"}模型构件…`, t)), await this.yieldToBrowser());
18793
18793
  }
18794
18794
  (g > 0 || f > 0) && console.warn("[ModelComparison] GUID 快照存在不可比较节点", {
@@ -20116,14 +20116,14 @@ class sh {
20116
20116
  const g = String(s[p[0]] ?? ""), f = String(o[p[1]] ?? ""), v = String(r[p[2]] ?? "");
20117
20117
  if (g !== "基础信息" || f !== "解单信息")
20118
20118
  return;
20119
- let w = [];
20119
+ let x = [];
20120
20120
  try {
20121
20121
  const m = JSON.parse(v);
20122
- w = Array.isArray(m) ? m : [];
20122
+ x = Array.isArray(m) ? m : [];
20123
20123
  } catch {
20124
- w = [];
20124
+ x = [];
20125
20125
  }
20126
- w.forEach((m) => {
20126
+ x.forEach((m) => {
20127
20127
  const b = String(m?.code ?? "").trim();
20128
20128
  if (b.length !== 0) {
20129
20129
  if (b.length > 12) {
@@ -20405,7 +20405,7 @@ class ah {
20405
20405
  if (!this.engine.camera || !this.engine.renderer) return null;
20406
20406
  const t = this.engine.renderer.domElement.clientWidth, i = this.engine.renderer.domElement.clientHeight;
20407
20407
  if (!t || !i) return null;
20408
- const n = new G(e.offsetX / t * 2 - 1, -(e.offsetY / i) * 2 + 1), s = new pe();
20408
+ const n = new W(e.offsetX / t * 2 - 1, -(e.offsetY / i) * 2 + 1), s = new pe();
20409
20409
  return s.setFromCamera(n, this.engine.camera), s.intersectObjects(this.pointsGroup.children, !1)[0]?.object ?? null;
20410
20410
  }
20411
20411
  updatePreview(e) {
@@ -20568,9 +20568,9 @@ class ah {
20568
20568
  const s = this.createIconButton("×", "关闭路径绘制", () => this.close());
20569
20569
  t.append(i, n, s), e.appendChild(t), this.statusElement = n;
20570
20570
  const o = document.createElement("div");
20571
- Object.assign(o.style, { display: "grid", gridTemplateColumns: "repeat(3, 1fr)", gap: "4px", padding: "8px" }), ["bezier", "straight", "rounded"].forEach((w) => {
20572
- const m = this.createIconButton(rh[w], oh[w], () => this.setLineType(w));
20573
- m.dataset.lineType = w, m.style.width = "100%", m.style.fontSize = "18px", o.appendChild(m);
20571
+ Object.assign(o.style, { display: "grid", gridTemplateColumns: "repeat(3, 1fr)", gap: "4px", padding: "8px" }), ["bezier", "straight", "rounded"].forEach((x) => {
20572
+ const m = this.createIconButton(rh[x], oh[x], () => this.setLineType(x));
20573
+ m.dataset.lineType = x, m.style.width = "100%", m.style.fontSize = "18px", o.appendChild(m);
20574
20574
  }), e.appendChild(o);
20575
20575
  const r = document.createElement("label");
20576
20576
  r.dataset.radiusRow = "true", Object.assign(r.style, { display: "none", alignItems: "center", gap: "8px", padding: "0 10px 8px", color: "#475569" });
@@ -20578,12 +20578,12 @@ class ah {
20578
20578
  a.textContent = "圆角";
20579
20579
  const c = document.createElement("input");
20580
20580
  c.type = "number", c.min = "0", c.step = "0.1", Object.assign(c.style, { flex: "1", minWidth: "0", height: "26px", padding: "0 7px", color: "#111827", background: "#ffffff", border: "1px solid #cbd5e1", borderRadius: "4px" }), c.addEventListener("change", () => {
20581
- const w = Number(c.value);
20582
- if (!Number.isFinite(w) || w < 0 || w === this.roundedRadius) {
20581
+ const x = Number(c.value);
20582
+ if (!Number.isFinite(x) || x < 0 || x === this.roundedRadius) {
20583
20583
  c.value = String(this.roundedRadius);
20584
20584
  return;
20585
20585
  }
20586
- this.saveHistory(), this.roundedRadius = w, this.refreshAll(), this.emitChange();
20586
+ this.saveHistory(), this.roundedRadius = x, this.refreshAll(), this.emitChange();
20587
20587
  }), r.append(a, c), e.appendChild(r), this.radiusInput = c;
20588
20588
  const h = document.createElement("div");
20589
20589
  Object.assign(h.style, { flex: "1", minHeight: "72px", maxHeight: "200px", overflowY: "auto", overflowX: "hidden", borderTop: "1px solid #e5e7eb" }), e.appendChild(h), this.pointsList = h;
@@ -20869,7 +20869,7 @@ class ph {
20869
20869
  constructor(e) {
20870
20870
  if (window.THREE = Rn, er(), this.options = e, this.container = document.getElementById(e.containerId), !this.container)
20871
20871
  throw new Error(`Container ${e.containerId} not found`);
20872
- if (this.rxQuotaListMapper = new sh(this), this.filterLoaderModel = new lh(this), this.engineModelModule = new Aa(this), this.engineModelModule.init(), this.deviceModule = new Do(this), this.deviceType = this.deviceModule.getDeviceType(), this.cameraModule = new ie(this), this.sceneModule = new _o(this), this.scene = this.sceneModule.scene, this.renderModule = new ko(this), this.renderer = this.renderModule.createRenderer(), this.camera = this.cameraModule.orthographicCamera, this.scene.camera = this.camera, this.renderer) {
20872
+ if (this.rxQuotaListMapper = new sh(this), this.filterLoaderModel = new lh(this), this.engineModelModule = new Aa(this), this.engineModelModule.init(), this.deviceModule = new Do(this), this.deviceType = this.deviceModule.getDeviceType(), this.cameraModule = new ie(this), this.sceneModule = new _o(this), this.scene = this.sceneModule.scene, this.renderModule = new ko(this), this.renderer = this.renderModule.createRenderer(), this.camera = this.cameraModule.perspectiveCamera, this.scene.camera = this.camera, this.renderer) {
20873
20873
  const o = this.renderer;
20874
20874
  o.interactionCullingEnabled = !0, o.interactionActive = !1, o.interactionRenderScene = this.scene, o.interactionFrameBudgetMs = this.options.interactionFrameBudgetMs ?? 6, o.interactionSkipShadows = this.options.interactionSkipShadows ?? !0;
20875
20875
  }
@@ -21225,7 +21225,6 @@ class ph {
21225
21225
  }
21226
21226
  }
21227
21227
  export {
21228
- ne as E,
21229
- nh as M,
21230
- ph as a
21228
+ ph as E,
21229
+ nh as M
21231
21230
  };