react-auth-service 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth-ui.es.js +557 -540
- package/dist/auth-ui.umd.js +7 -7
- package/package.json +1 -1
- package/types/common/token.d.ts +1 -0
- package/types/constants/apiEndpoints.d.ts +5 -5
- package/types/context/AuthContext.d.ts +1 -1
- package/types/index.d.ts +1 -0
- package/types/services/axiosInterceptor.d.ts +2 -0
package/dist/auth-ui.es.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useNavigate as Et, Navigate as
|
|
3
|
-
var
|
|
4
|
-
var
|
|
1
|
+
import bt, { useState as M, useEffect as He, createContext as Yt, useContext as Kt } from "react";
|
|
2
|
+
import { useNavigate as Et, Navigate as wt } from "react-router-dom";
|
|
3
|
+
var ye = { exports: {} }, le = {};
|
|
4
|
+
var Ke;
|
|
5
5
|
function Xt() {
|
|
6
|
-
if (
|
|
7
|
-
|
|
6
|
+
if (Ke) return le;
|
|
7
|
+
Ke = 1;
|
|
8
8
|
var e = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
|
|
9
9
|
function r(n, s, i) {
|
|
10
10
|
var o = null;
|
|
@@ -21,12 +21,12 @@ function Xt() {
|
|
|
21
21
|
props: i
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
return
|
|
24
|
+
return le.Fragment = t, le.jsx = r, le.jsxs = r, le;
|
|
25
25
|
}
|
|
26
|
-
var
|
|
27
|
-
var
|
|
28
|
-
function
|
|
29
|
-
return
|
|
26
|
+
var ue = {};
|
|
27
|
+
var Xe;
|
|
28
|
+
function Zt() {
|
|
29
|
+
return Xe || (Xe = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
30
30
|
function e(l) {
|
|
31
31
|
if (l == null) return null;
|
|
32
32
|
if (typeof l == "function")
|
|
@@ -43,28 +43,28 @@ function Kt() {
|
|
|
43
43
|
return "Suspense";
|
|
44
44
|
case j:
|
|
45
45
|
return "SuspenseList";
|
|
46
|
-
case
|
|
46
|
+
case be:
|
|
47
47
|
return "Activity";
|
|
48
48
|
}
|
|
49
49
|
if (typeof l == "object")
|
|
50
50
|
switch (typeof l.tag == "number" && console.error(
|
|
51
51
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
52
52
|
), l.$$typeof) {
|
|
53
|
-
case
|
|
53
|
+
case b:
|
|
54
54
|
return "Portal";
|
|
55
55
|
case C:
|
|
56
56
|
return l.displayName || "Context";
|
|
57
57
|
case T:
|
|
58
58
|
return (l._context.displayName || "Context") + ".Consumer";
|
|
59
|
-
case
|
|
60
|
-
var
|
|
61
|
-
return l = l.displayName, l || (l =
|
|
62
|
-
case
|
|
63
|
-
return
|
|
59
|
+
case U:
|
|
60
|
+
var E = l.render;
|
|
61
|
+
return l = l.displayName, l || (l = E.displayName || E.name || "", l = l !== "" ? "ForwardRef(" + l + ")" : "ForwardRef"), l;
|
|
62
|
+
case ie:
|
|
63
|
+
return E = l.displayName || null, E !== null ? E : e(l.type) || "Memo";
|
|
64
64
|
case H:
|
|
65
|
-
|
|
65
|
+
E = l._payload, l = l._init;
|
|
66
66
|
try {
|
|
67
|
-
return e(l(
|
|
67
|
+
return e(l(E));
|
|
68
68
|
} catch {
|
|
69
69
|
}
|
|
70
70
|
}
|
|
@@ -76,15 +76,15 @@ function Kt() {
|
|
|
76
76
|
function r(l) {
|
|
77
77
|
try {
|
|
78
78
|
t(l);
|
|
79
|
-
var
|
|
79
|
+
var E = !1;
|
|
80
80
|
} catch {
|
|
81
|
-
|
|
81
|
+
E = !0;
|
|
82
82
|
}
|
|
83
|
-
if (
|
|
84
|
-
|
|
85
|
-
var R =
|
|
83
|
+
if (E) {
|
|
84
|
+
E = console;
|
|
85
|
+
var R = E.error, O = typeof Symbol == "function" && Symbol.toStringTag && l[Symbol.toStringTag] || l.constructor.name || "Object";
|
|
86
86
|
return R.call(
|
|
87
|
-
|
|
87
|
+
E,
|
|
88
88
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
89
89
|
O
|
|
90
90
|
), t(l);
|
|
@@ -95,8 +95,8 @@ function Kt() {
|
|
|
95
95
|
if (typeof l == "object" && l !== null && l.$$typeof === H)
|
|
96
96
|
return "<...>";
|
|
97
97
|
try {
|
|
98
|
-
var
|
|
99
|
-
return
|
|
98
|
+
var E = e(l);
|
|
99
|
+
return E ? "<" + E + ">" : "<...>";
|
|
100
100
|
} catch {
|
|
101
101
|
return "<...>";
|
|
102
102
|
}
|
|
@@ -110,16 +110,16 @@ function Kt() {
|
|
|
110
110
|
}
|
|
111
111
|
function o(l) {
|
|
112
112
|
if (G.call(l, "key")) {
|
|
113
|
-
var
|
|
114
|
-
if (
|
|
113
|
+
var E = Object.getOwnPropertyDescriptor(l, "key").get;
|
|
114
|
+
if (E && E.isReactWarning) return !1;
|
|
115
115
|
}
|
|
116
116
|
return l.key !== void 0;
|
|
117
117
|
}
|
|
118
|
-
function c(l,
|
|
118
|
+
function c(l, E) {
|
|
119
119
|
function R() {
|
|
120
120
|
F || (F = !0, console.error(
|
|
121
121
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
122
|
-
|
|
122
|
+
E
|
|
123
123
|
));
|
|
124
124
|
}
|
|
125
125
|
R.isReactWarning = !0, Object.defineProperty(l, "key", {
|
|
@@ -129,16 +129,16 @@ function Kt() {
|
|
|
129
129
|
}
|
|
130
130
|
function h() {
|
|
131
131
|
var l = e(this.type);
|
|
132
|
-
return
|
|
132
|
+
return ae[l] || (ae[l] = !0, console.error(
|
|
133
133
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
134
134
|
)), l = this.props.ref, l !== void 0 ? l : null;
|
|
135
135
|
}
|
|
136
|
-
function f(l,
|
|
136
|
+
function f(l, E, R, O, W, je) {
|
|
137
137
|
var _ = R.ref;
|
|
138
138
|
return l = {
|
|
139
139
|
$$typeof: d,
|
|
140
140
|
type: l,
|
|
141
|
-
key:
|
|
141
|
+
key: E,
|
|
142
142
|
props: R,
|
|
143
143
|
_owner: O
|
|
144
144
|
}, (_ !== void 0 ? _ : null) !== null ? Object.defineProperty(l, "ref", {
|
|
@@ -163,11 +163,11 @@ function Kt() {
|
|
|
163
163
|
configurable: !1,
|
|
164
164
|
enumerable: !1,
|
|
165
165
|
writable: !0,
|
|
166
|
-
value:
|
|
166
|
+
value: je
|
|
167
167
|
}), Object.freeze && (Object.freeze(l.props), Object.freeze(l)), l;
|
|
168
168
|
}
|
|
169
|
-
function u(l,
|
|
170
|
-
var _ =
|
|
169
|
+
function u(l, E, R, O, W, je) {
|
|
170
|
+
var _ = E.children;
|
|
171
171
|
if (_ !== void 0)
|
|
172
172
|
if (O)
|
|
173
173
|
if (q(_)) {
|
|
@@ -179,12 +179,12 @@ function Kt() {
|
|
|
179
179
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
180
180
|
);
|
|
181
181
|
else m(_);
|
|
182
|
-
if (G.call(
|
|
182
|
+
if (G.call(E, "key")) {
|
|
183
183
|
_ = e(l);
|
|
184
|
-
var Q = Object.keys(
|
|
185
|
-
return
|
|
184
|
+
var Q = Object.keys(E).filter(function(Vt) {
|
|
185
|
+
return Vt !== "key";
|
|
186
186
|
});
|
|
187
|
-
O = 0 < Q.length ? "{key: someKey, " + Q.join(": ..., ") + ": ...}" : "{key: someKey}",
|
|
187
|
+
O = 0 < Q.length ? "{key: someKey, " + Q.join(": ..., ") + ": ...}" : "{key: someKey}", we[_ + O] || (Q = 0 < Q.length ? "{" + Q.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
188
188
|
`A props object containing a "key" prop is being spread into JSX:
|
|
189
189
|
let props = %s;
|
|
190
190
|
<%s {...props} />
|
|
@@ -195,13 +195,13 @@ React keys must be passed directly to JSX without using spread:
|
|
|
195
195
|
_,
|
|
196
196
|
Q,
|
|
197
197
|
_
|
|
198
|
-
),
|
|
198
|
+
), we[_ + O] = !0);
|
|
199
199
|
}
|
|
200
|
-
if (_ = null, R !== void 0 && (r(R), _ = "" + R), o(
|
|
200
|
+
if (_ = null, R !== void 0 && (r(R), _ = "" + R), o(E) && (r(E.key), _ = "" + E.key), "key" in E) {
|
|
201
201
|
R = {};
|
|
202
|
-
for (var
|
|
203
|
-
|
|
204
|
-
} else R =
|
|
202
|
+
for (var Le in E)
|
|
203
|
+
Le !== "key" && (R[Le] = E[Le]);
|
|
204
|
+
} else R = E;
|
|
205
205
|
return _ && c(
|
|
206
206
|
R,
|
|
207
207
|
typeof l == "function" ? l.displayName || l.name || "Unknown" : l
|
|
@@ -211,7 +211,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
211
211
|
R,
|
|
212
212
|
s(),
|
|
213
213
|
W,
|
|
214
|
-
|
|
214
|
+
je
|
|
215
215
|
);
|
|
216
216
|
}
|
|
217
217
|
function m(l) {
|
|
@@ -220,7 +220,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
220
220
|
function g(l) {
|
|
221
221
|
return typeof l == "object" && l !== null && l.$$typeof === d;
|
|
222
222
|
}
|
|
223
|
-
var A =
|
|
223
|
+
var A = bt, d = Symbol.for("react.transitional.element"), b = Symbol.for("react.portal"), p = Symbol.for("react.fragment"), S = Symbol.for("react.strict_mode"), N = Symbol.for("react.profiler"), T = Symbol.for("react.consumer"), C = Symbol.for("react.context"), U = Symbol.for("react.forward_ref"), $ = Symbol.for("react.suspense"), j = Symbol.for("react.suspense_list"), ie = Symbol.for("react.memo"), H = Symbol.for("react.lazy"), be = Symbol.for("react.activity"), Ee = Symbol.for("react.client.reference"), z = A.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, G = Object.prototype.hasOwnProperty, q = Array.isArray, Z = console.createTask ? console.createTask : function() {
|
|
224
224
|
return null;
|
|
225
225
|
};
|
|
226
226
|
A = {
|
|
@@ -228,100 +228,102 @@ React keys must be passed directly to JSX without using spread:
|
|
|
228
228
|
return l();
|
|
229
229
|
}
|
|
230
230
|
};
|
|
231
|
-
var F,
|
|
231
|
+
var F, ae = {}, v = A.react_stack_bottom_frame.bind(
|
|
232
232
|
A,
|
|
233
233
|
i
|
|
234
|
-
)(),
|
|
235
|
-
|
|
234
|
+
)(), ce = Z(n(i)), we = {};
|
|
235
|
+
ue.Fragment = p, ue.jsx = function(l, E, R) {
|
|
236
236
|
var O = 1e4 > z.recentlyCreatedOwnerStacks++;
|
|
237
237
|
return u(
|
|
238
238
|
l,
|
|
239
|
-
|
|
239
|
+
E,
|
|
240
240
|
R,
|
|
241
241
|
!1,
|
|
242
242
|
O ? Error("react-stack-top-frame") : v,
|
|
243
|
-
O ? Z(n(l)) :
|
|
243
|
+
O ? Z(n(l)) : ce
|
|
244
244
|
);
|
|
245
|
-
},
|
|
245
|
+
}, ue.jsxs = function(l, E, R) {
|
|
246
246
|
var O = 1e4 > z.recentlyCreatedOwnerStacks++;
|
|
247
247
|
return u(
|
|
248
248
|
l,
|
|
249
|
-
|
|
249
|
+
E,
|
|
250
250
|
R,
|
|
251
251
|
!0,
|
|
252
252
|
O ? Error("react-stack-top-frame") : v,
|
|
253
|
-
O ? Z(n(l)) :
|
|
253
|
+
O ? Z(n(l)) : ce
|
|
254
254
|
);
|
|
255
255
|
};
|
|
256
|
-
})()),
|
|
256
|
+
})()), ue;
|
|
257
257
|
}
|
|
258
|
-
var
|
|
259
|
-
function
|
|
260
|
-
return
|
|
258
|
+
var Ze;
|
|
259
|
+
function Qt() {
|
|
260
|
+
return Ze || (Ze = 1, process.env.NODE_ENV === "production" ? ye.exports = Xt() : ye.exports = Zt()), ye.exports;
|
|
261
261
|
}
|
|
262
|
-
var y =
|
|
263
|
-
const
|
|
264
|
-
refreshToken: "auth/renew-token",
|
|
265
|
-
login: "auth/authenticate",
|
|
266
|
-
logout: "auth/terminate",
|
|
267
|
-
register: "auth/register",
|
|
268
|
-
userDetails: "auth/profile",
|
|
262
|
+
var y = Qt();
|
|
263
|
+
const K = {
|
|
264
|
+
refreshToken: "/auth/renew-token",
|
|
265
|
+
login: "/auth/authenticate",
|
|
266
|
+
logout: "/auth/terminate",
|
|
267
|
+
register: "/auth/register",
|
|
268
|
+
userDetails: "/auth/profile",
|
|
269
269
|
test: "/auth/test-endpoint"
|
|
270
|
-
},
|
|
270
|
+
}, er = "Registration successful! Please login.", tr = "Registration failed. Please try again.", rr = "Login failed. Please try again.", nr = "Login successful!", Wn = "Logged out successfully.", sr = "Session expired. Please login again.", P = {
|
|
271
271
|
LOGIN: "Sign In",
|
|
272
272
|
SIGNUP: "Sign Up"
|
|
273
|
-
},
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
273
|
+
}, or = "Signing in...", ir = "Signing up...", yt = "Email", ar = "Password", cr = "User ID", lr = "Logout", Te = "sessionExpired", ze = "true", Ge = "accessToken";
|
|
274
|
+
function ee(e) {
|
|
275
|
+
e && localStorage.setItem(Ge, e);
|
|
276
|
+
}
|
|
277
|
+
function ur() {
|
|
278
|
+
localStorage.removeItem(Ge);
|
|
277
279
|
}
|
|
278
|
-
function
|
|
279
|
-
return
|
|
280
|
+
function fr() {
|
|
281
|
+
return localStorage.getItem(Ge);
|
|
280
282
|
}
|
|
281
283
|
function gt(e, t) {
|
|
282
284
|
return function() {
|
|
283
285
|
return e.apply(t, arguments);
|
|
284
286
|
};
|
|
285
287
|
}
|
|
286
|
-
const { toString:
|
|
287
|
-
const r =
|
|
288
|
+
const { toString: dr } = Object.prototype, { getPrototypeOf: Je } = Object, { iterator: Ne, toStringTag: St } = Symbol, _e = /* @__PURE__ */ ((e) => (t) => {
|
|
289
|
+
const r = dr.call(t);
|
|
288
290
|
return e[r] || (e[r] = r.slice(8, -1).toLowerCase());
|
|
289
|
-
})(/* @__PURE__ */ Object.create(null)), D = (e) => (e = e.toLowerCase(), (t) =>
|
|
290
|
-
function
|
|
291
|
-
return e !== null && !
|
|
291
|
+
})(/* @__PURE__ */ Object.create(null)), D = (e) => (e = e.toLowerCase(), (t) => _e(t) === e), Pe = (e) => (t) => typeof t === e, { isArray: se } = Array, te = Pe("undefined");
|
|
292
|
+
function de(e) {
|
|
293
|
+
return e !== null && !te(e) && e.constructor !== null && !te(e.constructor) && L(e.constructor.isBuffer) && e.constructor.isBuffer(e);
|
|
292
294
|
}
|
|
293
295
|
const Rt = D("ArrayBuffer");
|
|
294
|
-
function
|
|
296
|
+
function hr(e) {
|
|
295
297
|
let t;
|
|
296
298
|
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && Rt(e.buffer), t;
|
|
297
299
|
}
|
|
298
|
-
const
|
|
299
|
-
if (
|
|
300
|
+
const pr = Pe("string"), L = Pe("function"), Ot = Pe("number"), he = (e) => e !== null && typeof e == "object", mr = (e) => e === !0 || e === !1, Re = (e) => {
|
|
301
|
+
if (_e(e) !== "object")
|
|
300
302
|
return !1;
|
|
301
|
-
const t =
|
|
302
|
-
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(St in e) && !(
|
|
303
|
-
},
|
|
304
|
-
if (!
|
|
303
|
+
const t = Je(e);
|
|
304
|
+
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(St in e) && !(Ne in e);
|
|
305
|
+
}, br = (e) => {
|
|
306
|
+
if (!he(e) || de(e))
|
|
305
307
|
return !1;
|
|
306
308
|
try {
|
|
307
309
|
return Object.keys(e).length === 0 && Object.getPrototypeOf(e) === Object.prototype;
|
|
308
310
|
} catch {
|
|
309
311
|
return !1;
|
|
310
312
|
}
|
|
311
|
-
},
|
|
313
|
+
}, Er = D("Date"), wr = D("File"), yr = D("Blob"), gr = D("FileList"), Sr = (e) => he(e) && L(e.pipe), Rr = (e) => {
|
|
312
314
|
let t;
|
|
313
|
-
return e && (typeof FormData == "function" && e instanceof FormData || L(e.append) && ((t =
|
|
315
|
+
return e && (typeof FormData == "function" && e instanceof FormData || L(e.append) && ((t = _e(e)) === "formdata" || // detect form-data instance
|
|
314
316
|
t === "object" && L(e.toString) && e.toString() === "[object FormData]"));
|
|
315
|
-
},
|
|
316
|
-
function
|
|
317
|
+
}, Or = D("URLSearchParams"), [Ar, Tr, xr, Nr] = ["ReadableStream", "Request", "Response", "Headers"].map(D), _r = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
318
|
+
function pe(e, t, { allOwnKeys: r = !1 } = {}) {
|
|
317
319
|
if (e === null || typeof e > "u")
|
|
318
320
|
return;
|
|
319
321
|
let n, s;
|
|
320
|
-
if (typeof e != "object" && (e = [e]),
|
|
322
|
+
if (typeof e != "object" && (e = [e]), se(e))
|
|
321
323
|
for (n = 0, s = e.length; n < s; n++)
|
|
322
324
|
t.call(null, e[n], n, e);
|
|
323
325
|
else {
|
|
324
|
-
if (
|
|
326
|
+
if (de(e))
|
|
325
327
|
return;
|
|
326
328
|
const i = r ? Object.getOwnPropertyNames(e) : Object.keys(e), o = i.length;
|
|
327
329
|
let c;
|
|
@@ -330,7 +332,7 @@ function he(e, t, { allOwnKeys: r = !1 } = {}) {
|
|
|
330
332
|
}
|
|
331
333
|
}
|
|
332
334
|
function At(e, t) {
|
|
333
|
-
if (
|
|
335
|
+
if (de(e))
|
|
334
336
|
return null;
|
|
335
337
|
t = t.toLowerCase();
|
|
336
338
|
const r = Object.keys(e);
|
|
@@ -340,70 +342,70 @@ function At(e, t) {
|
|
|
340
342
|
return s;
|
|
341
343
|
return null;
|
|
342
344
|
}
|
|
343
|
-
const V = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, Tt = (e) => !
|
|
344
|
-
function
|
|
345
|
+
const V = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, Tt = (e) => !te(e) && e !== V;
|
|
346
|
+
function ve() {
|
|
345
347
|
const { caseless: e, skipUndefined: t } = Tt(this) && this || {}, r = {}, n = (s, i) => {
|
|
346
348
|
const o = e && At(r, i) || i;
|
|
347
|
-
|
|
349
|
+
Re(r[o]) && Re(s) ? r[o] = ve(r[o], s) : Re(s) ? r[o] = ve({}, s) : se(s) ? r[o] = s.slice() : (!t || !te(s)) && (r[o] = s);
|
|
348
350
|
};
|
|
349
351
|
for (let s = 0, i = arguments.length; s < i; s++)
|
|
350
|
-
arguments[s] &&
|
|
352
|
+
arguments[s] && pe(arguments[s], n);
|
|
351
353
|
return r;
|
|
352
354
|
}
|
|
353
|
-
const
|
|
355
|
+
const Pr = (e, t, r, { allOwnKeys: n } = {}) => (pe(t, (s, i) => {
|
|
354
356
|
r && L(s) ? e[i] = gt(s, r) : e[i] = s;
|
|
355
|
-
}, { allOwnKeys: n }), e),
|
|
357
|
+
}, { allOwnKeys: n }), e), Cr = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), kr = (e, t, r, n) => {
|
|
356
358
|
e.prototype = Object.create(t.prototype, n), e.prototype.constructor = e, Object.defineProperty(e, "super", {
|
|
357
359
|
value: t.prototype
|
|
358
360
|
}), r && Object.assign(e.prototype, r);
|
|
359
|
-
},
|
|
361
|
+
}, jr = (e, t, r, n) => {
|
|
360
362
|
let s, i, o;
|
|
361
363
|
const c = {};
|
|
362
364
|
if (t = t || {}, e == null) return t;
|
|
363
365
|
do {
|
|
364
366
|
for (s = Object.getOwnPropertyNames(e), i = s.length; i-- > 0; )
|
|
365
367
|
o = s[i], (!n || n(o, e, t)) && !c[o] && (t[o] = e[o], c[o] = !0);
|
|
366
|
-
e = r !== !1 &&
|
|
368
|
+
e = r !== !1 && Je(e);
|
|
367
369
|
} while (e && (!r || r(e, t)) && e !== Object.prototype);
|
|
368
370
|
return t;
|
|
369
|
-
},
|
|
371
|
+
}, Lr = (e, t, r) => {
|
|
370
372
|
e = String(e), (r === void 0 || r > e.length) && (r = e.length), r -= t.length;
|
|
371
373
|
const n = e.indexOf(t, r);
|
|
372
374
|
return n !== -1 && n === r;
|
|
373
|
-
},
|
|
375
|
+
}, Ir = (e) => {
|
|
374
376
|
if (!e) return null;
|
|
375
|
-
if (
|
|
377
|
+
if (se(e)) return e;
|
|
376
378
|
let t = e.length;
|
|
377
379
|
if (!Ot(t)) return null;
|
|
378
380
|
const r = new Array(t);
|
|
379
381
|
for (; t-- > 0; )
|
|
380
382
|
r[t] = e[t];
|
|
381
383
|
return r;
|
|
382
|
-
},
|
|
383
|
-
const n = (e && e[
|
|
384
|
+
}, Ur = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && Je(Uint8Array)), Fr = (e, t) => {
|
|
385
|
+
const n = (e && e[Ne]).call(e);
|
|
384
386
|
let s;
|
|
385
387
|
for (; (s = n.next()) && !s.done; ) {
|
|
386
388
|
const i = s.value;
|
|
387
389
|
t.call(e, i[0], i[1]);
|
|
388
390
|
}
|
|
389
|
-
},
|
|
391
|
+
}, vr = (e, t) => {
|
|
390
392
|
let r;
|
|
391
393
|
const n = [];
|
|
392
394
|
for (; (r = e.exec(t)) !== null; )
|
|
393
395
|
n.push(r);
|
|
394
396
|
return n;
|
|
395
|
-
},
|
|
397
|
+
}, Dr = D("HTMLFormElement"), Br = (e) => e.toLowerCase().replace(
|
|
396
398
|
/[-_\s]([a-z\d])(\w*)/g,
|
|
397
399
|
function(r, n, s) {
|
|
398
400
|
return n.toUpperCase() + s;
|
|
399
401
|
}
|
|
400
|
-
),
|
|
402
|
+
), Qe = (({ hasOwnProperty: e }) => (t, r) => e.call(t, r))(Object.prototype), $r = D("RegExp"), xt = (e, t) => {
|
|
401
403
|
const r = Object.getOwnPropertyDescriptors(e), n = {};
|
|
402
|
-
|
|
404
|
+
pe(r, (s, i) => {
|
|
403
405
|
let o;
|
|
404
406
|
(o = t(s, i, e)) !== !1 && (n[i] = o || s);
|
|
405
407
|
}), Object.defineProperties(e, n);
|
|
406
|
-
},
|
|
408
|
+
}, qr = (e) => {
|
|
407
409
|
xt(e, (t, r) => {
|
|
408
410
|
if (L(e) && ["arguments", "caller", "callee"].indexOf(r) !== -1)
|
|
409
411
|
return !1;
|
|
@@ -418,103 +420,103 @@ const Nr = (e, t, r, { allOwnKeys: n } = {}) => (he(t, (s, i) => {
|
|
|
418
420
|
});
|
|
419
421
|
}
|
|
420
422
|
});
|
|
421
|
-
},
|
|
423
|
+
}, Mr = (e, t) => {
|
|
422
424
|
const r = {}, n = (s) => {
|
|
423
425
|
s.forEach((i) => {
|
|
424
426
|
r[i] = !0;
|
|
425
427
|
});
|
|
426
428
|
};
|
|
427
|
-
return
|
|
428
|
-
},
|
|
429
|
-
},
|
|
430
|
-
function
|
|
431
|
-
return !!(e && L(e.append) && e[St] === "FormData" && e[
|
|
429
|
+
return se(e) ? n(e) : n(String(e).split(t)), r;
|
|
430
|
+
}, Hr = () => {
|
|
431
|
+
}, zr = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
|
|
432
|
+
function Gr(e) {
|
|
433
|
+
return !!(e && L(e.append) && e[St] === "FormData" && e[Ne]);
|
|
432
434
|
}
|
|
433
|
-
const
|
|
435
|
+
const Jr = (e) => {
|
|
434
436
|
const t = new Array(10), r = (n, s) => {
|
|
435
|
-
if (
|
|
437
|
+
if (he(n)) {
|
|
436
438
|
if (t.indexOf(n) >= 0)
|
|
437
439
|
return;
|
|
438
|
-
if (
|
|
440
|
+
if (de(n))
|
|
439
441
|
return n;
|
|
440
442
|
if (!("toJSON" in n)) {
|
|
441
443
|
t[s] = n;
|
|
442
|
-
const i =
|
|
443
|
-
return
|
|
444
|
+
const i = se(n) ? [] : {};
|
|
445
|
+
return pe(n, (o, c) => {
|
|
444
446
|
const h = r(o, s + 1);
|
|
445
|
-
!
|
|
447
|
+
!te(h) && (i[c] = h);
|
|
446
448
|
}), t[s] = void 0, i;
|
|
447
449
|
}
|
|
448
450
|
}
|
|
449
451
|
return n;
|
|
450
452
|
};
|
|
451
453
|
return r(e, 0);
|
|
452
|
-
},
|
|
454
|
+
}, Wr = D("AsyncFunction"), Vr = (e) => e && (he(e) || L(e)) && L(e.then) && L(e.catch), Nt = ((e, t) => e ? setImmediate : t ? ((r, n) => (V.addEventListener("message", ({ source: s, data: i }) => {
|
|
453
455
|
s === V && i === r && n.length && n.shift()();
|
|
454
456
|
}, !1), (s) => {
|
|
455
457
|
n.push(s), V.postMessage(r, "*");
|
|
456
458
|
}))(`axios@${Math.random()}`, []) : (r) => setTimeout(r))(
|
|
457
459
|
typeof setImmediate == "function",
|
|
458
460
|
L(V.postMessage)
|
|
459
|
-
),
|
|
460
|
-
isArray:
|
|
461
|
+
), Yr = typeof queueMicrotask < "u" ? queueMicrotask.bind(V) : typeof process < "u" && process.nextTick || Nt, Kr = (e) => e != null && L(e[Ne]), a = {
|
|
462
|
+
isArray: se,
|
|
461
463
|
isArrayBuffer: Rt,
|
|
462
|
-
isBuffer:
|
|
463
|
-
isFormData:
|
|
464
|
-
isArrayBufferView:
|
|
465
|
-
isString:
|
|
464
|
+
isBuffer: de,
|
|
465
|
+
isFormData: Rr,
|
|
466
|
+
isArrayBufferView: hr,
|
|
467
|
+
isString: pr,
|
|
466
468
|
isNumber: Ot,
|
|
467
|
-
isBoolean:
|
|
468
|
-
isObject:
|
|
469
|
-
isPlainObject:
|
|
470
|
-
isEmptyObject:
|
|
471
|
-
isReadableStream:
|
|
472
|
-
isRequest:
|
|
473
|
-
isResponse:
|
|
474
|
-
isHeaders:
|
|
475
|
-
isUndefined:
|
|
476
|
-
isDate:
|
|
477
|
-
isFile:
|
|
478
|
-
isBlob:
|
|
479
|
-
isRegExp:
|
|
469
|
+
isBoolean: mr,
|
|
470
|
+
isObject: he,
|
|
471
|
+
isPlainObject: Re,
|
|
472
|
+
isEmptyObject: br,
|
|
473
|
+
isReadableStream: Ar,
|
|
474
|
+
isRequest: Tr,
|
|
475
|
+
isResponse: xr,
|
|
476
|
+
isHeaders: Nr,
|
|
477
|
+
isUndefined: te,
|
|
478
|
+
isDate: Er,
|
|
479
|
+
isFile: wr,
|
|
480
|
+
isBlob: yr,
|
|
481
|
+
isRegExp: $r,
|
|
480
482
|
isFunction: L,
|
|
481
|
-
isStream:
|
|
482
|
-
isURLSearchParams:
|
|
483
|
-
isTypedArray:
|
|
484
|
-
isFileList:
|
|
485
|
-
forEach:
|
|
486
|
-
merge:
|
|
487
|
-
extend:
|
|
488
|
-
trim:
|
|
489
|
-
stripBOM:
|
|
490
|
-
inherits:
|
|
491
|
-
toFlatObject:
|
|
492
|
-
kindOf:
|
|
483
|
+
isStream: Sr,
|
|
484
|
+
isURLSearchParams: Or,
|
|
485
|
+
isTypedArray: Ur,
|
|
486
|
+
isFileList: gr,
|
|
487
|
+
forEach: pe,
|
|
488
|
+
merge: ve,
|
|
489
|
+
extend: Pr,
|
|
490
|
+
trim: _r,
|
|
491
|
+
stripBOM: Cr,
|
|
492
|
+
inherits: kr,
|
|
493
|
+
toFlatObject: jr,
|
|
494
|
+
kindOf: _e,
|
|
493
495
|
kindOfTest: D,
|
|
494
|
-
endsWith:
|
|
495
|
-
toArray:
|
|
496
|
-
forEachEntry:
|
|
497
|
-
matchAll:
|
|
498
|
-
isHTMLForm:
|
|
499
|
-
hasOwnProperty:
|
|
500
|
-
hasOwnProp:
|
|
496
|
+
endsWith: Lr,
|
|
497
|
+
toArray: Ir,
|
|
498
|
+
forEachEntry: Fr,
|
|
499
|
+
matchAll: vr,
|
|
500
|
+
isHTMLForm: Dr,
|
|
501
|
+
hasOwnProperty: Qe,
|
|
502
|
+
hasOwnProp: Qe,
|
|
501
503
|
// an alias to avoid ESLint no-prototype-builtins detection
|
|
502
504
|
reduceDescriptors: xt,
|
|
503
|
-
freezeMethods:
|
|
504
|
-
toObjectSet:
|
|
505
|
-
toCamelCase:
|
|
506
|
-
noop:
|
|
507
|
-
toFiniteNumber:
|
|
505
|
+
freezeMethods: qr,
|
|
506
|
+
toObjectSet: Mr,
|
|
507
|
+
toCamelCase: Br,
|
|
508
|
+
noop: Hr,
|
|
509
|
+
toFiniteNumber: zr,
|
|
508
510
|
findKey: At,
|
|
509
511
|
global: V,
|
|
510
512
|
isContextDefined: Tt,
|
|
511
|
-
isSpecCompliantForm:
|
|
512
|
-
toJSONObject:
|
|
513
|
-
isAsyncFn:
|
|
514
|
-
isThenable:
|
|
513
|
+
isSpecCompliantForm: Gr,
|
|
514
|
+
toJSONObject: Jr,
|
|
515
|
+
isAsyncFn: Wr,
|
|
516
|
+
isThenable: Vr,
|
|
515
517
|
setImmediate: Nt,
|
|
516
|
-
asap:
|
|
517
|
-
isIterable:
|
|
518
|
+
asap: Yr,
|
|
519
|
+
isIterable: Kr
|
|
518
520
|
};
|
|
519
521
|
function w(e, t, r, n, s) {
|
|
520
522
|
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), r && (this.config = r), n && (this.request = n), s && (this.response = s, this.status = s.status ? s.status : null);
|
|
@@ -568,33 +570,33 @@ w.from = (e, t, r, n, s, i) => {
|
|
|
568
570
|
const c = e && e.message ? e.message : "Error", h = t == null && e ? e.code : t;
|
|
569
571
|
return w.call(o, c, h, r, n, s), e && o.cause == null && Object.defineProperty(o, "cause", { value: e, configurable: !0 }), o.name = e && e.name || "Error", i && Object.assign(o, i), o;
|
|
570
572
|
};
|
|
571
|
-
const
|
|
572
|
-
function
|
|
573
|
+
const Xr = null;
|
|
574
|
+
function De(e) {
|
|
573
575
|
return a.isPlainObject(e) || a.isArray(e);
|
|
574
576
|
}
|
|
575
577
|
function Ct(e) {
|
|
576
578
|
return a.endsWith(e, "[]") ? e.slice(0, -2) : e;
|
|
577
579
|
}
|
|
578
|
-
function
|
|
580
|
+
function et(e, t, r) {
|
|
579
581
|
return e ? e.concat(t).map(function(s, i) {
|
|
580
582
|
return s = Ct(s), !r && i ? "[" + s + "]" : s;
|
|
581
583
|
}).join(r ? "." : "") : t;
|
|
582
584
|
}
|
|
583
|
-
function
|
|
584
|
-
return a.isArray(e) && !e.some(
|
|
585
|
+
function Zr(e) {
|
|
586
|
+
return a.isArray(e) && !e.some(De);
|
|
585
587
|
}
|
|
586
|
-
const
|
|
588
|
+
const Qr = a.toFlatObject(a, {}, null, function(t) {
|
|
587
589
|
return /^is[A-Z]/.test(t);
|
|
588
590
|
});
|
|
589
|
-
function
|
|
591
|
+
function Ce(e, t, r) {
|
|
590
592
|
if (!a.isObject(e))
|
|
591
593
|
throw new TypeError("target must be an object");
|
|
592
594
|
t = t || new FormData(), r = a.toFlatObject(r, {
|
|
593
595
|
metaTokens: !0,
|
|
594
596
|
dots: !1,
|
|
595
597
|
indexes: !1
|
|
596
|
-
}, !1, function(
|
|
597
|
-
return !a.isUndefined(p[
|
|
598
|
+
}, !1, function(b, p) {
|
|
599
|
+
return !a.isUndefined(p[b]);
|
|
598
600
|
});
|
|
599
601
|
const n = r.metaTokens, s = r.visitor || u, i = r.dots, o = r.indexes, h = (r.Blob || typeof Blob < "u" && Blob) && a.isSpecCompliantForm(t);
|
|
600
602
|
if (!a.isFunction(s))
|
|
@@ -609,39 +611,39 @@ function Pe(e, t, r) {
|
|
|
609
611
|
throw new w("Blob is not supported. Use a Buffer instead.");
|
|
610
612
|
return a.isArrayBuffer(d) || a.isTypedArray(d) ? h && typeof Blob == "function" ? new Blob([d]) : Buffer.from(d) : d;
|
|
611
613
|
}
|
|
612
|
-
function u(d,
|
|
614
|
+
function u(d, b, p) {
|
|
613
615
|
let S = d;
|
|
614
616
|
if (d && !p && typeof d == "object") {
|
|
615
|
-
if (a.endsWith(
|
|
616
|
-
|
|
617
|
-
else if (a.isArray(d) &&
|
|
618
|
-
return
|
|
617
|
+
if (a.endsWith(b, "{}"))
|
|
618
|
+
b = n ? b : b.slice(0, -2), d = JSON.stringify(d);
|
|
619
|
+
else if (a.isArray(d) && Zr(d) || (a.isFileList(d) || a.endsWith(b, "[]")) && (S = a.toArray(d)))
|
|
620
|
+
return b = Ct(b), S.forEach(function(T, C) {
|
|
619
621
|
!(a.isUndefined(T) || T === null) && t.append(
|
|
620
622
|
// eslint-disable-next-line no-nested-ternary
|
|
621
|
-
o === !0 ?
|
|
623
|
+
o === !0 ? et([b], C, i) : o === null ? b : b + "[]",
|
|
622
624
|
f(T)
|
|
623
625
|
);
|
|
624
626
|
}), !1;
|
|
625
627
|
}
|
|
626
|
-
return
|
|
628
|
+
return De(d) ? !0 : (t.append(et(p, b, i), f(d)), !1);
|
|
627
629
|
}
|
|
628
|
-
const m = [], g = Object.assign(
|
|
630
|
+
const m = [], g = Object.assign(Qr, {
|
|
629
631
|
defaultVisitor: u,
|
|
630
632
|
convertValue: f,
|
|
631
|
-
isVisitable:
|
|
633
|
+
isVisitable: De
|
|
632
634
|
});
|
|
633
|
-
function A(d,
|
|
635
|
+
function A(d, b) {
|
|
634
636
|
if (!a.isUndefined(d)) {
|
|
635
637
|
if (m.indexOf(d) !== -1)
|
|
636
|
-
throw Error("Circular reference detected in " +
|
|
638
|
+
throw Error("Circular reference detected in " + b.join("."));
|
|
637
639
|
m.push(d), a.forEach(d, function(S, N) {
|
|
638
640
|
(!(a.isUndefined(S) || S === null) && s.call(
|
|
639
641
|
t,
|
|
640
642
|
S,
|
|
641
643
|
a.isString(N) ? N.trim() : N,
|
|
642
|
-
|
|
644
|
+
b,
|
|
643
645
|
g
|
|
644
|
-
)) === !0 && A(S,
|
|
646
|
+
)) === !0 && A(S, b ? b.concat(N) : [N]);
|
|
645
647
|
}), m.pop();
|
|
646
648
|
}
|
|
647
649
|
}
|
|
@@ -649,7 +651,7 @@ function Pe(e, t, r) {
|
|
|
649
651
|
throw new TypeError("data must be an object");
|
|
650
652
|
return A(e), t;
|
|
651
653
|
}
|
|
652
|
-
function
|
|
654
|
+
function tt(e) {
|
|
653
655
|
const t = {
|
|
654
656
|
"!": "%21",
|
|
655
657
|
"'": "%27",
|
|
@@ -663,40 +665,40 @@ function Qe(e) {
|
|
|
663
665
|
return t[n];
|
|
664
666
|
});
|
|
665
667
|
}
|
|
666
|
-
function
|
|
667
|
-
this._pairs = [], e &&
|
|
668
|
+
function We(e, t) {
|
|
669
|
+
this._pairs = [], e && Ce(e, this, t);
|
|
668
670
|
}
|
|
669
|
-
const kt =
|
|
671
|
+
const kt = We.prototype;
|
|
670
672
|
kt.append = function(t, r) {
|
|
671
673
|
this._pairs.push([t, r]);
|
|
672
674
|
};
|
|
673
675
|
kt.toString = function(t) {
|
|
674
676
|
const r = t ? function(n) {
|
|
675
|
-
return t.call(this, n,
|
|
676
|
-
} :
|
|
677
|
+
return t.call(this, n, tt);
|
|
678
|
+
} : tt;
|
|
677
679
|
return this._pairs.map(function(s) {
|
|
678
680
|
return r(s[0]) + "=" + r(s[1]);
|
|
679
681
|
}, "").join("&");
|
|
680
682
|
};
|
|
681
|
-
function
|
|
683
|
+
function en(e) {
|
|
682
684
|
return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
|
|
683
685
|
}
|
|
684
686
|
function jt(e, t, r) {
|
|
685
687
|
if (!t)
|
|
686
688
|
return e;
|
|
687
|
-
const n = r && r.encode ||
|
|
689
|
+
const n = r && r.encode || en;
|
|
688
690
|
a.isFunction(r) && (r = {
|
|
689
691
|
serialize: r
|
|
690
692
|
});
|
|
691
693
|
const s = r && r.serialize;
|
|
692
694
|
let i;
|
|
693
|
-
if (s ? i = s(t, r) : i = a.isURLSearchParams(t) ? t.toString() : new
|
|
695
|
+
if (s ? i = s(t, r) : i = a.isURLSearchParams(t) ? t.toString() : new We(t, r).toString(n), i) {
|
|
694
696
|
const o = e.indexOf("#");
|
|
695
697
|
o !== -1 && (e = e.slice(0, o)), e += (e.indexOf("?") === -1 ? "?" : "&") + i;
|
|
696
698
|
}
|
|
697
699
|
return e;
|
|
698
700
|
}
|
|
699
|
-
class
|
|
701
|
+
class rt {
|
|
700
702
|
constructor() {
|
|
701
703
|
this.handlers = [];
|
|
702
704
|
}
|
|
@@ -754,38 +756,38 @@ const Lt = {
|
|
|
754
756
|
silentJSONParsing: !0,
|
|
755
757
|
forcedJSONParsing: !0,
|
|
756
758
|
clarifyTimeoutError: !1
|
|
757
|
-
},
|
|
759
|
+
}, tn = typeof URLSearchParams < "u" ? URLSearchParams : We, rn = typeof FormData < "u" ? FormData : null, nn = typeof Blob < "u" ? Blob : null, sn = {
|
|
758
760
|
isBrowser: !0,
|
|
759
761
|
classes: {
|
|
760
|
-
URLSearchParams:
|
|
761
|
-
FormData:
|
|
762
|
-
Blob:
|
|
762
|
+
URLSearchParams: tn,
|
|
763
|
+
FormData: rn,
|
|
764
|
+
Blob: nn
|
|
763
765
|
},
|
|
764
766
|
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
765
|
-
},
|
|
766
|
-
self instanceof WorkerGlobalScope && typeof self.importScripts == "function",
|
|
767
|
+
}, Ve = typeof window < "u" && typeof document < "u", Be = typeof navigator == "object" && navigator || void 0, on = Ve && (!Be || ["ReactNative", "NativeScript", "NS"].indexOf(Be.product) < 0), an = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
|
|
768
|
+
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", cn = Ve && window.location.href || "http://localhost", ln = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
767
769
|
__proto__: null,
|
|
768
|
-
hasBrowserEnv:
|
|
769
|
-
hasStandardBrowserEnv:
|
|
770
|
-
hasStandardBrowserWebWorkerEnv:
|
|
771
|
-
navigator:
|
|
772
|
-
origin:
|
|
770
|
+
hasBrowserEnv: Ve,
|
|
771
|
+
hasStandardBrowserEnv: on,
|
|
772
|
+
hasStandardBrowserWebWorkerEnv: an,
|
|
773
|
+
navigator: Be,
|
|
774
|
+
origin: cn
|
|
773
775
|
}, Symbol.toStringTag, { value: "Module" })), k = {
|
|
774
|
-
...
|
|
775
|
-
...
|
|
776
|
+
...ln,
|
|
777
|
+
...sn
|
|
776
778
|
};
|
|
777
|
-
function
|
|
778
|
-
return
|
|
779
|
+
function un(e, t) {
|
|
780
|
+
return Ce(e, new k.classes.URLSearchParams(), {
|
|
779
781
|
visitor: function(r, n, s, i) {
|
|
780
782
|
return k.isNode && a.isBuffer(r) ? (this.append(n, r.toString("base64")), !1) : i.defaultVisitor.apply(this, arguments);
|
|
781
783
|
},
|
|
782
784
|
...t
|
|
783
785
|
});
|
|
784
786
|
}
|
|
785
|
-
function
|
|
787
|
+
function fn(e) {
|
|
786
788
|
return a.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
|
|
787
789
|
}
|
|
788
|
-
function
|
|
790
|
+
function dn(e) {
|
|
789
791
|
const t = {}, r = Object.keys(e);
|
|
790
792
|
let n;
|
|
791
793
|
const s = r.length;
|
|
@@ -794,22 +796,22 @@ function un(e) {
|
|
|
794
796
|
i = r[n], t[i] = e[i];
|
|
795
797
|
return t;
|
|
796
798
|
}
|
|
797
|
-
function
|
|
799
|
+
function It(e) {
|
|
798
800
|
function t(r, n, s, i) {
|
|
799
801
|
let o = r[i++];
|
|
800
802
|
if (o === "__proto__") return !0;
|
|
801
803
|
const c = Number.isFinite(+o), h = i >= r.length;
|
|
802
|
-
return o = !o && a.isArray(s) ? s.length : o, h ? (a.hasOwnProp(s, o) ? s[o] = [s[o], n] : s[o] = n, !c) : ((!s[o] || !a.isObject(s[o])) && (s[o] = []), t(r, n, s[o], i) && a.isArray(s[o]) && (s[o] =
|
|
804
|
+
return o = !o && a.isArray(s) ? s.length : o, h ? (a.hasOwnProp(s, o) ? s[o] = [s[o], n] : s[o] = n, !c) : ((!s[o] || !a.isObject(s[o])) && (s[o] = []), t(r, n, s[o], i) && a.isArray(s[o]) && (s[o] = dn(s[o])), !c);
|
|
803
805
|
}
|
|
804
806
|
if (a.isFormData(e) && a.isFunction(e.entries)) {
|
|
805
807
|
const r = {};
|
|
806
808
|
return a.forEachEntry(e, (n, s) => {
|
|
807
|
-
t(
|
|
809
|
+
t(fn(n), s, r, 0);
|
|
808
810
|
}), r;
|
|
809
811
|
}
|
|
810
812
|
return null;
|
|
811
813
|
}
|
|
812
|
-
function
|
|
814
|
+
function hn(e, t, r) {
|
|
813
815
|
if (a.isString(e))
|
|
814
816
|
try {
|
|
815
817
|
return (t || JSON.parse)(e), a.trim(e);
|
|
@@ -819,13 +821,13 @@ function fn(e, t, r) {
|
|
|
819
821
|
}
|
|
820
822
|
return (r || JSON.stringify)(e);
|
|
821
823
|
}
|
|
822
|
-
const
|
|
824
|
+
const me = {
|
|
823
825
|
transitional: Lt,
|
|
824
826
|
adapter: ["xhr", "http", "fetch"],
|
|
825
827
|
transformRequest: [function(t, r) {
|
|
826
828
|
const n = r.getContentType() || "", s = n.indexOf("application/json") > -1, i = a.isObject(t);
|
|
827
829
|
if (i && a.isHTMLForm(t) && (t = new FormData(t)), a.isFormData(t))
|
|
828
|
-
return s ? JSON.stringify(
|
|
830
|
+
return s ? JSON.stringify(It(t)) : t;
|
|
829
831
|
if (a.isArrayBuffer(t) || a.isBuffer(t) || a.isStream(t) || a.isFile(t) || a.isBlob(t) || a.isReadableStream(t))
|
|
830
832
|
return t;
|
|
831
833
|
if (a.isArrayBufferView(t))
|
|
@@ -835,20 +837,20 @@ const pe = {
|
|
|
835
837
|
let c;
|
|
836
838
|
if (i) {
|
|
837
839
|
if (n.indexOf("application/x-www-form-urlencoded") > -1)
|
|
838
|
-
return
|
|
840
|
+
return un(t, this.formSerializer).toString();
|
|
839
841
|
if ((c = a.isFileList(t)) || n.indexOf("multipart/form-data") > -1) {
|
|
840
842
|
const h = this.env && this.env.FormData;
|
|
841
|
-
return
|
|
843
|
+
return Ce(
|
|
842
844
|
c ? { "files[]": t } : t,
|
|
843
845
|
h && new h(),
|
|
844
846
|
this.formSerializer
|
|
845
847
|
);
|
|
846
848
|
}
|
|
847
849
|
}
|
|
848
|
-
return i || s ? (r.setContentType("application/json", !1),
|
|
850
|
+
return i || s ? (r.setContentType("application/json", !1), hn(t)) : t;
|
|
849
851
|
}],
|
|
850
852
|
transformResponse: [function(t) {
|
|
851
|
-
const r = this.transitional ||
|
|
853
|
+
const r = this.transitional || me.transitional, n = r && r.forcedJSONParsing, s = this.responseType === "json";
|
|
852
854
|
if (a.isResponse(t) || a.isReadableStream(t))
|
|
853
855
|
return t;
|
|
854
856
|
if (t && a.isString(t) && (n && !this.responseType || s)) {
|
|
@@ -886,9 +888,9 @@ const pe = {
|
|
|
886
888
|
}
|
|
887
889
|
};
|
|
888
890
|
a.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
|
|
889
|
-
|
|
891
|
+
me.headers[e] = {};
|
|
890
892
|
});
|
|
891
|
-
const
|
|
893
|
+
const pn = a.toObjectSet([
|
|
892
894
|
"age",
|
|
893
895
|
"authorization",
|
|
894
896
|
"content-length",
|
|
@@ -906,29 +908,29 @@ const dn = a.toObjectSet([
|
|
|
906
908
|
"referer",
|
|
907
909
|
"retry-after",
|
|
908
910
|
"user-agent"
|
|
909
|
-
]),
|
|
911
|
+
]), mn = (e) => {
|
|
910
912
|
const t = {};
|
|
911
913
|
let r, n, s;
|
|
912
914
|
return e && e.split(`
|
|
913
915
|
`).forEach(function(o) {
|
|
914
|
-
s = o.indexOf(":"), r = o.substring(0, s).trim().toLowerCase(), n = o.substring(s + 1).trim(), !(!r || t[r] &&
|
|
916
|
+
s = o.indexOf(":"), r = o.substring(0, s).trim().toLowerCase(), n = o.substring(s + 1).trim(), !(!r || t[r] && pn[r]) && (r === "set-cookie" ? t[r] ? t[r].push(n) : t[r] = [n] : t[r] = t[r] ? t[r] + ", " + n : n);
|
|
915
917
|
}), t;
|
|
916
|
-
},
|
|
917
|
-
function
|
|
918
|
+
}, nt = Symbol("internals");
|
|
919
|
+
function fe(e) {
|
|
918
920
|
return e && String(e).trim().toLowerCase();
|
|
919
921
|
}
|
|
920
|
-
function
|
|
921
|
-
return e === !1 || e == null ? e : a.isArray(e) ? e.map(
|
|
922
|
+
function Oe(e) {
|
|
923
|
+
return e === !1 || e == null ? e : a.isArray(e) ? e.map(Oe) : String(e);
|
|
922
924
|
}
|
|
923
|
-
function
|
|
925
|
+
function bn(e) {
|
|
924
926
|
const t = /* @__PURE__ */ Object.create(null), r = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
925
927
|
let n;
|
|
926
928
|
for (; n = r.exec(e); )
|
|
927
929
|
t[n[1]] = n[2];
|
|
928
930
|
return t;
|
|
929
931
|
}
|
|
930
|
-
const
|
|
931
|
-
function
|
|
932
|
+
const En = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
|
|
933
|
+
function Ie(e, t, r, n, s) {
|
|
932
934
|
if (a.isFunction(n))
|
|
933
935
|
return n.call(this, t, r);
|
|
934
936
|
if (s && (t = r), !!a.isString(t)) {
|
|
@@ -938,10 +940,10 @@ function Le(e, t, r, n, s) {
|
|
|
938
940
|
return n.test(t);
|
|
939
941
|
}
|
|
940
942
|
}
|
|
941
|
-
function
|
|
943
|
+
function wn(e) {
|
|
942
944
|
return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, r, n) => r.toUpperCase() + n);
|
|
943
945
|
}
|
|
944
|
-
function
|
|
946
|
+
function yn(e, t) {
|
|
945
947
|
const r = a.toCamelCase(" " + t);
|
|
946
948
|
["get", "set", "has"].forEach((n) => {
|
|
947
949
|
Object.defineProperty(e, n + r, {
|
|
@@ -952,24 +954,24 @@ function bn(e, t) {
|
|
|
952
954
|
});
|
|
953
955
|
});
|
|
954
956
|
}
|
|
955
|
-
let
|
|
957
|
+
let I = class {
|
|
956
958
|
constructor(t) {
|
|
957
959
|
t && this.set(t);
|
|
958
960
|
}
|
|
959
961
|
set(t, r, n) {
|
|
960
962
|
const s = this;
|
|
961
963
|
function i(c, h, f) {
|
|
962
|
-
const u =
|
|
964
|
+
const u = fe(h);
|
|
963
965
|
if (!u)
|
|
964
966
|
throw new Error("header name must be a non-empty string");
|
|
965
967
|
const m = a.findKey(s, u);
|
|
966
|
-
(!m || s[m] === void 0 || f === !0 || f === void 0 && s[m] !== !1) && (s[m || h] =
|
|
968
|
+
(!m || s[m] === void 0 || f === !0 || f === void 0 && s[m] !== !1) && (s[m || h] = Oe(c));
|
|
967
969
|
}
|
|
968
970
|
const o = (c, h) => a.forEach(c, (f, u) => i(f, u, h));
|
|
969
971
|
if (a.isPlainObject(t) || t instanceof this.constructor)
|
|
970
972
|
o(t, r);
|
|
971
|
-
else if (a.isString(t) && (t = t.trim()) && !
|
|
972
|
-
o(
|
|
973
|
+
else if (a.isString(t) && (t = t.trim()) && !En(t))
|
|
974
|
+
o(mn(t), r);
|
|
973
975
|
else if (a.isObject(t) && a.isIterable(t)) {
|
|
974
976
|
let c = {}, h, f;
|
|
975
977
|
for (const u of t) {
|
|
@@ -983,14 +985,14 @@ let U = class {
|
|
|
983
985
|
return this;
|
|
984
986
|
}
|
|
985
987
|
get(t, r) {
|
|
986
|
-
if (t =
|
|
988
|
+
if (t = fe(t), t) {
|
|
987
989
|
const n = a.findKey(this, t);
|
|
988
990
|
if (n) {
|
|
989
991
|
const s = this[n];
|
|
990
992
|
if (!r)
|
|
991
993
|
return s;
|
|
992
994
|
if (r === !0)
|
|
993
|
-
return
|
|
995
|
+
return bn(s);
|
|
994
996
|
if (a.isFunction(r))
|
|
995
997
|
return r.call(this, s, n);
|
|
996
998
|
if (a.isRegExp(r))
|
|
@@ -1000,9 +1002,9 @@ let U = class {
|
|
|
1000
1002
|
}
|
|
1001
1003
|
}
|
|
1002
1004
|
has(t, r) {
|
|
1003
|
-
if (t =
|
|
1005
|
+
if (t = fe(t), t) {
|
|
1004
1006
|
const n = a.findKey(this, t);
|
|
1005
|
-
return !!(n && this[n] !== void 0 && (!r ||
|
|
1007
|
+
return !!(n && this[n] !== void 0 && (!r || Ie(this, this[n], n, r)));
|
|
1006
1008
|
}
|
|
1007
1009
|
return !1;
|
|
1008
1010
|
}
|
|
@@ -1010,9 +1012,9 @@ let U = class {
|
|
|
1010
1012
|
const n = this;
|
|
1011
1013
|
let s = !1;
|
|
1012
1014
|
function i(o) {
|
|
1013
|
-
if (o =
|
|
1015
|
+
if (o = fe(o), o) {
|
|
1014
1016
|
const c = a.findKey(n, o);
|
|
1015
|
-
c && (!r ||
|
|
1017
|
+
c && (!r || Ie(n, n[c], c, r)) && (delete n[c], s = !0);
|
|
1016
1018
|
}
|
|
1017
1019
|
}
|
|
1018
1020
|
return a.isArray(t) ? t.forEach(i) : i(t), s;
|
|
@@ -1022,7 +1024,7 @@ let U = class {
|
|
|
1022
1024
|
let n = r.length, s = !1;
|
|
1023
1025
|
for (; n--; ) {
|
|
1024
1026
|
const i = r[n];
|
|
1025
|
-
(!t ||
|
|
1027
|
+
(!t || Ie(this, this[i], i, t, !0)) && (delete this[i], s = !0);
|
|
1026
1028
|
}
|
|
1027
1029
|
return s;
|
|
1028
1030
|
}
|
|
@@ -1031,11 +1033,11 @@ let U = class {
|
|
|
1031
1033
|
return a.forEach(this, (s, i) => {
|
|
1032
1034
|
const o = a.findKey(n, i);
|
|
1033
1035
|
if (o) {
|
|
1034
|
-
r[o] =
|
|
1036
|
+
r[o] = Oe(s), delete r[i];
|
|
1035
1037
|
return;
|
|
1036
1038
|
}
|
|
1037
|
-
const c = t ?
|
|
1038
|
-
c !== i && delete r[i], r[c] =
|
|
1039
|
+
const c = t ? wn(i) : String(i).trim();
|
|
1040
|
+
c !== i && delete r[i], r[c] = Oe(s), n[c] = !0;
|
|
1039
1041
|
}), this;
|
|
1040
1042
|
}
|
|
1041
1043
|
concat(...t) {
|
|
@@ -1068,18 +1070,18 @@ let U = class {
|
|
|
1068
1070
|
return r.forEach((s) => n.set(s)), n;
|
|
1069
1071
|
}
|
|
1070
1072
|
static accessor(t) {
|
|
1071
|
-
const n = (this[
|
|
1073
|
+
const n = (this[nt] = this[nt] = {
|
|
1072
1074
|
accessors: {}
|
|
1073
1075
|
}).accessors, s = this.prototype;
|
|
1074
1076
|
function i(o) {
|
|
1075
|
-
const c =
|
|
1076
|
-
n[c] || (
|
|
1077
|
+
const c = fe(o);
|
|
1078
|
+
n[c] || (yn(s, o), n[c] = !0);
|
|
1077
1079
|
}
|
|
1078
1080
|
return a.isArray(t) ? t.forEach(i) : i(t), this;
|
|
1079
1081
|
}
|
|
1080
1082
|
};
|
|
1081
|
-
|
|
1082
|
-
a.reduceDescriptors(
|
|
1083
|
+
I.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
|
|
1084
|
+
a.reduceDescriptors(I.prototype, ({ value: e }, t) => {
|
|
1083
1085
|
let r = t[0].toUpperCase() + t.slice(1);
|
|
1084
1086
|
return {
|
|
1085
1087
|
get: () => e,
|
|
@@ -1088,21 +1090,21 @@ a.reduceDescriptors(U.prototype, ({ value: e }, t) => {
|
|
|
1088
1090
|
}
|
|
1089
1091
|
};
|
|
1090
1092
|
});
|
|
1091
|
-
a.freezeMethods(
|
|
1093
|
+
a.freezeMethods(I);
|
|
1092
1094
|
function Ue(e, t) {
|
|
1093
|
-
const r = this ||
|
|
1095
|
+
const r = this || me, n = t || r, s = I.from(n.headers);
|
|
1094
1096
|
let i = n.data;
|
|
1095
1097
|
return a.forEach(e, function(c) {
|
|
1096
1098
|
i = c.call(r, i, s.normalize(), t ? t.status : void 0);
|
|
1097
1099
|
}), s.normalize(), i;
|
|
1098
1100
|
}
|
|
1099
|
-
function
|
|
1101
|
+
function Ut(e) {
|
|
1100
1102
|
return !!(e && e.__CANCEL__);
|
|
1101
1103
|
}
|
|
1102
|
-
function
|
|
1104
|
+
function oe(e, t, r) {
|
|
1103
1105
|
w.call(this, e ?? "canceled", w.ERR_CANCELED, t, r), this.name = "CanceledError";
|
|
1104
1106
|
}
|
|
1105
|
-
a.inherits(
|
|
1107
|
+
a.inherits(oe, w, {
|
|
1106
1108
|
__CANCEL__: !0
|
|
1107
1109
|
});
|
|
1108
1110
|
function Ft(e, t, r) {
|
|
@@ -1115,11 +1117,11 @@ function Ft(e, t, r) {
|
|
|
1115
1117
|
r
|
|
1116
1118
|
));
|
|
1117
1119
|
}
|
|
1118
|
-
function
|
|
1120
|
+
function gn(e) {
|
|
1119
1121
|
const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
|
|
1120
1122
|
return t && t[1] || "";
|
|
1121
1123
|
}
|
|
1122
|
-
function
|
|
1124
|
+
function Sn(e, t) {
|
|
1123
1125
|
e = e || 10;
|
|
1124
1126
|
const r = new Array(e), n = new Array(e);
|
|
1125
1127
|
let s = 0, i = 0, o;
|
|
@@ -1135,7 +1137,7 @@ function yn(e, t) {
|
|
|
1135
1137
|
return A ? Math.round(g * 1e3 / A) : void 0;
|
|
1136
1138
|
};
|
|
1137
1139
|
}
|
|
1138
|
-
function
|
|
1140
|
+
function Rn(e, t) {
|
|
1139
1141
|
let r = 0, n = 1e3 / t, s, i;
|
|
1140
1142
|
const o = (f, u = Date.now()) => {
|
|
1141
1143
|
r = u, s = null, i && (clearTimeout(i), i = null), e(...f);
|
|
@@ -1147,10 +1149,10 @@ function gn(e, t) {
|
|
|
1147
1149
|
}, n - m)));
|
|
1148
1150
|
}, () => s && o(s)];
|
|
1149
1151
|
}
|
|
1150
|
-
const
|
|
1152
|
+
const xe = (e, t, r = 3) => {
|
|
1151
1153
|
let n = 0;
|
|
1152
|
-
const s =
|
|
1153
|
-
return
|
|
1154
|
+
const s = Sn(50, 250);
|
|
1155
|
+
return Rn((i) => {
|
|
1154
1156
|
const o = i.loaded, c = i.lengthComputable ? i.total : void 0, h = o - n, f = s(h), u = o <= c;
|
|
1155
1157
|
n = o;
|
|
1156
1158
|
const m = {
|
|
@@ -1166,17 +1168,17 @@ const Te = (e, t, r = 3) => {
|
|
|
1166
1168
|
};
|
|
1167
1169
|
e(m);
|
|
1168
1170
|
}, r);
|
|
1169
|
-
},
|
|
1171
|
+
}, st = (e, t) => {
|
|
1170
1172
|
const r = e != null;
|
|
1171
1173
|
return [(n) => t[0]({
|
|
1172
1174
|
lengthComputable: r,
|
|
1173
1175
|
total: e,
|
|
1174
1176
|
loaded: n
|
|
1175
1177
|
}), t[1]];
|
|
1176
|
-
},
|
|
1178
|
+
}, ot = (e) => (...t) => a.asap(() => e(...t)), On = k.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (r) => (r = new URL(r, k.origin), e.protocol === r.protocol && e.host === r.host && (t || e.port === r.port)))(
|
|
1177
1179
|
new URL(k.origin),
|
|
1178
1180
|
k.navigator && /(msie|trident)/i.test(k.navigator.userAgent)
|
|
1179
|
-
) : () => !0,
|
|
1181
|
+
) : () => !0, An = k.hasStandardBrowserEnv ? (
|
|
1180
1182
|
// Standard browser envs support document.cookie
|
|
1181
1183
|
{
|
|
1182
1184
|
write(e, t, r, n, s, i, o) {
|
|
@@ -1205,18 +1207,18 @@ const Te = (e, t, r = 3) => {
|
|
|
1205
1207
|
}
|
|
1206
1208
|
}
|
|
1207
1209
|
);
|
|
1208
|
-
function
|
|
1210
|
+
function Tn(e) {
|
|
1209
1211
|
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
|
|
1210
1212
|
}
|
|
1211
|
-
function
|
|
1213
|
+
function xn(e, t) {
|
|
1212
1214
|
return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
|
|
1213
1215
|
}
|
|
1214
1216
|
function vt(e, t, r) {
|
|
1215
|
-
let n = !
|
|
1216
|
-
return e && (n || r == !1) ?
|
|
1217
|
+
let n = !Tn(t);
|
|
1218
|
+
return e && (n || r == !1) ? xn(e, t) : t;
|
|
1217
1219
|
}
|
|
1218
|
-
const
|
|
1219
|
-
function
|
|
1220
|
+
const it = (e) => e instanceof I ? { ...e } : e;
|
|
1221
|
+
function X(e, t) {
|
|
1220
1222
|
t = t || {};
|
|
1221
1223
|
const r = {};
|
|
1222
1224
|
function n(f, u, m, g) {
|
|
@@ -1273,7 +1275,7 @@ function K(e, t) {
|
|
|
1273
1275
|
socketPath: o,
|
|
1274
1276
|
responseEncoding: o,
|
|
1275
1277
|
validateStatus: c,
|
|
1276
|
-
headers: (f, u, m) => s(
|
|
1278
|
+
headers: (f, u, m) => s(it(f), it(u), m, !0)
|
|
1277
1279
|
};
|
|
1278
1280
|
return a.forEach(Object.keys({ ...e, ...t }), function(u) {
|
|
1279
1281
|
const m = h[u] || s, g = m(e[u], t[u], u);
|
|
@@ -1281,9 +1283,9 @@ function K(e, t) {
|
|
|
1281
1283
|
}), r;
|
|
1282
1284
|
}
|
|
1283
1285
|
const Dt = (e) => {
|
|
1284
|
-
const t =
|
|
1286
|
+
const t = X({}, e);
|
|
1285
1287
|
let { data: r, withXSRFToken: n, xsrfHeaderName: s, xsrfCookieName: i, headers: o, auth: c } = t;
|
|
1286
|
-
if (t.headers = o =
|
|
1288
|
+
if (t.headers = o = I.from(o), t.url = jt(vt(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), c && o.set(
|
|
1287
1289
|
"Authorization",
|
|
1288
1290
|
"Basic " + btoa((c.username || "") + ":" + (c.password ? unescape(encodeURIComponent(c.password)) : ""))
|
|
1289
1291
|
), a.isFormData(r)) {
|
|
@@ -1296,18 +1298,18 @@ const Dt = (e) => {
|
|
|
1296
1298
|
});
|
|
1297
1299
|
}
|
|
1298
1300
|
}
|
|
1299
|
-
if (k.hasStandardBrowserEnv && (n && a.isFunction(n) && (n = n(t)), n || n !== !1 &&
|
|
1300
|
-
const h = s && i &&
|
|
1301
|
+
if (k.hasStandardBrowserEnv && (n && a.isFunction(n) && (n = n(t)), n || n !== !1 && On(t.url))) {
|
|
1302
|
+
const h = s && i && An.read(i);
|
|
1301
1303
|
h && o.set(s, h);
|
|
1302
1304
|
}
|
|
1303
1305
|
return t;
|
|
1304
|
-
},
|
|
1306
|
+
}, Nn = typeof XMLHttpRequest < "u", _n = Nn && function(e) {
|
|
1305
1307
|
return new Promise(function(r, n) {
|
|
1306
1308
|
const s = Dt(e);
|
|
1307
1309
|
let i = s.data;
|
|
1308
|
-
const o =
|
|
1310
|
+
const o = I.from(s.headers).normalize();
|
|
1309
1311
|
let { responseType: c, onUploadProgress: h, onDownloadProgress: f } = s, u, m, g, A, d;
|
|
1310
|
-
function
|
|
1312
|
+
function b() {
|
|
1311
1313
|
A && A(), d && d(), s.cancelToken && s.cancelToken.unsubscribe(u), s.signal && s.signal.removeEventListener("abort", u);
|
|
1312
1314
|
}
|
|
1313
1315
|
let p = new XMLHttpRequest();
|
|
@@ -1315,9 +1317,9 @@ const Dt = (e) => {
|
|
|
1315
1317
|
function S() {
|
|
1316
1318
|
if (!p)
|
|
1317
1319
|
return;
|
|
1318
|
-
const T =
|
|
1320
|
+
const T = I.from(
|
|
1319
1321
|
"getAllResponseHeaders" in p && p.getAllResponseHeaders()
|
|
1320
|
-
),
|
|
1322
|
+
), U = {
|
|
1321
1323
|
data: !c || c === "text" || c === "json" ? p.responseText : p.response,
|
|
1322
1324
|
status: p.status,
|
|
1323
1325
|
statusText: p.statusText,
|
|
@@ -1326,40 +1328,40 @@ const Dt = (e) => {
|
|
|
1326
1328
|
request: p
|
|
1327
1329
|
};
|
|
1328
1330
|
Ft(function(j) {
|
|
1329
|
-
r(j),
|
|
1331
|
+
r(j), b();
|
|
1330
1332
|
}, function(j) {
|
|
1331
|
-
n(j),
|
|
1332
|
-
},
|
|
1333
|
+
n(j), b();
|
|
1334
|
+
}, U), p = null;
|
|
1333
1335
|
}
|
|
1334
1336
|
"onloadend" in p ? p.onloadend = S : p.onreadystatechange = function() {
|
|
1335
1337
|
!p || p.readyState !== 4 || p.status === 0 && !(p.responseURL && p.responseURL.indexOf("file:") === 0) || setTimeout(S);
|
|
1336
1338
|
}, p.onabort = function() {
|
|
1337
1339
|
p && (n(new w("Request aborted", w.ECONNABORTED, e, p)), p = null);
|
|
1338
1340
|
}, p.onerror = function(C) {
|
|
1339
|
-
const
|
|
1341
|
+
const U = C && C.message ? C.message : "Network Error", $ = new w(U, w.ERR_NETWORK, e, p);
|
|
1340
1342
|
$.event = C || null, n($), p = null;
|
|
1341
1343
|
}, p.ontimeout = function() {
|
|
1342
1344
|
let C = s.timeout ? "timeout of " + s.timeout + "ms exceeded" : "timeout exceeded";
|
|
1343
|
-
const
|
|
1345
|
+
const U = s.transitional || Lt;
|
|
1344
1346
|
s.timeoutErrorMessage && (C = s.timeoutErrorMessage), n(new w(
|
|
1345
1347
|
C,
|
|
1346
|
-
|
|
1348
|
+
U.clarifyTimeoutError ? w.ETIMEDOUT : w.ECONNABORTED,
|
|
1347
1349
|
e,
|
|
1348
1350
|
p
|
|
1349
1351
|
)), p = null;
|
|
1350
|
-
}, i === void 0 && o.setContentType(null), "setRequestHeader" in p && a.forEach(o.toJSON(), function(C,
|
|
1351
|
-
p.setRequestHeader(
|
|
1352
|
-
}), a.isUndefined(s.withCredentials) || (p.withCredentials = !!s.withCredentials), c && c !== "json" && (p.responseType = s.responseType), f && ([g, d] =
|
|
1353
|
-
p && (n(!T || T.type ? new
|
|
1352
|
+
}, i === void 0 && o.setContentType(null), "setRequestHeader" in p && a.forEach(o.toJSON(), function(C, U) {
|
|
1353
|
+
p.setRequestHeader(U, C);
|
|
1354
|
+
}), a.isUndefined(s.withCredentials) || (p.withCredentials = !!s.withCredentials), c && c !== "json" && (p.responseType = s.responseType), f && ([g, d] = xe(f, !0), p.addEventListener("progress", g)), h && p.upload && ([m, A] = xe(h), p.upload.addEventListener("progress", m), p.upload.addEventListener("loadend", A)), (s.cancelToken || s.signal) && (u = (T) => {
|
|
1355
|
+
p && (n(!T || T.type ? new oe(null, e, p) : T), p.abort(), p = null);
|
|
1354
1356
|
}, s.cancelToken && s.cancelToken.subscribe(u), s.signal && (s.signal.aborted ? u() : s.signal.addEventListener("abort", u)));
|
|
1355
|
-
const N =
|
|
1357
|
+
const N = gn(s.url);
|
|
1356
1358
|
if (N && k.protocols.indexOf(N) === -1) {
|
|
1357
1359
|
n(new w("Unsupported protocol " + N + ":", w.ERR_BAD_REQUEST, e));
|
|
1358
1360
|
return;
|
|
1359
1361
|
}
|
|
1360
1362
|
p.send(i || null);
|
|
1361
1363
|
});
|
|
1362
|
-
},
|
|
1364
|
+
}, Pn = (e, t) => {
|
|
1363
1365
|
const { length: r } = e = e ? e.filter(Boolean) : [];
|
|
1364
1366
|
if (t || r) {
|
|
1365
1367
|
let n = new AbortController(), s;
|
|
@@ -1367,7 +1369,7 @@ const Dt = (e) => {
|
|
|
1367
1369
|
if (!s) {
|
|
1368
1370
|
s = !0, c();
|
|
1369
1371
|
const u = f instanceof Error ? f : this.reason;
|
|
1370
|
-
n.abort(u instanceof w ? u : new
|
|
1372
|
+
n.abort(u instanceof w ? u : new oe(u instanceof Error ? u.message : u));
|
|
1371
1373
|
}
|
|
1372
1374
|
};
|
|
1373
1375
|
let o = t && setTimeout(() => {
|
|
@@ -1382,7 +1384,7 @@ const Dt = (e) => {
|
|
|
1382
1384
|
const { signal: h } = n;
|
|
1383
1385
|
return h.unsubscribe = () => a.asap(c), h;
|
|
1384
1386
|
}
|
|
1385
|
-
},
|
|
1387
|
+
}, Cn = function* (e, t) {
|
|
1386
1388
|
let r = e.byteLength;
|
|
1387
1389
|
if (r < t) {
|
|
1388
1390
|
yield e;
|
|
@@ -1391,10 +1393,10 @@ const Dt = (e) => {
|
|
|
1391
1393
|
let n = 0, s;
|
|
1392
1394
|
for (; n < r; )
|
|
1393
1395
|
s = n + t, yield e.slice(n, s), n = s;
|
|
1394
|
-
},
|
|
1395
|
-
for await (const r of
|
|
1396
|
-
yield*
|
|
1397
|
-
},
|
|
1396
|
+
}, kn = async function* (e, t) {
|
|
1397
|
+
for await (const r of jn(e))
|
|
1398
|
+
yield* Cn(r, t);
|
|
1399
|
+
}, jn = async function* (e) {
|
|
1398
1400
|
if (e[Symbol.asyncIterator]) {
|
|
1399
1401
|
yield* e;
|
|
1400
1402
|
return;
|
|
@@ -1410,8 +1412,8 @@ const Dt = (e) => {
|
|
|
1410
1412
|
} finally {
|
|
1411
1413
|
await t.cancel();
|
|
1412
1414
|
}
|
|
1413
|
-
},
|
|
1414
|
-
const s =
|
|
1415
|
+
}, at = (e, t, r, n) => {
|
|
1416
|
+
const s = kn(e, t);
|
|
1415
1417
|
let i = 0, o, c = (h) => {
|
|
1416
1418
|
o || (o = !0, n && n(h));
|
|
1417
1419
|
};
|
|
@@ -1439,43 +1441,43 @@ const Dt = (e) => {
|
|
|
1439
1441
|
}, {
|
|
1440
1442
|
highWaterMark: 2
|
|
1441
1443
|
});
|
|
1442
|
-
},
|
|
1444
|
+
}, ct = 64 * 1024, { isFunction: ge } = a, Ln = (({ Request: e, Response: t }) => ({
|
|
1443
1445
|
Request: e,
|
|
1444
1446
|
Response: t
|
|
1445
1447
|
}))(a.global), {
|
|
1446
|
-
ReadableStream:
|
|
1447
|
-
TextEncoder:
|
|
1448
|
-
} = a.global,
|
|
1448
|
+
ReadableStream: lt,
|
|
1449
|
+
TextEncoder: ut
|
|
1450
|
+
} = a.global, ft = (e, ...t) => {
|
|
1449
1451
|
try {
|
|
1450
1452
|
return !!e(...t);
|
|
1451
1453
|
} catch {
|
|
1452
1454
|
return !1;
|
|
1453
1455
|
}
|
|
1454
|
-
},
|
|
1456
|
+
}, In = (e) => {
|
|
1455
1457
|
e = a.merge.call({
|
|
1456
1458
|
skipUndefined: !0
|
|
1457
|
-
},
|
|
1458
|
-
const { fetch: t, Request: r, Response: n } = e, s = t ?
|
|
1459
|
+
}, Ln, e);
|
|
1460
|
+
const { fetch: t, Request: r, Response: n } = e, s = t ? ge(t) : typeof fetch == "function", i = ge(r), o = ge(n);
|
|
1459
1461
|
if (!s)
|
|
1460
1462
|
return !1;
|
|
1461
|
-
const c = s &&
|
|
1463
|
+
const c = s && ge(lt), h = s && (typeof ut == "function" ? /* @__PURE__ */ ((d) => (b) => d.encode(b))(new ut()) : async (d) => new Uint8Array(await new r(d).arrayBuffer())), f = i && c && ft(() => {
|
|
1462
1464
|
let d = !1;
|
|
1463
|
-
const
|
|
1464
|
-
body: new
|
|
1465
|
+
const b = new r(k.origin, {
|
|
1466
|
+
body: new lt(),
|
|
1465
1467
|
method: "POST",
|
|
1466
1468
|
get duplex() {
|
|
1467
1469
|
return d = !0, "half";
|
|
1468
1470
|
}
|
|
1469
1471
|
}).headers.has("Content-Type");
|
|
1470
|
-
return d && !
|
|
1471
|
-
}), u = o && c &&
|
|
1472
|
+
return d && !b;
|
|
1473
|
+
}), u = o && c && ft(() => a.isReadableStream(new n("").body)), m = {
|
|
1472
1474
|
stream: u && ((d) => d.body)
|
|
1473
1475
|
};
|
|
1474
1476
|
s && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((d) => {
|
|
1475
|
-
!m[d] && (m[d] = (
|
|
1476
|
-
let S =
|
|
1477
|
+
!m[d] && (m[d] = (b, p) => {
|
|
1478
|
+
let S = b && b[d];
|
|
1477
1479
|
if (S)
|
|
1478
|
-
return S.call(
|
|
1480
|
+
return S.call(b);
|
|
1479
1481
|
throw new w(`Response type '${d}' is not supported`, w.ERR_NOT_SUPPORT, p);
|
|
1480
1482
|
});
|
|
1481
1483
|
});
|
|
@@ -1493,81 +1495,81 @@ const Dt = (e) => {
|
|
|
1493
1495
|
return d.byteLength;
|
|
1494
1496
|
if (a.isURLSearchParams(d) && (d = d + ""), a.isString(d))
|
|
1495
1497
|
return (await h(d)).byteLength;
|
|
1496
|
-
}, A = async (d,
|
|
1498
|
+
}, A = async (d, b) => {
|
|
1497
1499
|
const p = a.toFiniteNumber(d.getContentLength());
|
|
1498
|
-
return p ?? g(
|
|
1500
|
+
return p ?? g(b);
|
|
1499
1501
|
};
|
|
1500
1502
|
return async (d) => {
|
|
1501
1503
|
let {
|
|
1502
|
-
url:
|
|
1504
|
+
url: b,
|
|
1503
1505
|
method: p,
|
|
1504
1506
|
data: S,
|
|
1505
1507
|
signal: N,
|
|
1506
1508
|
cancelToken: T,
|
|
1507
1509
|
timeout: C,
|
|
1508
|
-
onDownloadProgress:
|
|
1510
|
+
onDownloadProgress: U,
|
|
1509
1511
|
onUploadProgress: $,
|
|
1510
1512
|
responseType: j,
|
|
1511
|
-
headers:
|
|
1513
|
+
headers: ie,
|
|
1512
1514
|
withCredentials: H = "same-origin",
|
|
1513
|
-
fetchOptions:
|
|
1515
|
+
fetchOptions: be
|
|
1514
1516
|
} = Dt(d), Ee = t || fetch;
|
|
1515
1517
|
j = j ? (j + "").toLowerCase() : "text";
|
|
1516
|
-
let z =
|
|
1518
|
+
let z = Pn([N, T && T.toAbortSignal()], C), G = null;
|
|
1517
1519
|
const q = z && z.unsubscribe && (() => {
|
|
1518
1520
|
z.unsubscribe();
|
|
1519
1521
|
});
|
|
1520
1522
|
let Z;
|
|
1521
1523
|
try {
|
|
1522
|
-
if ($ && f && p !== "get" && p !== "head" && (Z = await A(
|
|
1523
|
-
let l = new r(
|
|
1524
|
+
if ($ && f && p !== "get" && p !== "head" && (Z = await A(ie, S)) !== 0) {
|
|
1525
|
+
let l = new r(b, {
|
|
1524
1526
|
method: "POST",
|
|
1525
1527
|
body: S,
|
|
1526
1528
|
duplex: "half"
|
|
1527
|
-
}),
|
|
1528
|
-
if (a.isFormData(S) && (
|
|
1529
|
-
const [R, O] =
|
|
1529
|
+
}), E;
|
|
1530
|
+
if (a.isFormData(S) && (E = l.headers.get("content-type")) && ie.setContentType(E), l.body) {
|
|
1531
|
+
const [R, O] = st(
|
|
1530
1532
|
Z,
|
|
1531
|
-
|
|
1533
|
+
xe(ot($))
|
|
1532
1534
|
);
|
|
1533
|
-
S =
|
|
1535
|
+
S = at(l.body, ct, R, O);
|
|
1534
1536
|
}
|
|
1535
1537
|
}
|
|
1536
1538
|
a.isString(H) || (H = H ? "include" : "omit");
|
|
1537
|
-
const F = i && "credentials" in r.prototype,
|
|
1538
|
-
...
|
|
1539
|
+
const F = i && "credentials" in r.prototype, ae = {
|
|
1540
|
+
...be,
|
|
1539
1541
|
signal: z,
|
|
1540
1542
|
method: p.toUpperCase(),
|
|
1541
|
-
headers:
|
|
1543
|
+
headers: ie.normalize().toJSON(),
|
|
1542
1544
|
body: S,
|
|
1543
1545
|
duplex: "half",
|
|
1544
1546
|
credentials: F ? H : void 0
|
|
1545
1547
|
};
|
|
1546
|
-
G = i && new r(
|
|
1547
|
-
let v = await (i ? Ee(G,
|
|
1548
|
-
const
|
|
1549
|
-
if (u && (
|
|
1548
|
+
G = i && new r(b, ae);
|
|
1549
|
+
let v = await (i ? Ee(G, be) : Ee(b, ae));
|
|
1550
|
+
const ce = u && (j === "stream" || j === "response");
|
|
1551
|
+
if (u && (U || ce && q)) {
|
|
1550
1552
|
const l = {};
|
|
1551
1553
|
["status", "statusText", "headers"].forEach((W) => {
|
|
1552
1554
|
l[W] = v[W];
|
|
1553
1555
|
});
|
|
1554
|
-
const
|
|
1555
|
-
|
|
1556
|
-
|
|
1556
|
+
const E = a.toFiniteNumber(v.headers.get("content-length")), [R, O] = U && st(
|
|
1557
|
+
E,
|
|
1558
|
+
xe(ot(U), !0)
|
|
1557
1559
|
) || [];
|
|
1558
1560
|
v = new n(
|
|
1559
|
-
|
|
1561
|
+
at(v.body, ct, R, () => {
|
|
1560
1562
|
O && O(), q && q();
|
|
1561
1563
|
}),
|
|
1562
1564
|
l
|
|
1563
1565
|
);
|
|
1564
1566
|
}
|
|
1565
1567
|
j = j || "text";
|
|
1566
|
-
let
|
|
1567
|
-
return !
|
|
1568
|
-
Ft(l,
|
|
1569
|
-
data:
|
|
1570
|
-
headers:
|
|
1568
|
+
let we = await m[a.findKey(m, j) || "text"](v, d);
|
|
1569
|
+
return !ce && q && q(), await new Promise((l, E) => {
|
|
1570
|
+
Ft(l, E, {
|
|
1571
|
+
data: we,
|
|
1572
|
+
headers: I.from(v.headers),
|
|
1571
1573
|
status: v.status,
|
|
1572
1574
|
statusText: v.statusText,
|
|
1573
1575
|
config: d,
|
|
@@ -1583,27 +1585,27 @@ const Dt = (e) => {
|
|
|
1583
1585
|
) : w.from(F, F && F.code, d, G);
|
|
1584
1586
|
}
|
|
1585
1587
|
};
|
|
1586
|
-
},
|
|
1588
|
+
}, Un = /* @__PURE__ */ new Map(), Bt = (e) => {
|
|
1587
1589
|
let t = e && e.env || {};
|
|
1588
1590
|
const { fetch: r, Request: n, Response: s } = t, i = [
|
|
1589
1591
|
n,
|
|
1590
1592
|
s,
|
|
1591
1593
|
r
|
|
1592
1594
|
];
|
|
1593
|
-
let o = i.length, c = o, h, f, u =
|
|
1595
|
+
let o = i.length, c = o, h, f, u = Un;
|
|
1594
1596
|
for (; c--; )
|
|
1595
|
-
h = i[c], f = u.get(h), f === void 0 && u.set(h, f = c ? /* @__PURE__ */ new Map() :
|
|
1597
|
+
h = i[c], f = u.get(h), f === void 0 && u.set(h, f = c ? /* @__PURE__ */ new Map() : In(t)), u = f;
|
|
1596
1598
|
return f;
|
|
1597
1599
|
};
|
|
1598
1600
|
Bt();
|
|
1599
|
-
const
|
|
1600
|
-
http:
|
|
1601
|
-
xhr:
|
|
1601
|
+
const Ye = {
|
|
1602
|
+
http: Xr,
|
|
1603
|
+
xhr: _n,
|
|
1602
1604
|
fetch: {
|
|
1603
1605
|
get: Bt
|
|
1604
1606
|
}
|
|
1605
1607
|
};
|
|
1606
|
-
a.forEach(
|
|
1608
|
+
a.forEach(Ye, (e, t) => {
|
|
1607
1609
|
if (e) {
|
|
1608
1610
|
try {
|
|
1609
1611
|
Object.defineProperty(e, "name", { value: t });
|
|
@@ -1612,8 +1614,8 @@ a.forEach(Je, (e, t) => {
|
|
|
1612
1614
|
Object.defineProperty(e, "adapterName", { value: t });
|
|
1613
1615
|
}
|
|
1614
1616
|
});
|
|
1615
|
-
const
|
|
1616
|
-
function
|
|
1617
|
+
const dt = (e) => `- ${e}`, Fn = (e) => a.isFunction(e) || e === null || e === !1;
|
|
1618
|
+
function vn(e, t) {
|
|
1617
1619
|
e = a.isArray(e) ? e : [e];
|
|
1618
1620
|
const { length: r } = e;
|
|
1619
1621
|
let n, s;
|
|
@@ -1621,7 +1623,7 @@ function In(e, t) {
|
|
|
1621
1623
|
for (let o = 0; o < r; o++) {
|
|
1622
1624
|
n = e[o];
|
|
1623
1625
|
let c;
|
|
1624
|
-
if (s = n, !
|
|
1626
|
+
if (s = n, !Fn(n) && (s = Ye[(c = String(n)).toLowerCase()], s === void 0))
|
|
1625
1627
|
throw new w(`Unknown adapter '${c}'`);
|
|
1626
1628
|
if (s && (a.isFunction(s) || (s = s.get(t))))
|
|
1627
1629
|
break;
|
|
@@ -1632,8 +1634,8 @@ function In(e, t) {
|
|
|
1632
1634
|
([h, f]) => `adapter ${h} ` + (f === !1 ? "is not supported by the environment" : "is not available in the build")
|
|
1633
1635
|
);
|
|
1634
1636
|
let c = r ? o.length > 1 ? `since :
|
|
1635
|
-
` + o.map(
|
|
1636
|
-
`) : " " +
|
|
1637
|
+
` + o.map(dt).join(`
|
|
1638
|
+
`) : " " + dt(o[0]) : "as no adapter specified";
|
|
1637
1639
|
throw new w(
|
|
1638
1640
|
"There is no suitable adapter to dispatch the request " + c,
|
|
1639
1641
|
"ERR_NOT_SUPPORT"
|
|
@@ -1646,43 +1648,43 @@ const $t = {
|
|
|
1646
1648
|
* Resolve an adapter from a list of adapter names or functions.
|
|
1647
1649
|
* @type {Function}
|
|
1648
1650
|
*/
|
|
1649
|
-
getAdapter:
|
|
1651
|
+
getAdapter: vn,
|
|
1650
1652
|
/**
|
|
1651
1653
|
* Exposes all known adapters
|
|
1652
1654
|
* @type {Object<string, Function|Object>}
|
|
1653
1655
|
*/
|
|
1654
|
-
adapters:
|
|
1656
|
+
adapters: Ye
|
|
1655
1657
|
};
|
|
1656
|
-
function
|
|
1658
|
+
function Fe(e) {
|
|
1657
1659
|
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
|
|
1658
|
-
throw new
|
|
1660
|
+
throw new oe(null, e);
|
|
1659
1661
|
}
|
|
1660
|
-
function
|
|
1661
|
-
return
|
|
1662
|
+
function ht(e) {
|
|
1663
|
+
return Fe(e), e.headers = I.from(e.headers), e.data = Ue.call(
|
|
1662
1664
|
e,
|
|
1663
1665
|
e.transformRequest
|
|
1664
|
-
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), $t.getAdapter(e.adapter ||
|
|
1665
|
-
return
|
|
1666
|
+
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), $t.getAdapter(e.adapter || me.adapter, e)(e).then(function(n) {
|
|
1667
|
+
return Fe(e), n.data = Ue.call(
|
|
1666
1668
|
e,
|
|
1667
1669
|
e.transformResponse,
|
|
1668
1670
|
n
|
|
1669
|
-
), n.headers =
|
|
1671
|
+
), n.headers = I.from(n.headers), n;
|
|
1670
1672
|
}, function(n) {
|
|
1671
|
-
return
|
|
1673
|
+
return Ut(n) || (Fe(e), n && n.response && (n.response.data = Ue.call(
|
|
1672
1674
|
e,
|
|
1673
1675
|
e.transformResponse,
|
|
1674
1676
|
n.response
|
|
1675
|
-
), n.response.headers =
|
|
1677
|
+
), n.response.headers = I.from(n.response.headers))), Promise.reject(n);
|
|
1676
1678
|
});
|
|
1677
1679
|
}
|
|
1678
|
-
const qt = "1.13.2",
|
|
1680
|
+
const qt = "1.13.2", ke = {};
|
|
1679
1681
|
["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
|
|
1680
|
-
|
|
1682
|
+
ke[e] = function(n) {
|
|
1681
1683
|
return typeof n === e || "a" + (t < 1 ? "n " : " ") + e;
|
|
1682
1684
|
};
|
|
1683
1685
|
});
|
|
1684
|
-
const
|
|
1685
|
-
|
|
1686
|
+
const pt = {};
|
|
1687
|
+
ke.transitional = function(t, r, n) {
|
|
1686
1688
|
function s(i, o) {
|
|
1687
1689
|
return "[Axios v" + qt + "] Transitional option '" + i + "'" + o + (n ? ". " + n : "");
|
|
1688
1690
|
}
|
|
@@ -1692,7 +1694,7 @@ Ce.transitional = function(t, r, n) {
|
|
|
1692
1694
|
s(o, " has been removed" + (r ? " in " + r : "")),
|
|
1693
1695
|
w.ERR_DEPRECATED
|
|
1694
1696
|
);
|
|
1695
|
-
return r && !
|
|
1697
|
+
return r && !pt[o] && (pt[o] = !0, console.warn(
|
|
1696
1698
|
s(
|
|
1697
1699
|
o,
|
|
1698
1700
|
" has been deprecated since v" + r + " and will be removed in the near future"
|
|
@@ -1700,10 +1702,10 @@ Ce.transitional = function(t, r, n) {
|
|
|
1700
1702
|
)), t ? t(i, o, c) : !0;
|
|
1701
1703
|
};
|
|
1702
1704
|
};
|
|
1703
|
-
|
|
1705
|
+
ke.spelling = function(t) {
|
|
1704
1706
|
return (r, n) => (console.warn(`${n} is likely a misspelling of ${t}`), !0);
|
|
1705
1707
|
};
|
|
1706
|
-
function
|
|
1708
|
+
function Dn(e, t, r) {
|
|
1707
1709
|
if (typeof e != "object")
|
|
1708
1710
|
throw new w("options must be an object", w.ERR_BAD_OPTION_VALUE);
|
|
1709
1711
|
const n = Object.keys(e);
|
|
@@ -1720,15 +1722,15 @@ function Fn(e, t, r) {
|
|
|
1720
1722
|
throw new w("Unknown option " + i, w.ERR_BAD_OPTION);
|
|
1721
1723
|
}
|
|
1722
1724
|
}
|
|
1723
|
-
const
|
|
1724
|
-
assertOptions:
|
|
1725
|
-
validators:
|
|
1726
|
-
}, B =
|
|
1725
|
+
const Ae = {
|
|
1726
|
+
assertOptions: Dn,
|
|
1727
|
+
validators: ke
|
|
1728
|
+
}, B = Ae.validators;
|
|
1727
1729
|
let Y = class {
|
|
1728
1730
|
constructor(t) {
|
|
1729
1731
|
this.defaults = t || {}, this.interceptors = {
|
|
1730
|
-
request: new
|
|
1731
|
-
response: new
|
|
1732
|
+
request: new rt(),
|
|
1733
|
+
response: new rt()
|
|
1732
1734
|
};
|
|
1733
1735
|
}
|
|
1734
1736
|
/**
|
|
@@ -1757,18 +1759,18 @@ let Y = class {
|
|
|
1757
1759
|
}
|
|
1758
1760
|
}
|
|
1759
1761
|
_request(t, r) {
|
|
1760
|
-
typeof t == "string" ? (r = r || {}, r.url = t) : r = t || {}, r =
|
|
1762
|
+
typeof t == "string" ? (r = r || {}, r.url = t) : r = t || {}, r = X(this.defaults, r);
|
|
1761
1763
|
const { transitional: n, paramsSerializer: s, headers: i } = r;
|
|
1762
|
-
n !== void 0 &&
|
|
1764
|
+
n !== void 0 && Ae.assertOptions(n, {
|
|
1763
1765
|
silentJSONParsing: B.transitional(B.boolean),
|
|
1764
1766
|
forcedJSONParsing: B.transitional(B.boolean),
|
|
1765
1767
|
clarifyTimeoutError: B.transitional(B.boolean)
|
|
1766
1768
|
}, !1), s != null && (a.isFunction(s) ? r.paramsSerializer = {
|
|
1767
1769
|
serialize: s
|
|
1768
|
-
} :
|
|
1770
|
+
} : Ae.assertOptions(s, {
|
|
1769
1771
|
encode: B.function,
|
|
1770
1772
|
serialize: B.function
|
|
1771
|
-
}, !0)), r.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? r.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : r.allowAbsoluteUrls = !0),
|
|
1773
|
+
}, !0)), r.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? r.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : r.allowAbsoluteUrls = !0), Ae.assertOptions(r, {
|
|
1772
1774
|
baseUrl: B.spelling("baseURL"),
|
|
1773
1775
|
withXsrfToken: B.spelling("withXSRFToken")
|
|
1774
1776
|
}, !0), r.method = (r.method || this.defaults.method || "get").toLowerCase();
|
|
@@ -1781,19 +1783,19 @@ let Y = class {
|
|
|
1781
1783
|
(d) => {
|
|
1782
1784
|
delete i[d];
|
|
1783
1785
|
}
|
|
1784
|
-
), r.headers =
|
|
1786
|
+
), r.headers = I.concat(o, i);
|
|
1785
1787
|
const c = [];
|
|
1786
1788
|
let h = !0;
|
|
1787
|
-
this.interceptors.request.forEach(function(
|
|
1788
|
-
typeof
|
|
1789
|
+
this.interceptors.request.forEach(function(b) {
|
|
1790
|
+
typeof b.runWhen == "function" && b.runWhen(r) === !1 || (h = h && b.synchronous, c.unshift(b.fulfilled, b.rejected));
|
|
1789
1791
|
});
|
|
1790
1792
|
const f = [];
|
|
1791
|
-
this.interceptors.response.forEach(function(
|
|
1792
|
-
f.push(
|
|
1793
|
+
this.interceptors.response.forEach(function(b) {
|
|
1794
|
+
f.push(b.fulfilled, b.rejected);
|
|
1793
1795
|
});
|
|
1794
1796
|
let u, m = 0, g;
|
|
1795
1797
|
if (!h) {
|
|
1796
|
-
const d = [
|
|
1798
|
+
const d = [ht.bind(this), void 0];
|
|
1797
1799
|
for (d.unshift(...c), d.push(...f), g = d.length, u = Promise.resolve(r); m < g; )
|
|
1798
1800
|
u = u.then(d[m++], d[m++]);
|
|
1799
1801
|
return u;
|
|
@@ -1801,16 +1803,16 @@ let Y = class {
|
|
|
1801
1803
|
g = c.length;
|
|
1802
1804
|
let A = r;
|
|
1803
1805
|
for (; m < g; ) {
|
|
1804
|
-
const d = c[m++],
|
|
1806
|
+
const d = c[m++], b = c[m++];
|
|
1805
1807
|
try {
|
|
1806
1808
|
A = d(A);
|
|
1807
1809
|
} catch (p) {
|
|
1808
|
-
|
|
1810
|
+
b.call(this, p);
|
|
1809
1811
|
break;
|
|
1810
1812
|
}
|
|
1811
1813
|
}
|
|
1812
1814
|
try {
|
|
1813
|
-
u =
|
|
1815
|
+
u = ht.call(this, A);
|
|
1814
1816
|
} catch (d) {
|
|
1815
1817
|
return Promise.reject(d);
|
|
1816
1818
|
}
|
|
@@ -1819,14 +1821,14 @@ let Y = class {
|
|
|
1819
1821
|
return u;
|
|
1820
1822
|
}
|
|
1821
1823
|
getUri(t) {
|
|
1822
|
-
t =
|
|
1824
|
+
t = X(this.defaults, t);
|
|
1823
1825
|
const r = vt(t.baseURL, t.url, t.allowAbsoluteUrls);
|
|
1824
1826
|
return jt(r, t.params, t.paramsSerializer);
|
|
1825
1827
|
}
|
|
1826
1828
|
};
|
|
1827
1829
|
a.forEach(["delete", "get", "head", "options"], function(t) {
|
|
1828
1830
|
Y.prototype[t] = function(r, n) {
|
|
1829
|
-
return this.request(
|
|
1831
|
+
return this.request(X(n || {}, {
|
|
1830
1832
|
method: t,
|
|
1831
1833
|
url: r,
|
|
1832
1834
|
data: (n || {}).data
|
|
@@ -1836,7 +1838,7 @@ a.forEach(["delete", "get", "head", "options"], function(t) {
|
|
|
1836
1838
|
a.forEach(["post", "put", "patch"], function(t) {
|
|
1837
1839
|
function r(n) {
|
|
1838
1840
|
return function(i, o, c) {
|
|
1839
|
-
return this.request(
|
|
1841
|
+
return this.request(X(c || {}, {
|
|
1840
1842
|
method: t,
|
|
1841
1843
|
headers: n ? {
|
|
1842
1844
|
"Content-Type": "multipart/form-data"
|
|
@@ -1848,7 +1850,7 @@ a.forEach(["post", "put", "patch"], function(t) {
|
|
|
1848
1850
|
}
|
|
1849
1851
|
Y.prototype[t] = r(), Y.prototype[t + "Form"] = r(!0);
|
|
1850
1852
|
});
|
|
1851
|
-
let
|
|
1853
|
+
let Bn = class Mt {
|
|
1852
1854
|
constructor(t) {
|
|
1853
1855
|
if (typeof t != "function")
|
|
1854
1856
|
throw new TypeError("executor must be a function.");
|
|
@@ -1872,7 +1874,7 @@ let vn = class Mt {
|
|
|
1872
1874
|
n.unsubscribe(i);
|
|
1873
1875
|
}, o;
|
|
1874
1876
|
}, t(function(i, o, c) {
|
|
1875
|
-
n.reason || (n.reason = new
|
|
1877
|
+
n.reason || (n.reason = new oe(i, o, c), r(n.reason));
|
|
1876
1878
|
});
|
|
1877
1879
|
}
|
|
1878
1880
|
/**
|
|
@@ -1921,15 +1923,15 @@ let vn = class Mt {
|
|
|
1921
1923
|
};
|
|
1922
1924
|
}
|
|
1923
1925
|
};
|
|
1924
|
-
function
|
|
1926
|
+
function $n(e) {
|
|
1925
1927
|
return function(r) {
|
|
1926
1928
|
return e.apply(null, r);
|
|
1927
1929
|
};
|
|
1928
1930
|
}
|
|
1929
|
-
function
|
|
1931
|
+
function qn(e) {
|
|
1930
1932
|
return a.isObject(e) && e.isAxiosError === !0;
|
|
1931
1933
|
}
|
|
1932
|
-
const
|
|
1934
|
+
const $e = {
|
|
1933
1935
|
Continue: 100,
|
|
1934
1936
|
SwitchingProtocols: 101,
|
|
1935
1937
|
Processing: 102,
|
|
@@ -2000,79 +2002,72 @@ const Be = {
|
|
|
2000
2002
|
SslHandshakeFailed: 525,
|
|
2001
2003
|
InvalidSslCertificate: 526
|
|
2002
2004
|
};
|
|
2003
|
-
Object.entries(
|
|
2004
|
-
|
|
2005
|
+
Object.entries($e).forEach(([e, t]) => {
|
|
2006
|
+
$e[t] = e;
|
|
2005
2007
|
});
|
|
2006
2008
|
function Ht(e) {
|
|
2007
2009
|
const t = new Y(e), r = gt(Y.prototype.request, t);
|
|
2008
2010
|
return a.extend(r, Y.prototype, t, { allOwnKeys: !0 }), a.extend(r, t, null, { allOwnKeys: !0 }), r.create = function(s) {
|
|
2009
|
-
return Ht(
|
|
2011
|
+
return Ht(X(e, s));
|
|
2010
2012
|
}, r;
|
|
2011
2013
|
}
|
|
2012
|
-
const x = Ht(
|
|
2014
|
+
const x = Ht(me);
|
|
2013
2015
|
x.Axios = Y;
|
|
2014
|
-
x.CanceledError =
|
|
2015
|
-
x.CancelToken =
|
|
2016
|
-
x.isCancel =
|
|
2016
|
+
x.CanceledError = oe;
|
|
2017
|
+
x.CancelToken = Bn;
|
|
2018
|
+
x.isCancel = Ut;
|
|
2017
2019
|
x.VERSION = qt;
|
|
2018
|
-
x.toFormData =
|
|
2020
|
+
x.toFormData = Ce;
|
|
2019
2021
|
x.AxiosError = w;
|
|
2020
2022
|
x.Cancel = x.CanceledError;
|
|
2021
2023
|
x.all = function(t) {
|
|
2022
2024
|
return Promise.all(t);
|
|
2023
2025
|
};
|
|
2024
|
-
x.spread =
|
|
2025
|
-
x.isAxiosError =
|
|
2026
|
-
x.mergeConfig =
|
|
2027
|
-
x.AxiosHeaders =
|
|
2028
|
-
x.formToJSON = (e) =>
|
|
2026
|
+
x.spread = $n;
|
|
2027
|
+
x.isAxiosError = qn;
|
|
2028
|
+
x.mergeConfig = X;
|
|
2029
|
+
x.AxiosHeaders = I;
|
|
2030
|
+
x.formToJSON = (e) => It(a.isHTMLForm(e) ? new FormData(e) : e);
|
|
2029
2031
|
x.getAdapter = $t.getAdapter;
|
|
2030
|
-
x.HttpStatusCode =
|
|
2032
|
+
x.HttpStatusCode = $e;
|
|
2031
2033
|
x.default = x;
|
|
2032
2034
|
const {
|
|
2033
|
-
Axios:
|
|
2034
|
-
AxiosError:
|
|
2035
|
-
CanceledError:
|
|
2036
|
-
isCancel:
|
|
2037
|
-
CancelToken:
|
|
2038
|
-
VERSION:
|
|
2039
|
-
all:
|
|
2040
|
-
Cancel:
|
|
2041
|
-
isAxiosError:
|
|
2042
|
-
spread:
|
|
2043
|
-
toFormData:
|
|
2044
|
-
AxiosHeaders:
|
|
2045
|
-
HttpStatusCode:
|
|
2046
|
-
formToJSON:
|
|
2047
|
-
getAdapter:
|
|
2048
|
-
mergeConfig:
|
|
2049
|
-
} = x
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
localStorage.setItem("isLoggedIn", "true"), r(!0);
|
|
2054
|
-
}, s = () => {
|
|
2055
|
-
localStorage.removeItem("isLoggedIn"), le(null), r(!1);
|
|
2056
|
-
};
|
|
2057
|
-
return /* @__PURE__ */ y.jsx(zt.Provider, { value: { isAuthenticated: t, login: n, logout: s }, children: e });
|
|
2058
|
-
}, We = () => {
|
|
2059
|
-
const e = Yt(zt);
|
|
2060
|
-
if (!e)
|
|
2061
|
-
throw new Error("useAuth must be used inside AuthProvider");
|
|
2062
|
-
return e;
|
|
2063
|
-
};
|
|
2064
|
-
let $e = "";
|
|
2065
|
-
function ls(e) {
|
|
2066
|
-
$e = e.apiBaseUrl;
|
|
2035
|
+
Axios: Kn,
|
|
2036
|
+
AxiosError: Xn,
|
|
2037
|
+
CanceledError: Zn,
|
|
2038
|
+
isCancel: Qn,
|
|
2039
|
+
CancelToken: es,
|
|
2040
|
+
VERSION: ts,
|
|
2041
|
+
all: rs,
|
|
2042
|
+
Cancel: ns,
|
|
2043
|
+
isAxiosError: ss,
|
|
2044
|
+
spread: os,
|
|
2045
|
+
toFormData: is,
|
|
2046
|
+
AxiosHeaders: as,
|
|
2047
|
+
HttpStatusCode: cs,
|
|
2048
|
+
formToJSON: ls,
|
|
2049
|
+
getAdapter: us,
|
|
2050
|
+
mergeConfig: fs
|
|
2051
|
+
} = x;
|
|
2052
|
+
let qe = "";
|
|
2053
|
+
function ds(e) {
|
|
2054
|
+
qe = e.apiBaseUrl;
|
|
2067
2055
|
}
|
|
2068
|
-
function
|
|
2069
|
-
if (
|
|
2056
|
+
function re() {
|
|
2057
|
+
if (!qe)
|
|
2070
2058
|
throw new Error("Auth not initialized. Call initAuth() in consumer app.");
|
|
2071
|
-
return
|
|
2059
|
+
return qe;
|
|
2060
|
+
}
|
|
2061
|
+
let ne = null;
|
|
2062
|
+
function Mn(e) {
|
|
2063
|
+
ne = e;
|
|
2064
|
+
}
|
|
2065
|
+
function Hn() {
|
|
2066
|
+
ne = null;
|
|
2072
2067
|
}
|
|
2073
|
-
async function
|
|
2068
|
+
async function zt() {
|
|
2074
2069
|
const e = await x.post(
|
|
2075
|
-
`${
|
|
2070
|
+
`${re()}${K.refreshToken}`,
|
|
2076
2071
|
{},
|
|
2077
2072
|
{ withCredentials: !0 }
|
|
2078
2073
|
), t = e?.data?.accessToken || e?.data?.data?.accessToken;
|
|
@@ -2081,26 +2076,27 @@ async function Gt() {
|
|
|
2081
2076
|
return t;
|
|
2082
2077
|
}
|
|
2083
2078
|
const J = x.create({
|
|
2079
|
+
baseURL: re(),
|
|
2084
2080
|
withCredentials: !0
|
|
2085
2081
|
});
|
|
2086
|
-
let
|
|
2087
|
-
const
|
|
2088
|
-
|
|
2082
|
+
let Se = !1, Me = [];
|
|
2083
|
+
const mt = (e, t = null) => {
|
|
2084
|
+
Me.forEach((r) => {
|
|
2089
2085
|
e ? r.reject(e) : r.resolve(t);
|
|
2090
|
-
}),
|
|
2086
|
+
}), Me = [];
|
|
2091
2087
|
};
|
|
2092
2088
|
J.interceptors.request.use(
|
|
2093
2089
|
async (e) => {
|
|
2094
|
-
if (e.withCredentials = !0, e.url?.includes(
|
|
2090
|
+
if (e.withCredentials = !0, e.url?.includes(K.login) || e.url?.includes(K.register))
|
|
2095
2091
|
return e.headers && "Authorization" in e.headers && delete e.headers.Authorization, e;
|
|
2096
|
-
const r =
|
|
2092
|
+
const r = fr();
|
|
2097
2093
|
if (r)
|
|
2098
2094
|
return e.headers && (e.headers.Authorization = `Bearer ${r}`), e;
|
|
2099
2095
|
try {
|
|
2100
|
-
const n = await
|
|
2101
|
-
return
|
|
2096
|
+
const n = await zt();
|
|
2097
|
+
return ee(n), e.headers && (e.headers.Authorization = `Bearer ${n}`), e;
|
|
2102
2098
|
} catch (n) {
|
|
2103
|
-
throw window.location.href = "/", sessionStorage.setItem(
|
|
2099
|
+
throw window.location.href = "/", sessionStorage.setItem(Te, ze), ee(null), localStorage.removeItem("isLoggedIn"), ne && ne(), n;
|
|
2104
2100
|
}
|
|
2105
2101
|
},
|
|
2106
2102
|
(e) => Promise.reject(e)
|
|
@@ -2110,32 +2106,32 @@ J.interceptors.response.use(
|
|
|
2110
2106
|
async (e) => {
|
|
2111
2107
|
const t = e.config;
|
|
2112
2108
|
if (e.response?.status === 401 && !t._retry) {
|
|
2113
|
-
if (
|
|
2109
|
+
if (Se)
|
|
2114
2110
|
return new Promise((r, n) => {
|
|
2115
|
-
|
|
2111
|
+
Me.push({ resolve: r, reject: n });
|
|
2116
2112
|
}).then((r) => (t.headers && (t.headers.Authorization = `Bearer ${r}`), J(t))).catch((r) => Promise.reject(r));
|
|
2117
|
-
t._retry = !0,
|
|
2113
|
+
t._retry = !0, Se = !0;
|
|
2118
2114
|
try {
|
|
2119
|
-
const r = await
|
|
2120
|
-
return
|
|
2115
|
+
const r = await zt();
|
|
2116
|
+
return ee(r), t.headers && (t.headers.Authorization = `Bearer ${r}`), mt(null, r), Se = !1, J(t);
|
|
2121
2117
|
} catch (r) {
|
|
2122
|
-
return window.location.href = "/", sessionStorage.setItem(
|
|
2118
|
+
return window.location.href = "/", sessionStorage.setItem(Te, ze), mt(r, null), Se = !1, ne && ne(), Promise.reject(r);
|
|
2123
2119
|
}
|
|
2124
2120
|
}
|
|
2125
2121
|
return Promise.reject(e);
|
|
2126
2122
|
}
|
|
2127
2123
|
);
|
|
2128
|
-
const
|
|
2124
|
+
const Gt = {
|
|
2129
2125
|
MIN_LENGTH: 8,
|
|
2130
2126
|
REGEX: /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&#])[A-Za-z\d@$!%*?&#]{8,}$/,
|
|
2131
2127
|
ERROR_MESSAGE: "Password must be at least 8 characters long and include uppercase, lowercase, number, and special character."
|
|
2132
|
-
},
|
|
2128
|
+
}, zn = (e) => Gt.REGEX.test(e), hs = ({ onLoginSuccess: e }) => {
|
|
2133
2129
|
const [t, r] = M(P.LOGIN), [n, s] = M({
|
|
2134
2130
|
email: "",
|
|
2135
2131
|
password: ""
|
|
2136
2132
|
}), i = Et(), [o, c] = M(!1), [h, f] = M(""), [u, m] = M("");
|
|
2137
|
-
|
|
2138
|
-
typeof window < "u" && sessionStorage.getItem(
|
|
2133
|
+
He(() => {
|
|
2134
|
+
typeof window < "u" && sessionStorage.getItem(Te) === ze && (sessionStorage.removeItem(Te), f(sr), r(P.LOGIN));
|
|
2139
2135
|
}, []);
|
|
2140
2136
|
const g = (p) => {
|
|
2141
2137
|
const { name: S, value: N } = p.target;
|
|
@@ -2144,24 +2140,24 @@ const Jt = {
|
|
|
2144
2140
|
p.preventDefault(), c(!0), f(""), m("");
|
|
2145
2141
|
try {
|
|
2146
2142
|
if (t === P.SIGNUP) {
|
|
2147
|
-
if (
|
|
2148
|
-
f(
|
|
2143
|
+
if (!zn(n.password)) {
|
|
2144
|
+
f(Gt.ERROR_MESSAGE);
|
|
2149
2145
|
return;
|
|
2150
2146
|
}
|
|
2151
|
-
await J.post(`${
|
|
2147
|
+
await J.post(`${re()}${K.register}`, n), m(er), r(P.LOGIN), s({ email: n.email, password: "" });
|
|
2152
2148
|
return;
|
|
2153
2149
|
}
|
|
2154
|
-
const S = await J.post(`${
|
|
2155
|
-
|
|
2150
|
+
const S = await J.post(`${re()}${K.login}`, n), { accessToken: N } = S.data;
|
|
2151
|
+
ee(N), localStorage.setItem("isLoggedIn", "true"), m(nr), e && e(), i("/profile");
|
|
2156
2152
|
} catch (S) {
|
|
2157
|
-
const N = S?.response?.data?.message || (t === P.SIGNUP ?
|
|
2153
|
+
const N = S?.response?.data?.message || (t === P.SIGNUP ? tr : rr);
|
|
2158
2154
|
f(N);
|
|
2159
2155
|
} finally {
|
|
2160
2156
|
c(!1);
|
|
2161
2157
|
}
|
|
2162
2158
|
}, d = () => {
|
|
2163
2159
|
r(P.SIGNUP), f(""), m("");
|
|
2164
|
-
},
|
|
2160
|
+
}, b = () => {
|
|
2165
2161
|
r(P.LOGIN), f(""), m("");
|
|
2166
2162
|
};
|
|
2167
2163
|
return /* @__PURE__ */ y.jsx("div", { className: "auth-container", children: /* @__PURE__ */ y.jsxs("div", { className: "auth-card", children: [
|
|
@@ -2170,7 +2166,7 @@ const Jt = {
|
|
|
2170
2166
|
"button",
|
|
2171
2167
|
{
|
|
2172
2168
|
className: t === P.LOGIN ? "active" : "",
|
|
2173
|
-
onClick:
|
|
2169
|
+
onClick: b,
|
|
2174
2170
|
children: P.LOGIN
|
|
2175
2171
|
}
|
|
2176
2172
|
),
|
|
@@ -2186,7 +2182,7 @@ const Jt = {
|
|
|
2186
2182
|
/* @__PURE__ */ y.jsxs("form", { onSubmit: A, children: [
|
|
2187
2183
|
t === P.LOGIN ? /* @__PURE__ */ y.jsx("h2", { children: P.LOGIN }) : /* @__PURE__ */ y.jsx("h2", { children: P.SIGNUP }),
|
|
2188
2184
|
/* @__PURE__ */ y.jsxs("div", { className: "form-group", children: [
|
|
2189
|
-
/* @__PURE__ */ y.jsx("label", { htmlFor: "email", children:
|
|
2185
|
+
/* @__PURE__ */ y.jsx("label", { htmlFor: "email", children: yt }),
|
|
2190
2186
|
/* @__PURE__ */ y.jsx(
|
|
2191
2187
|
"input",
|
|
2192
2188
|
{
|
|
@@ -2201,7 +2197,7 @@ const Jt = {
|
|
|
2201
2197
|
)
|
|
2202
2198
|
] }),
|
|
2203
2199
|
/* @__PURE__ */ y.jsxs("div", { className: "form-group", children: [
|
|
2204
|
-
/* @__PURE__ */ y.jsx("label", { htmlFor: "password", children:
|
|
2200
|
+
/* @__PURE__ */ y.jsx("label", { htmlFor: "password", children: ar }),
|
|
2205
2201
|
/* @__PURE__ */ y.jsx(
|
|
2206
2202
|
"input",
|
|
2207
2203
|
{
|
|
@@ -2217,20 +2213,20 @@ const Jt = {
|
|
|
2217
2213
|
] }),
|
|
2218
2214
|
h && /* @__PURE__ */ y.jsx("div", { className: "error-message", children: h }),
|
|
2219
2215
|
u && /* @__PURE__ */ y.jsx("div", { className: "success-message", children: u }),
|
|
2220
|
-
/* @__PURE__ */ y.jsx("button", { type: "submit", className: "submit-btn", disabled: o, children: o ? t === P.LOGIN ?
|
|
2216
|
+
/* @__PURE__ */ y.jsx("button", { type: "submit", className: "submit-btn", disabled: o, children: o ? t === P.LOGIN ? or : ir : t === P.LOGIN ? P.LOGIN : P.SIGNUP })
|
|
2221
2217
|
] })
|
|
2222
2218
|
] }) });
|
|
2223
|
-
},
|
|
2224
|
-
const [t, r] =
|
|
2225
|
-
J.post(`${
|
|
2219
|
+
}, ps = ({ onLogout: e }) => {
|
|
2220
|
+
const [t, r] = bt.useState(null), [n, s] = M(!1), [i, o] = M(""), [c, h] = M(""), f = Et(), u = () => {
|
|
2221
|
+
J.post(`${re()}${K.logout}`).catch((m) => {
|
|
2226
2222
|
console.error("Logout failed:", m);
|
|
2227
2223
|
}), r(null), e(), f("/");
|
|
2228
2224
|
};
|
|
2229
|
-
return
|
|
2225
|
+
return He(() => {
|
|
2230
2226
|
(async () => {
|
|
2231
2227
|
s(!0), o("");
|
|
2232
2228
|
try {
|
|
2233
|
-
const g = await J.get(`${
|
|
2229
|
+
const g = await J.get(`${re()}${K.userDetails}`);
|
|
2234
2230
|
r(g.data.data), h("User details fetched successfully");
|
|
2235
2231
|
} catch (g) {
|
|
2236
2232
|
o(g.response?.data?.message || "Failed to fetch user details");
|
|
@@ -2244,14 +2240,14 @@ const Jt = {
|
|
|
2244
2240
|
/* @__PURE__ */ y.jsxs("div", { className: "user-details", children: [
|
|
2245
2241
|
/* @__PURE__ */ y.jsxs("div", { className: "detail-row", children: [
|
|
2246
2242
|
/* @__PURE__ */ y.jsxs("span", { className: "label", children: [
|
|
2247
|
-
|
|
2243
|
+
cr,
|
|
2248
2244
|
":"
|
|
2249
2245
|
] }),
|
|
2250
2246
|
/* @__PURE__ */ y.jsx("span", { className: "value", children: t?.userId })
|
|
2251
2247
|
] }),
|
|
2252
2248
|
/* @__PURE__ */ y.jsxs("div", { className: "detail-row", children: [
|
|
2253
2249
|
/* @__PURE__ */ y.jsxs("span", { className: "label", children: [
|
|
2254
|
-
|
|
2250
|
+
yt,
|
|
2255
2251
|
":"
|
|
2256
2252
|
] }),
|
|
2257
2253
|
/* @__PURE__ */ y.jsx("span", { className: "value", children: t?.emailId })
|
|
@@ -2259,47 +2255,68 @@ const Jt = {
|
|
|
2259
2255
|
] }),
|
|
2260
2256
|
i && /* @__PURE__ */ y.jsx("div", { className: "error-message", children: i }),
|
|
2261
2257
|
c && /* @__PURE__ */ y.jsx("div", { className: "success-message", children: c }),
|
|
2262
|
-
/* @__PURE__ */ y.jsx("button", { className: "logout-btn", onClick: u, children:
|
|
2258
|
+
/* @__PURE__ */ y.jsx("button", { className: "logout-btn", onClick: u, children: lr })
|
|
2263
2259
|
] }) });
|
|
2264
|
-
},
|
|
2260
|
+
}, Jt = Yt(null), ms = ({ children: e }) => {
|
|
2261
|
+
const [t, r] = M(
|
|
2262
|
+
localStorage.getItem("isLoggedIn") === "true"
|
|
2263
|
+
), n = (i) => {
|
|
2264
|
+
localStorage.setItem("isLoggedIn", "true"), ee(i), r(!0);
|
|
2265
|
+
}, s = () => {
|
|
2266
|
+
localStorage.removeItem("isLoggedIn"), ur(), ee(null), r(!1);
|
|
2267
|
+
};
|
|
2268
|
+
return He(() => (Mn(s), () => {
|
|
2269
|
+
Hn();
|
|
2270
|
+
}), []), /* @__PURE__ */ y.jsx(Jt.Provider, { value: { isAuthenticated: t, login: n, logout: s }, children: e });
|
|
2271
|
+
}, Wt = () => {
|
|
2272
|
+
const e = Kt(Jt);
|
|
2273
|
+
if (!e)
|
|
2274
|
+
throw new Error("useAuth must be used inside AuthProvider");
|
|
2275
|
+
return e;
|
|
2276
|
+
}, bs = ({
|
|
2265
2277
|
children: e,
|
|
2266
2278
|
redirectTo: t = "/"
|
|
2267
2279
|
}) => {
|
|
2268
|
-
const { isAuthenticated: r } =
|
|
2269
|
-
return r ? /* @__PURE__ */ y.jsx(y.Fragment, { children: e }) : /* @__PURE__ */ y.jsx(
|
|
2270
|
-
},
|
|
2280
|
+
const { isAuthenticated: r } = Wt();
|
|
2281
|
+
return r ? /* @__PURE__ */ y.jsx(y.Fragment, { children: e }) : /* @__PURE__ */ y.jsx(wt, { to: t, replace: !0 });
|
|
2282
|
+
}, Es = ({
|
|
2271
2283
|
children: e,
|
|
2272
2284
|
redirectTo: t = "/profile"
|
|
2273
2285
|
}) => {
|
|
2274
|
-
const { isAuthenticated: r } =
|
|
2275
|
-
return r ? /* @__PURE__ */ y.jsx(
|
|
2286
|
+
const { isAuthenticated: r } = Wt();
|
|
2287
|
+
return r ? /* @__PURE__ */ y.jsx(wt, { to: t, replace: !0 }) : /* @__PURE__ */ y.jsx(y.Fragment, { children: e });
|
|
2276
2288
|
};
|
|
2277
2289
|
export {
|
|
2278
|
-
|
|
2290
|
+
hs as AuthForm,
|
|
2279
2291
|
P as AuthMode,
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2292
|
+
ms as AuthProvider,
|
|
2293
|
+
yt as EMAIL_LABEL,
|
|
2294
|
+
rr as LOGIN_FAILED,
|
|
2295
|
+
nr as LOGIN_SUCCESS,
|
|
2296
|
+
lr as LOGOUT_BUTTON,
|
|
2297
|
+
Wn as LOGOUT_SUCCESS,
|
|
2298
|
+
ar as PASSWORD_LABEL,
|
|
2299
|
+
Gt as PASSWORD_VALIDATION,
|
|
2300
|
+
bs as ProtectedRoute,
|
|
2301
|
+
Es as PublicRoute,
|
|
2302
|
+
tr as REGISTRATION_FAILED,
|
|
2303
|
+
er as REGISTRATION_SUCCESS,
|
|
2304
|
+
sr as SESSION_EXPIRED,
|
|
2305
|
+
or as SIGNING_IN,
|
|
2306
|
+
ir as SIGNING_UP,
|
|
2307
|
+
cr as USER_ID,
|
|
2308
|
+
ps as UserProfile,
|
|
2297
2309
|
J as axiosInstance,
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2310
|
+
ur as clearAccessToken,
|
|
2311
|
+
Hn as clearLogoutCallback,
|
|
2312
|
+
K as endPoints,
|
|
2313
|
+
fr as getAccessToken,
|
|
2314
|
+
re as getApiBaseUrl,
|
|
2315
|
+
ds as initAuth,
|
|
2316
|
+
Te as sessionExpired,
|
|
2317
|
+
ze as sessionExpiredValue,
|
|
2318
|
+
ee as setAccessToken,
|
|
2319
|
+
Mn as setLogoutCallback,
|
|
2320
|
+
Wt as useAuth,
|
|
2321
|
+
zn as validatePassword
|
|
2305
2322
|
};
|