@realsee/dnalogel 3.73.1-alpha.1 → 3.73.1-alpha.3

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.
@@ -9,7 +9,12 @@ export declare class PlaneTag<C extends TagContentType = TagContentType> extends
9
9
  rectanglePlane?: Rectangle;
10
10
  private _floorIndex?;
11
11
  private _floorIndexDirty;
12
+ private _opacity?;
12
13
  constructor(plugin: PanoTagPluginController, tagData: TagData);
14
+ /** 获取透明度 */
15
+ get opacity(): number;
16
+ /** 设置透明度 (0-1) */
17
+ set opacity(value: number);
13
18
  /** 获取楼层索引(惰性计算 + 缓存) */
14
19
  get floorIndex(): number | undefined;
15
20
  /** 标记 floorIndex 需要重新计算(在位置等相关数据变化时调用) */
@@ -1,37 +1,37 @@
1
- var j = Object.defineProperty, R = Object.defineProperties;
2
- var V = Object.getOwnPropertyDescriptors;
1
+ var k = Object.defineProperty, j = Object.defineProperties;
2
+ var R = Object.getOwnPropertyDescriptors;
3
3
  var F = Object.getOwnPropertySymbols;
4
- var k = Object.prototype.hasOwnProperty, M = Object.prototype.propertyIsEnumerable;
5
- var y = (d, m, t) => m in d ? j(d, m, { enumerable: !0, configurable: !0, writable: !0, value: t }) : d[m] = t, I = (d, m) => {
6
- for (var t in m || (m = {}))
7
- k.call(m, t) && y(d, t, m[t]);
4
+ var V = Object.prototype.hasOwnProperty, w = Object.prototype.propertyIsEnumerable;
5
+ var I = (c, d, t) => d in c ? k(c, d, { enumerable: !0, configurable: !0, writable: !0, value: t }) : c[d] = t, b = (c, d) => {
6
+ for (var t in d || (d = {}))
7
+ V.call(d, t) && I(c, t, d[t]);
8
8
  if (F)
9
- for (var t of F(m))
10
- M.call(m, t) && y(d, t, m[t]);
11
- return d;
12
- }, S = (d, m) => R(d, V(m));
13
- var b = (d, m, t) => (y(d, typeof m != "symbol" ? m + "" : m, t), t);
14
- var C = (d, m, t) => new Promise((o, i) => {
15
- var a = (r) => {
9
+ for (var t of F(d))
10
+ w.call(d, t) && I(c, t, d[t]);
11
+ return c;
12
+ }, S = (c, d) => j(c, R(d));
13
+ var y = (c, d, t) => (I(c, typeof d != "symbol" ? d + "" : d, t), t);
14
+ var C = (c, d, t) => new Promise((e, i) => {
15
+ var o = (r) => {
16
16
  try {
17
- e(t.next(r));
18
- } catch (p) {
19
- i(p);
17
+ m(t.next(r));
18
+ } catch (n) {
19
+ i(n);
20
20
  }
21
- }, n = (r) => {
21
+ }, l = (r) => {
22
22
  try {
23
- e(t.throw(r));
24
- } catch (p) {
25
- i(p);
23
+ m(t.throw(r));
24
+ } catch (n) {
25
+ i(n);
26
26
  }
27
- }, e = (r) => r.done ? o(r.value) : Promise.resolve(r.value).then(a, n);
28
- e((t = t.apply(d, m)).next());
27
+ }, m = (r) => r.done ? e(r.value) : Promise.resolve(r.value).then(o, l);
28
+ m((t = t.apply(c, d)).next());
29
29
  });
30
- import { CONST as w } from "../../../shared-utils/constants.js";
31
- import { CSS3DObjectPlus as O } from "../../../shared-utils/CSS3DRender/CSS3DObject.js";
32
- import { anyPositionToVector3 as T, arrayPositionToVector3 as g } from "../../../shared-utils/positionToVector3.js";
30
+ import { CONST as M } from "../../../shared-utils/constants.js";
31
+ import { CSS3DObjectPlus as _ } from "../../../shared-utils/CSS3DRender/CSS3DObject.js";
32
+ import { anyPositionToVector3 as T, arrayPositionToVector3 as P } from "../../../shared-utils/positionToVector3.js";
33
33
  import * as E from "three";
34
- import { planeNormal as _ } from "../../utils/planeNormal.js";
34
+ import { planeNormal as O } from "../../utils/planeNormal.js";
35
35
  import { centerPoint as G } from "../../../shared-utils/three/centerPoint.js";
36
36
  import { VideoPlane as L, ImagePlane as A } from "../../utils/model/mediaPlane.js";
37
37
  import N from "../../Components/Tag/index.js";
@@ -52,8 +52,8 @@ import { waitFiveModelLoaded as x } from "../../../shared-utils/five/fiveModelLo
52
52
  import { uuid as $ } from "../../../shared-utils/uuid.js";
53
53
  import "../../../shared-utils/five/FivePuppet.js";
54
54
  import { Sculpt as U } from "../../../Sculpt/index.js";
55
- import { Rectangle as q } from "../../../Sculpt/Objects/Rectangle/index.js";
56
- import { getFloorMesh as W } from "../../../shared-utils/five/getFloorMesh.js";
55
+ import { Rectangle as W } from "../../../Sculpt/Objects/Rectangle/index.js";
56
+ import { getFloorMesh as q } from "../../../shared-utils/five/getFloorMesh.js";
57
57
  import "../../../shared-utils/even.js";
58
58
  import "../../../shared-utils/CSS3DRender/OpacityMesh.js";
59
59
  import "../../../shared-utils/isNil.js";
@@ -301,12 +301,22 @@ import "../../../Sculpt/Editors/RectangleMeshEditor.js";
301
301
  import "../../../Sculpt/utils/sortPositionsByCameraPosition.js";
302
302
  const Z = /* @__PURE__ */ new Map(), z = /* @__PURE__ */ new Map();
303
303
  class Xr extends B {
304
- constructor(t, o) {
305
- super(t, o);
306
- b(this, "_floorIndex");
307
- b(this, "_floorIndexDirty", !0);
304
+ constructor(t, e) {
305
+ super(t, e);
306
+ y(this, "_floorIndex");
307
+ y(this, "_floorIndexDirty", !0);
308
+ y(this, "_opacity");
308
309
  this.state.unfolded = !0, this.loadModel();
309
310
  }
311
+ /** 获取透明度 */
312
+ get opacity() {
313
+ var t, e;
314
+ return this._opacity !== void 0 ? this._opacity : (e = (t = this.data) == null ? void 0 : t.opacity) != null ? e : 1;
315
+ }
316
+ /** 设置透明度 (0-1) */
317
+ set opacity(t) {
318
+ t !== this._opacity && (this._opacity = t, this.mediaPlane && (this.mediaPlane.opacity = t));
319
+ }
310
320
  /** 获取楼层索引(惰性计算 + 缓存) */
311
321
  get floorIndex() {
312
322
  return (this._floorIndexDirty || this._floorIndex === void 0) && (this._floorIndex = this.computeFloorIndex(), this._floorIndexDirty = !1), this._floorIndex;
@@ -316,72 +326,73 @@ class Xr extends B {
316
326
  this._floorIndexDirty = !0;
317
327
  }
318
328
  applyVisible() {
319
- var o, i, a, n, e, r;
320
- this.computeRenderType() === "Mesh" ? (this.initialSculpt(), ((i = (o = this.data.mediaData) == null ? void 0 : o[0]) == null ? void 0 : i.type) === "Video" ? this.renderVideoPlane() : ((n = (a = this.data.mediaData) == null ? void 0 : a[0]) == null ? void 0 : n.type) === "Image" ? this.renderImagePlane() : this.renderEmptyPlane()) : ((e = this.tag3DContentSvelte) == null || e.svelteApp.$set({ tag: this, state: this.plugin.state, temporaryState: this.plugin.temporaryState }), (r = this.tag3DContentSvelte) != null && r.css3DInstance && (this.tag3DContentSvelte.css3DInstance.visible = this.visible, this.five.needsRender = !0));
329
+ var e, i, o, l, m, r;
330
+ this.computeRenderType() === "Mesh" ? (this.initialSculpt(), ((i = (e = this.data.mediaData) == null ? void 0 : e[0]) == null ? void 0 : i.type) === "Video" ? this.renderVideoPlane() : ((l = (o = this.data.mediaData) == null ? void 0 : o[0]) == null ? void 0 : l.type) === "Image" ? this.renderImagePlane() : this.renderEmptyPlane()) : ((m = this.tag3DContentSvelte) == null || m.svelteApp.$set({ tag: this, state: this.plugin.state, temporaryState: this.plugin.temporaryState }), (r = this.tag3DContentSvelte) != null && r.css3DInstance && (this.tag3DContentSvelte.css3DInstance.visible = this.visible, this.five.needsRender = !0));
321
331
  }
322
- set(t, o = !0) {
323
- super.set(t, o), x(this.five).then(() => {
332
+ set(t, e = !0) {
333
+ super.set(t, e), x(this.five).then(() => {
324
334
  this.tag3DContentSvelte && (t.data ? this.tag3DContentSvelte.svelteApp.$set({ tag: this, state: this.plugin.state, temporaryState: this.plugin.temporaryState }) : t.position && this.loadModel());
325
335
  });
326
336
  }
327
337
  setData(...t) {
328
- var i, a, n, e, r;
329
- super.setData(...t), this.computeRenderType() === "Mesh" ? ((a = (i = this.data.mediaData) == null ? void 0 : i[0]) == null ? void 0 : a.type) === "Video" ? this.renderVideoPlane() : ((e = (n = this.data.mediaData) == null ? void 0 : n[0]) == null ? void 0 : e.type) === "Image" ? this.renderImagePlane() : this.renderEmptyPlane() : (r = this.tag3DContentSvelte) == null || r.svelteApp.$set({ tag: this });
338
+ var i, o, l, m, r;
339
+ super.setData(...t), this.computeRenderType() === "Mesh" ? (((o = (i = this.data.mediaData) == null ? void 0 : i[0]) == null ? void 0 : o.type) === "Video" ? this.renderVideoPlane() : ((m = (l = this.data.mediaData) == null ? void 0 : l[0]) == null ? void 0 : m.type) === "Image" ? this.renderImagePlane() : this.renderEmptyPlane(), this.mediaPlane && (this.mediaPlane.opacity = this.opacity)) : (r = this.tag3DContentSvelte) == null || r.svelteApp.$set({ tag: this });
330
340
  }
331
341
  /** 计算楼层索引 */
332
342
  computeFloorIndex() {
343
+ var m, r;
333
344
  const t = /* @__PURE__ */ new Map();
334
- this.five.observers.forEach((n) => {
335
- var r;
336
- const e = (r = n.floorIndex) != null ? r : 0;
337
- if (!t.has(e)) {
338
- const p = W(this.five, e);
339
- p.isEmpty() || t.set(e, p);
345
+ ((r = (m = this.five.works.getWork(this.workUtil.workCode)) == null ? void 0 : m.observers) != null ? r : []).forEach((n) => {
346
+ var h;
347
+ const s = (h = n.floorIndex) != null ? h : 0;
348
+ if (!t.has(s)) {
349
+ const u = q(this.five, s);
350
+ u.isEmpty() || t.set(s, u);
340
351
  }
341
352
  });
342
- const o = G(...this.position.map(T)), i = [], a = [];
343
- if (t.forEach((n, e) => {
344
- a.push({ floorIndex: e, box: n }), n.containsPoint(o) && i.push({ floorIndex: e, box: n });
345
- }), i.length === 1)
346
- return i[0].floorIndex;
347
- if (i.length > 1) {
348
- let n = 1 / 0, e = i[0].floorIndex;
349
- return i.forEach(({ floorIndex: r, box: p }) => {
350
- const h = new E.Vector3();
351
- p.getCenter(h);
352
- const c = o.distanceTo(h);
353
- c < n && (n = c, e = r);
354
- }), e;
353
+ const i = G(...this.position.map(T)), o = [], l = [];
354
+ if (t.forEach((n, s) => {
355
+ l.push({ floorIndex: s, box: n }), n.containsPoint(i) && o.push({ floorIndex: s, box: n });
356
+ }), o.length === 1)
357
+ return o[0].floorIndex;
358
+ if (o.length > 1) {
359
+ let n = 1 / 0, s = o[0].floorIndex;
360
+ return o.forEach(({ floorIndex: h, box: u }) => {
361
+ const p = new E.Vector3();
362
+ u.getCenter(p);
363
+ const a = i.distanceTo(p);
364
+ a < n && (n = a, s = h);
365
+ }), s;
355
366
  }
356
- if (a.length > 0) {
357
- let n = 1 / 0, e = a[0].floorIndex;
358
- return a.forEach(({ floorIndex: r, box: p }) => {
359
- const h = new E.Vector3();
360
- p.getCenter(h);
361
- const c = o.distanceTo(h);
362
- c < n && (n = c, e = r);
363
- }), e;
367
+ if (l.length > 0) {
368
+ let n = 1 / 0, s = l[0].floorIndex;
369
+ return l.forEach(({ floorIndex: h, box: u }) => {
370
+ const p = new E.Vector3();
371
+ u.getCenter(p);
372
+ const a = i.distanceTo(p);
373
+ a < n && (n = a, s = h);
374
+ }), s;
364
375
  }
365
376
  }
366
377
  loadModel() {
367
378
  return C(this, null, function* () {
368
- var o, i, a, n, e, r;
379
+ var e, i, o, l, m, r;
369
380
  if (yield x(this.five), this.computeRenderType() === "Mesh")
370
- this.initialSculpt(), ((i = (o = this.data.mediaData) == null ? void 0 : o[0]) == null ? void 0 : i.type) === "Video" ? this.renderVideoPlane() : ((n = (a = this.data.mediaData) == null ? void 0 : a[0]) == null ? void 0 : n.type) === "Image" ? this.renderImagePlane() : this.renderEmptyPlane();
381
+ this.initialSculpt(), ((i = (e = this.data.mediaData) == null ? void 0 : e[0]) == null ? void 0 : i.type) === "Video" ? this.renderVideoPlane() : ((l = (o = this.data.mediaData) == null ? void 0 : o[0]) == null ? void 0 : l.type) === "Image" ? this.renderImagePlane() : this.renderEmptyPlane();
371
382
  else {
372
383
  H(this.five);
373
- const p = this.position.map(T);
374
- (r = (e = this.tag3DContentSvelte) == null ? void 0 : e.dispose) == null || r.call(e);
375
- const h = document.createElement("div");
376
- h.classList.add("tag-media-container");
377
- const c = I({ mode: "front", cornerPoints: p, container: h }, this.config.tag3DConfig), P = this.computeRenderType() === "BehindDom" || c.mode === "behind" ? "behind" : "front", l = new O(S(I({}, c), { mode: P })), s = this.computeNormal();
378
- l.position.add(s.clone().setLength(w.Z_FIGHTING_OFFSET)), this.plugin.group.add(l);
384
+ const n = this.position.map(T);
385
+ (r = (m = this.tag3DContentSvelte) == null ? void 0 : m.dispose) == null || r.call(m);
386
+ const s = document.createElement("div");
387
+ s.classList.add("tag-media-container");
388
+ const h = b({ mode: "front", cornerPoints: n, container: s }, this.config.tag3DConfig), u = this.computeRenderType() === "BehindDom" || h.mode === "behind" ? "behind" : "front", p = new _(S(b({}, h), { mode: u })), a = this.computeNormal();
389
+ p.position.add(a.clone().setLength(M.Z_FIGHTING_OFFSET)), this.plugin.group.add(p);
379
390
  let v;
380
- l.mode === "behind" && this.config.clickable !== !1 && (v = this.addObjectClickHandler(this, l, (f) => {
381
- this.plugin.hooks.emit("click", { event: f, target: "TagContent", tag: this });
391
+ p.mode === "behind" && this.config.clickable !== !1 && (v = this.addObjectClickHandler(this, p, (g) => {
392
+ this.plugin.hooks.emit("click", { event: g, target: "TagContent", tag: this });
382
393
  }));
383
- const u = new N({
384
- target: h,
394
+ const f = new N({
395
+ target: s,
385
396
  props: {
386
397
  tag: this,
387
398
  hooks: this.plugin.hooks,
@@ -392,15 +403,15 @@ class Xr extends B {
392
403
  }
393
404
  });
394
405
  this.tag3DContentSvelte = {
395
- svelteApp: u,
406
+ svelteApp: f,
396
407
  domContainer: {
397
- css3DObject: l
408
+ css3DObject: p
398
409
  },
399
- css3DInstance: l,
400
- initialNormal: s,
401
- currentNormal: s,
410
+ css3DInstance: p,
411
+ initialNormal: a,
412
+ currentNormal: a,
402
413
  dispose: () => {
403
- u.$destroy(), l.dispose(), v == null || v();
414
+ f.$destroy(), p.dispose(), v == null || v();
404
415
  }
405
416
  }, this.five.needsRender = !0;
406
417
  }
@@ -413,11 +424,11 @@ class Xr extends B {
413
424
  magnifier: null
414
425
  });
415
426
  t.clear(), t.group.removeFromParent();
416
- const o = $(), i = new q(
427
+ const e = $(), i = new W(
417
428
  {
418
- id: o,
429
+ id: e,
419
430
  type: "Rectangle",
420
- points: this.position.map(g),
431
+ points: this.position.map(P),
421
432
  style: {
422
433
  color: 2203620,
423
434
  opacity: 0.1,
@@ -429,8 +440,8 @@ class Xr extends B {
429
440
  }
430
441
  );
431
442
  i.visible = !1, this.plugin.imagePlaneGroup.add(i), this.rectanglePlane = i, i.editor.hooks.on("objectUpdate", () => {
432
- var a;
433
- (a = this.mediaPlane) == null || a.changePointsOrParams({ cornerPoints: i.data.points.map(g) });
443
+ var o;
444
+ (o = this.mediaPlane) == null || o.changePointsOrParams({ cornerPoints: i.data.points.map(P) });
434
445
  }), i.editor.disable();
435
446
  }
436
447
  editorEnable() {
@@ -439,80 +450,81 @@ class Xr extends B {
439
450
  editorDisable(t) {
440
451
  var i;
441
452
  this.rectanglePlane.visible = !1;
442
- const o = t || this.position.map(g);
443
- (i = this.mediaPlane) == null || i.changePointsOrParams({ cornerPoints: o }), this.rectanglePlane.setData({
444
- points: o
453
+ const e = t || this.position.map(P);
454
+ (i = this.mediaPlane) == null || i.changePointsOrParams({ cornerPoints: e }), this.rectanglePlane.setData({
455
+ points: e
445
456
  }), this.rectanglePlane.editor.disable();
446
457
  }
447
458
  renderVideoPlane() {
448
- var h, c, P;
459
+ var s, h, u;
449
460
  const t = this.data.mediaData[0];
450
461
  if (!t)
451
462
  return;
452
- const { url: o } = t;
453
- if (!o)
463
+ const { url: e } = t;
464
+ if (!e)
454
465
  return;
455
- const i = (h = this.data.objectFit) != null ? h : "contain", a = this.currentVisible, n = (() => !!(this.mediaPlane && !a))(), e = (() => !!(!this.mediaPlane && a))(), r = (() => !!(this.mediaPlane && (this.mediaPlane.src !== o || this.mediaPlane.objectFit !== i)))();
456
- (n || r) && this.mediaPlane && (this.plugin.imagePlaneGroup.remove(this.mediaPlane), this.mediaPlane.dispose(), this.mediaPlane.removeFromParent(), this.mediaPlane = void 0);
457
- const p = (() => !!(this.mediaPlane && this.mediaPlane.objectFit && this.mediaPlane.objectFit !== i))();
458
- if (e || r) {
459
- let l = this.position.map(g);
460
- this.rectanglePlane && (l = this.rectanglePlane.data.points.map(g));
461
- const s = new L(o, l, {
466
+ const i = (s = this.data.objectFit) != null ? s : "contain", o = this.currentVisible, l = (() => !!(this.mediaPlane && !o))(), m = (() => !!(!this.mediaPlane && o))(), r = (() => !!(this.mediaPlane && (this.mediaPlane.src !== e || this.mediaPlane.objectFit !== i)))();
467
+ (l || r) && this.mediaPlane && (this.plugin.imagePlaneGroup.remove(this.mediaPlane), this.mediaPlane.dispose(), this.mediaPlane.removeFromParent(), this.mediaPlane = void 0);
468
+ const n = (() => !!(this.mediaPlane && this.mediaPlane.objectFit && this.mediaPlane.objectFit !== i))();
469
+ if (m || r) {
470
+ let p = this.position.map(P);
471
+ this.rectanglePlane && (p = this.rectanglePlane.data.points.map(P));
472
+ const a = new L(e, p, {
462
473
  videoCoverSrc: t.videoCoverUrl,
463
474
  playButton: this.data.playIcon,
464
- paused: !((c = this.data.autoplayConfig) != null && c.autoplayVideo),
475
+ paused: !((h = this.data.autoplayConfig) != null && h.autoplayVideo),
465
476
  objectFit: this.data.objectFit,
466
477
  videoTextureMap: Z,
467
478
  ImageTextureMap: z,
468
- domEvents: this.plugin.domEvents
479
+ domEvents: this.plugin.domEvents,
480
+ opacity: this.opacity
469
481
  });
470
- this.plugin.domEvents.addAutoBindEventListener(s, "click", (u) => {
471
- var f, D;
472
- !((f = s.videoInstance) != null && f.paused) && ((D = s.videoInstance) == null ? void 0 : D.muted) === !1 && this.plugin.hooks.emit("playStateChange", {
473
- event: u,
482
+ this.plugin.domEvents.addAutoBindEventListener(a, "click", (f) => {
483
+ var g, D;
484
+ !((g = a.videoInstance) != null && g.paused) && ((D = a.videoInstance) == null ? void 0 : D.muted) === !1 && this.plugin.hooks.emit("playStateChange", {
485
+ event: f,
474
486
  state: "playing",
475
487
  tag: this,
476
- mediaInstance: s.videoInstance
488
+ mediaInstance: a.videoInstance
477
489
  });
478
- }), s.onVideoReady = (u) => {
479
- u.addEventListener("play", (f) => {
480
- this.plugin.mediaStore.set({ currentMediaElement: s.videoInstance }), this.plugin.hooks.emit("playStateChange", { event: f, state: "playing", tag: this, mediaInstance: s.videoInstance });
481
- }), u.addEventListener("pause", (f) => {
482
- this.plugin.hooks.emit("playStateChange", { event: f, state: "paused", tag: this, mediaInstance: s.videoInstance });
483
- }), u.addEventListener("ended", (f) => {
484
- this.plugin.hooks.emit("playStateChange", { event: f, state: "paused", tag: this, mediaInstance: s.videoInstance });
490
+ }), a.onVideoReady = (f) => {
491
+ f.addEventListener("play", (g) => {
492
+ this.plugin.mediaStore.set({ currentMediaElement: a.videoInstance }), this.plugin.hooks.emit("playStateChange", { event: g, state: "playing", tag: this, mediaInstance: a.videoInstance });
493
+ }), f.addEventListener("pause", (g) => {
494
+ this.plugin.hooks.emit("playStateChange", { event: g, state: "paused", tag: this, mediaInstance: a.videoInstance });
495
+ }), f.addEventListener("ended", (g) => {
496
+ this.plugin.hooks.emit("playStateChange", { event: g, state: "paused", tag: this, mediaInstance: a.videoInstance });
485
497
  });
486
498
  };
487
- const v = (u) => (this.five.on("renderFrame", u), () => this.five.off("renderFrame", u));
488
- s.initialRenderHooks(v), this.mediaPlane = s, this.play = () => s.play(), this.pause = () => s.pause(), this.plugin.imagePlaneGroup.add(this.mediaPlane);
499
+ const v = (f) => (this.five.on("renderFrame", f), () => this.five.off("renderFrame", f));
500
+ a.initialRenderHooks(v), this.mediaPlane = a, this.play = () => a.play(), this.pause = () => a.pause(), this.plugin.imagePlaneGroup.add(this.mediaPlane);
489
501
  }
490
- if (p) {
491
- const l = this.rectanglePlane.data.points.map(g);
492
- (P = this.mediaPlane) == null || P.changePointsOrParams({ cornerPoints: l, params: { objectFit: i } });
502
+ if (n) {
503
+ const p = this.rectanglePlane.data.points.map(P);
504
+ (u = this.mediaPlane) == null || u.changePointsOrParams({ cornerPoints: p, params: { objectFit: i } });
493
505
  }
494
506
  this.five.needsRender = !0;
495
507
  }
496
508
  renderImagePlane() {
497
- var c, P;
498
- const t = this.data.mediaData[0], o = (c = this.data.objectFit) != null ? c : "contain";
509
+ var h, u;
510
+ const t = this.data.mediaData[0], e = (h = this.data.objectFit) != null ? h : "contain";
499
511
  if (!t)
500
512
  return;
501
513
  const { url: i } = t;
502
514
  if (!i)
503
515
  return;
504
- let a = this.position.map(g);
505
- const n = this.currentVisible, e = (() => !!(this.mediaPlane && !n))(), r = (() => !!(!this.mediaPlane && n))(), p = (() => !!(this.mediaPlane && this.mediaPlane.src !== i))(), h = (() => !!(this.mediaPlane && this.mediaPlane.objectFit && this.mediaPlane.objectFit !== o))();
506
- if ((e || p) && this.mediaPlane && (this.plugin.imagePlaneGroup.remove(this.mediaPlane), this.mediaPlane.dispose(), this.mediaPlane.removeFromParent(), this.mediaPlane = void 0), (r || p) && (this.rectanglePlane && (a = this.rectanglePlane.data.points.map(g)), this.mediaPlane = new A(i, a, { objectFit: this.data.objectFit }), this.getConfig().clickable !== !1 && this.plugin.domEvents.addAutoBindEventListener(
516
+ let o = this.position.map(P);
517
+ const l = this.currentVisible, m = (() => !!(this.mediaPlane && !l))(), r = (() => !!(!this.mediaPlane && l))(), n = (() => !!(this.mediaPlane && this.mediaPlane.src !== i))(), s = (() => !!(this.mediaPlane && this.mediaPlane.objectFit && this.mediaPlane.objectFit !== e))();
518
+ if ((m || n) && this.mediaPlane && (this.plugin.imagePlaneGroup.remove(this.mediaPlane), this.mediaPlane.dispose(), this.mediaPlane.removeFromParent(), this.mediaPlane = void 0), (r || n) && (this.rectanglePlane && (o = this.rectanglePlane.data.points.map(P)), this.mediaPlane = new A(i, o, { objectFit: this.data.objectFit, opacity: this.opacity }), this.getConfig().clickable !== !1 && this.plugin.domEvents.addAutoBindEventListener(
507
519
  this.mediaPlane,
508
520
  "click",
509
- (l) => {
510
- this.plugin.hooks.emit("click", { tag: this, target: "TagContent", event: l.origDomEvent });
521
+ (p) => {
522
+ this.plugin.hooks.emit("click", { tag: this, target: "TagContent", event: p.origDomEvent });
511
523
  },
512
524
  { noEmitWhenHide: !0 }
513
- ), this.plugin.imagePlaneGroup.add(this.mediaPlane)), h) {
514
- const l = this.rectanglePlane.data.points.map(g);
515
- (P = this.mediaPlane) == null || P.changePointsOrParams({ cornerPoints: l, params: { objectFit: o } });
525
+ ), this.plugin.imagePlaneGroup.add(this.mediaPlane)), s) {
526
+ const p = this.rectanglePlane.data.points.map(P);
527
+ (u = this.mediaPlane) == null || u.changePointsOrParams({ cornerPoints: p, params: { objectFit: e } });
516
528
  }
517
529
  this.five.needsRender = !0;
518
530
  }
@@ -520,7 +532,7 @@ class Xr extends B {
520
532
  this.mediaPlane && (this.plugin.imagePlaneGroup.remove(this.mediaPlane), this.mediaPlane.dispose(), this.mediaPlane.removeFromParent(), this.mediaPlane = void 0);
521
533
  }
522
534
  computeNormal() {
523
- return _(this.position);
535
+ return O(this.position);
524
536
  }
525
537
  }
526
538
  export {
@@ -28,6 +28,7 @@ declare class ImagePlane extends MediaPlane {
28
28
  constructor(imageSrc: string, cornerPoints: Vector3[], params?: {
29
29
  objectFit?: ObjectFit;
30
30
  resolveZFighting?: boolean;
31
+ opacity?: number;
31
32
  });
32
33
  changePointsOrParams(props: {
33
34
  cornerPoints: Vector3[];
@@ -52,6 +53,7 @@ declare class VideoPlane extends MediaPlane {
52
53
  private buttonMesh?;
53
54
  private videoTextureMap;
54
55
  private ImageTextureMap;
56
+ private initialOpacity;
55
57
  constructor(videoSrc: string, cornerPoints: Vector3[], params?: {
56
58
  paused?: boolean;
57
59
  playButton?: 'withText' | 'withoutText' | string;
@@ -63,6 +65,7 @@ declare class VideoPlane extends MediaPlane {
63
65
  transparent: boolean;
64
66
  }>;
65
67
  domEvents?: FiveDomEvents;
68
+ opacity?: number;
66
69
  });
67
70
  play(muted?: boolean): Promise<void>;
68
71
  pause(): void;