authifyer-sdk 1.0.3 → 1.0.4
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/authifyer-sdk.es.js +491 -437
- package/dist/authifyer-sdk.umd.js +8 -8
- package/package.json +1 -1
- package/src/core/client.ts +15 -1
- package/src/react/components/SignUp.tsx +68 -3
package/dist/authifyer-sdk.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var Bt = Object.defineProperty;
|
|
2
2
|
var Dt = (t, e, r) => e in t ? Bt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
-
var
|
|
4
|
-
import qt, { createContext as Mt, useMemo as Ht, useState as
|
|
3
|
+
var K = (t, e, r) => Dt(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
import qt, { createContext as Mt, useMemo as Ht, useState as v, useEffect as $t, useContext as zt } from "react";
|
|
5
5
|
var be = { exports: {} }, se = {};
|
|
6
6
|
/**
|
|
7
7
|
* @license React
|
|
@@ -45,7 +45,7 @@ var oe = {};
|
|
|
45
45
|
* LICENSE file in the root directory of this source tree.
|
|
46
46
|
*/
|
|
47
47
|
var Ye;
|
|
48
|
-
function
|
|
48
|
+
function Vt() {
|
|
49
49
|
return Ye || (Ye = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
50
50
|
function t(l) {
|
|
51
51
|
if (l == null) return null;
|
|
@@ -59,9 +59,9 @@ function Jt() {
|
|
|
59
59
|
return "Profiler";
|
|
60
60
|
case S:
|
|
61
61
|
return "StrictMode";
|
|
62
|
-
case
|
|
62
|
+
case q:
|
|
63
63
|
return "Suspense";
|
|
64
|
-
case
|
|
64
|
+
case k:
|
|
65
65
|
return "SuspenseList";
|
|
66
66
|
case pe:
|
|
67
67
|
return "Activity";
|
|
@@ -70,18 +70,18 @@ function Jt() {
|
|
|
70
70
|
switch (typeof l.tag == "number" && console.error(
|
|
71
71
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
72
72
|
), l.$$typeof) {
|
|
73
|
-
case
|
|
73
|
+
case b:
|
|
74
74
|
return "Portal";
|
|
75
|
-
case
|
|
75
|
+
case N:
|
|
76
76
|
return l.displayName || "Context";
|
|
77
|
-
case
|
|
77
|
+
case x:
|
|
78
78
|
return (l._context.displayName || "Context") + ".Consumer";
|
|
79
|
-
case
|
|
79
|
+
case _:
|
|
80
80
|
var E = l.render;
|
|
81
81
|
return l = l.displayName, l || (l = E.displayName || E.name || "", l = l !== "" ? "ForwardRef(" + l + ")" : "ForwardRef"), l;
|
|
82
|
-
case
|
|
82
|
+
case U:
|
|
83
83
|
return E = l.displayName || null, E !== null ? E : t(l.type) || "Memo";
|
|
84
|
-
case
|
|
84
|
+
case I:
|
|
85
85
|
E = l._payload, l = l._init;
|
|
86
86
|
try {
|
|
87
87
|
return t(l(E));
|
|
@@ -112,7 +112,7 @@ function Jt() {
|
|
|
112
112
|
}
|
|
113
113
|
function n(l) {
|
|
114
114
|
if (l === h) return "<>";
|
|
115
|
-
if (typeof l == "object" && l !== null && l.$$typeof ===
|
|
115
|
+
if (typeof l == "object" && l !== null && l.$$typeof === I)
|
|
116
116
|
return "<...>";
|
|
117
117
|
try {
|
|
118
118
|
var E = t(l);
|
|
@@ -122,14 +122,14 @@ function Jt() {
|
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
function s() {
|
|
125
|
-
var l =
|
|
125
|
+
var l = W.A;
|
|
126
126
|
return l === null ? null : l.getOwner();
|
|
127
127
|
}
|
|
128
128
|
function o() {
|
|
129
129
|
return Error("react-stack-top-frame");
|
|
130
130
|
}
|
|
131
131
|
function i(l) {
|
|
132
|
-
if (
|
|
132
|
+
if (V.call(l, "key")) {
|
|
133
133
|
var E = Object.getOwnPropertyDescriptor(l, "key").get;
|
|
134
134
|
if (E && E.isReactWarning) return !1;
|
|
135
135
|
}
|
|
@@ -137,7 +137,7 @@ function Jt() {
|
|
|
137
137
|
}
|
|
138
138
|
function c(l, E) {
|
|
139
139
|
function T() {
|
|
140
|
-
|
|
140
|
+
P || (P = !0, console.error(
|
|
141
141
|
"%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)",
|
|
142
142
|
E
|
|
143
143
|
));
|
|
@@ -153,15 +153,15 @@ function Jt() {
|
|
|
153
153
|
"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."
|
|
154
154
|
)), l = this.props.ref, l !== void 0 ? l : null;
|
|
155
155
|
}
|
|
156
|
-
function d(l, E, T, A, J,
|
|
157
|
-
var
|
|
156
|
+
function d(l, E, T, A, J, Ce) {
|
|
157
|
+
var C = T.ref;
|
|
158
158
|
return l = {
|
|
159
159
|
$$typeof: f,
|
|
160
160
|
type: l,
|
|
161
161
|
key: E,
|
|
162
162
|
props: T,
|
|
163
163
|
_owner: A
|
|
164
|
-
}, (
|
|
164
|
+
}, (C !== void 0 ? C : null) !== null ? Object.defineProperty(l, "ref", {
|
|
165
165
|
enumerable: !1,
|
|
166
166
|
get: p
|
|
167
167
|
}) : Object.defineProperty(l, "ref", { enumerable: !1, value: null }), l._store = {}, Object.defineProperty(l._store, "validated", {
|
|
@@ -183,28 +183,28 @@ function Jt() {
|
|
|
183
183
|
configurable: !1,
|
|
184
184
|
enumerable: !1,
|
|
185
185
|
writable: !0,
|
|
186
|
-
value:
|
|
186
|
+
value: Ce
|
|
187
187
|
}), Object.freeze && (Object.freeze(l.props), Object.freeze(l)), l;
|
|
188
188
|
}
|
|
189
|
-
function u(l, E, T, A, J,
|
|
190
|
-
var
|
|
191
|
-
if (
|
|
189
|
+
function u(l, E, T, A, J, Ce) {
|
|
190
|
+
var C = E.children;
|
|
191
|
+
if (C !== void 0)
|
|
192
192
|
if (A)
|
|
193
|
-
if (
|
|
194
|
-
for (A = 0; A <
|
|
195
|
-
|
|
196
|
-
Object.freeze && Object.freeze(
|
|
193
|
+
if (z(C)) {
|
|
194
|
+
for (A = 0; A < C.length; A++)
|
|
195
|
+
y(C[A]);
|
|
196
|
+
Object.freeze && Object.freeze(C);
|
|
197
197
|
} else
|
|
198
198
|
console.error(
|
|
199
199
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
200
200
|
);
|
|
201
|
-
else
|
|
202
|
-
if (
|
|
203
|
-
|
|
204
|
-
var
|
|
201
|
+
else y(C);
|
|
202
|
+
if (V.call(E, "key")) {
|
|
203
|
+
C = t(l);
|
|
204
|
+
var Z = Object.keys(E).filter(function(Ft) {
|
|
205
205
|
return Ft !== "key";
|
|
206
206
|
});
|
|
207
|
-
A = 0 <
|
|
207
|
+
A = 0 < Z.length ? "{key: someKey, " + Z.join(": ..., ") + ": ...}" : "{key: someKey}", ye[C + A] || (Z = 0 < Z.length ? "{" + Z.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
208
208
|
`A props object containing a "key" prop is being spread into JSX:
|
|
209
209
|
let props = %s;
|
|
210
210
|
<%s {...props} />
|
|
@@ -212,35 +212,35 @@ React keys must be passed directly to JSX without using spread:
|
|
|
212
212
|
let props = %s;
|
|
213
213
|
<%s key={someKey} {...props} />`,
|
|
214
214
|
A,
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
), ye[
|
|
215
|
+
C,
|
|
216
|
+
Z,
|
|
217
|
+
C
|
|
218
|
+
), ye[C + A] = !0);
|
|
219
219
|
}
|
|
220
|
-
if (
|
|
220
|
+
if (C = null, T !== void 0 && (r(T), C = "" + T), i(E) && (r(E.key), C = "" + E.key), "key" in E) {
|
|
221
221
|
T = {};
|
|
222
|
-
for (var
|
|
223
|
-
|
|
222
|
+
for (var je in E)
|
|
223
|
+
je !== "key" && (T[je] = E[je]);
|
|
224
224
|
} else T = E;
|
|
225
|
-
return
|
|
225
|
+
return C && c(
|
|
226
226
|
T,
|
|
227
227
|
typeof l == "function" ? l.displayName || l.name || "Unknown" : l
|
|
228
228
|
), d(
|
|
229
229
|
l,
|
|
230
|
-
|
|
230
|
+
C,
|
|
231
231
|
T,
|
|
232
232
|
s(),
|
|
233
233
|
J,
|
|
234
|
-
|
|
234
|
+
Ce
|
|
235
235
|
);
|
|
236
236
|
}
|
|
237
|
-
function
|
|
238
|
-
w(l) ? l._store && (l._store.validated = 1) : typeof l == "object" && l !== null && l.$$typeof ===
|
|
237
|
+
function y(l) {
|
|
238
|
+
w(l) ? l._store && (l._store.validated = 1) : typeof l == "object" && l !== null && l.$$typeof === I && (l._payload.status === "fulfilled" ? w(l._payload.value) && l._payload.value._store && (l._payload.value._store.validated = 1) : l._store && (l._store.validated = 1));
|
|
239
239
|
}
|
|
240
240
|
function w(l) {
|
|
241
241
|
return typeof l == "object" && l !== null && l.$$typeof === f;
|
|
242
242
|
}
|
|
243
|
-
var R = qt, f = Symbol.for("react.transitional.element"),
|
|
243
|
+
var R = qt, f = Symbol.for("react.transitional.element"), b = Symbol.for("react.portal"), h = Symbol.for("react.fragment"), S = Symbol.for("react.strict_mode"), j = Symbol.for("react.profiler"), x = Symbol.for("react.consumer"), N = Symbol.for("react.context"), _ = Symbol.for("react.forward_ref"), q = Symbol.for("react.suspense"), k = Symbol.for("react.suspense_list"), U = Symbol.for("react.memo"), I = Symbol.for("react.lazy"), pe = Symbol.for("react.activity"), me = Symbol.for("react.client.reference"), W = R.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, V = Object.prototype.hasOwnProperty, z = Array.isArray, Q = console.createTask ? console.createTask : function() {
|
|
244
244
|
return null;
|
|
245
245
|
};
|
|
246
246
|
R = {
|
|
@@ -248,60 +248,60 @@ React keys must be passed directly to JSX without using spread:
|
|
|
248
248
|
return l();
|
|
249
249
|
}
|
|
250
250
|
};
|
|
251
|
-
var
|
|
251
|
+
var P, re = {}, M = R.react_stack_bottom_frame.bind(
|
|
252
252
|
R,
|
|
253
253
|
o
|
|
254
|
-
)(), ne =
|
|
254
|
+
)(), ne = Q(n(o)), ye = {};
|
|
255
255
|
oe.Fragment = h, oe.jsx = function(l, E, T) {
|
|
256
|
-
var A = 1e4 >
|
|
256
|
+
var A = 1e4 > W.recentlyCreatedOwnerStacks++;
|
|
257
257
|
return u(
|
|
258
258
|
l,
|
|
259
259
|
E,
|
|
260
260
|
T,
|
|
261
261
|
!1,
|
|
262
|
-
A ? Error("react-stack-top-frame") :
|
|
263
|
-
A ?
|
|
262
|
+
A ? Error("react-stack-top-frame") : M,
|
|
263
|
+
A ? Q(n(l)) : ne
|
|
264
264
|
);
|
|
265
265
|
}, oe.jsxs = function(l, E, T) {
|
|
266
|
-
var A = 1e4 >
|
|
266
|
+
var A = 1e4 > W.recentlyCreatedOwnerStacks++;
|
|
267
267
|
return u(
|
|
268
268
|
l,
|
|
269
269
|
E,
|
|
270
270
|
T,
|
|
271
271
|
!0,
|
|
272
|
-
A ? Error("react-stack-top-frame") :
|
|
273
|
-
A ?
|
|
272
|
+
A ? Error("react-stack-top-frame") : M,
|
|
273
|
+
A ? Q(n(l)) : ne
|
|
274
274
|
);
|
|
275
275
|
};
|
|
276
276
|
})()), oe;
|
|
277
277
|
}
|
|
278
278
|
var Xe;
|
|
279
|
-
function
|
|
280
|
-
return Xe || (Xe = 1, process.env.NODE_ENV === "production" ? be.exports = Wt() : be.exports =
|
|
279
|
+
function Jt() {
|
|
280
|
+
return Xe || (Xe = 1, process.env.NODE_ENV === "production" ? be.exports = Wt() : be.exports = Vt()), be.exports;
|
|
281
281
|
}
|
|
282
|
-
var
|
|
282
|
+
var m = Jt();
|
|
283
283
|
function pt(t, e) {
|
|
284
284
|
return function() {
|
|
285
285
|
return t.apply(e, arguments);
|
|
286
286
|
};
|
|
287
287
|
}
|
|
288
|
-
const { toString: Kt } = Object.prototype, { getPrototypeOf: $e } = Object, { iterator:
|
|
288
|
+
const { toString: Kt } = Object.prototype, { getPrototypeOf: $e } = Object, { iterator: Ae, toStringTag: mt } = Symbol, xe = /* @__PURE__ */ ((t) => (e) => {
|
|
289
289
|
const r = Kt.call(e);
|
|
290
290
|
return t[r] || (t[r] = r.slice(8, -1).toLowerCase());
|
|
291
|
-
})(/* @__PURE__ */ Object.create(null)),
|
|
291
|
+
})(/* @__PURE__ */ Object.create(null)), $ = (t) => (t = t.toLowerCase(), (e) => xe(e) === t), Oe = (t) => (e) => typeof e === t, { isArray: te } = Array, ee = Oe("undefined");
|
|
292
292
|
function ce(t) {
|
|
293
|
-
return t !== null && !
|
|
293
|
+
return t !== null && !ee(t) && t.constructor !== null && !ee(t.constructor) && F(t.constructor.isBuffer) && t.constructor.isBuffer(t);
|
|
294
294
|
}
|
|
295
|
-
const yt =
|
|
295
|
+
const yt = $("ArrayBuffer");
|
|
296
296
|
function Yt(t) {
|
|
297
297
|
let e;
|
|
298
298
|
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? e = ArrayBuffer.isView(t) : e = t && t.buffer && yt(t.buffer), e;
|
|
299
299
|
}
|
|
300
|
-
const Xt =
|
|
301
|
-
if (
|
|
300
|
+
const Xt = Oe("string"), F = Oe("function"), bt = Oe("number"), le = (t) => t !== null && typeof t == "object", Gt = (t) => t === !0 || t === !1, Ee = (t) => {
|
|
301
|
+
if (xe(t) !== "object")
|
|
302
302
|
return !1;
|
|
303
303
|
const e = $e(t);
|
|
304
|
-
return (e === null || e === Object.prototype || Object.getPrototypeOf(e) === null) && !(mt in t) && !(
|
|
304
|
+
return (e === null || e === Object.prototype || Object.getPrototypeOf(e) === null) && !(mt in t) && !(Ae in t);
|
|
305
305
|
}, Qt = (t) => {
|
|
306
306
|
if (!le(t) || ce(t))
|
|
307
307
|
return !1;
|
|
@@ -310,21 +310,21 @@ const Xt = xe("string"), k = xe("function"), bt = xe("number"), le = (t) => t !=
|
|
|
310
310
|
} catch {
|
|
311
311
|
return !1;
|
|
312
312
|
}
|
|
313
|
-
}, Zt =
|
|
313
|
+
}, Zt = $("Date"), er = $("File"), tr = $("Blob"), rr = $("FileList"), nr = (t) => le(t) && F(t.pipe), sr = (t) => {
|
|
314
314
|
let e;
|
|
315
|
-
return t && (typeof FormData == "function" && t instanceof FormData ||
|
|
316
|
-
e === "object" &&
|
|
317
|
-
}, or =
|
|
315
|
+
return t && (typeof FormData == "function" && t instanceof FormData || F(t.append) && ((e = xe(t)) === "formdata" || // detect form-data instance
|
|
316
|
+
e === "object" && F(t.toString) && t.toString() === "[object FormData]"));
|
|
317
|
+
}, or = $("URLSearchParams"), [ir, ar, cr, lr] = [
|
|
318
318
|
"ReadableStream",
|
|
319
319
|
"Request",
|
|
320
320
|
"Response",
|
|
321
321
|
"Headers"
|
|
322
|
-
].map(
|
|
322
|
+
].map($), ur = (t) => t.trim ? t.trim() : t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
323
323
|
function ue(t, e, { allOwnKeys: r = !1 } = {}) {
|
|
324
324
|
if (t === null || typeof t > "u")
|
|
325
325
|
return;
|
|
326
326
|
let n, s;
|
|
327
|
-
if (typeof t != "object" && (t = [t]),
|
|
327
|
+
if (typeof t != "object" && (t = [t]), te(t))
|
|
328
328
|
for (n = 0, s = t.length; n < s; n++)
|
|
329
329
|
e.call(null, t[n], n, t);
|
|
330
330
|
else {
|
|
@@ -347,13 +347,13 @@ function gt(t, e) {
|
|
|
347
347
|
return s;
|
|
348
348
|
return null;
|
|
349
349
|
}
|
|
350
|
-
const
|
|
351
|
-
function
|
|
350
|
+
const Y = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, Et = (t) => !ee(t) && t !== Y;
|
|
351
|
+
function Fe() {
|
|
352
352
|
const { caseless: t, skipUndefined: e } = Et(this) && this || {}, r = {}, n = (s, o) => {
|
|
353
353
|
if (o === "__proto__" || o === "constructor" || o === "prototype")
|
|
354
354
|
return;
|
|
355
355
|
const i = t && gt(r, o) || o;
|
|
356
|
-
Ee(r[i]) && Ee(s) ? r[i] =
|
|
356
|
+
Ee(r[i]) && Ee(s) ? r[i] = Fe(r[i], s) : Ee(s) ? r[i] = Fe({}, s) : te(s) ? r[i] = s.slice() : (!e || !ee(s)) && (r[i] = s);
|
|
357
357
|
};
|
|
358
358
|
for (let s = 0, o = arguments.length; s < o; s++)
|
|
359
359
|
arguments[s] && ue(arguments[s], n);
|
|
@@ -362,7 +362,7 @@ function Ie() {
|
|
|
362
362
|
const fr = (t, e, r, { allOwnKeys: n } = {}) => (ue(
|
|
363
363
|
e,
|
|
364
364
|
(s, o) => {
|
|
365
|
-
r &&
|
|
365
|
+
r && F(s) ? Object.defineProperty(t, o, {
|
|
366
366
|
value: pt(s, r),
|
|
367
367
|
writable: !0,
|
|
368
368
|
enumerable: !0,
|
|
@@ -403,7 +403,7 @@ const fr = (t, e, r, { allOwnKeys: n } = {}) => (ue(
|
|
|
403
403
|
return n !== -1 && n === r;
|
|
404
404
|
}, yr = (t) => {
|
|
405
405
|
if (!t) return null;
|
|
406
|
-
if (
|
|
406
|
+
if (te(t)) return t;
|
|
407
407
|
let e = t.length;
|
|
408
408
|
if (!bt(e)) return null;
|
|
409
409
|
const r = new Array(e);
|
|
@@ -411,7 +411,7 @@ const fr = (t, e, r, { allOwnKeys: n } = {}) => (ue(
|
|
|
411
411
|
r[e] = t[e];
|
|
412
412
|
return r;
|
|
413
413
|
}, br = /* @__PURE__ */ ((t) => (e) => t && e instanceof t)(typeof Uint8Array < "u" && $e(Uint8Array)), gr = (t, e) => {
|
|
414
|
-
const n = (t && t[
|
|
414
|
+
const n = (t && t[Ae]).call(t);
|
|
415
415
|
let s;
|
|
416
416
|
for (; (s = n.next()) && !s.done; ) {
|
|
417
417
|
const o = s.value;
|
|
@@ -423,9 +423,9 @@ const fr = (t, e, r, { allOwnKeys: n } = {}) => (ue(
|
|
|
423
423
|
for (; (r = t.exec(e)) !== null; )
|
|
424
424
|
n.push(r);
|
|
425
425
|
return n;
|
|
426
|
-
}, wr =
|
|
426
|
+
}, wr = $("HTMLFormElement"), Rr = (t) => t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function(r, n, s) {
|
|
427
427
|
return n.toUpperCase() + s;
|
|
428
|
-
}), Ge = (({ hasOwnProperty: t }) => (e, r) => t.call(e, r))(Object.prototype), Sr =
|
|
428
|
+
}), Ge = (({ hasOwnProperty: t }) => (e, r) => t.call(e, r))(Object.prototype), Sr = $("RegExp"), wt = (t, e) => {
|
|
429
429
|
const r = Object.getOwnPropertyDescriptors(t), n = {};
|
|
430
430
|
ue(r, (s, o) => {
|
|
431
431
|
let i;
|
|
@@ -433,10 +433,10 @@ const fr = (t, e, r, { allOwnKeys: n } = {}) => (ue(
|
|
|
433
433
|
}), Object.defineProperties(t, n);
|
|
434
434
|
}, Tr = (t) => {
|
|
435
435
|
wt(t, (e, r) => {
|
|
436
|
-
if (
|
|
436
|
+
if (F(t) && ["arguments", "caller", "callee"].indexOf(r) !== -1)
|
|
437
437
|
return !1;
|
|
438
438
|
const n = t[r];
|
|
439
|
-
if (
|
|
439
|
+
if (F(n)) {
|
|
440
440
|
if (e.enumerable = !1, "writable" in e) {
|
|
441
441
|
e.writable = !1;
|
|
442
442
|
return;
|
|
@@ -452,11 +452,11 @@ const fr = (t, e, r, { allOwnKeys: n } = {}) => (ue(
|
|
|
452
452
|
r[o] = !0;
|
|
453
453
|
});
|
|
454
454
|
};
|
|
455
|
-
return
|
|
455
|
+
return te(t) ? n(t) : n(String(t).split(e)), r;
|
|
456
456
|
}, xr = () => {
|
|
457
|
-
},
|
|
458
|
-
function
|
|
459
|
-
return !!(t &&
|
|
457
|
+
}, Or = (t, e) => t != null && Number.isFinite(t = +t) ? t : e;
|
|
458
|
+
function _r(t) {
|
|
459
|
+
return !!(t && F(t.append) && t[mt] === "FormData" && t[Ae]);
|
|
460
460
|
}
|
|
461
461
|
const Nr = (t) => {
|
|
462
462
|
const e = new Array(10), r = (n, s) => {
|
|
@@ -467,26 +467,26 @@ const Nr = (t) => {
|
|
|
467
467
|
return n;
|
|
468
468
|
if (!("toJSON" in n)) {
|
|
469
469
|
e[s] = n;
|
|
470
|
-
const o =
|
|
470
|
+
const o = te(n) ? [] : {};
|
|
471
471
|
return ue(n, (i, c) => {
|
|
472
472
|
const p = r(i, s + 1);
|
|
473
|
-
!
|
|
473
|
+
!ee(p) && (o[c] = p);
|
|
474
474
|
}), e[s] = void 0, o;
|
|
475
475
|
}
|
|
476
476
|
}
|
|
477
477
|
return n;
|
|
478
478
|
};
|
|
479
479
|
return r(t, 0);
|
|
480
|
-
}, Cr =
|
|
480
|
+
}, Cr = $("AsyncFunction"), jr = (t) => t && (le(t) || F(t)) && F(t.then) && F(t.catch), Rt = ((t, e) => t ? setImmediate : e ? ((r, n) => (Y.addEventListener(
|
|
481
481
|
"message",
|
|
482
482
|
({ source: s, data: o }) => {
|
|
483
|
-
s ===
|
|
483
|
+
s === Y && o === r && n.length && n.shift()();
|
|
484
484
|
},
|
|
485
485
|
!1
|
|
486
486
|
), (s) => {
|
|
487
|
-
n.push(s),
|
|
488
|
-
}))(`axios@${Math.random()}`, []) : (r) => setTimeout(r))(typeof setImmediate == "function",
|
|
489
|
-
isArray:
|
|
487
|
+
n.push(s), Y.postMessage(r, "*");
|
|
488
|
+
}))(`axios@${Math.random()}`, []) : (r) => setTimeout(r))(typeof setImmediate == "function", F(Y.postMessage)), Pr = typeof queueMicrotask < "u" ? queueMicrotask.bind(Y) : typeof process < "u" && process.nextTick || Rt, vr = (t) => t != null && F(t[Ae]), a = {
|
|
489
|
+
isArray: te,
|
|
490
490
|
isArrayBuffer: yt,
|
|
491
491
|
isBuffer: ce,
|
|
492
492
|
isFormData: sr,
|
|
@@ -501,25 +501,25 @@ const Nr = (t) => {
|
|
|
501
501
|
isRequest: ar,
|
|
502
502
|
isResponse: cr,
|
|
503
503
|
isHeaders: lr,
|
|
504
|
-
isUndefined:
|
|
504
|
+
isUndefined: ee,
|
|
505
505
|
isDate: Zt,
|
|
506
506
|
isFile: er,
|
|
507
507
|
isBlob: tr,
|
|
508
508
|
isRegExp: Sr,
|
|
509
|
-
isFunction:
|
|
509
|
+
isFunction: F,
|
|
510
510
|
isStream: nr,
|
|
511
511
|
isURLSearchParams: or,
|
|
512
512
|
isTypedArray: br,
|
|
513
513
|
isFileList: rr,
|
|
514
514
|
forEach: ue,
|
|
515
|
-
merge:
|
|
515
|
+
merge: Fe,
|
|
516
516
|
extend: fr,
|
|
517
517
|
trim: ur,
|
|
518
518
|
stripBOM: dr,
|
|
519
519
|
inherits: hr,
|
|
520
520
|
toFlatObject: pr,
|
|
521
|
-
kindOf:
|
|
522
|
-
kindOfTest:
|
|
521
|
+
kindOf: xe,
|
|
522
|
+
kindOfTest: $,
|
|
523
523
|
endsWith: mr,
|
|
524
524
|
toArray: yr,
|
|
525
525
|
forEachEntry: gr,
|
|
@@ -533,16 +533,16 @@ const Nr = (t) => {
|
|
|
533
533
|
toObjectSet: Ar,
|
|
534
534
|
toCamelCase: Rr,
|
|
535
535
|
noop: xr,
|
|
536
|
-
toFiniteNumber:
|
|
536
|
+
toFiniteNumber: Or,
|
|
537
537
|
findKey: gt,
|
|
538
|
-
global:
|
|
538
|
+
global: Y,
|
|
539
539
|
isContextDefined: Et,
|
|
540
|
-
isSpecCompliantForm:
|
|
540
|
+
isSpecCompliantForm: _r,
|
|
541
541
|
toJSONObject: Nr,
|
|
542
542
|
isAsyncFn: Cr,
|
|
543
|
-
isThenable:
|
|
543
|
+
isThenable: jr,
|
|
544
544
|
setImmediate: Rt,
|
|
545
|
-
asap:
|
|
545
|
+
asap: Pr,
|
|
546
546
|
isIterable: vr
|
|
547
547
|
};
|
|
548
548
|
let g = class St extends Error {
|
|
@@ -597,7 +597,7 @@ g.ERR_CANCELED = "ERR_CANCELED";
|
|
|
597
597
|
g.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
|
|
598
598
|
g.ERR_INVALID_URL = "ERR_INVALID_URL";
|
|
599
599
|
const kr = null;
|
|
600
|
-
function
|
|
600
|
+
function Be(t) {
|
|
601
601
|
return a.isPlainObject(t) || a.isArray(t);
|
|
602
602
|
}
|
|
603
603
|
function Tt(t) {
|
|
@@ -609,7 +609,7 @@ function Qe(t, e, r) {
|
|
|
609
609
|
}).join(r ? "." : "") : e;
|
|
610
610
|
}
|
|
611
611
|
function Lr(t) {
|
|
612
|
-
return a.isArray(t) && !t.some(
|
|
612
|
+
return a.isArray(t) && !t.some(Be);
|
|
613
613
|
}
|
|
614
614
|
const Ur = a.toFlatObject(a, {}, null, function(e) {
|
|
615
615
|
return /^is[A-Z]/.test(e);
|
|
@@ -621,8 +621,8 @@ function _e(t, e, r) {
|
|
|
621
621
|
metaTokens: !0,
|
|
622
622
|
dots: !1,
|
|
623
623
|
indexes: !1
|
|
624
|
-
}, !1, function(
|
|
625
|
-
return !a.isUndefined(h[
|
|
624
|
+
}, !1, function(b, h) {
|
|
625
|
+
return !a.isUndefined(h[b]);
|
|
626
626
|
});
|
|
627
627
|
const n = r.metaTokens, s = r.visitor || u, o = r.dots, i = r.indexes, p = (r.Blob || typeof Blob < "u" && Blob) && a.isSpecCompliantForm(e);
|
|
628
628
|
if (!a.isFunction(s))
|
|
@@ -637,40 +637,40 @@ function _e(t, e, r) {
|
|
|
637
637
|
throw new g("Blob is not supported. Use a Buffer instead.");
|
|
638
638
|
return a.isArrayBuffer(f) || a.isTypedArray(f) ? p && typeof Blob == "function" ? new Blob([f]) : Buffer.from(f) : f;
|
|
639
639
|
}
|
|
640
|
-
function u(f,
|
|
640
|
+
function u(f, b, h) {
|
|
641
641
|
let S = f;
|
|
642
642
|
if (f && !h && typeof f == "object") {
|
|
643
|
-
if (a.endsWith(
|
|
644
|
-
|
|
645
|
-
else if (a.isArray(f) && Lr(f) || (a.isFileList(f) || a.endsWith(
|
|
646
|
-
return
|
|
647
|
-
!(a.isUndefined(
|
|
643
|
+
if (a.endsWith(b, "{}"))
|
|
644
|
+
b = n ? b : b.slice(0, -2), f = JSON.stringify(f);
|
|
645
|
+
else if (a.isArray(f) && Lr(f) || (a.isFileList(f) || a.endsWith(b, "[]")) && (S = a.toArray(f)))
|
|
646
|
+
return b = Tt(b), S.forEach(function(x, N) {
|
|
647
|
+
!(a.isUndefined(x) || x === null) && e.append(
|
|
648
648
|
// eslint-disable-next-line no-nested-ternary
|
|
649
|
-
i === !0 ? Qe([
|
|
650
|
-
d(
|
|
649
|
+
i === !0 ? Qe([b], N, o) : i === null ? b : b + "[]",
|
|
650
|
+
d(x)
|
|
651
651
|
);
|
|
652
652
|
}), !1;
|
|
653
653
|
}
|
|
654
|
-
return
|
|
654
|
+
return Be(f) ? !0 : (e.append(Qe(h, b, o), d(f)), !1);
|
|
655
655
|
}
|
|
656
|
-
const
|
|
656
|
+
const y = [], w = Object.assign(Ur, {
|
|
657
657
|
defaultVisitor: u,
|
|
658
658
|
convertValue: d,
|
|
659
|
-
isVisitable:
|
|
659
|
+
isVisitable: Be
|
|
660
660
|
});
|
|
661
|
-
function R(f,
|
|
661
|
+
function R(f, b) {
|
|
662
662
|
if (!a.isUndefined(f)) {
|
|
663
|
-
if (
|
|
664
|
-
throw Error("Circular reference detected in " +
|
|
665
|
-
|
|
663
|
+
if (y.indexOf(f) !== -1)
|
|
664
|
+
throw Error("Circular reference detected in " + b.join("."));
|
|
665
|
+
y.push(f), a.forEach(f, function(S, j) {
|
|
666
666
|
(!(a.isUndefined(S) || S === null) && s.call(
|
|
667
667
|
e,
|
|
668
668
|
S,
|
|
669
669
|
a.isString(j) ? j.trim() : j,
|
|
670
|
-
|
|
670
|
+
b,
|
|
671
671
|
w
|
|
672
|
-
)) === !0 && R(S,
|
|
673
|
-
}),
|
|
672
|
+
)) === !0 && R(S, b ? b.concat(j) : [j]);
|
|
673
|
+
}), y.pop();
|
|
674
674
|
}
|
|
675
675
|
}
|
|
676
676
|
if (!a.isObject(t))
|
|
@@ -790,30 +790,30 @@ const We = {
|
|
|
790
790
|
Blob: Dr
|
|
791
791
|
},
|
|
792
792
|
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
793
|
-
},
|
|
794
|
-
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", $r =
|
|
793
|
+
}, Ve = typeof window < "u" && typeof document < "u", De = typeof navigator == "object" && navigator || void 0, Mr = Ve && (!De || ["ReactNative", "NativeScript", "NS"].indexOf(De.product) < 0), Hr = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
|
|
794
|
+
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", $r = Ve && window.location.href || "http://localhost", zr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
795
795
|
__proto__: null,
|
|
796
|
-
hasBrowserEnv:
|
|
796
|
+
hasBrowserEnv: Ve,
|
|
797
797
|
hasStandardBrowserEnv: Mr,
|
|
798
798
|
hasStandardBrowserWebWorkerEnv: Hr,
|
|
799
|
-
navigator:
|
|
799
|
+
navigator: De,
|
|
800
800
|
origin: $r
|
|
801
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
801
|
+
}, Symbol.toStringTag, { value: "Module" })), L = {
|
|
802
802
|
...zr,
|
|
803
803
|
...qr
|
|
804
804
|
};
|
|
805
805
|
function Wr(t, e) {
|
|
806
|
-
return _e(t, new
|
|
806
|
+
return _e(t, new L.classes.URLSearchParams(), {
|
|
807
807
|
visitor: function(r, n, s, o) {
|
|
808
|
-
return
|
|
808
|
+
return L.isNode && a.isBuffer(r) ? (this.append(n, r.toString("base64")), !1) : o.defaultVisitor.apply(this, arguments);
|
|
809
809
|
},
|
|
810
810
|
...e
|
|
811
811
|
});
|
|
812
812
|
}
|
|
813
|
-
function
|
|
813
|
+
function Vr(t) {
|
|
814
814
|
return a.matchAll(/\w+|\[(\w*)]/g, t).map((e) => e[0] === "[]" ? "" : e[1] || e[0]);
|
|
815
815
|
}
|
|
816
|
-
function
|
|
816
|
+
function Jr(t) {
|
|
817
817
|
const e = {}, r = Object.keys(t);
|
|
818
818
|
let n;
|
|
819
819
|
const s = r.length;
|
|
@@ -822,17 +822,17 @@ function Vr(t) {
|
|
|
822
822
|
o = r[n], e[o] = t[o];
|
|
823
823
|
return e;
|
|
824
824
|
}
|
|
825
|
-
function
|
|
825
|
+
function Ot(t) {
|
|
826
826
|
function e(r, n, s, o) {
|
|
827
827
|
let i = r[o++];
|
|
828
828
|
if (i === "__proto__") return !0;
|
|
829
829
|
const c = Number.isFinite(+i), p = o >= r.length;
|
|
830
|
-
return i = !i && a.isArray(s) ? s.length : i, p ? (a.hasOwnProp(s, i) ? s[i] = [s[i], n] : s[i] = n, !c) : ((!s[i] || !a.isObject(s[i])) && (s[i] = []), e(r, n, s[i], o) && a.isArray(s[i]) && (s[i] =
|
|
830
|
+
return i = !i && a.isArray(s) ? s.length : i, p ? (a.hasOwnProp(s, i) ? s[i] = [s[i], n] : s[i] = n, !c) : ((!s[i] || !a.isObject(s[i])) && (s[i] = []), e(r, n, s[i], o) && a.isArray(s[i]) && (s[i] = Jr(s[i])), !c);
|
|
831
831
|
}
|
|
832
832
|
if (a.isFormData(t) && a.isFunction(t.entries)) {
|
|
833
833
|
const r = {};
|
|
834
834
|
return a.forEachEntry(t, (n, s) => {
|
|
835
|
-
e(
|
|
835
|
+
e(Vr(n), s, r, 0);
|
|
836
836
|
}), r;
|
|
837
837
|
}
|
|
838
838
|
return null;
|
|
@@ -853,7 +853,7 @@ const fe = {
|
|
|
853
853
|
transformRequest: [function(e, r) {
|
|
854
854
|
const n = r.getContentType() || "", s = n.indexOf("application/json") > -1, o = a.isObject(e);
|
|
855
855
|
if (o && a.isHTMLForm(e) && (e = new FormData(e)), a.isFormData(e))
|
|
856
|
-
return s ? JSON.stringify(
|
|
856
|
+
return s ? JSON.stringify(Ot(e)) : e;
|
|
857
857
|
if (a.isArrayBuffer(e) || a.isBuffer(e) || a.isStream(e) || a.isFile(e) || a.isBlob(e) || a.isReadableStream(e))
|
|
858
858
|
return e;
|
|
859
859
|
if (a.isArrayBufferView(e))
|
|
@@ -900,8 +900,8 @@ const fe = {
|
|
|
900
900
|
maxContentLength: -1,
|
|
901
901
|
maxBodyLength: -1,
|
|
902
902
|
env: {
|
|
903
|
-
FormData:
|
|
904
|
-
Blob:
|
|
903
|
+
FormData: L.classes.FormData,
|
|
904
|
+
Blob: L.classes.Blob
|
|
905
905
|
},
|
|
906
906
|
validateStatus: function(e) {
|
|
907
907
|
return e >= 200 && e < 300;
|
|
@@ -980,7 +980,7 @@ function en(t, e) {
|
|
|
980
980
|
});
|
|
981
981
|
});
|
|
982
982
|
}
|
|
983
|
-
let
|
|
983
|
+
let B = class {
|
|
984
984
|
constructor(e) {
|
|
985
985
|
e && this.set(e);
|
|
986
986
|
}
|
|
@@ -990,8 +990,8 @@ let L = class {
|
|
|
990
990
|
const u = ie(p);
|
|
991
991
|
if (!u)
|
|
992
992
|
throw new Error("header name must be a non-empty string");
|
|
993
|
-
const
|
|
994
|
-
(!
|
|
993
|
+
const y = a.findKey(s, u);
|
|
994
|
+
(!y || s[y] === void 0 || d === !0 || d === void 0 && s[y] !== !1) && (s[y || p] = we(c));
|
|
995
995
|
}
|
|
996
996
|
const i = (c, p) => a.forEach(c, (d, u) => o(d, u, p));
|
|
997
997
|
if (a.isPlainObject(e) || e instanceof this.constructor)
|
|
@@ -1106,8 +1106,8 @@ let L = class {
|
|
|
1106
1106
|
return a.isArray(e) ? e.forEach(o) : o(e), this;
|
|
1107
1107
|
}
|
|
1108
1108
|
};
|
|
1109
|
-
|
|
1110
|
-
a.reduceDescriptors(
|
|
1109
|
+
B.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
|
|
1110
|
+
a.reduceDescriptors(B.prototype, ({ value: t }, e) => {
|
|
1111
1111
|
let r = e[0].toUpperCase() + e.slice(1);
|
|
1112
1112
|
return {
|
|
1113
1113
|
get: () => t,
|
|
@@ -1116,15 +1116,15 @@ a.reduceDescriptors(L.prototype, ({ value: t }, e) => {
|
|
|
1116
1116
|
}
|
|
1117
1117
|
};
|
|
1118
1118
|
});
|
|
1119
|
-
a.freezeMethods(
|
|
1120
|
-
function
|
|
1121
|
-
const r = this || fe, n = e || r, s =
|
|
1119
|
+
a.freezeMethods(B);
|
|
1120
|
+
function ve(t, e) {
|
|
1121
|
+
const r = this || fe, n = e || r, s = B.from(n.headers);
|
|
1122
1122
|
let o = n.data;
|
|
1123
1123
|
return a.forEach(t, function(c) {
|
|
1124
1124
|
o = c.call(r, o, s.normalize(), e ? e.status : void 0);
|
|
1125
1125
|
}), s.normalize(), o;
|
|
1126
1126
|
}
|
|
1127
|
-
function
|
|
1127
|
+
function _t(t) {
|
|
1128
1128
|
return !!(t && t.__CANCEL__);
|
|
1129
1129
|
}
|
|
1130
1130
|
let de = class extends g {
|
|
@@ -1162,9 +1162,9 @@ function rn(t, e) {
|
|
|
1162
1162
|
return e = e !== void 0 ? e : 1e3, function(p) {
|
|
1163
1163
|
const d = Date.now(), u = n[o];
|
|
1164
1164
|
i || (i = d), r[s] = p, n[s] = d;
|
|
1165
|
-
let
|
|
1166
|
-
for (;
|
|
1167
|
-
w += r[
|
|
1165
|
+
let y = o, w = 0;
|
|
1166
|
+
for (; y !== s; )
|
|
1167
|
+
w += r[y++], y = y % t;
|
|
1168
1168
|
if (s = (s + 1) % t, s === o && (o = (o + 1) % t), d - i < e)
|
|
1169
1169
|
return;
|
|
1170
1170
|
const R = u && d - u;
|
|
@@ -1177,19 +1177,19 @@ function nn(t, e) {
|
|
|
1177
1177
|
r = u, s = null, o && (clearTimeout(o), o = null), t(...d);
|
|
1178
1178
|
};
|
|
1179
1179
|
return [(...d) => {
|
|
1180
|
-
const u = Date.now(),
|
|
1181
|
-
|
|
1180
|
+
const u = Date.now(), y = u - r;
|
|
1181
|
+
y >= n ? i(d, u) : (s = d, o || (o = setTimeout(() => {
|
|
1182
1182
|
o = null, i(s);
|
|
1183
|
-
}, n -
|
|
1183
|
+
}, n - y)));
|
|
1184
1184
|
}, () => s && i(s)];
|
|
1185
1185
|
}
|
|
1186
|
-
const
|
|
1186
|
+
const Te = (t, e, r = 3) => {
|
|
1187
1187
|
let n = 0;
|
|
1188
1188
|
const s = rn(50, 250);
|
|
1189
1189
|
return nn((o) => {
|
|
1190
1190
|
const i = o.loaded, c = o.lengthComputable ? o.total : void 0, p = i - n, d = s(p), u = i <= c;
|
|
1191
1191
|
n = i;
|
|
1192
|
-
const
|
|
1192
|
+
const y = {
|
|
1193
1193
|
loaded: i,
|
|
1194
1194
|
total: c,
|
|
1195
1195
|
progress: c ? i / c : void 0,
|
|
@@ -1200,7 +1200,7 @@ const Se = (t, e, r = 3) => {
|
|
|
1200
1200
|
lengthComputable: c != null,
|
|
1201
1201
|
[e ? "download" : "upload"]: !0
|
|
1202
1202
|
};
|
|
1203
|
-
t(
|
|
1203
|
+
t(y);
|
|
1204
1204
|
}, r);
|
|
1205
1205
|
}, rt = (t, e) => {
|
|
1206
1206
|
const r = t != null;
|
|
@@ -1209,10 +1209,10 @@ const Se = (t, e, r = 3) => {
|
|
|
1209
1209
|
total: t,
|
|
1210
1210
|
loaded: n
|
|
1211
1211
|
}), e[1]];
|
|
1212
|
-
}, nt = (t) => (...e) => a.asap(() => t(...e)), sn =
|
|
1213
|
-
new URL(
|
|
1214
|
-
|
|
1215
|
-
) : () => !0, on =
|
|
1212
|
+
}, nt = (t) => (...e) => a.asap(() => t(...e)), sn = L.hasStandardBrowserEnv ? /* @__PURE__ */ ((t, e) => (r) => (r = new URL(r, L.origin), t.protocol === r.protocol && t.host === r.host && (e || t.port === r.port)))(
|
|
1213
|
+
new URL(L.origin),
|
|
1214
|
+
L.navigator && /(msie|trident)/i.test(L.navigator.userAgent)
|
|
1215
|
+
) : () => !0, on = L.hasStandardBrowserEnv ? (
|
|
1216
1216
|
// Standard browser envs support document.cookie
|
|
1217
1217
|
{
|
|
1218
1218
|
write(t, e, r, n, s, o, i) {
|
|
@@ -1251,18 +1251,18 @@ function Ct(t, e, r) {
|
|
|
1251
1251
|
let n = !an(e);
|
|
1252
1252
|
return t && (n || r == !1) ? cn(t, e) : e;
|
|
1253
1253
|
}
|
|
1254
|
-
const st = (t) => t instanceof
|
|
1255
|
-
function
|
|
1254
|
+
const st = (t) => t instanceof B ? { ...t } : t;
|
|
1255
|
+
function G(t, e) {
|
|
1256
1256
|
e = e || {};
|
|
1257
1257
|
const r = {};
|
|
1258
|
-
function n(d, u,
|
|
1258
|
+
function n(d, u, y, w) {
|
|
1259
1259
|
return a.isPlainObject(d) && a.isPlainObject(u) ? a.merge.call({ caseless: w }, d, u) : a.isPlainObject(u) ? a.merge({}, u) : a.isArray(u) ? u.slice() : u;
|
|
1260
1260
|
}
|
|
1261
|
-
function s(d, u,
|
|
1261
|
+
function s(d, u, y, w) {
|
|
1262
1262
|
if (a.isUndefined(u)) {
|
|
1263
1263
|
if (!a.isUndefined(d))
|
|
1264
|
-
return n(void 0, d,
|
|
1265
|
-
} else return n(d, u,
|
|
1264
|
+
return n(void 0, d, y, w);
|
|
1265
|
+
} else return n(d, u, y, w);
|
|
1266
1266
|
}
|
|
1267
1267
|
function o(d, u) {
|
|
1268
1268
|
if (!a.isUndefined(u))
|
|
@@ -1274,10 +1274,10 @@ function X(t, e) {
|
|
|
1274
1274
|
return n(void 0, d);
|
|
1275
1275
|
} else return n(void 0, u);
|
|
1276
1276
|
}
|
|
1277
|
-
function c(d, u,
|
|
1278
|
-
if (
|
|
1277
|
+
function c(d, u, y) {
|
|
1278
|
+
if (y in e)
|
|
1279
1279
|
return n(d, u);
|
|
1280
|
-
if (
|
|
1280
|
+
if (y in t)
|
|
1281
1281
|
return n(void 0, d);
|
|
1282
1282
|
}
|
|
1283
1283
|
const p = {
|
|
@@ -1309,46 +1309,46 @@ function X(t, e) {
|
|
|
1309
1309
|
socketPath: i,
|
|
1310
1310
|
responseEncoding: i,
|
|
1311
1311
|
validateStatus: c,
|
|
1312
|
-
headers: (d, u,
|
|
1312
|
+
headers: (d, u, y) => s(st(d), st(u), y, !0)
|
|
1313
1313
|
};
|
|
1314
1314
|
return a.forEach(
|
|
1315
1315
|
Object.keys({ ...t, ...e }),
|
|
1316
1316
|
function(u) {
|
|
1317
1317
|
if (u === "__proto__" || u === "constructor" || u === "prototype")
|
|
1318
1318
|
return;
|
|
1319
|
-
const
|
|
1320
|
-
a.isUndefined(w) &&
|
|
1319
|
+
const y = a.hasOwnProp(p, u) ? p[u] : s, w = y(t[u], e[u], u);
|
|
1320
|
+
a.isUndefined(w) && y !== c || (r[u] = w);
|
|
1321
1321
|
}
|
|
1322
1322
|
), r;
|
|
1323
1323
|
}
|
|
1324
|
-
const
|
|
1325
|
-
const e =
|
|
1324
|
+
const jt = (t) => {
|
|
1325
|
+
const e = G({}, t);
|
|
1326
1326
|
let { data: r, withXSRFToken: n, xsrfHeaderName: s, xsrfCookieName: o, headers: i, auth: c } = e;
|
|
1327
|
-
if (e.headers = i =
|
|
1327
|
+
if (e.headers = i = B.from(i), e.url = xt(Ct(e.baseURL, e.url, e.allowAbsoluteUrls), t.params, t.paramsSerializer), c && i.set(
|
|
1328
1328
|
"Authorization",
|
|
1329
1329
|
"Basic " + btoa((c.username || "") + ":" + (c.password ? unescape(encodeURIComponent(c.password)) : ""))
|
|
1330
1330
|
), a.isFormData(r)) {
|
|
1331
|
-
if (
|
|
1331
|
+
if (L.hasStandardBrowserEnv || L.hasStandardBrowserWebWorkerEnv)
|
|
1332
1332
|
i.setContentType(void 0);
|
|
1333
1333
|
else if (a.isFunction(r.getHeaders)) {
|
|
1334
1334
|
const p = r.getHeaders(), d = ["content-type", "content-length"];
|
|
1335
|
-
Object.entries(p).forEach(([u,
|
|
1336
|
-
d.includes(u.toLowerCase()) && i.set(u,
|
|
1335
|
+
Object.entries(p).forEach(([u, y]) => {
|
|
1336
|
+
d.includes(u.toLowerCase()) && i.set(u, y);
|
|
1337
1337
|
});
|
|
1338
1338
|
}
|
|
1339
1339
|
}
|
|
1340
|
-
if (
|
|
1340
|
+
if (L.hasStandardBrowserEnv && (n && a.isFunction(n) && (n = n(e)), n || n !== !1 && sn(e.url))) {
|
|
1341
1341
|
const p = s && o && on.read(o);
|
|
1342
1342
|
p && i.set(s, p);
|
|
1343
1343
|
}
|
|
1344
1344
|
return e;
|
|
1345
1345
|
}, ln = typeof XMLHttpRequest < "u", un = ln && function(t) {
|
|
1346
1346
|
return new Promise(function(r, n) {
|
|
1347
|
-
const s =
|
|
1347
|
+
const s = jt(t);
|
|
1348
1348
|
let o = s.data;
|
|
1349
|
-
const i =
|
|
1350
|
-
let { responseType: c, onUploadProgress: p, onDownloadProgress: d } = s, u,
|
|
1351
|
-
function
|
|
1349
|
+
const i = B.from(s.headers).normalize();
|
|
1350
|
+
let { responseType: c, onUploadProgress: p, onDownloadProgress: d } = s, u, y, w, R, f;
|
|
1351
|
+
function b() {
|
|
1352
1352
|
R && R(), f && f(), s.cancelToken && s.cancelToken.unsubscribe(u), s.signal && s.signal.removeEventListener("abort", u);
|
|
1353
1353
|
}
|
|
1354
1354
|
let h = new XMLHttpRequest();
|
|
@@ -1356,45 +1356,45 @@ const Pt = (t) => {
|
|
|
1356
1356
|
function S() {
|
|
1357
1357
|
if (!h)
|
|
1358
1358
|
return;
|
|
1359
|
-
const
|
|
1359
|
+
const x = B.from(
|
|
1360
1360
|
"getAllResponseHeaders" in h && h.getAllResponseHeaders()
|
|
1361
|
-
),
|
|
1361
|
+
), _ = {
|
|
1362
1362
|
data: !c || c === "text" || c === "json" ? h.responseText : h.response,
|
|
1363
1363
|
status: h.status,
|
|
1364
1364
|
statusText: h.statusText,
|
|
1365
|
-
headers:
|
|
1365
|
+
headers: x,
|
|
1366
1366
|
config: t,
|
|
1367
1367
|
request: h
|
|
1368
1368
|
};
|
|
1369
|
-
Nt(function(
|
|
1370
|
-
r(
|
|
1371
|
-
}, function(
|
|
1372
|
-
n(
|
|
1373
|
-
},
|
|
1369
|
+
Nt(function(k) {
|
|
1370
|
+
r(k), b();
|
|
1371
|
+
}, function(k) {
|
|
1372
|
+
n(k), b();
|
|
1373
|
+
}, _), h = null;
|
|
1374
1374
|
}
|
|
1375
1375
|
"onloadend" in h ? h.onloadend = S : h.onreadystatechange = function() {
|
|
1376
1376
|
!h || h.readyState !== 4 || h.status === 0 && !(h.responseURL && h.responseURL.indexOf("file:") === 0) || setTimeout(S);
|
|
1377
1377
|
}, h.onabort = function() {
|
|
1378
1378
|
h && (n(new g("Request aborted", g.ECONNABORTED, t, h)), h = null);
|
|
1379
|
-
}, h.onerror = function(
|
|
1380
|
-
const
|
|
1381
|
-
|
|
1379
|
+
}, h.onerror = function(N) {
|
|
1380
|
+
const _ = N && N.message ? N.message : "Network Error", q = new g(_, g.ERR_NETWORK, t, h);
|
|
1381
|
+
q.event = N || null, n(q), h = null;
|
|
1382
1382
|
}, h.ontimeout = function() {
|
|
1383
|
-
let
|
|
1384
|
-
const
|
|
1385
|
-
s.timeoutErrorMessage && (
|
|
1386
|
-
|
|
1387
|
-
|
|
1383
|
+
let N = s.timeout ? "timeout of " + s.timeout + "ms exceeded" : "timeout exceeded";
|
|
1384
|
+
const _ = s.transitional || We;
|
|
1385
|
+
s.timeoutErrorMessage && (N = s.timeoutErrorMessage), n(new g(
|
|
1386
|
+
N,
|
|
1387
|
+
_.clarifyTimeoutError ? g.ETIMEDOUT : g.ECONNABORTED,
|
|
1388
1388
|
t,
|
|
1389
1389
|
h
|
|
1390
1390
|
)), h = null;
|
|
1391
|
-
}, o === void 0 && i.setContentType(null), "setRequestHeader" in h && a.forEach(i.toJSON(), function(
|
|
1392
|
-
h.setRequestHeader(
|
|
1393
|
-
}), a.isUndefined(s.withCredentials) || (h.withCredentials = !!s.withCredentials), c && c !== "json" && (h.responseType = s.responseType), d && ([w, f] =
|
|
1394
|
-
h && (n(!
|
|
1391
|
+
}, o === void 0 && i.setContentType(null), "setRequestHeader" in h && a.forEach(i.toJSON(), function(N, _) {
|
|
1392
|
+
h.setRequestHeader(_, N);
|
|
1393
|
+
}), a.isUndefined(s.withCredentials) || (h.withCredentials = !!s.withCredentials), c && c !== "json" && (h.responseType = s.responseType), d && ([w, f] = Te(d, !0), h.addEventListener("progress", w)), p && h.upload && ([y, R] = Te(p), h.upload.addEventListener("progress", y), h.upload.addEventListener("loadend", R)), (s.cancelToken || s.signal) && (u = (x) => {
|
|
1394
|
+
h && (n(!x || x.type ? new de(null, t, h) : x), h.abort(), h = null);
|
|
1395
1395
|
}, s.cancelToken && s.cancelToken.subscribe(u), s.signal && (s.signal.aborted ? u() : s.signal.addEventListener("abort", u)));
|
|
1396
1396
|
const j = tn(s.url);
|
|
1397
|
-
if (j &&
|
|
1397
|
+
if (j && L.protocols.indexOf(j) === -1) {
|
|
1398
1398
|
n(new g("Unsupported protocol " + j + ":", g.ERR_BAD_REQUEST, t));
|
|
1399
1399
|
return;
|
|
1400
1400
|
}
|
|
@@ -1464,9 +1464,9 @@ const Pt = (t) => {
|
|
|
1464
1464
|
c(), p.close();
|
|
1465
1465
|
return;
|
|
1466
1466
|
}
|
|
1467
|
-
let
|
|
1467
|
+
let y = u.byteLength;
|
|
1468
1468
|
if (r) {
|
|
1469
|
-
let w = o +=
|
|
1469
|
+
let w = o += y;
|
|
1470
1470
|
r(w);
|
|
1471
1471
|
}
|
|
1472
1472
|
p.enqueue(new Uint8Array(u));
|
|
@@ -1499,24 +1499,24 @@ const Pt = (t) => {
|
|
|
1499
1499
|
const { fetch: e, Request: r, Response: n } = t, s = e ? ge(e) : typeof fetch == "function", o = ge(r), i = ge(n);
|
|
1500
1500
|
if (!s)
|
|
1501
1501
|
return !1;
|
|
1502
|
-
const c = s && ge(at), p = s && (typeof ct == "function" ? /* @__PURE__ */ ((f) => (
|
|
1502
|
+
const c = s && ge(at), p = s && (typeof ct == "function" ? /* @__PURE__ */ ((f) => (b) => f.encode(b))(new ct()) : async (f) => new Uint8Array(await new r(f).arrayBuffer())), d = o && c && lt(() => {
|
|
1503
1503
|
let f = !1;
|
|
1504
|
-
const
|
|
1504
|
+
const b = new r(L.origin, {
|
|
1505
1505
|
body: new at(),
|
|
1506
1506
|
method: "POST",
|
|
1507
1507
|
get duplex() {
|
|
1508
1508
|
return f = !0, "half";
|
|
1509
1509
|
}
|
|
1510
1510
|
}).headers.has("Content-Type");
|
|
1511
|
-
return f && !
|
|
1512
|
-
}), u = i && c && lt(() => a.isReadableStream(new n("").body)),
|
|
1511
|
+
return f && !b;
|
|
1512
|
+
}), u = i && c && lt(() => a.isReadableStream(new n("").body)), y = {
|
|
1513
1513
|
stream: u && ((f) => f.body)
|
|
1514
1514
|
};
|
|
1515
1515
|
s && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((f) => {
|
|
1516
|
-
!
|
|
1517
|
-
let S =
|
|
1516
|
+
!y[f] && (y[f] = (b, h) => {
|
|
1517
|
+
let S = b && b[f];
|
|
1518
1518
|
if (S)
|
|
1519
|
-
return S.call(
|
|
1519
|
+
return S.call(b);
|
|
1520
1520
|
throw new g(`Response type '${f}' is not supported`, g.ERR_NOT_SUPPORT, h);
|
|
1521
1521
|
});
|
|
1522
1522
|
});
|
|
@@ -1526,7 +1526,7 @@ const Pt = (t) => {
|
|
|
1526
1526
|
if (a.isBlob(f))
|
|
1527
1527
|
return f.size;
|
|
1528
1528
|
if (a.isSpecCompliantForm(f))
|
|
1529
|
-
return (await new r(
|
|
1529
|
+
return (await new r(L.origin, {
|
|
1530
1530
|
method: "POST",
|
|
1531
1531
|
body: f
|
|
1532
1532
|
}).arrayBuffer()).byteLength;
|
|
@@ -1534,97 +1534,97 @@ const Pt = (t) => {
|
|
|
1534
1534
|
return f.byteLength;
|
|
1535
1535
|
if (a.isURLSearchParams(f) && (f = f + ""), a.isString(f))
|
|
1536
1536
|
return (await p(f)).byteLength;
|
|
1537
|
-
}, R = async (f,
|
|
1537
|
+
}, R = async (f, b) => {
|
|
1538
1538
|
const h = a.toFiniteNumber(f.getContentLength());
|
|
1539
|
-
return h ?? w(
|
|
1539
|
+
return h ?? w(b);
|
|
1540
1540
|
};
|
|
1541
1541
|
return async (f) => {
|
|
1542
1542
|
let {
|
|
1543
|
-
url:
|
|
1543
|
+
url: b,
|
|
1544
1544
|
method: h,
|
|
1545
1545
|
data: S,
|
|
1546
1546
|
signal: j,
|
|
1547
|
-
cancelToken:
|
|
1548
|
-
timeout:
|
|
1549
|
-
onDownloadProgress:
|
|
1550
|
-
onUploadProgress:
|
|
1551
|
-
responseType:
|
|
1552
|
-
headers:
|
|
1553
|
-
withCredentials:
|
|
1547
|
+
cancelToken: x,
|
|
1548
|
+
timeout: N,
|
|
1549
|
+
onDownloadProgress: _,
|
|
1550
|
+
onUploadProgress: q,
|
|
1551
|
+
responseType: k,
|
|
1552
|
+
headers: U,
|
|
1553
|
+
withCredentials: I = "same-origin",
|
|
1554
1554
|
fetchOptions: pe
|
|
1555
|
-
} =
|
|
1556
|
-
|
|
1557
|
-
let
|
|
1558
|
-
const
|
|
1559
|
-
|
|
1555
|
+
} = jt(f), me = e || fetch;
|
|
1556
|
+
k = k ? (k + "").toLowerCase() : "text";
|
|
1557
|
+
let W = fn([j, x && x.toAbortSignal()], N), V = null;
|
|
1558
|
+
const z = W && W.unsubscribe && (() => {
|
|
1559
|
+
W.unsubscribe();
|
|
1560
1560
|
});
|
|
1561
|
-
let
|
|
1561
|
+
let Q;
|
|
1562
1562
|
try {
|
|
1563
|
-
if (
|
|
1564
|
-
let l = new r(
|
|
1563
|
+
if (q && d && h !== "get" && h !== "head" && (Q = await R(U, S)) !== 0) {
|
|
1564
|
+
let l = new r(b, {
|
|
1565
1565
|
method: "POST",
|
|
1566
1566
|
body: S,
|
|
1567
1567
|
duplex: "half"
|
|
1568
1568
|
}), E;
|
|
1569
|
-
if (a.isFormData(S) && (E = l.headers.get("content-type")) &&
|
|
1569
|
+
if (a.isFormData(S) && (E = l.headers.get("content-type")) && U.setContentType(E), l.body) {
|
|
1570
1570
|
const [T, A] = rt(
|
|
1571
|
-
|
|
1572
|
-
|
|
1571
|
+
Q,
|
|
1572
|
+
Te(nt(q))
|
|
1573
1573
|
);
|
|
1574
1574
|
S = ot(l.body, it, T, A);
|
|
1575
1575
|
}
|
|
1576
1576
|
}
|
|
1577
|
-
a.isString(
|
|
1578
|
-
const
|
|
1577
|
+
a.isString(I) || (I = I ? "include" : "omit");
|
|
1578
|
+
const P = o && "credentials" in r.prototype, re = {
|
|
1579
1579
|
...pe,
|
|
1580
|
-
signal:
|
|
1580
|
+
signal: W,
|
|
1581
1581
|
method: h.toUpperCase(),
|
|
1582
|
-
headers:
|
|
1582
|
+
headers: U.normalize().toJSON(),
|
|
1583
1583
|
body: S,
|
|
1584
1584
|
duplex: "half",
|
|
1585
|
-
credentials:
|
|
1585
|
+
credentials: P ? I : void 0
|
|
1586
1586
|
};
|
|
1587
|
-
|
|
1588
|
-
let
|
|
1589
|
-
const ne = u && (
|
|
1590
|
-
if (u && (
|
|
1587
|
+
V = o && new r(b, re);
|
|
1588
|
+
let M = await (o ? me(V, pe) : me(b, re));
|
|
1589
|
+
const ne = u && (k === "stream" || k === "response");
|
|
1590
|
+
if (u && (_ || ne && z)) {
|
|
1591
1591
|
const l = {};
|
|
1592
1592
|
["status", "statusText", "headers"].forEach((J) => {
|
|
1593
|
-
l[J] =
|
|
1593
|
+
l[J] = M[J];
|
|
1594
1594
|
});
|
|
1595
|
-
const E = a.toFiniteNumber(
|
|
1595
|
+
const E = a.toFiniteNumber(M.headers.get("content-length")), [T, A] = _ && rt(
|
|
1596
1596
|
E,
|
|
1597
|
-
|
|
1597
|
+
Te(nt(_), !0)
|
|
1598
1598
|
) || [];
|
|
1599
|
-
|
|
1600
|
-
ot(
|
|
1601
|
-
A && A(),
|
|
1599
|
+
M = new n(
|
|
1600
|
+
ot(M.body, it, T, () => {
|
|
1601
|
+
A && A(), z && z();
|
|
1602
1602
|
}),
|
|
1603
1603
|
l
|
|
1604
1604
|
);
|
|
1605
1605
|
}
|
|
1606
|
-
|
|
1607
|
-
let ye = await
|
|
1608
|
-
return !ne &&
|
|
1606
|
+
k = k || "text";
|
|
1607
|
+
let ye = await y[a.findKey(y, k) || "text"](M, f);
|
|
1608
|
+
return !ne && z && z(), await new Promise((l, E) => {
|
|
1609
1609
|
Nt(l, E, {
|
|
1610
1610
|
data: ye,
|
|
1611
|
-
headers:
|
|
1612
|
-
status:
|
|
1613
|
-
statusText:
|
|
1611
|
+
headers: B.from(M.headers),
|
|
1612
|
+
status: M.status,
|
|
1613
|
+
statusText: M.statusText,
|
|
1614
1614
|
config: f,
|
|
1615
|
-
request:
|
|
1615
|
+
request: V
|
|
1616
1616
|
});
|
|
1617
1617
|
});
|
|
1618
|
-
} catch (
|
|
1619
|
-
throw
|
|
1620
|
-
new g("Network Error", g.ERR_NETWORK, f,
|
|
1618
|
+
} catch (P) {
|
|
1619
|
+
throw z && z(), P && P.name === "TypeError" && /Load failed|fetch/i.test(P.message) ? Object.assign(
|
|
1620
|
+
new g("Network Error", g.ERR_NETWORK, f, V, P && P.response),
|
|
1621
1621
|
{
|
|
1622
|
-
cause:
|
|
1622
|
+
cause: P.cause || P
|
|
1623
1623
|
}
|
|
1624
|
-
) : g.from(
|
|
1624
|
+
) : g.from(P, P && P.code, f, V, P && P.response);
|
|
1625
1625
|
}
|
|
1626
1626
|
};
|
|
1627
|
-
}, bn = /* @__PURE__ */ new Map(),
|
|
1627
|
+
}, bn = /* @__PURE__ */ new Map(), Pt = (t) => {
|
|
1628
1628
|
let e = t && t.env || {};
|
|
1629
1629
|
const { fetch: r, Request: n, Response: s } = e, o = [
|
|
1630
1630
|
n,
|
|
@@ -1636,15 +1636,15 @@ const Pt = (t) => {
|
|
|
1636
1636
|
p = o[c], d = u.get(p), d === void 0 && u.set(p, d = c ? /* @__PURE__ */ new Map() : yn(e)), u = d;
|
|
1637
1637
|
return d;
|
|
1638
1638
|
};
|
|
1639
|
-
|
|
1640
|
-
const
|
|
1639
|
+
Pt();
|
|
1640
|
+
const Je = {
|
|
1641
1641
|
http: kr,
|
|
1642
1642
|
xhr: un,
|
|
1643
1643
|
fetch: {
|
|
1644
|
-
get:
|
|
1644
|
+
get: Pt
|
|
1645
1645
|
}
|
|
1646
1646
|
};
|
|
1647
|
-
a.forEach(
|
|
1647
|
+
a.forEach(Je, (t, e) => {
|
|
1648
1648
|
if (t) {
|
|
1649
1649
|
try {
|
|
1650
1650
|
Object.defineProperty(t, "name", { value: e });
|
|
@@ -1662,7 +1662,7 @@ function En(t, e) {
|
|
|
1662
1662
|
for (let i = 0; i < r; i++) {
|
|
1663
1663
|
n = t[i];
|
|
1664
1664
|
let c;
|
|
1665
|
-
if (s = n, !gn(n) && (s =
|
|
1665
|
+
if (s = n, !gn(n) && (s = Je[(c = String(n)).toLowerCase()], s === void 0))
|
|
1666
1666
|
throw new g(`Unknown adapter '${c}'`);
|
|
1667
1667
|
if (s && (a.isFunction(s) || (s = s.get(e))))
|
|
1668
1668
|
break;
|
|
@@ -1692,38 +1692,38 @@ const vt = {
|
|
|
1692
1692
|
* Exposes all known adapters
|
|
1693
1693
|
* @type {Object<string, Function|Object>}
|
|
1694
1694
|
*/
|
|
1695
|
-
adapters:
|
|
1695
|
+
adapters: Je
|
|
1696
1696
|
};
|
|
1697
|
-
function
|
|
1697
|
+
function ke(t) {
|
|
1698
1698
|
if (t.cancelToken && t.cancelToken.throwIfRequested(), t.signal && t.signal.aborted)
|
|
1699
1699
|
throw new de(null, t);
|
|
1700
1700
|
}
|
|
1701
1701
|
function ft(t) {
|
|
1702
|
-
return
|
|
1702
|
+
return ke(t), t.headers = B.from(t.headers), t.data = ve.call(
|
|
1703
1703
|
t,
|
|
1704
1704
|
t.transformRequest
|
|
1705
1705
|
), ["post", "put", "patch"].indexOf(t.method) !== -1 && t.headers.setContentType("application/x-www-form-urlencoded", !1), vt.getAdapter(t.adapter || fe.adapter, t)(t).then(function(n) {
|
|
1706
|
-
return
|
|
1706
|
+
return ke(t), n.data = ve.call(
|
|
1707
1707
|
t,
|
|
1708
1708
|
t.transformResponse,
|
|
1709
1709
|
n
|
|
1710
|
-
), n.headers =
|
|
1710
|
+
), n.headers = B.from(n.headers), n;
|
|
1711
1711
|
}, function(n) {
|
|
1712
|
-
return
|
|
1712
|
+
return _t(n) || (ke(t), n && n.response && (n.response.data = ve.call(
|
|
1713
1713
|
t,
|
|
1714
1714
|
t.transformResponse,
|
|
1715
1715
|
n.response
|
|
1716
|
-
), n.response.headers =
|
|
1716
|
+
), n.response.headers = B.from(n.response.headers))), Promise.reject(n);
|
|
1717
1717
|
});
|
|
1718
1718
|
}
|
|
1719
|
-
const kt = "1.13.5",
|
|
1719
|
+
const kt = "1.13.5", Ne = {};
|
|
1720
1720
|
["object", "boolean", "number", "function", "string", "symbol"].forEach((t, e) => {
|
|
1721
|
-
|
|
1721
|
+
Ne[t] = function(n) {
|
|
1722
1722
|
return typeof n === t || "a" + (e < 1 ? "n " : " ") + t;
|
|
1723
1723
|
};
|
|
1724
1724
|
});
|
|
1725
1725
|
const dt = {};
|
|
1726
|
-
|
|
1726
|
+
Ne.transitional = function(e, r, n) {
|
|
1727
1727
|
function s(o, i) {
|
|
1728
1728
|
return "[Axios v" + kt + "] Transitional option '" + o + "'" + i + (n ? ". " + n : "");
|
|
1729
1729
|
}
|
|
@@ -1741,7 +1741,7 @@ Oe.transitional = function(e, r, n) {
|
|
|
1741
1741
|
)), e ? e(o, i, c) : !0;
|
|
1742
1742
|
};
|
|
1743
1743
|
};
|
|
1744
|
-
|
|
1744
|
+
Ne.spelling = function(e) {
|
|
1745
1745
|
return (r, n) => (console.warn(`${n} is likely a misspelling of ${e}`), !0);
|
|
1746
1746
|
};
|
|
1747
1747
|
function wn(t, e, r) {
|
|
@@ -1763,9 +1763,9 @@ function wn(t, e, r) {
|
|
|
1763
1763
|
}
|
|
1764
1764
|
const Re = {
|
|
1765
1765
|
assertOptions: wn,
|
|
1766
|
-
validators:
|
|
1767
|
-
},
|
|
1768
|
-
let
|
|
1766
|
+
validators: Ne
|
|
1767
|
+
}, D = Re.validators;
|
|
1768
|
+
let X = class {
|
|
1769
1769
|
constructor(e) {
|
|
1770
1770
|
this.defaults = e || {}, this.interceptors = {
|
|
1771
1771
|
request: new et(),
|
|
@@ -1798,21 +1798,21 @@ let Y = class {
|
|
|
1798
1798
|
}
|
|
1799
1799
|
}
|
|
1800
1800
|
_request(e, r) {
|
|
1801
|
-
typeof e == "string" ? (r = r || {}, r.url = e) : r = e || {}, r =
|
|
1801
|
+
typeof e == "string" ? (r = r || {}, r.url = e) : r = e || {}, r = G(this.defaults, r);
|
|
1802
1802
|
const { transitional: n, paramsSerializer: s, headers: o } = r;
|
|
1803
1803
|
n !== void 0 && Re.assertOptions(n, {
|
|
1804
|
-
silentJSONParsing:
|
|
1805
|
-
forcedJSONParsing:
|
|
1806
|
-
clarifyTimeoutError:
|
|
1807
|
-
legacyInterceptorReqResOrdering:
|
|
1804
|
+
silentJSONParsing: D.transitional(D.boolean),
|
|
1805
|
+
forcedJSONParsing: D.transitional(D.boolean),
|
|
1806
|
+
clarifyTimeoutError: D.transitional(D.boolean),
|
|
1807
|
+
legacyInterceptorReqResOrdering: D.transitional(D.boolean)
|
|
1808
1808
|
}, !1), s != null && (a.isFunction(s) ? r.paramsSerializer = {
|
|
1809
1809
|
serialize: s
|
|
1810
1810
|
} : Re.assertOptions(s, {
|
|
1811
|
-
encode:
|
|
1812
|
-
serialize:
|
|
1811
|
+
encode: D.function,
|
|
1812
|
+
serialize: D.function
|
|
1813
1813
|
}, !0)), r.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? r.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : r.allowAbsoluteUrls = !0), Re.assertOptions(r, {
|
|
1814
|
-
baseUrl:
|
|
1815
|
-
withXsrfToken:
|
|
1814
|
+
baseUrl: D.spelling("baseURL"),
|
|
1815
|
+
withXsrfToken: D.spelling("withXSRFToken")
|
|
1816
1816
|
}, !0), r.method = (r.method || this.defaults.method || "get").toLowerCase();
|
|
1817
1817
|
let i = o && a.merge(
|
|
1818
1818
|
o.common,
|
|
@@ -1823,35 +1823,35 @@ let Y = class {
|
|
|
1823
1823
|
(f) => {
|
|
1824
1824
|
delete o[f];
|
|
1825
1825
|
}
|
|
1826
|
-
), r.headers =
|
|
1826
|
+
), r.headers = B.concat(i, o);
|
|
1827
1827
|
const c = [];
|
|
1828
1828
|
let p = !0;
|
|
1829
|
-
this.interceptors.request.forEach(function(
|
|
1830
|
-
if (typeof
|
|
1829
|
+
this.interceptors.request.forEach(function(b) {
|
|
1830
|
+
if (typeof b.runWhen == "function" && b.runWhen(r) === !1)
|
|
1831
1831
|
return;
|
|
1832
|
-
p = p &&
|
|
1832
|
+
p = p && b.synchronous;
|
|
1833
1833
|
const h = r.transitional || We;
|
|
1834
|
-
h && h.legacyInterceptorReqResOrdering ? c.unshift(
|
|
1834
|
+
h && h.legacyInterceptorReqResOrdering ? c.unshift(b.fulfilled, b.rejected) : c.push(b.fulfilled, b.rejected);
|
|
1835
1835
|
});
|
|
1836
1836
|
const d = [];
|
|
1837
|
-
this.interceptors.response.forEach(function(
|
|
1838
|
-
d.push(
|
|
1837
|
+
this.interceptors.response.forEach(function(b) {
|
|
1838
|
+
d.push(b.fulfilled, b.rejected);
|
|
1839
1839
|
});
|
|
1840
|
-
let u,
|
|
1840
|
+
let u, y = 0, w;
|
|
1841
1841
|
if (!p) {
|
|
1842
1842
|
const f = [ft.bind(this), void 0];
|
|
1843
|
-
for (f.unshift(...c), f.push(...d), w = f.length, u = Promise.resolve(r);
|
|
1844
|
-
u = u.then(f[
|
|
1843
|
+
for (f.unshift(...c), f.push(...d), w = f.length, u = Promise.resolve(r); y < w; )
|
|
1844
|
+
u = u.then(f[y++], f[y++]);
|
|
1845
1845
|
return u;
|
|
1846
1846
|
}
|
|
1847
1847
|
w = c.length;
|
|
1848
1848
|
let R = r;
|
|
1849
|
-
for (;
|
|
1850
|
-
const f = c[
|
|
1849
|
+
for (; y < w; ) {
|
|
1850
|
+
const f = c[y++], b = c[y++];
|
|
1851
1851
|
try {
|
|
1852
1852
|
R = f(R);
|
|
1853
1853
|
} catch (h) {
|
|
1854
|
-
|
|
1854
|
+
b.call(this, h);
|
|
1855
1855
|
break;
|
|
1856
1856
|
}
|
|
1857
1857
|
}
|
|
@@ -1860,19 +1860,19 @@ let Y = class {
|
|
|
1860
1860
|
} catch (f) {
|
|
1861
1861
|
return Promise.reject(f);
|
|
1862
1862
|
}
|
|
1863
|
-
for (
|
|
1864
|
-
u = u.then(d[
|
|
1863
|
+
for (y = 0, w = d.length; y < w; )
|
|
1864
|
+
u = u.then(d[y++], d[y++]);
|
|
1865
1865
|
return u;
|
|
1866
1866
|
}
|
|
1867
1867
|
getUri(e) {
|
|
1868
|
-
e =
|
|
1868
|
+
e = G(this.defaults, e);
|
|
1869
1869
|
const r = Ct(e.baseURL, e.url, e.allowAbsoluteUrls);
|
|
1870
1870
|
return xt(r, e.params, e.paramsSerializer);
|
|
1871
1871
|
}
|
|
1872
1872
|
};
|
|
1873
1873
|
a.forEach(["delete", "get", "head", "options"], function(e) {
|
|
1874
|
-
|
|
1875
|
-
return this.request(
|
|
1874
|
+
X.prototype[e] = function(r, n) {
|
|
1875
|
+
return this.request(G(n || {}, {
|
|
1876
1876
|
method: e,
|
|
1877
1877
|
url: r,
|
|
1878
1878
|
data: (n || {}).data
|
|
@@ -1882,7 +1882,7 @@ a.forEach(["delete", "get", "head", "options"], function(e) {
|
|
|
1882
1882
|
a.forEach(["post", "put", "patch"], function(e) {
|
|
1883
1883
|
function r(n) {
|
|
1884
1884
|
return function(o, i, c) {
|
|
1885
|
-
return this.request(
|
|
1885
|
+
return this.request(G(c || {}, {
|
|
1886
1886
|
method: e,
|
|
1887
1887
|
headers: n ? {
|
|
1888
1888
|
"Content-Type": "multipart/form-data"
|
|
@@ -1892,7 +1892,7 @@ a.forEach(["post", "put", "patch"], function(e) {
|
|
|
1892
1892
|
}));
|
|
1893
1893
|
};
|
|
1894
1894
|
}
|
|
1895
|
-
|
|
1895
|
+
X.prototype[e] = r(), X.prototype[e + "Form"] = r(!0);
|
|
1896
1896
|
});
|
|
1897
1897
|
let Rn = class Lt {
|
|
1898
1898
|
constructor(e) {
|
|
@@ -1975,7 +1975,7 @@ function Sn(t) {
|
|
|
1975
1975
|
function Tn(t) {
|
|
1976
1976
|
return a.isObject(t) && t.isAxiosError === !0;
|
|
1977
1977
|
}
|
|
1978
|
-
const
|
|
1978
|
+
const qe = {
|
|
1979
1979
|
Continue: 100,
|
|
1980
1980
|
SwitchingProtocols: 101,
|
|
1981
1981
|
Processing: 102,
|
|
@@ -2046,35 +2046,35 @@ const De = {
|
|
|
2046
2046
|
SslHandshakeFailed: 525,
|
|
2047
2047
|
InvalidSslCertificate: 526
|
|
2048
2048
|
};
|
|
2049
|
-
Object.entries(
|
|
2050
|
-
|
|
2049
|
+
Object.entries(qe).forEach(([t, e]) => {
|
|
2050
|
+
qe[e] = t;
|
|
2051
2051
|
});
|
|
2052
2052
|
function Ut(t) {
|
|
2053
|
-
const e = new
|
|
2054
|
-
return a.extend(r,
|
|
2055
|
-
return Ut(
|
|
2053
|
+
const e = new X(t), r = pt(X.prototype.request, e);
|
|
2054
|
+
return a.extend(r, X.prototype, e, { allOwnKeys: !0 }), a.extend(r, e, null, { allOwnKeys: !0 }), r.create = function(s) {
|
|
2055
|
+
return Ut(G(t, s));
|
|
2056
2056
|
}, r;
|
|
2057
2057
|
}
|
|
2058
|
-
const
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2058
|
+
const O = Ut(fe);
|
|
2059
|
+
O.Axios = X;
|
|
2060
|
+
O.CanceledError = de;
|
|
2061
|
+
O.CancelToken = Rn;
|
|
2062
|
+
O.isCancel = _t;
|
|
2063
|
+
O.VERSION = kt;
|
|
2064
|
+
O.toFormData = _e;
|
|
2065
|
+
O.AxiosError = g;
|
|
2066
|
+
O.Cancel = O.CanceledError;
|
|
2067
|
+
O.all = function(e) {
|
|
2068
2068
|
return Promise.all(e);
|
|
2069
2069
|
};
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2070
|
+
O.spread = Sn;
|
|
2071
|
+
O.isAxiosError = Tn;
|
|
2072
|
+
O.mergeConfig = G;
|
|
2073
|
+
O.AxiosHeaders = B;
|
|
2074
|
+
O.formToJSON = (t) => Ot(a.isHTMLForm(t) ? new FormData(t) : t);
|
|
2075
|
+
O.getAdapter = vt.getAdapter;
|
|
2076
|
+
O.HttpStatusCode = qe;
|
|
2077
|
+
O.default = O;
|
|
2078
2078
|
const {
|
|
2079
2079
|
Axios: Un,
|
|
2080
2080
|
AxiosError: In,
|
|
@@ -2087,37 +2087,37 @@ const {
|
|
|
2087
2087
|
isAxiosError: $n,
|
|
2088
2088
|
spread: zn,
|
|
2089
2089
|
toFormData: Wn,
|
|
2090
|
-
AxiosHeaders:
|
|
2091
|
-
HttpStatusCode:
|
|
2090
|
+
AxiosHeaders: Vn,
|
|
2091
|
+
HttpStatusCode: Jn,
|
|
2092
2092
|
formToJSON: Kn,
|
|
2093
2093
|
getAdapter: Yn,
|
|
2094
2094
|
mergeConfig: Xn
|
|
2095
|
-
} =
|
|
2095
|
+
} = O, An = "https://authifyer-backend.onrender.com", H = O.create({
|
|
2096
2096
|
baseURL: An,
|
|
2097
2097
|
headers: {
|
|
2098
2098
|
"Content-Type": "application/json"
|
|
2099
2099
|
}
|
|
2100
|
-
}),
|
|
2100
|
+
}), Me = "authifyer_access_token", Le = (t) => {
|
|
2101
2101
|
try {
|
|
2102
|
-
t ? (localStorage.setItem(
|
|
2102
|
+
t ? (localStorage.setItem(Me, t), H.defaults.headers.common.Authorization = `Bearer ${t}`) : (localStorage.removeItem(Me), delete H.defaults.headers.common.Authorization);
|
|
2103
2103
|
} catch (e) {
|
|
2104
2104
|
console.warn("Authifyer: localStorage is not accessible.", e);
|
|
2105
2105
|
}
|
|
2106
2106
|
}, xn = () => {
|
|
2107
2107
|
try {
|
|
2108
|
-
return localStorage.getItem(
|
|
2108
|
+
return localStorage.getItem(Me);
|
|
2109
2109
|
} catch {
|
|
2110
2110
|
return null;
|
|
2111
2111
|
}
|
|
2112
|
-
},
|
|
2112
|
+
}, He = "authifyer_refresh_token", Ue = (t) => {
|
|
2113
2113
|
try {
|
|
2114
|
-
t ? localStorage.setItem(
|
|
2114
|
+
t ? localStorage.setItem(He, t) : localStorage.removeItem(He);
|
|
2115
2115
|
} catch (e) {
|
|
2116
2116
|
console.warn("Authifyer: localStorage is not accessible. Session persistence may fail.", e), typeof window < "u" && window.dispatchEvent(new CustomEvent("auth:storage_error"));
|
|
2117
2117
|
}
|
|
2118
|
-
},
|
|
2118
|
+
}, Ie = () => {
|
|
2119
2119
|
try {
|
|
2120
|
-
return localStorage.getItem(
|
|
2120
|
+
return localStorage.getItem(He);
|
|
2121
2121
|
} catch (t) {
|
|
2122
2122
|
return console.warn("Authifyer: localStorage is not accessible. Session persistence may fail.", t), typeof window < "u" && window.dispatchEvent(new CustomEvent("auth:storage_error")), null;
|
|
2123
2123
|
}
|
|
@@ -2125,13 +2125,13 @@ const {
|
|
|
2125
2125
|
class ae extends Error {
|
|
2126
2126
|
}
|
|
2127
2127
|
ae.prototype.name = "InvalidTokenError";
|
|
2128
|
-
function
|
|
2128
|
+
function On(t) {
|
|
2129
2129
|
return decodeURIComponent(atob(t).replace(/(.)/g, (e, r) => {
|
|
2130
2130
|
let n = r.charCodeAt(0).toString(16).toUpperCase();
|
|
2131
2131
|
return n.length < 2 && (n = "0" + n), "%" + n;
|
|
2132
2132
|
}));
|
|
2133
2133
|
}
|
|
2134
|
-
function
|
|
2134
|
+
function _n(t) {
|
|
2135
2135
|
let e = t.replace(/-/g, "+").replace(/_/g, "/");
|
|
2136
2136
|
switch (e.length % 4) {
|
|
2137
2137
|
case 0:
|
|
@@ -2146,7 +2146,7 @@ function On(t) {
|
|
|
2146
2146
|
throw new Error("base64 string is not of the correct length");
|
|
2147
2147
|
}
|
|
2148
2148
|
try {
|
|
2149
|
-
return
|
|
2149
|
+
return On(e);
|
|
2150
2150
|
} catch {
|
|
2151
2151
|
return atob(e);
|
|
2152
2152
|
}
|
|
@@ -2160,7 +2160,7 @@ function Nn(t, e) {
|
|
|
2160
2160
|
throw new ae(`Invalid token specified: missing part #${r + 1}`);
|
|
2161
2161
|
let s;
|
|
2162
2162
|
try {
|
|
2163
|
-
s =
|
|
2163
|
+
s = _n(n);
|
|
2164
2164
|
} catch (o) {
|
|
2165
2165
|
throw new ae(`Invalid token specified: invalid base64 for part #${r + 1} (${o.message})`);
|
|
2166
2166
|
}
|
|
@@ -2197,21 +2197,21 @@ const ht = (t) => {
|
|
|
2197
2197
|
};
|
|
2198
2198
|
class Cn {
|
|
2199
2199
|
constructor(e, r) {
|
|
2200
|
-
|
|
2201
|
-
|
|
2200
|
+
K(this, "publishableKey");
|
|
2201
|
+
K(this, "refreshTimer", null);
|
|
2202
2202
|
// State
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
this.publishableKey = e, r != null && r.backendUrl && (
|
|
2203
|
+
K(this, "session", null);
|
|
2204
|
+
K(this, "config", null);
|
|
2205
|
+
K(this, "isLoading", !0);
|
|
2206
|
+
K(this, "listeners", []);
|
|
2207
|
+
this.publishableKey = e, r != null && r.backendUrl && (H.defaults.baseURL = r.backendUrl);
|
|
2208
2208
|
}
|
|
2209
2209
|
// --- API Methods ---
|
|
2210
2210
|
async load() {
|
|
2211
2211
|
try {
|
|
2212
2212
|
this.isLoading = !0, this.notifyListeners();
|
|
2213
2213
|
try {
|
|
2214
|
-
const n = (await
|
|
2214
|
+
const n = (await H.get(`/public/config/${this.publishableKey}`)).data, s = [];
|
|
2215
2215
|
n.isGoogleOauthEnabled && s.push("google"), n.isGithubOauthEnabled && s.push("github"), this.config = {
|
|
2216
2216
|
emailPasswordEnabled: n.isEmailPassEnabled,
|
|
2217
2217
|
oauthProviders: s
|
|
@@ -2225,7 +2225,7 @@ class Cn {
|
|
|
2225
2225
|
const e = xn();
|
|
2226
2226
|
if (e) {
|
|
2227
2227
|
const r = ht(e);
|
|
2228
|
-
r && (this.session = r,
|
|
2228
|
+
r && (this.session = r, Le(e), this.startRefreshTimer());
|
|
2229
2229
|
}
|
|
2230
2230
|
this.session || await this.refreshSession();
|
|
2231
2231
|
} catch (e) {
|
|
@@ -2237,7 +2237,7 @@ class Cn {
|
|
|
2237
2237
|
// --- Auth Actions ---
|
|
2238
2238
|
async signInWithEmail(e, r) {
|
|
2239
2239
|
try {
|
|
2240
|
-
const n = await
|
|
2240
|
+
const n = await H.post("/authifyer/project/login/email", {
|
|
2241
2241
|
email: e,
|
|
2242
2242
|
password: r,
|
|
2243
2243
|
publicProjectId: this.publishableKey
|
|
@@ -2250,20 +2250,30 @@ class Cn {
|
|
|
2250
2250
|
}
|
|
2251
2251
|
async signUpWithEmail(e, r) {
|
|
2252
2252
|
try {
|
|
2253
|
-
const n = await
|
|
2253
|
+
const n = await H.post("/authifyer/project/register/email", {
|
|
2254
2254
|
email: e,
|
|
2255
2255
|
password: r,
|
|
2256
2256
|
publicProjectId: this.publishableKey
|
|
2257
2257
|
});
|
|
2258
|
-
this.handleAuthResponse(n.data);
|
|
2258
|
+
return this.handleAuthResponse(n.data), n.data;
|
|
2259
|
+
} catch (n) {
|
|
2260
|
+
throw n;
|
|
2261
|
+
}
|
|
2262
|
+
}
|
|
2263
|
+
async verifyEmail(e, r) {
|
|
2264
|
+
try {
|
|
2265
|
+
await H.post("/api/auth/verify-email", {
|
|
2266
|
+
token: e,
|
|
2267
|
+
subjectId: r
|
|
2268
|
+
});
|
|
2259
2269
|
} catch (n) {
|
|
2260
2270
|
throw n;
|
|
2261
2271
|
}
|
|
2262
2272
|
}
|
|
2263
2273
|
async signOut() {
|
|
2264
2274
|
try {
|
|
2265
|
-
const e =
|
|
2266
|
-
await
|
|
2275
|
+
const e = Ie();
|
|
2276
|
+
await H.post("/authifyer/session/logout", {
|
|
2267
2277
|
refresh_token: e || void 0
|
|
2268
2278
|
});
|
|
2269
2279
|
} catch (e) {
|
|
@@ -2273,25 +2283,25 @@ class Cn {
|
|
|
2273
2283
|
}
|
|
2274
2284
|
}
|
|
2275
2285
|
signInWithOAuth(e) {
|
|
2276
|
-
const r = window.location.origin, n = `${
|
|
2286
|
+
const r = window.location.origin, n = `${H.defaults.baseURL}/oauth2/authorization/${e}?publishable_key=${this.publishableKey}&redirect_uri=${r}`;
|
|
2277
2287
|
window.location.href = n;
|
|
2278
2288
|
}
|
|
2279
2289
|
// --- Session Management ---
|
|
2280
2290
|
async refreshSession() {
|
|
2281
2291
|
try {
|
|
2282
|
-
const e =
|
|
2292
|
+
const e = Ie();
|
|
2283
2293
|
if (!e) {
|
|
2284
2294
|
this.clearSession();
|
|
2285
2295
|
return;
|
|
2286
2296
|
}
|
|
2287
|
-
const r = await
|
|
2297
|
+
const r = await H.post("/authifyer/jwt/refresh-jwt", {
|
|
2288
2298
|
refresh_token: e
|
|
2289
2299
|
}), { access_token: n, refresh_token: s } = r.data;
|
|
2290
2300
|
if (n) {
|
|
2291
2301
|
const o = n.accessToken || n;
|
|
2292
2302
|
this.setSession(o);
|
|
2293
2303
|
}
|
|
2294
|
-
s &&
|
|
2304
|
+
s && Ue(s);
|
|
2295
2305
|
} catch {
|
|
2296
2306
|
this.clearSession();
|
|
2297
2307
|
}
|
|
@@ -2303,8 +2313,8 @@ class Cn {
|
|
|
2303
2313
|
*/
|
|
2304
2314
|
async rotateSession() {
|
|
2305
2315
|
try {
|
|
2306
|
-
const e =
|
|
2307
|
-
await
|
|
2316
|
+
const e = Ie();
|
|
2317
|
+
await H.post("/authifyer/session/refresh", {
|
|
2308
2318
|
refresh_token: e || void 0
|
|
2309
2319
|
}), await this.refreshSession();
|
|
2310
2320
|
} catch (e) {
|
|
@@ -2312,14 +2322,14 @@ class Cn {
|
|
|
2312
2322
|
}
|
|
2313
2323
|
}
|
|
2314
2324
|
handleAuthResponse(e) {
|
|
2315
|
-
e.accessToken && this.setSession(e.accessToken), (e.refreshToken || e.refresh_token) &&
|
|
2325
|
+
e.accessToken && this.setSession(e.accessToken), (e.refreshToken || e.refresh_token) && Ue(e.refreshToken || e.refresh_token);
|
|
2316
2326
|
}
|
|
2317
2327
|
setSession(e) {
|
|
2318
2328
|
const r = ht(e);
|
|
2319
|
-
r && (this.session = r,
|
|
2329
|
+
r && (this.session = r, Le(e), this.startRefreshTimer(), this.notifyListeners());
|
|
2320
2330
|
}
|
|
2321
2331
|
clearSession() {
|
|
2322
|
-
this.session = null,
|
|
2332
|
+
this.session = null, Le(null), Ue(null), this.stopRefreshTimer(), this.notifyListeners();
|
|
2323
2333
|
}
|
|
2324
2334
|
// --- Timer ---
|
|
2325
2335
|
startRefreshTimer() {
|
|
@@ -2348,22 +2358,22 @@ const It = Mt(void 0), Gn = ({
|
|
|
2348
2358
|
}) => {
|
|
2349
2359
|
var f;
|
|
2350
2360
|
const s = Ht(() => {
|
|
2351
|
-
const
|
|
2361
|
+
const b = (
|
|
2352
2362
|
// @ts-ignore (Vite)
|
|
2353
2363
|
// @ts-ignore (Next.js / CRA)
|
|
2354
2364
|
typeof process < "u" && process.env && (process.env.NEXT_PUBLIC_AUTHIFYER_PUBLISHABLE_KEY || process.env.REACT_APP_AUTHIFYER_PUBLISHABLE_KEY)
|
|
2355
|
-
), h = t ||
|
|
2365
|
+
), h = t || b;
|
|
2356
2366
|
h || console.error("AuthifyerProvider requires a publishableKey either passed as a prop or set as an environment variable (e.g. VITE_AUTHIFYER_PUBLISHABLE_KEY, NEXT_PUBLIC_AUTHIFYER_PUBLISHABLE_KEY, REACT_APP_AUTHIFYER_PUBLISHABLE_KEY).");
|
|
2357
2367
|
const S = new Cn(h || "", { backendUrl: e });
|
|
2358
2368
|
return r && (S.config = r), S;
|
|
2359
|
-
}, [t, e, r]), [o, i] =
|
|
2369
|
+
}, [t, e, r]), [o, i] = v(((f = s.session) == null ? void 0 : f.user) || null), [c, p] = v(s.session), [d, u] = v(s.config), [y, w] = v(s.isLoading);
|
|
2360
2370
|
$t(() => {
|
|
2361
|
-
const
|
|
2371
|
+
const b = s.subscribe((h) => {
|
|
2362
2372
|
var S;
|
|
2363
2373
|
i(((S = h.session) == null ? void 0 : S.user) || null), p(h.session), r || u(h.config), w(h.isLoading);
|
|
2364
2374
|
});
|
|
2365
2375
|
return s.load(), () => {
|
|
2366
|
-
|
|
2376
|
+
b();
|
|
2367
2377
|
};
|
|
2368
2378
|
}, [s, r]);
|
|
2369
2379
|
const R = {
|
|
@@ -2371,9 +2381,9 @@ const It = Mt(void 0), Gn = ({
|
|
|
2371
2381
|
user: o,
|
|
2372
2382
|
session: c,
|
|
2373
2383
|
config: r || d,
|
|
2374
|
-
isLoading:
|
|
2384
|
+
isLoading: y
|
|
2375
2385
|
};
|
|
2376
|
-
return /* @__PURE__ */
|
|
2386
|
+
return /* @__PURE__ */ m.jsx(It.Provider, { value: R, children: n });
|
|
2377
2387
|
}, he = () => {
|
|
2378
2388
|
const t = zt(It);
|
|
2379
2389
|
if (t === void 0)
|
|
@@ -2388,21 +2398,21 @@ const It = Mt(void 0), Gn = ({
|
|
|
2388
2398
|
}, es = () => {
|
|
2389
2399
|
const { client: t } = he();
|
|
2390
2400
|
return t;
|
|
2391
|
-
},
|
|
2392
|
-
/* @__PURE__ */
|
|
2393
|
-
/* @__PURE__ */
|
|
2394
|
-
e && /* @__PURE__ */
|
|
2401
|
+
}, Se = ({ title: t, subtitle: e, children: r }) => /* @__PURE__ */ m.jsx("div", { className: "authifyer-root", children: /* @__PURE__ */ m.jsxs("div", { className: "authifyer-card", children: [
|
|
2402
|
+
/* @__PURE__ */ m.jsxs("div", { className: "authifyer-card-header", children: [
|
|
2403
|
+
/* @__PURE__ */ m.jsx("h2", { className: "authifyer-card-title", children: t }),
|
|
2404
|
+
e && /* @__PURE__ */ m.jsx("p", { className: "authifyer-card-subtitle", children: e })
|
|
2395
2405
|
] }),
|
|
2396
|
-
/* @__PURE__ */
|
|
2397
|
-
/* @__PURE__ */
|
|
2398
|
-
/* @__PURE__ */
|
|
2399
|
-
/* @__PURE__ */
|
|
2400
|
-
/* @__PURE__ */
|
|
2406
|
+
/* @__PURE__ */ m.jsx("div", { className: "authifyer-card-content", children: r }),
|
|
2407
|
+
/* @__PURE__ */ m.jsxs("div", { className: "authifyer-footer", children: [
|
|
2408
|
+
/* @__PURE__ */ m.jsx("span", { className: "authifyer-secured-text", children: "Secured by" }),
|
|
2409
|
+
/* @__PURE__ */ m.jsxs("span", { className: "authifyer-brand", children: [
|
|
2410
|
+
/* @__PURE__ */ m.jsx("svg", { className: "authifyer-logo-icon", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ m.jsx("path", { d: "M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5" }) }),
|
|
2401
2411
|
"Authifyer"
|
|
2402
2412
|
] })
|
|
2403
2413
|
] })
|
|
2404
2414
|
] }) }), ts = () => {
|
|
2405
|
-
const { client: t, config: e } = he(), [r, n] =
|
|
2415
|
+
const { client: t, config: e } = he(), [r, n] = v(""), [s, o] = v(""), [i, c] = v(""), [p, d] = v(!1), u = (e == null ? void 0 : e.emailPasswordEnabled) ?? !0, y = (e == null ? void 0 : e.oauthProviders) ?? ["google", "github"], w = async (R) => {
|
|
2406
2416
|
R.preventDefault(), d(!0), c("");
|
|
2407
2417
|
try {
|
|
2408
2418
|
await t.signInWithEmail(r, s);
|
|
@@ -2412,42 +2422,42 @@ const It = Mt(void 0), Gn = ({
|
|
|
2412
2422
|
d(!1);
|
|
2413
2423
|
}
|
|
2414
2424
|
};
|
|
2415
|
-
return /* @__PURE__ */
|
|
2416
|
-
i && /* @__PURE__ */
|
|
2417
|
-
(
|
|
2418
|
-
|
|
2425
|
+
return /* @__PURE__ */ m.jsxs(Se, { title: "Sign in", subtitle: "to continue to Authifyer", children: [
|
|
2426
|
+
i && /* @__PURE__ */ m.jsx("p", { className: "authifyer-error", children: i }),
|
|
2427
|
+
(y.includes("google") || y.includes("github")) && /* @__PURE__ */ m.jsxs("div", { className: "authifyer-form", children: [
|
|
2428
|
+
y.includes("google") && /* @__PURE__ */ m.jsxs(
|
|
2419
2429
|
"button",
|
|
2420
2430
|
{
|
|
2421
2431
|
className: "authifyer-provider-btn",
|
|
2422
2432
|
onClick: () => t.signInWithOAuth("google"),
|
|
2423
2433
|
children: [
|
|
2424
|
-
/* @__PURE__ */
|
|
2425
|
-
/* @__PURE__ */
|
|
2426
|
-
/* @__PURE__ */
|
|
2427
|
-
/* @__PURE__ */
|
|
2428
|
-
/* @__PURE__ */
|
|
2434
|
+
/* @__PURE__ */ m.jsxs("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
2435
|
+
/* @__PURE__ */ m.jsx("path", { d: "M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z", fill: "#4285F4" }),
|
|
2436
|
+
/* @__PURE__ */ m.jsx("path", { d: "M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z", fill: "#34A853" }),
|
|
2437
|
+
/* @__PURE__ */ m.jsx("path", { d: "M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z", fill: "#FBBC05" }),
|
|
2438
|
+
/* @__PURE__ */ m.jsx("path", { d: "M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z", fill: "#EA4335" })
|
|
2429
2439
|
] }),
|
|
2430
2440
|
"Continue with Google"
|
|
2431
2441
|
]
|
|
2432
2442
|
}
|
|
2433
2443
|
),
|
|
2434
|
-
|
|
2444
|
+
y.includes("github") && /* @__PURE__ */ m.jsxs(
|
|
2435
2445
|
"button",
|
|
2436
2446
|
{
|
|
2437
2447
|
className: "authifyer-provider-btn",
|
|
2438
2448
|
onClick: () => t.signInWithOAuth("github"),
|
|
2439
2449
|
children: [
|
|
2440
|
-
/* @__PURE__ */
|
|
2450
|
+
/* @__PURE__ */ m.jsx("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ m.jsx("path", { d: "M12 0C5.37 0 0 5.37 0 12c0 5.3 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z" }) }),
|
|
2441
2451
|
"Continue with GitHub"
|
|
2442
2452
|
]
|
|
2443
2453
|
}
|
|
2444
2454
|
)
|
|
2445
2455
|
] }),
|
|
2446
|
-
(
|
|
2447
|
-
u && /* @__PURE__ */
|
|
2448
|
-
/* @__PURE__ */
|
|
2449
|
-
/* @__PURE__ */
|
|
2450
|
-
/* @__PURE__ */
|
|
2456
|
+
(y.includes("google") || y.includes("github")) && u && /* @__PURE__ */ m.jsx("div", { className: "authifyer-divider", children: "or" }),
|
|
2457
|
+
u && /* @__PURE__ */ m.jsxs("form", { onSubmit: w, className: "authifyer-form", children: [
|
|
2458
|
+
/* @__PURE__ */ m.jsxs("div", { className: "authifyer-form-group", children: [
|
|
2459
|
+
/* @__PURE__ */ m.jsx("label", { className: "authifyer-label", children: "Email address" }),
|
|
2460
|
+
/* @__PURE__ */ m.jsx(
|
|
2451
2461
|
"input",
|
|
2452
2462
|
{
|
|
2453
2463
|
type: "email",
|
|
@@ -2458,9 +2468,9 @@ const It = Mt(void 0), Gn = ({
|
|
|
2458
2468
|
}
|
|
2459
2469
|
)
|
|
2460
2470
|
] }),
|
|
2461
|
-
/* @__PURE__ */
|
|
2462
|
-
/* @__PURE__ */
|
|
2463
|
-
/* @__PURE__ */
|
|
2471
|
+
/* @__PURE__ */ m.jsxs("div", { className: "authifyer-form-group", children: [
|
|
2472
|
+
/* @__PURE__ */ m.jsx("label", { className: "authifyer-label", children: "Password" }),
|
|
2473
|
+
/* @__PURE__ */ m.jsx(
|
|
2464
2474
|
"input",
|
|
2465
2475
|
{
|
|
2466
2476
|
type: "password",
|
|
@@ -2471,86 +2481,130 @@ const It = Mt(void 0), Gn = ({
|
|
|
2471
2481
|
}
|
|
2472
2482
|
)
|
|
2473
2483
|
] }),
|
|
2474
|
-
/* @__PURE__ */
|
|
2484
|
+
/* @__PURE__ */ m.jsx("button", { type: "submit", className: "authifyer-submit-btn", disabled: p, children: p ? "Signing In..." : "Continue" })
|
|
2475
2485
|
] })
|
|
2476
2486
|
] });
|
|
2477
2487
|
}, rs = () => {
|
|
2478
|
-
const { client: t, config: e } = he(), [r, n] =
|
|
2479
|
-
|
|
2488
|
+
const { client: t, config: e } = he(), [r, n] = v(""), [s, o] = v(""), [i, c] = v(""), [p, d] = v(!1), [u, y] = v(!1), [w, R] = v(null), [f, b] = v(""), [h, S] = v(""), [j, x] = v(!1), N = (e == null ? void 0 : e.emailPasswordEnabled) ?? !0, _ = (e == null ? void 0 : e.oauthProviders) ?? ["google", "github"], q = async (U) => {
|
|
2489
|
+
U.preventDefault(), d(!0), c("");
|
|
2480
2490
|
try {
|
|
2481
|
-
await t.signUpWithEmail(r, s)
|
|
2491
|
+
const I = await t.signUpWithEmail(r, s);
|
|
2492
|
+
I != null && I.subjectId ? R(I.subjectId) : y(!0);
|
|
2482
2493
|
} catch {
|
|
2483
2494
|
c("Registration failed. User might already exist.");
|
|
2484
2495
|
} finally {
|
|
2485
2496
|
d(!1);
|
|
2486
2497
|
}
|
|
2498
|
+
}, k = async (U) => {
|
|
2499
|
+
if (U.preventDefault(), !!w) {
|
|
2500
|
+
x(!0), S("");
|
|
2501
|
+
try {
|
|
2502
|
+
await t.verifyEmail(f, w), R(null), y(!0);
|
|
2503
|
+
} catch {
|
|
2504
|
+
S("Invalid authorization code. Please try again.");
|
|
2505
|
+
} finally {
|
|
2506
|
+
x(!1);
|
|
2507
|
+
}
|
|
2508
|
+
}
|
|
2487
2509
|
};
|
|
2488
|
-
return u ? /* @__PURE__ */
|
|
2489
|
-
/* @__PURE__ */
|
|
2490
|
-
/* @__PURE__ */
|
|
2491
|
-
/* @__PURE__ */
|
|
2492
|
-
/* @__PURE__ */
|
|
2510
|
+
return u ? /* @__PURE__ */ m.jsx(Se, { title: "Welcome!", children: /* @__PURE__ */ m.jsxs("div", { className: "authifyer-success", children: [
|
|
2511
|
+
/* @__PURE__ */ m.jsx("svg", { className: "authifyer-success-icon", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ m.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" }) }),
|
|
2512
|
+
/* @__PURE__ */ m.jsxs("div", { children: [
|
|
2513
|
+
/* @__PURE__ */ m.jsx("h3", { className: "authifyer-success-title", children: "Success" }),
|
|
2514
|
+
/* @__PURE__ */ m.jsx("p", { className: "authifyer-success-text", children: "Application authenticated. You are now logged in." })
|
|
2515
|
+
] })
|
|
2516
|
+
] }) }) : w ? /* @__PURE__ */ m.jsxs(Se, { title: "Verify your email", subtitle: `Code sent to ${r}`, children: [
|
|
2517
|
+
h && /* @__PURE__ */ m.jsx("p", { className: "authifyer-error", children: h }),
|
|
2518
|
+
/* @__PURE__ */ m.jsxs("form", { onSubmit: k, className: "authifyer-form", children: [
|
|
2519
|
+
/* @__PURE__ */ m.jsxs("div", { className: "authifyer-form-group", children: [
|
|
2520
|
+
/* @__PURE__ */ m.jsx("label", { className: "authifyer-label", style: { textAlign: "center" }, children: "Enter 6-digit Code" }),
|
|
2521
|
+
/* @__PURE__ */ m.jsx(
|
|
2522
|
+
"input",
|
|
2523
|
+
{
|
|
2524
|
+
type: "text",
|
|
2525
|
+
maxLength: 6,
|
|
2526
|
+
className: "authifyer-input",
|
|
2527
|
+
style: { textAlign: "center", letterSpacing: "0.25em", fontSize: "1.25rem", fontWeight: 600 },
|
|
2528
|
+
value: f,
|
|
2529
|
+
onChange: (U) => b(U.target.value.replace(/\D/g, "")),
|
|
2530
|
+
required: !0
|
|
2531
|
+
}
|
|
2532
|
+
)
|
|
2533
|
+
] }),
|
|
2534
|
+
/* @__PURE__ */ m.jsx("button", { type: "submit", className: "authifyer-submit-btn", disabled: j || f.length < 6, children: j ? "Verifying..." : "Verify Code" }),
|
|
2535
|
+
/* @__PURE__ */ m.jsx(
|
|
2536
|
+
"button",
|
|
2537
|
+
{
|
|
2538
|
+
type: "button",
|
|
2539
|
+
className: "authifyer-provider-btn",
|
|
2540
|
+
style: { marginTop: "0.5rem", border: "none", background: "transparent", color: "#666" },
|
|
2541
|
+
onClick: () => {
|
|
2542
|
+
R(null), b("");
|
|
2543
|
+
},
|
|
2544
|
+
children: "Back to Sign Up"
|
|
2545
|
+
}
|
|
2546
|
+
)
|
|
2493
2547
|
] })
|
|
2494
|
-
] })
|
|
2495
|
-
i && /* @__PURE__ */
|
|
2496
|
-
(
|
|
2497
|
-
|
|
2548
|
+
] }) : /* @__PURE__ */ m.jsxs(Se, { title: "Create your account", subtitle: "Welcome to Authifyer", children: [
|
|
2549
|
+
i && /* @__PURE__ */ m.jsx("p", { className: "authifyer-error", children: i }),
|
|
2550
|
+
(_.includes("google") || _.includes("github")) && /* @__PURE__ */ m.jsxs("div", { className: "authifyer-form", children: [
|
|
2551
|
+
_.includes("google") && /* @__PURE__ */ m.jsxs(
|
|
2498
2552
|
"button",
|
|
2499
2553
|
{
|
|
2500
2554
|
className: "authifyer-provider-btn",
|
|
2501
2555
|
onClick: () => t.signInWithOAuth("google"),
|
|
2502
2556
|
children: [
|
|
2503
|
-
/* @__PURE__ */
|
|
2504
|
-
/* @__PURE__ */
|
|
2505
|
-
/* @__PURE__ */
|
|
2506
|
-
/* @__PURE__ */
|
|
2507
|
-
/* @__PURE__ */
|
|
2557
|
+
/* @__PURE__ */ m.jsxs("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
2558
|
+
/* @__PURE__ */ m.jsx("path", { d: "M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z", fill: "#4285F4" }),
|
|
2559
|
+
/* @__PURE__ */ m.jsx("path", { d: "M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z", fill: "#34A853" }),
|
|
2560
|
+
/* @__PURE__ */ m.jsx("path", { d: "M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z", fill: "#FBBC05" }),
|
|
2561
|
+
/* @__PURE__ */ m.jsx("path", { d: "M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z", fill: "#EA4335" })
|
|
2508
2562
|
] }),
|
|
2509
2563
|
"Continue with Google"
|
|
2510
2564
|
]
|
|
2511
2565
|
}
|
|
2512
2566
|
),
|
|
2513
|
-
|
|
2567
|
+
_.includes("github") && /* @__PURE__ */ m.jsxs(
|
|
2514
2568
|
"button",
|
|
2515
2569
|
{
|
|
2516
2570
|
className: "authifyer-provider-btn",
|
|
2517
2571
|
onClick: () => t.signInWithOAuth("github"),
|
|
2518
2572
|
children: [
|
|
2519
|
-
/* @__PURE__ */
|
|
2573
|
+
/* @__PURE__ */ m.jsx("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ m.jsx("path", { d: "M12 0C5.37 0 0 5.37 0 12c0 5.3 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z" }) }),
|
|
2520
2574
|
"Continue with GitHub"
|
|
2521
2575
|
]
|
|
2522
2576
|
}
|
|
2523
2577
|
)
|
|
2524
2578
|
] }),
|
|
2525
|
-
(
|
|
2526
|
-
|
|
2527
|
-
/* @__PURE__ */
|
|
2528
|
-
/* @__PURE__ */
|
|
2529
|
-
/* @__PURE__ */
|
|
2579
|
+
(_.includes("google") || _.includes("github")) && N && /* @__PURE__ */ m.jsx("div", { className: "authifyer-divider", children: "or" }),
|
|
2580
|
+
N && /* @__PURE__ */ m.jsxs("form", { onSubmit: q, className: "authifyer-form", children: [
|
|
2581
|
+
/* @__PURE__ */ m.jsxs("div", { className: "authifyer-form-group", children: [
|
|
2582
|
+
/* @__PURE__ */ m.jsx("label", { className: "authifyer-label", children: "Email address" }),
|
|
2583
|
+
/* @__PURE__ */ m.jsx(
|
|
2530
2584
|
"input",
|
|
2531
2585
|
{
|
|
2532
2586
|
type: "email",
|
|
2533
2587
|
className: "authifyer-input",
|
|
2534
2588
|
value: r,
|
|
2535
|
-
onChange: (
|
|
2589
|
+
onChange: (U) => n(U.target.value),
|
|
2536
2590
|
required: !0
|
|
2537
2591
|
}
|
|
2538
2592
|
)
|
|
2539
2593
|
] }),
|
|
2540
|
-
/* @__PURE__ */
|
|
2541
|
-
/* @__PURE__ */
|
|
2542
|
-
/* @__PURE__ */
|
|
2594
|
+
/* @__PURE__ */ m.jsxs("div", { className: "authifyer-form-group", children: [
|
|
2595
|
+
/* @__PURE__ */ m.jsx("label", { className: "authifyer-label", children: "Password" }),
|
|
2596
|
+
/* @__PURE__ */ m.jsx(
|
|
2543
2597
|
"input",
|
|
2544
2598
|
{
|
|
2545
2599
|
type: "password",
|
|
2546
2600
|
className: "authifyer-input",
|
|
2547
2601
|
value: s,
|
|
2548
|
-
onChange: (
|
|
2602
|
+
onChange: (U) => o(U.target.value),
|
|
2549
2603
|
required: !0
|
|
2550
2604
|
}
|
|
2551
2605
|
)
|
|
2552
2606
|
] }),
|
|
2553
|
-
/* @__PURE__ */
|
|
2607
|
+
/* @__PURE__ */ m.jsx("button", { type: "submit", className: "authifyer-submit-btn", disabled: p, children: p ? "Signing Up..." : "Continue" })
|
|
2554
2608
|
] })
|
|
2555
2609
|
] });
|
|
2556
2610
|
};
|