@minmaps-dev/mm-web-sdk 1.0.0-rc.5 → 1.0.0-rc.50

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/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { IControl, ControlPosition, Map } from 'maplibre-gl';
1
+ import { Map, StyleSpecification, IControl, ControlPosition } from 'maplibre-gl';
2
2
 
3
3
  /**
4
4
  * Represents a floor in a building
@@ -6,8 +6,18 @@ import { IControl, ControlPosition, Map } from 'maplibre-gl';
6
6
  interface Floor {
7
7
  /** Unique floor identifier */
8
8
  id: string | number;
9
+ /**
10
+ * Underlying map entity id. Separate from `id` (the floor entity id) — used
11
+ * by waypoints (`wp.mapId`) and floor-geojson endpoints. Optional because
12
+ * not all providers populate it.
13
+ */
14
+ mapId?: string | number;
9
15
  /** Display name of the floor */
10
16
  name: string;
17
+ /** Short display name of the floor (e.g. "L2"). Optional: JACS leaves it
18
+ * unset on plenty of floors, and `JacsDataProvider` maps a blank one to
19
+ * `undefined` rather than inventing a value. */
20
+ shortName?: string;
11
21
  /** Floor sequence/order (e.g., -1 for basement, 0 for ground, 1 for first floor) */
12
22
  sequence?: number;
13
23
  /** Associated map data */
@@ -23,6 +33,7 @@ interface Floor {
23
33
  interface FloorMetadata {
24
34
  id: string | number;
25
35
  name: string;
36
+ shortName?: string;
26
37
  sequence?: number;
27
38
  isDefault?: boolean;
28
39
  isActive?: boolean;
@@ -32,7 +43,7 @@ interface POI {
32
43
  /** Unique identifier */
33
44
  id: string | number;
34
45
  /** POI type */
35
- type: 'amenity' | 'destination';
46
+ type: 'amenity' | 'destination' | 'kiosk';
36
47
  /** Display name */
37
48
  name: string;
38
49
  /** Geographic coordinates [longitude, latitude] */
@@ -45,6 +56,17 @@ interface POI {
45
56
  floorId: string | number;
46
57
  /** Category/type of amenity (e.g., 'restroom', 'elevator') */
47
58
  amenityType?: string;
59
+ /** Locale-stable classification text (name + type + keywords, frozen at
60
+ * load before any locale patch can translate them). Copied from the
61
+ * source `Amenity.classifyText`; used by `amenityCategoryFor`/rank
62
+ * instead of the live, possibly-translated fields. See `Amenity.classifyText`. */
63
+ classifyText?: string;
64
+ /** Which amenity icon layer this POI renders in — `'connector'`,
65
+ * `'entrance'`, `'parking'`, `'bus'`, `'information'` or `'other'`.
66
+ * Derived from the amenity's connector flag, name, type and keywords;
67
+ * emitted as the `amenityCategory` feature property the theme filters on.
68
+ * Amenities only. See `amenityCategoryFor`. */
69
+ amenityCategory?: 'connector' | 'entrance' | 'parking' | 'bus' | 'information' | 'other';
48
70
  /** Search keywords */
49
71
  keywords?: string[];
50
72
  /** Additional properties */
@@ -55,6 +77,15 @@ interface POI {
55
77
  waypoint?: Waypoint;
56
78
  /** Marks this POI as the "You are here" kiosk */
57
79
  isYouAreHere?: boolean;
80
+ /** For kiosk POIs only: compass heading the device physically faces, in
81
+ * degrees clockwise from north. Sourced from JACS `Device.heading`. */
82
+ heading?: number | null;
83
+ /** Per-instance name for this specific placement of an amenity (e.g.
84
+ * "Parking Lot A" for a "Parking" amenity), resolved from the waypoint's
85
+ * `amenityAssociations`. Distinct from `name`, which is the amenity's
86
+ * type-level name shared by every instance — see `Amenity.name`. Amenities
87
+ * only, and only set when JACS actually returned an instance name. */
88
+ instanceName?: string;
58
89
  }
59
90
  /**
60
91
  * Amenity - a specific type of POI (facilities, services)
@@ -64,14 +95,42 @@ interface Amenity {
64
95
  id: string | number;
65
96
  /** Display name */
66
97
  name: string;
67
- /** SVG icon data */
98
+ /** Inline SVG markup (legacy fullcall DTO). When absent, icon is resolved from `uris`. */
68
99
  svg?: string;
100
+ /**
101
+ * Hosted icon descriptors from JACS (`uris[].locales[].uriPath`). Used by
102
+ * the SDK's runtime icon fetcher to register a map image at init time.
103
+ */
104
+ uris?: Array<{
105
+ mimeType?: string;
106
+ resourceType?: string;
107
+ locales?: Array<{
108
+ locale?: string;
109
+ uriPath?: string;
110
+ }>;
111
+ }>;
112
+ /**
113
+ * Map-image id used as `icon-image` in the POI style layer. Decorated
114
+ * in-place by AmenityIcons.register once the SVG is fetched and registered.
115
+ */
116
+ iconId?: string;
69
117
  /** Search keywords */
70
118
  keywords?: string[];
71
119
  /** Associated waypoints */
72
120
  waypoints?: Waypoint[];
73
121
  /** Amenity type/category */
74
122
  type?: string;
123
+ /**
124
+ * Locale-stable snapshot of `name + type + keywords`, captured once from
125
+ * the `/all` payload before `applyLocale` ever runs. `amenityCategoryFor`
126
+ * and the icon-rank heuristics in `poi.ts` match hard-coded English
127
+ * vocabulary against those fields; `name`/`keywords` are legitimately
128
+ * overwritten with translated text on a language switch
129
+ * (`LOCALIZED_FIELDS.amenity`), which reclassified every translated
130
+ * amenity to `'other'`/tier-3 and dropped its icon until the next zoom
131
+ * recomputed the rank gate. Classification reads this frozen copy instead.
132
+ */
133
+ classifyText?: string;
75
134
  /** Extended properties */
76
135
  extensors?: Record<string, unknown>;
77
136
  }
@@ -87,8 +146,34 @@ interface Destination {
87
146
  waypoints?: Waypoint[];
88
147
  /** Category/classification */
89
148
  category?: string;
149
+ /** Room number — the CMS's "Room Number" field. A **real JACS column**, not
150
+ * one of the `mm_` stand-in extensors, so it arrives on the entity rather
151
+ * than in `extensors`. Surfaced as `getPOIDetails().roomNumber`. */
152
+ unitNumber?: string | null;
153
+ /** Search keywords */
154
+ keywords?: string[];
90
155
  /** Additional properties */
91
156
  properties?: Record<string, unknown>;
157
+ /** The CMS "Location Image" — a photo or logo for the popover, not a map
158
+ * marker. JACS `/all` fullcall serves this as
159
+ * `{ items: [{ resourceType, mimeType, path }] }`; the legacy/basic shape is
160
+ * `[{ locales: [{ uriPath }] }]`. `destinationImageSrc` handles both, and
161
+ * surfaces the result on `sdk.getPOIDetails(poi).imageUrl`. */
162
+ uris?: unknown;
163
+ /** Inline SVG for the uploaded image, embedded by JACS `/all`. Preferred over
164
+ * fetching `uris[].path` — no network round-trip. */
165
+ svg?: string;
166
+ /** Free-form CMS metadata. */
167
+ extensors?: Record<string, unknown>;
168
+ /** @deprecated Read by nothing in the SDK as of rc.34.
169
+ *
170
+ * JACS still serves the old map-manager "Label Display" mode
171
+ * (`0` Hidden · `1` Label · `2` Image), but the CMS removed the picker and
172
+ * pins every write to `1`. Rows authored before that keep a stale `0`/`2`
173
+ * the author can no longer change, so honouring the field would hide labels
174
+ * with no way to bring them back. Destinations always render dot + text
175
+ * label; the uploaded image goes to the popover instead. */
176
+ displayMode?: number;
92
177
  }
93
178
  /**
94
179
  * Waypoint - a specific point location
@@ -102,6 +187,19 @@ interface Waypoint {
102
187
  floorId?: string | number;
103
188
  /** Whether this is the primary/default waypoint */
104
189
  isPrimary?: boolean;
190
+ /** CMS zone (department) this waypoint belongs to, if any. The only backend
191
+ * link between a location and its department — read at runtime across the
192
+ * data provider (see the package CLAUDE.md zone landmine). */
193
+ zoneId?: string | number;
194
+ /** Per-instance names JACS attaches to this waypoint's amenities (e.g. a
195
+ * "Parking" amenity placed twice as "Parking Lot A" / "Parking Lot B").
196
+ * `id` matches an `Amenity.id`, not this waypoint — a waypoint can carry
197
+ * more than one amenity, so a consumer must find the entry for the
198
+ * specific amenity it's rendering rather than assuming index 0. */
199
+ amenityAssociations?: Array<{
200
+ id: string | number;
201
+ name: string;
202
+ }>;
105
203
  }
106
204
  /**
107
205
  * Amenity enriched with the floor it belongs to
@@ -121,6 +219,28 @@ interface POISearchResult {
121
219
  matchedFields: string[];
122
220
  }
123
221
 
222
+ /**
223
+ * A Zone is a CMS-authored department category — a named, colored grouping
224
+ * (e.g. "Cardiology", "Surgical", "Admin"). Zones are venue-wide (not
225
+ * floor-scoped) in the JACS `/all` payload and carry no geometry of their own;
226
+ * their spatial footprint is derived from the waypoints that reference them
227
+ * (`waypoint.zoneId`), which lets the SDK color-code the room/unit polygons a
228
+ * zone covers. See `map/zones.ts` for the derivation.
229
+ */
230
+ interface Zone {
231
+ id: number;
232
+ name: string;
233
+ /** Authored hex color (e.g. "#d32f2f"); may be empty when the author
234
+ * hasn't picked one — such zones are skipped for color-coding. */
235
+ color: string;
236
+ /** The color this zone's rooms are drawn in under the active theme — `color`
237
+ * in the default theme, its high-contrast palette entry under high contrast.
238
+ * Use this, not `color`, for a legend swatch, and re-read it on
239
+ * `themeChanged`. Set on `getZones()` results only. */
240
+ displayColor?: string;
241
+ description?: string;
242
+ }
243
+
124
244
  /** Captured camera state (center, zoom, pitch, bearing) */
125
245
  type CameraState = {
126
246
  center: [number, number];
@@ -140,25 +260,433 @@ type ViewOptions = {
140
260
  /** SW/NE bounding box */
141
261
  type Bounds = [[number, number], [number, number]];
142
262
 
263
+ /** How to center the map after computing a route */
264
+ type WayfindCenterMode = 'none' | 'destination' | 'route';
265
+ /**
266
+ * Per-call routing preferences forwarded to the wayfinding provider.
267
+ *
268
+ * - `avoidStairs` — hard-filter stairs from the graph. Accessibility
269
+ * preference otherwise comes from the CMS's per-path-type `weight`
270
+ * (elevators score low, stairs/escalators score high) — see
271
+ * `data/wayfinding/weights.ts` — not from a caller-supplied flag.
272
+ *
273
+ * The bundled stub provider doesn't compute routes; consumers wire a real
274
+ * provider (see `mm-web-sdk-example/lib/wayfinding`) that reads this
275
+ * flag when building edge weights.
276
+ */
277
+ type RoutingOptions = {
278
+ avoidStairs?: boolean;
279
+ };
280
+ /**
281
+ * A spot on a floor that need not be a POI — a tap in the middle of a
282
+ * corridor. Routes and walk times accept one wherever they accept a POI:
283
+ * it's snapped to the closest point along a path on its floor and routed
284
+ * from (or to) there, without any CMS waypoint at that spot.
285
+ *
286
+ * `kind` tells it apart from a `POI`, which also has `floorId` and
287
+ * `coordinates`. Build one with `sdk.snapToPath`, or by hand from a stored
288
+ * point (a shared link) — the SDK snaps it again either way.
289
+ */
290
+ type MapLocation = {
291
+ kind: 'location';
292
+ floorId: string | number;
293
+ /** `[lng, lat]`. */
294
+ coordinates: [number, number];
295
+ /** What the route calls it — the arrive step's landmark and the end
296
+ * flag's label. Omitted, the arrive step reads "You have arrived". */
297
+ label?: string;
298
+ /** Where the visitor actually tapped, when it's off the walking network and
299
+ * `coordinates` (where the route starts or ends) had to be moved onto it.
300
+ * Set by `snapToPath`; a location built from a stored point is snapped from
301
+ * `tapped ?? coordinates`, so store this to rebuild it later. */
302
+ tapped?: [number, number];
303
+ /** The walkable way from `tapped` to `coordinates` — around rooms, back-of-
304
+ * house areas and other obstacles, leaving a room by its door — drawn as a
305
+ * dotted line with a marker on the tap. `tapped` without `approach` means
306
+ * no walkable way was found (a room with no known door, somewhere nothing
307
+ * walks), so the point was simply moved to the nearest path. */
308
+ approach?: [number, number][];
309
+ /** `tapped` is inside a building or room, so `approach` leads to a hallway
310
+ * rather than an outdoor walkway — it picks the approach step's wording.
311
+ * Set by `snapToPath` alongside `approach`. */
312
+ indoors?: boolean;
313
+ /** `tapped` was in a hallway, a little way off its path line: the point was
314
+ * moved to the middle of the hall, with no `approach` to draw. Set by
315
+ * `snapToPath` with `tapped`; a "choose on map" UI can say so. */
316
+ centered?: boolean;
317
+ };
318
+ /** True for a `MapLocation`, false for a `POI`. */
319
+ declare function isMapLocation(value: unknown): value is MapLocation;
320
+
321
+ /**
322
+ * A single point along the rendered route. `mapId` lets the renderer
323
+ * split the polyline by floor (so other-floor segments don't paint
324
+ * through the visible floor's geometry); `waypointId` and `pathTypeId`
325
+ * let downstream layers (text-directions, step UI) classify
326
+ * transitions — e.g. "Take the elevator" vs "Walk straight". The two
327
+ * endpoint points are the kiosk and destination anchors (`isEndpoint`
328
+ * marks them so they can render endpoint pins). All fields except
329
+ * `coordinates` are optional for backward-compat with the straight-line
330
+ * fallback.
331
+ */
332
+ type RoutePoint = {
333
+ coordinates: [number, number];
334
+ /** Floor mapId this point sits on. Missing on the straight-line fallback. */
335
+ mapId?: number;
336
+ /** JACS waypoint id this point resolved to, if any. */
337
+ waypointId?: number;
338
+ /** Path type of the edge that LEADS INTO this point (i.e. the edge
339
+ * whose `toKey` is this node). Used to detect elevator / stair /
340
+ * escalator transitions. Missing on the start point and on the
341
+ * straight-line fallback. */
342
+ pathTypeId?: number;
343
+ /** True for the snapped kiosk + destination anchors. */
344
+ isEndpoint?: boolean;
345
+ };
346
+
347
+ type WayfindStep = DepartStep | TurnStep | ContinueStep | TransitionStep$1 | ApproachStep | ArriveStep;
348
+ type StepBase = {
349
+ /** Indices into the input `points` array that this step spans. */
350
+ pointRange: [startInclusive: number, endInclusive: number];
351
+ /** Floor this step is on. `null` for cross-floor transitions. */
352
+ floorId: number | null;
353
+ /** Localized instruction text. */
354
+ text: string;
355
+ /** Total walking distance within this step, in feet (rounded). */
356
+ distanceFeet?: number;
357
+ /** Landmark name used for anchoring, if any. */
358
+ landmark?: string;
359
+ };
360
+ type DepartStep = StepBase & {
361
+ type: 'depart';
362
+ /** Which way the traveller turns before walking off, relative to the
363
+ * way they're facing at the origin. Absent when `originFacingBearing`
364
+ * wasn't supplied (direction unknowable) or when the route heads
365
+ * straight ahead. Consumers use it to pick the step's icon. */
366
+ initialTurn?: 'left' | 'right' | 'around';
367
+ };
368
+ type TurnStep = StepBase & {
369
+ type: 'turn-left' | 'turn-right' | 'u-turn';
370
+ };
371
+ type ContinueStep = StepBase & {
372
+ type: 'continue';
373
+ };
374
+ type TransitionStep$1 = StepBase & {
375
+ type: 'transition';
376
+ transition: 'elevator' | 'stairs' | 'escalator';
377
+ fromFloorId: number | null;
378
+ toFloorId: number | null;
379
+ };
380
+ type ArriveStep = StepBase & {
381
+ type: 'arrive';
382
+ };
383
+ /**
384
+ * The walk between a tapped spot and the walking network (`MapLocation.approach`):
385
+ * `'start'` from where the visitor tapped to the hallway, before the depart
386
+ * step; `'end'` from the hallway to the tapped destination, before arrive.
387
+ * Its geometry isn't on the route line, so it carries its own `path` (in
388
+ * walking order) — highlight and frame that, not `pointRange`, which only
389
+ * marks the route point it joins.
390
+ */
391
+ type ApproachStep = StepBase & {
392
+ type: 'approach';
393
+ approach: 'start' | 'end';
394
+ path: [number, number][];
395
+ };
396
+
143
397
  interface MapEvent {
144
398
  floor?: Floor;
399
+ /** `routeReady`: the destination routed to — the exact instance, so for
400
+ * `navigateFromKioskToClosestAmenity` it carries the picked `waypointId`. */
145
401
  poi?: POI;
402
+ /** All POIs co-located at a clicked point (overlapping pins / a shared
403
+ * suite). Emitted by `poiSelected`; length ≥ 1, and `poi` mirrors
404
+ * `pois[0]` for single-POI consumers. */
405
+ pois?: POI[];
146
406
  coordinates?: [number, number];
407
+ /** `locationPicked`: the tap snapped to the closest point along a path, or
408
+ * `null` when no path on the floor was within reach (`coordinates` is the
409
+ * raw tap either way). `routeFailed`: the location that didn't resolve.
410
+ * `routeReady`: the tapped spot routed to, in place of `poi`. */
411
+ location?: MapLocation | null;
412
+ /** `locationPicked`: the tap was outside every building and room on the
413
+ * floor. With `hasOutdoorPaths(floor.id)` false, nothing outdoors on this
414
+ * floor is walkable — the visitor wants a floor that has outdoor paths. */
415
+ outdoors?: boolean;
147
416
  error?: any;
148
417
  venue?: any;
149
418
  camera?: CameraState;
419
+ /** Emitted by `themeChanged`; `'custom'` when consumer passed a raw style. */
420
+ theme?: 'default' | 'high-contrast' | 'color-blind' | 'custom';
421
+ /** Emitted by `localeChanged` after `setLocale()` finishes patching the
422
+ * venue model. BCP-47 code (`'en'`, `'es'`, `'es-MX'`). */
423
+ locale?: string;
424
+ /** Emitted by `routeReady` after a successful `navigateFromKioskToPOI`.
425
+ * Carries the raw geometry (`points`) and the human-readable
426
+ * step-by-step directions. Subscribe to drive a turn-by-turn UI. */
427
+ route?: {
428
+ points: RoutePoint[];
429
+ steps: WayfindStep[];
430
+ /** Floor mapId of each segment, in render order. `null` for
431
+ * segments emitted by the straight-line fallback. */
432
+ floorIds: Array<number | null>;
433
+ };
150
434
  }
151
435
  type EventCallback = (event: MapEvent) => void;
152
436
 
437
+ /**
438
+ * Padding kept clear inside the viewport when the SDK frames bounds —
439
+ * the initial venue/floor fit and the wayfinding route fit. A plain
440
+ * number pads all sides equally; the object form lets a kiosk reserve
441
+ * space for fixed UI overlays (header, dock, side rails) so framed
442
+ * content is never hidden behind them.
443
+ */
444
+ type BoundsPadding = number | {
445
+ top: number;
446
+ bottom: number;
447
+ left: number;
448
+ right: number;
449
+ };
450
+ /**
451
+ * Built-in theme names accepted by `MinuteMaps.setTheme()` and the
452
+ * `options.theme` init option. Pass a `StyleSpecification` directly for
453
+ * custom themes.
454
+ */
455
+ type ThemeName = 'default' | 'high-contrast' | 'color-blind';
456
+ /**
457
+ * Style of the disc + ring rendered behind each amenity icon. The SDK
458
+ * composites this into the icon bitmap at registration time, so badge +
459
+ * icon participate in symbol collision as one unit.
460
+ */
461
+ type AmenityBadgeStyle = {
462
+ /** Fill colour of the badge disc. Default `'#fdb81e'`. */
463
+ color?: string;
464
+ /** Stroke colour of the ring around the disc. Default `'#FFFFFF'`. */
465
+ ringColor?: string;
466
+ /** Ring width in logical px. Default `2`. */
467
+ ringWidth?: number;
468
+ /** Extra inset between the icon and the badge's inner edge, in logical px
469
+ * (applied on all sides). Default `0` — the icon fills ~85% of the disc
470
+ * as before. Raise this if an icon's own artwork reaches close to its
471
+ * viewBox edges and ends up touching the ring. */
472
+ padding?: number;
473
+ };
153
474
  interface SDKOptions {
154
475
  debug?: boolean;
155
- theme?: 'light' | 'dark' | 'hybrid' | any;
476
+ /**
477
+ * `window` key the SDK instance is published under while `debug` is on, so
478
+ * a running kiosk can be driven from devtools (`mm.debug.hide('labels')`,
479
+ * `mm.getMap()`). Defaults to `'mm'`. Pass another name to avoid a clash,
480
+ * or `false` to publish nothing even in debug mode. Ignored entirely when
481
+ * `debug` is off.
482
+ */
483
+ debugGlobal?: string | false;
484
+ /**
485
+ * Initial theme. `'default'` uses the bundled hybrid 3D theme.
486
+ * `'high-contrast'` uses the WCAG-AA tuned theme. `'color-blind'` keeps the
487
+ * default look but swaps the colors that red-green and blue-yellow color
488
+ * blindness merge (the route, room categories and department zones,
489
+ * restrooms, parks). Pass a
490
+ * `StyleSpecification` for fully custom styling.
491
+ */
492
+ theme?: ThemeName | any;
493
+ /**
494
+ * When true, the SDK skips animations on imperative camera calls
495
+ * (wayfinding fits, `setView`, idle re-frames). Consumers should
496
+ * mirror their app's `prefers-reduced-motion` state into this.
497
+ */
498
+ reducedMotion?: boolean;
499
+ /**
500
+ * Whether a freshly computed route auto-highlights its first step's
501
+ * segment (the brighter `route-line-active` overlay). Defaults to
502
+ * `true`, preserving the turn-by-turn segment highlight that
503
+ * `setActiveStep` drives.
504
+ *
505
+ * Set `false` for kiosk-style "show the whole route at once" UIs:
506
+ * the entire route line is shown without singling out one segment,
507
+ * which reads more clearly at a glance and avoids implying the visitor
508
+ * must step through the route. `setActiveStep` still works when called
509
+ * explicitly (e.g. a paginated QR-handoff / mobile flow) — this only
510
+ * controls the automatic highlight on `routeReady`.
511
+ */
512
+ routeStepHighlight?: boolean;
513
+ /**
514
+ * Whether restroom pins that are too close together to draw individually
515
+ * collapse into a single Material `wc` badge. Defaults to `true`.
516
+ *
517
+ * Venues author men's and women's restrooms as two amenities a few metres
518
+ * apart. Both are wayfinding-critical (rank 0) and both draw on a layer that
519
+ * doesn't allow icon overlap, so without this MapLibre resolves the collision
520
+ * by hiding one of them outright until the camera is very close in. Grouping
521
+ * shows one badge in their place and hands back *all* the members when it's
522
+ * tapped, so the consumer can offer directions to each.
523
+ *
524
+ * Set `false` to opt out and get the raw collision behaviour back.
525
+ */
526
+ groupRestroomIcons?: boolean;
156
527
  initialFloor?: string | number;
157
528
  enableInteractions?: boolean;
158
529
  customSprite?: string;
159
530
  minIndoorZoom?: number;
531
+ /**
532
+ * How far, in **metres** (default `0.3`, ≈1 ft), extruded interior polygons
533
+ * (restrooms, back-of-house, obstacles, connectors) are inset so their edges
534
+ * don't z-fight the neighbouring room block. A polygon too thin to survive
535
+ * the inset (it would keep under half its area, e.g. a ~0.3 m back-of-house
536
+ * perimeter band) is left at its original size rather than erased. Metres to match the theme's
537
+ * `fill-extrusion-height` values, which MapLibre defines in metres — unlike
538
+ * the distances shown to visitors, which are in feet. Was feet before this
539
+ * option changed units; a value of `1` is now ~3.3× thicker.
540
+ */
160
541
  wallThickness?: number;
161
- boundsPadding?: number;
542
+ /**
543
+ * How much costlier a candidate on a **different floor** from the kiosk is
544
+ * treated when choosing the closest instance of an amenity (default `1.5`).
545
+ * Used by `findClosestByWalkTime`, and so by `navigateFromKioskToClosestAmenity`
546
+ * and `highlightAmenity`.
547
+ *
548
+ * A multiplier on the trip's effort — walk time plus the elevator wait — not
549
+ * a distance: `1.5` means another floor's instance has to be a third cheaper
550
+ * to beat one on the kiosk's floor. It is a *preference* for not making the
551
+ * visitor change floors, layered on top of the physical cost of doing so
552
+ * (which is already in the effort). `1` turns it off and ranks by effort
553
+ * alone; a value below `1` is treated as `1`. It only affects which instance
554
+ * is chosen — never a route.
555
+ *
556
+ * For scale: at the Las Vegas VA the nearest other-floor Lactation Pod costs
557
+ * ~400 ft-equivalent against ~530 for the one on the kiosk's floor, so it
558
+ * takes a value above ~1.32 to keep the visitor on their floor.
559
+ */
560
+ otherFloorPenalty?: number;
561
+ boundsPadding?: BoundsPadding;
562
+ /**
563
+ * Caps how far a visitor can pan/zoom out. By default the SDK derives this
564
+ * from the venue's own bounds, scaled to 3x its width/height around the
565
+ * same center — enough room to pan around the building without drifting
566
+ * into an empty, un-tiled region. The default box is never smaller than
567
+ * ~3.7 km a side, so a small venue isn't forced to zoom in tighter than a
568
+ * large one. Pass a number to use a different
569
+ * multiplier (e.g. `1.5` for a tighter leash), explicit `[[west, south],
570
+ * [east, north]]` bounds to override entirely, or `false` to disable
571
+ * max-bounds clamping.
572
+ */
573
+ maxBounds?: Bounds | number | false;
574
+ /**
575
+ * Hides basemap points of interest (civic and marine icons, park names) that
576
+ * fall within this many metres of the venue's bounds, so an OSM library or
577
+ * chapel on the campus isn't drawn underneath the venue's own map. Defaults
578
+ * to `50`. Street labels, road shields and water labels are never hidden.
579
+ * Pass `false` to show every basemap POI.
580
+ */
581
+ hideBasemapPoisNearVenue?: number | false;
582
+ /**
583
+ * Whether the venue's kiosk anchors a "You are here" marker, and the opening
584
+ * view / default route origin. Defaults to `true`. Set `false` for non-kiosk
585
+ * consumers (e.g. a browser map): no device is resolved, even via the
586
+ * "first placed device" fallback, so the marker is never drawn.
587
+ */
588
+ kiosk?: boolean;
589
+ /**
590
+ * Pitch (deg) for the opening view, applied centred on the kiosk ("You
591
+ * are here"). Omit for top-down.
592
+ */
593
+ initialPitch?: number;
594
+ /**
595
+ * Zoom for the opening view, centred on the kiosk. Set this above the
596
+ * theme's unit-walls breakpoint (~16.5 in the bundled hybrid theme) so the
597
+ * kiosk opens on the building's interior floor plan (its contents) rather
598
+ * than a zoomed-out 3D massing outline. Omit to keep the post-floor-fit
599
+ * zoom.
600
+ */
601
+ initialZoom?: number;
602
+ /**
603
+ * Zoom floor for selecting a place — a map tap or `selectPOI` (default
604
+ * `19.25`, one level into the Kiosk view). A selection made from further out
605
+ * zooms in to this; a closer zoom is kept. At the Kiosk view's edge (18.25)
606
+ * the selected dot and name are drawn but still lose collision to their
607
+ * neighbours, and in the Building view (a room tapped from 16.5 up) they
608
+ * aren't drawn at all — either way the visitor selects a place they can't
609
+ * see. `0` keeps the current zoom on every selection.
610
+ */
611
+ selectionZoom?: number;
612
+ /**
613
+ * Clamp zoom-out relative to the opening view. When set, the map's
614
+ * `minZoom` becomes `(initialZoom − this)`, so visitors can nudge out by
615
+ * this many zoom levels but never pull back below the interior into the
616
+ * massing/region. `0` locks zoom-out exactly to the opening view.
617
+ */
618
+ minZoomBelowInitialFit?: number;
619
+ /**
620
+ * Zoom-out floor expressed as ground scale: the most metres one CSS pixel
621
+ * may span. The SDK converts it to a `minZoom` at the venue's latitude, so
622
+ * every venue shows the same amount of surrounding map when fully zoomed
623
+ * out — a plain zoom number doesn't, because Web Mercator shows less ground
624
+ * per zoom level the further a venue is from the equator. Takes precedence
625
+ * over `minZoomBelowInitialFit`. For scale, `1.207` is zoom 15.8 at Orlando
626
+ * (about 2.3 km x 1.3 km on a 1920x1080 screen).
627
+ */
628
+ minZoomMetersPerPixel?: number;
629
+ /**
630
+ * Override the colour the SDK recolours every amenity SVG to before it
631
+ * composites the badge. `none` / `transparent` fills are preserved so
632
+ * cut-outs stay. When the badge is enabled (the default), this defaults
633
+ * to navy (`#162e51`) so icons read on gold. Set explicitly for a
634
+ * different look, or set `amenityBadge: false` to disable recolouring
635
+ * altogether and keep the CMS-uploaded colours.
636
+ */
637
+ amenityIconColor?: string;
638
+ /**
639
+ * Badge composited behind each amenity icon. Pass `false` to render the
640
+ * icon alone (no badge — useful for high-contrast or 2D themes where the
641
+ * gold disc would compete with the floor). Pass an object to tune the
642
+ * disc / ring style. Defaults to a VA-gold disc with a 2px white ring.
643
+ *
644
+ * The badge is baked into the icon bitmap (canvas composite) rather than
645
+ * drawn as a separate circle layer, so badge + icon participate in symbol
646
+ * collision together — overlapping amenities hide as one unit instead of
647
+ * the icon hiding while the disc stays painted.
648
+ */
649
+ amenityBadge?: AmenityBadgeStyle | false;
650
+ /**
651
+ * Badge for vertical-circulation connectors (elevator / stairs / escalator).
652
+ * These render as their own visual class — a navy disc with a white glyph —
653
+ * so circulation reads distinct from the gold service amenities. Pass `false`
654
+ * to fall them back into the regular gold badge, or an object to tune the
655
+ * disc / ring. When `amenityBadge` is `false`, connectors are badge-less too
656
+ * unless this is set explicitly.
657
+ */
658
+ connectorBadge?: AmenityBadgeStyle | false;
659
+ /**
660
+ * Badge for information-desk amenities (curated `information`/`info`
661
+ * icon). These render as their own visual class — a green disc with a
662
+ * white glyph by default — so information reads distinct from the gold
663
+ * service amenities. Pass `false` to fall them back into the regular gold
664
+ * badge, or an object to tune the disc / ring. When `amenityBadge` is
665
+ * `false`, information icons are badge-less too unless this is set
666
+ * explicitly.
667
+ */
668
+ informationBadge?: AmenityBadgeStyle | false;
669
+ /**
670
+ * Glyph colour for information icons on their badge. Default white
671
+ * (matches `informationBadge`'s default green disc).
672
+ */
673
+ informationIconColor?: string;
674
+ /**
675
+ * Badge for the end-of-route flag (`poi-route-end-flag`) shown in place of a
676
+ * destination's dot while a route to it is displayed. Has its own defaults
677
+ * (green disc, white ring) that don't follow `amenityBadge`. Pass an object
678
+ * to tune the disc / ring, or `false` for the bare flag glyph with no badge.
679
+ * When `amenityBadge` is `false`, the flag is badge-less too unless this is
680
+ * set explicitly. Under the high-contrast theme the disc colour is forced to
681
+ * the high-contrast amenity yellow, like the amenity and connector badges.
682
+ */
683
+ routeEndBadge?: AmenityBadgeStyle | false;
684
+ /**
685
+ * Flag glyph colour on the end-of-route badge. Default white (contrasts the
686
+ * default green disc); doesn't follow `amenityIconColor`. Ignored under the
687
+ * high-contrast theme, which forces its own glyph colour.
688
+ */
689
+ routeEndIconColor?: string;
162
690
  styleMode?: 'venueStyleUrl' | 'sdkTemplate';
163
691
  templateOverrideMode?: 'colorsOnly' | 'colorsAndConstants' | 'all';
164
692
  }
@@ -190,9 +718,19 @@ type SDKConfig = {
190
718
  venueId: number;
191
719
  locale?: string;
192
720
  auth?: JMapAuth;
721
+ /**
722
+ * Identifies which physical kiosk this instance is, so the SDK can pin
723
+ * the "You are here" marker. Matched against either the numeric device
724
+ * `id` or the device `uuid` from the venue's `devices`. The device's
725
+ * attached waypoint (`waypoint.deviceIds`) is the kiosk's location.
726
+ */
727
+ deviceId?: string | number;
193
728
  };
194
729
  jacs: {
195
- mode: 'proxy' | 'direct';
730
+ /** `snapshot` reads published venue snapshots from a CDN — what clients
731
+ * should use. `proxy`/`direct` read live JACS (the draft): local dev and
732
+ * CMS preview. */
733
+ mode: 'proxy' | 'direct' | 'snapshot';
196
734
  host?: string;
197
735
  auth?: {
198
736
  clientId: string;
@@ -200,12 +738,240 @@ type SDKConfig = {
200
738
  password: string;
201
739
  };
202
740
  proxyBaseUrl?: string;
741
+ baseUrl?: string;
203
742
  };
204
743
  options?: SDKOptions;
205
744
  };
206
745
 
207
- /** How to center the map after computing a route */
208
- type WayfindCenterMode = 'none' | 'destination' | 'route';
746
+ /** The chosen ends; either may be missing. */
747
+ type RouteEndPreview = {
748
+ start?: POI | MapLocation | null;
749
+ destination?: POI | MapLocation | null;
750
+ };
751
+
752
+ type Visibility = 'visible' | 'none';
753
+ type DebugLayersDeps = {
754
+ getMap: () => Map | null;
755
+ /**
756
+ * Re-assert the visibility the SDK itself owns — floor layers, the POI
757
+ * category filter, the 2D/3D view mode. Called at the end of `reset()`,
758
+ * because restoring a captured `visibility` can't distinguish "the theme
759
+ * ships this visible" from "the SDK hid it because it belongs to another
760
+ * floor", and the naive restore would reveal every floor at once.
761
+ */
762
+ reapplySdkState?: () => void;
763
+ log?: (...args: unknown[]) => void;
764
+ };
765
+ type LayerRow = {
766
+ id: string;
767
+ type: string;
768
+ visibility: Visibility;
769
+ /**
770
+ * What this layer's visibility was before we touched it — i.e. what the
771
+ * theme and the SDK want it to be. Equal to `visibility` for any layer we
772
+ * hold no override on. A UI wanting to show "is this group on" should judge
773
+ * only the layers whose `base` is `'visible'`: the rest (the 3D extrusions
774
+ * in flat mode, the 2D outlines outside it) aren't rendering by design, so
775
+ * counting them makes a healthy group look half-off.
776
+ */
777
+ base: Visibility;
778
+ };
779
+ /**
780
+ * Console-facing layer inspector for demos, screenshots and debugging.
781
+ *
782
+ * Reachable as `sdk.debug`, and as `window.mm.debug` when
783
+ * `options.debug` is on (see `options.debugGlobal`).
784
+ *
785
+ * Two things make it more than a wrapper around `setLayoutProperty`:
786
+ *
787
+ * 1. **Selectors.** `hide('amenities')`, `hide('route-')`, `hide('/^poi-/')`
788
+ * and `hide('type:fill-extrusion')` all work, so you don't have to know
789
+ * the theme's layer ids to start poking at it.
790
+ * 2. **Overrides are sticky.** The SDK re-asserts layer visibility on floor
791
+ * changes, `setPOIFilter`, flat-mode toggles and theme swaps — all of which
792
+ * would otherwise wipe a manual toggle mid-demo. Every override is re-applied
793
+ * on `styledata`, so what you hid stays hidden until `reset()`.
794
+ */
795
+ declare class DebugLayers {
796
+ private deps;
797
+ /** layer id → visibility this API is asserting. */
798
+ private overrides;
799
+ /** layer id → visibility before we first touched it. */
800
+ private originals;
801
+ /** `${layer}|${prop}` → paint value before we first touched it. */
802
+ private paintOriginals;
803
+ private sticky;
804
+ private attachedTo;
805
+ /** Re-entrancy guard: our own `setLayoutProperty` fires `styledata`. */
806
+ private applying;
807
+ private readonly onStyleData;
808
+ constructor(deps: DebugLayersDeps);
809
+ /** Begin re-asserting overrides across style/floor changes. */
810
+ attach(map: Map): void;
811
+ detach(): void;
812
+ /**
813
+ * Every layer in the active style, newest-on-top last, with its current
814
+ * visibility. Pass a selector to narrow it (same grammar as `hide`).
815
+ */
816
+ list(selector?: string): LayerRow[];
817
+ /** Just the ids currently rendering — the quickest "what am I looking at". */
818
+ visible(): string[];
819
+ /** Group name → the ids it resolves to *in the active style*. */
820
+ groups(): Record<string, string[]>;
821
+ /** Hide every layer the selectors resolve to. Returns the ids affected. */
822
+ hide(...selectors: string[]): string[];
823
+ /**
824
+ * **Force** every resolved layer visible — including ones the SDK
825
+ * deliberately keeps off: the 3D extrusions while flat mode is on, the 2D
826
+ * outlines while it isn't, every floor but the active one. Forcing those
827
+ * renders two representations of the same geometry at once, or every floor
828
+ * stacked, and the map looks wrong.
829
+ *
830
+ * So this is *not* the way to undo a `hide()` — use `restore()`, which puts
831
+ * each layer back to what it was rather than blanket-revealing the group.
832
+ * Reach for `show()` only when you actually mean "reveal this regardless".
833
+ */
834
+ show(...selectors: string[]): string[];
835
+ /**
836
+ * Undo our overrides on these layers: each goes back to the visibility it
837
+ * had before we first touched it, and control returns to the SDK (floor
838
+ * layers, POI filter, view mode re-assert afterwards).
839
+ *
840
+ * This is the correct inverse of `hide()`. A group is rarely uniformly
841
+ * visible to begin with — `rooms` hides either the 2D outline or the 3D
842
+ * extrusion depending on view mode, and every floor layer but the active
843
+ * one is off — so `hide()` then `show()` does not round-trip, but `hide()`
844
+ * then `restore()` does.
845
+ *
846
+ * Returns the ids that actually had an override; layers we never touched
847
+ * are left alone.
848
+ */
849
+ restore(...selectors: string[]): string[];
850
+ /** Flip each resolved layer independently. Returns the ids affected. */
851
+ toggle(...selectors: string[]): string[];
852
+ /**
853
+ * Show only what the selectors resolve to — everything else is hidden
854
+ * (except `background`, which is just the canvas colour). The one-liner for
855
+ * "which layer is drawing that thing".
856
+ *
857
+ * The kept set is *restored*, not forced: anything we'd previously hidden
858
+ * comes back, but a layer the theme ships hidden stays hidden. Soloing must
859
+ * not invent geometry that never renders normally — see `show()`.
860
+ */
861
+ solo(...selectors: string[]): string[];
862
+ /**
863
+ * Set a paint property — `paint('units-fill', 'fill-color', '#f00')`. The
864
+ * original value is captured so `reset()` puts it back. Not sticky: unlike
865
+ * visibility, a theme swap rebuilds paint from the new style and re-applying
866
+ * a captured expression across themes is exactly the bug `setTheme` had to
867
+ * fix. Re-run it after a swap if you need it back.
868
+ */
869
+ paint(selector: string, prop: string, value: unknown): string[];
870
+ /**
871
+ * Drop every override and paint change, then let the SDK re-assert the
872
+ * visibility it owns (floor layers, POI filter, view mode). Back to the map
873
+ * you'd have had without touching anything.
874
+ */
875
+ reset(): void;
876
+ /**
877
+ * Hand the layers we just released back to the SDK, then re-assert whatever
878
+ * overrides are still standing.
879
+ *
880
+ * The second half is not belt-and-braces. The SDK's re-assert passes are
881
+ * all-or-nothing: with no POI filter active, `applyPOIFilter` writes
882
+ * `visible` to *every* POI category layer, and the floor / view-mode passes
883
+ * sweep their whole layer sets the same way. So releasing one group would
884
+ * un-hide every other group you'd hidden — hide labels, destinations and
885
+ * amenities, re-check one, and all three came back.
886
+ *
887
+ * Doing it here rather than waiting for the `styledata` the SDK's writes
888
+ * trigger also keeps it synchronous: MapLibre fires that on a later frame,
889
+ * so a UI reading visibility straight after this call would otherwise see —
890
+ * and render — the clobbered state.
891
+ */
892
+ private handBackToSdk;
893
+ /**
894
+ * The current override set as a plain object — save it, paste it back with
895
+ * `apply()` to reproduce the exact same framing for a screenshot later.
896
+ */
897
+ snapshot(): Record<string, Visibility>;
898
+ /** Apply a `snapshot()` (or any layer-id → visibility map). */
899
+ apply(snapshot: Record<string, Visibility>): string[];
900
+ /**
901
+ * Stop (or resume) re-asserting overrides when the style changes. Turn it
902
+ * off if you want a floor switch or `setPOIFilter` to win over what you
903
+ * toggled by hand.
904
+ */
905
+ setSticky(enabled: boolean): boolean;
906
+ /** Console cheat sheet. */
907
+ help(): Array<{
908
+ call: string;
909
+ does: string;
910
+ }>;
911
+ /**
912
+ * Resolve one selector to layer ids present in the active style, tried in
913
+ * order: group name → exact layer id → `type:<layer type>` → `/regex/` →
914
+ * case-insensitive substring on the id.
915
+ */
916
+ resolve(selector: string): string[];
917
+ private resolveAll;
918
+ private set;
919
+ /**
920
+ * Put these layers back to their pre-override visibility and forget them.
921
+ * Callers decide whether to follow up with `reapplySdkState` — `restore()`
922
+ * and `reset()` do, `solo()` deliberately doesn't.
923
+ */
924
+ private restoreVisibility;
925
+ /** Write one layer's visibility and remember it as an override. */
926
+ private write;
927
+ /**
928
+ * Re-assert overrides after something else rewrote layer visibility. Only
929
+ * writes when the current value actually differs, so this doesn't feed
930
+ * itself through the `styledata` it triggers.
931
+ */
932
+ private reapply;
933
+ private styleLayers;
934
+ private visibilityOf;
935
+ /**
936
+ * MapLibre throws from these getters/setters while a style is mid-swap (the
937
+ * layer exists in `getStyle()` but its owner is being replaced). A debug tool
938
+ * that can break the map it's inspecting is worse than useless.
939
+ */
940
+ private safe;
941
+ }
942
+
943
+ type LayerAudit = {
944
+ /** `featureType` values the CMS permits for this customer. */
945
+ allowed: string[];
946
+ /** `featureType` values actually present in the loaded floors. */
947
+ inData: string[];
948
+ /** `featureType` values some theme layer filters on. */
949
+ inStyle: string[];
950
+ /**
951
+ * Drawn on a map but not in the customer's allowed list — a mis-authored
952
+ * or renamed layer. These render only by accident (if the theme happens to
953
+ * match the string) and are invisible otherwise.
954
+ */
955
+ unauthorized: string[];
956
+ /**
957
+ * Present in the data and allowed, but no theme layer filters on it. The
958
+ * author drew something the map will never show.
959
+ */
960
+ unstyled: string[];
961
+ /**
962
+ * The theme filters on it, but no loaded floor contains it. Dead weight in
963
+ * the style *for this venue* — another venue may well use it, so this is a
964
+ * prompt to check, not a delete list. Cross-reference `allowed`: a value
965
+ * that isn't in there either is dead everywhere for this customer.
966
+ */
967
+ unused: string[];
968
+ /**
969
+ * Allowed by the CMS but no theme rule matches it, whether or not this
970
+ * venue happens to draw it. The SDK's total blind spot — an author can
971
+ * legitimately draw any of these and get nothing.
972
+ */
973
+ allowedNotStyled: string[];
974
+ };
209
975
 
210
976
  type LoggerFn = (...args: unknown[]) => void;
211
977
  type AmenityManagerDeps = {
@@ -224,71 +990,1896 @@ declare class AmenityManager {
224
990
  private log;
225
991
  private loadForFloor;
226
992
  getAll(): AmenityWithFloor[];
993
+ /**
994
+ * Venue-wide amenities, one entry per id. `getAll()` returns each amenity
995
+ * once per floor it appears on (and so renders a multi-floor "Bathroom"
996
+ * three times in a venue list); this collapses those into a single record
997
+ * with all its waypoints merged across floors.
998
+ *
999
+ * Also folds any duplicate-id records from the provider into a single entry
1000
+ * so React lists don't trip on dup keys. This used to say those duplicates
1001
+ * were "a CMS data bug" — they weren't. JACS returns one record per amenity;
1002
+ * the SDK's own floor index pushed it once per waypoint, so an amenity with
1003
+ * four placements on a floor came back four times. Fixed at the source in
1004
+ * `jacsDataProvider.floorIdsForWaypoints`; the fold stays as a cheap guard
1005
+ * for a provider that genuinely repeats an id.
1006
+ *
1007
+ * Use this for venue-wide browse UIs; pair it with `findClosestWaypoint`
1008
+ * (on the SDK) to resolve a tap to the nearest physical instance.
1009
+ */
1010
+ getDistinct(): Amenity[];
227
1011
  getByFloorId(floorId: Floor['id']): AmenityWithFloor[];
228
1012
  getAllKiosks(): AmenityWithFloor[];
229
1013
  getKioskForFloor(floorId: Floor['id']): AmenityWithFloor | null;
230
1014
  logKioskForFloor(floorId: Floor['id']): void;
231
1015
  }
232
1016
 
1017
+ /**
1018
+ * The `mm_`-prefixed extensor keys the CMS reserves for fields JACS has no
1019
+ * column for yet.
1020
+ *
1021
+ * This file is the read half of a cross-repo table: the write half is
1022
+ * `cms/packages/map-manager/app/utils/reserved-extensors.js`, which owns the key
1023
+ * names, the value encodings, and the rule that a default value is deleted
1024
+ * rather than stored. Change them together.
1025
+ *
1026
+ * The `mm_` prefix is load-bearing on both sides. Authors can type anything into
1027
+ * the CMS's free-form Properties editor, so an unprefixed key like
1028
+ * `point_of_interest` could collide with a hand-entered one; the prefix also
1029
+ * makes "is this key reserved?" a prefix scan rather than a hand-maintained list
1030
+ * once JACS grows real columns and these are migrated away.
1031
+ *
1032
+ * Two things that look like they belong here and don't:
1033
+ *
1034
+ * - **Room number.** The CMS labels it "Room Number", but it writes the real
1035
+ * `Destination.unitNumber` field, not an extensor. `getPOIDetails().roomNumber`
1036
+ * reads that field (see `sdk.ts`).
1037
+ * - **`mm_point_of_interest`.** Registered by the CMS and parsed here for
1038
+ * completeness, but deliberately not surfaced on `getPOIDetails` — nothing has
1039
+ * pinned down whether an unflagged destination should drop out of search, out
1040
+ * of the map, or neither, and guessing wrong is worse than omitting it.
1041
+ */
1042
+ declare const RESERVED_EXTENSOR_PREFIX = "mm_";
1043
+ /** Weekly opening hours. Value shape and parser live in `openHours.ts`. */
1044
+ declare const OPEN_HOURS_EXTENSOR_KEY = "mm_open_hours";
1045
+ /** Phone number, with the extension folded into the same value. */
1046
+ declare const PHONE_EXTENSOR_KEY = "mm_phone";
1047
+ /** Alt text for the destination's uploaded Location Image. */
1048
+ declare const IMAGE_ALT_EXTENSOR_KEY = "mm_image_alt";
1049
+ /** Author-set "this is a point of interest" flag. Parsed, not surfaced. */
1050
+ declare const POINT_OF_INTEREST_EXTENSOR_KEY = "mm_point_of_interest";
1051
+ /**
1052
+ * Which building on the campus the destination stands in.
1053
+ *
1054
+ * The venue's own `Building` record can't answer this: the CMS binds a venue to
1055
+ * a single building and hangs the floor list off it, so a campus with a dozen
1056
+ * numbered buildings has one `Building` and no way to say which one a room is
1057
+ * in. The author types it as free text, and that text is what a kiosk prints —
1058
+ * it is not a reference to anything, so don't try to resolve it against
1059
+ * `venue.buildings`.
1060
+ */
1061
+ declare const BUILDING_NAME_EXTENSOR_KEY = "mm_building_name";
1062
+ interface DestinationPhone {
1063
+ /** Exactly as the author typed it — `"(408) 300-9294"`. Deliberately not
1064
+ * normalised: doing that properly across international formats needs a real
1065
+ * phone library, and the CMS makes the same choice on the way in. */
1066
+ number: string;
1067
+ /** Internal extension digits, when there is one. */
1068
+ ext?: string;
1069
+ }
1070
+ /**
1071
+ * `"(408) 300-9294;ext=123"` → `{ number, ext }`. `null` when there's no number
1072
+ * — including for the empty string, which is how JACS spells a deleted key.
1073
+ */
1074
+ declare function parsePhone(raw: unknown): DestinationPhone | null;
1075
+ /** Alt text for the Location Image, or `undefined` when the author set none. */
1076
+ declare function parseImageAlt(raw: unknown): string | undefined;
1077
+ /** The building name, or `undefined` when the author set none. */
1078
+ declare function parseBuildingName(raw: unknown): string | undefined;
1079
+ /** The point-of-interest flag. Absence means false — only the checked state is
1080
+ * ever stored. */
1081
+ declare function parsePointOfInterest(raw: unknown): boolean;
1082
+
1083
+ /**
1084
+ * Weekly opening hours for a destination.
1085
+ *
1086
+ * JACS has no hours column, so the CMS ships the whole week in a single
1087
+ * destination extensor — key `mm_open_hours`, value a JSON string:
1088
+ *
1089
+ * {"v":1,"days":{"mon":[["09:00","17:30"]],"sat":[],"sun":[["00:00","24:00"]]}}
1090
+ *
1091
+ * - Times are 24-hour `"HH:MM"` and **venue-local**; no timezone is recorded.
1092
+ * - Each day maps to an array of `[open, close]` ranges. The editor exposes one
1093
+ * range per day today, but the array shape leaves room for split shifts (a
1094
+ * cafeteria that closes over the afternoon) and extra ranges round-trip.
1095
+ * - An empty array — or a missing day — means closed.
1096
+ * - `[["00:00","24:00"]]` means open 24 hours.
1097
+ *
1098
+ * This module owns the read half: parse the value (`parseOpenHours`) and derive
1099
+ * the live open/closed state from it (`getOpenStatus`). The write half lives in
1100
+ * the CMS (`map-manager`'s `utils/open-hours.js`) — the two must agree on the
1101
+ * wire shape above, so change them together. The key itself is registered in
1102
+ * `reservedExtensors.ts` alongside the CMS's other stand-in fields, mirroring
1103
+ * the same split on the authoring side.
1104
+ */
1105
+
1106
+ /** Wire-format version this module understands. */
1107
+ declare const OPEN_HOURS_VERSION = 1;
1108
+ type DayKey = 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat' | 'sun';
1109
+ /** Monday-first, matching the wire format's own day order. `getOpenStatus`
1110
+ * reports `OpenHoursTransition.day` as one of these. */
1111
+ declare const DAY_KEYS: readonly DayKey[];
1112
+ /** One open→close stretch within a single day. 24-hour `"HH:MM"`, venue-local.
1113
+ * `close` may be `"24:00"` (end of day); `open` never is. */
1114
+ interface HoursRange {
1115
+ open: string;
1116
+ close: string;
1117
+ }
1118
+ /** A parsed week. Every day is present; a closed day is an empty array. */
1119
+ interface OpenHours {
1120
+ days: Record<DayKey, HoursRange[]>;
1121
+ /** Open every minute of the week (a 24/7 emergency department, say). The
1122
+ * status has no `closesAt` in this case — there is nothing to count down to. */
1123
+ alwaysOpen: boolean;
1124
+ }
1125
+ /** A point in the week the status is counting toward. */
1126
+ interface OpenHoursTransition {
1127
+ /** Day the transition falls on, venue-local. */
1128
+ day: DayKey;
1129
+ /** 24-hour `"HH:MM"`, venue-local. Midnight is always `"00:00"` on the
1130
+ * following day — `"24:00"` never surfaces here. */
1131
+ time: string;
1132
+ /** Whole minutes from `now`. */
1133
+ minutesUntil: number;
1134
+ /** Calendar days ahead: `0` today, `1` tomorrow. */
1135
+ daysAhead: number;
1136
+ }
1137
+ interface OpenStatus {
1138
+ /** Open right now. */
1139
+ open: boolean;
1140
+ /** Open every minute of the week — no closing time to show. */
1141
+ alwaysOpen: boolean;
1142
+ /** Open, and closing within `soonMinutes`. */
1143
+ closingSoon: boolean;
1144
+ /** Closed, and opening within `soonMinutes`. */
1145
+ openingSoon: boolean;
1146
+ /** When open: the end of the current stretch. Absent when `alwaysOpen`. */
1147
+ closesAt?: OpenHoursTransition;
1148
+ /** When closed: the next time it opens. Absent when no day is open. */
1149
+ opensAt?: OpenHoursTransition;
1150
+ }
1151
+ interface OpenStatusOptions {
1152
+ /** How near a transition counts as "soon". Default `30`. */
1153
+ soonMinutes?: number;
1154
+ /** IANA zone the hours are expressed in (`'America/Denver'`). Omit — the
1155
+ * normal case for a kiosk standing in the venue — to read the host clock.
1156
+ * An unrecognised zone falls back to the host clock rather than throwing. */
1157
+ timeZone?: string;
1158
+ }
1159
+ /**
1160
+ * Extensor value → a parsed week, or `null` when there is nothing usable.
1161
+ *
1162
+ * Accepts the stored JSON string or an already-parsed object. Anything
1163
+ * unreadable — absent key, malformed JSON, no open day — is `null` rather than
1164
+ * a throw, so a bad value costs the consumer an omitted section, not a crash.
1165
+ *
1166
+ * An unknown `v` is also `null`, deliberately. A future version could add
1167
+ * holiday overrides or a timezone; reading only the `days` it recognises would
1168
+ * let the SDK announce "Open" on a day the venue marked closed, and a confidently
1169
+ * wrong answer at a kiosk is worse than a missing one.
1170
+ */
1171
+ declare function parseOpenHours(raw: unknown): OpenHours | null;
1172
+ /**
1173
+ * The weekday `now` falls on in `timeZone` (host clock when omitted or
1174
+ * unrecognised) — the same day `getOpenStatus` evaluates against. Exported so
1175
+ * a week table can highlight "today" without disagreeing with the status line
1176
+ * around the venue's midnight.
1177
+ */
1178
+ declare function dayKeyAt(now: Date, timeZone?: string): DayKey;
1179
+ /**
1180
+ * A short label for `timeZone` (host zone when omitted or unrecognised) — the
1181
+ * zone `getOpenStatus` reads hours against — so a UI can say "Opens 9:00 AM ET".
1182
+ *
1183
+ * US zones get the generic form (`ET`, `CT`, `MT`, `PT`, `AKT`), which doesn't
1184
+ * flip with daylight saving. Elsewhere the engine has no generic abbreviation
1185
+ * (it would spell out "Germany Time"), so this falls back to the specific short
1186
+ * name, which may be an offset (`GMT+2`). `now` only matters for that fallback
1187
+ * and for zones like Phoenix that print `MST` year-round.
1188
+ */
1189
+ declare function timeZoneAbbreviation(now?: Date, timeZone?: string): string;
1190
+ /**
1191
+ * The live open/closed state for a parsed week.
1192
+ *
1193
+ * Pure and time-explicit: pass the `now` you want evaluated (default: the
1194
+ * moment of the call). Nothing is cached, so a consumer that wants a status
1195
+ * that stays true — a kiosk card sitting open — re-calls this on a tick rather
1196
+ * than holding the result.
1197
+ *
1198
+ * Hours carry no timezone of their own, so they are read against the host clock
1199
+ * unless `options.timeZone` names the venue's zone. The kiosk case needs no
1200
+ * option: the machine stands in the building it is describing. A web consumer
1201
+ * whose visitors may be elsewhere should resolve the venue's zone (e.g. from
1202
+ * `MinuteMaps.getVenueCenter()`) and pass it.
1203
+ */
1204
+ declare function getOpenStatus(hours: OpenHours, now?: Date, options?: OpenStatusOptions): OpenStatus;
1205
+
1206
+ /** One floor of the active route, drawn on its own for a printout. */
1207
+ type RouteFloorImage = {
1208
+ floor: Floor;
1209
+ /** The bare map canvas (no DOM chrome), as a `data:` URL. */
1210
+ dataUrl: string;
1211
+ };
1212
+ type RouteImageOptions = {
1213
+ /** CSS-pixel size the map is laid out at while capturing. Default 1200×800. */
1214
+ width?: number;
1215
+ height?: number;
1216
+ /** Canvas pixels per CSS pixel. Default 2, crisp enough for paper. */
1217
+ pixelRatio?: number;
1218
+ /** Padding around each floor's route segment, in CSS px. Default 40. */
1219
+ padding?: number;
1220
+ /** Draw in flat (2D) mode, which reads better on paper. The previous mode
1221
+ * is put back afterwards. Default `true`. */
1222
+ flat?: boolean;
1223
+ /** Image MIME type passed to `toDataURL`. Default `'image/png'`. */
1224
+ type?: string;
1225
+ /** Encoder quality for lossy types (`'image/jpeg'`, `'image/webp'`). */
1226
+ quality?: number;
1227
+ };
1228
+
1229
+ type JacsProviderConfig = {
1230
+ mode: 'proxy';
1231
+ proxyBaseUrl?: string;
1232
+ fetchImpl?: typeof fetch;
1233
+ } | {
1234
+ mode: 'direct';
1235
+ host: string;
1236
+ clientId: string;
1237
+ username: string;
1238
+ password: string;
1239
+ fetchImpl?: typeof fetch;
1240
+ };
1241
+ type GetBuildingsArgs = {
1242
+ customerId: number | string;
1243
+ venueId: number | string;
1244
+ };
1245
+ type GetFloorsArgs = {
1246
+ customerId: number | string;
1247
+ venueId: number | string;
1248
+ buildingId: number | string;
1249
+ /** BCP-47 code (`es`, `en-US`). When set, JACS resolves floor `name` /
1250
+ * `description` to that locale instead of the customer's default. */
1251
+ locale?: string;
1252
+ };
1253
+ type GetDestinationsArgs = {
1254
+ customerId: number | string;
1255
+ venueId: number | string;
1256
+ /** See {@link GetFloorsArgs.locale}. */
1257
+ locale?: string;
1258
+ };
1259
+ type GetAmenitiesArgs = {
1260
+ customerId: number | string;
1261
+ /** See {@link GetFloorsArgs.locale}. */
1262
+ locale?: string;
1263
+ };
1264
+ type GetZonesArgs = {
1265
+ customerId: number | string;
1266
+ venueId: number | string;
1267
+ /** See {@link GetFloorsArgs.locale}. */
1268
+ locale?: string;
1269
+ };
1270
+ type GetMapLabelsArgs = {
1271
+ customerId: number | string;
1272
+ venueId: number | string;
1273
+ /** See {@link GetFloorsArgs.locale}. */
1274
+ locale?: string;
1275
+ };
1276
+ type GetVenueArgs = {
1277
+ customerId: number | string;
1278
+ venueId: number | string;
1279
+ };
1280
+ type JacsVenue = Record<string, any>;
1281
+ type GetBuildingFullArgs = {
1282
+ customerId: number | string;
1283
+ venueId: number | string;
1284
+ buildingId: number | string;
1285
+ mapProfile?: string;
1286
+ geojson?: boolean;
1287
+ };
1288
+ type JacsBuildingFull = Record<string, any>;
1289
+ type JacsVenueAll = Record<string, any>;
1290
+ type GetStylesheet3dArgs = {
1291
+ customerId: number | string;
1292
+ venueId: number | string;
1293
+ buildingId: number | string;
1294
+ };
1295
+ type GetFloorMapGeoJsonArgs = {
1296
+ customerId: number | string;
1297
+ venueId: number | string;
1298
+ buildingId: number | string;
1299
+ floorId: number | string;
1300
+ };
1301
+ type GetPolygonLayersArgs = {
1302
+ customerId: number | string;
1303
+ };
1304
+ type GetFloorMapTemplate3dArgs = {
1305
+ customerId: number | string;
1306
+ venueId: number | string;
1307
+ buildingId: number | string;
1308
+ floorId: number | string;
1309
+ };
1310
+ type JacsBuilding = {
1311
+ id?: number | string;
1312
+ buildingId?: number | string;
1313
+ name?: string;
1314
+ isDefault?: boolean;
1315
+ default?: boolean;
1316
+ [key: string]: any;
1317
+ };
1318
+ type JacsFloor = Record<string, any>;
1319
+ type JacsDestination = Record<string, any>;
1320
+ type JacsAmenity = Record<string, any>;
1321
+ type JacsZone = Record<string, any>;
1322
+ type JacsMapLabel = Record<string, any>;
1323
+ type JacsPolygonLayer = Record<string, any>;
1324
+ /**
1325
+ * This matches the “map-template/3d” shape you pasted earlier:
1326
+ * rows keyed by layerName with paint-ish properties like fill, line-color, etc.
1327
+ */
1328
+ type JacsMapTemplate3dRow = {
1329
+ layerName: string;
1330
+ fill?: string | null;
1331
+ 'fill-opacity'?: number | null;
1332
+ fillAntialias?: boolean | null;
1333
+ 'fill-pattern'?: string | null;
1334
+ 'line-color'?: string | null;
1335
+ 'line-width'?: number | null;
1336
+ lineOpacity?: number | null;
1337
+ strokeWidth?: number | null;
1338
+ strokeOpacity?: number | null;
1339
+ 'fill-extrusion-color'?: string | null;
1340
+ 'fill-extrusion-height'?: number | null;
1341
+ 'fill-extrusion-opacity'?: number | null;
1342
+ 'fill-extrusion-base'?: number | null;
1343
+ 'fill-extrusion-pattern'?: string | null;
1344
+ [key: string]: any;
1345
+ };
1346
+ declare class JacsProvider {
1347
+ private mode;
1348
+ private proxyBaseUrl;
1349
+ private direct;
1350
+ private fetchImpl;
1351
+ private tokenCache;
1352
+ constructor(config: JacsProviderConfig);
1353
+ /** `/customer/all` — every customer with its venues, for a venue picker. Each
1354
+ * entry is `{ customer, venues[] }`. Not venue-scoped. */
1355
+ getCustomersAll(): Promise<Record<string, any>[]>;
1356
+ getPolygonLayers(args: GetPolygonLayersArgs): Promise<JacsPolygonLayer[]>;
1357
+ getFloorMapTemplate3d(args: GetFloorMapTemplate3dArgs): Promise<JacsMapTemplate3dRow[]>;
1358
+ getFloors(args: GetFloorsArgs): Promise<JacsFloor[]>;
1359
+ /**
1360
+ * Hits the JEM venue full-call aggregator at /customer/{cid}/venue/{vid}/all.
1361
+ * Unlike /building/{bid}/full this endpoint does NOT go through Redis — JACS
1362
+ * assembles the response server-side from many controllers on every call, so
1363
+ * SDK consumers always see fresh data regardless of cache invalidation state.
1364
+ *
1365
+ * Response shape: { customer, venue, buildings: [{ floors }], waypoints[],
1366
+ * destinations[], amenities[], paths[], mapLabels[], devices[], zones[],
1367
+ * pathTypes[], mapProfiles[] }. Floor geojson is NOT included — the SDK
1368
+ * lazy-loads it via ensureFloorGeojson.
1369
+ */
1370
+ getVenueAll(args: GetVenueArgs): Promise<JacsVenueAll>;
1371
+ getVenue(args: GetVenueArgs): Promise<JacsVenue>;
1372
+ getFloorMapGeojson(args: GetFloorMapGeoJsonArgs): Promise<GeoJSON.FeatureCollection>;
1373
+ getBuildingFull(args: GetBuildingFullArgs): Promise<JacsBuildingFull>;
1374
+ getDestinations(args: GetDestinationsArgs): Promise<JacsDestination[]>;
1375
+ /** Zones (department groupings). `name` / `description` are localized. */
1376
+ getZones(args: GetZonesArgs): Promise<JacsZone[]>;
1377
+ /**
1378
+ * CMS-authored map labels (street / area / wing names). The endpoint is
1379
+ * `/label`, not `/map-label` — the latter 404s. The localized `name` is on
1380
+ * the label template; each `instances[]` placement carries its own internal
1381
+ * `name` ("Parking Lot E - Instance 1") which is authoring metadata and is
1382
+ * never displayed.
1383
+ */
1384
+ getMapLabels(args: GetMapLabelsArgs): Promise<JacsMapLabel[]>;
1385
+ /**
1386
+ * Amenities are **customer-scoped**, not venue-scoped. A
1387
+ * `/customer/{id}/venue/{id}/amenity` path also exists and returns the same
1388
+ * records, but it silently ignores `?locale=` — it answers with the base
1389
+ * (en-US) names for every locale, which reads as "translations aren't
1390
+ * working" rather than as a wrong URL. Only `/customer/{id}/amenity`
1391
+ * resolves the locale. Don't reintroduce the venue segment.
1392
+ */
1393
+ getAmenities(args: GetAmenitiesArgs): Promise<JacsAmenity[]>;
1394
+ getBuildings(args: GetBuildingsArgs): Promise<JacsBuilding[]>;
1395
+ getStylesheet3d(args: GetStylesheet3dArgs): Promise<StyleSpecification>;
1396
+ invalidateToken(): void;
1397
+ getJson<T>(path: string): Promise<T>;
1398
+ private extractArray;
1399
+ private getJwtToken;
1400
+ private normalizeHost;
1401
+ private joinUrl;
1402
+ private safeReadText;
1403
+ }
1404
+
1405
+ /** The JacsProvider methods the SDK's data layer reads. Both JacsProvider (live
1406
+ * JACS) and SnapshotProvider (published snapshots) implement them. */
1407
+ type JacsReader = Pick<JacsProvider, 'getVenueAll' | 'getFloorMapGeojson' | 'getDestinations' | 'getFloors' | 'getZones' | 'getMapLabels' | 'getAmenities' | 'getPolygonLayers' | 'getCustomersAll'>;
1408
+ type SnapshotProviderConfig = {
1409
+ /** Root of the snapshot host, e.g. `https://snapshots.example.com`. */
1410
+ baseUrl: string;
1411
+ fetchImpl?: typeof fetch;
1412
+ };
1413
+ /** Highest manifest `schemaVersion` this SDK can read. */
1414
+ declare const SNAPSHOT_SCHEMA_VERSION = 1;
1415
+ /**
1416
+ * The venue (or its customer) can't be shown from snapshots: it was never
1417
+ * published, or it was withdrawn (unpublished, disabled or deleted). Thrown
1418
+ * from `init()`; check `reason` to show "not published" vs "no longer
1419
+ * available".
1420
+ */
1421
+ declare class SnapshotUnavailableError extends Error {
1422
+ readonly reason: 'not-published' | 'withdrawn';
1423
+ readonly customerId: string;
1424
+ readonly venueId: string | null;
1425
+ constructor(reason: 'not-published' | 'withdrawn', customerId: string, venueId: string | null);
1426
+ }
1427
+ /** The customer and venue snapshot versions a load is using. */
1428
+ type SnapshotVersions = {
1429
+ customer: number;
1430
+ venue: number;
1431
+ };
1432
+ /**
1433
+ * Result of `checkForUpdate`: whether what's published now differs from what
1434
+ * this instance loaded.
1435
+ *
1436
+ * - `current` — nothing newer is published.
1437
+ * - `available` — a newer customer or venue version is published; reload to
1438
+ * show it.
1439
+ * - `unavailable` — the venue (or its customer) has since been withdrawn or
1440
+ * was never published; a reload would fail with `SnapshotUnavailableError`.
1441
+ * - `incompatible` — a newer version is published in a schema this SDK can't
1442
+ * read; don't reload until the SDK is updated.
1443
+ */
1444
+ type SnapshotUpdateCheck = {
1445
+ status: 'current';
1446
+ loaded: SnapshotVersions;
1447
+ } | {
1448
+ status: 'available';
1449
+ loaded: SnapshotVersions;
1450
+ latest: SnapshotVersions;
1451
+ } | {
1452
+ status: 'unavailable';
1453
+ loaded: SnapshotVersions;
1454
+ reason: 'not-published' | 'withdrawn';
1455
+ } | {
1456
+ status: 'incompatible';
1457
+ loaded: SnapshotVersions;
1458
+ schemaVersion: number;
1459
+ };
1460
+ /**
1461
+ * Picks the locale folder to read. Exact (case-insensitive) match first, then a
1462
+ * same-language match (`es` → `es-US`), then `fallback` — so a locale the
1463
+ * customer added after this venue was last published falls back to the default
1464
+ * language until the venue is republished.
1465
+ */
1466
+ declare function resolveSnapshotLocale(requested: string | undefined, available: string[], fallback: string): string;
1467
+ declare class SnapshotProvider implements JacsReader {
1468
+ private baseUrl;
1469
+ private fetchImpl;
1470
+ private snapshots;
1471
+ private files;
1472
+ constructor(config: SnapshotProviderConfig);
1473
+ /** `directory.json` — published, public customers with their venues, in
1474
+ * `/customer/all`'s `{ customer, venues[] }` shape. */
1475
+ getCustomersAll(): Promise<Record<string, any>[]>;
1476
+ /** venue.json with the customer-wide pieces put back where `/all` has them. */
1477
+ getVenueAll(args: {
1478
+ customerId: number | string;
1479
+ venueId: number | string;
1480
+ }): Promise<JacsVenueAll>;
1481
+ getFloorMapGeojson(args: {
1482
+ customerId: number | string;
1483
+ venueId: number | string;
1484
+ floorId: number | string;
1485
+ }): Promise<GeoJSON.FeatureCollection>;
1486
+ getDestinations(args: {
1487
+ customerId: number | string;
1488
+ venueId: number | string;
1489
+ locale?: string;
1490
+ }): Promise<JacsDestination[]>;
1491
+ /** The snapshot holds the first building's floors only — the one the SDK reads. */
1492
+ getFloors(args: {
1493
+ customerId: number | string;
1494
+ venueId: number | string;
1495
+ locale?: string;
1496
+ }): Promise<JacsFloor[]>;
1497
+ getZones(args: {
1498
+ customerId: number | string;
1499
+ venueId: number | string;
1500
+ locale?: string;
1501
+ }): Promise<JacsZone[]>;
1502
+ getMapLabels(args: {
1503
+ customerId: number | string;
1504
+ venueId: number | string;
1505
+ locale?: string;
1506
+ }): Promise<JacsMapLabel[]>;
1507
+ getAmenities(args: {
1508
+ customerId: number | string;
1509
+ locale?: string;
1510
+ }): Promise<JacsAmenity[]>;
1511
+ getPolygonLayers(args: {
1512
+ customerId: number | string;
1513
+ }): Promise<JacsPolygonLayer[]>;
1514
+ /** The manifest versions this instance is reading, once loaded. */
1515
+ getVersions(customerId: number | string, venueId: number | string): Promise<{
1516
+ customer: number;
1517
+ venue: number;
1518
+ }>;
1519
+ /**
1520
+ * Re-reads both manifests (without changing what this instance reads) and
1521
+ * compares them with the versions it loaded. Rejects when a manifest can't
1522
+ * be fetched — a network failure says nothing about what's published, so
1523
+ * try again later.
1524
+ */
1525
+ checkForUpdate(customerId: number | string, venueId: number | string): Promise<SnapshotUpdateCheck>;
1526
+ private venueLocalized;
1527
+ private customerRef;
1528
+ private venueRef;
1529
+ /**
1530
+ * Runs `read` against the pinned snapshots. The publisher keeps old versions
1531
+ * for a while, but a long-running client (a kiosk) can outlive one: if a
1532
+ * pinned version's file is gone, re-read that manifest and retry once on the
1533
+ * current version. Data already loaded from the old version stays as it was;
1534
+ * files fetched from now on come from the new one.
1535
+ */
1536
+ private pinned;
1537
+ /** The current manifest, read once per instance: a loaded venue keeps
1538
+ * reading the version it started with (see `pinned` for when it can't). */
1539
+ private snapshot;
1540
+ /** Versioned files are immutable, so one fetch per file per instance. */
1541
+ private file;
1542
+ private list;
1543
+ private fetchJson;
1544
+ }
1545
+
1546
+ /** A built-in theme name, or `'custom'` when a raw style was passed. */
1547
+ type ActiveThemeName = ThemeName | 'custom';
233
1548
  declare class MinuteMaps {
234
1549
  private config;
235
1550
  private map;
1551
+ /**
1552
+ * Generation token for `init()`. Bumped by every `init()` and by `destroy()`,
1553
+ * so an init suspended on a network await can tell it has been superseded and
1554
+ * bail instead of creating a map nobody holds a reference to.
1555
+ *
1556
+ * This is what makes `destroy()` safe *during* init: `destroy()` only removes
1557
+ * `this.map`, which is still null until step 3, so a teardown that lands
1558
+ * mid-fetch has nothing to clean up — and without this token the init would
1559
+ * resume and build a fully live orphan (WebGL context, render loop, map-level
1560
+ * listeners, YAH pulse) that can never be reached to shut down. React
1561
+ * StrictMode's mount → unmount → mount does exactly this on every dev load.
1562
+ *
1563
+ * A counter, not a sticky `destroyed` flag: `destroy()` → `init()` re-init is
1564
+ * a supported lifecycle (see the manager-class note in CLAUDE.md), so the
1565
+ * instance has to stay usable after teardown.
1566
+ */
1567
+ private initGeneration;
236
1568
  private data;
237
1569
  private wayfindingProvider;
238
1570
  private events;
239
1571
  private floorsApi;
240
1572
  private venue;
241
1573
  private spriteKeys;
242
- private readonly debug;
1574
+ private readonly debugEnabled;
243
1575
  private readonly logger;
1576
+ /**
1577
+ * Console-facing layer inspector — `sdk.debug.hide('labels')`,
1578
+ * `sdk.debug.solo('route')`, `sdk.debug.reset()`. Always present so demo
1579
+ * code can drive it; additionally reachable as `window.mm.debug` when
1580
+ * `options.debug` is on. See `DebugLayers`.
1581
+ */
1582
+ readonly debug: DebugLayers;
1583
+ /** The `window` key `debug` mode installed this instance under, if any. */
1584
+ private debugGlobalKey;
244
1585
  private defaultCamera;
1586
+ /** This venue's opening zoom, captured once after the initial fit resolves.
1587
+ * Anchors the pinned zoom profile's icon/label reveal thresholds (idle
1588
+ * spotlight, active route) to this venue's own opening view rather than an
1589
+ * absolute MapLibre zoom, and the roof fill's fade-in. See `zoomViews`. */
1590
+ private iconZoomBase;
1591
+ /** The current floor's building-label points, as written to
1592
+ * `MAP_LABELS_SOURCE_ID` — what a building-label tap hit-tests against. */
1593
+ private buildingLabelPoints;
1594
+ /** Which layers show at which zoom: the Campus / Building / Kiosk views, or
1595
+ * the pinned profile while the idle spotlight or a route is up. Re-applied
1596
+ * after every `setTheme()` swap, since `setStyle({ diff: false })`
1597
+ * recreates layers from the pristine theme. */
1598
+ private zoomViews;
245
1599
  private viewModes;
1600
+ /** Mirror of `config.options.reducedMotion`, mutable via `setReducedMotion`. */
1601
+ private reducedMotion;
1602
+ /** Whether map labels render in OpenDyslexic, mutable via `setDyslexicFont`.
1603
+ * Re-applied after every `setTheme()` swap, same reason as `iconZoomBase`. */
1604
+ private dyslexicFont;
1605
+ /** Multiplier applied to every theme label's `text-size`, mutable via
1606
+ * `setTextScale`. Re-applied after every `setTheme()` swap. */
1607
+ private textScale;
1608
+ /** Each label layer's unscaled `text-size` and em offsets, captured by
1609
+ * `setTextScale` and keyed `"<layer id>|<property>"`. Cleared on
1610
+ * `setTheme()` — the recreated layers carry new base values. */
1611
+ private baseTextSizes;
1612
+ /** Tracks the active theme name so `setTheme()` is a no-op when re-requested. */
1613
+ private activeThemeName;
1614
+ /** Tracks the active locale so `setLocale()` is a no-op when re-requested.
1615
+ * Seeded from `config.jmap.locale` at construction; `undefined` means
1616
+ * whatever the customer's default locale is on the JACS side. */
1617
+ private currentLocale;
1618
+ /** The destination of the last successfully computed route — kept so
1619
+ * `setLocale()` can rebuild + re-emit `routeReady` with retranslated
1620
+ * step text without recomputing the path. Cleared on route failure. */
1621
+ private lastRouteDestination;
1622
+ /** `setLocationPicking` is on: a tap snaps to a path and emits
1623
+ * `locationPicked` instead of selecting what's under it. */
1624
+ private locationPicking;
1625
+ /** The active route's two ends, for redrawing its approaches after a
1626
+ * location-pick preview borrowed their source. */
1627
+ private routeApproachEnds;
1628
+ /** The running "moved to the nearest path" animation frame, if any. */
1629
+ private pickAnimationFrame;
1630
+ /** Waypoint ids (stringified) of the connector(s) the active transition
1631
+ * step rides — empty unless `setActiveStep` is on a transition. Drives
1632
+ * `applyRouteConnectorHighlight`. */
1633
+ private activeTransitionWaypointIds;
1634
+ /** Set while `captureRouteFloorImages` runs; holds the bounds padding to
1635
+ * put back afterwards (updated by any `setBoundsPadding` in between). */
1636
+ private routeCapture;
246
1637
  private amenityManager;
247
1638
  private wayfinding;
1639
+ private highlightManager;
1640
+ private selectionManager;
1641
+ private restroomGroups;
1642
+ /** Captured unit paint values to restore when the selection clears, or
1643
+ * `null` when no room is currently focused. See `UNIT_DIM_TARGETS`. */
1644
+ private unitDimRestore;
1645
+ /** Captured destination-layer filters to restore when the selection clears,
1646
+ * or `null` when no destination focus is active. See `setDestinationFocus`. */
1647
+ private destFocusRestore;
1648
+ /** The allow-list currently narrowing the destination layers, or `null` when
1649
+ * no focus is active. Kept alongside `destFocusRestore` (which holds the
1650
+ * *previous* filters, not the ids) so `setTheme` can re-apply the same focus
1651
+ * to the new style's layers after a swap discards the old ones. */
1652
+ private destFocusIds;
1653
+ /** The predicate currently narrowing the POI marker layers to a curated set,
1654
+ * or `null` when no spotlight is active. See `setPOISpotlight`. Held as the
1655
+ * predicate, not a resolved id list, so a floor change or locale redraw can
1656
+ * re-resolve it against the POIs now on screen. */
1657
+ private poiSpotlight;
1658
+ /** Layer filters as they were before the spotlight narrowed them, put back
1659
+ * verbatim when it releases. `null` when no spotlight filter is applied. */
1660
+ private poiSpotlightRestore;
1661
+ /** Coordinates of the current tap/Info selection, or `null` when nothing is
1662
+ * selected. `easeToSelection` reads `getBoundsPadding()` at the moment a
1663
+ * selection is made, which is often *before* the consumer's info card has
1664
+ * mounted and been measured into that padding — so the first pan can land
1665
+ * the POI behind the card. Kept here so `setBoundsPadding` can re-nudge the
1666
+ * camera once the consumer measures its now-mounted chrome and reports
1667
+ * fresh insets, the same way it already re-fits an active route. Cleared by
1668
+ * `clearHighlight`. */
1669
+ private selectedCoordinates;
1670
+ /** Zoom floor for the current selection's camera move, or `null` to keep
1671
+ * the current zoom. Set by `selectPOI` and map taps (`selectionZoom()` — a
1672
+ * pick can arrive from the Campus or Building view, where the selected
1673
+ * marker isn't drawn); kept beside
1674
+ * `selectedCoordinates` so a `setBoundsPadding` re-nudge carries the same
1675
+ * zoom instead of cancelling the zoom-in halfway. Cleared with it. */
1676
+ private selectedMinZoom;
1677
+ private youAreHerePulse;
1678
+ /** Theme layers whose features represent a tappable destination/amenity.
1679
+ * A click hit-tests these (see `SelectionManager`) → `poiSelected`. The
1680
+ * "You are here" anchor and the transient highlight layers are excluded;
1681
+ * a POI drawn across the circle/label/icon layers is de-duped downstream
1682
+ * in `resolveClickedPOIs`. */
1683
+ private static readonly CLICKABLE_POI_LAYERS;
1684
+ /** Room-body layers that are also tappable: a click on a `Units` polygon
1685
+ * resolves to the destination pin inside it (see `resolvePOIsFromFeatures`).
1686
+ * Queried alongside the pin layers so tapping the room or its dot behaves
1687
+ * identically. Kept separate from the pin list because these carry no POI
1688
+ * identity of their own — they resolve spatially. */
1689
+ private static readonly CLICKABLE_UNIT_LAYERS;
1690
+ /** The kiosk's own "you are here" pin — icon, directional heading wedge,
1691
+ * and the ring drawn behind them. Deliberately **not** part of
1692
+ * `CLICKABLE_POI_LAYERS`: that list feeds `emitPoiSelected`, which opens
1693
+ * a selection card for a destination/amenity, and this pin isn't one —
1694
+ * it's where the kiosk itself is standing. A tap here means "where am
1695
+ * I", so it gets its own delegated listener emitting `youAreHereClicked`
1696
+ * instead, for a consumer to wire to the same recenter action as its
1697
+ * own recenter control. */
1698
+ private static readonly YOU_ARE_HERE_LAYERS;
1699
+ /** While a room is selected, the other units are recolored to a flat, muted
1700
+ * gray so the raised, full-strength highlight block reads as the focus. We
1701
+ * recolor rather than lower opacity on purpose: translucent extrusions blend
1702
+ * through their neighbours and look murky. The blocks stay fully opaque (and
1703
+ * keep their vertical-gradient shading, so they still read as rooms) — just
1704
+ * colorless. The selected room's own base grays too, but its highlight cap
1705
+ * sits opaque and taller on top, so it still stands out. The original paint
1706
+ * value (the data-driven color expression) is captured at mute time and put
1707
+ * back on `clearHighlight`, so department tinting returns intact. */
1708
+ private static readonly UNIT_DIM_TARGETS;
1709
+ /** Destination marker layers hidden down to just the selected destination
1710
+ * while a room is focused, so the map declutters to the one place in view.
1711
+ * Amenity/connector layers (`poiType: 'amenity'`), the "you are here" anchor,
1712
+ * and room name labels (`map-labels`) are deliberately absent — they stay
1713
+ * visible as wayfinding reference. Restored on `clearHighlight`. */
1714
+ private static readonly DESTINATION_FOCUS_LAYERS;
1715
+ /** Categorical POI layers in the bundled theme that `setPOIFilter`
1716
+ * toggles. Layers absent from this list — `poi-you-are-here-*` and the
1717
+ * `poi-highlight-*` layers — are intentionally unaffected; they're
1718
+ * anchors or transient focus state, not categorical content. */
1719
+ private static readonly POI_CATEGORY_LAYERS;
1720
+ /** Marker layers `setPOISpotlight` narrows. Every categorical POI layer
1721
+ * except `poi-other-amenity-icons`, whose filter the restroom-group manager
1722
+ * and the zoom-range pass rewrite as the camera moves — a spotlight
1723
+ * narrowing would be silently overwritten mid-orbit — plus the per-instance
1724
+ * amenity label, which is a marker in every sense but isn't a category. */
1725
+ private static readonly POI_SPOTLIGHT_LAYERS;
1726
+ private poiVisibleTypes;
1727
+ /** Independent show/hide state for destination dots and name labels, set
1728
+ * by `setDestinationCirclesVisible`/`setDestinationLabelsVisible`. Kept
1729
+ * separate from `poiVisibleTypes` so the two controls compose instead of
1730
+ * clobbering each other — `applyPOIFilter` and `applyDestinationDisplay`
1731
+ * each own one paint/layout axis of the same layers. */
1732
+ private destinationCirclesVisible;
1733
+ private destinationLabelsVisible;
248
1734
  constructor(config: SDKConfig);
249
1735
  init(): Promise<void>;
1736
+ /**
1737
+ * Supply an image the current style has requested but doesn't have.
1738
+ *
1739
+ * Every imperatively-registered image is served from here, because a theme
1740
+ * swap (`setStyle` with `diff: false`) drops all of them and the code that
1741
+ * registered them doesn't run again:
1742
+ *
1743
+ * - the **route arrow** isn't in the sprite sheet at all — it's canvas-drawn
1744
+ * on demand (this was already the case);
1745
+ * - **amenity / destination icons** come back from `iconCache`. Their
1746
+ * registrars run only during `init`, so before this they went missing on
1747
+ * the first theme swap and never returned — the map kept the dots and
1748
+ * labels but lost every badge and logo.
1749
+ *
1750
+ * Serving lazily (rather than re-registering everything on `style.load`)
1751
+ * means only the ids the new style actually asks for are restored, with no
1752
+ * refetch and no re-compositing.
1753
+ */
1754
+ private serveMissingStyleImage;
250
1755
  on(event: string, cb: (e: MapEvent) => void): void;
251
1756
  off(event: string, cb?: (e: MapEvent) => void): void;
252
1757
  addControl(control: IControl, position?: ControlPosition): void;
253
1758
  setView(options: ViewOptions): void;
1759
+ /**
1760
+ * Force a camera move to land instantly while reduced motion is on.
1761
+ *
1762
+ * The single gate every consumer-driven move goes through — zoom
1763
+ * buttons, compass reset, go-home, recenter, route fits — so the one
1764
+ * toggle covers them all instead of each call site remembering to ask.
1765
+ * Returns `opts` untouched when the preference is off, so a caller that
1766
+ * asked for `animate: false` keeps it either way.
1767
+ */
1768
+ private motionGated;
254
1769
  get amenities(): AmenityManager;
255
1770
  resetView(opts?: {
256
1771
  animate?: boolean;
257
1772
  duration?: number;
258
1773
  }): void;
1774
+ /** Whether the "You are here" pin, its name or its ring is drawn under
1775
+ * `point` — the same box the `youAreHereClicked` handler queries, so a tap
1776
+ * that recenters never also selects the room or pins beneath the pin.
1777
+ * Synchronous, and `false` if the query throws: `poi-data` doesn't show the
1778
+ * persistent failure `map/symbolHitTest.ts` works around, only the
1779
+ * one-frame one, and a dropped claim then just lets the tap select. */
1780
+ private isYouAreHereAt;
1781
+ /** The venue marker or building label drawn under `point`, as the point to
1782
+ * zoom in on, or `null`. */
1783
+ private zoomTapTargetAt;
1784
+ /** A venue marker or building label tap: zoom in on that symbol to the Kiosk view,
1785
+ * centered in the area the chrome leaves free (`boundsPadding`). Keeps the
1786
+ * current pitch and bearing. */
1787
+ private zoomToKioskView;
1788
+ /**
1789
+ * Content-aware re-frame: fit an active route if one is displayed,
1790
+ * otherwise fit the current floor's geojson. Unlike `resetView()`, this
1791
+ * preserves the user's pitch and bearing — it only adjusts center/zoom
1792
+ * to bring the scene back into view. Intended use is after the map
1793
+ * container resizes (e.g. a side drawer opens beside the map and the
1794
+ * pane gets narrower), so what matters stays framed without a yank.
1795
+ */
1796
+ refit(opts?: {
1797
+ animate?: boolean;
1798
+ duration?: number;
1799
+ }): void;
1800
+ /**
1801
+ * Update the bounds padding (camera insets) used by route + floor fits.
1802
+ * Consumers measure their on-screen chrome (panels, rails) and pass the
1803
+ * insets so a fit frames the path in the visible, unobscured area rather
1804
+ * than under the UI. Stored; the next fit / `refit()` uses it (clamped so
1805
+ * a fit always lands — see `clampPadding`). While the camera still sits on
1806
+ * the opening view, that view is re-framed with the new insets too (and
1807
+ * becomes `resetView()`'s target) — the opening fit runs before a consumer
1808
+ * can measure chrome that only mounts once the map is ready.
1809
+ */
1810
+ setBoundsPadding(p: BoundsPadding): void;
1811
+ /** Whether the camera is still exactly on the opening view — no pan, zoom,
1812
+ * tilt or rotate since init (or since the last re-frame). */
1813
+ private isAtOpeningView;
1814
+ /** Redo the opening fit (the current floor's footprint, or the venue's
1815
+ * bounds without floor geometry) with the current bounds padding, then the
1816
+ * opening framing policy, and make the result the new `resetView()` target.
1817
+ * Z0 (`iconZoomBase`) is left as captured at init. */
1818
+ private reframeOpeningView;
1819
+ private fitToBounds;
259
1820
  set3dEnabled(enabled: boolean): void;
260
1821
  toggle3d(): void;
261
1822
  getIs3dEnabled(): boolean;
1823
+ /**
1824
+ * (Re-)register per-amenity icons, per-destination logos, and the kiosk
1825
+ * "you are here" icon. Needed both at init and after every `setTheme()`
1826
+ * call — `map.setStyle(..., { diff: false })` tears down and recreates
1827
+ * the whole `Style` object, which drops every image added at runtime via
1828
+ * `map.addImage`. Only `route-arrow` re-registers itself lazily via
1829
+ * `styleimagemissing`; everything else must be re-run explicitly here or
1830
+ * it silently goes blank after a theme swap.
1831
+ *
1832
+ * `themeName === 'high-contrast'` recolors both the amenity badge disc
1833
+ * and the connector (elevator/stairs/escalator) badge disc to
1834
+ * `HIGH_CONTRAST_AMENITY_BADGE_COLOR`, and forces both the regular and
1835
+ * connector glyph to `HIGH_CONTRAST_AMENITY_ICON_COLOR` so neither
1836
+ * washes out against its now-yellow disc and the two match each other.
1837
+ * Ring colors are left untouched. Failures per icon set are logged and
1838
+ * skipped so one bad icon doesn't block the rest.
1839
+ */
1840
+ private registerRuntimeIcons;
1841
+ /**
1842
+ * Set the active map theme by name (`'default'` / `'high-contrast'` /
1843
+ * `'color-blind'`) or by
1844
+ * passing a custom `StyleSpecification`. The current floor, route, POIs
1845
+ * and camera are preserved across the swap — only layer styling changes.
1846
+ *
1847
+ * Used by kiosk consumers to wire the OS-level / popover high-contrast
1848
+ * toggle to the map. See `KIOSK.md` for the pattern.
1849
+ *
1850
+ * Switching between the two built-in themes happens in place (paint
1851
+ * properties plus the sprite — see `swapBuiltinThemeInPlace`); a custom style,
1852
+ * or leaving one, rebuilds the style with `setStyle`. Calls run one at a time
1853
+ * in the order made, so a quick double toggle can't interleave two swaps.
1854
+ */
1855
+ setTheme(theme: ThemeName | StyleSpecification): Promise<void>;
1856
+ /** Tail of the `setTheme` queue. */
1857
+ private themeQueue;
1858
+ private applyTheme;
1859
+ /**
1860
+ * Switch between built-in themes without `setStyle`. They share every layer
1861
+ * and differ only in paint and sprite (high contrast and color-blind are
1862
+ * derived from hybrid — see `themes/`), so this rewrites the paint
1863
+ * properties that differ and points the map at the other sprite sheet.
1864
+ * Sources, filters, zoom ranges, layout overrides (text scale, dyslexic font)
1865
+ * and the selection's destination focus are untouched, so unlike the
1866
+ * `setStyle` path there is nothing to capture and restore.
1867
+ *
1868
+ * Returns `false`, having changed nothing, when the two themes differ in
1869
+ * anything paint can't express; the caller then falls back to `setStyle`.
1870
+ */
1871
+ private swapBuiltinThemeInPlace;
1872
+ /** Room layers whose color a zone palette replaces. The
1873
+ * highlight pair is here so a selected room's raised block keeps its
1874
+ * palette color instead of reverting to the authored one. */
1875
+ private static readonly ZONE_PAINT_TARGETS;
1876
+ /** Zone id → palette fill for `themeName`, over the zones in use (see
1877
+ * `assignZonePaletteColors` for why only those), or `null` for a theme that
1878
+ * draws the authored colors. */
1879
+ private paletteZoneColors;
1880
+ /**
1881
+ * Under a theme with a zone palette (high contrast, color-blind), color each
1882
+ * zoned room from it, keeping the theme's own value for everything else.
1883
+ * Under the default theme, write the theme's own value back: its expression
1884
+ * already tints by the authored `zoneColor`, and an in-place swap away from
1885
+ * color-blind wouldn't reset these layers otherwise, since the two static
1886
+ * themes' unit fills are identical and `diffThemePaint` skips them.
1887
+ *
1888
+ * Writes the room layers' paint, so it must run before `setUnitFocusDim(true)`
1889
+ * captures them — otherwise clearing the selection would hand back the
1890
+ * palette-less value.
1891
+ */
1892
+ private applyZonePaint;
1893
+ /** The color a zone's rooms are drawn in under the active theme: its palette
1894
+ * entry under high contrast or color-blind, its authored color otherwise. */
1895
+ private zoneDisplayColor;
1896
+ /** Currently active theme name (or `'custom'` when a raw style was passed). */
1897
+ getActiveTheme(): ActiveThemeName;
1898
+ /**
1899
+ * Update the SDK's reduced-motion preference at runtime. When true, every
1900
+ * imperative camera move (`setView`, `resetView`, `refit`, recenter, route
1901
+ * fits, selection pans, floor fits) runs with `duration: 0`, and every
1902
+ * looping animation the SDK drives — the route line-draw, the flowing route
1903
+ * arrows, the "You are here" pulse, the selection ring's ping — is stopped.
1904
+ *
1905
+ * Anything already on screen is switched over here, not just on the next
1906
+ * action: a visitor who flips the toggle mid-route is doing it *because* of
1907
+ * the motion they can see, so waiting for the next event would be the one
1908
+ * moment the preference doesn't work.
1909
+ */
1910
+ setReducedMotion(enabled: boolean): void;
1911
+ getReducedMotion(): boolean;
1912
+ /**
1913
+ * Swap every map label (street names, POI names, building labels, "You are
1914
+ * here") between the bundled themes' default font and OpenDyslexic. Mirrors
1915
+ * the DOM-side dyslexic-font accommodation onto the canvas, which CSS can't
1916
+ * reach.
1917
+ *
1918
+ * Goes through MapLibre's local-glyph fallback: `text-font` values are swapped to
1919
+ * fontstack names intentionally absent from the glyph server
1920
+ * (`OpenDyslexic Bold` etc.), so MapLibre rasterizes them from a
1921
+ * page-loaded `@font-face` instead. The consuming app owns loading that
1922
+ * font — the SDK ships no assets — so this is a no-op glyph-wise (labels
1923
+ * fall back to tofu-free default rendering) if the app never declared it.
1924
+ *
1925
+ * Re-applied after `setTheme()`, since `setStyle({ diff: false })`
1926
+ * recreates every layer from the pristine (non-dyslexic) theme JSON.
1927
+ */
1928
+ setDyslexicFont(enabled: boolean): Promise<void>;
1929
+ getDyslexicFont(): boolean;
1930
+ private applyDyslexicFontToLabels;
1931
+ /**
1932
+ * Scale every map label's `text-size` by `scale` (1 = theme default; the
1933
+ * example kiosk passes 1.15 for its "large text" setting). Mirrors the
1934
+ * DOM-side text-size accommodation onto the canvas, which CSS can't reach.
1935
+ *
1936
+ * Multiplies the output values inside each layer's `text-size` (MapLibre
1937
+ * requires `zoom` to stay at the top of the expression, so it can't be
1938
+ * wrapped), so zoom interpolation and data-driven sizing keep working. Re-applied after
1939
+ * `setTheme()`, since `setStyle({ diff: false })` recreates every layer from
1940
+ * the pristine theme JSON. Non-finite or non-positive values reset to 1.
1941
+ *
1942
+ * The em-based `text-offset` / `text-variable-anchor-offset` are divided by
1943
+ * the same factor, so each label keeps its pixel distance from an icon that
1944
+ * doesn't scale (see `scaleTextEmOffset`).
1945
+ */
1946
+ setTextScale(scale: number): void;
1947
+ getTextScale(): number;
1948
+ private applyTextScaleToLabels;
1949
+ /**
1950
+ * Switch the locale used for POI / amenity / destination / floor names at
1951
+ * runtime. The SDK refetches localized names from JACS (per-entity
1952
+ * endpoints — `/all` does not honor `?locale=`), patches the in-memory
1953
+ * venue model in place, then redraws the POI source for the current floor
1954
+ * so map labels render in the new language.
1955
+ *
1956
+ * Structural data (waypoints, coordinates, iconIds) is preserved — only
1957
+ * the localized fields (`name`, `description`) move.
1958
+ *
1959
+ * Emits a `localeChanged` event with the new code after the patch
1960
+ * completes. No-op when the code matches the current locale.
1961
+ *
1962
+ * Throws only on programmer error — a provider without locale support
1963
+ * (only `JacsDataProvider` has it today) or an empty code. A **failed
1964
+ * JACS fetch is not fatal**: the locale still switches and is reported,
1965
+ * it's only the localized names that stay on the prior language. That
1966
+ * split is deliberate — generated directions text ships inside the SDK
1967
+ * and must not be held hostage to a network round-trip.
1968
+ */
1969
+ setLocale(locale: string): Promise<void>;
1970
+ /**
1971
+ * Start fetching the localized names for `locale` in the background so a
1972
+ * later `setLocale(locale)` only has the in-memory patch and redraw left to
1973
+ * do. Call it once after `ready` for each alternate language the UI offers.
1974
+ *
1975
+ * Never throws and never changes the active locale or the map — a provider
1976
+ * without locale support, an empty code or a failed fetch is a silent no-op
1977
+ * (a failed fetch is retried when `setLocale` runs). Safe to call
1978
+ * repeatedly; the fetch for a given code happens once.
1979
+ */
1980
+ prefetchLocale(locale: string): Promise<void>;
1981
+ /**
1982
+ * Whether newer data has been published since this venue loaded, for
1983
+ * long-running displays (kiosks) that should pick up a publish. Snapshot
1984
+ * mode only: it re-reads the venue's and customer's manifests and compares
1985
+ * them with the versions in use; `{ status: 'unsupported' }` in live
1986
+ * (`proxy`/`direct`) modes. A loaded venue never switches versions by
1987
+ * itself — on `available`, reload (ideally while nobody is using the
1988
+ * screen). Rejects when the manifests can't be fetched; try again later.
1989
+ */
1990
+ checkForUpdate(): Promise<SnapshotUpdateCheck | {
1991
+ status: 'unsupported';
1992
+ }>;
1993
+ /** Currently active locale (BCP-47), or `undefined` when no locale has
1994
+ * been set — meaning JACS resolves names to the customer's default. */
1995
+ getActiveLocale(): string | undefined;
262
1996
  setUnits2dEnabled(enabled: boolean): void;
263
1997
  toggleUnits2d(): void;
264
1998
  getIsUnits2dEnabled(): boolean;
265
1999
  setFlatMode(enabled: boolean): void;
266
2000
  toggleFlatMode(): void;
267
2001
  getIsFlatMode(): boolean;
2002
+ /**
2003
+ * Street address of the venue, from its first JACS building's `address`.
2004
+ * The CMS's Edit Venue form saves its Address field there, since it binds a
2005
+ * venue to a single building. `null` before the venue loads or when the
2006
+ * address is blank. In the venue's default language: `/all` ignores
2007
+ * `?locale=` and the locale refetch doesn't cover buildings.
2008
+ */
2009
+ getVenueAddress(): string | null;
2010
+ /**
2011
+ * Description of the venue, from its first JACS building's `description` —
2012
+ * stored there by the CMS's Edit Venue form, like `getVenueAddress()`.
2013
+ * `null` before the venue loads or when the description is blank. Same
2014
+ * locale caveat: always the venue's default language.
2015
+ */
2016
+ getVenueDescription(): string | null;
2017
+ /**
2018
+ * Center of the venue's bounds as `[lng, lat]`. `null` before the venue
2019
+ * loads or when it has no coordinates. JACS records no time zone, so a
2020
+ * consumer whose visitors may be outside the venue's zone resolves one from
2021
+ * this point and passes it to `getOpenStatus` / `dayKeyAt`.
2022
+ */
2023
+ getVenueCenter(): [number, number] | null;
268
2024
  getFloors(): Floor[];
269
2025
  getCurrentFloor(): Floor | null;
270
2026
  getDefaultFloor(): Floor | null;
271
2027
  getDestinations(floor?: Floor): Destination[];
2028
+ getZones(): Zone[];
2029
+ /** The department (zone) a POI belongs to, resolved via its waypoint's
2030
+ * `zoneId` — the only backend link between a location and a department
2031
+ * (see the zone landmine in the package CLAUDE.md). `null` when the POI
2032
+ * has no waypoint, no zone, or the zone id is unknown. */
2033
+ getZoneForPOI(poi: POI): Zone | null;
2034
+ /** Human-readable detail fields for a POI info popover. Only surfaces
2035
+ * fields that exist on the current data — `category`, `floorName`,
2036
+ * `zoneName`, `keywords`, `description`, and `imageUrl` are each omitted
2037
+ * when absent. Keeps the display-field derivation (incl. the zone lookup)
2038
+ * in the SDK so consumers stay thin. */
2039
+ getPOIDetails(poi: POI): {
2040
+ name: string;
2041
+ type: 'amenity' | 'destination' | 'kiosk';
2042
+ category?: string;
2043
+ floorName?: string;
2044
+ floorShortName?: string;
2045
+ zoneName?: string;
2046
+ zoneDescription?: string;
2047
+ /** The colour that tints this room's polygon on the map under the active
2048
+ * theme — the department's authored `Zone.color`, or its high-contrast
2049
+ * palette entry under high contrast (`Zone.displayColor`) — so a consumer
2050
+ * can print a swatch beside the department name and connect the two.
2051
+ * Re-read it on `themeChanged`. Absent when the author never picked one,
2052
+ * which is also when the map leaves the room untinted; treat "no colour"
2053
+ * as "this department isn't colour-coded", not as "fall back to a default
2054
+ * swatch". */
2055
+ zoneColor?: string;
2056
+ keywords?: string[];
2057
+ description?: string;
2058
+ /** CMS-authored extras from the entity's `extensors` bag (opening hours,
2059
+ * days, room, building). Free-form — the consumer decides what to render.
2060
+ * Artwork is not in here; see `imageUrl`. */
2061
+ properties?: Record<string, unknown>;
2062
+ /** The destination's uploaded location image, ready for an `<img src>`.
2063
+ * Destinations only — amenities use sprite glyphs, not photos. Inline SVG
2064
+ * from `/all` comes back as a data URI; otherwise it's the uploaded uri
2065
+ * path. Absent when nothing was uploaded in the CMS. */
2066
+ imageUrl?: string;
2067
+ /** Author-written alt text for `imageUrl` (`mm_image_alt`) — a description
2068
+ * of the place, for screen readers and for anyone the image fails to load
2069
+ * for. Absent when the author wrote none, in which case the image is
2070
+ * decorative and belongs in an `<img alt="">`, not an unlabelled one. */
2071
+ imageAlt?: string;
2072
+ /** Room number — the CMS's "Room Number". Reads the real
2073
+ * `Destination.unitNumber` column, falling back to a legacy hand-typed
2074
+ * `room_number` property for venues authored before that field existed. */
2075
+ roomNumber?: string;
2076
+ /** Which building on the campus this destination is in (`mm_building_name`),
2077
+ * as the author typed it — "200", "Ambulatory Care". Free text, not a
2078
+ * reference to a `Building` record; render it, don't resolve it. Falls back
2079
+ * to the legacy hand-typed `building_name` property, which is unprefixed
2080
+ * and therefore a different key. */
2081
+ buildingName?: string;
2082
+ /** Phone number and internal extension (`mm_phone`). The number is exactly
2083
+ * as the author typed it, not normalised — see `parsePhone`. */
2084
+ phone?: DestinationPhone;
2085
+ /** The CMS-authored opening hours (`mm_open_hours`), parsed. Absent when
2086
+ * the author set none, or the stored value is unreadable.
2087
+ *
2088
+ * Static — it describes the week, not this moment. Pass it to
2089
+ * `getOpenStatus()` for the live open/closed state, and re-call that on a
2090
+ * tick if the UI stays on screen. The raw string also remains in
2091
+ * `properties` for consumers that would rather parse it themselves. */
2092
+ openHours?: OpenHours;
2093
+ };
2094
+ /** Resolve the source Destination/Amenity record backing a rendered POI,
2095
+ * for detail fields (category, localized description) that don't live on
2096
+ * the built POI object. */
2097
+ private getSourceEntity;
272
2098
  getPolygonLayers(): any[];
2099
+ /**
2100
+ * Cross-reference the venue's drawn layers against the customer's allowed
2101
+ * layer list (JACS `GET /customer/{id}/polygon-layer`) and against what the
2102
+ * active theme can actually render.
2103
+ *
2104
+ * Three failure modes, none of which is visible by looking at the map:
2105
+ * a layer drawn under a name the CMS doesn't list (`unauthorized`), a layer
2106
+ * legitimately drawn that no theme rule matches (`unstyled`), and a theme
2107
+ * rule with nothing to draw at this venue (`unused`). Runs automatically
2108
+ * once after `ready` when `options.debug` is on; call it directly —
2109
+ * `mm.validateMapLayers()` — any time.
2110
+ *
2111
+ * Only counts floors whose geojson has loaded. Init preloads the rest in
2112
+ * the background, so a call in the first moments after `ready` may report
2113
+ * fewer `inData` types than a call a second later.
2114
+ */
2115
+ validateMapLayers(): Promise<LayerAudit>;
2116
+ /** Debug-mode auto-run: log findings once, stay silent when clean. */
2117
+ private reportLayerAudit;
273
2118
  getFloorMapTemplate3d(floorId: string | number): any[];
274
2119
  getAllPOIs(floor?: Floor): POI[];
2120
+ /**
2121
+ * Put the map on the kiosk's floor before drawing a route from it.
2122
+ *
2123
+ * **A route from the kiosk always starts on the kiosk's floor**, so that is
2124
+ * the floor the visitor has to be looking at when it appears. The renderer
2125
+ * agrees with that already — `wayfinding` reveals and frames *the active
2126
+ * floor's* slice of the route — which is exactly why this matters: leave the
2127
+ * map where the visitor had wandered to and the route arrives framed on the
2128
+ * wrong leg, or on no leg at all.
2129
+ *
2130
+ * Both halves of that were reported from a real kiosk. Browse up to Level 3,
2131
+ * search, press Directions: if Level 3 isn't on the route the fit falls back
2132
+ * to the union of every floor and nothing reads as a path from here; if it
2133
+ * *is* on the route — because the destination is up there — the visitor is
2134
+ * looking at the last leg of a walk they haven't started, with no indication
2135
+ * that the first one is two floors down.
2136
+ *
2137
+ * Called before the route is computed rather than after it's drawn, so the
2138
+ * camera makes one move instead of fitting the wrong floor and correcting.
2139
+ * No-op when the venue has no kiosk anchor (those routes fail anyway) or the
2140
+ * map is already there.
2141
+ */
2142
+ private showKioskFloorForRoute;
2143
+ /**
2144
+ * The floor the kiosk is physically anchored to — not necessarily the
2145
+ * floor currently displayed (the visitor may have panned the floor
2146
+ * selector to preview a destination on another level, and the SDK opens
2147
+ * on the venue's configured default floor rather than the kiosk's own —
2148
+ * see `FloorManager.selectInitialFloor`). Anchor resolution (routing,
2149
+ * recentering, closest-waypoint) must resolve against this floor, never
2150
+ * `getCurrentFloor()`, or it silently misses the "you are here" POI
2151
+ * whenever the two diverge. `null` when the venue has no kiosk anchor.
2152
+ */
2153
+ getKioskFloor(): Floor | null;
275
2154
  getYouAreHerePOI(floor?: Floor): POI | null;
276
2155
  getYouAreHereCoordinates(floor?: Floor): [number, number] | null;
2156
+ /**
2157
+ * Compass heading the kiosk's physical hardware faces, in degrees
2158
+ * clockwise from north. Sourced from JACS `Device.heading`. `null` when
2159
+ * the venue's device record has no heading set.
2160
+ *
2161
+ * In order to rotate the map so it is oriented towards the user's gaze,
2162
+ * 180 is subtracted from `Device.heading`.
2163
+ *
2164
+ * Drives `recenterOnKiosk({ useHeading: true })` and the directional
2165
+ * cone rendered next to the "You are here" marker.
2166
+ */
2167
+ getKioskHeading(): number | null;
2168
+ /**
2169
+ * Bearing (degrees clockwise from north) the visitor at the kiosk is
2170
+ * FACING — the device heading rotated 180°, since they stand in front
2171
+ * of the screen looking back at it. `null` when the device record
2172
+ * carries no heading, in which case direction-relative wording ("turn
2173
+ * right and walk 40 ft") is suppressed rather than guessed.
2174
+ */
2175
+ private getVisitorFacingBearing;
2176
+ /**
2177
+ * Display name of the JACS device the kiosk is anchored to (e.g.
2178
+ * "Main Lobby Kiosk", "Information Desk Kiosk"). `null` when the venue
2179
+ * has no kiosk anchor or the device record carries no `name`.
2180
+ *
2181
+ * Distinct from `getYouAreHerePOI()?.name`, which is always the
2182
+ * literal "You are here" label rendered on the map. Use this for chrome
2183
+ * that needs the kiosk's identity — e.g. the directions overlay's
2184
+ * "From <kiosk>" header.
2185
+ */
2186
+ getKioskName(): string | null;
2187
+ /**
2188
+ * Distance + walking time from the kiosk's anchor waypoint to a target,
2189
+ * computed over the JACS path graph (the same graph the routing engine
2190
+ * uses). Designed for "Closest: 30 sec walk" subtitles in the consumer
2191
+ * UI — no second graph build, no second Dijkstra implementation.
2192
+ *
2193
+ * Accepts a raw waypoint id, an amenity / destination object (the first
2194
+ * entry of its `waypoints` array is treated as the entry point), or any
2195
+ * `{ id, mapId? }` shape. Returns `null` when the kiosk isn't anchored,
2196
+ * the target waypoint isn't on the graph, or no path resolves.
2197
+ *
2198
+ * Walking speed defaults to 2.953 ft/s (0.9 m/s, average adult walking speed —
2199
+ * PMC2967707). Pass `walkingSpeedFps` to estimate for accessibility (e.g. 2).
2200
+ *
2201
+ * `feet` / `seconds` are the *physical* walk — horizontal legs only, what a
2202
+ * visitor is shown. `effortSeconds` adds the router's charge for each floor
2203
+ * change (the elevator wait) and is what to *rank* candidates by; see
2204
+ * `findClosestByWalkTime`. Pass `avoidStairs` to price the path as a route
2205
+ * with that option would be.
2206
+ */
2207
+ getWalkTimeFromKiosk(target: number | string | {
2208
+ id?: number | string;
2209
+ mapId?: number;
2210
+ } | {
2211
+ waypoints?: Array<number | string | {
2212
+ id?: number | string;
2213
+ }>;
2214
+ }, opts?: {
2215
+ walkingSpeedFps?: number;
2216
+ avoidStairs?: boolean;
2217
+ }): {
2218
+ feet: number;
2219
+ seconds: number;
2220
+ effortSeconds: number;
2221
+ pathNodeCount: number;
2222
+ } | null;
2223
+ /**
2224
+ * Center the camera on the kiosk's "You are here" position. Use this
2225
+ * (not `resetView`) for a chrome "Recenter" button — `resetView` snaps
2226
+ * to the SDK's captured default camera, which may have been a venue
2227
+ * overview rather than the kiosk's spot.
2228
+ *
2229
+ * When `useHeading` is true (default) and the kiosk device has a
2230
+ * `heading` on file, the camera's bearing is rotated so the direction
2231
+ * the kiosk physically faces ends up at the top of the screen. That
2232
+ * way "what the user sees in front of them" matches "what's up on the
2233
+ * map" — the single largest readability win for stressed indoor users.
2234
+ */
2235
+ recenterOnKiosk(opts?: {
2236
+ useHeading?: boolean;
2237
+ zoom?: number;
2238
+ pitch?: number;
2239
+ animate?: boolean;
2240
+ duration?: number;
2241
+ }): void;
2242
+ /**
2243
+ * Find the POI placed on a given waypoint, searching every floor. A
2244
+ * waypoint is a single placement, so this resolves the exact amenity
2245
+ * instance or destination a kiosk routed to — unlike an amenity id, which
2246
+ * is shared by all of its instances. The kiosk's own "You are here" POI is
2247
+ * skipped. Returns `null` when nothing is placed on that waypoint (stale id,
2248
+ * or a floor whose geometry hasn't loaded).
2249
+ */
2250
+ getPOIByWaypointId(waypointId: string | number): POI | null;
277
2251
  searchPOIs(query: string, floor?: Floor): POI[];
2252
+ /**
2253
+ * Search POIs across every floor in the venue. Returns raw matches —
2254
+ * an amenity that exists on multiple floors appears multiple times,
2255
+ * once per instance. Consumers that need one row per logical amenity
2256
+ * should dedupe by id (and, for "nearest", pick the instance closest
2257
+ * to the kiosk via planar distance on `coordinates`).
2258
+ */
2259
+ searchAllPOIs(query: string): POI[];
278
2260
  wayfindBetweenWaypoints(fromWaypoint: any, toWaypoint: any, options?: {
279
2261
  centerMode?: 'none' | 'destination' | 'route';
280
2262
  zoom?: number;
2263
+ /** Hard-filter stairs from the graph. */
2264
+ avoidStairs?: boolean;
281
2265
  }): Promise<any>;
282
2266
  navigateFromKioskToDestination(destination: any): Promise<any>;
2267
+ /**
2268
+ * Route from the kiosk to a specific POI's waypoint. Use this when you
2269
+ * already hold a resolved POI (e.g. from `searchPOIs` / `searchAllPOIs`).
2270
+ * For a venue-wide amenity record with multiple instances, resolve via
2271
+ * `findClosestWaypoint` first — or use `highlightAmenity` instead, if
2272
+ * you want a visual focus rather than a route.
2273
+ */
2274
+ navigateFromKioskToPOI(poi: POI, options?: {
2275
+ avoidStairs?: boolean;
2276
+ }): Promise<any>;
2277
+ /**
2278
+ * Route between two arbitrary POIs — the browser/mobile counterpart of
2279
+ * `navigateFromKioskToPOI`, for visitors who aren't standing at a kiosk
2280
+ * and pick their own starting point. `navigateBetween` with POIs only.
2281
+ */
2282
+ navigateBetweenPOIs(from: POI, to: POI, options?: {
2283
+ avoidStairs?: boolean;
2284
+ }): Promise<any>;
2285
+ /**
2286
+ * Route between two picks, each a POI or a `MapLocation` (a tapped spot
2287
+ * that isn't a POI — see `snapToPath`). A location is snapped to the
2288
+ * closest point along a path on its floor and routed from there, so a
2289
+ * visitor can start mid-corridor with no waypoint authored at that spot.
2290
+ * Same events (`routeReady` / `routeFailed`) and the same
2291
+ * `centerMode: 'route'` framing as the kiosk routes. Switches to the
2292
+ * origin's floor first, because the route starts there.
2293
+ *
2294
+ * Emits `routeFailed` with `origin_unavailable` / `destination_unavailable`
2295
+ * when a POI has no waypoint or a location has no path within reach,
2296
+ * `no_route` when no path connects them.
2297
+ */
2298
+ navigateBetween(from: POI | MapLocation, to: POI | MapLocation, options?: {
2299
+ avoidStairs?: boolean;
2300
+ }): Promise<any>;
2301
+ /**
2302
+ * What a tap on the map stands for as one end of a route — the rule "choose
2303
+ * on map" (`setLocationPicking`) applies, and the one to apply to a stored
2304
+ * tap so it resolves the same way:
2305
+ *
2306
+ * - **Inside a room that holds a destination** → that destination (`POI`),
2307
+ * routed to its entrance. A clinic's examination rooms and the like aren't
2308
+ * somewhere to walk a visitor through, so a tap there never becomes a spot
2309
+ * with an approach (`destinationInRoomAt`: smallest such room, nearest
2310
+ * destination in it).
2311
+ * - **Anywhere else** — an unplotted corridor, outdoors, a room with no
2312
+ * destination → `snapToPath`.
2313
+ *
2314
+ * `null` when the floor is unknown or no path is within reach.
2315
+ */
2316
+ resolveMapTap(location: Omit<MapLocation, 'kind'> | MapLocation): POI | MapLocation | null;
2317
+ /** `destinationInRoomAt` against a floor's own geometry and destinations. */
2318
+ private destinationInRoomAtTap;
2319
+ /**
2320
+ * Move a spot on a floor onto the walking network — where a route from (or
2321
+ * to) it will actually start (or end). The path point chosen is the one
2322
+ * closest **to walk to**, not the closest in a straight line: rooms,
2323
+ * back-of-house areas, stairs, elevators, obstacles and other buildings are
2324
+ * walked around, and a tap inside a room leaves by its door (inferred where
2325
+ * a path crosses the room's outline) rather than through the wall to the
2326
+ * corridor behind it. See `data/wayfinding/approach.ts`.
2327
+ *
2328
+ * Returns a `MapLocation` with `coordinates` on a path (`label` carried
2329
+ * over) and, when the tap was off the network, `tapped` plus — if a
2330
+ * walkable way was found — `approach`, the dotted line to draw. `tapped`
2331
+ * without `approach` means the point was simply moved (a room with no known
2332
+ * door, somewhere nothing walks) — or, with `centered`, moved from the side
2333
+ * of a hallway to its middle. `null` when the floor is unknown or no path
2334
+ * is within `maxDistanceMeters` (default 30 m).
2335
+ *
2336
+ * Planned from `tapped ?? coordinates`, so re-snapping a result (or a stored
2337
+ * tap) gives the same answer. Until the floor's geometry has loaded it's the
2338
+ * plain nearest point. Cross-floor paths are never snapped to.
2339
+ */
2340
+ snapToPath(location: Omit<MapLocation, 'kind'> | MapLocation, opts?: {
2341
+ maxDistanceMeters?: number;
2342
+ }): MapLocation | null;
2343
+ /**
2344
+ * Whether floor `floorId` has walkways outdoors — a path edge outside every
2345
+ * building and room. A multi-storey campus usually draws its outdoor paths
2346
+ * on the ground floor only, so a tap outside on another floor
2347
+ * (`locationPicked`'s `outdoors`) can't reach one: a "choose on map" UI can
2348
+ * point the visitor to a floor where this is `true`. `false` when the floor
2349
+ * is unknown or its geometry hasn't loaded.
2350
+ */
2351
+ hasOutdoorPaths(floorId: Floor['id']): boolean;
2352
+ /**
2353
+ * Turn map taps into location picks — for a "choose on map" control. While
2354
+ * on, a tap selects nothing; it's snapped to the closest point along a path
2355
+ * on the visible floor (`snapToPath`), a ring marks the snapped spot, and
2356
+ * **`locationPicked`** is emitted with `location` (the snapped
2357
+ * `MapLocation`, or `null` when no path was in reach — the ring is taken
2358
+ * down), `coordinates` (the raw tap), `floor`, and `outdoors` (the tap is
2359
+ * outside every building and room — see `hasOutdoorPaths`). Turning it off removes
2360
+ * the ring.
2361
+ */
2362
+ setLocationPicking(enabled: boolean): void;
2363
+ /**
2364
+ * Pin the ends a visitor has chosen for a route that isn't drawn yet — a
2365
+ * route form's start and destination — so each choice reads as saved: the
2366
+ * sprite's `marker-start` on `start`, `marker-destination` on
2367
+ * `destination`. A location tapped off the walking network is pinned where
2368
+ * it was tapped. Shown on the end's own floor only. Replaces the previous
2369
+ * preview; `{}` clears it. Independent of the route — clear it once the
2370
+ * route is drawn, so the route's own markers stand alone.
2371
+ */
2372
+ setRouteEndPreview(ends: RouteEndPreview): void;
2373
+ /**
2374
+ * A pick on the map: the ring on the on-path point, and the approach to it
2375
+ * from the tap. A tap that had to be *moved* (no walkable way) is shown
2376
+ * moving — its marker slides from the tap onto the path before the ring
2377
+ * appears — so the jump reads as deliberate. With reduced motion it's
2378
+ * simply there.
2379
+ */
2380
+ private showPickedLocation;
2381
+ /** A pick that resolved to a destination (`resolveMapTap`): its room
2382
+ * raised and the ring on its pin, as `highlightPOI` locates one. */
2383
+ private showPickedDestination;
2384
+ private stopPickAnimation;
2385
+ /** The floor's path-graph map id: for JACS venues the floor id *is* the
2386
+ * mapId, but read `mapId` first rather than lean on that. */
2387
+ private mapIdForFloorId;
2388
+ /** What the router takes for one end of a route: a POI's waypoint, or a
2389
+ * location's floor + on-path point (spliced in by the provider as a
2390
+ * virtual node). A location must already be through `snapToPath`, so its
2391
+ * `coordinates` are on a path. `null` when it can't be routed. */
2392
+ private routeEndpointWaypoint;
2393
+ /**
2394
+ * Distance + walking time between two arbitrary picks over the path graph —
2395
+ * `getWalkTimeFromKiosk` with a caller-chosen origin. Either end may be a
2396
+ * `MapLocation`, snapped exactly as `navigateBetween` snaps it, and its
2397
+ * `approach` (the walk from the tap to the path) is counted in `feet` /
2398
+ * `seconds` / `effortSeconds`. `null` when a POI has no waypoint on the
2399
+ * graph, a location has no path within reach, or no path resolves.
2400
+ */
2401
+ getWalkTimeBetween(from: POI | MapLocation, target: Parameters<MinuteMaps['getWalkTimeFromKiosk']>[0] | MapLocation, opts?: {
2402
+ walkingSpeedFps?: number;
2403
+ avoidStairs?: boolean;
2404
+ }): {
2405
+ feet: number;
2406
+ seconds: number;
2407
+ effortSeconds: number;
2408
+ pathNodeCount: number;
2409
+ } | null;
2410
+ /** One end of a walk-time query: a POI's waypoint, or a location's
2411
+ * on-path point (already through `snapToPath`). */
2412
+ private walkTimeRef;
2413
+ /** `routeReady`'s destination: `poi` for a place — the exact instance
2414
+ * routed to, so `navigateFromKioskToClosestAmenity`'s pick is visible —
2415
+ * or `location` for a tapped spot. */
2416
+ private routeDestinationEventField;
2417
+ /** Shared tail of the route entry points: path, camera fit, steps, events.
2418
+ * `originPoi` is the start a visitor picked (`navigateBetween`), which
2419
+ * gets a start pin; a kiosk route passes none — "You are here" marks it. */
2420
+ private routeTo;
2421
+ /** Build the landmark / floor-name context the directions module needs.
2422
+ * Pulled out so `setLocale()` or `setActiveStep()` can rebuild it on
2423
+ * demand if we ever surface a locale-aware variant. */
2424
+ /**
2425
+ * Rewrite every source whose features carry venue-authored *text* for a
2426
+ * floor: POI labels and map labels. Both read their names straight out of
2427
+ * the venue model, so anything that mutates that model in place — today
2428
+ * `setLocale`'s translation patch — has to call this or the map keeps
2429
+ * rendering the old strings until the next floor change.
2430
+ *
2431
+ * Map labels ride the same lifecycle as POIs and carry the `allLevels`
2432
+ * flag, which the projector has already honored by duplicating the
2433
+ * instance under every floor's list.
2434
+ */
2435
+ private redrawFloorText;
2436
+ /** The route's directions: `buildDirections` over the path, plus a step
2437
+ * for each tapped end's walk on to / off the network (`withApproachSteps`). */
2438
+ private buildRouteSteps;
2439
+ private buildDirectionsContext;
2440
+ /**
2441
+ * Drive the turn-by-turn UI. Two effects:
2442
+ *
2443
+ * 1. When the step's `floorId` differs from the active floor, switch
2444
+ * floors so the segment for the step's leg becomes visible.
2445
+ * 2. Highlight the step's slice of the route line by writing the
2446
+ * point range to the `route-active-step` source; the bundled
2447
+ * theme's `route-line-active` layer paints it in gold over the
2448
+ * muted base route.
2449
+ *
2450
+ * Transition steps (cross-floor elevator / stair hops) clear the line
2451
+ * highlight — there's no meaningful on-floor segment to paint — and
2452
+ * instead swap the connector(s) the step rides to their highlighted
2453
+ * sprite badge (`CONNECTOR_HIGHLIGHTED_ICON_SUFFIX`).
2454
+ *
2455
+ * `opts.fit` moves the camera too:
2456
+ * - `'step'` frames just this step (zoomed no closer than
2457
+ * `ROUTE_STEP_FIT_MAX_ZOOM`) instead of the floor's whole segment, and
2458
+ * keeps framing it through later re-fits — `setBoundsPadding` as the
2459
+ * consumer's directions card resizes, a floor switch back to the step's
2460
+ * floor — until another fit or a new route.
2461
+ * - `'route'` goes back to the route's own framing (its floor segment),
2462
+ * as when it was first drawn — e.g. a "Restart" on the first step.
2463
+ *
2464
+ * Omitted, the camera is left alone, so a route's first framing stays
2465
+ * the whole route.
2466
+ *
2467
+ * Pass `null` to clear the highlight without changing the floor or
2468
+ * tearing down the route.
2469
+ */
2470
+ setActiveStep(step: WayfindStep | null, opts?: {
2471
+ fit?: 'step' | 'route';
2472
+ }): Promise<void>;
2473
+ /** The coordinates of `step`'s point range, for the camera to frame. */
2474
+ private stepFocusFor;
2475
+ private writeActiveStepHighlight;
2476
+ private clearActiveStepHighlight;
2477
+ private clearRouteConnectorHighlight;
2478
+ /**
2479
+ * Point `ROUTE_CONNECTOR_LAYER_ID`'s `icon-image` at the highlighted badge
2480
+ * for the connector(s) the active transition step rides, and back at the
2481
+ * plain `iconId` otherwise. Imperative like the layer's filter, so it's
2482
+ * re-run from `updateRouteFloorFilter` after a theme swap drops it.
2483
+ *
2484
+ * `coalesce` over `image` falls back to the plain badge when the sprite has
2485
+ * no `-highlighted` copy of an id (a custom CMS connector icon, or a sprite
2486
+ * that predates the variant) rather than drawing nothing.
2487
+ */
2488
+ private applyRouteConnectorHighlight;
2489
+ /**
2490
+ * Draw each floor the active route crosses, in route order, and return
2491
+ * one image per floor — for printing directions.
2492
+ *
2493
+ * Images are the map canvas alone, so the consumer's DOM chrome (panels,
2494
+ * buttons, the floor picker) never appears in them. For the duration the
2495
+ * map container is laid out at a fixed `width` × `height`, the camera
2496
+ * fits each floor's segment of the route with uniform `padding`, and the
2497
+ * line is drawn solid (no draw-on sweep, no step highlight). The map is
2498
+ * drawn flat (2D) unless `flat: false`. Afterwards the container size,
2499
+ * floor, camera, flat/3D mode and padding are put back. Hide the
2500
+ * map behind a loading screen while this runs; the visitor would
2501
+ * otherwise see it jump between floors.
2502
+ *
2503
+ * The step highlight is cleared, not restored: call `setActiveStep`
2504
+ * again with the step your UI is showing. Resolves to `[]` when no route
2505
+ * is displayed.
2506
+ */
2507
+ captureRouteFloorImages(opts?: RouteImageOptions): Promise<RouteFloorImage[]>;
283
2508
  clearRoute(): void;
2509
+ /**
2510
+ * Put the end-of-route marker on `poi`, or take it down (`null`). With
2511
+ * `start`, the route's start also gets the sprite's `marker-start` pin.
2512
+ *
2513
+ * A destination gets a flag in place of its dot; an amenity instance gets an
2514
+ * enlarged copy of its own icon (`map/routeEnd.ts`). Both are drawn from a
2515
+ * source of their own, so this never touches the POI layers — clearing the
2516
+ * route empties the source and the ordinary dot / icon are what remain.
2517
+ *
2518
+ * The routed restroom is also kept out of restroom grouping while the marker
2519
+ * is up; see `RestroomGroupManager.setExcludedKey`.
2520
+ */
2521
+ private setRouteEnd;
2522
+ /**
2523
+ * Highlight a single POI on the map — a pulsing ring — and bring it into
2524
+ * view. Resolves the POI across all floors, switching the active floor if
2525
+ * it lives on another one. Pass a POI / amenity / destination id.
2526
+ */
2527
+ highlightPOI(id: string | number): Promise<void>;
2528
+ /**
2529
+ * Select a POI programmatically — the same end state as tapping it on the
2530
+ * map, from a list or any other chrome.
2531
+ *
2532
+ * Switches the active floor first when the POI lives on another one, raises
2533
+ * its room as a highlighted block, mutes the neighbouring units, declutters
2534
+ * to the selected destination(s), pans it into the unobscured map area and
2535
+ * emits **`poiSelected`** carrying every co-located POI. A consumer that
2536
+ * already renders an info card off that event therefore needs no second code
2537
+ * path: a tap and a list pick arrive the same way.
2538
+ *
2539
+ * This is deliberately *not* `highlightPOI`, which is the search-locate
2540
+ * gesture — it zooms and recenters and draws a pulsing ring, and emits
2541
+ * nothing. Selection is the quieter one: no ring, the raised room is the
2542
+ * indicator, and the current zoom is kept — unless it is further out than
2543
+ * `options.selectionZoom` (default 19.25, just inside the Kiosk view), where
2544
+ * the room or its marker may not be drawn, in which case the camera zooms in
2545
+ * to it. A map tap gets the same floor.
2546
+ *
2547
+ * Accepts a `POI` (preferred — its `type` and `waypointId` pin down the exact
2548
+ * instance, which matters for an amenity that shares one id across every
2549
+ * physical pin) or a bare id.
2550
+ *
2551
+ * **`includeCoLocated: false` emits only the requested POI.** By default the
2552
+ * payload carries everything sharing the room, which is right when the
2553
+ * gesture was a tap — the visitor pointed at a place on a floor plan and the
2554
+ * consumer has to show them what's there. It's wrong when they picked one
2555
+ * entry out of a named list: they have already disambiguated, and handing
2556
+ * back four places would ask them to do it again, on a card that opened
2557
+ * *because* they were specific. The map treatment is identical either way
2558
+ * (same room raised, same neighbours muted, same pan); only the payload —
2559
+ * and so the declutter's allow-list — narrows.
2560
+ *
2561
+ * Returns the selected POIs, `pois[0]` being the requested one; an empty
2562
+ * array if no POI matched, which is also when nothing on the map changes.
2563
+ */
2564
+ selectPOI(target: POI | string | number, options?: {
2565
+ includeCoLocated?: boolean;
2566
+ }): Promise<POI[]>;
2567
+ /** Zoom floor for a tap or `selectPOI` camera move (`options.selectionZoom`),
2568
+ * or `null` to keep the current zoom. The default sits a level past the
2569
+ * Kiosk view's edge: right at `KIOSK_VIEW_MIN_ZOOM` the selected dot and
2570
+ * name are drawn but routinely lose collision to amenities and room names. */
2571
+ private selectionZoom;
2572
+ /** Remove the POI highlight set by `highlightPOI`, un-dim the other units,
2573
+ * and bring back the destination markers hidden by a room selection. */
2574
+ clearHighlight(): void;
2575
+ /** Map a click's raw feature hits to the full, de-duplicated POIs at that
2576
+ * point (see `resolvePOIsFromFeatures`). Injected into `SelectionManager`.
2577
+ * `getAllPOIs()` is the current floor's rendered POIs — the only clickable
2578
+ * ones — and carries each POI's `waypoint`, needed for directions. */
2579
+ private resolveClickedPOIs;
2580
+ /** Emit `poiSelected` for the co-located POIs at a clicked point. Focuses the
2581
+ * selection in place (no recenter — the user already sees where they
2582
+ * tapped): rings the tapped dot and, when the tap landed in a room, raises
2583
+ * that room as a highlighted block so the eye goes to the selected unit.
2584
+ * `clearHighlight` removes both. `poi` mirrors `pois[0]` for single-POI
2585
+ * consumers. */
2586
+ private emitPoiSelected;
2587
+ /**
2588
+ * Build the room-highlight payload for a selection. The colour comes from the
2589
+ * *clicked* feature (the rendered truth), but the geometry comes from the
2590
+ * floor's full source polygon — the clicked feature is from
2591
+ * `queryRenderedFeatures`, whose geometry is clipped to on-screen tiles, so
2592
+ * highlighting it directly would leave any off-screen part of the room grey
2593
+ * (its base extrusion is muted). Falls back to the clipped geometry if the
2594
+ * full polygon can't be found. Returns `null` for a pin with no room.
2595
+ */
2596
+ private unitHighlightFor;
2597
+ /** The full, unclipped `Units` polygon on the current floor that contains
2598
+ * `coord`, straight from the floor source (not the tile-clipped render). */
2599
+ private fullUnitPolygonAt;
2600
+ /**
2601
+ * Hide every destination marker except the given ids (pass `null` to
2602
+ * restore all). Narrows each destination layer's own filter with an id
2603
+ * allow-list; amenity/connector/"you are here" layers are untouched, so they
2604
+ * stay on the map as reference. Captures the original filters once and puts
2605
+ * them back verbatim, so the layers' base rules (poiType, showLabel, iconId)
2606
+ * survive.
2607
+ */
2608
+ private setDestinationFocus;
2609
+ /**
2610
+ * Select every destination inside a tapped cluster bubble, so a consumer's
2611
+ * multi-place card lists them — the same `poiSelected` a tap on stacked pins
2612
+ * emits.
2613
+ *
2614
+ * Unlike `emitPoiSelected` this raises no room and narrows no markers. A
2615
+ * cluster spans rooms, so there is no one unit to raise or dim around, and
2616
+ * the destination focus would filter out the bubble that was just tapped
2617
+ * (its features carry no `id`) and the members hidden inside it with it.
2618
+ * Any earlier selection is cleared first, so a room left raised by the last
2619
+ * tap doesn't outlive this one. `clearHighlight` afterwards is a harmless
2620
+ * no-op for the consumer to call on dismiss.
2621
+ *
2622
+ * The leaves are read back from the cluster source (`getClusterLeaves`: a
2623
+ * promise on MapLibre v5, a callback on v4 — `peerDependencies` allows both)
2624
+ * and resolved against the floor's POIs, since a source feature only carries
2625
+ * enough identity to look the full POI (with its waypoint) back up.
2626
+ */
2627
+ private selectCluster;
2628
+ /** Gentle pan so the selection sits in the centre of the map area MapLibre
2629
+ * frames within `boundsPadding` (which the consumer sets to reserve for its
2630
+ * bottom-docked chrome / info card). A straight `easeTo`, current zoom kept,
2631
+ * so it reads as a nudge, not a recenter — unless `selectedMinZoom` is set
2632
+ * and the camera is further out, in which case it zooms in to that floor. */
2633
+ private easeToSelection;
2634
+ /** Dim every unit's paint (or restore it) so a selected room reads as the
2635
+ * focus. Idempotent: capturing only happens on the first activate, and the
2636
+ * captured originals are put back verbatim on deactivate. */
2637
+ private setUnitFocusDim;
2638
+ /**
2639
+ * Show only the named POI categories on the map. Pass `['amenity']` to
2640
+ * emphasize amenities (e.g. while an Amenities drawer is open) — destination
2641
+ * POIs hide. Call `clearPOIFilter()` to restore the default (all categories).
2642
+ *
2643
+ * The "You are here" marker, the wheelchair-accessibility badge, and any
2644
+ * active highlight are not affected and always render.
2645
+ */
2646
+ setPOIFilter(types: Array<'amenity' | 'destination'>): void;
2647
+ /** Restore the default — every POI category renders. */
2648
+ clearPOIFilter(): void;
2649
+ /**
2650
+ * Narrow the POI markers to a curated set: only POIs for which `match`
2651
+ * returns true keep their icon and label, every other pin on the categorical
2652
+ * marker layers (destinations, entrances, parking, bus, connectors,
2653
+ * information, and the per-instance amenity names) is filtered out. Built for
2654
+ * an attract loop that wants a few chosen places on screen instead of either
2655
+ * every marker or none.
2656
+ *
2657
+ * `match` runs against the current floor's POIs — the same objects
2658
+ * `getAllPOIs()` returns, `instanceName` and `amenityCategory` included — and
2659
+ * is re-run on every floor change, theme swap and locale redraw, so the
2660
+ * spotlight follows the map rather than the floor it was set on. Kiosk
2661
+ * "You are here" is never touched.
2662
+ *
2663
+ * Two things it deliberately leaves alone:
2664
+ * - `poi-other-amenity-icons` and the restroom badge. Their filters are owned
2665
+ * by the restroom-group manager and rewritten as the camera moves, so a
2666
+ * narrowing there would not survive a frame. Hide them with `hideLayers`
2667
+ * if the spotlight should exclude them.
2668
+ * - `setPOIFilter`'s category visibility, which composes: a category the
2669
+ * filter hides stays hidden whatever `match` says.
2670
+ *
2671
+ * Selecting a place (`selectPOI`, a map tap) releases the spotlight. Pass
2672
+ * `null` — or call `clearPOISpotlight()` — to restore every marker.
2673
+ */
2674
+ setPOISpotlight(match: ((poi: POI) => boolean) | null): void;
2675
+ /** Re-apply the zoom profile if the idle spotlight or a route just changed
2676
+ * which one is in force, and refresh what hangs off it. */
2677
+ private syncZoomViews;
2678
+ /** Restore every POI marker narrowed by `setPOISpotlight`. */
2679
+ clearPOISpotlight(): void;
2680
+ private applyPOISpotlight;
2681
+ private applyPOIFilter;
2682
+ /**
2683
+ * Show or hide destination dots, independently of their name labels and of
2684
+ * `setPOIFilter`'s combined `'destination'` category (which still toggles
2685
+ * both together). Affects every destination dot — both the dot+label
2686
+ * marker on `poi-destination-labels` and the dot-only fallback on
2687
+ * `poi-destination-circles` that a `showLabel: false` POI renders on.
2688
+ *
2689
+ * Implemented as `icon-opacity`, not a layer swap: dot and label are
2690
+ * placed as one collision unit on `poi-destination-labels` (`icon-optional:
2691
+ * false` / `text-optional: true`), which is what guarantees a label never
2692
+ * renders without a dot beneath it. Splitting them into independently
2693
+ * *placed* layers would let MapLibre's collision index resolve each half
2694
+ * on its own, so a label could win placement while its dot lost — the
2695
+ * "floating name" bug this theme's combined layer was built to fix (see
2696
+ * `themes.test.ts` :: "a destination is one marker").
2697
+ */
2698
+ setDestinationCirclesVisible(visible: boolean): void;
2699
+ /**
2700
+ * Show or hide destination name labels, independently of their dots. See
2701
+ * `setDestinationCirclesVisible` for why this is an opacity toggle on the
2702
+ * shared marker layer rather than a separate label layer.
2703
+ *
2704
+ * `visible: true` (the default) doesn't mean "always on" — labels still
2705
+ * fade in only once the visitor has zoomed in past the venue's opening
2706
+ * view (`DESTINATION_LABEL_REVEAL_OFFSET` in `iconZoomRanges.ts`), so a
2707
+ * zoomed-out visitor sees dots without the screen filling with names. Pass
2708
+ * `false` to suppress labels outright regardless of zoom.
2709
+ */
2710
+ setDestinationLabelsVisible(visible: boolean): void;
2711
+ private applyDestinationDisplay;
2712
+ /**
2713
+ * Return the waypoint in `waypoints` closest to `from`. Useful for
2714
+ * "route to the nearest X" against a venue-wide amenity record that has
2715
+ * multiple physical instances. Defaults `from` to the kiosk's
2716
+ * "You are here" coordinates.
2717
+ *
2718
+ * Distance is planar Euclidean on lng/lat — sufficient for ordering at
2719
+ * single-venue scale, and avoids a turf dependency on the hot path.
2720
+ */
2721
+ findClosestWaypoint(waypoints: Waypoint[], from?: [number, number]): Waypoint | null;
2722
+ /**
2723
+ * Pick the candidate cheapest to reach from the kiosk — the one rule for
2724
+ * "closest instance of an amenity". `navigateFromKioskToClosestAmenity` and
2725
+ * `highlightAmenity` use it, and a consumer collapsing a venue-wide amenity
2726
+ * to a single search row should too, so a tap and a search result can never
2727
+ * resolve the same amenity to different floors.
2728
+ *
2729
+ * Each candidate is scored by `getWalkTimeFromKiosk().effortSeconds` — walk
2730
+ * time over the JACS path graph **plus the elevator wait** for any floor
2731
+ * change — and a candidate on a *different floor* from the kiosk has that
2732
+ * score multiplied by `options.otherFloorPenalty` (default `1.5`; `1`
2733
+ * disables it). The wait is the physical cost of leaving the floor; the
2734
+ * multiplier is a preference for not making the visitor do it, and only
2735
+ * applies here — it never changes a route.
2736
+ *
2737
+ * `toWaypoint` maps a candidate to the waypoint it stands for (identity for
2738
+ * a `Waypoint[]`, `poi => poi.waypoint` for a `POI[]`). Candidates whose
2739
+ * waypoint is missing or has no coordinates are ignored, as are waypoints
2740
+ * the graph can't reach from the kiosk. If none resolve a cost, falls back
2741
+ * to the planar `findClosestWaypoint`, **restricted to the kiosk's floor
2742
+ * when any candidate is on it** (planar distance is meaningless across
2743
+ * overlaid floors). Returns `null` for no usable candidate. Pass the same
2744
+ * `avoidStairs` the route will use so the pick and the route agree.
2745
+ */
2746
+ findClosestByWalkTime<T>(items: readonly T[], toWaypoint: (item: T) => Waypoint | null | undefined, opts?: {
2747
+ avoidStairs?: boolean;
2748
+ }): T | null;
2749
+ /**
2750
+ * Route from the kiosk to the closest physical instance of an amenity.
2751
+ * Resolves the amenity venue-wide, picks the instance with the smallest
2752
+ * path-graph cost from the kiosk (`findClosestByWalkTime`: walk time plus
2753
+ * the elevator wait, with a preference for the kiosk's floor; falling back
2754
+ * to planar Euclidean when the walk-time graph can't resolve any waypoint), switches the
2755
+ * active floor if needed, and routes via the same plumbing as
2756
+ * `navigateFromKioskToPOI` — so step-by-step directions, the
2757
+ * `routeReady` event, and the active-floor camera fit all "just work."
2758
+ *
2759
+ * Pass `avoidStairs` to hard-filter stairs from the *route* (the SDK's
2760
+ * routing engine reads it per call; the CMS's per-path-type weight
2761
+ * otherwise handles accessibility preference automatically). The same
2762
+ * flag is passed to the closest-instance pick, so an instance reachable
2763
+ * only by stairs is skipped in favour of one the route can actually reach.
2764
+ */
2765
+ navigateFromKioskToClosestAmenity(amenityId: string | number, options?: {
2766
+ avoidStairs?: boolean;
2767
+ }): Promise<any>;
2768
+ /**
2769
+ * Highlight + center on the closest physical instance of an amenity.
2770
+ * The amenity is resolved against `amenities.getDistinct()` (venue-wide,
2771
+ * deduped); the closest waypoint to the kiosk is picked; the active floor
2772
+ * is switched if that instance lives on another one.
2773
+ *
2774
+ * This is the right call from a venue-wide list ("here are all the
2775
+ * bathrooms in the building, take me to the closest one"). For taps on
2776
+ * a specific resolved POI (e.g. a search result that already names one
2777
+ * instance), use `highlightPOI` instead.
2778
+ */
2779
+ highlightAmenity(amenityId: string | number): Promise<void>;
2780
+ /** Which floor owns this waypoint, by matching mapId against the floor's
2781
+ * `mapId` (or `id` as fallback). Used to switch floors when routing /
2782
+ * highlighting hits an instance on a different one. */
2783
+ private findFloorForWaypoint;
284
2784
  getCameraPosition(): CameraState | null;
285
2785
  getMap(): Map | null;
2786
+ /**
2787
+ * Hide one or more layers by id — a public, always-live counterpart to
2788
+ * `debug.hide()` for consumers that want to toggle arbitrary layers
2789
+ * without reaching into the console-facing debug API. Sticky: the
2790
+ * override is re-asserted across floor changes, `setPOIFilter`, view-mode
2791
+ * toggles and theme swaps until `showLayers` undoes it. Ids absent from
2792
+ * the active style are skipped silently. Returns the ids actually found
2793
+ * and hidden.
2794
+ */
2795
+ hideLayers(layerIds: string[]): string[];
2796
+ /**
2797
+ * Undo `hideLayers` for these ids. Each layer returns to whatever
2798
+ * visibility the SDK's own state — current floor, POI filter, view mode —
2799
+ * says it should have; it is **not** forced to `visible`. A layer the SDK
2800
+ * is independently keeping hidden (another floor's layers, an
2801
+ * off-view-mode extrusion) stays hidden rather than being force-revealed.
2802
+ * This is the correct inverse of `hideLayers` (mirrors `debug.restore()` —
2803
+ * see `debugLayers.ts` for why a blanket "show" is usually the wrong
2804
+ * undo). Returns the ids that actually had an override to release.
2805
+ */
2806
+ showLayers(layerIds: string[]): string[];
2807
+ /**
2808
+ * Whether a layer is currently rendering (`visibility !== 'none'`).
2809
+ * `false` for a layer absent from the active style.
2810
+ */
2811
+ isLayerVisible(layerId: string): boolean;
2812
+ /**
2813
+ * Put this instance on `window` so a kiosk running in a browser can be
2814
+ * driven from devtools — `mm.debug.help()`, `mm.getMap()`, `mm.setTheme(…)`.
2815
+ * Debug builds only: nothing is exposed unless `options.debug` is on, and
2816
+ * `options.debugGlobal` renames the key (or `false` opts out entirely).
2817
+ *
2818
+ * Refuses to clobber a key that already holds something that isn't a
2819
+ * MinuteMaps — a kiosk shell with its own `window.mm` shouldn't lose it to
2820
+ * a dev-mode convenience.
2821
+ */
2822
+ private exposeDebugGlobal;
2823
+ /** Drop the `window` handle, but only if it still points at this instance. */
2824
+ private releaseDebugGlobal;
286
2825
  destroy(): void;
287
2826
  setCurrentFloor(floor: Floor): Promise<void>;
2827
+ /**
2828
+ * Filter the route-line / route-halo layers to only render segments
2829
+ * whose `floorId` matches the active floor (or features that carry no
2830
+ * `floorId` at all — the straight-line fallback, which we want visible
2831
+ * on every floor since it has no floor membership to filter against).
2832
+ *
2833
+ * Features are tagged with the JACS pixel `mapId` (that's what flows
2834
+ * through the route point's `mapId`), so the filter compares against
2835
+ * the active floor's `mapId`, NOT its `id` — those are two different
2836
+ * JACS identifiers (`floor.id` is the building-floor record; `mapId`
2837
+ * is the SVG asset). We accept the floor's `id` here for convenience
2838
+ * and resolve to `mapId` via `getFloors()`.
2839
+ *
2840
+ * Applied imperatively rather than baked into the theme JSON so the
2841
+ * filter tracks runtime floor changes without restyling the map.
2842
+ */
2843
+ private updateRouteFloorFilter;
288
2844
  isReady(): boolean;
289
2845
  private setFloorLayerVisibility;
290
2846
  private getBoundsPadding;
2847
+ /**
2848
+ * Shrink per-side padding if the requested insets would leave no room.
2849
+ * `cameraForBounds` / `fitBounds` silently fail ("Map cannot fit within
2850
+ * canvas") when an axis's total padding meets or exceeds that axis — cap
2851
+ * each axis's total at 80% so a fit always has space to land.
2852
+ */
2853
+ private clampPadding;
291
2854
  private getVenueBounds;
2855
+ /**
2856
+ * The polygon `options.hideBasemapPoisNearVenue` hides basemap POIs inside:
2857
+ * the venue's bounds padded outward. `null` when disabled or before the
2858
+ * venue loads.
2859
+ */
2860
+ private getBasemapPoiMask;
2861
+ /**
2862
+ * Resolve `options.maxBounds` into the actual pan/zoom-out cap. `false`
2863
+ * disables it, explicit bounds pass through as-is, and a number (or the
2864
+ * unset default of 3) scales the venue's own bounds outward around its
2865
+ * center — see `scaleBounds`.
2866
+ *
2867
+ * The unset default is also floored at `DEFAULT_MIN_MAX_BOUNDS_SPAN_M` per
2868
+ * side. MapLibre won't zoom out past the point where `maxBounds` fills the
2869
+ * viewport, so a small venue's 3x box would otherwise raise the effective
2870
+ * zoom-out floor above `minZoom` and show far less surrounding map than a
2871
+ * large venue does. An explicit number is a deliberate leash and is left as-is.
2872
+ */
2873
+ private getMaxBounds;
2874
+ /**
2875
+ * Opening-framing policy applied once after the initial floor fit.
2876
+ * - `initialPitch`: tilt to this and re-fit the building footprint so the
2877
+ * kiosk opens on a tilted building instead of a flat top-down plan.
2878
+ * - `minZoomBelowInitialFit`: clamp the map's minZoom to
2879
+ * `(fitZoom − margin)` so visitors can't pull back to the empty region.
2880
+ * Both are no-ops when their option is unset.
2881
+ */
2882
+ private applyInitialFraming;
292
2883
  private applyInitialViewFromVenue;
293
2884
  private loadAndPatchVenueStyle;
294
2885
  private ensureFloorLayersFromStyle;
@@ -296,5 +2887,204 @@ declare class MinuteMaps {
296
2887
  }
297
2888
  declare function createMinuteMapsSDK(config: SDKConfig): MinuteMaps;
298
2889
 
299
- export { MinuteMaps, createMinuteMapsSDK };
300
- export type { Amenity, AmenityWithFloor, Bounds, CameraState, Destination, EventCallback, Floor, FloorMetadata, JMapAuth, JMapConfig, JacsAuth, JacsConfig, MapEvent, POI, POISearchResult, SDKConfig, SDKOptions, ViewOptions, WayfindCenterMode, Waypoint };
2890
+ /** Where a `VenueDirectory` reads from: live JACS (`proxy`/`direct`, which
2891
+ * reads `/customer/all`) or published snapshots (`snapshot`, which reads
2892
+ * `directory.json` — published venues only). */
2893
+ type VenueDirectoryConfig = JacsProviderConfig | ({
2894
+ mode: 'snapshot';
2895
+ } & SnapshotProviderConfig);
2896
+ /** The slice of `/customer/all`'s `customer` object a client acts on. Audit
2897
+ * fields, quotas and SSO config are dropped on purpose. */
2898
+ type Customer = {
2899
+ id: number | string;
2900
+ name: string;
2901
+ /** `null` when JACS has no localized name; use {@link customerDisplayName}. */
2902
+ localizedName: string | null;
2903
+ /** Environment/partition the customer lives in; test customers carry a
2904
+ * different one, which is what the `tenantId` filter keys on. */
2905
+ tenantId: number | null;
2906
+ uuid: string | null;
2907
+ /** BCP-47 code of `defaultLocale.locale`. */
2908
+ defaultLocale: string | null;
2909
+ };
2910
+ /** A venue as listed under a customer — a summary, not the loaded venue model. */
2911
+ type VenueSummary = {
2912
+ id: number | string;
2913
+ customerId: number | string;
2914
+ name: string;
2915
+ /** South-west corner (`bottomLng`, `bottomLat`); `null` if JACS omitted coordinates. */
2916
+ southWest: [number, number] | null;
2917
+ /** North-east corner (`topLng`, `topLat`). */
2918
+ northEast: [number, number] | null;
2919
+ /** JACS's `status` flag. Not filtered here — a picker decides whether to hide
2920
+ * `false` (unpublished) venues. */
2921
+ status: boolean;
2922
+ locked: boolean;
2923
+ uuid: string | null;
2924
+ /** JACS's `externalId`; `null` when the venue has none. */
2925
+ externalId: string | null;
2926
+ /** JACS `extensors` — free-form per-venue key/values (`GO_LIVE`, `MOBILE_APP`,
2927
+ * `KIOSK_LOCATIONS`, analytics ids, …). Values are the raw strings JACS sends
2928
+ * (`KIOSK_LOCATIONS` is a JSON-encoded string); non-scalar values are dropped. */
2929
+ extensors: Record<string, string>;
2930
+ /** UUID of the venue's default map template; `null` when not set. */
2931
+ defaultMapTemplateId: string | null;
2932
+ /** JACS `labelType` enum value; `null` if omitted. */
2933
+ labelType: number | null;
2934
+ /** Whether the venue's map uses marker clustering. */
2935
+ clustering: boolean;
2936
+ /** Whether JACS publishes the venue's edits automatically. */
2937
+ autoPublish: boolean;
2938
+ /** The venue's street address (its first building's `address`); `null` when
2939
+ * blank or unknown. Only snapshot directories carry it — `/customer/all`
2940
+ * has no buildings — so it is always `null` in `proxy`/`direct` mode. Same
2941
+ * value `MinuteMaps.getVenueAddress()` returns once the venue loads. */
2942
+ address: string | null;
2943
+ /** The venue's description, as with `address`. Matches
2944
+ * `MinuteMaps.getVenueDescription()`. */
2945
+ description: string | null;
2946
+ /** Whether the venue has a map to open: `false` when the publisher listed it
2947
+ * with no building, floors or uploaded floor maps, so a picker can show it
2948
+ * without loading it. `null` when the source doesn't say — always in
2949
+ * `proxy`/`direct` mode, and in snapshots published before the field. */
2950
+ mapped: boolean | null;
2951
+ };
2952
+ /** One entry of `/customer/all`: a customer and the venues it owns. Hand a
2953
+ * venue's `customerId` and `id` to the SDK's `jacs`/`venue` config to load it. */
2954
+ type CustomerVenues = {
2955
+ customer: Customer;
2956
+ venues: VenueSummary[];
2957
+ };
2958
+ type ListCustomerVenuesOptions = {
2959
+ /** Keep only customers with this `tenantId`, so test customers living in
2960
+ * other tenants are left out. A customer with no `tenantId` never matches.
2961
+ * Omit to return every customer the proxy exposes. */
2962
+ tenantId?: number;
2963
+ };
2964
+ /** `customer.localizedName` when non-blank, else `customer.name`. */
2965
+ declare function customerDisplayName(customer: Customer): string;
2966
+ /**
2967
+ * Lists the customers and venues a user can pick from — the data behind a
2968
+ * "select your hospital" screen. Unlike the `MinuteMaps` class this isn't
2969
+ * bound to a venue: it runs *before* one is chosen.
2970
+ *
2971
+ * Accepts JACS config (proxy or direct), snapshot config, or an existing
2972
+ * `JacsProvider` / `SnapshotProvider`.
2973
+ */
2974
+ declare class VenueDirectory {
2975
+ private jacs;
2976
+ constructor(config: VenueDirectoryConfig | JacsReader);
2977
+ /** `/customer/all`, optionally narrowed to one `tenantId`. */
2978
+ listCustomerVenues(options?: ListCustomerVenuesOptions): Promise<CustomerVenues[]>;
2979
+ }
2980
+
2981
+ type TransitionStep = Extract<WayfindStep, {
2982
+ type: 'transition';
2983
+ }>;
2984
+ type RouteFloorSection = {
2985
+ /** Floor (JACS `mapId`) this section is on. `null` only for a degenerate
2986
+ * floorless route (straight-line fallback with no `mapId`). */
2987
+ floorId: number | null;
2988
+ /** This floor's steps, each with its index into the original flat array
2989
+ * so the consumer can call `setActiveStep` / highlight by index. */
2990
+ steps: Array<{
2991
+ step: WayfindStep;
2992
+ index: number;
2993
+ }>;
2994
+ /** Index of this section's first step in the original array — the target
2995
+ * for `setActiveStep` when advancing INTO this section. */
2996
+ firstStepIndex: number;
2997
+ /** The transition step that leaves this floor for the next section, if
2998
+ * any. Absent on the final section. Its `text` ("Take the elevator to
2999
+ * Basement") makes a good "continue" button label. */
3000
+ exit?: {
3001
+ step: TransitionStep;
3002
+ index: number;
3003
+ };
3004
+ };
3005
+ /**
3006
+ * Group steps into per-floor sections. Single-floor routes return one
3007
+ * section (so a consumer can keep its whole-route view for that case).
3008
+ */
3009
+ declare function groupStepsIntoFloorSections(steps: WayfindStep[]): RouteFloorSection[];
3010
+ /**
3011
+ * Which section is "active" given the active step index — the last section
3012
+ * whose `firstStepIndex` is at or before `activeStepIndex`. Returns 0 when
3013
+ * nothing matches (e.g. index points at the leading transition, which
3014
+ * shouldn't happen since routes start with a depart step).
3015
+ */
3016
+ declare function activeSectionIndex(sections: RouteFloorSection[], activeStepIndex: number): number;
3017
+
3018
+ /** True when an amenity is a vertical-circulation connector. The provider
3019
+ * stamps `_connector` on every synthetic elevator / stairs / escalator, which
3020
+ * is the reliable signal — `extensors.iconName` is only the *display* glyph
3021
+ * and may be any CMS-assigned icon (we still honour it as a fallback for
3022
+ * amenities authored with a connector icon name directly). */
3023
+ declare function isConnectorAmenity(amenity: AmenityLike): boolean;
3024
+ type LocaleField = {
3025
+ locale?: string;
3026
+ uriPath?: string;
3027
+ };
3028
+ type UriField = {
3029
+ mimeType?: string;
3030
+ resourceType?: string;
3031
+ locales?: LocaleField[];
3032
+ };
3033
+ type AmenityLike = {
3034
+ id: number | string;
3035
+ iconId?: string;
3036
+ uris?: UriField[] | null;
3037
+ /** Inline SVG markup. Used by the SDK for synthetic connector
3038
+ * amenities (elevator / stairs / escalator) where the CMS has no
3039
+ * uploaded icon to fetch. When set, this short-circuits the
3040
+ * `uris[].locales[].uriPath` lookup. */
3041
+ svg?: string;
3042
+ /** Free-form CMS metadata. When `extensors.iconName` names a curated
3043
+ * Material Symbols icon, the SDK renders it from the bundled registry
3044
+ * (no upload, no network) — see `pickMaterialSvg`. */
3045
+ extensors?: Record<string, unknown> | null;
3046
+ /** Set by the JACS provider on synthetic vertical-circulation amenities
3047
+ * (elevator / stairs / escalator built from path types). The reliable
3048
+ * connector signal — `extensors.iconName` is the *display* glyph, which
3049
+ * may be any CMS-assigned icon, not the connector kind. */
3050
+ _connector?: boolean;
3051
+ };
3052
+ type ResolvedIconSource = {
3053
+ /** Map image id to register/reference. Shared across amenities for
3054
+ * connectors (preset) and curated Material icons (`material-<name>`). */
3055
+ iconId: string;
3056
+ /** Source for `composeAmenityBitmap` — exactly one of url / inlineSvg. */
3057
+ source: {
3058
+ url?: string;
3059
+ inlineSvg?: string;
3060
+ };
3061
+ /**
3062
+ * Where the artwork came from. The map doesn't care — it rasterises all
3063
+ * three the same way — but a DOM consumer must, because provenance decides
3064
+ * both trust and styling:
3065
+ *
3066
+ * - `material` — from the SDK's bundled registry. Ours, so it's safe to
3067
+ * inline into the DOM, and safe to recolour (it's a monochrome glyph).
3068
+ * - `inline` — an `svg` string off the CMS record. **Author-supplied
3069
+ * markup**: an inline `<svg>` can carry `<script>`, so render it through
3070
+ * an `<img src="data:…">` (which never executes script), not
3071
+ * `dangerouslySetInnerHTML`.
3072
+ * - `upload` — a URL to a CMS-uploaded file. Also author-supplied, also an
3073
+ * `<img>`; and it arrives in whatever colours the author chose, so don't
3074
+ * assume you can tint it to match a badge.
3075
+ */
3076
+ kind: 'material' | 'inline' | 'upload';
3077
+ };
3078
+ /**
3079
+ * Pure icon-source resolution by precedence — no map/DOM side effects, so it's
3080
+ * unit-testable:
3081
+ * 1. inline svg — explicit inline-SVG override (rare)
3082
+ * 2. extensors.iconName — curated Material icon (bundled, shared bitmap);
3083
+ * also how synthetic connectors render now
3084
+ * 3. uris[].uriPath — legacy / custom-uploaded SVG (fetched)
3085
+ * Returns null when the amenity has no resolvable icon.
3086
+ */
3087
+ declare function resolveAmenityIconSource(amenity: AmenityLike, preferredLocale?: string): ResolvedIconSource | null;
3088
+
3089
+ export { BUILDING_NAME_EXTENSOR_KEY, DAY_KEYS, IMAGE_ALT_EXTENSOR_KEY, MinuteMaps, OPEN_HOURS_EXTENSOR_KEY, OPEN_HOURS_VERSION, PHONE_EXTENSOR_KEY, POINT_OF_INTEREST_EXTENSOR_KEY, RESERVED_EXTENSOR_PREFIX, SNAPSHOT_SCHEMA_VERSION, SnapshotProvider, SnapshotUnavailableError, VenueDirectory, activeSectionIndex, createMinuteMapsSDK, customerDisplayName, dayKeyAt, getOpenStatus, groupStepsIntoFloorSections, isConnectorAmenity, isMapLocation, parseBuildingName, parseImageAlt, parseOpenHours, parsePhone, parsePointOfInterest, resolveAmenityIconSource, resolveSnapshotLocale, timeZoneAbbreviation };
3090
+ export type { Amenity, AmenityBadgeStyle, AmenityWithFloor, Bounds, BoundsPadding, CameraState, Customer, CustomerVenues, DayKey, Destination, DestinationPhone, EventCallback, Floor, FloorMetadata, HoursRange, JMapAuth, JMapConfig, JacsAuth, JacsConfig, JacsProviderConfig, JacsReader, ListCustomerVenuesOptions, MapEvent, MapLocation, OpenHours, OpenHoursTransition, OpenStatus, OpenStatusOptions, POI, POISearchResult, ResolvedIconSource, RouteEndPreview, RouteFloorImage, RouteFloorSection, RouteImageOptions, RoutePoint, RoutingOptions, SDKConfig, SDKOptions, SnapshotProviderConfig, SnapshotUpdateCheck, SnapshotVersions, ThemeName, TransitionStep, VenueDirectoryConfig, VenueSummary, ViewOptions, WayfindCenterMode, WayfindStep, Waypoint, Zone };