@expofp/floorplan 3.26.0 → 3.27.0

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 (203) hide show
  1. package/dist/browser/{Button-DI5g1CPS.js → Button-e8P-AcfW.js} +6 -6
  2. package/dist/browser/{CookieConsent-Qws_nQ3N.js → CookieConsent-DT6PZdD-.js} +8 -8
  3. package/dist/browser/{Debug-DTNPNDds.js → Debug-Btnxv9GC.js} +8 -8
  4. package/dist/browser/DebugTools-CH_HoQal.js +1922 -0
  5. package/dist/browser/{Demo-BDZjOBQc.js → Demo-DZoFFss-.js} +10 -10
  6. package/dist/browser/{Free-Cage9TkV.js → Free-DiFQkGSU.js} +10 -10
  7. package/dist/browser/{GalleryContainer-EeLKgziN.js → GalleryContainer-aJ6EZ5I3.js} +11 -11
  8. package/dist/browser/{GpsLoader-CJMX_mJN.js → GpsLoader-Bu9mBOam.js} +34 -34
  9. package/dist/browser/{KioskStore-BSza48xl.js → KioskStore-DUC4jNn0.js} +58 -107
  10. package/dist/browser/{MaplibreAdapter-evVQiVQj.js → MaplibreAdapter-DIlDXt73.js} +2056 -2141
  11. package/dist/browser/{ModalContainer-CTKDfIyR.js → ModalContainer-CVRxdpt2.js} +11 -11
  12. package/dist/browser/{PermissionNotice-O469DuWb.js → PermissionNotice-B5X5RQja.js} +7 -7
  13. package/dist/browser/SetKioskMode-BbDnU98F.js +48 -0
  14. package/dist/browser/{ShowKiosk-DumFiuHU.js → ShowKiosk-B7HfONvN.js} +11 -11
  15. package/dist/browser/{ViewerMenuPanel-ByFemA_T.js → ViewerMenuPanel-CT6kvVUw.js} +17 -17
  16. package/dist/browser/{add-debug-secret-listener-TLumKuSo.js → add-debug-secret-listener-Dvv-Pg0-.js} +1 -1
  17. package/dist/browser/{adopt-global-settings-ghJrZaU5.js → adopt-global-settings-CXzCKJtp.js} +10 -10
  18. package/dist/browser/{boolean-editor-WIpm-pFP.js → boolean-editor-CHMR9ZwP.js} +10 -10
  19. package/dist/browser/{bootIntercom-BR_Ehbyl.js → bootIntercom-DQcGuly8.js} +3 -3
  20. package/dist/browser/bundle.json +77 -65
  21. package/dist/browser/camera-events-BkrzcISl.js +18 -0
  22. package/dist/browser/{classnames-BmlkHMS8.js → classnames-BYuGpzao.js} +2 -2
  23. package/dist/browser/{client-CIHxJZmk.js → client-hxMr1frV.js} +793 -992
  24. package/dist/browser/{components-7lxOhyyi.js → components-DiB2l4Q7.js} +1952 -2013
  25. package/dist/browser/debug-context-CfyAAxAt.js +24315 -0
  26. package/dist/browser/{debug-overlay-B7jCqVlX.js → debug-overlay-PYUvPcx-.js} +11 -11
  27. package/dist/browser/{debug-ui-D1ApG52e.js → debug-ui-BXRAYxv6.js} +7 -7
  28. package/dist/browser/dimming-Dj-1kBgQ.js +1108 -0
  29. package/dist/browser/{dist-C67OkD_4.js → dist-30RVEJTr.js} +7 -7
  30. package/dist/browser/{dist-BrF5yJyj.js → dist-DgGMS59X.js} +6 -6
  31. package/dist/browser/{dist-CnpnDA-V.js → dist-opCvrhNh.js} +3 -3
  32. package/dist/browser/{efp-debug-init-BqEN61Fo.js → efp-debug-init-CYfrcz9M.js} +4 -4
  33. package/dist/browser/{enum-editor-Cy6VeZZd.js → enum-editor-BYO96W3-.js} +5 -5
  34. package/dist/browser/{es5-DyV1fctu.js → es5-Bpzk_wCi.js} +2 -2
  35. package/dist/browser/{event-not-found-BpFVdXz_.js → event-not-found-DEepFxEc.js} +1 -1
  36. package/dist/browser/{exports-C7NzL4lf.js → exports-Bo5VUoiX.js} +1 -1
  37. package/dist/browser/{favicon-BHscWjwp.js → favicon-Bf88cI9_.js} +1 -1
  38. package/dist/browser/{fetch-retry.umd-BytZeydp.js → fetch-retry.umd-D2BnNN8g.js} +2 -2
  39. package/dist/browser/{flex-BQBLAC6l.js → flex-B5cqWC1b.js} +6 -6
  40. package/dist/browser/{floorplan.loader-DkaQPhwC.js → floorplan.loader-D3lRYRJS.js} +10 -10
  41. package/dist/browser/{floorplan.ready-DwuXZphI.js → floorplan.ready-CsdDpbEv.js} +344 -308
  42. package/dist/browser/{fuse-DZTwJ52u.js → fuse-CzalO4Mu.js} +2 -2
  43. package/dist/browser/{i18n-Bcv8xw_q.js → i18n-D1sb3MoT.js} +5 -5
  44. package/dist/browser/index.js +14 -14
  45. package/dist/browser/{index.module-BFxDVa3K.js → index.module-JxYvexTC.js} +4 -4
  46. package/dist/browser/{integrateKiosk-VTNZSSfD.js → integrateKiosk-e4HqZu2W.js} +5 -5
  47. package/dist/browser/{is-webview-CjItzxdV.js → is-webview-ChPDTaTY.js} +1 -1
  48. package/dist/browser/{jsx-runtime-CT2c-IhD.js → jsx-runtime-Ca1Wj_4-.js} +2 -2
  49. package/dist/browser/{kiosk-record-v7r7q7t0.js → kiosk-record-C2cafcoW.js} +1 -1
  50. package/dist/browser/{lib-DGh8lZgT.js → lib-DXqE6M9Z.js} +3 -3
  51. package/dist/browser/{loadImage-a_ahClbD.js → loadImage-8qYzT9NG.js} +4 -4
  52. package/dist/browser/{logDeviceInfo-DHfa6NcE.js → logDeviceInfo-CF95RwQH.js} +9 -9
  53. package/dist/browser/{mobx-dAtztuiQ.js → mobx-B8aGIDdz.js} +7 -7
  54. package/dist/browser/{optional-boolean-editor-D43-yLO3.js → optional-boolean-editor-D02Q8KUS.js} +4 -4
  55. package/dist/browser/{optional-enum-editor-Cvn8TV-x.js → optional-enum-editor-RV_EKfNQ.js} +5 -5
  56. package/dist/browser/{optional-string-editor-sY0yVw_j.js → optional-string-editor-D_t_aZG2.js} +5 -5
  57. package/dist/browser/{particles.min-BD7iDSr6.js → particles.min-CDyH_67D.js} +2 -2
  58. package/dist/browser/{react-BJopqGbW.js → react-CDmIhEY6.js} +2 -2
  59. package/dist/browser/{react-dom-B77nDdqp.js → react-dom-PGvJwDoR.js} +3 -3
  60. package/dist/browser/{rolldown-runtime-BmHtYG9i.js → rolldown-runtime-CwqkRsWu.js} +1 -1
  61. package/dist/browser/scheduler-MBFOnOYr.js +212 -0
  62. package/dist/browser/{select-ByU-Ym6-.js → select-2x53pvd0.js} +11 -11
  63. package/dist/browser/{settings-CEH1i0Pj.js → settings-BCkl8gdb.js} +2 -2
  64. package/dist/browser/{settings-item-_PTji9Bz.js → settings-item-DT6Vnw06.js} +7 -7
  65. package/dist/browser/store-Dej5FGrq.js +31205 -0
  66. package/dist/browser/{string-editor-DaF1t7MK.js → string-editor-w9YDgRoR.js} +5 -5
  67. package/dist/browser/{text-field-XRLZPyNV.js → text-field-ricOc0h0.js} +6 -6
  68. package/dist/browser/{theme-D0OZcdto.js → theme-Ce7vpk9b.js} +9 -9
  69. package/dist/browser/{ui-7ozfXlN3.js → ui-PDV2rEkU.js} +9 -9
  70. package/dist/browser/{useRenderTarget-BG295f3e.js → useRenderTarget-DroCs5kL.js} +5 -5
  71. package/dist/browser/viewport-Jwms2MJD.js +41 -0
  72. package/dist/esm/components/Kiosk/KioskStore.d.ts +5 -2
  73. package/dist/esm/components/Kiosk/KioskStore.js +1 -1
  74. package/dist/esm/components/Kiosk/SetKioskMode.d.ts +1 -2
  75. package/dist/esm/components/Kiosk/SetKioskMode.js +1 -1
  76. package/dist/esm/components/Map/Map.d.ts +1 -1
  77. package/dist/esm/components/Map/Map.js +1 -1
  78. package/dist/esm/components/Map/MapCamera.d.ts +17 -0
  79. package/dist/esm/components/Map/MapCamera.js +1 -0
  80. package/dist/esm/components/Map/MapViewport.d.ts +12 -0
  81. package/dist/esm/components/Map/MapViewport.js +1 -0
  82. package/dist/esm/components/Map/booth-by-xy.d.ts +13 -0
  83. package/dist/esm/components/Map/booth-by-xy.js +1 -1
  84. package/dist/esm/components/Map/camera-events.d.ts +16 -0
  85. package/dist/esm/components/Map/camera-events.js +1 -0
  86. package/dist/esm/components/Map/camera.d.ts +48 -0
  87. package/dist/esm/components/Map/camera.js +1 -0
  88. package/dist/esm/components/Map/drawing/config/TextFitter.d.ts +1 -1
  89. package/dist/esm/components/Map/drawing/config/config-all.d.ts +1 -2
  90. package/dist/esm/components/Map/drawing/config/config-all.js +1 -1
  91. package/dist/esm/components/Map/drawing/config/config-bg.d.ts +1 -2
  92. package/dist/esm/components/Map/drawing/config/config-bg.js +1 -1
  93. package/dist/esm/components/Map/drawing/config/config-booth-badge.d.ts +70 -3
  94. package/dist/esm/components/Map/drawing/config/config-booth-badge.js +1 -1
  95. package/dist/esm/components/Map/drawing/config/config-booth-bg.d.ts +3 -6
  96. package/dist/esm/components/Map/drawing/config/config-booth-bg.js +1 -1
  97. package/dist/esm/components/Map/drawing/config/config-booth-bookmark.d.ts +11 -7
  98. package/dist/esm/components/Map/drawing/config/config-booth-bookmark.js +1 -1
  99. package/dist/esm/components/Map/drawing/config/config-booth-border.d.ts +2 -3
  100. package/dist/esm/components/Map/drawing/config/config-booth-border.js +1 -1
  101. package/dist/esm/components/Map/drawing/config/config-booth-labels-special.d.ts +16 -3
  102. package/dist/esm/components/Map/drawing/config/config-booth-labels-special.js +2 -2
  103. package/dist/esm/components/Map/drawing/config/config-booth-labels.d.ts +18 -4
  104. package/dist/esm/components/Map/drawing/config/config-booth-labels.js +1 -1
  105. package/dist/esm/components/Map/drawing/config/config-booths.d.ts +1 -2
  106. package/dist/esm/components/Map/drawing/config/config-booths.js +1 -1
  107. package/dist/esm/components/Map/drawing/config/config-load-layer.d.ts +1 -2
  108. package/dist/esm/components/Map/drawing/config/config-load-layer.js +1 -1
  109. package/dist/esm/components/Map/drawing/config/config-markers.d.ts +23 -2
  110. package/dist/esm/components/Map/drawing/config/config-markers.js +1 -1
  111. package/dist/esm/components/Map/drawing/config/layer-images.d.ts +35 -0
  112. package/dist/esm/components/Map/drawing/config/layer-images.js +1 -0
  113. package/dist/esm/components/Map/drawing/config/loadBoothsImages.d.ts +38 -3
  114. package/dist/esm/components/Map/drawing/config/loadBoothsImages.js +1 -1
  115. package/dist/esm/components/Map/pointer.d.ts +73 -0
  116. package/dist/esm/components/Map/pointer.js +1 -0
  117. package/dist/esm/components/Map/scene.d.ts +20 -0
  118. package/dist/esm/components/Map/scene.js +1 -0
  119. package/dist/esm/components/Map/traffic/trafficLayers.d.ts +2 -7
  120. package/dist/esm/components/Map/traffic/trafficLayers.js +1 -1
  121. package/dist/esm/components/Map/traffic/useBuildRoute.d.ts +4 -3
  122. package/dist/esm/components/Map/traffic/useBuildRoute.js +6 -6
  123. package/dist/esm/components/Map/traffic/useManageTraffic.d.ts +4 -3
  124. package/dist/esm/components/Map/traffic/useManageTraffic.js +1 -1
  125. package/dist/esm/components/Map/viewport.d.ts +63 -0
  126. package/dist/esm/components/Map/viewport.js +1 -0
  127. package/dist/esm/components/Maplibre/MaplibreAdapter.d.ts +6 -2
  128. package/dist/esm/components/Maplibre/MaplibreAdapter.js +1 -1
  129. package/dist/esm/components/Maplibre/MaplibreWrapper.d.ts +30 -8
  130. package/dist/esm/components/Maplibre/MaplibreWrapper.js +1 -1
  131. package/dist/esm/components/Maplibre/useDimming.d.ts +2 -2
  132. package/dist/esm/components/Maplibre/useDimming.js +1 -1
  133. package/dist/esm/components/Maplibre/useKioskIdleEvents.d.ts +5 -6
  134. package/dist/esm/components/Maplibre/useLayerVisibilitySync.d.ts +2 -2
  135. package/dist/esm/components/Maplibre/useLayerVisibilitySync.js +1 -1
  136. package/dist/esm/components/Maplibre/usePoiMarkers.d.ts +1 -2
  137. package/dist/esm/components/Maplibre/useWayfindingAndMarkers.d.ts +8 -5
  138. package/dist/esm/components/Maplibre/useWayfindingAndMarkers.js +1 -1
  139. package/dist/esm/components/Maplibre/utils/layer-defs.d.ts +8 -3
  140. package/dist/esm/components/Maplibre/utils/layer-defs.js +1 -1
  141. package/dist/esm/components/Maplibre/utils/poi-marker-hit-test.d.ts +3 -3
  142. package/dist/esm/components/Ws.js +1 -1
  143. package/dist/esm/engine/defs.d.ts +30 -0
  144. package/dist/esm/engine/defs.js +3 -0
  145. package/dist/esm/engine/fonts.js +1 -0
  146. package/dist/esm/engine/update-def.d.ts +52 -0
  147. package/dist/esm/engine/update-def.js +1 -0
  148. package/dist/esm/engine/utils/rotation.d.ts +6 -0
  149. package/dist/esm/engine/utils/rotation.js +1 -0
  150. package/dist/esm/floorplan.ready.d.ts +2 -0
  151. package/dist/esm/floorplan.ready.js +1 -1
  152. package/dist/esm/store/BoothStore.d.ts +11 -0
  153. package/dist/esm/store/LayerStore.d.ts +2 -0
  154. package/dist/esm/store/LayerStore.js +1 -1
  155. package/dist/esm/store/RootStore.d.ts +0 -2
  156. package/dist/esm/store/RootStore.js +1 -1
  157. package/dist/esm/store/RouteStore.js +1 -1
  158. package/dist/esm/store/UIState.js +1 -1
  159. package/dist/esm/store/details-events.d.ts +11 -0
  160. package/dist/esm/store/details-events.js +1 -0
  161. package/dist/esm/store/init/init-booths.js +1 -1
  162. package/dist/esm/utils/dimming.d.ts +13 -2
  163. package/dist/esm/utils/dimming.js +1 -1
  164. package/dist/esm/utils/mobx.d.ts +2 -2
  165. package/dist/esm/utils/mobx.js +1 -1
  166. package/dist/esm/utils/scene-bounds.d.ts +1 -1
  167. package/dist/esm/utils/scene-bounds.js +1 -1
  168. package/dist/esm/wayfinding/adapters/canvasIconProvider.js +1 -1
  169. package/dist/esm/wayfinding/createWayfinding.d.ts +19 -2
  170. package/dist/esm/wayfinding/createWayfinding.js +1 -1
  171. package/package.json +11 -10
  172. package/dist/browser/SetKioskMode-DUk4c-Gs.js +0 -57
  173. package/dist/browser/booth-by-xy-CyZpg1Fn.js +0 -1130
  174. package/dist/browser/main-sUuehgQu.js +0 -289
  175. package/dist/browser/store-Oj0dGPnb.js +0 -41431
  176. package/dist/esm/components/Map/pointInConvexQuad.d.ts +0 -3
  177. package/dist/esm/components/Map/pointInConvexQuad.js +0 -1
  178. package/dist/esm/components/Map/visibleArea.d.ts +0 -16
  179. package/dist/esm/components/Map/visibleArea.js +0 -1
  180. package/dist/esm/components/Maplibre/useRendererEvents.d.ts +0 -9
  181. package/dist/esm/components/Maplibre/useRendererEvents.js +0 -1
  182. package/dist/esm/components/Maplibre/utils/update-pump.d.ts +0 -18
  183. package/dist/esm/components/Maplibre/utils/update-pump.js +0 -1
  184. package/dist/esm/renderer/HandlerRegistry.d.ts +0 -18
  185. package/dist/esm/renderer/HandlerRegistry.js +0 -1
  186. package/dist/esm/renderer/RendererService.d.ts +0 -44
  187. package/dist/esm/renderer/RendererService.js +0 -1
  188. package/dist/esm/renderer/engine-core/defs.d.ts +0 -40
  189. package/dist/esm/renderer/engine-core/defs.js +0 -3
  190. package/dist/esm/renderer/engine-core/fonts.js +0 -1
  191. package/dist/esm/renderer/engine-core/settings.d.ts +0 -4
  192. package/dist/esm/renderer/engine-core/settings.js +0 -1
  193. package/dist/esm/renderer/engine-core/types.d.ts +0 -50
  194. package/dist/esm/renderer/engine-core/types.js +0 -1
  195. package/dist/esm/renderer/engine-core/update-def.d.ts +0 -12
  196. package/dist/esm/renderer/engine-core/update-def.js +0 -1
  197. package/dist/esm/renderer/engine-core/utils/rotation.d.ts +0 -17
  198. package/dist/esm/renderer/engine-core/utils/rotation.js +0 -1
  199. package/dist/esm/renderer/index.d.ts +0 -19
  200. package/dist/esm/renderer/index.js +0 -1
  201. /package/dist/esm/{renderer/engine-core → engine}/canvases.d.ts +0 -0
  202. /package/dist/esm/{renderer/engine-core → engine}/canvases.js +0 -0
  203. /package/dist/esm/{renderer/engine-core → engine}/fonts.d.ts +0 -0
@@ -1,4 +1,3 @@
1
- import { type Renderer } from '@expofp/renderer';
2
1
  import { type Map as MaplibreMap } from 'maplibre-gl';
3
2
  import { type RefObject } from 'react';
4
3
  import { type GeoConfig } from './utils/geo-config';
@@ -22,5 +21,5 @@ import { type GeoConfig } from './utils/geo-config';
22
21
  * (`configOutdoorPoiLayer` never publishes), so this is belt-and-braces — it
23
22
  * keeps the map untouched even if markers reach the store another way.
24
23
  */
25
- export declare function usePoiMarkers(renderer: Renderer | null, mapRef: RefObject<MaplibreMap | null>, geoConfig: GeoConfig | null): void;
24
+ export declare function usePoiMarkers(ready: boolean, mapRef: RefObject<MaplibreMap | null>, geoConfig: GeoConfig | null): void;
26
25
  //# sourceMappingURL=usePoiMarkers.d.ts.map
@@ -1,8 +1,11 @@
1
- import { type Renderer } from '@expofp/renderer';
2
- import { type RendererService } from '../../renderer/RendererService';
1
+ import { type SceneDef } from '@expofp/renderer';
2
+ import { type RefObject } from 'react';
3
3
  /**
4
- * Sets up wayfinding and markers when the renderer becomes available,
5
- * and tears them down when the renderer changes or the component unmounts.
4
+ * Starts wayfinding and markers once the scene exists, and tears them down with it — the same
5
+ * declarative forms the standalone map uses: both fill layers `configAll` put in the scene, and
6
+ * layout and picking reach them through the handlers their own defs declare.
7
+ * @param scene - The prepared scene the map draws, once it exists.
8
+ * @param canvas - The canvas the plan draws on — the map's own, read lazily.
6
9
  */
7
- export declare function useWayfindingAndMarkers(renderer: Renderer | null, rendererService: RendererService): void;
10
+ export declare function useWayfindingAndMarkers(scene: SceneDef | null, canvas: RefObject<HTMLCanvasElement | null>): void;
8
11
  //# sourceMappingURL=useWayfindingAndMarkers.d.ts.map
@@ -1 +1 @@
1
- import{useEffect as r}from"react";import i from"../../store";import{createWayfinding as m}from"../../wayfinding";import{configMarkers as a}from"../Map/drawing/config/config-markers";export function useWayfindingAndMarkers(t,o){r(()=>{if(!t)return;const f=m(o,i),n=a(o);return()=>{f?.(),n?.()}},[t,o])}
1
+ import{useEffect as f}from"react";import n from"../../store";import{createWayfinding as e}from"../../wayfinding";import{configMarkers as m}from"../Map/drawing/config/config-markers";export function useWayfindingAndMarkers(r,o){f(()=>{if(!r)return;const i=e({scene:r,store:n,canvas:o}),t=m({scene:r});return()=>{i(),t()}},[r,o])}
@@ -1,4 +1,9 @@
1
- import { type LayerDef, type ShapeDef } from '@expofp/renderer';
2
- export declare function collectLayerDefsByName(layer: LayerDef, acc?: Map<string, LayerDef[]>): Map<string, LayerDef[]>;
3
- export declare function getBooth(shapeDef: ShapeDef): import("../../../store/BoothStore").Booth | null | undefined;
1
+ import { type LayerDef } from '@expofp/renderer';
2
+ /**
3
+ * Indexes a layer tree by name, one list per name — floors repeat across scenes.
4
+ * @param layer - The root to walk.
5
+ * @param acc - The accumulator, threaded through recursion.
6
+ * @returns Layer defs by name.
7
+ */
8
+ export declare function collectLayerDefsByName(layer: LayerDef, acc?: Map<string, LayerDef<import("@expofp/renderer").RenderableDef>[]>): Map<string, LayerDef<import("@expofp/renderer").RenderableDef>[]>;
4
9
  //# sourceMappingURL=layer-defs.d.ts.map
@@ -1 +1 @@
1
- import{boothStore as t}from"../../../store";export function collectLayerDefsByName(e,n=new Map){if(e.name){const o=n.get(e.name)??[];o.push(e),n.set(e.name,o)}for(const o of e.children??[])o&&"children"in o&&collectLayerDefsByName(o,n);return n}export function getBooth(e){return e?.shape?t.booths.find(n=>n.shapes?.some(o=>o.shape===e.shape)):null}
1
+ import{isLayerDef as o}from"@expofp/renderer";export function collectLayerDefsByName(e,f=new Map){if(e.name){const n=f.get(e.name)??[];n.push(e),f.set(e.name,n)}for(const n of e.children??[])o(n)&&collectLayerDefsByName(n,f);return f}
@@ -1,9 +1,9 @@
1
1
  type PoiMarkerHitTest = (x: number, y: number) => boolean;
2
2
  /**
3
3
  * Model-space hit-test against the outdoor PoI symbol/cluster layers, set by
4
- * `usePoiMarkers` while active. The renderer click pipeline
5
- * (useRendererEvents) consults it so a click handled by a native MapLibre
6
- * layer does not also select the booth underneath.
4
+ * `usePoiMarkers` while active. The plan's click seam (`clickedPlan` in
5
+ * Map/pointer.ts) consults it so a click handled by a native MapLibre layer
6
+ * does not also select the booth underneath.
7
7
  *
8
8
  * Deliberately a leaf module (no imports): it decouples the renderer click
9
9
  * pipeline from the Maplibre hook that owns the marker layers.
@@ -1 +1 @@
1
- import{jsx as n}from"react/jsx-runtime";import"./Ws.scss";import p from"classnames";import{reaction as x}from"mobx";import{useLocalStore as w,useObserver as g}from"mobx-react-lite";import b,{createRef as I,useCallback as m}from"react";import{CSSTransition as y,TransitionGroup as S}from"react-transition-group";import T,{exhibitorStore as k,uiState as r}from"../store";import{trackWsExhibitorClick as v}from"../tools/gtag";import{remsToPixels as E,shuffle as N}from"../utils";import{loadImagesInBatchesById as B}from"../utils/loadImagesInBatches";import{useInit as L}from"../utils/mobx";const h=8e3,M=b.memo(()=>{const e=w(()=>({el:null,all:[],adv:[],keySeq:0,index:0,imgByExhibitorId:new Map,batchSize:100,loading:!1,leftToNextLoad:0,timeoutId:0,get sectionStyle(){const{wsStarted:t,wsPosition:i}=r,a=i==="top",o={right:0,width:"100%",opacity:t?1:0};return a?o.top=0:o.bottom=0,o}})),s=m(()=>{const i=(e.el?.getBoundingClientRect().width??0)-E(.3)*2;let a=0;const o=[];do{const l=e.all[e.index%e.all.length],c=e.imgByExhibitorId.get(l.id);if(!c)break;const f=c.width*r.wsImageHeightPx/c.height+20;if(a+f>i&&o.length)break;a+=f,o.push({key:e.keySeq++,e:l}),e.index=(e.index+1)%e.all.length}while(!0);e.adv=o.map(l=>({...l,nodeRef:I()})),e.leftToNextLoad=Math.max(0,e.leftToNextLoad-o.length)},[e]),d=m(async()=>{e.loading=!0;let t=e.all.slice(e.index,e.index+e.batchSize);t.length<e.batchSize&&(t=t.concat(e.all.slice(0,e.batchSize-t.length)));const i=await B(new Map(t.map(a=>[a.id,{fallback:a.logo?.url}])));return e.leftToNextLoad=i.size,e.loading=!1,i},[e]),u=m(()=>{const t=async()=>{if(e.loading){e.timeoutId=window.setTimeout(t,h);return}e.leftToNextLoad<=e.adv.length&&(e.imgByExhibitorId=await d()),s(),e.timeoutId=window.setTimeout(t,h)};clearTimeout(e.timeoutId),e.timeoutId=window.setTimeout(t,h)},[d,s]);return L(()=>{let t,i=!0;return(async()=>(e.all=N(k.advertised),e.imgByExhibitorId=await d(),i&&(s(),u(),r.wsStarted=!0,t=x(()=>r.screenSize,s))))(),()=>{i=!1,t?.(),clearInterval(e.timeoutId)}}),g(()=>n("section",{className:p("ws",{"efp-semi-transparent":r.setKioskModeEnabled}),ref:t=>e.el=t,onMouseOver:()=>clearInterval(e.timeoutId),onMouseOut:u,style:e.sectionStyle,children:n(S,{component:null,children:e.adv.map(t=>n(y,{timeout:500,nodeRef:t.nodeRef,children:n("a",{ref:t.nodeRef,href:`?${t.e.slug}`,className:"ws__exhibitor",style:{height:`${r.wsImageHeightPx}px`},onClick:i=>{i.preventDefault(),v(t.e),T.clickExhibitor(t.e)},children:n("img",{src:t.e.logo?.url,alt:t.e.name,crossOrigin:"anonymous"})})},t.key))})}))});export default()=>g(()=>r.wsShown?n(M,{}):null);
1
+ import{jsx as n}from"react/jsx-runtime";import"./Ws.scss";import b from"classnames";import{reaction as y}from"mobx";import{useLocalStore as I,useObserver as x}from"mobx-react-lite";import S,{createRef as k,useCallback as h}from"react";import{CSSTransition as T,TransitionGroup as v}from"react-transition-group";import E,{exhibitorStore as N,uiState as o}from"../store";import{trackWsExhibitorClick as M}from"../tools/gtag";import{remsToPixels as B,shuffle as L}from"../utils";import{loadImagesInBatchesById as R}from"../utils/loadImagesInBatches";import{useInit as z}from"../utils/mobx";const u=8e3,W=S.memo(()=>{const t=I(()=>({el:null,all:[],adv:[],keySeq:0,index:0,batchStart:0,imgByExhibitorId:new Map,batchSize:100,loading:!1,leftToNextLoad:0,timeoutId:0,get sectionStyle(){const{wsStarted:e,wsPosition:i}=o,l=i==="top",r={right:0,width:"100%",opacity:e?1:0};return l?r.top=0:r.bottom=0,r}})),s=h((e=!1)=>{const i=e?t.adv:[];e?t.index=t.batchStart:t.batchStart=t.index;const r=(t.el?.getBoundingClientRect().width??0)-B(.3)*2;let g=0;const a=[];do{const c=t.all[t.index%t.all.length],m=t.imgByExhibitorId.get(c.id);if(!m)break;const p=m.width*o.wsImageHeightPx/m.height+20;if(g+p>r&&a.length)break;g+=p;const w=i[a.length]?.e===c?i[a.length]:null;a.push(w??{key:t.keySeq++,e:c,nodeRef:k()}),t.index=(t.index+1)%t.all.length}while(!0);t.adv=a,t.leftToNextLoad=Math.max(0,t.leftToNextLoad-Math.max(0,a.length-i.length))},[t]),d=h(async()=>{t.loading=!0;let e=t.all.slice(t.index,t.index+t.batchSize);e.length<t.batchSize&&(e=e.concat(t.all.slice(0,t.batchSize-e.length)));const i=await R(new Map(e.map(l=>[l.id,{fallback:l.logo?.url}])));return t.leftToNextLoad=i.size,t.loading=!1,i},[t]),f=h(()=>{const e=async()=>{if(t.loading){t.timeoutId=window.setTimeout(e,u);return}t.leftToNextLoad<=t.adv.length&&(t.imgByExhibitorId=await d()),s(),t.timeoutId=window.setTimeout(e,u)};clearTimeout(t.timeoutId),t.timeoutId=window.setTimeout(e,u)},[d,s]);return z(()=>{let e,i=!0;return(async()=>(t.all=L(N.advertised),t.imgByExhibitorId=await d(),i&&(s(),f(),o.wsStarted=!0,e=y(()=>o.screenSize,()=>s(!0),{delay:250}))))(),()=>{i=!1,e?.(),clearInterval(t.timeoutId)}}),x(()=>n("section",{className:b("ws",{"efp-semi-transparent":o.setKioskModeEnabled}),ref:e=>t.el=e,onMouseOver:()=>clearInterval(t.timeoutId),onMouseOut:f,style:t.sectionStyle,children:n(v,{component:null,children:t.adv.map(e=>n(T,{timeout:500,nodeRef:e.nodeRef,children:n("a",{ref:e.nodeRef,href:`?${e.e.slug}`,className:"ws__exhibitor",style:{height:`${o.wsImageHeightPx}px`},onClick:i=>{i.preventDefault(),M(e.e),E.clickExhibitor(e.e)},children:n("img",{src:e.e.logo?.url,alt:e.e.name,crossOrigin:"anonymous"})})},e.key))})}))});export default()=>x(()=>o.wsShown?n(W,{}):null);
@@ -0,0 +1,30 @@
1
+ import { Box, type LineLike, Mesh, type Polygon, Rect, type TriangleIndex } from '@expofp/geometry';
2
+ import { type ImageDef, type ImageSource, type LayerDef, type LineDef, type RenderableDefCollection, type SceneDef, type ShapeDef, type SharedDef, type TextAlignment, type TextDef, type TextLineDef } from '@expofp/renderer';
3
+ /**
4
+ * What svgMesh3d puts on `window.__fpPaths`: vertices as bare number tuples, which is why this is
5
+ * not geometry's `MeshLike` — that one holds points. The third component is optional because
6
+ * svgMesh3d emits it per vertex and only sometimes.
7
+ */
8
+ export interface MeshType {
9
+ positions: [number, number, number?][];
10
+ cells: TriangleIndex[];
11
+ }
12
+ export type TextLines = [string[], string[]];
13
+ export interface FontSizeFactor {
14
+ scaleFactor: number;
15
+ value: number;
16
+ lines: string[];
17
+ }
18
+ export declare function rectToShapeDef(rect: SVGRectElement, color?: string): ShapeDef;
19
+ export declare function meshToShapeDef(mesh: MeshType, color: string): ShapeDef;
20
+ export declare function createShapeDef(shape: Box | Rect | Polygon | Mesh, color?: string): ShapeDef;
21
+ export declare function createImageDef(source: ImageSource, bounds: Rect, options?: SharedDef & {
22
+ origin?: [number, number];
23
+ }): ImageDef;
24
+ export declare function createTextDef(textLines: TextLineDef[], bounds: Rect, padding: [number, number], alignment: TextAlignment, options?: SharedDef): TextDef;
25
+ export declare function createTextDefLines(textLines: TextLines, color: string, fontSize: number, fontUrl?: [string | undefined, string | undefined]): TextLineDef[];
26
+ export declare function createLineDef({ p0, p1 }: LineLike, color?: string, width?: number): LineDef;
27
+ export declare function createLayerDef(name: string, children: RenderableDefCollection, options?: SharedDef): LayerDef;
28
+ export declare function createSceneDef(layers: LayerDef[], viewboxRect: Box | SVGRectElement, background?: string): SceneDef;
29
+ export declare function createShapeDot(rect: Rect, color?: string, radius?: number): ImageDef;
30
+ //# sourceMappingURL=defs.d.ts.map
@@ -0,0 +1,3 @@
1
+ import{Box as i,isBox as s,isMesh as c,isPolygon as u,isRect as x,Mesh as d,Rect as h}from"@expofp/geometry";import{createCircleCanvas as p}from"./canvases";import{DEFAULT_FONT_LIGHT_URL as w,DEFAULT_FONT_URL as D}from"./fonts";export function rectToShapeDef(e,r){return createShapeDef(i.fromSvg(e),r)}export function meshToShapeDef(e,r){if(!e)throw new Error("Create ShapeDef: mesh is not provided");const t=e.positions.map(o=>({x:o[0],y:Math.abs(o[1]),z:o[2]??0})),n=e.cells;return createShapeDef(new d(t,n),r)}export function createShapeDef(e,r="#000"){if(!e||!(s(e)||x(e)||u(e)||c(e)))throw new Error("Invalid shape definition");return{shape:e,color:r}}export function createImageDef(e,r,t){if(!e)throw new Error("Image source is not provided");return{source:e,bounds:r,...t}}export function createTextDef(e,r,t,n,o){if(e.length===0)throw new Error("Invalid text lines");return{lines:e,bounds:r,padding:t,alignment:n,...o}}export function createTextDefLines(e,r,t,n=[void 0,void 0]){const[o,f]=e,a=[{text:o.join(`
2
+ `),fontUrl:n[0]||D,color:r,fontSize:t}];return f.length&&a.push({text:f.join(`
3
+ `),fontUrl:n[1]||w,color:r,fontSize:t}),a}export function createLineDef({p0:e,p1:r},t="#000",n=10){if(!(e?.x&&e.y||r?.x&&r.y))throw new Error("Line data is invalid");return{points:{p0:{x:e.x,y:e.y},p1:{x:r.x,y:r.y}},color:t,width:n}}export function createLayerDef(e,r,t){if(!e)throw new Error("Layer name is required");return r||(r=[]),{name:e,children:r,...t}}export function createSceneDef(e,r,t){const n=r instanceof i?r:i.fromSvg(r);return{rootLayer:createLayerDef("root",e),background:t,viewbox:n}}export function createShapeDot(e,r="#000",t=1.5){const n=p(t,r),o=new h(e.center,{x:n.width,y:n.height},e.rotation,e.elevation);return createImageDef(n,o)}
@@ -0,0 +1 @@
1
+ import{getConfig as s}from"@expofp/config";import t from"../tools/base-runtime-url";export const DEFAULT_FONT_URL=`${t}fonts/oswald-v17-cyrillic_latin-500.woff`,DEFAULT_FONT_LIGHT_URL=`${t}fonts/oswald-v17-cyrillic_latin-300.woff`;export function loadCustomFontsUrls(){const o=s();return o.customCssFonts?.length?o.customCssFonts:[]}
@@ -0,0 +1,52 @@
1
+ import { Rect } from '@expofp/geometry';
2
+ import { type TextDef, type TextLineDef } from '@expofp/renderer';
3
+ import { type FontSizeFactor } from './defs';
4
+ export declare function updateLinesScale(lines: TextLineDef[], scale: number, fontSizes: [FontSizeFactor[], FontSizeFactor[]]): boolean;
5
+ /**
6
+ * Turns a text def's own bounds: the axis-aligned 90° footprint swap (width ↔ height) plus the
7
+ * rotation delta.
8
+ *
9
+ * **In place**, where {@link updateRectRotation} returns a new rect, and the difference is
10
+ * ownership rather than taste. These bounds belong to a def the renderer already holds, and the
11
+ * drawers capture them into locals to write through (`layOutDot` resizes `shapeDot.bounds` that
12
+ * way) — so replacing the object would strand every reference to it. `Rect.set` is geometry's
13
+ * escape hatch for exactly this. A drawer's own `canvasRect` has no such holders, which is why the
14
+ * other one is free to hand back a fresh value.
15
+ * @param textDef - The def to turn; its bounds are written through.
16
+ * @param rotation - The rotation delta, in radians.
17
+ * @returns The same def, for callers that read as if it were a value.
18
+ */
19
+ export declare function updateTextDefRotation(textDef: TextDef, rotation: number): TextDef;
20
+ /**
21
+ * Turns a plain rect: the same transform {@link updateTextDefRotation} applies, on a rect no def
22
+ * holds — a drawer's `canvasRect`, which every caller reassigns — so this one is free to return a
23
+ * new value instead of writing through.
24
+ *
25
+ * Rebuilt from scalars, so the elevation is carried across explicitly; a rect that dropped it would
26
+ * take whatever is rebuilt from it down to the floor on the first roll.
27
+ * @param rect - The rect to turn.
28
+ * @param angle - The rotation delta, in radians.
29
+ * @returns The turned rect.
30
+ */
31
+ export declare function updateRectRotation(rect: Rect, angle: number): Rect;
32
+ export declare function getRotation(newAngle: number, currentRotation: number): number | undefined;
33
+ export declare function shouldFlip(newAngle: number, currentRotation: number): boolean;
34
+ /**
35
+ * The signed shortest angle from `currentRotation` to `newAngle`, wrapped into `(-π, π]`.
36
+ *
37
+ * Always a number: the `| undefined` this used to be declared with described no path through the
38
+ * body, and its two callers already read the result as a plain angle.
39
+ * @param newAngle - The angle turned to, in radians.
40
+ * @param currentRotation - The angle turned from, in radians.
41
+ * @returns The difference in radians.
42
+ */
43
+ export declare function getAngleDiff(newAngle: number, currentRotation: number): number;
44
+ export declare function flipAngle(angle: number): number;
45
+ export declare function getClampedBoundsCanvas(rect: Rect, canvas: HTMLCanvasElement, padding: number, scale: number): Rect;
46
+ /**
47
+ * Reads the `roll` map setting — `1`/`0`, from the URL or the venue — as a boolean, refusing
48
+ * anything else. The label configs consult it before declaring their `onRoll` rules: with roll
49
+ * disabled the plan never turns, so a counter-rotation would only ever fight a stale angle.
50
+ */
51
+ export declare function getRollValue(value: 1 | 0): boolean;
52
+ //# sourceMappingURL=update-def.d.ts.map
@@ -0,0 +1 @@
1
+ import{Rect as X}from"@expofp/geometry";import{getBounds as Y}from"./canvases";export function updateLinesScale(o,n,t){let e=!1;return o.forEach((i,c)=>{let s=0;t[c].forEach(({value:a,scaleFactor:r})=>{n<r&&(s=a)}),i.fontSize!==s*n&&(e=!0),i.fontSize=s*n}),e}export function updateTextDefRotation(o,n){const t=o.bounds;return t.set(t.center.x,t.center.y,t.size.y,t.size.x,t.rotation+n,t.elevation),o}export function updateRectRotation(o,n){const{size:t,center:e,rotation:i,elevation:c}=o;return new X(e,{x:t.y,y:t.x},i+n,c)}export function getRotation(o,n){const t=getAngleDiff(o,n);if(Math.abs(t)>Math.PI/4)return Math.sign(t)*Math.PI/2}export function shouldFlip(o,n){const t=getAngleDiff(o,n),e=Math.PI/2;return Math.abs(t)>e+.1}export function getAngleDiff(o,n){const t=Math.PI,e=2*t;return((c,s)=>((c-s+t)%e+e)%e-t)(o,n)}export function flipAngle(o){return(o+Math.PI+Math.PI)%(2*Math.PI)-Math.PI}export function getClampedBoundsCanvas(o,n,t,e){const i=n.width,c=n.height,s=o.size,a=o.center,r=o.rotation,d=s.x/i,m=s.x-t*2,g=(s.y-t*2)*.8,M=0,b=m/i,I=g/c,y=Math.min(b,I,d);e=Math.min(Math.max(e,M),y);const P=i*e,R=c*e,h=Math.sin(r),f=Math.cos(r),u=s.x/2-t,x=-s.y/2+t,S=a.x+u*f-x*h,z=a.y+u*h+x*f,p=P/2,l=-R/2,B=p*f-l*h,W=p*h+l*f,w=S-B,H=z-W;return Y(w,H,i,c,e,r)}export function getRollValue(o){if(!o)return!1;if(!Number.isInteger(+o)||+o!=1&&+o!=0)throw new Error("Map roll: setting value is incorrect");return!!+o}
@@ -0,0 +1,6 @@
1
+ import { Rect, RectLike } from '@expofp/geometry';
2
+ import { ImageDef } from '@expofp/renderer';
3
+ export declare function isInnerInsideOuter(inner: Rect, outer?: RectLike): boolean;
4
+ export declare function flipImageDef(imageDef: ImageDef, angle: number): boolean;
5
+ export declare function rotateImageDef(imageDef: ImageDef, angle: number): boolean;
6
+ //# sourceMappingURL=rotation.d.ts.map
@@ -0,0 +1 @@
1
+ import{flipAngle as h,getRotation as y,shouldFlip as u}from"../update-def";export function isInnerInsideOuter(o,n){if(!n)return!1;const t=Math.cos(n.rotation??0),e=Math.sin(n.rotation??0),c=n.size.x/2,a=n.size.y/2;return d(o,o.rotation+Math.PI/2).every(r=>{const i=r.x-n.center.x,f=r.y-n.center.y,s=i*t+f*e,x=f*t-i*e;return Math.abs(s)<=c&&Math.abs(x)<=a})}function d(o,n=o.rotation){const t=o.size.x/2,e=o.size.y/2,c=Math.sin(n),a=Math.cos(n),r=o.center.x,i=o.center.y;return[{x:-t,y:-e},{x:t,y:-e},{x:t,y:e},{x:-t,y:e}].map(s=>({x:r+s.x*a-s.y*c,y:i+s.x*c+s.y*a}))}export function flipImageDef(o,n){const t=o.bounds;return u(n,t.rotation)?(t.rotate(h(t.rotation)-t.rotation,t),!0):!1}export function rotateImageDef(o,n){const t=o.bounds,e=y(n,t.rotation);return e===void 0?!1:(t.rotate(e,t),!0)}
@@ -8,6 +8,8 @@ import type { GeoConfig } from './types';
8
8
  import { Bounds, POISelectors } from './types/sdk.types';
9
9
  export default class FloorPlanReady extends FloorPlanLoader {
10
10
  root: ReturnType<typeof createRoot>;
11
+ private disposeDetailsEvents?;
12
+ private disposeBoothHitTest?;
11
13
  protected init(): void;
12
14
  selectBooth(nameOrExternalId: string | string[]): void;
13
15
  selectExhibitor(nameOrExternalId: string | string[]): void;
@@ -1 +1 @@
1
- import{Fragment as A,jsx as x,jsxs as T}from"react/jsx-runtime";import{Box as E}from"@expofp/geometry";import{CameraSchema as I}from"@expofp/schema";import{optimizeWaypointOrder as M}from"@expofp/wayfinding";import{ErrorBoundary as R}from"@sentry/react";import $ from"debug";import{reaction as V}from"mobx";import{createRoot as z}from"react-dom/client";import{install as j}from"resize-observer";import G from"./components/Layout";import{MAX_ROUTE_WAYPOINTS as d}from"./constants";import N from"./data";import{fpGeo as b}from"./data/fpGeo";import q from"./floorplan.loader";import{shouldLoadIntercom as O}from"./intercom";import{BoundsSchema as U,POISelectorsSchema as P,ZoomToOptionsSchema as w}from"./schemas/sdk.schemas";import{applyDeclarativeConfig as Y,applyParameters as D,applyPathway as H,initUrlRouting as W}from"./services/url-dispatch";import{destroyUrlSync as X}from"./services/url-sync";import r from"./store";import{bindRootElement as K,destroyUiHandlers as Q}from"./store/init/init-ui";import{findBooth as S,Route as B,separateExternalIds as k}from"./store/RouteStore";import{destroyGtag as Z,GaEventActions as v,sendEventToGa as F,setConsentSettings as J}from"./tools/gtag";import _ from"./tools/report-error";import ee,{resetTelemetry as te}from"./tools/track-event";import{cameraToMapSettings as re,mapSettingsToCamera as oe}from"./utils/camera-map-settings";import{getStorage as C}from"./utils/entity-storage";import{getMostFrequent as ie}from"./utils/getMostFrequent";import{convertLocalToGps as se,isValidPointCoords as y}from"./utils/gps";import{getLocales as ne,hasLocale as ae,setLocale as he}from"./utils/i18n";import{mapEntity as g}from"./utils/mapEntity";const p=$("efp:api");j();export default class ce extends q{init(){Y(),this.ignoreQuery||W(this.offHistory),ee("load"),K(r),r.fp=this,J(this.consent),F(v.Load,""),this.root=z(this.renderTarget),this.root.render(x(R,{children:x(G,{offHistory:this.offHistory,consent:this.consent})})),F(v.Rendered,""),V(()=>r.layerStore.layersLoaded,()=>{this.resolveReady(),r.initialized||this.onInit?.(this),r.initialized=!0});const e=O(N);e&&import("./intercom/bootIntercom").then(({bootIntercom:t})=>t(e)).catch(()=>{})}selectBooth(e){if(typeof e!="string"&&!Array.isArray(e)){a("selectBooth","Parameter must be a string or an array of strings.","EFP000000");return}const t=r.boothStore.booths.filter(o=>typeof e=="string"?o.name===e||o.externalId===e:e.includes(o.name)||e.includes(o.externalId));r.selectBooth(t)}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){r.uiState.menu=!1,r.searchStore.resetSearchBox(),r.uiState.details=null;return}const t=r.exhibitorStore.exhibitors.filter(s=>typeof e=="string"?s.name===e||s.externalId===e:e.includes(s.name)||e.includes(s.externalId));if(!t?.length)return;if(typeof e=="string"){r.selectExhibitor(t[0]),r.moveToList([t[0]]);return}const o=t.flatMap(s=>s.booths.map(i=>i.layer)),n=ie(o.map(s=>s.description));n&&r.layerStore.updateVisibility(n,!0),r.uiState.menu=!1,r.searchStore.resetSearchBox(),r.uiState.details=null,r.uiState.list={type:"filter",items:t,query:{key:"exhibitors",value:t.map(s=>s.name).join(",")}},r.moveToList()}highlightExhibitors(e){Array.isArray(e)||a("highlightExhibitors","Parameter must be an array of strings.","EFP000200"),r.boothStore.highlightedByExternalIds=[],r.exhibitorStore.highlightedByExternalIds=[...e]}highlightBooths(e){Array.isArray(e)||a("highlightBooths","Parameter must be an array of strings.","EFP000300"),r.exhibitorStore.highlightedByExternalIds=[],r.boothStore.highlightedByExternalIds=[...e]}highlightEntities(e){Array.isArray(e)||a("highlightEntities","Parameter must be an array of strings.","EFP000400");const{boothExternalIds:t,exhibitorExternalIds:o}=k(e);r.boothStore.highlightedByExternalIds=[...t],r.exhibitorStore.highlightedByExternalIds=[...o]}selectRoute(e,t){if(Array.isArray(e)){let o=[...e];const n=o.shift(),s=o.pop();if(o.length>d)throw new Error(`The maximum number of waypoints is ${d}.`);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}r.routeStore.selectRoute(new B(m(n),m(s),o.map(m)));return}e||a("selectRoute","At a minimum, the starting point must be passed.","EFP000402"),r.routeStore.selectRoute(new B(m(e),m(t)))}getOptimizedRoutes(e){if(!Array.isArray(e))return a("getOptimizedRoutes","Parameter must be an array.","EFP000500"),[];if(e.length>d)throw new Error(`The maximum number of waypoints is ${d}.`);const t=e.map(m).filter(n=>!!n);if(!t.length)throw new Error("No booths found for the provided waypoints.");const o=new Map;for(const n of t){const s=n.layer?.name??"",i=o.get(s);i?i.push(n):o.set(s,[n])}return Array.from(o.values()).map(n=>({waypoints:M(n.map(s=>[s.name,{x:s.rect.center.x,y:s.rect.center.y}]))}))}selectCurrentPosition(e,t,o){const n=y(e.x)&&y(e.y),s=y(e.lng)&&y(e.lat);!n&&!s&&a("selectCurrentPosition","A point must be passed. Either (x,y) or (lat,lng) are required.","EFP000600"),r.routeStore.selectCurrentPosition(e,t,o),this.onCurrentPositionChanged?.(e)}setBookmarks(e){(!Array.isArray(e)||!e.length)&&a("setBookmarks","Parameter must be an array.","EFP000700"),e.forEach(t=>{const o=r.exhibitorStore.exhibitors.find(n=>n.name===t.name||n.externalId===t.externalId);o&&(o.bookmarked=t.bookmarked)})}setEntitiesBookmarks(e){if(!Array.isArray(e)||!e.length){a("setEntitiesBookmarks","Parameter must be an array.","EFP000701");return}const t=["exhibitor","event","speaker","booth"],o=e.find(i=>!i.type||!t.includes(i.type));if(o){a("setEntitiesBookmarks",`Invalid entity type: ${o.type}. Must be one of: ${t.join(", ")}.`,"EFP000702");return}const n=C("bookmarked"),s={exhibitor:{existingIds:new Set(n.exhibitors||[]),finder:i=>r.exhibitorStore.findExhibitor(i),replacer:i=>r.exhibitorStore.replaceBookmarked(i)},event:{existingIds:new Set(n.events||[]),finder:i=>r.eventStore.findByNameOrSlug(i),replacer:i=>r.eventStore.replaceBookmarked(i)},speaker:{existingIds:new Set(n.speakers||[]),finder:i=>r.speakerStore.speakers.find(h=>h.name===i||h.externalId===i||h.slug===i),replacer:i=>r.speakerStore.replaceBookmarked(i)},booth:{existingIds:new Set(n.booths||[]),finder:i=>{const h=r.boothStore.findBooth(i);return h?.exhibitors.length===0?h:void 0},replacer:i=>r.boothStore.replaceBookmarked(i)}};e.forEach(i=>{const h=s[i.type],u=i.name||i.externalId||"",c=h.finder(u);c?i.bookmarked?h.existingIds.add(c.id):h.existingIds.delete(c.id):console.warn(`Entity not found: ${i.type} with query "${u}"`)}),Object.values(s).forEach(i=>{i.replacer(Array.from(i.existingIds))})}setEntitiesVisited(e){if(!Array.isArray(e)||!e.length){a("setEntitiesVisited","Parameter must be an array.","EFP000703");return}const t=["exhibitor","event"],o=e.find(i=>!i.type||!t.includes(i.type));if(o){a("setEntitiesVisited",`Invalid entity type: ${o.type}. Must be one of: ${t.join(", ")}.`,"EFP000704");return}const n=C("visited"),s={exhibitor:{existingIds:new Set(n.exhibitors||[]),finder:i=>r.exhibitorStore.findExhibitor(i),replacer:i=>r.exhibitorStore.replaceVisited(i)},event:{existingIds:new Set(n.events||[]),finder:i=>r.eventStore.findByNameOrSlug(i),replacer:i=>r.eventStore.replaceVisited(i)}};e.forEach(i=>{const h=s[i.type],u=i.name||i.externalId||"",c=h.finder(u);c?i.visited?h.existingIds.add(c.id):h.existingIds.delete(c.id):console.warn(`Entity not found: ${i.type} with query "${u}"`)}),Object.values(s).forEach(i=>{i.replacer(Array.from(i.existingIds))})}setMarkers(e){if(!e||!Array.isArray(e.icons)||!Array.isArray(e.markers)){a("setMarkers","Invalid input.","EFP000800");return}r.routeStore.setMarkers(e)}selectMarker(e,t=!0){return typeof e!="string"&&a("selectMarker","The identifier must be passed.","EFP000900"),r.routeStore.selectMarker(e,t)}drawCircles(e){Array.isArray(e)||a("drawCircles","Invalid input.","EFP000A00"),r.uiState.debugCircles=e}checkRoutes(){r.routeStore.checkRoutes()}updateLayerVisibility(e,t){typeof e!="string"&&a("updateLayerVisibility","The layer name (string) must be passed.","EFP000B00"),t||a("updateLayerVisibility","Passing a false value to visible will have no effect.","EFP000B01"),r.layerStore.updateVisibility(e,t)}getCenterCoordinates(){return r.fp.getCenterCoordinates()}exhibitorsList(){return r.exhibitorStore.exhibitors.map(e=>g(e))}boothsList(){return r.boothStore.booths.map(e=>g(e))}categoriesList(){return r.categoryStore.categories.map(e=>g(e))}selectCategory(e){if(e==null||typeof e!="string"){r.searchStore.selectSearch();return}const t=e?.toLowerCase(),o=r.categoryStore.categories.find(({name:n,slug:s})=>n?.toLowerCase()===t||s?.toLowerCase()===t);if(!o){a("selectCategory",`Category ${e} not found.`,"EFP000C01");return}r.selectCategory(o)}select(e){if(typeof e!="string"){a("select","Parameter must be a string.","EFP001700");return}const t=e,o=t?.toLowerCase(),n=r.boothStore.booths.find(c=>c.slug?.toLowerCase()===o||c.externalId?.toLowerCase()===o||c.externalId?.toLowerCase()?.replace(/\s+/g,"")===o);if(n){setTimeout(()=>r.selectBooth(n),250);return}const s=r.eventStore.eventItems.find(c=>c.slug?.toLowerCase()===o||c.externalId?.toLowerCase()===o);if(s){r.selectEventItem(s,!0);return}const i=r.exhibitorStore.exhibitors.find(c=>c.slug?.toLowerCase()===o||c.externalId?.toLowerCase()===o);if(i){setTimeout(()=>r.clickExhibitor(i),250);return}const h=r.categoryStore.categories.find(c=>c.slug===t);if(h){r.selectCategory(h);return}const u=r.speakerStore.findBySlug(t);if(u){r.selectSpeaker(u,!0);return}t.includes("heatmap=true")||r.searchStore.selectSearch(t)}showList(e){const t={bookmarks:()=>r.selectBookmarks(),visited:()=>r.selectVisited(),sessions:()=>r.selectSessions(),exhibitors:()=>r.selectExhibitors(),speakers:()=>r.selectSpeakers(),tours:()=>r.selectTours(),language:()=>r.selectLanguage()},o=t[e];if(!o){a("showList",`Unknown list "${e}". Must be one of: ${Object.keys(t).join(", ")}.`,"EFP001800");return}o()}selectTour(e){if(typeof e!="string"||!e){a("selectTour","A tour id must be passed.","EFP001900");return}const t=r.toursStore.getTourById(e);t?r.toursStore.launchTour(t,t.name,t.description):(console.warn(`Route with id "${e}" not found`),r.selectTours())}openPlanner(e={}){if(typeof e!="object"||e===null){a("openPlanner","An options object must be passed.","EFP001A00");return}const t=e.from?S(e.from):null;e.fromBookmarks?r.routePlannerStore.launchFromBookmarks(t??void 0):r.routePlannerStore.launchFromSlugs(e.items??[],t??void 0)}startBuildRoute(){r.uiState.startBuildRoute()}applyParameters(e){typeof e!="string"&&a("applyParameters","A query string must be passed.","EFP000D00"),D(e)}getVisibility(){return r.uiState.visibility}setVisibility(e){(typeof e!="object"||!Object.keys(e).length)&&a("setVisibility","The parameter must be passed.","EFP000E00"),r.uiState.setVisibility(e)}findLocation(){r.routeStore.findLocation()}zoomIn(){r.uiState.zoomIn()}zoomOut(){r.uiState.zoomOut()}switchView(){r.maplibreStore.activateMaplibre()}setCamera(e){p("setCamera called with camera=%O",e);const t=I.safeParse(e);if(!t.success){a("setCamera",t.error.message,"EFP001B00");return}r.uiState.setMapSettings(re(t.data))}getCamera(){return oe(r.uiState.mapSettings)}zoomTo(e,t){p("zoomTo called with selectors=%O options=%O",e,t);const o=P.safeParse(e);if(!o.success){a("zoomTo",o.error.message,"EFP001600");return}const n=w.safeParse(t);if(!n.success){a("zoomTo",n.error.message,"EFP001601");return}const s=this.getBounds(e);s&&this.fitBounds(s,t)}getBounds(e){p("getBounds called with selectors=%O",e);const t=P.safeParse(e);if(!t.success){a("getBounds",t.error.message,"EFP001400");return}const o=[];if(e.booths?.forEach(s=>{let i;s.externalId?i=r.boothStore.boothByExternalId.get(s.externalId):s.name&&(i=r.boothStore.boothByName.get(s.name.toLowerCase())),i?.rect&&o.push(i.rect)}),e.exhibitors?.forEach(s=>{let i;s.externalId?i=r.exhibitorStore.exhibitorByExternalId.get(s.externalId):s.name&&(i=r.exhibitorStore.exhibitorByName.get(s.name.toLowerCase())),i?.booths?.forEach(h=>{h.rect&&o.push(h.rect)})}),o.length===0)return;const n=E.fromUnion(...o);return{leftTop:{x:n.min.x,y:n.min.y},rightBottom:{x:n.max.x,y:n.max.y}}}fitBounds(e,t){if(p("fitBounds called with bounds=%O options=%O",e,t),!e){r.uiState.fitBounds();return}const o=U.safeParse(e);if(!o.success){a("fitBounds",o.error.message,"EFP001500");return}const n=w.safeParse(t);if(!n.success){a("fitBounds",n.error.message,"EFP001501");return}const s=E.fromMinMax({x:e.leftTop.x,y:e.leftTop.y},{x:e.rightBottom.x,y:e.rightBottom.y});r.uiState.moveToRect=t?.padding?s.expand(t.padding):s}getBoothRect(e){typeof e!="string"&&a("getBoothRect","A booth name must be passed.","EFP000F00");const t=S(e)?.rect;return t?l.fromBox(t):void 0}convertToGeo(e,t){if(!b?.properties?.config){a("convertToGeo","The coordinates cannot be converted because the GPS configuration is not defined.","EFP001000");return}if(!e||!t){a("convertToGeo","Both coordinates must be passed.","EFP001001");return}return se(e,t,b.properties.config)}getGeoConfig(){const e=b?.properties?.config;return e?{bearing:e.bearing??0,p0:e.p0,p1:e.p1,p2:e.p2}:null}releaseResources(){window.removeEventListener("error",_),r.maplibreStore.dispose(),X(),Q(),Z(),te(),this.root.unmount(),super.releaseResources()}search(e){return typeof e!="string"&&a("search","A search string must be passed.","EFP001100"),r.fuzzySearchEngineStore.loadEngine().then(()=>(r.searchStore.selectSearch(e),r.uiState.fuzzySearchItems.map(t=>({item:g(t.item),score:t.score}))))}getFloors(){return r.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 t=this.getFloors();if(e.name){const o=t.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=t.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,t){const{boothExternalIds:o,exhibitorExternalIds:n}=t?.length?k(t):{boothExternalIds:[],exhibitorExternalIds:[]};H({pathwayId:e,boothIds:o,exhibitorIds:n})}showPathwayOnly(e,t){this.activateFloor({name:t}),r.layerStore.showPathWay(e),r.uiState.setPathwayOnlyMode(!0);const o=r.layerStore.findLayer(e),n=r.layerStore.findLayer(t),s=o?.rect||o?.viewbox?o:n;if(s?.rect||s?.viewbox){const i=s.viewbox??s.rect;r.uiState.moveToRect=i.clone()}}hidePathways(){this.highlightBooths([]),r.layerStore.hidePathways(),r.uiState.setPathwayOnlyMode(!1)}showSearch(){r.selectSearch("")}changeLanguage(e){const t=e?.toLowerCase?.();if(!ae(t)){a("changeLanguage",`Language "${e}" was not found. Available languages: ${ne().map(o=>o.id).join(",")}`,"EFP001300");return}he(t)}isGpsTrackingEnabled(){return r.routeStore.gpsEnabled}setGpsTrackingEnabled(e){r.routeStore.setGpsTrackingEnabled(e)}deselectCurrentPosition(){r.routeStore.selectCurrentPosition(null,!1)}deselectRoute(){r.routeStore.selectRoute(null),r.routeStore.setOnlyAccessible(!1)}reset(){this.selectBooth(""),this.selectExhibitor(""),this.selectCategory(),this.deselectCurrentPosition(),this.deselectRoute(),this.highlightEntities([]),r.uiState.kioskData&&r.resetCameraFn?r.resetCameraFn?.():this.fitBounds()}selectAccessibleRoute(e){r.routeStore.setOnlyAccessible(!0),this.selectRoute(e)}}function m(f){return typeof f=="string"?S(f):r.routeStore.getNearestBooth(f)}let L=0;function a(f,e,t){const o=`Error calling "${f}" SDK method.`,n=`${e.endsWith(".")?e:e+"."} More information at`;let s="https://js-sdk.expofp.com/api/packages";if(t&&(s+=`#error-${t}`),console.error(`${o} ${n} ${s}`),r.fp.disableRuntimeAlerts)return;r.uiState.setGlobalErrorMessage({title:o,body:T(A,{children:[n," ",x("a",{href:s,target:"_blank",rel:"noreferrer",children:s})]})}),clearTimeout(L);const i=8e3;L=window.setTimeout(()=>{const h=async()=>{r.uiState.globalErrorMessages.length>0&&(r.uiState.popGlobalErrorMessage(),await new Promise(u=>setTimeout(u,i/2)),h())};h()},i)}class l{get h(){return Math.abs(this.y2-this.y1)}get w(){return Math.abs(this.x2-this.x1)}get cx(){return(this.x1+this.x2)/2}get cy(){return(this.y1+this.y2)/2}constructor(e,t,o,n){if(e>o){const s=e;e=o,o=s}if(t>n){const s=t;t=n,n=s}this.x1=e,this.y1=t,this.x2=o,this.y2=n}static fromBox(e){return new l(e.min.x,e.min.y,e.max.x,e.max.y)}static fromCxcywh(e,t,o,n){return new l(e-o/2,t-n/2,e+o/2,t+n/2)}contains(e){return e.x1>=this.x1&&e.x2<=this.x2&&e.y1>=this.y1&&e.y2<=this.y2}intersects(e){const t=Math.max(this.x1,e.x1),o=Math.min(this.x2,e.x2),n=Math.max(this.y1,e.y1),s=Math.min(this.y2,e.y2);return o>=t&&s>=n}getIntersection(e){const t=Math.max(this.x1,e.x1),o=Math.min(this.x2,e.x2),n=Math.max(this.y1,e.y1),s=Math.min(this.y2,e.y2);return o>=t&&s>=n?new l(t,n,o,s):new l(0,0,0,0)}getRotated90(){return l.fromCxcywh(this.cx,this.cy,this.h,this.w)}normalize(e,t){return new l(this.x1/e,this.y1/t,this.x2/e,this.y2/t)}withPadding(e,t=e){return this.w<e*2||this.h<t*2?this:l.fromCxcywh(this.cx,this.cy,this.w-e*2,this.h-t*2)}scale(e){return new l(this.x1*e,this.y1*e,this.x2*e,this.y2*e)}getArea(){return this.w*this.h}clone(){return new l(this.x1,this.y1,this.x2,this.y2)}translate(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this}equals(e){return e.x1===this.x1&&e.x2===this.x2&&e.y1===this.y1&&e.y2===this.y2}toString(){return this.x1+","+this.y1+","+this.w+","+this.h}containsPoint(e,t){return e>=this.x1&&e<=this.x2&&t>=this.y1&&t<=this.y2}}
1
+ import{Fragment as A,jsx as x,jsxs as T}from"react/jsx-runtime";import{Box as E}from"@expofp/geometry";import{CameraSchema as I}from"@expofp/schema";import{optimizeWaypointOrder as M}from"@expofp/wayfinding";import{ErrorBoundary as R}from"@sentry/react";import $ from"debug";import{reaction as V}from"mobx";import{createRoot as z}from"react-dom/client";import{install as j}from"resize-observer";import G from"./components/Layout";import{bindBoothHitTest as N}from"./components/Map/booth-by-xy";import{MAX_ROUTE_WAYPOINTS as d}from"./constants";import D from"./data";import{fpGeo as b}from"./data/fpGeo";import H from"./floorplan.loader";import{shouldLoadIntercom as q}from"./intercom";import{BoundsSchema as O,POISelectorsSchema as P,ZoomToOptionsSchema as w}from"./schemas/sdk.schemas";import{applyDeclarativeConfig as U,applyParameters as Y,applyPathway as W,initUrlRouting as X}from"./services/url-dispatch";import{destroyUrlSync as K}from"./services/url-sync";import r from"./store";import{bindDetailsEvents as Q}from"./store/details-events";import{bindRootElement as Z,destroyUiHandlers as J}from"./store/init/init-ui";import{findBooth as S,Route as B,separateExternalIds as v}from"./store/RouteStore";import{destroyGtag as _,GaEventActions as k,sendEventToGa as F,setConsentSettings as ee}from"./tools/gtag";import te from"./tools/report-error";import re,{resetTelemetry as ie}from"./tools/track-event";import{cameraToMapSettings as oe,mapSettingsToCamera as se}from"./utils/camera-map-settings";import{getStorage as C}from"./utils/entity-storage";import{getMostFrequent as ne}from"./utils/getMostFrequent";import{convertLocalToGps as ae,isValidPointCoords as y}from"./utils/gps";import{getLocales as he,hasLocale as ce,setLocale as le}from"./utils/i18n";import{mapEntity as g}from"./utils/mapEntity";const p=$("efp:api");j();export default class ue extends H{init(){U(),this.ignoreQuery||X(this.offHistory),re("load"),Z(r),r.fp=this,this.disposeDetailsEvents=Q(),this.disposeBoothHitTest=N(),ee(this.consent),F(k.Load,""),this.root=z(this.renderTarget),this.root.render(x(R,{children:x(G,{offHistory:this.offHistory,consent:this.consent})})),F(k.Rendered,""),V(()=>r.layerStore.layersLoaded,()=>{this.resolveReady(),r.initialized||this.onInit?.(this),r.initialized=!0});const e=q(D);e&&import("./intercom/bootIntercom").then(({bootIntercom:t})=>t(e)).catch(()=>{})}selectBooth(e){if(typeof e!="string"&&!Array.isArray(e)){a("selectBooth","Parameter must be a string or an array of strings.","EFP000000");return}const t=r.boothStore.booths.filter(i=>typeof e=="string"?i.name===e||i.externalId===e:e.includes(i.name)||e.includes(i.externalId));r.selectBooth(t)}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){r.uiState.menu=!1,r.searchStore.resetSearchBox(),r.uiState.details=null;return}const t=r.exhibitorStore.exhibitors.filter(s=>typeof e=="string"?s.name===e||s.externalId===e:e.includes(s.name)||e.includes(s.externalId));if(!t?.length)return;if(typeof e=="string"){r.selectExhibitor(t[0]),r.moveToList([t[0]]);return}const i=t.flatMap(s=>s.booths.map(o=>o.layer)),n=ne(i.map(s=>s.description));n&&r.layerStore.updateVisibility(n,!0),r.uiState.menu=!1,r.searchStore.resetSearchBox(),r.uiState.details=null,r.uiState.list={type:"filter",items:t,query:{key:"exhibitors",value:t.map(s=>s.name).join(",")}},r.moveToList()}highlightExhibitors(e){Array.isArray(e)||a("highlightExhibitors","Parameter must be an array of strings.","EFP000200"),r.boothStore.highlightedByExternalIds=[],r.exhibitorStore.highlightedByExternalIds=[...e]}highlightBooths(e){Array.isArray(e)||a("highlightBooths","Parameter must be an array of strings.","EFP000300"),r.exhibitorStore.highlightedByExternalIds=[],r.boothStore.highlightedByExternalIds=[...e]}highlightEntities(e){Array.isArray(e)||a("highlightEntities","Parameter must be an array of strings.","EFP000400");const{boothExternalIds:t,exhibitorExternalIds:i}=v(e);r.boothStore.highlightedByExternalIds=[...t],r.exhibitorStore.highlightedByExternalIds=[...i]}selectRoute(e,t){if(Array.isArray(e)){let i=[...e];const n=i.shift(),s=i.pop();if(i.length>d)throw new Error(`The maximum number of waypoints is ${d}.`);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}r.routeStore.selectRoute(new B(m(n),m(s),i.map(m)));return}e||a("selectRoute","At a minimum, the starting point must be passed.","EFP000402"),r.routeStore.selectRoute(new B(m(e),m(t)))}getOptimizedRoutes(e){if(!Array.isArray(e))return a("getOptimizedRoutes","Parameter must be an array.","EFP000500"),[];if(e.length>d)throw new Error(`The maximum number of waypoints is ${d}.`);const t=e.map(m).filter(n=>!!n);if(!t.length)throw new Error("No booths found for the provided waypoints.");const i=new Map;for(const n of t){const s=n.layer?.name??"",o=i.get(s);o?o.push(n):i.set(s,[n])}return Array.from(i.values()).map(n=>({waypoints:M(n.map(s=>[s.name,{x:s.rect.center.x,y:s.rect.center.y}]))}))}selectCurrentPosition(e,t,i){const n=y(e.x)&&y(e.y),s=y(e.lng)&&y(e.lat);!n&&!s&&a("selectCurrentPosition","A point must be passed. Either (x,y) or (lat,lng) are required.","EFP000600"),r.routeStore.selectCurrentPosition(e,t,i),this.onCurrentPositionChanged?.(e)}setBookmarks(e){(!Array.isArray(e)||!e.length)&&a("setBookmarks","Parameter must be an array.","EFP000700"),e.forEach(t=>{const i=r.exhibitorStore.exhibitors.find(n=>n.name===t.name||n.externalId===t.externalId);i&&(i.bookmarked=t.bookmarked)})}setEntitiesBookmarks(e){if(!Array.isArray(e)||!e.length){a("setEntitiesBookmarks","Parameter must be an array.","EFP000701");return}const t=["exhibitor","event","speaker","booth"],i=e.find(o=>!o.type||!t.includes(o.type));if(i){a("setEntitiesBookmarks",`Invalid entity type: ${i.type}. Must be one of: ${t.join(", ")}.`,"EFP000702");return}const n=C("bookmarked"),s={exhibitor:{existingIds:new Set(n.exhibitors||[]),finder:o=>r.exhibitorStore.findExhibitor(o),replacer:o=>r.exhibitorStore.replaceBookmarked(o)},event:{existingIds:new Set(n.events||[]),finder:o=>r.eventStore.findByNameOrSlug(o),replacer:o=>r.eventStore.replaceBookmarked(o)},speaker:{existingIds:new Set(n.speakers||[]),finder:o=>r.speakerStore.speakers.find(h=>h.name===o||h.externalId===o||h.slug===o),replacer:o=>r.speakerStore.replaceBookmarked(o)},booth:{existingIds:new Set(n.booths||[]),finder:o=>{const h=r.boothStore.findBooth(o);return h?.exhibitors.length===0?h:void 0},replacer:o=>r.boothStore.replaceBookmarked(o)}};e.forEach(o=>{const h=s[o.type],u=o.name||o.externalId||"",c=h.finder(u);c?o.bookmarked?h.existingIds.add(c.id):h.existingIds.delete(c.id):console.warn(`Entity not found: ${o.type} with query "${u}"`)}),Object.values(s).forEach(o=>{o.replacer(Array.from(o.existingIds))})}setEntitiesVisited(e){if(!Array.isArray(e)||!e.length){a("setEntitiesVisited","Parameter must be an array.","EFP000703");return}const t=["exhibitor","event"],i=e.find(o=>!o.type||!t.includes(o.type));if(i){a("setEntitiesVisited",`Invalid entity type: ${i.type}. Must be one of: ${t.join(", ")}.`,"EFP000704");return}const n=C("visited"),s={exhibitor:{existingIds:new Set(n.exhibitors||[]),finder:o=>r.exhibitorStore.findExhibitor(o),replacer:o=>r.exhibitorStore.replaceVisited(o)},event:{existingIds:new Set(n.events||[]),finder:o=>r.eventStore.findByNameOrSlug(o),replacer:o=>r.eventStore.replaceVisited(o)}};e.forEach(o=>{const h=s[o.type],u=o.name||o.externalId||"",c=h.finder(u);c?o.visited?h.existingIds.add(c.id):h.existingIds.delete(c.id):console.warn(`Entity not found: ${o.type} with query "${u}"`)}),Object.values(s).forEach(o=>{o.replacer(Array.from(o.existingIds))})}setMarkers(e){if(!e||!Array.isArray(e.icons)||!Array.isArray(e.markers)){a("setMarkers","Invalid input.","EFP000800");return}r.routeStore.setMarkers(e)}selectMarker(e,t=!0){return typeof e!="string"&&a("selectMarker","The identifier must be passed.","EFP000900"),r.routeStore.selectMarker(e,t)}drawCircles(e){Array.isArray(e)||a("drawCircles","Invalid input.","EFP000A00"),r.uiState.debugCircles=e}checkRoutes(){r.routeStore.checkRoutes()}updateLayerVisibility(e,t){typeof e!="string"&&a("updateLayerVisibility","The layer name (string) must be passed.","EFP000B00"),t||a("updateLayerVisibility","Passing a false value to visible will have no effect.","EFP000B01"),r.layerStore.updateVisibility(e,t)}getCenterCoordinates(){return r.fp.getCenterCoordinates()}exhibitorsList(){return r.exhibitorStore.exhibitors.map(e=>g(e))}boothsList(){return r.boothStore.booths.map(e=>g(e))}categoriesList(){return r.categoryStore.categories.map(e=>g(e))}selectCategory(e){if(e==null||typeof e!="string"){r.searchStore.selectSearch();return}const t=e?.toLowerCase(),i=r.categoryStore.categories.find(({name:n,slug:s})=>n?.toLowerCase()===t||s?.toLowerCase()===t);if(!i){a("selectCategory",`Category ${e} not found.`,"EFP000C01");return}r.selectCategory(i)}select(e){if(typeof e!="string"){a("select","Parameter must be a string.","EFP001700");return}const t=e,i=t?.toLowerCase(),n=r.boothStore.booths.find(c=>c.slug?.toLowerCase()===i||c.externalId?.toLowerCase()===i||c.externalId?.toLowerCase()?.replace(/\s+/g,"")===i);if(n){setTimeout(()=>r.selectBooth(n),250);return}const s=r.eventStore.eventItems.find(c=>c.slug?.toLowerCase()===i||c.externalId?.toLowerCase()===i);if(s){r.selectEventItem(s,!0);return}const o=r.exhibitorStore.exhibitors.find(c=>c.slug?.toLowerCase()===i||c.externalId?.toLowerCase()===i);if(o){setTimeout(()=>r.clickExhibitor(o),250);return}const h=r.categoryStore.categories.find(c=>c.slug===t);if(h){r.selectCategory(h);return}const u=r.speakerStore.findBySlug(t);if(u){r.selectSpeaker(u,!0);return}t.includes("heatmap=true")||r.searchStore.selectSearch(t)}showList(e){const t={bookmarks:()=>r.selectBookmarks(),visited:()=>r.selectVisited(),sessions:()=>r.selectSessions(),exhibitors:()=>r.selectExhibitors(),speakers:()=>r.selectSpeakers(),tours:()=>r.selectTours(),language:()=>r.selectLanguage()},i=t[e];if(!i){a("showList",`Unknown list "${e}". Must be one of: ${Object.keys(t).join(", ")}.`,"EFP001800");return}i()}selectTour(e){if(typeof e!="string"||!e){a("selectTour","A tour id must be passed.","EFP001900");return}const t=r.toursStore.getTourById(e);t?r.toursStore.launchTour(t,t.name,t.description):(console.warn(`Route with id "${e}" not found`),r.selectTours())}openPlanner(e={}){if(typeof e!="object"||e===null){a("openPlanner","An options object must be passed.","EFP001A00");return}const t=e.from?S(e.from):null;e.fromBookmarks?r.routePlannerStore.launchFromBookmarks(t??void 0):r.routePlannerStore.launchFromSlugs(e.items??[],t??void 0)}startBuildRoute(){r.uiState.startBuildRoute()}applyParameters(e){typeof e!="string"&&a("applyParameters","A query string must be passed.","EFP000D00"),Y(e)}getVisibility(){return r.uiState.visibility}setVisibility(e){(typeof e!="object"||!Object.keys(e).length)&&a("setVisibility","The parameter must be passed.","EFP000E00"),r.uiState.setVisibility(e)}findLocation(){r.routeStore.findLocation()}zoomIn(){r.uiState.zoomIn()}zoomOut(){r.uiState.zoomOut()}switchView(){r.maplibreStore.activateMaplibre()}setCamera(e){p("setCamera called with camera=%O",e);const t=I.safeParse(e);if(!t.success){a("setCamera",t.error.message,"EFP001B00");return}r.uiState.setMapSettings(oe(t.data))}getCamera(){return se(r.uiState.mapSettings)}zoomTo(e,t){p("zoomTo called with selectors=%O options=%O",e,t);const i=P.safeParse(e);if(!i.success){a("zoomTo",i.error.message,"EFP001600");return}const n=w.safeParse(t);if(!n.success){a("zoomTo",n.error.message,"EFP001601");return}const s=this.getBounds(e);s&&this.fitBounds(s,t)}getBounds(e){p("getBounds called with selectors=%O",e);const t=P.safeParse(e);if(!t.success){a("getBounds",t.error.message,"EFP001400");return}const i=[];if(e.booths?.forEach(s=>{let o;s.externalId?o=r.boothStore.boothByExternalId.get(s.externalId):s.name&&(o=r.boothStore.boothByName.get(s.name.toLowerCase())),o?.rect&&i.push(o.rect)}),e.exhibitors?.forEach(s=>{let o;s.externalId?o=r.exhibitorStore.exhibitorByExternalId.get(s.externalId):s.name&&(o=r.exhibitorStore.exhibitorByName.get(s.name.toLowerCase())),o?.booths?.forEach(h=>{h.rect&&i.push(h.rect)})}),i.length===0)return;const n=E.fromUnion(...i);return{leftTop:{x:n.min.x,y:n.min.y},rightBottom:{x:n.max.x,y:n.max.y}}}fitBounds(e,t){if(p("fitBounds called with bounds=%O options=%O",e,t),!e){r.uiState.fitBounds();return}const i=O.safeParse(e);if(!i.success){a("fitBounds",i.error.message,"EFP001500");return}const n=w.safeParse(t);if(!n.success){a("fitBounds",n.error.message,"EFP001501");return}const s=E.fromMinMax({x:e.leftTop.x,y:e.leftTop.y},{x:e.rightBottom.x,y:e.rightBottom.y});r.uiState.moveToRect=t?.padding?s.expand(t.padding):s}getBoothRect(e){typeof e!="string"&&a("getBoothRect","A booth name must be passed.","EFP000F00");const t=S(e)?.rect;return t?l.fromBox(t):void 0}convertToGeo(e,t){if(!b?.properties?.config){a("convertToGeo","The coordinates cannot be converted because the GPS configuration is not defined.","EFP001000");return}if(!e||!t){a("convertToGeo","Both coordinates must be passed.","EFP001001");return}return ae(e,t,b.properties.config)}getGeoConfig(){const e=b?.properties?.config;return e?{bearing:e.bearing??0,p0:e.p0,p1:e.p1,p2:e.p2}:null}releaseResources(){window.removeEventListener("error",te),this.disposeDetailsEvents?.(),this.disposeDetailsEvents=void 0,this.disposeBoothHitTest?.(),this.disposeBoothHitTest=void 0,r.maplibreStore.dispose(),K(),J(),_(),ie(),this.root.unmount(),super.releaseResources()}search(e){return typeof e!="string"&&a("search","A search string must be passed.","EFP001100"),r.fuzzySearchEngineStore.loadEngine().then(()=>(r.searchStore.selectSearch(e),r.uiState.fuzzySearchItems.map(t=>({item:g(t.item),score:t.score}))))}getFloors(){return r.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 t=this.getFloors();if(e.name){const i=t.find(n=>n.name===e.name||n.shortName===e.name);if(!i){a("activateFloor",`Floor with name "${e.name}" not found.`,"EFP001201");return}if(i.active)return;this.updateLayerVisibility(i.name,!0);return}if(e.index!==null){const i=t.find(s=>s.index===e.index),n=i?.name;if(!n){a("activateFloor",`Floor at index ${e.index} does not exist.`,"EFP001203");return}if(i.active)return;this.updateLayerVisibility(n,!0);return}}showPathway(e,t){const{boothExternalIds:i,exhibitorExternalIds:n}=t?.length?v(t):{boothExternalIds:[],exhibitorExternalIds:[]};W({pathwayId:e,boothIds:i,exhibitorIds:n})}showPathwayOnly(e,t){this.activateFloor({name:t}),r.layerStore.showPathWay(e),r.uiState.setPathwayOnlyMode(!0);const i=r.layerStore.findLayer(e),n=r.layerStore.findLayer(t),s=i?.rect||i?.viewbox?i:n;if(s?.rect||s?.viewbox){const o=s.viewbox??s.rect;r.uiState.moveToRect=o.clone()}}hidePathways(){this.highlightBooths([]),r.layerStore.hidePathways(),r.uiState.setPathwayOnlyMode(!1)}showSearch(){r.selectSearch("")}changeLanguage(e){const t=e?.toLowerCase?.();if(!ce(t)){a("changeLanguage",`Language "${e}" was not found. Available languages: ${he().map(i=>i.id).join(",")}`,"EFP001300");return}le(t)}isGpsTrackingEnabled(){return r.routeStore.gpsEnabled}setGpsTrackingEnabled(e){r.routeStore.setGpsTrackingEnabled(e)}deselectCurrentPosition(){r.routeStore.selectCurrentPosition(null,!1)}deselectRoute(){r.routeStore.selectRoute(null),r.routeStore.setOnlyAccessible(!1)}reset(){this.selectBooth(""),this.selectExhibitor(""),this.selectCategory(),this.deselectCurrentPosition(),this.deselectRoute(),this.highlightEntities([]),r.uiState.kioskData&&r.resetCameraFn?r.resetCameraFn?.():this.fitBounds()}selectAccessibleRoute(e){r.routeStore.setOnlyAccessible(!0),this.selectRoute(e)}}function m(f){return typeof f=="string"?S(f):r.routeStore.getNearestBooth(f)}let L=0;function a(f,e,t){const i=`Error calling "${f}" SDK method.`,n=`${e.endsWith(".")?e:e+"."} More information at`;let s="https://js-sdk.expofp.com/api/packages";if(t&&(s+=`#error-${t}`),console.error(`${i} ${n} ${s}`),r.fp.disableRuntimeAlerts)return;r.uiState.setGlobalErrorMessage({title:i,body:T(A,{children:[n," ",x("a",{href:s,target:"_blank",rel:"noreferrer",children:s})]})}),clearTimeout(L);const o=8e3;L=window.setTimeout(()=>{const h=async()=>{r.uiState.globalErrorMessages.length>0&&(r.uiState.popGlobalErrorMessage(),await new Promise(u=>setTimeout(u,o/2)),h())};h()},o)}class l{get h(){return Math.abs(this.y2-this.y1)}get w(){return Math.abs(this.x2-this.x1)}get cx(){return(this.x1+this.x2)/2}get cy(){return(this.y1+this.y2)/2}constructor(e,t,i,n){if(e>i){const s=e;e=i,i=s}if(t>n){const s=t;t=n,n=s}this.x1=e,this.y1=t,this.x2=i,this.y2=n}static fromBox(e){return new l(e.min.x,e.min.y,e.max.x,e.max.y)}static fromCxcywh(e,t,i,n){return new l(e-i/2,t-n/2,e+i/2,t+n/2)}contains(e){return e.x1>=this.x1&&e.x2<=this.x2&&e.y1>=this.y1&&e.y2<=this.y2}intersects(e){const t=Math.max(this.x1,e.x1),i=Math.min(this.x2,e.x2),n=Math.max(this.y1,e.y1),s=Math.min(this.y2,e.y2);return i>=t&&s>=n}getIntersection(e){const t=Math.max(this.x1,e.x1),i=Math.min(this.x2,e.x2),n=Math.max(this.y1,e.y1),s=Math.min(this.y2,e.y2);return i>=t&&s>=n?new l(t,n,i,s):new l(0,0,0,0)}getRotated90(){return l.fromCxcywh(this.cx,this.cy,this.h,this.w)}normalize(e,t){return new l(this.x1/e,this.y1/t,this.x2/e,this.y2/t)}withPadding(e,t=e){return this.w<e*2||this.h<t*2?this:l.fromCxcywh(this.cx,this.cy,this.w-e*2,this.h-t*2)}scale(e){return new l(this.x1*e,this.y1*e,this.x2*e,this.y2*e)}getArea(){return this.w*this.h}clone(){return new l(this.x1,this.y1,this.x2,this.y2)}translate(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this}equals(e){return e.x1===this.x1&&e.x2===this.x2&&e.y1===this.y1&&e.y2===this.y2}toString(){return this.x1+","+this.y1+","+this.w+","+this.h}containsPoint(e,t){return e>=this.x1&&e<=this.x2&&t>=this.y1&&t<=this.y2}}
@@ -45,6 +45,17 @@ export declare abstract class BoothBase {
45
45
  * only at the rotation-sensitive render/geometry sites; the footprint
46
46
  * itself ({@link rect}) is axis-aligned and never carries this rotation. */
47
47
  readonly rotate: number;
48
+ /**
49
+ * Height of the booth's top surface above the floor, from the `data-elev` attribute on its
50
+ * `<rect>`; `0` when the attribute is absent. Held apart from {@link rect} for the same reason as
51
+ * {@link rotate} — a `Box` is pure 2D with no elevation — and combined into a geometry `Rect` as
52
+ * its fourth argument wherever something is drawn *on* the booth: its fill, labels, badges,
53
+ * bookmarks, borders and logo. That is what places those on the roof rather than on the floor.
54
+ *
55
+ * Stored as authored, with no sign flip: the renderer's scene mirrors z, so plan space reads
56
+ * positive-up and a booth 50 units tall simply has `elevation: 50`.
57
+ */
58
+ readonly elevation: number;
48
59
  readonly paths: PathInfo[];
49
60
  readonly pathsWithRect: boolean;
50
61
  readonly slug: string;
@@ -42,6 +42,8 @@ export default class LayerStore {
42
42
  get visible(): Layer[];
43
43
  get loaded(): Layer[];
44
44
  get rectangle(): Box | null;
45
+ /** Union of all layers' rects to use as a bounds for camera */
46
+ get bounds(): Box | undefined;
45
47
  get viewboxRectangle(): Box | null;
46
48
  get pathwayLayers(): Layer[];
47
49
  get floors(): (Floor & {
@@ -1 +1 @@
1
- import{__decorate as a}from"tslib";import{Box as d}from"@expofp/geometry";import{action as c,computed as f,observable as h,runInAction as m}from"mobx";import y from"../components/Map/drawing/config/config-load-layer";import{getFpSvgJs as w}from"../data/fp-payloads";import b from"../tools/settings";import{areLayersEnabled as v}from"../utils/areLayersEnabled";import{shortenName as g}from"../utils/shortenName";import n from".";const x=["money2020usa","rodion2","possible2025","2025virtuosotravelweek","zscalerskofy26","gamescom2025"];export var LayersMode;(function(s){s[s.Default=0]="Default",s[s.Separated=1]="Separated",s[s.Radio=2]="Radio",s[s.CheckBox=3]="CheckBox"})(LayersMode||(LayersMode={}));export var LayerMode;(function(s){s[s.Unset=0]="Unset",s[s.AlwaysVisible=1]="AlwaysVisible",s[s.AlwaysHidden=2]="AlwaysHidden",s[s.TurnedOn=3]="TurnedOn",s[s.TurnedOff=4]="TurnedOff"})(LayerMode||(LayerMode={}));export class Layer{constructor(){this.basePriority=0,this.name="",this.description="",this.frozen=!1,this.rect=null,this.viewbox=null,this.configured=!1,this.childLayers=[],this.rootParent=null,this.mode=LayerMode.Unset,this.children=[],this.loaded=!1,this.visible=!1}get shortName(){return g(this.description)}}a([h],Layer.prototype,"loaded",void 0),a([h],Layer.prototype,"visible",void 0);export default class l{constructor(){this.layers=[],this.mode=LayersMode.Default,this.layersLoaded=!1,this.updateVisibilityTimeout=0,this.selectFloorTimeout=0}get visible(){return this.layers.filter(r=>r.frozen||r.visible)}get loaded(){return this.layers.filter(r=>r.loaded)}get rectangle(){const r=this.visible.filter(t=>!t.frozen).map(t=>t.viewbox??t.rect).filter(t=>!!t);return this.mode!==LayersMode.Radio||!r.length?null:d.fromUnion(...r)||null}get viewboxRectangle(){const r=this.visible.filter(t=>!t.frozen).map(t=>t.viewbox).filter(t=>!!t);return r.length&&d.fromUnion(...r)||null}get pathwayLayers(){return this.layers.filter(r=>r.pathway)}get floors(){if(!v())return[];const r=new Set(this.layers.filter(e=>e&&!e.frozen&&!e.rootParent&&!e.pathway).concat(n.routeStore.layers.filter(e=>e&&e.mode!==LayerMode.AlwaysHidden&&e.mode!==LayerMode.AlwaysVisible))),t=Array.from(r).reverse();return t.map((e,i)=>{const o=n.routeStore.layers.length>0&&n.routeStore.layers.indexOf(e)===-1,u=n.toursStore.tourLayers.length>0&&n.toursStore.tourLayers.indexOf(e)===-1;return{layer:e,name:e.name,shortName:e.shortName,description:e.description,active:e.visible,disabled:!!(o||u),index:e.floorIndex??t.length-i-1}})}selectFloor(r){if(this.selectFloorTimeout)return;this.selectFloorTimeout=window.setTimeout(()=>this.selectFloorTimeout=0,500);const t=this.layers.find(i=>i.description===r.description);if(!t)return;if(this.mode===LayersMode.Radio){if(this.updateVisibility(t,!0),n.maplibreStore.showMaplibre)return;if(!!w().__fpSettings?.fpVer||x.includes(b.EXPO)){const o=t.viewbox??t.rect;n.uiState.moveToRect=o}else{const o=this.layers.indexOf(this.layers.filter(p=>!p.frozen&&p.visible)[0]),u=this.layers.indexOf(t);if(o===u)return;n.uiState.zoomBy=u<o?.95:1.05}}else this.updateVisibility(t,!t.visible);const e=n.toursStore.getTourLayerInfo(t.name)||n.toursStore.getTourLayerInfo(t.description);if(e){this.showPathWay(e.id);return}n.toursStore.stopTour()}updateVisibility(r,t){if(this.mode===LayersMode.Radio&&!t)return;const e=r instanceof Layer?r:this.findLayer(r);if(!e||e.visible===t){e&&n.routeStore.currentRouteLayer!==e&&(n.routeStore.currentRouteLayer=e);return}y(e,n.rendererService).then(()=>{this.mode===LayersMode.Radio&&this.layers.filter(i=>!i.pathway).forEach(i=>{i.name!==e.name&&!i.frozen&&i.visible&&(i.visible=!1,i.childLayers.forEach(o=>{o.visible=!1}))}),e&&(e.visible=t,e.childLayers.forEach(i=>{i.visible=t}),t&&(n.routeStore.currentRouteLayer=e),typeof n.fp.onFloorActivated=="function"&&(clearTimeout(this.updateVisibilityTimeout),this.updateVisibilityTimeout=window.setTimeout(()=>{const i=n.fp.getFloors();n.fp.onFloorActivated(i.find(o=>o.name===e.name))})))})}findLayer(r){if(r==null)return null;const t=this.layers.filter(o=>!o.rootParent);if(typeof r=="number"){const o=t.filter(u=>!u.frozen)[r];if(o)return o}const e=r.toString().toLowerCase(),i=t.find(o=>{const u=(o.name.match(/(-?[0-9]+)/)||"")[0];return e===o?.name.toLowerCase()||e===o?.description.toLowerCase()||e===o?.shortName.toLowerCase()||e===u});return i||(/\D/.test(e)?null:t.filter(o=>!o.frozen)[parseInt(e)]??null)}getPathwayList(){return this.layers.filter(r=>r.pathway)}async showPathWay(r){try{const t=this.findLayer(r);if(!t)throw new Error(`There is no pathway with this name. ${r}`);await y(t,n.rendererService);const e=this.getPathwayList();m(()=>{e.forEach(i=>{const o=i.name===r;i.visible=o,i.childLayers.forEach(u=>{u.visible=o})})})}catch(t){console.error("showPathWay",t)}}hidePathways(){this.getPathwayList().forEach(t=>{t.visible=!1,t.childLayers.forEach(e=>{e.visible=!1})})}}a([h],l.prototype,"layers",void 0),a([h],l.prototype,"defaultLayer",void 0),a([h],l.prototype,"mode",void 0),a([h],l.prototype,"layersLoaded",void 0),a([f({keepAlive:!0})],l.prototype,"visible",null),a([f({keepAlive:!0})],l.prototype,"loaded",null),a([f({keepAlive:!0})],l.prototype,"rectangle",null),a([f({keepAlive:!0})],l.prototype,"viewboxRectangle",null),a([f],l.prototype,"pathwayLayers",null),a([f],l.prototype,"floors",null),a([c],l.prototype,"selectFloor",null),a([c],l.prototype,"updateVisibility",null),a([c],l.prototype,"showPathWay",null),a([c],l.prototype,"hidePathways",null);
1
+ import{__decorate as n}from"tslib";import{Box as p}from"@expofp/geometry";import{action as c,computed as f,observable as h,runInAction as m}from"mobx";import y from"../components/Map/drawing/config/config-load-layer";import{getFpSvgJs as b}from"../data/fp-payloads";import w from"../tools/settings";import{areLayersEnabled as v}from"../utils/areLayersEnabled";import{shortenName as g}from"../utils/shortenName";import a from".";const x=["money2020usa","rodion2","possible2025","2025virtuosotravelweek","zscalerskofy26","gamescom2025"];export var LayersMode;(function(s){s[s.Default=0]="Default",s[s.Separated=1]="Separated",s[s.Radio=2]="Radio",s[s.CheckBox=3]="CheckBox"})(LayersMode||(LayersMode={}));export var LayerMode;(function(s){s[s.Unset=0]="Unset",s[s.AlwaysVisible=1]="AlwaysVisible",s[s.AlwaysHidden=2]="AlwaysHidden",s[s.TurnedOn=3]="TurnedOn",s[s.TurnedOff=4]="TurnedOff"})(LayerMode||(LayerMode={}));export class Layer{constructor(){this.basePriority=0,this.name="",this.description="",this.frozen=!1,this.rect=null,this.viewbox=null,this.configured=!1,this.childLayers=[],this.rootParent=null,this.mode=LayerMode.Unset,this.children=[],this.loaded=!1,this.visible=!1}get shortName(){return g(this.description)}}n([h],Layer.prototype,"loaded",void 0),n([h],Layer.prototype,"visible",void 0);export default class l{constructor(){this.layers=[],this.mode=LayersMode.Default,this.layersLoaded=!1,this.updateVisibilityTimeout=0,this.selectFloorTimeout=0}get visible(){return this.layers.filter(r=>r.frozen||r.visible)}get loaded(){return this.layers.filter(r=>r.loaded)}get rectangle(){const r=this.visible.filter(e=>!e.frozen).map(e=>e.viewbox??e.rect).filter(e=>!!e);return this.mode!==LayersMode.Radio||!r.length?null:p.fromUnion(...r)||null}get bounds(){const r=this.visible.map(e=>e.viewbox??e.rect).filter(Boolean);return r.length?p.fromUnion(...r):void 0}get viewboxRectangle(){const r=this.visible.filter(e=>!e.frozen).map(e=>e.viewbox).filter(e=>!!e);return r.length&&p.fromUnion(...r)||null}get pathwayLayers(){return this.layers.filter(r=>r.pathway)}get floors(){if(!v())return[];const r=new Set(this.layers.filter(t=>t&&!t.frozen&&!t.rootParent&&!t.pathway).concat(a.routeStore.layers.filter(t=>t&&t.mode!==LayerMode.AlwaysHidden&&t.mode!==LayerMode.AlwaysVisible))),e=Array.from(r).reverse();return e.map((t,i)=>{const o=a.routeStore.layers.length>0&&a.routeStore.layers.indexOf(t)===-1,u=a.toursStore.tourLayers.length>0&&a.toursStore.tourLayers.indexOf(t)===-1;return{layer:t,name:t.name,shortName:t.shortName,description:t.description,active:t.visible,disabled:!!(o||u),index:t.floorIndex??e.length-i-1}})}selectFloor(r){if(this.selectFloorTimeout)return;this.selectFloorTimeout=window.setTimeout(()=>this.selectFloorTimeout=0,500);const e=this.layers.find(i=>i.description===r.description);if(!e)return;if(this.mode===LayersMode.Radio){if(this.updateVisibility(e,!0),a.maplibreStore.showMaplibre)return;if(!!b().__fpSettings?.fpVer||x.includes(w.EXPO)){const o=e.viewbox??e.rect;a.uiState.moveToRect=o}else{const o=this.layers.indexOf(this.layers.filter(d=>!d.frozen&&d.visible)[0]),u=this.layers.indexOf(e);if(o===u)return;a.uiState.zoomBy=u<o?.95:1.05}}else this.updateVisibility(e,!e.visible);const t=a.toursStore.getTourLayerInfo(e.name)||a.toursStore.getTourLayerInfo(e.description);if(t){this.showPathWay(t.id);return}a.toursStore.stopTour()}updateVisibility(r,e){if(this.mode===LayersMode.Radio&&!e)return;const t=r instanceof Layer?r:this.findLayer(r);if(!t||t.visible===e){t&&a.routeStore.currentRouteLayer!==t&&(a.routeStore.currentRouteLayer=t);return}y(t).then(()=>{this.mode===LayersMode.Radio&&this.layers.filter(i=>!i.pathway).forEach(i=>{i.name!==t.name&&!i.frozen&&i.visible&&(i.visible=!1,i.childLayers.forEach(o=>{o.visible=!1}))}),t&&(t.visible=e,t.childLayers.forEach(i=>{i.visible=e}),e&&(a.routeStore.currentRouteLayer=t),typeof a.fp.onFloorActivated=="function"&&(clearTimeout(this.updateVisibilityTimeout),this.updateVisibilityTimeout=window.setTimeout(()=>{const i=a.fp.getFloors();a.fp.onFloorActivated(i.find(o=>o.name===t.name))})))})}findLayer(r){if(r==null)return null;const e=this.layers.filter(o=>!o.rootParent);if(typeof r=="number"){const o=e.filter(u=>!u.frozen)[r];if(o)return o}const t=r.toString().toLowerCase(),i=e.find(o=>{const u=(o.name.match(/(-?[0-9]+)/)||"")[0];return t===o?.name.toLowerCase()||t===o?.description.toLowerCase()||t===o?.shortName.toLowerCase()||t===u});return i||(/\D/.test(t)?null:e.filter(o=>!o.frozen)[parseInt(t)]??null)}getPathwayList(){return this.layers.filter(r=>r.pathway)}async showPathWay(r){try{const e=this.findLayer(r);if(!e)throw new Error(`There is no pathway with this name. ${r}`);await y(e);const t=this.getPathwayList();m(()=>{t.forEach(i=>{const o=i.name===r;i.visible=o,i.childLayers.forEach(u=>{u.visible=o})})})}catch(e){console.error("showPathWay",e)}}hidePathways(){this.getPathwayList().forEach(e=>{e.visible=!1,e.childLayers.forEach(t=>{t.visible=!1})})}}n([h],l.prototype,"layers",void 0),n([h],l.prototype,"defaultLayer",void 0),n([h],l.prototype,"mode",void 0),n([h],l.prototype,"layersLoaded",void 0),n([f({keepAlive:!0})],l.prototype,"visible",null),n([f({keepAlive:!0})],l.prototype,"loaded",null),n([f({keepAlive:!0})],l.prototype,"rectangle",null),n([f({keepAlive:!0})],l.prototype,"bounds",null),n([f({keepAlive:!0})],l.prototype,"viewboxRectangle",null),n([f],l.prototype,"pathwayLayers",null),n([f],l.prototype,"floors",null),n([c],l.prototype,"selectFloor",null),n([c],l.prototype,"updateVisibility",null),n([c],l.prototype,"showPathWay",null),n([c],l.prototype,"hidePathways",null);
@@ -1,5 +1,4 @@
1
1
  import FloorPlanReady from '../floorplan.ready';
2
- import { RendererService } from '../renderer';
3
2
  import { URLFilterManager } from '../services/URLFilterManager';
4
3
  import BookmarksStore from './BookmarksStore';
5
4
  import BoothStore, { Booth } from './BoothStore';
@@ -53,7 +52,6 @@ export default class RootStore {
53
52
  readonly bookmarksStore: BookmarksStore;
54
53
  readonly urlFilterManager: URLFilterManager;
55
54
  readonly shortcutRegistry: ShortcutRegistry;
56
- readonly rendererService: RendererService;
57
55
  fp: FloorPlanReady;
58
56
  initialized: boolean;
59
57
  resetCameraFn: () => void;
@@ -1 +1 @@
1
- import{__decorate as o}from"tslib";import{action as s,computed as y,observable as S,runInAction as c}from"mobx";import{LANGUAGE_TYPE as w}from"../constants";import{RendererService as v}from"../renderer";import{URLFilterManager as b}from"../services/URLFilterManager";import{GaEventActions as n,sendEventToGa as p}from"../tools/gtag";import g from"../tools/logger";import{isWebGlSupported as k}from"../utils";import{resetLocale as x}from"../utils/i18n";import h from"../utils/is-mobile";import u from"../utils/is-webview";import{sanitizeSearch as B}from"../utils/sanitizeText";import _ from"./BookmarksStore";import L,{BoothBase as f,RegularBooth as E}from"./BoothStore";import C from"./CategoryFilterStore";import T,{Category as I}from"./CategoryStore";import F,{EventItem as M}from"./EventStore";import O,{Exhibitor as m}from"./ExhibitorStore";import z from"./FuzzySearchEngineStore";import R from"./HeatmapStore";import A from"./IntercomStore";import P,{LayersMode as d}from"./LayerStore";import V from"./MaplibreStore";import G from"./OverlayStore";import q from"./PoiMarkerStore";import N from"./PoiTypeStore";import{SearchShortcutProvider as U}from"./providers/SearchShortcutProvider";import{SessionsShortcutProvider as W}from"./providers/SessionsShortcutProvider";import{SpeakerShortcutProvider as j}from"./providers/SpeakerShortcutProvider";import D from"./RoutePlannerStore";import H from"./RouteStore";import K from"./SearchButtonsStore";import Y from"./SearchStore";import $ from"./SessionsFilterStore";import{ShortcutRegistry as J}from"./ShortcutRegistry";import Q from"./SpeakerFilterStore";import X from"./SpeakerStore";import{SpeakerItem as Z}from"./SpeakerStore";import tt from"./ToursStore";import et from"./UIState";export default class i{setResetCameraFn(t){this.resetCameraFn=t}constructor(){this.rendererService=new v,this.initialized=!1,this.categoryStore=new T(this),this.exhibitorStore=new O(this),this.boothStore=new L(this),this.routeStore=new H(this),this.routePlannerStore=new D(this),this.toursStore=new tt(this),this.uiState=new et(this),this.overlayStore=new G(this),this.maplibreStore=new V(this),this.layerStore=new P,this.intercomStore=new A,this.eventStore=new F(this),this.heatmapStore=new R,this.poiTypeStore=new N(this),this.poiMarkerStore=new q(this),this.fuzzySearchEngineStore=new z(["name","title","fullName","booths.name"]),this.categoryFilterStore=new C(this),this.sessionsFilterStore=new $(this),this.speakerStore=new X(this),this.speakerFilterStore=new Q(this),this.searchStore=new Y(this),this.searchButtonsStore=new K(this),this.bookmarksStore=new _(this),this.urlFilterManager=new b(this),this.shortcutRegistry=new J,this.registerShortcutProviders()}selectExhibitor(t,r=!0){this.uiState.hoveredExhibitor=null,this.uiState.details=t;var e=t.booths.filter(a=>a.visible),l=t.booths.filter(a=>!a.visible);!e.length&&l.length&&this.layerStore.updateVisibility(l[0].layer,!0),r&&setTimeout(()=>this.moveToList(t.booths.filter(a=>a.visible)),u||h?500:50)}selectBooth(t,r=!0){let e=Array.isArray(t)?t:[t];this.uiState.details=e[0],e.length===1&&e[0].schedule?.length&&(this.uiState.desiredOverlaySize="medium"),e.length===1&&e[0].layer&&!e[0].visible&&this.layerStore.mode===d.Radio&&this.layerStore.updateVisibility(e[0].layer,!0),r&&setTimeout(()=>this.moveToList(e),u||h?500:50)}reset(){const t=window.__searchi;t&&t.querySelector&&t.querySelector("input[type=search]")&&t.querySelector("input[type=search]").blur&&t.querySelector("input[type=search]").blur(),window.setTimeout(()=>{this.uiState.setKioskModeEnabled||x().then(()=>{c(()=>{this.selectSearch(""),this.uiState.details=null,this.resetCameraFn?.(),this.uiState.menu=!1,this.searchStore.resetSearchBox(),this.searchButtonsStore.clearAllFilters()}),setTimeout(()=>{c(()=>{this.uiState.inIdle=!0})},100)})},1e3)}selectNone(){window.__resett&&window.__resett(),this.uiState.details=this.uiState.selectedCategory}selectBookmarks(){this.uiState.details=null,this.uiState.list={type:"bookmarks"}}selectVisited(){this.uiState.details=null,this.uiState.list={type:"visited"}}selectLanguage(){this.uiState.details=null,this.uiState.list={type:w}}selectCategory(t){window.__resett&&window.__resett(),this.uiState.details=t,this.uiState.list={type:"category",category:t},this.uiState.desiredOverlaySize="full",t.exhibitors.find(e=>e.booths.find(l=>l.visible))||this.layerStore.updateVisibility(t.exhibitors[0]?.booths[0]?.layer,!0),setTimeout(()=>{this.uiState.moveToBooths=t.exhibitors.filter(e=>e.booths.find(l=>l.visible)).flatMap(e=>e.booths)},200)}selectEventItem(t,r=!0){if(this.uiState.hoveredExhibitor=null,this.uiState.details=t,this.uiState.desiredOverlaySize="medium",t.boothId){const e=this.boothStore.booths.find(l=>l.id===t.boothId);e&&e.layer&&!e.visible&&this.layerStore.mode===d.Radio&&this.layerStore.updateVisibility(e.layer,!0)}r&&setTimeout(()=>{if(t.boothId){const e=this.boothStore.booths.find(l=>l.id===t.boothId);e&&this.moveToList([e])}},u||h?500:50)}selectSearch(t){window.__resett&&window.__resett(),this.uiState.details=null,this.speakerStore.clearSelectedSpeaker(),this.uiState.list={type:"search",text:B(t,Object.keys(this.uiState.mapSettings).map(r=>`${r}=`)),focused:!1},this.uiState.activeListIndex=-1}clickBookmarks(){window.__resett&&window.__resett(),this.uiState.menu=!1,this.selectBookmarks(),this.moveToList(),this.showMap()}clickVisited(){window.__resett&&window.__resett(),this.uiState.menu=!1,this.selectVisited(),this.moveToList(),this.showMap()}clickLanguage(){window.__resett&&window.__resett(),this.uiState.menu=!1,this.selectLanguage()}clickCategory(t){window.__resett&&window.__resett(),this.uiState.menu=!1,this.selectCategory(t),this.uiState.onCategoryClick&&this.uiState.onCategoryClick({id:t.id,name:t.name,exhibitors:t.exhibitors.map(r=>r.id)}),setTimeout(()=>{this.moveToList(),this.showMap()},100)}clickSeminars(){this.clickCategory(this.categoryStore.seminarsCategory)}clickBoothInList(t){window.__resett&&window.__resett(),this.uiState.hoveredBooth=null,this.selectBooth(t),this.moveToList([t]),this.showMap()}clickBoothInList2(t){window.__resett&&window.__resett(),this.uiState.hoveredBooth=null,this.selectBooth(t,!1),window.setTimeout(()=>{this.moveToList([t]),this.showMap()},navigator.userAgent.toLowerCase().indexOf("android")>-1?400:50)}clickBooth(t){const r=this.uiState.details;if(this.uiState.menu=!1,this.uiState.list.type==="sessions"&&this.searchStore.selectSearch(),this.uiState.list.type==="speakers"&&this.searchStore.selectSearch(),this.uiState.list.type==="tours"&&this.searchStore.selectSearch(),this.uiState.list.type==="multi-point-tour"&&this.searchStore.selectSearch(),!(this.uiState.selectedRoute?.from&&this.uiState.selectedRoute?.to)){if(this.uiState.selectedRoute?.to&&!this.uiState.selectedRoute?.from&&t){this.routeStore.setStartPoint(t);return}if(t)this.routeStore.tempToBooth=t;else{this.uiState.details=null,this.fp.hidePathways(),this.uiState.list={type:"search",text:"",focused:!1},this.uiState.onBoothClick&&this.uiState.onBoothClick({target:null});return}if(this.uiState.onBoothClick){const e={name:"",description:""},l={target:{...t,layer:t.layer||e}};this.uiState.onBoothClick(l)}if(t.exhibitors.length===1&&t instanceof E){const e=t.exhibitors[0];r===e?p(n.ViewBooth,t.name):this.heatmapStore.forceTrack={action:n.ViewBooth,label:t.name,exhibitor:e},this.selectExhibitor(e,!1)}else r===t&&p(n.ViewBooth,t.name),this.selectBooth(t,!1);this.showMap()}}clickExhibitor2(t){this.selectExhibitor(t,!0),this.showMap()}clickExhibitor(t){window.setTimeout(()=>{this.clickExhibitor2(t)},navigator.userAgent.toLowerCase().indexOf("android")>-1?400:50)}showMap(){this.uiState.overlayPosition==="bottom"&&k&&(this.uiState.desiredOverlaySize="medium")}showOverlay(){this.uiState.overlayPosition==="bottom"&&(this.uiState.desiredOverlaySize="full")}toggleMapOverlay(){this.uiState.overlayPosition==="bottom"&&this.uiState.overlaySize==="full"?this.uiState.desiredOverlaySize="medium":this.uiState.overlayPosition==="bottom"&&this.uiState.overlaySize!=="full"&&(this.uiState.desiredOverlaySize="full")}moveToList(t){t=t||this.uiState.listItems;const r=[];t.forEach(e=>{if(e instanceof m)r.push(...e.booths.filter(l=>l.visible));else if(e instanceof f)e.visible&&r.push(e);else if(e instanceof M&&e.boothId){const l=this.boothStore.boothById.get(e.boothId);l?.visible&&r.push(l)}else e instanceof Z&&this.speakerStore.getEventsBySpeaker(e.id).forEach(l=>{if(!l.boothId)return;const a=this.boothStore.boothById.get(l.boothId);a?.visible&&r.push(a)})}),this.uiState.moveToBooths=r}moveToExhibitor(t){this.moveToList([t])}changeActiveListIndex(t){let r=this.uiState.activeListIndex+t;r=Math.max(0,Math.min(this.uiState.listItems.length-1,r)),this.uiState.activeListIndex=r}toggleModal(t){this.uiState.modalActive[t]=!this.uiState.modalActive[t]}openGallery(){this.uiState.galleryActive=!0}closeGallery(){this.uiState.galleryActive=!1}openActiveListItem(){const t=this.uiState.listItems[this.uiState.activeListIndex];t&&(g.log("Opening",t),t instanceof m?this.clickExhibitor(t):t instanceof I?this.clickCategory(t):t instanceof f&&this.clickBoothInList2(t))}toggleCategoryFilter(){this.uiState.categoryFilterOpen=!this.uiState.categoryFilterOpen}applyCategoryFilters(t){this.uiState.selectedCategoryFilters=t,this.uiState.categoryFilterOpen=!1}get filteredExhibitors(){return this.uiState.selectedCategoryFilters.length===0?this.exhibitorStore.exhibitors:this.exhibitorStore.exhibitors.filter(t=>this.uiState.selectedCategoryFilters.some(r=>t.categories.some(e=>e.id===r.id)))}selectSessions(){this.uiState.list={type:"sessions",text:"",focused:!1},this.uiState.menu=!1,this.uiState.selectedTrack=null,this.searchButtonsStore.setSubButtonId(null),this.searchButtonsStore.subButtonsEnabled&&this.searchButtonsStore.showSubButtons("sessions"),h&&(this.uiState.desiredOverlaySize="full")}selectExhibitors(){this.uiState.list={type:"exhibitors",text:"",focused:!1},this.uiState.menu=!1,h&&(this.uiState.desiredOverlaySize="full")}selectTours(){this.uiState.list={type:"tours",text:"",focused:!1},this.uiState.menu=!1,h&&(this.uiState.desiredOverlaySize="full")}selectSpeakers(){this.uiState.list={type:"speakers",text:"",focused:!1},this.uiState.menu=!1,h&&(this.uiState.desiredOverlaySize="full")}selectSpeaker(t,r=!0){this.speakerStore.selectSpeaker(t,r)}resetFilters(){this.searchButtonsStore.clearAllFilters()}registerShortcutProviders(){this.shortcutRegistry.register(new W(this)),this.shortcutRegistry.register(new j(this)),this.shortcutRegistry.register(new U(this))}}o([S],i.prototype,"initialized",void 0),o([S],i.prototype,"resetCameraFn",void 0),o([s],i.prototype,"setResetCameraFn",null),o([s],i.prototype,"selectExhibitor",null),o([s],i.prototype,"selectBooth",null),o([s],i.prototype,"reset",null),o([s],i.prototype,"selectNone",null),o([s],i.prototype,"selectBookmarks",null),o([s],i.prototype,"selectVisited",null),o([s],i.prototype,"selectLanguage",null),o([s],i.prototype,"selectCategory",null),o([s],i.prototype,"selectEventItem",null),o([s],i.prototype,"selectSearch",null),o([s],i.prototype,"clickBookmarks",null),o([s],i.prototype,"clickVisited",null),o([s],i.prototype,"clickLanguage",null),o([s],i.prototype,"clickCategory",null),o([s],i.prototype,"clickSeminars",null),o([s],i.prototype,"clickBoothInList",null),o([s],i.prototype,"clickBoothInList2",null),o([s],i.prototype,"clickBooth",null),o([s],i.prototype,"clickExhibitor2",null),o([s],i.prototype,"clickExhibitor",null),o([s],i.prototype,"showMap",null),o([s],i.prototype,"showOverlay",null),o([s],i.prototype,"toggleMapOverlay",null),o([s],i.prototype,"moveToList",null),o([s],i.prototype,"moveToExhibitor",null),o([s],i.prototype,"changeActiveListIndex",null),o([s],i.prototype,"toggleModal",null),o([s],i.prototype,"openGallery",null),o([s],i.prototype,"closeGallery",null),o([s],i.prototype,"openActiveListItem",null),o([s],i.prototype,"toggleCategoryFilter",null),o([s],i.prototype,"applyCategoryFilters",null),o([y],i.prototype,"filteredExhibitors",null),o([s],i.prototype,"selectSessions",null),o([s],i.prototype,"selectExhibitors",null),o([s],i.prototype,"selectTours",null),o([s],i.prototype,"selectSpeakers",null),o([s],i.prototype,"selectSpeaker",null),o([s],i.prototype,"resetFilters",null);
1
+ import{__decorate as o}from"tslib";import{action as s,computed as y,observable as S,runInAction as c}from"mobx";import{LANGUAGE_TYPE as w}from"../constants";import{URLFilterManager as v}from"../services/URLFilterManager";import{GaEventActions as n,sendEventToGa as p}from"../tools/gtag";import b from"../tools/logger";import{isWebGlSupported as g}from"../utils";import{resetLocale as k}from"../utils/i18n";import h from"../utils/is-mobile";import u from"../utils/is-webview";import{sanitizeSearch as x}from"../utils/sanitizeText";import B from"./BookmarksStore";import _,{BoothBase as f,RegularBooth as L}from"./BoothStore";import E from"./CategoryFilterStore";import C,{Category as T}from"./CategoryStore";import I,{EventItem as F}from"./EventStore";import M,{Exhibitor as m}from"./ExhibitorStore";import O from"./FuzzySearchEngineStore";import z from"./HeatmapStore";import A from"./IntercomStore";import R,{LayersMode as d}from"./LayerStore";import P from"./MaplibreStore";import V from"./OverlayStore";import G from"./PoiMarkerStore";import q from"./PoiTypeStore";import{SearchShortcutProvider as N}from"./providers/SearchShortcutProvider";import{SessionsShortcutProvider as U}from"./providers/SessionsShortcutProvider";import{SpeakerShortcutProvider as W}from"./providers/SpeakerShortcutProvider";import j from"./RoutePlannerStore";import D from"./RouteStore";import H from"./SearchButtonsStore";import K from"./SearchStore";import Y from"./SessionsFilterStore";import{ShortcutRegistry as $}from"./ShortcutRegistry";import J from"./SpeakerFilterStore";import Q from"./SpeakerStore";import{SpeakerItem as X}from"./SpeakerStore";import Z from"./ToursStore";import tt from"./UIState";export default class i{setResetCameraFn(t){this.resetCameraFn=t}constructor(){this.initialized=!1,this.categoryStore=new C(this),this.exhibitorStore=new M(this),this.boothStore=new _(this),this.routeStore=new D(this),this.routePlannerStore=new j(this),this.toursStore=new Z(this),this.uiState=new tt(this),this.overlayStore=new V(this),this.maplibreStore=new P(this),this.layerStore=new R,this.intercomStore=new A,this.eventStore=new I(this),this.heatmapStore=new z,this.poiTypeStore=new q(this),this.poiMarkerStore=new G(this),this.fuzzySearchEngineStore=new O(["name","title","fullName","booths.name"]),this.categoryFilterStore=new E(this),this.sessionsFilterStore=new Y(this),this.speakerStore=new Q(this),this.speakerFilterStore=new J(this),this.searchStore=new K(this),this.searchButtonsStore=new H(this),this.bookmarksStore=new B(this),this.urlFilterManager=new v(this),this.shortcutRegistry=new $,this.registerShortcutProviders()}selectExhibitor(t,r=!0){this.uiState.hoveredExhibitor=null,this.uiState.details=t;var e=t.booths.filter(a=>a.visible),l=t.booths.filter(a=>!a.visible);!e.length&&l.length&&this.layerStore.updateVisibility(l[0].layer,!0),r&&setTimeout(()=>this.moveToList(t.booths.filter(a=>a.visible)),u||h?500:50)}selectBooth(t,r=!0){let e=Array.isArray(t)?t:[t];this.uiState.details=e[0],e.length===1&&e[0].schedule?.length&&(this.uiState.desiredOverlaySize="medium"),e.length===1&&e[0].layer&&!e[0].visible&&this.layerStore.mode===d.Radio&&this.layerStore.updateVisibility(e[0].layer,!0),r&&setTimeout(()=>this.moveToList(e),u||h?500:50)}reset(){const t=window.__searchi;t&&t.querySelector&&t.querySelector("input[type=search]")&&t.querySelector("input[type=search]").blur&&t.querySelector("input[type=search]").blur(),window.setTimeout(()=>{this.uiState.setKioskModeEnabled||k().then(()=>{c(()=>{this.selectSearch(""),this.uiState.details=null,this.resetCameraFn?.(),this.uiState.menu=!1,this.searchStore.resetSearchBox(),this.searchButtonsStore.clearAllFilters()}),setTimeout(()=>{c(()=>{this.uiState.inIdle=!0})},100)})},1e3)}selectNone(){window.__resett&&window.__resett(),this.uiState.details=this.uiState.selectedCategory}selectBookmarks(){this.uiState.details=null,this.uiState.list={type:"bookmarks"}}selectVisited(){this.uiState.details=null,this.uiState.list={type:"visited"}}selectLanguage(){this.uiState.details=null,this.uiState.list={type:w}}selectCategory(t){window.__resett&&window.__resett(),this.uiState.details=t,this.uiState.list={type:"category",category:t},this.uiState.desiredOverlaySize="full",t.exhibitors.find(e=>e.booths.find(l=>l.visible))||this.layerStore.updateVisibility(t.exhibitors[0]?.booths[0]?.layer,!0),setTimeout(()=>{this.uiState.moveToBooths=t.exhibitors.filter(e=>e.booths.find(l=>l.visible)).flatMap(e=>e.booths)},200)}selectEventItem(t,r=!0){if(this.uiState.hoveredExhibitor=null,this.uiState.details=t,this.uiState.desiredOverlaySize="medium",t.boothId){const e=this.boothStore.booths.find(l=>l.id===t.boothId);e&&e.layer&&!e.visible&&this.layerStore.mode===d.Radio&&this.layerStore.updateVisibility(e.layer,!0)}r&&setTimeout(()=>{if(t.boothId){const e=this.boothStore.booths.find(l=>l.id===t.boothId);e&&this.moveToList([e])}},u||h?500:50)}selectSearch(t){window.__resett&&window.__resett(),this.uiState.details=null,this.speakerStore.clearSelectedSpeaker(),this.uiState.list={type:"search",text:x(t,Object.keys(this.uiState.mapSettings).map(r=>`${r}=`)),focused:!1},this.uiState.activeListIndex=-1}clickBookmarks(){window.__resett&&window.__resett(),this.uiState.menu=!1,this.selectBookmarks(),this.moveToList(),this.showMap()}clickVisited(){window.__resett&&window.__resett(),this.uiState.menu=!1,this.selectVisited(),this.moveToList(),this.showMap()}clickLanguage(){window.__resett&&window.__resett(),this.uiState.menu=!1,this.selectLanguage()}clickCategory(t){window.__resett&&window.__resett(),this.uiState.menu=!1,this.selectCategory(t),this.uiState.onCategoryClick&&this.uiState.onCategoryClick({id:t.id,name:t.name,exhibitors:t.exhibitors.map(r=>r.id)}),setTimeout(()=>{this.moveToList(),this.showMap()},100)}clickSeminars(){this.clickCategory(this.categoryStore.seminarsCategory)}clickBoothInList(t){window.__resett&&window.__resett(),this.uiState.hoveredBooth=null,this.selectBooth(t),this.moveToList([t]),this.showMap()}clickBoothInList2(t){window.__resett&&window.__resett(),this.uiState.hoveredBooth=null,this.selectBooth(t,!1),window.setTimeout(()=>{this.moveToList([t]),this.showMap()},navigator.userAgent.toLowerCase().indexOf("android")>-1?400:50)}clickBooth(t){const r=this.uiState.details;if(this.uiState.menu=!1,this.uiState.list.type==="sessions"&&this.searchStore.selectSearch(),this.uiState.list.type==="speakers"&&this.searchStore.selectSearch(),this.uiState.list.type==="tours"&&this.searchStore.selectSearch(),this.uiState.list.type==="multi-point-tour"&&this.searchStore.selectSearch(),!(this.uiState.selectedRoute?.from&&this.uiState.selectedRoute?.to)){if(this.uiState.selectedRoute?.to&&!this.uiState.selectedRoute?.from&&t){this.routeStore.setStartPoint(t);return}if(t)this.routeStore.tempToBooth=t;else{this.uiState.details=null,this.fp.hidePathways(),this.uiState.list={type:"search",text:"",focused:!1},this.uiState.onBoothClick&&this.uiState.onBoothClick({target:null});return}if(this.uiState.onBoothClick){const e={name:"",description:""},l={target:{...t,layer:t.layer||e}};this.uiState.onBoothClick(l)}if(t.exhibitors.length===1&&t instanceof L){const e=t.exhibitors[0];r===e?p(n.ViewBooth,t.name):this.heatmapStore.forceTrack={action:n.ViewBooth,label:t.name,exhibitor:e},this.selectExhibitor(e,!1)}else r===t&&p(n.ViewBooth,t.name),this.selectBooth(t,!1);this.showMap()}}clickExhibitor2(t){this.selectExhibitor(t,!0),this.showMap()}clickExhibitor(t){window.setTimeout(()=>{this.clickExhibitor2(t)},navigator.userAgent.toLowerCase().indexOf("android")>-1?400:50)}showMap(){this.uiState.overlayPosition==="bottom"&&g&&(this.uiState.desiredOverlaySize="medium")}showOverlay(){this.uiState.overlayPosition==="bottom"&&(this.uiState.desiredOverlaySize="full")}toggleMapOverlay(){this.uiState.overlayPosition==="bottom"&&this.uiState.overlaySize==="full"?this.uiState.desiredOverlaySize="medium":this.uiState.overlayPosition==="bottom"&&this.uiState.overlaySize!=="full"&&(this.uiState.desiredOverlaySize="full")}moveToList(t){t=t||this.uiState.listItems;const r=[];t.forEach(e=>{if(e instanceof m)r.push(...e.booths.filter(l=>l.visible));else if(e instanceof f)e.visible&&r.push(e);else if(e instanceof F&&e.boothId){const l=this.boothStore.boothById.get(e.boothId);l?.visible&&r.push(l)}else e instanceof X&&this.speakerStore.getEventsBySpeaker(e.id).forEach(l=>{if(!l.boothId)return;const a=this.boothStore.boothById.get(l.boothId);a?.visible&&r.push(a)})}),this.uiState.moveToBooths=r}moveToExhibitor(t){this.moveToList([t])}changeActiveListIndex(t){let r=this.uiState.activeListIndex+t;r=Math.max(0,Math.min(this.uiState.listItems.length-1,r)),this.uiState.activeListIndex=r}toggleModal(t){this.uiState.modalActive[t]=!this.uiState.modalActive[t]}openGallery(){this.uiState.galleryActive=!0}closeGallery(){this.uiState.galleryActive=!1}openActiveListItem(){const t=this.uiState.listItems[this.uiState.activeListIndex];t&&(b.log("Opening",t),t instanceof m?this.clickExhibitor(t):t instanceof T?this.clickCategory(t):t instanceof f&&this.clickBoothInList2(t))}toggleCategoryFilter(){this.uiState.categoryFilterOpen=!this.uiState.categoryFilterOpen}applyCategoryFilters(t){this.uiState.selectedCategoryFilters=t,this.uiState.categoryFilterOpen=!1}get filteredExhibitors(){return this.uiState.selectedCategoryFilters.length===0?this.exhibitorStore.exhibitors:this.exhibitorStore.exhibitors.filter(t=>this.uiState.selectedCategoryFilters.some(r=>t.categories.some(e=>e.id===r.id)))}selectSessions(){this.uiState.list={type:"sessions",text:"",focused:!1},this.uiState.menu=!1,this.uiState.selectedTrack=null,this.searchButtonsStore.setSubButtonId(null),this.searchButtonsStore.subButtonsEnabled&&this.searchButtonsStore.showSubButtons("sessions"),h&&(this.uiState.desiredOverlaySize="full")}selectExhibitors(){this.uiState.list={type:"exhibitors",text:"",focused:!1},this.uiState.menu=!1,h&&(this.uiState.desiredOverlaySize="full")}selectTours(){this.uiState.list={type:"tours",text:"",focused:!1},this.uiState.menu=!1,h&&(this.uiState.desiredOverlaySize="full")}selectSpeakers(){this.uiState.list={type:"speakers",text:"",focused:!1},this.uiState.menu=!1,h&&(this.uiState.desiredOverlaySize="full")}selectSpeaker(t,r=!0){this.speakerStore.selectSpeaker(t,r)}resetFilters(){this.searchButtonsStore.clearAllFilters()}registerShortcutProviders(){this.shortcutRegistry.register(new U(this)),this.shortcutRegistry.register(new W(this)),this.shortcutRegistry.register(new N(this))}}o([S],i.prototype,"initialized",void 0),o([S],i.prototype,"resetCameraFn",void 0),o([s],i.prototype,"setResetCameraFn",null),o([s],i.prototype,"selectExhibitor",null),o([s],i.prototype,"selectBooth",null),o([s],i.prototype,"reset",null),o([s],i.prototype,"selectNone",null),o([s],i.prototype,"selectBookmarks",null),o([s],i.prototype,"selectVisited",null),o([s],i.prototype,"selectLanguage",null),o([s],i.prototype,"selectCategory",null),o([s],i.prototype,"selectEventItem",null),o([s],i.prototype,"selectSearch",null),o([s],i.prototype,"clickBookmarks",null),o([s],i.prototype,"clickVisited",null),o([s],i.prototype,"clickLanguage",null),o([s],i.prototype,"clickCategory",null),o([s],i.prototype,"clickSeminars",null),o([s],i.prototype,"clickBoothInList",null),o([s],i.prototype,"clickBoothInList2",null),o([s],i.prototype,"clickBooth",null),o([s],i.prototype,"clickExhibitor2",null),o([s],i.prototype,"clickExhibitor",null),o([s],i.prototype,"showMap",null),o([s],i.prototype,"showOverlay",null),o([s],i.prototype,"toggleMapOverlay",null),o([s],i.prototype,"moveToList",null),o([s],i.prototype,"moveToExhibitor",null),o([s],i.prototype,"changeActiveListIndex",null),o([s],i.prototype,"toggleModal",null),o([s],i.prototype,"openGallery",null),o([s],i.prototype,"closeGallery",null),o([s],i.prototype,"openActiveListItem",null),o([s],i.prototype,"toggleCategoryFilter",null),o([s],i.prototype,"applyCategoryFilters",null),o([y],i.prototype,"filteredExhibitors",null),o([s],i.prototype,"selectSessions",null),o([s],i.prototype,"selectExhibitors",null),o([s],i.prototype,"selectTours",null),o([s],i.prototype,"selectSpeakers",null),o([s],i.prototype,"selectSpeaker",null),o([s],i.prototype,"resetFilters",null);
@@ -1 +1 @@
1
- import{__decorate as n}from"tslib";import{Box as k,boxContainsPoint as F,pointDistance as L}from"@expofp/geometry";import{action as f,computed as g,observable as u}from"mobx";import{getName as G}from"../components/Kiosk/SetKiosk";import{DEFAULT_UNITS as T,ORIENTATION_GRANTED_KEY as B}from"../constants";import E from"../data";import{fpGeo as P}from"../data/fpGeo";import{getLayerSvg as U,svgArea as h}from"../data/svg";import{GaEventActions as $,sendEventToGa as V}from"../tools/gtag";import w from"../tools/logger";import{areLayersEnabled as K}from"../utils/areLayersEnabled";import{calcSpeed as D}from"../utils/calcSpeed";import{calcTravelTime as A}from"../utils/calcTravelTime";import{calculateRelativeBearing as W,convertGpsToLocal as I,isValidPointCoords as b}from"../utils/gps";import{boothToEndpoint as C,buildRoute as Z,CURRENT_LOCATION_NAME as q,CURRENT_POSITION_POINT_ID as j,isWayfindingReady as X,KIOSK_ANCHOR_POINT_ID as Y,toArbitraryPoint as M}from"../wayfinding";import c,{layersStore as R,uiState as p}from".";import{BoothBase as y}from"./BoothStore";import{LayersMode as H}from"./LayerStore";import{revealLayer as N}from"./reveal-layer.js";function m(o){return typeof o=="string"?Number(o.replace(",",".")):o}export default class i{constructor(e){this.routeLines=[],this.routeDistance=null,this.currentPosition=null,this.requestCompass=!1,this.iconType=0,this.tempToBooth=null,this.focusEnabled=!0,this.prevZ=null,this.markersData={icons:[],markers:[]},this.prevMarkers=[],this.pendingReveal=null,this.showAccessible=!1,this.onlyAccessible=!1,this.currentRouteLayer=null,this.currentRouteExhibitor=null,this.routeUnits=T,this.isGpsTrackingEnabled=!0,this.rootStore=e,this.focusEnabled=!window.location.search}get canFindLocation(){return!!p.kioskData||!!this.currentPosition}selectRoute(e,t=!0,r=!1){if(t&&(p.list={type:"search",text:"",focused:!1}),e&&!e.from&&e.to){const s=this.resolveFallbackFrom();s&&(e=new Route(s,e.to,e.waypoints))}e?.from&&e?.to&&e.from===e.to&&(e=null);const l=[];e?.from&&e?.to&&window.setTimeout(()=>{this.rootStore.showMap()},navigator.userAgent.toLowerCase().indexOf("android")>-1?400:50),e?.from instanceof y&&e.from.visible&&l.push(e.from),e?.to instanceof y&&e.to.visible&&(this.tempToBooth=null,l.push(e.to)),!e&&c.fp.onDirection&&c.fp.onDirection(null);const a=()=>{if(this.rootStore.moveToList(l),p.details=e,e&&(!e.from||!e.to)&&c.showOverlay(),e?.to&&e?.from){const s=J(e.from);s&&this.rootStore.layerStore.updateVisibility(s,!0)}if(!this.currentRouteLayer){const s=O(this.rootStore.layerStore,e?.from),d=O(this.rootStore.layerStore,e?.to);s?this.currentRouteLayer=s:d&&(this.currentRouteLayer=d)}t&&e?.from&&e?.to&&V($.ClickDirections,`${e?.from?"From "+e.from.name:""} ${e?.to?"To "+e.to.name:""}`)};r?a():setTimeout(a,200)}rebuildRouteFromPosition(e){const t=p.selectedRoute;t?.to&&this.selectRoute(new Route(e,t.to,t.waypoints),!1,!0)}resolveFallbackFrom(){if(this.currentPosition)return M(this.currentPosition,q,j);const e=p.kioskData;return e?M({x:e.x,y:e.y,z:e.z??void 0},G(),Y):null}setStartPoint(e){const t=p.selectedRoute;if(t?.to&&!t?.from&&e){const r=new Route(e,t.to,t.waypoints);this.selectRoute(r)}}get pathLayers(){return c.routeStore.routeLines?.map(e=>e.p0.layer)?.filter((e,t,r)=>r.indexOf(e)===t).map((e,t)=>({id:t+1,layer:c.layerStore.findLayer(e)}))}getNearestBooth(e){if(!e)return null;const t=this.rootStore.layerStore.findLayer(e.z),r=P?.properties.config,l=!!(e.lat&&e.lng),a=r&&l?I(e,r):e;return!a||!b(a.x)||!b(a.y)?null:this.rootStore.boothStore.booths.filter(s=>R.mode===H.Default||!t?s.visible&&s.rect:s.rect&&(typeof e.z!="number"&&!e.z&&s.visible||t.name===s.layer?.name)).sort((s,d)=>L(a,s.rect.center)-L(a,d.rect.center))[0]||null}setMarkers(e){this.markersData.markers=(e?.markers??[]).map(Q),this.markersData.icons=e?.icons??[]}selectMarker(e,t){const r=this.markersData.markers.find(a=>a.id===e);this.markersData.markers.forEach(a=>a.active=!1),r&&(r.active=!0);const l=c.layerStore.findLayer(r?.z);if(t&&r){const a=c.rendererService.renderer;return l&&!l?.visible&&R.updateVisibility(l,!0),a?a.controls.panTo(r.x,r.y):(w.warn("Renderer is not initialized. Cannot pan to marker."),Promise.resolve())}return Promise.resolve()}get selectedMarkers(){return this.markersData.markers.filter(e=>e.active)}get layers(){const e=[];return c.routeStore.routeLines?.map(t=>t.p0.layer).forEach(t=>{e.indexOf(t)===-1&&e.push(t)}),e.map(t=>c.layerStore.layers.find(r=>r.name===t)).filter(t=>!!t)}clickRoute(e,t){window.__resett&&window.__resett(),this.rootStore.uiState.menu=!1,p.list.type==="route-planner"&&(p.list={type:"search",text:"",focused:!1}),this.selectRoute(new Route(e,t))}selectCurrentPosition(e,t=!0,r){clearTimeout(this.cpTimeout),e&&(e.x=m(e.x),e.y=m(e.y),e.lat!==void 0&&(e.lat=m(e.lat)),e.lng!==void 0&&(e.lng=m(e.lng)),K()||(e.z=void 0));const l=t&&this.rootStore.uiState.details&&!(this.rootStore.uiState.details instanceof Route),a=t&&!l&&(this.focusEnabled||this.prevZ!=e?.z);this.focusEnabled&&(this.focusEnabled=!1),this.prevZ=e?.z?.toString()??null,this.iconType=r?1:0;const s=e?ee(e):null;if(!e||!s){this.currentPosition=null;return}const d=c.layerStore.findLayer(e.z),x=new CurrentPosition(s.x,s.y,d?.name||this.currentRouteLayer?.name,W(s),e.lat,e.lng);let S=!this.routeLines?.length;d&&this.routeLines?.length&&(S=!!this.routeLines.find(v=>v.p0.layer===d.name||v.p1.layer===d.name));const _=a&&S;this.currentPosition=x,_&&this.focusOnPosition(x,d),this.gpsEnabled||(this.cpTimeout=setTimeout(()=>{this.currentPosition&&this.selectCurrentPosition(null,!1)},30*1e3))}findLocation(){if(!this.canFindLocation)return;const e=this.currentPosition??p.kioskData;e&&(this.currentPosition&&localStorage.getItem(B)==="false"&&(c.routeStore.requestCompass=!0),this.pendingReveal?.(),this.pendingReveal=N({layer:c.layerStore.findLayer(e.z),show:t=>R.updateVisibility(t,!0),then:()=>{p.moveToRect=this.findLocationRect(e)}}))}findLocationRect(e){const t=k.fromCenter(e,{x:100,y:100});if(t.intersects(h))return t;const r=Math.max(h.min.x,Math.min(e.x,h.max.x)),l=Math.max(h.min.y,Math.min(e.y,h.max.y)),a=Math.min(h.size.width,h.size.height)*.3,s=k.fromCenter({x:r,y:l},{x:a,y:a}).intersection(h);return s?k.fromUnion(t,s):t}focusOnPosition(e,t){this.pendingReveal?.(),this.pendingReveal=N({layer:t,show:r=>R.updateVisibility(r,!0),then:()=>{if(c.maplibreStore.showMaplibre){p.moveToLocation=!0;return}const r=c.rendererService.renderer;if(!r){w.warn("Renderer is not initialized. Cannot pan to current position.");return}r.controls.panTo(e.x,e.y)}})}get routeInfo(){const e=this.routeDistance,t=this.routeUnits;return e?{distance:`${e}${t}`,units:t,time:A(e,D(t))}:null}updateRoute(e,t){!e?.length&&!this.routeLines.length||(this.routeLines=e,this.updateRoutePoints())}updateRouteDistance(e){if(e==null)return;const t=U(),r=(t.getAttribute("units")||T).toLowerCase?.().trim(),l=t.getAttribute("fp-ver")?.startsWith("5")??!1;this.routeDistance=Math.round(e/(l?1:10)),this.routeUnits=r,this.updateRoutePoints()}updateRoutePoints(){const e=p.selectedRoute,t=this.routeDistance,r=this.routeUnits;c.fp.onDirection&&setTimeout(()=>{c.fp.onDirection({from:z(e?.from??null),to:z(e?.to??null),lines:this.routeLines,distance:t==null?"":`${t}${r}`,units:r,time:A(t??0,D(r))})},200)}checkRoutes(){if(!X()){console.warn("checkRoutes: wayfinding is not initialized \u2014 call createWayfinding() first. Skipping route check.");return}const e=c.boothStore.booths;console.info(`Route check started ${e.length}.... `);for(let t=0;t<e.length;t++){const r=e[t];for(let l=t+1;l<e.length;l++){const a=e[l];Z(C(r),C(a)).lines.length||console.warn(`No route found from ${r.name} to ${a.name}`)}}console.info("Route check done....")}setGpsTrackingEnabled(e){this.isGpsTrackingEnabled=e}get gpsEnabled(){return E.autoTrackingGps&&this.isGpsTrackingEnabled&&!E.enableIPS}setOnlyAccessible(e){this.onlyAccessible=e}}n([u],i.prototype,"routeLines",void 0),n([u],i.prototype,"routeDistance",void 0),n([u],i.prototype,"currentPosition",void 0),n([u],i.prototype,"requestCompass",void 0),n([u],i.prototype,"iconType",void 0),n([u],i.prototype,"tempToBooth",void 0),n([u],i.prototype,"focusEnabled",void 0),n([u],i.prototype,"prevZ",void 0),n([u],i.prototype,"markersData",void 0),n([u],i.prototype,"prevMarkers",void 0),n([u],i.prototype,"showAccessible",void 0),n([u],i.prototype,"onlyAccessible",void 0),n([u],i.prototype,"currentRouteLayer",void 0),n([u],i.prototype,"currentRouteExhibitor",void 0),n([g],i.prototype,"canFindLocation",null),n([f],i.prototype,"selectRoute",null),n([f],i.prototype,"rebuildRouteFromPosition",null),n([f],i.prototype,"setStartPoint",null),n([g({keepAlive:!0})],i.prototype,"pathLayers",null),n([f],i.prototype,"setMarkers",null),n([f],i.prototype,"selectMarker",null),n([g({keepAlive:!0})],i.prototype,"selectedMarkers",null),n([g({keepAlive:!0})],i.prototype,"layers",null),n([f],i.prototype,"clickRoute",null),n([f],i.prototype,"selectCurrentPosition",null),n([f],i.prototype,"findLocation",null),n([u],i.prototype,"routeUnits",void 0),n([g],i.prototype,"routeInfo",null),n([f],i.prototype,"updateRoute",null),n([f],i.prototype,"updateRouteDistance",null),n([f],i.prototype,"updateRoutePoints",null),n([f],i.prototype,"checkRoutes",null),n([u],i.prototype,"isGpsTrackingEnabled",void 0),n([f],i.prototype,"setGpsTrackingEnabled",null),n([g({keepAlive:!0})],i.prototype,"gpsEnabled",null),n([f],i.prototype,"setOnlyAccessible",null);function J(o){if(o)return o instanceof y?o.layer?.name:o.layer}function O(o,e){return e?e instanceof y?e.layer??null:o.findLayer(e.layer):null}function Q(o){return{...o,x:m(o.x),y:m(o.y),lat:o.lat===void 0?void 0:m(o.lat),lng:o.lng===void 0?void 0:m(o.lng)}}function ee(o){const e=P?.properties.config??null;let t=null;return e&&F({min:e.p0,max:e.p2},o)?t={...o}:e&&b(o.lat)&&b(o.lng)?t=I(o,e):e||(t=o),t||null}export function findBooth(o){return c.boothStore.findBooth(o)||c.exhibitorStore.findExhibitor(o)?.booths[0]}export function findEntityByExternalId(o){const e=c.boothStore.boothByExternalId.get(o);if(e)return{type:"booth",entity:e};const t=c.exhibitorStore.exhibitorByExternalId.get(o);if(t)return{type:"exhibitor",entity:t}}export function separateExternalIds(o){const e=[],t=[];for(const r of o){const l=findEntityByExternalId(r);l&&(l.type==="booth"?e.push(r):t.push(r))}return{boothExternalIds:e,exhibitorExternalIds:t}}export function extractRoute(o,e,t){return new Route(findBooth(o)??null,findBooth(e)??null,t?.map(r=>findBooth(r)).filter(r=>!!r))}export class Route{constructor(e,t,r){this.from=e,this.to=t,this.waypoints=r;const l=e instanceof y?e.id:void 0,a=t instanceof y?t.id:void 0;this.waypoints=r?.filter(s=>s&&s.id!==l&&s.id!==a)}}function z(o){return o?o instanceof y?{id:o.id,name:o.name,externalId:o.externalId,layer:{name:o.layer?.name,description:o.layer?.description}}:{id:Number.MAX_SAFE_INTEGER,name:o.name,externalId:void 0,layer:{name:o.layer,description:void 0}}:null}export class CurrentPosition{constructor(e,t,r,l,a,s){this.x=e,this.y=t,this.z=r,this.angle=l,this.lat=a,this.lng=s}}
1
+ import{__decorate as n}from"tslib";import{Box as x,boxContainsPoint as G,pointDistance as L}from"@expofp/geometry";import{action as f,computed as g,observable as u}from"mobx";import{getName as B}from"../components/Kiosk/SetKiosk";import{mapCamera as T}from"../components/Map/camera";import{DEFAULT_UNITS as E,ORIENTATION_GRANTED_KEY as U}from"../constants";import P from"../data";import{fpGeo as w}from"../data/fpGeo";import{getLayerSvg as $,svgArea as m}from"../data/svg";import{GaEventActions as V,sendEventToGa as K}from"../tools/gtag";import D from"../tools/logger";import{areLayersEnabled as W}from"../utils/areLayersEnabled";import{calcSpeed as A}from"../utils/calcSpeed";import{calcTravelTime as I}from"../utils/calcTravelTime";import{calculateRelativeBearing as Z,convertGpsToLocal as C,isValidPointCoords as b}from"../utils/gps";import{boothToEndpoint as M,buildRoute as q,CURRENT_LOCATION_NAME as j,CURRENT_POSITION_POINT_ID as X,isWayfindingReady as Y,KIOSK_ANCHOR_POINT_ID as H,toArbitraryPoint as N}from"../wayfinding";import c,{layersStore as R,uiState as p}from".";import{BoothBase as y}from"./BoothStore";import{LayersMode as J}from"./LayerStore";import{revealLayer as O}from"./reveal-layer.js";function d(o){return typeof o=="string"?Number(o.replace(",",".")):o}export default class i{constructor(t){this.routeLines=[],this.routeDistance=null,this.currentPosition=null,this.requestCompass=!1,this.iconType=0,this.tempToBooth=null,this.focusEnabled=!0,this.prevZ=null,this.markersData={icons:[],markers:[]},this.prevMarkers=[],this.pendingReveal=null,this.showAccessible=!1,this.onlyAccessible=!1,this.currentRouteLayer=null,this.currentRouteExhibitor=null,this.routeUnits=E,this.isGpsTrackingEnabled=!0,this.rootStore=t,this.focusEnabled=!window.location.search}get canFindLocation(){return!!p.kioskData||!!this.currentPosition}selectRoute(t,e=!0,r=!1){if(e&&(p.list={type:"search",text:"",focused:!1}),t&&!t.from&&t.to){const s=this.resolveFallbackFrom();s&&(t=new Route(s,t.to,t.waypoints))}t?.from&&t?.to&&t.from===t.to&&(t=null);const l=[];t?.from&&t?.to&&window.setTimeout(()=>{this.rootStore.showMap()},navigator.userAgent.toLowerCase().indexOf("android")>-1?400:50),t?.from instanceof y&&t.from.visible&&l.push(t.from),t?.to instanceof y&&t.to.visible&&(this.tempToBooth=null,l.push(t.to)),!t&&c.fp.onDirection&&c.fp.onDirection(null);const a=()=>{if(this.rootStore.moveToList(l),p.details=t,t&&(!t.from||!t.to)&&c.showOverlay(),t?.to&&t?.from){const s=Q(t.from);s&&this.rootStore.layerStore.updateVisibility(s,!0)}if(!this.currentRouteLayer){const s=_(this.rootStore.layerStore,t?.from),h=_(this.rootStore.layerStore,t?.to);s?this.currentRouteLayer=s:h&&(this.currentRouteLayer=h)}e&&t?.from&&t?.to&&K(V.ClickDirections,`${t?.from?"From "+t.from.name:""} ${t?.to?"To "+t.to.name:""}`)};r?a():setTimeout(a,200)}rebuildRouteFromPosition(t){const e=p.selectedRoute;e?.to&&this.selectRoute(new Route(t,e.to,e.waypoints),!1,!0)}resolveFallbackFrom(){if(this.currentPosition)return N(this.currentPosition,j,X);const t=p.kioskData;return t?N({x:t.x,y:t.y,z:t.z??void 0},B(),H):null}setStartPoint(t){const e=p.selectedRoute;if(e?.to&&!e?.from&&t){const r=new Route(t,e.to,e.waypoints);this.selectRoute(r)}}get pathLayers(){return c.routeStore.routeLines?.map(t=>t.p0.layer)?.filter((t,e,r)=>r.indexOf(t)===e).map((t,e)=>({id:e+1,layer:c.layerStore.findLayer(t)}))}getNearestBooth(t){if(!t)return null;const e=this.rootStore.layerStore.findLayer(t.z),r=w?.properties.config,l=!!(t.lat&&t.lng),a=r&&l?C(t,r):t;return!a||!b(a.x)||!b(a.y)?null:this.rootStore.boothStore.booths.filter(s=>R.mode===J.Default||!e?s.visible&&s.rect:s.rect&&(typeof t.z!="number"&&!t.z&&s.visible||e.name===s.layer?.name)).sort((s,h)=>L(a,s.rect.center)-L(a,h.rect.center))[0]||null}setMarkers(t){this.markersData.markers=(t?.markers??[]).map(tt),this.markersData.icons=t?.icons??[]}selectMarker(t,e){const r=this.markersData.markers.find(a=>a.id===t);this.markersData.markers.forEach(a=>a.active=!1),r&&(r.active=!0);const l=c.layerStore.findLayer(r?.z);if(e&&r){l&&!l?.visible&&R.updateVisibility(l,!0);const a=T();return a?a.api.panTo({x:r.x,y:r.y}):(D.warn("Map camera is not mounted. Cannot pan to marker."),Promise.resolve())}return Promise.resolve()}get selectedMarkers(){return this.markersData.markers.filter(t=>t.active)}get layers(){const t=[];return c.routeStore.routeLines?.map(e=>e.p0.layer).forEach(e=>{t.indexOf(e)===-1&&t.push(e)}),t.map(e=>c.layerStore.layers.find(r=>r.name===e)).filter(e=>!!e)}clickRoute(t,e){window.__resett&&window.__resett(),this.rootStore.uiState.menu=!1,p.list.type==="route-planner"&&(p.list={type:"search",text:"",focused:!1}),this.selectRoute(new Route(t,e))}selectCurrentPosition(t,e=!0,r){clearTimeout(this.cpTimeout),t&&(t.x=d(t.x),t.y=d(t.y),t.lat!==void 0&&(t.lat=d(t.lat)),t.lng!==void 0&&(t.lng=d(t.lng)),W()||(t.z=void 0));const l=e&&this.rootStore.uiState.details&&!(this.rootStore.uiState.details instanceof Route),a=e&&!l&&(this.focusEnabled||this.prevZ!=t?.z);this.focusEnabled&&(this.focusEnabled=!1),this.prevZ=t?.z?.toString()??null,this.iconType=r?1:0;const s=t?et(t):null;if(!t||!s){this.currentPosition=null;return}const h=c.layerStore.findLayer(t.z),k=new CurrentPosition(s.x,s.y,h?.name||this.currentRouteLayer?.name,Z(s),t.lat,t.lng);let v=!this.routeLines?.length;h&&this.routeLines?.length&&(v=!!this.routeLines.find(S=>S.p0.layer===h.name||S.p1.layer===h.name));const F=a&&v;this.currentPosition=k,F&&this.focusOnPosition(k,h),this.gpsEnabled||(this.cpTimeout=setTimeout(()=>{this.currentPosition&&this.selectCurrentPosition(null,!1)},30*1e3))}findLocation(){if(!this.canFindLocation)return;const t=this.currentPosition??p.kioskData;t&&(this.currentPosition&&localStorage.getItem(U)==="false"&&(c.routeStore.requestCompass=!0),this.pendingReveal?.(),this.pendingReveal=O({layer:c.layerStore.findLayer(t.z),show:e=>R.updateVisibility(e,!0),then:()=>{p.moveToRect=this.findLocationRect(t)}}))}findLocationRect(t){const e=x.fromCenter(t,{x:100,y:100});if(e.intersects(m))return e;const r=Math.max(m.min.x,Math.min(t.x,m.max.x)),l=Math.max(m.min.y,Math.min(t.y,m.max.y)),a=Math.min(m.size.width,m.size.height)*.3,s=x.fromCenter({x:r,y:l},{x:a,y:a}).intersection(m);return s?x.fromUnion(e,s):e}focusOnPosition(t,e){this.pendingReveal?.(),this.pendingReveal=O({layer:e,show:r=>R.updateVisibility(r,!0),then:()=>{if(c.maplibreStore.showMaplibre){p.moveToLocation=!0;return}const r=T();if(r){r.api.panTo({x:t.x,y:t.y});return}D.warn("Map camera is not mounted. Cannot pan to current position.")}})}get routeInfo(){const t=this.routeDistance,e=this.routeUnits;return t?{distance:`${t}${e}`,units:e,time:I(t,A(e))}:null}updateRoute(t,e){!t?.length&&!this.routeLines.length||(this.routeLines=t,this.updateRoutePoints())}updateRouteDistance(t){if(t==null)return;const e=$(),r=(e.getAttribute("units")||E).toLowerCase?.().trim(),l=e.getAttribute("fp-ver")?.startsWith("5")??!1;this.routeDistance=Math.round(t/(l?1:10)),this.routeUnits=r,this.updateRoutePoints()}updateRoutePoints(){const t=p.selectedRoute,e=this.routeDistance,r=this.routeUnits;c.fp.onDirection&&setTimeout(()=>{c.fp.onDirection({from:z(t?.from??null),to:z(t?.to??null),lines:this.routeLines,distance:e==null?"":`${e}${r}`,units:r,time:I(e??0,A(r))})},200)}checkRoutes(){if(!Y()){console.warn("checkRoutes: wayfinding is not initialized \u2014 call createWayfinding() first. Skipping route check.");return}const t=c.boothStore.booths;console.info(`Route check started ${t.length}.... `);for(let e=0;e<t.length;e++){const r=t[e];for(let l=e+1;l<t.length;l++){const a=t[l];q(M(r),M(a)).lines.length||console.warn(`No route found from ${r.name} to ${a.name}`)}}console.info("Route check done....")}setGpsTrackingEnabled(t){this.isGpsTrackingEnabled=t}get gpsEnabled(){return P.autoTrackingGps&&this.isGpsTrackingEnabled&&!P.enableIPS}setOnlyAccessible(t){this.onlyAccessible=t}}n([u],i.prototype,"routeLines",void 0),n([u],i.prototype,"routeDistance",void 0),n([u],i.prototype,"currentPosition",void 0),n([u],i.prototype,"requestCompass",void 0),n([u],i.prototype,"iconType",void 0),n([u],i.prototype,"tempToBooth",void 0),n([u],i.prototype,"focusEnabled",void 0),n([u],i.prototype,"prevZ",void 0),n([u],i.prototype,"markersData",void 0),n([u],i.prototype,"prevMarkers",void 0),n([u],i.prototype,"showAccessible",void 0),n([u],i.prototype,"onlyAccessible",void 0),n([u],i.prototype,"currentRouteLayer",void 0),n([u],i.prototype,"currentRouteExhibitor",void 0),n([g],i.prototype,"canFindLocation",null),n([f],i.prototype,"selectRoute",null),n([f],i.prototype,"rebuildRouteFromPosition",null),n([f],i.prototype,"setStartPoint",null),n([g({keepAlive:!0})],i.prototype,"pathLayers",null),n([f],i.prototype,"setMarkers",null),n([f],i.prototype,"selectMarker",null),n([g({keepAlive:!0})],i.prototype,"selectedMarkers",null),n([g({keepAlive:!0})],i.prototype,"layers",null),n([f],i.prototype,"clickRoute",null),n([f],i.prototype,"selectCurrentPosition",null),n([f],i.prototype,"findLocation",null),n([u],i.prototype,"routeUnits",void 0),n([g],i.prototype,"routeInfo",null),n([f],i.prototype,"updateRoute",null),n([f],i.prototype,"updateRouteDistance",null),n([f],i.prototype,"updateRoutePoints",null),n([f],i.prototype,"checkRoutes",null),n([u],i.prototype,"isGpsTrackingEnabled",void 0),n([f],i.prototype,"setGpsTrackingEnabled",null),n([g({keepAlive:!0})],i.prototype,"gpsEnabled",null),n([f],i.prototype,"setOnlyAccessible",null);function Q(o){if(o)return o instanceof y?o.layer?.name:o.layer}function _(o,t){return t?t instanceof y?t.layer??null:o.findLayer(t.layer):null}function tt(o){return{...o,x:d(o.x),y:d(o.y),lat:o.lat===void 0?void 0:d(o.lat),lng:o.lng===void 0?void 0:d(o.lng)}}function et(o){const t=w?.properties.config??null;let e=null;return t&&G({min:t.p0,max:t.p2},o)?e={...o}:t&&b(o.lat)&&b(o.lng)?e=C(o,t):t||(e=o),e||null}export function findBooth(o){return c.boothStore.findBooth(o)||c.exhibitorStore.findExhibitor(o)?.booths[0]}export function findEntityByExternalId(o){const t=c.boothStore.boothByExternalId.get(o);if(t)return{type:"booth",entity:t};const e=c.exhibitorStore.exhibitorByExternalId.get(o);if(e)return{type:"exhibitor",entity:e}}export function separateExternalIds(o){const t=[],e=[];for(const r of o){const l=findEntityByExternalId(r);l&&(l.type==="booth"?t.push(r):e.push(r))}return{boothExternalIds:t,exhibitorExternalIds:e}}export function extractRoute(o,t,e){return new Route(findBooth(o)??null,findBooth(t)??null,e?.map(r=>findBooth(r)).filter(r=>!!r))}export class Route{constructor(t,e,r){this.from=t,this.to=e,this.waypoints=r;const l=t instanceof y?t.id:void 0,a=e instanceof y?e.id:void 0;this.waypoints=r?.filter(s=>s&&s.id!==l&&s.id!==a)}}function z(o){return o?o instanceof y?{id:o.id,name:o.name,externalId:o.externalId,layer:{name:o.layer?.name,description:o.layer?.description}}:{id:Number.MAX_SAFE_INTEGER,name:o.name,externalId:void 0,layer:{name:o.layer,description:void 0}}:null}export class CurrentPosition{constructor(t,e,r,l,a,s){this.x=t,this.y=e,this.z=r,this.angle=l,this.lat=a,this.lng=s}}