iflow-engine-base-3d 3.12.30 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
- import { S as ki, G as pe, P as Xt, O as Be, M as F, V as d, e as et, T as Un, C as Us, W as Li, a as Ws, b as We, N as Bi, c as Gs, d as lt, f as W, Q as Te, E as Wn, R as me, g as tt, h as Gn, B as R, i as zi, A as qn, j as H, k as z, I as V, l as ri, m as ai, n as Kn, o as jn, L as Qt, p as qs, q as Ks, r as js, s as Yi, D as re, t as Xi, u as Ys, F as Xs, v as xe, w as Yn, x as Xn, y as Ri, z as Qs, H as Qn, J as ae, K as $s, U as Zs, X as Et, Y as Js, Z as $n, _ as eo, $ as Ie, a0 as At, a1 as it, a2 as Xe, a3 as $t, a4 as Oi, a5 as Z, a6 as oe, a7 as St, a8 as to, a9 as nt, aa as wi, ab as Ge, ac as Lt, ad as io, ae as no, af as bi, ag as pt, ah as so, ai as ut, aj as oo, ak as ro, al as Zn, am as Zt, an as Pt, ao as Jt, ap as ao, aq as Qi, ar as Tt, as as It, at as lo, au as co, av as $i, aw as ho, ax as uo, ay as po, az as mo, aA as go, aB as fo, aC as yo, aD as Mo, aE as vo, aF as xo, aG as Jn, aH as wo, aI as bo, aJ as Co, aK as Eo, aL as Ao, aM as So, aN as Po, aO as To, aP as Io, aQ as _o } from "./three-vendor-UroN9p1L.js";
2
- import { W as fe, C as Do, L as Mt, B as Zi, g as Oe, a as ko, E as Lo, r as Bo } from "./sdk-runtime-CP-PEZRP.js";
3
- import { r as ee, g as zo } from "./sdk-assets-DHhjv3WO.js";
4
- import { a as ei, J as Ci, c as Ro, b as Oo, P as li, q as Fo, k as No, n as Ji, E as en, S as Ho } from "./sdk-vendor-DYgn7sFs.js";
5
- class Vo {
1
+ import { S as ki, G as pe, P as Xt, O as Be, M as F, V as d, e as et, T as Vn, C as Vs, W as Li, a as Us, b as We, N as Bi, c as Ws, d as lt, f as W, Q as Te, E as Un, R as me, g as tt, h as Wn, B as R, i as zi, A as Gn, j as H, k as z, I as V, l as ri, m as ai, n as qn, o as Kn, L as Qt, p as Gs, q as qs, r as Ks, s as Yi, D as re, t as Xi, u as js, F as Ys, v as xe, w as jn, x as Yn, y as Ri, z as Xs, H as Xn, J as ae, K as Qs, U as $s, X as Et, Y as Zs, Z as Qn, _ as Js, $ as Ie, a0 as At, a1 as it, a2 as Xe, a3 as $t, a4 as Oi, a5 as Z, a6 as oe, a7 as St, a8 as eo, a9 as nt, aa as wi, ab as Ge, ac as Lt, ad as to, ae as io, af as bi, ag as pt, ah as no, ai as ut, aj as so, ak as oo, al as $n, am as Zt, an as Pt, ao as Jt, ap as ro, aq as Qi, ar as Tt, as as It, at as ao, au as lo, av as $i, aw as co, ax as ho, ay as uo, az as po, aA as mo, aB as go, aC as fo, aD as yo, aE as Mo, aF as vo, aG as Zn, aH as xo, aI as wo, aJ as bo, aK as Co, aL as Eo, aM as Ao, aN as So, aO as Po, aP as To, aQ as Io } from "./three-vendor-UroN9p1L.js";
2
+ import { W as fe, C as _o, L as Mt, B as Zi, g as Oe, a as Do, E as ko, r as Lo } from "./sdk-runtime-BQIg-ngM.js";
3
+ import { r as ee, g as Bo } from "./sdk-assets-DHhjv3WO.js";
4
+ import { a as ei, J as Ci, c as zo, b as Ro, P as li, q as Oo, k as Fo, n as Ji, E as en, S as No } from "./sdk-vendor-DYgn7sFs.js";
5
+ class Ho {
6
6
  engine;
7
7
  scene;
8
8
  constructor(e) {
@@ -358,7 +358,7 @@ class ie {
358
358
  l(), h.start(), u();
359
359
  }
360
360
  }
361
- class Uo {
361
+ class Vo {
362
362
  engine;
363
363
  deviceType;
364
364
  constructor(e) {
@@ -423,19 +423,19 @@ class Uo {
423
423
  }
424
424
  }
425
425
  const Fi = 1.1;
426
- function es(a) {
426
+ function Jn(a) {
427
427
  return a?.deviceModule?.isMobile?.() === !0 ? 1 : window.devicePixelRatio || 1;
428
428
  }
429
- class Wo {
429
+ class Uo {
430
430
  engine;
431
431
  renderer;
432
432
  watermark;
433
433
  constructor(e) {
434
- this.engine = e, this.renderer = null, this.watermark = new Do(Un);
434
+ this.engine = e, this.renderer = null, this.watermark = new _o(Vn);
435
435
  }
436
436
  createRenderer() {
437
437
  const { width: e, height: t } = this.engine.deviceModule.getContainerSize(), i = this.engine.deviceModule.isMobile();
438
- return Us.enabled = !0, this.renderer = new Li({
438
+ return Vs.enabled = !0, this.renderer = new Li({
439
439
  // 原生 MSAA 主要覆盖非后处理路径;后处理链路的边缘由 composer 的 samples 和 FXAA 继续处理。
440
440
  antialias: i ? !1 : this.engine.options.antialias ?? !0,
441
441
  alpha: !0,
@@ -443,7 +443,7 @@ class Wo {
443
443
  stencil: !0,
444
444
  // iOS 保留 drawing buffer 会长期占用额外帧缓冲;移动端优先保证大模型稳定加载。
445
445
  preserveDrawingBuffer: !i
446
- }), this.renderer.setClearColor(0, 0), this.renderer.setSize(e, t, !1), this.renderer.setPixelRatio(es(this.engine)), this.renderer.domElement.style.width = "100%", this.renderer.domElement.style.width = "100%", this.renderer.domElement.style.height = "100%", this.renderer.domElement.style.display = "block", this.renderer.shadowMap.enabled = !i, this.renderer.shadowMap.type = Ws, this.renderer.localClippingEnabled = !0, this.renderer.outputColorSpace = We, this.renderer.toneMapping = Bi, this.renderer.toneMappingExposure = Fi, this.engine.container.appendChild(this.renderer.domElement), this.renderer;
446
+ }), this.renderer.setClearColor(0, 0), this.renderer.setSize(e, t, !1), this.renderer.setPixelRatio(Jn(this.engine)), this.renderer.domElement.style.width = "100%", this.renderer.domElement.style.width = "100%", this.renderer.domElement.style.height = "100%", this.renderer.domElement.style.display = "block", this.renderer.shadowMap.enabled = !i, this.renderer.shadowMap.type = Us, this.renderer.localClippingEnabled = !0, this.renderer.outputColorSpace = We, this.renderer.toneMapping = Bi, this.renderer.toneMappingExposure = Fi, this.engine.container.appendChild(this.renderer.domElement), this.renderer;
447
447
  }
448
448
  disposeRenderer() {
449
449
  this.watermark.dispose(), this.renderer?.dispose();
@@ -455,14 +455,14 @@ class Wo {
455
455
  this.renderer && this.watermark.render(this.renderer);
456
456
  }
457
457
  }
458
- const Go = { type: "change" }, tn = { type: "start" }, nn = { type: "end" }, $ = 1e-6, ci = Math.PI * 2, de = {
458
+ const Wo = { type: "change" }, tn = { type: "start" }, nn = { type: "end" }, $ = 1e-6, ci = Math.PI * 2, de = {
459
459
  NONE: -1,
460
460
  ROTATE: 0,
461
461
  PAN: 1,
462
462
  DOLLY: 2,
463
463
  TOUCH_ROTATE: 3,
464
464
  TOUCH_DOLLY_PAN: 4
465
- }, hi = new d(1, 0, 0), qo = new d(0, 1, 0), Ko = new d(0, 0, 1), ct = new d(), Ot = new d(), Ae = new d(), X = new d(), De = new d(), ge = new d(), ke = new d(), jo = new d(), Ft = new Te(), di = new Te(), sn = /* @__PURE__ */ new Set([
465
+ }, hi = new d(1, 0, 0), Go = new d(0, 1, 0), qo = new d(0, 0, 1), ct = new d(), Ot = new d(), Ae = new d(), X = new d(), De = new d(), ge = new d(), ke = new d(), Ko = new d(), Ft = new Te(), di = new Te(), sn = /* @__PURE__ */ new Set([
466
466
  "KeyW",
467
467
  "KeyA",
468
468
  "KeyS",
@@ -492,7 +492,7 @@ function rn(a) {
492
492
  const e = a?.tagName?.toLowerCase?.();
493
493
  return a?.isContentEditable === !0 || e === "input" || e === "textarea" || e === "select";
494
494
  }
495
- class ts extends Gs {
495
+ class es extends Ws {
496
496
  constructor(e, t, i = null) {
497
497
  super(t, i), this.engine = e, this.target = new d(), this.origin = new d(), this.cursor = new d(), this.showOriginIcon = !0, this.auto = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.enableRotate = !0, this.enablePan = !0, this.enableZoom = !0, this.enableDamping = !1, this.rotateSpeed = 0.51, this.panSpeed = 1, this.zoomSpeed = 1, this.touchZoomSpeed = 1.35, this.dampingFactor = 0.08, this.keyRotateSpeed = 1, this.keyPanSpeed = 7, this.keyMoveSpeed = 0.5, this.keyMoveBoost = 2, this.keys = {
498
498
  LEFT: "ArrowLeft",
@@ -540,7 +540,7 @@ class ts extends Gs {
540
540
  const i = typeof e == "number" ? e : null, n = typeof e == "boolean" ? e : !!t, s = this._applyPendingMotion(i);
541
541
  this._alignCamera();
542
542
  const o = n || s || this._hasCameraStateChanged();
543
- return o && (this.dispatchEvent(Go), this._rememberState()), o;
543
+ return o && (this.dispatchEvent(Wo), this._rememberState()), o;
544
544
  }
545
545
  _applyPendingMotion(e) {
546
546
  let t = !1;
@@ -598,7 +598,7 @@ class ts extends Gs {
598
598
  }
599
599
  _applyPan(e, t) {
600
600
  const { width: i, height: n } = on(this.domElement);
601
- X.copy(hi).applyQuaternion(this.object.quaternion).normalize(), De.copy(qo).applyQuaternion(this.object.quaternion).normalize();
601
+ X.copy(hi).applyQuaternion(this.object.quaternion).normalize(), De.copy(Go).applyQuaternion(this.object.quaternion).normalize();
602
602
  let s = 0, o = 0;
603
603
  if (this.object.isPerspectiveCamera) {
604
604
  const l = 2 * Math.max(this.object.position.distanceTo(this.target), $) * Math.tan(F.degToRad(this.object.getEffectiveFOV() * 0.5)), c = l * this.object.aspect;
@@ -624,10 +624,10 @@ class ts extends Gs {
624
624
  ge.copy(this.target).sub(this.object.position), !(ge.lengthSq() < $) && (ge.normalize(), X.copy(this._getStableRightAxis(ge)), De.crossVectors(X, ge).normalize(), De.lengthSq() < $ && De.copy(this._referenceUp), this._viewRight.copy(X), this.object.up.copy(De), this.object.lookAt(this.target), this.object.updateMatrixWorld());
625
625
  }
626
626
  _getStableRightAxis(e) {
627
- return X.crossVectors(e, this._referenceUp), X.lengthSq() < $ && (X.copy(this._viewRight), X.addScaledVector(e, -X.dot(e))), X.lengthSq() < $ && (X.copy(hi), X.addScaledVector(e, -X.dot(e))), X.lengthSq() < $ && (X.copy(Ko), X.addScaledVector(e, -X.dot(e))), X.normalize(), this._viewRight.lengthSq() > $ && X.dot(this._viewRight) < 0 && X.negate(), X;
627
+ return X.crossVectors(e, this._referenceUp), X.lengthSq() < $ && (X.copy(this._viewRight), X.addScaledVector(e, -X.dot(e))), X.lengthSq() < $ && (X.copy(hi), X.addScaledVector(e, -X.dot(e))), X.lengthSq() < $ && (X.copy(qo), X.addScaledVector(e, -X.dot(e))), X.normalize(), this._viewRight.lengthSq() > $ && X.dot(this._viewRight) < 0 && X.negate(), X;
628
628
  }
629
629
  _getRotatePivot() {
630
- return Ye(this.origin) ? this.origin.distanceToSquared(this.target) < $ ? this.target : jo.copy(this.origin) : this.target;
630
+ return Ye(this.origin) ? this.origin.distanceToSquared(this.target) < $ ? this.target : Ko.copy(this.origin) : this.target;
631
631
  }
632
632
  _hasCameraStateChanged() {
633
633
  const e = this.object.isOrthographicCamera && Math.abs(this.object.zoom - this._lastZoom) > $;
@@ -774,7 +774,7 @@ class ts extends Gs {
774
774
  this.enableZoom && (this._zoomVelocity += e);
775
775
  }
776
776
  }
777
- class an extends Wn {
777
+ class an extends Un {
778
778
  constructor(e, t, i, n) {
779
779
  super(), this._Engine = e, this.camera = t, this.object = t, this.domElement = i, this._isEnabled = !1, this._rayOriginOffset = new d(0, -1, 0), this._camerLocalDirection = new d(), this._tmpVector = new d(), this._lookDirection = new d(), this._rayCaster = new me(), this._fallingTime = 0, this._isMouseInElement = !1, this._euler = new tt(0, 0, 0, "YZX"), this._prevMouseX = 0, this._prevMouseY = 0, this._pointerLookActive = !1, this._externalLookActive = !1, this._interactionActive = !1, this._sharedTargetDistance = 10, this.target = this.camera.position.clone().add(
780
780
  new d(0, 0, -1).applyQuaternion(this.camera.quaternion).normalize().multiplyScalar(this._sharedTargetDistance)
@@ -1136,7 +1136,7 @@ class an extends Wn {
1136
1136
  return r;
1137
1137
  }
1138
1138
  }
1139
- const Yo = ee("/assets/worker_walk.glb", import.meta.url), Xo = Math.PI, Qo = {
1139
+ const jo = ee("/assets/worker_walk.glb", import.meta.url), Yo = Math.PI, Xo = {
1140
1140
  16: "ShiftLeft",
1141
1141
  37: "ArrowLeft",
1142
1142
  38: "ArrowUp",
@@ -1160,9 +1160,9 @@ const Yo = ee("/assets/worker_walk.glb", import.meta.url), Xo = Math.PI, Qo = {
1160
1160
  jump: ["Space"],
1161
1161
  boost: ["ShiftLeft", "ShiftRight"]
1162
1162
  };
1163
- class ln extends Wn {
1163
+ class ln extends Un {
1164
1164
  constructor(e, t, i, n = {}) {
1165
- super(), this._Engine = e, this.camera = t, this.object = t, this.domElement = i, this._isEnabled = !1, this.target = new d(), this.auto = !1, this.applyGravity = n.applyGravity ?? !0, this.gravityMinHeight = !0, this.applyCollision = n.applyCollision ?? !0, this.positionEasing = !0, this.lookflag = 1, this.lookHorizontalFlag = 1, this.lookSpeed = n.lookSpeed ?? 3e-3, this.moveSpeed = n.moveSpeed ?? 0.02, this.playerHeight = n.playerHeight ?? 1.6, this.playerRadius = n.playerRadius ?? 0.3, this.cameraDistance = n.cameraDistance ?? 2, this.cameraHeight = n.cameraHeight ?? 0, this.targetHeight = n.targetHeight ?? this.playerHeight, this.cameraCollisionTargetHeight = n.cameraCollisionTargetHeight ?? this.playerHeight + 0.1, this.cameraCollisionInterval = Math.max(1, Math.floor(n.cameraCollisionInterval ?? 20)), this.cameraCollisionPadding = n.cameraCollisionPadding ?? 0.15, this.minCameraCollisionDistance = n.minCameraCollisionDistance ?? 0.35, this.jumpSpeed = n.jumpSpeed ?? 0.24, this.jumpGravity = n.jumpGravity ?? 0.012, this.maxRotateX = n.maxPitch ?? Math.PI * 0.45, this.minPitch = n.minPitch ?? -Math.PI * 0.38, this.g = 9.8, this._moveInput = new d(), this._moveDirection = new d(), this._rayCaster = new me(), this._cameraRayCaster = new me(), this._cameraCollisionFrame = 0, this._lastCameraSafeDistance = null, this._fallingTime = 0, this._isMouseInElement = !1, this._prevMouseX = 0, this._prevMouseY = 0, this._dragRotateThreshold = n.dragRotateThreshold ?? 2, this._pointerLookActive = !1, this._externalLookActive = !1, this._scriptedMotionActive = !1, this._interactionActive = !1, this._yaw = 0, this._pitch = n.initialPitch ?? 0, this._pressedKeys = /* @__PURE__ */ new Set(), this._verticalVelocity = 0, this._isJumping = !1, this._isJumpKeyDown = !1, this._jumpStartHeight = 0, this.avatarRoot = new pe(), this.avatarRoot.name = "ThirdPersonAvatarRoot", this.avatarRoot.visible = n.visible ?? !0, this.avatarMixer = null, this.avatarWalkAction = null, this._isWalkActionPlaying = !1, this._avatarAnimationTimer = new Gn(), this._avatarAnimationTimer.connect(document), this._avatarLoadRequestId = 0, this.defaultAvatarUrl = n.avatarUrl ?? Yo, this._ownsAvatarResources = !n.avatar, this.avatar = n.avatar || this.createDefaultAvatar(), this.avatar.name = this.avatar.name || "ThirdPersonAvatar", this.avatarRoot.add(this.avatar), !n.avatar && this.defaultAvatarUrl && this.loadAvatarModel(this.defaultAvatarUrl, n.avatarOptions);
1165
+ super(), this._Engine = e, this.camera = t, this.object = t, this.domElement = i, this._isEnabled = !1, this.target = new d(), this.auto = !1, this.applyGravity = n.applyGravity ?? !0, this.gravityMinHeight = !0, this.applyCollision = n.applyCollision ?? !0, this.positionEasing = !0, this.lookflag = 1, this.lookHorizontalFlag = 1, this.lookSpeed = n.lookSpeed ?? 3e-3, this.moveSpeed = n.moveSpeed ?? 0.02, this.playerHeight = n.playerHeight ?? 1.6, this.playerRadius = n.playerRadius ?? 0.3, this.cameraDistance = n.cameraDistance ?? 2, this.cameraHeight = n.cameraHeight ?? 0, this.targetHeight = n.targetHeight ?? this.playerHeight, this.cameraCollisionTargetHeight = n.cameraCollisionTargetHeight ?? this.playerHeight + 0.1, this.cameraCollisionInterval = Math.max(1, Math.floor(n.cameraCollisionInterval ?? 20)), this.cameraCollisionPadding = n.cameraCollisionPadding ?? 0.15, this.minCameraCollisionDistance = n.minCameraCollisionDistance ?? 0.35, this.jumpSpeed = n.jumpSpeed ?? 0.24, this.jumpGravity = n.jumpGravity ?? 0.012, this.maxRotateX = n.maxPitch ?? Math.PI * 0.45, this.minPitch = n.minPitch ?? -Math.PI * 0.38, this.g = 9.8, this._moveInput = new d(), this._moveDirection = new d(), this._rayCaster = new me(), this._cameraRayCaster = new me(), this._cameraCollisionFrame = 0, this._lastCameraSafeDistance = null, this._fallingTime = 0, this._isMouseInElement = !1, this._prevMouseX = 0, this._prevMouseY = 0, this._dragRotateThreshold = n.dragRotateThreshold ?? 2, this._pointerLookActive = !1, this._externalLookActive = !1, this._scriptedMotionActive = !1, this._interactionActive = !1, this._yaw = 0, this._pitch = n.initialPitch ?? 0, this._pressedKeys = /* @__PURE__ */ new Set(), this._verticalVelocity = 0, this._isJumping = !1, this._isJumpKeyDown = !1, this._jumpStartHeight = 0, this.avatarRoot = new pe(), this.avatarRoot.name = "ThirdPersonAvatarRoot", this.avatarRoot.visible = n.visible ?? !0, this.avatarMixer = null, this.avatarWalkAction = null, this._isWalkActionPlaying = !1, this._avatarAnimationTimer = new Wn(), this._avatarAnimationTimer.connect(document), this._avatarLoadRequestId = 0, this.defaultAvatarUrl = n.avatarUrl ?? jo, this._ownsAvatarResources = !n.avatar, this.avatar = n.avatar || this.createDefaultAvatar(), this.avatar.name = this.avatar.name || "ThirdPersonAvatar", this.avatarRoot.add(this.avatar), !n.avatar && this.defaultAvatarUrl && this.loadAvatarModel(this.defaultAvatarUrl, n.avatarOptions);
1166
1166
  const s = this.isPcDevice();
1167
1167
  this.bindmousedown = s ? this.onMouseDown.bind(this) : this.onTouchStart.bind(this), this.bindmouseup = s ? this.onMouseUp.bind(this) : this.onTouchEnd.bind(this), this.bindmousemove = s ? this.onMouseMove.bind(this) : this.onTouchMove.bind(this), this.bindonKeyDown = this.onKeyDown.bind(this), this.bindonKeyUp = this.onKeyUp.bind(this), this.bindWindowBlur = this.onWindowBlur.bind(this), this.bindVisibilityChange = this.onVisibilityChange.bind(this), this.bindMouseEnter = this.onMouseEnter.bind(this), this.bindMouseLeave = this.onMouseLeave.bind(this), this.initAvatarPoseFromCamera();
1168
1168
  }
@@ -1223,7 +1223,7 @@ class ln extends Wn {
1223
1223
  alignToFeet: !0,
1224
1224
  fitToPlayerHeight: !0,
1225
1225
  ownsResources: !0,
1226
- yawOffset: Xo,
1226
+ yawOffset: Yo,
1227
1227
  ...t
1228
1228
  }), this.setupAvatarAnimation(o, s.animations || []);
1229
1229
  },
@@ -1237,7 +1237,7 @@ class ln extends Wn {
1237
1237
  setupAvatarAnimation(e, t) {
1238
1238
  if (!t.length)
1239
1239
  return;
1240
- this.avatarMixer = new qn(e);
1240
+ this.avatarMixer = new Gn(e);
1241
1241
  const i = t.find((n) => /walk|run|move/i.test(n.name)) || t[0];
1242
1242
  this.avatarWalkAction = this.avatarMixer.clipAction(i), this.avatarWalkAction.enabled = !0, this.avatarWalkAction.clampWhenFinished = !1, this.avatarWalkAction.setEffectiveWeight(1), this.avatarWalkAction.paused = !0, this.avatarWalkAction.play(), this._avatarAnimationTimer.reset();
1243
1243
  }
@@ -1342,7 +1342,7 @@ class ln extends Wn {
1342
1342
  }
1343
1343
  }
1344
1344
  getEventCode(e) {
1345
- return e.code || Qo[e.keyCode] || e.key || "";
1345
+ return e.code || Xo[e.keyCode] || e.key || "";
1346
1346
  }
1347
1347
  hasPressed(e) {
1348
1348
  return e.some((t) => this._pressedKeys.has(t));
@@ -1599,11 +1599,11 @@ class ln extends Wn {
1599
1599
  });
1600
1600
  }
1601
1601
  }
1602
- const Ei = "__isModelUrlGroup", ti = "__modelDepthBias", is = 4;
1603
- function ns(a) {
1602
+ const Ei = "__isModelUrlGroup", ti = "__modelDepthBias", ts = 4;
1603
+ function is(a) {
1604
1604
  return a.__modelGroupMap instanceof Map || (a.__modelGroupMap = /* @__PURE__ */ new Map()), a.__modelGroupMap;
1605
1605
  }
1606
- function ss(a) {
1606
+ function ns(a) {
1607
1607
  return a.__modelObjectIndexMap instanceof Map || (a.__modelObjectIndexMap = /* @__PURE__ */ new Map()), a.__modelObjectIndexMap;
1608
1608
  }
1609
1609
  function Ai(a, e) {
@@ -1622,7 +1622,7 @@ function vt(a, e, t) {
1622
1622
  i != null && (Array.isArray(i.urls) || (i.urls = []), i.urls.includes(t) || i.urls.push(t));
1623
1623
  }
1624
1624
  function $e(a, e) {
1625
- const t = ns(a), i = t.get(e);
1625
+ const t = is(a), i = t.get(e);
1626
1626
  if (i && i.parent != null)
1627
1627
  return i;
1628
1628
  const n = Hi(a, e);
@@ -1640,11 +1640,11 @@ function ot(a, e) {
1640
1640
  if (t != null)
1641
1641
  return t;
1642
1642
  const i = new pe();
1643
- Ai(i, e), a.scene.add(i), ns(a).set(e, i);
1643
+ Ai(i, e), a.scene.add(i), is(a).set(e, i);
1644
1644
  const s = Hi(a, e);
1645
1645
  return s != null && (s.group = i), i;
1646
1646
  }
1647
- function $o(a) {
1647
+ function Qo(a) {
1648
1648
  const e = [], t = /* @__PURE__ */ new Set();
1649
1649
  return (Array.isArray(a?.models) ? a.models : []).forEach((n) => {
1650
1650
  if (n?.url == null)
@@ -1657,7 +1657,7 @@ function $o(a) {
1657
1657
  }
1658
1658
  function _t(a, e) {
1659
1659
  const t = [], i = /* @__PURE__ */ new Set();
1660
- return $o(a).forEach((s) => {
1660
+ return Qo(a).forEach((s) => {
1661
1661
  s.traverse((o) => {
1662
1662
  o === s || i.has(o.uuid) || e(o) && (i.add(o.uuid), t.push(o));
1663
1663
  });
@@ -1674,7 +1674,7 @@ function _t(a, e) {
1674
1674
  function Vi(a) {
1675
1675
  return _t(a, (e) => e instanceof z && !(e instanceof V));
1676
1676
  }
1677
- function Zo(a) {
1677
+ function $o(a) {
1678
1678
  if (typeof a.__modelObjectIndexSeed == "number")
1679
1679
  return;
1680
1680
  let e = -1;
@@ -1682,24 +1682,24 @@ function Zo(a) {
1682
1682
  typeof t?.index == "number" && Number.isFinite(t.index) && (e = Math.max(e, t.index));
1683
1683
  }), a.__modelObjectIndexSeed = e + 1;
1684
1684
  }
1685
- function Jo(a) {
1686
- Zo(a);
1685
+ function Zo(a) {
1686
+ $o(a);
1687
1687
  const e = a.__modelObjectIndexSeed;
1688
1688
  return a.__modelObjectIndexSeed += 1, e;
1689
1689
  }
1690
1690
  function Ui(a, e, t) {
1691
- const i = typeof t == "number" ? t : Jo(a);
1692
- return e.index = i, ss(a).set(i, e), i;
1691
+ const i = typeof t == "number" ? t : Zo(a);
1692
+ return e.index = i, ns(a).set(i, e), i;
1693
1693
  }
1694
- function os(a) {
1694
+ function ss(a) {
1695
1695
  return Array.isArray(a) ? a : a != null ? [a] : [];
1696
1696
  }
1697
- function er(a) {
1697
+ function Jo(a) {
1698
1698
  return 1 + (Number.isFinite(a) ? Math.abs(Math.floor(a)) : 0) % 16 * 0.125;
1699
1699
  }
1700
1700
  function Wi(a, e) {
1701
- const t = typeof e == "number" ? e : a?.index, i = er(t);
1702
- os(a?.material).forEach((n) => {
1701
+ const t = typeof e == "number" ? e : a?.index, i = Jo(t);
1702
+ ss(a?.material).forEach((n) => {
1703
1703
  n.userData = n.userData ?? {};
1704
1704
  const s = n.userData[ti] ?? {};
1705
1705
  n.userData[ti] = {
@@ -1707,30 +1707,30 @@ function Wi(a, e) {
1707
1707
  enabled: !0,
1708
1708
  factor: 1,
1709
1709
  units: i
1710
- }, n.polygonOffset = !0, n.polygonOffsetFactor = 1, n.polygonOffsetUnits = i + (s.edgeActive ? is : 0), n.needsUpdate = !0;
1710
+ }, n.polygonOffset = !0, n.polygonOffsetFactor = 1, n.polygonOffsetUnits = i + (s.edgeActive ? ts : 0), n.needsUpdate = !0;
1711
1711
  });
1712
1712
  }
1713
1713
  function cn(a, e) {
1714
- os(a?.material).forEach((t) => {
1714
+ ss(a?.material).forEach((t) => {
1715
1715
  t.userData = t.userData ?? {};
1716
1716
  const i = t.userData[ti] ?? {}, n = i.enabled ? i.units : t.polygonOffsetUnits ?? 0, s = i.enabled ? i.factor : t.polygonOffsetFactor ?? 1;
1717
1717
  t.userData[ti] = {
1718
1718
  ...i,
1719
1719
  edgeActive: e
1720
- }, i.enabled || e ? (t.polygonOffset = !1, t.polygonOffsetFactor = s, t.polygonOffsetUnits = n + (e ? is : 0)) : t.polygonOffset = !1, t.needsUpdate = !0;
1720
+ }, i.enabled || e ? (t.polygonOffset = !1, t.polygonOffsetFactor = s, t.polygonOffsetUnits = n + (e ? ts : 0)) : t.polygonOffset = !1, t.needsUpdate = !0;
1721
1721
  });
1722
1722
  }
1723
1723
  function Le(a, e) {
1724
1724
  if (!Number.isFinite(e))
1725
1725
  return;
1726
- const t = ss(a), i = t.get(e);
1726
+ const t = ns(a), i = t.get(e);
1727
1727
  if (i && i.parent != null)
1728
1728
  return i;
1729
1729
  i && i.parent == null && t.delete(e);
1730
1730
  const n = _t(a, (s) => s.index === e)[0];
1731
1731
  return n != null ? (t.set(e, n), n) : a?.scene?.children?.find?.((s) => s?.index === e);
1732
1732
  }
1733
- class tr {
1733
+ class er {
1734
1734
  constructor(e) {
1735
1735
  this.engine = e;
1736
1736
  }
@@ -1953,7 +1953,7 @@ function Gi(a) {
1953
1953
  touchControlsSnapshot: null,
1954
1954
  mouseMoveFrame: null,
1955
1955
  latestMouseMoveEvent: null
1956
- }, t = 800, i = 28, n = 132, s = 44, o = 168, r = new tr(a);
1956
+ }, t = 800, i = 28, n = 132, s = 44, o = 168, r = new er(a);
1957
1957
  e.handle_catch = function(v, A, B = !0, U = !0) {
1958
1958
  const Y = e.options;
1959
1959
  e.options = {
@@ -2221,7 +2221,7 @@ function Gi(a) {
2221
2221
  e.lastPoint = null;
2222
2222
  }, e;
2223
2223
  }
2224
- class ir {
2224
+ class tr {
2225
2225
  engine;
2226
2226
  orbitControls;
2227
2227
  firstPersonControls;
@@ -2247,7 +2247,7 @@ class ir {
2247
2247
  this.engine = e, this.init(), this.handelBehaved = Gi(this.engine), this.handelBehaved.init(this, null), this.handelBehaved.active();
2248
2248
  }
2249
2249
  init() {
2250
- this.orbitControls = new ts(this.engine, this.engine.camera, this.engine.renderer.domElement), this.orbitControls.showOriginIcon = !0, this.firstPersonControls = new an(this.engine, this.engine.camera, this.engine.renderer.domElement), this.thirdPersonControls = new ln(this.engine, this.engine.camera, this.engine.renderer.domElement), this.applyRoamLookDirection(this.firstPersonControls), this.applyRoamLookDirection(this.thirdPersonControls);
2250
+ this.orbitControls = new es(this.engine, this.engine.camera, this.engine.renderer.domElement), this.orbitControls.showOriginIcon = !0, this.firstPersonControls = new an(this.engine, this.engine.camera, this.engine.renderer.domElement), this.thirdPersonControls = new ln(this.engine, this.engine.camera, this.engine.renderer.domElement), this.applyRoamLookDirection(this.firstPersonControls), this.applyRoamLookDirection(this.thirdPersonControls);
2251
2251
  const e = document.createElement("div");
2252
2252
  this.originDiv = e, e.className = "originDiv", e.style.position = "absolute", e.style.top = "0px", e.style.left = "0px", e.style.width = "30px", e.style.height = "30px", e.style.borderRadius = "50%", e.style.pointerEvents = "none", e.style.backgroundImage = `url(${ee("/assets/svg/rotate-orbit.svg", import.meta.url)})`, this.engine.container.appendChild(this.originDiv);
2253
2253
  }
@@ -2543,7 +2543,7 @@ class ir {
2543
2543
  this.isActive = !1, this.handelBehaved?.disActive?.(), this.orbitControls?.dispose?.(), this.firstPersonControls?.dispose?.(), this.thirdPersonControls?.dispose?.(), this.removeMobileRoamControls(), this.originDiv?.remove(), this.originDiv = null, this.orbitControls = null, this.firstPersonControls = null, this.thirdPersonControls = null, this.handelBehaved = null;
2544
2544
  }
2545
2545
  }
2546
- const nr = {
2546
+ const ir = {
2547
2547
  uniforms: {
2548
2548
  tDiffuse: { value: null },
2549
2549
  saturation: { value: 1.2 },
@@ -2579,8 +2579,8 @@ const nr = {
2579
2579
  gl_FragColor = color;
2580
2580
  }
2581
2581
  `
2582
- }, rs = 0.5, as = 1.1, ls = 1;
2583
- class sr {
2582
+ }, os = 0.5, rs = 1.1, as = 1;
2583
+ class nr {
2584
2584
  engine;
2585
2585
  composer;
2586
2586
  saturationPass;
@@ -2665,16 +2665,16 @@ class sr {
2665
2665
  this.composer && (this.syncAmbientOcclusionDepthTextures(), this.composer.render());
2666
2666
  }
2667
2667
  init() {
2668
- const { width: e, height: t } = this.engine.deviceModule.getContainerSize(), i = this.engine.scene, n = this.engine.camera, s = this.engine.renderer, o = this.engine.deviceModule.isMobile(), r = this.engine.renderer?.getPixelRatio?.() ?? window.devicePixelRatio ?? 1, l = new Kn(e, t, {
2668
+ const { width: e, height: t } = this.engine.deviceModule.getContainerSize(), i = this.engine.scene, n = this.engine.camera, s = this.engine.renderer, o = this.engine.deviceModule.isMobile(), r = this.engine.renderer?.getPixelRatio?.() ?? window.devicePixelRatio ?? 1, l = o ? this.engine.mobileMemoryProfile.samples : 4, c = new qn(e, t, {
2669
2669
  minFilter: Qt,
2670
2670
  magFilter: Qt,
2671
- format: jn,
2672
- // 移动端关闭多重采样,避免全分辨率多采样缓冲造成显存峰值。
2673
- samples: o ? 1 : 4
2671
+ format: Kn,
2672
+ // 移动端按设备内存控制多重采样,平衡边缘质量与全分辨率缓冲占用。
2673
+ samples: l
2674
2674
  });
2675
- l.texture.colorSpace = qs, this.composer = new Ks(s, l), this.composer.setPixelRatio(r), this.composer.setSize(e, t);
2676
- const c = new js(i, n);
2677
- this.composer.addPass(c), this.gtaoPass = new Yi(i, n, e, t), this.gtaoPass.output = Yi.OUTPUT.Default, this.gtaoPass.blendIntensity = rs, this.gtaoPass.enabled = !1, this.gtaoPass.normalMaterial.side = re, this.gtaoPass.normalMaterial.needsUpdate = !0, this.excludeClippingHelpersFromGtao(this.gtaoPass), this.gtaoPass.updateGtaoMaterial && this.gtaoPass.updateGtaoMaterial({
2675
+ c.texture.colorSpace = Gs, this.composer = new qs(s, c), this.composer.setPixelRatio(r), this.composer.setSize(e, t);
2676
+ const h = new Ks(i, n);
2677
+ this.composer.addPass(h), this.gtaoPass = new Yi(i, n, e, t), this.gtaoPass.output = Yi.OUTPUT.Default, this.gtaoPass.blendIntensity = os, this.gtaoPass.enabled = !1, this.gtaoPass.normalMaterial.side = re, this.gtaoPass.normalMaterial.needsUpdate = !0, this.excludeClippingHelpersFromGtao(this.gtaoPass), this.gtaoPass.updateGtaoMaterial && this.gtaoPass.updateGtaoMaterial({
2678
2678
  // AO 采样半径。推荐范围:0.1 ~ 2.0。
2679
2679
  // 越大遮蔽范围越广,但容易发灰、丢细节;对性能有轻到中等影响。
2680
2680
  radius: 0.45,
@@ -2700,7 +2700,7 @@ class sr {
2700
2700
  samples: 32,
2701
2701
  rings: 3,
2702
2702
  radiusExponent: 2
2703
- }), this.applyClippingToAmbientOcclusionPass(this.gtaoPass), this.composer.addPass(this.gtaoPass), this.ssaoPass = new Xi(i, n, e, t), this.ssaoPass.kernelRadius = 8, this.ssaoPass.minDistance = 5e-3, this.ssaoPass.maxDistance = 0.1, this.ssaoPass.output = Xi.OUTPUT.Default, this.ssaoPass.enabled = !1, this.excludeClippingHelpersFromGtao(this.ssaoPass), this.applyClippingToAmbientOcclusionPass(this.ssaoPass), this.composer.addPass(this.ssaoPass), this.saturationPass = new ai(nr), this.saturationPass.uniforms.saturation.value = as, this.saturationPass.uniforms.contrast.value = ls, this.saturationPass.enabled = !1, this.composer.addPass(this.saturationPass), this.outputPass = new Ys(), this.outputPass.enabled = !0, this.composer.addPass(this.outputPass), this.fxaaPass = new ai(Xs), this.fxaaPass.material.uniforms.resolution.value.x = 1 / (e * r), this.fxaaPass.material.uniforms.resolution.value.y = 1 / (t * r), this.fxaaPass.enabled = o, this.composer.addPass(this.fxaaPass), this.syncAmbientOcclusionDepthTextures();
2703
+ }), this.applyClippingToAmbientOcclusionPass(this.gtaoPass), this.composer.addPass(this.gtaoPass), this.ssaoPass = new Xi(i, n, e, t), this.ssaoPass.kernelRadius = 8, this.ssaoPass.minDistance = 5e-3, this.ssaoPass.maxDistance = 0.1, this.ssaoPass.output = Xi.OUTPUT.Default, this.ssaoPass.enabled = !1, this.excludeClippingHelpersFromGtao(this.ssaoPass), this.applyClippingToAmbientOcclusionPass(this.ssaoPass), this.composer.addPass(this.ssaoPass), this.saturationPass = new ai(ir), this.saturationPass.uniforms.saturation.value = rs, this.saturationPass.uniforms.contrast.value = as, this.saturationPass.enabled = !1, this.composer.addPass(this.saturationPass), this.outputPass = new js(), this.outputPass.enabled = !0, this.composer.addPass(this.outputPass), this.fxaaPass = new ai(Ys), this.fxaaPass.material.uniforms.resolution.value.x = 1 / (e * r), this.fxaaPass.material.uniforms.resolution.value.y = 1 / (t * r), this.fxaaPass.enabled = o, this.composer.addPass(this.fxaaPass), this.syncAmbientOcclusionDepthTextures();
2704
2704
  }
2705
2705
  }
2706
2706
  function Dt(a) {
@@ -2710,7 +2710,7 @@ function Dt(a) {
2710
2710
  i = n[1];
2711
2711
  a.name = t, a.guid = i;
2712
2712
  }
2713
- function or(a, e, t, i) {
2713
+ function sr(a, e, t, i) {
2714
2714
  const r = a.models.find((x) => x.url == t);
2715
2715
  if (r == null)
2716
2716
  return;
@@ -2721,7 +2721,7 @@ function or(a, e, t, i) {
2721
2721
  }, x.rotation = { x: 0, y: 0, z: 0 }, x), M = (x, m) => {
2722
2722
  if (!Array.isArray(m) || m.length === 0)
2723
2723
  return;
2724
- const b = m.map((S) => y(S)), C = ar(x, l, b, t, a);
2724
+ const b = m.map((S) => y(S)), C = rr(x, l, b, t, a);
2725
2725
  C != null && b.forEach((S, I) => {
2726
2726
  const P = [[C, I, 0, 0]];
2727
2727
  S.indexes = P, S.id = Number(S.id);
@@ -2729,9 +2729,9 @@ function or(a, e, t, i) {
2729
2729
  Dt(L), r.nodesMap.set(Number(S.id), L), c.push(Number(S.id));
2730
2730
  });
2731
2731
  };
2732
- M("Circle", h), M("Rect", u), M("Ellipse", g), M("Bridge", p), rr(r, c);
2732
+ M("Circle", h), M("Rect", u), M("Ellipse", g), M("Bridge", p), or(r, c);
2733
2733
  }
2734
- function rr(a, e) {
2734
+ function or(a, e) {
2735
2735
  if (e.length === 0 || !Array.isArray(a?.lods))
2736
2736
  return;
2737
2737
  const i = a.lods[0]?.octreeBox;
@@ -2743,7 +2743,7 @@ function rr(a, e) {
2743
2743
  n.has(s) || (i.elements.push(s), n.add(s));
2744
2744
  });
2745
2745
  }
2746
- function ar(a, e, t, i, n) {
2746
+ function rr(a, e, t, i, n) {
2747
2747
  let s;
2748
2748
  const o = {
2749
2749
  width: 1,
@@ -2821,7 +2821,7 @@ function ar(a, e, t, i, n) {
2821
2821
  return r.meshs = p, r.instanceMatrix && r.instanceMatrix.array && (r.cloneInstanceMatrix = Array.from(r.instanceMatrix.array)), r.instanceMatrix.needsUpdate = !0, l;
2822
2822
  }
2823
2823
  function Ht(a, e) {
2824
- const t = new Yn();
2824
+ const t = new jn();
2825
2825
  switch (e.width = e.width * 0.3048, e.height = e.height * 0.3048, e.diameter = e.diameter * 0.3048, a) {
2826
2826
  case "Rect":
2827
2827
  t.moveTo(-e.width / 2, -e.height / 2), t.lineTo(-e.width / 2, e.height / 2), t.lineTo(e.width / 2, e.height / 2), t.lineTo(e.width / 2, -e.height / 2), t.lineTo(-e.width / 2, -e.height / 2);
@@ -2842,7 +2842,7 @@ function Ht(a, e) {
2842
2842
  };
2843
2843
  return n(t, i, e.color, e.position, e.rotation);
2844
2844
  function n(s, o, r, l, c) {
2845
- const h = new Xn(s, o), u = new Ri({
2845
+ const h = new Yn(s, o), u = new Ri({
2846
2846
  // MEP 最终颜色由 instanceColor 乘算,基础材质保持白色才能避免二次染色。
2847
2847
  color: 16777215,
2848
2848
  metalness: 0,
@@ -2854,69 +2854,69 @@ function Ht(a, e) {
2854
2854
  }
2855
2855
  }
2856
2856
  var se = /* @__PURE__ */ ((a) => (a.ModelLoadStart = "model-load-start", a.ModelLoadProgress = "model-load-progress", a.ModelLoaded = "model-loaded", a.ModelError = "model-error", a.SelectionChanged = "selection-changed", a.HoverChanged = "hover-changed", a.Click = "click", a.MouseMove = "mouse-move", a.ModelPlaceSelected = "model-place-selected", a.ModelCalibrationChanged = "model-calibration-changed", a.CameraChanged = "camera-changed", a.CameraIdle = "camera-idle", a.EngineFree = "engine-free", a.EngineBusy = "engine-busy", a.MeasureChanged = "measure-changed", a.MeasureClick = "measure-click", a.SectionMove = "section-move", a.LoadingCompleted = "loading_completed", a))(se || {});
2857
- const hn = "__bvhAccelerationInstalled", cs = "__bvhBuildFailed", lr = "__bvhBuilt", cr = "__bvhTriangleCount", hs = 200, hr = 10;
2858
- function dr() {
2857
+ const hn = "__bvhAccelerationInstalled", ls = "__bvhBuildFailed", ar = "__bvhBuilt", lr = "__bvhTriangleCount", cs = 200, cr = 10;
2858
+ function hr() {
2859
2859
  const a = globalThis;
2860
- a[hn] !== !0 && (z.prototype.raycast = Qs, ae.prototype.computeBoundsTree = Qn, ae.prototype.disposeBoundsTree = $s, a[hn] = !0);
2860
+ a[hn] !== !0 && (z.prototype.raycast = Xs, ae.prototype.computeBoundsTree = Xn, ae.prototype.disposeBoundsTree = Qs, a[hn] = !0);
2861
2861
  }
2862
- function ur(a) {
2862
+ function dr(a) {
2863
2863
  a.firstHitOnly = !0;
2864
2864
  }
2865
- function pr(a) {
2865
+ function ur(a) {
2866
2866
  delete a.firstHitOnly;
2867
2867
  }
2868
- function mr(a, e = hs) {
2868
+ function pr(a, e = cs) {
2869
2869
  if (a == null)
2870
2870
  return !1;
2871
2871
  const t = a;
2872
- if (t.boundsTree != null || t.userData?.[cs] === !0)
2872
+ if (t.boundsTree != null || t.userData?.[ls] === !0)
2873
2873
  return !1;
2874
2874
  const i = a.attributes.position?.count ?? 0;
2875
2875
  return (a.index?.count ?? i) / 3 >= e;
2876
2876
  }
2877
- function gr(a) {
2877
+ function mr(a) {
2878
2878
  if (a == null)
2879
2879
  return 0;
2880
2880
  const e = a.attributes.position?.count ?? 0;
2881
2881
  return (a.index?.count ?? e) / 3;
2882
2882
  }
2883
- function fr(a, e = {}) {
2883
+ function gr(a, e = {}) {
2884
2884
  if (a == null)
2885
2885
  return;
2886
- const t = e.triangleThreshold ?? hs;
2887
- if (!mr(a, t)) {
2886
+ const t = e.triangleThreshold ?? cs;
2887
+ if (!pr(a, t)) {
2888
2888
  e.setBoundingBox === !0 && a.boundingBox == null && a.computeBoundingBox(), e.setBoundingSphere === !0 && a.boundingSphere == null && a.computeBoundingSphere();
2889
2889
  return;
2890
2890
  }
2891
2891
  const i = a;
2892
2892
  try {
2893
- i.userData = i.userData ?? {}, i.userData[cr] = gr(a), e.setBoundingBox === !0 && a.boundingBox == null && a.computeBoundingBox(), e.setBoundingSphere === !0 && a.boundingSphere == null && a.computeBoundingSphere(), Qn.call(i, {
2893
+ i.userData = i.userData ?? {}, i.userData[lr] = mr(a), e.setBoundingBox === !0 && a.boundingBox == null && a.computeBoundingBox(), e.setBoundingSphere === !0 && a.boundingSphere == null && a.computeBoundingSphere(), Xn.call(i, {
2894
2894
  // 对外继续兼容旧字段,内部改用 three-mesh-bvh 0.9.10 的新参数名。
2895
- maxLeafSize: e.maxLeafTris ?? hr
2896
- }), i.userData[lr] = i.boundsTree != null;
2895
+ maxLeafSize: e.maxLeafTris ?? cr
2896
+ }), i.userData[ar] = i.boundsTree != null;
2897
2897
  } catch (n) {
2898
- i.userData = i.userData ?? {}, i.userData[cs] = !0, console.warn("[raycastAcceleration] failed to build bounds tree", n);
2898
+ i.userData = i.userData ?? {}, i.userData[ls] = !0, console.warn("[raycastAcceleration] failed to build bounds tree", n);
2899
2899
  }
2900
2900
  }
2901
2901
  let gt = null, ft = null, dn = null;
2902
- const yr = 8, ds = 24, Mr = 24, vr = 64, xr = 240, wr = 2, un = 2048, pn = /* @__PURE__ */ new WeakSet(), br = 10;
2903
- function us() {
2902
+ const fr = 8, hs = 24, yr = 24, Mr = 64, vr = 240, xr = 2, un = /* @__PURE__ */ new WeakSet(), wr = 10;
2903
+ function ds() {
2904
2904
  return ee("draco/", import.meta.url);
2905
2905
  }
2906
- function ps() {
2906
+ function us() {
2907
2907
  return ee("basis/", import.meta.url);
2908
2908
  }
2909
- function Cr() {
2910
- return gt == null && (gt = new $n(), gt.setDecoderPath(us()), gt.preload()), gt;
2909
+ function br() {
2910
+ return gt == null && (gt = new Qn(), gt.setDecoderPath(ds()), gt.preload()), gt;
2911
2911
  }
2912
- function Er(a) {
2913
- return ft == null && (ft = new eo(), ft.setTranscoderPath(ps())), dn !== a && (ft.detectSupport(a), dn = a), ft;
2912
+ function Cr(a) {
2913
+ return ft == null && (ft = new Js(), ft.setTranscoderPath(us())), dn !== a && (ft.detectSupport(a), dn = a), ft;
2914
2914
  }
2915
- function Ar(a) {
2915
+ function Er(a) {
2916
2916
  const e = new zi();
2917
- return e.setDRACOLoader(Cr()), e.setMeshoptDecoder(Js), a?.renderer != null && e.setKTX2Loader(Er(a.renderer)), e;
2917
+ return e.setDRACOLoader(br()), e.setMeshoptDecoder(Zs), a?.renderer != null && e.setKTX2Loader(Cr(a.renderer)), e;
2918
2918
  }
2919
- function ms() {
2919
+ function ps() {
2920
2920
  return new Promise((a) => {
2921
2921
  if (typeof requestAnimationFrame == "function") {
2922
2922
  requestAnimationFrame(() => a());
@@ -2925,20 +2925,20 @@ function ms() {
2925
2925
  setTimeout(a, 16);
2926
2926
  });
2927
2927
  }
2928
- function Sr() {
2928
+ function Ar() {
2929
2929
  const a = navigator?.scheduling;
2930
2930
  return typeof a?.isInputPending == "function" ? a.isInputPending() : !1;
2931
2931
  }
2932
- function Pr(a) {
2933
- return a?.engineStatus?.isFree === !1 || Sr();
2932
+ function Sr(a) {
2933
+ return a?.engineStatus?.isFree === !1 || Ar();
2934
2934
  }
2935
2935
  async function Ze(a, e, t) {
2936
2936
  if (e)
2937
2937
  return t;
2938
2938
  const i = performance.now();
2939
- return Pr(a) || i - t >= yr ? (await ms(), performance.now()) : t;
2939
+ return Sr(a) || i - t >= fr ? (await ps(), performance.now()) : t;
2940
2940
  }
2941
- function Tr(a, e) {
2941
+ function Pr(a, e) {
2942
2942
  return new Promise((t, i) => {
2943
2943
  Mt(a, (n) => {
2944
2944
  if (n == null) {
@@ -2951,7 +2951,7 @@ function Tr(a, e) {
2951
2951
  }, e);
2952
2952
  });
2953
2953
  }
2954
- async function gs(a, e) {
2954
+ async function ms(a, e) {
2955
2955
  const t = await ei({
2956
2956
  method: "get",
2957
2957
  responseType: "arraybuffer",
@@ -2960,33 +2960,33 @@ async function gs(a, e) {
2960
2960
  let i = t.data;
2961
2961
  return Zi.isEncrypted(t.data) && (i = await Zi.decryptPzEnc(t.data, e)), Ci.loadAsync(i);
2962
2962
  }
2963
- function mn(a) {
2963
+ function pn(a) {
2964
2964
  return a.replace(/\\/g, "/").replace(/^\/+/, "");
2965
2965
  }
2966
- function fs(a, e) {
2967
- const t = new Set(e.map((i) => mn(i)));
2966
+ function gs(a, e) {
2967
+ const t = new Set(e.map((i) => pn(i)));
2968
2968
  for (const i of Object.keys(a.files))
2969
- if (t.has(mn(i)))
2969
+ if (t.has(pn(i)))
2970
2970
  return a.files[i];
2971
2971
  return null;
2972
2972
  }
2973
- function gn(a, e) {
2974
- const t = fs(a, e);
2973
+ function mn(a, e) {
2974
+ const t = gs(a, e);
2975
2975
  return t == null || t.dir ? Promise.resolve(null) : t.async("string");
2976
2976
  }
2977
- function Ir(a) {
2977
+ function Tr(a) {
2978
2978
  const e = Object.values(a.files).find((t) => t != null && t.dir !== !0);
2979
2979
  return e == null ? Promise.resolve(null) : e.async("string");
2980
2980
  }
2981
- function _r(a) {
2981
+ function Ir(a) {
2982
2982
  return a.charCodeAt(0) === 65279 ? a.slice(1) : a;
2983
2983
  }
2984
2984
  function ii(a) {
2985
- return JSON.parse(_r(a));
2985
+ return JSON.parse(Ir(a));
2986
2986
  }
2987
- async function Dr(a, e) {
2987
+ async function _r(a, e) {
2988
2988
  try {
2989
- const t = await gs(a, e), i = await Ir(t);
2989
+ const t = await ms(a, e), i = await Tr(t);
2990
2990
  if (i == null)
2991
2991
  return { exists: !0, value: [] };
2992
2992
  const n = ii(i);
@@ -2995,13 +2995,13 @@ async function Dr(a, e) {
2995
2995
  return ei.isAxiosError(t) && t.response?.status === 404 ? { exists: !1 } : (console.warn("[loadLightModel] failed to load optional quota_list", { path: a, error: t }), { exists: !1 });
2996
2996
  }
2997
2997
  }
2998
- function kr(a, e) {
2999
- const t = fs(a, e);
2998
+ function Dr(a, e) {
2999
+ const t = gs(a, e);
3000
3000
  return t == null || t.dir ? Promise.resolve(null) : t.async("arraybuffer");
3001
3001
  }
3002
- function Lr(a, e) {
3002
+ function kr(a, e) {
3003
3003
  return new Promise((t, i) => {
3004
- Ar(a).parse(e, zo(import.meta.url), t, i);
3004
+ Er(a).parse(e, Bo(import.meta.url), t, i);
3005
3005
  });
3006
3006
  }
3007
3007
  function mt(a, e) {
@@ -3019,34 +3019,34 @@ function kt(a) {
3019
3019
  t.disposeBoundsTree?.(), t.dispose();
3020
3020
  }), a.length = 0;
3021
3021
  }
3022
- function ys(a, e) {
3022
+ function fs(a, e) {
3023
3023
  const t = mt(a, e);
3024
3024
  return Array.isArray(t?.lods) ? t.lods : [];
3025
3025
  }
3026
- function Ms(a) {
3026
+ function ys(a) {
3027
3027
  a.loadStatus == null && (a.loadStatus = {}), a.loadStatus.modelMep == null && (a.loadStatus.modelMep = !1), a.loadStatus.normal == null && (a.loadStatus.normal = !1), a.loadStatus.quotaList == null && (a.loadStatus.quotaList = !1);
3028
3028
  }
3029
- function Br(a) {
3030
- return Ms(a), a.status === "loaded" && a.loadStatus.normal === !0 && a.loadStatus.modelMep === !0 && a.loadStatus.quotaList === !0;
3029
+ function Lr(a) {
3030
+ return ys(a), a.status === "loaded" && a.loadStatus.normal === !0 && a.loadStatus.modelMep === !0 && a.loadStatus.quotaList === !0;
3031
3031
  }
3032
3032
  function xt(a) {
3033
3033
  const e = a?.engineStatus?.models;
3034
- !Array.isArray(e) || e.length === 0 || !e.every((i) => Br(i)) || a.__loadingCompletedTriggered === !0 || (a.__loadingCompletedTriggered = !0, a.events?.trigger?.(se.LoadingCompleted, {}));
3034
+ !Array.isArray(e) || e.length === 0 || !e.every((i) => Lr(i)) || a.__loadingCompletedTriggered === !0 || (a.__loadingCompletedTriggered = !0, a.events?.trigger?.(se.LoadingCompleted, {}));
3035
3035
  }
3036
- function vs(a) {
3036
+ function Ms(a) {
3037
3037
  return a === !0 || a === "loading";
3038
3038
  }
3039
- function fn(a) {
3039
+ function gn(a) {
3040
3040
  return a.index != null ? a.index.count : a.attributes.position?.count ?? 0;
3041
3041
  }
3042
- async function zr(a, e, t) {
3042
+ async function Br(a, e, t) {
3043
3043
  let i = performance.now();
3044
3044
  for (let n = 0; n < e.length; n++)
3045
3045
  e[n]?.traverse?.((s) => {
3046
- bs(s?.material, a);
3047
- }), (n + 1) % Mr === 0 && (i = await Ze(a, t, i));
3046
+ ws(s?.material, a);
3047
+ }), (n + 1) % yr === 0 && (i = await Ze(a, t, i));
3048
3048
  }
3049
- async function Rr(a, e, t) {
3049
+ async function zr(a, e, t) {
3050
3050
  const i = [], n = [{ node: e.octreeBox, visited: !1 }];
3051
3051
  let s = performance.now();
3052
3052
  for (; n.length > 0; ) {
@@ -3067,13 +3067,13 @@ async function Rr(a, e, t) {
3067
3067
  }
3068
3068
  return i;
3069
3069
  }
3070
- async function Or(a, e, t, i) {
3070
+ async function Rr(a, e, t, i) {
3071
3071
  if (ue(a, e.url, e.loadVersion))
3072
3072
  return [];
3073
3073
  const n = mt(a, e.url);
3074
3074
  if (n?.nodesMap == null)
3075
3075
  return [];
3076
- const s = a.filterLoaderModel?.getContinueIdSet?.(e.url) ?? /* @__PURE__ */ new Set(), o = await Rr(a, t, i);
3076
+ const s = a.filterLoaderModel?.getContinueIdSet?.(e.url) ?? /* @__PURE__ */ new Set(), o = await zr(a, t, i);
3077
3077
  console.log("[loadLightModel] pending mesh ids", t.path, o.length);
3078
3078
  const r = [], l = a?.deviceModule?.isMobile?.() !== !0;
3079
3079
  let c = performance.now(), h = 0;
@@ -3094,46 +3094,46 @@ async function Or(a, e, t, i) {
3094
3094
  m.dispose();
3095
3095
  continue;
3096
3096
  }
3097
- m.applyMatrix4(x), m.computeBoundingBox(), l && b.count > 2e4 && fr(m, {
3097
+ m.applyMatrix4(x), m.computeBoundingBox(), l && b.count > 2e4 && gr(m, {
3098
3098
  setBoundingSphere: !0
3099
3099
  });
3100
3100
  const C = new z(m, M.material);
3101
- y.box = m.boundingBox?.clone(), y.mesh = C, C.name = Number(u), C.glb = y.glb, C.url = e.url, r.push(C), h++, h % ds === 0 && (c = await Ze(a, i, c));
3101
+ y.box = m.boundingBox?.clone(), y.mesh = C, C.name = Number(u), C.glb = y.glb, C.url = e.url, r.push(C), h++, h % hs === 0 && (c = await Ze(a, i, c));
3102
3102
  }
3103
3103
  }
3104
3104
  return r;
3105
3105
  }
3106
- function xs(a) {
3106
+ function vs(a) {
3107
3107
  const e = a.clone();
3108
3108
  return e.clippingPlanes = a.clippingPlanes, e;
3109
3109
  }
3110
- function Fr(a) {
3110
+ function Or(a) {
3111
3111
  a.setRGB(a.r, a.g, a.b, We);
3112
3112
  }
3113
- function Nr(a) {
3113
+ function Fr(a) {
3114
3114
  const e = a;
3115
- e.color == null || a.userData.__displayColorLinearized === !0 || (Fr(e.color), a.userData.__displayColorLinearized = !0);
3115
+ e.color == null || a.userData.__displayColorLinearized === !0 || (Or(e.color), a.userData.__displayColorLinearized = !0);
3116
3116
  }
3117
- function Hr(a, e, t, i, n, s) {
3117
+ function Nr(a, e, t, i, n, s) {
3118
3118
  const o = Et(
3119
3119
  i.map((u) => u.geometry),
3120
3120
  !1
3121
- ), r = xs(n), l = new z(o, r);
3121
+ ), r = vs(n), l = new z(o, r);
3122
3122
  s != null && (l.visible = !1, s.push(l)), l.castShadow = !0, l.receiveShadow = !0, ot(e, a).add(l);
3123
3123
  const h = Ui(e, l);
3124
3124
  return Wi(l, h), l.url = a, l.glb = t, l.materialClone = r, l.geometrys = i.map((u) => u.geometry), l.geometry.computeVertexNormals(), l;
3125
3125
  }
3126
- function Vr(a, e, t, i) {
3126
+ function Hr(a, e, t, i) {
3127
3127
  return ($e(a, e)?.children ?? a.scene.children).find((o) => {
3128
3128
  const r = o;
3129
3129
  return o instanceof z && r.url == e && r.glb == t && r.materialClone === i;
3130
3130
  });
3131
3131
  }
3132
- function Ur(a, e) {
3132
+ function Vr(a, e) {
3133
3133
  const t = Array.isArray(a.geometrys) ? a.geometrys : [], i = e.map((o) => o.geometry), n = [...t, ...i], s = Et(n, !1);
3134
3134
  a.geometry != null && a.geometry.dispose(), a.geometry = s, a.geometrys = n, a.castShadow = !0, a.receiveShadow = !0;
3135
3135
  }
3136
- async function Wr(a, e, t, i, n, s) {
3136
+ async function Ur(a, e, t, i, n, s) {
3137
3137
  if (ue(t, a, e)) {
3138
3138
  kt(i);
3139
3139
  return;
@@ -3146,7 +3146,7 @@ async function Wr(a, e, t, i, n, s) {
3146
3146
  const r = mt(t, a);
3147
3147
  let l = performance.now();
3148
3148
  for (const [c, h] of o.entries()) {
3149
- const u = n ? h.length : xr;
3149
+ const u = n ? h.length : vr;
3150
3150
  for (let p = 0; p < h.length; p += u) {
3151
3151
  if (ue(t, a, e)) {
3152
3152
  kt(i);
@@ -3155,13 +3155,13 @@ async function Wr(a, e, t, i, n, s) {
3155
3155
  const g = h.slice(p, p + u);
3156
3156
  if (g.length === 0)
3157
3157
  continue;
3158
- const y = ea(g[0].material, t);
3159
- let M = Vr(t, a, c, y), x = 0, m = 0;
3160
- M = null, M != null ? (x = Array.isArray(M.geometrys) ? M.geometrys.length : 0, m = fn(M.geometry), Ur(M, g)) : M = Hr(a, t, c, g, y, s);
3158
+ const y = Jr(g[0].material, t);
3159
+ let M = Hr(t, a, c, y), x = 0, m = 0;
3160
+ M = null, M != null ? (x = Array.isArray(M.geometrys) ? M.geometrys.length : 0, m = gn(M.geometry), Vr(M, g)) : M = Nr(a, t, c, g, y, s);
3161
3161
  const b = /* @__PURE__ */ new Map();
3162
3162
  let C = m;
3163
3163
  g.forEach((S, I) => {
3164
- const P = Number(S.name), L = fn(S.geometry), k = b.get(P) ?? [];
3164
+ const P = Number(S.name), L = gn(S.geometry), k = b.get(P) ?? [];
3165
3165
  if (k.push([C, C + L]), b.set(P, k), r?.nodesMap?.has(P)) {
3166
3166
  const O = r.nodesMap.get(P);
3167
3167
  O.indexes == null && (O.indexes = []), O.indexes.push([M.index, x + I, C, C + L]);
@@ -3174,25 +3174,25 @@ async function Wr(a, e, t, i, n, s) {
3174
3174
  }
3175
3175
  }
3176
3176
  }
3177
- function Gr(a, e) {
3177
+ function Wr(a, e) {
3178
3178
  const t = a?.geometry;
3179
3179
  return t instanceof ae ? (t.boundingBox == null && t.computeBoundingBox(), t.boundingBox?.clone().applyMatrix4(e) ?? null) : null;
3180
3180
  }
3181
- async function qr(a, e, t, i, n, s, o, r) {
3181
+ async function Gr(a, e, t, i, n, s, o, r) {
3182
3182
  if (ue(i, a, e) || n == null || s == null || s.length === 0)
3183
3183
  return;
3184
3184
  const l = mt(i, a);
3185
3185
  if (l == null)
3186
3186
  return;
3187
3187
  n.geometry.computeVertexNormals();
3188
- const c = new V(n.geometry, xs(n.material), s.length);
3188
+ const c = new V(n.geometry, vs(n.material), s.length);
3189
3189
  r != null && (c.visible = !1, r.push(c)), ot(i, a).add(c);
3190
3190
  const u = Ui(i, c);
3191
3191
  Wi(c, u);
3192
3192
  const p = new Float32Array(s.length * 3);
3193
3193
  for (let M = 0; M < s.length; M++)
3194
3194
  p[M * 3] = 1, p[M * 3 + 1] = 1, p[M * 3 + 2] = 1;
3195
- c.instanceColor = new Zs(p, 3);
3195
+ c.instanceColor = new $s(p, 3);
3196
3196
  let g = performance.now();
3197
3197
  const y = [];
3198
3198
  for (let M = 0; M < s.length; M++) {
@@ -3202,7 +3202,7 @@ async function qr(a, e, t, i, n, s, o, r) {
3202
3202
  }
3203
3203
  const x = s[M], m = new H();
3204
3204
  m.elements = x.matrix;
3205
- const b = Gr(n, m);
3205
+ const b = Wr(n, m);
3206
3206
  if (b != null && (x.box = b.clone()), c.setMatrixAt(M, m), c.matrixs || (c.matrixs = []), c.matrixs.push(m.clone()), y.push(m.clone()), l.nodesMap.has(x.id)) {
3207
3207
  const C = l.nodesMap.get(x.id);
3208
3208
  C.indexes == null && (C.indexes = []), C.indexes.push([u, M, 0, 0]), Dt(C), b != null && C?.info != null && (C.info.box instanceof R ? C.info.box.union(b) : C.info.box = b.clone());
@@ -3215,11 +3215,11 @@ async function qr(a, e, t, i, n, s, o, r) {
3215
3215
  };
3216
3216
  Dt(C), l.nodesMap.set(x.id, C);
3217
3217
  }
3218
- (M + 1) % vr === 0 && (g = await Ze(i, o, g));
3218
+ (M + 1) % Mr === 0 && (g = await Ze(i, o, g));
3219
3219
  }
3220
3220
  c.instanceMatrix.needsUpdate = !0, c.instanceColor != null && (c.instanceColor.needsUpdate = !0), c.materialClone = c.material, c.url = a, c.glb = n.glb, c.ids = s.map((M) => M.id), c.matrixsClone = y, c.meshIndex = t, r == null && i.requestComposerRender?.();
3221
3221
  }
3222
- async function Kr(a, e, t, i, n) {
3222
+ async function qr(a, e, t, i, n) {
3223
3223
  const s = e.instanceNodes;
3224
3224
  if (s == null)
3225
3225
  return;
@@ -3236,7 +3236,7 @@ async function Kr(a, e, t, i, n) {
3236
3236
  const u = Array.isArray(c.children) ? c.children.filter((p) => o.has(Number(p?.id)) === !1) : [];
3237
3237
  if (u.length === 0)
3238
3238
  continue;
3239
- await qr(
3239
+ await Gr(
3240
3240
  a.url,
3241
3241
  a.loadVersion,
3242
3242
  c.mesh,
@@ -3252,30 +3252,30 @@ async function Kr(a, e, t, i, n) {
3252
3252
  }
3253
3253
  }
3254
3254
  }
3255
- async function jr(a, e, t, i) {
3255
+ async function Kr(a, e, t, i) {
3256
3256
  if (t.status === !0 || t.meshPromise != null) {
3257
3257
  await t.meshPromise;
3258
3258
  return;
3259
3259
  }
3260
3260
  t.meshPromise = (async () => {
3261
3261
  console.log(`[loadLightModel] start build lod meshes ${Date.now() - window.startTime}ms`);
3262
- const n = a?.deviceModule?.isMobile?.() === !0 ? [] : void 0, s = await Or(a, e, t, i);
3262
+ const n = a?.deviceModule?.isMobile?.() === !0 ? [] : void 0, s = await Rr(a, e, t, i);
3263
3263
  if (ue(a, e.url, e.loadVersion)) {
3264
3264
  kt(s);
3265
3265
  return;
3266
3266
  }
3267
- if (await Kr(e, t, a, i, n), ue(a, e.url, e.loadVersion)) {
3267
+ if (await qr(e, t, a, i, n), ue(a, e.url, e.loadVersion)) {
3268
3268
  kt(s);
3269
3269
  return;
3270
3270
  }
3271
- t.glbs = [], await Wr(e.url, e.loadVersion, a, s, i, n), !ue(a, e.url, e.loadVersion) && (t.instanceNodes = null, t.status = !0, n?.forEach((o) => {
3271
+ t.glbs = [], await Ur(e.url, e.loadVersion, a, s, i, n), !ue(a, e.url, e.loadVersion) && (t.instanceNodes = null, t.status = !0, n?.forEach((o) => {
3272
3272
  o.visible = !0;
3273
3273
  }), a.requestComposerRender?.(), console.log(`[loadLightModel] *****************************************************finish build lod meshes ${Date.now() - window.startTime}ms`));
3274
3274
  })().finally(() => {
3275
3275
  t.meshPromise = null;
3276
3276
  }), await t.meshPromise;
3277
3277
  }
3278
- async function Yr(a, e, t, i) {
3278
+ async function jr(a, e, t, i) {
3279
3279
  if (t.loadSuccess !== !0) {
3280
3280
  if (t.preparePromise != null) {
3281
3281
  await t.preparePromise;
@@ -3285,9 +3285,9 @@ async function Yr(a, e, t, i) {
3285
3285
  console.log("[loadLightModel] loading GLB bundle", t.path), t.glbs = t.glbs ?? {};
3286
3286
  const n = e.url + t.path;
3287
3287
  vt(a, e.url, n), console.log(`[loadLightModel] ZIP 解压开始 ${Date.now() - window.startTime}ms`);
3288
- const s = await gs(n, e.key);
3288
+ const s = await ms(n, e.key);
3289
3289
  console.log(`[loadLightModel] ZIP 解压完成 ${Date.now() - window.startTime}ms`);
3290
- const o = await gn(s, ["/nodes.json", "nodes.json"]);
3290
+ const o = await mn(s, ["/nodes.json", "nodes.json"]);
3291
3291
  if (o == null)
3292
3292
  return;
3293
3293
  const r = ii(o), l = mt(a, e.url);
@@ -3309,11 +3309,11 @@ async function Yr(a, e, t, i) {
3309
3309
  continue;
3310
3310
  S.infos.push(C), Dt(S);
3311
3311
  }
3312
- (b + 1) % ds === 0 && (c = await Ze(a, i, c));
3312
+ (b + 1) % hs === 0 && (c = await Ze(a, i, c));
3313
3313
  }
3314
3314
  }
3315
3315
  const u = async (x) => {
3316
- let m = await kr(s, [`/${x}.glb`, `${x}.glb`, x + ".glb"]);
3316
+ let m = await Dr(s, [`/${x}.glb`, `${x}.glb`, x + ".glb"]);
3317
3317
  if (m == null) {
3318
3318
  console.error("[loadLightModel] glb not found in zip", {
3319
3319
  modelUrl: e.url,
@@ -3324,17 +3324,17 @@ async function Yr(a, e, t, i) {
3324
3324
  return;
3325
3325
  }
3326
3326
  try {
3327
- const b = await Lr(a, m);
3327
+ const b = await kr(a, m);
3328
3328
  m = null, t.glbs[x] = b.scene.children, t.glbs[x].forEach((C) => {
3329
3329
  C.matrixWorld;
3330
- }), await zr(a, t.glbs[x], i);
3330
+ }), await Br(a, t.glbs[x], i);
3331
3331
  } catch (b) {
3332
3332
  console.error("[loadLightModel] failed to load glb", {
3333
3333
  modelUrl: e.url,
3334
3334
  lodPath: t.path,
3335
3335
  glbKey: `${x}.glb`,
3336
- dracoDecoderPath: us(),
3337
- basisTranscoderPath: ps(),
3336
+ dracoDecoderPath: ds(),
3337
+ basisTranscoderPath: us(),
3338
3338
  error: b
3339
3339
  });
3340
3340
  } finally {
@@ -3342,21 +3342,21 @@ async function Yr(a, e, t, i) {
3342
3342
  }
3343
3343
  };
3344
3344
  let p = 0;
3345
- const g = a?.deviceModule?.isMobile?.() === !0 ? 1 : wr, y = Math.min(g, h.length);
3345
+ const g = a?.deviceModule?.isMobile?.() === !0 ? 1 : xr, y = Math.min(g, h.length);
3346
3346
  await Promise.all(Array.from({ length: y }, async () => {
3347
3347
  for (; p < h.length; ) {
3348
3348
  const x = h[p++];
3349
3349
  await u(x);
3350
3350
  }
3351
3351
  })), console.log(`[loadLightModel] 所有 GLB 加载完成 ${Date.now() - window.startTime}ms`);
3352
- const M = await gn(s, ["/instances.json", "instances.json"]);
3352
+ const M = await mn(s, ["/instances.json", "instances.json"]);
3353
3353
  t.instanceNodes = M != null ? ii(M) : null, t.loadSuccess = !0;
3354
3354
  })().finally(() => {
3355
3355
  t.preparePromise = null;
3356
3356
  }), await t.preparePromise;
3357
3357
  }
3358
3358
  }
3359
- function Xr(a, e, t) {
3359
+ function Yr(a, e, t) {
3360
3360
  if (t.boundingBox || (t.boundingBox = new R(), t.boundingBox.min = new d(t.octreeBox.min.X, t.octreeBox.min.Z, -t.octreeBox.min.Y), t.boundingBox.max = new d(t.octreeBox.max.X, t.octreeBox.max.Z, -t.octreeBox.max.Y)), !t.maxSize)
3361
3361
  return 1e3;
3362
3362
  const i = t.boundingBox, n = i.min, s = i.max, o = n.clone().add(s.clone()).multiplyScalar(0.5), r = n.distanceTo(s), l = new d(), c = new d(), h = new d(), u = new d();
@@ -3372,28 +3372,28 @@ function Xr(a, e, t) {
3372
3372
  const g = u.clone().add(h.multiplyScalar(Math.max(p, r))), y = g.clone().add(l.setLength(t.maxSize)), M = new fe(e, a.renderer, a.scene).worldToScreen(g), x = new fe(e, a.renderer, a.scene).worldToScreen(y);
3373
3373
  return M.distanceTo(x);
3374
3374
  }
3375
- async function Qr(a, e, t, i) {
3376
- ue(a, e.url, e.loadVersion) || t.maxSize < 1e6 && t.path != "/lod0" && (!(Xr(a, a.camera, t) >= br) || t.status === !0) || (await Yr(a, e, t, i), !ue(a, e.url, e.loadVersion) && t.loadSuccess === !0 && await jr(a, e, t, i));
3375
+ async function Xr(a, e, t, i) {
3376
+ ue(a, e.url, e.loadVersion) || t.maxSize < 1e6 && t.path != "/lod0" && (!(Yr(a, a.camera, t) >= wr) || t.status === !0) || (await jr(a, e, t, i), !ue(a, e.url, e.loadVersion) && t.loadSuccess === !0 && await Kr(a, e, t, i));
3377
3377
  }
3378
- function $r(a, e, t) {
3379
- if (vs(e.loadStatus.modelMep))
3378
+ function Qr(a, e, t) {
3379
+ if (Ms(e.loadStatus.modelMep))
3380
3380
  return;
3381
3381
  const i = mt(a, e.url);
3382
3382
  if (i == null)
3383
3383
  return;
3384
3384
  e.loadStatus.modelMep = "loading", i.modelMep == null && (i.modelMep = {}), (async () => {
3385
- t || await ms(), !ue(a, e.url, e.loadVersion) && (or(a, i.modelMep, e.url), e.loadStatus.modelMep = !0, xt(a));
3385
+ t || await ps(), !ue(a, e.url, e.loadVersion) && (sr(a, i.modelMep, e.url), e.loadStatus.modelMep = !0, xt(a));
3386
3386
  })().catch((s) => {
3387
3387
  e.loadStatus.modelMep = !1, console.error("[loadLightModel] failed to load mep model", s);
3388
3388
  });
3389
3389
  }
3390
- function Zr(a, e, t, i, n) {
3390
+ function $r(a, e, t, i, n) {
3391
3391
  const s = ot(a, e);
3392
3392
  a.models || (a.models = []);
3393
3393
  const o = t?.loadQuotaList ?? !1, r = t?.loadEdge !== !1;
3394
3394
  window.startTime = Date.now();
3395
3395
  let l = "WDDsBNtzVz6aSh/bCFh3CmjjANEDRryoXF1XCJvJjeE=";
3396
- Tr(e + "/info", l).then((c) => {
3396
+ Pr(e + "/info", l).then((c) => {
3397
3397
  if (ue(a, e, n))
3398
3398
  return;
3399
3399
  const h = ii(c), u = h?.baseInfo ?? {}, p = typeof u?.name == "string" ? u.name : "";
@@ -3439,75 +3439,75 @@ function Zr(a, e, t, i, n) {
3439
3439
  ue(a, e, n) || (a.filterLoaderModel?.buildContinueIds?.(e), M());
3440
3440
  }) : M();
3441
3441
  function M() {
3442
- ue(a, e, n) || (o ? Dr(e + "/quota_list", l).then((x) => {
3442
+ ue(a, e, n) || (o ? _r(e + "/quota_list", l).then((x) => {
3443
3443
  ue(a, e, n) || (x.exists && (y.quotaList = x.value ?? [], a.rxQuotaListMapper.loadNodeMap(y)), g.loadStatus.quotaList = !0, xt(a));
3444
3444
  }).catch((x) => {
3445
3445
  ue(a, e, n) || (g.loadStatus.quotaList = !0, console.warn("[loadLightModel] unexpected quota_list load failure", { url: e, error: x }), xt(a));
3446
3446
  }) : (g.loadStatus.quotaList = !0, xt(a)), a.viewCube.CameraGoHome(1), a.models.length == i && setTimeout(() => {
3447
- ws(a, null, !1);
3447
+ xs(a, null, !1);
3448
3448
  }, 100));
3449
3449
  }
3450
3450
  }).catch((c) => {
3451
3451
  console.error("[loadLightModel] failed to load model info", { url: e, error: c });
3452
3452
  });
3453
3453
  }
3454
- async function ws(a, e, t = !1) {
3454
+ async function xs(a, e, t = !1) {
3455
3455
  const i = a.engineStatus.models.filter((n) => e == null || n.url == e);
3456
3456
  for (const n of i)
3457
- if (!ue(a, n.url, n.loadVersion) && (Ms(n), !(n.status !== "loading" || n.type !== "light") && ($r(a, n, t), !vs(n.loadStatus.normal)))) {
3457
+ if (!ue(a, n.url, n.loadVersion) && (ys(n), !(n.status !== "loading" || n.type !== "light") && (Qr(a, n, t), !Ms(n.loadStatus.normal)))) {
3458
3458
  n.loadStatus.normal = "loading";
3459
3459
  try {
3460
- await Jr(a, n, t);
3460
+ await Zr(a, n, t);
3461
3461
  } finally {
3462
- const s = ys(a, n.url), o = s.length > 0 && s.every((r) => r.status === !0);
3462
+ const s = fs(a, n.url), o = s.length > 0 && s.every((r) => r.status === !0);
3463
3463
  n.loadStatus.normal = o, o && (n.status = "loaded"), xt(a);
3464
3464
  }
3465
3465
  }
3466
3466
  }
3467
- async function Jr(a, e, t = !1) {
3467
+ async function Zr(a, e, t = !1) {
3468
3468
  console.log(`[loadLightModel] start loadNode ${Date.now() - window.startTime}ms`);
3469
- const i = ys(a, e.url);
3469
+ const i = fs(a, e.url);
3470
3470
  if (i.length !== 0)
3471
3471
  for (const n of i)
3472
- await Qr(a, e, n, t);
3472
+ await Xr(a, e, n, t);
3473
3473
  }
3474
- function ea(a, e) {
3475
- Nr(a), bs(a, e);
3474
+ function Jr(a, e) {
3475
+ Fr(a), ws(a, e);
3476
3476
  const t = a.map;
3477
3477
  return t != null && t.colorSpace !== We && (t.colorSpace = We, t.needsUpdate = !0), a.side = re, a.shadowSide = re, a.clipShadows = !0, e?.sectionPlane && (a.clippingPlanes = e.sectionPlane), a;
3478
3478
  }
3479
- function ta(a) {
3479
+ function ea(a) {
3480
3480
  const e = a.source?.data ?? a.image, t = Array.isArray(a.mipmaps) ? a.mipmaps[0] : null, i = Number(e?.videoWidth ?? e?.naturalWidth ?? e?.width ?? t?.width), n = Number(e?.videoHeight ?? e?.naturalHeight ?? e?.height ?? t?.height);
3481
3481
  return Number.isFinite(i) && i > 0 && Number.isFinite(n) && n > 0 ? { width: i, height: n } : null;
3482
3482
  }
3483
- function ia(a) {
3483
+ function ta(a) {
3484
3484
  const e = a.source?.data ?? a.image;
3485
3485
  typeof e?.close == "function" && e.close(), Array.isArray(a.mipmaps) && (a.mipmaps.length = 0), a.dispose(), a.source != null && (a.source.data = null);
3486
3486
  }
3487
- function bs(a, e) {
3487
+ function ws(a, e) {
3488
3488
  if (e?.deviceModule?.isMobile?.() !== !0 || a == null)
3489
3489
  return;
3490
- const t = Array.isArray(a) ? a : [a], i = Number(e?.renderer?.capabilities?.maxTextureSize), n = Number.isFinite(i) ? Math.min(un, i) : un;
3491
- t.forEach((s) => {
3492
- s != null && Object.keys(s).forEach((o) => {
3493
- const r = s[o];
3494
- if (r?.isTexture !== !0)
3490
+ const t = Array.isArray(a) ? a : [a], i = Number(e?.renderer?.capabilities?.maxTextureSize), n = Number(e?.mobileMemoryProfile?.maxTextureSize ?? 2048), s = Number.isFinite(i) ? Math.min(n, i) : n;
3491
+ t.forEach((o) => {
3492
+ o != null && Object.keys(o).forEach((r) => {
3493
+ const l = o[r];
3494
+ if (l?.isTexture !== !0)
3495
3495
  return;
3496
- if (pn.has(r)) {
3497
- s[o] = null;
3496
+ if (un.has(l)) {
3497
+ o[r] = null;
3498
3498
  return;
3499
3499
  }
3500
- const l = ta(r);
3501
- l == null || Math.max(l.width, l.height) <= n || (pn.add(r), s[o] = null, ia(r), console.warn("[loadLightModel] discarded oversized mobile texture", {
3502
- slot: o,
3503
- width: l.width,
3504
- height: l.height,
3505
- maxTextureSize: n
3500
+ const c = ea(l);
3501
+ c == null || Math.max(c.width, c.height) <= s || (un.add(l), o[r] = null, ta(l), console.warn("[loadLightModel] discarded oversized mobile texture", {
3502
+ slot: r,
3503
+ width: c.width,
3504
+ height: c.height,
3505
+ maxTextureSize: s
3506
3506
  }));
3507
3507
  });
3508
3508
  });
3509
3509
  }
3510
- const na = "/__local_model__", sa = /^(info|property|edge|quota_list|lod\d+)(?:\.zip)?$/i, oa = /^(info|property|edge|quota_list|lod\d+)(?:~)?$/i;
3510
+ const ia = "/__local_model__", na = /^(info|property|edge|quota_list|lod\d+)(?:\.zip)?$/i, sa = /^(info|property|edge|quota_list|lod\d+)(?:~)?$/i;
3511
3511
  class ve {
3512
3512
  static localRequestMap = /* @__PURE__ */ new Map();
3513
3513
  static localObjectUrls = /* @__PURE__ */ new Set();
@@ -3530,7 +3530,7 @@ class ve {
3530
3530
  for (const n of e) {
3531
3531
  this.unloadedModelUrls.delete(n);
3532
3532
  const s = (this.modelLoadVersions.get(n) ?? 0) + 1;
3533
- this.modelLoadVersions.set(n, s), i(n) === "light" && Zr(this.engine, n, t, e.length, s);
3533
+ this.modelLoadVersions.set(n, s), i(n) === "light" && $r(this.engine, n, t, e.length, s);
3534
3534
  }
3535
3535
  function i(n) {
3536
3536
  const s = n.split(".").pop();
@@ -3548,11 +3548,11 @@ class ve {
3548
3548
  const s = e[n];
3549
3549
  try {
3550
3550
  const o = await ei.get(s, { responseType: "blob" });
3551
- if (!await Mn(o.data))
3551
+ if (!await yn(o.data))
3552
3552
  throw new Error("响应内容不是有效的 ZIP 文件");
3553
3553
  i.push(new File(
3554
3554
  [o.data],
3555
- ua(s, n),
3555
+ da(s, n),
3556
3556
  { type: o.data.type || "application/zip" }
3557
3557
  ));
3558
3558
  } catch (o) {
@@ -3593,8 +3593,8 @@ class ve {
3593
3593
  if (typeof e != "string" || e.length === 0)
3594
3594
  return;
3595
3595
  this.unloadedModelUrls.add(e), this.modelLoadVersions.set(e, (this.modelLoadVersions.get(e) ?? 0) + 1);
3596
- const t = Array.isArray(this.engine?.models) ? this.engine.models.filter((s) => s?.url === e) : [], i = ra(this.engine, e, t), n = aa(this.engine, e, i);
3597
- this.engine?.modelExplode?.releaseModel?.(e), this.engine?.modelToolModule?.releaseModelRuntimeState?.(e), this.engine?.modelEdge?.releaseModel?.(e), la(i), ca(i, n), ha(this.engine, e, i, t), t.forEach(da), Array.isArray(this.engine?.models) && (this.engine.models = this.engine.models.filter((s) => s?.url !== e)), this.clearEngineStatus(e), this.engine?.filterLoaderModel?.clear?.(e), this.removeModelGroupReference(e), ve.releaseLocalRequests(e), this.engine.requestComposerRender?.();
3596
+ const t = Array.isArray(this.engine?.models) ? this.engine.models.filter((s) => s?.url === e) : [], i = oa(this.engine, e, t), n = ra(this.engine, e, i);
3597
+ this.engine?.modelExplode?.releaseModel?.(e), this.engine?.modelToolModule?.releaseModelRuntimeState?.(e), this.engine?.modelEdge?.releaseModel?.(e), aa(i), la(i, n), ca(this.engine, e, i, t), t.forEach(ha), Array.isArray(this.engine?.models) && (this.engine.models = this.engine.models.filter((s) => s?.url !== e)), this.clearEngineStatus(e), this.engine?.filterLoaderModel?.clear?.(e), this.removeModelGroupReference(e), ve.releaseLocalRequests(e), this.engine.requestComposerRender?.();
3598
3598
  }
3599
3599
  /** 返回指定 URL 是否已收到卸载请求,供异步加载链路避免卸载后回写。 */
3600
3600
  isModelUnloadRequested(e) {
@@ -3624,13 +3624,13 @@ class ve {
3624
3624
  for (const l of t) {
3625
3625
  const c = this.parseDirectPackageEntry(l.path);
3626
3626
  if (c != null) {
3627
- vn(i, c.modelKey).set(c.packageName, l.blob);
3627
+ Mn(i, c.modelKey).set(c.packageName, l.blob);
3628
3628
  continue;
3629
3629
  }
3630
3630
  const h = this.parseExtractedPackageEntry(l.path);
3631
3631
  if (h == null)
3632
3632
  continue;
3633
- const u = vn(n, h.modelKey), p = u.get(h.packageName) ?? [];
3633
+ const u = Mn(n, h.modelKey), p = u.get(h.packageName) ?? [];
3634
3634
  p.push({
3635
3635
  path: h.innerPath,
3636
3636
  blob: l.blob
@@ -3654,7 +3654,7 @@ class ve {
3654
3654
  blob: await this.packEntriesAsZip(g)
3655
3655
  });
3656
3656
  c.some((p) => p.packageName === "info") && (r += 1, o.push({
3657
- rootUrl: `${na}/${ve.createLocalModelId(l, r)}`,
3657
+ rootUrl: `${ia}/${ve.createLocalModelId(l, r)}`,
3658
3658
  packages: c
3659
3659
  }));
3660
3660
  }
@@ -3668,15 +3668,15 @@ class ve {
3668
3668
  const t = [];
3669
3669
  for (const i of e) {
3670
3670
  const n = Re(i.webkitRelativePath || i.name), s = wt(n);
3671
- if (yn(s)) {
3671
+ if (fn(s)) {
3672
3672
  t.push({ path: n, blob: i });
3673
3673
  continue;
3674
3674
  }
3675
- if (await Mn(i)) {
3675
+ if (await yn(i)) {
3676
3676
  const o = await Ci.loadAsync(i), r = ui(n), l = Object.values(o.files);
3677
3677
  for (const c of l)
3678
3678
  c.dir || t.push({
3679
- path: pa(r, Re(c.name)),
3679
+ path: ua(r, Re(c.name)),
3680
3680
  blob: await c.async("blob")
3681
3681
  });
3682
3682
  continue;
@@ -3690,9 +3690,9 @@ class ve {
3690
3690
  */
3691
3691
  parseDirectPackageEntry(e) {
3692
3692
  const t = ui(e), i = wt(e);
3693
- return yn(i) ? {
3693
+ return fn(i) ? {
3694
3694
  modelKey: t,
3695
- packageName: ma(i)
3695
+ packageName: pa(i)
3696
3696
  } : null;
3697
3697
  }
3698
3698
  /**
@@ -3701,7 +3701,7 @@ class ve {
3701
3701
  parseExtractedPackageEntry(e) {
3702
3702
  const t = Re(e).split("/").filter(Boolean);
3703
3703
  for (let n = 0; n < t.length; n++) {
3704
- const s = ga(t[n]);
3704
+ const s = ma(t[n]);
3705
3705
  if (s == null)
3706
3706
  continue;
3707
3707
  const o = t.slice(n + 1);
@@ -3772,14 +3772,14 @@ class ve {
3772
3772
  return `${e.replace(/[^a-zA-Z0-9/_-]/g, "_").replace(/\//g, "__") || "model"}_${Date.now()}_${t}_${Math.random().toString(36).slice(2, 8)}`;
3773
3773
  }
3774
3774
  }
3775
- function Cs() {
3775
+ function bs() {
3776
3776
  return {
3777
3777
  geometries: /* @__PURE__ */ new Set(),
3778
3778
  materials: /* @__PURE__ */ new Set(),
3779
3779
  textures: /* @__PURE__ */ new Set()
3780
3780
  };
3781
3781
  }
3782
- function Es(a, e) {
3782
+ function Cs(a, e) {
3783
3783
  Object.values(a).forEach((i) => {
3784
3784
  i instanceof Ie && e.add(i);
3785
3785
  });
@@ -3795,13 +3795,13 @@ function Si(a, e) {
3795
3795
  [a?.geometry, ...Array.isArray(a?.geometrys) ? a.geometrys : []].forEach((n) => {
3796
3796
  n instanceof ae && e.geometries.add(n);
3797
3797
  }), (Array.isArray(a?.material) ? a.material : [a?.material]).forEach((n) => {
3798
- n instanceof At && (e.materials.add(n), Es(n, e.textures));
3798
+ n instanceof At && (e.materials.add(n), Cs(n, e.textures));
3799
3799
  });
3800
3800
  }
3801
3801
  function Ve(a, e) {
3802
3802
  a instanceof it && a.traverse((t) => e.add(t));
3803
3803
  }
3804
- function As(a, e) {
3804
+ function Es(a, e) {
3805
3805
  Ve(a?.group, e), a?.nodesMap?.forEach?.((t) => {
3806
3806
  Ve(t?.mesh, e), Ve(t?.pickBoxMesh, e), Ve(t?.info?.mesh, e), t?.infos?.forEach?.((i) => Ve(i?.mesh, e));
3807
3807
  }), a?.lods?.forEach?.((t) => {
@@ -3810,23 +3810,23 @@ function As(a, e) {
3810
3810
  });
3811
3811
  });
3812
3812
  }
3813
- function ra(a, e, t) {
3813
+ function oa(a, e, t) {
3814
3814
  const i = /* @__PURE__ */ new Set();
3815
- return Ve(a?.__modelGroupMap instanceof Map ? a.__modelGroupMap.get(e) : null, i), Ve($e(a, e), i), t.forEach((n) => As(n, i)), a?.__modelObjectIndexMap instanceof Map && a.__modelObjectIndexMap.forEach((n) => {
3815
+ return Ve(a?.__modelGroupMap instanceof Map ? a.__modelGroupMap.get(e) : null, i), Ve($e(a, e), i), t.forEach((n) => Es(n, i)), a?.__modelObjectIndexMap instanceof Map && a.__modelObjectIndexMap.forEach((n) => {
3816
3816
  (n?.url === e || n?.userData?.url === e) && Ve(n, i);
3817
3817
  }), a?.scene?.traverse?.((n) => {
3818
3818
  (n?.url === e || n?.userData?.url === e) && Ve(n, i);
3819
3819
  }), i;
3820
3820
  }
3821
- function aa(a, e, t) {
3822
- const i = Cs();
3821
+ function ra(a, e, t) {
3822
+ const i = bs();
3823
3823
  a?.scene?.traverse?.((s) => {
3824
3824
  t.has(s) || Si(s, i);
3825
3825
  }), a?.models?.forEach?.((s) => {
3826
3826
  if (s?.url === e)
3827
3827
  return;
3828
3828
  const o = /* @__PURE__ */ new Set();
3829
- As(s, o), o.forEach((r) => Si(r, i));
3829
+ Es(s, o), o.forEach((r) => Si(r, i));
3830
3830
  });
3831
3831
  const n = a?.scene;
3832
3832
  return n?.background instanceof Ie && i.textures.add(n.background), n?.environment instanceof Ie && i.textures.add(n.environment), [
@@ -3840,16 +3840,16 @@ function aa(a, e, t) {
3840
3840
  a?.modelExplode?.highlightMaterial,
3841
3841
  a?.modelExplode?.translucentMaterial
3842
3842
  ].forEach((s) => {
3843
- s instanceof At && (i.materials.add(s), Es(s, i.textures));
3843
+ s instanceof At && (i.materials.add(s), Cs(s, i.textures));
3844
3844
  }), i;
3845
3845
  }
3846
- function la(a) {
3846
+ function aa(a) {
3847
3847
  a.forEach((e) => {
3848
3848
  e.parent != null && !a.has(e.parent) && e.parent.remove(e);
3849
3849
  });
3850
3850
  }
3851
- function ca(a, e) {
3852
- const t = Cs();
3851
+ function la(a, e) {
3852
+ const t = bs();
3853
3853
  a.forEach((i) => Si(i, t)), t.geometries.forEach((i) => {
3854
3854
  e.geometries.has(i) || (i.disposeBoundsTree?.(), i.dispose());
3855
3855
  }), t.materials.forEach((i) => {
@@ -3858,7 +3858,7 @@ function ca(a, e) {
3858
3858
  e.textures.has(i) || i.dispose();
3859
3859
  });
3860
3860
  }
3861
- function ha(a, e, t, i) {
3861
+ function ca(a, e, t, i) {
3862
3862
  const n = /* @__PURE__ */ new Set();
3863
3863
  t.forEach((o) => {
3864
3864
  Number.isFinite(o?.index) && n.add(o.index);
@@ -3874,7 +3874,7 @@ function ha(a, e, t, i) {
3874
3874
  (n.has(r) || t.has(o) || o?.url === e) && s.delete(r);
3875
3875
  });
3876
3876
  }
3877
- function da(a) {
3877
+ function ha(a) {
3878
3878
  a?.nodesMap?.clear?.(), a?.lods?.forEach?.((e) => {
3879
3879
  e.glbs = [], e.instanceNodes = null, e.preparePromise = null, e.meshPromise = null, e.octreeBox = null;
3880
3880
  }), a.group = null, a.modelEdge = null, a.modelMep = null, a.modelMapper = null, a.modelTree = null, a.quotaList = null, a.urls = [];
@@ -3890,7 +3890,7 @@ function ui(a) {
3890
3890
  const e = Re(a), t = e.lastIndexOf("/");
3891
3891
  return t >= 0 ? e.slice(0, t) : "";
3892
3892
  }
3893
- function ua(a, e) {
3893
+ function da(a, e) {
3894
3894
  try {
3895
3895
  const t = new URL(a, window.location.origin);
3896
3896
  return decodeURIComponent(wt(t.pathname)) || `model-package-${e + 1}.zip`;
@@ -3898,29 +3898,29 @@ function ua(a, e) {
3898
3898
  return wt(a.split("?")[0].split("#")[0]) || `model-package-${e + 1}.zip`;
3899
3899
  }
3900
3900
  }
3901
- function pa(a, e) {
3901
+ function ua(a, e) {
3902
3902
  return Re(a ? e ? `${a}/${e}` : a : e);
3903
3903
  }
3904
- function yn(a) {
3905
- return sa.test(a);
3904
+ function fn(a) {
3905
+ return na.test(a);
3906
3906
  }
3907
- function ma(a) {
3907
+ function pa(a) {
3908
3908
  return a.replace(/\.zip$/i, "").toLowerCase();
3909
3909
  }
3910
- function ga(a) {
3911
- const e = oa.exec(a);
3910
+ function ma(a) {
3911
+ const e = sa.exec(a);
3912
3912
  return e == null ? null : e[1].toLowerCase();
3913
3913
  }
3914
- async function Mn(a) {
3914
+ async function yn(a) {
3915
3915
  const e = await a.slice(0, 4).arrayBuffer(), t = new Uint8Array(e);
3916
3916
  return t.length >= 4 && t[0] === 80 && t[1] === 75 && t[2] === 3 && t[3] === 4;
3917
3917
  }
3918
- function vn(a, e) {
3918
+ function Mn(a, e) {
3919
3919
  let t = a.get(e);
3920
3920
  return t == null && (t = /* @__PURE__ */ new Map(), a.set(e, t)), t;
3921
3921
  }
3922
3922
  var ne = /* @__PURE__ */ ((a) => (a.ModelLoadStart = "model-load-start", a.ModelLoadProgress = "model-load-progress", a.ModelLoaded = "model-loaded", a.ModelError = "model-error", a.SelectionChanged = "selection-changed", a.HoverChanged = "hover-changed", a.Click = "click", a.MouseMove = "mouse-move", a.ModelPlaceSelected = "model-place-selected", a.ModelCalibrationChanged = "model-calibration-changed", a.CameraChanged = "camera-changed", a.CameraIdle = "camera-idle", a.ViewportResize = "viewport-resize", a.EngineFree = "engine-free", a.EngineBusy = "engine-busy", a.MeasureChanged = "measure-changed", a.SectionMove = "section-move", a.LoadingCompleted = "loading_completed", a))(ne || {});
3923
- class fa {
3923
+ class ga {
3924
3924
  engine;
3925
3925
  isFree;
3926
3926
  // 是否是编辑模式
@@ -3943,7 +3943,7 @@ class fa {
3943
3943
  }
3944
3944
  init() {
3945
3945
  this.engine.renderer?.domElement?.addEventListener("contextmenu", this.handleContextMenu, !0), this.engine.events.on(ne.EngineFree, (e) => {
3946
- this.updateFree(!0), ws(this.engine, e, !1), this.engine?.octreeBox?.requestBvhBuild?.();
3946
+ this.updateFree(!0), xs(this.engine, e, !1), this.engine?.octreeBox?.requestBvhBuild?.();
3947
3947
  }), this.engine.events.on(ne.EngineBusy, () => {
3948
3948
  this.updateFree(!1);
3949
3949
  });
@@ -3962,7 +3962,7 @@ class fa {
3962
3962
  closeAllFunction = () => {
3963
3963
  };
3964
3964
  }
3965
- class ya {
3965
+ class fa {
3966
3966
  // 使用字符串作为键,以确保不同来源的 EventType 枚举值能够正确匹配
3967
3967
  listeners = /* @__PURE__ */ new Map();
3968
3968
  // 是否启用调试模式(可以通过外部设置)
@@ -4018,8 +4018,8 @@ class ya {
4018
4018
  });
4019
4019
  }
4020
4020
  }
4021
- const bt = 1, pi = 1, Ma = 1800, xn = 1024, va = 1.35, xa = 20, wa = 1200, mi = 0.5, ba = 10, Ca = 0.08, gi = 500, wn = 5e4, bn = 120, Ea = 5e4, Cn = 0.12, Aa = 8, Sa = 0.75, En = 5e-5, Pa = 15e-4, Ta = 2.5, Ia = 2.4, _a = 4.5, Da = 0.94, ka = 0.995, La = 80, Ba = 0.06, za = 8, Ra = new d(-1, 4, 2).normalize();
4022
- class Oa {
4021
+ const bt = 1, pi = 1, ya = 1800, vn = 1024, Ma = 1.35, va = 20, xa = 1200, mi = 0.5, wa = 10, ba = 0.08, gi = 500, xn = 5e4, wn = 120, Ca = 5e4, bn = 0.12, Ea = 8, Aa = 0.75, Cn = 5e-5, Sa = 15e-4, Pa = 2.5, Ta = 2.4, Ia = 4.5, _a = 0.94, Da = 0.995, ka = 80, La = 0.06, Ba = 8, za = new d(-1, 4, 2).normalize();
4022
+ class Ra {
4023
4023
  // 引擎实例,要求至少提供 scene、controls、octreeBox 等运行时对象。
4024
4024
  engine;
4025
4025
  // 上一次应用到阴影相机的半边长,用于跳过无意义的小幅更新。
@@ -4050,7 +4050,7 @@ class Oa {
4050
4050
  */
4051
4051
  init() {
4052
4052
  const e = new Xe(16774630, 2);
4053
- e.name = "directionalShadowLight", e.castShadow = !0, e.shadow.mapSize.width = xn, e.shadow.mapSize.height = xn, e.shadow.camera.near = mi, e.shadow.camera.far = gi, e.shadow.bias = -En, e.shadow.normalBias = Cn;
4053
+ e.name = "directionalShadowLight", e.castShadow = !0, e.shadow.mapSize.width = vn, e.shadow.mapSize.height = vn, e.shadow.camera.near = mi, e.shadow.camera.far = gi, e.shadow.bias = -Cn, e.shadow.normalBias = bn;
4054
4054
  const t = pi;
4055
4055
  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 = bt, e.target.name = "directionalShadowLightTarget";
4056
4056
  const i = new Xe(16777215, 2);
@@ -4082,16 +4082,16 @@ class Oa {
4082
4082
  }
4083
4083
  const l = this.resolveShadowTarget(e, r), c = this.getCameraHalfExtent(e, l), h = this.getSceneShadowHalfSize(s, c), u = F.clamp(
4084
4084
  Math.max(
4085
- c * va,
4085
+ c * Ma,
4086
4086
  h,
4087
4087
  pi
4088
4088
  ),
4089
4089
  pi,
4090
- Ma
4090
+ ya
4091
4091
  ), p = F.clamp(
4092
- Math.max(u * 2.5, o * 0.75, bn),
4093
- bn,
4094
- Ea
4092
+ Math.max(u * 2.5, o * 0.75, wn),
4093
+ wn,
4094
+ Ca
4095
4095
  ), g = this.getLightOffsetDirection(), y = this.snapShadowTargetToTexel(
4096
4096
  l,
4097
4097
  g,
@@ -4124,7 +4124,7 @@ class Oa {
4124
4124
  return 0;
4125
4125
  if (t <= 0)
4126
4126
  return e * 0.75;
4127
- const i = t * xa;
4127
+ const i = t * va;
4128
4128
  return Math.min(e * 0.75, i);
4129
4129
  }
4130
4130
  /**
@@ -4136,15 +4136,15 @@ class Oa {
4136
4136
  updateShadowBias(e, t, i) {
4137
4137
  const n = Math.max(e.shadow.mapSize.width, 1), s = t * 2 / n, o = Math.max(i.far - i.near, 1);
4138
4138
  e.shadow.normalBias = F.clamp(
4139
- s * Sa,
4140
- Cn,
4141
- Aa
4139
+ s * Aa,
4140
+ bn,
4141
+ Ea
4142
4142
  );
4143
- const r = s / o * Ta;
4143
+ const r = s / o * Pa;
4144
4144
  e.shadow.bias = -F.clamp(
4145
4145
  r,
4146
- En,
4147
- Pa
4146
+ Cn,
4147
+ Sa
4148
4148
  );
4149
4149
  }
4150
4150
  /**
@@ -4167,12 +4167,12 @@ class Oa {
4167
4167
  }
4168
4168
  if (Number.isFinite(c) && Number.isFinite(h)) {
4169
4169
  const u = Math.max(
4170
- (h - c) * Ca,
4171
- ba
4170
+ (h - c) * ba,
4171
+ wa
4172
4172
  ), p = Math.max(mi, c - u), g = F.clamp(
4173
4173
  Math.max(p + 1, h + u),
4174
4174
  p + 1,
4175
- wn
4175
+ xn
4176
4176
  );
4177
4177
  return { near: p, far: g };
4178
4178
  }
@@ -4180,7 +4180,7 @@ class Oa {
4180
4180
  const r = F.clamp(
4181
4181
  Math.max(n * 1.5, s * 4, gi),
4182
4182
  gi,
4183
- wn
4183
+ xn
4184
4184
  );
4185
4185
  return { near: mi, far: r };
4186
4186
  }
@@ -4284,7 +4284,7 @@ class Oa {
4284
4284
  }
4285
4285
  if (e instanceof Xt) {
4286
4286
  const i = this.resolveShadowTarget(e, t), n = Math.max(e.position.distanceTo(i), 1), s = F.degToRad(e.getEffectiveFOV() * 0.5), o = Math.max(Math.tan(s) * n, 1), r = o * Math.max(e.aspect, 1e-6);
4287
- return Math.min(Math.max(r, o), wa);
4287
+ return Math.min(Math.max(r, o), xa);
4288
4288
  }
4289
4289
  return 0;
4290
4290
  }
@@ -4311,7 +4311,7 @@ class Oa {
4311
4311
  * @returns 标准化后的世界空间光源偏移方向。
4312
4312
  */
4313
4313
  getLightOffsetDirection() {
4314
- return Ra.clone();
4314
+ return za.clone();
4315
4315
  }
4316
4316
  /**
4317
4317
  * 根据当前视角和阴影贴图密度计算最终显示强度。
@@ -4324,8 +4324,8 @@ class Oa {
4324
4324
  getShadowDisplayIntensity(e, t, i, n) {
4325
4325
  const s = i * 2 / Math.max(n, 1), o = 1 - F.smoothstep(
4326
4326
  s,
4327
- Ia,
4328
- _a
4327
+ Ta,
4328
+ Ia
4329
4329
  );
4330
4330
  let r = 1;
4331
4331
  if (e) {
@@ -4334,8 +4334,8 @@ class Oa {
4334
4334
  const c = Math.abs(l.dot(t.clone().normalize()));
4335
4335
  r = 1 - F.smoothstep(
4336
4336
  c,
4337
- Da,
4338
- ka
4337
+ _a,
4338
+ Da
4339
4339
  );
4340
4340
  }
4341
4341
  return bt * Math.min(o, r);
@@ -4380,10 +4380,10 @@ class Oa {
4380
4380
  if (i.isEmpty())
4381
4381
  return;
4382
4382
  const n = i.getSize(new d()), s = Math.max(n.x, n.z), o = Math.max(
4383
- za,
4384
- s * Ba
4383
+ Ba,
4384
+ s * La
4385
4385
  );
4386
- if (s >= La && n.y <= o) {
4386
+ if (s >= ka && n.y <= o) {
4387
4387
  e.castShadow = !1, t.__lightModuleReceiverOnlyShadow = !0;
4388
4388
  return;
4389
4389
  }
@@ -4399,7 +4399,7 @@ class Oa {
4399
4399
  i && (i.shadowSide = Oi);
4400
4400
  }
4401
4401
  }
4402
- class Fa {
4402
+ class Oa {
4403
4403
  engine;
4404
4404
  behavior;
4405
4405
  isCtrlDown = !1;
@@ -4834,7 +4834,7 @@ class Fa {
4834
4834
  return e?.nodesMap?.get(t) ?? e?.nodesMap?.get(Number(t)) ?? e?.nodesMap?.get(String(t));
4835
4835
  }
4836
4836
  }
4837
- class Na {
4837
+ class Fa {
4838
4838
  engine;
4839
4839
  highlightMaterial;
4840
4840
  translucentMaterial;
@@ -5106,7 +5106,7 @@ class Na {
5106
5106
  const u = this.getSceneModel(h[0]);
5107
5107
  u instanceof V ? o.has(h[0]) ? o.get(h[0])?.push(h[1]) : o.set(h[0], [h[1]]) : this.setSplitComponentState(u, h[1], 1, !0);
5108
5108
  });
5109
- }), Ha(o, this.engine);
5109
+ }), Na(o, this.engine);
5110
5110
  let r = this.engine.engineStatus.highlightModels.find((l) => l.url == t.url);
5111
5111
  r != null ? (Array.isArray(r.guids) || (r.guids = this.getModelGuids(i, r.ids)), n.forEach((l, c) => {
5112
5112
  const h = r.ids.indexOf(l);
@@ -5136,7 +5136,7 @@ class Na {
5136
5136
  !0
5137
5137
  );
5138
5138
  });
5139
- }), An(n, this.engine, "highlightModel");
5139
+ }), En(n, this.engine, "highlightModel");
5140
5140
  }), this.rebatchSplitModels(), this.updateMaterial(), this.syncHighlightModelEdges(this.getHighlightModelsAfterRemove(e)), this.syncExplodeVisualState();
5141
5141
  }
5142
5142
  // 取消所有模型高亮
@@ -5160,7 +5160,7 @@ class Na {
5160
5160
  const c = this.getSceneModel(l[0]);
5161
5161
  c instanceof V ? n.has(l[0]) ? n.get(l[0])?.push(l[1]) : n.set(l[0], [l[1]]) : this.setSplitComponentState(c, l[1], -1, !1);
5162
5162
  });
5163
- }), n.size > 0 && Ua(n, this.engine);
5163
+ }), n.size > 0 && Va(n, this.engine);
5164
5164
  let s = this.engine.engineStatus.hideModels.find((o) => o.url == t.url);
5165
5165
  s != null ? this.appendUniqueIds(s.ids, t.ids) : this.engine.engineStatus.hideModels.push({
5166
5166
  url: t.url,
@@ -5186,7 +5186,7 @@ class Na {
5186
5186
  !0
5187
5187
  );
5188
5188
  });
5189
- }), s.size > 0 && Sn(s, this.engine), t)
5189
+ }), s.size > 0 && An(s, this.engine), t)
5190
5190
  return;
5191
5191
  let o = this.engine.engineStatus.hideModels.find((r) => r.url == i.url);
5192
5192
  o && (i.ids.forEach((r) => {
@@ -5512,7 +5512,7 @@ class Na {
5512
5512
  const u = this.getSceneModel(h[0]);
5513
5513
  u instanceof V ? o.has(h[0]) ? o.get(h[0])?.push(h[1]) : o.set(h[0], [h[1]]) : this.setSplitComponentState(u, h[1], 2, !0);
5514
5514
  });
5515
- }), Va(o, this.engine, i);
5515
+ }), Ha(o, this.engine, i);
5516
5516
  let r = this.engine.engineStatus.translucentModels.find((l) => l.url == n.url);
5517
5517
  r != null ? r.ids.push(...n.ids) : this.engine.engineStatus.translucentModels.push({
5518
5518
  url: n.url,
@@ -5538,7 +5538,7 @@ class Na {
5538
5538
  !0
5539
5539
  );
5540
5540
  });
5541
- }), n.size > 0 && Sn(n, this.engine), An(n, this.engine, "translucentModel");
5541
+ }), n.size > 0 && An(n, this.engine), En(n, this.engine, "translucentModel");
5542
5542
  }), this.engine.engineStatus.translucentModels = [], this.rebatchSplitModels(), this.syncExplodeVisualState();
5543
5543
  }
5544
5544
  // ***************************************************** 设置模型半透明 ***************************************************** //
@@ -5586,7 +5586,7 @@ class Na {
5586
5586
  }
5587
5587
  // ***************************************************** 设置模型颜色 ***************************************************** //
5588
5588
  }
5589
- function Ha(a, e) {
5589
+ function Na(a, e) {
5590
5590
  a.forEach((t, i) => {
5591
5591
  const n = Rt(e, i);
5592
5592
  if (!(n instanceof V))
@@ -5619,7 +5619,7 @@ function Ha(a, e) {
5619
5619
  }), n.instanceMatrix.needsUpdate = !0, r.instanceMatrix.needsUpdate = !0, (n.parent ?? e.scene).add(r);
5620
5620
  });
5621
5621
  }
5622
- function An(a, e, t) {
5622
+ function En(a, e, t) {
5623
5623
  a.forEach((i, n) => {
5624
5624
  const s = Rt(e, n);
5625
5625
  if (!(s instanceof V))
@@ -5637,11 +5637,11 @@ function An(a, e, t) {
5637
5637
  e.scene.traverse((r) => {
5638
5638
  r.key == n && r.name == t && o.push(r);
5639
5639
  }), o.forEach((r) => {
5640
- Ss(r);
5640
+ As(r);
5641
5641
  });
5642
5642
  });
5643
5643
  }
5644
- function Va(a, e, t = 0.05) {
5644
+ function Ha(a, e, t = 0.05) {
5645
5645
  a.forEach((i, n) => {
5646
5646
  const s = Rt(e, n);
5647
5647
  if (!(s instanceof V))
@@ -5668,12 +5668,12 @@ function Va(a, e, t = 0.05) {
5668
5668
  }), s.instanceMatrix.needsUpdate = !0, l.instanceMatrix.needsUpdate = !0, (s.parent ?? e.scene).add(l);
5669
5669
  });
5670
5670
  }
5671
- function Ua(a, e) {
5671
+ function Va(a, e) {
5672
5672
  const t = [];
5673
5673
  e.scene.traverse((i) => {
5674
5674
  i.name == "highlightModel" && t.push(i);
5675
5675
  }), t.forEach((i) => {
5676
- Ss(i);
5676
+ As(i);
5677
5677
  }), a.forEach((i, n) => {
5678
5678
  const s = Rt(e, n);
5679
5679
  if (!(s instanceof V))
@@ -5687,7 +5687,7 @@ function Ua(a, e) {
5687
5687
  }), s.instanceMatrix.needsUpdate = !0;
5688
5688
  });
5689
5689
  }
5690
- function Sn(a, e) {
5690
+ function An(a, e) {
5691
5691
  a.forEach((t, i) => {
5692
5692
  const n = Rt(e, i);
5693
5693
  n instanceof V && (t.forEach((s) => {
@@ -5708,7 +5708,7 @@ function Bt(a, e, t) {
5708
5708
  function zt(a, e) {
5709
5709
  a?.cloneModel != null && (a.cloneModel.visible = e);
5710
5710
  }
5711
- function Ss(a) {
5711
+ function As(a) {
5712
5712
  if (a == null)
5713
5713
  return;
5714
5714
  const e = a.parent;
@@ -5717,8 +5717,8 @@ function Ss(a) {
5717
5717
  function Rt(a, e) {
5718
5718
  return Le(a, e);
5719
5719
  }
5720
- const Ps = "advanced";
5721
- class Wa {
5720
+ const Ss = "advanced";
5721
+ class Ua {
5722
5722
  engine;
5723
5723
  currentMode = "";
5724
5724
  // 是否为手动设置(手动设置时,自动适配不再生效)
@@ -5736,7 +5736,7 @@ class Wa {
5736
5736
  * 初始化模块
5737
5737
  */
5738
5738
  init() {
5739
- this.cachePassReferences(), this.autoSwitch(Ps);
5739
+ this.cachePassReferences(), this.autoSwitch(Ss);
5740
5740
  }
5741
5741
  /**
5742
5742
  * 手动切换渲染模式(用户调用),锁定自动适配
@@ -5942,7 +5942,7 @@ class ni {
5942
5942
  color: 16777215,
5943
5943
  transparent: !0,
5944
5944
  opacity: 0,
5945
- blending: to,
5945
+ blending: eo,
5946
5946
  depthWrite: !1
5947
5947
  }), this.overlayMaterial.clippingPlanes = this.engine.sectionPlane;
5948
5948
  }
@@ -6007,10 +6007,10 @@ class ni {
6007
6007
  this.setAnimationFrameRateExempt(!1), this.removeOverlayMeshes(), this.overlayMaterial.dispose(), this.tagDiv?.remove?.(), this.tagDiv = null, this.animState = "idle";
6008
6008
  }
6009
6009
  }
6010
- function Ga() {
6010
+ function Wa() {
6011
6011
  return new ki();
6012
6012
  }
6013
- function qa(a, e) {
6013
+ function Ga(a, e) {
6014
6014
  a.appendChild(e.domElement);
6015
6015
  }
6016
6016
  const Je = {
@@ -6022,7 +6022,7 @@ const Je = {
6022
6022
  front: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAACXBIWXMAAAsTAAALEwEAmpwYAAABp0lEQVR4nO3ZwWnDQBBA0XFwM9uA23FtbkcNqByngxCCzQb/985CzOEzaFeXmXkOWdeZmfM8d8/BBmut+do9BHsJIE4AcQKIE0CcAOIEECeAOAHECSBOAHECiBNAnADiBBAngDgBxAkgTgBxAogTQJwA4gQQJ4A4AcQJIE4AcQKIE0CcAOIEECeAOAHECSBOAHECiBNAnADiBBAngDgBxAkgTgBxAoi77h7gne73+xzH8bL33W63eTweL3vff2ADxAkgTgBxAogTQNxHnwJ+8olf9H9hA8QJIE4AcQKIE0CcAOIEECeAOAHEZW8Cj+OYtdavn//Um0MbIE4AcQKIE0CcAOKyp4CZmfM8d4+wnQ0QJ4A4AcQJIE4AcQKIE0CcAOIEECeAOAHECSBOAHECiLvMzNNv0aa1lg1QJ4A4AcQJIE4AcQKIE0CcAOIEECeAOAHECSBOAHECiBNAnADiBBAngDgBxAkgTgBxAogTQJwA4gQQJ4A4AcQJIE4AcQKIE0CcAOIEECeAOAHECSBOAHECiBNAnADiBBAngDgBxF1m5rl7CPb5Bhi1Gm3j3a/lAAAAAElFTkSuQmCC",
6023
6023
  back: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAACXBIWXMAAAsTAAALEwEAmpwYAAADuklEQVR4nO3dMUvjYADG8cfjlsxugkRBkAwuog5+gJKAk1un4iLZbAQds+nioG7FzamDH0BXN4ngKg6i0k0IuEhGbzlFvCY1veR97/I8vzURnuFPkzYBJwC8QWj9BIDb21vbO8QCz/Pww/YIsUsBkFMA5BQAOQVATgGQUwDkFAA5BUBOAZBTAOQUADkFQE4BkFMA5BQAOQVATgGQUwDkFAA5BUBOAZBTAOQUADkFQE4BkFMA5BQAOQVATgGQUwDkFAA5BUBOAZBTAOQUADkFQE4BkFMA5BQAOQVATgGQUwDkFAC5n7YHVK3T6SBJkrH/fmVlBe12GwDg+35Vs/5ZjQvgbyVJ8hFQFEUIwxDr6+uYnp62vKweugSM0Ov10Gq1cHFxYXtKLRTAN0VRhLOzM9szKqcASojjGDc3N7ZnVEoBlHR8fGx7QqXobgKH/XucLMtweXmJfr8/8htEkiQYDAaNuSnUJwAAx3Hg+z5OT08/vgIWeXx8rH+UIQrgi52dHbiua3uGMQrgC8dxsLq6anuGMQpgDDMzM7YnVEYBDPHy8pJ7zHXdxtwAAgrgD3d3dzg/P8893u12zY0xQAF8kqYp9vf3c48HQdC4B0R0vwMMk6Yprq+vEUVR7jlBEGBvb8/gKjPoAvA8r/TfhGGIra2tGtbYRxdAGWEYwvd9zM/P255SG90DFJiamsLDw4PtGbVSAAXiOEYURfA8r5GPggEF8G1xHKPT6SBNU9tTKqUASkiSBNvb28iyzPaUytDdBA57HAx8/5FwkiQ4OTlpzLcCfQL89vmR8O7ubuG5vV4Pg8HA0LJ6KYAhNjY2EARB4TlXV1eG1tRLAeRotVqFx/MuJf8bBZBjdna28Pj9/b2hJfVSADleX19tTzBCAeR4fn4uPD45OWloSb0UwBBZlqHf7xees7CwYGhNvRTAEAcHByNfD5+bmzO0pl50PwTleX8n4OjoCE9PT4Xnuq6LpaUlQ8vqRRfAOO8DfNXtduE4TgVr7NMloKSmvRamAEpo4mthdJeAcYVhiM3NzcZ89L9TACO0222sra1hcXHR9pRaKIAhDg8PAQDLy8uN+cEnzwSAt6Y82JByPM/TTSA7BUBOAZBTAOQUADkFQE4BkFMA5BQAOQVATgGQUwDkFAA5BUBOAZBTAOQUADkFQE4BkFMA5BQAOQVATgGQUwDkFAA5BUBOAZBTAOQUADkFQE4BkFMA5BQAOQVATgGQUwDkFAA5BUBOAZBTAOQUADkFQE4BkJsA8GZ7hNjzC2Yhv7BCBMu8AAAAAElFTkSuQmCC"
6024
6024
  };
6025
- function Ka(a, e, t) {
6025
+ function qa(a, e, t) {
6026
6026
  var i = new Object();
6027
6027
  i.visible = !0;
6028
6028
  let n = null, s = 0, o, r, l = [];
@@ -6208,8 +6208,8 @@ function Ka(a, e, t) {
6208
6208
  }), He.easing(et.Easing.Cubic.InOut), g(), He.start(), oi();
6209
6209
  } else {
6210
6210
  var E = w.min.clone().add(w.max.clone()).multiplyScalar(0.5);
6211
- let Vs = e.camera.position.clone().sub(a.controls.target.clone()).normalize();
6212
- var T = E.clone().add(Vs.multiplyScalar(2 * w.max.distanceTo(w.min)));
6211
+ let Hs = e.camera.position.clone().sub(a.controls.target.clone()).normalize();
6212
+ var T = E.clone().add(Hs.multiplyScalar(2 * w.max.distanceTo(w.min)));
6213
6213
  P(e.camera.position, T, a.controls.target.clone(), E, null, null, f);
6214
6214
  }
6215
6215
  };
@@ -6322,7 +6322,7 @@ function Ka(a, e, t) {
6322
6322
  }
6323
6323
  }
6324
6324
  function k() {
6325
- i.sceneOrtho = Ga();
6325
+ i.sceneOrtho = Wa();
6326
6326
  var E = t.clientWidth, _ = t.clientWidth, w = E > _ ? E / _ : _ / E, f = 300;
6327
6327
  i.camera = new Be(
6328
6328
  f * w / -2,
@@ -6337,7 +6337,7 @@ function Ka(a, e, t) {
6337
6337
  });
6338
6338
  D.setSize(E, _), D.setClearAlpha(0), i.sceneOrtho.renderer = D;
6339
6339
  let T = new $t(16777215, 0.8);
6340
- i.sceneOrtho.add(T), qa(o, D), i.orbitControls = new ts(a, 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);
6340
+ i.sceneOrtho.add(T), Ga(o, D), i.orbitControls = new es(a, 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);
6341
6341
  }
6342
6342
  let O = !1;
6343
6343
  function K() {
@@ -6642,7 +6642,7 @@ function Ka(a, e, t) {
6642
6642
  !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("已退出全屏模式"));
6643
6643
  }, i;
6644
6644
  }
6645
- class ja {
6645
+ class Ka {
6646
6646
  engine;
6647
6647
  cubeTool;
6648
6648
  mainViewPort;
@@ -6650,7 +6650,7 @@ class ja {
6650
6650
  this.engine = e;
6651
6651
  }
6652
6652
  init() {
6653
- this.cubeTool = Ka(this.engine, this.engine.scene, this.engine.container), this.cubeTool.init();
6653
+ this.cubeTool = qa(this.engine, this.engine.scene, this.engine.container), this.cubeTool.init();
6654
6654
  }
6655
6655
  // 隐藏视图立方体,供 showViewCube=false 的初始化配置调用。
6656
6656
  hide() {
@@ -6770,7 +6770,7 @@ class ja {
6770
6770
  this.cubeTool.TakeScreenshot();
6771
6771
  }
6772
6772
  }
6773
- function Ya(a) {
6773
+ function ja(a) {
6774
6774
  let e = new Object(), t = null;
6775
6775
  return e.getBoundingBox = function() {
6776
6776
  let i = a.models, n = new d(1e8, 1e9, 1e10), s = new d(-1e8, -1e9, -1e10);
@@ -6828,12 +6828,12 @@ function Ya(a) {
6828
6828
  });
6829
6829
  });
6830
6830
  const m = l.map((f) => O(f)).filter((f) => f instanceof z);
6831
- ur(i);
6831
+ dr(i);
6832
6832
  const b = [
6833
6833
  ...x,
6834
6834
  ...i.intersectObjects(m, !1).map(he)
6835
6835
  ].sort((f, E) => f.distance - E.distance);
6836
- return pr(i), b;
6836
+ return ur(i), b;
6837
6837
  function C(f, E, _, D, T) {
6838
6838
  if (E == null)
6839
6839
  return;
@@ -6996,7 +6996,7 @@ function Ya(a) {
6996
6996
  }
6997
6997
  }, e;
6998
6998
  }
6999
- class Xa {
6999
+ class Ya {
7000
7000
  engine;
7001
7001
  // 绘制状态
7002
7002
  isDrawing = !1;
@@ -7174,8 +7174,8 @@ class Xa {
7174
7174
  this.disActive(), this.selectionBox?.remove(), this.selectionBox = null, this.worldToScreen = null, this.isDrawing = !1;
7175
7175
  }
7176
7176
  }
7177
- const Qa = F.degToRad(10), Pn = 1e-3, Pi = !1, $a = [];
7178
- class Za {
7177
+ const Xa = F.degToRad(10), Sn = 1e-3, Pi = !1, Qa = [];
7178
+ class $a {
7179
7179
  engine;
7180
7180
  rootGroup = null;
7181
7181
  isVisible = Pi;
@@ -7189,7 +7189,7 @@ class Za {
7189
7189
  }
7190
7190
  setMockData() {
7191
7191
  const e = this.engine.models?.[0]?.grids;
7192
- this.setData(Array.isArray(e) && e.length > 0 ? e : $a);
7192
+ this.setData(Array.isArray(e) && e.length > 0 ? e : Qa);
7193
7193
  }
7194
7194
  show() {
7195
7195
  this.isVisible = !0, this.rootGroup && (this.rootGroup.visible = !0);
@@ -7278,7 +7278,7 @@ class Za {
7278
7278
  throw new Error("Grid sprite canvas context is not available");
7279
7279
  const o = 128 / 2, r = 128 / 2, l = 128 / 2 - 4;
7280
7280
  s.beginPath(), s.arc(o, r, l, 0, Math.PI * 2), s.fillStyle = "white", s.fill(), s.strokeStyle = "#1890ff", s.lineWidth = 6, s.stroke(), s.fillStyle = "#1890ff", s.font = `bold ${Math.round(128 * 0.38)}px Arial`, s.textAlign = "center", s.textBaseline = "middle", s.fillText(e, o, r);
7281
- const c = new io(n), h = new no({
7281
+ const c = new to(n), h = new io({
7282
7282
  map: c,
7283
7283
  depthTest: !1,
7284
7284
  transparent: !0
@@ -7328,7 +7328,7 @@ class Za {
7328
7328
  const n = this.createProjection(i);
7329
7329
  if (!n)
7330
7330
  return;
7331
- const s = t.find((o) => o.direction.angleTo(n.direction) <= Qa);
7331
+ const s = t.find((o) => o.direction.angleTo(n.direction) <= Xa);
7332
7332
  if (s) {
7333
7333
  s.axes.push(n);
7334
7334
  return;
@@ -7358,13 +7358,13 @@ class Za {
7358
7358
  }
7359
7359
  normalizeDirection(e) {
7360
7360
  const t = e.clone().normalize();
7361
- return (t.x < 0 || Math.abs(t.x) <= Pn && t.y < 0) && t.multiplyScalar(-1), t;
7361
+ return (t.x < 0 || Math.abs(t.x) <= Sn && t.y < 0) && t.multiplyScalar(-1), t;
7362
7362
  }
7363
7363
  /**
7364
7364
  * 在单个轴族内优先返回点位所属的最近轴网区间,避免落在线上时出现空描述。
7365
7365
  */
7366
7366
  resolveFamilyLocation(e, t) {
7367
- const i = t.dot(e.normal), n = e.axes.find((c) => Math.abs(c.offset - i) <= Pn) ?? null;
7367
+ const i = t.dot(e.normal), n = e.axes.find((c) => Math.abs(c.offset - i) <= Sn) ?? null;
7368
7368
  if (n) {
7369
7369
  const c = e.axes.findIndex((u) => u.data.Id === n.data.Id), h = this.pickAxisPairAroundIndex(e.axes, c);
7370
7370
  return {
@@ -7463,15 +7463,15 @@ class Za {
7463
7463
  return e instanceof d ? e.clone() : new d(e.x, e.y, e.z);
7464
7464
  }
7465
7465
  }
7466
- const Ts = "0", Is = 0, _s = !1;
7466
+ const Ps = "0", Ts = 0, Is = !1;
7467
7467
  class qi {
7468
7468
  engine;
7469
- currentId = Ts;
7469
+ currentId = Ps;
7470
7470
  groundGroup;
7471
7471
  groundMesh = null;
7472
7472
  /** 当前为官方 Water 水面时为 true,用于 update/dispose 分支 */
7473
7473
  isWaterAddon = !1;
7474
- groundY = Is;
7474
+ groundY = Ts;
7475
7475
  /** 默认水面法线贴图路径(项目内为 public/textture/waternormals.jpg) */
7476
7476
  static DEFAULT_WATER_NORMALS = "/texture/waternormals.jpg";
7477
7477
  groundList = [
@@ -7496,7 +7496,7 @@ class qi {
7496
7496
  this.engine = e, this.groundGroup = new pe(), this.groundGroup.name = "groundGroup";
7497
7497
  }
7498
7498
  init() {
7499
- this.engine.scene.add(this.groundGroup), this.groundGroup.visible = _s;
7499
+ this.engine.scene.add(this.groundGroup), this.groundGroup.visible = Is;
7500
7500
  }
7501
7501
  /**
7502
7502
  * 切换地面类型
@@ -7511,7 +7511,7 @@ class qi {
7511
7511
  if (i.water) {
7512
7512
  const s = new bi(n, n), o = t?.waterNormalsUrl ?? ee(qi.DEFAULT_WATER_NORMALS, import.meta.url), r = new nt().load(o, (g) => {
7513
7513
  g.wrapS = g.wrapT = pt;
7514
- }), l = t?.sunDirection ?? new d(0.5, 0.8, 0.5).normalize(), c = t?.distortionScale ?? i.distortionScale ?? 3.7, h = t?.waterSize ?? i.size ?? 1, u = t?.opacity ?? 0.92, p = new so(s, {
7514
+ }), l = t?.sunDirection ?? new d(0.5, 0.8, 0.5).normalize(), c = t?.distortionScale ?? i.distortionScale ?? 3.7, h = t?.waterSize ?? i.size ?? 1, u = t?.opacity ?? 0.92, p = new no(s, {
7515
7515
  textureWidth: 512,
7516
7516
  textureHeight: 512,
7517
7517
  waterNormals: r,
@@ -7603,12 +7603,12 @@ class qi {
7603
7603
  Array.isArray(e) ? e.forEach((t) => t.dispose()) : e.dispose(), this.groundGroup.remove(this.groundMesh), this.groundMesh = null, this.isWaterAddon = !1;
7604
7604
  }
7605
7605
  }
7606
- const Ue = "0", Ja = !0, Ds = 0.2, el = 0.35;
7607
- class tl {
7606
+ const Ue = "0", Za = !0, _s = 0.2, Ja = 0.35;
7607
+ class el {
7608
7608
  engine;
7609
7609
  currentHdrId = Ue;
7610
- isVisible = Ja;
7611
- currentIntensity = Ds;
7610
+ isVisible = Za;
7611
+ currentIntensity = _s;
7612
7612
  currentTexture = null;
7613
7613
  currentEnvironmentTexture = null;
7614
7614
  skybox = null;
@@ -7693,10 +7693,10 @@ class tl {
7693
7693
  _loadHdr(e) {
7694
7694
  const t = ee(e, import.meta.url);
7695
7695
  return new Promise((i, n) => {
7696
- new oo().load(
7696
+ new so().load(
7697
7697
  t,
7698
7698
  (s) => {
7699
- s.mapping = ro, i(s);
7699
+ s.mapping = oo, i(s);
7700
7700
  },
7701
7701
  void 0,
7702
7702
  (s) => n(s)
@@ -7706,7 +7706,7 @@ class tl {
7706
7706
  _applyTexture(e) {
7707
7707
  if (this.currentTexture = e, !this.engine.scene || !this.engine.renderer) return;
7708
7708
  this._captureSceneState(), this.currentEnvironmentTexture?.dispose();
7709
- const t = new Zn(this.engine.renderer), i = t.fromEquirectangular(e).texture;
7709
+ const t = new $n(this.engine.renderer), i = t.fromEquirectangular(e).texture;
7710
7710
  t.dispose(), this.currentEnvironmentTexture = i, this.engine.scene.background = null, this.engine.scene.environment = i, this.engine.scene.environmentIntensity = this.currentIntensity, this.engine.renderer.toneMapping = Bi, this.engine.renderer.toneMappingExposure = this.previousToneMappingExposure > 0 ? this.previousToneMappingExposure : Fi, this._removeSkybox(), this._createSkybox(e), this._setAmbientLightIntensity(this._getHdrAmbientLightIntensity());
7711
7711
  }
7712
7712
  _captureSceneState() {
@@ -7748,20 +7748,20 @@ class tl {
7748
7748
  t && (t.intensity = e);
7749
7749
  }
7750
7750
  _getHdrAmbientLightIntensity() {
7751
- return Math.max(this.previousAmbientLightIntensity * el, 0);
7751
+ return Math.max(this.previousAmbientLightIntensity * Ja, 0);
7752
7752
  }
7753
7753
  _requestRender() {
7754
7754
  this.engine?.requestComposerRender?.();
7755
7755
  }
7756
7756
  }
7757
- const il = 1e-3, ks = !1, nl = [
7757
+ const tl = 1e-3, Ds = !1, il = [
7758
7758
  { Id: "339", Name: "L1", Elevation: -0.32808398950131235 },
7759
7759
  { Id: "2787", Name: "L2", Elevation: 16.896325459317584 },
7760
7760
  { Id: "236633", Name: "L3", Elevation: 36.745406824146976 }
7761
7761
  ];
7762
- class sl {
7762
+ class nl {
7763
7763
  engine;
7764
- isVisible = ks;
7764
+ isVisible = Ds;
7765
7765
  levels = [];
7766
7766
  svgContainer = null;
7767
7767
  svgOverlay = null;
@@ -7779,7 +7779,7 @@ class sl {
7779
7779
  }
7780
7780
  setMockData() {
7781
7781
  const e = this.engine.models?.[0]?.levels, t = this.engine.models?.[0]?.boundingBox;
7782
- this.setData(Array.isArray(e) && e.length > 0 ? e : nl, t);
7782
+ this.setData(Array.isArray(e) && e.length > 0 ? e : il, t);
7783
7783
  }
7784
7784
  show() {
7785
7785
  this.isVisible = !0, this.svgContainer && (this.svgContainer.style.display = "block"), this.levels.forEach((e) => {
@@ -7812,7 +7812,7 @@ class sl {
7812
7812
  const { url: i, targetPoint: n } = this.resolvePointLookupArgs(e, t), s = this.getLevelData(i).slice().sort((g, y) => g.Elevation - y.Elevation);
7813
7813
  if (s.length === 0)
7814
7814
  return null;
7815
- const o = (n instanceof d, n.y), r = s.find((g) => Math.abs(g.Elevation - o) <= il) ?? null;
7815
+ const o = (n instanceof d, n.y), r = s.find((g) => Math.abs(g.Elevation - o) <= tl) ?? null;
7816
7816
  if (r)
7817
7817
  return {
7818
7818
  pointY: o,
@@ -7986,33 +7986,33 @@ class sl {
7986
7986
  };
7987
7987
  }
7988
7988
  }
7989
- const jt = !0, Ti = 0.5, ol = 32, rl = 0.3, Ls = 0.05, al = 0.04, ll = 0.18, cl = 0.01;
7990
- function hl(a) {
7989
+ const jt = !0, Ti = 0.5, sl = 32, ol = 0.3, ks = 0.05, rl = 0.04, al = 0.18, ll = 0.01;
7990
+ function cl(a) {
7991
7991
  return !a?.min || !a?.max ? 0 : a.min.distanceTo(a.max);
7992
7992
  }
7993
- function dl(a, e) {
7993
+ function hl(a, e) {
7994
7994
  return a instanceof d ? a.clone() : e?.min && e?.max ? e.min.clone().add(e.max).multiplyScalar(0.5) : new d();
7995
7995
  }
7996
- function ul(a, e, t) {
7996
+ function dl(a, e, t) {
7997
7997
  if (a instanceof Be)
7998
7998
  return Math.max((a.top - a.bottom) / Math.max(a.zoom, 1e-6), 1);
7999
- const i = a, n = dl(e, t), s = i.position.distanceTo(n), o = typeof i.getEffectiveFOV == "function" ? i.getEffectiveFOV() : i.fov, r = F.degToRad(o * 0.5);
7999
+ const i = a, n = hl(e, t), s = i.position.distanceTo(n), o = typeof i.getEffectiveFOV == "function" ? i.getEffectiveFOV() : i.fov, r = F.degToRad(o * 0.5);
8000
8000
  return Math.max(2 * s * Math.tan(r), 1);
8001
8001
  }
8002
- function pl(a, e, t, i) {
8002
+ function ul(a, e, t, i) {
8003
8003
  if (a == null)
8004
8004
  return i;
8005
- const n = hl(t);
8005
+ const n = cl(t);
8006
8006
  if (n <= 0)
8007
8007
  return i;
8008
- const s = ul(a, e, t), o = Math.max(n * al, 1), r = Math.max(n * ll, o + 1), l = F.clamp(
8008
+ const s = dl(a, e, t), o = Math.max(n * rl, 1), r = Math.max(n * al, o + 1), l = F.clamp(
8009
8009
  (s - o) / (r - o),
8010
8010
  0,
8011
8011
  1
8012
- ), c = Math.max(i * rl, Ls);
8012
+ ), c = Math.max(i * ol, ks);
8013
8013
  return F.lerp(i, c, l);
8014
8014
  }
8015
- class ml {
8015
+ class pl {
8016
8016
  engine;
8017
8017
  isActive = jt;
8018
8018
  groupEdge;
@@ -8123,13 +8123,13 @@ class ml {
8123
8123
  update() {
8124
8124
  if (!this.isActive || !this.material)
8125
8125
  return;
8126
- const e = pl(
8126
+ const e = ul(
8127
8127
  this.engine?.camera,
8128
8128
  this.engine?.controls?.target,
8129
8129
  this.engine?.octreeBox?.getBoundingBox?.(),
8130
8130
  this.baseOpacity
8131
8131
  );
8132
- Math.abs(this.material.opacity - e) <= cl || (this.material.opacity = e, this.material.needsUpdate = !0);
8132
+ Math.abs(this.material.opacity - e) <= ll || (this.material.opacity = e, this.material.needsUpdate = !0);
8133
8133
  }
8134
8134
  hasPendingModelEdges() {
8135
8135
  return (this.engine?.models ?? []).some((t) => this.shouldLoadModelEdge(t) && !Array.isArray(t?.modelEdge));
@@ -8262,7 +8262,7 @@ class ml {
8262
8262
  if (i.ids.forEach((l) => {
8263
8263
  const c = n?.get(Number(l)), h = typeof c == "number" ? this.getEdgePointsByIndex(i.url, c) : null;
8264
8264
  if (Array.isArray(h)) {
8265
- if (h.length > ol)
8265
+ if (h.length > sl)
8266
8266
  return;
8267
8267
  this.appendEdgePositions(s, h);
8268
8268
  }
@@ -8321,7 +8321,7 @@ class ml {
8321
8321
  }
8322
8322
  // 设置边线材质透明度
8323
8323
  setOpacity(e) {
8324
- this.baseOpacity = F.clamp(e, Ls, 1), this.update();
8324
+ this.baseOpacity = F.clamp(e, ks, 1), this.update();
8325
8325
  }
8326
8326
  // 显示边线
8327
8327
  showModelEdge(e, t) {
@@ -8352,7 +8352,7 @@ class ml {
8352
8352
  this.releaseIndexes(e);
8353
8353
  }
8354
8354
  }
8355
- const Tn = {
8355
+ const Pn = {
8356
8356
  turbidity: 10,
8357
8357
  rayleigh: 3,
8358
8358
  mieCoefficient: 5e-3,
@@ -8365,7 +8365,7 @@ const Tn = {
8365
8365
  cloudDensity: 0.4,
8366
8366
  cloudElevation: 0.5,
8367
8367
  showSunDisc: !0
8368
- }, Ii = "sunrise_clear", Bs = 0.2, _i = [
8368
+ }, Ii = "sunrise_clear", Ls = 0.2, _i = [
8369
8369
  {
8370
8370
  id: "sunrise_clear",
8371
8371
  names: ["晴朗日出", "晴朗日出", "Clear Sunrise"],
@@ -8536,17 +8536,17 @@ const Tn = {
8536
8536
  showSunDisc: !1
8537
8537
  }
8538
8538
  }
8539
- ], In = _i.reduce(
8539
+ ], Tn = _i.reduce(
8540
8540
  (a, e) => (a[e.id] = e, a),
8541
8541
  {}
8542
- ), _n = 2e6;
8543
- class gl {
8542
+ ), In = 2e6;
8543
+ class ml {
8544
8544
  engine;
8545
8545
  sky = null;
8546
8546
  sun = new d();
8547
- params = { ...Tn, ...In[Ii].params };
8547
+ params = { ...Pn, ...Tn[Ii].params };
8548
8548
  currentPreset = Ii;
8549
- currentIntensity = Bs;
8549
+ currentIntensity = Ls;
8550
8550
  currentEnvironmentTarget = null;
8551
8551
  skyScale = 45e4;
8552
8552
  skyName = "bim_engine_sky";
@@ -8567,7 +8567,7 @@ class gl {
8567
8567
  this.sky.visible = !0, this._captureSceneState(), this._expandCameraFarForSky(), this._applyParamsToSky();
8568
8568
  return;
8569
8569
  }
8570
- const e = new ao();
8570
+ const e = new ro();
8571
8571
  e.scale.setScalar(this.skyScale), e.name = this.skyName, this.sky = e, this.engine.scene.add(e), this._captureSceneState(), this._expandCameraFarForSky(), this.engine.renderer && (this.engine.renderer.toneMapping = Qi, this.engine.scene.background = null), this._applyParamsToSky();
8572
8572
  }
8573
8573
  close(e = !0) {
@@ -8583,8 +8583,8 @@ class gl {
8583
8583
  Object.assign(this.params, e), this._applyParamsToSky(), this.engine?.renderer && (e.exposure !== void 0 || e.orthoExposureScale !== void 0) && (this.engine.renderer.toneMappingExposure = this._getEffectiveExposure());
8584
8584
  }
8585
8585
  setPreset(e) {
8586
- const t = In[e];
8587
- t && (this.currentPreset = e, this.params = { ...Tn, ...t.params }, this._applyParamsToSky(), this.engine?.renderer && (this.engine.renderer.toneMappingExposure = this._getEffectiveExposure()));
8586
+ const t = Tn[e];
8587
+ t && (this.currentPreset = e, this.params = { ...Pn, ...t.params }, this._applyParamsToSky(), this.engine?.renderer && (this.engine.renderer.toneMappingExposure = this._getEffectiveExposure()));
8588
8588
  }
8589
8589
  getCurrentPreset() {
8590
8590
  return this.currentPreset;
@@ -8628,7 +8628,7 @@ class gl {
8628
8628
  const e = this.engine?.camera;
8629
8629
  if (!e || typeof e.far != "number") return;
8630
8630
  const t = e.far;
8631
- t >= _n || (this.savedCameraFar == null && (this.savedCameraFar = t), e.far = _n, typeof e.updateProjectionMatrix == "function" && e.updateProjectionMatrix());
8631
+ t >= In || (this.savedCameraFar == null && (this.savedCameraFar = t), e.far = In, typeof e.updateProjectionMatrix == "function" && e.updateProjectionMatrix());
8632
8632
  }
8633
8633
  _restoreCameraFar() {
8634
8634
  if (this.savedCameraFar == null || !this.engine?.camera) return;
@@ -8653,7 +8653,7 @@ class gl {
8653
8653
  this._disposeEnvironmentTarget();
8654
8654
  const e = new ki(), t = this.sky.clone();
8655
8655
  t.material = this.sky.material.clone(), e.add(t);
8656
- const i = new Zn(this.engine.renderer);
8656
+ const i = new $n(this.engine.renderer);
8657
8657
  this.currentEnvironmentTarget = i.fromScene(e, 0, 0.1, this.skyScale * 2), i.dispose(), this.engine.scene.background = null, this.engine.scene.environment = this.currentEnvironmentTarget.texture, this.engine.scene.environmentIntensity = this.currentIntensity, t.material.dispose();
8658
8658
  }
8659
8659
  _disposeEnvironmentTarget() {
@@ -8664,7 +8664,7 @@ class gl {
8664
8664
  n && (i instanceof d && typeof n.value?.copy == "function" ? n.value.copy(i) : n.value = i);
8665
8665
  }
8666
8666
  }
8667
- class fl {
8667
+ class gl {
8668
8668
  /** 寮曟搸瀹炰緥寮曠敤 */
8669
8669
  engine;
8670
8670
  defaultSettings;
@@ -8796,28 +8796,28 @@ class fl {
8796
8796
  return {
8797
8797
  render: {
8798
8798
  mode: this._toRenderMode(this.engine.engineModelModule?.getCurrentMode?.()),
8799
- contrast: this._uniformToPercent(t, ls),
8800
- saturation: this._uniformToPercent(e, as),
8799
+ contrast: this._uniformToPercent(t, as),
8800
+ saturation: this._uniformToPercent(e, rs),
8801
8801
  shadowIntensity: this._shadowToPercent(this._getDirectionalLightShadowIntensity(), bt),
8802
8802
  lightIntensity: this._exposureToPercent(n, Fi),
8803
- gtaoIntensity: this._unitToPercent(i, rs)
8803
+ gtaoIntensity: this._unitToPercent(i, os)
8804
8804
  },
8805
8805
  display: {
8806
8806
  showEdge: this.engine.modelEdge?.isEnabled?.() ?? jt,
8807
8807
  edgeOpacity: this._unitToPercent(s, Ti),
8808
8808
  showGrid: this.engine.grid?.getVisible?.() ?? Pi,
8809
- showLevel: this.engine.level?.getVisible?.() ?? ks,
8810
- showGround: this.engine.ground?.getVisible?.() ?? _s,
8811
- groundId: this.engine.ground?.getCurrentId?.() ?? Ts,
8812
- groundHeight: this.engine.ground?.getHeight?.() ?? Is
8809
+ showLevel: this.engine.level?.getVisible?.() ?? Ds,
8810
+ showGround: this.engine.ground?.getVisible?.() ?? Is,
8811
+ groundId: this.engine.ground?.getCurrentId?.() ?? Ps,
8812
+ groundHeight: this.engine.ground?.getHeight?.() ?? Ts
8813
8813
  },
8814
8814
  environment: {
8815
8815
  type: h ? "sky" : o !== Ue ? "hdr" : "none",
8816
8816
  hdrId: o,
8817
- hdrIntensity: this._unitToPercent(r, Ds),
8817
+ hdrIntensity: this._unitToPercent(r, _s),
8818
8818
  skyPreset: c,
8819
8819
  skyParams: {},
8820
- skyIntensity: this._unitToPercent(l, Bs)
8820
+ skyIntensity: this._unitToPercent(l, Ls)
8821
8821
  }
8822
8822
  };
8823
8823
  }
@@ -8852,7 +8852,7 @@ class fl {
8852
8852
  };
8853
8853
  }
8854
8854
  _toRenderMode(e) {
8855
- return e === "simple" || e === "balance" || e === "advanced" ? e : Ps;
8855
+ return e === "simple" || e === "balance" || e === "advanced" ? e : Ss;
8856
8856
  }
8857
8857
  _uniformToPercent(e, t) {
8858
8858
  const i = typeof e == "number" ? e : t;
@@ -9201,7 +9201,7 @@ class qe {
9201
9201
  }
9202
9202
  }
9203
9203
  }
9204
- class yl {
9204
+ class fl {
9205
9205
  engine;
9206
9206
  isActive = !1;
9207
9207
  tools;
@@ -9305,7 +9305,7 @@ class yl {
9305
9305
  }
9306
9306
  }
9307
9307
  }
9308
- class Ml {
9308
+ class yl {
9309
9309
  engine;
9310
9310
  tools;
9311
9311
  isActive = !1;
@@ -9361,7 +9361,7 @@ class Ml {
9361
9361
  }
9362
9362
  // 按下esc
9363
9363
  }
9364
- class vl {
9364
+ class Ml {
9365
9365
  engine;
9366
9366
  isActive = !1;
9367
9367
  tools;
@@ -9416,7 +9416,7 @@ class vl {
9416
9416
  t.point1 = s.point, t.point2 = n[0].point, t.text = t.point1.clone().distanceTo(t.point2.clone()), this.engine.events.trigger(se.MeasureChanged, t);
9417
9417
  }
9418
9418
  }
9419
- class xl {
9419
+ class vl {
9420
9420
  engine;
9421
9421
  isActive = !1;
9422
9422
  tools;
@@ -9461,7 +9461,7 @@ class xl {
9461
9461
  t.point = e.catch.point.clone(), t.text = e.catch.point.y, t.isSelect = !1, this.engine.events.trigger(se.MeasureChanged, t);
9462
9462
  }
9463
9463
  }
9464
- class wl {
9464
+ class xl {
9465
9465
  engine;
9466
9466
  isActive = !1;
9467
9467
  tools;
@@ -9513,7 +9513,7 @@ class wl {
9513
9513
  e != null && (e.isSelect = !1, this.engine.events.trigger(se.MeasureChanged, e));
9514
9514
  }
9515
9515
  }
9516
- class bl {
9516
+ class wl {
9517
9517
  engine;
9518
9518
  tools;
9519
9519
  // 存储三个点:起点、顶点(中间点)、终点
@@ -9581,7 +9581,7 @@ class bl {
9581
9581
  }
9582
9582
  }
9583
9583
  }
9584
- class Cl {
9584
+ class bl {
9585
9585
  engine;
9586
9586
  tools;
9587
9587
  points = [];
@@ -9808,7 +9808,7 @@ class Ct {
9808
9808
  }
9809
9809
  }
9810
9810
  }
9811
- class El {
9811
+ class Cl {
9812
9812
  engine;
9813
9813
  isActive = !1;
9814
9814
  points = [];
@@ -9889,7 +9889,7 @@ class El {
9889
9889
  };
9890
9890
  }
9891
9891
  }
9892
- class Al {
9892
+ class El {
9893
9893
  isActive = !1;
9894
9894
  engine;
9895
9895
  clearHeightMeasure;
@@ -9915,7 +9915,7 @@ class Al {
9915
9915
  volumeAnnotation: []
9916
9916
  };
9917
9917
  constructor(e) {
9918
- this.engine = e, this.clearHeightMeasure = new yl(e), this.distanceMeasure = new Ml(e), this.clearDistanceMeasure = new vl(e), this.elevationMeasure = new xl(e), this.pointMeasure = new wl(e), this.angleMeasure = new bl(e), this.areaMeasure = new Cl(e), this.slopeMeasure = new Ct(e), this.faceDistanceMeasure = new El(e), this.tools = new qe(e), this.annotationContainer = document.createElement("div"), this.annotationContainer.className = "annotation-container", e.container.appendChild(this.annotationContainer);
9918
+ this.engine = e, this.clearHeightMeasure = new fl(e), this.distanceMeasure = new yl(e), this.clearDistanceMeasure = new Ml(e), this.elevationMeasure = new vl(e), this.pointMeasure = new xl(e), this.angleMeasure = new wl(e), this.areaMeasure = new bl(e), this.slopeMeasure = new Ct(e), this.faceDistanceMeasure = new Cl(e), this.tools = new qe(e), this.annotationContainer = document.createElement("div"), this.annotationContainer.className = "annotation-container", e.container.appendChild(this.annotationContainer);
9919
9919
  }
9920
9920
  setContextMenuDisabled(e) {
9921
9921
  this.engine?.engineStatus != null && (this.engine.engineStatus.isDisableContextMenu = e);
@@ -9963,7 +9963,7 @@ class Al {
9963
9963
  this.engine.setIdleFrameRateExempt?.("measure", !1), this.setContextMenuDisabled(!1), this.tools.disActive(), this.clearHeightMeasure.disActive(), this.distanceMeasure.disActive(), this.clearDistanceMeasure.disActive(), this.elevationMeasure.disActive(), this.pointMeasure.disActive(), this.angleMeasure.disActive(), this.areaMeasure.disActive(), this.slopeMeasure.disActive(), this.faceDistanceMeasure.disActive(), this.clearAll(), this.annotationContainer.remove(), this.isActive = !1;
9964
9964
  }
9965
9965
  }
9966
- class Sl {
9966
+ class Al {
9967
9967
  engine;
9968
9968
  isActive = !1;
9969
9969
  isCtrlDown = !1;
@@ -10482,7 +10482,7 @@ class Sl {
10482
10482
  x && x.setFromNormalAndCoplanarPoint(i.clone().setLength(-1), o);
10483
10483
  }
10484
10484
  }
10485
- class Pl {
10485
+ class Sl {
10486
10486
  engine;
10487
10487
  isActive = !1;
10488
10488
  isDrag = !1;
@@ -11037,7 +11037,7 @@ class Pl {
11037
11037
  }
11038
11038
  }
11039
11039
  }
11040
- class Tl {
11040
+ class Pl {
11041
11041
  engine;
11042
11042
  callback_;
11043
11043
  isActive;
@@ -11068,7 +11068,7 @@ class Tl {
11068
11068
  });
11069
11069
  }
11070
11070
  }
11071
- class Il {
11071
+ class Tl {
11072
11072
  /** 引擎实例(包含 scene / models / engineStatus / octreeBox 等) */
11073
11073
  engine;
11074
11074
  /** three-bvh-csg 计算器,负责执行布尔操作 */
@@ -11090,7 +11090,7 @@ class Il {
11090
11090
  fillTextureRepeat = 60;
11091
11091
  fillTextureRotation = 0;
11092
11092
  constructor(e) {
11093
- this.engine = e, this.evaluator = new lo();
11093
+ this.engine = e, this.evaluator = new ao();
11094
11094
  const t = ee("/texture/fill.png", import.meta.url), i = new nt().load(t);
11095
11095
  i.wrapS = pt, i.wrapT = pt, i.center.set(0.5, 0.5), i.rotation = this.fillTextureRotation, this.fillMaterial = new Ri({
11096
11096
  color: 14079687,
@@ -11156,7 +11156,7 @@ class Il {
11156
11156
  const x = this.createWorldBrushFromMesh(M);
11157
11157
  if (x != null)
11158
11158
  try {
11159
- const b = this.evaluator.evaluate(x, c, co)?.geometry;
11159
+ const b = this.evaluator.evaluate(x, c, lo)?.geometry;
11160
11160
  if (!b)
11161
11161
  continue;
11162
11162
  const C = this.extractPlaneCapGeometry(b, e, l);
@@ -11384,7 +11384,7 @@ class Il {
11384
11384
  return { tangent: l, bitangent: c };
11385
11385
  }
11386
11386
  }
11387
- class _l {
11387
+ class Il {
11388
11388
  engine;
11389
11389
  clippingTolerance = 1e-4;
11390
11390
  sectionBox;
@@ -11396,7 +11396,7 @@ class _l {
11396
11396
  fillCutFace = !0;
11397
11397
  viewRangePlanes = null;
11398
11398
  constructor(e) {
11399
- this.engine = e, this.sectionCatchFace = new Tl(this.engine);
11399
+ this.engine = e, this.sectionCatchFace = new Pl(this.engine);
11400
11400
  let t = new Z(new d(0, 0, 1), 1e5);
11401
11401
  t.name = "前";
11402
11402
  let i = new Z(new d(0, 0, 1), 1e5);
@@ -11413,7 +11413,7 @@ class _l {
11413
11413
  l.name = "face", this.engine.sectionPlane = [t, i, n, s, o, r, l];
11414
11414
  }
11415
11415
  init() {
11416
- this.sectionBox = new Sl(this.engine), this.sectionFace = new Pl(this.engine), this.clippingCSGSimple = new Il(this.engine);
11416
+ this.sectionBox = new Al(this.engine), this.sectionFace = new Sl(this.engine), this.clippingCSGSimple = new Tl(this.engine);
11417
11417
  }
11418
11418
  // 自动缩放适用的视图比例
11419
11419
  scaleBox() {
@@ -11620,7 +11620,7 @@ class _l {
11620
11620
  });
11621
11621
  }
11622
11622
  }
11623
- class Dl {
11623
+ class _l {
11624
11624
  engine;
11625
11625
  constructor(e) {
11626
11626
  this.engine = e;
@@ -11659,7 +11659,7 @@ class Dl {
11659
11659
  }), e;
11660
11660
  }
11661
11661
  }
11662
- class kl {
11662
+ class Dl {
11663
11663
  engine;
11664
11664
  constructor(e) {
11665
11665
  this.engine = e;
@@ -11697,7 +11697,7 @@ class kl {
11697
11697
  });
11698
11698
  }
11699
11699
  }
11700
- class Ll {
11700
+ class kl {
11701
11701
  engine;
11702
11702
  // 扩展属性
11703
11703
  extended‌ = /* @__PURE__ */ new Map();
@@ -11823,8 +11823,8 @@ class Ll {
11823
11823
  }
11824
11824
  }
11825
11825
  }
11826
- const Bl = '<svg width="18" height="18" viewBox="0 0 24 24" fill="none" aria-hidden="true"><circle cx="10.8" cy="10.8" r="6.5" stroke="currentColor" stroke-width="2"/><path d="m16 16 4.3 4.3" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>';
11827
- class zl {
11826
+ const Ll = '<svg width="18" height="18" viewBox="0 0 24 24" fill="none" aria-hidden="true"><circle cx="10.8" cy="10.8" r="6.5" stroke="currentColor" stroke-width="2"/><path d="m16 16 4.3 4.3" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>';
11827
+ class Bl {
11828
11828
  manager;
11829
11829
  wrapper;
11830
11830
  input;
@@ -11840,7 +11840,7 @@ class zl {
11840
11840
  this.manager = t, this.wrapper = document.createElement("div"), this.wrapper.className = "engine-3d-search", this.wrapper.innerHTML = `
11841
11841
  <section class="engine-3d-search__box" role="dialog" aria-label="模型检索">
11842
11842
  <div class="engine-3d-search__input-row">
11843
- <span class="engine-3d-search__icon">${Bl}</span>
11843
+ <span class="engine-3d-search__icon">${Ll}</span>
11844
11844
  <input class="engine-3d-search__input" type="search" placeholder="检索模型名称、构件 ID、房间" autocomplete="off" spellcheck="false" />
11845
11845
  <button class="engine-3d-search__clear" type="button" aria-label="关闭检索框">×</button>
11846
11846
  </div>
@@ -11943,13 +11943,13 @@ class zl {
11943
11943
  this.input.removeEventListener("input", this.onInput), this.input.removeEventListener("keydown", this.onKeyDown), this.wrapper.querySelector(".engine-3d-search__clear")?.removeEventListener("click", this.onCloseClick), this.pagination.removeEventListener("click", this.onPageClick), document.removeEventListener("mousedown", this.onDocumentMouseDown), document.removeEventListener("keydown", this.onDocumentKeyDown), this.debounceTimer !== null && clearTimeout(this.debounceTimer), this.wrapper.remove();
11944
11944
  }
11945
11945
  }
11946
- class Rl {
11946
+ class zl {
11947
11947
  engine;
11948
11948
  searchUI = null;
11949
11949
  constructor(e) {
11950
11950
  this.engine = e;
11951
11951
  const t = e?.container;
11952
- t && (this.searchUI = new zl(t, this), this.setTheme(e?.options?.searchTheme === "light" ? "light" : "dark"));
11952
+ t && (this.searchUI = new Bl(t, this), this.setTheme(e?.options?.searchTheme === "light" ? "light" : "dark"));
11953
11953
  }
11954
11954
  /** 按名称、ID、房间名称/编号检索已加载模型。 */
11955
11955
  search(e, t = {}) {
@@ -12087,7 +12087,7 @@ class Rl {
12087
12087
  return s < 0 ? null : (s === 0 ? 1e3 : 500) - s - Math.max(0, n.length - t.length) * 0.01;
12088
12088
  }
12089
12089
  }
12090
- class Ol {
12090
+ class Rl {
12091
12091
  engine;
12092
12092
  constructor(e) {
12093
12093
  this.engine = e;
@@ -12180,14 +12180,14 @@ class Ol {
12180
12180
  }), t && t(i), i;
12181
12181
  }
12182
12182
  }
12183
- const Dn = !1, Fl = 51283, Nl = 2718207;
12184
- class Hl {
12183
+ const _n = !1, Ol = 51283, Fl = 2718207;
12184
+ class Nl {
12185
12185
  engine;
12186
12186
  rootGroup;
12187
12187
  meshMaterial;
12188
12188
  instanceMaterial;
12189
12189
  handleLoadingCompleted;
12190
- isVisible = Dn;
12190
+ isVisible = _n;
12191
12191
  filterState = {
12192
12192
  urls: null,
12193
12193
  ids: null,
@@ -12195,7 +12195,7 @@ class Hl {
12195
12195
  showInstance: !0
12196
12196
  };
12197
12197
  constructor(e) {
12198
- this.engine = e, this.rootGroup = new pe(), this.rootGroup.name = "nodeBoxGroup", this.rootGroup.visible = Dn, this.engine.scene?.add(this.rootGroup), this.meshMaterial = this.createMaterial(Fl), this.instanceMaterial = this.createMaterial(Nl), this.handleLoadingCompleted = () => {
12198
+ this.engine = e, this.rootGroup = new pe(), this.rootGroup.name = "nodeBoxGroup", this.rootGroup.visible = _n, this.engine.scene?.add(this.rootGroup), this.meshMaterial = this.createMaterial(Ol), this.instanceMaterial = this.createMaterial(Fl), this.handleLoadingCompleted = () => {
12199
12199
  this.isVisible && this.rebuild();
12200
12200
  }, this.engine.events?.on?.(ne.LoadingCompleted, this.handleLoadingCompleted);
12201
12201
  }
@@ -12326,8 +12326,8 @@ class Hl {
12326
12326
  e.matrixAutoUpdate = !1, e.matrix.copy(t), e.matrixWorldNeedsUpdate = !0, e.updateMatrixWorld(!0);
12327
12327
  }
12328
12328
  }
12329
- const Vl = "path-roaming-animation", Ul = 8e3, Wl = 100, Vt = 16;
12330
- class Gl {
12329
+ const Hl = "path-roaming-animation", Vl = 8e3, Ul = 100, Vt = 16;
12330
+ class Wl {
12331
12331
  engine;
12332
12332
  points = [];
12333
12333
  status = "idle";
@@ -12677,7 +12677,7 @@ class Gl {
12677
12677
  const t = e.loopMode ?? (e.loop ? "repeat" : "none");
12678
12678
  return {
12679
12679
  ...e,
12680
- duration: this.toPositiveNumber(e.duration, Ul),
12680
+ duration: this.toPositiveNumber(e.duration, Vl),
12681
12681
  playbackRate: this.toPositiveNumber(e.playbackRate, 1),
12682
12682
  timing: "distance",
12683
12683
  positionInterpolation: "linear",
@@ -12687,7 +12687,7 @@ class Gl {
12687
12687
  loopMode: t,
12688
12688
  loopCount: e.loopCount === void 0 ? Number.POSITIVE_INFINITY : Math.max(Math.floor(this.toNonNegativeNumber(e.loopCount, 0)), 0),
12689
12689
  direction: e.direction ?? "forward",
12690
- maxFrameDelta: this.toPositiveNumber(e.maxFrameDelta, Wl)
12690
+ maxFrameDelta: this.toPositiveNumber(e.maxFrameDelta, Ul)
12691
12691
  };
12692
12692
  }
12693
12693
  /** 规范化外部关键帧,并以四元数作为旋转的权威数据。 */
@@ -12781,7 +12781,7 @@ class Gl {
12781
12781
  }
12782
12782
  /** 播放期间解除引擎空闲限帧。 */
12783
12783
  setFrameRateExempt(e) {
12784
- this.engine.setIdleFrameRateExempt?.(Vl, e);
12784
+ this.engine.setIdleFrameRateExempt?.(Hl, e);
12785
12785
  }
12786
12786
  isValidPointIndex(e) {
12787
12787
  return Number.isInteger(e) && e >= 0 && e < this.points.length;
@@ -12842,7 +12842,7 @@ class Gl {
12842
12842
  return { x: e.x, y: e.y, z: e.z, w: e.w };
12843
12843
  }
12844
12844
  }
12845
- class ql {
12845
+ class Gl {
12846
12846
  engine;
12847
12847
  miniMapCamera = null;
12848
12848
  miniMapRenderer = null;
@@ -13244,7 +13244,7 @@ class ql {
13244
13244
  p.rotateYaw(-c);
13245
13245
  return;
13246
13246
  }
13247
- const g = i.getWorldDirection(new d()).multiplyScalar(h), y = new ho().setFromVector3(g);
13247
+ const g = i.getWorldDirection(new d()).multiplyScalar(h), y = new co().setFromVector3(g);
13248
13248
  y.theta -= c, g.setFromSpherical(y), n.target?.copy(i.position).add(g), n.update?.(), this.engine.controlModule?.firstPersonControls?.syncRotationStateFromCamera?.();
13249
13249
  }
13250
13250
  drawOverlay() {
@@ -13303,7 +13303,7 @@ class ql {
13303
13303
  this.miniMapContainer && (this.miniMapContainer.removeEventListener("wheel", this.onWheel), this.miniMapContainer.removeEventListener("mousedown", this.onMouseDown), this.miniMapContainer.removeEventListener("mousemove", this.onMouseMove), this.miniMapContainer.removeEventListener("mouseup", this.onMouseUp), this.miniMapContainer.removeEventListener("pointerdown", this.onMouseDown), this.miniMapContainer.removeEventListener("pointermove", this.onMouseMove), this.miniMapContainer.removeEventListener("pointerup", this.onMouseUp), this.miniMapContainer.removeEventListener("pointercancel", this.onMouseUp), this.miniMapContainer.removeEventListener("mouseenter", this.onMouseEnter), this.miniMapContainer.removeEventListener("mouseleave", this.onMouseLeave)), window.removeEventListener("mousemove", this.onMouseMove), window.removeEventListener("mouseup", this.onMouseUp), window.removeEventListener("pointermove", this.onMouseMove), window.removeEventListener("pointerup", this.onMouseUp), window.removeEventListener("pointercancel", this.onMouseUp), window.removeEventListener("resize", this.onWindowResize), this.sizeToggleButton?.removeEventListener("click", this.onSizeToggleClick), this.resizeHandle?.removeEventListener("mousedown", this.onResizeHandleMouseDown), this.resizeHandle?.removeEventListener("pointerdown", this.onResizeHandleMouseDown), this.modelSelect?.removeEventListener("change", this.onModelChange), this.levelSelect?.removeEventListener("change", this.onLevelChange), this.engine.events?.off?.(this.loadingCompletedEventName, this.onLoadingCompleted), this.miniMapRenderer && (this.miniMapRenderer.dispose(), this.miniMapRenderer = null), this.miniMapContainer && (this.miniMapContainer.remove(), this.miniMapContainer = null), this.miniMapCamera = null, this.overlayCtx = null, this.overlayCanvas = null, this.levelToolbar = null, this.sizeToggleButton = null, this.resizeHandle = null, this.modelSelect = null, this.levelSelect = null, this.levelModels = [], this.levelDataSignature = "", this.selectedModelUrl = null;
13304
13304
  }
13305
13305
  }
13306
- class Kl {
13306
+ class ql {
13307
13307
  engine;
13308
13308
  constructor(e) {
13309
13309
  this.engine = e;
@@ -13600,26 +13600,26 @@ class Kl {
13600
13600
  return Math.abs(s.dot(e)) < 0.999 ? s : new d(1, 0, 0);
13601
13601
  }
13602
13602
  }
13603
- class jl {
13603
+ class Kl {
13604
13604
  engine;
13605
13605
  constructor(e) {
13606
13606
  }
13607
13607
  update() {
13608
13608
  }
13609
13609
  }
13610
- const kn = "bim-engine:link-element-2d3d-state", Ln = "link-element-2d3d";
13611
- class Yl {
13610
+ const Dn = "bim-engine:link-element-2d3d-state", kn = "link-element-2d3d";
13611
+ class jl {
13612
13612
  engine;
13613
13613
  constructor(e) {
13614
13614
  this.engine = e, this.active();
13615
13615
  }
13616
13616
  // 激活
13617
13617
  active() {
13618
- window.addEventListener("D2ElementClick", this.listenElementClick), window.addEventListener(kn, this.listenLinkStateChange);
13618
+ window.addEventListener("D2ElementClick", this.listenElementClick), window.addEventListener(Dn, this.listenLinkStateChange);
13619
13619
  }
13620
13620
  // 取消
13621
13621
  disActive() {
13622
- window.removeEventListener("D2ElementClick", this.listenElementClick), window.removeEventListener(kn, this.listenLinkStateChange), this.engine?.setIdleFrameRateExempt?.(Ln, !1);
13622
+ window.removeEventListener("D2ElementClick", this.listenElementClick), window.removeEventListener(Dn, this.listenLinkStateChange), this.engine?.setIdleFrameRateExempt?.(kn, !1);
13623
13623
  }
13624
13624
  dispose() {
13625
13625
  this.disActive();
@@ -13639,10 +13639,10 @@ class Yl {
13639
13639
  /** 二三维模型联动开启时保持 3D 引擎全帧渲染,避免等待空闲限帧间隔。 */
13640
13640
  listenLinkStateChange = (e) => {
13641
13641
  const t = e.detail?.enabled === !0;
13642
- this.engine?.setIdleFrameRateExempt?.(Ln, t);
13642
+ this.engine?.setIdleFrameRateExempt?.(kn, t);
13643
13643
  };
13644
13644
  }
13645
- class Xl {
13645
+ class Yl {
13646
13646
  engine;
13647
13647
  constructor(e) {
13648
13648
  this.engine = e, this.active();
@@ -13696,7 +13696,7 @@ const ht = {
13696
13696
  EncodingComplete: "encoding-complete",
13697
13697
  EncodingError: "encoding-error"
13698
13698
  };
13699
- class Ql {
13699
+ class Xl {
13700
13700
  engine;
13701
13701
  apiKey;
13702
13702
  baseURL = "https://api.deepseek.com";
@@ -13884,12 +13884,12 @@ class Ql {
13884
13884
  }
13885
13885
  }
13886
13886
  }
13887
- const fi = 1 / 0.3048, $l = 1, Zl = 1.8, Bn = /* @__PURE__ */ new Set([
13887
+ const fi = 1 / 0.3048, Ql = 1, $l = 1.8, Ln = /* @__PURE__ */ new Set([
13888
13888
  "dynamic-elevation-bar-area",
13889
13889
  "dynamic-elevation-guest-area",
13890
13890
  "dynamic-elevation-door-head-area"
13891
- ]), Jl = ["台面"], ec = ["咖啡机"], tc = ["门店编号"], ic = ["发光logo", "发光Logo"];
13892
- class nc {
13891
+ ]), Zl = ["台面"], Jl = ["咖啡机"], ec = ["门店编号"], tc = ["发光logo", "发光Logo"];
13892
+ class ic {
13893
13893
  engine;
13894
13894
  constructor(e) {
13895
13895
  this.engine = e;
@@ -13903,10 +13903,10 @@ class nc {
13903
13903
  return null;
13904
13904
  const t = e.views ?? {}, i = (t.Elevations ?? []).filter((o) => {
13905
13905
  const r = o?.Id ?? o?.id;
13906
- return !Bn.has(String(r ?? ""));
13906
+ return !Ln.has(String(r ?? ""));
13907
13907
  }), n = (t.DynamicViews ?? []).filter((o) => {
13908
13908
  const r = o?.Id ?? o?.id, l = String(r ?? "");
13909
- return !Bn.has(l) && !l.startsWith("dynamic-elevation-door-head-area");
13909
+ return !Ln.has(l) && !l.startsWith("dynamic-elevation-door-head-area");
13910
13910
  }), s = this.generate(e);
13911
13911
  return e.views = {
13912
13912
  ...t,
@@ -13923,7 +13923,7 @@ class nc {
13923
13923
  generate(e) {
13924
13924
  if (!(e?.nodesMap instanceof Map) || e.nodesMap.size === 0)
13925
13925
  return [];
13926
- const t = this.collectMergedWorldBoxByKeywords(e, Jl), i = this.collectMergedWorldBoxByKeywords(e, ec), n = this.collectMergedWorldBoxByKeywords(e, tc), s = this.collectWorldBoxesByKeywords(e, ic), o = [];
13926
+ const t = this.collectMergedWorldBoxByKeywords(e, Zl), i = this.collectMergedWorldBoxByKeywords(e, Jl), n = this.collectMergedWorldBoxByKeywords(e, ec), s = this.collectWorldBoxesByKeywords(e, tc), o = [];
13927
13927
  if (t && i && n) {
13928
13928
  const r = this.createBarAreaView(t, i, n), l = this.createGuestAreaView(t, i, n);
13929
13929
  r && o.push(r), l && o.push(l);
@@ -14014,8 +14014,8 @@ class nc {
14014
14014
  * 相机始终在观察面外侧偏移固定距离,且高度统一锁定为 1.8 米。
14015
14015
  */
14016
14016
  createCameraPosition(e, t) {
14017
- const i = e.clone().add(t.clone().multiplyScalar($l));
14018
- return i.y = Zl, i;
14017
+ const i = e.clone().add(t.clone().multiplyScalar(Ql));
14018
+ return i.y = $l, i;
14019
14019
  }
14020
14020
  /**
14021
14021
  * 将 three.js 空间中的观察参数转换成运行时立面视图结构。
@@ -14190,8 +14190,8 @@ class nc {
14190
14190
  };
14191
14191
  }
14192
14192
  }
14193
- const zn = 16, Rn = 0.02, yi = 1e-6, sc = 600;
14194
- function zs() {
14193
+ const Bn = 16, zn = 0.02, yi = 1e-6, nc = 600;
14194
+ function Bs() {
14195
14195
  return {
14196
14196
  ceilingPlans: [],
14197
14197
  elevations: [],
@@ -14200,14 +14200,14 @@ function zs() {
14200
14200
  sections: []
14201
14201
  };
14202
14202
  }
14203
- function Rs(a, e) {
14203
+ function zs(a, e) {
14204
14204
  return {
14205
14205
  id: a.Id ?? a.id,
14206
14206
  name: a.Name ?? a.name,
14207
14207
  url: e
14208
14208
  };
14209
14209
  }
14210
- class oc {
14210
+ class sc {
14211
14211
  engine;
14212
14212
  resolveViewTree;
14213
14213
  openView;
@@ -14217,7 +14217,7 @@ class oc {
14217
14217
  }
14218
14218
  /** 获取构件可见的动态视图,并可选择直接打开第一个匹配项。 */
14219
14219
  getElementVisibleViews(e, t, i = !1) {
14220
- const n = zs(), s = this.engine.models.find((p) => p.url === e);
14220
+ const n = Bs(), s = this.engine.models.find((p) => p.url === e);
14221
14221
  if (!s)
14222
14222
  return n;
14223
14223
  const o = this.findModelNode(s, t), r = this.getNodeWorldBox(s, o), l = this.resolveViewTree(e);
@@ -14230,7 +14230,7 @@ class oc {
14230
14230
  h = p.length > 0 ? p : [this.getNearestCameraCandidate(c, r)];
14231
14231
  }
14232
14232
  h.forEach((p) => {
14233
- n.dynamicViews.push(Rs(p.view, e));
14233
+ n.dynamicViews.push(zs(p.view, e));
14234
14234
  });
14235
14235
  const u = n.dynamicViews[0];
14236
14236
  return i && u ? this.openView(u.url, u.id, () => {
@@ -14290,14 +14290,14 @@ class oc {
14290
14290
  t.projectionMatrix,
14291
14291
  t.matrixWorldInverse
14292
14292
  );
14293
- if (new uo().setFromProjectionMatrix(i).intersectsBox(e))
14293
+ if (new ho().setFromProjectionMatrix(i).intersectsBox(e))
14294
14294
  return;
14295
14295
  const s = e.getCenter(new d()), o = this.engine.cameraModule?.rotateToTarget;
14296
14296
  if (typeof o == "function") {
14297
14297
  o.call(
14298
14298
  this.engine.cameraModule,
14299
14299
  s,
14300
- sc,
14300
+ nc,
14301
14301
  () => this.syncControlRotationState()
14302
14302
  );
14303
14303
  return;
@@ -14320,13 +14320,13 @@ class oc {
14320
14320
  */
14321
14321
  createElementSamplePoints(e, t, i, n) {
14322
14322
  const s = this.collectSampleSources(e, t), o = [];
14323
- for (let r = 0; r < zn && s.length > 0; r++) {
14323
+ for (let r = 0; r < Bn && s.length > 0; r++) {
14324
14324
  const l = s[r % s.length], c = this.sampleGeometrySurface(l, n);
14325
14325
  c && o.push(c);
14326
14326
  }
14327
14327
  if (o.length > 0)
14328
14328
  return o;
14329
- for (o.push(i.getCenter(new d())); o.length < zn; )
14329
+ for (o.push(i.getCenter(new d())); o.length < Bn; )
14330
14330
  o.push(new d(
14331
14331
  F.lerp(i.min.x, i.max.x, n()),
14332
14332
  F.lerp(i.min.y, i.max.y, n()),
@@ -14373,9 +14373,9 @@ class oc {
14373
14373
  if (typeof s != "function")
14374
14374
  return !1;
14375
14375
  const o = t.clone().sub(e), r = o.length();
14376
- if (r <= Rn)
14376
+ if (r <= zn)
14377
14377
  return !0;
14378
- this.raycaster.near = 0, this.raycaster.far = r + Rn, this.raycaster.set(e, o.normalize());
14378
+ this.raycaster.near = 0, this.raycaster.far = r + zn, this.raycaster.set(e, o.normalize());
14379
14379
  const c = (s.call(
14380
14380
  this.engine.octreeBox,
14381
14381
  this.raycaster,
@@ -14420,12 +14420,12 @@ const Ut = {
14420
14420
  floorPlan: "楼层平面",
14421
14421
  elevation: "立面视图",
14422
14422
  section: "剖面视图"
14423
- }, rc = {
14423
+ }, oc = {
14424
14424
  ceilingPlan: [Ut.ceilingPlan, "天花"],
14425
14425
  floorPlan: [Ut.floorPlan, "楼层"],
14426
14426
  elevation: [Ut.elevation, "立面"],
14427
14427
  section: [Ut.section, "剖面"]
14428
- }, ac = [
14428
+ }, rc = [
14429
14429
  ["CeilingPlans", "ceilingPlans"],
14430
14430
  ["Elevations", "elevations"],
14431
14431
  ["DynamicViews", "dynamicViews"],
@@ -14439,7 +14439,7 @@ class Ki {
14439
14439
  dynamicViewVisibility;
14440
14440
  /** 管理模型原生视图与运行时动态视图的统一入口。 */
14441
14441
  constructor(e) {
14442
- this.engine = e, this.dynamicElevationViewGenerator = new nc(e), this.dynamicViewVisibility = new oc(
14442
+ this.engine = e, this.dynamicElevationViewGenerator = new ic(e), this.dynamicViewVisibility = new sc(
14443
14443
  e,
14444
14444
  (t) => this.getResolvedViewTree(t),
14445
14445
  (t, i, n) => this.openViewInternal(t, i, n)
@@ -14458,10 +14458,10 @@ class Ki {
14458
14458
  }
14459
14459
  /** 获取单个模型的视图树数据,并补充运行时生成的动态视图分类。 */
14460
14460
  getViewTreeData(e) {
14461
- const t = this.getResolvedViewTree(e), i = zs();
14462
- return t && ac.forEach(([n, s]) => {
14461
+ const t = this.getResolvedViewTree(e), i = Bs();
14462
+ return t && rc.forEach(([n, s]) => {
14463
14463
  (t[n] ?? []).forEach((o) => {
14464
- i[s].push(Rs(o, e));
14464
+ i[s].push(zs(o, e));
14465
14465
  });
14466
14466
  }), i;
14467
14467
  }
@@ -14574,7 +14574,7 @@ class Ki {
14574
14574
  const t = String(e ?? "").replace(/\s+/g, "");
14575
14575
  if (!t)
14576
14576
  return "unknown";
14577
- const i = Object.entries(rc);
14577
+ const i = Object.entries(oc);
14578
14578
  for (const [n, s] of i)
14579
14579
  if (s.some((o) => t.includes(o)))
14580
14580
  return n;
@@ -14611,7 +14611,7 @@ class Ki {
14611
14611
  !t || t.isEmpty?.() || this.engine.viewCube?.zoomToModel?.(t, e);
14612
14612
  }
14613
14613
  }
14614
- class lc {
14614
+ class ac {
14615
14615
  constructor(e) {
14616
14616
  }
14617
14617
  /** 3D 独立包不支持加载 2D 视图。 */
@@ -14622,16 +14622,16 @@ class lc {
14622
14622
  removeSectionPlane() {
14623
14623
  }
14624
14624
  }
14625
- function cc(a, e, t = "bim-snapshot.png") {
14625
+ function lc(a, e, t = "bim-snapshot.png") {
14626
14626
  const i = a?.renderer, n = i?.domElement;
14627
14627
  if (!i || !n || !e)
14628
14628
  return null;
14629
14629
  const s = n.width || n.clientWidth, o = n.height || n.clientHeight;
14630
14630
  if (s <= 0 || o <= 0)
14631
14631
  return null;
14632
- let r = hc(n, s, o);
14633
- if (!dc(r)) {
14634
- const p = uc(a, s, o);
14632
+ let r = cc(n, s, o);
14633
+ if (!hc(r)) {
14634
+ const p = dc(a, s, o);
14635
14635
  p && (r = p);
14636
14636
  }
14637
14637
  const l = document.createElement("canvas");
@@ -14643,13 +14643,13 @@ function cc(a, e, t = "bim-snapshot.png") {
14643
14643
  const h = l.toDataURL("image/png"), u = document.createElement("a");
14644
14644
  return u.href = h, u.download = t.toLowerCase().endsWith(".png") ? t : `${t}.png`, u.click(), h;
14645
14645
  }
14646
- function hc(a, e, t) {
14646
+ function cc(a, e, t) {
14647
14647
  const i = document.createElement("canvas");
14648
14648
  i.width = e, i.height = t;
14649
14649
  const n = i.getContext("2d");
14650
14650
  return n && n.drawImage(a, 0, 0, e, t), i;
14651
14651
  }
14652
- function dc(a) {
14652
+ function hc(a) {
14653
14653
  const e = a.getContext("2d");
14654
14654
  if (!e || a.width <= 0 || a.height <= 0)
14655
14655
  return !1;
@@ -14662,28 +14662,28 @@ function dc(a) {
14662
14662
  }
14663
14663
  return !1;
14664
14664
  }
14665
- function uc(a, e, t) {
14665
+ function dc(a, e, t) {
14666
14666
  const i = a?.renderer, n = a?.scene, s = a?.camera;
14667
14667
  if (!i || !n || !s)
14668
14668
  return null;
14669
- const o = new Kn(e, t, {
14669
+ const o = new qn(e, t, {
14670
14670
  minFilter: Qt,
14671
14671
  magFilter: Qt,
14672
- format: jn,
14672
+ format: Kn,
14673
14673
  depthBuffer: !0,
14674
14674
  stencilBuffer: !0
14675
14675
  }), r = i.getRenderTarget(), l = i.autoClear, c = i.xr?.enabled ?? !1;
14676
14676
  try {
14677
14677
  i.xr && (i.xr.enabled = !1), i.autoClear = !0, i.setRenderTarget(o), i.clear(!0, !0, !0), i.render(n, s);
14678
14678
  const h = new Uint8Array(e * t * 4);
14679
- return i.readRenderTargetPixels(o, 0, 0, e, t, h), pc(h, e, t);
14679
+ return i.readRenderTargetPixels(o, 0, 0, e, t, h), uc(h, e, t);
14680
14680
  } catch {
14681
14681
  return null;
14682
14682
  } finally {
14683
14683
  i.setRenderTarget(r), i.autoClear = l, i.xr && (i.xr.enabled = c), o.dispose();
14684
14684
  }
14685
14685
  }
14686
- function pc(a, e, t) {
14686
+ function uc(a, e, t) {
14687
14687
  const i = document.createElement("canvas");
14688
14688
  i.width = e, i.height = t;
14689
14689
  const n = i.getContext("2d");
@@ -14697,7 +14697,7 @@ function pc(a, e, t) {
14697
14697
  }
14698
14698
  return n.putImageData(s, 0, 0), i;
14699
14699
  }
14700
- const mc = [
14700
+ const pc = [
14701
14701
  "#ffffff",
14702
14702
  "#000000",
14703
14703
  "#ff4d4f",
@@ -14708,7 +14708,7 @@ const mc = [
14708
14708
  "#1677ff",
14709
14709
  "#722ed1",
14710
14710
  "#eb2f96"
14711
- ], gc = {
14711
+ ], mc = {
14712
14712
  none: ee("/assets/icon/选择.svg", import.meta.url),
14713
14713
  line: ee("/assets/icon/线.svg", import.meta.url),
14714
14714
  arrow: ee("/assets/icon/箭头.svg", import.meta.url),
@@ -14716,7 +14716,7 @@ const mc = [
14716
14716
  circle: ee("/assets/icon/圆形.svg", import.meta.url),
14717
14717
  text: ee("/assets/icon/文字.svg", import.meta.url),
14718
14718
  cloudline: ee("/assets/icon/云线.svg", import.meta.url)
14719
- }, fc = ee("/assets/icon/测距.svg", import.meta.url), yc = ee("/assets/icon/截图.svg", import.meta.url), Mc = ee("/assets/icon/线宽.svg", import.meta.url), vc = ee("/assets/icon/字号.svg", import.meta.url), xc = `data:image/svg+xml;utf8,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2l4 8-4 12-4-12 4-8z" fill="#1677ff"/><circle cx="12" cy="10" r="2.5" fill="#fff"/></svg>')}`, wc = [
14719
+ }, gc = ee("/assets/icon/测距.svg", import.meta.url), fc = ee("/assets/icon/截图.svg", import.meta.url), yc = ee("/assets/icon/线宽.svg", import.meta.url), Mc = ee("/assets/icon/字号.svg", import.meta.url), vc = `data:image/svg+xml;utf8,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2l4 8-4 12-4-12 4-8z" fill="#1677ff"/><circle cx="12" cy="10" r="2.5" fill="#fff"/></svg>')}`, xc = [
14720
14720
  { type: "distance", label: "距离" },
14721
14721
  { type: "clearDistance", label: "净距" },
14722
14722
  { type: "clearHeight", label: "净高" },
@@ -14725,7 +14725,7 @@ const mc = [
14725
14725
  { type: "angle", label: "角度" },
14726
14726
  { type: "area", label: "面积" },
14727
14727
  { type: "slope", label: "坡度" }
14728
- ], bc = {
14728
+ ], wc = {
14729
14729
  distance: ee("/assets/icon/距离.svg", import.meta.url),
14730
14730
  clearDistance: ee("/assets/icon/净距.svg", import.meta.url),
14731
14731
  clearHeight: ee("/assets/icon/净高.svg", import.meta.url),
@@ -14735,7 +14735,7 @@ const mc = [
14735
14735
  area: ee("/assets/icon/面积.svg", import.meta.url),
14736
14736
  slope: ee("/assets/icon/坡度.svg", import.meta.url)
14737
14737
  };
14738
- class Cc {
14738
+ class bc {
14739
14739
  constructor(e, t) {
14740
14740
  this.handlers = e, this.root = document.createElement("div"), this.root.style.position = "absolute", this.root.style.top = "8px", this.root.style.left = "50%", this.root.style.transform = "translateX(-50%)", this.root.style.display = "none", this.root.style.padding = "6px", this.root.style.background = "#ffffff", this.root.style.border = "1px solid #d9d9d9", this.root.style.borderRadius = "8px", this.root.style.pointerEvents = "auto", this.root.style.userSelect = "none", this.root.style.boxShadow = "0 4px 14px rgba(0, 0, 0, 0.12)", this.root.style.zIndex = "1300", this.root.style.overflow = "visible", this.editPanel = document.createElement("div"), this.editPanel.style.display = "flex", this.editPanel.style.flexDirection = "column", this.editPanel.style.gap = "6px", this.viewPanel = document.createElement("div"), this.viewPanel.style.display = "none", this.viewPanel.style.alignItems = "center", this.viewPanel.style.gap = "6px";
14741
14741
  const i = document.createElement("div");
@@ -14748,7 +14748,7 @@ class Cc {
14748
14748
  { type: "text", label: "文字" },
14749
14749
  { type: "cloudline", label: "云线" }
14750
14750
  ].forEach((y) => {
14751
- const M = this.createIconButton(y.label, gc[y.type]);
14751
+ const M = this.createIconButton(y.label, mc[y.type]);
14752
14752
  M.onclick = () => this.handlers.onDrawTypeChange(y.type), this.drawButtons[y.type] = M, i.appendChild(M);
14753
14753
  });
14754
14754
  const s = document.createElement("div");
@@ -14758,23 +14758,23 @@ class Cc {
14758
14758
  this.updateColorControl(this.colorInput.value), this.handlers.onColorChange(this.colorInput.value), this.setColorPresetVisible(!1);
14759
14759
  }, s.appendChild(this.colorInput), this.colorPresetPanel = document.createElement("div"), this.colorPresetPanel.style.position = "absolute", this.colorPresetPanel.style.top = "30px", this.colorPresetPanel.style.left = "0", this.colorPresetPanel.style.display = "none", this.colorPresetPanel.style.padding = "8px", this.colorPresetPanel.style.background = "#ffffff", this.colorPresetPanel.style.border = "1px solid #d9d9d9", this.colorPresetPanel.style.borderRadius = "6px", this.colorPresetPanel.style.boxShadow = "0 6px 18px rgba(0, 0, 0, 0.14)", this.colorPresetPanel.style.zIndex = "20", this.colorPresetPanel.style.width = "152px";
14760
14760
  const r = document.createElement("div");
14761
- r.style.display = "grid", r.style.gridTemplateColumns = "repeat(5, 1fr)", r.style.gap = "6px", mc.forEach((y) => {
14761
+ r.style.display = "grid", r.style.gridTemplateColumns = "repeat(5, 1fr)", r.style.gap = "6px", pc.forEach((y) => {
14762
14762
  const M = document.createElement("button");
14763
14763
  M.type = "button", M.title = y, M.style.width = "22px", M.style.height = "22px", M.style.padding = "0", M.style.border = "1px solid #d9d9d9", M.style.borderRadius = "4px", M.style.background = y, M.style.cursor = "pointer", M.onclick = () => {
14764
14764
  this.updateColorControl(y), this.handlers.onColorChange(y), this.setColorPresetVisible(!1);
14765
14765
  }, r.appendChild(M);
14766
14766
  }), this.colorPresetPanel.appendChild(r);
14767
14767
  const l = document.createElement("button");
14768
- l.type = "button", l.textContent = "自定义", l.style.marginTop = "8px", l.style.width = "100%", l.style.height = "26px", l.style.border = "1px solid #d9d9d9", l.style.borderRadius = "4px", l.style.background = "#ffffff", l.style.color = "#333333", l.style.cursor = "pointer", l.onclick = () => this.openNativeColorPicker(), this.colorPresetPanel.appendChild(l), s.appendChild(this.colorPresetPanel), this.updateColorControl(t.stroke), i.appendChild(this.createField("", s)), this.strokeWidthInput = document.createElement("input"), this.strokeWidthInput.type = "number", this.strokeWidthInput.min = "1", this.strokeWidthInput.max = "20", this.strokeWidthInput.step = "1", this.strokeWidthInput.value = String(t.strokeWidth), this.strokeWidthInput.style.width = "46px", this.strokeWidthInput.oninput = () => this.handlers.onStrokeWidthChange(this.strokeWidthInput.value), i.appendChild(this.createField("", this.strokeWidthInput, Mc, "线宽")), this.fontSizeInput = document.createElement("input"), this.fontSizeInput.type = "number", this.fontSizeInput.min = "10", this.fontSizeInput.max = "96", this.fontSizeInput.step = "1", this.fontSizeInput.value = String(t.fontSize), this.fontSizeInput.style.width = "46px", this.fontSizeInput.oninput = () => this.handlers.onFontSizeChange(this.fontSizeInput.value), i.appendChild(this.createField("", this.fontSizeInput, vc, "字号")), this.distanceButton = this.createIconButton("测量", fc), this.distanceButton.onclick = () => this.handlers.onMeasureToggle(), i.appendChild(this.distanceButton);
14769
- const c = this.createIconButton("截图", yc);
14768
+ l.type = "button", l.textContent = "自定义", l.style.marginTop = "8px", l.style.width = "100%", l.style.height = "26px", l.style.border = "1px solid #d9d9d9", l.style.borderRadius = "4px", l.style.background = "#ffffff", l.style.color = "#333333", l.style.cursor = "pointer", l.onclick = () => this.openNativeColorPicker(), this.colorPresetPanel.appendChild(l), s.appendChild(this.colorPresetPanel), this.updateColorControl(t.stroke), i.appendChild(this.createField("", s)), this.strokeWidthInput = document.createElement("input"), this.strokeWidthInput.type = "number", this.strokeWidthInput.min = "1", this.strokeWidthInput.max = "20", this.strokeWidthInput.step = "1", this.strokeWidthInput.value = String(t.strokeWidth), this.strokeWidthInput.style.width = "46px", this.strokeWidthInput.oninput = () => this.handlers.onStrokeWidthChange(this.strokeWidthInput.value), i.appendChild(this.createField("", this.strokeWidthInput, yc, "线宽")), this.fontSizeInput = document.createElement("input"), this.fontSizeInput.type = "number", this.fontSizeInput.min = "10", this.fontSizeInput.max = "96", this.fontSizeInput.step = "1", this.fontSizeInput.value = String(t.fontSize), this.fontSizeInput.style.width = "46px", this.fontSizeInput.oninput = () => this.handlers.onFontSizeChange(this.fontSizeInput.value), i.appendChild(this.createField("", this.fontSizeInput, Mc, "字号")), this.distanceButton = this.createIconButton("测量", gc), this.distanceButton.onclick = () => this.handlers.onMeasureToggle(), i.appendChild(this.distanceButton);
14769
+ const c = this.createIconButton("截图", fc);
14770
14770
  c.onclick = () => this.handlers.onScreenshot(), i.appendChild(c);
14771
- const h = this.createIconButton("捕捉点", xc);
14771
+ const h = this.createIconButton("捕捉点", vc);
14772
14772
  h.onclick = () => this.handlers.onPickPoint(), i.appendChild(h);
14773
14773
  const u = this.createTextButton("×", "取消");
14774
14774
  u.onclick = () => this.handlers.onCancel(), u.style.background = "#ff4d4f", u.style.borderColor = "#ff4d4f", u.style.color = "#ffffff", i.appendChild(u);
14775
14775
  const p = this.createTextButton("✔", "确定");
14776
- p.onclick = () => this.handlers.onConfirm(), p.style.background = "#52c41a", p.style.borderColor = "#52c41a", p.style.color = "#ffffff", i.appendChild(p), this.measureSubPanel = document.createElement("div"), this.measureSubPanel.style.display = "none", this.measureSubPanel.style.alignItems = "center", this.measureSubPanel.style.gap = "6px", this.measureSubPanel.style.flexWrap = "wrap", this.measureSubPanel.style.paddingTop = "2px", wc.forEach((y) => {
14777
- const M = this.createSmallIconButton(y.label, bc[y.type]);
14776
+ p.onclick = () => this.handlers.onConfirm(), p.style.background = "#52c41a", p.style.borderColor = "#52c41a", p.style.color = "#ffffff", i.appendChild(p), this.measureSubPanel = document.createElement("div"), this.measureSubPanel.style.display = "none", this.measureSubPanel.style.alignItems = "center", this.measureSubPanel.style.gap = "6px", this.measureSubPanel.style.flexWrap = "wrap", this.measureSubPanel.style.paddingTop = "2px", xc.forEach((y) => {
14777
+ const M = this.createSmallIconButton(y.label, wc[y.type]);
14778
14778
  M.onclick = () => this.handlers.onMeasureTypeChange(y.type), this.measureTypeButtons[y.type] = M, this.measureSubPanel.appendChild(M);
14779
14779
  }), this.editPanel.appendChild(i), this.editPanel.appendChild(this.measureSubPanel);
14780
14780
  const g = this.createTextButton("关闭", "关闭");
@@ -14899,7 +14899,7 @@ class Cc {
14899
14899
  return i.type = "button", i.title = t, i.textContent = e, i.style.width = "28px", i.style.height = "28px", i.style.padding = "0 10px", i.style.border = "1px solid #d9d9d9", i.style.borderRadius = "4px", i.style.background = "#ffffff", i.style.color = "#333333", i.style.fontSize = "13px", i.style.lineHeight = "1", i.style.cursor = "pointer", i;
14900
14900
  }
14901
14901
  }
14902
- class Ec {
14902
+ class Cc {
14903
14903
  engine;
14904
14904
  wrapper;
14905
14905
  canvasEl;
@@ -14938,7 +14938,7 @@ class Ec {
14938
14938
  const t = this.engine.container;
14939
14939
  if (!t)
14940
14940
  throw new Error("FabricDraw: engine container not found.");
14941
- this.wrapper = document.createElement("div"), this.wrapper.className = "fabric-draw-layer", this.wrapper.style.position = "absolute", this.wrapper.style.left = "0", this.wrapper.style.top = "0", this.wrapper.style.right = "0", this.wrapper.style.bottom = "0", this.wrapper.style.pointerEvents = "none", this.canvasEl = document.createElement("canvas"), this.canvasEl.style.width = "100%", this.canvasEl.style.height = "100%", this.wrapper.appendChild(this.canvasEl), this.toolbar = new Cc({
14941
+ this.wrapper = document.createElement("div"), this.wrapper.className = "fabric-draw-layer", this.wrapper.style.position = "absolute", this.wrapper.style.left = "0", this.wrapper.style.top = "0", this.wrapper.style.right = "0", this.wrapper.style.bottom = "0", this.wrapper.style.pointerEvents = "none", this.canvasEl = document.createElement("canvas"), this.canvasEl.style.width = "100%", this.canvasEl.style.height = "100%", this.wrapper.appendChild(this.canvasEl), this.toolbar = new bc({
14942
14942
  onDrawTypeChange: (n) => this.setDrawType(n),
14943
14943
  onMeasureToggle: () => this.toggleMeasurePanel(),
14944
14944
  onMeasureTypeChange: (n) => this.activateDistanceMeasure(n),
@@ -14964,7 +14964,7 @@ class Ec {
14964
14964
  fontSize: this.drawStyle.fontSize
14965
14965
  }), this.toolbar.mount(this.wrapper);
14966
14966
  const i = this.engine.renderer?.domElement;
14967
- i?.nextSibling ? t.insertBefore(this.wrapper, i.nextSibling) : t.appendChild(this.wrapper), this.canvas = new Ro(this.canvasEl, {
14967
+ i?.nextSibling ? t.insertBefore(this.wrapper, i.nextSibling) : t.appendChild(this.wrapper), this.canvas = new zo(this.canvasEl, {
14968
14968
  selection: !0,
14969
14969
  preserveObjectStacking: !0
14970
14970
  }), this.resize(), this.canvas.on("mouse:down", this.onMouseDown), this.canvas.on("mouse:move", this.onMouseMove), this.canvas.on("mouse:up", this.onMouseUp), this.canvas.on("mouse:dblclick", this.onMouseDblClick), this.canvas.on("selection:created", this.onSelectionChanged), this.canvas.on("selection:updated", this.onSelectionChanged), this.canvas.on("selection:cleared", this.onSelectionChanged), window.addEventListener("keydown", this.onKeyDown), this.refreshToolbarState();
@@ -15050,7 +15050,7 @@ class Ec {
15050
15050
  /**
15051
15051
  * 鐩存帴缁樺埗鏂囧瓧銆? */
15052
15052
  drawText(e, t, i) {
15053
- const n = this.mergeStyle(i), s = new Oo(t ?? n.text, {
15053
+ const n = this.mergeStyle(i), s = new Ro(t ?? n.text, {
15054
15054
  left: e.x,
15055
15055
  top: e.y,
15056
15056
  ...this.createTextStyle(n),
@@ -15087,7 +15087,7 @@ class Ec {
15087
15087
  * 鎴浘淇濆瓨锛堟ā鍨?Fabric鎵规敞鍚堟垚锛夈€? */
15088
15088
  saveScreenshot(e = "bim-snapshot.png") {
15089
15089
  const t = this.canvas.lowerCanvasEl;
15090
- return t ? cc(this.engine, t, e) : null;
15090
+ return t ? lc(this.engine, t, e) : null;
15091
15091
  }
15092
15092
  /**
15093
15093
  * 鍚屾鐢诲竷灏哄銆? */
@@ -15255,7 +15255,7 @@ class Ec {
15255
15255
  return s.annotationType = "line", s;
15256
15256
  }
15257
15257
  createRectObject(e, t, i, n) {
15258
- const s = this.getBoxFromPoints(e, t), o = new Fo({
15258
+ const s = this.getBoxFromPoints(e, t), o = new Oo({
15259
15259
  ...this.createObjectBase(i, n),
15260
15260
  left: s.left,
15261
15261
  top: s.top,
@@ -15267,7 +15267,7 @@ class Ec {
15267
15267
  return o.annotationType = "rect", o;
15268
15268
  }
15269
15269
  createCircleObject(e, t, i, n) {
15270
- const s = this.getCircleFromPoints(e, t), o = new No({
15270
+ const s = this.getCircleFromPoints(e, t), o = new Fo({
15271
15271
  ...this.createObjectBase(i, n),
15272
15272
  left: s.left,
15273
15273
  top: s.top,
@@ -15571,7 +15571,7 @@ class Ec {
15571
15571
  return JSON.parse(JSON.stringify(e));
15572
15572
  }
15573
15573
  }
15574
- class Ac {
15574
+ class Ec {
15575
15575
  engine;
15576
15576
  capturePoint = null;
15577
15577
  labelPrefix = "drawing-pin-label-";
@@ -16021,7 +16021,7 @@ class Ac {
16021
16021
  return e;
16022
16022
  }
16023
16023
  }
16024
- const Mi = "bim-engine:model-link-3d", Sc = "default-model-link-3d-group", On = "model-link-3d", Fn = {
16024
+ const Mi = "bim-engine:model-link-3d", Ac = "default-model-link-3d-group", Rn = "model-link-3d", On = {
16025
16025
  enabled: !1,
16026
16026
  highlight: !0,
16027
16027
  visibility: !0,
@@ -16030,7 +16030,7 @@ const Mi = "bim-engine:model-link-3d", Sc = "default-model-link-3d-group", On =
16030
16030
  cameraMode: "onStop",
16031
16031
  cameraThrottleMs: 50
16032
16032
  };
16033
- class Pc {
16033
+ class Sc {
16034
16034
  viewerGuid;
16035
16035
  engine;
16036
16036
  options;
@@ -16088,20 +16088,20 @@ class Pc {
16088
16088
  return this.applyingLinkedEvent;
16089
16089
  }
16090
16090
  dispose() {
16091
- this.disposed || (this.disposed = !0, typeof window < "u" && window.removeEventListener(Mi, this.handleWindowEvent), this.pendingCameraTimer != null && (window.clearTimeout(this.pendingCameraTimer), this.pendingCameraTimer = null), this.firstPersonSyncFrame != null && (window.cancelAnimationFrame(this.firstPersonSyncFrame), this.firstPersonSyncFrame = null), this.engine?.setIdleFrameRateExempt?.(On, !1), this.unbindCameraEvents(), this.restoreModelToolMethods());
16091
+ this.disposed || (this.disposed = !0, typeof window < "u" && window.removeEventListener(Mi, this.handleWindowEvent), this.pendingCameraTimer != null && (window.clearTimeout(this.pendingCameraTimer), this.pendingCameraTimer = null), this.firstPersonSyncFrame != null && (window.cancelAnimationFrame(this.firstPersonSyncFrame), this.firstPersonSyncFrame = null), this.engine?.setIdleFrameRateExempt?.(Rn, !1), this.unbindCameraEvents(), this.restoreModelToolMethods());
16092
16092
  }
16093
16093
  normalizeOptions(e) {
16094
16094
  return {
16095
- ...Fn,
16095
+ ...On,
16096
16096
  ...e,
16097
- groupId: e.groupId ?? this.engine?.options?.linkGroupId ?? Sc,
16097
+ groupId: e.groupId ?? this.engine?.options?.linkGroupId ?? Ac,
16098
16098
  modelId: e.modelId ?? this.engine?.options?.modelLinkId
16099
16099
  };
16100
16100
  }
16101
16101
  /** 模型联动开启后需要持续响应外部视图变化,不能进入空闲限帧。 */
16102
16102
  syncIdleFrameRateExempt() {
16103
16103
  this.engine?.setIdleFrameRateExempt?.(
16104
- On,
16104
+ Rn,
16105
16105
  this.options.enabled === !0
16106
16106
  );
16107
16107
  }
@@ -16193,7 +16193,7 @@ class Pc {
16193
16193
  return this.engine?.controlModule?.firstPersonControls?.enabled === !0 && this.engine?.movefirst === !0;
16194
16194
  }
16195
16195
  emitCameraThrottled() {
16196
- const e = Date.now(), t = Math.max(0, (this.options.cameraThrottleMs ?? Fn.cameraThrottleMs) - (e - this.lastCameraEmitTime));
16196
+ const e = Date.now(), t = Math.max(0, (this.options.cameraThrottleMs ?? On.cameraThrottleMs) - (e - this.lastCameraEmitTime));
16197
16197
  if (t === 0) {
16198
16198
  this.emitCamera();
16199
16199
  return;
@@ -16334,13 +16334,13 @@ class Pc {
16334
16334
  }).filter((n) => n.ids.length > 0);
16335
16335
  }
16336
16336
  }
16337
- class Tc {
16337
+ class Pc {
16338
16338
  engine;
16339
16339
  manager;
16340
16340
  worldToScreen;
16341
16341
  raycaster = new me();
16342
16342
  constructor(e) {
16343
- this.engine = e, this.worldToScreen = new fe(e.camera, e.renderer, e.scene), this.manager = new ko({
16343
+ this.engine = e, this.worldToScreen = new fe(e.camera, e.renderer, e.scene), this.manager = new Do({
16344
16344
  container: e.container,
16345
16345
  className: "bim-engine-label-container bim-engine-label-container-3d",
16346
16346
  projectCoordinate: (t) => this.projectCoordinate(t),
@@ -16402,7 +16402,7 @@ class Tc {
16402
16402
  return e = this.engine.clipping?.filterIntersectionsByClipping?.(e) ?? e, e.filter((i) => i?.point instanceof d).sort((i, n) => i.distance - n.distance)[0] ?? null;
16403
16403
  }
16404
16404
  }
16405
- class Ic {
16405
+ class Tc {
16406
16406
  /** 推进当前标记注册的材质与独立点动画。 */
16407
16407
  updateRecord(e, t) {
16408
16408
  const i = t + e.timeSeed;
@@ -16425,7 +16425,7 @@ class Ic {
16425
16425
  });
16426
16426
  }
16427
16427
  }
16428
- class _c {
16428
+ class Ic {
16429
16429
  engine;
16430
16430
  rootGroup;
16431
16431
  records;
@@ -16732,7 +16732,7 @@ const Pe = {
16732
16732
  showBottom: !1,
16733
16733
  edgeColor: "#d9ffff"
16734
16734
  }
16735
- }, Dc = {
16735
+ }, _c = {
16736
16736
  background: "rgba(10, 18, 28, 0.92)",
16737
16737
  color: "#ffffff",
16738
16738
  border: "1px solid rgba(127, 252, 255, 0.72)",
@@ -16741,7 +16741,7 @@ const Pe = {
16741
16741
  boxShadow: "0 10px 30px rgba(0, 0, 0, 0.32)",
16742
16742
  minWidth: "120px",
16743
16743
  pointerEvents: "auto"
16744
- }, kc = "bim-engine-annotation3d-panels";
16744
+ }, Dc = "bim-engine-annotation3d-panels";
16745
16745
  function Yt(a) {
16746
16746
  return a.map((e) => ({ x: e.x, y: e.y, z: e.z }));
16747
16747
  }
@@ -16752,7 +16752,7 @@ function Wt(a) {
16752
16752
  const e = new d();
16753
16753
  return a.length === 0 ? e : (a.forEach((t) => e.add(J(t))), e.multiplyScalar(1 / a.length));
16754
16754
  }
16755
- function Lc(a) {
16755
+ function kc(a) {
16756
16756
  const e = new d();
16757
16757
  for (let t = 0; t < a.length; t += 1) {
16758
16758
  const i = a[t], n = a[(t + 1) % a.length];
@@ -16760,9 +16760,9 @@ function Lc(a) {
16760
16760
  }
16761
16761
  return e.normalize();
16762
16762
  }
16763
- function Os(a) {
16763
+ function Rs(a) {
16764
16764
  const e = a.map((c) => J(c)), t = e[0].clone(), i = e.length > 1 ? e[1].clone().sub(t).normalize() : new d(1, 0, 0);
16765
- let n = Lc(e);
16765
+ let n = kc(e);
16766
16766
  n.lengthSq() < 1e-8 && (n = new d(0, 1, 0));
16767
16767
  const s = new d().crossVectors(n, i).normalize(), o = new d().crossVectors(s, n).normalize(), r = e.map((c) => {
16768
16768
  const h = c.clone().sub(t);
@@ -16770,8 +16770,8 @@ function Os(a) {
16770
16770
  }), l = new H().makeBasis(o, s, n).setPosition(t);
16771
16771
  return { origin: t, normal: n, matrix: l, localPoints: r };
16772
16772
  }
16773
- function Fs(a) {
16774
- const e = new Yn();
16773
+ function Os(a) {
16774
+ const e = new jn();
16775
16775
  return a.forEach((t, i) => {
16776
16776
  if (i === 0) {
16777
16777
  e.moveTo(t.x, t.y);
@@ -16780,12 +16780,12 @@ function Fs(a) {
16780
16780
  e.lineTo(t.x, t.y);
16781
16781
  }), e.closePath(), e;
16782
16782
  }
16783
- function Bc(a, e) {
16783
+ function Lc(a, e) {
16784
16784
  a.traverse((t) => {
16785
16785
  t.userData = t.userData ?? {}, t.userData.annotationId = e;
16786
16786
  });
16787
16787
  }
16788
- function zc(a) {
16788
+ function Bc(a) {
16789
16789
  a.traverse((e) => {
16790
16790
  const t = e;
16791
16791
  t.geometry?.dispose?.();
@@ -16797,13 +16797,13 @@ function zc(a) {
16797
16797
  i?.dispose?.();
16798
16798
  });
16799
16799
  }
16800
- function Rc(a) {
16800
+ function zc(a) {
16801
16801
  return a.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
16802
16802
  }
16803
- function Oc(a) {
16803
+ function Rc(a) {
16804
16804
  return a === "polyline" || a === "curve3d" ? "center" : a === "polygon" ? "centroid" : "top";
16805
16805
  }
16806
- class Fc {
16806
+ class Oc {
16807
16807
  render(e) {
16808
16808
  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, l = 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(), y = Math.max(t.fontSize ?? 14, 10), M = 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), C = this.getBoardWidth(e, g, y), S = Math.max(Math.round((t.boardHeight ?? 1.8) * 22), y + 18, 34), I = Math.max(Math.round((t.stemWidth ?? e.instance.style.lineWidth ?? 0.12) * 20), 2), P = t.borderWidth ?? 2.5, L = t.variant ?? "elbow", k = c === "right" ? 22 + b - 8 : 22 - b - C + 8, O = 8, K = Math.min(22, k) - 16, te = Math.max(22, k + C) + 16, Q = Math.max(te - K, 140), he = Math.max(m + S + 36, 120), le = 22 - K, ce = k - K, ye = he - 18, Se = Math.max(ye - m, 14), w = c === "right" ? ce : ce + C, f = O + Math.round(S * 0.5), E = L === "vertical" ? [`${le},${ye}`, `${le},${Se}`] : [`${le},${ye}`, `${le},${f}`, `${w},${f}`], _ = e.instance.selectable !== !1, D = _ ? "visiblePainted" : "none", T = _ ? "pointer" : "default", N = ce + (h || !g ? 38 : 12), G = t.showBoard === !1 ? "" : `
16809
16809
  <rect x="${ce}" y="${O}" width="${C}" height="${S}" rx="10"
@@ -16857,7 +16857,7 @@ class Fc {
16857
16857
  return Math.max(Math.round((n.boardWidth ?? 4.6) * 22), Math.ceil(r), 78);
16858
16858
  }
16859
16859
  }
16860
- class Nc {
16860
+ class Fc {
16861
16861
  /** 按标记类型重建内容,并返回相对三维锚点的布局参数。 */
16862
16862
  render(e, t) {
16863
16863
  const i = t.instance.type === "iconPoint" ? t.instance.style.iconPoint ?? {} : t.instance.type === "textPoint" ? t.instance.style.textPoint ?? {} : t.instance.style.iconTextPoint ?? {}, n = JSON.stringify({
@@ -16930,10 +16930,10 @@ class Nc {
16930
16930
  return `rgba(${r >> 16 & 255}, ${r >> 8 & 255}, ${r & 255}, ${i})`;
16931
16931
  }
16932
16932
  }
16933
- const Hc = /* @__PURE__ */ new Set(["iconPoint", "textPoint", "iconTextPoint"]), Vc = /* @__PURE__ */ new Set(["iconPoint", "textPoint", "iconTextPoint", "ripplePoint", "pillarPoint", "leaderPoint"]);
16934
- class Uc {
16933
+ const Nc = /* @__PURE__ */ new Set(["iconPoint", "textPoint", "iconTextPoint"]), Hc = /* @__PURE__ */ new Set(["iconPoint", "textPoint", "iconTextPoint", "ripplePoint", "pillarPoint", "leaderPoint"]);
16934
+ class Vc {
16935
16935
  constructor(e, t) {
16936
- this.engine = e, this.isAnchorOccluded = t, this.container = document.createElement("div"), this.container.className = kc, this.container.style.cssText = [
16936
+ this.engine = e, this.isAnchorOccluded = t, this.container = document.createElement("div"), this.container.className = Dc, this.container.style.cssText = [
16937
16937
  "position:absolute",
16938
16938
  "left:0",
16939
16939
  "top:0",
@@ -16946,8 +16946,8 @@ class Uc {
16946
16946
  }
16947
16947
  container;
16948
16948
  worldToScreen;
16949
- leaderMarker = new Fc();
16950
- pointContentMarker = new Nc();
16949
+ leaderMarker = new Oc();
16950
+ pointContentMarker = new Fc();
16951
16951
  updateProjectionState() {
16952
16952
  this.worldToScreen.updateCamera(this.engine.camera), this.worldToScreen.updateRenderer(this.engine.renderer), this.worldToScreen.updateScene(this.engine.scene);
16953
16953
  }
@@ -16960,7 +16960,7 @@ class Uc {
16960
16960
  "transform:translate(-50%, -100%)",
16961
16961
  "display:none",
16962
16962
  t.interactive === !1 ? "pointer-events:none" : "pointer-events:auto"
16963
- ].join(";"), t.mode === "html" ? i.innerHTML = t.html ?? "" : i.textContent = t.text ?? "", Object.entries(t.style ?? {}).forEach(([n, s]) => i.style.setProperty(Rc(n), s)), i;
16963
+ ].join(";"), t.mode === "html" ? i.innerHTML = t.html ?? "" : i.textContent = t.text ?? "", Object.entries(t.style ?? {}).forEach(([n, s]) => i.style.setProperty(zc(n), s)), i;
16964
16964
  }
16965
16965
  createLeaderMarkerElement(e) {
16966
16966
  const t = document.createElement("div");
@@ -16972,7 +16972,7 @@ class Uc {
16972
16972
  return t.className = "bim-annotation3d-marker bim-annotation3d-point-marker", t.dataset.annotationId = e.id, t.style.cssText = ["position:absolute", "left:0", "top:0", "display:none", "pointer-events:none"].join(";"), t;
16973
16973
  }
16974
16974
  updateRecord(e) {
16975
- if (e.markerElement && e.instance.type === "leaderPoint" ? this.updateLeaderMarker(e) : e.markerElement && Hc.has(e.instance.type) && this.updatePointMarker(e), !e.panelElement || !e.instance.panel)
16975
+ if (e.markerElement && e.instance.type === "leaderPoint" ? this.updateLeaderMarker(e) : e.markerElement && Nc.has(e.instance.type) && this.updatePointMarker(e), !e.panelElement || !e.instance.panel)
16976
16976
  return;
16977
16977
  const t = e.instance.panel;
16978
16978
  if (!(t.visible !== !1 && this.shouldShowPanel(e)) || !e.instance.visible) {
@@ -17031,9 +17031,9 @@ class Uc {
17031
17031
  const t = e.instance.panel?.offset ?? {};
17032
17032
  if (e.panelAnchorPoint)
17033
17033
  return e.panelAnchorPoint.clone().add(new d(t.x ?? 0, t.y ?? 0, t.z ?? 0));
17034
- const i = e.instance.panel?.anchor ?? Oc(e.instance.type);
17034
+ const i = e.instance.panel?.anchor ?? Rc(e.instance.type);
17035
17035
  let n = new d();
17036
- if (Vc.has(e.instance.type))
17036
+ if (Hc.has(e.instance.type))
17037
17037
  n.copy(J(e.instance.points[0])), i === "top" && (n.y += e.volumeHeight ?? 0);
17038
17038
  else if (e.instance.type === "polyline" || e.instance.type === "curve3d")
17039
17039
  i === "start" ? n.copy(J(e.instance.points[0])) : i === "end" ? n.copy(J(e.instance.points[e.instance.points.length - 1])) : e.anchorCurve ? n.copy(e.anchorCurve.getPoint(0.5)) : n.copy(Wt(e.instance.points));
@@ -17048,19 +17048,19 @@ class Uc {
17048
17048
  return n.add(new d(t.x ?? 0, t.y ?? 0, t.z ?? 0)), n;
17049
17049
  }
17050
17050
  }
17051
- class Wc {
17051
+ class Uc {
17052
17052
  apply(e, t) {
17053
17053
  e.instance.root.visible = e.instance.visible, e.instance.style.alwaysOnTop && e.instance.root.traverse((i) => {
17054
17054
  i.renderOrder = Math.max(i.renderOrder, 1200);
17055
17055
  }), t(e);
17056
17056
  }
17057
17057
  }
17058
- class Gc {
17058
+ class Wc {
17059
17059
  constructor(e) {
17060
17060
  this.engine = e;
17061
17061
  }
17062
17062
  createSurfaceMaterial(e) {
17063
- const t = e.style ?? {}, i = e.effect ?? {}, n = this.getGradientStops(e.color, i.gradient?.stops), s = i.gradient?.enabled === !0, o = i.glow?.enabled ? i.glow.intensity ?? 0.9 : 0, r = i.flow?.enabled === !0, l = i.pulse?.enabled === !0, c = i.scan?.enabled === !0, h = i.flow?.direction === "backward" ? -1 : 1, u = new po({
17063
+ const t = e.style ?? {}, i = e.effect ?? {}, n = this.getGradientStops(e.color, i.gradient?.stops), s = i.gradient?.enabled === !0, o = i.glow?.enabled ? i.glow.intensity ?? 0.9 : 0, r = i.flow?.enabled === !0, l = i.pulse?.enabled === !0, c = i.scan?.enabled === !0, h = i.flow?.direction === "backward" ? -1 : 1, u = new uo({
17064
17064
  transparent: !0,
17065
17065
  side: re,
17066
17066
  depthTest: t.alwaysOnTop ? !1 : t.depthTest !== !1,
@@ -17207,13 +17207,13 @@ class Ke {
17207
17207
  this.engine = e, this.materialFactory = t;
17208
17208
  }
17209
17209
  createSegmentCurve(e) {
17210
- const t = new mo();
17210
+ const t = new po();
17211
17211
  for (let i = 0; i < e.length - 1; i += 1)
17212
- t.add(new go(e[i], e[i + 1]));
17212
+ t.add(new mo(e[i], e[i + 1]));
17213
17213
  return t;
17214
17214
  }
17215
17215
  createTubeMesh(e, t, i, n, s, o, r = 10, l = !1) {
17216
- const c = new fo(t, i, n, r, l);
17216
+ const c = new go(t, i, n, r, l);
17217
17217
  c.computeBoundingBox();
17218
17218
  const h = c.boundingBox ?? new R(new d(0, 0, 0), new d(1, 1, 1)), u = this.materialFactory.createSurfaceMaterial({
17219
17219
  color: s.color ?? "#7ffcff",
@@ -17234,11 +17234,11 @@ class Ke {
17234
17234
  depthTest: i.alwaysOnTop ? !1 : i.depthTest !== !1
17235
17235
  });
17236
17236
  s.clippingPlanes = this.engine.sectionPlane;
17237
- const o = new yo(n, s);
17237
+ const o = new fo(n, s);
17238
17238
  return o.renderOrder = 998, o;
17239
17239
  }
17240
17240
  }
17241
- class qc extends Ke {
17241
+ class Gc extends Ke {
17242
17242
  type = "box";
17243
17243
  build(e) {
17244
17244
  if (e.instance.points.length < 2)
@@ -17265,14 +17265,14 @@ class qc extends Ke {
17265
17265
  depthTest: e.instance.style.alwaysOnTop ? !1 : e.instance.style.depthTest !== !1
17266
17266
  });
17267
17267
  p.clippingPlanes = this.engine.sectionPlane;
17268
- const g = new Jt(new Mo(l), p);
17268
+ const g = new Jt(new yo(l), p);
17269
17269
  g.position.copy(r), e.instance.root.add(g), e.volumeHeight = o.y, e.animatedMaterials.push(h);
17270
17270
  }
17271
17271
  }
17272
- class Kc extends Ke {
17272
+ class qc extends Ke {
17273
17273
  type = "curve3d";
17274
17274
  build(e) {
17275
- const t = e.instance.points.map((r) => J(r)), i = e.instance.style.curve ?? {}, n = i.interpolation ?? "catmullRom", s = new vo(
17275
+ const t = e.instance.points.map((r) => J(r)), i = e.instance.style.curve ?? {}, n = i.interpolation ?? "catmullRom", s = new Mo(
17276
17276
  t,
17277
17277
  i.closed ?? !1,
17278
17278
  n === "catmullRom" ? "catmullrom" : n,
@@ -17290,10 +17290,10 @@ class Kc extends Ke {
17290
17290
  e.instance.root.add(o), e.anchorCurve = s, e.panelAnchorPoint = s.getPoint(0.5);
17291
17291
  }
17292
17292
  }
17293
- class jc extends Ke {
17293
+ class Kc extends Ke {
17294
17294
  type = "extrudePolygon";
17295
17295
  build(e) {
17296
- const t = Os(e.instance.points), i = Fs(t.localPoints), n = e.instance.style.volume?.height ?? 10, s = new Xn(i, {
17296
+ const t = Rs(e.instance.points), i = Os(t.localPoints), n = e.instance.style.volume?.height ?? 10, s = new Yn(i, {
17297
17297
  depth: n,
17298
17298
  bevelEnabled: !1,
17299
17299
  steps: 1,
@@ -17338,21 +17338,21 @@ class ji extends Ke {
17338
17338
  e.instance.root.position.copy(t), e.panelAnchorPoint = t.clone();
17339
17339
  }
17340
17340
  }
17341
- class Yc extends ji {
17341
+ class jc extends ji {
17342
17342
  type = "iconPoint";
17343
17343
  /** 将图标点绑定到首个世界坐标。 */
17344
17344
  build(e) {
17345
17345
  this.buildDomAnchor(e);
17346
17346
  }
17347
17347
  }
17348
- class Xc extends ji {
17348
+ class Yc extends ji {
17349
17349
  type = "iconTextPoint";
17350
17350
  /** 将图文组合点绑定到首个世界坐标。 */
17351
17351
  build(e) {
17352
17352
  this.buildDomAnchor(e);
17353
17353
  }
17354
17354
  }
17355
- class Qc extends Ke {
17355
+ class Xc extends Ke {
17356
17356
  type = "leaderPoint";
17357
17357
  build(e) {
17358
17358
  const t = J(e.instance.points[0]), i = e.instance.style.leaderPoint ?? {}, n = Math.max(i.height ?? 8, 0.5), s = i.offsetX ?? i.armLength ?? 4, o = i.offsetZ ?? 0, r = this.createLeaderPathPoints(i.variant ?? "elbow", n, s, o), l = r[r.length - 1].clone();
@@ -17372,13 +17372,13 @@ class Qc extends Ke {
17372
17372
  ];
17373
17373
  }
17374
17374
  }
17375
- class $c extends Ke {
17375
+ class Qc extends Ke {
17376
17376
  type = "pillarPoint";
17377
17377
  /** 根据光柱专属参数创建柱体与可选底环。 */
17378
17378
  build(e) {
17379
17379
  const t = e.instance.style.pillarPoint ?? {}, i = J(e.instance.points[0]), n = new d(t.offsetX ?? 0, t.offsetY ?? 0, t.offsetZ ?? 0), s = Math.max(t.height ?? 16, 0.01);
17380
17380
  e.instance.root.position.copy(i).add(n), e.panelAnchorPoint = i.clone().add(n).add(new d(0, s, 0)), e.volumeHeight = s;
17381
- const o = new xo(
17381
+ const o = new vo(
17382
17382
  Math.max(t.radiusTop ?? 0.3, 1e-3),
17383
17383
  Math.max(t.radiusBottom ?? 0.75, 1e-3),
17384
17384
  s,
@@ -17421,7 +17421,7 @@ class $c extends Ke {
17421
17421
  });
17422
17422
  h.clippingPlanes = this.engine.sectionPlane;
17423
17423
  const u = new z(
17424
- new Jn(
17424
+ new Zn(
17425
17425
  Math.max(t.baseRingInnerRadius ?? 1.9, 1e-3),
17426
17426
  Math.max(t.baseRingOuterRadius ?? 2.4, (t.baseRingInnerRadius ?? 1.9) + 1e-3),
17427
17427
  Math.max(12, Math.floor(t.baseRingSegments ?? 48))
@@ -17432,10 +17432,10 @@ class $c extends Ke {
17432
17432
  }
17433
17433
  }
17434
17434
  }
17435
- class Zc extends Ke {
17435
+ class $c extends Ke {
17436
17436
  type = "polygon";
17437
17437
  build(e) {
17438
- const t = Os(e.instance.points), i = Fs(t.localPoints), n = new wo(i);
17438
+ const t = Rs(e.instance.points), i = Os(t.localPoints), n = new xo(i);
17439
17439
  n.computeBoundingBox();
17440
17440
  const s = n.boundingBox ?? new R(new d(0, 0, 0), new d(1, 1, 1)), o = this.materialFactory.createSurfaceMaterial({
17441
17441
  color: e.instance.style.fillColor ?? e.instance.style.color ?? "#7ffcff",
@@ -17455,7 +17455,7 @@ class Zc extends Ke {
17455
17455
  ), e.animatedMaterials.push(o);
17456
17456
  }
17457
17457
  }
17458
- class Jc extends Ke {
17458
+ class Zc extends Ke {
17459
17459
  type = "polyline";
17460
17460
  build(e) {
17461
17461
  const t = e.instance.points.map((s) => J(s)), i = this.createSegmentCurve(t), n = this.createTubeMesh(
@@ -17469,7 +17469,7 @@ class Jc extends Ke {
17469
17469
  e.instance.root.add(n), e.anchorCurve = i, e.panelAnchorPoint = i.getPoint(0.5);
17470
17470
  }
17471
17471
  }
17472
- class eh extends Ke {
17472
+ class Jc extends Ke {
17473
17473
  type = "ripplePoint";
17474
17474
  /** 根据波纹参数创建中心点和错相扩散圆环。 */
17475
17475
  build(e) {
@@ -17501,36 +17501,36 @@ class eh extends Ke {
17501
17501
  });
17502
17502
  h.clippingPlanes = this.engine.sectionPlane;
17503
17503
  const u = new z(
17504
- new Jn(Math.max(o - r, 1e-3), o, l),
17504
+ new Zn(Math.max(o - r, 1e-3), o, l),
17505
17505
  h
17506
17506
  );
17507
17507
  u.rotation.set(t.rotationX ?? -Math.PI / 2, t.rotationY ?? 0, t.rotationZ ?? 0), u.userData.ripplePhase = c / s, u.userData.rippleSpeed = Math.max(t.speed ?? 0.9, 0), u.userData.rippleStartRadius = Math.max(t.startRadius ?? 0.2, 0), u.userData.rippleMaxRadius = o, u.userData.rippleBaseOpacity = h.opacity, e.instance.root.add(u), e.rippleMeshes.push(u);
17508
17508
  }
17509
17509
  }
17510
17510
  }
17511
- class th extends ji {
17511
+ class eh extends ji {
17512
17512
  type = "textPoint";
17513
17513
  /** 将文字点绑定到首个世界坐标。 */
17514
17514
  build(e) {
17515
17515
  this.buildDomAnchor(e);
17516
17516
  }
17517
17517
  }
17518
- function ih(a, e) {
17518
+ function th(a, e) {
17519
17519
  return [
17520
+ new jc(a, e),
17521
+ new eh(a, e),
17520
17522
  new Yc(a, e),
17521
- new th(a, e),
17523
+ new Jc(a, e),
17524
+ new Qc(a, e),
17522
17525
  new Xc(a, e),
17523
- new eh(a, e),
17526
+ new Zc(a, e),
17527
+ new qc(a, e),
17524
17528
  new $c(a, e),
17525
- new Qc(a, e),
17526
- new Jc(a, e),
17527
17529
  new Kc(a, e),
17528
- new Zc(a, e),
17529
- new jc(a, e),
17530
- new qc(a, e)
17530
+ new Gc(a, e)
17531
17531
  ];
17532
17532
  }
17533
- function nh(a, e, t) {
17533
+ function ih(a, e, t) {
17534
17534
  const i = a.camera;
17535
17535
  if (!i)
17536
17536
  return !1;
@@ -17543,7 +17543,7 @@ function nh(a, e, t) {
17543
17543
  const r = o.sort((l, c) => l.distance - c.distance)[0];
17544
17544
  return !!(r && r.distance < s - 0.05);
17545
17545
  }
17546
- class sh {
17546
+ class nh {
17547
17547
  /** 归一化外部数据,并在创建几何前校验类型对应的必要输入。 */
17548
17548
  normalizeData(e) {
17549
17549
  const t = {
@@ -17677,7 +17677,7 @@ class sh {
17677
17677
  offset: { ...e.offset ?? {} },
17678
17678
  screenOffset: { ...e.screenOffset ?? {} },
17679
17679
  className: e.className,
17680
- style: { ...Dc, ...e.style ?? {} },
17680
+ style: { ..._c, ...e.style ?? {} },
17681
17681
  interactive: e.interactive ?? !0,
17682
17682
  occlusion: e.occlusion ?? "show",
17683
17683
  actions: e.actions
@@ -17716,11 +17716,11 @@ class sh {
17716
17716
  }
17717
17717
  }
17718
17718
  }
17719
- function oh(a) {
17719
+ function sh(a) {
17720
17720
  const { actions: e, ...t } = a;
17721
17721
  return t;
17722
17722
  }
17723
- function rh(a) {
17723
+ function oh(a) {
17724
17724
  return {
17725
17725
  id: a.instance.id,
17726
17726
  type: a.instance.type,
@@ -17736,7 +17736,7 @@ function rh(a) {
17736
17736
  function Gt(a) {
17737
17737
  return a === void 0 ? a : JSON.parse(JSON.stringify(a));
17738
17738
  }
17739
- class ah {
17739
+ class rh {
17740
17740
  builders = /* @__PURE__ */ new Map();
17741
17741
  constructor(e) {
17742
17742
  e.forEach((t) => this.builders.set(t.type, t));
@@ -17748,8 +17748,8 @@ class ah {
17748
17748
  t.build(e);
17749
17749
  }
17750
17750
  }
17751
- const lh = /* @__PURE__ */ new Set(["iconPoint", "textPoint", "iconTextPoint"]);
17752
- class ch {
17751
+ const ah = /* @__PURE__ */ new Set(["iconPoint", "textPoint", "iconTextPoint"]);
17752
+ class lh {
17753
17753
  constructor(e, t) {
17754
17754
  this.markerRegistry = e, this.overlayController = t;
17755
17755
  }
@@ -17764,7 +17764,7 @@ class ch {
17764
17764
  selectable: e.selectable ?? !0,
17765
17765
  style: e.style,
17766
17766
  effect: e.effect ?? {},
17767
- panel: e.panel ? oh(e.panel) : void 0,
17767
+ panel: e.panel ? sh(e.panel) : void 0,
17768
17768
  data: e.data,
17769
17769
  panelVisible: e.panel?.trigger === "always",
17770
17770
  hovered: !1,
@@ -17773,37 +17773,37 @@ class ch {
17773
17773
  instance: i,
17774
17774
  actions: e.panel?.actions,
17775
17775
  panelElement: e.panel ? this.overlayController.createPanelElement(i, e.panel) : null,
17776
- markerElement: e.type === "leaderPoint" ? this.overlayController.createLeaderMarkerElement(i) : lh.has(e.type) ? this.overlayController.createPointMarkerElement(i) : null,
17776
+ markerElement: e.type === "leaderPoint" ? this.overlayController.createLeaderMarkerElement(i) : ah.has(e.type) ? this.overlayController.createPointMarkerElement(i) : null,
17777
17777
  timeSeed: Math.random() * Math.PI * 2,
17778
17778
  pulseMaterials: [],
17779
17779
  rippleMeshes: [],
17780
17780
  baseRingMeshes: [],
17781
17781
  animatedMaterials: []
17782
17782
  };
17783
- return this.markerRegistry.build(n), Bc(t, i.id), n;
17783
+ return this.markerRegistry.build(n), Lc(t, i.id), n;
17784
17784
  }
17785
17785
  }
17786
- class hh {
17786
+ class ch {
17787
17787
  engine;
17788
17788
  rootGroup;
17789
17789
  records = /* @__PURE__ */ new Map();
17790
17790
  occlusionRaycaster = new me();
17791
- normalizer = new sh();
17791
+ normalizer = new nh();
17792
17792
  materialFactory;
17793
17793
  overlayController;
17794
17794
  interactionController;
17795
17795
  effectsController;
17796
- visibilityController = new Wc();
17796
+ visibilityController = new Uc();
17797
17797
  markerRegistry;
17798
17798
  recordFactory;
17799
17799
  currentTime = 0;
17800
17800
  constructor(e) {
17801
- this.engine = e, this.rootGroup = new pe(), this.rootGroup.name = "Annotation3dRoot", this.engine.scene.add(this.rootGroup), this.materialFactory = new Gc(this.engine), this.overlayController = new Uc(
17801
+ this.engine = e, this.rootGroup = new pe(), this.rootGroup.name = "Annotation3dRoot", this.engine.scene.add(this.rootGroup), this.materialFactory = new Wc(this.engine), this.overlayController = new Vc(
17802
17802
  this.engine,
17803
- (t) => nh(this.engine, this.occlusionRaycaster, t)
17804
- ), this.markerRegistry = new ah(
17805
- ih(this.engine, this.materialFactory)
17806
- ), this.recordFactory = new ch(this.markerRegistry, this.overlayController), this.effectsController = new Ic(), this.interactionController = new _c({
17803
+ (t) => ih(this.engine, this.occlusionRaycaster, t)
17804
+ ), this.markerRegistry = new rh(
17805
+ th(this.engine, this.materialFactory)
17806
+ ), this.recordFactory = new lh(this.markerRegistry, this.overlayController), this.effectsController = new Tc(), this.interactionController = new Ic({
17807
17807
  engine: this.engine,
17808
17808
  rootGroup: this.rootGroup,
17809
17809
  records: this.records,
@@ -17904,7 +17904,7 @@ class hh {
17904
17904
  return this.update(e, { panel: n });
17905
17905
  }
17906
17906
  getData() {
17907
- return Array.from(this.records.values()).map((e) => rh(e));
17907
+ return Array.from(this.records.values()).map((e) => oh(e));
17908
17908
  }
17909
17909
  restoreData(e) {
17910
17910
  this.clear(), e.forEach((t) => this.add(t));
@@ -17922,7 +17922,7 @@ class hh {
17922
17922
  }
17923
17923
  removeInternal(e, t) {
17924
17924
  const i = this.records.get(e);
17925
- return i ? (this.interactionController.handleRecordRemoved(e), zc(i.instance.root), i.instance.root.removeFromParent(), i.panelElement?.remove(), i.markerElement?.remove(), this.records.delete(e), t && this.emit("annotation3d-removed", { id: e }), !0) : !1;
17925
+ return i ? (this.interactionController.handleRecordRemoved(e), Bc(i.instance.root), i.instance.root.removeFromParent(), i.panelElement?.remove(), i.markerElement?.remove(), this.records.delete(e), t && this.emit("annotation3d-removed", { id: e }), !0) : !1;
17926
17926
  }
17927
17927
  toEventPayload(e, t) {
17928
17928
  return { id: e.instance.id, annotation: e.instance, originalEvent: t };
@@ -18257,15 +18257,15 @@ class dt {
18257
18257
  return "x" in e ? new d(e.x, e.y, e.z) : new d(e.X, e.Y, e.Z);
18258
18258
  }
18259
18259
  }
18260
- const dh = 1e-3, uh = 0.65, ph = 1;
18261
- class mh {
18260
+ const hh = 1e-3, dh = 0.65, uh = 1;
18261
+ class ph {
18262
18262
  engine;
18263
18263
  loader;
18264
18264
  dracoLoader;
18265
18265
  dracoDecoderPath;
18266
18266
  modelList = /* @__PURE__ */ new Map();
18267
18267
  modelTransforms = [];
18268
- animationTimer = new Gn();
18268
+ animationTimer = new Wn();
18269
18269
  transformControl = null;
18270
18270
  transformHelper = null;
18271
18271
  selectedModelId = null;
@@ -18423,13 +18423,13 @@ class mh {
18423
18423
  const l = t ? `“${t}”` : "默认动画";
18424
18424
  throw new Error(`播放模型动画失败:模型 “${e}” 不存在${l}。`);
18425
18425
  }
18426
- (i.stopOthers ?? !0) && this.stopAnimation(e), n.mixer || (n.mixer = new qn(n.object), n.mixer.addEventListener("finished", (l) => {
18426
+ (i.stopOthers ?? !0) && this.stopAnimation(e), n.mixer || (n.mixer = new Gn(n.object), n.mixer.addEventListener("finished", (l) => {
18427
18427
  n.actions.forEach((c, h) => {
18428
18428
  c === l.action && n.actions.delete(h);
18429
18429
  });
18430
18430
  }));
18431
18431
  const o = n.mixer.clipAction(s);
18432
- o.reset(), o.enabled = !0, o.clampWhenFinished = i.clampWhenFinished ?? !1, o.setEffectiveTimeScale(i.timeScale ?? 1), i.loop ?? !0 ? o.setLoop(bo, i.repetitions ?? 1 / 0) : o.setLoop(Co, i.repetitions ?? 1);
18432
+ o.reset(), o.enabled = !0, o.clampWhenFinished = i.clampWhenFinished ?? !1, o.setEffectiveTimeScale(i.timeScale ?? 1), i.loop ?? !0 ? o.setLoop(wo, i.repetitions ?? 1 / 0) : o.setLoop(bo, i.repetitions ?? 1);
18433
18433
  const r = i.fadeIn ?? 0;
18434
18434
  return r > 0 && o.fadeIn(r), o.play(), n.actions.set(s.name, o), this.animationTimer.reset(), this.requestRender(), { name: s.name, duration: s.duration };
18435
18435
  }
@@ -18522,7 +18522,7 @@ class mh {
18522
18522
  }
18523
18523
  /** 创建独立解码器实例,便于管理器销毁或切换资源目录时释放 worker。 */
18524
18524
  createDracoLoader(e) {
18525
- const t = new $n();
18525
+ const t = new Qn();
18526
18526
  return t.setDecoderPath(e), t;
18527
18527
  }
18528
18528
  resolveDracoDecoderPath(e) {
@@ -18570,7 +18570,7 @@ class mh {
18570
18570
  }
18571
18571
  /** 透视相机使用更小的屏幕尺寸系数,正交相机维持原有尺寸。 */
18572
18572
  syncTransformControlCamera() {
18573
- !this.transformControl || !this.engine.camera || (this.transformControl.camera = this.engine.camera, this.transformControl.size = this.engine.camera.isPerspectiveCamera ? uh : ph);
18573
+ !this.transformControl || !this.engine.camera || (this.transformControl.camera = this.engine.camera, this.transformControl.size = this.engine.camera.isPerspectiveCamera ? dh : uh);
18574
18574
  }
18575
18575
  /** 使用引擎统一的捕捉器等待用户单击,并在取消或完成后恢复常规交互。 */
18576
18576
  pickPlacementPoint(e, t) {
@@ -18609,7 +18609,7 @@ class mh {
18609
18609
  const i = t.clone(), n = e?.normal ?? e?.face?.normal;
18610
18610
  if (n == null) return { position: i, normal: null };
18611
18611
  const s = n.clone(), o = e?.matrix ?? e?.object?.matrixWorld;
18612
- return o && s.transformDirection(o), s.lengthSq() < 1e-10 ? { position: i, normal: null } : (s.normalize(), i.addScaledVector(s, dh), { position: i, normal: s });
18612
+ return o && s.transformDirection(o), s.lengthSq() < 1e-10 ? { position: i, normal: null } : (s.normalize(), i.addScaledVector(s, hh), { position: i, normal: s });
18613
18613
  }
18614
18614
  handlePointerDown(e) {
18615
18615
  if (!(!this.editingEnabled || !this.engine.camera || !this.engine.renderer)) {
@@ -18767,7 +18767,7 @@ class vi extends Error {
18767
18767
  super("模型对比已取消"), this.name = "ModelComparisonCancelledError";
18768
18768
  }
18769
18769
  }
18770
- class gh {
18770
+ class mh {
18771
18771
  constructor(e) {
18772
18772
  this.engine = e;
18773
18773
  }
@@ -19205,8 +19205,8 @@ class gh {
19205
19205
  });
19206
19206
  }
19207
19207
  }
19208
- const Nn = "__modelExplodeProxy", Hn = new H().makeScale(0, 0, 0);
19209
- class fh {
19208
+ const Fn = "__modelExplodeProxy", Nn = new H().makeScale(0, 0, 0);
19209
+ class gh {
19210
19210
  engine;
19211
19211
  /** 当前是否处于炸开模式;供外部滑块、交互模块判断是否需要走代理逻辑。 */
19212
19212
  active = !1;
@@ -19347,7 +19347,7 @@ class fh {
19347
19347
  * 从命中的代理对象还原真实构件 ID,避免 Object3D.name 字符串化造成 nodesMap 查询失败。
19348
19348
  */
19349
19349
  getObjectComponentId(e) {
19350
- return e?.userData?.[Nn] === !0 ? e.userData.componentId : null;
19350
+ return e?.userData?.[Fn] === !0 ? e.userData.componentId : null;
19351
19351
  }
19352
19352
  /**
19353
19353
  * 返回炸开后用于悬浮高亮的代理网格。
@@ -19501,7 +19501,7 @@ class fh {
19501
19501
  }
19502
19502
  /** 给代理对象写入稳定交互身份,避免依赖 name 的字符串化 id。 */
19503
19503
  assignProxyIdentity(e, t, i) {
19504
- e.url = t, e.name = String(i), e.userData[Nn] = !0, e.userData.componentId = i, e.userData.url = t;
19504
+ e.url = t, e.name = String(i), e.userData[Fn] = !0, e.userData.componentId = i, e.userData.url = t;
19505
19505
  }
19506
19506
  /**
19507
19507
  * 隐藏源渲染片段,避免与代理对象重复显示。
@@ -19509,7 +19509,7 @@ class fh {
19509
19509
  */
19510
19510
  hideSource(e) {
19511
19511
  if (e.kind === "instance") {
19512
- e.sourceMesh.setMatrixAt(e.subIndex, Hn), e.sourceMesh.instanceMatrix.needsUpdate = !0;
19512
+ e.sourceMesh.setMatrixAt(e.subIndex, Nn), e.sourceMesh.instanceMatrix.needsUpdate = !0;
19513
19513
  return;
19514
19514
  }
19515
19515
  this.ensureSplitState(e);
@@ -19529,7 +19529,7 @@ class fh {
19529
19529
  */
19530
19530
  restoreSource(e) {
19531
19531
  if (e.kind === "instance") {
19532
- const s = this.shouldKeepOriginalInstanceHidden(e) ? Hn : e.originalMatrix;
19532
+ const s = this.shouldKeepOriginalInstanceHidden(e) ? Nn : e.originalMatrix;
19533
19533
  s instanceof H && (e.sourceMesh.setMatrixAt(e.subIndex, s), e.sourceMesh.instanceMatrix.needsUpdate = !0);
19534
19534
  return;
19535
19535
  }
@@ -19733,7 +19733,7 @@ class fh {
19733
19733
  return Math.abs(i);
19734
19734
  }
19735
19735
  }
19736
- const Vn = "bim-material-editor-style", st = [
19736
+ const Hn = "bim-material-editor-style", st = [
19737
19737
  "map",
19738
19738
  "normalMap",
19739
19739
  "roughnessMap",
@@ -19752,7 +19752,7 @@ const Vn = "bim-material-editor-style", st = [
19752
19752
  bumpMap: "凹凸贴图",
19753
19753
  emissiveMap: "自发光贴图"
19754
19754
  };
19755
- class yh {
19755
+ class fh {
19756
19756
  constructor(e) {
19757
19757
  this.engine = e;
19758
19758
  }
@@ -19838,7 +19838,7 @@ function si(a) {
19838
19838
  function xi(a) {
19839
19839
  return a.map((e) => e.name || e.url || e.type || e.uuid).filter((e, t, i) => e.length > 0 && i.indexOf(e) === t);
19840
19840
  }
19841
- function Ns(a) {
19841
+ function Fs(a) {
19842
19842
  const e = {
19843
19843
  name: a.name,
19844
19844
  opacity: a.opacity,
@@ -19858,7 +19858,7 @@ function Ns(a) {
19858
19858
  function yt(a) {
19859
19859
  return a instanceof Ie ? si(a) || a.uuid : a;
19860
19860
  }
19861
- function Mh(a) {
19861
+ function yh(a) {
19862
19862
  const e = a, t = {
19863
19863
  type: a.type,
19864
19864
  name: a.name || a.type,
@@ -19874,8 +19874,8 @@ function Mh(a) {
19874
19874
  i in e && (t[i] = yt(e[i]) ?? null);
19875
19875
  }), JSON.stringify(t);
19876
19876
  }
19877
- function vh(a, e) {
19878
- const t = Ns(a), i = {};
19877
+ function Mh(a, e) {
19878
+ const t = Fs(a), i = {};
19879
19879
  return Object.entries(e.values).forEach(([n, s]) => {
19880
19880
  const o = t[n];
19881
19881
  yt(s) !== yt(o) && (i[n] = {
@@ -19884,7 +19884,7 @@ function vh(a, e) {
19884
19884
  });
19885
19885
  }), i;
19886
19886
  }
19887
- function Hs(a, e, t) {
19887
+ function Ns(a, e, t) {
19888
19888
  const i = a;
19889
19889
  if ((e === "color" || e === "emissive") && i[e] instanceof xe && typeof t == "string") {
19890
19890
  i[e].set(t);
@@ -19919,7 +19919,7 @@ function qt(a) {
19919
19919
  }))
19920
19920
  };
19921
19921
  }
19922
- class xh {
19922
+ class vh {
19923
19923
  constructor(e, t) {
19924
19924
  this.engine = e, this.host = t;
19925
19925
  }
@@ -20073,7 +20073,7 @@ class xh {
20073
20073
  createSideSelect(e, t) {
20074
20074
  const i = this.createElement("div", "bim-material-editor__row"), n = document.createElement("select");
20075
20075
  return [
20076
- { label: "正面", value: Eo },
20076
+ { label: "正面", value: Co },
20077
20077
  { label: "背面", value: Oi },
20078
20078
  { label: "双面", value: re }
20079
20079
  ].forEach((s) => {
@@ -20090,10 +20090,10 @@ class xh {
20090
20090
  return t && (n.className = t), i && (n.textContent = i), n;
20091
20091
  }
20092
20092
  ensureStyle() {
20093
- if (document.getElementById(Vn) != null)
20093
+ if (document.getElementById(Hn) != null)
20094
20094
  return;
20095
20095
  const e = document.createElement("style");
20096
- e.id = Vn, e.textContent = `
20096
+ e.id = Hn, e.textContent = `
20097
20097
  .bim-material-editor{position:absolute;right:0;top:0;bottom:0;z-index:1005;height:100%;max-height:100%;display:grid;grid-template-rows:auto auto auto auto minmax(0,1fr) auto;gap:8px;padding:12px;background:#f7f9fc;color:#1b2430;border-left:1px solid #d7dde8;box-shadow:-8px 0 24px rgba(20,30,45,.16);font:13px/1.4 Arial,"Microsoft YaHei",sans-serif;box-sizing:border-box;overflow:hidden}
20098
20098
  .bim-material-editor *{box-sizing:border-box}
20099
20099
  .bim-material-editor__header{display:flex;align-items:center;justify-content:space-between;gap:8px}
@@ -20126,7 +20126,7 @@ class xh {
20126
20126
  `, document.head.appendChild(e);
20127
20127
  }
20128
20128
  }
20129
- class wh {
20129
+ class xh {
20130
20130
  constructor(e) {
20131
20131
  this.collectSceneMaterials = e;
20132
20132
  }
@@ -20147,7 +20147,7 @@ class wh {
20147
20147
  name: e.name,
20148
20148
  type: e.type,
20149
20149
  objectNames: xi(t),
20150
- values: Ns(e)
20150
+ values: Fs(e)
20151
20151
  });
20152
20152
  }
20153
20153
  getModifiedMaterials() {
@@ -20157,7 +20157,7 @@ class wh {
20157
20157
  const i = this.baselineSnapshots.get(t.material.uuid);
20158
20158
  if (i == null)
20159
20159
  return;
20160
- const n = vh(t.material, i);
20160
+ const n = Mh(t.material, i);
20161
20161
  Object.keys(n).length !== 0 && e.push({
20162
20162
  id: t.material.uuid,
20163
20163
  name: t.material.name || i.name,
@@ -20170,17 +20170,17 @@ class wh {
20170
20170
  restore(e) {
20171
20171
  const t = this.baselineSnapshots.get(e.uuid);
20172
20172
  return t == null ? !1 : (Object.entries(t.values).forEach(([i, n]) => {
20173
- Hs(e, i, n);
20173
+ Ns(e, i, n);
20174
20174
  }), e.needsUpdate = !0, !0);
20175
20175
  }
20176
20176
  }
20177
- class bh {
20177
+ class wh {
20178
20178
  constructor(e, t = {}) {
20179
20179
  this.engine = e, this.options = {
20180
20180
  visible: t.visible ?? !1,
20181
20181
  title: t.title ?? "材质编辑器",
20182
20182
  width: t.width ?? 340
20183
- }, this.visible = this.options.visible, this.collector = new yh(e), this.snapshots = new wh(() => this.collectSceneMaterials()), this.panel = new xh(e, this);
20183
+ }, this.visible = this.options.visible, this.collector = new fh(e), this.snapshots = new xh(() => this.collectSceneMaterials()), this.panel = new vh(e, this);
20184
20184
  }
20185
20185
  options;
20186
20186
  selectedMaterials = [];
@@ -20263,7 +20263,7 @@ class bh {
20263
20263
  const i = this.findMaterialGroupById(e);
20264
20264
  i.length !== 0 && (i.forEach((n) => {
20265
20265
  this.snapshots.ensure(n, this.collector.findOwners(n)), Object.entries(t).forEach(([s, o]) => {
20266
- Hs(n, s, o);
20266
+ Ns(n, s, o);
20267
20267
  }), n.needsUpdate = !0;
20268
20268
  }), this.requestRender(), this.render());
20269
20269
  }
@@ -20322,7 +20322,7 @@ class bh {
20322
20322
  dedupeMaterials(e) {
20323
20323
  const t = /* @__PURE__ */ new Map();
20324
20324
  return e.forEach((i) => {
20325
- const n = Mh(i.material), s = t.get(n);
20325
+ const n = yh(i.material), s = t.get(n);
20326
20326
  if (s == null) {
20327
20327
  t.set(n, { material: i.material, materials: [i.material], owners: [...i.owners] });
20328
20328
  return;
@@ -20348,7 +20348,7 @@ class bh {
20348
20348
  }
20349
20349
  replaceTexture(e, t, i) {
20350
20350
  const n = e, s = n[t];
20351
- s != null && this.ownedTextures.has(s) && (s.dispose(), this.ownedTextures.delete(s)), i != null && (i.colorSpace = t === "map" || t === "emissiveMap" ? We : Ao, i.wrapS = pt, i.wrapT = pt, i.needsUpdate = !0, this.ownedTextures.add(i)), n[t] = i, e.needsUpdate = !0, this.requestRender();
20351
+ s != null && this.ownedTextures.has(s) && (s.dispose(), this.ownedTextures.delete(s)), i != null && (i.colorSpace = t === "map" || t === "emissiveMap" ? We : Eo, i.wrapS = pt, i.wrapT = pt, i.needsUpdate = !0, this.ownedTextures.add(i)), n[t] = i, e.needsUpdate = !0, this.requestRender();
20352
20352
  }
20353
20353
  loadTexture(e) {
20354
20354
  return new Promise((t, i) => {
@@ -20362,7 +20362,7 @@ class bh {
20362
20362
  this.ownedTextures.forEach((e) => e.dispose()), this.ownedTextures.clear();
20363
20363
  }
20364
20364
  }
20365
- class Ch {
20365
+ class bh {
20366
20366
  engine;
20367
20367
  codeMap = [];
20368
20368
  continusIds = /* @__PURE__ */ new Map();
@@ -20463,16 +20463,16 @@ const Kt = {
20463
20463
  sampleCount: 64,
20464
20464
  roundedRadius: 1,
20465
20465
  historyLimit: 100
20466
- }, Eh = {
20466
+ }, Ch = {
20467
20467
  bezier: "贝塞尔曲线",
20468
20468
  straight: "直线",
20469
20469
  rounded: "圆角直线"
20470
- }, Ah = {
20470
+ }, Eh = {
20471
20471
  bezier: "∿",
20472
20472
  straight: "╱",
20473
20473
  rounded: "⌁"
20474
20474
  };
20475
- class Sh {
20475
+ class Ah {
20476
20476
  type = "path-draw";
20477
20477
  engine;
20478
20478
  root = new pe();
@@ -20706,10 +20706,10 @@ class Sh {
20706
20706
  }
20707
20707
  /** 使用 Line2 保证 WebGL 环境下的像素线宽真实生效。 */
20708
20708
  updateLineObject(e, t, i) {
20709
- const n = new So();
20709
+ const n = new Ao();
20710
20710
  if (n.setPositions(t.flatMap((r) => [r.x, r.y, r.z])), e)
20711
20711
  return e.geometry.dispose(), e.geometry = n, e.computeLineDistances(), this.syncLineResolution(e), this.requestRender(), e;
20712
- const s = new Po({
20712
+ const s = new So({
20713
20713
  color: i ? this.options.previewColor : this.options.lineColor,
20714
20714
  linewidth: this.options.lineWidth,
20715
20715
  dashed: i,
@@ -20718,7 +20718,7 @@ class Sh {
20718
20718
  depthTest: !1,
20719
20719
  transparent: i,
20720
20720
  opacity: i ? 0.82 : 1
20721
- }), o = new To(n, s);
20721
+ }), o = new Po(n, s);
20722
20722
  return o.name = i ? "PathDrawPreviewLine" : "PathDrawLine", o.renderOrder = i ? 1001 : 1e3, o.computeLineDistances(), this.syncLineResolution(o), this.root.add(o), this.requestRender(), o;
20723
20723
  }
20724
20724
  syncLineResolution(e) {
@@ -20838,7 +20838,7 @@ class Sh {
20838
20838
  t.append(i, n, s), e.appendChild(t), this.statusElement = n;
20839
20839
  const o = document.createElement("div");
20840
20840
  Object.assign(o.style, { display: "grid", gridTemplateColumns: "repeat(3, 1fr)", gap: "4px", padding: "8px" }), ["bezier", "straight", "rounded"].forEach((x) => {
20841
- const m = this.createIconButton(Ah[x], Eh[x], () => this.setLineType(x));
20841
+ const m = this.createIconButton(Eh[x], Ch[x], () => this.setLineType(x));
20842
20842
  m.dataset.lineType = x, m.style.width = "100%", m.style.fontSize = "18px", o.appendChild(m);
20843
20843
  }), e.appendChild(o);
20844
20844
  const r = document.createElement("label");
@@ -20956,7 +20956,7 @@ class Sh {
20956
20956
  return { x: e.x, y: e.y, z: e.z };
20957
20957
  }
20958
20958
  }
20959
- class Ph {
20959
+ class Sh {
20960
20960
  engine;
20961
20961
  continusIds = /* @__PURE__ */ new Map();
20962
20962
  constructor(e) {
@@ -21015,9 +21015,23 @@ class Ph {
21015
21015
  });
21016
21016
  }
21017
21017
  }
21018
- class kh {
21018
+ const Ph = Object.freeze({
21019
+ maxTextureSize: 1024,
21020
+ samples: 0
21021
+ }), Th = Object.freeze({
21022
+ maxTextureSize: 2048,
21023
+ samples: 2
21024
+ }), Ih = Object.freeze({
21025
+ maxTextureSize: 4096,
21026
+ samples: 4
21027
+ });
21028
+ function _h(a) {
21029
+ return typeof a != "number" || !Number.isFinite(a) || a <= 4 ? Ph : a <= 6 ? Th : Ih;
21030
+ }
21031
+ class zh {
21019
21032
  // 引擎参数
21020
21033
  options;
21034
+ mobileMemoryProfile;
21021
21035
  deviceType;
21022
21036
  animationId = null;
21023
21037
  isDisposed = !1;
@@ -21131,22 +21145,22 @@ class kh {
21131
21145
  // 业务数据
21132
21146
  models = [];
21133
21147
  reactBoundingClientRect = { left: 0, top: 0 };
21134
- version = Lo;
21148
+ version = ko;
21135
21149
  versionEl = null;
21136
21150
  // 引擎容器
21137
21151
  container;
21138
21152
  constructor(e) {
21139
- if (window.THREE = Un, dr(), this.options = e, this.container = document.getElementById(e.containerId), !this.container)
21153
+ if (window.THREE = Vn, hr(), this.options = e, this.mobileMemoryProfile = _h(e.limit_memory), this.container = document.getElementById(e.containerId), !this.container)
21140
21154
  throw new Error(`Container ${e.containerId} not found`);
21141
- if (this.rxQuotaListMapper = new Ch(this), this.filterLoaderModel = new Ph(this), this.engineModelModule = new Wa(this), this.engineModelModule.init(), this.deviceModule = new Uo(this), this.deviceType = this.deviceModule.getDeviceType(), this.cameraModule = new ie(this), this.sceneModule = new Vo(this), this.scene = this.sceneModule.scene, this.renderModule = new Wo(this), this.renderer = this.renderModule.createRenderer(), this.camera = this.cameraModule.perspectiveCamera, this.scene.camera = this.camera, this.renderer) {
21155
+ if (this.rxQuotaListMapper = new bh(this), this.filterLoaderModel = new Sh(this), this.engineModelModule = new Ua(this), this.engineModelModule.init(), this.deviceModule = new Vo(this), this.deviceType = this.deviceModule.getDeviceType(), this.cameraModule = new ie(this), this.sceneModule = new Ho(this), this.scene = this.sceneModule.scene, this.renderModule = new Uo(this), this.renderer = this.renderModule.createRenderer(), this.camera = this.cameraModule.perspectiveCamera, this.scene.camera = this.camera, this.renderer) {
21142
21156
  const o = this.renderer;
21143
21157
  o.interactionCullingEnabled = !0, o.interactionActive = !1, o.interactionRenderScene = this.scene, o.interactionFrameBudgetMs = this.options.interactionFrameBudgetMs ?? 6, o.interactionSkipShadows = this.options.interactionSkipShadows ?? !0;
21144
21158
  }
21145
- this.controlModule = new ir(this), this.controlModule.switchDefaultMode(), this.controls = this.controlModule.orbitControls, this.clipping = new _l(this), this.clipping.init(), this.composerModule = new sr(this), this.composerModule.init(), this.events = new ya();
21159
+ this.controlModule = new tr(this), this.controlModule.switchDefaultMode(), this.controls = this.controlModule.orbitControls, this.clipping = new Il(this), this.clipping.init(), this.composerModule = new nr(this), this.composerModule.init(), this.events = new fa();
21146
21160
  const t = this.events.trigger.bind(this.events);
21147
21161
  this.events.trigger = ((o, r) => {
21148
21162
  t(o, r), String(o) !== String(ne.EngineBusy) && this.requestComposerRender();
21149
- }), this.engineStatus = new fa(this), this.engineStatus.init(), this.loaderModule = new ve(this), this.lightModule = new Oa(this), this.lightModule.init(), this.viewCube = new ja(this), this.viewCube.init(), this.options.showViewCube == !1 && this.viewCube.hide(), this.octreeBox = Ya(this), this.rangeScale = new Xa(this), this.rangeScale.init(), this.setting = new fl(this), this.engineModelModule.init(), this.handelBehaved = Gi(this), this.modelMapperBatch = new Ol(this), this.measure = new Al(this), this.modelToolModule = new Na(this), this.modelLink3d = new Pc(this, this.options.linkOptions ?? {}), this.modelLink3d.init(), this.modelProperties = new Ll(this), this.search = new Rl(this), this.interactionModule = new Fa(this), this.interactionModule.init(), this.interactionModule.active(), this.hoverHighLight = new ni(this), this.modelEdge = new ml(this), this.nodeBox = new Hl(this), this.modelTree = new Dl(this), this.viewTree = new Ki(this), this.merge2d = new lc(this), this.engineInfo = new kl(this), this.pathRoaming = new Gl(this), this.pathRoaming.init(), this.oneClickEncoding = new Ql(this), this.minMap = new ql(this), this.linkElement2d3d = new Yl(this), this.linkView2d3d = new Xl(this), this.grid = new Za(this), this.level = new sl(this), this.issueReport = new Kl(this), this.fabricDraw = new Ec(this), this.drawingPin = new Ac(this), this.label = new Tc(this), this.annotation3d = new hh(this), this.calibration = new dt(this), this.modelPlace = new mh(this), this.modelComparison = new gh(this), this.modelExplode = new fh(this), this.materialTool = new bh(this, this.options.materialEditorOptions ?? {}), this.materialTool.init(), this.pathDraw = new Sh(this), this.text = new jl(this), this.hdr = new tl(this), this.ground = new qi(this), this.ground.init(), this.skyManager = new gl(this), this.setting.init(), this.worldToScreen = new fe(this.camera, this.renderer, this.scene), this.options.showStats && (this.stats = new Ho(), this.stats.showPanel(0), this.stats.dom.style.position = "absolute", this.stats.dom.style.top = "0px", this.stats.dom.style.left = "0px", this.stats.dom.style.zIndex = "1000", this.container.appendChild(this.stats.dom));
21163
+ }), this.engineStatus = new ga(this), this.engineStatus.init(), this.loaderModule = new ve(this), this.lightModule = new Ra(this), this.lightModule.init(), this.viewCube = new Ka(this), this.viewCube.init(), this.options.showViewCube == !1 && this.viewCube.hide(), this.octreeBox = ja(this), this.rangeScale = new Ya(this), this.rangeScale.init(), this.setting = new gl(this), this.engineModelModule.init(), this.handelBehaved = Gi(this), this.modelMapperBatch = new Rl(this), this.measure = new El(this), this.modelToolModule = new Fa(this), this.modelLink3d = new Sc(this, this.options.linkOptions ?? {}), this.modelLink3d.init(), this.modelProperties = new kl(this), this.search = new zl(this), this.interactionModule = new Oa(this), this.interactionModule.init(), this.interactionModule.active(), this.hoverHighLight = new ni(this), this.modelEdge = new pl(this), this.nodeBox = new Nl(this), this.modelTree = new _l(this), this.viewTree = new Ki(this), this.merge2d = new ac(this), this.engineInfo = new Dl(this), this.pathRoaming = new Wl(this), this.pathRoaming.init(), this.oneClickEncoding = new Xl(this), this.minMap = new Gl(this), this.linkElement2d3d = new jl(this), this.linkView2d3d = new Yl(this), this.grid = new $a(this), this.level = new nl(this), this.issueReport = new ql(this), this.fabricDraw = new Cc(this), this.drawingPin = new Ec(this), this.label = new Pc(this), this.annotation3d = new ch(this), this.calibration = new dt(this), this.modelPlace = new ph(this), this.modelComparison = new mh(this), this.modelExplode = new gh(this), this.materialTool = new wh(this, this.options.materialEditorOptions ?? {}), this.materialTool.init(), this.pathDraw = new Ah(this), this.text = new Kl(this), this.hdr = new el(this), this.ground = new qi(this), this.ground.init(), this.skyManager = new ml(this), this.setting.init(), this.worldToScreen = new fe(this.camera, this.renderer, this.scene), this.options.showStats && (this.stats = new No(), this.stats.showPanel(0), this.stats.dom.style.position = "absolute", this.stats.dom.style.top = "0px", this.stats.dom.style.left = "0px", this.stats.dom.style.zIndex = "1000", this.container.appendChild(this.stats.dom));
21150
21164
  let i = document.createElement("div");
21151
21165
  i.className = "versionText", this.versionEl = i, this.updateVersionDisplay(), this.container.appendChild(i);
21152
21166
  let n = document.createElementNS("http://www.w3.org/2000/svg", "svg");
@@ -21262,7 +21276,7 @@ class kh {
21262
21276
  * 解析得到多个模型地址时,共用同一份加载选项,包括是否加载边线。
21263
21277
  */
21264
21278
  async loadModelByViewToken(e, t) {
21265
- const i = await Bo(
21279
+ const i = await Lo(
21266
21280
  this.options,
21267
21281
  e,
21268
21282
  "3d"
@@ -21372,7 +21386,7 @@ class kh {
21372
21386
  const i = this.getViewportSize(e, t);
21373
21387
  e = i.width, t = i.height;
21374
21388
  const n = this.camera.position.clone(), s = this.camera.quaternion.clone(), o = this.camera.up.clone(), r = this.controls?.target?.clone?.(), l = this.controlModule?.orbitControls?.origin?.clone?.();
21375
- this.renderer.setPixelRatio(es(this)), this.renderer.setSize(e, t, !1);
21389
+ this.renderer.setPixelRatio(Jn(this)), this.renderer.setSize(e, t, !1);
21376
21390
  const c = this.renderer.domElement.clientWidth || e, h = this.renderer.domElement.clientHeight || t;
21377
21391
  if (!c || !h)
21378
21392
  return;
@@ -21439,7 +21453,7 @@ class kh {
21439
21453
  if (!e) return;
21440
21454
  [...e.children].forEach((i) => {
21441
21455
  this.clearScene(i);
21442
- }), e.parent && e.parent.remove(e), e instanceof z && !(e instanceof V) && (e.geometry && e.geometry.dispose(), e.material && (Array.isArray(e.material) ? e.material.forEach((i) => this.disposeMaterial(i)) : this.disposeMaterial(e.material))), e instanceof Lt && (e.geometry && e.geometry.dispose(), e.material && this.disposeMaterial(e.material)), e instanceof Io && (e.geometry && e.geometry.dispose(), e.material && this.disposeMaterial(e.material)), e instanceof V && (e.geometry && e.geometry.dispose(), e.material && (Array.isArray(e.material) ? e.material.forEach((i) => this.disposeMaterial(i)) : this.disposeMaterial(e.material)), e.instanceMatrix && (e.instanceMatrix = null), e.instanceColor && (e.instanceColor = null)), e instanceof wi && e.material && this.disposeMaterial(e.material), e instanceof _o && e.shadow?.dispose?.();
21456
+ }), e.parent && e.parent.remove(e), e instanceof z && !(e instanceof V) && (e.geometry && e.geometry.dispose(), e.material && (Array.isArray(e.material) ? e.material.forEach((i) => this.disposeMaterial(i)) : this.disposeMaterial(e.material))), e instanceof Lt && (e.geometry && e.geometry.dispose(), e.material && this.disposeMaterial(e.material)), e instanceof To && (e.geometry && e.geometry.dispose(), e.material && this.disposeMaterial(e.material)), e instanceof V && (e.geometry && e.geometry.dispose(), e.material && (Array.isArray(e.material) ? e.material.forEach((i) => this.disposeMaterial(i)) : this.disposeMaterial(e.material)), e.instanceMatrix && (e.instanceMatrix = null), e.instanceColor && (e.instanceColor = null)), e instanceof wi && e.material && this.disposeMaterial(e.material), e instanceof Io && e.shadow?.dispose?.();
21443
21457
  }
21444
21458
  /**
21445
21459
  * 清理材质及其纹理
@@ -21494,6 +21508,6 @@ class kh {
21494
21508
  }
21495
21509
  }
21496
21510
  export {
21497
- kh as E,
21498
- bh as M
21511
+ zh as E,
21512
+ wh as M
21499
21513
  };