@expofp/floorplan 3.9.0 → 3.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/{Button-D6kSs8oT.js → Button-DdPvRBTh.js} +5 -5
- package/dist/browser/{CookieConsent-COR-7PnR.js → CookieConsent-C39dYjaQ.js} +7 -7
- package/dist/browser/{Debug-hcVDK_6B.js → Debug-B5r6LCAX.js} +7 -7
- package/dist/browser/{Demo-CXfqKcNa.js → Demo-Dbrjn3oi.js} +9 -9
- package/dist/browser/{Free-UltUjcsW.js → Free-DUcGDkLZ.js} +9 -9
- package/dist/browser/{Gallery-Dw_l4-HJ.js → Gallery-CvO5_8hs.js} +9 -9
- package/dist/browser/{GpsLoader-BeUr-tWe.js → GpsLoader-Cybs-6Z0.js} +21 -21
- package/dist/browser/{KioskStore-rXGF6ISj.js → KioskStore-Df_lwtgJ.js} +34 -34
- package/dist/browser/{MaplibreAdapter-DBu4xFLx.js → MaplibreAdapter-BgOzaHlx.js} +1866 -1863
- package/dist/browser/{ModalContainer-CHubcxXg.js → ModalContainer-DXVCm1fb.js} +10 -10
- package/dist/browser/{PermissionNotice-Dcyf-h-X.js → PermissionNotice-B0OJFFky.js} +6 -6
- package/dist/browser/{SetKioskMode-Dsaeb_7s.js → SetKioskMode-BdOX40be.js} +12 -12
- package/dist/browser/ShowKiosk-cvnSTpd2.js +28 -0
- package/dist/browser/{TouchHand-BglJHdqZ.js → TouchHand-RDWCILm_.js} +4 -4
- package/dist/browser/{ViewerMenuPanel-6hwMrGsD.js → ViewerMenuPanel-BlCzm_mm.js} +10 -10
- package/dist/browser/{add-debug-secret-listener-CrjDiiDe.js → add-debug-secret-listener-lYBneebf.js} +1 -1
- package/dist/browser/{boolean-editor-B8TY5r_7.js → boolean-editor-C_bdHxC2.js} +9 -9
- package/dist/browser/{bootIntercom-BLVUFUo9.js → bootIntercom-Bf4CaruD.js} +2 -2
- package/dist/browser/booth-by-xy-WnHwiopn.js +1067 -0
- package/dist/browser/{browser-C0ZAqhfq.js → browser-BGtGwkTn.js} +2 -2
- package/dist/browser/bundle.json +62 -62
- package/dist/browser/{classnames-CORO_J9N.js → classnames-DRy7JPyJ.js} +2 -2
- package/dist/browser/{client-B8k3_zlK.js → client-BE52OM0U.js} +4 -4
- package/dist/browser/{components-Br23UmiD.js → components-BfKSs6sY.js} +1697 -1696
- package/dist/browser/{debug-overlay-OnJ9mpi3.js → debug-overlay-mKmIzOYk.js} +10 -10
- package/dist/browser/{debug-ui-BGxXBqCM.js → debug-ui-DLxMK2XU.js} +6 -6
- package/dist/browser/{dist-DeenbCqa.js → dist-DSRSA5oz.js} +6 -6
- package/dist/browser/{dist-Bwo0bena.js → dist-QsCYWHCu.js} +5 -5
- package/dist/browser/{dist-DJcDQ9wl.js → dist-eojWwYB5.js} +3 -3
- package/dist/browser/{efp-debug-init-D4xpSVxZ.js → efp-debug-init-C5HgsgC2.js} +2 -2
- package/dist/browser/{enum-editor-BtQ7q_B6.js → enum-editor-BqpFqXiM.js} +11 -11
- package/dist/browser/{es5-DyYwMIHo.js → es5-7bslpbjj.js} +2 -2
- package/dist/browser/{event-not-found-DHZml9YG.js → event-not-found-Bc1SpnKw.js} +1 -1
- package/dist/browser/{exports-BSvGPafo.js → exports-CYJRF2aW.js} +1 -1
- package/dist/browser/{favicon-7eGefoDS.js → favicon-CRiidRYo.js} +1 -1
- package/dist/browser/{fetch-retry.umd-D4q_0lN2.js → fetch-retry.umd-Btwt1fg_.js} +2 -2
- package/dist/browser/{flex-BNMB3s0s.js → flex-ITkzmA3C.js} +5 -5
- package/dist/browser/{floorplan.loader-C464BfTl.js → floorplan.loader-DJVlfwah.js} +11 -11
- package/dist/browser/{floorplan.ready-F-rEW40x.js → floorplan.ready-7KwBZy9I.js} +156 -156
- package/dist/browser/{fuse-BOOzXNLy.js → fuse-CcYz7YAl.js} +2 -2
- package/dist/browser/{i18n-CJxFIIru.js → i18n-CeVxHTr1.js} +4 -4
- package/dist/browser/index.js +12 -12
- package/dist/browser/{index.module-CkT4oOvs.js → index.module-CV2WVv52.js} +4 -4
- package/dist/browser/{is-webview-B86RAuQv.js → is-webview-BOqof5Uq.js} +1 -1
- package/dist/browser/{jsx-runtime-3_7049j-.js → jsx-runtime-BiSrB4Oo.js} +2 -2
- package/dist/browser/{lib-CjZn5G8Q.js → lib-Dg9vXDVM.js} +4 -4
- package/dist/browser/{loadImage-CV72jhce.js → loadImage-VYhbBgH6.js} +4 -4
- package/dist/browser/{logDeviceInfo-CH_mwixN.js → logDeviceInfo-B8Mi-9H5.js} +9 -9
- package/dist/browser/{main-DBcClnTP.js → main-D6ItQIYj.js} +1 -1
- package/dist/browser/{mobx-Cnc_mxKS.js → mobx-Deoo_wpx.js} +4 -4
- package/dist/browser/{particles.min-Bdddyoyn.js → particles.min-BNwqgit-.js} +2 -2
- package/dist/browser/{prop-types-D9saedjy.js → prop-types-CuEYshV7.js} +2 -2
- package/dist/browser/{react-CtAjLpE4.js → react-BMPhuMz9.js} +2 -2
- package/dist/browser/{react-dom-9Z9grXEI.js → react-dom-DSdkXj0b.js} +3 -3
- package/dist/browser/{reset-all-settings-D2rGLtD9.js → reset-all-settings-C2yTiJ1V.js} +7 -7
- package/dist/browser/{rolldown-runtime-6HCGHF5o.js → rolldown-runtime-I1EwXf_t.js} +1 -1
- package/dist/browser/{settings-r2jCygEX.js → settings-Dr8bs0FB.js} +2 -2
- package/dist/browser/{settings-item-CmuDoi0N.js → settings-item-DjfyQTQB.js} +6 -6
- package/dist/browser/{store-hsXE5nII.js → store-CVdrQCza.js} +6737 -5892
- package/dist/browser/{string-editor-UncyEsWj.js → string-editor-3sN4j-ci.js} +7 -7
- package/dist/browser/{theme-DmuulesT.js → theme-BSTLt6eV.js} +8 -8
- package/dist/browser/{ui-CBeseOX-.js → ui-CiFfwrN8.js} +8 -8
- package/dist/browser/{useRenderTarget-C5lcypnV.js → useRenderTarget-DF7LdnYr.js} +4 -4
- package/dist/esm/components/Map/Map.js +1 -1
- package/dist/esm/components/Maplibre/MaplibreAdapter.js +1 -1
- package/dist/esm/components/Maplibre/useWayfindingAndMarkers.js +1 -1
- package/dist/esm/data/Flags.d.ts +8 -0
- package/dist/esm/store/RouteStore.d.ts +1 -2
- package/dist/esm/store/RouteStore.js +1 -1
- package/dist/esm/wayfinding/adapters/canvasIconProvider.d.ts +1 -1
- package/dist/esm/wayfinding/adapters/canvasIconProvider.js +1 -1
- package/dist/esm/wayfinding/adapters/graphDataSource.d.ts +2 -1
- package/dist/esm/wayfinding/adapters/graphDataSource.js +1 -1
- package/dist/esm/wayfinding/adapters/index.d.ts +3 -4
- package/dist/esm/wayfinding/adapters/index.js +1 -1
- package/dist/esm/wayfinding/bindMobxReactions.d.ts +6 -0
- package/dist/esm/wayfinding/bindMobxReactions.js +1 -1
- package/dist/esm/wayfinding/core/__tests__/helpers.d.ts +4 -4
- package/dist/esm/wayfinding/core/createWayfindingEngine.js +1 -1
- package/dist/esm/wayfinding/core/graph/buildGraph.d.ts +1 -1
- package/dist/esm/wayfinding/core/graph/buildNGraph.d.ts +2 -2
- package/dist/esm/wayfinding/core/graph/findShortestPath.d.ts +2 -2
- package/dist/esm/wayfinding/core/graph/graphHelpers.d.ts +4 -4
- package/dist/esm/wayfinding/core/graph/graphHelpers.js +1 -1
- package/dist/esm/wayfinding/core/graph/linkCost.d.ts +2 -2
- package/dist/esm/wayfinding/core/index.d.ts +8 -8
- package/dist/esm/wayfinding/core/index.js +1 -1
- package/dist/esm/wayfinding/core/position/gpsThreshold.d.ts +2 -2
- package/dist/esm/wayfinding/core/routing/getRouteLength.d.ts +1 -1
- package/dist/esm/wayfinding/core/types.d.ts +19 -9
- package/dist/esm/wayfinding/createWayfinding.d.ts +15 -1
- package/dist/esm/wayfinding/createWayfinding.js +1 -1
- package/dist/esm/wayfinding/handlers/yahHandler.d.ts +3 -3
- package/dist/esm/wayfinding/handlers/yahHandler.js +1 -1
- package/dist/esm/wayfinding/index.d.ts +13 -0
- package/dist/esm/wayfinding/index.js +1 -0
- package/dist/esm/wayfinding/renderer/createWayfindingRenderer.js +1 -1
- package/dist/esm/wayfinding/renderer/iconManager.d.ts +3 -3
- package/dist/esm/wayfinding/renderer/routeLineManager.d.ts +5 -5
- package/dist/esm/wayfinding/renderer/trailManager.d.ts +2 -2
- package/dist/esm/wayfinding/runtime/createWayfindingRuntime.js +1 -1
- package/dist/esm/wayfinding/runtime/endpointView.d.ts +1 -2
- package/dist/esm/wayfinding/runtime/positionTrailView.d.ts +5 -6
- package/dist/esm/wayfinding/runtime/positionView.d.ts +2 -3
- package/dist/esm/wayfinding/runtime/routeUpdate.d.ts +3 -3
- package/dist/esm/wayfinding/runtime/trailView.d.ts +1 -2
- package/dist/esm/wayfinding/runtime/transitionView.d.ts +2 -3
- package/dist/esm/wayfinding/runtime/types.d.ts +10 -2
- package/package.json +4 -4
- package/dist/browser/ShowKiosk-B33TvvNh.js +0 -28
- package/dist/browser/createWayfinding-CywBuuhE.js +0 -1892
- package/dist/esm/wayfinding/adapters/iconProvider.d.ts +0 -15
- package/dist/esm/wayfinding/adapters/iconProvider.js +0 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
(function() {
|
|
2
2
|
try {
|
|
3
3
|
var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {};
|
|
4
|
-
e.SENTRY_RELEASE = { id: "3.
|
|
4
|
+
e.SENTRY_RELEASE = { id: "3.10.1" };
|
|
5
5
|
var t = new e.Error().stack;
|
|
6
6
|
t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "888fc155-fb35-4159-9302-91880886e35d", e._sentryDebugIdIdentifier = "sentry-dbid-888fc155-fb35-4159-9302-91880886e35d");
|
|
7
7
|
} catch {}
|
|
8
8
|
})();
|
|
9
|
-
import { r as e } from "./rolldown-runtime-
|
|
10
|
-
import { t } from "./react-
|
|
11
|
-
import { t as n } from "./jsx-runtime-
|
|
12
|
-
import { D as r, i, l as a, n as o, s, u as c, y as l } from "./flex-
|
|
13
|
-
import { t as u } from "./classnames-
|
|
14
|
-
import { t as d } from "./settings-item-
|
|
9
|
+
import { r as e } from "./rolldown-runtime-I1EwXf_t.js";
|
|
10
|
+
import { t } from "./react-BMPhuMz9.js";
|
|
11
|
+
import { t as n } from "./jsx-runtime-BiSrB4Oo.js";
|
|
12
|
+
import { D as r, i, l as a, n as o, s, u as c, y as l } from "./flex-ITkzmA3C.js";
|
|
13
|
+
import { t as u } from "./classnames-DRy7JPyJ.js";
|
|
14
|
+
import { t as d } from "./settings-item-DjfyQTQB.js";
|
|
15
15
|
//#region ../../node_modules/.pnpm/@radix-ui+themes@3.3.0_@types+react-dom@19.2.3_@types+react@19.2.17__@types+react@19.2._925f851475345a9e5e368d312bb98178/node_modules/@radix-ui/themes/dist/esm/components/text-field.props.js
|
|
16
16
|
var f = {
|
|
17
17
|
size: {
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
(function() {
|
|
2
2
|
try {
|
|
3
3
|
var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {};
|
|
4
|
-
e.SENTRY_RELEASE = { id: "3.
|
|
4
|
+
e.SENTRY_RELEASE = { id: "3.10.1" };
|
|
5
5
|
var t = new e.Error().stack;
|
|
6
6
|
t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "b674b3f0-1e85-4d5b-b554-fb365f6d1945", e._sentryDebugIdIdentifier = "sentry-dbid-b674b3f0-1e85-4d5b-b554-fb365f6d1945");
|
|
7
7
|
} catch {}
|
|
8
8
|
})();
|
|
9
|
-
import { r as e } from "./rolldown-runtime-
|
|
10
|
-
import { t } from "./react-
|
|
11
|
-
import { t as n } from "./jsx-runtime-
|
|
12
|
-
import { t as r } from "./react-dom-
|
|
13
|
-
import { C as i, E as a, O as o, T as s, _ as c, o as l, v as u, w as d } from "./flex-
|
|
14
|
-
import { c as f, i as p, n as m, o as h, r as g, s as _, t as v } from "./dist-
|
|
15
|
-
import { t as y } from "./classnames-
|
|
9
|
+
import { r as e } from "./rolldown-runtime-I1EwXf_t.js";
|
|
10
|
+
import { t } from "./react-BMPhuMz9.js";
|
|
11
|
+
import { t as n } from "./jsx-runtime-BiSrB4Oo.js";
|
|
12
|
+
import { t as r } from "./react-dom-DSdkXj0b.js";
|
|
13
|
+
import { C as i, E as a, O as o, T as s, _ as c, o as l, v as u, w as d } from "./flex-ITkzmA3C.js";
|
|
14
|
+
import { c as f, i as p, n as m, o as h, r as g, s as _, t as v } from "./dist-DSRSA5oz.js";
|
|
15
|
+
import { t as y } from "./classnames-DRy7JPyJ.js";
|
|
16
16
|
//#region ../../node_modules/.pnpm/@radix-ui+react-visually-hidden@1.2.3_@types+react-dom@19.2.3_@types+react@19.2.17__@ty_070bcfa32421a5876e7dcb93369fcbee/node_modules/@radix-ui/react-visually-hidden/dist/index.mjs
|
|
17
17
|
var b = /* @__PURE__ */ e(r(), 1), x = /* @__PURE__ */ e(t(), 1), S = n(), C = Object.freeze({
|
|
18
18
|
position: "absolute",
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
(function() {
|
|
2
2
|
try {
|
|
3
3
|
var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {};
|
|
4
|
-
e.SENTRY_RELEASE = { id: "3.
|
|
4
|
+
e.SENTRY_RELEASE = { id: "3.10.1" };
|
|
5
5
|
var t = new e.Error().stack;
|
|
6
6
|
t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "43912113-9328-4069-8890-5091c8745c34", e._sentryDebugIdIdentifier = "sentry-dbid-43912113-9328-4069-8890-5091c8745c34");
|
|
7
7
|
} catch {}
|
|
8
8
|
})();
|
|
9
|
-
import { r as e } from "./rolldown-runtime-
|
|
10
|
-
import { a as t, r as n } from "./reset-all-settings-
|
|
11
|
-
import { t as r } from "./jsx-runtime-
|
|
12
|
-
import "./settings-
|
|
13
|
-
import { t as i } from "./browser-
|
|
14
|
-
import { t as a } from "./add-debug-secret-listener-
|
|
9
|
+
import { r as e } from "./rolldown-runtime-I1EwXf_t.js";
|
|
10
|
+
import { a as t, r as n } from "./reset-all-settings-C2yTiJ1V.js";
|
|
11
|
+
import { t as r } from "./jsx-runtime-BiSrB4Oo.js";
|
|
12
|
+
import "./settings-Dr8bs0FB.js";
|
|
13
|
+
import { t as i } from "./browser-BGtGwkTn.js";
|
|
14
|
+
import { t as a } from "./add-debug-secret-listener-lYBneebf.js";
|
|
15
15
|
//#region ../debug/src/lib/ui/render-debug-ui.tsx
|
|
16
16
|
var o = /* @__PURE__ */ e(i(), 1), s = r(), c = !1;
|
|
17
17
|
function l() {
|
|
@@ -26,7 +26,7 @@ function l() {
|
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
28
|
let i = async (t) => {
|
|
29
|
-
let { DebugUi: n } = await import("./debug-ui-
|
|
29
|
+
let { DebugUi: n } = await import("./debug-ui-DLxMK2XU.js"), { createRoot: i } = await import("./client-BE52OM0U.js").then((t) => /* @__PURE__ */ e(t.default, 1)), a = document.createElement("div");
|
|
30
30
|
document.body.appendChild(a), i(a).render(/* @__PURE__ */ (0, s.jsx)(n, {
|
|
31
31
|
useDebugButtonState: r.useState,
|
|
32
32
|
open: t
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
(function() {
|
|
2
2
|
try {
|
|
3
3
|
var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {};
|
|
4
|
-
e.SENTRY_RELEASE = { id: "3.
|
|
4
|
+
e.SENTRY_RELEASE = { id: "3.10.1" };
|
|
5
5
|
var t = new e.Error().stack;
|
|
6
6
|
t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "d4febe97-784c-4cf8-93f1-f2e3b29f8347", e._sentryDebugIdIdentifier = "sentry-dbid-d4febe97-784c-4cf8-93f1-f2e3b29f8347");
|
|
7
7
|
} catch {}
|
|
8
8
|
})();
|
|
9
|
-
import { r as e } from "./rolldown-runtime-
|
|
10
|
-
import { t } from "./react-
|
|
11
|
-
import { s as n } from "./store-
|
|
9
|
+
import { r as e } from "./rolldown-runtime-I1EwXf_t.js";
|
|
10
|
+
import { t } from "./react-BMPhuMz9.js";
|
|
11
|
+
import { s as n } from "./store-CVdrQCza.js";
|
|
12
12
|
//#region src/utils/getRenderTargetFromRoot.ts
|
|
13
13
|
var r = /* @__PURE__ */ e(t(), 1);
|
|
14
14
|
function i(e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as C,jsxs as N,Fragment as
|
|
1
|
+
import{jsx as C,jsxs as N,Fragment as oe}from"react/jsx-runtime";import{Box as k}from"@expofp/geometry";import te from"classnames";import re from"color";import{observable as ne,reaction as ie}from"mobx";import{useObserver as ae}from"mobx-react-lite";import{useEffect as se,useMemo as le,useRef as S,useState as me}from"react";import{DEBUG_STORAGE_KEY as O}from"../../constants";import ce from"../../data";import{fpGeo as fe}from"../../data/fpGeo";import{svgArea as X}from"../../data/svg";import{boxToRenderer as L,createSceneDef as de,mapRollSetting as U}from"../../renderer";import{pickDefaultScene as A,pickDefaultScenePoint as ue}from"../../renderer/engine-core/defs";import a,{boothStore as pe,layersStore as h,uiState as o}from"../../store";import{BoothBase as j}from"../../store/BoothStore";import{Category as he}from"../../store/CategoryStore";import{Exhibitor as Z}from"../../store/ExhibitorStore";import{LayerMode as R}from"../../store/LayerStore";import{CurrentPosition as ve,Route as ye}from"../../store/RouteStore";import B from"../../tools/logger";import p from"../../tools/settings";import be from"../../ui/Draggable";import{areLayersEnabled as ge}from"../../utils/areLayersEnabled";import{applyVenueDimValue as we,createDimmingAnimator as Se}from"../../utils/dimming";import{convertGpsToLocal as Re}from"../../utils/gps";import y from"../../utils/is-debug";import{isPathwayLayer as $}from"../../utils/is-pathway-layer";import{useReaction as d}from"../../utils/mobx";import{createWayfinding as xe}from"../../wayfinding";import K from"./booth-by-xy";import Te from"./drawing/config/config-all";import{configMarkers as Ce,getMarkerFromClick as ke}from"./drawing/config/config-markers";import{loadLayersImages as Le}from"./drawing/config/loadBoothsImages";import{useBuildRoute as Be}from"./traffic/useBuildRoute";import{useManageTraffic as Ee}from"./traffic/useManageTraffic";const V=Number.isFinite(p.maxZoom);export default function Me(){let E={};const W="#ebebeb",v=S(),b=le(()=>ne({moving:!1,prevLevel:a.layerStore.layers.find(e=>!e.frozen&&e.visible)}),[]),l=a.rendererService,x=S(Se(e=>we(l,e)));let s;const g=S(null),M=S(null);let P=null,z=null,I=!1;function _(){h.layers.forEach(e=>{e.configured=!1,e.children=[],e.loaded=!1})}const[H,q]=me(()=>typeof window<"u"&&window.localStorage?localStorage.getItem(O)!=="false":!0);d(()=>a.routeStore.currentRouteLayer,()=>{if(!l.scene||b.prevLevel===a.routeStore.currentRouteLayer)return;const e=l.scene.rootLayer.children.filter(t=>a.layerStore.floors.some(n=>t.name.includes(n.name)));let r=a.routeStore.currentRouteLayer.name;if(!e.find(t=>t.name===r))return;const i=e?.map(t=>(t.name===r&&(t.hidden=!1),t.name===b.prevLevel?.name&&(t.hidden=!0),t));b.prevLevel=a.routeStore.currentRouteLayer,l.update(...i)}),d(()=>o.centerMap,()=>{!o.centerMap||a.maplibreStore.showMaplibre||(s.controls.resetCamera({zoom:!!(o.list.type==="search"&&o.list.text)}),o.centerMap=!1)}),se(()=>{if(!v.current)return;async function e(){_(),h.layersLoaded=!1;let r={};try{if(y){const t=document.createElement("canvas").getContext("webgl2"),n=t&&t.getExtension("EXT_disjoint_timer_query_webgl2"),m=(await import("stats-gl")).default,f=new m({trackGPU:n,horizontal:!0}),u=M.current;if(!u)throw new Error("memoryInfoPanel not found.");f.dom.style.position="relative",u.style.width=`${90*(n?3:2)}px`,u.style.height="48px",u.appendChild(f.dom),r={stats:f,memoryInfoPanel:u}}}catch(i){console.error(i)}s=l.create({canvas:v.current,ui:r}),g.current=s,ie(()=>o.canvasVisibleRectPx,(i,t)=>{i&&(s.visibleRect=L(i)),t.dispose()},{fireImmediately:!0}),Te(l).then(i=>{if(I||g.current!==s)return;y&&console.log("Renderer settings",s);const t=re(p.backgroundColor==="none"?W:p.backgroundColor).string();E=de(i,X,t),l.start(E),x.current.setTarget(o.dimmed,{immediate:!0}),U(s,a.fp.enableRotation?1:0),V&&s.viewport.setMaxZoom(p.maxZoom),h.layersLoaded=!0,a.fp.onFpConfigured&&a.fp?.onFpConfigured(),P=xe(l,a),z=Ce(l),Le(l)}),s.events.addEventListener("pointer:move",({data:i})=>{if(o.setKioskModeEnabled)return;const{point:t,defs:n}=A(i),c=K(t.x,t.y),m=D(n[0]);o.hoveredBooth=c||m}),s.events.addEventListener("pointer:out",()=>{o.setKioskModeEnabled||(o.hoveredBooth=null)}),s.events.addEventListener("pointer:click",({data:i})=>{if(!o?.rootElement)return;window.__resett&&window.__resett(),o.overlayPosition==="bottom"&&o.overlaySize==="full"&&a.showMap();const{point:t,defs:n}=A(i),{x:c,y:m}=t;if(o.onGetCoordsClick){const w=a.layerStore.layers.find(T=>T.visible&&(T.mode===R.TurnedOn||T.mode===R.TurnedOff));o.onGetCoordsClick({x:c,y:m,z:w?.name||null})}if(o.setKioskModeEnabled)return;if(o.onMarkerClick){const w=ke(c,m,l.scale);y&&console.log("marker",w),o.onMarkerClick(w)}const f=K(t.x,t.y),u=D(n[0]);y&&console.log("boothIdFromClientXy",f,"boothByShape",u,"pointer:click point",t),a.clickBooth(f||u)}),s.events.addEventListener("navigation:change",()=>window.__resett&&window.__resett())}return e(),a.fp.getCenterCoordinates=Q,()=>J()},[]);function J(){I=!0,x.current.stop(),P?.(),z?.(),_(),h.layersLoaded=!1,l.disposeIfCurrent(g.current),g.current=null}function Q(){const e=v.current;if(!v.current)throw new Error("Canvas not ready");const r=ue(s.viewport.canvasToSvg({x:e.clientWidth/2,y:e.clientHeight/2})),t=a.layerStore.visible.find(n=>n.mode===R.TurnedOff||n.mode===R.TurnedOn)?.name||null;return{...r,z:t}}function D(e){return!e||!e.shape?null:pe.booths.find(r=>r.shapes?.find(i=>i.shape==e.shape))}d(()=>o.zoomBy,()=>{if(!o.zoomBy||a.maplibreStore.showMaplibre)return;const e=o.zoomBy;s.controls.zoomBy(e),o.zoomBy=null}),d(()=>o.dimmed,e=>{x.current.setTarget(e)}),d(()=>o.details,()=>{if(!o.onDetails)return;if(!o.details){o.onDetails(null);return}var e=o.details;if(p.EXPO==="wineparis"&&(e instanceof Z&&(e=e.booths[0]),!e))return;let r=null,i=[];e instanceof Z?(r="exhibitor",i=e.booths.map(n=>n.name).sort((n,c)=>n==a.routeStore.tempToBooth?.name?-1:c==a.routeStore.tempToBooth?.name?1:0)):e instanceof j?(r="booth",i=[e.name]):e instanceof ye?(r="route",i=[e.from?.name,e.to?.name].filter(n=>!!n)):e instanceof he&&(r="category",i=e.exhibitors.map(n=>n.booths.map(c=>c.name)).flat());var t={type:r,name:e?.name,id:e?.id,externalId:e?.externalId,boothsNames:i};o.onDetails({...t,...r==="route"?{routeInfo:a.routeStore.routeInfo}:{}})}),d(()=>o.canvasVisibleRectPx,e=>{l.renderer&&(l.renderer.visibleRect=L(e))},{fireImmediately:!0}),d(()=>o.moveToRect,()=>{!o.moveToRect||a.maplibreStore.showMaplibre||(o.moveToRect&&o.moveToRect.size.height!==1/0&&o.moveToRect.size.width!==1/0&&o.moveToRect.size.height>0&&o.moveToRect.size.width>0&&G(o.moveToRect),o.moveToRect=null)}),d(()=>o.rollReset,e=>{e&&(s.controls.resetCamera({roll:!0}),o.rollReset=!1)}),d(()=>o.moveToBooths,()=>{if(B.log("this.moveToBooths",o.moveToBooths),!o.moveToBooths||a.maplibreStore.showMaplibre)return;B.log("watched moveToBooths",o.moveToBooths);const e=o.moveToBooths.filter(r=>r.rect).map(r=>r.rect);e.length!==0&&(G(k.fromUnion(...e)),o.moveToBooths=null)}),d(()=>o.mapSettings,({zoomtime:e,center:r,centerxy:i,bearing:t,roll:n,z:c})=>{if(!(a.maplibreStore.showMaplibre||!l.renderer))try{e&&e!==o.defaultMapSettings.zoomtime&&l.renderer.controls.configure({zoomTime:e/1e3}),a.fp.enableRotation&&U(s,n);let m;if(r){const f=r.split(",").map(Number),u=new ve(void 0,void 0,void 0,void 0,f[0],f[1]);m=Re(u,fe.properties.config)}else if(i){const f=i.split(",").map(Number);m={x:f[0],y:f[1]}}c&&a.fp.activateFloor({name:c}),(m?.x||m?.y)&&l.renderer.controls.panTo(m.x,m.y),Number.isFinite(t)&&l.renderer.controls.rollTo(t)}catch(m){B.error("Error in mapSettings reaction",m)}}),Be({enabled:h.layersLoaded&&o.buildRoute,rendererService:l});const F="routes-api.expofp.com",Y=ce.flags?.busRoutes??!1;Ee({permission:h.layersLoaded&&Y,rendererService:l,dataJsonUrl:`https://${F}/v1/routes?expo=${p.EXPO}`,websocketUrl:`wss://${F}/locations?expo=${p.EXPO}`}),d(()=>a.layerStore.visible,e=>{if(!l.scene)return;const r=e.filter(n=>$(n.name)),t=l.scene.rootLayer.children.filter(n=>$(n.name));t.forEach(n=>{n.hidden=!r.find(c=>c.name===n.name)}),l.update(...t)});function G(e){let r=e;const i=ee(e,X),t=o.selectedRoute?.from,n=t instanceof j?t.layer?.name:t?.layer;o.kioskData&&(!ge()||n===a.routeStore.currentRouteLayer?.name)&&(r=k.fromUnion(e,new k(o.kioskData.x,o.kioskData.y,1,1)));const c=L(r),m={paddingPercent:i,maxZoom:V?void 0:10};if(o.shouldShiftMapRect){s.visibleRect.min={...s.visibleRect.min,x:s.visibleRect.min.x+o.overlayWidthPx},s.visibleRect=s.visibleRect;try{s.controls.zoomTo(c,m)}finally{s.visibleRect.min={...s.visibleRect.min,x:s.visibleRect.min.x-o.overlayWidthPx}}}else s.controls.zoomTo(c,m)}function ee(e,r){return!e||!r?0:(e.area/r.area>.1?15:25)/100}return ae(()=>N(oe,{children:[C("canvas",{style:{width:"100%",height:"100%"},ref:v,className:te({map:!0,moving:b.moving,hidden:a.maplibreStore.showMaplibre}),children:"ExpoFP.com"}),y&&H&&N(be,{className:"debug-fps",children:[C("div",{ref:M}),C("button",{onClick:()=>{typeof window<"u"&&window.localStorage&&localStorage.setItem(O,"false"),q(!1)},style:{padding:"4px 8px",fontSize:"11px",cursor:"pointer",backgroundColor:"#333",color:"#fff",border:"1px solid #555",width:"100%"},children:"Hide debug"})]})]}))}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as J}from"react/jsx-runtime";import{degToRad as E}from"@expofp/geometry";import W from"color";import{runInAction as X}from"mobx";import{observer as H}from"mobx-react-lite";import{useCallback as P,useEffect as _,useMemo as d,useRef as p,useState as k}from"react";import K from"../../data";import{getLayerSvg as Z,svgArea as x}from"../../data/svg";import{createSceneDef as Q}from"../../renderer";import a,{uiState as g}from"../../store";import M from"../../tools/settings";import Y from"../Map/drawing/config/config-all";import{loadLayersImages as q}from"../Map/drawing/config/loadBoothsImages";import{useBuildRoute as ee}from"../Map/traffic/useBuildRoute";import{useManageTraffic as re}from"../Map/traffic/useManageTraffic";import oe from"./MaplibreWrapper";import{useCameraReactions as te}from"./useCameraReactions";import{useDimming as ne}from"./useDimming";import{useLayerVisibilitySync as ae}from"./useLayerVisibilitySync";import{useRendererEvents as ie}from"./useRendererEvents";import{useWayfindingAndMarkers as se}from"./useWayfindingAndMarkers";import{deriveGeoConfig as le,deriveVenueMapBounds as ce,getLocalRectGeoBounds as ue,getVisibleRectFitPadding as fe,INITIAL_FIT_ZOOM_ADJUSTMENT as me}from"./utils/geo-config";import{applyMapOptions as I,DEFAULT_MAP_OPTIONS as de,getTileSource as pe,MAP_2D_OPTIONS as ge}from"./utils/map-helpers";import{calculateTransformMatrix as ye}from"./utils/solver";const $="routes-api.expofp.com";function B(){X(()=>{a.layerStore.layers.forEach(i=>{i.configured=!1,i.children=[],i.loaded=!1}),a.layerStore.layersLoaded=!1})}function F(i,y){const s=[];for(const c of i.rollRegistry.invoke(y))Array.isArray(c)?s.push(...c):s.push(c);s.length&&i.update(...s)}const Re=H(function({viewMode:y}){const[s,c]=k(null),[T,h]=k(null),e=a.rendererService,D=p(null),l=p(null),R=p(null),L=p(null),r=d(()=>le(),[]),u=d(()=>r?{center:r.center,bearing:r.bearing,zoom:r.zoom,bounds:ue(x,r.gpsConfig),fitPadding:fe(0),zoomAdjustment:me}:null,[r]),v=d(()=>r?ye(r.gpsConfig,Z()?.getAttribute("units")):null,[r]),f=d(()=>({...y==="map2d"?ge:de,maxBounds:r?ce(r.gpsConfig):void 0}),[r,y]),O=p(f),j=d(()=>pe(),[]),{mapDimAnimatorRef:b,venueDimAnimatorRef:S,handleMapDimLayerReady:z}=ne(l,e);_(()=>{if(!r)return;let n=!1;B();const o=Y(e).then(t=>{if(n)return;const A=W(M.backgroundColor==="none"?"#ebebeb":M.backgroundColor).string(),V=Q(t,x,A);c(V)}).catch(t=>{n||console.warn("Maplibre scene configuration failed.",t)}),C=b.current,m=S.current;return()=>{n=!0,B();const t=D.current;o.finally(()=>e.disposeIfCurrent(t)),R.current?.(),R.current=null,D.current=null,l.current=null,L.current=null,h(null),C?.stop(),m?.stop(),g.sceneDefReady=!1}},[r,b,e,S]);const N=P((n,o,C,m)=>{D.current=n,l.current=o,L.current=m,h(n),e.attach(n,C,m),I(o,O.current),b.current?.setTarget(g.dimmed,{immediate:!0}),S.current?.setTarget(g.dimmed,{immediate:!0}),R.current?.();const t=()=>F(e,E(o.getBearing()));o.on("rotate",t),o.on("rotateend",t),R.current=()=>{o.off("rotate",t),o.off("rotateend",t)},q(e);const A=e.ptScaleRegistry.invoke(e.scale||1);A.length&&e.update(...A),F(e,E(o.getBearing())),a.layerStore.layersLoaded=!0,a.fp.onFpConfigured&&a.fp.onFpConfigured(),g.sceneDefReady=!0,m()},[e,b,S]);_(()=>{O.current=f,I(l.current,f,!0)},[f]),ie(T,e),se(T,e),ae(e,l,r),te(l,r),ee({enabled:a.layerStore.layersLoaded&&g.buildRoute,rendererService:e});const U=K.flags?.busRoutes??!1;re({permission:a.layerStore.layersLoaded&&U,rendererService:e,dataJsonUrl:`https://${$}/v1/routes?expo=${M.EXPO}`,websocketUrl:`wss://${$}/locations?expo=${M.EXPO}`});const w=P(n=>{console.warn("Maplibre map failed to load; falling back to floorplan mode.",n),a.maplibreStore.deactivateMaplibre()},[]);if(!r||!u||!v||!s)return null;const G=`${u.center.join(",")}:${u.bearing}:${u.zoom}`;return J(oe,{sceneDef:s,geoConfig:u,staticTransform:v,tileSource:j,mapOptions:f,onRendererReady:N,onMapDimLayerReady:z,onMapLoadError:w},G)});export default Re;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useEffect as
|
|
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])}
|
package/dist/esm/data/Flags.d.ts
CHANGED
|
@@ -7,5 +7,13 @@ export interface FloorPlanFlags {
|
|
|
7
7
|
* Custom `setkiosk` phrase.
|
|
8
8
|
*/
|
|
9
9
|
customSetKiosk?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Enable live bus/transport routing on the floor plan.
|
|
12
|
+
*
|
|
13
|
+
* Disabled by default: most plans have no transit routes, and probing for
|
|
14
|
+
* them issues an extra HTTP request on every load. Set to `true` only for
|
|
15
|
+
* plans that actually provide bus routes.
|
|
16
|
+
*/
|
|
17
|
+
busRoutes?: boolean;
|
|
10
18
|
}
|
|
11
19
|
//# sourceMappingURL=Flags.d.ts.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Point } from '@expofp/geometry';
|
|
2
|
-
import { ArbitraryPoint } from '../wayfinding
|
|
3
|
-
import { RouteLine } from '../wayfinding/core';
|
|
2
|
+
import { ArbitraryPoint, type RouteLine } from '../wayfinding';
|
|
4
3
|
import { Booth } from './BoothStore';
|
|
5
4
|
import { Exhibitor } from './ExhibitorStore';
|
|
6
5
|
import { Layer } from './LayerStore';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__esDecorate as a,__runInitializers as r}from"tslib";import{action as h,computed as E,observable as f}from"mobx";import{Box as S,Point as He,boxContainsPoint as Je,pointDistance as Fe}from"@expofp/geometry";import c,{layersStore as L}from".";import{fpGeo as P}from"../data/fpGeo";import{getName as Qe}from"../components/Kiosk/SetKiosk";import{DEFAULT_UNITS as Ne,ORIENTATION_GRANTED_KEY as et}from"../constants";import Be from"../data";import{getLayerSvg as tt,svgArea as k}from"../data/svg";import{GaEventActions as st,sendEventToGa as it}from"../tools/gtag";import Ue from"../tools/logger";import{areLayersEnabled as at}from"../utils/areLayersEnabled";import{calcSpeed as Ze}from"../utils/calcSpeed";import{calcTravelTime as qe}from"../utils/calcTravelTime";import{calculateRelativeBearing as rt,convertGpsToLocal as $e,isValidPointCoords as Ve}from"../utils/gps";import{boothToEndpoint as Ke,CURRENT_LOCATION_NAME as nt,CURRENT_POSITION_POINT_ID as ot,graphDataSource as je,KIOSK_ANCHOR_POINT_ID as lt,toArbitraryPoint as We}from"../wayfinding/adapters";import{createWayfindingEngine as ct}from"../wayfinding/core";import{BoothBase as R}from"./BoothStore";import{uiState as _}from"./index";import{LayersMode as ut}from"./LayerStore";const b=s=>typeof s=="string"?Number(s.replace(",",".")):s;let dt=(()=>{let s=[],n,l=[],p=[],y,v=[],g=[],z,D=[],I=[],A,w=[],M=[],C,G=[],O=[],F,N=[],B=[],U,Z=[],q=[],$,V=[],K=[],j,W=[],X=[],Y,H=[],J=[],Q,ee=[],te=[],se,ie=[],ae=[],re,ne=[],oe=[],le,ce=[],ue=[],de,fe,me,he,pe,_e,ye,ge,ke,be,Re,ve,xe,Ee=[],Te=[],Le,Se,Pe,ze,De,Ie,Ae=[],we=[],Me,Ce,Ge;return class{static{const t=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;n=[f],y=[f],z=[f],A=[f],C=[f],F=[f],U=[f],$=[f],j=[f],Y=[f],Q=[f],se=[f],re=[f],le=[f],de=[E],fe=[h],me=[h],he=[h],pe=[E({keepAlive:!0})],_e=[h],ye=[h],ge=[E({keepAlive:!0})],ke=[E({keepAlive:!0})],be=[h],Re=[h],ve=[h],xe=[f],Le=[E],Se=[h],Pe=[h],ze=[h],De=[h],Ie=[f],Me=[h],Ce=[E({keepAlive:!0})],Ge=[h],a(this,null,de,{kind:"getter",name:"canFindLocation",static:!1,private:!1,access:{has:e=>"canFindLocation"in e,get:e=>e.canFindLocation},metadata:t},null,s),a(this,null,fe,{kind:"method",name:"selectRoute",static:!1,private:!1,access:{has:e=>"selectRoute"in e,get:e=>e.selectRoute},metadata:t},null,s),a(this,null,me,{kind:"method",name:"rebuildRouteFromPosition",static:!1,private:!1,access:{has:e=>"rebuildRouteFromPosition"in e,get:e=>e.rebuildRouteFromPosition},metadata:t},null,s),a(this,null,he,{kind:"method",name:"setStartPoint",static:!1,private:!1,access:{has:e=>"setStartPoint"in e,get:e=>e.setStartPoint},metadata:t},null,s),a(this,null,pe,{kind:"getter",name:"pathLayers",static:!1,private:!1,access:{has:e=>"pathLayers"in e,get:e=>e.pathLayers},metadata:t},null,s),a(this,null,_e,{kind:"method",name:"setMarkers",static:!1,private:!1,access:{has:e=>"setMarkers"in e,get:e=>e.setMarkers},metadata:t},null,s),a(this,null,ye,{kind:"method",name:"selectMarker",static:!1,private:!1,access:{has:e=>"selectMarker"in e,get:e=>e.selectMarker},metadata:t},null,s),a(this,null,ge,{kind:"getter",name:"selectedMarkers",static:!1,private:!1,access:{has:e=>"selectedMarkers"in e,get:e=>e.selectedMarkers},metadata:t},null,s),a(this,null,ke,{kind:"getter",name:"layers",static:!1,private:!1,access:{has:e=>"layers"in e,get:e=>e.layers},metadata:t},null,s),a(this,null,be,{kind:"method",name:"clickRoute",static:!1,private:!1,access:{has:e=>"clickRoute"in e,get:e=>e.clickRoute},metadata:t},null,s),a(this,null,Re,{kind:"method",name:"selectCurrentPosition",static:!1,private:!1,access:{has:e=>"selectCurrentPosition"in e,get:e=>e.selectCurrentPosition},metadata:t},null,s),a(this,null,ve,{kind:"method",name:"findLocation",static:!1,private:!1,access:{has:e=>"findLocation"in e,get:e=>e.findLocation},metadata:t},null,s),a(this,null,Le,{kind:"getter",name:"routeInfo",static:!1,private:!1,access:{has:e=>"routeInfo"in e,get:e=>e.routeInfo},metadata:t},null,s),a(this,null,Se,{kind:"method",name:"updateRoute",static:!1,private:!1,access:{has:e=>"updateRoute"in e,get:e=>e.updateRoute},metadata:t},null,s),a(this,null,Pe,{kind:"method",name:"updateRouteDistance",static:!1,private:!1,access:{has:e=>"updateRouteDistance"in e,get:e=>e.updateRouteDistance},metadata:t},null,s),a(this,null,ze,{kind:"method",name:"updateRoutePoints",static:!1,private:!1,access:{has:e=>"updateRoutePoints"in e,get:e=>e.updateRoutePoints},metadata:t},null,s),a(this,null,De,{kind:"method",name:"checkRoutes",static:!1,private:!1,access:{has:e=>"checkRoutes"in e,get:e=>e.checkRoutes},metadata:t},null,s),a(this,null,Me,{kind:"method",name:"setGpsTrackingEnabled",static:!1,private:!1,access:{has:e=>"setGpsTrackingEnabled"in e,get:e=>e.setGpsTrackingEnabled},metadata:t},null,s),a(this,null,Ce,{kind:"getter",name:"gpsEnabled",static:!1,private:!1,access:{has:e=>"gpsEnabled"in e,get:e=>e.gpsEnabled},metadata:t},null,s),a(this,null,Ge,{kind:"method",name:"setOnlyAccessible",static:!1,private:!1,access:{has:e=>"setOnlyAccessible"in e,get:e=>e.setOnlyAccessible},metadata:t},null,s),a(null,null,n,{kind:"field",name:"routeLines",static:!1,private:!1,access:{has:e=>"routeLines"in e,get:e=>e.routeLines,set:(e,i)=>{e.routeLines=i}},metadata:t},l,p),a(null,null,y,{kind:"field",name:"routeDistance",static:!1,private:!1,access:{has:e=>"routeDistance"in e,get:e=>e.routeDistance,set:(e,i)=>{e.routeDistance=i}},metadata:t},v,g),a(null,null,z,{kind:"field",name:"currentPosition",static:!1,private:!1,access:{has:e=>"currentPosition"in e,get:e=>e.currentPosition,set:(e,i)=>{e.currentPosition=i}},metadata:t},D,I),a(null,null,A,{kind:"field",name:"requestCompass",static:!1,private:!1,access:{has:e=>"requestCompass"in e,get:e=>e.requestCompass,set:(e,i)=>{e.requestCompass=i}},metadata:t},w,M),a(null,null,C,{kind:"field",name:"iconType",static:!1,private:!1,access:{has:e=>"iconType"in e,get:e=>e.iconType,set:(e,i)=>{e.iconType=i}},metadata:t},G,O),a(null,null,F,{kind:"field",name:"tempToBooth",static:!1,private:!1,access:{has:e=>"tempToBooth"in e,get:e=>e.tempToBooth,set:(e,i)=>{e.tempToBooth=i}},metadata:t},N,B),a(null,null,U,{kind:"field",name:"focusEnabled",static:!1,private:!1,access:{has:e=>"focusEnabled"in e,get:e=>e.focusEnabled,set:(e,i)=>{e.focusEnabled=i}},metadata:t},Z,q),a(null,null,$,{kind:"field",name:"prevZ",static:!1,private:!1,access:{has:e=>"prevZ"in e,get:e=>e.prevZ,set:(e,i)=>{e.prevZ=i}},metadata:t},V,K),a(null,null,j,{kind:"field",name:"markersData",static:!1,private:!1,access:{has:e=>"markersData"in e,get:e=>e.markersData,set:(e,i)=>{e.markersData=i}},metadata:t},W,X),a(null,null,Y,{kind:"field",name:"prevMarkers",static:!1,private:!1,access:{has:e=>"prevMarkers"in e,get:e=>e.prevMarkers,set:(e,i)=>{e.prevMarkers=i}},metadata:t},H,J),a(null,null,Q,{kind:"field",name:"showAccessible",static:!1,private:!1,access:{has:e=>"showAccessible"in e,get:e=>e.showAccessible,set:(e,i)=>{e.showAccessible=i}},metadata:t},ee,te),a(null,null,se,{kind:"field",name:"onlyAccessible",static:!1,private:!1,access:{has:e=>"onlyAccessible"in e,get:e=>e.onlyAccessible,set:(e,i)=>{e.onlyAccessible=i}},metadata:t},ie,ae),a(null,null,re,{kind:"field",name:"currentRouteLayer",static:!1,private:!1,access:{has:e=>"currentRouteLayer"in e,get:e=>e.currentRouteLayer,set:(e,i)=>{e.currentRouteLayer=i}},metadata:t},ne,oe),a(null,null,le,{kind:"field",name:"currentRouteExhibitor",static:!1,private:!1,access:{has:e=>"currentRouteExhibitor"in e,get:e=>e.currentRouteExhibitor,set:(e,i)=>{e.currentRouteExhibitor=i}},metadata:t},ce,ue),a(null,null,xe,{kind:"field",name:"routeUnits",static:!1,private:!1,access:{has:e=>"routeUnits"in e,get:e=>e.routeUnits,set:(e,i)=>{e.routeUnits=i}},metadata:t},Ee,Te),a(null,null,Ie,{kind:"field",name:"isGpsTrackingEnabled",static:!1,private:!1,access:{has:e=>"isGpsTrackingEnabled"in e,get:e=>e.isGpsTrackingEnabled,set:(e,i)=>{e.isGpsTrackingEnabled=i}},metadata:t},Ae,we),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}rootStore=r(this,s);cpTimeout;routeLines=r(this,l,[]);routeDistance=(r(this,p),r(this,v,null));currentPosition=(r(this,g),r(this,D,null));requestCompass=(r(this,I),r(this,w,!1));iconType=(r(this,M),r(this,G,0));tempToBooth=(r(this,O),r(this,N,null));focusEnabled=(r(this,B),r(this,Z,!0));prevZ=(r(this,q),r(this,V,null));markersData=(r(this,K),r(this,W,{icons:[],markers:[]}));prevMarkers=(r(this,X),r(this,H,[]));showAccessible=(r(this,J),r(this,ee,!!je.getLines().find(t=>t.unaccessible)));onlyAccessible=(r(this,te),r(this,ie,!1));currentRouteLayer=(r(this,ae),r(this,ne,null));currentRouteExhibitor=(r(this,oe),r(this,ce,null));constructor(t){r(this,we),this.rootStore=t,this.focusEnabled=!window.location.search}get canFindLocation(){return!!_.kioskData||!!this.currentPosition}selectRoute(t,e=!0,i=!1){if(e&&(_.list={type:"search",text:"",focused:!1}),t&&!t.from&&t.to){const d=this.resolveFallbackFrom();d&&(t=new Route(d,t.to,t.waypoints))}t?.from&&t?.to&&t.from===t.to&&(t=null);let o=[];t?.from&&t?.to&&window.setTimeout(()=>{this.rootStore.showMap()},navigator.userAgent.toLowerCase().indexOf("android")>-1?400:50),t?.from instanceof R&&t.from.visible&&o.push(t.from),t?.to instanceof R&&t.to.visible&&(this.tempToBooth=null,o.push(t.to)),!t&&c.fp.onDirection&&c.fp.onDirection(null);const u=()=>{if(this.rootStore.moveToList(o),_.details=t,t&&(!t.from||!t.to)&&c.showOverlay(),t?.to&&t?.from){const d=ft(t.from);d&&this.rootStore.layerStore.updateVisibility(d,!0)}if(!this.currentRouteLayer){const d=Xe(this.rootStore.layerStore,t?.from),m=Xe(this.rootStore.layerStore,t?.to);d?this.currentRouteLayer=d:m&&(this.currentRouteLayer=m)}e&&t?.from&&t?.to&&it(st.ClickDirections,`${t?.from?"From "+t.from.name:""} ${t?.to?"To "+t.to.name:""}`)};i?u():setTimeout(u,200)}rebuildRouteFromPosition(t){const e=_.selectedRoute;e?.to&&this.selectRoute(new Route(t,e.to,e.waypoints),!1,!0)}resolveFallbackFrom(){if(this.currentPosition)return We(this.currentPosition,nt,ot);const t=_.kioskData;return t?We({x:t.x,y:t.y,z:t.z},Qe(),lt):null}setStartPoint(t){const e=_.selectedRoute;if(e?.to&&!e?.from&&t){const i=new Route(t,e.to,e.waypoints);this.selectRoute(i)}}get pathLayers(){return c.routeStore.routeLines?.map(t=>t.p0.layer)?.filter((t,e,i)=>i.indexOf(t)===e).reverse().map((t,e)=>({id:e+1,layer:c.layerStore.findLayer(t)}))}getNearestBooth(t){if(!t)return null;let e=this.rootStore.layerStore.findLayer(t.z);const i=t.lat&&t.lng?$e(t,P.properties.config):t;return this.rootStore.boothStore.booths.filter(o=>L.mode===ut.Default||!e?o.visible&&o.rect:o.rect&&(typeof t.z!="number"&&!t.z&&o.visible||e.name===o.layer?.name)).sort((o,u)=>Fe(i,o.rect.center)-Fe(i,u.rect.center))[0]||null}setMarkers(t){this.markersData.markers=(t?.markers??[]).map(mt),this.markersData.icons=t?.icons??[]}selectMarker(t,e){const i=this.markersData.markers.find(u=>u.id===t);this.markersData.markers.forEach(u=>u.active=!1),i&&(i.active=!0);let o=c.layerStore.findLayer(i?.z);if(e&&i){const u=c.rendererService.renderer;return o&&!o?.visible&&L.updateVisibility(o,!0),u?u.controls.panTo(i.x,i.y):(Ue.warn("Renderer is not initialized. Cannot pan to marker."),Promise.resolve())}return Promise.resolve()}get selectedMarkers(){return this.markersData.markers.filter(t=>t.active)}get layers(){var t=[];return c.routeStore.routeLines?.map(e=>e.p0.layer).reverse().forEach(e=>{t.indexOf(e)===-1&&t.push(e)}),t.map(e=>c.layerStore.layers.find(i=>i.name===e))}clickRoute(t,e){window.__resett&&window.__resett(),this.rootStore.uiState.menu=null,_.list.type==="route-planner"&&(_.list={type:"search",text:"",focused:!1}),this.selectRoute(new Route(t,e))}selectCurrentPosition(t,e=!0,i){clearTimeout(this.cpTimeout),t&&(t.x=b(t.x),t.y=b(t.y),t.lat=b(t.lat),t.lng=b(t.lng),at()||(t.z=null));const o=e&&this.rootStore.uiState.details&&!(this.rootStore.uiState.details instanceof Route),u=e&&!o&&(this.focusEnabled||this.prevZ!=t?.z);this.focusEnabled&&(this.focusEnabled=!1),this.prevZ=t?.z?.toString(),this.iconType=i?1:0;const d=t?ht(t):null;if(!d){this.currentPosition=null;return}const m=c.layerStore.findLayer(t.z),x=new CurrentPosition(d.x,d.y,m?.name||this.currentRouteLayer?.name,rt(d),t.lat,t.lng);let Oe=!this.routeLines?.length;if(m&&this.routeLines?.length&&(Oe=!!this.routeLines.find(T=>T.p0.layer===m.name||T.p1.layer===m.name)),u&&Oe){const T=c.rendererService.renderer;if(m&&!m?.visible&&L.updateVisibility(m,!0),!T){Ue.warn("Renderer is not initialized. Cannot pan to current position.");return}T.controls.panTo(x.x,x.y)}this.currentPosition=x,this.gpsEnabled||(this.cpTimeout=setTimeout(()=>{this.currentPosition&&this.selectCurrentPosition(null,!1)},30*1e3))}findLocation(){if(!this.canFindLocation)return;if(c.maplibreStore.showMaplibre){_.moveToLocation=!0;return}const t=this.currentPosition??_.kioskData;if(!t)return;this.currentPosition&&localStorage.getItem(et)==="false"&&(c.routeStore.requestCompass=!0);const e=S.fromCenter(t,{x:100,y:100});let i;if(e.intersects(k))i=e;else{const u=Math.max(k.min.x,Math.min(t.x,k.max.x)),d=Math.max(k.min.y,Math.min(t.y,k.max.y)),m=Math.min(k.size.width,k.size.height)*.3,x=S.fromCenter({x:u,y:d},{x:m,y:m}).intersection(k);i=x?S.fromUnion(e,x):e}_.moveToRect=i;const o=c.layerStore.findLayer(t.z);o&&L.updateVisibility(o,!0)}routeUnits=(r(this,ue),r(this,Ee,Ne));get routeInfo(){const t=this.routeDistance,e=this.routeUnits;return t?{distance:`${t}${e}`,units:e,time:qe(t,Ze(e))}:null}updateRoute(t,e){!t?.length&&!this.routeLines.length||(this.routeLines=t,this.updateRoutePoints())}updateRouteDistance(t){if(t==null)return;const e=tt(),i=(e.getAttribute("units")||Ne).toLowerCase?.().trim(),o=e.getAttribute("fp-ver")?.startsWith("5")??!1;this.routeDistance=Math.round(t/(o?1:10)),this.routeUnits=i,this.updateRoutePoints()}updateRoutePoints(){const t=_.selectedRoute,e=this.routeDistance,i=this.routeUnits;c.fp.onDirection&&setTimeout(()=>{c.fp.onDirection({from:Ye(t?.from??null),to:Ye(t?.to??null),lines:this.routeLines,distance:`${e}${i}`,units:i,time:qe(e,Ze(i))})},200)}checkRoutes(){const t=ct(je),e=c.boothStore.booths;console.info(`Route check started ${e.length}.... `);for(let i=0;i<e.length;i++){const o=e[i];for(let u=i+1;u<e.length;u++){const d=e[u];t.buildRoute(Ke(o),Ke(d)).lines.length||console.warn(`No route found from ${o.name} to ${d.name}`)}}console.info("Route check done....")}isGpsTrackingEnabled=(r(this,Te),r(this,Ae,!0));setGpsTrackingEnabled(t){this.isGpsTrackingEnabled=t}get gpsEnabled(){return Be.autoTrackingGps&&this.isGpsTrackingEnabled&&!Be.enableIPS}setOnlyAccessible(t){this.onlyAccessible=t}}})();export default dt;function ft(s){if(s)return s instanceof R?s.layer?.name:s.layer}function Xe(s,n){return n?n instanceof R?n.layer??null:s.findLayer(n.layer):null}function mt(s){return{...s,x:b(s.x),y:b(s.y),lat:b(s.lat),lng:b(s.lng)}}function ht(s){let n=null,l=null;return P&&(n=P.properties.config),n&&Je({min:n.p0,max:n.p2},s)?l={...s}:n&&Ve(s.lat)&&Ve(s.lng)?l=$e(s,n):n||(l=s),l||null}export function findBooth(s){return c.boothStore.findBooth(s)||c.exhibitorStore.findExhibitor(s)?.booths[0]}export function findEntityByExternalId(s){const n=c.boothStore.boothByExternalId.get(s);if(n)return{type:"booth",entity:n};const l=c.exhibitorStore.exhibitorByExternalId.get(s);if(l)return{type:"exhibitor",entity:l}}export function separateExternalIds(s){const n=[],l=[];for(const p of s){const y=findEntityByExternalId(p);y&&(y.type==="booth"?n.push(p):l.push(p))}return{boothExternalIds:n,exhibitorExternalIds:l}}export function extractRoute(s,n,l){return new Route(findBooth(s)??null,findBooth(n)??null,l?.map(p=>findBooth(p)))}export class Route{from;to;waypoints;constructor(n,l,p){this.from=n,this.to=l,this.waypoints=p;const y=n instanceof R?n.id:void 0,v=l instanceof R?l.id:void 0;this.waypoints=p?.filter(g=>g&&g.id!==y&&g.id!==v)}}function Ye(s){return s?s instanceof R?{id:s.id,name:s.name,externalId:s.externalId,layer:{name:s.layer?.name,description:s.layer?.description}}:{id:Number.MAX_SAFE_INTEGER,name:s.name,externalId:void 0,layer:{name:s.layer,description:void 0}}:null}export class CurrentPosition extends He{x;y;z;angle;lat;lng;constructor(n,l,p,y,v,g){super(n,l),this.x=n,this.y=l,this.z=p,this.angle=y,this.lat=v,this.lng=g}}
|
|
1
|
+
import{__esDecorate as a,__runInitializers as r}from"tslib";import{action as m,computed as E,observable as f}from"mobx";import{Box as S,Point as Ye,boxContainsPoint as He,pointDistance as Fe}from"@expofp/geometry";import c,{layersStore as L}from".";import{fpGeo as P}from"../data/fpGeo";import{getName as Je}from"../components/Kiosk/SetKiosk";import{DEFAULT_UNITS as Ne,ORIENTATION_GRANTED_KEY as Qe}from"../constants";import Be from"../data";import{getLayerSvg as et,svgArea as g}from"../data/svg";import{GaEventActions as tt,sendEventToGa as st}from"../tools/gtag";import Ue from"../tools/logger";import{areLayersEnabled as it}from"../utils/areLayersEnabled";import{calcSpeed as Ze}from"../utils/calcSpeed";import{calcTravelTime as qe}from"../utils/calcTravelTime";import{calculateRelativeBearing as at,convertGpsToLocal as $e,isValidPointCoords as Ve}from"../utils/gps";import{boothToEndpoint as Ke,buildRoute as rt,CURRENT_LOCATION_NAME as nt,CURRENT_POSITION_POINT_ID as ot,isWayfindingReady as lt,KIOSK_ANCHOR_POINT_ID as ct,toArbitraryPoint as je}from"../wayfinding";import{BoothBase as R}from"./BoothStore";import{uiState as _}from"./index";import{LayersMode as ut}from"./LayerStore";const b=s=>typeof s=="string"?Number(s.replace(",",".")):s;let dt=(()=>{let s=[],n,l=[],h=[],y,v=[],k=[],z,D=[],I=[],A,w=[],M=[],C,G=[],O=[],F,N=[],B=[],U,Z=[],q=[],$,V=[],K=[],j,W=[],X=[],Y,H=[],J=[],Q,ee=[],te=[],se,ie=[],ae=[],re,ne=[],oe=[],le,ce=[],ue=[],de,fe,me,he,pe,_e,ye,ke,ge,be,Re,ve,xe,Ee=[],Te=[],Le,Se,Pe,ze,De,Ie,Ae=[],we=[],Me,Ce,Ge;return class{static{const t=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;n=[f],y=[f],z=[f],A=[f],C=[f],F=[f],U=[f],$=[f],j=[f],Y=[f],Q=[f],se=[f],re=[f],le=[f],de=[E],fe=[m],me=[m],he=[m],pe=[E({keepAlive:!0})],_e=[m],ye=[m],ke=[E({keepAlive:!0})],ge=[E({keepAlive:!0})],be=[m],Re=[m],ve=[m],xe=[f],Le=[E],Se=[m],Pe=[m],ze=[m],De=[m],Ie=[f],Me=[m],Ce=[E({keepAlive:!0})],Ge=[m],a(this,null,de,{kind:"getter",name:"canFindLocation",static:!1,private:!1,access:{has:e=>"canFindLocation"in e,get:e=>e.canFindLocation},metadata:t},null,s),a(this,null,fe,{kind:"method",name:"selectRoute",static:!1,private:!1,access:{has:e=>"selectRoute"in e,get:e=>e.selectRoute},metadata:t},null,s),a(this,null,me,{kind:"method",name:"rebuildRouteFromPosition",static:!1,private:!1,access:{has:e=>"rebuildRouteFromPosition"in e,get:e=>e.rebuildRouteFromPosition},metadata:t},null,s),a(this,null,he,{kind:"method",name:"setStartPoint",static:!1,private:!1,access:{has:e=>"setStartPoint"in e,get:e=>e.setStartPoint},metadata:t},null,s),a(this,null,pe,{kind:"getter",name:"pathLayers",static:!1,private:!1,access:{has:e=>"pathLayers"in e,get:e=>e.pathLayers},metadata:t},null,s),a(this,null,_e,{kind:"method",name:"setMarkers",static:!1,private:!1,access:{has:e=>"setMarkers"in e,get:e=>e.setMarkers},metadata:t},null,s),a(this,null,ye,{kind:"method",name:"selectMarker",static:!1,private:!1,access:{has:e=>"selectMarker"in e,get:e=>e.selectMarker},metadata:t},null,s),a(this,null,ke,{kind:"getter",name:"selectedMarkers",static:!1,private:!1,access:{has:e=>"selectedMarkers"in e,get:e=>e.selectedMarkers},metadata:t},null,s),a(this,null,ge,{kind:"getter",name:"layers",static:!1,private:!1,access:{has:e=>"layers"in e,get:e=>e.layers},metadata:t},null,s),a(this,null,be,{kind:"method",name:"clickRoute",static:!1,private:!1,access:{has:e=>"clickRoute"in e,get:e=>e.clickRoute},metadata:t},null,s),a(this,null,Re,{kind:"method",name:"selectCurrentPosition",static:!1,private:!1,access:{has:e=>"selectCurrentPosition"in e,get:e=>e.selectCurrentPosition},metadata:t},null,s),a(this,null,ve,{kind:"method",name:"findLocation",static:!1,private:!1,access:{has:e=>"findLocation"in e,get:e=>e.findLocation},metadata:t},null,s),a(this,null,Le,{kind:"getter",name:"routeInfo",static:!1,private:!1,access:{has:e=>"routeInfo"in e,get:e=>e.routeInfo},metadata:t},null,s),a(this,null,Se,{kind:"method",name:"updateRoute",static:!1,private:!1,access:{has:e=>"updateRoute"in e,get:e=>e.updateRoute},metadata:t},null,s),a(this,null,Pe,{kind:"method",name:"updateRouteDistance",static:!1,private:!1,access:{has:e=>"updateRouteDistance"in e,get:e=>e.updateRouteDistance},metadata:t},null,s),a(this,null,ze,{kind:"method",name:"updateRoutePoints",static:!1,private:!1,access:{has:e=>"updateRoutePoints"in e,get:e=>e.updateRoutePoints},metadata:t},null,s),a(this,null,De,{kind:"method",name:"checkRoutes",static:!1,private:!1,access:{has:e=>"checkRoutes"in e,get:e=>e.checkRoutes},metadata:t},null,s),a(this,null,Me,{kind:"method",name:"setGpsTrackingEnabled",static:!1,private:!1,access:{has:e=>"setGpsTrackingEnabled"in e,get:e=>e.setGpsTrackingEnabled},metadata:t},null,s),a(this,null,Ce,{kind:"getter",name:"gpsEnabled",static:!1,private:!1,access:{has:e=>"gpsEnabled"in e,get:e=>e.gpsEnabled},metadata:t},null,s),a(this,null,Ge,{kind:"method",name:"setOnlyAccessible",static:!1,private:!1,access:{has:e=>"setOnlyAccessible"in e,get:e=>e.setOnlyAccessible},metadata:t},null,s),a(null,null,n,{kind:"field",name:"routeLines",static:!1,private:!1,access:{has:e=>"routeLines"in e,get:e=>e.routeLines,set:(e,i)=>{e.routeLines=i}},metadata:t},l,h),a(null,null,y,{kind:"field",name:"routeDistance",static:!1,private:!1,access:{has:e=>"routeDistance"in e,get:e=>e.routeDistance,set:(e,i)=>{e.routeDistance=i}},metadata:t},v,k),a(null,null,z,{kind:"field",name:"currentPosition",static:!1,private:!1,access:{has:e=>"currentPosition"in e,get:e=>e.currentPosition,set:(e,i)=>{e.currentPosition=i}},metadata:t},D,I),a(null,null,A,{kind:"field",name:"requestCompass",static:!1,private:!1,access:{has:e=>"requestCompass"in e,get:e=>e.requestCompass,set:(e,i)=>{e.requestCompass=i}},metadata:t},w,M),a(null,null,C,{kind:"field",name:"iconType",static:!1,private:!1,access:{has:e=>"iconType"in e,get:e=>e.iconType,set:(e,i)=>{e.iconType=i}},metadata:t},G,O),a(null,null,F,{kind:"field",name:"tempToBooth",static:!1,private:!1,access:{has:e=>"tempToBooth"in e,get:e=>e.tempToBooth,set:(e,i)=>{e.tempToBooth=i}},metadata:t},N,B),a(null,null,U,{kind:"field",name:"focusEnabled",static:!1,private:!1,access:{has:e=>"focusEnabled"in e,get:e=>e.focusEnabled,set:(e,i)=>{e.focusEnabled=i}},metadata:t},Z,q),a(null,null,$,{kind:"field",name:"prevZ",static:!1,private:!1,access:{has:e=>"prevZ"in e,get:e=>e.prevZ,set:(e,i)=>{e.prevZ=i}},metadata:t},V,K),a(null,null,j,{kind:"field",name:"markersData",static:!1,private:!1,access:{has:e=>"markersData"in e,get:e=>e.markersData,set:(e,i)=>{e.markersData=i}},metadata:t},W,X),a(null,null,Y,{kind:"field",name:"prevMarkers",static:!1,private:!1,access:{has:e=>"prevMarkers"in e,get:e=>e.prevMarkers,set:(e,i)=>{e.prevMarkers=i}},metadata:t},H,J),a(null,null,Q,{kind:"field",name:"showAccessible",static:!1,private:!1,access:{has:e=>"showAccessible"in e,get:e=>e.showAccessible,set:(e,i)=>{e.showAccessible=i}},metadata:t},ee,te),a(null,null,se,{kind:"field",name:"onlyAccessible",static:!1,private:!1,access:{has:e=>"onlyAccessible"in e,get:e=>e.onlyAccessible,set:(e,i)=>{e.onlyAccessible=i}},metadata:t},ie,ae),a(null,null,re,{kind:"field",name:"currentRouteLayer",static:!1,private:!1,access:{has:e=>"currentRouteLayer"in e,get:e=>e.currentRouteLayer,set:(e,i)=>{e.currentRouteLayer=i}},metadata:t},ne,oe),a(null,null,le,{kind:"field",name:"currentRouteExhibitor",static:!1,private:!1,access:{has:e=>"currentRouteExhibitor"in e,get:e=>e.currentRouteExhibitor,set:(e,i)=>{e.currentRouteExhibitor=i}},metadata:t},ce,ue),a(null,null,xe,{kind:"field",name:"routeUnits",static:!1,private:!1,access:{has:e=>"routeUnits"in e,get:e=>e.routeUnits,set:(e,i)=>{e.routeUnits=i}},metadata:t},Ee,Te),a(null,null,Ie,{kind:"field",name:"isGpsTrackingEnabled",static:!1,private:!1,access:{has:e=>"isGpsTrackingEnabled"in e,get:e=>e.isGpsTrackingEnabled,set:(e,i)=>{e.isGpsTrackingEnabled=i}},metadata:t},Ae,we),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}rootStore=r(this,s);cpTimeout;routeLines=r(this,l,[]);routeDistance=(r(this,h),r(this,v,null));currentPosition=(r(this,k),r(this,D,null));requestCompass=(r(this,I),r(this,w,!1));iconType=(r(this,M),r(this,G,0));tempToBooth=(r(this,O),r(this,N,null));focusEnabled=(r(this,B),r(this,Z,!0));prevZ=(r(this,q),r(this,V,null));markersData=(r(this,K),r(this,W,{icons:[],markers:[]}));prevMarkers=(r(this,X),r(this,H,[]));showAccessible=(r(this,J),r(this,ee,!1));onlyAccessible=(r(this,te),r(this,ie,!1));currentRouteLayer=(r(this,ae),r(this,ne,null));currentRouteExhibitor=(r(this,oe),r(this,ce,null));constructor(t){r(this,we),this.rootStore=t,this.focusEnabled=!window.location.search}get canFindLocation(){return!!_.kioskData||!!this.currentPosition}selectRoute(t,e=!0,i=!1){if(e&&(_.list={type:"search",text:"",focused:!1}),t&&!t.from&&t.to){const d=this.resolveFallbackFrom();d&&(t=new Route(d,t.to,t.waypoints))}t?.from&&t?.to&&t.from===t.to&&(t=null);let o=[];t?.from&&t?.to&&window.setTimeout(()=>{this.rootStore.showMap()},navigator.userAgent.toLowerCase().indexOf("android")>-1?400:50),t?.from instanceof R&&t.from.visible&&o.push(t.from),t?.to instanceof R&&t.to.visible&&(this.tempToBooth=null,o.push(t.to)),!t&&c.fp.onDirection&&c.fp.onDirection(null);const u=()=>{if(this.rootStore.moveToList(o),_.details=t,t&&(!t.from||!t.to)&&c.showOverlay(),t?.to&&t?.from){const d=ft(t.from);d&&this.rootStore.layerStore.updateVisibility(d,!0)}if(!this.currentRouteLayer){const d=We(this.rootStore.layerStore,t?.from),p=We(this.rootStore.layerStore,t?.to);d?this.currentRouteLayer=d:p&&(this.currentRouteLayer=p)}e&&t?.from&&t?.to&&st(tt.ClickDirections,`${t?.from?"From "+t.from.name:""} ${t?.to?"To "+t.to.name:""}`)};i?u():setTimeout(u,200)}rebuildRouteFromPosition(t){const e=_.selectedRoute;e?.to&&this.selectRoute(new Route(t,e.to,e.waypoints),!1,!0)}resolveFallbackFrom(){if(this.currentPosition)return je(this.currentPosition,nt,ot);const t=_.kioskData;return t?je({x:t.x,y:t.y,z:t.z},Je(),ct):null}setStartPoint(t){const e=_.selectedRoute;if(e?.to&&!e?.from&&t){const i=new Route(t,e.to,e.waypoints);this.selectRoute(i)}}get pathLayers(){return c.routeStore.routeLines?.map(t=>t.p0.layer)?.filter((t,e,i)=>i.indexOf(t)===e).reverse().map((t,e)=>({id:e+1,layer:c.layerStore.findLayer(t)}))}getNearestBooth(t){if(!t)return null;let e=this.rootStore.layerStore.findLayer(t.z);const i=t.lat&&t.lng?$e(t,P.properties.config):t;return this.rootStore.boothStore.booths.filter(o=>L.mode===ut.Default||!e?o.visible&&o.rect:o.rect&&(typeof t.z!="number"&&!t.z&&o.visible||e.name===o.layer?.name)).sort((o,u)=>Fe(i,o.rect.center)-Fe(i,u.rect.center))[0]||null}setMarkers(t){this.markersData.markers=(t?.markers??[]).map(mt),this.markersData.icons=t?.icons??[]}selectMarker(t,e){const i=this.markersData.markers.find(u=>u.id===t);this.markersData.markers.forEach(u=>u.active=!1),i&&(i.active=!0);let o=c.layerStore.findLayer(i?.z);if(e&&i){const u=c.rendererService.renderer;return o&&!o?.visible&&L.updateVisibility(o,!0),u?u.controls.panTo(i.x,i.y):(Ue.warn("Renderer is not initialized. Cannot pan to marker."),Promise.resolve())}return Promise.resolve()}get selectedMarkers(){return this.markersData.markers.filter(t=>t.active)}get layers(){var t=[];return c.routeStore.routeLines?.map(e=>e.p0.layer).reverse().forEach(e=>{t.indexOf(e)===-1&&t.push(e)}),t.map(e=>c.layerStore.layers.find(i=>i.name===e))}clickRoute(t,e){window.__resett&&window.__resett(),this.rootStore.uiState.menu=null,_.list.type==="route-planner"&&(_.list={type:"search",text:"",focused:!1}),this.selectRoute(new Route(t,e))}selectCurrentPosition(t,e=!0,i){clearTimeout(this.cpTimeout),t&&(t.x=b(t.x),t.y=b(t.y),t.lat=b(t.lat),t.lng=b(t.lng),it()||(t.z=null));const o=e&&this.rootStore.uiState.details&&!(this.rootStore.uiState.details instanceof Route),u=e&&!o&&(this.focusEnabled||this.prevZ!=t?.z);this.focusEnabled&&(this.focusEnabled=!1),this.prevZ=t?.z?.toString(),this.iconType=i?1:0;const d=t?ht(t):null;if(!d){this.currentPosition=null;return}const p=c.layerStore.findLayer(t.z),x=new CurrentPosition(d.x,d.y,p?.name||this.currentRouteLayer?.name,at(d),t.lat,t.lng);let Oe=!this.routeLines?.length;if(p&&this.routeLines?.length&&(Oe=!!this.routeLines.find(T=>T.p0.layer===p.name||T.p1.layer===p.name)),u&&Oe){const T=c.rendererService.renderer;if(p&&!p?.visible&&L.updateVisibility(p,!0),!T){Ue.warn("Renderer is not initialized. Cannot pan to current position.");return}T.controls.panTo(x.x,x.y)}this.currentPosition=x,this.gpsEnabled||(this.cpTimeout=setTimeout(()=>{this.currentPosition&&this.selectCurrentPosition(null,!1)},30*1e3))}findLocation(){if(!this.canFindLocation)return;if(c.maplibreStore.showMaplibre){_.moveToLocation=!0;return}const t=this.currentPosition??_.kioskData;if(!t)return;this.currentPosition&&localStorage.getItem(Qe)==="false"&&(c.routeStore.requestCompass=!0);const e=S.fromCenter(t,{x:100,y:100});let i;if(e.intersects(g))i=e;else{const u=Math.max(g.min.x,Math.min(t.x,g.max.x)),d=Math.max(g.min.y,Math.min(t.y,g.max.y)),p=Math.min(g.size.width,g.size.height)*.3,x=S.fromCenter({x:u,y:d},{x:p,y:p}).intersection(g);i=x?S.fromUnion(e,x):e}_.moveToRect=i;const o=c.layerStore.findLayer(t.z);o&&L.updateVisibility(o,!0)}routeUnits=(r(this,ue),r(this,Ee,Ne));get routeInfo(){const t=this.routeDistance,e=this.routeUnits;return t?{distance:`${t}${e}`,units:e,time:qe(t,Ze(e))}:null}updateRoute(t,e){!t?.length&&!this.routeLines.length||(this.routeLines=t,this.updateRoutePoints())}updateRouteDistance(t){if(t==null)return;const e=et(),i=(e.getAttribute("units")||Ne).toLowerCase?.().trim(),o=e.getAttribute("fp-ver")?.startsWith("5")??!1;this.routeDistance=Math.round(t/(o?1:10)),this.routeUnits=i,this.updateRoutePoints()}updateRoutePoints(){const t=_.selectedRoute,e=this.routeDistance,i=this.routeUnits;c.fp.onDirection&&setTimeout(()=>{c.fp.onDirection({from:Xe(t?.from??null),to:Xe(t?.to??null),lines:this.routeLines,distance:`${e}${i}`,units:i,time:qe(e,Ze(i))})},200)}checkRoutes(){if(!lt()){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 i=t[e];for(let o=e+1;o<t.length;o++){const u=t[o];rt(Ke(i),Ke(u)).lines.length||console.warn(`No route found from ${i.name} to ${u.name}`)}}console.info("Route check done....")}isGpsTrackingEnabled=(r(this,Te),r(this,Ae,!0));setGpsTrackingEnabled(t){this.isGpsTrackingEnabled=t}get gpsEnabled(){return Be.autoTrackingGps&&this.isGpsTrackingEnabled&&!Be.enableIPS}setOnlyAccessible(t){this.onlyAccessible=t}}})();export default dt;function ft(s){if(s)return s instanceof R?s.layer?.name:s.layer}function We(s,n){return n?n instanceof R?n.layer??null:s.findLayer(n.layer):null}function mt(s){return{...s,x:b(s.x),y:b(s.y),lat:b(s.lat),lng:b(s.lng)}}function ht(s){let n=null,l=null;return P&&(n=P.properties.config),n&&He({min:n.p0,max:n.p2},s)?l={...s}:n&&Ve(s.lat)&&Ve(s.lng)?l=$e(s,n):n||(l=s),l||null}export function findBooth(s){return c.boothStore.findBooth(s)||c.exhibitorStore.findExhibitor(s)?.booths[0]}export function findEntityByExternalId(s){const n=c.boothStore.boothByExternalId.get(s);if(n)return{type:"booth",entity:n};const l=c.exhibitorStore.exhibitorByExternalId.get(s);if(l)return{type:"exhibitor",entity:l}}export function separateExternalIds(s){const n=[],l=[];for(const h of s){const y=findEntityByExternalId(h);y&&(y.type==="booth"?n.push(h):l.push(h))}return{boothExternalIds:n,exhibitorExternalIds:l}}export function extractRoute(s,n,l){return new Route(findBooth(s)??null,findBooth(n)??null,l?.map(h=>findBooth(h)))}export class Route{from;to;waypoints;constructor(n,l,h){this.from=n,this.to=l,this.waypoints=h;const y=n instanceof R?n.id:void 0,v=l instanceof R?l.id:void 0;this.waypoints=h?.filter(k=>k&&k.id!==y&&k.id!==v)}}function Xe(s){return s?s instanceof R?{id:s.id,name:s.name,externalId:s.externalId,layer:{name:s.layer?.name,description:s.layer?.description}}:{id:Number.MAX_SAFE_INTEGER,name:s.name,externalId:void 0,layer:{name:s.layer,description:void 0}}:null}export class CurrentPosition extends Ye{x;y;z;angle;lat;lng;constructor(n,l,h,y,v,k){super(n,l),this.x=n,this.y=l,this.z=h,this.angle=y,this.lat=v,this.lng=k}}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* All canvases are pre-created eagerly.
|
|
6
6
|
* Fallback canvases are used when custom images are not available.
|
|
7
7
|
*/
|
|
8
|
-
import type { IconProvider } from '
|
|
8
|
+
import type { IconProvider } from '../runtime/types';
|
|
9
9
|
interface CanvasIconProviderConfig {
|
|
10
10
|
/** Icon image map — typically store.fp.icons */
|
|
11
11
|
readonly iconMap: Map<string, HTMLImageElement>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createArrowCurrentCanvas as
|
|
1
|
+
import{createArrowCurrentCanvas as w,createCurrentCanvas as u,createImageCanvas as I,createTargetCanvas as O}from"../../components/Map/drawing/config/canvases";import{createCircleCanvas as v}from"../../renderer";const A="#00A2FF",F="#FF9F06",n=34,l=56;function a(i,e,t,s,C,r){const c=i.get(e);return c?(c.id=e,I(c,t,s,C)):r()}function o(i){return{canvas:i,width:i.width,height:i.height}}export function createCanvasIconProvider(i){const{iconMap:e,pixelRatio:t}=i,s=i.sourceColor??A,C=i.destinationColor??F,r=new Map;r.set("destination",o(a(e,"destination",n,n,t,()=>O(t,C)))),r.set("source",o(a(e,"departure",n,n,t,()=>u(t,s)))),r.set("source_inactive",o(a(e,"departure_inactive",n,n,t,()=>u(t,s))));const c=u(t,s);c.id="current-location",r.set("current",o(c));const d=a(e,"transition",n,n,t,()=>u(t,s));return r.set("transition",o(d)),r.set("transition_up",o(a(e,"transition_up",l,n,t,()=>d))),r.set("transition_down",o(a(e,"transition_down",l,n,t,()=>d))),r.set("transition_entry",o(a(e,"departure",n,n,t,()=>u(t,s)))),r.set("current_arrow",o(a(e,"direction",n,n,t,()=>w(t,s)))),r.set("trail",o(v(4,"#b5b7bc"))),{getIcon(_){const p=r.get(_);if(!p)throw new Error(`Unknown icon: ${_}`);return p}}}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { type GraphDataSource } from '../core';
|
|
2
|
-
|
|
2
|
+
/** Reads the app's wayfinding graph data from `window.__wfData`. */
|
|
3
|
+
export declare function createGraphDataSource(): GraphDataSource;
|
|
3
4
|
//# sourceMappingURL=graphDataSource.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function n(){return window.__wfData}export
|
|
1
|
+
function n(){return window.__wfData}export function createGraphDataSource(){return{getLines:()=>n()?.lines??[],getLineEnds:()=>n()?.lineEnds??[]}}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
+
export type { ArbitraryPoint, ArbitraryPointId } from './arbitraryPoint';
|
|
2
|
+
export { CURRENT_LOCATION_NAME, CURRENT_POSITION_POINT_ID, KIOSK_ANCHOR_POINT_ID, toArbitraryPoint, } from './arbitraryPoint';
|
|
1
3
|
export { boothToEndpoint } from './boothToEndpoint';
|
|
2
4
|
export { createCanvasIconProvider } from './canvasIconProvider';
|
|
3
5
|
export { createFloorContext } from './floorContext';
|
|
4
|
-
export {
|
|
6
|
+
export { createGraphDataSource } from './graphDataSource';
|
|
5
7
|
export { createKioskCanvas } from './kioskCanvas';
|
|
6
|
-
export { CURRENT_LOCATION_NAME, CURRENT_POSITION_POINT_ID, KIOSK_ANCHOR_POINT_ID, toArbitraryPoint, } from './arbitraryPoint';
|
|
7
|
-
export type { ArbitraryPoint, ArbitraryPointId } from './arbitraryPoint';
|
|
8
8
|
export { positionInput } from './positionInput';
|
|
9
|
-
export type { IconAsset, IconName, IconProvider } from './iconProvider';
|
|
10
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{boothToEndpoint}from"./boothToEndpoint";export{createCanvasIconProvider}from"./canvasIconProvider";export{createFloorContext}from"./floorContext";export{
|
|
1
|
+
export{CURRENT_LOCATION_NAME,CURRENT_POSITION_POINT_ID,KIOSK_ANCHOR_POINT_ID,toArbitraryPoint}from"./arbitraryPoint";export{boothToEndpoint}from"./boothToEndpoint";export{createCanvasIconProvider}from"./canvasIconProvider";export{createFloorContext}from"./floorContext";export{createGraphDataSource}from"./graphDataSource";export{createKioskCanvas}from"./kioskCanvas";export{positionInput}from"./positionInput";
|
|
@@ -8,6 +8,12 @@ interface BindMobxReactionsArgs {
|
|
|
8
8
|
readonly runtime: WayfindingRuntime;
|
|
9
9
|
readonly kioskHandler: KioskHandler;
|
|
10
10
|
readonly yahHandler: YahHandler;
|
|
11
|
+
/**
|
|
12
|
+
* TODO (improvement): typing these as concrete `store/*` classes couples this
|
|
13
|
+
* glue to the store and produces type-only madge cycles (harmless at runtime —
|
|
14
|
+
* `import type` is erased). To make the wf glue fully store-type-free, invert
|
|
15
|
+
* into local ports (as done for `FloorContext`/`IconProvider`).
|
|
16
|
+
*/
|
|
11
17
|
readonly stores: {
|
|
12
18
|
readonly routeStore: RouteStore;
|
|
13
19
|
readonly uiState: UIState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{comparer as E,reaction as c}from"mobx";import{
|
|
1
|
+
import{comparer as E,reaction as c}from"mobx";import{boothToEndpoint as P,CURRENT_LOCATION_NAME as C,CURRENT_POSITION_POINT_ID as a,positionInput as x,toArbitraryPoint as T}from"./adapters";import{createRerouteController as k}from"./core";const b=i=>"rect"in i?P(i):i;export function bindMobxReactions({runtime:i,kioskHandler:A,yahHandler:R,stores:{routeStore:t,uiState:e,layerStore:l},rerouteThresholdSvg:g}){const f=[],F=k(g);function m(){const o=e.selectedRoute,n=o?.from?b(o.from):null,s=o?.to?b(o.to):null;if(!n||!s){i.clearRoute();return}i.setRoute({from:n,to:s,waypoints:o?.waypoints?.map(P),accessible:t.onlyAccessible})===!1&&console.error(new Error(`Route not found: (${n.x},${n.y}) \u2192 (${s.x},${s.y})`))}function u(){const o=t.currentPosition,n=t.iconType!==0,s=e.selectedRoute,d=!!(s?.from&&s?.to),y=n&&!d;if(!o){i.onPositionChanged(null),R(null);return}const p=x(o);y?(i.onPositionChanged(null),R({x:p.x,y:p.y,layer:p.layer})):(R(null),i.onPositionChanged(p))}function I(){const o=t.currentPosition,n=e.selectedRoute;if(!o||!n?.to)return;const s=!n.from,y=n.from?.id===a&&F.shouldReroute(x(o),t.routeLines);!s&&!y||t.rebuildRouteFromPosition(T(o,C,a))}function h(){const o=l.floors.find(n=>n.active)?.name;A(e.kioskData??null,o,l.mode)}function L(){const o=e.selectedRoute,n=t.currentPosition;if(!o?.to||!n||o.from?.id!==a||t.routeLines.length>0)return;const s=n.z!=null?String(n.z):"";o.from.x===n.x&&o.from.y===n.y&&o.from.layer===s||t.rebuildRouteFromPosition(T(n,C,a))}f.push(c(()=>l.layersLoaded,()=>{m(),u()}),c(()=>[e.selectedRoute,t.onlyAccessible],()=>{m(),u()}),c(()=>t.currentPosition,()=>{u()}),c(()=>{const o=t.currentPosition;return o?{x:o.x,y:o.y,z:o.z}:null},()=>{I(),L()},{equals:E.structural}),c(()=>[e.kioskData,l.floors.find(o=>o.active)],()=>h()));let r=null;const N=c(()=>[t.currentRouteLayer,e.getRouteNextFloor],()=>{l.layersLoaded&&(r!==null&&clearTimeout(r),r=setTimeout(()=>{i.onFloorChanged(),u(),r=null},0))});return f.push(()=>{r!==null&&clearTimeout(r),N()}),m(),u(),h(),()=>{for(const o of f)o();f.length=0}}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { type GraphBuildOptions, type GraphDataSource, type GraphInstance, type
|
|
1
|
+
import { type GraphBuildOptions, type GraphDataSource, type GraphInstance, type GraphLine, type PathNode, type RoutePoint } from '../types';
|
|
2
2
|
export declare function makePoint(layer: string, x: number, y: number): RoutePoint;
|
|
3
|
-
export declare function makeLine(p0: RoutePoint, p1: RoutePoint, overrides?: Partial<Omit<
|
|
3
|
+
export declare function makeLine(p0: RoutePoint, p1: RoutePoint, overrides?: Partial<Omit<GraphLine, 'p0' | 'p1'>>): GraphLine;
|
|
4
4
|
export declare function makeNode(layer: string, x: number, y: number): PathNode;
|
|
5
5
|
export declare function createMockDataSource(options?: {
|
|
6
|
-
lines?:
|
|
6
|
+
lines?: GraphLine[];
|
|
7
7
|
lineEnds?: RoutePoint[];
|
|
8
8
|
}): GraphDataSource;
|
|
9
9
|
export declare function createMockGraph(options?: {
|
|
10
|
-
lines?:
|
|
10
|
+
lines?: GraphLine[];
|
|
11
11
|
lineEnds?: RoutePoint[];
|
|
12
12
|
hasNodeResult?: boolean | ((id: string) => boolean);
|
|
13
13
|
findResult?: PathNode[] | ((fromId: string, toId: string) => PathNode[]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createGraphCache as G}from"./graph/graphCache";import{
|
|
1
|
+
import{createGraphCache as G}from"./graph/graphCache";import{buildMultiPointRoute as b}from"./routing/buildMultiPointRoute";import{buildRoute as R}from"./routing/buildRoute";import{getRouteLength as m}from"./routing/getRouteLength";import{reorderWaypoints as y}from"./routing/optimizeWaypointOrder";import{resolveWaypointCandidates as h}from"./routing/resolveWaypointCandidates";const g=1e-6,u=(e,t)=>e.layer===t.layer&&Math.abs(e.x-t.x)<g&&Math.abs(e.y-t.y)<g;function O(e,t){if(!e.length)return e;const n=e[e.length-1],o=n.p1,r=u(t.segment.p0,o)?t.segment.p1:t.segment.p0;return u(n.p0,r)?[...e.slice(0,-1),{...n,p1:t.projection}]:[...e,{...t.segment,p0:o,p1:t.projection}]}function j(e,t){if(!e.length)return e;const n=e[0],o=n.p0,r=u(t.segment.p0,o)?t.segment.p1:t.segment.p0;return u(n.p1,r)?[{...n,p0:t.projection},...e.slice(1)]:[{...t.segment,p0:t.projection,p1:o},...e]}function E(e,t,n){let o=e;return t&&(o=O(o,t)),n&&(o=j(o,n)),o}export function createWayfindingEngine(e){const t=G();return{buildRoute(n,o,r){const i=t.getOrBuild(e,r?.accessible??!1),s=h(i,n),a=h(i,o),c=R(i,s.candidates,a.candidates),p=!!s.offGraphEntry||!!a.offGraphEntry,f=E(c.lines,s.offGraphEntry,a.offGraphEntry);return{lines:f,distance:p?m(f):c.totalDistance}},buildWaypointsRoute(n,o){if(n.length<2)return{lines:[],distance:0};const r=t.getOrBuild(e,o?.accessible??!1),s=(o?.fastest?y(n):n).map(d=>h(r,d)),a=b(r,s.map(d=>d.candidates)),c=s[0].offGraphEntry,p=s[s.length-1].offGraphEntry,f=!!c||!!p,l=E(a.lines,c,p);return{lines:l,distance:f?m(l):a.totalDistance}}}}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { GraphBuildOptions, GraphDataSource, GraphInstance, PathFinder } from '../types';
|
|
1
|
+
import { type GraphBuildOptions, type GraphDataSource, type GraphInstance, type PathFinder } from '../types';
|
|
2
2
|
export declare function buildGraph(dataSource: GraphDataSource, pathFinder: PathFinder, options: GraphBuildOptions): GraphInstance;
|
|
3
3
|
//# sourceMappingURL=buildGraph.d.ts.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type Graph } from 'ngraph.graph';
|
|
2
|
-
import { type
|
|
2
|
+
import { type GraphLine, type PathFinderOptions } from '../types';
|
|
3
3
|
interface LinkData {
|
|
4
4
|
distance: number;
|
|
5
5
|
}
|
|
6
6
|
/** Builds an ngraph instance from route lines, filtering and linking per options. */
|
|
7
|
-
export declare function buildNGraph(lines:
|
|
7
|
+
export declare function buildNGraph(lines: GraphLine[], options: PathFinderOptions): Graph<unknown, LinkData>;
|
|
8
8
|
export {};
|
|
9
9
|
//# sourceMappingURL=buildNGraph.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type GraphInstance, type
|
|
1
|
+
import { type GraphInstance, type GraphLine, type RoutePoint, type ShortestPathResult } from '../types';
|
|
2
2
|
/** Computes the weighted path cost matching the graph link distance formula. */
|
|
3
|
-
export declare function computeWeightedPathCost(points: RoutePoint[], lines:
|
|
3
|
+
export declare function computeWeightedPathCost(points: RoutePoint[], lines: GraphLine[]): number;
|
|
4
4
|
/**
|
|
5
5
|
* Finds the shortest path between candidate point sets by trying all from×to
|
|
6
6
|
* pairs and picking the one with the lowest weighted cost.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { RouteLine, RoutePoint } from '../types';
|
|
1
|
+
import { type GraphLine, type RouteLine, type RoutePoint } from '../types';
|
|
2
2
|
export declare const toNodeId: (p: RoutePoint) => string;
|
|
3
3
|
export declare const arePointsClose: (p1: RoutePoint, p2: RoutePoint) => boolean;
|
|
4
|
-
export declare const matchesLine: (line:
|
|
5
|
-
export declare function findLineByEndpoints(lines:
|
|
4
|
+
export declare const matchesLine: (line: GraphLine, p0: RoutePoint, p1: RoutePoint) => boolean;
|
|
5
|
+
export declare function findLineByEndpoints(lines: GraphLine[], p0: RoutePoint, p1: RoutePoint): GraphLine | undefined;
|
|
6
6
|
export declare function canMergeSegments(lastSegment: RouteLine, segment: RouteLine): boolean;
|
|
7
|
-
export declare function buildRouteSegments(points: RoutePoint[], lines:
|
|
7
|
+
export declare function buildRouteSegments(points: RoutePoint[], lines: GraphLine[]): RouteLine[];
|
|
8
8
|
//# sourceMappingURL=graphHelpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{degToRad as a,lineAngle as
|
|
1
|
+
import{degToRad as a,lineAngle as u,pointDistance as f}from"@expofp/geometry";export const toNodeId=t=>`${t.layer}_${t.x}_${t.y}`;const p=1;export const arePointsClose=(t,n)=>t.layer===n.layer&&f(t,n)<=p,matchesLine=(t,n,e)=>arePointsClose(t.p0,n)&&arePointsClose(t.p1,e)||arePointsClose(t.p0,e)&&arePointsClose(t.p1,n);export function findLineByEndpoints(t,n,e){return t.find(o=>matchesLine(o,n,e))}const d=a(5);export function canMergeSegments(t,n){if(t.virtual!==n.virtual)return!1;const e=u(t.p0,t.p1),o=u(n.p0,n.p1);let r=Math.abs(o-e);return r>Math.PI&&(r=2*Math.PI-r),r<=d}export function buildRouteSegments(t,n){const e=[];for(let o=1;o<t.length;o++){const r=t[o-1],i=t[o],l=findLineByEndpoints(n,r,i);if(!l){console.warn(`WF: buildRouteSegments \u2014 no line found between ${toNodeId(r)} and ${toNodeId(i)}`);continue}const s={p0:r,p1:i,virtual:l.virtual},c=e[e.length-1];c&&canMergeSegments(c,s)?e[e.length-1]={...c,p1:s.p1}:e.push(s)}return e}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type GraphLine } from '../types';
|
|
2
2
|
/** Weighted cost of a route line for A* graph edge (legacy formula). */
|
|
3
|
-
export declare function linkCost(line:
|
|
3
|
+
export declare function linkCost(line: GraphLine): number;
|
|
4
4
|
//# sourceMappingURL=linkCost.d.ts.map
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
+
export type { Route, WayfindingEngine } from './createWayfindingEngine';
|
|
1
2
|
export { createWayfindingEngine } from './createWayfindingEngine';
|
|
2
|
-
export type {
|
|
3
|
-
export type { GraphDataSource, RouteEndpoint, RouteLine, RoutePoint, RouteSnapResult, SnapToRouteConfig, } from './types';
|
|
4
|
-
export { projectPointOnSegment } from './geometry/projectPointOnSegment';
|
|
3
|
+
export type { GraphDataSource, GraphLine, RouteEndpoint, RouteLine, RoutePoint, RouteSnapResult, SnapToRouteConfig, } from './types';
|
|
5
4
|
export type { SegmentProjection } from './geometry/projectPointOnSegment';
|
|
6
|
-
export {
|
|
7
|
-
export type { TransitionPointDef } from './rendering/computeTransitionPoints';
|
|
5
|
+
export { projectPointOnSegment } from './geometry/projectPointOnSegment';
|
|
8
6
|
export { computeTrailPoints } from './rendering/computeTrailPoints';
|
|
9
|
-
export {
|
|
7
|
+
export type { TransitionPointDef } from './rendering/computeTransitionPoints';
|
|
8
|
+
export { computeTransitionPoints } from './rendering/computeTransitionPoints';
|
|
10
9
|
export { normalizeRouteDirection } from './rendering/normalizeRouteDirection';
|
|
10
|
+
export { computeBoundingBox } from './rendering/routeGeometry';
|
|
11
11
|
export { getRouteLength } from './routing/getRouteLength';
|
|
12
|
-
export {
|
|
13
|
-
export { createRerouteController } from './position/rerouteController';
|
|
12
|
+
export { getThresholdFromMetersToSvg, getThresholdSafe, resolveRerouteThresholdSvg, SNAP_THRESHOLD_METERS, } from './position/gpsThreshold';
|
|
14
13
|
export type { RerouteController } from './position/rerouteController';
|
|
14
|
+
export { createRerouteController } from './position/rerouteController';
|
|
15
15
|
export { snapToRoute } from './position/snapToRoute';
|
|
16
16
|
export { splitRouteByPoint } from './position/splitRouteByPoint';
|
|
17
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{createWayfindingEngine}from"./createWayfindingEngine";export{projectPointOnSegment}from"./geometry/projectPointOnSegment";export{
|
|
1
|
+
export{createWayfindingEngine}from"./createWayfindingEngine";export{projectPointOnSegment}from"./geometry/projectPointOnSegment";export{computeTrailPoints}from"./rendering/computeTrailPoints";export{computeTransitionPoints}from"./rendering/computeTransitionPoints";export{normalizeRouteDirection}from"./rendering/normalizeRouteDirection";export{computeBoundingBox}from"./rendering/routeGeometry";export{getRouteLength}from"./routing/getRouteLength";export{getThresholdFromMetersToSvg,getThresholdSafe,resolveRerouteThresholdSvg,SNAP_THRESHOLD_METERS}from"./position/gpsThreshold";export{createRerouteController}from"./position/rerouteController";export{snapToRoute}from"./position/snapToRoute";export{splitRouteByPoint}from"./position/splitRouteByPoint";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const SNAP_THRESHOLD_METERS = 7.5;
|
|
2
|
-
|
|
2
|
+
interface GpsProjectionConfig {
|
|
3
3
|
p0: {
|
|
4
4
|
x: number;
|
|
5
5
|
y: number;
|
|
@@ -12,7 +12,7 @@ type GpsProjectionConfig = {
|
|
|
12
12
|
lat: number;
|
|
13
13
|
lng: number;
|
|
14
14
|
};
|
|
15
|
-
}
|
|
15
|
+
}
|
|
16
16
|
export declare const getThresholdSafe: (value?: number) => number | undefined;
|
|
17
17
|
export declare function getThresholdFromMetersToSvg({ thresholdInMeters, gpsConfig, }: {
|
|
18
18
|
thresholdInMeters?: number;
|