@expofp/floorplan 3.1.16 → 3.2.1

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 (67) hide show
  1. package/dist/browser/{CookieConsent-CQDsrgbU.js → CookieConsent-B3rZd5BD.js} +35 -35
  2. package/dist/browser/{Debug-BcNSH-iH.js → Debug-CtVuELkw.js} +6 -6
  3. package/dist/browser/{Demo-kCvUOITO.js → Demo-iGvQURlh.js} +8 -8
  4. package/dist/browser/{Free-gXfqnUd5.js → Free-jQoUFwnQ.js} +8 -8
  5. package/dist/browser/{Gallery-B3QdUWyQ.js → Gallery-D9unamG6.js} +8 -8
  6. package/dist/browser/{GpsLoader-BET4xXNq.js → GpsLoader-DkYSuJhi.js} +8 -8
  7. package/dist/browser/{KioskStore-bZFEkEBb.js → KioskStore-BWQF6jWI.js} +3 -3
  8. package/dist/browser/{Mapbox-BMWZ6QK9.js → Mapbox-B5hU1R6O.js} +8 -8
  9. package/dist/browser/{SetKioskMode-adPAc7ky.js → SetKioskMode-KF0x8l6b.js} +7 -7
  10. package/dist/browser/{ShowKiosk-B6dVPRek.js → ShowKiosk-mMook1HE.js} +9 -9
  11. package/dist/browser/{ThreeComponent-DXZ3u550.js → ThreeComponent-DGb4xeIj.js} +9 -9
  12. package/dist/browser/{TouchHand-DyT_zF5n.js → TouchHand-BGpJ5ZoN.js} +4 -4
  13. package/dist/browser/{ViewerMenuPanel-OJ8Lwc6C.js → ViewerMenuPanel-C9nR9pDs.js} +7 -7
  14. package/dist/browser/{add-debug-secret-listener-CrvCxTcP.js → add-debug-secret-listener-BxpWvt2V.js} +1 -1
  15. package/dist/browser/{boolean-editor-stkieJaB.js → boolean-editor-B8hTuIli.js} +10 -10
  16. package/dist/browser/{bootIntercom-B3nU6CQ3.js → bootIntercom-B_dfAShm.js} +1 -1
  17. package/dist/browser/{box-6tZLiac7.js → box-XKE9wNFD.js} +5 -5
  18. package/dist/browser/{browser-DztBjbWO.js → browser-CfLYfucL.js} +2 -2
  19. package/dist/browser/bundle.json +53 -53
  20. package/dist/browser/{classnames-DJRhtNjm.js → classnames-D1nDaB1k.js} +2 -2
  21. package/dist/browser/{client-DQmw7z9y.js → client-CqNrKj3Z.js} +4 -4
  22. package/dist/browser/{data-BYoZaMAv.js → data-DCahfCwH.js} +3 -3
  23. package/dist/browser/debug-overlay-CvlEeTSZ.js +1419 -0
  24. package/dist/browser/{debug-ui-CgqpvDtO.js → debug-ui-CGkAroSA.js} +6 -6
  25. package/dist/browser/{dist-CZc9sNMJ.js → dist-C93oFc3k.js} +5 -5
  26. package/dist/browser/{dist-BrrtR5hI.js → dist-CUXae8IG.js} +6 -6
  27. package/dist/browser/{dist-UA5mlHFV.js → dist-DUyMiRTQ.js} +3 -3
  28. package/dist/browser/{efp-debug-init-DxEkBswA.js → efp-debug-init-CPhU_V_k.js} +2 -2
  29. package/dist/browser/{enum-editor-BqAmDc3H.js → enum-editor-Byu5xdzX.js} +11 -11
  30. package/dist/browser/{exports-isM-09GK.js → exports-CvumiE4t.js} +1 -1
  31. package/dist/browser/{favicon-UD4Q-f4j.js → favicon-ChtnCZED.js} +1 -1
  32. package/dist/browser/{fetch-retry.umd-BlVbY13p.js → fetch-retry.umd-CUDVAzSk.js} +2 -2
  33. package/dist/browser/{flex-DjbrjC-1.js → flex-DEZMrFqS.js} +6 -6
  34. package/dist/browser/{flex.props-DRQDPH-O.js → flex.props-CTNEi3-q.js} +2 -2
  35. package/dist/browser/{floorplan.loader-D_Y9hWQE.js → floorplan.loader-DRiVqkzc.js} +12 -9
  36. package/dist/browser/{floorplan.ready-3P6ZV_dx.js → floorplan.ready-ixjJTYPz.js} +16 -13
  37. package/dist/browser/{fuse-C-Yh6YLb.js → fuse-BurZ2sWK.js} +2 -2
  38. package/dist/browser/index.js +12 -12
  39. package/dist/browser/{is-debug-CKVIbwoe.js → is-debug-CEXcAujw.js} +3 -3
  40. package/dist/browser/{jsx-runtime-CejsiA26.js → jsx-runtime-CdO4u0ay.js} +2 -2
  41. package/dist/browser/{lib-DEVDgOR7.js → lib-BOUBrJ0U.js} +4 -4
  42. package/dist/browser/{main-xMAYA3qI.js → main-B4iuu1xd.js} +1 -1
  43. package/dist/browser/{mobx-B9XJ7XE6.js → mobx-3pfZzP7b.js} +4 -4
  44. package/dist/browser/{particles.min-BCFkS7oE.js → particles.min-CUYvw8D7.js} +2 -2
  45. package/dist/browser/{prop-types-DmxC3QAy.js → prop-types-Ks0MlfLO.js} +2 -2
  46. package/dist/browser/{react-B-G3L7Rn.js → react-Cd6ISJpP.js} +2 -2
  47. package/dist/browser/{react-dom-CKbkBaWy.js → react-dom-CRaVzmYs.js} +3 -3
  48. package/dist/browser/{reset-all-settings-y8JdCGMy.js → reset-all-settings-CVh0zFJu.js} +7 -7
  49. package/dist/browser/{rolldown-runtime-AkR64urP.js → rolldown-runtime-Do50O3yd.js} +1 -1
  50. package/dist/browser/{settings-r22_PX70.js → settings-10SJFxQW.js} +2 -2
  51. package/dist/browser/{settings-item-SpULjWL4.js → settings-item-e8s2pQ6C.js} +6 -6
  52. package/dist/browser/{store-_SJRUdHN.js → store-B8knN7JY.js} +14 -13
  53. package/dist/browser/{string-editor-CrznPV96.js → string-editor-5jYoetRz.js} +8 -8
  54. package/dist/browser/{theme-BrkbjjxD.js → theme-CIykb3CO.js} +8 -8
  55. package/dist/browser/{ui-DeHGdVUf.js → ui-D-0Ugpyf.js} +8 -8
  56. package/dist/esm/components/QrCode.js +1 -1
  57. package/dist/esm/components/Wayfinding.js +1 -1
  58. package/dist/esm/floorplan.loader.d.ts +1 -0
  59. package/dist/esm/floorplan.loader.js +1 -1
  60. package/dist/esm/floorplan.ready.d.ts +1 -0
  61. package/dist/esm/floorplan.ready.js +1 -1
  62. package/dist/esm/services/routing.js +1 -1
  63. package/dist/esm/store/RouteStore.d.ts +1 -0
  64. package/dist/esm/store/RouteStore.js +1 -1
  65. package/dist/esm/types.d.ts +52 -0
  66. package/package.json +3 -3
  67. package/dist/browser/debug-overlay-HtSxJTNa.js +0 -1419
@@ -2,7 +2,7 @@
2
2
  (function() {
3
3
  try {
4
4
  var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {};
5
- e.SENTRY_RELEASE = { id: "3.1.16" };
5
+ e.SENTRY_RELEASE = { id: "3.2.1" };
6
6
  var t = new e.Error().stack;
7
7
  t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "4a11513d-0070-4205-b636-a85d593cfa99", e._sentryDebugIdIdentifier = "sentry-dbid-4a11513d-0070-4205-b636-a85d593cfa99");
8
8
  } catch {}
@@ -1,9 +1,9 @@
1
1
  (function() {
2
2
  try {
3
3
  var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {};
4
- e.SENTRY_RELEASE = { id: "3.1.16" };
4
+ e.SENTRY_RELEASE = { id: "3.2.1" };
5
5
  var t = new e.Error().stack;
6
6
  t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "0a3595ef-9aa6-450c-ac03-85d9c3295c13", e._sentryDebugIdIdentifier = "sentry-dbid-0a3595ef-9aa6-450c-ac03-85d9c3295c13");
7
7
  } catch {}
8
8
  })();
9
- import "./reset-all-settings-y8JdCGMy.js";
9
+ import "./reset-all-settings-CVh0zFJu.js";
@@ -1,16 +1,16 @@
1
1
  (function() {
2
2
  try {
3
3
  var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {};
4
- e.SENTRY_RELEASE = { id: "3.1.16" };
4
+ e.SENTRY_RELEASE = { id: "3.2.1" };
5
5
  var t = new e.Error().stack;
6
6
  t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "97df4986-8841-4629-a21b-87caec591399", e._sentryDebugIdIdentifier = "sentry-dbid-97df4986-8841-4629-a21b-87caec591399");
7
7
  } catch {}
8
8
  })();
9
- import { r as e } from "./rolldown-runtime-AkR64urP.js";
10
- import { t } from "./react-B-G3L7Rn.js";
11
- import { t as n } from "./jsx-runtime-CejsiA26.js";
12
- import { c as r, l as i, s as a, t as o, v as s } from "./box-6tZLiac7.js";
13
- import { t as c } from "./classnames-DJRhtNjm.js";
9
+ import { r as e } from "./rolldown-runtime-Do50O3yd.js";
10
+ import { t } from "./react-Cd6ISJpP.js";
11
+ import { t as n } from "./jsx-runtime-CdO4u0ay.js";
12
+ import { c as r, l as i, s as a, t as o, v as s } from "./box-XKE9wNFD.js";
13
+ import { t as c } from "./classnames-D1nDaB1k.js";
14
14
  //#region ../../node_modules/.pnpm/@radix-ui+themes@3.3.0_@types+react-dom@19.2.3_@types+react@19.2.14__@types+react@19.2._c0b9fed6e211d5c83adcfe1ae3769049/node_modules/@radix-ui/themes/dist/esm/components/separator.props.js
15
15
  var l = /* @__PURE__ */ e(t()), u = /* @__PURE__ */ e(c()), d = {
16
16
  orientation: {
@@ -2,17 +2,17 @@ function __vite_inject_css__(css, id, forceLightDom){ if (typeof document==='un
2
2
  (function() {
3
3
  try {
4
4
  var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {};
5
- e.SENTRY_RELEASE = { id: "3.1.16" };
5
+ e.SENTRY_RELEASE = { id: "3.2.1" };
6
6
  var t = new e.Error().stack;
7
- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "27571125-ec66-4210-9e3e-69dc20653c8d", e._sentryDebugIdIdentifier = "sentry-dbid-27571125-ec66-4210-9e3e-69dc20653c8d");
7
+ t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "7047a695-0a2e-4db1-8b8e-45306b4f442f", e._sentryDebugIdIdentifier = "sentry-dbid-7047a695-0a2e-4db1-8b8e-45306b4f442f");
8
8
  } catch {}
9
9
  })();
10
- import { r as e, t } from "./rolldown-runtime-AkR64urP.js";
11
- import { t as n } from "./react-B-G3L7Rn.js";
12
- import { t as r } from "./jsx-runtime-CejsiA26.js";
13
- import { t as i } from "./browser-DztBjbWO.js";
14
- import { C as a, Ct as o, D as s, E as c, Et as l, F as u, G as d, H as f, I as p, K as m, L as h, M as g, N as _, O as v, P as y, St as b, W as x, Y as S, _ as C, _t as w, a as T, b as E, bt as D, c as O, ct as k, d as A, et as ee, f as te, ft as ne, g as re, h as j, ht as ie, i as ae, j as oe, l as se, m as ce, mt as le, n as ue, o as de, p as M, pt as fe, q as pe, r as me, st as he, t as N, tt as ge, u as P, ut as _e, v as F, x as ve, xt as ye, y as I } from "./is-debug-CKVIbwoe.js";
15
- import { t as be } from "./classnames-DJRhtNjm.js";
10
+ import { r as e, t } from "./rolldown-runtime-Do50O3yd.js";
11
+ import { t as n } from "./react-Cd6ISJpP.js";
12
+ import { t as r } from "./jsx-runtime-CdO4u0ay.js";
13
+ import { t as i } from "./browser-CfLYfucL.js";
14
+ import { C as a, Ct as o, D as s, E as c, Et as l, F as u, G as d, H as f, I as p, K as m, L as h, M as g, N as _, O as v, P as y, St as b, W as x, Y as S, _ as C, _t as w, a as T, b as E, bt as D, c as O, ct as k, d as A, et as ee, f as te, ft as ne, g as re, h as j, ht as ie, i as ae, j as oe, l as se, m as ce, mt as le, n as ue, o as de, p as M, pt as fe, q as pe, r as me, st as he, t as N, tt as ge, u as P, ut as _e, v as F, x as ve, xt as ye, y as I } from "./is-debug-CEXcAujw.js";
15
+ import { t as be } from "./classnames-D1nDaB1k.js";
16
16
  //#region ../../node_modules/.pnpm/mobx-react-lite@1.5.2_mobx@5.15.7_react@19.2.5/node_modules/mobx-react-lite/dist/index.module.js
17
17
  var xe = /* @__PURE__ */ e(n());
18
18
  if (!xe.useState) throw Error("mobx-react-lite requires React with Hooks support");
@@ -30457,6 +30457,9 @@ var qM = (e) => typeof e == "string" ? Number(e.replace(",", ".")) : e, JM = (wM
30457
30457
  get gpsEnabled() {
30458
30458
  return R.autoTrackingGps && this.isGpsTrackingEnabled && !R.enableIPS;
30459
30459
  }
30460
+ setOnlyAccessible(e) {
30461
+ this.onlyAccessible = e;
30462
+ }
30460
30463
  }, kM = KM(G.prototype, "routeLines", [F], {
30461
30464
  configurable: !0,
30462
30465
  enumerable: !0,
@@ -30572,7 +30575,7 @@ var qM = (e) => typeof e == "string" ? Number(e.replace(",", ".")) : e, JM = (wM
30572
30575
  initializer: function() {
30573
30576
  return !0;
30574
30577
  }
30575
- }), KM(G.prototype, "setGpsTrackingEnabled", [M], Object.getOwnPropertyDescriptor(G.prototype, "setGpsTrackingEnabled"), G.prototype), KM(G.prototype, "gpsEnabled", [OM], Object.getOwnPropertyDescriptor(G.prototype, "gpsEnabled"), G.prototype), G);
30578
+ }), KM(G.prototype, "setGpsTrackingEnabled", [M], Object.getOwnPropertyDescriptor(G.prototype, "setGpsTrackingEnabled"), G.prototype), KM(G.prototype, "gpsEnabled", [OM], Object.getOwnPropertyDescriptor(G.prototype, "gpsEnabled"), G.prototype), KM(G.prototype, "setOnlyAccessible", [M], Object.getOwnPropertyDescriptor(G.prototype, "setOnlyAccessible"), G.prototype), G);
30576
30579
  function YM(e) {
30577
30580
  return {
30578
30581
  ...e,
@@ -31295,9 +31298,7 @@ function JN() {
31295
31298
  }
31296
31299
  } else if (e.startsWith("route")) {
31297
31300
  let t = e.split(":");
31298
- E(() => {
31299
- Q.routeStore.onlyAccessible = t[3] === "true";
31300
- });
31301
+ Q.routeStore.setOnlyAccessible(t[3] === "true");
31301
31302
  let n = eN(t[2], t[1], t.slice(4));
31302
31303
  Q.routeStore.selectRoute(n);
31303
31304
  let r = t.slice(4).length > 0;
@@ -34219,7 +34220,7 @@ var hL = (dL = class {
34219
34220
  }
34220
34221
  async buildEngine() {
34221
34222
  try {
34222
- let { default: e } = await import("./fuse-C-Yh6YLb.js").then((e) => e.n);
34223
+ let { default: e } = await import("./fuse-BurZ2sWK.js").then((e) => e.n);
34223
34224
  E(() => {
34224
34225
  this.engine = new e([], {
34225
34226
  keys: this.keys,
@@ -1,18 +1,18 @@
1
1
  (function() {
2
2
  try {
3
3
  var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {};
4
- e.SENTRY_RELEASE = { id: "3.1.16" };
4
+ e.SENTRY_RELEASE = { id: "3.2.1" };
5
5
  var t = new e.Error().stack;
6
6
  t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "ad0b7429-2216-49bc-b4c2-a2d12f366be7", e._sentryDebugIdIdentifier = "sentry-dbid-ad0b7429-2216-49bc-b4c2-a2d12f366be7");
7
7
  } catch {}
8
8
  })();
9
- import { r as e } from "./rolldown-runtime-AkR64urP.js";
10
- import { t } from "./react-B-G3L7Rn.js";
11
- import { t as n } from "./jsx-runtime-CejsiA26.js";
12
- import { E as r, c as i, l as a, o, r as s, v as c } from "./box-6tZLiac7.js";
13
- import { t as l } from "./classnames-DJRhtNjm.js";
14
- import { t as u } from "./flex.props-DRQDPH-O.js";
15
- import { t as d } from "./settings-item-SpULjWL4.js";
9
+ import { r as e } from "./rolldown-runtime-Do50O3yd.js";
10
+ import { t } from "./react-Cd6ISJpP.js";
11
+ import { t as n } from "./jsx-runtime-CdO4u0ay.js";
12
+ import { E as r, c as i, l as a, o, r as s, v as c } from "./box-XKE9wNFD.js";
13
+ import { t as l } from "./classnames-D1nDaB1k.js";
14
+ import { t as u } from "./flex.props-CTNEi3-q.js";
15
+ import { t as d } from "./settings-item-e8s2pQ6C.js";
16
16
  //#region ../../node_modules/.pnpm/@radix-ui+themes@3.3.0_@types+react-dom@19.2.3_@types+react@19.2.14__@types+react@19.2._c0b9fed6e211d5c83adcfe1ae3769049/node_modules/@radix-ui/themes/dist/esm/components/text-field.props.js
17
17
  var f = {
18
18
  size: {
@@ -1,18 +1,18 @@
1
1
  (function() {
2
2
  try {
3
3
  var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {};
4
- e.SENTRY_RELEASE = { id: "3.1.16" };
4
+ e.SENTRY_RELEASE = { id: "3.2.1" };
5
5
  var t = new e.Error().stack;
6
6
  t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "90d0766a-2911-4661-88ef-a6bc95ba851f", e._sentryDebugIdIdentifier = "sentry-dbid-90d0766a-2911-4661-88ef-a6bc95ba851f");
7
7
  } catch {}
8
8
  })();
9
- import { r as e } from "./rolldown-runtime-AkR64urP.js";
10
- import { t } from "./react-B-G3L7Rn.js";
11
- import { t as n } from "./jsx-runtime-CejsiA26.js";
12
- import { t as r } from "./react-dom-CKbkBaWy.js";
13
- import { C as i, D as a, S as o, T as s, _ as c, a as l, g as u, w as d } from "./box-6tZLiac7.js";
14
- import { c as f, i as p, n as m, o as h, r as g, s as _, t as v } from "./dist-BrrtR5hI.js";
15
- import { t as y } from "./classnames-DJRhtNjm.js";
9
+ import { r as e } from "./rolldown-runtime-Do50O3yd.js";
10
+ import { t } from "./react-Cd6ISJpP.js";
11
+ import { t as n } from "./jsx-runtime-CdO4u0ay.js";
12
+ import { t as r } from "./react-dom-CRaVzmYs.js";
13
+ import { C as i, D as a, S as o, T as s, _ as c, a as l, g as u, w as d } from "./box-XKE9wNFD.js";
14
+ import { c as f, i as p, n as m, o as h, r as g, s as _, t as v } from "./dist-CUXae8IG.js";
15
+ import { t as y } from "./classnames-D1nDaB1k.js";
16
16
  //#region ../../node_modules/.pnpm/@radix-ui+react-visually-hidden@1.2.3_@types+react-dom@19.2.3_@types+react@19.2.14__@ty_e810030844e1cfedd403eda403a3d8c6/node_modules/@radix-ui/react-visually-hidden/dist/index.mjs
17
17
  var b = /* @__PURE__ */ e(r(), 1), x = /* @__PURE__ */ e(t(), 1), S = n(), C = Object.freeze({
18
18
  position: "absolute",
@@ -1,17 +1,17 @@
1
1
  (function() {
2
2
  try {
3
3
  var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {};
4
- e.SENTRY_RELEASE = { id: "3.1.16" };
4
+ e.SENTRY_RELEASE = { id: "3.2.1" };
5
5
  var t = new e.Error().stack;
6
6
  t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "92182a39-8df3-47fb-a7de-39aa7bf1975b", e._sentryDebugIdIdentifier = "sentry-dbid-92182a39-8df3-47fb-a7de-39aa7bf1975b");
7
7
  } catch {}
8
8
  })();
9
- import { r as e } from "./rolldown-runtime-AkR64urP.js";
10
- import { i as t, r as n } from "./reset-all-settings-y8JdCGMy.js";
11
- import { t as r } from "./jsx-runtime-CejsiA26.js";
12
- import "./settings-r22_PX70.js";
13
- import { t as i } from "./browser-DztBjbWO.js";
14
- import { t as a } from "./add-debug-secret-listener-CrvCxTcP.js";
9
+ import { r as e } from "./rolldown-runtime-Do50O3yd.js";
10
+ import { i as t, r as n } from "./reset-all-settings-CVh0zFJu.js";
11
+ import { t as r } from "./jsx-runtime-CdO4u0ay.js";
12
+ import "./settings-10SJFxQW.js";
13
+ import { t as i } from "./browser-CfLYfucL.js";
14
+ import { t as a } from "./add-debug-secret-listener-BxpWvt2V.js";
15
15
  //#region ../debug/src/lib/ui/render-debug-ui.tsx
16
16
  var o = /* @__PURE__ */ e(i(), 1), s = r(), c = !1;
17
17
  function l() {
@@ -26,7 +26,7 @@ function l() {
26
26
  }
27
27
  });
28
28
  let i = async (t) => {
29
- let { DebugUi: n } = await import("./debug-ui-CgqpvDtO.js"), { createRoot: i } = await import("./client-DQmw7z9y.js").then((t) => /* @__PURE__ */ e(t.default, 1)), a = document.createElement("div");
29
+ let { DebugUi: n } = await import("./debug-ui-CGkAroSA.js"), { createRoot: i } = await import("./client-CqNrKj3Z.js").then((t) => /* @__PURE__ */ e(t.default, 1)), a = document.createElement("div");
30
30
  document.body.appendChild(a), i(a).render(/* @__PURE__ */ (0, s.jsx)(n, {
31
31
  useDebugButtonState: r.useState,
32
32
  open: t
@@ -1 +1 @@
1
- import{lazy as o}from"react";const r=o(()=>import("react-qr-code"));export default r;
1
+ import{lazy as e}from"react";const o=e(()=>import("react-qr-code").then(t=>({default:t.QRCode??t.default})));export default o;
@@ -1 +1 @@
1
- import{jsx as f,jsxs as U}from"react/jsx-runtime";import x from"classnames";import{useObserver as C}from"mobx-react-lite";import{useEffect as m,useMemo as B,useState as V,useRef as _}from"react";import z from"../data";import{getLayerSvg as $}from"../data/svg";import r,{boothStore as F,exhibitorStore as K,uiState as e}from"../store";import{RegularBooth as L}from"../store/BoothStore";import{Route as S}from"../store/RouteStore";import I from"../tools/settings";import{t as y}from"../utils/i18n";import Q from"./EntityList";import X from"./WayfindingTemplate";import{calcSpeed as q}from"../utils/calcSpeed";import{calcTravelTime as G}from"../utils/calcTravelTime";import{DEFAULT_UNITS as H}from"../constants";import"./Wayfinding.scss";function J(){const k=_(null),a=B(()=>r.routeStore.pathLayers.map(i=>({id:i.id,name:i.layer?.shortName,description:i.layer?.description,basePriority:i.layer?.basePriority??0})),[r.routeStore.pathLayers]),[b,R]=V();m(()=>{b||R(a[0])},[r.routeStore.pathLayers,a]),m(()=>{const i=a.find(u=>u.description?.toLowerCase()===r.routeStore.currentRouteLayer?.description?.toLowerCase());i&&R(i)},[r.routeStore.currentRouteLayer,a]),m(()=>{const i=e.selectedRoute;if(!i){e.setIsMultiPointRoute(!1);return}const c=(i.waypoints?.length||0)>0;e.setIsMultiPointRoute(c)},[e.selectedRoute]);const T=()=>{const{from:i,to:u}=e.selectedRoute;return!!(i&&u)},N=()=>e.overlaySize==="full",D=()=>!!(T()&&!N()),g=()=>{const i=e.selectedRoute;return i?(i.waypoints?.length||0)>0?"multi":"simple":"none"},M=()=>e.routeTitle;return m(()=>{g()==="multi"&&e.selectedRoute},[e.selectedRoute]),C(()=>{const i=g(),u=M();if(i==="multi")return U("div",{className:x("main-wayfinding",{hidden:e.kiosk&&e.selectedRoute?.from&&e.selectedRoute?.to}),children:[e.routeDescription&&f("div",{className:"efp-wayfinding-description",children:e.routeDescription}),f(Q,{updatedScrollableRef:k})]});const c=[],p=()=>r.routeStore.defaultFrom?F.booths.concat([r.routeStore.defaultFrom]):F.booths,A=p().filter(t=>t instanceof L),E=p().filter(t=>!(t instanceof L)),w=()=>{let t=[];return K.exhibitors.forEach(o=>{c.push(...o.booths.map(s=>s.id)),t.push(...o.booths.map(s=>({value:s.id.toString(),label:o.name+" - "+s.fullName})))}),E.filter(o=>c.indexOf(o.id)===-1).forEach(o=>{t.push({value:o.id.toString(),label:o.fullName})}),t=t.sort((o,s)=>o.label.localeCompare(s.label,void 0,{sensitivity:"base"})),A.filter(o=>c.indexOf(o.id)===-1).forEach(o=>{t.push({value:o.id.toString(),label:o.fullName})}),t},v=(t,o=!0)=>{const s=p().filter(d=>d.id.toString()===t)[0],{from:n,to:l}=e.selectedRoute;o?r.routeStore.selectRoute(new S(s||null,l)):r.routeStore.selectRoute(new S(n,s||null))},O=t=>{const o=[],s=$().getAttribute("units")||H,n=G(t,q(s));let l=new Date;l.setMinutes(l.getMinutes()+n/60);const d=l.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});return o.push({title:y("Travel time"),text:n<60?"< 1 min":`~ ${Math.round(n/60)} min`},{title:y("Distance"),text:Math.round(t)+` ${s}`},{title:y("Est arrival"),text:d}),o},W=()=>{const{from:t,to:o}=e.selectedRoute;r.routeStore.selectRoute(new S(o,t))},P=e.selectedRoute?.from&&e.selectedRoute?.to&&!r.routeStore.routeLines.length;return f("div",{className:x("main-wayfinding",{hidden:e.kiosk&&e.selectedRoute?.from&&e.selectedRoute?.to}),children:f(X,{showForm:!D(),showInfo:!!(!z.hideWayInformation&&I.EXPO!=="bloomberg"&&e.selectedRoute?.from&&e.selectedRoute?.to),floors:a,currentFloor:b,onClickFloor:t=>{const o=r.routeStore.pathLayers.find(s=>s.id===t.id);o?.layer&&r.layerStore.updateVisibility(o.layer,!0)},routeFound:!P,options:w(),fromValue:e.selectedRoute?.from?.id?.toString()||"",toValue:e.selectedRoute?.to?.id?.toString()||"",onChangeFrom:t=>v(t,!0),onChangeTo:t=>v(t,!1),onSwitch:W,infoItems:O(r.routeStore.routeDistance),infoAccessible:r.routeStore.onlyAccessible,showAccessible:r.routeStore.showAccessible,onAccessibleCheck:t=>r.routeStore.onlyAccessible=t,onClickInfo:()=>r.showOverlay(),routeUrl:e.routeQRCodeUrl,isKiosk:e.kiosk,showDetailsIcon:e.showRouteInstantly,onDetailsIconClick:()=>{const t=r.routeStore.defaultFrom?.id,{from:o,to:s}=e.selectedRoute||{},n=[s,o].find(l=>l?.id!==t);if(n){const d=w().find(h=>h.value===n.id.toString()),j=n.exhibitors.find(h=>d.label.includes(h.name));e.details=j||n}}})})})}function Y(){return C(()=>I.wayfinding&&!e.menu&&e.selectedRoute&&e.list.type!=="route-planner"&&f(J,{}))}export default Y;
1
+ import{jsx as f,jsxs as U}from"react/jsx-runtime";import x from"classnames";import{useObserver as C}from"mobx-react-lite";import{useEffect as m,useMemo as B,useState as V,useRef as _}from"react";import z from"../data";import{getLayerSvg as $}from"../data/svg";import r,{boothStore as F,exhibitorStore as K,uiState as e}from"../store";import{RegularBooth as L}from"../store/BoothStore";import{Route as S}from"../store/RouteStore";import I from"../tools/settings";import{t as y}from"../utils/i18n";import Q from"./EntityList";import X from"./WayfindingTemplate";import{calcSpeed as q}from"../utils/calcSpeed";import{calcTravelTime as G}from"../utils/calcTravelTime";import{DEFAULT_UNITS as H}from"../constants";import"./Wayfinding.scss";function J(){const k=_(null),a=B(()=>r.routeStore.pathLayers.map(i=>({id:i.id,name:i.layer?.shortName,description:i.layer?.description,basePriority:i.layer?.basePriority??0})),[r.routeStore.pathLayers]),[b,R]=V();m(()=>{b||R(a[0])},[r.routeStore.pathLayers,a]),m(()=>{const i=a.find(u=>u.description?.toLowerCase()===r.routeStore.currentRouteLayer?.description?.toLowerCase());i&&R(i)},[r.routeStore.currentRouteLayer,a]),m(()=>{const i=e.selectedRoute;if(!i){e.setIsMultiPointRoute(!1);return}const c=(i.waypoints?.length||0)>0;e.setIsMultiPointRoute(c)},[e.selectedRoute]);const T=()=>{const{from:i,to:u}=e.selectedRoute;return!!(i&&u)},N=()=>e.overlaySize==="full",D=()=>!!(T()&&!N()),g=()=>{const i=e.selectedRoute;return i?(i.waypoints?.length||0)>0?"multi":"simple":"none"},M=()=>e.routeTitle;return m(()=>{g()==="multi"&&e.selectedRoute},[e.selectedRoute]),C(()=>{const i=g(),u=M();if(i==="multi")return U("div",{className:x("main-wayfinding",{hidden:e.kiosk&&e.selectedRoute?.from&&e.selectedRoute?.to}),children:[e.routeDescription&&f("div",{className:"efp-wayfinding-description",children:e.routeDescription}),f(Q,{updatedScrollableRef:k})]});const c=[],p=()=>r.routeStore.defaultFrom?F.booths.concat([r.routeStore.defaultFrom]):F.booths,A=p().filter(t=>t instanceof L),E=p().filter(t=>!(t instanceof L)),w=()=>{let t=[];return K.exhibitors.forEach(o=>{c.push(...o.booths.map(s=>s.id)),t.push(...o.booths.map(s=>({value:s.id.toString(),label:o.name+" - "+s.fullName})))}),E.filter(o=>c.indexOf(o.id)===-1).forEach(o=>{t.push({value:o.id.toString(),label:o.fullName})}),t=t.sort((o,s)=>o.label.localeCompare(s.label,void 0,{sensitivity:"base"})),A.filter(o=>c.indexOf(o.id)===-1).forEach(o=>{t.push({value:o.id.toString(),label:o.fullName})}),t},v=(t,o=!0)=>{const s=p().filter(d=>d.id.toString()===t)[0],{from:n,to:l}=e.selectedRoute;o?r.routeStore.selectRoute(new S(s||null,l)):r.routeStore.selectRoute(new S(n,s||null))},O=t=>{const o=[],s=$().getAttribute("units")||H,n=G(t,q(s));let l=new Date;l.setMinutes(l.getMinutes()+n/60);const d=l.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});return o.push({title:y("Travel time"),text:n<60?"< 1 min":`~ ${Math.round(n/60)} min`},{title:y("Distance"),text:Math.round(t)+` ${s}`},{title:y("Est arrival"),text:d}),o},W=()=>{const{from:t,to:o}=e.selectedRoute;r.routeStore.selectRoute(new S(o,t))},P=e.selectedRoute?.from&&e.selectedRoute?.to&&!r.routeStore.routeLines.length;return f("div",{className:x("main-wayfinding",{hidden:e.kiosk&&e.selectedRoute?.from&&e.selectedRoute?.to}),children:f(X,{showForm:!D(),showInfo:!!(!z.hideWayInformation&&I.EXPO!=="bloomberg"&&e.selectedRoute?.from&&e.selectedRoute?.to),floors:a,currentFloor:b,onClickFloor:t=>{const o=r.routeStore.pathLayers.find(s=>s.id===t.id);o?.layer&&r.layerStore.updateVisibility(o.layer,!0)},routeFound:!P,options:w(),fromValue:e.selectedRoute?.from?.id?.toString()||"",toValue:e.selectedRoute?.to?.id?.toString()||"",onChangeFrom:t=>v(t,!0),onChangeTo:t=>v(t,!1),onSwitch:W,infoItems:O(r.routeStore.routeDistance),infoAccessible:r.routeStore.onlyAccessible,showAccessible:r.routeStore.showAccessible,onAccessibleCheck:t=>r.routeStore.setOnlyAccessible(t),onClickInfo:()=>r.showOverlay(),routeUrl:e.routeQRCodeUrl,isKiosk:e.kiosk,showDetailsIcon:e.showRouteInstantly,onDetailsIconClick:()=>{const t=r.routeStore.defaultFrom?.id,{from:o,to:s}=e.selectedRoute||{},n=[s,o].find(l=>l?.id!==t);if(n){const d=w().find(h=>h.value===n.id.toString()),j=n.exhibitors.find(h=>d.label.includes(h.name));e.details=j||n}}})})})}function Y(){return C(()=>I.wayfinding&&!e.menu&&e.selectedRoute&&e.list.type!=="route-planner"&&f(J,{}))}export default Y;
@@ -102,6 +102,7 @@ export default class FloorPlanLoader implements FloorPlan {
102
102
  deselectCurrentPosition(): void;
103
103
  deselectRoute(): void;
104
104
  reset(): void;
105
+ selectAccessibleRoute(waypoints: RouteWaypoint[]): void;
105
106
  constructor(options?: FloorPlanOptions);
106
107
  }
107
108
  //# sourceMappingURL=floorplan.loader.d.ts.map
@@ -1 +1 @@
1
- import{PREVIEW_MODE_ATTRIBUTE as V}from"./constants";import l from"./tools/base-runtime-url";import{buildRebookingUrl as H,getRebookingToken as z,retainRebookingToken as G}from"./tools/rebookingUrl";import{loadCss as x,loadFont as g,loadJs as b}from"./tools/loaders";import L from"./tools/logger";import{sleep as N}from"./utils";import{initI18n as Q}from"./utils/i18n";import B from"./utils/is-webview";import{loadCustomCss as q}from"./utils/loadCustomCss";import{loadIcons as W}from"./utils/loadIcons";import $ from"./utils/mergeExhibitors";import E from"./utils/use-shadow";import J from"./utils/is-debug";import K from"./utils/is-localhost";import{initSentry as Y}from"./tools/sentry";import{shouldLoadIntercom as X}from"./intercom";function t(){throw new Error("FloorPlan not ready")}export default class Z{options;renderTarget;_ready;element;eventId;dataUrl;noOverlay;offHistory;ignoreQuery;allowConsent;onInit;disableRuntimeAlerts;viewerMode;efpStyleLoadHandler;resolveReady;icons=new Map;enableRotation=!0;alwaysShowSidebar=!1;get ready(){return this._ready}get previewMode(){return this.options.previewMode||this.element.hasAttribute(V)}onBoothClick;onBookmarkClick;onVisitedClick;onCategoryClick;onFpConfigured;onDirection;onDetails;onExhibitorCustomButtonClick;onGetCoordsClick;onMarkerClick;onLeaveEvent;selectBooth(e){t()}selectExhibitor(e){t()}selectRoute(e,a){t()}getOptimizedRoutes(e){t()}selectCurrentPosition(e,a,h){t()}setBookmarks(e){t()}setEntitiesBookmarks(e){t()}setEntitiesVisited(e){t()}setMarkers(e){t()}updateLayerVisibility(e,a){t()}getCenterCoordinates(){t()}applyParameters(e){t()}exhibitorsList(){t()}boothsList(){t()}categoriesList(){t()}selectCategory(e){t()}getVisibility(){t()}setVisibility(e){t()}findLocation(){t()}zoomIn(){t()}zoomOut(){t()}zoomTo(e,a){t()}switchView(){t()}fitBounds(){t()}getBounds(e){t()}getBoothRect(e){t()}convertToGeo(e,a){t()}unstable_destroy(){t()}highlightExhibitors(e){t()}highlightBooths(e){t()}onCurrentPositionChanged(e){t()}search(e){t()}getFloors(){t()}onFloorActivated(e){t()}activateFloor(e){t()}showPathway(e,a){t()}showPathwayOnly(e,a){t()}hidePathways(){t()}showSearch(){t()}changeLanguage(e){t()}isGpsTrackingEnabled(){t()}setGpsTrackingEnabled(e){t()}deselectCurrentPosition(){t()}deselectRoute(){t()}reset(){t()}constructor(e){this.options=e,this.noOverlay=!!e.noOverlay,this.offHistory=!!e.offHistory,this.ignoreQuery=e.ignoreQuery,this.allowConsent=K&&!J?!1:e.allowConsent,this.onBoothClick=e.onBoothClick,this.onBookmarkClick=e.onBookmarkClick,this.onVisitedClick=e.onVisitedClick,this.onCategoryClick=e.onCategoryClick,this.onDetails=e.onDetails,this.onExhibitorCustomButtonClick=e.onExhibitorCustomButtonClick,this.onGetCoordsClick=e.onGetCoordsClick,this.onMarkerClick=e.onMarkerClick,this.onFpConfigured=e.onFpConfigured,this.onDirection=e.onDirection,this.onInit=e.onInit,this.onCurrentPositionChanged=e.onCurrentPositionChanged,this.onFloorActivated=e.onFloorActivated,this.onLeaveEvent=e.onLeaveEvent,this.viewerMode=!!e.viewerMode,this.disableRuntimeAlerts=e.disableRuntimeAlerts??!0,this._ready=new Promise((d,i)=>{this.resolveReady=d});const a=e.element;if(this.element=a,a.__expofp)throw new Error("Element already in use");if(a.__expofp=this,a.getAttribute("data-event-id")||a.getAttribute("data-event"))throw new Error("data-xxx attributes are removed, use options instead");const h=e.expo||e.event;if(!h)throw new Error("`expo` option is required");Y({eventId:h||"",isWebview:B}),this.eventId=h,window.__efpEvent=h,window.__efpElement=a;const P=[...a.classList];a.classList.remove(...P),a.classList.add("expofp-floorplan-default",...P);const O=document.head||document.getElementsByTagName("head")[0],I=document.createElement("style");O.prepend(I),I.textContent=".expofp-floorplan-default { width: 100%; height: 100%;}";const m=document.createElement("div");m.style.height="100%",m.style.width="100%",a.appendChild(m);let n;if(B&&(this.allowConsent=!0),e.allowConsent===void 0){const i=new URL(window.location.href).searchParams.get("allowConsent");i&&(this.allowConsent=i==="true")}if(E){n=m.attachShadow({mode:"open"});const d=n,i=document;d.createElement=(...r)=>i.createElement(...r),d.createElementNS=(...r)=>i.createElementNS(...r),d.createTextNode=(...r)=>i.createTextNode(...r)}else n=m;const y=document.createElement("div");if(y.style.height="100%",y.style.width="100%",n.appendChild(y),E&&Object.defineProperty(y,"ownerDocument",{value:n}),window.__efpShadowDOMStyleParent=E?n:void 0,this.renderTarget=y,a.getAttribute("data-data-url"))throw new Error("data-xxx attributes are removed, use options instead");const u=e.legacyDataUrlBase;window.__dataUrlBase=u,this.dataUrl=u,L.log("Instantiating ExpoFP floorplan",e.element,h);const D=u+"data.js",j=u+"wf.data.js",R=u+"fp.svg.js",T=[b(j),b(D),b(R)];let v=0;this.efpStyleLoadHandler=function(d){const i=window.__efpStyleElements;for(;v<i.length;){const r=i[v];n.appendChild(r),v++}},window.addEventListener("__efpStyleLoad",this.efpStyleLoadHandler);const k=this;(async function(){await Promise.all(T);let i=0;for(;window.__fpPending&&!window.__fp;)await N(2e3),await b(R+`?v=${++i}`);const r=window.__data,_=X(r);_&&import("./intercom/bootIntercom").then(({bootIntercom:o})=>o(_)).catch(()=>{}),await Q();const f=new URLSearchParams(window.location.search);let w,C;if(r?.trackerUrl)try{w=new URL(r.trackerUrl),C=w.searchParams.get("expoId")}catch(o){console.error(o)}const U=async o=>{if(!w||!C)return Promise.reject(new Error("trackerUrl or expoId is missing"));const s=new URL(o.dataUrl,w.origin),c=await fetch(s.toString(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expoId:C,token:decodeURIComponent(f.get("t"))})});let p=[];c.ok&&(p=(await c.json()).map(o.dataMapper)),window.__heatmapDataYah={yah:p}};if(f.get("heatmap")==="true")try{if(f.get("type")==="yah")f.get("subtype")==="kiosk"?await U({dataUrl:"/api/kiosks/list/viewer",dataMapper:o=>({...o,id:o.key,name:`Kiosk ${o.key}`})}):await U({dataUrl:"/api/v1/you-are-here/qr-code/list/viewer",dataMapper:(o,s)=>({...o,name:`QR Code #${s+1}`})});else{const o=new URL("/api/fp-stats/get",w.origin);o.searchParams.set("expoId",C),o.searchParams.set("type","booview"),o.searchParams.set("t",decodeURIComponent(f.get("t")));const s=new URL("api/fp-stats/get",w.origin);s.searchParams.set("expoId",C),s.searchParams.set("type","exview"),s.searchParams.set("t",decodeURIComponent(f.get("t")));const[c,p]=await Promise.all([fetch(o.toString()),fetch(s.toString())]),[S,A]=await Promise.all([c.json(),p.json()]);window.__heatmapData={booths:S,exhibitors:A}}}catch(o){console.error("Heatmap: Initialization error",o)}try{const o=z();if(o){G(o);const s=H("api/rebooking-data",{rt:o,expoKey:h}),c=await fetch(s);if(c.ok){const p=await c.json();$(r,p)}r.isRebooking=c.ok}else r.isRebooking=!1}catch(o){console.error(o)}const M=[x(l+"vendor/sanitize-css/sanitize.css",n),x(l+"vendor/perfect-scrollbar/css/perfect-scrollbar.css",n),x(l+"vendor/mapbox/mapbox-gl.css",n),g("Oswald",l+"fonts/oswald-v17-cyrillic_latin-300.woff",{weight:300}),g("Oswald",l+"fonts/oswald-v17-cyrillic_latin-500.woff",{weight:500}),g("Inter",l+"fonts/inter-400.woff2",{weight:400}),g("Inter",l+"fonts/inter-500.woff2",{weight:500}),g("Inter",l+"fonts/inter-600.woff2",{weight:600}),g("efp-symbols",l+"fonts/efp-symbols.woff",{weight:400}),q(r,n),W(k.icons)];await Promise.all(M),k.enableRotation=r?.enableRotation??!1,k.alwaysShowSidebar=r?.alwaysShowSidebar??!1,L.log("Data loaded");const{default:F}=await import("./floorplan.ready");for(document.querySelectorAll(".expofp-floorplan-loader").forEach(o=>o.remove());a.firstChild&&a.firstChild!==m;)a.removeChild(a.firstChild);Object.setPrototypeOf(k,F.prototype).init()})()}}
1
+ import{PREVIEW_MODE_ATTRIBUTE as V}from"./constants";import l from"./tools/base-runtime-url";import{buildRebookingUrl as H,getRebookingToken as z,retainRebookingToken as G}from"./tools/rebookingUrl";import{loadCss as x,loadFont as g,loadJs as b}from"./tools/loaders";import L from"./tools/logger";import{sleep as N}from"./utils";import{initI18n as Q}from"./utils/i18n";import B from"./utils/is-webview";import{loadCustomCss as q}from"./utils/loadCustomCss";import{loadIcons as W}from"./utils/loadIcons";import $ from"./utils/mergeExhibitors";import E from"./utils/use-shadow";import J from"./utils/is-debug";import K from"./utils/is-localhost";import{initSentry as Y}from"./tools/sentry";import{shouldLoadIntercom as X}from"./intercom";function t(){throw new Error("FloorPlan not ready")}export default class Z{options;renderTarget;_ready;element;eventId;dataUrl;noOverlay;offHistory;ignoreQuery;allowConsent;onInit;disableRuntimeAlerts;viewerMode;efpStyleLoadHandler;resolveReady;icons=new Map;enableRotation=!0;alwaysShowSidebar=!1;get ready(){return this._ready}get previewMode(){return this.options.previewMode||this.element.hasAttribute(V)}onBoothClick;onBookmarkClick;onVisitedClick;onCategoryClick;onFpConfigured;onDirection;onDetails;onExhibitorCustomButtonClick;onGetCoordsClick;onMarkerClick;onLeaveEvent;selectBooth(e){t()}selectExhibitor(e){t()}selectRoute(e,a){t()}getOptimizedRoutes(e){t()}selectCurrentPosition(e,a,h){t()}setBookmarks(e){t()}setEntitiesBookmarks(e){t()}setEntitiesVisited(e){t()}setMarkers(e){t()}updateLayerVisibility(e,a){t()}getCenterCoordinates(){t()}applyParameters(e){t()}exhibitorsList(){t()}boothsList(){t()}categoriesList(){t()}selectCategory(e){t()}getVisibility(){t()}setVisibility(e){t()}findLocation(){t()}zoomIn(){t()}zoomOut(){t()}zoomTo(e,a){t()}switchView(){t()}fitBounds(){t()}getBounds(e){t()}getBoothRect(e){t()}convertToGeo(e,a){t()}unstable_destroy(){t()}highlightExhibitors(e){t()}highlightBooths(e){t()}onCurrentPositionChanged(e){t()}search(e){t()}getFloors(){t()}onFloorActivated(e){t()}activateFloor(e){t()}showPathway(e,a){t()}showPathwayOnly(e,a){t()}hidePathways(){t()}showSearch(){t()}changeLanguage(e){t()}isGpsTrackingEnabled(){t()}setGpsTrackingEnabled(e){t()}deselectCurrentPosition(){t()}deselectRoute(){t()}reset(){t()}selectAccessibleRoute(e){t()}constructor(e){this.options=e,this.noOverlay=!!e.noOverlay,this.offHistory=!!e.offHistory,this.ignoreQuery=e.ignoreQuery,this.allowConsent=K&&!J?!1:e.allowConsent,this.onBoothClick=e.onBoothClick,this.onBookmarkClick=e.onBookmarkClick,this.onVisitedClick=e.onVisitedClick,this.onCategoryClick=e.onCategoryClick,this.onDetails=e.onDetails,this.onExhibitorCustomButtonClick=e.onExhibitorCustomButtonClick,this.onGetCoordsClick=e.onGetCoordsClick,this.onMarkerClick=e.onMarkerClick,this.onFpConfigured=e.onFpConfigured,this.onDirection=e.onDirection,this.onInit=e.onInit,this.onCurrentPositionChanged=e.onCurrentPositionChanged,this.onFloorActivated=e.onFloorActivated,this.onLeaveEvent=e.onLeaveEvent,this.viewerMode=!!e.viewerMode,this.disableRuntimeAlerts=e.disableRuntimeAlerts??!0,this._ready=new Promise((d,i)=>{this.resolveReady=d});const a=e.element;if(this.element=a,a.__expofp)throw new Error("Element already in use");if(a.__expofp=this,a.getAttribute("data-event-id")||a.getAttribute("data-event"))throw new Error("data-xxx attributes are removed, use options instead");const h=e.expo||e.event;if(!h)throw new Error("`expo` option is required");Y({eventId:h||"",isWebview:B}),this.eventId=h,window.__efpEvent=h,window.__efpElement=a;const P=[...a.classList];a.classList.remove(...P),a.classList.add("expofp-floorplan-default",...P);const O=document.head||document.getElementsByTagName("head")[0],R=document.createElement("style");O.prepend(R),R.textContent=".expofp-floorplan-default { width: 100%; height: 100%;}";const m=document.createElement("div");m.style.height="100%",m.style.width="100%",a.appendChild(m);let n;if(B&&(this.allowConsent=!0),e.allowConsent===void 0){const i=new URL(window.location.href).searchParams.get("allowConsent");i&&(this.allowConsent=i==="true")}if(E){n=m.attachShadow({mode:"open"});const d=n,i=document;d.createElement=(...r)=>i.createElement(...r),d.createElementNS=(...r)=>i.createElementNS(...r),d.createTextNode=(...r)=>i.createTextNode(...r)}else n=m;const y=document.createElement("div");if(y.style.height="100%",y.style.width="100%",n.appendChild(y),E&&Object.defineProperty(y,"ownerDocument",{value:n}),window.__efpShadowDOMStyleParent=E?n:void 0,this.renderTarget=y,a.getAttribute("data-data-url"))throw new Error("data-xxx attributes are removed, use options instead");const u=e.legacyDataUrlBase;window.__dataUrlBase=u,this.dataUrl=u,L.log("Instantiating ExpoFP floorplan",e.element,h);const D=u+"data.js",j=u+"wf.data.js",I=u+"fp.svg.js",T=[b(j),b(D),b(I)];let v=0;this.efpStyleLoadHandler=function(d){const i=window.__efpStyleElements;for(;v<i.length;){const r=i[v];n.appendChild(r),v++}},window.addEventListener("__efpStyleLoad",this.efpStyleLoadHandler);const k=this;(async function(){await Promise.all(T);let i=0;for(;window.__fpPending&&!window.__fp;)await N(2e3),await b(I+`?v=${++i}`);const r=window.__data,_=X(r);_&&import("./intercom/bootIntercom").then(({bootIntercom:o})=>o(_)).catch(()=>{}),await Q();const f=new URLSearchParams(window.location.search);let w,C;if(r?.trackerUrl)try{w=new URL(r.trackerUrl),C=w.searchParams.get("expoId")}catch(o){console.error(o)}const U=async o=>{if(!w||!C)return Promise.reject(new Error("trackerUrl or expoId is missing"));const s=new URL(o.dataUrl,w.origin),c=await fetch(s.toString(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expoId:C,token:decodeURIComponent(f.get("t"))})});let p=[];c.ok&&(p=(await c.json()).map(o.dataMapper)),window.__heatmapDataYah={yah:p}};if(f.get("heatmap")==="true")try{if(f.get("type")==="yah")f.get("subtype")==="kiosk"?await U({dataUrl:"/api/kiosks/list/viewer",dataMapper:o=>({...o,id:o.key,name:`Kiosk ${o.key}`})}):await U({dataUrl:"/api/v1/you-are-here/qr-code/list/viewer",dataMapper:(o,s)=>({...o,name:`QR Code #${s+1}`})});else{const o=new URL("/api/fp-stats/get",w.origin);o.searchParams.set("expoId",C),o.searchParams.set("type","booview"),o.searchParams.set("t",decodeURIComponent(f.get("t")));const s=new URL("api/fp-stats/get",w.origin);s.searchParams.set("expoId",C),s.searchParams.set("type","exview"),s.searchParams.set("t",decodeURIComponent(f.get("t")));const[c,p]=await Promise.all([fetch(o.toString()),fetch(s.toString())]),[S,F]=await Promise.all([c.json(),p.json()]);window.__heatmapData={booths:S,exhibitors:F}}}catch(o){console.error("Heatmap: Initialization error",o)}try{const o=z();if(o){G(o);const s=H("api/rebooking-data",{rt:o,expoKey:h}),c=await fetch(s);if(c.ok){const p=await c.json();$(r,p)}r.isRebooking=c.ok}else r.isRebooking=!1}catch(o){console.error(o)}const M=[x(l+"vendor/sanitize-css/sanitize.css",n),x(l+"vendor/perfect-scrollbar/css/perfect-scrollbar.css",n),x(l+"vendor/mapbox/mapbox-gl.css",n),g("Oswald",l+"fonts/oswald-v17-cyrillic_latin-300.woff",{weight:300}),g("Oswald",l+"fonts/oswald-v17-cyrillic_latin-500.woff",{weight:500}),g("Inter",l+"fonts/inter-400.woff2",{weight:400}),g("Inter",l+"fonts/inter-500.woff2",{weight:500}),g("Inter",l+"fonts/inter-600.woff2",{weight:600}),g("efp-symbols",l+"fonts/efp-symbols.woff",{weight:400}),q(r,n),W(k.icons)];await Promise.all(M),k.enableRotation=r?.enableRotation??!1,k.alwaysShowSidebar=r?.alwaysShowSidebar??!1,L.log("Data loaded");const{default:A}=await import("./floorplan.ready");for(document.querySelectorAll(".expofp-floorplan-loader").forEach(o=>o.remove());a.firstChild&&a.firstChild!==m;)a.removeChild(a.firstChild);Object.setPrototypeOf(k,A.prototype).init()})()}}
@@ -83,5 +83,6 @@ export default class FloorPlanReady extends FloorPlanLoader {
83
83
  deselectCurrentPosition(): void;
84
84
  deselectRoute(): void;
85
85
  reset(): void;
86
+ selectAccessibleRoute(waypoints: RouteWaypoint[]): void;
86
87
  }
87
88
  //# sourceMappingURL=floorplan.ready.d.ts.map
@@ -1 +1 @@
1
- import{jsx as g,Fragment as L,jsxs as C}from"react/jsx-runtime";import{reaction as T}from"mobx";import{createRoot as R}from"react-dom/client";import{install as I}from"resize-observer";import V from"./components/Layout";import $ from"./floorplan.loader";import{applyParameters as M,destroyHistory as j,initRouting as z}from"./services/routing";import t from"./store";import{Route as S,findBooth as x,separateExternalIds as E}from"./store/RouteStore";import{destroyUiHandlers as G}from"./store/init/init-ui";import{GaEventActions as P,destroyGtag as _,sendEventToGa as w,setConsentSettings as q}from"./tools/gtag";import N from"./tools/report-error";import{resetGlobalVariables as Y}from"./tools/reset";import H from"./tools/track-event";import{fpGeo as v}from"./data/fpGeo";import{convertLocalToGps as O,isValidPointCoords as d}from"./utils/gps";import m from"./core/Rect";import{mapEntity as y}from"./utils/mapEntity";import{LANG_KEY as X,MAX_ROUTE_WAYPOINTS as p,PATHWAY_KEY as U}from"./constants";import{getStorage as B}from"./utils/entity-storage";import{ErrorBoundary as D}from"@sentry/react";import{POISelectorsSchema as F,BoundsSchema as K,ZoomToOptionsSchema as A}from"./schemas/sdk.schemas";import W from"debug";import{buildOptimizedRoute as Q}from"./utils/buildOptimizedRoute";import{hasLocale as Z,getLocales as J}from"./utils/i18n";const b=W("efp:api");I();export default class ee extends ${root;init(){this.ignoreQuery||z(this.offHistory),H("load"),t.fp=this,q(this.allowConsent),w(P.Load,""),this.root=R(this.renderTarget),this.root.render(g(D,{children:g(V,{offHistory:this.offHistory,allowConsent:this.allowConsent})})),w(P.Rendered,""),T(()=>t.layerStore.layersLoaded,()=>{this.resolveReady(),t.initialized||this.onInit?.(this),t.initialized=!0})}selectBooth(e){if(typeof e!="string"&&!Array.isArray(e)){a("selectBooth","Parameter must be a string or an array of strings.","EFP000000");return}const i=t.boothStore.booths.filter(o=>typeof e=="string"?o.name===e||o.externalId===e:e.includes(o.name)||e.includes(o.externalId));t.selectBooth(i)}selectExhibitor(e){if(typeof e!="string"&&!Array.isArray(e)){a("selectExhibitor","Parameter must be a string or an array of strings.","EFP000100");return}if(!e?.length){t.uiState.menu=!1,t.searchStore.resetSearchBox(),t.uiState.details=null;return}const i=t.exhibitorStore.exhibitors.filter(s=>typeof e=="string"?s.name===e||s.externalId===e:e.includes(s.name)||e.includes(s.externalId));if(!i?.length)return;if(typeof e=="string"){t.selectExhibitor(i[0]),t.moveToList([i[0]]);return}const o=i.flatMap(s=>s.booths.map(r=>r.layer)),{description:n}=o.reduce((s,r)=>(s.freq[r.description]=(s.freq[r.description]||0)+1,s.freq[r.description]>s.maxCount&&(s.maxCount=s.freq[r.description],s.mostFrequent=r),s),{freq:{},mostFrequent:o[0],maxCount:0}).mostFrequent;t.layerStore.updateVisibility(n,!0),t.uiState.menu=!1,t.searchStore.resetSearchBox(),t.uiState.details=null,t.uiState.list={type:"filter",items:i,query:{key:"exhibitors",value:i.map(s=>s.externalId).join(",")}},t.moveToList()}highlightExhibitors(e){Array.isArray(e)||a("highlightExhibitors","Parameter must be an array of strings.","EFP000200"),t.boothStore.highlightedByExternalIds=[],t.exhibitorStore.highlightedByExternalIds=[...e]}highlightBooths(e){Array.isArray(e)||a("highlightBooths","Parameter must be an array of strings.","EFP000300"),t.exhibitorStore.highlightedByExternalIds=[],t.boothStore.highlightedByExternalIds=[...e]}highlightEntities(e){Array.isArray(e)||a("highlightEntities","Parameter must be an array of strings.","EFP000400");const{boothExternalIds:i,exhibitorExternalIds:o}=E(e);t.boothStore.highlightedByExternalIds=[...i],t.exhibitorStore.highlightedByExternalIds=[...o]}selectRoute(e,i){if(Array.isArray(e)){let o=[...e];const n=o.shift(),s=o.pop();if(o.length>p)throw new Error(`The maximum number of waypoints is ${p}.`);if(!n||!s){a("selectRoute","Invalid route format: When providing an array, it must include at least two points: a start and a destination.","EFP000401");return}t.routeStore.selectRoute(new S(f(n),f(s),o.map(f)));return}e||a("selectRoute","At a minimum, the starting point must be passed.","EFP000402"),t.routeStore.selectRoute(new S(f(e),f(i)))}getOptimizedRoutes(e){if(!Array.isArray(e))return a("getOptimizedRoutes","Parameter must be an array.","EFP000500"),[];if(e.length>p)throw new Error(`The maximum number of waypoints is ${p}.`);const i=e.map(f).filter(n=>!!n);if(!i.length)throw new Error("No booths found for the provided waypoints.");const o=new Map;for(const n of i){const s=n.layer?.name??"",r=o.get(s);r?r.push(n):o.set(s,[n])}return Array.from(o.values()).map(n=>({waypoints:Q(n.map(s=>[s.name,{cx:s.rect.cx,cy:s.rect.cy}]))}))}selectCurrentPosition(e,i,o){const n=d(e.x)&&d(e.y),s=d(e.lng)&&d(e.lat);!n&&!s&&a("selectCurrentPosition","A point must be passed. Either (x,y) or (lat,lng) are required.","EFP000600"),t.routeStore.selectCurrentPosition(e,i,o),this.onCurrentPositionChanged?.(e)}setBookmarks(e){(!Array.isArray(e)||!e.length)&&a("setBookmarks","Parameter must be an array.","EFP000700"),e.forEach(i=>{const o=t.exhibitorStore.exhibitors.find(n=>n.name===i.name||n.externalId===i.externalId);o&&(o.bookmarked=i.bookmarked)})}setEntitiesBookmarks(e){if(!Array.isArray(e)||!e.length){a("setEntitiesBookmarks","Parameter must be an array.","EFP000701");return}const i=["exhibitor","event","speaker","booth"],o=e.find(r=>!r.type||!i.includes(r.type));if(o){a("setEntitiesBookmarks",`Invalid entity type: ${o.type}. Must be one of: ${i.join(", ")}.`,"EFP000702");return}const n=B("bookmarked"),s={exhibitor:{existingIds:new Set(n.exhibitors||[]),finder:r=>t.exhibitorStore.findExhibitor(r),replacer:r=>t.exhibitorStore.replaceBookmarked(r)},event:{existingIds:new Set(n.events||[]),finder:r=>t.eventStore.findByNameOrSlug(r),replacer:r=>t.eventStore.replaceBookmarked(r)},speaker:{existingIds:new Set(n.speakers||[]),finder:r=>t.speakerStore.speakers.find(l=>l.name===r||l.externalId===r||l.slug===r),replacer:r=>t.speakerStore.replaceBookmarked(r)},booth:{existingIds:new Set(n.booths||[]),finder:r=>{const l=t.boothStore.findBooth(r);return l?.exhibitors.length===0?l:void 0},replacer:r=>t.boothStore.replaceBookmarked(r)}};e.forEach(r=>{const l=s[r.type],h=r.name||r.externalId||"",c=l.finder(h);c?r.bookmarked?l.existingIds.add(c.id):l.existingIds.delete(c.id):console.warn(`Entity not found: ${r.type} with query "${h}"`)}),Object.values(s).forEach(r=>{r.replacer(Array.from(r.existingIds))})}setEntitiesVisited(e){if(!Array.isArray(e)||!e.length){a("setEntitiesVisited","Parameter must be an array.","EFP000703");return}const i=["exhibitor","event"],o=e.find(r=>!r.type||!i.includes(r.type));if(o){a("setEntitiesVisited",`Invalid entity type: ${o.type}. Must be one of: ${i.join(", ")}.`,"EFP000704");return}const n=B("visited"),s={exhibitor:{existingIds:new Set(n.exhibitors||[]),finder:r=>t.exhibitorStore.findExhibitor(r),replacer:r=>t.exhibitorStore.replaceVisited(r)},event:{existingIds:new Set(n.events||[]),finder:r=>t.eventStore.findByNameOrSlug(r),replacer:r=>t.eventStore.replaceVisited(r)}};e.forEach(r=>{const l=s[r.type],h=r.name||r.externalId||"",c=l.finder(h);c?r.visited?l.existingIds.add(c.id):l.existingIds.delete(c.id):console.warn(`Entity not found: ${r.type} with query "${h}"`)}),Object.values(s).forEach(r=>{r.replacer(Array.from(r.existingIds))})}setMarkers(e){if(!e||!Array.isArray(e.icons)||!Array.isArray(e.markers)){a("setMarkers","Invalid input.","EFP000800");return}t.routeStore.setMarkers(e)}selectMarker(e,i=!0){return typeof e!="string"&&a("selectMarker","The identifier must be passed.","EFP000900"),t.routeStore.selectMarker(e,i)}drawCircles(e){Array.isArray(e)||a("drawCircles","Invalid input.","EFP000A00"),t.uiState.debugCircles=e}checkRoutes(){t.routeStore.checkRoutes()}updateLayerVisibility(e,i){typeof e!="string"&&a("updateLayerVisibility","The layer name (string) must be passed.","EFP000B00"),i||a("updateLayerVisibility","Passing a false value to visible will have no effect.","EFP000B01"),t.layerStore.updateVisibility(e,i)}getCenterCoordinates(){return t.fp.getCenterCoordinates()}exhibitorsList(){return t.exhibitorStore.exhibitors.map(e=>y(e))}boothsList(){return t.boothStore.booths.map(e=>y(e))}categoriesList(){return t.categoryStore.categories.map(e=>y(e))}selectCategory(e){if(e==null||typeof e!="string"){t.searchStore.selectSearch();return}const i=e?.toLowerCase(),o=t.categoryStore.categories.find(({name:n,slug:s})=>n?.toLowerCase()===i||s?.toLowerCase()===i);if(!o){a("selectCategory",`Category ${e} not found.`,"EFP000C01");return}t.selectCategory(o)}applyParameters(e){typeof e!="string"&&a("applyParameters","A query string must be passed.","EFP000D00"),M(e)}getVisibility(){return t.uiState.visibility}setVisibility(e){(typeof e!="object"||!Object.keys(e).length)&&a("setVisibility","The parameter must be passed.","EFP000E00"),t.uiState.setVisibility(e)}findLocation(){t.routeStore.findLocation()}zoomIn(){t.uiState.zoomIn()}zoomOut(){t.uiState.zoomOut()}switchView(){t.mapboxStore.activateMapbox()}zoomTo(e,i){b("zoomTo called with selectors=%O options=%O",e,i);const o=F.safeParse(e);if(!o.success){a("zoomTo",o.error.message,"EFP001600");return}const n=A.safeParse(i);if(!n.success){a("zoomTo",n.error.message,"EFP001601");return}const s=this.getBounds(e);s&&this.fitBounds(s,i)}getBounds(e){b("getBounds called with selectors=%O",e);const i=F.safeParse(e);if(!i.success){a("getBounds",i.error.message,"EFP001400");return}const o=[];if(e.booths?.forEach(s=>{let r;s.externalId?r=t.boothStore.boothByExternalId.get(s.externalId):s.name&&(r=t.boothStore.boothByName.get(s.name.toLowerCase())),r?.rect&&o.push(r.rect)}),e.exhibitors?.forEach(s=>{let r;s.externalId?r=t.exhibitorStore.exhibitorByExternalId.get(s.externalId):s.name&&(r=t.exhibitorStore.exhibitorByName.get(s.name.toLowerCase())),r?.booths?.forEach(l=>{l.rect&&o.push(l.rect)})}),o.length===0)return;const n=m.fromMultiple(o);return{leftTop:{x:n.x1,y:n.y1},rightBottom:{x:n.x2,y:n.y2}}}fitBounds(e,i){if(b("fitBounds called with bounds=%O options=%O",e,i),!e){t.uiState.fitBounds();return}const o=K.safeParse(e);if(!o.success){a("fitBounds",o.error.message,"EFP001500");return}const n=A.safeParse(i);if(!n.success){a("fitBounds",n.error.message,"EFP001501");return}let s;if(i?.padding){const r=i.padding;s=m.fromX1y1x2y2(e.leftTop.x-r,e.leftTop.y-r,e.rightBottom.x+r,e.rightBottom.y+r)}else s=m.fromX1y1x2y2(e.leftTop.x,e.leftTop.y,e.rightBottom.x,e.rightBottom.y);t.uiState.moveToRect=s}getBoothRect(e){return typeof e!="string"&&a("getBoothRect","A booth name must be passed.","EFP000F00"),x(e)?.rect}convertToGeo(e,i){if(!v?.properties?.config){a("convertToGeo","The coordinates cannot be converted because the GPS configuration is not defined.","EFP001000");return}if(!e||!i){a("convertToGeo","Both coordinates must be passed.","EFP001001");return}return O(e,i,v.properties.config)}unstable_destroy(){let e=window.__efpElement.firstChild;Y(),window.removeEventListener("__efpStyleLoad",this.efpStyleLoadHandler),window.removeEventListener("error",N),j(),G(),_(),[...document.getElementsByTagName("script")].filter(o=>o.src.indexOf("/fp.svg")>-1||o.src.indexOf("/wf.data.js")>-1||o.src.indexOf("/data.js")>-1).forEach(o=>o.remove()),this.root.unmount(),e.remove()}search(e){return typeof e!="string"&&a("search","A search string must be passed.","EFP001100"),t.fuzzySearchEngineStore.loadEngine().then(()=>(t.searchStore.selectSearch(e),t.uiState.fuzzySearchItems.map(i=>({item:y(i.item),score:i.score}))))}getFloors(){return t.layerStore.floors.map(e=>({name:e.name,shortName:e.shortName,description:e.description,active:e.active,disabled:e.disabled,index:e.index}))}activateFloor(e){if(!e?.name&&e?.index==null){a("activateFloor","Invalid floorId. It must contain either a name or an index.","EFP001200");return}const i=this.getFloors();if(e.name){const o=i.find(n=>n.name===e.name||n.shortName===e.name);if(!o){a("activateFloor",`Floor with name "${e.name}" not found.`,"EFP001201");return}if(o.active)return;this.updateLayerVisibility(o.name,!0);return}if(e.index!==null){const o=i.find(s=>s.index===e.index),n=o?.name;if(!n){a("activateFloor",`Floor at index ${e.index} does not exist.`,"EFP001203");return}if(o.active)return;this.updateLayerVisibility(n,!0);return}}showPathway(e,i){const o=new URLSearchParams;if(o.set(U,e),i?.length){const{boothExternalIds:n,exhibitorExternalIds:s}=E(i);n.length>0&&o.set("booths",n.join(",")),s.length>0&&o.set("exhibitors",s.join(","))}this.applyParameters(o.toString())}showPathwayOnly(e,i){this.activateFloor({name:i}),t.layerStore.showPathWay(e),t.uiState.setPathwayOnlyMode(!0);const o=t.layerStore.findLayer(e),n=t.layerStore.findLayer(i),s=o?.rect||o?.viewbox?o:n;if(s?.rect||s?.viewbox){const r=s.viewbox??s.rect;t.uiState.moveToRect=m.fromX1y1x2y2(r.x1,r.y1,r.x2,r.y2)}}hidePathways(){this.highlightBooths([]),t.layerStore.hidePathways(),t.uiState.setPathwayOnlyMode(!1)}showSearch(){t.selectSearch("")}changeLanguage(e){const i=e?.toLowerCase?.();if(!Z(i)){a("changeLanguage",`Language "${e}" was not found. Available languages: ${J().map(n=>n.id).join(",")}`,"EFP001300");return}const o=new URLSearchParams;o.set(X,i),this.applyParameters(o.toString())}isGpsTrackingEnabled(){return t.routeStore.gpsEnabled}setGpsTrackingEnabled(e){t.routeStore.setGpsTrackingEnabled(e)}deselectCurrentPosition(){t.routeStore.selectCurrentPosition(null,!1)}deselectRoute(){t.routeStore.selectRoute(null)}reset(){this.selectBooth(""),this.selectExhibitor(""),this.selectCategory(),this.deselectCurrentPosition(),this.deselectRoute(),this.highlightEntities([]),t.uiState.kioskData&&t.resetCameraFn?t.resetCameraFn?.():this.fitBounds()}}function f(u){return typeof u=="string"?x(u):t.routeStore.getNearestBooth(u)}let k=0;function a(u,e,i){const o=`Error calling "${u}" SDK method.`,n=`${e.endsWith(".")?e:e+"."} More information at`;let s="https://developer.expofp.com/guide/java-script-api-reference";if(i&&(s+=`#error-${i}`),console.error(`${o} ${n} ${s}`),t.fp.disableRuntimeAlerts)return;t.uiState.setGlobalErrorMessage({title:o,body:C(L,{children:[n," ",g("a",{href:s,target:"_blank",rel:"noreferrer",children:s})]})}),clearTimeout(k);const r=8e3;k=window.setTimeout(()=>{const l=async()=>{t.uiState.globalErrorMessages.length>0&&(t.uiState.popGlobalErrorMessage(),await new Promise(h=>setTimeout(h,r/2)),l())};l()},r)}
1
+ import{jsx as g,Fragment as L,jsxs as C}from"react/jsx-runtime";import{reaction as T}from"mobx";import{createRoot as R}from"react-dom/client";import{install as I}from"resize-observer";import V from"./components/Layout";import $ from"./floorplan.loader";import{applyParameters as M,destroyHistory as j,initRouting as z}from"./services/routing";import t from"./store";import{Route as S,findBooth as x,separateExternalIds as E}from"./store/RouteStore";import{destroyUiHandlers as G}from"./store/init/init-ui";import{GaEventActions as P,destroyGtag as _,sendEventToGa as w,setConsentSettings as q}from"./tools/gtag";import N from"./tools/report-error";import{resetGlobalVariables as Y}from"./tools/reset";import H from"./tools/track-event";import{fpGeo as v}from"./data/fpGeo";import{convertLocalToGps as O,isValidPointCoords as d}from"./utils/gps";import m from"./core/Rect";import{mapEntity as y}from"./utils/mapEntity";import{LANG_KEY as X,MAX_ROUTE_WAYPOINTS as p,PATHWAY_KEY as U}from"./constants";import{getStorage as B}from"./utils/entity-storage";import{ErrorBoundary as D}from"@sentry/react";import{POISelectorsSchema as F,BoundsSchema as K,ZoomToOptionsSchema as A}from"./schemas/sdk.schemas";import W from"debug";import{buildOptimizedRoute as Q}from"./utils/buildOptimizedRoute";import{hasLocale as Z,getLocales as J}from"./utils/i18n";const b=W("efp:api");I();export default class ee extends ${root;init(){this.ignoreQuery||z(this.offHistory),H("load"),t.fp=this,q(this.allowConsent),w(P.Load,""),this.root=R(this.renderTarget),this.root.render(g(D,{children:g(V,{offHistory:this.offHistory,allowConsent:this.allowConsent})})),w(P.Rendered,""),T(()=>t.layerStore.layersLoaded,()=>{this.resolveReady(),t.initialized||this.onInit?.(this),t.initialized=!0})}selectBooth(e){if(typeof e!="string"&&!Array.isArray(e)){a("selectBooth","Parameter must be a string or an array of strings.","EFP000000");return}const i=t.boothStore.booths.filter(o=>typeof e=="string"?o.name===e||o.externalId===e:e.includes(o.name)||e.includes(o.externalId));t.selectBooth(i)}selectExhibitor(e){if(typeof e!="string"&&!Array.isArray(e)){a("selectExhibitor","Parameter must be a string or an array of strings.","EFP000100");return}if(!e?.length){t.uiState.menu=!1,t.searchStore.resetSearchBox(),t.uiState.details=null;return}const i=t.exhibitorStore.exhibitors.filter(s=>typeof e=="string"?s.name===e||s.externalId===e:e.includes(s.name)||e.includes(s.externalId));if(!i?.length)return;if(typeof e=="string"){t.selectExhibitor(i[0]),t.moveToList([i[0]]);return}const o=i.flatMap(s=>s.booths.map(r=>r.layer)),{description:n}=o.reduce((s,r)=>(s.freq[r.description]=(s.freq[r.description]||0)+1,s.freq[r.description]>s.maxCount&&(s.maxCount=s.freq[r.description],s.mostFrequent=r),s),{freq:{},mostFrequent:o[0],maxCount:0}).mostFrequent;t.layerStore.updateVisibility(n,!0),t.uiState.menu=!1,t.searchStore.resetSearchBox(),t.uiState.details=null,t.uiState.list={type:"filter",items:i,query:{key:"exhibitors",value:i.map(s=>s.externalId).join(",")}},t.moveToList()}highlightExhibitors(e){Array.isArray(e)||a("highlightExhibitors","Parameter must be an array of strings.","EFP000200"),t.boothStore.highlightedByExternalIds=[],t.exhibitorStore.highlightedByExternalIds=[...e]}highlightBooths(e){Array.isArray(e)||a("highlightBooths","Parameter must be an array of strings.","EFP000300"),t.exhibitorStore.highlightedByExternalIds=[],t.boothStore.highlightedByExternalIds=[...e]}highlightEntities(e){Array.isArray(e)||a("highlightEntities","Parameter must be an array of strings.","EFP000400");const{boothExternalIds:i,exhibitorExternalIds:o}=E(e);t.boothStore.highlightedByExternalIds=[...i],t.exhibitorStore.highlightedByExternalIds=[...o]}selectRoute(e,i){if(Array.isArray(e)){let o=[...e];const n=o.shift(),s=o.pop();if(o.length>p)throw new Error(`The maximum number of waypoints is ${p}.`);if(!n||!s){a("selectRoute","Invalid route format: When providing an array, it must include at least two points: a start and a destination.","EFP000401");return}t.routeStore.selectRoute(new S(f(n),f(s),o.map(f)));return}e||a("selectRoute","At a minimum, the starting point must be passed.","EFP000402"),t.routeStore.selectRoute(new S(f(e),f(i)))}getOptimizedRoutes(e){if(!Array.isArray(e))return a("getOptimizedRoutes","Parameter must be an array.","EFP000500"),[];if(e.length>p)throw new Error(`The maximum number of waypoints is ${p}.`);const i=e.map(f).filter(n=>!!n);if(!i.length)throw new Error("No booths found for the provided waypoints.");const o=new Map;for(const n of i){const s=n.layer?.name??"",r=o.get(s);r?r.push(n):o.set(s,[n])}return Array.from(o.values()).map(n=>({waypoints:Q(n.map(s=>[s.name,{cx:s.rect.cx,cy:s.rect.cy}]))}))}selectCurrentPosition(e,i,o){const n=d(e.x)&&d(e.y),s=d(e.lng)&&d(e.lat);!n&&!s&&a("selectCurrentPosition","A point must be passed. Either (x,y) or (lat,lng) are required.","EFP000600"),t.routeStore.selectCurrentPosition(e,i,o),this.onCurrentPositionChanged?.(e)}setBookmarks(e){(!Array.isArray(e)||!e.length)&&a("setBookmarks","Parameter must be an array.","EFP000700"),e.forEach(i=>{const o=t.exhibitorStore.exhibitors.find(n=>n.name===i.name||n.externalId===i.externalId);o&&(o.bookmarked=i.bookmarked)})}setEntitiesBookmarks(e){if(!Array.isArray(e)||!e.length){a("setEntitiesBookmarks","Parameter must be an array.","EFP000701");return}const i=["exhibitor","event","speaker","booth"],o=e.find(r=>!r.type||!i.includes(r.type));if(o){a("setEntitiesBookmarks",`Invalid entity type: ${o.type}. Must be one of: ${i.join(", ")}.`,"EFP000702");return}const n=B("bookmarked"),s={exhibitor:{existingIds:new Set(n.exhibitors||[]),finder:r=>t.exhibitorStore.findExhibitor(r),replacer:r=>t.exhibitorStore.replaceBookmarked(r)},event:{existingIds:new Set(n.events||[]),finder:r=>t.eventStore.findByNameOrSlug(r),replacer:r=>t.eventStore.replaceBookmarked(r)},speaker:{existingIds:new Set(n.speakers||[]),finder:r=>t.speakerStore.speakers.find(l=>l.name===r||l.externalId===r||l.slug===r),replacer:r=>t.speakerStore.replaceBookmarked(r)},booth:{existingIds:new Set(n.booths||[]),finder:r=>{const l=t.boothStore.findBooth(r);return l?.exhibitors.length===0?l:void 0},replacer:r=>t.boothStore.replaceBookmarked(r)}};e.forEach(r=>{const l=s[r.type],h=r.name||r.externalId||"",c=l.finder(h);c?r.bookmarked?l.existingIds.add(c.id):l.existingIds.delete(c.id):console.warn(`Entity not found: ${r.type} with query "${h}"`)}),Object.values(s).forEach(r=>{r.replacer(Array.from(r.existingIds))})}setEntitiesVisited(e){if(!Array.isArray(e)||!e.length){a("setEntitiesVisited","Parameter must be an array.","EFP000703");return}const i=["exhibitor","event"],o=e.find(r=>!r.type||!i.includes(r.type));if(o){a("setEntitiesVisited",`Invalid entity type: ${o.type}. Must be one of: ${i.join(", ")}.`,"EFP000704");return}const n=B("visited"),s={exhibitor:{existingIds:new Set(n.exhibitors||[]),finder:r=>t.exhibitorStore.findExhibitor(r),replacer:r=>t.exhibitorStore.replaceVisited(r)},event:{existingIds:new Set(n.events||[]),finder:r=>t.eventStore.findByNameOrSlug(r),replacer:r=>t.eventStore.replaceVisited(r)}};e.forEach(r=>{const l=s[r.type],h=r.name||r.externalId||"",c=l.finder(h);c?r.visited?l.existingIds.add(c.id):l.existingIds.delete(c.id):console.warn(`Entity not found: ${r.type} with query "${h}"`)}),Object.values(s).forEach(r=>{r.replacer(Array.from(r.existingIds))})}setMarkers(e){if(!e||!Array.isArray(e.icons)||!Array.isArray(e.markers)){a("setMarkers","Invalid input.","EFP000800");return}t.routeStore.setMarkers(e)}selectMarker(e,i=!0){return typeof e!="string"&&a("selectMarker","The identifier must be passed.","EFP000900"),t.routeStore.selectMarker(e,i)}drawCircles(e){Array.isArray(e)||a("drawCircles","Invalid input.","EFP000A00"),t.uiState.debugCircles=e}checkRoutes(){t.routeStore.checkRoutes()}updateLayerVisibility(e,i){typeof e!="string"&&a("updateLayerVisibility","The layer name (string) must be passed.","EFP000B00"),i||a("updateLayerVisibility","Passing a false value to visible will have no effect.","EFP000B01"),t.layerStore.updateVisibility(e,i)}getCenterCoordinates(){return t.fp.getCenterCoordinates()}exhibitorsList(){return t.exhibitorStore.exhibitors.map(e=>y(e))}boothsList(){return t.boothStore.booths.map(e=>y(e))}categoriesList(){return t.categoryStore.categories.map(e=>y(e))}selectCategory(e){if(e==null||typeof e!="string"){t.searchStore.selectSearch();return}const i=e?.toLowerCase(),o=t.categoryStore.categories.find(({name:n,slug:s})=>n?.toLowerCase()===i||s?.toLowerCase()===i);if(!o){a("selectCategory",`Category ${e} not found.`,"EFP000C01");return}t.selectCategory(o)}applyParameters(e){typeof e!="string"&&a("applyParameters","A query string must be passed.","EFP000D00"),M(e)}getVisibility(){return t.uiState.visibility}setVisibility(e){(typeof e!="object"||!Object.keys(e).length)&&a("setVisibility","The parameter must be passed.","EFP000E00"),t.uiState.setVisibility(e)}findLocation(){t.routeStore.findLocation()}zoomIn(){t.uiState.zoomIn()}zoomOut(){t.uiState.zoomOut()}switchView(){t.mapboxStore.activateMapbox()}zoomTo(e,i){b("zoomTo called with selectors=%O options=%O",e,i);const o=F.safeParse(e);if(!o.success){a("zoomTo",o.error.message,"EFP001600");return}const n=A.safeParse(i);if(!n.success){a("zoomTo",n.error.message,"EFP001601");return}const s=this.getBounds(e);s&&this.fitBounds(s,i)}getBounds(e){b("getBounds called with selectors=%O",e);const i=F.safeParse(e);if(!i.success){a("getBounds",i.error.message,"EFP001400");return}const o=[];if(e.booths?.forEach(s=>{let r;s.externalId?r=t.boothStore.boothByExternalId.get(s.externalId):s.name&&(r=t.boothStore.boothByName.get(s.name.toLowerCase())),r?.rect&&o.push(r.rect)}),e.exhibitors?.forEach(s=>{let r;s.externalId?r=t.exhibitorStore.exhibitorByExternalId.get(s.externalId):s.name&&(r=t.exhibitorStore.exhibitorByName.get(s.name.toLowerCase())),r?.booths?.forEach(l=>{l.rect&&o.push(l.rect)})}),o.length===0)return;const n=m.fromMultiple(o);return{leftTop:{x:n.x1,y:n.y1},rightBottom:{x:n.x2,y:n.y2}}}fitBounds(e,i){if(b("fitBounds called with bounds=%O options=%O",e,i),!e){t.uiState.fitBounds();return}const o=K.safeParse(e);if(!o.success){a("fitBounds",o.error.message,"EFP001500");return}const n=A.safeParse(i);if(!n.success){a("fitBounds",n.error.message,"EFP001501");return}let s;if(i?.padding){const r=i.padding;s=m.fromX1y1x2y2(e.leftTop.x-r,e.leftTop.y-r,e.rightBottom.x+r,e.rightBottom.y+r)}else s=m.fromX1y1x2y2(e.leftTop.x,e.leftTop.y,e.rightBottom.x,e.rightBottom.y);t.uiState.moveToRect=s}getBoothRect(e){return typeof e!="string"&&a("getBoothRect","A booth name must be passed.","EFP000F00"),x(e)?.rect}convertToGeo(e,i){if(!v?.properties?.config){a("convertToGeo","The coordinates cannot be converted because the GPS configuration is not defined.","EFP001000");return}if(!e||!i){a("convertToGeo","Both coordinates must be passed.","EFP001001");return}return O(e,i,v.properties.config)}unstable_destroy(){let e=window.__efpElement.firstChild;Y(),window.removeEventListener("__efpStyleLoad",this.efpStyleLoadHandler),window.removeEventListener("error",N),j(),G(),_(),[...document.getElementsByTagName("script")].filter(o=>o.src.indexOf("/fp.svg")>-1||o.src.indexOf("/wf.data.js")>-1||o.src.indexOf("/data.js")>-1).forEach(o=>o.remove()),this.root.unmount(),e.remove()}search(e){return typeof e!="string"&&a("search","A search string must be passed.","EFP001100"),t.fuzzySearchEngineStore.loadEngine().then(()=>(t.searchStore.selectSearch(e),t.uiState.fuzzySearchItems.map(i=>({item:y(i.item),score:i.score}))))}getFloors(){return t.layerStore.floors.map(e=>({name:e.name,shortName:e.shortName,description:e.description,active:e.active,disabled:e.disabled,index:e.index}))}activateFloor(e){if(!e?.name&&e?.index==null){a("activateFloor","Invalid floorId. It must contain either a name or an index.","EFP001200");return}const i=this.getFloors();if(e.name){const o=i.find(n=>n.name===e.name||n.shortName===e.name);if(!o){a("activateFloor",`Floor with name "${e.name}" not found.`,"EFP001201");return}if(o.active)return;this.updateLayerVisibility(o.name,!0);return}if(e.index!==null){const o=i.find(s=>s.index===e.index),n=o?.name;if(!n){a("activateFloor",`Floor at index ${e.index} does not exist.`,"EFP001203");return}if(o.active)return;this.updateLayerVisibility(n,!0);return}}showPathway(e,i){const o=new URLSearchParams;if(o.set(U,e),i?.length){const{boothExternalIds:n,exhibitorExternalIds:s}=E(i);n.length>0&&o.set("booths",n.join(",")),s.length>0&&o.set("exhibitors",s.join(","))}this.applyParameters(o.toString())}showPathwayOnly(e,i){this.activateFloor({name:i}),t.layerStore.showPathWay(e),t.uiState.setPathwayOnlyMode(!0);const o=t.layerStore.findLayer(e),n=t.layerStore.findLayer(i),s=o?.rect||o?.viewbox?o:n;if(s?.rect||s?.viewbox){const r=s.viewbox??s.rect;t.uiState.moveToRect=m.fromX1y1x2y2(r.x1,r.y1,r.x2,r.y2)}}hidePathways(){this.highlightBooths([]),t.layerStore.hidePathways(),t.uiState.setPathwayOnlyMode(!1)}showSearch(){t.selectSearch("")}changeLanguage(e){const i=e?.toLowerCase?.();if(!Z(i)){a("changeLanguage",`Language "${e}" was not found. Available languages: ${J().map(n=>n.id).join(",")}`,"EFP001300");return}const o=new URLSearchParams;o.set(X,i),this.applyParameters(o.toString())}isGpsTrackingEnabled(){return t.routeStore.gpsEnabled}setGpsTrackingEnabled(e){t.routeStore.setGpsTrackingEnabled(e)}deselectCurrentPosition(){t.routeStore.selectCurrentPosition(null,!1)}deselectRoute(){t.routeStore.selectRoute(null),t.routeStore.setOnlyAccessible(!1)}reset(){this.selectBooth(""),this.selectExhibitor(""),this.selectCategory(),this.deselectCurrentPosition(),this.deselectRoute(),this.highlightEntities([]),t.uiState.kioskData&&t.resetCameraFn?t.resetCameraFn?.():this.fitBounds()}selectAccessibleRoute(e){t.routeStore.setOnlyAccessible(!0),this.selectRoute(e)}}function f(u){return typeof u=="string"?x(u):t.routeStore.getNearestBooth(u)}let k=0;function a(u,e,i){const o=`Error calling "${u}" SDK method.`,n=`${e.endsWith(".")?e:e+"."} More information at`;let s="https://developer.expofp.com/guide/java-script-api-reference";if(i&&(s+=`#error-${i}`),console.error(`${o} ${n} ${s}`),t.fp.disableRuntimeAlerts)return;t.uiState.setGlobalErrorMessage({title:o,body:C(L,{children:[n," ",g("a",{href:s,target:"_blank",rel:"noreferrer",children:s})]})}),clearTimeout(k);const r=8e3;k=window.setTimeout(()=>{const l=async()=>{t.uiState.globalErrorMessages.length>0&&(t.uiState.popGlobalErrorMessage(),await new Promise(h=>setTimeout(h,r/2)),l())};l()},r)}
@@ -1 +1 @@
1
- import{createBrowserHistory as oe}from"history";import{autorun as A,reaction as k}from"mobx";import{handleCustomCommand as F}from"../utils/customCommands";import{BUILD_ROUTE_KEY as se,KIOSK_ENABLE_KEY as $,MAP_SETTINGS_KEY as re,PREVIEW_MODE_QUERY as E,PREVIEW_MODE_STORAGE_KEY as N,SEPARATOR as R,PATHWAY_KEY as W,PLANNER_KEY as P,PLANNER_SOURCE_KEY as K,PLANNER_FROM_KEY as Y,LANG_KEY as V,UI_SCALE_PARAM_KEY as H,UI_SCALE_RESET_PARAM_KEY as G,VIEWER_MODE_QUERY as I,VIEWER_MODE_STORAGE_KEY as D,LANGUAGE_TYPE as x}from"../constants";import v from"../data";import s,{uiState as i}from"../store";import{CurrentPosition as ae,extractRoute as ie,findBooth as le}from"../store/RouteStore";import{setConsentSettings as z}from"../tools/gtag";import U from"../tools/logger";import{isLocalStorageAvailable as L}from"../utils/localStorage";import{yahKey as ne}from"../utils/yah";import{areLayersEnabled as ce}from"../utils/areLayersEnabled";import ue from"../core/Rect";import{getMostFrequent as he}from"../utils/getMostFrequent";import{runInAction as C}from"mobx";import{recoverKioskFromUrlPrams as fe}from"../components/Kiosk/recoverKioskFromUrlPrams";import{hasLocale as de,setLocale as me}from"../utils/i18n";let m=!1,_=!1,j=null,q=null,Q=null,J;const h=oe(),B=window.location.pathname,S=[];export function getLocationHistory(){return S}function b(t){return B+t}function pe(t){m||h.push(b(t))}export function historyReplace(t){m||h.push(b(t))}function f(t){return t.replace(/=&/g,"&").replace(/=$/,"")}function X(){let t="";const l=i.selectedExhibitor,a=i.selectedBooth,e=i.selectedEventItem,o=i.selectedRoute,r=i.selectedSpeaker,n=i.setKioskModeEnabled;if(i.list.type==="route-planner"&&!l&&!a&&!e){const d=s.routePlannerStore;if(d.source==="bookmarks")t=`${P}&${K}=bookmarks`;else{const w=d.items.map(g=>g.entity.slug).filter(Boolean).join(R);t=`${P}=${w}`}const p=d.startPoint?.slug;p&&(t+=`&${Y}=${p}`)}else if(o&&!i.isMultiPointRoute){const d=o.from?`:${o.from.slug}`:"",p=o.to?`:${o.to.slug}`:"",w=s.routeStore.onlyAccessible?":true":":false",g=o.waypoints?.map(u=>`:${u.slug}`).join("");t=`route${p}${d}${w}${g||""}`}else if(l)t=l.slug;else if(a)t=a.slug;else if(e)t=e.slug;else if(r)t=r.slug;else if(n)t="";else switch(i.list.type){case"bookmarks":t="bookmarks";break;case"visited":t="visited";break;case"category":t=i.selectedCategory.slug;break;case"search":t=i.list.text||"";break;case x:t=x;break;case"filter":t=`${i.list.query.key}=${i.list.query.value}`;break;case"sessions":t="sessions";break;case"exhibitors":t="exhibitors";break;case"speakers":t="speakers";break;case"tours":t="tours";break;case"multi-point-tour":t=`tour=${i.list.tourId}`;break;default:throw new Error("Unkown list.type")}if(_)return;const c=t?"?"+encodeURIComponent(t):"";h.location.search!==c&&(l!==j||a!==q||e!==Q?pe(c):historyReplace(c),j=l,q=a,Q=e)}function Z(){const t=i.selectedExhibitor,l=i.selectedEventItem,a=i.selectedSpeaker;let e="";t?e=t.name:l?e=l.name:a?e=a.name:i.list.type==="search"&&i.list.text?e="`"+(i.list.text||"")+"`":i.list.type==="multi-point-tour"&&i.tourTitle&&(e=i.tourTitle),e.length&&(e+=" \u2013 "),e+=v.title,v.subtitle&&(e+=" \u2013 "+v.subtitle),e+=" \u2013 Expo Floor Plan by ExpoFP",document.title=e}function T(){const t=h.location.search.length>1?decodeURIComponent(h.location.search.substring(1)):"";return F(t,!1)}function y(){const t=h.location.search.length>1?decodeURIComponent(h.location.search.substring(1)):"";_=!0;const l=s.boothStore.booths.find(e=>e.slug?.toLowerCase()===t?.toLowerCase()||e.externalId?.toLowerCase()===t?.toLowerCase()||e.externalId?.toLowerCase()?.replace(/\s+/g,"")===t?.toLowerCase()),a=new URLSearchParams(decodeURIComponent(window.location.search));if(fe(a),ge(a),!T())if(a.has("yah")){const e=a.get("yah");F(`${ne} ${e}`,!0)}else if(a.has($)){const e=a.get($);e==="1"?i.kiosk=!0:e==="0"&&(i.kiosk=!1,i.resetUIScale())}else if(t==="tours")s.selectTours();else if(t.startsWith("tour=")){const e=t.split("=")[1],o=s.toursStore.getTourById(e);o?s.toursStore.launchTour(o,o.name,o.description):(console.warn(`Route with id "${e}" not found`),s.selectTours())}else if(a.has(P)){const e=a.get(K),o=a.get(Y),r=o?le(o):null;if(e==="bookmarks")s.routePlannerStore.launchFromBookmarks(r??void 0);else{const n=(a.get(P)||"").split(R).filter(Boolean);s.routePlannerStore.launchFromSlugs(n,r??void 0)}}else if(t.startsWith("route")){const e=t.split(R);C(()=>{s.routeStore.onlyAccessible=e[3]==="true"});const o=ie(e[2],e[1],e.slice(4));s.routeStore.selectRoute(o);const n=e.slice(4).length>0;s.uiState.setIsMultiPointRoute(n);const d=new URLSearchParams(window.location.search).get("title");d&&s.uiState.setRouteTitle(d)}else if(t==="bookmarks")s.selectBookmarks();else if(t==="visited")s.selectVisited();else if(t===x)s.selectLanguage();else if(a.has(V)){const e=a.get(V)?.toLowerCase();de(e)&&me(e)}else if(t==="sessions")s.selectSessions();else if(t==="exhibitors")s.selectExhibitors();else if(t==="speakers")s.selectSpeakers();else if(t==="-pdf")s.uiState.printingPdf=!0;else if(t.startsWith("hide"))s.uiState.setVisibility(new URLSearchParams(t).get("hide").split(",").filter(Boolean).reduce((e,o)=>({...e,[o]:!1}),{}));else if(l)setTimeout(()=>s.selectBooth(l),250);else if(t===se)s.uiState.startBuildRoute();else if(a.get(W)){const e=a.get(W),o=a.get("booths")?.split(",")||[],r=a.get("exhibitors")?.split(",")||[],n=a.get("tour");if(n){const u=s.toursStore.getTourById(n);u&&C(()=>{s.uiState.setTourTitle(u.name),s.uiState.setTourDescription(u.description),s.uiState.setIsMultiPointTour(!0),s.uiState.setMultiPointTourList(u.id)})}const c=s.boothStore.booths,d=s.exhibitorStore.exhibitors,p=c.filter(u=>o.includes(u.externalId)),w=d.filter(u=>r.includes(u.externalId)).flatMap(u=>u.booths),g=[...p,...w];if(ce()){const u=g.map(te=>te.layer.name),O=he(u);O&&s.fp.activateFloor({name:O})}(o.length>0||r.length>0)&&s.fp.highlightEntities([...o,...r]),s.layerStore.showPathWay(e),g.length>0&&C(()=>{s.uiState.moveToRect=ue.fromMultiple(g.map(u=>u.rect).filter(Boolean)),s.uiState.rollReset=!0})}else{const e=s.eventStore.eventItems.find(o=>o.slug?.toLowerCase()===t?.toLowerCase()||o.externalId?.toLowerCase()===t?.toLowerCase());if(e)s.selectEventItem(e,!0);else{const o=s.exhibitorStore.exhibitors.find(r=>r.slug?.toLowerCase()===t?.toLowerCase()||r.externalId?.toLowerCase()===t?.toLowerCase());if(t.startsWith("exhibitors")){const r=t.split("=")[1].split(",");setTimeout(()=>s.fp.selectExhibitor(r),250)}else if(o)setTimeout(()=>s.clickExhibitor(o),250);else if(t.includes("=")&&(t.startsWith("categories=")||t.startsWith("poiType=")))U.log("Skipping filter parameter in dispatchFromUrl:",t);else{const n=s.categoryStore.categories.find(c=>c.slug===t);if(n)s.selectCategory(n);else{const c=s.speakerStore.findBySlug(t);c?s.selectSpeaker(c,!0):t.includes("heatmap=true")||s.searchStore.selectSearch(t)}}}}_=!1,X(),Z()}function M(){const t=h.location.search;if(t.includes("heatmap")){const e=new URL(window.location.href);if(e.searchParams.get("heatmap")==="true")if(e.searchParams.get("type")==="yah"){let r=f(e.search);m=!0,historyReplace(r),s.uiState.heatmapYah=!0,s.uiState.monochrome=!0,s.uiState.hideLogoInBooth=!0,s.uiState.hideHeaderLogo=!0,s.uiState.disableBookmarked=!0}else{e.searchParams.delete("heatmap");let r=f(e.search);m=!0,historyReplace(r),s.uiState.heatmap=!0}}if(t.startsWith("?preview="))historyReplace("?");else if(t.startsWith("?b="))historyReplace("?bookmarks");else if(t.startsWith("?ba=")){const e=new URL(window.location.href),o=parseInt(e.searchParams.get("ba")),r=s.exhibitorStore.exhibitorById.get(o);historyReplace(r?"?"+r.slug:"?bookmarks")}else t.startsWith("?mapbox=false")&&(s.mapboxStore.isMapbox=!1,historyReplace("?"));if(t.includes("blue-dot")){const e=new URL(window.location.href),o=e.searchParams.get("blue-dot").split(",");if(e.searchParams.delete("blue-dot"),o.length>1){const n=s.layerStore.findLayer(o[2])?.name,c=new ae(Number(o[0])||void 0,Number(o[1])||void 0,n,void 0,Number(o[3])||void 0,Number(o[4])||void 0);s.layerStore.layersLoaded?s.routeStore.selectCurrentPosition(c,!1,1):k(()=>s.layerStore.layersLoaded,()=>{s.routeStore.selectCurrentPosition(c,!1,1)})}let r=f(e.search);historyReplace(r)}if(t.includes("copy_exh")){const e=new URL(window.location.href),o=e.searchParams.get("copy_exh");e.searchParams.delete("copy_exh"),historyReplace("?")}if(t.includes("noOverlay")){const e=new URL(window.location.href),o=e.searchParams.get("noOverlay");e.searchParams.delete("noOverlay");let r=f(e.search);o==="true"?s.uiState.hideOverlay=!0:o==="false"&&(s.uiState.hideOverlay=!1),historyReplace(r)}if(t.includes("allowConsent")){const e=new URL(window.location.href),o=e.searchParams.get("allowConsent");e.searchParams.delete("allowConsent");const r=f(e.search);o==="true"?z(!0):o==="false"&&z(!1),historyReplace(r)}if(t.includes("hideHeaderLogo")){const e=new URL(window.location.href),o=e.searchParams.get("hideHeaderLogo");e.searchParams.delete("hideHeaderLogo");const r=f(e.search);o==="true"&&(i.hideHeaderLogo=!0),historyReplace(r)}if(t.includes("hideLogoInBooth")){const e=new URL(window.location.href),o=e.searchParams.get("hideLogoInBooth");e.searchParams.delete("hideLogoInBooth");const r=f(e.search);o==="true"&&(i.hideLogoInBooth=!0),historyReplace(r)}if(t.includes("disableFeatured")){const e=new URL(window.location.href),o=e.searchParams.get("disableFeatured");e.searchParams.delete("disableFeatured");const r=f(e.search);o==="true"&&s.exhibitorStore.exhibitors.forEach(n=>n.featured=!1),historyReplace(r)}if(t.includes("disableBookmarked")){const e=new URL(window.location.href),o=e.searchParams.get("disableBookmarked");e.searchParams.delete("disableBookmarked");const r=f(e.search);o==="true"&&(i.disableBookmarked=!0),historyReplace(r)}if(t.includes("disableGps")){const e=new URL(window.location.href),o=e.searchParams.get("disableGps");e.searchParams.delete("disableGps");const r=f(e.search);o==="true"&&s.routeStore.setGpsTrackingEnabled(!1),historyReplace(r)}if(t.includes("monochrome")){const e=new URL(window.location.href),o=e.searchParams.get("monochrome");e.searchParams.delete("monochrome");const r=f(e.search);o==="true"&&(i.monochrome=!0),historyReplace(r)}if((t.startsWith("?fbclid")||t.startsWith("?_ga"))&&historyReplace("?"),t.includes(I)){const e=new URL(window.location.href),o=e.searchParams.get(I);o==="1"||o==="true"?L&&localStorage.setItem(D,"1"):(o==="0"||o==="false")&&L&&localStorage.removeItem(D),e.searchParams.delete(I),historyReplace(f(e.search))}if(t.includes(E)){const e=new URL(window.location.href),o=e.searchParams.get(E);o==="true"?L&&localStorage.setItem(N,"1"):o==="false"&&L&&localStorage.removeItem(N),e.searchParams.delete(E),historyReplace(f(e.search))}if(i.previewExhibitor&&historyReplace("?"+i.previewExhibitor.slug),h.location.search.includes("&")||h.location.search.includes("%26")){let e=h.location.search;e=e.startsWith("?")?e.slice(1):e;const o=e.includes("&")?"&":"%26",n=e.split(o).map(c=>{const d=s.exhibitorStore.exhibitors.find(p=>p.slug===c||p.externalId===c);return d?d.name:c}).join("&");historyReplace("?"+n)}const l=new URLSearchParams(window.location.search);if(l.has(G)){s.uiState.resetUIScale();const e=new URL(window.location.href);e.searchParams.delete(G);let o=f(e.search);m=!0,historyReplace(o),m=!1}const a=l.get(H);if(a){const e=a.replace(",","."),o=parseFloat(e);!isNaN(o)&&o>=.8&&o<=1.4?s.uiState.setUIScale(o,!0):U.warn(`Invalid ui-scale parameter: ${a}. Must be a number between 0.8 and 1.4.`);const r=new URL(window.location.href);r.searchParams.delete(H);let n=f(r.search);m=!0,historyReplace(n),m=!1}}export function initRouting(t=!1){m=t,!m&&b(h.location.search)===B&&S.push(b(h.location.search)),J=h.listen((l,a)=>{m||(S.push(b(l.search)),U.log("history",a,l),a==="POP"&&y())}),M(),T(),k(()=>s.layerStore.layersLoaded,()=>{s.urlFilterManager&&!s.urlFilterManager.isInitialized&&s.urlFilterManager.initialize(),y(),A(Z),A(X),i.viewerMode&&(i.menu=!0)})}export function applyParameters(t=""){historyReplace("?"+decodeURIComponent(t.toString())),s.layerStore.layersLoaded?(M(),y()):(T(),k(()=>s.layerStore.layersLoaded,()=>{M(),y()}))}export function destroyHistory(){J()}export function goBack(){if(console.log("goBack"),S.length>1){S.pop();const l=S[S.length-1].replace(B,"");return m=!0,h.replace(l),m=!1,y(),!0}else return h.go(-1),!1}function ge(t){try{let l={};const a=i.defaultMapSettings;if(new Set(t.keys()).size)l=ee(Object.fromEntries(t.entries()),a);else{const e=sessionStorage.getItem(re);e&&(l=ee(JSON.parse(e),a))}if(i.setMapSettings(l),l.z){const e=s.layerStore.layers.find(o=>o.name===l.z);e&&s.layerStore.updateVisibility(e,!0)}}catch(l){console.error("Failed to process or save map settings.",l)}}function ee(t,l){const a={};for(const e in t){if(!Object.prototype.hasOwnProperty.call(l,e)||!Object.prototype.hasOwnProperty.call(t,e))continue;const o=t[e];typeof l[e]=="number"&&typeof o=="string"?a[e]=parseFloat(o):a[e]=o}return a}
1
+ import{createBrowserHistory as oe}from"history";import{autorun as O,reaction as k}from"mobx";import{handleCustomCommand as A}from"../utils/customCommands";import{BUILD_ROUTE_KEY as se,KIOSK_ENABLE_KEY as F,MAP_SETTINGS_KEY as re,PREVIEW_MODE_QUERY as E,PREVIEW_MODE_STORAGE_KEY as $,SEPARATOR as R,PATHWAY_KEY as N,PLANNER_KEY as P,PLANNER_SOURCE_KEY as W,PLANNER_FROM_KEY as K,LANG_KEY as Y,UI_SCALE_PARAM_KEY as V,UI_SCALE_RESET_PARAM_KEY as H,VIEWER_MODE_QUERY as I,VIEWER_MODE_STORAGE_KEY as G,LANGUAGE_TYPE as x}from"../constants";import v from"../data";import s,{uiState as i}from"../store";import{CurrentPosition as ae,extractRoute as ie,findBooth as le}from"../store/RouteStore";import{setConsentSettings as D}from"../tools/gtag";import U from"../tools/logger";import{isLocalStorageAvailable as L}from"../utils/localStorage";import{yahKey as ne}from"../utils/yah";import{areLayersEnabled as ce}from"../utils/areLayersEnabled";import ue from"../core/Rect";import{getMostFrequent as he}from"../utils/getMostFrequent";import{runInAction as z}from"mobx";import{recoverKioskFromUrlPrams as fe}from"../components/Kiosk/recoverKioskFromUrlPrams";import{hasLocale as de,setLocale as me}from"../utils/i18n";let m=!1,C=!1,j=null,q=null,Q=null,J;const h=oe(),_=window.location.pathname,S=[];export function getLocationHistory(){return S}function b(t){return _+t}function pe(t){m||h.push(b(t))}export function historyReplace(t){m||h.push(b(t))}function f(t){return t.replace(/=&/g,"&").replace(/=$/,"")}function X(){let t="";const l=i.selectedExhibitor,a=i.selectedBooth,e=i.selectedEventItem,o=i.selectedRoute,r=i.selectedSpeaker,n=i.setKioskModeEnabled;if(i.list.type==="route-planner"&&!l&&!a&&!e){const d=s.routePlannerStore;if(d.source==="bookmarks")t=`${P}&${W}=bookmarks`;else{const w=d.items.map(g=>g.entity.slug).filter(Boolean).join(R);t=`${P}=${w}`}const p=d.startPoint?.slug;p&&(t+=`&${K}=${p}`)}else if(o&&!i.isMultiPointRoute){const d=o.from?`:${o.from.slug}`:"",p=o.to?`:${o.to.slug}`:"",w=s.routeStore.onlyAccessible?":true":":false",g=o.waypoints?.map(u=>`:${u.slug}`).join("");t=`route${p}${d}${w}${g||""}`}else if(l)t=l.slug;else if(a)t=a.slug;else if(e)t=e.slug;else if(r)t=r.slug;else if(n)t="";else switch(i.list.type){case"bookmarks":t="bookmarks";break;case"visited":t="visited";break;case"category":t=i.selectedCategory.slug;break;case"search":t=i.list.text||"";break;case x:t=x;break;case"filter":t=`${i.list.query.key}=${i.list.query.value}`;break;case"sessions":t="sessions";break;case"exhibitors":t="exhibitors";break;case"speakers":t="speakers";break;case"tours":t="tours";break;case"multi-point-tour":t=`tour=${i.list.tourId}`;break;default:throw new Error("Unkown list.type")}if(C)return;const c=t?"?"+encodeURIComponent(t):"";h.location.search!==c&&(l!==j||a!==q||e!==Q?pe(c):historyReplace(c),j=l,q=a,Q=e)}function Z(){const t=i.selectedExhibitor,l=i.selectedEventItem,a=i.selectedSpeaker;let e="";t?e=t.name:l?e=l.name:a?e=a.name:i.list.type==="search"&&i.list.text?e="`"+(i.list.text||"")+"`":i.list.type==="multi-point-tour"&&i.tourTitle&&(e=i.tourTitle),e.length&&(e+=" \u2013 "),e+=v.title,v.subtitle&&(e+=" \u2013 "+v.subtitle),e+=" \u2013 Expo Floor Plan by ExpoFP",document.title=e}function B(){const t=h.location.search.length>1?decodeURIComponent(h.location.search.substring(1)):"";return A(t,!1)}function y(){const t=h.location.search.length>1?decodeURIComponent(h.location.search.substring(1)):"";C=!0;const l=s.boothStore.booths.find(e=>e.slug?.toLowerCase()===t?.toLowerCase()||e.externalId?.toLowerCase()===t?.toLowerCase()||e.externalId?.toLowerCase()?.replace(/\s+/g,"")===t?.toLowerCase()),a=new URLSearchParams(decodeURIComponent(window.location.search));if(fe(a),ge(a),!B())if(a.has("yah")){const e=a.get("yah");A(`${ne} ${e}`,!0)}else if(a.has(F)){const e=a.get(F);e==="1"?i.kiosk=!0:e==="0"&&(i.kiosk=!1,i.resetUIScale())}else if(t==="tours")s.selectTours();else if(t.startsWith("tour=")){const e=t.split("=")[1],o=s.toursStore.getTourById(e);o?s.toursStore.launchTour(o,o.name,o.description):(console.warn(`Route with id "${e}" not found`),s.selectTours())}else if(a.has(P)){const e=a.get(W),o=a.get(K),r=o?le(o):null;if(e==="bookmarks")s.routePlannerStore.launchFromBookmarks(r??void 0);else{const n=(a.get(P)||"").split(R).filter(Boolean);s.routePlannerStore.launchFromSlugs(n,r??void 0)}}else if(t.startsWith("route")){const e=t.split(R);s.routeStore.setOnlyAccessible(e[3]==="true");const o=ie(e[2],e[1],e.slice(4));s.routeStore.selectRoute(o);const n=e.slice(4).length>0;s.uiState.setIsMultiPointRoute(n);const d=new URLSearchParams(window.location.search).get("title");d&&s.uiState.setRouteTitle(d)}else if(t==="bookmarks")s.selectBookmarks();else if(t==="visited")s.selectVisited();else if(t===x)s.selectLanguage();else if(a.has(Y)){const e=a.get(Y)?.toLowerCase();de(e)&&me(e)}else if(t==="sessions")s.selectSessions();else if(t==="exhibitors")s.selectExhibitors();else if(t==="speakers")s.selectSpeakers();else if(t==="-pdf")s.uiState.printingPdf=!0;else if(t.startsWith("hide"))s.uiState.setVisibility(new URLSearchParams(t).get("hide").split(",").filter(Boolean).reduce((e,o)=>({...e,[o]:!1}),{}));else if(l)setTimeout(()=>s.selectBooth(l),250);else if(t===se)s.uiState.startBuildRoute();else if(a.get(N)){const e=a.get(N),o=a.get("booths")?.split(",")||[],r=a.get("exhibitors")?.split(",")||[],n=a.get("tour");if(n){const u=s.toursStore.getTourById(n);u&&z(()=>{s.uiState.setTourTitle(u.name),s.uiState.setTourDescription(u.description),s.uiState.setIsMultiPointTour(!0),s.uiState.setMultiPointTourList(u.id)})}const c=s.boothStore.booths,d=s.exhibitorStore.exhibitors,p=c.filter(u=>o.includes(u.externalId)),w=d.filter(u=>r.includes(u.externalId)).flatMap(u=>u.booths),g=[...p,...w];if(ce()){const u=g.map(te=>te.layer.name),M=he(u);M&&s.fp.activateFloor({name:M})}(o.length>0||r.length>0)&&s.fp.highlightEntities([...o,...r]),s.layerStore.showPathWay(e),g.length>0&&z(()=>{s.uiState.moveToRect=ue.fromMultiple(g.map(u=>u.rect).filter(Boolean)),s.uiState.rollReset=!0})}else{const e=s.eventStore.eventItems.find(o=>o.slug?.toLowerCase()===t?.toLowerCase()||o.externalId?.toLowerCase()===t?.toLowerCase());if(e)s.selectEventItem(e,!0);else{const o=s.exhibitorStore.exhibitors.find(r=>r.slug?.toLowerCase()===t?.toLowerCase()||r.externalId?.toLowerCase()===t?.toLowerCase());if(t.startsWith("exhibitors")){const r=t.split("=")[1].split(",");setTimeout(()=>s.fp.selectExhibitor(r),250)}else if(o)setTimeout(()=>s.clickExhibitor(o),250);else if(t.includes("=")&&(t.startsWith("categories=")||t.startsWith("poiType=")))U.log("Skipping filter parameter in dispatchFromUrl:",t);else{const n=s.categoryStore.categories.find(c=>c.slug===t);if(n)s.selectCategory(n);else{const c=s.speakerStore.findBySlug(t);c?s.selectSpeaker(c,!0):t.includes("heatmap=true")||s.searchStore.selectSearch(t)}}}}C=!1,X(),Z()}function T(){const t=h.location.search;if(t.includes("heatmap")){const e=new URL(window.location.href);if(e.searchParams.get("heatmap")==="true")if(e.searchParams.get("type")==="yah"){let r=f(e.search);m=!0,historyReplace(r),s.uiState.heatmapYah=!0,s.uiState.monochrome=!0,s.uiState.hideLogoInBooth=!0,s.uiState.hideHeaderLogo=!0,s.uiState.disableBookmarked=!0}else{e.searchParams.delete("heatmap");let r=f(e.search);m=!0,historyReplace(r),s.uiState.heatmap=!0}}if(t.startsWith("?preview="))historyReplace("?");else if(t.startsWith("?b="))historyReplace("?bookmarks");else if(t.startsWith("?ba=")){const e=new URL(window.location.href),o=parseInt(e.searchParams.get("ba")),r=s.exhibitorStore.exhibitorById.get(o);historyReplace(r?"?"+r.slug:"?bookmarks")}else t.startsWith("?mapbox=false")&&(s.mapboxStore.isMapbox=!1,historyReplace("?"));if(t.includes("blue-dot")){const e=new URL(window.location.href),o=e.searchParams.get("blue-dot").split(",");if(e.searchParams.delete("blue-dot"),o.length>1){const n=s.layerStore.findLayer(o[2])?.name,c=new ae(Number(o[0])||void 0,Number(o[1])||void 0,n,void 0,Number(o[3])||void 0,Number(o[4])||void 0);s.layerStore.layersLoaded?s.routeStore.selectCurrentPosition(c,!1,1):k(()=>s.layerStore.layersLoaded,()=>{s.routeStore.selectCurrentPosition(c,!1,1)})}let r=f(e.search);historyReplace(r)}if(t.includes("copy_exh")){const e=new URL(window.location.href),o=e.searchParams.get("copy_exh");e.searchParams.delete("copy_exh"),historyReplace("?")}if(t.includes("noOverlay")){const e=new URL(window.location.href),o=e.searchParams.get("noOverlay");e.searchParams.delete("noOverlay");let r=f(e.search);o==="true"?s.uiState.hideOverlay=!0:o==="false"&&(s.uiState.hideOverlay=!1),historyReplace(r)}if(t.includes("allowConsent")){const e=new URL(window.location.href),o=e.searchParams.get("allowConsent");e.searchParams.delete("allowConsent");const r=f(e.search);o==="true"?D(!0):o==="false"&&D(!1),historyReplace(r)}if(t.includes("hideHeaderLogo")){const e=new URL(window.location.href),o=e.searchParams.get("hideHeaderLogo");e.searchParams.delete("hideHeaderLogo");const r=f(e.search);o==="true"&&(i.hideHeaderLogo=!0),historyReplace(r)}if(t.includes("hideLogoInBooth")){const e=new URL(window.location.href),o=e.searchParams.get("hideLogoInBooth");e.searchParams.delete("hideLogoInBooth");const r=f(e.search);o==="true"&&(i.hideLogoInBooth=!0),historyReplace(r)}if(t.includes("disableFeatured")){const e=new URL(window.location.href),o=e.searchParams.get("disableFeatured");e.searchParams.delete("disableFeatured");const r=f(e.search);o==="true"&&s.exhibitorStore.exhibitors.forEach(n=>n.featured=!1),historyReplace(r)}if(t.includes("disableBookmarked")){const e=new URL(window.location.href),o=e.searchParams.get("disableBookmarked");e.searchParams.delete("disableBookmarked");const r=f(e.search);o==="true"&&(i.disableBookmarked=!0),historyReplace(r)}if(t.includes("disableGps")){const e=new URL(window.location.href),o=e.searchParams.get("disableGps");e.searchParams.delete("disableGps");const r=f(e.search);o==="true"&&s.routeStore.setGpsTrackingEnabled(!1),historyReplace(r)}if(t.includes("monochrome")){const e=new URL(window.location.href),o=e.searchParams.get("monochrome");e.searchParams.delete("monochrome");const r=f(e.search);o==="true"&&(i.monochrome=!0),historyReplace(r)}if((t.startsWith("?fbclid")||t.startsWith("?_ga"))&&historyReplace("?"),t.includes(I)){const e=new URL(window.location.href),o=e.searchParams.get(I);o==="1"||o==="true"?L&&localStorage.setItem(G,"1"):(o==="0"||o==="false")&&L&&localStorage.removeItem(G),e.searchParams.delete(I),historyReplace(f(e.search))}if(t.includes(E)){const e=new URL(window.location.href),o=e.searchParams.get(E);o==="true"?L&&localStorage.setItem($,"1"):o==="false"&&L&&localStorage.removeItem($),e.searchParams.delete(E),historyReplace(f(e.search))}if(i.previewExhibitor&&historyReplace("?"+i.previewExhibitor.slug),h.location.search.includes("&")||h.location.search.includes("%26")){let e=h.location.search;e=e.startsWith("?")?e.slice(1):e;const o=e.includes("&")?"&":"%26",n=e.split(o).map(c=>{const d=s.exhibitorStore.exhibitors.find(p=>p.slug===c||p.externalId===c);return d?d.name:c}).join("&");historyReplace("?"+n)}const l=new URLSearchParams(window.location.search);if(l.has(H)){s.uiState.resetUIScale();const e=new URL(window.location.href);e.searchParams.delete(H);let o=f(e.search);m=!0,historyReplace(o),m=!1}const a=l.get(V);if(a){const e=a.replace(",","."),o=parseFloat(e);!isNaN(o)&&o>=.8&&o<=1.4?s.uiState.setUIScale(o,!0):U.warn(`Invalid ui-scale parameter: ${a}. Must be a number between 0.8 and 1.4.`);const r=new URL(window.location.href);r.searchParams.delete(V);let n=f(r.search);m=!0,historyReplace(n),m=!1}}export function initRouting(t=!1){m=t,!m&&b(h.location.search)===_&&S.push(b(h.location.search)),J=h.listen((l,a)=>{m||(S.push(b(l.search)),U.log("history",a,l),a==="POP"&&y())}),T(),B(),k(()=>s.layerStore.layersLoaded,()=>{s.urlFilterManager&&!s.urlFilterManager.isInitialized&&s.urlFilterManager.initialize(),y(),O(Z),O(X),i.viewerMode&&(i.menu=!0)})}export function applyParameters(t=""){historyReplace("?"+decodeURIComponent(t.toString())),s.layerStore.layersLoaded?(T(),y()):(B(),k(()=>s.layerStore.layersLoaded,()=>{T(),y()}))}export function destroyHistory(){J()}export function goBack(){if(console.log("goBack"),S.length>1){S.pop();const l=S[S.length-1].replace(_,"");return m=!0,h.replace(l),m=!1,y(),!0}else return h.go(-1),!1}function ge(t){try{let l={};const a=i.defaultMapSettings;if(new Set(t.keys()).size)l=ee(Object.fromEntries(t.entries()),a);else{const e=sessionStorage.getItem(re);e&&(l=ee(JSON.parse(e),a))}if(i.setMapSettings(l),l.z){const e=s.layerStore.layers.find(o=>o.name===l.z);e&&s.layerStore.updateVisibility(e,!0)}}catch(l){console.error("Failed to process or save map settings.",l)}}function ee(t,l){const a={};for(const e in t){if(!Object.prototype.hasOwnProperty.call(l,e)||!Object.prototype.hasOwnProperty.call(t,e))continue;const o=t[e];typeof l[e]=="number"&&typeof o=="string"?a[e]=parseFloat(o):a[e]=o}return a}
@@ -51,6 +51,7 @@ export default class RouteStore {
51
51
  isGpsTrackingEnabled: boolean;
52
52
  setGpsTrackingEnabled(value: boolean): void;
53
53
  get gpsEnabled(): boolean;
54
+ setOnlyAccessible(value: boolean): void;
54
55
  }
55
56
  export declare function findBooth(str: string): Booth | undefined;
56
57
  export declare function findEntityByExternalId(externalId: string): {
@@ -1 +1 @@
1
- import{__esDecorate as i,__runInitializers as r}from"tslib";import{action as m,computed as k,observable as d}from"mobx";import{Point as Ve,lineLength as Me}from"simple-geometry";import o,{boothStore as je,layersStore as x}from".";import{fpGeo as T}from"../data/fpGeo";import We from"../core/Rect";import{GaEventActions as Ke,sendEventToGa as Xe}from"../tools/gtag";import{convertGpsToLocal as Be,isValidPointCoords as Ce,calculateRelativeBearing as Ye}from"../utils/gps";import{getLayerSvg as He,svgArea as Je}from"../data/svg";import{getGraphLines as Qe,boothToWaypoint as Fe,graphDataSource as Ge}from"../wayfinding";import{LayersMode as et}from"./LayerStore";import{uiState as p}from"./index";import{calcSpeed as Ue}from"../utils/calcSpeed";import{calcTravelTime as Oe}from"../utils/calcTravelTime";import{DEFAULT_UNITS as Ne,ORIENTATION_GRANTED_KEY as tt}from"../constants";import{areLayersEnabled as st}from"../utils/areLayersEnabled";import{distancePointToRouteOnLayer as at,findBoothInRadius as it}from"../components/Map/drawing/config/route-snapping";import Ze from"../data";import qe from"../tools/logger";import rt from"../tools/settings";const g=a=>typeof a=="string"?Number(a.replace(",",".")):a;let nt=(()=>{let a=[],n,l=[],f=[],h,v=[],R=[],L,E=[],z=[],P,D=[],I=[],w,A=[],M=[],B,C=[],F=[],G,U=[],O=[],N,Z=[],q=[],$,V=[],j=[],W,K=[],X=[],Y,H=[],J=[],Q,ee=[],te=[],se,ae=[],ie=[],re,ne=[],oe=[],le,ce,ue,de,fe,he,me,pe,_e,ge,ye,ke,be,ve=[],Re=[],xe,Se,Te,Le,Ee,ze,Pe=[],De=[],Ie,we;return class{static{const t=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;n=[d],h=[d],L=[d],P=[d],w=[d],B=[d],G=[d],N=[d],$=[d],W=[d],Y=[d],Q=[d],se=[d],re=[d],le=[k],ce=[m],ue=[m],de=[k({keepAlive:!0})],fe=[k({keepAlive:!0})],he=[m],me=[m],pe=[k({keepAlive:!0})],_e=[k({keepAlive:!0})],ge=[m],ye=[m],ke=[m],be=[d],xe=[k],Se=[m],Te=[m],Le=[m],Ee=[m],ze=[d],Ie=[m],we=[k({keepAlive:!0})],i(this,null,le,{kind:"getter",name:"canFindLocation",static:!1,private:!1,access:{has:e=>"canFindLocation"in e,get:e=>e.canFindLocation},metadata:t},null,a),i(this,null,ce,{kind:"method",name:"selectRoute",static:!1,private:!1,access:{has:e=>"selectRoute"in e,get:e=>e.selectRoute},metadata:t},null,a),i(this,null,ue,{kind:"method",name:"setStartPoint",static:!1,private:!1,access:{has:e=>"setStartPoint"in e,get:e=>e.setStartPoint},metadata:t},null,a),i(this,null,de,{kind:"getter",name:"pathLayers",static:!1,private:!1,access:{has:e=>"pathLayers"in e,get:e=>e.pathLayers},metadata:t},null,a),i(this,null,fe,{kind:"getter",name:"nearestBooth",static:!1,private:!1,access:{has:e=>"nearestBooth"in e,get:e=>e.nearestBooth},metadata:t},null,a),i(this,null,he,{kind:"method",name:"setMarkers",static:!1,private:!1,access:{has:e=>"setMarkers"in e,get:e=>e.setMarkers},metadata:t},null,a),i(this,null,me,{kind:"method",name:"selectMarker",static:!1,private:!1,access:{has:e=>"selectMarker"in e,get:e=>e.selectMarker},metadata:t},null,a),i(this,null,pe,{kind:"getter",name:"selectedMarkers",static:!1,private:!1,access:{has:e=>"selectedMarkers"in e,get:e=>e.selectedMarkers},metadata:t},null,a),i(this,null,_e,{kind:"getter",name:"layers",static:!1,private:!1,access:{has:e=>"layers"in e,get:e=>e.layers},metadata:t},null,a),i(this,null,ge,{kind:"method",name:"clickRoute",static:!1,private:!1,access:{has:e=>"clickRoute"in e,get:e=>e.clickRoute},metadata:t},null,a),i(this,null,ye,{kind:"method",name:"selectCurrentPosition",static:!1,private:!1,access:{has:e=>"selectCurrentPosition"in e,get:e=>e.selectCurrentPosition},metadata:t},null,a),i(this,null,ke,{kind:"method",name:"findLocation",static:!1,private:!1,access:{has:e=>"findLocation"in e,get:e=>e.findLocation},metadata:t},null,a),i(this,null,xe,{kind:"getter",name:"routeInfo",static:!1,private:!1,access:{has:e=>"routeInfo"in e,get:e=>e.routeInfo},metadata:t},null,a),i(this,null,Se,{kind:"method",name:"updateRoute",static:!1,private:!1,access:{has:e=>"updateRoute"in e,get:e=>e.updateRoute},metadata:t},null,a),i(this,null,Te,{kind:"method",name:"updateRouteDistance",static:!1,private:!1,access:{has:e=>"updateRouteDistance"in e,get:e=>e.updateRouteDistance},metadata:t},null,a),i(this,null,Le,{kind:"method",name:"updateRoutePoints",static:!1,private:!1,access:{has:e=>"updateRoutePoints"in e,get:e=>e.updateRoutePoints},metadata:t},null,a),i(this,null,Ee,{kind:"method",name:"checkRoutes",static:!1,private:!1,access:{has:e=>"checkRoutes"in e,get:e=>e.checkRoutes},metadata:t},null,a),i(this,null,Ie,{kind:"method",name:"setGpsTrackingEnabled",static:!1,private:!1,access:{has:e=>"setGpsTrackingEnabled"in e,get:e=>e.setGpsTrackingEnabled},metadata:t},null,a),i(this,null,we,{kind:"getter",name:"gpsEnabled",static:!1,private:!1,access:{has:e=>"gpsEnabled"in e,get:e=>e.gpsEnabled},metadata:t},null,a),i(null,null,n,{kind:"field",name:"routeLines",static:!1,private:!1,access:{has:e=>"routeLines"in e,get:e=>e.routeLines,set:(e,s)=>{e.routeLines=s}},metadata:t},l,f),i(null,null,h,{kind:"field",name:"routeDistance",static:!1,private:!1,access:{has:e=>"routeDistance"in e,get:e=>e.routeDistance,set:(e,s)=>{e.routeDistance=s}},metadata:t},v,R),i(null,null,L,{kind:"field",name:"currentPosition",static:!1,private:!1,access:{has:e=>"currentPosition"in e,get:e=>e.currentPosition,set:(e,s)=>{e.currentPosition=s}},metadata:t},E,z),i(null,null,P,{kind:"field",name:"requestCompass",static:!1,private:!1,access:{has:e=>"requestCompass"in e,get:e=>e.requestCompass,set:(e,s)=>{e.requestCompass=s}},metadata:t},D,I),i(null,null,w,{kind:"field",name:"iconType",static:!1,private:!1,access:{has:e=>"iconType"in e,get:e=>e.iconType,set:(e,s)=>{e.iconType=s}},metadata:t},A,M),i(null,null,B,{kind:"field",name:"tempToBooth",static:!1,private:!1,access:{has:e=>"tempToBooth"in e,get:e=>e.tempToBooth,set:(e,s)=>{e.tempToBooth=s}},metadata:t},C,F),i(null,null,G,{kind:"field",name:"defaultFrom",static:!1,private:!1,access:{has:e=>"defaultFrom"in e,get:e=>e.defaultFrom,set:(e,s)=>{e.defaultFrom=s}},metadata:t},U,O),i(null,null,N,{kind:"field",name:"focusEnabled",static:!1,private:!1,access:{has:e=>"focusEnabled"in e,get:e=>e.focusEnabled,set:(e,s)=>{e.focusEnabled=s}},metadata:t},Z,q),i(null,null,$,{kind:"field",name:"prevZ",static:!1,private:!1,access:{has:e=>"prevZ"in e,get:e=>e.prevZ,set:(e,s)=>{e.prevZ=s}},metadata:t},V,j),i(null,null,W,{kind:"field",name:"markersData",static:!1,private:!1,access:{has:e=>"markersData"in e,get:e=>e.markersData,set:(e,s)=>{e.markersData=s}},metadata:t},K,X),i(null,null,Y,{kind:"field",name:"prevMarkers",static:!1,private:!1,access:{has:e=>"prevMarkers"in e,get:e=>e.prevMarkers,set:(e,s)=>{e.prevMarkers=s}},metadata:t},H,J),i(null,null,Q,{kind:"field",name:"showAccessible",static:!1,private:!1,access:{has:e=>"showAccessible"in e,get:e=>e.showAccessible,set:(e,s)=>{e.showAccessible=s}},metadata:t},ee,te),i(null,null,se,{kind:"field",name:"onlyAccessible",static:!1,private:!1,access:{has:e=>"onlyAccessible"in e,get:e=>e.onlyAccessible,set:(e,s)=>{e.onlyAccessible=s}},metadata:t},ae,ie),i(null,null,re,{kind:"field",name:"currentRouteLayer",static:!1,private:!1,access:{has:e=>"currentRouteLayer"in e,get:e=>e.currentRouteLayer,set:(e,s)=>{e.currentRouteLayer=s}},metadata:t},ne,oe),i(null,null,be,{kind:"field",name:"routeUnits",static:!1,private:!1,access:{has:e=>"routeUnits"in e,get:e=>e.routeUnits,set:(e,s)=>{e.routeUnits=s}},metadata:t},ve,Re),i(null,null,ze,{kind:"field",name:"isGpsTrackingEnabled",static:!1,private:!1,access:{has:e=>"isGpsTrackingEnabled"in e,get:e=>e.isGpsTrackingEnabled,set:(e,s)=>{e.isGpsTrackingEnabled=s}},metadata:t},Pe,De),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}rootStore=r(this,a);cpTimeout;routeLines=r(this,l,[]);routeDistance=(r(this,f),r(this,v,null));currentPosition=(r(this,R),r(this,E,null));requestCompass=(r(this,z),r(this,D,!1));iconType=(r(this,I),r(this,A,0));tempToBooth=(r(this,M),r(this,C,null));defaultFrom=(r(this,F),r(this,U,null));focusEnabled=(r(this,O),r(this,Z,!0));prevZ=(r(this,q),r(this,V,null));markersData=(r(this,j),r(this,K,{icons:[],markers:[]}));prevMarkers=(r(this,X),r(this,H,[]));showAccessible=(r(this,J),r(this,ee,!!Ge.getLines().find(t=>t.unaccessible)));onlyAccessible=(r(this,te),r(this,ae,!1));currentRouteLayer=(r(this,ie),r(this,ne,null));constructor(t){r(this,De),this.rootStore=t,this.focusEnabled=!window.location.search}get canFindLocation(){return!!this.defaultFrom||!!this.currentPosition}selectRoute(t,e=!0){e&&(p.list={type:"search",text:"",focused:!1}),!t?.from&&t?.to&&this.currentPosition&&(t.from=this.nearestBooth),t?.from&&t?.to&&t.from===t.to&&(t=null);let s=[];t?.from&&t?.to&&window.setTimeout(()=>{this.rootStore.showMap()},navigator.userAgent.toLowerCase().indexOf("android")>-1?400:50),t?.from?.visible&&s.push(t.from),t?.to?.visible&&(this.tempToBooth=null,s.push(t.to)),!t&&o.fp.onDirection&&o.fp.onDirection(null),setTimeout(()=>{this.rootStore.moveToList(s),p.details=t,t&&(!t.from||!t.to)&&o.showOverlay(),t?.to&&t?.from?.layer&&this.rootStore.layerStore.updateVisibility(t.from.layer,!0),!this.currentRouteLayer&&t?.from?.layer&&(this.currentRouteLayer=t?.from?.layer),e&&t?.from&&t?.to&&Xe(Ke.ClickDirections,`${t?.from?"From "+t.from.name:""} ${t?.to?"To "+t.to.name:""}`)},200)}setStartPoint(t){const e=p.selectedRoute;if(e?.to&&!e?.from&&t){const s=new Route(t,e.to,e.waypoints);this.selectRoute(s)}}get pathLayers(){return o.routeStore.routeLines?.map(t=>t.p0.layer)?.filter((t,e,s)=>s.indexOf(t)===e).reverse().map((t,e)=>({id:e+1,layer:o.layerStore.findLayer(t)}))}get nearestBooth(){return this.getNearestBooth(this.currentPosition)}getNearestBooth(t){if(!t)return null;let e=this.rootStore.layerStore.findLayer(t.z);const s=t.lat&&t.lng?Be(t,T.properties.config):t;return this.rootStore.boothStore.booths.filter(c=>x.mode===et.Default||!e?c.visible&&c.rect:c.rect&&(typeof t.z!="number"&&!t.z&&c.visible||e.name===c.layer?.name)).sort((c,u)=>Me(s,{x:c.rect.cx,y:c.rect.cy})-Me(s,{x:u.rect.cx,y:u.rect.cy}))[0]||null}setMarkers(t){this.markersData.markers=(t?.markers??[]).map(ot),this.markersData.icons=t?.icons??[]}selectMarker(t,e){const s=this.markersData.markers.find(u=>u.id===t);this.markersData.markers.forEach(u=>u.active=!1),s&&(s.active=!0);let c=o.layerStore.findLayer(s?.z);if(e&&s){const u=o.rendererService.renderer;return c&&!c?.visible&&x.updateVisibility(c,!0),u?u.controls.panTo(s.x,s.y):(qe.warn("Renderer is not initialized. Cannot pan to marker."),Promise.resolve())}return Promise.resolve()}get selectedMarkers(){return this.markersData.markers.filter(t=>t.active)}get layers(){var t=[];return o.routeStore.routeLines?.map(e=>e.p0.layer).reverse().forEach(e=>{t.indexOf(e)===-1&&t.push(e)}),t.map(e=>o.layerStore.layers.find(s=>s.name===e))}clickRoute(t,e){window.__resett&&window.__resett(),this.rootStore.uiState.menu=null,p.list.type==="route-planner"&&(p.list={type:"search",text:"",focused:!1}),this.selectRoute(new Route(this.defaultFrom||t,e))}selectCurrentPosition(t,e=!0,s){clearTimeout(this.cpTimeout),t&&(t.x=g(t.x),t.y=g(t.y),t.lat=g(t.lat),t.lng=g(t.lng),st()||(t.z=null)),e=!(e&&this.rootStore.uiState.details&&!(this.rootStore.uiState.details instanceof Route))&&(this.focusEnabled||this.prevZ!=t?.z),this.focusEnabled&&(this.focusEnabled=!1),this.prevZ=t?.z?.toString(),this.iconType=s?1:0;const u=t?lt(t):null;if(!u){this.currentPosition=null;return}const _=o.layerStore.findLayer(t.z),b=new CurrentPosition(u.x,u.y,_?.name||this.currentRouteLayer?.name,Ye(u),t.lat,t.lng),S=p.selectedRoute;let Ae=!this.routeLines?.length;if(_&&this.routeLines?.length&&(Ae=!!this.routeLines.find(y=>y.p0.layer===_.name||y.p1.layer===_.name)),e&&Ae){const y=o.rendererService.renderer;if(_&&!_?.visible&&x.updateVisibility(_,!0),!y){qe.warn("Renderer is not initialized. Cannot pan to current position.");return}y.controls.panTo(b.x,b.y)}const $e=!(rt.EXPO==="cloudnext26")&&ct(b,this.routeLines)&&!!it(b,je.booths,[S?.to]);if(S&&$e){const y=o.routeStore.getNearestBooth(b);o.routeStore.selectRoute(new Route(y,S?.to),!1)}this.currentPosition=b,this.gpsEnabled||(this.cpTimeout=setTimeout(()=>{this.currentPosition&&this.selectCurrentPosition(null,!1)},30*1e3))}findLocation(){if(this.canFindLocation){if(o.mapboxStore.showMapbox){p.moveToLocation=!0;return}if(o.routeStore.currentPosition){const t=o.routeStore.currentPosition,e=We.fromCxcywh(t.x,t.y,100,100);if(!e.intersects(Je))return;localStorage.getItem(tt)==="false"&&(o.routeStore.requestCompass=!0),p.moveToRect=e;const c=o.layerStore.findLayer(o.routeStore.currentPosition?.z);c&&x.updateVisibility(c,!0)}else o.selectBooth(o.routeStore.defaultFrom)}}routeUnits=(r(this,oe),r(this,ve,Ne));get routeInfo(){const t=this.routeDistance,e=this.routeUnits;return t?{distance:`${t}${e}`,units:e,time:Oe(t,Ue(e))}:null}updateRoute(t,e){!t?.length&&!this.routeLines.length||(this.routeLines=t,this.updateRoutePoints())}updateRouteDistance(t){if(t==null)return;const e=He(),s=(e.getAttribute("units")||Ne).toLowerCase?.().trim(),c=e.getAttribute("fp-ver")?.startsWith("5")??!1;this.routeDistance=Math.round(t/(c?1:10)),this.routeUnits=s,this.updateRoutePoints()}updateRoutePoints(){const t=p.selectedRoute,e=this.routeDistance,s=this.routeUnits;o.fp.onDirection&&setTimeout(()=>{o.fp.onDirection({from:t?.from?{id:t.from.id,name:t.from.name,externalId:t.from.externalId,layer:{name:t.from?.layer?.name,description:t.from?.layer?.description}}:null,to:t?.to?{id:t.to.id,name:t.to.name,externalId:t.to.externalId,layer:{name:t.to.layer?.name,description:t.to.layer?.description}}:null,lines:this.routeLines,distance:`${e}${s}`,units:s,time:Oe(e,Ue(s))})},200)}checkRoutes(){let t=o.boothStore.booths;console.info(`Route check started ${t.length}.... `);for(let e=0;e<t.length;e++){const s=t[e];for(let c=e+1;c<t.length;c++){const u=t[c];Qe(Ge,Fe(s),Fe(u)).length||console.warn(`No route found from ${s.name} to ${u.name}`)}}console.info("Route check done....")}isGpsTrackingEnabled=(r(this,Re),r(this,Pe,!0));setGpsTrackingEnabled(t){this.isGpsTrackingEnabled=t}get gpsEnabled(){return Ze.autoTrackingGps&&this.isGpsTrackingEnabled&&!Ze.enableIPS}}})();export default nt;function ot(a){return{...a,x:g(a.x),y:g(a.y),lat:g(a.lat),lng:g(a.lng)}}function lt(a){let n=null,l=null;return T&&(n=T.properties.config),n&&a.x>=n.p0.x&&a.x<=n.p2.x&&a.y>=n.p0.y&&a.y<=n.p2.y?l={...a}:n&&Ce(a.lat)&&Ce(a.lng)?l=Be(a,n):n||(l=a),l||null}export function findBooth(a){return o.boothStore.findBooth(a)||o.exhibitorStore.findExhibitor(a)?.booths[0]}export function findEntityByExternalId(a){const n=o.boothStore.boothByExternalId.get(a);if(n)return{type:"booth",entity:n};const l=o.exhibitorStore.exhibitorByExternalId.get(a);if(l)return{type:"exhibitor",entity:l}}export function separateExternalIds(a){const n=[],l=[];for(const f of a){const h=findEntityByExternalId(f);h&&(h.type==="booth"?n.push(f):l.push(f))}return{boothExternalIds:n,exhibitorExternalIds:l}}export function extractRoute(a,n,l){return new Route(findBooth(a)??o.routeStore.defaultFrom??null,findBooth(n),l?.map(f=>findBooth(f)))}export class Route{from;to;waypoints;constructor(n,l,f){this.from=n,this.to=l,this.waypoints=f,this.waypoints=f?.filter(h=>h&&h.id!==n?.id&&h.id!==l?.id)}}export class CurrentPosition extends Ve{x;y;z;angle;lat;lng;constructor(n,l,f,h,v,R){super(n,l),this.x=n,this.y=l,this.z=f,this.angle=h,this.lat=v,this.lng=R}}function ct(a,n,l=10){if(!a||!n?.length)return!1;const f={layer:a.z?String(a.z):void 0,x:a.x,y:a.y},h=at(f,n);return isFinite(h)&&h>l}
1
+ import{__esDecorate as i,__runInitializers as r}from"tslib";import{action as m,computed as k,observable as d}from"mobx";import{Point as je,lineLength as Be}from"simple-geometry";import o,{boothStore as We,layersStore as x}from".";import{fpGeo as T}from"../data/fpGeo";import Ke from"../core/Rect";import{GaEventActions as Xe,sendEventToGa as Ye}from"../tools/gtag";import{convertGpsToLocal as Ce,isValidPointCoords as Fe,calculateRelativeBearing as He}from"../utils/gps";import{getLayerSvg as Je,svgArea as Qe}from"../data/svg";import{getGraphLines as et,boothToWaypoint as Ge,graphDataSource as Oe}from"../wayfinding";import{LayersMode as tt}from"./LayerStore";import{uiState as p}from"./index";import{calcSpeed as Ue}from"../utils/calcSpeed";import{calcTravelTime as Ne}from"../utils/calcTravelTime";import{DEFAULT_UNITS as Ze,ORIENTATION_GRANTED_KEY as st}from"../constants";import{areLayersEnabled as at}from"../utils/areLayersEnabled";import{distancePointToRouteOnLayer as it,findBoothInRadius as rt}from"../components/Map/drawing/config/route-snapping";import qe from"../data";import $e from"../tools/logger";import nt from"../tools/settings";const y=a=>typeof a=="string"?Number(a.replace(",",".")):a;let ot=(()=>{let a=[],n,l=[],f=[],h,v=[],R=[],L,E=[],z=[],P,D=[],I=[],A,w=[],M=[],B,C=[],F=[],G,O=[],U=[],N,Z=[],q=[],$,V=[],j=[],W,K=[],X=[],Y,H=[],J=[],Q,ee=[],te=[],se,ae=[],ie=[],re,ne=[],oe=[],le,ce,ue,de,fe,he,me,pe,_e,ye,ge,ke,be,ve=[],Re=[],xe,Se,Te,Le,Ee,ze,Pe=[],De=[],Ie,Ae,we;return class{static{const t=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;n=[d],h=[d],L=[d],P=[d],A=[d],B=[d],G=[d],N=[d],$=[d],W=[d],Y=[d],Q=[d],se=[d],re=[d],le=[k],ce=[m],ue=[m],de=[k({keepAlive:!0})],fe=[k({keepAlive:!0})],he=[m],me=[m],pe=[k({keepAlive:!0})],_e=[k({keepAlive:!0})],ye=[m],ge=[m],ke=[m],be=[d],xe=[k],Se=[m],Te=[m],Le=[m],Ee=[m],ze=[d],Ie=[m],Ae=[k({keepAlive:!0})],we=[m],i(this,null,le,{kind:"getter",name:"canFindLocation",static:!1,private:!1,access:{has:e=>"canFindLocation"in e,get:e=>e.canFindLocation},metadata:t},null,a),i(this,null,ce,{kind:"method",name:"selectRoute",static:!1,private:!1,access:{has:e=>"selectRoute"in e,get:e=>e.selectRoute},metadata:t},null,a),i(this,null,ue,{kind:"method",name:"setStartPoint",static:!1,private:!1,access:{has:e=>"setStartPoint"in e,get:e=>e.setStartPoint},metadata:t},null,a),i(this,null,de,{kind:"getter",name:"pathLayers",static:!1,private:!1,access:{has:e=>"pathLayers"in e,get:e=>e.pathLayers},metadata:t},null,a),i(this,null,fe,{kind:"getter",name:"nearestBooth",static:!1,private:!1,access:{has:e=>"nearestBooth"in e,get:e=>e.nearestBooth},metadata:t},null,a),i(this,null,he,{kind:"method",name:"setMarkers",static:!1,private:!1,access:{has:e=>"setMarkers"in e,get:e=>e.setMarkers},metadata:t},null,a),i(this,null,me,{kind:"method",name:"selectMarker",static:!1,private:!1,access:{has:e=>"selectMarker"in e,get:e=>e.selectMarker},metadata:t},null,a),i(this,null,pe,{kind:"getter",name:"selectedMarkers",static:!1,private:!1,access:{has:e=>"selectedMarkers"in e,get:e=>e.selectedMarkers},metadata:t},null,a),i(this,null,_e,{kind:"getter",name:"layers",static:!1,private:!1,access:{has:e=>"layers"in e,get:e=>e.layers},metadata:t},null,a),i(this,null,ye,{kind:"method",name:"clickRoute",static:!1,private:!1,access:{has:e=>"clickRoute"in e,get:e=>e.clickRoute},metadata:t},null,a),i(this,null,ge,{kind:"method",name:"selectCurrentPosition",static:!1,private:!1,access:{has:e=>"selectCurrentPosition"in e,get:e=>e.selectCurrentPosition},metadata:t},null,a),i(this,null,ke,{kind:"method",name:"findLocation",static:!1,private:!1,access:{has:e=>"findLocation"in e,get:e=>e.findLocation},metadata:t},null,a),i(this,null,xe,{kind:"getter",name:"routeInfo",static:!1,private:!1,access:{has:e=>"routeInfo"in e,get:e=>e.routeInfo},metadata:t},null,a),i(this,null,Se,{kind:"method",name:"updateRoute",static:!1,private:!1,access:{has:e=>"updateRoute"in e,get:e=>e.updateRoute},metadata:t},null,a),i(this,null,Te,{kind:"method",name:"updateRouteDistance",static:!1,private:!1,access:{has:e=>"updateRouteDistance"in e,get:e=>e.updateRouteDistance},metadata:t},null,a),i(this,null,Le,{kind:"method",name:"updateRoutePoints",static:!1,private:!1,access:{has:e=>"updateRoutePoints"in e,get:e=>e.updateRoutePoints},metadata:t},null,a),i(this,null,Ee,{kind:"method",name:"checkRoutes",static:!1,private:!1,access:{has:e=>"checkRoutes"in e,get:e=>e.checkRoutes},metadata:t},null,a),i(this,null,Ie,{kind:"method",name:"setGpsTrackingEnabled",static:!1,private:!1,access:{has:e=>"setGpsTrackingEnabled"in e,get:e=>e.setGpsTrackingEnabled},metadata:t},null,a),i(this,null,Ae,{kind:"getter",name:"gpsEnabled",static:!1,private:!1,access:{has:e=>"gpsEnabled"in e,get:e=>e.gpsEnabled},metadata:t},null,a),i(this,null,we,{kind:"method",name:"setOnlyAccessible",static:!1,private:!1,access:{has:e=>"setOnlyAccessible"in e,get:e=>e.setOnlyAccessible},metadata:t},null,a),i(null,null,n,{kind:"field",name:"routeLines",static:!1,private:!1,access:{has:e=>"routeLines"in e,get:e=>e.routeLines,set:(e,s)=>{e.routeLines=s}},metadata:t},l,f),i(null,null,h,{kind:"field",name:"routeDistance",static:!1,private:!1,access:{has:e=>"routeDistance"in e,get:e=>e.routeDistance,set:(e,s)=>{e.routeDistance=s}},metadata:t},v,R),i(null,null,L,{kind:"field",name:"currentPosition",static:!1,private:!1,access:{has:e=>"currentPosition"in e,get:e=>e.currentPosition,set:(e,s)=>{e.currentPosition=s}},metadata:t},E,z),i(null,null,P,{kind:"field",name:"requestCompass",static:!1,private:!1,access:{has:e=>"requestCompass"in e,get:e=>e.requestCompass,set:(e,s)=>{e.requestCompass=s}},metadata:t},D,I),i(null,null,A,{kind:"field",name:"iconType",static:!1,private:!1,access:{has:e=>"iconType"in e,get:e=>e.iconType,set:(e,s)=>{e.iconType=s}},metadata:t},w,M),i(null,null,B,{kind:"field",name:"tempToBooth",static:!1,private:!1,access:{has:e=>"tempToBooth"in e,get:e=>e.tempToBooth,set:(e,s)=>{e.tempToBooth=s}},metadata:t},C,F),i(null,null,G,{kind:"field",name:"defaultFrom",static:!1,private:!1,access:{has:e=>"defaultFrom"in e,get:e=>e.defaultFrom,set:(e,s)=>{e.defaultFrom=s}},metadata:t},O,U),i(null,null,N,{kind:"field",name:"focusEnabled",static:!1,private:!1,access:{has:e=>"focusEnabled"in e,get:e=>e.focusEnabled,set:(e,s)=>{e.focusEnabled=s}},metadata:t},Z,q),i(null,null,$,{kind:"field",name:"prevZ",static:!1,private:!1,access:{has:e=>"prevZ"in e,get:e=>e.prevZ,set:(e,s)=>{e.prevZ=s}},metadata:t},V,j),i(null,null,W,{kind:"field",name:"markersData",static:!1,private:!1,access:{has:e=>"markersData"in e,get:e=>e.markersData,set:(e,s)=>{e.markersData=s}},metadata:t},K,X),i(null,null,Y,{kind:"field",name:"prevMarkers",static:!1,private:!1,access:{has:e=>"prevMarkers"in e,get:e=>e.prevMarkers,set:(e,s)=>{e.prevMarkers=s}},metadata:t},H,J),i(null,null,Q,{kind:"field",name:"showAccessible",static:!1,private:!1,access:{has:e=>"showAccessible"in e,get:e=>e.showAccessible,set:(e,s)=>{e.showAccessible=s}},metadata:t},ee,te),i(null,null,se,{kind:"field",name:"onlyAccessible",static:!1,private:!1,access:{has:e=>"onlyAccessible"in e,get:e=>e.onlyAccessible,set:(e,s)=>{e.onlyAccessible=s}},metadata:t},ae,ie),i(null,null,re,{kind:"field",name:"currentRouteLayer",static:!1,private:!1,access:{has:e=>"currentRouteLayer"in e,get:e=>e.currentRouteLayer,set:(e,s)=>{e.currentRouteLayer=s}},metadata:t},ne,oe),i(null,null,be,{kind:"field",name:"routeUnits",static:!1,private:!1,access:{has:e=>"routeUnits"in e,get:e=>e.routeUnits,set:(e,s)=>{e.routeUnits=s}},metadata:t},ve,Re),i(null,null,ze,{kind:"field",name:"isGpsTrackingEnabled",static:!1,private:!1,access:{has:e=>"isGpsTrackingEnabled"in e,get:e=>e.isGpsTrackingEnabled,set:(e,s)=>{e.isGpsTrackingEnabled=s}},metadata:t},Pe,De),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}rootStore=r(this,a);cpTimeout;routeLines=r(this,l,[]);routeDistance=(r(this,f),r(this,v,null));currentPosition=(r(this,R),r(this,E,null));requestCompass=(r(this,z),r(this,D,!1));iconType=(r(this,I),r(this,w,0));tempToBooth=(r(this,M),r(this,C,null));defaultFrom=(r(this,F),r(this,O,null));focusEnabled=(r(this,U),r(this,Z,!0));prevZ=(r(this,q),r(this,V,null));markersData=(r(this,j),r(this,K,{icons:[],markers:[]}));prevMarkers=(r(this,X),r(this,H,[]));showAccessible=(r(this,J),r(this,ee,!!Oe.getLines().find(t=>t.unaccessible)));onlyAccessible=(r(this,te),r(this,ae,!1));currentRouteLayer=(r(this,ie),r(this,ne,null));constructor(t){r(this,De),this.rootStore=t,this.focusEnabled=!window.location.search}get canFindLocation(){return!!this.defaultFrom||!!this.currentPosition}selectRoute(t,e=!0){e&&(p.list={type:"search",text:"",focused:!1}),!t?.from&&t?.to&&this.currentPosition&&(t.from=this.nearestBooth),t?.from&&t?.to&&t.from===t.to&&(t=null);let s=[];t?.from&&t?.to&&window.setTimeout(()=>{this.rootStore.showMap()},navigator.userAgent.toLowerCase().indexOf("android")>-1?400:50),t?.from?.visible&&s.push(t.from),t?.to?.visible&&(this.tempToBooth=null,s.push(t.to)),!t&&o.fp.onDirection&&o.fp.onDirection(null),setTimeout(()=>{this.rootStore.moveToList(s),p.details=t,t&&(!t.from||!t.to)&&o.showOverlay(),t?.to&&t?.from?.layer&&this.rootStore.layerStore.updateVisibility(t.from.layer,!0),!this.currentRouteLayer&&t?.from?.layer&&(this.currentRouteLayer=t?.from?.layer),e&&t?.from&&t?.to&&Ye(Xe.ClickDirections,`${t?.from?"From "+t.from.name:""} ${t?.to?"To "+t.to.name:""}`)},200)}setStartPoint(t){const e=p.selectedRoute;if(e?.to&&!e?.from&&t){const s=new Route(t,e.to,e.waypoints);this.selectRoute(s)}}get pathLayers(){return o.routeStore.routeLines?.map(t=>t.p0.layer)?.filter((t,e,s)=>s.indexOf(t)===e).reverse().map((t,e)=>({id:e+1,layer:o.layerStore.findLayer(t)}))}get nearestBooth(){return this.getNearestBooth(this.currentPosition)}getNearestBooth(t){if(!t)return null;let e=this.rootStore.layerStore.findLayer(t.z);const s=t.lat&&t.lng?Ce(t,T.properties.config):t;return this.rootStore.boothStore.booths.filter(c=>x.mode===tt.Default||!e?c.visible&&c.rect:c.rect&&(typeof t.z!="number"&&!t.z&&c.visible||e.name===c.layer?.name)).sort((c,u)=>Be(s,{x:c.rect.cx,y:c.rect.cy})-Be(s,{x:u.rect.cx,y:u.rect.cy}))[0]||null}setMarkers(t){this.markersData.markers=(t?.markers??[]).map(lt),this.markersData.icons=t?.icons??[]}selectMarker(t,e){const s=this.markersData.markers.find(u=>u.id===t);this.markersData.markers.forEach(u=>u.active=!1),s&&(s.active=!0);let c=o.layerStore.findLayer(s?.z);if(e&&s){const u=o.rendererService.renderer;return c&&!c?.visible&&x.updateVisibility(c,!0),u?u.controls.panTo(s.x,s.y):($e.warn("Renderer is not initialized. Cannot pan to marker."),Promise.resolve())}return Promise.resolve()}get selectedMarkers(){return this.markersData.markers.filter(t=>t.active)}get layers(){var t=[];return o.routeStore.routeLines?.map(e=>e.p0.layer).reverse().forEach(e=>{t.indexOf(e)===-1&&t.push(e)}),t.map(e=>o.layerStore.layers.find(s=>s.name===e))}clickRoute(t,e){window.__resett&&window.__resett(),this.rootStore.uiState.menu=null,p.list.type==="route-planner"&&(p.list={type:"search",text:"",focused:!1}),this.selectRoute(new Route(this.defaultFrom||t,e))}selectCurrentPosition(t,e=!0,s){clearTimeout(this.cpTimeout),t&&(t.x=y(t.x),t.y=y(t.y),t.lat=y(t.lat),t.lng=y(t.lng),at()||(t.z=null)),e=!(e&&this.rootStore.uiState.details&&!(this.rootStore.uiState.details instanceof Route))&&(this.focusEnabled||this.prevZ!=t?.z),this.focusEnabled&&(this.focusEnabled=!1),this.prevZ=t?.z?.toString(),this.iconType=s?1:0;const u=t?ct(t):null;if(!u){this.currentPosition=null;return}const _=o.layerStore.findLayer(t.z),b=new CurrentPosition(u.x,u.y,_?.name||this.currentRouteLayer?.name,He(u),t.lat,t.lng),S=p.selectedRoute;let Me=!this.routeLines?.length;if(_&&this.routeLines?.length&&(Me=!!this.routeLines.find(g=>g.p0.layer===_.name||g.p1.layer===_.name)),e&&Me){const g=o.rendererService.renderer;if(_&&!_?.visible&&x.updateVisibility(_,!0),!g){$e.warn("Renderer is not initialized. Cannot pan to current position.");return}g.controls.panTo(b.x,b.y)}const Ve=!(nt.EXPO==="cloudnext26")&&ut(b,this.routeLines)&&!!rt(b,We.booths,[S?.to]);if(S&&Ve){const g=o.routeStore.getNearestBooth(b);o.routeStore.selectRoute(new Route(g,S?.to),!1)}this.currentPosition=b,this.gpsEnabled||(this.cpTimeout=setTimeout(()=>{this.currentPosition&&this.selectCurrentPosition(null,!1)},30*1e3))}findLocation(){if(this.canFindLocation){if(o.mapboxStore.showMapbox){p.moveToLocation=!0;return}if(o.routeStore.currentPosition){const t=o.routeStore.currentPosition,e=Ke.fromCxcywh(t.x,t.y,100,100);if(!e.intersects(Qe))return;localStorage.getItem(st)==="false"&&(o.routeStore.requestCompass=!0),p.moveToRect=e;const c=o.layerStore.findLayer(o.routeStore.currentPosition?.z);c&&x.updateVisibility(c,!0)}else o.selectBooth(o.routeStore.defaultFrom)}}routeUnits=(r(this,oe),r(this,ve,Ze));get routeInfo(){const t=this.routeDistance,e=this.routeUnits;return t?{distance:`${t}${e}`,units:e,time:Ne(t,Ue(e))}:null}updateRoute(t,e){!t?.length&&!this.routeLines.length||(this.routeLines=t,this.updateRoutePoints())}updateRouteDistance(t){if(t==null)return;const e=Je(),s=(e.getAttribute("units")||Ze).toLowerCase?.().trim(),c=e.getAttribute("fp-ver")?.startsWith("5")??!1;this.routeDistance=Math.round(t/(c?1:10)),this.routeUnits=s,this.updateRoutePoints()}updateRoutePoints(){const t=p.selectedRoute,e=this.routeDistance,s=this.routeUnits;o.fp.onDirection&&setTimeout(()=>{o.fp.onDirection({from:t?.from?{id:t.from.id,name:t.from.name,externalId:t.from.externalId,layer:{name:t.from?.layer?.name,description:t.from?.layer?.description}}:null,to:t?.to?{id:t.to.id,name:t.to.name,externalId:t.to.externalId,layer:{name:t.to.layer?.name,description:t.to.layer?.description}}:null,lines:this.routeLines,distance:`${e}${s}`,units:s,time:Ne(e,Ue(s))})},200)}checkRoutes(){let t=o.boothStore.booths;console.info(`Route check started ${t.length}.... `);for(let e=0;e<t.length;e++){const s=t[e];for(let c=e+1;c<t.length;c++){const u=t[c];et(Oe,Ge(s),Ge(u)).length||console.warn(`No route found from ${s.name} to ${u.name}`)}}console.info("Route check done....")}isGpsTrackingEnabled=(r(this,Re),r(this,Pe,!0));setGpsTrackingEnabled(t){this.isGpsTrackingEnabled=t}get gpsEnabled(){return qe.autoTrackingGps&&this.isGpsTrackingEnabled&&!qe.enableIPS}setOnlyAccessible(t){this.onlyAccessible=t}}})();export default ot;function lt(a){return{...a,x:y(a.x),y:y(a.y),lat:y(a.lat),lng:y(a.lng)}}function ct(a){let n=null,l=null;return T&&(n=T.properties.config),n&&a.x>=n.p0.x&&a.x<=n.p2.x&&a.y>=n.p0.y&&a.y<=n.p2.y?l={...a}:n&&Fe(a.lat)&&Fe(a.lng)?l=Ce(a,n):n||(l=a),l||null}export function findBooth(a){return o.boothStore.findBooth(a)||o.exhibitorStore.findExhibitor(a)?.booths[0]}export function findEntityByExternalId(a){const n=o.boothStore.boothByExternalId.get(a);if(n)return{type:"booth",entity:n};const l=o.exhibitorStore.exhibitorByExternalId.get(a);if(l)return{type:"exhibitor",entity:l}}export function separateExternalIds(a){const n=[],l=[];for(const f of a){const h=findEntityByExternalId(f);h&&(h.type==="booth"?n.push(f):l.push(f))}return{boothExternalIds:n,exhibitorExternalIds:l}}export function extractRoute(a,n,l){return new Route(findBooth(a)??o.routeStore.defaultFrom??null,findBooth(n),l?.map(f=>findBooth(f)))}export class Route{from;to;waypoints;constructor(n,l,f){this.from=n,this.to=l,this.waypoints=f,this.waypoints=f?.filter(h=>h&&h.id!==n?.id&&h.id!==l?.id)}}export class CurrentPosition extends je{x;y;z;angle;lat;lng;constructor(n,l,f,h,v,R){super(n,l),this.x=n,this.y=l,this.z=f,this.angle=h,this.lat=v,this.lng=R}}function ut(a,n,l=10){if(!a||!n?.length)return!1;const f={layer:a.z?String(a.z):void 0,x:a.x,y:a.y},h=it(f,n);return isFinite(h)&&h>l}