@odynn/awayz-core 0.5.0 → 0.5.2
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/components/Bookings/FlightBooking/FlightBooking.js +65 -205
- package/dist/components/Bookings/HotelBooking/HotelBooking.js +1 -1
- package/dist/components/CashValue/CashValue.js +431 -418
- package/dist/components/CashValue/CashValue.stories.js +17 -16
- package/dist/components/Menu/Menu.js +1 -1
- package/dist/components/Wallet/Card/Card.js +1 -1
- package/dist/components/Wallet/Card/Card.stories.js +7 -6
- package/dist/hooks/useBookingManagement/useBookingManagement.js +7 -6
- package/dist/hooks/useBookingManagement/useBookingManagement.test.js +2 -1
- package/dist/hooks/useTripManagement/useTripManagement.js +3 -2
- package/dist/hooks/useTripManagement/useTripManagement.test.js +1 -0
- package/dist/hooks/useWallet/useWallet.js +8 -7
- package/dist/hooks/useWallet/useWallet.test.js +1 -0
- package/dist/{index-agnspg2e.js → index-CDh8vAM_.js} +2 -2
- package/dist/lib/components/CashValue/CashValue.d.ts +5 -1
- package/dist/lib/components/CashValue/CashValue.stories.d.ts +1 -1
- package/dist/lib/hooks/useBookingManagement/mocks/HotelBooking200.json.d.ts +1 -1
- package/dist/providers/AwayzProvider.js +6 -5
- package/dist/services/bookings/BookingService.js +26 -25
- package/dist/services/currency/CurrencyService.js +7 -6
- package/package.json +1 -1
|
@@ -1,237 +1,97 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { h as
|
|
3
|
-
import { E as
|
|
4
|
-
import { a as
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
1
|
+
import { jsx as e, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import { h as t } from "../../../arrayExtensions-DlcBOj5a.js";
|
|
3
|
+
import { E as o } from "../../../DateFormats-DZD30Nea.js";
|
|
4
|
+
import { a as r } from "../../../keys-DcSEucOc.js";
|
|
5
|
+
import "react";
|
|
6
|
+
import { useTranslation as D } from "react-i18next";
|
|
7
|
+
import { F as E } from "../../../index-CDh8vAM_.js";
|
|
8
|
+
import M from "../../Menu/Menu.js";
|
|
8
9
|
import '../../../assets/_styles4.css';/* empty css */
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return e.services.logger.forward(r, "warn", "react-i18next::", !0);
|
|
17
|
-
E(r[0]) && (r[0] = `react-i18next:: ${r[0]}`), (N = (p = e == null ? void 0 : e.services) == null ? void 0 : p.logger) != null && N.warn ? e.services.logger.warn(...r) : console != null && console.warn && console.warn(...r);
|
|
18
|
-
}, U = {}, M = (e, t, s, i) => {
|
|
19
|
-
E(s) && U[s] || (E(s) && (U[s] = /* @__PURE__ */ new Date()), K(e, t, s, i));
|
|
20
|
-
}, j = (e, t) => () => {
|
|
21
|
-
if (e.isInitialized)
|
|
22
|
-
t();
|
|
23
|
-
else {
|
|
24
|
-
const s = () => {
|
|
25
|
-
setTimeout(() => {
|
|
26
|
-
e.off("initialized", s);
|
|
27
|
-
}, 0), t();
|
|
28
|
-
};
|
|
29
|
-
e.on("initialized", s);
|
|
30
|
-
}
|
|
31
|
-
}, D = (e, t, s) => {
|
|
32
|
-
e.loadNamespaces(t, j(e, s));
|
|
33
|
-
}, z = (e, t, s, i) => {
|
|
34
|
-
if (E(s) && (s = [s]), e.options.preload && e.options.preload.indexOf(t) > -1) return D(e, s, i);
|
|
35
|
-
s.forEach((r) => {
|
|
36
|
-
e.options.ns.indexOf(r) < 0 && e.options.ns.push(r);
|
|
37
|
-
}), e.loadLanguages(t, j(e, i));
|
|
38
|
-
}, J = (e, t, s = {}) => !t.languages || !t.languages.length ? (M(t, "NO_LANGUAGES", "i18n.languages were undefined or empty", {
|
|
39
|
-
languages: t.languages
|
|
40
|
-
}), !0) : t.hasLoadedNamespace(e, {
|
|
41
|
-
lng: s.lng,
|
|
42
|
-
precheck: (i, r) => {
|
|
43
|
-
if (s.bindI18n && s.bindI18n.indexOf("languageChanging") > -1 && i.services.backendConnector.backend && i.isLanguageChangingTo && !r(i.isLanguageChangingTo, e)) return !1;
|
|
44
|
-
}
|
|
45
|
-
}), E = (e) => typeof e == "string", X = (e) => typeof e == "object" && e !== null, Q = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g, Z = {
|
|
46
|
-
"&": "&",
|
|
47
|
-
"&": "&",
|
|
48
|
-
"<": "<",
|
|
49
|
-
"<": "<",
|
|
50
|
-
">": ">",
|
|
51
|
-
">": ">",
|
|
52
|
-
"'": "'",
|
|
53
|
-
"'": "'",
|
|
54
|
-
""": '"',
|
|
55
|
-
""": '"',
|
|
56
|
-
" ": " ",
|
|
57
|
-
" ": " ",
|
|
58
|
-
"©": "©",
|
|
59
|
-
"©": "©",
|
|
60
|
-
"®": "®",
|
|
61
|
-
"®": "®",
|
|
62
|
-
"…": "…",
|
|
63
|
-
"…": "…",
|
|
64
|
-
"/": "/",
|
|
65
|
-
"/": "/"
|
|
66
|
-
}, V = (e) => Z[e], ee = (e) => e.replace(Q, V);
|
|
67
|
-
let te = {
|
|
68
|
-
bindI18n: "languageChanged",
|
|
69
|
-
bindI18nStore: "",
|
|
70
|
-
transEmptyNodeValue: "",
|
|
71
|
-
transSupportBasicHtmlNodes: !0,
|
|
72
|
-
transWrapTextNodes: "",
|
|
73
|
-
transKeepBasicHtmlNodesFor: ["br", "strong", "i", "p"],
|
|
74
|
-
useSuspense: !0,
|
|
75
|
-
unescape: ee
|
|
76
|
-
};
|
|
77
|
-
const se = () => te;
|
|
78
|
-
let ne;
|
|
79
|
-
const ae = () => ne, ie = B();
|
|
80
|
-
class oe {
|
|
81
|
-
constructor() {
|
|
82
|
-
this.usedNamespaces = {};
|
|
83
|
-
}
|
|
84
|
-
addUsedNamespaces(t) {
|
|
85
|
-
t.forEach((s) => {
|
|
86
|
-
this.usedNamespaces[s] || (this.usedNamespaces[s] = !0);
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
getUsedNamespaces() {
|
|
90
|
-
return Object.keys(this.usedNamespaces);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
const re = (e, t) => {
|
|
94
|
-
const s = A();
|
|
95
|
-
return F(() => {
|
|
96
|
-
s.current = e;
|
|
97
|
-
}, [e, t]), s.current;
|
|
98
|
-
}, H = (e, t, s, i) => e.getFixedT(t, s, i), ce = (e, t, s, i) => W(H(e, t, s, i), [e, t, s, i]), le = (e, t = {}) => {
|
|
99
|
-
var R, k, L, O;
|
|
100
|
-
const {
|
|
101
|
-
i18n: s
|
|
102
|
-
} = t, {
|
|
103
|
-
i18n: i,
|
|
104
|
-
defaultNS: r
|
|
105
|
-
} = G(ie) || {}, n = s || i || ae();
|
|
106
|
-
if (n && !n.reportNamespaces && (n.reportNamespaces = new oe()), !n) {
|
|
107
|
-
M(n, "NO_I18NEXT_INSTANCE", "useTranslation: You will need to pass in an i18next instance by using initReactI18next");
|
|
108
|
-
const l = (g, h) => E(h) ? h : X(h) && E(h.defaultValue) ? h.defaultValue : Array.isArray(g) ? g[g.length - 1] : g, f = [l, {}, !1];
|
|
109
|
-
return f.t = l, f.i18n = {}, f.ready = !1, f;
|
|
110
|
-
}
|
|
111
|
-
(R = n.options.react) != null && R.wait && M(n, "DEPRECATED_OPTION", "useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");
|
|
112
|
-
const d = {
|
|
113
|
-
...se(),
|
|
114
|
-
...n.options.react,
|
|
115
|
-
...t
|
|
116
|
-
}, {
|
|
117
|
-
useSuspense: p,
|
|
118
|
-
keyPrefix: N
|
|
119
|
-
} = d;
|
|
120
|
-
let o = r || ((k = n.options) == null ? void 0 : k.defaultNS);
|
|
121
|
-
o = E(o) ? [o] : o || ["translation"], (O = (L = n.reportNamespaces).addUsedNamespaces) == null || O.call(L, o);
|
|
122
|
-
const m = (n.isInitialized || n.initializedStoreOnce) && o.every((l) => J(l, n, d)), S = ce(n, t.lng || null, d.nsMode === "fallback" ? o : o[0], N), u = () => S, C = () => H(n, t.lng || null, d.nsMode === "fallback" ? o : o[0], N), [_, T] = Y(u);
|
|
123
|
-
let y = o.join();
|
|
124
|
-
t.lng && (y = `${t.lng}${y}`);
|
|
125
|
-
const P = re(y), v = A(!0);
|
|
126
|
-
F(() => {
|
|
127
|
-
const {
|
|
128
|
-
bindI18n: l,
|
|
129
|
-
bindI18nStore: f
|
|
130
|
-
} = d;
|
|
131
|
-
v.current = !0, !m && !p && (t.lng ? z(n, t.lng, o, () => {
|
|
132
|
-
v.current && T(C);
|
|
133
|
-
}) : D(n, o, () => {
|
|
134
|
-
v.current && T(C);
|
|
135
|
-
})), m && P && P !== y && v.current && T(C);
|
|
136
|
-
const g = () => {
|
|
137
|
-
v.current && T(C);
|
|
138
|
-
};
|
|
139
|
-
return l && (n == null || n.on(l, g)), f && (n == null || n.store.on(f, g)), () => {
|
|
140
|
-
v.current = !1, n && l && (l == null || l.split(" ").forEach((h) => n.off(h, g))), f && n && f.split(" ").forEach((h) => n.store.off(h, g));
|
|
141
|
-
};
|
|
142
|
-
}, [n, y]), F(() => {
|
|
143
|
-
v.current && m && T(u);
|
|
144
|
-
}, [n, N, m]);
|
|
145
|
-
const w = [_, n, m];
|
|
146
|
-
if (w.t = _, w.i18n = n, w.ready = m, m || !m && !p) return w;
|
|
147
|
-
throw new Promise((l) => {
|
|
148
|
-
t.lng ? z(n, t.lng, o, () => l()) : D(n, o, () => l());
|
|
149
|
-
});
|
|
150
|
-
}, ve = ({
|
|
151
|
-
airlines: e,
|
|
152
|
-
departure: t,
|
|
153
|
-
arrival: s,
|
|
154
|
-
bookingRef: i,
|
|
155
|
-
flightClass: r,
|
|
156
|
-
numberOfPassengers: n,
|
|
10
|
+
const b = ({
|
|
11
|
+
airlines: s,
|
|
12
|
+
departure: c,
|
|
13
|
+
arrival: l,
|
|
14
|
+
bookingRef: v,
|
|
15
|
+
flightClass: N,
|
|
16
|
+
numberOfPassengers: g,
|
|
157
17
|
cancelledAt: d,
|
|
158
|
-
hasAirlineChanges:
|
|
159
|
-
onClick:
|
|
160
|
-
contextOptions:
|
|
18
|
+
hasAirlineChanges: m,
|
|
19
|
+
onClick: f,
|
|
20
|
+
contextOptions: h = []
|
|
161
21
|
}) => {
|
|
162
|
-
var
|
|
163
|
-
const { t:
|
|
164
|
-
return /* @__PURE__ */
|
|
165
|
-
/* @__PURE__ */
|
|
166
|
-
/* @__PURE__ */
|
|
167
|
-
/* @__PURE__ */
|
|
168
|
-
/* @__PURE__ */
|
|
169
|
-
/* @__PURE__ */
|
|
170
|
-
] },
|
|
171
|
-
|
|
22
|
+
var p;
|
|
23
|
+
const { t: n } = D();
|
|
24
|
+
return /* @__PURE__ */ e("div", { className: "selected-flight-card", onClick: f, children: /* @__PURE__ */ i("div", { className: "content", children: [
|
|
25
|
+
/* @__PURE__ */ i("div", { className: "top-section", children: [
|
|
26
|
+
/* @__PURE__ */ i("div", { className: "header", children: [
|
|
27
|
+
/* @__PURE__ */ e("div", { children: s == null ? void 0 : s.map((a) => /* @__PURE__ */ i("div", { className: "airline-logo tip", children: [
|
|
28
|
+
/* @__PURE__ */ e("img", { src: a.logo, alt: a.name }),
|
|
29
|
+
/* @__PURE__ */ e("span", { className: "right", children: a.name })
|
|
30
|
+
] }, a.name)) }),
|
|
31
|
+
h.length > 0 && /* @__PURE__ */ e(
|
|
172
32
|
"div",
|
|
173
33
|
{
|
|
174
|
-
onClick: (
|
|
175
|
-
|
|
34
|
+
onClick: (a) => {
|
|
35
|
+
a.stopPropagation();
|
|
176
36
|
},
|
|
177
|
-
children: /* @__PURE__ */
|
|
37
|
+
children: /* @__PURE__ */ e(M, { options: h })
|
|
178
38
|
}
|
|
179
39
|
)
|
|
180
40
|
] }),
|
|
181
|
-
/* @__PURE__ */
|
|
182
|
-
/* @__PURE__ */
|
|
183
|
-
/* @__PURE__ */
|
|
184
|
-
/* @__PURE__ */
|
|
185
|
-
/* @__PURE__ */
|
|
41
|
+
/* @__PURE__ */ i("div", { className: "flight", children: [
|
|
42
|
+
/* @__PURE__ */ e("p", { className: "departure-title", children: c.airportCode }),
|
|
43
|
+
/* @__PURE__ */ e(E, {}),
|
|
44
|
+
/* @__PURE__ */ e("p", { className: "arrival-title", children: l.airportCode }),
|
|
45
|
+
/* @__PURE__ */ e("span", { className: "flight-trail" })
|
|
186
46
|
] }),
|
|
187
|
-
/* @__PURE__ */
|
|
188
|
-
/* @__PURE__ */
|
|
189
|
-
/* @__PURE__ */
|
|
190
|
-
/* @__PURE__ */
|
|
47
|
+
/* @__PURE__ */ i("div", { className: "flight-details", children: [
|
|
48
|
+
/* @__PURE__ */ i("div", { className: "destination", children: [
|
|
49
|
+
/* @__PURE__ */ e("span", { children: c.location }),
|
|
50
|
+
/* @__PURE__ */ e("span", { children: l.location })
|
|
191
51
|
] }),
|
|
192
|
-
/* @__PURE__ */
|
|
193
|
-
/* @__PURE__ */
|
|
194
|
-
|
|
52
|
+
/* @__PURE__ */ i("div", { className: "time", children: [
|
|
53
|
+
/* @__PURE__ */ e("p", { children: t(c.dateTime).format(
|
|
54
|
+
n(r.DATE_TIME_MEDIUM, o.FlightShortDate)
|
|
195
55
|
) }),
|
|
196
|
-
/* @__PURE__ */
|
|
197
|
-
|
|
56
|
+
/* @__PURE__ */ e("p", { children: t(l.dateTime).format(
|
|
57
|
+
n(r.DATE_TIME_MEDIUM, o.FlightShortDate)
|
|
198
58
|
) })
|
|
199
59
|
] })
|
|
200
60
|
] })
|
|
201
61
|
] }),
|
|
202
|
-
/* @__PURE__ */
|
|
203
|
-
/* @__PURE__ */
|
|
204
|
-
(d ||
|
|
205
|
-
d && /* @__PURE__ */
|
|
62
|
+
/* @__PURE__ */ e("div", { className: "mid-section", children: /* @__PURE__ */ e("div", { className: "dashes" }) }),
|
|
63
|
+
/* @__PURE__ */ i("div", { className: "bottom-section", children: [
|
|
64
|
+
(d || m) && /* @__PURE__ */ i("div", { className: "notices", children: [
|
|
65
|
+
d && /* @__PURE__ */ e("div", { className: "cancelled-notice", children: /* @__PURE__ */ i("p", { children: [
|
|
206
66
|
"Cancelled:",
|
|
207
67
|
" ",
|
|
208
|
-
(
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
68
|
+
(p = t(d)) == null ? void 0 : p.format(
|
|
69
|
+
n(
|
|
70
|
+
r.DISPLAY_MEDIUM_WITH_YEAR,
|
|
71
|
+
o.USStringDateFormat
|
|
212
72
|
)
|
|
213
73
|
)
|
|
214
74
|
] }) }),
|
|
215
|
-
|
|
75
|
+
m && /* @__PURE__ */ e("div", { className: "cancelled-notice", children: /* @__PURE__ */ e("p", { children: "Changes Pending Review" }) })
|
|
216
76
|
] }),
|
|
217
|
-
/* @__PURE__ */
|
|
218
|
-
/* @__PURE__ */
|
|
77
|
+
/* @__PURE__ */ i("div", { className: "bottom-header", children: [
|
|
78
|
+
/* @__PURE__ */ e("p", { children: "Booking Confirmation" }),
|
|
219
79
|
" ",
|
|
220
|
-
/* @__PURE__ */
|
|
80
|
+
/* @__PURE__ */ e("div", { className: "id-and-icon", children: /* @__PURE__ */ e("span", { children: v }) })
|
|
221
81
|
] }),
|
|
222
|
-
/* @__PURE__ */
|
|
223
|
-
/* @__PURE__ */
|
|
224
|
-
/* @__PURE__ */
|
|
225
|
-
/* @__PURE__ */
|
|
82
|
+
/* @__PURE__ */ i("div", { className: "bottom-section-details", children: [
|
|
83
|
+
/* @__PURE__ */ i("div", { children: [
|
|
84
|
+
/* @__PURE__ */ e("p", { children: "Class" }),
|
|
85
|
+
/* @__PURE__ */ e("span", { children: N })
|
|
226
86
|
] }),
|
|
227
|
-
/* @__PURE__ */
|
|
228
|
-
/* @__PURE__ */
|
|
229
|
-
/* @__PURE__ */
|
|
87
|
+
/* @__PURE__ */ i("div", { children: [
|
|
88
|
+
/* @__PURE__ */ e("p", { children: "Passengers" }),
|
|
89
|
+
/* @__PURE__ */ e("span", { children: g })
|
|
230
90
|
] })
|
|
231
91
|
] })
|
|
232
92
|
] })
|
|
233
93
|
] }) });
|
|
234
94
|
};
|
|
235
95
|
export {
|
|
236
|
-
|
|
96
|
+
b as FlightBooking
|
|
237
97
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as e, jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import { G as g } from "../../../index-
|
|
2
|
+
import { G as g } from "../../../index-CDh8vAM_.js";
|
|
3
3
|
import { h as k } from "../../../arrayExtensions-DlcBOj5a.js";
|
|
4
4
|
import { E as N } from "../../../DateFormats-DZD30Nea.js";
|
|
5
5
|
import "react";
|