@odynn/awayz-flights 0.9.7 → 0.9.9
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/dist/BookingOption-V-FzaupW.js +196 -0
- package/dist/FlightItinerary-C4KPpVcF.js +94 -0
- package/dist/assets/FlightItinerary.css +1 -1
- package/dist/assets/FlightItineraryDropdown.css +1 -0
- package/dist/assets/MiniFlightItinerary.css +1 -0
- package/dist/assets/_styles.css +1 -1
- package/dist/assets/_styles2.css +1 -1
- package/dist/components/BookingOption/BookingOption.js +3 -4
- package/dist/components/Dialog/Dialog.js +1 -1
- package/dist/components/FlightItinerary/FlightItinerary.js +3 -4
- package/dist/components/FlightItineraryDropdown/FlightItineraryDropdown.js +22 -30
- package/dist/components/FlightResult/FlightResult.js +173 -183
- package/dist/components/HorizontalScroller/HorizontalScroller.js +3 -3
- package/dist/components/MiniFlightItinerary/MiniFlightItinerary.js +89 -7
- package/dist/components/index.js +5 -5
- package/dist/constants/endpoints.js +1 -1
- package/dist/enums-tLvxh02p.js +4 -0
- package/dist/hooks/index.js +3 -3
- package/dist/hooks/useFlightSearch/useFlightSearch.js +420 -11
- package/dist/{index-D8ljJLcr.js → index-9LVJi5JO.js} +7 -7
- package/dist/index-Kopwbl-x.js +19 -0
- package/dist/lib/components/FlightItinerary/FlightItinerary.d.ts +1 -6
- package/dist/lib/components/FlightItineraryDropdown/FlightItineraryDropdown.d.ts +2 -4
- package/dist/lib/constants/endpoints.d.ts +2 -1
- package/dist/lib/services/flights/FlightsService.d.ts +1 -0
- package/dist/main.js +35 -34
- package/dist/services/flights/FlightsService.js +37 -28
- package/dist/utils/flightUtils.js +39 -40
- package/package.json +1 -1
- package/dist/BookingOption-BTupJyHW.js +0 -192
- package/dist/FlightItinerary-BYXRMQUD.js +0 -262
- package/dist/MiniFlightItinerary-D2tFssaK.js +0 -106
- package/dist/assets/_styles5.css +0 -1
- package/dist/index-Gj4bRuCQ.js +0 -15
- package/dist/index-nI16-czT.js +0 -4
- package/dist/useFlightSearch-Dxoeykpk.js +0 -420
|
@@ -1,101 +1,100 @@
|
|
|
1
|
-
import { jsx as r, jsxs as n, Fragment as
|
|
2
|
-
import { useAwayzContext as
|
|
3
|
-
import { useQuery as
|
|
4
|
-
import { p as
|
|
5
|
-
import { g as
|
|
1
|
+
import { jsx as r, jsxs as n, Fragment as L } from "react/jsx-runtime";
|
|
2
|
+
import { useAwayzContext as Fe, useFeatureFlags as Pe, RewardsService as Y, EAmountsDisplayFeature as u, CashValue as Q, EToolTipPosition as j, ClientPointsValue as Ee, EInvalidAmountDisplayOption as Te, awayzClient as ne, EFlightBookingOptionsDisplayFeature as G, CurrencyService as Ae } from "@odynn/awayz-core";
|
|
3
|
+
import { useQuery as De } from "@tanstack/react-query";
|
|
4
|
+
import { p as w, c as Oe, B as J } from "../../BookingOption-V-FzaupW.js";
|
|
5
|
+
import { g as X } from "../../dateUtils-Cb9VQiIL.js";
|
|
6
6
|
import "../../arrayExtensions-Ce8YopTP.js";
|
|
7
|
-
import { E as H } from "../../
|
|
8
|
-
import {
|
|
9
|
-
import { useRef as
|
|
10
|
-
import { h as
|
|
11
|
-
import { useTranslation as
|
|
12
|
-
import {
|
|
13
|
-
import { EPaymentType as
|
|
14
|
-
import
|
|
15
|
-
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
queryKey: [H.CONVERT_CURRENCY, m, c],
|
|
7
|
+
import { E as H } from "../../enums-tLvxh02p.js";
|
|
8
|
+
import { E as T, F as Z } from "../../FlightItinerary-C4KPpVcF.js";
|
|
9
|
+
import { useRef as be, useState as A, useMemo as v, useEffect as k } from "react";
|
|
10
|
+
import { h as g } from "../../moment-BGjjqtLQ.js";
|
|
11
|
+
import { useTranslation as Ce } from "react-i18next";
|
|
12
|
+
import { b as W, c as _e, d as Se, e as Ie, f as x } from "../../index-9LVJi5JO.js";
|
|
13
|
+
import { EPaymentType as d } from "../../enums/EPaymentType.js";
|
|
14
|
+
import { DEFAULT_AIRLINE_PROGRAM as B, getFlightNumber as Re, getLogoPath as Le, getAirlineProgram as ke } from "../../utils/flightUtils.js";
|
|
15
|
+
import ee from "../Dialog/Dialog.js";
|
|
16
|
+
import ie from "../HorizontalScroller/HorizontalScroller.js";
|
|
17
|
+
import '../../assets/_styles.css';/* empty css */
|
|
18
|
+
const xe = (...e) => e.join(" ");
|
|
19
|
+
async function re(e, h, l) {
|
|
20
|
+
if (!e || h === l) return e;
|
|
21
|
+
const t = await ne.ensureQueryData({
|
|
22
|
+
queryKey: [H.CONVERT_CURRENCY, h, l],
|
|
24
23
|
staleTime: 1e3 * 60 * 60,
|
|
25
24
|
// 1 hour
|
|
26
|
-
queryFn: () =>
|
|
27
|
-
baseCurrency:
|
|
28
|
-
targetCurrency:
|
|
25
|
+
queryFn: () => Ae.convertCurrency({
|
|
26
|
+
baseCurrency: h,
|
|
27
|
+
targetCurrency: l
|
|
29
28
|
})
|
|
30
29
|
});
|
|
31
|
-
return e *
|
|
30
|
+
return e * t;
|
|
32
31
|
}
|
|
33
|
-
const
|
|
32
|
+
const Be = ({
|
|
34
33
|
details: e,
|
|
35
|
-
onClick:
|
|
36
|
-
showBestValue:
|
|
37
|
-
onShowBestValueCalculation:
|
|
38
|
-
customStyling:
|
|
39
|
-
customCashComponent:
|
|
40
|
-
customPointsComponent:
|
|
41
|
-
onBookWithCash:
|
|
34
|
+
onClick: h,
|
|
35
|
+
showBestValue: l = !1,
|
|
36
|
+
onShowBestValueCalculation: t,
|
|
37
|
+
customStyling: se = !1,
|
|
38
|
+
customCashComponent: ae,
|
|
39
|
+
customPointsComponent: te,
|
|
40
|
+
onBookWithCash: D,
|
|
42
41
|
onBookWithPoints: O
|
|
43
42
|
}) => {
|
|
44
|
-
const { t:
|
|
43
|
+
const { t: N } = Ce(), b = be(null), [U, ce] = A(!1), [F, le] = A(
|
|
45
44
|
"none"
|
|
46
45
|
/* NONE */
|
|
47
|
-
), [
|
|
48
|
-
() =>
|
|
49
|
-
[
|
|
50
|
-
),
|
|
51
|
-
() =>
|
|
52
|
-
[
|
|
53
|
-
),
|
|
54
|
-
var i =
|
|
46
|
+
), [oe, me] = A(!1), { config: C } = Fe(), pe = e.origin, he = e.destination, P = e.flightDetails, m = e.paymentOptions || [], { featureFlags: p } = Pe(), _ = v(
|
|
47
|
+
() => m.filter((i) => i.points === -1),
|
|
48
|
+
[m]
|
|
49
|
+
), S = v(
|
|
50
|
+
() => m.filter((i) => i.points > -1),
|
|
51
|
+
[m]
|
|
52
|
+
), $ = m.filter((i) => i.points === -1).length === 1, ge = m.filter((i) => i.points > -1).length === 1, [fe, M] = A(B), c = v(() => {
|
|
53
|
+
var i = m.filter((s) => s.points > -1).sort((s, a) => s.points - a.points);
|
|
55
54
|
return i.find(
|
|
56
55
|
(s) => s.program === e.airlineProgram
|
|
57
56
|
) || i[0];
|
|
58
|
-
}, [
|
|
59
|
-
if (!
|
|
60
|
-
M(
|
|
57
|
+
}, [m, e.airlineProgram]), ue = async () => {
|
|
58
|
+
if (!c) {
|
|
59
|
+
M(B);
|
|
61
60
|
return;
|
|
62
61
|
}
|
|
63
|
-
const i = await
|
|
62
|
+
const i = await ke(c.program);
|
|
64
63
|
M(i);
|
|
65
64
|
};
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}, [
|
|
69
|
-
const { flightNumbers:
|
|
65
|
+
k(() => {
|
|
66
|
+
ue();
|
|
67
|
+
}, [c]);
|
|
68
|
+
const { flightNumbers: de, airlines: y } = v(() => {
|
|
70
69
|
const i = [], s = [];
|
|
71
|
-
return e.flightDetails.slices.forEach((
|
|
72
|
-
|
|
73
|
-
const
|
|
74
|
-
i.includes(
|
|
75
|
-
const
|
|
76
|
-
s.some((
|
|
77
|
-
logo:
|
|
78
|
-
airline:
|
|
70
|
+
return e.flightDetails.slices.forEach((a) => {
|
|
71
|
+
a.segments.forEach((o) => {
|
|
72
|
+
const f = Re(o);
|
|
73
|
+
i.includes(f) || i.push(f);
|
|
74
|
+
const E = o.operatingCarrier;
|
|
75
|
+
s.some((R) => R.airline === E.name) || s.push({
|
|
76
|
+
logo: Le(E.iataCode),
|
|
77
|
+
airline: E.name
|
|
79
78
|
});
|
|
80
79
|
});
|
|
81
80
|
}), { flightNumbers: i, airlines: s };
|
|
82
81
|
}, [e.flightDetails.slices]), Ne = () => {
|
|
83
|
-
|
|
84
|
-
},
|
|
85
|
-
queryKey: [H.VALUE_CENTS,
|
|
86
|
-
queryFn: () => Y.getCentPerPoint(
|
|
82
|
+
p.flightBookingOptionsDisplayFeature === G.SHEET || e.partial ? e.cash > 0 ? h(e, d.CASH) : h(e, d.POINTS) : K();
|
|
83
|
+
}, I = e == null ? void 0 : e.airlineProgram, { data: V } = De({
|
|
84
|
+
queryKey: [H.VALUE_CENTS, I, "test"],
|
|
85
|
+
queryFn: () => Y.getCentPerPoint(I),
|
|
87
86
|
staleTime: 1 / 0,
|
|
88
|
-
enabled: !!
|
|
89
|
-
}),
|
|
87
|
+
enabled: !!I && l
|
|
88
|
+
}), q = v(() => {
|
|
90
89
|
var i, s;
|
|
91
90
|
return (s = (i = e.paymentOptions) == null ? void 0 : i.find(
|
|
92
|
-
(
|
|
91
|
+
(a) => {
|
|
93
92
|
var o;
|
|
94
|
-
return
|
|
93
|
+
return a.program === e.airlineProgram && ((o = a.cashFee) == null ? void 0 : o.amount) !== 0;
|
|
95
94
|
}
|
|
96
95
|
)) == null ? void 0 : s.cashFee;
|
|
97
|
-
}, [e.paymentOptions, e.airlineProgram]),
|
|
98
|
-
if (!e || !
|
|
96
|
+
}, [e.paymentOptions, e.airlineProgram]), ye = async () => {
|
|
97
|
+
if (!e || !V || !e.points || !e.cash)
|
|
99
98
|
return;
|
|
100
99
|
const i = e.currency;
|
|
101
100
|
let s = {
|
|
@@ -103,65 +102,62 @@ const ri = ({
|
|
|
103
102
|
currency: i
|
|
104
103
|
};
|
|
105
104
|
try {
|
|
106
|
-
s = await
|
|
105
|
+
s = await ne.ensureQueryData({
|
|
107
106
|
queryKey: [H.VALUE_CENTS, e.airlineProgram],
|
|
108
107
|
staleTime: 1e3 * 60 * 60,
|
|
109
108
|
// 1 hour
|
|
110
109
|
queryFn: () => Y.getCentPerPoint(e.airlineProgram)
|
|
111
110
|
});
|
|
112
|
-
} catch (
|
|
111
|
+
} catch (ve) {
|
|
113
112
|
console.warn(
|
|
114
113
|
"Failed to fetch value cents for airline program:",
|
|
115
114
|
e.airlineProgram,
|
|
116
|
-
|
|
115
|
+
ve
|
|
117
116
|
);
|
|
118
117
|
}
|
|
119
|
-
const
|
|
118
|
+
const a = q ?? {
|
|
120
119
|
amount: 0,
|
|
121
120
|
currency: i
|
|
122
|
-
}, [o,
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
121
|
+
}, [o, f] = await Promise.all([
|
|
122
|
+
re(
|
|
123
|
+
a.amount,
|
|
124
|
+
a.currency,
|
|
126
125
|
i
|
|
127
126
|
),
|
|
128
|
-
|
|
127
|
+
re(
|
|
129
128
|
s.valueCents,
|
|
130
129
|
s.currency,
|
|
131
130
|
i
|
|
132
131
|
)
|
|
133
|
-
]),
|
|
134
|
-
|
|
135
|
-
|
|
132
|
+
]), R = f * e.points / 100 + o < e.cash;
|
|
133
|
+
le(
|
|
134
|
+
R ? "points" : "cash"
|
|
136
135
|
/* CASH */
|
|
137
136
|
);
|
|
138
137
|
};
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
}, [e,
|
|
142
|
-
const i =
|
|
143
|
-
if (!(i.year() ===
|
|
144
|
-
const o = i.diff(s),
|
|
145
|
-
|
|
138
|
+
k(() => {
|
|
139
|
+
ye();
|
|
140
|
+
}, [e, V, q]), k(() => {
|
|
141
|
+
const i = g(e.expiresAt), s = g();
|
|
142
|
+
if (!(i.year() === g(0).year()) && i.isAfter(s)) {
|
|
143
|
+
const o = i.diff(s), f = setTimeout(() => {
|
|
144
|
+
me(!0);
|
|
146
145
|
}, o);
|
|
147
146
|
return () => {
|
|
148
|
-
clearTimeout(
|
|
147
|
+
clearTimeout(f);
|
|
149
148
|
};
|
|
150
149
|
}
|
|
151
150
|
}, [e.expiresAt]);
|
|
152
|
-
const z = (i, s,
|
|
153
|
-
i.stopPropagation(),
|
|
151
|
+
const z = (i, s, a) => {
|
|
152
|
+
i.stopPropagation(), p.flightBookingOptionsDisplayFeature === G.SHEET || a.partial ? h(a, s) : K();
|
|
154
153
|
}, K = () => {
|
|
155
154
|
const i = !U;
|
|
156
|
-
|
|
157
|
-
}
|
|
158
|
-
e.departureTime,
|
|
159
|
-
e.arrivalTime
|
|
160
|
-
);
|
|
155
|
+
ce(i), i && b.current && b.current.scrollIntoView({ behavior: "smooth" });
|
|
156
|
+
};
|
|
161
157
|
return /* @__PURE__ */ r(
|
|
162
158
|
"div",
|
|
163
159
|
{
|
|
164
|
-
className: `${
|
|
160
|
+
className: `${se ? "" : "awayz-"}flight-result`,
|
|
165
161
|
onClick: Ne,
|
|
166
162
|
children: /* @__PURE__ */ n("div", { className: "content", children: [
|
|
167
163
|
/* @__PURE__ */ n("div", { className: "flight-info", children: [
|
|
@@ -170,28 +166,28 @@ const ri = ({
|
|
|
170
166
|
/* @__PURE__ */ r(
|
|
171
167
|
"img",
|
|
172
168
|
{
|
|
173
|
-
src:
|
|
174
|
-
alt:
|
|
175
|
-
onError: (i) => i.currentTarget.src = (
|
|
169
|
+
src: y[0].logo,
|
|
170
|
+
alt: y[0].airline,
|
|
171
|
+
onError: (i) => i.currentTarget.src = (C == null ? void 0 : C.logoFallbackImageUrl) ?? ""
|
|
176
172
|
}
|
|
177
173
|
),
|
|
178
174
|
/* @__PURE__ */ n("div", { children: [
|
|
179
175
|
/* @__PURE__ */ n("p", { children: [
|
|
180
|
-
|
|
181
|
-
|
|
176
|
+
y[0].airline,
|
|
177
|
+
y.length > 1 && /* @__PURE__ */ n("sup", { className: "multiple-airlines", children: [
|
|
182
178
|
"+",
|
|
183
|
-
|
|
179
|
+
y.length - 1
|
|
184
180
|
] })
|
|
185
181
|
] }),
|
|
186
|
-
/* @__PURE__ */ r("p", { children:
|
|
182
|
+
/* @__PURE__ */ r("p", { children: de[0] })
|
|
187
183
|
] })
|
|
188
184
|
] }),
|
|
189
185
|
/* @__PURE__ */ n("div", { className: "flight-times", children: [
|
|
190
186
|
/* @__PURE__ */ n("div", { className: "flight-duration", children: [
|
|
191
|
-
/* @__PURE__ */ r(
|
|
192
|
-
/* @__PURE__ */ r("p", { children:
|
|
187
|
+
/* @__PURE__ */ r(W, {}),
|
|
188
|
+
/* @__PURE__ */ r("p", { children: X(P.slices[0].duration) })
|
|
193
189
|
] }),
|
|
194
|
-
/* @__PURE__ */ r("p", { children: e.numberOfStops > 0 ? `${e.numberOfStops} ${
|
|
190
|
+
/* @__PURE__ */ r("p", { children: e.numberOfStops > 0 ? `${e.numberOfStops} ${w(
|
|
195
191
|
e.numberOfStops,
|
|
196
192
|
"Stop"
|
|
197
193
|
)}` : "Direct" })
|
|
@@ -199,106 +195,100 @@ const ri = ({
|
|
|
199
195
|
] }),
|
|
200
196
|
/* @__PURE__ */ n("div", { className: "flight-info-content", children: [
|
|
201
197
|
/* @__PURE__ */ n("div", { className: "flight-info-times", children: [
|
|
198
|
+
/* @__PURE__ */ r("p", { className: "flight-info-date", children: g(e.departureTime).format(
|
|
199
|
+
N(T.DISPLAY_MEDIUM)
|
|
200
|
+
) }),
|
|
202
201
|
/* @__PURE__ */ n("p", { className: "flight-info-time", children: [
|
|
203
|
-
|
|
204
|
-
|
|
202
|
+
g(e.departureTime).format(
|
|
203
|
+
N(T.TIME_ONLY)
|
|
205
204
|
),
|
|
206
205
|
" "
|
|
207
206
|
] }),
|
|
208
207
|
/* @__PURE__ */ n("div", { className: "flight-location", children: [
|
|
209
208
|
/* @__PURE__ */ r("div", { className: "flight-location-icon", children: /* @__PURE__ */ r(_e, {}) }),
|
|
210
|
-
/* @__PURE__ */ r("p", { children:
|
|
209
|
+
/* @__PURE__ */ r("p", { children: pe.airportCode })
|
|
211
210
|
] })
|
|
212
211
|
] }),
|
|
213
212
|
/* @__PURE__ */ n("div", { className: "flight-icon", children: [
|
|
214
|
-
/* @__PURE__ */ r("span", { children: /* @__PURE__ */ r(
|
|
213
|
+
/* @__PURE__ */ r("span", { children: /* @__PURE__ */ r(Se, {}) }),
|
|
215
214
|
/* @__PURE__ */ n("div", { className: "flight-times", children: [
|
|
216
215
|
/* @__PURE__ */ n("div", { className: "flight-duration", children: [
|
|
217
|
-
/* @__PURE__ */ r(
|
|
218
|
-
/* @__PURE__ */ r("p", { children:
|
|
216
|
+
/* @__PURE__ */ r(W, {}),
|
|
217
|
+
/* @__PURE__ */ r("p", { children: X(P.slices[0].duration) })
|
|
219
218
|
] }),
|
|
220
|
-
/* @__PURE__ */ r("p", { children: e.numberOfStops > 0 ? `${e.numberOfStops} ${
|
|
219
|
+
/* @__PURE__ */ r("p", { children: e.numberOfStops > 0 ? `${e.numberOfStops} ${w(
|
|
221
220
|
e.numberOfStops,
|
|
222
221
|
"Stop"
|
|
223
222
|
)}` : "Direct" })
|
|
224
223
|
] }),
|
|
225
224
|
/* @__PURE__ */ r(
|
|
226
|
-
|
|
225
|
+
ee,
|
|
227
226
|
{
|
|
228
227
|
title: "Flight Details",
|
|
229
|
-
trigger: /* @__PURE__ */ r("p", { className: "view-flight-details", children: "
|
|
230
|
-
children: /* @__PURE__ */ r(
|
|
231
|
-
B,
|
|
232
|
-
{
|
|
233
|
-
itinerary: v.slices[0].segments,
|
|
234
|
-
origin: C,
|
|
235
|
-
destination: S,
|
|
236
|
-
isMultiDayFlight: Q
|
|
237
|
-
}
|
|
238
|
-
)
|
|
228
|
+
trigger: /* @__PURE__ */ r("p", { className: "view-flight-details", children: "Flight Details" }),
|
|
229
|
+
children: /* @__PURE__ */ r(Z, { itinerary: P.slices[0].segments })
|
|
239
230
|
}
|
|
240
231
|
)
|
|
241
232
|
] }),
|
|
242
233
|
/* @__PURE__ */ n("div", { className: "flight-info-times", children: [
|
|
234
|
+
/* @__PURE__ */ r("p", { className: "flight-info-date", children: g(e.arrivalTime).format(
|
|
235
|
+
N(T.DISPLAY_MEDIUM)
|
|
236
|
+
) }),
|
|
243
237
|
/* @__PURE__ */ n("p", { className: "flight-info-time", children: [
|
|
244
|
-
|
|
245
|
-
|
|
238
|
+
g(e.arrivalTime).format(
|
|
239
|
+
N(T.TIME_ONLY)
|
|
246
240
|
),
|
|
247
241
|
" "
|
|
248
242
|
] }),
|
|
249
243
|
/* @__PURE__ */ n("div", { className: "flight-location", children: [
|
|
250
|
-
/* @__PURE__ */ r("p", { children:
|
|
251
|
-
/* @__PURE__ */ r("div", { className: "flight-location-icon", children: /* @__PURE__ */ r(
|
|
244
|
+
/* @__PURE__ */ r("p", { children: he.airportCode }),
|
|
245
|
+
/* @__PURE__ */ r("div", { className: "flight-location-icon", children: /* @__PURE__ */ r(Ie, {}) })
|
|
252
246
|
] })
|
|
253
247
|
] })
|
|
254
248
|
] })
|
|
255
249
|
] }),
|
|
256
250
|
/* @__PURE__ */ n("div", { className: "flight-footer", children: [
|
|
257
251
|
/* @__PURE__ */ r(
|
|
258
|
-
|
|
252
|
+
ee,
|
|
259
253
|
{
|
|
260
254
|
title: "Flight Details",
|
|
261
255
|
trigger: /* @__PURE__ */ r("p", { className: "view-flight-details", children: "View Flight Details" }),
|
|
262
|
-
children: /* @__PURE__ */ r(
|
|
263
|
-
B,
|
|
264
|
-
{
|
|
265
|
-
itinerary: v.slices[0].segments,
|
|
266
|
-
origin: C,
|
|
267
|
-
destination: S,
|
|
268
|
-
isMultiDayFlight: Q
|
|
269
|
-
}
|
|
270
|
-
)
|
|
256
|
+
children: /* @__PURE__ */ r(Z, { itinerary: P.slices[0].segments })
|
|
271
257
|
}
|
|
272
258
|
),
|
|
273
|
-
/* @__PURE__ */ r("div", { className: "booking-options", children:
|
|
274
|
-
/* @__PURE__ */ r("span", { children: /* @__PURE__ */ r(
|
|
259
|
+
/* @__PURE__ */ r("div", { className: "booking-options", children: oe ? /* @__PURE__ */ n("div", { className: "offer-expiry", children: [
|
|
260
|
+
/* @__PURE__ */ r("span", { children: /* @__PURE__ */ r(x, {}) }),
|
|
275
261
|
/* @__PURE__ */ r("p", { className: "expired-tip", children: "Offer Expired" })
|
|
276
|
-
] }) : /* @__PURE__ */ n(
|
|
277
|
-
|
|
262
|
+
] }) : /* @__PURE__ */ n(L, { children: [
|
|
263
|
+
ae || e.cash > 0 && /* @__PURE__ */ n(
|
|
278
264
|
"div",
|
|
279
265
|
{
|
|
280
|
-
className:
|
|
266
|
+
className: xe(
|
|
267
|
+
"amount-value",
|
|
268
|
+
F === "cash" && l ? "show-best-value-flag" : "",
|
|
269
|
+
p.amountsDisplayFeature !== u.CASH_AND_TRAVEL_PARTNER_POINTS ? "lg" : ""
|
|
270
|
+
),
|
|
281
271
|
onClick: (i) => {
|
|
282
|
-
z(i,
|
|
272
|
+
z(i, d.CASH, e);
|
|
283
273
|
},
|
|
284
274
|
children: [
|
|
285
|
-
|
|
275
|
+
p.amountsDisplayFeature === u.CASH_AND_TRAVEL_PARTNER_POINTS ? /* @__PURE__ */ r("b", { children: "Cash" }) : /* @__PURE__ */ r("b", { children: $ ? "Book For" : "From" }),
|
|
286
276
|
/* @__PURE__ */ n("div", { children: [
|
|
287
|
-
/* @__PURE__ */ r("label", { children:
|
|
277
|
+
p.amountsDisplayFeature === u.CASH_AND_TRAVEL_PARTNER_POINTS && /* @__PURE__ */ r("label", { children: $ ? "Book For" : "From" }),
|
|
288
278
|
/* @__PURE__ */ n("span", { className: "flight-cash-amount-value", children: [
|
|
289
279
|
/* @__PURE__ */ r(
|
|
290
|
-
|
|
280
|
+
Q,
|
|
291
281
|
{
|
|
292
282
|
amount: e.cash,
|
|
293
283
|
currency: e.currency,
|
|
294
|
-
position:
|
|
284
|
+
position: j.LEFT
|
|
295
285
|
}
|
|
296
286
|
),
|
|
297
|
-
|
|
287
|
+
p.amountsDisplayFeature === u.CASH_AND_CLIENT_POINTS && /* @__PURE__ */ n(L, { children: [
|
|
298
288
|
"/",
|
|
299
289
|
" ",
|
|
300
290
|
/* @__PURE__ */ r(
|
|
301
|
-
|
|
291
|
+
Ee,
|
|
302
292
|
{
|
|
303
293
|
currency: e.currency,
|
|
304
294
|
cashAmount: e.cash
|
|
@@ -307,62 +297,62 @@ const ri = ({
|
|
|
307
297
|
] })
|
|
308
298
|
] })
|
|
309
299
|
] }),
|
|
310
|
-
|
|
300
|
+
F === "cash" && p.amountsDisplayFeature === u.CASH_AND_TRAVEL_PARTNER_POINTS && l && /* @__PURE__ */ n(
|
|
311
301
|
"div",
|
|
312
302
|
{
|
|
313
303
|
className: "best-value-flag tip",
|
|
314
304
|
onClick: (i) => {
|
|
315
|
-
i.stopPropagation(),
|
|
305
|
+
i.stopPropagation(), t == null || t(e);
|
|
316
306
|
},
|
|
317
307
|
children: [
|
|
318
|
-
|
|
308
|
+
t && /* @__PURE__ */ r(x, {}),
|
|
319
309
|
/* @__PURE__ */ r("p", { children: "Best Value" }),
|
|
320
|
-
|
|
310
|
+
t && /* @__PURE__ */ r("span", { children: "Click to learn more" })
|
|
321
311
|
]
|
|
322
312
|
}
|
|
323
313
|
)
|
|
324
314
|
]
|
|
325
315
|
}
|
|
326
316
|
),
|
|
327
|
-
|
|
317
|
+
te || e.points > 0 && p.amountsDisplayFeature === u.CASH_AND_TRAVEL_PARTNER_POINTS && /* @__PURE__ */ n(
|
|
328
318
|
"div",
|
|
329
319
|
{
|
|
330
|
-
className: `amount-value ${
|
|
320
|
+
className: `amount-value ${F === "points" && l ? "show-best-value-flag" : ""}`,
|
|
331
321
|
onClick: (i) => {
|
|
332
|
-
z(i,
|
|
322
|
+
z(i, d.POINTS, e);
|
|
333
323
|
},
|
|
334
324
|
children: [
|
|
335
|
-
|
|
325
|
+
F === "points" && l && /* @__PURE__ */ n(
|
|
336
326
|
"div",
|
|
337
327
|
{
|
|
338
328
|
className: "best-value-flag tip",
|
|
339
329
|
onClick: (i) => {
|
|
340
|
-
i.stopPropagation(),
|
|
330
|
+
i.stopPropagation(), t == null || t(e);
|
|
341
331
|
},
|
|
342
332
|
children: [
|
|
343
|
-
|
|
333
|
+
t && /* @__PURE__ */ r(x, {}),
|
|
344
334
|
/* @__PURE__ */ r("p", { children: "Best Value" }),
|
|
345
|
-
|
|
335
|
+
t && /* @__PURE__ */ r("span", { children: "Click to learn more" })
|
|
346
336
|
]
|
|
347
337
|
}
|
|
348
338
|
),
|
|
349
|
-
/* @__PURE__ */ r("div", { className: "amount-airline-logo", children: /* @__PURE__ */ r("img", { src:
|
|
339
|
+
/* @__PURE__ */ r("div", { className: "amount-airline-logo", children: /* @__PURE__ */ r("img", { src: fe.programLogo }) }),
|
|
350
340
|
/* @__PURE__ */ n("div", { children: [
|
|
351
|
-
/* @__PURE__ */ r("label", { children:
|
|
341
|
+
/* @__PURE__ */ r("label", { children: ge ? "Book For" : "From" }),
|
|
352
342
|
/* @__PURE__ */ n("p", { children: [
|
|
353
|
-
`${
|
|
354
|
-
|
|
355
|
-
)} ${
|
|
356
|
-
!!
|
|
343
|
+
`${Oe(
|
|
344
|
+
c == null ? void 0 : c.points
|
|
345
|
+
)} ${N("miles")}`,
|
|
346
|
+
!!(c != null && c.cashFee) && /* @__PURE__ */ n(L, { children: [
|
|
357
347
|
" + ",
|
|
358
348
|
/* @__PURE__ */ r(
|
|
359
|
-
|
|
349
|
+
Q,
|
|
360
350
|
{
|
|
361
|
-
amount:
|
|
362
|
-
currency:
|
|
351
|
+
amount: c.cashFee.amount,
|
|
352
|
+
currency: c.cashFee.currency,
|
|
363
353
|
customDisplay: "No fee",
|
|
364
|
-
zeroDisplayOption:
|
|
365
|
-
position:
|
|
354
|
+
zeroDisplayOption: Te.CUSTOM,
|
|
355
|
+
position: j.LEFT
|
|
366
356
|
}
|
|
367
357
|
)
|
|
368
358
|
] })
|
|
@@ -375,11 +365,11 @@ const ri = ({
|
|
|
375
365
|
] }),
|
|
376
366
|
/* @__PURE__ */ r("div", { className: `flight-details ${U ? "is-open" : ""}`, children: /* @__PURE__ */ r("div", { ref: b, className: "inner", children: /* @__PURE__ */ n("div", { className: "flight-booking-options", children: [
|
|
377
367
|
_.length > 0 && /* @__PURE__ */ n("div", { className: "booking-options-section", children: [
|
|
378
|
-
|
|
379
|
-
/* @__PURE__ */ r(
|
|
380
|
-
|
|
368
|
+
S.length > 0 && /* @__PURE__ */ r("p", { className: "booking-options-title", children: "Cash Options" }),
|
|
369
|
+
/* @__PURE__ */ r(ie, { children: _.map((i, s) => /* @__PURE__ */ r(
|
|
370
|
+
J,
|
|
381
371
|
{
|
|
382
|
-
type:
|
|
372
|
+
type: d.CASH,
|
|
383
373
|
title: i.fareBrandName,
|
|
384
374
|
cashValue: {
|
|
385
375
|
amount: i.cash,
|
|
@@ -388,7 +378,7 @@ const ri = ({
|
|
|
388
378
|
milesValue: void 0,
|
|
389
379
|
cashFee: i.cashFee,
|
|
390
380
|
setSelected: () => {
|
|
391
|
-
|
|
381
|
+
D == null || D(i, e);
|
|
392
382
|
},
|
|
393
383
|
conditions: i.conditions,
|
|
394
384
|
slices: e.flightDetails.slices,
|
|
@@ -397,12 +387,12 @@ const ri = ({
|
|
|
397
387
|
`cash-${s}`
|
|
398
388
|
)) })
|
|
399
389
|
] }),
|
|
400
|
-
|
|
390
|
+
S.length > 0 && /* @__PURE__ */ n("div", { className: "booking-options-section", children: [
|
|
401
391
|
_.length > 0 && /* @__PURE__ */ r("p", { className: "booking-options-title", children: "Miles Options" }),
|
|
402
|
-
/* @__PURE__ */ r(
|
|
403
|
-
|
|
392
|
+
/* @__PURE__ */ r(ie, { children: S.map((i, s) => /* @__PURE__ */ r(
|
|
393
|
+
J,
|
|
404
394
|
{
|
|
405
|
-
type:
|
|
395
|
+
type: d.POINTS,
|
|
406
396
|
title: i.fareBrandName,
|
|
407
397
|
cashValue: void 0,
|
|
408
398
|
milesValue: i.points,
|
|
@@ -424,5 +414,5 @@ const ri = ({
|
|
|
424
414
|
);
|
|
425
415
|
};
|
|
426
416
|
export {
|
|
427
|
-
|
|
417
|
+
Be as FlightResult
|
|
428
418
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as L, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as C, useState as n, useEffect as A } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { F as E, a as R } from "../../index-9LVJi5JO.js";
|
|
4
4
|
import '../../assets/_styles2.css';/* empty css */
|
|
5
|
-
const
|
|
5
|
+
const F = ({
|
|
6
6
|
children: i,
|
|
7
7
|
className: d = ""
|
|
8
8
|
}) => {
|
|
@@ -71,5 +71,5 @@ const N = ({
|
|
|
71
71
|
);
|
|
72
72
|
};
|
|
73
73
|
export {
|
|
74
|
-
|
|
74
|
+
F as default
|
|
75
75
|
};
|