venue-js 1.4.0-next.20 → 1.4.0-next.22
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/data/index.d.mts +1 -1
- package/dist/data/index.d.ts +1 -1
- package/dist/data/index.js +38 -32
- package/dist/data/index.js.map +1 -1
- package/dist/data/index.mjs +32 -26
- package/dist/data/index.mjs.map +1 -1
- package/dist/{index-X4qpYAhF.d.mts → index-CrxL_5B7.d.mts} +2 -2
- package/dist/{index-X4qpYAhF.d.ts → index-CrxL_5B7.d.ts} +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +193 -187
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +32 -26
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/data/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { QueryObserver } from '@tanstack/query-core';
|
|
2
|
-
export { b5 as ALL_FEATURE_TYPES, h as AmenityFeature, ay as AmenityFeaturePopulated, f as AmenityGeometry, g as AmenityProperties, e as AnchorFeature, az as AnchorFeaturePopulated, A as AnchorGeometry, d as AnchorProperties, Y as AnyRelationshipFeature, B as BaseRelationshipProperties, b0 as DEFAULT_BASE_URL, j as DetailFeature, D as DetailGeometry, i as DetailProperties, am as ElementFeature, ak as ElementGeometry, al as ElementProperties, H as ElevatorRelationshipFeature, aJ as ElevatorRelationshipFeaturePopulated, G as ElevatorRelationshipProperties, X as EscalatorRelationshipFeature, aH as EscalatorRelationshipFeaturePopulated, W as EscalatorRelationshipProperties, ab as EventFeature, a9 as EventGeometry, aa as EventProperties, aQ as FeaturePopulatedResponseMap, aY as FeatureQueryOptions, av as FeatureResponseMap, aw as FeatureType, aW as FilterParams, aV as FindParams, l as FixtureFeature, aA as FixtureFeaturePopulated, F as FixtureGeometry, k as FixtureProperties, b4 as GEOJSON_FEATURE_TYPES, a$ as IMDFUnitCategory, b1 as IMDF_FEATURE_TYPES, b2 as IMDF_UNIT_CATEGORIES, I as Id, c as ImdfFeature, a_ as InternalFilterByType, aZ as InternalFindById, n as KioskFeature, aB as KioskFeaturePopulated, K as KioskGeometry, m as KioskProperties, aj as LabelFeature, ah as LabelGeometry, ai as LabelProperties, p as LevelFeature, aC as LevelFeaturePopulated, L as LevelGeometry, o as LevelProperties, a as Media, M as MediaFile, b as Model3d, au as Model3dFeature, as as Model3dGeometry, aP as Model3dPopulated, at as Model3dProperties, b3 as NONIMDF_FEATURE_TYPES, aU as NavigateClient, r as OccupantFeature, aD as OccupantFeaturePopulated, O as OccupantGeometry, b7 as OccupantHelpers, q as OccupantProperties, u as OpeningFeature, aE as OpeningFeaturePopulated, s as OpeningGeometry, t as OpeningProperties, x as OpeningTypeAndId, ar as Page, ax as PolygonalFeature, aR as PopulatableFeatureType, aX as PopulatedParams, ag as PrivilegeFeature, ae as PrivilegeGeometry, af as PrivilegeProperties, ad as PromotionFeature, ac as PromotionProperties, N as RampRelationshipFeature, aI as RampRelationshipFeaturePopulated, J as RampRelationshipProperties, v as RelationshipCategories, w as RelationshipDirectionTypes, z as RelationshipFeature, aF as RelationshipFeaturePopulated, y as RelationshipGeometry, aT as SearchClient, $ as SectionFeature, aL as SectionFeaturePopulated, Z as SectionGeometry, _ as SectionProperties, S as SingleGeometry, aq as SponsoredContentFeature, an as SponsoredContentLegacyType, ao as SponsoredContentPlacementType, ap as SponsoredContentStrapiV4ApiResponse, aK as StairRelationshipFeaturePopulated, Q as StairsRelationshipFeature, P as StairsRelationshipProperties, a8 as TaxonomyFeature, aO as TaxonomyFeaturePopulated, a6 as TaxonomyGeometry, a7 as TaxonomyProperties, T as TransalatableString, E as TraversalRelationshipFeature, aG as TraversalRelationshipFeaturePopulated, C as TraversalRelationshipProperties, a2 as UnitFeature, aM as UnitFeaturePopulated, a0 as UnitGeometry, a1 as UnitProperties, U as UnitTypeAndId, aS as VenueClientOptions, V as VenueDataClient, a5 as VenueFeature, aN as VenueFeaturePopulated, a3 as VenueGeometry, a4 as VenueProperties, b6 as defaultFeatureQueryOptionsMap, bj as fetchDeliveryApi, bk as fetchPreviewApi, bi as getDataClient, bn as getNavigateClient, bm as getSearchClient, b8 as isValidCoordinate, be as isValidLineString, bb as isValidLineStringCoordinates, bc as isValidMultiPolygon, ba as isValidMultiPolygonCoordinates, bf as isValidPoint, bd as isValidPolygon, b9 as isValidPolygonCoordinates, bg as matchFilter, bh as matchFilters, bl as safeFetchFeature } from '../index-
|
|
2
|
+
export { b5 as ALL_FEATURE_TYPES, h as AmenityFeature, ay as AmenityFeaturePopulated, f as AmenityGeometry, g as AmenityProperties, e as AnchorFeature, az as AnchorFeaturePopulated, A as AnchorGeometry, d as AnchorProperties, Y as AnyRelationshipFeature, B as BaseRelationshipProperties, b0 as DEFAULT_BASE_URL, j as DetailFeature, D as DetailGeometry, i as DetailProperties, am as ElementFeature, ak as ElementGeometry, al as ElementProperties, H as ElevatorRelationshipFeature, aJ as ElevatorRelationshipFeaturePopulated, G as ElevatorRelationshipProperties, X as EscalatorRelationshipFeature, aH as EscalatorRelationshipFeaturePopulated, W as EscalatorRelationshipProperties, ab as EventFeature, a9 as EventGeometry, aa as EventProperties, aQ as FeaturePopulatedResponseMap, aY as FeatureQueryOptions, av as FeatureResponseMap, aw as FeatureType, aW as FilterParams, aV as FindParams, l as FixtureFeature, aA as FixtureFeaturePopulated, F as FixtureGeometry, k as FixtureProperties, b4 as GEOJSON_FEATURE_TYPES, a$ as IMDFUnitCategory, b1 as IMDF_FEATURE_TYPES, b2 as IMDF_UNIT_CATEGORIES, I as Id, c as ImdfFeature, a_ as InternalFilterByType, aZ as InternalFindById, n as KioskFeature, aB as KioskFeaturePopulated, K as KioskGeometry, m as KioskProperties, aj as LabelFeature, ah as LabelGeometry, ai as LabelProperties, p as LevelFeature, aC as LevelFeaturePopulated, L as LevelGeometry, o as LevelProperties, a as Media, M as MediaFile, b as Model3d, au as Model3dFeature, as as Model3dGeometry, aP as Model3dPopulated, at as Model3dProperties, b3 as NONIMDF_FEATURE_TYPES, aU as NavigateClient, r as OccupantFeature, aD as OccupantFeaturePopulated, O as OccupantGeometry, b7 as OccupantHelpers, q as OccupantProperties, u as OpeningFeature, aE as OpeningFeaturePopulated, s as OpeningGeometry, t as OpeningProperties, x as OpeningTypeAndId, ar as Page, ax as PolygonalFeature, aR as PopulatableFeatureType, aX as PopulatedParams, ag as PrivilegeFeature, ae as PrivilegeGeometry, af as PrivilegeProperties, ad as PromotionFeature, ac as PromotionProperties, N as RampRelationshipFeature, aI as RampRelationshipFeaturePopulated, J as RampRelationshipProperties, v as RelationshipCategories, w as RelationshipDirectionTypes, z as RelationshipFeature, aF as RelationshipFeaturePopulated, y as RelationshipGeometry, aT as SearchClient, $ as SectionFeature, aL as SectionFeaturePopulated, Z as SectionGeometry, _ as SectionProperties, S as SingleGeometry, aq as SponsoredContentFeature, an as SponsoredContentLegacyType, ao as SponsoredContentPlacementType, ap as SponsoredContentStrapiV4ApiResponse, aK as StairRelationshipFeaturePopulated, Q as StairsRelationshipFeature, P as StairsRelationshipProperties, a8 as TaxonomyFeature, aO as TaxonomyFeaturePopulated, a6 as TaxonomyGeometry, a7 as TaxonomyProperties, T as TransalatableString, E as TraversalRelationshipFeature, aG as TraversalRelationshipFeaturePopulated, C as TraversalRelationshipProperties, a2 as UnitFeature, aM as UnitFeaturePopulated, a0 as UnitGeometry, a1 as UnitProperties, U as UnitTypeAndId, aS as VenueClientOptions, V as VenueDataClient, a5 as VenueFeature, aN as VenueFeaturePopulated, a3 as VenueGeometry, a4 as VenueProperties, b6 as defaultFeatureQueryOptionsMap, bj as fetchDeliveryApi, bk as fetchPreviewApi, bi as getDataClient, bn as getNavigateClient, bm as getSearchClient, b8 as isValidCoordinate, be as isValidLineString, bb as isValidLineStringCoordinates, bc as isValidMultiPolygon, ba as isValidMultiPolygonCoordinates, bf as isValidPoint, bd as isValidPolygon, b9 as isValidPolygonCoordinates, bg as matchFilter, bh as matchFilters, bl as safeFetchFeature } from '../index-CrxL_5B7.mjs';
|
|
3
3
|
import 'geojson';
|
|
4
4
|
import 'fuse.js';
|
package/dist/data/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { QueryObserver } from '@tanstack/query-core';
|
|
2
|
-
export { b5 as ALL_FEATURE_TYPES, h as AmenityFeature, ay as AmenityFeaturePopulated, f as AmenityGeometry, g as AmenityProperties, e as AnchorFeature, az as AnchorFeaturePopulated, A as AnchorGeometry, d as AnchorProperties, Y as AnyRelationshipFeature, B as BaseRelationshipProperties, b0 as DEFAULT_BASE_URL, j as DetailFeature, D as DetailGeometry, i as DetailProperties, am as ElementFeature, ak as ElementGeometry, al as ElementProperties, H as ElevatorRelationshipFeature, aJ as ElevatorRelationshipFeaturePopulated, G as ElevatorRelationshipProperties, X as EscalatorRelationshipFeature, aH as EscalatorRelationshipFeaturePopulated, W as EscalatorRelationshipProperties, ab as EventFeature, a9 as EventGeometry, aa as EventProperties, aQ as FeaturePopulatedResponseMap, aY as FeatureQueryOptions, av as FeatureResponseMap, aw as FeatureType, aW as FilterParams, aV as FindParams, l as FixtureFeature, aA as FixtureFeaturePopulated, F as FixtureGeometry, k as FixtureProperties, b4 as GEOJSON_FEATURE_TYPES, a$ as IMDFUnitCategory, b1 as IMDF_FEATURE_TYPES, b2 as IMDF_UNIT_CATEGORIES, I as Id, c as ImdfFeature, a_ as InternalFilterByType, aZ as InternalFindById, n as KioskFeature, aB as KioskFeaturePopulated, K as KioskGeometry, m as KioskProperties, aj as LabelFeature, ah as LabelGeometry, ai as LabelProperties, p as LevelFeature, aC as LevelFeaturePopulated, L as LevelGeometry, o as LevelProperties, a as Media, M as MediaFile, b as Model3d, au as Model3dFeature, as as Model3dGeometry, aP as Model3dPopulated, at as Model3dProperties, b3 as NONIMDF_FEATURE_TYPES, aU as NavigateClient, r as OccupantFeature, aD as OccupantFeaturePopulated, O as OccupantGeometry, b7 as OccupantHelpers, q as OccupantProperties, u as OpeningFeature, aE as OpeningFeaturePopulated, s as OpeningGeometry, t as OpeningProperties, x as OpeningTypeAndId, ar as Page, ax as PolygonalFeature, aR as PopulatableFeatureType, aX as PopulatedParams, ag as PrivilegeFeature, ae as PrivilegeGeometry, af as PrivilegeProperties, ad as PromotionFeature, ac as PromotionProperties, N as RampRelationshipFeature, aI as RampRelationshipFeaturePopulated, J as RampRelationshipProperties, v as RelationshipCategories, w as RelationshipDirectionTypes, z as RelationshipFeature, aF as RelationshipFeaturePopulated, y as RelationshipGeometry, aT as SearchClient, $ as SectionFeature, aL as SectionFeaturePopulated, Z as SectionGeometry, _ as SectionProperties, S as SingleGeometry, aq as SponsoredContentFeature, an as SponsoredContentLegacyType, ao as SponsoredContentPlacementType, ap as SponsoredContentStrapiV4ApiResponse, aK as StairRelationshipFeaturePopulated, Q as StairsRelationshipFeature, P as StairsRelationshipProperties, a8 as TaxonomyFeature, aO as TaxonomyFeaturePopulated, a6 as TaxonomyGeometry, a7 as TaxonomyProperties, T as TransalatableString, E as TraversalRelationshipFeature, aG as TraversalRelationshipFeaturePopulated, C as TraversalRelationshipProperties, a2 as UnitFeature, aM as UnitFeaturePopulated, a0 as UnitGeometry, a1 as UnitProperties, U as UnitTypeAndId, aS as VenueClientOptions, V as VenueDataClient, a5 as VenueFeature, aN as VenueFeaturePopulated, a3 as VenueGeometry, a4 as VenueProperties, b6 as defaultFeatureQueryOptionsMap, bj as fetchDeliveryApi, bk as fetchPreviewApi, bi as getDataClient, bn as getNavigateClient, bm as getSearchClient, b8 as isValidCoordinate, be as isValidLineString, bb as isValidLineStringCoordinates, bc as isValidMultiPolygon, ba as isValidMultiPolygonCoordinates, bf as isValidPoint, bd as isValidPolygon, b9 as isValidPolygonCoordinates, bg as matchFilter, bh as matchFilters, bl as safeFetchFeature } from '../index-
|
|
2
|
+
export { b5 as ALL_FEATURE_TYPES, h as AmenityFeature, ay as AmenityFeaturePopulated, f as AmenityGeometry, g as AmenityProperties, e as AnchorFeature, az as AnchorFeaturePopulated, A as AnchorGeometry, d as AnchorProperties, Y as AnyRelationshipFeature, B as BaseRelationshipProperties, b0 as DEFAULT_BASE_URL, j as DetailFeature, D as DetailGeometry, i as DetailProperties, am as ElementFeature, ak as ElementGeometry, al as ElementProperties, H as ElevatorRelationshipFeature, aJ as ElevatorRelationshipFeaturePopulated, G as ElevatorRelationshipProperties, X as EscalatorRelationshipFeature, aH as EscalatorRelationshipFeaturePopulated, W as EscalatorRelationshipProperties, ab as EventFeature, a9 as EventGeometry, aa as EventProperties, aQ as FeaturePopulatedResponseMap, aY as FeatureQueryOptions, av as FeatureResponseMap, aw as FeatureType, aW as FilterParams, aV as FindParams, l as FixtureFeature, aA as FixtureFeaturePopulated, F as FixtureGeometry, k as FixtureProperties, b4 as GEOJSON_FEATURE_TYPES, a$ as IMDFUnitCategory, b1 as IMDF_FEATURE_TYPES, b2 as IMDF_UNIT_CATEGORIES, I as Id, c as ImdfFeature, a_ as InternalFilterByType, aZ as InternalFindById, n as KioskFeature, aB as KioskFeaturePopulated, K as KioskGeometry, m as KioskProperties, aj as LabelFeature, ah as LabelGeometry, ai as LabelProperties, p as LevelFeature, aC as LevelFeaturePopulated, L as LevelGeometry, o as LevelProperties, a as Media, M as MediaFile, b as Model3d, au as Model3dFeature, as as Model3dGeometry, aP as Model3dPopulated, at as Model3dProperties, b3 as NONIMDF_FEATURE_TYPES, aU as NavigateClient, r as OccupantFeature, aD as OccupantFeaturePopulated, O as OccupantGeometry, b7 as OccupantHelpers, q as OccupantProperties, u as OpeningFeature, aE as OpeningFeaturePopulated, s as OpeningGeometry, t as OpeningProperties, x as OpeningTypeAndId, ar as Page, ax as PolygonalFeature, aR as PopulatableFeatureType, aX as PopulatedParams, ag as PrivilegeFeature, ae as PrivilegeGeometry, af as PrivilegeProperties, ad as PromotionFeature, ac as PromotionProperties, N as RampRelationshipFeature, aI as RampRelationshipFeaturePopulated, J as RampRelationshipProperties, v as RelationshipCategories, w as RelationshipDirectionTypes, z as RelationshipFeature, aF as RelationshipFeaturePopulated, y as RelationshipGeometry, aT as SearchClient, $ as SectionFeature, aL as SectionFeaturePopulated, Z as SectionGeometry, _ as SectionProperties, S as SingleGeometry, aq as SponsoredContentFeature, an as SponsoredContentLegacyType, ao as SponsoredContentPlacementType, ap as SponsoredContentStrapiV4ApiResponse, aK as StairRelationshipFeaturePopulated, Q as StairsRelationshipFeature, P as StairsRelationshipProperties, a8 as TaxonomyFeature, aO as TaxonomyFeaturePopulated, a6 as TaxonomyGeometry, a7 as TaxonomyProperties, T as TransalatableString, E as TraversalRelationshipFeature, aG as TraversalRelationshipFeaturePopulated, C as TraversalRelationshipProperties, a2 as UnitFeature, aM as UnitFeaturePopulated, a0 as UnitGeometry, a1 as UnitProperties, U as UnitTypeAndId, aS as VenueClientOptions, V as VenueDataClient, a5 as VenueFeature, aN as VenueFeaturePopulated, a3 as VenueGeometry, a4 as VenueProperties, b6 as defaultFeatureQueryOptionsMap, bj as fetchDeliveryApi, bk as fetchPreviewApi, bi as getDataClient, bn as getNavigateClient, bm as getSearchClient, b8 as isValidCoordinate, be as isValidLineString, bb as isValidLineStringCoordinates, bc as isValidMultiPolygon, ba as isValidMultiPolygonCoordinates, bf as isValidPoint, bd as isValidPolygon, b9 as isValidPolygonCoordinates, bg as matchFilter, bh as matchFilters, bl as safeFetchFeature } from '../index-CrxL_5B7.js';
|
|
3
3
|
import 'geojson';
|
|
4
4
|
import 'fuse.js';
|
package/dist/data/index.js
CHANGED
|
@@ -794,7 +794,7 @@ var getSearchClient = ({ occupants, amenities }) => {
|
|
|
794
794
|
var import_boolean_point_in_polygon4 = require("@turf/boolean-point-in-polygon");
|
|
795
795
|
|
|
796
796
|
// src/data/navigate/graph/prepare.ts
|
|
797
|
-
var
|
|
797
|
+
var import_lodash11 = __toESM(require("lodash"));
|
|
798
798
|
var import_node_dijkstra = __toESM(require("node-dijkstra"));
|
|
799
799
|
var import_distance3 = require("@turf/distance");
|
|
800
800
|
var import_center5 = require("@turf/center");
|
|
@@ -918,7 +918,7 @@ var createElevatorNodeMap = (elevatorLikeRelationships, unitOpenings, options) =
|
|
|
918
918
|
const level = levels.find((level2) => level2.id === destination.properties.level_id);
|
|
919
919
|
return { opening, level };
|
|
920
920
|
});
|
|
921
|
-
const intermediaryOpeningAndLevels = intermediary.map((unitTypeAndId) => {
|
|
921
|
+
const intermediaryOpeningAndLevels = (intermediary || []).map((unitTypeAndId) => {
|
|
922
922
|
const openings = unitOpenings[unitTypeAndId.id];
|
|
923
923
|
const unit = units.find((unit2) => unit2.id === unitTypeAndId.id);
|
|
924
924
|
const level = levels.find((level2) => level2.id === unit.properties.level_id);
|
|
@@ -962,11 +962,13 @@ var createEscalatorNodeMap = (relationships, options) => {
|
|
|
962
962
|
const {
|
|
963
963
|
properties: { direction, origin, destination }
|
|
964
964
|
} = relationship;
|
|
965
|
-
(
|
|
966
|
-
|
|
967
|
-
(
|
|
965
|
+
if (origin && destination) {
|
|
966
|
+
(0, import_set.default)(nodeMap, `${origin.id}.${destination.id}`, distanceOptions.baseDistance);
|
|
967
|
+
if (direction === "undirected") {
|
|
968
|
+
(0, import_set.default)(nodeMap, `${destination.id}.${origin.id}`, distanceOptions.baseDistance);
|
|
969
|
+
}
|
|
970
|
+
counter++;
|
|
968
971
|
}
|
|
969
|
-
counter++;
|
|
970
972
|
}
|
|
971
973
|
const t1 = performance.now();
|
|
972
974
|
trace("nav", ` \u2502 \u251C\u2500 add ${counter} escalator relationships`, t1 - t0);
|
|
@@ -1091,17 +1093,19 @@ var createPOINodeMap = (features, getFeatureUnit, unitOpenings) => {
|
|
|
1091
1093
|
features.forEach((feat) => {
|
|
1092
1094
|
try {
|
|
1093
1095
|
const locatedOnUnitId = getFeatureUnit(feat);
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1096
|
+
if (locatedOnUnitId) {
|
|
1097
|
+
const openings = unitOpenings[locatedOnUnitId] ?? [];
|
|
1098
|
+
const center7 = (0, import_center4.center)(feat);
|
|
1099
|
+
for (const opening of openings) {
|
|
1100
|
+
try {
|
|
1101
|
+
const openingCenter = (0, import_center4.center)(opening);
|
|
1102
|
+
const dis = (0, import_distance2.distance)(center7, openingCenter, { units: "meters" }) + BASE_POI_BASEDISTANCE;
|
|
1103
|
+
import_lodash9.default.set(nodeMap, `${opening.id}.${feat.id}`, dis);
|
|
1104
|
+
import_lodash9.default.set(nodeMap, `${feat.id}.${opening.id}`, dis);
|
|
1105
|
+
counter++;
|
|
1106
|
+
} catch (err) {
|
|
1107
|
+
console.log(err, opening);
|
|
1108
|
+
}
|
|
1105
1109
|
}
|
|
1106
1110
|
}
|
|
1107
1111
|
} catch (err) {
|
|
@@ -1148,13 +1152,13 @@ var createUnitOpenings = (relationships, units, openings) => {
|
|
|
1148
1152
|
});
|
|
1149
1153
|
units.forEach((unit) => {
|
|
1150
1154
|
const unitId = unit.id;
|
|
1151
|
-
const
|
|
1152
|
-
const relationshipIntermediaryTypeAndId =
|
|
1153
|
-
(relationship) => relationship.properties.intermediary[0]
|
|
1155
|
+
const connectedRelationship = relationshipMap.get(unitId) || [];
|
|
1156
|
+
const relationshipIntermediaryTypeAndId = compact(connectedRelationship.map(
|
|
1157
|
+
(relationship) => relationship.properties.intermediary?.[0]
|
|
1154
1158
|
// Assuming intermediary is always an array
|
|
1155
|
-
);
|
|
1159
|
+
));
|
|
1156
1160
|
const relationshipIntermediary = relationshipIntermediaryTypeAndId.map(({ id }) => {
|
|
1157
|
-
return openings.find((opening) => opening.id === id);
|
|
1161
|
+
return openings.find((opening) => !!opening && opening.id === id);
|
|
1158
1162
|
});
|
|
1159
1163
|
openingConnections[unitId] = (0, import_uniqBy.default)(
|
|
1160
1164
|
[...openingConnections[unitId] || [], ...relationshipIntermediary],
|
|
@@ -1179,8 +1183,7 @@ var prepareGraph = (options) => {
|
|
|
1179
1183
|
relationships = [],
|
|
1180
1184
|
openings = [],
|
|
1181
1185
|
units = [],
|
|
1182
|
-
kiosks = []
|
|
1183
|
-
levels = []
|
|
1186
|
+
kiosks = []
|
|
1184
1187
|
}
|
|
1185
1188
|
} = options;
|
|
1186
1189
|
const {
|
|
@@ -1189,7 +1192,7 @@ var prepareGraph = (options) => {
|
|
|
1189
1192
|
ramp: rampRelationships = [],
|
|
1190
1193
|
elevator: elevatorRelationships = [],
|
|
1191
1194
|
stairs: stairsRelationships = []
|
|
1192
|
-
} =
|
|
1195
|
+
} = import_lodash11.default.groupBy(relationships, "properties.category");
|
|
1193
1196
|
const unitOpenings = createUnitOpenings(traversalRelationships, units, openings);
|
|
1194
1197
|
const traversalNodeMap = createTraversalNodeMap(unitOpenings, options);
|
|
1195
1198
|
const escalatorNodeMap = createEscalatorNodeMap(escalatorRelationships, options);
|
|
@@ -1204,7 +1207,7 @@ var prepareGraph = (options) => {
|
|
|
1204
1207
|
unitOpenings,
|
|
1205
1208
|
options
|
|
1206
1209
|
);
|
|
1207
|
-
const amenityNodeMap = createPOINodeMap(amenities, (amenity) => amenity.properties.unit_ids[0], unitOpenings);
|
|
1210
|
+
const amenityNodeMap = createPOINodeMap(amenities, (amenity) => amenity.properties.unit_ids?.[0] || null, unitOpenings);
|
|
1208
1211
|
const anchorsNodeMap = createPOINodeMap(anchors, (anchor) => anchor.properties.unit_id, unitOpenings);
|
|
1209
1212
|
const walkwayUnits = units.filter((unit) => unit.properties.category === "walkway");
|
|
1210
1213
|
const kioskNodeMap = createPOINodeMap(kiosks, (kiosk) => findContainingUnit(kiosk, walkwayUnits)?.id, unitOpenings);
|
|
@@ -1248,7 +1251,7 @@ var prepareGraph = (options) => {
|
|
|
1248
1251
|
};
|
|
1249
1252
|
|
|
1250
1253
|
// src/data/navigate/steps/createStepUtils.ts
|
|
1251
|
-
var
|
|
1254
|
+
var import_lodash13 = require("lodash");
|
|
1252
1255
|
var import_intersectionBy = __toESM(require("lodash/intersectionBy"));
|
|
1253
1256
|
|
|
1254
1257
|
// src/data/navigate/description/describe.ts
|
|
@@ -1272,7 +1275,7 @@ var describeHorizontalStep = (intermediary, toward, landmark) => {
|
|
|
1272
1275
|
};
|
|
1273
1276
|
|
|
1274
1277
|
// src/data/navigate/steps/path/index.ts
|
|
1275
|
-
var
|
|
1278
|
+
var import_lodash12 = __toESM(require("lodash"));
|
|
1276
1279
|
|
|
1277
1280
|
// src/data/navigate/constants.ts
|
|
1278
1281
|
var OBSTACLE_FEATURE_TYPES = [
|
|
@@ -1915,7 +1918,7 @@ var createStepPathUtils = (options) => {
|
|
|
1915
1918
|
const exceptionFeatureIds = [];
|
|
1916
1919
|
const obstacles = findObstaclesFromWalkway(
|
|
1917
1920
|
relatedWalkablePlatform,
|
|
1918
|
-
|
|
1921
|
+
import_lodash12.default.compact(exceptionFeatureIds)
|
|
1919
1922
|
);
|
|
1920
1923
|
const line = findPathOnArea(from, to, {
|
|
1921
1924
|
resolution,
|
|
@@ -1995,7 +1998,7 @@ var createStepUtils = (options) => {
|
|
|
1995
1998
|
return intermediaryTypeAndId.map(({ id }) => findByIdSync(id));
|
|
1996
1999
|
};
|
|
1997
2000
|
const formatCategoryLabel = (category) => {
|
|
1998
|
-
return (0,
|
|
2001
|
+
return (0, import_lodash13.capitalize)(category);
|
|
1999
2002
|
};
|
|
2000
2003
|
const getNextStepIntermediary = (from, to, intermediary) => {
|
|
2001
2004
|
if (to.type === "end") return to.name;
|
|
@@ -2254,7 +2257,9 @@ var createLandmarkUtils = (options) => {
|
|
|
2254
2257
|
const locationType = occupant.properties.unit_id ? "unit" : "kiosk";
|
|
2255
2258
|
const locationId = locationType === "unit" ? occupant.properties.unit_id : occupant.properties.kiosk_id;
|
|
2256
2259
|
const location = locationType === "unit" ? findByIdSync(locationId) : findByIdSync(locationId);
|
|
2257
|
-
|
|
2260
|
+
if (!location) return null;
|
|
2261
|
+
const level = location.properties.level_id ? findByIdSync(location.properties.level_id) : null;
|
|
2262
|
+
if (!level) return null;
|
|
2258
2263
|
return {
|
|
2259
2264
|
name: occupant.properties.name,
|
|
2260
2265
|
point: (0, import_center8.center)(location.geometry).geometry.coordinates,
|
|
@@ -2264,7 +2269,7 @@ var createLandmarkUtils = (options) => {
|
|
|
2264
2269
|
};
|
|
2265
2270
|
};
|
|
2266
2271
|
const landmarks = [
|
|
2267
|
-
...occupants.map(occupantToLandmark)
|
|
2272
|
+
...compact(occupants.map(occupantToLandmark))
|
|
2268
2273
|
];
|
|
2269
2274
|
const findNearbyLandmarks = (point2, levelId) => {
|
|
2270
2275
|
if (point2 === null || levelId === null) return [];
|
|
@@ -2354,6 +2359,7 @@ var getNavigateClient = (options) => {
|
|
|
2354
2359
|
trace("nav", "\u2713 findRoute", 0);
|
|
2355
2360
|
const t02 = performance.now();
|
|
2356
2361
|
const path = graph.path(routeOriginParam, routeDestinationParam);
|
|
2362
|
+
if (path === null) return { steps: [], distance: 0, duration: 0 };
|
|
2357
2363
|
const t12 = performance.now();
|
|
2358
2364
|
trace("nav", " \u251C\u2500 path (dijkstra)", t12 - t02);
|
|
2359
2365
|
const waypoints = waypointUtils.toWaypoints(path);
|