@mapsindoors/map-template 1.66.2 → 1.66.3

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 (48) hide show
  1. package/dist/_commonjsHelpers-ba3f0406-b20f75c1.mjs +30 -0
  2. package/dist/combo-box-item.entry-85094f35.mjs +22 -0
  3. package/dist/icon-b8d01d6f-6d4b7c40.mjs +33 -0
  4. package/dist/mapsindoors-react.es.js +7 -59824
  5. package/dist/mapsindoors-react.umd.js +560 -491
  6. package/dist/mapsindoors-webcomponent.es.js +51218 -39989
  7. package/dist/mapsindoors-webcomponent.umd.js +554 -480
  8. package/dist/mi-card_2.entry-817a0422.mjs +33 -0
  9. package/dist/mi-chip.entry-f7dbae24.mjs +26 -0
  10. package/dist/mi-column.entry-30d4c1d7.mjs +28 -0
  11. package/dist/mi-combo-box.entry-998279bc.mjs +270 -0
  12. package/dist/mi-data-table.entry-e0a9dd7a.mjs +231 -0
  13. package/dist/mi-distance_2.entry-e930707c.mjs +346 -0
  14. package/dist/mi-dropdown-item.entry-e624023f.mjs +22 -0
  15. package/dist/mi-dropdown.entry-8d4d8ee3.mjs +331 -0
  16. package/dist/mi-floor-selector.entry-329407f6.mjs +122 -0
  17. package/dist/mi-keyboard.entry-ceed8ed2.mjs +3048 -0
  18. package/dist/mi-list-item-category.entry-a33342c9.mjs +46 -0
  19. package/dist/mi-list-item-location.entry-e9b9527d.mjs +144 -0
  20. package/dist/mi-list.entry-d5bd6cae.mjs +49 -0
  21. package/dist/mi-location-booking.entry-63d82e20.mjs +4873 -0
  22. package/dist/mi-location-info.entry-43f0e6f3.mjs +39 -0
  23. package/dist/mi-map-googlemaps.entry-abe19e39.mjs +406 -0
  24. package/dist/mi-map-mapbox.entry-02d4ace9.mjs +308 -0
  25. package/dist/mi-metric-card.entry-85d97733.mjs +36 -0
  26. package/dist/mi-my-position.entry-223dd3e0.mjs +1406 -0
  27. package/dist/mi-notification.entry-7facb24f.mjs +91 -0
  28. package/dist/mi-route-instructions-heading.entry-e11004f5.mjs +82 -0
  29. package/dist/mi-route-instructions-maneuver-legacy.entry-e0a64029.mjs +83 -0
  30. package/dist/mi-route-instructions-maneuver.entry-98953d3e.mjs +83 -0
  31. package/dist/mi-route-instructions-step-legacy.entry-05ac87cf.mjs +209 -0
  32. package/dist/mi-route-instructions-step.entry-35ae490e.mjs +244 -0
  33. package/dist/mi-route-instructions.entry-fc97f09d.mjs +150 -0
  34. package/dist/mi-scroll-buttons.entry-9e523ef6.mjs +86 -0
  35. package/dist/mi-search.entry-8c1f6929.mjs +258 -0
  36. package/dist/mi-share-sms.entry-0689c0ac.mjs +63 -0
  37. package/dist/mi-step-switcher.entry-aa8f0707.mjs +34 -0
  38. package/dist/mi-tab-panel.entry-1ddc397b.mjs +29 -0
  39. package/dist/mi-tab.entry-a478df47.mjs +21 -0
  40. package/dist/mi-tabs.entry-7c445312.mjs +44 -0
  41. package/dist/mi-time.entry-df58a4f1.mjs +53 -0
  42. package/dist/mi-variables-9a6c8d4d-64044b44.mjs +16 -0
  43. package/dist/reactcomponent-fed5da4c.mjs +57763 -0
  44. package/dist/route-travel-mode.enum-7f4ce9c7-0da65b8e.mjs +16 -0
  45. package/dist/sort-order.enum-64ce8998-fb78d66a.mjs +326 -0
  46. package/dist/unit-system.enum-eaefb53e-5d1cf129.mjs +16 -0
  47. package/dist/utils-ae714467-4f4e3a56.mjs +45 -0
  48. package/package.json +1 -1
@@ -0,0 +1,91 @@
1
+ import { r as c, f as r, h as i, H as f, g as d } from "./reactcomponent-fed5da4c.mjs";
2
+ import "react";
3
+ import "react-dom";
4
+ (function() {
5
+ try {
6
+ var t = typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, e = new t.Error().stack;
7
+ e && (t._sentryDebugIds = t._sentryDebugIds || {}, t._sentryDebugIds[e] = "df413ede-37ba-4e7f-8003-b95f35f0ba3d", t._sentryDebugIdIdentifier = "sentry-dbid-df413ede-37ba-4e7f-8003-b95f35f0ba3d");
8
+ } catch {
9
+ }
10
+ })();
11
+ var l;
12
+ (function(t) {
13
+ t.TOP_LEFT = "top-left", t.TOP_CENTER = "top-center", t.TOP_RIGHT = "top-right", t.BOTTOM_CENTER = "bottom-center", t.BOTTOM_LEFT = "bottom-left", t.BOTTOM_RIGHT = "bottom-right";
14
+ })(l || (l = {}));
15
+ var n;
16
+ (function(t) {
17
+ t.Error = "error", t.Info = "info", t.Success = "success", t.Warning = "warning", t.None = "none";
18
+ })(n || (n = {}));
19
+ const h = ':host{padding:16px;font-family:Figtree, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";position:fixed;z-index:1000;display:flex;flex-direction:column}:host(.top-left){top:0;left:0}:host(.top-center){top:0;align-items:center;left:50%;transform:translate(-50%, 0)}:host(.top-right){top:0;right:0;align-items:flex-end}:host(.bottom-left){bottom:0;left:0}:host(.bottom-center){bottom:0;align-items:center;left:50%;transform:translate(-50%, 0)}:host(.bottom-right){bottom:0;right:0;align-items:flex-end}.notification{margin-top:16px;display:flex;flex-direction:row;box-shadow:0px 4px 4px rgba(0, 0, 0, 0.16), 0px 2px 2px rgba(0, 0, 0, 0.18), 0px 1px 1px rgba(0, 0, 0, 0.2);border-radius:2px;background-color:#fcfcfc;overflow:hidden}.notification .icon{width:48px;display:flex;justify-content:center;align-items:center}.notification .icon-type--error{background-color:#ef4444}.notification .icon-type--success{background-color:#22c55e}.notification .icon-type--warning{background-color:#f59e0b}.notification .icon-type--info{background-color:#6b7280}.notification .label{padding-left:16px;flex:1;font-size:0.875rem}.notification .btn{padding-left:24px;padding-right:16px;display:flex;align-items:center;border:none;background-color:#fcfcfc}.notification .btn:focus{outline:none;box-shadow:none}', g = class {
20
+ constructor(t) {
21
+ c(this, t), this.notifications = [], this.notificationId = 0, this.position = l.BOTTOM_RIGHT, this.duration = 3;
22
+ }
23
+ /**
24
+ * Show a notification.
25
+ *
26
+ * @param {string} message - Message to display.
27
+ * @param {string} [type='none'] - Type of notification. Available types: 'info', 'warning', 'success', 'error' and 'none'.
28
+ * @param {boolean} [sticky=false] - Set message as sticky to prevent it from disappearing.
29
+ * @returns {Promise<void>}
30
+ */
31
+ async push(t, e = "none", o = !1) {
32
+ if (typeof t != "string" || t.length < 1)
33
+ return;
34
+ if (!Object.values(n).some((a) => a === e)) {
35
+ console.error("Invalid notification type");
36
+ return;
37
+ }
38
+ const s = {
39
+ id: this.notificationId,
40
+ message: t,
41
+ sticky: o,
42
+ type: e
43
+ };
44
+ o === !1 && (s.timer = window.setTimeout(() => this.dismiss(s.id), this.duration * 1e3)), this.notificationId++, this.notifications.push(s), r(this.hostElement);
45
+ }
46
+ /**
47
+ * Clear all notifications.
48
+ *
49
+ * @returns {Promise<void>}
50
+ */
51
+ async clearAll() {
52
+ this.notifications = [], r(this.hostElement);
53
+ }
54
+ /**
55
+ * Dismiss a single notification.
56
+ *
57
+ * @param {number} id
58
+ */
59
+ dismiss(t) {
60
+ this.notifications = this.notifications.filter((e) => e.id !== t), r(this.hostElement);
61
+ }
62
+ render() {
63
+ return i(f, { class: this.position }, this.notifications.map((t) => this.renderNotification(t)));
64
+ }
65
+ /**
66
+ * Get JSX for notification.
67
+ *
68
+ * @param {NotificationMessage} { id, message }
69
+ * @returns {JSX.Element}
70
+ */
71
+ renderNotification({ id: t, message: e, type: o }) {
72
+ return i("div", { class: "notification", role: "alert" }, o && o !== "none" ? this.renderIcon(o) : null, i("p", { class: "label" }, e), i("button", { type: "button", "aria-label": "Dismiss notification", class: "btn", onClick: () => this.dismiss(t) }, i("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", role: "img", "aria-hidden": "true", focusable: "false" }, i("path", { d: "M14 1.41L12.59 0L7 5.59L1.41 0L0 1.41L5.59 7L0 12.59L1.41 14L7 8.41L12.59 14L14 12.59L8.41 7L14 1.41Z", fill: "#1E2025" }))));
73
+ }
74
+ /**
75
+ * Get JSX for type-icon.
76
+ *
77
+ * @param {NotificationType} type
78
+ * @returns {JSX.Element}
79
+ */
80
+ renderIcon(t) {
81
+ return t === n.Error ? i("div", { class: "icon icon-type--error" }, i("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", role: "img", "aria-hidden": "true", focusable: "false" }, i("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M10 0C4.48 0 0 4.48 0 10C0 15.52 4.48 20 10 20C15.52 20 20 15.52 20 10C20 4.48 15.52 0 10 0ZM9 15V13H11V15H9ZM9 5V11H11V5H9Z", fill: "#FCFCFC" }))) : t === n.Success ? i("div", { class: "icon icon-type--success" }, i("svg", { width: "18", height: "14", viewBox: "0 0 18 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", role: "img", "aria-hidden": "true", focusable: "false" }, i("path", { d: "M5.99997 11.17L1.82997 7L0.409973 8.41L5.99997 14L18 2L16.59 0.59L5.99997 11.17Z", fill: "#FCFCFC" }))) : t === n.Warning ? i("div", { class: "icon icon-type--warning" }, i("svg", { width: "22", height: "19", viewBox: "0 0 22 19", fill: "none", xmlns: "http://www.w3.org/2000/svg", role: "img", "aria-hidden": "true", focusable: "false" }, i("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M22 19L11 0L0 19H22ZM10 16V14H12V16H10ZM10 12H12V8H10V12Z", fill: "#FCFCFC" }))) : i("div", { class: "icon icon-type--info" }, i("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", role: "img", "aria-hidden": "true", focusable: "false" }, i("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M10 0C4.48 0 0 4.48 0 10C0 15.52 4.48 20 10 20C15.52 20 20 15.52 20 10C20 4.48 15.52 0 10 0ZM9 15V9H11V15H9ZM9 5V7H11V5H9Z", fill: "#FCFCFC" })));
82
+ }
83
+ get hostElement() {
84
+ return d(this);
85
+ }
86
+ };
87
+ g.style = h;
88
+ export {
89
+ g as mi_notification
90
+ };
91
+ //# sourceMappingURL=mi-notification.entry-7facb24f.mjs.map
@@ -0,0 +1,82 @@
1
+ import { r as s, h as t } from "./reactcomponent-fed5da4c.mjs";
2
+ import { R as i } from "./route-travel-mode.enum-7f4ce9c7-0da65b8e.mjs";
3
+ import { U as a } from "./unit-system.enum-eaefb53e-5d1cf129.mjs";
4
+ import "react";
5
+ import "react-dom";
6
+ (function() {
7
+ try {
8
+ var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, n = new e.Error().stack;
9
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "32742bb1-c7a0-4c08-a187-1eed64116611", e._sentryDebugIdIdentifier = "sentry-dbid-32742bb1-c7a0-4c08-a187-1eed64116611");
10
+ } catch {
11
+ }
12
+ })();
13
+ const r = '.directions{border-bottom:1px solid #d1d5db;color:#1c1917;font-size:1rem;font-weight:400;font-family:Figtree, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"}.directions-way-points{padding-top:24px;padding-bottom:24px;padding-left:16px;padding-right:16px;border-bottom:1px solid #f3f4f6}.directions-way-points span{display:block}.directions-way-points span:first-child{font-size:1.25rem;font-weight:500;line-height:1.5rem}.directions-way-points span:last-child{color:#6b7280}.directions-way-points span:last-child a{color:#3b82f6;text-decoration:none}.directions-details{padding:16px;display:flex;flex-direction:row;justify-content:space-between}.directions-details-numbers mi-time{font-weight:500}.directions-details-numbers-distance{color:#6b7280;font-size:0.875rem;font-weight:400;text-transform:lowercase}.directions-details-travel-mode-selector{display:flex;align-items:center;color:#3b82f6;text-decoration:none}.directions-details-travel-mode-selector mi-icon{width:24px;height:24px;margin-left:8px;background-color:#3b82f6}', o = class {
14
+ constructor(e) {
15
+ s(this, e), this.originName = void 0, this.destinationName = void 0, this.totalTravelTime = void 0, this.totalWalkingDistance = void 0, this.travelMode = i.Walking, this.unit = a.Metric, this.translations = {
16
+ from: "From",
17
+ to: "To",
18
+ avoidStairs: "Avoid stairs",
19
+ walk: "Walk",
20
+ walking: "Walking",
21
+ bike: "Bike",
22
+ bicycling: "Bicycling",
23
+ transit: "Transit",
24
+ car: "Car",
25
+ driving: "Driving"
26
+ };
27
+ }
28
+ /**
29
+ * Get travel mode as a string. Eg. "Walking", "Driving", "Transit", "Bicycling".
30
+ *
31
+ * @returns {string}
32
+ */
33
+ getTravelModeString() {
34
+ switch (this.travelMode) {
35
+ case i.Walking:
36
+ return this.translations.walk;
37
+ case i.Driving:
38
+ return this.translations.car;
39
+ case i.Transit:
40
+ return this.translations.transit;
41
+ case i.Bicycling:
42
+ return this.translations.bike;
43
+ default:
44
+ return this.translations.walk;
45
+ }
46
+ }
47
+ /**
48
+ * Get icon name for travel mode.
49
+ *
50
+ * @returns {string}
51
+ */
52
+ getTravelModeIconName() {
53
+ switch (this.travelMode) {
54
+ case i.Walking:
55
+ return "walk";
56
+ case i.Driving:
57
+ return "car";
58
+ case i.Transit:
59
+ return "transit";
60
+ case i.Bicycling:
61
+ return "bike";
62
+ default:
63
+ return "walk";
64
+ }
65
+ }
66
+ render() {
67
+ return t("div", { class: "directions" }, this.originName && this.destinationName ? this.renderWayPoints() : null, t("div", { class: "directions-details" }, this.totalTravelTime >= 0 || this.totalWalkingDistance >= 0 ? t("div", { class: "directions-details-numbers" }, this.totalTravelTime >= 0 ? t("div", null, t("mi-time", { seconds: this.totalTravelTime })) : null, this.totalWalkingDistance >= 0 ? t("div", { class: "directions-details-numbers-distance" }, t("mi-distance", { meters: this.totalWalkingDistance }), " ", this.translations.walking.toLowerCase()) : null) : null, t("a", { href: "#", class: "directions-details-travel-mode-selector" }, this.getTravelModeString(), t("mi-icon", { "icon-name": this.getTravelModeIconName() }))));
68
+ }
69
+ /**
70
+ * Render direction way points.
71
+ *
72
+ * @returns {JSX.Element}
73
+ */
74
+ renderWayPoints() {
75
+ return t("div", { class: "directions-way-points" }, t("span", null, this.translations.to, " ", this.destinationName), t("span", null, this.translations.from, " ", t("a", { href: "#" }, this.originName)));
76
+ }
77
+ };
78
+ o.style = r;
79
+ export {
80
+ o as mi_route_instructions_heading
81
+ };
82
+ //# sourceMappingURL=mi-route-instructions-heading.entry-e11004f5.mjs.map
@@ -0,0 +1,83 @@
1
+ import { r as s, h as e, H as r } from "./reactcomponent-fed5da4c.mjs";
2
+ import { U as o } from "./unit-system.enum-eaefb53e-5d1cf129.mjs";
3
+ import "react";
4
+ import "react-dom";
5
+ (function() {
6
+ try {
7
+ var t = typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, n = new t.Error().stack;
8
+ n && (t._sentryDebugIds = t._sentryDebugIds || {}, t._sentryDebugIds[n] = "31294eba-4a02-436e-9bae-42e24efb251f", t._sentryDebugIdIdentifier = "sentry-dbid-31294eba-4a02-436e-9bae-42e24efb251f");
9
+ } catch {
10
+ }
11
+ })();
12
+ const l = ':host{display:flex;padding-top:12px;padding-bottom:12px;font-family:Figtree, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"}.icon{width:48px;display:flex;justify-content:center}.icon mi-icon{width:24px;height:24px}.description{display:flex;flex-direction:column;flex:1}.description p{margin:0;padding-right:16px;font-size:0.875rem;word-break:break-all}.description__distance{display:flex;align-items:center}.description__distance mi-distance{font-size:0.75rem;padding-right:12px}.description__distance-border{flex:1;width:100%;height:0;border-bottom:1px solid #e5e7eb}', d = class {
13
+ constructor(t) {
14
+ s(this, t), this.maneuver = void 0, this.maneuverData = void 0, this.translations = void 0, this.translationsData = void 0, this.unit = o.Metric;
15
+ }
16
+ parseManeuverProp() {
17
+ this.maneuverData = JSON.parse(this.maneuver);
18
+ }
19
+ parseTranslationsProp() {
20
+ this.translationsData = JSON.parse(this.translations);
21
+ }
22
+ componentWillLoad() {
23
+ this.parseManeuverProp(), this.parseTranslationsProp();
24
+ }
25
+ /**
26
+ * Get maneuver name.
27
+ *
28
+ * @returns {string}
29
+ */
30
+ getManeuverName(t) {
31
+ if (t.includes("straight"))
32
+ return "straight";
33
+ if (t.includes("sharp right"))
34
+ return "sharp-right";
35
+ if (t.includes("sharp left"))
36
+ return "sharp-left";
37
+ if (t.includes("slight right"))
38
+ return "slight-right";
39
+ if (t.includes("slight left"))
40
+ return "slight-left";
41
+ if (t.includes("right"))
42
+ return "right";
43
+ if (t.includes("left"))
44
+ return "left";
45
+ if (t.includes("uturn"))
46
+ return "u-turn";
47
+ if (t.includes("depart"))
48
+ return "straight";
49
+ }
50
+ render() {
51
+ return this.maneuverData && this.translationsData ? this.renderManeuver() : null;
52
+ }
53
+ /**
54
+ * Render step.
55
+ *
56
+ * @returns {JSX.Element}
57
+ */
58
+ renderManeuver() {
59
+ const t = {
60
+ straight: this.translationsData.continueStraightAhead,
61
+ left: `${this.translationsData.goLeft} ${this.translationsData.andContinue}`,
62
+ "sharp-left": `${this.translationsData.goSharpLeft} ${this.translationsData.andContinue}`,
63
+ "slight-left": `${this.translationsData.goSlightLeft} ${this.translationsData.andContinue}`,
64
+ right: `${this.translationsData.goRight} ${this.translationsData.andContinue}`,
65
+ "sharp-right": `${this.translationsData.goSharpRight} ${this.translationsData.andContinue}`,
66
+ "slight-right": `${this.translationsData.goSlightRight} ${this.translationsData.andContinue}`,
67
+ "u-turn": `${this.translationsData.turnAround} ${this.translationsData.andContinue}`
68
+ // 'Turn around and continue'
69
+ }, n = this.getManeuverName(this.maneuverData.maneuver.toLowerCase()), i = `arrow-${n}`, a = this.maneuverData.instructions ? this.maneuverData.instructions : t[n];
70
+ return e(r, null, e("div", { class: "icon" }, n ? e("mi-icon", { part: "maneuver-icon", "icon-name": i }) : null), e("div", { class: "description" }, e("p", { part: "maneuver-description" }, a), e("div", { class: "description__distance" }, e("mi-distance", { part: "maneuver-description-distance", meters: this.maneuverData.distance.value, unit: this.unit }), e("span", { part: "maneuver-description-distance-border", class: "description__distance-border" }))));
71
+ }
72
+ static get watchers() {
73
+ return {
74
+ maneuver: ["parseManeuverProp"],
75
+ translations: ["parseTranslationsProp"]
76
+ };
77
+ }
78
+ };
79
+ d.style = l;
80
+ export {
81
+ d as mi_route_instructions_maneuver_legacy
82
+ };
83
+ //# sourceMappingURL=mi-route-instructions-maneuver-legacy.entry-e0a64029.mjs.map
@@ -0,0 +1,83 @@
1
+ import { r as e, h as a, H as r } from "./reactcomponent-fed5da4c.mjs";
2
+ import { U as o } from "./unit-system.enum-eaefb53e-5d1cf129.mjs";
3
+ import "react";
4
+ import "react-dom";
5
+ (function() {
6
+ try {
7
+ var t = typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, n = new t.Error().stack;
8
+ n && (t._sentryDebugIds = t._sentryDebugIds || {}, t._sentryDebugIds[n] = "d2260c26-a96c-4f2b-ab01-f533de617a97", t._sentryDebugIdIdentifier = "sentry-dbid-d2260c26-a96c-4f2b-ab01-f533de617a97");
9
+ } catch {
10
+ }
11
+ })();
12
+ const u = ":host{display:grid;gap:24px;grid-auto-flow:column;align-items:center;grid-template-columns:24px 1fr;border-top:1px solid #e5e7eb;padding:16px}.icon{width:24px;height:24px}.description{font-size:16px;display:grid;gap:8px;height:-moz-fit-content;height:fit-content}.description__text{margin:0;font-size:16px;word-break:break-all}.description mi-distance{font-size:12px;color:#6b7280}", l = class {
13
+ constructor(t) {
14
+ e(this, t), this.maneuver = void 0, this.maneuverData = void 0, this.translations = void 0, this.translationsData = void 0, this.unit = o.Metric;
15
+ }
16
+ parseManeuverProp() {
17
+ this.maneuverData = JSON.parse(this.maneuver);
18
+ }
19
+ parseTranslationsProp() {
20
+ this.translationsData = JSON.parse(this.translations);
21
+ }
22
+ componentWillLoad() {
23
+ this.parseManeuverProp(), this.parseTranslationsProp();
24
+ }
25
+ /**
26
+ * Get maneuver name.
27
+ *
28
+ * @returns {string}
29
+ */
30
+ getManeuverName(t) {
31
+ if (t.includes("straight"))
32
+ return "straight";
33
+ if (t.includes("sharp right"))
34
+ return "sharp-right";
35
+ if (t.includes("sharp left"))
36
+ return "sharp-left";
37
+ if (t.includes("slight right"))
38
+ return "slight-right";
39
+ if (t.includes("slight left"))
40
+ return "slight-left";
41
+ if (t.includes("right"))
42
+ return "right";
43
+ if (t.includes("left"))
44
+ return "left";
45
+ if (t.includes("uturn"))
46
+ return "u-turn";
47
+ if (t.includes("depart"))
48
+ return "straight";
49
+ }
50
+ render() {
51
+ return this.maneuverData && this.translationsData ? this.renderManeuver() : null;
52
+ }
53
+ /**
54
+ * Render step.
55
+ *
56
+ * @returns {JSX.Element}
57
+ */
58
+ renderManeuver() {
59
+ const t = {
60
+ straight: this.translationsData.continueStraightAhead,
61
+ left: `${this.translationsData.goLeft} ${this.translationsData.andContinue}`,
62
+ "sharp-left": `${this.translationsData.goSharpLeft} ${this.translationsData.andContinue}`,
63
+ "slight-left": `${this.translationsData.goSlightLeft} ${this.translationsData.andContinue}`,
64
+ right: `${this.translationsData.goRight} ${this.translationsData.andContinue}`,
65
+ "sharp-right": `${this.translationsData.goSharpRight} ${this.translationsData.andContinue}`,
66
+ "slight-right": `${this.translationsData.goSlightRight} ${this.translationsData.andContinue}`,
67
+ "u-turn": `${this.translationsData.turnAround} ${this.translationsData.andContinue}`
68
+ // 'Turn around and continue'
69
+ }, n = this.getManeuverName(this.maneuverData.maneuver.toLowerCase()), i = `arrow-${n}`, s = this.maneuverData.instructions ? this.maneuverData.instructions : t[n];
70
+ return a(r, null, a("div", { class: "icon" }, n ? a("mi-icon", { part: "maneuver-icon", "icon-name": i }) : null), a("div", { class: "description" }, a("div", { class: "description__text" }, s), a("mi-distance", { part: "maneuver-description-distance", meters: this.maneuverData.distance.value, unit: this.unit })));
71
+ }
72
+ static get watchers() {
73
+ return {
74
+ maneuver: ["parseManeuverProp"],
75
+ translations: ["parseTranslationsProp"]
76
+ };
77
+ }
78
+ };
79
+ l.style = u;
80
+ export {
81
+ l as mi_route_instructions_maneuver
82
+ };
83
+ //# sourceMappingURL=mi-route-instructions-maneuver.entry-98953d3e.mjs.map
@@ -0,0 +1,209 @@
1
+ import { r as n, c as r, h as s } from "./reactcomponent-fed5da4c.mjs";
2
+ import { U as o } from "./unit-system.enum-eaefb53e-5d1cf129.mjs";
3
+ import { c as l } from "./utils-ae714467-4f4e3a56.mjs";
4
+ import "react";
5
+ import "react-dom";
6
+ (function() {
7
+ try {
8
+ var t = typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, e = new t.Error().stack;
9
+ e && (t._sentryDebugIds = t._sentryDebugIds || {}, t._sentryDebugIds[e] = "2251760d-9bc4-42dc-aa9f-5d7dad2122ac", t._sentryDebugIdIdentifier = "sentry-dbid-2251760d-9bc4-42dc-aa9f-5d7dad2122ac");
10
+ } catch {
11
+ }
12
+ })();
13
+ const p = ':host{display:block;font-family:Figtree, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"}.step{display:grid;grid-template-columns:40px 1fr 40px;grid-template-areas:"actionicon heading heading" "modeicon description toggle" "modeicon substeps substeps"}.step__action-icon{-ms-grid-row:1;-ms-grid-column:1;display:flex;justify-content:center;align-items:center;grid-area:actionicon}.step__action-icon--circled{position:relative}.step__action-icon--circled::before{position:absolute;width:24px;height:24px;border:1px solid #1c1917;content:"";border-radius:50%}.step__action-icon mi-icon{display:block;width:12px;height:12px}.step__heading{-ms-grid-row:1;-ms-grid-column:2;-ms-grid-column-span:2;grid-area:heading;font-size:1rem;margin:0;border-bottom:1px solid #DCDCDF;border-top:1px solid #DCDCDF;padding:12px}.step__heading>span{font-size:0.875rem;color:#6b7280}.step__travel-mode{-ms-grid-row:2;-ms-grid-row-span:2;-ms-grid-column:1;grid-area:modeicon;display:flex;justify-content:center;align-items:center;position:relative;min-height:72px}.step__travel-mode::before{position:absolute;width:calc(50% - 2px);left:0;height:100%;content:""}.step__travel-mode--dotted::before{border-right:4px dotted #bfdbfe}.step__travel-mode--solid::before{border-right:4px solid #bfdbfe}.step__travel-mode-icon{position:absolute;left:50%;top:24px;transform:translateX(-50%);background-color:#fcfcfc;padding:3px;border-radius:4px}.step__travel-mode-icon mi-icon{width:16px;height:16px;background-color:#6b7280;display:block}.step__description{-ms-grid-row:2;-ms-grid-column:2;grid-area:description;padding:12px}.step__short-name{margin-right:4px;padding:2px 4px;font-size:0.875rem;color:#fcfcfc;background-color:#6b7280;border-radius:2px}.step__distance-duration{color:#6b7280;font-size:0.875rem}.step__toggle{-ms-grid-row:2;-ms-grid-column:3;grid-area:toggle;display:flex;justify-content:center;align-items:center;transition:transform 300ms;cursor:pointer}.step__toggle--open{transform:rotate(180deg)}.step__toggle mi-icon{width:16px;height:16px;display:block;background-color:#3b82f6}.step__substeps{-ms-grid-row:3;-ms-grid-column:2;-ms-grid-column-span:2;grid-area:substeps}', d = class {
14
+ constructor(t) {
15
+ n(this, t), this.stepClicked = r(this, "stepClicked", 7), this.isInternetExplorer = l(), this.step = void 0, this.stepData = void 0, this.hideIndoorSubsteps = !0, this.fromRouteContext = "", this.fromTravelMode = void 0, this.fromTransitStop = void 0, this.unit = o.Metric, this.translations = void 0, this.translationsData = void 0, this.substepsAreOpen = !1;
16
+ }
17
+ parseStepProp() {
18
+ this.step && (this.stepData = JSON.parse(this.step));
19
+ }
20
+ parseTranslationsProp() {
21
+ this.translations && (this.translationsData = JSON.parse(this.translations));
22
+ }
23
+ componentWillLoad() {
24
+ this.parseStepProp(), this.parseTranslationsProp();
25
+ }
26
+ /**
27
+ * Render if there is step data.
28
+ */
29
+ render() {
30
+ return this.stepData && this.translationsData ? this.renderStep() : null;
31
+ }
32
+ /**
33
+ * Emits stepClicked event (if click target is not related to an action)
34
+ * @param event Event
35
+ */
36
+ stepClickHandler(t) {
37
+ if (Array.from(t.target.classList).includes("icon-toggle"))
38
+ return;
39
+ let e = null;
40
+ t.target.dataset.maneuverIndex !== void 0 && (e = parseInt(t.target.dataset.maneuverIndex)), this.stepClicked.emit({ maneuverIndex: e });
41
+ }
42
+ /**
43
+ * Render step part depending on travel mode.
44
+ *
45
+ * @returns {JSX.Element}
46
+ */
47
+ renderStep() {
48
+ switch (this.stepData.travel_mode.toUpperCase()) {
49
+ case "DRIVING":
50
+ return this.renderDrivingStep();
51
+ case "WALKING":
52
+ return this.renderWalkingStep();
53
+ case "BICYCLING":
54
+ return this.renderBicyclingStep();
55
+ case "TRANSIT":
56
+ return this.renderTransitStep();
57
+ default:
58
+ return s("div", null, "Unknown travel mode: ", this.stepData.travel_mode);
59
+ }
60
+ }
61
+ /**
62
+ * Render the travel mode indicator and dotted/solid line.
63
+ *
64
+ * @returns {JSX.Element}
65
+ */
66
+ renderTravelMode() {
67
+ if (this.isInternetExplorer)
68
+ return null;
69
+ let t;
70
+ switch (this.stepData.travel_mode.toUpperCase()) {
71
+ case "DRIVING":
72
+ t = "car";
73
+ break;
74
+ case "WALKING":
75
+ t = "walk";
76
+ break;
77
+ case "BICYCLING":
78
+ t = "bike";
79
+ break;
80
+ case "TRANSIT":
81
+ t = this.getTransitVehicleIconName();
82
+ break;
83
+ }
84
+ return s("span", { part: "step-travel-mode", class: `step__travel-mode step__travel-mode--${this.stepData.travel_mode.toUpperCase() === "TRANSIT" ? "solid" : "dotted"}` }, s("span", { class: "step__travel-mode-icon" }, s("mi-icon", { part: "step-travel-mode-icon", "icon-name": t })));
85
+ }
86
+ /**
87
+ * Get icon name for transit vehicle.
88
+ *
89
+ * @returns {string}
90
+ */
91
+ getTransitVehicleIconName() {
92
+ var t, e;
93
+ const i = (e = (t = this.stepData.transit_information) === null || t === void 0 ? void 0 : t.line.vehicle) === null || e === void 0 ? void 0 : e.type.toLowerCase();
94
+ return i && ["boat", "bus", "railway", "train", "subway"].some((a) => a === i) ? i : "transit";
95
+ }
96
+ /**
97
+ * Toggles visibility of sub steps (steps in steps)
98
+ */
99
+ toggleSubsteps() {
100
+ this.substepsAreOpen = !this.substepsAreOpen;
101
+ }
102
+ /**
103
+ * Render substeps if they should be visible.
104
+ *
105
+ * @returns {JSX.Element}
106
+ */
107
+ renderSubsteps() {
108
+ return this.substepsAreOpen === !0 ? s("div", { class: "step__substeps" }, this.stepData.steps.map((t, e) => s("mi-route-instructions-maneuver-legacy", {
109
+ "data-maneuver-index": e,
110
+ maneuver: JSON.stringify(t),
111
+ translations: this.translations,
112
+ unit: this.unit,
113
+ // @ts-ignore
114
+ exportparts: `
115
+ maneuver-icon,
116
+ maneuver-description,
117
+ maneuver-description-distance,
118
+ maneuver-description-distance-border`
119
+ }))) : null;
120
+ }
121
+ /**
122
+ * Render the toggle button for the sub step expander.
123
+ *
124
+ * @returns {JSX.Element}
125
+ */
126
+ renderToggleButton() {
127
+ return this.stepData.steps.length <= 0 || this.hideIndoorSubsteps === !0 && this.stepData.route_context.toLowerCase() === "insidebuilding" ? null : s("span", { class: `step__toggle ${this.substepsAreOpen ? "step__toggle--open" : ""}`, onClick: () => this.toggleSubsteps() }, this.isInternetExplorer ? "▼" : s("mi-icon", { part: "step-toggle", "icon-name": "toggle" }));
128
+ }
129
+ /**
130
+ * Render time and distance part.
131
+ *
132
+ * @returns {JSX.Element}
133
+ */
134
+ renderTimeAndDistance() {
135
+ return s("span", { part: "step-info", class: "step__distance-duration" }, s("mi-time", { seconds: this.stepData.duration.value, translations: `{"days":"${this.translationsData.days}","hours":"${this.translationsData.hours}","minutes":"${this.translationsData.minutes}"}` }), " · ", s("mi-distance", { meters: this.stepData.distance.value, unit: this.unit }), s("br", null));
136
+ }
137
+ /**
138
+ * Render a driving step.
139
+ *
140
+ * @returns {JSX.Element}
141
+ */
142
+ renderDrivingStep() {
143
+ return s("div", { class: "step", onClick: (t) => this.stepClickHandler(t) }, this.isInternetExplorer ? null : s("span", { class: "step__action-icon step__action-icon--circled" }, s("mi-icon", { "icon-name": "car" })), s("h3", { part: "step-heading", class: "step__heading" }, this.getStepHeading()), this.renderTravelMode(), s("div", { part: "step-description", class: "step__description" }, this.translationsData.drive, s("br", null), this.renderTimeAndDistance()), this.renderToggleButton(), this.renderSubsteps());
144
+ }
145
+ /**
146
+ * Get display heading.
147
+ *
148
+ * @returns {string}
149
+ */
150
+ getStepHeading() {
151
+ var t;
152
+ const e = {
153
+ driving: this.translationsData.drive,
154
+ walking: this.translationsData.walk,
155
+ bicycling: this.translationsData.bike
156
+ };
157
+ return !((t = this.stepData.steps[0]) === null || t === void 0) && t.instructions ? this.stepData.steps[0].instructions : e[this.stepData.travel_mode.toLowerCase()];
158
+ }
159
+ /**
160
+ * Render a walking step.
161
+ *
162
+ *
163
+ * @returns {JSX.Element}
164
+ */
165
+ renderWalkingStep() {
166
+ let t, e;
167
+ return this.stepData.parking === !0 ? (t = `${this.translationsData.park} ${this.stepData.label ? ` ${this.translationsData.at} ` + this.stepData.label : ""}`, e = "park") : this.stepData.highway && this.stepData.highway.toUpperCase() === "STEPS" ? (t = `${this.translationsData.takeStaircaseToLevel} ${this.stepData.end_location.floor_name}`, e = "stairs") : this.stepData.highway && this.stepData.highway.toUpperCase() === "LADDER" ? (t = `${this.translationsData.takeLadderToLevel} ${this.stepData.end_location.floor_name}`, e = "ladder") : this.stepData.highway && this.stepData.highway.toUpperCase() === "ESCALATOR" ? (t = `${this.translationsData.takeEscalatorToLevel} ${this.stepData.end_location.floor_name}`, e = "escalator") : this.stepData.highway && this.stepData.highway.toUpperCase() === "WHEELCHAIRRAMP" ? (t = `${this.translationsData.takeWheelchairRampToLevel} ${this.stepData.end_location.floor_name}`, e = "wheelchair-ramp") : this.stepData.highway && this.stepData.highway.toUpperCase() === "WHEELCHAIRLIFT" ? (t = `${this.translationsData.takeWheelchairLiftToLevel} ${this.stepData.end_location.floor_name}`, e = "wheelchair-lift") : this.stepData.highway && this.stepData.highway.toUpperCase() === "ELEVATOR" ? (t = `${this.translationsData.takeElevatorToLevel} ${this.stepData.end_location.floor_name}`, e = "elevator") : this.fromRouteContext === "InsideBuilding" && this.stepData.route_context === "Outside" ? (t = this.addStepContextNameToHeading(this.translationsData.exit, this.stepData.start_context), e = "exit") : this.fromRouteContext === "InsideBuilding" && this.stepData.route_context === "InsideBuilding" ? (t = this.getStepHeading(), e = "walk") : this.fromRouteContext === "Outside" && this.stepData.route_context === "Outside" && this.fromTravelMode.toUpperCase() === "TRANSIT" ? (t = this.fromTransitStop, e = "transit-stop") : this.fromRouteContext === "Outside" && this.stepData.route_context === "Outside" ? (t = this.getStepHeading(), e = "walk") : this.fromRouteContext === "Outside" && this.stepData.route_context === "InsideBuilding" ? (t = this.addStepContextNameToHeading(this.translationsData.enter, this.stepData.end_context), e = "enter") : (t = this.fromRouteContext, e = "circle"), s("div", { class: "step", onClick: (i) => this.stepClickHandler(i) }, this.isInternetExplorer ? null : s("span", { class: `step__action-icon ${e !== "circle" ? "step__action-icon--circled" : ""}` }, s("mi-icon", { "icon-name": e })), s("h3", { part: "step-heading", class: "step__heading" }, t), this.renderTravelMode(), s("div", { part: "step-description", class: "step__description" }, this.translationsData.walk, s("br", null), this.renderTimeAndDistance()), this.renderToggleButton(), this.renderSubsteps());
168
+ }
169
+ /**
170
+ * Add building or venue name to the step heading
171
+ * @param {string} heading
172
+ * @param {StepContext} stepContext
173
+ * @returns
174
+ */
175
+ addStepContextNameToHeading(t, e) {
176
+ return e && (e.building ? t += ` ${e.building.buildingInfo.name} ${this.translationsData.building}` : e.venue && (t += ` ${e.venue.venueInfo.name} ${this.translationsData.venue}`)), t;
177
+ }
178
+ /**
179
+ * Render a bicycling step.
180
+ *
181
+ * @returns {JSX.Element}
182
+ */
183
+ renderBicyclingStep() {
184
+ return s("div", { class: "step", onClick: (t) => this.stepClickHandler(t) }, this.isInternetExplorer ? null : s("span", { class: "step__action-icon step__action-icon--circled" }, s("mi-icon", { "icon-name": "bike" })), s("h3", { part: "step-heading", class: "step__heading" }, this.getStepHeading()), this.renderTravelMode(), s("div", { part: "step-description", class: "step__description" }, this.translationsData.bike, s("br", null), this.renderTimeAndDistance()), this.renderToggleButton(), this.renderSubsteps());
185
+ }
186
+ /**
187
+ * Render a transit step.
188
+ *
189
+ * @returns {JSX.Element}
190
+ */
191
+ renderTransitStep() {
192
+ var t, e;
193
+ return s("div", { class: "step", onClick: (i) => this.stepClickHandler(i) }, this.isInternetExplorer ? null : s("span", { class: "step__action-icon step__action-icon--circled" }, s("mi-icon", { "icon-name": "transit-stop" })), s("h3", { part: "step-heading", class: "step__heading" }, this.stepData.instructions), this.renderTravelMode(), s("div", { part: "step-description", class: "step__description" }, this.stepData.transit_information.line.short_name ? s("span", { class: "step__short-name", style: {
194
+ backgroundColor: !((t = this.stepData.transit_information.line) === null || t === void 0) && t.color ? this.stepData.transit_information.line.color : null,
195
+ color: !((e = this.stepData.transit_information.line) === null || e === void 0) && e.text_color ? this.stepData.transit_information.line.text_color : null
196
+ } }, this.stepData.transit_information.line.short_name) : null, this.stepData.transit_information.headsign ? this.stepData.transit_information.headsign : null, s("br", null), s("span", { part: "step-info", class: "step__distance-duration" }, s("mi-time", { seconds: this.stepData.duration.value, translations: `{"days":"${this.translationsData.days}","hours":"${this.translationsData.hours}","minutes":"${this.translationsData.minutes}"}` }), " · ", this.stepData.transit_information.num_stops ? this.stepData.transit_information.num_stops : null, " ", this.translationsData.stops ? this.translationsData.stops : null)), this.renderToggleButton(), this.renderSubsteps());
197
+ }
198
+ static get watchers() {
199
+ return {
200
+ step: ["parseStepProp"],
201
+ translations: ["parseTranslationsProp"]
202
+ };
203
+ }
204
+ };
205
+ d.style = p;
206
+ export {
207
+ d as mi_route_instructions_step_legacy
208
+ };
209
+ //# sourceMappingURL=mi-route-instructions-step-legacy.entry-05ac87cf.mjs.map