@expofp/floorplan 3.7.17 → 3.8.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 (170) hide show
  1. package/dist/browser/{Button-CalAncSt.js → Button-1J9oictV.js} +5 -5
  2. package/dist/browser/{CookieConsent-ZygvYtDb.js → CookieConsent-DIB9ja_x.js} +7 -7
  3. package/dist/browser/{Debug-D0iAX94G.js → Debug-Dj0pjQgz.js} +7 -7
  4. package/dist/browser/{Demo-DtZnCrNU.js → Demo-DFFTbr3B.js} +9 -9
  5. package/dist/browser/{Free-CY2ZgfTi.js → Free-VNovKWeM.js} +9 -9
  6. package/dist/browser/{Gallery-BJyU80Q8.js → Gallery-CsjJODa1.js} +9 -9
  7. package/dist/browser/{GpsLoader-C4Az3Ogj.js → GpsLoader-LtDTQ04B.js} +25 -25
  8. package/dist/browser/{KioskStore-D3xv5iMJ.js → KioskStore-BlqVE5Em.js} +26 -26
  9. package/dist/browser/{MaplibreAdapter-BI5hr4DA.js → MaplibreAdapter-BdhppB5g.js} +941 -960
  10. package/dist/browser/{ModalContainer-CGy7G3W-.js → ModalContainer-B3TzgHkN.js} +10 -10
  11. package/dist/browser/{PermissionNotice-BQl-Eh0U.js → PermissionNotice-CFzmPPcM.js} +6 -6
  12. package/dist/browser/{SetKioskMode-puXODfKF.js → SetKioskMode-BmGR1XVY.js} +11 -11
  13. package/dist/browser/ShowKiosk-zlmmcHhV.js +28 -0
  14. package/dist/browser/{TouchHand-DjRl3mqw.js → TouchHand-CJVe9zjZ.js} +4 -4
  15. package/dist/browser/{ViewerMenuPanel-DwpOTh1A.js → ViewerMenuPanel-BWULAn9z.js} +10 -10
  16. package/dist/browser/{add-debug-secret-listener-0zbOfR23.js → add-debug-secret-listener-BmN449zK.js} +1 -1
  17. package/dist/browser/{boolean-editor-Ct-PRF2J.js → boolean-editor-DfnwzSdd.js} +9 -9
  18. package/dist/browser/{bootIntercom-CNJJMQLU.js → bootIntercom-Dm7ltiQq.js} +2 -2
  19. package/dist/browser/{browser-Dvk9Y0QP.js → browser-BHxQ7Crl.js} +2 -2
  20. package/dist/browser/bundle.json +61 -61
  21. package/dist/browser/{classnames-N7RelmSW.js → classnames-CYIl-Aml.js} +2 -2
  22. package/dist/browser/{client-B3oB_gzf.js → client-C9cyInZ3.js} +4 -4
  23. package/dist/browser/{components-DCWqd4OH.js → components-CGrjy21U.js} +1680 -1684
  24. package/dist/browser/{createWayfinding-DCYv9I1K.js → createWayfinding-BiBK6J8p.js} +513 -494
  25. package/dist/browser/{debug-overlay-C1zmn9JP.js → debug-overlay-DDKkKZ7_.js} +10 -10
  26. package/dist/browser/{debug-ui-Dk4TQW1Q.js → debug-ui-CKdNfGUm.js} +6 -6
  27. package/dist/browser/{dist-Dhhxwn3m.js → dist-Dveh_M6J.js} +3 -3
  28. package/dist/browser/{dist-BjWXGdvS.js → dist-Sr-nbWel.js} +6 -6
  29. package/dist/browser/{dist-CZ9F3ShM.js → dist-Y5bXC6OR.js} +5 -5
  30. package/dist/browser/{efp-debug-init-BY441NPw.js → efp-debug-init-QlttX6qg.js} +2 -2
  31. package/dist/browser/{enum-editor-wsFvRjdm.js → enum-editor-D8AUxIjM.js} +11 -11
  32. package/dist/browser/{es5--a3vRB-s.js → es5-DM_2dLMc.js} +2 -2
  33. package/dist/browser/{event-not-found-C08dNiXm.js → event-not-found-BzZrJTbo.js} +1 -1
  34. package/dist/browser/{exports-DnnAyWkZ.js → exports-C77c46fn.js} +1 -1
  35. package/dist/browser/{favicon-BUBgyUNE.js → favicon-CLXnJgR0.js} +1 -1
  36. package/dist/browser/{fetch-retry.umd-DqWbcFb6.js → fetch-retry.umd-DIeR-B1a.js} +2 -2
  37. package/dist/browser/{flex-BJvbUFUw.js → flex-B9_T4ILl.js} +5 -5
  38. package/dist/browser/{floorplan.loader-DtRqhN7h.js → floorplan.loader-DBLUmBct.js} +11 -11
  39. package/dist/browser/{floorplan.ready-DU_ul7oy.js → floorplan.ready-C_Yqubo7.js} +303 -227
  40. package/dist/browser/{fuse-C1gHDLf6.js → fuse-BA9FAI84.js} +2 -2
  41. package/dist/browser/{i18n-GqZrkrT3.js → i18n-i9ni8Aks.js} +4 -4
  42. package/dist/browser/index.js +12 -12
  43. package/dist/browser/{index.module-ClFPQstA.js → index.module-DPZn4TXU.js} +4 -4
  44. package/dist/browser/{is-webview-Ubd69hDX.js → is-webview-Dy8i33Cj.js} +1 -1
  45. package/dist/browser/{jsx-runtime-CcqjcKRn.js → jsx-runtime-DzGUGvz-.js} +2 -2
  46. package/dist/browser/{lib-D-VhTz7u.js → lib-BHciLO67.js} +4 -4
  47. package/dist/browser/{loadImage-BSgOJpEi.js → loadImage-Kl5pv_Gu.js} +4 -4
  48. package/dist/browser/{logDeviceInfo-CqPbQalh.js → logDeviceInfo-CS0Fd9Bz.js} +9 -9
  49. package/dist/browser/{main-D02oALU5.js → main-CnhK8g8p.js} +1 -1
  50. package/dist/browser/{mobx-9haaaJQN.js → mobx-MDNY-J4R.js} +4 -4
  51. package/dist/browser/{particles.min-Cy0_xv2F.js → particles.min-BfWO2YCb.js} +2 -2
  52. package/dist/browser/{prop-types-CGmwvRRk.js → prop-types-8OQVQO5z.js} +2 -2
  53. package/dist/browser/{react-C94g1dWf.js → react-BHziDcUN.js} +2 -2
  54. package/dist/browser/{react-dom-VzzznUin.js → react-dom-B2YH_-FW.js} +3 -3
  55. package/dist/browser/{reset-all-settings-Bs45R4UK.js → reset-all-settings-DhiQzgYR.js} +7 -7
  56. package/dist/browser/{rolldown-runtime-DDajFMnr.js → rolldown-runtime-kNW8iHBm.js} +1 -1
  57. package/dist/browser/{settings-B89NEO7Z.js → settings-Cu5Wcs8p.js} +2 -2
  58. package/dist/browser/{settings-item-CTgteXDw.js → settings-item-v4B4uQdw.js} +6 -6
  59. package/dist/browser/{store-39MLQcdz.js → store-pynNgMKs.js} +5840 -5756
  60. package/dist/browser/{string-editor-4uawnaDY.js → string-editor-DpTkbez0.js} +7 -7
  61. package/dist/browser/{theme-CWzone56.js → theme-BOa5CSxW.js} +8 -8
  62. package/dist/browser/{ui-D8Gz1TVh.js → ui-Bq-HLu6b.js} +8 -8
  63. package/dist/browser/{useRenderTarget-BSjQ_3rd.js → useRenderTarget-l4FhOrhr.js} +4 -4
  64. package/dist/esm/components/LevelSelector.js +1 -1
  65. package/dist/esm/components/Map/Map.js +1 -1
  66. package/dist/esm/components/Map/booth-by-xy.js +1 -1
  67. package/dist/esm/components/Map/drawing/config/config-booth-badge.js +1 -1
  68. package/dist/esm/components/Map/drawing/config/config-booth-bg.js +1 -1
  69. package/dist/esm/components/Map/drawing/config/config-booth-bookmark.d.ts +1 -1
  70. package/dist/esm/components/Map/drawing/config/config-booth-bookmark.js +1 -1
  71. package/dist/esm/components/Map/drawing/config/config-booth-border.js +1 -1
  72. package/dist/esm/components/Map/drawing/config/config-booth-labels-special.d.ts +1 -2
  73. package/dist/esm/components/Map/drawing/config/config-booth-labels-special.js +2 -2
  74. package/dist/esm/components/Map/drawing/config/config-booth-labels.d.ts +4 -4
  75. package/dist/esm/components/Map/drawing/config/config-booth-labels.js +1 -1
  76. package/dist/esm/components/Map/drawing/config/config-booths.js +1 -1
  77. package/dist/esm/components/Map/drawing/config/config-load-layer.js +1 -1
  78. package/dist/esm/components/Map/drawing/config/config-markers.js +1 -1
  79. package/dist/esm/components/Map/drawing/config/loadBoothsImages.d.ts +10 -4
  80. package/dist/esm/components/Map/drawing/config/loadBoothsImages.js +1 -1
  81. package/dist/esm/components/Map/traffic/useBuildRoute.js +5 -5
  82. package/dist/esm/components/Map/traffic/useManageTraffic.js +1 -1
  83. package/dist/esm/components/Maplibre/MaplibreAdapter.js +1 -1
  84. package/dist/esm/components/Maplibre/useCameraReactions.d.ts +2 -2
  85. package/dist/esm/components/Maplibre/useCameraReactions.js +1 -1
  86. package/dist/esm/components/Maplibre/useLayerVisibilitySync.d.ts +2 -2
  87. package/dist/esm/components/Maplibre/useLayerVisibilitySync.js +1 -1
  88. package/dist/esm/components/Maplibre/utils/geo-config.d.ts +6 -6
  89. package/dist/esm/components/Maplibre/utils/geo-config.js +1 -1
  90. package/dist/esm/components/Maplibre/utils/solver.js +1 -1
  91. package/dist/esm/components/gps/useUserLocationAndHeading.d.ts +1 -1
  92. package/dist/esm/components/gps/useUserLocationAndHeading.js +1 -1
  93. package/dist/esm/components/gps/utils.d.ts +1 -1
  94. package/dist/esm/components/gps/utils.js +1 -1
  95. package/dist/esm/data/svg.d.ts +4 -4
  96. package/dist/esm/data/svg.js +1 -1
  97. package/dist/esm/floorplan.ready.d.ts +39 -2
  98. package/dist/esm/floorplan.ready.js +1 -1
  99. package/dist/esm/renderer/engine-core/canvases.d.ts +1 -1
  100. package/dist/esm/renderer/engine-core/canvases.js +1 -1
  101. package/dist/esm/renderer/engine-core/defs.d.ts +23 -4
  102. package/dist/esm/renderer/engine-core/defs.js +3 -3
  103. package/dist/esm/renderer/engine-core/types.d.ts +13 -2
  104. package/dist/esm/renderer/engine-core/update-def.d.ts +3 -2
  105. package/dist/esm/renderer/engine-core/update-def.js +1 -1
  106. package/dist/esm/renderer/engine-core/utils/rotation.d.ts +13 -1
  107. package/dist/esm/renderer/index.d.ts +2 -2
  108. package/dist/esm/renderer/index.js +1 -1
  109. package/dist/esm/services/routing.js +1 -1
  110. package/dist/esm/store/BoothStore.d.ts +14 -2
  111. package/dist/esm/store/BoothStore.js +1 -1
  112. package/dist/esm/store/LayerStore.d.ts +4 -4
  113. package/dist/esm/store/LayerStore.js +1 -1
  114. package/dist/esm/store/RouteStore.d.ts +3 -3
  115. package/dist/esm/store/RouteStore.js +1 -1
  116. package/dist/esm/store/UIState.d.ts +6 -7
  117. package/dist/esm/store/UIState.js +1 -1
  118. package/dist/esm/store/init/init-booths.js +1 -1
  119. package/dist/esm/store/init/init-layers.js +1 -1
  120. package/dist/esm/store/init/init-ui.js +1 -1
  121. package/dist/esm/utils/gps.d.ts +0 -1
  122. package/dist/esm/utils/gps.js +1 -1
  123. package/dist/esm/utils/imageloader.d.ts +1 -3
  124. package/dist/esm/utils/imageloader.js +1 -1
  125. package/dist/esm/utils/math.d.ts +0 -1
  126. package/dist/esm/utils/math.js +1 -1
  127. package/dist/esm/wayfinding/adapters/boothToEndpoint.d.ts +4 -0
  128. package/dist/esm/wayfinding/adapters/boothToEndpoint.js +1 -1
  129. package/dist/esm/wayfinding/core/geometry/projectPointOnSegment.d.ts +7 -6
  130. package/dist/esm/wayfinding/core/geometry/projectPointOnSegment.js +1 -1
  131. package/dist/esm/wayfinding/core/graph/graphHelpers.js +1 -1
  132. package/dist/esm/wayfinding/core/graph/linkCost.js +1 -1
  133. package/dist/esm/wayfinding/core/graph/pathfinder/aStarPathFinder.js +1 -1
  134. package/dist/esm/wayfinding/core/index.d.ts +0 -1
  135. package/dist/esm/wayfinding/core/position/distanceToRoute.d.ts +1 -1
  136. package/dist/esm/wayfinding/core/position/distanceToRoute.js +1 -1
  137. package/dist/esm/wayfinding/core/position/gpsThreshold.js +1 -1
  138. package/dist/esm/wayfinding/core/position/rerouteController.d.ts +1 -1
  139. package/dist/esm/wayfinding/core/position/rerouteController.js +1 -1
  140. package/dist/esm/wayfinding/core/position/snapToRoute.js +1 -1
  141. package/dist/esm/wayfinding/core/rendering/computeTrailPoints.d.ts +2 -2
  142. package/dist/esm/wayfinding/core/rendering/computeTrailPoints.js +1 -1
  143. package/dist/esm/wayfinding/core/rendering/normalizeRouteDirection.d.ts +1 -1
  144. package/dist/esm/wayfinding/core/rendering/normalizeRouteDirection.js +1 -1
  145. package/dist/esm/wayfinding/core/rendering/routeGeometry.d.ts +4 -8
  146. package/dist/esm/wayfinding/core/rendering/routeGeometry.js +1 -1
  147. package/dist/esm/wayfinding/core/routing/getRouteLength.js +1 -1
  148. package/dist/esm/wayfinding/createWayfinding.js +1 -1
  149. package/dist/esm/wayfinding/handlers/kioskHandler.js +1 -1
  150. package/dist/esm/wayfinding/renderer/iconManager.js +1 -1
  151. package/dist/esm/wayfinding/runtime/createWayfindingRuntime.js +1 -1
  152. package/dist/esm/wayfinding/runtime/positionView.d.ts +3 -3
  153. package/dist/esm/wayfinding/runtime/positionView.js +1 -1
  154. package/dist/esm/wayfinding/runtime/routeUpdate.d.ts +6 -5
  155. package/dist/esm/wayfinding/runtime/routeUpdate.js +1 -1
  156. package/dist/esm/wayfinding/runtime/types.d.ts +4 -3
  157. package/package.json +4 -4
  158. package/dist/browser/ShowKiosk-78DDAGCM.js +0 -28
  159. package/dist/esm/components/Map/drawing/config/Rect.d.ts +0 -7
  160. package/dist/esm/components/Map/drawing/config/Rect.js +0 -1
  161. package/dist/esm/core/Line.d.ts +0 -12
  162. package/dist/esm/core/Line.js +0 -1
  163. package/dist/esm/core/Polygon.d.ts +0 -16
  164. package/dist/esm/core/Polygon.js +0 -1
  165. package/dist/esm/core/Rect.d.ts +0 -36
  166. package/dist/esm/core/Rect.js +0 -1
  167. package/dist/esm/core/Size.d.ts +0 -7
  168. package/dist/esm/core/Size.js +0 -1
  169. package/dist/esm/utils/haversineDistance.d.ts +0 -7
  170. package/dist/esm/utils/haversineDistance.js +0 -1
@@ -1,4 +1,4 @@
1
- import { type RouteLine, type RoutePoint } from '../types';
1
+ import type { RouteLine, RoutePoint } from '../types';
2
2
  /** Decides whether the current GPS tick warrants rebuilding the route. */
3
3
  export interface RerouteController {
4
4
  /** Evaluates the current tick. Returns `true` when the caller should rebuild the route. */
@@ -1 +1 @@
1
- import{distancePointToRouteOnLayer as o}from"./distanceToRoute";export function createRerouteController(n){return{shouldReroute(r,t){if(!t.length)return!1;const e=r.layer;return e&&!t.some(a=>a.p0.layer===e&&a.p1.layer===e)?!0:o({x:r.x,y:r.y,layer:e},t)>n}}}
1
+ import{distancePointToRouteOnLayer as a}from"./distanceToRoute";export function createRerouteController(n){return{shouldReroute(t,e){if(!e.length)return!1;const r=t.layer;return r&&!e.some(o=>o.p0.layer===r&&o.p1.layer===r)?!0:a(t,e)>n}}}
@@ -1 +1 @@
1
- import{pointInPolygon as E}from"../geometry/pointInPolygon";import{projectPointOnSegment as O}from"../geometry/projectPointOnSegment";function D(o,a){let y=0;for(const n of o){const t=Math.hypot(n.p1.x-n.p0.x,n.p1.y-n.p0.y);if(t!==0){if(y+t>=a){const r=(a-y)/t,h=n.p0.x+(n.p1.x-n.p0.x)*r,s=n.p0.y+(n.p1.y-n.p0.y)*r;return{point:{layer:n.p0.layer,x:h,y:s},line:n}}y+=t}}const i=o[o.length-1];return{point:{layer:i.p0.layer,x:i.p1.x,y:i.p1.y},line:i}}export{SNAP_THRESHOLD_METERS}from"./gpsThreshold";export function snapToRoute(o,a,y){const i=a.length;if(!i)return{snapped:!1};const{snapThreshold:n,to:t,from:r,minRemainingUnits:h=.5}=y,s=o.layer||null;let P=1/0,u=null,m=0,F=s==null;for(let e=0;e<i;e++){const f=a[e],{p0:l,p1:c}=f,S=Math.hypot(c.x-l.x,c.y-l.y);if(S===0)continue;if(s!=null&&String(l.layer)!==s){m+=S;continue}F=!0;const g=O({x:o.x,y:o.y},l,c);g.distance<P&&(P=g.distance,u={segmentIndex:e,t:g.t,distanceFromPolylineStart:m+S*g.t}),m+=S}if(s!=null&&!F)return{snapped:!1};const p=m,b=a[0].p0,M=a[i-1].p1,A=Math.hypot(t.x-b.x,t.y-b.y),I=Math.hypot(t.x-M.x,t.y-M.y),x=A<=I,T=Math.min(h,p);if(r?.bounds&&(s==null||!r.layer||r.layer===s)&&E({x:o.x,y:o.y},r.bounds)){const e=p,f=x?e:p-e,l=D(a,f);return{snapped:!0,snappedPoint:l.point,snappedLine:l.line,distance:e}}if(t.bounds&&(s==null||!t.layer||t.layer===s)&&E({x:o.x,y:o.y},t.bounds)){const e=T,f=p-e,c=D(a,x?e:f);return{snapped:!0,snappedPoint:c.point,snappedLine:c.line,distance:e}}if(!u||P>n)return{snapped:!1};let d=x?u.distanceFromPolylineStart:p-u.distanceFromPolylineStart;d<T&&(d=T);const L=p-d,R=D(a,x?d:L);return{snapped:!0,snappedPoint:R.point,snappedLine:R.line,distance:d}}
1
+ import{pointDistance as P}from"@expofp/geometry";import{pointInPolygon as E}from"../geometry/pointInPolygon";import{projectPointOnSegment as v}from"../geometry/projectPointOnSegment";function F(e,a){let p=0;for(const n of e){const o=P(n.p0,n.p1);if(o!==0){if(p+o>=a){const r=(a-p)/o,h=n.p0.x+(n.p1.x-n.p0.x)*r,s=n.p0.y+(n.p1.y-n.p0.y)*r;return{point:{layer:n.p0.layer,x:h,y:s},line:n}}p+=o}}const i=e[e.length-1];return{point:{layer:i.p0.layer,x:i.p1.x,y:i.p1.y},line:i}}export{SNAP_THRESHOLD_METERS}from"./gpsThreshold";export function snapToRoute(e,a,p){const i=a.length;if(!i)return{snapped:!1};const{snapThreshold:n,to:o,from:r,minRemainingUnits:h=.5}=p,s=e.layer||null;let D=1/0,m=null,u=0,b=s==null;for(let t=0;t<i;t++){const y=a[t],{p0:l,p1:f}=y,g=P(l,f);if(g===0)continue;if(s!=null&&String(l.layer)!==s){u+=g;continue}b=!0;const x=v({x:e.x,y:e.y},l,f);x.distance<D&&(D=x.distance,m={segmentIndex:t,t:x.t,distanceFromPolylineStart:u+g*x.t}),u+=g}if(s!=null&&!b)return{snapped:!1};const c=u,A=a[0].p0,I=a[i-1].p1,L=P(o,A),O=P(o,I),S=L<=O,T=Math.min(h,c);if(r?.bounds&&(s==null||!r.layer||r.layer===s)&&E({x:e.x,y:e.y},r.bounds)){const t=c,y=S?t:c-t,l=F(a,y);return{snapped:!0,snappedPoint:l.point,snappedLine:l.line,distance:t}}if(o.bounds&&(s==null||!o.layer||o.layer===s)&&E({x:e.x,y:e.y},o.bounds)){const t=T,y=c-t,f=F(a,S?t:y);return{snapped:!0,snappedPoint:f.point,snappedLine:f.line,distance:t}}if(!m||D>n)return{snapped:!1};let d=S?m.distanceFromPolylineStart:c-m.distanceFromPolylineStart;d<T&&(d=T);const j=c-d,R=F(a,S?d:j);return{snapped:!0,snappedPoint:R.point,snappedLine:R.line,distance:d}}
@@ -1,4 +1,4 @@
1
- import { type Point } from 'simple-geometry';
1
+ import { type Point2Like } from '@expofp/geometry';
2
2
  /**
3
3
  * Generates evenly-spaced points along a quadratic Bézier curve
4
4
  * between two points. Used for dotted trail visualization when
@@ -15,5 +15,5 @@ export declare function computeTrailPoints(from: {
15
15
  }, to: {
16
16
  x: number;
17
17
  y: number;
18
- }, interval?: number, curvature?: number): Point[];
18
+ }, interval?: number, curvature?: number): Point2Like[];
19
19
  //# sourceMappingURL=computeTrailPoints.d.ts.map
@@ -1 +1 @@
1
- const A=.4,E=8;export function computeTrailPoints(c,s,i=8,t=.4){const n=Math.hypot(s.x-c.x,s.y-c.y);if(n===0||i<=0)return[];const y=Math.max(Math.ceil(n/i)+1,2),o={x:(c.x+s.x)/2,y:(c.y+s.y)/2-n*t},e=[];for(let x=0;x<y;x++){const u=x/(y-1);e.push(T(c,o,s,u))}return e}function T(c,s,i,t){const n=1-t;return{x:n*n*c.x+2*n*t*s.x+t*t*i.x,y:n*n*c.y+2*n*t*s.y+t*t*i.y}}
1
+ import{pointDistance as a}from"@expofp/geometry";const y=.4,T=8;export function computeTrailPoints(c,i,o=T,t=y){const n=a(i,c);if(n===0||o<=0)return[];const e=Math.max(Math.ceil(n/o)+1,2),u={x:(c.x+i.x)/2,y:(c.y+i.y)/2-n*t},r=[];for(let s=0;s<e;s++){const x=s/(e-1);r.push(A(c,u,i,x))}return r}function A(c,i,o,t){const n=1-t;return{x:n*n*c.x+2*n*t*i.x+t*t*o.x,y:n*n*c.y+2*n*t*i.y+t*t*o.y}}
@@ -1,4 +1,4 @@
1
- import { type RouteLine, type RoutePoint } from '../types';
1
+ import type { RouteLine, RoutePoint } from '../types';
2
2
  /**
3
3
  * Ensures that `routeLines` run in the from→to direction.
4
4
  *
@@ -1 +1 @@
1
- function i(t,s,p){let r=0,a=1/0,c=1/0;const f=p.reduce((e,n)=>e+n,0);for(let e=0;e<s.length;e++){const n=s[e],o=p[e];if(t.layer&&n.p0.layer!==t.layer){r+=o;continue}const d=n.p1.x-n.p0.x,y=n.p1.y-n.p0.y,h=d*d+y*y;if(h<1e-10){r+=o;continue}const l=((t.x-n.p0.x)*d+(t.y-n.p0.y)*y)/h,u=Math.max(0,Math.min(1,l)),x=n.p0.x+d*u,S=n.p0.y+y*u,m=Math.hypot(t.x-x,t.y-S);m<a&&(a=m,c=r+o*u),r+=o}return{found:c!==1/0,fromStart:c,total:f}}export function normalizeRouteDirection(t,s,p){const r=t.map(o=>Math.hypot(o.p1.x-o.p0.x,o.p1.y-o.p0.y)),a=i(s,t,r),c=a.found?a:i(p,t,r);if(!c.found)return t;const f=c.fromStart,e=c.total-c.fromStart;return(a.found?e<f:f<e)?t.slice().reverse().map(o=>({...o,p0:o.p1,p1:o.p0})):t}
1
+ import{pointDistance as g}from"@expofp/geometry";function y(t,s,f){let r=0,a=1/0,c=1/0;const p=f.reduce((e,n)=>e+n,0);for(let e=0;e<s.length;e++){const n=s[e],o=f[e];if(t.layer&&n.p0.layer!==t.layer){r+=o;continue}const d=n.p1.x-n.p0.x,i=n.p1.y-n.p0.y,u=d*d+i*i;if(u<1e-10){r+=o;continue}const h=((t.x-n.p0.x)*d+(t.y-n.p0.y)*i)/u,m=Math.max(0,Math.min(1,h)),x=n.p0.x+d*m,S=n.p0.y+i*m,l=Math.hypot(t.x-x,t.y-S);l<a&&(a=l,c=r+o*m),r+=o}return{found:c!==1/0,fromStart:c,total:p}}export function normalizeRouteDirection(t,s,f){const r=t.map(o=>g(o.p0,o.p1)),a=y(s,t,r),c=a.found?a:y(f,t,r);if(!c.found)return t;const p=c.fromStart,e=c.total-c.fromStart;return(a.found?e<p:p<e)?t.slice().reverse().map(o=>({...o,p0:o.p1,p1:o.p0})):t}
@@ -1,15 +1,11 @@
1
- export interface BoundingBox {
2
- x1: number;
3
- y1: number;
4
- x2: number;
5
- y2: number;
6
- }
1
+ import { Box } from '@expofp/geometry';
7
2
  /**
8
3
  * Computes the axis-aligned bounding box of a set of points.
9
- * Returns null for an empty array.
4
+ * Always returns a {@link Box}. An empty array returns `Box.fromPoints([])` — a zero-size
5
+ * box at the origin — which is distinguished from a real route bbox via `.isEmpty()`.
10
6
  */
11
7
  export declare function computeBoundingBox(points: readonly {
12
8
  x: number;
13
9
  y: number;
14
- }[]): BoundingBox | null;
10
+ }[]): Box;
15
11
  //# sourceMappingURL=routeGeometry.d.ts.map
@@ -1 +1 @@
1
- export function computeBoundingBox(e){if(e.length===0)return null;let i=1/0,t=1/0,f=-1/0,y=-1/0;for(const n of e)n.x<i&&(i=n.x),n.y<t&&(t=n.y),n.x>f&&(f=n.x),n.y>y&&(y=n.y);return{x1:i,y1:t,x2:f,y2:y}}
1
+ import{Box as n}from"@expofp/geometry";export function computeBoundingBox(o){return n.fromPoints(o)}
@@ -1 +1 @@
1
- import{lineLength as n}from"simple-geometry";export function getRouteLength(t){return t.reduce((r,e)=>r+n(e.p0,e.p1),0)}
1
+ import{pointDistance as r}from"@expofp/geometry";export function getRouteLength(e){return e.reduce((o,t)=>o+r(t.p0,t.p1),0)}
@@ -1 +1 @@
1
- import h from"../core/Rect";import{fpGeo as n}from"../data/fpGeo";import o,{layersStore as s,uiState as f}from"../store";import{createCanvasIconProvider as E,createFloorContext as y,graphDataSource as T}from"./adapters";import{bindMobxReactions as A}from"./bindMobxReactions";import{SNAP_THRESHOLD_METERS as M,createWayfindingEngine as N,getThresholdFromMetersToSvg as x,getThresholdSafe as I,resolveRerouteThresholdSvg as L}from"./core";import{createKioskHandler as v}from"./handlers/kioskHandler";import{createYahHandler as W}from"./handlers/yahHandler";import{WF_CURRENT_POSITION_LAYER_NAME as F,WF_LINES_ANIMATED_LAYER_NAME as P,WF_LINES_LAYER_NAME as k,WF_POINTS_LAYER_NAME as C,WF_TRAIL_LAYER_NAME as H}from"./layers";import{createWayfindingRuntime as Y}from"./runtime/createWayfindingRuntime";import{createWayfindingRenderer as D}from"./renderer";export function createWayfinding(l){const m=N(T),a=E({iconMap:o.fp.icons,pixelRatio:devicePixelRatio}),t=D(l),c=y(s,o.routeStore),i={points:C,trail:H,lines:k,linesAnimated:P,currentPosition:F},d=I(n?.properties?.config?.snapThreshold)||M,R=x({thresholdInMeters:d,gpsConfig:n?.properties?.config}),p=Y({engine:m,renderer:t,iconProvider:a,floorContext:c,layers:i,snapThreshold:R,onTransitionClick:e=>{e.role==="exit"&&s.updateVisibility(e.targetLayer,!0)},onRouteUpdate:(e,r)=>{o.routeStore.updateRoute(e),r&&(f.moveToRect=h.fromX1y1x2y2(r.x1,r.y1,r.x2,r.y2))},onRouteDistance:e=>o.routeStore.updateRouteDistance(e)}),S=v({renderer:t,kioskIconMap:o.fp.icons,layer:i.points}),g=W({renderer:t,iconProvider:a,floorContext:c,layer:i.points}),u=L(n?.properties?.config),_=A({runtime:p,kioskHandler:S,yahHandler:g,stores:{routeStore:o.routeStore,uiState:f,layerStore:s},rerouteThresholdSvg:u});return t.flush(),()=>{_(),p.destroy()}}
1
+ import{fpGeo as i}from"../data/fpGeo";import o,{layersStore as n,uiState as l}from"../store";import{createCanvasIconProvider as g,createFloorContext as h,graphDataSource as T}from"./adapters";import{bindMobxReactions as A}from"./bindMobxReactions";import{SNAP_THRESHOLD_METERS as y,createWayfindingEngine as M,getThresholdFromMetersToSvg as N,getThresholdSafe as I,resolveRerouteThresholdSvg as L}from"./core";import{createKioskHandler as v}from"./handlers/kioskHandler";import{createYahHandler as W}from"./handlers/yahHandler";import{WF_CURRENT_POSITION_LAYER_NAME as x,WF_LINES_ANIMATED_LAYER_NAME as F,WF_LINES_LAYER_NAME as P,WF_POINTS_LAYER_NAME as k,WF_TRAIL_LAYER_NAME as C}from"./layers";import{createWayfindingRuntime as H}from"./runtime/createWayfindingRuntime";import{createWayfindingRenderer as Y}from"./renderer";export function createWayfinding(d){const f=M(T),s=g({iconMap:o.fp.icons,pixelRatio:devicePixelRatio}),r=Y(d),a=h(n,o.routeStore),t={points:k,trail:C,lines:P,linesAnimated:F,currentPosition:x},m=I(i?.properties?.config?.snapThreshold)||y,u=N({thresholdInMeters:m,gpsConfig:i?.properties?.config}),c=H({engine:f,renderer:r,iconProvider:s,floorContext:a,layers:t,snapThreshold:u,onTransitionClick:e=>{e.role==="exit"&&n.updateVisibility(e.targetLayer,!0)},onRouteUpdate:(e,p)=>{o.routeStore.updateRoute(e),p.isEmpty()||(l.moveToRect=p)},onRouteDistance:e=>o.routeStore.updateRouteDistance(e)}),R=v({renderer:r,kioskIconMap:o.fp.icons,layer:t.points}),S=W({renderer:r,iconProvider:s,floorContext:a,layer:t.points}),E=L(i?.properties?.config),_=A({runtime:c,kioskHandler:R,yahHandler:S,stores:{routeStore:o.routeStore,uiState:l,layerStore:n},rerouteThresholdSvg:E});return r.flush(),()=>{_(),c.destroy()}}
@@ -1 +1 @@
1
- import{createKioskCanvas as u}from"../adapters";const o="kiosk",s=0;export function createKioskHandler({renderer:n,kioskIconMap:a,layer:f}){return(t,c,l)=>{if(!t){n.setIcon(o,null),n.flush();return}if(l!==s&&t.z&&c&&t.z!==c){n.setIcon(o,null),n.flush();return}n.setIcon(o,{canvas:u(a,t.iconSizePercent),layer:f,x:t.x,y:t.y,rotation:(t.heading??0)*Math.PI/180}),n.flush()}}
1
+ import{degToRad as u}from"@expofp/geometry";import{createKioskCanvas as s}from"../adapters";const n="kiosk",i=0;export function createKioskHandler({renderer:t,kioskIconMap:f,layer:a}){return(o,c,l)=>{if(!o){t.setIcon(n,null),t.flush();return}if(l!==i&&o.z&&c&&o.z!==c){t.setIcon(n,null),t.flush();return}t.setIcon(n,{canvas:s(f,o.iconSizePercent),layer:a,x:o.x,y:o.y,rotation:u(o.heading??0)}),t.flush()}}
@@ -1 +1 @@
1
- import{createImageDef as w,getBounds as m,getRotation as L}from"../../renderer";import{pickDefaultScene as D}from"../../renderer/engine-core/defs";export function createIconManager(u,r){const l=new Map,d=new Map,f=new Map;function g(e,a){return a===void 0?e:`${e}#${a}`}function b(e,a){let t=d.get(e);t||(t=new Set,d.set(e,t)),t.add(a),f.set(a,e)}function k(e){const a=f.get(e);if(!a)return;const t=d.get(a);t&&t.delete(e),f.delete(e)}function h(e,a,t){const n=u.touchLayer(t.layer),i=w(t.canvas,m(t.x,t.y,t.canvas.width,t.canvas.height,r.scale,t.rotation),{hidden:t.hidden??!1,dim:t.dimmed??!1,origin:t.origin});n.children.push(i),r.onPtScale(e,c=>{const s=l.get(e);if(!(!s||s.imageDef.hidden))return s.imageDef.bounds=m(s.imageDef.bounds.center.x,s.imageDef.bounds.center.y,s.imageDef.source.width,s.imageDef.source.height,c,s.imageDef.bounds.rotation),s.imageDef}),t.cardinalSnap&&r.onRoll(e,c=>{const s=l.get(e);if(!s)return;const y=L(c,s.imageDef.bounds.rotation);if(y!==void 0)return s.imageDef.bounds.rotation+=y,s.imageDef});const o={imageDef:i,layerName:t.layer,callback:t.onClick??null};return l.set(e,o),b(a,e),o}function p(e,a,t,n){const i=u.resolveLayer(t.layerName),o=i.children,c=o.indexOf(t.imageDef);c>=0&&o.splice(c,1),u.touchedLayers.set(t.layerName,i),r.ptScaleRegistry.unregisterByName(e),r.rollRegistry.unregisterByName(e),l.delete(e),k(e),h(e,a,n)}function N(e,a,t,n){if(t.layerName!==n.layer)throw new Error(`renderer: icon "${e}" cannot move between layers (was "${t.layerName}", got "${n.layer}")`);if(t.imageDef.source!==n.canvas){p(e,a,t,n);return}t.imageDef.bounds=m(n.x,n.y,n.canvas.width,n.canvas.height,r.scale,n.rotation),t.imageDef.hidden=n.hidden??!1,t.imageDef.dim=n.dimmed??!1,t.callback=n.onClick??null,u.touchLayer(n.layer)}return{setIcon(e,a,t){const n=g(e,t);if(a===null){const o=l.get(n);o&&(o.imageDef.hidden=!0,o.callback=null,u.touchLayer(o.layerName));return}const i=l.get(n);i?N(n,e,i,a):h(n,e,a)},clearIcons(e){const a=typeof e=="string"?[e]:e;for(const t of a){const n=d.get(t);if(n)for(const i of n){const o=l.get(i);o&&(o.imageDef.hidden=!0,o.callback=null,u.touchLayer(o.layerName))}}},hideAll(){for(const e of l.values())e.imageDef.hidden=!0,e.callback=null,u.touchedLayers.set(e.layerName,u.resolveLayer(e.layerName))},destroy(){for(const e of l.keys())r.ptScaleRegistry.unregisterByName(e),r.rollRegistry.unregisterByName(e);l.clear(),d.clear(),f.clear()},handleClick({data:e}){const{defs:a}=D(e);for(const t of l.values())if(t.callback&&!t.imageDef.hidden&&a.includes(t.imageDef)){t.callback();return}},handleHover({data:e}){const a=r.renderer;if(!a)return;const{defs:t}=D(e);let n=!1;for(const i of l.values())if(i.callback&&!i.imageDef.hidden&&t.includes(i.imageDef)){n=!0;break}a.canvas.style.cursor=n?"pointer":""}}}
1
+ import{createImageDef as L,getBounds as m,getRotation as v,rectToRenderer as D}from"../../renderer";import{pickDefaultScene as g}from"../../renderer/engine-core/defs";export function createIconManager(u,r){const l=new Map,d=new Map,f=new Map;function b(e,a){return a===void 0?e:`${e}#${a}`}function k(e,a){let t=d.get(e);t||(t=new Set,d.set(e,t)),t.add(a),f.set(a,e)}function p(e){const a=f.get(e);if(!a)return;const t=d.get(a);t&&t.delete(e),f.delete(e)}function h(e,a,t){const n=u.touchLayer(t.layer),i=L(t.canvas,m(t.x,t.y,t.canvas.width,t.canvas.height,r.scale,t.rotation),{hidden:t.hidden??!1,dim:t.dimmed??!1,origin:t.origin});n.children.push(i),r.onPtScale(e,c=>{const s=l.get(e);if(!(!s||s.imageDef.hidden))return s.imageDef.bounds=D(m(s.imageDef.bounds.center.x,s.imageDef.bounds.center.y,s.imageDef.source.width,s.imageDef.source.height,c,s.imageDef.bounds.rotation)),s.imageDef}),t.cardinalSnap&&r.onRoll(e,c=>{const s=l.get(e);if(!s)return;const y=v(c,s.imageDef.bounds.rotation);if(y!==void 0)return s.imageDef.bounds.rotation+=y,s.imageDef});const o={imageDef:i,layerName:t.layer,callback:t.onClick??null};return l.set(e,o),k(a,e),o}function N(e,a,t,n){const i=u.resolveLayer(t.layerName),o=i.children,c=o.indexOf(t.imageDef);c>=0&&o.splice(c,1),u.touchedLayers.set(t.layerName,i),r.ptScaleRegistry.unregisterByName(e),r.rollRegistry.unregisterByName(e),l.delete(e),p(e),h(e,a,n)}function w(e,a,t,n){if(t.layerName!==n.layer)throw new Error(`renderer: icon "${e}" cannot move between layers (was "${t.layerName}", got "${n.layer}")`);if(t.imageDef.source!==n.canvas){N(e,a,t,n);return}t.imageDef.bounds=D(m(n.x,n.y,n.canvas.width,n.canvas.height,r.scale,n.rotation)),t.imageDef.hidden=n.hidden??!1,t.imageDef.dim=n.dimmed??!1,t.callback=n.onClick??null,u.touchLayer(n.layer)}return{setIcon(e,a,t){const n=b(e,t);if(a===null){const o=l.get(n);o&&(o.imageDef.hidden=!0,o.callback=null,u.touchLayer(o.layerName));return}const i=l.get(n);i?w(n,e,i,a):h(n,e,a)},clearIcons(e){const a=typeof e=="string"?[e]:e;for(const t of a){const n=d.get(t);if(n)for(const i of n){const o=l.get(i);o&&(o.imageDef.hidden=!0,o.callback=null,u.touchLayer(o.layerName))}}},hideAll(){for(const e of l.values())e.imageDef.hidden=!0,e.callback=null,u.touchedLayers.set(e.layerName,u.resolveLayer(e.layerName))},destroy(){for(const e of l.keys())r.ptScaleRegistry.unregisterByName(e),r.rollRegistry.unregisterByName(e);l.clear(),d.clear(),f.clear()},handleClick({data:e}){const{defs:a}=g(e);for(const t of l.values())if(t.callback&&!t.imageDef.hidden&&a.includes(t.imageDef)){t.callback();return}},handleHover({data:e}){const a=r.renderer;if(!a)return;const{defs:t}=g(e);let n=!1;for(const i of l.values())if(i.callback&&!i.imageDef.hidden&&t.includes(i.imageDef)){n=!0;break}a.canvas.style.cursor=n?"pointer":""}}}
@@ -1 +1 @@
1
- import{CURRENT_POSITION_POINT_ID as C}from"./positionView";import{getRouteLength as G,snapToRoute as H}from"../core";import{getRouteLines as J}from"./getRouteLines";import{createEndpointView as K}from"./endpointView";import{createPositionTrailView as Q}from"./positionTrailView";import{createRouteLinesView as X}from"./routeLinesView";import{computeRouteRenderData as Y}from"./routeRenderData";import{computeRouteUpdate as Z}from"./routeUpdate";import{createTrailView as $}from"./trailView";import{createTransitionView as D}from"./transitionView";const x=A=>A.flatMap(e=>[e.p0,e.p1]);export function createWayfindingRuntime({engine:A,renderer:e,iconProvider:P,floorContext:c,layers:f,snapThreshold:E,onTransitionClick:M,onRouteUpdate:N,onRouteDistance:R}){const d=K({renderer:e,iconProvider:P,floorContext:c,layer:f.points}),I=D({renderer:e,iconProvider:P,floorContext:c,onTransitionClick:M,layer:f.points}),W=$({renderer:e,iconProvider:P,floorContext:c,layer:f.trail}),l=Q({renderer:e,iconProvider:P,floorContext:c,trails:W,iconLayer:f.currentPosition,snapThreshold:E}),O=X({renderer:e,linesLayer:f.lines,animatedLinesLayer:f.linesAnimated});let r=[],o=null,u=null,s=null,p=0,y=!1,T=!1;function S(){return c.showAllFloors()?null:c.getActiveFloor()}function _(){const t=S();return t===null?r.filter(n=>!n.virtual):r.filter(n=>n.p0.layer===t&&!n.virtual)}function V(){if(!o||!u)return null;const t=_();return t.length?{from:o,to:u,routePoints:x(t),visibleLines:t}:null}function m(t=null,n=!1){if(!o||!u)return;const i=Y({routeLines:r,currentRouteLayer:S(),from:o,to:u,snap:t});O.draw(i,n),p=i.distance}function g(t){const n=V();if(!n){l.setTrail(null,null);return}const i=s&&t&&!t.snapped?s:null,h=a=>a.bounds?.length?null:a.id===C?i:a,L=y?null:h(n.from);if(L){l.setTrail(n.routePoints[n.routePoints.length-1],L);return}const b=h(n.to);l.setTrail(b?n.routePoints[0]:null,b)}function U(){if(!o||!u)return;const t=V();if(!t){d.hide(),I.clear(),l.clearTrail(),m();return}d.place(o,u,t.routePoints,T),I.place(r),m(),g(null)}function w(){if(!o||!u)return;const t=V();t&&d.place(o,u,t.routePoints,T)}function F(){if(T=!1,!s||!o||!u)return null;const t=r.filter(h=>!h.virtual);if(!t.length)return null;const n=V(),i=n?l.applyToRoute(s,n,t):H(s,t,{snapThreshold:E,from:o,to:u});return i.snapped&&(y=!0),T=i.snapped,i}function k(){const t=Z(r,_());return N(t.lines,t.bounds),t}function j({from:t,to:n,waypoints:i,accessible:h}){const L=J({engine:A,from:t,to:n,waypoints:i,accessible:h});if(!L.length)return v(),!1;y=!1,o=t,u=n,r=L,U();const{lines:b}=k(),a=F();return w(),g(a),a&&m(a,!0),R(a?p:G(b)),e.flush(),!0}function q(t){const n=s!==null;if(s=t,!t){T=!1,l.hideIcon(),g(null),n&&w(),m(),R(p),e.flush();return}l.placeIcon(t);const i=F();w(),g(i),i&&m(i,!0),R(p),e.flush()}function z(){U();const t=F();w(),g(t),t&&m(t,!0),r.length&&k(),R(p),e.flush()}function v(){y=!1,r=[],o=null,u=null,p=0,d.hide(),I.clear(),l.clearTrail(),O.clear(),N([],null),R(0),e.flush()}function B(){v(),s=null,e.destroy()}return{setRoute:j,onPositionChanged:q,onFloorChanged:z,clearRoute:v,destroy:B}}
1
+ import{Box as C}from"@expofp/geometry";import{CURRENT_POSITION_POINT_ID as G}from"./positionView";import{getRouteLength as H,snapToRoute as J}from"../core";import{getRouteLines as K}from"./getRouteLines";import{createEndpointView as Q}from"./endpointView";import{createPositionTrailView as X}from"./positionTrailView";import{createRouteLinesView as Y}from"./routeLinesView";import{computeRouteRenderData as Z}from"./routeRenderData";import{computeRouteUpdate as $}from"./routeUpdate";import{createTrailView as D}from"./trailView";import{createTransitionView as x}from"./transitionView";const tt=A=>A.flatMap(e=>[e.p0,e.p1]);export function createWayfindingRuntime({engine:A,renderer:e,iconProvider:P,floorContext:c,layers:f,snapThreshold:E,onTransitionClick:B,onRouteUpdate:N,onRouteDistance:R}){const d=Q({renderer:e,iconProvider:P,floorContext:c,layer:f.points}),I=x({renderer:e,iconProvider:P,floorContext:c,onTransitionClick:B,layer:f.points}),M=D({renderer:e,iconProvider:P,floorContext:c,layer:f.trail}),l=X({renderer:e,iconProvider:P,floorContext:c,trails:M,iconLayer:f.currentPosition,snapThreshold:E}),O=Y({renderer:e,linesLayer:f.lines,animatedLinesLayer:f.linesAnimated});let u=[],o=null,r=null,s=null,p=0,y=!1,T=!1;function S(){return c.showAllFloors()?null:c.getActiveFloor()}function _(){const t=S();return t===null?u.filter(n=>!n.virtual):u.filter(n=>n.p0.layer===t&&!n.virtual)}function V(){if(!o||!r)return null;const t=_();return t.length?{from:o,to:r,routePoints:tt(t),visibleLines:t}:null}function m(t=null,n=!1){if(!o||!r)return;const i=Z({routeLines:u,currentRouteLayer:S(),from:o,to:r,snap:t});O.draw(i,n),p=i.distance}function g(t){const n=V();if(!n){l.setTrail(null,null);return}const i=s&&t&&!t.snapped?s:null,h=a=>a.bounds?.length?null:a.id===G?i:a,L=y?null:h(n.from);if(L){l.setTrail(n.routePoints[n.routePoints.length-1],L);return}const b=h(n.to);l.setTrail(b?n.routePoints[0]:null,b)}function U(){if(!o||!r)return;const t=V();if(!t){d.hide(),I.clear(),l.clearTrail(),m();return}d.place(o,r,t.routePoints,T),I.place(u),m(),g(null)}function w(){if(!o||!r)return;const t=V();t&&d.place(o,r,t.routePoints,T)}function F(){if(T=!1,!s||!o||!r)return null;const t=u.filter(h=>!h.virtual);if(!t.length)return null;const n=V(),i=n?l.applyToRoute(s,n,t):J(s,t,{snapThreshold:E,from:o,to:r});return i.snapped&&(y=!0),T=i.snapped,i}function k(){const t=$(u,_());return N(t.lines,t.bounds),t}function W({from:t,to:n,waypoints:i,accessible:h}){const L=K({engine:A,from:t,to:n,waypoints:i,accessible:h});if(!L.length)return v(),!1;y=!1,o=t,r=n,u=L,U();const{lines:b}=k(),a=F();return w(),g(a),a&&m(a,!0),R(a?p:H(b)),e.flush(),!0}function j(t){const n=s!==null;if(s=t,!t){T=!1,l.hideIcon(),g(null),n&&w(),m(),R(p),e.flush();return}l.placeIcon(t);const i=F();w(),g(i),i&&m(i,!0),R(p),e.flush()}function q(){U();const t=F();w(),g(t),t&&m(t,!0),u.length&&k(),R(p),e.flush()}function v(){y=!1,u=[],o=null,r=null,p=0,d.hide(),I.clear(),l.clearTrail(),O.clear(),N([],new C),R(0),e.flush()}function z(){v(),s=null,e.destroy()}return{setRoute:W,onPositionChanged:j,onFloorChanged:q,clearRoute:v,destroy:z}}
@@ -1,6 +1,6 @@
1
- import { type IconProvider } from '../adapters';
2
- import { type WayfindingRenderer } from '../renderer';
3
- import { type PositionInput } from './types';
1
+ import type { IconProvider } from '../adapters';
2
+ import type { WayfindingRenderer } from '../renderer';
3
+ import type { PositionInput } from './types';
4
4
  export declare const CURRENT_POSITION_POINT_ID = "current-position";
5
5
  interface PositionView {
6
6
  /**
@@ -1 +1 @@
1
- export const CURRENT_POSITION_POINT_ID="current-position";const c="position";export function createPositionView({renderer:o,iconProvider:i,layer:s}){return{place(n,t){const e=Number.isFinite(n.angle),a=e?"current_arrow":"current",r=e?n.angle*Math.PI/180:void 0;o.setIcon(c,{canvas:i.getIcon(a).canvas,layer:s,x:n.x,y:n.y,rotation:r,hidden:t,dimmed:t,origin:[.5,.5]})},hide(){o.setIcon(c,null)}}}
1
+ import{degToRad as I}from"@expofp/geometry";export const CURRENT_POSITION_POINT_ID="current-position";const c="position";export function createPositionView({renderer:n,iconProvider:i,layer:r}){return{place(o,e){const t=Number.isFinite(o.angle),s=t?"current_arrow":"current",a=t?I(o.angle):void 0;n.setIcon(c,{canvas:i.getIcon(s).canvas,layer:r,x:o.x,y:o.y,rotation:a,hidden:e,dimmed:e,origin:[.5,.5]})},hide(){n.setIcon(c,null)}}}
@@ -1,14 +1,15 @@
1
- import type { BoundingBox, RouteLine } from '../core';
1
+ import type { RouteLine } from '../core';
2
+ import { Box } from '@expofp/geometry';
2
3
  /**
3
4
  * Compute the payload for the runtime's `onRouteUpdate` callback:
4
5
  * - `lines`: route lines as the consumer sees them — virtual graph-internal
5
6
  * segments are filtered out before publication.
6
- * - `bounds`: bounding box over the visible route points, or `null` when
7
- * the route is empty or collapses to a single point (no useful viewport
8
- * to fit).
7
+ * - `bounds`: bounding box over the visible route points. It is an EMPTY box
8
+ * (`bounds.isEmpty()`) when the route is empty or collapses to a single point
9
+ * (no useful viewport to fit); consumers check `isEmpty()` rather than null.
9
10
  */
10
11
  export declare function computeRouteUpdate(routeLines: ReadonlyArray<RouteLine>, visibleLines: ReadonlyArray<RouteLine>): {
11
12
  lines: RouteLine[];
12
- bounds: BoundingBox | null;
13
+ bounds: Box;
13
14
  };
14
15
  //# sourceMappingURL=routeUpdate.d.ts.map
@@ -1 +1 @@
1
- import{computeBoundingBox as p}from"../core";export function computeRouteUpdate(u,r){const n=u.filter(t=>!t.virtual),e=r.flatMap(t=>[t.p0,t.p1]),o=p(e);return o?o.x1===o.x2&&o.y1===o.y2?{lines:n,bounds:null}:{lines:n,bounds:o}:{lines:n,bounds:null}}
1
+ import{computeBoundingBox as r}from"../core";export function computeRouteUpdate(t,n){const p=t.filter(o=>!o.virtual),u=n.flatMap(o=>[o.p0,o.p1]),e=r(u);return{lines:p,bounds:e}}
@@ -1,4 +1,5 @@
1
- import type { BoundingBox, RouteEndpoint, RouteLine, TransitionPointDef, WayfindingEngine } from '../core';
1
+ import type { Box } from '@expofp/geometry';
2
+ import type { RouteEndpoint, RouteLine, TransitionPointDef, WayfindingEngine } from '../core';
2
3
  import type { WayfindingRenderer } from '../renderer';
3
4
  import type { IconProvider } from '../adapters';
4
5
  /** User position + optional heading, without efp store coupling. */
@@ -46,8 +47,8 @@ export interface WayfindingRuntimeConfig {
46
47
  readonly layers: LayerNames;
47
48
  readonly snapThreshold: number;
48
49
  readonly onTransitionClick: (point: TransitionPointDef) => void;
49
- /** Fired when the route itself changes. `bounds` is the bbox of visible route points (null when empty). */
50
- readonly onRouteUpdate: (lines: RouteLine[], bounds: BoundingBox | null) => void;
50
+ /** Fired when the route itself changes. `bounds` is the bbox of visible route points; call `bounds.isEmpty()` to detect an empty/cleared route. */
51
+ readonly onRouteUpdate: (lines: RouteLine[], bounds: Box) => void;
51
52
  /** Fired when distance changes — on route change and on position snap updates. */
52
53
  readonly onRouteDistance: (distance: number) => void;
53
54
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expofp/floorplan",
3
- "version": "3.7.17",
3
+ "version": "3.8.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/expofp/efp-app.git",
@@ -66,15 +66,15 @@
66
66
  "react-virtuoso": "^4.12.6",
67
67
  "react-zoom-pan-pinch-sr": "^0.2.0",
68
68
  "resize-observer": "^1.0.4",
69
- "simple-geometry": "^1.0.5",
70
69
  "slugify": "1.6.6",
71
70
  "stats-gl": "^3.6.0",
72
71
  "swiper": "^9.1.0",
73
72
  "tslib": "^2.3.0",
74
73
  "uuid": "^9.0.1",
75
74
  "zod": "4.3.5",
76
- "@expofp/debug": "3.7.17",
77
- "@expofp/resolve": "3.7.17"
75
+ "@expofp/geometry": "3.8.0",
76
+ "@expofp/resolve": "3.8.0",
77
+ "@expofp/debug": "3.8.0"
78
78
  },
79
79
  "devDependencies": {
80
80
  "@babel/plugin-proposal-decorators": "^8.0.2",
@@ -1,28 +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.7.17" };
5
- var t = new e.Error().stack;
6
- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "26b953ae-2311-4500-b58c-f1a4cfb22319", e._sentryDebugIdIdentifier = "sentry-dbid-26b953ae-2311-4500-b58c-f1a4cfb22319");
7
- } catch {}
8
- })();
9
- import "./rolldown-runtime-DDajFMnr.js";
10
- import { t as e } from "./react-C94g1dWf.js";
11
- import { t } from "./jsx-runtime-CcqjcKRn.js";
12
- import "./i18n-GqZrkrT3.js";
13
- import { t as n } from "./index.module-ClFPQstA.js";
14
- import { lt as r, o as i, ut as a } from "./store-39MLQcdz.js";
15
- import { n as o } from "./mobx-9haaaJQN.js";
16
- import { t as s } from "./KioskStore-D3xv5iMJ.js";
17
- import { t as c } from "./TouchHand-DjRl3mqw.js";
18
- e();
19
- var l = t(), u = n(() => (o(() => {
20
- if (localStorage.getItem("kiosk") === "0") return;
21
- s.restoreData();
22
- let e = s.kiosk;
23
- if (e) return r(e, !0), a(e), s.resetCamera(), i.setResetCameraFn(() => s.resetCamera()), () => {
24
- i.uiState.setKioskData(null), i.uiState.resetMapSettings();
25
- };
26
- }), i.uiState.kiosk && i.uiState.inIdle ? /* @__PURE__ */ (0, l.jsx)(c, {}) : null));
27
- //#endregion
28
- export { u as default };
@@ -1,7 +0,0 @@
1
- import { Rect as RectShape } from '@expofp/renderer';
2
- import CoreRect from '../../../../core/Rect';
3
- export declare class Rect extends RectShape {
4
- static fromCoreRect(rect: CoreRect, rotate?: number): RectShape;
5
- static inflateRect(rect: Rect, borderWidth: number): Rect;
6
- }
7
- //# sourceMappingURL=Rect.d.ts.map
@@ -1 +0,0 @@
1
- import{Rect as n}from"@expofp/renderer";export class Rect extends n{static fromCoreRect(x,a=0){return new n({x:x.x1,y:x.y1},{x:x.x2,y:x.y2},-a)}static inflateRect(x,a){return new Rect({x:x.min.x+a,y:x.min.y+a},{x:x.max.x-a,y:x.max.y-a},x.rotation)}}
@@ -1,12 +0,0 @@
1
- import type Rect from './Rect';
2
- export default class Line {
3
- x1: number;
4
- x2: number;
5
- y1: number;
6
- y2: number;
7
- constructor(x1: number, y1: number, x2: number, y2: number);
8
- static fromSvgLineElement(svgLine: SVGLineElement): Line;
9
- static fromRect(r: Rect): Line[];
10
- intersects(r: Rect | Line): boolean;
11
- }
12
- //# sourceMappingURL=Line.d.ts.map
@@ -1 +0,0 @@
1
- export default class s{x1;x2;y1;y2;constructor(t,x,y,h){this.x1=t,this.y1=x,this.x2=y,this.y2=h}static fromSvgLineElement(t){return new s(t.x1.baseVal.value,t.y1.baseVal.value,t.x2.baseVal.value,t.y2.baseVal.value)}static fromRect(t){return[new s(t.x1,t.y1,t.x2,t.y1),new s(t.x2,t.y1,t.x2,t.y2),new s(t.x2,t.y2,t.x1,t.y2),new s(t.x1,t.y2,t.x1,t.y1)]}intersects(t){const x=this.x1>this.x2||this.x1===this.x2&&this.y2<this.y1,y=x?this.x2:this.x1,h=x?this.x1:this.x2,a=x?this.y2:this.y1,e=x?this.y1:this.y2;return h>=t.x1&&y<=t.x2&&e>=t.y1&&a<=t.y2}}
@@ -1,16 +0,0 @@
1
- import type Rect from './Rect';
2
- export default class Polygon4 {
3
- x1: number;
4
- y1: number;
5
- x2: number;
6
- y2: number;
7
- x3: number;
8
- y3: number;
9
- x4: number;
10
- y4: number;
11
- private constructor();
12
- static fromRect(r: Rect): Polygon4;
13
- rotate(radians: number, cx: number, cy: number): Polygon4;
14
- toTriangles(): [Triangle, Triangle];
15
- }
16
- //# sourceMappingURL=Polygon.d.ts.map
@@ -1 +0,0 @@
1
- export default class n{x1;y1;x2;y2;x3;y3;x4;y4;constructor(t,i,h,x,y,s,o,c){this.x1=t,this.y1=i,this.x2=h,this.y2=x,this.x3=y,this.y3=s,this.x4=o,this.y4=c}static fromRect(t){return new n(t.x1,t.y1,t.x2,t.y1,t.x2,t.y2,t.x1,t.y2)}rotate(t,i,h){if(!t)return this;const x=Math.sin(t),y=Math.cos(t);function s(e,r){const u=e-i,a=r-h,m=u*y+a*x,p=a*y-u*x;return e=i+m,r=h+p,[e,r]}const[o,c]=s(this.x1,this.y1),[f,w]=s(this.x2,this.y2),[l,D]=s(this.x3,this.y3),[M,d]=s(this.x4,this.y4);return new n(o,c,f,w,l,D,M,d)}toTriangles(){return[[[this.x1,this.y1],[this.x2,this.y2],[this.x4,this.y4]],[[this.x2,this.y2],[this.x4,this.y4],[this.x3,this.y3]]]}}
@@ -1,36 +0,0 @@
1
- export default class Rect {
2
- x1: number;
3
- x2: number;
4
- y1: number;
5
- y2: number;
6
- get h(): number;
7
- get w(): number;
8
- get cx(): number;
9
- get cy(): number;
10
- private constructor();
11
- static fromX1y1x2y2(x1: number, y1: number, x2: number, y2: number): Rect;
12
- static fromXywh(x: number, y: number, w: number, h: number): Rect;
13
- static fromCxcywh(cx: number, cy: number, w: number, h: number): Rect;
14
- static fromXywhRect(rect: {
15
- x: number;
16
- y: number;
17
- w: number;
18
- h: number;
19
- }): Rect;
20
- static fromSvgRectElement(svgRect: SVGRectElement): Rect;
21
- static fromMultiple(rects: Rect[]): Rect;
22
- contains(r: Rect): boolean;
23
- intersects(r: Rect): boolean;
24
- getIntersection(r: Rect): Rect;
25
- getRotated90(): Rect;
26
- normalize(width: number, height: number): Rect;
27
- withPadding(x: number, y?: number): Rect;
28
- scale(s: number): Rect;
29
- getArea(): number;
30
- clone(): Rect;
31
- translate(dx: number, dy: number): this;
32
- equals(r: Rect): boolean;
33
- toString(): string;
34
- containsPoint(x: number, y: number): boolean;
35
- }
36
- //# sourceMappingURL=Rect.d.ts.map
@@ -1 +0,0 @@
1
- export default class n{x1;x2;y1;y2;get h(){return Math.abs(this.y2-this.y1)}get w(){return Math.abs(this.x2-this.x1)}get cx(){return(this.x1+this.x2)/2}get cy(){return(this.y1+this.y2)/2}constructor(t,i,s,h){if(t>s){const r=t;t=s,s=r}if(i>h){const r=i;i=h,h=r}if(t>s||i>h)throw new Error(`Invalid rect ${t} ${s} ${i} ${h}`);this.x1=t,this.y1=i,this.x2=s,this.y2=h}static fromX1y1x2y2(t,i,s,h){return new n(t,i,s,h)}static fromXywh(t,i,s,h){return this.fromX1y1x2y2(t,i,t+s,i+h)}static fromCxcywh(t,i,s,h){return this.fromX1y1x2y2(t-s/2,i-h/2,t+s/2,i+h/2)}static fromXywhRect(t){return this.fromX1y1x2y2(t.x,t.y,t.x+t.w,t.y+t.h)}static fromSvgRectElement(t){return this.fromXywh(t.x.baseVal.value,t.y.baseVal.value,t.width.baseVal.value,t.height.baseVal.value)}static fromMultiple(t){return n.fromX1y1x2y2(Math.min(...t.map(i=>i.x1)),Math.min(...t.map(i=>i.y1)),Math.max(...t.map(i=>i.x2)),Math.max(...t.map(i=>i.y2)))}contains(t){return t.x1>=this.x1&&t.x2<=this.x2&&t.y1>=this.y1&&t.y2<=this.y2}intersects(t){const i=Math.max(this.x1,t.x1),s=Math.min(this.x2,t.x2),h=Math.max(this.y1,t.y1),r=Math.min(this.y2,t.y2);return s>=i&&r>=h}getIntersection(t){const i=Math.max(this.x1,t.x1),s=Math.min(this.x2,t.x2),h=Math.max(this.y1,t.y1),r=Math.min(this.y2,t.y2);return s>=i&&r>=h?n.fromX1y1x2y2(i,h,s,r):n.fromX1y1x2y2(0,0,0,0)}getRotated90(){return n.fromCxcywh(this.cx,this.cy,this.h,this.w)}normalize(t,i){const s=this.x1/t,h=this.x2/t,r=this.y1/i,y=this.y2/i;return n.fromX1y1x2y2(s,r,h,y)}withPadding(t,i=t){return this.w<t*2||this.h<i*2?this:n.fromCxcywh(this.cx,this.cy,this.w-t*2,this.h-i*2)}scale(t){return n.fromX1y1x2y2(this.x1*t,this.y1*t,this.x2*t,this.y2*t)}getArea(){return this.w*this.h}clone(){return new n(this.x1,this.y1,this.x2,this.y2)}translate(t,i){return this.x1+=t,this.x2+=t,this.y1+=i,this.y2+=i,this}equals(t){return t.x1===this.x1&&t.x2===this.x2&&t.y1===this.y1&&t.y2===this.y2}toString(){return this.x1+","+this.y1+","+this.w+","+this.h}containsPoint(t,i){return t>=this.x1&&t<=this.x2&&i>=this.y1&&i<=this.y2}}
@@ -1,7 +0,0 @@
1
- export default class Size {
2
- width: number;
3
- height: number;
4
- constructor(width: number, height: number);
5
- scale(s: number): Size;
6
- }
7
- //# sourceMappingURL=Size.d.ts.map
@@ -1 +0,0 @@
1
- export default class h{width;height;constructor(t,i){this.width=t,this.height=i}scale(t){return new h(this.width*t,this.height*t)}}
@@ -1,7 +0,0 @@
1
- /**
2
- * Great-circle distance between two GPS points using the Haversine formula.
3
- *
4
- * @returns distance in metres
5
- */
6
- export declare function haversineDistance(lat1: number, lng1: number, lat2: number, lng2: number): number;
7
- //# sourceMappingURL=haversineDistance.d.ts.map
@@ -1 +0,0 @@
1
- export function haversineDistance(t,c,n,M){const o=t*Math.PI/180,i=n*Math.PI/180,s=(n-t)*Math.PI/180,a=(M-c)*Math.PI/180,h=Math.sin(s/2)*Math.sin(s/2)+Math.cos(o)*Math.cos(i)*Math.sin(a/2)*Math.sin(a/2);return 6371e3*(2*Math.atan2(Math.sqrt(h),Math.sqrt(1-h)))}