@realsee/dnalogel 2.28.4 → 2.28.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.
@@ -1,31 +1,31 @@
1
1
  var T = Object.defineProperty, K = Object.defineProperties;
2
- var O = Object.getOwnPropertyDescriptors;
2
+ var A = Object.getOwnPropertyDescriptors;
3
3
  var F = Object.getOwnPropertySymbols;
4
- var U = Object.prototype.hasOwnProperty, A = Object.prototype.propertyIsEnumerable;
5
- var L = (c, u, e) => u in c ? T(c, u, { enumerable: !0, configurable: !0, writable: !0, value: e }) : c[u] = e, g = (c, u) => {
6
- for (var e in u || (u = {}))
7
- U.call(u, e) && L(c, e, u[e]);
4
+ var O = Object.prototype.hasOwnProperty, U = Object.prototype.propertyIsEnumerable;
5
+ var L = (c, l, e) => l in c ? T(c, l, { enumerable: !0, configurable: !0, writable: !0, value: e }) : c[l] = e, g = (c, l) => {
6
+ for (var e in l || (l = {}))
7
+ O.call(l, e) && L(c, e, l[e]);
8
8
  if (F)
9
- for (var e of F(u))
10
- A.call(u, e) && L(c, e, u[e]);
9
+ for (var e of F(l))
10
+ U.call(l, e) && L(c, e, l[e]);
11
11
  return c;
12
- }, C = (c, u) => K(c, O(u));
13
- var I = (c, u, e) => (L(c, typeof u != "symbol" ? u + "" : u, e), e);
14
- var v = (c, u, e) => new Promise((t, i) => {
12
+ }, C = (c, l) => K(c, A(l));
13
+ var I = (c, l, e) => (L(c, typeof l != "symbol" ? l + "" : l, e), e);
14
+ var v = (c, l, e) => new Promise((t, i) => {
15
15
  var r = (d) => {
16
16
  try {
17
17
  s(e.next(d));
18
- } catch (o) {
19
- i(o);
18
+ } catch (a) {
19
+ i(a);
20
20
  }
21
21
  }, n = (d) => {
22
22
  try {
23
23
  s(e.throw(d));
24
- } catch (o) {
25
- i(o);
24
+ } catch (a) {
25
+ i(a);
26
26
  }
27
27
  }, s = (d) => d.done ? t(d.value) : Promise.resolve(d.value).then(r, n);
28
- s((e = e.apply(c, u)).next());
28
+ s((e = e.apply(c, l)).next());
29
29
  });
30
30
  import { Controller as V } from "../base/BasePluginWithData.js";
31
31
  import { GuideLinePlugin as $ } from "../GuideLinePlugin/index.js";
@@ -239,30 +239,30 @@ class z extends V {
239
239
  */
240
240
  load(e, t, i) {
241
241
  return v(this, null, function* () {
242
- var a, m, f, l, h, P;
242
+ var o, m, p, u, h, P;
243
243
  if (this.state.disposed)
244
244
  return D();
245
- this.privateState.fiveOriginGetProgress || (m = (a = this.five.controller) == null ? void 0 : a.cameraMotion) != null && m.getProgress || (yield this.waitFiveLoaded(), this.privateState.fiveOriginGetProgress = (l = (f = this.five.controller) == null ? void 0 : f.cameraMotion) == null ? void 0 : l.getProgress), this.clear();
245
+ this.privateState.fiveOriginGetProgress || (m = (o = this.five.controller) == null ? void 0 : o.cameraMotion) != null && m.getProgress || (yield this.waitFiveLoaded(), this.privateState.fiveOriginGetProgress = (u = (p = this.five.controller) == null ? void 0 : p.cameraMotion) == null ? void 0 : u.getProgress), this.clear();
246
246
  const r = this.data ? JSON.parse(JSON.stringify(this.data)) : void 0, n = yield this.formatData(e);
247
247
  this.data = n, this.hooks.emit("dataChange", n, r);
248
248
  let s = [], d;
249
- const o = this.data.keyframes.filter((p) => p.data.panoIndex !== void 0);
250
- o.filter((p, y) => {
249
+ const a = this.data.keyframes.filter((f) => f.data.panoIndex !== void 0);
250
+ a.filter((f, y) => {
251
251
  var S;
252
- return p.data.panoIndex !== ((S = o[y - 1]) == null ? void 0 : S.data.panoIndex);
253
- }).map((p) => p.data.panoIndex).forEach((p) => {
252
+ return f.data.panoIndex !== ((S = a[y - 1]) == null ? void 0 : S.data.panoIndex);
253
+ }).map((f) => f.data.panoIndex).forEach((f) => {
254
254
  var S, k;
255
- const y = (S = this.five.work.observers[p]) == null ? void 0 : S.floorIndex;
255
+ const y = (S = this.five.work.observers[f]) == null ? void 0 : S.floorIndex;
256
256
  if (y !== void 0)
257
257
  if (d === y) {
258
258
  const b = s.length - 1;
259
- s[b] = [...(k = s[b]) != null ? k : [], p];
259
+ s[b] = [...(k = s[b]) != null ? k : [], f];
260
260
  } else {
261
261
  d = y;
262
262
  const b = s.length;
263
- s[b] = [p];
263
+ s[b] = [f];
264
264
  }
265
- }), !this.GuideLine && ((h = this.config) == null ? void 0 : h.useGuideLine) !== !1 && n.useGuildLine !== !1 && (this.GuideLine = $(this.five, this.config)), (P = this.GuideLine) == null || P.load({ routes: s.map((p) => ({ panoIndexList: p })), config: n.guildPluginOptions }), this.setState({ playing: !1 }), this.handleVisible(this.state.visible), this.handleEnable(this.state.enabled), this.changePlayState(this.state.playing), this.changeSpeed(this.state.speed), t && this.setState(t, { userAction: i }), console.debug(`${x} loaded`, n), this.hooks.emit("dataLoaded", n);
265
+ }), !this.GuideLine && ((h = this.config) == null ? void 0 : h.useGuideLine) !== !1 && n.useGuildLine !== !1 && (this.GuideLine = $(this.five, this.config)), (P = this.GuideLine) == null || P.load({ routes: s.map((f) => ({ panoIndexList: f })), config: n.guildPluginOptions }), t ? this.setState(t, { userAction: i }) : (this.setState({ playing: !1 }, { userAction: !1 }), this.handleVisible(this.state.visible), this.handleEnable(this.state.enabled), this.changePlayState(this.state.playing, { userAction: !1 }), this.changeSpeed(this.state.speed)), this.clearPauseData(), console.debug(`${x} loaded`, n), this.hooks.emit("dataLoaded", n);
266
266
  });
267
267
  }
268
268
  /**
@@ -352,34 +352,34 @@ class z extends V {
352
352
  return {
353
353
  keyframesId: w(),
354
354
  keyframes: i.keyframes.map((r, n) => {
355
- var o;
355
+ var a;
356
356
  const s = i.keyframes[n + 1], d = (() => !s || s.start === void 0 || r.end === void 0 ? 0 : s.start - r.end)();
357
- return C(g({ id: (o = r.uuid) != null ? o : w(), moveIndex: n, stay: d, index: n }, r), { guildPluginOptions: i.guildPluginOptions });
357
+ return C(g({ id: (a = r.uuid) != null ? a : w(), moveIndex: n, stay: d, index: n }, r), { guildPluginOptions: i.guildPluginOptions });
358
358
  })
359
359
  };
360
360
  if (i.panoIndexList) {
361
361
  let r = [];
362
362
  const { moveEffect: n, moveToFirstPanoEffect: s, moveToFirstPanoDuration: d } = i;
363
- return this.privateState.moveToFirstPanoEffect = s, this.privateState.moveToFirstPanoDuration = d, i.panoIndexList.forEach((o, a) => {
363
+ return this.privateState.moveToFirstPanoEffect = s, this.privateState.moveToFirstPanoDuration = d, i.panoIndexList.forEach((a, o) => {
364
364
  const m = (() => {
365
- var p, y, S, k;
366
- const f = i.panoIndexList.slice(a).find((b) => b !== o);
367
- if (f === void 0)
365
+ var f, y, S, k;
366
+ const p = i.panoIndexList.slice(o).find((b) => b !== a);
367
+ if (p === void 0)
368
368
  return;
369
- const l = (p = t[o]) == null ? void 0 : p.position, h = (y = t[f]) == null ? void 0 : y.position;
370
- if (!h || !l || ((S = t[o]) == null ? void 0 : S.floorIndex) !== ((k = t[f]) == null ? void 0 : k.floorIndex))
369
+ const u = (f = t[a]) == null ? void 0 : f.position, h = (y = t[p]) == null ? void 0 : y.position;
370
+ if (!h || !u || ((S = t[a]) == null ? void 0 : S.floorIndex) !== ((k = t[p]) == null ? void 0 : k.floorIndex))
371
371
  return;
372
- const P = new j.Vector3().subVectors(h, l);
372
+ const P = new j.Vector3().subVectors(h, u);
373
373
  return N(P.normalize());
374
374
  })();
375
375
  i.moveType === void 0 || i.moveType === "justMove" ? r.push({
376
- moveIndex: a,
376
+ moveIndex: o,
377
377
  stay: i.stay,
378
- data: g({ effect: "Move", panoIndex: o, moveEffect: n }, m != null ? m : {})
379
- }) : i.moveType === "moveAndRotate" && (r.push({ moveIndex: a, stay: i.stay, data: { effect: "Move", panoIndex: o, moveEffect: n } }), m && r.push({ moveIndex: a, stay: i.stay, data: g({ effect: "Rotate", panoIndex: o }, m) }));
378
+ data: g({ effect: "Move", panoIndex: a, moveEffect: n }, m != null ? m : {})
379
+ }) : i.moveType === "moveAndRotate" && (r.push({ moveIndex: o, stay: i.stay, data: { effect: "Move", panoIndex: a, moveEffect: n } }), m && r.push({ moveIndex: o, stay: i.stay, data: g({ effect: "Rotate", panoIndex: a }, m) }));
380
380
  }), {
381
381
  keyframesId: w(),
382
- keyframes: r.map((o, a) => g({ id: w(), index: a }, o)),
382
+ keyframes: r.map((a, o) => g({ id: w(), index: o }, a)),
383
383
  guildPluginOptions: i.guildPluginOptions,
384
384
  useGuildLine: i.useGuildLine
385
385
  };
@@ -411,32 +411,32 @@ class z extends V {
411
411
  // eslint-disable-next-line complexity
412
412
  handlePlay(e) {
413
413
  return v(this, null, function* () {
414
- var l;
414
+ var u;
415
415
  const { data: t, state: i, privateState: r, hooks: n } = this;
416
416
  if (r.playing || !(t != null && t.keyframes) || (t == null ? void 0 : t.keyframes.length) === 0)
417
417
  return;
418
418
  const s = w();
419
419
  r.playId = s, r.playing = !0, r.broke = !1;
420
- const d = t.keyframes, o = this.getPauseData();
421
- (e == null ? void 0 : e.notEmitEvent) !== !0 && n.emit("play", { userAction: (l = e == null ? void 0 : e.userAction) != null ? l : !0 });
422
- let a = !1;
423
- const f = yield (() => v(this, null, function* () {
420
+ const d = t.keyframes, a = this.getPauseData();
421
+ (e == null ? void 0 : e.notEmitEvent) !== !0 && n.emit("play", { userAction: (u = e == null ? void 0 : e.userAction) != null ? u : !0 });
422
+ let o = !1;
423
+ const p = yield (() => v(this, null, function* () {
424
424
  var h, P;
425
425
  if ((e == null ? void 0 : e.playFromIndex) !== void 0)
426
426
  return e.playFromIndex;
427
427
  if ((e == null ? void 0 : e.playFromId) !== void 0)
428
- return (h = this.data) == null ? void 0 : h.keyframes.findIndex((p) => p.id === e.playFromId);
429
- if (o != null && o.keyframeId) {
430
- const p = (P = this.data) == null ? void 0 : P.keyframes.find((y) => y.id === o.keyframeId);
431
- if (o != null && o.fiveState && (yield this.move(o.fiveState, {
428
+ return (h = this.data) == null ? void 0 : h.keyframes.findIndex((f) => f.id === e.playFromId);
429
+ if (a != null && a.keyframeId) {
430
+ const f = (P = this.data) == null ? void 0 : P.keyframes.find((y) => y.id === a.keyframeId);
431
+ if (a != null && a.fiveState && (yield this.move(a.fiveState, {
432
432
  moveEffect: r.moveToFirstPanoEffect,
433
433
  duration: r.moveToFirstPanoDuration
434
- })), p) {
435
- if (p.data.effect === "Move")
436
- return p.index;
437
- if (p.data.effect === "Rotate") {
438
- const y = o.duration !== void 0 ? o.duration * (1 - o.playedProgress) : void 0;
439
- return yield this.playKeyframe(p, { duration: y }), a = !0, p.index + 1;
434
+ })), f) {
435
+ if (f.data.effect === "Move")
436
+ return f.index;
437
+ if (f.data.effect === "Rotate") {
438
+ const y = a.duration !== void 0 ? a.duration * (1 - a.playedProgress) : void 0;
439
+ return yield this.playKeyframe(f, { duration: y }), o = !0, f.index + 1;
440
440
  }
441
441
  }
442
442
  }
@@ -445,12 +445,12 @@ class z extends V {
445
445
  for (const h of d) {
446
446
  if (r.broke || !i.playing || !r.playing || s !== r.playId)
447
447
  return;
448
- if (!(f !== void 0 && h.index < f))
448
+ if (!(p !== void 0 && h.index < p))
449
449
  try {
450
450
  n.emit("playIndexChange", h.index, h), yield this.playKeyframe(h, {
451
- moveEffect: a === !1 ? r.moveToFirstPanoEffect : void 0,
452
- duration: a === !1 && typeof r.moveToFirstPanoDuration == "number" ? r.moveToFirstPanoDuration : void 0
453
- }), h.stay && (yield J(h.stay)), a === !1 && (a = !0);
451
+ moveEffect: o === !1 ? r.moveToFirstPanoEffect : void 0,
452
+ duration: o === !1 && typeof r.moveToFirstPanoDuration == "number" ? r.moveToFirstPanoDuration : void 0
453
+ }), h.stay && (yield J(h.stay)), o === !1 && (o = !0);
454
454
  } catch (P) {
455
455
  return Promise.resolve("broke");
456
456
  }
@@ -464,7 +464,7 @@ class z extends V {
464
464
  handlePause(e) {
465
465
  var n;
466
466
  const { state: t, privateState: i, hooks: r } = this;
467
- t.playing = !1, i.playing !== !1 && (i.playing = !1, this.setPauseData(), i.broke || this.forceInteruptUpdateCamera(), (e == null ? void 0 : e.notEmitEvent) !== !0 && r.emit("pause", { userAction: (n = e == null ? void 0 : e.userAction) != null ? n : !0 }));
467
+ t.playing = !1, i.playing !== !1 && (i.playing = !1, (e == null ? void 0 : e.userAction) !== !1 && this.setPauseData(), i.broke || this.forceInteruptUpdateCamera(), (e == null ? void 0 : e.notEmitEvent) !== !0 && r.emit("pause", { userAction: (n = e == null ? void 0 : e.userAction) != null ? n : !0 }));
468
468
  }
469
469
  /**
470
470
  * @description Play single keyframe
@@ -496,28 +496,28 @@ class z extends V {
496
496
  const r = e.data;
497
497
  if (t.duration = (n = t.duration) != null ? n : e.start !== void 0 && e.end !== void 0 ? e.end - e.start : void 0, !!r)
498
498
  return new Promise((s, d) => {
499
- let o = !1;
499
+ let a = !1;
500
500
  this.addInterruptListener(() => {
501
- if (!o)
502
- return this.hooks.emit("broke"), this.privateState.broke = !0, this.setState({ playing: !1 }), o = !0, d(new Error("play is interupted"));
501
+ if (!a)
502
+ return this.hooks.emit("broke"), this.privateState.broke = !0, this.setState({ playing: !1 }), a = !0, d(new Error("play is interupted"));
503
503
  });
504
504
  try {
505
- if (o)
505
+ if (a)
506
506
  return;
507
- const a = () => {
508
- s(), o = !0;
507
+ const o = () => {
508
+ s(), a = !0;
509
509
  };
510
510
  switch (r.effect) {
511
511
  case "Move":
512
- this.move(r, t).then(a);
512
+ this.move(r, t).then(o);
513
513
  break;
514
514
  case "Rotate":
515
- this.rotate(r, t).then(a);
515
+ this.rotate(r, t).then(o);
516
516
  break;
517
517
  default:
518
- this.rotate(r, t).then(a);
518
+ this.rotate(r, t).then(o);
519
519
  }
520
- } catch (a) {
520
+ } catch (o) {
521
521
  }
522
522
  });
523
523
  });
@@ -573,13 +573,13 @@ class z extends V {
573
573
  updateCamera(i) {
574
574
  return v(this, arguments, function* (e, t = {}) {
575
575
  const { five: r, privateState: n, state: s } = this, d = (() => {
576
- var l, h;
577
- const m = (l = s.config) == null ? void 0 : l.speedConfig, f = (h = e.rotateSpeed) != null ? h : m == null ? void 0 : m.rotateSpeed;
576
+ var u, h;
577
+ const m = (u = s.config) == null ? void 0 : u.speedConfig, p = (h = e.rotateSpeed) != null ? h : m == null ? void 0 : m.rotateSpeed;
578
578
  if ((m == null ? void 0 : m.rotateSpeedUnit) === void 0)
579
- return f;
580
- if (f !== void 0)
581
- return m.rotateSpeedUnit === "rad/ms" ? f : f / 1e3;
582
- })(), o = (() => {
579
+ return p;
580
+ if (p !== void 0)
581
+ return m.rotateSpeedUnit === "rad/ms" ? p : p / 1e3;
582
+ })(), a = (() => {
583
583
  if (t.duration)
584
584
  return t.duration;
585
585
  if (d) {
@@ -588,10 +588,10 @@ class z extends V {
588
588
  }
589
589
  return 800;
590
590
  })();
591
- n.currentPlayKeyframe && (n.currentPlayKeyframe.originDuration = o);
592
- const a = this.getSpeededDuration(o);
591
+ n.currentPlayKeyframe && (n.currentPlayKeyframe.originDuration = a);
592
+ const o = this.getSpeededDuration(a);
593
593
  return new Promise((m) => {
594
- _(() => r.updateCamera(e, a)), setTimeout(() => m(), a);
594
+ _(() => r.updateCamera(e, o)), setTimeout(() => m(), o);
595
595
  });
596
596
  });
597
597
  }
@@ -606,32 +606,32 @@ class z extends V {
606
606
  const s = i.getCurrentState().mode !== "Panorama";
607
607
  s && (this.privateState.modeChanging = !0);
608
608
  const d = (() => {
609
- var f, l;
610
- const a = (f = n.config) == null ? void 0 : f.speedConfig, m = (l = e.moveSpeed) != null ? l : a == null ? void 0 : a.moveSpeed;
611
- if ((a == null ? void 0 : a.moveSpeedUnit) === void 0)
609
+ var p, u;
610
+ const o = (p = n.config) == null ? void 0 : p.speedConfig, m = (u = e.moveSpeed) != null ? u : o == null ? void 0 : o.moveSpeed;
611
+ if ((o == null ? void 0 : o.moveSpeedUnit) === void 0)
612
612
  return m;
613
613
  if (m !== void 0)
614
- return a.moveSpeedUnit === "m/ms" ? m : m / 1e3;
615
- })(), o = (() => {
614
+ return o.moveSpeedUnit === "m/ms" ? m : m / 1e3;
615
+ })(), a = (() => {
616
616
  if (t != null && t.duration)
617
617
  return t.duration;
618
618
  if (d && typeof i.panoIndex == "number" && typeof e.panoIndex == "number") {
619
- const a = i.work.observers[i.panoIndex].position, m = i.work.observers[e.panoIndex].position;
620
- return a.distanceTo(m) / d;
619
+ const o = i.work.observers[i.panoIndex].position, m = i.work.observers[e.panoIndex].position;
620
+ return o.distanceTo(m) / d;
621
621
  }
622
622
  return 800;
623
623
  })();
624
- r.currentPlayKeyframe && (r.currentPlayKeyframe.originDuration = o), yield new Promise((a) => {
625
- var m, f, l;
624
+ r.currentPlayKeyframe && (r.currentPlayKeyframe.originDuration = a), yield new Promise((o) => {
625
+ var m, p, u;
626
626
  i.moveToPano(e.panoIndex, {
627
627
  latitude: e.latitude,
628
628
  longitude: e.longitude,
629
629
  fov: e.fov,
630
- duration: this.getSpeededDuration(o),
631
- effect: (l = (f = t == null ? void 0 : t.moveEffect) != null ? f : (m = this.state.config) == null ? void 0 : m.moveEffect) != null ? l : e.moveEffect,
632
- moveCancelCallback: () => a(),
633
- moveEndCallback: () => a()
634
- }), s && i.once("panoArrived", () => a());
630
+ duration: this.getSpeededDuration(a),
631
+ effect: (u = (p = t == null ? void 0 : t.moveEffect) != null ? p : (m = this.state.config) == null ? void 0 : m.moveEffect) != null ? u : e.moveEffect,
632
+ moveCancelCallback: () => o(),
633
+ moveEndCallback: () => o()
634
+ }), s && i.once("panoArrived", () => o());
635
635
  }), s && (this.privateState.modeChanging = !1);
636
636
  });
637
637
  }
@@ -642,8 +642,8 @@ class z extends V {
642
642
  const { state: i, privateState: r, hooks: n } = this, { currentPlayKeyframe: s } = r;
643
643
  if (n.emit("speedChange", e, { userAction: t }), i.playing && s)
644
644
  try {
645
- const d = s.originDuration !== void 0 ? s.originDuration * (1 - this.getProgress()) : void 0, o = this.playKeyframe(s.keyframe, { duration: d });
646
- r.currentPlayQueue.push(o);
645
+ const d = s.originDuration !== void 0 ? s.originDuration * (1 - this.getProgress()) : void 0, a = this.playKeyframe(s.keyframe, { duration: d });
646
+ r.currentPlayQueue.push(a);
647
647
  } catch (d) {
648
648
  }
649
649
  }
@@ -13,6 +13,8 @@ export declare class PanoCompassController extends BasePlugin.Controller<State,
13
13
  private roomInfoWrapperInstance?;
14
14
  private compassMeshTween?;
15
15
  private compassMesh?;
16
+ private logoMesh?;
17
+ private logoMeshTween?;
16
18
  private entryDoorMesh?;
17
19
  constructor(five: Five, config?: PanoCompassPluginParameterType);
18
20
  /**
@@ -68,6 +70,7 @@ export declare class PanoCompassController extends BasePlugin.Controller<State,
68
70
  */
69
71
  private _toggleVisible;
70
72
  private _clearCompassIfNeed;
73
+ private _clearLogoIfNeed;
71
74
  private _clearEntryDoorIfNeed;
72
75
  /**
73
76
  * 初始化
@@ -75,6 +78,7 @@ export declare class PanoCompassController extends BasePlugin.Controller<State,
75
78
  */
76
79
  private init;
77
80
  private loadCompassMesh;
81
+ private loadLogoMesh;
78
82
  private loadEntryDoorMesh;
79
83
  private loadRoomInfo;
80
84
  private onFivePanoWillArrive;