@sbb-esta/lyne-elements-experimental 4.0.1 → 4.0.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 (56) hide show
  1. package/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.d.ts.map +1 -1
  2. package/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.js +15 -16
  3. package/core/datetime/date-helper.js +3 -3
  4. package/custom-elements.json +241 -53
  5. package/development/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.d.ts.map +1 -1
  6. package/development/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.js +17 -19
  7. package/development/core/datetime/date-helper.js +3 -3
  8. package/development/{differenceInMinutes-D5Nj8Stc.js → differenceInMinutes-B0dawX-5.js} +2 -2
  9. package/development/{format-BQfaa1ZT.js → format-BMkeaqaF.js} +3 -3
  10. package/development/{isValid-DvieCZVi.js → isValid-BYRch7pV.js} +2 -2
  11. package/development/journey-summary/journey-summary.component.js +2 -2
  12. package/development/pearl-chain/pearl-chain.component.js +3 -5
  13. package/development/pearl-chain-time/pearl-chain-time.component.js +1 -1
  14. package/development/seat-reservation/common/mapper/mapper.d.ts +2 -2
  15. package/development/seat-reservation/common/mapper/mapper.d.ts.map +1 -1
  16. package/development/seat-reservation/common/mapper/mapper.js +19 -6
  17. package/development/seat-reservation/common/mapper/seat-reservation-sample-data.d.ts +122 -0
  18. package/development/seat-reservation/common/mapper/seat-reservation-sample-data.d.ts.map +1 -1
  19. package/development/seat-reservation/common/mapper/seat-reservation-sample-data.js +970 -1
  20. package/development/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts +11 -5
  21. package/development/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts.map +1 -1
  22. package/development/seat-reservation/seat-reservation/seat-reservation-base-element.js +118 -56
  23. package/development/seat-reservation/seat-reservation/seat-reservation.component.d.ts.map +1 -1
  24. package/development/seat-reservation/seat-reservation/seat-reservation.component.js +170 -282
  25. package/development/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.d.ts.map +1 -1
  26. package/development/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +11 -8
  27. package/development/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.d.ts.map +1 -1
  28. package/development/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +153 -45
  29. package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +2 -2
  30. package/development/timetable-row/timetable-row.component.js +1 -1
  31. package/development/{toDate-D_Vjps95.js → toDate-BWb6Z1JD.js} +2 -2
  32. package/{differenceInMinutes-CP_C5onR.js → differenceInMinutes-COvvdYsJ.js} +1 -1
  33. package/{format-lqeCzmzS.js → format-CmKROkbc.js} +2 -41
  34. package/{isValid-Ceq2O0NQ.js → isValid-m3_OsPaB.js} +1 -1
  35. package/journey-summary/journey-summary.component.js +2 -2
  36. package/package.json +2 -2
  37. package/pearl-chain/pearl-chain.component.js +3 -3
  38. package/pearl-chain-time/pearl-chain-time.component.js +1 -1
  39. package/seat-reservation/common/mapper/mapper.d.ts +2 -2
  40. package/seat-reservation/common/mapper/mapper.d.ts.map +1 -1
  41. package/seat-reservation/common/mapper/mapper.js +41 -38
  42. package/seat-reservation/common/mapper/seat-reservation-sample-data.d.ts +122 -0
  43. package/seat-reservation/common/mapper/seat-reservation-sample-data.d.ts.map +1 -1
  44. package/seat-reservation/common/mapper/seat-reservation-sample-data.js +968 -1
  45. package/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts +11 -5
  46. package/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts.map +1 -1
  47. package/seat-reservation/seat-reservation/seat-reservation-base-element.js +99 -73
  48. package/seat-reservation/seat-reservation/seat-reservation.component.d.ts.map +1 -1
  49. package/seat-reservation/seat-reservation/seat-reservation.component.js +210 -213
  50. package/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.d.ts.map +1 -1
  51. package/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +31 -28
  52. package/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.d.ts.map +1 -1
  53. package/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +143 -142
  54. package/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +1 -1
  55. package/timetable-row/timetable-row.component.js +1 -1
  56. package/{toDate-BCXKL_wM.js → toDate-Bw2KTWeq.js} +1 -1
@@ -1,12 +1,13 @@
1
- import { __esDecorate as $, __runInitializers as y } from "tslib";
1
+ import { __esDecorate as k, __runInitializers as y } from "tslib";
2
2
  import { SbbLanguageController as A } from "@sbb-esta/lyne-elements/core/controllers.js";
3
3
  import { boxSizingStyles as R } from "@sbb-esta/lyne-elements/core/styles.js";
4
- import { css as S, html as n, nothing as u } from "lit";
4
+ import { css as S, html as n, nothing as _ } from "lit";
5
5
  import { customElement as E } from "lit/decorators.js";
6
- import { classMap as x } from "lit/directives/class-map.js";
6
+ import { classMap as $ } from "lit/directives/class-map.js";
7
+ import { repeat as N } from "lit/directives/repeat.js";
7
8
  import { styleMap as v } from "lit/directives/style-map.js";
8
- import { getI18nSeatReservation as l } from "../common.js";
9
- import { SeatReservationBaseElement as T } from "./seat-reservation-base-element.js";
9
+ import { getI18nSeatReservation as c } from "../common.js";
10
+ import { SeatReservationBaseElement as P } from "./seat-reservation-base-element.js";
10
11
  import "@sbb-esta/lyne-elements/button.js";
11
12
  import "@sbb-esta/lyne-elements/screen-reader-only.js";
12
13
  import "@sbb-esta/lyne-elements/popover.js";
@@ -15,11 +16,11 @@ import "../seat-reservation-graphic.js";
15
16
  import "../seat-reservation-place-control.js";
16
17
  import "../seat-reservation-navigation-coach.js";
17
18
  import "../seat-reservation-scoped.js";
18
- const N = S`:host{--sbb-seat-reservation-grid-size: 16px;--sbb-seat-reservation-height: 0;--sbb-seat-reservation-decks: 1;display:block;height:inherit}:host ::part(coach-floor){fill:var(--sbb-background-color-2)}@media(forced-colors:active){:host ::part(coach-floor){fill:transparent}}:host(:dir(rtl)) :not(.sbb-sr-place-ctrl--type-bicycle,.sbb-sr-place-ctrl--orientation-90,.sbb-sr-place-ctrl--orientation-270,.sbb-sr-place-ctrl--state-selected) ::part(coach-floor){rotate:180deg}[popover]:where(sbb-popover){margin:0;padding:0;border:none;width:auto;height:auto;background-color:transparent;color:inherit;pointer-events:none}.sbb-sr__container{display:flex;height:inherit}.sbb-sr__grid{display:grid;grid-template-columns:20% 1fr 20%;grid-template-rows:auto auto}.sbb-sr__grid .sbb-sr-navigation-first-grid,.sbb-sr__grid .sbb-sr-navigation-last-grid{grid-row-start:1;position:relative;margin-block-start:calc(4 * var(--sbb-seat-reservation-one-px-rem, .0625rem))}.sbb-sr__grid .sbb-sr-navigation-first-grid{grid-column:1/2}.sbb-sr__grid .sbb-sr-navigation-last-grid{grid-column:3/4}.sbb-sr__grid .sbb-sr__component{display:flex;grid-column:1/4;grid-row:1/3}.sbb-sr__grid .sbb-sr-grid-inner{display:grid;grid-template-columns:20% 60% 20%;grid-template-rows:auto 1fr;gap:0}.sbb-sr__grid .sbb-sr-grid-inner .nav-grid{grid-column:2/3;grid-row:1/2;display:inherit}.sbb-sr__grid .sbb-sr-grid-inner .coaches-grid{grid-column:1/4;grid-row:2/3;display:inherit}.sbb-sr__navigation-control-button{position:absolute;z-index:10}.sbb-sr__navigation-control-button#first-tab-element{inset-inline-end:calc(8 * var(--sbb-seat-reservation-one-px-rem, .0625rem))}.sbb-sr__navigation-control-button#last-tab-element{inset-inline-start:calc(8 * var(--sbb-seat-reservation-one-px-rem, .0625rem))}.sbb-sr-navigation-wrapper{overflow:hidden;padding-block:0 calc(32 * var(--sbb-seat-reservation-one-px-rem, .0625rem))}.sbb-sr-navigation{--sbb-scrollbar-thumb-width: .125rem;--sbb-scrollbar-thumb-width-hover: .25rem;--sbb-scrollbar-width-firefox: thin;--sbb-scrollbar-color: color-mix(in srgb, var(--sbb-color-black) 30%, transparent);--sbb-scrollbar-color: light-dark( color-mix(in srgb, var(--sbb-color-black) 30%, transparent), color-mix(in srgb, var(--sbb-color-white) 30%, transparent) );--sbb-scrollbar-color-hover: color-mix(in srgb, var(--sbb-color-black) 60%, transparent);--sbb-scrollbar-color-hover: light-dark( color-mix(in srgb, var(--sbb-color-black) 60%, transparent), color-mix(in srgb, var(--sbb-color-white) 60%, transparent) );--sbb-scrollbar-track-color: transparent;--sbb-scrollbar-width: var(--sbb-spacing-fixed-3x)}.sbb-sr-navigation::-webkit-scrollbar{width:var(--sbb-scrollbar-width);height:var(--sbb-scrollbar-width);background-color:var(--sbb-scrollbar-track-color, transparent)}.sbb-sr-navigation::-webkit-scrollbar-corner{background-color:var(--sbb-scrollbar-track-color, transparent)}.sbb-sr-navigation::-webkit-scrollbar-thumb{background-color:var(--sbb-scrollbar-color, currentcolor);border:calc(.5 * (var(--sbb-scrollbar-width) - var(--sbb-scrollbar-thumb-width))) solid transparent;border-radius:var(--sbb-border-radius-4x);background-clip:padding-box}.sbb-sr-navigation::-webkit-scrollbar-thumb:hover{background-color:var(--sbb-scrollbar-color-hover, currentcolor);border-width:calc(.5 * (var(--sbb-scrollbar-width) - var(--sbb-scrollbar-thumb-width-hover)))}.sbb-sr-navigation::-webkit-scrollbar-button,.sbb-sr-navigation::-webkit-scrollbar-corner{display:none}@supports not selector(::-webkit-scrollbar){.sbb-sr-navigation{scrollbar-width:var(--sbb-scrollbar-width-firefox);scrollbar-color:var(--sbb-scrollbar-color, currentcolor) var(--sbb-scrollbar-track-color, transparent)}}.sbb-sr-navigation{padding-block-start:calc(4 * var(--sbb-seat-reservation-one-px-rem, .0625rem))}.sbb-sr-navigation{--sbb-scrollbar-color: transparent;display:flex;overflow:scroll hidden;position:relative}.sbb-sr-navigation__list-coaches{list-style:none;margin:0;padding:0;font-size:inherit;display:flex;flex-wrap:nowrap;gap:calc(4 * var(--sbb-seat-reservation-one-px-rem, .0625rem));padding:calc(2 * var(--sbb-seat-reservation-one-px-rem, .0625rem))}.sbb-sr__wrapper-coach-decks{display:flex;overflow:hidden;height:inherit}.sbb-sr__wrapper-coach-decks .sbb-sr__wrapper-deck-labels{display:flex;justify-content:space-between;height:calc(var(--sbb-seat-reservation-height) * var(--sbb-seat-reservation-one-px-rem, .0625rem));writing-mode:vertical-lr}.sbb-sr__wrapper-coach-decks .sbb-sr__wrapper-deck-labels b{height:calc(50% - 16 * var(--sbb-seat-reservation-one-px-rem, .0625rem));width:calc(20 * var(--sbb-seat-reservation-one-px-rem, .0625rem));margin-block-end:16px;rotate:180deg;text-align:center;line-height:calc(20 * var(--sbb-seat-reservation-one-px-rem, .0625rem))}.sbb-sr__wrapper{--sbb-scrollbar-thumb-width: .125rem;--sbb-scrollbar-thumb-width-hover: .25rem;--sbb-scrollbar-width-firefox: thin;--sbb-scrollbar-color: color-mix(in srgb, var(--sbb-color-black) 30%, transparent);--sbb-scrollbar-color: light-dark( color-mix(in srgb, var(--sbb-color-black) 30%, transparent), color-mix(in srgb, var(--sbb-color-white) 30%, transparent) );--sbb-scrollbar-color-hover: color-mix(in srgb, var(--sbb-color-black) 60%, transparent);--sbb-scrollbar-color-hover: light-dark( color-mix(in srgb, var(--sbb-color-black) 60%, transparent), color-mix(in srgb, var(--sbb-color-white) 60%, transparent) );--sbb-scrollbar-track-color: transparent;--sbb-scrollbar-width: var(--sbb-spacing-fixed-3x)}.sbb-sr__wrapper::-webkit-scrollbar{width:var(--sbb-scrollbar-width);height:var(--sbb-scrollbar-width);background-color:var(--sbb-scrollbar-track-color, transparent)}.sbb-sr__wrapper::-webkit-scrollbar-corner{background-color:var(--sbb-scrollbar-track-color, transparent)}.sbb-sr__wrapper::-webkit-scrollbar-thumb{background-color:var(--sbb-scrollbar-color, currentcolor);border:calc(.5 * (var(--sbb-scrollbar-width) - var(--sbb-scrollbar-thumb-width))) solid transparent;border-radius:var(--sbb-border-radius-4x);background-clip:padding-box}.sbb-sr__wrapper::-webkit-scrollbar-thumb:hover{background-color:var(--sbb-scrollbar-color-hover, currentcolor);border-width:calc(.5 * (var(--sbb-scrollbar-width) - var(--sbb-scrollbar-thumb-width-hover)))}.sbb-sr__wrapper::-webkit-scrollbar-button,.sbb-sr__wrapper::-webkit-scrollbar-corner{display:none}@supports not selector(::-webkit-scrollbar){.sbb-sr__wrapper{scrollbar-width:var(--sbb-scrollbar-width-firefox);scrollbar-color:var(--sbb-scrollbar-color, currentcolor) var(--sbb-scrollbar-track-color, transparent)}}.sbb-sr__wrapper{overflow-x:scroll;padding-block:calc(8 * var(--sbb-seat-reservation-one-px-rem, .0625rem)) calc(16 * var(--sbb-seat-reservation-one-px-rem, .0625rem))}.sbb-sr__wrapper .sbb-sr__parent{display:flex;flex-direction:column;position:relative}.sbb-sr__list-decks{list-style:none;margin:0;padding:0;font-size:inherit;display:flex;flex-direction:column}.sbb-sr__list-decks--gap{gap:calc(48 * var(--sbb-seat-reservation-one-px-rem, .0625rem))}.sbb-sr__list-item-deck{position:relative}.sbb-sr__list-coaches{list-style:none;margin:0;padding:0;font-size:inherit;display:flex;gap:calc(4 * var(--sbb-seat-reservation-one-px-rem, .0625rem))}.sbb-sr__item-coach{position:relative}.sbb-sr-popover{margin:0}.sbb-sr-coach-wrapper__table{outline:0}:host([align-vertical]) .sbb-sr{grid-template-columns:calc((var(--sbb-seat-reservation-height) + 24) * var(--sbb-seat-reservation-one-px-rem, .0625rem)) 1fr;grid-template-rows:20% 60% 20%}:host([align-vertical]) .sbb-sr .sbb-sr-navigation-first-grid,:host([align-vertical]) .sbb-sr .sbb-sr-navigation-last-grid{margin-inline-start:calc(4 * var(--sbb-seat-reservation-one-px-rem, .0625rem));margin-block-start:0}:host([align-vertical]) .sbb-sr .sbb-sr-navigation-first-grid{grid-column:2/3;grid-row-start:1}:host([align-vertical]) .sbb-sr .sbb-sr-navigation-first-grid #first-tab-element{position:absolute;inset-block-end:calc(16 * var(--sbb-seat-reservation-one-px-rem, .0625rem));inset-inline-start:calc(16 * var(--sbb-seat-reservation-one-px-rem, .0625rem));inset-inline-end:initial;rotate:90deg}:host([align-vertical]) .sbb-sr .sbb-sr-navigation-last-grid{grid-column:2/3;grid-row:3/4}:host([align-vertical]) .sbb-sr .sbb-sr-navigation-last-grid #last-tab-element{inset-block-start:calc(16 * var(--sbb-seat-reservation-one-px-rem, .0625rem));inset-inline-start:calc(16 * var(--sbb-seat-reservation-one-px-rem, .0625rem));rotate:90deg}:host([align-vertical]) .sbb-sr .sbb-sr-navigation-wrapper{padding-block-end:initial;padding-inline-start:calc(16 * var(--sbb-seat-reservation-one-px-rem, .0625rem))}:host([align-vertical]) .sbb-sr .sbb-sr__component{grid-column:1/3;grid-row:1/4}:host([align-vertical]) .sbb-sr .sbb-sr-grid-inner{grid-template-columns:calc((var(--sbb-seat-reservation-height) + 24) * var(--sbb-seat-reservation-one-px-rem, .0625rem)) 1fr;grid-template-rows:20% 60% 20%}:host([align-vertical]) .sbb-sr .sbb-sr-grid-inner .nav-grid{grid-column:2/3;grid-row:2/3;height:100%}:host([align-vertical]) .sbb-sr .sbb-sr-grid-inner .nav-grid .sbb-sr-navigation{display:block;overflow:hidden scroll;height:100%;padding-block-start:0;padding-inline-start:calc(4 * var(--sbb-seat-reservation-one-px-rem, .0625rem))}:host([align-vertical]) .sbb-sr .sbb-sr-grid-inner .nav-grid .sbb-sr-navigation .sbb-sr-navigation__list-coaches{flex-direction:column;padding:calc(2 * var(--sbb-seat-reservation-one-px-rem, .0625rem))}:host([align-vertical]) .sbb-sr .sbb-sr-grid-inner .coaches-grid{grid-column:1/2;grid-row:1/4;overflow:hidden;position:relative}:host([align-vertical]) .sbb-sr .sbb-sr-grid-inner .coaches-grid .sbb-sr__wrapper-coach-decks{flex-direction:column}:host([align-vertical]) .sbb-sr .sbb-sr-grid-inner .coaches-grid .sbb-sr__wrapper-coach-decks .sbb-sr__wrapper-deck-labels{flex-direction:column-reverse;width:calc(100% - 24 * var(--sbb-seat-reservation-one-px-rem, .0625rem));height:initial}:host([align-vertical]) .sbb-sr .sbb-sr-grid-inner .coaches-grid .sbb-sr__wrapper-coach-decks .sbb-sr__wrapper-deck-labels b{width:calc(50% - 16 * var(--sbb-seat-reservation-one-px-rem, .0625rem));height:calc(20 * var(--sbb-seat-reservation-one-px-rem, .0625rem));margin-bottom:16px;rotate:initial;writing-mode:initial}:host([align-vertical]) .sbb-sr .sbb-sr-grid-inner .coaches-grid .sbb-sr__wrapper-coach-decks .sbb-sr__wrapper{--sbb-scrollbar-thumb-width: .125rem;--sbb-scrollbar-thumb-width-hover: .25rem;--sbb-scrollbar-width-firefox: thin;--sbb-scrollbar-color: color-mix(in srgb, var(--sbb-color-black) 30%, transparent);--sbb-scrollbar-color: light-dark( color-mix(in srgb, var(--sbb-color-black) 30%, transparent), color-mix(in srgb, var(--sbb-color-white) 30%, transparent) );--sbb-scrollbar-color-hover: color-mix(in srgb, var(--sbb-color-black) 60%, transparent);--sbb-scrollbar-color-hover: light-dark( color-mix(in srgb, var(--sbb-color-black) 60%, transparent), color-mix(in srgb, var(--sbb-color-white) 60%, transparent) );--sbb-scrollbar-track-color: transparent;--sbb-scrollbar-width: var(--sbb-spacing-fixed-3x)}:host([align-vertical]) .sbb-sr .sbb-sr-grid-inner .coaches-grid .sbb-sr__wrapper-coach-decks .sbb-sr__wrapper::-webkit-scrollbar{width:var(--sbb-scrollbar-width);height:var(--sbb-scrollbar-width);background-color:var(--sbb-scrollbar-track-color, transparent)}:host([align-vertical]) .sbb-sr .sbb-sr-grid-inner .coaches-grid .sbb-sr__wrapper-coach-decks .sbb-sr__wrapper::-webkit-scrollbar-corner{background-color:var(--sbb-scrollbar-track-color, transparent)}:host([align-vertical]) .sbb-sr .sbb-sr-grid-inner .coaches-grid .sbb-sr__wrapper-coach-decks .sbb-sr__wrapper::-webkit-scrollbar-thumb{background-color:var(--sbb-scrollbar-color, currentcolor);border:calc(.5 * (var(--sbb-scrollbar-width) - var(--sbb-scrollbar-thumb-width))) solid transparent;border-radius:var(--sbb-border-radius-4x);background-clip:padding-box}:host([align-vertical]) .sbb-sr .sbb-sr-grid-inner .coaches-grid .sbb-sr__wrapper-coach-decks .sbb-sr__wrapper::-webkit-scrollbar-thumb:hover{background-color:var(--sbb-scrollbar-color-hover, currentcolor);border-width:calc(.5 * (var(--sbb-scrollbar-width) - var(--sbb-scrollbar-thumb-width-hover)))}:host([align-vertical]) .sbb-sr .sbb-sr-grid-inner .coaches-grid .sbb-sr__wrapper-coach-decks .sbb-sr__wrapper::-webkit-scrollbar-button,:host([align-vertical]) .sbb-sr .sbb-sr-grid-inner .coaches-grid .sbb-sr__wrapper-coach-decks .sbb-sr__wrapper::-webkit-scrollbar-corner{display:none}@supports not selector(::-webkit-scrollbar){:host([align-vertical]) .sbb-sr .sbb-sr-grid-inner .coaches-grid .sbb-sr__wrapper-coach-decks .sbb-sr__wrapper{scrollbar-width:var(--sbb-scrollbar-width-firefox);scrollbar-color:var(--sbb-scrollbar-color, currentcolor) var(--sbb-scrollbar-track-color, transparent)}}:host([align-vertical]) .sbb-sr .sbb-sr-grid-inner .coaches-grid .sbb-sr__wrapper-coach-decks .sbb-sr__wrapper{overflow:hidden scroll;height:100%;padding:0}:host([align-vertical]) .sbb-sr .sbb-sr-grid-inner .coaches-grid .sbb-sr__wrapper-coach-decks .sbb-sr__parent{rotate:90deg;transform-origin:calc((var(--sbb-seat-reservation-height) + 24 - 24 - 6 * (var(--sbb-seat-reservation-decks) - 1)) / 2 * var(--sbb-seat-reservation-one-px-rem, .0625rem)) calc((var(--sbb-seat-reservation-height) + 24 - 24 - 6 * (var(--sbb-seat-reservation-decks) - 1)) / 2 * var(--sbb-seat-reservation-one-px-rem, .0625rem))}`;
19
- let X = (() => {
20
- var h;
21
- let C = [E("sbb-seat-reservation")], w, f = [], d, k = T;
22
- return h = class extends k {
19
+ const T = S`:host{--sbb-seat-reservation-grid-size: 16px;--sbb-seat-reservation-height: 0;--sbb-seat-reservation-decks: 1;display:block;height:inherit}:host ::part(coach-floor){fill:var(--sbb-background-color-2)}@media(forced-colors:active){:host ::part(coach-floor){fill:transparent}}:host(:dir(rtl)) :not(.sbb-sr-place-ctrl--type-bicycle,.sbb-sr-place-ctrl--orientation-90,.sbb-sr-place-ctrl--orientation-270,.sbb-sr-place-ctrl--state-selected) ::part(coach-floor){rotate:180deg}[popover]:where(sbb-popover){margin:0;padding:0;border:none;width:auto;height:auto;background-color:transparent;color:inherit;pointer-events:none}[popover]:where(sbb-popover) .sbb-sr-popover{margin-block:calc(4 * var(--sbb-seat-reservation-one-px-rem, .0625rem))}:host([align-vertical]) .sbb-sr__component{flex-direction:row-reverse;justify-content:flex-end;gap:calc(22 * var(--sbb-seat-reservation-one-px-rem, .0625rem));height:inherit}@media(min-width:37.5rem){:host([align-vertical]) .sbb-sr__component{gap:calc(54 * var(--sbb-seat-reservation-one-px-rem, .0625rem))}}:host([align-vertical]) .sbb-sr__component nav.sbb-sr-navigation,:host([align-vertical]) .sbb-sr__component ul.sbb-sr-navigation__list-coaches{flex-direction:column}:host([align-vertical]) .sbb-sr__component nav.sbb-sr-navigation{padding:calc(16 * var(--sbb-seat-reservation-one-px-rem, .0625rem)) 0}:host([align-vertical]) .sbb-sr__component nav.sbb-sr-navigation .sbb-sr__navigation-control-button{left:calc(1 * var(--sbb-seat-reservation-one-px-rem, .0625rem));top:0;rotate:90deg}@media(min-width:64rem){:host([align-vertical]) .sbb-sr__component nav.sbb-sr-navigation .sbb-sr__navigation-control-button{left:calc(-1 * var(--sbb-seat-reservation-one-px-rem, .0625rem))}}:host([align-vertical]) .sbb-sr__component nav.sbb-sr-navigation ul.sbb-sr-navigation__list-coaches{max-width:initial;padding:calc(5 * var(--sbb-seat-reservation-one-px-rem, .0625rem));overflow:hidden scroll}:host([align-vertical]) .sbb-sr__wrapper-coach-decks{flex-direction:column}:host([align-vertical]) .sbb-sr__wrapper-coach-decks .sbb-sr__wrapper-deck-labels{flex-direction:column-reverse;width:calc((var(--sbb-seat-reservation-height) + 24) * var(--sbb-seat-reservation-one-px-rem, .0625rem));height:initial}:host([align-vertical]) .sbb-sr__wrapper-coach-decks .sbb-sr__wrapper-deck-labels b{inline-size:calc(50% - 16 * var(--sbb-seat-reservation-one-px-rem, .0625rem));block-size:calc(20 * var(--sbb-seat-reservation-one-px-rem, .0625rem));margin-bottom:calc(16 * var(--sbb-seat-reservation-one-px-rem, .0625rem));rotate:initial;writing-mode:initial}:host([align-vertical]) .sbb-sr__wrapper-scrollarea{width:calc((var(--sbb-seat-reservation-height) + 24) * var(--sbb-seat-reservation-one-px-rem, .0625rem));height:100%;overflow:hidden scroll}:host([align-vertical]) .sbb-sr__wrapper-scrollarea .sbb-sr__parent{flex-direction:row;rotate:90deg}.sbb-sr-navigation{gap:calc(3 * var(--sbb-seat-reservation-one-px-rem, .0625rem))}.sbb-sr-navigation .sbb-sr__navigation-control-button{position:relative;top:calc(2 * var(--sbb-seat-reservation-one-px-rem, .0625rem))}@media(min-width:64rem){.sbb-sr-navigation .sbb-sr__navigation-control-button{top:0}}.sbb-sr__component{display:flex;flex-direction:column;gap:calc(64 * var(--sbb-seat-reservation-one-px-rem, .0625rem) - 16px)}.sbb-sr-navigation-wrapper{display:flex}.sbb-sr-navigation{display:flex;justify-content:center;width:100%;padding-inline:16px}.sbb-sr-navigation__list-coaches{list-style:none;margin:0;padding:0;font-size:inherit;--sbb-scrollbar-thumb-width: .125rem;--sbb-scrollbar-thumb-width-hover: .25rem;--sbb-scrollbar-width-firefox: thin;--sbb-scrollbar-color: color-mix(in srgb, var(--sbb-color-black) 30%, transparent);--sbb-scrollbar-color: light-dark( color-mix(in srgb, var(--sbb-color-black) 30%, transparent), color-mix(in srgb, var(--sbb-color-white) 30%, transparent) );--sbb-scrollbar-color-hover: color-mix(in srgb, var(--sbb-color-black) 60%, transparent);--sbb-scrollbar-color-hover: light-dark( color-mix(in srgb, var(--sbb-color-black) 60%, transparent), color-mix(in srgb, var(--sbb-color-white) 60%, transparent) );--sbb-scrollbar-track-color: transparent;--sbb-scrollbar-width: var(--sbb-spacing-fixed-3x)}.sbb-sr-navigation__list-coaches::-webkit-scrollbar{width:var(--sbb-scrollbar-width);height:var(--sbb-scrollbar-width);background-color:var(--sbb-scrollbar-track-color, transparent)}.sbb-sr-navigation__list-coaches::-webkit-scrollbar-corner{background-color:var(--sbb-scrollbar-track-color, transparent)}.sbb-sr-navigation__list-coaches::-webkit-scrollbar-thumb{background-color:var(--sbb-scrollbar-color, currentcolor);border:calc(.5 * (var(--sbb-scrollbar-width) - var(--sbb-scrollbar-thumb-width))) solid transparent;border-radius:var(--sbb-border-radius-4x);background-clip:padding-box}.sbb-sr-navigation__list-coaches::-webkit-scrollbar-thumb:hover{background-color:var(--sbb-scrollbar-color-hover, currentcolor);border-width:calc(.5 * (var(--sbb-scrollbar-width) - var(--sbb-scrollbar-thumb-width-hover)))}.sbb-sr-navigation__list-coaches::-webkit-scrollbar-button,.sbb-sr-navigation__list-coaches::-webkit-scrollbar-corner{display:none}@supports not selector(::-webkit-scrollbar){.sbb-sr-navigation__list-coaches{scrollbar-width:var(--sbb-scrollbar-width-firefox);scrollbar-color:var(--sbb-scrollbar-color, currentcolor) var(--sbb-scrollbar-track-color, transparent)}}.sbb-sr-navigation__list-coaches{display:flex;flex-wrap:nowrap;gap:calc(4 * var(--sbb-seat-reservation-one-px-rem, .0625rem));padding:calc(6 * var(--sbb-seat-reservation-one-px-rem, .0625rem)) calc(5 * var(--sbb-seat-reservation-one-px-rem, .0625rem)) 0;max-width:856px;--sbb-scrollbar-color: transparent;overflow:scroll hidden;position:relative}.sbb-sr__wrapper-coach-decks{display:flex;overflow:hidden;height:inherit}.sbb-sr__wrapper-coach-decks .sbb-sr__wrapper-deck-labels{display:flex;justify-content:space-between;height:calc(var(--sbb-seat-reservation-height) * var(--sbb-seat-reservation-one-px-rem, .0625rem));writing-mode:vertical-lr}.sbb-sr__wrapper-coach-decks .sbb-sr__wrapper-deck-labels b{height:calc(50% - 16 * var(--sbb-seat-reservation-one-px-rem, .0625rem));width:calc(20 * var(--sbb-seat-reservation-one-px-rem, .0625rem));margin-block-end:16px;rotate:180deg;text-align:center;line-height:calc(20 * var(--sbb-seat-reservation-one-px-rem, .0625rem))}.sbb-sr__wrapper-scrollarea{--sbb-scrollbar-thumb-width: .125rem;--sbb-scrollbar-thumb-width-hover: .25rem;--sbb-scrollbar-width-firefox: thin;--sbb-scrollbar-color: color-mix(in srgb, var(--sbb-color-black) 30%, transparent);--sbb-scrollbar-color: light-dark( color-mix(in srgb, var(--sbb-color-black) 30%, transparent), color-mix(in srgb, var(--sbb-color-white) 30%, transparent) );--sbb-scrollbar-color-hover: color-mix(in srgb, var(--sbb-color-black) 60%, transparent);--sbb-scrollbar-color-hover: light-dark( color-mix(in srgb, var(--sbb-color-black) 60%, transparent), color-mix(in srgb, var(--sbb-color-white) 60%, transparent) );--sbb-scrollbar-track-color: transparent;--sbb-scrollbar-width: var(--sbb-spacing-fixed-3x)}.sbb-sr__wrapper-scrollarea::-webkit-scrollbar{width:var(--sbb-scrollbar-width);height:var(--sbb-scrollbar-width);background-color:var(--sbb-scrollbar-track-color, transparent)}.sbb-sr__wrapper-scrollarea::-webkit-scrollbar-corner{background-color:var(--sbb-scrollbar-track-color, transparent)}.sbb-sr__wrapper-scrollarea::-webkit-scrollbar-thumb{background-color:var(--sbb-scrollbar-color, currentcolor);border:calc(.5 * (var(--sbb-scrollbar-width) - var(--sbb-scrollbar-thumb-width))) solid transparent;border-radius:var(--sbb-border-radius-4x);background-clip:padding-box}.sbb-sr__wrapper-scrollarea::-webkit-scrollbar-thumb:hover{background-color:var(--sbb-scrollbar-color-hover, currentcolor);border-width:calc(.5 * (var(--sbb-scrollbar-width) - var(--sbb-scrollbar-thumb-width-hover)))}.sbb-sr__wrapper-scrollarea::-webkit-scrollbar-button,.sbb-sr__wrapper-scrollarea::-webkit-scrollbar-corner{display:none}@supports not selector(::-webkit-scrollbar){.sbb-sr__wrapper-scrollarea{scrollbar-width:var(--sbb-scrollbar-width-firefox);scrollbar-color:var(--sbb-scrollbar-color, currentcolor) var(--sbb-scrollbar-track-color, transparent)}}.sbb-sr__wrapper-scrollarea{overflow:scroll hidden;padding-block:calc(8 * var(--sbb-seat-reservation-one-px-rem, .0625rem)) calc(16 * var(--sbb-seat-reservation-one-px-rem, .0625rem))}.sbb-sr__wrapper-scrollarea .sbb-sr__parent{display:flex;flex-direction:column;position:relative}.sbb-sr__list-decks{list-style:none;margin:0;padding:0;font-size:inherit;display:flex;flex-direction:column}.sbb-sr__list-decks--gap{gap:calc(48 * var(--sbb-seat-reservation-one-px-rem, .0625rem))}.sbb-sr__list-item-deck{position:relative}.sbb-sr__list-coaches{list-style:none;margin:0;padding:0;font-size:inherit;display:flex;gap:calc(4 * var(--sbb-seat-reservation-one-px-rem, .0625rem))}.sbb-sr__item-coach{position:relative}.sbb-sr-coach-wrapper__table{outline:0}`;
20
+ let Y = (() => {
21
+ var p;
22
+ let C = [E("sbb-seat-reservation")], f, w = [], h, x = P;
23
+ return p = class extends x {
23
24
  constructor() {
24
25
  super(...arguments), this._language = new A(this), this._notAreaElements = [
25
26
  "DRIVER_AREA",
@@ -31,11 +32,11 @@ let X = (() => {
31
32
  "COMPARTMENT_PASSAGE_LOW"
32
33
  ], this._notFixedRotatableAreaIcons = ["ENTRY_EXIT"];
33
34
  }
34
- willUpdate(r) {
35
- super.willUpdate(r), r.has("hasNavigation") && (this.hasNavigation ? this.shadowRoot?.querySelectorAll("table").forEach((e) => e.removeAttribute("tabindex")) : this.shadowRoot?.querySelectorAll("table").forEach((e) => e.setAttribute("tabindex", "0")));
35
+ willUpdate(e) {
36
+ super.willUpdate(e), e.has("hasNavigation") && (this.hasNavigation ? this.shadowRoot?.querySelectorAll("table").forEach((r) => r.removeAttribute("tabindex")) : this.shadowRoot?.querySelectorAll("table").forEach((r) => r.setAttribute("tabindex", "0")));
36
37
  }
37
- firstUpdated(r) {
38
- super.firstUpdated(r), this.updateComplete.then(() => {
38
+ firstUpdated(e) {
39
+ super.firstUpdated(e), this.updateComplete.then(() => {
39
40
  this.initNavigationSelectionByScrollEvent();
40
41
  });
41
42
  }
@@ -44,103 +45,96 @@ let X = (() => {
44
45
  }
45
46
  _initVehicleSeatReservationConstruction() {
46
47
  this._coachesHtmlTemplate = n`
47
- <div class="sbb-sr__container">
48
- <div class="sbb-sr sbb-sr__grid">
49
- <div class="sbb-sr-navigation-first-grid">
50
- ${this._renderNavigationControlButton("DIRECTION_LEFT")}
51
- </div>
48
+ <div class="sbb-sr__component">
49
+ ${this._renderNavigation()}
50
+ <div
51
+ class="sbb-sr__wrapper-coach-decks"
52
+ @keydown=${(e) => this.keyboardSeatmapEventHadling(e)}
53
+ >
54
+ <div class="sbb-sr__wrapper-deck-labels">${this._renderDeckLabels()}</div>
52
55
  <div
53
- class="sbb-sr__component"
54
- @keydown=${(r) => this.handleKeyboardEvent(r)}
56
+ @scroll=${() => this.coachAreaScrollend()}
57
+ id="sbb-sr__wrapper-scrollarea"
58
+ class="sbb-sr__wrapper-scrollarea"
59
+ tabindex="-1"
55
60
  >
56
- <div class="sbb-sr-grid-inner">
57
- <div class="nav-grid">${this._renderNavigation()}</div>
58
- <div class="coaches-grid">
59
- <div class="sbb-sr__wrapper-coach-decks">
60
- <div class="sbb-sr__wrapper-deck-labels">${this._renderDeckLabels()}</div>
61
- <div
62
- id="sbb-sr__wrapper-scrollarea"
63
- class="sbb-sr__wrapper"
64
- @scroll=${() => this.coachAreaScrollend()}
65
- >
66
- <div id="sbb-sr__parent-area" class="sbb-sr__parent" tabindex="-1">
67
- <ul
68
- class="${x({
61
+ <div id="sbb-sr__parent-area" class="sbb-sr__parent">
62
+ <ul
63
+ class="${$({
69
64
  "sbb-sr__list-decks": !0,
70
65
  "sbb-sr__list-decks--gap": this.hasMultipleDecks
71
66
  })}"
72
- >
73
- ${this.seatReservations?.map((r, e) => n`<li class="sbb-sr__list-item-deck">
74
- <ul class="sbb-sr__list-coaches" role="presentation">
75
- ${this._renderCoaches(r, e)}
76
- </ul>
77
- </li>`)}
67
+ >
68
+ ${this.seatReservations?.map((e, r) => n`<li class="sbb-sr__list-item-deck">
69
+ <ul class="sbb-sr__list-coaches" role="presentation">
70
+ ${this._renderCoaches(e, r)}
78
71
  </ul>
79
- </div>
80
- </div>
81
- </div>
82
- </div>
72
+ </li>`)}
73
+ </ul>
83
74
  </div>
84
75
  </div>
85
- <div class="sbb-sr-navigation-last-grid">
86
- ${this._renderNavigationControlButton("DIRECTION_RIGHT")}
87
- </div>
88
76
  </div>
89
77
  </div>
90
78
  `;
91
79
  }
92
80
  _renderDeckLabels() {
93
- return this.hasMultipleDecks ? this.seatReservations.map((r) => {
94
- const e = l(r.deckCoachLevel, this._language.current);
95
- return n`<b aria-hidden="true">${e}</b>`;
81
+ return this.hasMultipleDecks ? this.seatReservations.map((e) => {
82
+ const r = c(e.deckCoachLevel, this._language.current);
83
+ return n`<b aria-hidden="true">${r}</b>`;
96
84
  }) : null;
97
85
  }
98
- _renderNavigationControlButton(r) {
86
+ _renderNavigationControlButton(e) {
99
87
  if (!this.hasNavigation || !this.seatReservations)
100
88
  return null;
101
- const e = r == "DIRECTION_RIGHT" ? "last-tab-element" : "first-tab-element", t = r == "DIRECTION_RIGHT" ? "chevron-small-right-small" : "chevron-small-left-small", a = r == "DIRECTION_RIGHT" ? l("SEAT_RESERVATION_END", this._language.current) : l("SEAT_RESERVATION_BEGIN", this._language.current);
102
- let s = !0;
103
- return (r == "DIRECTION_LEFT" && this.selectedCoachIndex > 0 || r == "DIRECTION_RIGHT" && this.selectedCoachIndex < this.seatReservations[this.currSelectedDeckIndex].coachItems.length - 1) && (s = !1), n`<sbb-secondary-button
104
- @click="${() => this.navigateByDirectionBtn(r)}"
105
- id="${e}"
106
- class="sbb-sr__navigation-control-button"
107
- size="s"
108
- icon-name="${t}"
109
- type="button"
110
- aria-label="${a}"
111
- role="contentinfo"
112
- .disabledInteractive="${s || u}"
113
- ></sbb-secondary-button>`;
89
+ const r = e == "DIRECTION_RIGHT" ? "sbb-sr-navigation__wrapper-button-direction--right" : "sbb-sr-navigation__wrapper-button-direction--left", s = e == "DIRECTION_RIGHT" ? "chevron-small-right-small" : "chevron-small-left-small", a = e == "DIRECTION_RIGHT" ? c("SEAT_RESERVATION_END", this._language.current) : c("SEAT_RESERVATION_BEGIN", this._language.current);
90
+ let o = !0;
91
+ return (e == "DIRECTION_LEFT" && this.selectedCoachIndex > 0 || e == "DIRECTION_RIGHT" && this.selectedCoachIndex < this.coachNavData.length - 1) && (o = !1), n`<div class="sbb-sr-navigation__wrapper-button-direction">
92
+ <sbb-secondary-button
93
+ @click="${() => this.navigateByDirectionBtn(e)}"
94
+ @focus="${() => this.onFocusNavDirectionButton()}"
95
+ id="${r}"
96
+ class="sbb-sr__navigation-control-button"
97
+ size="m"
98
+ icon-name="${s}"
99
+ type="button"
100
+ aria-label="${a}"
101
+ role="button"
102
+ .disabledInteractive="${o || _}"
103
+ ></sbb-secondary-button>
104
+ </div>`;
114
105
  }
115
106
  _renderNavigation() {
116
107
  return !this.hasNavigation || !this.seatReservations ? null : n`<div class="sbb-sr-navigation-wrapper">
117
108
  <nav id="sbb-sr-navigation" class="sbb-sr-navigation">
109
+ ${this._renderNavigationControlButton("DIRECTION_LEFT")}
118
110
  <ul
119
111
  id="sbb-sr__navigation-list-coaches"
120
112
  class="sbb-sr-navigation__list-coaches"
121
- aria-label="${l("SEAT_RESERVATION_NAVIGATION", this._language.current)}"
113
+ aria-label="${c("SEAT_RESERVATION_NAVIGATION", this._language.current)}"
122
114
  >
123
- ${this.coachNavData.map((r, e) => n`<li>
115
+ ${this.coachNavData.map((e, r) => n`<li>
124
116
  <sbb-seat-reservation-navigation-coach
125
- @selectcoach=${(t) => this._onSelectNavCoach(t)}
117
+ @selectcoach=${(s) => this._onSelectNavCoach(s)}
126
118
  @focuscoach=${() => this._onFocusNavCoach()}
127
- index="${e}"
128
- coach-id="${r.id}"
129
- .freePlacesByType="${r.freePlaces}"
130
- .selected=${this.selectedCoachIndex === e}
131
- .focused=${this.focusedCoachIndex === e}
132
- .hovered=${this.hoveredScrollCoachIndex === e}
119
+ @keyup=${(s) => this.onKeyNavigationNavCoachButton(s, r)}
120
+ index="${r}"
121
+ coach-id="${e.id}"
122
+ .freePlacesByType="${e.freePlaces}"
123
+ .selected=${this.selectedCoachIndex === r}
124
+ .focused=${this.focusedCoachIndex === r}
125
+ .hovered=${this.hoveredCoachIndex === r}
133
126
  .nativeFocusActive=${this.hasSeatReservationNativeFocus}
134
- .propertyIds="${r.propertyIds}"
135
- .travelClass="${r.travelClass}"
136
- ?driver-area="${r.isDriverArea}"
137
- ?first="${r?.driverAreaSide?.left}"
138
- ?last="${r?.driverAreaSide?.right}"
127
+ .propertyIds="${e.propertyIds}"
128
+ .travelClass="${e.travelClass}"
129
+ ?driver-area="${e.isDriverArea}"
130
+ ?first="${e?.driverAreaSide?.left}"
131
+ ?last="${e?.driverAreaSide?.right}"
139
132
  ?vertical="${this.alignVertical}"
140
133
  >
141
134
  </sbb-seat-reservation-navigation-coach>
142
135
  </li>`)}
143
136
  </ul>
137
+ ${this._renderNavigationControlButton("DIRECTION_RIGHT")}
144
138
  </nav>
145
139
  </div>`;
146
140
  }
@@ -150,36 +144,37 @@ let X = (() => {
150
144
  * @param seatReservation
151
145
  * @param coachDeckIndex
152
146
  */
153
- _renderCoaches(r, e) {
154
- const t = JSON.parse(JSON.stringify(r?.coachItems));
155
- return t ? t.map((a, s) => n`
147
+ _renderCoaches(e, r) {
148
+ const s = JSON.parse(JSON.stringify(e?.coachItems));
149
+ return s ? s.map((a, o) => n`
156
150
  <li class="sbb-sr__item-coach">
157
- ${this._renderCoachElement(a, s, e, r.deckCoachIndex)}
151
+ ${this._renderCoachElement(a, o, r, e.deckCoachIndex)}
158
152
  </li>
159
153
  `) : null;
160
154
  }
161
- _renderCoachElement(r, e, t, a) {
162
- const s = this.getCalculatedDimension(r.dimension), i = this._getDescriptionTableCoach(r);
155
+ _renderCoachElement(e, r, s, a) {
156
+ const o = this.getCalculatedDimension(e.dimension), t = this._getDescriptionTableCoach(e);
163
157
  return n`<sbb-seat-reservation-scoped
164
158
  style=${v({
165
- "--sbb-seat-reservation-scoped-width": s.w,
166
- "--sbb-seat-reservation-scoped-height": s.h
159
+ "--sbb-seat-reservation-scoped-width": o.w,
160
+ "--sbb-seat-reservation-scoped-height": o.h
167
161
  })}
168
162
  >
169
- ${this._getRenderedCoachBorders(r)}
170
- ${this._getRenderedGraphicalElements(r.graphicElements || [], r.dimension, e, t)}
171
- ${this._getRenderedServiceElements(e, t, r.serviceElements)}
163
+ ${this._getRenderedCoachBorders(e)}
164
+ ${this._getRenderedGraphicalElements(e.graphicElements || [], e.dimension, r, s)}
165
+ ${this._getRenderedServiceElements(r, s, e.serviceElements)}
172
166
 
173
167
  <table
174
- @focus=${() => this.onFocusTableCoachAndPreselectPlace(e)}
175
- id="sbb-sr-coach-${e}"
168
+ @focus=${() => this.onFocusTableCoachAndPreselectPlace(r)}
169
+ id="sbb-sr-coach-${r}"
176
170
  class="sbb-sr-coach-wrapper__table"
177
- aria-describedby="sbb-sr-coach-caption-${e}"
171
+ aria-describedby="sbb-sr-coach-caption-${r}"
172
+ tabindex="-1"
178
173
  >
179
- <caption id="sbb-sr-coach-caption-${e}" tabindex="-1">
180
- <sbb-screen-reader-only>${i}</sbb-screen-reader-only>
174
+ <caption id="sbb-sr-coach-caption-${r}" tabindex="-1">
175
+ <sbb-screen-reader-only>${t}</sbb-screen-reader-only>
181
176
  </caption>
182
- ${this._getRenderedRowPlaces(r, e, t, a)}
177
+ ${this._getRenderedRowPlaces(e, r, s, a)}
183
178
  </table>
184
179
  </sbb-seat-reservation-scoped>`;
185
180
  }
@@ -187,17 +182,17 @@ let X = (() => {
187
182
  * @returns Returns the border graphic (COACH_BORDER_MIDDLE) of a coach with calculated border gap and coach width,
188
183
  * depending on whether the coach is with a driver area or without.
189
184
  */
190
- _getRenderedCoachBorders(r) {
191
- if (!r.graphicElements)
185
+ _getRenderedCoachBorders(e) {
186
+ if (!e.graphicElements)
192
187
  return null;
193
- const e = 1, a = r.graphicElements?.find((b) => b.icon === "DRIVER_AREA"), s = a ? r.dimension.w - a.dimension.w - e : r.dimension.w - e * 2, i = (r.dimension.h + this.coachBorderOffset * 2) * this.baseGridSize, o = a && a.position.x === 0 ? a?.dimension.w * this.baseGridSize : this.baseGridSize;
188
+ const r = 1, a = e.graphicElements?.find((l) => l.icon === "DRIVER_AREA"), o = a ? e.dimension.w - a.dimension.w - r : e.dimension.w - r * 2, t = (e.dimension.h + this.coachBorderOffset * 2) * this.baseGridSize, i = a && a.position.x === 0 ? a?.dimension.w * this.baseGridSize : this.baseGridSize;
194
189
  return n`
195
190
  <sbb-seat-reservation-graphic
196
191
  style=${v({
197
- "--sbb-seat-reservation-graphic-width": s * this.baseGridSize,
198
- "--sbb-seat-reservation-graphic-height": i,
192
+ "--sbb-seat-reservation-graphic-width": o * this.baseGridSize,
193
+ "--sbb-seat-reservation-graphic-height": t,
199
194
  "--sbb-seat-reservation-graphic-top": this.coachBorderPadding * -1,
200
- "--sbb-seat-reservation-graphic-left": o,
195
+ "--sbb-seat-reservation-graphic-left": i,
201
196
  "--sbb-seat-reservation-graphic-position": "absolute"
202
197
  })}
203
198
  name="COACH_BORDER_MIDDLE"
@@ -206,57 +201,59 @@ let X = (() => {
206
201
  ></sbb-seat-reservation-graphic>
207
202
  `;
208
203
  }
209
- _getRenderedRowPlaces(r, e, t, a) {
210
- if (!r.places)
204
+ _getRenderedRowPlaces(e, r, s, a) {
205
+ if (!e.places)
211
206
  return null;
212
- const s = {};
213
- for (const i of r.places)
214
- s[i.position.y] ? s[i.position.y].push(i) : s[i.position.y] = [i];
215
- return Object.values(s).map((i, o) => n`
216
- <tr id="row-${e}-${i[0].position.y}" data-row-index=${o}>
217
- ${this._getRenderedColumnPlaces(i, e, t, a)}
207
+ const o = {};
208
+ for (const t of e.places)
209
+ o[t.position.y] ? o[t.position.y].push(t) : o[t.position.y] = [t];
210
+ return Object.values(o).map((t, i) => n`
211
+ <tr id="row-${r}-${t[0].position.y}" data-row-index=${i}>
212
+ ${this._getRenderedColumnPlaces(t, r, s, a)}
218
213
  </tr>
219
- `).flatMap((i) => i);
214
+ `).flatMap((t) => t);
220
215
  }
221
- _getRenderedColumnPlaces(r, e, t, a) {
222
- return r.sort((s, i) => Number(s.position.x) - Number(i.position.x)), r?.map((s, i) => {
223
- const o = this.getCalculatedDimension(s.dimension), b = this.getCalculatedPosition(s.position), p = s.rotation || 0, c = this.alignVertical ? -90 : 0, g = this.getPlaceElementId(t, e, s.number);
216
+ _getRenderedColumnPlaces(e, r, s, a) {
217
+ e.sort((t, i) => Number(t.position.x) - Number(i.position.x));
218
+ const o = r + "-" + a;
219
+ return n`${N(e, (t) => o + "-" + t.number, (t, i) => {
220
+ const l = this.getCalculatedDimension(t.dimension), d = this.getCalculatedPosition(t.position), b = t.rotation || 0, u = this.alignVertical ? -90 : 0, m = this.getPlaceElementId(s, r, t.number);
224
221
  return n`
225
- <td
226
- id="cell-${t}-${e}-${s.position.y}-${i}"
227
- class="graphical-element"
228
- >
229
- <sbb-seat-reservation-place-control
230
- style=${v({
231
- "--sbb-seat-reservation-place-control-text-scale-value": Math.min(o.w, o.h),
232
- "--sbb-seat-reservation-place-control-width": o.w,
233
- "--sbb-seat-reservation-place-control-height": o.h,
234
- "--sbb-seat-reservation-place-control-top": b.y,
235
- "--sbb-seat-reservation-place-control-left": b.x,
236
- "--sbb-seat-reservation-place-control-rotation": p,
237
- "--sbb-seat-reservation-place-control-text-rotation": c
222
+ <td
223
+ id="cell-${s}-${r}-${t.position.y}-${i}"
224
+ class="graphical-element"
225
+ >
226
+ <sbb-seat-reservation-place-control
227
+ style=${v({
228
+ "--sbb-seat-reservation-place-control-text-scale-value": Math.min(l.w, l.h),
229
+ "--sbb-seat-reservation-place-control-width": l.w,
230
+ "--sbb-seat-reservation-place-control-height": l.h,
231
+ "--sbb-seat-reservation-place-control-top": d.y,
232
+ "--sbb-seat-reservation-place-control-left": d.x,
233
+ "--sbb-seat-reservation-place-control-rotation": b,
234
+ "--sbb-seat-reservation-place-control-text-rotation": u
238
235
  })}
239
- @selectplace=${(_) => this._onSelectPlace(_)}
240
- exportparts="sbb-sr-place-part"
241
- id=${g}
242
- class="seat-reservation-place-control"
243
- text=${s.number}
244
- type=${s.type}
245
- state=${s.state}
246
- coach-index=${e}
247
- deck-index=${a}
248
- data-deck-index=${t}
249
- .propertyIds=${s.propertyIds}
250
- .preventClick=${this.preventPlaceClick}
251
- ></sbb-seat-reservation-place-control>
252
- </td>
253
- `;
254
- });
236
+ @selectplace=${(g) => this._onSelectPlace(g)}
237
+ exportparts="sbb-sr-place-part"
238
+ id=${m}
239
+ class="seat-reservation-place-control"
240
+ text=${t.number}
241
+ type=${t.type}
242
+ state=${t.state}
243
+ coach-index=${r}
244
+ deck-index=${a}
245
+ data-deck-index=${s}
246
+ .propertyIds=${t.propertyIds}
247
+ .preventClick=${this.preventPlaceClick}
248
+ ></sbb-seat-reservation-place-control>
249
+ </td>
250
+ `;
251
+ })}`;
255
252
  }
256
- _getRenderedGraphicalElements(r, e, t, a) {
257
- return r ? r?.map((s) => {
258
- const i = s.icon ?? "", o = s.rotation || 0, b = this._notFixedRotatableAreaIcons.indexOf(s.icon) === -1, p = this.alignVertical && b ? o - 90 : o;
259
- return this._notAreaElements.findIndex((c) => c === i) > -1 ? this._getRenderElementWithoutArea(s, o, e) : this._getRenderElementWithArea(s, p, e, t, a);
253
+ _getRenderedGraphicalElements(e, r, s, a) {
254
+ return e ? e?.map((o) => {
255
+ const t = o.icon ?? "", i = o.rotation || 0, l = this._notFixedRotatableAreaIcons.indexOf(o.icon) === -1, d = this.alignVertical && l ? i - 90 : i;
256
+ return this._notAreaElements.findIndex((b) => b === t) > -1 ? this._getRenderElementWithoutArea(o, i, r) : this._getRenderElementWithArea(o, d, r, s, a);
260
257
  }) : null;
261
258
  }
262
259
  /**
@@ -268,76 +265,76 @@ let X = (() => {
268
265
  * @param coachDeckIndex used to generate a unique id
269
266
  * @private
270
267
  */
271
- _getRenderElementWithArea(r, e, t, a, s) {
272
- const i = r.icon?.indexOf("TABLE") === -1, o = r.icon && i ? r.icon : null, b = this.isElementDirectlyOnBorder(r, t) && o !== "ENTRY_EXIT", p = r.icon ? l(r.icon, this._language.current) : u, c = this.getCalculatedDimension(r.dimension, t, !0, b), g = this.getCalculatedPosition(r.position, r.dimension, t, !0), _ = `popover-trigger-${s}-${a}-${g.x}-${g.y}`;
273
- let m = "free";
274
- return r.position.y === this.coachBorderOffset * -1 ? m = "upper-border" : r.position.y + r.dimension.h === t.h + this.coachBorderOffset && (m = "lower-border"), n`
268
+ _getRenderElementWithArea(e, r, s, a, o) {
269
+ const t = e.icon?.indexOf("TABLE") === -1, i = e.icon && t ? e.icon : null, l = this.isElementDirectlyOnBorder(e, s) && i !== "ENTRY_EXIT", d = e.icon ? c(e.icon, this._language.current) : _, b = this.getCalculatedDimension(e.dimension, s, !0, l), u = this.getCalculatedPosition(e.position, e.dimension, s, !0), m = `popover-trigger-${o}-${a}-${u.x}-${u.y}`;
270
+ let g = "free";
271
+ return e.position.y === this.coachBorderOffset * -1 ? g = "upper-border" : e.position.y + e.dimension.h === s.h + this.coachBorderOffset && (g = "lower-border"), n`
275
272
  <sbb-seat-reservation-area
276
- id="${_}"
277
- class="${x({ "sbb-seat-reservation-area--cursor-pointer": o !== null })}"
273
+ id="${m}"
274
+ class="${$({ "sbb-seat-reservation-area--cursor-pointer": i !== null })}"
278
275
  style=${v({
279
- "--sbb-seat-reservation-area-width": c.w,
280
- "--sbb-seat-reservation-area-height": c.h,
281
- "--sbb-seat-reservation-area-top": g.y,
282
- "--sbb-seat-reservation-area-left": g.x
276
+ "--sbb-seat-reservation-area-width": b.w,
277
+ "--sbb-seat-reservation-area-height": b.h,
278
+ "--sbb-seat-reservation-area-top": u.y,
279
+ "--sbb-seat-reservation-area-left": u.x
283
280
  })}
284
- mounting=${m}
281
+ mounting=${g}
285
282
  background="dark"
286
283
  aria-hidden="true"
287
284
  >
288
- ${o ? n`
285
+ ${i ? n`
289
286
  <sbb-seat-reservation-graphic
290
287
  style=${v({
291
- "--sbb-seat-reservation-graphic-max-width": c.w,
288
+ "--sbb-seat-reservation-graphic-max-width": b.w,
292
289
  "--sbb-seat-reservation-graphic-height": this.baseGridSize,
293
- "--sbb-seat-reservation-graphic-rotation": e
290
+ "--sbb-seat-reservation-graphic-rotation": r
294
291
  })}
295
- name=${o}
292
+ name=${i}
296
293
  role="img"
297
294
  aria-hidden="true"
298
295
  class="auto-width"
299
296
  ></sbb-seat-reservation-graphic>
300
- ` : u}
297
+ ` : _}
301
298
  </sbb-seat-reservation-area>
302
- ${o ? this._popover(_, p) : u}
299
+ ${i ? this._popover(m, d) : _}
303
300
  `;
304
301
  }
305
- _getRenderElementWithoutArea(r, e, t) {
306
- const a = this.getCalculatedDimension(r.dimension, t), s = this.getCalculatedPosition(r.position, r.dimension, t), i = r.icon && r.icon.indexOf("DRIVER_AREA") === -1 ? r.icon : r.icon?.concat("_", this.seatReservations[this.currSelectedDeckIndex].vehicleType);
302
+ _getRenderElementWithoutArea(e, r, s) {
303
+ const a = this.getCalculatedDimension(e.dimension, s), o = this.getCalculatedPosition(e.position, e.dimension, s), t = e.icon && e.icon.indexOf("DRIVER_AREA") === -1 ? e.icon : e.icon?.concat("_", this.seatReservations[this.currSelectedDeckIndex].vehicleType);
307
304
  return n` <sbb-seat-reservation-graphic
308
305
  style=${v({
309
306
  "--sbb-seat-reservation-graphic-width": a.w,
310
307
  "--sbb-seat-reservation-graphic-height": a.h,
311
- "--sbb-seat-reservation-graphic-top": s.y,
312
- "--sbb-seat-reservation-graphic-left": s.x,
308
+ "--sbb-seat-reservation-graphic-top": o.y,
309
+ "--sbb-seat-reservation-graphic-left": o.x,
313
310
  "--sbb-seat-reservation-graphic-position": "absolute",
314
- "--sbb-seat-reservation-graphic-rotation": e
311
+ "--sbb-seat-reservation-graphic-rotation": r
315
312
  })}
316
- name=${i ?? u}
313
+ name=${t ?? _}
317
314
  aria-hidden="true"
318
315
  ?stretch=${!0}
319
316
  ></sbb-seat-reservation-graphic>`;
320
317
  }
321
- _getRenderedServiceElements(r, e, t) {
322
- return t ? t?.map((a) => {
323
- const s = a.icon ? l(a.icon, this._language.current) : null, i = this.getCalculatedDimension(a.dimension), o = this.getCalculatedPosition(a.position), b = a.rotation || 0, p = this.alignVertical ? b - 90 : b, c = `popover-trigger-${e}-${r}-${o.x}-${o.y}`;
318
+ _getRenderedServiceElements(e, r, s) {
319
+ return s ? s?.map((a) => {
320
+ const o = a.icon ? c(a.icon, this._language.current) : null, t = this.getCalculatedDimension(a.dimension), i = this.getCalculatedPosition(a.position), l = a.rotation || 0, d = this.alignVertical ? l - 90 : l, b = `popover-trigger-${r}-${e}-${i.x}-${i.y}`;
324
321
  return n`
325
322
  <sbb-seat-reservation-graphic
326
- id="${c}"
323
+ id="${b}"
327
324
  style=${v({
328
- "--sbb-seat-reservation-graphic-width": i.w,
329
- "--sbb-seat-reservation-graphic-height": i.h,
330
- "--sbb-seat-reservation-graphic-top": o.y,
331
- "--sbb-seat-reservation-graphic-left": o.x,
325
+ "--sbb-seat-reservation-graphic-width": t.w,
326
+ "--sbb-seat-reservation-graphic-height": t.h,
327
+ "--sbb-seat-reservation-graphic-top": i.y,
328
+ "--sbb-seat-reservation-graphic-left": i.x,
332
329
  "--sbb-seat-reservation-graphic-position": "absolute",
333
- "--sbb-seat-reservation-graphic-rotation": p
330
+ "--sbb-seat-reservation-graphic-rotation": d
334
331
  })}
335
332
  class="sbb-seat-reservation-graphic--cursor-pointer"
336
- name=${a.icon ?? u}
333
+ name=${a.icon ?? _}
337
334
  role="img"
338
335
  aria-hidden="true"
339
336
  ></sbb-seat-reservation-graphic>
340
- ${this._popover(c, s)}
337
+ ${this._popover(b, o)}
341
338
  `;
342
339
  }) : null;
343
340
  }
@@ -346,13 +343,13 @@ let X = (() => {
346
343
  * Each selection emits an array of all selected places
347
344
  * @param selectPlaceEvent
348
345
  */
349
- _onSelectPlace(r) {
350
- const e = r.detail;
351
- this.preventCoachScrollByPlaceClick = !0, this.isCoachGridFocusable = !1, this.hasSeatReservationNativeFocus || (this.hasSeatReservationNativeFocus = !0), this.preventPlaceClick || (this.updateSelectedSeatReservationPlaces(e), this.updateCurrentSelectedPlaceInCoach(e));
346
+ _onSelectPlace(e) {
347
+ const r = e.detail;
348
+ this.preventCoachScrollByPlaceClick = !0, this.isCoachGridFocusable = !1, this.focusedCoachIndex = -1, this.hasSeatReservationNativeFocus || (this.hasSeatReservationNativeFocus = !0), this.preventPlaceClick || (this.updateSelectedSeatReservationPlaces(r), this.updateCurrentSelectedPlaceInCoach(r));
352
349
  }
353
- _onSelectNavCoach(r) {
354
- const e = r.detail;
355
- this.isKeyboardNavigation = !1, this.preventCoachScrollByPlaceClick = !1, e !== null && e !== this.currSelectedCoachIndex ? (this.unfocusPlaceElement(), this.scrollToSelectedNavCoach(e)) : e === this.currSelectedCoachIndex && (this.updateCurrentSelectedCoach(), this.preselectPlaceInCoach()), this._closePopover();
350
+ _onSelectNavCoach(e) {
351
+ const r = e.detail;
352
+ this.isKeyboardNavigation = !1, this.preventCoachScrollByPlaceClick = !1, this.hasSeatReservationNativeFocus = !0, r !== null && r !== this.currSelectedCoachIndex ? (this.unfocusPlaceElement(), this.scrollToSelectedNavCoach(r)) : r === this.currSelectedCoachIndex && (this.updateCurrentSelectedCoach(), this.preselectPlaceInCoach()), this._closePopover();
356
353
  }
357
354
  _onFocusNavCoach() {
358
355
  this.preventCoachScrollByPlaceClick ? this.focusPlaceElement(this.currSelectedPlace) : this.preselectPlaceInCoach(), this.isAutoScrolling = !1;
@@ -363,10 +360,10 @@ let X = (() => {
363
360
  * @param popoverContent
364
361
  * @private
365
362
  */
366
- _popover(r, e) {
363
+ _popover(e, r) {
367
364
  return n`
368
- <sbb-popover trigger="${r}" hover-trigger="">
369
- <p class="sbb-text-s sbb-sr-popover">${e}</p>
365
+ <sbb-popover trigger="${e}" hover-trigger="">
366
+ <p class="sbb-text-s sbb-sr-popover">${r}</p>
370
367
  </sbb-popover>
371
368
  `;
372
369
  }
@@ -375,38 +372,38 @@ let X = (() => {
375
372
  * @private
376
373
  */
377
374
  _closePopover() {
378
- this.shadowRoot?.querySelectorAll("sbb-popover:is(:state(state-opened),[state--state-opened])").forEach((r) => r.close());
375
+ this.shadowRoot?.querySelectorAll("sbb-popover:is(:state(state-opened),[state--state-opened])").forEach((e) => e.close());
379
376
  }
380
- _getDescriptionTableCoach(r) {
381
- if (!r.places?.length)
382
- return l("COACH_BLOCKED_TABLE_CAPTION", this._language.current, [
383
- r.id
377
+ _getDescriptionTableCoach(e) {
378
+ if (!e.places?.length)
379
+ return c("COACH_BLOCKED_TABLE_CAPTION", this._language.current, [
380
+ e.id
384
381
  ]);
385
- let e;
386
- const t = this._getTitleDescriptionListString(r.graphicElements), a = this._getTitleDescriptionListString(r.serviceElements);
387
- if (e = l("COACH_TABLE_CAPTION", this._language.current, [
388
- r.id
382
+ let r;
383
+ const s = this._getTitleDescriptionListString(e.graphicElements), a = this._getTitleDescriptionListString(e.serviceElements);
384
+ if (r = c("COACH_TABLE_CAPTION", this._language.current, [
385
+ e.id
389
386
  ]), !this.hasNavigation) {
390
- const s = this.getAvailableFreePlacesNumFromCoach(r.places), i = l("COACH_AVAILABLE_NUMBER_OF_PLACES", this._language.current, [s.seats, s.bicycles]);
391
- e = e.concat(". ").concat(i).concat(". ");
387
+ const o = this.getAvailableFreePlacesNumFromCoach(e.places), t = c("COACH_AVAILABLE_NUMBER_OF_PLACES", this._language.current, [o.seats, o.bicycles]);
388
+ r = r.concat(". ").concat(t).concat(". ");
392
389
  }
393
- return (t || a) && (e += ". " + l("COACH_AVAILABLE_SERVICES", this._language.current) + ": ", e += a + ", " + t + "."), e;
390
+ return (s || a) && (r += ". " + c("COACH_AVAILABLE_SERVICES", this._language.current) + ": ", r += a + ", " + s + "."), r;
394
391
  }
395
- _getTitleDescriptionListString(r) {
396
- const e = [];
397
- return r?.map((t) => {
398
- const a = t.icon;
392
+ _getTitleDescriptionListString(e) {
393
+ const r = [];
394
+ return e?.map((s) => {
395
+ const a = s.icon;
399
396
  if (!a)
400
397
  return null;
401
- const s = e.indexOf(a) > -1, i = l(t.icon, this._language.current), o = this._notFixedRotatableAreaIcons.indexOf(a) === -1 && this._notAreaElements.indexOf(a) === -1;
402
- return s || e.push(t.icon), i && !s && o ? i : null;
403
- }).filter((t) => !!t).join(", ");
398
+ const o = r.indexOf(a) > -1, t = c(s.icon, this._language.current), i = this._notFixedRotatableAreaIcons.indexOf(a) === -1 && this._notAreaElements.indexOf(a) === -1;
399
+ return o || r.push(s.icon), t && !o && i ? t : null;
400
+ }).filter((s) => !!s).join(", ");
404
401
  }
405
- }, d = h, (() => {
406
- const r = typeof Symbol == "function" && Symbol.metadata ? Object.create(k[Symbol.metadata] ?? null) : void 0;
407
- $(null, w = { value: d }, C, { kind: "class", name: d.name, metadata: r }, null, f), d = w.value, r && Object.defineProperty(d, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: r });
408
- })(), h.styles = [R, N], y(d, f), d;
402
+ }, h = p, (() => {
403
+ const e = typeof Symbol == "function" && Symbol.metadata ? Object.create(x[Symbol.metadata] ?? null) : void 0;
404
+ k(null, f = { value: h }, C, { kind: "class", name: h.name, metadata: e }, null, w), h = f.value, e && Object.defineProperty(h, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: e });
405
+ })(), p.styles = [R, T], y(h, w), h;
409
406
  })();
410
407
  export {
411
- X as SbbSeatReservationElement
408
+ Y as SbbSeatReservationElement
412
409
  };