@mapvx/web-js 3.4.0-dev.2 → 3.5.0-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/dist/cjs/domain/models/campaign.js +73 -0
  2. package/dist/cjs/domain/models/campaign.js.map +1 -0
  3. package/dist/cjs/index.js +4 -1
  4. package/dist/cjs/index.js.map +1 -1
  5. package/dist/cjs/logger/sentry.js +1 -1
  6. package/dist/cjs/map/map.js +380 -14
  7. package/dist/cjs/map/map.js.map +1 -1
  8. package/dist/cjs/map/scene3DController.js +36 -0
  9. package/dist/cjs/map/scene3DController.js.map +1 -1
  10. package/dist/cjs/repository/repository.js +65 -4
  11. package/dist/cjs/repository/repository.js.map +1 -1
  12. package/dist/cjs/repository/requester.js +81 -9
  13. package/dist/cjs/repository/requester.js.map +1 -1
  14. package/dist/cjs/sdk.js +12 -0
  15. package/dist/cjs/sdk.js.map +1 -1
  16. package/dist/es/config/sdkConfig.d.ts +15 -0
  17. package/dist/es/config/sdkConfig.d.ts.map +1 -1
  18. package/dist/es/domain/models/campaign.d.ts +116 -0
  19. package/dist/es/domain/models/campaign.d.ts.map +1 -0
  20. package/dist/es/domain/models/campaign.js +69 -0
  21. package/dist/es/domain/models/campaign.js.map +1 -0
  22. package/dist/es/domain/models/mapConfig.d.ts +6 -0
  23. package/dist/es/domain/models/mapConfig.d.ts.map +1 -1
  24. package/dist/es/index.d.ts +2 -0
  25. package/dist/es/index.d.ts.map +1 -1
  26. package/dist/es/index.js +2 -0
  27. package/dist/es/index.js.map +1 -1
  28. package/dist/es/logger/sentry.js +1 -1
  29. package/dist/es/map/map.d.ts +145 -0
  30. package/dist/es/map/map.d.ts.map +1 -1
  31. package/dist/es/map/map.js +380 -14
  32. package/dist/es/map/map.js.map +1 -1
  33. package/dist/es/map/scene3DController.d.ts +20 -0
  34. package/dist/es/map/scene3DController.d.ts.map +1 -1
  35. package/dist/es/map/scene3DController.js +36 -0
  36. package/dist/es/map/scene3DController.js.map +1 -1
  37. package/dist/es/repository/repository.d.ts +16 -1
  38. package/dist/es/repository/repository.d.ts.map +1 -1
  39. package/dist/es/repository/repository.js +65 -4
  40. package/dist/es/repository/repository.js.map +1 -1
  41. package/dist/es/repository/requester.d.ts +30 -1
  42. package/dist/es/repository/requester.d.ts.map +1 -1
  43. package/dist/es/repository/requester.js +81 -9
  44. package/dist/es/repository/requester.js.map +1 -1
  45. package/dist/es/sdk.d.ts +11 -1
  46. package/dist/es/sdk.d.ts.map +1 -1
  47. package/dist/es/sdk.js +12 -0
  48. package/dist/es/sdk.js.map +1 -1
  49. package/dist/umd/index.js +1688 -838
  50. package/dist/umd/index.js.map +1 -1
  51. package/package.json +1 -1
package/dist/umd/index.js CHANGED
@@ -288,6 +288,7 @@ __webpack_require__.d(__webpack_exports__, {
288
288
  Banner: () => (/* reexport */ Banner),
289
289
  CIRCLE_DEFAULTS: () => (/* reexport */ CIRCLE_DEFAULTS),
290
290
  CacheManager: () => (/* reexport */ CacheManager),
291
+ Campaign: () => (/* reexport */ Campaign),
291
292
  DEFAULT_CACHE_CONFIGS: () => (/* reexport */ DEFAULT_CACHE_CONFIGS),
292
293
  DEFAULT_MARKER_LAYOUT_CONFIG: () => (/* reexport */ DEFAULT_MARKER_LAYOUT_CONFIG),
293
294
  DEFAULT_MAX_STORAGE_BYTES: () => (/* reexport */ DEFAULT_MAX_STORAGE_BYTES),
@@ -11248,7 +11249,7 @@ const extractSafariExtensionDetails = (func, filename) => {
11248
11249
  // exists only for the type-checker, so in the ES/CJS builds the identifier is
11249
11250
  // genuinely absent and a direct comparison throws ReferenceError at module load.
11250
11251
  // `typeof` is the only safe way to probe a possibly-undeclared global.
11251
- var sentry_SDK_VERSION = false ? 0 : "3.4.0-dev.2";
11252
+ var sentry_SDK_VERSION = false ? 0 : "3.5.0-dev.1";
11252
11253
  var DSN = false ? 0 : "https://872f598f020e3cd73a0933b562d24c81@sentry.mapvx.app/5";
11253
11254
 
11254
11255
  /**
@@ -15904,6 +15905,121 @@ var Polyline = /*#__PURE__*/function () {
15904
15905
  }
15905
15906
  }]);
15906
15907
  }();
15908
+ ;// ./src/domain/models/campaign.ts
15909
+ function campaign_typeof(o) { "@babel/helpers - typeof"; return campaign_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, campaign_typeof(o); }
15910
+ function campaign_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, campaign_toPropertyKey(o.key), o); } }
15911
+ function campaign_createClass(e, r, t) { return r && campaign_defineProperties(e.prototype, r), t && campaign_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
15912
+ function campaign_toPropertyKey(t) { var i = campaign_toPrimitive(t, "string"); return "symbol" == campaign_typeof(i) ? i : i + ""; }
15913
+ function campaign_toPrimitive(t, r) { if ("object" != campaign_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != campaign_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
15914
+ function campaign_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
15915
+ /**
15916
+ * Media kind of a campaign item.
15917
+ * @group Campaigns
15918
+ */
15919
+
15920
+ /**
15921
+ * Localized alternative text for a campaign media item.
15922
+ * @group Campaigns
15923
+ */
15924
+
15925
+ /**
15926
+ * A single campaign media item (image or video) as it comes from the API.
15927
+ * @group Campaigns
15928
+ */
15929
+
15930
+ /**
15931
+ * A weekly display window for a campaign.
15932
+ * @group Campaigns
15933
+ */
15934
+
15935
+ /**
15936
+ * API response for a campaign, as returned by `GET /api/sdk/v2/campaigns`.
15937
+ * Contains the data structure as it comes from the server.
15938
+ * @group Campaigns
15939
+ */
15940
+
15941
+ /**
15942
+ * A single, normalized campaign media item.
15943
+ * @group Campaigns
15944
+ */
15945
+
15946
+ /**
15947
+ * A normalized weekly display window.
15948
+ * @group Campaigns
15949
+ */
15950
+
15951
+ /**
15952
+ * Resolves a campaign image's media kind, tolerating the casing and spelling variations a
15953
+ * backend can return.
15954
+ *
15955
+ * A strict `mediaType === "video"` check silently classifies `"VIDEO"`, `"Video"` and
15956
+ * `"video/mp4"` as images, which puts an mp4 URL in an `<img>` slot — the screensaver
15957
+ * then holds a blank frame with no warning anywhere. The MIME-ish `type` field is
15958
+ * consulted as a fallback because it carries the same information (`"video/mp4"`) when
15959
+ * `mediaType` is missing or unrecognized.
15960
+ *
15961
+ * @param mediaType Raw `mediaType` from the API response, if any.
15962
+ * @param type Raw MIME `type` from the API response, used as the fallback signal.
15963
+ * @returns `"video"` when either field identifies video, otherwise `"image"`.
15964
+ * @hidden
15965
+ */
15966
+ function resolveMediaType(mediaType, type) {
15967
+ var declared = mediaType === null || mediaType === void 0 ? void 0 : mediaType.trim().toLowerCase();
15968
+ if (declared === "video" || declared !== null && declared !== void 0 && declared.startsWith("video/")) return "video";
15969
+ if (declared === "image" || declared !== null && declared !== void 0 && declared.startsWith("image/")) return "image";
15970
+ // `mediaType` absent or unrecognized: fall back to the MIME type.
15971
+ return type !== null && type !== void 0 && type.trim().toLowerCase().startsWith("video/") ? "video" : "image";
15972
+ }
15973
+
15974
+ /**
15975
+ * A campaign shown by a totem screensaver. Its media items and weekly schedules
15976
+ * drive the playlist; the SDK returns campaigns for a maps-group verbatim (it does
15977
+ * NOT filter by status/date/schedule — the consumer decides which are active).
15978
+ * @group Campaigns
15979
+ */
15980
+ var Campaign = /*#__PURE__*/campaign_createClass(/** Per-group playlist order of this campaign (0 = first). */
15981
+
15982
+ /** Alias of {@link sortOrder}. */
15983
+
15984
+ /**
15985
+ * Creates a campaign from API response data, applying the same normalization the
15986
+ * backend uses: an unrecognized `mediaType` falls back to the MIME `type` and then to
15987
+ * `"image"`, `endDate` defaults to `null`, and `order` mirrors `sortOrder`.
15988
+ * @param rawCampaign API response data for a campaign.
15989
+ */
15990
+ function Campaign(rawCampaign) {
15991
+ var _rawCampaign$endDate, _rawCampaign$endTime, _ref, _rawCampaign$sortOrde, _rawCampaign$images, _rawCampaign$schedule;
15992
+ campaign_classCallCheck(this, Campaign);
15993
+ this.id = rawCampaign.id;
15994
+ this.name = rawCampaign.name;
15995
+ this.status = rawCampaign.status;
15996
+ this.startDate = rawCampaign.startDate;
15997
+ this.endDate = (_rawCampaign$endDate = rawCampaign.endDate) !== null && _rawCampaign$endDate !== void 0 ? _rawCampaign$endDate : null;
15998
+ this.startTime = rawCampaign.startTime;
15999
+ this.endTime = (_rawCampaign$endTime = rawCampaign.endTime) !== null && _rawCampaign$endTime !== void 0 ? _rawCampaign$endTime : null;
16000
+ var sortOrder = (_ref = (_rawCampaign$sortOrde = rawCampaign.sortOrder) !== null && _rawCampaign$sortOrde !== void 0 ? _rawCampaign$sortOrde : rawCampaign.order) !== null && _ref !== void 0 ? _ref : 0;
16001
+ this.sortOrder = sortOrder;
16002
+ this.order = sortOrder;
16003
+ this.images = ((_rawCampaign$images = rawCampaign.images) !== null && _rawCampaign$images !== void 0 ? _rawCampaign$images : []).map(function (image) {
16004
+ var _image$durationSecond, _image$alt;
16005
+ return {
16006
+ orientation: image.orientation,
16007
+ order: image.order,
16008
+ mediaType: resolveMediaType(image.mediaType, image.type),
16009
+ durationSeconds: (_image$durationSecond = image.durationSeconds) !== null && _image$durationSecond !== void 0 ? _image$durationSecond : null,
16010
+ url: image.url,
16011
+ type: image.type,
16012
+ alt: (_image$alt = image.alt) !== null && _image$alt !== void 0 ? _image$alt : []
16013
+ };
16014
+ });
16015
+ this.schedules = ((_rawCampaign$schedule = rawCampaign.schedules) !== null && _rawCampaign$schedule !== void 0 ? _rawCampaign$schedule : []).map(function (schedule) {
16016
+ return {
16017
+ dayOfWeek: schedule.dayOfWeek,
16018
+ startTime: schedule.startTime,
16019
+ endTime: schedule.endTime
16020
+ };
16021
+ });
16022
+ });
15907
16023
  ;// ./src/domain/models/institution.ts
15908
16024
  function institution_typeof(o) { "@babel/helpers - typeof"; return institution_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, institution_typeof(o); }
15909
16025
  function institution_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, institution_toPropertyKey(o.key), o); } }
@@ -16109,7 +16225,7 @@ function normalizeBaseUrl(url) {
16109
16225
  */
16110
16226
  var Requester = /*#__PURE__*/function () {
16111
16227
  function Requester(lang) {
16112
- var _endpoints$routeApiUr, _endpoints$healthApiU, _endpoints$legacyApiU;
16228
+ var _endpoints$portalApiU, _endpoints$routeApiUr, _endpoints$healthApiU, _endpoints$legacyApiU;
16113
16229
  var apiUrl = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "https://public-api.mapvx.com";
16114
16230
  var mapvxRequestContext = arguments.length > 2 ? arguments[2] : undefined;
16115
16231
  var endpoints = arguments.length > 3 ? arguments[3] : undefined;
@@ -16117,8 +16233,15 @@ var Requester = /*#__PURE__*/function () {
16117
16233
  this.lang = lang;
16118
16234
  this.mapvxRequestContext = mapvxRequestContext;
16119
16235
  var cleanApiUrl = normalizeBaseUrl(apiUrl);
16236
+ // The `/api/sdk/v2` (api-key) and `/api/portal` (bearer) surfaces can live on
16237
+ // different hosts (e.g. split local backends); `endpoints.portalApiUrl` overrides
16238
+ // the portal host, defaulting to the sdk host when omitted.
16239
+ // `?.trim() ||` for the same reason as the three hosts below: a blank/whitespace
16240
+ // override must fall back to `apiUrl`, not build `https:// /api/portal/`.
16241
+ var portalOverride = endpoints === null || endpoints === void 0 || (_endpoints$portalApiU = endpoints.portalApiUrl) === null || _endpoints$portalApiU === void 0 ? void 0 : _endpoints$portalApiU.trim();
16242
+ var cleanPortalUrl = portalOverride ? normalizeBaseUrl(portalOverride) : cleanApiUrl;
16120
16243
  this.baseUrl = "".concat(cleanApiUrl, "/api/sdk/v2/");
16121
- this.baseUrlPortal = "".concat(cleanApiUrl, "/api/portal/");
16244
+ this.baseUrlPortal = "".concat(cleanPortalUrl, "/api/portal/");
16122
16245
  // Routing, health and legacy-transport endpoints live on a different host
16123
16246
  // than `apiUrl` in production (api.mapvx.com vs public-api.mapvx.com), so
16124
16247
  // they default to that host and can each be overridden independently — an
@@ -16277,17 +16400,47 @@ var Requester = /*#__PURE__*/function () {
16277
16400
  }
16278
16401
  return fetchStops;
16279
16402
  }()
16403
+ /**
16404
+ * Adds the map-style selection params shared by {@link fetchMapStyle} and
16405
+ * {@link fetchMapStyleByBearer}.
16406
+ *
16407
+ * The theme goes under `styleTheme` (camelCase) while the place and style ref go
16408
+ * under `place_id` / `style_ref`. The mixed casing is the server's actual contract,
16409
+ * not an oversight: `FormInput.styleTheme` predates the snake_case params added
16410
+ * alongside `style_ref` (backend-mono `seedwork/infrastructure/validation.ts`).
16411
+ * Do not "fix" the casing here — `style_theme` is read by nothing.
16412
+ *
16413
+ * @param params Query params object to extend in place.
16414
+ * @param placeId Optional place whose assigned style should be resolved.
16415
+ * @param styleRef Optional explicit style reference, bypassing the place's style.
16416
+ * @param styleTheme Optional theme (`"light"` | `"dark"`).
16417
+ */
16418
+ )
16419
+ }, {
16420
+ key: "applyMapStyleParams",
16421
+ value: function applyMapStyleParams(params, placeId, styleRef, styleTheme) {
16422
+ if (placeId != null) {
16423
+ params.place_id = placeId;
16424
+ }
16425
+ // Preview an explicit style ref / theme, bypassing the place's assigned style.
16426
+ if (styleRef != null) {
16427
+ params.style_ref = styleRef;
16428
+ }
16429
+ if (styleTheme != null) {
16430
+ params.styleTheme = styleTheme;
16431
+ }
16432
+ }
16433
+
16280
16434
  /**
16281
16435
  *
16282
16436
  * @param token Client identification
16283
16437
  * @param placeId
16284
16438
  * @returns Response promise
16285
16439
  */
16286
- )
16287
16440
  }, {
16288
16441
  key: "fetchMapStyle",
16289
16442
  value: (function () {
16290
- var _fetchMapStyle = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee4(token, placeId) {
16443
+ var _fetchMapStyle = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee4(token, placeId, styleRef, styleTheme) {
16291
16444
  var options, params;
16292
16445
  return requester_regenerator().w(function (_context4) {
16293
16446
  while (1) switch (_context4.n) {
@@ -16302,18 +16455,51 @@ var Requester = /*#__PURE__*/function () {
16302
16455
  params = {
16303
16456
  lang: this.lang
16304
16457
  };
16305
- if (placeId != null) {
16306
- params.place_id = placeId;
16307
- }
16458
+ this.applyMapStyleParams(params, placeId, styleRef, styleTheme);
16308
16459
  return _context4.a(2, this.fetchFromUrl(this.baseUrl + "mapStyleJson", params, options));
16309
16460
  }
16310
16461
  }, _callee4, this);
16311
16462
  }));
16312
- function fetchMapStyle(_x9, _x0) {
16463
+ function fetchMapStyle(_x9, _x0, _x1, _x10) {
16313
16464
  return _fetchMapStyle.apply(this, arguments);
16314
16465
  }
16315
16466
  return fetchMapStyle;
16316
16467
  }()
16468
+ /**
16469
+ * Bearer-authenticated variant of {@link fetchMapStyle}: resolves the style JSON
16470
+ * using the logged-in user's token, so access is authorized by the user's client
16471
+ * permissions rather than the api key's scopes. Same query contract
16472
+ * (`place_id`, `style_ref`, `styleTheme`).
16473
+ */
16474
+ )
16475
+ }, {
16476
+ key: "fetchMapStyleByBearer",
16477
+ value: (function () {
16478
+ var _fetchMapStyleByBearer = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee5(authToken, placeId, styleRef, styleTheme) {
16479
+ var options, params;
16480
+ return requester_regenerator().w(function (_context5) {
16481
+ while (1) switch (_context5.n) {
16482
+ case 0:
16483
+ options = {
16484
+ method: "GET",
16485
+ headers: {
16486
+ "content-type": "application/json",
16487
+ Authorization: "Bearer ".concat(authToken)
16488
+ }
16489
+ };
16490
+ params = {
16491
+ lang: this.lang
16492
+ };
16493
+ this.applyMapStyleParams(params, placeId, styleRef, styleTheme);
16494
+ return _context5.a(2, this.fetchFromUrl(this.baseUrlPortal + "mapStyleJson", params, options));
16495
+ }
16496
+ }, _callee5, this);
16497
+ }));
16498
+ function fetchMapStyleByBearer(_x11, _x12, _x13, _x14) {
16499
+ return _fetchMapStyleByBearer.apply(this, arguments);
16500
+ }
16501
+ return fetchMapStyleByBearer;
16502
+ }()
16317
16503
  /**
16318
16504
  * Fetches the map style configuration for a specified institution.
16319
16505
  * Can be used to obtain any map style from an Institution, without the limitation of the ApiKey.
@@ -16330,10 +16516,10 @@ var Requester = /*#__PURE__*/function () {
16330
16516
  }, {
16331
16517
  key: "fetchAnyMapStyle",
16332
16518
  value: (function () {
16333
- var _fetchAnyMapStyle = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee5(authToken, institutionId) {
16519
+ var _fetchAnyMapStyle = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee6(authToken, institutionId) {
16334
16520
  var options, params;
16335
- return requester_regenerator().w(function (_context5) {
16336
- while (1) switch (_context5.n) {
16521
+ return requester_regenerator().w(function (_context6) {
16522
+ while (1) switch (_context6.n) {
16337
16523
  case 0:
16338
16524
  options = {
16339
16525
  method: "GET",
@@ -16346,11 +16532,11 @@ var Requester = /*#__PURE__*/function () {
16346
16532
  lang: this.lang,
16347
16533
  institution_id: institutionId
16348
16534
  };
16349
- return _context5.a(2, this.fetchFromUrl(this.baseUrlPortal + "mapStyle", params, options));
16535
+ return _context6.a(2, this.fetchFromUrl(this.baseUrlPortal + "mapStyle", params, options));
16350
16536
  }
16351
- }, _callee5, this);
16537
+ }, _callee6, this);
16352
16538
  }));
16353
- function fetchAnyMapStyle(_x1, _x10) {
16539
+ function fetchAnyMapStyle(_x15, _x16) {
16354
16540
  return _fetchAnyMapStyle.apply(this, arguments);
16355
16541
  }
16356
16542
  return fetchAnyMapStyle;
@@ -16364,10 +16550,10 @@ var Requester = /*#__PURE__*/function () {
16364
16550
  }, {
16365
16551
  key: "fetchAllowedPlaces",
16366
16552
  value: (function () {
16367
- var _fetchAllowedPlaces = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee6(token) {
16553
+ var _fetchAllowedPlaces = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee7(token) {
16368
16554
  var options, params;
16369
- return requester_regenerator().w(function (_context6) {
16370
- while (1) switch (_context6.n) {
16555
+ return requester_regenerator().w(function (_context7) {
16556
+ while (1) switch (_context7.n) {
16371
16557
  case 0:
16372
16558
  options = {
16373
16559
  method: "GET",
@@ -16379,11 +16565,11 @@ var Requester = /*#__PURE__*/function () {
16379
16565
  params = {
16380
16566
  lang: this.lang
16381
16567
  };
16382
- return _context6.a(2, this.fetchFromUrl(this.baseUrl + "availablePlaces", params, options));
16568
+ return _context7.a(2, this.fetchFromUrl(this.baseUrl + "availablePlaces", params, options));
16383
16569
  }
16384
- }, _callee6, this);
16570
+ }, _callee7, this);
16385
16571
  }));
16386
- function fetchAllowedPlaces(_x11) {
16572
+ function fetchAllowedPlaces(_x17) {
16387
16573
  return _fetchAllowedPlaces.apply(this, arguments);
16388
16574
  }
16389
16575
  return fetchAllowedPlaces;
@@ -16402,10 +16588,10 @@ var Requester = /*#__PURE__*/function () {
16402
16588
  }, {
16403
16589
  key: "fetchPlacesFromAnyInstitution",
16404
16590
  value: (function () {
16405
- var _fetchPlacesFromAnyInstitution = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee7(institutionId, authToken) {
16591
+ var _fetchPlacesFromAnyInstitution = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee8(institutionId, authToken) {
16406
16592
  var options, params;
16407
- return requester_regenerator().w(function (_context7) {
16408
- while (1) switch (_context7.n) {
16593
+ return requester_regenerator().w(function (_context8) {
16594
+ while (1) switch (_context8.n) {
16409
16595
  case 0:
16410
16596
  options = {
16411
16597
  method: "GET",
@@ -16418,11 +16604,11 @@ var Requester = /*#__PURE__*/function () {
16418
16604
  institution_id: institutionId,
16419
16605
  lang: this.lang
16420
16606
  };
16421
- return _context7.a(2, this.fetchFromUrl(this.baseUrlPortal + "availablePlaces", params, options));
16607
+ return _context8.a(2, this.fetchFromUrl(this.baseUrlPortal + "availablePlaces", params, options));
16422
16608
  }
16423
- }, _callee7, this);
16609
+ }, _callee8, this);
16424
16610
  }));
16425
- function fetchPlacesFromAnyInstitution(_x12, _x13) {
16611
+ function fetchPlacesFromAnyInstitution(_x18, _x19) {
16426
16612
  return _fetchPlacesFromAnyInstitution.apply(this, arguments);
16427
16613
  }
16428
16614
  return fetchPlacesFromAnyInstitution;
@@ -16444,10 +16630,10 @@ var Requester = /*#__PURE__*/function () {
16444
16630
  }, {
16445
16631
  key: "fetchPlaceDetail",
16446
16632
  value: (function () {
16447
- var _fetchPlaceDetail = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee8(token, placeId, buildingId, floorId, level) {
16633
+ var _fetchPlaceDetail = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee9(token, placeId, buildingId, floorId, level) {
16448
16634
  var options, params;
16449
- return requester_regenerator().w(function (_context8) {
16450
- while (1) switch (_context8.n) {
16635
+ return requester_regenerator().w(function (_context9) {
16636
+ while (1) switch (_context9.n) {
16451
16637
  case 0:
16452
16638
  options = {
16453
16639
  method: "GET",
@@ -16468,11 +16654,11 @@ var Requester = /*#__PURE__*/function () {
16468
16654
  } else if (level !== undefined) {
16469
16655
  params.floor = level;
16470
16656
  }
16471
- return _context8.a(2, this.fetchFromUrl(this.baseUrl + "place", params, options));
16657
+ return _context9.a(2, this.fetchFromUrl(this.baseUrl + "place", params, options));
16472
16658
  }
16473
- }, _callee8, this);
16659
+ }, _callee9, this);
16474
16660
  }));
16475
- function fetchPlaceDetail(_x14, _x15, _x16, _x17, _x18) {
16661
+ function fetchPlaceDetail(_x20, _x21, _x22, _x23, _x24) {
16476
16662
  return _fetchPlaceDetail.apply(this, arguments);
16477
16663
  }
16478
16664
  return fetchPlaceDetail;
@@ -16498,10 +16684,10 @@ var Requester = /*#__PURE__*/function () {
16498
16684
  }, {
16499
16685
  key: "fetchAnyPlaceDetail",
16500
16686
  value: (function () {
16501
- var _fetchAnyPlaceDetail = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee9(authToken, placeId, buildingId, floorId, level) {
16687
+ var _fetchAnyPlaceDetail = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee0(authToken, placeId, buildingId, floorId, level) {
16502
16688
  var options, params;
16503
- return requester_regenerator().w(function (_context9) {
16504
- while (1) switch (_context9.n) {
16689
+ return requester_regenerator().w(function (_context0) {
16690
+ while (1) switch (_context0.n) {
16505
16691
  case 0:
16506
16692
  options = {
16507
16693
  method: "GET",
@@ -16522,11 +16708,11 @@ var Requester = /*#__PURE__*/function () {
16522
16708
  } else if (level !== undefined) {
16523
16709
  params.floor = level;
16524
16710
  }
16525
- return _context9.a(2, this.fetchFromUrl(this.baseUrlPortal + "place", params, options));
16711
+ return _context0.a(2, this.fetchFromUrl(this.baseUrlPortal + "place", params, options));
16526
16712
  }
16527
- }, _callee9, this);
16713
+ }, _callee0, this);
16528
16714
  }));
16529
- function fetchAnyPlaceDetail(_x19, _x20, _x21, _x22, _x23) {
16715
+ function fetchAnyPlaceDetail(_x25, _x26, _x27, _x28, _x29) {
16530
16716
  return _fetchAnyPlaceDetail.apply(this, arguments);
16531
16717
  }
16532
16718
  return fetchAnyPlaceDetail;
@@ -16541,10 +16727,10 @@ var Requester = /*#__PURE__*/function () {
16541
16727
  }, {
16542
16728
  key: "fetchSubPlaces",
16543
16729
  value: (function () {
16544
- var _fetchSubPlaces = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee0(targetPlaceId, token) {
16730
+ var _fetchSubPlaces = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee1(targetPlaceId, token) {
16545
16731
  var options, params;
16546
- return requester_regenerator().w(function (_context0) {
16547
- while (1) switch (_context0.n) {
16732
+ return requester_regenerator().w(function (_context1) {
16733
+ while (1) switch (_context1.n) {
16548
16734
  case 0:
16549
16735
  options = {
16550
16736
  method: "GET",
@@ -16557,11 +16743,11 @@ var Requester = /*#__PURE__*/function () {
16557
16743
  targetPlace: targetPlaceId,
16558
16744
  lang: this.lang
16559
16745
  };
16560
- return _context0.a(2, this.fetchFromUrl(this.baseUrl + "subPlaces", params, options));
16746
+ return _context1.a(2, this.fetchFromUrl(this.baseUrl + "subPlaces", params, options));
16561
16747
  }
16562
- }, _callee0, this);
16748
+ }, _callee1, this);
16563
16749
  }));
16564
- function fetchSubPlaces(_x24, _x25) {
16750
+ function fetchSubPlaces(_x30, _x31) {
16565
16751
  return _fetchSubPlaces.apply(this, arguments);
16566
16752
  }
16567
16753
  return fetchSubPlaces;
@@ -16582,10 +16768,10 @@ var Requester = /*#__PURE__*/function () {
16582
16768
  }, {
16583
16769
  key: "fetchAnySubPlaces",
16584
16770
  value: (function () {
16585
- var _fetchAnySubPlaces = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee1(targetPlaceId, authToken) {
16771
+ var _fetchAnySubPlaces = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee10(targetPlaceId, authToken) {
16586
16772
  var options, params;
16587
- return requester_regenerator().w(function (_context1) {
16588
- while (1) switch (_context1.n) {
16773
+ return requester_regenerator().w(function (_context10) {
16774
+ while (1) switch (_context10.n) {
16589
16775
  case 0:
16590
16776
  options = {
16591
16777
  method: "GET",
@@ -16598,11 +16784,11 @@ var Requester = /*#__PURE__*/function () {
16598
16784
  place_id: targetPlaceId,
16599
16785
  lang: this.lang
16600
16786
  };
16601
- return _context1.a(2, this.fetchFromUrl(this.baseUrlPortal + "subPlaces", params, options));
16787
+ return _context10.a(2, this.fetchFromUrl(this.baseUrlPortal + "subPlaces", params, options));
16602
16788
  }
16603
- }, _callee1, this);
16789
+ }, _callee10, this);
16604
16790
  }));
16605
- function fetchAnySubPlaces(_x26, _x27) {
16791
+ function fetchAnySubPlaces(_x32, _x33) {
16606
16792
  return _fetchAnySubPlaces.apply(this, arguments);
16607
16793
  }
16608
16794
  return fetchAnySubPlaces;
@@ -16706,10 +16892,10 @@ var Requester = /*#__PURE__*/function () {
16706
16892
  }, {
16707
16893
  key: "fetchRoute",
16708
16894
  value: (function () {
16709
- var _fetchRoute = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee10(routeConfig, token) {
16895
+ var _fetchRoute = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee11(routeConfig, token) {
16710
16896
  var options, cleanParams;
16711
- return requester_regenerator().w(function (_context10) {
16712
- while (1) switch (_context10.n) {
16897
+ return requester_regenerator().w(function (_context11) {
16898
+ while (1) switch (_context11.n) {
16713
16899
  case 0:
16714
16900
  options = {
16715
16901
  method: "GET",
@@ -16719,11 +16905,11 @@ var Requester = /*#__PURE__*/function () {
16719
16905
  }
16720
16906
  };
16721
16907
  cleanParams = this.buildRouteParams(routeConfig);
16722
- return _context10.a(2, this.fetchFromUrl(this.routeBaseUrl + "route", cleanParams, options));
16908
+ return _context11.a(2, this.fetchFromUrl(this.routeBaseUrl + "route", cleanParams, options));
16723
16909
  }
16724
- }, _callee10, this);
16910
+ }, _callee11, this);
16725
16911
  }));
16726
- function fetchRoute(_x28, _x29) {
16912
+ function fetchRoute(_x34, _x35) {
16727
16913
  return _fetchRoute.apply(this, arguments);
16728
16914
  }
16729
16915
  return fetchRoute;
@@ -16737,10 +16923,10 @@ var Requester = /*#__PURE__*/function () {
16737
16923
  }, {
16738
16924
  key: "fetchRouteV2",
16739
16925
  value: (function () {
16740
- var _fetchRouteV = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee11(routeConfig, token) {
16926
+ var _fetchRouteV = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee12(routeConfig, token) {
16741
16927
  var options, cleanParams;
16742
- return requester_regenerator().w(function (_context11) {
16743
- while (1) switch (_context11.n) {
16928
+ return requester_regenerator().w(function (_context12) {
16929
+ while (1) switch (_context12.n) {
16744
16930
  case 0:
16745
16931
  options = {
16746
16932
  method: "GET",
@@ -16750,11 +16936,11 @@ var Requester = /*#__PURE__*/function () {
16750
16936
  }
16751
16937
  };
16752
16938
  cleanParams = this.buildRouteParams(routeConfig);
16753
- return _context11.a(2, this.fetchFromUrl(this.routeBaseUrl + "v2/route", cleanParams, options));
16939
+ return _context12.a(2, this.fetchFromUrl(this.routeBaseUrl + "v2/route", cleanParams, options));
16754
16940
  }
16755
- }, _callee11, this);
16941
+ }, _callee12, this);
16756
16942
  }));
16757
- function fetchRouteV2(_x30, _x31) {
16943
+ function fetchRouteV2(_x36, _x37) {
16758
16944
  return _fetchRouteV.apply(this, arguments);
16759
16945
  }
16760
16946
  return fetchRouteV2;
@@ -16768,10 +16954,10 @@ var Requester = /*#__PURE__*/function () {
16768
16954
  }, {
16769
16955
  key: "fetchLiveRoute",
16770
16956
  value: (function () {
16771
- var _fetchLiveRoute = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee12(routeConfig, token) {
16957
+ var _fetchLiveRoute = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee13(routeConfig, token) {
16772
16958
  var options, cleanParams;
16773
- return requester_regenerator().w(function (_context12) {
16774
- while (1) switch (_context12.n) {
16959
+ return requester_regenerator().w(function (_context13) {
16960
+ while (1) switch (_context13.n) {
16775
16961
  case 0:
16776
16962
  options = {
16777
16963
  method: "GET",
@@ -16781,11 +16967,11 @@ var Requester = /*#__PURE__*/function () {
16781
16967
  }
16782
16968
  };
16783
16969
  cleanParams = this.buildRouteParams(routeConfig);
16784
- return _context12.a(2, this.fetchFromUrl(this.routeBaseUrl + "liveroute", cleanParams, options));
16970
+ return _context13.a(2, this.fetchFromUrl(this.routeBaseUrl + "liveroute", cleanParams, options));
16785
16971
  }
16786
- }, _callee12, this);
16972
+ }, _callee13, this);
16787
16973
  }));
16788
- function fetchLiveRoute(_x32, _x33) {
16974
+ function fetchLiveRoute(_x38, _x39) {
16789
16975
  return _fetchLiveRoute.apply(this, arguments);
16790
16976
  }
16791
16977
  return fetchLiveRoute;
@@ -16801,10 +16987,10 @@ var Requester = /*#__PURE__*/function () {
16801
16987
  }, {
16802
16988
  key: "fetchInstitutions",
16803
16989
  value: (function () {
16804
- var _fetchInstitutions = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee13(token) {
16990
+ var _fetchInstitutions = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee14(token) {
16805
16991
  var options, params;
16806
- return requester_regenerator().w(function (_context13) {
16807
- while (1) switch (_context13.n) {
16992
+ return requester_regenerator().w(function (_context14) {
16993
+ while (1) switch (_context14.n) {
16808
16994
  case 0:
16809
16995
  options = {
16810
16996
  method: "GET",
@@ -16816,11 +17002,11 @@ var Requester = /*#__PURE__*/function () {
16816
17002
  params = {
16817
17003
  lang: this.lang
16818
17004
  };
16819
- return _context13.a(2, this.fetchFromUrl(this.baseUrl + "institution", params, options));
17005
+ return _context14.a(2, this.fetchFromUrl(this.baseUrl + "institution", params, options));
16820
17006
  }
16821
- }, _callee13, this);
17007
+ }, _callee14, this);
16822
17008
  }));
16823
- function fetchInstitutions(_x34) {
17009
+ function fetchInstitutions(_x40) {
16824
17010
  return _fetchInstitutions.apply(this, arguments);
16825
17011
  }
16826
17012
  return fetchInstitutions;
@@ -16841,10 +17027,10 @@ var Requester = /*#__PURE__*/function () {
16841
17027
  }, {
16842
17028
  key: "fetchSearchResults",
16843
17029
  value: (function () {
16844
- var _fetchSearchResults = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee14(institutionId, input, token, parentIds, origin, lat, lng, floor) {
17030
+ var _fetchSearchResults = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee15(institutionId, input, token, parentIds, origin, lat, lng, floor) {
16845
17031
  var options, params;
16846
- return requester_regenerator().w(function (_context14) {
16847
- while (1) switch (_context14.n) {
17032
+ return requester_regenerator().w(function (_context15) {
17033
+ while (1) switch (_context15.n) {
16848
17034
  case 0:
16849
17035
  options = {
16850
17036
  method: "GET",
@@ -16873,11 +17059,11 @@ var Requester = /*#__PURE__*/function () {
16873
17059
  if (floor) {
16874
17060
  params.floor = floor;
16875
17061
  }
16876
- return _context14.a(2, this.fetchFromUrl(this.baseUrl + "searchPlacesWithFilters", params, options));
17062
+ return _context15.a(2, this.fetchFromUrl(this.baseUrl + "searchPlacesWithFilters", params, options));
16877
17063
  }
16878
- }, _callee14, this);
17064
+ }, _callee15, this);
16879
17065
  }));
16880
- function fetchSearchResults(_x35, _x36, _x37, _x38, _x39, _x40, _x41, _x42) {
17066
+ function fetchSearchResults(_x41, _x42, _x43, _x44, _x45, _x46, _x47, _x48) {
16881
17067
  return _fetchSearchResults.apply(this, arguments);
16882
17068
  }
16883
17069
  return fetchSearchResults;
@@ -16904,10 +17090,10 @@ var Requester = /*#__PURE__*/function () {
16904
17090
  }, {
16905
17091
  key: "fetchSearchPlacesByTags",
16906
17092
  value: (function () {
16907
- var _fetchSearchPlacesByTags = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee15(institutionId, tags, token, parentPlaces, sort, origin, lat, lng, floor) {
17093
+ var _fetchSearchPlacesByTags = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee16(institutionId, tags, token, parentPlaces, sort, origin, lat, lng, floor) {
16908
17094
  var options, params;
16909
- return requester_regenerator().w(function (_context15) {
16910
- while (1) switch (_context15.n) {
17095
+ return requester_regenerator().w(function (_context16) {
17096
+ while (1) switch (_context16.n) {
16911
17097
  case 0:
16912
17098
  // The v2 endpoints authenticate via the Authorization header (Bearer),
16913
17099
  // not via a `token` query parameter like the legacy /api/sdk/* routes.
@@ -16941,11 +17127,11 @@ var Requester = /*#__PURE__*/function () {
16941
17127
  if (floor) {
16942
17128
  params.floor = floor;
16943
17129
  }
16944
- return _context15.a(2, this.fetchFromUrl(this.baseUrl + "searchPlacesByTags", params, options));
17130
+ return _context16.a(2, this.fetchFromUrl(this.baseUrl + "searchPlacesByTags", params, options));
16945
17131
  }
16946
- }, _callee15, this);
17132
+ }, _callee16, this);
16947
17133
  }));
16948
- function fetchSearchPlacesByTags(_x43, _x44, _x45, _x46, _x47, _x48, _x49, _x50, _x51) {
17134
+ function fetchSearchPlacesByTags(_x49, _x50, _x51, _x52, _x53, _x54, _x55, _x56, _x57) {
16949
17135
  return _fetchSearchPlacesByTags.apply(this, arguments);
16950
17136
  }
16951
17137
  return fetchSearchPlacesByTags;
@@ -16953,10 +17139,10 @@ var Requester = /*#__PURE__*/function () {
16953
17139
  }, {
16954
17140
  key: "fetchConfiguration",
16955
17141
  value: function () {
16956
- var _fetchConfiguration = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee16(token, place_id, product) {
17142
+ var _fetchConfiguration = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee17(token, place_id, product) {
16957
17143
  var options, params;
16958
- return requester_regenerator().w(function (_context16) {
16959
- while (1) switch (_context16.n) {
17144
+ return requester_regenerator().w(function (_context17) {
17145
+ while (1) switch (_context17.n) {
16960
17146
  case 0:
16961
17147
  options = {
16962
17148
  method: "GET",
@@ -16970,22 +17156,55 @@ var Requester = /*#__PURE__*/function () {
16970
17156
  };
16971
17157
  if (place_id) params.place_id = place_id;
16972
17158
  if (product) params.product = product;
16973
- return _context16.a(2, this.fetchFromUrl(this.baseUrl + "configuration", params, options));
17159
+ return _context17.a(2, this.fetchFromUrl(this.baseUrl + "configuration", params, options));
16974
17160
  }
16975
- }, _callee16, this);
17161
+ }, _callee17, this);
16976
17162
  }));
16977
- function fetchConfiguration(_x52, _x53, _x54) {
17163
+ function fetchConfiguration(_x58, _x59, _x60) {
16978
17164
  return _fetchConfiguration.apply(this, arguments);
16979
17165
  }
16980
17166
  return fetchConfiguration;
16981
17167
  }()
17168
+ /**
17169
+ * Fetches the campaigns configured for a maps-group (totem screensaver playlist).
17170
+ * `place_id` is the maps-group firebase id; `kiosk_id` optionally narrows to a
17171
+ * single totem. Uses the api-key (`/api/sdk/v2/`) surface.
17172
+ */
17173
+ }, {
17174
+ key: "fetchCampaigns",
17175
+ value: (function () {
17176
+ var _fetchCampaigns = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee18(token, place_id, kiosk_id) {
17177
+ var options, params;
17178
+ return requester_regenerator().w(function (_context18) {
17179
+ while (1) switch (_context18.n) {
17180
+ case 0:
17181
+ options = {
17182
+ method: "GET",
17183
+ headers: {
17184
+ "content-type": "application/json",
17185
+ Authorization: "Bearer ".concat(token)
17186
+ }
17187
+ };
17188
+ params = {
17189
+ placeId: place_id
17190
+ };
17191
+ if (kiosk_id) params.kioskId = kiosk_id;
17192
+ return _context18.a(2, this.fetchFromUrl(this.baseUrl + "campaigns", params, options));
17193
+ }
17194
+ }, _callee18, this);
17195
+ }));
17196
+ function fetchCampaigns(_x61, _x62, _x63) {
17197
+ return _fetchCampaigns.apply(this, arguments);
17198
+ }
17199
+ return fetchCampaigns;
17200
+ }())
16982
17201
  }, {
16983
17202
  key: "fetchCategories",
16984
17203
  value: function () {
16985
- var _fetchCategories = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee17(token, place_id) {
17204
+ var _fetchCategories = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee19(token, place_id) {
16986
17205
  var options, params;
16987
- return requester_regenerator().w(function (_context17) {
16988
- while (1) switch (_context17.n) {
17206
+ return requester_regenerator().w(function (_context19) {
17207
+ while (1) switch (_context19.n) {
16989
17208
  case 0:
16990
17209
  options = {
16991
17210
  method: "GET",
@@ -16998,11 +17217,11 @@ var Requester = /*#__PURE__*/function () {
16998
17217
  lang: this.lang
16999
17218
  };
17000
17219
  if (place_id) params.id = place_id;
17001
- return _context17.a(2, this.fetchFromUrl(this.baseUrl + "category", params, options));
17220
+ return _context19.a(2, this.fetchFromUrl(this.baseUrl + "category", params, options));
17002
17221
  }
17003
- }, _callee17, this);
17222
+ }, _callee19, this);
17004
17223
  }));
17005
- function fetchCategories(_x55, _x56) {
17224
+ function fetchCategories(_x64, _x65) {
17006
17225
  return _fetchCategories.apply(this, arguments);
17007
17226
  }
17008
17227
  return fetchCategories;
@@ -17010,10 +17229,10 @@ var Requester = /*#__PURE__*/function () {
17010
17229
  }, {
17011
17230
  key: "fetchRoutesForOrigin",
17012
17231
  value: function () {
17013
- var _fetchRoutesForOrigin = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee18(token, parentPlaceId, fromPlaceId, announceFormat, unitSystem, mode) {
17232
+ var _fetchRoutesForOrigin = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee20(token, parentPlaceId, fromPlaceId, announceFormat, unitSystem, mode) {
17014
17233
  var options, params;
17015
- return requester_regenerator().w(function (_context18) {
17016
- while (1) switch (_context18.n) {
17234
+ return requester_regenerator().w(function (_context20) {
17235
+ while (1) switch (_context20.n) {
17017
17236
  case 0:
17018
17237
  options = {
17019
17238
  method: "GET",
@@ -17030,11 +17249,11 @@ var Requester = /*#__PURE__*/function () {
17030
17249
  mode: mode,
17031
17250
  lang: this.lang
17032
17251
  };
17033
- return _context18.a(2, this.fetchFromUrl(this.routeBaseUrl + "routes_for_origin", params, options));
17252
+ return _context20.a(2, this.fetchFromUrl(this.routeBaseUrl + "routes_for_origin", params, options));
17034
17253
  }
17035
- }, _callee18, this);
17254
+ }, _callee20, this);
17036
17255
  }));
17037
- function fetchRoutesForOrigin(_x57, _x58, _x59, _x60, _x61, _x62) {
17256
+ function fetchRoutesForOrigin(_x66, _x67, _x68, _x69, _x70, _x71) {
17038
17257
  return _fetchRoutesForOrigin.apply(this, arguments);
17039
17258
  }
17040
17259
  return fetchRoutesForOrigin;
@@ -17042,10 +17261,10 @@ var Requester = /*#__PURE__*/function () {
17042
17261
  }, {
17043
17262
  key: "fetchCacheTimestamp",
17044
17263
  value: function () {
17045
- var _fetchCacheTimestamp = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee19(token, placeId) {
17264
+ var _fetchCacheTimestamp = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee21(token, placeId) {
17046
17265
  var options, params;
17047
- return requester_regenerator().w(function (_context19) {
17048
- while (1) switch (_context19.n) {
17266
+ return requester_regenerator().w(function (_context21) {
17267
+ while (1) switch (_context21.n) {
17049
17268
  case 0:
17050
17269
  options = {
17051
17270
  method: "GET",
@@ -17057,11 +17276,11 @@ var Requester = /*#__PURE__*/function () {
17057
17276
  params = {
17058
17277
  placeId: placeId
17059
17278
  };
17060
- return _context19.a(2, this.fetchFromUrl(this.routeBaseUrl + "cache_timestamp", params, options));
17279
+ return _context21.a(2, this.fetchFromUrl(this.routeBaseUrl + "cache_timestamp", params, options));
17061
17280
  }
17062
- }, _callee19, this);
17281
+ }, _callee21, this);
17063
17282
  }));
17064
- function fetchCacheTimestamp(_x63, _x64) {
17283
+ function fetchCacheTimestamp(_x72, _x73) {
17065
17284
  return _fetchCacheTimestamp.apply(this, arguments);
17066
17285
  }
17067
17286
  return fetchCacheTimestamp;
@@ -17069,10 +17288,10 @@ var Requester = /*#__PURE__*/function () {
17069
17288
  }, {
17070
17289
  key: "fetchCssCustomization",
17071
17290
  value: function () {
17072
- var _fetchCssCustomization = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee20(token, type) {
17291
+ var _fetchCssCustomization = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee22(token, type) {
17073
17292
  var options, params;
17074
- return requester_regenerator().w(function (_context20) {
17075
- while (1) switch (_context20.n) {
17293
+ return requester_regenerator().w(function (_context22) {
17294
+ while (1) switch (_context22.n) {
17076
17295
  case 0:
17077
17296
  options = {
17078
17297
  method: "GET",
@@ -17084,11 +17303,11 @@ var Requester = /*#__PURE__*/function () {
17084
17303
  params = {
17085
17304
  type: type
17086
17305
  };
17087
- return _context20.a(2, this.fetchFromUrl(this.baseUrl + "styles/customStyles", params, options));
17306
+ return _context22.a(2, this.fetchFromUrl(this.baseUrl + "styles/customStyles", params, options));
17088
17307
  }
17089
- }, _callee20, this);
17308
+ }, _callee22, this);
17090
17309
  }));
17091
- function fetchCssCustomization(_x65, _x66) {
17310
+ function fetchCssCustomization(_x74, _x75) {
17092
17311
  return _fetchCssCustomization.apply(this, arguments);
17093
17312
  }
17094
17313
  return fetchCssCustomization;
@@ -17096,10 +17315,10 @@ var Requester = /*#__PURE__*/function () {
17096
17315
  }, {
17097
17316
  key: "postHealth",
17098
17317
  value: function () {
17099
- var _postHealth = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee21(token, healthPingId, placeId, totemId, status) {
17318
+ var _postHealth = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee23(token, healthPingId, placeId, totemId, status) {
17100
17319
  var requestData, params, options;
17101
- return requester_regenerator().w(function (_context21) {
17102
- while (1) switch (_context21.n) {
17320
+ return requester_regenerator().w(function (_context23) {
17321
+ while (1) switch (_context23.n) {
17103
17322
  case 0:
17104
17323
  requestData = JSON.stringify({
17105
17324
  healthPingId: healthPingId,
@@ -17117,11 +17336,11 @@ var Requester = /*#__PURE__*/function () {
17117
17336
  },
17118
17337
  body: requestData
17119
17338
  };
17120
- return _context21.a(2, this.fetchFromUrl(this.baseUrlHealth, params, options));
17339
+ return _context23.a(2, this.fetchFromUrl(this.baseUrlHealth, params, options));
17121
17340
  }
17122
- }, _callee21, this);
17341
+ }, _callee23, this);
17123
17342
  }));
17124
- function postHealth(_x67, _x68, _x69, _x70, _x71) {
17343
+ function postHealth(_x76, _x77, _x78, _x79, _x80) {
17125
17344
  return _postHealth.apply(this, arguments);
17126
17345
  }
17127
17346
  return postHealth;
@@ -17163,6 +17382,7 @@ function repository_typeof(o) { "@babel/helpers - typeof"; return repository_typ
17163
17382
 
17164
17383
 
17165
17384
 
17385
+
17166
17386
  /**
17167
17387
  * Extracts a human-readable error message from an API error response body.
17168
17388
  * Handles various response formats: string, object with message/error field, or falls back to JSON.
@@ -17218,12 +17438,14 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
17218
17438
  }, {
17219
17439
  key: "fetchAndParseMapStyle",
17220
17440
  value: function () {
17221
- var _fetchAndParseMapStyle = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee(placeId) {
17222
- var response, errorBody, responseData, style, _t;
17441
+ var _fetchAndParseMapStyle = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee(placeId, styleRef, styleTheme) {
17442
+ var cacheable, response, errorBody, responseData, style, _t;
17223
17443
  return repository_regenerator().w(function (_context) {
17224
17444
  while (1) switch (_context.p = _context.n) {
17225
17445
  case 0:
17226
- if (!(placeId === undefined && this.baseStyle)) {
17446
+ // `baseStyle` caches only the default (no place, no explicit preview ref/theme).
17447
+ cacheable = placeId === undefined && styleRef === undefined && styleTheme === undefined;
17448
+ if (!(cacheable && this.baseStyle)) {
17227
17449
  _context.n = 1;
17228
17450
  break;
17229
17451
  }
@@ -17231,7 +17453,7 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
17231
17453
  case 1:
17232
17454
  _context.p = 1;
17233
17455
  _context.n = 2;
17234
- return this.requester.fetchMapStyle(this.token, placeId);
17456
+ return this.requester.fetchMapStyle(this.token, placeId, styleRef, styleTheme);
17235
17457
  case 2:
17236
17458
  response = _context.v;
17237
17459
  if (response.ok) {
@@ -17249,7 +17471,7 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
17249
17471
  case 5:
17250
17472
  responseData = _context.v;
17251
17473
  style = responseData.style;
17252
- if (placeId === undefined) {
17474
+ if (cacheable) {
17253
17475
  this.baseStyle = style;
17254
17476
  }
17255
17477
  this.logEvent("fetchAndParseMapStyle");
@@ -17268,22 +17490,28 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
17268
17490
  }
17269
17491
  }, _callee, this, [[1, 6]]);
17270
17492
  }));
17271
- function fetchAndParseMapStyle(_x) {
17493
+ function fetchAndParseMapStyle(_x, _x2, _x3) {
17272
17494
  return _fetchAndParseMapStyle.apply(this, arguments);
17273
17495
  }
17274
17496
  return fetchAndParseMapStyle;
17275
17497
  }()
17498
+ /**
17499
+ * Bearer-authenticated style fetch: resolves a style by explicit ref/theme for
17500
+ * a place through the bearer map style endpoint, authorized by the user's
17501
+ * client access instead of the api key's scopes. Mirrors
17502
+ * {@link fetchAndParseMapStyle} but with a user bearer token.
17503
+ */
17276
17504
  }, {
17277
- key: "fetchAndParseAnyMapStyle",
17278
- value: function () {
17279
- var _fetchAndParseAnyMapStyle = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee2(institutionId, authToken) {
17505
+ key: "fetchAndParseMapStyleByBearer",
17506
+ value: (function () {
17507
+ var _fetchAndParseMapStyleByBearer = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee2(placeId, authToken, styleRef, styleTheme) {
17280
17508
  var response, errorBody, responseData, style, _t2;
17281
17509
  return repository_regenerator().w(function (_context2) {
17282
17510
  while (1) switch (_context2.p = _context2.n) {
17283
17511
  case 0:
17284
17512
  _context2.p = 0;
17285
17513
  _context2.n = 1;
17286
- return this.requester.fetchAnyMapStyle(authToken, institutionId);
17514
+ return this.requester.fetchMapStyleByBearer(authToken, placeId, styleRef, styleTheme);
17287
17515
  case 1:
17288
17516
  response = _context2.v;
17289
17517
  if (response.ok) {
@@ -17301,13 +17529,13 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
17301
17529
  case 4:
17302
17530
  responseData = _context2.v;
17303
17531
  style = responseData.style;
17304
- this.logEvent("fetchAndParseAnyMapStyle");
17532
+ this.logEvent("fetchAndParseMapStyleByBearer");
17305
17533
  return _context2.a(2, style);
17306
17534
  case 5:
17307
17535
  _context2.p = 5;
17308
17536
  _t2 = _context2.v;
17309
17537
  this.logError(_t2, {
17310
- functionName: "fetchAndParseAnyMapStyle"
17538
+ functionName: "fetchAndParseMapStyleByBearer"
17311
17539
  });
17312
17540
  throw new Error("Failed to fetch and parse map style with bearer token", {
17313
17541
  cause: _t2
@@ -17317,22 +17545,22 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
17317
17545
  }
17318
17546
  }, _callee2, this, [[0, 5]]);
17319
17547
  }));
17320
- function fetchAndParseAnyMapStyle(_x2, _x3) {
17321
- return _fetchAndParseAnyMapStyle.apply(this, arguments);
17548
+ function fetchAndParseMapStyleByBearer(_x4, _x5, _x6, _x7) {
17549
+ return _fetchAndParseMapStyleByBearer.apply(this, arguments);
17322
17550
  }
17323
- return fetchAndParseAnyMapStyle;
17324
- }()
17551
+ return fetchAndParseMapStyleByBearer;
17552
+ }())
17325
17553
  }, {
17326
- key: "fetchAndParseInstitutions",
17554
+ key: "fetchAndParseAnyMapStyle",
17327
17555
  value: function () {
17328
- var _fetchAndParseInstitutions = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee3() {
17329
- var response, errorBody, responseData, institutions, _iterator, _step, institutionData, institution, resultInstitution, _t3;
17556
+ var _fetchAndParseAnyMapStyle = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee3(institutionId, authToken) {
17557
+ var response, errorBody, responseData, style, _t3;
17330
17558
  return repository_regenerator().w(function (_context3) {
17331
17559
  while (1) switch (_context3.p = _context3.n) {
17332
17560
  case 0:
17333
17561
  _context3.p = 0;
17334
17562
  _context3.n = 1;
17335
- return this.requester.fetchInstitutions(this.token);
17563
+ return this.requester.fetchAnyMapStyle(authToken, institutionId);
17336
17564
  case 1:
17337
17565
  response = _context3.v;
17338
17566
  if (response.ok) {
@@ -17349,47 +17577,96 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
17349
17577
  return response.json();
17350
17578
  case 4:
17351
17579
  responseData = _context3.v;
17352
- institutions = [];
17353
- _iterator = repository_createForOfIteratorHelper(responseData);
17354
- try {
17355
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
17356
- institutionData = _step.value;
17357
- institution = new Institution(institutionData);
17358
- institutions.push(institution);
17359
- }
17360
- } catch (err) {
17361
- _iterator.e(err);
17362
- } finally {
17363
- _iterator.f();
17364
- }
17365
- institutions.sort(function (a, b) {
17366
- return a.title.localeCompare(b.title);
17367
- });
17368
- resultInstitution = institutions;
17369
- if (!resultInstitution) {
17370
- _context3.n = 5;
17371
- break;
17372
- }
17373
- this.logEvent("fetchAndParseInstitutionsV2");
17374
- return _context3.a(2, resultInstitution);
17580
+ style = responseData.style;
17581
+ this.logEvent("fetchAndParseAnyMapStyle");
17582
+ return _context3.a(2, style);
17375
17583
  case 5:
17376
- throw new Error("No institutions associated to this apiKey");
17377
- case 6:
17378
- _context3.n = 8;
17379
- break;
17380
- case 7:
17381
- _context3.p = 7;
17584
+ _context3.p = 5;
17382
17585
  _t3 = _context3.v;
17383
17586
  this.logError(_t3, {
17384
- functionName: "fetchAndParseInstitutionsV2"
17587
+ functionName: "fetchAndParseAnyMapStyle"
17385
17588
  });
17386
- throw new Error("Failed to fetch and parse institution", {
17589
+ throw new Error("Failed to fetch and parse map style with bearer token", {
17387
17590
  cause: _t3
17388
17591
  });
17389
- case 8:
17592
+ case 6:
17390
17593
  return _context3.a(2);
17391
17594
  }
17392
- }, _callee3, this, [[0, 7]]);
17595
+ }, _callee3, this, [[0, 5]]);
17596
+ }));
17597
+ function fetchAndParseAnyMapStyle(_x8, _x9) {
17598
+ return _fetchAndParseAnyMapStyle.apply(this, arguments);
17599
+ }
17600
+ return fetchAndParseAnyMapStyle;
17601
+ }()
17602
+ }, {
17603
+ key: "fetchAndParseInstitutions",
17604
+ value: function () {
17605
+ var _fetchAndParseInstitutions = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee4() {
17606
+ var response, errorBody, responseData, institutions, _iterator, _step, institutionData, institution, resultInstitution, _t4;
17607
+ return repository_regenerator().w(function (_context4) {
17608
+ while (1) switch (_context4.p = _context4.n) {
17609
+ case 0:
17610
+ _context4.p = 0;
17611
+ _context4.n = 1;
17612
+ return this.requester.fetchInstitutions(this.token);
17613
+ case 1:
17614
+ response = _context4.v;
17615
+ if (response.ok) {
17616
+ _context4.n = 3;
17617
+ break;
17618
+ }
17619
+ _context4.n = 2;
17620
+ return response.json();
17621
+ case 2:
17622
+ errorBody = _context4.v;
17623
+ throw new Error("Fetch failed with status ".concat(response.status, ": ").concat(extractErrorMessage(errorBody)));
17624
+ case 3:
17625
+ _context4.n = 4;
17626
+ return response.json();
17627
+ case 4:
17628
+ responseData = _context4.v;
17629
+ institutions = [];
17630
+ _iterator = repository_createForOfIteratorHelper(responseData);
17631
+ try {
17632
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
17633
+ institutionData = _step.value;
17634
+ institution = new Institution(institutionData);
17635
+ institutions.push(institution);
17636
+ }
17637
+ } catch (err) {
17638
+ _iterator.e(err);
17639
+ } finally {
17640
+ _iterator.f();
17641
+ }
17642
+ institutions.sort(function (a, b) {
17643
+ return a.title.localeCompare(b.title);
17644
+ });
17645
+ resultInstitution = institutions;
17646
+ if (!resultInstitution) {
17647
+ _context4.n = 5;
17648
+ break;
17649
+ }
17650
+ this.logEvent("fetchAndParseInstitutionsV2");
17651
+ return _context4.a(2, resultInstitution);
17652
+ case 5:
17653
+ throw new Error("No institutions associated to this apiKey");
17654
+ case 6:
17655
+ _context4.n = 8;
17656
+ break;
17657
+ case 7:
17658
+ _context4.p = 7;
17659
+ _t4 = _context4.v;
17660
+ this.logError(_t4, {
17661
+ functionName: "fetchAndParseInstitutionsV2"
17662
+ });
17663
+ throw new Error("Failed to fetch and parse institution", {
17664
+ cause: _t4
17665
+ });
17666
+ case 8:
17667
+ return _context4.a(2);
17668
+ }
17669
+ }, _callee4, this, [[0, 7]]);
17393
17670
  }));
17394
17671
  function fetchAndParseInstitutions() {
17395
17672
  return _fetchAndParseInstitutions.apply(this, arguments);
@@ -17399,60 +17676,60 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
17399
17676
  }, {
17400
17677
  key: "fetchAndParsePlaceDetail",
17401
17678
  value: function () {
17402
- var _fetchAndParsePlaceDetail = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee4(query) {
17403
- var id, buildingId, floorId, level, cacheKey, cachedPlace, response, errorBody, responseData, place, _t4;
17404
- return repository_regenerator().w(function (_context4) {
17405
- while (1) switch (_context4.p = _context4.n) {
17679
+ var _fetchAndParsePlaceDetail = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee5(query) {
17680
+ var id, buildingId, floorId, level, cacheKey, cachedPlace, response, errorBody, responseData, place, _t5;
17681
+ return repository_regenerator().w(function (_context5) {
17682
+ while (1) switch (_context5.p = _context5.n) {
17406
17683
  case 0:
17407
- _context4.p = 0;
17684
+ _context5.p = 0;
17408
17685
  id = query.id, buildingId = query.buildingId, floorId = query.floorId, level = query.level;
17409
17686
  cacheKey = this.placeCacheKey(id, buildingId);
17410
17687
  cachedPlace = this.cache.getPlace(cacheKey, this.currentLang);
17411
17688
  if (!(cachedPlace != null)) {
17412
- _context4.n = 1;
17689
+ _context5.n = 1;
17413
17690
  break;
17414
17691
  }
17415
17692
  this.logEvent("fetchAndParsePlaceDetail", {
17416
17693
  cached: "true"
17417
17694
  });
17418
- return _context4.a(2, cachedPlace);
17695
+ return _context5.a(2, cachedPlace);
17419
17696
  case 1:
17420
- _context4.n = 2;
17697
+ _context5.n = 2;
17421
17698
  return this.requester.fetchPlaceDetail(this.token, id, buildingId, floorId, level);
17422
17699
  case 2:
17423
- response = _context4.v;
17700
+ response = _context5.v;
17424
17701
  if (response.ok) {
17425
- _context4.n = 4;
17702
+ _context5.n = 4;
17426
17703
  break;
17427
17704
  }
17428
- _context4.n = 3;
17705
+ _context5.n = 3;
17429
17706
  return response.json();
17430
17707
  case 3:
17431
- errorBody = _context4.v;
17708
+ errorBody = _context5.v;
17432
17709
  throw new Error("Fetch failed with status ".concat(response.status, ": ").concat(extractErrorMessage(errorBody)));
17433
17710
  case 4:
17434
- _context4.n = 5;
17711
+ _context5.n = 5;
17435
17712
  return response.json();
17436
17713
  case 5:
17437
- responseData = _context4.v;
17714
+ responseData = _context5.v;
17438
17715
  place = new MVXPlace(responseData);
17439
17716
  this.cachePlace(place, buildingId);
17440
17717
  this.logEvent("fetchAndParsePlaceDetail", {
17441
17718
  cached: "false"
17442
17719
  });
17443
- return _context4.a(2, place);
17720
+ return _context5.a(2, place);
17444
17721
  case 6:
17445
- _context4.p = 6;
17446
- _t4 = _context4.v;
17722
+ _context5.p = 6;
17723
+ _t5 = _context5.v;
17447
17724
  throw new Error("Failed to fetch and parse place detail", {
17448
- cause: _t4
17725
+ cause: _t5
17449
17726
  });
17450
17727
  case 7:
17451
- return _context4.a(2);
17728
+ return _context5.a(2);
17452
17729
  }
17453
- }, _callee4, this, [[0, 6]]);
17730
+ }, _callee5, this, [[0, 6]]);
17454
17731
  }));
17455
- function fetchAndParsePlaceDetail(_x4) {
17732
+ function fetchAndParsePlaceDetail(_x0) {
17456
17733
  return _fetchAndParsePlaceDetail.apply(this, arguments);
17457
17734
  }
17458
17735
  return fetchAndParsePlaceDetail;
@@ -17460,60 +17737,60 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
17460
17737
  }, {
17461
17738
  key: "fetchAndParseAnyPlaceDetail",
17462
17739
  value: function () {
17463
- var _fetchAndParseAnyPlaceDetail = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee5(query, authToken) {
17464
- var id, buildingId, floorId, level, cacheKey, cachedPlace, response, errorBody, responseData, place, _t5;
17465
- return repository_regenerator().w(function (_context5) {
17466
- while (1) switch (_context5.p = _context5.n) {
17740
+ var _fetchAndParseAnyPlaceDetail = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee6(query, authToken) {
17741
+ var id, buildingId, floorId, level, cacheKey, cachedPlace, response, errorBody, responseData, place, _t6;
17742
+ return repository_regenerator().w(function (_context6) {
17743
+ while (1) switch (_context6.p = _context6.n) {
17467
17744
  case 0:
17468
- _context5.p = 0;
17745
+ _context6.p = 0;
17469
17746
  id = query.id, buildingId = query.buildingId, floorId = query.floorId, level = query.level;
17470
17747
  cacheKey = this.placeCacheKey(id, buildingId);
17471
17748
  cachedPlace = this.cache.getPlace(cacheKey, this.currentLang);
17472
17749
  if (!(cachedPlace != null)) {
17473
- _context5.n = 1;
17750
+ _context6.n = 1;
17474
17751
  break;
17475
17752
  }
17476
17753
  this.logEvent("fetchAndParseAnyPlaceDetail", {
17477
17754
  cached: "true"
17478
17755
  });
17479
- return _context5.a(2, cachedPlace);
17756
+ return _context6.a(2, cachedPlace);
17480
17757
  case 1:
17481
- _context5.n = 2;
17758
+ _context6.n = 2;
17482
17759
  return this.requester.fetchAnyPlaceDetail(authToken, id, buildingId, floorId, level);
17483
17760
  case 2:
17484
- response = _context5.v;
17761
+ response = _context6.v;
17485
17762
  if (response.ok) {
17486
- _context5.n = 4;
17763
+ _context6.n = 4;
17487
17764
  break;
17488
17765
  }
17489
- _context5.n = 3;
17766
+ _context6.n = 3;
17490
17767
  return response.json();
17491
17768
  case 3:
17492
- errorBody = _context5.v;
17769
+ errorBody = _context6.v;
17493
17770
  throw new Error("Fetch failed with status ".concat(response.status, ": ").concat(extractErrorMessage(errorBody)));
17494
17771
  case 4:
17495
- _context5.n = 5;
17772
+ _context6.n = 5;
17496
17773
  return response.json();
17497
17774
  case 5:
17498
- responseData = _context5.v;
17775
+ responseData = _context6.v;
17499
17776
  place = new MVXPlace(responseData);
17500
17777
  this.cachePlace(place, buildingId);
17501
17778
  this.logEvent("fetchAndParseAnyPlaceDetail", {
17502
17779
  cached: "false"
17503
17780
  });
17504
- return _context5.a(2, place);
17781
+ return _context6.a(2, place);
17505
17782
  case 6:
17506
- _context5.p = 6;
17507
- _t5 = _context5.v;
17783
+ _context6.p = 6;
17784
+ _t6 = _context6.v;
17508
17785
  throw new Error("Failed to fetch and parse place detail with bearer token", {
17509
- cause: _t5
17786
+ cause: _t6
17510
17787
  });
17511
17788
  case 7:
17512
- return _context5.a(2);
17789
+ return _context6.a(2);
17513
17790
  }
17514
- }, _callee5, this, [[0, 6]]);
17791
+ }, _callee6, this, [[0, 6]]);
17515
17792
  }));
17516
- function fetchAndParseAnyPlaceDetail(_x5, _x6) {
17793
+ function fetchAndParseAnyPlaceDetail(_x1, _x10) {
17517
17794
  return _fetchAndParseAnyPlaceDetail.apply(this, arguments);
17518
17795
  }
17519
17796
  return fetchAndParseAnyPlaceDetail;
@@ -17545,42 +17822,42 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
17545
17822
  }, {
17546
17823
  key: "fetchAndParseSubPlaces",
17547
17824
  value: function () {
17548
- var _fetchAndParseSubPlaces = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee6(parentPlaceId) {
17825
+ var _fetchAndParseSubPlaces = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee7(parentPlaceId) {
17549
17826
  var _this2 = this;
17550
- var cachedSubPlaces, response, errorBody, responseData, subPlaces, _t6;
17551
- return repository_regenerator().w(function (_context6) {
17552
- while (1) switch (_context6.p = _context6.n) {
17827
+ var cachedSubPlaces, response, errorBody, responseData, subPlaces, _t7;
17828
+ return repository_regenerator().w(function (_context7) {
17829
+ while (1) switch (_context7.p = _context7.n) {
17553
17830
  case 0:
17554
- _context6.p = 0;
17831
+ _context7.p = 0;
17555
17832
  // Check cache first
17556
17833
  cachedSubPlaces = this.cache.getSubPlaces(parentPlaceId, this.currentLang);
17557
17834
  if (!(cachedSubPlaces != null)) {
17558
- _context6.n = 1;
17835
+ _context7.n = 1;
17559
17836
  break;
17560
17837
  }
17561
17838
  this.logEvent("fetchAndParseSubPlaces", {
17562
17839
  cached: "true"
17563
17840
  });
17564
- return _context6.a(2, cachedSubPlaces.data);
17841
+ return _context7.a(2, cachedSubPlaces.data);
17565
17842
  case 1:
17566
- _context6.n = 2;
17843
+ _context7.n = 2;
17567
17844
  return this.requester.fetchSubPlaces(parentPlaceId, this.token);
17568
17845
  case 2:
17569
- response = _context6.v;
17846
+ response = _context7.v;
17570
17847
  if (response.ok) {
17571
- _context6.n = 4;
17848
+ _context7.n = 4;
17572
17849
  break;
17573
17850
  }
17574
- _context6.n = 3;
17851
+ _context7.n = 3;
17575
17852
  return response.json();
17576
17853
  case 3:
17577
- errorBody = _context6.v;
17854
+ errorBody = _context7.v;
17578
17855
  throw new Error("Fetch failed with status ".concat(response.status, ": ").concat(extractErrorMessage(errorBody)));
17579
17856
  case 4:
17580
- _context6.n = 5;
17857
+ _context7.n = 5;
17581
17858
  return response.json();
17582
17859
  case 5:
17583
- responseData = _context6.v;
17860
+ responseData = _context7.v;
17584
17861
  subPlaces = responseData.map(function (place) {
17585
17862
  return new MVXPlace(place);
17586
17863
  }); // Cache the result
@@ -17599,19 +17876,19 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
17599
17876
  _this2.cache.setPlace(place.clientId, place, _this2.currentLang);
17600
17877
  }
17601
17878
  });
17602
- return _context6.a(2, subPlaces);
17879
+ return _context7.a(2, subPlaces);
17603
17880
  case 6:
17604
- _context6.p = 6;
17605
- _t6 = _context6.v;
17881
+ _context7.p = 6;
17882
+ _t7 = _context7.v;
17606
17883
  throw new Error("Failed to fetch and parse subplaces", {
17607
- cause: _t6
17884
+ cause: _t7
17608
17885
  });
17609
17886
  case 7:
17610
- return _context6.a(2);
17887
+ return _context7.a(2);
17611
17888
  }
17612
- }, _callee6, this, [[0, 6]]);
17889
+ }, _callee7, this, [[0, 6]]);
17613
17890
  }));
17614
- function fetchAndParseSubPlaces(_x7) {
17891
+ function fetchAndParseSubPlaces(_x11) {
17615
17892
  return _fetchAndParseSubPlaces.apply(this, arguments);
17616
17893
  }
17617
17894
  return fetchAndParseSubPlaces;
@@ -17619,31 +17896,31 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
17619
17896
  }, {
17620
17897
  key: "fetchAndParseAnySubPlaces",
17621
17898
  value: function () {
17622
- var _fetchAndParseAnySubPlaces = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee7(parentPlaceId, authToken) {
17899
+ var _fetchAndParseAnySubPlaces = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee8(parentPlaceId, authToken) {
17623
17900
  var _this3 = this;
17624
- var response, errorBody, responseData, subPlaces, _t7;
17625
- return repository_regenerator().w(function (_context7) {
17626
- while (1) switch (_context7.p = _context7.n) {
17901
+ var response, errorBody, responseData, subPlaces, _t8;
17902
+ return repository_regenerator().w(function (_context8) {
17903
+ while (1) switch (_context8.p = _context8.n) {
17627
17904
  case 0:
17628
- _context7.p = 0;
17629
- _context7.n = 1;
17905
+ _context8.p = 0;
17906
+ _context8.n = 1;
17630
17907
  return this.requester.fetchAnySubPlaces(parentPlaceId, authToken);
17631
17908
  case 1:
17632
- response = _context7.v;
17909
+ response = _context8.v;
17633
17910
  if (response.ok) {
17634
- _context7.n = 3;
17911
+ _context8.n = 3;
17635
17912
  break;
17636
17913
  }
17637
- _context7.n = 2;
17914
+ _context8.n = 2;
17638
17915
  return response.json();
17639
17916
  case 2:
17640
- errorBody = _context7.v;
17917
+ errorBody = _context8.v;
17641
17918
  throw new Error("Fetch failed with status ".concat(response.status, ": ").concat(extractErrorMessage(errorBody)));
17642
17919
  case 3:
17643
- _context7.n = 4;
17920
+ _context8.n = 4;
17644
17921
  return response.json();
17645
17922
  case 4:
17646
- responseData = _context7.v;
17923
+ responseData = _context8.v;
17647
17924
  subPlaces = responseData.map(function (place) {
17648
17925
  return new MVXPlace(place);
17649
17926
  });
@@ -17656,19 +17933,19 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
17656
17933
  _this3.cache.setPlace(place.clientId, place, _this3.currentLang);
17657
17934
  }
17658
17935
  });
17659
- return _context7.a(2, subPlaces);
17936
+ return _context8.a(2, subPlaces);
17660
17937
  case 5:
17661
- _context7.p = 5;
17662
- _t7 = _context7.v;
17938
+ _context8.p = 5;
17939
+ _t8 = _context8.v;
17663
17940
  throw new Error("Failed to fetch and parse any subplaces", {
17664
- cause: _t7
17941
+ cause: _t8
17665
17942
  });
17666
17943
  case 6:
17667
- return _context7.a(2);
17944
+ return _context8.a(2);
17668
17945
  }
17669
- }, _callee7, this, [[0, 5]]);
17946
+ }, _callee8, this, [[0, 5]]);
17670
17947
  }));
17671
- function fetchAndParseAnySubPlaces(_x8, _x9) {
17948
+ function fetchAndParseAnySubPlaces(_x12, _x13) {
17672
17949
  return _fetchAndParseAnySubPlaces.apply(this, arguments);
17673
17950
  }
17674
17951
  return fetchAndParseAnySubPlaces;
@@ -17676,31 +17953,31 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
17676
17953
  }, {
17677
17954
  key: "fetchAndParseAvailablePlaces",
17678
17955
  value: function () {
17679
- var _fetchAndParseAvailablePlaces = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee8() {
17956
+ var _fetchAndParseAvailablePlaces = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee9() {
17680
17957
  var _this4 = this;
17681
- var response, errorBody, typedResponseData, data, _t8;
17682
- return repository_regenerator().w(function (_context8) {
17683
- while (1) switch (_context8.p = _context8.n) {
17958
+ var response, errorBody, typedResponseData, data, _t9;
17959
+ return repository_regenerator().w(function (_context9) {
17960
+ while (1) switch (_context9.p = _context9.n) {
17684
17961
  case 0:
17685
- _context8.p = 0;
17686
- _context8.n = 1;
17962
+ _context9.p = 0;
17963
+ _context9.n = 1;
17687
17964
  return this.requester.fetchAllowedPlaces(this.token);
17688
17965
  case 1:
17689
- response = _context8.v;
17966
+ response = _context9.v;
17690
17967
  if (response.ok) {
17691
- _context8.n = 3;
17968
+ _context9.n = 3;
17692
17969
  break;
17693
17970
  }
17694
- _context8.n = 2;
17971
+ _context9.n = 2;
17695
17972
  return response.json();
17696
17973
  case 2:
17697
- errorBody = _context8.v;
17974
+ errorBody = _context9.v;
17698
17975
  throw new Error("Fetch failed with status ".concat(response.status, ": ").concat(extractErrorMessage(errorBody)));
17699
17976
  case 3:
17700
- _context8.n = 4;
17977
+ _context9.n = 4;
17701
17978
  return response.json();
17702
17979
  case 4:
17703
- typedResponseData = _context8.v;
17980
+ typedResponseData = _context9.v;
17704
17981
  data = typedResponseData.map(function (data) {
17705
17982
  return new MVXPlace(data);
17706
17983
  });
@@ -17713,20 +17990,20 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
17713
17990
  _this4.cache.setPlace(place.clientId, place, _this4.currentLang);
17714
17991
  }
17715
17992
  });
17716
- return _context8.a(2, data);
17993
+ return _context9.a(2, data);
17717
17994
  case 5:
17718
- _context8.p = 5;
17719
- _t8 = _context8.v;
17720
- this.logError(_t8, {
17995
+ _context9.p = 5;
17996
+ _t9 = _context9.v;
17997
+ this.logError(_t9, {
17721
17998
  functionName: "fetchAndParseAvailablePlaces"
17722
17999
  });
17723
18000
  throw new Error("Failed to fetch and parse parent places", {
17724
- cause: _t8
18001
+ cause: _t9
17725
18002
  });
17726
18003
  case 6:
17727
- return _context8.a(2);
18004
+ return _context9.a(2);
17728
18005
  }
17729
- }, _callee8, this, [[0, 5]]);
18006
+ }, _callee9, this, [[0, 5]]);
17730
18007
  }));
17731
18008
  function fetchAndParseAvailablePlaces() {
17732
18009
  return _fetchAndParseAvailablePlaces.apply(this, arguments);
@@ -17736,31 +18013,31 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
17736
18013
  }, {
17737
18014
  key: "fetchAndParsePlacesFromInstitution",
17738
18015
  value: function () {
17739
- var _fetchAndParsePlacesFromInstitution = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee9(institutionId, authToken) {
18016
+ var _fetchAndParsePlacesFromInstitution = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee0(institutionId, authToken) {
17740
18017
  var _this5 = this;
17741
- var response, errorBody, typedResponseData, data, _t9;
17742
- return repository_regenerator().w(function (_context9) {
17743
- while (1) switch (_context9.p = _context9.n) {
18018
+ var response, errorBody, typedResponseData, data, _t0;
18019
+ return repository_regenerator().w(function (_context0) {
18020
+ while (1) switch (_context0.p = _context0.n) {
17744
18021
  case 0:
17745
- _context9.p = 0;
17746
- _context9.n = 1;
18022
+ _context0.p = 0;
18023
+ _context0.n = 1;
17747
18024
  return this.requester.fetchPlacesFromAnyInstitution(institutionId, authToken);
17748
18025
  case 1:
17749
- response = _context9.v;
18026
+ response = _context0.v;
17750
18027
  if (response.ok) {
17751
- _context9.n = 3;
18028
+ _context0.n = 3;
17752
18029
  break;
17753
18030
  }
17754
- _context9.n = 2;
18031
+ _context0.n = 2;
17755
18032
  return response.json();
17756
18033
  case 2:
17757
- errorBody = _context9.v;
18034
+ errorBody = _context0.v;
17758
18035
  throw new Error("Fetch failed with status ".concat(response.status, ": ").concat(extractErrorMessage(errorBody)));
17759
18036
  case 3:
17760
- _context9.n = 4;
18037
+ _context0.n = 4;
17761
18038
  return response.json();
17762
18039
  case 4:
17763
- typedResponseData = _context9.v;
18040
+ typedResponseData = _context0.v;
17764
18041
  data = typedResponseData.map(function (data) {
17765
18042
  return new MVXPlace(data);
17766
18043
  });
@@ -17773,22 +18050,22 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
17773
18050
  _this5.cache.setPlace(place.clientId, place, _this5.currentLang);
17774
18051
  }
17775
18052
  });
17776
- return _context9.a(2, data);
18053
+ return _context0.a(2, data);
17777
18054
  case 5:
17778
- _context9.p = 5;
17779
- _t9 = _context9.v;
17780
- this.logError(_t9, {
18055
+ _context0.p = 5;
18056
+ _t0 = _context0.v;
18057
+ this.logError(_t0, {
17781
18058
  functionName: "fetchAndParsePlacesFromInstitution"
17782
18059
  });
17783
18060
  throw new Error("Failed to fetch and parse parent places from institution", {
17784
- cause: _t9
18061
+ cause: _t0
17785
18062
  });
17786
18063
  case 6:
17787
- return _context9.a(2);
18064
+ return _context0.a(2);
17788
18065
  }
17789
- }, _callee9, this, [[0, 5]]);
18066
+ }, _callee0, this, [[0, 5]]);
17790
18067
  }));
17791
- function fetchAndParsePlacesFromInstitution(_x0, _x1) {
18068
+ function fetchAndParsePlacesFromInstitution(_x14, _x15) {
17792
18069
  return _fetchAndParsePlacesFromInstitution.apply(this, arguments);
17793
18070
  }
17794
18071
  return fetchAndParsePlacesFromInstitution;
@@ -17821,61 +18098,61 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
17821
18098
  }, {
17822
18099
  key: "fetchAndParseRoute",
17823
18100
  value: function () {
17824
- var _fetchAndParseRoute = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee0(config) {
17825
- var destinationId, cachedResponse, response, errorBody, responseData, route, _t0;
17826
- return repository_regenerator().w(function (_context0) {
17827
- while (1) switch (_context0.p = _context0.n) {
18101
+ var _fetchAndParseRoute = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee1(config) {
18102
+ var destinationId, cachedResponse, response, errorBody, responseData, route, _t1;
18103
+ return repository_regenerator().w(function (_context1) {
18104
+ while (1) switch (_context1.p = _context1.n) {
17828
18105
  case 0:
17829
- _context0.p = 0;
18106
+ _context1.p = 0;
17830
18107
  destinationId = "";
17831
18108
  if ("id" in config.finalLocation) {
17832
18109
  destinationId = config.finalLocation.id;
17833
18110
  }
17834
18111
  cachedResponse = this.cache.getRoute(destinationId);
17835
18112
  if (!(cachedResponse != null)) {
17836
- _context0.n = 1;
18113
+ _context1.n = 1;
17837
18114
  break;
17838
18115
  }
17839
18116
  this.logEvent("fetchAndParseRoute", {
17840
18117
  cached: "true"
17841
18118
  });
17842
18119
  this.debugLog("Route cache testing. Found in caché.");
17843
- return _context0.a(2, cachedResponse.data);
18120
+ return _context1.a(2, cachedResponse.data);
17844
18121
  case 1:
17845
- _context0.n = 2;
18122
+ _context1.n = 2;
17846
18123
  return this.requester.fetchRoute(config, this.token);
17847
18124
  case 2:
17848
- response = _context0.v;
18125
+ response = _context1.v;
17849
18126
  if (response.ok) {
17850
- _context0.n = 4;
18127
+ _context1.n = 4;
17851
18128
  break;
17852
18129
  }
17853
- _context0.n = 3;
18130
+ _context1.n = 3;
17854
18131
  return response.json();
17855
18132
  case 3:
17856
- errorBody = _context0.v;
18133
+ errorBody = _context1.v;
17857
18134
  throw new Error("Fetch failed with status ".concat(response.status, ": ").concat(extractErrorMessage(errorBody)));
17858
18135
  case 4:
17859
- _context0.n = 5;
18136
+ _context1.n = 5;
17860
18137
  return response.json();
17861
18138
  case 5:
17862
- responseData = _context0.v;
18139
+ responseData = _context1.v;
17863
18140
  route = new MVXRoute(responseData[0]);
17864
18141
  this.logEvent("fetchAndParseRoute");
17865
18142
  this.debugLog("Route cache testing. Fetched.");
17866
- return _context0.a(2, route);
18143
+ return _context1.a(2, route);
17867
18144
  case 6:
17868
- _context0.p = 6;
17869
- _t0 = _context0.v;
18145
+ _context1.p = 6;
18146
+ _t1 = _context1.v;
17870
18147
  throw new Error("Failed to fetch and parse route", {
17871
- cause: _t0
18148
+ cause: _t1
17872
18149
  });
17873
18150
  case 7:
17874
- return _context0.a(2);
18151
+ return _context1.a(2);
17875
18152
  }
17876
- }, _callee0, this, [[0, 6]]);
18153
+ }, _callee1, this, [[0, 6]]);
17877
18154
  }));
17878
- function fetchAndParseRoute(_x10) {
18155
+ function fetchAndParseRoute(_x16) {
17879
18156
  return _fetchAndParseRoute.apply(this, arguments);
17880
18157
  }
17881
18158
  return fetchAndParseRoute;
@@ -17883,61 +18160,61 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
17883
18160
  }, {
17884
18161
  key: "fetchAndParseRouteV2",
17885
18162
  value: function () {
17886
- var _fetchAndParseRouteV = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee1(config) {
17887
- var destinationId, cachedResponse, response, errorBody, responseData, route, _t1;
17888
- return repository_regenerator().w(function (_context1) {
17889
- while (1) switch (_context1.p = _context1.n) {
18163
+ var _fetchAndParseRouteV = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee10(config) {
18164
+ var destinationId, cachedResponse, response, errorBody, responseData, route, _t10;
18165
+ return repository_regenerator().w(function (_context10) {
18166
+ while (1) switch (_context10.p = _context10.n) {
17890
18167
  case 0:
17891
- _context1.p = 0;
18168
+ _context10.p = 0;
17892
18169
  destinationId = "";
17893
18170
  if ("id" in config.finalLocation) {
17894
18171
  destinationId = config.finalLocation.id;
17895
18172
  }
17896
18173
  cachedResponse = this.cache.getRoute(destinationId);
17897
18174
  if (!(cachedResponse != null)) {
17898
- _context1.n = 1;
18175
+ _context10.n = 1;
17899
18176
  break;
17900
18177
  }
17901
18178
  this.logEvent("fetchAndParseRouteV2", {
17902
18179
  cached: "true"
17903
18180
  });
17904
18181
  this.debugLog("Route cache testing. Found in caché.");
17905
- return _context1.a(2, cachedResponse.data);
18182
+ return _context10.a(2, cachedResponse.data);
17906
18183
  case 1:
17907
- _context1.n = 2;
18184
+ _context10.n = 2;
17908
18185
  return this.requester.fetchRouteV2(config, this.token);
17909
18186
  case 2:
17910
- response = _context1.v;
18187
+ response = _context10.v;
17911
18188
  if (response.ok) {
17912
- _context1.n = 4;
18189
+ _context10.n = 4;
17913
18190
  break;
17914
18191
  }
17915
- _context1.n = 3;
18192
+ _context10.n = 3;
17916
18193
  return response.json();
17917
18194
  case 3:
17918
- errorBody = _context1.v;
18195
+ errorBody = _context10.v;
17919
18196
  throw new Error("Fetch failed with status ".concat(response.status, ": ").concat(extractErrorMessage(errorBody)));
17920
18197
  case 4:
17921
- _context1.n = 5;
18198
+ _context10.n = 5;
17922
18199
  return response.json();
17923
18200
  case 5:
17924
- responseData = _context1.v;
18201
+ responseData = _context10.v;
17925
18202
  route = new MVXRoute(responseData[0]);
17926
18203
  this.logEvent("fetchAndParseRouteV2");
17927
18204
  this.debugLog("Route cache testing. Fetched.");
17928
- return _context1.a(2, route);
18205
+ return _context10.a(2, route);
17929
18206
  case 6:
17930
- _context1.p = 6;
17931
- _t1 = _context1.v;
18207
+ _context10.p = 6;
18208
+ _t10 = _context10.v;
17932
18209
  throw new Error("Failed to fetch and parse route", {
17933
- cause: _t1
18210
+ cause: _t10
17934
18211
  });
17935
18212
  case 7:
17936
- return _context1.a(2);
18213
+ return _context10.a(2);
17937
18214
  }
17938
- }, _callee1, this, [[0, 6]]);
18215
+ }, _callee10, this, [[0, 6]]);
17939
18216
  }));
17940
- function fetchAndParseRouteV2(_x11) {
18217
+ function fetchAndParseRouteV2(_x17) {
17941
18218
  return _fetchAndParseRouteV.apply(this, arguments);
17942
18219
  }
17943
18220
  return fetchAndParseRouteV2;
@@ -17945,46 +18222,46 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
17945
18222
  }, {
17946
18223
  key: "fetchAndParseLiveRoute",
17947
18224
  value: function () {
17948
- var _fetchAndParseLiveRoute = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee10(config) {
17949
- var response, errorBody, responseData, route, _t10;
17950
- return repository_regenerator().w(function (_context10) {
17951
- while (1) switch (_context10.p = _context10.n) {
18225
+ var _fetchAndParseLiveRoute = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee11(config) {
18226
+ var response, errorBody, responseData, route, _t11;
18227
+ return repository_regenerator().w(function (_context11) {
18228
+ while (1) switch (_context11.p = _context11.n) {
17952
18229
  case 0:
17953
- _context10.p = 0;
17954
- _context10.n = 1;
18230
+ _context11.p = 0;
18231
+ _context11.n = 1;
17955
18232
  return this.requester.fetchLiveRoute(config, this.token);
17956
18233
  case 1:
17957
- response = _context10.v;
18234
+ response = _context11.v;
17958
18235
  if (response.ok) {
17959
- _context10.n = 3;
18236
+ _context11.n = 3;
17960
18237
  break;
17961
18238
  }
17962
- _context10.n = 2;
18239
+ _context11.n = 2;
17963
18240
  return response.json();
17964
18241
  case 2:
17965
- errorBody = _context10.v;
18242
+ errorBody = _context11.v;
17966
18243
  throw new Error("Fetch failed with status ".concat(response.status, ": ").concat(extractErrorMessage(errorBody)));
17967
18244
  case 3:
17968
- _context10.n = 4;
18245
+ _context11.n = 4;
17969
18246
  return response.json();
17970
18247
  case 4:
17971
- responseData = _context10.v;
18248
+ responseData = _context11.v;
17972
18249
  route = new MVXRoute(responseData[0]);
17973
18250
  this.logEvent("fetchAndParseLiveRoute");
17974
18251
  this.debugLog("Live route fetched.");
17975
- return _context10.a(2, route);
18252
+ return _context11.a(2, route);
17976
18253
  case 5:
17977
- _context10.p = 5;
17978
- _t10 = _context10.v;
18254
+ _context11.p = 5;
18255
+ _t11 = _context11.v;
17979
18256
  throw new Error("Failed to fetch and parse route", {
17980
- cause: _t10
18257
+ cause: _t11
17981
18258
  });
17982
18259
  case 6:
17983
- return _context10.a(2);
18260
+ return _context11.a(2);
17984
18261
  }
17985
- }, _callee10, this, [[0, 5]]);
18262
+ }, _callee11, this, [[0, 5]]);
17986
18263
  }));
17987
- function fetchAndParseLiveRoute(_x12) {
18264
+ function fetchAndParseLiveRoute(_x18) {
17988
18265
  return _fetchAndParseLiveRoute.apply(this, arguments);
17989
18266
  }
17990
18267
  return fetchAndParseLiveRoute;
@@ -17992,52 +18269,52 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
17992
18269
  }, {
17993
18270
  key: "fetchAndParseTransport",
17994
18271
  value: function () {
17995
- var _fetchAndParseTransport = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee11(stopId) {
18272
+ var _fetchAndParseTransport = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee12(stopId) {
17996
18273
  var _this7 = this;
17997
- var cachedResponse, response, errorBody, typedResponseData, stopsPromises, stops, transport, _cachedResponse, _transport, _t11;
17998
- return repository_regenerator().w(function (_context11) {
17999
- while (1) switch (_context11.p = _context11.n) {
18274
+ var cachedResponse, response, errorBody, typedResponseData, stopsPromises, stops, transport, _cachedResponse, _transport, _t12;
18275
+ return repository_regenerator().w(function (_context12) {
18276
+ while (1) switch (_context12.p = _context12.n) {
18000
18277
  case 0:
18001
- _context11.p = 0;
18278
+ _context12.p = 0;
18002
18279
  cachedResponse = this.cache.getVehicle(stopId, this.currentLang);
18003
18280
  if (!(cachedResponse != null && (Date.now() - cachedResponse.timestamp < 60 * 1000 || cachedResponse.data.routes.length === 0))) {
18004
- _context11.n = 1;
18281
+ _context12.n = 1;
18005
18282
  break;
18006
18283
  }
18007
18284
  this.logEvent("fetchAndParseTransport", {
18008
18285
  cached: "true"
18009
18286
  });
18010
- return _context11.a(2, cachedResponse.data);
18287
+ return _context12.a(2, cachedResponse.data);
18011
18288
  case 1:
18012
- _context11.n = 2;
18289
+ _context12.n = 2;
18013
18290
  return this.requester.fetchTransport(this.token, stopId);
18014
18291
  case 2:
18015
- response = _context11.v;
18292
+ response = _context12.v;
18016
18293
  if (response.ok) {
18017
- _context11.n = 4;
18294
+ _context12.n = 4;
18018
18295
  break;
18019
18296
  }
18020
- _context11.n = 3;
18297
+ _context12.n = 3;
18021
18298
  return response.json();
18022
18299
  case 3:
18023
- errorBody = _context11.v;
18300
+ errorBody = _context12.v;
18024
18301
  throw new Error("Fetch failed with status ".concat(response.status, ": ").concat(extractErrorMessage(errorBody)));
18025
18302
  case 4:
18026
- _context11.n = 5;
18303
+ _context12.n = 5;
18027
18304
  return response.json();
18028
18305
  case 5:
18029
- typedResponseData = _context11.v;
18306
+ typedResponseData = _context12.v;
18030
18307
  if (!(typedResponseData.realtimeSchedules.length > 0)) {
18031
- _context11.n = 7;
18308
+ _context12.n = 7;
18032
18309
  break;
18033
18310
  }
18034
18311
  stopsPromises = typedResponseData.realtimeSchedules.map(function (e) {
18035
18312
  return _this7.fetchAndParseStops(stopId, e.vehicleId);
18036
18313
  });
18037
- _context11.n = 6;
18314
+ _context12.n = 6;
18038
18315
  return Promise.all(stopsPromises);
18039
18316
  case 6:
18040
- stops = _context11.v;
18317
+ stops = _context12.v;
18041
18318
  if (stops.length > 0) {
18042
18319
  typedResponseData.realtimeSchedules.forEach(function (vehicle) {
18043
18320
  var _stops$find$places, _stops$find;
@@ -18055,13 +18332,13 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
18055
18332
  this.logEvent("fetchAndParseTransport", {
18056
18333
  cached: "false"
18057
18334
  });
18058
- return _context11.a(2, transport);
18335
+ return _context12.a(2, transport);
18059
18336
  case 8:
18060
- _context11.p = 8;
18061
- _t11 = _context11.v;
18337
+ _context12.p = 8;
18338
+ _t12 = _context12.v;
18062
18339
  _cachedResponse = this.cache.getVehicle(stopId, this.currentLang);
18063
18340
  if (!(_cachedResponse != null)) {
18064
- _context11.n = 9;
18341
+ _context12.n = 9;
18065
18342
  break;
18066
18343
  }
18067
18344
  _transport = new MVXTransport({
@@ -18071,17 +18348,17 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
18071
18348
  this.logEvent("fetchAndParseTransport", {
18072
18349
  cached: "true"
18073
18350
  });
18074
- return _context11.a(2, _transport);
18351
+ return _context12.a(2, _transport);
18075
18352
  case 9:
18076
18353
  throw new Error("Failed to fetch and parse transport", {
18077
- cause: _t11
18354
+ cause: _t12
18078
18355
  });
18079
18356
  case 10:
18080
- return _context11.a(2);
18357
+ return _context12.a(2);
18081
18358
  }
18082
- }, _callee11, this, [[0, 8]]);
18359
+ }, _callee12, this, [[0, 8]]);
18083
18360
  }));
18084
- function fetchAndParseTransport(_x13) {
18361
+ function fetchAndParseTransport(_x19) {
18085
18362
  return _fetchAndParseTransport.apply(this, arguments);
18086
18363
  }
18087
18364
  return fetchAndParseTransport;
@@ -18089,43 +18366,43 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
18089
18366
  }, {
18090
18367
  key: "fetchAndParseStops",
18091
18368
  value: function () {
18092
- var _fetchAndParseStops = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee12(stopId, vehicleId) {
18093
- var cachedResponse, response, errorBody, typedResponseData, data, _t12;
18094
- return repository_regenerator().w(function (_context12) {
18095
- while (1) switch (_context12.p = _context12.n) {
18369
+ var _fetchAndParseStops = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee13(stopId, vehicleId) {
18370
+ var cachedResponse, response, errorBody, typedResponseData, data, _t13;
18371
+ return repository_regenerator().w(function (_context13) {
18372
+ while (1) switch (_context13.p = _context13.n) {
18096
18373
  case 0:
18097
- _context12.p = 0;
18374
+ _context13.p = 0;
18098
18375
  cachedResponse = this.cache.getStops(stopId + vehicleId, this.currentLang);
18099
18376
  if (!(cachedResponse != null && Date.now() - cachedResponse.timestamp < 60 * 1000)) {
18100
- _context12.n = 1;
18377
+ _context13.n = 1;
18101
18378
  break;
18102
18379
  }
18103
18380
  this.logEvent("fetchAndParseStops", {
18104
18381
  cached: "true"
18105
18382
  });
18106
- return _context12.a(2, {
18383
+ return _context13.a(2, {
18107
18384
  id: vehicleId,
18108
18385
  places: cachedResponse.data
18109
18386
  });
18110
18387
  case 1:
18111
- _context12.n = 2;
18388
+ _context13.n = 2;
18112
18389
  return this.requester.fetchStops(this.token, stopId, vehicleId);
18113
18390
  case 2:
18114
- response = _context12.v;
18391
+ response = _context13.v;
18115
18392
  if (response.ok) {
18116
- _context12.n = 4;
18393
+ _context13.n = 4;
18117
18394
  break;
18118
18395
  }
18119
- _context12.n = 3;
18396
+ _context13.n = 3;
18120
18397
  return response.json();
18121
18398
  case 3:
18122
- errorBody = _context12.v;
18399
+ errorBody = _context13.v;
18123
18400
  throw new Error("Fetch failed with status ".concat(response.status, ": ").concat(extractErrorMessage(errorBody)));
18124
18401
  case 4:
18125
- _context12.n = 5;
18402
+ _context13.n = 5;
18126
18403
  return response.json();
18127
18404
  case 5:
18128
- typedResponseData = _context12.v;
18405
+ typedResponseData = _context13.v;
18129
18406
  data = typedResponseData.map(function (e) {
18130
18407
  return new MVXPlace(e);
18131
18408
  });
@@ -18136,22 +18413,22 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
18136
18413
  this.logEvent("fetchAndParseStops", {
18137
18414
  cached: "false"
18138
18415
  });
18139
- return _context12.a(2, {
18416
+ return _context13.a(2, {
18140
18417
  id: vehicleId,
18141
18418
  places: data
18142
18419
  });
18143
18420
  case 6:
18144
- _context12.p = 6;
18145
- _t12 = _context12.v;
18421
+ _context13.p = 6;
18422
+ _t13 = _context13.v;
18146
18423
  throw new Error("Failed to fetch and parse stops", {
18147
- cause: _t12
18424
+ cause: _t13
18148
18425
  });
18149
18426
  case 7:
18150
- return _context12.a(2);
18427
+ return _context13.a(2);
18151
18428
  }
18152
- }, _callee12, this, [[0, 6]]);
18429
+ }, _callee13, this, [[0, 6]]);
18153
18430
  }));
18154
- function fetchAndParseStops(_x14, _x15) {
18431
+ function fetchAndParseStops(_x20, _x21) {
18155
18432
  return _fetchAndParseStops.apply(this, arguments);
18156
18433
  }
18157
18434
  return fetchAndParseStops;
@@ -18159,46 +18436,46 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
18159
18436
  }, {
18160
18437
  key: "fetchAndParseSearchResults",
18161
18438
  value: function () {
18162
- var _fetchAndParseSearchResults = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee13(institutionId, input, parentPlaces, origin, lat, lng, floor) {
18163
- var response, errorBody, responseData, searchResults, _t13;
18164
- return repository_regenerator().w(function (_context13) {
18165
- while (1) switch (_context13.p = _context13.n) {
18439
+ var _fetchAndParseSearchResults = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee14(institutionId, input, parentPlaces, origin, lat, lng, floor) {
18440
+ var response, errorBody, responseData, searchResults, _t14;
18441
+ return repository_regenerator().w(function (_context14) {
18442
+ while (1) switch (_context14.p = _context14.n) {
18166
18443
  case 0:
18167
- _context13.p = 0;
18168
- _context13.n = 1;
18444
+ _context14.p = 0;
18445
+ _context14.n = 1;
18169
18446
  return this.requester.fetchSearchResults(institutionId, input, this.token, parentPlaces, origin, lat, lng, floor);
18170
18447
  case 1:
18171
- response = _context13.v;
18448
+ response = _context14.v;
18172
18449
  if (response.ok) {
18173
- _context13.n = 3;
18450
+ _context14.n = 3;
18174
18451
  break;
18175
18452
  }
18176
- _context13.n = 2;
18453
+ _context14.n = 2;
18177
18454
  return response.json();
18178
18455
  case 2:
18179
- errorBody = _context13.v;
18456
+ errorBody = _context14.v;
18180
18457
  throw new Error("Fetch failed with status ".concat(response.status, ": ").concat(extractErrorMessage(errorBody)));
18181
18458
  case 3:
18182
- _context13.n = 4;
18459
+ _context14.n = 4;
18183
18460
  return response.json();
18184
18461
  case 4:
18185
- responseData = _context13.v;
18462
+ responseData = _context14.v;
18186
18463
  searchResults = responseData.map(function (result) {
18187
18464
  return new MVXPlace(result);
18188
18465
  });
18189
- return _context13.a(2, searchResults);
18466
+ return _context14.a(2, searchResults);
18190
18467
  case 5:
18191
- _context13.p = 5;
18192
- _t13 = _context13.v;
18468
+ _context14.p = 5;
18469
+ _t14 = _context14.v;
18193
18470
  throw new Error("Failed to fetch and parse search results", {
18194
- cause: _t13
18471
+ cause: _t14
18195
18472
  });
18196
18473
  case 6:
18197
- return _context13.a(2);
18474
+ return _context14.a(2);
18198
18475
  }
18199
- }, _callee13, this, [[0, 5]]);
18476
+ }, _callee14, this, [[0, 5]]);
18200
18477
  }));
18201
- function fetchAndParseSearchResults(_x16, _x17, _x18, _x19, _x20, _x21, _x22) {
18478
+ function fetchAndParseSearchResults(_x22, _x23, _x24, _x25, _x26, _x27, _x28) {
18202
18479
  return _fetchAndParseSearchResults.apply(this, arguments);
18203
18480
  }
18204
18481
  return fetchAndParseSearchResults;
@@ -18206,31 +18483,31 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
18206
18483
  }, {
18207
18484
  key: "fetchAndParseSearchPlacesByTags",
18208
18485
  value: function () {
18209
- var _fetchAndParseSearchPlacesByTags = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee14(institutionId, tags, parentPlaces, sort, origin, lat, lng, floor) {
18486
+ var _fetchAndParseSearchPlacesByTags = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee15(institutionId, tags, parentPlaces, sort, origin, lat, lng, floor) {
18210
18487
  var _this8 = this;
18211
- var response, errorBody, responseData, places, _t14;
18212
- return repository_regenerator().w(function (_context14) {
18213
- while (1) switch (_context14.p = _context14.n) {
18488
+ var response, errorBody, responseData, places, _t15;
18489
+ return repository_regenerator().w(function (_context15) {
18490
+ while (1) switch (_context15.p = _context15.n) {
18214
18491
  case 0:
18215
- _context14.p = 0;
18216
- _context14.n = 1;
18492
+ _context15.p = 0;
18493
+ _context15.n = 1;
18217
18494
  return this.requester.fetchSearchPlacesByTags(institutionId, tags, this.token, parentPlaces, sort, origin, lat, lng, floor);
18218
18495
  case 1:
18219
- response = _context14.v;
18496
+ response = _context15.v;
18220
18497
  if (response.ok) {
18221
- _context14.n = 3;
18498
+ _context15.n = 3;
18222
18499
  break;
18223
18500
  }
18224
- _context14.n = 2;
18501
+ _context15.n = 2;
18225
18502
  return response.json();
18226
18503
  case 2:
18227
- errorBody = _context14.v;
18504
+ errorBody = _context15.v;
18228
18505
  throw new Error("Fetch failed with status ".concat(response.status, ": ").concat(extractErrorMessage(errorBody)));
18229
18506
  case 3:
18230
- _context14.n = 4;
18507
+ _context15.n = 4;
18231
18508
  return response.json();
18232
18509
  case 4:
18233
- responseData = _context14.v;
18510
+ responseData = _context15.v;
18234
18511
  places = responseData.map(function (place) {
18235
18512
  return new MVXPlace(place);
18236
18513
  });
@@ -18243,19 +18520,19 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
18243
18520
  _this8.cache.setPlace(place.clientId, place, _this8.currentLang);
18244
18521
  }
18245
18522
  });
18246
- return _context14.a(2, places);
18523
+ return _context15.a(2, places);
18247
18524
  case 5:
18248
- _context14.p = 5;
18249
- _t14 = _context14.v;
18525
+ _context15.p = 5;
18526
+ _t15 = _context15.v;
18250
18527
  throw new Error("Failed to fetch and parse search places by tags", {
18251
- cause: _t14
18528
+ cause: _t15
18252
18529
  });
18253
18530
  case 6:
18254
- return _context14.a(2);
18531
+ return _context15.a(2);
18255
18532
  }
18256
- }, _callee14, this, [[0, 5]]);
18533
+ }, _callee15, this, [[0, 5]]);
18257
18534
  }));
18258
- function fetchAndParseSearchPlacesByTags(_x23, _x24, _x25, _x26, _x27, _x28, _x29, _x30) {
18535
+ function fetchAndParseSearchPlacesByTags(_x29, _x30, _x31, _x32, _x33, _x34, _x35, _x36) {
18259
18536
  return _fetchAndParseSearchPlacesByTags.apply(this, arguments);
18260
18537
  }
18261
18538
  return fetchAndParseSearchPlacesByTags;
@@ -18263,31 +18540,31 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
18263
18540
  }, {
18264
18541
  key: "fetchAndParseRoutesFromOrigin",
18265
18542
  value: function () {
18266
- var _fetchAndParseRoutesFromOrigin = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee15(parentPlaceId, fromPlaceId, announceFormat, unitSystem, mode) {
18543
+ var _fetchAndParseRoutesFromOrigin = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee16(parentPlaceId, fromPlaceId, announceFormat, unitSystem, mode) {
18267
18544
  var _this9 = this;
18268
- var response, errorBody, _ref, routes, accessibleRoutes, _t15;
18269
- return repository_regenerator().w(function (_context15) {
18270
- while (1) switch (_context15.p = _context15.n) {
18545
+ var response, errorBody, _ref, routes, accessibleRoutes, _t16;
18546
+ return repository_regenerator().w(function (_context16) {
18547
+ while (1) switch (_context16.p = _context16.n) {
18271
18548
  case 0:
18272
- _context15.p = 0;
18273
- _context15.n = 1;
18549
+ _context16.p = 0;
18550
+ _context16.n = 1;
18274
18551
  return this.requester.fetchRoutesForOrigin(this.token, parentPlaceId, fromPlaceId, announceFormat, unitSystem, mode);
18275
18552
  case 1:
18276
- response = _context15.v;
18553
+ response = _context16.v;
18277
18554
  if (response.ok) {
18278
- _context15.n = 3;
18555
+ _context16.n = 3;
18279
18556
  break;
18280
18557
  }
18281
- _context15.n = 2;
18558
+ _context16.n = 2;
18282
18559
  return response.json();
18283
18560
  case 2:
18284
- errorBody = _context15.v;
18561
+ errorBody = _context16.v;
18285
18562
  throw new Error("Fetch failed with status ".concat(response.status, ": ").concat(extractErrorMessage(errorBody)));
18286
18563
  case 3:
18287
- _context15.n = 4;
18564
+ _context16.n = 4;
18288
18565
  return response.json();
18289
18566
  case 4:
18290
- _ref = _context15.v;
18567
+ _ref = _context16.v;
18291
18568
  routes = _ref.routes;
18292
18569
  accessibleRoutes = _ref.accessibleRoutes;
18293
18570
  Object.entries(routes).forEach(function (_ref2) {
@@ -18311,20 +18588,20 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
18311
18588
  });
18312
18589
  });
18313
18590
  this.debugLog("Route cache testing. Cache populated!");
18314
- _context15.n = 6;
18591
+ _context16.n = 6;
18315
18592
  break;
18316
18593
  case 5:
18317
- _context15.p = 5;
18318
- _t15 = _context15.v;
18594
+ _context16.p = 5;
18595
+ _t16 = _context16.v;
18319
18596
  throw new Error("Failed to fetch and parse routes from origin results", {
18320
- cause: _t15
18597
+ cause: _t16
18321
18598
  });
18322
18599
  case 6:
18323
- return _context15.a(2);
18600
+ return _context16.a(2);
18324
18601
  }
18325
- }, _callee15, this, [[0, 5]]);
18602
+ }, _callee16, this, [[0, 5]]);
18326
18603
  }));
18327
- function fetchAndParseRoutesFromOrigin(_x31, _x32, _x33, _x34, _x35) {
18604
+ function fetchAndParseRoutesFromOrigin(_x37, _x38, _x39, _x40, _x41) {
18328
18605
  return _fetchAndParseRoutesFromOrigin.apply(this, arguments);
18329
18606
  }
18330
18607
  return fetchAndParseRoutesFromOrigin;
@@ -18332,44 +18609,44 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
18332
18609
  }, {
18333
18610
  key: "fetchAndParseCacheTimestamp",
18334
18611
  value: function () {
18335
- var _fetchAndParseCacheTimestamp = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee16(parentPlaceId) {
18336
- var response, errorBody, _ref6, lastUpdate, _t16;
18337
- return repository_regenerator().w(function (_context16) {
18338
- while (1) switch (_context16.p = _context16.n) {
18612
+ var _fetchAndParseCacheTimestamp = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee17(parentPlaceId) {
18613
+ var response, errorBody, _ref6, lastUpdate, _t17;
18614
+ return repository_regenerator().w(function (_context17) {
18615
+ while (1) switch (_context17.p = _context17.n) {
18339
18616
  case 0:
18340
- _context16.p = 0;
18341
- _context16.n = 1;
18617
+ _context17.p = 0;
18618
+ _context17.n = 1;
18342
18619
  return this.requester.fetchCacheTimestamp(this.token, parentPlaceId);
18343
18620
  case 1:
18344
- response = _context16.v;
18621
+ response = _context17.v;
18345
18622
  if (response.ok) {
18346
- _context16.n = 3;
18623
+ _context17.n = 3;
18347
18624
  break;
18348
18625
  }
18349
- _context16.n = 2;
18626
+ _context17.n = 2;
18350
18627
  return response.json();
18351
18628
  case 2:
18352
- errorBody = _context16.v;
18629
+ errorBody = _context17.v;
18353
18630
  throw new Error("Fetch failed with status ".concat(response.status, ": ").concat(extractErrorMessage(errorBody)));
18354
18631
  case 3:
18355
- _context16.n = 4;
18632
+ _context17.n = 4;
18356
18633
  return response.json();
18357
18634
  case 4:
18358
- _ref6 = _context16.v;
18635
+ _ref6 = _context17.v;
18359
18636
  lastUpdate = _ref6.lastUpdate;
18360
- return _context16.a(2, lastUpdate);
18637
+ return _context17.a(2, lastUpdate);
18361
18638
  case 5:
18362
- _context16.p = 5;
18363
- _t16 = _context16.v;
18639
+ _context17.p = 5;
18640
+ _t17 = _context17.v;
18364
18641
  throw new Error("Failed to fetch and parse cache timestamp", {
18365
- cause: _t16
18642
+ cause: _t17
18366
18643
  });
18367
18644
  case 6:
18368
- return _context16.a(2);
18645
+ return _context17.a(2);
18369
18646
  }
18370
- }, _callee16, this, [[0, 5]]);
18647
+ }, _callee17, this, [[0, 5]]);
18371
18648
  }));
18372
- function fetchAndParseCacheTimestamp(_x36) {
18649
+ function fetchAndParseCacheTimestamp(_x42) {
18373
18650
  return _fetchAndParseCacheTimestamp.apply(this, arguments);
18374
18651
  }
18375
18652
  return fetchAndParseCacheTimestamp;
@@ -18383,41 +18660,41 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
18383
18660
  }, {
18384
18661
  key: "fetchAndParseConfiguration",
18385
18662
  value: function () {
18386
- var _fetchAndParseConfiguration = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee17(placeId, product) {
18387
- var cachedConfig, response, errorBody, config, _t17;
18388
- return repository_regenerator().w(function (_context17) {
18389
- while (1) switch (_context17.p = _context17.n) {
18663
+ var _fetchAndParseConfiguration = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee18(placeId, product) {
18664
+ var cachedConfig, response, errorBody, config, _t18;
18665
+ return repository_regenerator().w(function (_context18) {
18666
+ while (1) switch (_context18.p = _context18.n) {
18390
18667
  case 0:
18391
- _context17.p = 0;
18668
+ _context18.p = 0;
18392
18669
  // Check cache first
18393
18670
  cachedConfig = this.cache.getConfiguration(placeId || "default", product || "default", this.currentLang);
18394
18671
  if (!(cachedConfig != null)) {
18395
- _context17.n = 1;
18672
+ _context18.n = 1;
18396
18673
  break;
18397
18674
  }
18398
18675
  this.logEvent("fetchAndParseConfiguration", {
18399
18676
  cached: "true"
18400
18677
  });
18401
- return _context17.a(2, cachedConfig.data);
18678
+ return _context18.a(2, cachedConfig.data);
18402
18679
  case 1:
18403
- _context17.n = 2;
18680
+ _context18.n = 2;
18404
18681
  return this.requester.fetchConfiguration(this.token, placeId, product);
18405
18682
  case 2:
18406
- response = _context17.v;
18683
+ response = _context18.v;
18407
18684
  if (response.ok) {
18408
- _context17.n = 4;
18685
+ _context18.n = 4;
18409
18686
  break;
18410
18687
  }
18411
- _context17.n = 3;
18688
+ _context18.n = 3;
18412
18689
  return response.json();
18413
18690
  case 3:
18414
- errorBody = _context17.v;
18691
+ errorBody = _context18.v;
18415
18692
  throw new Error("Fetch failed with status ".concat(response.status, ": ").concat(extractErrorMessage(errorBody)));
18416
18693
  case 4:
18417
- _context17.n = 5;
18694
+ _context18.n = 5;
18418
18695
  return response.json();
18419
18696
  case 5:
18420
- config = _context17.v;
18697
+ config = _context18.v;
18421
18698
  // Cache the result
18422
18699
  this.cache.setConfiguration(placeId || "default", product || "default", this.currentLang, {
18423
18700
  timestamp: Date.now(),
@@ -18426,64 +18703,133 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
18426
18703
  this.logEvent("fetchAndParseConfiguration", {
18427
18704
  cached: "false"
18428
18705
  });
18429
- return _context17.a(2, config);
18706
+ return _context18.a(2, config);
18430
18707
  case 6:
18431
- _context17.p = 6;
18432
- _t17 = _context17.v;
18433
- this.logError(_t17, {
18708
+ _context18.p = 6;
18709
+ _t18 = _context18.v;
18710
+ this.logError(_t18, {
18434
18711
  functionName: "fetchAndParseConfiguration"
18435
18712
  });
18436
18713
  throw new Error("Failed to fetch and parse configuration", {
18437
- cause: _t17
18714
+ cause: _t18
18438
18715
  });
18439
18716
  case 7:
18440
- return _context17.a(2);
18717
+ return _context18.a(2);
18441
18718
  }
18442
- }, _callee17, this, [[0, 6]]);
18719
+ }, _callee18, this, [[0, 6]]);
18443
18720
  }));
18444
- function fetchAndParseConfiguration(_x37, _x38) {
18721
+ function fetchAndParseConfiguration(_x43, _x44) {
18445
18722
  return _fetchAndParseConfiguration.apply(this, arguments);
18446
18723
  }
18447
18724
  return fetchAndParseConfiguration;
18448
18725
  }()
18726
+ /**
18727
+ * Fetches the campaigns for a maps-group (totem screensaver playlist). Returns them
18728
+ * verbatim — no status/date/schedule filtering, that is the consumer's decision.
18729
+ * `placeId` is the maps-group firebase id; `kioskId` optionally narrows to a totem.
18730
+ * Not cached (campaigns change; the totem keeps its own short-lived cache).
18731
+ */
18732
+ }, {
18733
+ key: "fetchAndParseCampaigns",
18734
+ value: (function () {
18735
+ var _fetchAndParseCampaigns = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee19(placeId, kioskId) {
18736
+ var response, errorBody, raw, campaigns, _t19;
18737
+ return repository_regenerator().w(function (_context19) {
18738
+ while (1) switch (_context19.p = _context19.n) {
18739
+ case 0:
18740
+ _context19.p = 0;
18741
+ _context19.n = 1;
18742
+ return this.requester.fetchCampaigns(this.token, placeId, kioskId);
18743
+ case 1:
18744
+ response = _context19.v;
18745
+ if (response.ok) {
18746
+ _context19.n = 3;
18747
+ break;
18748
+ }
18749
+ _context19.n = 2;
18750
+ return response.json();
18751
+ case 2:
18752
+ errorBody = _context19.v;
18753
+ throw new Error("Fetch failed with status ".concat(response.status, ": ").concat(extractErrorMessage(errorBody)));
18754
+ case 3:
18755
+ _context19.n = 4;
18756
+ return response.json();
18757
+ case 4:
18758
+ raw = _context19.v;
18759
+ // A non-array body is a contract break (a `{ campaigns: [...] }` wrapper, an HTML
18760
+ // error page served with a 200). Degrading to an empty playlist keeps the totem
18761
+ // running, but it must not look like a successful empty fetch — without this
18762
+ // warning the screensaver just goes blank with nothing to diagnose.
18763
+ if (!Array.isArray(raw)) {
18764
+ this.logWarning(new Error("Campaigns response body was not an array"), {
18765
+ functionName: "fetchAndParseCampaigns",
18766
+ receivedType: raw === null ? "null" : repository_typeof(raw)
18767
+ });
18768
+ }
18769
+ campaigns = (Array.isArray(raw) ? raw : []).map(function (item) {
18770
+ return new Campaign(item);
18771
+ });
18772
+ this.logEvent("fetchAndParseCampaigns", {
18773
+ count: String(campaigns.length)
18774
+ });
18775
+ return _context19.a(2, campaigns);
18776
+ case 5:
18777
+ _context19.p = 5;
18778
+ _t19 = _context19.v;
18779
+ this.logError(_t19, {
18780
+ functionName: "fetchAndParseCampaigns"
18781
+ });
18782
+ throw new Error("Failed to fetch and parse campaigns", {
18783
+ cause: _t19
18784
+ });
18785
+ case 6:
18786
+ return _context19.a(2);
18787
+ }
18788
+ }, _callee19, this, [[0, 5]]);
18789
+ }));
18790
+ function fetchAndParseCampaigns(_x45, _x46) {
18791
+ return _fetchAndParseCampaigns.apply(this, arguments);
18792
+ }
18793
+ return fetchAndParseCampaigns;
18794
+ }())
18449
18795
  }, {
18450
18796
  key: "fetchAndParseCategories",
18451
18797
  value: function () {
18452
- var _fetchAndParseCategories = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee18(placeId) {
18453
- var cachedCategories, response, errorBody, categories, _t18;
18454
- return repository_regenerator().w(function (_context18) {
18455
- while (1) switch (_context18.p = _context18.n) {
18798
+ var _fetchAndParseCategories = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee20(placeId) {
18799
+ var cachedCategories, response, errorBody, categories, _t20;
18800
+ return repository_regenerator().w(function (_context20) {
18801
+ while (1) switch (_context20.p = _context20.n) {
18456
18802
  case 0:
18457
- _context18.p = 0;
18803
+ _context20.p = 0;
18458
18804
  // Check cache first
18459
18805
  cachedCategories = this.cache.getCategories(placeId || "default", this.currentLang);
18460
18806
  if (!(cachedCategories != null)) {
18461
- _context18.n = 1;
18807
+ _context20.n = 1;
18462
18808
  break;
18463
18809
  }
18464
18810
  this.logEvent("fetchAndParseCategories", {
18465
18811
  cached: "true"
18466
18812
  });
18467
- return _context18.a(2, cachedCategories.data);
18813
+ return _context20.a(2, cachedCategories.data);
18468
18814
  case 1:
18469
- _context18.n = 2;
18815
+ _context20.n = 2;
18470
18816
  return this.requester.fetchCategories(this.token, placeId);
18471
18817
  case 2:
18472
- response = _context18.v;
18818
+ response = _context20.v;
18473
18819
  if (response.ok) {
18474
- _context18.n = 4;
18820
+ _context20.n = 4;
18475
18821
  break;
18476
18822
  }
18477
- _context18.n = 3;
18823
+ _context20.n = 3;
18478
18824
  return response.json();
18479
18825
  case 3:
18480
- errorBody = _context18.v;
18826
+ errorBody = _context20.v;
18481
18827
  throw new Error("Fetch failed with status ".concat(response.status, ": ").concat(extractErrorMessage(errorBody)));
18482
18828
  case 4:
18483
- _context18.n = 5;
18829
+ _context20.n = 5;
18484
18830
  return response.json();
18485
18831
  case 5:
18486
- categories = _context18.v;
18832
+ categories = _context20.v;
18487
18833
  // Cache the result
18488
18834
  this.cache.setCategories(placeId || "default", this.currentLang, {
18489
18835
  timestamp: Date.now(),
@@ -18492,19 +18838,19 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
18492
18838
  this.logEvent("fetchAndParseCategories", {
18493
18839
  cached: "false"
18494
18840
  });
18495
- return _context18.a(2, categories);
18841
+ return _context20.a(2, categories);
18496
18842
  case 6:
18497
- _context18.p = 6;
18498
- _t18 = _context18.v;
18843
+ _context20.p = 6;
18844
+ _t20 = _context20.v;
18499
18845
  throw new Error("Failed to fetch and parse categories", {
18500
- cause: _t18
18846
+ cause: _t20
18501
18847
  });
18502
18848
  case 7:
18503
- return _context18.a(2);
18849
+ return _context20.a(2);
18504
18850
  }
18505
- }, _callee18, this, [[0, 6]]);
18851
+ }, _callee20, this, [[0, 6]]);
18506
18852
  }));
18507
- function fetchAndParseCategories(_x39) {
18853
+ function fetchAndParseCategories(_x47) {
18508
18854
  return _fetchAndParseCategories.apply(this, arguments);
18509
18855
  }
18510
18856
  return fetchAndParseCategories;
@@ -18512,43 +18858,43 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
18512
18858
  }, {
18513
18859
  key: "fetchAndParseCssCustomization",
18514
18860
  value: function () {
18515
- var _fetchAndParseCssCustomization = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee19(type) {
18516
- var response, errorBody, cssCustomization, _t19;
18517
- return repository_regenerator().w(function (_context19) {
18518
- while (1) switch (_context19.p = _context19.n) {
18861
+ var _fetchAndParseCssCustomization = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee21(type) {
18862
+ var response, errorBody, cssCustomization, _t21;
18863
+ return repository_regenerator().w(function (_context21) {
18864
+ while (1) switch (_context21.p = _context21.n) {
18519
18865
  case 0:
18520
- _context19.p = 0;
18521
- _context19.n = 1;
18866
+ _context21.p = 0;
18867
+ _context21.n = 1;
18522
18868
  return this.requester.fetchCssCustomization(this.token, type);
18523
18869
  case 1:
18524
- response = _context19.v;
18870
+ response = _context21.v;
18525
18871
  if (response.ok) {
18526
- _context19.n = 3;
18872
+ _context21.n = 3;
18527
18873
  break;
18528
18874
  }
18529
- _context19.n = 2;
18875
+ _context21.n = 2;
18530
18876
  return response.json();
18531
18877
  case 2:
18532
- errorBody = _context19.v;
18878
+ errorBody = _context21.v;
18533
18879
  throw new Error("Fetch failed with status ".concat(response.status, ": ").concat(extractErrorMessage(errorBody)));
18534
18880
  case 3:
18535
- _context19.n = 4;
18881
+ _context21.n = 4;
18536
18882
  return response.json();
18537
18883
  case 4:
18538
- cssCustomization = _context19.v;
18539
- return _context19.a(2, cssCustomization);
18884
+ cssCustomization = _context21.v;
18885
+ return _context21.a(2, cssCustomization);
18540
18886
  case 5:
18541
- _context19.p = 5;
18542
- _t19 = _context19.v;
18887
+ _context21.p = 5;
18888
+ _t21 = _context21.v;
18543
18889
  throw new Error("Failed to fetch and parse css customization", {
18544
- cause: _t19
18890
+ cause: _t21
18545
18891
  });
18546
18892
  case 6:
18547
- return _context19.a(2);
18893
+ return _context21.a(2);
18548
18894
  }
18549
- }, _callee19, this, [[0, 5]]);
18895
+ }, _callee21, this, [[0, 5]]);
18550
18896
  }));
18551
- function fetchAndParseCssCustomization(_x40) {
18897
+ function fetchAndParseCssCustomization(_x48) {
18552
18898
  return _fetchAndParseCssCustomization.apply(this, arguments);
18553
18899
  }
18554
18900
  return fetchAndParseCssCustomization;
@@ -18556,34 +18902,34 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
18556
18902
  }, {
18557
18903
  key: "postAndParseHealthPing",
18558
18904
  value: function () {
18559
- var _postAndParseHealthPing = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee20(healthPingId, placeId, totemId, status) {
18905
+ var _postAndParseHealthPing = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee22(healthPingId, placeId, totemId, status) {
18560
18906
  var response, errorBody, data;
18561
- return repository_regenerator().w(function (_context20) {
18562
- while (1) switch (_context20.n) {
18907
+ return repository_regenerator().w(function (_context22) {
18908
+ while (1) switch (_context22.n) {
18563
18909
  case 0:
18564
- _context20.n = 1;
18910
+ _context22.n = 1;
18565
18911
  return this.requester.postHealth(this.token, healthPingId, placeId, totemId, status);
18566
18912
  case 1:
18567
- response = _context20.v;
18913
+ response = _context22.v;
18568
18914
  if (response.ok) {
18569
- _context20.n = 3;
18915
+ _context22.n = 3;
18570
18916
  break;
18571
18917
  }
18572
- _context20.n = 2;
18918
+ _context22.n = 2;
18573
18919
  return response.json();
18574
18920
  case 2:
18575
- errorBody = _context20.v;
18921
+ errorBody = _context22.v;
18576
18922
  throw new Error("Post failed with status ".concat(response.status, ": ").concat(extractErrorMessage(errorBody)));
18577
18923
  case 3:
18578
- _context20.n = 4;
18924
+ _context22.n = 4;
18579
18925
  return response.json();
18580
18926
  case 4:
18581
- data = _context20.v;
18582
- return _context20.a(2, data);
18927
+ data = _context22.v;
18928
+ return _context22.a(2, data);
18583
18929
  }
18584
- }, _callee20, this);
18930
+ }, _callee22, this);
18585
18931
  }));
18586
- function postAndParseHealthPing(_x41, _x42, _x43, _x44) {
18932
+ function postAndParseHealthPing(_x49, _x50, _x51, _x52) {
18587
18933
  return _postAndParseHealthPing.apply(this, arguments);
18588
18934
  }
18589
18935
  return postAndParseHealthPing;
@@ -19704,7 +20050,49 @@ var Scene3DController = /*#__PURE__*/function () {
19704
20050
  return _onMapLoad.apply(this, arguments);
19705
20051
  }
19706
20052
  return onMapLoad;
19707
- }() /** Re-applies zoom-based model transparency and evaluates LOD; call on every map `zoom`. */
20053
+ }()
20054
+ /**
20055
+ * Re-attaches the style-owned half of the 3D scene after the map style has been fully
20056
+ * replaced (`map.setStyle(..., { diff: false })`).
20057
+ *
20058
+ * A full swap deletes every layer, so MapLibre removes the GLB custom layer and calls
20059
+ * its `onRemove` — which runs {@link dispose} and frees the renderer, the GLB roots and
20060
+ * the templates. `onMapLoad` is the only other place that adds the layer and it never
20061
+ * runs twice, so without this call the models are gone permanently and the MapLibre
20062
+ * icon layers that deck.gl replaced come back on top of the deck icons.
20063
+ *
20064
+ * Only style-owned state is rebuilt. The deck.gl overlay is a map CONTROL, not a style
20065
+ * layer, so it survives the swap untouched — re-adding it here would stack a second
20066
+ * overlay on the map. Its layers are repopulated separately by the map's
20067
+ * `refreshOverlay` call in `whenStyleUpdates`.
20068
+ *
20069
+ * No-op before `onMapLoad` has run (2D mode, or the lazy 3D libraries still loading):
20070
+ * `deckMod` is the same readiness signal `onMapLoad` itself checks, and the initial
20071
+ * `onMapLoad` will add the layer once it completes.
20072
+ */
20073
+ }, {
20074
+ key: "reattachToStyle",
20075
+ value: function reattachToStyle() {
20076
+ if (!this.deckMod) return;
20077
+
20078
+ // Hide MapLibre icon layers again — replaced by deck.gl IconLayer. These are layout
20079
+ // properties on the STYLE's layers, so the swap reset them to visible.
20080
+ this.hideLayers(this.scene3DConfig.hideLayers);
20081
+
20082
+ // `dispose()` (via the removed layer's `onRemove`) uninstalled this.
20083
+ this.installDebugStatsHook();
20084
+ var models = this.scene3DConfig.models;
20085
+ var glbModelsActive = models !== undefined && models.enabled !== false && models.assets.length > 0;
20086
+
20087
+ // `createGlbCustomLayer` rebuilds the scene, its lights and the renderer (in `onAdd`)
20088
+ // and kicks off a fresh template load, so it fully recovers from the dispose.
20089
+ if (glbModelsActive) {
20090
+ this.map.addLayer(this.createGlbCustomLayer());
20091
+ }
20092
+ this.updateDeckOverlay();
20093
+ }
20094
+
20095
+ /** Re-applies zoom-based model transparency and evaluates LOD; call on every map `zoom`. */
19708
20096
  }, {
19709
20097
  key: "onZoom",
19710
20098
  value: function onZoom() {
@@ -21146,6 +21534,14 @@ var MAX_TILE_RETRIES = 5;
21146
21534
  */
21147
21535
  var TILE_RETRY_BASE_DELAY_MS = 1000;
21148
21536
 
21537
+ /**
21538
+ * Safety deadline for {@link InternalMapVXMap.setStyle}'s `onStyleReady` callback. The
21539
+ * callback normally fires on the map's `idle` event, but `idle` may never arrive (the
21540
+ * style request failed, the swap never settles). Callers hide the map behind a loading
21541
+ * overlay until the callback arrives, so it must be released no matter what.
21542
+ */
21543
+ var STYLE_READY_TIMEOUT_MS = 4000;
21544
+
21149
21545
  /** Bookkeeping for one tile in the retry queue. */
21150
21546
 
21151
21547
  /** Fill/line layer ids for one circle render-order bucket. */
@@ -21316,10 +21712,16 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
21316
21712
  * @returns A new instance of MapVXMap.
21317
21713
  */
21318
21714
  function InternalMapVXMap(mapConfig, container, token) {
21319
- var _mapConfig$lang, _mapConfig$lang2, _mapConfig$mode;
21715
+ var _mapConfig$lang, _mapConfig$lang2, _mapConfig$lang3, _mapConfig$mode;
21320
21716
  var _this;
21321
21717
  map_classCallCheck(this, InternalMapVXMap);
21322
21718
  _this = map_callSuper(this, InternalMapVXMap);
21719
+ /**
21720
+ * Logged-in user's bearer token, if the map was created with one.
21721
+ * When present, `setStyle` resolves styles through the bearer-authenticated
21722
+ * style endpoint (user-authorized, per client) instead of the api-key SDK
21723
+ * surface, so client styles can be previewed/applied without api-key scopes.
21724
+ */
21323
21725
  /**
21324
21726
  * Id of the live route currently drawn by {@link addLiveRoute}. A live route is
21325
21727
  * refreshed repeatedly as the user moves, so each refresh replaces this one
@@ -21337,6 +21739,34 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
21337
21739
  map_defineProperty(_this, "subPlaces", []);
21338
21740
  map_defineProperty(_this, "currentFloor", "");
21339
21741
  map_defineProperty(_this, "baseFilters", {});
21742
+ /**
21743
+ * Layer ids whose declared (base) filter has already been resolved — either captured
21744
+ * into {@link baseFilters} or confirmed absent.
21745
+ *
21746
+ * `baseFilters[id] === undefined` cannot carry that information on its own: it means
21747
+ * both "not looked at yet" and "looked at, the layer declares no filter". Without the
21748
+ * distinction, a later pass re-reads the layer's LIVE filter — which by then is the
21749
+ * one this class wrote — and stores our own floor/public-place filter as if it were
21750
+ * the style's, so the layer keeps filtering by a stale floor forever.
21751
+ *
21752
+ * An id lands here the moment its declared filter is read from the style spec, or the
21753
+ * moment this class writes a filter to that layer, whichever happens first. Layers
21754
+ * added asynchronously after a `setStyle` swap are in neither situation, so their
21755
+ * genuinely pristine live filter is still captured on first touch.
21756
+ */
21757
+ map_defineProperty(_this, "capturedBaseFilters", new Set());
21758
+ /**
21759
+ * Monotonic id of the most recently STARTED style swap. Every {@link setStyle} call
21760
+ * captures its own value and checks it again in each async continuation, so a
21761
+ * superseded swap can neither touch the shared bookkeeping (`styleReadyTimer`,
21762
+ * `pendingStyleSwapListener`) nor apply its obsolete style to the live map.
21763
+ *
21764
+ * A per-call `readied` flag is not enough: the timer and the listener slot are
21765
+ * single-valued instance state, so two overlapping swaps otherwise clobber each
21766
+ * other's — one caller's overlay is released by the other's failure, or an
21767
+ * abandoned listener re-seeds filters from layer ids the current style lacks.
21768
+ */
21769
+ map_defineProperty(_this, "styleSwapGeneration", 0);
21340
21770
  map_defineProperty(_this, "markers", []);
21341
21771
  map_defineProperty(_this, "circles", []);
21342
21772
  map_defineProperty(_this, "enableHover", false);
@@ -21357,9 +21787,12 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
21357
21787
  _this.repository = new Repository(token, (_mapConfig$lang2 = mapConfig.lang) !== null && _mapConfig$lang2 !== void 0 ? _mapConfig$lang2 : "en", mapConfig.apiUrl, undefined, mapConfig.mapvxRequestContext, {
21358
21788
  routeApiUrl: mapConfig.routeApiUrl,
21359
21789
  healthApiUrl: mapConfig.healthApiUrl,
21360
- legacyApiUrl: mapConfig.legacyApiUrl
21790
+ legacyApiUrl: mapConfig.legacyApiUrl,
21791
+ portalApiUrl: mapConfig.portalApiUrl
21361
21792
  });
21362
21793
  _this.token = token;
21794
+ _this.authToken = mapConfig.authToken;
21795
+ _this.currentLang = (_mapConfig$lang3 = mapConfig.lang) !== null && _mapConfig$lang3 !== void 0 ? _mapConfig$lang3 : "en";
21363
21796
  _this.parentPlaceId = mapConfig.parentPlaceId;
21364
21797
  _this.routeController = new RouteController(_this);
21365
21798
  _this.userLocationMarker = undefined;
@@ -21577,6 +22010,17 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
21577
22010
  style.layers.filter(function (layer) {
21578
22011
  return layer.id.startsWith("indoor-");
21579
22012
  }).forEach(function (layer) {
22013
+ // Seed from the STYLE SPEC — the only pristine source — and do it BEFORE the
22014
+ // setFilter below overwrites the live filter. Reading it back afterwards would
22015
+ // return our own `publicPlaceFilter` and store it as the layer's declared one,
22016
+ // turning `public_place` from an OR into an AND and hiding every private
22017
+ // feature on the selected floor. Every indoor layer is covered, not just
22018
+ // fill/line/symbol: a `circle` layer is discriminated by its filter just the
22019
+ // same, and dropping it makes the layer repaint every feature.
22020
+ // `filter` is absent from the union member for `background` layers, hence the
22021
+ // structural read rather than `layer.filter`.
22022
+ var declared = layer.filter;
22023
+ _this7.captureDeclaredBaseFilter(layer.id, declared);
21580
22024
  var baseFilter = _this7.baseFilters[layer.id];
21581
22025
  if (baseFilter != null) {
21582
22026
  var finalFilter = ["all", baseFilter, publicPlaceFilter];
@@ -21584,20 +22028,31 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
21584
22028
  } else {
21585
22029
  _this7.map.setFilter(layer.id, publicPlaceFilter);
21586
22030
  }
21587
- switch (layer.type) {
21588
- case "line":
21589
- case "symbol":
21590
- case "fill-extrusion":
21591
- case "fill":
21592
- if (layer.filter != null) {
21593
- _this7.baseFilters[layer.id] = layer.filter;
21594
- }
21595
- break;
21596
- default:
21597
- break;
21598
- }
21599
22031
  });
21600
22032
  }
22033
+
22034
+ /**
22035
+ * Records a layer's declared (base) filter the first time the layer is seen, from an
22036
+ * explicit value (a style-spec `filter`) when one is available, otherwise by reading
22037
+ * the live filter — which is only pristine for layers this class has never written to.
22038
+ *
22039
+ * Marking happens even when no filter exists, so the layer is never revisited: on a
22040
+ * second visit its live filter is one we produced, and storing that as the "declared"
22041
+ * filter is what freezes a layer to a stale floor.
22042
+ *
22043
+ * @param layerId Id of the layer whose base filter should be resolved.
22044
+ * @param declared Declared filter straight from the style spec, when the caller has it.
22045
+ */
22046
+ }, {
22047
+ key: "captureDeclaredBaseFilter",
22048
+ value: function captureDeclaredBaseFilter(layerId, declared) {
22049
+ if (this.capturedBaseFilters.has(layerId)) return;
22050
+ this.capturedBaseFilters.add(layerId);
22051
+ var baseFilter = declared !== null && declared !== void 0 ? declared : this.safeGetFilter(layerId);
22052
+ if (baseFilter != null) {
22053
+ this.baseFilters[layerId] = baseFilter;
22054
+ }
22055
+ }
21601
22056
  }, {
21602
22057
  key: "setLayersForLanguage",
21603
22058
  value: function setLayersForLanguage(lang) {
@@ -21657,6 +22112,14 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
21657
22112
  var _this$scene3D;
21658
22113
  this.circles = [];
21659
22114
  this.markerLayoutController.destroy();
22115
+ // Drop any in-flight `setStyle` bookkeeping while the map still exists: the
22116
+ // listener has to be detached before `map.remove()`, and the safety timer must not
22117
+ // outlive the map and call `onStyleReady` for a map that is already gone.
22118
+ this.clearPendingStyleSwapListener();
22119
+ if (this.styleReadyTimer) {
22120
+ clearTimeout(this.styleReadyTimer);
22121
+ this.styleReadyTimer = undefined;
22122
+ }
21660
22123
  // Dispose the 3D scene's GPU resources before the map (and its shared WebGL context) go away —
21661
22124
  // MapLibre's own teardown never calls the custom GLB layer's `onRemove`.
21662
22125
  (_this$scene3D = this.scene3D) === null || _this$scene3D === void 0 || _this$scene3D.dispose();
@@ -21754,6 +22217,13 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
21754
22217
  var useServiceWorkerCaching = _this9.tileCacheConfig.enabled && _this9.tileCacheConfig.persistToServiceWorker;
21755
22218
  var finalStyle = useServiceWorkerCaching ? _this9.transformStyleForCaching(style) : style;
21756
22219
  _this9.map.setStyle(finalStyle);
22220
+ // The new place's style declares its own filters for the same `indoor-*` layer
22221
+ // ids. Without this reset every id is still marked captured from the previous
22222
+ // place, so `captureDeclaredBaseFilter` early-returns for all of them and the
22223
+ // previous place's expressions keep filtering the new style forever. (The
22224
+ // `switch (layer.type)` block that used to re-read them on every style load was
22225
+ // removed when capture became once-per-id, which is what made this necessary.)
22226
+ _this9.resetBaseFilters();
21757
22227
  _this9.whenStyleUpdates(finalStyle);
21758
22228
  onStyleReady === null || onStyleReady === void 0 || onStyleReady();
21759
22229
  })["catch"](console.error);
@@ -21804,6 +22274,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
21804
22274
  value: function setLang(lang) {
21805
22275
  var _this0 = this;
21806
22276
  this.repository.setLang(lang);
22277
+ this.currentLang = lang;
21807
22278
  if (rtlLanguages.includes(lang)) {
21808
22279
  this.setRTLSupport();
21809
22280
  }
@@ -21824,6 +22295,236 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
21824
22295
  value: function setParentPlace(place, updateStyle, onStyleReady) {
21825
22296
  this.changeParentPlaceTo(place, updateStyle, onStyleReady);
21826
22297
  }
22298
+ }, {
22299
+ key: "setStyle",
22300
+ value: function setStyle(styleRef, styleTheme, onStyleReady) {
22301
+ var _this1 = this;
22302
+ // Every swap gets a generation. All shared bookkeeping below is touched only while
22303
+ // this swap is still the current one, so two overlapping calls cannot release each
22304
+ // other's overlay or apply an obsolete style. `readied` stays per-call because each
22305
+ // caller's callback must still fire exactly once.
22306
+ var generation = ++this.styleSwapGeneration;
22307
+ var isCurrent = function isCurrent() {
22308
+ return _this1.styleSwapGeneration === generation;
22309
+ };
22310
+ var readied = false;
22311
+ var reportReady = function reportReady(error) {
22312
+ if (readied) return;
22313
+ readied = true;
22314
+ // Only the current swap owns the shared timer; a superseded swap clearing it here
22315
+ // would leave the live swap with no safety net (and its caller hidden forever).
22316
+ if (isCurrent() && _this1.styleReadyTimer) {
22317
+ clearTimeout(_this1.styleReadyTimer);
22318
+ _this1.styleReadyTimer = undefined;
22319
+ }
22320
+ onStyleReady === null || onStyleReady === void 0 || onStyleReady(error);
22321
+ };
22322
+
22323
+ // `onStyleReady` must fire on EVERY path — success, a rejected style request, or a
22324
+ // swap that never settles — because callers keep the map hidden behind a loading
22325
+ // overlay until it arrives. The safety timer is therefore armed before the request
22326
+ // instead of inside `.then()`.
22327
+ if (this.styleReadyTimer) clearTimeout(this.styleReadyTimer);
22328
+ this.styleReadyTimer = setTimeout(reportReady, STYLE_READY_TIMEOUT_MS);
22329
+
22330
+ // A previous swap may still hold a `styledata` listener whose style never reached the
22331
+ // loaded state. Drop it before starting a new one: it captured an obsolete style and
22332
+ // would otherwise fire on this swap, wiping `baseFilters` and calling `setFilter`
22333
+ // with layer ids the new style does not have.
22334
+ this.clearPendingStyleSwapListener();
22335
+
22336
+ // `this.map` is created asynchronously (see `onMapStyleLoaded`), so a `setStyle` call
22337
+ // made right after `createMap` can land before it exists. Fail loudly instead of
22338
+ // letting `this.map.setStyle` throw into `.catch`, which reported READY and left the
22339
+ // caller revealing the previous style as if the swap had succeeded.
22340
+ if (!this.map) {
22341
+ var error = new Error("setStyle called before the map finished initializing; wait for the map's load event");
22342
+ this.logError(error, {
22343
+ functionName: "setStyle"
22344
+ });
22345
+ reportReady(error);
22346
+ return;
22347
+ }
22348
+
22349
+ // When a user bearer token is present, the style is resolved through the
22350
+ // bearer-authenticated endpoint, which authorizes by the user's client access
22351
+ // rather than the api key's scopes — so a client's branded style can be
22352
+ // previewed/applied without granting that place to a shared api key.
22353
+ // Api-key consumers keep the `/api/sdk/v2/mapStyleJson` path.
22354
+ var stylePromise = this.authToken ? this.repository.fetchAndParseMapStyleByBearer(this.parentPlaceId, this.authToken, styleRef, styleTheme) : this.repository.fetchAndParseMapStyle(this.parentPlaceId, styleRef, styleTheme);
22355
+ stylePromise.then(function (style) {
22356
+ // A newer swap started while this style was in flight. Applying this one now
22357
+ // would fight the newer style layer by layer, so drop it and let the newer swap
22358
+ // own the map and its caller's callback.
22359
+ if (!isCurrent()) return;
22360
+ var useServiceWorkerCaching = _this1.tileCacheConfig.enabled && _this1.tileCacheConfig.persistToServiceWorker;
22361
+ var finalStyle = useServiceWorkerCaching ? _this1.transformStyleForCaching(style) : style;
22362
+ // Full (non-diff) swap so the previewed style completely replaces the base —
22363
+ // a diff would keep old base layers and reappear on the next floor change.
22364
+ _this1.map.setStyle(finalStyle, {
22365
+ diff: false
22366
+ });
22367
+
22368
+ // Drop the previous style's base filters SYNCHRONOUSLY, right where the layers
22369
+ // they describe stop existing. They are keyed by layer id and persist across
22370
+ // swaps, so any code reading them before the apply pass below (the `idle`
22371
+ // handler's `filterByFloorKey`, a floor change racing the swap) would AND the
22372
+ // previous style's discriminator into the new style's layers — the stale-filter
22373
+ // washout this reset exists to prevent. Gating it on `isStyleLoaded` left exactly
22374
+ // that window open. Fresh declared filters are re-captured lazily in
22375
+ // `applyLayerFilters` as each indoor layer is first touched.
22376
+ _this1.resetBaseFilters();
22377
+
22378
+ // Re-apply floor filters, route/circle layers and markers ONLY once the new
22379
+ // style's sources/layers have finished loading; running them mid-reload throws
22380
+ // (`getSource` on an undefined style) and the floor filter would not stick.
22381
+ var _applyOnceLoaded = function applyOnceLoaded() {
22382
+ // Superseded: detach and leave the map to the newer swap. Without this the
22383
+ // listener stays attached (the slot it was tracked in has been overwritten)
22384
+ // and re-seeds filters from layer ids the current style does not have, which
22385
+ // makes maplibre throw and aborts the newer swap's own listener.
22386
+ if (!isCurrent()) {
22387
+ _this1.map.off("styledata", _applyOnceLoaded);
22388
+ return;
22389
+ }
22390
+ if (!_this1.hasLoadedStyle()) return;
22391
+ _this1.map.off("styledata", _applyOnceLoaded);
22392
+ if (_this1.pendingStyleSwapListener === _applyOnceLoaded) {
22393
+ _this1.pendingStyleSwapListener = undefined;
22394
+ }
22395
+ _this1.whenStyleUpdates(finalStyle);
22396
+ // A non-diff swap replaces every layer, so anything applied ON TOP of the
22397
+ // style — label language, caller-requested place highlights, the 3D scene's
22398
+ // GLB layer and hidden-layer overrides — is gone and has to be replayed.
22399
+ // `whenStyleUpdates` covers only floor filters, routes and circles.
22400
+ _this1.restoreStyleOverlays();
22401
+ _this1.logEvent("setStyle");
22402
+ };
22403
+ _this1.pendingStyleSwapListener = _applyOnceLoaded;
22404
+ _this1.map.on("styledata", _applyOnceLoaded);
22405
+ _applyOnceLoaded();
22406
+
22407
+ // Re-apply the floor filter and report ready once the map is idle. This is
22408
+ // intentionally OUTSIDE applyOnceLoaded's `isStyleLoaded` gate: the indoor
22409
+ // polygon layers settle a beat after the swap (so the floor filter in
22410
+ // whenStyleUpdates misses them and the venue paints every floor at once), and
22411
+ // `idle` only fires once the style is loaded and its first tiles rendered — so
22412
+ // filterByFloorKey is safe here and does not depend on the sometimes-flaky
22413
+ // isStyleLoaded check. onStyleReady lets callers reveal the map only once it is
22414
+ // settled; the timer armed above just clears a hanging overlay if idle never fires.
22415
+ _this1.map.once("idle", function () {
22416
+ // `once` cannot be cancelled, so a superseded swap's handler still fires —
22417
+ // filtering here keeps it from re-filtering the newer style's floors and from
22418
+ // reporting the newer swap's caller ready ahead of time.
22419
+ if (!isCurrent()) return;
22420
+ _this1.filterByFloorKey(_this1.currentFloor);
22421
+ reportReady();
22422
+ });
22423
+ })["catch"](function (error) {
22424
+ // A superseded swap must not tear down the listener the CURRENT swap installed.
22425
+ if (isCurrent()) {
22426
+ _this1.clearPendingStyleSwapListener();
22427
+ }
22428
+ _this1.logError(error, {
22429
+ functionName: "setStyle"
22430
+ });
22431
+ // Release the caller immediately instead of making it wait out the safety timer:
22432
+ // the style will never arrive, so the overlay has nothing to wait for. The error
22433
+ // is handed to the callback so a caller can tell a failed swap from an applied
22434
+ // one — the previous style is still on screen either way.
22435
+ reportReady(error instanceof Error ? error : new Error(String(error)));
22436
+ });
22437
+ }
22438
+
22439
+ /**
22440
+ * Forgets every captured base filter so the next style's declared filters are read
22441
+ * fresh from that style instead of inherited from the previous one.
22442
+ *
22443
+ * Both halves must move together: `baseFilters` holds the expressions and
22444
+ * `capturedBaseFilters` records which layer ids have already been resolved, so
22445
+ * clearing only the first would leave every id marked "already captured" and the new
22446
+ * style's filters would never be read at all.
22447
+ */
22448
+ }, {
22449
+ key: "resetBaseFilters",
22450
+ value: function resetBaseFilters() {
22451
+ this.baseFilters = {};
22452
+ this.capturedBaseFilters.clear();
22453
+ }
22454
+
22455
+ /**
22456
+ * Replays everything that lives ON TOP of the map style after a full (non-diff) swap
22457
+ * has deleted it: label language expressions, caller-requested place highlights and
22458
+ * the 3D scene's GLB layer / hidden-layer overrides.
22459
+ *
22460
+ * These are deliberately not part of `whenStyleUpdates`, which restores only
22461
+ * style-derived state. These are decisions the SDK's callers made through `setLang`,
22462
+ * `setPlacesAsSelected`, `addBorderToPlaces` and the 3D config, and nothing else would
22463
+ * ever restore them.
22464
+ */
22465
+ }, {
22466
+ key: "restoreStyleOverlays",
22467
+ value: function restoreStyleOverlays() {
22468
+ var _this10 = this;
22469
+ // Each step is isolated: the style itself has already been applied by the time we get
22470
+ // here, so one failing restore must neither skip the others nor bubble out into
22471
+ // `setStyle`'s `.catch`, which would report the successful swap to `onStyleReady` as
22472
+ // a failure. `setPlacesAsSelected` / `addBorderToPlaces` throw by contract.
22473
+ var restore = function restore(what, step) {
22474
+ try {
22475
+ step();
22476
+ } catch (error) {
22477
+ _this10.logError(error, {
22478
+ functionName: "restoreStyleOverlays",
22479
+ step: what
22480
+ });
22481
+ }
22482
+ };
22483
+ restore("language", function () {
22484
+ return _this10.setLayersForLanguage(_this10.currentLang);
22485
+ });
22486
+ if (this.coloredPlacesRequest) {
22487
+ var _this$coloredPlacesRe = this.coloredPlacesRequest,
22488
+ _placeIds = _this$coloredPlacesRe.placeIds,
22489
+ _color = _this$coloredPlacesRe.color;
22490
+ restore("coloredPlaces", function () {
22491
+ return _this10.setPlacesAsSelected(_placeIds, _color);
22492
+ });
22493
+ }
22494
+ if (this.borderedPlacesRequest) {
22495
+ var _this$borderedPlacesR = this.borderedPlacesRequest,
22496
+ _placeIds2 = _this$borderedPlacesR.placeIds,
22497
+ _color2 = _this$borderedPlacesR.color,
22498
+ _width = _this$borderedPlacesR.width;
22499
+ restore("borderedPlaces", function () {
22500
+ return _this10.addBorderToPlaces(_placeIds2, _color2, _width);
22501
+ });
22502
+ }
22503
+
22504
+ // The swap removed the GLB custom layer, and MapLibre called its `onRemove`, which
22505
+ // disposes the whole three.js scene. Nothing else re-adds it, so without this every
22506
+ // 3D model disappears permanently and `hideLayers` stops being applied.
22507
+ restore("scene3D", function () {
22508
+ var _this10$scene3D;
22509
+ return (_this10$scene3D = _this10.scene3D) === null || _this10$scene3D === void 0 ? void 0 : _this10$scene3D.reattachToStyle();
22510
+ });
22511
+ }
22512
+
22513
+ /**
22514
+ * Removes the `styledata` listener left by an in-flight {@link setStyle} swap, if any.
22515
+ * Called before starting a new swap and when one fails, so a listener holding an
22516
+ * obsolete style can never fire against a different style's layers.
22517
+ */
22518
+ }, {
22519
+ key: "clearPendingStyleSwapListener",
22520
+ value: function clearPendingStyleSwapListener() {
22521
+ var _this$map;
22522
+ if (!this.pendingStyleSwapListener) return;
22523
+ // `this.map?` — a listener can only have been installed while the map existed, but
22524
+ // this also runs from `destroyMap` and from `setStyle` before the map is created.
22525
+ (_this$map = this.map) === null || _this$map === void 0 || _this$map.off("styledata", this.pendingStyleSwapListener);
22526
+ this.pendingStyleSwapListener = undefined;
22527
+ }
21827
22528
 
21828
22529
  /**
21829
22530
  * Removes current parent place and updates style to default
@@ -21873,7 +22574,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
21873
22574
  }, {
21874
22575
  key: "addMarker",
21875
22576
  value: function addMarker(marker) {
21876
- var _this1 = this;
22577
+ var _this11 = this;
21877
22578
  try {
21878
22579
  var _marker$maxLabelWidth, _this$innerFloors$fin4, _this$innerFloors$fin5;
21879
22580
  // Check if a marker with the same ID already exists and remove it
@@ -21895,7 +22596,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
21895
22596
  maxLabelWidthPx: (_marker$maxLabelWidth = marker.maxLabelWidthPx) !== null && _marker$maxLabelWidth !== void 0 ? _marker$maxLabelWidth : this.markerLayoutConfig.maxLabelWidthPx
21896
22597
  }));
21897
22598
  var isOutdoor = !this.parentPlace || ((_this$innerFloors$fin4 = (_this$innerFloors$fin5 = this.innerFloors.find(function (floor) {
21898
- return floor.key === _this1.currentFloor;
22599
+ return floor.key === _this11.currentFloor;
21899
22600
  })) === null || _this$innerFloors$fin5 === void 0 ? void 0 : _this$innerFloors$fin5.reachableFromGPS) !== null && _this$innerFloors$fin4 !== void 0 ? _this$innerFloors$fin4 : false);
21900
22601
  markerCreated.changeFloor(this.currentFloor, this.map, isOutdoor);
21901
22602
  this.markers.push(markerCreated);
@@ -22435,12 +23136,12 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
22435
23136
  value: function updateMarkersTo(floorId) {
22436
23137
  var _this$innerFloors$fin8,
22437
23138
  _this$innerFloors$fin9,
22438
- _this10 = this;
23139
+ _this12 = this;
22439
23140
  var isOutdoor = !this.parentPlace || ((_this$innerFloors$fin8 = (_this$innerFloors$fin9 = this.innerFloors.find(function (floor) {
22440
23141
  return floor.key === floorId;
22441
23142
  })) === null || _this$innerFloors$fin9 === void 0 ? void 0 : _this$innerFloors$fin9.reachableFromGPS) !== null && _this$innerFloors$fin8 !== void 0 ? _this$innerFloors$fin8 : false);
22442
23143
  this.markers.forEach(function (e) {
22443
- e.changeFloor(floorId, _this10.map, isOutdoor);
23144
+ e.changeFloor(floorId, _this12.map, isOutdoor);
22444
23145
  });
22445
23146
  this.markerLayoutController.scheduleRelayout();
22446
23147
  }
@@ -22449,14 +23150,14 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
22449
23150
  value: function updateFiltersTo(floorId) {
22450
23151
  var _this$map$getStyle$la3,
22451
23152
  _this$map$getStyle3,
22452
- _this11 = this,
23153
+ _this13 = this,
22453
23154
  _this$innerFloors$fin0;
22454
23155
  if (!this.map) return;
22455
23156
  var layers = (_this$map$getStyle$la3 = (_this$map$getStyle3 = this.map.getStyle()) === null || _this$map$getStyle3 === void 0 ? void 0 : _this$map$getStyle3.layers) !== null && _this$map$getStyle$la3 !== void 0 ? _this$map$getStyle$la3 : [];
22456
23157
  layers.filter(function (l) {
22457
23158
  return l.id.startsWith("base-indoor-");
22458
23159
  }).forEach(function (l) {
22459
- _this11.map.removeLayer(l.id);
23160
+ _this13.map.removeLayer(l.id);
22460
23161
  });
22461
23162
  var baseFloorId = (_this$innerFloors$fin0 = this.innerFloors.find(function (floor) {
22462
23163
  return floor.key === floorId;
@@ -22464,6 +23165,18 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
22464
23165
  var indoorLayers = layers.filter(function (layer) {
22465
23166
  return layer.id.startsWith("indoor-");
22466
23167
  });
23168
+
23169
+ // Resolve each indoor layer's declared (base) filter before we start folding floor
23170
+ // filters into it — and before cloning it into a `base-indoor-*` layer, which copies
23171
+ // the base filter across. Layers added asynchronously after a `setStyle` swap are
23172
+ // missing when `setBaseFilters` runs, so this is where their still-pristine filter
23173
+ // is captured; without it the layer loses its own discrimination and repaints every
23174
+ // feature (the washed-out / blue-outline look after changing floors). Layers already
23175
+ // resolved are skipped, so a filter this class wrote is never mistaken for a
23176
+ // declared one.
23177
+ indoorLayers.forEach(function (layer) {
23178
+ return _this13.captureDeclaredBaseFilter(layer.id);
23179
+ });
22467
23180
  if (baseFloorId != undefined) {
22468
23181
  var _indoorLayers$;
22469
23182
  var firstLayerId = (_indoorLayers$ = indoorLayers[0]) === null || _indoorLayers$ === void 0 ? void 0 : _indoorLayers$.id;
@@ -22472,19 +23185,46 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
22472
23185
  }).forEach(function (layer) {
22473
23186
  var baseLayer = deepClone(layer);
22474
23187
  baseLayer.id = "base-" + layer.id;
22475
- _this11.baseFilters[baseLayer.id] = _this11.baseFilters[layer.id];
22476
- _this11.map.addLayer(baseLayer, firstLayerId);
22477
- _this11.applyLayerFilters(baseLayer, baseFloorId);
23188
+ _this13.baseFilters[baseLayer.id] = _this13.baseFilters[layer.id];
23189
+ _this13.map.addLayer(baseLayer, firstLayerId);
23190
+ _this13.applyLayerFilters(baseLayer, baseFloorId);
22478
23191
  });
22479
23192
  }
22480
23193
  indoorLayers.forEach(function (layer) {
22481
- _this11.applyLayerFilters(layer, floorId);
23194
+ _this13.applyLayerFilters(layer, floorId);
22482
23195
  });
22483
23196
  }
23197
+
23198
+ /**
23199
+ * Reads a layer's current filter, tolerating the layer having been removed or the
23200
+ * style being mid-swap (maplibre `getFilter` throws in those cases). Returns
23201
+ * `undefined` instead of throwing so base-filter capture never aborts floor filtering.
23202
+ */
23203
+ }, {
23204
+ key: "safeGetFilter",
23205
+ value: function safeGetFilter(layerId) {
23206
+ try {
23207
+ return this.map.getFilter(layerId);
23208
+ } catch (_unused) {
23209
+ return undefined;
23210
+ }
23211
+ }
22484
23212
  }, {
22485
23213
  key: "applyLayerFilters",
22486
23214
  value: function applyLayerFilters(layer, floorId) {
22487
23215
  var _this$parentPlaceId2;
23216
+ // Resolve the layer's declared (base) filter the first time we touch it. Indoor
23217
+ // layers such as `indoor-polygon-room` share one source and are told apart only by
23218
+ // their own filter (e.g. `["in","room",["get","tags"]]`); we must fold that into the
23219
+ // floor filter or the layer repaints every feature. Some of these layers are added
23220
+ // asynchronously after a `setStyle` swap, so they are absent when `setBaseFilters`
23221
+ // runs — capturing here, while their live filter is still pristine, is what keeps a
23222
+ // floor change from wiping the style (the washed-out, blue-outline look).
23223
+ // `base-indoor-*` clones inherit their base filter from the layer they were cloned
23224
+ // from, so they are never read back.
23225
+ if (!layer.id.startsWith("base-indoor-")) {
23226
+ this.captureDeclaredBaseFilter(layer.id);
23227
+ }
22488
23228
  var baseFilter = this.baseFilters[layer.id];
22489
23229
  var floorIdString = floorId !== null && floorId !== void 0 ? floorId : "";
22490
23230
  var floorFilter = ["any", ["in", floorIdString, ["get", "floor_key"]]];
@@ -22501,6 +23241,11 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
22501
23241
  } else if (!layer.id.includes("colored") && (layer.type == "fill" || layer.type === "fill-extrusion")) {
22502
23242
  customFilters.push(["!", ["in", this.hoveredId, ["get", "ref"]]]);
22503
23243
  }
23244
+
23245
+ // From here on this layer's live filter is ours, never the style's declared one.
23246
+ // Marking it keeps any later pass from reading it back as a base filter — that is
23247
+ // what used to AND the previous floor into the next one and blank the layer out.
23248
+ this.capturedBaseFilters.add(layer.id);
22504
23249
  if (baseFilter != null) {
22505
23250
  var finalFilter = ["all", baseFilter, customFilters];
22506
23251
  this.map.setFilter(layer.id, finalFilter);
@@ -22999,17 +23744,17 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
22999
23744
  }, {
23000
23745
  key: "defaultClickListener",
23001
23746
  value: function defaultClickListener() {
23002
- var _this12 = this;
23747
+ var _this14 = this;
23003
23748
  this.map.on("click", /*#__PURE__*/function () {
23004
23749
  var _ref4 = map_asyncToGenerator(/*#__PURE__*/map_regenerator().m(function _callee3(e) {
23005
23750
  var features, roomFeatures, touchedFeature, ref, _clickedPlace, _ref5, _clickedPlace$mapvxId, _clickedPlace2, _clickedPlace3, clickedPlace, _iterator3, _step3, potentialParentPlace, cachedSubPlaces, cachedPlaces, clickedPlaceId, _t3;
23006
23751
  return map_regenerator().w(function (_context3) {
23007
23752
  while (1) switch (_context3.p = _context3.n) {
23008
23753
  case 0:
23009
- features = _this12.map.queryRenderedFeatures(e.point); // Filter room features by current floor
23754
+ features = _this14.map.queryRenderedFeatures(e.point); // Filter room features by current floor
23010
23755
  roomFeatures = features.filter(function (feature) {
23011
23756
  var _feature$properties;
23012
- return feature.properties["class"] === "room" && ((_feature$properties = feature.properties) === null || _feature$properties === void 0 ? void 0 : _feature$properties.floor_key) === _this12.currentFloor;
23757
+ return feature.properties["class"] === "room" && ((_feature$properties = feature.properties) === null || _feature$properties === void 0 ? void 0 : _feature$properties.floor_key) === _this14.currentFloor;
23013
23758
  });
23014
23759
  touchedFeature = roomFeatures[0];
23015
23760
  ref = touchedFeature === null || touchedFeature === void 0 ? void 0 : touchedFeature.properties.ref;
@@ -23020,14 +23765,14 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
23020
23765
  console.log("touchedFeature", ref);
23021
23766
 
23022
23767
  // First, search in current subPlaces
23023
- clickedPlace = _this12.subPlaces.find(function (subPlace) {
23768
+ clickedPlace = _this14.subPlaces.find(function (subPlace) {
23024
23769
  return subPlace.mapvxId === ref;
23025
23770
  }); // If not found, search in subplaces of potential parent places
23026
23771
  if (!(clickedPlace === undefined)) {
23027
23772
  _context3.n = 7;
23028
23773
  break;
23029
23774
  }
23030
- _iterator3 = map_createForOfIteratorHelper(_this12.potentialParentPlaces);
23775
+ _iterator3 = map_createForOfIteratorHelper(_this14.potentialParentPlaces);
23031
23776
  _context3.p = 1;
23032
23777
  _iterator3.s();
23033
23778
  case 2:
@@ -23036,7 +23781,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
23036
23781
  break;
23037
23782
  }
23038
23783
  potentialParentPlace = _step3.value;
23039
- cachedSubPlaces = _this12.repository.getCachedSubPlaces(potentialParentPlace.mapvxId);
23784
+ cachedSubPlaces = _this14.repository.getCachedSubPlaces(potentialParentPlace.mapvxId);
23040
23785
  if (!cachedSubPlaces) {
23041
23786
  _context3.n = 3;
23042
23787
  break;
@@ -23068,14 +23813,14 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
23068
23813
  _context3.n = 10;
23069
23814
  break;
23070
23815
  }
23071
- cachedPlaces = _this12.repository.getCachedPlaces([ref]);
23816
+ cachedPlaces = _this14.repository.getCachedPlaces([ref]);
23072
23817
  if (!(cachedPlaces.length === 0)) {
23073
23818
  _context3.n = 9;
23074
23819
  break;
23075
23820
  }
23076
23821
  console.log("fetching place detail from server", ref);
23077
23822
  _context3.n = 8;
23078
- return _this12.repository.fetchAndParsePlaceDetail({
23823
+ return _this14.repository.fetchAndParsePlaceDetail({
23079
23824
  id: ref
23080
23825
  });
23081
23826
  case 8:
@@ -23088,8 +23833,8 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
23088
23833
  case 10:
23089
23834
  console.log("clickedPlace", (_clickedPlace = clickedPlace) === null || _clickedPlace === void 0 ? void 0 : _clickedPlace.title);
23090
23835
  clickedPlaceId = (_ref5 = (_clickedPlace$mapvxId = (_clickedPlace2 = clickedPlace) === null || _clickedPlace2 === void 0 ? void 0 : _clickedPlace2.mapvxId) !== null && _clickedPlace$mapvxId !== void 0 ? _clickedPlace$mapvxId : (_clickedPlace3 = clickedPlace) === null || _clickedPlace3 === void 0 ? void 0 : _clickedPlace3.clientId) !== null && _ref5 !== void 0 ? _ref5 : "";
23091
- if (clickedPlace !== undefined && _this12.clickCallback) {
23092
- _this12.clickCallback(clickedPlaceId);
23836
+ if (clickedPlace !== undefined && _this14.clickCallback) {
23837
+ _this14.clickCallback(clickedPlaceId);
23093
23838
  }
23094
23839
  case 11:
23095
23840
  return _context3.a(2);
@@ -23104,35 +23849,39 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
23104
23849
  }, {
23105
23850
  key: "onHover",
23106
23851
  value: function onHover() {
23107
- var _this13 = this;
23852
+ var _this15 = this;
23108
23853
  if (!this.enableHover) return;
23109
23854
  this.map.on("mousemove", "hoverable", function (e) {
23110
23855
  var _e$features;
23111
23856
  var feature = (_e$features = e.features) === null || _e$features === void 0 ? void 0 : _e$features.find(function (feature) {
23112
23857
  var _feature$properties$r, _feature$properties2;
23113
- return ((_feature$properties$r = feature.properties.ref) === null || _feature$properties$r === void 0 ? void 0 : _feature$properties$r.length) > 0 && ((_feature$properties2 = feature.properties) === null || _feature$properties2 === void 0 ? void 0 : _feature$properties2.floor_key) === _this13.currentFloor;
23858
+ return ((_feature$properties$r = feature.properties.ref) === null || _feature$properties$r === void 0 ? void 0 : _feature$properties$r.length) > 0 && ((_feature$properties2 = feature.properties) === null || _feature$properties2 === void 0 ? void 0 : _feature$properties2.floor_key) === _this15.currentFloor;
23114
23859
  });
23115
23860
  var ref = feature === null || feature === void 0 ? void 0 : feature.properties.ref;
23116
23861
  if (ref != null && typeof ref === "string" && ref.length > 0) {
23117
- _this13.hoveredId = ref;
23118
- _this13.updateFiltersTo(_this13.currentFloor);
23119
- } else if (ref === undefined && _this13.hoveredId !== "unselected") {
23120
- _this13.hoveredId = "unselected";
23121
- _this13.updateFiltersTo(_this13.currentFloor);
23862
+ _this15.hoveredId = ref;
23863
+ _this15.updateFiltersTo(_this15.currentFloor);
23864
+ } else if (ref === undefined && _this15.hoveredId !== "unselected") {
23865
+ _this15.hoveredId = "unselected";
23866
+ _this15.updateFiltersTo(_this15.currentFloor);
23122
23867
  }
23123
23868
  });
23124
23869
 
23125
23870
  // When the mouse leaves the state-fill layer, update the feature state of the
23126
23871
  // previously hovered feature.
23127
23872
  this.map.on("mouseleave", "hoverable", function () {
23128
- _this13.hoveredId = "unselected";
23129
- _this13.updateFiltersTo(_this13.currentFloor);
23873
+ _this15.hoveredId = "unselected";
23874
+ _this15.updateFiltersTo(_this15.currentFloor);
23130
23875
  });
23131
23876
  }
23132
23877
  }, {
23133
23878
  key: "setPlacesAsSelected",
23134
23879
  value: function setPlacesAsSelected(placeIds, color) {
23135
23880
  try {
23881
+ this.coloredPlacesRequest = {
23882
+ placeIds: map_toConsumableArray(placeIds),
23883
+ color: color
23884
+ };
23136
23885
  if (!this.hasLayer("indoor-colored-places")) {
23137
23886
  this.createColoredPlacesLayer();
23138
23887
  }
@@ -23144,6 +23893,9 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
23144
23893
  var placeFilter = ["any"].concat(map_toConsumableArray(coloredPlacesFilters));
23145
23894
  var condition = ["all", placeFilter, basicFilter];
23146
23895
  this.map.setFilter("indoor-colored-places", condition);
23896
+ // Caller-defined base filter: mark it resolved so no later capture can
23897
+ // overwrite this customization with the layer's style-declared filter.
23898
+ this.capturedBaseFilters.add("indoor-colored-places");
23147
23899
  this.baseFilters["indoor-colored-places"] = placeFilter;
23148
23900
  if (color !== undefined) {
23149
23901
  var layer = this.map.getLayer("indoor-colored-places");
@@ -23226,8 +23978,12 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
23226
23978
  }, {
23227
23979
  key: "clearColoredPlaces",
23228
23980
  value: function clearColoredPlaces() {
23981
+ this.coloredPlacesRequest = undefined;
23229
23982
  if (this.hasLayer("indoor-colored-places")) {
23230
23983
  var condition = ["==", ["get", "ref"], "unselected"];
23984
+ // Caller-defined base filter: mark it resolved so no later capture can
23985
+ // overwrite this customization with the layer's style-declared filter.
23986
+ this.capturedBaseFilters.add("indoor-colored-places");
23231
23987
  this.baseFilters["indoor-colored-places"] = condition;
23232
23988
  this.map.setFilter("indoor-colored-places", condition);
23233
23989
  }
@@ -23516,7 +24272,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
23516
24272
  }, {
23517
24273
  key: "addUserLocationTracking",
23518
24274
  value: function addUserLocationTracking(enableHighAccuracy, geoLocation, icon) {
23519
- var _this14 = this;
24275
+ var _this16 = this;
23520
24276
  var initialCoordinate = {
23521
24277
  lat: 0.0,
23522
24278
  lng: 0.0
@@ -23540,7 +24296,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
23540
24296
  this.markerLayoutController.scheduleRelayout();
23541
24297
  var updateMarker = function updateMarker(position) {
23542
24298
  marker.setLngLat([position.coords.longitude, position.coords.latitude]);
23543
- _this14.markerLayoutController.scheduleRelayout();
24299
+ _this16.markerLayoutController.scheduleRelayout();
23544
24300
  };
23545
24301
  this.geoLocation = geoLocation !== null && geoLocation !== void 0 ? geoLocation : navigator.geolocation;
23546
24302
  this.watchPositionID = this.geoLocation.watchPosition(updateMarker, function (error) {
@@ -23573,6 +24329,11 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
23573
24329
  key: "addBorderToPlaces",
23574
24330
  value: function addBorderToPlaces(placeIds, color, width) {
23575
24331
  try {
24332
+ this.borderedPlacesRequest = {
24333
+ placeIds: map_toConsumableArray(placeIds),
24334
+ color: color,
24335
+ width: width
24336
+ };
23576
24337
  if (!this.hasLayer("indoor-bordered-places")) {
23577
24338
  this.createBorderedPlacesLayer();
23578
24339
  }
@@ -23584,6 +24345,9 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
23584
24345
  var placeFilter = ["any"].concat(map_toConsumableArray(coloredPlacesFilters));
23585
24346
  var condition = ["all", placeFilter, basicFilter];
23586
24347
  this.map.setFilter("indoor-bordered-places", condition);
24348
+ // Caller-defined base filter: mark it resolved so no later capture can
24349
+ // overwrite this customization with the layer's style-declared filter.
24350
+ this.capturedBaseFilters.add("indoor-bordered-places");
23587
24351
  this.baseFilters["indoor-bordered-places"] = placeFilter;
23588
24352
  if (color !== undefined && width !== undefined) {
23589
24353
  this.map.setPaintProperty("indoor-bordered-places", "line-color", color);
@@ -23614,8 +24378,12 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
23614
24378
  }, {
23615
24379
  key: "clearBorderedPlaces",
23616
24380
  value: function clearBorderedPlaces() {
24381
+ this.borderedPlacesRequest = undefined;
23617
24382
  if (this.hasLayer("indoor-bordered-places")) {
23618
24383
  var condition = ["==", ["get", "ref"], "unselected"];
24384
+ // Caller-defined base filter: mark it resolved so no later capture can
24385
+ // overwrite this customization with the layer's style-declared filter.
24386
+ this.capturedBaseFilters.add("indoor-bordered-places");
23619
24387
  this.baseFilters["indoor-bordered-places"] = condition;
23620
24388
  this.map.setFilter("indoor-bordered-places", condition);
23621
24389
  }
@@ -23623,20 +24391,20 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
23623
24391
  }, {
23624
24392
  key: "onWebGLContextLost",
23625
24393
  value: function onWebGLContextLost(e) {
23626
- var _this$map,
23627
- _this15 = this;
24394
+ var _this$map2,
24395
+ _this17 = this;
23628
24396
  e.originalEvent.preventDefault();
23629
24397
  console.warn("Contexto WebGL perdido 😢");
23630
24398
 
23631
24399
  // Intentar restaurar el contexto automáticamente
23632
- var canvas = this === null || this === void 0 || (_this$map = this.map) === null || _this$map === void 0 ? void 0 : _this$map.getCanvas();
24400
+ var canvas = this === null || this === void 0 || (_this$map2 = this.map) === null || _this$map2 === void 0 ? void 0 : _this$map2.getCanvas();
23633
24401
  var gl = (canvas === null || canvas === void 0 ? void 0 : canvas.getContext("webgl")) || (canvas === null || canvas === void 0 ? void 0 : canvas.getContext("webgl2"));
23634
24402
  if (gl && gl.isContextLost()) {
23635
24403
  var _ext$restoreContext;
23636
24404
  canvas.addEventListener("webglcontextrestored", function () {
23637
24405
  console.debug("Contexto WebGL restaurado, forzando re-render");
23638
- _this15.map.triggerRepaint(); // forzar repaint
23639
- _this15.failedTiles.clear();
24406
+ _this17.map.triggerRepaint(); // forzar repaint
24407
+ _this17.failedTiles.clear();
23640
24408
  }, {
23641
24409
  once: true
23642
24410
  });
@@ -23673,10 +24441,46 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
23673
24441
  this.failedTiles["delete"](e.tile);
23674
24442
  }
23675
24443
  }
24444
+
24445
+ /**
24446
+ * True when a style object is attached to the map. During a full `setStyle` swap the
24447
+ * map is momentarily style-less and any `getSource`/`getFilter` call throws
24448
+ * ("Cannot read properties of undefined"), so call sites that only need the style to
24449
+ * exist should gate on this rather than on `isStyleLoaded()`.
24450
+ */
24451
+ }, {
24452
+ key: "hasStyle",
24453
+ value: function hasStyle() {
24454
+ // `map.getStyle()` is the PUBLIC probe: it returns the serialized style, or throws
24455
+ // while the map is momentarily style-less mid-swap. Reading maplibre's internal
24456
+ // `style` field instead (it is absent from the public typings, so it needed a double
24457
+ // cast) would fail closed and silently forever the moment a maplibre upgrade renames
24458
+ // or privatizes it — disabling both the tile-retry loop and `setStyle`'s apply pass
24459
+ // with no throw and no log. `safeGetFilter` already uses this try/catch shape.
24460
+ try {
24461
+ var _this$map3;
24462
+ return ((_this$map3 = this.map) === null || _this$map3 === void 0 ? void 0 : _this$map3.getStyle()) != null;
24463
+ } catch (_unused2) {
24464
+ return false;
24465
+ }
24466
+ }
24467
+
24468
+ /**
24469
+ * True when the map has a style object attached and fully loaded. Unlike
24470
+ * `map.isStyleLoaded()`, this does not emit maplibre's "There is no style
24471
+ * added to the map" warning when the style is momentarily absent (e.g. during
24472
+ * a `setStyle` swap), because it checks for the style object first.
24473
+ */
24474
+ }, {
24475
+ key: "hasLoadedStyle",
24476
+ value: function hasLoadedStyle() {
24477
+ if (!this.hasStyle()) return false;
24478
+ return this.map.isStyleLoaded() === true;
24479
+ }
23676
24480
  }, {
23677
24481
  key: "subscribeToFailedTiles",
23678
24482
  value: function subscribeToFailedTiles() {
23679
- var _this16 = this;
24483
+ var _this18 = this;
23680
24484
  if (this.retryTimer) return;
23681
24485
 
23682
24486
  // Store bound functions for proper cleanup
@@ -23685,20 +24489,31 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
23685
24489
  this.boundOnWebGLContextLost = this.onWebGLContextLost.bind(this);
23686
24490
  this.boundOnWebGLContextRestored = this.onWebGLContextRestored.bind(this);
23687
24491
  this.retryTimer = setInterval(function () {
23688
- if (!_this16.map.getSource("indoorequal")) {
23689
- _this16.failedTiles.clear();
24492
+ // During a full style swap (`setStyle` with `diff: false`) the map can
24493
+ // momentarily have no style object attached. Calling `getSource` then
24494
+ // throws ("Cannot read properties of undefined (reading 'getSource')").
24495
+ // Only the style's PRESENCE is checked here, never `isStyleLoaded()`:
24496
+ // that is false while any source still has tiles in flight, which is
24497
+ // exactly when tiles fail — gating on it would skip every tick during a
24498
+ // bad-network burst. The queue is left untouched so the tiles queued
24499
+ // mid-swap are still retried on the next tick.
24500
+ if (!_this18.hasStyle()) {
24501
+ return;
24502
+ }
24503
+ if (!_this18.map.getSource("indoorequal")) {
24504
+ _this18.failedTiles.clear();
23690
24505
  return;
23691
24506
  }
23692
- var source = _this16.map.getSource("indoorequal");
24507
+ var source = _this18.map.getSource("indoorequal");
23693
24508
  if (!source || source.type !== "vector") {
23694
- _this16.failedTiles.clear();
24509
+ _this18.failedTiles.clear();
23695
24510
  return;
23696
24511
  }
23697
24512
 
23698
24513
  // Process tiles and remove invalid ones
23699
24514
  var tilesToRetry = [];
23700
24515
  var tilesToRemove = [];
23701
- _this16.failedTiles.forEach(function (tile) {
24516
+ _this18.failedTiles.forEach(function (tile) {
23702
24517
  // Check if tile is still valid before attempting reload
23703
24518
  if (!tile || tile.state === "unloaded" || tile.state === "loading") {
23704
24519
  tilesToRemove.push(tile);
@@ -23716,14 +24531,14 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
23716
24531
 
23717
24532
  // Remove invalid tiles from the set
23718
24533
  tilesToRemove.forEach(function (tile) {
23719
- return _this16.failedTiles["delete"](tile);
24534
+ return _this18.failedTiles["delete"](tile);
23720
24535
  });
23721
24536
 
23722
24537
  // Attempt to reload valid failed tiles
23723
24538
  var now = Date.now();
23724
24539
  tilesToRetry.forEach(function (tile) {
23725
- var _this16$tileRetryStat;
23726
- var retry = (_this16$tileRetryStat = _this16.tileRetryState.get(tile)) !== null && _this16$tileRetryStat !== void 0 ? _this16$tileRetryStat : {
24540
+ var _this18$tileRetryStat;
24541
+ var retry = (_this18$tileRetryStat = _this18.tileRetryState.get(tile)) !== null && _this18$tileRetryStat !== void 0 ? _this18$tileRetryStat : {
23727
24542
  attempts: 0,
23728
24543
  nextAttemptAt: 0,
23729
24544
  pending: false
@@ -23734,16 +24549,16 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
23734
24549
  var onFailure = function onFailure(error) {
23735
24550
  var attempts = retry.attempts + 1;
23736
24551
  if (attempts >= MAX_TILE_RETRIES) {
23737
- _this16.debugLog("Tile reload failed ".concat(attempts, " times, dropping it from the retry queue"), error);
23738
- _this16.failedTiles["delete"](tile);
23739
- _this16.tileRetryState["delete"](tile);
24552
+ _this18.debugLog("Tile reload failed ".concat(attempts, " times, dropping it from the retry queue"), error);
24553
+ _this18.failedTiles["delete"](tile);
24554
+ _this18.tileRetryState["delete"](tile);
23740
24555
  return;
23741
24556
  }
23742
24557
 
23743
24558
  // Stay in the queue and try again once the backoff has elapsed.
23744
24559
  var backoffMs = TILE_RETRY_BASE_DELAY_MS * Math.pow(2, attempts - 1);
23745
- _this16.debugLog("Tile reload failed (attempt ".concat(attempts, "/").concat(MAX_TILE_RETRIES, "), retrying in ").concat(backoffMs, "ms"), error);
23746
- _this16.tileRetryState.set(tile, {
24560
+ _this18.debugLog("Tile reload failed (attempt ".concat(attempts, "/").concat(MAX_TILE_RETRIES, "), retrying in ").concat(backoffMs, "ms"), error);
24561
+ _this18.tileRetryState.set(tile, {
23747
24562
  attempts: attempts,
23748
24563
  nextAttemptAt: Date.now() + backoffMs,
23749
24564
  pending: false
@@ -23752,7 +24567,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
23752
24567
  try {
23753
24568
  // Verify tile still exists and is in a retryable state
23754
24569
  if (tile && (tile.state === "errored" || tile.state === "expired")) {
23755
- _this16.tileRetryState.set(tile, map_objectSpread(map_objectSpread({}, retry), {}, {
24570
+ _this18.tileRetryState.set(tile, map_objectSpread(map_objectSpread({}, retry), {}, {
23756
24571
  pending: true
23757
24572
  }));
23758
24573
  // loadTile is async, so a rejection escapes this try/catch and has to be handled
@@ -23762,7 +24577,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
23762
24577
  // Loaded: forget the attempt history so a later failure starts from zero. The
23763
24578
  // tile leaves the queue through the tilesToRemove branch on the next tick,
23764
24579
  // once its state is no longer errored/expired.
23765
- _this16.tileRetryState["delete"](tile);
24580
+ _this18.tileRetryState["delete"](tile);
23766
24581
  })["catch"](onFailure);
23767
24582
  }
23768
24583
  } catch (error) {
@@ -23944,7 +24759,8 @@ var InternalMapVXSDK = /*#__PURE__*/function (_Loggeable) {
23944
24759
  _this.repository = new Repository(token, _this.config.lang, _this.config.apiUrl, cacheManager, _this.config.mapvxRequestContext, {
23945
24760
  routeApiUrl: _this.config.routeApiUrl,
23946
24761
  healthApiUrl: _this.config.healthApiUrl,
23947
- legacyApiUrl: _this.config.legacyApiUrl
24762
+ legacyApiUrl: _this.config.legacyApiUrl,
24763
+ portalApiUrl: _this.config.portalApiUrl
23948
24764
  });
23949
24765
  _this.cachePlaces();
23950
24766
  _this.logEvent("initSDK");
@@ -24061,6 +24877,7 @@ var InternalMapVXSDK = /*#__PURE__*/function (_Loggeable) {
24061
24877
  try {
24062
24878
  mapConfig.lang = this.config.lang;
24063
24879
  mapConfig.apiUrl = this.config.apiUrl;
24880
+ mapConfig.portalApiUrl = this.config.portalApiUrl;
24064
24881
  mapConfig.mapvxRequestContext = this.config.mapvxRequestContext;
24065
24882
  // Routing endpoints go through the map's own Repository, so forward the
24066
24883
  // (possibly overridden) hosts too — otherwise routes would fall back to
@@ -24118,24 +24935,24 @@ var InternalMapVXSDK = /*#__PURE__*/function (_Loggeable) {
24118
24935
  return getConfiguration;
24119
24936
  }()
24120
24937
  }, {
24121
- key: "getCategories",
24938
+ key: "getCampaigns",
24122
24939
  value: function () {
24123
- var _getCategories = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function _callee4(placeId) {
24124
- var categories, _t4;
24940
+ var _getCampaigns = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function _callee4(placeId, kioskId) {
24941
+ var campaigns, _t4;
24125
24942
  return sdk_regenerator().w(function (_context4) {
24126
24943
  while (1) switch (_context4.p = _context4.n) {
24127
24944
  case 0:
24128
24945
  _context4.p = 0;
24129
24946
  _context4.n = 1;
24130
- return this.repository.fetchAndParseCategories(placeId);
24947
+ return this.repository.fetchAndParseCampaigns(placeId, kioskId);
24131
24948
  case 1:
24132
- categories = _context4.v;
24133
- this.logEvent("categories");
24134
- return _context4.a(2, categories);
24949
+ campaigns = _context4.v;
24950
+ this.logEvent("campaigns");
24951
+ return _context4.a(2, campaigns);
24135
24952
  case 2:
24136
24953
  _context4.p = 2;
24137
24954
  _t4 = _context4.v;
24138
- throw new Error("Failed to get categories", {
24955
+ throw new Error("Failed to get campaigns", {
24139
24956
  cause: _t4
24140
24957
  });
24141
24958
  case 3:
@@ -24143,7 +24960,38 @@ var InternalMapVXSDK = /*#__PURE__*/function (_Loggeable) {
24143
24960
  }
24144
24961
  }, _callee4, this, [[0, 2]]);
24145
24962
  }));
24146
- function getCategories(_x6) {
24963
+ function getCampaigns(_x6, _x7) {
24964
+ return _getCampaigns.apply(this, arguments);
24965
+ }
24966
+ return getCampaigns;
24967
+ }()
24968
+ }, {
24969
+ key: "getCategories",
24970
+ value: function () {
24971
+ var _getCategories = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function _callee5(placeId) {
24972
+ var categories, _t5;
24973
+ return sdk_regenerator().w(function (_context5) {
24974
+ while (1) switch (_context5.p = _context5.n) {
24975
+ case 0:
24976
+ _context5.p = 0;
24977
+ _context5.n = 1;
24978
+ return this.repository.fetchAndParseCategories(placeId);
24979
+ case 1:
24980
+ categories = _context5.v;
24981
+ this.logEvent("categories");
24982
+ return _context5.a(2, categories);
24983
+ case 2:
24984
+ _context5.p = 2;
24985
+ _t5 = _context5.v;
24986
+ throw new Error("Failed to get categories", {
24987
+ cause: _t5
24988
+ });
24989
+ case 3:
24990
+ return _context5.a(2);
24991
+ }
24992
+ }, _callee5, this, [[0, 2]]);
24993
+ }));
24994
+ function getCategories(_x8) {
24147
24995
  return _getCategories.apply(this, arguments);
24148
24996
  }
24149
24997
  return getCategories;
@@ -24151,29 +24999,29 @@ var InternalMapVXSDK = /*#__PURE__*/function (_Loggeable) {
24151
24999
  }, {
24152
25000
  key: "getTransport",
24153
25001
  value: function () {
24154
- var _getTransport = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function _callee5(stopId) {
24155
- var allowedTransport, _t5;
24156
- return sdk_regenerator().w(function (_context5) {
24157
- while (1) switch (_context5.p = _context5.n) {
25002
+ var _getTransport = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function _callee6(stopId) {
25003
+ var allowedTransport, _t6;
25004
+ return sdk_regenerator().w(function (_context6) {
25005
+ while (1) switch (_context6.p = _context6.n) {
24158
25006
  case 0:
24159
- _context5.p = 0;
24160
- _context5.n = 1;
25007
+ _context6.p = 0;
25008
+ _context6.n = 1;
24161
25009
  return this.repository.fetchAndParseTransport(stopId);
24162
25010
  case 1:
24163
- allowedTransport = _context5.v;
24164
- return _context5.a(2, allowedTransport);
25011
+ allowedTransport = _context6.v;
25012
+ return _context6.a(2, allowedTransport);
24165
25013
  case 2:
24166
- _context5.p = 2;
24167
- _t5 = _context5.v;
25014
+ _context6.p = 2;
25015
+ _t6 = _context6.v;
24168
25016
  throw new Error("Failed to get transport", {
24169
- cause: _t5
25017
+ cause: _t6
24170
25018
  });
24171
25019
  case 3:
24172
- return _context5.a(2);
25020
+ return _context6.a(2);
24173
25021
  }
24174
- }, _callee5, this, [[0, 2]]);
25022
+ }, _callee6, this, [[0, 2]]);
24175
25023
  }));
24176
- function getTransport(_x7) {
25024
+ function getTransport(_x9) {
24177
25025
  return _getTransport.apply(this, arguments);
24178
25026
  }
24179
25027
  return getTransport;
@@ -24194,53 +25042,22 @@ var InternalMapVXSDK = /*#__PURE__*/function (_Loggeable) {
24194
25042
  }, {
24195
25043
  key: "getAvailablePlaces",
24196
25044
  value: function () {
24197
- var _getAvailablePlaces = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function _callee6() {
24198
- var allowedPlaces, _t6;
24199
- return sdk_regenerator().w(function (_context6) {
24200
- while (1) switch (_context6.p = _context6.n) {
24201
- case 0:
24202
- _context6.p = 0;
24203
- _context6.n = 1;
24204
- return this.repository.fetchAndParseAvailablePlaces();
24205
- case 1:
24206
- allowedPlaces = _context6.v;
24207
- this.logEvent("getAvailablePlaces");
24208
- return _context6.a(2, allowedPlaces);
24209
- case 2:
24210
- _context6.p = 2;
24211
- _t6 = _context6.v;
24212
- throw new Error("Failed to get available places", {
24213
- cause: _t6
24214
- });
24215
- case 3:
24216
- return _context6.a(2);
24217
- }
24218
- }, _callee6, this, [[0, 2]]);
24219
- }));
24220
- function getAvailablePlaces() {
24221
- return _getAvailablePlaces.apply(this, arguments);
24222
- }
24223
- return getAvailablePlaces;
24224
- }()
24225
- }, {
24226
- key: "getSubPlaces",
24227
- value: function () {
24228
- var _getSubPlaces = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function _callee7(parentPlaceId) {
24229
- var subPlaces, _t7;
25045
+ var _getAvailablePlaces = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function _callee7() {
25046
+ var allowedPlaces, _t7;
24230
25047
  return sdk_regenerator().w(function (_context7) {
24231
25048
  while (1) switch (_context7.p = _context7.n) {
24232
25049
  case 0:
24233
25050
  _context7.p = 0;
24234
25051
  _context7.n = 1;
24235
- return this.repository.fetchAndParseSubPlaces(parentPlaceId);
25052
+ return this.repository.fetchAndParseAvailablePlaces();
24236
25053
  case 1:
24237
- subPlaces = _context7.v;
24238
- this.logEvent("getSubPlaces");
24239
- return _context7.a(2, subPlaces);
25054
+ allowedPlaces = _context7.v;
25055
+ this.logEvent("getAvailablePlaces");
25056
+ return _context7.a(2, allowedPlaces);
24240
25057
  case 2:
24241
25058
  _context7.p = 2;
24242
25059
  _t7 = _context7.v;
24243
- throw new Error("Failed to get subplaces", {
25060
+ throw new Error("Failed to get available places", {
24244
25061
  cause: _t7
24245
25062
  });
24246
25063
  case 3:
@@ -24248,30 +25065,30 @@ var InternalMapVXSDK = /*#__PURE__*/function (_Loggeable) {
24248
25065
  }
24249
25066
  }, _callee7, this, [[0, 2]]);
24250
25067
  }));
24251
- function getSubPlaces(_x8) {
24252
- return _getSubPlaces.apply(this, arguments);
25068
+ function getAvailablePlaces() {
25069
+ return _getAvailablePlaces.apply(this, arguments);
24253
25070
  }
24254
- return getSubPlaces;
25071
+ return getAvailablePlaces;
24255
25072
  }()
24256
25073
  }, {
24257
- key: "getPlacesFromInstitution",
25074
+ key: "getSubPlaces",
24258
25075
  value: function () {
24259
- var _getPlacesFromInstitution = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function _callee8(institutionId, authToken) {
24260
- var allowedPlaces, _t8;
25076
+ var _getSubPlaces = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function _callee8(parentPlaceId) {
25077
+ var subPlaces, _t8;
24261
25078
  return sdk_regenerator().w(function (_context8) {
24262
25079
  while (1) switch (_context8.p = _context8.n) {
24263
25080
  case 0:
24264
25081
  _context8.p = 0;
24265
25082
  _context8.n = 1;
24266
- return this.repository.fetchAndParsePlacesFromInstitution(institutionId, authToken);
25083
+ return this.repository.fetchAndParseSubPlaces(parentPlaceId);
24267
25084
  case 1:
24268
- allowedPlaces = _context8.v;
24269
- this.logEvent("getPlacesFromInstitution");
24270
- return _context8.a(2, allowedPlaces);
25085
+ subPlaces = _context8.v;
25086
+ this.logEvent("getSubPlaces");
25087
+ return _context8.a(2, subPlaces);
24271
25088
  case 2:
24272
25089
  _context8.p = 2;
24273
25090
  _t8 = _context8.v;
24274
- throw new Error("Failed to get places from institution", {
25091
+ throw new Error("Failed to get subplaces", {
24275
25092
  cause: _t8
24276
25093
  });
24277
25094
  case 3:
@@ -24279,30 +25096,30 @@ var InternalMapVXSDK = /*#__PURE__*/function (_Loggeable) {
24279
25096
  }
24280
25097
  }, _callee8, this, [[0, 2]]);
24281
25098
  }));
24282
- function getPlacesFromInstitution(_x9, _x0) {
24283
- return _getPlacesFromInstitution.apply(this, arguments);
25099
+ function getSubPlaces(_x0) {
25100
+ return _getSubPlaces.apply(this, arguments);
24284
25101
  }
24285
- return getPlacesFromInstitution;
25102
+ return getSubPlaces;
24286
25103
  }()
24287
25104
  }, {
24288
- key: "getAnySubPlaces",
25105
+ key: "getPlacesFromInstitution",
24289
25106
  value: function () {
24290
- var _getAnySubPlaces = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function _callee9(parentPlaceId, authToken) {
24291
- var subPlaces, _t9;
25107
+ var _getPlacesFromInstitution = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function _callee9(institutionId, authToken) {
25108
+ var allowedPlaces, _t9;
24292
25109
  return sdk_regenerator().w(function (_context9) {
24293
25110
  while (1) switch (_context9.p = _context9.n) {
24294
25111
  case 0:
24295
25112
  _context9.p = 0;
24296
25113
  _context9.n = 1;
24297
- return this.repository.fetchAndParseAnySubPlaces(parentPlaceId, authToken);
25114
+ return this.repository.fetchAndParsePlacesFromInstitution(institutionId, authToken);
24298
25115
  case 1:
24299
- subPlaces = _context9.v;
24300
- this.logEvent("getAnySubPlaces");
24301
- return _context9.a(2, subPlaces);
25116
+ allowedPlaces = _context9.v;
25117
+ this.logEvent("getPlacesFromInstitution");
25118
+ return _context9.a(2, allowedPlaces);
24302
25119
  case 2:
24303
25120
  _context9.p = 2;
24304
25121
  _t9 = _context9.v;
24305
- throw new Error("Failed to get any sub-places", {
25122
+ throw new Error("Failed to get places from institution", {
24306
25123
  cause: _t9
24307
25124
  });
24308
25125
  case 3:
@@ -24310,30 +25127,30 @@ var InternalMapVXSDK = /*#__PURE__*/function (_Loggeable) {
24310
25127
  }
24311
25128
  }, _callee9, this, [[0, 2]]);
24312
25129
  }));
24313
- function getAnySubPlaces(_x1, _x10) {
24314
- return _getAnySubPlaces.apply(this, arguments);
25130
+ function getPlacesFromInstitution(_x1, _x10) {
25131
+ return _getPlacesFromInstitution.apply(this, arguments);
24315
25132
  }
24316
- return getAnySubPlaces;
25133
+ return getPlacesFromInstitution;
24317
25134
  }()
24318
25135
  }, {
24319
- key: "getInstitutions",
25136
+ key: "getAnySubPlaces",
24320
25137
  value: function () {
24321
- var _getInstitutions = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function _callee0() {
24322
- var institutions, _t0;
25138
+ var _getAnySubPlaces = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function _callee0(parentPlaceId, authToken) {
25139
+ var subPlaces, _t0;
24323
25140
  return sdk_regenerator().w(function (_context0) {
24324
25141
  while (1) switch (_context0.p = _context0.n) {
24325
25142
  case 0:
24326
25143
  _context0.p = 0;
24327
25144
  _context0.n = 1;
24328
- return this.repository.fetchAndParseInstitutions();
25145
+ return this.repository.fetchAndParseAnySubPlaces(parentPlaceId, authToken);
24329
25146
  case 1:
24330
- institutions = _context0.v;
24331
- this.logEvent("getInstitutions");
24332
- return _context0.a(2, institutions);
25147
+ subPlaces = _context0.v;
25148
+ this.logEvent("getAnySubPlaces");
25149
+ return _context0.a(2, subPlaces);
24333
25150
  case 2:
24334
25151
  _context0.p = 2;
24335
25152
  _t0 = _context0.v;
24336
- throw new Error("Error getInstitution", {
25153
+ throw new Error("Failed to get any sub-places", {
24337
25154
  cause: _t0
24338
25155
  });
24339
25156
  case 3:
@@ -24341,31 +25158,30 @@ var InternalMapVXSDK = /*#__PURE__*/function (_Loggeable) {
24341
25158
  }
24342
25159
  }, _callee0, this, [[0, 2]]);
24343
25160
  }));
24344
- function getInstitutions() {
24345
- return _getInstitutions.apply(this, arguments);
25161
+ function getAnySubPlaces(_x11, _x12) {
25162
+ return _getAnySubPlaces.apply(this, arguments);
24346
25163
  }
24347
- return getInstitutions;
25164
+ return getAnySubPlaces;
24348
25165
  }()
24349
25166
  }, {
24350
- key: "getRoute",
25167
+ key: "getInstitutions",
24351
25168
  value: function () {
24352
- var _getRoute = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function _callee1(routeConfig) {
24353
- var config, route, _t1;
25169
+ var _getInstitutions = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function _callee1() {
25170
+ var institutions, _t1;
24354
25171
  return sdk_regenerator().w(function (_context1) {
24355
25172
  while (1) switch (_context1.p = _context1.n) {
24356
25173
  case 0:
24357
25174
  _context1.p = 0;
24358
- config = new InternalGetRouteConfiguration(routeConfig);
24359
25175
  _context1.n = 1;
24360
- return this.repository.fetchAndParseRoute(config);
25176
+ return this.repository.fetchAndParseInstitutions();
24361
25177
  case 1:
24362
- route = _context1.v;
24363
- this.logEvent("getRoute");
24364
- return _context1.a(2, route);
25178
+ institutions = _context1.v;
25179
+ this.logEvent("getInstitutions");
25180
+ return _context1.a(2, institutions);
24365
25181
  case 2:
24366
25182
  _context1.p = 2;
24367
25183
  _t1 = _context1.v;
24368
- throw new Error("Failed to get route", {
25184
+ throw new Error("Error getInstitution", {
24369
25185
  cause: _t1
24370
25186
  });
24371
25187
  case 3:
@@ -24373,15 +25189,15 @@ var InternalMapVXSDK = /*#__PURE__*/function (_Loggeable) {
24373
25189
  }
24374
25190
  }, _callee1, this, [[0, 2]]);
24375
25191
  }));
24376
- function getRoute(_x11) {
24377
- return _getRoute.apply(this, arguments);
25192
+ function getInstitutions() {
25193
+ return _getInstitutions.apply(this, arguments);
24378
25194
  }
24379
- return getRoute;
25195
+ return getInstitutions;
24380
25196
  }()
24381
25197
  }, {
24382
- key: "getRouteV2",
25198
+ key: "getRoute",
24383
25199
  value: function () {
24384
- var _getRouteV = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function _callee10(routeConfig) {
25200
+ var _getRoute = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function _callee10(routeConfig) {
24385
25201
  var config, route, _t10;
24386
25202
  return sdk_regenerator().w(function (_context10) {
24387
25203
  while (1) switch (_context10.p = _context10.n) {
@@ -24389,10 +25205,10 @@ var InternalMapVXSDK = /*#__PURE__*/function (_Loggeable) {
24389
25205
  _context10.p = 0;
24390
25206
  config = new InternalGetRouteConfiguration(routeConfig);
24391
25207
  _context10.n = 1;
24392
- return this.repository.fetchAndParseRouteV2(config);
25208
+ return this.repository.fetchAndParseRoute(config);
24393
25209
  case 1:
24394
25210
  route = _context10.v;
24395
- this.logEvent("getRouteV2");
25211
+ this.logEvent("getRoute");
24396
25212
  return _context10.a(2, route);
24397
25213
  case 2:
24398
25214
  _context10.p = 2;
@@ -24405,15 +25221,15 @@ var InternalMapVXSDK = /*#__PURE__*/function (_Loggeable) {
24405
25221
  }
24406
25222
  }, _callee10, this, [[0, 2]]);
24407
25223
  }));
24408
- function getRouteV2(_x12) {
24409
- return _getRouteV.apply(this, arguments);
25224
+ function getRoute(_x13) {
25225
+ return _getRoute.apply(this, arguments);
24410
25226
  }
24411
- return getRouteV2;
25227
+ return getRoute;
24412
25228
  }()
24413
25229
  }, {
24414
- key: "getLiveRoute",
25230
+ key: "getRouteV2",
24415
25231
  value: function () {
24416
- var _getLiveRoute = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function _callee11(routeConfig) {
25232
+ var _getRouteV = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function _callee11(routeConfig) {
24417
25233
  var config, route, _t11;
24418
25234
  return sdk_regenerator().w(function (_context11) {
24419
25235
  while (1) switch (_context11.p = _context11.n) {
@@ -24421,10 +25237,10 @@ var InternalMapVXSDK = /*#__PURE__*/function (_Loggeable) {
24421
25237
  _context11.p = 0;
24422
25238
  config = new InternalGetRouteConfiguration(routeConfig);
24423
25239
  _context11.n = 1;
24424
- return this.repository.fetchAndParseLiveRoute(config);
25240
+ return this.repository.fetchAndParseRouteV2(config);
24425
25241
  case 1:
24426
25242
  route = _context11.v;
24427
- this.logEvent("getLiveRoute");
25243
+ this.logEvent("getRouteV2");
24428
25244
  return _context11.a(2, route);
24429
25245
  case 2:
24430
25246
  _context11.p = 2;
@@ -24437,32 +25253,31 @@ var InternalMapVXSDK = /*#__PURE__*/function (_Loggeable) {
24437
25253
  }
24438
25254
  }, _callee11, this, [[0, 2]]);
24439
25255
  }));
24440
- function getLiveRoute(_x13) {
24441
- return _getLiveRoute.apply(this, arguments);
25256
+ function getRouteV2(_x14) {
25257
+ return _getRouteV.apply(this, arguments);
24442
25258
  }
24443
- return getLiveRoute;
25259
+ return getRouteV2;
24444
25260
  }()
24445
25261
  }, {
24446
- key: "getPlacesByInput",
25262
+ key: "getLiveRoute",
24447
25263
  value: function () {
24448
- var _getPlacesByInput = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function _callee12(input, institutionId, parentPlaceId, otherParentPlacesIds, origin, lat, lng, floor) {
24449
- var parentPlaces, places, _t12;
25264
+ var _getLiveRoute = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function _callee12(routeConfig) {
25265
+ var config, route, _t12;
24450
25266
  return sdk_regenerator().w(function (_context12) {
24451
25267
  while (1) switch (_context12.p = _context12.n) {
24452
25268
  case 0:
24453
25269
  _context12.p = 0;
24454
- // TODO: se debe cambiar a usar un solo parámetro en la siguiente version major.
24455
- parentPlaces = parentPlaceId ? otherParentPlacesIds ? [parentPlaceId].concat(sdk_toConsumableArray(otherParentPlacesIds)) : [parentPlaceId] : otherParentPlacesIds;
25270
+ config = new InternalGetRouteConfiguration(routeConfig);
24456
25271
  _context12.n = 1;
24457
- return this.repository.fetchAndParseSearchResults(institutionId, input, parentPlaces, origin, lat, lng, floor);
25272
+ return this.repository.fetchAndParseLiveRoute(config);
24458
25273
  case 1:
24459
- places = _context12.v;
24460
- this.logEvent("getPlacesByInput");
24461
- return _context12.a(2, places);
25274
+ route = _context12.v;
25275
+ this.logEvent("getLiveRoute");
25276
+ return _context12.a(2, route);
24462
25277
  case 2:
24463
25278
  _context12.p = 2;
24464
25279
  _t12 = _context12.v;
24465
- throw new Error("Failed to get places by input", {
25280
+ throw new Error("Failed to get route", {
24466
25281
  cause: _t12
24467
25282
  });
24468
25283
  case 3:
@@ -24470,7 +25285,40 @@ var InternalMapVXSDK = /*#__PURE__*/function (_Loggeable) {
24470
25285
  }
24471
25286
  }, _callee12, this, [[0, 2]]);
24472
25287
  }));
24473
- function getPlacesByInput(_x14, _x15, _x16, _x17, _x18, _x19, _x20, _x21) {
25288
+ function getLiveRoute(_x15) {
25289
+ return _getLiveRoute.apply(this, arguments);
25290
+ }
25291
+ return getLiveRoute;
25292
+ }()
25293
+ }, {
25294
+ key: "getPlacesByInput",
25295
+ value: function () {
25296
+ var _getPlacesByInput = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function _callee13(input, institutionId, parentPlaceId, otherParentPlacesIds, origin, lat, lng, floor) {
25297
+ var parentPlaces, places, _t13;
25298
+ return sdk_regenerator().w(function (_context13) {
25299
+ while (1) switch (_context13.p = _context13.n) {
25300
+ case 0:
25301
+ _context13.p = 0;
25302
+ // TODO: se debe cambiar a usar un solo parámetro en la siguiente version major.
25303
+ parentPlaces = parentPlaceId ? otherParentPlacesIds ? [parentPlaceId].concat(sdk_toConsumableArray(otherParentPlacesIds)) : [parentPlaceId] : otherParentPlacesIds;
25304
+ _context13.n = 1;
25305
+ return this.repository.fetchAndParseSearchResults(institutionId, input, parentPlaces, origin, lat, lng, floor);
25306
+ case 1:
25307
+ places = _context13.v;
25308
+ this.logEvent("getPlacesByInput");
25309
+ return _context13.a(2, places);
25310
+ case 2:
25311
+ _context13.p = 2;
25312
+ _t13 = _context13.v;
25313
+ throw new Error("Failed to get places by input", {
25314
+ cause: _t13
25315
+ });
25316
+ case 3:
25317
+ return _context13.a(2);
25318
+ }
25319
+ }, _callee13, this, [[0, 2]]);
25320
+ }));
25321
+ function getPlacesByInput(_x16, _x17, _x18, _x19, _x20, _x21, _x22, _x23) {
24474
25322
  return _getPlacesByInput.apply(this, arguments);
24475
25323
  }
24476
25324
  return getPlacesByInput;
@@ -24478,7 +25326,7 @@ var InternalMapVXSDK = /*#__PURE__*/function (_Loggeable) {
24478
25326
  }, {
24479
25327
  key: "searchPlacesByTags",
24480
25328
  value: function () {
24481
- var _searchPlacesByTags = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function _callee13(institutionId, tags) {
25329
+ var _searchPlacesByTags = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function _callee14(institutionId, tags) {
24482
25330
  var options,
24483
25331
  parentPlaces,
24484
25332
  sort,
@@ -24488,49 +25336,49 @@ var InternalMapVXSDK = /*#__PURE__*/function (_Loggeable) {
24488
25336
  floor,
24489
25337
  hasCoordinateContext,
24490
25338
  places,
24491
- _args13 = arguments,
24492
- _t13;
24493
- return sdk_regenerator().w(function (_context13) {
24494
- while (1) switch (_context13.p = _context13.n) {
25339
+ _args14 = arguments,
25340
+ _t14;
25341
+ return sdk_regenerator().w(function (_context14) {
25342
+ while (1) switch (_context14.p = _context14.n) {
24495
25343
  case 0:
24496
- options = _args13.length > 2 && _args13[2] !== undefined ? _args13[2] : {};
25344
+ options = _args14.length > 2 && _args14[2] !== undefined ? _args14[2] : {};
24497
25345
  if (!(!tags || tags.length === 0)) {
24498
- _context13.n = 1;
25346
+ _context14.n = 1;
24499
25347
  break;
24500
25348
  }
24501
25349
  throw new Error("searchPlacesByTags requires at least one tag");
24502
25350
  case 1:
24503
25351
  parentPlaces = options.parentPlaces, sort = options.sort, origin = options.origin, lat = options.lat, lng = options.lng, floor = options.floor;
24504
25352
  if (!(sort === "distance")) {
24505
- _context13.n = 2;
25353
+ _context14.n = 2;
24506
25354
  break;
24507
25355
  }
24508
25356
  hasCoordinateContext = lat != null && lng != null && floor != null && parentPlaces != null && parentPlaces.length > 0;
24509
25357
  if (!(!origin && !hasCoordinateContext)) {
24510
- _context13.n = 2;
25358
+ _context14.n = 2;
24511
25359
  break;
24512
25360
  }
24513
25361
  throw new Error('searchPlacesByTags with sort "distance" requires "origin" or "lat" + "lng" + "floor" + "parentPlaces"');
24514
25362
  case 2:
24515
- _context13.p = 2;
24516
- _context13.n = 3;
25363
+ _context14.p = 2;
25364
+ _context14.n = 3;
24517
25365
  return this.repository.fetchAndParseSearchPlacesByTags(institutionId, tags, parentPlaces, sort, origin, lat, lng, floor);
24518
25366
  case 3:
24519
- places = _context13.v;
25367
+ places = _context14.v;
24520
25368
  this.logEvent("searchPlacesByTags");
24521
- return _context13.a(2, places);
25369
+ return _context14.a(2, places);
24522
25370
  case 4:
24523
- _context13.p = 4;
24524
- _t13 = _context13.v;
25371
+ _context14.p = 4;
25372
+ _t14 = _context14.v;
24525
25373
  throw new Error("Failed to search places by tags", {
24526
- cause: _t13
25374
+ cause: _t14
24527
25375
  });
24528
25376
  case 5:
24529
- return _context13.a(2);
25377
+ return _context14.a(2);
24530
25378
  }
24531
- }, _callee13, this, [[2, 4]]);
25379
+ }, _callee14, this, [[2, 4]]);
24532
25380
  }));
24533
- function searchPlacesByTags(_x22, _x23) {
25381
+ function searchPlacesByTags(_x24, _x25) {
24534
25382
  return _searchPlacesByTags.apply(this, arguments);
24535
25383
  }
24536
25384
  return searchPlacesByTags;
@@ -24538,28 +25386,28 @@ var InternalMapVXSDK = /*#__PURE__*/function (_Loggeable) {
24538
25386
  }, {
24539
25387
  key: "getPlacesByCategory",
24540
25388
  value: function () {
24541
- var _getPlacesByCategory = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function _callee14(category) {
24542
- var _t14;
24543
- return sdk_regenerator().w(function (_context14) {
24544
- while (1) switch (_context14.p = _context14.n) {
25389
+ var _getPlacesByCategory = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function _callee15(category) {
25390
+ var _t15;
25391
+ return sdk_regenerator().w(function (_context15) {
25392
+ while (1) switch (_context15.p = _context15.n) {
24545
25393
  case 0:
24546
- _context14.p = 0;
25394
+ _context15.p = 0;
24547
25395
  // TODO: Implement proper category-based search when API endpoint is available
24548
25396
  // For now, return an empty array as a placeholder implementation
24549
25397
  this.logEvent("getPlacesByCategory");
24550
- return _context14.a(2, []);
25398
+ return _context15.a(2, []);
24551
25399
  case 1:
24552
- _context14.p = 1;
24553
- _t14 = _context14.v;
25400
+ _context15.p = 1;
25401
+ _t15 = _context15.v;
24554
25402
  throw new Error("Failed to get places by category", {
24555
- cause: _t14
25403
+ cause: _t15
24556
25404
  });
24557
25405
  case 2:
24558
- return _context14.a(2);
25406
+ return _context15.a(2);
24559
25407
  }
24560
- }, _callee14, this, [[0, 1]]);
25408
+ }, _callee15, this, [[0, 1]]);
24561
25409
  }));
24562
- function getPlacesByCategory(_x24) {
25410
+ function getPlacesByCategory(_x26) {
24563
25411
  return _getPlacesByCategory.apply(this, arguments);
24564
25412
  }
24565
25413
  return getPlacesByCategory;
@@ -24654,18 +25502,18 @@ var InternalMapVXSDK = /*#__PURE__*/function (_Loggeable) {
24654
25502
  }, {
24655
25503
  key: "loadRoutesForOriginCache",
24656
25504
  value: function () {
24657
- var _loadRoutesForOriginCache = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function _callee15(parentPlaceId, fromPlaceId, announceFormat, unitSystem, mode) {
24658
- return sdk_regenerator().w(function (_context15) {
24659
- while (1) switch (_context15.n) {
25505
+ var _loadRoutesForOriginCache = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function _callee16(parentPlaceId, fromPlaceId, announceFormat, unitSystem, mode) {
25506
+ return sdk_regenerator().w(function (_context16) {
25507
+ while (1) switch (_context16.n) {
24660
25508
  case 0:
24661
- _context15.n = 1;
25509
+ _context16.n = 1;
24662
25510
  return this.repository.fetchAndParseRoutesFromOrigin(parentPlaceId, fromPlaceId, announceFormat, unitSystem, mode);
24663
25511
  case 1:
24664
- return _context15.a(2);
25512
+ return _context16.a(2);
24665
25513
  }
24666
- }, _callee15, this);
25514
+ }, _callee16, this);
24667
25515
  }));
24668
- function loadRoutesForOriginCache(_x25, _x26, _x27, _x28, _x29) {
25516
+ function loadRoutesForOriginCache(_x27, _x28, _x29, _x30, _x31) {
24669
25517
  return _loadRoutesForOriginCache.apply(this, arguments);
24670
25518
  }
24671
25519
  return loadRoutesForOriginCache;
@@ -24673,30 +25521,30 @@ var InternalMapVXSDK = /*#__PURE__*/function (_Loggeable) {
24673
25521
  }, {
24674
25522
  key: "getCacheTimestamp",
24675
25523
  value: function () {
24676
- var _getCacheTimestamp = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function _callee16(parentPlaceId) {
24677
- var cacheTimestamp, _t15;
24678
- return sdk_regenerator().w(function (_context16) {
24679
- while (1) switch (_context16.p = _context16.n) {
25524
+ var _getCacheTimestamp = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function _callee17(parentPlaceId) {
25525
+ var cacheTimestamp, _t16;
25526
+ return sdk_regenerator().w(function (_context17) {
25527
+ while (1) switch (_context17.p = _context17.n) {
24680
25528
  case 0:
24681
- _context16.p = 0;
24682
- _context16.n = 1;
25529
+ _context17.p = 0;
25530
+ _context17.n = 1;
24683
25531
  return this.repository.fetchAndParseCacheTimestamp(parentPlaceId);
24684
25532
  case 1:
24685
- cacheTimestamp = _context16.v;
25533
+ cacheTimestamp = _context17.v;
24686
25534
  this.logEvent("getCacheTimestamp");
24687
- return _context16.a(2, cacheTimestamp);
25535
+ return _context17.a(2, cacheTimestamp);
24688
25536
  case 2:
24689
- _context16.p = 2;
24690
- _t15 = _context16.v;
25537
+ _context17.p = 2;
25538
+ _t16 = _context17.v;
24691
25539
  throw new Error("Failed to get cache timestamp", {
24692
- cause: _t15
25540
+ cause: _t16
24693
25541
  });
24694
25542
  case 3:
24695
- return _context16.a(2);
25543
+ return _context17.a(2);
24696
25544
  }
24697
- }, _callee16, this, [[0, 2]]);
25545
+ }, _callee17, this, [[0, 2]]);
24698
25546
  }));
24699
- function getCacheTimestamp(_x30) {
25547
+ function getCacheTimestamp(_x32) {
24700
25548
  return _getCacheTimestamp.apply(this, arguments);
24701
25549
  }
24702
25550
  return getCacheTimestamp;
@@ -24709,30 +25557,30 @@ var InternalMapVXSDK = /*#__PURE__*/function (_Loggeable) {
24709
25557
  }, {
24710
25558
  key: "getCssCustomization",
24711
25559
  value: function () {
24712
- var _getCssCustomization = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function _callee17(type) {
24713
- var cssCustomization, _t16;
24714
- return sdk_regenerator().w(function (_context17) {
24715
- while (1) switch (_context17.p = _context17.n) {
25560
+ var _getCssCustomization = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function _callee18(type) {
25561
+ var cssCustomization, _t17;
25562
+ return sdk_regenerator().w(function (_context18) {
25563
+ while (1) switch (_context18.p = _context18.n) {
24716
25564
  case 0:
24717
- _context17.p = 0;
24718
- _context17.n = 1;
25565
+ _context18.p = 0;
25566
+ _context18.n = 1;
24719
25567
  return this.repository.fetchAndParseCssCustomization(type);
24720
25568
  case 1:
24721
- cssCustomization = _context17.v;
25569
+ cssCustomization = _context18.v;
24722
25570
  this.logEvent("cssCustomization");
24723
- return _context17.a(2, cssCustomization);
25571
+ return _context18.a(2, cssCustomization);
24724
25572
  case 2:
24725
- _context17.p = 2;
24726
- _t16 = _context17.v;
25573
+ _context18.p = 2;
25574
+ _t17 = _context18.v;
24727
25575
  throw new Error("Failed to get css customization", {
24728
- cause: _t16
25576
+ cause: _t17
24729
25577
  });
24730
25578
  case 3:
24731
- return _context17.a(2);
25579
+ return _context18.a(2);
24732
25580
  }
24733
- }, _callee17, this, [[0, 2]]);
25581
+ }, _callee18, this, [[0, 2]]);
24734
25582
  }));
24735
- function getCssCustomization(_x31) {
25583
+ function getCssCustomization(_x33) {
24736
25584
  return _getCssCustomization.apply(this, arguments);
24737
25585
  }
24738
25586
  return getCssCustomization;
@@ -24740,29 +25588,29 @@ var InternalMapVXSDK = /*#__PURE__*/function (_Loggeable) {
24740
25588
  }, {
24741
25589
  key: "notifyHealth",
24742
25590
  value: function () {
24743
- var _notifyHealth = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function _callee18(healthPingId, placeId, totemId, status) {
24744
- var health, _t17;
24745
- return sdk_regenerator().w(function (_context18) {
24746
- while (1) switch (_context18.p = _context18.n) {
25591
+ var _notifyHealth = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function _callee19(healthPingId, placeId, totemId, status) {
25592
+ var health, _t18;
25593
+ return sdk_regenerator().w(function (_context19) {
25594
+ while (1) switch (_context19.p = _context19.n) {
24747
25595
  case 0:
24748
- _context18.p = 0;
24749
- _context18.n = 1;
25596
+ _context19.p = 0;
25597
+ _context19.n = 1;
24750
25598
  return this.repository.postAndParseHealthPing(healthPingId, placeId, totemId, status);
24751
25599
  case 1:
24752
- health = _context18.v;
24753
- return _context18.a(2, health);
25600
+ health = _context19.v;
25601
+ return _context19.a(2, health);
24754
25602
  case 2:
24755
- _context18.p = 2;
24756
- _t17 = _context18.v;
25603
+ _context19.p = 2;
25604
+ _t18 = _context19.v;
24757
25605
  throw new Error("Failed to notify health", {
24758
- cause: _t17
25606
+ cause: _t18
24759
25607
  });
24760
25608
  case 3:
24761
- return _context18.a(2);
25609
+ return _context19.a(2);
24762
25610
  }
24763
- }, _callee18, this, [[0, 2]]);
25611
+ }, _callee19, this, [[0, 2]]);
24764
25612
  }));
24765
- function notifyHealth(_x32, _x33, _x34, _x35) {
25613
+ function notifyHealth(_x34, _x35, _x36, _x37) {
24766
25614
  return _notifyHealth.apply(this, arguments);
24767
25615
  }
24768
25616
  return notifyHealth;
@@ -26174,6 +27022,8 @@ function normalizeOrigin(raw) {
26174
27022
  // ─── Domain Models: Banner ───────────────────────────────────────────────────
26175
27023
 
26176
27024
 
27025
+ // ─── Domain Models: Campaigns ────────────────────────────────────────────────
27026
+
26177
27027
  // ─── Domain Models: Categories ───────────────────────────────────────────────
26178
27028
 
26179
27029
  // ─── Domain Models: Circle ───────────────────────────────────────────────────