@expofp/floorplan 3.3.8 → 3.4.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/{CookieConsent-DhAS93Nm.js → CookieConsent-BgzFI0o5.js} +8 -8
- package/dist/browser/{Debug-DciNEVl6.js → Debug-DwwZ0jVT.js} +9 -9
- package/dist/browser/{Demo-Dh3K6IRU.js → Demo-Bhv7muKd.js} +9 -9
- package/dist/browser/{Free-BHUzZwj9.js → Free-EaDzP7U5.js} +11 -11
- package/dist/browser/{Gallery-C0nPxxJB.js → Gallery-BFio06PY.js} +10 -10
- package/dist/browser/{GpsLoader-De8VPIEW.js → GpsLoader-BhYirpWa.js} +35 -35
- package/dist/browser/{KioskStore-D1jnGTbv.js → KioskStore-DiTPaFb2.js} +5 -5
- package/dist/browser/MaplibreAdapter-BKj3sK8A.js +35131 -0
- package/dist/browser/{Modal-D8kuOldj.js → Modal-DVY124d5.js} +10 -10
- package/dist/browser/{PermissionNotice-v9vhrWnr.js → PermissionNotice-CrAxf_da.js} +7 -7
- package/dist/browser/{SetKioskMode-D2cDGv9V.js → SetKioskMode-Cj1IbMbn.js} +18 -18
- package/dist/browser/ShowKiosk-CqmJT8yJ.js +26 -0
- package/dist/browser/{TouchHand-hrkQyTE4.js → TouchHand-BdZWU_I1.js} +4 -4
- package/dist/browser/{ViewerMenuPanel-BVfEToAO.js → ViewerMenuPanel-DbVIwrJO.js} +17 -17
- package/dist/browser/{add-debug-secret-listener-CdWQ5IqR.js → add-debug-secret-listener-B8gxDWmn.js} +1 -1
- package/dist/browser/{boolean-editor-D24_ATfB.js → boolean-editor-CIT7g6C5.js} +10 -10
- package/dist/browser/{bootIntercom-DSRi4yws.js → bootIntercom-CcgHFRAw.js} +2 -2
- package/dist/browser/{box-BXDPYk7M.js → box-CydZk4HJ.js} +5 -5
- package/dist/browser/{browser-Dk-lVBqy.js → browser-DlMYMMvJ.js} +2 -2
- package/dist/browser/bundle.json +61 -64
- package/dist/browser/{classnames-DNY5NR54.js → classnames-DmdaKMoa.js} +2 -2
- package/dist/browser/{client-CWN096Nx.js → client-8ygU_jvu.js} +4 -4
- package/dist/browser/{components-D9o158HA.js → components-BgwIl1Lu.js} +2073 -3912
- package/dist/browser/createWayfinding-D9tuHHx5.js +1889 -0
- package/dist/browser/{debug-overlay-DQG-UfZv.js → debug-overlay-Dos3Ate2.js} +11 -11
- package/dist/browser/{debug-ui-yYN-_8G_.js → debug-ui-BjmKfkgV.js} +6 -6
- package/dist/browser/{dist-uPMox8hh.js → dist-B3Y58WKJ.js} +6 -6
- package/dist/browser/{dist-CAs4SFEJ.js → dist-Bm6VKnC2.js} +3 -3
- package/dist/browser/{dist-7_sOACbd.js → dist-_wJOZ0rm.js} +5 -5
- package/dist/browser/{efp-debug-init-Dwp-psKk.js → efp-debug-init-yyCWZRTx.js} +5 -4
- package/dist/browser/{enum-editor-PV_iv0tr.js → enum-editor-D8X_uabc.js} +11 -11
- package/dist/browser/{event-not-found-BjBg31r7.js → event-not-found-Bm_W5xxA.js} +1 -1
- package/dist/browser/{exports-lMrT2XbM.js → exports-DnHrfjiU.js} +1 -1
- package/dist/browser/{favicon-qwrv2N2K.js → favicon-Bnz633J6.js} +1 -1
- package/dist/browser/{fetch-retry.umd-D_06P7tx.js → fetch-retry.umd-BunUcQza.js} +2 -2
- package/dist/browser/{flex-DMyWG2k5.js → flex-DwDJlblp.js} +6 -6
- package/dist/browser/{flex.props-DJYmgUbO.js → flex.props-BAGkFvkN.js} +2 -2
- package/dist/browser/{floorplan.loader-CkEu28br.js → floorplan.loader-B3PUqtqn.js} +30 -31
- package/dist/browser/{floorplan.ready-CL42thhp.js → floorplan.ready-BAnq_GdS.js} +251 -251
- package/dist/browser/{fuse-BrJpK9Lv.js → fuse-Bhsd7fBU.js} +2 -2
- package/dist/browser/{i18n-ST-5I_Xd.js → i18n-C5BBGKZk.js} +5 -5
- package/dist/browser/index.js +13 -13
- package/dist/browser/{jsx-runtime-z-VgZsNI.js → jsx-runtime-Dk2--jeN.js} +2 -2
- package/dist/browser/{lib-resthkmx.js → lib-Brd2BCh_.js} +4 -4
- package/dist/browser/locales/ar.json +0 -1
- package/dist/browser/locales/de.json +0 -1
- package/dist/browser/locales/es.json +0 -1
- package/dist/browser/locales/fr.json +0 -1
- package/dist/browser/locales/he.json +0 -1
- package/dist/browser/locales/it.json +0 -1
- package/dist/browser/locales/kk.json +0 -1
- package/dist/browser/locales/ko.json +0 -1
- package/dist/browser/locales/mn.json +0 -1
- package/dist/browser/locales/nl.json +0 -1
- package/dist/browser/locales/pl.json +0 -1
- package/dist/browser/locales/pt.json +0 -1
- package/dist/browser/locales/ru.json +0 -1
- package/dist/browser/locales/sv.json +0 -1
- package/dist/browser/locales/th.json +0 -1
- package/dist/browser/locales/tr.json +0 -1
- package/dist/browser/locales/uk.json +0 -1
- package/dist/browser/locales/vi.json +0 -1
- package/dist/browser/locales/zh.json +0 -1
- package/dist/browser/{main-BOaUt8eX.js → main-pIcuVUIg.js} +1 -1
- package/dist/browser/{mobx-BGVJo_6r.js → mobx-BfCD0EQ-.js} +4 -4
- package/dist/browser/{particles.min-D3-LD_RC.js → particles.min-ChGMv-bm.js} +2 -2
- package/dist/browser/{prop-types-xS5Y65WT.js → prop-types-xdXFFTmm.js} +2 -2
- package/dist/browser/{react-CDDaD-I1.js → react-BbZc5Oeq.js} +2 -2
- package/dist/browser/{react-dom-B1aPQ40g.js → react-dom-BBDOhlbP.js} +3 -3
- package/dist/browser/{reset-all-settings-DHgz1Ud7.js → reset-all-settings-BQC7zljW.js} +7 -7
- package/dist/browser/{rolldown-runtime-Bb8iYlSJ.js → rolldown-runtime-DS4W77DU.js} +1 -1
- package/dist/browser/{settings-BD9hHBVE.js → settings-CK-qRFM8.js} +2 -2
- package/dist/browser/{settings-item-BMJ0aBEh.js → settings-item-CUnGC7xO.js} +6 -6
- package/dist/browser/{storage-B0mOBJql.js → storage-0QGL3b8S.js} +3 -3
- package/dist/browser/{store-Dyrv6nnP.js → store-Bm4aFC2V.js} +4453 -4897
- package/dist/browser/{string-editor-DoAiUhFX.js → string-editor-BNry84Oh.js} +8 -8
- package/dist/browser/{theme-7rduvM4D.js → theme-BIXywNMw.js} +8 -8
- package/dist/browser/{ui-CgRQk7e0.js → ui-AzubEvGd.js} +8 -8
- package/dist/browser/{useRenderTarget-rq9Hu7Z3.js → useRenderTarget-Bf7cQRFi.js} +4 -4
- package/dist/esm/_misc_to_move/manifest.d.ts +1 -0
- package/dist/esm/components/Controls.js +1 -1
- package/dist/esm/components/Exhibitor.js +1 -1
- package/dist/esm/components/Layout.js +1 -1
- package/dist/esm/components/LevelSelector.js +1 -1
- package/dist/esm/components/LogoOverlay.js +1 -1
- package/dist/esm/components/Map/Map.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-booth-bg.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-booth-border.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-booths.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-load-layer.js +1 -1
- package/dist/esm/components/Map/traffic/useManageTraffic.js +1 -1
- package/dist/esm/components/Maplibre/MaplibreAdapter.d.ts +14 -0
- package/dist/esm/components/Maplibre/MaplibreAdapter.js +1 -0
- package/dist/esm/components/Maplibre/MaplibreWrapper.d.ts +69 -0
- package/dist/esm/components/Maplibre/MaplibreWrapper.js +1 -0
- package/dist/esm/components/Maplibre/useCameraReactions.d.ts +10 -0
- package/dist/esm/components/Maplibre/useCameraReactions.js +1 -0
- package/dist/esm/components/Maplibre/useDimming.d.ts +16 -0
- package/dist/esm/components/Maplibre/useDimming.js +1 -0
- package/dist/esm/components/Maplibre/useLayerVisibilitySync.d.ts +11 -0
- package/dist/esm/components/Maplibre/useLayerVisibilitySync.js +1 -0
- package/dist/esm/components/Maplibre/useRendererEvents.d.ts +9 -0
- package/dist/esm/components/Maplibre/useRendererEvents.js +1 -0
- package/dist/esm/components/Maplibre/useWayfindingAndMarkers.d.ts +8 -0
- package/dist/esm/components/Maplibre/useWayfindingAndMarkers.js +1 -0
- package/dist/esm/components/Maplibre/utils/geo-config.d.ts +30 -0
- package/dist/esm/components/Maplibre/utils/geo-config.js +1 -0
- package/dist/esm/components/Maplibre/utils/layer-defs.d.ts +4 -0
- package/dist/esm/components/Maplibre/utils/layer-defs.js +1 -0
- package/dist/esm/components/Maplibre/utils/map-helpers.d.ts +9 -0
- package/dist/esm/components/Maplibre/utils/map-helpers.js +1 -0
- package/dist/esm/components/Maplibre/utils/solver.d.ts +24 -0
- package/dist/esm/components/Maplibre/utils/solver.js +1 -0
- package/dist/esm/data/Flags.d.ts +1 -0
- package/dist/esm/data/fpGeo.d.ts +20 -1
- package/dist/esm/floorplan.loader.d.ts +1 -0
- package/dist/esm/floorplan.loader.js +1 -1
- package/dist/esm/floorplan.ready.js +1 -1
- package/dist/esm/renderer/RendererService.d.ts +5 -0
- package/dist/esm/renderer/RendererService.js +1 -1
- package/dist/esm/services/routing.js +1 -1
- package/dist/esm/store/MaplibreStore.d.ts +22 -0
- package/dist/esm/store/MaplibreStore.js +1 -0
- package/dist/esm/store/RootStore.d.ts +2 -2
- package/dist/esm/store/RootStore.js +1 -1
- package/dist/esm/store/RouteStore.js +1 -1
- package/dist/esm/store/init/init-booths.js +1 -1
- package/dist/esm/types.d.ts +9 -0
- package/dist/esm/utils/dimming.d.ts +16 -0
- package/dist/esm/utils/dimming.js +1 -0
- package/dist/esm/wayfinding/core/position/gpsThreshold.d.ts +1 -1
- package/package.json +5 -9
- package/dist/browser/Mapbox-CzVyYzjj.js +0 -120
- package/dist/browser/ShowKiosk-DjrDUQUM.js +0 -26
- package/dist/browser/ThreeComponent-CUKVDY94.js +0 -1494
- package/dist/browser/data-ZH4_sxkL.js +0 -27967
- package/dist/browser/vendor/mapbox/mapbox-gl.css +0 -1
- package/dist/esm/components/Mapbox/Button.d.ts +0 -10
- package/dist/esm/components/Mapbox/Button.js +0 -1
- package/dist/esm/components/Mapbox/Dot.d.ts +0 -10
- package/dist/esm/components/Mapbox/Dot.js +0 -1
- package/dist/esm/components/Mapbox/MapLoader.d.ts +0 -4
- package/dist/esm/components/Mapbox/MapLoader.js +0 -1
- package/dist/esm/components/Mapbox/Mapbox.d.ts +0 -4
- package/dist/esm/components/Mapbox/Mapbox.js +0 -1
- package/dist/esm/components/Mapbox/utils/data.d.ts +0 -38
- package/dist/esm/components/Mapbox/utils/data.js +0 -1
- package/dist/esm/components/Threejs/ThreeComponent.d.ts +0 -7
- package/dist/esm/components/Threejs/ThreeComponent.js +0 -1
- package/dist/esm/components/Threejs/UIManager.d.ts +0 -28
- package/dist/esm/components/Threejs/UIManager.js +0 -1
- package/dist/esm/components/Threejs/common/BoothMesh.d.ts +0 -20
- package/dist/esm/components/Threejs/common/BoothMesh.js +0 -1
- package/dist/esm/components/Threejs/common/Scene.d.ts +0 -13
- package/dist/esm/components/Threejs/common/Scene.js +0 -1
- package/dist/esm/components/Threejs/common/SpriteMesh.d.ts +0 -5
- package/dist/esm/components/Threejs/common/SpriteMesh.js +0 -1
- package/dist/esm/components/Threejs/common/dataLoader.d.ts +0 -31
- package/dist/esm/components/Threejs/common/dataLoader.js +0 -1
- package/dist/esm/components/Threejs/common/modelLoader.d.ts +0 -3
- package/dist/esm/components/Threejs/common/modelLoader.js +0 -1
- package/dist/esm/components/Threejs/common/sceneLoader.d.ts +0 -7
- package/dist/esm/components/Threejs/common/sceneLoader.js +0 -1
- package/dist/esm/components/Threejs/index.d.ts +0 -4
- package/dist/esm/components/Threejs/index.js +0 -1
- package/dist/esm/components/Threejs/mapbox/configureWebGLForMapbox.d.ts +0 -2
- package/dist/esm/components/Threejs/mapbox/configureWebGLForMapbox.js +0 -1
- package/dist/esm/components/Threejs/mapbox/index_mapbox.d.ts +0 -4
- package/dist/esm/components/Threejs/mapbox/index_mapbox.js +0 -1
- package/dist/esm/components/Threejs/mapbox/init-mapbox.d.ts +0 -3
- package/dist/esm/components/Threejs/mapbox/init-mapbox.js +0 -1
- package/dist/esm/components/Threejs/utils/canvasFromText.d.ts +0 -2
- package/dist/esm/components/Threejs/utils/canvasFromText.js +0 -1
- package/dist/esm/components/Threejs/utils/textureMerger.d.ts +0 -60
- package/dist/esm/components/Threejs/utils/textureMerger.js +0 -1
- package/dist/esm/store/MapboxStore.d.ts +0 -13
- package/dist/esm/store/MapboxStore.js +0 -1
|
@@ -0,0 +1,1889 @@
|
|
|
1
|
+
(function() {
|
|
2
|
+
try {
|
|
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.0" };
|
|
5
|
+
var t = new e.Error().stack;
|
|
6
|
+
t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "ba4f96b8-3148-4e29-a176-c40ac3068001", e._sentryDebugIdIdentifier = "sentry-dbid-ba4f96b8-3148-4e29-a176-c40ac3068001");
|
|
7
|
+
} catch {}
|
|
8
|
+
})();
|
|
9
|
+
import { r as e } from "./rolldown-runtime-DS4W77DU.js";
|
|
10
|
+
import { t } from "./react-BbZc5Oeq.js";
|
|
11
|
+
import { g as n, k as r, ot as i } from "./i18n-C5BBGKZk.js";
|
|
12
|
+
import { c as a } from "./storage-0QGL3b8S.js";
|
|
13
|
+
import { $t as o, At as s, B as c, Bt as l, Ct as u, Dt as d, F as f, Ft as p, G as m, H as h, I as g, J as _, Jt as v, K as y, L as b, Nt as x, Ot as S, Pt as C, Q as w, R as T, St as E, Tt as D, V as O, W as k, X as A, Y as j, Zt as M, _t as ee, c as te, dt as ne, en as re, i as N, jt as P, kt as ie, lt as ae, mt as oe, nn as se, o as F, q as ce, rt as I, s as L, t as R, tn as z, vt as le, wt as B, yt as ue, z as de, zt as V } from "./store-Bm4aFC2V.js";
|
|
14
|
+
//#region src/wayfinding/layers.ts
|
|
15
|
+
var fe = "wf-points", pe = "wf-trail-points", me = "wf-lines", he = "wf-lines-animated", ge = "_selected", _e = "markers";
|
|
16
|
+
function ve(e) {
|
|
17
|
+
let t = [], r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = [], o = e.scene.rootLayer.children.find((e) => e.name === _e);
|
|
18
|
+
async function s(e) {
|
|
19
|
+
let t = [];
|
|
20
|
+
e.forEach((e) => {
|
|
21
|
+
let { name: n, content: i, width: a, height: o, scale: s } = e;
|
|
22
|
+
if (r.has(n)) return;
|
|
23
|
+
let c = new Image(), l = new Promise((e, t) => {
|
|
24
|
+
c.onload = () => {
|
|
25
|
+
r.set(n, {
|
|
26
|
+
img: c,
|
|
27
|
+
width: a,
|
|
28
|
+
height: o,
|
|
29
|
+
scale: s
|
|
30
|
+
}), e();
|
|
31
|
+
}, c.onerror = (e) => {
|
|
32
|
+
t(e);
|
|
33
|
+
};
|
|
34
|
+
});
|
|
35
|
+
t.push(l), c.src = i, c.crossOrigin = "anonymous";
|
|
36
|
+
}), await Promise.all(t);
|
|
37
|
+
}
|
|
38
|
+
let c = (e) => `marker-ptScaleHandlers-${e.id}`, l = (e) => `marker-rollHandlers-${e.id}`, d = (t, n) => {
|
|
39
|
+
e.onPtScale(n, (e) => {
|
|
40
|
+
let { center: n, rotation: r } = t.bounds, { width: i, height: a } = t.source;
|
|
41
|
+
return t.bounds = C(n.x, n.y, i, a, e, r), t;
|
|
42
|
+
});
|
|
43
|
+
}, f = (t, n) => {
|
|
44
|
+
e.onRoll(n, (e) => (t.bounds.rotation = e, t));
|
|
45
|
+
};
|
|
46
|
+
function p() {
|
|
47
|
+
let t = F.routeStore.markersData.markers;
|
|
48
|
+
if (!t.length) return;
|
|
49
|
+
a = [];
|
|
50
|
+
let n = e.scale, s = ee(e.angle);
|
|
51
|
+
t.forEach((e) => {
|
|
52
|
+
var t, o;
|
|
53
|
+
let c = r.get(e.icon);
|
|
54
|
+
if (!c) return;
|
|
55
|
+
let l = c.scale || window.devicePixelRatio, d = e.icon;
|
|
56
|
+
if (!i.has(d)) {
|
|
57
|
+
let e = V(c.img, c.width, c.height, l);
|
|
58
|
+
i.set(d, e);
|
|
59
|
+
}
|
|
60
|
+
let f = i.get(d), p = r.get(e.selectedIcon), m = e.selectedIcon;
|
|
61
|
+
if (!i.has(m)) {
|
|
62
|
+
let e = V(p.img, p.width, p.height, l);
|
|
63
|
+
i.set(m, e);
|
|
64
|
+
}
|
|
65
|
+
let h = i.get(m), g = (t = (o = N.findLayer(e.z)) == null ? void 0 : o.visible) == null ? !0 : t, _ = C(e.x, e.y, f.width, f.height, n, s), v = C(e.x, e.y, h.width, h.height, n, s), y;
|
|
66
|
+
switch (e.position) {
|
|
67
|
+
case "lefttop":
|
|
68
|
+
y = [0, 0];
|
|
69
|
+
break;
|
|
70
|
+
case "centertop":
|
|
71
|
+
y = [.5, 0];
|
|
72
|
+
break;
|
|
73
|
+
case "centerbottom":
|
|
74
|
+
y = [.5, 1];
|
|
75
|
+
break;
|
|
76
|
+
default: y = [.5, .5];
|
|
77
|
+
}
|
|
78
|
+
let b = {
|
|
79
|
+
...u(f, _, {
|
|
80
|
+
hidden: !g,
|
|
81
|
+
origin: y
|
|
82
|
+
}),
|
|
83
|
+
id: e.id,
|
|
84
|
+
scale: l
|
|
85
|
+
}, x = {
|
|
86
|
+
...u(h, v, {
|
|
87
|
+
hidden: !(g && e.active),
|
|
88
|
+
origin: y
|
|
89
|
+
}),
|
|
90
|
+
id: `${e.id}${ge}`,
|
|
91
|
+
scale: l
|
|
92
|
+
};
|
|
93
|
+
a.push(b, x);
|
|
94
|
+
}), o.children = a, a.forEach((e) => {
|
|
95
|
+
d(e, c(e)), f(e, l(e));
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
function m() {
|
|
99
|
+
a.forEach((t) => {
|
|
100
|
+
e.ptScaleRegistry.unregisterByName(c(t)), e.rollRegistry.unregisterByName(l(t));
|
|
101
|
+
}), o.children = [], a = [];
|
|
102
|
+
}
|
|
103
|
+
function h() {
|
|
104
|
+
let e = F.routeStore.markersData.markers;
|
|
105
|
+
e.length && e.forEach((e) => {
|
|
106
|
+
var t, n;
|
|
107
|
+
let r = a.find((t) => t.id === e.id), i = a.find((t) => t.id === `${e.id}${ge}`);
|
|
108
|
+
if (!r) return;
|
|
109
|
+
let o = (t = (n = N.findLayer(e.z)) == null ? void 0 : n.visible) == null ? !0 : t;
|
|
110
|
+
e.active ? (r.hidden = !0, i.hidden = !(o && e.active)) : (r.hidden = !o, i.hidden = !0);
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
return t.push(n(() => [F.routeStore.selectedMarkers, F.layerStore.visible], () => {
|
|
114
|
+
if (!F.routeStore.markersData.markers.length) {
|
|
115
|
+
m(), e.update(o);
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
h(), e.update(...a);
|
|
119
|
+
})), t.push(n(() => F.routeStore.markersData.markers, () => {
|
|
120
|
+
s(F.routeStore.markersData.icons).then(() => {
|
|
121
|
+
p(), e.update(o);
|
|
122
|
+
});
|
|
123
|
+
}, { fireImmediately: !0 })), function() {
|
|
124
|
+
t.forEach((e) => e()), t.length = 0;
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
function ye(e, t, n) {
|
|
128
|
+
for (let r of F.routeStore.markersData.markers) {
|
|
129
|
+
let i = F.routeStore.markersData.icons.find((e) => e.name === r.icon);
|
|
130
|
+
if (!i) continue;
|
|
131
|
+
let a = i.width * n * devicePixelRatio, o = i.height * n * devicePixelRatio;
|
|
132
|
+
if (be(e, t, r.x, r.y, a, o)) {
|
|
133
|
+
let e = F.layerStore.findLayer(r.z);
|
|
134
|
+
if (!e || e && e.visible) return r;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
function be(e, t, n, r, i, a) {
|
|
140
|
+
let o = e >= n - i && e <= n + i, s = t >= r - a && t <= r + a;
|
|
141
|
+
return o && s;
|
|
142
|
+
}
|
|
143
|
+
//#endregion
|
|
144
|
+
//#region src/components/Map/traffic/trafficLayers.ts
|
|
145
|
+
var xe = "traffic_route", Se = "traffic_route_stop", Ce = "traffic_vehicles", we = "build_route_lines", Te = "build_route_dots", Ee = 5;
|
|
146
|
+
function De() {
|
|
147
|
+
let e = [];
|
|
148
|
+
for (let t = 0; t < Ee; t++) e.push({
|
|
149
|
+
name: Oe(t),
|
|
150
|
+
children: []
|
|
151
|
+
}), e.push({
|
|
152
|
+
name: ke(t),
|
|
153
|
+
children: [],
|
|
154
|
+
interactive: !0
|
|
155
|
+
});
|
|
156
|
+
return e.push({
|
|
157
|
+
name: Ce,
|
|
158
|
+
children: [],
|
|
159
|
+
interactive: !0
|
|
160
|
+
}), e.push({
|
|
161
|
+
name: we,
|
|
162
|
+
children: []
|
|
163
|
+
}), e.push({
|
|
164
|
+
name: Te,
|
|
165
|
+
children: [],
|
|
166
|
+
interactive: !0
|
|
167
|
+
}), e;
|
|
168
|
+
}
|
|
169
|
+
function Oe(e) {
|
|
170
|
+
return `${xe}_${e + 1}`;
|
|
171
|
+
}
|
|
172
|
+
function ke(e) {
|
|
173
|
+
return `${Se}_${e + 1}`;
|
|
174
|
+
}
|
|
175
|
+
function Ae() {
|
|
176
|
+
return RegExp(`^${xe}_\\d+$`);
|
|
177
|
+
}
|
|
178
|
+
function je() {
|
|
179
|
+
return RegExp(`^${Se}_\\d+$`);
|
|
180
|
+
}
|
|
181
|
+
//#endregion
|
|
182
|
+
//#region src/utils/geometry.ts
|
|
183
|
+
var Me = /* @__PURE__ */ e(se(), 1);
|
|
184
|
+
function Ne(e, t, n) {
|
|
185
|
+
let [r, i] = n[0], [a, o] = n[1], [s, c] = n[2], l = (o - c) * (r - s) + (s - a) * (i - c);
|
|
186
|
+
if (l === 0) return !1;
|
|
187
|
+
let u = ((o - c) * (e - s) + (s - a) * (t - c)) / l, d = ((c - i) * (e - s) + (r - s) * (t - c)) / l, f = 1 - u - d;
|
|
188
|
+
return u >= 0 && u <= 1 && d >= 0 && d <= 1 && f >= 0 && f <= 1;
|
|
189
|
+
}
|
|
190
|
+
//#endregion
|
|
191
|
+
//#region src/components/Map/drawing/config/config-booth-badge.ts
|
|
192
|
+
var Pe = .5, Fe = .3, Ie = 15, Le = 24, Re = 30, ze = 12, Be = .8, Ve = document.createElement("canvas").getContext("2d");
|
|
193
|
+
function He(e) {
|
|
194
|
+
return e.length <= Ie ? e : e.slice(0, Ie - 1) + "…";
|
|
195
|
+
}
|
|
196
|
+
function Ue(e) {
|
|
197
|
+
var t, n;
|
|
198
|
+
if (!((t = e.paths) != null && t.length)) return [];
|
|
199
|
+
let r = ((n = e.layer) == null ? void 0 : n.name) || "", i = [];
|
|
200
|
+
for (let t of e.paths) for (let e of M(t.index, r)) i.push(e);
|
|
201
|
+
return i;
|
|
202
|
+
}
|
|
203
|
+
function We(e) {
|
|
204
|
+
let t = Ue(e);
|
|
205
|
+
if (!t.length) return null;
|
|
206
|
+
let n = Infinity, r = Infinity, i = -Infinity, a = -Infinity;
|
|
207
|
+
for (let e of t) for (let t of e) t[0] < n && (n = t[0]), t[1] < r && (r = t[1]), t[0] > i && (i = t[0]), t[1] > a && (a = t[1]);
|
|
208
|
+
return isFinite(n) ? {
|
|
209
|
+
x1: n,
|
|
210
|
+
y1: r,
|
|
211
|
+
w: i - n,
|
|
212
|
+
h: a - r
|
|
213
|
+
} : null;
|
|
214
|
+
}
|
|
215
|
+
function H(e, t, n) {
|
|
216
|
+
for (let r of n) if (Ne(e, t, r)) return !0;
|
|
217
|
+
return !1;
|
|
218
|
+
}
|
|
219
|
+
function Ge(e, t, n, r, i, a) {
|
|
220
|
+
if (!e.length || !H(t, n, e)) return a;
|
|
221
|
+
let o = 0, s = a;
|
|
222
|
+
for (let a = 0; a < 10; a++) {
|
|
223
|
+
let a = (o + s) / 2, c = r * a, l = i * a;
|
|
224
|
+
H(t + c, n, e) && H(t, n + l, e) && H(t + c, n + l, e) ? o = a : s = a;
|
|
225
|
+
}
|
|
226
|
+
return o;
|
|
227
|
+
}
|
|
228
|
+
function Ke(e) {
|
|
229
|
+
var t;
|
|
230
|
+
return (t = We(e)) == null ? e.rect : t;
|
|
231
|
+
}
|
|
232
|
+
function qe(e, t, n, r) {
|
|
233
|
+
let i = Ke(e);
|
|
234
|
+
if (t.length) {
|
|
235
|
+
let e = /* @__PURE__ */ new Set(), r = null, a = Infinity;
|
|
236
|
+
for (let o of t) for (let s of o) {
|
|
237
|
+
let o = `${s[0]},${s[1]}`;
|
|
238
|
+
if (e.has(o)) continue;
|
|
239
|
+
e.add(o);
|
|
240
|
+
let c = s[0] + n, l = s[1] + n;
|
|
241
|
+
if (H(c, l, t)) {
|
|
242
|
+
let e = c - i.x1 + (l - i.y1);
|
|
243
|
+
e < a && (a = e, r = {
|
|
244
|
+
x: c,
|
|
245
|
+
y: l
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
if (r) return r;
|
|
250
|
+
}
|
|
251
|
+
let a = e.rect.x1 + n, o = e.rect.y1 + n;
|
|
252
|
+
if (!r) return {
|
|
253
|
+
x: a,
|
|
254
|
+
y: o
|
|
255
|
+
};
|
|
256
|
+
let s = Math.cos(r), c = Math.sin(r), l = a - e.rect.cx, u = o - e.rect.cy;
|
|
257
|
+
return {
|
|
258
|
+
x: e.rect.cx + l * s - u * c,
|
|
259
|
+
y: e.rect.cy + l * c + u * s
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
function U(e) {
|
|
263
|
+
return e && e !== "none" ? e : void 0;
|
|
264
|
+
}
|
|
265
|
+
function Je(e) {
|
|
266
|
+
var t;
|
|
267
|
+
let n = U(e.borderColor) || U(re.boothBorderColor) || re.colors.booths.default;
|
|
268
|
+
return ((t = e.paths) == null ? void 0 : t.length) > 1 && U(e.paths[e.paths.length - 1].color) || n;
|
|
269
|
+
}
|
|
270
|
+
function Ye(e, t) {
|
|
271
|
+
let r = He(t.title || t.name), i = Je(t), a = te((0, Me.default)(i).hex()), o = window.devicePixelRatio || 1, s = le();
|
|
272
|
+
Ve.font = l(Re, s);
|
|
273
|
+
let c = Ve.measureText(r).width, u = Math.ceil(c + ze * 2), f = (t.borderWidth || R.borderWidth) / 2, m = u * Be, h = 54 * Be, g = t.rotate ? -t.rotate : 0, _ = t.rect.w, v = t.rect.h, y = Math.min(_ > 0 ? _ * Pe / m : Infinity, v > 0 ? v * Fe / h : Infinity), b = Ue(t), { x, y: C } = qe(t, b, f, g), w = Ge(b, x, C, m, h, y), T = Math.cos(g), E = Math.sin(g), D = (e, t) => {
|
|
274
|
+
let n = e / 2, r = t / 2, i = x + n * T - r * E, a = C + n * E + r * T;
|
|
275
|
+
return new p({
|
|
276
|
+
x: i - n,
|
|
277
|
+
y: a - r
|
|
278
|
+
}, {
|
|
279
|
+
x: i + n,
|
|
280
|
+
y: a + r
|
|
281
|
+
}, g);
|
|
282
|
+
}, O = (e) => {
|
|
283
|
+
let t = Math.min(e, w);
|
|
284
|
+
return D(m * t, h * t);
|
|
285
|
+
}, k = ue(s, e.fontUrls), A = d(D(1, 1), i);
|
|
286
|
+
A.hidden = !0, A.dim = t.skipDim ? !1 : void 0;
|
|
287
|
+
let j = S(ie([[r], []], a, 0, [k, k]), D(1, 1), [0, 0], {
|
|
288
|
+
horizontal: "center",
|
|
289
|
+
vertical: "center"
|
|
290
|
+
});
|
|
291
|
+
j.hidden = !0, j.dim = t.skipDim ? !1 : void 0;
|
|
292
|
+
let M = () => !!(t.layer && !t.layer.visible);
|
|
293
|
+
return n(() => t.skipDim, (t) => {
|
|
294
|
+
A.dim = t ? !1 : void 0, j.dim = t ? !1 : void 0, e.update(A, j);
|
|
295
|
+
}), n(() => {
|
|
296
|
+
var e, n;
|
|
297
|
+
return (e = (n = t.layer) == null ? void 0 : n.visible) == null ? !0 : e;
|
|
298
|
+
}, (t) => {
|
|
299
|
+
A.hidden = !t, j.hidden = !t, e.update(A, j);
|
|
300
|
+
}), e.onPtScale(`badge-bg-${t.id}`, (e) => (A.shape = O(e), A.hidden = M(), A)), e.onPtScale(`badge-text-${t.id}`, (e) => {
|
|
301
|
+
let t = Math.min(e, w);
|
|
302
|
+
return j.lines[0].fontSize = Le / o * t, j.bounds = O(e), j.hidden = M(), j;
|
|
303
|
+
}), {
|
|
304
|
+
bg: A,
|
|
305
|
+
text: j
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
function Xe(e, t, n) {
|
|
309
|
+
if (o.hideExhibitorBoothNumber) return null;
|
|
310
|
+
let r = [], i = [];
|
|
311
|
+
for (let t of n) if (t instanceof v && t.noLabels && !L.hideLogoInBooth && t.exhibitors.some((e) => e.logoInBooth && e.logo)) {
|
|
312
|
+
let { bg: n, text: a } = Ye(e, t);
|
|
313
|
+
r.push(n), i.push(a);
|
|
314
|
+
}
|
|
315
|
+
return r.length ? {
|
|
316
|
+
name: `${t}:badges`,
|
|
317
|
+
children: [{
|
|
318
|
+
name: `${t}:badgeBgs`,
|
|
319
|
+
children: r
|
|
320
|
+
}, {
|
|
321
|
+
name: `${t}:badgeTexts`,
|
|
322
|
+
children: i
|
|
323
|
+
}]
|
|
324
|
+
} : null;
|
|
325
|
+
}
|
|
326
|
+
//#endregion
|
|
327
|
+
//#region src/components/Map/drawing/config/config-all.ts
|
|
328
|
+
function Ze(e) {
|
|
329
|
+
let { layers: t, defaultLayer: n } = F.layerStore;
|
|
330
|
+
if (n) {
|
|
331
|
+
let e = [].concat(t), r = t.find((e) => e === n), i = t.indexOf(r);
|
|
332
|
+
e.splice(i, 1), t = [r].concat(e);
|
|
333
|
+
}
|
|
334
|
+
let r = t.filter((e) => !e.rootParent).map((t) => oe(t, e));
|
|
335
|
+
return Promise.all(r).then((t) => {
|
|
336
|
+
let n = B(fe, [], {
|
|
337
|
+
dim: !1,
|
|
338
|
+
interactive: !0
|
|
339
|
+
}), r = B(me, [], { dim: !1 }), i = B(_e, []), a = B(pe, [], { dim: !1 }), o = B(he, [], { dim: !1 }), s = [], c = [];
|
|
340
|
+
for (let e of t.flat()) ae(e.name) ? (e.dim = !1, c.push(e)) : s.push(e);
|
|
341
|
+
let l = Xe(e, "root", F.boothStore.booths);
|
|
342
|
+
return [
|
|
343
|
+
...s,
|
|
344
|
+
...l ? [l] : [],
|
|
345
|
+
...c,
|
|
346
|
+
...De(),
|
|
347
|
+
i,
|
|
348
|
+
a,
|
|
349
|
+
r,
|
|
350
|
+
o,
|
|
351
|
+
n
|
|
352
|
+
];
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
//#endregion
|
|
356
|
+
//#region src/components/Map/traffic/UpdateQueue.ts
|
|
357
|
+
var W = /* @__PURE__ */ e(t(), 1), Qe = class {
|
|
358
|
+
constructor() {
|
|
359
|
+
this.queue = [], this.isProcessing = !1, this.rafId = null, this.CHUNK_SIZE = 100, this.TIME_BUDGET = 4;
|
|
360
|
+
}
|
|
361
|
+
add(e) {
|
|
362
|
+
this.queue.push(e), this.scheduleProcessing();
|
|
363
|
+
}
|
|
364
|
+
scheduleProcessing() {
|
|
365
|
+
this.isProcessing || this.queue.length === 0 || (this.isProcessing = !0, this.queue.length <= this.CHUNK_SIZE * 2 ? Promise.resolve().then(() => this.processMicrotaskQueue()) : this.rafId = requestAnimationFrame((e) => {
|
|
366
|
+
this.processQueue(e);
|
|
367
|
+
}));
|
|
368
|
+
}
|
|
369
|
+
processMicrotaskQueue() {
|
|
370
|
+
let e = performance.now(), t = 0;
|
|
371
|
+
for (; this.queue.length > 0 && t < this.CHUNK_SIZE;) {
|
|
372
|
+
let n = this.queue.shift();
|
|
373
|
+
try {
|
|
374
|
+
n();
|
|
375
|
+
} catch (e) {
|
|
376
|
+
console.warn("UpdateQueue task error:", e);
|
|
377
|
+
}
|
|
378
|
+
if (t++, performance.now() - e > this.TIME_BUDGET) break;
|
|
379
|
+
}
|
|
380
|
+
this.queue.length > 0 ? Promise.resolve().then(() => this.processMicrotaskQueue()) : this.isProcessing = !1;
|
|
381
|
+
}
|
|
382
|
+
processQueue(e) {
|
|
383
|
+
this.rafId = null;
|
|
384
|
+
let t = 0;
|
|
385
|
+
for (; this.queue.length > 0 && t < this.CHUNK_SIZE;) {
|
|
386
|
+
let n = this.queue.shift();
|
|
387
|
+
try {
|
|
388
|
+
n();
|
|
389
|
+
} catch (e) {
|
|
390
|
+
console.warn("UpdateQueue task error:", e);
|
|
391
|
+
}
|
|
392
|
+
if (t++, performance.now() - e > this.TIME_BUDGET) break;
|
|
393
|
+
}
|
|
394
|
+
this.queue.length > 0 ? this.rafId = requestAnimationFrame((e) => this.processQueue(e)) : this.isProcessing = !1;
|
|
395
|
+
}
|
|
396
|
+
destroy() {
|
|
397
|
+
this.rafId !== null && (cancelAnimationFrame(this.rafId), this.rafId = null), this.queue = [], this.isProcessing = !1;
|
|
398
|
+
}
|
|
399
|
+
}, G = 49, $e = `hsl(257, 76%, ${G}%)`, et = `hsl(339.903, 82%, ${G}%)`, tt = `hsl(257, 76%, ${Math.round(G * 1.82)}%)`, K = 4, nt = K, rt = "U", it = "R", at = "S", ot = "P", st = class {
|
|
400
|
+
constructor() {
|
|
401
|
+
this._state = [[]], this.index = 0, this.pointHashSet = /* @__PURE__ */ new Set(), this.locked = !1, this.storageKey = "expofp_build_route_state", this._selected = 0;
|
|
402
|
+
}
|
|
403
|
+
get points() {
|
|
404
|
+
return this._state[this.index];
|
|
405
|
+
}
|
|
406
|
+
set points(e) {
|
|
407
|
+
this._state.push(e), this.setIndex(), this.save();
|
|
408
|
+
}
|
|
409
|
+
setIndex() {
|
|
410
|
+
this.index = Math.max(this._state.length - 1, 0);
|
|
411
|
+
}
|
|
412
|
+
genPointHash(e) {
|
|
413
|
+
return `${e.x},${e.y}`;
|
|
414
|
+
}
|
|
415
|
+
add(e) {
|
|
416
|
+
let t = this.genPointHash(e);
|
|
417
|
+
this.pointHashSet.has(t) || (this.pointHashSet.add(t), this.points = [...this.points, e]);
|
|
418
|
+
}
|
|
419
|
+
undo() {
|
|
420
|
+
this.index && (this._state.pop(), this.setIndex(), this.save(), this.select(this.points.length - 1));
|
|
421
|
+
}
|
|
422
|
+
execute(e) {
|
|
423
|
+
try {
|
|
424
|
+
if (this.locked) return;
|
|
425
|
+
this.locked = !0, e();
|
|
426
|
+
} finally {
|
|
427
|
+
requestAnimationFrame(() => {
|
|
428
|
+
this.locked = !1;
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
log(e, t = 12) {
|
|
433
|
+
console.log(`%c${e}`, `color: black; font-size: ${t}px; background: LemonChiffon;`);
|
|
434
|
+
}
|
|
435
|
+
instruct() {
|
|
436
|
+
this.log(`How to Build a Route:
|
|
437
|
+
Add Point: Click on the map.
|
|
438
|
+
Apply Smoothing: Press ${it}.
|
|
439
|
+
Apply Simplification: Press ${at}.
|
|
440
|
+
Undo: Press ${rt}.
|
|
441
|
+
Enable/Disable Preview: Press ${ot}.
|
|
442
|
+
`, 16);
|
|
443
|
+
}
|
|
444
|
+
applyChaikinSmoothing(e, t, n) {
|
|
445
|
+
let r = [];
|
|
446
|
+
if (n >= 1 && e.length >= 2) {
|
|
447
|
+
r = [e[0]];
|
|
448
|
+
for (let t = 1; t < e.length; t++) {
|
|
449
|
+
let i = e[t - 1], a = e[t];
|
|
450
|
+
for (let e = 1; e <= n; e++) {
|
|
451
|
+
let t = e / (n + 1);
|
|
452
|
+
r.push({
|
|
453
|
+
x: i.x + (a.x - i.x) * t,
|
|
454
|
+
y: i.y + (a.y - i.y) * t
|
|
455
|
+
});
|
|
456
|
+
}
|
|
457
|
+
r.push(a);
|
|
458
|
+
}
|
|
459
|
+
} else r = e.slice();
|
|
460
|
+
for (let e = 0; e < t && !(r.length < 2); e++) {
|
|
461
|
+
let e = [{ ...r[0] }];
|
|
462
|
+
for (let t = 1; t < r.length; t++) {
|
|
463
|
+
let n = r[t - 1], i = r[t];
|
|
464
|
+
e.push({
|
|
465
|
+
x: .75 * n.x + .25 * i.x,
|
|
466
|
+
y: .75 * n.y + .25 * i.y
|
|
467
|
+
}), e.push({
|
|
468
|
+
x: .25 * n.x + .75 * i.x,
|
|
469
|
+
y: .25 * n.y + .75 * i.y
|
|
470
|
+
});
|
|
471
|
+
}
|
|
472
|
+
e.push({ ...r[r.length - 1] }), r = e;
|
|
473
|
+
}
|
|
474
|
+
return r;
|
|
475
|
+
}
|
|
476
|
+
applySmoothing() {
|
|
477
|
+
this.points.length < 3 || (this.points = this.applyChaikinSmoothing(this.points, 1, 0), this.select(this.points.length - 1));
|
|
478
|
+
}
|
|
479
|
+
save() {
|
|
480
|
+
try {
|
|
481
|
+
this.points.length ? sessionStorage.setItem(this.storageKey, JSON.stringify(this.points)) : sessionStorage.removeItem(this.storageKey);
|
|
482
|
+
} catch (e) {
|
|
483
|
+
console.warn(e);
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
restore() {
|
|
487
|
+
try {
|
|
488
|
+
let e = sessionStorage.getItem(this.storageKey);
|
|
489
|
+
if (!e) return;
|
|
490
|
+
let t = JSON.parse(e);
|
|
491
|
+
if (!Array.isArray(t)) return;
|
|
492
|
+
t.forEach((e) => this.add(e)), this.select(this.points.length - 1);
|
|
493
|
+
} catch (e) {
|
|
494
|
+
console.warn(e);
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
topologyPreservingSimplify(e, t) {
|
|
498
|
+
if (e.length <= 2) return e.map((e) => ({ ...e }));
|
|
499
|
+
let n = (e, t, n) => {
|
|
500
|
+
let r = e.x, i = e.y, a = t.x, o = t.y, s = n.x, c = n.y;
|
|
501
|
+
return Math.abs((c - o) * r - (s - a) * i + s * o - c * a) / (Math.sqrt((c - o) ** 2 + (s - a) ** 2) || 1e-10);
|
|
502
|
+
}, r = (e, t, n, r) => {
|
|
503
|
+
let i = (e, t, n) => (n.y - e.y) * (t.x - e.x) - (t.y - e.y) * (n.x - e.x);
|
|
504
|
+
return i(e, n, r) * i(t, n, r) < 0 && i(n, e, t) * i(r, e, t) < 0;
|
|
505
|
+
}, i = Array(e.length).fill(!1);
|
|
506
|
+
i[0] = i[i.length - 1] = !0;
|
|
507
|
+
let a = [], o = (s, c) => {
|
|
508
|
+
if (c <= s + 1) return;
|
|
509
|
+
let l = e[s], u = e[c], d = 0, f = 0;
|
|
510
|
+
for (let t = s + 1; t < c; t++) {
|
|
511
|
+
let r = n(e[t], l, u);
|
|
512
|
+
r > d && (d = r, f = t);
|
|
513
|
+
}
|
|
514
|
+
if (d > t) {
|
|
515
|
+
let t = e[f], n = !0;
|
|
516
|
+
for (let e = 0; e < a.length - 1; e++) if (r(a[e], a[e + 1], l, t) || r(a[e], a[e + 1], t, u)) {
|
|
517
|
+
n = !1;
|
|
518
|
+
break;
|
|
519
|
+
}
|
|
520
|
+
n && (i[f] = !0, o(s, f), o(f, c));
|
|
521
|
+
}
|
|
522
|
+
};
|
|
523
|
+
return o(0, e.length - 1), e.filter((e, t) => i[t]);
|
|
524
|
+
}
|
|
525
|
+
applySimplification() {
|
|
526
|
+
this.points = this.topologyPreservingSimplify(this.points, .5), this.select(this.points.length - 1);
|
|
527
|
+
}
|
|
528
|
+
get selected() {
|
|
529
|
+
return this._selected;
|
|
530
|
+
}
|
|
531
|
+
select(e) {
|
|
532
|
+
this._selected = Math.max(0, Math.min(e, this.points.length - 1));
|
|
533
|
+
}
|
|
534
|
+
};
|
|
535
|
+
function ct({ enabled: e, rendererService: t }) {
|
|
536
|
+
let n = (0, W.useRef)(!1), r = (0, W.useRef)(), i = (0, W.useMemo)(() => x(K, $e), []), a = (0, W.useMemo)(() => x(K, et), []), o = (0, W.useMemo)(() => new st(), []), c = (0, W.useRef)(new Qe()), l = (0, W.useMemo)(() => {
|
|
537
|
+
if (!t.scene) return {};
|
|
538
|
+
let e = t.scene.rootLayer.children;
|
|
539
|
+
return {
|
|
540
|
+
linesLayer: e.find((e) => e.name === we),
|
|
541
|
+
pointsLayer: e.find((e) => e.name === Te)
|
|
542
|
+
};
|
|
543
|
+
}, [t.scene]), u = (0, W.useCallback)(() => {
|
|
544
|
+
if (!(t != null && t.renderer) || !l || !i || !a) return;
|
|
545
|
+
let { linesLayer: e, pointsLayer: s } = l;
|
|
546
|
+
if (!e || !s) return;
|
|
547
|
+
let u = o.points, d = n.current;
|
|
548
|
+
d ? s.children.length = 0 : s.children = u.map(({ x: e, y: t }, n) => {
|
|
549
|
+
let s = n == o.selected ? a : i;
|
|
550
|
+
return {
|
|
551
|
+
source: s,
|
|
552
|
+
bounds: C(e, t, s.width, s.height, r.current)
|
|
553
|
+
};
|
|
554
|
+
});
|
|
555
|
+
let f = [];
|
|
556
|
+
for (let e = 1; e < u.length; e++) {
|
|
557
|
+
let t = u[e - 1], n = u[e];
|
|
558
|
+
f.push({
|
|
559
|
+
points: [t, n],
|
|
560
|
+
color: d ? $e : tt,
|
|
561
|
+
width: nt
|
|
562
|
+
});
|
|
563
|
+
}
|
|
564
|
+
f.length ? e.children = f : e.children.length = 0, c.current.add(() => t.update(s, e)), o.instruct(), o.log(JSON.stringify(o.points));
|
|
565
|
+
}, [
|
|
566
|
+
t,
|
|
567
|
+
o,
|
|
568
|
+
l,
|
|
569
|
+
i,
|
|
570
|
+
a
|
|
571
|
+
]), d = (0, W.useCallback)((e) => {
|
|
572
|
+
let t = e.key.toUpperCase();
|
|
573
|
+
o.execute(() => {
|
|
574
|
+
switch (t) {
|
|
575
|
+
case rt:
|
|
576
|
+
e.preventDefault(), o.undo(), n.current = !1, u();
|
|
577
|
+
break;
|
|
578
|
+
case it:
|
|
579
|
+
e.preventDefault(), o.applySmoothing(), n.current = !1, u();
|
|
580
|
+
break;
|
|
581
|
+
case at:
|
|
582
|
+
e.preventDefault(), o.applySimplification(), n.current = !1, u();
|
|
583
|
+
break;
|
|
584
|
+
case ot:
|
|
585
|
+
e.preventDefault(), n.current = !n.current, u();
|
|
586
|
+
break;
|
|
587
|
+
}
|
|
588
|
+
});
|
|
589
|
+
}, [o, u]), f = (0, W.useCallback)(({ ptScale: e, sceneId: n }) => {
|
|
590
|
+
if (!s(n) || !(t != null && t.renderer) || !l) return;
|
|
591
|
+
let { pointsLayer: i } = l;
|
|
592
|
+
i && (r.current = e, o.execute(() => {
|
|
593
|
+
let e = i.children, n = [];
|
|
594
|
+
for (let t = 0; t < e.length; t++) {
|
|
595
|
+
let i = e[t];
|
|
596
|
+
i.bounds = C(i.bounds.center.x, i.bounds.center.y, i.source.width, i.source.height, r.current), n.push(i);
|
|
597
|
+
}
|
|
598
|
+
c.current.add(() => t.update(...n));
|
|
599
|
+
}));
|
|
600
|
+
}, [
|
|
601
|
+
t,
|
|
602
|
+
l,
|
|
603
|
+
o
|
|
604
|
+
]), p = (0, W.useCallback)(({ data: e }) => {
|
|
605
|
+
o.execute(() => {
|
|
606
|
+
let { point: t } = P(e);
|
|
607
|
+
o.add({
|
|
608
|
+
x: t.x,
|
|
609
|
+
y: t.y
|
|
610
|
+
}), o.select(o.points.length - 1), u();
|
|
611
|
+
});
|
|
612
|
+
}, [o, u]);
|
|
613
|
+
(0, W.useEffect)(() => {
|
|
614
|
+
let n = t.renderer;
|
|
615
|
+
if (!(!e || !n)) return r.current = t.scale, o.execute(() => {
|
|
616
|
+
o.restore(), u();
|
|
617
|
+
}), n.events.addEventListener("pointer:click", p), n.events.addEventListener("viewport:ptscale", f), window.addEventListener("keyup", d), () => {
|
|
618
|
+
window.removeEventListener("keyup", d), n.events.removeEventListener("pointer:click", p), n.events.removeEventListener("viewport:ptscale", f), c.current.destroy();
|
|
619
|
+
};
|
|
620
|
+
}, [
|
|
621
|
+
e,
|
|
622
|
+
t,
|
|
623
|
+
o,
|
|
624
|
+
u,
|
|
625
|
+
p,
|
|
626
|
+
f,
|
|
627
|
+
d
|
|
628
|
+
]);
|
|
629
|
+
}
|
|
630
|
+
//#endregion
|
|
631
|
+
//#region src/components/Map/traffic/useManageTraffic.ts
|
|
632
|
+
var q = 2, lt = q * 3.5, J = q * 12, ut = J * .7, dt = 8, ft = "transport_locations", pt = 150, mt = "#a4aab6", ht = 1e3, gt = 2e4, _t = 500;
|
|
633
|
+
function vt({ permission: e, rendererService: t, dataJsonUrl: n, websocketUrl: i }) {
|
|
634
|
+
let o = (0, W.useRef)(window.devicePixelRatio), c = (0, W.useRef)(/* @__PURE__ */ new Map()), l = (0, W.useRef)(/* @__PURE__ */ new Map()), u = (0, W.useRef)(), d = (0, W.useRef)(), f = (0, W.useRef)(performance.now()), p = (0, W.useRef)(1), m = (0, W.useRef)(new Qe()), h = (0, W.useRef)(/* @__PURE__ */ new Map()), g = (0, W.useRef)(), _ = (0, W.useRef)(ht), v = (0, W.useRef)(/* @__PURE__ */ new Map()), y = (0, W.useRef)();
|
|
635
|
+
(0, W.useEffect)(() => {
|
|
636
|
+
let b;
|
|
637
|
+
async function x() {
|
|
638
|
+
if (!(!e || !t.scene)) try {
|
|
639
|
+
let e;
|
|
640
|
+
try {
|
|
641
|
+
let t = await fetch(n, {
|
|
642
|
+
method: "GET",
|
|
643
|
+
headers: { "Content-Type": "application/json" }
|
|
644
|
+
});
|
|
645
|
+
if (!t.ok || t.status === 204) return;
|
|
646
|
+
e = await t.json();
|
|
647
|
+
} catch (e) {
|
|
648
|
+
console.warn("useManageTraffic failed to get JSON", e);
|
|
649
|
+
}
|
|
650
|
+
if (!e || e != null && e.disabled || e != null && e.error) return;
|
|
651
|
+
o.current = yt(t.scale);
|
|
652
|
+
let i = new Map(e.routes.map(({ id: e, color: t }) => [e, t])), u = t.scene.rootLayer.children, _ = /* @__PURE__ */ new Map();
|
|
653
|
+
i.forEach((e) => {
|
|
654
|
+
_.set(e, St({
|
|
655
|
+
radius: lt,
|
|
656
|
+
color: e,
|
|
657
|
+
scale: window.devicePixelRatio
|
|
658
|
+
}));
|
|
659
|
+
});
|
|
660
|
+
let y = Ae(), x = u.filter((e) => y.test(e.name)), w = je(), E = u.filter((e) => w.test(e.name));
|
|
661
|
+
e.routes.slice(0, x.length).forEach(({ id: e, color: n, path: r, stops: i, hiddenPoints: a }, s) => {
|
|
662
|
+
h.current.set(e, r);
|
|
663
|
+
let c = x[s];
|
|
664
|
+
if (c) {
|
|
665
|
+
var l;
|
|
666
|
+
let e = new Map((l = a == null ? void 0 : a.map((e) => [At(e), e])) == null ? [] : l);
|
|
667
|
+
for (let t = 1; t < r.length; t++) {
|
|
668
|
+
let i = r[t - 1], a = r[t];
|
|
669
|
+
e.has(At(i)) || e.has(At(a)) || c.children.push({
|
|
670
|
+
points: [i, a],
|
|
671
|
+
color: n,
|
|
672
|
+
width: q
|
|
673
|
+
});
|
|
674
|
+
}
|
|
675
|
+
c.children.length && m.current.add(() => t.update(c));
|
|
676
|
+
}
|
|
677
|
+
let u = E[s];
|
|
678
|
+
if (u && i != null && i.length) {
|
|
679
|
+
let e = _.get(n);
|
|
680
|
+
i.forEach((t) => {
|
|
681
|
+
u.children.push({
|
|
682
|
+
source: e,
|
|
683
|
+
bounds: C(t.x, t.y, e.width, e.height, o.current)
|
|
684
|
+
});
|
|
685
|
+
}), u.children.length && m.current.add(() => t.update(u));
|
|
686
|
+
}
|
|
687
|
+
});
|
|
688
|
+
let D = u.find((e) => e.name === Ce), O = /* @__PURE__ */ new Map();
|
|
689
|
+
g.current = (e) => {
|
|
690
|
+
try {
|
|
691
|
+
let { ptScale: n, sceneId: r } = bt(e);
|
|
692
|
+
if (!s(r)) return;
|
|
693
|
+
o.current = yt(n);
|
|
694
|
+
let i = [];
|
|
695
|
+
for (let e = 0; e < E.length; e++) {
|
|
696
|
+
let t = E[e].children;
|
|
697
|
+
for (let e = 0; e < t.length; e++) {
|
|
698
|
+
let n = t[e];
|
|
699
|
+
n.bounds = C(n.bounds.center.x, n.bounds.center.y, n.source.width, n.source.height, o.current, n.bounds.rotation), i.push(n);
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
let a = [...c.current.values()];
|
|
703
|
+
for (let e = 0; e < a.length; e++) {
|
|
704
|
+
let t = a[e];
|
|
705
|
+
t.bounds = C(t.bounds.center.x, t.bounds.center.y, t.source.width, t.source.height, o.current, t.bounds.rotation);
|
|
706
|
+
}
|
|
707
|
+
m.current.add(() => t.update(...i, ...a));
|
|
708
|
+
} catch (e) {
|
|
709
|
+
console.error("ptscale", e);
|
|
710
|
+
}
|
|
711
|
+
}, t.renderer.events.addEventListener("viewport:ptscale", g.current), b = requestAnimationFrame(() => {
|
|
712
|
+
var e;
|
|
713
|
+
(e = g.current) == null || e.call(g, t.scale);
|
|
714
|
+
}), i.forEach((e, t) => {
|
|
715
|
+
O.set(t, Ct({
|
|
716
|
+
id: t,
|
|
717
|
+
width: J,
|
|
718
|
+
height: J,
|
|
719
|
+
color: e,
|
|
720
|
+
scale: window.devicePixelRatio
|
|
721
|
+
}));
|
|
722
|
+
}), O.set(mt, Ct({
|
|
723
|
+
id: "orphan",
|
|
724
|
+
width: J,
|
|
725
|
+
height: J,
|
|
726
|
+
color: mt,
|
|
727
|
+
scale: window.devicePixelRatio
|
|
728
|
+
}));
|
|
729
|
+
let k = null;
|
|
730
|
+
try {
|
|
731
|
+
k = V(await a(`${r}icons/bus-white.svg`), ut, ut, window.devicePixelRatio);
|
|
732
|
+
} catch (e) {
|
|
733
|
+
console.error(e);
|
|
734
|
+
}
|
|
735
|
+
d.current = (e) => {
|
|
736
|
+
try {
|
|
737
|
+
var n;
|
|
738
|
+
let r = JSON.parse(e.data);
|
|
739
|
+
if (r.type !== ft) return;
|
|
740
|
+
let i = e.timeStamp || performance.now();
|
|
741
|
+
p.current = Math.round(i - f.current), f.current = i;
|
|
742
|
+
let a = Math.max((n = p.current) == null ? _t : n, _t), s = l.current, u = c.current, d = D.children, g = m.current, _ = !1;
|
|
743
|
+
r.data.forEach(({ id: e, x: n, y: r, route_id: i, hidden: c }) => {
|
|
744
|
+
if (s.has(e)) {
|
|
745
|
+
var l;
|
|
746
|
+
(l = s.get(e)) == null || l(), s.delete(e);
|
|
747
|
+
}
|
|
748
|
+
if (c && u.has(e) && u.has(Y(e))) {
|
|
749
|
+
let n = u.get(e);
|
|
750
|
+
n.hidden = !0;
|
|
751
|
+
let r = u.get(Y(e));
|
|
752
|
+
r.hidden = !0, g.add(() => t.update(n, r));
|
|
753
|
+
return;
|
|
754
|
+
}
|
|
755
|
+
if (v.current.set(e, performance.now()), !u.has(e)) {
|
|
756
|
+
let t = O.get(i) || O.get(mt), a = {
|
|
757
|
+
id: e,
|
|
758
|
+
source: t,
|
|
759
|
+
bounds: C(n, r, t.width, t.height, o.current, 0)
|
|
760
|
+
};
|
|
761
|
+
if (u.set(e, a), k) {
|
|
762
|
+
let t = Y(e), i = {
|
|
763
|
+
id: t,
|
|
764
|
+
source: k,
|
|
765
|
+
bounds: C(n, r, k.width, k.height, o.current, 0)
|
|
766
|
+
};
|
|
767
|
+
k.setAttribute("id", t), u.set(t, i), d.push(a, i);
|
|
768
|
+
} else d.push(a);
|
|
769
|
+
_ = !0;
|
|
770
|
+
return;
|
|
771
|
+
}
|
|
772
|
+
let f = u.get(e), p = u.get(Y(e)), m = f.bounds.center, y = Ot(m, {
|
|
773
|
+
x: n,
|
|
774
|
+
y: r
|
|
775
|
+
}, h.current.get(i));
|
|
776
|
+
if (y.reduce((e, t, n) => n === 0 ? e : e + wt(y[n - 1], t), 0) >= pt || document.hidden) Tt({
|
|
777
|
+
rendererService: t,
|
|
778
|
+
updateQueue: g,
|
|
779
|
+
vehicle: f,
|
|
780
|
+
vehicleFinery: p,
|
|
781
|
+
x: n,
|
|
782
|
+
y: r,
|
|
783
|
+
scale: o.current,
|
|
784
|
+
angle: xt(f.bounds.center, {
|
|
785
|
+
x: n,
|
|
786
|
+
y: r
|
|
787
|
+
})
|
|
788
|
+
});
|
|
789
|
+
else {
|
|
790
|
+
let n = kt(y, a, (e) => {
|
|
791
|
+
Tt({
|
|
792
|
+
rendererService: t,
|
|
793
|
+
updateQueue: g,
|
|
794
|
+
vehicle: f,
|
|
795
|
+
vehicleFinery: p,
|
|
796
|
+
x: e.x,
|
|
797
|
+
y: e.y,
|
|
798
|
+
scale: o.current,
|
|
799
|
+
angle: e.angle
|
|
800
|
+
});
|
|
801
|
+
});
|
|
802
|
+
s.set(e, n);
|
|
803
|
+
}
|
|
804
|
+
}), _ && g.add(() => t.update(D));
|
|
805
|
+
} catch (e) {
|
|
806
|
+
console.error("handleSocketMessage", e);
|
|
807
|
+
}
|
|
808
|
+
}, S(), T(e.config ? (Number(e.config.vehicle_inactive_interval) || 20) * 1e3 : gt);
|
|
809
|
+
} catch (e) {
|
|
810
|
+
console.warn(e);
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
x();
|
|
814
|
+
function S() {
|
|
815
|
+
var e, t;
|
|
816
|
+
((e = u.current) == null ? void 0 : e.readyState) === WebSocket.OPEN || ((t = u.current) == null ? void 0 : t.readyState) === WebSocket.CONNECTING || (u.current = new WebSocket(i), u.current.onmessage = d.current, u.current.onopen = () => {
|
|
817
|
+
_.current = ht;
|
|
818
|
+
}, u.current.onclose = () => {
|
|
819
|
+
navigator.onLine && (setTimeout(S, _.current), _.current = Math.min(_.current * 2, 3e4));
|
|
820
|
+
});
|
|
821
|
+
}
|
|
822
|
+
function w() {
|
|
823
|
+
S();
|
|
824
|
+
}
|
|
825
|
+
window.addEventListener("online", w);
|
|
826
|
+
function T(e) {
|
|
827
|
+
clearInterval(y.current), y.current = window.setInterval(() => {
|
|
828
|
+
let n = performance.now(), r = [], i = [];
|
|
829
|
+
v.current.forEach((t, a) => {
|
|
830
|
+
if (n - t < e) return;
|
|
831
|
+
let o = c.current.get(a);
|
|
832
|
+
o && (o.hidden = !0, i.push(o), r.push(a));
|
|
833
|
+
let s = Y(a), l = c.current.get(s);
|
|
834
|
+
l && (l.hidden = !0, i.push(l), r.push(s));
|
|
835
|
+
}), i.length && m.current.add(() => t.update(...i)), r.forEach((e) => v.current.delete(e));
|
|
836
|
+
}, e);
|
|
837
|
+
}
|
|
838
|
+
return () => {
|
|
839
|
+
g.current && t.renderer && t.renderer.events.removeEventListener("viewport:ptscale", g.current), b !== void 0 && cancelAnimationFrame(b), l.current.forEach((e) => e == null ? void 0 : e()), l.current.clear(), c.current.clear(), m.current.destroy(), window.removeEventListener("online", w), clearInterval(y.current);
|
|
840
|
+
};
|
|
841
|
+
}, [
|
|
842
|
+
e,
|
|
843
|
+
t,
|
|
844
|
+
n,
|
|
845
|
+
i
|
|
846
|
+
]);
|
|
847
|
+
}
|
|
848
|
+
function yt(e) {
|
|
849
|
+
return Math.min(e || window.devicePixelRatio, dt);
|
|
850
|
+
}
|
|
851
|
+
function bt(e) {
|
|
852
|
+
return typeof e == "number" ? { ptScale: e } : e;
|
|
853
|
+
}
|
|
854
|
+
function xt(e, t) {
|
|
855
|
+
return Math.atan2(t.y - e.y, t.x - e.x);
|
|
856
|
+
}
|
|
857
|
+
function St({ radius: e, scale: t, color: n }) {
|
|
858
|
+
let r = document.createElement("canvas"), i = r.getContext("2d");
|
|
859
|
+
i.imageSmoothingEnabled = !1;
|
|
860
|
+
let a = Math.ceil(e * 2 * t), o = a / 2, s = e * .78, c = e * .33;
|
|
861
|
+
return r.width = a, r.height = a, i.translate(o, o), i.scale(t, t), i.beginPath(), i.arc(0, 0, e, 0, 2 * Math.PI), i.fillStyle = "#FFFFFF", i.fill(), i.beginPath(), i.arc(0, 0, s, 0, 2 * Math.PI), i.fillStyle = n, i.fill(), i.beginPath(), i.arc(0, 0, c, 0, 2 * Math.PI), i.fillStyle = "#FFFFFF", i.fill(), r;
|
|
862
|
+
}
|
|
863
|
+
function Ct({ id: e, width: t, height: n, color: r, scale: i }) {
|
|
864
|
+
let a = 2 * i, o = t / 2 * i, s = n * i, c = .01, l = s * .6, u = s, d = 8 * i, f = u + a + l / 2 + d * 2, p = o * 2 + l + a + d * 2, m = document.createElement("canvas");
|
|
865
|
+
m.setAttribute("id", e), m.width = f, m.height = p;
|
|
866
|
+
let h = m.getContext("2d"), g = f / 2, _ = p / 2;
|
|
867
|
+
h.save(), h.translate(g, _), h.rotate(-Math.PI / 2), h.translate(-g, -_);
|
|
868
|
+
let v = g, y = _ - u / 2 + o, b = y + l;
|
|
869
|
+
return h.shadowColor = "rgba(16, 24, 40, 0.2)", h.shadowBlur = d / 2, h.beginPath(), h.arc(v, y, o, Math.PI, 0, !1), h.bezierCurveTo(v + o, y + s * .3, v + c * o, b, v, b), h.bezierCurveTo(v - c * o, b, v - o, y + s * .3, v - o, y), h.closePath(), h.fillStyle = r, h.fill(), h.strokeStyle = "#FFFFFF", h.lineWidth = a, h.stroke(), h.restore(), m;
|
|
870
|
+
}
|
|
871
|
+
function wt(e, t) {
|
|
872
|
+
return Math.hypot(e.x - t.x, e.y - t.y);
|
|
873
|
+
}
|
|
874
|
+
function Y(e) {
|
|
875
|
+
return `${e}_finery`;
|
|
876
|
+
}
|
|
877
|
+
function Tt({ rendererService: e, updateQueue: t, vehicle: n, vehicleFinery: r, x: i, y: a, scale: o, angle: s }) {
|
|
878
|
+
n.bounds = C(i, a, n.source.width, n.source.height, o, s), n.hidden = !1, r ? (r.bounds = C(i, a, r.source.width, r.source.height, o, ee(e.angle)), r.hidden = !1, t.add(() => e.update(r, n))) : t.add(() => e.update(n));
|
|
879
|
+
}
|
|
880
|
+
function X(e, t, n) {
|
|
881
|
+
return {
|
|
882
|
+
x: e.x + (t.x - e.x) * n,
|
|
883
|
+
y: e.y + (t.y - e.y) * n
|
|
884
|
+
};
|
|
885
|
+
}
|
|
886
|
+
function Et(e, t) {
|
|
887
|
+
let n = Infinity, r = {
|
|
888
|
+
index: 0,
|
|
889
|
+
t: 0
|
|
890
|
+
};
|
|
891
|
+
for (let i = 0; i < t.length - 1; i++) {
|
|
892
|
+
let a = t[i], o = t[i + 1], s = o.x - a.x, c = o.y - a.y, l = s * s + c * c, u = l ? ((e.x - a.x) * s + (e.y - a.y) * c) / l : 0, d = Math.max(0, Math.min(1, u)), f = wt(e, X(a, o, d));
|
|
893
|
+
f < n && (n = f, r = {
|
|
894
|
+
index: i,
|
|
895
|
+
t: d
|
|
896
|
+
});
|
|
897
|
+
}
|
|
898
|
+
return r;
|
|
899
|
+
}
|
|
900
|
+
function Dt(e, t, n) {
|
|
901
|
+
let r = wt(e, t), i = Math.max(2, Math.ceil(r / n) + 1), a = [];
|
|
902
|
+
for (let n = 0; n < i; n++) {
|
|
903
|
+
let r = X(e, t, n / (i - 1));
|
|
904
|
+
a.push({
|
|
905
|
+
x: r.x,
|
|
906
|
+
y: r.y
|
|
907
|
+
});
|
|
908
|
+
}
|
|
909
|
+
return a;
|
|
910
|
+
}
|
|
911
|
+
function Ot(e, t, n) {
|
|
912
|
+
if (!n || !n.length) return Dt(e, t, 10);
|
|
913
|
+
let r = Et(e, n), i = Et(t, n), a = [], o = (e) => a.push({
|
|
914
|
+
x: e.x,
|
|
915
|
+
y: e.y
|
|
916
|
+
});
|
|
917
|
+
r.index + 1 < n.length ? o(X(n[r.index], n[r.index + 1], r.t)) : o(n[r.index]);
|
|
918
|
+
for (let e = r.index + 1; e <= i.index && e < n.length; e++) o(n[e]);
|
|
919
|
+
return i.index + 1 < n.length ? o(X(n[i.index], n[i.index + 1], i.t)) : o(n[i.index]), a;
|
|
920
|
+
}
|
|
921
|
+
function kt(e, t, n, r) {
|
|
922
|
+
if (e.length < 2) return () => {};
|
|
923
|
+
let i = null, a, o = [], s = 0;
|
|
924
|
+
for (let t = 0; t < e.length - 1; t++) {
|
|
925
|
+
let n = Math.hypot(e[t + 1].x - e[t].x, e[t + 1].y - e[t].y);
|
|
926
|
+
o.push(n), s += n;
|
|
927
|
+
}
|
|
928
|
+
let c = (l) => {
|
|
929
|
+
i || (i = l);
|
|
930
|
+
let u = l - i, d = Math.min(u / t, 1), f = d * s, p = 0, m = 0;
|
|
931
|
+
for (; m < o.length && p + o[m] < f;) p += o[m], m++;
|
|
932
|
+
m >= o.length && (m = o.length - 1);
|
|
933
|
+
let h = e[m], g = e[Math.min(m + 1, e.length - 1)], _ = o[m] || 0, v = _ === 0 ? 0 : (f - p) / _, y = h.x + (g.x - h.x) * v, b = h.y + (g.y - h.y) * v, x = g.x - h.x, S = g.y - h.y;
|
|
934
|
+
n({
|
|
935
|
+
x: y,
|
|
936
|
+
y: b,
|
|
937
|
+
angle: x === 0 && S === 0 ? 0 : Math.atan2(S, x)
|
|
938
|
+
}), d < 1 ? a = requestAnimationFrame(c) : r && r();
|
|
939
|
+
};
|
|
940
|
+
return a = requestAnimationFrame(c), () => {
|
|
941
|
+
a && cancelAnimationFrame(a);
|
|
942
|
+
};
|
|
943
|
+
}
|
|
944
|
+
function At(e) {
|
|
945
|
+
return `${e.x},${e.y}`;
|
|
946
|
+
}
|
|
947
|
+
//#endregion
|
|
948
|
+
//#region src/utils/dimming.ts
|
|
949
|
+
var jt = .5, Mt = "cubic";
|
|
950
|
+
function Nt(e, t) {
|
|
951
|
+
let n = e.scene;
|
|
952
|
+
if (!n) return;
|
|
953
|
+
let r = n.rootLayer;
|
|
954
|
+
r.dim !== t && (r.dim = t, e.update(n.rootLayer));
|
|
955
|
+
}
|
|
956
|
+
function Pt(e, t = 300, n = Mt) {
|
|
957
|
+
let r = null, i = 0, a = 0, o = 0, s = 0, c = Math.max(t, 0);
|
|
958
|
+
function l() {
|
|
959
|
+
r === null || typeof cancelAnimationFrame != "function" || (cancelAnimationFrame(r), r = null);
|
|
960
|
+
}
|
|
961
|
+
function u(t) {
|
|
962
|
+
l(), i = t, e(i);
|
|
963
|
+
}
|
|
964
|
+
function d(t) {
|
|
965
|
+
let l = t - s, u = Math.min(l / c, 1), f = Ft(u, n);
|
|
966
|
+
if (i = a + (o - a) * f, e(i), u < 1) {
|
|
967
|
+
r = requestAnimationFrame(d);
|
|
968
|
+
return;
|
|
969
|
+
}
|
|
970
|
+
r = null, i = o, e(i);
|
|
971
|
+
}
|
|
972
|
+
return {
|
|
973
|
+
getValue() {
|
|
974
|
+
return i;
|
|
975
|
+
},
|
|
976
|
+
setTarget(e, t = {}) {
|
|
977
|
+
let n = +!!e;
|
|
978
|
+
if (!(!t.immediate && n === o && r === null)) {
|
|
979
|
+
if (o = n, t.immediate || c === 0 || typeof requestAnimationFrame != "function") {
|
|
980
|
+
u(o);
|
|
981
|
+
return;
|
|
982
|
+
}
|
|
983
|
+
l(), a = i, s = typeof performance > "u" ? Date.now() : performance.now(), r = requestAnimationFrame(d);
|
|
984
|
+
}
|
|
985
|
+
},
|
|
986
|
+
stop() {
|
|
987
|
+
l();
|
|
988
|
+
}
|
|
989
|
+
};
|
|
990
|
+
}
|
|
991
|
+
function Ft(e, t) {
|
|
992
|
+
return t === "linear" ? e : It(e);
|
|
993
|
+
}
|
|
994
|
+
function It(e) {
|
|
995
|
+
return e < .5 ? 4 * e * e * e : 1 - (-2 * e + 2) ** 3 / 2;
|
|
996
|
+
}
|
|
997
|
+
//#endregion
|
|
998
|
+
//#region src/components/Map/booth-by-xy.ts
|
|
999
|
+
var Lt = /* @__PURE__ */ new Map(), Rt = [], zt = [], Bt = [], Z = /* @__PURE__ */ new Map(), Q;
|
|
1000
|
+
function Vt() {
|
|
1001
|
+
let e = R.booths.filter((e) => e.visible && e.rect && e.rect.w > 0 && e.rect.h > 0);
|
|
1002
|
+
if (Lt = /* @__PURE__ */ new Map(), Rt = [], Bt = [], Q = null, Z = /* @__PURE__ */ new Map(), !e.length) return;
|
|
1003
|
+
zt = e.filter((e) => e.paths);
|
|
1004
|
+
let t = z.fromMultiple(e.map((e) => e.rect));
|
|
1005
|
+
for (let t of e) {
|
|
1006
|
+
let e = t.rect;
|
|
1007
|
+
Math.abs(t.rotate) === 90 * Math.PI / 180 && (e = e.getRotated90()), Rt.push(e), Lt.set(e, t);
|
|
1008
|
+
}
|
|
1009
|
+
let n = Math.ceil(t.w / 2), r = Math.ceil(t.h / 2);
|
|
1010
|
+
for (let e = 0; e < 2; e++) for (let i = 0; i < 2; i++) {
|
|
1011
|
+
let a = t.x1 + e * n, o = t.y1 + i * r, s = z.fromXywh(a, o, n, r);
|
|
1012
|
+
Bt.push(s);
|
|
1013
|
+
let c = Rt.filter((e) => s.intersects(e));
|
|
1014
|
+
Z.set(s, c);
|
|
1015
|
+
}
|
|
1016
|
+
i.log("hover segmentToRects", Z);
|
|
1017
|
+
}
|
|
1018
|
+
n(() => [
|
|
1019
|
+
R.booths,
|
|
1020
|
+
N.loaded,
|
|
1021
|
+
N.visible
|
|
1022
|
+
], () => Vt());
|
|
1023
|
+
function Ht(e, t) {
|
|
1024
|
+
let n;
|
|
1025
|
+
n = Q && Q.containsPoint(e, t) ? Q : Bt.find((n) => n.containsPoint(e, t)), n && (Q = n);
|
|
1026
|
+
let r = Z.get(n);
|
|
1027
|
+
if (r) {
|
|
1028
|
+
let n = r.filter((n) => n.containsPoint(e, t));
|
|
1029
|
+
if (n.length) {
|
|
1030
|
+
let e;
|
|
1031
|
+
e = n.length > 1 ? n.sort((e, t) => e.w - t.w)[0] : n[0];
|
|
1032
|
+
let t = Lt.get(e);
|
|
1033
|
+
return t.visible ? t : null;
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1036
|
+
for (let n of zt) for (let r of n.paths) for (let i of M(r.index, N.mode === ne.Default ? "" : n.layer.name)) if (Ne(e, t, i)) return n.visible ? n : null;
|
|
1037
|
+
return null;
|
|
1038
|
+
}
|
|
1039
|
+
function Ut(e, t) {
|
|
1040
|
+
return Ht(e, t);
|
|
1041
|
+
}
|
|
1042
|
+
//#endregion
|
|
1043
|
+
//#region src/wayfinding/bindMobxReactions.ts
|
|
1044
|
+
function Wt({ runtime: e, kioskHandler: t, yahHandler: r, stores: { routeStore: i, uiState: a, layerStore: o } }) {
|
|
1045
|
+
let s = [];
|
|
1046
|
+
function l() {
|
|
1047
|
+
var t, n, r;
|
|
1048
|
+
let o = (t = a.selectedRoute) == null ? void 0 : t.from, s = (n = a.selectedRoute) == null ? void 0 : n.to;
|
|
1049
|
+
if (!(o != null && o.rect) || !(s != null && s.rect)) {
|
|
1050
|
+
e.clearRoute();
|
|
1051
|
+
return;
|
|
1052
|
+
}
|
|
1053
|
+
e.setRoute({
|
|
1054
|
+
from: c(o),
|
|
1055
|
+
to: c(s),
|
|
1056
|
+
waypoints: (r = a.selectedRoute) == null || (r = r.waypoints) == null ? void 0 : r.map(c),
|
|
1057
|
+
accessible: i.onlyAccessible
|
|
1058
|
+
}) === !1 && console.error(/* @__PURE__ */ Error(`Route not found: ${o.name} → ${s.name}`));
|
|
1059
|
+
}
|
|
1060
|
+
function u() {
|
|
1061
|
+
var t, n;
|
|
1062
|
+
let o = i.currentPosition, s = i.iconType !== 0, c = !!((t = a.selectedRoute) != null && t.from && (n = a.selectedRoute) != null && n.to), l = s && !c;
|
|
1063
|
+
if (!o) {
|
|
1064
|
+
e.onPositionChanged(null), r(null);
|
|
1065
|
+
return;
|
|
1066
|
+
}
|
|
1067
|
+
let u = f(o);
|
|
1068
|
+
l ? (e.onPositionChanged(null), r({
|
|
1069
|
+
x: u.x,
|
|
1070
|
+
y: u.y,
|
|
1071
|
+
layer: u.layer
|
|
1072
|
+
})) : (r(null), e.onPositionChanged(u));
|
|
1073
|
+
}
|
|
1074
|
+
function d() {
|
|
1075
|
+
var e, n;
|
|
1076
|
+
let r = (e = o.floors.find((e) => e.active)) == null ? void 0 : e.name;
|
|
1077
|
+
t((n = a.kioskData) == null ? null : n, r, o.mode);
|
|
1078
|
+
}
|
|
1079
|
+
s.push(n(() => o.layersLoaded, () => {
|
|
1080
|
+
l(), u();
|
|
1081
|
+
}), n(() => [a.selectedRoute, i.onlyAccessible], () => {
|
|
1082
|
+
l(), u();
|
|
1083
|
+
}), n(() => i.currentPosition, () => u()), n(() => [a.kioskData, o.floors.find((e) => e.active)], () => d()));
|
|
1084
|
+
let p = null, m = n(() => [i.currentRouteLayer, a.getRouteNextFloor], () => {
|
|
1085
|
+
o.layersLoaded && (p !== null && clearTimeout(p), p = setTimeout(() => {
|
|
1086
|
+
e.onFloorChanged(), u(), p = null;
|
|
1087
|
+
}, 0));
|
|
1088
|
+
});
|
|
1089
|
+
return s.push(() => {
|
|
1090
|
+
p !== null && clearTimeout(p), m();
|
|
1091
|
+
}), l(), u(), d(), () => {
|
|
1092
|
+
for (let e of s) e();
|
|
1093
|
+
s.length = 0;
|
|
1094
|
+
};
|
|
1095
|
+
}
|
|
1096
|
+
//#endregion
|
|
1097
|
+
//#region src/wayfinding/handlers/kioskHandler.ts
|
|
1098
|
+
var Gt = "kiosk", Kt = 0;
|
|
1099
|
+
function qt({ renderer: e, kioskIconMap: t, layer: n }) {
|
|
1100
|
+
return (r, i, a) => {
|
|
1101
|
+
var o;
|
|
1102
|
+
if (!r) {
|
|
1103
|
+
e.setIcon(Gt, null), e.flush();
|
|
1104
|
+
return;
|
|
1105
|
+
}
|
|
1106
|
+
if (a !== Kt && r.z && i && r.z !== i) {
|
|
1107
|
+
e.setIcon(Gt, null), e.flush();
|
|
1108
|
+
return;
|
|
1109
|
+
}
|
|
1110
|
+
e.setIcon(Gt, {
|
|
1111
|
+
canvas: g(t, r.iconSizePercent),
|
|
1112
|
+
layer: n,
|
|
1113
|
+
x: r.x,
|
|
1114
|
+
y: r.y,
|
|
1115
|
+
rotation: ((o = r.heading) == null ? 0 : o) * Math.PI / 180
|
|
1116
|
+
}), e.flush();
|
|
1117
|
+
};
|
|
1118
|
+
}
|
|
1119
|
+
//#endregion
|
|
1120
|
+
//#region src/wayfinding/handlers/yahHandler.ts
|
|
1121
|
+
var Jt = "yah";
|
|
1122
|
+
function Yt({ renderer: e, iconProvider: t, floorContext: n, layer: r }) {
|
|
1123
|
+
return (i) => {
|
|
1124
|
+
if (!i) {
|
|
1125
|
+
e.setIcon(Jt, null), e.flush();
|
|
1126
|
+
return;
|
|
1127
|
+
}
|
|
1128
|
+
let a = n.isLayerVisible(i.layer);
|
|
1129
|
+
e.setIcon(Jt, {
|
|
1130
|
+
canvas: t.getIcon("yah").canvas,
|
|
1131
|
+
layer: r,
|
|
1132
|
+
x: i.x,
|
|
1133
|
+
y: i.y,
|
|
1134
|
+
hidden: !a,
|
|
1135
|
+
dimmed: !a,
|
|
1136
|
+
origin: [.5, 1]
|
|
1137
|
+
}), e.flush();
|
|
1138
|
+
};
|
|
1139
|
+
}
|
|
1140
|
+
//#endregion
|
|
1141
|
+
//#region src/wayfinding/runtime/getRouteLines.ts
|
|
1142
|
+
function Xt({ engine: e, from: t, to: n, waypoints: r, accessible: i }) {
|
|
1143
|
+
return r != null && r.length ? e.buildWaypointsRoute([
|
|
1144
|
+
t,
|
|
1145
|
+
...r,
|
|
1146
|
+
n
|
|
1147
|
+
], { accessible: i }).lines : e.buildRoute(t, n, { accessible: i }).lines;
|
|
1148
|
+
}
|
|
1149
|
+
//#endregion
|
|
1150
|
+
//#region src/wayfinding/runtime/endpointView.ts
|
|
1151
|
+
function Zt({ renderer: e, iconProvider: t, floorContext: n, layer: r }) {
|
|
1152
|
+
return {
|
|
1153
|
+
place(i, a, o) {
|
|
1154
|
+
if (!o.length) return;
|
|
1155
|
+
let s = n.isLayerVisible(i.layer), c = n.isLayerVisible(a.layer), l = o[o.length - 1], u = o[0];
|
|
1156
|
+
e.setIcon("source", {
|
|
1157
|
+
canvas: t.getIcon("source").canvas,
|
|
1158
|
+
layer: r,
|
|
1159
|
+
x: l.x,
|
|
1160
|
+
y: l.y,
|
|
1161
|
+
hidden: !s || !i.bounds,
|
|
1162
|
+
dimmed: !s,
|
|
1163
|
+
cardinalSnap: !0
|
|
1164
|
+
}), e.setIcon("destination", {
|
|
1165
|
+
canvas: t.getIcon("destination").canvas,
|
|
1166
|
+
layer: r,
|
|
1167
|
+
x: u.x,
|
|
1168
|
+
y: u.y,
|
|
1169
|
+
hidden: !c || !a.bounds,
|
|
1170
|
+
dimmed: !c,
|
|
1171
|
+
cardinalSnap: !0
|
|
1172
|
+
});
|
|
1173
|
+
},
|
|
1174
|
+
hide() {
|
|
1175
|
+
e.setIcon("source", null), e.setIcon("destination", null);
|
|
1176
|
+
}
|
|
1177
|
+
};
|
|
1178
|
+
}
|
|
1179
|
+
//#endregion
|
|
1180
|
+
//#region src/wayfinding/runtime/positionView.ts
|
|
1181
|
+
var Qt = "position";
|
|
1182
|
+
function $t({ renderer: e, iconProvider: t, layer: n }) {
|
|
1183
|
+
return {
|
|
1184
|
+
place(r, i) {
|
|
1185
|
+
let a = Number.isFinite(r.angle), o = a ? "current_arrow" : "current", s = a ? r.angle * Math.PI / 180 : void 0;
|
|
1186
|
+
e.setIcon(Qt, {
|
|
1187
|
+
canvas: t.getIcon(o).canvas,
|
|
1188
|
+
layer: n,
|
|
1189
|
+
x: r.x,
|
|
1190
|
+
y: r.y,
|
|
1191
|
+
rotation: s,
|
|
1192
|
+
hidden: i,
|
|
1193
|
+
dimmed: i,
|
|
1194
|
+
origin: [.5, .5]
|
|
1195
|
+
});
|
|
1196
|
+
},
|
|
1197
|
+
hide() {
|
|
1198
|
+
e.setIcon(Qt, null);
|
|
1199
|
+
}
|
|
1200
|
+
};
|
|
1201
|
+
}
|
|
1202
|
+
//#endregion
|
|
1203
|
+
//#region src/wayfinding/runtime/positionTrailView.ts
|
|
1204
|
+
var $ = "trail";
|
|
1205
|
+
function en({ renderer: e, iconProvider: t, floorContext: n, trails: r, iconLayer: i, snapThreshold: a }) {
|
|
1206
|
+
let o = $t({
|
|
1207
|
+
renderer: e,
|
|
1208
|
+
iconProvider: t,
|
|
1209
|
+
layer: i
|
|
1210
|
+
});
|
|
1211
|
+
function s(e) {
|
|
1212
|
+
if (!e.routePoints.length) {
|
|
1213
|
+
r.clear($);
|
|
1214
|
+
return;
|
|
1215
|
+
}
|
|
1216
|
+
if (!e.from.bounds) {
|
|
1217
|
+
r.place($, e.routePoints[e.routePoints.length - 1], {
|
|
1218
|
+
x: e.from.x,
|
|
1219
|
+
y: e.from.y,
|
|
1220
|
+
layer: e.from.layer
|
|
1221
|
+
});
|
|
1222
|
+
return;
|
|
1223
|
+
}
|
|
1224
|
+
if (!e.to.bounds) {
|
|
1225
|
+
r.place($, e.routePoints[0], {
|
|
1226
|
+
x: e.to.x,
|
|
1227
|
+
y: e.to.y,
|
|
1228
|
+
layer: e.to.layer
|
|
1229
|
+
});
|
|
1230
|
+
return;
|
|
1231
|
+
}
|
|
1232
|
+
r.clear($);
|
|
1233
|
+
}
|
|
1234
|
+
return {
|
|
1235
|
+
placeIcon(e) {
|
|
1236
|
+
let t = !n.isLayerVisible(e.layer);
|
|
1237
|
+
o.place(e, t);
|
|
1238
|
+
},
|
|
1239
|
+
hideIcon() {
|
|
1240
|
+
o.hide();
|
|
1241
|
+
},
|
|
1242
|
+
applyToRoute(e, t, i) {
|
|
1243
|
+
let c = h({
|
|
1244
|
+
x: e.x,
|
|
1245
|
+
y: e.y,
|
|
1246
|
+
z: e.layer || null
|
|
1247
|
+
}, [...i], {
|
|
1248
|
+
snapThreshold: a,
|
|
1249
|
+
from: t.from,
|
|
1250
|
+
to: t.to
|
|
1251
|
+
});
|
|
1252
|
+
if (c.snapped) {
|
|
1253
|
+
s(t);
|
|
1254
|
+
let r = !n.isLayerVisible(e.layer);
|
|
1255
|
+
return o.place({
|
|
1256
|
+
...e,
|
|
1257
|
+
x: c.snappedPoint.x,
|
|
1258
|
+
y: c.snappedPoint.y
|
|
1259
|
+
}, r), c;
|
|
1260
|
+
}
|
|
1261
|
+
return t.routePoints.length ? r.place($, {
|
|
1262
|
+
x: e.x,
|
|
1263
|
+
y: e.y,
|
|
1264
|
+
layer: e.layer
|
|
1265
|
+
}, t.routePoints[t.routePoints.length - 1]) : r.clear($), c;
|
|
1266
|
+
},
|
|
1267
|
+
refreshTrail(e) {
|
|
1268
|
+
if (!e) {
|
|
1269
|
+
r.clear($);
|
|
1270
|
+
return;
|
|
1271
|
+
}
|
|
1272
|
+
s(e);
|
|
1273
|
+
},
|
|
1274
|
+
clearTrail() {
|
|
1275
|
+
r.clear($);
|
|
1276
|
+
}
|
|
1277
|
+
};
|
|
1278
|
+
}
|
|
1279
|
+
//#endregion
|
|
1280
|
+
//#region src/wayfinding/runtime/routeLinesView.ts
|
|
1281
|
+
function tn({ renderer: e, linesLayer: t, animatedLinesLayer: n }) {
|
|
1282
|
+
return {
|
|
1283
|
+
draw({ passed: r, remaining: i }, a = !1) {
|
|
1284
|
+
e.setRouteLines(r, i, {
|
|
1285
|
+
linesLayer: t,
|
|
1286
|
+
animatedLinesLayer: n,
|
|
1287
|
+
resetAnimation: !a
|
|
1288
|
+
});
|
|
1289
|
+
},
|
|
1290
|
+
clear() {
|
|
1291
|
+
e.setRouteLines([], [], {
|
|
1292
|
+
linesLayer: t,
|
|
1293
|
+
animatedLinesLayer: n,
|
|
1294
|
+
resetAnimation: !0
|
|
1295
|
+
});
|
|
1296
|
+
}
|
|
1297
|
+
};
|
|
1298
|
+
}
|
|
1299
|
+
//#endregion
|
|
1300
|
+
//#region src/wayfinding/runtime/routeRenderData.ts
|
|
1301
|
+
function nn({ routeLines: e, currentRouteLayer: t, from: n, to: r, snap: i }) {
|
|
1302
|
+
let a = y(e.filter((e) => !e.virtual), n, r), o = t === null ? a : a.filter((e) => e.p0.layer === t);
|
|
1303
|
+
if (!(i != null && i.snapped)) return {
|
|
1304
|
+
passed: [],
|
|
1305
|
+
remaining: o,
|
|
1306
|
+
distance: w(a)
|
|
1307
|
+
};
|
|
1308
|
+
let { passed: s, remaining: c } = O(o, i.snappedPoint);
|
|
1309
|
+
return {
|
|
1310
|
+
passed: s,
|
|
1311
|
+
remaining: c !== o && c.length > 0 ? [{
|
|
1312
|
+
...c[0],
|
|
1313
|
+
p0: i.snappedPoint
|
|
1314
|
+
}, ...c.slice(1)] : c,
|
|
1315
|
+
distance: i.distance
|
|
1316
|
+
};
|
|
1317
|
+
}
|
|
1318
|
+
//#endregion
|
|
1319
|
+
//#region src/wayfinding/runtime/routeUpdate.ts
|
|
1320
|
+
function rn(e, t) {
|
|
1321
|
+
let n = e.filter((e) => !e.virtual), r = ce(t.flatMap((e) => [e.p0, e.p1]));
|
|
1322
|
+
return !r || r.x1 === r.x2 && r.y1 === r.y2 ? {
|
|
1323
|
+
lines: n,
|
|
1324
|
+
bounds: null
|
|
1325
|
+
} : {
|
|
1326
|
+
lines: n,
|
|
1327
|
+
bounds: r
|
|
1328
|
+
};
|
|
1329
|
+
}
|
|
1330
|
+
//#endregion
|
|
1331
|
+
//#region src/wayfinding/runtime/trailView.ts
|
|
1332
|
+
function an({ renderer: e, iconProvider: t, floorContext: n, layer: r }) {
|
|
1333
|
+
let i = /* @__PURE__ */ new Set();
|
|
1334
|
+
function a(e, t) {
|
|
1335
|
+
if (n.showAllFloors()) return !0;
|
|
1336
|
+
let r = n.getActiveFloor();
|
|
1337
|
+
return r ? e === r && t === r : !1;
|
|
1338
|
+
}
|
|
1339
|
+
function o(t) {
|
|
1340
|
+
e.setTrail(t, null, null), i.delete(t);
|
|
1341
|
+
}
|
|
1342
|
+
return {
|
|
1343
|
+
place(n, s, c) {
|
|
1344
|
+
if (!a(s.layer, c.layer)) {
|
|
1345
|
+
o(n);
|
|
1346
|
+
return;
|
|
1347
|
+
}
|
|
1348
|
+
e.setTrail(n, s, c, {
|
|
1349
|
+
canvas: t.getIcon("trail").canvas,
|
|
1350
|
+
layer: r
|
|
1351
|
+
}), i.add(n);
|
|
1352
|
+
},
|
|
1353
|
+
clear(e) {
|
|
1354
|
+
o(e);
|
|
1355
|
+
},
|
|
1356
|
+
clearAll() {
|
|
1357
|
+
for (let t of i) e.setTrail(t, null, null);
|
|
1358
|
+
i.clear();
|
|
1359
|
+
}
|
|
1360
|
+
};
|
|
1361
|
+
}
|
|
1362
|
+
//#endregion
|
|
1363
|
+
//#region src/wayfinding/runtime/transitionView.ts
|
|
1364
|
+
var on = "transition";
|
|
1365
|
+
function sn({ renderer: e, iconProvider: t, floorContext: n, onTransitionClick: r, layer: i }) {
|
|
1366
|
+
return {
|
|
1367
|
+
place(a) {
|
|
1368
|
+
e.clearIcons(on);
|
|
1369
|
+
let o;
|
|
1370
|
+
if (n.showAllFloors()) o = null;
|
|
1371
|
+
else {
|
|
1372
|
+
let e = n.getActiveFloor();
|
|
1373
|
+
if (!e) return;
|
|
1374
|
+
o = e;
|
|
1375
|
+
}
|
|
1376
|
+
let s = j({
|
|
1377
|
+
routeLines: a,
|
|
1378
|
+
currentLayerName: o,
|
|
1379
|
+
floorOrder: n.getFloorOrder()
|
|
1380
|
+
});
|
|
1381
|
+
for (let [n, a] of s.entries()) e.setIcon(on, {
|
|
1382
|
+
canvas: t.getIcon(cn(a.role, a.direction)).canvas,
|
|
1383
|
+
layer: i,
|
|
1384
|
+
x: a.x,
|
|
1385
|
+
y: a.y,
|
|
1386
|
+
cardinalSnap: !0,
|
|
1387
|
+
onClick: a.role === "exit" ? () => r(a) : void 0
|
|
1388
|
+
}, n);
|
|
1389
|
+
},
|
|
1390
|
+
clear() {
|
|
1391
|
+
e.clearIcons(on);
|
|
1392
|
+
}
|
|
1393
|
+
};
|
|
1394
|
+
}
|
|
1395
|
+
function cn(e, t) {
|
|
1396
|
+
return e === "entry" ? "transition_entry" : t === "up" ? "transition_up" : t === "down" ? "transition_down" : "transition";
|
|
1397
|
+
}
|
|
1398
|
+
//#endregion
|
|
1399
|
+
//#region src/wayfinding/runtime/createWayfindingRuntime.ts
|
|
1400
|
+
var ln = (e) => e.flatMap((e) => [e.p0, e.p1]);
|
|
1401
|
+
function un({ engine: e, renderer: t, iconProvider: n, floorContext: r, layers: i, snapThreshold: a, onTransitionClick: o, onRouteUpdate: s, onRouteDistance: c }) {
|
|
1402
|
+
let l = Zt({
|
|
1403
|
+
renderer: t,
|
|
1404
|
+
iconProvider: n,
|
|
1405
|
+
floorContext: r,
|
|
1406
|
+
layer: i.points
|
|
1407
|
+
}), u = sn({
|
|
1408
|
+
renderer: t,
|
|
1409
|
+
iconProvider: n,
|
|
1410
|
+
floorContext: r,
|
|
1411
|
+
onTransitionClick: o,
|
|
1412
|
+
layer: i.points
|
|
1413
|
+
}), d = en({
|
|
1414
|
+
renderer: t,
|
|
1415
|
+
iconProvider: n,
|
|
1416
|
+
floorContext: r,
|
|
1417
|
+
trails: an({
|
|
1418
|
+
renderer: t,
|
|
1419
|
+
iconProvider: n,
|
|
1420
|
+
floorContext: r,
|
|
1421
|
+
layer: i.trail
|
|
1422
|
+
}),
|
|
1423
|
+
iconLayer: i.points,
|
|
1424
|
+
snapThreshold: a
|
|
1425
|
+
}), f = tn({
|
|
1426
|
+
renderer: t,
|
|
1427
|
+
linesLayer: i.lines,
|
|
1428
|
+
animatedLinesLayer: i.linesAnimated
|
|
1429
|
+
}), p = [], m = null, g = null, _ = null, v = 0;
|
|
1430
|
+
function y() {
|
|
1431
|
+
return r.showAllFloors() ? null : r.getActiveFloor();
|
|
1432
|
+
}
|
|
1433
|
+
function b() {
|
|
1434
|
+
let e = y();
|
|
1435
|
+
return e === null ? p.filter((e) => !e.virtual) : p.filter((t) => t.p0.layer === e && !t.virtual);
|
|
1436
|
+
}
|
|
1437
|
+
function x() {
|
|
1438
|
+
if (!m || !g) return null;
|
|
1439
|
+
let e = b();
|
|
1440
|
+
return e.length ? {
|
|
1441
|
+
from: m,
|
|
1442
|
+
to: g,
|
|
1443
|
+
routePoints: ln(e),
|
|
1444
|
+
visibleLines: e
|
|
1445
|
+
} : null;
|
|
1446
|
+
}
|
|
1447
|
+
function S(e, t = !1) {
|
|
1448
|
+
if (!m || !g) return;
|
|
1449
|
+
let n = nn({
|
|
1450
|
+
routeLines: p,
|
|
1451
|
+
currentRouteLayer: y(),
|
|
1452
|
+
from: m,
|
|
1453
|
+
to: g,
|
|
1454
|
+
snap: e
|
|
1455
|
+
});
|
|
1456
|
+
f.draw(n, t), v = n.distance;
|
|
1457
|
+
}
|
|
1458
|
+
function C() {
|
|
1459
|
+
if (!m || !g) return;
|
|
1460
|
+
let e = x();
|
|
1461
|
+
if (!e) {
|
|
1462
|
+
l.hide(), u.clear(), d.refreshTrail(null), S();
|
|
1463
|
+
return;
|
|
1464
|
+
}
|
|
1465
|
+
l.place(m, g, e.routePoints), u.place(p), S(), d.refreshTrail(e);
|
|
1466
|
+
}
|
|
1467
|
+
function T() {
|
|
1468
|
+
if (!_ || !m || !g) return;
|
|
1469
|
+
let e = p.filter((e) => !e.virtual);
|
|
1470
|
+
if (!e.length) return;
|
|
1471
|
+
let t = x();
|
|
1472
|
+
return t ? d.applyToRoute(_, t, e) : (d.refreshTrail(null), h({
|
|
1473
|
+
x: _.x,
|
|
1474
|
+
y: _.y,
|
|
1475
|
+
z: _.layer || null
|
|
1476
|
+
}, e, {
|
|
1477
|
+
snapThreshold: a,
|
|
1478
|
+
from: m,
|
|
1479
|
+
to: g
|
|
1480
|
+
}));
|
|
1481
|
+
}
|
|
1482
|
+
function E() {
|
|
1483
|
+
let e = rn(p, b());
|
|
1484
|
+
return s(e.lines, e.bounds), e;
|
|
1485
|
+
}
|
|
1486
|
+
function D({ from: n, to: r, waypoints: i, accessible: a }) {
|
|
1487
|
+
let o = Xt({
|
|
1488
|
+
engine: e,
|
|
1489
|
+
from: n,
|
|
1490
|
+
to: r,
|
|
1491
|
+
waypoints: i,
|
|
1492
|
+
accessible: a
|
|
1493
|
+
});
|
|
1494
|
+
if (!o.length) return A(), !1;
|
|
1495
|
+
m = n, g = r, p = o, C();
|
|
1496
|
+
let { lines: s } = E(), l = T();
|
|
1497
|
+
return l && S(l, !0), c(l ? v : w(s)), t.flush(), !0;
|
|
1498
|
+
}
|
|
1499
|
+
function O(e) {
|
|
1500
|
+
if (_ = e, !e) {
|
|
1501
|
+
d.hideIcon(), d.refreshTrail(x()), S(), c(v), t.flush();
|
|
1502
|
+
return;
|
|
1503
|
+
}
|
|
1504
|
+
d.placeIcon(e);
|
|
1505
|
+
let n = T();
|
|
1506
|
+
n && S(n, !0), c(v), t.flush();
|
|
1507
|
+
}
|
|
1508
|
+
function k() {
|
|
1509
|
+
C();
|
|
1510
|
+
let e = T();
|
|
1511
|
+
e && S(e, !0), p.length && E(), c(v), t.flush();
|
|
1512
|
+
}
|
|
1513
|
+
function A() {
|
|
1514
|
+
p = [], m = null, g = null, v = 0, l.hide(), u.clear(), d.clearTrail(), f.clear(), s([], null), c(0), t.flush();
|
|
1515
|
+
}
|
|
1516
|
+
function j() {
|
|
1517
|
+
A(), _ = null, t.destroy();
|
|
1518
|
+
}
|
|
1519
|
+
return {
|
|
1520
|
+
setRoute: D,
|
|
1521
|
+
onPositionChanged: O,
|
|
1522
|
+
onFloorChanged: k,
|
|
1523
|
+
clearRoute: A,
|
|
1524
|
+
destroy: j
|
|
1525
|
+
};
|
|
1526
|
+
}
|
|
1527
|
+
//#endregion
|
|
1528
|
+
//#region src/wayfinding/renderer/layerManager.ts
|
|
1529
|
+
function dn(e) {
|
|
1530
|
+
let t = e.scene;
|
|
1531
|
+
if (!t) throw Error("renderer: rendererService.scene is null — start RendererService before constructing renderer");
|
|
1532
|
+
let n = t.rootLayer.children, r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
|
|
1533
|
+
return {
|
|
1534
|
+
touchedLayers: i,
|
|
1535
|
+
resolveLayer(e) {
|
|
1536
|
+
let t = r.get(e);
|
|
1537
|
+
if (t) return t;
|
|
1538
|
+
let i = n.find((t) => t.name === e);
|
|
1539
|
+
if (!i) throw Error(`renderer: layer "${e}" not found in scene`);
|
|
1540
|
+
return r.set(e, i), i;
|
|
1541
|
+
},
|
|
1542
|
+
touchLayer(e) {
|
|
1543
|
+
let t = this.resolveLayer(e);
|
|
1544
|
+
return i.set(e, t), t;
|
|
1545
|
+
},
|
|
1546
|
+
flush() {
|
|
1547
|
+
if (i.size !== 0) {
|
|
1548
|
+
for (let e of i.values()) e.children = [...e.children];
|
|
1549
|
+
e.update(...i.values()), i.clear();
|
|
1550
|
+
}
|
|
1551
|
+
},
|
|
1552
|
+
destroy() {
|
|
1553
|
+
i.clear(), r.clear();
|
|
1554
|
+
}
|
|
1555
|
+
};
|
|
1556
|
+
}
|
|
1557
|
+
//#endregion
|
|
1558
|
+
//#region src/wayfinding/renderer/iconManager.ts
|
|
1559
|
+
function fn(e, t) {
|
|
1560
|
+
let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
|
|
1561
|
+
function a(e, t) {
|
|
1562
|
+
return t === void 0 ? e : `${e}#${t}`;
|
|
1563
|
+
}
|
|
1564
|
+
function o(e, t) {
|
|
1565
|
+
let n = r.get(e);
|
|
1566
|
+
n || (n = /* @__PURE__ */ new Set(), r.set(e, n)), n.add(t), i.set(t, e);
|
|
1567
|
+
}
|
|
1568
|
+
function s(e) {
|
|
1569
|
+
let t = i.get(e);
|
|
1570
|
+
if (!t) return;
|
|
1571
|
+
let n = r.get(t);
|
|
1572
|
+
n && n.delete(e), i.delete(e);
|
|
1573
|
+
}
|
|
1574
|
+
function c(r, i, a) {
|
|
1575
|
+
var s, c, l;
|
|
1576
|
+
let d = e.touchLayer(a.layer), f = u(a.canvas, C(a.x, a.y, a.canvas.width, a.canvas.height, t.scale, a.rotation), {
|
|
1577
|
+
hidden: (s = a.hidden) == null ? !1 : s,
|
|
1578
|
+
dim: (c = a.dimmed) == null ? !1 : c,
|
|
1579
|
+
origin: a.origin
|
|
1580
|
+
});
|
|
1581
|
+
d.children.push(f), t.onPtScale(r, (e) => {
|
|
1582
|
+
let t = n.get(r);
|
|
1583
|
+
if (!(!t || t.imageDef.hidden)) return t.imageDef.bounds = C(t.imageDef.bounds.center.x, t.imageDef.bounds.center.y, t.imageDef.source.width, t.imageDef.source.height, e, t.imageDef.bounds.rotation), t.imageDef;
|
|
1584
|
+
}), a.cardinalSnap && t.onRoll(r, (e) => {
|
|
1585
|
+
let t = n.get(r);
|
|
1586
|
+
if (!t) return;
|
|
1587
|
+
let i = E(e, t.imageDef.bounds.rotation);
|
|
1588
|
+
if (i !== void 0) return t.imageDef.bounds.rotation += i, t.imageDef;
|
|
1589
|
+
});
|
|
1590
|
+
let p = {
|
|
1591
|
+
imageDef: f,
|
|
1592
|
+
layerName: a.layer,
|
|
1593
|
+
callback: (l = a.onClick) == null ? null : l
|
|
1594
|
+
};
|
|
1595
|
+
return n.set(r, p), o(i, r), p;
|
|
1596
|
+
}
|
|
1597
|
+
function l(r, i, a, o) {
|
|
1598
|
+
let l = e.resolveLayer(a.layerName), u = l.children, d = u.indexOf(a.imageDef);
|
|
1599
|
+
d >= 0 && u.splice(d, 1), e.touchedLayers.set(a.layerName, l), t.ptScaleRegistry.unregisterByName(r), t.rollRegistry.unregisterByName(r), n.delete(r), s(r), c(r, i, o);
|
|
1600
|
+
}
|
|
1601
|
+
function d(n, r, i, a) {
|
|
1602
|
+
var o, s, c;
|
|
1603
|
+
if (i.layerName !== a.layer) throw Error(`renderer: icon "${n}" cannot move between layers (was "${i.layerName}", got "${a.layer}")`);
|
|
1604
|
+
if (i.imageDef.source !== a.canvas) {
|
|
1605
|
+
l(n, r, i, a);
|
|
1606
|
+
return;
|
|
1607
|
+
}
|
|
1608
|
+
i.imageDef.bounds = C(a.x, a.y, a.canvas.width, a.canvas.height, t.scale, a.rotation), i.imageDef.hidden = (o = a.hidden) == null ? !1 : o, i.imageDef.dim = (s = a.dimmed) == null ? !1 : s, i.callback = (c = a.onClick) == null ? null : c, e.touchLayer(a.layer);
|
|
1609
|
+
}
|
|
1610
|
+
return {
|
|
1611
|
+
setIcon(t, r, i) {
|
|
1612
|
+
let o = a(t, i);
|
|
1613
|
+
if (r === null) {
|
|
1614
|
+
let t = n.get(o);
|
|
1615
|
+
t && (t.imageDef.hidden = !0, t.callback = null, e.touchLayer(t.layerName));
|
|
1616
|
+
return;
|
|
1617
|
+
}
|
|
1618
|
+
let s = n.get(o);
|
|
1619
|
+
s ? d(o, t, s, r) : c(o, t, r);
|
|
1620
|
+
},
|
|
1621
|
+
clearIcons(t) {
|
|
1622
|
+
let i = typeof t == "string" ? [t] : t;
|
|
1623
|
+
for (let t of i) {
|
|
1624
|
+
let i = r.get(t);
|
|
1625
|
+
if (i) for (let t of i) {
|
|
1626
|
+
let r = n.get(t);
|
|
1627
|
+
r && (r.imageDef.hidden = !0, r.callback = null, e.touchLayer(r.layerName));
|
|
1628
|
+
}
|
|
1629
|
+
}
|
|
1630
|
+
},
|
|
1631
|
+
hideAll() {
|
|
1632
|
+
for (let t of n.values()) t.imageDef.hidden = !0, t.callback = null, e.touchedLayers.set(t.layerName, e.resolveLayer(t.layerName));
|
|
1633
|
+
},
|
|
1634
|
+
destroy() {
|
|
1635
|
+
for (let e of n.keys()) t.ptScaleRegistry.unregisterByName(e), t.rollRegistry.unregisterByName(e);
|
|
1636
|
+
n.clear(), r.clear(), i.clear();
|
|
1637
|
+
},
|
|
1638
|
+
handleClick({ data: e }) {
|
|
1639
|
+
let { defs: t } = P(e);
|
|
1640
|
+
for (let e of n.values()) if (e.callback && !e.imageDef.hidden && t.includes(e.imageDef)) {
|
|
1641
|
+
e.callback();
|
|
1642
|
+
return;
|
|
1643
|
+
}
|
|
1644
|
+
},
|
|
1645
|
+
handleHover({ data: e }) {
|
|
1646
|
+
let r = t.renderer;
|
|
1647
|
+
if (!r) return;
|
|
1648
|
+
let { defs: i } = P(e), a = !1;
|
|
1649
|
+
for (let e of n.values()) if (e.callback && !e.imageDef.hidden && i.includes(e.imageDef)) {
|
|
1650
|
+
a = !0;
|
|
1651
|
+
break;
|
|
1652
|
+
}
|
|
1653
|
+
r.canvas.style.cursor = a ? "pointer" : "";
|
|
1654
|
+
}
|
|
1655
|
+
};
|
|
1656
|
+
}
|
|
1657
|
+
//#endregion
|
|
1658
|
+
//#region src/wayfinding/renderer/trailManager.ts
|
|
1659
|
+
var pn = 40;
|
|
1660
|
+
function mn(e, t) {
|
|
1661
|
+
let n = /* @__PURE__ */ new Map();
|
|
1662
|
+
function r(e) {
|
|
1663
|
+
return `trail#${e}`;
|
|
1664
|
+
}
|
|
1665
|
+
function i(t) {
|
|
1666
|
+
if (!t.dotDefs.length) return;
|
|
1667
|
+
let n = e.touchLayer(t.layerName), r = new Set(t.dotDefs);
|
|
1668
|
+
n.children = n.children.filter((e) => !r.has(e)), t.dotDefs = [];
|
|
1669
|
+
}
|
|
1670
|
+
function a(n) {
|
|
1671
|
+
let r = e.touchLayer(n.layerName), a = t.scale, o = pn * a, s = _(n.from, n.to, o), c = n.canvas, l = s.map((e) => u(c, C(e.x, e.y, c.width, c.height, a)));
|
|
1672
|
+
i(n), r.children.push(...l), n.dotDefs = l;
|
|
1673
|
+
}
|
|
1674
|
+
function o(e) {
|
|
1675
|
+
let a = n.get(e);
|
|
1676
|
+
a && (i(a), t.ptScaleRegistry.unregisterByName(r(e)), n.delete(e));
|
|
1677
|
+
}
|
|
1678
|
+
return {
|
|
1679
|
+
setTrail(i, s, c, l) {
|
|
1680
|
+
if (s === null || c === null) {
|
|
1681
|
+
o(i);
|
|
1682
|
+
return;
|
|
1683
|
+
}
|
|
1684
|
+
if (!l) throw Error(`renderer: setTrail("${i}") requires options when from/to are non-null`);
|
|
1685
|
+
let u = n.get(i);
|
|
1686
|
+
if (u) {
|
|
1687
|
+
if (u.canvas !== l.canvas || u.layerName !== l.layer) throw Error(`renderer: trail "${i}" cannot change canvas or layer after first call`);
|
|
1688
|
+
u.from = s, u.to = c, a(u);
|
|
1689
|
+
return;
|
|
1690
|
+
}
|
|
1691
|
+
let d = {
|
|
1692
|
+
from: s,
|
|
1693
|
+
to: c,
|
|
1694
|
+
canvas: l.canvas,
|
|
1695
|
+
layerName: l.layer,
|
|
1696
|
+
dotDefs: []
|
|
1697
|
+
};
|
|
1698
|
+
n.set(i, d), t.onPtScale(r(i), () => (a(d), e.touchLayer(d.layerName))), a(d);
|
|
1699
|
+
},
|
|
1700
|
+
destroy() {
|
|
1701
|
+
for (let e of [...n.keys()]) o(e);
|
|
1702
|
+
}
|
|
1703
|
+
};
|
|
1704
|
+
}
|
|
1705
|
+
//#endregion
|
|
1706
|
+
//#region src/renderer/engine-core/animation.ts
|
|
1707
|
+
function hn(e, t, n, r = 0) {
|
|
1708
|
+
let i = 0, a = 0, o = null, s = null;
|
|
1709
|
+
if (!e.length) return;
|
|
1710
|
+
let c = e.map((e) => {
|
|
1711
|
+
let t = e.points[1].x - e.points[0].x, n = e.points[1].y - e.points[0].y;
|
|
1712
|
+
return Math.sqrt(t * t + n * n);
|
|
1713
|
+
}), l = c.reduce((e, t) => e + t, 0), u = Math.max(20, Math.min(l / 2, 300));
|
|
1714
|
+
function d(e) {
|
|
1715
|
+
let t = e % 1 * l, n = 0;
|
|
1716
|
+
i = 0, a = 0;
|
|
1717
|
+
for (let e = 0; e < c.length; e++) {
|
|
1718
|
+
if (n + c[e] > t) {
|
|
1719
|
+
i = e, a = t - n;
|
|
1720
|
+
break;
|
|
1721
|
+
}
|
|
1722
|
+
n += c[e], e === c.length - 1 && (i = 0, a = 0);
|
|
1723
|
+
}
|
|
1724
|
+
}
|
|
1725
|
+
function f(e, t) {
|
|
1726
|
+
let n = e.points[0], r = e.points[1], i = r.x - n.x, a = r.y - n.y, o = Math.sqrt(i * i + a * a), s = Math.min(t / o, 1);
|
|
1727
|
+
return {
|
|
1728
|
+
points: [{
|
|
1729
|
+
x: n.x,
|
|
1730
|
+
y: n.y
|
|
1731
|
+
}, {
|
|
1732
|
+
x: n.x + i * s,
|
|
1733
|
+
y: n.y + a * s
|
|
1734
|
+
}],
|
|
1735
|
+
color: e.color,
|
|
1736
|
+
width: e.width
|
|
1737
|
+
};
|
|
1738
|
+
}
|
|
1739
|
+
function p(r) {
|
|
1740
|
+
o || (o = r);
|
|
1741
|
+
let l = (r - o) / 1e3;
|
|
1742
|
+
o = r;
|
|
1743
|
+
let d = n(), m = u * Math.sqrt(d);
|
|
1744
|
+
for (a += m * l; a >= c[i];) a -= c[i], i++, i >= e.length && (i = 0);
|
|
1745
|
+
let h = e[i];
|
|
1746
|
+
t(f(h, a), i, !1), s = requestAnimationFrame(p);
|
|
1747
|
+
}
|
|
1748
|
+
function m() {
|
|
1749
|
+
h(), r <= 0 && (i = 0, a = 0), o = null, s = requestAnimationFrame(p);
|
|
1750
|
+
}
|
|
1751
|
+
function h() {
|
|
1752
|
+
s && (cancelAnimationFrame(s), s = null, o = null);
|
|
1753
|
+
}
|
|
1754
|
+
function g() {
|
|
1755
|
+
if (l <= 0) return 0;
|
|
1756
|
+
let e = 0;
|
|
1757
|
+
for (let t = 0; t < i; t++) e += c[t];
|
|
1758
|
+
return e += a, e / l;
|
|
1759
|
+
}
|
|
1760
|
+
function _() {
|
|
1761
|
+
document.visibilityState === "visible" ? m() : h();
|
|
1762
|
+
}
|
|
1763
|
+
return r > 0 && d(r), document.addEventListener("visibilitychange", _), m(), {
|
|
1764
|
+
stop: () => {
|
|
1765
|
+
h(), document.removeEventListener("visibilitychange", _);
|
|
1766
|
+
},
|
|
1767
|
+
getProgress: g
|
|
1768
|
+
};
|
|
1769
|
+
}
|
|
1770
|
+
//#endregion
|
|
1771
|
+
//#region src/wayfinding/renderer/routeLineManager.ts
|
|
1772
|
+
function gn(e, t, n) {
|
|
1773
|
+
let r = null, i = null, a = null;
|
|
1774
|
+
return {
|
|
1775
|
+
setRouteLines(o, s, c) {
|
|
1776
|
+
var l, u;
|
|
1777
|
+
let d = e.touchLayer(c.linesLayer), f = e.touchLayer(c.animatedLinesLayer);
|
|
1778
|
+
i = d, a = f;
|
|
1779
|
+
let p = (l = c.resetAnimation) == null ? !0 : l, m = 0;
|
|
1780
|
+
r && (p || (m = r.getProgress()), r.stop(), r = null);
|
|
1781
|
+
let h = o.map((e) => D(e, n.passed)), g = s.map((e) => D(e, n.remaining));
|
|
1782
|
+
if (d.children = [...h, ...g], !g.length) {
|
|
1783
|
+
f.children = [];
|
|
1784
|
+
return;
|
|
1785
|
+
}
|
|
1786
|
+
let _ = g.map((e) => ({
|
|
1787
|
+
...e,
|
|
1788
|
+
color: n.active
|
|
1789
|
+
}));
|
|
1790
|
+
r = (u = hn(_, (e, n, r) => {
|
|
1791
|
+
f.children = r ? [] : [..._.slice(0, n), e], t.update(f);
|
|
1792
|
+
}, () => t.scale, m)) == null ? null : u;
|
|
1793
|
+
},
|
|
1794
|
+
clearLines() {
|
|
1795
|
+
r && (r.stop(), r = null), i && (i.children = [], e.touchedLayers.set(i.name, i)), a && (a.children = [], e.touchedLayers.set(a.name, a));
|
|
1796
|
+
},
|
|
1797
|
+
destroy() {
|
|
1798
|
+
this.clearLines();
|
|
1799
|
+
}
|
|
1800
|
+
};
|
|
1801
|
+
}
|
|
1802
|
+
//#endregion
|
|
1803
|
+
//#region src/wayfinding/renderer/createWayfindingRenderer.ts
|
|
1804
|
+
var _n = {
|
|
1805
|
+
passed: "#B5B7BC",
|
|
1806
|
+
remaining: "#A4CCE2",
|
|
1807
|
+
active: "#0794EA"
|
|
1808
|
+
};
|
|
1809
|
+
function vn(e, t = {}) {
|
|
1810
|
+
let n = {
|
|
1811
|
+
..._n,
|
|
1812
|
+
...t.colors
|
|
1813
|
+
}, r = dn(e), i = fn(r, e), a = mn(r, e), o = gn(r, e, n), s = e.renderer;
|
|
1814
|
+
if (!s) throw Error("renderer: rendererService.renderer is null — start RendererService before constructing renderer");
|
|
1815
|
+
s.events.addEventListener("pointer:click", i.handleClick), s.events.addEventListener("pointer:move", i.handleHover);
|
|
1816
|
+
let c = {
|
|
1817
|
+
setIcon: i.setIcon,
|
|
1818
|
+
clearIcons: i.clearIcons,
|
|
1819
|
+
setTrail: a.setTrail,
|
|
1820
|
+
setRouteLines: o.setRouteLines,
|
|
1821
|
+
clearRoute() {
|
|
1822
|
+
o.clearLines(), a.destroy(), i.hideAll();
|
|
1823
|
+
},
|
|
1824
|
+
flush: r.flush,
|
|
1825
|
+
destroy() {
|
|
1826
|
+
c.clearRoute();
|
|
1827
|
+
let t = e.renderer;
|
|
1828
|
+
t && (t.events.removeEventListener("pointer:click", i.handleClick), t.events.removeEventListener("pointer:move", i.handleHover)), i.destroy(), a.destroy(), o.destroy(), r.destroy();
|
|
1829
|
+
}
|
|
1830
|
+
};
|
|
1831
|
+
return c;
|
|
1832
|
+
}
|
|
1833
|
+
//#endregion
|
|
1834
|
+
//#region src/wayfinding/createWayfinding.ts
|
|
1835
|
+
function yn(e) {
|
|
1836
|
+
var t, n;
|
|
1837
|
+
let r = A(b), i = de({
|
|
1838
|
+
iconMap: F.fp.icons,
|
|
1839
|
+
pixelRatio: devicePixelRatio
|
|
1840
|
+
}), a = vn(e), o = T(N, F.routeStore), s = {
|
|
1841
|
+
points: fe,
|
|
1842
|
+
trail: pe,
|
|
1843
|
+
lines: me,
|
|
1844
|
+
linesAnimated: he
|
|
1845
|
+
}, c = un({
|
|
1846
|
+
engine: r,
|
|
1847
|
+
renderer: a,
|
|
1848
|
+
iconProvider: i,
|
|
1849
|
+
floorContext: o,
|
|
1850
|
+
layers: s,
|
|
1851
|
+
snapThreshold: k({
|
|
1852
|
+
thresholdInMeters: m(I == null || (t = I.properties) == null || (t = t.config) == null ? void 0 : t.snapThreshold) || 7.5,
|
|
1853
|
+
gpsConfig: I == null || (n = I.properties) == null ? void 0 : n.config
|
|
1854
|
+
}),
|
|
1855
|
+
onTransitionClick: (e) => {
|
|
1856
|
+
e.role === "exit" && N.updateVisibility(e.targetLayer, !0);
|
|
1857
|
+
},
|
|
1858
|
+
onRouteUpdate: (e, t) => {
|
|
1859
|
+
if (F.routeStore.updateRoute(e), t) {
|
|
1860
|
+
let e = t.x2 - t.x1, n = t.y2 - t.y1;
|
|
1861
|
+
L.moveToRect = z.fromX1y1x2y2(t.x1, t.y1, t.x2, t.y2).withPadding(e, n);
|
|
1862
|
+
}
|
|
1863
|
+
},
|
|
1864
|
+
onRouteDistance: (e) => F.routeStore.updateRouteDistance(e)
|
|
1865
|
+
}), l = Wt({
|
|
1866
|
+
runtime: c,
|
|
1867
|
+
kioskHandler: qt({
|
|
1868
|
+
renderer: a,
|
|
1869
|
+
kioskIconMap: F.fp.icons,
|
|
1870
|
+
layer: s.points
|
|
1871
|
+
}),
|
|
1872
|
+
yahHandler: Yt({
|
|
1873
|
+
renderer: a,
|
|
1874
|
+
iconProvider: i,
|
|
1875
|
+
floorContext: o,
|
|
1876
|
+
layer: s.points
|
|
1877
|
+
}),
|
|
1878
|
+
stores: {
|
|
1879
|
+
routeStore: F.routeStore,
|
|
1880
|
+
uiState: L,
|
|
1881
|
+
layerStore: N
|
|
1882
|
+
}
|
|
1883
|
+
});
|
|
1884
|
+
return a.flush(), () => {
|
|
1885
|
+
l(), c.destroy();
|
|
1886
|
+
};
|
|
1887
|
+
}
|
|
1888
|
+
//#endregion
|
|
1889
|
+
export { Pt as a, Ze as c, Nt as i, ve as l, Ut as n, vt as o, jt as r, ct as s, yn as t, ye as u };
|