@expofp/floorplan 3.2.6 → 3.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/{CookieConsent-AXeH9_mR.js → CookieConsent-B1LE7YfT.js} +2990 -2572
- package/dist/browser/{Debug-D5ilpjt9.js → Debug-DhDzWQYS.js} +7 -7
- package/dist/browser/{Demo-D2ZQ82R-.js → Demo-D_175gLz.js} +11 -11
- package/dist/browser/{Free-Cmu2GELK.js → Free-eF7PbjEi.js} +13 -13
- package/dist/browser/{Gallery-CHhf9uSJ.js → Gallery-BA-pvWo8.js} +9 -9
- package/dist/browser/{GpsLoader-D1p1K7tv.js → GpsLoader-CfS8cpM_.js} +35 -35
- package/dist/browser/{KioskStore-B5seJF_w.js → KioskStore-D6ga9Qev.js} +17 -17
- package/dist/browser/{Mapbox-vm-JvDPW.js → Mapbox-B2UgukAw.js} +41 -41
- package/dist/browser/{SetKioskMode-CsvIhnEp.js → SetKioskMode-DN9dYtQq.js} +18 -18
- package/dist/browser/ShowKiosk-NOvinyaO.js +26 -0
- package/dist/browser/{ThreeComponent-l50EC7kp.js → ThreeComponent-Dd6C-3ZE.js} +195 -195
- package/dist/browser/{TouchHand-CzIhbCk_.js → TouchHand-D4zCIp9f.js} +4 -4
- package/dist/browser/{ViewerMenuPanel-DN5BiNZZ.js → ViewerMenuPanel-3gfsNYAC.js} +17 -17
- package/dist/browser/{add-debug-secret-listener-BP0ji46o.js → add-debug-secret-listener-PCn2L2xn.js} +1 -1
- package/dist/browser/{boolean-editor-BIXc9xad.js → boolean-editor-C62I7paI.js} +10 -10
- package/dist/browser/bootIntercom-CJp5myUd.js +37 -0
- package/dist/browser/{box-Cj2OPB5o.js → box-BllGyNzW.js} +5 -5
- package/dist/browser/{browser-iEBlxETL.js → browser-hErw7TCJ.js} +2 -2
- package/dist/browser/bundle.json +53 -53
- package/dist/browser/{classnames-BdEjlCJw.js → classnames-DZ15rBvY.js} +2 -2
- package/dist/browser/{client-AFMbhyej.js → client-vSscuHGN.js} +4 -4
- package/dist/browser/{data-BNcMQJM9.js → data-Pg90oQgy.js} +49 -49
- package/dist/browser/{debug-overlay-BvzIl4S5.js → debug-overlay-Cz0LzO7B.js} +11 -11
- package/dist/browser/{debug-ui-Cjk1VEBj.js → debug-ui-HOJ52C7W.js} +6 -6
- package/dist/browser/{dist-CpONuUgR.js → dist-B-j5Mwk6.js} +5 -5
- package/dist/browser/{dist-CCy_DoUq.js → dist-D1FyJZyA.js} +6 -6
- package/dist/browser/{dist-B03hOAXP.js → dist-Di6V6Vgc.js} +3 -3
- package/dist/browser/{efp-debug-init-DjqnYMK4.js → efp-debug-init-GJ1wnZRj.js} +2 -2
- package/dist/browser/{enum-editor-DNavJMSd.js → enum-editor-DDYy1Hf6.js} +11 -11
- package/dist/browser/{exports-BaXbuICo.js → exports-D2FWPMfV.js} +1 -1
- package/dist/browser/{favicon-CPIIkXVW.js → favicon-CLnUT7_M.js} +1 -1
- package/dist/browser/{fetch-retry.umd-DuhpKOAv.js → fetch-retry.umd-CsTB0zFM.js} +2 -2
- package/dist/browser/{flex-BEEq9bN8.js → flex-fdrXlk1E.js} +6 -6
- package/dist/browser/{flex.props-DxAZIGSj.js → flex.props-CKl-laU4.js} +2 -2
- package/dist/browser/{floorplan.loader-KZ3u0Juq.js → floorplan.loader-B9u5roId.js} +9 -9
- package/dist/browser/{floorplan.ready-DMR98iUb.js → floorplan.ready-DhqJ6xoZ.js} +215 -254
- package/dist/browser/{fuse-CjSkZXtV.js → fuse-BiPQjoVv.js} +2 -2
- package/dist/browser/index.js +12 -12
- package/dist/browser/{is-debug-DPDBcjeg.js → is-debug-DatwRSE7.js} +3 -3
- package/dist/browser/{jsx-runtime-DnQmxKxk.js → jsx-runtime-IE8skafD.js} +2 -2
- package/dist/browser/{lib-BXRYaEmQ.js → lib-DeP5xNNM.js} +4 -4
- package/dist/browser/{main-Bw8nBuIh.js → main-DHo0y8hQ.js} +1 -1
- package/dist/browser/{mobx-DsBbHmhw.js → mobx-CrV9DCMJ.js} +4 -4
- package/dist/browser/{particles.min-BmgWvtXZ.js → particles.min-CvpZUl3e.js} +2 -2
- package/dist/browser/{prop-types-CRT2Qy-L.js → prop-types-BHwYgrUd.js} +2 -2
- package/dist/browser/{react-BCrcyjAU.js → react-B3Fm-ZS0.js} +2 -2
- package/dist/browser/{react-dom-z6XbaPl9.js → react-dom-CySklTOi.js} +3 -3
- package/dist/browser/{reset-all-settings-BOrTf1Lp.js → reset-all-settings-Cl74zGyE.js} +7 -7
- package/dist/browser/{rolldown-runtime-BSQQuCTD.js → rolldown-runtime-BAuBEODA.js} +1 -1
- package/dist/browser/{settings-DTDJKJjP.js → settings-BIgQOlLC.js} +2 -2
- package/dist/browser/{settings-item-DdnzmVZj.js → settings-item-CMHd9Vr7.js} +6 -6
- package/dist/browser/{store-CB1U4gvI.js → store-WG-XbhCX.js} +4643 -4503
- package/dist/browser/{string-editor-BEncfiNG.js → string-editor-Cdda3m3H.js} +8 -8
- package/dist/browser/{theme-RyeKAHMc.js → theme-CEfCl0Wg.js} +8 -8
- package/dist/browser/{ui-D5E2lSMl.js → ui-Cxw-zCCr.js} +8 -8
- package/dist/esm/RouteCutIn.js +1 -1
- package/dist/esm/components/IntercomLauncher.d.ts +5 -0
- package/dist/esm/components/IntercomLauncher.js +1 -0
- package/dist/esm/components/Layout.js +1 -1
- package/dist/esm/components/Map/Map.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-all.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-booths.js +1 -1
- package/dist/esm/components/SearchBox.js +1 -1
- package/dist/esm/components/gps/useUserLocationAndHeading.js +1 -1
- package/dist/esm/components/gps/utils.js +1 -1
- package/dist/esm/floorplan.ready.js +1 -1
- package/dist/esm/intercom/bootIntercom.js +1 -19
- package/dist/esm/services/routing.js +1 -1
- package/dist/esm/store/BoothStore.d.ts +0 -1
- package/dist/esm/store/BoothStore.js +1 -1
- package/dist/esm/store/IntercomStore.d.ts +7 -0
- package/dist/esm/store/IntercomStore.js +1 -0
- package/dist/esm/store/RootStore.d.ts +2 -0
- package/dist/esm/store/RootStore.js +1 -1
- package/dist/esm/store/RouteStore.d.ts +1 -1
- package/dist/esm/store/RouteStore.js +1 -1
- package/dist/esm/store/UIState.js +1 -1
- package/dist/esm/store/index.d.ts +1 -0
- package/dist/esm/store/index.js +1 -1
- package/dist/esm/store/init/init-booths.js +1 -1
- package/dist/esm/tools/track-event.js +1 -1
- package/dist/esm/utils/customCommands.d.ts +1 -1
- package/dist/esm/utils/customCommands.js +1 -1
- package/dist/esm/utils/gps.d.ts +0 -1
- package/dist/esm/utils/gps.js +1 -1
- package/dist/esm/utils/haversineDistance.d.ts +7 -0
- package/dist/esm/utils/haversineDistance.js +1 -0
- package/dist/esm/wayfinding/adapters/boothToEndpoint.d.ts +13 -0
- package/dist/esm/wayfinding/adapters/boothToEndpoint.js +1 -0
- package/dist/esm/wayfinding/adapters/boothToWaypoint.d.ts +1 -1
- package/dist/esm/wayfinding/adapters/canvasIconProvider.d.ts +20 -0
- package/dist/esm/wayfinding/adapters/canvasIconProvider.js +1 -0
- package/dist/esm/wayfinding/adapters/floorContext.d.ts +10 -0
- package/dist/esm/wayfinding/adapters/floorContext.js +1 -0
- package/dist/esm/wayfinding/adapters/graphDataSource.d.ts +1 -1
- package/dist/esm/wayfinding/adapters/iconProvider.d.ts +15 -0
- package/dist/esm/wayfinding/adapters/index.d.ts +9 -0
- package/dist/esm/wayfinding/adapters/index.js +1 -0
- package/dist/esm/wayfinding/adapters/kioskCanvas.d.ts +7 -0
- package/dist/esm/wayfinding/adapters/kioskCanvas.js +1 -0
- package/dist/esm/wayfinding/adapters/positionInput.d.ts +11 -0
- package/dist/esm/wayfinding/adapters/positionInput.js +1 -0
- package/dist/esm/wayfinding/bindMobxReactions.d.ts +27 -0
- package/dist/esm/wayfinding/bindMobxReactions.js +1 -0
- package/dist/esm/wayfinding/{__tests__ → core/__tests__}/helpers.d.ts +0 -5
- package/dist/esm/wayfinding/core/__tests__/helpers.js +1 -0
- package/dist/esm/wayfinding/core/createWayfindingEngine.d.ts +16 -0
- package/dist/esm/wayfinding/core/createWayfindingEngine.js +1 -0
- package/dist/esm/wayfinding/{graph → core/graph}/graphCache.d.ts +2 -1
- package/dist/esm/wayfinding/core/index.d.ts +16 -0
- package/dist/esm/wayfinding/core/index.js +1 -0
- package/dist/esm/wayfinding/core/position/distanceToRoute.d.ts +3 -0
- package/dist/esm/wayfinding/core/position/distanceToRoute.js +1 -0
- package/dist/esm/wayfinding/core/position/gpsThreshold.d.ts +22 -0
- package/dist/esm/wayfinding/core/position/gpsThreshold.js +1 -0
- package/dist/esm/wayfinding/core/position/shouldReroute.d.ts +3 -0
- package/dist/esm/wayfinding/core/position/shouldReroute.js +1 -0
- package/dist/esm/wayfinding/core/position/snapToRoute.d.ts +4 -0
- package/dist/esm/wayfinding/core/position/snapToRoute.js +1 -0
- package/dist/esm/{components/Map/drawing/config/route-snapping → wayfinding/core/position}/splitRouteByPoint.d.ts +1 -1
- package/dist/esm/wayfinding/core/position/splitRouteByPoint.js +1 -0
- package/dist/esm/wayfinding/core/rendering/computeTrailPoints.d.ts +19 -0
- package/dist/esm/wayfinding/core/rendering/computeTrailPoints.js +1 -0
- package/dist/esm/wayfinding/{rendering → core/rendering}/computeTransitionPoints.d.ts +2 -2
- package/dist/esm/wayfinding/core/rendering/computeTransitionPoints.js +1 -0
- package/dist/esm/wayfinding/core/rendering/getVisibleRouteLines.d.ts +11 -0
- package/dist/esm/wayfinding/core/rendering/getVisibleRouteLines.js +1 -0
- package/dist/esm/wayfinding/core/rendering/normalizeRouteDirection.d.ts +20 -0
- package/dist/esm/wayfinding/core/rendering/normalizeRouteDirection.js +1 -0
- package/dist/esm/wayfinding/core/rendering/routeGeometry.d.ts +15 -0
- package/dist/esm/wayfinding/core/rendering/routeGeometry.js +1 -0
- package/dist/esm/wayfinding/core/routing/optimizeWaypointOrder.d.ts +19 -0
- package/dist/esm/wayfinding/core/routing/optimizeWaypointOrder.js +1 -0
- package/dist/esm/wayfinding/core/routing/resolveWaypointCandidates.d.ts +7 -0
- package/dist/esm/wayfinding/core/routing/resolveWaypointCandidates.js +1 -0
- package/dist/esm/wayfinding/{types.d.ts → core/types.d.ts} +37 -0
- package/dist/esm/wayfinding/createWayfinding.d.ts +3 -0
- package/dist/esm/wayfinding/createWayfinding.js +1 -0
- package/dist/esm/wayfinding/handlers/kioskHandler.d.ts +25 -0
- package/dist/esm/wayfinding/handlers/kioskHandler.js +1 -0
- package/dist/esm/wayfinding/handlers/yahHandler.d.ts +23 -0
- package/dist/esm/wayfinding/handlers/yahHandler.js +1 -0
- package/dist/esm/wayfinding/layers.d.ts +14 -0
- package/dist/esm/wayfinding/layers.js +1 -0
- package/dist/esm/wayfinding/renderer/createWayfindingRenderer.d.ts +14 -0
- package/dist/esm/wayfinding/renderer/createWayfindingRenderer.js +1 -0
- package/dist/esm/wayfinding/renderer/iconManager.d.ts +31 -0
- package/dist/esm/wayfinding/renderer/iconManager.js +1 -0
- package/dist/esm/wayfinding/renderer/index.d.ts +3 -0
- package/dist/esm/wayfinding/renderer/index.js +1 -0
- package/dist/esm/wayfinding/renderer/layerManager.d.ts +27 -0
- package/dist/esm/wayfinding/renderer/layerManager.js +1 -0
- package/dist/esm/wayfinding/renderer/routeLineManager.d.ts +42 -0
- package/dist/esm/wayfinding/renderer/routeLineManager.js +1 -0
- package/dist/esm/wayfinding/renderer/trailManager.d.ts +27 -0
- package/dist/esm/wayfinding/renderer/trailManager.js +1 -0
- package/dist/esm/wayfinding/renderer/types.d.ts +162 -0
- package/dist/esm/wayfinding/runtime/createWayfindingRuntime.d.ts +3 -0
- package/dist/esm/wayfinding/runtime/createWayfindingRuntime.js +1 -0
- package/dist/esm/wayfinding/runtime/endpointView.d.ts +16 -0
- package/dist/esm/wayfinding/runtime/endpointView.js +1 -0
- package/dist/esm/wayfinding/runtime/getRouteLines.d.ts +13 -0
- package/dist/esm/wayfinding/runtime/getRouteLines.js +1 -0
- package/dist/esm/wayfinding/runtime/positionTrailView.d.ts +57 -0
- package/dist/esm/wayfinding/runtime/positionTrailView.js +1 -0
- package/dist/esm/wayfinding/runtime/positionView.d.ts +23 -0
- package/dist/esm/wayfinding/runtime/positionView.js +1 -0
- package/dist/esm/wayfinding/runtime/routeLinesView.d.ts +18 -0
- package/dist/esm/wayfinding/runtime/routeLinesView.js +1 -0
- package/dist/esm/wayfinding/runtime/routeRenderData.d.ts +29 -0
- package/dist/esm/wayfinding/runtime/routeRenderData.js +1 -0
- package/dist/esm/wayfinding/runtime/routeUpdate.d.ts +14 -0
- package/dist/esm/wayfinding/runtime/routeUpdate.js +1 -0
- package/dist/esm/wayfinding/runtime/trailView.d.ts +21 -0
- package/dist/esm/wayfinding/runtime/trailView.js +1 -0
- package/dist/esm/wayfinding/runtime/transitionView.d.ts +18 -0
- package/dist/esm/wayfinding/runtime/transitionView.js +1 -0
- package/dist/esm/wayfinding/runtime/types.d.ts +72 -0
- package/dist/esm/wayfinding/runtime/types.js +1 -0
- package/dist/esm/wayfinding/utils/findBoothInRadius.d.ts +4 -0
- package/dist/esm/wayfinding/utils/findBoothInRadius.js +1 -0
- package/package.json +3 -3
- package/dist/browser/ShowKiosk-BL9nfBDf.js +0 -26
- package/dist/browser/bootIntercom-D3i1xdrZ.js +0 -40
- package/dist/esm/components/Map/drawing/config/config-booth-scaled.d.ts +0 -14
- package/dist/esm/components/Map/drawing/config/config-booth-scaled.js +0 -1
- package/dist/esm/components/Map/drawing/config/config-wf.d.ts +0 -8
- package/dist/esm/components/Map/drawing/config/config-wf.js +0 -1
- package/dist/esm/components/Map/drawing/config/config-yah.d.ts +0 -2
- package/dist/esm/components/Map/drawing/config/config-yah.js +0 -1
- package/dist/esm/components/Map/drawing/config/route-snapping/index.d.ts +0 -5
- package/dist/esm/components/Map/drawing/config/route-snapping/index.js +0 -1
- package/dist/esm/components/Map/drawing/config/route-snapping/snapPositionToRoute.d.ts +0 -21
- package/dist/esm/components/Map/drawing/config/route-snapping/snapPositionToRoute.js +0 -1
- package/dist/esm/components/Map/drawing/config/route-snapping/splitRouteByPoint.js +0 -1
- package/dist/esm/components/Map/drawing/config/route-snapping/types.d.ts +0 -18
- package/dist/esm/components/Map/drawing/config/route-snapping/utils.d.ts +0 -29
- package/dist/esm/components/Map/drawing/config/route-snapping/utils.js +0 -1
- package/dist/esm/utils/buildOptimizedRoute.d.ts +0 -11
- package/dist/esm/utils/buildOptimizedRoute.js +0 -1
- package/dist/esm/utils/yah.d.ts +0 -8
- package/dist/esm/utils/yah.js +0 -1
- package/dist/esm/wayfinding/_PLAN-public-api.d.ts +0 -220
- package/dist/esm/wayfinding/__integration__/legacy/legacyWayfinding.d.ts +0 -27
- package/dist/esm/wayfinding/__integration__/legacy/legacyWayfinding.js +0 -1
- package/dist/esm/wayfinding/__tests__/helpers.js +0 -1
- package/dist/esm/wayfinding/index.d.ts +0 -18
- package/dist/esm/wayfinding/index.js +0 -1
- package/dist/esm/wayfinding/rendering/computeTransitionPoints.js +0 -1
- package/dist/esm/wayfinding/rendering/normalizeRouteDirection.d.ts +0 -19
- package/dist/esm/wayfinding/rendering/normalizeRouteDirection.js +0 -1
- package/dist/esm/wayfinding/rendering/routeGeometry.d.ts +0 -16
- package/dist/esm/wayfinding/rendering/routeGeometry.js +0 -1
- package/dist/esm/wayfinding/routing/getGraphLines.d.ts +0 -14
- package/dist/esm/wayfinding/routing/getGraphLines.js +0 -1
- /package/dist/esm/{components/Map/drawing/config/route-snapping/types.js → wayfinding/adapters/iconProvider.js} +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/buildGraph.d.ts +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/buildGraph.js +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/buildNGraph.d.ts +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/buildNGraph.js +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/constants.d.ts +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/constants.js +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/findShortestPath.d.ts +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/findShortestPath.js +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/graphCache.js +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/graphHelpers.d.ts +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/graphHelpers.js +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/linkCost.d.ts +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/linkCost.js +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/pathfinder/aStarPathFinder.d.ts +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/pathfinder/aStarPathFinder.js +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/pathfinder/parseNodeId.d.ts +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/pathfinder/parseNodeId.js +0 -0
- /package/dist/esm/wayfinding/{routing → core/routing}/buildMultiPointRoute.d.ts +0 -0
- /package/dist/esm/wayfinding/{routing → core/routing}/buildMultiPointRoute.js +0 -0
- /package/dist/esm/wayfinding/{routing → core/routing}/buildRoute.d.ts +0 -0
- /package/dist/esm/wayfinding/{routing → core/routing}/buildRoute.js +0 -0
- /package/dist/esm/wayfinding/{routing → core/routing}/findNearestGraphPoint.d.ts +0 -0
- /package/dist/esm/wayfinding/{routing → core/routing}/findNearestGraphPoint.js +0 -0
- /package/dist/esm/wayfinding/{routing → core/routing}/getRouteLength.d.ts +0 -0
- /package/dist/esm/wayfinding/{routing → core/routing}/getRouteLength.js +0 -0
- /package/dist/esm/wayfinding/{routing → core/routing}/routeResult.d.ts +0 -0
- /package/dist/esm/wayfinding/{routing → core/routing}/routeResult.js +0 -0
- /package/dist/esm/wayfinding/{types.js → core/types.js} +0 -0
- /package/dist/esm/wayfinding/{_PLAN-public-api.js → renderer/types.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import c from"../data";import
|
|
1
|
+
import c from"../data";import i from"./logger";import{getLocationHistory as f}from"../services/routing";import{uiState as m}from"../store";import{getSavedKiosk as u}from"../components/Kiosk/SetKiosk";import{requestKioskKey as p}from"../components/Kiosk/requestKioskKey";import{createTelemetry as d}from"./telemetry";let a;function g(){if(a)return a;const r=window.__efpEvent;let t;try{const e=new URL(c.trackerUrl).searchParams.get("expoId");t=e?Number(e):void 0}catch(e){i.error(e)}return a=d({url:"https://app.expofp.com/api/telemetry",expo:r,expoId:t}),a}function s(r,t){const e=f(),n=e[e.length-2];return{type:r,value:t!==void 0?String(t):"",timestamp:new Date().toISOString(),url:window.location.href,referrer:n?window.location.origin+n:""}}function S(){return!!c?.trackerUrl&&process.env.NODE_ENV==="production"&&!m.heatmap}export default async function v(r,t){if(i.log("trackEvent",r,t),!!S())try{const e=g(),n=u();if(n){const o=await k(n);if(o)e.setKioskId(o);else{e.enqueue(s(r,t));return}}y(e),await e.send(s(r,t))}catch(e){i.error("trackEvent",String(e))}}async function k(r){if(!r)return null;const t="expofp-kiosk-stats-id";let e=localStorage.getItem(t);return e||(e=await p(r,"https://app.expofp.com/"),e?(localStorage.setItem(t,e),e):null)}let l=!1;function y(r){if(l)return;l=!0;const t="efp-track-events";try{const e=localStorage.getItem(t);if(!e)return;const n=JSON.parse(e);if(!Array.isArray(n)){localStorage.removeItem(t);return}for(const o of n)!o||typeof o!="object"||!o.headers||r.enqueue({type:o.type,value:o.value!==void 0?String(o.value):"",timestamp:o.timeStamp,url:o.headers["X-href"],referrer:o.headers["X-ref"]??""});localStorage.removeItem(t)}catch(e){localStorage.removeItem(t),i.error("Failed to migrate old events.",String(e))}}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function handleCustomCommand(text: string
|
|
1
|
+
export declare function handleCustomCommand(text: string): boolean;
|
|
2
2
|
//# sourceMappingURL=customCommands.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{DEBUG_KEY as i,SET_KIOSK_KEY as a}from"../constants";import{getRebookingTokenFromQuery as n}from"../tools/rebookingUrl";import{handleDebugMode as s}from"../tools/handleDebugMode";import l,{uiState as c}from"../store";export function handleCustomCommand(o){if(o=o.trim(),o.toLowerCase()==="__addcache")navigator.serviceWorker.getRegistrations().then(r=>{if(!r.length)return alert("No registered service workers.");var t=[];l.exhibitorStore.exhibitors.forEach(e=>{t.push(e.logo),t.push(...e.gallery||[])}),Promise.all(t.map(e=>fetch(e))).then(e=>alert(`${e.length} images loaded.`)).catch(e=>alert(e))});else if(/^copy_exh=\d+/.test(o)){const r=o.match(/^copy_exh=(\d+)/);if(r&&!isNaN(parseInt(r[1]))){const e=`${window.location.origin+window.location.pathname}?${r[0]}`;window.location.replace(e)}}else{if(n())return!0;o.startsWith(i)?s():o.toLowerCase().startsWith(a)&&c.enableSetKioskMode(!0)}return!1}
|
package/dist/esm/utils/gps.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { CurrentPosition } from "../store/RouteStore";
|
|
2
|
-
export declare function distance(lat1: number, lng1: number, lat2: number, lng2: number): number;
|
|
3
2
|
export declare function bearing(lat1: number, lng1: number, lat2: number, lng2: number): number;
|
|
4
3
|
export interface GpsConfig {
|
|
5
4
|
p0: {
|
package/dist/esm/utils/gps.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getAngle as
|
|
1
|
+
import{getAngle as x,lineAngle as y,lineCenter as G,lineLength as h,rotatePoint as L,shiftPoint as B}from"simple-geometry";import b from"../tools/logger";import{fpGeo as R}from"../data/fpGeo";import{haversineDistance as u}from"./haversineDistance";const g=6371e3,S=-180,T=180;let v=n=>n*Math.PI/180,d=n=>n*180/Math.PI;export function bearing(n,l,t,s){const a=n*Math.PI/180,r=t*Math.PI/180,e=(s-l)*Math.PI/180,o=Math.sin(e)*Math.cos(r),c=Math.cos(a)*Math.sin(r)-Math.sin(a)*Math.cos(r)*Math.cos(e);return(Math.atan2(o,c)*180/Math.PI+360)%360}export function isValidPointCoords(n){return typeof n=="number"&&Number.isFinite(n)}export function convertGpsToLocal({lat:n,lng:l,angle:t},s){if(!(isValidPointCoords(n)&&isValidPointCoords(l)))return null;let{p0:a,p2:r}=s;const e=u(a.lat,a.lng,r.lat,r.lng),o=bearing(a.lat,a.lng,r.lat,r.lng),c=h(a,r),i=y(a,r);let p=u(a.lat,a.lng,n,l),M=bearing(a.lat,a.lng,n,l)-o;if(!isValidPointCoords(e)||e<=0)return b.warn("Invalid GPS config: zero or negative distance",{fullGpsDistance:e,p0:a,p2:r}),null;let I=p/e,m=L(M,B(a,c*I,i),a.x,a.y),A=h(m,G(s.p0,s.p2)),D=h(s.p0,s.p2);return A>5*D?(b.warn("Current position too far"),null):{...m,angle:t}}export function convertLocalToGps(n,l,t){var s=-x(t.p0,t.p2,{x:t.p0.x+1e4,y:t.p0.y}),a=-x(t.p0,{x:n,y:l},{x:t.p0.x+1e4,y:t.p0.y}),r=a-s,e=h(t.p2,t.p0),o=h(t.p0,{x:n,y:l}),c=o/e,i=u(t.p0.lat,t.p0.lng,t.p2.lat,t.p2.lng),p=c*i,P=bearing(t.p0.lat,t.p0.lng,t.p2.lat,t.p2.lng),M=w(t.p0.lat,t.p0.lng,p,P+r);return M}function w(n,l,t,s){var a=t/g,r=v(s),e=v(n),o=v(l),c=Math.asin(Math.sin(e)*Math.cos(a)+Math.cos(e)*Math.sin(a)*Math.cos(r)),i=o+Math.atan2(Math.sin(r)*Math.sin(a)*Math.cos(e),Math.cos(a)-Math.sin(e)*Math.sin(c)),p=d(i);return(p<S||p>T)&&(i=(i+3*Math.PI)%(2*Math.PI)-Math.PI,p=d(i)),[p,d(c)]}export function calculateRelativeBearing(n){const l=R?.properties?.config?.bearing??0;return n?.angle===null?0:(((n.angle-l)%360+360)%360-90+360)%360}
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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)))}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Booth } from "../../store/BoothStore";
|
|
2
|
+
import type { RouteEndpoint } from "../core";
|
|
3
|
+
/**
|
|
4
|
+
* Converts an efp `Booth` to a neutral {@link RouteEndpoint}.
|
|
5
|
+
*
|
|
6
|
+
* - Regular booth → `{x, y}` at rect centroid + `bounds` as a 4-vertex
|
|
7
|
+
* polygon respecting the booth's rotation.
|
|
8
|
+
* - `RouteCutIn` (kiosk-like) → `{x, y}` at the kiosk's physical point
|
|
9
|
+
* with **no `bounds`**. Runtime detects the missing `bounds` and draws a
|
|
10
|
+
* dotted trail from the nearest graph anchor to this off-graph point.
|
|
11
|
+
*/
|
|
12
|
+
export declare function boothToEndpoint(booth: Booth): RouteEndpoint;
|
|
13
|
+
//# sourceMappingURL=boothToEndpoint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import n from"../../core/Polygon";function y(e){return e.entity?.type==="route-cut-in"}export function boothToEndpoint(e){if(y(e)){const t=e.destination;return{x:t.x,y:t.y,layer:e.layer?.name??""}}const r=n.fromRect(e.rect).rotate(e.rotate,e.rect.cx,e.rect.cy);return{x:e.rect.cx,y:e.rect.cy,layer:e.layer?.name??"",bounds:[{x:r.x1,y:r.y1},{x:r.x2,y:r.y2},{x:r.x3,y:r.y3},{x:r.x4,y:r.y4}]}}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* efp-app adapter: creates icon canvases from store.fp.icons.
|
|
3
|
+
*
|
|
4
|
+
* Extracts the icon creation block from config-wf.ts (lines 168–248).
|
|
5
|
+
* All canvases are pre-created eagerly.
|
|
6
|
+
* Fallback canvases are used when custom images are not available.
|
|
7
|
+
*/
|
|
8
|
+
import type { IconProvider } from "./iconProvider";
|
|
9
|
+
interface CanvasIconProviderConfig {
|
|
10
|
+
/** Icon image map — typically store.fp.icons */
|
|
11
|
+
readonly iconMap: Map<string, HTMLImageElement>;
|
|
12
|
+
readonly pixelRatio: number;
|
|
13
|
+
/** Fallback color for source/current/transition icons (default: "#00A2FF") */
|
|
14
|
+
readonly sourceColor?: string;
|
|
15
|
+
/** Fallback color for destination icon (default: "#FF9F06") */
|
|
16
|
+
readonly destinationColor?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function createCanvasIconProvider(config: CanvasIconProviderConfig): IconProvider;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=canvasIconProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createArrowCurrentCanvas as w,createCurrentCanvas as C,createImageCanvas as h,createTargetCanvas as g,createYahCanvas as v}from"../../components/Map/drawing/config/canvases";import{createCircleCanvas as F}from"../../renderer";import{decreaseByPercentage as _}from"../../utils/math";const I="#00A2FF",O="#FF9F06",e=34;function c(o,n,t,s,u,r){const i=o.get(n);return i?(i.id=n,h(i,t,s,u)):r()}function m(o,n,t,s,u){const r=o.get(n);return r?(r.id=n,h(r,t,s,u)):null}function a(o){return{canvas:o,width:o.width,height:o.height}}export function createCanvasIconProvider(o){const{iconMap:n,pixelRatio:t}=o,s=o.sourceColor??I,u=o.destinationColor??O,r=new Map;r.set("destination",a(c(n,"destination",e,e,t,()=>g(t,u)))),r.set("source",a(c(n,"departure",e,e,t,()=>C(t,s))));const i=C(t,s);i.id="current-location",r.set("current",a(i));const d=c(n,"transition",e,e,t,()=>C(t,s));r.set("transition",a(d)),r.set("transition_up",a(m(n,"transition_up",56,e,t)??d)),r.set("transition_down",a(m(n,"transition_down",56,e,t)??d)),r.set("transition_entry",a(c(n,"departure",e,e,t,()=>C(t,s)))),r.set("current_arrow",a(c(n,"direction",e,e,t,()=>w(t,s))));const f=c(n,"yah",_(64,32),_(90,32),t,()=>v(t,"#ff4343"));return f.id="current-location-2",r.set("yah",a(f)),r.set("trail",a(F(4,"#b5b7bc"))),{getIcon(l){const p=r.get(l);if(!p)throw new Error(`Unknown icon: ${l}`);return p}}}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type LayerStore from "../../store/LayerStore";
|
|
2
|
+
import type RouteStore from "../../store/RouteStore";
|
|
3
|
+
import type { FloorContext } from "../runtime/types";
|
|
4
|
+
/**
|
|
5
|
+
* Adapter: builds a neutral {@link FloorContext} from the efp `LayerStore` +
|
|
6
|
+
* `RouteStore`. Single place in the code that knows about efp-specific magic
|
|
7
|
+
* values like `LayersMode.Default === 0`.
|
|
8
|
+
*/
|
|
9
|
+
export declare function createFloorContext(layerStore: LayerStore, routeStore: RouteStore): FloorContext;
|
|
10
|
+
//# sourceMappingURL=floorContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const t=0;export function createFloorContext(r,s){return{showAllFloors(){return r.mode===0},getActiveFloor(){const e=s.currentRouteLayer?.name;return e&&r.layers.some(i=>i.name===e&&i.visible)?e:""},isLayerVisible(e){return e?r.findLayer?r.findLayer(e)?.visible??!0:r.layers.some(n=>n.name===e&&n.visible):!0},getFloorOrder(){return r.floors.map(e=>e.name).reverse()}}}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Port: icon asset provider.
|
|
3
|
+
*
|
|
4
|
+
* Abstracts away how icon canvases are created (custom image vs fallback).
|
|
5
|
+
*/
|
|
6
|
+
export type IconName = "source" | "destination" | "current" | "current_arrow" | "yah" | "transition" | "transition_up" | "transition_down" | "transition_entry" | "trail";
|
|
7
|
+
export interface IconAsset {
|
|
8
|
+
readonly canvas: HTMLCanvasElement;
|
|
9
|
+
readonly width: number;
|
|
10
|
+
readonly height: number;
|
|
11
|
+
}
|
|
12
|
+
export interface IconProvider {
|
|
13
|
+
getIcon(name: IconName): IconAsset;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=iconProvider.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { boothToEndpoint } from "./boothToEndpoint";
|
|
2
|
+
export { boothToWaypoint } from "./boothToWaypoint";
|
|
3
|
+
export { createCanvasIconProvider } from "./canvasIconProvider";
|
|
4
|
+
export { createFloorContext } from "./floorContext";
|
|
5
|
+
export { graphDataSource } from "./graphDataSource";
|
|
6
|
+
export { createKioskCanvas } from "./kioskCanvas";
|
|
7
|
+
export { positionInput } from "./positionInput";
|
|
8
|
+
export type { IconAsset, IconName, IconProvider } from "./iconProvider";
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{boothToEndpoint}from"./boothToEndpoint";export{boothToWaypoint}from"./boothToWaypoint";export{createCanvasIconProvider}from"./canvasIconProvider";export{createFloorContext}from"./floorContext";export{graphDataSource}from"./graphDataSource";export{createKioskCanvas}from"./kioskCanvas";export{positionInput}from"./positionInput";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds the kiosk icon canvas. If `kioskIconMap` provides a "kiosk" image,
|
|
3
|
+
* it's drawn at a size scaled by `iconSizePercent` (default 100%). Otherwise
|
|
4
|
+
* falls back to a generic arrow canvas tinted with the fallback color.
|
|
5
|
+
*/
|
|
6
|
+
export declare function createKioskCanvas(kioskIconMap: Map<string, HTMLImageElement> | undefined, iconSizePercent?: number): HTMLCanvasElement;
|
|
7
|
+
//# sourceMappingURL=kioskCanvas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import c from"color";import{createImageCanvas as s,createArrowCurrentCanvas as K}from"../../components/Map/drawing/config/canvases";import{decreaseByPercentage as a}from"../../utils/math";const C=199,_=152,i=55,m="#ee4422";export function createKioskCanvas(n,o){const t=devicePixelRatio,e=n?.get("kiosk");if(e){e.id="kiosk";const r=o?o/100:1;return s(e,a(C*r,i),a(_*r,i),t)}return K(t,c(m).hex())}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CurrentPosition } from "../../store/RouteStore";
|
|
2
|
+
import type { PositionInput } from "../runtime/types";
|
|
3
|
+
/**
|
|
4
|
+
* Converts the efp `CurrentPosition` class instance to a neutral
|
|
5
|
+
* `PositionInput` for the runtime.
|
|
6
|
+
*
|
|
7
|
+
* `z` in CurrentPosition can be `number | string | undefined`; the runtime
|
|
8
|
+
* expects `layer: string`. Non-finite `angle` becomes `undefined`.
|
|
9
|
+
*/
|
|
10
|
+
export declare function positionInput(position: CurrentPosition): PositionInput;
|
|
11
|
+
//# sourceMappingURL=positionInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function positionInput(e){return{x:e.x,y:e.y,layer:e.z!=null?String(e.z):"",angle:Number.isFinite(e.angle)?e.angle:void 0}}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type LayerStore from "../store/LayerStore";
|
|
2
|
+
import type RouteStore from "../store/RouteStore";
|
|
3
|
+
import type UIState from "../store/UIState";
|
|
4
|
+
import type { KioskHandler } from "./handlers/kioskHandler";
|
|
5
|
+
import type { YahHandler } from "./handlers/yahHandler";
|
|
6
|
+
import type { WayfindingRuntime } from "./runtime/types";
|
|
7
|
+
interface BindMobxReactionsArgs {
|
|
8
|
+
readonly runtime: WayfindingRuntime;
|
|
9
|
+
readonly kioskHandler: KioskHandler;
|
|
10
|
+
readonly yahHandler: YahHandler;
|
|
11
|
+
readonly stores: {
|
|
12
|
+
readonly routeStore: RouteStore;
|
|
13
|
+
readonly uiState: UIState;
|
|
14
|
+
readonly layerStore: LayerStore;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Wires the observable efp stores to the imperative wayfinding runtime and
|
|
19
|
+
* the efp-side kiosk/yah handlers. Each reaction translates observable
|
|
20
|
+
* changes into neutral-typed imperative calls.
|
|
21
|
+
*
|
|
22
|
+
* Returns a dispose function that tears down all reactions plus the deferred
|
|
23
|
+
* floor-change timeout.
|
|
24
|
+
*/
|
|
25
|
+
export declare function bindMobxReactions({ runtime, kioskHandler, yahHandler, stores: { routeStore, uiState, layerStore }, }: BindMobxReactionsArgs): () => void;
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=bindMobxReactions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{reaction as f}from"mobx";import{boothToEndpoint as a,positionInput as g}from"./adapters";export function bindMobxReactions({runtime:s,kioskHandler:h,yahHandler:d,stores:{routeStore:e,uiState:n,layerStore:l}}){const p=[];function r(){const o=n.selectedRoute?.from,i=n.selectedRoute?.to;if(!o?.rect||!i?.rect){s.clearRoute();return}s.setRoute({from:a(o),to:a(i),waypoints:n.selectedRoute?.waypoints?.map(a),accessible:e.onlyAccessible})}function c(){const o=e.currentPosition,i=e.iconType!==0,y=!!(n.selectedRoute?.from&&n.selectedRoute?.to),b=i&&!y;if(!o){s.onPositionChanged(null),d(null);return}const u=g(o);b?(s.onPositionChanged(null),d({x:u.x,y:u.y,layer:u.layer})):(d(null),s.onPositionChanged(u))}function R(){const o=l.floors.find(i=>i.active)?.name;h(n.kioskData??null,o,l.mode)}p.push(f(()=>l.layersLoaded,()=>{r(),c()}),f(()=>[n.selectedRoute,e.onlyAccessible],()=>{r(),c()}),f(()=>e.currentPosition,()=>c()),f(()=>[n.kioskData,l.floors.find(o=>o.active)],()=>R()));let t=null;const m=f(()=>[e.currentRouteLayer,n.getRouteNextFloor],()=>{l.layersLoaded&&(t!==null&&clearTimeout(t),t=setTimeout(()=>{s.onFloorChanged(),c(),t=null},0))});return p.push(()=>{t!==null&&clearTimeout(t),m()}),r(),c(),R(),()=>{for(const o of p)o();p.length=0}}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import type { GraphBuildOptions, GraphDataSource, GraphInstance, PathNode, RouteLine, RoutePoint } from "../types";
|
|
2
2
|
export declare function makePoint(layer: string, x: number, y: number): RoutePoint;
|
|
3
|
-
/** Creates a simple linear graph: p0 — p1 — p2 — ... */
|
|
4
|
-
export declare function makeLinearGraph(layerName: string, ...coords: [number, number][]): {
|
|
5
|
-
points: RoutePoint[];
|
|
6
|
-
lines: RouteLine[];
|
|
7
|
-
};
|
|
8
3
|
export declare function makeLine(p0: RoutePoint, p1: RoutePoint, overrides?: Partial<Omit<RouteLine, "p0" | "p1">>): RouteLine;
|
|
9
4
|
export declare function makeNode(layer: string, x: number, y: number): PathNode;
|
|
10
5
|
export declare function createMockDataSource(options?: {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{vi as i}from"vitest";export function makePoint(e,n,t){return{layer:e,x:n,y:t}}export function makeLine(e,n,t={}){return{p0:e,p1:n,unaccessible:!1,unidirection:!1,virtual:!1,weight:4,...t}}export function makeNode(e,n,t){return{id:`${e}_${n}_${t}`,layer:e,x:n,y:t}}export function createMockDataSource(e={}){return{getLines:()=>e.lines??[],getLineEnds:()=>e.lineEnds??[]}}export function createMockGraph(e={}){const{lines:n=[],lineEnds:t=[],hasNodeResult:o=!0,findResult:r=[],graphOptions:u}=e;return{finder:{build:i.fn(),hasNode:typeof o=="function"?i.fn(o):i.fn().mockReturnValue(o),find:typeof r=="function"?i.fn(r):i.fn().mockReturnValue(r)},dataSource:{getLines:()=>n,getLineEnds:()=>t},options:u??{oriented:!0}}}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { GraphDataSource, RouteLine, RouteWaypoint } from "./types";
|
|
2
|
+
export interface Route {
|
|
3
|
+
readonly lines: RouteLine[];
|
|
4
|
+
readonly distance: number;
|
|
5
|
+
}
|
|
6
|
+
export interface WayfindingEngine {
|
|
7
|
+
buildRoute(from: RouteWaypoint, to: RouteWaypoint, options?: {
|
|
8
|
+
accessible?: boolean;
|
|
9
|
+
}): Route;
|
|
10
|
+
buildWaypointsRoute(waypoints: RouteWaypoint[], options?: {
|
|
11
|
+
accessible?: boolean;
|
|
12
|
+
fastest?: boolean;
|
|
13
|
+
}): Route;
|
|
14
|
+
}
|
|
15
|
+
export declare function createWayfindingEngine(dataSource: GraphDataSource): WayfindingEngine;
|
|
16
|
+
//# sourceMappingURL=createWayfindingEngine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createGraphCache as d}from"./graph/graphCache";import{buildRoute as u}from"./routing/buildRoute";import{buildMultiPointRoute as f}from"./routing/buildMultiPointRoute";import{resolveWaypointCandidates as a}from"./routing/resolveWaypointCandidates";import{reorderWaypoints as m}from"./routing/optimizeWaypointOrder";export function createWayfindingEngine(c){const l=d();return{buildRoute(e,t,r){const n=l.getOrBuild(c,r?.accessible??!1),s=a(n,e),i=a(n,t),o=u(n,s,i);return{lines:o.lines,distance:o.totalDistance}},buildWaypointsRoute(e,t){if(e.length<2)return{lines:[],distance:0};const r=l.getOrBuild(c,t?.accessible??!1),s=(t?.fastest?m(e):e).map(o=>a(r,o)),i=f(r,s);return{lines:i.lines,distance:i.totalDistance}}}}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { GraphDataSource, GraphInstance } from "../types";
|
|
2
|
-
|
|
2
|
+
interface GraphCache {
|
|
3
3
|
getOrBuild(dataSource: GraphDataSource, onlyAccessible: boolean): GraphInstance;
|
|
4
4
|
}
|
|
5
5
|
export declare function createGraphCache(): GraphCache;
|
|
6
|
+
export {};
|
|
6
7
|
//# sourceMappingURL=graphCache.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export { createWayfindingEngine } from "./createWayfindingEngine";
|
|
2
|
+
export type { WayfindingEngine, Route } from "./createWayfindingEngine";
|
|
3
|
+
export type { GraphDataSource, PositionPoint, RouteEndpoint, RouteLine, RoutePoint, RouteSnapResult, RouteWaypoint, SnapToRouteConfig, } from "./types";
|
|
4
|
+
export { computeTransitionPoints } from "./rendering/computeTransitionPoints";
|
|
5
|
+
export type { TransitionPointDef } from "./rendering/computeTransitionPoints";
|
|
6
|
+
export { computeTrailPoints } from "./rendering/computeTrailPoints";
|
|
7
|
+
export { getVisibleRouteLines } from "./rendering/getVisibleRouteLines";
|
|
8
|
+
export { computeBoundingBox } from "./rendering/routeGeometry";
|
|
9
|
+
export type { BoundingBox } from "./rendering/routeGeometry";
|
|
10
|
+
export { normalizeRouteDirection } from "./rendering/normalizeRouteDirection";
|
|
11
|
+
export { getRouteLength } from "./routing/getRouteLength";
|
|
12
|
+
export { SNAP_THRESHOLD_METERS, getThresholdSafe, getThresholdFromMetersToSvg } from "./position/gpsThreshold";
|
|
13
|
+
export { shouldReroute } from "./position/shouldReroute";
|
|
14
|
+
export { snapToRoute } from "./position/snapToRoute";
|
|
15
|
+
export { splitRouteByPoint } from "./position/splitRouteByPoint";
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{createWayfindingEngine}from"./createWayfindingEngine";export{computeTransitionPoints}from"./rendering/computeTransitionPoints";export{computeTrailPoints}from"./rendering/computeTrailPoints";export{getVisibleRouteLines}from"./rendering/getVisibleRouteLines";export{computeBoundingBox}from"./rendering/routeGeometry";export{normalizeRouteDirection}from"./rendering/normalizeRouteDirection";export{getRouteLength}from"./routing/getRouteLength";export{SNAP_THRESHOLD_METERS,getThresholdSafe,getThresholdFromMetersToSvg}from"./position/gpsThreshold";export{shouldReroute}from"./position/shouldReroute";export{snapToRoute}from"./position/snapToRoute";export{splitRouteByPoint}from"./position/splitRouteByPoint";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function h(n,c,e,t,r,y){const s=r-e,i=y-t,a=n-e,l=c-t,f=s*s+i*i;if(f===0)return Math.hypot(n-e,c-t);let o=(a*s+l*i)/f;o<0?o=0:o>1&&(o=1);const u=e+o*s,b=t+o*i;return Math.hypot(n-u,c-b)}export function distancePointToRouteOnLayer(n,c){let e=1/0;for(const t of c){if(n.layer&&(t.p0.layer!==n.layer||t.p1.layer!==n.layer))continue;const r=h(n.x,n.y,t.p0.x,t.p0.y,t.p1.x,t.p1.y);r<e&&(e=r)}return e}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const SNAP_THRESHOLD_METERS = 7.5;
|
|
2
|
+
type GpsProjectionConfig = {
|
|
3
|
+
p0: {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
lat: number;
|
|
7
|
+
lng: number;
|
|
8
|
+
};
|
|
9
|
+
p2: {
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
lat: number;
|
|
13
|
+
lng: number;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export declare const getThresholdSafe: (value: number) => number | undefined;
|
|
17
|
+
export declare function getThresholdFromMetersToSvg({ thresholdInMeters, gpsConfig }: {
|
|
18
|
+
thresholdInMeters?: number;
|
|
19
|
+
gpsConfig?: GpsProjectionConfig;
|
|
20
|
+
}): number;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=gpsThreshold.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{lineLength as s}from"simple-geometry";import{haversineDistance as f}from"../../../utils/haversineDistance";export const SNAP_THRESHOLD_METERS=7.5;const c=20;function l(t,n){const{p0:e,p2:r}=n,o=f(e.lat,e.lng,r.lat,r.lng),i=s(e,r);return!o||!i?0:t*(i/o)}export const getThresholdSafe=t=>{if(typeof t=="number"&&Number.isFinite(t))return t};export function getThresholdFromMetersToSvg({thresholdInMeters:t,gpsConfig:n}){let e=0;return t&&n&&(e=l(t,n)),e||(e=c),e}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{distancePointToRouteOnLayer as u}from"./distanceToRoute";const c=10;export function shouldReroute(t,e,r=c){if(!t||!e.length)return!1;const l={layer:t.z!=null?String(t.z):"",x:t.x,y:t.y},n=u(l,e);return isFinite(n)&&n>r}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { PositionPoint, RouteLine, RouteSnapResult, SnapToRouteConfig } from "../types";
|
|
2
|
+
export { SNAP_THRESHOLD_METERS } from "./gpsThreshold";
|
|
3
|
+
export declare function snapToRoute(position: PositionPoint, routeLines: RouteLine[], config: SnapToRouteConfig): RouteSnapResult;
|
|
4
|
+
//# sourceMappingURL=snapToRoute.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const H=1e-9;function w(s,i,t,a){const n=(s-t.x)*(a.y-t.y)-(i-t.y)*(a.x-t.x);if(Math.abs(n)>H)return!1;const e=(s-t.x)*(a.x-t.x)+(i-t.y)*(a.y-t.y),c=(a.x-t.x)**2+(a.y-t.y)**2;return e>=0&&e<=c}function q(s,i,t){if(t.length<3)return!1;for(let n=0,e=t.length-1;n<t.length;e=n++)if(w(s,i,t[e],t[n]))return!0;let a=!1;for(let n=0,e=t.length-1;n<t.length;e=n++){const c=t[n].x,d=t[n].y,r=t[e].x,y=t[e].y;d>i!=y>i&&s<(r-c)*(i-d)/(y-d)+c&&(a=!a)}return a}function F(s,i){let t=0;for(const n of s){const e=Math.hypot(n.p1.x-n.p0.x,n.p1.y-n.p0.y);if(e!==0){if(t+e>=i){const c=(i-t)/e,d=n.p0.x+(n.p1.x-n.p0.x)*c,r=n.p0.y+(n.p1.y-n.p0.y)*c;return{point:{layer:n.p0.layer,x:d,y:r},line:n}}t+=e}}const a=s[s.length-1];return{point:{layer:a.p0.layer,x:a.p1.x,y:a.p1.y},line:a}}export{SNAP_THRESHOLD_METERS}from"./gpsThreshold";export function snapToRoute(s,i,t){const a=i.length;if(!a)return{snapped:!1};const{snapThreshold:n,to:e,from:c,minRemainingUnits:d=.5}=t,r=s.z!=null?String(s.z):null;let y=1/0,f=null,m=0,R=r==null;for(let o=0;o<a;o++){const x=i[o],{p0:l,p1:h}=x,g=h.x-l.x,P=h.y-l.y,T=g*g+P*P;if(T===0)continue;const E=Math.sqrt(T);if(r!=null&&String(l.layer)!==r){m+=E;continue}R=!0;const b=((s.x-l.x)*g+(s.y-l.y)*P)/T,M=Math.max(0,Math.min(1,b)),v=l.x+g*M,z=l.y+P*M,_=Math.hypot(s.x-v,s.y-z);_<y&&(y=_,f={segmentIndex:o,t:M,distanceFromPolylineStart:m+E*M}),m+=E}if(r!=null&&!R)return{snapped:!1};const p=m,O=i[0].p0,j=i[a-1].p1,A=Math.hypot(e.x-O.x,e.y-O.y),L=Math.hypot(e.x-j.x,e.y-j.y),S=A<=L,D=Math.min(d,p);if(c?.bounds&&(r==null||!c.layer||c.layer===r)&&q(s.x,s.y,c.bounds)){const o=p,x=S?o:p-o,l=F(i,x);return{snapped:!0,snappedPoint:l.point,snappedLine:l.line,distance:o}}if(e.bounds&&(r==null||!e.layer||e.layer===r)&&q(s.x,s.y,e.bounds)){const o=D,x=p-o,h=F(i,S?o:x);return{snapped:!0,snappedPoint:h.point,snappedLine:h.line,distance:o}}if(!f||y>n)return{snapped:!1};let u=S?f.distanceFromPolylineStart:p-f.distanceFromPolylineStart;u<D&&(u=D);const N=p-u,I=F(i,S?u:N);return{snapped:!0,snappedPoint:I.point,snappedLine:I.line,distance:u}}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RouteLine, RoutePoint } from "
|
|
1
|
+
import type { RouteLine, RoutePoint } from "../types";
|
|
2
2
|
export declare function splitRouteByPoint(routeLines: RouteLine[], snapPoint: RoutePoint): {
|
|
3
3
|
passed: RouteLine[];
|
|
4
4
|
remaining: RouteLine[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function splitRouteByPoint(t,c){let n=-1,e=0,f=1/0;for(let l=0;l<t.length;l++){const p=t[l];if(p.p0.layer!==c.layer)continue;const s=p.p1.x-p.p0.x,y=p.p1.y-p.p0.y,r=s*s+y*y;if(r===0)continue;const x=((c.x-p.p0.x)*s+(c.y-p.p0.y)*y)/r;if(x<-1e-6||x>1+1e-6)continue;const a=Math.min(1,Math.max(0,x)),m=p.p0.x+a*s,g=p.p0.y+a*y,o=(c.x-m)**2+(c.y-g)**2;o<f&&(f=o,n=l,e=a)}if(n===-1)return{passed:[],remaining:t};if(e<1e-6)return{passed:t.slice(0,n),remaining:t.slice(n)};if(e>1-1e-6)return{passed:t.slice(0,n+1),remaining:t.slice(n+1)};const i=t[n],d={layer:i.p0.layer,x:i.p0.x+e*(i.p1.x-i.p0.x),y:i.p0.y+e*(i.p1.y-i.p0.y)};return{passed:[...t.slice(0,n),{...i,p1:d}],remaining:[{...i,p0:d},...t.slice(n+1)]}}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Point } from "simple-geometry";
|
|
2
|
+
/**
|
|
3
|
+
* Generates evenly-spaced points along a quadratic Bézier curve
|
|
4
|
+
* between two points. Used for dotted trail visualization when
|
|
5
|
+
* a point (kiosk, GPS, marker, etc.) is far from the route.
|
|
6
|
+
*
|
|
7
|
+
* @param from - Start point (e.g. route endpoint)
|
|
8
|
+
* @param to - End point (e.g. off-route position)
|
|
9
|
+
* @param interval - Spacing between points in SVG units (default: 8)
|
|
10
|
+
* @param curvature - Arc height as fraction of distance (0 = straight, 0.4 = default arc)
|
|
11
|
+
*/
|
|
12
|
+
export declare function computeTrailPoints(from: {
|
|
13
|
+
x: number;
|
|
14
|
+
y: number;
|
|
15
|
+
}, to: {
|
|
16
|
+
x: number;
|
|
17
|
+
y: number;
|
|
18
|
+
}, interval?: number, curvature?: number): Point[];
|
|
19
|
+
//# sourceMappingURL=computeTrailPoints.d.ts.map
|
|
@@ -0,0 +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}}
|
|
@@ -2,12 +2,12 @@ import type { RouteLine } from "../types";
|
|
|
2
2
|
interface TransitionPointsInput {
|
|
3
3
|
/** Full route including virtual lines */
|
|
4
4
|
readonly routeLines: RouteLine[];
|
|
5
|
-
/**
|
|
5
|
+
/** Floor to scope to. `null` = no floor scoping (returns transitions on every floor). */
|
|
6
6
|
readonly currentLayerName: string | null;
|
|
7
7
|
/** Floor names ordered low → high (from layerStore.floors) */
|
|
8
8
|
readonly floorOrder: string[];
|
|
9
9
|
}
|
|
10
|
-
interface TransitionPointDef {
|
|
10
|
+
export interface TransitionPointDef {
|
|
11
11
|
readonly x: number;
|
|
12
12
|
readonly y: number;
|
|
13
13
|
/** Floor where the icon is rendered */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function s(a,n){return a.toLowerCase()===n.toLowerCase()}function d(a,n){return a.findIndex(r=>s(r,n))}function C(a,n,r){const o=d(a,n),t=d(a,r);return o===-1||t===-1?"neutral":t>o?"up":"down"}function w(a,n,r){return a.find(o=>s(o.p0.layer,n)?!r.has(o.p1.layer.toLowerCase()):s(o.p1.layer,n)?!r.has(o.p0.layer.toLowerCase()):!1)}function h(a,n,r,o){if(n.has(o.toLowerCase()))return o;let t=o;const l=new Set([r.toLowerCase(),t.toLowerCase()]);let u=w(a,t,l);for(;u&&(t=s(u.p0.layer,t)?u.p1.layer:u.p0.layer,!n.has(t.toLowerCase()));)l.add(t.toLowerCase()),u=w(a,t,l);return t}export function computeTransitionPoints(a){const{routeLines:n,currentLayerName:r,floorOrder:o}=a,t=n.filter(e=>e.virtual&&!s(e.p0.layer,e.p1.layer)),l=new Set;for(const e of n)e.virtual||(l.add(e.p0.layer.toLowerCase()),l.add(e.p1.layer.toLowerCase()));const c=(r?t.filter(e=>s(e.p0.layer,r)||s(e.p1.layer,r)):t).map(e=>{const i=r?s(e.p0.layer,r):!0,y=i?e.p0:e.p1,x=i?e.p1:e.p0,p=h(t,l,y.layer,x.layer);return{x:y.x,y:y.y,layer:y.layer,targetLayer:p,direction:C(o,y.layer,p),role:r&&i?"entry":"exit"}}),L=new Set(c.filter(e=>e.role==="exit").map(e=>`${e.x}:${e.y}`)),f=new Set;return c.filter(e=>{const i=`${e.x}:${e.y}`;return e.role==="entry"&&L.has(i)||f.has(i)?!1:(f.add(i),!0)})}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { RouteLine } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Filters route lines for a given floor: removes virtual segments
|
|
4
|
+
* and keeps only lines on the specified floor.
|
|
5
|
+
*
|
|
6
|
+
* @param routeLines - All route lines (may span multiple floors)
|
|
7
|
+
* @param currentFloor - Floor to filter by, or `null` to return all non-virtual lines
|
|
8
|
+
* (single-floor plans / "show all" mode)
|
|
9
|
+
*/
|
|
10
|
+
export declare function getVisibleRouteLines(routeLines: ReadonlyArray<RouteLine>, currentFloor: string | null): RouteLine[];
|
|
11
|
+
//# sourceMappingURL=getVisibleRouteLines.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function getVisibleRouteLines(t,e){const i=[];for(const n of t)n.virtual||e!==null&&n.p0.layer!==e||i.push(n);return i}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { RouteLine, RoutePoint } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Ensures that `routeLines` run in the from→to direction.
|
|
4
|
+
*
|
|
5
|
+
* A* returns paths in target→source order. For rendering (arrow animation,
|
|
6
|
+
* route progress split) and remaining-distance computation the lines must
|
|
7
|
+
* go from the origin to the destination.
|
|
8
|
+
*
|
|
9
|
+
* Direction is decided by projecting `from` (or `to` as a fallback) onto
|
|
10
|
+
* `routeLines`: if the anchor lands closer to the polyline end than to
|
|
11
|
+
* its start, the array is reversed and each segment's endpoints are
|
|
12
|
+
* flipped to keep continuity.
|
|
13
|
+
*
|
|
14
|
+
* @param routeLines Lines to normalize.
|
|
15
|
+
* @param from Route origin (user-selected "from" point).
|
|
16
|
+
* @param to Route destination (user-selected "to" point).
|
|
17
|
+
* @returns Lines guaranteed to run from→to, or the original array unchanged.
|
|
18
|
+
*/
|
|
19
|
+
export declare function normalizeRouteDirection(routeLines: RouteLine[], from: RoutePoint, to: RoutePoint): RouteLine[];
|
|
20
|
+
//# sourceMappingURL=normalizeRouteDirection.d.ts.map
|
|
@@ -0,0 +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}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface BoundingBox {
|
|
2
|
+
x1: number;
|
|
3
|
+
y1: number;
|
|
4
|
+
x2: number;
|
|
5
|
+
y2: number;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Computes the axis-aligned bounding box of a set of points.
|
|
9
|
+
* Returns null for an empty array.
|
|
10
|
+
*/
|
|
11
|
+
export declare function computeBoundingBox(points: ReadonlyArray<{
|
|
12
|
+
x: number;
|
|
13
|
+
y: number;
|
|
14
|
+
}>): BoundingBox | null;
|
|
15
|
+
//# sourceMappingURL=routeGeometry.d.ts.map
|
|
@@ -0,0 +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}}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
type Point = {
|
|
2
|
+
cx: number;
|
|
3
|
+
cy: number;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Optimizes waypoint ordering to minimize total travel distance.
|
|
7
|
+
* Nearest neighbor O(n²) + 2-opt refinement O(k·n²), k ≤ 100.
|
|
8
|
+
*/
|
|
9
|
+
export declare function optimizeWaypointOrder(data: [string, Point][]): string[];
|
|
10
|
+
/**
|
|
11
|
+
* Reorders waypoints for fastest traversal.
|
|
12
|
+
* First and last stay fixed (from/to), only middle waypoints are reordered.
|
|
13
|
+
*/
|
|
14
|
+
export declare function reorderWaypoints<T extends {
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
}>(waypoints: T[]): T[];
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=optimizeWaypointOrder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const x=100,b=-.01;export function optimizeWaypointOrder(e){const c=new Map(e),t=Array.from(c.keys());if(t.length<=2)return t;const r=M(t,c);return r.length<4?r:u(r,c)}export function reorderWaypoints(e){if(e.length<=3)return e;const c=e[0],t=e[e.length-1],r=e.slice(1,-1),i=r.map((o,a)=>[String(a),{cx:o.x,cy:o.y}]),n=optimizeWaypointOrder(i).map(o=>r[Number(o)]);return[c,...n,t]}function M(e,c){const t=[e[0]],r=new Set(e);let i=e[0];for(r.delete(e[0]);r.size>0;){const s=c.get(i);let n="",o=1/0;for(const a of r){const l=c.get(a),d=Math.abs(s.cx-l.cx)+Math.abs(s.cy-l.cy);d<o&&(o=d,n=a)}if(!n)break;t.push(n),r.delete(n),i=n}return t}function u(e,c){const t=[...e];let r=!0;for(let i=0;r&&i<100;i++){r=!1;t:for(let s=1;s<t.length-2;s++)for(let n=s+1;n<t.length-1;n++){const o=c.get(t[s-1]),a=c.get(t[s]),l=c.get(t[n]),d=c.get(t[n+1]);if(Math.abs(o.cx-l.cx)+Math.abs(o.cy-l.cy)+Math.abs(a.cx-d.cx)+Math.abs(a.cy-d.cy)-(Math.abs(o.cx-a.cx)+Math.abs(o.cy-a.cy))-(Math.abs(l.cx-d.cx)+Math.abs(l.cy-d.cy))<-.01){for(let f=s,h=n;f<h;f++,h--)[t[f],t[h]]=[t[h],t[f]];r=!0;break t}}}return t}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { GraphInstance, RoutePoint, RouteWaypoint } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Resolves a waypoint to candidate graph points.
|
|
4
|
+
* Uses rect-based search if the waypoint has a rect, otherwise falls back to nearest-point lookup.
|
|
5
|
+
*/
|
|
6
|
+
export declare function resolveWaypointCandidates(graph: GraphInstance, waypoint: RouteWaypoint): RoutePoint[];
|
|
7
|
+
//# sourceMappingURL=resolveWaypointCandidates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{findGraphPointsInRect as n,findNearestGraphPoint as a}from"./findNearestGraphPoint";export function resolveWaypointCandidates(r,e){if(e.rect)return n(r.dataSource,e.rect,e.layer);const t=a(r,{x:e.x,y:e.y,layer:e.layer});return t?[t]:[]}
|
|
@@ -73,4 +73,41 @@ export interface RouteWaypoint {
|
|
|
73
73
|
*/
|
|
74
74
|
readonly rect?: SimpleGeometryRect;
|
|
75
75
|
}
|
|
76
|
+
/** Minimal position interface — replaces CurrentPosition class dependency in core. */
|
|
77
|
+
export interface PositionPoint {
|
|
78
|
+
readonly x: number;
|
|
79
|
+
readonly y: number;
|
|
80
|
+
readonly z?: string | number | null;
|
|
81
|
+
}
|
|
82
|
+
export type RouteSnapResult = {
|
|
83
|
+
snapped: false;
|
|
84
|
+
} | {
|
|
85
|
+
snapped: true;
|
|
86
|
+
snappedPoint: RoutePoint;
|
|
87
|
+
snappedLine: RouteLine;
|
|
88
|
+
/** Arc-length from `snappedPoint` to the destination, along the route. */
|
|
89
|
+
distance: number;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* An endpoint of a route — anchor coordinates on a layer, optionally with a
|
|
93
|
+
* polygon describing the surrounding region (for booths and similar areas).
|
|
94
|
+
* Absence of `bounds` means the endpoint is a single off-graph point (e.g.
|
|
95
|
+
* a kiosk) and the runtime will draw a dotted trail to the nearest graph
|
|
96
|
+
* anchor.
|
|
97
|
+
*/
|
|
98
|
+
export interface RouteEndpoint {
|
|
99
|
+
readonly x: number;
|
|
100
|
+
readonly y: number;
|
|
101
|
+
readonly layer: string;
|
|
102
|
+
readonly bounds?: ReadonlyArray<{
|
|
103
|
+
readonly x: number;
|
|
104
|
+
readonly y: number;
|
|
105
|
+
}>;
|
|
106
|
+
}
|
|
107
|
+
export type SnapToRouteConfig = {
|
|
108
|
+
snapThreshold: number;
|
|
109
|
+
minRemainingUnits?: number;
|
|
110
|
+
to: RouteEndpoint;
|
|
111
|
+
from?: RouteEndpoint;
|
|
112
|
+
};
|
|
76
113
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import _ from"../core/Rect";import{fpGeo as p}from"../data/fpGeo";import t,{layersStore as n,uiState as f}from"../store";import{createCanvasIconProvider as A,createFloorContext as u,graphDataSource as x}from"./adapters";import{bindMobxReactions as T}from"./bindMobxReactions";import{createWayfindingEngine as M,getThresholdSafe as L,getThresholdFromMetersToSvg as N,SNAP_THRESHOLD_METERS as I}from"./core";import{createKioskHandler as W}from"./handlers/kioskHandler";import{createYahHandler as k}from"./handlers/yahHandler";import{WF_LINES_ANIMATED_LAYER_NAME as v,WF_LINES_LAYER_NAME as F,WF_POINTS_LAYER_NAME as H,WF_TRAIL_LAYER_NAME as P}from"./layers";import{createWayfindingRuntime as C}from"./runtime/createWayfindingRuntime";import{createWayfindingRenderer as D}from"./renderer";export function createWayfinding(m){const l=M(x),a=A({iconMap:t.fp.icons,pixelRatio:devicePixelRatio}),r=D(m),s=u(n,t.routeStore),i={points:H,trail:P,lines:F,linesAnimated:v},d=L(p?.properties?.config?.snapThreshold)||I,y=N({thresholdInMeters:d,gpsConfig:p?.properties?.config}),c=C({engine:l,renderer:r,iconProvider:a,floorContext:s,layers:i,snapThreshold:y,onTransitionClick:o=>{o.role==="exit"&&n.updateVisibility(o.targetLayer,!0)},onRouteUpdate:(o,e)=>{if(t.routeStore.updateRoute(o),e){const S=e.x2-e.x1,E=e.y2-e.y1;f.moveToRect=_.fromX1y1x2y2(e.x1,e.y1,e.x2,e.y2).withPadding(S,E)}},onRouteDistance:o=>t.routeStore.updateRouteDistance(o)}),R=W({renderer:r,kioskIconMap:t.fp.icons,layer:i.points}),g=k({renderer:r,iconProvider:a,floorContext:s,layer:i.points}),h=T({runtime:c,kioskHandler:R,yahHandler:g,stores:{routeStore:t.routeStore,uiState:f,layerStore:n}});return r.flush(),()=>{h(),c.destroy()}}
|