@neuctra/authix 1.1.29 → 1.1.30
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/neuctra-authix.es.js +754 -750
- package/dist/neuctra-authix.umd.js +21 -21
- package/dist/react/SignedIn.d.ts.map +1 -1
- package/dist/sdk/index.d.ts +10 -0
- package/dist/sdk/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Le, { forwardRef as Nt, createElement as
|
|
1
|
+
import Le, { forwardRef as Nt, createElement as Xe, useState as O, useEffect as te, useRef as xt } from "react";
|
|
2
2
|
function Ut(t, e) {
|
|
3
3
|
return function() {
|
|
4
4
|
return t.apply(e, arguments);
|
|
@@ -7,11 +7,11 @@ function Ut(t, e) {
|
|
|
7
7
|
const { toString: fr } = Object.prototype, { getPrototypeOf: st } = Object, { iterator: Fe, toStringTag: Dt } = Symbol, Me = /* @__PURE__ */ ((t) => (e) => {
|
|
8
8
|
const r = fr.call(e);
|
|
9
9
|
return t[r] || (t[r] = r.slice(8, -1).toLowerCase());
|
|
10
|
-
})(/* @__PURE__ */ Object.create(null)),
|
|
10
|
+
})(/* @__PURE__ */ Object.create(null)), ae = (t) => (t = t.toLowerCase(), (e) => Me(e) === t), We = (t) => (e) => typeof e === t, { isArray: we } = Array, ye = We("undefined");
|
|
11
11
|
function Ce(t) {
|
|
12
12
|
return t !== null && !ye(t) && t.constructor !== null && !ye(t.constructor) && re(t.constructor.isBuffer) && t.constructor.isBuffer(t);
|
|
13
13
|
}
|
|
14
|
-
const Lt =
|
|
14
|
+
const Lt = ae("ArrayBuffer");
|
|
15
15
|
function xr(t) {
|
|
16
16
|
let e;
|
|
17
17
|
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? e = ArrayBuffer.isView(t) : e = t && t.buffer && Lt(t.buffer), e;
|
|
@@ -29,24 +29,24 @@ const hr = We("string"), re = We("function"), Ft = We("number"), Te = (t) => t !
|
|
|
29
29
|
} catch {
|
|
30
30
|
return !1;
|
|
31
31
|
}
|
|
32
|
-
}, yr =
|
|
32
|
+
}, yr = ae("Date"), br = ae("File"), wr = ae("Blob"), jr = ae("FileList"), vr = (t) => Te(t) && re(t.pipe), Sr = (t) => {
|
|
33
33
|
let e;
|
|
34
34
|
return t && (typeof FormData == "function" && t instanceof FormData || re(t.append) && ((e = Me(t)) === "formdata" || // detect form-data instance
|
|
35
35
|
e === "object" && re(t.toString) && t.toString() === "[object FormData]"));
|
|
36
|
-
}, kr =
|
|
36
|
+
}, kr = ae("URLSearchParams"), [Er, Cr, Tr, Rr] = ["ReadableStream", "Request", "Response", "Headers"].map(ae), Ir = (t) => t.trim ? t.trim() : t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
37
37
|
function Re(t, e, { allOwnKeys: r = !1 } = {}) {
|
|
38
38
|
if (t === null || typeof t > "u")
|
|
39
39
|
return;
|
|
40
|
-
let s,
|
|
40
|
+
let s, o;
|
|
41
41
|
if (typeof t != "object" && (t = [t]), we(t))
|
|
42
|
-
for (s = 0,
|
|
42
|
+
for (s = 0, o = t.length; s < o; s++)
|
|
43
43
|
e.call(null, t[s], s, t);
|
|
44
44
|
else {
|
|
45
45
|
if (Ce(t))
|
|
46
46
|
return;
|
|
47
|
-
const i = r ? Object.getOwnPropertyNames(t) : Object.keys(t),
|
|
47
|
+
const i = r ? Object.getOwnPropertyNames(t) : Object.keys(t), a = i.length;
|
|
48
48
|
let l;
|
|
49
|
-
for (s = 0; s <
|
|
49
|
+
for (s = 0; s < a; s++)
|
|
50
50
|
l = i[s], e.call(null, t[l], l, t);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
@@ -55,35 +55,35 @@ function Mt(t, e) {
|
|
|
55
55
|
return null;
|
|
56
56
|
e = e.toLowerCase();
|
|
57
57
|
const r = Object.keys(t);
|
|
58
|
-
let s = r.length,
|
|
58
|
+
let s = r.length, o;
|
|
59
59
|
for (; s-- > 0; )
|
|
60
|
-
if (
|
|
61
|
-
return
|
|
60
|
+
if (o = r[s], e === o.toLowerCase())
|
|
61
|
+
return o;
|
|
62
62
|
return null;
|
|
63
63
|
}
|
|
64
|
-
const
|
|
64
|
+
const fe = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, Wt = (t) => !ye(t) && t !== fe;
|
|
65
65
|
function Ze() {
|
|
66
|
-
const { caseless: t, skipUndefined: e } = Wt(this) && this || {}, r = {}, s = (
|
|
67
|
-
const
|
|
68
|
-
Ae(r[
|
|
66
|
+
const { caseless: t, skipUndefined: e } = Wt(this) && this || {}, r = {}, s = (o, i) => {
|
|
67
|
+
const a = t && Mt(r, i) || i;
|
|
68
|
+
Ae(r[a]) && Ae(o) ? r[a] = Ze(r[a], o) : Ae(o) ? r[a] = Ze({}, o) : we(o) ? r[a] = o.slice() : (!e || !ye(o)) && (r[a] = o);
|
|
69
69
|
};
|
|
70
|
-
for (let
|
|
71
|
-
arguments[
|
|
70
|
+
for (let o = 0, i = arguments.length; o < i; o++)
|
|
71
|
+
arguments[o] && Re(arguments[o], s);
|
|
72
72
|
return r;
|
|
73
73
|
}
|
|
74
|
-
const Pr = (t, e, r, { allOwnKeys: s } = {}) => (Re(e, (
|
|
75
|
-
r && re(
|
|
74
|
+
const Pr = (t, e, r, { allOwnKeys: s } = {}) => (Re(e, (o, i) => {
|
|
75
|
+
r && re(o) ? t[i] = Ut(o, r) : t[i] = o;
|
|
76
76
|
}, { allOwnKeys: s }), t), Or = (t) => (t.charCodeAt(0) === 65279 && (t = t.slice(1)), t), zr = (t, e, r, s) => {
|
|
77
77
|
t.prototype = Object.create(e.prototype, s), t.prototype.constructor = t, Object.defineProperty(t, "super", {
|
|
78
78
|
value: e.prototype
|
|
79
79
|
}), r && Object.assign(t.prototype, r);
|
|
80
80
|
}, Ar = (t, e, r, s) => {
|
|
81
|
-
let
|
|
81
|
+
let o, i, a;
|
|
82
82
|
const l = {};
|
|
83
83
|
if (e = e || {}, t == null) return e;
|
|
84
84
|
do {
|
|
85
|
-
for (
|
|
86
|
-
|
|
85
|
+
for (o = Object.getOwnPropertyNames(t), i = o.length; i-- > 0; )
|
|
86
|
+
a = o[i], (!s || s(a, t, e)) && !l[a] && (e[a] = t[a], l[a] = !0);
|
|
87
87
|
t = r !== !1 && st(t);
|
|
88
88
|
} while (t && (!r || r(t, e)) && t !== Object.prototype);
|
|
89
89
|
return e;
|
|
@@ -102,9 +102,9 @@ const Pr = (t, e, r, { allOwnKeys: s } = {}) => (Re(e, (a, i) => {
|
|
|
102
102
|
return r;
|
|
103
103
|
}, Nr = /* @__PURE__ */ ((t) => (e) => t && e instanceof t)(typeof Uint8Array < "u" && st(Uint8Array)), Ur = (t, e) => {
|
|
104
104
|
const s = (t && t[Fe]).call(t);
|
|
105
|
-
let
|
|
106
|
-
for (; (
|
|
107
|
-
const i =
|
|
105
|
+
let o;
|
|
106
|
+
for (; (o = s.next()) && !o.done; ) {
|
|
107
|
+
const i = o.value;
|
|
108
108
|
e.call(t, i[0], i[1]);
|
|
109
109
|
}
|
|
110
110
|
}, Dr = (t, e) => {
|
|
@@ -113,16 +113,16 @@ const Pr = (t, e, r, { allOwnKeys: s } = {}) => (Re(e, (a, i) => {
|
|
|
113
113
|
for (; (r = t.exec(e)) !== null; )
|
|
114
114
|
s.push(r);
|
|
115
115
|
return s;
|
|
116
|
-
}, Lr =
|
|
116
|
+
}, Lr = ae("HTMLFormElement"), Fr = (t) => t.toLowerCase().replace(
|
|
117
117
|
/[-_\s]([a-z\d])(\w*)/g,
|
|
118
|
-
function(r, s,
|
|
119
|
-
return s.toUpperCase() +
|
|
118
|
+
function(r, s, o) {
|
|
119
|
+
return s.toUpperCase() + o;
|
|
120
120
|
}
|
|
121
|
-
), ht = (({ hasOwnProperty: t }) => (e, r) => t.call(e, r))(Object.prototype), Mr =
|
|
121
|
+
), ht = (({ hasOwnProperty: t }) => (e, r) => t.call(e, r))(Object.prototype), Mr = ae("RegExp"), qt = (t, e) => {
|
|
122
122
|
const r = Object.getOwnPropertyDescriptors(t), s = {};
|
|
123
|
-
Re(r, (
|
|
124
|
-
let
|
|
125
|
-
(
|
|
123
|
+
Re(r, (o, i) => {
|
|
124
|
+
let a;
|
|
125
|
+
(a = e(o, i, t)) !== !1 && (s[i] = a || o);
|
|
126
126
|
}), Object.defineProperties(t, s);
|
|
127
127
|
}, Wr = (t) => {
|
|
128
128
|
qt(t, (e, r) => {
|
|
@@ -140,8 +140,8 @@ const Pr = (t, e, r, { allOwnKeys: s } = {}) => (Re(e, (a, i) => {
|
|
|
140
140
|
}
|
|
141
141
|
});
|
|
142
142
|
}, qr = (t, e) => {
|
|
143
|
-
const r = {}, s = (
|
|
144
|
-
|
|
143
|
+
const r = {}, s = (o) => {
|
|
144
|
+
o.forEach((i) => {
|
|
145
145
|
r[i] = !0;
|
|
146
146
|
});
|
|
147
147
|
};
|
|
@@ -152,32 +152,32 @@ function Vr(t) {
|
|
|
152
152
|
return !!(t && re(t.append) && t[Dt] === "FormData" && t[Fe]);
|
|
153
153
|
}
|
|
154
154
|
const Yr = (t) => {
|
|
155
|
-
const e = new Array(10), r = (s,
|
|
155
|
+
const e = new Array(10), r = (s, o) => {
|
|
156
156
|
if (Te(s)) {
|
|
157
157
|
if (e.indexOf(s) >= 0)
|
|
158
158
|
return;
|
|
159
159
|
if (Ce(s))
|
|
160
160
|
return s;
|
|
161
161
|
if (!("toJSON" in s)) {
|
|
162
|
-
e[
|
|
162
|
+
e[o] = s;
|
|
163
163
|
const i = we(s) ? [] : {};
|
|
164
|
-
return Re(s, (
|
|
165
|
-
const h = r(
|
|
164
|
+
return Re(s, (a, l) => {
|
|
165
|
+
const h = r(a, o + 1);
|
|
166
166
|
!ye(h) && (i[l] = h);
|
|
167
|
-
}), e[
|
|
167
|
+
}), e[o] = void 0, i;
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
return s;
|
|
171
171
|
};
|
|
172
172
|
return r(t, 0);
|
|
173
|
-
}, Kr =
|
|
174
|
-
|
|
175
|
-
}, !1), (
|
|
176
|
-
s.push(
|
|
173
|
+
}, Kr = ae("AsyncFunction"), Jr = (t) => t && (Te(t) || re(t)) && re(t.then) && re(t.catch), Bt = ((t, e) => t ? setImmediate : e ? ((r, s) => (fe.addEventListener("message", ({ source: o, data: i }) => {
|
|
174
|
+
o === fe && i === r && s.length && s.shift()();
|
|
175
|
+
}, !1), (o) => {
|
|
176
|
+
s.push(o), fe.postMessage(r, "*");
|
|
177
177
|
}))(`axios@${Math.random()}`, []) : (r) => setTimeout(r))(
|
|
178
178
|
typeof setImmediate == "function",
|
|
179
|
-
re(
|
|
180
|
-
),
|
|
179
|
+
re(fe.postMessage)
|
|
180
|
+
), Gr = typeof queueMicrotask < "u" ? queueMicrotask.bind(fe) : typeof process < "u" && process.nextTick || Bt, Xr = (t) => t != null && re(t[Fe]), p = {
|
|
181
181
|
isArray: we,
|
|
182
182
|
isArrayBuffer: Lt,
|
|
183
183
|
isBuffer: Ce,
|
|
@@ -211,7 +211,7 @@ const Yr = (t) => {
|
|
|
211
211
|
inherits: zr,
|
|
212
212
|
toFlatObject: Ar,
|
|
213
213
|
kindOf: Me,
|
|
214
|
-
kindOfTest:
|
|
214
|
+
kindOfTest: ae,
|
|
215
215
|
endsWith: _r,
|
|
216
216
|
toArray: $r,
|
|
217
217
|
forEachEntry: Ur,
|
|
@@ -227,18 +227,18 @@ const Yr = (t) => {
|
|
|
227
227
|
noop: Br,
|
|
228
228
|
toFiniteNumber: Hr,
|
|
229
229
|
findKey: Mt,
|
|
230
|
-
global:
|
|
230
|
+
global: fe,
|
|
231
231
|
isContextDefined: Wt,
|
|
232
232
|
isSpecCompliantForm: Vr,
|
|
233
233
|
toJSONObject: Yr,
|
|
234
234
|
isAsyncFn: Kr,
|
|
235
235
|
isThenable: Jr,
|
|
236
236
|
setImmediate: Bt,
|
|
237
|
-
asap:
|
|
238
|
-
isIterable:
|
|
237
|
+
asap: Gr,
|
|
238
|
+
isIterable: Xr
|
|
239
239
|
};
|
|
240
|
-
function L(t, e, r, s,
|
|
241
|
-
Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = t, this.name = "AxiosError", e && (this.code = e), r && (this.config = r), s && (this.request = s),
|
|
240
|
+
function L(t, e, r, s, o) {
|
|
241
|
+
Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = t, this.name = "AxiosError", e && (this.code = e), r && (this.config = r), s && (this.request = s), o && (this.response = o, this.status = o.status ? o.status : null);
|
|
242
242
|
}
|
|
243
243
|
p.inherits(L, Error, {
|
|
244
244
|
toJSON: function() {
|
|
@@ -281,13 +281,13 @@ const Ht = L.prototype, Vt = {};
|
|
|
281
281
|
});
|
|
282
282
|
Object.defineProperties(L, Vt);
|
|
283
283
|
Object.defineProperty(Ht, "isAxiosError", { value: !0 });
|
|
284
|
-
L.from = (t, e, r, s,
|
|
285
|
-
const
|
|
286
|
-
p.toFlatObject(t,
|
|
287
|
-
return
|
|
284
|
+
L.from = (t, e, r, s, o, i) => {
|
|
285
|
+
const a = Object.create(Ht);
|
|
286
|
+
p.toFlatObject(t, a, function(u) {
|
|
287
|
+
return u !== Error.prototype;
|
|
288
288
|
}, (c) => c !== "isAxiosError");
|
|
289
289
|
const l = t && t.message ? t.message : "Error", h = e == null && t ? t.code : e;
|
|
290
|
-
return L.call(
|
|
290
|
+
return L.call(a, l, h, r, s, o), t && a.cause == null && Object.defineProperty(a, "cause", { value: t, configurable: !0 }), a.name = t && t.name || "Error", i && Object.assign(a, i), a;
|
|
291
291
|
};
|
|
292
292
|
const Zr = null;
|
|
293
293
|
function Qe(t) {
|
|
@@ -297,8 +297,8 @@ function Yt(t) {
|
|
|
297
297
|
return p.endsWith(t, "[]") ? t.slice(0, -2) : t;
|
|
298
298
|
}
|
|
299
299
|
function gt(t, e, r) {
|
|
300
|
-
return t ? t.concat(e).map(function(
|
|
301
|
-
return
|
|
300
|
+
return t ? t.concat(e).map(function(o, i) {
|
|
301
|
+
return o = Yt(o), !r && i ? "[" + o + "]" : o;
|
|
302
302
|
}).join(r ? "." : "") : e;
|
|
303
303
|
}
|
|
304
304
|
function Qr(t) {
|
|
@@ -317,46 +317,46 @@ function qe(t, e, r) {
|
|
|
317
317
|
}, !1, function(j, m) {
|
|
318
318
|
return !p.isUndefined(m[j]);
|
|
319
319
|
});
|
|
320
|
-
const s = r.metaTokens,
|
|
321
|
-
if (!p.isFunction(
|
|
320
|
+
const s = r.metaTokens, o = r.visitor || u, i = r.dots, a = r.indexes, h = (r.Blob || typeof Blob < "u" && Blob) && p.isSpecCompliantForm(e);
|
|
321
|
+
if (!p.isFunction(o))
|
|
322
322
|
throw new TypeError("visitor must be a function");
|
|
323
|
-
function c(
|
|
324
|
-
if (
|
|
325
|
-
if (p.isDate(
|
|
326
|
-
return
|
|
327
|
-
if (p.isBoolean(
|
|
328
|
-
return
|
|
329
|
-
if (!h && p.isBlob(
|
|
323
|
+
function c(d) {
|
|
324
|
+
if (d === null) return "";
|
|
325
|
+
if (p.isDate(d))
|
|
326
|
+
return d.toISOString();
|
|
327
|
+
if (p.isBoolean(d))
|
|
328
|
+
return d.toString();
|
|
329
|
+
if (!h && p.isBlob(d))
|
|
330
330
|
throw new L("Blob is not supported. Use a Buffer instead.");
|
|
331
|
-
return p.isArrayBuffer(
|
|
331
|
+
return p.isArrayBuffer(d) || p.isTypedArray(d) ? h && typeof Blob == "function" ? new Blob([d]) : Buffer.from(d) : d;
|
|
332
332
|
}
|
|
333
|
-
function d
|
|
334
|
-
let _ =
|
|
335
|
-
if (
|
|
333
|
+
function u(d, j, m) {
|
|
334
|
+
let _ = d;
|
|
335
|
+
if (d && !m && typeof d == "object") {
|
|
336
336
|
if (p.endsWith(j, "{}"))
|
|
337
|
-
j = s ? j : j.slice(0, -2),
|
|
338
|
-
else if (p.isArray(
|
|
337
|
+
j = s ? j : j.slice(0, -2), d = JSON.stringify(d);
|
|
338
|
+
else if (p.isArray(d) && Qr(d) || (p.isFileList(d) || p.endsWith(j, "[]")) && (_ = p.toArray(d)))
|
|
339
339
|
return j = Yt(j), _.forEach(function(A, C) {
|
|
340
340
|
!(p.isUndefined(A) || A === null) && e.append(
|
|
341
341
|
// eslint-disable-next-line no-nested-ternary
|
|
342
|
-
|
|
342
|
+
a === !0 ? gt([j], C, i) : a === null ? j : j + "[]",
|
|
343
343
|
c(A)
|
|
344
344
|
);
|
|
345
345
|
}), !1;
|
|
346
346
|
}
|
|
347
|
-
return Qe(
|
|
347
|
+
return Qe(d) ? !0 : (e.append(gt(m, j, i), c(d)), !1);
|
|
348
348
|
}
|
|
349
349
|
const b = [], y = Object.assign(en, {
|
|
350
|
-
defaultVisitor:
|
|
350
|
+
defaultVisitor: u,
|
|
351
351
|
convertValue: c,
|
|
352
352
|
isVisitable: Qe
|
|
353
353
|
});
|
|
354
|
-
function w(
|
|
355
|
-
if (!p.isUndefined(
|
|
356
|
-
if (b.indexOf(
|
|
354
|
+
function w(d, j) {
|
|
355
|
+
if (!p.isUndefined(d)) {
|
|
356
|
+
if (b.indexOf(d) !== -1)
|
|
357
357
|
throw Error("Circular reference detected in " + j.join("."));
|
|
358
|
-
b.push(
|
|
359
|
-
(!(p.isUndefined(_) || _ === null) &&
|
|
358
|
+
b.push(d), p.forEach(d, function(_, R) {
|
|
359
|
+
(!(p.isUndefined(_) || _ === null) && o.call(
|
|
360
360
|
e,
|
|
361
361
|
_,
|
|
362
362
|
p.isString(R) ? R.trim() : R,
|
|
@@ -384,10 +384,10 @@ function mt(t) {
|
|
|
384
384
|
return e[s];
|
|
385
385
|
});
|
|
386
386
|
}
|
|
387
|
-
function
|
|
387
|
+
function ot(t, e) {
|
|
388
388
|
this._pairs = [], t && qe(t, this, e);
|
|
389
389
|
}
|
|
390
|
-
const Kt =
|
|
390
|
+
const Kt = ot.prototype;
|
|
391
391
|
Kt.append = function(e, r) {
|
|
392
392
|
this._pairs.push([e, r]);
|
|
393
393
|
};
|
|
@@ -395,8 +395,8 @@ Kt.toString = function(e) {
|
|
|
395
395
|
const r = e ? function(s) {
|
|
396
396
|
return e.call(this, s, mt);
|
|
397
397
|
} : mt;
|
|
398
|
-
return this._pairs.map(function(
|
|
399
|
-
return r(
|
|
398
|
+
return this._pairs.map(function(o) {
|
|
399
|
+
return r(o[0]) + "=" + r(o[1]);
|
|
400
400
|
}, "").join("&");
|
|
401
401
|
};
|
|
402
402
|
function tn(t) {
|
|
@@ -409,11 +409,11 @@ function Jt(t, e, r) {
|
|
|
409
409
|
p.isFunction(r) && (r = {
|
|
410
410
|
serialize: r
|
|
411
411
|
});
|
|
412
|
-
const
|
|
412
|
+
const o = r && r.serialize;
|
|
413
413
|
let i;
|
|
414
|
-
if (
|
|
415
|
-
const
|
|
416
|
-
|
|
414
|
+
if (o ? i = o(e, r) : i = p.isURLSearchParams(e) ? e.toString() : new ot(e, r).toString(s), i) {
|
|
415
|
+
const a = t.indexOf("#");
|
|
416
|
+
a !== -1 && (t = t.slice(0, a)), t += (t.indexOf("?") === -1 ? "?" : "&") + i;
|
|
417
417
|
}
|
|
418
418
|
return t;
|
|
419
419
|
}
|
|
@@ -471,11 +471,11 @@ class yt {
|
|
|
471
471
|
});
|
|
472
472
|
}
|
|
473
473
|
}
|
|
474
|
-
const
|
|
474
|
+
const Gt = {
|
|
475
475
|
silentJSONParsing: !0,
|
|
476
476
|
forcedJSONParsing: !0,
|
|
477
477
|
clarifyTimeoutError: !1
|
|
478
|
-
}, rn = typeof URLSearchParams < "u" ? URLSearchParams :
|
|
478
|
+
}, rn = typeof URLSearchParams < "u" ? URLSearchParams : ot, nn = typeof FormData < "u" ? FormData : null, sn = typeof Blob < "u" ? Blob : null, on = {
|
|
479
479
|
isBrowser: !0,
|
|
480
480
|
classes: {
|
|
481
481
|
URLSearchParams: rn,
|
|
@@ -483,21 +483,21 @@ const Xt = {
|
|
|
483
483
|
Blob: sn
|
|
484
484
|
},
|
|
485
485
|
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
486
|
-
},
|
|
487
|
-
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", cn =
|
|
486
|
+
}, at = typeof window < "u" && typeof document < "u", et = typeof navigator == "object" && navigator || void 0, an = at && (!et || ["ReactNative", "NativeScript", "NS"].indexOf(et.product) < 0), ln = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
|
|
487
|
+
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", cn = at && window.location.href || "http://localhost", dn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
488
488
|
__proto__: null,
|
|
489
|
-
hasBrowserEnv:
|
|
490
|
-
hasStandardBrowserEnv:
|
|
489
|
+
hasBrowserEnv: at,
|
|
490
|
+
hasStandardBrowserEnv: an,
|
|
491
491
|
hasStandardBrowserWebWorkerEnv: ln,
|
|
492
492
|
navigator: et,
|
|
493
493
|
origin: cn
|
|
494
494
|
}, Symbol.toStringTag, { value: "Module" })), ee = {
|
|
495
495
|
...dn,
|
|
496
|
-
...
|
|
496
|
+
...on
|
|
497
497
|
};
|
|
498
498
|
function un(t, e) {
|
|
499
499
|
return qe(t, new ee.classes.URLSearchParams(), {
|
|
500
|
-
visitor: function(r, s,
|
|
500
|
+
visitor: function(r, s, o, i) {
|
|
501
501
|
return ee.isNode && p.isBuffer(r) ? (this.append(s, r.toString("base64")), !1) : i.defaultVisitor.apply(this, arguments);
|
|
502
502
|
},
|
|
503
503
|
...e
|
|
@@ -509,23 +509,23 @@ function pn(t) {
|
|
|
509
509
|
function fn(t) {
|
|
510
510
|
const e = {}, r = Object.keys(t);
|
|
511
511
|
let s;
|
|
512
|
-
const
|
|
512
|
+
const o = r.length;
|
|
513
513
|
let i;
|
|
514
|
-
for (s = 0; s <
|
|
514
|
+
for (s = 0; s < o; s++)
|
|
515
515
|
i = r[s], e[i] = t[i];
|
|
516
516
|
return e;
|
|
517
517
|
}
|
|
518
|
-
function
|
|
519
|
-
function e(r, s,
|
|
520
|
-
let
|
|
521
|
-
if (
|
|
522
|
-
const l = Number.isFinite(+
|
|
523
|
-
return
|
|
518
|
+
function Xt(t) {
|
|
519
|
+
function e(r, s, o, i) {
|
|
520
|
+
let a = r[i++];
|
|
521
|
+
if (a === "__proto__") return !0;
|
|
522
|
+
const l = Number.isFinite(+a), h = i >= r.length;
|
|
523
|
+
return a = !a && p.isArray(o) ? o.length : a, h ? (p.hasOwnProp(o, a) ? o[a] = [o[a], s] : o[a] = s, !l) : ((!o[a] || !p.isObject(o[a])) && (o[a] = []), e(r, s, o[a], i) && p.isArray(o[a]) && (o[a] = fn(o[a])), !l);
|
|
524
524
|
}
|
|
525
525
|
if (p.isFormData(t) && p.isFunction(t.entries)) {
|
|
526
526
|
const r = {};
|
|
527
|
-
return p.forEachEntry(t, (s,
|
|
528
|
-
e(pn(s),
|
|
527
|
+
return p.forEachEntry(t, (s, o) => {
|
|
528
|
+
e(pn(s), o, r, 0);
|
|
529
529
|
}), r;
|
|
530
530
|
}
|
|
531
531
|
return null;
|
|
@@ -541,12 +541,12 @@ function xn(t, e, r) {
|
|
|
541
541
|
return (r || JSON.stringify)(t);
|
|
542
542
|
}
|
|
543
543
|
const Ie = {
|
|
544
|
-
transitional:
|
|
544
|
+
transitional: Gt,
|
|
545
545
|
adapter: ["xhr", "http", "fetch"],
|
|
546
546
|
transformRequest: [function(e, r) {
|
|
547
|
-
const s = r.getContentType() || "",
|
|
547
|
+
const s = r.getContentType() || "", o = s.indexOf("application/json") > -1, i = p.isObject(e);
|
|
548
548
|
if (i && p.isHTMLForm(e) && (e = new FormData(e)), p.isFormData(e))
|
|
549
|
-
return
|
|
549
|
+
return o ? JSON.stringify(Xt(e)) : e;
|
|
550
550
|
if (p.isArrayBuffer(e) || p.isBuffer(e) || p.isStream(e) || p.isFile(e) || p.isBlob(e) || p.isReadableStream(e))
|
|
551
551
|
return e;
|
|
552
552
|
if (p.isArrayBufferView(e))
|
|
@@ -566,18 +566,18 @@ const Ie = {
|
|
|
566
566
|
);
|
|
567
567
|
}
|
|
568
568
|
}
|
|
569
|
-
return i ||
|
|
569
|
+
return i || o ? (r.setContentType("application/json", !1), xn(e)) : e;
|
|
570
570
|
}],
|
|
571
571
|
transformResponse: [function(e) {
|
|
572
|
-
const r = this.transitional || Ie.transitional, s = r && r.forcedJSONParsing,
|
|
572
|
+
const r = this.transitional || Ie.transitional, s = r && r.forcedJSONParsing, o = this.responseType === "json";
|
|
573
573
|
if (p.isResponse(e) || p.isReadableStream(e))
|
|
574
574
|
return e;
|
|
575
|
-
if (e && p.isString(e) && (s && !this.responseType ||
|
|
576
|
-
const
|
|
575
|
+
if (e && p.isString(e) && (s && !this.responseType || o)) {
|
|
576
|
+
const a = !(r && r.silentJSONParsing) && o;
|
|
577
577
|
try {
|
|
578
578
|
return JSON.parse(e, this.parseReviver);
|
|
579
579
|
} catch (l) {
|
|
580
|
-
if (
|
|
580
|
+
if (a)
|
|
581
581
|
throw l.name === "SyntaxError" ? L.from(l, L.ERR_BAD_RESPONSE, this, null, this.response) : l;
|
|
582
582
|
}
|
|
583
583
|
}
|
|
@@ -629,10 +629,10 @@ const hn = p.toObjectSet([
|
|
|
629
629
|
"user-agent"
|
|
630
630
|
]), gn = (t) => {
|
|
631
631
|
const e = {};
|
|
632
|
-
let r, s,
|
|
632
|
+
let r, s, o;
|
|
633
633
|
return t && t.split(`
|
|
634
|
-
`).forEach(function(
|
|
635
|
-
|
|
634
|
+
`).forEach(function(a) {
|
|
635
|
+
o = a.indexOf(":"), r = a.substring(0, o).trim().toLowerCase(), s = a.substring(o + 1).trim(), !(!r || e[r] && hn[r]) && (r === "set-cookie" ? e[r] ? e[r].push(s) : e[r] = [s] : e[r] = e[r] ? e[r] + ", " + s : s);
|
|
636
636
|
}), e;
|
|
637
637
|
}, bt = Symbol("internals");
|
|
638
638
|
function Se(t) {
|
|
@@ -649,10 +649,10 @@ function mn(t) {
|
|
|
649
649
|
return e;
|
|
650
650
|
}
|
|
651
651
|
const yn = (t) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());
|
|
652
|
-
function Ye(t, e, r, s,
|
|
652
|
+
function Ye(t, e, r, s, o) {
|
|
653
653
|
if (p.isFunction(s))
|
|
654
654
|
return s.call(this, e, r);
|
|
655
|
-
if (
|
|
655
|
+
if (o && (e = r), !!p.isString(e)) {
|
|
656
656
|
if (p.isString(s))
|
|
657
657
|
return e.indexOf(s) !== -1;
|
|
658
658
|
if (p.isRegExp(s))
|
|
@@ -666,8 +666,8 @@ function wn(t, e) {
|
|
|
666
666
|
const r = p.toCamelCase(" " + e);
|
|
667
667
|
["get", "set", "has"].forEach((s) => {
|
|
668
668
|
Object.defineProperty(t, s + r, {
|
|
669
|
-
value: function(
|
|
670
|
-
return this[s].call(this, e,
|
|
669
|
+
value: function(o, i, a) {
|
|
670
|
+
return this[s].call(this, e, o, i, a);
|
|
671
671
|
},
|
|
672
672
|
configurable: !0
|
|
673
673
|
});
|
|
@@ -678,27 +678,27 @@ let ne = class {
|
|
|
678
678
|
e && this.set(e);
|
|
679
679
|
}
|
|
680
680
|
set(e, r, s) {
|
|
681
|
-
const
|
|
681
|
+
const o = this;
|
|
682
682
|
function i(l, h, c) {
|
|
683
|
-
const
|
|
684
|
-
if (!
|
|
683
|
+
const u = Se(h);
|
|
684
|
+
if (!u)
|
|
685
685
|
throw new Error("header name must be a non-empty string");
|
|
686
|
-
const b = p.findKey(
|
|
687
|
-
(!b ||
|
|
686
|
+
const b = p.findKey(o, u);
|
|
687
|
+
(!b || o[b] === void 0 || c === !0 || c === void 0 && o[b] !== !1) && (o[b || h] = _e(l));
|
|
688
688
|
}
|
|
689
|
-
const
|
|
689
|
+
const a = (l, h) => p.forEach(l, (c, u) => i(c, u, h));
|
|
690
690
|
if (p.isPlainObject(e) || e instanceof this.constructor)
|
|
691
|
-
|
|
691
|
+
a(e, r);
|
|
692
692
|
else if (p.isString(e) && (e = e.trim()) && !yn(e))
|
|
693
|
-
|
|
693
|
+
a(gn(e), r);
|
|
694
694
|
else if (p.isObject(e) && p.isIterable(e)) {
|
|
695
695
|
let l = {}, h, c;
|
|
696
|
-
for (const
|
|
697
|
-
if (!p.isArray(
|
|
696
|
+
for (const u of e) {
|
|
697
|
+
if (!p.isArray(u))
|
|
698
698
|
throw TypeError("Object iterator must return a key-value pair");
|
|
699
|
-
l[c =
|
|
699
|
+
l[c = u[0]] = (h = l[c]) ? p.isArray(h) ? [...h, u[1]] : [h, u[1]] : u[1];
|
|
700
700
|
}
|
|
701
|
-
|
|
701
|
+
a(l, r);
|
|
702
702
|
} else
|
|
703
703
|
e != null && i(r, e, s);
|
|
704
704
|
return this;
|
|
@@ -707,15 +707,15 @@ let ne = class {
|
|
|
707
707
|
if (e = Se(e), e) {
|
|
708
708
|
const s = p.findKey(this, e);
|
|
709
709
|
if (s) {
|
|
710
|
-
const
|
|
710
|
+
const o = this[s];
|
|
711
711
|
if (!r)
|
|
712
|
-
return
|
|
712
|
+
return o;
|
|
713
713
|
if (r === !0)
|
|
714
|
-
return mn(
|
|
714
|
+
return mn(o);
|
|
715
715
|
if (p.isFunction(r))
|
|
716
|
-
return r.call(this,
|
|
716
|
+
return r.call(this, o, s);
|
|
717
717
|
if (p.isRegExp(r))
|
|
718
|
-
return r.exec(
|
|
718
|
+
return r.exec(o);
|
|
719
719
|
throw new TypeError("parser must be boolean|regexp|function");
|
|
720
720
|
}
|
|
721
721
|
}
|
|
@@ -729,34 +729,34 @@ let ne = class {
|
|
|
729
729
|
}
|
|
730
730
|
delete(e, r) {
|
|
731
731
|
const s = this;
|
|
732
|
-
let
|
|
733
|
-
function i(
|
|
734
|
-
if (
|
|
735
|
-
const l = p.findKey(s,
|
|
736
|
-
l && (!r || Ye(s, s[l], l, r)) && (delete s[l],
|
|
732
|
+
let o = !1;
|
|
733
|
+
function i(a) {
|
|
734
|
+
if (a = Se(a), a) {
|
|
735
|
+
const l = p.findKey(s, a);
|
|
736
|
+
l && (!r || Ye(s, s[l], l, r)) && (delete s[l], o = !0);
|
|
737
737
|
}
|
|
738
738
|
}
|
|
739
|
-
return p.isArray(e) ? e.forEach(i) : i(e),
|
|
739
|
+
return p.isArray(e) ? e.forEach(i) : i(e), o;
|
|
740
740
|
}
|
|
741
741
|
clear(e) {
|
|
742
742
|
const r = Object.keys(this);
|
|
743
|
-
let s = r.length,
|
|
743
|
+
let s = r.length, o = !1;
|
|
744
744
|
for (; s--; ) {
|
|
745
745
|
const i = r[s];
|
|
746
|
-
(!e || Ye(this, this[i], i, e, !0)) && (delete this[i],
|
|
746
|
+
(!e || Ye(this, this[i], i, e, !0)) && (delete this[i], o = !0);
|
|
747
747
|
}
|
|
748
|
-
return
|
|
748
|
+
return o;
|
|
749
749
|
}
|
|
750
750
|
normalize(e) {
|
|
751
751
|
const r = this, s = {};
|
|
752
|
-
return p.forEach(this, (
|
|
753
|
-
const
|
|
754
|
-
if (
|
|
755
|
-
r[
|
|
752
|
+
return p.forEach(this, (o, i) => {
|
|
753
|
+
const a = p.findKey(s, i);
|
|
754
|
+
if (a) {
|
|
755
|
+
r[a] = _e(o), delete r[i];
|
|
756
756
|
return;
|
|
757
757
|
}
|
|
758
758
|
const l = e ? bn(i) : String(i).trim();
|
|
759
|
-
l !== i && delete r[i], r[l] = _e(
|
|
759
|
+
l !== i && delete r[i], r[l] = _e(o), s[l] = !0;
|
|
760
760
|
}), this;
|
|
761
761
|
}
|
|
762
762
|
concat(...e) {
|
|
@@ -764,8 +764,8 @@ let ne = class {
|
|
|
764
764
|
}
|
|
765
765
|
toJSON(e) {
|
|
766
766
|
const r = /* @__PURE__ */ Object.create(null);
|
|
767
|
-
return p.forEach(this, (s,
|
|
768
|
-
s != null && s !== !1 && (r[
|
|
767
|
+
return p.forEach(this, (s, o) => {
|
|
768
|
+
s != null && s !== !1 && (r[o] = e && p.isArray(s) ? s.join(", ") : s);
|
|
769
769
|
}), r;
|
|
770
770
|
}
|
|
771
771
|
[Symbol.iterator]() {
|
|
@@ -786,15 +786,15 @@ let ne = class {
|
|
|
786
786
|
}
|
|
787
787
|
static concat(e, ...r) {
|
|
788
788
|
const s = new this(e);
|
|
789
|
-
return r.forEach((
|
|
789
|
+
return r.forEach((o) => s.set(o)), s;
|
|
790
790
|
}
|
|
791
791
|
static accessor(e) {
|
|
792
792
|
const s = (this[bt] = this[bt] = {
|
|
793
793
|
accessors: {}
|
|
794
|
-
}).accessors,
|
|
795
|
-
function i(
|
|
796
|
-
const l = Se(
|
|
797
|
-
s[l] || (wn(
|
|
794
|
+
}).accessors, o = this.prototype;
|
|
795
|
+
function i(a) {
|
|
796
|
+
const l = Se(a);
|
|
797
|
+
s[l] || (wn(o, a), s[l] = !0);
|
|
798
798
|
}
|
|
799
799
|
return p.isArray(e) ? e.forEach(i) : i(e), this;
|
|
800
800
|
}
|
|
@@ -811,11 +811,11 @@ p.reduceDescriptors(ne.prototype, ({ value: t }, e) => {
|
|
|
811
811
|
});
|
|
812
812
|
p.freezeMethods(ne);
|
|
813
813
|
function Ke(t, e) {
|
|
814
|
-
const r = this || Ie, s = e || r,
|
|
814
|
+
const r = this || Ie, s = e || r, o = ne.from(s.headers);
|
|
815
815
|
let i = s.data;
|
|
816
816
|
return p.forEach(t, function(l) {
|
|
817
|
-
i = l.call(r, i,
|
|
818
|
-
}),
|
|
817
|
+
i = l.call(r, i, o.normalize(), e ? e.status : void 0);
|
|
818
|
+
}), o.normalize(), i;
|
|
819
819
|
}
|
|
820
820
|
function Zt(t) {
|
|
821
821
|
return !!(t && t.__CANCEL__);
|
|
@@ -843,44 +843,44 @@ function jn(t) {
|
|
|
843
843
|
function vn(t, e) {
|
|
844
844
|
t = t || 10;
|
|
845
845
|
const r = new Array(t), s = new Array(t);
|
|
846
|
-
let
|
|
846
|
+
let o = 0, i = 0, a;
|
|
847
847
|
return e = e !== void 0 ? e : 1e3, function(h) {
|
|
848
|
-
const c = Date.now(),
|
|
849
|
-
|
|
848
|
+
const c = Date.now(), u = s[i];
|
|
849
|
+
a || (a = c), r[o] = h, s[o] = c;
|
|
850
850
|
let b = i, y = 0;
|
|
851
|
-
for (; b !==
|
|
851
|
+
for (; b !== o; )
|
|
852
852
|
y += r[b++], b = b % t;
|
|
853
|
-
if (
|
|
853
|
+
if (o = (o + 1) % t, o === i && (i = (i + 1) % t), c - a < e)
|
|
854
854
|
return;
|
|
855
|
-
const w =
|
|
855
|
+
const w = u && c - u;
|
|
856
856
|
return w ? Math.round(y * 1e3 / w) : void 0;
|
|
857
857
|
};
|
|
858
858
|
}
|
|
859
859
|
function Sn(t, e) {
|
|
860
|
-
let r = 0, s = 1e3 / e,
|
|
861
|
-
const
|
|
862
|
-
r =
|
|
860
|
+
let r = 0, s = 1e3 / e, o, i;
|
|
861
|
+
const a = (c, u = Date.now()) => {
|
|
862
|
+
r = u, o = null, i && (clearTimeout(i), i = null), t(...c);
|
|
863
863
|
};
|
|
864
864
|
return [(...c) => {
|
|
865
|
-
const
|
|
866
|
-
b >= s ?
|
|
867
|
-
i = null, o
|
|
865
|
+
const u = Date.now(), b = u - r;
|
|
866
|
+
b >= s ? a(c, u) : (o = c, i || (i = setTimeout(() => {
|
|
867
|
+
i = null, a(o);
|
|
868
868
|
}, s - b)));
|
|
869
|
-
}, () =>
|
|
869
|
+
}, () => o && a(o)];
|
|
870
870
|
}
|
|
871
871
|
const De = (t, e, r = 3) => {
|
|
872
872
|
let s = 0;
|
|
873
|
-
const
|
|
873
|
+
const o = vn(50, 250);
|
|
874
874
|
return Sn((i) => {
|
|
875
|
-
const
|
|
876
|
-
s =
|
|
875
|
+
const a = i.loaded, l = i.lengthComputable ? i.total : void 0, h = a - s, c = o(h), u = a <= l;
|
|
876
|
+
s = a;
|
|
877
877
|
const b = {
|
|
878
|
-
loaded:
|
|
878
|
+
loaded: a,
|
|
879
879
|
total: l,
|
|
880
|
-
progress: l ?
|
|
880
|
+
progress: l ? a / l : void 0,
|
|
881
881
|
bytes: h,
|
|
882
882
|
rate: c || void 0,
|
|
883
|
-
estimated: c && l &&
|
|
883
|
+
estimated: c && l && u ? (l - a) / c : void 0,
|
|
884
884
|
event: i,
|
|
885
885
|
lengthComputable: l != null,
|
|
886
886
|
[e ? "download" : "upload"]: !0
|
|
@@ -900,9 +900,9 @@ const De = (t, e, r = 3) => {
|
|
|
900
900
|
) : () => !0, En = ee.hasStandardBrowserEnv ? (
|
|
901
901
|
// Standard browser envs support document.cookie
|
|
902
902
|
{
|
|
903
|
-
write(t, e, r, s,
|
|
904
|
-
const
|
|
905
|
-
p.isNumber(r) &&
|
|
903
|
+
write(t, e, r, s, o, i) {
|
|
904
|
+
const a = [t + "=" + encodeURIComponent(e)];
|
|
905
|
+
p.isNumber(r) && a.push("expires=" + new Date(r).toGMTString()), p.isString(s) && a.push("path=" + s), p.isString(o) && a.push("domain=" + o), i === !0 && a.push("secure"), document.cookie = a.join("; ");
|
|
906
906
|
},
|
|
907
907
|
read(t) {
|
|
908
908
|
const e = document.cookie.match(new RegExp("(^|;\\s*)(" + t + ")=([^;]*)"));
|
|
@@ -935,31 +935,31 @@ function er(t, e, r) {
|
|
|
935
935
|
return t && (s || r == !1) ? Tn(t, e) : e;
|
|
936
936
|
}
|
|
937
937
|
const vt = (t) => t instanceof ne ? { ...t } : t;
|
|
938
|
-
function
|
|
938
|
+
function he(t, e) {
|
|
939
939
|
e = e || {};
|
|
940
940
|
const r = {};
|
|
941
|
-
function s(c,
|
|
942
|
-
return p.isPlainObject(c) && p.isPlainObject(
|
|
941
|
+
function s(c, u, b, y) {
|
|
942
|
+
return p.isPlainObject(c) && p.isPlainObject(u) ? p.merge.call({ caseless: y }, c, u) : p.isPlainObject(u) ? p.merge({}, u) : p.isArray(u) ? u.slice() : u;
|
|
943
943
|
}
|
|
944
|
-
function
|
|
945
|
-
if (p.isUndefined(
|
|
944
|
+
function o(c, u, b, y) {
|
|
945
|
+
if (p.isUndefined(u)) {
|
|
946
946
|
if (!p.isUndefined(c))
|
|
947
947
|
return s(void 0, c, b, y);
|
|
948
|
-
} else return s(c,
|
|
948
|
+
} else return s(c, u, b, y);
|
|
949
949
|
}
|
|
950
|
-
function i(c,
|
|
951
|
-
if (!p.isUndefined(
|
|
952
|
-
return s(void 0,
|
|
950
|
+
function i(c, u) {
|
|
951
|
+
if (!p.isUndefined(u))
|
|
952
|
+
return s(void 0, u);
|
|
953
953
|
}
|
|
954
|
-
function
|
|
955
|
-
if (p.isUndefined(
|
|
954
|
+
function a(c, u) {
|
|
955
|
+
if (p.isUndefined(u)) {
|
|
956
956
|
if (!p.isUndefined(c))
|
|
957
957
|
return s(void 0, c);
|
|
958
|
-
} else return s(void 0,
|
|
958
|
+
} else return s(void 0, u);
|
|
959
959
|
}
|
|
960
|
-
function l(c,
|
|
960
|
+
function l(c, u, b) {
|
|
961
961
|
if (b in e)
|
|
962
|
-
return s(c,
|
|
962
|
+
return s(c, u);
|
|
963
963
|
if (b in t)
|
|
964
964
|
return s(void 0, c);
|
|
965
965
|
}
|
|
@@ -967,70 +967,70 @@ function ge(t, e) {
|
|
|
967
967
|
url: i,
|
|
968
968
|
method: i,
|
|
969
969
|
data: i,
|
|
970
|
-
baseURL:
|
|
971
|
-
transformRequest:
|
|
972
|
-
transformResponse:
|
|
973
|
-
paramsSerializer:
|
|
974
|
-
timeout:
|
|
975
|
-
timeoutMessage:
|
|
976
|
-
withCredentials:
|
|
977
|
-
withXSRFToken:
|
|
978
|
-
adapter:
|
|
979
|
-
responseType:
|
|
980
|
-
xsrfCookieName:
|
|
981
|
-
xsrfHeaderName:
|
|
982
|
-
onUploadProgress:
|
|
983
|
-
onDownloadProgress:
|
|
984
|
-
decompress:
|
|
985
|
-
maxContentLength:
|
|
986
|
-
maxBodyLength:
|
|
987
|
-
beforeRedirect:
|
|
988
|
-
transport:
|
|
989
|
-
httpAgent:
|
|
990
|
-
httpsAgent:
|
|
991
|
-
cancelToken:
|
|
992
|
-
socketPath:
|
|
993
|
-
responseEncoding:
|
|
970
|
+
baseURL: a,
|
|
971
|
+
transformRequest: a,
|
|
972
|
+
transformResponse: a,
|
|
973
|
+
paramsSerializer: a,
|
|
974
|
+
timeout: a,
|
|
975
|
+
timeoutMessage: a,
|
|
976
|
+
withCredentials: a,
|
|
977
|
+
withXSRFToken: a,
|
|
978
|
+
adapter: a,
|
|
979
|
+
responseType: a,
|
|
980
|
+
xsrfCookieName: a,
|
|
981
|
+
xsrfHeaderName: a,
|
|
982
|
+
onUploadProgress: a,
|
|
983
|
+
onDownloadProgress: a,
|
|
984
|
+
decompress: a,
|
|
985
|
+
maxContentLength: a,
|
|
986
|
+
maxBodyLength: a,
|
|
987
|
+
beforeRedirect: a,
|
|
988
|
+
transport: a,
|
|
989
|
+
httpAgent: a,
|
|
990
|
+
httpsAgent: a,
|
|
991
|
+
cancelToken: a,
|
|
992
|
+
socketPath: a,
|
|
993
|
+
responseEncoding: a,
|
|
994
994
|
validateStatus: l,
|
|
995
|
-
headers: (c,
|
|
995
|
+
headers: (c, u, b) => o(vt(c), vt(u), b, !0)
|
|
996
996
|
};
|
|
997
|
-
return p.forEach(Object.keys({ ...t, ...e }), function(
|
|
998
|
-
const b = h[
|
|
999
|
-
p.isUndefined(y) && b !== l || (r[
|
|
997
|
+
return p.forEach(Object.keys({ ...t, ...e }), function(u) {
|
|
998
|
+
const b = h[u] || o, y = b(t[u], e[u], u);
|
|
999
|
+
p.isUndefined(y) && b !== l || (r[u] = y);
|
|
1000
1000
|
}), r;
|
|
1001
1001
|
}
|
|
1002
1002
|
const tr = (t) => {
|
|
1003
|
-
const e =
|
|
1004
|
-
let { data: r, withXSRFToken: s, xsrfHeaderName:
|
|
1005
|
-
if (e.headers =
|
|
1003
|
+
const e = he({}, t);
|
|
1004
|
+
let { data: r, withXSRFToken: s, xsrfHeaderName: o, xsrfCookieName: i, headers: a, auth: l } = e;
|
|
1005
|
+
if (e.headers = a = ne.from(a), e.url = Jt(er(e.baseURL, e.url, e.allowAbsoluteUrls), t.params, t.paramsSerializer), l && a.set(
|
|
1006
1006
|
"Authorization",
|
|
1007
1007
|
"Basic " + btoa((l.username || "") + ":" + (l.password ? unescape(encodeURIComponent(l.password)) : ""))
|
|
1008
1008
|
), p.isFormData(r)) {
|
|
1009
1009
|
if (ee.hasStandardBrowserEnv || ee.hasStandardBrowserWebWorkerEnv)
|
|
1010
|
-
|
|
1010
|
+
a.setContentType(void 0);
|
|
1011
1011
|
else if (p.isFunction(r.getHeaders)) {
|
|
1012
1012
|
const h = r.getHeaders(), c = ["content-type", "content-length"];
|
|
1013
|
-
Object.entries(h).forEach(([
|
|
1014
|
-
c.includes(
|
|
1013
|
+
Object.entries(h).forEach(([u, b]) => {
|
|
1014
|
+
c.includes(u.toLowerCase()) && a.set(u, b);
|
|
1015
1015
|
});
|
|
1016
1016
|
}
|
|
1017
1017
|
}
|
|
1018
1018
|
if (ee.hasStandardBrowserEnv && (s && p.isFunction(s) && (s = s(e)), s || s !== !1 && kn(e.url))) {
|
|
1019
|
-
const h =
|
|
1020
|
-
h &&
|
|
1019
|
+
const h = o && i && En.read(i);
|
|
1020
|
+
h && a.set(o, h);
|
|
1021
1021
|
}
|
|
1022
1022
|
return e;
|
|
1023
1023
|
}, Rn = typeof XMLHttpRequest < "u", In = Rn && function(t) {
|
|
1024
1024
|
return new Promise(function(r, s) {
|
|
1025
|
-
const
|
|
1026
|
-
let i =
|
|
1027
|
-
const
|
|
1028
|
-
let { responseType: l, onUploadProgress: h, onDownloadProgress: c } =
|
|
1025
|
+
const o = tr(t);
|
|
1026
|
+
let i = o.data;
|
|
1027
|
+
const a = ne.from(o.headers).normalize();
|
|
1028
|
+
let { responseType: l, onUploadProgress: h, onDownloadProgress: c } = o, u, b, y, w, d;
|
|
1029
1029
|
function j() {
|
|
1030
|
-
w && w(),
|
|
1030
|
+
w && w(), d && d(), o.cancelToken && o.cancelToken.unsubscribe(u), o.signal && o.signal.removeEventListener("abort", u);
|
|
1031
1031
|
}
|
|
1032
1032
|
let m = new XMLHttpRequest();
|
|
1033
|
-
m.open(
|
|
1033
|
+
m.open(o.method.toUpperCase(), o.url, !0), m.timeout = o.timeout;
|
|
1034
1034
|
function _() {
|
|
1035
1035
|
if (!m)
|
|
1036
1036
|
return;
|
|
@@ -1058,20 +1058,20 @@ const tr = (t) => {
|
|
|
1058
1058
|
const M = C && C.message ? C.message : "Network Error", g = new L(M, L.ERR_NETWORK, t, m);
|
|
1059
1059
|
g.event = C || null, s(g), m = null;
|
|
1060
1060
|
}, m.ontimeout = function() {
|
|
1061
|
-
let C =
|
|
1062
|
-
const M =
|
|
1063
|
-
|
|
1061
|
+
let C = o.timeout ? "timeout of " + o.timeout + "ms exceeded" : "timeout exceeded";
|
|
1062
|
+
const M = o.transitional || Gt;
|
|
1063
|
+
o.timeoutErrorMessage && (C = o.timeoutErrorMessage), s(new L(
|
|
1064
1064
|
C,
|
|
1065
1065
|
M.clarifyTimeoutError ? L.ETIMEDOUT : L.ECONNABORTED,
|
|
1066
1066
|
t,
|
|
1067
1067
|
m
|
|
1068
1068
|
)), m = null;
|
|
1069
|
-
}, i === void 0 &&
|
|
1069
|
+
}, i === void 0 && a.setContentType(null), "setRequestHeader" in m && p.forEach(a.toJSON(), function(C, M) {
|
|
1070
1070
|
m.setRequestHeader(M, C);
|
|
1071
|
-
}), p.isUndefined(
|
|
1071
|
+
}), p.isUndefined(o.withCredentials) || (m.withCredentials = !!o.withCredentials), l && l !== "json" && (m.responseType = o.responseType), c && ([y, d] = De(c, !0), m.addEventListener("progress", y)), h && m.upload && ([b, w] = De(h), m.upload.addEventListener("progress", b), m.upload.addEventListener("loadend", w)), (o.cancelToken || o.signal) && (u = (A) => {
|
|
1072
1072
|
m && (s(!A || A.type ? new je(null, t, m) : A), m.abort(), m = null);
|
|
1073
|
-
},
|
|
1074
|
-
const R = jn(
|
|
1073
|
+
}, o.cancelToken && o.cancelToken.subscribe(u), o.signal && (o.signal.aborted ? u() : o.signal.addEventListener("abort", u)));
|
|
1074
|
+
const R = jn(o.url);
|
|
1075
1075
|
if (R && ee.protocols.indexOf(R) === -1) {
|
|
1076
1076
|
s(new L("Unsupported protocol " + R + ":", L.ERR_BAD_REQUEST, t));
|
|
1077
1077
|
return;
|
|
@@ -1081,19 +1081,19 @@ const tr = (t) => {
|
|
|
1081
1081
|
}, Pn = (t, e) => {
|
|
1082
1082
|
const { length: r } = t = t ? t.filter(Boolean) : [];
|
|
1083
1083
|
if (e || r) {
|
|
1084
|
-
let s = new AbortController(),
|
|
1084
|
+
let s = new AbortController(), o;
|
|
1085
1085
|
const i = function(c) {
|
|
1086
|
-
if (!
|
|
1087
|
-
|
|
1088
|
-
const
|
|
1089
|
-
s.abort(
|
|
1086
|
+
if (!o) {
|
|
1087
|
+
o = !0, l();
|
|
1088
|
+
const u = c instanceof Error ? c : this.reason;
|
|
1089
|
+
s.abort(u instanceof L ? u : new je(u instanceof Error ? u.message : u));
|
|
1090
1090
|
}
|
|
1091
1091
|
};
|
|
1092
|
-
let
|
|
1093
|
-
|
|
1092
|
+
let a = e && setTimeout(() => {
|
|
1093
|
+
a = null, i(new L(`timeout ${e} of ms exceeded`, L.ETIMEDOUT));
|
|
1094
1094
|
}, e);
|
|
1095
1095
|
const l = () => {
|
|
1096
|
-
t && (
|
|
1096
|
+
t && (a && clearTimeout(a), a = null, t.forEach((c) => {
|
|
1097
1097
|
c.unsubscribe ? c.unsubscribe(i) : c.removeEventListener("abort", i);
|
|
1098
1098
|
}), t = null);
|
|
1099
1099
|
};
|
|
@@ -1107,9 +1107,9 @@ const tr = (t) => {
|
|
|
1107
1107
|
yield t;
|
|
1108
1108
|
return;
|
|
1109
1109
|
}
|
|
1110
|
-
let s = 0,
|
|
1110
|
+
let s = 0, o;
|
|
1111
1111
|
for (; s < r; )
|
|
1112
|
-
|
|
1112
|
+
o = s + e, yield t.slice(s, o), s = o;
|
|
1113
1113
|
}, zn = async function* (t, e) {
|
|
1114
1114
|
for await (const r of An(t))
|
|
1115
1115
|
yield* On(r, e);
|
|
@@ -1130,30 +1130,30 @@ const tr = (t) => {
|
|
|
1130
1130
|
await e.cancel();
|
|
1131
1131
|
}
|
|
1132
1132
|
}, St = (t, e, r, s) => {
|
|
1133
|
-
const
|
|
1134
|
-
let i = 0,
|
|
1135
|
-
|
|
1133
|
+
const o = zn(t, e);
|
|
1134
|
+
let i = 0, a, l = (h) => {
|
|
1135
|
+
a || (a = !0, s && s(h));
|
|
1136
1136
|
};
|
|
1137
1137
|
return new ReadableStream({
|
|
1138
1138
|
async pull(h) {
|
|
1139
1139
|
try {
|
|
1140
|
-
const { done: c, value:
|
|
1140
|
+
const { done: c, value: u } = await o.next();
|
|
1141
1141
|
if (c) {
|
|
1142
1142
|
l(), h.close();
|
|
1143
1143
|
return;
|
|
1144
1144
|
}
|
|
1145
|
-
let b =
|
|
1145
|
+
let b = u.byteLength;
|
|
1146
1146
|
if (r) {
|
|
1147
1147
|
let y = i += b;
|
|
1148
1148
|
r(y);
|
|
1149
1149
|
}
|
|
1150
|
-
h.enqueue(new Uint8Array(
|
|
1150
|
+
h.enqueue(new Uint8Array(u));
|
|
1151
1151
|
} catch (c) {
|
|
1152
1152
|
throw l(c), c;
|
|
1153
1153
|
}
|
|
1154
1154
|
},
|
|
1155
1155
|
cancel(h) {
|
|
1156
|
-
return l(h),
|
|
1156
|
+
return l(h), o.return();
|
|
1157
1157
|
}
|
|
1158
1158
|
}, {
|
|
1159
1159
|
highWaterMark: 2
|
|
@@ -1174,49 +1174,49 @@ const tr = (t) => {
|
|
|
1174
1174
|
t = p.merge.call({
|
|
1175
1175
|
skipUndefined: !0
|
|
1176
1176
|
}, _n, t);
|
|
1177
|
-
const { fetch: e, Request: r, Response: s } = t,
|
|
1178
|
-
if (!
|
|
1177
|
+
const { fetch: e, Request: r, Response: s } = t, o = e ? Oe(e) : typeof fetch == "function", i = Oe(r), a = Oe(s);
|
|
1178
|
+
if (!o)
|
|
1179
1179
|
return !1;
|
|
1180
|
-
const l =
|
|
1181
|
-
let
|
|
1180
|
+
const l = o && Oe(Et), h = o && (typeof Ct == "function" ? /* @__PURE__ */ ((d) => (j) => d.encode(j))(new Ct()) : async (d) => new Uint8Array(await new r(d).arrayBuffer())), c = i && l && Tt(() => {
|
|
1181
|
+
let d = !1;
|
|
1182
1182
|
const j = new r(ee.origin, {
|
|
1183
1183
|
body: new Et(),
|
|
1184
1184
|
method: "POST",
|
|
1185
1185
|
get duplex() {
|
|
1186
|
-
return
|
|
1186
|
+
return d = !0, "half";
|
|
1187
1187
|
}
|
|
1188
1188
|
}).headers.has("Content-Type");
|
|
1189
|
-
return
|
|
1190
|
-
}),
|
|
1191
|
-
stream:
|
|
1189
|
+
return d && !j;
|
|
1190
|
+
}), u = a && l && Tt(() => p.isReadableStream(new s("").body)), b = {
|
|
1191
|
+
stream: u && ((d) => d.body)
|
|
1192
1192
|
};
|
|
1193
|
-
|
|
1194
|
-
!b[
|
|
1195
|
-
let _ = j && j[
|
|
1193
|
+
o && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((d) => {
|
|
1194
|
+
!b[d] && (b[d] = (j, m) => {
|
|
1195
|
+
let _ = j && j[d];
|
|
1196
1196
|
if (_)
|
|
1197
1197
|
return _.call(j);
|
|
1198
|
-
throw new L(`Response type '${
|
|
1198
|
+
throw new L(`Response type '${d}' is not supported`, L.ERR_NOT_SUPPORT, m);
|
|
1199
1199
|
});
|
|
1200
1200
|
});
|
|
1201
|
-
const y = async (
|
|
1202
|
-
if (
|
|
1201
|
+
const y = async (d) => {
|
|
1202
|
+
if (d == null)
|
|
1203
1203
|
return 0;
|
|
1204
|
-
if (p.isBlob(
|
|
1205
|
-
return
|
|
1206
|
-
if (p.isSpecCompliantForm(
|
|
1204
|
+
if (p.isBlob(d))
|
|
1205
|
+
return d.size;
|
|
1206
|
+
if (p.isSpecCompliantForm(d))
|
|
1207
1207
|
return (await new r(ee.origin, {
|
|
1208
1208
|
method: "POST",
|
|
1209
|
-
body:
|
|
1209
|
+
body: d
|
|
1210
1210
|
}).arrayBuffer()).byteLength;
|
|
1211
|
-
if (p.isArrayBufferView(
|
|
1212
|
-
return
|
|
1213
|
-
if (p.isURLSearchParams(
|
|
1214
|
-
return (await h(
|
|
1215
|
-
}, w = async (
|
|
1216
|
-
const m = p.toFiniteNumber(
|
|
1211
|
+
if (p.isArrayBufferView(d) || p.isArrayBuffer(d))
|
|
1212
|
+
return d.byteLength;
|
|
1213
|
+
if (p.isURLSearchParams(d) && (d = d + ""), p.isString(d))
|
|
1214
|
+
return (await h(d)).byteLength;
|
|
1215
|
+
}, w = async (d, j) => {
|
|
1216
|
+
const m = p.toFiniteNumber(d.getContentLength());
|
|
1217
1217
|
return m ?? y(j);
|
|
1218
1218
|
};
|
|
1219
|
-
return async (
|
|
1219
|
+
return async (d) => {
|
|
1220
1220
|
let {
|
|
1221
1221
|
url: j,
|
|
1222
1222
|
method: m,
|
|
@@ -1230,7 +1230,7 @@ const tr = (t) => {
|
|
|
1230
1230
|
headers: v,
|
|
1231
1231
|
withCredentials: U = "same-origin",
|
|
1232
1232
|
fetchOptions: q
|
|
1233
|
-
} = tr(
|
|
1233
|
+
} = tr(d), F = e || fetch;
|
|
1234
1234
|
I = I ? (I + "").toLowerCase() : "text";
|
|
1235
1235
|
let V = Pn([R, A && A.toAbortSignal()], C), Z = null;
|
|
1236
1236
|
const T = V && V.unsubscribe && (() => {
|
|
@@ -1264,8 +1264,8 @@ const tr = (t) => {
|
|
|
1264
1264
|
};
|
|
1265
1265
|
Z = i && new r(j, P);
|
|
1266
1266
|
let K = await (i ? F(Z, q) : F(j, P));
|
|
1267
|
-
const Q =
|
|
1268
|
-
if (
|
|
1267
|
+
const Q = u && (I === "stream" || I === "response");
|
|
1268
|
+
if (u && (M || Q && T)) {
|
|
1269
1269
|
const f = {};
|
|
1270
1270
|
["status", "statusText", "headers"].forEach(($) => {
|
|
1271
1271
|
f[$] = K[$];
|
|
@@ -1282,36 +1282,36 @@ const tr = (t) => {
|
|
|
1282
1282
|
);
|
|
1283
1283
|
}
|
|
1284
1284
|
I = I || "text";
|
|
1285
|
-
let
|
|
1285
|
+
let G = await b[p.findKey(b, I) || "text"](K, d);
|
|
1286
1286
|
return !Q && T && T(), await new Promise((f, S) => {
|
|
1287
1287
|
Qt(f, S, {
|
|
1288
|
-
data:
|
|
1288
|
+
data: G,
|
|
1289
1289
|
headers: ne.from(K.headers),
|
|
1290
1290
|
status: K.status,
|
|
1291
1291
|
statusText: K.statusText,
|
|
1292
|
-
config:
|
|
1292
|
+
config: d,
|
|
1293
1293
|
request: Z
|
|
1294
1294
|
});
|
|
1295
1295
|
});
|
|
1296
1296
|
} catch (z) {
|
|
1297
1297
|
throw T && T(), z && z.name === "TypeError" && /Load failed|fetch/i.test(z.message) ? Object.assign(
|
|
1298
|
-
new L("Network Error", L.ERR_NETWORK,
|
|
1298
|
+
new L("Network Error", L.ERR_NETWORK, d, Z),
|
|
1299
1299
|
{
|
|
1300
1300
|
cause: z.cause || z
|
|
1301
1301
|
}
|
|
1302
|
-
) : L.from(z, z && z.code,
|
|
1302
|
+
) : L.from(z, z && z.code, d, Z);
|
|
1303
1303
|
}
|
|
1304
1304
|
};
|
|
1305
1305
|
}, Nn = /* @__PURE__ */ new Map(), rr = (t) => {
|
|
1306
1306
|
let e = t ? t.env : {};
|
|
1307
|
-
const { fetch: r, Request: s, Response:
|
|
1307
|
+
const { fetch: r, Request: s, Response: o } = e, i = [
|
|
1308
1308
|
s,
|
|
1309
|
-
|
|
1309
|
+
o,
|
|
1310
1310
|
r
|
|
1311
1311
|
];
|
|
1312
|
-
let
|
|
1312
|
+
let a = i.length, l = a, h, c, u = Nn;
|
|
1313
1313
|
for (; l--; )
|
|
1314
|
-
h = i[l], c =
|
|
1314
|
+
h = i[l], c = u.get(h), c === void 0 && u.set(h, c = l ? /* @__PURE__ */ new Map() : $n(e)), u = c;
|
|
1315
1315
|
return c;
|
|
1316
1316
|
};
|
|
1317
1317
|
rr();
|
|
@@ -1335,30 +1335,30 @@ const Rt = (t) => `- ${t}`, Un = (t) => p.isFunction(t) || t === null || t === !
|
|
|
1335
1335
|
getAdapter: (t, e) => {
|
|
1336
1336
|
t = p.isArray(t) ? t : [t];
|
|
1337
1337
|
const { length: r } = t;
|
|
1338
|
-
let s,
|
|
1338
|
+
let s, o;
|
|
1339
1339
|
const i = {};
|
|
1340
|
-
for (let
|
|
1341
|
-
s = t[
|
|
1340
|
+
for (let a = 0; a < r; a++) {
|
|
1341
|
+
s = t[a];
|
|
1342
1342
|
let l;
|
|
1343
|
-
if (
|
|
1343
|
+
if (o = s, !Un(s) && (o = tt[(l = String(s)).toLowerCase()], o === void 0))
|
|
1344
1344
|
throw new L(`Unknown adapter '${l}'`);
|
|
1345
|
-
if (
|
|
1345
|
+
if (o && (p.isFunction(o) || (o = o.get(e))))
|
|
1346
1346
|
break;
|
|
1347
|
-
i[l || "#" +
|
|
1347
|
+
i[l || "#" + a] = o;
|
|
1348
1348
|
}
|
|
1349
|
-
if (!
|
|
1350
|
-
const
|
|
1349
|
+
if (!o) {
|
|
1350
|
+
const a = Object.entries(i).map(
|
|
1351
1351
|
([h, c]) => `adapter ${h} ` + (c === !1 ? "is not supported by the environment" : "is not available in the build")
|
|
1352
1352
|
);
|
|
1353
|
-
let l = r ?
|
|
1354
|
-
` +
|
|
1355
|
-
`) : " " + Rt(
|
|
1353
|
+
let l = r ? a.length > 1 ? `since :
|
|
1354
|
+
` + a.map(Rt).join(`
|
|
1355
|
+
`) : " " + Rt(a[0]) : "as no adapter specified";
|
|
1356
1356
|
throw new L(
|
|
1357
1357
|
"There is no suitable adapter to dispatch the request " + l,
|
|
1358
1358
|
"ERR_NOT_SUPPORT"
|
|
1359
1359
|
);
|
|
1360
1360
|
}
|
|
1361
|
-
return
|
|
1361
|
+
return o;
|
|
1362
1362
|
},
|
|
1363
1363
|
adapters: tt
|
|
1364
1364
|
};
|
|
@@ -1392,21 +1392,21 @@ const sr = "1.12.2", Be = {};
|
|
|
1392
1392
|
});
|
|
1393
1393
|
const Pt = {};
|
|
1394
1394
|
Be.transitional = function(e, r, s) {
|
|
1395
|
-
function
|
|
1396
|
-
return "[Axios v" + sr + "] Transitional option '" + i + "'" +
|
|
1395
|
+
function o(i, a) {
|
|
1396
|
+
return "[Axios v" + sr + "] Transitional option '" + i + "'" + a + (s ? ". " + s : "");
|
|
1397
1397
|
}
|
|
1398
|
-
return (i,
|
|
1398
|
+
return (i, a, l) => {
|
|
1399
1399
|
if (e === !1)
|
|
1400
1400
|
throw new L(
|
|
1401
|
-
a
|
|
1401
|
+
o(a, " has been removed" + (r ? " in " + r : "")),
|
|
1402
1402
|
L.ERR_DEPRECATED
|
|
1403
1403
|
);
|
|
1404
|
-
return r && !Pt[
|
|
1405
|
-
|
|
1406
|
-
|
|
1404
|
+
return r && !Pt[a] && (Pt[a] = !0, console.warn(
|
|
1405
|
+
o(
|
|
1406
|
+
a,
|
|
1407
1407
|
" has been deprecated since v" + r + " and will be removed in the near future"
|
|
1408
1408
|
)
|
|
1409
|
-
)), e ? e(i,
|
|
1409
|
+
)), e ? e(i, a, l) : !0;
|
|
1410
1410
|
};
|
|
1411
1411
|
};
|
|
1412
1412
|
Be.spelling = function(e) {
|
|
@@ -1416,11 +1416,11 @@ function Dn(t, e, r) {
|
|
|
1416
1416
|
if (typeof t != "object")
|
|
1417
1417
|
throw new L("options must be an object", L.ERR_BAD_OPTION_VALUE);
|
|
1418
1418
|
const s = Object.keys(t);
|
|
1419
|
-
let
|
|
1420
|
-
for (;
|
|
1421
|
-
const i = s[
|
|
1422
|
-
if (
|
|
1423
|
-
const l = t[i], h = l === void 0 ||
|
|
1419
|
+
let o = s.length;
|
|
1420
|
+
for (; o-- > 0; ) {
|
|
1421
|
+
const i = s[o], a = e[i];
|
|
1422
|
+
if (a) {
|
|
1423
|
+
const l = t[i], h = l === void 0 || a(l, i, t);
|
|
1424
1424
|
if (h !== !0)
|
|
1425
1425
|
throw new L("option " + i + " must be " + h, L.ERR_BAD_OPTION_VALUE);
|
|
1426
1426
|
continue;
|
|
@@ -1433,7 +1433,7 @@ const $e = {
|
|
|
1433
1433
|
assertOptions: Dn,
|
|
1434
1434
|
validators: Be
|
|
1435
1435
|
}, ie = $e.validators;
|
|
1436
|
-
let
|
|
1436
|
+
let xe = class {
|
|
1437
1437
|
constructor(e) {
|
|
1438
1438
|
this.defaults = e || {}, this.interceptors = {
|
|
1439
1439
|
request: new yt(),
|
|
@@ -1453,9 +1453,9 @@ let he = class {
|
|
|
1453
1453
|
return await this._request(e, r);
|
|
1454
1454
|
} catch (s) {
|
|
1455
1455
|
if (s instanceof Error) {
|
|
1456
|
-
let
|
|
1457
|
-
Error.captureStackTrace ? Error.captureStackTrace(
|
|
1458
|
-
const i =
|
|
1456
|
+
let o = {};
|
|
1457
|
+
Error.captureStackTrace ? Error.captureStackTrace(o) : o = new Error();
|
|
1458
|
+
const i = o.stack ? o.stack.replace(/^.+\n/, "") : "";
|
|
1459
1459
|
try {
|
|
1460
1460
|
s.stack ? i && !String(s.stack).endsWith(i.replace(/^.+\n.+\n/, "")) && (s.stack += `
|
|
1461
1461
|
` + i) : s.stack = i;
|
|
@@ -1466,31 +1466,31 @@ let he = class {
|
|
|
1466
1466
|
}
|
|
1467
1467
|
}
|
|
1468
1468
|
_request(e, r) {
|
|
1469
|
-
typeof e == "string" ? (r = r || {}, r.url = e) : r = e || {}, r =
|
|
1470
|
-
const { transitional: s, paramsSerializer:
|
|
1469
|
+
typeof e == "string" ? (r = r || {}, r.url = e) : r = e || {}, r = he(this.defaults, r);
|
|
1470
|
+
const { transitional: s, paramsSerializer: o, headers: i } = r;
|
|
1471
1471
|
s !== void 0 && $e.assertOptions(s, {
|
|
1472
1472
|
silentJSONParsing: ie.transitional(ie.boolean),
|
|
1473
1473
|
forcedJSONParsing: ie.transitional(ie.boolean),
|
|
1474
1474
|
clarifyTimeoutError: ie.transitional(ie.boolean)
|
|
1475
|
-
}, !1),
|
|
1476
|
-
serialize:
|
|
1477
|
-
} : $e.assertOptions(
|
|
1475
|
+
}, !1), o != null && (p.isFunction(o) ? r.paramsSerializer = {
|
|
1476
|
+
serialize: o
|
|
1477
|
+
} : $e.assertOptions(o, {
|
|
1478
1478
|
encode: ie.function,
|
|
1479
1479
|
serialize: ie.function
|
|
1480
1480
|
}, !0)), r.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? r.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : r.allowAbsoluteUrls = !0), $e.assertOptions(r, {
|
|
1481
1481
|
baseUrl: ie.spelling("baseURL"),
|
|
1482
1482
|
withXsrfToken: ie.spelling("withXSRFToken")
|
|
1483
1483
|
}, !0), r.method = (r.method || this.defaults.method || "get").toLowerCase();
|
|
1484
|
-
let
|
|
1484
|
+
let a = i && p.merge(
|
|
1485
1485
|
i.common,
|
|
1486
1486
|
i[r.method]
|
|
1487
1487
|
);
|
|
1488
1488
|
i && p.forEach(
|
|
1489
1489
|
["delete", "get", "head", "post", "put", "patch", "common"],
|
|
1490
|
-
(
|
|
1491
|
-
delete i[
|
|
1490
|
+
(d) => {
|
|
1491
|
+
delete i[d];
|
|
1492
1492
|
}
|
|
1493
|
-
), r.headers = ne.concat(
|
|
1493
|
+
), r.headers = ne.concat(a, i);
|
|
1494
1494
|
const l = [];
|
|
1495
1495
|
let h = !0;
|
|
1496
1496
|
this.interceptors.request.forEach(function(j) {
|
|
@@ -1500,42 +1500,42 @@ let he = class {
|
|
|
1500
1500
|
this.interceptors.response.forEach(function(j) {
|
|
1501
1501
|
c.push(j.fulfilled, j.rejected);
|
|
1502
1502
|
});
|
|
1503
|
-
let
|
|
1503
|
+
let u, b = 0, y;
|
|
1504
1504
|
if (!h) {
|
|
1505
|
-
const
|
|
1506
|
-
for (
|
|
1507
|
-
|
|
1508
|
-
return
|
|
1505
|
+
const d = [It.bind(this), void 0];
|
|
1506
|
+
for (d.unshift(...l), d.push(...c), y = d.length, u = Promise.resolve(r); b < y; )
|
|
1507
|
+
u = u.then(d[b++], d[b++]);
|
|
1508
|
+
return u;
|
|
1509
1509
|
}
|
|
1510
1510
|
y = l.length;
|
|
1511
1511
|
let w = r;
|
|
1512
1512
|
for (; b < y; ) {
|
|
1513
|
-
const
|
|
1513
|
+
const d = l[b++], j = l[b++];
|
|
1514
1514
|
try {
|
|
1515
|
-
w =
|
|
1515
|
+
w = d(w);
|
|
1516
1516
|
} catch (m) {
|
|
1517
1517
|
j.call(this, m);
|
|
1518
1518
|
break;
|
|
1519
1519
|
}
|
|
1520
1520
|
}
|
|
1521
1521
|
try {
|
|
1522
|
-
|
|
1523
|
-
} catch (
|
|
1524
|
-
return Promise.reject(
|
|
1522
|
+
u = It.call(this, w);
|
|
1523
|
+
} catch (d) {
|
|
1524
|
+
return Promise.reject(d);
|
|
1525
1525
|
}
|
|
1526
1526
|
for (b = 0, y = c.length; b < y; )
|
|
1527
|
-
|
|
1528
|
-
return
|
|
1527
|
+
u = u.then(c[b++], c[b++]);
|
|
1528
|
+
return u;
|
|
1529
1529
|
}
|
|
1530
1530
|
getUri(e) {
|
|
1531
|
-
e =
|
|
1531
|
+
e = he(this.defaults, e);
|
|
1532
1532
|
const r = er(e.baseURL, e.url, e.allowAbsoluteUrls);
|
|
1533
1533
|
return Jt(r, e.params, e.paramsSerializer);
|
|
1534
1534
|
}
|
|
1535
1535
|
};
|
|
1536
1536
|
p.forEach(["delete", "get", "head", "options"], function(e) {
|
|
1537
|
-
|
|
1538
|
-
return this.request(
|
|
1537
|
+
xe.prototype[e] = function(r, s) {
|
|
1538
|
+
return this.request(he(s || {}, {
|
|
1539
1539
|
method: e,
|
|
1540
1540
|
url: r,
|
|
1541
1541
|
data: (s || {}).data
|
|
@@ -1544,20 +1544,20 @@ p.forEach(["delete", "get", "head", "options"], function(e) {
|
|
|
1544
1544
|
});
|
|
1545
1545
|
p.forEach(["post", "put", "patch"], function(e) {
|
|
1546
1546
|
function r(s) {
|
|
1547
|
-
return function(i,
|
|
1548
|
-
return this.request(
|
|
1547
|
+
return function(i, a, l) {
|
|
1548
|
+
return this.request(he(l || {}, {
|
|
1549
1549
|
method: e,
|
|
1550
1550
|
headers: s ? {
|
|
1551
1551
|
"Content-Type": "multipart/form-data"
|
|
1552
1552
|
} : {},
|
|
1553
1553
|
url: i,
|
|
1554
|
-
data:
|
|
1554
|
+
data: a
|
|
1555
1555
|
}));
|
|
1556
1556
|
};
|
|
1557
1557
|
}
|
|
1558
|
-
|
|
1558
|
+
xe.prototype[e] = r(), xe.prototype[e + "Form"] = r(!0);
|
|
1559
1559
|
});
|
|
1560
|
-
let Ln = class
|
|
1560
|
+
let Ln = class or {
|
|
1561
1561
|
constructor(e) {
|
|
1562
1562
|
if (typeof e != "function")
|
|
1563
1563
|
throw new TypeError("executor must be a function.");
|
|
@@ -1566,22 +1566,22 @@ let Ln = class ar {
|
|
|
1566
1566
|
r = i;
|
|
1567
1567
|
});
|
|
1568
1568
|
const s = this;
|
|
1569
|
-
this.promise.then((
|
|
1569
|
+
this.promise.then((o) => {
|
|
1570
1570
|
if (!s._listeners) return;
|
|
1571
1571
|
let i = s._listeners.length;
|
|
1572
1572
|
for (; i-- > 0; )
|
|
1573
|
-
s._listeners[i](
|
|
1573
|
+
s._listeners[i](o);
|
|
1574
1574
|
s._listeners = null;
|
|
1575
|
-
}), this.promise.then = (
|
|
1575
|
+
}), this.promise.then = (o) => {
|
|
1576
1576
|
let i;
|
|
1577
|
-
const
|
|
1577
|
+
const a = new Promise((l) => {
|
|
1578
1578
|
s.subscribe(l), i = l;
|
|
1579
|
-
}).then(
|
|
1580
|
-
return
|
|
1579
|
+
}).then(o);
|
|
1580
|
+
return a.cancel = function() {
|
|
1581
1581
|
s.unsubscribe(i);
|
|
1582
|
-
},
|
|
1583
|
-
}, e(function(i,
|
|
1584
|
-
s.reason || (s.reason = new je(i,
|
|
1582
|
+
}, a;
|
|
1583
|
+
}, e(function(i, a, l) {
|
|
1584
|
+
s.reason || (s.reason = new je(i, a, l), r(s.reason));
|
|
1585
1585
|
});
|
|
1586
1586
|
}
|
|
1587
1587
|
/**
|
|
@@ -1623,8 +1623,8 @@ let Ln = class ar {
|
|
|
1623
1623
|
static source() {
|
|
1624
1624
|
let e;
|
|
1625
1625
|
return {
|
|
1626
|
-
token: new
|
|
1627
|
-
e =
|
|
1626
|
+
token: new or(function(o) {
|
|
1627
|
+
e = o;
|
|
1628
1628
|
}),
|
|
1629
1629
|
cancel: e
|
|
1630
1630
|
};
|
|
@@ -1706,14 +1706,14 @@ const rt = {
|
|
|
1706
1706
|
Object.entries(rt).forEach(([t, e]) => {
|
|
1707
1707
|
rt[e] = t;
|
|
1708
1708
|
});
|
|
1709
|
-
function
|
|
1710
|
-
const e = new
|
|
1711
|
-
return p.extend(r,
|
|
1712
|
-
return
|
|
1709
|
+
function ar(t) {
|
|
1710
|
+
const e = new xe(t), r = Ut(xe.prototype.request, e);
|
|
1711
|
+
return p.extend(r, xe.prototype, e, { allOwnKeys: !0 }), p.extend(r, e, null, { allOwnKeys: !0 }), r.create = function(o) {
|
|
1712
|
+
return ar(he(t, o));
|
|
1713
1713
|
}, r;
|
|
1714
1714
|
}
|
|
1715
|
-
const W =
|
|
1716
|
-
W.Axios =
|
|
1715
|
+
const W = ar(Ie);
|
|
1716
|
+
W.Axios = xe;
|
|
1717
1717
|
W.CanceledError = je;
|
|
1718
1718
|
W.CancelToken = Ln;
|
|
1719
1719
|
W.isCancel = Zt;
|
|
@@ -1726,31 +1726,31 @@ W.all = function(e) {
|
|
|
1726
1726
|
};
|
|
1727
1727
|
W.spread = Fn;
|
|
1728
1728
|
W.isAxiosError = Mn;
|
|
1729
|
-
W.mergeConfig =
|
|
1729
|
+
W.mergeConfig = he;
|
|
1730
1730
|
W.AxiosHeaders = ne;
|
|
1731
|
-
W.formToJSON = (t) =>
|
|
1731
|
+
W.formToJSON = (t) => Xt(p.isHTMLForm(t) ? new FormData(t) : t);
|
|
1732
1732
|
W.getAdapter = nr.getAdapter;
|
|
1733
1733
|
W.HttpStatusCode = rt;
|
|
1734
1734
|
W.default = W;
|
|
1735
1735
|
const {
|
|
1736
1736
|
Axios: Ks,
|
|
1737
1737
|
AxiosError: Js,
|
|
1738
|
-
CanceledError:
|
|
1739
|
-
isCancel:
|
|
1738
|
+
CanceledError: Gs,
|
|
1739
|
+
isCancel: Xs,
|
|
1740
1740
|
CancelToken: Zs,
|
|
1741
1741
|
VERSION: Qs,
|
|
1742
|
-
all:
|
|
1743
|
-
Cancel:
|
|
1744
|
-
isAxiosError:
|
|
1745
|
-
spread:
|
|
1746
|
-
toFormData:
|
|
1747
|
-
AxiosHeaders:
|
|
1748
|
-
HttpStatusCode:
|
|
1749
|
-
formToJSON:
|
|
1750
|
-
getAdapter:
|
|
1751
|
-
mergeConfig:
|
|
1742
|
+
all: eo,
|
|
1743
|
+
Cancel: to,
|
|
1744
|
+
isAxiosError: ro,
|
|
1745
|
+
spread: no,
|
|
1746
|
+
toFormData: so,
|
|
1747
|
+
AxiosHeaders: oo,
|
|
1748
|
+
HttpStatusCode: ao,
|
|
1749
|
+
formToJSON: io,
|
|
1750
|
+
getAdapter: lo,
|
|
1751
|
+
mergeConfig: co
|
|
1752
1752
|
} = W;
|
|
1753
|
-
class
|
|
1753
|
+
class uo {
|
|
1754
1754
|
baseUrl;
|
|
1755
1755
|
apiKey;
|
|
1756
1756
|
appId;
|
|
@@ -1779,7 +1779,7 @@ class da {
|
|
|
1779
1779
|
* @param data Optional request body
|
|
1780
1780
|
* @param extraHeaders Optional custom headers
|
|
1781
1781
|
*/
|
|
1782
|
-
async request(e, r, s,
|
|
1782
|
+
async request(e, r, s, o = {}) {
|
|
1783
1783
|
if (!e) throw new Error("HTTP method is required");
|
|
1784
1784
|
if (!r) throw new Error("Request path is required");
|
|
1785
1785
|
try {
|
|
@@ -1791,12 +1791,12 @@ class da {
|
|
|
1791
1791
|
url: r,
|
|
1792
1792
|
method: e,
|
|
1793
1793
|
data: i,
|
|
1794
|
-
headers:
|
|
1794
|
+
headers: o
|
|
1795
1795
|
})).data;
|
|
1796
1796
|
} catch (i) {
|
|
1797
1797
|
if (console.error("❌ [Request Error]:", i), i.isAxiosError) {
|
|
1798
|
-
const
|
|
1799
|
-
throw new Error(`Request failed (${
|
|
1798
|
+
const a = i.response?.status || 0, l = i.response?.data?.message || i.message || "Unknown Axios error occurred";
|
|
1799
|
+
throw new Error(`Request failed (${a}): ${l}`);
|
|
1800
1800
|
}
|
|
1801
1801
|
throw new Error(`Unexpected error: ${i.message || "Unknown failure"}`);
|
|
1802
1802
|
}
|
|
@@ -1807,8 +1807,8 @@ class da {
|
|
|
1807
1807
|
* @param params user details
|
|
1808
1808
|
*/
|
|
1809
1809
|
async signup(e) {
|
|
1810
|
-
const { name: r, email: s, password:
|
|
1811
|
-
if (!r || !s || !
|
|
1810
|
+
const { name: r, email: s, password: o } = e;
|
|
1811
|
+
if (!r || !s || !o)
|
|
1812
1812
|
throw new Error("signup: 'name', 'email', and 'password' are required");
|
|
1813
1813
|
return this.request("POST", "/users/signup", e);
|
|
1814
1814
|
}
|
|
@@ -1817,13 +1817,13 @@ class da {
|
|
|
1817
1817
|
* @param params login details
|
|
1818
1818
|
*/
|
|
1819
1819
|
async login(e) {
|
|
1820
|
-
const { email: r, password: s, appId:
|
|
1820
|
+
const { email: r, password: s, appId: o } = e;
|
|
1821
1821
|
if (!r || !s)
|
|
1822
1822
|
throw new Error("login: 'email' and 'password' are required");
|
|
1823
1823
|
return this.request("POST", "/users/login", {
|
|
1824
1824
|
email: r,
|
|
1825
1825
|
password: s,
|
|
1826
|
-
appId:
|
|
1826
|
+
appId: o || this.appId
|
|
1827
1827
|
});
|
|
1828
1828
|
}
|
|
1829
1829
|
/**
|
|
@@ -1843,15 +1843,15 @@ class da {
|
|
|
1843
1843
|
* @param params requires userId, currentPassword, newPassword
|
|
1844
1844
|
*/
|
|
1845
1845
|
async changePassword(e) {
|
|
1846
|
-
const { userId: r, currentPassword: s, newPassword:
|
|
1846
|
+
const { userId: r, currentPassword: s, newPassword: o, appId: i } = e;
|
|
1847
1847
|
if (!r) throw new Error("changePassword: 'userId' is required");
|
|
1848
|
-
if (!s || !
|
|
1848
|
+
if (!s || !o)
|
|
1849
1849
|
throw new Error(
|
|
1850
1850
|
"changePassword: both 'currentPassword' and 'newPassword' are required"
|
|
1851
1851
|
);
|
|
1852
1852
|
return this.request("PUT", `/users/change-password/${r}`, {
|
|
1853
1853
|
currentPassword: s,
|
|
1854
|
-
newPassword:
|
|
1854
|
+
newPassword: o,
|
|
1855
1855
|
appId: i || this.appId
|
|
1856
1856
|
});
|
|
1857
1857
|
}
|
|
@@ -1900,13 +1900,13 @@ class da {
|
|
|
1900
1900
|
* @param params requires token + otp
|
|
1901
1901
|
*/
|
|
1902
1902
|
async verifyEmail(e) {
|
|
1903
|
-
const { token: r, otp: s, appId:
|
|
1903
|
+
const { token: r, otp: s, appId: o } = e;
|
|
1904
1904
|
if (!r) throw new Error("verifyEmail: 'token' is required");
|
|
1905
1905
|
if (!s) throw new Error("verifyEmail: 'otp' is required");
|
|
1906
1906
|
return this.request(
|
|
1907
1907
|
"POST",
|
|
1908
1908
|
"/users/verify-email",
|
|
1909
|
-
{ otp: s, appId:
|
|
1909
|
+
{ otp: s, appId: o || this.appId },
|
|
1910
1910
|
{ Authorization: `Bearer ${r}` }
|
|
1911
1911
|
);
|
|
1912
1912
|
}
|
|
@@ -1927,18 +1927,33 @@ class da {
|
|
|
1927
1927
|
* @param params requires email, otp, newPassword
|
|
1928
1928
|
*/
|
|
1929
1929
|
async resetPassword(e) {
|
|
1930
|
-
const { email: r, otp: s, newPassword:
|
|
1931
|
-
if (!r || !s || !
|
|
1930
|
+
const { email: r, otp: s, newPassword: o, appId: i } = e;
|
|
1931
|
+
if (!r || !s || !o)
|
|
1932
1932
|
throw new Error(
|
|
1933
1933
|
"resetPassword: 'email', 'otp' and 'newPassword' are required"
|
|
1934
1934
|
);
|
|
1935
1935
|
return this.request("POST", "/users/reset-password", {
|
|
1936
1936
|
email: r,
|
|
1937
1937
|
otp: s,
|
|
1938
|
-
newPassword:
|
|
1938
|
+
newPassword: o,
|
|
1939
1939
|
appId: i || this.appId
|
|
1940
1940
|
});
|
|
1941
1941
|
}
|
|
1942
|
+
/**
|
|
1943
|
+
* Check if a user exists for this app (lightweight)
|
|
1944
|
+
* @param userId user id to check
|
|
1945
|
+
* @returns { exists: boolean }
|
|
1946
|
+
*/
|
|
1947
|
+
async checkUser(e) {
|
|
1948
|
+
if (!e)
|
|
1949
|
+
throw new Error("checkUser: 'userId' is required");
|
|
1950
|
+
if (!this.appId)
|
|
1951
|
+
throw new Error("checkUser: SDK 'appId' is missing in config");
|
|
1952
|
+
return this.request(
|
|
1953
|
+
"GET",
|
|
1954
|
+
`/users/check-user/${e}?appId=${this.appId}`
|
|
1955
|
+
);
|
|
1956
|
+
}
|
|
1942
1957
|
// ================= USER EXTRA DATA =================
|
|
1943
1958
|
async searchAllUsersData(e) {
|
|
1944
1959
|
if (!this.appId) throw new Error("searchAllUsersData: appId missing");
|
|
@@ -1948,8 +1963,8 @@ class da {
|
|
|
1948
1963
|
async searchUserData(e) {
|
|
1949
1964
|
const { userId: r, ...s } = e;
|
|
1950
1965
|
if (!r) throw new Error("userId required");
|
|
1951
|
-
const
|
|
1952
|
-
return this.request("GET", `/users/${r}/data/search?${
|
|
1966
|
+
const o = new URLSearchParams(s).toString();
|
|
1967
|
+
return this.request("GET", `/users/${r}/data/search?${o}`);
|
|
1953
1968
|
}
|
|
1954
1969
|
/**
|
|
1955
1970
|
* Fetch ALL users' merged data for a specific app
|
|
@@ -1984,14 +1999,14 @@ class da {
|
|
|
1984
1999
|
* @param params requires userId and data object
|
|
1985
2000
|
*/
|
|
1986
2001
|
async addUserData(e) {
|
|
1987
|
-
const { userId: r, dataCategory: s, data:
|
|
2002
|
+
const { userId: r, dataCategory: s, data: o } = e;
|
|
1988
2003
|
if (!r) throw new Error("addUserData: 'userId' is required");
|
|
1989
2004
|
if (!s)
|
|
1990
2005
|
throw new Error("addUserData: 'dataCategory' is required");
|
|
1991
|
-
if (!
|
|
2006
|
+
if (!o) throw new Error("addUserData: 'data' is required");
|
|
1992
2007
|
return this.request("POST", `/users/${r}/data`, {
|
|
1993
2008
|
dataCategory: s,
|
|
1994
|
-
...
|
|
2009
|
+
...o
|
|
1995
2010
|
});
|
|
1996
2011
|
}
|
|
1997
2012
|
/**
|
|
@@ -1999,11 +2014,11 @@ class da {
|
|
|
1999
2014
|
* @param params requires userId, dataId, and updated fields
|
|
2000
2015
|
*/
|
|
2001
2016
|
async updateUserData(e) {
|
|
2002
|
-
const { userId: r, dataId: s, data:
|
|
2017
|
+
const { userId: r, dataId: s, data: o } = e;
|
|
2003
2018
|
if (!r || !s)
|
|
2004
2019
|
throw new Error("updateUserData: 'userId' and 'dataId' are required");
|
|
2005
|
-
if (!
|
|
2006
|
-
return this.request("PUT", `/users/${r}/data/${s}`,
|
|
2020
|
+
if (!o) throw new Error("updateUserData: 'data' is required");
|
|
2021
|
+
return this.request("PUT", `/users/${r}/data/${s}`, o);
|
|
2007
2022
|
}
|
|
2008
2023
|
/**
|
|
2009
2024
|
* Delete a data object by its id
|
|
@@ -2031,18 +2046,18 @@ function Wn() {
|
|
|
2031
2046
|
if (Ot) return ke;
|
|
2032
2047
|
Ot = 1;
|
|
2033
2048
|
var t = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
|
|
2034
|
-
function r(s,
|
|
2035
|
-
var
|
|
2036
|
-
if (i !== void 0 && (
|
|
2049
|
+
function r(s, o, i) {
|
|
2050
|
+
var a = null;
|
|
2051
|
+
if (i !== void 0 && (a = "" + i), o.key !== void 0 && (a = "" + o.key), "key" in o) {
|
|
2037
2052
|
i = {};
|
|
2038
|
-
for (var l in
|
|
2039
|
-
l !== "key" && (i[l] =
|
|
2040
|
-
} else i =
|
|
2041
|
-
return
|
|
2053
|
+
for (var l in o)
|
|
2054
|
+
l !== "key" && (i[l] = o[l]);
|
|
2055
|
+
} else i = o;
|
|
2056
|
+
return o = i.ref, {
|
|
2042
2057
|
$$typeof: t,
|
|
2043
2058
|
type: s,
|
|
2044
|
-
key:
|
|
2045
|
-
ref:
|
|
2059
|
+
key: a,
|
|
2060
|
+
ref: o !== void 0 ? o : null,
|
|
2046
2061
|
props: i
|
|
2047
2062
|
};
|
|
2048
2063
|
}
|
|
@@ -2135,14 +2150,14 @@ function qn() {
|
|
|
2135
2150
|
return "<...>";
|
|
2136
2151
|
}
|
|
2137
2152
|
}
|
|
2138
|
-
function
|
|
2153
|
+
function o() {
|
|
2139
2154
|
var f = V.A;
|
|
2140
2155
|
return f === null ? null : f.getOwner();
|
|
2141
2156
|
}
|
|
2142
2157
|
function i() {
|
|
2143
2158
|
return Error("react-stack-top-frame");
|
|
2144
2159
|
}
|
|
2145
|
-
function
|
|
2160
|
+
function a(f) {
|
|
2146
2161
|
if (Z.call(f, "key")) {
|
|
2147
2162
|
var S = Object.getOwnPropertyDescriptor(f, "key").get;
|
|
2148
2163
|
if (S && S.isReactWarning) return !1;
|
|
@@ -2170,7 +2185,7 @@ function qn() {
|
|
|
2170
2185
|
function c(f, S, x, k, $, N) {
|
|
2171
2186
|
var Y = x.ref;
|
|
2172
2187
|
return f = {
|
|
2173
|
-
$$typeof:
|
|
2188
|
+
$$typeof: d,
|
|
2174
2189
|
type: f,
|
|
2175
2190
|
key: S,
|
|
2176
2191
|
props: x,
|
|
@@ -2200,7 +2215,7 @@ function qn() {
|
|
|
2200
2215
|
value: N
|
|
2201
2216
|
}), Object.freeze && (Object.freeze(f.props), Object.freeze(f)), f;
|
|
2202
2217
|
}
|
|
2203
|
-
function
|
|
2218
|
+
function u(f, S, x, k, $, N) {
|
|
2204
2219
|
var Y = S.children;
|
|
2205
2220
|
if (Y !== void 0)
|
|
2206
2221
|
if (k)
|
|
@@ -2218,7 +2233,7 @@ function qn() {
|
|
|
2218
2233
|
var se = Object.keys(S).filter(function(ve) {
|
|
2219
2234
|
return ve !== "key";
|
|
2220
2235
|
});
|
|
2221
|
-
k = 0 < se.length ? "{key: someKey, " + se.join(": ..., ") + ": ...}" : "{key: someKey}",
|
|
2236
|
+
k = 0 < se.length ? "{key: someKey, " + se.join(": ..., ") + ": ...}" : "{key: someKey}", G[Y + k] || (se = 0 < se.length ? "{" + se.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
2222
2237
|
`A props object containing a "key" prop is being spread into JSX:
|
|
2223
2238
|
let props = %s;
|
|
2224
2239
|
<%s {...props} />
|
|
@@ -2229,12 +2244,12 @@ React keys must be passed directly to JSX without using spread:
|
|
|
2229
2244
|
Y,
|
|
2230
2245
|
se,
|
|
2231
2246
|
Y
|
|
2232
|
-
),
|
|
2247
|
+
), G[Y + k] = !0);
|
|
2233
2248
|
}
|
|
2234
|
-
if (Y = null, x !== void 0 && (r(x), Y = "" + x),
|
|
2249
|
+
if (Y = null, x !== void 0 && (r(x), Y = "" + x), a(S) && (r(S.key), Y = "" + S.key), "key" in S) {
|
|
2235
2250
|
x = {};
|
|
2236
|
-
for (var
|
|
2237
|
-
|
|
2251
|
+
for (var ue in S)
|
|
2252
|
+
ue !== "key" && (x[ue] = S[ue]);
|
|
2238
2253
|
} else x = S;
|
|
2239
2254
|
return Y && l(
|
|
2240
2255
|
x,
|
|
@@ -2243,7 +2258,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
2243
2258
|
f,
|
|
2244
2259
|
Y,
|
|
2245
2260
|
x,
|
|
2246
|
-
|
|
2261
|
+
o(),
|
|
2247
2262
|
$,
|
|
2248
2263
|
N
|
|
2249
2264
|
);
|
|
@@ -2252,9 +2267,9 @@ React keys must be passed directly to JSX without using spread:
|
|
|
2252
2267
|
y(f) ? f._store && (f._store.validated = 1) : typeof f == "object" && f !== null && f.$$typeof === U && (f._payload.status === "fulfilled" ? y(f._payload.value) && f._payload.value._store && (f._payload.value._store.validated = 1) : f._store && (f._store.validated = 1));
|
|
2253
2268
|
}
|
|
2254
2269
|
function y(f) {
|
|
2255
|
-
return typeof f == "object" && f !== null && f.$$typeof ===
|
|
2270
|
+
return typeof f == "object" && f !== null && f.$$typeof === d;
|
|
2256
2271
|
}
|
|
2257
|
-
var w = Le,
|
|
2272
|
+
var w = Le, d = Symbol.for("react.transitional.element"), j = Symbol.for("react.portal"), m = Symbol.for("react.fragment"), _ = Symbol.for("react.strict_mode"), R = Symbol.for("react.profiler"), A = Symbol.for("react.consumer"), C = Symbol.for("react.context"), M = Symbol.for("react.forward_ref"), g = Symbol.for("react.suspense"), I = Symbol.for("react.suspense_list"), v = Symbol.for("react.memo"), U = Symbol.for("react.lazy"), q = Symbol.for("react.activity"), F = Symbol.for("react.client.reference"), V = w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Z = Object.prototype.hasOwnProperty, T = Array.isArray, J = console.createTask ? console.createTask : function() {
|
|
2258
2273
|
return null;
|
|
2259
2274
|
};
|
|
2260
2275
|
w = {
|
|
@@ -2265,10 +2280,10 @@ React keys must be passed directly to JSX without using spread:
|
|
|
2265
2280
|
var z, P = {}, K = w.react_stack_bottom_frame.bind(
|
|
2266
2281
|
w,
|
|
2267
2282
|
i
|
|
2268
|
-
)(), Q = J(s(i)),
|
|
2283
|
+
)(), Q = J(s(i)), G = {};
|
|
2269
2284
|
Ee.Fragment = m, Ee.jsx = function(f, S, x) {
|
|
2270
2285
|
var k = 1e4 > V.recentlyCreatedOwnerStacks++;
|
|
2271
|
-
return
|
|
2286
|
+
return u(
|
|
2272
2287
|
f,
|
|
2273
2288
|
S,
|
|
2274
2289
|
x,
|
|
@@ -2278,7 +2293,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
2278
2293
|
);
|
|
2279
2294
|
}, Ee.jsxs = function(f, S, x) {
|
|
2280
2295
|
var k = 1e4 > V.recentlyCreatedOwnerStacks++;
|
|
2281
|
-
return
|
|
2296
|
+
return u(
|
|
2282
2297
|
f,
|
|
2283
2298
|
S,
|
|
2284
2299
|
x,
|
|
@@ -2295,10 +2310,10 @@ function Bn() {
|
|
|
2295
2310
|
}
|
|
2296
2311
|
var n = Bn();
|
|
2297
2312
|
const Hn = async (t, e) => {
|
|
2298
|
-
const { name: r, email: s, password:
|
|
2313
|
+
const { name: r, email: s, password: o, appId: i, phone: a, address: l, avatarUrl: h, isActive: c = !0, role: u = "user" } = t, { baseUrl: b, apiKey: y } = e;
|
|
2299
2314
|
if (!y)
|
|
2300
2315
|
throw new Error("API key is required for signup");
|
|
2301
|
-
if (!r || !s || !
|
|
2316
|
+
if (!r || !s || !o || !i)
|
|
2302
2317
|
throw new Error("Name, email, password, and appId are required");
|
|
2303
2318
|
try {
|
|
2304
2319
|
const w = await W.post(
|
|
@@ -2306,13 +2321,13 @@ const Hn = async (t, e) => {
|
|
|
2306
2321
|
{
|
|
2307
2322
|
name: r,
|
|
2308
2323
|
email: s,
|
|
2309
|
-
password:
|
|
2324
|
+
password: o,
|
|
2310
2325
|
appId: i,
|
|
2311
|
-
phone:
|
|
2326
|
+
phone: a,
|
|
2312
2327
|
address: l,
|
|
2313
2328
|
avatarUrl: h,
|
|
2314
2329
|
isActive: c,
|
|
2315
|
-
role:
|
|
2330
|
+
role: u
|
|
2316
2331
|
},
|
|
2317
2332
|
{
|
|
2318
2333
|
headers: {
|
|
@@ -2323,15 +2338,15 @@ const Hn = async (t, e) => {
|
|
|
2323
2338
|
);
|
|
2324
2339
|
return w.data?.user && localStorage.setItem("userInfo", JSON.stringify(w.data.user)), w.data.user;
|
|
2325
2340
|
} catch (w) {
|
|
2326
|
-
const
|
|
2327
|
-
if (console.error("Signup API Error:",
|
|
2328
|
-
if (
|
|
2341
|
+
const d = w.response?.data?.message || w.message || "Signup failed";
|
|
2342
|
+
if (console.error("Signup API Error:", d), w.response?.status === 400) {
|
|
2343
|
+
if (d.includes("already exists"))
|
|
2329
2344
|
throw {
|
|
2330
2345
|
success: !1,
|
|
2331
2346
|
message: "User with this email already exists for this app",
|
|
2332
2347
|
status: 400
|
|
2333
2348
|
};
|
|
2334
|
-
if (
|
|
2349
|
+
if (d.includes("inactive"))
|
|
2335
2350
|
throw {
|
|
2336
2351
|
success: !1,
|
|
2337
2352
|
message: "Cannot signup under an inactive app",
|
|
@@ -2344,7 +2359,7 @@ const Hn = async (t, e) => {
|
|
|
2344
2359
|
status: 404
|
|
2345
2360
|
} : {
|
|
2346
2361
|
success: !1,
|
|
2347
|
-
message:
|
|
2362
|
+
message: d,
|
|
2348
2363
|
status: w.response?.status || 500
|
|
2349
2364
|
};
|
|
2350
2365
|
}
|
|
@@ -2389,17 +2404,17 @@ var Jn = {
|
|
|
2389
2404
|
* This source code is licensed under the ISC license.
|
|
2390
2405
|
* See the LICENSE file in the root directory of this source tree.
|
|
2391
2406
|
*/
|
|
2392
|
-
const
|
|
2407
|
+
const Gn = Nt(
|
|
2393
2408
|
({
|
|
2394
2409
|
color: t = "currentColor",
|
|
2395
2410
|
size: e = 24,
|
|
2396
2411
|
strokeWidth: r = 2,
|
|
2397
2412
|
absoluteStrokeWidth: s,
|
|
2398
|
-
className:
|
|
2413
|
+
className: o = "",
|
|
2399
2414
|
children: i,
|
|
2400
|
-
iconNode:
|
|
2415
|
+
iconNode: a,
|
|
2401
2416
|
...l
|
|
2402
|
-
}, h) =>
|
|
2417
|
+
}, h) => Xe(
|
|
2403
2418
|
"svg",
|
|
2404
2419
|
{
|
|
2405
2420
|
ref: h,
|
|
@@ -2408,12 +2423,12 @@ const Xn = Nt(
|
|
|
2408
2423
|
height: e,
|
|
2409
2424
|
stroke: t,
|
|
2410
2425
|
strokeWidth: s ? Number(r) * 24 / Number(e) : r,
|
|
2411
|
-
className: ir("lucide",
|
|
2426
|
+
className: ir("lucide", o),
|
|
2412
2427
|
...!i && !Kn(l) && { "aria-hidden": "true" },
|
|
2413
2428
|
...l
|
|
2414
2429
|
},
|
|
2415
2430
|
[
|
|
2416
|
-
...
|
|
2431
|
+
...a.map(([c, u]) => Xe(c, u)),
|
|
2417
2432
|
...Array.isArray(i) ? i : [i]
|
|
2418
2433
|
]
|
|
2419
2434
|
)
|
|
@@ -2426,7 +2441,7 @@ const Xn = Nt(
|
|
|
2426
2441
|
*/
|
|
2427
2442
|
const B = (t, e) => {
|
|
2428
2443
|
const r = Nt(
|
|
2429
|
-
({ className: s, ...
|
|
2444
|
+
({ className: s, ...o }, i) => Xe(Gn, {
|
|
2430
2445
|
ref: i,
|
|
2431
2446
|
iconNode: e,
|
|
2432
2447
|
className: ir(
|
|
@@ -2434,7 +2449,7 @@ const B = (t, e) => {
|
|
|
2434
2449
|
`lucide-${t}`,
|
|
2435
2450
|
s
|
|
2436
2451
|
),
|
|
2437
|
-
...
|
|
2452
|
+
...o
|
|
2438
2453
|
})
|
|
2439
2454
|
);
|
|
2440
2455
|
return r.displayName = _t(t), r;
|
|
@@ -2445,7 +2460,7 @@ const B = (t, e) => {
|
|
|
2445
2460
|
* This source code is licensed under the ISC license.
|
|
2446
2461
|
* See the LICENSE file in the root directory of this source tree.
|
|
2447
2462
|
*/
|
|
2448
|
-
const
|
|
2463
|
+
const Xn = [
|
|
2449
2464
|
[
|
|
2450
2465
|
"path",
|
|
2451
2466
|
{
|
|
@@ -2454,7 +2469,7 @@ const Gn = [
|
|
|
2454
2469
|
}
|
|
2455
2470
|
],
|
|
2456
2471
|
["circle", { cx: "12", cy: "13", r: "3", key: "1vg3eu" }]
|
|
2457
|
-
], nt = B("camera",
|
|
2472
|
+
], nt = B("camera", Xn);
|
|
2458
2473
|
/**
|
|
2459
2474
|
* @license lucide-react v0.544.0 - ISC
|
|
2460
2475
|
*
|
|
@@ -2492,7 +2507,7 @@ const ts = [
|
|
|
2492
2507
|
const rs = [
|
|
2493
2508
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
2494
2509
|
["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
|
|
2495
|
-
],
|
|
2510
|
+
], Ge = B("circle-check", rs);
|
|
2496
2511
|
/**
|
|
2497
2512
|
* @license lucide-react v0.544.0 - ISC
|
|
2498
2513
|
*
|
|
@@ -2510,11 +2525,11 @@ const ns = [
|
|
|
2510
2525
|
* This source code is licensed under the ISC license.
|
|
2511
2526
|
* See the LICENSE file in the root directory of this source tree.
|
|
2512
2527
|
*/
|
|
2513
|
-
const
|
|
2528
|
+
const os = [
|
|
2514
2529
|
["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
|
|
2515
2530
|
["circle", { cx: "12", cy: "5", r: "1", key: "gxeob9" }],
|
|
2516
2531
|
["circle", { cx: "12", cy: "19", r: "1", key: "lyex9k" }]
|
|
2517
|
-
],
|
|
2532
|
+
], as = B("ellipsis-vertical", os);
|
|
2518
2533
|
/**
|
|
2519
2534
|
* @license lucide-react v0.544.0 - ISC
|
|
2520
2535
|
*
|
|
@@ -2626,7 +2641,7 @@ const xs = [
|
|
|
2626
2641
|
* This source code is licensed under the ISC license.
|
|
2627
2642
|
* See the LICENSE file in the root directory of this source tree.
|
|
2628
2643
|
*/
|
|
2629
|
-
const gs = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]],
|
|
2644
|
+
const gs = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], oe = B("loader-circle", gs);
|
|
2630
2645
|
/**
|
|
2631
2646
|
* @license lucide-react v0.544.0 - ISC
|
|
2632
2647
|
*
|
|
@@ -2850,30 +2865,30 @@ const Ls = [
|
|
|
2850
2865
|
baseUrl: "",
|
|
2851
2866
|
apiKey: "",
|
|
2852
2867
|
appId: ""
|
|
2853
|
-
},
|
|
2868
|
+
}, po = (t) => {
|
|
2854
2869
|
if (!t.baseUrl || !t.apiKey || !t.appId)
|
|
2855
2870
|
throw new Error("baseUrl, apiKey, and appId are required");
|
|
2856
2871
|
Ue.baseUrl = t.baseUrl, Ue.apiKey = t.apiKey, Ue.appId = t.appId;
|
|
2857
|
-
},
|
|
2872
|
+
}, ge = () => Ue, fo = ({
|
|
2858
2873
|
logoUrl: t,
|
|
2859
2874
|
logoLinkUrl: e,
|
|
2860
2875
|
title: r = "Create Your Account",
|
|
2861
2876
|
subtitle: s = "Join our platform today",
|
|
2862
|
-
footerText:
|
|
2877
|
+
footerText: o = "Secure authentication powered by Neuctra Authix",
|
|
2863
2878
|
primaryColor: i = "#00C214",
|
|
2864
|
-
gradient:
|
|
2879
|
+
gradient: a = "linear-gradient(135deg, #22c55e, #00C214)",
|
|
2865
2880
|
darkMode: l = !0,
|
|
2866
2881
|
// Only avatar is optional
|
|
2867
2882
|
showAvatar: h = !1,
|
|
2868
2883
|
roles: c = [],
|
|
2869
2884
|
// 🔥 FIXED
|
|
2870
|
-
showRoleSelector:
|
|
2885
|
+
showRoleSelector: u = !1,
|
|
2871
2886
|
// 🔥 FIXED
|
|
2872
2887
|
loginUrl: b,
|
|
2873
2888
|
onSuccess: y,
|
|
2874
2889
|
onError: w
|
|
2875
2890
|
}) => {
|
|
2876
|
-
const { baseUrl:
|
|
2891
|
+
const { baseUrl: d, apiKey: j, appId: m } = ge(), _ = {
|
|
2877
2892
|
name: "",
|
|
2878
2893
|
email: "",
|
|
2879
2894
|
password: "",
|
|
@@ -2892,14 +2907,14 @@ const Ls = [
|
|
|
2892
2907
|
}, Q = () => {
|
|
2893
2908
|
const S = {};
|
|
2894
2909
|
return R.name.trim() || (S.name = "Name is required"), R.email.trim() ? /\S+@\S+\.\S+/.test(R.email) || (S.email = "Invalid email address") : S.email = "Email is required", R.password ? R.password.length < 6 && (S.password = "Password must be at least 6 characters") : S.password = "Password is required", F(S), Object.keys(S).length === 0;
|
|
2895
|
-
},
|
|
2910
|
+
}, G = async (S) => {
|
|
2896
2911
|
if (S.preventDefault(), !!Q()) {
|
|
2897
2912
|
I(!0), U(null);
|
|
2898
2913
|
try {
|
|
2899
2914
|
const x = {
|
|
2900
2915
|
...R,
|
|
2901
2916
|
appId: m
|
|
2902
|
-
}, k = await Hn(x, { baseUrl:
|
|
2917
|
+
}, k = await Hn(x, { baseUrl: d, apiKey: j });
|
|
2903
2918
|
U({ type: "success", text: "Account created successfully!" }), y && y(k);
|
|
2904
2919
|
} catch (x) {
|
|
2905
2920
|
const k = x.message || "Signup failed. Please try again.";
|
|
@@ -3033,10 +3048,10 @@ const Ls = [
|
|
|
3033
3048
|
/* @__PURE__ */ n.jsxs(
|
|
3034
3049
|
"form",
|
|
3035
3050
|
{
|
|
3036
|
-
onSubmit:
|
|
3051
|
+
onSubmit: G,
|
|
3037
3052
|
style: { display: "flex", flexDirection: "column", gap: "14px" },
|
|
3038
3053
|
children: [
|
|
3039
|
-
|
|
3054
|
+
u && c && c.length === 2 && /* @__PURE__ */ n.jsxs(
|
|
3040
3055
|
"div",
|
|
3041
3056
|
{
|
|
3042
3057
|
style: { display: "flex", flexDirection: "column", gap: "4px" },
|
|
@@ -3415,7 +3430,7 @@ const Ls = [
|
|
|
3415
3430
|
disabled: g,
|
|
3416
3431
|
style: {
|
|
3417
3432
|
padding: "12px",
|
|
3418
|
-
background:
|
|
3433
|
+
background: a,
|
|
3419
3434
|
color: "#fff",
|
|
3420
3435
|
border: "none",
|
|
3421
3436
|
borderRadius: "10px",
|
|
@@ -3473,17 +3488,17 @@ const Ls = [
|
|
|
3473
3488
|
}
|
|
3474
3489
|
);
|
|
3475
3490
|
}, Fs = async (t, e) => {
|
|
3476
|
-
const { email: r, password: s, appId:
|
|
3477
|
-
if (!
|
|
3491
|
+
const { email: r, password: s, appId: o } = t, { baseUrl: i, apiKey: a } = e;
|
|
3492
|
+
if (!a)
|
|
3478
3493
|
throw new Error("API key is required for login");
|
|
3479
3494
|
try {
|
|
3480
3495
|
const l = await W.post(
|
|
3481
3496
|
`${i}/users/login`,
|
|
3482
|
-
{ email: r, password: s, appId:
|
|
3497
|
+
{ email: r, password: s, appId: o },
|
|
3483
3498
|
{
|
|
3484
3499
|
headers: {
|
|
3485
3500
|
"Content-Type": "application/json",
|
|
3486
|
-
"x-api-key":
|
|
3501
|
+
"x-api-key": a
|
|
3487
3502
|
}
|
|
3488
3503
|
}
|
|
3489
3504
|
);
|
|
@@ -3496,20 +3511,20 @@ const Ls = [
|
|
|
3496
3511
|
status: l.response?.status || 500
|
|
3497
3512
|
};
|
|
3498
3513
|
}
|
|
3499
|
-
},
|
|
3514
|
+
}, xo = ({
|
|
3500
3515
|
logoUrl: t,
|
|
3501
3516
|
logoLinkUrl: e,
|
|
3502
3517
|
title: r = "Sign In to Your Account",
|
|
3503
3518
|
subtitle: s = "Welcome back! Please enter your details",
|
|
3504
|
-
footerText:
|
|
3519
|
+
footerText: o = "Secure authentication powered by Neuctra Authix",
|
|
3505
3520
|
primaryColor: i = "#00C214",
|
|
3506
|
-
gradient:
|
|
3521
|
+
gradient: a = "linear-gradient(135deg, #22c55e, #00C214)",
|
|
3507
3522
|
darkMode: l = !0,
|
|
3508
3523
|
signupUrl: h,
|
|
3509
3524
|
onSuccess: c,
|
|
3510
|
-
onError:
|
|
3525
|
+
onError: u
|
|
3511
3526
|
}) => {
|
|
3512
|
-
const { baseUrl: b, apiKey: y, appId: w } =
|
|
3527
|
+
const { baseUrl: b, apiKey: y, appId: w } = ge(), [d, j] = O("login"), [m, _] = O(1), [R, A] = O(!1), [C, M] = O(!1), [g, I] = O(null), [v, U] = O(""), [q, F] = O(""), [V, Z] = O({
|
|
3513
3528
|
email: "",
|
|
3514
3529
|
otp: "",
|
|
3515
3530
|
newPassword: "",
|
|
@@ -3521,7 +3536,7 @@ const Ls = [
|
|
|
3521
3536
|
return $(), window.addEventListener("resize", $), () => window.removeEventListener("resize", $);
|
|
3522
3537
|
}
|
|
3523
3538
|
}, []);
|
|
3524
|
-
const
|
|
3539
|
+
const G = async ($) => {
|
|
3525
3540
|
$.preventDefault(), M(!0), I(null);
|
|
3526
3541
|
try {
|
|
3527
3542
|
const N = await Fs(
|
|
@@ -3531,7 +3546,7 @@ const Ls = [
|
|
|
3531
3546
|
I({ type: "success", text: `Welcome ${N.name}` }), c?.(N);
|
|
3532
3547
|
} catch (N) {
|
|
3533
3548
|
const Y = N.message || "Login failed";
|
|
3534
|
-
I({ type: "error", text: Y }),
|
|
3549
|
+
I({ type: "error", text: Y }), u?.(N);
|
|
3535
3550
|
} finally {
|
|
3536
3551
|
M(!1);
|
|
3537
3552
|
}
|
|
@@ -3653,7 +3668,7 @@ const Ls = [
|
|
|
3653
3668
|
color: z,
|
|
3654
3669
|
margin: 0
|
|
3655
3670
|
},
|
|
3656
|
-
children:
|
|
3671
|
+
children: d === "login" ? r : m === 1 ? "Forgot Password" : "Reset Password"
|
|
3657
3672
|
}
|
|
3658
3673
|
),
|
|
3659
3674
|
/* @__PURE__ */ n.jsx(
|
|
@@ -3663,16 +3678,16 @@ const Ls = [
|
|
|
3663
3678
|
fontSize: "14px",
|
|
3664
3679
|
color: P
|
|
3665
3680
|
},
|
|
3666
|
-
children:
|
|
3681
|
+
children: d === "login" ? s : "Follow the steps to reset your password"
|
|
3667
3682
|
}
|
|
3668
3683
|
)
|
|
3669
3684
|
]
|
|
3670
3685
|
}
|
|
3671
3686
|
),
|
|
3672
|
-
|
|
3687
|
+
d === "login" && /* @__PURE__ */ n.jsxs(
|
|
3673
3688
|
"form",
|
|
3674
3689
|
{
|
|
3675
|
-
onSubmit:
|
|
3690
|
+
onSubmit: G,
|
|
3676
3691
|
style: { display: "flex", flexDirection: "column", gap: "14px" },
|
|
3677
3692
|
children: [
|
|
3678
3693
|
/* @__PURE__ */ n.jsxs(
|
|
@@ -3832,7 +3847,7 @@ const Ls = [
|
|
|
3832
3847
|
disabled: C,
|
|
3833
3848
|
style: {
|
|
3834
3849
|
padding: "12px",
|
|
3835
|
-
background:
|
|
3850
|
+
background: a,
|
|
3836
3851
|
color: "#fff",
|
|
3837
3852
|
border: "none",
|
|
3838
3853
|
borderRadius: "10px",
|
|
@@ -3845,7 +3860,7 @@ const Ls = [
|
|
|
3845
3860
|
]
|
|
3846
3861
|
}
|
|
3847
3862
|
),
|
|
3848
|
-
|
|
3863
|
+
d === "forgot" && /* @__PURE__ */ n.jsxs(
|
|
3849
3864
|
"form",
|
|
3850
3865
|
{
|
|
3851
3866
|
onSubmit: m === 1 ? S : x,
|
|
@@ -4008,7 +4023,7 @@ const Ls = [
|
|
|
4008
4023
|
disabled: C,
|
|
4009
4024
|
style: {
|
|
4010
4025
|
padding: "12px",
|
|
4011
|
-
background:
|
|
4026
|
+
background: a,
|
|
4012
4027
|
color: "#fff",
|
|
4013
4028
|
border: "none",
|
|
4014
4029
|
fontSize: "14px",
|
|
@@ -4082,49 +4097,38 @@ const Ls = [
|
|
|
4082
4097
|
)
|
|
4083
4098
|
}
|
|
4084
4099
|
);
|
|
4085
|
-
},
|
|
4100
|
+
}, ho = ({
|
|
4086
4101
|
children: t,
|
|
4087
4102
|
fallback: e = null,
|
|
4088
4103
|
className: r,
|
|
4089
4104
|
width: s,
|
|
4090
|
-
height:
|
|
4105
|
+
height: o
|
|
4091
4106
|
}) => {
|
|
4092
|
-
const
|
|
4107
|
+
const [i, a] = O(() => {
|
|
4108
|
+
if (typeof window > "u") return !1;
|
|
4109
|
+
try {
|
|
4110
|
+
const l = localStorage.getItem("userInfo");
|
|
4111
|
+
return !!(l && l !== "undefined" && l !== "null");
|
|
4112
|
+
} catch {
|
|
4113
|
+
return !1;
|
|
4114
|
+
}
|
|
4115
|
+
});
|
|
4093
4116
|
return te(() => {
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
}
|
|
4102
|
-
|
|
4103
|
-
if (!u?.id) {
|
|
4104
|
-
l(!1);
|
|
4105
|
-
return;
|
|
4106
|
-
}
|
|
4107
|
-
const j = await fetch(
|
|
4108
|
-
`https://server.authix.neuctra.com/api/users/check-user/${u.id}?appId=${i}`
|
|
4109
|
-
);
|
|
4110
|
-
if (!j.ok) {
|
|
4111
|
-
l(!1);
|
|
4112
|
-
return;
|
|
4117
|
+
const l = () => {
|
|
4118
|
+
if (!(typeof window > "u"))
|
|
4119
|
+
try {
|
|
4120
|
+
const h = localStorage.getItem("userInfo");
|
|
4121
|
+
a(
|
|
4122
|
+
!!(h && h !== "undefined" && h !== "null")
|
|
4123
|
+
);
|
|
4124
|
+
} catch {
|
|
4125
|
+
a(!1);
|
|
4113
4126
|
}
|
|
4114
|
-
const m = await j.json();
|
|
4115
|
-
d || l(!!m?.exists);
|
|
4116
|
-
} catch {
|
|
4117
|
-
d || l(!1);
|
|
4118
|
-
} finally {
|
|
4119
|
-
d || c(!1);
|
|
4120
|
-
}
|
|
4121
4127
|
};
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
return window.addEventListener("storage", y), () => {
|
|
4125
|
-
d = !0, window.removeEventListener("storage", y);
|
|
4128
|
+
return window.addEventListener("storage", l), () => {
|
|
4129
|
+
window.removeEventListener("storage", l);
|
|
4126
4130
|
};
|
|
4127
|
-
}, [
|
|
4131
|
+
}, []), i ? /* @__PURE__ */ n.jsx(
|
|
4128
4132
|
"div",
|
|
4129
4133
|
{
|
|
4130
4134
|
className: r,
|
|
@@ -4132,19 +4136,19 @@ const Ls = [
|
|
|
4132
4136
|
display: "flex",
|
|
4133
4137
|
alignItems: "center",
|
|
4134
4138
|
width: s,
|
|
4135
|
-
height:
|
|
4139
|
+
height: o
|
|
4136
4140
|
},
|
|
4137
4141
|
children: t
|
|
4138
4142
|
}
|
|
4139
4143
|
) : typeof e == "function" ? e() : e;
|
|
4140
|
-
},
|
|
4144
|
+
}, go = ({
|
|
4141
4145
|
children: t,
|
|
4142
4146
|
fallback: e = null,
|
|
4143
4147
|
className: r,
|
|
4144
4148
|
width: s,
|
|
4145
|
-
height:
|
|
4149
|
+
height: o
|
|
4146
4150
|
}) => {
|
|
4147
|
-
const [i,
|
|
4151
|
+
const [i, a] = O(() => {
|
|
4148
4152
|
if (typeof window > "u") return !0;
|
|
4149
4153
|
try {
|
|
4150
4154
|
const l = localStorage.getItem("userInfo");
|
|
@@ -4157,11 +4161,11 @@ const Ls = [
|
|
|
4157
4161
|
const l = () => {
|
|
4158
4162
|
try {
|
|
4159
4163
|
const h = localStorage.getItem("userInfo");
|
|
4160
|
-
|
|
4164
|
+
a(
|
|
4161
4165
|
!h || h === "undefined" || h === "null"
|
|
4162
4166
|
);
|
|
4163
4167
|
} catch {
|
|
4164
|
-
|
|
4168
|
+
a(!0);
|
|
4165
4169
|
}
|
|
4166
4170
|
};
|
|
4167
4171
|
return l(), window.addEventListener("storage", l), () => window.removeEventListener("storage", l);
|
|
@@ -4173,7 +4177,7 @@ const Ls = [
|
|
|
4173
4177
|
display: "flex",
|
|
4174
4178
|
alignItems: "center",
|
|
4175
4179
|
width: s,
|
|
4176
|
-
height:
|
|
4180
|
+
height: o
|
|
4177
4181
|
},
|
|
4178
4182
|
children: t
|
|
4179
4183
|
}
|
|
@@ -4183,11 +4187,11 @@ const Ls = [
|
|
|
4183
4187
|
onClose: e,
|
|
4184
4188
|
onSuccess: r,
|
|
4185
4189
|
onError: s,
|
|
4186
|
-
userId:
|
|
4190
|
+
userId: o,
|
|
4187
4191
|
token: i,
|
|
4188
|
-
colors:
|
|
4192
|
+
colors: a
|
|
4189
4193
|
}) => {
|
|
4190
|
-
const { baseUrl: l, apiKey: h, appId: c } =
|
|
4194
|
+
const { baseUrl: l, apiKey: h, appId: c } = ge(), [u, b] = O(!1), [y, w] = O(""), [d, j] = O("warning"), [m, _] = O(!1);
|
|
4191
4195
|
if (te(() => {
|
|
4192
4196
|
if (typeof window > "u") return;
|
|
4193
4197
|
const g = () => {
|
|
@@ -4198,7 +4202,7 @@ const Ls = [
|
|
|
4198
4202
|
const R = async () => {
|
|
4199
4203
|
b(!0), j("processing");
|
|
4200
4204
|
try {
|
|
4201
|
-
const { data: g } = await W.delete(`${l}/users/delete/${
|
|
4205
|
+
const { data: g } = await W.delete(`${l}/users/delete/${o}`, {
|
|
4202
4206
|
data: { appId: c },
|
|
4203
4207
|
headers: {
|
|
4204
4208
|
"x-api-key": h
|
|
@@ -4213,9 +4217,9 @@ const Ls = [
|
|
|
4213
4217
|
b(!1);
|
|
4214
4218
|
}
|
|
4215
4219
|
}, A = y.toLowerCase() === "delete my account", C = (g) => {
|
|
4216
|
-
g.target === g.currentTarget &&
|
|
4220
|
+
g.target === g.currentTarget && d !== "processing" && d !== "success" && e();
|
|
4217
4221
|
}, M = () => {
|
|
4218
|
-
switch (
|
|
4222
|
+
switch (d) {
|
|
4219
4223
|
case "warning":
|
|
4220
4224
|
return /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
4221
4225
|
/* @__PURE__ */ n.jsxs(
|
|
@@ -4260,7 +4264,7 @@ const Ls = [
|
|
|
4260
4264
|
"h3",
|
|
4261
4265
|
{
|
|
4262
4266
|
style: {
|
|
4263
|
-
color:
|
|
4267
|
+
color: a.textPrimary,
|
|
4264
4268
|
margin: 0,
|
|
4265
4269
|
fontSize: "20px",
|
|
4266
4270
|
fontWeight: 700,
|
|
@@ -4280,7 +4284,7 @@ const Ls = [
|
|
|
4280
4284
|
style: {
|
|
4281
4285
|
background: "transparent",
|
|
4282
4286
|
border: "none",
|
|
4283
|
-
color:
|
|
4287
|
+
color: a.textTertiary,
|
|
4284
4288
|
cursor: "pointer",
|
|
4285
4289
|
padding: "8px",
|
|
4286
4290
|
borderRadius: "8px",
|
|
@@ -4293,10 +4297,10 @@ const Ls = [
|
|
|
4293
4297
|
transition: "all 0.2s ease"
|
|
4294
4298
|
},
|
|
4295
4299
|
onMouseOver: (g) => {
|
|
4296
|
-
g.currentTarget.style.backgroundColor =
|
|
4300
|
+
g.currentTarget.style.backgroundColor = a.border, g.currentTarget.style.color = a.textPrimary;
|
|
4297
4301
|
},
|
|
4298
4302
|
onMouseOut: (g) => {
|
|
4299
|
-
g.currentTarget.style.backgroundColor = "transparent", g.currentTarget.style.color =
|
|
4303
|
+
g.currentTarget.style.backgroundColor = "transparent", g.currentTarget.style.color = a.textTertiary;
|
|
4300
4304
|
},
|
|
4301
4305
|
children: /* @__PURE__ */ n.jsx(Pe, { size: 20 })
|
|
4302
4306
|
}
|
|
@@ -4311,8 +4315,8 @@ const Ls = [
|
|
|
4311
4315
|
display: "flex",
|
|
4312
4316
|
gap: "16px",
|
|
4313
4317
|
padding: "20px",
|
|
4314
|
-
background: `${
|
|
4315
|
-
border: `1px solid ${
|
|
4318
|
+
background: `${a.error}15`,
|
|
4319
|
+
border: `1px solid ${a.error}30`,
|
|
4316
4320
|
borderRadius: "12px",
|
|
4317
4321
|
marginBottom: "20px"
|
|
4318
4322
|
},
|
|
@@ -4321,7 +4325,7 @@ const Ls = [
|
|
|
4321
4325
|
"div",
|
|
4322
4326
|
{
|
|
4323
4327
|
style: {
|
|
4324
|
-
color:
|
|
4328
|
+
color: a.error,
|
|
4325
4329
|
flexShrink: 0,
|
|
4326
4330
|
display: "flex",
|
|
4327
4331
|
alignItems: "flex-start"
|
|
@@ -4334,7 +4338,7 @@ const Ls = [
|
|
|
4334
4338
|
"h4",
|
|
4335
4339
|
{
|
|
4336
4340
|
style: {
|
|
4337
|
-
color:
|
|
4341
|
+
color: a.textPrimary,
|
|
4338
4342
|
margin: "0 0 12px 0",
|
|
4339
4343
|
fontSize: "16px",
|
|
4340
4344
|
fontWeight: 600
|
|
@@ -4371,10 +4375,10 @@ const Ls = [
|
|
|
4371
4375
|
alignItems: "center",
|
|
4372
4376
|
gap: "10px",
|
|
4373
4377
|
fontSize: "14px",
|
|
4374
|
-
color:
|
|
4378
|
+
color: a.textSecondary
|
|
4375
4379
|
},
|
|
4376
4380
|
children: [
|
|
4377
|
-
/* @__PURE__ */ n.jsx("div", { style: { color:
|
|
4381
|
+
/* @__PURE__ */ n.jsx("div", { style: { color: a.error, flexShrink: 0 }, children: g.icon }),
|
|
4378
4382
|
/* @__PURE__ */ n.jsx("span", { children: g.text })
|
|
4379
4383
|
]
|
|
4380
4384
|
},
|
|
@@ -4404,9 +4408,9 @@ const Ls = [
|
|
|
4404
4408
|
style: {
|
|
4405
4409
|
padding: "10px 24px",
|
|
4406
4410
|
borderRadius: "10px",
|
|
4407
|
-
border: `1.5px solid ${
|
|
4411
|
+
border: `1.5px solid ${a.border}`,
|
|
4408
4412
|
background: "transparent",
|
|
4409
|
-
color:
|
|
4413
|
+
color: a.textPrimary,
|
|
4410
4414
|
fontSize: "14px",
|
|
4411
4415
|
fontWeight: 500,
|
|
4412
4416
|
cursor: "pointer",
|
|
@@ -4415,7 +4419,7 @@ const Ls = [
|
|
|
4415
4419
|
transition: "all 0.2s ease"
|
|
4416
4420
|
},
|
|
4417
4421
|
onMouseOver: (g) => {
|
|
4418
|
-
g.currentTarget.style.backgroundColor =
|
|
4422
|
+
g.currentTarget.style.backgroundColor = a.border, g.currentTarget.style.transform = "translateY(-1px)";
|
|
4419
4423
|
},
|
|
4420
4424
|
onMouseOut: (g) => {
|
|
4421
4425
|
g.currentTarget.style.backgroundColor = "transparent", g.currentTarget.style.transform = "translateY(0)";
|
|
@@ -4494,7 +4498,7 @@ const Ls = [
|
|
|
4494
4498
|
"h3",
|
|
4495
4499
|
{
|
|
4496
4500
|
style: {
|
|
4497
|
-
color:
|
|
4501
|
+
color: a.textPrimary,
|
|
4498
4502
|
margin: 0,
|
|
4499
4503
|
fontSize: "20px",
|
|
4500
4504
|
fontWeight: 700,
|
|
@@ -4511,7 +4515,7 @@ const Ls = [
|
|
|
4511
4515
|
"p",
|
|
4512
4516
|
{
|
|
4513
4517
|
style: {
|
|
4514
|
-
color:
|
|
4518
|
+
color: a.textSecondary,
|
|
4515
4519
|
marginBottom: "16px",
|
|
4516
4520
|
fontSize: "14px",
|
|
4517
4521
|
lineHeight: "1.5"
|
|
@@ -4519,7 +4523,7 @@ const Ls = [
|
|
|
4519
4523
|
children: [
|
|
4520
4524
|
"Type",
|
|
4521
4525
|
" ",
|
|
4522
|
-
/* @__PURE__ */ n.jsx("strong", { style: { color:
|
|
4526
|
+
/* @__PURE__ */ n.jsx("strong", { style: { color: a.textPrimary }, children: '"delete my account"' }),
|
|
4523
4527
|
" ",
|
|
4524
4528
|
"to confirm:"
|
|
4525
4529
|
]
|
|
@@ -4536,16 +4540,16 @@ const Ls = [
|
|
|
4536
4540
|
width: "100%",
|
|
4537
4541
|
padding: "14px 16px",
|
|
4538
4542
|
borderRadius: "10px",
|
|
4539
|
-
border: `2px solid ${A ?
|
|
4543
|
+
border: `2px solid ${A ? a.success : a.error}`,
|
|
4540
4544
|
backgroundColor: "transparent",
|
|
4541
|
-
color:
|
|
4545
|
+
color: a.textPrimary,
|
|
4542
4546
|
fontSize: "15px",
|
|
4543
4547
|
outline: "none",
|
|
4544
4548
|
transition: "all 0.2s ease",
|
|
4545
4549
|
boxSizing: "border-box"
|
|
4546
4550
|
},
|
|
4547
4551
|
onFocus: (g) => {
|
|
4548
|
-
g.target.style.boxShadow = `0 0 0 3px ${
|
|
4552
|
+
g.target.style.boxShadow = `0 0 0 3px ${a.accent}20`;
|
|
4549
4553
|
},
|
|
4550
4554
|
onBlur: (g) => {
|
|
4551
4555
|
g.target.style.boxShadow = "none";
|
|
@@ -4561,12 +4565,12 @@ const Ls = [
|
|
|
4561
4565
|
alignItems: "center",
|
|
4562
4566
|
gap: "8px",
|
|
4563
4567
|
marginTop: "10px",
|
|
4564
|
-
color:
|
|
4568
|
+
color: a.success,
|
|
4565
4569
|
fontSize: "14px",
|
|
4566
4570
|
fontWeight: 500
|
|
4567
4571
|
},
|
|
4568
4572
|
children: [
|
|
4569
|
-
/* @__PURE__ */ n.jsx(
|
|
4573
|
+
/* @__PURE__ */ n.jsx(Ge, { size: 16 }),
|
|
4570
4574
|
/* @__PURE__ */ n.jsx("span", { children: "Confirmation accepted" })
|
|
4571
4575
|
]
|
|
4572
4576
|
}
|
|
@@ -4592,9 +4596,9 @@ const Ls = [
|
|
|
4592
4596
|
style: {
|
|
4593
4597
|
padding: "10px 24px",
|
|
4594
4598
|
borderRadius: "10px",
|
|
4595
|
-
border: `1.5px solid ${
|
|
4599
|
+
border: `1.5px solid ${a.border}`,
|
|
4596
4600
|
background: "transparent",
|
|
4597
|
-
color:
|
|
4601
|
+
color: a.textPrimary,
|
|
4598
4602
|
fontSize: "14px",
|
|
4599
4603
|
fontWeight: 500,
|
|
4600
4604
|
cursor: "pointer",
|
|
@@ -4603,7 +4607,7 @@ const Ls = [
|
|
|
4603
4607
|
transition: "all 0.2s ease"
|
|
4604
4608
|
},
|
|
4605
4609
|
onMouseOver: (g) => {
|
|
4606
|
-
g.currentTarget.style.backgroundColor =
|
|
4610
|
+
g.currentTarget.style.backgroundColor = a.border, g.currentTarget.style.transform = "translateY(-1px)";
|
|
4607
4611
|
},
|
|
4608
4612
|
onMouseOut: (g) => {
|
|
4609
4613
|
g.currentTarget.style.backgroundColor = "transparent", g.currentTarget.style.transform = "translateY(0)";
|
|
@@ -4615,7 +4619,7 @@ const Ls = [
|
|
|
4615
4619
|
"button",
|
|
4616
4620
|
{
|
|
4617
4621
|
onClick: R,
|
|
4618
|
-
disabled: !A ||
|
|
4622
|
+
disabled: !A || u,
|
|
4619
4623
|
style: {
|
|
4620
4624
|
padding: "10px 24px",
|
|
4621
4625
|
borderRadius: "10px",
|
|
@@ -4624,22 +4628,22 @@ const Ls = [
|
|
|
4624
4628
|
color: "white",
|
|
4625
4629
|
fontSize: "14px",
|
|
4626
4630
|
fontWeight: 600,
|
|
4627
|
-
cursor: !A ||
|
|
4631
|
+
cursor: !A || u ? "not-allowed" : "pointer",
|
|
4628
4632
|
flex: m ? "none" : 1,
|
|
4629
4633
|
minWidth: m ? "100%" : "140px",
|
|
4630
|
-
opacity: !A ||
|
|
4634
|
+
opacity: !A || u ? 0.6 : 1,
|
|
4631
4635
|
display: "flex",
|
|
4632
4636
|
alignItems: "center",
|
|
4633
4637
|
justifyContent: "center",
|
|
4634
4638
|
gap: "8px",
|
|
4635
4639
|
transition: "all 0.2s ease",
|
|
4636
|
-
boxShadow: !A ||
|
|
4640
|
+
boxShadow: !A || u ? "none" : "0 4px 12px rgba(239, 68, 68, 0.4)"
|
|
4637
4641
|
},
|
|
4638
4642
|
onMouseOver: (g) => {
|
|
4639
|
-
A && !
|
|
4643
|
+
A && !u && (g.currentTarget.style.transform = "translateY(-1px)", g.currentTarget.style.boxShadow = "0 6px 20px rgba(239, 68, 68, 0.5)");
|
|
4640
4644
|
},
|
|
4641
4645
|
onMouseOut: (g) => {
|
|
4642
|
-
A && !
|
|
4646
|
+
A && !u && (g.currentTarget.style.transform = "translateY(0)", g.currentTarget.style.boxShadow = "0 4px 12px rgba(239, 68, 68, 0.4)");
|
|
4643
4647
|
},
|
|
4644
4648
|
children: [
|
|
4645
4649
|
/* @__PURE__ */ n.jsx(Ne, { size: 16 }),
|
|
@@ -4678,7 +4682,7 @@ const Ls = [
|
|
|
4678
4682
|
flexShrink: 0
|
|
4679
4683
|
},
|
|
4680
4684
|
children: /* @__PURE__ */ n.jsx(
|
|
4681
|
-
|
|
4685
|
+
oe,
|
|
4682
4686
|
{
|
|
4683
4687
|
size: 20,
|
|
4684
4688
|
style: {
|
|
@@ -4693,7 +4697,7 @@ const Ls = [
|
|
|
4693
4697
|
"h3",
|
|
4694
4698
|
{
|
|
4695
4699
|
style: {
|
|
4696
|
-
color:
|
|
4700
|
+
color: a.textPrimary,
|
|
4697
4701
|
margin: 0,
|
|
4698
4702
|
fontSize: "20px",
|
|
4699
4703
|
fontWeight: 700,
|
|
@@ -4706,7 +4710,7 @@ const Ls = [
|
|
|
4706
4710
|
"p",
|
|
4707
4711
|
{
|
|
4708
4712
|
style: {
|
|
4709
|
-
color:
|
|
4713
|
+
color: a.textTertiary,
|
|
4710
4714
|
margin: "4px 0 0 0",
|
|
4711
4715
|
fontSize: "14px",
|
|
4712
4716
|
lineHeight: "1.4"
|
|
@@ -4740,7 +4744,7 @@ const Ls = [
|
|
|
4740
4744
|
padding: "12px",
|
|
4741
4745
|
borderRadius: "8px",
|
|
4742
4746
|
transition: "all 0.2s ease",
|
|
4743
|
-
backgroundColor: g.active ? `${
|
|
4747
|
+
backgroundColor: g.active ? `${a.accent}10` : "transparent"
|
|
4744
4748
|
},
|
|
4745
4749
|
children: [
|
|
4746
4750
|
/* @__PURE__ */ n.jsx(
|
|
@@ -4750,9 +4754,9 @@ const Ls = [
|
|
|
4750
4754
|
width: "8px",
|
|
4751
4755
|
height: "8px",
|
|
4752
4756
|
borderRadius: "50%",
|
|
4753
|
-
backgroundColor: g.active ?
|
|
4757
|
+
backgroundColor: g.active ? a.accent : a.textTertiary,
|
|
4754
4758
|
transition: "all 0.3s ease",
|
|
4755
|
-
boxShadow: g.active ? `0 0 0 4px ${
|
|
4759
|
+
boxShadow: g.active ? `0 0 0 4px ${a.accent}20` : "none"
|
|
4756
4760
|
}
|
|
4757
4761
|
}
|
|
4758
4762
|
),
|
|
@@ -4761,7 +4765,7 @@ const Ls = [
|
|
|
4761
4765
|
{
|
|
4762
4766
|
style: {
|
|
4763
4767
|
fontSize: "14px",
|
|
4764
|
-
color: g.active ?
|
|
4768
|
+
color: g.active ? a.textPrimary : a.textSecondary,
|
|
4765
4769
|
fontWeight: g.active ? 500 : 400
|
|
4766
4770
|
},
|
|
4767
4771
|
children: g.text
|
|
@@ -4781,17 +4785,17 @@ const Ls = [
|
|
|
4781
4785
|
alignItems: "center",
|
|
4782
4786
|
gap: "10px",
|
|
4783
4787
|
padding: "16px",
|
|
4784
|
-
background: `${
|
|
4788
|
+
background: `${a.accent}10`,
|
|
4785
4789
|
borderRadius: "10px",
|
|
4786
4790
|
fontSize: "14px",
|
|
4787
|
-
color:
|
|
4791
|
+
color: a.textSecondary
|
|
4788
4792
|
},
|
|
4789
4793
|
children: [
|
|
4790
4794
|
/* @__PURE__ */ n.jsx(
|
|
4791
4795
|
dr,
|
|
4792
4796
|
{
|
|
4793
4797
|
size: 18,
|
|
4794
|
-
style: { color:
|
|
4798
|
+
style: { color: a.accent, flexShrink: 0 }
|
|
4795
4799
|
}
|
|
4796
4800
|
),
|
|
4797
4801
|
/* @__PURE__ */ n.jsx("span", { children: "You will be redirected to the login page shortly" })
|
|
@@ -4825,7 +4829,7 @@ const Ls = [
|
|
|
4825
4829
|
color: "white",
|
|
4826
4830
|
flexShrink: 0
|
|
4827
4831
|
},
|
|
4828
|
-
children: /* @__PURE__ */ n.jsx(
|
|
4832
|
+
children: /* @__PURE__ */ n.jsx(Ge, { size: 20 })
|
|
4829
4833
|
}
|
|
4830
4834
|
),
|
|
4831
4835
|
/* @__PURE__ */ n.jsxs("div", { style: { flex: 1 }, children: [
|
|
@@ -4833,7 +4837,7 @@ const Ls = [
|
|
|
4833
4837
|
"h3",
|
|
4834
4838
|
{
|
|
4835
4839
|
style: {
|
|
4836
|
-
color:
|
|
4840
|
+
color: a.textPrimary,
|
|
4837
4841
|
margin: 0,
|
|
4838
4842
|
fontSize: "20px",
|
|
4839
4843
|
fontWeight: 700,
|
|
@@ -4846,7 +4850,7 @@ const Ls = [
|
|
|
4846
4850
|
"p",
|
|
4847
4851
|
{
|
|
4848
4852
|
style: {
|
|
4849
|
-
color:
|
|
4853
|
+
color: a.textTertiary,
|
|
4850
4854
|
margin: "4px 0 0 0",
|
|
4851
4855
|
fontSize: "14px",
|
|
4852
4856
|
lineHeight: "1.4"
|
|
@@ -4864,18 +4868,18 @@ const Ls = [
|
|
|
4864
4868
|
style: {
|
|
4865
4869
|
textAlign: "center",
|
|
4866
4870
|
padding: "20px",
|
|
4867
|
-
background: `${
|
|
4868
|
-
border: `1px solid ${
|
|
4871
|
+
background: `${a.success}10`,
|
|
4872
|
+
border: `1px solid ${a.success}20`,
|
|
4869
4873
|
borderRadius: "12px",
|
|
4870
4874
|
marginBottom: "24px"
|
|
4871
4875
|
},
|
|
4872
4876
|
children: [
|
|
4873
4877
|
/* @__PURE__ */ n.jsx(
|
|
4874
|
-
|
|
4878
|
+
Ge,
|
|
4875
4879
|
{
|
|
4876
4880
|
size: 48,
|
|
4877
4881
|
style: {
|
|
4878
|
-
color:
|
|
4882
|
+
color: a.success,
|
|
4879
4883
|
marginBottom: "12px",
|
|
4880
4884
|
display: "block",
|
|
4881
4885
|
margin: "0 auto 12px auto"
|
|
@@ -4886,7 +4890,7 @@ const Ls = [
|
|
|
4886
4890
|
"p",
|
|
4887
4891
|
{
|
|
4888
4892
|
style: {
|
|
4889
|
-
color:
|
|
4893
|
+
color: a.textPrimary,
|
|
4890
4894
|
fontSize: "16px",
|
|
4891
4895
|
fontWeight: 600,
|
|
4892
4896
|
margin: "0 0 8px 0"
|
|
@@ -4898,7 +4902,7 @@ const Ls = [
|
|
|
4898
4902
|
"p",
|
|
4899
4903
|
{
|
|
4900
4904
|
style: {
|
|
4901
|
-
color:
|
|
4905
|
+
color: a.textSecondary,
|
|
4902
4906
|
fontSize: "14px",
|
|
4903
4907
|
margin: 0,
|
|
4904
4908
|
lineHeight: "1.5"
|
|
@@ -4917,20 +4921,20 @@ const Ls = [
|
|
|
4917
4921
|
alignItems: "center",
|
|
4918
4922
|
gap: "10px",
|
|
4919
4923
|
padding: "16px",
|
|
4920
|
-
background: `${
|
|
4924
|
+
background: `${a.accent}10`,
|
|
4921
4925
|
borderRadius: "10px",
|
|
4922
4926
|
fontSize: "14px",
|
|
4923
|
-
color:
|
|
4927
|
+
color: a.textSecondary,
|
|
4924
4928
|
justifyContent: "center"
|
|
4925
4929
|
},
|
|
4926
4930
|
children: [
|
|
4927
4931
|
/* @__PURE__ */ n.jsx(
|
|
4928
|
-
|
|
4932
|
+
oe,
|
|
4929
4933
|
{
|
|
4930
4934
|
size: 16,
|
|
4931
4935
|
style: {
|
|
4932
4936
|
animation: "spin 1s linear infinite",
|
|
4933
|
-
color:
|
|
4937
|
+
color: a.accent
|
|
4934
4938
|
}
|
|
4935
4939
|
}
|
|
4936
4940
|
),
|
|
@@ -4962,8 +4966,8 @@ const Ls = [
|
|
|
4962
4966
|
"div",
|
|
4963
4967
|
{
|
|
4964
4968
|
style: {
|
|
4965
|
-
backgroundColor:
|
|
4966
|
-
border: `1px solid ${
|
|
4969
|
+
backgroundColor: a.surface,
|
|
4970
|
+
border: `1px solid ${a.border}`,
|
|
4967
4971
|
borderRadius: "20px",
|
|
4968
4972
|
width: "100%",
|
|
4969
4973
|
maxWidth: "480px",
|
|
@@ -5039,20 +5043,20 @@ const Ls = [
|
|
|
5039
5043
|
onUpdate: r,
|
|
5040
5044
|
colors: s
|
|
5041
5045
|
}) => {
|
|
5042
|
-
const [
|
|
5046
|
+
const [o, i] = O(""), [a, l] = O(!1), [h, c] = O(!1), [u, b] = O({ isValid: !1, message: "", type: null });
|
|
5043
5047
|
if (te(() => {
|
|
5044
5048
|
if (typeof window > "u") return;
|
|
5045
|
-
const
|
|
5049
|
+
const d = () => {
|
|
5046
5050
|
c(window.innerWidth < 640);
|
|
5047
5051
|
};
|
|
5048
|
-
return
|
|
5052
|
+
return d(), window.addEventListener("resize", d), () => window.removeEventListener("resize", d);
|
|
5049
5053
|
}, []), te(() => {
|
|
5050
|
-
if (!
|
|
5054
|
+
if (!o.trim()) {
|
|
5051
5055
|
b({ isValid: !1, message: "", type: null });
|
|
5052
5056
|
return;
|
|
5053
5057
|
}
|
|
5054
5058
|
try {
|
|
5055
|
-
const
|
|
5059
|
+
const d = new URL(o), j = /\.(jpg|jpeg|png|gif|webp|svg)$/i.test(d.pathname);
|
|
5056
5060
|
b(j ? {
|
|
5057
5061
|
isValid: !0,
|
|
5058
5062
|
message: "Valid image URL",
|
|
@@ -5069,18 +5073,18 @@ const Ls = [
|
|
|
5069
5073
|
type: "error"
|
|
5070
5074
|
});
|
|
5071
5075
|
}
|
|
5072
|
-
}, [
|
|
5076
|
+
}, [o]), !t) return null;
|
|
5073
5077
|
const y = async () => {
|
|
5074
|
-
if (!(!
|
|
5078
|
+
if (!(!o || !u.isValid)) {
|
|
5075
5079
|
l(!0);
|
|
5076
5080
|
try {
|
|
5077
|
-
await r(
|
|
5081
|
+
await r(o) && (i(""), e());
|
|
5078
5082
|
} finally {
|
|
5079
5083
|
l(!1);
|
|
5080
5084
|
}
|
|
5081
5085
|
}
|
|
5082
|
-
}, w = (
|
|
5083
|
-
|
|
5086
|
+
}, w = (d) => {
|
|
5087
|
+
d.target === d.currentTarget && e();
|
|
5084
5088
|
};
|
|
5085
5089
|
return /* @__PURE__ */ n.jsxs(
|
|
5086
5090
|
"div",
|
|
@@ -5187,11 +5191,11 @@ const Ls = [
|
|
|
5187
5191
|
flexShrink: 0,
|
|
5188
5192
|
transition: "all 0.2s ease"
|
|
5189
5193
|
},
|
|
5190
|
-
onMouseOver: (
|
|
5191
|
-
|
|
5194
|
+
onMouseOver: (d) => {
|
|
5195
|
+
d.currentTarget.style.backgroundColor = s.border, d.currentTarget.style.color = s.textPrimary;
|
|
5192
5196
|
},
|
|
5193
|
-
onMouseOut: (
|
|
5194
|
-
|
|
5197
|
+
onMouseOut: (d) => {
|
|
5198
|
+
d.currentTarget.style.backgroundColor = "transparent", d.currentTarget.style.color = s.textTertiary;
|
|
5195
5199
|
},
|
|
5196
5200
|
children: /* @__PURE__ */ n.jsx(Pe, { size: 20 })
|
|
5197
5201
|
}
|
|
@@ -5235,14 +5239,14 @@ const Ls = [
|
|
|
5235
5239
|
type: "url",
|
|
5236
5240
|
id: "avatar-url",
|
|
5237
5241
|
placeholder: "https://example.com/your-avatar.jpg",
|
|
5238
|
-
value:
|
|
5239
|
-
onChange: (
|
|
5242
|
+
value: o,
|
|
5243
|
+
onChange: (d) => i(d.target.value),
|
|
5240
5244
|
style: {
|
|
5241
5245
|
width: "100%",
|
|
5242
5246
|
padding: "14px 16px",
|
|
5243
5247
|
paddingLeft: "44px",
|
|
5244
5248
|
borderRadius: "12px",
|
|
5245
|
-
border: `1.5px solid ${
|
|
5249
|
+
border: `1.5px solid ${u.type === "error" ? s.error : u.type === "success" ? s.success : s.border}`,
|
|
5246
5250
|
backgroundColor: "transparent",
|
|
5247
5251
|
color: s.textPrimary,
|
|
5248
5252
|
fontSize: "15px",
|
|
@@ -5250,13 +5254,13 @@ const Ls = [
|
|
|
5250
5254
|
transition: "all 0.2s ease",
|
|
5251
5255
|
boxSizing: "border-box"
|
|
5252
5256
|
},
|
|
5253
|
-
onFocus: (
|
|
5254
|
-
|
|
5257
|
+
onFocus: (d) => {
|
|
5258
|
+
d.target.style.borderColor = s.accent, d.target.style.boxShadow = `0 0 0 3px ${s.accent}20`;
|
|
5255
5259
|
},
|
|
5256
|
-
onBlur: (
|
|
5257
|
-
|
|
5260
|
+
onBlur: (d) => {
|
|
5261
|
+
d.target.style.borderColor = u.type === "error" ? s.error : u.type === "success" ? s.success : s.border, d.target.style.boxShadow = "none";
|
|
5258
5262
|
},
|
|
5259
|
-
disabled:
|
|
5263
|
+
disabled: a
|
|
5260
5264
|
}
|
|
5261
5265
|
),
|
|
5262
5266
|
/* @__PURE__ */ n.jsx(
|
|
@@ -5273,7 +5277,7 @@ const Ls = [
|
|
|
5273
5277
|
}
|
|
5274
5278
|
)
|
|
5275
5279
|
] }),
|
|
5276
|
-
|
|
5280
|
+
u.message && /* @__PURE__ */ n.jsxs(
|
|
5277
5281
|
"div",
|
|
5278
5282
|
{
|
|
5279
5283
|
style: {
|
|
@@ -5282,18 +5286,18 @@ const Ls = [
|
|
|
5282
5286
|
gap: "6px",
|
|
5283
5287
|
marginTop: "8px",
|
|
5284
5288
|
fontSize: "13px",
|
|
5285
|
-
color:
|
|
5289
|
+
color: u.type === "success" ? s.success : u.type === "error" ? s.error : s.textTertiary
|
|
5286
5290
|
},
|
|
5287
5291
|
children: [
|
|
5288
|
-
|
|
5289
|
-
|
|
5290
|
-
|
|
5291
|
-
|
|
5292
|
+
u.type === "success" && /* @__PURE__ */ n.jsx(ce, { size: 14 }),
|
|
5293
|
+
u.type === "error" && /* @__PURE__ */ n.jsx(le, { size: 14 }),
|
|
5294
|
+
u.type === "warning" && /* @__PURE__ */ n.jsx(le, { size: 14 }),
|
|
5295
|
+
u.message
|
|
5292
5296
|
]
|
|
5293
5297
|
}
|
|
5294
5298
|
)
|
|
5295
5299
|
] }),
|
|
5296
|
-
|
|
5300
|
+
o && u.type === "success" && /* @__PURE__ */ n.jsxs(
|
|
5297
5301
|
"div",
|
|
5298
5302
|
{
|
|
5299
5303
|
style: {
|
|
@@ -5319,7 +5323,7 @@ const Ls = [
|
|
|
5319
5323
|
/* @__PURE__ */ n.jsx(
|
|
5320
5324
|
"img",
|
|
5321
5325
|
{
|
|
5322
|
-
src:
|
|
5326
|
+
src: o,
|
|
5323
5327
|
alt: "Avatar preview",
|
|
5324
5328
|
style: {
|
|
5325
5329
|
width: "80px",
|
|
@@ -5329,8 +5333,8 @@ const Ls = [
|
|
|
5329
5333
|
border: `2px solid ${s.success}40`,
|
|
5330
5334
|
margin: "0 auto"
|
|
5331
5335
|
},
|
|
5332
|
-
onError: (
|
|
5333
|
-
|
|
5336
|
+
onError: (d) => {
|
|
5337
|
+
d.currentTarget.style.display = "none";
|
|
5334
5338
|
}
|
|
5335
5339
|
}
|
|
5336
5340
|
)
|
|
@@ -5356,7 +5360,7 @@ const Ls = [
|
|
|
5356
5360
|
"button",
|
|
5357
5361
|
{
|
|
5358
5362
|
onClick: e,
|
|
5359
|
-
disabled:
|
|
5363
|
+
disabled: a,
|
|
5360
5364
|
style: {
|
|
5361
5365
|
padding: "10px 24px",
|
|
5362
5366
|
borderRadius: "10px",
|
|
@@ -5365,17 +5369,17 @@ const Ls = [
|
|
|
5365
5369
|
color: s.textPrimary,
|
|
5366
5370
|
fontSize: "14px",
|
|
5367
5371
|
fontWeight: 500,
|
|
5368
|
-
cursor:
|
|
5372
|
+
cursor: a ? "not-allowed" : "pointer",
|
|
5369
5373
|
flex: h ? "none" : 1,
|
|
5370
5374
|
minWidth: h ? "100%" : "120px",
|
|
5371
|
-
opacity:
|
|
5375
|
+
opacity: a ? 0.6 : 1,
|
|
5372
5376
|
transition: "all 0.2s ease"
|
|
5373
5377
|
},
|
|
5374
|
-
onMouseOver: (
|
|
5375
|
-
|
|
5378
|
+
onMouseOver: (d) => {
|
|
5379
|
+
a || (d.currentTarget.style.backgroundColor = s.border, d.currentTarget.style.transform = "translateY(-1px)");
|
|
5376
5380
|
},
|
|
5377
|
-
onMouseOut: (
|
|
5378
|
-
|
|
5381
|
+
onMouseOut: (d) => {
|
|
5382
|
+
a || (d.currentTarget.style.backgroundColor = "transparent", d.currentTarget.style.transform = "translateY(0)");
|
|
5379
5383
|
},
|
|
5380
5384
|
children: "Cancel"
|
|
5381
5385
|
}
|
|
@@ -5384,7 +5388,7 @@ const Ls = [
|
|
|
5384
5388
|
"button",
|
|
5385
5389
|
{
|
|
5386
5390
|
onClick: y,
|
|
5387
|
-
disabled:
|
|
5391
|
+
disabled: a || !u.isValid,
|
|
5388
5392
|
style: {
|
|
5389
5393
|
padding: "10px 24px",
|
|
5390
5394
|
borderRadius: "10px",
|
|
@@ -5393,26 +5397,26 @@ const Ls = [
|
|
|
5393
5397
|
color: "#fff",
|
|
5394
5398
|
fontSize: "14px",
|
|
5395
5399
|
fontWeight: 600,
|
|
5396
|
-
cursor:
|
|
5400
|
+
cursor: a || !u.isValid ? "not-allowed" : "pointer",
|
|
5397
5401
|
flex: h ? "none" : 1,
|
|
5398
5402
|
minWidth: h ? "100%" : "140px",
|
|
5399
|
-
opacity:
|
|
5403
|
+
opacity: a || !u.isValid ? 0.6 : 1,
|
|
5400
5404
|
display: "flex",
|
|
5401
5405
|
alignItems: "center",
|
|
5402
5406
|
justifyContent: "center",
|
|
5403
5407
|
gap: "8px",
|
|
5404
5408
|
transition: "all 0.2s ease",
|
|
5405
|
-
boxShadow:
|
|
5409
|
+
boxShadow: a || !u.isValid ? "none" : `0 4px 12px ${s.accent}40`
|
|
5406
5410
|
},
|
|
5407
|
-
onMouseOver: (
|
|
5408
|
-
!
|
|
5411
|
+
onMouseOver: (d) => {
|
|
5412
|
+
!a && u.isValid && (d.currentTarget.style.transform = "translateY(-1px)", d.currentTarget.style.boxShadow = `0 6px 20px ${s.accent}60`);
|
|
5409
5413
|
},
|
|
5410
|
-
onMouseOut: (
|
|
5411
|
-
!
|
|
5414
|
+
onMouseOut: (d) => {
|
|
5415
|
+
!a && u.isValid && (d.currentTarget.style.transform = "translateY(0)", d.currentTarget.style.boxShadow = `0 4px 12px ${s.accent}40`);
|
|
5412
5416
|
},
|
|
5413
|
-
children:
|
|
5417
|
+
children: a ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
5414
5418
|
/* @__PURE__ */ n.jsx(
|
|
5415
|
-
|
|
5419
|
+
oe,
|
|
5416
5420
|
{
|
|
5417
5421
|
size: 16,
|
|
5418
5422
|
style: {
|
|
@@ -5490,14 +5494,14 @@ const Ls = [
|
|
|
5490
5494
|
onClose: e,
|
|
5491
5495
|
onSuccess: r,
|
|
5492
5496
|
onError: s,
|
|
5493
|
-
userId:
|
|
5497
|
+
userId: o,
|
|
5494
5498
|
colors: i
|
|
5495
5499
|
}) => {
|
|
5496
|
-
const { baseUrl:
|
|
5500
|
+
const { baseUrl: a, apiKey: l, appId: h } = ge(), [c, u] = O({
|
|
5497
5501
|
currentPassword: "",
|
|
5498
5502
|
newPassword: "",
|
|
5499
5503
|
confirmPassword: ""
|
|
5500
|
-
}), [b, y] = O({}), [w,
|
|
5504
|
+
}), [b, y] = O({}), [w, d] = O(!1), [j, m] = O({
|
|
5501
5505
|
currentPassword: !1,
|
|
5502
5506
|
newPassword: !1,
|
|
5503
5507
|
confirmPassword: !1
|
|
@@ -5511,7 +5515,7 @@ const Ls = [
|
|
|
5511
5515
|
}, []), !t) return null;
|
|
5512
5516
|
const A = (v) => {
|
|
5513
5517
|
const { name: U, value: q } = v.target;
|
|
5514
|
-
|
|
5518
|
+
u((F) => ({ ...F, [U]: q })), b[U] && y((F) => ({ ...F, [U]: "" }));
|
|
5515
5519
|
}, C = (v) => {
|
|
5516
5520
|
m((U) => ({ ...U, [v]: !U[v] }));
|
|
5517
5521
|
}, M = () => {
|
|
@@ -5519,10 +5523,10 @@ const Ls = [
|
|
|
5519
5523
|
return c.currentPassword || (v.currentPassword = "Current password is required"), c.newPassword ? c.newPassword.length < 6 && (v.newPassword = "Password must be at least 6 characters") : v.newPassword = "New password is required", c.newPassword !== c.confirmPassword && (v.confirmPassword = "Passwords do not match"), y(v), Object.keys(v).length === 0;
|
|
5520
5524
|
}, g = async (v) => {
|
|
5521
5525
|
if (v.preventDefault(), !!M()) {
|
|
5522
|
-
|
|
5526
|
+
d(!0);
|
|
5523
5527
|
try {
|
|
5524
5528
|
const { data: U } = await W.put(
|
|
5525
|
-
`${
|
|
5529
|
+
`${a}/users/change-password/${o}`,
|
|
5526
5530
|
{
|
|
5527
5531
|
appId: h,
|
|
5528
5532
|
currentPassword: c.currentPassword,
|
|
@@ -5534,7 +5538,7 @@ const Ls = [
|
|
|
5534
5538
|
}
|
|
5535
5539
|
}
|
|
5536
5540
|
);
|
|
5537
|
-
U.success ? (r(U.message || "Password updated successfully"),
|
|
5541
|
+
U.success ? (r(U.message || "Password updated successfully"), u({
|
|
5538
5542
|
currentPassword: "",
|
|
5539
5543
|
newPassword: "",
|
|
5540
5544
|
confirmPassword: ""
|
|
@@ -5542,7 +5546,7 @@ const Ls = [
|
|
|
5542
5546
|
} catch (U) {
|
|
5543
5547
|
s(U.response?.data?.message || "Something went wrong");
|
|
5544
5548
|
} finally {
|
|
5545
|
-
|
|
5549
|
+
d(!1);
|
|
5546
5550
|
}
|
|
5547
5551
|
}
|
|
5548
5552
|
}, I = [
|
|
@@ -5870,7 +5874,7 @@ const Ls = [
|
|
|
5870
5874
|
},
|
|
5871
5875
|
children: w ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
5872
5876
|
/* @__PURE__ */ n.jsx(
|
|
5873
|
-
|
|
5877
|
+
oe,
|
|
5874
5878
|
{
|
|
5875
5879
|
size: 16,
|
|
5876
5880
|
style: {
|
|
@@ -5935,24 +5939,24 @@ const Ls = [
|
|
|
5935
5939
|
onClose: e,
|
|
5936
5940
|
onVerify: r,
|
|
5937
5941
|
onSendOTP: s,
|
|
5938
|
-
verifyFormData:
|
|
5942
|
+
verifyFormData: o,
|
|
5939
5943
|
setVerifyFormData: i,
|
|
5940
|
-
otpSent:
|
|
5944
|
+
otpSent: a,
|
|
5941
5945
|
verifying: l,
|
|
5942
5946
|
user: h,
|
|
5943
5947
|
colors: c,
|
|
5944
|
-
darkMode:
|
|
5948
|
+
darkMode: u
|
|
5945
5949
|
}) => {
|
|
5946
5950
|
if (!t) return null;
|
|
5947
5951
|
const b = () => {
|
|
5948
|
-
e(), i({ email: h?.email || "", otp: "", appId:
|
|
5952
|
+
e(), i({ email: h?.email || "", otp: "", appId: o.appId });
|
|
5949
5953
|
};
|
|
5950
5954
|
return /* @__PURE__ */ n.jsxs(
|
|
5951
5955
|
"div",
|
|
5952
5956
|
{
|
|
5953
5957
|
className: "modal-overlay",
|
|
5954
5958
|
style: {
|
|
5955
|
-
backgroundColor:
|
|
5959
|
+
backgroundColor: u ? "rgba(0, 0, 0, 0.8)" : "rgba(0, 0, 0, 0.5)"
|
|
5956
5960
|
},
|
|
5957
5961
|
children: [
|
|
5958
5962
|
/* @__PURE__ */ n.jsxs(
|
|
@@ -5986,7 +5990,7 @@ const Ls = [
|
|
|
5986
5990
|
"input",
|
|
5987
5991
|
{
|
|
5988
5992
|
type: "email",
|
|
5989
|
-
value:
|
|
5993
|
+
value: o.email,
|
|
5990
5994
|
onChange: (y) => i((w) => ({ ...w, email: y.target.value })),
|
|
5991
5995
|
placeholder: "Enter your email",
|
|
5992
5996
|
style: {
|
|
@@ -6001,7 +6005,7 @@ const Ls = [
|
|
|
6001
6005
|
)
|
|
6002
6006
|
] })
|
|
6003
6007
|
] }),
|
|
6004
|
-
|
|
6008
|
+
a && /* @__PURE__ */ n.jsxs("div", { className: "form-group", children: [
|
|
6005
6009
|
/* @__PURE__ */ n.jsx("label", { style: { color: c.textSecondary }, children: "OTP" }),
|
|
6006
6010
|
/* @__PURE__ */ n.jsxs("div", { className: "input-container", children: [
|
|
6007
6011
|
/* @__PURE__ */ n.jsx(cr, { size: 18, style: { color: c.textTertiary }, "aria-hidden": "true" }),
|
|
@@ -6009,7 +6013,7 @@ const Ls = [
|
|
|
6009
6013
|
"input",
|
|
6010
6014
|
{
|
|
6011
6015
|
type: "text",
|
|
6012
|
-
value:
|
|
6016
|
+
value: o.otp,
|
|
6013
6017
|
onChange: (y) => i((w) => ({ ...w, otp: y.target.value })),
|
|
6014
6018
|
placeholder: "Enter OTP",
|
|
6015
6019
|
style: {
|
|
@@ -6024,7 +6028,7 @@ const Ls = [
|
|
|
6024
6028
|
)
|
|
6025
6029
|
] })
|
|
6026
6030
|
] }),
|
|
6027
|
-
/* @__PURE__ */ n.jsx("div", { className: "modal-actions", children:
|
|
6031
|
+
/* @__PURE__ */ n.jsx("div", { className: "modal-actions", children: a ? /* @__PURE__ */ n.jsxs(
|
|
6028
6032
|
"button",
|
|
6029
6033
|
{
|
|
6030
6034
|
type: "submit",
|
|
@@ -6036,7 +6040,7 @@ const Ls = [
|
|
|
6036
6040
|
},
|
|
6037
6041
|
"aria-label": l ? "Verifying email" : "Verify email",
|
|
6038
6042
|
children: [
|
|
6039
|
-
l ? /* @__PURE__ */ n.jsx(
|
|
6043
|
+
l ? /* @__PURE__ */ n.jsx(oe, { size: 16, className: "spinner", "aria-hidden": "true" }) : /* @__PURE__ */ n.jsx(ce, { size: 16, "aria-hidden": "true" }),
|
|
6040
6044
|
l ? "Verifying..." : "Verify Email"
|
|
6041
6045
|
]
|
|
6042
6046
|
}
|
|
@@ -6053,7 +6057,7 @@ const Ls = [
|
|
|
6053
6057
|
},
|
|
6054
6058
|
"aria-label": l ? "Sending OTP" : "Send OTP",
|
|
6055
6059
|
children: [
|
|
6056
|
-
l ? /* @__PURE__ */ n.jsx(
|
|
6060
|
+
l ? /* @__PURE__ */ n.jsx(oe, { size: 16, className: "spinner", "aria-hidden": "true" }) : /* @__PURE__ */ n.jsx(ut, { size: 16, "aria-hidden": "true" }),
|
|
6057
6061
|
l ? "Sending..." : "Send OTP"
|
|
6058
6062
|
]
|
|
6059
6063
|
}
|
|
@@ -6111,7 +6115,7 @@ const Ls = [
|
|
|
6111
6115
|
}
|
|
6112
6116
|
|
|
6113
6117
|
.close-btn:hover {
|
|
6114
|
-
background-color: ${
|
|
6118
|
+
background-color: ${u ? "rgba(255,255,255,0.1)" : "rgba(0,0,0,0.1)"};
|
|
6115
6119
|
}
|
|
6116
6120
|
|
|
6117
6121
|
.verify-form {
|
|
@@ -6213,16 +6217,16 @@ const Ls = [
|
|
|
6213
6217
|
]
|
|
6214
6218
|
}
|
|
6215
6219
|
);
|
|
6216
|
-
},
|
|
6220
|
+
}, mo = ({
|
|
6217
6221
|
token: t,
|
|
6218
6222
|
user: e = null,
|
|
6219
6223
|
darkMode: r = !0,
|
|
6220
6224
|
homeUrl: s,
|
|
6221
|
-
onLogout:
|
|
6225
|
+
onLogout: o,
|
|
6222
6226
|
onVerify: i,
|
|
6223
|
-
primaryColor:
|
|
6227
|
+
primaryColor: a = "#00C212"
|
|
6224
6228
|
}) => {
|
|
6225
|
-
const { baseUrl: l, apiKey: h, appId: c } =
|
|
6229
|
+
const { baseUrl: l, apiKey: h, appId: c } = ge(), [u, b] = O(null), [y, w] = O(e), [d, j] = O(!0), [m, _] = O(!1), [R, A] = O(!1), [C, M] = O(!1), [g, I] = O(!1), [v, U] = O(!1), [q, F] = O(!1), [V, Z] = O(!1), [T, J] = O(!1), [z, P] = O(null), [K, Q] = O(!1), [G, f] = O({
|
|
6226
6230
|
email: "",
|
|
6227
6231
|
otp: "",
|
|
6228
6232
|
appId: c
|
|
@@ -6244,15 +6248,15 @@ const Ls = [
|
|
|
6244
6248
|
};
|
|
6245
6249
|
te(() => {
|
|
6246
6250
|
const E = (H) => {
|
|
6247
|
-
const
|
|
6248
|
-
|
|
6251
|
+
const X = document.querySelector(".dropdown-container");
|
|
6252
|
+
X && !X.contains(H.target) && Y();
|
|
6249
6253
|
};
|
|
6250
6254
|
return V && document.addEventListener("mousedown", E), () => {
|
|
6251
6255
|
document.removeEventListener("mousedown", E);
|
|
6252
6256
|
};
|
|
6253
6257
|
}, [V]);
|
|
6254
6258
|
const se = async () => {
|
|
6255
|
-
if (!
|
|
6259
|
+
if (!G.email || !/\S+@\S+\.\S+/.test(G.email)) {
|
|
6256
6260
|
N("error", "Please enter a valid email");
|
|
6257
6261
|
return;
|
|
6258
6262
|
}
|
|
@@ -6260,7 +6264,7 @@ const Ls = [
|
|
|
6260
6264
|
$(!0);
|
|
6261
6265
|
const E = await W.post(
|
|
6262
6266
|
`${l}/users/send-verify-otp/${y?.id}`,
|
|
6263
|
-
{ email:
|
|
6267
|
+
{ email: G.email },
|
|
6264
6268
|
{
|
|
6265
6269
|
headers: { "x-api-key": h, "x-app-id": c }
|
|
6266
6270
|
}
|
|
@@ -6271,8 +6275,8 @@ const Ls = [
|
|
|
6271
6275
|
} finally {
|
|
6272
6276
|
$(!1);
|
|
6273
6277
|
}
|
|
6274
|
-
},
|
|
6275
|
-
if (E.preventDefault(), !
|
|
6278
|
+
}, ue = async (E) => {
|
|
6279
|
+
if (E.preventDefault(), !G.email || !G.otp) {
|
|
6276
6280
|
N("error", "Please fill in all fields");
|
|
6277
6281
|
return;
|
|
6278
6282
|
}
|
|
@@ -6280,15 +6284,15 @@ const Ls = [
|
|
|
6280
6284
|
$(!0);
|
|
6281
6285
|
const H = await W.post(
|
|
6282
6286
|
`${l}/users/verify-email`,
|
|
6283
|
-
|
|
6287
|
+
G
|
|
6284
6288
|
);
|
|
6285
6289
|
if (H.data.success) {
|
|
6286
6290
|
if (N("success", H.data.message || "Email verified!"), y) {
|
|
6287
|
-
const
|
|
6288
|
-
w(
|
|
6291
|
+
const X = { ...y, isVerified: !0 };
|
|
6292
|
+
w(X), localStorage.setItem(
|
|
6289
6293
|
"userInfo",
|
|
6290
|
-
JSON.stringify({ ...
|
|
6291
|
-
), typeof i == "function" && i(
|
|
6294
|
+
JSON.stringify({ ...X, token: t })
|
|
6295
|
+
), typeof i == "function" && i(X);
|
|
6292
6296
|
}
|
|
6293
6297
|
f({ email: "", otp: "", appId: c }), x(!1), F(!1);
|
|
6294
6298
|
} else
|
|
@@ -6304,15 +6308,15 @@ const Ls = [
|
|
|
6304
6308
|
}, ve = async (E) => {
|
|
6305
6309
|
if (!y) return !1;
|
|
6306
6310
|
try {
|
|
6307
|
-
const H = { ...y, avatarUrl: E }, { data:
|
|
6311
|
+
const H = { ...y, avatarUrl: E }, { data: X } = await W.put(
|
|
6308
6312
|
`${l}/users/update/${y.id}`,
|
|
6309
6313
|
H,
|
|
6310
6314
|
{ headers: { "x-api-key": h } }
|
|
6311
6315
|
);
|
|
6312
|
-
return
|
|
6316
|
+
return X.success ? (w(H), localStorage.setItem(
|
|
6313
6317
|
"userInfo",
|
|
6314
6318
|
JSON.stringify({ ...H, token: t })
|
|
6315
|
-
), N("success", "Avatar updated successfully!"), !0) : (N("error",
|
|
6319
|
+
), N("success", "Avatar updated successfully!"), !0) : (N("error", X.message || "Failed to update avatar"), !1);
|
|
6316
6320
|
} catch (H) {
|
|
6317
6321
|
return console.error("Avatar update error:", H), N("error", "Failed to update avatar"), !1;
|
|
6318
6322
|
}
|
|
@@ -6353,8 +6357,8 @@ const Ls = [
|
|
|
6353
6357
|
else {
|
|
6354
6358
|
const H = localStorage.getItem("userInfo");
|
|
6355
6359
|
if (H) {
|
|
6356
|
-
const
|
|
6357
|
-
w(
|
|
6360
|
+
const X = JSON.parse(H);
|
|
6361
|
+
w(X), j(!1), pt(X.id);
|
|
6358
6362
|
} else
|
|
6359
6363
|
j(!1);
|
|
6360
6364
|
}
|
|
@@ -6363,8 +6367,8 @@ const Ls = [
|
|
|
6363
6367
|
y?.email && f((E) => ({ ...E, email: y.email }));
|
|
6364
6368
|
}, [y?.email]);
|
|
6365
6369
|
const ft = (E, H) => {
|
|
6366
|
-
let
|
|
6367
|
-
return
|
|
6370
|
+
let X = parseInt(E.replace("#", ""), 16), pe = (X >> 16) + H, He = (X >> 8 & 255) + H, Ve = (X & 255) + H;
|
|
6371
|
+
return pe = Math.min(255, Math.max(0, pe)), He = Math.min(255, Math.max(0, He)), Ve = Math.min(255, Math.max(0, Ve)), `#${(Ve | He << 8 | pe << 16).toString(16).padStart(6, "0")}`;
|
|
6368
6372
|
}, D = r ? {
|
|
6369
6373
|
background: "#000000",
|
|
6370
6374
|
surface: "#09090b",
|
|
@@ -6373,8 +6377,8 @@ const Ls = [
|
|
|
6373
6377
|
textPrimary: "#ffffff",
|
|
6374
6378
|
textSecondary: "#d4d4d8",
|
|
6375
6379
|
textTertiary: "#a1a1aa",
|
|
6376
|
-
accent:
|
|
6377
|
-
accentHover: ft(
|
|
6380
|
+
accent: a,
|
|
6381
|
+
accentHover: ft(a, -15),
|
|
6378
6382
|
success: "#10b981",
|
|
6379
6383
|
error: "#ef4444",
|
|
6380
6384
|
border: "#27272a",
|
|
@@ -6387,14 +6391,14 @@ const Ls = [
|
|
|
6387
6391
|
textPrimary: "#18181b",
|
|
6388
6392
|
textSecondary: "#52525b",
|
|
6389
6393
|
textTertiary: "#71717a",
|
|
6390
|
-
accent:
|
|
6391
|
-
accentHover: ft(
|
|
6394
|
+
accent: a,
|
|
6395
|
+
accentHover: ft(a, -15),
|
|
6392
6396
|
success: "#10b981",
|
|
6393
6397
|
error: "#ef4444",
|
|
6394
6398
|
border: "#e4e4e7",
|
|
6395
6399
|
warning: "#d97706"
|
|
6396
6400
|
};
|
|
6397
|
-
if (
|
|
6401
|
+
if (d)
|
|
6398
6402
|
return /* @__PURE__ */ n.jsx(
|
|
6399
6403
|
"div",
|
|
6400
6404
|
{
|
|
@@ -6419,7 +6423,7 @@ const Ls = [
|
|
|
6419
6423
|
},
|
|
6420
6424
|
children: [
|
|
6421
6425
|
/* @__PURE__ */ n.jsx(
|
|
6422
|
-
|
|
6426
|
+
oe,
|
|
6423
6427
|
{
|
|
6424
6428
|
size: 40,
|
|
6425
6429
|
color: D.accent,
|
|
@@ -6562,14 +6566,14 @@ const Ls = [
|
|
|
6562
6566
|
display: "grid",
|
|
6563
6567
|
gap: "24px",
|
|
6564
6568
|
gridTemplateColumns: "1fr",
|
|
6565
|
-
...
|
|
6569
|
+
...u && window.innerWidth >= 1024 && {
|
|
6566
6570
|
gridTemplateColumns: "1fr 2fr",
|
|
6567
6571
|
gap: "10px"
|
|
6568
6572
|
},
|
|
6569
|
-
...
|
|
6573
|
+
...u && window.innerWidth >= 768 && u && window.innerWidth < 1024 && {
|
|
6570
6574
|
gap: "10px"
|
|
6571
6575
|
},
|
|
6572
|
-
...
|
|
6576
|
+
...u && window.innerWidth >= 600 && u && window.innerWidth < 768 && {
|
|
6573
6577
|
gap: "28px"
|
|
6574
6578
|
}
|
|
6575
6579
|
},
|
|
@@ -6754,7 +6758,7 @@ const Ls = [
|
|
|
6754
6758
|
gap: "8px",
|
|
6755
6759
|
textDecoration: "none",
|
|
6756
6760
|
minHeight: "36px",
|
|
6757
|
-
flex:
|
|
6761
|
+
flex: u && window.innerWidth < 1024 ? "1" : "auto"
|
|
6758
6762
|
},
|
|
6759
6763
|
children: [
|
|
6760
6764
|
/* @__PURE__ */ n.jsx(Pe, { size: 16, "aria-hidden": "true" }),
|
|
@@ -6784,11 +6788,11 @@ const Ls = [
|
|
|
6784
6788
|
gap: "8px",
|
|
6785
6789
|
textDecoration: "none",
|
|
6786
6790
|
minHeight: "36px",
|
|
6787
|
-
flex:
|
|
6791
|
+
flex: u && window.innerWidth < 1024 ? "1" : "auto"
|
|
6788
6792
|
},
|
|
6789
6793
|
children: [
|
|
6790
6794
|
R ? /* @__PURE__ */ n.jsx(
|
|
6791
|
-
|
|
6795
|
+
oe,
|
|
6792
6796
|
{
|
|
6793
6797
|
size: 16,
|
|
6794
6798
|
style: { animation: "spin 1s linear infinite" },
|
|
@@ -6820,7 +6824,7 @@ const Ls = [
|
|
|
6820
6824
|
gap: "8px",
|
|
6821
6825
|
textDecoration: "none",
|
|
6822
6826
|
minHeight: "36px",
|
|
6823
|
-
flex:
|
|
6827
|
+
flex: u && window.innerWidth < 1024 ? "1" : "auto"
|
|
6824
6828
|
},
|
|
6825
6829
|
children: [
|
|
6826
6830
|
/* @__PURE__ */ n.jsx(Es, { size: 16, "aria-hidden": "true" }),
|
|
@@ -6850,11 +6854,11 @@ const Ls = [
|
|
|
6850
6854
|
gap: "8px",
|
|
6851
6855
|
minHeight: "36px",
|
|
6852
6856
|
opacity: K ? 0.7 : 1,
|
|
6853
|
-
flex:
|
|
6857
|
+
flex: u && window.innerWidth < 1024 ? "1" : "auto"
|
|
6854
6858
|
},
|
|
6855
6859
|
children: [
|
|
6856
6860
|
K ? /* @__PURE__ */ n.jsx(
|
|
6857
|
-
|
|
6861
|
+
oe,
|
|
6858
6862
|
{
|
|
6859
6863
|
size: 14,
|
|
6860
6864
|
style: { animation: "spin 1s linear infinite" },
|
|
@@ -6890,7 +6894,7 @@ const Ls = [
|
|
|
6890
6894
|
},
|
|
6891
6895
|
onClick: () => Z(!V),
|
|
6892
6896
|
children: [
|
|
6893
|
-
/* @__PURE__ */ n.jsx(
|
|
6897
|
+
/* @__PURE__ */ n.jsx(as, { size: 16, "aria-hidden": "true" }),
|
|
6894
6898
|
"More Actions"
|
|
6895
6899
|
]
|
|
6896
6900
|
}
|
|
@@ -6943,11 +6947,11 @@ const Ls = [
|
|
|
6943
6947
|
]
|
|
6944
6948
|
}
|
|
6945
6949
|
),
|
|
6946
|
-
|
|
6950
|
+
o && /* @__PURE__ */ n.jsxs(
|
|
6947
6951
|
"button",
|
|
6948
6952
|
{
|
|
6949
6953
|
onClick: () => {
|
|
6950
|
-
|
|
6954
|
+
o(), Y();
|
|
6951
6955
|
},
|
|
6952
6956
|
style: {
|
|
6953
6957
|
width: "100%",
|
|
@@ -7060,7 +7064,7 @@ const Ls = [
|
|
|
7060
7064
|
display: "grid",
|
|
7061
7065
|
gap: "20px",
|
|
7062
7066
|
gridTemplateColumns: "1fr",
|
|
7063
|
-
...
|
|
7067
|
+
...u && window.innerWidth >= 600 && {
|
|
7064
7068
|
gridTemplateColumns: "1fr 1fr",
|
|
7065
7069
|
gap: "20px"
|
|
7066
7070
|
}
|
|
@@ -7099,13 +7103,13 @@ const Ls = [
|
|
|
7099
7103
|
type: E.type,
|
|
7100
7104
|
name: E.name,
|
|
7101
7105
|
value: y[E.name],
|
|
7102
|
-
onChange: (
|
|
7103
|
-
(
|
|
7106
|
+
onChange: (X) => w(
|
|
7107
|
+
(pe) => pe && { ...pe, [X.target.name]: X.target.value }
|
|
7104
7108
|
),
|
|
7105
7109
|
style: {
|
|
7106
7110
|
padding: "12px",
|
|
7107
7111
|
borderRadius: "8px",
|
|
7108
|
-
border: `1px solid ${
|
|
7112
|
+
border: `1px solid ${a}`,
|
|
7109
7113
|
backgroundColor: "transparent",
|
|
7110
7114
|
color: D.textPrimary,
|
|
7111
7115
|
fontSize: "12px",
|
|
@@ -7323,9 +7327,9 @@ const Ls = [
|
|
|
7323
7327
|
onClose: () => {
|
|
7324
7328
|
F(!1), x(!1), f({ email: y?.email || "", otp: "", appId: c });
|
|
7325
7329
|
},
|
|
7326
|
-
onVerify:
|
|
7330
|
+
onVerify: ue,
|
|
7327
7331
|
onSendOTP: se,
|
|
7328
|
-
verifyFormData:
|
|
7332
|
+
verifyFormData: G,
|
|
7329
7333
|
setVerifyFormData: f,
|
|
7330
7334
|
otpSent: S,
|
|
7331
7335
|
verifying: k,
|
|
@@ -7426,27 +7430,27 @@ const Ls = [
|
|
|
7426
7430
|
]
|
|
7427
7431
|
}
|
|
7428
7432
|
);
|
|
7429
|
-
},
|
|
7433
|
+
}, yo = ({
|
|
7430
7434
|
darkMode: t = !0,
|
|
7431
7435
|
primaryColor: e = "#3b82f6",
|
|
7432
7436
|
onLogout: r,
|
|
7433
7437
|
varient: s = "classic",
|
|
7434
|
-
propUser:
|
|
7438
|
+
propUser: o,
|
|
7435
7439
|
className: i = "",
|
|
7436
7440
|
// New URL props with defaults
|
|
7437
|
-
profileUrl:
|
|
7441
|
+
profileUrl: a,
|
|
7438
7442
|
settingsUrl: l,
|
|
7439
7443
|
// Menu item visibility with defaults
|
|
7440
7444
|
showProfileMenuItem: h = !0,
|
|
7441
7445
|
showSettingsMenuItem: c = !0,
|
|
7442
|
-
showViewProfileMenuItem:
|
|
7446
|
+
showViewProfileMenuItem: u = !0,
|
|
7443
7447
|
// Custom labels with defaults
|
|
7444
7448
|
profileLabel: b = "My Profile",
|
|
7445
7449
|
settingsLabel: y = "Settings",
|
|
7446
7450
|
viewProfileLabel: w = "View Profile",
|
|
7447
|
-
logoutLabel:
|
|
7451
|
+
logoutLabel: d = "Sign Out"
|
|
7448
7452
|
}) => {
|
|
7449
|
-
const { baseUrl: j, apiKey: m, appId: _ } =
|
|
7453
|
+
const { baseUrl: j, apiKey: m, appId: _ } = ge(), [R, A] = O(!1), [C, M] = O(null), [g, I] = O(!0), [v, U] = O(null), q = xt(null), F = xt(null), [V, Z] = O(!1), [T, J] = O(!1);
|
|
7450
7454
|
te(() => {
|
|
7451
7455
|
if (typeof window > "u") return;
|
|
7452
7456
|
const x = () => {
|
|
@@ -7456,10 +7460,10 @@ const Ls = [
|
|
|
7456
7460
|
}, []), te(() => {
|
|
7457
7461
|
(async () => {
|
|
7458
7462
|
try {
|
|
7459
|
-
if (I(!0), U(null),
|
|
7460
|
-
if (!
|
|
7463
|
+
if (I(!0), U(null), o) {
|
|
7464
|
+
if (!o.id || !o.name || !o.email)
|
|
7461
7465
|
throw new Error("Invalid user data provided");
|
|
7462
|
-
M(
|
|
7466
|
+
M(o);
|
|
7463
7467
|
} else if (typeof window < "u") {
|
|
7464
7468
|
const k = localStorage.getItem("userInfo");
|
|
7465
7469
|
if (k)
|
|
@@ -7478,13 +7482,13 @@ const Ls = [
|
|
|
7478
7482
|
I(!1);
|
|
7479
7483
|
}
|
|
7480
7484
|
})();
|
|
7481
|
-
}, [
|
|
7485
|
+
}, [o]), te(() => {
|
|
7482
7486
|
if (typeof window > "u") return;
|
|
7483
7487
|
const x = () => {
|
|
7484
7488
|
if (!R || !F.current) return;
|
|
7485
|
-
const k = F.current.getBoundingClientRect(), $ = window.innerWidth, N = window.innerHeight, Y = 280, se = $ - k.right,
|
|
7489
|
+
const k = F.current.getBoundingClientRect(), $ = window.innerWidth, N = window.innerHeight, Y = 280, se = $ - k.right, ue = k.left;
|
|
7486
7490
|
N - k.bottom;
|
|
7487
|
-
const ve = se >= Y || se >
|
|
7491
|
+
const ve = se >= Y || se > ue;
|
|
7488
7492
|
Z(ve);
|
|
7489
7493
|
};
|
|
7490
7494
|
return x(), window.addEventListener("resize", x), () => window.removeEventListener("resize", x);
|
|
@@ -7725,7 +7729,7 @@ const Ls = [
|
|
|
7725
7729
|
if (x) {
|
|
7726
7730
|
const k = JSON.parse(x);
|
|
7727
7731
|
M(k);
|
|
7728
|
-
} else
|
|
7732
|
+
} else o && M(o);
|
|
7729
7733
|
} catch (x) {
|
|
7730
7734
|
console.error("Retry failed:", x), U("Invalid user data"), localStorage.removeItem("userInfo"), M(null);
|
|
7731
7735
|
} finally {
|
|
@@ -7733,8 +7737,8 @@ const Ls = [
|
|
|
7733
7737
|
}
|
|
7734
7738
|
}, Q = (x, k) => {
|
|
7735
7739
|
(x.key === "Enter" || x.key === " ") && (x.preventDefault(), k());
|
|
7736
|
-
},
|
|
7737
|
-
const x =
|
|
7740
|
+
}, G = () => a || C?.profileUrl, f = () => {
|
|
7741
|
+
const x = G();
|
|
7738
7742
|
x && window.open(x, "_self", "noopener,noreferrer");
|
|
7739
7743
|
}, S = () => {
|
|
7740
7744
|
l && window.open(l, "_self", "noopener,noreferrer");
|
|
@@ -7886,7 +7890,7 @@ const Ls = [
|
|
|
7886
7890
|
] })
|
|
7887
7891
|
] }),
|
|
7888
7892
|
/* @__PURE__ */ n.jsxs("div", { style: P.dropdownSection, children: [
|
|
7889
|
-
h &&
|
|
7893
|
+
h && G() && /* @__PURE__ */ n.jsxs(
|
|
7890
7894
|
"button",
|
|
7891
7895
|
{
|
|
7892
7896
|
style: P.menuItem,
|
|
@@ -7926,7 +7930,7 @@ const Ls = [
|
|
|
7926
7930
|
]
|
|
7927
7931
|
}
|
|
7928
7932
|
),
|
|
7929
|
-
|
|
7933
|
+
u && C.profileUrl && /* @__PURE__ */ n.jsxs(
|
|
7930
7934
|
"a",
|
|
7931
7935
|
{
|
|
7932
7936
|
href: C.profileUrl,
|
|
@@ -7970,7 +7974,7 @@ const Ls = [
|
|
|
7970
7974
|
"aria-hidden": "true"
|
|
7971
7975
|
}
|
|
7972
7976
|
),
|
|
7973
|
-
/* @__PURE__ */ n.jsx("span", { style: P.menuItemText, children:
|
|
7977
|
+
/* @__PURE__ */ n.jsx("span", { style: P.menuItemText, children: d })
|
|
7974
7978
|
]
|
|
7975
7979
|
}
|
|
7976
7980
|
) })
|
|
@@ -8003,17 +8007,17 @@ const Ls = [
|
|
|
8003
8007
|
]
|
|
8004
8008
|
}
|
|
8005
8009
|
);
|
|
8006
|
-
},
|
|
8010
|
+
}, bo = ({
|
|
8007
8011
|
user: t,
|
|
8008
8012
|
darkMode: e = !0,
|
|
8009
8013
|
primaryColor: r = "#00C212",
|
|
8010
8014
|
onVerify: s
|
|
8011
8015
|
}) => {
|
|
8012
|
-
const { appId:
|
|
8016
|
+
const { appId: o, baseUrl: i, apiKey: a } = ge(), [l, h] = O({
|
|
8013
8017
|
email: t?.email || "",
|
|
8014
8018
|
otp: "",
|
|
8015
|
-
appId:
|
|
8016
|
-
}), [c,
|
|
8019
|
+
appId: o
|
|
8020
|
+
}), [c, u] = O(!1), [b, y] = O(!1), [w, d] = O(null), j = (g, I) => {
|
|
8017
8021
|
let v = parseInt(g.replace("#", ""), 16), U = (v >> 16) + I, q = (v >> 8 & 255) + I, F = (v & 255) + I;
|
|
8018
8022
|
return U = Math.min(255, Math.max(0, U)), q = Math.min(255, Math.max(0, q)), F = Math.min(255, Math.max(0, F)), `#${(F | q << 8 | U << 16).toString(16).padStart(6, "0")}`;
|
|
8019
8023
|
}, m = e ? {
|
|
@@ -8043,7 +8047,7 @@ const Ls = [
|
|
|
8043
8047
|
t?.email && h((g) => ({ ...g, email: t.email }));
|
|
8044
8048
|
}, [t?.email]);
|
|
8045
8049
|
const _ = (g, I) => {
|
|
8046
|
-
|
|
8050
|
+
d({ type: g, message: I }), setTimeout(() => d(null), 3e3);
|
|
8047
8051
|
}, R = async () => {
|
|
8048
8052
|
if (!l.email || !/\S+@\S+\.\S+/.test(l.email)) {
|
|
8049
8053
|
_("error", "Please enter a valid email");
|
|
@@ -8054,9 +8058,9 @@ const Ls = [
|
|
|
8054
8058
|
const g = await W.post(
|
|
8055
8059
|
`${i}/users/send-verify-otp/${t?.id}`,
|
|
8056
8060
|
{ email: l.email },
|
|
8057
|
-
{ headers: { "x-api-key":
|
|
8061
|
+
{ headers: { "x-api-key": a, "x-app-id": o } }
|
|
8058
8062
|
);
|
|
8059
|
-
g.data.success ? (_("success", g.data.message || "OTP sent!"),
|
|
8063
|
+
g.data.success ? (_("success", g.data.message || "OTP sent!"), u(!0)) : _("error", g.data.message || "Failed to send OTP");
|
|
8060
8064
|
} catch (g) {
|
|
8061
8065
|
_("error", g.response?.data?.message || "Server error");
|
|
8062
8066
|
} finally {
|
|
@@ -8072,7 +8076,7 @@ const Ls = [
|
|
|
8072
8076
|
const I = await W.post(`${i}/users/verify-email`, l);
|
|
8073
8077
|
if (I.data.success && t) {
|
|
8074
8078
|
const v = { ...t, isVerified: !0 };
|
|
8075
|
-
s?.(v), _("success", I.data.message || "Email verified!"),
|
|
8079
|
+
s?.(v), _("success", I.data.message || "Email verified!"), u(!1), h({ email: t.email, otp: "", appId: o });
|
|
8076
8080
|
} else
|
|
8077
8081
|
_("error", I.data.message || "Verification failed");
|
|
8078
8082
|
} catch (I) {
|
|
@@ -8203,7 +8207,7 @@ const Ls = [
|
|
|
8203
8207
|
] })
|
|
8204
8208
|
] }),
|
|
8205
8209
|
/* @__PURE__ */ n.jsx("div", { style: { display: "flex", gap: 12 }, children: c ? /* @__PURE__ */ n.jsxs("button", { type: "submit", disabled: b, style: M(b), children: [
|
|
8206
|
-
b ? /* @__PURE__ */ n.jsx(
|
|
8210
|
+
b ? /* @__PURE__ */ n.jsx(oe, { size: 16, className: "spinner" }) : /* @__PURE__ */ n.jsx(ce, { size: 16 }),
|
|
8207
8211
|
b ? "Verifying..." : "Verify Email"
|
|
8208
8212
|
] }) : /* @__PURE__ */ n.jsxs(
|
|
8209
8213
|
"button",
|
|
@@ -8213,7 +8217,7 @@ const Ls = [
|
|
|
8213
8217
|
disabled: b,
|
|
8214
8218
|
style: M(b),
|
|
8215
8219
|
children: [
|
|
8216
|
-
b ? /* @__PURE__ */ n.jsx(
|
|
8220
|
+
b ? /* @__PURE__ */ n.jsx(oe, { size: 16, className: "spinner" }) : /* @__PURE__ */ n.jsx(ut, { size: 16 }),
|
|
8217
8221
|
b ? "Sending..." : "Send OTP"
|
|
8218
8222
|
]
|
|
8219
8223
|
}
|
|
@@ -8223,14 +8227,14 @@ const Ls = [
|
|
|
8223
8227
|
);
|
|
8224
8228
|
};
|
|
8225
8229
|
export {
|
|
8226
|
-
|
|
8227
|
-
|
|
8228
|
-
|
|
8229
|
-
|
|
8230
|
-
|
|
8231
|
-
|
|
8232
|
-
|
|
8233
|
-
|
|
8234
|
-
|
|
8235
|
-
|
|
8230
|
+
uo as NeuctraAuthix,
|
|
8231
|
+
bo as ReactEmailVerification,
|
|
8232
|
+
ho as ReactSignedIn,
|
|
8233
|
+
go as ReactSignedOut,
|
|
8234
|
+
yo as ReactUserButton,
|
|
8235
|
+
xo as ReactUserLogin,
|
|
8236
|
+
mo as ReactUserProfile,
|
|
8237
|
+
fo as ReactUserSignUp,
|
|
8238
|
+
ge as getSdkConfig,
|
|
8239
|
+
po as setSdkConfig
|
|
8236
8240
|
};
|