@odynn/awayz-flights 0.10.13 → 0.10.15
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/FlightItinerary-BMRY5V0b.js +103 -0
- package/dist/components/FlightItinerary/FlightItinerary.js +3 -2
- package/dist/components/FlightItineraryDropdown/FlightItineraryDropdown.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/hooks/useFlightSearch/useFlightSearch.js +764 -737
- package/dist/keys-BcBfU51M.js +5 -0
- package/dist/main.js +1 -1
- package/dist/utils/flightUtils.js +91 -88
- package/package.json +2 -2
- package/dist/FlightItinerary-WKjh-sAR.js +0 -104
|
@@ -1,30 +1,31 @@
|
|
|
1
|
-
import { useAwayzContext as
|
|
2
|
-
import { useQuery as
|
|
1
|
+
import { useAwayzContext as kt, awayzClient as te, getBaseUrl as Dt, AccountService as Bt } from "@odynn/awayz-core";
|
|
2
|
+
import { useQuery as qt, useMutation as ge } from "@tanstack/react-query";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "../../moment-BGjjqtLQ.js";
|
|
5
5
|
import "../../arrayExtensions-Ce8YopTP.js";
|
|
6
|
-
import { F as J, c as
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
6
|
+
import { F as J, c as Me } from "../../FlightsService-BgXzj6SR.js";
|
|
7
|
+
import { a as jt } from "../../keys-BcBfU51M.js";
|
|
8
|
+
import { useState as Oe, useRef as Te } from "react";
|
|
9
|
+
import Mt from "../../stores/useFlightStore.js";
|
|
10
|
+
import { EFlightType as st, EFlightPaymentType as ne } from "../../types/enums.js";
|
|
11
|
+
import { ECabinClass as vt } from "../../types/ECabinClass.js";
|
|
12
|
+
import { passengerValues as ve, mapDataToFlightDetails as Ht, groupFlightResults as zt, buildFlightSearchQuery as $t } from "../../utils/flightUtils.js";
|
|
13
|
+
async function Vt(e, t) {
|
|
13
14
|
const n = e.getReader();
|
|
14
15
|
let r;
|
|
15
16
|
for (; !(r = await n.read()).done; )
|
|
16
17
|
t(r.value);
|
|
17
18
|
}
|
|
18
|
-
function
|
|
19
|
+
function Jt(e) {
|
|
19
20
|
let t, n, r, s = !1;
|
|
20
21
|
return function(o) {
|
|
21
|
-
t === void 0 ? (t = o, n = 0, r = -1) : t =
|
|
22
|
+
t === void 0 ? (t = o, n = 0, r = -1) : t = Gt(t, o);
|
|
22
23
|
const c = t.length;
|
|
23
24
|
let f = 0;
|
|
24
25
|
for (; n < c; ) {
|
|
25
26
|
s && (t[n] === 10 && (f = ++n), s = !1);
|
|
26
|
-
let
|
|
27
|
-
for (; n < c &&
|
|
27
|
+
let u = -1;
|
|
28
|
+
for (; n < c && u === -1; ++n)
|
|
28
29
|
switch (t[n]) {
|
|
29
30
|
case 58:
|
|
30
31
|
r === -1 && (r = n - f);
|
|
@@ -32,48 +33,48 @@ function qt(e) {
|
|
|
32
33
|
case 13:
|
|
33
34
|
s = !0;
|
|
34
35
|
case 10:
|
|
35
|
-
|
|
36
|
+
u = n;
|
|
36
37
|
break;
|
|
37
38
|
}
|
|
38
|
-
if (
|
|
39
|
+
if (u === -1)
|
|
39
40
|
break;
|
|
40
|
-
e(t.subarray(f,
|
|
41
|
+
e(t.subarray(f, u), r), f = n, r = -1;
|
|
41
42
|
}
|
|
42
43
|
f === c ? t = void 0 : f !== 0 && (t = t.subarray(f), n -= f);
|
|
43
44
|
};
|
|
44
45
|
}
|
|
45
|
-
function
|
|
46
|
-
let r =
|
|
46
|
+
function Wt(e, t, n) {
|
|
47
|
+
let r = He();
|
|
47
48
|
const s = new TextDecoder();
|
|
48
49
|
return function(o, c) {
|
|
49
50
|
if (o.length === 0)
|
|
50
|
-
n == null || n(r), r =
|
|
51
|
+
n == null || n(r), r = He();
|
|
51
52
|
else if (c > 0) {
|
|
52
|
-
const f = s.decode(o.subarray(0, c)),
|
|
53
|
+
const f = s.decode(o.subarray(0, c)), u = c + (o[c + 1] === 32 ? 2 : 1), l = s.decode(o.subarray(u));
|
|
53
54
|
switch (f) {
|
|
54
55
|
case "data":
|
|
55
56
|
r.data = r.data ? r.data + `
|
|
56
|
-
` +
|
|
57
|
+
` + l : l;
|
|
57
58
|
break;
|
|
58
59
|
case "event":
|
|
59
|
-
r.event =
|
|
60
|
+
r.event = l;
|
|
60
61
|
break;
|
|
61
62
|
case "id":
|
|
62
|
-
e(r.id =
|
|
63
|
+
e(r.id = l);
|
|
63
64
|
break;
|
|
64
65
|
case "retry":
|
|
65
|
-
const
|
|
66
|
-
isNaN(
|
|
66
|
+
const h = parseInt(l, 10);
|
|
67
|
+
isNaN(h) || t(r.retry = h);
|
|
67
68
|
break;
|
|
68
69
|
}
|
|
69
70
|
}
|
|
70
71
|
};
|
|
71
72
|
}
|
|
72
|
-
function
|
|
73
|
+
function Gt(e, t) {
|
|
73
74
|
const n = new Uint8Array(e.length + t.length);
|
|
74
75
|
return n.set(e), n.set(t, e.length), n;
|
|
75
76
|
}
|
|
76
|
-
function
|
|
77
|
+
function He() {
|
|
77
78
|
return {
|
|
78
79
|
data: "",
|
|
79
80
|
event: "",
|
|
@@ -81,7 +82,7 @@ function Be() {
|
|
|
81
82
|
retry: void 0
|
|
82
83
|
};
|
|
83
84
|
}
|
|
84
|
-
var
|
|
85
|
+
var Kt = function(e, t) {
|
|
85
86
|
var n = {};
|
|
86
87
|
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
|
|
87
88
|
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -89,81 +90,81 @@ var Ht = function(e, t) {
|
|
|
89
90
|
t.indexOf(r[s]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[s]) && (n[r[s]] = e[r[s]]);
|
|
90
91
|
return n;
|
|
91
92
|
};
|
|
92
|
-
const
|
|
93
|
-
function
|
|
94
|
-
var { signal: n, headers: r, onopen: s, onmessage: i, onclose: o, onerror: c, openWhenHidden: f, fetch:
|
|
95
|
-
return new Promise((
|
|
93
|
+
const Pe = "text/event-stream", Xt = 1e3, ze = "last-event-id";
|
|
94
|
+
function Yt(e, t) {
|
|
95
|
+
var { signal: n, headers: r, onopen: s, onmessage: i, onclose: o, onerror: c, openWhenHidden: f, fetch: u } = t, l = Kt(t, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
|
|
96
|
+
return new Promise((h, w) => {
|
|
96
97
|
const S = Object.assign({}, r);
|
|
97
|
-
S.accept || (S.accept =
|
|
98
|
-
let
|
|
98
|
+
S.accept || (S.accept = Pe);
|
|
99
|
+
let d;
|
|
99
100
|
function m() {
|
|
100
|
-
|
|
101
|
+
d.abort(), document.hidden || T();
|
|
101
102
|
}
|
|
102
103
|
f || document.addEventListener("visibilitychange", m);
|
|
103
|
-
let
|
|
104
|
+
let p = Xt, y = 0;
|
|
104
105
|
function E() {
|
|
105
|
-
document.removeEventListener("visibilitychange", m), window.clearTimeout(y),
|
|
106
|
+
document.removeEventListener("visibilitychange", m), window.clearTimeout(y), d.abort();
|
|
106
107
|
}
|
|
107
108
|
n == null || n.addEventListener("abort", () => {
|
|
108
|
-
E(),
|
|
109
|
+
E(), h();
|
|
109
110
|
});
|
|
110
|
-
const g =
|
|
111
|
-
async function
|
|
112
|
-
var
|
|
113
|
-
|
|
111
|
+
const g = u ?? window.fetch, x = s ?? Zt;
|
|
112
|
+
async function T() {
|
|
113
|
+
var L;
|
|
114
|
+
d = new AbortController();
|
|
114
115
|
try {
|
|
115
|
-
const
|
|
116
|
-
await
|
|
117
|
-
|
|
118
|
-
}, (
|
|
119
|
-
|
|
120
|
-
}, i))), o == null || o(), E(),
|
|
121
|
-
} catch (
|
|
122
|
-
if (!
|
|
116
|
+
const U = await g(e, Object.assign(Object.assign({}, l), { headers: S, signal: d.signal }));
|
|
117
|
+
await x(U), await Vt(U.body, Jt(Wt((F) => {
|
|
118
|
+
F ? S[ze] = F : delete S[ze];
|
|
119
|
+
}, (F) => {
|
|
120
|
+
p = F;
|
|
121
|
+
}, i))), o == null || o(), E(), h();
|
|
122
|
+
} catch (U) {
|
|
123
|
+
if (!d.signal.aborted)
|
|
123
124
|
try {
|
|
124
|
-
const
|
|
125
|
-
window.clearTimeout(y), y = window.setTimeout(
|
|
126
|
-
} catch (
|
|
127
|
-
E(), w(
|
|
125
|
+
const F = (L = c == null ? void 0 : c(U)) !== null && L !== void 0 ? L : p;
|
|
126
|
+
window.clearTimeout(y), y = window.setTimeout(T, F);
|
|
127
|
+
} catch (F) {
|
|
128
|
+
E(), w(F);
|
|
128
129
|
}
|
|
129
130
|
}
|
|
130
131
|
}
|
|
131
|
-
|
|
132
|
+
T();
|
|
132
133
|
});
|
|
133
134
|
}
|
|
134
|
-
function
|
|
135
|
+
function Zt(e) {
|
|
135
136
|
const t = e.headers.get("content-type");
|
|
136
|
-
if (!(t != null && t.startsWith(
|
|
137
|
-
throw new Error(`Expected content-type to be ${
|
|
137
|
+
if (!(t != null && t.startsWith(Pe)))
|
|
138
|
+
throw new Error(`Expected content-type to be ${Pe}, Actual: ${t}`);
|
|
138
139
|
}
|
|
139
140
|
var z = /* @__PURE__ */ ((e) => (e.LOCATIONS = "LOCATIONS", e.CHECK_USER = "CHECK_USER", e.USER_REGIONS = "USER_REGIONS", e.CONVERT_CURRENCY = "CONVERT_CURRENCY", e.CLIENT_COMPONENT_KEY = "CLIENT_COMPONENT_KEY", e.SEARCH_LIMIT = "SEARCH_LIMIT", e.PROGRAMS = "PROGRAMS", e.USER_PROGRAMS = "USER_PROGRAMS", e.LINKED_USER_PROGRAMS = "LINKED_USER_PROGRAMS", e.BANKS = "BANKS", e.CARDS = "CARDS", e.USER_CARDS = "USER_CARDS", e.TRIPS = "TRIPS", e.UNCATEGORISED_BOOKINGS = "UNCATEGORISED_BOOKINGS", e.BOOKING = "BOOKING", e.VALUE_CENTS = "VALUE_CENTS", e.AVAILABILITY_ALERTS = "AVAILABILITY_ALERTS", e.ALERT_NOTIFICATIONS = "ALERT_NOTIFICATIONS", e.POINTS_AS_CASH = "POINTS_AS_CASH", e.GET_USER_REGION = "get_user_region", e.PRICING = "pricing", e.FAQS = "faqs", e.FEATURES = "features", e.AIRLINE_HEALTH = "airline_health", e.SUPPORTED_AIRLINE_PROGRAMS = "supported_airline_programs", e.CLIENT_DETAILS = "client-details", e))(z || {});
|
|
140
|
-
function
|
|
141
|
+
function ot(e, t) {
|
|
141
142
|
return function() {
|
|
142
143
|
return e.apply(t, arguments);
|
|
143
144
|
};
|
|
144
145
|
}
|
|
145
|
-
const { toString:
|
|
146
|
-
const n =
|
|
146
|
+
const { toString: Qt } = Object.prototype, { getPrototypeOf: De } = Object, { iterator: le, toStringTag: it } = Symbol, fe = /* @__PURE__ */ ((e) => (t) => {
|
|
147
|
+
const n = Qt.call(t);
|
|
147
148
|
return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
|
|
148
|
-
})(/* @__PURE__ */ Object.create(null)),
|
|
149
|
-
function
|
|
150
|
-
return e !== null && !G(e) && e.constructor !== null && !G(e.constructor) &&
|
|
149
|
+
})(/* @__PURE__ */ Object.create(null)), B = (e) => (e = e.toLowerCase(), (t) => fe(t) === e), de = (e) => (t) => typeof t === e, { isArray: $ } = Array, G = de("undefined");
|
|
150
|
+
function en(e) {
|
|
151
|
+
return e !== null && !G(e) && e.constructor !== null && !G(e.constructor) && k(e.constructor.isBuffer) && e.constructor.isBuffer(e);
|
|
151
152
|
}
|
|
152
|
-
const
|
|
153
|
-
function
|
|
153
|
+
const at = B("ArrayBuffer");
|
|
154
|
+
function tn(e) {
|
|
154
155
|
let t;
|
|
155
|
-
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer &&
|
|
156
|
+
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && at(e.buffer), t;
|
|
156
157
|
}
|
|
157
|
-
const
|
|
158
|
-
if (
|
|
158
|
+
const nn = de("string"), k = de("function"), ct = de("number"), he = (e) => e !== null && typeof e == "object", rn = (e) => e === !0 || e === !1, se = (e) => {
|
|
159
|
+
if (fe(e) !== "object")
|
|
159
160
|
return !1;
|
|
160
|
-
const t =
|
|
161
|
-
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(
|
|
162
|
-
},
|
|
161
|
+
const t = De(e);
|
|
162
|
+
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(it in e) && !(le in e);
|
|
163
|
+
}, sn = B("Date"), on = B("File"), an = B("Blob"), cn = B("FileList"), un = (e) => he(e) && k(e.pipe), ln = (e) => {
|
|
163
164
|
let t;
|
|
164
|
-
return e && (typeof FormData == "function" && e instanceof FormData ||
|
|
165
|
-
t === "object" &&
|
|
166
|
-
},
|
|
165
|
+
return e && (typeof FormData == "function" && e instanceof FormData || k(e.append) && ((t = fe(e)) === "formdata" || // detect form-data instance
|
|
166
|
+
t === "object" && k(e.toString) && e.toString() === "[object FormData]"));
|
|
167
|
+
}, fn = B("URLSearchParams"), [dn, hn, pn, mn] = ["ReadableStream", "Request", "Response", "Headers"].map(B), bn = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
167
168
|
function K(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
168
169
|
if (e === null || typeof e > "u")
|
|
169
170
|
return;
|
|
@@ -178,7 +179,7 @@ function K(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
|
178
179
|
c = i[r], t.call(null, e[c], c, e);
|
|
179
180
|
}
|
|
180
181
|
}
|
|
181
|
-
function
|
|
182
|
+
function ut(e, t) {
|
|
182
183
|
t = t.toLowerCase();
|
|
183
184
|
const n = Object.keys(e);
|
|
184
185
|
let r = n.length, s;
|
|
@@ -187,75 +188,75 @@ function st(e, t) {
|
|
|
187
188
|
return s;
|
|
188
189
|
return null;
|
|
189
190
|
}
|
|
190
|
-
const M = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global,
|
|
191
|
-
function
|
|
192
|
-
const { caseless: e } =
|
|
193
|
-
const i = e &&
|
|
194
|
-
|
|
191
|
+
const M = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, lt = (e) => !G(e) && e !== M;
|
|
192
|
+
function Ie() {
|
|
193
|
+
const { caseless: e } = lt(this) && this || {}, t = {}, n = (r, s) => {
|
|
194
|
+
const i = e && ut(t, s) || s;
|
|
195
|
+
se(t[i]) && se(r) ? t[i] = Ie(t[i], r) : se(r) ? t[i] = Ie({}, r) : $(r) ? t[i] = r.slice() : t[i] = r;
|
|
195
196
|
};
|
|
196
197
|
for (let r = 0, s = arguments.length; r < s; r++)
|
|
197
198
|
arguments[r] && K(arguments[r], n);
|
|
198
199
|
return t;
|
|
199
200
|
}
|
|
200
|
-
const
|
|
201
|
-
n &&
|
|
202
|
-
}, { allOwnKeys: r }), e),
|
|
201
|
+
const Rn = (e, t, n, { allOwnKeys: r } = {}) => (K(t, (s, i) => {
|
|
202
|
+
n && k(s) ? e[i] = ot(s, n) : e[i] = s;
|
|
203
|
+
}, { allOwnKeys: r }), e), wn = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), Sn = (e, t, n, r) => {
|
|
203
204
|
e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", {
|
|
204
205
|
value: t.prototype
|
|
205
206
|
}), n && Object.assign(e.prototype, n);
|
|
206
|
-
},
|
|
207
|
+
}, yn = (e, t, n, r) => {
|
|
207
208
|
let s, i, o;
|
|
208
209
|
const c = {};
|
|
209
210
|
if (t = t || {}, e == null) return t;
|
|
210
211
|
do {
|
|
211
212
|
for (s = Object.getOwnPropertyNames(e), i = s.length; i-- > 0; )
|
|
212
213
|
o = s[i], (!r || r(o, e, t)) && !c[o] && (t[o] = e[o], c[o] = !0);
|
|
213
|
-
e = n !== !1 &&
|
|
214
|
+
e = n !== !1 && De(e);
|
|
214
215
|
} while (e && (!n || n(e, t)) && e !== Object.prototype);
|
|
215
216
|
return t;
|
|
216
|
-
},
|
|
217
|
+
}, En = (e, t, n) => {
|
|
217
218
|
e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length;
|
|
218
219
|
const r = e.indexOf(t, n);
|
|
219
220
|
return r !== -1 && r === n;
|
|
220
|
-
},
|
|
221
|
+
}, gn = (e) => {
|
|
221
222
|
if (!e) return null;
|
|
222
223
|
if ($(e)) return e;
|
|
223
224
|
let t = e.length;
|
|
224
|
-
if (!
|
|
225
|
+
if (!ct(t)) return null;
|
|
225
226
|
const n = new Array(t);
|
|
226
227
|
for (; t-- > 0; )
|
|
227
228
|
n[t] = e[t];
|
|
228
229
|
return n;
|
|
229
|
-
},
|
|
230
|
-
const r = (e && e[
|
|
230
|
+
}, On = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && De(Uint8Array)), Tn = (e, t) => {
|
|
231
|
+
const r = (e && e[le]).call(e);
|
|
231
232
|
let s;
|
|
232
233
|
for (; (s = r.next()) && !s.done; ) {
|
|
233
234
|
const i = s.value;
|
|
234
235
|
t.call(e, i[0], i[1]);
|
|
235
236
|
}
|
|
236
|
-
},
|
|
237
|
+
}, An = (e, t) => {
|
|
237
238
|
let n;
|
|
238
239
|
const r = [];
|
|
239
240
|
for (; (n = e.exec(t)) !== null; )
|
|
240
241
|
r.push(n);
|
|
241
242
|
return r;
|
|
242
|
-
},
|
|
243
|
+
}, Cn = B("HTMLFormElement"), Nn = (e) => e.toLowerCase().replace(
|
|
243
244
|
/[-_\s]([a-z\d])(\w*)/g,
|
|
244
245
|
function(n, r, s) {
|
|
245
246
|
return r.toUpperCase() + s;
|
|
246
247
|
}
|
|
247
|
-
),
|
|
248
|
+
), $e = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), _n = B("RegExp"), ft = (e, t) => {
|
|
248
249
|
const n = Object.getOwnPropertyDescriptors(e), r = {};
|
|
249
250
|
K(n, (s, i) => {
|
|
250
251
|
let o;
|
|
251
252
|
(o = t(s, i, e)) !== !1 && (r[i] = o || s);
|
|
252
253
|
}), Object.defineProperties(e, r);
|
|
253
|
-
},
|
|
254
|
-
|
|
255
|
-
if (
|
|
254
|
+
}, Pn = (e) => {
|
|
255
|
+
ft(e, (t, n) => {
|
|
256
|
+
if (k(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
|
|
256
257
|
return !1;
|
|
257
258
|
const r = e[n];
|
|
258
|
-
if (
|
|
259
|
+
if (k(r)) {
|
|
259
260
|
if (t.enumerable = !1, "writable" in t) {
|
|
260
261
|
t.writable = !1;
|
|
261
262
|
return;
|
|
@@ -265,21 +266,21 @@ const ln = (e, t, n, { allOwnKeys: r } = {}) => (K(t, (s, i) => {
|
|
|
265
266
|
});
|
|
266
267
|
}
|
|
267
268
|
});
|
|
268
|
-
},
|
|
269
|
+
}, In = (e, t) => {
|
|
269
270
|
const n = {}, r = (s) => {
|
|
270
271
|
s.forEach((i) => {
|
|
271
272
|
n[i] = !0;
|
|
272
273
|
});
|
|
273
274
|
};
|
|
274
275
|
return $(e) ? r(e) : r(String(e).split(t)), n;
|
|
275
|
-
},
|
|
276
|
-
},
|
|
277
|
-
function
|
|
278
|
-
return !!(e &&
|
|
276
|
+
}, xn = () => {
|
|
277
|
+
}, Fn = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
|
|
278
|
+
function Ln(e) {
|
|
279
|
+
return !!(e && k(e.append) && e[it] === "FormData" && e[le]);
|
|
279
280
|
}
|
|
280
|
-
const
|
|
281
|
+
const Un = (e) => {
|
|
281
282
|
const t = new Array(10), n = (r, s) => {
|
|
282
|
-
if (
|
|
283
|
+
if (he(r)) {
|
|
283
284
|
if (t.indexOf(r) >= 0)
|
|
284
285
|
return;
|
|
285
286
|
if (!("toJSON" in r)) {
|
|
@@ -294,71 +295,71 @@ const Cn = (e) => {
|
|
|
294
295
|
return r;
|
|
295
296
|
};
|
|
296
297
|
return n(e, 0);
|
|
297
|
-
},
|
|
298
|
+
}, kn = B("AsyncFunction"), Dn = (e) => e && (he(e) || k(e)) && k(e.then) && k(e.catch), dt = ((e, t) => e ? setImmediate : t ? ((n, r) => (M.addEventListener("message", ({ source: s, data: i }) => {
|
|
298
299
|
s === M && i === n && r.length && r.shift()();
|
|
299
300
|
}, !1), (s) => {
|
|
300
301
|
r.push(s), M.postMessage(n, "*");
|
|
301
302
|
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
|
|
302
303
|
typeof setImmediate == "function",
|
|
303
|
-
|
|
304
|
-
),
|
|
304
|
+
k(M.postMessage)
|
|
305
|
+
), Bn = typeof queueMicrotask < "u" ? queueMicrotask.bind(M) : typeof process < "u" && process.nextTick || dt, qn = (e) => e != null && k(e[le]), a = {
|
|
305
306
|
isArray: $,
|
|
306
|
-
isArrayBuffer:
|
|
307
|
-
isBuffer:
|
|
308
|
-
isFormData:
|
|
309
|
-
isArrayBufferView:
|
|
310
|
-
isString:
|
|
311
|
-
isNumber:
|
|
312
|
-
isBoolean:
|
|
313
|
-
isObject:
|
|
314
|
-
isPlainObject:
|
|
315
|
-
isReadableStream:
|
|
316
|
-
isRequest:
|
|
317
|
-
isResponse:
|
|
318
|
-
isHeaders:
|
|
307
|
+
isArrayBuffer: at,
|
|
308
|
+
isBuffer: en,
|
|
309
|
+
isFormData: ln,
|
|
310
|
+
isArrayBufferView: tn,
|
|
311
|
+
isString: nn,
|
|
312
|
+
isNumber: ct,
|
|
313
|
+
isBoolean: rn,
|
|
314
|
+
isObject: he,
|
|
315
|
+
isPlainObject: se,
|
|
316
|
+
isReadableStream: dn,
|
|
317
|
+
isRequest: hn,
|
|
318
|
+
isResponse: pn,
|
|
319
|
+
isHeaders: mn,
|
|
319
320
|
isUndefined: G,
|
|
320
|
-
isDate:
|
|
321
|
-
isFile:
|
|
322
|
-
isBlob:
|
|
323
|
-
isRegExp:
|
|
324
|
-
isFunction:
|
|
325
|
-
isStream:
|
|
326
|
-
isURLSearchParams:
|
|
327
|
-
isTypedArray:
|
|
328
|
-
isFileList:
|
|
321
|
+
isDate: sn,
|
|
322
|
+
isFile: on,
|
|
323
|
+
isBlob: an,
|
|
324
|
+
isRegExp: _n,
|
|
325
|
+
isFunction: k,
|
|
326
|
+
isStream: un,
|
|
327
|
+
isURLSearchParams: fn,
|
|
328
|
+
isTypedArray: On,
|
|
329
|
+
isFileList: cn,
|
|
329
330
|
forEach: K,
|
|
330
|
-
merge:
|
|
331
|
-
extend:
|
|
332
|
-
trim:
|
|
333
|
-
stripBOM:
|
|
334
|
-
inherits:
|
|
335
|
-
toFlatObject:
|
|
336
|
-
kindOf:
|
|
337
|
-
kindOfTest:
|
|
338
|
-
endsWith:
|
|
339
|
-
toArray:
|
|
340
|
-
forEachEntry:
|
|
341
|
-
matchAll:
|
|
342
|
-
isHTMLForm:
|
|
343
|
-
hasOwnProperty:
|
|
344
|
-
hasOwnProp:
|
|
331
|
+
merge: Ie,
|
|
332
|
+
extend: Rn,
|
|
333
|
+
trim: bn,
|
|
334
|
+
stripBOM: wn,
|
|
335
|
+
inherits: Sn,
|
|
336
|
+
toFlatObject: yn,
|
|
337
|
+
kindOf: fe,
|
|
338
|
+
kindOfTest: B,
|
|
339
|
+
endsWith: En,
|
|
340
|
+
toArray: gn,
|
|
341
|
+
forEachEntry: Tn,
|
|
342
|
+
matchAll: An,
|
|
343
|
+
isHTMLForm: Cn,
|
|
344
|
+
hasOwnProperty: $e,
|
|
345
|
+
hasOwnProp: $e,
|
|
345
346
|
// an alias to avoid ESLint no-prototype-builtins detection
|
|
346
|
-
reduceDescriptors:
|
|
347
|
-
freezeMethods:
|
|
348
|
-
toObjectSet:
|
|
349
|
-
toCamelCase:
|
|
350
|
-
noop:
|
|
351
|
-
toFiniteNumber:
|
|
352
|
-
findKey:
|
|
347
|
+
reduceDescriptors: ft,
|
|
348
|
+
freezeMethods: Pn,
|
|
349
|
+
toObjectSet: In,
|
|
350
|
+
toCamelCase: Nn,
|
|
351
|
+
noop: xn,
|
|
352
|
+
toFiniteNumber: Fn,
|
|
353
|
+
findKey: ut,
|
|
353
354
|
global: M,
|
|
354
|
-
isContextDefined:
|
|
355
|
-
isSpecCompliantForm:
|
|
356
|
-
toJSONObject:
|
|
357
|
-
isAsyncFn:
|
|
358
|
-
isThenable:
|
|
359
|
-
setImmediate:
|
|
360
|
-
asap:
|
|
361
|
-
isIterable:
|
|
355
|
+
isContextDefined: lt,
|
|
356
|
+
isSpecCompliantForm: Ln,
|
|
357
|
+
toJSONObject: Un,
|
|
358
|
+
isAsyncFn: kn,
|
|
359
|
+
isThenable: Dn,
|
|
360
|
+
setImmediate: dt,
|
|
361
|
+
asap: Bn,
|
|
362
|
+
isIterable: qn
|
|
362
363
|
};
|
|
363
364
|
function R(e, t, n, r, s) {
|
|
364
365
|
Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = e, this.name = "AxiosError", t && (this.code = t), n && (this.config = n), r && (this.request = r), s && (this.response = s, this.status = s.status ? s.status : null);
|
|
@@ -384,7 +385,7 @@ a.inherits(R, Error, {
|
|
|
384
385
|
};
|
|
385
386
|
}
|
|
386
387
|
});
|
|
387
|
-
const
|
|
388
|
+
const ht = R.prototype, pt = {};
|
|
388
389
|
[
|
|
389
390
|
"ERR_BAD_OPTION_VALUE",
|
|
390
391
|
"ERR_BAD_OPTION",
|
|
@@ -400,81 +401,81 @@ const ct = R.prototype, lt = {};
|
|
|
400
401
|
"ERR_INVALID_URL"
|
|
401
402
|
// eslint-disable-next-line func-names
|
|
402
403
|
].forEach((e) => {
|
|
403
|
-
|
|
404
|
+
pt[e] = { value: e };
|
|
404
405
|
});
|
|
405
|
-
Object.defineProperties(R,
|
|
406
|
-
Object.defineProperty(
|
|
406
|
+
Object.defineProperties(R, pt);
|
|
407
|
+
Object.defineProperty(ht, "isAxiosError", { value: !0 });
|
|
407
408
|
R.from = (e, t, n, r, s, i) => {
|
|
408
|
-
const o = Object.create(
|
|
409
|
+
const o = Object.create(ht);
|
|
409
410
|
return a.toFlatObject(e, o, function(f) {
|
|
410
411
|
return f !== Error.prototype;
|
|
411
412
|
}, (c) => c !== "isAxiosError"), R.call(o, e.message, t, n, r, s), o.cause = e, o.name = e.name, i && Object.assign(o, i), o;
|
|
412
413
|
};
|
|
413
|
-
const
|
|
414
|
-
function
|
|
414
|
+
const jn = null;
|
|
415
|
+
function xe(e) {
|
|
415
416
|
return a.isPlainObject(e) || a.isArray(e);
|
|
416
417
|
}
|
|
417
|
-
function
|
|
418
|
+
function mt(e) {
|
|
418
419
|
return a.endsWith(e, "[]") ? e.slice(0, -2) : e;
|
|
419
420
|
}
|
|
420
|
-
function
|
|
421
|
+
function Ve(e, t, n) {
|
|
421
422
|
return e ? e.concat(t).map(function(s, i) {
|
|
422
|
-
return s =
|
|
423
|
+
return s = mt(s), !n && i ? "[" + s + "]" : s;
|
|
423
424
|
}).join(n ? "." : "") : t;
|
|
424
425
|
}
|
|
425
|
-
function
|
|
426
|
-
return a.isArray(e) && !e.some(
|
|
426
|
+
function Mn(e) {
|
|
427
|
+
return a.isArray(e) && !e.some(xe);
|
|
427
428
|
}
|
|
428
|
-
const
|
|
429
|
+
const vn = a.toFlatObject(a, {}, null, function(t) {
|
|
429
430
|
return /^is[A-Z]/.test(t);
|
|
430
431
|
});
|
|
431
|
-
function
|
|
432
|
+
function pe(e, t, n) {
|
|
432
433
|
if (!a.isObject(e))
|
|
433
434
|
throw new TypeError("target must be an object");
|
|
434
435
|
t = t || new FormData(), n = a.toFlatObject(n, {
|
|
435
436
|
metaTokens: !0,
|
|
436
437
|
dots: !1,
|
|
437
438
|
indexes: !1
|
|
438
|
-
}, !1, function(m,
|
|
439
|
-
return !a.isUndefined(
|
|
439
|
+
}, !1, function(m, p) {
|
|
440
|
+
return !a.isUndefined(p[m]);
|
|
440
441
|
});
|
|
441
|
-
const r = n.metaTokens, s = n.visitor ||
|
|
442
|
+
const r = n.metaTokens, s = n.visitor || l, i = n.dots, o = n.indexes, f = (n.Blob || typeof Blob < "u" && Blob) && a.isSpecCompliantForm(t);
|
|
442
443
|
if (!a.isFunction(s))
|
|
443
444
|
throw new TypeError("visitor must be a function");
|
|
444
|
-
function
|
|
445
|
-
if (
|
|
446
|
-
if (a.isDate(
|
|
447
|
-
return
|
|
448
|
-
if (!f && a.isBlob(
|
|
445
|
+
function u(d) {
|
|
446
|
+
if (d === null) return "";
|
|
447
|
+
if (a.isDate(d))
|
|
448
|
+
return d.toISOString();
|
|
449
|
+
if (!f && a.isBlob(d))
|
|
449
450
|
throw new R("Blob is not supported. Use a Buffer instead.");
|
|
450
|
-
return a.isArrayBuffer(
|
|
451
|
+
return a.isArrayBuffer(d) || a.isTypedArray(d) ? f && typeof Blob == "function" ? new Blob([d]) : Buffer.from(d) : d;
|
|
451
452
|
}
|
|
452
|
-
function
|
|
453
|
-
let y =
|
|
454
|
-
if (
|
|
453
|
+
function l(d, m, p) {
|
|
454
|
+
let y = d;
|
|
455
|
+
if (d && !p && typeof d == "object") {
|
|
455
456
|
if (a.endsWith(m, "{}"))
|
|
456
|
-
m = r ? m : m.slice(0, -2),
|
|
457
|
-
else if (a.isArray(
|
|
458
|
-
return m =
|
|
457
|
+
m = r ? m : m.slice(0, -2), d = JSON.stringify(d);
|
|
458
|
+
else if (a.isArray(d) && Mn(d) || (a.isFileList(d) || a.endsWith(m, "[]")) && (y = a.toArray(d)))
|
|
459
|
+
return m = mt(m), y.forEach(function(g, x) {
|
|
459
460
|
!(a.isUndefined(g) || g === null) && t.append(
|
|
460
461
|
// eslint-disable-next-line no-nested-ternary
|
|
461
|
-
o === !0 ?
|
|
462
|
-
|
|
462
|
+
o === !0 ? Ve([m], x, i) : o === null ? m : m + "[]",
|
|
463
|
+
u(g)
|
|
463
464
|
);
|
|
464
465
|
}), !1;
|
|
465
466
|
}
|
|
466
|
-
return
|
|
467
|
+
return xe(d) ? !0 : (t.append(Ve(p, m, i), u(d)), !1);
|
|
467
468
|
}
|
|
468
|
-
const
|
|
469
|
-
defaultVisitor:
|
|
470
|
-
convertValue:
|
|
471
|
-
isVisitable:
|
|
469
|
+
const h = [], w = Object.assign(vn, {
|
|
470
|
+
defaultVisitor: l,
|
|
471
|
+
convertValue: u,
|
|
472
|
+
isVisitable: xe
|
|
472
473
|
});
|
|
473
|
-
function S(
|
|
474
|
-
if (!a.isUndefined(
|
|
475
|
-
if (
|
|
474
|
+
function S(d, m) {
|
|
475
|
+
if (!a.isUndefined(d)) {
|
|
476
|
+
if (h.indexOf(d) !== -1)
|
|
476
477
|
throw Error("Circular reference detected in " + m.join("."));
|
|
477
|
-
|
|
478
|
+
h.push(d), a.forEach(d, function(y, E) {
|
|
478
479
|
(!(a.isUndefined(y) || y === null) && s.call(
|
|
479
480
|
t,
|
|
480
481
|
y,
|
|
@@ -482,14 +483,14 @@ function ue(e, t, n) {
|
|
|
482
483
|
m,
|
|
483
484
|
w
|
|
484
485
|
)) === !0 && S(y, m ? m.concat(E) : [E]);
|
|
485
|
-
}),
|
|
486
|
+
}), h.pop();
|
|
486
487
|
}
|
|
487
488
|
}
|
|
488
489
|
if (!a.isObject(e))
|
|
489
490
|
throw new TypeError("data must be an object");
|
|
490
491
|
return S(e), t;
|
|
491
492
|
}
|
|
492
|
-
function
|
|
493
|
+
function Je(e) {
|
|
493
494
|
const t = {
|
|
494
495
|
"!": "%21",
|
|
495
496
|
"'": "%27",
|
|
@@ -503,40 +504,40 @@ function He(e) {
|
|
|
503
504
|
return t[r];
|
|
504
505
|
});
|
|
505
506
|
}
|
|
506
|
-
function
|
|
507
|
-
this._pairs = [], e &&
|
|
507
|
+
function Be(e, t) {
|
|
508
|
+
this._pairs = [], e && pe(e, this, t);
|
|
508
509
|
}
|
|
509
|
-
const
|
|
510
|
-
|
|
510
|
+
const bt = Be.prototype;
|
|
511
|
+
bt.append = function(t, n) {
|
|
511
512
|
this._pairs.push([t, n]);
|
|
512
513
|
};
|
|
513
|
-
|
|
514
|
+
bt.toString = function(t) {
|
|
514
515
|
const n = t ? function(r) {
|
|
515
|
-
return t.call(this, r,
|
|
516
|
-
} :
|
|
516
|
+
return t.call(this, r, Je);
|
|
517
|
+
} : Je;
|
|
517
518
|
return this._pairs.map(function(s) {
|
|
518
519
|
return n(s[0]) + "=" + n(s[1]);
|
|
519
520
|
}, "").join("&");
|
|
520
521
|
};
|
|
521
|
-
function
|
|
522
|
+
function Hn(e) {
|
|
522
523
|
return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
|
|
523
524
|
}
|
|
524
|
-
function
|
|
525
|
+
function Rt(e, t, n) {
|
|
525
526
|
if (!t)
|
|
526
527
|
return e;
|
|
527
|
-
const r = n && n.encode ||
|
|
528
|
+
const r = n && n.encode || Hn;
|
|
528
529
|
a.isFunction(n) && (n = {
|
|
529
530
|
serialize: n
|
|
530
531
|
});
|
|
531
532
|
const s = n && n.serialize;
|
|
532
533
|
let i;
|
|
533
|
-
if (s ? i = s(t, n) : i = a.isURLSearchParams(t) ? t.toString() : new
|
|
534
|
+
if (s ? i = s(t, n) : i = a.isURLSearchParams(t) ? t.toString() : new Be(t, n).toString(r), i) {
|
|
534
535
|
const o = e.indexOf("#");
|
|
535
536
|
o !== -1 && (e = e.slice(0, o)), e += (e.indexOf("?") === -1 ? "?" : "&") + i;
|
|
536
537
|
}
|
|
537
538
|
return e;
|
|
538
539
|
}
|
|
539
|
-
class
|
|
540
|
+
class We {
|
|
540
541
|
constructor() {
|
|
541
542
|
this.handlers = [];
|
|
542
543
|
}
|
|
@@ -590,41 +591,41 @@ class ve {
|
|
|
590
591
|
});
|
|
591
592
|
}
|
|
592
593
|
}
|
|
593
|
-
const
|
|
594
|
+
const wt = {
|
|
594
595
|
silentJSONParsing: !0,
|
|
595
596
|
forcedJSONParsing: !0,
|
|
596
597
|
clarifyTimeoutError: !1
|
|
597
|
-
},
|
|
598
|
+
}, zn = typeof URLSearchParams < "u" ? URLSearchParams : Be, $n = typeof FormData < "u" ? FormData : null, Vn = typeof Blob < "u" ? Blob : null, Jn = {
|
|
598
599
|
isBrowser: !0,
|
|
599
600
|
classes: {
|
|
600
|
-
URLSearchParams:
|
|
601
|
-
FormData:
|
|
602
|
-
Blob:
|
|
601
|
+
URLSearchParams: zn,
|
|
602
|
+
FormData: $n,
|
|
603
|
+
Blob: Vn
|
|
603
604
|
},
|
|
604
605
|
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
605
|
-
},
|
|
606
|
-
self instanceof WorkerGlobalScope && typeof self.importScripts == "function",
|
|
606
|
+
}, qe = typeof window < "u" && typeof document < "u", Fe = typeof navigator == "object" && navigator || void 0, Wn = qe && (!Fe || ["ReactNative", "NativeScript", "NS"].indexOf(Fe.product) < 0), Gn = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
|
|
607
|
+
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Kn = qe && window.location.href || "http://localhost", Xn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
607
608
|
__proto__: null,
|
|
608
|
-
hasBrowserEnv:
|
|
609
|
-
hasStandardBrowserEnv:
|
|
610
|
-
hasStandardBrowserWebWorkerEnv:
|
|
611
|
-
navigator:
|
|
612
|
-
origin:
|
|
613
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
614
|
-
...
|
|
615
|
-
...
|
|
609
|
+
hasBrowserEnv: qe,
|
|
610
|
+
hasStandardBrowserEnv: Wn,
|
|
611
|
+
hasStandardBrowserWebWorkerEnv: Gn,
|
|
612
|
+
navigator: Fe,
|
|
613
|
+
origin: Kn
|
|
614
|
+
}, Symbol.toStringTag, { value: "Module" })), I = {
|
|
615
|
+
...Xn,
|
|
616
|
+
...Jn
|
|
616
617
|
};
|
|
617
|
-
function
|
|
618
|
-
return
|
|
618
|
+
function Yn(e, t) {
|
|
619
|
+
return pe(e, new I.classes.URLSearchParams(), Object.assign({
|
|
619
620
|
visitor: function(n, r, s, i) {
|
|
620
|
-
return
|
|
621
|
+
return I.isNode && a.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : i.defaultVisitor.apply(this, arguments);
|
|
621
622
|
}
|
|
622
623
|
}, t));
|
|
623
624
|
}
|
|
624
|
-
function
|
|
625
|
+
function Zn(e) {
|
|
625
626
|
return a.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
|
|
626
627
|
}
|
|
627
|
-
function
|
|
628
|
+
function Qn(e) {
|
|
628
629
|
const t = {}, n = Object.keys(e);
|
|
629
630
|
let r;
|
|
630
631
|
const s = n.length;
|
|
@@ -633,22 +634,22 @@ function Vn(e) {
|
|
|
633
634
|
i = n[r], t[i] = e[i];
|
|
634
635
|
return t;
|
|
635
636
|
}
|
|
636
|
-
function
|
|
637
|
+
function St(e) {
|
|
637
638
|
function t(n, r, s, i) {
|
|
638
639
|
let o = n[i++];
|
|
639
640
|
if (o === "__proto__") return !0;
|
|
640
641
|
const c = Number.isFinite(+o), f = i >= n.length;
|
|
641
|
-
return o = !o && a.isArray(s) ? s.length : o, f ? (a.hasOwnProp(s, o) ? s[o] = [s[o], r] : s[o] = r, !c) : ((!s[o] || !a.isObject(s[o])) && (s[o] = []), t(n, r, s[o], i) && a.isArray(s[o]) && (s[o] =
|
|
642
|
+
return o = !o && a.isArray(s) ? s.length : o, f ? (a.hasOwnProp(s, o) ? s[o] = [s[o], r] : s[o] = r, !c) : ((!s[o] || !a.isObject(s[o])) && (s[o] = []), t(n, r, s[o], i) && a.isArray(s[o]) && (s[o] = Qn(s[o])), !c);
|
|
642
643
|
}
|
|
643
644
|
if (a.isFormData(e) && a.isFunction(e.entries)) {
|
|
644
645
|
const n = {};
|
|
645
646
|
return a.forEachEntry(e, (r, s) => {
|
|
646
|
-
t(
|
|
647
|
+
t(Zn(r), s, n, 0);
|
|
647
648
|
}), n;
|
|
648
649
|
}
|
|
649
650
|
return null;
|
|
650
651
|
}
|
|
651
|
-
function
|
|
652
|
+
function er(e, t, n) {
|
|
652
653
|
if (a.isString(e))
|
|
653
654
|
try {
|
|
654
655
|
return (t || JSON.parse)(e), a.trim(e);
|
|
@@ -659,12 +660,12 @@ function Jn(e, t, n) {
|
|
|
659
660
|
return (n || JSON.stringify)(e);
|
|
660
661
|
}
|
|
661
662
|
const X = {
|
|
662
|
-
transitional:
|
|
663
|
+
transitional: wt,
|
|
663
664
|
adapter: ["xhr", "http", "fetch"],
|
|
664
665
|
transformRequest: [function(t, n) {
|
|
665
666
|
const r = n.getContentType() || "", s = r.indexOf("application/json") > -1, i = a.isObject(t);
|
|
666
667
|
if (i && a.isHTMLForm(t) && (t = new FormData(t)), a.isFormData(t))
|
|
667
|
-
return s ? JSON.stringify(
|
|
668
|
+
return s ? JSON.stringify(St(t)) : t;
|
|
668
669
|
if (a.isArrayBuffer(t) || a.isBuffer(t) || a.isStream(t) || a.isFile(t) || a.isBlob(t) || a.isReadableStream(t))
|
|
669
670
|
return t;
|
|
670
671
|
if (a.isArrayBufferView(t))
|
|
@@ -674,17 +675,17 @@ const X = {
|
|
|
674
675
|
let c;
|
|
675
676
|
if (i) {
|
|
676
677
|
if (r.indexOf("application/x-www-form-urlencoded") > -1)
|
|
677
|
-
return
|
|
678
|
+
return Yn(t, this.formSerializer).toString();
|
|
678
679
|
if ((c = a.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
|
|
679
680
|
const f = this.env && this.env.FormData;
|
|
680
|
-
return
|
|
681
|
+
return pe(
|
|
681
682
|
c ? { "files[]": t } : t,
|
|
682
683
|
f && new f(),
|
|
683
684
|
this.formSerializer
|
|
684
685
|
);
|
|
685
686
|
}
|
|
686
687
|
}
|
|
687
|
-
return i || s ? (n.setContentType("application/json", !1),
|
|
688
|
+
return i || s ? (n.setContentType("application/json", !1), er(t)) : t;
|
|
688
689
|
}],
|
|
689
690
|
transformResponse: [function(t) {
|
|
690
691
|
const n = this.transitional || X.transitional, r = n && n.forcedJSONParsing, s = this.responseType === "json";
|
|
@@ -711,8 +712,8 @@ const X = {
|
|
|
711
712
|
maxContentLength: -1,
|
|
712
713
|
maxBodyLength: -1,
|
|
713
714
|
env: {
|
|
714
|
-
FormData:
|
|
715
|
-
Blob:
|
|
715
|
+
FormData: I.classes.FormData,
|
|
716
|
+
Blob: I.classes.Blob
|
|
716
717
|
},
|
|
717
718
|
validateStatus: function(t) {
|
|
718
719
|
return t >= 200 && t < 300;
|
|
@@ -727,7 +728,7 @@ const X = {
|
|
|
727
728
|
a.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
|
|
728
729
|
X.headers[e] = {};
|
|
729
730
|
});
|
|
730
|
-
const
|
|
731
|
+
const tr = a.toObjectSet([
|
|
731
732
|
"age",
|
|
732
733
|
"authorization",
|
|
733
734
|
"content-length",
|
|
@@ -745,29 +746,29 @@ const Wn = a.toObjectSet([
|
|
|
745
746
|
"referer",
|
|
746
747
|
"retry-after",
|
|
747
748
|
"user-agent"
|
|
748
|
-
]),
|
|
749
|
+
]), nr = (e) => {
|
|
749
750
|
const t = {};
|
|
750
751
|
let n, r, s;
|
|
751
752
|
return e && e.split(`
|
|
752
753
|
`).forEach(function(o) {
|
|
753
|
-
s = o.indexOf(":"), n = o.substring(0, s).trim().toLowerCase(), r = o.substring(s + 1).trim(), !(!n || t[n] &&
|
|
754
|
+
s = o.indexOf(":"), n = o.substring(0, s).trim().toLowerCase(), r = o.substring(s + 1).trim(), !(!n || t[n] && tr[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
|
|
754
755
|
}), t;
|
|
755
|
-
},
|
|
756
|
+
}, Ge = Symbol("internals");
|
|
756
757
|
function W(e) {
|
|
757
758
|
return e && String(e).trim().toLowerCase();
|
|
758
759
|
}
|
|
759
|
-
function
|
|
760
|
-
return e === !1 || e == null ? e : a.isArray(e) ? e.map(
|
|
760
|
+
function oe(e) {
|
|
761
|
+
return e === !1 || e == null ? e : a.isArray(e) ? e.map(oe) : String(e);
|
|
761
762
|
}
|
|
762
|
-
function
|
|
763
|
+
function rr(e) {
|
|
763
764
|
const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
764
765
|
let r;
|
|
765
766
|
for (; r = n.exec(e); )
|
|
766
767
|
t[r[1]] = r[2];
|
|
767
768
|
return t;
|
|
768
769
|
}
|
|
769
|
-
const
|
|
770
|
-
function
|
|
770
|
+
const sr = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
|
|
771
|
+
function Ae(e, t, n, r, s) {
|
|
771
772
|
if (a.isFunction(r))
|
|
772
773
|
return r.call(this, t, n);
|
|
773
774
|
if (s && (t = n), !!a.isString(t)) {
|
|
@@ -777,10 +778,10 @@ function we(e, t, n, r, s) {
|
|
|
777
778
|
return r.test(t);
|
|
778
779
|
}
|
|
779
780
|
}
|
|
780
|
-
function
|
|
781
|
+
function or(e) {
|
|
781
782
|
return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, r) => n.toUpperCase() + r);
|
|
782
783
|
}
|
|
783
|
-
function
|
|
784
|
+
function ir(e, t) {
|
|
784
785
|
const n = a.toCamelCase(" " + t);
|
|
785
786
|
["get", "set", "has"].forEach((r) => {
|
|
786
787
|
Object.defineProperty(e, r + n, {
|
|
@@ -791,30 +792,30 @@ function Zn(e, t) {
|
|
|
791
792
|
});
|
|
792
793
|
});
|
|
793
794
|
}
|
|
794
|
-
let
|
|
795
|
+
let D = class {
|
|
795
796
|
constructor(t) {
|
|
796
797
|
t && this.set(t);
|
|
797
798
|
}
|
|
798
799
|
set(t, n, r) {
|
|
799
800
|
const s = this;
|
|
800
|
-
function i(c, f,
|
|
801
|
-
const
|
|
802
|
-
if (!
|
|
801
|
+
function i(c, f, u) {
|
|
802
|
+
const l = W(f);
|
|
803
|
+
if (!l)
|
|
803
804
|
throw new Error("header name must be a non-empty string");
|
|
804
|
-
const
|
|
805
|
-
(!
|
|
805
|
+
const h = a.findKey(s, l);
|
|
806
|
+
(!h || s[h] === void 0 || u === !0 || u === void 0 && s[h] !== !1) && (s[h || f] = oe(c));
|
|
806
807
|
}
|
|
807
|
-
const o = (c, f) => a.forEach(c, (
|
|
808
|
+
const o = (c, f) => a.forEach(c, (u, l) => i(u, l, f));
|
|
808
809
|
if (a.isPlainObject(t) || t instanceof this.constructor)
|
|
809
810
|
o(t, n);
|
|
810
|
-
else if (a.isString(t) && (t = t.trim()) && !
|
|
811
|
-
o(
|
|
811
|
+
else if (a.isString(t) && (t = t.trim()) && !sr(t))
|
|
812
|
+
o(nr(t), n);
|
|
812
813
|
else if (a.isObject(t) && a.isIterable(t)) {
|
|
813
|
-
let c = {}, f,
|
|
814
|
-
for (const
|
|
815
|
-
if (!a.isArray(
|
|
814
|
+
let c = {}, f, u;
|
|
815
|
+
for (const l of t) {
|
|
816
|
+
if (!a.isArray(l))
|
|
816
817
|
throw TypeError("Object iterator must return a key-value pair");
|
|
817
|
-
c[
|
|
818
|
+
c[u = l[0]] = (f = c[u]) ? a.isArray(f) ? [...f, l[1]] : [f, l[1]] : l[1];
|
|
818
819
|
}
|
|
819
820
|
o(c, n);
|
|
820
821
|
} else
|
|
@@ -829,7 +830,7 @@ let U = class {
|
|
|
829
830
|
if (!n)
|
|
830
831
|
return s;
|
|
831
832
|
if (n === !0)
|
|
832
|
-
return
|
|
833
|
+
return rr(s);
|
|
833
834
|
if (a.isFunction(n))
|
|
834
835
|
return n.call(this, s, r);
|
|
835
836
|
if (a.isRegExp(n))
|
|
@@ -841,7 +842,7 @@ let U = class {
|
|
|
841
842
|
has(t, n) {
|
|
842
843
|
if (t = W(t), t) {
|
|
843
844
|
const r = a.findKey(this, t);
|
|
844
|
-
return !!(r && this[r] !== void 0 && (!n ||
|
|
845
|
+
return !!(r && this[r] !== void 0 && (!n || Ae(this, this[r], r, n)));
|
|
845
846
|
}
|
|
846
847
|
return !1;
|
|
847
848
|
}
|
|
@@ -851,7 +852,7 @@ let U = class {
|
|
|
851
852
|
function i(o) {
|
|
852
853
|
if (o = W(o), o) {
|
|
853
854
|
const c = a.findKey(r, o);
|
|
854
|
-
c && (!n ||
|
|
855
|
+
c && (!n || Ae(r, r[c], c, n)) && (delete r[c], s = !0);
|
|
855
856
|
}
|
|
856
857
|
}
|
|
857
858
|
return a.isArray(t) ? t.forEach(i) : i(t), s;
|
|
@@ -861,7 +862,7 @@ let U = class {
|
|
|
861
862
|
let r = n.length, s = !1;
|
|
862
863
|
for (; r--; ) {
|
|
863
864
|
const i = n[r];
|
|
864
|
-
(!t ||
|
|
865
|
+
(!t || Ae(this, this[i], i, t, !0)) && (delete this[i], s = !0);
|
|
865
866
|
}
|
|
866
867
|
return s;
|
|
867
868
|
}
|
|
@@ -870,11 +871,11 @@ let U = class {
|
|
|
870
871
|
return a.forEach(this, (s, i) => {
|
|
871
872
|
const o = a.findKey(r, i);
|
|
872
873
|
if (o) {
|
|
873
|
-
n[o] =
|
|
874
|
+
n[o] = oe(s), delete n[i];
|
|
874
875
|
return;
|
|
875
876
|
}
|
|
876
|
-
const c = t ?
|
|
877
|
-
c !== i && delete n[i], n[c] =
|
|
877
|
+
const c = t ? or(i) : String(i).trim();
|
|
878
|
+
c !== i && delete n[i], n[c] = oe(s), r[c] = !0;
|
|
878
879
|
}), this;
|
|
879
880
|
}
|
|
880
881
|
concat(...t) {
|
|
@@ -907,18 +908,18 @@ let U = class {
|
|
|
907
908
|
return n.forEach((s) => r.set(s)), r;
|
|
908
909
|
}
|
|
909
910
|
static accessor(t) {
|
|
910
|
-
const r = (this[
|
|
911
|
+
const r = (this[Ge] = this[Ge] = {
|
|
911
912
|
accessors: {}
|
|
912
913
|
}).accessors, s = this.prototype;
|
|
913
914
|
function i(o) {
|
|
914
915
|
const c = W(o);
|
|
915
|
-
r[c] || (
|
|
916
|
+
r[c] || (ir(s, o), r[c] = !0);
|
|
916
917
|
}
|
|
917
918
|
return a.isArray(t) ? t.forEach(i) : i(t), this;
|
|
918
919
|
}
|
|
919
920
|
};
|
|
920
|
-
|
|
921
|
-
a.reduceDescriptors(
|
|
921
|
+
D.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
|
|
922
|
+
a.reduceDescriptors(D.prototype, ({ value: e }, t) => {
|
|
922
923
|
let n = t[0].toUpperCase() + t.slice(1);
|
|
923
924
|
return {
|
|
924
925
|
get: () => e,
|
|
@@ -927,15 +928,15 @@ a.reduceDescriptors(U.prototype, ({ value: e }, t) => {
|
|
|
927
928
|
}
|
|
928
929
|
};
|
|
929
930
|
});
|
|
930
|
-
a.freezeMethods(
|
|
931
|
-
function
|
|
932
|
-
const n = this || X, r = t || n, s =
|
|
931
|
+
a.freezeMethods(D);
|
|
932
|
+
function Ce(e, t) {
|
|
933
|
+
const n = this || X, r = t || n, s = D.from(r.headers);
|
|
933
934
|
let i = r.data;
|
|
934
935
|
return a.forEach(e, function(c) {
|
|
935
936
|
i = c.call(n, i, s.normalize(), t ? t.status : void 0);
|
|
936
937
|
}), s.normalize(), i;
|
|
937
938
|
}
|
|
938
|
-
function
|
|
939
|
+
function yt(e) {
|
|
939
940
|
return !!(e && e.__CANCEL__);
|
|
940
941
|
}
|
|
941
942
|
function V(e, t, n) {
|
|
@@ -944,7 +945,7 @@ function V(e, t, n) {
|
|
|
944
945
|
a.inherits(V, R, {
|
|
945
946
|
__CANCEL__: !0
|
|
946
947
|
});
|
|
947
|
-
function
|
|
948
|
+
function Et(e, t, n) {
|
|
948
949
|
const r = n.config.validateStatus;
|
|
949
950
|
!n.status || !r || r(n.status) ? e(n) : t(new R(
|
|
950
951
|
"Request failed with status code " + n.status,
|
|
@@ -954,68 +955,68 @@ function bt(e, t, n) {
|
|
|
954
955
|
n
|
|
955
956
|
));
|
|
956
957
|
}
|
|
957
|
-
function
|
|
958
|
+
function ar(e) {
|
|
958
959
|
const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
|
|
959
960
|
return t && t[1] || "";
|
|
960
961
|
}
|
|
961
|
-
function
|
|
962
|
+
function cr(e, t) {
|
|
962
963
|
e = e || 10;
|
|
963
964
|
const n = new Array(e), r = new Array(e);
|
|
964
965
|
let s = 0, i = 0, o;
|
|
965
966
|
return t = t !== void 0 ? t : 1e3, function(f) {
|
|
966
|
-
const
|
|
967
|
-
o || (o =
|
|
968
|
-
let
|
|
969
|
-
for (;
|
|
970
|
-
w += n[
|
|
971
|
-
if (s = (s + 1) % e, s === i && (i = (i + 1) % e),
|
|
967
|
+
const u = Date.now(), l = r[i];
|
|
968
|
+
o || (o = u), n[s] = f, r[s] = u;
|
|
969
|
+
let h = i, w = 0;
|
|
970
|
+
for (; h !== s; )
|
|
971
|
+
w += n[h++], h = h % e;
|
|
972
|
+
if (s = (s + 1) % e, s === i && (i = (i + 1) % e), u - o < t)
|
|
972
973
|
return;
|
|
973
|
-
const S =
|
|
974
|
+
const S = l && u - l;
|
|
974
975
|
return S ? Math.round(w * 1e3 / S) : void 0;
|
|
975
976
|
};
|
|
976
977
|
}
|
|
977
|
-
function
|
|
978
|
+
function ur(e, t) {
|
|
978
979
|
let n = 0, r = 1e3 / t, s, i;
|
|
979
|
-
const o = (
|
|
980
|
-
n =
|
|
980
|
+
const o = (u, l = Date.now()) => {
|
|
981
|
+
n = l, s = null, i && (clearTimeout(i), i = null), e.apply(null, u);
|
|
981
982
|
};
|
|
982
|
-
return [(...
|
|
983
|
-
const
|
|
984
|
-
|
|
983
|
+
return [(...u) => {
|
|
984
|
+
const l = Date.now(), h = l - n;
|
|
985
|
+
h >= r ? o(u, l) : (s = u, i || (i = setTimeout(() => {
|
|
985
986
|
i = null, o(s);
|
|
986
|
-
}, r -
|
|
987
|
+
}, r - h)));
|
|
987
988
|
}, () => s && o(s)];
|
|
988
989
|
}
|
|
989
|
-
const
|
|
990
|
+
const ae = (e, t, n = 3) => {
|
|
990
991
|
let r = 0;
|
|
991
|
-
const s =
|
|
992
|
-
return
|
|
993
|
-
const o = i.loaded, c = i.lengthComputable ? i.total : void 0, f = o - r,
|
|
992
|
+
const s = cr(50, 250);
|
|
993
|
+
return ur((i) => {
|
|
994
|
+
const o = i.loaded, c = i.lengthComputable ? i.total : void 0, f = o - r, u = s(f), l = o <= c;
|
|
994
995
|
r = o;
|
|
995
|
-
const
|
|
996
|
+
const h = {
|
|
996
997
|
loaded: o,
|
|
997
998
|
total: c,
|
|
998
999
|
progress: c ? o / c : void 0,
|
|
999
1000
|
bytes: f,
|
|
1000
|
-
rate:
|
|
1001
|
-
estimated:
|
|
1001
|
+
rate: u || void 0,
|
|
1002
|
+
estimated: u && c && l ? (c - o) / u : void 0,
|
|
1002
1003
|
event: i,
|
|
1003
1004
|
lengthComputable: c != null,
|
|
1004
1005
|
[t ? "download" : "upload"]: !0
|
|
1005
1006
|
};
|
|
1006
|
-
e(
|
|
1007
|
+
e(h);
|
|
1007
1008
|
}, n);
|
|
1008
|
-
},
|
|
1009
|
+
}, Ke = (e, t) => {
|
|
1009
1010
|
const n = e != null;
|
|
1010
1011
|
return [(r) => t[0]({
|
|
1011
1012
|
lengthComputable: n,
|
|
1012
1013
|
total: e,
|
|
1013
1014
|
loaded: r
|
|
1014
1015
|
}), t[1]];
|
|
1015
|
-
},
|
|
1016
|
-
new URL(
|
|
1017
|
-
|
|
1018
|
-
) : () => !0,
|
|
1016
|
+
}, Xe = (e) => (...t) => a.asap(() => e(...t)), lr = I.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, I.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
|
|
1017
|
+
new URL(I.origin),
|
|
1018
|
+
I.navigator && /(msie|trident)/i.test(I.navigator.userAgent)
|
|
1019
|
+
) : () => !0, fr = I.hasStandardBrowserEnv ? (
|
|
1019
1020
|
// Standard browser envs support document.cookie
|
|
1020
1021
|
{
|
|
1021
1022
|
write(e, t, n, r, s, i) {
|
|
@@ -1042,44 +1043,44 @@ const se = (e, t, n = 3) => {
|
|
|
1042
1043
|
}
|
|
1043
1044
|
}
|
|
1044
1045
|
);
|
|
1045
|
-
function
|
|
1046
|
+
function dr(e) {
|
|
1046
1047
|
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
|
|
1047
1048
|
}
|
|
1048
|
-
function
|
|
1049
|
+
function hr(e, t) {
|
|
1049
1050
|
return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
|
|
1050
1051
|
}
|
|
1051
|
-
function
|
|
1052
|
-
let r = !
|
|
1053
|
-
return e && (r || n == !1) ?
|
|
1052
|
+
function gt(e, t, n) {
|
|
1053
|
+
let r = !dr(t);
|
|
1054
|
+
return e && (r || n == !1) ? hr(e, t) : t;
|
|
1054
1055
|
}
|
|
1055
|
-
const
|
|
1056
|
-
function
|
|
1056
|
+
const Ye = (e) => e instanceof D ? { ...e } : e;
|
|
1057
|
+
function H(e, t) {
|
|
1057
1058
|
t = t || {};
|
|
1058
1059
|
const n = {};
|
|
1059
|
-
function r(
|
|
1060
|
-
return a.isPlainObject(
|
|
1060
|
+
function r(u, l, h, w) {
|
|
1061
|
+
return a.isPlainObject(u) && a.isPlainObject(l) ? a.merge.call({ caseless: w }, u, l) : a.isPlainObject(l) ? a.merge({}, l) : a.isArray(l) ? l.slice() : l;
|
|
1061
1062
|
}
|
|
1062
|
-
function s(
|
|
1063
|
-
if (a.isUndefined(
|
|
1064
|
-
if (!a.isUndefined(
|
|
1065
|
-
return r(void 0,
|
|
1066
|
-
} else return r(
|
|
1063
|
+
function s(u, l, h, w) {
|
|
1064
|
+
if (a.isUndefined(l)) {
|
|
1065
|
+
if (!a.isUndefined(u))
|
|
1066
|
+
return r(void 0, u, h, w);
|
|
1067
|
+
} else return r(u, l, h, w);
|
|
1067
1068
|
}
|
|
1068
|
-
function i(
|
|
1069
|
-
if (!a.isUndefined(
|
|
1070
|
-
return r(void 0,
|
|
1069
|
+
function i(u, l) {
|
|
1070
|
+
if (!a.isUndefined(l))
|
|
1071
|
+
return r(void 0, l);
|
|
1071
1072
|
}
|
|
1072
|
-
function o(
|
|
1073
|
-
if (a.isUndefined(
|
|
1074
|
-
if (!a.isUndefined(
|
|
1075
|
-
return r(void 0,
|
|
1076
|
-
} else return r(void 0,
|
|
1073
|
+
function o(u, l) {
|
|
1074
|
+
if (a.isUndefined(l)) {
|
|
1075
|
+
if (!a.isUndefined(u))
|
|
1076
|
+
return r(void 0, u);
|
|
1077
|
+
} else return r(void 0, l);
|
|
1077
1078
|
}
|
|
1078
|
-
function c(
|
|
1079
|
-
if (
|
|
1080
|
-
return r(
|
|
1081
|
-
if (
|
|
1082
|
-
return r(void 0,
|
|
1079
|
+
function c(u, l, h) {
|
|
1080
|
+
if (h in t)
|
|
1081
|
+
return r(u, l);
|
|
1082
|
+
if (h in e)
|
|
1083
|
+
return r(void 0, u);
|
|
1083
1084
|
}
|
|
1084
1085
|
const f = {
|
|
1085
1086
|
url: i,
|
|
@@ -1110,115 +1111,115 @@ function v(e, t) {
|
|
|
1110
1111
|
socketPath: o,
|
|
1111
1112
|
responseEncoding: o,
|
|
1112
1113
|
validateStatus: c,
|
|
1113
|
-
headers: (
|
|
1114
|
+
headers: (u, l, h) => s(Ye(u), Ye(l), h, !0)
|
|
1114
1115
|
};
|
|
1115
|
-
return a.forEach(Object.keys(Object.assign({}, e, t)), function(
|
|
1116
|
-
const
|
|
1117
|
-
a.isUndefined(w) &&
|
|
1116
|
+
return a.forEach(Object.keys(Object.assign({}, e, t)), function(l) {
|
|
1117
|
+
const h = f[l] || s, w = h(e[l], t[l], l);
|
|
1118
|
+
a.isUndefined(w) && h !== c || (n[l] = w);
|
|
1118
1119
|
}), n;
|
|
1119
1120
|
}
|
|
1120
|
-
const
|
|
1121
|
-
const t =
|
|
1121
|
+
const Ot = (e) => {
|
|
1122
|
+
const t = H({}, e);
|
|
1122
1123
|
let { data: n, withXSRFToken: r, xsrfHeaderName: s, xsrfCookieName: i, headers: o, auth: c } = t;
|
|
1123
|
-
t.headers = o =
|
|
1124
|
+
t.headers = o = D.from(o), t.url = Rt(gt(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), c && o.set(
|
|
1124
1125
|
"Authorization",
|
|
1125
1126
|
"Basic " + btoa((c.username || "") + ":" + (c.password ? unescape(encodeURIComponent(c.password)) : ""))
|
|
1126
1127
|
);
|
|
1127
1128
|
let f;
|
|
1128
1129
|
if (a.isFormData(n)) {
|
|
1129
|
-
if (
|
|
1130
|
+
if (I.hasStandardBrowserEnv || I.hasStandardBrowserWebWorkerEnv)
|
|
1130
1131
|
o.setContentType(void 0);
|
|
1131
1132
|
else if ((f = o.getContentType()) !== !1) {
|
|
1132
|
-
const [
|
|
1133
|
-
o.setContentType([
|
|
1133
|
+
const [u, ...l] = f ? f.split(";").map((h) => h.trim()).filter(Boolean) : [];
|
|
1134
|
+
o.setContentType([u || "multipart/form-data", ...l].join("; "));
|
|
1134
1135
|
}
|
|
1135
1136
|
}
|
|
1136
|
-
if (
|
|
1137
|
-
const
|
|
1138
|
-
|
|
1137
|
+
if (I.hasStandardBrowserEnv && (r && a.isFunction(r) && (r = r(t)), r || r !== !1 && lr(t.url))) {
|
|
1138
|
+
const u = s && i && fr.read(i);
|
|
1139
|
+
u && o.set(s, u);
|
|
1139
1140
|
}
|
|
1140
1141
|
return t;
|
|
1141
|
-
},
|
|
1142
|
+
}, pr = typeof XMLHttpRequest < "u", mr = pr && function(e) {
|
|
1142
1143
|
return new Promise(function(n, r) {
|
|
1143
|
-
const s =
|
|
1144
|
+
const s = Ot(e);
|
|
1144
1145
|
let i = s.data;
|
|
1145
|
-
const o =
|
|
1146
|
-
let { responseType: c, onUploadProgress: f, onDownloadProgress:
|
|
1146
|
+
const o = D.from(s.headers).normalize();
|
|
1147
|
+
let { responseType: c, onUploadProgress: f, onDownloadProgress: u } = s, l, h, w, S, d;
|
|
1147
1148
|
function m() {
|
|
1148
|
-
S && S(),
|
|
1149
|
+
S && S(), d && d(), s.cancelToken && s.cancelToken.unsubscribe(l), s.signal && s.signal.removeEventListener("abort", l);
|
|
1149
1150
|
}
|
|
1150
|
-
let
|
|
1151
|
-
|
|
1151
|
+
let p = new XMLHttpRequest();
|
|
1152
|
+
p.open(s.method.toUpperCase(), s.url, !0), p.timeout = s.timeout;
|
|
1152
1153
|
function y() {
|
|
1153
|
-
if (!
|
|
1154
|
+
if (!p)
|
|
1154
1155
|
return;
|
|
1155
|
-
const g =
|
|
1156
|
-
"getAllResponseHeaders" in
|
|
1157
|
-
),
|
|
1158
|
-
data: !c || c === "text" || c === "json" ?
|
|
1159
|
-
status:
|
|
1160
|
-
statusText:
|
|
1156
|
+
const g = D.from(
|
|
1157
|
+
"getAllResponseHeaders" in p && p.getAllResponseHeaders()
|
|
1158
|
+
), T = {
|
|
1159
|
+
data: !c || c === "text" || c === "json" ? p.responseText : p.response,
|
|
1160
|
+
status: p.status,
|
|
1161
|
+
statusText: p.statusText,
|
|
1161
1162
|
headers: g,
|
|
1162
1163
|
config: e,
|
|
1163
|
-
request:
|
|
1164
|
+
request: p
|
|
1164
1165
|
};
|
|
1165
|
-
|
|
1166
|
-
n(
|
|
1167
|
-
}, function(
|
|
1168
|
-
r(
|
|
1169
|
-
},
|
|
1166
|
+
Et(function(U) {
|
|
1167
|
+
n(U), m();
|
|
1168
|
+
}, function(U) {
|
|
1169
|
+
r(U), m();
|
|
1170
|
+
}, T), p = null;
|
|
1170
1171
|
}
|
|
1171
|
-
"onloadend" in
|
|
1172
|
-
!
|
|
1173
|
-
},
|
|
1174
|
-
|
|
1175
|
-
},
|
|
1176
|
-
r(new R("Network Error", R.ERR_NETWORK, e,
|
|
1177
|
-
},
|
|
1178
|
-
let
|
|
1179
|
-
const
|
|
1180
|
-
s.timeoutErrorMessage && (
|
|
1181
|
-
|
|
1182
|
-
|
|
1172
|
+
"onloadend" in p ? p.onloadend = y : p.onreadystatechange = function() {
|
|
1173
|
+
!p || p.readyState !== 4 || p.status === 0 && !(p.responseURL && p.responseURL.indexOf("file:") === 0) || setTimeout(y);
|
|
1174
|
+
}, p.onabort = function() {
|
|
1175
|
+
p && (r(new R("Request aborted", R.ECONNABORTED, e, p)), p = null);
|
|
1176
|
+
}, p.onerror = function() {
|
|
1177
|
+
r(new R("Network Error", R.ERR_NETWORK, e, p)), p = null;
|
|
1178
|
+
}, p.ontimeout = function() {
|
|
1179
|
+
let x = s.timeout ? "timeout of " + s.timeout + "ms exceeded" : "timeout exceeded";
|
|
1180
|
+
const T = s.transitional || wt;
|
|
1181
|
+
s.timeoutErrorMessage && (x = s.timeoutErrorMessage), r(new R(
|
|
1182
|
+
x,
|
|
1183
|
+
T.clarifyTimeoutError ? R.ETIMEDOUT : R.ECONNABORTED,
|
|
1183
1184
|
e,
|
|
1184
|
-
|
|
1185
|
-
)),
|
|
1186
|
-
}, i === void 0 && o.setContentType(null), "setRequestHeader" in
|
|
1187
|
-
|
|
1188
|
-
}), a.isUndefined(s.withCredentials) || (
|
|
1189
|
-
|
|
1190
|
-
}, s.cancelToken && s.cancelToken.subscribe(
|
|
1191
|
-
const E =
|
|
1192
|
-
if (E &&
|
|
1185
|
+
p
|
|
1186
|
+
)), p = null;
|
|
1187
|
+
}, i === void 0 && o.setContentType(null), "setRequestHeader" in p && a.forEach(o.toJSON(), function(x, T) {
|
|
1188
|
+
p.setRequestHeader(T, x);
|
|
1189
|
+
}), a.isUndefined(s.withCredentials) || (p.withCredentials = !!s.withCredentials), c && c !== "json" && (p.responseType = s.responseType), u && ([w, d] = ae(u, !0), p.addEventListener("progress", w)), f && p.upload && ([h, S] = ae(f), p.upload.addEventListener("progress", h), p.upload.addEventListener("loadend", S)), (s.cancelToken || s.signal) && (l = (g) => {
|
|
1190
|
+
p && (r(!g || g.type ? new V(null, e, p) : g), p.abort(), p = null);
|
|
1191
|
+
}, s.cancelToken && s.cancelToken.subscribe(l), s.signal && (s.signal.aborted ? l() : s.signal.addEventListener("abort", l)));
|
|
1192
|
+
const E = ar(s.url);
|
|
1193
|
+
if (E && I.protocols.indexOf(E) === -1) {
|
|
1193
1194
|
r(new R("Unsupported protocol " + E + ":", R.ERR_BAD_REQUEST, e));
|
|
1194
1195
|
return;
|
|
1195
1196
|
}
|
|
1196
|
-
|
|
1197
|
+
p.send(i || null);
|
|
1197
1198
|
});
|
|
1198
|
-
},
|
|
1199
|
+
}, br = (e, t) => {
|
|
1199
1200
|
const { length: n } = e = e ? e.filter(Boolean) : [];
|
|
1200
1201
|
if (t || n) {
|
|
1201
1202
|
let r = new AbortController(), s;
|
|
1202
|
-
const i = function(
|
|
1203
|
+
const i = function(u) {
|
|
1203
1204
|
if (!s) {
|
|
1204
1205
|
s = !0, c();
|
|
1205
|
-
const
|
|
1206
|
-
r.abort(
|
|
1206
|
+
const l = u instanceof Error ? u : this.reason;
|
|
1207
|
+
r.abort(l instanceof R ? l : new V(l instanceof Error ? l.message : l));
|
|
1207
1208
|
}
|
|
1208
1209
|
};
|
|
1209
1210
|
let o = t && setTimeout(() => {
|
|
1210
1211
|
o = null, i(new R(`timeout ${t} of ms exceeded`, R.ETIMEDOUT));
|
|
1211
1212
|
}, t);
|
|
1212
1213
|
const c = () => {
|
|
1213
|
-
e && (o && clearTimeout(o), o = null, e.forEach((
|
|
1214
|
-
|
|
1214
|
+
e && (o && clearTimeout(o), o = null, e.forEach((u) => {
|
|
1215
|
+
u.unsubscribe ? u.unsubscribe(i) : u.removeEventListener("abort", i);
|
|
1215
1216
|
}), e = null);
|
|
1216
1217
|
};
|
|
1217
|
-
e.forEach((
|
|
1218
|
+
e.forEach((u) => u.addEventListener("abort", i));
|
|
1218
1219
|
const { signal: f } = r;
|
|
1219
1220
|
return f.unsubscribe = () => a.asap(c), f;
|
|
1220
1221
|
}
|
|
1221
|
-
},
|
|
1222
|
+
}, Rr = function* (e, t) {
|
|
1222
1223
|
let n = e.byteLength;
|
|
1223
1224
|
if (n < t) {
|
|
1224
1225
|
yield e;
|
|
@@ -1227,10 +1228,10 @@ const wt = (e) => {
|
|
|
1227
1228
|
let r = 0, s;
|
|
1228
1229
|
for (; r < n; )
|
|
1229
1230
|
s = r + t, yield e.slice(r, s), r = s;
|
|
1230
|
-
},
|
|
1231
|
-
for await (const n of
|
|
1232
|
-
yield*
|
|
1233
|
-
},
|
|
1231
|
+
}, wr = async function* (e, t) {
|
|
1232
|
+
for await (const n of Sr(e))
|
|
1233
|
+
yield* Rr(n, t);
|
|
1234
|
+
}, Sr = async function* (e) {
|
|
1234
1235
|
if (e[Symbol.asyncIterator]) {
|
|
1235
1236
|
yield* e;
|
|
1236
1237
|
return;
|
|
@@ -1246,27 +1247,27 @@ const wt = (e) => {
|
|
|
1246
1247
|
} finally {
|
|
1247
1248
|
await t.cancel();
|
|
1248
1249
|
}
|
|
1249
|
-
},
|
|
1250
|
-
const s =
|
|
1250
|
+
}, Ze = (e, t, n, r) => {
|
|
1251
|
+
const s = wr(e, t);
|
|
1251
1252
|
let i = 0, o, c = (f) => {
|
|
1252
1253
|
o || (o = !0, r && r(f));
|
|
1253
1254
|
};
|
|
1254
1255
|
return new ReadableStream({
|
|
1255
1256
|
async pull(f) {
|
|
1256
1257
|
try {
|
|
1257
|
-
const { done:
|
|
1258
|
-
if (
|
|
1258
|
+
const { done: u, value: l } = await s.next();
|
|
1259
|
+
if (u) {
|
|
1259
1260
|
c(), f.close();
|
|
1260
1261
|
return;
|
|
1261
1262
|
}
|
|
1262
|
-
let
|
|
1263
|
+
let h = l.byteLength;
|
|
1263
1264
|
if (n) {
|
|
1264
|
-
let w = i +=
|
|
1265
|
+
let w = i += h;
|
|
1265
1266
|
n(w);
|
|
1266
1267
|
}
|
|
1267
|
-
f.enqueue(new Uint8Array(
|
|
1268
|
-
} catch (
|
|
1269
|
-
throw c(
|
|
1268
|
+
f.enqueue(new Uint8Array(l));
|
|
1269
|
+
} catch (u) {
|
|
1270
|
+
throw c(u), u;
|
|
1270
1271
|
}
|
|
1271
1272
|
},
|
|
1272
1273
|
cancel(f) {
|
|
@@ -1275,15 +1276,15 @@ const wt = (e) => {
|
|
|
1275
1276
|
}, {
|
|
1276
1277
|
highWaterMark: 2
|
|
1277
1278
|
});
|
|
1278
|
-
},
|
|
1279
|
+
}, me = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", Tt = me && typeof ReadableStream == "function", yr = me && (typeof TextEncoder == "function" ? /* @__PURE__ */ ((e) => (t) => e.encode(t))(new TextEncoder()) : async (e) => new Uint8Array(await new Response(e).arrayBuffer())), At = (e, ...t) => {
|
|
1279
1280
|
try {
|
|
1280
1281
|
return !!e(...t);
|
|
1281
1282
|
} catch {
|
|
1282
1283
|
return !1;
|
|
1283
1284
|
}
|
|
1284
|
-
},
|
|
1285
|
+
}, Er = Tt && At(() => {
|
|
1285
1286
|
let e = !1;
|
|
1286
|
-
const t = new Request(
|
|
1287
|
+
const t = new Request(I.origin, {
|
|
1287
1288
|
body: new ReadableStream(),
|
|
1288
1289
|
method: "POST",
|
|
1289
1290
|
get duplex() {
|
|
@@ -1291,34 +1292,34 @@ const wt = (e) => {
|
|
|
1291
1292
|
}
|
|
1292
1293
|
}).headers.has("Content-Type");
|
|
1293
1294
|
return e && !t;
|
|
1294
|
-
}),
|
|
1295
|
-
stream:
|
|
1295
|
+
}), Qe = 64 * 1024, Le = Tt && At(() => a.isReadableStream(new Response("").body)), ce = {
|
|
1296
|
+
stream: Le && ((e) => e.body)
|
|
1296
1297
|
};
|
|
1297
|
-
|
|
1298
|
+
me && ((e) => {
|
|
1298
1299
|
["text", "arrayBuffer", "blob", "formData", "stream"].forEach((t) => {
|
|
1299
|
-
!
|
|
1300
|
+
!ce[t] && (ce[t] = a.isFunction(e[t]) ? (n) => n[t]() : (n, r) => {
|
|
1300
1301
|
throw new R(`Response type '${t}' is not supported`, R.ERR_NOT_SUPPORT, r);
|
|
1301
1302
|
});
|
|
1302
1303
|
});
|
|
1303
1304
|
})(new Response());
|
|
1304
|
-
const
|
|
1305
|
+
const gr = async (e) => {
|
|
1305
1306
|
if (e == null)
|
|
1306
1307
|
return 0;
|
|
1307
1308
|
if (a.isBlob(e))
|
|
1308
1309
|
return e.size;
|
|
1309
1310
|
if (a.isSpecCompliantForm(e))
|
|
1310
|
-
return (await new Request(
|
|
1311
|
+
return (await new Request(I.origin, {
|
|
1311
1312
|
method: "POST",
|
|
1312
1313
|
body: e
|
|
1313
1314
|
}).arrayBuffer()).byteLength;
|
|
1314
1315
|
if (a.isArrayBufferView(e) || a.isArrayBuffer(e))
|
|
1315
1316
|
return e.byteLength;
|
|
1316
1317
|
if (a.isURLSearchParams(e) && (e = e + ""), a.isString(e))
|
|
1317
|
-
return (await
|
|
1318
|
-
},
|
|
1318
|
+
return (await yr(e)).byteLength;
|
|
1319
|
+
}, Or = async (e, t) => {
|
|
1319
1320
|
const n = a.toFiniteNumber(e.getContentLength());
|
|
1320
|
-
return n ??
|
|
1321
|
-
},
|
|
1321
|
+
return n ?? gr(t);
|
|
1322
|
+
}, Tr = me && (async (e) => {
|
|
1322
1323
|
let {
|
|
1323
1324
|
url: t,
|
|
1324
1325
|
method: n,
|
|
@@ -1328,87 +1329,87 @@ const hr = async (e) => {
|
|
|
1328
1329
|
timeout: o,
|
|
1329
1330
|
onDownloadProgress: c,
|
|
1330
1331
|
onUploadProgress: f,
|
|
1331
|
-
responseType:
|
|
1332
|
-
headers:
|
|
1333
|
-
withCredentials:
|
|
1332
|
+
responseType: u,
|
|
1333
|
+
headers: l,
|
|
1334
|
+
withCredentials: h = "same-origin",
|
|
1334
1335
|
fetchOptions: w
|
|
1335
|
-
} =
|
|
1336
|
-
|
|
1337
|
-
let S =
|
|
1336
|
+
} = Ot(e);
|
|
1337
|
+
u = u ? (u + "").toLowerCase() : "text";
|
|
1338
|
+
let S = br([s, i && i.toAbortSignal()], o), d;
|
|
1338
1339
|
const m = S && S.unsubscribe && (() => {
|
|
1339
1340
|
S.unsubscribe();
|
|
1340
1341
|
});
|
|
1341
|
-
let
|
|
1342
|
+
let p;
|
|
1342
1343
|
try {
|
|
1343
|
-
if (f &&
|
|
1344
|
-
let
|
|
1344
|
+
if (f && Er && n !== "get" && n !== "head" && (p = await Or(l, r)) !== 0) {
|
|
1345
|
+
let T = new Request(t, {
|
|
1345
1346
|
method: "POST",
|
|
1346
1347
|
body: r,
|
|
1347
1348
|
duplex: "half"
|
|
1348
|
-
}),
|
|
1349
|
-
if (a.isFormData(r) && (
|
|
1350
|
-
const [
|
|
1351
|
-
|
|
1352
|
-
|
|
1349
|
+
}), L;
|
|
1350
|
+
if (a.isFormData(r) && (L = T.headers.get("content-type")) && l.setContentType(L), T.body) {
|
|
1351
|
+
const [U, F] = Ke(
|
|
1352
|
+
p,
|
|
1353
|
+
ae(Xe(f))
|
|
1353
1354
|
);
|
|
1354
|
-
r =
|
|
1355
|
+
r = Ze(T.body, Qe, U, F);
|
|
1355
1356
|
}
|
|
1356
1357
|
}
|
|
1357
|
-
a.isString(
|
|
1358
|
+
a.isString(h) || (h = h ? "include" : "omit");
|
|
1358
1359
|
const y = "credentials" in Request.prototype;
|
|
1359
|
-
|
|
1360
|
+
d = new Request(t, {
|
|
1360
1361
|
...w,
|
|
1361
1362
|
signal: S,
|
|
1362
1363
|
method: n.toUpperCase(),
|
|
1363
|
-
headers:
|
|
1364
|
+
headers: l.normalize().toJSON(),
|
|
1364
1365
|
body: r,
|
|
1365
1366
|
duplex: "half",
|
|
1366
|
-
credentials: y ?
|
|
1367
|
+
credentials: y ? h : void 0
|
|
1367
1368
|
});
|
|
1368
|
-
let E = await fetch(
|
|
1369
|
-
const g =
|
|
1370
|
-
if (
|
|
1371
|
-
const
|
|
1369
|
+
let E = await fetch(d);
|
|
1370
|
+
const g = Le && (u === "stream" || u === "response");
|
|
1371
|
+
if (Le && (c || g && m)) {
|
|
1372
|
+
const T = {};
|
|
1372
1373
|
["status", "statusText", "headers"].forEach((Y) => {
|
|
1373
|
-
|
|
1374
|
+
T[Y] = E[Y];
|
|
1374
1375
|
});
|
|
1375
|
-
const
|
|
1376
|
-
|
|
1377
|
-
|
|
1376
|
+
const L = a.toFiniteNumber(E.headers.get("content-length")), [U, F] = c && Ke(
|
|
1377
|
+
L,
|
|
1378
|
+
ae(Xe(c), !0)
|
|
1378
1379
|
) || [];
|
|
1379
1380
|
E = new Response(
|
|
1380
|
-
|
|
1381
|
-
|
|
1381
|
+
Ze(E.body, Qe, U, () => {
|
|
1382
|
+
F && F(), m && m();
|
|
1382
1383
|
}),
|
|
1383
|
-
|
|
1384
|
+
T
|
|
1384
1385
|
);
|
|
1385
1386
|
}
|
|
1386
|
-
|
|
1387
|
-
let
|
|
1388
|
-
return !g && m && m(), await new Promise((
|
|
1389
|
-
|
|
1390
|
-
data:
|
|
1391
|
-
headers:
|
|
1387
|
+
u = u || "text";
|
|
1388
|
+
let x = await ce[a.findKey(ce, u) || "text"](E, e);
|
|
1389
|
+
return !g && m && m(), await new Promise((T, L) => {
|
|
1390
|
+
Et(T, L, {
|
|
1391
|
+
data: x,
|
|
1392
|
+
headers: D.from(E.headers),
|
|
1392
1393
|
status: E.status,
|
|
1393
1394
|
statusText: E.statusText,
|
|
1394
1395
|
config: e,
|
|
1395
|
-
request:
|
|
1396
|
+
request: d
|
|
1396
1397
|
});
|
|
1397
1398
|
});
|
|
1398
1399
|
} catch (y) {
|
|
1399
1400
|
throw m && m(), y && y.name === "TypeError" && /Load failed|fetch/i.test(y.message) ? Object.assign(
|
|
1400
|
-
new R("Network Error", R.ERR_NETWORK, e,
|
|
1401
|
+
new R("Network Error", R.ERR_NETWORK, e, d),
|
|
1401
1402
|
{
|
|
1402
1403
|
cause: y.cause || y
|
|
1403
1404
|
}
|
|
1404
|
-
) : R.from(y, y && y.code, e,
|
|
1405
|
+
) : R.from(y, y && y.code, e, d);
|
|
1405
1406
|
}
|
|
1406
|
-
}),
|
|
1407
|
-
http:
|
|
1408
|
-
xhr:
|
|
1409
|
-
fetch:
|
|
1407
|
+
}), Ue = {
|
|
1408
|
+
http: jn,
|
|
1409
|
+
xhr: mr,
|
|
1410
|
+
fetch: Tr
|
|
1410
1411
|
};
|
|
1411
|
-
a.forEach(
|
|
1412
|
+
a.forEach(Ue, (e, t) => {
|
|
1412
1413
|
if (e) {
|
|
1413
1414
|
try {
|
|
1414
1415
|
Object.defineProperty(e, "name", { value: t });
|
|
@@ -1417,7 +1418,7 @@ a.forEach(Ne, (e, t) => {
|
|
|
1417
1418
|
Object.defineProperty(e, "adapterName", { value: t });
|
|
1418
1419
|
}
|
|
1419
1420
|
});
|
|
1420
|
-
const
|
|
1421
|
+
const et = (e) => `- ${e}`, Ar = (e) => a.isFunction(e) || e === null || e === !1, Ct = {
|
|
1421
1422
|
getAdapter: (e) => {
|
|
1422
1423
|
e = a.isArray(e) ? e : [e];
|
|
1423
1424
|
const { length: t } = e;
|
|
@@ -1426,7 +1427,7 @@ const Ke = (e) => `- ${e}`, Rr = (e) => a.isFunction(e) || e === null || e === !
|
|
|
1426
1427
|
for (let i = 0; i < t; i++) {
|
|
1427
1428
|
n = e[i];
|
|
1428
1429
|
let o;
|
|
1429
|
-
if (r = n, !
|
|
1430
|
+
if (r = n, !Ar(n) && (r = Ue[(o = String(n)).toLowerCase()], r === void 0))
|
|
1430
1431
|
throw new R(`Unknown adapter '${o}'`);
|
|
1431
1432
|
if (r)
|
|
1432
1433
|
break;
|
|
@@ -1437,8 +1438,8 @@ const Ke = (e) => `- ${e}`, Rr = (e) => a.isFunction(e) || e === null || e === !
|
|
|
1437
1438
|
([c, f]) => `adapter ${c} ` + (f === !1 ? "is not supported by the environment" : "is not available in the build")
|
|
1438
1439
|
);
|
|
1439
1440
|
let o = t ? i.length > 1 ? `since :
|
|
1440
|
-
` + i.map(
|
|
1441
|
-
`) : " " +
|
|
1441
|
+
` + i.map(et).join(`
|
|
1442
|
+
`) : " " + et(i[0]) : "as no adapter specified";
|
|
1442
1443
|
throw new R(
|
|
1443
1444
|
"There is no suitable adapter to dispatch the request " + o,
|
|
1444
1445
|
"ERR_NOT_SUPPORT"
|
|
@@ -1446,40 +1447,40 @@ const Ke = (e) => `- ${e}`, Rr = (e) => a.isFunction(e) || e === null || e === !
|
|
|
1446
1447
|
}
|
|
1447
1448
|
return r;
|
|
1448
1449
|
},
|
|
1449
|
-
adapters:
|
|
1450
|
+
adapters: Ue
|
|
1450
1451
|
};
|
|
1451
|
-
function
|
|
1452
|
+
function Ne(e) {
|
|
1452
1453
|
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
|
|
1453
1454
|
throw new V(null, e);
|
|
1454
1455
|
}
|
|
1455
|
-
function
|
|
1456
|
-
return
|
|
1456
|
+
function tt(e) {
|
|
1457
|
+
return Ne(e), e.headers = D.from(e.headers), e.data = Ce.call(
|
|
1457
1458
|
e,
|
|
1458
1459
|
e.transformRequest
|
|
1459
|
-
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1),
|
|
1460
|
-
return
|
|
1460
|
+
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), Ct.getAdapter(e.adapter || X.adapter)(e).then(function(r) {
|
|
1461
|
+
return Ne(e), r.data = Ce.call(
|
|
1461
1462
|
e,
|
|
1462
1463
|
e.transformResponse,
|
|
1463
1464
|
r
|
|
1464
|
-
), r.headers =
|
|
1465
|
+
), r.headers = D.from(r.headers), r;
|
|
1465
1466
|
}, function(r) {
|
|
1466
|
-
return
|
|
1467
|
+
return yt(r) || (Ne(e), r && r.response && (r.response.data = Ce.call(
|
|
1467
1468
|
e,
|
|
1468
1469
|
e.transformResponse,
|
|
1469
1470
|
r.response
|
|
1470
|
-
), r.response.headers =
|
|
1471
|
+
), r.response.headers = D.from(r.response.headers))), Promise.reject(r);
|
|
1471
1472
|
});
|
|
1472
1473
|
}
|
|
1473
|
-
const
|
|
1474
|
+
const Nt = "1.9.0", be = {};
|
|
1474
1475
|
["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
|
|
1475
|
-
|
|
1476
|
+
be[e] = function(r) {
|
|
1476
1477
|
return typeof r === e || "a" + (t < 1 ? "n " : " ") + e;
|
|
1477
1478
|
};
|
|
1478
1479
|
});
|
|
1479
|
-
const
|
|
1480
|
-
|
|
1480
|
+
const nt = {};
|
|
1481
|
+
be.transitional = function(t, n, r) {
|
|
1481
1482
|
function s(i, o) {
|
|
1482
|
-
return "[Axios v" +
|
|
1483
|
+
return "[Axios v" + Nt + "] Transitional option '" + i + "'" + o + (r ? ". " + r : "");
|
|
1483
1484
|
}
|
|
1484
1485
|
return (i, o, c) => {
|
|
1485
1486
|
if (t === !1)
|
|
@@ -1487,7 +1488,7 @@ de.transitional = function(t, n, r) {
|
|
|
1487
1488
|
s(o, " has been removed" + (n ? " in " + n : "")),
|
|
1488
1489
|
R.ERR_DEPRECATED
|
|
1489
1490
|
);
|
|
1490
|
-
return n && !
|
|
1491
|
+
return n && !nt[o] && (nt[o] = !0, console.warn(
|
|
1491
1492
|
s(
|
|
1492
1493
|
o,
|
|
1493
1494
|
" has been deprecated since v" + n + " and will be removed in the near future"
|
|
@@ -1495,10 +1496,10 @@ de.transitional = function(t, n, r) {
|
|
|
1495
1496
|
)), t ? t(i, o, c) : !0;
|
|
1496
1497
|
};
|
|
1497
1498
|
};
|
|
1498
|
-
|
|
1499
|
+
be.spelling = function(t) {
|
|
1499
1500
|
return (n, r) => (console.warn(`${r} is likely a misspelling of ${t}`), !0);
|
|
1500
1501
|
};
|
|
1501
|
-
function
|
|
1502
|
+
function Cr(e, t, n) {
|
|
1502
1503
|
if (typeof e != "object")
|
|
1503
1504
|
throw new R("options must be an object", R.ERR_BAD_OPTION_VALUE);
|
|
1504
1505
|
const r = Object.keys(e);
|
|
@@ -1515,15 +1516,15 @@ function wr(e, t, n) {
|
|
|
1515
1516
|
throw new R("Unknown option " + i, R.ERR_BAD_OPTION);
|
|
1516
1517
|
}
|
|
1517
1518
|
}
|
|
1518
|
-
const
|
|
1519
|
-
assertOptions:
|
|
1520
|
-
validators:
|
|
1521
|
-
},
|
|
1522
|
-
let
|
|
1519
|
+
const ie = {
|
|
1520
|
+
assertOptions: Cr,
|
|
1521
|
+
validators: be
|
|
1522
|
+
}, q = ie.validators;
|
|
1523
|
+
let v = class {
|
|
1523
1524
|
constructor(t) {
|
|
1524
1525
|
this.defaults = t || {}, this.interceptors = {
|
|
1525
|
-
request: new
|
|
1526
|
-
response: new
|
|
1526
|
+
request: new We(),
|
|
1527
|
+
response: new We()
|
|
1527
1528
|
};
|
|
1528
1529
|
}
|
|
1529
1530
|
/**
|
|
@@ -1552,20 +1553,20 @@ let H = class {
|
|
|
1552
1553
|
}
|
|
1553
1554
|
}
|
|
1554
1555
|
_request(t, n) {
|
|
1555
|
-
typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n =
|
|
1556
|
+
typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = H(this.defaults, n);
|
|
1556
1557
|
const { transitional: r, paramsSerializer: s, headers: i } = n;
|
|
1557
|
-
r !== void 0 &&
|
|
1558
|
-
silentJSONParsing:
|
|
1559
|
-
forcedJSONParsing:
|
|
1560
|
-
clarifyTimeoutError:
|
|
1558
|
+
r !== void 0 && ie.assertOptions(r, {
|
|
1559
|
+
silentJSONParsing: q.transitional(q.boolean),
|
|
1560
|
+
forcedJSONParsing: q.transitional(q.boolean),
|
|
1561
|
+
clarifyTimeoutError: q.transitional(q.boolean)
|
|
1561
1562
|
}, !1), s != null && (a.isFunction(s) ? n.paramsSerializer = {
|
|
1562
1563
|
serialize: s
|
|
1563
|
-
} :
|
|
1564
|
-
encode:
|
|
1565
|
-
serialize:
|
|
1566
|
-
}, !0)), n.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? n.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : n.allowAbsoluteUrls = !0),
|
|
1567
|
-
baseUrl:
|
|
1568
|
-
withXsrfToken:
|
|
1564
|
+
} : ie.assertOptions(s, {
|
|
1565
|
+
encode: q.function,
|
|
1566
|
+
serialize: q.function
|
|
1567
|
+
}, !0)), n.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? n.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : n.allowAbsoluteUrls = !0), ie.assertOptions(n, {
|
|
1568
|
+
baseUrl: q.spelling("baseURL"),
|
|
1569
|
+
withXsrfToken: q.spelling("withXSRFToken")
|
|
1569
1570
|
}, !0), n.method = (n.method || this.defaults.method || "get").toLowerCase();
|
|
1570
1571
|
let o = i && a.merge(
|
|
1571
1572
|
i.common,
|
|
@@ -1573,55 +1574,55 @@ let H = class {
|
|
|
1573
1574
|
);
|
|
1574
1575
|
i && a.forEach(
|
|
1575
1576
|
["delete", "get", "head", "post", "put", "patch", "common"],
|
|
1576
|
-
(
|
|
1577
|
-
delete i[
|
|
1577
|
+
(d) => {
|
|
1578
|
+
delete i[d];
|
|
1578
1579
|
}
|
|
1579
|
-
), n.headers =
|
|
1580
|
+
), n.headers = D.concat(o, i);
|
|
1580
1581
|
const c = [];
|
|
1581
1582
|
let f = !0;
|
|
1582
1583
|
this.interceptors.request.forEach(function(m) {
|
|
1583
1584
|
typeof m.runWhen == "function" && m.runWhen(n) === !1 || (f = f && m.synchronous, c.unshift(m.fulfilled, m.rejected));
|
|
1584
1585
|
});
|
|
1585
|
-
const
|
|
1586
|
+
const u = [];
|
|
1586
1587
|
this.interceptors.response.forEach(function(m) {
|
|
1587
|
-
|
|
1588
|
+
u.push(m.fulfilled, m.rejected);
|
|
1588
1589
|
});
|
|
1589
|
-
let
|
|
1590
|
+
let l, h = 0, w;
|
|
1590
1591
|
if (!f) {
|
|
1591
|
-
const
|
|
1592
|
-
for (
|
|
1593
|
-
|
|
1594
|
-
return
|
|
1592
|
+
const d = [tt.bind(this), void 0];
|
|
1593
|
+
for (d.unshift.apply(d, c), d.push.apply(d, u), w = d.length, l = Promise.resolve(n); h < w; )
|
|
1594
|
+
l = l.then(d[h++], d[h++]);
|
|
1595
|
+
return l;
|
|
1595
1596
|
}
|
|
1596
1597
|
w = c.length;
|
|
1597
1598
|
let S = n;
|
|
1598
|
-
for (
|
|
1599
|
-
const
|
|
1599
|
+
for (h = 0; h < w; ) {
|
|
1600
|
+
const d = c[h++], m = c[h++];
|
|
1600
1601
|
try {
|
|
1601
|
-
S =
|
|
1602
|
-
} catch (
|
|
1603
|
-
m.call(this,
|
|
1602
|
+
S = d(S);
|
|
1603
|
+
} catch (p) {
|
|
1604
|
+
m.call(this, p);
|
|
1604
1605
|
break;
|
|
1605
1606
|
}
|
|
1606
1607
|
}
|
|
1607
1608
|
try {
|
|
1608
|
-
|
|
1609
|
-
} catch (
|
|
1610
|
-
return Promise.reject(
|
|
1609
|
+
l = tt.call(this, S);
|
|
1610
|
+
} catch (d) {
|
|
1611
|
+
return Promise.reject(d);
|
|
1611
1612
|
}
|
|
1612
|
-
for (
|
|
1613
|
-
|
|
1614
|
-
return
|
|
1613
|
+
for (h = 0, w = u.length; h < w; )
|
|
1614
|
+
l = l.then(u[h++], u[h++]);
|
|
1615
|
+
return l;
|
|
1615
1616
|
}
|
|
1616
1617
|
getUri(t) {
|
|
1617
|
-
t =
|
|
1618
|
-
const n =
|
|
1619
|
-
return
|
|
1618
|
+
t = H(this.defaults, t);
|
|
1619
|
+
const n = gt(t.baseURL, t.url, t.allowAbsoluteUrls);
|
|
1620
|
+
return Rt(n, t.params, t.paramsSerializer);
|
|
1620
1621
|
}
|
|
1621
1622
|
};
|
|
1622
1623
|
a.forEach(["delete", "get", "head", "options"], function(t) {
|
|
1623
|
-
|
|
1624
|
-
return this.request(
|
|
1624
|
+
v.prototype[t] = function(n, r) {
|
|
1625
|
+
return this.request(H(r || {}, {
|
|
1625
1626
|
method: t,
|
|
1626
1627
|
url: n,
|
|
1627
1628
|
data: (r || {}).data
|
|
@@ -1631,7 +1632,7 @@ a.forEach(["delete", "get", "head", "options"], function(t) {
|
|
|
1631
1632
|
a.forEach(["post", "put", "patch"], function(t) {
|
|
1632
1633
|
function n(r) {
|
|
1633
1634
|
return function(i, o, c) {
|
|
1634
|
-
return this.request(
|
|
1635
|
+
return this.request(H(c || {}, {
|
|
1635
1636
|
method: t,
|
|
1636
1637
|
headers: r ? {
|
|
1637
1638
|
"Content-Type": "multipart/form-data"
|
|
@@ -1641,9 +1642,9 @@ a.forEach(["post", "put", "patch"], function(t) {
|
|
|
1641
1642
|
}));
|
|
1642
1643
|
};
|
|
1643
1644
|
}
|
|
1644
|
-
|
|
1645
|
+
v.prototype[t] = n(), v.prototype[t + "Form"] = n(!0);
|
|
1645
1646
|
});
|
|
1646
|
-
let
|
|
1647
|
+
let Nr = class _t {
|
|
1647
1648
|
constructor(t) {
|
|
1648
1649
|
if (typeof t != "function")
|
|
1649
1650
|
throw new TypeError("executor must be a function.");
|
|
@@ -1709,22 +1710,22 @@ let Sr = class Ot {
|
|
|
1709
1710
|
static source() {
|
|
1710
1711
|
let t;
|
|
1711
1712
|
return {
|
|
1712
|
-
token: new
|
|
1713
|
+
token: new _t(function(s) {
|
|
1713
1714
|
t = s;
|
|
1714
1715
|
}),
|
|
1715
1716
|
cancel: t
|
|
1716
1717
|
};
|
|
1717
1718
|
}
|
|
1718
1719
|
};
|
|
1719
|
-
function
|
|
1720
|
+
function _r(e) {
|
|
1720
1721
|
return function(n) {
|
|
1721
1722
|
return e.apply(null, n);
|
|
1722
1723
|
};
|
|
1723
1724
|
}
|
|
1724
|
-
function
|
|
1725
|
+
function Pr(e) {
|
|
1725
1726
|
return a.isObject(e) && e.isAxiosError === !0;
|
|
1726
1727
|
}
|
|
1727
|
-
const
|
|
1728
|
+
const ke = {
|
|
1728
1729
|
Continue: 100,
|
|
1729
1730
|
SwitchingProtocols: 101,
|
|
1730
1731
|
Processing: 102,
|
|
@@ -1789,155 +1790,156 @@ const _e = {
|
|
|
1789
1790
|
NotExtended: 510,
|
|
1790
1791
|
NetworkAuthenticationRequired: 511
|
|
1791
1792
|
};
|
|
1792
|
-
Object.entries(
|
|
1793
|
-
|
|
1793
|
+
Object.entries(ke).forEach(([e, t]) => {
|
|
1794
|
+
ke[t] = e;
|
|
1794
1795
|
});
|
|
1795
|
-
function
|
|
1796
|
-
const t = new
|
|
1797
|
-
return a.extend(n,
|
|
1798
|
-
return
|
|
1796
|
+
function Pt(e) {
|
|
1797
|
+
const t = new v(e), n = ot(v.prototype.request, t);
|
|
1798
|
+
return a.extend(n, v.prototype, t, { allOwnKeys: !0 }), a.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(s) {
|
|
1799
|
+
return Pt(H(e, s));
|
|
1799
1800
|
}, n;
|
|
1800
1801
|
}
|
|
1801
|
-
const
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1802
|
+
const N = Pt(X);
|
|
1803
|
+
N.Axios = v;
|
|
1804
|
+
N.CanceledError = V;
|
|
1805
|
+
N.CancelToken = Nr;
|
|
1806
|
+
N.isCancel = yt;
|
|
1807
|
+
N.VERSION = Nt;
|
|
1808
|
+
N.toFormData = pe;
|
|
1809
|
+
N.AxiosError = R;
|
|
1810
|
+
N.Cancel = N.CanceledError;
|
|
1811
|
+
N.all = function(t) {
|
|
1811
1812
|
return Promise.all(t);
|
|
1812
1813
|
};
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1814
|
+
N.spread = _r;
|
|
1815
|
+
N.isAxiosError = Pr;
|
|
1816
|
+
N.mergeConfig = H;
|
|
1817
|
+
N.AxiosHeaders = D;
|
|
1818
|
+
N.formToJSON = (e) => St(a.isHTMLForm(e) ? new FormData(e) : e);
|
|
1819
|
+
N.getAdapter = Ct.getAdapter;
|
|
1820
|
+
N.HttpStatusCode = ke;
|
|
1821
|
+
N.default = N;
|
|
1821
1822
|
const {
|
|
1822
|
-
Axios:
|
|
1823
|
-
AxiosError:
|
|
1824
|
-
CanceledError:
|
|
1825
|
-
isCancel:
|
|
1826
|
-
CancelToken:
|
|
1827
|
-
VERSION:
|
|
1828
|
-
all:
|
|
1829
|
-
Cancel:
|
|
1830
|
-
isAxiosError:
|
|
1831
|
-
spread:
|
|
1832
|
-
toFormData:
|
|
1833
|
-
AxiosHeaders:
|
|
1834
|
-
HttpStatusCode:
|
|
1835
|
-
formToJSON:
|
|
1836
|
-
getAdapter:
|
|
1837
|
-
mergeConfig:
|
|
1838
|
-
} =
|
|
1839
|
-
let Ee = new AbortController();
|
|
1840
|
-
const gr = 3 * 60 * 1e3, Ze = (e) => {
|
|
1823
|
+
Axios: Yr,
|
|
1824
|
+
AxiosError: Zr,
|
|
1825
|
+
CanceledError: Qr,
|
|
1826
|
+
isCancel: es,
|
|
1827
|
+
CancelToken: ts,
|
|
1828
|
+
VERSION: ns,
|
|
1829
|
+
all: rs,
|
|
1830
|
+
Cancel: ss,
|
|
1831
|
+
isAxiosError: os,
|
|
1832
|
+
spread: is,
|
|
1833
|
+
toFormData: as,
|
|
1834
|
+
AxiosHeaders: cs,
|
|
1835
|
+
HttpStatusCode: ue,
|
|
1836
|
+
formToJSON: us,
|
|
1837
|
+
getAdapter: ls,
|
|
1838
|
+
mergeConfig: fs
|
|
1839
|
+
} = N, re = vt.ECONOMY, Ir = 3 * 60 * 1e3, _e = "Flight stream received a 401, refreshed the token, and restarted the stream.", rt = (e) => {
|
|
1841
1840
|
if (!e.origin || !e.destination)
|
|
1842
1841
|
throw new Error("Origin and destination are required.");
|
|
1843
1842
|
if (!e.dates)
|
|
1844
1843
|
throw new Error("At least one date is required.");
|
|
1845
|
-
if (e.flightType ===
|
|
1844
|
+
if (e.flightType === st.ROUND_TRIP && e.dates.length != 2)
|
|
1846
1845
|
throw new Error(
|
|
1847
1846
|
"Two dates are required for round-trip flights: departure and return."
|
|
1848
1847
|
);
|
|
1849
|
-
},
|
|
1848
|
+
}, xr = (e, t, n) => e[t] === ue.Ok ? e : {
|
|
1850
1849
|
...e,
|
|
1851
|
-
[t]: n ??
|
|
1852
|
-
},
|
|
1853
|
-
const { token: e
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1850
|
+
[t]: n ?? ue.MultipleChoices
|
|
1851
|
+
}, Fr = (e) => localStorage.getItem(jt.TOKEN) || e || "", Lr = async () => {
|
|
1852
|
+
const { token: e } = await Bt.refreshAccessToken();
|
|
1853
|
+
return e;
|
|
1854
|
+
}, ds = () => {
|
|
1855
|
+
const { token: e, config: t } = kt(), [n, r] = Oe(""), [s, i] = Oe([]), [o, c] = Oe(!1), f = Te(null), u = Te(null), l = Te(0), {
|
|
1856
|
+
inboundResults: h,
|
|
1857
|
+
outboundResults: w,
|
|
1858
|
+
setInboundResults: S,
|
|
1859
|
+
setOutboundResults: d,
|
|
1860
|
+
partialOfferRequestId: m,
|
|
1859
1861
|
setPartialOfferRequestId: p,
|
|
1860
|
-
airlineStatuses:
|
|
1861
|
-
setAirlineStatuses:
|
|
1862
|
-
} =
|
|
1862
|
+
airlineStatuses: y,
|
|
1863
|
+
setAirlineStatuses: E
|
|
1864
|
+
} = Mt(), { data: g } = qt({
|
|
1863
1865
|
queryKey: [z.SUPPORTED_AIRLINE_PROGRAMS],
|
|
1864
1866
|
queryFn: J.getSupportedAirlinePrograms
|
|
1865
|
-
}),
|
|
1867
|
+
}), x = ({
|
|
1866
1868
|
data: b,
|
|
1867
|
-
inbound:
|
|
1869
|
+
inbound: O
|
|
1868
1870
|
}) => {
|
|
1869
|
-
const
|
|
1870
|
-
return (
|
|
1871
|
+
const A = Ht(b);
|
|
1872
|
+
return (O ? S : d)(zt(A)), A;
|
|
1871
1873
|
}, {
|
|
1872
|
-
mutate:
|
|
1873
|
-
status:
|
|
1874
|
-
error:
|
|
1875
|
-
} =
|
|
1874
|
+
mutate: T,
|
|
1875
|
+
status: L,
|
|
1876
|
+
error: U
|
|
1877
|
+
} = ge({
|
|
1876
1878
|
mutationFn: async (b) => {
|
|
1877
|
-
|
|
1878
|
-
const { passengerList:
|
|
1879
|
-
passengers:
|
|
1879
|
+
rt(b);
|
|
1880
|
+
const { passengerList: O } = ve(b.passengers), A = {
|
|
1881
|
+
passengers: O,
|
|
1880
1882
|
origin: b.origin || "",
|
|
1881
1883
|
destination: b.destination || "",
|
|
1882
|
-
cabin_class: b.cabinClass ??
|
|
1884
|
+
cabin_class: b.cabinClass ?? re
|
|
1883
1885
|
};
|
|
1884
|
-
if (b.flightType ===
|
|
1885
|
-
const
|
|
1886
|
-
...
|
|
1886
|
+
if (b.flightType === st.ONE_WAY) {
|
|
1887
|
+
const _ = await J.cashOnlySearch({
|
|
1888
|
+
...A,
|
|
1887
1889
|
departure_dates: b.dates
|
|
1888
1890
|
});
|
|
1889
1891
|
return {
|
|
1890
|
-
success:
|
|
1891
|
-
data:
|
|
1892
|
+
success: _.success,
|
|
1893
|
+
data: _.data
|
|
1892
1894
|
};
|
|
1893
1895
|
} else {
|
|
1894
|
-
const
|
|
1895
|
-
...
|
|
1896
|
+
const _ = await J.roundTripOutboundSearch({
|
|
1897
|
+
...A,
|
|
1896
1898
|
departure_date: b.dates[0],
|
|
1897
1899
|
return_date: b.dates[1]
|
|
1898
1900
|
});
|
|
1899
1901
|
return {
|
|
1900
|
-
success:
|
|
1901
|
-
data:
|
|
1902
|
-
partialOfferRequestId:
|
|
1902
|
+
success: _.success,
|
|
1903
|
+
data: _.data.offers,
|
|
1904
|
+
partialOfferRequestId: _.data.id
|
|
1903
1905
|
};
|
|
1904
1906
|
}
|
|
1905
1907
|
},
|
|
1906
1908
|
onSuccess: (b) => {
|
|
1907
|
-
const { success:
|
|
1908
|
-
if (!
|
|
1909
|
+
const { success: O, data: A, partialOfferRequestId: _ } = b;
|
|
1910
|
+
if (!O) {
|
|
1909
1911
|
console.log("oh lol, it didn't work");
|
|
1910
1912
|
return;
|
|
1911
1913
|
}
|
|
1912
|
-
|
|
1914
|
+
x({ data: A }), _ && p(_);
|
|
1913
1915
|
},
|
|
1914
1916
|
onError: (b) => {
|
|
1915
1917
|
console.error("Error in outbound flight search:", b);
|
|
1916
1918
|
},
|
|
1917
1919
|
onSettled: () => {
|
|
1918
|
-
|
|
1920
|
+
te.invalidateQueries({ queryKey: [z.SEARCH_LIMIT] });
|
|
1919
1921
|
}
|
|
1920
1922
|
}), {
|
|
1921
|
-
mutate:
|
|
1922
|
-
status:
|
|
1923
|
-
error:
|
|
1924
|
-
} =
|
|
1923
|
+
mutate: F,
|
|
1924
|
+
status: Y,
|
|
1925
|
+
error: It
|
|
1926
|
+
} = ge({
|
|
1925
1927
|
mutationFn: async ({
|
|
1926
1928
|
outboundOfferId: b,
|
|
1927
|
-
cabinClass:
|
|
1929
|
+
cabinClass: O
|
|
1928
1930
|
}) => {
|
|
1929
|
-
if (!
|
|
1931
|
+
if (!m)
|
|
1930
1932
|
throw new Error("No partialOfferRequestId found for inbound search.");
|
|
1931
|
-
return
|
|
1933
|
+
return S([]), r(b), await J.roundTripInboundSearch({
|
|
1932
1934
|
outboundOfferId: b,
|
|
1933
|
-
outboundOfferRequestId:
|
|
1934
|
-
cabinClass:
|
|
1935
|
+
outboundOfferRequestId: m,
|
|
1936
|
+
cabinClass: O || re
|
|
1935
1937
|
});
|
|
1936
1938
|
},
|
|
1937
1939
|
onSuccess: (b) => {
|
|
1938
|
-
const { success:
|
|
1939
|
-
|
|
1940
|
-
data:
|
|
1940
|
+
const { success: O, data: A } = b;
|
|
1941
|
+
O && x({
|
|
1942
|
+
data: A.offers,
|
|
1941
1943
|
inbound: !0
|
|
1942
1944
|
});
|
|
1943
1945
|
},
|
|
@@ -1945,110 +1947,135 @@ const gr = 3 * 60 * 1e3, Ze = (e) => {
|
|
|
1945
1947
|
console.error("Error in inbound flight search:", b);
|
|
1946
1948
|
},
|
|
1947
1949
|
onSettled: () => {
|
|
1948
|
-
|
|
1950
|
+
te.invalidateQueries({ queryKey: [z.SEARCH_LIMIT] });
|
|
1949
1951
|
}
|
|
1950
1952
|
}), {
|
|
1951
|
-
mutate:
|
|
1952
|
-
status:
|
|
1953
|
-
error:
|
|
1954
|
-
} =
|
|
1953
|
+
mutate: xt,
|
|
1954
|
+
status: Ft,
|
|
1955
|
+
error: Lt
|
|
1956
|
+
} = ge({
|
|
1955
1957
|
mutationFn: async ({
|
|
1956
1958
|
inboundOfferId: b,
|
|
1957
|
-
cabinClass:
|
|
1959
|
+
cabinClass: O
|
|
1958
1960
|
}) => {
|
|
1959
|
-
if (!
|
|
1961
|
+
if (!m)
|
|
1960
1962
|
throw new Error("No partialOfferRequestId found for round-trip fares.");
|
|
1961
1963
|
return await J.getRoundTripFares({
|
|
1962
1964
|
outboundOfferId: n,
|
|
1963
|
-
outboundOfferRequestId:
|
|
1965
|
+
outboundOfferRequestId: m,
|
|
1964
1966
|
inboundOfferId: b,
|
|
1965
|
-
cabinClass:
|
|
1967
|
+
cabinClass: O || re
|
|
1966
1968
|
});
|
|
1967
1969
|
},
|
|
1968
1970
|
onSuccess: (b) => {
|
|
1969
|
-
const { success:
|
|
1970
|
-
if (!
|
|
1971
|
-
const
|
|
1972
|
-
i(
|
|
1971
|
+
const { success: O, data: A } = b;
|
|
1972
|
+
if (!O) return;
|
|
1973
|
+
const _ = A.offers;
|
|
1974
|
+
i(Me(_));
|
|
1973
1975
|
},
|
|
1974
1976
|
onError: (b) => {
|
|
1975
1977
|
console.error("Error in round-trip fare search:", b);
|
|
1976
1978
|
},
|
|
1977
1979
|
onSettled: () => {
|
|
1978
|
-
|
|
1980
|
+
te.invalidateQueries({ queryKey: [z.SEARCH_LIMIT] });
|
|
1979
1981
|
}
|
|
1980
|
-
}),
|
|
1981
|
-
var
|
|
1982
|
-
|
|
1983
|
-
|
|
1982
|
+
}), Re = async (b, O) => {
|
|
1983
|
+
var je;
|
|
1984
|
+
const A = l.current + 1;
|
|
1985
|
+
l.current = A, (O == null ? void 0 : O.resetAirlineStatuses) !== !1 && E(() => ({
|
|
1986
|
+
...g == null ? void 0 : g.reduce((C, P) => (C[P] = -1, C), {})
|
|
1984
1987
|
})), c(!0);
|
|
1985
|
-
const
|
|
1988
|
+
const _ = b.paymentType === ne.CASH_AND_MILES ? ['"cash"', '"points"'] : ['"points"'], { passengerCount: Z } = ve(b.passengers), Q = $t({
|
|
1986
1989
|
originCode: b.origin,
|
|
1987
1990
|
destinationCode: b.destination,
|
|
1988
1991
|
dates: b.dates,
|
|
1989
|
-
cabinClass: b.cabinClass ??
|
|
1990
|
-
passengerCount:
|
|
1991
|
-
paymentType:
|
|
1992
|
+
cabinClass: b.cabinClass ?? re,
|
|
1993
|
+
passengerCount: Z,
|
|
1994
|
+
paymentType: _
|
|
1992
1995
|
});
|
|
1993
|
-
let
|
|
1994
|
-
|
|
1996
|
+
let Se = [], ye = 0;
|
|
1997
|
+
const ee = new AbortController();
|
|
1998
|
+
u.current = ee;
|
|
1999
|
+
const j = () => {
|
|
2000
|
+
we({ runId: A });
|
|
2001
|
+
};
|
|
2002
|
+
f.current = setTimeout(
|
|
1995
2003
|
() => {
|
|
1996
|
-
|
|
2004
|
+
j();
|
|
1997
2005
|
},
|
|
1998
|
-
(((
|
|
1999
|
-
)
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
if (
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2006
|
+
(((je = t == null ? void 0 : t.flightsConfig) == null ? void 0 : je.streamTimeoutTotalSeconds) ?? Ir) * 1e3
|
|
2007
|
+
);
|
|
2008
|
+
try {
|
|
2009
|
+
await Yt(Dt() + Q, {
|
|
2010
|
+
headers: {
|
|
2011
|
+
"Content-Type": "application/json",
|
|
2012
|
+
Authorization: Fr(e),
|
|
2013
|
+
"client-id": (t == null ? void 0 : t.clientId) ?? ""
|
|
2014
|
+
},
|
|
2015
|
+
openWhenHidden: !0,
|
|
2016
|
+
signal: ee.signal,
|
|
2017
|
+
async onopen(C) {
|
|
2018
|
+
if (C.status === ue.Unauthorized && !(O != null && O.hasRetriedAfterAuthRefresh))
|
|
2019
|
+
throw f.current && (clearTimeout(f.current), f.current = null), ee.abort(), await Lr(), A === l.current && Re(b, {
|
|
2020
|
+
hasRetriedAfterAuthRefresh: !0,
|
|
2021
|
+
resetAirlineStatuses: !1
|
|
2022
|
+
}), new Error(_e);
|
|
2023
|
+
if (!C.ok)
|
|
2024
|
+
throw new Error(
|
|
2025
|
+
`Flight stream request failed with status ${C.status}.`
|
|
2026
|
+
);
|
|
2027
|
+
},
|
|
2028
|
+
onmessage(C) {
|
|
2029
|
+
try {
|
|
2030
|
+
const P = Me(JSON.parse(C.data));
|
|
2031
|
+
if (P.success === !1)
|
|
2032
|
+
return;
|
|
2033
|
+
if (P.close === !0) {
|
|
2034
|
+
j();
|
|
2035
|
+
return;
|
|
2036
|
+
}
|
|
2037
|
+
if (P.airlineProgram && E(
|
|
2038
|
+
(Ee) => xr(
|
|
2039
|
+
Ee,
|
|
2040
|
+
P.airlineProgram,
|
|
2041
|
+
P.status ?? P.statusCode
|
|
2042
|
+
)
|
|
2043
|
+
), P.status === ue.Ok && P.flights && P.flights.length > 0) {
|
|
2044
|
+
ye = 0;
|
|
2045
|
+
const Ee = P.flights.map((Ut) => ({
|
|
2046
|
+
...Ut,
|
|
2047
|
+
partners: P.partners ?? []
|
|
2048
|
+
}));
|
|
2049
|
+
Se = [...Se, ...Ee], x({ data: Se });
|
|
2050
|
+
}
|
|
2051
|
+
P.ping && (ye++, ye >= t.flightsConfig.streamTimeoutPingCount && j());
|
|
2052
|
+
} catch (P) {
|
|
2053
|
+
console.error("Error parsing message:", P), j();
|
|
2029
2054
|
}
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
console.error("
|
|
2033
|
-
}
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2055
|
+
},
|
|
2056
|
+
onerror(C) {
|
|
2057
|
+
throw (C == null ? void 0 : C.message) === _e || (console.error("EventSource error:", C), j()), C;
|
|
2058
|
+
},
|
|
2059
|
+
onclose() {
|
|
2060
|
+
j();
|
|
2061
|
+
},
|
|
2062
|
+
keepalive: !1
|
|
2063
|
+
});
|
|
2064
|
+
} catch (C) {
|
|
2065
|
+
if ((C == null ? void 0 : C.message) === _e)
|
|
2066
|
+
return;
|
|
2067
|
+
ee.signal.aborted || (console.error("Flight stream failed:", C), j());
|
|
2068
|
+
}
|
|
2069
|
+
}, we = (b) => {
|
|
2070
|
+
var O;
|
|
2071
|
+
b != null && b.runId && b.runId !== l.current || ((O = u.current) == null || O.abort(), u.current = null, f.current && (clearTimeout(f.current), f.current = null), c(!1), te.invalidateQueries({ queryKey: [z.SEARCH_LIMIT] }), E((A) => {
|
|
2072
|
+
const _ = {};
|
|
2073
|
+
for (const Z in A) {
|
|
2074
|
+
const Q = A[Z];
|
|
2075
|
+
Q !== -1 && (_[Z] = Q);
|
|
2049
2076
|
}
|
|
2050
|
-
return
|
|
2051
|
-
});
|
|
2077
|
+
return _;
|
|
2078
|
+
}));
|
|
2052
2079
|
};
|
|
2053
2080
|
return {
|
|
2054
2081
|
/**
|
|
@@ -2056,19 +2083,19 @@ const gr = 3 * 60 * 1e3, Ze = (e) => {
|
|
|
2056
2083
|
* @type {boolean}
|
|
2057
2084
|
* @default false
|
|
2058
2085
|
*/
|
|
2059
|
-
loading:
|
|
2086
|
+
loading: L === "pending" || Y === "pending" || o,
|
|
2060
2087
|
/**
|
|
2061
2088
|
* Loading status for fares
|
|
2062
2089
|
* @type {boolean}
|
|
2063
2090
|
* @default false
|
|
2064
2091
|
*/
|
|
2065
|
-
loadingFares:
|
|
2066
|
-
outboundError:
|
|
2067
|
-
inboundError:
|
|
2068
|
-
roundTripFaresError:
|
|
2092
|
+
loadingFares: Ft === "pending",
|
|
2093
|
+
outboundError: U,
|
|
2094
|
+
inboundError: It,
|
|
2095
|
+
roundTripFaresError: Lt,
|
|
2069
2096
|
// Results
|
|
2070
|
-
outboundResults:
|
|
2071
|
-
inboundResults:
|
|
2097
|
+
outboundResults: w,
|
|
2098
|
+
inboundResults: h,
|
|
2072
2099
|
roundTripFares: s,
|
|
2073
2100
|
// Mutation triggers
|
|
2074
2101
|
/**
|
|
@@ -2078,15 +2105,15 @@ const gr = 3 * 60 * 1e3, Ze = (e) => {
|
|
|
2078
2105
|
* @param {ISearchFlightArgs} args - The search arguments
|
|
2079
2106
|
*/
|
|
2080
2107
|
searchOutboundFlights: async (b) => {
|
|
2081
|
-
switch (
|
|
2082
|
-
case
|
|
2083
|
-
|
|
2108
|
+
switch (rt(b), d([]), we(), b.paymentType) {
|
|
2109
|
+
case ne.CASH_AND_MILES:
|
|
2110
|
+
Re(b);
|
|
2084
2111
|
break;
|
|
2085
|
-
case
|
|
2086
|
-
|
|
2112
|
+
case ne.CASH:
|
|
2113
|
+
T(b);
|
|
2087
2114
|
break;
|
|
2088
|
-
case
|
|
2089
|
-
|
|
2115
|
+
case ne.MILES:
|
|
2116
|
+
Re(b);
|
|
2090
2117
|
break;
|
|
2091
2118
|
}
|
|
2092
2119
|
},
|
|
@@ -2096,14 +2123,14 @@ const gr = 3 * 60 * 1e3, Ze = (e) => {
|
|
|
2096
2123
|
*
|
|
2097
2124
|
* @param {{ outboundOfferId: string; cabinClass: ECabinClass }} args - The search arguments
|
|
2098
2125
|
*/
|
|
2099
|
-
searchInboundFlights:
|
|
2126
|
+
searchInboundFlights: F,
|
|
2100
2127
|
/**
|
|
2101
2128
|
* Used to get round-trip fares after selecting both outbound and inbound flights
|
|
2102
2129
|
* @type {function}
|
|
2103
2130
|
*
|
|
2104
2131
|
* @param {{ inboundOfferId: string; cabinClass: ECabinClass }} args - The fare search arguments
|
|
2105
2132
|
*/
|
|
2106
|
-
getRoundTripFares:
|
|
2133
|
+
getRoundTripFares: xt,
|
|
2107
2134
|
/**
|
|
2108
2135
|
* Resets the flight search state, clearing all results and selections
|
|
2109
2136
|
* @type {function}
|
|
@@ -2111,20 +2138,20 @@ const gr = 3 * 60 * 1e3, Ze = (e) => {
|
|
|
2111
2138
|
* @returns {void}
|
|
2112
2139
|
*/
|
|
2113
2140
|
reset: () => {
|
|
2114
|
-
|
|
2141
|
+
we(), d([]), S([]), i([]), p(""), r("");
|
|
2115
2142
|
},
|
|
2116
2143
|
/**
|
|
2117
2144
|
* Points search statuses of airlines during the flight search
|
|
2118
2145
|
* @type {IAirlineStatuses}
|
|
2119
2146
|
*/
|
|
2120
|
-
airlineStatuses:
|
|
2147
|
+
airlineStatuses: y,
|
|
2121
2148
|
/**
|
|
2122
2149
|
* The partial offer request ID returned from the round-trip outbound search, needed for the inbound search and fares search
|
|
2123
2150
|
* @type {string}
|
|
2124
2151
|
*/
|
|
2125
|
-
partialOfferRequestId:
|
|
2152
|
+
partialOfferRequestId: m
|
|
2126
2153
|
};
|
|
2127
2154
|
};
|
|
2128
2155
|
export {
|
|
2129
|
-
|
|
2156
|
+
ds as useFlightSearch
|
|
2130
2157
|
};
|