@sbb-esta/lyne-elements-experimental 3.0.0-next.1 → 3.0.0-next.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.
- package/core/datetime/date-helper.js +142 -142
- package/core/timetable/access-leg-helper.js +49 -52
- package/core/timetable/timetable-helper.js +7 -8
- package/development/core/datetime/date-helper.js +10 -10
- package/development/core/timetable/access-leg-helper.js +12 -15
- package/development/core/timetable/timetable-helper.js +6 -7
- package/development/{differenceInMinutes-CHSyWiQs.js → differenceInMinutes-D5Nj8Stc.js} +3 -3
- package/development/{format-D0-yhzi4.js → format-BQfaa1ZT.js} +22 -26
- package/development/{isValid-Bo4R7iA7.js → isValid-DvieCZVi.js} +3 -3
- package/development/journey-summary/journey-summary.component.js +4 -5
- package/development/pearl-chain/pearl-chain.component.d.ts.map +1 -1
- package/development/pearl-chain/pearl-chain.component.js +28 -39
- package/development/pearl-chain-time/pearl-chain-time.component.js +5 -6
- package/development/pearl-chain-vertical/pearl-chain-vertical.component.js +1 -1
- package/development/pearl-chain-vertical-item/pearl-chain-vertical-item.component.js +1 -1
- package/development/seat-reservation/common/mapper/icon-mapper.js +1 -1
- package/development/seat-reservation/common/mapper/mapper.js +14 -16
- package/development/seat-reservation/common/mapper/seat-reservation-sample-data.js +1 -1
- package/development/seat-reservation/common/svgs.js +1 -1
- package/development/seat-reservation/common/translations/i18n.js +2 -3
- package/development/seat-reservation/seat-reservation/seat-reservation-base-element.js +22 -33
- package/development/seat-reservation/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.js +6 -7
- package/development/seat-reservation/seat-reservation/seat-reservation.component.js +16 -23
- package/development/seat-reservation/seat-reservation-area/seat-reservation-area.component.js +1 -1
- package/development/seat-reservation/seat-reservation-graphic/seat-reservation-assets.js +2 -3
- package/development/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +7 -8
- package/development/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +7 -11
- package/development/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.js +2 -3
- package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +4 -5
- package/development/timetable-duration/timetable-duration.component.js +1 -1
- package/development/timetable-row/timetable-row.component.js +58 -89
- package/differenceInMinutes-CP_C5onR.js +23 -0
- package/{format-Dg8rkk7h.js → format-lqeCzmzS.js} +438 -442
- package/isValid-Ceq2O0NQ.js +45 -0
- package/journey-summary/journey-summary.component.js +3 -4
- package/package.json +2 -2
- package/pearl-chain/pearl-chain.component.d.ts.map +1 -1
- package/pearl-chain/pearl-chain.component.js +78 -95
- package/pearl-chain-time/pearl-chain-time.component.js +44 -45
- package/seat-reservation/common/mapper/mapper.js +50 -54
- package/seat-reservation/common/translations/i18n.js +5 -6
- package/seat-reservation/seat-reservation/seat-reservation-base-element.js +104 -115
- package/seat-reservation/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.js +40 -41
- package/seat-reservation/seat-reservation/seat-reservation.component.js +78 -87
- package/seat-reservation/seat-reservation-graphic/seat-reservation-assets.js +15 -18
- package/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +58 -59
- package/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +71 -75
- package/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.js +12 -13
- package/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +23 -24
- package/timetable-row/timetable-row.component.js +207 -247
- package/differenceInMinutes-BMqUZdhj.js +0 -23
- package/isValid-DJ69OMZJ.js +0 -45
|
@@ -1,191 +1,191 @@
|
|
|
1
|
-
import { i18nDurationDay as
|
|
2
|
-
import { t as d, c as
|
|
3
|
-
import { n as I, d as y, i as U } from "../../isValid-
|
|
4
|
-
import { g as C, a as Y, d as F } from "../../differenceInMinutes-
|
|
5
|
-
function x(
|
|
6
|
-
const
|
|
7
|
-
return isNaN(
|
|
8
|
-
}
|
|
9
|
-
function z(
|
|
10
|
-
return
|
|
11
|
-
}
|
|
12
|
-
function H(
|
|
13
|
-
return z(
|
|
14
|
-
}
|
|
15
|
-
function S(
|
|
16
|
-
const [
|
|
17
|
-
n
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
),
|
|
21
|
-
y(
|
|
1
|
+
import { i18nDurationDay as N, i18nDurationHour as h, i18nDurationMinute as T } from "@sbb-esta/lyne-elements/core/i18n.js";
|
|
2
|
+
import { t as d, c as g, b as m, m as w } from "../../toDate-BCXKL_wM.js";
|
|
3
|
+
import { n as I, d as y, i as U } from "../../isValid-Ceq2O0NQ.js";
|
|
4
|
+
import { g as C, a as Y, d as F } from "../../differenceInMinutes-CP_C5onR.js";
|
|
5
|
+
function x(e, t, n) {
|
|
6
|
+
const i = d(e, n?.in);
|
|
7
|
+
return isNaN(t) ? g(e, NaN) : (t && i.setDate(i.getDate() + t), i);
|
|
8
|
+
}
|
|
9
|
+
function z(e, t, n) {
|
|
10
|
+
return g(e, +d(e) + t);
|
|
11
|
+
}
|
|
12
|
+
function H(e, t, n) {
|
|
13
|
+
return z(e, t * m);
|
|
14
|
+
}
|
|
15
|
+
function S(e, t, n) {
|
|
16
|
+
const [i, s] = I(
|
|
17
|
+
n?.in,
|
|
18
|
+
e,
|
|
19
|
+
t
|
|
20
|
+
), r = M(i, s), a = Math.abs(
|
|
21
|
+
y(i, s)
|
|
22
22
|
);
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
return
|
|
23
|
+
i.setDate(i.getDate() - r * a);
|
|
24
|
+
const o = +(M(i, s) === -r), u = r * (a - o);
|
|
25
|
+
return u === 0 ? 0 : u;
|
|
26
26
|
}
|
|
27
|
-
function M(
|
|
28
|
-
const n =
|
|
27
|
+
function M(e, t) {
|
|
28
|
+
const n = e.getFullYear() - t.getFullYear() || e.getMonth() - t.getMonth() || e.getDate() - t.getDate() || e.getHours() - t.getHours() || e.getMinutes() - t.getMinutes() || e.getSeconds() - t.getSeconds() || e.getMilliseconds() - t.getMilliseconds();
|
|
29
29
|
return n < 0 ? -1 : n > 0 ? 1 : n;
|
|
30
30
|
}
|
|
31
|
-
function Z(
|
|
32
|
-
const [
|
|
33
|
-
n
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
),
|
|
37
|
-
return C(n
|
|
38
|
-
}
|
|
39
|
-
function v(
|
|
40
|
-
return x(
|
|
41
|
-
}
|
|
42
|
-
function O(
|
|
43
|
-
const n = () =>
|
|
44
|
-
let
|
|
45
|
-
if (
|
|
46
|
-
const
|
|
47
|
-
|
|
31
|
+
function Z(e, t, n) {
|
|
32
|
+
const [i, s] = I(
|
|
33
|
+
n?.in,
|
|
34
|
+
e,
|
|
35
|
+
t
|
|
36
|
+
), r = (+i - +s) / m;
|
|
37
|
+
return C(n?.roundingMethod)(r);
|
|
38
|
+
}
|
|
39
|
+
function v(e, t, n) {
|
|
40
|
+
return x(e, -t, n);
|
|
41
|
+
}
|
|
42
|
+
function O(e, t) {
|
|
43
|
+
const n = () => g(t?.in, NaN), s = k(e);
|
|
44
|
+
let r;
|
|
45
|
+
if (s.date) {
|
|
46
|
+
const c = W(s.date, 2);
|
|
47
|
+
r = j(c.restDateString, c.year);
|
|
48
48
|
}
|
|
49
|
-
if (!
|
|
50
|
-
const
|
|
51
|
-
let
|
|
52
|
-
if (
|
|
49
|
+
if (!r || isNaN(+r)) return n();
|
|
50
|
+
const a = +r;
|
|
51
|
+
let o = 0, u;
|
|
52
|
+
if (s.time && (o = A(s.time), isNaN(o)))
|
|
53
53
|
return n();
|
|
54
|
-
if (
|
|
55
|
-
if (
|
|
54
|
+
if (s.timezone) {
|
|
55
|
+
if (u = E(s.timezone), isNaN(u)) return n();
|
|
56
56
|
} else {
|
|
57
|
-
const
|
|
58
|
-
return
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
),
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
),
|
|
57
|
+
const c = new Date(a + o), p = d(0, t?.in);
|
|
58
|
+
return p.setFullYear(
|
|
59
|
+
c.getUTCFullYear(),
|
|
60
|
+
c.getUTCMonth(),
|
|
61
|
+
c.getUTCDate()
|
|
62
|
+
), p.setHours(
|
|
63
|
+
c.getUTCHours(),
|
|
64
|
+
c.getUTCMinutes(),
|
|
65
|
+
c.getUTCSeconds(),
|
|
66
|
+
c.getUTCMilliseconds()
|
|
67
|
+
), p;
|
|
68
68
|
}
|
|
69
|
-
return d(
|
|
69
|
+
return d(a + o + u, t?.in);
|
|
70
70
|
}
|
|
71
71
|
const l = {
|
|
72
72
|
dateTimeDelimiter: /[T ]/,
|
|
73
73
|
timeZoneDelimiter: /[Z ]/i,
|
|
74
74
|
timezone: /([Z+-].*)$/
|
|
75
75
|
}, _ = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/, b = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/, R = /^([+-])(\d{2})(?::?(\d{2}))?$/;
|
|
76
|
-
function k(
|
|
77
|
-
const
|
|
78
|
-
let
|
|
76
|
+
function k(e) {
|
|
77
|
+
const t = {}, n = e.split(l.dateTimeDelimiter);
|
|
78
|
+
let i;
|
|
79
79
|
if (n.length > 2)
|
|
80
|
-
return
|
|
81
|
-
if (/:/.test(n[0]) ?
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
))),
|
|
85
|
-
const
|
|
86
|
-
|
|
80
|
+
return t;
|
|
81
|
+
if (/:/.test(n[0]) ? i = n[0] : (t.date = n[0], i = n[1], l.timeZoneDelimiter.test(t.date) && (t.date = e.split(l.timeZoneDelimiter)[0], i = e.substr(
|
|
82
|
+
t.date.length,
|
|
83
|
+
e.length
|
|
84
|
+
))), i) {
|
|
85
|
+
const s = l.timezone.exec(i);
|
|
86
|
+
s ? (t.time = i.replace(s[1], ""), t.timezone = s[1]) : t.time = i;
|
|
87
87
|
}
|
|
88
|
-
return
|
|
88
|
+
return t;
|
|
89
89
|
}
|
|
90
|
-
function W(
|
|
90
|
+
function W(e, t) {
|
|
91
91
|
const n = new RegExp(
|
|
92
|
-
"^(?:(\\d{4}|[+-]\\d{" + (4 +
|
|
93
|
-
),
|
|
94
|
-
if (!
|
|
95
|
-
const
|
|
92
|
+
"^(?:(\\d{4}|[+-]\\d{" + (4 + t) + "})|(\\d{2}|[+-]\\d{" + (2 + t) + "})$)"
|
|
93
|
+
), i = e.match(n);
|
|
94
|
+
if (!i) return { year: NaN, restDateString: "" };
|
|
95
|
+
const s = i[1] ? parseInt(i[1]) : null, r = i[2] ? parseInt(i[2]) : null;
|
|
96
96
|
return {
|
|
97
|
-
year:
|
|
98
|
-
restDateString:
|
|
97
|
+
year: r === null ? s : r * 100,
|
|
98
|
+
restDateString: e.slice((i[1] || i[2]).length)
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
|
-
function j(
|
|
102
|
-
if (
|
|
103
|
-
const n =
|
|
101
|
+
function j(e, t) {
|
|
102
|
+
if (t === null) return /* @__PURE__ */ new Date(NaN);
|
|
103
|
+
const n = e.match(_);
|
|
104
104
|
if (!n) return /* @__PURE__ */ new Date(NaN);
|
|
105
|
-
const
|
|
106
|
-
if (
|
|
107
|
-
return G(
|
|
105
|
+
const i = !!n[4], s = f(n[1]), r = f(n[2]) - 1, a = f(n[3]), o = f(n[4]), u = f(n[5]) - 1;
|
|
106
|
+
if (i)
|
|
107
|
+
return G(t, o, u) ? J(t, o, u) : /* @__PURE__ */ new Date(NaN);
|
|
108
108
|
{
|
|
109
|
-
const
|
|
110
|
-
return !q(
|
|
109
|
+
const c = /* @__PURE__ */ new Date(0);
|
|
110
|
+
return !q(t, r, a) || !B(t, s) ? /* @__PURE__ */ new Date(NaN) : (c.setUTCFullYear(t, r, Math.max(s, a)), c);
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
function f(
|
|
114
|
-
return
|
|
113
|
+
function f(e) {
|
|
114
|
+
return e ? parseInt(e) : 1;
|
|
115
115
|
}
|
|
116
|
-
function A(
|
|
117
|
-
const
|
|
118
|
-
if (!
|
|
119
|
-
const n =
|
|
120
|
-
return K(n,
|
|
116
|
+
function A(e) {
|
|
117
|
+
const t = e.match(b);
|
|
118
|
+
if (!t) return NaN;
|
|
119
|
+
const n = D(t[1]), i = D(t[2]), s = D(t[3]);
|
|
120
|
+
return K(n, i, s) ? n * m + i * w + s * 1e3 : NaN;
|
|
121
121
|
}
|
|
122
|
-
function
|
|
123
|
-
return
|
|
122
|
+
function D(e) {
|
|
123
|
+
return e && parseFloat(e.replace(",", ".")) || 0;
|
|
124
124
|
}
|
|
125
|
-
function E(
|
|
126
|
-
if (
|
|
127
|
-
const
|
|
128
|
-
if (!
|
|
129
|
-
const n =
|
|
130
|
-
return P(
|
|
125
|
+
function E(e) {
|
|
126
|
+
if (e === "Z") return 0;
|
|
127
|
+
const t = e.match(R);
|
|
128
|
+
if (!t) return 0;
|
|
129
|
+
const n = t[1] === "+" ? -1 : 1, i = parseInt(t[2]), s = t[3] && parseInt(t[3]) || 0;
|
|
130
|
+
return P(i, s) ? n * (i * m + s * w) : NaN;
|
|
131
131
|
}
|
|
132
|
-
function J(
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
const
|
|
136
|
-
return
|
|
132
|
+
function J(e, t, n) {
|
|
133
|
+
const i = /* @__PURE__ */ new Date(0);
|
|
134
|
+
i.setUTCFullYear(e, 0, 4);
|
|
135
|
+
const s = i.getUTCDay() || 7, r = (t - 1) * 7 + n + 1 - s;
|
|
136
|
+
return i.setUTCDate(i.getUTCDate() + r), i;
|
|
137
137
|
}
|
|
138
138
|
const V = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
139
|
-
function $(
|
|
140
|
-
return
|
|
139
|
+
function $(e) {
|
|
140
|
+
return e % 400 === 0 || e % 4 === 0 && e % 100 !== 0;
|
|
141
141
|
}
|
|
142
|
-
function q(
|
|
143
|
-
return
|
|
142
|
+
function q(e, t, n) {
|
|
143
|
+
return t >= 0 && t <= 11 && n >= 1 && n <= (V[t] || ($(e) ? 29 : 28));
|
|
144
144
|
}
|
|
145
|
-
function B(
|
|
146
|
-
return
|
|
145
|
+
function B(e, t) {
|
|
146
|
+
return t >= 1 && t <= ($(e) ? 366 : 365);
|
|
147
147
|
}
|
|
148
|
-
function G(
|
|
149
|
-
return
|
|
148
|
+
function G(e, t, n) {
|
|
149
|
+
return t >= 1 && t <= 53 && n >= 0 && n <= 6;
|
|
150
150
|
}
|
|
151
|
-
function K(
|
|
152
|
-
return
|
|
151
|
+
function K(e, t, n) {
|
|
152
|
+
return e === 24 ? t === 0 && n === 0 : n >= 0 && n < 60 && t >= 0 && t < 60 && e >= 0 && e < 25;
|
|
153
153
|
}
|
|
154
|
-
function P(
|
|
155
|
-
return
|
|
154
|
+
function P(e, t) {
|
|
155
|
+
return t >= 0 && t <= 59;
|
|
156
156
|
}
|
|
157
|
-
function Q(
|
|
158
|
-
return H(
|
|
157
|
+
function Q(e, t, n) {
|
|
158
|
+
return H(e, -t);
|
|
159
159
|
}
|
|
160
|
-
function
|
|
161
|
-
if (!
|
|
160
|
+
function nt(e) {
|
|
161
|
+
if (!e)
|
|
162
162
|
return;
|
|
163
|
-
const
|
|
164
|
-
if (U(
|
|
165
|
-
if (
|
|
166
|
-
return new Date(
|
|
167
|
-
if (
|
|
168
|
-
const n =
|
|
163
|
+
const t = O(e);
|
|
164
|
+
if (U(t)) {
|
|
165
|
+
if (e.includes("Z"))
|
|
166
|
+
return new Date(e.replace("Z", ""));
|
|
167
|
+
if (e.includes("T")) {
|
|
168
|
+
const n = e.split("T");
|
|
169
169
|
if (n[1] && (n[1].includes("+") || n[1].includes("-")))
|
|
170
170
|
return /* @__PURE__ */ new Date(`${n[0]}T${n[1].split(/[+-]/)[0]}`);
|
|
171
171
|
}
|
|
172
|
-
return new Date(
|
|
172
|
+
return new Date(e);
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
|
-
const
|
|
176
|
-
const n = [],
|
|
177
|
-
let
|
|
178
|
-
const
|
|
179
|
-
|
|
180
|
-
const
|
|
181
|
-
|
|
182
|
-
const
|
|
183
|
-
return
|
|
175
|
+
const it = (e, t) => {
|
|
176
|
+
const n = [], i = [];
|
|
177
|
+
let r = Y(0, e);
|
|
178
|
+
const a = S(r, 0);
|
|
179
|
+
a > 0 && (n.push(`${a} d`), t && i.push(`${a} ${a > 1 ? N.multiple.long[t] : N.single.long[t]}`), r = v(r, a));
|
|
180
|
+
const o = Z(r, 0);
|
|
181
|
+
o > 0 && (n.push(`${o} h`), t && i.push(`${o} ${o > 1 ? h.multiple.long[t] : h.single.long[t]}`), r = Q(r, o));
|
|
182
|
+
const u = F(r, 0);
|
|
183
|
+
return u > 0 && (n.push(`${u} min`), t && i.push(`${u} ${u > 1 ? T.multiple.long[t] : T.single.long[t]}`)), {
|
|
184
184
|
short: n.join(" "),
|
|
185
|
-
long:
|
|
185
|
+
long: i.join(" ")
|
|
186
186
|
};
|
|
187
187
|
};
|
|
188
188
|
export {
|
|
189
|
-
|
|
190
|
-
|
|
189
|
+
it as durationToTime,
|
|
190
|
+
nt as removeTimezoneFromISOTimeString
|
|
191
191
|
};
|
|
@@ -1,42 +1,39 @@
|
|
|
1
|
-
import { i18nWalkingDistanceDeparture as
|
|
2
|
-
import { nothing as
|
|
3
|
-
import { isRideLeg as
|
|
1
|
+
import { i18nWalkingDistanceDeparture as T, i18nWalkingDistanceArrival as h } from "@sbb-esta/lyne-elements/core/i18n.js";
|
|
2
|
+
import { nothing as u, html as f } from "lit";
|
|
3
|
+
import { isRideLeg as $, isConnectionLeg as L, extractTimeAndStringFromNoticeText as k } from "./timetable-helper.js";
|
|
4
4
|
import "@sbb-esta/lyne-elements/icon.js";
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
text: ((r = i == null ? void 0 : i.text) == null ? void 0 : r.template) || "",
|
|
5
|
+
function g(t, r) {
|
|
6
|
+
const i = L(t) ? t : null, n = i ? i?.notices?.filter((e) => r.includes(e.name))[0] : null;
|
|
7
|
+
return n ? {
|
|
8
|
+
duration: i?.duration || 0,
|
|
9
|
+
text: n?.text?.template || "",
|
|
11
10
|
icon: "walk-small"
|
|
12
11
|
} : null;
|
|
13
12
|
}
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
const e = h(t) ? (l = (c = t == null ? void 0 : t.serviceJourney) == null ? void 0 : c.notices) == null ? void 0 : l.filter((u) => ["CI"].includes(u.name))[0] : null, r = e && C(e);
|
|
13
|
+
function M(t, r, i, n) {
|
|
14
|
+
const e = $(t) ? t?.serviceJourney?.notices?.filter((m) => ["CI"].includes(m.name))[0] : null, c = e && k(e);
|
|
17
15
|
return e ? {
|
|
18
|
-
duration: (
|
|
19
|
-
text:
|
|
20
|
-
icon:
|
|
16
|
+
duration: (c?.duration || 0) + (r || 0),
|
|
17
|
+
text: i ? T[n] : c?.text || "",
|
|
18
|
+
icon: i ? "wheelchair-small" : `sa-${e?.name?.toLowerCase()}`
|
|
21
19
|
} : null;
|
|
22
20
|
}
|
|
23
|
-
function
|
|
24
|
-
|
|
25
|
-
const e = h(t) ? (l = (c = t == null ? void 0 : t.serviceJourney) == null ? void 0 : c.notices) == null ? void 0 : l.filter((u) => ["CO"].includes(u.name))[0] : null, r = e && C(e);
|
|
21
|
+
function N(t, r, i, n) {
|
|
22
|
+
const e = $(t) ? t?.serviceJourney?.notices?.filter((m) => ["CO"].includes(m.name))[0] : null, c = e && k(e);
|
|
26
23
|
return e ? {
|
|
27
|
-
duration: (
|
|
28
|
-
text:
|
|
29
|
-
icon:
|
|
24
|
+
duration: (c?.duration || 0) + (r || 0),
|
|
25
|
+
text: i ? h[n] : c?.text || "",
|
|
26
|
+
icon: i ? "wheelchair-small" : `sa-${e?.name?.toLowerCase()}`
|
|
30
27
|
} : null;
|
|
31
28
|
}
|
|
32
|
-
function
|
|
29
|
+
function _(t, r, i, n, e) {
|
|
33
30
|
return f`
|
|
34
|
-
<span class="sbb-pearl-chain__time-transfer sbb-pearl-chain__time-transfer--${
|
|
35
|
-
<sbb-icon name=${
|
|
31
|
+
<span class="sbb-pearl-chain__time-transfer sbb-pearl-chain__time-transfer--${r}-${e}">
|
|
32
|
+
<sbb-icon name=${r}></sbb-icon>
|
|
36
33
|
<time datetime=${t + "M"}>
|
|
37
34
|
<span class="sbb-screen-reader-only">
|
|
38
|
-
${!
|
|
39
|
-
${
|
|
35
|
+
${!n && e ? e === "departure" ? T[i] : h[i] : u}
|
|
36
|
+
${n ? f`<span>${n}</span>` : u}
|
|
40
37
|
</span>
|
|
41
38
|
${t}
|
|
42
39
|
<span class="sbb-pearl-chain__time-walktime-prime-symbol" aria-hidden="true">'</span>
|
|
@@ -45,50 +42,50 @@ function v(t, a, n, i, e) {
|
|
|
45
42
|
</span>
|
|
46
43
|
`;
|
|
47
44
|
}
|
|
48
|
-
function p(t,
|
|
45
|
+
function p(t, r, i, n) {
|
|
49
46
|
return f`
|
|
50
|
-
<span class="sbb-pearl-chain__time-walktime sbb-pearl-chain__time-walktime--${
|
|
51
|
-
<sbb-icon name=${
|
|
47
|
+
<span class="sbb-pearl-chain__time-walktime sbb-pearl-chain__time-walktime--${n}-${i}">
|
|
48
|
+
<sbb-icon name=${n}></sbb-icon>
|
|
52
49
|
<time datetime=${t + "M"}>
|
|
53
|
-
<span class="sbb-screen-reader-only">${
|
|
50
|
+
<span class="sbb-screen-reader-only">${r}</span>
|
|
54
51
|
${t}
|
|
55
52
|
<span class="sbb-pearl-chain__time-walktime-prime-symbol" aria-hidden="true">'</span>
|
|
56
53
|
</time>
|
|
57
54
|
</span>
|
|
58
55
|
`;
|
|
59
56
|
}
|
|
60
|
-
function
|
|
61
|
-
const
|
|
62
|
-
text:
|
|
63
|
-
duration:
|
|
57
|
+
function B(t, r, i, n, e) {
|
|
58
|
+
const c = t && t.filter((w) => $(w) || L(w))[0], m = ["YM", "YB", "Y", "YT"], o = g(c, m), s = M(c, r, e, n), d = r ? {
|
|
59
|
+
text: T[n],
|
|
60
|
+
duration: r,
|
|
64
61
|
icon: e ? "wheelchair-small" : "walk-small"
|
|
65
|
-
} : null,
|
|
66
|
-
function
|
|
62
|
+
} : null, v = () => o || (d && !s && !o ? d : s || null);
|
|
63
|
+
function C() {
|
|
67
64
|
return f`
|
|
68
|
-
${
|
|
69
|
-
${
|
|
70
|
-
${s ? e ? p(s.duration, s.text, "left", s.icon) :
|
|
65
|
+
${o ? p(o.duration, o.text, "left", o.icon) : u}
|
|
66
|
+
${d && !s && !o ? p(d.duration, d.text, "left", d.icon) : u}
|
|
67
|
+
${s ? e ? p(s.duration, s.text, "left", s.icon) : _(s.duration, s.icon, n, s.text, "departure") : u}
|
|
71
68
|
`;
|
|
72
69
|
}
|
|
73
|
-
const
|
|
74
|
-
text:
|
|
75
|
-
duration:
|
|
70
|
+
const A = t && t[t.length - 1], x = (L(A) || $(A)) && A, l = x && g(x, m), a = x && N(x, i, e, n), b = i ? {
|
|
71
|
+
text: h[n],
|
|
72
|
+
duration: i,
|
|
76
73
|
icon: e ? "wheelchair-small" : "walk-small"
|
|
77
|
-
} : null,
|
|
78
|
-
function
|
|
74
|
+
} : null, D = () => l || (b && !a && !l ? b : a || null);
|
|
75
|
+
function Y() {
|
|
79
76
|
return f`
|
|
80
|
-
${
|
|
81
|
-
${
|
|
82
|
-
${
|
|
77
|
+
${l ? p(l.duration, l.text, "right", l.icon) : u}
|
|
78
|
+
${b && !a && !l ? p(b.duration, b.text, "right", b.icon) : u}
|
|
79
|
+
${a ? e ? p(a.duration, a.text, "right", a.icon) : _(a.duration, a.icon, n, a.text, "arrival") : u}
|
|
83
80
|
`;
|
|
84
81
|
}
|
|
85
82
|
return {
|
|
86
|
-
renderDepartureTimeAttribute:
|
|
87
|
-
renderArrivalTimeAttribute:
|
|
88
|
-
departureTimeAttribute:
|
|
89
|
-
arrivalTimeAttribute:
|
|
83
|
+
renderDepartureTimeAttribute: C,
|
|
84
|
+
renderArrivalTimeAttribute: Y,
|
|
85
|
+
departureTimeAttribute: v(),
|
|
86
|
+
arrivalTimeAttribute: D()
|
|
90
87
|
};
|
|
91
88
|
}
|
|
92
89
|
export {
|
|
93
|
-
|
|
90
|
+
B as getDepartureArrivalTimeAttribute
|
|
94
91
|
};
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
const d = ((e = t == null ? void 0 : t.text) == null ? void 0 : e.template) && t.text.template.indexOf("(") + 1, r = (a = (s = t == null ? void 0 : t.text) == null ? void 0 : s.template) == null ? void 0 : a.substring(d || 0, (x = t == null ? void 0 : t.text) == null ? void 0 : x.template.indexOf(")"));
|
|
1
|
+
const r = (t) => t?.__typename === "PTRideLeg", i = (t) => t?.__typename === "PTConnectionLeg", s = (t) => {
|
|
2
|
+
const n = t?.text?.template && t.text.template.indexOf("(") + 1, e = t?.text?.template?.substring(n || 0, t?.text?.template.indexOf(")"));
|
|
4
3
|
return {
|
|
5
|
-
duration:
|
|
6
|
-
text:
|
|
4
|
+
duration: e && +e.substring(0, e.length - 1) || 0,
|
|
5
|
+
text: t?.text?.template?.split("(")[0] || ""
|
|
7
6
|
};
|
|
8
7
|
};
|
|
9
8
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
s as extractTimeAndStringFromNoticeText,
|
|
10
|
+
i as isConnectionLeg,
|
|
11
|
+
r as isRideLeg
|
|
13
12
|
};
|