@expofp/floorplan 3.18.0 → 3.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/dist/browser/{Button-CR9X3hHB.js → Button-CSjGwCw8.js} +5 -5
  2. package/dist/browser/{CookieConsent-BWKzA_Db.js → CookieConsent-DoKq6i8L.js} +7 -7
  3. package/dist/browser/{Debug-CElPDJlB.js → Debug-5zEiNUyg.js} +7 -7
  4. package/dist/browser/{Demo-DpzdTNuZ.js → Demo-gYGSSAX-.js} +9 -9
  5. package/dist/browser/{Free-Dzj0kezR.js → Free-3I9CaGED.js} +9 -9
  6. package/dist/browser/{Gallery-BFh_yQY4.js → Gallery-DvczhcFU.js} +9 -9
  7. package/dist/browser/{GpsLoader-PkypWxTl.js → GpsLoader-CkmCme_P.js} +22 -22
  8. package/dist/browser/{KioskStore-Cwuze3X_.js → KioskStore-Dkc03BJk.js} +7 -7
  9. package/dist/browser/{MaplibreAdapter-CXm_wkcT.js → MaplibreAdapter-DRlvaZ7C.js} +2276 -2031
  10. package/dist/browser/{ModalContainer-qMMdrK2w.js → ModalContainer-h3TovgWF.js} +10 -10
  11. package/dist/browser/{PermissionNotice-zHHL-Tb1.js → PermissionNotice-B8j8TR_D.js} +6 -6
  12. package/dist/browser/{SetKioskMode-NJzx1LsZ.js → SetKioskMode-C4NKwotU.js} +11 -11
  13. package/dist/browser/{ShowKiosk-JTxQ22h-.js → ShowKiosk-BBmrToaF.js} +12 -12
  14. package/dist/browser/{TouchHand-B1_sEZ0y.js → TouchHand-DRif3YH_.js} +4 -4
  15. package/dist/browser/{ViewerMenuPanel-CStYkINl.js → ViewerMenuPanel-YpBiORHt.js} +10 -10
  16. package/dist/browser/{add-debug-secret-listener-CLwgmFlw.js → add-debug-secret-listener-CFqwaslU.js} +1 -1
  17. package/dist/browser/{adopt-global-settings-DNtTKtHp.js → adopt-global-settings-B0JmlKXZ.js} +9 -9
  18. package/dist/browser/{boolean-editor-DU3YVPQz.js → boolean-editor-XhzKDQsF.js} +9 -9
  19. package/dist/browser/{bootIntercom-C3p3aQE4.js → bootIntercom-CL4Wwt09.js} +2 -2
  20. package/dist/browser/booth-by-xy-CNodwywv.js +1130 -0
  21. package/dist/browser/bundle.json +66 -66
  22. package/dist/browser/{classnames-DsyabRET.js → classnames-D7bHkaTv.js} +2 -2
  23. package/dist/browser/{client-BtftV096.js → client-FmZunq3E.js} +4 -4
  24. package/dist/browser/{components-BWMM8EM8.js → components-BxYu3VSQ.js} +456 -452
  25. package/dist/browser/{debug-overlay-D3Y5V71i.js → debug-overlay-Col3kun-.js} +10 -10
  26. package/dist/browser/{debug-ui-DLVYgylj.js → debug-ui-DP-m_PQY.js} +6 -6
  27. package/dist/browser/{dist-DDo1tPsx.js → dist--UfxHNpB.js} +6 -6
  28. package/dist/browser/{dist-BXb1cx9e.js → dist-DKuVdnM1.js} +5 -5
  29. package/dist/browser/{dist-CfgFWfr7.js → dist-j_Dvhg_B.js} +3 -3
  30. package/dist/browser/{efp-debug-init-C07vji2o.js → efp-debug-init-DLVidU_L.js} +3 -3
  31. package/dist/browser/{enum-editor-CQB7Ql3U.js → enum-editor-Cl34zB7v.js} +4 -4
  32. package/dist/browser/{es5-ijKSUeQ7.js → es5-vcEukkmw.js} +2 -2
  33. package/dist/browser/{event-not-found-BwyzoaLT.js → event-not-found-ChZDmcvK.js} +1 -1
  34. package/dist/browser/{exports-Ci3Y-h6M.js → exports-BXJy6Kmw.js} +1 -1
  35. package/dist/browser/{favicon-BGu3h_Jd.js → favicon-_NCvfFvc.js} +1 -1
  36. package/dist/browser/{fetch-retry.umd-DPsRRR-2.js → fetch-retry.umd-3LUIAd6l.js} +2 -2
  37. package/dist/browser/{flex-pSz169Ur.js → flex-DzUPTjql.js} +5 -5
  38. package/dist/browser/{floorplan.loader-C6QTWa65.js → floorplan.loader-Cq6lnFlH.js} +10 -10
  39. package/dist/browser/{floorplan.ready-CAzapBXm.js → floorplan.ready-CVvdDLK9.js} +78 -78
  40. package/dist/browser/{fuse-DtxL2N-V.js → fuse-DFMgyIxf.js} +2 -2
  41. package/dist/browser/{i18n-DVyODyCY.js → i18n-DWMPMvpq.js} +729 -724
  42. package/dist/browser/index.js +28 -28
  43. package/dist/browser/{index.module-Cvt_te8N.js → index.module-CwWKL3qT.js} +4 -4
  44. package/dist/browser/{integrateKiosk-d8rib-aX.js → integrateKiosk-DDctkdW5.js} +4 -4
  45. package/dist/browser/{is-webview-DdTBb7TJ.js → is-webview-Dh3BOm5s.js} +1 -1
  46. package/dist/browser/{jsx-runtime-DaJp0rHj.js → jsx-runtime-BT-4UVZK.js} +2 -2
  47. package/dist/browser/{kiosk-record-CKAUCVLy.js → kiosk-record-DAkjgI5d.js} +1 -1
  48. package/dist/browser/{lib-DJccgJUD.js → lib-DSN5rncL.js} +3 -3
  49. package/dist/browser/{loadImage-x0VcWQVd.js → loadImage-6MtT3dR2.js} +4 -4
  50. package/dist/browser/{logDeviceInfo-D0W2-Idq.js → logDeviceInfo-C9v2HsL2.js} +9 -9
  51. package/dist/browser/{main-BPkzidEN.js → main-CGLB-evp.js} +1 -1
  52. package/dist/browser/{mobx-BhywMatw.js → mobx-Dykg-ki-.js} +4 -4
  53. package/dist/browser/{optional-boolean-editor-Mcny_JoC.js → optional-boolean-editor-Ds90tVAe.js} +3 -3
  54. package/dist/browser/{optional-enum-editor-DNJb-HlW.js → optional-enum-editor-DwpbJFlC.js} +4 -4
  55. package/dist/browser/{optional-string-editor-mXHbu-td.js → optional-string-editor-C_MgikTV.js} +4 -4
  56. package/dist/browser/{particles.min-h8plthOJ.js → particles.min-BrRwE_cB.js} +2 -2
  57. package/dist/browser/{react-BtNYeFCj.js → react-D3BZ05ZR.js} +2 -2
  58. package/dist/browser/{react-dom-Cpzv99hV.js → react-dom-hZlmCSGa.js} +3 -3
  59. package/dist/browser/{rolldown-runtime-DISrh_Iz.js → rolldown-runtime-BA6mgZXd.js} +1 -1
  60. package/dist/browser/{select-CUP0HHGg.js → select-D23T81nr.js} +10 -10
  61. package/dist/browser/{settings-vwUDDFWG.js → settings-Br2xGZpf.js} +2 -2
  62. package/dist/browser/{settings-item-EIedbjEy.js → settings-item-uLGrYZVO.js} +6 -6
  63. package/dist/browser/{store-CuOAVnMk.js → store-F1P0xfXS.js} +6605 -6466
  64. package/dist/browser/{string-editor-B5j-wOvD.js → string-editor-Cco_LbQO.js} +4 -4
  65. package/dist/browser/{text-field-C7hImOEM.js → text-field-rxoXlZbL.js} +5 -5
  66. package/dist/browser/{theme--eOt90dH.js → theme-teEFcmm4.js} +8 -8
  67. package/dist/browser/{ui-BbAFe1Un.js → ui-D6A9bSSx.js} +8 -8
  68. package/dist/browser/{useRenderTarget-tyvk_Tnj.js → useRenderTarget-CqdzcoGw.js} +4 -4
  69. package/dist/esm/components/Map/Map.js +1 -1
  70. package/dist/esm/components/Map/drawing/config/canvases.d.ts +9 -0
  71. package/dist/esm/components/Map/drawing/config/canvases.js +1 -1
  72. package/dist/esm/components/Map/drawing/config/config-all.d.ts +6 -3
  73. package/dist/esm/components/Map/drawing/config/config-all.js +1 -1
  74. package/dist/esm/components/Map/drawing/config/config-booth-badge.d.ts +8 -4
  75. package/dist/esm/components/Map/drawing/config/config-booth-badge.js +1 -1
  76. package/dist/esm/components/Map/drawing/config/config-load-layer.js +1 -1
  77. package/dist/esm/components/Map/drawing/config/config-outdoor-poi.d.ts +31 -0
  78. package/dist/esm/components/Map/drawing/config/config-outdoor-poi.js +1 -0
  79. package/dist/esm/components/Maplibre/MaplibreAdapter.js +1 -1
  80. package/dist/esm/components/Maplibre/useCameraReactions.js +1 -1
  81. package/dist/esm/components/Maplibre/useDimming.d.ts +9 -0
  82. package/dist/esm/components/Maplibre/useDimming.js +1 -1
  83. package/dist/esm/components/Maplibre/usePoiMarkers.d.ts +26 -0
  84. package/dist/esm/components/Maplibre/usePoiMarkers.js +1 -0
  85. package/dist/esm/components/Maplibre/useRendererEvents.js +1 -1
  86. package/dist/esm/components/Maplibre/utils/geo-config.d.ts +2 -0
  87. package/dist/esm/components/Maplibre/utils/geo-config.js +1 -1
  88. package/dist/esm/components/Maplibre/utils/poi-marker-hit-test.d.ts +16 -0
  89. package/dist/esm/components/Maplibre/utils/poi-marker-hit-test.js +1 -0
  90. package/dist/esm/constants.d.ts +11 -0
  91. package/dist/esm/constants.js +1 -1
  92. package/dist/esm/store/PoiMarkerStore.d.ts +76 -0
  93. package/dist/esm/store/PoiMarkerStore.js +1 -0
  94. package/dist/esm/store/RootStore.d.ts +2 -0
  95. package/dist/esm/store/RootStore.js +1 -1
  96. package/dist/esm/store/outdoor-poi-filter.d.ts +21 -0
  97. package/dist/esm/store/outdoor-poi-filter.js +1 -0
  98. package/package.json +8 -8
  99. package/dist/browser/booth-by-xy-DSMmkHYp.js +0 -1077
@@ -1,1077 +0,0 @@
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.18.0" };
5
- var t = new e.Error().stack;
6
- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "57160234-4def-4812-adcd-bf44dd846430", e._sentryDebugIdIdentifier = "sentry-dbid-57160234-4def-4812-adcd-bf44dd846430");
7
- } catch {}
8
- })();
9
- import { r as e } from "./rolldown-runtime-DISrh_Iz.js";
10
- import { A as t, v as n } from "./i18n-DVyODyCY.js";
11
- import { t as r } from "./react-BtNYeFCj.js";
12
- import { r as i, t as a } from "./loadImage-x0VcWQVd.js";
13
- import { At as o, Bt as s, D as c, Dt as l, E as u, Ft as d, Jt as f, Lt as p, Nt as m, O as h, Ot as g, Pt as _, T as v, Tt as y, Vt as b, _t as x, a as S, an as C, c as w, cn as T, dn as E, fn as D, gn as O, ht as k, in as A, jt as j, k as M, kt as ee, ln as N, mn as te, mt as ne, on as re, pn as ie, s as P, t as F, tn as ae, un as oe, v as se, vt as ce, wt as le } from "./store-CuOAVnMk.js";
14
- //#region src/components/Map/traffic/trafficLayers.ts
15
- var ue = "traffic_route", de = "traffic_route_stop", fe = "traffic_vehicles", pe = "build_route_lines", me = "build_route_dots", he = 5;
16
- function ge() {
17
- let e = [];
18
- for (let t = 0; t < he; t++) e.push({
19
- name: _e(t),
20
- children: []
21
- }), e.push({
22
- name: ve(t),
23
- children: [],
24
- interactive: !0
25
- });
26
- return e.push({
27
- name: fe,
28
- children: [],
29
- interactive: !0
30
- }), e.push({
31
- name: pe,
32
- children: []
33
- }), e.push({
34
- name: me,
35
- children: [],
36
- interactive: !0
37
- }), e;
38
- }
39
- function _e(e) {
40
- return `${ue}_${e + 1}`;
41
- }
42
- function ve(e) {
43
- return `${de}_${e + 1}`;
44
- }
45
- function ye() {
46
- return RegExp(`^${ue}_\\d+$`);
47
- }
48
- function be() {
49
- return RegExp(`^${de}_\\d+$`);
50
- }
51
- //#endregion
52
- //#region src/components/Map/drawing/config/config-booth-badge-eligibility.ts
53
- var xe = /* @__PURE__ */ e(C(), 1);
54
- function Se(e) {
55
- return e.hideExhibitorBoothNumber || e.hideBoothBadges || !e.hasExhibitors ? !1 : e.noLabels || !e.hideLogoInBooth && e.hasLogoInBooth;
56
- }
57
- //#endregion
58
- //#region src/components/Map/drawing/config/config-booth-badge.ts
59
- var Ce = .5, we = .3, I = 15, Te = 24, Ee = 30, De = 12, Oe = .8, ke = document.createElement("canvas").getContext("2d");
60
- function Ae(e) {
61
- return e.length <= I ? e : e.slice(0, I - 1) + "…";
62
- }
63
- function je(e) {
64
- var t, n;
65
- if (!((t = e.paths) != null && t.length)) return [];
66
- let r = ((n = e.layer) == null ? void 0 : n.name) || "", i = [];
67
- for (let t of e.paths) for (let e of ae(t.index, r)) i.push(e);
68
- return i;
69
- }
70
- function Me(e) {
71
- let t = je(e);
72
- return t.length ? T.fromPoints(t.flat().map(([e, t]) => ({
73
- x: e,
74
- y: t
75
- }))) : null;
76
- }
77
- function Ne(e) {
78
- let t = [], n = [];
79
- for (let r of e) {
80
- let e = t.length;
81
- t.push({
82
- x: r[0][0],
83
- y: r[0][1]
84
- }), t.push({
85
- x: r[1][0],
86
- y: r[1][1]
87
- }), t.push({
88
- x: r[2][0],
89
- y: r[2][1]
90
- }), n.push([
91
- e,
92
- e + 1,
93
- e + 2
94
- ]);
95
- }
96
- return new E(t, n);
97
- }
98
- function L(e, t, n) {
99
- return n.containsPoint({
100
- x: e,
101
- y: t
102
- });
103
- }
104
- function Pe(e, t, n, r, i, a, o) {
105
- if (!e.length || !L(n, r, t)) return o;
106
- let s = 0, c = o;
107
- for (let e = 0; e < 10; e++) {
108
- let e = (s + c) / 2, o = i * e, l = a * e;
109
- L(n + o, r, t) && L(n, r + l, t) && L(n + o, r + l, t) ? s = e : c = e;
110
- }
111
- return s;
112
- }
113
- function Fe(e) {
114
- var t;
115
- return (t = Me(e)) == null ? e.rect : t;
116
- }
117
- function Ie(e, t, n, r, i) {
118
- let a = Fe(e);
119
- if (t.length) {
120
- let e = /* @__PURE__ */ new Set(), i = null, o = Infinity;
121
- for (let s of t) for (let t of s) {
122
- let s = `${t[0]},${t[1]}`;
123
- if (e.has(s)) continue;
124
- e.add(s);
125
- let c = t[0] + r, l = t[1] + r;
126
- if (L(c, l, n)) {
127
- let e = c - a.min.x + (l - a.min.y);
128
- e < o && (o = e, i = {
129
- x: c,
130
- y: l
131
- });
132
- }
133
- }
134
- if (i) return i;
135
- }
136
- let o = e.rect.min.x + r, s = e.rect.min.y + r;
137
- return i ? ie({
138
- x: o,
139
- y: s
140
- }, i, e.rect.center) : {
141
- x: o,
142
- y: s
143
- };
144
- }
145
- function R(e) {
146
- return e && e !== "none" ? e : void 0;
147
- }
148
- function Le(e) {
149
- var t;
150
- let n = R(e.borderColor) || R(O.boothBorderColor) || O.colors.booths.default;
151
- return ((t = e.paths) == null ? void 0 : t.length) > 1 && R(e.paths[e.paths.length - 1].color) || n;
152
- }
153
- function Re(e, t) {
154
- var r;
155
- let i = Ae(t.title || t.name), a = Le(t), o = se((0, xe.default)(a).hex()), s = window.devicePixelRatio || 1, c = x();
156
- ke.font = b(Ee, c);
157
- let u = ke.measureText(i).width, d = Math.ceil(u + De * 2), f = (t.borderWidth || F.borderWidth) / 2, p = d * Oe, h = 54 * Oe, _ = (r = t.rotate) == null ? 0 : r, v = t.rect.size.width, y = t.rect.size.height, S = Math.min(v > 0 ? v * Ce / p : Infinity, y > 0 ? y * we / h : Infinity), C = je(t), w = Ne(C), { x: T, y: E } = Ie(t, C, w, f, _), D = Pe(C, w, T, E, p, h, S), O = (e, t) => {
158
- let n = e / 2, r = t / 2;
159
- return new oe(ie({
160
- x: T + n,
161
- y: E + r
162
- }, _, {
163
- x: T,
164
- y: E
165
- }), {
166
- x: e,
167
- y: t
168
- }, _);
169
- }, k = (e) => {
170
- let t = Math.min(e, D);
171
- return O(p * t, h * t);
172
- }, A = ce(c, e.fontUrls), j = l(O(1, 1), a);
173
- j.hidden = !0, j.dim = !t.skipDim && void 0;
174
- let M = g(ee([[i], []], o, 0, [A, A]), O(1, 1), [0, 0], {
175
- horizontal: "center",
176
- vertical: "center"
177
- });
178
- M.hidden = !0, M.dim = !t.skipDim && void 0;
179
- let N = () => !!(t.layer && !t.layer.visible);
180
- return n(() => t.skipDim, (t) => {
181
- j.dim = !t && void 0, M.dim = !t && void 0, e.update(j, M);
182
- }), n(() => {
183
- var e, n;
184
- return (e = (n = t.layer) == null ? void 0 : n.visible) == null || e;
185
- }, (t) => {
186
- j.hidden = !t, M.hidden = !t, e.update(j, M);
187
- }), e.onPtScale(`badge-bg-${t.id}`, (e) => (j.shape = m(k(e)), j.hidden = N(), j)), e.onPtScale(`badge-text-${t.id}`, (e) => {
188
- let t = Math.min(e, D);
189
- return M.lines[0].fontSize = Te / s * t, M.bounds = m(k(e)), M.hidden = N(), M;
190
- }), {
191
- bg: j,
192
- text: M
193
- };
194
- }
195
- function ze(e, t, n) {
196
- let r = [], i = [];
197
- for (let t of n) if (t instanceof f && Se({
198
- hideExhibitorBoothNumber: A.hideExhibitorBoothNumber,
199
- hideBoothBadges: A.hideBoothBadges,
200
- hideLogoInBooth: w.hideLogoInBooth,
201
- noLabels: t.noLabels,
202
- hasExhibitors: t.exhibitors.length > 0,
203
- hasLogoInBooth: t.exhibitors.some((e) => e.logoInBooth && e.logo)
204
- })) {
205
- let { bg: n, text: a } = Re(e, t);
206
- r.push(n), i.push(a);
207
- }
208
- return r.length ? {
209
- name: `${t}:badges`,
210
- children: [{
211
- name: `${t}:badgeBgs`,
212
- children: r
213
- }, {
214
- name: `${t}:badgeTexts`,
215
- children: i
216
- }]
217
- } : null;
218
- }
219
- //#endregion
220
- //#region src/components/Map/drawing/config/config-markers.ts
221
- var Be = "_selected", Ve = "markers";
222
- function He(e) {
223
- let t = [], r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = [], o = e.scene.rootLayer.children.find((e) => e.name === Ve);
224
- async function c(e) {
225
- let t = [];
226
- e.forEach((e) => {
227
- let { name: n, content: i, width: a, height: o, scale: s } = e;
228
- if (r.has(n)) return;
229
- let c = new Image(), l = new Promise((e, t) => {
230
- c.onload = () => {
231
- r.set(n, {
232
- img: c,
233
- width: a,
234
- height: o,
235
- scale: s
236
- }), e();
237
- }, c.onerror = (e) => {
238
- t(e);
239
- };
240
- });
241
- t.push(l), c.src = i, c.crossOrigin = "anonymous";
242
- }), await Promise.all(t);
243
- }
244
- let l = (e) => `marker-ptScaleHandlers-${e.id}`, u = (e) => `marker-rollHandlers-${e.id}`, f = (t, n) => {
245
- e.onPtScale(n, (e) => {
246
- let { center: n, rotation: r } = t.bounds, { width: i, height: a } = t.source;
247
- return t.bounds = m(d(n.x, n.y, i, a, e, r)), t;
248
- });
249
- }, p = (t, n) => {
250
- e.onRoll(n, (e) => (t.bounds.rotation = e, t));
251
- };
252
- function h() {
253
- let t = P.routeStore.markersData.markers;
254
- if (!t.length) return;
255
- a = [];
256
- let n = e.scale, c = te(e.angle);
257
- t.forEach((e) => {
258
- var t, o;
259
- let l = r.get(e.icon);
260
- if (!l) return;
261
- let u = l.scale || window.devicePixelRatio, f = e.icon;
262
- if (!i.has(f)) {
263
- let e = s(l.img, l.width, l.height, u);
264
- i.set(f, e);
265
- }
266
- let p = i.get(f), m = r.get(e.selectedIcon), h = e.selectedIcon;
267
- if (!i.has(h)) {
268
- let e = s(m.img, m.width, m.height, u);
269
- i.set(h, e);
270
- }
271
- let g = i.get(h), _ = (t = (o = S.findLayer(e.z)) == null ? void 0 : o.visible) == null || t, v = d(e.x, e.y, p.width, p.height, n, c), y = d(e.x, e.y, g.width, g.height, n, c), b;
272
- switch (e.position) {
273
- case "lefttop":
274
- b = [0, 0];
275
- break;
276
- case "centertop":
277
- b = [.5, 0];
278
- break;
279
- case "centerbottom":
280
- b = [.5, 1];
281
- break;
282
- default: b = [.5, .5];
283
- }
284
- let x = {
285
- ...le(p, v, {
286
- hidden: !_,
287
- origin: b
288
- }),
289
- id: e.id,
290
- scale: u
291
- }, C = {
292
- ...le(g, y, {
293
- hidden: !(_ && e.active),
294
- origin: b
295
- }),
296
- id: `${e.id}${Be}`,
297
- scale: u
298
- };
299
- a.push(x, C);
300
- }), o.children = a, a.forEach((e) => {
301
- f(e, l(e)), p(e, u(e));
302
- });
303
- }
304
- function g() {
305
- a.forEach((t) => {
306
- e.ptScaleRegistry.unregisterByName(l(t)), e.rollRegistry.unregisterByName(u(t));
307
- }), o.children = [], a = [];
308
- }
309
- function _() {
310
- let e = P.routeStore.markersData.markers;
311
- e.length && e.forEach((e) => {
312
- var t, n;
313
- let r = a.find((t) => t.id === e.id), i = a.find((t) => t.id === `${e.id}${Be}`);
314
- if (!r) return;
315
- let o = (t = (n = S.findLayer(e.z)) == null ? void 0 : n.visible) == null || t;
316
- e.active ? (r.hidden = !0, i.hidden = !(o && e.active)) : (r.hidden = !o, i.hidden = !0);
317
- });
318
- }
319
- return t.push(n(() => [P.routeStore.selectedMarkers, P.layerStore.visible], () => {
320
- if (!P.routeStore.markersData.markers.length) {
321
- g(), e.update(o);
322
- return;
323
- }
324
- _(), e.update(...a);
325
- })), t.push(n(() => P.routeStore.markersData.markers, () => {
326
- c(P.routeStore.markersData.icons).then(() => {
327
- h(), e.update(o);
328
- });
329
- }, { fireImmediately: !0 })), function() {
330
- t.forEach((e) => e()), t.length = 0;
331
- };
332
- }
333
- function Ue(e, t, n) {
334
- for (let r of P.routeStore.markersData.markers) {
335
- let i = P.routeStore.markersData.icons.find((e) => e.name === r.icon);
336
- if (!i) continue;
337
- let a = i.width * n * devicePixelRatio, o = i.height * n * devicePixelRatio;
338
- if (We(e, t, r.x, r.y, a, o)) {
339
- let e = P.layerStore.findLayer(r.z);
340
- if (!e || e && e.visible) return r;
341
- }
342
- }
343
- return null;
344
- }
345
- function We(e, t, n, r, i, a) {
346
- return T.fromCenter({
347
- x: n,
348
- y: r
349
- }, {
350
- x: 2 * i,
351
- y: 2 * a
352
- }).containsPoint({
353
- x: e,
354
- y: t
355
- });
356
- }
357
- //#endregion
358
- //#region src/components/Map/drawing/config/config-all.ts
359
- function Ge(e) {
360
- let { layers: t, defaultLayer: n } = P.layerStore;
361
- if (n) {
362
- let e = [].concat(t), r = t.find((e) => e === n), i = t.indexOf(r);
363
- e.splice(i, 1), t = [r].concat(e);
364
- }
365
- let r = t.filter((e) => !e.rootParent).map((t) => k(t, e));
366
- return Promise.all(r).then((t) => {
367
- let n = y(h, [], {
368
- dim: !1,
369
- interactive: !0
370
- }), r = y(c, [], { dim: !1 }), i = y(Ve, []), a = y(M, [], { dim: !1 }), o = y(u, [], { dim: !1 }), s = y(v, [], { dim: !1 }), l = [], d = [];
371
- for (let e of t.flat()) p(e.name) ? (e.dim = !1, d.push(e)) : l.push(e);
372
- let f = ze(e, "root", P.boothStore.booths);
373
- return [
374
- ...l,
375
- ...f ? [f] : [],
376
- ...d,
377
- ...ge(),
378
- i,
379
- a,
380
- r,
381
- o,
382
- n,
383
- s
384
- ];
385
- });
386
- }
387
- //#endregion
388
- //#region src/components/Map/traffic/UpdateQueue.ts
389
- var z = /* @__PURE__ */ e(r(), 1), Ke = class {
390
- constructor() {
391
- this.queue = [], this.isProcessing = !1, this.rafId = null, this.CHUNK_SIZE = 100, this.TIME_BUDGET = 4;
392
- }
393
- add(e) {
394
- this.queue.push(e), this.scheduleProcessing();
395
- }
396
- scheduleProcessing() {
397
- 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) => {
398
- this.processQueue(e);
399
- }));
400
- }
401
- processMicrotaskQueue() {
402
- let e = performance.now(), t = 0;
403
- for (; this.queue.length > 0 && t < this.CHUNK_SIZE;) {
404
- let n = this.queue.shift();
405
- try {
406
- n();
407
- } catch (e) {
408
- console.warn("UpdateQueue task error:", e);
409
- }
410
- if (t++, performance.now() - e > this.TIME_BUDGET) break;
411
- }
412
- this.queue.length > 0 ? Promise.resolve().then(() => this.processMicrotaskQueue()) : this.isProcessing = !1;
413
- }
414
- processQueue(e) {
415
- this.rafId = null;
416
- let t = 0;
417
- for (; this.queue.length > 0 && t < this.CHUNK_SIZE;) {
418
- let n = this.queue.shift();
419
- try {
420
- n();
421
- } catch (e) {
422
- console.warn("UpdateQueue task error:", e);
423
- }
424
- if (t++, performance.now() - e > this.TIME_BUDGET) break;
425
- }
426
- this.queue.length > 0 ? this.rafId = requestAnimationFrame((e) => this.processQueue(e)) : this.isProcessing = !1;
427
- }
428
- destroy() {
429
- this.rafId !== null && (cancelAnimationFrame(this.rafId), this.rafId = null), this.queue = [], this.isProcessing = !1;
430
- }
431
- }, B = 49, V = `hsl(257, 76%, ${B}%)`, qe = `hsl(339.903, 82%, ${B}%)`, Je = `hsl(257, 76%, ${Math.round(B * 1.82)}%)`, H = 4, Ye = H, Xe = "U", Ze = "R", Qe = "S", $e = "P", et = class {
432
- constructor() {
433
- this._state = [[]], this.index = 0, this.pointHashSet = /* @__PURE__ */ new Set(), this.locked = !1, this.storageKey = "expofp_build_route_state", this._selected = 0;
434
- }
435
- get points() {
436
- return this._state[this.index];
437
- }
438
- set points(e) {
439
- this._state.push(e), this.setIndex(), this.save();
440
- }
441
- setIndex() {
442
- this.index = Math.max(this._state.length - 1, 0);
443
- }
444
- genPointHash(e) {
445
- return `${e.x},${e.y}`;
446
- }
447
- add(e) {
448
- let t = this.genPointHash(e);
449
- this.pointHashSet.has(t) || (this.pointHashSet.add(t), this.points = [...this.points, e]);
450
- }
451
- undo() {
452
- this.index && (this._state.pop(), this.setIndex(), this.save(), this.select(this.points.length - 1));
453
- }
454
- execute(e) {
455
- try {
456
- if (this.locked) return;
457
- this.locked = !0, e();
458
- } finally {
459
- requestAnimationFrame(() => {
460
- this.locked = !1;
461
- });
462
- }
463
- }
464
- log(e, t = 12) {
465
- console.log(`%c${e}`, `color: black; font-size: ${t}px; background: LemonChiffon;`);
466
- }
467
- instruct() {
468
- this.log(`How to Build a Route:
469
- Add Point: Click on the map.
470
- Apply Smoothing: Press ${Ze}.
471
- Apply Simplification: Press ${Qe}.
472
- Undo: Press ${Xe}.
473
- Enable/Disable Preview: Press ${$e}.
474
- `, 16);
475
- }
476
- applyChaikinSmoothing(e, t, n) {
477
- let r = [];
478
- if (n >= 1 && e.length >= 2) {
479
- r = [e[0]];
480
- for (let t = 1; t < e.length; t++) {
481
- let i = e[t - 1], a = e[t];
482
- for (let e = 1; e <= n; e++) {
483
- let t = e / (n + 1);
484
- r.push({
485
- x: i.x + (a.x - i.x) * t,
486
- y: i.y + (a.y - i.y) * t
487
- });
488
- }
489
- r.push(a);
490
- }
491
- } else r = e.slice();
492
- for (let e = 0; e < t && !(r.length < 2); e++) {
493
- let e = [{ ...r[0] }];
494
- for (let t = 1; t < r.length; t++) {
495
- let n = r[t - 1], i = r[t];
496
- e.push({
497
- x: .75 * n.x + .25 * i.x,
498
- y: .75 * n.y + .25 * i.y
499
- }), e.push({
500
- x: .25 * n.x + .75 * i.x,
501
- y: .25 * n.y + .75 * i.y
502
- });
503
- }
504
- e.push({ ...r[r.length - 1] }), r = e;
505
- }
506
- return r;
507
- }
508
- applySmoothing() {
509
- this.points.length < 3 || (this.points = this.applyChaikinSmoothing(this.points, 1, 0), this.select(this.points.length - 1));
510
- }
511
- save() {
512
- try {
513
- this.points.length ? sessionStorage.setItem(this.storageKey, JSON.stringify(this.points)) : sessionStorage.removeItem(this.storageKey);
514
- } catch (e) {
515
- console.warn(e);
516
- }
517
- }
518
- restore() {
519
- try {
520
- let e = sessionStorage.getItem(this.storageKey);
521
- if (!e) return;
522
- let t = JSON.parse(e);
523
- if (!Array.isArray(t)) return;
524
- t.forEach((e) => this.add(e)), this.select(this.points.length - 1);
525
- } catch (e) {
526
- console.warn(e);
527
- }
528
- }
529
- topologyPreservingSimplify(e, t) {
530
- if (e.length <= 2) return e.map((e) => ({ ...e }));
531
- let n = (e, t, n) => {
532
- let r = e.x, i = e.y, a = t.x, o = t.y, s = n.x, c = n.y;
533
- return Math.abs((c - o) * r - (s - a) * i + s * o - c * a) / (Math.sqrt((c - o) ** 2 + (s - a) ** 2) || 1e-10);
534
- }, r = (e, t, n, r) => {
535
- let i = N({
536
- p0: e,
537
- p1: t
538
- }, {
539
- p0: n,
540
- p1: r
541
- });
542
- return i !== null && i.onLine1 && i.onLine2;
543
- }, i = Array(e.length).fill(!1);
544
- i[0] = i[i.length - 1] = !0;
545
- let a = [], o = (s, c) => {
546
- if (c <= s + 1) return;
547
- let l = e[s], u = e[c], d = 0, f = 0;
548
- for (let t = s + 1; t < c; t++) {
549
- let r = n(e[t], l, u);
550
- r > d && (d = r, f = t);
551
- }
552
- if (d > t) {
553
- let t = e[f], n = !0;
554
- 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)) {
555
- n = !1;
556
- break;
557
- }
558
- n && (i[f] = !0, o(s, f), o(f, c));
559
- }
560
- };
561
- return o(0, e.length - 1), e.filter((e, t) => i[t]);
562
- }
563
- applySimplification() {
564
- this.points = this.topologyPreservingSimplify(this.points, .5), this.select(this.points.length - 1);
565
- }
566
- get selected() {
567
- return this._selected;
568
- }
569
- select(e) {
570
- this._selected = Math.max(0, Math.min(e, this.points.length - 1));
571
- }
572
- };
573
- function tt({ enabled: e, rendererService: t }) {
574
- let n = (0, z.useRef)(!1), r = (0, z.useRef)(), i = (0, z.useMemo)(() => _(H, V), []), a = (0, z.useMemo)(() => _(H, qe), []), s = (0, z.useMemo)(() => new et(), []), c = (0, z.useRef)(new Ke()), l = (0, z.useMemo)(() => {
575
- if (!t.scene) return {};
576
- let e = t.scene.rootLayer.children;
577
- return {
578
- linesLayer: e.find((e) => e.name === pe),
579
- pointsLayer: e.find((e) => e.name === me)
580
- };
581
- }, [t.scene]), u = (0, z.useCallback)(() => {
582
- if (!(t != null && t.renderer) || !l || !i || !a) return;
583
- let { linesLayer: e, pointsLayer: o } = l;
584
- if (!e || !o) return;
585
- let u = s.points, f = n.current;
586
- f ? o.children.length = 0 : o.children = u.map(({ x: e, y: t }, n) => {
587
- let o = n == s.selected ? a : i;
588
- return {
589
- source: o,
590
- bounds: m(d(e, t, o.width, o.height, r.current))
591
- };
592
- });
593
- let p = [];
594
- for (let e = 1; e < u.length; e++) {
595
- let t = u[e - 1], n = u[e];
596
- p.push({
597
- points: [t, n],
598
- color: f ? V : Je,
599
- width: Ye
600
- });
601
- }
602
- p.length ? e.children = p : e.children.length = 0, c.current.add(() => t.update(o, e)), s.instruct(), s.log(JSON.stringify(s.points));
603
- }, [
604
- t,
605
- s,
606
- l,
607
- i,
608
- a
609
- ]), f = (0, z.useCallback)((e) => {
610
- let t = e.key.toUpperCase();
611
- s.execute(() => {
612
- switch (t) {
613
- case Xe:
614
- e.preventDefault(), s.undo(), n.current = !1, u();
615
- break;
616
- case Ze:
617
- e.preventDefault(), s.applySmoothing(), n.current = !1, u();
618
- break;
619
- case Qe:
620
- e.preventDefault(), s.applySimplification(), n.current = !1, u();
621
- break;
622
- case $e:
623
- e.preventDefault(), n.current = !n.current, u();
624
- break;
625
- }
626
- });
627
- }, [s, u]), p = (0, z.useCallback)(({ ptScale: e, sceneId: n }) => {
628
- if (!o(n) || !(t != null && t.renderer) || !l) return;
629
- let { pointsLayer: i } = l;
630
- i && (r.current = e, s.execute(() => {
631
- let e = i.children, n = [];
632
- for (let t of e) t.bounds = m(d(t.bounds.center.x, t.bounds.center.y, t.source.width, t.source.height, r.current)), n.push(t);
633
- c.current.add(() => t.update(...n));
634
- }));
635
- }, [
636
- t,
637
- l,
638
- s
639
- ]), h = (0, z.useCallback)(({ data: e }) => {
640
- s.execute(() => {
641
- let { point: t } = j(e);
642
- s.add({
643
- x: t.x,
644
- y: t.y
645
- }), s.select(s.points.length - 1), u();
646
- });
647
- }, [s, u]);
648
- (0, z.useEffect)(() => {
649
- let n = t.renderer;
650
- if (!(!e || !n)) return r.current = t.scale, s.execute(() => {
651
- s.restore(), u();
652
- }), n.events.addEventListener("pointer:click", h), n.events.addEventListener("viewport:ptscale", p), window.addEventListener("keyup", f), () => {
653
- window.removeEventListener("keyup", f), n.events.removeEventListener("pointer:click", h), n.events.removeEventListener("viewport:ptscale", p), c.current.destroy();
654
- };
655
- }, [
656
- e,
657
- t,
658
- s,
659
- u,
660
- h,
661
- p,
662
- f
663
- ]);
664
- }
665
- //#endregion
666
- //#region src/components/Map/traffic/useManageTraffic.ts
667
- var U = 2, nt = U * 3.5, W = U * 12, rt = W * .7, it = 8, at = "transport_locations", ot = 150, G = "#a4aab6", st = 1e3, ct = 2e4, lt = 500;
668
- function ut({ permission: e, rendererService: n, dataJsonUrl: r, websocketUrl: i }) {
669
- let c = (0, z.useRef)(window.devicePixelRatio), l = (0, z.useRef)(/* @__PURE__ */ new Map()), u = (0, z.useRef)(/* @__PURE__ */ new Map()), f = (0, z.useRef)(), p = (0, z.useRef)(), h = (0, z.useRef)(performance.now()), g = (0, z.useRef)(1), _ = (0, z.useRef)(new Ke()), v = (0, z.useRef)(/* @__PURE__ */ new Map()), y = (0, z.useRef)(), b = (0, z.useRef)(st), x = (0, z.useRef)(/* @__PURE__ */ new Map()), S = (0, z.useRef)();
670
- (0, z.useEffect)(() => {
671
- let C;
672
- async function w() {
673
- if (!(!e || !n.scene)) try {
674
- let e;
675
- try {
676
- let t = await fetch(r, {
677
- method: "GET",
678
- headers: { "Content-Type": "application/json" }
679
- });
680
- if (!t.ok || t.status === 204) return;
681
- e = await t.json();
682
- } catch (e) {
683
- console.warn("useManageTraffic failed to get JSON", e);
684
- }
685
- if (!e || e != null && e.disabled || e != null && e.error) return;
686
- c.current = dt(n.scale);
687
- let i = new Map(e.routes.map(({ id: e, color: t }) => [e, t])), f = n.scene.rootLayer.children, b = /* @__PURE__ */ new Map();
688
- i.forEach((e) => {
689
- b.set(e, mt({
690
- radius: nt,
691
- color: e,
692
- scale: window.devicePixelRatio
693
- }));
694
- });
695
- let S = ye(), w = f.filter((e) => S.test(e.name)), E = be(), O = f.filter((e) => E.test(e.name));
696
- e.routes.slice(0, w.length).forEach(({ id: e, color: t, path: r, stops: i, hiddenPoints: a }, o) => {
697
- v.current.set(e, r);
698
- let s = w[o];
699
- if (s) {
700
- var l;
701
- let e = new Map((l = a == null ? void 0 : a.map((e) => [Y(e), e])) == null ? [] : l);
702
- for (let n = 1; n < r.length; n++) {
703
- let i = r[n - 1], a = r[n];
704
- e.has(Y(i)) || e.has(Y(a)) || s.children.push({
705
- points: [i, a],
706
- color: t,
707
- width: U
708
- });
709
- }
710
- s.children.length && _.current.add(() => n.update(s));
711
- }
712
- let u = O[o];
713
- if (u && i != null && i.length) {
714
- let e = b.get(t);
715
- i.forEach((t) => {
716
- u.children.push({
717
- source: e,
718
- bounds: m(d(t.x, t.y, e.width, e.height, c.current))
719
- });
720
- }), u.children.length && _.current.add(() => n.update(u));
721
- }
722
- });
723
- let k = f.find((e) => e.name === fe), A = /* @__PURE__ */ new Map();
724
- y.current = (e) => {
725
- try {
726
- let { ptScale: t, sceneId: r } = ft(e);
727
- if (!o(r)) return;
728
- c.current = dt(t);
729
- let i = [];
730
- for (let e of O) {
731
- let t = e.children;
732
- for (let e of t) e.bounds = m(d(e.bounds.center.x, e.bounds.center.y, e.source.width, e.source.height, c.current, e.bounds.rotation)), i.push(e);
733
- }
734
- let a = [...l.current.values()];
735
- for (let e of a) e.bounds = m(d(e.bounds.center.x, e.bounds.center.y, e.source.width, e.source.height, c.current, e.bounds.rotation));
736
- _.current.add(() => n.update(...i, ...a));
737
- } catch (e) {
738
- console.error("ptscale", e);
739
- }
740
- }, n.renderer.events.addEventListener("viewport:ptscale", y.current), C = requestAnimationFrame(() => {
741
- var e;
742
- (e = y.current) == null || e.call(y, n.scale);
743
- }), i.forEach((e, t) => {
744
- A.set(t, ht({
745
- id: t,
746
- width: W,
747
- height: W,
748
- color: e,
749
- scale: window.devicePixelRatio
750
- }));
751
- }), A.set(G, ht({
752
- id: "orphan",
753
- width: W,
754
- height: W,
755
- color: G,
756
- scale: window.devicePixelRatio
757
- }));
758
- let j = null;
759
- try {
760
- j = s(await a(`${t}icons/bus-white.svg`), rt, rt, window.devicePixelRatio);
761
- } catch (e) {
762
- console.error(e);
763
- }
764
- p.current = (e) => {
765
- try {
766
- var t;
767
- let r = JSON.parse(e.data);
768
- if (r.type !== at) return;
769
- let i = e.timeStamp || performance.now();
770
- g.current = Math.round(i - h.current), h.current = i;
771
- let a = Math.max((t = g.current) == null ? lt : t, lt), o = u.current, s = l.current, f = k.children, p = _.current, y = !1;
772
- r.data.forEach(({ id: e, x: t, y: r, route_id: i, hidden: l }) => {
773
- if (o.has(e)) {
774
- var u;
775
- (u = o.get(e)) == null || u(), o.delete(e);
776
- }
777
- if (l && s.has(e) && s.has(q(e))) {
778
- let t = s.get(e);
779
- t.hidden = !0;
780
- let r = s.get(q(e));
781
- r.hidden = !0, p.add(() => n.update(t, r));
782
- return;
783
- }
784
- if (x.current.set(e, performance.now()), !s.has(e)) {
785
- let n = A.get(i) || A.get(G), a = {
786
- id: e,
787
- source: n,
788
- bounds: m(d(t, r, n.width, n.height, c.current, 0))
789
- };
790
- if (s.set(e, a), j) {
791
- let n = q(e), i = {
792
- id: n,
793
- source: j,
794
- bounds: m(d(t, r, j.width, j.height, c.current, 0))
795
- };
796
- j.setAttribute("id", n), s.set(n, i), f.push(a, i);
797
- } else f.push(a);
798
- y = !0;
799
- return;
800
- }
801
- let h = s.get(e), g = s.get(q(e)), _ = h.bounds.center, b = yt(_, {
802
- x: t,
803
- y: r
804
- }, v.current.get(i));
805
- if (b.reduce((e, t, n) => n === 0 ? e : e + K(b[n - 1], t), 0) >= ot || document.hidden) gt({
806
- rendererService: n,
807
- updateQueue: p,
808
- vehicle: h,
809
- vehicleFinery: g,
810
- x: t,
811
- y: r,
812
- scale: c.current,
813
- angle: pt(h.bounds.center, {
814
- x: t,
815
- y: r
816
- })
817
- });
818
- else {
819
- let t = bt(b, a, (e) => {
820
- gt({
821
- rendererService: n,
822
- updateQueue: p,
823
- vehicle: h,
824
- vehicleFinery: g,
825
- x: e.x,
826
- y: e.y,
827
- scale: c.current,
828
- angle: e.angle
829
- });
830
- });
831
- o.set(e, t);
832
- }
833
- }), y && p.add(() => n.update(k));
834
- } catch (e) {
835
- console.error("handleSocketMessage", e);
836
- }
837
- }, T(), D(e.config ? (Number(e.config.vehicle_inactive_interval) || 20) * 1e3 : ct);
838
- } catch (e) {
839
- console.warn(e);
840
- }
841
- }
842
- w();
843
- function T() {
844
- var e, t;
845
- ((e = f.current) == null ? void 0 : e.readyState) === WebSocket.OPEN || ((t = f.current) == null ? void 0 : t.readyState) === WebSocket.CONNECTING || (f.current = new WebSocket(i), f.current.onmessage = p.current, f.current.onopen = () => {
846
- b.current = st;
847
- }, f.current.onclose = () => {
848
- navigator.onLine && (setTimeout(T, b.current), b.current = Math.min(b.current * 2, 3e4));
849
- });
850
- }
851
- function E() {
852
- T();
853
- }
854
- window.addEventListener("online", E);
855
- function D(e) {
856
- clearInterval(S.current), S.current = window.setInterval(() => {
857
- let t = performance.now(), r = [], i = [];
858
- x.current.forEach((n, a) => {
859
- if (t - n < e) return;
860
- let o = l.current.get(a);
861
- o && (o.hidden = !0, i.push(o), r.push(a));
862
- let s = q(a), c = l.current.get(s);
863
- c && (c.hidden = !0, i.push(c), r.push(s));
864
- }), i.length && _.current.add(() => n.update(...i)), r.forEach((e) => x.current.delete(e));
865
- }, e);
866
- }
867
- return () => {
868
- y.current && n.renderer && n.renderer.events.removeEventListener("viewport:ptscale", y.current), C !== void 0 && cancelAnimationFrame(C), u.current.forEach((e) => e == null ? void 0 : e()), u.current.clear(), l.current.clear(), _.current.destroy(), window.removeEventListener("online", E), clearInterval(S.current);
869
- };
870
- }, [
871
- e,
872
- n,
873
- r,
874
- i
875
- ]);
876
- }
877
- function dt(e) {
878
- return Math.min(e || window.devicePixelRatio, it);
879
- }
880
- function ft(e) {
881
- return typeof e == "number" ? { ptScale: e } : e;
882
- }
883
- function pt(e, t) {
884
- return re(e, t);
885
- }
886
- function mt({ radius: e, scale: t, color: n }) {
887
- let r = document.createElement("canvas"), i = r.getContext("2d");
888
- i.imageSmoothingEnabled = !1;
889
- let a = Math.ceil(e * 2 * t), o = a / 2, s = e * .78, c = e * .33;
890
- 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;
891
- }
892
- function ht({ id: e, width: t, height: n, color: r, scale: i }) {
893
- 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");
894
- m.setAttribute("id", e), m.width = f, m.height = p;
895
- let h = m.getContext("2d"), g = f / 2, _ = p / 2;
896
- h.save(), h.translate(g, _), h.rotate(-Math.PI / 2), h.translate(-g, -_);
897
- let v = g, y = _ - u / 2 + o, b = y + l;
898
- 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;
899
- }
900
- function K(e, t) {
901
- return D(e, t);
902
- }
903
- function q(e) {
904
- return `${e}_finery`;
905
- }
906
- function gt({ rendererService: e, updateQueue: t, vehicle: n, vehicleFinery: r, x: i, y: a, scale: o, angle: s }) {
907
- n.bounds = m(d(i, a, n.source.width, n.source.height, o, s)), n.hidden = !1, r ? (r.bounds = m(d(i, a, r.source.width, r.source.height, o, te(e.angle))), r.hidden = !1, t.add(() => e.update(r, n))) : t.add(() => e.update(n));
908
- }
909
- function J(e, t, n) {
910
- return {
911
- x: e.x + (t.x - e.x) * n,
912
- y: e.y + (t.y - e.y) * n
913
- };
914
- }
915
- function _t(e, t) {
916
- let n = Infinity, r = {
917
- index: 0,
918
- t: 0
919
- };
920
- for (let i = 0; i < t.length - 1; i++) {
921
- 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 = K(e, J(a, o, d));
922
- f < n && (n = f, r = {
923
- index: i,
924
- t: d
925
- });
926
- }
927
- return r;
928
- }
929
- function vt(e, t, n) {
930
- let r = K(e, t), i = Math.max(2, Math.ceil(r / n) + 1), a = [];
931
- for (let n = 0; n < i; n++) {
932
- let r = J(e, t, n / (i - 1));
933
- a.push(r);
934
- }
935
- return a;
936
- }
937
- function yt(e, t, n) {
938
- if (!n || !n.length) return vt(e, t, 10);
939
- let r = _t(e, n), i = _t(t, n), a = [], o = (e) => a.push(e);
940
- r.index + 1 < n.length ? o(J(n[r.index], n[r.index + 1], r.t)) : o(n[r.index]);
941
- for (let e = r.index + 1; e <= i.index && e < n.length; e++) o(n[e]);
942
- return i.index + 1 < n.length ? o(J(n[i.index], n[i.index + 1], i.t)) : o(n[i.index]), a;
943
- }
944
- function bt(e, t, n, r) {
945
- if (e.length < 2) return () => {};
946
- let i = null, a, o = [], s = 0;
947
- for (let t = 0; t < e.length - 1; t++) {
948
- let n = D(e[t], e[t + 1]);
949
- o.push(n), s += n;
950
- }
951
- let c = (l) => {
952
- i || (i = l);
953
- let u = l - i, d = Math.min(u / t, 1), f = d * s, p = 0, m = 0;
954
- for (; m < o.length && p + o[m] < f;) p += o[m], m++;
955
- m >= o.length && (m = o.length - 1);
956
- let h = e[m], g = e[Math.min(m + 1, e.length - 1)], _ = o[m] || 0, v = _ === 0 ? 0 : (f - p) / _;
957
- n({
958
- x: h.x + (g.x - h.x) * v,
959
- y: h.y + (g.y - h.y) * v,
960
- angle: re(h, g)
961
- }), d < 1 ? a = requestAnimationFrame(c) : r && r();
962
- };
963
- return a = requestAnimationFrame(c), () => {
964
- a && cancelAnimationFrame(a);
965
- };
966
- }
967
- function Y(e) {
968
- return `${e.x},${e.y}`;
969
- }
970
- //#endregion
971
- //#region src/utils/dimming.ts
972
- var xt = .5, St = "cubic";
973
- function Ct(e, t) {
974
- let n = e.scene;
975
- if (!n) return;
976
- let r = n.rootLayer;
977
- r.dim !== t && (r.dim = t, e.update(n.rootLayer));
978
- }
979
- function wt(e, t = 300, n = St) {
980
- let r = null, i = 0, a = 0, o = 0, s = 0, c = Math.max(t, 0);
981
- function l() {
982
- r === null || typeof cancelAnimationFrame != "function" || (cancelAnimationFrame(r), r = null);
983
- }
984
- function u(t) {
985
- l(), i = t, e(i);
986
- }
987
- function d(t) {
988
- let l = t - s, u = Math.min(l / c, 1), f = Tt(u, n);
989
- if (i = a + (o - a) * f, e(i), u < 1) {
990
- r = requestAnimationFrame(d);
991
- return;
992
- }
993
- r = null, i = o, e(i);
994
- }
995
- return {
996
- getValue() {
997
- return i;
998
- },
999
- setTarget(e, t = {}) {
1000
- let n = +!!e;
1001
- if (!(!t.immediate && n === o && r === null)) {
1002
- if (o = n, t.immediate || c === 0 || typeof requestAnimationFrame != "function") {
1003
- u(o);
1004
- return;
1005
- }
1006
- l(), a = i, s = typeof performance > "u" ? Date.now() : performance.now(), r = requestAnimationFrame(d);
1007
- }
1008
- },
1009
- stop() {
1010
- l();
1011
- }
1012
- };
1013
- }
1014
- function Tt(e, t) {
1015
- return t === "linear" ? e : Et(e);
1016
- }
1017
- function Et(e) {
1018
- return e < .5 ? 4 * e * e * e : 1 - (-2 * e + 2) ** 3 / 2;
1019
- }
1020
- //#endregion
1021
- //#region src/components/Map/booth-by-xy.ts
1022
- var X = [], Z = /* @__PURE__ */ new Map(), Q = null, $ = [];
1023
- function Dt() {
1024
- let e = F.booths.filter((e) => e.visible && e.rect && e.rect.size.width > 0 && e.rect.size.height > 0);
1025
- if (X = [], Q = null, Z = /* @__PURE__ */ new Map(), $ = e.filter((e) => e.paths), !e.length) return;
1026
- let t = [], n = Infinity, r = Infinity, a = -Infinity, o = -Infinity;
1027
- for (let i of e) {
1028
- let e = i.rotate ? new oe(i.rect.center, i.rect.size, i.rotate) : null, s = e ? e.bounds : i.rect;
1029
- t.push({
1030
- booth: i,
1031
- shape: e == null ? i.rect : e,
1032
- bounds: s
1033
- }), s.min.x < n && (n = s.min.x), s.min.y < r && (r = s.min.y), s.max.x > a && (a = s.max.x), s.max.y > o && (o = s.max.y);
1034
- }
1035
- let s = T.fromMinMax({
1036
- x: n,
1037
- y: r
1038
- }, {
1039
- x: a,
1040
- y: o
1041
- }), c = Math.ceil(s.size.width / 2), l = Math.ceil(s.size.height / 2);
1042
- for (let e = 0; e < 2; e++) for (let n = 0; n < 2; n++) {
1043
- let r = new T(s.min.x + e * c, s.min.y + n * l, c, l);
1044
- X.push(r), Z.set(r, t.filter((e) => r.intersects(e.bounds)));
1045
- }
1046
- i.log("hover segmentToHitAreas", Z);
1047
- }
1048
- n(() => [
1049
- F.booths,
1050
- S.loaded,
1051
- S.visible
1052
- ], () => Dt());
1053
- function Ot(e, t) {
1054
- let n = {
1055
- x: e,
1056
- y: t
1057
- }, r;
1058
- r = Q && Q.containsPoint(n) ? Q : X.find((e) => e.containsPoint(n)), r && (Q = r);
1059
- let i = r ? Z.get(r) : void 0;
1060
- if (i) {
1061
- let e = i.filter((e) => e.booth.visible && e.shape.containsPoint(n));
1062
- if (e.length) return (e.length > 1 ? e.sort((e, t) => e.booth.rect.area - t.booth.rect.area)[0] : e[0]).booth;
1063
- }
1064
- for (let e of $) if (e.visible) for (let t of e.paths) for (let r of ae(t.index, S.mode === ne.Default ? "" : e.layer.name)) {
1065
- let t = r.map((e) => ({
1066
- x: e[0],
1067
- y: e[1]
1068
- }));
1069
- if (E.fromConvexRing(t).containsPoint(n)) return e;
1070
- }
1071
- return null;
1072
- }
1073
- function kt(e, t) {
1074
- return Ot(e, t);
1075
- }
1076
- //#endregion
1077
- export { ut as a, He as c, wt as i, Ue as l, xt as n, tt as o, Ct as r, Ge as s, kt as t };