@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,244 @@
1
+ import { r as o, c as a, h as e } from "./reactcomponent-fed5da4c.mjs";
2
+ import { U as n } 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 : {}, s = new t.Error().stack;
9
+ s && (t._sentryDebugIds = t._sentryDebugIds || {}, t._sentryDebugIds[s] = "403abe8b-c616-4b4e-bbe7-d9146019f617", t._sentryDebugIdIdentifier = "sentry-dbid-403abe8b-c616-4b4e-bbe7-d9146019f617");
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;gap:16px;justify-items:center}.step__info{display:grid;grid-auto-flow:column;align-items:center;justify-content:space-between;width:100%;position:sticky;top:50px;background:white;z-index:1000;padding-bottom:8px}.step__destination{display:grid;gap:8px;align-items:center;justify-content:center;grid-auto-flow:column}.step__heading{font-weight:500;font-size:1.25rem;margin:0}.step__heading>span{font-size:0.875rem;color:#6b7280}.step__travel-mode{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__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{display:grid;justify-content:center}.step__toggle mi-icon{width:24px;height:24px;display:block}.step__details{display:grid;gap:24px;width:100%}', d = class {
14
+ constructor(t) {
15
+ o(this, t), this.stepClicked = a(this, "stepClicked", 7), this.substepsToggled = a(this, "substepsToggled", 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.destinationLocation = void 0, this.unit = navigator.language === "en-US" ? n.Imperial : n.Metric, this.showToggleButton = !0, 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
+ /**
24
+ * Programmatically open the substeps.
25
+ */
26
+ openSubsteps() {
27
+ this.substepsAreOpen = !0;
28
+ }
29
+ /**
30
+ * Programmatically close the substeps.
31
+ */
32
+ closeSubsteps() {
33
+ this.substepsAreOpen = !1;
34
+ }
35
+ componentWillLoad() {
36
+ this.parseStepProp(), this.parseTranslationsProp();
37
+ }
38
+ /**
39
+ * Render if there is step data.
40
+ */
41
+ render() {
42
+ return this.stepData && this.translationsData ? this.renderStep() : null;
43
+ }
44
+ /**
45
+ * Emits stepClicked event (if click target is not related to an action)
46
+ * @param event Event
47
+ */
48
+ stepClickHandler(t) {
49
+ if (Array.from(t.target.classList).includes("icon-toggle"))
50
+ return;
51
+ let s = null;
52
+ t.target.dataset.maneuverIndex !== void 0 && (s = parseInt(t.target.dataset.maneuverIndex)), this.stepClicked.emit({ maneuverIndex: s });
53
+ }
54
+ /**
55
+ * Render step part depending on travel mode.
56
+ *
57
+ * @returns {JSX.Element}
58
+ */
59
+ renderStep() {
60
+ switch (this.stepData.travel_mode.toUpperCase()) {
61
+ case "DRIVING":
62
+ return this.renderDrivingStep();
63
+ case "WALKING":
64
+ return this.renderWalkingStep();
65
+ case "BICYCLING":
66
+ return this.renderBicyclingStep();
67
+ case "TRANSIT":
68
+ return this.renderTransitStep();
69
+ case "DESTINATION":
70
+ return this.renderDestinationStep();
71
+ default:
72
+ return e("div", null, "Unknown travel mode: ", this.stepData.travel_mode);
73
+ }
74
+ }
75
+ /**
76
+ * Render the travel mode indicator and dotted/solid line.
77
+ *
78
+ * @returns {JSX.Element}
79
+ */
80
+ renderTravelMode() {
81
+ if (this.isInternetExplorer)
82
+ return null;
83
+ let t;
84
+ switch (this.stepData.travel_mode.toUpperCase()) {
85
+ case "DRIVING":
86
+ t = "car";
87
+ break;
88
+ case "WALKING":
89
+ t = "walk";
90
+ break;
91
+ case "BICYCLING":
92
+ t = "bike";
93
+ break;
94
+ case "TRANSIT":
95
+ t = this.getTransitVehicleIconName();
96
+ break;
97
+ case "DESTINATION":
98
+ t = "logo";
99
+ break;
100
+ }
101
+ return e("span", { part: "step-travel-mode", class: `step__travel-mode step__travel-mode--${this.stepData.travel_mode.toUpperCase() === "TRANSIT" ? "solid" : "dotted"}` }, e("span", { class: "step__travel-mode-icon" }, e("mi-icon", { part: "step-travel-mode-icon", "icon-name": t })));
102
+ }
103
+ /**
104
+ * Get icon name for transit vehicle.
105
+ *
106
+ * @returns {string}
107
+ */
108
+ getTransitVehicleIconName() {
109
+ var t, s;
110
+ const i = (s = (t = this.stepData.transit_information) === null || t === void 0 ? void 0 : t.line.vehicle) === null || s === void 0 ? void 0 : s.type.toLowerCase();
111
+ return i && ["boat", "bus", "railway", "train", "subway"].some((r) => r === i) ? i : "transit";
112
+ }
113
+ /**
114
+ * Toggles visibility of sub steps (steps in steps)
115
+ */
116
+ toggleSubsteps() {
117
+ this.substepsToggled.emit(), this.substepsAreOpen = !this.substepsAreOpen;
118
+ }
119
+ /**
120
+ * Render substeps if they should be visible.
121
+ *
122
+ * @returns {JSX.Element}
123
+ */
124
+ renderSubsteps() {
125
+ var t;
126
+ return this.substepsAreOpen === !0 ? e("div", { class: "step__substeps" }, (t = this.stepData.steps) === null || t === void 0 ? void 0 : t.map((s, i) => e("mi-route-instructions-maneuver", {
127
+ "data-maneuver-index": i,
128
+ maneuver: JSON.stringify(s),
129
+ translations: this.translations,
130
+ unit: this.unit,
131
+ // @ts-ignore
132
+ exportparts: `
133
+ maneuver-icon,
134
+ maneuver-description,
135
+ maneuver-description-distance,
136
+ maneuver-description-distance-border`
137
+ }))) : null;
138
+ }
139
+ /**
140
+ * Render the toggle button for the sub step expander.
141
+ *
142
+ * @returns {JSX.Element}
143
+ */
144
+ renderToggleButton() {
145
+ var t;
146
+ return ((t = this.stepData.steps) === null || t === void 0 ? void 0 : t.length) <= 0 || !this.showToggleButton ? null : e("span", { class: "step__toggle", onClick: () => this.toggleSubsteps() }, this.substepsAreOpen ? e("mi-icon", { part: "step-toggle", "icon-name": "chevron-down" }) : e("mi-icon", { part: "step-toggle", "icon-name": "chevron-up" }));
147
+ }
148
+ /**
149
+ * Render distance part.
150
+ *
151
+ * @returns {JSX.Element}
152
+ */
153
+ renderDistance() {
154
+ return e("span", { part: "step-info", class: "step__distance-duration" }, e("mi-distance", { meters: this.stepData.distance.value, unit: this.unit }), e("br", null));
155
+ }
156
+ /**
157
+ * Render toggle and substeps.
158
+ *
159
+ * @returns {JSX.Element}
160
+ */
161
+ showSubsteps() {
162
+ return e("div", { class: "step__details" }, this.renderSubsteps());
163
+ }
164
+ /**
165
+ * Render a driving step.
166
+ *
167
+ * @returns {JSX.Element}
168
+ */
169
+ renderDrivingStep() {
170
+ return e("div", { class: "step", onClick: (t) => this.stepClickHandler(t) }, e("div", { class: "step__info" }, e("div", { part: "step-heading", class: "step__heading" }, this.getStepHeading()), this.renderToggleButton()), this.showSubsteps());
171
+ }
172
+ /**
173
+ * Get display heading.
174
+ *
175
+ * @returns {string}
176
+ */
177
+ getStepHeading() {
178
+ var t;
179
+ const s = {
180
+ driving: this.translationsData.drive,
181
+ walking: this.translationsData.walk,
182
+ bicycling: this.translationsData.bike
183
+ };
184
+ return !((t = this.stepData.steps[0]) === null || t === void 0) && t.instructions ? this.stepData.steps[0].instructions : s[this.stepData.travel_mode.toLowerCase()];
185
+ }
186
+ /**
187
+ * Render a walking step.
188
+ *
189
+ *
190
+ * @returns {JSX.Element}
191
+ */
192
+ renderWalkingStep() {
193
+ let t;
194
+ return this.stepData.parking === !0 ? t = `${this.translationsData.park} ${this.stepData.label ? ` ${this.translationsData.at} ` + this.stepData.label : ""}` : this.stepData.highway && this.stepData.highway.toUpperCase() === "STEPS" ? t = `${this.translationsData.takeStaircaseToLevel} ${this.stepData.end_location.floor_name}` : this.stepData.highway && this.stepData.highway.toUpperCase() === "LADDER" ? t = `${this.translationsData.takeLadderToLevel} ${this.stepData.end_location.floor_name}` : this.stepData.highway && this.stepData.highway.toUpperCase() === "ESCALATOR" ? t = `${this.translationsData.takeEscalatorToLevel} ${this.stepData.end_location.floor_name}` : this.stepData.highway && this.stepData.highway.toUpperCase() === "WHEELCHAIRRAMP" ? t = `${this.translationsData.takeWheelchairRampToLevel} ${this.stepData.end_location.floor_name}` : this.stepData.highway && this.stepData.highway.toUpperCase() === "WHEELCHAIRLIFT" ? t = `${this.translationsData.takeWheelchairLiftToLevel} ${this.stepData.end_location.floor_name}` : this.stepData.highway && this.stepData.highway.toUpperCase() === "ELEVATOR" ? t = `${this.translationsData.takeElevatorToLevel} ${this.stepData.end_location.floor_name}` : this.fromRouteContext === "InsideBuilding" && this.stepData.route_context === "Outside" ? t = this.addStepContextNameToHeading(this.translationsData.exit, this.stepData.start_context) : this.fromRouteContext === "InsideBuilding" && this.stepData.route_context === "InsideBuilding" ? t = this.getStepHeading() : this.fromRouteContext === "Outside" && this.stepData.route_context === "Outside" && this.fromTravelMode.toUpperCase() === "TRANSIT" ? t = this.fromTransitStop : this.fromRouteContext === "Outside" && this.stepData.route_context === "Outside" ? t = this.getStepHeading() : this.fromRouteContext === "Outside" && this.stepData.route_context === "InsideBuilding" ? t = this.addStepContextNameToHeading(this.translationsData.enter, this.stepData.end_context) : t = this.fromRouteContext, e("div", { class: "step", onClick: (s) => this.stepClickHandler(s) }, e("div", { class: "step__info" }, e("div", { part: "step-heading", class: "step__heading" }, t), this.renderToggleButton()), this.showSubsteps());
195
+ }
196
+ /**
197
+ * Add building or venue name to the step heading
198
+ * @param {string} heading
199
+ * @param {StepContext} stepContext
200
+ * @returns
201
+ */
202
+ addStepContextNameToHeading(t, s) {
203
+ return s && (s.building ? t += ` ${s.building.buildingInfo.name} ${this.translationsData.building}` : s.venue && (t += ` ${s.venue.venueInfo.name} ${this.translationsData.venue}`)), t;
204
+ }
205
+ /**
206
+ * Render a bicycling step.
207
+ *
208
+ * @returns {JSX.Element}
209
+ */
210
+ renderBicyclingStep() {
211
+ return e("div", { class: "step", onClick: (t) => this.stepClickHandler(t) }, e("div", { class: "step__info" }, e("div", { part: "step-heading", class: "step__heading" }, this.getStepHeading()), this.renderToggleButton()), this.showSubsteps());
212
+ }
213
+ /**
214
+ * Render the destination step.
215
+ *
216
+ * @returns {JSX.Element}
217
+ */
218
+ renderDestinationStep() {
219
+ return e("div", { class: "step", onClick: (t) => this.stepClickHandler(t) }, e("div", { class: "step__info" }, e("div", { part: "step-heading", class: "step__heading" }, this.translationsData.destination), this.renderToggleButton()), this.showSubsteps());
220
+ }
221
+ /**
222
+ * Render a transit step.
223
+ *
224
+ * @returns {JSX.Element}
225
+ */
226
+ renderTransitStep() {
227
+ var t, s;
228
+ return e("div", { class: "step", onClick: (i) => this.stepClickHandler(i) }, e("div", { class: "step__info" }, e("h3", { part: "step-heading", class: "step__heading" }, this.stepData.instructions), this.renderToggleButton()), this.renderTravelMode(), e("div", { part: "step-description", class: "step__description" }, this.stepData.transit_information.line.short_name ? e("span", { class: "step__short-name", style: {
229
+ backgroundColor: !((t = this.stepData.transit_information.line) === null || t === void 0) && t.color ? this.stepData.transit_information.line.color : null,
230
+ color: !((s = this.stepData.transit_information.line) === null || s === void 0) && s.text_color ? this.stepData.transit_information.line.text_color : null
231
+ } }, this.stepData.transit_information.line.short_name) : null, this.stepData.transit_information.headsign ? this.stepData.transit_information.headsign : null, e("br", null), e("span", { part: "step-info", class: "step__distance-duration" }, e("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.showSubsteps());
232
+ }
233
+ static get watchers() {
234
+ return {
235
+ step: ["parseStepProp"],
236
+ translations: ["parseTranslationsProp"]
237
+ };
238
+ }
239
+ };
240
+ d.style = p;
241
+ export {
242
+ d as mi_route_instructions_step
243
+ };
244
+ //# sourceMappingURL=mi-route-instructions-step.entry-35ae490e.mjs.map
@@ -0,0 +1,150 @@
1
+ import { r as h, c as g, h as s, H as f } from "./reactcomponent-fed5da4c.mjs";
2
+ import { R as v } from "./route-travel-mode.enum-7f4ce9c7-0da65b8e.mjs";
3
+ import { U as m } from "./unit-system.enum-eaefb53e-5d1cf129.mjs";
4
+ import { c as S } from "./utils-ae714467-4f4e3a56.mjs";
5
+ import "react";
6
+ import "react-dom";
7
+ (function() {
8
+ try {
9
+ var t = typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, i = new t.Error().stack;
10
+ i && (t._sentryDebugIds = t._sentryDebugIds || {}, t._sentryDebugIds[i] = "fa5ad370-6ea7-4164-a1f8-2506feab6642", t._sentryDebugIdIdentifier = "sentry-dbid-fa5ad370-6ea7-4164-a1f8-2506feab6642");
11
+ } catch {
12
+ }
13
+ })();
14
+ const x = ':host{display:block;background-color:#fcfcfc;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"}:host mi-route-instructions-step:hover{cursor:pointer;background-color:#f9fafb;transition:300ms ease}:host mi-route-instructions-step.active{background-color:#f3f4f6;transition:none;cursor:default}:host .instructions-destination{display:flex}:host .instructions-destination-icon{width:40px;display:flex;justify-content:center;align-items:center}:host .instructions-destination-icon mi-icon{width:24px;height:24px;background-color:#1c1917}:host .instructions-destination-details{flex:1;padding:12px}:host .instructions-destination-details mi-location-info{font-size:0.875rem}', I = class {
15
+ constructor(t) {
16
+ h(this, t), this.clicked = g(this, "clicked", 7), this.miStepElements = [], this.lastStepRouteContext = null, this.lastStepTravelMode = null, this.lastStepTransitStop = null, this.activeStep = {
17
+ legIndex: 0,
18
+ stepIndex: 0
19
+ }, this.unit = m.Metric, this.route = void 0, this.hideIndoorSubsteps = !1, this.travelMode = v.Walking, this.originLocation = void 0, this.originName = void 0, this.destinationLocation = void 0, this.destinationName = void 0, this.translations = {
20
+ walk: "Walk",
21
+ bike: "Bike",
22
+ transit: "Transit",
23
+ drive: "Drive",
24
+ destination: "You have arrived",
25
+ leave: "Leave",
26
+ from: "From",
27
+ park: "Park",
28
+ at: "at",
29
+ building: "Building",
30
+ venue: "Venue",
31
+ takeStaircaseToLevel: "Take staircase to level",
32
+ takeLadderToLevel: "Take the ladder to level",
33
+ takeElevatorToLevel: "Take elevator to level",
34
+ takeEscalatorToLevel: "Take escalator to level",
35
+ takeWheelchairLiftToLevel: "Take wheelchair lift to level",
36
+ takeWheelchairRampToLevel: "Take wheelchair ramp to level",
37
+ exit: "Exit",
38
+ enter: "Enter",
39
+ stops: "stops",
40
+ andContinue: "and continue",
41
+ continueStraightAhead: "Continue straight ahead",
42
+ goLeft: "Go left",
43
+ goSharpLeft: "Go sharp left",
44
+ goSlightLeft: "Go slight left",
45
+ goRight: "Go right",
46
+ goSharpRight: "Go sharp right",
47
+ goSlightRight: "Go slight right",
48
+ turnAround: "Turn around",
49
+ days: "d",
50
+ hours: "h",
51
+ minutes: "min"
52
+ };
53
+ }
54
+ componentDidRender() {
55
+ this.miStepElements.forEach((t) => {
56
+ t.hideIndoorSubsteps = this.hideIndoorSubsteps;
57
+ });
58
+ }
59
+ /**
60
+ * Transform the step in legs to a flat array of steps.
61
+ *
62
+ * @returns {Step[]}
63
+ */
64
+ getRouteSteps() {
65
+ return this.route ? this.route.legs.reduce((t, i, e) => {
66
+ for (const o in i.steps) {
67
+ const n = i.steps[o];
68
+ n.originalLegIndex = e, n.originalStepIndex = parseInt(o), t.push(n);
69
+ }
70
+ return t;
71
+ }, []) : [];
72
+ }
73
+ /**
74
+ * Updates the activeStep attribute and emits an object with leg, step and maneuver index information.
75
+ *
76
+ * @param {CustomEvent<any>} event Step object.
77
+ * @param {number} stepIndex step index.
78
+ */
79
+ stepClickedHandler(t, i) {
80
+ const e = this.getRouteSteps()[i];
81
+ this.activeStep = {
82
+ legIndex: e.originalLegIndex,
83
+ stepIndex: e.originalStepIndex
84
+ }, this.clicked.emit({
85
+ legIndex: e.originalLegIndex,
86
+ stepIndex: e.originalStepIndex,
87
+ maneuverIndex: t.detail.maneuverIndex
88
+ });
89
+ }
90
+ /**
91
+ * Check if the step is active.
92
+ *
93
+ * @param {Step} step
94
+ * @returns {boolean}
95
+ */
96
+ isActiveStep(t) {
97
+ return this.activeStep ? this.activeStep.legIndex === t.originalLegIndex && this.activeStep.stepIndex === t.originalStepIndex : !1;
98
+ }
99
+ render() {
100
+ return this.route ? this.renderInstructions() : null;
101
+ }
102
+ /**
103
+ * Render instructions.
104
+ *
105
+ * @returns {JSX.Element}
106
+ */
107
+ renderInstructions() {
108
+ return s(f, null, this.getRouteSteps().map((t, i) => {
109
+ var e, o, n, a, r;
110
+ const d = !((o = (e = this.originLocation) === null || e === void 0 ? void 0 : e.properties) === null || o === void 0) && o.name ? this.originLocation.properties.name : this.originName || "", c = t.originalLegIndex === 0 && t.originalStepIndex === 0 ? d : this.lastStepRouteContext, p = this.lastStepTravelMode, u = this.lastStepTransitStop;
111
+ return this.lastStepRouteContext = t.route_context, this.lastStepTravelMode = t.travel_mode, this.lastStepTransitStop = !((a = (n = t.transit_information) === null || n === void 0 ? void 0 : n.arrival_stop) === null || a === void 0) && a.name ? (r = t.transit_information) === null || r === void 0 ? void 0 : r.arrival_stop.name : null, s("mi-route-instructions-step-legacy", {
112
+ ref: (l) => this.miStepElements.push(l),
113
+ "from-travel-mode": p,
114
+ "from-route-context": c,
115
+ "from-transit-stop": u,
116
+ step: JSON.stringify(t),
117
+ translations: JSON.stringify(this.translations),
118
+ unit: this.unit,
119
+ onStepClicked: (l) => this.stepClickedHandler(l, i),
120
+ class: this.isActiveStep(t) ? "active" : "",
121
+ part: this.isActiveStep(t) ? "step active" : "step",
122
+ // @ts-ignore
123
+ exportparts: `
124
+ step-toggle,
125
+ step-heading,
126
+ step-description,
127
+ step-info,
128
+ step-travel-mode,
129
+ step-travel-mode-icon,
130
+ maneuver-icon,
131
+ maneuver-description,
132
+ maneuver-description-distance,
133
+ maneuver-description-distance-border`
134
+ });
135
+ }), this.destinationLocation || this.destinationName ? this.renderDestination() : null);
136
+ }
137
+ /**
138
+ * Render destination.
139
+ *
140
+ * @returns {JSX.Element}
141
+ */
142
+ renderDestination() {
143
+ return s("div", { class: "instructions-destination" }, s("div", { class: "instructions-destination-icon" }, S() ? null : s("mi-icon", { "icon-name": "marker" })), s("div", { part: "instructions-destination", class: "instructions-destination-details" }, this.destinationLocation ? this.destinationLocation.properties.name : this.destinationName, this.destinationLocation ? s("mi-location-info", { part: "instructions-destination-info", location: this.destinationLocation }) : null));
144
+ }
145
+ };
146
+ I.style = x;
147
+ export {
148
+ I as mi_route_instructions
149
+ };
150
+ //# sourceMappingURL=mi-route-instructions.entry-fc97f09d.mjs.map
@@ -0,0 +1,86 @@
1
+ import { r as n, h as o } 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] = "e9f40179-d4e4-4f4e-a7aa-f66b04a987ac", t._sentryDebugIdIdentifier = "sentry-dbid-e9f40179-d4e4-4f4e-a7aa-f66b04a987ac");
8
+ } catch {
9
+ }
10
+ })();
11
+ const i = 'a.mi-button{cursor:default}.mi-button{border-radius:4px;border-width:1px;border-style:solid;font-family:Inter, -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";font-size:1rem;font-weight:500;padding-left:16px;padding-right:16px;padding-top:12px;padding-bottom:12px;display:inline-flex;align-items:center}.mi-button:disabled{opacity:0.48;cursor:not-allowed}.mi-button object{filter:invert(9%) sepia(13%) saturate(692%) hue-rotate(185deg) brightness(98%) contrast(91%);width:16px;height:16px}.mi-button--small{padding-left:12px;padding-right:12px;padding-top:8px;padding-bottom:8px;font-size:0.875rem;height:32px}.mi-button--small object{width:16px;height:16px}.mi-button--large{padding-left:16px;padding-right:16px;font-size:1.25rem}.mi-button--large object{width:20px;height:20px}.mi-button--full-width{width:100%;justify-content:center}.mi-button--icon-left{padding-left:12px}.mi-button--icon-left object{margin-right:8px}.mi-button--icon-right{padding-right:12px}.mi-button--icon-right object{margin-left:8px}.mi-button--icon-both{padding-top:12px;padding-bottom:12px}.mi-button--icon-both object:first-of-type{margin-right:8px}.mi-button--icon-both object:last-of-type{margin-left:8px}.mi-button--base{background:linear-gradient(#f5f7fa, #ebeff5);color:#1e2025;border-color:#c8d0e0}.mi-button--base:not(:disabled):hover{background:linear-gradient(#ebeff5, #dee3ed);border-color:#aeb9cb}.mi-button--base:not(:disabled):active{background:linear-gradient(#dee3ed, #ebeff5)}.mi-button--primary{color:#ffffff;border-color:#20693e;background:linear-gradient(#3ba064, #2a844e)}.mi-button--primary object{filter:invert(100%) sepia(93%) saturate(0%) hue-rotate(201deg) brightness(106%) contrast(106%)}.mi-button--primary:not(:disabled):hover{background:linear-gradient(#2a844e, #20693e)}.mi-button--primary:not(:disabled):active{background:linear-gradient(#20693e, #2a844e)}.mi-button--delete{background:linear-gradient(#f55151, #de1b1b);color:#ffffff;border-color:#ba0d0d}.mi-button--delete object{filter:invert(100%) sepia(93%) saturate(0%) hue-rotate(201deg) brightness(106%) contrast(106%)}.mi-button--delete:not(:disabled):hover{background:linear-gradient(#de1b1b, #ba0d0d)}.mi-button--delete:not(:disabled):active{background:linear-gradient(#ba0d0d, #de1b1b)}.mi-button--outline{color:#3071d9;border-color:#3071d9;background-color:transparent}.mi-button--outline object{filter:invert(38%) sepia(97%) saturate(742%) hue-rotate(188deg) brightness(86%) contrast(97%)}.mi-button--outline:not(:disabled):hover{color:#1d5bbf;border-color:#1d5bbf;background-color:#eef4fc}.mi-button--outline:not(:disabled):active{color:#1d5bbf;border-color:#1d5bbf;background-color:#cfe0fc}.mi-button--link{color:#3071d9;border-style:none;background-color:transparent;cursor:pointer}.mi-button--link object{filter:invert(38%) sepia(97%) saturate(742%) hue-rotate(188deg) brightness(86%) contrast(97%)}.mi-button--link:not(:disabled):hover{color:#1d5bbf;border-color:#1d5bbf;background-color:#eef4fc}.mi-button--link:disabled:hover{cursor:not-allowed}.mi-button--link:not(:disabled):active{color:#1d5bbf;border-color:#1d5bbf;background-color:#cfe0fc}html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}.scroll-buttons{height:100%;width:64px;display:flex;flex-direction:column;align-items:center;justify-content:center;row-gap:16px}.scroll-buttons .btn{margin:0;padding:0;background:none;width:64px;height:64px;background-color:#ffffff;border:none;border-radius:8px;display:flex;align-items:center;justify-content:center}.scroll-buttons .btn mi-icon{width:32px}.scroll-buttons .btn:hover{background:none;background-color:#ffffff;cursor:pointer}.scroll-buttons .btn:disabled{opacity:1}.scroll-buttons .btn:disabled mi-icon{background-color:#a5a9af}', r = class {
12
+ constructor(t) {
13
+ n(this, t), this.scrollContainerElementRef = void 0, this.scrollLength = 100;
14
+ }
15
+ /**
16
+ * Update scroll buttons enabled/disabled states.
17
+ */
18
+ async updateScrollButtons() {
19
+ this.updateScrollButtonsState();
20
+ }
21
+ /**
22
+ * Watch for container scroll events.
23
+ */
24
+ addScrollEventListener() {
25
+ var t, e;
26
+ (t = this.resizeObserver) === null || t === void 0 || t.disconnect(), (e = this.scrollContainerElementRef) === null || e === void 0 || e.addEventListener("scroll", () => {
27
+ this.updateScrollButtonsState();
28
+ }), this.scrollContainerElementRef && (this.resizeObserver = new ResizeObserver(() => {
29
+ this.updateScrollButtonsState();
30
+ }), this.resizeObserver.observe(this.scrollContainerElementRef));
31
+ }
32
+ /**
33
+ * Adds scroll event listener to the container element when this component is first attached to the DOM.
34
+ */
35
+ connectedCallback() {
36
+ this.addScrollEventListener();
37
+ }
38
+ /**
39
+ * Disconnects ResizeObserver.
40
+ */
41
+ disconnectedCallback() {
42
+ var t;
43
+ (t = this.resizeObserver) === null || t === void 0 || t.disconnect();
44
+ }
45
+ /**
46
+ * Updates enable/disable state for scroll up and down buttons.
47
+ *
48
+ * @returns {Promise<void>}
49
+ */
50
+ async updateScrollButtonsState() {
51
+ this.scrollContainerElementRef.scrollTop === 0 ? this.upButtonElement.disabled = !0 : this.upButtonElement.disabled && (this.upButtonElement.disabled = !1), this.scrollContainerElementRef.scrollHeight - this.scrollContainerElementRef.scrollTop === this.scrollContainerElementRef.clientHeight && this.upButtonElement.disabled === !0 ? this.downButtonElement.disabled = !0 : this.scrollContainerElementRef.scrollHeight - this.scrollContainerElementRef.scrollTop > this.scrollContainerElementRef.clientHeight ? this.downButtonElement.disabled = !1 : this.downButtonElement.disabled = !0;
52
+ }
53
+ /**
54
+ * Update scroll position.
55
+ *
56
+ * @param {number} value - Value to scroll.
57
+ */
58
+ updateScrollPosition(t) {
59
+ "scrollBehavior" in document.documentElement.style ? this.scrollContainerElementRef.scroll({
60
+ top: this.scrollContainerElementRef.scrollTop + t,
61
+ behavior: "smooth"
62
+ }) : this.scrollContainerElementRef.scrollTop = t;
63
+ }
64
+ /**
65
+ * Render scoll buttons.
66
+ *
67
+ * @returns {JSX.Element}
68
+ */
69
+ render() {
70
+ return o("div", { part: "container", class: "scroll-buttons" }, o("button", { part: "button button-up", class: "mi-button mi-button--base btn btn-up", type: "button", disabled: !0, "aria-label": "Scroll Up", ref: (t) => {
71
+ this.upButtonElement = t;
72
+ }, onClick: () => this.updateScrollPosition(-this.scrollLength) }, o("mi-icon", { "icon-name": "chevron-up" })), o("button", { part: "button button-down", class: "mi-button mi-button--base btn btn-down", type: "button", "aria-label": "Scroll Down", ref: (t) => {
73
+ this.downButtonElement = t;
74
+ }, onClick: () => this.updateScrollPosition(this.scrollLength) }, o("mi-icon", { "icon-name": "chevron-down" })));
75
+ }
76
+ static get watchers() {
77
+ return {
78
+ scrollContainerElementRef: ["addScrollEventListener"]
79
+ };
80
+ }
81
+ };
82
+ r.style = i;
83
+ export {
84
+ r as mi_scroll_buttons
85
+ };
86
+ //# sourceMappingURL=mi-scroll-buttons.entry-9e523ef6.mjs.map