@realsee/dnalogel 3.77.4 → 3.77.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/CHANGELOG.md +20 -11
  2. package/dist/DigitalPerformancePlugin/controller/index.d.ts +224 -0
  3. package/dist/DigitalPerformancePlugin/core/DigitalHuman.d.ts +55 -0
  4. package/dist/DigitalPerformancePlugin/core/DigitalPlayground.d.ts +40 -0
  5. package/dist/DigitalPerformancePlugin/core/DigitalStateMachine.d.ts +150 -0
  6. package/dist/DigitalPerformancePlugin/core/Trace.d.ts +9 -0
  7. package/dist/DigitalPerformancePlugin/index.d.ts +11 -0
  8. package/dist/DigitalPerformancePlugin/mock.d.ts +76 -0
  9. package/dist/DigitalPerformancePlugin/typings/index.d.ts +79 -0
  10. package/dist/PanoTagPlugin/controller/Tag/BaseTag.d.ts +5 -1
  11. package/dist/PanoTagPlugin/controller/Tag/BoxTag.d.ts +119 -0
  12. package/dist/PanoTagPlugin/controller/Tag/MaskTag.d.ts +257 -0
  13. package/dist/PanoTagPlugin/controller/Tag/MaskTag.shaders.d.ts +10 -0
  14. package/dist/PanoTagPlugin/controller/Tag/PolygonTag.d.ts +112 -0
  15. package/dist/PanoTagPlugin/controller/TagRender.d.ts +1 -1
  16. package/dist/PanoTagPlugin/controller/index.d.ts +55 -2
  17. package/dist/PanoTagPlugin/typings/controller.d.ts +10 -0
  18. package/dist/PanoTagPlugin/typings/tag/Tag.d.ts +8 -3
  19. package/dist/PanoTagPlugin/typings/tag/Utils.d.ts +50 -1
  20. package/dist/PanoTagPlugin/utils/sculptDataToBoxPosition.d.ts +6 -0
  21. package/dist/PanoTagPlugin/utils/tag/tagCheck.d.ts +6 -0
  22. package/dist/PanoTagPlugin/utils/tagPosition.d.ts +12 -3
  23. package/dist/index.cjs.js +188 -92
  24. package/dist/index.d.ts +1 -0
  25. package/dist/index.js +17508 -14249
  26. package/dist/index.umd.js +184 -88
  27. package/libs/CruisePlugin/Move.js +7 -2
  28. package/libs/CruisePlugin/Work.js +7 -2
  29. package/libs/CruisePlugin/index.js +11 -6
  30. package/libs/DigitalPerformancePlugin/controller/index.d.ts +2 -2
  31. package/libs/DigitalPerformancePlugin/controller/index.js +164 -173
  32. package/libs/DigitalPerformancePlugin/core/DigitalHuman.d.ts +16 -6
  33. package/libs/DigitalPerformancePlugin/core/DigitalHuman.js +128 -102
  34. package/libs/DigitalPerformancePlugin/core/DigitalPlayground.d.ts +11 -5
  35. package/libs/DigitalPerformancePlugin/core/DigitalPlayground.js +84 -74
  36. package/libs/DigitalPerformancePlugin/core/DigitalStateMachine.d.ts +7 -0
  37. package/libs/DigitalPerformancePlugin/mock.d.ts +6 -0
  38. package/libs/DigitalPerformancePlugin/mock.js +272 -274
  39. package/libs/GuideLinePlugin/Controller.js +9 -4
  40. package/libs/GuideLinePlugin/GuideLineItem.js +7 -2
  41. package/libs/GuideLinePlugin/GuideLineModeItem.js +7 -2
  42. package/libs/GuideLinePlugin/index.js +11 -6
  43. package/libs/PanoTagPlugin/Components/TagItem.js +122 -122
  44. package/libs/PanoTagPlugin/controller/Tag/BaseTag.d.ts +5 -1
  45. package/libs/PanoTagPlugin/controller/Tag/BaseTag.js +320 -289
  46. package/libs/PanoTagPlugin/controller/Tag/BoxTag.d.ts +119 -0
  47. package/libs/PanoTagPlugin/controller/Tag/BoxTag.js +515 -0
  48. package/libs/PanoTagPlugin/controller/Tag/MaskTag.d.ts +257 -0
  49. package/libs/PanoTagPlugin/controller/Tag/MaskTag.js +815 -0
  50. package/libs/PanoTagPlugin/controller/Tag/MaskTag.shaders.d.ts +10 -0
  51. package/libs/PanoTagPlugin/controller/Tag/MaskTag.shaders.js +94 -0
  52. package/libs/PanoTagPlugin/controller/Tag/PolygonTag.d.ts +112 -0
  53. package/libs/PanoTagPlugin/controller/Tag/PolygonTag.js +478 -0
  54. package/libs/PanoTagPlugin/controller/TagRender.d.ts +1 -1
  55. package/libs/PanoTagPlugin/controller/TagUtil.js +19 -17
  56. package/libs/PanoTagPlugin/controller/index.d.ts +55 -2
  57. package/libs/PanoTagPlugin/controller/index.js +261 -148
  58. package/libs/PanoTagPlugin/index.js +16 -11
  59. package/libs/PanoTagPlugin/typings/controller.d.ts +10 -0
  60. package/libs/PanoTagPlugin/typings/tag/Tag.d.ts +8 -3
  61. package/libs/PanoTagPlugin/typings/tag/Utils.d.ts +50 -1
  62. package/libs/PanoTagPlugin/utils/addDebugPoints.js +27 -13
  63. package/libs/PanoTagPlugin/utils/index.js +29 -26
  64. package/libs/PanoTagPlugin/utils/sculptDataToBoxPosition.d.ts +6 -0
  65. package/libs/PanoTagPlugin/utils/sculptDataToBoxPosition.js +18 -0
  66. package/libs/PanoTagPlugin/utils/tag/tagCheck.d.ts +6 -0
  67. package/libs/PanoTagPlugin/utils/tag/tagCheck.js +26 -14
  68. package/libs/PanoTagPlugin/utils/tagPosition.d.ts +12 -3
  69. package/libs/PanoTagPlugin/utils/tagPosition.js +49 -16
  70. package/libs/base/BasePlugin.js +1 -1
  71. package/libs/index.d.ts +1 -0
  72. package/libs/index.js +166 -150
  73. package/libs/shared-utils/logger.js +1 -1
  74. package/package.json +2 -2
@@ -1,68 +1,71 @@
1
- var E = Object.defineProperty, U = Object.defineProperties;
1
+ var w = Object.defineProperty, F = Object.defineProperties;
2
2
  var _ = Object.getOwnPropertyDescriptors;
3
- var b = Object.getOwnPropertySymbols;
4
- var F = Object.prototype.hasOwnProperty, w = Object.prototype.propertyIsEnumerable;
5
- var g = (h, p, e) => p in h ? E(h, p, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[p] = e, f = (h, p) => {
3
+ var S = Object.getOwnPropertySymbols;
4
+ var L = Object.prototype.hasOwnProperty, B = Object.prototype.propertyIsEnumerable;
5
+ var b = (l, p, e) => p in l ? w(l, p, { enumerable: !0, configurable: !0, writable: !0, value: e }) : l[p] = e, g = (l, p) => {
6
6
  for (var e in p || (p = {}))
7
- F.call(p, e) && g(h, e, p[e]);
8
- if (b)
9
- for (var e of b(p))
10
- w.call(p, e) && g(h, e, p[e]);
11
- return h;
12
- }, c = (h, p) => U(h, _(p));
13
- var m = (h, p, e) => (g(h, typeof p != "symbol" ? p + "" : p, e), e);
14
- var d = (h, p, e) => new Promise((t, i) => {
15
- var o = (r) => {
7
+ L.call(p, e) && b(l, e, p[e]);
8
+ if (S)
9
+ for (var e of S(p))
10
+ B.call(p, e) && b(l, e, p[e]);
11
+ return l;
12
+ }, C = (l, p) => F(l, _(p));
13
+ var d = (l, p, e) => (b(l, typeof p != "symbol" ? p + "" : p, e), e);
14
+ var m = (l, p, e) => new Promise((t, i) => {
15
+ var o = (s) => {
16
16
  try {
17
- s(e.next(r));
18
- } catch (a) {
19
- i(a);
17
+ a(e.next(s));
18
+ } catch (r) {
19
+ i(r);
20
20
  }
21
- }, n = (r) => {
21
+ }, n = (s) => {
22
22
  try {
23
- s(e.throw(r));
24
- } catch (a) {
25
- i(a);
23
+ a(e.throw(s));
24
+ } catch (r) {
25
+ i(r);
26
26
  }
27
- }, s = (r) => r.done ? t(r.value) : Promise.resolve(r.value).then(o, n);
28
- s((e = e.apply(h, p)).next());
27
+ }, a = (s) => s.done ? t(s.value) : Promise.resolve(s.value).then(o, n);
28
+ a((e = e.apply(l, p)).next());
29
29
  });
30
- import * as u from "three";
31
- import { objectAssignDeepExports as l } from "../../vendor/object-assign-deep/objectAssignDeep.js";
32
- import { arrayPositionToVector3 as v } from "../../shared-utils/positionToVector3.js";
33
- import { isModelTag as k, isMediaModelTag as L } from "../utils/tag/tagCheck.js";
34
- import { debounce as y } from "../utils/debounce.js";
35
- import { throttle as I } from "../utils/throttle.js";
36
- import M, { getTagStickType as B } from "../utils/tag/format.js";
37
- import { generateBlankAudio as G, AudioNamespace as O } from "../../shared-utils/audio.js";
38
- import { resizeObserver as T } from "../../shared-utils/dom/resizeObserver.js";
39
- import { TagRender as R } from "./TagRender.js";
30
+ import * as P from "three";
31
+ import { objectAssignDeepExports as v } from "../../vendor/object-assign-deep/objectAssignDeep.js";
32
+ import { arrayPositionToVector3 as k } from "../../shared-utils/positionToVector3.js";
33
+ import { isModelTag as R, isMediaModelTag as G } from "../utils/tag/tagCheck.js";
34
+ import { debounce as D } from "../utils/debounce.js";
35
+ import { throttle as O } from "../utils/throttle.js";
36
+ import x, { getTagStickType as N } from "../utils/tag/format.js";
37
+ import { generateBlankAudio as V, AudioNamespace as z } from "../../shared-utils/audio.js";
38
+ import { resizeObserver as M } from "../../shared-utils/dom/resizeObserver.js";
39
+ import { TagRender as $ } from "./TagRender.js";
40
40
  import "../../shared-utils/tag.js";
41
- import { isModelLike as C } from "../../shared-utils/five/mode.js";
41
+ import { isModelLike as A } from "../../shared-utils/five/mode.js";
42
42
  import "../../vendor/hammerjs/hammer.js";
43
43
  import "../../shared-utils/three/PointSelector/index.js";
44
44
  import "../../shared-utils/three/CSS3DRenderer/index.js";
45
- import { waitFiveModelLoaded as N } from "../../shared-utils/five/fiveModelLoad.js";
45
+ import { waitFiveModelLoaded as j } from "../../shared-utils/five/fiveModelLoad.js";
46
46
  import "../../CSS3DRenderPlugin/utils/generateBehindFiveElement.js";
47
47
  import "@realsee/five/line";
48
48
  import "../../shared-utils/three/core/Five_LineMaterial2.js";
49
49
  import "../../shared-utils/three/core/Sphere.js";
50
50
  import "../../shared-utils/three/blink.js";
51
- import { getFiveModel as V } from "../../shared-utils/five/getFiveModel.js";
51
+ import { getFiveModel as Q } from "../../shared-utils/five/getFiveModel.js";
52
52
  import "../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
53
53
  import "../../CSS3DRenderPlugin/utils/three/CSS3DRender.js";
54
54
  import "../../vendor/earcut/src/earcut.js";
55
- import { nextFrame as z } from "../../shared-utils/animationFrame/index.js";
55
+ import { nextFrame as H } from "../../shared-utils/animationFrame/index.js";
56
56
  import "../../shared-utils/five/FivePuppet.js";
57
- import { DebugUtil as j } from "../utils/DebugUtil.js";
58
- import { safeObj as S } from "../../shared-utils/safeObj.js";
59
- import { PointTag as Q } from "./Tag/PointTag.js";
60
- import { ModelTag as $ } from "./Tag/ModelTag.js";
61
- import { PlaneTag as H } from "./Tag/PlaneTag.js";
62
- import x from "../Components/TagContainer.js";
63
- import { fiveEveryReadyListener as W } from "../../shared-utils/five/fiveEveryReadyListener.js";
64
- import { vector3ToArray as P } from "../../shared-utils/three/vector3ToArray.js";
65
- import { tweenProgress as q } from "../../shared-utils/animationFrame/BetterTween.js";
57
+ import { DebugUtil as W } from "../utils/DebugUtil.js";
58
+ import { safeObj as E } from "../../shared-utils/safeObj.js";
59
+ import { PointTag as q } from "./Tag/PointTag.js";
60
+ import { ModelTag as J } from "./Tag/ModelTag.js";
61
+ import { PlaneTag as Z } from "./Tag/PlaneTag.js";
62
+ import { BoxTag as Y } from "./Tag/BoxTag.js";
63
+ import { PolygonTag as K } from "./Tag/PolygonTag.js";
64
+ import { MaskTag as c } from "./Tag/MaskTag.js";
65
+ import X from "../Components/TagContainer.js";
66
+ import { fiveEveryReadyListener as ee } from "../../shared-utils/five/fiveEveryReadyListener.js";
67
+ import { vector3ToArray as U } from "../../shared-utils/three/vector3ToArray.js";
68
+ import { tweenProgress as te } from "../../shared-utils/animationFrame/BetterTween.js";
66
69
  import "../../shared-utils/url/defaultUrls.js";
67
70
  import "./TagUtil.js";
68
71
  import "../typings/tag/TagConfig.js";
@@ -313,6 +316,8 @@ import "../../Sculpt/Meshes/Box.js";
313
316
  import "../../shared-utils/forReverseEach.js";
314
317
  import "../../Sculpt/Objects/Line/index.js";
315
318
  import "../../shared-utils/five/getFloorMesh.js";
319
+ import "../utils/sculptDataToBoxPosition.js";
320
+ import "./Tag/MaskTag.shaders.js";
316
321
  import "../Components/TagItem.js";
317
322
  import "../Components/Common/TagPoint.js";
318
323
  import "../Components/Tag/AudioTag/AudioPoint.js";
@@ -329,35 +334,37 @@ import "../Components/Common/TagPopover/TagPopoverToolBar.js";
329
334
  import "../Components/Common/TagPopover/ArrowRightIcon.js";
330
335
  import "../Components/Common/TagPopover/ShareIcon.js";
331
336
  import "../utils/popoverContainer.js";
332
- const D = "Dnalogel-PanoTagPlugin", _s = (h) => `${D}--${h}`;
333
- class Fs extends R {
337
+ const I = "Dnalogel-PanoTagPlugin", Ns = (l) => `${I}--${l}`;
338
+ class Vs extends $ {
334
339
  constructor(e, t) {
335
340
  super(e);
336
341
  /** state */
337
- m(this, "state", { enabled: !0, visible: !0 });
342
+ d(this, "state", { enabled: !0, visible: !0 });
338
343
  /** debug */
339
- m(this, "debug");
340
- m(this, "debugUtil", new j(this));
344
+ d(this, "debug");
345
+ d(this, "debugUtil", new W(this));
341
346
  /** 全局 hover 启用状态,默认 true */
342
- m(this, "globalHoverEnabled", !0);
347
+ d(this, "globalHoverEnabled", !0);
343
348
  /** 更改 tag 模型 */
344
- m(this, "changeTagModel", (e, t) => d(this, null, function* () {
349
+ d(this, "changeTagModel", (e, t) => m(this, null, function* () {
345
350
  var i;
346
- e.data = l({}, e.data, t), yield (i = e.loadModel) == null ? void 0 : i.call(e);
351
+ e.data = v({}, e.data, t), yield (i = e.loadModel) == null ? void 0 : i.call(e);
347
352
  }));
348
- m(this, "handleFiveModeChange", (e) => {
353
+ d(this, "handleFiveModeChange", (e) => {
349
354
  const t = () => {
350
355
  this.filter2DPointTag.forEach((i) => {
351
356
  i.state.visible = !1, i.applyVisible();
352
357
  }), this.five.ready().then(() => {
353
358
  this.tagsDo(this.tags, (i) => {
354
- i.updateVisible(), L(i) && e !== "Panorama" && this.changeTagMode(i, "behind");
359
+ i.updateVisible(), G(i) && e !== "Panorama" && this.changeTagMode(i, "behind");
360
+ }), e === "Panorama" ? this.updateMaskTagsForCurrentPano() : this.filterMaskTag.forEach((i) => {
361
+ i.state.visible = !1, i.applyVisible();
355
362
  });
356
363
  });
357
364
  };
358
365
  this.tags.length < 500 ? t() : this.five.ready().then(() => t());
359
366
  });
360
- m(this, "handleFiveWantsMoveToPano", () => {
367
+ d(this, "handleFiveWantsMoveToPano", () => {
361
368
  if (this.tags.length > 500) {
362
369
  this.temporaryState.visible = !1, this.addRenderQueue({ type: "TagContainerSvelte", keys: ["temporaryState"] });
363
370
  return;
@@ -366,54 +373,54 @@ class Fs extends R {
366
373
  e.temporaryState.visible = !0;
367
374
  }), this.addRenderQueue({ type: "TagContainerSvelte", keys: ["tags"] }), this.tags.forEach((e) => e.applyVisible());
368
375
  });
369
- m(this, "clickhandler", (e) => {
376
+ d(this, "clickhandler", (e) => {
370
377
  e.tag.onClick(e);
371
378
  });
372
- m(this, "handleFiveCameraUpdate", () => {
379
+ d(this, "handleFiveCameraUpdate", () => {
373
380
  this.filterPointTag.forEach((e) => e.updateScreenPosition());
374
381
  });
375
- m(this, "handleFiveCameraFovUpdate", () => {
382
+ d(this, "handleFiveCameraFovUpdate", () => {
376
383
  this.handleFiveCameraUpdate(), this.five.off("render.prepare", this.handleFiveCameraUpdate), this.five.on("render.prepare", this.handleFiveCameraUpdate), setTimeout(() => {
377
384
  this.five.off("render.prepare", this.handleFiveCameraUpdate);
378
385
  }, 1e3);
379
386
  });
380
- m(this, "handleFivePanoArrived", () => d(this, null, function* () {
387
+ d(this, "handleFivePanoArrived", () => m(this, null, function* () {
381
388
  this.filter2DPointTag.forEach((e) => {
382
389
  e.state.visible = !1, e.applyVisible();
383
390
  }), this.tagsDo(this.tags, (e) => {
384
391
  e.updateVisible();
385
- }), this.temporaryState.visible = !0, this.addRenderQueue({ type: "TagContainerSvelte", keys: ["temporaryState"] }), yield this.setUnfolded(), this.tags.filter(k).filter((e) => {
392
+ }), this.updateMaskTagsForCurrentPano(), this.temporaryState.visible = !0, this.addRenderQueue({ type: "TagContainerSvelte", keys: ["temporaryState"] }), yield this.setUnfolded(), this.tags.filter(R).filter((e) => {
386
393
  var t;
387
394
  return (t = e.getConfig().modelConfig) == null ? void 0 : t.autoLookAtEnabled;
388
395
  }).forEach((e) => {
389
- var a;
390
- const t = new u.Mesh(new u.BoxGeometry(), new u.MeshBasicMaterial()), i = (a = e.model) == null ? void 0 : a.object;
396
+ var r;
397
+ const t = new P.Mesh(new P.BoxGeometry(), new P.MeshBasicMaterial()), i = (r = e.model) == null ? void 0 : r.object;
391
398
  if (!i)
392
399
  return;
393
400
  t.position.copy(i.position), t.quaternion.copy(i.quaternion);
394
401
  const o = this.five.camera.position;
395
402
  t.lookAt(o.clone().setY(t.position.y));
396
- const n = i.quaternion.clone(), s = t.quaternion.clone(), r = q();
397
- r.onUpdate(({ progress: A }) => {
398
- i.quaternion.copy(n.clone().slerp(s, A));
399
- }), r.play();
403
+ const n = i.quaternion.clone(), a = t.quaternion.clone(), s = te();
404
+ s.onUpdate(({ progress: h }) => {
405
+ i.quaternion.copy(n.clone().slerp(a, h));
406
+ }), s.play();
400
407
  });
401
408
  }));
402
409
  /** 楼层切换时,需要更新标签可见性 */
403
- m(this, "handleFiveModelShownFloorChange", () => {
410
+ d(this, "handleFiveModelShownFloorChange", () => {
404
411
  this.tagsDo(this.tags, (e) => e.updateVisible());
405
412
  });
406
- m(this, "onFiveRefined", y(() => {
407
- C(this.five.getCurrentState().mode) ? this.setUnfoldedByCamera() : this.tags.forEach((e) => e.cache.clear()), this.tagsDo(this.tags, (e) => e.updateVisible());
413
+ d(this, "onFiveRefined", D(() => {
414
+ A(this.five.getCurrentState().mode) ? this.setUnfoldedByCamera() : this.tags.forEach((e) => e.cache.clear()), this.tagsDo(this.tags, (e) => e.updateVisible());
408
415
  }));
409
- m(this, "onFiveEveryReady", () => {
410
- this.setUnfoldedByCamera(), C(this.five.getCurrentState().mode) && this.tagsDo(this.tags, (e) => e.updateVisible());
416
+ d(this, "onFiveEveryReady", () => {
417
+ this.setUnfoldedByCamera(), A(this.five.getCurrentState().mode) && this.tagsDo(this.tags, (e) => e.updateVisible());
411
418
  });
412
- m(this, "render", () => {
419
+ d(this, "render", () => {
413
420
  this.renderQueue.forEach((e, t) => {
414
421
  const { keys: i } = e;
415
422
  if (t === "TagContainerSvelte") {
416
- const n = this.filterPointTag.filter((r) => r.screenPosition), s = {
423
+ const n = this.filterPointTag.filter((s) => s.screenPosition), a = {
417
424
  hooks: this.hooks,
418
425
  tags: n,
419
426
  state: this.state,
@@ -424,30 +431,30 @@ class Fs extends R {
424
431
  zIndex: this.params.containerZIndex
425
432
  };
426
433
  if (this.TagContainerSvelte) {
427
- let r = {};
434
+ let s = {};
428
435
  if (i.length === 0)
429
- r = s;
436
+ s = a;
430
437
  else
431
- for (const a of i)
432
- r[a] = s[a];
433
- this.TagContainerSvelte.$set(r);
438
+ for (const r of i)
439
+ s[r] = a[r];
440
+ this.TagContainerSvelte.$set(s);
434
441
  } else {
435
442
  if (!this.container)
436
443
  return console.error("updateRenderPlaneTag: tag2DContainer not found");
437
- this.TagContainerSvelte = new x({
444
+ this.TagContainerSvelte = new X({
438
445
  target: this.container,
439
- props: c(f({}, s), { state: c(f({}, this.state), { enabled: !1 }) })
440
- }), z(() => {
441
- var r;
442
- (r = this.TagContainerSvelte) == null || r.$set({ state: this.state });
446
+ props: C(g({}, a), { state: C(g({}, this.state), { enabled: !1 }) })
447
+ }), H(() => {
448
+ var s;
449
+ (s = this.TagContainerSvelte) == null || s.$set({ state: this.state });
443
450
  });
444
451
  }
445
452
  }
446
453
  }), this.renderQueue.clear();
447
454
  });
448
- this.params = l({}, { debug: !1, config: this.config }, f({}, t)), this.debug = this.params.debug, this.config = this.params.config, this.debug && this.debugUtil.bindLog(), G(1, { namespace: O.PlayAudio });
455
+ this.params = v({}, { debug: !1, config: this.config }, g({}, t)), this.debug = this.params.debug, this.config = this.params.config, this.debug && this.debugUtil.bindLog(), V(1, { namespace: z.PlayAudio });
449
456
  try {
450
- Array.isArray(window.__PANOTAGPLUGIN_DEBUG_LIST__) || (window.__PANOTAGPLUGIN_DEBUG_LIST__ = []), this.NAME = D + "-" + window.__PANOTAGPLUGIN_DEBUG_LIST__.length, window.__PANOTAGPLUGIN_DEBUG_LIST__.push(this), window.__PANOTAGPLUGIN_DEBUG__ || Object.defineProperty(window, "__PANOTAGPLUGIN_DEBUG__", {
457
+ Array.isArray(window.__PANOTAGPLUGIN_DEBUG_LIST__) || (window.__PANOTAGPLUGIN_DEBUG_LIST__ = []), this.NAME = I + "-" + window.__PANOTAGPLUGIN_DEBUG_LIST__.length, window.__PANOTAGPLUGIN_DEBUG_LIST__.push(this), window.__PANOTAGPLUGIN_DEBUG__ || Object.defineProperty(window, "__PANOTAGPLUGIN_DEBUG__", {
451
458
  get: function() {
452
459
  return window.__PANOTAGPLUGIN_DEBUG_LIST__.sort((i, o) => o.tags.length - i.tags.length)[0];
453
460
  }
@@ -465,53 +472,60 @@ class Fs extends R {
465
472
  * @description 加载数据
466
473
  */
467
474
  load(e) {
468
- return d(this, null, function* () {
475
+ return m(this, null, function* () {
469
476
  var o, n;
470
- this.clearTags();
477
+ c.clearSharedMeshRegistry(), this.clearTags();
471
478
  try {
472
479
  console.debug(this.NAME, " load:", { data: JSON.parse(JSON.stringify(e)) });
473
- } catch (s) {
480
+ } catch (a) {
474
481
  }
475
- const t = V(this.five);
476
- e.tagList.forEach((s) => {
477
- if (s.enu_position && this.isValidArrayPosition(s.enu_position))
482
+ const t = Q(this.five);
483
+ e.tagList.forEach((a) => {
484
+ if (a.enu_position && this.isValidArrayPosition(a.enu_position))
478
485
  try {
479
- const r = v(s.enu_position), a = t.viewLayers[0].scene.enuToWorld(r);
480
- s.position = P(a);
481
- } catch (r) {
486
+ const s = k(a.enu_position), r = t.viewLayers[0].scene.enuToWorld(s);
487
+ a.position = U(r);
488
+ } catch (s) {
482
489
  }
483
- if (s.enu_normal && this.isValidArrayPosition(s.enu_normal))
490
+ if (a.enu_normal && this.isValidArrayPosition(a.enu_normal))
484
491
  try {
485
- const r = v(s.enu_normal), a = t.viewLayers[0].scene.enuToWorld(r);
486
- s.normal = P(a);
487
- } catch (r) {
492
+ const s = k(a.enu_normal), r = t.viewLayers[0].scene.enuToWorld(s);
493
+ a.normal = U(r);
494
+ } catch (s) {
488
495
  }
489
- }), this.config = l({}, this.config, {
496
+ }), this.config = v({}, this.config, {
490
497
  globalConfig: (o = e.globalConfig) != null ? o : {},
491
498
  contentTypeConfig: (n = e.contentTypeConfig) != null ? n : {}
492
499
  });
493
500
  const i = yield this.addTag(e.tagList);
494
- return this.hooks.emit("loaded"), i;
501
+ return this.five.state.mode === "Panorama" && this.updateMaskTagsForCurrentPano(), this.hooks.emit("loaded"), i;
495
502
  });
496
503
  }
497
504
  /**
498
505
  * @description 添加标签
506
+ * @param tag 标签或标签数组
507
+ * @param options 可选配置
508
+ * @param options.updateMaskUrl 是否更新 mask。若为 true 且该 panoIndex 已有 Mask 标签,仅更新其 maskUrl(不变 color、style),并添加新标签
499
509
  */
500
- addTag(e) {
501
- return d(this, null, function* () {
502
- const i = (Array.isArray(e) ? e : [e]).filter((o) => o.position).map((o) => {
503
- const n = B(o);
504
- if (n === "2DPoint" || n === "3DPoint")
505
- return new Q(this, o);
506
- if (n === "Model")
507
- return new $(this, o);
508
- if (n === "Plane")
509
- return new H(this, o);
510
+ addTag(e, t) {
511
+ return m(this, null, function* () {
512
+ var a, s;
513
+ const o = (Array.isArray(e) ? e : [e]).filter((r) => r.stickType === "3DBox" || r.stickType === "Mask" || r.position);
514
+ if (t != null && t.updateMaskUrl && o.length === 1 && o[0].stickType === "Mask") {
515
+ const r = o[0], h = (a = r.maskUrl) != null ? a : r.mask, f = (s = r.fiveState) == null ? void 0 : s.panoIndex;
516
+ h && typeof f == "number" && this.tags.filter((u) => {
517
+ var T;
518
+ return u instanceof c && ((T = u.fiveState) == null ? void 0 : T.panoIndex) === f;
519
+ }).forEach((u) => u.set({ mask: h }));
520
+ }
521
+ const n = o.map((r) => {
522
+ const h = N(r);
523
+ return h === "2DPoint" || h === "3DPoint" ? new q(this, r) : h === "Model" ? new J(this, r) : h === "Plane" ? new Z(this, r) : h === "3DBox" ? new Y(this, r) : h === "Polygon" ? new K(this, r) : h === "Mask" ? new c(this, r) : null;
510
524
  });
511
- return i.forEach((o) => M(o)), this.tags.push(...i), this.tagsLengthWillUpdate = !0, N(this.five).then(() => d(this, null, function* () {
512
- var o, n;
513
- this.store.eventListenerDisposer && ((n = (o = this.store).eventListenerDisposer) == null || n.call(o)), this.state.enabled && this.handleEnable(), this.addResizeListener(), this.clearUnusedPanelTag(), this.tagsDo(i, (s) => {
514
- this.tags.includes(s) && (s.updateVisible(), s.updateZIndex());
525
+ return n.forEach((r) => x(r)), this.tags.push(...n), this.tagsLengthWillUpdate = !0, j(this.five).then(() => m(this, null, function* () {
526
+ var r, h;
527
+ this.store.eventListenerDisposer && ((h = (r = this.store).eventListenerDisposer) == null || h.call(r)), this.state.enabled && this.handleEnable(), this.addResizeListener(), this.clearUnusedPanelTag(), this.tagsDo(n, (f) => {
528
+ this.tags.includes(f) && (f.updateVisible(), f.updateZIndex());
515
529
  }), this.setUnfolded(), this.addRenderQueue({ type: "TagContainerSvelte" }), this.hooks.emit("tagsLengthChange");
516
530
  }));
517
531
  });
@@ -520,7 +534,7 @@ class Fs extends R {
520
534
  * @description 改变配置
521
535
  */
522
536
  changeConfig(e, t = !0) {
523
- t ? this.config = l({}, this.config, e) : this.config = e, this.tags.forEach((i) => {
537
+ t ? this.config = v({}, this.config, e) : this.config = e, this.tags.forEach((i) => {
524
538
  i.updateConfig();
525
539
  }), this.tagsDo(this.tags, (i) => i.updateVisible());
526
540
  }
@@ -528,7 +542,7 @@ class Fs extends R {
528
542
  * @description 改变全局配置
529
543
  */
530
544
  changeGlobalConfig(e, t = !0) {
531
- t ? this.config.globalConfig = l({}, this.config.globalConfig, e) : this.config.globalConfig = e, this.tags.forEach((i) => {
545
+ t ? this.config.globalConfig = v({}, this.config.globalConfig, e) : this.config.globalConfig = e, this.tags.forEach((i) => {
532
546
  i.updateConfig();
533
547
  }), this.tagsDo(this.tags, (i) => {
534
548
  i.updateVisible();
@@ -538,14 +552,14 @@ class Fs extends R {
538
552
  * @description 改变类型配置
539
553
  */
540
554
  changeContentTypeConfig(e, t, i = !0) {
541
- this.config.contentTypeConfig || (this.config.contentTypeConfig = {}), i ? this.config.contentTypeConfig[e] = l({}, this.config.contentTypeConfig[e], t) : this.config.contentTypeConfig[e] = t, this.tags.forEach((o) => {
555
+ this.config.contentTypeConfig || (this.config.contentTypeConfig = {}), i ? this.config.contentTypeConfig[e] = v({}, this.config.contentTypeConfig[e], t) : this.config.contentTypeConfig[e] = t, this.tags.forEach((o) => {
542
556
  o.updateConfig();
543
557
  }), this.tagsDo(this.tags, (o) => {
544
558
  o.updateVisible();
545
559
  });
546
560
  }
547
561
  show(e) {
548
- return d(this, null, function* () {
562
+ return m(this, null, function* () {
549
563
  if (this.checkDisposed())
550
564
  return;
551
565
  const { userAction: t = !0 } = e != null ? e : {};
@@ -553,7 +567,7 @@ class Fs extends R {
553
567
  });
554
568
  }
555
569
  hide(e) {
556
- return d(this, null, function* () {
570
+ return m(this, null, function* () {
557
571
  if (this.checkDisposed())
558
572
  return;
559
573
  const { userAction: t = !0 } = e != null ? e : {};
@@ -575,21 +589,21 @@ class Fs extends R {
575
589
  setState(e, t) {
576
590
  if (this.checkDisposed())
577
591
  return;
578
- const { userAction: i = !0 } = t != null ? t : {}, o = f({}, this.state);
592
+ const { userAction: i = !0 } = t != null ? t : {}, o = g({}, this.state);
579
593
  this.state = Object.assign(this.state, e), o.visible !== this.state.visible && (e.visible ? this.handleShow() : this.handleHide()), o.enabled !== this.state.enabled && (e.enabled ? this.handleEnable() : this.handleDisable()), this.hooks.emit("stateChange", { state: this.state, prevState: o, userAction: i });
580
594
  }
581
595
  /**
582
596
  * @description 销毁
583
597
  */
584
598
  dispose() {
585
- var e, t, i, o, n, s;
586
- this.pauseCurrentMedia(), this.disposeAllCSS3DContainer(), (e = this.TagContainerSvelte) == null || e.$destroy(), this.filterCSS3DTag.forEach((r) => {
587
- var a;
588
- return (a = r.tag3DContentSvelte) == null ? void 0 : a.svelteApp.$destroy();
589
- }), this.tags.forEach((r) => {
590
- var a;
591
- (a = r.rectanglePlane) == null || a.editor.disable(), r.cache.clear();
592
- }), this.tags = [], this.tagsLengthWillUpdate = !0, this.hooks.emit("tagsLengthChange"), (t = this.store.disposers) == null || t.forEach((r) => r == null ? void 0 : r()), this.store.disposers = [], (o = (i = this.store).eventListenerDisposer) == null || o.call(i), this.store.eventListenerDisposer = void 0, (s = (n = this.store).resizeObserverDisposer) == null || s.call(n), this.store.resizeObserverDisposer = void 0, this.store.resizeObserverDisposerAdding = !1, this.five.scene.remove(this.group), this.group.remove(...this.group.children), this.gltfObjectGroup.remove(...this.gltfObjectGroup.children), this.imagePlaneGroup.remove(...this.imagePlaneGroup.children), this.five.needsRender = !0, this.store.disposed = !0, this.hooks.emit("dispose");
599
+ var e, t, i, o, n, a;
600
+ this.pauseCurrentMedia(), this.disposeAllCSS3DContainer(), (e = this.TagContainerSvelte) == null || e.$destroy(), this.filterCSS3DTag.forEach((s) => {
601
+ var r;
602
+ return (r = s.tag3DContentSvelte) == null ? void 0 : r.svelteApp.$destroy();
603
+ }), this.tags.forEach((s) => {
604
+ var r;
605
+ (r = s.rectanglePlane) == null || r.editor.disable(), s.cache.clear();
606
+ }), this.tags = [], this.tagsLengthWillUpdate = !0, this.hooks.emit("tagsLengthChange"), (t = this.store.disposers) == null || t.forEach((s) => s == null ? void 0 : s()), this.store.disposers = [], (o = (i = this.store).eventListenerDisposer) == null || o.call(i), this.store.eventListenerDisposer = void 0, (a = (n = this.store).resizeObserverDisposer) == null || a.call(n), this.store.resizeObserverDisposer = void 0, this.store.resizeObserverDisposerAdding = !1, this.five.scene.remove(this.group), this.group.remove(...this.group.children), this.gltfObjectGroup.remove(...this.gltfObjectGroup.children), this.imagePlaneGroup.remove(...this.imagePlaneGroup.children), this.five.needsRender = !0, this.store.disposed = !0, this.hooks.emit("dispose");
593
607
  }
594
608
  /**
595
609
  * @description 闪烁标签
@@ -597,7 +611,7 @@ class Fs extends R {
597
611
  * @param {Partial<anime.AnimeParams>} animeConfig
598
612
  */
599
613
  blinkTagById(e, t) {
600
- return d(this, null, function* () {
614
+ return m(this, null, function* () {
601
615
  var i;
602
616
  return (i = this.getTagById(e)) == null ? void 0 : i.blink(t);
603
617
  });
@@ -628,7 +642,7 @@ class Fs extends R {
628
642
  */
629
643
  changeTagNormalById(e, t) {
630
644
  const i = this.getTagById(e);
631
- i && i.tag3DContentSvelte && (i.tag3DContentSvelte.currentNormal = v(t));
645
+ i && i.tag3DContentSvelte && (i.tag3DContentSvelte.currentNormal = k(t));
632
646
  }
633
647
  /**
634
648
  * @description 改变data
@@ -655,7 +669,53 @@ class Fs extends R {
655
669
  */
656
670
  changeTagById(e, t, i = !0) {
657
671
  const o = this.getTagById(e);
658
- o && (o.set(t), o.updateVisible(), this.clearUnusedPanelTag(), o.hooks.emit("dataChanged", o.data));
672
+ if (o) {
673
+ if (t.stickType && t.stickType !== o.stickType) {
674
+ console.log(`[PanoTagPlugin] stickType changed from ${o.stickType} to ${t.stickType}, recreating tag`);
675
+ const n = g({}, o);
676
+ this.destroyTagById(e), this.five.ready().then(() => {
677
+ this.addTag(g(g({}, n), t));
678
+ });
679
+ return;
680
+ }
681
+ o.set(t), o instanceof c && o.updateMaskStyle(), o.updateVisible(), this.clearUnusedPanelTag(), o.hooks.emit("dataChanged", o.data);
682
+ }
683
+ }
684
+ /**
685
+ * @description 批量更新指定点位的 Mask 图
686
+ * @param maskUpdates 包含点位索引和对应 mask 的数组
687
+ * @example
688
+ * changeMask([
689
+ * { index: 0, mask: 'https://example.com/mask1.png' },
690
+ * { index: 1, mask: canvasElement }
691
+ * ])
692
+ */
693
+ changeMask(e) {
694
+ if (!Array.isArray(e) || e.length === 0) {
695
+ console.warn("[PanoTagPlugin] changeMask: invalid or empty maskUpdates");
696
+ return;
697
+ }
698
+ e.forEach(({ index: t, mask: i }) => {
699
+ if (typeof t != "number") {
700
+ console.warn("[PanoTagPlugin] changeMask: invalid index", t);
701
+ return;
702
+ }
703
+ if (!i) {
704
+ console.warn("[PanoTagPlugin] changeMask: invalid mask for index", t);
705
+ return;
706
+ }
707
+ const o = this.tags.filter((n) => {
708
+ var a;
709
+ return n instanceof c && ((a = n.fiveState) == null ? void 0 : a.panoIndex) === t;
710
+ });
711
+ if (o.length === 0) {
712
+ console.debug(`[PanoTagPlugin] changeMask: no MaskTag found at panoIndex ${t}`);
713
+ return;
714
+ }
715
+ o.forEach((n) => {
716
+ n.set({ mask: i }), console.log(`[PanoTagPlugin] Updated mask for tag ${n.id} at panoIndex ${t}`);
717
+ });
718
+ }), this.five.needsRender = !0;
659
719
  }
660
720
  /**
661
721
  * @description 销毁tag
@@ -678,15 +738,15 @@ class Fs extends R {
678
738
  clearTags() {
679
739
  var e;
680
740
  this.tags.length && (this.tags.forEach((t) => {
681
- var i, o, n, s, r, a;
682
- (i = t.tag3DContentSvelte) == null || i.dispose(), (n = (o = t.mediaPlane) == null ? void 0 : o.parent) == null || n.remove(t.mediaPlane), (a = (r = (s = t.model) == null ? void 0 : s.object) == null ? void 0 : r.parent) == null || a.remove(t.model.object), t != null && t.tagNormalLine && (t == null || t.removeTagNormalLine());
741
+ var i, o, n, a, s, r, h, f, y, u, T;
742
+ (i = t.tag3DContentSvelte) == null || i.dispose(), (n = (o = t.mediaPlane) == null ? void 0 : o.parent) == null || n.remove(t.mediaPlane), (r = (s = (a = t.model) == null ? void 0 : a.object) == null ? void 0 : s.parent) == null || r.remove(t.model.object), (f = (h = t.rectanglePlane) == null ? void 0 : h.parent) == null || f.remove(t.rectanglePlane), (y = t.boxShape) != null && y.parent && t.boxShape.parent.remove(t.boxShape), (T = (u = t.polygonShape) == null ? void 0 : u.parent) == null || T.remove(t.polygonShape), t != null && t.tagNormalLine && (t == null || t.removeTagNormalLine()), t instanceof c && t.dispose();
683
743
  }), this.tags = [], this.tagsLengthWillUpdate = !0, this.hooks.emit("tagsLengthChange"), (e = this.TagContainerSvelte) == null || e.$destroy(), this.TagContainerSvelte = void 0, this.disposeAllCSS3DContainer()), this.enabledModelTagSet.clear(), this.cache.clear();
684
744
  }
685
745
  /**
686
746
  * @description 设置 unfolded
687
747
  */
688
748
  setUnfolded() {
689
- return d(this, null, function* () {
749
+ return m(this, null, function* () {
690
750
  return new Promise((e) => {
691
751
  setTimeout(() => {
692
752
  this.setUnfoldedByCamera(), e();
@@ -722,20 +782,20 @@ class Fs extends R {
722
782
  if (this.store.disposed)
723
783
  return;
724
784
  const e = this.five.getElement(), t = () => {
725
- this.state.enabled && (this.filterPointTag.forEach((a) => a.updateScreenPosition({ force: !0 })), this.temporaryState.visible = !0, this.addRenderQueue({ type: "TagContainerSvelte", keys: ["temporaryState"] }));
785
+ this.state.enabled && (this.filterPointTag.forEach((r) => r.updateScreenPosition({ force: !0 })), this.temporaryState.visible = !0, this.addRenderQueue({ type: "TagContainerSvelte", keys: ["temporaryState"] }));
726
786
  }, i = () => {
727
787
  this.state.enabled && (this.temporaryState.visible = !1, this.addRenderQueue({ type: "TagContainerSvelte", keys: ["temporaryState"] }));
728
- }, { observe: o, unobserve: n } = T(
729
- I(() => {
788
+ }, { observe: o, unobserve: n } = M(
789
+ O(() => {
730
790
  this.store.resizeObserverDisposer && i();
731
791
  }, 500),
732
792
  e
733
- ), { observe: s, unobserve: r } = T(
734
- y(() => t(), 400),
793
+ ), { observe: a, unobserve: s } = M(
794
+ D(() => t(), 400),
735
795
  e
736
796
  );
737
- return o(), s(), () => {
738
- n(), r();
797
+ return o(), a(), () => {
798
+ n(), s();
739
799
  };
740
800
  }
741
801
  setUnfoldedByCamera() {
@@ -745,13 +805,13 @@ class Fs extends R {
745
805
  if (t.state && i !== void 0) {
746
806
  if (i === !0 && t.screenPosition) {
747
807
  const o = t.getConfig().unfoldedConfig;
748
- S(o).keep !== "unfolded" && (e = !0);
808
+ E(o).keep !== "unfolded" && (e = !0);
749
809
  }
750
810
  t.state.unfolded = i;
751
811
  }
752
812
  }), e && this.filterPointTag.forEach((t) => {
753
813
  const i = t.getConfig().unfoldedConfig;
754
- typeof i == "object" && (i.autoUnfold || i.autoUnfold === !1 || S(i.autoUnfold).enable === !1 || i.keep) || t.state && (t.state.unfolded = !1);
814
+ typeof i == "object" && (i.autoUnfold || i.autoUnfold === !1 || E(i.autoUnfold).enable === !1 || i.keep) || t.state && (t.state.unfolded = !1);
755
815
  });
756
816
  }
757
817
  changeTagMode(e, t) {
@@ -762,7 +822,7 @@ class Fs extends R {
762
822
  * @description 添加 cameraUpdate, panoArrived 等事件监听
763
823
  */
764
824
  addEventListener() {
765
- const { five: e, hooks: t } = this, i = W(this.five, this.onFiveEveryReady);
825
+ const { five: e, hooks: t } = this, i = ee(this.five, this.onFiveEveryReady);
766
826
  return this.handleFivePanoArrived(), e.on("wantsMoveToPano", this.handleFiveWantsMoveToPano), e.on("models.refined", this.onFiveRefined), e.on("modeChange", this.handleFiveModeChange), e.on("modelShownFloorChange", this.handleFiveModelShownFloorChange), e.on("cameraUpdate", this.handleFiveCameraUpdate), e.on("cameraFovUpdate", this.handleFiveCameraFovUpdate), e.on("panoArrived", this.handleFivePanoArrived), e.on("panoArrived", this.loadVideoFirstFrame), e.on("render.prepare", this.render), t.on("click", this.clickhandler), () => {
767
827
  i(), e.off("wantsMoveToPano", this.handleFiveWantsMoveToPano), e.off("models.refined", this.onFiveRefined), e.off("modeChange", this.handleFiveModeChange), e.off("modelShownFloorChange", this.handleFiveModelShownFloorChange), e.off("cameraUpdate", this.handleFiveCameraUpdate), e.off("cameraFovUpdate", this.handleFiveCameraFovUpdate), e.off("panoArrived", this.handleFivePanoArrived), e.off("panoArrived", this.loadVideoFirstFrame), e.off("render.prepare", this.render), t.off("click", this.clickhandler), this.store.eventListenerDisposer = void 0;
768
828
  };
@@ -801,9 +861,62 @@ class Fs extends R {
801
861
  isValidArrayPosition(e) {
802
862
  return !Array.isArray(e) || e.length !== 3 ? !1 : e.every((t) => typeof t == "number" && !isNaN(t) && isFinite(t));
803
863
  }
864
+ /**
865
+ * 更新当前点位的 Mask 标签
866
+ * Mask 标签仅在当前点位可见
867
+ */
868
+ updateMaskTagsForCurrentPano() {
869
+ const e = this.five.getCurrentState().panoIndex;
870
+ console.log(
871
+ "[PanoTagPlugin] updateMaskTagsForCurrentPano, current panoIndex:",
872
+ e,
873
+ "mask tags count:",
874
+ this.filterMaskTag.length
875
+ ), this.filterMaskTag.forEach((t) => {
876
+ var o;
877
+ const i = (o = t.fiveState) == null ? void 0 : o.panoIndex;
878
+ console.log(
879
+ "[PanoTagPlugin] Processing mask tag:",
880
+ t.id,
881
+ "tagPanoIndex:",
882
+ i,
883
+ "matches current:",
884
+ i === e
885
+ ), i === e ? (console.log("[PanoTagPlugin] Tag matches current pano, updating visibility..."), t.updateVisible(), t.applyVisible()) : t.visible && (console.log("[PanoTagPlugin] Tag is from different pano, hiding..."), t.state.visible = !1, t.applyVisible());
886
+ });
887
+ }
888
+ /**
889
+ * 获取所有 Mask 类型的标签
890
+ */
891
+ get filterMaskTag() {
892
+ return this.tags.filter((e) => e.stickType === "Mask");
893
+ }
894
+ /**
895
+ * 获取 MaskTag 性能统计信息(用于性能监控和调试)
896
+ * @returns 性能统计信息
897
+ */
898
+ getMaskTagPerformanceStats() {
899
+ const e = c.getCacheStats(), t = this.filterMaskTag.length, i = this.filterMaskTag.filter((o) => o.visible).length;
900
+ return {
901
+ // 标签统计
902
+ totalMaskTags: t,
903
+ visibleMaskTags: i,
904
+ // 纹理缓存统计
905
+ textureCache: e,
906
+ // 当前点位
907
+ currentPanoIndex: this.five.state.panoIndex
908
+ };
909
+ }
910
+ /**
911
+ * 清理所有 MaskTag 纹理缓存(用于内存管理)
912
+ * 注意:这会释放所有纹理缓存,谨慎使用
913
+ */
914
+ clearMaskTagCache() {
915
+ c.clearAllCache();
916
+ }
804
917
  }
805
918
  export {
806
- Fs as PanoTagPluginController,
807
- Fs as default,
808
- _s as pluginFlag
919
+ Vs as PanoTagPluginController,
920
+ Vs as default,
921
+ Ns as pluginFlag
809
922
  };