@expofp/floorplan 3.38.0 → 3.39.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 (90) hide show
  1. package/dist/browser/{Button-ClbFcvfV.js → Button-DDJ9HcfI.js} +5 -5
  2. package/dist/browser/{CookieConsent-BtYMAMD8.js → CookieConsent-CJSQYYJ0.js} +7 -7
  3. package/dist/browser/{Debug-6rBej4wJ.js → Debug-Bt5IRvUt.js} +7 -7
  4. package/dist/browser/{DebugTools-CweHk4eX.js → DebugTools-C-4QnINH.js} +26 -26
  5. package/dist/browser/{Demo-DkbMkg4o.js → Demo-ClW-lszE.js} +9 -9
  6. package/dist/browser/{Free-Da8_iIA3.js → Free-CPuBAHN9.js} +9 -9
  7. package/dist/browser/{GalleryContainer-cYgizXxX.js → GalleryContainer-CIasK5mL.js} +10 -10
  8. package/dist/browser/{GpsLoader-dY9414p_.js → GpsLoader-DiArANLO.js} +17 -17
  9. package/dist/browser/{KioskStore-dTaEpV2u.js → KioskStore-BZ4HwD9A.js} +9 -7
  10. package/dist/browser/{MaplibreAdapter-Bin47a4P.js → MaplibreAdapter-BdbdSizH.js} +102 -102
  11. package/dist/browser/{ModalContainer-cqTsVJWK.js → ModalContainer-BuH30fJN.js} +10 -10
  12. package/dist/browser/{PermissionNotice-Czo_ZPGg.js → PermissionNotice-DMOhs0fQ.js} +6 -6
  13. package/dist/browser/{SetKioskMode-BHyRe8uR.js → SetKioskMode-BUUQxMDT.js} +12 -12
  14. package/dist/browser/{ShowKiosk-Btvjwee0.js → ShowKiosk-CGkQXtiC.js} +10 -10
  15. package/dist/browser/{ViewerMenuPanel-ChhGSeZi.js → ViewerMenuPanel-C0hwkh7I.js} +9 -9
  16. package/dist/browser/{add-debug-secret-listener-Uy98ISZg.js → add-debug-secret-listener-DibnDryN.js} +1 -1
  17. package/dist/browser/{adopt-global-settings-CSk5bLXy.js → adopt-global-settings-BscL85ma.js} +9 -9
  18. package/dist/browser/{boolean-editor-BX0E97NA.js → boolean-editor-CLJh2knL.js} +9 -9
  19. package/dist/browser/{bootIntercom-CgTbDJ3h.js → bootIntercom-C-YBp0xT.js} +2 -2
  20. package/dist/browser/bundle.json +71 -71
  21. package/dist/browser/{camera-events-Djsde0Ux.js → camera-events-CQZgwih3.js} +1 -1
  22. package/dist/browser/{classnames-B52rwbt4.js → classnames-4Iik8FC_.js} +2 -2
  23. package/dist/browser/{client-CTsWysuI.js → client-BtPJvi_3.js} +5 -5
  24. package/dist/browser/{components-CYoiaY2t.js → components-DMOhc6ZZ.js} +753 -716
  25. package/dist/browser/{debug-context-BnO2NQR9.js → debug-context-CxXzVYRx.js} +7 -7
  26. package/dist/browser/{debug-overlay-bJmbHnXN.js → debug-overlay-BJZ16esR.js} +10 -10
  27. package/dist/browser/{debug-ui-DvXUU9-P.js → debug-ui-CX2sgttZ.js} +6 -6
  28. package/dist/browser/{dimming-BrGbMBxb.js → dimming-3R7UOgr9.js} +215 -210
  29. package/dist/browser/{dist-ShElP6T0.js → dist--cp6ZHYH.js} +5 -5
  30. package/dist/browser/{dist-DZ2Exk9m.js → dist-DeeoO3mx.js} +6 -6
  31. package/dist/browser/{dist-CnbCTNO3.js → dist-DoBzJWpA.js} +3 -3
  32. package/dist/browser/{efp-debug-init-BR__9zmi.js → efp-debug-init-DfQX41Dz.js} +3 -3
  33. package/dist/browser/{enum-editor-D1frUcEv.js → enum-editor-BByQoeky.js} +4 -4
  34. package/dist/browser/{es5-COBqz2Zh.js → es5-CP2UUc_5.js} +2 -2
  35. package/dist/browser/{event-head-BUJJHBIq.js → event-head-BXpNerID.js} +1 -1
  36. package/dist/browser/{event-not-found-K1N4NbnT.js → event-not-found-Bx82hQuX.js} +3 -3
  37. package/dist/browser/{exports-DN6wF8DS.js → exports-gWa75nmY.js} +1 -1
  38. package/dist/browser/{favicon-D6QoTQSP.js → favicon-DNdj7aFi.js} +1 -1
  39. package/dist/browser/{fetch-retry.umd-HVXbN6qF.js → fetch-retry.umd-Df7tkVK1.js} +2 -2
  40. package/dist/browser/{flex-BP_sJeus.js → flex-uig6hZkZ.js} +5 -5
  41. package/dist/browser/{floorplan.loader-Dzvb4FTD.js → floorplan.loader-DNLxyDic.js} +10 -10
  42. package/dist/browser/{floorplan.ready-DLq2zteX.js → floorplan.ready-C_lm766s.js} +16 -16
  43. package/dist/browser/{fuse-B-w8rUFE.js → fuse-Didw830W.js} +2 -2
  44. package/dist/browser/{i18n-C6fFyMGD.js → i18n-BVE2kS7w.js} +5 -5
  45. package/dist/browser/index.js +16 -16
  46. package/dist/browser/{index.module-m51AK8p4.js → index.module-CVo9wrU4.js} +4 -4
  47. package/dist/browser/{integrateKiosk-6cmnHeoj.js → integrateKiosk-bnGUsf7Q.js} +4 -4
  48. package/dist/browser/{is-own-domain-wvyQvGlL.js → is-own-domain-B64uVROp.js} +1 -1
  49. package/dist/browser/{is-webview-oqXVE6bv.js → is-webview-BoQ3VPRe.js} +1 -1
  50. package/dist/browser/{jsx-runtime-CtJ_t8Mi.js → jsx-runtime-BGutO_I9.js} +2 -2
  51. package/dist/browser/{kiosk-record-Di9isPMQ.js → kiosk-record-Bcyr4YeZ.js} +1 -1
  52. package/dist/browser/{lib-DmKWthvt.js → lib-CW4ROgrI.js} +3 -3
  53. package/dist/browser/{loadImage-DUelfWA7.js → loadImage-B-6VhOfG.js} +4 -4
  54. package/dist/browser/{logDeviceInfo-BuhtLa4A.js → logDeviceInfo-DLgu-6-l.js} +9 -9
  55. package/dist/browser/{mobx-UGMGcjzY.js → mobx-B9XSgx3-.js} +4 -4
  56. package/dist/browser/{optional-boolean-editor-C1Ndbp_u.js → optional-boolean-editor-ESbhCoDb.js} +3 -3
  57. package/dist/browser/{optional-enum-editor-DYAfwsr2.js → optional-enum-editor-_RF_OVcS.js} +4 -4
  58. package/dist/browser/{optional-string-editor-ClMoGgGt.js → optional-string-editor-C6h-x0BL.js} +4 -4
  59. package/dist/browser/{particles.min-BffTQ57s.js → particles.min-Dccc8fgr.js} +2 -2
  60. package/dist/browser/{react-C-Qd2U47.js → react-CM7l092i.js} +2 -2
  61. package/dist/browser/{react-dom-CnXY0ene.js → react-dom-DV2t60Bu.js} +3 -3
  62. package/dist/browser/{rolldown-runtime-CjjOYn6R.js → rolldown-runtime-BOCG9HEF.js} +1 -1
  63. package/dist/browser/{scheduler-Qu0FRRuK.js → scheduler-CYuaS4GW.js} +2 -2
  64. package/dist/browser/{select-DBf5drek.js → select-Ck7Yfj4n.js} +10 -10
  65. package/dist/browser/{settings-CK9N4RDZ.js → settings-BEwEIUKe.js} +2 -2
  66. package/dist/browser/{settings-item-C1kuqAX7.js → settings-item-BMVccHn4.js} +6 -6
  67. package/dist/browser/{store-DcCWvP6P.js → store-CARxK2Ft.js} +5874 -5632
  68. package/dist/browser/{string-editor-CZm4w5-_.js → string-editor-DvchTir6.js} +4 -4
  69. package/dist/browser/{text-field-BjwNyut3.js → text-field-B93LMty4.js} +5 -5
  70. package/dist/browser/{theme-Cq3CRc3v.js → theme-FqSzizhT.js} +8 -8
  71. package/dist/browser/{ui-COIkgfZE.js → ui-1b_AyBgX.js} +8 -8
  72. package/dist/browser/{useRenderTarget-Dr7hirkU.js → useRenderTarget-Z7iVu1Bc.js} +4 -4
  73. package/dist/browser/{viewport-3wsqmW9Q.js → viewport-CN0fRYhD.js} +2 -2
  74. package/dist/esm/components/Kiosk/KioskStore.js +1 -1
  75. package/dist/esm/components/Map/drawing/config/config-all.js +1 -1
  76. package/dist/esm/components/Map/drawing/config/config-booth-labels-special.js +2 -2
  77. package/dist/esm/components/Map/drawing/config/config-booth-labels.js +1 -1
  78. package/dist/esm/components/Map/drawing/config/config-booths.d.ts +1 -1
  79. package/dist/esm/components/Map/drawing/config/config-booths.js +1 -1
  80. package/dist/esm/components/Map/drawing/config/config-markers.d.ts +2 -2
  81. package/dist/esm/components/Map/drawing/config/config-markers.js +1 -1
  82. package/dist/esm/components/Wayfinding.js +1 -1
  83. package/dist/esm/engine/canvases.d.ts +1 -1
  84. package/dist/esm/engine/canvases.js +1 -1
  85. package/dist/esm/engine/defs.d.ts +7 -3
  86. package/dist/esm/engine/update-def.js +1 -1
  87. package/dist/esm/types.d.ts +1 -1
  88. package/dist/esm/wayfinding/createWayfinding.js +1 -1
  89. package/dist/esm/wayfinding/handlers/kioskHandler.js +1 -1
  90. package/package.json +11 -11
@@ -1,14 +1,14 @@
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.38.0" };
4
+ e.SENTRY_RELEASE = { id: "3.39.1" };
5
5
  var t = new e.Error().stack;
6
6
  t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "8f241b7f-d106-4e96-a6a2-b96a0f9abf69", e._sentryDebugIdIdentifier = "sentry-dbid-8f241b7f-d106-4e96-a6a2-b96a0f9abf69");
7
7
  } catch {}
8
8
  })();
9
- import { t as e } from "./jsx-runtime-CtJ_t8Mi.js";
10
- import { t } from "./settings-item-C1kuqAX7.js";
11
- import { t as n } from "./text-field-BjwNyut3.js";
9
+ import { t as e } from "./jsx-runtime-BGutO_I9.js";
10
+ import { t } from "./settings-item-BMVccHn4.js";
11
+ import { t as n } from "./text-field-B93LMty4.js";
12
12
  //#region ../debug/src/lib/ui/string-editor.tsx
13
13
  var r = e(), i = (e) => {
14
14
  var i;
@@ -1,15 +1,15 @@
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.38.0" };
4
+ e.SENTRY_RELEASE = { id: "3.39.1" };
5
5
  var t = new e.Error().stack;
6
6
  t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "e13f8c4e-8995-47cd-802d-392fd9bdf13a", e._sentryDebugIdIdentifier = "sentry-dbid-e13f8c4e-8995-47cd-802d-392fd9bdf13a");
7
7
  } catch {}
8
8
  })();
9
- import { r as e } from "./rolldown-runtime-CjjOYn6R.js";
10
- import { t } from "./react-C-Qd2U47.js";
11
- import { D as n, i as r, l as i, n as a, s as o, u as s, y as c } from "./flex-BP_sJeus.js";
12
- import { t as l } from "./classnames-B52rwbt4.js";
9
+ import { r as e } from "./rolldown-runtime-BOCG9HEF.js";
10
+ import { t } from "./react-CM7l092i.js";
11
+ import { D as n, i as r, l as i, n as a, s as o, u as s, y as c } from "./flex-uig6hZkZ.js";
12
+ import { t as l } from "./classnames-4Iik8FC_.js";
13
13
  //#region ../../node_modules/.pnpm/@radix-ui+themes@3.3.0_@types+react-dom@19.2.3_@types+react@19.2.17__@types+react@19.2._5ea800d4e947acedb1fa1275f1697b17/node_modules/@radix-ui/themes/dist/esm/components/text-field.props.js
14
14
  var u = /* @__PURE__ */ e(t()), d = /* @__PURE__ */ e(l()), f = {
15
15
  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.38.0" };
4
+ e.SENTRY_RELEASE = { id: "3.39.1" };
5
5
  var t = new e.Error().stack;
6
6
  t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "5b26ff7f-61de-4d09-8508-a74b71b94f98", e._sentryDebugIdIdentifier = "sentry-dbid-5b26ff7f-61de-4d09-8508-a74b71b94f98");
7
7
  } catch {}
8
8
  })();
9
- import { r as e } from "./rolldown-runtime-CjjOYn6R.js";
10
- import { t } from "./react-C-Qd2U47.js";
11
- import { t as n } from "./jsx-runtime-CtJ_t8Mi.js";
12
- import { t as r } from "./react-dom-CnXY0ene.js";
13
- import { C as i, E as a, O as o, T as s, _ as c, o as l, v as u, w as d } from "./flex-BP_sJeus.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-DZ2Exk9m.js";
15
- import { t as y } from "./classnames-B52rwbt4.js";
9
+ import { r as e } from "./rolldown-runtime-BOCG9HEF.js";
10
+ import { t } from "./react-CM7l092i.js";
11
+ import { t as n } from "./jsx-runtime-BGutO_I9.js";
12
+ import { t as r } from "./react-dom-DV2t60Bu.js";
13
+ import { C as i, E as a, O as o, T as s, _ as c, o as l, v as u, w as d } from "./flex-uig6hZkZ.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-DeeoO3mx.js";
15
+ import { t as y } from "./classnames-4Iik8FC_.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.17__@ty_cffccd7838985066e8e1d993b5cb6017/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.38.0" };
4
+ e.SENTRY_RELEASE = { id: "3.39.1" };
5
5
  var t = new e.Error().stack;
6
6
  t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "80a4f49f-d869-4a38-b1c0-c3cfd645ceec", e._sentryDebugIdIdentifier = "sentry-dbid-80a4f49f-d869-4a38-b1c0-c3cfd645ceec");
7
7
  } catch {}
8
8
  })();
9
- import { r as e } from "./rolldown-runtime-CjjOYn6R.js";
10
- import { a as t, i as n, s as r } from "./efp-debug-init-BR__9zmi.js";
11
- import { a as i, i as a } from "./adopt-global-settings-CSk5bLXy.js";
12
- import { t as o } from "./jsx-runtime-CtJ_t8Mi.js";
13
- import "./settings-CK9N4RDZ.js";
14
- import { t as s } from "./add-debug-secret-listener-Uy98ISZg.js";
9
+ import { r as e } from "./rolldown-runtime-BOCG9HEF.js";
10
+ import { a as t, i as n, s as r } from "./efp-debug-init-DfQX41Dz.js";
11
+ import { a as i, i as a } from "./adopt-global-settings-BscL85ma.js";
12
+ import { t as o } from "./jsx-runtime-BGutO_I9.js";
13
+ import "./settings-BEwEIUKe.js";
14
+ import { t as s } from "./add-debug-secret-listener-DibnDryN.js";
15
15
  //#region ../debug/src/lib/ui/render-debug-ui.tsx
16
16
  var c = /* @__PURE__ */ e(r(), 1), l = o(), u = !1;
17
17
  function d() {
@@ -26,7 +26,7 @@ function d() {
26
26
  }
27
27
  });
28
28
  let o = async (t) => {
29
- let { DebugUi: n } = await import("./debug-ui-DvXUU9-P.js"), { createRoot: i } = await import("./client-CTsWysuI.js").then((t) => /* @__PURE__ */ e(t.t(), 1)), a = document.createElement("div");
29
+ let { DebugUi: n } = await import("./debug-ui-CX2sgttZ.js"), { createRoot: i } = await import("./client-BtPJvi_3.js").then((t) => /* @__PURE__ */ e(t.t(), 1)), a = document.createElement("div");
30
30
  document.body.appendChild(a), i(a).render(/* @__PURE__ */ (0, l.jsx)(n, {
31
31
  useDebugButtonState: r.useState,
32
32
  open: t
@@ -1,14 +1,14 @@
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.38.0" };
4
+ e.SENTRY_RELEASE = { id: "3.39.1" };
5
5
  var t = new e.Error().stack;
6
6
  t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "44feeb02-c84e-4fb1-b2f8-984c7d50f58d", e._sentryDebugIdIdentifier = "sentry-dbid-44feeb02-c84e-4fb1-b2f8-984c7d50f58d");
7
7
  } catch {}
8
8
  })();
9
- import { r as e } from "./rolldown-runtime-CjjOYn6R.js";
10
- import { t } from "./react-C-Qd2U47.js";
11
- import { l as n } from "./store-DcCWvP6P.js";
9
+ import { r as e } from "./rolldown-runtime-BOCG9HEF.js";
10
+ import { t } from "./react-CM7l092i.js";
11
+ import { l as n } from "./store-CARxK2Ft.js";
12
12
  //#region ../ui/src/shared/activeElement.ts
13
13
  var r = (e) => !!e && "activeElement" in e;
14
14
  function i(e) {
@@ -1,12 +1,12 @@
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.38.0" };
4
+ e.SENTRY_RELEASE = { id: "3.39.1" };
5
5
  var t = new e.Error().stack;
6
6
  t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "233b3b22-a917-48c8-8f7e-f558b0dbd9d8", e._sentryDebugIdIdentifier = "sentry-dbid-233b3b22-a917-48c8-8f7e-f558b0dbd9d8");
7
7
  } catch {}
8
8
  })();
9
- import { c as e, vt as t } from "./store-DcCWvP6P.js";
9
+ import { c as e, vt as t } from "./store-CARxK2Ft.js";
10
10
  //#region src/components/Map/viewport.ts
11
11
  function n(e) {
12
12
  return {
@@ -1 +1 @@
1
- import{__decorate as i}from"tslib";import{getConfig as f}from"@expofp/config";import{action as n,computed as k,observable as g,toJS as m,when as C}from"mobx";import{KIOSK_ENABLE_KEY as p}from"../../constants";import a from"../../store";import{areLayersEnabled as y}from"../../utils/areLayersEnabled";import{t as h}from"../../utils/i18n";import{isLocalStorageAvailable as S}from"../../utils/localStorage";import{mapCamera as d}from"../Map/camera";import{mapViewport as K}from"../Map/viewport";import{screenFitsKiosk as M,storedKioskMode as v}from"./kiosk-mode";import{getPtScaleZoomRatio as P,toFiniteNumber as u}from"./kiosk-record";import{updateKiosk as b}from"./kioskApi";import{getSavedKiosk as w,removeKiosk as F,saveKiosk as R}from"./SetKiosk";import{KIOSK_STORAGE_KEY as D}from"./SetKiosk/constants";const I=2e4;class s{constructor(){this.savedKiosk=null,this.statusMessages=[],this.statusMessageTimer=0,this.isResettingCamera=!1,this.isRestoringFraming=!1}get kiosk(){return a.uiState.kioskData}setKiosk(e){a.uiState.setKioskData(e)}getCameraState(){if(a.maplibreStore.showMaplibre){const t=a.maplibreStore.cameraPort?.getCameraState();return t?{mapCenterLng:t.lng,mapCenterLat:t.lat,mapZoom:t.zoom,mapBearingDegrees:t.bearing,mapPitchDegrees:t.pitch}:{}}const e=d()?.state();return e?{mapInitialPtScale:this.initialPtScale,mapPtScale:e.pixelSize,mapCenterX:e.center.x,mapCenterY:e.center.y,mapRollDegrees:e.roll,mapPitch:e.pitch}:{}}get hasUnsavedChanges(){const e=this.savedKiosk,t=m(this.kiosk);if(!t||!e)return!!t!=!!e;const o=Object.keys(e),r=Object.keys(t);if(o.length!==r.length)return!0;for(const l of o)if(!(l in t)||e[l]!==t[l])return!0;return!1}addStatusMessage(e){this.statusMessages=[{...e,id:Date.now()}],this.startCleanupMessages()}clearStatusMessages(){this.statusMessages=[]}startCleanupMessages(){clearTimeout(this.statusMessageTimer),this.statusMessageTimer=window.setTimeout(()=>this.clearStatusMessages(),1e3)}async resetCamera(){if(!this.isResettingCamera){this.isResettingCamera=!0;try{if(a.maplibreStore.showMaplibre&&await this.resetMaplibreCamera()){this.isRestoringFraming=!0;return}this.isRestoringFraming=await this.resetPlanCamera()}finally{this.isResettingCamera=!1}}}async resetMaplibreCamera(){const e=await this.waitForMaplibreCameraPort();if(!e)return!1;const t=this.kiosk;t?.z!=null&&a.fp.activateFloor({name:String(t.z)});const o=u(t?.mapCenterLng),r=u(t?.mapCenterLat),l=u(t?.mapZoom);return o===void 0||r===void 0||l===void 0?(e.resetPitch(),a.uiState.fitBounds(),!0):(e.applyCameraState({lng:o,lat:r,zoom:l,bearing:u(t?.mapBearingDegrees),pitch:u(t?.mapPitchDegrees)}),!0)}async waitForMaplibreCameraPort(){const{maplibreStore:e}=a;if(e.cameraPort)return e.cameraPort;try{await C(()=>!!e.cameraPort||!e.showMaplibre,{timeout:I})}catch{return null}return e.cameraPort}async resetPlanCamera(){const e=d();if(!e)return!1;const t=this.kiosk;await e.api.reset({pan:!0,zoom:!0,roll:!0,pitch:!0},{immediate:!0}),t?.z!=null&&a.fp.activateFloor({name:String(t.z)});const o=P(t);o!==void 0&&await e.api.zoomBy(o,{immediate:!0});const r=u(t?.mapCenterX),l=u(t?.mapCenterY);r!==void 0&&l!==void 0&&await e.api.panTo({x:r,y:l},{immediate:!0});const c=u(t?.mapRollDegrees);return c!==void 0&&await e.api.rollTo(c,{immediate:!0}),!0}restoreData(){const e=w();this.savedKiosk=e??null,e&&(this.setKiosk(e),a.uiState.kiosk=!0)}handleSetupReady(){this.restoreData(),a.uiState.kiosk=!0,a.uiState.hideFreeOrDemo=!0,a.uiState.setForceDim(!0),a.searchStore.setSearchText(""),a.searchStore.setFocused(!1),this.resetCamera()}handleClose(){M(a.uiState)&&v(f())||(a.uiState.kiosk=!1),a.uiState.restoreUIScale(),this.setKiosk(null),a.uiState.setForceDim(!1),a.uiState.enableSetKioskMode(!1),a.searchStore.closeSearch()}handleDelete(){S&&localStorage.getItem(D)!==null&&localStorage.getItem(p)==="1"&&localStorage.removeItem(p),F(),this.savedKiosk=null,this.setKiosk(null),a.uiState.resetMapSettings(),a.uiState.resetUIScale(),this.addStatusMessage({variant:"success",title:h("Deleted")})}handleSave(){const e=K();if(!e)return;const t=m(this.kiosk);if(!t)return;const o=this.getCameraState(),r={...t,...o};if(!e.isVisible({x:r.x,y:r.y})){this.addStatusMessage({variant:"error",title:h("Kiosk not visible")});return}this.setKiosk(r),R(r),S&&localStorage.setItem(p,"1"),b(r,"https://app.expofp.com/"),a.uiState.setUIScale(r.uiScale,!0),this.addStatusMessage({variant:"success",title:h("Saved")}),this.savedKiosk=r}delayChange(e){requestAnimationFrame(()=>e?.())}handleChange(e){const t=m(this.kiosk);t&&(Number.isFinite(e.angle)&&this.setKiosk({...t,heading:e.angle}),Number.isFinite(e.scale)&&(this.setKiosk({...t,uiScale:e.scale}),this.delayChange(()=>a.uiState.setUIScale(e.scale,!1))),Number.isFinite(e.percent)&&this.setKiosk({...t,iconSizePercent:e.percent}))}setInitialPtScale(e){if(this.initialPtScale)return;this.initialPtScale=e;const t=m(this.kiosk);t&&this.setKiosk({...t,mapInitialPtScale:e})}handleClick(e){const t=m(this.kiosk),o=a.fp.getFloors(),r=y()?o.find(c=>c.active)?.name??null:null,l=a.uiState.uiScale;this.setKiosk({...t,x:e.x,y:e.y,z:r,uiScale:t?.uiScale||l,heading:t?.heading||0,iconSizePercent:t?.iconSizePercent||100,...this.getCameraState()})}handleNavigationChange(){const e=this.isRestoringFraming;this.isRestoringFraming=!1;const t=m(this.kiosk);if(!t)return;const o=this.getCameraState();this.setKiosk({...t,...o}),e&&this.savedKiosk&&(this.savedKiosk={...this.savedKiosk,...o})}}i([k({keepAlive:!0})],s.prototype,"kiosk",null),i([n],s.prototype,"setKiosk",null),i([g],s.prototype,"savedKiosk",void 0),i([k({keepAlive:!0})],s.prototype,"hasUnsavedChanges",null),i([g],s.prototype,"statusMessages",void 0),i([n],s.prototype,"addStatusMessage",null),i([n],s.prototype,"clearStatusMessages",null),i([n],s.prototype,"startCleanupMessages",null),i([n],s.prototype,"resetCamera",null),i([n],s.prototype,"restoreData",null),i([n],s.prototype,"handleSetupReady",null),i([n],s.prototype,"handleClose",null),i([n],s.prototype,"handleDelete",null),i([n],s.prototype,"handleSave",null),i([n],s.prototype,"handleChange",null),i([n],s.prototype,"setInitialPtScale",null),i([n],s.prototype,"handleClick",null),i([n],s.prototype,"handleNavigationChange",null);export default new s;
1
+ import{__decorate as i}from"tslib";import{getConfig as C}from"@expofp/config";import{action as n,computed as g,observable as S,toJS as m,when as y}from"mobx";import{KIOSK_ENABLE_KEY as p}from"../../constants";import a from"../../store";import{areLayersEnabled as K}from"../../utils/areLayersEnabled";import{t as h}from"../../utils/i18n";import{isLocalStorageAvailable as d}from"../../utils/localStorage";import{mapCamera as f}from"../Map/camera";import{mapViewport as M}from"../Map/viewport";import{screenFitsKiosk as v,storedKioskMode as P}from"./kiosk-mode";import{getPtScaleZoomRatio as b,toFiniteNumber as u}from"./kiosk-record";import{updateKiosk as w}from"./kioskApi";import{getSavedKiosk as F,removeKiosk as R,saveKiosk as D}from"./SetKiosk";import{KIOSK_STORAGE_KEY as I}from"./SetKiosk/constants";const z=2e4;class s{constructor(){this.savedKiosk=null,this.statusMessages=[],this.statusMessageTimer=0,this.isResettingCamera=!1,this.isRestoringFraming=!1}get kiosk(){return a.uiState.kioskData}setKiosk(e){a.uiState.setKioskData(e)}getCameraState(){if(a.maplibreStore.showMaplibre){const t=a.maplibreStore.cameraPort?.getCameraState();return t?{mapCenterLng:t.lng,mapCenterLat:t.lat,mapZoom:t.zoom,mapBearingDegrees:t.bearing,mapPitchDegrees:t.pitch}:{}}const e=f()?.state();return e?{mapInitialPtScale:this.initialPtScale,mapPtScale:e.pixelSize,mapCenterX:e.center.x,mapCenterY:e.center.y,mapRollDegrees:e.roll,mapPitch:e.pitch}:{}}get hasUnsavedChanges(){const e=this.savedKiosk,t=m(this.kiosk);if(!t||!e)return!!t!=!!e;const o=Object.keys(e),r=Object.keys(t);if(o.length!==r.length)return!0;for(const l of o)if(!(l in t)||e[l]!==t[l])return!0;return!1}addStatusMessage(e){this.statusMessages=[{...e,id:Date.now()}],this.startCleanupMessages()}clearStatusMessages(){this.statusMessages=[]}startCleanupMessages(){clearTimeout(this.statusMessageTimer),this.statusMessageTimer=window.setTimeout(()=>this.clearStatusMessages(),1e3)}async resetCamera(){if(!this.isResettingCamera){this.isResettingCamera=!0;try{if(a.maplibreStore.showMaplibre&&await this.resetMaplibreCamera()){this.isRestoringFraming=!0;return}this.isRestoringFraming=await this.resetPlanCamera()}finally{this.isResettingCamera=!1}}}async resetMaplibreCamera(){const e=await this.waitForMaplibreCameraPort();if(!e)return!1;const t=this.kiosk;t?.z!=null&&a.fp.activateFloor({name:String(t.z)});const o=u(t?.mapCenterLng),r=u(t?.mapCenterLat),l=u(t?.mapZoom);return o===void 0||r===void 0||l===void 0?(e.resetPitch(),a.uiState.fitBounds(),!0):(e.applyCameraState({lng:o,lat:r,zoom:l,bearing:u(t?.mapBearingDegrees),pitch:u(t?.mapPitchDegrees)}),!0)}async waitForMaplibreCameraPort(){const{maplibreStore:e}=a;if(e.cameraPort)return e.cameraPort;try{await y(()=>!!e.cameraPort||!e.showMaplibre,{timeout:z})}catch{return null}return e.cameraPort}async resetPlanCamera(){const e=f();if(!e)return!1;const t=this.kiosk;await e.api.reset({pan:!0,zoom:!0,roll:!0,pitch:!0},{immediate:!0}),t?.z!=null&&a.fp.activateFloor({name:String(t.z)});const o=b(t);o!==void 0&&await e.api.zoomBy(o,{immediate:!0});const r=u(t?.mapCenterX),l=u(t?.mapCenterY);r!==void 0&&l!==void 0&&await e.api.panTo({x:r,y:l},{immediate:!0});const c=u(t?.mapRollDegrees);c!==void 0&&await e.api.rollTo(c,{immediate:!0});const k=u(t?.mapPitch);return k!==void 0&&await e.api.pitchTo(k,{immediate:!0}),!0}restoreData(){const e=F();this.savedKiosk=e??null,e&&(this.setKiosk(e),a.uiState.kiosk=!0)}handleSetupReady(){this.restoreData(),a.uiState.kiosk=!0,a.uiState.hideFreeOrDemo=!0,a.uiState.setForceDim(!0),a.searchStore.setSearchText(""),a.searchStore.setFocused(!1),this.resetCamera()}handleClose(){v(a.uiState)&&P(C())||(a.uiState.kiosk=!1),a.uiState.restoreUIScale(),this.setKiosk(null),a.uiState.setForceDim(!1),a.uiState.enableSetKioskMode(!1),a.searchStore.closeSearch()}handleDelete(){d&&localStorage.getItem(I)!==null&&localStorage.getItem(p)==="1"&&localStorage.removeItem(p),R(),this.savedKiosk=null,this.setKiosk(null),a.uiState.resetMapSettings(),a.uiState.resetUIScale(),this.addStatusMessage({variant:"success",title:h("Deleted")})}handleSave(){const e=M();if(!e)return;const t=m(this.kiosk);if(!t)return;const o=this.getCameraState(),r={...t,...o};if(!e.isVisible({x:r.x,y:r.y})){this.addStatusMessage({variant:"error",title:h("Kiosk not visible")});return}this.setKiosk(r),D(r),d&&localStorage.setItem(p,"1"),w(r,"https://app.expofp.com/"),a.uiState.setUIScale(r.uiScale,!0),this.addStatusMessage({variant:"success",title:h("Saved")}),this.savedKiosk=r}delayChange(e){requestAnimationFrame(()=>e?.())}handleChange(e){const t=m(this.kiosk);t&&(Number.isFinite(e.angle)&&this.setKiosk({...t,heading:e.angle}),Number.isFinite(e.scale)&&(this.setKiosk({...t,uiScale:e.scale}),this.delayChange(()=>a.uiState.setUIScale(e.scale,!1))),Number.isFinite(e.percent)&&this.setKiosk({...t,iconSizePercent:e.percent}))}setInitialPtScale(e){if(this.initialPtScale)return;this.initialPtScale=e;const t=m(this.kiosk);t&&this.setKiosk({...t,mapInitialPtScale:e})}handleClick(e){const t=m(this.kiosk),o=a.fp.getFloors(),r=K()?o.find(c=>c.active)?.name??null:null,l=a.uiState.uiScale;this.setKiosk({...t,x:e.x,y:e.y,z:r,uiScale:t?.uiScale||l,heading:t?.heading||0,iconSizePercent:t?.iconSizePercent||100,...this.getCameraState()})}handleNavigationChange(){const e=this.isRestoringFraming;this.isRestoringFraming=!1;const t=m(this.kiosk);if(!t)return;const o=this.getCameraState();this.setKiosk({...t,...o}),e&&this.savedKiosk&&(this.savedKiosk={...this.savedKiosk,...o})}}i([g({keepAlive:!0})],s.prototype,"kiosk",null),i([n],s.prototype,"setKiosk",null),i([S],s.prototype,"savedKiosk",void 0),i([g({keepAlive:!0})],s.prototype,"hasUnsavedChanges",null),i([S],s.prototype,"statusMessages",void 0),i([n],s.prototype,"addStatusMessage",null),i([n],s.prototype,"clearStatusMessages",null),i([n],s.prototype,"startCleanupMessages",null),i([n],s.prototype,"resetCamera",null),i([n],s.prototype,"restoreData",null),i([n],s.prototype,"handleSetupReady",null),i([n],s.prototype,"handleClose",null),i([n],s.prototype,"handleDelete",null),i([n],s.prototype,"handleSave",null),i([n],s.prototype,"handleChange",null),i([n],s.prototype,"setInitialPtScale",null),i([n],s.prototype,"handleClick",null),i([n],s.prototype,"handleNavigationChange",null);export default new s;
@@ -1 +1 @@
1
- import{initWayfindingLayers as c}from"@expofp/wayfinding";import{createLayerDef as p}from"../../../../engine/defs";import s from"../../../../store";import{isPathwayLayer as L}from"../../../../utils/is-pathway-layer";import{createTrafficLayers as d}from"../../traffic/trafficLayers";import{configBoothsBadges as u}from"./config-booth-badge";import h from"./config-load-layer";import{MARKER_LAYER_NAME as g}from"./config-markers";export default function b(){const{defaultLayer:t}=s.layerStore;let{layers:e}=s.layerStore;if(t){const r=[...e],a=e.indexOf(t);r.splice(a,1),e=[t,...r]}const l=e.filter(r=>!r.rootParent).map(r=>h(r));return Promise.all(l).then(r=>{const a=p(g,[]),m=c(),n=[],i=[];for(const o of r.flat())L(o.name)?(o.dim=0,i.push(o)):n.push(o);const{layer:f,cleanup:y}=u("root",s.boothStore.booths);return{layers:[...n,...f?[f]:[],...i,...d(),a,m],cleanup:y}})}
1
+ import{initWayfindingLayers as p}from"@expofp/wayfinding";import{createLayerDef as L}from"../../../../engine/defs";import f,{boothStore as d,uiState as l}from"../../../../store";import{isPathwayLayer as u}from"../../../../utils/is-pathway-layer";import{createTrafficLayers as h}from"../../traffic/trafficLayers";import{configBoothsBadges as g}from"./config-booth-badge";import w from"./config-load-layer";import{MARKER_LAYER_NAME as b}from"./config-markers";export default function A(){const{defaultLayer:a}=f.layerStore;let{layers:e}=f.layerStore;if(a){const r=[...e],o=e.indexOf(a);r.splice(o,1),e=[a,...r]}const m=e.filter(r=>!r.rootParent).map(r=>w(r));return Promise.all(m).then(r=>{const o=L(b,[]);o.overlay=l.is3DView;const y=p({overlay:l.is3DView}),i=[],s=[];for(const t of r.flat())u(t.name)?(t.dim=0,s.push(t)):i.push(t);const{layer:n,cleanup:c}=g("root",d.booths);return{layers:[...i,...n?[n]:[],...s,...h(),o,y],cleanup:c}})}
@@ -1,2 +1,2 @@
1
- import{Rect as m}from"@expofp/geometry";import{update as L}from"@expofp/renderer";import{reaction as b}from"mobx";import{FONT_WEIGHT_PRIMARY_BOOTH as g,FONT_WEIGHT_PRIMARY_SPECIAL as y}from"../../../../constants";import{createTextDef as D}from"../../../../engine/defs";import{loadCustomFontsUrls as F}from"../../../../engine/fonts";import{getQuarterTurns as x,getRollValue as R,rotateRectByQuarters as S,rotateTextDefByQuarters as T,shouldFlip as v}from"../../../../engine/update-def";import{heatmapStore as B,layersStore as I,uiState as l}from"../../../../store";import{SpecialBooth as w}from"../../../../store/BoothStore";import z from"../../../../tools/settings";import{getFont as M}from"./canvases";import{BoothLabelDrawer as O,getFontUrlByWeight as k,getMinZoomFactorForDot as C,isDirectionsMode as P}from"./config-booth-labels";import{LABEL_MARGIN_FRACTION as f}from"./label-inset.js";import _ from"./TextFitter";const c=new Map;function A(i){let t=c.get(i);if(!t){const s=[18,16,14,12,10,7].map(o=>o*i),e=14*i;t=new _(M,s,e),c.set(i,t),setTimeout(()=>c.delete(i),5e3)}return t}export default function N(i){if(!(!(i instanceof w)||i.noLabels))return new V(i)}class V extends O{constructor(t){super(t),this.steps=[],this.text="";const s=this.booth.rect,e=Number(getComputedStyle(document.body).getPropertyValue(y))||Number(getComputedStyle(document.body).getPropertyValue(g))||500,o=k(e,F()),h=s.expand({x:-(s.size.width*f+this.padding),y:-(s.size.height*f+this.padding)});this.setText(),this.canvasRect=new m(h.center,h.size,t.rotate,t.elevation),this.setFactors(this.text),this.labelIsVertical=Math.abs(Math.abs(t.rotate)-Math.PI/2)<.01,this.fontSizes=[this.steps,[]],this.minZoomDotVisible=C(this.steps.map(a=>a.scaleFactor)),this.shapeLabel=D([{text:this.text,color:t.labelColor||z.boothLabelColor,fontUrl:o,fontSize:0}],new m(h.center,h.size,t.rotate,t.elevation),[this.padding,this.padding],{horizontal:"center",text:"center",vertical:"center"}),this.shapeLabel.onScale=({pixelSize:a})=>this.layOutLabel(a),this.getShapeDot(),b(()=>[this.booth.skipDim,l.selectedRoute,I.layersLoaded],()=>{const a=P();this.shapeLabel.dim=a||this.booth.skipDim?0:void 0,this.shapeDot.dim=a||this.booth.skipDim?0:void 0,L(this.shapeLabel,this.shapeDot)}),b(()=>l.mapSettings,({roll:a})=>{R(a??0)&&(this.shapeLabel.onRoll=({roll:p,pixelSize:d})=>{const r=this.shapeLabel.bounds.rotation;if(this.labelIsVertical)return v(p,r)?(this.shapeLabel.bounds.rotate(-2*r,this.shapeLabel.bounds),[this.shapeLabel,this.shapeDot]):void 0;const n=x(p,r);if(n===0)return;const{size:u}=this.canvasRect;return this.shapeLabel=T(this.shapeLabel,n),u.x!==u.y&&!this.shapeLabel.hidden&&(this.canvasRect=S(this.canvasRect,n),this.setFactors(this.text),this.layOutLabel(d),this.layOutDot(d)),[this.shapeLabel,this.shapeDot]})},{fireImmediately:!0})}getShape(){return[this.shapeLabel,this.shapeDot]}layOutLabel(t){const s=this.steps.find(e=>e.scaleFactor<1/t);return s?(this.shapeLabel.lines[0].fontSize=s.value*t,this.shapeLabel.lines[0].text=s.lines.join(`
2
- `),this.shapeLabel.padding=[this.paddingScaled[0]*t+this.padding,this.paddingScaled[1]*t+this.padding],[this.shapeLabel]):(this.shapeLabel.lines[0].fontSize=0,[this.shapeLabel])}layOutDot(t){const s=this.steps.find(h=>h.scaleFactor<1/t),e=this.shapeDot.bounds,o=this.shapeDot.source;return e.scale({x:o.width*t/e.size.x,y:o.height*t/e.size.y},e.center,e),this.shapeDot.hidden=!!s,[this.shapeDot]}setFactors(t){this.steps=A(devicePixelRatio).getStepsForRect(t,this.canvasRect.size.x,this.canvasRect.size.y)}setText(){const t=this.booth.title||this.booth.name,e=`Clicks: ${B.getTotalClicksByBooth(this.booth)}`;this.text=l.heatmap?`${t} - ${e}`:t}}
1
+ import{Rect as u}from"@expofp/geometry";import{update as L}from"@expofp/renderer";import{reaction as m}from"mobx";import{FONT_WEIGHT_PRIMARY_BOOTH as g,FONT_WEIGHT_PRIMARY_SPECIAL as y}from"../../../../constants";import{createTextDef as F}from"../../../../engine/defs";import{loadCustomFontsUrls as D}from"../../../../engine/fonts";import{getQuarterTurns as x,getRollValue as R,rotateRectByQuarters as S,rotateTextDefByQuarters as T,shouldFlip as v}from"../../../../engine/update-def";import{heatmapStore as B,layersStore as I,uiState as b}from"../../../../store";import{SpecialBooth as w}from"../../../../store/BoothStore";import z from"../../../../tools/settings";import{getFont as O}from"./canvases";import{BoothLabelDrawer as C,getFontUrlByWeight as M,getMinZoomFactorForDot as P}from"./config-booth-labels";import{LABEL_MARGIN_FRACTION as f}from"./label-inset.js";import _ from"./TextFitter";const l=new Map;function A(i){let t=l.get(i);if(!t){const s=[18,16,14,12,10,7].map(o=>o*i),e=14*i;t=new _(O,s,e),l.set(i,t),setTimeout(()=>l.delete(i),5e3)}return t}export default function N(i){if(!(!(i instanceof w)||i.noLabels))return new V(i)}class V extends C{constructor(t){super(t),this.steps=[],this.text="";const s=this.booth.rect,e=Number(getComputedStyle(document.body).getPropertyValue(y))||Number(getComputedStyle(document.body).getPropertyValue(g))||500,o=M(e,D()),r=s.expand({x:-(s.size.width*f+this.padding),y:-(s.size.height*f+this.padding)});this.setText(),this.canvasRect=new u(r.center,r.size,t.rotate,t.elevation),this.setFactors(this.text),this.labelIsVertical=Math.abs(Math.abs(t.rotate)-Math.PI/2)<.01,this.fontSizes=[this.steps,[]],this.minZoomDotVisible=P(this.steps.map(a=>a.scaleFactor)),this.shapeLabel=F([{text:this.text,color:t.labelColor||z.boothLabelColor,fontUrl:o,fontSize:0}],new u(r.center,r.size,t.rotate,t.elevation),[this.padding,this.padding],{horizontal:"center",text:"center",vertical:"center"}),this.shapeLabel.onScale=({pixelSize:a})=>this.layOutLabel(a),this.getShapeDot(),m(()=>I.layersLoaded&&this.booth.skipDim===!0,a=>{this.shapeLabel.dim=a?0:void 0,this.shapeDot.dim=a?0:void 0,L(this.shapeLabel,this.shapeDot)}),m(()=>b.mapSettings,({roll:a})=>{R(a??0)&&(this.shapeLabel.onRoll=({roll:c,pixelSize:p})=>{const h=this.shapeLabel.bounds.rotation;if(this.labelIsVertical)return v(c,h)?(this.shapeLabel.bounds.rotate(-2*h,this.shapeLabel.bounds),[this.shapeLabel,this.shapeDot]):void 0;const n=x(c,h);if(n===0)return;const{size:d}=this.canvasRect;return this.shapeLabel=T(this.shapeLabel,n),d.x!==d.y&&!this.shapeLabel.hidden&&(this.canvasRect=S(this.canvasRect,n),this.setFactors(this.text),this.layOutLabel(p),this.layOutDot(p)),[this.shapeLabel,this.shapeDot]})},{fireImmediately:!0})}getShape(){return[this.shapeLabel,this.shapeDot]}layOutLabel(t){const s=this.steps.find(e=>e.scaleFactor<1/t);return s?(this.shapeLabel.lines[0].fontSize=s.value*t,this.shapeLabel.lines[0].text=s.lines.join(`
2
+ `),this.shapeLabel.padding=[this.paddingScaled[0]*t+this.padding,this.paddingScaled[1]*t+this.padding],[this.shapeLabel]):(this.shapeLabel.lines[0].fontSize=0,[this.shapeLabel])}layOutDot(t){const s=this.steps.find(r=>r.scaleFactor<1/t),e=this.shapeDot.bounds,o=this.shapeDot.source;return e.scale({x:o.width*t/e.size.x,y:o.height*t/e.size.y},e.center,e),this.shapeDot.hidden=!!s,[this.shapeDot]}setFactors(t){this.steps=A(devicePixelRatio).getStepsForRect(t,this.canvasRect.size.x,this.canvasRect.size.y)}setText(){const t=this.booth.title||this.booth.name,e=`Clicks: ${B.getTotalClicksByBooth(this.booth)}`;this.text=b.heatmap?`${t} - ${e}`:t}}
@@ -1 +1 @@
1
- import{Rect as B}from"@expofp/geometry";import{update as U}from"@expofp/renderer";import{reaction as M}from"mobx";import{FONT_WEIGHT_PRIMARY_BOOTH as V,FONT_WEIGHT_PRIMARY_EXHIBITOR as Z,FONT_WEIGHT_SECONDARY_BOOTH as X,FONT_WEIGHT_SECONDARY_EXHIBITOR as G}from"../../../../constants";import c from"../../../../data";import{createShapeDot as k,createTextDef as Y,createTextDefLines as Q}from"../../../../engine/defs";import{DEFAULT_FONT_LIGHT_URL as $,DEFAULT_FONT_URL as W,loadCustomFontsUrls as q}from"../../../../engine/fonts";import{getQuarterTurns as j,getRollValue as J,rotateRectByQuarters as K,rotateTextDefByQuarters as tt,updateLinesScale as et}from"../../../../engine/update-def";import{boothStore as it,layersStore as _,uiState as m}from"../../../../store";import{RegularBooth as st,SpecialBooth as ot}from"../../../../store/BoothStore";import v from"../../../../tools/settings";import{t as S}from"../../../../utils/i18n";import nt from"../../../../utils/is-mobile";import at from"../../../../utils/is-webview";import{isArabicText as rt}from"../../../../utils/rtl";import{BoothDrawerBaseWithoutPainter as ht}from"./BoothDrawerBase";import{getFont as I}from"./canvases";import{getLabelBorderInset as lt}from"./label-inset.js";let z=v.boothLabelColor;v.EXPO==="tqs2021"&&(z="#000");const x=nt||at,F=n=>n.replace(" ","").substring(0,4).replace(/[0-9]/g,"3").replace(/[A-Z]/gi,"A"),P=document.createElement("canvas").getContext("2d");export default function ct(n){if(!(!(n instanceof st)||n.noLabels))return new BoothLabelDrawer(n)}export function getMinZoomFactorForDot(n){return Array.isArray(n)&&n.length>0?Math.max(...n.map(t=>t)):typeof n=="number"?n:-0}export const isDirectionsMode=()=>!!(m.selectedRoute?.from&&m.selectedRoute?.to);export function getFontUrlByWeight(n,t=[],e="normal"){return[...t,{weight:500,url:W,style:"normal"},{weight:300,url:$,style:"normal"}].find(s=>+s.weight===n&&s.style===e)?.url||W}function b(n,t){return Number(getComputedStyle(document.body).getPropertyValue(n))||t}export function getBoothLabelWeights(){return{main:b(V,500),details:b(X,300)}}export function getExhibitorLabelWeights(){return{main:b(Z,500),details:b(G,300)}}export function getBadgeFontWeight(){return getExhibitorLabelWeights().details}const y="Details";export class BoothLabelDrawer extends ht{constructor(t){super(t),this.minZoomDotVisible=0,this.maxZoomDotVisible=0,this.exh=[],this.shapeLabel=void 0,this.shapeDot=void 0,this.fontSizes=[[],[]],this.lines=[[],[]],this.fontUrls=["",""],this.canvasRect=new B(t.rect.center,t.rect.size,t.rotate,t.elevation),this.paddingScaled=[4,4],this.padding=lt(t.borderWidth||it.borderWidth,t.rect.size),this.topLeftAlignment={horizontal:m.rtl?"right":"left",vertical:"top"},this.centerAlignment={horizontal:"center",vertical:"center"},this.prefixes=x?[{fontSize:7,name:"XS",short:!0},{fontSize:10,name:"S",short:!0},{fontSize:16,name:y,short:!1}]:[{fontSize:7,name:"XS",short:!0},{fontSize:10,name:"S",short:!0},{fontSize:12,name:"M",short:!0},{fontSize:14,name:"L",short:!0},{fontSize:18,name:y,short:!1}],!(t instanceof ot)&&(this.exh=c.hideExhibitors?[]:c.onlyFeaturedExhibitors?t.exhibitors.filter(e=>e.featured):t.exhibitors,x&&this.optimizationLevel()>=3&&(this.prefixes=this.prefixes.filter(e=>e.name!=="S")),this.createLines(),this.calculateFontSizeFactors(),this.shapeLabel=Y(Q(this.lines,this.booth.labelColor||z,0,this.fontUrls),new B(this.booth.rect.center,this.booth.rect.size,this.booth.rotate,this.booth.elevation),[...this.paddingScaled],{horizontal:"left",vertical:"top"}),this.shapeLabel.onScale=({pixelSize:e})=>this.layOutLabel(e),this.getShapeDot(),M(()=>[this.booth.skipDim,m.selectedRoute,_.layersLoaded],()=>{if(!_.layersLoaded)return;const e=isDirectionsMode();this.shapeLabel.dim=e||this.booth.skipDim?0:void 0,this.shapeDot.dim=e||this.booth.skipDim?0:void 0,U(this.shapeLabel,this.shapeDot)}),M(()=>m.mapSettings,({roll:e})=>{J(e??0)&&(this.shapeLabel.onRoll=({roll:i,pixelSize:a})=>{const s=j(i,this.shapeLabel.bounds.rotation);if(s===0)return;const{size:r}=this.canvasRect;return this.shapeLabel=tt(this.shapeLabel,s),!this.shapeLabel.hidden&&!this.exh.length&&r.x!==r.y&&(this.canvasRect=K(this.canvasRect,s),this.calculateFontSizeFactors(),this.layOutLabel(a),this.layOutDot(a)),[this.shapeLabel,this.shapeDot]})},{fireImmediately:!0}))}getShape(){return[this.shapeLabel,this.shapeDot]}layOutLabel(t){const e=this.lines[1]??[],i=this.fontSizes[1]??[];if(v.EXPO!=="wineparis2026"){const s=this.exh.length?this.topLeftAlignment:e.length?t<i[i.length-1].scaleFactor?this.topLeftAlignment:this.centerAlignment:this.topLeftAlignment;this.shapeLabel.alignment=s}return et(this.shapeLabel.lines,t,this.fontSizes)?(this.shapeLabel.padding[0]=this.paddingScaled[0]*t+this.padding,this.shapeLabel.padding[1]=this.paddingScaled[1]*t+this.padding,[this.shapeLabel]):[]}layOutDot(t){const e=t>=this.minZoomDotVisible&&t<=this.maxZoomDotVisible;if(!e&&this.shapeDot.hidden)return[];const i=this.shapeDot.bounds,a=this.shapeDot.source;return i.scale({x:a.width*t/i.size.x,y:a.height*t/i.size.y},i.center,i),this.shapeDot.hidden=!e,[this.shapeDot]}getShapeDot(){this.shapeDot=k(this.canvasRect,this.booth.labelColor||z),this.shapeDot.hidden=!0,this.shapeDot.onScale=({pixelSize:e})=>this.layOutDot(e);const t=this.shapeDot.source;this.maxZoomDotVisible=Math.min(this.canvasRect.size.x/t.width,this.canvasRect.size.y/t.height)}createLines(){const t=this.booth,e=[],i=[],a=x&&this.optimizationLevel()>=3?1:3;if(this.exh.length){const s=t.exhibitors.filter(o=>o.order===0),r=t.exhibitors.filter(o=>o.order);if(s.length>0)e.push(...s.map(o=>o.name));else if(c.onlyFeaturedExhibitors)e.push(...t.exhibitors.filter(o=>o.featured).map(o=>o.name));else if(r.length>0){e.push(...r.map(u=>u.name));const o=t.exhibitors.filter(u=>u.order===void 0);o.length>0&&e.push(S("and {{moreCount}} more",{moreCount:o.length}))}else t.exhibitors.length>a?e.push(`${t.exhibitors.length} ${c.exhibitorTermPlural}`):e.push(...t.exhibitors.map(o=>o.name));i.push(t.title||t.name)}else{const s=!!t.exhibitors.length;e.push(t.title||t.name),t.onHold?i.push(S("On Hold")):t.reserved?i.push(S("Reserved")):s||i.push(...t.exhibitors.map(r=>r.name).sort((r,o)=>r>o?1:-1)),t.size&&i.push(t.size.indexOf("/")>-1?t.size.substring(0,t.size.indexOf("/")).trim():t.size),t.price&&t.price!=="0"&&!m.previewMode&&i.push(t.price)}m.rtl&&e.forEach((s,r)=>{(s.endsWith(".")||s.endsWith("!")||s.endsWith("?"))&&(e[r]=e[r]+"\u200F"),rt(s)&&(e[r]=e[r]+" ")}),this.lines=[e,i]}calculateFontSizeFactors(){const t=this.lines[0];let e;const i=this.canvasRect,a=[],s=[],r=this.prefixes.slice(0,this.exh.length?this.prefixes.length:this.prefixes.length-1),{main:o,details:u}=this.exh.length?getExhibitorLabelWeights():getBoothLabelWeights();for(const{fontSize:l,short:p}of r){const d=l*devicePixelRatio,L=.9*l*devicePixelRatio,f=I(d,o),T=I(L,u),O=c.hideExhibitorBoothNumber||p;let w,A,D,g;if(this.exh.length)e=p?[]:this.lines[1],D=Math.max(...t.map(h=>this.measureText(h,f).width),...e.map(h=>this.measureText(h,T).width)),w=Math.max(...t.map(h=>this.exh.length?this.measureText(F(h),f).width:this.measureText(F(h),f).width+3+3),...e.map(h=>this.measureText(F(h),T).width)),g=d*t.length+L*e.length+devicePixelRatio*(t.length+e.length)+3,A=O?g/t.length:null;else{const h=t[0].replace(/[0-9]/g,"3").replace(/[A-Z]/g,"A"),H=4;D=this.measureText(h,f).width+3+3,g=d+H}const C=i.size.x/(w||D),N=i.size.y/(A||g),E=Math.min(C,N);a.push({scaleFactor:E,value:d,lines:[]}),O||s.push({scaleFactor:E,value:L,lines:[]})}if(!this.exh.length){const l=a[a.length-1],p=this.prefixes.find(d=>d.name===y);p&&(a.push({scaleFactor:l.scaleFactor/1.8,value:p.fontSize*devicePixelRatio,lines:[]}),s.push({scaleFactor:l.scaleFactor/1.8,value:p.fontSize*(x?1:.9)*devicePixelRatio,lines:[]}))}const R=q();this.fontUrls=[getFontUrlByWeight(o,R),getFontUrlByWeight(u,R)],this.minZoomDotVisible=getMinZoomFactorForDot(a.map(l=>l.scaleFactor)),this.fontSizes=[a,s]}calcArea(t,e){return Math.floor(Math.max(0,t)*Math.max(0,e)/1e3)}optimizationLevel(){return Math.min(c.viewOptimizationLevel?c.viewOptimizationLevel:Math.floor(this.calcArea(this.canvasRect.size.x,this.canvasRect.size.y)/5e3),3)}measureText(t,e){return P.font=e,P.measureText(t)}}
1
+ import{Rect as B}from"@expofp/geometry";import{update as H}from"@expofp/renderer";import{reaction as M}from"mobx";import{FONT_WEIGHT_PRIMARY_BOOTH as U,FONT_WEIGHT_PRIMARY_EXHIBITOR as V,FONT_WEIGHT_SECONDARY_BOOTH as Z,FONT_WEIGHT_SECONDARY_EXHIBITOR as X}from"../../../../constants";import c from"../../../../data";import{createShapeDot as G,createTextDef as Y,createTextDefLines as Q}from"../../../../engine/defs";import{DEFAULT_FONT_LIGHT_URL as $,DEFAULT_FONT_URL as W,loadCustomFontsUrls as q}from"../../../../engine/fonts";import{getQuarterTurns as j,getRollValue as k,rotateRectByQuarters as J,rotateTextDefByQuarters as K,updateLinesScale as tt}from"../../../../engine/update-def";import{boothStore as et,layersStore as it,uiState as f}from"../../../../store";import{RegularBooth as st,SpecialBooth as ot}from"../../../../store/BoothStore";import D from"../../../../tools/settings";import{t as S}from"../../../../utils/i18n";import nt from"../../../../utils/is-mobile";import at from"../../../../utils/is-webview";import{isArabicText as rt}from"../../../../utils/rtl";import{BoothDrawerBaseWithoutPainter as ht}from"./BoothDrawerBase";import{getFont as _}from"./canvases";import{getLabelBorderInset as lt}from"./label-inset.js";let z=D.boothLabelColor;D.EXPO==="tqs2021"&&(z="#000");const x=nt||at,F=n=>n.replace(" ","").substring(0,4).replace(/[0-9]/g,"3").replace(/[A-Z]/gi,"A"),I=document.createElement("canvas").getContext("2d");export default function ct(n){if(!(!(n instanceof st)||n.noLabels))return new BoothLabelDrawer(n)}export function getMinZoomFactorForDot(n){return Array.isArray(n)&&n.length>0?Math.max(...n.map(t=>t)):typeof n=="number"?n:-0}export const isDirectionsMode=()=>!!(f.selectedRoute?.from&&f.selectedRoute?.to);export function getFontUrlByWeight(n,t=[],e="normal"){return[...t,{weight:500,url:W,style:"normal"},{weight:300,url:$,style:"normal"}].find(s=>+s.weight===n&&s.style===e)?.url||W}function b(n,t){return Number(getComputedStyle(document.body).getPropertyValue(n))||t}export function getBoothLabelWeights(){return{main:b(U,500),details:b(Z,300)}}export function getExhibitorLabelWeights(){return{main:b(V,500),details:b(X,300)}}export function getBadgeFontWeight(){return getExhibitorLabelWeights().details}const y="Details";export class BoothLabelDrawer extends ht{constructor(t){super(t),this.minZoomDotVisible=0,this.maxZoomDotVisible=0,this.exh=[],this.shapeLabel=void 0,this.shapeDot=void 0,this.fontSizes=[[],[]],this.lines=[[],[]],this.fontUrls=["",""],this.canvasRect=new B(t.rect.center,t.rect.size,t.rotate,t.elevation),this.paddingScaled=[4,4],this.padding=lt(t.borderWidth||et.borderWidth,t.rect.size),this.topLeftAlignment={horizontal:f.rtl?"right":"left",vertical:"top"},this.centerAlignment={horizontal:"center",vertical:"center"},this.prefixes=x?[{fontSize:7,name:"XS",short:!0},{fontSize:10,name:"S",short:!0},{fontSize:16,name:y,short:!1}]:[{fontSize:7,name:"XS",short:!0},{fontSize:10,name:"S",short:!0},{fontSize:12,name:"M",short:!0},{fontSize:14,name:"L",short:!0},{fontSize:18,name:y,short:!1}],!(t instanceof ot)&&(this.exh=c.hideExhibitors?[]:c.onlyFeaturedExhibitors?t.exhibitors.filter(e=>e.featured):t.exhibitors,x&&this.optimizationLevel()>=3&&(this.prefixes=this.prefixes.filter(e=>e.name!=="S")),this.createLines(),this.calculateFontSizeFactors(),this.shapeLabel=Y(Q(this.lines,this.booth.labelColor||z,0,this.fontUrls),new B(this.booth.rect.center,this.booth.rect.size,this.booth.rotate,this.booth.elevation),[...this.paddingScaled],{horizontal:"left",vertical:"top"}),this.shapeLabel.onScale=({pixelSize:e})=>this.layOutLabel(e),this.getShapeDot(),M(()=>it.layersLoaded&&this.booth.skipDim===!0,e=>{this.shapeLabel.dim=e?0:void 0,this.shapeDot.dim=e?0:void 0,H(this.shapeLabel,this.shapeDot)}),M(()=>f.mapSettings,({roll:e})=>{k(e??0)&&(this.shapeLabel.onRoll=({roll:i,pixelSize:a})=>{const s=j(i,this.shapeLabel.bounds.rotation);if(s===0)return;const{size:r}=this.canvasRect;return this.shapeLabel=K(this.shapeLabel,s),!this.shapeLabel.hidden&&!this.exh.length&&r.x!==r.y&&(this.canvasRect=J(this.canvasRect,s),this.calculateFontSizeFactors(),this.layOutLabel(a),this.layOutDot(a)),[this.shapeLabel,this.shapeDot]})},{fireImmediately:!0}))}getShape(){return[this.shapeLabel,this.shapeDot]}layOutLabel(t){const e=this.lines[1]??[],i=this.fontSizes[1]??[];if(D.EXPO!=="wineparis2026"){const s=this.exh.length?this.topLeftAlignment:e.length?t<i[i.length-1].scaleFactor?this.topLeftAlignment:this.centerAlignment:this.topLeftAlignment;this.shapeLabel.alignment=s}return tt(this.shapeLabel.lines,t,this.fontSizes)?(this.shapeLabel.padding[0]=this.paddingScaled[0]*t+this.padding,this.shapeLabel.padding[1]=this.paddingScaled[1]*t+this.padding,[this.shapeLabel]):[]}layOutDot(t){const e=t>=this.minZoomDotVisible&&t<=this.maxZoomDotVisible;if(!e&&this.shapeDot.hidden)return[];const i=this.shapeDot.bounds,a=this.shapeDot.source;return i.scale({x:a.width*t/i.size.x,y:a.height*t/i.size.y},i.center,i),this.shapeDot.hidden=!e,[this.shapeDot]}getShapeDot(){this.shapeDot=G(this.canvasRect,this.booth.labelColor||z),this.shapeDot.hidden=!0,this.shapeDot.onScale=({pixelSize:e})=>this.layOutDot(e);const t=this.shapeDot.source;this.maxZoomDotVisible=Math.min(this.canvasRect.size.x/t.width,this.canvasRect.size.y/t.height)}createLines(){const t=this.booth,e=[],i=[],a=x&&this.optimizationLevel()>=3?1:3;if(this.exh.length){const s=t.exhibitors.filter(o=>o.order===0),r=t.exhibitors.filter(o=>o.order);if(s.length>0)e.push(...s.map(o=>o.name));else if(c.onlyFeaturedExhibitors)e.push(...t.exhibitors.filter(o=>o.featured).map(o=>o.name));else if(r.length>0){e.push(...r.map(m=>m.name));const o=t.exhibitors.filter(m=>m.order===void 0);o.length>0&&e.push(S("and {{moreCount}} more",{moreCount:o.length}))}else t.exhibitors.length>a?e.push(`${t.exhibitors.length} ${c.exhibitorTermPlural}`):e.push(...t.exhibitors.map(o=>o.name));i.push(t.title||t.name)}else{const s=!!t.exhibitors.length;e.push(t.title||t.name),t.onHold?i.push(S("On Hold")):t.reserved?i.push(S("Reserved")):s||i.push(...t.exhibitors.map(r=>r.name).sort((r,o)=>r>o?1:-1)),t.size&&i.push(t.size.indexOf("/")>-1?t.size.substring(0,t.size.indexOf("/")).trim():t.size),t.price&&t.price!=="0"&&!f.previewMode&&i.push(t.price)}f.rtl&&e.forEach((s,r)=>{(s.endsWith(".")||s.endsWith("!")||s.endsWith("?"))&&(e[r]=e[r]+"\u200F"),rt(s)&&(e[r]=e[r]+" ")}),this.lines=[e,i]}calculateFontSizeFactors(){const t=this.lines[0];let e;const i=this.canvasRect,a=[],s=[],r=this.prefixes.slice(0,this.exh.length?this.prefixes.length:this.prefixes.length-1),{main:o,details:m}=this.exh.length?getExhibitorLabelWeights():getBoothLabelWeights();for(const{fontSize:l,short:u}of r){const p=l*devicePixelRatio,L=.9*l*devicePixelRatio,d=_(p,o),T=_(L,m),O=c.hideExhibitorBoothNumber||u;let w,A,v,g;if(this.exh.length)e=u?[]:this.lines[1],v=Math.max(...t.map(h=>this.measureText(h,d).width),...e.map(h=>this.measureText(h,T).width)),w=Math.max(...t.map(h=>this.exh.length?this.measureText(F(h),d).width:this.measureText(F(h),d).width+3+3),...e.map(h=>this.measureText(F(h),T).width)),g=p*t.length+L*e.length+devicePixelRatio*(t.length+e.length)+3,A=O?g/t.length:null;else{const h=t[0].replace(/[0-9]/g,"3").replace(/[A-Z]/g,"A"),N=4;v=this.measureText(h,d).width+3+3,g=p+N}const P=i.size.x/(w||v),C=i.size.y/(A||g),E=Math.min(P,C);a.push({scaleFactor:E,value:p,lines:[]}),O||s.push({scaleFactor:E,value:L,lines:[]})}if(!this.exh.length){const l=a[a.length-1],u=this.prefixes.find(p=>p.name===y);u&&(a.push({scaleFactor:l.scaleFactor/1.8,value:u.fontSize*devicePixelRatio,lines:[]}),s.push({scaleFactor:l.scaleFactor/1.8,value:u.fontSize*(x?1:.9)*devicePixelRatio,lines:[]}))}const R=q();this.fontUrls=[getFontUrlByWeight(o,R),getFontUrlByWeight(m,R)],this.minZoomDotVisible=getMinZoomFactorForDot(a.map(l=>l.scaleFactor)),this.fontSizes=[a,s]}calcArea(t,e){return Math.floor(Math.max(0,t)*Math.max(0,e)/1e3)}optimizationLevel(){return Math.min(c.viewOptimizationLevel?c.viewOptimizationLevel:Math.floor(this.calcArea(this.canvasRect.size.x,this.canvasRect.size.y)/5e3),3)}measureText(t,e){return I.font=e,I.measureText(t)}}
@@ -1,4 +1,4 @@
1
- import type { LayerDef } from '@expofp/renderer';
1
+ import { type LayerDef } from '@expofp/renderer';
2
2
  import type { Booth } from '../../../../store/BoothStore';
3
3
  export declare const BOOTHS_CHUNK_SIZE = 350;
4
4
  export default function configBooths(layerID: string, booths: Booth[]): LayerDef;
@@ -1 +1 @@
1
- import{Rect as A}from"@expofp/geometry";import C from"debug";import{SEPARATOR as I}from"../../../../constants";import{createImageDef as E}from"../../../../engine/defs";import{flipImageDef as T,isInnerInsideOuter as U,rotateImageDef as _}from"../../../../engine/utils/rotation";import{boothStore as y,uiState as z}from"../../../../store";import K from"../../../../tools/settings";import{loadBlobsInBatchesById as M}from"../../../../utils/loadImagesInBatches";import{clearHoveredBooth as Z,hoverBooth as j,rememberBoothShapes as q,selectBooth as F}from"../../pointer";import{createLogoPreparer as G}from"./booth-logos";import J from"./config-booth-bg";import Q from"./config-booth-bookmark";import V from"./config-booth-border";import X from"./config-booth-labels";import Y from"./config-booth-labels-special";import{registerLayerImages as oo}from"./layer-images";import{createBoothImg as eo,getImageLayerName as to,mapBoothsLogos as ro}from"./loadBoothsImages";const k=C("efp:booth-logos");export const BOOTHS_CHUNK_SIZE=350;export default function no($,D){return(l=>{const i=$,d=[],m=[],p=[],g=[],b=[],u=to(i),B={name:u,children:[]};for(const o of l){const s=J(o)?.getShape();s&&(d.push(...s),q(o,s));const a=X(o)?.getShape();a&&m.push(...a);const c=Y(o)?.getShape();if(c&&p.push(...c),!K.borderless){const e=V(o)?.getShape();e&&g.push(e)}const h=Q(o)?.getShape();h&&b.push(h)}const R=m.filter(o=>o.lines),x=p.filter(o=>o.lines),O=m.filter(o=>o.source),P=p.filter(o=>o.source);if(!z.hideLogoInBooth){const o=ro(l);oo(u,async()=>{const s=await M(o,BOOTHS_CHUNK_SIZE),a=[],c=G(),h=await Promise.all([...s].map(async([e,t])=>{const n=y.boothById.get(e);return[e,n,n?await c(n,t):null]}));for(const[e,t,n]of h){if(!t){k("dropped a logo: no booth has id %s",e);continue}if(!n){k("dropped the logo of booth %s: the image could not be read",e);continue}const{blob:w,aspectRatio:v}=n,{bounds:H}=eo(t,v),r=E(w,H),N=t.borderWidth||y.borderWidth,S=t.rect.expand(-N),W=new A(S.center,S.size,t.rotate);r.onRoll=U(r.bounds,W)?({roll:f})=>_(r,f)?[r]:void 0:({roll:f})=>T(r,f)?[r]:void 0,t.shapes.push(r),a.push(r)}return{layer:B,children:a}})}let L=[];if(l.length){const o=i+I;L=[{name:`${o}boothBackground`,children:d,onPointerMove:j,onPointerOut:Z,onClick:F},{name:`${o}labels`,children:R},{name:`${o}specialLabels`,children:x},{name:`${o}dots`,children:O},{name:`${o}specialDots`,children:P},B,{name:`${o}boothsBookmark`,children:b},{name:`${i}${I}boothBorder`,children:g}]}return{name:i,children:L}})(D)}
1
+ import{Rect as C}from"@expofp/geometry";import{update as E}from"@expofp/renderer";import G from"debug";import{reaction as M}from"mobx";import{SEPARATOR as s}from"../../../../constants";import{createImageDef as T}from"../../../../engine/defs";import{flipImageDef as U,isInnerInsideOuter as _,rotateImageDef as z}from"../../../../engine/utils/rotation";import{boothStore as $,layersStore as K,uiState as Z}from"../../../../store";import j from"../../../../tools/settings";import{loadBlobsInBatchesById as q}from"../../../../utils/loadImagesInBatches";import{clearHoveredBooth as F,hoverBooth as J,rememberBoothShapes as Q,selectBooth as V}from"../../pointer";import{createLogoPreparer as X}from"./booth-logos";import Y from"./config-booth-bg";import oo from"./config-booth-bookmark";import eo from"./config-booth-border";import to,{isDirectionsMode as ro}from"./config-booth-labels";import no from"./config-booth-labels-special";import{registerLayerImages as so}from"./layer-images";import{createBoothImg as ao,getImageLayerName as io,mapBoothsLogos as co}from"./loadBoothsImages";const k=G("efp:booth-logos");export const BOOTHS_CHUNK_SIZE=350;export default function lo(D,R){return(h=>{const e=D,g=[],p=[],d=[],u=[],B=[],L=io(e),S={name:L,children:[]};for(const o of h){const i=Y(o)?.getShape();i&&(g.push(...i),Q(o,i));const c=to(o)?.getShape();c&&p.push(...c);const l=no(o)?.getShape();if(l&&d.push(...l),!j.borderless){const t=eo(o)?.getShape();t&&u.push(t)}const m=oo(o)?.getShape();m&&B.push(m)}const x=p.filter(o=>o.lines),O=d.filter(o=>o.lines),P=p.filter(o=>o.source),w=d.filter(o=>o.source);if(!Z.hideLogoInBooth){const o=co(h);so(L,async()=>{const i=await q(o,BOOTHS_CHUNK_SIZE),c=[],l=X(),m=await Promise.all([...i].map(async([t,r])=>{const a=$.boothById.get(t);return[t,a,a?await l(a,r):null]}));for(const[t,r,a]of m){if(!r){k("dropped a logo: no booth has id %s",t);continue}if(!a){k("dropped the logo of booth %s: the image could not be read",t);continue}const{blob:v,aspectRatio:H}=a,{bounds:N}=ao(r,H),n=T(v,N),W=r.borderWidth||$.borderWidth,I=r.rect.expand(-W),A=new C(I.center,I.size,r.rotate);n.onRoll=_(n.bounds,A)?({roll:b})=>z(n,b)?[n]:void 0:({roll:b})=>U(n,b)?[n]:void 0,r.shapes.push(n),c.push(n)}return{layer:S,children:c}})}const f={name:`${e}${s}labelGroup`,children:[{name:`${e}${s}labels`,children:x},{name:`${e}${s}specialLabels`,children:O},{name:`${e}${s}dots`,children:P},{name:`${e}${s}specialDots`,children:w}]};M(()=>K.layersLoaded&&ro(),o=>{f.dim=o?0:void 0,E(f)},{fireImmediately:!0});let y=[];if(h.length){const o=e+s;y=[{name:`${o}boothBackground`,children:g,onPointerMove:J,onPointerOut:F,onClick:V},f,S,{name:`${o}boothsBookmark`,children:B},{name:`${e}${s}boothBorder`,children:u}]}return{name:e,children:y}})(R)}
@@ -1,5 +1,5 @@
1
- import { SceneDef } from '@expofp/renderer';
2
- import { FloorPlanMarkerEvent } from '../../../../types';
1
+ import { type SceneDef } from '@expofp/renderer';
2
+ import { type FloorPlanMarkerEvent } from '../../../../types';
3
3
  export declare const MARKER_LAYER_NAME = "markers";
4
4
  /** What {@link configMarkers} needs: the scene whose root layers hold the marker layer. */
5
5
  export interface MarkerOptions {
@@ -1 +1 @@
1
- import{Box as O}from"@expofp/geometry";import{update as v}from"@expofp/renderer";import{reaction as I}from"mobx";import{getBounds as w}from"../../../../engine/canvases";import{createImageDef as E}from"../../../../engine/defs";import u,{layersStore as C}from"../../../../store";import{setMarkerResolver as R}from"../../pointer";import{createImageCanvas as P}from"./canvases";const L="_selected";export const MARKER_LAYER_NAME="markers";function T(o,f){const{center:c,rotation:r}=o.bounds,{width:i,height:s}=o.source;return o.bounds=w(c.x,c.y,i,s,f,r),[o]}function W(o){B=o}export function configMarkers(o){const{scene:f}=o,c=[],r=new Map,i=new Map;let s=[];const a=f.rootLayer.children.find(e=>e.name===MARKER_LAYER_NAME);a.onScale=({pixelSize:e})=>W(e),R(markerAt),v(a);async function g(e){const n=[];e.forEach(m=>{const{name:t,content:d,width:l,height:k,scale:y}=m;if(r.has(t))return;const h=new Image,M=new Promise((S,D)=>{h.onload=()=>{r.set(t,{img:h,width:l,height:k,scale:y}),S()},h.onerror=b=>{D(b)}});n.push(M),h.src=d,h.crossOrigin="anonymous"}),await Promise.all(n)}const z=e=>{e.onScale=({pixelSize:n})=>T(e,n)},A=e=>{e.onRoll=({roll:n})=>{if(n!==e.bounds.rotation)return e.bounds.rotate(n-e.bounds.rotation,e.bounds),[e]}};function _(){const e=u.routeStore.markersData.markers;if(!e.length)return;s=[];const n=1,m=0;e.forEach(t=>{const d=r.get(t.icon);if(!d)return;const l=d.scale||window.devicePixelRatio,k=t.icon;if(!i.has(k)){const x=P(d.img,d.width,d.height,l);i.set(k,x)}const y=i.get(k),h=r.get(t.selectedIcon),M=t.selectedIcon;if(!i.has(M)){const x=P(h.img,h.width,h.height,l);i.set(M,x)}const S=i.get(M),D=C.findLayer(t.z)?.visible??!0,b=w(t.x,t.y,y.width,y.height,n,m),F=w(t.x,t.y,S.width,S.height,n,m);let p;switch(t.position){case"lefttop":p=[0,0];break;case"centertop":p=[.5,0];break;case"centerbottom":p=[.5,1];break;default:p=[.5,.5]}const H={...E(y,b,{hidden:!D,origin:p}),id:t.id,scale:l},N={...E(S,F,{hidden:!(D&&t.active),origin:p}),id:`${t.id}${L}`,scale:l};s.push(H,N)}),a.children=s,s.forEach(t=>{z(t),A(t)})}function $(){a.children=[],s=[]}function K(){const e=u.routeStore.markersData.markers;e.length&&e.forEach(n=>{const m=s.find(l=>l.id===n.id),t=s.find(l=>l.id===`${n.id}${L}`);if(!m)return;const d=C.findLayer(n.z)?.visible??!0;n.active?(m.hidden=!0,t.hidden=!(d&&n.active)):(m.hidden=!d,t.hidden=!0)})}return c.push(I(()=>[u.routeStore.selectedMarkers,u.layerStore.visible],()=>{if(!u.routeStore.markersData.markers.length){$(),v(a);return}K(),v(...s)})),c.push(I(()=>u.routeStore.markersData.markers,()=>{g(u.routeStore.markersData.icons).then(()=>{_(),v(a)})},{fireImmediately:!0})),function(){c.forEach(n=>n()),c.length=0,a.onScale=void 0,R(),v(a)}}export function markerAt(o,f){return getMarkerFromClick(o,f,B)}export function getMarkerFromClick(o,f,c){for(const r of u.routeStore.markersData.markers){const i=u.routeStore.markersData.icons.find(g=>g.name===r.icon);if(!i)continue;const s=i.width*c*devicePixelRatio,a=i.height*c*devicePixelRatio;if(Y(o,f,r.x,r.y,s,a)){const g=u.layerStore.findLayer(r.z);if(!g||g&&g.visible)return r}}return null}function Y(o,f,c,r,i,s){return O.fromCenter({x:c,y:r},{x:2*i,y:2*s}).containsPoint({x:o,y:f})}let B=1;
1
+ import{Box as K}from"@expofp/geometry";import{update as v}from"@expofp/renderer";import{reaction as I}from"mobx";import{getBounds as y}from"../../../../engine/canvases";import{createImageDef as E}from"../../../../engine/defs";import l,{layersStore as R,uiState as N}from"../../../../store";import{setMarkerResolver as P}from"../../pointer";import{createImageCanvas as O}from"./canvases";const C="_selected";export const MARKER_LAYER_NAME="markers";function T(r,f){const{center:c,rotation:o,elevation:d}=r.bounds,{width:i,height:s}=r.source;return r.bounds=y(c.x,c.y,i,s,f,o,d),[r]}function V(r){L=r}export function configMarkers(r){const{scene:f}=r,c=[],o=new Map,d=new Map;let i=[];const s=f.rootLayer.children.find(e=>e.name===MARKER_LAYER_NAME);s.onScale=({pixelSize:e})=>V(e),P(markerAt),v(s);async function p(e){const n=[];e.forEach(u=>{const{name:a,content:t,width:h,height:D,scale:g}=u;if(o.has(a))return;const m=new Image,S=new Promise((M,b)=>{m.onload=()=>{o.set(a,{img:m,width:h,height:D,scale:g}),M()},m.onerror=x=>{b(x)}});n.push(S),m.src=t,m.crossOrigin="anonymous"}),await Promise.all(n)}const B=e=>{e.onScale=({pixelSize:n})=>T(e,n)},z=e=>{e.screenSpace||(e.onRoll=({roll:n})=>{if(n!==e.bounds.rotation)return e.bounds.rotate(n-e.bounds.rotation,e.bounds),[e]})};function w(e,n,u){const a=d.get(e);if(a)return a;const t=O(n.img,n.width,n.height,u);return d.set(e,t),t}function A(){const e=l.routeStore.markersData.markers;if(!e.length)return;i=[];const n=1,u=0,a=N.is3DView;e.forEach(t=>{const h=o.get(t.icon);if(!h)return;const D=o.get(t.selectedIcon);if(!D)return;const g=h.scale||window.devicePixelRatio,m=w(t.icon,h,g),S=w(t.selectedIcon,D,g),M=R.findLayer(t.z)?.visible??!0,b=y(t.x,t.y,m.width,m.height,n,u),x=y(t.x,t.y,S.width,S.height,n,u);let k;switch(t.position){case"lefttop":k=[0,0];break;case"centertop":k=[.5,0];break;case"centerbottom":k=[.5,1];break;default:k=[.5,.5]}const F={...E(m,b,{hidden:!M,origin:k}),id:t.id,scale:g,screenSpace:a},H={...E(S,x,{hidden:!(M&&t.active),origin:k}),id:`${t.id}${C}`,scale:g,screenSpace:a};i.push(F,H)}),s.children=i,i.forEach(t=>{B(t),z(t)})}function _(){s.children=[],i=[]}function $(){const e=l.routeStore.markersData.markers;e.length&&e.forEach(n=>{const u=i.find(h=>h.id===n.id),a=i.find(h=>h.id===`${n.id}${C}`);if(!u||!a)return;const t=R.findLayer(n.z)?.visible??!0;n.active?(u.hidden=!0,a.hidden=!(t&&n.active)):(u.hidden=!t,a.hidden=!0)})}return c.push(I(()=>[l.routeStore.selectedMarkers,l.layerStore.visible],()=>{if(!l.routeStore.markersData.markers.length){_(),v(s);return}$(),v(...i)})),c.push(I(()=>l.routeStore.markersData.markers,()=>{p(l.routeStore.markersData.icons).then(()=>{A(),v(s)})},{fireImmediately:!0})),function(){c.forEach(n=>n()),c.length=0,s.onScale=void 0,P(),v(s)}}export function markerAt(r,f){return getMarkerFromClick(r,f,L)}export function getMarkerFromClick(r,f,c){for(const o of l.routeStore.markersData.markers){const d=l.routeStore.markersData.icons.find(p=>p.name===o.icon);if(!d)continue;const i=d.width*c*devicePixelRatio,s=d.height*c*devicePixelRatio;if(W(r,f,o.x,o.y,i,s)){const p=l.layerStore.findLayer(o.z);if(!p||p&&p.visible)return o}}return null}function W(r,f,c,o,d,i){return K.fromCenter({x:c,y:o},{x:2*d,y:2*i}).containsPoint({x:r,y:f})}let L=1;
@@ -1 +1 @@
1
- import{jsx as y,jsxs as H}from"react/jsx-runtime";import"./Wayfinding.scss";import T from"classnames";import{useObserver as L}from"mobx-react-lite";import{useEffect as R,useMemo as B,useRef as Q,useState as F}from"react";import{DEFAULT_UNITS as X}from"../constants";import q from"../data";import{getLayerSvg as G}from"../data/svg";import l,{boothStore as I,exhibitorStore as k,uiState as e}from"../store";import{BoothBase as S,RegularBooth as D}from"../store/BoothStore";import{Route as v}from"../store/RouteStore";import P from"../tools/settings";import{calcSpeed as J}from"../utils/calcSpeed";import{calcTravelTime as Y}from"../utils/calcTravelTime";import{t as w}from"../utils/i18n";import{CURRENT_POSITION_POINT_ID as A,KIOSK_ANCHOR_POINT_ID as Z}from"../wayfinding/adapters";import ee from"./EntityList";import te from"./WayfindingTemplate";function oe(){const M=Q(null),b=B(()=>{const o=l.routeStore.pathLayers;return o.map((i,c)=>{const u=o[c+1],a=i.layer?.basePriority??0,r=u?.layer?.basePriority??0,d=u?r<a?"up":"down":void 0;return{id:i.id,name:i.layer?.shortName,description:i.layer?.description,directionToNext:d}})},[l.routeStore.pathLayers]),[C,E]=F(),[g,_]=F({}),N=o=>{o&&_(i=>({...i,[o.value]:o}))};R(()=>{C||E(b[0])},[l.routeStore.pathLayers,b]),R(()=>{const o=b.find(i=>i.description?.toLowerCase()===l.routeStore.currentRouteLayer?.description?.toLowerCase());o&&E(o)},[l.routeStore.currentRouteLayer,b]),R(()=>{const o=e.selectedRoute;if(!o){e.setIsMultiPointRoute(!1);return}const c=(o.waypoints?.length||0)>0;e.setIsMultiPointRoute(c)},[e.selectedRoute]);const W=()=>{const{from:o,to:i}=e.selectedRoute;return!!(o&&i)},U=()=>e.overlaySize==="full",V=()=>!!(W()&&!U()),O=()=>{const o=e.selectedRoute;return o?(o.waypoints?.length||0)>0?"multi":"simple":"none"};R(()=>{O()==="multi"&&e.selectedRoute},[e.selectedRoute]);const x=B(()=>{const o=[],i=I.booths,c=i.filter(r=>r instanceof D),u=i.filter(r=>!(r instanceof D));let a=[];return k.exhibitors.forEach(r=>{o.push(...r.booths.map(d=>d.id)),a.push(...r.booths.map(d=>({value:d.id.toString(),label:r.name+" - "+d.fullName,exhibitorId:r.id})))}),u.filter(r=>o.indexOf(r.id)===-1).forEach(r=>{a.push({value:r.id.toString(),label:r.fullName})}),a=a.sort((r,d)=>r.label.localeCompare(d.label,void 0,{sensitivity:"base"})),c.filter(r=>o.indexOf(r.id)===-1).forEach(r=>{a.push({value:r.id.toString(),label:r.fullName})}),a},[k.exhibitors.length,I.booths.length]);return R(()=>{const o=e.selectedRoute?.to?.id?.toString(),i=l.routeStore.currentRouteExhibitor;if(!i)return;const c=x.find(u=>u.value===o&&u.exhibitorId===i.id);l.routeStore.currentRouteExhibitor=null,N(c)},[l.routeStore.currentRouteExhibitor,e.selectedRoute?.to?.id,x]),L(()=>{if(O()==="multi")return H("div",{className:T("main-wayfinding",{hidden:e.kiosk&&e.selectedRoute?.from&&e.selectedRoute?.to}),children:[e.routeDescription&&y("div",{className:"efp-wayfinding-description",children:e.routeDescription}),y(ee,{updatedScrollableRef:M})]});const i=e.selectedRoute?.from&&!(e.selectedRoute.from instanceof S)?e.selectedRoute.from:null,c=e.selectedRoute?.to&&!(e.selectedRoute.to instanceof S)?e.selectedRoute.to:null,u=[];i&&u.push({value:i.id,label:i.name}),c&&c.id!==i?.id&&u.push({value:c.id,label:c.name}),u.push(...x);const a=(t,s=!0)=>{const n=t?.value;if(n===A||n===Z)return;const f=I.booths.find(h=>h.id.toString()===n)??null,{from:m,to:p}=e.selectedRoute;N(t),s?l.routeStore.selectRoute(new v(f,p)):l.routeStore.selectRoute(new v(m,f))},r=t=>{const s=[],n=G().getAttribute("units")||X,f=Y(t,J(n));let m=new Date;m.setMinutes(m.getMinutes()+f/60);const p=m.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});return s.push({title:w("Travel time"),text:f<60?"< 1 min":`~ ${Math.round(f/60)} min`},{title:w("Distance"),text:Math.round(t)+` ${n}`},{title:w("Est arrival"),text:p}),s},d=()=>{const{from:t,to:s}=e.selectedRoute;t?.id!==A&&l.routeStore.selectRoute(new v(s,t))},j=e.selectedRoute?.from&&e.selectedRoute?.to&&!l.routeStore.routeLines.length;function K(){const t=e.selectedRoute?.from?.id?.toString(),s=t?g[t]:void 0;return u.find(n=>s?n.value===s.value&&n.label===s.label:n.value===t)}function $(){const t=e.selectedRoute?.to?.id?.toString(),s=t?g[t]:void 0;return u.find(n=>s?n.value===s.value&&n.label===s.label:n.value===t)}const z=!!(!q.hideWayInformation&&P.EXPO!=="bloomberg"&&e.selectedRoute?.from&&e.selectedRoute?.to);return y("div",{className:T("main-wayfinding",{hidden:e.kiosk&&e.selectedRoute?.from&&e.selectedRoute?.to}),children:y(te,{showForm:!V(),showInfo:z,floors:b,currentFloor:C,onClickFloor:t=>{const s=l.routeStore.pathLayers.find(n=>n.id===t.id);s?.layer&&l.layerStore.updateVisibility(s.layer,!0)},routeFound:!j,options:u,getOptionKey:t=>`${t.value}-${t.exhibitorId??""}`,fromValue:K(),toValue:$(),onChangeFrom:t=>a(t,!0),onChangeTo:t=>a(t,!1),onSwitch:d,infoItems:r(l.routeStore.routeDistance),infoAccessible:l.routeStore.onlyAccessible,showAccessible:l.routeStore.showAccessible,onAccessibleCheck:t=>l.routeStore.setOnlyAccessible(t),onClickInfo:()=>l.showOverlay(),routeUrl:e.routeQRCodeUrl,isKiosk:e.kiosk,showDetailsIcon:e.showRouteInstantly,onDetailsIconClick:()=>{const{from:t,to:s}=e.selectedRoute||{},n=(s instanceof S?s:null)??(t instanceof S?t:null);if(n){const f=n.id.toString(),m=g[f]??u.find(h=>h.value===f),p=m?.exhibitorId!=null?n.exhibitors.find(h=>h.id===m.exhibitorId):n.exhibitors.find(h=>m?.label.includes(h.name));e.details=p||n}}})})})}function re(){return L(()=>P.wayfinding&&!e.menu&&e.selectedRoute&&e.list.type!=="route-planner"&&y(oe,{}))}export default re;
1
+ import{jsx as y,jsxs as H}from"react/jsx-runtime";import"./Wayfinding.scss";import L from"classnames";import{useObserver as O}from"mobx-react-lite";import{useEffect as R,useMemo as B,useRef as Q,useState as F}from"react";import{DEFAULT_UNITS as X}from"../constants";import q from"../data";import{getLayerSvg as G}from"../data/svg";import l,{boothStore as w,exhibitorStore as k,uiState as e}from"../store";import{BoothBase as S,RegularBooth as D}from"../store/BoothStore";import{Route as I}from"../store/RouteStore";import P from"../tools/settings";import{calcSpeed as J}from"../utils/calcSpeed";import{calcTravelTime as Y}from"../utils/calcTravelTime";import{t as v}from"../utils/i18n";import{CURRENT_POSITION_POINT_ID as A,KIOSK_ANCHOR_POINT_ID as Z}from"../wayfinding/adapters";import ee from"./EntityList";import te from"./WayfindingTemplate";function oe(){const M=Q(null),b=B(()=>{const o=l.routeStore.pathLayers;return o.map((i,c)=>{const u=o[c+1],a=i.layer?.basePriority??0,r=u?.layer?.basePriority??0,d=u?r<a?"up":"down":void 0;return{id:i.id,name:i.layer?.shortName,description:i.layer?.description,directionToNext:d}})},[l.routeStore.pathLayers]),[C,E]=F(),[g,_]=F({}),N=o=>{o&&_(i=>({...i,[o.value]:o}))};R(()=>{C||E(b[0])},[l.routeStore.pathLayers,b]),R(()=>{const o=b.find(i=>i.description?.toLowerCase()===l.routeStore.currentRouteLayer?.description?.toLowerCase());o&&E(o)},[l.routeStore.currentRouteLayer,b]),R(()=>{const o=e.selectedRoute;if(!o){e.setIsMultiPointRoute(!1);return}const c=(o.waypoints?.length||0)>0;e.setIsMultiPointRoute(c)},[e.selectedRoute]);const W=()=>{const{from:o,to:i}=e.selectedRoute;return!!(o&&i)},U=()=>e.overlaySize==="full",V=()=>!!(W()&&!U()),T=()=>{const o=e.selectedRoute;return o?(o.waypoints?.length||0)>0?"multi":"simple":"none"};R(()=>{T()==="multi"&&e.selectedRoute},[e.selectedRoute]);const x=B(()=>{const o=new Set,i=w.booths,c=i.filter(r=>r instanceof D),u=i.filter(r=>!(r instanceof D));let a=[];return k.exhibitors.forEach(r=>{for(const d of r.booths)o.add(d.id);a.push(...r.booths.map(d=>({value:d.id.toString(),label:r.name+" - "+d.fullName,exhibitorId:r.id})))}),u.filter(r=>!o.has(r.id)).forEach(r=>{a.push({value:r.id.toString(),label:r.fullName})}),a=a.sort((r,d)=>r.label.localeCompare(d.label,void 0,{sensitivity:"base"})),c.filter(r=>!o.has(r.id)).forEach(r=>{a.push({value:r.id.toString(),label:r.fullName})}),a},[k.exhibitors.length,w.booths.length]);return R(()=>{const o=e.selectedRoute?.to?.id?.toString(),i=l.routeStore.currentRouteExhibitor;if(!i)return;const c=x.find(u=>u.value===o&&u.exhibitorId===i.id);l.routeStore.currentRouteExhibitor=null,N(c)},[l.routeStore.currentRouteExhibitor,e.selectedRoute?.to?.id,x]),O(()=>{if(T()==="multi")return H("div",{className:L("main-wayfinding",{hidden:e.kiosk&&e.selectedRoute?.from&&e.selectedRoute?.to}),children:[e.routeDescription&&y("div",{className:"efp-wayfinding-description",children:e.routeDescription}),y(ee,{updatedScrollableRef:M})]});const i=e.selectedRoute?.from&&!(e.selectedRoute.from instanceof S)?e.selectedRoute.from:null,c=e.selectedRoute?.to&&!(e.selectedRoute.to instanceof S)?e.selectedRoute.to:null,u=[];i&&u.push({value:i.id,label:i.name}),c&&c.id!==i?.id&&u.push({value:c.id,label:c.name}),u.push(...x);const a=(t,s=!0)=>{const n=t?.value;if(n===A||n===Z)return;const f=w.booths.find(h=>h.id.toString()===n)??null,{from:m,to:p}=e.selectedRoute;N(t),s?l.routeStore.selectRoute(new I(f,p)):l.routeStore.selectRoute(new I(m,f))},r=t=>{const s=[],n=G().getAttribute("units")||X,f=Y(t,J(n));let m=new Date;m.setMinutes(m.getMinutes()+f/60);const p=m.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});return s.push({title:v("Travel time"),text:f<60?"< 1 min":`~ ${Math.round(f/60)} min`},{title:v("Distance"),text:Math.round(t)+` ${n}`},{title:v("Est arrival"),text:p}),s},d=()=>{const{from:t,to:s}=e.selectedRoute;t?.id!==A&&l.routeStore.selectRoute(new I(s,t))},j=e.selectedRoute?.from&&e.selectedRoute?.to&&!l.routeStore.routeLines.length;function K(){const t=e.selectedRoute?.from?.id?.toString(),s=t?g[t]:void 0;return u.find(n=>s?n.value===s.value&&n.label===s.label:n.value===t)}function $(){const t=e.selectedRoute?.to?.id?.toString(),s=t?g[t]:void 0;return u.find(n=>s?n.value===s.value&&n.label===s.label:n.value===t)}const z=!!(!q.hideWayInformation&&P.EXPO!=="bloomberg"&&e.selectedRoute?.from&&e.selectedRoute?.to);return y("div",{className:L("main-wayfinding",{hidden:e.kiosk&&e.selectedRoute?.from&&e.selectedRoute?.to}),children:y(te,{showForm:!V(),showInfo:z,floors:b,currentFloor:C,onClickFloor:t=>{const s=l.routeStore.pathLayers.find(n=>n.id===t.id);s?.layer&&l.layerStore.updateVisibility(s.layer,!0)},routeFound:!j,options:u,getOptionKey:t=>`${t.value}-${t.exhibitorId??""}`,fromValue:K(),toValue:$(),onChangeFrom:t=>a(t,!0),onChangeTo:t=>a(t,!1),onSwitch:d,infoItems:r(l.routeStore.routeDistance),infoAccessible:l.routeStore.onlyAccessible,showAccessible:l.routeStore.showAccessible,onAccessibleCheck:t=>l.routeStore.setOnlyAccessible(t),onClickInfo:()=>l.showOverlay(),routeUrl:e.routeQRCodeUrl,isKiosk:e.kiosk,showDetailsIcon:e.showRouteInstantly,onDetailsIconClick:()=>{const{from:t,to:s}=e.selectedRoute||{},n=(s instanceof S?s:null)??(t instanceof S?t:null);if(n){const f=n.id.toString(),m=g[f]??u.find(h=>h.value===f),p=m?.exhibitorId!=null?n.exhibitors.find(h=>h.id===m.exhibitorId):n.exhibitors.find(h=>m?.label.includes(h.name));e.details=p||n}}})})})}function re(){return O(()=>P.wayfinding&&!e.menu&&e.selectedRoute&&e.list.type!=="route-planner"&&y(oe,{}))}export default re;
@@ -1,5 +1,5 @@
1
1
  import { Rect } from '@expofp/geometry';
2
2
  export declare function createCircleCanvas(radius: number, color: string): HTMLCanvasElement;
3
3
  export declare function createBookmarkCanvas(maxSizePx: number, pixelRatio: number): HTMLCanvasElement;
4
- export declare function getBounds(x: number, y: number, width: number, height: number, scale?: number, rotate?: number): Rect;
4
+ export declare function getBounds(x: number, y: number, width: number, height: number, scale?: number, rotate?: number, elevation?: number): Rect;
5
5
  //# sourceMappingURL=canvases.d.ts.map
@@ -1 +1 @@
1
- import{Rect as d}from"@expofp/geometry";const r=new Map;export function createCircleCanvas(i,n){const c=n.toUpperCase();if(!r.has(c)){const t=document.createElement("canvas"),a=i*2*devicePixelRatio+1*2;t.width=a,t.height=a;const s=t.getContext("2d");s.fillStyle=n,s.beginPath(),s.arc(a/2,a/2,i*devicePixelRatio,0,2*Math.PI),s.fill(),r.set(c,t)}return r.get(c)}const h=new Map;export function createBookmarkCanvas(i,n){const c=i;if(h.has(c))return h.get(c);const t=i,o=t*1.4,a=Math.ceil(t*n),s=Math.ceil(o*n),l=document.createElement("canvas");l.width=a,l.height=s;const e=l.getContext("2d");return e.scale(n,n),e.fillStyle="#fdbf2b",e.strokeStyle="#fff",e.lineWidth=4/n,e.beginPath(),e.moveTo(0,0),e.lineTo(0,o),e.lineTo(t/2,o-t/2),e.lineTo(t,o),e.lineTo(t,0),e.lineTo(0,0),e.fill(),e.stroke(),h.set(c,l),l}export function getBounds(i,n,c,t,o=1,a){const s=c*o,l=t*o;return new d({x:i,y:n},{x:s,y:l},a)}
1
+ import{Rect as d}from"@expofp/geometry";const r=new Map;export function createCircleCanvas(i,n){const c=n.toUpperCase();if(!r.has(c)){const e=document.createElement("canvas"),a=i*2*devicePixelRatio+1*2;e.width=a,e.height=a;const s=e.getContext("2d");s.fillStyle=n,s.beginPath(),s.arc(a/2,a/2,i*devicePixelRatio,0,2*Math.PI),s.fill(),r.set(c,e)}return r.get(c)}const h=new Map;export function createBookmarkCanvas(i,n){const c=i;if(h.has(c))return h.get(c);const e=i,o=e*1.4,a=Math.ceil(e*n),s=Math.ceil(o*n),l=document.createElement("canvas");l.width=a,l.height=s;const t=l.getContext("2d");return t.scale(n,n),t.fillStyle="#fdbf2b",t.strokeStyle="#fff",t.lineWidth=4/n,t.beginPath(),t.moveTo(0,0),t.lineTo(0,o),t.lineTo(e/2,o-e/2),t.lineTo(e,o),t.lineTo(e,0),t.lineTo(0,0),t.fill(),t.stroke(),h.set(c,l),l}export function getBounds(i,n,c,e,o=1,a,s){const l=c*o,t=e*o;return new d({x:i,y:n},{x:l,y:t},a,s)}
@@ -18,12 +18,16 @@ export interface FontSizeFactor {
18
18
  export declare function rectToShapeDef(rect: SVGRectElement, color?: string): ShapeDef;
19
19
  export declare function meshToShapeDef(mesh: MeshType, color: string): ShapeDef;
20
20
  export declare function createShapeDef(shape: Box | Rect | Polygon | Mesh, color?: string): ShapeDef;
21
- export declare function createImageDef(source: ImageSource, bounds: Rect, options?: SharedDef & {
21
+ export declare function createImageDef<Source extends ImageSource>(source: Source, bounds: Rect, options?: SharedDef & {
22
22
  origin?: [number, number];
23
- }): ImageDef;
23
+ }): ImageDef & {
24
+ source: Source;
25
+ };
24
26
  export declare function createTextDef(textLines: TextLineDef[], bounds: Rect, padding: [number, number], alignment: TextAlignment, options?: SharedDef): TextDef;
25
27
  export declare function createTextDefLines(textLines: TextLines, color: string, fontSize: number, fontUrl?: [string | undefined, string | undefined]): TextLineDef[];
26
28
  export declare function createLayerDef(name: string, children: RenderableDefCollection, options?: SharedDef): LayerDef;
27
29
  export declare function createSceneDef(layers: LayerDef[], viewboxRect: Box | SVGRectElement, background?: string): SceneDef;
28
- export declare function createShapeDot(rect: Rect, color?: string, radius?: number): ImageDef;
30
+ export declare function createShapeDot(rect: Rect, color?: string, radius?: number): ImageDef & {
31
+ source: HTMLCanvasElement;
32
+ };
29
33
  //# sourceMappingURL=defs.d.ts.map
@@ -1 +1 @@
1
- import{angleDiff as l,Rect as k}from"@expofp/geometry";import{getBounds as w}from"./canvases";export function updateLinesScale(t,o,n){let e=!1;return t.forEach((r,i)=>{let s=0;n[i].forEach(({value:a,scaleFactor:c})=>{o<c&&(s=a)}),r.fontSize!==s*o&&(e=!0),r.fontSize=s*o}),e}export function rotateTextDefByQuarters(t,o){const{center:n,size:e,rotation:r,elevation:i}=t.bounds,s=o%2!==0;return t.bounds.set(n.x,n.y,s?e.y:e.x,s?e.x:e.y,r+o*Math.PI/2,i),t}export function rotateRectByQuarters(t,o){const{size:n,center:e,rotation:r,elevation:i}=t,s=o%2!==0?{x:n.y,y:n.x}:n;return new k(e,s,r+o*Math.PI/2,i)}export function getQuarterTurns(t,o){if(!Number.isFinite(t)||!Number.isFinite(o))return 0;const n=l(t,o);return Math.abs(n)<=Math.PI/4?0:Math.round(n/(Math.PI/2))}export function shouldFlip(t,o){const n=l(t,o),e=Math.PI/2;return Math.abs(n)>e+.1}export function flipAngle(t){return(t+Math.PI+Math.PI)%(2*Math.PI)-Math.PI}export function getClampedBoundsCanvas(t,o,n,e){const r=o.width,i=o.height,s=t.size,a=t.center,c=t.rotation,d=s.x/r,M=s.x-n*2,b=(s.y-n*2)*.8,y=0,g=M/r,I=b/i,S=Math.min(g,I,d);e=Math.min(Math.max(e,y),S);const P=r*e,z=i*e,h=Math.sin(c),f=Math.cos(c),u=s.x/2-n,x=-s.y/2+n,B=a.x+u*f-x*h,R=a.y+u*h+x*f,m=P/2,p=-z/2,W=m*f-p*h,H=m*h+p*f,X=B-W,Y=R-H;return w(X,Y,r,i,e,c)}export function getRollValue(t){if(!t)return!1;if(!Number.isInteger(+t)||+t!=1&&+t!=0)throw new Error("Map roll: setting value is incorrect");return!!+t}
1
+ import{angleDiff as p,Rect as k}from"@expofp/geometry";import{getBounds as w}from"./canvases";export function updateLinesScale(t,o,n){let e=!1;return t.forEach((r,i)=>{let s=0;n[i].forEach(({value:a,scaleFactor:c})=>{o<c&&(s=a)}),r.fontSize!==s*o&&(e=!0),r.fontSize=s*o}),e}export function rotateTextDefByQuarters(t,o){const{center:n,size:e,rotation:r,elevation:i}=t.bounds,s=o%2!==0;return t.bounds.set(n.x,n.y,s?e.y:e.x,s?e.x:e.y,r+o*Math.PI/2,i),t}export function rotateRectByQuarters(t,o){const{size:n,center:e,rotation:r,elevation:i}=t,s=o%2!==0?{x:n.y,y:n.x}:n;return new k(e,s,r+o*Math.PI/2,i)}export function getQuarterTurns(t,o){if(!Number.isFinite(t)||!Number.isFinite(o))return 0;const n=p(t,o);return Math.abs(n)<=Math.PI/4?0:Math.round(n/(Math.PI/2))}export function shouldFlip(t,o){const n=p(t,o),e=Math.PI/2;return Math.abs(n)>e+.1}export function flipAngle(t){return(t+Math.PI+Math.PI)%(2*Math.PI)-Math.PI}export function getClampedBoundsCanvas(t,o,n,e){const r=o.width,i=o.height,s=t.size,a=t.center,c=t.rotation,d=s.x/r,M=s.x-n*2,b=(s.y-n*2)*.8,y=0,g=M/r,I=b/i,S=Math.min(g,I,d);e=Math.min(Math.max(e,y),S);const P=r*e,z=i*e,h=Math.sin(c),f=Math.cos(c),u=s.x/2-n,x=-s.y/2+n,B=a.x+u*f-x*h,R=a.y+u*h+x*f,l=P/2,m=-z/2,W=l*f-m*h,H=l*h+m*f,X=B-W,Y=R-H;return w(X,Y,r,i,e,c,t.elevation)}export function getRollValue(t){if(!t)return!1;if(!Number.isInteger(+t)||+t!=1&&+t!=0)throw new Error("Map roll: setting value is incorrect");return!!+t}
@@ -372,7 +372,7 @@ export interface Marker extends CurrentPosition {
372
372
  id: string;
373
373
  icon: string;
374
374
  selectedIcon: string;
375
- position: 'centertop' | 'lefttop';
375
+ position: 'centertop' | 'lefttop' | 'centerbottom';
376
376
  active?: boolean;
377
377
  }
378
378
  export interface MarkerIcon {
@@ -1 +1 @@
1
- import{update as d}from"@expofp/renderer";import{createWayfinding as g,resolveWayfindingLayers as S}from"@expofp/wayfinding";import{fpGeo as R}from"../data/fpGeo";import{attachCardinalSnap as v}from"../engine/utils/rotation";import{createCanvasIconProvider as h,createFloorContext as x,createGraphDataSource as k}from"./adapters";import{bindMobxReactions as C}from"./bindMobxReactions";import{createKioskHandler as P}from"./handlers/kioskHandler";import{createYahHandler as W}from"./handlers/yahHandler";let u=null;export function isWayfindingReady(){return u!==null}function b(){if(!u)throw new Error("Wayfinding is not initialized \u2014 call createWayfinding() first.");return u}export function buildRoute(e,n,r){return b().wayfinding.buildRoute(e,n,r)}export function createWayfinding(e){const{scene:n,store:r,canvas:o}=e,c=S(n.rootLayer),{wayfinding:s,dispose:i}=w(r,c,{attachCardinalSnap:v,update:d}),t=c.icons;return t.onClick=f=>M(s,f),t.onPointerMove=f=>y(s,o,f),t.onPointerOut=()=>y(s,o),d(t),()=>{t.onClick=void 0,t.onPointerMove=void 0,t.onPointerOut=void 0,o.current&&(o.current.style.cursor=""),d(t),i()}}function w(e,n,r){const o=k(),c=h({iconMap:e.fp.icons,pixelRatio:devicePixelRatio}),s=x(e.layerStore,e.routeStore),i=g({dataSource:o,renderer:r,iconProvider:c,floorContext:s,layers:n,gpsConfig:R?.properties?.config,onTransitionClick:a=>{a.role==="exit"&&e.layerStore.updateVisibility(a.targetLayer,!0)},onRouteUpdate:(a,p)=>{e.routeStore.updateRoute([...a]),p.isEmpty()||(e.uiState.moveToRect=p)},onRouteDistance:a=>e.routeStore.updateRouteDistance(a)}),t=P({wayfinding:i,kioskIconMap:e.fp.icons}),f=W({wayfinding:i,iconMap:e.fp.icons,pixelRatio:devicePixelRatio,floorContext:s}),m=C({wayfinding:i,kioskHandler:t,yahHandler:f,stores:{routeStore:e.routeStore,uiState:e.uiState,layerStore:e.layerStore}});e.routeStore.showAccessible=o.getLines().some(a=>a.unaccessible);const l={wayfinding:i};return u=l,i.flush(),{wayfinding:i,dispose(){H(l)&&(u=null,e.routeStore.showAccessible=!1),m(),i.destroy()}}}function H(e){return u===e}function M(e,n){e.handleClick([n.def])&&n.stopPropagation()}function y(e,n,r){const o=n.current;if(!o)return;const c=r?e.handleHover([r.def]):!1;o.style.cursor=c?"pointer":""}
1
+ import{update as d}from"@expofp/renderer";import{createWayfinding as S,resolveWayfindingLayers as g}from"@expofp/wayfinding";import{fpGeo as R}from"../data/fpGeo";import{attachCardinalSnap as v}from"../engine/utils/rotation";import{createCanvasIconProvider as h,createFloorContext as x,createGraphDataSource as k}from"./adapters";import{bindMobxReactions as C}from"./bindMobxReactions";import{createKioskHandler as P}from"./handlers/kioskHandler";import{createYahHandler as W}from"./handlers/yahHandler";let u=null;export function isWayfindingReady(){return u!==null}function w(){if(!u)throw new Error("Wayfinding is not initialized \u2014 call createWayfinding() first.");return u}export function buildRoute(e,n,r){return w().wayfinding.buildRoute(e,n,r)}export function createWayfinding(e){const{scene:n,store:r,canvas:o}=e,c=g(n.rootLayer),{wayfinding:s,dispose:t}=b(r,c,{attachCardinalSnap:v,update:d}),i=c.icons;return i.onClick=f=>M(s,f),i.onPointerMove=f=>y(s,o,f),i.onPointerOut=()=>y(s,o),d(i),()=>{i.onClick=void 0,i.onPointerMove=void 0,i.onPointerOut=void 0,o.current&&(o.current.style.cursor=""),d(i),t()}}function b(e,n,r){const o=k(),c=h({iconMap:e.fp.icons,pixelRatio:devicePixelRatio}),s=x(e.layerStore,e.routeStore),t=S({dataSource:o,renderer:r,iconProvider:c,floorContext:s,layers:n,gpsConfig:R?.properties?.config,screenSpaceIcons:e.uiState.is3DView,onTransitionClick:a=>{a.role==="exit"&&e.layerStore.updateVisibility(a.targetLayer,!0)},onRouteUpdate:(a,p)=>{e.routeStore.updateRoute([...a]),p.isEmpty()||(e.uiState.moveToRect=p)},onRouteDistance:a=>e.routeStore.updateRouteDistance(a)}),i=P({wayfinding:t,kioskIconMap:e.fp.icons}),f=W({wayfinding:t,iconMap:e.fp.icons,pixelRatio:devicePixelRatio,floorContext:s}),m=C({wayfinding:t,kioskHandler:i,yahHandler:f,stores:{routeStore:e.routeStore,uiState:e.uiState,layerStore:e.layerStore}});e.routeStore.showAccessible=o.getLines().some(a=>a.unaccessible);const l={wayfinding:t};return u=l,t.flush(),{wayfinding:t,dispose(){H(l)&&(u=null,e.routeStore.showAccessible=!1),m(),t.destroy()}}}function H(e){return u===e}function M(e,n){e.handleClick([n.def])&&n.stopPropagation()}function y(e,n,r){const o=n.current;if(!o)return;const c=r?e.handleHover([r.def]):!1;o.style.cursor=c?"pointer":""}
@@ -1 +1 @@
1
- import{degToRad as l}from"@expofp/geometry";import{createKioskCanvas as f}from"../adapters";const n="kiosk",p=0;export function createKioskHandler({wayfinding:t,kioskIconMap:a}){const s=new Map,u=e=>{const o=e??100,c=s.get(o);if(c)return c;const r=f(a,e);return s.set(o,r),r};return(e,o,c)=>{if(!e){t.setIcon(n,null),t.flush();return}if(c!==p&&e.z&&o&&e.z!==o){t.setIcon(n,null),t.flush();return}t.setIcon(n,{canvas:u(e.iconSizePercent),x:e.x,y:e.y,rotation:l(e.heading??0)}),t.flush()}}
1
+ import{degToRad as l}from"@expofp/geometry";import{createKioskCanvas as f}from"../adapters";const n="kiosk",p=0;export function createKioskHandler({wayfinding:t,kioskIconMap:a}){const s=new Map,u=e=>{const c=e??100,o=s.get(c);if(o)return o;const r=f(a,e);return s.set(c,r),r};return(e,c,o)=>{if(!e){t.setIcon(n,null),t.flush();return}if(o!==p&&e.z&&c&&e.z!==c){t.setIcon(n,null),t.flush();return}t.setIcon(n,{canvas:u(e.iconSizePercent),x:e.x,y:e.y,rotation:l(e.heading??0),screenSpace:!1}),t.flush()}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expofp/floorplan",
3
- "version": "3.38.0",
3
+ "version": "3.39.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/expofp/efp-app.git",
@@ -62,22 +62,22 @@
62
62
  "pmtiles": "^4.4.1",
63
63
  "react-qr-code": "^2.0.9",
64
64
  "react-transition-group": "^4.4.5",
65
- "react-virtuoso": "^4.12.6",
65
+ "react-virtuoso": "^4.18.7",
66
66
  "resize-observer": "^1.0.4",
67
67
  "slugify": "1.6.6",
68
68
  "stats-gl": "^3.6.0",
69
69
  "tslib": "^2.3.0",
70
70
  "uuid": "^9.0.1",
71
71
  "zod": "4.4.3",
72
- "@expofp/config": "3.38.0",
73
- "@expofp/debug": "3.38.0",
74
- "@expofp/geometry": "3.38.0",
75
- "@expofp/renderer": "3.38.0",
76
- "@expofp/resolve": "3.38.0",
77
- "@expofp/schema": "3.38.0",
78
- "@expofp/ui": "3.38.0",
79
- "@expofp/utils": "3.38.0",
80
- "@expofp/wayfinding": "3.38.0"
72
+ "@expofp/config": "3.39.1",
73
+ "@expofp/debug": "3.39.1",
74
+ "@expofp/geometry": "3.39.1",
75
+ "@expofp/renderer": "3.39.1",
76
+ "@expofp/resolve": "3.39.1",
77
+ "@expofp/schema": "3.39.1",
78
+ "@expofp/ui": "3.39.1",
79
+ "@expofp/utils": "3.39.1",
80
+ "@expofp/wayfinding": "3.39.1"
81
81
  },
82
82
  "devDependencies": {
83
83
  "@babel/plugin-proposal-decorators": "^8.0.2",