@expofp/floorplan 3.22.0 → 3.23.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.
- package/dist/browser/{Button-PkkC8fYi.js → Button-Cdcme0dW.js} +5 -5
- package/dist/browser/{CookieConsent-COPAytjc.js → CookieConsent-B7cDBqp6.js} +7 -7
- package/dist/browser/{Debug-CWVwWCU0.js → Debug-C1YnJvnk.js} +7 -7
- package/dist/browser/{Demo-yP6tHJE2.js → Demo-BIM3wFq3.js} +9 -9
- package/dist/browser/{Free-rILAyXya.js → Free-D7U5AEcf.js} +12 -12
- package/dist/browser/{Gallery-DbQ6bxpv.js → Gallery-BXlz1tz4.js} +9 -9
- package/dist/browser/{GpsLoader-U0qUOF4J.js → GpsLoader-BdUzK_Wq.js} +29 -29
- package/dist/browser/{KioskStore-D25GX7Yv.js → KioskStore-t38ARgcW.js} +33 -33
- package/dist/browser/{MaplibreAdapter-CMX6Q9zs.js → MaplibreAdapter-CSAShUgd.js} +2098 -2047
- package/dist/browser/{ModalContainer-TVi_WpAy.js → ModalContainer-B33HKAAU.js} +10 -10
- package/dist/browser/{PermissionNotice-SMHSj2qI.js → PermissionNotice-F6g9pz0M.js} +6 -6
- package/dist/browser/{SetKioskMode-BwSFzzos.js → SetKioskMode-CJoi2gHM.js} +11 -11
- package/dist/browser/{ShowKiosk-D0lj2wzz.js → ShowKiosk-H4rnBUGh.js} +11 -11
- package/dist/browser/{ViewerMenuPanel-9A84e6XT.js → ViewerMenuPanel-BmJhh8Ln.js} +10 -10
- package/dist/browser/{add-debug-secret-listener-CyjybhbR.js → add-debug-secret-listener-BNoe6VU3.js} +1 -1
- package/dist/browser/{adopt-global-settings-BhJX0B0D.js → adopt-global-settings-DIweHmmO.js} +9 -9
- package/dist/browser/{boolean-editor-3IdccOj-.js → boolean-editor-C9fqoeTB.js} +9 -9
- package/dist/browser/{bootIntercom-CkHVzOj8.js → bootIntercom-BB5HdKln.js} +2 -2
- package/dist/browser/{booth-by-xy-CQvcHK_A.js → booth-by-xy-BP9IYJhy.js} +254 -254
- package/dist/browser/bundle.json +65 -65
- package/dist/browser/{classnames-6bU7zOpA.js → classnames-Dmeqek3o.js} +2 -2
- package/dist/browser/{client-BkHWS5lm.js → client-CBb2454O.js} +4 -4
- package/dist/browser/{components-Btgwx55F.js → components-DyDFRZBC.js} +787 -738
- package/dist/browser/{debug-overlay-D9Gq5tnJ.js → debug-overlay-DXOrtUeJ.js} +10 -10
- package/dist/browser/{debug-ui-CclRARRM.js → debug-ui-tNUnR4wz.js} +6 -6
- package/dist/browser/{dist-nmYmVc14.js → dist-BIFUFe-T.js} +5 -5
- package/dist/browser/{dist-YXQi1KHp.js → dist-DZfEO0RJ.js} +6 -6
- package/dist/browser/{dist-D4vUke_M.js → dist-DcOtrqGG.js} +3 -3
- package/dist/browser/{efp-debug-init-BNS4_yDX.js → efp-debug-init-B4ddpmiL.js} +3 -3
- package/dist/browser/{enum-editor-YeDXZjkr.js → enum-editor-CJB3E-Vh.js} +4 -4
- package/dist/browser/{es5-CNjSlyOY.js → es5-DeTUpXm2.js} +2 -2
- package/dist/browser/{event-not-found-BQMzvSOp.js → event-not-found-WRXwMJms.js} +1 -1
- package/dist/browser/{exports-BPkLTIY6.js → exports-C5uYtLxL.js} +1 -1
- package/dist/browser/{favicon-D09E0ggy.js → favicon-5gTCZLy9.js} +1 -1
- package/dist/browser/{fetch-retry.umd-CyeSNjOO.js → fetch-retry.umd-BoyaQteS.js} +2 -2
- package/dist/browser/{flex-DFe-lnRY.js → flex-DjFgAKFt.js} +5 -5
- package/dist/browser/{floorplan.loader-CtqFPg5v.js → floorplan.loader-Ck3XnezM.js} +20 -20
- package/dist/browser/{floorplan.ready-mvJLjOT8.js → floorplan.ready-CzTR8qqL.js} +315 -353
- package/dist/browser/{fuse-CH8SDiG4.js → fuse-BR27GheK.js} +2 -2
- package/dist/browser/{i18n-pREdf4o-.js → i18n-DNH3sP4D.js} +2528 -2559
- package/dist/browser/index.js +35 -35
- package/dist/browser/{index.module-4MYJQyVQ.js → index.module-DzGptmYn.js} +4 -4
- package/dist/browser/{integrateKiosk-BuctRtHM.js → integrateKiosk-DN5HgMdz.js} +9 -8
- package/dist/browser/{is-webview-Dk7i6iyE.js → is-webview-CEqtlsy5.js} +1 -1
- package/dist/browser/{jsx-runtime-BXQ7PX-y.js → jsx-runtime-BRUHXGcL.js} +2 -2
- package/dist/browser/{kiosk-record-Dz3E7PjP.js → kiosk-record-C6KsyYH0.js} +1 -1
- package/dist/browser/{lib-BfXVjQQV.js → lib-BoYL1Y22.js} +3 -3
- package/dist/browser/{loadImage-CUg38cMx.js → loadImage-2JV_4hsV.js} +4 -4
- package/dist/browser/{logDeviceInfo-CgIqRuAY.js → logDeviceInfo-Bga4LjdT.js} +9 -9
- package/dist/browser/{main-BzXd5H0A.js → main-BUSluy8y.js} +1 -1
- package/dist/browser/{mobx-BEFSh5R7.js → mobx-Cp-RXiD6.js} +4 -4
- package/dist/browser/{optional-boolean-editor-DH0Yj5mx.js → optional-boolean-editor-biZOa4EF.js} +3 -3
- package/dist/browser/{optional-enum-editor-DdsG6-RD.js → optional-enum-editor-BuzYWVhL.js} +4 -4
- package/dist/browser/{optional-string-editor-DdFnggla.js → optional-string-editor-1Gxph7oU.js} +4 -4
- package/dist/browser/{particles.min-C6YCIw7u.js → particles.min-Cq5SYO7P.js} +2 -2
- package/dist/browser/{react-Cq6vsgZS.js → react-BCiZTNvQ.js} +2 -2
- package/dist/browser/{react-dom-CioKdINL.js → react-dom-Gayzbfmi.js} +3 -3
- package/dist/browser/{rolldown-runtime-CEmdmqfC.js → rolldown-runtime-C4CgTizo.js} +1 -1
- package/dist/browser/{select-BREAzzuP.js → select-BEAG7sfR.js} +10 -10
- package/dist/browser/{settings-C17jPyNg.js → settings-BJrS0XMO.js} +2 -2
- package/dist/browser/{settings-item-BYt2Yu8n.js → settings-item-C-rqGE6m.js} +6 -6
- package/dist/browser/{store-BzaR1IVp.js → store-DH91iUcL.js} +7014 -7107
- package/dist/browser/{string-editor-XaVb33Ez.js → string-editor-fs3xB248.js} +4 -4
- package/dist/browser/{text-field-D70wZ5kg.js → text-field-CN-pynRC.js} +5 -5
- package/dist/browser/{theme-BLZVltm4.js → theme-78GgHmsO.js} +8 -8
- package/dist/browser/{ui-DyGGq9Ts.js → ui-BFQlKtKk.js} +8 -8
- package/dist/browser/{useRenderTarget-CMhjhwNe.js → useRenderTarget-CtWSXh71.js} +4 -4
- package/dist/esm/components/Bookmarks.js +1 -1
- package/dist/esm/components/Kiosk/integrateKiosk.d.ts +8 -2
- package/dist/esm/components/Kiosk/integrateKiosk.js +1 -1
- package/dist/esm/components/Kiosk/kiosk-mode.d.ts +8 -0
- package/dist/esm/components/Kiosk/kiosk-mode.js +1 -0
- package/dist/esm/components/Kiosk/kiosk-record.d.ts +5 -1
- package/dist/esm/components/Kiosk/kioskUrlParam.d.ts +7 -3
- package/dist/esm/components/Kiosk/kioskUrlParam.js +1 -1
- package/dist/esm/components/Map/Map.js +1 -1
- package/dist/esm/components/Maplibre/MaplibreAdapter.js +1 -1
- package/dist/esm/components/Maplibre/useCameraReactions.js +1 -1
- package/dist/esm/components/Maplibre/utils/geo-config.d.ts +32 -0
- package/dist/esm/components/Maplibre/utils/geo-config.js +1 -1
- package/dist/esm/floorplan.ready.js +1 -1
- package/dist/esm/services/multi-slug.d.ts +3 -3
- package/dist/esm/services/url-dispatch.d.ts +3 -5
- package/dist/esm/services/url-dispatch.js +1 -1
- package/dist/esm/store/BookmarksStore.d.ts +1 -4
- package/dist/esm/store/BookmarksStore.js +1 -2
- package/dist/esm/store/UIState.d.ts +8 -0
- package/dist/esm/store/UIState.js +1 -1
- package/dist/esm/store/init/index.js +1 -1
- package/dist/esm/store/init/init-booths.d.ts +3 -3
- package/dist/esm/store/init/init-booths.js +1 -1
- package/dist/esm/store/init/init-ui.js +1 -1
- package/dist/esm/utils/customCommands.js +1 -1
- package/dist/esm/utils/scene-bounds.d.ts +7 -0
- package/dist/esm/utils/scene-bounds.js +1 -1
- package/package.json +10 -9
- package/dist/esm/store/init/init-bookmarks.d.ts +0 -9
- package/dist/esm/store/init/init-bookmarks.js +0 -1
|
@@ -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.23.0" };
|
|
5
5
|
var t = new e.Error().stack;
|
|
6
6
|
t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "0a67f4c1-0ef6-428f-92c6-94c57178bf21", e._sentryDebugIdIdentifier = "sentry-dbid-0a67f4c1-0ef6-428f-92c6-94c57178bf21");
|
|
7
7
|
} catch {}
|
|
8
8
|
})();
|
|
9
|
-
import { t as e } from "./jsx-runtime-
|
|
10
|
-
import { t } from "./settings-item-
|
|
11
|
-
import { t as n } from "./text-field-
|
|
9
|
+
import { t as e } from "./jsx-runtime-BRUHXGcL.js";
|
|
10
|
+
import { t } from "./settings-item-C-rqGE6m.js";
|
|
11
|
+
import { t as n } from "./text-field-CN-pynRC.js";
|
|
12
12
|
//#region ../debug/src/lib/ui/string-editor.tsx
|
|
13
13
|
var r = e(), i = (e) => {
|
|
14
14
|
var i;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
(function() {
|
|
2
2
|
try {
|
|
3
3
|
var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {};
|
|
4
|
-
e.SENTRY_RELEASE = { id: "3.
|
|
4
|
+
e.SENTRY_RELEASE = { id: "3.23.0" };
|
|
5
5
|
var t = new e.Error().stack;
|
|
6
6
|
t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "9c5a0877-c176-4e2d-b51c-123d50ab2b3c", e._sentryDebugIdIdentifier = "sentry-dbid-9c5a0877-c176-4e2d-b51c-123d50ab2b3c");
|
|
7
7
|
} catch {}
|
|
8
8
|
})();
|
|
9
|
-
import { r as e } from "./rolldown-runtime-
|
|
10
|
-
import { t } from "./react-
|
|
11
|
-
import { D as n, i as r, l as i, n as a, s as o, u as s, y as c } from "./flex-
|
|
12
|
-
import { t as l } from "./classnames-
|
|
9
|
+
import { r as e } from "./rolldown-runtime-C4CgTizo.js";
|
|
10
|
+
import { t } from "./react-BCiZTNvQ.js";
|
|
11
|
+
import { D as n, i as r, l as i, n as a, s as o, u as s, y as c } from "./flex-DjFgAKFt.js";
|
|
12
|
+
import { t as l } from "./classnames-Dmeqek3o.js";
|
|
13
13
|
//#region ../../node_modules/.pnpm/@radix-ui+themes@3.3.0_@types+react-dom@19.2.3_@types+react@19.2.17__@types+react@19.2._5ea800d4e947acedb1fa1275f1697b17/node_modules/@radix-ui/themes/dist/esm/components/text-field.props.js
|
|
14
14
|
var u = /* @__PURE__ */ e(t()), d = /* @__PURE__ */ e(l()), f = {
|
|
15
15
|
size: {
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
(function() {
|
|
2
2
|
try {
|
|
3
3
|
var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {};
|
|
4
|
-
e.SENTRY_RELEASE = { id: "3.
|
|
4
|
+
e.SENTRY_RELEASE = { id: "3.23.0" };
|
|
5
5
|
var t = new e.Error().stack;
|
|
6
6
|
t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "f658045a-5be7-4ea4-a4b2-ddea9ab9caf3", e._sentryDebugIdIdentifier = "sentry-dbid-f658045a-5be7-4ea4-a4b2-ddea9ab9caf3");
|
|
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-C4CgTizo.js";
|
|
10
|
+
import { t } from "./react-BCiZTNvQ.js";
|
|
11
|
+
import { t as n } from "./jsx-runtime-BRUHXGcL.js";
|
|
12
|
+
import { t as r } from "./react-dom-Gayzbfmi.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-DjFgAKFt.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-DZfEO0RJ.js";
|
|
15
|
+
import { t as y } from "./classnames-Dmeqek3o.js";
|
|
16
16
|
//#region ../../node_modules/.pnpm/@radix-ui+react-visually-hidden@1.2.3_@types+react-dom@19.2.3_@types+react@19.2.17__@ty_cffccd7838985066e8e1d993b5cb6017/node_modules/@radix-ui/react-visually-hidden/dist/index.mjs
|
|
17
17
|
var b = /* @__PURE__ */ e(r(), 1), x = /* @__PURE__ */ e(t(), 1), S = n(), C = Object.freeze({
|
|
18
18
|
position: "absolute",
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
(function() {
|
|
2
2
|
try {
|
|
3
3
|
var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {};
|
|
4
|
-
e.SENTRY_RELEASE = { id: "3.
|
|
4
|
+
e.SENTRY_RELEASE = { id: "3.23.0" };
|
|
5
5
|
var t = new e.Error().stack;
|
|
6
6
|
t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "3c34ab8b-5d65-4c06-8595-6ed371acabc5", e._sentryDebugIdIdentifier = "sentry-dbid-3c34ab8b-5d65-4c06-8595-6ed371acabc5");
|
|
7
7
|
} catch {}
|
|
8
8
|
})();
|
|
9
|
-
import { r as e } from "./rolldown-runtime-
|
|
10
|
-
import { a as t, i as n, s as r } from "./efp-debug-init-
|
|
11
|
-
import { a as i, i as a } from "./adopt-global-settings-
|
|
12
|
-
import { t as o } from "./jsx-runtime-
|
|
13
|
-
import "./settings-
|
|
14
|
-
import { t as s } from "./add-debug-secret-listener-
|
|
9
|
+
import { r as e } from "./rolldown-runtime-C4CgTizo.js";
|
|
10
|
+
import { a as t, i as n, s as r } from "./efp-debug-init-B4ddpmiL.js";
|
|
11
|
+
import { a as i, i as a } from "./adopt-global-settings-DIweHmmO.js";
|
|
12
|
+
import { t as o } from "./jsx-runtime-BRUHXGcL.js";
|
|
13
|
+
import "./settings-BJrS0XMO.js";
|
|
14
|
+
import { t as s } from "./add-debug-secret-listener-BNoe6VU3.js";
|
|
15
15
|
//#region ../debug/src/lib/ui/render-debug-ui.tsx
|
|
16
16
|
var c = /* @__PURE__ */ e(r(), 1), l = o(), u = !1;
|
|
17
17
|
function d() {
|
|
@@ -26,7 +26,7 @@ function d() {
|
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
28
|
let o = async (t) => {
|
|
29
|
-
let { DebugUi: n } = await import("./debug-ui-
|
|
29
|
+
let { DebugUi: n } = await import("./debug-ui-tNUnR4wz.js"), { createRoot: i } = await import("./client-CBb2454O.js").then((t) => /* @__PURE__ */ e(t.default, 1)), a = document.createElement("div");
|
|
30
30
|
document.body.appendChild(a), i(a).render(/* @__PURE__ */ (0, l.jsx)(n, {
|
|
31
31
|
useDebugButtonState: r.useState,
|
|
32
32
|
open: t
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
(function() {
|
|
2
2
|
try {
|
|
3
3
|
var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {};
|
|
4
|
-
e.SENTRY_RELEASE = { id: "3.
|
|
4
|
+
e.SENTRY_RELEASE = { id: "3.23.0" };
|
|
5
5
|
var t = new e.Error().stack;
|
|
6
6
|
t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "d8257710-401b-4433-989c-d77176101db5", e._sentryDebugIdIdentifier = "sentry-dbid-d8257710-401b-4433-989c-d77176101db5");
|
|
7
7
|
} catch {}
|
|
8
8
|
})();
|
|
9
|
-
import { r as e } from "./rolldown-runtime-
|
|
10
|
-
import { t } from "./react-
|
|
11
|
-
import { c as n } from "./store-
|
|
9
|
+
import { r as e } from "./rolldown-runtime-C4CgTizo.js";
|
|
10
|
+
import { t } from "./react-BCiZTNvQ.js";
|
|
11
|
+
import { c as n } from "./store-DH91iUcL.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{Fragment as a,jsx as o,jsxs as
|
|
1
|
+
import{Fragment as a,jsx as o,jsxs as n}from"react/jsx-runtime";import{useObserver as r}from"mobx-react-lite";import{useRef as i}from"react";import m from"../data";import e,{uiState as t}from"../store";import l from"../tools/settings";import{EntityList as f}from"./";import u from"./SidebarActionsContainer";function k(){return r(()=>!l.wayfinding||!e.bookmarksStore.hasRoutableBookmarks?null:o(u,{className:"efp-sidebar-actions--bookmarks",showDirections:!1,showBookmark:!1,showRoutePlanner:!0,showShare:!1,onClickRoutePlanner:()=>e.routePlannerStore.launchFromBookmarks()}))}function c(){const s=i(null);return r(()=>n(a,{children:[o(k,{}),o(f,{updatedScrollableRef:s})]}))}export default()=>r(()=>!m.hideBookmarks&&!t.details&&t.list.type==="bookmarks"&&o(c,{}));
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { type Kiosk } from './SetKiosk';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Apply a kiosk anchor to the map. Two callers with different inputs: the
|
|
4
|
+
* device's own kiosk (saved locally or from `config.kiosk`) carries the full
|
|
5
|
+
* shape including its home framing, while a QR-shared route hands over the
|
|
6
|
+
* position alone (`kiosk_x/y/z`) — hence every framing field is optional here.
|
|
7
|
+
*/
|
|
8
|
+
export declare function integrateKioskIntoMap(kiosk: Partial<Kiosk>, enableKioskMode: boolean): void;
|
|
9
|
+
export declare function integrateKioskIntoWf(kiosk: Partial<Kiosk>): void;
|
|
4
10
|
//# sourceMappingURL=integrateKiosk.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{runInAction as
|
|
1
|
+
import{runInAction as a,when as i}from"mobx";import e from"../../store";import{getPtScaleZoomRatio as u}from"./kiosk-record";export function integrateKioskIntoMap(t,n){t&&a(()=>{if(e.uiState.setKioskData(t),e.uiState.kiosk=n,e.maplibreStore.showMaplibre)return;const o=t.mapCenterX!=null&&t.mapCenterY!=null;e.uiState.setMapSettings({centerxy:o?`${t.mapCenterX},${t.mapCenterY}`:"",z:t.z??void 0,bearing:t.mapRollDegrees});const r=u(t);r!==void 0&&e.uiState.changeZoom(r)})}export function integrateKioskIntoWf(t){t&&(t.z!=null&&e.fp.activateFloor({name:t.z.toString()}),i(()=>!!e.uiState.selectedRoute,()=>{const n=e.uiState.selectedRoute;n?.to&&!n.from&&e.routeStore.selectRoute(n,!1,!0)}))}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type UIState from '../../store/UIState';
|
|
2
|
+
/**
|
|
3
|
+
* Toggle kiosk mode — the single meaning of `kiosk=1` / `kiosk=0` from either
|
|
4
|
+
* channel (the `?kiosk=` URL param, the typed search-box command). Exit also
|
|
5
|
+
* resets the per-device UI scale; init-ui's reaction persists the choice.
|
|
6
|
+
*/
|
|
7
|
+
export declare function applyKioskMode(uiState: UIState, enabled: boolean): void;
|
|
8
|
+
//# sourceMappingURL=kiosk-mode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function applyKioskMode(o,i){o.kiosk=i,i||o.resetUIScale()}
|
|
@@ -14,6 +14,10 @@ export declare function toFiniteNumber(value: number | null | undefined): number
|
|
|
14
14
|
* to the one the kiosk was saved at, or undefined when the record does not
|
|
15
15
|
* carry both. Restoring the home framing and integrating the kiosk at load both
|
|
16
16
|
* need it, and both need the same guard.
|
|
17
|
+
*
|
|
18
|
+
* `Partial` rather than `Kiosk`: a QR-shared route hands over the anchor
|
|
19
|
+
* position alone, with no framing at all — the guard above is what that case
|
|
20
|
+
* lands in.
|
|
17
21
|
*/
|
|
18
|
-
export declare function getPtScaleZoomRatio(kiosk: Kiosk | null | undefined): number | undefined;
|
|
22
|
+
export declare function getPtScaleZoomRatio(kiosk: Partial<Kiosk> | null | undefined): number | undefined;
|
|
19
23
|
//# sourceMappingURL=kiosk-record.d.ts.map
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import { Kiosk } from './SetKiosk';
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { type Kiosk } from './SetKiosk';
|
|
2
|
+
/** The anchor keys, in the order both halves speak them. */
|
|
3
|
+
declare const ANCHOR_KEYS: readonly ['x', 'y', 'z'];
|
|
4
|
+
type KioskAnchor = Partial<Pick<Kiosk, (typeof ANCHOR_KEYS)[number]>>;
|
|
5
|
+
export declare function collectKioskUrlParams(searchParams: URLSearchParams): KioskAnchor;
|
|
6
|
+
export declare function setKioskUrlParams(searchParams: URLSearchParams, kioskData: KioskAnchor): void;
|
|
7
|
+
export {};
|
|
4
8
|
//# sourceMappingURL=kioskUrlParam.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getKioskUrlParamKey as
|
|
1
|
+
import{getKioskUrlParamKey as e}from"./SetKiosk";const i=["x","y","z"];export function collectKioskUrlParams(r){const t={},o=u(r,"x");o!==null&&(t.x=o);const n=u(r,"y");n!==null&&(t.y=n);const l=r.get(e("z"));return l!==null&&(t.z=l),t}export function setKioskUrlParams(r,t){if(t)for(const o of i){const n=t[o];n!=null&&r.set(e(o),typeof n=="number"?n.toFixed(2):`${n}`)}}function u(r,t){const o=r.get(e(t));if(o===null)return null;const n=parseFloat(o);return Number.isNaN(n)?null:n}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Fragment as ne,jsx as k,jsxs as U}from"react/jsx-runtime";import{Box as L}from"@expofp/geometry";import{Draggable as ie}from"@expofp/ui";import ae from"classnames";import se from"color";import{observable as le,reaction as me}from"mobx";import{useObserver as ce}from"mobx-react-lite";import{useEffect as fe,useMemo as de,useRef as x,useState as ue}from"react";import{DEBUG_STORAGE_KEY as Z}from"../../constants";import pe from"../../data";import{fpGeo as he}from"../../data/fpGeo";import{svgArea as j}from"../../data/svg";import{boxToRenderer as B,createSceneDef as
|
|
1
|
+
import{Fragment as ne,jsx as k,jsxs as U}from"react/jsx-runtime";import{Box as L}from"@expofp/geometry";import{Draggable as ie}from"@expofp/ui";import ae from"classnames";import se from"color";import{observable as le,reaction as me}from"mobx";import{useObserver as ce}from"mobx-react-lite";import{useEffect as fe,useMemo as de,useRef as x,useState as ue}from"react";import{DEBUG_STORAGE_KEY as Z}from"../../constants";import pe from"../../data";import{fpGeo as he}from"../../data/fpGeo";import{svgArea as j}from"../../data/svg";import{boxToRenderer as B,createSceneDef as ve,mapRollSetting as A}from"../../renderer";import{pickDefaultScene as $,pickDefaultScenePoint as ye}from"../../renderer/engine-core/defs";import i,{boothStore as ge,layersStore as v,uiState as o}from"../../store";import{BoothBase as K}from"../../store/BoothStore";import{Category as be}from"../../store/CategoryStore";import{Exhibitor as V}from"../../store/ExhibitorStore";import{LayerMode as R}from"../../store/LayerStore";import{Route as Se}from"../../store/RouteStore";import E from"../../tools/logger";import h from"../../tools/settings";import{areLayersEnabled as we}from"../../utils/areLayersEnabled";import{parseNumberPair as W}from"../../utils/camera-map-settings";import{applyVenueDimValue as xe,createDimmingAnimator as Re}from"../../utils/dimming";import{convertGpsToLocal as Te}from"../../utils/gps";import y from"../../utils/is-debug";import{isPathwayLayer as H}from"../../utils/is-pathway-layer";import{useReaction as u}from"../../utils/mobx";import{createWayfinding as Ce}from"../../wayfinding";import q from"./booth-by-xy";import ke from"./drawing/config/config-all";import{configMarkers as Le,getMarkerFromClick as Be}from"./drawing/config/config-markers";import{loadLayersImages as Ee}from"./drawing/config/loadBoothsImages";import{useBuildRoute as Me}from"./traffic/useBuildRoute";import{useManageTraffic as Pe}from"./traffic/useManageTraffic";const M=Number.isFinite(h.maxZoom)?h.maxZoom:void 0,ze=M!==void 0;export default function Ie(){let P={};const J="#ebebeb",g=x(null),b=de(()=>le({moving:!1,prevLevel:i.layerStore.layers.find(e=>!e.frozen&&e.visible)}),[]),a=i.rendererService,T=x(Re(e=>xe(a,e)));let l;const S=x(null),z=x(null);let I=null,_=null,D=null,F=!1;function G(){v.layers.forEach(e=>{e.configured=!1,e.children=[],e.loaded=!1})}const[Q,Y]=ue(()=>typeof window<"u"&&window.localStorage?localStorage.getItem(Z)!=="false":!0);u(()=>i.routeStore.currentRouteLayer,()=>{if(!a.scene||b.prevLevel===i.routeStore.currentRouteLayer)return;const e=a.scene.rootLayer.children.filter(r=>i.layerStore.floors.some(t=>r.name.includes(t.name))),n=i.routeStore.currentRouteLayer.name;if(!e.find(r=>r.name===n))return;const s=e?.map(r=>(r.name===n&&(r.hidden=!1),r.name===b.prevLevel?.name&&(r.hidden=!0),r));b.prevLevel=i.routeStore.currentRouteLayer,a.update(...s)}),u(()=>o.centerMap,()=>{!o.centerMap||i.maplibreStore.showMaplibre||(l.controls.resetCamera({zoom:!!(o.list.type==="search"&&o.list.text)}),o.centerMap=!1)}),fe(()=>{if(!g.current)return;async function e(){const n=g.current;if(!n)return;G(),v.layersLoaded=!1;let s={};try{if(y){const t=document.createElement("canvas").getContext("webgl2"),m=t&&t.getExtension("EXT_disjoint_timer_query_webgl2"),f=(await import("stats-gl")).default,c=new f({trackGPU:m,horizontal:!0}),p=z.current;if(!p)throw new Error("memoryInfoPanel not found.");c.dom.style.position="relative",p.style.width=`${90*(m?3:2)}px`,p.style.height="48px",p.appendChild(c.dom),s={stats:c,memoryInfoPanel:p}}}catch(r){console.error(r)}l=a.create({canvas:n,ui:s}),S.current=l,me(()=>o.canvasVisibleRectPx,(r,t)=>{r&&(l.visibleRect=B(r)),t.dispose()},{fireImmediately:!0}),ke(a).then(({layers:r,cleanup:t})=>{if(F||S.current!==l){t();return}D=t,y&&console.log("Renderer settings",l);const m=se(h.backgroundColor==="none"?J:h.backgroundColor).string();P=ve(r,j,m),a.start(P),T.current.setTarget(o.dimmed,{immediate:!0}),A(l,i.fp.enableRotation?1:0),M!==void 0&&l.viewport.setMaxZoom(M),v.layersLoaded=!0,i.fp.onFpConfigured&&i.fp?.onFpConfigured(),I=Ce(a,i),_=Le(a),Ee(a)}),l.events.addEventListener("pointer:move",({data:r})=>{if(o.setKioskModeEnabled)return;const{point:t,defs:m}=$(r),d=q(t.x,t.y),f=N(m[0]);o.hoveredBooth=d||f}),l.events.addEventListener("pointer:out",()=>{o.setKioskModeEnabled||(o.hoveredBooth=null)}),l.events.addEventListener("pointer:click",({data:r})=>{if(!o?.rootElement)return;window.__resett&&window.__resett(),o.overlayPosition==="bottom"&&o.overlaySize==="full"&&i.showMap();const{point:t,defs:m}=$(r),{x:d,y:f}=t;if(o.onGetCoordsClick){const w=i.layerStore.layers.find(C=>C.visible&&(C.mode===R.TurnedOn||C.mode===R.TurnedOff));o.onGetCoordsClick({x:d,y:f,z:w?.name||null})}if(o.setKioskModeEnabled)return;if(o.onMarkerClick){const w=Be(d,f,a.scale);y&&console.log("marker",w),o.onMarkerClick(w)}const c=q(t.x,t.y),p=N(m[0]);y&&console.log("boothIdFromClientXy",c,"boothByShape",p,"pointer:click point",t),i.clickBooth(c||p)}),l.events.addEventListener("navigation:change",()=>window.__resett&&window.__resett())}return e(),i.fp.getCenterCoordinates=oe,()=>ee()},[]);function ee(){F=!0,T.current.stop(),I?.(),_?.(),D?.(),G(),v.layersLoaded=!1,a.disposeIfCurrent(S.current),S.current=null}function oe(){const e=g.current;if(!e)throw new Error("Canvas not ready");const n=ye(l.viewport.canvasToSvg({x:e.clientWidth/2,y:e.clientHeight/2})),r=i.layerStore.visible.find(t=>t.mode===R.TurnedOff||t.mode===R.TurnedOn)?.name||null;return{...n,z:r}}function N(e){return!e||!e.shape?null:ge.booths.find(n=>n.shapes?.find(s=>s.shape==e.shape))??null}u(()=>o.zoomBy,()=>{if(!o.zoomBy||i.maplibreStore.showMaplibre)return;const e=o.zoomBy;l.controls.zoomBy(e),o.zoomBy=null}),u(()=>o.dimmed,e=>{T.current.setTarget(e)}),u(()=>o.details,()=>{if(!o.onDetails)return;if(!o.details){o.onDetails(null);return}let e=o.details;if(h.EXPO==="wineparis"&&(e instanceof V&&(e=e.booths[0]),!e))return;let n=null,s=[];e instanceof V?(n="exhibitor",s=e.booths.map(t=>t.name).sort((t,m)=>t==i.routeStore.tempToBooth?.name?-1:m==i.routeStore.tempToBooth?.name?1:0)):e instanceof K?(n="booth",s=[e.name]):e instanceof Se?(n="route",s=[e.from?.name,e.to?.name].filter(t=>!!t)):e instanceof be&&(n="category",s=e.exhibitors.map(t=>t.booths.map(m=>m.name)).flat());const r={type:n,name:e?.name,id:e?.id,externalId:e?.externalId,boothsNames:s};o.onDetails({...r,...n==="route"?{routeInfo:i.routeStore.routeInfo??void 0}:{}})}),u(()=>o.canvasVisibleRectPx,e=>{a.renderer&&(a.renderer.visibleRect=B(e))},{fireImmediately:!0}),u(()=>o.moveToRect,()=>{!o.moveToRect||i.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&&X(o.moveToRect,o.moveToRectPaddingPercent),o.moveToRect=null,o.moveToRectPaddingPercent=null)}),u(()=>o.rollReset,e=>{e&&(l.controls.resetCamera({roll:!0}),o.rollReset=!1)}),u(()=>o.moveToBooths,()=>{if(E.log("this.moveToBooths",o.moveToBooths),!o.moveToBooths||i.maplibreStore.showMaplibre)return;E.log("watched moveToBooths",o.moveToBooths);const e=o.moveToBooths.filter(n=>n.rect).map(n=>n.rect);e.length!==0&&(X(L.fromUnion(...e)),o.moveToBooths=null)}),u(()=>o.mapSettings,({zoomtime:e,center:n,centerxy:s,bearing:r,roll:t,z:m})=>{if(!(i.maplibreStore.showMaplibre||!a.renderer))try{e&&e!==o.defaultMapSettings.zoomtime&&a.renderer.controls.configure({zoomTime:e/1e3}),i.fp.enableRotation&&A(l,t??0);let d;if(n){const f=W(n),c=he?.properties.config;if(!c)throw new Error("Map center given in GPS, but the plan has no GPS config");f&&(d=Te({lat:f[0],lng:f[1]},c)??void 0)}else if(s){const f=W(s);f&&(d={x:f[0],y:f[1]})}m&&i.fp.activateFloor({name:m}),d&&a.renderer.controls.panTo(d.x,d.y),typeof r=="number"&&Number.isFinite(r)&&a.renderer.controls.rollTo(r)}catch(d){E.error("Error in mapSettings reaction",d)}}),Me({enabled:v.layersLoaded&&o.buildRoute,rendererService:a});const O="routes-api.expofp.com",te=pe.busRoutes??!1;Pe({permission:v.layersLoaded&&te,rendererService:a,dataJsonUrl:`https://${O}/v1/routes?expo=${h.EXPO}`,websocketUrl:`wss://${O}/locations?expo=${h.EXPO}`}),u(()=>i.layerStore.visible,e=>{if(!a.scene)return;const n=e.filter(t=>H(t.name)),r=a.scene.rootLayer.children.filter(t=>H(t.name));r.forEach(t=>{t.hidden=!n.find(m=>m.name===t.name)}),a.update(...r)});function X(e,n){let s=e;const r=n??re(e,j),t=o.selectedRoute?.from,m=t instanceof K?t.layer?.name:t?.layer;o.kioskData&&(!we()||m===i.routeStore.currentRouteLayer?.name)&&(s=L.fromUnion(e,new L(o.kioskData.x,o.kioskData.y,1,1)));const d=B(s),f={paddingPercent:r,maxZoom:ze?void 0:10},c=l.visibleRect;if(o.shouldShiftMapRect&&c){c.min={...c.min,x:c.min.x+o.overlayWidthPx},l.visibleRect=c;try{l.controls.zoomTo(d,f)}finally{c.min={...c.min,x:c.min.x-o.overlayWidthPx}}}else l.controls.zoomTo(d,f)}function re(e,n){return!e||!n?0:(e.area/n.area>.1?15:25)/100}return ce(()=>U(ne,{children:[k("canvas",{style:{width:"100%",height:"100%"},ref:g,className:ae({map:!0,moving:b.moving,hidden:i.maplibreStore.showMaplibre}),children:"ExpoFP.com"}),y&&Q&&U(ie,{className:"debug-fps",children:[k("div",{ref:z}),k("button",{onClick:()=>{typeof window<"u"&&window.localStorage&&localStorage.setItem(Z,"false"),Y(!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 Q}from"react/jsx-runtime";import{degToRad as w}from"@expofp/geometry";import Y from"color";import{runInAction as q}from"mobx";import{observer as ee}from"mobx-react-lite";import{useCallback as $,useEffect as B,useMemo as d,useRef as g,useState as j}from"react";import re from"../../data";import{getLayerSvg as te,svgArea as P,svgAreaExplicit as oe}from"../../data/svg";import{createSceneDef as ne}from"../../renderer";import c,{uiState as s}from"../../store";import v from"../../tools/settings";import{fitRectIsFraming as ie,getVenueFitMarginPercent as ae,resolveVenueFitRect as ce}from"../../utils/scene-bounds";import se from"../Map/drawing/config/config-all";import{loadLayersImages as le}from"../Map/drawing/config/loadBoothsImages";import{useBuildRoute as ue}from"../Map/traffic/useBuildRoute";import{useManageTraffic as fe}from"../Map/traffic/useManageTraffic";import me from"./MaplibreWrapper";import{useCameraReactions as pe}from"./useCameraReactions";import{useDimming as ge}from"./useDimming";import{useKioskIdleEvents as de}from"./useKioskIdleEvents";import{useLayerVisibilitySync as be}from"./useLayerVisibilitySync";import{usePoiMarkers as Re}from"./usePoiMarkers";import{useRendererEvents as Se}from"./useRendererEvents";import{useWayfindingAndMarkers as he}from"./useWayfindingAndMarkers";import{cameraForLocalRect as ye,deriveGeoConfig as Ce,getLocalRectGeoBounds as Me,getVisibleRectFitPadding as Ae,INITIAL_FIT_ZOOM_ADJUSTMENT as De}from"./utils/geo-config";import{applyMapOptions as N,DEFAULT_MAP_OPTIONS as Pe,getTileSource as ve,MAP_2D_OPTIONS as Te}from"./utils/map-helpers";import{calculateTransformMatrix as ze}from"./utils/solver";const U="routes-api.expofp.com",Le=800;function Ee(r,l,i){return{getCameraState:()=>{const o=r.getCenter();return{lng:o.lng,lat:o.lat,zoom:r.getZoom(),bearing:r.getBearing(),pitch:r.getPitch()}},applyCameraState:o=>{r.easeTo({center:[o.lng,o.lat],zoom:o.zoom,bearing:o.bearing??l,pitch:o.pitch??i(),duration:Le,essential:!0})},resetPitch:()=>{const o=i();r.getPitch()!==o&&r.jumpTo({pitch:o})}}}function V(){c.poiMarkerStore.clear(),q(()=>{c.layerStore.layers.forEach(r=>{r.configured=!1,r.children=[],r.loaded=!1}),c.layerStore.layersLoaded=!1})}function G(r,l){const i=[];for(const o of r.rollRegistry.invoke(l))Array.isArray(o)?i.push(...o):i.push(o);i.length&&r.update(...i)}function Oe(r){const l=Math.abs(r[0]??0),i=Math.hypot(r[0]??0,r[1]??0);return l<=0||i<=0?1:l/i}const xe=ee(function({viewMode:l}){const[i,o]=j(null),[y,x]=j(null),n=c.rendererService,T=g(null),u=g(null),C=g(null),z=g(null),I=g(null),M=g(null),e=d(()=>Ce(),[]),L=d(()=>ce({layerViewbox:c.layerStore.viewboxRectangle,explicitArea:oe?P:null,layerRectangle:c.layerStore.rectangle,sceneDef:i,svgArea:P}),[i]),A=L.rect,b=d(()=>{if(!e)return null;const a=ie(L.source)?0:ae(A,P),t=Ae(0);a&&s.screenSize&&(t.left+=s.screenSize.width*a,t.right+=s.screenSize.width*a,t.top+=s.screenSize.height*a,t.bottom+=s.screenSize.height*a);const m=s.screenSize?ye(A,e.gpsConfig,e.bearing,{width:s.screenSize.width,height:s.screenSize.height},t):null;return m?{center:m.center,bearing:e.bearing,zoom:m.zoom}:{center:e.center,bearing:e.bearing,zoom:e.zoom,bounds:Me(A,e.gpsConfig),fitPadding:t,zoomAdjustment:De}},[e,L,A]),R=d(()=>e?ze(e.gpsConfig,te()?.getAttribute("units")):null,[e]),S=d(()=>({...l==="map2d"?Te:Pe}),[l]),E=g(S),X=d(()=>ve(),[]),{mapDimAnimatorRef:_,venueDimAnimatorRef:k,applyDimmingTarget:F,handleMapDimLayerReady:J}=ge(u,n);B(()=>{if(!e)return;let a=!1;V();const t=se(n).then(({layers:f,cleanup:p})=>{if(a){p();return}z.current=p;const D=Y(v.backgroundColor==="none"?"#ebebeb":v.backgroundColor).string(),O=ne(f,P,D);o(O)}).catch(f=>{a||console.warn("Maplibre scene configuration failed.",f)}),m=_.current,h=k.current;return()=>{a=!0,V();const f=T.current;t.finally(()=>n.disposeIfCurrent(f)),C.current?.(),C.current=null,z.current?.(),z.current=null,M.current&&(c.maplibreStore.clearCameraPortIfCurrent(M.current),M.current=null),T.current=null,u.current=null,I.current=null,x(null),m?.stop(),h?.stop(),s.sceneDefReady=!1}},[e,_,n,k]);const K=$((a,t,m,h)=>{T.current=a,u.current=t,I.current=h,x(a),n.attach(a,m,h,R?Oe(R):1),N(t,E.current);const f=Ee(t,e?.bearing??t.getBearing(),()=>E.current.pitch??0);M.current=f,c.maplibreStore.setCameraPort(f),F({immediate:!0}),C.current?.();const p=()=>{const O=t.getBearing()-(e?.bearing??0);G(n,w(O))};t.on("rotate",p),t.on("rotateend",p),C.current=()=>{t.off("rotate",p),t.off("rotateend",p)},le(n);const D=n.ptScaleRegistry.invoke(n.scale||1);D.length&&n.update(...D),G(n,w(t.getBearing()-(e?.bearing??0))),c.layerStore.layersLoaded=!0,c.fp.onFpConfigured&&c.fp.onFpConfigured(),s.sceneDefReady=!0,h()},[n,F,R,e]);B(()=>{E.current=S,N(u.current,S,!0)},[S]),Se(y,n),de(y,u),he(y,n),Re(y,u,e),be(n,u,e),pe(u,e,i),ue({enabled:c.layerStore.layersLoaded&&s.buildRoute,rendererService:n});const W=re.busRoutes??!1;fe({permission:c.layerStore.layersLoaded&&W,rendererService:n,dataJsonUrl:`https://${U}/v1/routes?expo=${v.EXPO}`,websocketUrl:`wss://${U}/locations?expo=${v.EXPO}`});const Z=$(a=>{console.warn("Maplibre map failed to load; falling back to floorplan mode.",a),c.maplibreStore.deactivateMaplibre()},[]);if(!e||!b||!R||!i)return null;const H=`${b.center.join(",")}:${b.bearing}:${b.zoom}`;return Q(me,{sceneDef:i,geoConfig:b,staticTransform:R,tileSource:X,mapOptions:S,onRendererReady:K,onMapDimLayerReady:J,onMapLoadError:Z},H)});export default xe;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Box as
|
|
1
|
+
import{Box as T}from"@expofp/geometry";import{svgArea as f,svgAreaExplicit as v}from"../../data/svg";import m,{uiState as s}from"../../store";import{convertLocalToGps as h}from"../../utils/gps";import{useReaction as u}from"../../utils/mobx";import{expandRectByPercent as P,getVenueFitMarginPercent as b,resolveVenueFitRect as x}from"../../utils/scene-bounds";import{fitMapToLocalRect as d,getVisibleRectFitPadding as M,isLngLatInVisibleViewport as O}from"./utils/geo-config";const a=s,g=15,R=24;function S(e){return P(e,b(e,f))}function L(e,r){return Math.min(Math.max(r,e.getMinZoom()),e.getMaxZoom())}function B(e,r,l){if(l.length!==1)return!1;const n=l[0]?.id,t=m.poiMarkerStore.markers.find(c=>c.boothId===n);if(!t)return!1;const o=h(t.center.x,t.center.y,r.gpsConfig),i=M(R);return O(e,o,i)||e.easeTo({center:o,zoom:L(e,g),bearing:r.bearing,duration:500,essential:!0}),!0}export function useCameraReactions(e,r,l){u(()=>a.moveToBooths,n=>{const t=e.current;if(!n||!t||!r)return;const o=n.filter(c=>c.rect);if(o.length===0)return;if(B(t,r,o)){a.moveToBooths=null;return}const i=T.fromUnion(...o.map(c=>c.rect));d(t,S(i),r),a.moveToBooths=null}),u(()=>a.moveToRect,n=>{const t=e.current;!n||!t||!r||(d(t,n,r,{paddingPercent:a.moveToRectPaddingPercent}),a.moveToRect=null,a.moveToRectPaddingPercent=null)}),u(()=>a.zoomBy,n=>{const t=e.current;!n||!t||(t.flyTo({zoom:t.getZoom()+(n>1?.5:-.5),animate:!0,duration:500}),a.zoomBy=null)}),u(()=>s.moveToLocation,n=>{const t=e.current,o=m.routeStore.currentPosition;if(!n||!t||!o)return;const{lng:i,lat:c}=o,y=typeof i=="number"&&Number.isFinite(i)&&typeof c=="number"&&Number.isFinite(c);let p;if(y)p=[i,c];else{if(!r)return;p=h(o.x,o.y,r.gpsConfig)}t.flyTo({center:p,animate:!0,duration:1e3}),t.once("moveend",()=>{s.moveToLocation=!1})}),u(()=>s.centerMap,n=>{const t=e.current;if(!n||!t||!r)return;if(!(s.list.type==="search"&&!s.list.text)){const{rect:i}=x({layerViewbox:m.layerStore.viewboxRectangle,explicitArea:v?f:null,layerRectangle:m.layerStore.rectangle,sceneDef:l,svgArea:f});d(t,i,r)}s.centerMap=!1})}
|
|
@@ -13,13 +13,45 @@ export interface CameraPaddingOptions {
|
|
|
13
13
|
}
|
|
14
14
|
export interface FitMapOptions {
|
|
15
15
|
duration?: number;
|
|
16
|
+
/** Breathing room around the rect, in CSS pixels per side. */
|
|
16
17
|
padding?: number;
|
|
18
|
+
/**
|
|
19
|
+
* Breathing room as a fraction of the canvas per side, overriding `padding`
|
|
20
|
+
* when set — the form Fit-to-screen speaks, so the legacy renderer and the map
|
|
21
|
+
* pad a venue fit by the same proportion rather than by the same pixel count.
|
|
22
|
+
*/
|
|
23
|
+
paddingPercent?: number | null;
|
|
17
24
|
}
|
|
18
25
|
export declare const MAP_BOUNDS_PADDING_FACTOR = 3;
|
|
19
26
|
export declare const MAP_BOUNDS_MIN_PADDING_DEGREES = 0.02;
|
|
20
27
|
export declare const INITIAL_FIT_ZOOM_ADJUSTMENT = 0.15;
|
|
21
28
|
export declare function deriveVenueMapBounds(config: TransformGeoConfig): LngLatBoundsLike | undefined;
|
|
22
29
|
export declare function getLocalRectGeoBounds(rect: Box, config: TransformGeoConfig): LngLatBoundsLike;
|
|
30
|
+
/** Viewport a camera has to frame a rect inside, in CSS pixels. */
|
|
31
|
+
export interface ViewportPx {
|
|
32
|
+
width: number;
|
|
33
|
+
height: number;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The camera that frames a plan-local rect exactly, with the map rotated to the
|
|
37
|
+
* plan's bearing.
|
|
38
|
+
*
|
|
39
|
+
* Deliberately *not* `map.cameraForBounds`. A `LngLatBounds` is north-aligned,
|
|
40
|
+
* so a rect on a rotated plan can only reach MapLibre as its geographic AABB —
|
|
41
|
+
* and `cameraForBounds` then fits the AABB's north-west→south-east *diagonal*
|
|
42
|
+
* re-rotated into the bearing-aligned frame, a box with no relation to the rect
|
|
43
|
+
* once the bearing is not a multiple of 90°. At a -48.8° bearing a 1159x814
|
|
44
|
+
* plan rect reaches the fit as roughly 45x597, so the vertical constraint wins
|
|
45
|
+
* and the camera lands ~1.27 zoom levels (2.4x) too far out. Rotating the
|
|
46
|
+
* rect's own four corners before measuring is the whole fix.
|
|
47
|
+
*
|
|
48
|
+
* Returns null when the rect, the projection or the viewport can't produce a
|
|
49
|
+
* camera; callers keep their current framing in that case.
|
|
50
|
+
*/
|
|
51
|
+
export declare function cameraForLocalRect(rect: Box, config: TransformGeoConfig, bearing: number, viewport: ViewportPx, padding: CameraPaddingOptions): {
|
|
52
|
+
center: [number, number];
|
|
53
|
+
zoom: number;
|
|
54
|
+
} | null;
|
|
23
55
|
export declare function getVisibleRectFitPadding(extraPadding?: number): CameraPaddingOptions;
|
|
24
56
|
/** Whether a lng/lat projects inside the visible viewport, inset by `padding`. */
|
|
25
57
|
export declare function isLngLatInVisibleViewport(map: MaplibreMap, lngLat: [number, number], padding: CameraPaddingOptions): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{LngLatBounds as
|
|
1
|
+
import{LngLatBounds as D,MercatorCoordinate as E}from"maplibre-gl";import{fpGeo as I}from"../../../data/fpGeo";import{svgArea as x}from"../../../data/svg";import{uiState as z}from"../../../store";import{convertLocalToGps as u}from"../../../utils/gps";import{planBearing as N}from"../../../utils/planBearing";export const MAP_BOUNDS_PADDING_FACTOR=3,MAP_BOUNDS_MIN_PADDING_DEGREES=.02,INITIAL_FIT_ZOOM_ADJUSTMENT=.15;const T=1.42,F=.35,S=.9,A=.85,P=8,B=.05;export function deriveVenueMapBounds(t){const n=[[x.min.x,x.min.y],[x.max.x,x.min.y],[x.max.x,x.max.y],[x.min.x,x.max.y]].map(([c,l])=>u(c,l,t));if(!n.every(([c,l])=>Number.isFinite(c)&&Number.isFinite(l)))return;const e=n.map(([c])=>c),o=n.map(([,c])=>c),i=Math.min(...e),r=Math.max(...e),s=Math.min(...o),a=Math.max(...o),m=Math.max((r-i)*MAP_BOUNDS_PADDING_FACTOR,MAP_BOUNDS_MIN_PADDING_DEGREES),h=Math.max((a-s)*MAP_BOUNDS_PADDING_FACTOR,MAP_BOUNDS_MIN_PADDING_DEGREES);return[[i-m,s-h],[r+m,a+h]]}function O(t,n,e,o){const i=Math.min(t.getZoom(),n),r=(e-i)*Math.min(1,o/T);return i+r>=t.getMinZoom()-B}function w(t,n,e){if(O(t,n,e,T))return T;if(!O(t,n,e,F))return null;let o=F,i=T;for(let r=0;r<P;r++){const s=(o+i)/2;O(t,n,e,s)?o=s:i=s}return o}export function getLocalRectGeoBounds(t,n){const e=[u(t.min.x,t.min.y,n),u(t.max.x,t.min.y,n),u(t.max.x,t.max.y,n),u(t.min.x,t.max.y,n)],o=e.map(([r])=>r),i=e.map(([,r])=>r);return[[Math.min(...o),Math.min(...i)],[Math.max(...o),Math.max(...i)]]}const R=512;export function cameraForLocalRect(t,n,e,o,i){const r=[u(t.min.x,t.min.y,n),u(t.max.x,t.min.y,n),u(t.max.x,t.max.y,n),u(t.min.x,t.max.y,n)].map(([M,p])=>E.fromLngLat({lng:M,lat:p}));if(!r.every(({x:M,y:p})=>Number.isFinite(M)&&Number.isFinite(p)))return null;const s=-e*Math.PI/180,a=Math.cos(s),m=Math.sin(s),h=r.map(({x:M,y:p})=>M*a-p*m),c=r.map(({x:M,y:p})=>M*m+p*a),l=Math.max(...h)-Math.min(...h),y=Math.max(...c)-Math.min(...c);if(l<=0||y<=0)return null;const b=o.width-i.left-i.right,f=o.height-i.top-i.bottom;if(b<=0||f<=0)return null;const d=Math.min(b/(l*R),f/(y*R));if(!(d>0))return null;const g=R*d,L=(Math.min(...h)+Math.max(...h))/2-(i.left-i.right)/2/g,_=(Math.min(...c)+Math.max(...c))/2-(i.top-i.bottom)/2/g,{lng:v,lat:C}=new E(L*a+_*m,-L*m+_*a).toLngLat();return{center:[v,C],zoom:Math.log2(d)}}function U(t,n){return{top:t.top+n.top,bottom:t.bottom+n.bottom,left:t.left+n.left,right:t.right+n.right}}export function getVisibleRectFitPadding(t=0){const n=z.canvasVisibleRectPx,e=z.screenSize;return!n||!e?{top:t,bottom:t,left:t,right:t}:{top:Math.max(0,n.min.y)+t,bottom:Math.max(0,e.height-n.max.y)+t,left:Math.max(0,n.min.x)+t,right:Math.max(0,e.width-n.max.x)+t}}export function isLngLatInVisibleViewport(t,n,e){const o=t.project(n),i=t.getCanvas();return o.x>=e.left&&o.x<=i.clientWidth-e.right&&o.y>=e.top&&o.y<=i.clientHeight-e.bottom}export function deriveGeoConfig(){if(!I?.properties?.config)return null;const t=I.properties.config,n=(t.p0.lng+t.p2.lng)/2,e=(t.p0.lat+t.p2.lat)/2,o=N(t.p0,t.p2),i=Number.isFinite(o)?o:t.bearing??0;return{center:[n,e],bearing:i,zoom:16,gpsConfig:t}}export function fitMapToLocalRect(t,n,e,o={}){if(!t||!n||!e||n.size.height===1/0||n.size.width===1/0||n.size.height<=0||n.size.width<=0)return;const i=getLocalRectGeoBounds(n,e.gpsConfig),r=t.getCanvas(),s=o.paddingPercent==null?getVisibleRectFitPadding(o.padding??50):U(getVisibleRectFitPadding(0),{top:r.clientHeight*o.paddingPercent,bottom:r.clientHeight*o.paddingPercent,left:r.clientWidth*o.paddingPercent,right:r.clientWidth*o.paddingPercent}),a=cameraForLocalRect(n,e.gpsConfig,e.bearing,{width:r.clientWidth,height:r.clientHeight},s);if(!a){t.fitBounds(i,{padding:s,bearing:e.bearing,essential:!0});return}const m=t.project(t.getCenter()),h=t.project(a.center),c=Math.max(t.getCanvas().clientWidth,t.getCanvas().clientHeight,1),l=Math.hypot(h.x-m.x,h.y-m.y)/c,y=Math.abs(t.getZoom()-a.zoom),b=o.duration??Math.min(2800,500+l*450+y*150),f={center:a.center,zoom:a.zoom,bearing:e.bearing,duration:b,essential:!0};if(l<=1.2&&y<=1.5){t.easeTo(f);return}const d=t.getBounds().extend(D.convert(i)),g=t.cameraForBounds(d,{padding:s,bearing:e.bearing});if(!g?.center||typeof g.zoom!="number"||g.zoom>=t.getZoom()-.2){t.easeTo(f);return}const L=w(t,a.zoom,g.zoom);if(L!==null){const _=Math.max(F,L*S),v=Math.round(b*A);t.flyTo({...f,curve:_,duration:v});return}t.easeTo(f)}
|
|
@@ -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 q from"./data";import{fpGeo as b}from"./data/fpGeo";import N from"./floorplan.loader";import{shouldLoadIntercom as O}from"./intercom";import{BoundsSchema as U,POISelectorsSchema as w,ZoomToOptionsSchema as P}from"./schemas/sdk.schemas";import{applyDeclarativeConfig as H,applyParameters as Y,applyPathway as _,initUrlRouting as D}from"./services/url-dispatch";import{destroyUrlSync as W}from"./services/url-sync";import r from"./store";import{destroyUiHandlers as X}from"./store/init/init-ui";import{findBooth as S,Route as v,separateExternalIds as B}from"./store/RouteStore";import{destroyGtag as K,GaEventActions as k,sendEventToGa as F,setConsentSettings as Q}from"./tools/gtag";import Z from"./tools/report-error";import{resetGlobalVariables as J}from"./tools/reset";import ee from"./tools/track-event";import{cameraToMapSettings as te,mapSettingsToCamera as re}from"./utils/camera-map-settings";import{getStorage as C}from"./utils/entity-storage";import{convertLocalToGps as oe,isValidPointCoords as y}from"./utils/gps";import{getLocales as ie,hasLocale as se,setLocale as ne}from"./utils/i18n";import{mapEntity as g}from"./utils/mapEntity";const p=$("efp:api");j();export default class ae extends N{init(){H(),this.ignoreQuery||D(this.offHistory),ee("load"),r.fp=this,Q(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=O(q);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(i=>typeof e=="string"?i.name===e||i.externalId===e:e.includes(i.name)||e.includes(i.externalId));if(!t?.length)return;if(typeof e=="string"){r.selectExhibitor(t[0]),r.moveToList([t[0]]);return}const o=t.flatMap(i=>i.booths.map(s=>s.layer)),{description:n}=o.reduce((i,s)=>(i.freq[s.description]=(i.freq[s.description]||0)+1,i.freq[s.description]>i.maxCount&&(i.maxCount=i.freq[s.description],i.mostFrequent=s),i),{freq:{},mostFrequent:o[0],maxCount:0}).mostFrequent;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(i=>i.externalId).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}=B(e);r.boothStore.highlightedByExternalIds=[...t],r.exhibitorStore.highlightedByExternalIds=[...o]}selectRoute(e,t){if(Array.isArray(e)){let o=[...e];const n=o.shift(),i=o.pop();if(o.length>d)throw new Error(`The maximum number of waypoints is ${d}.`);if(!n||!i){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 v(m(n),m(i),o.map(m)));return}e||a("selectRoute","At a minimum, the starting point must be passed.","EFP000402"),r.routeStore.selectRoute(new v(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 i=n.layer?.name??"",s=o.get(i);s?s.push(n):o.set(i,[n])}return Array.from(o.values()).map(n=>({waypoints:M(n.map(i=>[i.name,{x:i.rect.center.x,y:i.rect.center.y}]))}))}selectCurrentPosition(e,t,o){const n=y(e.x)&&y(e.y),i=y(e.lng)&&y(e.lat);!n&&!i&&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(s=>!s.type||!t.includes(s.type));if(o){a("setEntitiesBookmarks",`Invalid entity type: ${o.type}. Must be one of: ${t.join(", ")}.`,"EFP000702");return}const n=C("bookmarked"),i={exhibitor:{existingIds:new Set(n.exhibitors||[]),finder:s=>r.exhibitorStore.findExhibitor(s),replacer:s=>r.exhibitorStore.replaceBookmarked(s)},event:{existingIds:new Set(n.events||[]),finder:s=>r.eventStore.findByNameOrSlug(s),replacer:s=>r.eventStore.replaceBookmarked(s)},speaker:{existingIds:new Set(n.speakers||[]),finder:s=>r.speakerStore.speakers.find(h=>h.name===s||h.externalId===s||h.slug===s),replacer:s=>r.speakerStore.replaceBookmarked(s)},booth:{existingIds:new Set(n.booths||[]),finder:s=>{const h=r.boothStore.findBooth(s);return h?.exhibitors.length===0?h:void 0},replacer:s=>r.boothStore.replaceBookmarked(s)}};e.forEach(s=>{const h=i[s.type],c=s.name||s.externalId||"",l=h.finder(c);l?s.bookmarked?h.existingIds.add(l.id):h.existingIds.delete(l.id):console.warn(`Entity not found: ${s.type} with query "${c}"`)}),Object.values(i).forEach(s=>{s.replacer(Array.from(s.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(s=>!s.type||!t.includes(s.type));if(o){a("setEntitiesVisited",`Invalid entity type: ${o.type}. Must be one of: ${t.join(", ")}.`,"EFP000704");return}const n=C("visited"),i={exhibitor:{existingIds:new Set(n.exhibitors||[]),finder:s=>r.exhibitorStore.findExhibitor(s),replacer:s=>r.exhibitorStore.replaceVisited(s)},event:{existingIds:new Set(n.events||[]),finder:s=>r.eventStore.findByNameOrSlug(s),replacer:s=>r.eventStore.replaceVisited(s)}};e.forEach(s=>{const h=i[s.type],c=s.name||s.externalId||"",l=h.finder(c);l?s.visited?h.existingIds.add(l.id):h.existingIds.delete(l.id):console.warn(`Entity not found: ${s.type} with query "${c}"`)}),Object.values(i).forEach(s=>{s.replacer(Array.from(s.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:i})=>n?.toLowerCase()===t||i?.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(l=>l.slug?.toLowerCase()===o||l.externalId?.toLowerCase()===o||l.externalId?.toLowerCase()?.replace(/\s+/g,"")===o);if(n){setTimeout(()=>r.selectBooth(n),250);return}const i=r.eventStore.eventItems.find(l=>l.slug?.toLowerCase()===o||l.externalId?.toLowerCase()===o);if(i){r.selectEventItem(i,!0);return}const s=r.exhibitorStore.exhibitors.find(l=>l.slug?.toLowerCase()===o||l.externalId?.toLowerCase()===o);if(s){setTimeout(()=>r.clickExhibitor(s),250);return}const h=r.categoryStore.categories.find(l=>l.slug===t);if(h){r.selectCategory(h);return}const c=r.speakerStore.findBySlug(t);if(c){r.selectSpeaker(c,!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"),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(te(t.data))}getCamera(){return re(r.uiState.mapSettings)}zoomTo(e,t){p("zoomTo called with selectors=%O options=%O",e,t);const o=w.safeParse(e);if(!o.success){a("zoomTo",o.error.message,"EFP001600");return}const n=P.safeParse(t);if(!n.success){a("zoomTo",n.error.message,"EFP001601");return}const i=this.getBounds(e);i&&this.fitBounds(i,t)}getBounds(e){p("getBounds called with selectors=%O",e);const t=w.safeParse(e);if(!t.success){a("getBounds",t.error.message,"EFP001400");return}const o=[];if(e.booths?.forEach(i=>{let s;i.externalId?s=r.boothStore.boothByExternalId.get(i.externalId):i.name&&(s=r.boothStore.boothByName.get(i.name.toLowerCase())),s?.rect&&o.push(s.rect)}),e.exhibitors?.forEach(i=>{let s;i.externalId?s=r.exhibitorStore.exhibitorByExternalId.get(i.externalId):i.name&&(s=r.exhibitorStore.exhibitorByName.get(i.name.toLowerCase())),s?.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=P.safeParse(t);if(!n.success){a("fitBounds",n.error.message,"EFP001501");return}const i=E.fromMinMax({x:e.leftTop.x,y:e.leftTop.y},{x:e.rightBottom.x,y:e.rightBottom.y});r.uiState.moveToRect=t?.padding?i.expand(t.padding):i}getBoothRect(e){typeof e!="string"&&a("getBoothRect","A booth name must be passed.","EFP000F00");const t=S(e)?.rect;return t?u.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 oe(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}unstable_destroy(){let e=window.__efpElement.firstChild;J(),window.removeEventListener("__efpStyleLoad",this.efpStyleLoadHandler),window.removeEventListener("error",Z),r.maplibreStore.dispose(),W(),X(),K(),this.root.unmount(),e.remove()}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(i=>i.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?B(t):{boothExternalIds:[],exhibitorExternalIds:[]};_({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),i=o?.rect||o?.viewbox?o:n;if(i?.rect||i?.viewbox){const s=i.viewbox??i.rect;r.uiState.moveToRect=s.clone()}}hidePathways(){this.highlightBooths([]),r.layerStore.hidePathways(),r.uiState.setPathwayOnlyMode(!1)}showSearch(){r.selectSearch("")}changeLanguage(e){const t=e?.toLowerCase?.();if(!se(t)){a("changeLanguage",`Language "${e}" was not found. Available languages: ${ie().map(o=>o.id).join(",")}`,"EFP001300");return}ne(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 i="https://js-sdk.expofp.com/api/packages";if(t&&(i+=`#error-${t}`),console.error(`${o} ${n} ${i}`),r.fp.disableRuntimeAlerts)return;r.uiState.setGlobalErrorMessage({title:o,body:T(A,{children:[n," ",x("a",{href:i,target:"_blank",rel:"noreferrer",children:i})]})}),clearTimeout(L);const s=8e3;L=window.setTimeout(()=>{const h=async()=>{r.uiState.globalErrorMessages.length>0&&(r.uiState.popGlobalErrorMessage(),await new Promise(c=>setTimeout(c,s/2)),h())};h()},s)}class u{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 i=e;e=o,o=i}if(t>n){const i=t;t=n,n=i}this.x1=e,this.y1=t,this.x2=o,this.y2=n}static fromBox(e){return new u(e.min.x,e.min.y,e.max.x,e.max.y)}static fromCxcywh(e,t,o,n){return new u(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),i=Math.min(this.y2,e.y2);return o>=t&&i>=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),i=Math.min(this.y2,e.y2);return o>=t&&i>=n?new u(t,n,o,i):new u(0,0,0,0)}getRotated90(){return u.fromCxcywh(this.cx,this.cy,this.h,this.w)}normalize(e,t){return new u(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:u.fromCxcywh(this.cx,this.cy,this.w-e*2,this.h-t*2)}scale(e){return new u(this.x1*e,this.y1*e,this.x2*e,this.y2*e)}getArea(){return this.w*this.h}clone(){return new u(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{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 w,ZoomToOptionsSchema as P}from"./schemas/sdk.schemas";import{applyDeclarativeConfig as H,applyParameters as Y,applyPathway as _,initUrlRouting as D}from"./services/url-dispatch";import{destroyUrlSync as W}from"./services/url-sync";import r from"./store";import{destroyUiHandlers as X}from"./store/init/init-ui";import{findBooth as S,Route as v,separateExternalIds as B}from"./store/RouteStore";import{destroyGtag as K,GaEventActions as k,sendEventToGa as F,setConsentSettings as Q}from"./tools/gtag";import Z from"./tools/report-error";import{resetGlobalVariables as J}from"./tools/reset";import ee from"./tools/track-event";import{cameraToMapSettings as te,mapSettingsToCamera as re}from"./utils/camera-map-settings";import{getStorage as L}from"./utils/entity-storage";import{getMostFrequent as oe}from"./utils/getMostFrequent";import{convertLocalToGps as ie,isValidPointCoords as y}from"./utils/gps";import{getLocales as se,hasLocale as ne,setLocale as ae}from"./utils/i18n";import{mapEntity as g}from"./utils/mapEntity";const p=$("efp:api");j();export default class he extends q{init(){H(),this.ignoreQuery||D(this.offHistory),ee("load"),r.fp=this,Q(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=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=oe(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}=B(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 v(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 v(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=L("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=L("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"),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(te(t.data))}getCamera(){return re(r.uiState.mapSettings)}zoomTo(e,t){p("zoomTo called with selectors=%O options=%O",e,t);const o=w.safeParse(e);if(!o.success){a("zoomTo",o.error.message,"EFP001600");return}const n=P.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=w.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=P.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 ie(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}unstable_destroy(){let e=window.__efpElement.firstChild;J(),window.removeEventListener("__efpStyleLoad",this.efpStyleLoadHandler),window.removeEventListener("error",Z),r.maplibreStore.dispose(),W(),X(),K(),this.root.unmount(),e.remove()}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?B(t):{boothExternalIds:[],exhibitorExternalIds:[]};_({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(!ne(t)){a("changeLanguage",`Language "${e}" was not found. Available languages: ${se().map(o=>o.id).join(",")}`,"EFP001300");return}ae(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 C=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(C);const i=8e3;C=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}}
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
* is rewritten to the exhibitor's display name, keeping that text readable.
|
|
9
9
|
*
|
|
10
10
|
* Only slug-shaped parts count and only they are rewritten: a `key=value`
|
|
11
|
-
* part (config key, intent shortcut, one-shot — `=` travels as
|
|
12
|
-
* encoded form) is never a slug. A lone slug riding with such
|
|
13
|
-
* (`?slug&
|
|
11
|
+
* part (config key, intent shortcut, one-shot, retired key — `=` travels as
|
|
12
|
+
* `%3D` in the encoded form) is never a slug. A lone slug riding with such
|
|
13
|
+
* params (`?slug&consent=denied`) is NOT a multi-slug link — left alone, it
|
|
14
14
|
* flows through the parser's config-stripping to a clean single-slug select.
|
|
15
15
|
*
|
|
16
16
|
* Returns the rewritten search (delimiter normalized to `&`), or `null` when
|
|
@@ -10,15 +10,13 @@ export declare function initUrlRouting(offHistory: boolean): void;
|
|
|
10
10
|
/** The public `FloorPlan.applyParameters` — replay a legacy query at runtime. */
|
|
11
11
|
export declare function applyParameters(queryRaw?: string): void;
|
|
12
12
|
/**
|
|
13
|
-
* The
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* (which passes no tour).
|
|
13
|
+
* The body of `FloorPlan.showPathway`. Lives here from the days the retired
|
|
14
|
+
* `?pathway=` deep link shared it; the multi-point-tour header that link
|
|
15
|
+
* could also raise is `ToursStore.launchTour`'s job now.
|
|
17
16
|
*/
|
|
18
17
|
export declare function applyPathway(options: {
|
|
19
18
|
pathwayId: string;
|
|
20
19
|
boothIds: string[];
|
|
21
20
|
exhibitorIds: string[];
|
|
22
|
-
tourId?: string;
|
|
23
21
|
}): void;
|
|
24
22
|
//# sourceMappingURL=url-dispatch.d.ts.map
|