@odynn/awayz-core 0.10.29 → 0.10.31
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/AccountService-B582vLTc.js +2149 -0
- package/dist/{TripsService-B2m7Yy9W.js → TripsService-BwBvXdDC.js} +6 -6
- package/dist/assets/_styles5.css +1 -1
- package/dist/assets/_styles6.css +1 -1
- package/dist/assets/_styles7.css +1 -0
- package/dist/components/CashValue/CashValue.js +15 -13
- package/dist/components/CashValue/CashValue.stories.js +22 -21
- package/dist/components/ClientPointsValue/ClientPointsValue.js +20 -18
- package/dist/components/Modal/Modal.js +1 -1
- package/dist/components/Tooltip/Tooltip.js +1 -1
- package/dist/components/Wallet/Card/Card.stories.js +16 -14
- package/dist/hooks/useAwayzAuth/useAwayzAuth.js +15 -13
- package/dist/hooks/useBookingManagement/useBookingManagement.js +6 -4
- package/dist/hooks/useBookingManagement/useBookingManagement.test.js +5 -3
- package/dist/hooks/useFeatureFlags.js +1 -1
- package/dist/hooks/useSearchLimit.js +1 -1
- package/dist/hooks/useTripManagement/useTripManagement.js +7 -5
- package/dist/hooks/useTripManagement/useTripManagement.test.js +5 -3
- package/dist/hooks/useWallet/useWallet.js +31 -29
- package/dist/hooks/useWallet/useWallet.test.js +4 -2
- package/dist/lib/hooks/useBookingManagement/useBookingManagement.types.d.ts +1 -1
- package/dist/lib/services/account/AccountService.d.ts +12 -2
- package/dist/lib/services/account/AccountServices.types.d.ts +13 -0
- package/dist/lib/services/bookings/BookingService.d.ts +1 -1
- package/dist/lib/services/index.d.ts +2 -0
- package/dist/lib/services/instanceConfig.d.ts +1 -1
- package/dist/main.js +43 -39
- package/dist/providers/AwayzProvider.js +10 -8
- package/dist/services/account/AccountService.js +3 -2
- package/dist/services/bookings/BookingService.js +4 -4
- package/dist/services/currency/CurrencyService.js +16 -14
- package/dist/services/features/featureService.js +1 -1
- package/dist/services/index.js +13 -9
- package/dist/services/instance.js +1 -1
- package/dist/services/instanceConfig.js +8 -20
- package/dist/services/noRetryInstance.js +9 -2
- package/dist/services/preferences/PreferencesService.js +1 -1
- package/dist/services/rewards/RewardsService.js +1 -1
- package/dist/services/trips/TripsService.js +2 -2
- package/dist/services/wallet/WalletService.js +1 -1
- package/dist/utils/clientPoints.js +6 -4
- package/package.json +1 -1
- package/dist/assets/noRetryInstance.css +0 -1
- package/dist/noRetryInstance-DNLgOg0E.js +0 -2134
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
var v = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var n = (s, e, a) =>
|
|
2
|
+
var D = (s, e, a) => e in s ? v(s, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : s[e] = a;
|
|
3
|
+
var n = (s, e, a) => D(s, typeof e != "symbol" ? e + "" : e, a);
|
|
4
4
|
import "react/jsx-runtime";
|
|
5
5
|
import "./arrayExtensions-DlcBOj5a.js";
|
|
6
|
-
import { c as i,
|
|
6
|
+
import { c as i, j as u, a as d, r as S } from "./AccountService-B582vLTc.js";
|
|
7
7
|
import "react";
|
|
8
|
-
import { DEFAULT_LOGO as
|
|
8
|
+
import { DEFAULT_LOGO as f } from "./configs/defaultAwayzConfig.js";
|
|
9
9
|
import { EMyTripsEndpoints as o } from "./configs/endpoints.js";
|
|
10
10
|
import { EBookingType as y } from "./services/trips/TripService.types.js";
|
|
11
11
|
const I = "https://assets.duffel.com/img/airlines/for-light-background/full-color-lockup/";
|
|
@@ -41,7 +41,7 @@ class O {
|
|
|
41
41
|
n(this, "updateTrip", async (e, a) => {
|
|
42
42
|
const { data: t } = await i.put(
|
|
43
43
|
`${o.TRIPS}/${e}`,
|
|
44
|
-
|
|
44
|
+
S(u(a))
|
|
45
45
|
);
|
|
46
46
|
return t != null && t.success ? {
|
|
47
47
|
success: !0,
|
|
@@ -103,7 +103,7 @@ const T = (s) => s.map((e) => {
|
|
|
103
103
|
airlines: e.slices.map((p) => {
|
|
104
104
|
var g;
|
|
105
105
|
return {
|
|
106
|
-
logo: (g = p.carriers.operating_iata_codes) != null && g.length ? `${I}${p.carriers.operating_iata_codes[0]}.svg` :
|
|
106
|
+
logo: (g = p.carriers.operating_iata_codes) != null && g.length ? `${I}${p.carriers.operating_iata_codes[0]}.svg` : f,
|
|
107
107
|
name: p.carriers.operating[0]
|
|
108
108
|
};
|
|
109
109
|
}),
|
package/dist/assets/_styles5.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@import"https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap";*{font-family:Inter,sans-serif!important;margin:0;padding:0;box-sizing:border-box}:root{font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.
|
|
1
|
+
@import"https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap";*{font-family:Inter,sans-serif!important;margin:0;padding:0;box-sizing:border-box}:root{font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.currency-conversion{max-width:fit-content}.currency-conversion sub{vertical-align:text-bottom}.currency-conversion svg{fill:var(--primary, #1495f2);transform:scaleX(.75)}.currency-conversion.loading{background-color:var(--border, #e7eef3);background-size:300%;background-position:100% 0;animation:shimmer 2s infinite;color:transparent;padding:0 .5rem;border-radius:.5rem}.currency-conversion-container{display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;gap:1rem}.currency-conversion-container>p{font-weight:600}.currency-conversion-container .currency-conversion-amounts{position:relative;display:flex;align-items:center;width:100vw;max-width:300px;border:1px solid var(--border, #e7eef3);border-radius:.5rem}.currency-conversion-container .currency-conversion-amounts div{flex:1;width:50%;padding:1rem;font-weight:600}.currency-conversion-container .currency-conversion-amounts div:first-of-type{border-right:1px solid var(--border, #e7eef3)}.currency-conversion-container .currency-conversion-amounts .conversion-icon{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);border-radius:50%;background-color:var(--foreground, #fff);color:var(--primary, #1495f2);height:2rem;width:2rem;display:flex;align-items:center;justify-content:center;border:1px solid var(--border, #e7eef3)}.currency-conversion-container .currency-conversion-amounts .conversion-icon svg{fill:var(--primary, #1495f2);width:1rem;height:1rem;transform:scaleX(.75)}.currency-conversion-container .currency-conversion-rate{padding:.5rem 1rem;border-radius:.5rem;background-color:var(--border, #e7eef3);font-size:.8rem}
|
package/dist/assets/_styles6.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@import"https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap";*{font-family:Inter,sans-serif!important;margin:0;padding:0;box-sizing:border-box}:root{font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.
|
|
1
|
+
@import"https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap";*{font-family:Inter,sans-serif!important;margin:0;padding:0;box-sizing:border-box}:root{font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.tooltip-content{border-radius:.5rem;border:1px solid var(--border, #e7eef3);padding:1rem;line-height:1;background-color:var(--foreground, #fff);animation-duration:.4s;animation-timing-function:cubic-bezier(.16,1,.3,1);animation-fill-mode:both;will-change:transform,opacity;z-index:500}.tooltip-arrow{fill:var(--foreground, #fff)}.tooltip-content[data-state=delayed-open][data-side=top]{animation-name:tooltip-down}.tooltip-content[data-state=delayed-open][data-side=right]{animation-name:tooltip-right}.tooltip-content[data-state=delayed-open][data-side=bottom]{animation-name:tooltip-up}.tooltip-content[data-state=delayed-open][data-side=left]{animation-name:tooltip-left}@keyframes tooltip-up{0%{opacity:0;transform:translate3d(0,4px,0)}to{opacity:1;transform:translateZ(0)}}@keyframes tooltip-down{0%{opacity:0;transform:translate3d(0,-4px,0)}to{opacity:1;transform:translateZ(0)}}@keyframes tooltip-left{0%{opacity:0;transform:translate3d(4px,0,0)}to{opacity:1;transform:translateZ(0)}}@keyframes tooltip-right{0%{opacity:0;transform:translate3d(-4px,0,0)}to{opacity:1;transform:translateZ(0)}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import"https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap";*{font-family:Inter,sans-serif!important;margin:0;padding:0;box-sizing:border-box}:root{font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.modal-backdrop{position:fixed;top:60px;left:0;bottom:0;right:0;z-index:400;background-color:var(--opaque-background, rgba(249, 253, 255, .5843137255));transition:all .2s ease-in-out;-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px);display:flex;align-items:center;justify-content:center}.modal-backdrop.hidden{background-color:transparent;pointer-events:none;-webkit-backdrop-filter:blur(0);backdrop-filter:blur(0)}.modal-backdrop.hidden .modal-content{scale:.8;opacity:0}.modal-backdrop .modal-content{transition:all .2s ease-in-out;background-color:var(--foreground, #fff);border-radius:.5rem;border:1px solid var(--border, #e7eef3);position:relative}.modal-backdrop .modal-content .divider{width:100%;border:1px solid var(--border, #e7eef3);transform:scaleY(.5);margin:0}.modal-backdrop .modal-content .close-btn{height:30px;width:30px;border-radius:.5rem;border:1px solid var(--border, #e7eef3);display:flex;align-items:center;justify-content:center;position:absolute;top:1rem;right:1rem;transition:all .3s ease-in-out;cursor:pointer}.modal-backdrop .modal-content .close-btn:hover{background-color:var(--border, #e7eef3)}@media screen and (max-width: 768px){.modal-backdrop .modal-content{width:100%;max-height:80dvh;height:fit-content;position:absolute;bottom:0;overflow-y:auto;border-radius:1rem 1rem 0 0}}.modal-backdrop.padding .modal-content{padding:1rem}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as r, jsxs as l } from "react/jsx-runtime";
|
|
2
2
|
import { useQuery as _ } from "@tanstack/react-query";
|
|
3
|
-
import { g as
|
|
3
|
+
import { g as m, a as S, b as f } from "../../cashUtils-DyxlHnod.js";
|
|
4
4
|
import "../../arrayExtensions-DlcBOj5a.js";
|
|
5
|
-
import { E as T } from "../../
|
|
5
|
+
import { E as T } from "../../AccountService-B582vLTc.js";
|
|
6
6
|
import { useMemo as I } from "react";
|
|
7
7
|
import { a as v } from "../../index-C8p5kinH.js";
|
|
8
8
|
import "react-i18next";
|
|
9
|
-
import '../../assets/_styles4.css';import '../../assets/_styles2.css';import '../../assets/_styles.css';import '../../assets/_styles3.css';/* empty css */
|
|
9
|
+
import '../../assets/_styles5.css';import '../../assets/_styles4.css';import '../../assets/_styles2.css';import '../../assets/_styles.css';import '../../assets/_styles3.css';/* empty css */
|
|
10
10
|
/* empty css */
|
|
11
11
|
/* empty css */
|
|
12
12
|
import { EInvalidAmountDisplayOption as t, EToolTipPosition as M } from "./CashValueTypes.js";
|
|
@@ -15,8 +15,10 @@ import "../../configs/awayzClient.js";
|
|
|
15
15
|
/* empty css */
|
|
16
16
|
import "../../context/AwayzContext.js";
|
|
17
17
|
import { CurrencyService as x } from "../../services/currency/CurrencyService.js";
|
|
18
|
+
import "../../services/noRetryInstance.js";
|
|
18
19
|
import { Tooltip as D } from "../Tooltip/Tooltip.js";
|
|
19
|
-
|
|
20
|
+
/* empty css */
|
|
21
|
+
const Y = 1e3 * 60 * 60, P = ({
|
|
20
22
|
amount: i,
|
|
21
23
|
currency: e,
|
|
22
24
|
position: A = M.RIGHT,
|
|
@@ -28,7 +30,7 @@ const Y = 1e3 * 60 * 60, J = ({
|
|
|
28
30
|
showOriginal: R = !0
|
|
29
31
|
}) => {
|
|
30
32
|
var C, N;
|
|
31
|
-
const { user: o } = O(), n = ((C = o == null ? void 0 : o.preferences) == null ? void 0 : C.currency) ?? ((N = o == null ? void 0 : o.userRegion) == null ? void 0 : N.currency), c = n !== e, { data: a, isPending:
|
|
33
|
+
const { user: o } = O(), n = ((C = o == null ? void 0 : o.preferences) == null ? void 0 : C.currency) ?? ((N = o == null ? void 0 : o.userRegion) == null ? void 0 : N.currency), c = n !== e, { data: a, isPending: u } = _({
|
|
32
34
|
queryKey: [T.CONVERT_CURRENCY, e, n],
|
|
33
35
|
queryFn: () => x.convertCurrency({
|
|
34
36
|
baseCurrency: e,
|
|
@@ -41,19 +43,19 @@ const Y = 1e3 * 60 * 60, J = ({
|
|
|
41
43
|
return null;
|
|
42
44
|
let h = typeof i == "string" ? parseFloat(i) : i;
|
|
43
45
|
if (c) {
|
|
44
|
-
if (
|
|
46
|
+
if (u || !a) return null;
|
|
45
47
|
h = h * a;
|
|
46
48
|
}
|
|
47
49
|
return h;
|
|
48
|
-
}, [i, o,
|
|
50
|
+
}, [i, o, u, c, a]);
|
|
49
51
|
if (R)
|
|
50
|
-
return /* @__PURE__ */ r("span", { className: "currency-conversion", children:
|
|
52
|
+
return /* @__PURE__ */ r("span", { className: "currency-conversion", children: m(
|
|
51
53
|
i,
|
|
52
54
|
e,
|
|
53
55
|
s,
|
|
54
56
|
d
|
|
55
57
|
) });
|
|
56
|
-
if (
|
|
58
|
+
if (u && c)
|
|
57
59
|
return /* @__PURE__ */ r("span", { className: "currency-conversion loading", children: i });
|
|
58
60
|
if (!n || !p || p < 0)
|
|
59
61
|
switch (y) {
|
|
@@ -73,7 +75,7 @@ const Y = 1e3 * 60 * 60, J = ({
|
|
|
73
75
|
return /* @__PURE__ */ r("span", { children: "N/A" });
|
|
74
76
|
}
|
|
75
77
|
return /* @__PURE__ */ l("span", { className: "currency-conversion", children: [
|
|
76
|
-
|
|
78
|
+
m(
|
|
77
79
|
p,
|
|
78
80
|
n,
|
|
79
81
|
s,
|
|
@@ -92,13 +94,13 @@ const Y = 1e3 * 60 * 60, J = ({
|
|
|
92
94
|
n
|
|
93
95
|
] }),
|
|
94
96
|
/* @__PURE__ */ l("div", { className: "currency-conversion-amounts", children: [
|
|
95
|
-
/* @__PURE__ */ r("div", { children: /* @__PURE__ */ r("p", { children:
|
|
97
|
+
/* @__PURE__ */ r("div", { children: /* @__PURE__ */ r("p", { children: m(
|
|
96
98
|
i,
|
|
97
99
|
e,
|
|
98
100
|
s,
|
|
99
101
|
d
|
|
100
102
|
) }) }),
|
|
101
|
-
/* @__PURE__ */ r("div", { children: /* @__PURE__ */ r("p", { children:
|
|
103
|
+
/* @__PURE__ */ r("div", { children: /* @__PURE__ */ r("p", { children: m(
|
|
102
104
|
p,
|
|
103
105
|
n,
|
|
104
106
|
s,
|
|
@@ -125,6 +127,6 @@ const Y = 1e3 * 60 * 60, J = ({
|
|
|
125
127
|
] });
|
|
126
128
|
};
|
|
127
129
|
export {
|
|
128
|
-
|
|
130
|
+
P as CashValue,
|
|
129
131
|
Y as CurrencyCallStaleTimeMs
|
|
130
132
|
};
|
|
@@ -9,12 +9,13 @@ import { CashValue as n } from "./CashValue.js";
|
|
|
9
9
|
import { EToolTipPosition as t, EInvalidAmountDisplayOption as o } from "./CashValueTypes.js";
|
|
10
10
|
import "@tanstack/react-query";
|
|
11
11
|
import "../../context/AwayzContext.js";
|
|
12
|
-
import "../../
|
|
12
|
+
import "../../AccountService-B582vLTc.js";
|
|
13
13
|
import "../../configs/awayzClient.js";
|
|
14
|
+
import { EAuthFlow as a } from "../../types/EAuthFlow.js";
|
|
14
15
|
/* empty css */
|
|
15
|
-
import { AwayzProvider as
|
|
16
|
-
import
|
|
17
|
-
const
|
|
16
|
+
import { AwayzProvider as i } from "../../providers/AwayzProvider.js";
|
|
17
|
+
import "../../services/noRetryInstance.js";
|
|
18
|
+
const h = {
|
|
18
19
|
title: "Core/Cash Value",
|
|
19
20
|
component: n,
|
|
20
21
|
parameters: {
|
|
@@ -43,11 +44,11 @@ const f = {
|
|
|
43
44
|
tags: ["autodocs"],
|
|
44
45
|
decorators: [
|
|
45
46
|
(r) => /* @__PURE__ */ e(
|
|
46
|
-
|
|
47
|
+
i,
|
|
47
48
|
{
|
|
48
49
|
config: {
|
|
49
50
|
gatewayBaseUrl: "TODO:",
|
|
50
|
-
authFlow:
|
|
51
|
+
authFlow: a.STANDARD,
|
|
51
52
|
clientId: void 0,
|
|
52
53
|
trustedOrigins: ["*"],
|
|
53
54
|
testMode: !0,
|
|
@@ -57,46 +58,46 @@ const f = {
|
|
|
57
58
|
}
|
|
58
59
|
)
|
|
59
60
|
]
|
|
60
|
-
},
|
|
61
|
+
}, _ = {
|
|
61
62
|
name: "Euro to Dollar Cash Value",
|
|
62
63
|
args: {
|
|
63
64
|
amount: 100,
|
|
64
65
|
currency: "EUR"
|
|
65
66
|
}
|
|
66
|
-
},
|
|
67
|
+
}, v = {
|
|
67
68
|
name: "Invalid Amount",
|
|
68
69
|
args: {
|
|
69
70
|
amount: "invalid",
|
|
70
71
|
currency: "EUR"
|
|
71
72
|
}
|
|
72
|
-
},
|
|
73
|
+
}, U = {
|
|
73
74
|
name: "Zero Amount with Display as Zero",
|
|
74
75
|
args: {
|
|
75
76
|
amount: 0,
|
|
76
77
|
zeroDisplayOption: o.DISPLAY_AS_ZERO,
|
|
77
78
|
currency: "EUR"
|
|
78
79
|
}
|
|
79
|
-
},
|
|
80
|
+
}, I = {
|
|
80
81
|
name: "Zero Amount with Display as Zero With Currency",
|
|
81
82
|
args: {
|
|
82
83
|
amount: 0,
|
|
83
84
|
zeroDisplayOption: o.DISPLAY_AS_ZERO_WITH_CURRENCY,
|
|
84
85
|
currency: "EUR"
|
|
85
86
|
}
|
|
86
|
-
},
|
|
87
|
+
}, b = {
|
|
87
88
|
name: "Zero Amount with Display as Zero With Currency No Decimal",
|
|
88
89
|
args: {
|
|
89
90
|
amount: 0,
|
|
90
91
|
zeroDisplayOption: o.DISPLAY_AS_ZERO_WITH_CURRENCY_NO_DECIMAL,
|
|
91
92
|
currency: "EUR"
|
|
92
93
|
}
|
|
93
|
-
},
|
|
94
|
+
}, N = {
|
|
94
95
|
name: "Negative Amount",
|
|
95
96
|
args: {
|
|
96
97
|
amount: -100,
|
|
97
98
|
currency: "EUR"
|
|
98
99
|
}
|
|
99
|
-
},
|
|
100
|
+
}, T = {
|
|
100
101
|
name: "Custom Zero Amount",
|
|
101
102
|
args: {
|
|
102
103
|
amount: 0,
|
|
@@ -106,12 +107,12 @@ const f = {
|
|
|
106
107
|
}
|
|
107
108
|
};
|
|
108
109
|
export {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
110
|
+
T as CustomZeroAmount,
|
|
111
|
+
_ as Default,
|
|
112
|
+
v as InvalidAmount,
|
|
113
|
+
N as NegativeAmount,
|
|
114
|
+
U as ZeroAmount,
|
|
115
|
+
I as ZeroCurrencyAmount,
|
|
116
|
+
b as ZeroCurrencyNoDecimalAmount,
|
|
117
|
+
h as default
|
|
117
118
|
};
|
|
@@ -1,46 +1,48 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useQuery as
|
|
1
|
+
import { jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { useQuery as u } from "@tanstack/react-query";
|
|
3
3
|
import "../../arrayExtensions-DlcBOj5a.js";
|
|
4
|
-
import { c
|
|
5
|
-
import { E as f } from "../../
|
|
4
|
+
import { c } from "../../numberUtils-B4wd-SGR.js";
|
|
5
|
+
import { E as f } from "../../AccountService-B582vLTc.js";
|
|
6
6
|
import { useMemo as C } from "react";
|
|
7
7
|
import { useAwayzContext as l } from "../../hooks/useAwayzContext.js";
|
|
8
8
|
import "react-i18next";
|
|
9
|
-
import '../../assets/_styles4.css';import '../../assets/
|
|
9
|
+
import '../../assets/_styles4.css';import '../../assets/_styles5.css';import '../../assets/_styles7.css';import '../../assets/_styles6.css';import '../../assets/_styles2.css';import '../../assets/_styles.css';import '../../assets/_styles3.css';/* empty css */
|
|
10
10
|
/* empty css */
|
|
11
11
|
/* empty css */
|
|
12
12
|
import { CurrencyService as y } from "../../services/currency/CurrencyService.js";
|
|
13
13
|
/* empty css */
|
|
14
14
|
/* empty css */
|
|
15
15
|
import "../../index-Cv-wvFlM.js";
|
|
16
|
+
/* empty css */
|
|
16
17
|
/* empty css */
|
|
17
18
|
import "../../configs/awayzClient.js";
|
|
18
19
|
import "../../context/AwayzContext.js";
|
|
20
|
+
import "../../services/noRetryInstance.js";
|
|
19
21
|
import { getCurrency as d } from "../../utils/currency.js";
|
|
20
22
|
import { useFeatureFlags as v } from "../../hooks/useFeatureFlags.js";
|
|
21
23
|
import { useWallet as R } from "../../hooks/useWallet/useWallet.js";
|
|
22
|
-
const
|
|
24
|
+
const k = ({
|
|
23
25
|
cashAmount: m,
|
|
24
|
-
currency:
|
|
26
|
+
currency: r
|
|
25
27
|
}) => {
|
|
26
|
-
const { pointsAsCash:
|
|
27
|
-
() => d(
|
|
28
|
+
const { pointsAsCash: e } = R(), { user: t } = l(), { featureFlags: i } = v(), o = C(
|
|
29
|
+
() => d(i.defaultCurrencyFeature, t),
|
|
28
30
|
[t]
|
|
29
|
-
), { data:
|
|
30
|
-
queryKey: [f.CONVERT_CURRENCY,
|
|
31
|
+
), { data: n } = u({
|
|
32
|
+
queryKey: [f.CONVERT_CURRENCY, r, e.currency],
|
|
31
33
|
queryFn: () => y.convertCurrency({
|
|
32
|
-
baseCurrency:
|
|
33
|
-
targetCurrency:
|
|
34
|
+
baseCurrency: r,
|
|
35
|
+
targetCurrency: e.currency
|
|
34
36
|
}),
|
|
35
37
|
staleTime: 1e3 * 60 * 60,
|
|
36
38
|
// 1 hour
|
|
37
|
-
enabled: !!
|
|
38
|
-
}),
|
|
39
|
-
return /* @__PURE__ */
|
|
40
|
-
|
|
39
|
+
enabled: !!r && !!o && r !== o && e.currency !== r && !!e.currency
|
|
40
|
+
}), s = m * (n ?? 1), a = Math.round(s / e.valuePerPoint);
|
|
41
|
+
return /* @__PURE__ */ p("p", { className: "client-points-amount", children: [
|
|
42
|
+
c(a),
|
|
41
43
|
" pts."
|
|
42
44
|
] });
|
|
43
45
|
};
|
|
44
46
|
export {
|
|
45
|
-
|
|
47
|
+
k as ClientPointsValue
|
|
46
48
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import '../../assets/
|
|
2
|
+
import '../../assets/_styles7.css';/* empty css */
|
|
3
3
|
import { r as i } from "../../index-Cv-wvFlM.js";
|
|
4
4
|
const s = ({ show: t, onClose: o, children: r, padding: d = !0 }) => {
|
|
5
5
|
const e = () => {
|
|
@@ -3,7 +3,7 @@ import * as s from "react";
|
|
|
3
3
|
import { useState as ce, useEffect as et } from "react";
|
|
4
4
|
import { u as D, a as tt, c as R, b as z, d as fe, e as rt, f as nt, g as Y, o as ot, s as st, h as it, i as at, j as lt, k as ct, l as dt, m as ut, n as pt, p as ft, P as he } from "../../index-DUTpB-ZJ.js";
|
|
5
5
|
import { r as ht, R as vt } from "../../index-Cv-wvFlM.js";
|
|
6
|
-
import '../../assets/
|
|
6
|
+
import '../../assets/_styles6.css';/* empty css */
|
|
7
7
|
import yt from "../Modal/Modal.js";
|
|
8
8
|
// @__NO_SIDE_EFFECTS__
|
|
9
9
|
function mt(e) {
|
|
@@ -2,33 +2,35 @@ import { jsx as t } from "react/jsx-runtime";
|
|
|
2
2
|
import "../../../arrayExtensions-DlcBOj5a.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "react-i18next";
|
|
5
|
-
import '../../../assets/
|
|
5
|
+
import '../../../assets/_styles5.css';import '../../../assets/_styles7.css';import '../../../assets/_styles6.css';import '../../../assets/_styles2.css';import '../../../assets/_styles.css';import '../../../assets/_styles3.css';/* empty css */
|
|
6
6
|
/* empty css */
|
|
7
7
|
/* empty css */
|
|
8
8
|
import "@tanstack/react-query";
|
|
9
9
|
import "../../../configs/awayzClient.js";
|
|
10
|
-
import "../../../
|
|
10
|
+
import { EAuthFlow as r } from "../../../types/EAuthFlow.js";
|
|
11
|
+
import "../../../AccountService-B582vLTc.js";
|
|
11
12
|
/* empty css */
|
|
12
13
|
/* empty css */
|
|
13
14
|
import "../../../index-Cv-wvFlM.js";
|
|
15
|
+
/* empty css */
|
|
14
16
|
import "../../../context/AwayzContext.js";
|
|
15
|
-
import { Card as
|
|
16
|
-
import { AwayzProvider as
|
|
17
|
-
import
|
|
18
|
-
const
|
|
17
|
+
import { Card as a } from "./Card.js";
|
|
18
|
+
import { AwayzProvider as e } from "../../../providers/AwayzProvider.js";
|
|
19
|
+
import "../../../services/noRetryInstance.js";
|
|
20
|
+
const b = {
|
|
19
21
|
title: "Wallet/Card",
|
|
20
|
-
component:
|
|
22
|
+
component: a,
|
|
21
23
|
parameters: {
|
|
22
24
|
layout: "centered"
|
|
23
25
|
},
|
|
24
26
|
tags: ["autodocs"],
|
|
25
27
|
decorators: [
|
|
26
28
|
(o) => /* @__PURE__ */ t(
|
|
27
|
-
|
|
29
|
+
e,
|
|
28
30
|
{
|
|
29
31
|
config: {
|
|
30
32
|
testMode: !0,
|
|
31
|
-
authFlow:
|
|
33
|
+
authFlow: r.STANDARD,
|
|
32
34
|
gatewayBaseUrl: "TODO:",
|
|
33
35
|
trustedOrigins: ["*"],
|
|
34
36
|
clientId: "6790e7c295a102749a33795e"
|
|
@@ -37,7 +39,7 @@ const z = {
|
|
|
37
39
|
}
|
|
38
40
|
)
|
|
39
41
|
]
|
|
40
|
-
},
|
|
42
|
+
}, O = {
|
|
41
43
|
args: {
|
|
42
44
|
details: {
|
|
43
45
|
id: "12345",
|
|
@@ -49,7 +51,7 @@ const z = {
|
|
|
49
51
|
console.log("Card deleted:", o);
|
|
50
52
|
}
|
|
51
53
|
}
|
|
52
|
-
},
|
|
54
|
+
}, U = {
|
|
53
55
|
args: {
|
|
54
56
|
details: {
|
|
55
57
|
name: "IHG Rewards Club Premier",
|
|
@@ -59,7 +61,7 @@ const z = {
|
|
|
59
61
|
}
|
|
60
62
|
};
|
|
61
63
|
export {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
64
|
+
O as DarkCard,
|
|
65
|
+
U as LightCard,
|
|
66
|
+
b as default
|
|
65
67
|
};
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import { c as P } from "../../cashUtils-DyxlHnod.js";
|
|
2
2
|
import "../../arrayExtensions-DlcBOj5a.js";
|
|
3
|
-
import {
|
|
3
|
+
import { f as M, A as m, E as K } from "../../AccountService-B582vLTc.js";
|
|
4
4
|
import { a as i } from "../../keys-BcBfU51M.js";
|
|
5
|
-
import { useState as f, useCallback as
|
|
5
|
+
import { useState as f, useCallback as N, useEffect as T } from "react";
|
|
6
6
|
import { awayzClient as R } from "../../configs/awayzClient.js";
|
|
7
7
|
import { PreferencesService as q } from "../../services/preferences/PreferencesService.js";
|
|
8
8
|
import "@tanstack/react-query";
|
|
9
9
|
import "react/jsx-runtime";
|
|
10
10
|
import "react-i18next";
|
|
11
|
-
import '../../assets/_styles4.css';import '../../assets/
|
|
11
|
+
import '../../assets/_styles4.css';import '../../assets/_styles5.css';import '../../assets/_styles7.css';import '../../assets/_styles6.css';import '../../assets/_styles2.css';import '../../assets/_styles.css';import '../../assets/_styles3.css';/* empty css */
|
|
12
12
|
/* empty css */
|
|
13
13
|
/* empty css */
|
|
14
14
|
/* empty css */
|
|
15
15
|
/* empty css */
|
|
16
16
|
import "../../index-Cv-wvFlM.js";
|
|
17
|
+
/* empty css */
|
|
17
18
|
import "../../context/AwayzContext.js";
|
|
18
19
|
/* empty css */
|
|
20
|
+
import "../../services/noRetryInstance.js";
|
|
19
21
|
import { EAuthFlow as k } from "../../types/EAuthFlow.js";
|
|
20
22
|
const x = (t, c) => {
|
|
21
23
|
var d, w;
|
|
@@ -32,13 +34,13 @@ const x = (t, c) => {
|
|
|
32
34
|
},
|
|
33
35
|
"*"
|
|
34
36
|
);
|
|
35
|
-
},
|
|
36
|
-
const [c, u] = f(!0), [y, d] = f(!1), [w, O] = f(), [o, S] = f(), [
|
|
37
|
+
}, ge = (t) => {
|
|
38
|
+
const [c, u] = f(!0), [y, d] = f(!1), [w, O] = f(), [o, S] = f(), [F, I] = f([]), [C, _] = f([]), g = N(
|
|
37
39
|
async (s) => {
|
|
38
40
|
t != null && t.onSuccess && (t == null || t.onSuccess(s)), t != null && t.onSuccessAsync && await (t == null ? void 0 : t.onSuccessAsync(s)), u(!1), d(!0), O(s.token), S(s.user), R.invalidateQueries();
|
|
39
41
|
},
|
|
40
42
|
[t]
|
|
41
|
-
), l =
|
|
43
|
+
), l = N(
|
|
42
44
|
async (s, e) => {
|
|
43
45
|
if (t.authFlow !== k.POST_MESSAGE)
|
|
44
46
|
return x(e ?? "exchange_token", s);
|
|
@@ -61,9 +63,9 @@ const x = (t, c) => {
|
|
|
61
63
|
return;
|
|
62
64
|
}
|
|
63
65
|
localStorage.setItem(i.TOKEN, n.token), await g(n);
|
|
64
|
-
const { data: E, ...
|
|
65
|
-
if (!
|
|
66
|
-
console.error({ reqLimitError:
|
|
66
|
+
const { data: E, ...p } = await m.getRequestLimit();
|
|
67
|
+
if (!p.success) {
|
|
68
|
+
console.error({ reqLimitError: p });
|
|
67
69
|
return;
|
|
68
70
|
}
|
|
69
71
|
E == null || E.forEach(
|
|
@@ -83,7 +85,7 @@ const x = (t, c) => {
|
|
|
83
85
|
}, v = async () => {
|
|
84
86
|
try {
|
|
85
87
|
const { success: s, data: e } = await R.ensureQueryData({
|
|
86
|
-
queryKey: [
|
|
88
|
+
queryKey: [K.CHECK_USER],
|
|
87
89
|
queryFn: m.checkUser
|
|
88
90
|
});
|
|
89
91
|
if (!s) {
|
|
@@ -150,7 +152,7 @@ const x = (t, c) => {
|
|
|
150
152
|
isAuthenticated: y,
|
|
151
153
|
token: w,
|
|
152
154
|
user: o,
|
|
153
|
-
supportedRegions:
|
|
155
|
+
supportedRegions: F,
|
|
154
156
|
supportedCurrencies: C,
|
|
155
157
|
signIn: async (s) => {
|
|
156
158
|
const e = await m.login(s);
|
|
@@ -201,7 +203,7 @@ const x = (t, c) => {
|
|
|
201
203
|
}
|
|
202
204
|
};
|
|
203
205
|
S(r), R.invalidateQueries({
|
|
204
|
-
queryKey: [
|
|
206
|
+
queryKey: [K.CHECK_USER]
|
|
205
207
|
});
|
|
206
208
|
}
|
|
207
209
|
return !0;
|
|
@@ -228,5 +230,5 @@ const x = (t, c) => {
|
|
|
228
230
|
};
|
|
229
231
|
export {
|
|
230
232
|
x as authFailurePostMessage,
|
|
231
|
-
|
|
233
|
+
ge as useAwayzAuth
|
|
232
234
|
};
|
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
import { useQuery as g, useMutation as u } from "@tanstack/react-query";
|
|
2
2
|
import "react/jsx-runtime";
|
|
3
3
|
import "../../arrayExtensions-DlcBOj5a.js";
|
|
4
|
-
import { E as a } from "../../
|
|
4
|
+
import { E as a } from "../../AccountService-B582vLTc.js";
|
|
5
5
|
import { useState as x } from "react";
|
|
6
6
|
import "react-i18next";
|
|
7
|
-
import '../../assets/_styles4.css';import '../../assets/
|
|
7
|
+
import '../../assets/_styles4.css';import '../../assets/_styles5.css';import '../../assets/_styles7.css';import '../../assets/_styles6.css';import '../../assets/_styles2.css';import '../../assets/_styles.css';import '../../assets/_styles3.css';/* empty css */
|
|
8
8
|
/* empty css */
|
|
9
9
|
/* empty css */
|
|
10
10
|
import { awayzClient as z } from "../../configs/awayzClient.js";
|
|
11
11
|
/* empty css */
|
|
12
12
|
/* empty css */
|
|
13
13
|
import "../../index-Cv-wvFlM.js";
|
|
14
|
+
/* empty css */
|
|
14
15
|
import "../../context/AwayzContext.js";
|
|
15
16
|
import { EBookingType as t } from "../../services/trips/TripService.types.js";
|
|
16
17
|
import { ECancelStatus as e } from "./useBookingManagement.types.js";
|
|
17
18
|
/* empty css */
|
|
19
|
+
import "../../services/noRetryInstance.js";
|
|
18
20
|
import { BookingService as o } from "../../services/bookings/BookingService.js";
|
|
19
|
-
const
|
|
21
|
+
const Er = (r, i) => {
|
|
20
22
|
const {
|
|
21
23
|
data: E,
|
|
22
24
|
isError: L,
|
|
@@ -150,5 +152,5 @@ const lr = (r, i) => {
|
|
|
150
152
|
};
|
|
151
153
|
};
|
|
152
154
|
export {
|
|
153
|
-
|
|
155
|
+
Er as useBookingManagement
|
|
154
156
|
};
|
|
@@ -2,21 +2,23 @@ import { EBookingEndpoints as i } from "../../configs/endpoints.js";
|
|
|
2
2
|
import "react/jsx-runtime";
|
|
3
3
|
import "../../arrayExtensions-DlcBOj5a.js";
|
|
4
4
|
import "react";
|
|
5
|
+
import "../../configs/awayzClient.js";
|
|
6
|
+
import { c } from "../../AccountService-B582vLTc.js";
|
|
5
7
|
import "react-i18next";
|
|
6
|
-
import '../../assets/_styles4.css';import '../../assets/
|
|
8
|
+
import '../../assets/_styles4.css';import '../../assets/_styles5.css';import '../../assets/_styles7.css';import '../../assets/_styles6.css';import '../../assets/_styles2.css';import '../../assets/_styles.css';import '../../assets/_styles3.css';/* empty css */
|
|
7
9
|
/* empty css */
|
|
8
10
|
/* empty css */
|
|
9
11
|
import "@tanstack/react-query";
|
|
10
12
|
/* empty css */
|
|
11
13
|
/* empty css */
|
|
12
14
|
import "../../index-Cv-wvFlM.js";
|
|
13
|
-
|
|
15
|
+
/* empty css */
|
|
14
16
|
import "../../context/AwayzContext.js";
|
|
15
17
|
import { useBookingManagement as t } from "./useBookingManagement.js";
|
|
16
|
-
import "../../configs/awayzClient.js";
|
|
17
18
|
import { EBookingType as r } from "../../services/trips/TripService.types.js";
|
|
18
19
|
import { ECancelStatus as d } from "./useBookingManagement.types.js";
|
|
19
20
|
/* empty css */
|
|
21
|
+
import "../../services/noRetryInstance.js";
|
|
20
22
|
import { renderHook as a, waitFor as n } from "../../tests/TestWrapper.js";
|
|
21
23
|
import { d as s, v as u, t as l, g as e } from "../../vi.2VT5v0um-lKoi8TEt.js";
|
|
22
24
|
const m = { _id: "6811290ef16af25943018944", order_id: "ord_0000AvQk8IXqiCE2o20e00", user_id: "67d82b1c52c4a4dbe4e640c0", void_window_ends_at: null, documents: [{ passenger_ids: ["pas_0000AvQjcLZRvVQivKWRxi"], unique_identifier: "1", type: "electronic_ticket" }], synced_at: "2025-06-23T18:32:48Z", available_actions: ["cancel", "change", "update"], airline_initiated_changes: [], cancellation: null, tax_currency: "USD", base_currency: "USD", base_amount: "77.49", tax_amount: "13.94", total_currency: "USD", offer_id: "off_0000AvQjcLqSuF2bm6U2U7", booking_reference: "GHNRHO", created_at: "2025-06-23T18:31:58.211428Z", payment_status: { paid_at: "2025-06-23T18:31:58Z", price_guarantee_expires_at: null, payment_required_by: null, awaiting_payment: !1 }, live_mode: !1, total_amount: "91.43", slices: [{ destination_type: "airport", origin_type: "airport", fare_brand_name: "Basic", segments: [{ origin_terminal: "2", destination_terminal: "1", aircraft: { iata_code: "773", name: "Boeing 777-300", id: "arc_00009VMF8AhXSSRnQDI6HE" }, departing_at: "2025-07-30T22:27:00", arriving_at: "2025-07-31T00:24:00", operating_carrier: { logo_symbol_url: "https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/ZZ.svg", logo_lockup_url: null, conditions_of_carriage_url: "https://duffelairways.com/dummy-url/conditions-of-carriage", iata_code: "ZZ", name: "Duffel Airways", id: "arl_00009VME7D6ivUu8dn35WK" }, marketing_carrier: { logo_symbol_url: "https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/ZZ.svg", logo_lockup_url: null, conditions_of_carriage_url: "https://duffelairways.com/dummy-url/conditions-of-carriage", iata_code: "ZZ", name: "Duffel Airways", id: "arl_00009VME7D6ivUu8dn35WK" }, stops: [], operating_carrier_flight_number: "9596", marketing_carrier_flight_number: "9596", distance: "1034.9960998474376", passengers: [{ baggages: [{ quantity: 1, type: "checked" }, { quantity: 1, type: "carry_on" }], cabin_class_marketing_name: "Economy", passenger_id: "pas_0000AvQjcLZRvVQivKWRxi", seat: null, cabin_class: "economy" }], duration: "PT1H57M", destination: { icao_code: "LFPG", iata_country_code: "FR", iata_city_code: "PAR", city_name: "Paris", iata_code: "CDG", latitude: 49.011244, longitude: 2.548962, city: { icao_code: null, iata_country_code: "FR", iata_city_code: "PAR", city_name: null, iata_code: "PAR", latitude: null, longitude: null, time_zone: null, type: "city", name: "Paris", id: "cit_par_fr" }, time_zone: "Europe/Paris", type: "airport", name: "Paris Charles de Gaulle Airport", id: "arp_cdg_fr" }, origin: { icao_code: "LOWW", iata_country_code: "AT", iata_city_code: "VIE", city_name: "Vienna", iata_code: "VIE", latitude: 48.113065, longitude: 16.568137, city: null, time_zone: "Europe/Vienna", type: "airport", name: "Vienna International Airport", id: "arp_vie_at" }, id: "seg_0000AvQjcLqSuF2bm6U2U5" }], conditions: { change_before_departure: { penalty_currency: "GBP", penalty_amount: "10.00", allowed: !0 } }, duration: "PT1H57M", destination: { icao_code: "LFPG", iata_country_code: "FR", iata_city_code: "PAR", city_name: "Paris", iata_code: "CDG", latitude: 49.011244, longitude: 2.548962, city: { icao_code: null, iata_country_code: "FR", iata_city_code: "PAR", city_name: null, iata_code: "PAR", latitude: null, longitude: null, time_zone: null, type: "city", name: "Paris", id: "cit_par_fr" }, time_zone: "Europe/Paris", type: "airport", name: "Paris Charles de Gaulle Airport", id: "arp_cdg_fr" }, origin: { icao_code: "LOWW", iata_country_code: "AT", iata_city_code: "VIE", city_name: "Vienna", iata_code: "VIE", latitude: 48.113065, longitude: 16.568137, city: null, time_zone: "Europe/Vienna", type: "airport", name: "Vienna International Airport", id: "arp_vie_at" }, id: "sli_0000AvQjcLqSuF2bm6U2U6" }], passengers: [{ born_on: "2007-04-29", loyalty_programme_accounts: [], family_name: "Botha", given_name: "Adriaan", gender: "m", infant_passenger_id: null, phone_number: "+12345642342", user_id: null, email: "adriaan.botha@typedev.co.za", title: "mr", type: "adult", id: "pas_0000AvQjcLZRvVQivKWRxi" }], conditions: { refund_before_departure: { penalty_currency: null, penalty_amount: null, allowed: !1 }, change_before_departure: { penalty_currency: "GBP", penalty_amount: "10.00", allowed: !0 } }, cancelled_at: null, changes: [], content: "managed", services: [], users: ["icu_0000Asbm8q0FlWOhf0fDUm"], metadata: null, type: "instant", owner: { logo_symbol_url: "https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/ZZ.svg", logo_lockup_url: null, conditions_of_carriage_url: "https://duffelairways.com/dummy-url/conditions-of-carriage", iata_code: "ZZ", name: "Duffel Airways", id: "arl_00009VME7D6ivUu8dn35WK" }, id: "ord_0000AvQk8IXqiCE2o20e00", status: "flight confirmed" }, g = "Flight booking found", _ = !0, h = { internalRequestId: "f6b54196-4d33-434d-9800-d9dc72a074ab" }, v = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useQuery as U } from "@tanstack/react-query";
|
|
2
2
|
import "react/jsx-runtime";
|
|
3
3
|
import "../arrayExtensions-DlcBOj5a.js";
|
|
4
|
-
import { E as N, t as F } from "../
|
|
4
|
+
import { E as N, t as F } from "../AccountService-B582vLTc.js";
|
|
5
5
|
import { useMemo as r } from "react";
|
|
6
6
|
import { FeatureService as e } from "../services/features/featureService.js";
|
|
7
7
|
const L = [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useQuery as u } from "@tanstack/react-query";
|
|
2
2
|
import "react/jsx-runtime";
|
|
3
3
|
import "../arrayExtensions-DlcBOj5a.js";
|
|
4
|
-
import { E as m, A as c,
|
|
4
|
+
import { E as m, A as c, a as f } from "../AccountService-B582vLTc.js";
|
|
5
5
|
import { useEffect as d } from "react";
|
|
6
6
|
import { useAwayzContext as y } from "./useAwayzContext.js";
|
|
7
7
|
var s = /* @__PURE__ */ ((r) => (r.HOTEL = "Hotel", r.FLIGHT = "Flight", r))(s || {});
|